@agile-team/mach-report 2.22.0 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/ExcelBindingWizard-BrTmdo7f.cjs +1 -0
- package/dist/ExcelBindingWizard-CcDMLO8Q.js +1486 -0
- package/dist/ParamEditor-BGjovFUe.js +737 -0
- package/dist/ParamEditor-CeNp4_zQ.cjs +1 -0
- package/dist/ReportBatchPanel-CHxBtG9R.cjs +1 -0
- package/dist/ReportBatchPanel-CJB67WNd.js +351 -0
- package/dist/ReportLabelStudio-Tplc1TLJ.js +784 -0
- package/dist/ReportLabelStudio-g8PkqJWn.cjs +1 -0
- package/dist/ReportParamPanel-C7fZTllk.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-GI43aGa0.js} +146 -127
- package/dist/ReportPreview-BoGBGyRr.cjs +6 -0
- package/dist/ReportPreview-QLONCyci.js +6257 -0
- package/dist/ReportTemplateLibrary-BFQIX0sg.cjs +1 -0
- package/dist/ReportTemplateLibrary-KqX4E2sN.js +312 -0
- package/dist/RuleEditor-BZUP9yvL.cjs +1 -0
- package/dist/RuleEditor-OPX1awrH.js +2342 -0
- package/dist/TemplateOutlinePanel-CVYKVLv_.cjs +1 -0
- package/dist/TemplateOutlinePanel-DQS-eOs6.js +97 -0
- package/dist/TemplateReusePanel-CY6O93Zk.cjs +1 -0
- package/dist/TemplateReusePanel-DKXiFTyB.js +389 -0
- package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +1 -0
- package/dist/TemplateReviewPanel-Dijwm9YE.js +593 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-BB99S802.js +257 -0
- package/dist/auto-BrPWo7Xm.cjs +1 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-BZoVWTgl.js +7172 -0
- package/dist/designer-zS2uKJmY.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +105 -45
- package/dist/designer.d.ts +105 -45
- package/dist/designer.js +4 -4
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-7lquyj0w.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CEd-dq9A.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-CNWXomuV.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-D8pI87fL.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-BRnzKudk.js} +763 -776
- package/dist/json-snapshot-DNiIbpOr.cjs +2 -0
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-DmlnL5eB.js → pdf-CJToa81Z.js} +20 -20
- package/dist/{pdf-CARdBcuw.cjs → pdf-DpMkW72B.cjs} +42 -42
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BWTp-X7b.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-_BkUVc2z.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-CWGdnqQd.js} +21 -21
- package/dist/prefill-PaAy6wLk.cjs +1 -0
- package/dist/prepared-CJy_qk7d.js +94 -0
- package/dist/prepared-D0yCSxSO.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-fjaeKkjf.js → protocol-BG16rz6D.js} +3 -3
- package/dist/{protocol-C9ZaylID.cjs → protocol-wzhl1Fim.cjs} +1 -1
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/runtime-DYMOS_gz.cjs +1 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-PiCax9zQ.js} +52 -51
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1676 -1619
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog-CRuZL3pi.js} +17 -17
- package/dist/template-catalog-DtrtT1FY.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/textwrap-D4ZksyMK.js +111 -0
- package/dist/textwrap-DEHqAjKZ.cjs +4 -0
- package/dist/vue/async.d.cts +31 -0
- package/dist/vue/async.d.ts +31 -0
- package/dist/vue/index.d.cts +32 -1
- package/dist/vue/index.d.ts +32 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-CW79I6Gl.cjs +0 -1
- package/dist/ExcelBindingWizard-CZyppD7I.js +0 -1485
- package/dist/ParamEditor-CiYCJI0b.cjs +0 -1
- package/dist/ParamEditor-DQit-Gdf.js +0 -732
- package/dist/ReportBatchPanel-DKTpV7MU.js +0 -350
- package/dist/ReportBatchPanel-Db6TAfG5.cjs +0 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportLabelStudio-BYnRqmje.js +0 -780
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/ReportTemplateLibrary-BZuKn0YK.js +0 -311
- package/dist/ReportTemplateLibrary-DEXH07ND.cjs +0 -1
- package/dist/RuleEditor-CIQn547x.js +0 -2341
- package/dist/RuleEditor-zSUmPjKa.cjs +0 -1
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/TemplateOutlinePanel-D0PgOSQE.js +0 -96
- package/dist/TemplateReusePanel-BKlAEF8-.js +0 -388
- package/dist/TemplateReusePanel-DAy_Hwqz.cjs +0 -1
- package/dist/TemplateReviewPanel-CowmHaQQ.cjs +0 -1
- package/dist/TemplateReviewPanel-div-EH_m.js +0 -592
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-CkGjRFT3.js +0 -110
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import { computed as W, ref as _, shallowRef as K, watch as O, onBeforeUnmount as oe, defineComponent as re, openBlock as u, createElementBlock as c, unref as e, createElementVNode as i, toDisplayString as l, withDirectives as F, withKeys as ae, isRef as z, vModelText as Y, Fragment as j, renderList as J, vModelSelect as le, createCommentVNode as g, createTextVNode as G, withModifiers as ie, normalizeClass as se } from "vue";
|
|
2
|
-
import { parseReportTemplate as M, cloneReportTemplate as ne } from "@agile-team/mach-report";
|
|
3
|
-
import { a as de } from "./designer-B7jJeAeG.js";
|
|
4
|
-
import { _ as ue } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
5
|
-
function ce(r) {
|
|
6
|
-
return !r || typeof r.id != "string" || !r.id.trim() || typeof r.name != "string" || !r.name.trim() || [r.draftRevision, r.publishedRevision].some((p) => p !== void 0 && (typeof p != "string" || !p.trim())) ? !1 : r.tags === void 0 || Array.isArray(r.tags) && r.tags.length <= 20 && r.tags.every((p) => typeof p == "string");
|
|
7
|
-
}
|
|
8
|
-
function ve(r) {
|
|
9
|
-
if (!r || !Array.isArray(r.items) || r.items.length > 100 || r.next !== void 0 && (typeof r.next != "string" || !r.next || r.next.length > 4096)) throw new Error("invalid");
|
|
10
|
-
const p = /* @__PURE__ */ new Set();
|
|
11
|
-
for (const d of r.items) {
|
|
12
|
-
if (!ce(d) || p.has(d.id)) throw new Error("invalid");
|
|
13
|
-
p.add(d.id);
|
|
14
|
-
}
|
|
15
|
-
if (r.categories !== void 0 && (!Array.isArray(r.categories) || r.categories.length > 1e3 || r.categories.some((d) => !d || typeof d.id != "string" || !d.id || typeof d.label != "string"))) throw new Error("invalid");
|
|
16
|
-
}
|
|
17
|
-
function ye(r, p) {
|
|
18
|
-
const d = W(() => ({ ...de, ...r.messages })), N = _(""), a = _(""), D = K([]), L = K([]), f = _([void 0]), w = _(), S = _(!1), T = _(!1), m = _(""), v = K(), q = _(""), $ = _(""), k = _("search"), x = _(""), E = K();
|
|
19
|
-
let h = 0, C = 0, P, I, V;
|
|
20
|
-
const B = W(() => ({ search: d.value.retrySearch, open: d.value.retryOpen, copy: d.value.retryCopy })[k.value]);
|
|
21
|
-
function A() {
|
|
22
|
-
m.value = "", E.value = void 0;
|
|
23
|
-
}
|
|
24
|
-
function s(t, n) {
|
|
25
|
-
if (ve(t), t.next !== void 0 && (t.next === n.cursor || !n.previous && f.value.includes(t.next))) throw new Error(d.value.stale);
|
|
26
|
-
D.value = t.items.map((y) => ({ ...y, ...y.tags ? { tags: [...y.tags] } : {} })), w.value = t.next, n.previous ? f.value = f.value.slice(0, -1) : n.more && (f.value = [...f.value, n.cursor]), t.categories && (L.value = t.categories);
|
|
27
|
-
}
|
|
28
|
-
function o(t) {
|
|
29
|
-
return t instanceof Error ? t.message === "invalid" ? d.value.invalid : t.message : String(t);
|
|
30
|
-
}
|
|
31
|
-
async function R(t) {
|
|
32
|
-
clearTimeout(V), P?.abort();
|
|
33
|
-
const n = ++h, y = new AbortController();
|
|
34
|
-
P = y, S.value = !0, A(), !t.more && !t.previous && (D.value = [], w.value = void 0, f.value = [void 0]);
|
|
35
|
-
try {
|
|
36
|
-
const b = await r.provider.search({ query: t.query, category: t.category, cursor: t.cursor, limit: 30, signal: y.signal });
|
|
37
|
-
if (n !== h) return;
|
|
38
|
-
s(b, t);
|
|
39
|
-
} catch (b) {
|
|
40
|
-
n === h && !y.signal.aborted && (m.value = o(b), k.value = "search", E.value = () => R(t));
|
|
41
|
-
} finally {
|
|
42
|
-
n === h && (S.value = !1);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
async function U(t = !1, n = !1) {
|
|
46
|
-
t && !w.value || n && f.value.length < 2 || await R({ query: N.value.trim(), category: a.value || void 0, cursor: n ? f.value.at(-2) : t ? w.value : void 0, more: t, previous: n });
|
|
47
|
-
}
|
|
48
|
-
async function X(t, n, y) {
|
|
49
|
-
if (t.savedDocument) return M(t.savedDocument);
|
|
50
|
-
if (t.candidate) return M(t.candidate);
|
|
51
|
-
const b = await r.provider.get(t.entry.id, { signal: n, mode: t.mode });
|
|
52
|
-
if (y !== C) return;
|
|
53
|
-
if (!b || b.id !== t.entry.id) throw new Error(d.value.missing);
|
|
54
|
-
const H = M(b);
|
|
55
|
-
if (t.mode === "published" && t.entry.publishedRevision !== H.revision) throw new Error(d.value.publicationChanged);
|
|
56
|
-
return t.copy ? (t.candidate = ne(H, t.identity), M(t.candidate)) : H;
|
|
57
|
-
}
|
|
58
|
-
async function Q(t) {
|
|
59
|
-
if (T.value) return;
|
|
60
|
-
const n = ++C, y = new AbortController();
|
|
61
|
-
I = y, T.value = !0, A(), x.value = (t.copy && !t.savedDocument ? d.value.creatingTarget : d.value.openingTarget).replace("{name}", t.savedDocument?.name ?? t.entry.name);
|
|
62
|
-
try {
|
|
63
|
-
let b = await X(t, y.signal, n);
|
|
64
|
-
if (!b || n !== C) return;
|
|
65
|
-
if (t.copy && !t.savedDocument) {
|
|
66
|
-
if (!t.create || (b = M(await t.create(b, { signal: y.signal })), n !== C)) return;
|
|
67
|
-
if (b.id !== t.identity.id) throw new Error(d.value.invalid);
|
|
68
|
-
t.savedDocument = M(b), v.value = void 0;
|
|
69
|
-
}
|
|
70
|
-
p(b, { mode: t.mode }), t.copy && U();
|
|
71
|
-
} catch (b) {
|
|
72
|
-
n === C && !y.signal.aborted && (m.value = o(b), k.value = t.copy && !t.savedDocument ? "copy" : "open", E.value = () => Q(t));
|
|
73
|
-
} finally {
|
|
74
|
-
n === C && (T.value = !1, x.value = "");
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async function Z(t, n = !1, y = "edit") {
|
|
78
|
-
await Q({ entry: { ...t }, copy: n, mode: n ? "edit" : y, identity: { id: q.value.trim(), name: $.value.trim() }, create: r.create });
|
|
79
|
-
}
|
|
80
|
-
function ee() {
|
|
81
|
-
h++, P?.abort(), D.value = [], w.value = void 0, f.value = [void 0], S.value = !0, A(), clearTimeout(V), V = setTimeout(() => {
|
|
82
|
-
U();
|
|
83
|
-
}, 180);
|
|
84
|
-
}
|
|
85
|
-
function te() {
|
|
86
|
-
C++, I?.abort(), T.value = !1, x.value = "", v.value = void 0, U();
|
|
87
|
-
}
|
|
88
|
-
return O([N, a], ee), O([() => r.provider, () => r.create], te), O([q, $], () => {
|
|
89
|
-
k.value === "copy" && A();
|
|
90
|
-
}), oe(() => {
|
|
91
|
-
h++, C++, clearTimeout(V), P?.abort(), I?.abort();
|
|
92
|
-
}), U(), {
|
|
93
|
-
m: d,
|
|
94
|
-
cursors: f,
|
|
95
|
-
query: N,
|
|
96
|
-
category: a,
|
|
97
|
-
entries: D,
|
|
98
|
-
categories: L,
|
|
99
|
-
next: w,
|
|
100
|
-
loading: S,
|
|
101
|
-
busy: T,
|
|
102
|
-
error: m,
|
|
103
|
-
errorKind: k,
|
|
104
|
-
retryLabel: B,
|
|
105
|
-
loadingTarget: x,
|
|
106
|
-
copying: v,
|
|
107
|
-
newId: q,
|
|
108
|
-
newName: $,
|
|
109
|
-
search: U,
|
|
110
|
-
load: Z,
|
|
111
|
-
retry: async () => {
|
|
112
|
-
!T.value && !S.value && await E.value?.();
|
|
113
|
-
},
|
|
114
|
-
beginCopy: (t) => {
|
|
115
|
-
A(), v.value = t, q.value = "", $.value = t.name;
|
|
116
|
-
},
|
|
117
|
-
cancelCopy: () => {
|
|
118
|
-
T.value || (v.value = void 0, A());
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
const be = ["aria-label", "aria-busy"], fe = ["disabled"], me = { class: "mr-library-search" }, pe = ["placeholder", "aria-label"], ge = ["aria-label"], he = { value: "" }, _e = ["value"], we = {
|
|
123
|
-
key: 0,
|
|
124
|
-
class: "mr-library-progress",
|
|
125
|
-
role: "status"
|
|
126
|
-
}, ke = {
|
|
127
|
-
key: 1,
|
|
128
|
-
role: "alert",
|
|
129
|
-
class: "mr-library-error"
|
|
130
|
-
}, Ce = ["disabled"], Re = ["disabled"], Te = ["disabled"], xe = ["disabled"], Ee = ["disabled"], Ae = { key: 3 }, $e = { class: "mr-library-info" }, De = ["title", "disabled", "onClick"], Se = ["title"], qe = { key: 0 }, Le = { key: 1 }, Pe = {
|
|
131
|
-
key: 2,
|
|
132
|
-
class: "mr-library-tags"
|
|
133
|
-
}, Ve = ["title"], Me = { class: "mr-library-actions" }, Ne = ["disabled", "onClick"], Ie = ["disabled", "onClick"], Ue = ["disabled", "onClick"], Be = {
|
|
134
|
-
key: 4,
|
|
135
|
-
class: "mr-library-empty",
|
|
136
|
-
role: "status"
|
|
137
|
-
}, Ke = { key: 0 }, Fe = ["disabled"], ze = ["disabled"], Ge = /* @__PURE__ */ re({
|
|
138
|
-
__name: "ReportTemplateLibrary",
|
|
139
|
-
props: {
|
|
140
|
-
provider: {},
|
|
141
|
-
messages: {},
|
|
142
|
-
create: { type: Function }
|
|
143
|
-
},
|
|
144
|
-
emits: ["open"],
|
|
145
|
-
setup(r, { emit: p }) {
|
|
146
|
-
const d = r, N = p, { m: a, cursors: D, query: L, category: f, entries: w, categories: S, next: T, loading: m, busy: v, error: q, copying: $, newId: k, newName: x, search: E, load: h, beginCopy: C, cancelCopy: P, retry: I, retryLabel: V, loadingTarget: B } = ye(d, (A, s) => N("open", A, s));
|
|
147
|
-
return (A, s) => (u(), c("section", {
|
|
148
|
-
class: "mr-library",
|
|
149
|
-
"aria-label": e(a).title,
|
|
150
|
-
"aria-busy": e(m) || e(v)
|
|
151
|
-
}, [
|
|
152
|
-
i("header", null, [
|
|
153
|
-
i("div", null, [
|
|
154
|
-
i("h2", null, l(e(a).title), 1),
|
|
155
|
-
i("p", null, l(e(a).subtitle), 1)
|
|
156
|
-
]),
|
|
157
|
-
i("button", {
|
|
158
|
-
type: "button",
|
|
159
|
-
disabled: e(m) || e(v),
|
|
160
|
-
onClick: s[0] || (s[0] = (o) => e(E)())
|
|
161
|
-
}, l(e(a).refresh), 9, fe)
|
|
162
|
-
]),
|
|
163
|
-
i("div", me, [
|
|
164
|
-
F(i("input", {
|
|
165
|
-
"onUpdate:modelValue": s[1] || (s[1] = (o) => z(L) ? L.value = o : null),
|
|
166
|
-
type: "search",
|
|
167
|
-
placeholder: e(a).search,
|
|
168
|
-
"aria-label": e(a).search,
|
|
169
|
-
onKeydown: s[2] || (s[2] = ae((o) => e(E)(), ["enter"]))
|
|
170
|
-
}, null, 40, pe), [
|
|
171
|
-
[Y, e(L)]
|
|
172
|
-
]),
|
|
173
|
-
F(i("select", {
|
|
174
|
-
"onUpdate:modelValue": s[3] || (s[3] = (o) => z(f) ? f.value = o : null),
|
|
175
|
-
"aria-label": e(a).all
|
|
176
|
-
}, [
|
|
177
|
-
i("option", he, l(e(a).all), 1),
|
|
178
|
-
(u(!0), c(j, null, J(e(S), (o) => (u(), c("option", {
|
|
179
|
-
key: o.id,
|
|
180
|
-
value: o.id
|
|
181
|
-
}, l(o.label) + l(o.count === void 0 ? "" : ` (${o.count})`), 9, _e))), 128))
|
|
182
|
-
], 8, ge), [
|
|
183
|
-
[le, e(f)]
|
|
184
|
-
])
|
|
185
|
-
]),
|
|
186
|
-
e(B) ? (u(), c("div", we, l(e(B)), 1)) : g("", !0),
|
|
187
|
-
e(q) ? (u(), c("div", ke, [
|
|
188
|
-
G(l(e(q)) + " ", 1),
|
|
189
|
-
i("button", {
|
|
190
|
-
type: "button",
|
|
191
|
-
disabled: e(m) || e(v),
|
|
192
|
-
onClick: s[4] || (s[4] = (o) => e(I)())
|
|
193
|
-
}, l(e(V)), 9, Ce)
|
|
194
|
-
])) : g("", !0),
|
|
195
|
-
e($) ? (u(), c("form", {
|
|
196
|
-
key: 2,
|
|
197
|
-
class: "mr-library-copy",
|
|
198
|
-
onSubmit: s[8] || (s[8] = ie((o) => e(h)(e($), !0), ["prevent"]))
|
|
199
|
-
}, [
|
|
200
|
-
i("strong", null, l(e(a).copyTitle) + " · " + l(e($).name), 1),
|
|
201
|
-
i("label", null, [
|
|
202
|
-
G(l(e(a).newId), 1),
|
|
203
|
-
F(i("input", {
|
|
204
|
-
"onUpdate:modelValue": s[5] || (s[5] = (o) => z(k) ? k.value = o : null),
|
|
205
|
-
required: "",
|
|
206
|
-
maxlength: "256",
|
|
207
|
-
disabled: e(v)
|
|
208
|
-
}, null, 8, Re), [
|
|
209
|
-
[Y, e(k)]
|
|
210
|
-
])
|
|
211
|
-
]),
|
|
212
|
-
i("label", null, [
|
|
213
|
-
G(l(e(a).newName), 1),
|
|
214
|
-
F(i("input", {
|
|
215
|
-
"onUpdate:modelValue": s[6] || (s[6] = (o) => z(x) ? x.value = o : null),
|
|
216
|
-
required: "",
|
|
217
|
-
maxlength: "256",
|
|
218
|
-
disabled: e(v)
|
|
219
|
-
}, null, 8, Te), [
|
|
220
|
-
[Y, e(x)]
|
|
221
|
-
])
|
|
222
|
-
]),
|
|
223
|
-
i("div", null, [
|
|
224
|
-
i("button", {
|
|
225
|
-
type: "button",
|
|
226
|
-
disabled: e(v),
|
|
227
|
-
onClick: s[7] || (s[7] = (o) => e(P)())
|
|
228
|
-
}, l(e(a).cancel), 9, xe),
|
|
229
|
-
i("button", {
|
|
230
|
-
type: "submit",
|
|
231
|
-
disabled: e(v) || !e(k).trim() || !e(x).trim()
|
|
232
|
-
}, l(e(v) ? e(a).loading : e(a).create), 9, Ee)
|
|
233
|
-
])
|
|
234
|
-
], 32)) : g("", !0),
|
|
235
|
-
e(w).length ? (u(), c("ul", Ae, [
|
|
236
|
-
(u(!0), c(j, null, J(e(w), (o) => (u(), c("li", {
|
|
237
|
-
key: o.id
|
|
238
|
-
}, [
|
|
239
|
-
i("div", $e, [
|
|
240
|
-
i("button", {
|
|
241
|
-
class: "mr-library-name",
|
|
242
|
-
title: o.name,
|
|
243
|
-
type: "button",
|
|
244
|
-
disabled: e(v),
|
|
245
|
-
onClick: (R) => e(h)(o)
|
|
246
|
-
}, l(o.name), 9, De),
|
|
247
|
-
i("small", {
|
|
248
|
-
title: o.id
|
|
249
|
-
}, [
|
|
250
|
-
G(l(o.id), 1),
|
|
251
|
-
o.revision ? (u(), c("span", qe, " · " + l(e(a).revision) + " " + l(o.revision), 1)) : g("", !0)
|
|
252
|
-
], 8, Se),
|
|
253
|
-
o.draftRevision || o.publishedRevision ? (u(), c("span", {
|
|
254
|
-
key: 0,
|
|
255
|
-
class: se(["mr-library-state", { "mr-library-state--draft": o.draftRevision }])
|
|
256
|
-
}, l(o.draftRevision ? o.publishedRevision ? e(a).draftPending : e(a).draft : e(a).published), 3)) : g("", !0),
|
|
257
|
-
o.description ? (u(), c("p", Le, l(o.description), 1)) : g("", !0),
|
|
258
|
-
o.tags?.length ? (u(), c("div", Pe, [
|
|
259
|
-
(u(!0), c(j, null, J(o.tags, (R) => (u(), c("span", {
|
|
260
|
-
key: R,
|
|
261
|
-
title: R
|
|
262
|
-
}, l(R), 9, Ve))), 128))
|
|
263
|
-
])) : g("", !0)
|
|
264
|
-
]),
|
|
265
|
-
i("div", Me, [
|
|
266
|
-
r.create ? (u(), c("button", {
|
|
267
|
-
key: 0,
|
|
268
|
-
type: "button",
|
|
269
|
-
disabled: e(v),
|
|
270
|
-
onClick: (R) => e(C)(o)
|
|
271
|
-
}, l(e(a).copy), 9, Ne)) : g("", !0),
|
|
272
|
-
o.publishedRevision ? (u(), c("button", {
|
|
273
|
-
key: 1,
|
|
274
|
-
type: "button",
|
|
275
|
-
disabled: e(v),
|
|
276
|
-
onClick: (R) => e(h)(o, !1, "published")
|
|
277
|
-
}, l(e(a).viewPublished), 9, Ie)) : g("", !0),
|
|
278
|
-
i("button", {
|
|
279
|
-
type: "button",
|
|
280
|
-
disabled: e(v),
|
|
281
|
-
onClick: (R) => e(h)(o)
|
|
282
|
-
}, l(o.draftRevision ? e(a).continueDraft : e(a).open), 9, Ue)
|
|
283
|
-
])
|
|
284
|
-
]))), 128))
|
|
285
|
-
])) : (u(), c("div", Be, [
|
|
286
|
-
i("strong", null, l(e(m) ? e(a).loading : e(a).empty), 1),
|
|
287
|
-
e(m) ? g("", !0) : (u(), c("p", Ke, l(e(a).emptyHint), 1))
|
|
288
|
-
])),
|
|
289
|
-
i("footer", null, [
|
|
290
|
-
i("span", null, l(e(D).length) + " " + l(e(a).page) + " · " + l(e(w).length) + " " + l(e(a).count), 1),
|
|
291
|
-
i("div", null, [
|
|
292
|
-
e(D).length > 1 ? (u(), c("button", {
|
|
293
|
-
key: 0,
|
|
294
|
-
type: "button",
|
|
295
|
-
disabled: e(m) || e(v),
|
|
296
|
-
onClick: s[9] || (s[9] = (o) => e(E)(!1, !0))
|
|
297
|
-
}, l(e(a).previous), 9, Fe)) : g("", !0),
|
|
298
|
-
e(T) ? (u(), c("button", {
|
|
299
|
-
key: 1,
|
|
300
|
-
type: "button",
|
|
301
|
-
disabled: e(m) || e(v),
|
|
302
|
-
onClick: s[10] || (s[10] = (o) => e(E)(!0))
|
|
303
|
-
}, l(e(m) ? e(a).loading : e(a).loadMore), 9, ze)) : g("", !0)
|
|
304
|
-
])
|
|
305
|
-
])
|
|
306
|
-
], 8, be));
|
|
307
|
-
}
|
|
308
|
-
}), Je = /* @__PURE__ */ ue(Ge, [["__scopeId", "data-v-9513aca4"]]);
|
|
309
|
-
export {
|
|
310
|
-
Je as default
|
|
311
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("@agile-team/mach-report"),F=require("./designer-BWQVpJeN.cjs"),K=require("./_plugin-vue_export-helper-BLmdZLlg.cjs");function H(o){return!o||typeof o.id!="string"||!o.id.trim()||typeof o.name!="string"||!o.name.trim()||[o.draftRevision,o.publishedRevision].some(m=>m!==void 0&&(typeof m!="string"||!m.trim()))?!1:o.tags===void 0||Array.isArray(o.tags)&&o.tags.length<=20&&o.tags.every(m=>typeof m=="string")}function O(o){if(!o||!Array.isArray(o.items)||o.items.length>100||o.next!==void 0&&(typeof o.next!="string"||!o.next||o.next.length>4096))throw new Error("invalid");const m=new Set;for(const i of o.items){if(!H(i)||m.has(i.id))throw new Error("invalid");m.add(i.id)}if(o.categories!==void 0&&(!Array.isArray(o.categories)||o.categories.length>1e3||o.categories.some(i=>!i||typeof i.id!="string"||!i.id||typeof i.label!="string")))throw new Error("invalid")}function j(o,m){const i=e.computed(()=>({...F.TEMPLATE_LIBRARY_MESSAGES,...o.messages})),T=e.ref(""),n=e.ref(""),D=e.shallowRef([]),S=e.shallowRef([]),d=e.ref([void 0]),p=e.ref(),N=e.ref(!1),h=e.ref(!1),f=e.ref(""),s=e.shallowRef(),w=e.ref(""),V=e.ref(""),y=e.ref("search"),k=e.ref(""),E=e.shallowRef();let v=0,g=0,C,x,R;const A=e.computed(()=>({search:i.value.retrySearch,open:i.value.retryOpen,copy:i.value.retryCopy})[y.value]);function _(){f.value="",E.value=void 0}function l(t,a){if(O(t),t.next!==void 0&&(t.next===a.cursor||!a.previous&&d.value.includes(t.next)))throw new Error(i.value.stale);D.value=t.items.map(u=>({...u,...u.tags?{tags:[...u.tags]}:{}})),p.value=t.next,a.previous?d.value=d.value.slice(0,-1):a.more&&(d.value=[...d.value,a.cursor]),t.categories&&(S.value=t.categories)}function r(t){return t instanceof Error?t.message==="invalid"?i.value.invalid:t.message:String(t)}async function b(t){clearTimeout(R),C?.abort();const a=++v,u=new AbortController;C=u,N.value=!0,_(),!t.more&&!t.previous&&(D.value=[],p.value=void 0,d.value=[void 0]);try{const c=await o.provider.search({query:t.query,category:t.category,cursor:t.cursor,limit:30,signal:u.signal});if(a!==v)return;l(c,t)}catch(c){a===v&&!u.signal.aborted&&(f.value=r(c),y.value="search",E.value=()=>b(t))}finally{a===v&&(N.value=!1)}}async function q(t=!1,a=!1){t&&!p.value||a&&d.value.length<2||await b({query:T.value.trim(),category:n.value||void 0,cursor:a?d.value.at(-2):t?p.value:void 0,more:t,previous:a})}async function M(t,a,u){if(t.savedDocument)return B.parseReportTemplate(t.savedDocument);if(t.candidate)return B.parseReportTemplate(t.candidate);const c=await o.provider.get(t.entry.id,{signal:a,mode:t.mode});if(u!==g)return;if(!c||c.id!==t.entry.id)throw new Error(i.value.missing);const $=B.parseReportTemplate(c);if(t.mode==="published"&&t.entry.publishedRevision!==$.revision)throw new Error(i.value.publicationChanged);return t.copy?(t.candidate=B.cloneReportTemplate($,t.identity),B.parseReportTemplate(t.candidate)):$}async function L(t){if(h.value)return;const a=++g,u=new AbortController;x=u,h.value=!0,_(),k.value=(t.copy&&!t.savedDocument?i.value.creatingTarget:i.value.openingTarget).replace("{name}",t.savedDocument?.name??t.entry.name);try{let c=await M(t,u.signal,a);if(!c||a!==g)return;if(t.copy&&!t.savedDocument){if(!t.create||(c=B.parseReportTemplate(await t.create(c,{signal:u.signal})),a!==g))return;if(c.id!==t.identity.id)throw new Error(i.value.invalid);t.savedDocument=B.parseReportTemplate(c),s.value=void 0}m(c,{mode:t.mode}),t.copy&&q()}catch(c){a===g&&!u.signal.aborted&&(f.value=r(c),y.value=t.copy&&!t.savedDocument?"copy":"open",E.value=()=>L(t))}finally{a===g&&(h.value=!1,k.value="")}}async function P(t,a=!1,u="edit"){await L({entry:{...t},copy:a,mode:a?"edit":u,identity:{id:w.value.trim(),name:V.value.trim()},create:o.create})}function I(){v++,C?.abort(),D.value=[],p.value=void 0,d.value=[void 0],N.value=!0,_(),clearTimeout(R),R=setTimeout(()=>{q()},180)}function U(){g++,x?.abort(),h.value=!1,k.value="",s.value=void 0,q()}return e.watch([T,n],I),e.watch([()=>o.provider,()=>o.create],U),e.watch([w,V],()=>{y.value==="copy"&&_()}),e.onBeforeUnmount(()=>{v++,g++,clearTimeout(R),C?.abort(),x?.abort()}),q(),{m:i,cursors:d,query:T,category:n,entries:D,categories:S,next:p,loading:N,busy:h,error:f,errorKind:y,retryLabel:A,loadingTarget:k,copying:s,newId:w,newName:V,search:q,load:P,retry:async()=>{!h.value&&!N.value&&await E.value?.()},beginCopy:t=>{_(),s.value=t,w.value="",V.value=t.name},cancelCopy:()=>{h.value||(s.value=void 0,_())}}}const z=["aria-label","aria-busy"],G=["disabled"],Y={class:"mr-library-search"},J=["placeholder","aria-label"],Q=["aria-label"],W={value:""},X=["value"],Z={key:0,class:"mr-library-progress",role:"status"},ee={key:1,role:"alert",class:"mr-library-error"},te=["disabled"],re=["disabled"],oe=["disabled"],ne=["disabled"],le=["disabled"],ae={key:3},ie={class:"mr-library-info"},se=["title","disabled","onClick"],ue=["title"],ce={key:0},de={key:1},fe={key:2,class:"mr-library-tags"},me=["title"],ve={class:"mr-library-actions"},pe=["disabled","onClick"],ye=["disabled","onClick"],ge=["disabled","onClick"],be={key:4,class:"mr-library-empty",role:"status"},he={key:0},ke=["disabled"],Ee=["disabled"],_e=e.defineComponent({__name:"ReportTemplateLibrary",props:{provider:{},messages:{},create:{type:Function}},emits:["open"],setup(o,{emit:m}){const i=o,T=m,{m:n,cursors:D,query:S,category:d,entries:p,categories:N,next:h,loading:f,busy:s,error:w,copying:V,newId:y,newName:k,search:E,load:v,beginCopy:g,cancelCopy:C,retry:x,retryLabel:R,loadingTarget:A}=j(i,(_,l)=>T("open",_,l));return(_,l)=>(e.openBlock(),e.createElementBlock("section",{class:"mr-library","aria-label":e.unref(n).title,"aria-busy":e.unref(f)||e.unref(s)},[e.createElementVNode("header",null,[e.createElementVNode("div",null,[e.createElementVNode("h2",null,e.toDisplayString(e.unref(n).title),1),e.createElementVNode("p",null,e.toDisplayString(e.unref(n).subtitle),1)]),e.createElementVNode("button",{type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[0]||(l[0]=r=>e.unref(E)())},e.toDisplayString(e.unref(n).refresh),9,G)]),e.createElementVNode("div",Y,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[1]||(l[1]=r=>e.isRef(S)?S.value=r:null),type:"search",placeholder:e.unref(n).search,"aria-label":e.unref(n).search,onKeydown:l[2]||(l[2]=e.withKeys(r=>e.unref(E)(),["enter"]))},null,40,J),[[e.vModelText,e.unref(S)]]),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":l[3]||(l[3]=r=>e.isRef(d)?d.value=r:null),"aria-label":e.unref(n).all},[e.createElementVNode("option",W,e.toDisplayString(e.unref(n).all),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),r=>(e.openBlock(),e.createElementBlock("option",{key:r.id,value:r.id},e.toDisplayString(r.label)+e.toDisplayString(r.count===void 0?"":` (${r.count})`),9,X))),128))],8,Q),[[e.vModelSelect,e.unref(d)]])]),e.unref(A)?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(e.unref(A)),1)):e.createCommentVNode("",!0),e.unref(w)?(e.openBlock(),e.createElementBlock("div",ee,[e.createTextVNode(e.toDisplayString(e.unref(w))+" ",1),e.createElementVNode("button",{type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[4]||(l[4]=r=>e.unref(x)())},e.toDisplayString(e.unref(R)),9,te)])):e.createCommentVNode("",!0),e.unref(V)?(e.openBlock(),e.createElementBlock("form",{key:2,class:"mr-library-copy",onSubmit:l[8]||(l[8]=e.withModifiers(r=>e.unref(v)(e.unref(V),!0),["prevent"]))},[e.createElementVNode("strong",null,e.toDisplayString(e.unref(n).copyTitle)+" · "+e.toDisplayString(e.unref(V).name),1),e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(e.unref(n).newId),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[5]||(l[5]=r=>e.isRef(y)?y.value=r:null),required:"",maxlength:"256",disabled:e.unref(s)},null,8,re),[[e.vModelText,e.unref(y)]])]),e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(e.unref(n).newName),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[6]||(l[6]=r=>e.isRef(k)?k.value=r:null),required:"",maxlength:"256",disabled:e.unref(s)},null,8,oe),[[e.vModelText,e.unref(k)]])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",disabled:e.unref(s),onClick:l[7]||(l[7]=r=>e.unref(C)())},e.toDisplayString(e.unref(n).cancel),9,ne),e.createElementVNode("button",{type:"submit",disabled:e.unref(s)||!e.unref(y).trim()||!e.unref(k).trim()},e.toDisplayString(e.unref(s)?e.unref(n).loading:e.unref(n).create),9,le)])],32)):e.createCommentVNode("",!0),e.unref(p).length?(e.openBlock(),e.createElementBlock("ul",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),r=>(e.openBlock(),e.createElementBlock("li",{key:r.id},[e.createElementVNode("div",ie,[e.createElementVNode("button",{class:"mr-library-name",title:r.name,type:"button",disabled:e.unref(s),onClick:b=>e.unref(v)(r)},e.toDisplayString(r.name),9,se),e.createElementVNode("small",{title:r.id},[e.createTextVNode(e.toDisplayString(r.id),1),r.revision?(e.openBlock(),e.createElementBlock("span",ce," · "+e.toDisplayString(e.unref(n).revision)+" "+e.toDisplayString(r.revision),1)):e.createCommentVNode("",!0)],8,ue),r.draftRevision||r.publishedRevision?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["mr-library-state",{"mr-library-state--draft":r.draftRevision}])},e.toDisplayString(r.draftRevision?r.publishedRevision?e.unref(n).draftPending:e.unref(n).draft:e.unref(n).published),3)):e.createCommentVNode("",!0),r.description?(e.openBlock(),e.createElementBlock("p",de,e.toDisplayString(r.description),1)):e.createCommentVNode("",!0),r.tags?.length?(e.openBlock(),e.createElementBlock("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tags,b=>(e.openBlock(),e.createElementBlock("span",{key:b,title:b},e.toDisplayString(b),9,me))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ve,[o.create?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:e.unref(s),onClick:b=>e.unref(g)(r)},e.toDisplayString(e.unref(n).copy),9,pe)):e.createCommentVNode("",!0),r.publishedRevision?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:e.unref(s),onClick:b=>e.unref(v)(r,!1,"published")},e.toDisplayString(e.unref(n).viewPublished),9,ye)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",disabled:e.unref(s),onClick:b=>e.unref(v)(r)},e.toDisplayString(r.draftRevision?e.unref(n).continueDraft:e.unref(n).open),9,ge)])]))),128))])):(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("strong",null,e.toDisplayString(e.unref(f)?e.unref(n).loading:e.unref(n).empty),1),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",he,e.toDisplayString(e.unref(n).emptyHint),1))])),e.createElementVNode("footer",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(D).length)+" "+e.toDisplayString(e.unref(n).page)+" · "+e.toDisplayString(e.unref(p).length)+" "+e.toDisplayString(e.unref(n).count),1),e.createElementVNode("div",null,[e.unref(D).length>1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[9]||(l[9]=r=>e.unref(E)(!1,!0))},e.toDisplayString(e.unref(n).previous),9,ke)):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[10]||(l[10]=r=>e.unref(E)(!0))},e.toDisplayString(e.unref(f)?e.unref(n).loading:e.unref(n).loadMore),9,Ee)):e.createCommentVNode("",!0)])])],8,z))}}),Ve=K._export_sfc(_e,[["__scopeId","data-v-9513aca4"]]);exports.default=Ve;
|