@agile-team/mach-report 2.8.0 → 2.8.2
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 +3 -3
- package/dist/{ReportPreview-BKKDAv8e.js → ReportPreview-DRBAUkxj.js} +610 -653
- package/dist/ReportPreview-DjGeWHY-.cjs +6 -0
- package/dist/_plugin-vue_export-helper-BLmdZLlg.cjs +1 -0
- package/dist/_plugin-vue_export-helper-DPbiz14D.js +53 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +38 -0
- package/dist/designer.d.ts +38 -0
- package/dist/designer.js +751 -438
- package/dist/{plugin-PCgxBVB2.js → plugin-BurDDMcd.js} +1 -1
- package/dist/{plugin-mAfvgSey.cjs → plugin-DSFu51Ua.cjs} +1 -1
- package/dist/style.css +1 -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 +4 -4
- package/package.json +1 -1
- package/dist/ReportPreview-E3cm67Tk.cjs +0 -6
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +0 -1
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
package/dist/designer.js
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { provideMachReportConfig as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
const f =
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
for (const
|
|
12
|
-
for (let
|
|
13
|
-
return
|
|
14
|
-
}),
|
|
15
|
-
const
|
|
16
|
-
return (
|
|
17
|
-
const
|
|
18
|
-
return
|
|
1
|
+
import { ref as $, computed as A, shallowRef as pe, onBeforeUnmount as he, watch as W, defineComponent as be, getCurrentInstance as ye, nextTick as te, openBlock as y, createElementBlock as k, unref as e, createElementVNode as n, createVNode as ne, toDisplayString as a, normalizeClass as me, createTextVNode as R, createCommentVNode as P, withKeys as _e, withModifiers as ke, Fragment as K, renderList as se, withDirectives as de, isRef as ue, vModelSelect as Ce, vModelText as fe, createBlock as ge } from "vue";
|
|
2
|
+
import { provideMachReportConfig as we, createLocalFetcher as Se, ReportPreview as xe } from "@agile-team/mach-report/vue";
|
|
3
|
+
import { _ as Y, a as Ee } from "./_plugin-vue_export-helper-DPbiz14D.js";
|
|
4
|
+
import { resolveGridLayout as ce, parseReportTemplate as J, serializeReportTemplate as U, validateReportTemplateDocument as Me } from "@agile-team/mach-report";
|
|
5
|
+
function Te(c, M, u, b) {
|
|
6
|
+
const f = $(0), s = $(""), C = $([]), B = A(() => c.value.template.pages.flatMap((d, r) => d.components.flatMap((i, m) => i.kind === "list" ? [{ component: i, pageIndex: r, componentIndex: m }] : []))), w = A(() => B.value[f.value]?.component), p = A(() => {
|
|
7
|
+
const d = w.value;
|
|
8
|
+
if (!d) return [];
|
|
9
|
+
const r = d.columns.map((i) => i.headerStyle?.align ?? i.headerAlign ?? d.headerStyle?.align ?? d.headerAlign ?? i.style?.align ?? "center");
|
|
10
|
+
if (d.headerGrid && M())
|
|
11
|
+
for (const i of ce(d.headerGrid, d.widthMm, 100).cells)
|
|
12
|
+
for (let m = i.ci; m < i.ci + (i.cell.colSpan ?? 1); m++) r[m] = i.cell.style?.align ?? "left";
|
|
13
|
+
return r;
|
|
14
|
+
}), g = A(() => {
|
|
15
|
+
const d = s.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
|
|
16
|
+
return (w.value?.columns ?? []).flatMap((r, i) => {
|
|
17
|
+
const m = `${r.header} ${r.field}`.toLocaleLowerCase();
|
|
18
|
+
return d.every((x) => m.includes(x)) ? [{ column: r, index: i }] : [];
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function _(d, r) {
|
|
22
|
+
C.value = r ? [.../* @__PURE__ */ new Set([...C.value, d])] : C.value.filter((i) => i !== d);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
for (const
|
|
24
|
+
function T(d) {
|
|
25
|
+
for (const r of g.value) _(r.index, d);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function h() {
|
|
28
|
+
C.value = [];
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function L(d, r, i) {
|
|
31
31
|
if (!u()) return;
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const m = w.value?.columns[d];
|
|
33
|
+
m && (Object.assign(m, { [r]: r === "widthMm" ? Number(i) : i }), r === "header" && I(d, String(i)), r === "headerAlign" && j(d, i), r === "widthMm" && Q(), b());
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
39
|
-
|
|
35
|
+
function Q() {
|
|
36
|
+
const d = B.value[f.value];
|
|
37
|
+
if (!d) return;
|
|
38
|
+
const r = d.component, i = c.value.template.pages[d.pageIndex], m = r.columns.map((x) => x.widthMm);
|
|
39
|
+
r.headerGrid && (r.headerGrid.colWidthsMm = m), i.layout === "wide" && m.every((x) => Number.isFinite(x) && x > 0) && (r.widthMm = m.reduce((x, t) => x + t, 0), i.widthMm = Math.max(...i.components.map((x) => x.leftMm + x.widthMm)) + (i.marginRightMm ?? 0));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
t.header =
|
|
41
|
+
function I(d, r) {
|
|
42
|
+
const i = w.value;
|
|
43
|
+
if (!i?.headerGrid) return;
|
|
44
|
+
const x = ce(i.headerGrid, i.widthMm, 100).cells.filter(({ ci: t, cell: V }) => t <= d && t + (V.colSpan ?? 1) > d).slice(-1)[0];
|
|
45
|
+
x && (Object.assign(x.cell, { text: r, rawText: r, value: r }), i.columns.slice(x.ci, x.ci + (x.cell.colSpan ?? 1)).forEach((t) => {
|
|
46
|
+
t.header = r;
|
|
47
47
|
}));
|
|
48
48
|
}
|
|
49
|
-
function j(
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const t =
|
|
53
|
-
t && (t.cell.style = { ...t.cell.style, align:
|
|
54
|
-
|
|
49
|
+
function j(d, r) {
|
|
50
|
+
const i = w.value, m = i?.columns[d];
|
|
51
|
+
if (m?.headerStyle?.align !== void 0 && (m.headerStyle = { ...m.headerStyle, align: r }), !i?.headerGrid) return;
|
|
52
|
+
const t = ce(i.headerGrid, i.widthMm, 100).cells.filter(({ ci: V, cell: O }) => V <= d && V + (O.colSpan ?? 1) > d).slice(-1)[0];
|
|
53
|
+
t && (t.cell.style = { ...t.cell.style, align: r }, i.columns.slice(t.ci, t.ci + (t.cell.colSpan ?? 1)).forEach((V) => {
|
|
54
|
+
V.headerAlign = r, V.headerStyle?.align !== void 0 && (V.headerStyle = { ...V.headerStyle, align: r });
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
if (!(!u() ||
|
|
59
|
-
for (const
|
|
60
|
-
const
|
|
61
|
-
|
|
57
|
+
function H(d, r) {
|
|
58
|
+
if (!(!u() || d === "headerAlign" && r === "auto")) {
|
|
59
|
+
for (const i of C.value) {
|
|
60
|
+
const m = w.value?.columns[i];
|
|
61
|
+
m && (Object.assign(m, { [d]: r }), d === "headerAlign" && j(i, r));
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
b();
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
return { selected: f, query:
|
|
66
|
+
return { selected: f, query: s, selectedColumns: C, lists: B, activeList: w, headerAlignments: p, visibleColumns: g, toggleColumn: _, selectVisible: T, clearSelection: h, setColumn: L, alignColumns: H };
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const u =
|
|
70
|
-
function
|
|
71
|
-
u.value = [
|
|
68
|
+
function Ae(c, M = { entries: 100, bytes: 16 * 1024 * 1024 }) {
|
|
69
|
+
const u = $([c]), b = $(0), f = A(() => b.value > 0), s = A(() => b.value + 1 < u.value.length), C = A(() => u.value[b.value]);
|
|
70
|
+
function B(g) {
|
|
71
|
+
u.value = [g], b.value = 0;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
if (u.value[
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
let
|
|
78
|
-
for (;
|
|
79
|
-
u.value =
|
|
73
|
+
function w(g) {
|
|
74
|
+
if (u.value[b.value] === g) return;
|
|
75
|
+
const _ = u.value.slice(0, b.value + 1);
|
|
76
|
+
_.push(g);
|
|
77
|
+
let T = _.reduce((h, L) => h + L.length * 2, 0);
|
|
78
|
+
for (; _.length > 1 && (_.length > M.entries || T > M.bytes); ) T -= _.shift().length * 2;
|
|
79
|
+
u.value = _, b.value = u.value.length - 1;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
if (!(
|
|
83
|
-
return
|
|
81
|
+
function p(g) {
|
|
82
|
+
if (!(g < 0 ? !f.value : !s.value))
|
|
83
|
+
return b.value += g, u.value[b.value];
|
|
84
84
|
}
|
|
85
|
-
return { canUndo: f, canRedo:
|
|
85
|
+
return { canUndo: f, canRedo: s, current: C, reset: B, record: w, move: p };
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
let
|
|
90
|
-
function
|
|
91
|
-
|
|
87
|
+
function De(c) {
|
|
88
|
+
const M = pe(null), u = $(!1);
|
|
89
|
+
let b, f = 0;
|
|
90
|
+
function s(w) {
|
|
91
|
+
b?.(w), b = void 0, M.value = null;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
f++,
|
|
93
|
+
function C() {
|
|
94
|
+
f++, s(!1), u.value = !1;
|
|
95
95
|
}
|
|
96
|
-
async function
|
|
97
|
-
|
|
98
|
-
const
|
|
96
|
+
async function B(w) {
|
|
97
|
+
C();
|
|
98
|
+
const p = f, g = c();
|
|
99
99
|
u.value = !0;
|
|
100
100
|
try {
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
|
|
101
|
+
const _ = await new Promise((T, h) => {
|
|
102
|
+
if (b = T, !g) {
|
|
103
|
+
M.value = w;
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
Promise.resolve().then(() => f ===
|
|
107
|
-
f ===
|
|
108
|
-
}, (
|
|
109
|
-
f ===
|
|
106
|
+
Promise.resolve().then(() => f === p ? g(w) : !1).then((L) => {
|
|
107
|
+
f === p && s(L === !0);
|
|
108
|
+
}, (L) => {
|
|
109
|
+
f === p && (b = void 0, M.value = null, h(L));
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
|
-
return f ===
|
|
112
|
+
return f === p && _ === !0;
|
|
113
113
|
} finally {
|
|
114
|
-
f ===
|
|
114
|
+
f === p && (u.value = !1);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return he(C), { confirmation: M, pending: u, decide: s, request: B, cancel: C };
|
|
118
118
|
}
|
|
119
|
-
const
|
|
119
|
+
const je = {
|
|
120
120
|
title: "报表模板属性编辑器",
|
|
121
121
|
heading: "模板属性",
|
|
122
122
|
unpublished: "未发布",
|
|
@@ -149,7 +149,7 @@ const Ee = {
|
|
|
149
149
|
applyJson: "校验并应用 JSON",
|
|
150
150
|
note: "字段映射应与数据源契约一致。此编辑器维护模板属性;保存由接入方提供的版本服务处理。",
|
|
151
151
|
invalid: "请先修正模板错误,再预览或保存。"
|
|
152
|
-
},
|
|
152
|
+
}, Re = {
|
|
153
153
|
undo: "撤销",
|
|
154
154
|
redo: "重做",
|
|
155
155
|
columnsSearch: "搜索列名或字段",
|
|
@@ -164,10 +164,27 @@ const Ee = {
|
|
|
164
164
|
discardDescription: "当前包含未保存的属性或尚未应用的 JSON,继续将丢弃这些修改。",
|
|
165
165
|
keepEditing: "继续编辑",
|
|
166
166
|
discard: "丢弃修改并继续",
|
|
167
|
-
jsonPending: "JSON 尚未应用。请先校验并应用,或撤销 JSON 修改后继续属性编辑与保存。"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
jsonPending: "JSON 尚未应用。请先校验并应用,或撤销 JSON 修改后继续属性编辑与保存。",
|
|
168
|
+
fieldsSection: "字段",
|
|
169
|
+
templateSection: "模板",
|
|
170
|
+
advancedSection: "高级",
|
|
171
|
+
sectionsLabel: "模板设置分区",
|
|
172
|
+
columnDirectory: "字段目录",
|
|
173
|
+
columnProperties: "字段属性",
|
|
174
|
+
selectColumn: "选择字段",
|
|
175
|
+
clearSearch: "清除搜索",
|
|
176
|
+
fieldsCount: "个字段",
|
|
177
|
+
templateDetails: "模板信息",
|
|
178
|
+
advancedTitle: "完整配置",
|
|
179
|
+
advancedDescription: "用于批量迁移或配置复杂模板。应用前会校验;未应用的内容会受到草稿保护。",
|
|
180
|
+
templateIdentity: "模板标识",
|
|
181
|
+
templateRevision: "当前修订",
|
|
182
|
+
readonly: "只读",
|
|
183
|
+
ready: "可编辑",
|
|
184
|
+
previewTitle: "实时预览"
|
|
185
|
+
}, $e = { ...je, ...Re };
|
|
186
|
+
function Be(c, M) {
|
|
187
|
+
const u = $(J(c.modelValue)), b = $(U(u.value)), f = $(U(u.value)), s = $(""), C = $(!1), B = A(() => ({ ...$e, ...c.messages })), w = A(() => ({
|
|
171
188
|
showExport: !1,
|
|
172
189
|
showPrint: !1,
|
|
173
190
|
showPdfWindow: !1,
|
|
@@ -186,137 +203,180 @@ function je(c, w) {
|
|
|
186
203
|
...c.preview?.theme
|
|
187
204
|
}
|
|
188
205
|
}));
|
|
189
|
-
|
|
190
|
-
return
|
|
206
|
+
we({ get defaults() {
|
|
207
|
+
return w.value;
|
|
191
208
|
} });
|
|
192
|
-
let
|
|
193
|
-
const
|
|
209
|
+
let p, g = 0;
|
|
210
|
+
const _ = A(() => Me(u.value)), T = A(() => {
|
|
194
211
|
try {
|
|
195
|
-
return
|
|
212
|
+
return U(u.value) !== b.value;
|
|
196
213
|
} catch {
|
|
197
214
|
return !0;
|
|
198
215
|
}
|
|
199
|
-
}),
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
function
|
|
203
|
-
|
|
216
|
+
}), h = $(f.value), L = A(() => f.value !== h.value), Q = A(() => T.value || f.value !== h.value), I = () => JSON.stringify({ document: u.value, json: f.value, appliedJson: h.value }), j = Ae(I()), H = De(() => c.beforeDiscard), d = A(() => C.value || H.pending.value), r = () => !c.readonly && !d.value && !L.value, i = Te(u, () => _.value.ok, r, q), { selected: m, lists: x, activeList: t, headerAlignments: V, setColumn: O } = i;
|
|
217
|
+
W(m, () => i.clearSelection());
|
|
218
|
+
const z = A(() => _.value.ok ? Se({ draft: { template: u.value.template, datasets: c.datasets ?? {}, params: [] } }) : void 0);
|
|
219
|
+
function E() {
|
|
220
|
+
g++, p?.abort(), p = void 0, C.value = !1;
|
|
204
221
|
}
|
|
205
|
-
let
|
|
206
|
-
async function
|
|
207
|
-
if (!
|
|
208
|
-
const
|
|
222
|
+
let G = 0;
|
|
223
|
+
async function N(l = "replace", o) {
|
|
224
|
+
if (!Q.value) return !0;
|
|
225
|
+
const v = I();
|
|
209
226
|
try {
|
|
210
|
-
return await
|
|
211
|
-
reason:
|
|
227
|
+
return await H.request({
|
|
228
|
+
reason: l,
|
|
212
229
|
document: JSON.parse(JSON.stringify(u.value)),
|
|
213
|
-
replacement:
|
|
230
|
+
replacement: o ? J(o) : void 0,
|
|
214
231
|
pendingLocalChanges: !0
|
|
215
|
-
}) &&
|
|
216
|
-
} catch (
|
|
217
|
-
return
|
|
232
|
+
}) && v === I();
|
|
233
|
+
} catch (D) {
|
|
234
|
+
return s.value = D instanceof Error ? D.message : String(D), !1;
|
|
218
235
|
}
|
|
219
236
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
237
|
+
function le(l) {
|
|
238
|
+
E(), u.value = l, b.value = U(l), f.value = b.value, h.value = f.value, s.value = "", m.value = 0, i.clearSelection(), j.reset(I());
|
|
222
239
|
}
|
|
223
|
-
|
|
224
|
-
let
|
|
240
|
+
W(() => c.modelValue, async (l) => {
|
|
241
|
+
let o;
|
|
225
242
|
try {
|
|
226
|
-
|
|
227
|
-
} catch (
|
|
228
|
-
|
|
243
|
+
o = J(l);
|
|
244
|
+
} catch (D) {
|
|
245
|
+
s.value = D instanceof Error ? D.message : String(D);
|
|
229
246
|
return;
|
|
230
247
|
}
|
|
231
248
|
try {
|
|
232
|
-
if (
|
|
249
|
+
if (U(o) === U(u.value)) return;
|
|
233
250
|
} catch {
|
|
234
251
|
}
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
|
|
252
|
+
const v = ++G;
|
|
253
|
+
if (E(), !await N("replace", o)) {
|
|
254
|
+
v === G && _.value.ok && M("update:modelValue", J(u.value));
|
|
238
255
|
return;
|
|
239
256
|
}
|
|
240
|
-
|
|
241
|
-
}),
|
|
242
|
-
|
|
257
|
+
v === G && le(o);
|
|
258
|
+
}), he(() => {
|
|
259
|
+
G++, E();
|
|
243
260
|
});
|
|
244
|
-
function
|
|
245
|
-
|
|
261
|
+
function q() {
|
|
262
|
+
H.cancel(), s.value = "", _.value.ok && (f.value = U(u.value), h.value = f.value, M("update:modelValue", J(u.value))), j.record(I());
|
|
246
263
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
264
|
+
function oe(l) {
|
|
265
|
+
r() && (u.value.name = l, q());
|
|
249
266
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
267
|
+
function X(l) {
|
|
268
|
+
r() && (u.value.description = l, q());
|
|
252
269
|
}
|
|
253
|
-
function
|
|
254
|
-
if (!(c.readonly ||
|
|
270
|
+
function F() {
|
|
271
|
+
if (!(c.readonly || d.value))
|
|
255
272
|
try {
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
if (
|
|
259
|
-
u.value =
|
|
260
|
-
} catch (
|
|
261
|
-
|
|
273
|
+
const l = J(f.value);
|
|
274
|
+
if (l.id !== u.value.id) throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
|
|
275
|
+
if (l.revision !== u.value.revision) throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
|
|
276
|
+
u.value = l, m.value = 0, i.clearSelection(), q();
|
|
277
|
+
} catch (l) {
|
|
278
|
+
s.value = l instanceof Error ? l.message : String(l);
|
|
262
279
|
}
|
|
263
280
|
}
|
|
264
|
-
async function
|
|
265
|
-
|
|
281
|
+
async function ae() {
|
|
282
|
+
d.value || c.readonly || !await N("reset") || (le(J(b.value)), M("update:modelValue", J(u.value)));
|
|
266
283
|
}
|
|
267
|
-
function
|
|
268
|
-
if (
|
|
269
|
-
j.record(
|
|
270
|
-
const
|
|
271
|
-
if (!
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
u.value =
|
|
284
|
+
function Z(l) {
|
|
285
|
+
if (d.value || c.readonly) return;
|
|
286
|
+
j.record(I());
|
|
287
|
+
const o = j.move(l);
|
|
288
|
+
if (!o) return;
|
|
289
|
+
H.cancel();
|
|
290
|
+
const v = JSON.parse(o);
|
|
291
|
+
u.value = v.document, f.value = v.json, h.value = v.appliedJson, s.value = "", m.value = 0, i.clearSelection(), _.value.ok && M("update:modelValue", J(u.value));
|
|
275
292
|
}
|
|
276
|
-
async function
|
|
277
|
-
if (!c.save || !
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
const
|
|
293
|
+
async function ie() {
|
|
294
|
+
if (!c.save || !r() || !_.value.ok) return;
|
|
295
|
+
const l = ++g;
|
|
296
|
+
p = new AbortController(), C.value = !0, s.value = "";
|
|
297
|
+
const o = J(u.value);
|
|
281
298
|
try {
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
284
|
-
if (
|
|
285
|
-
u.value =
|
|
286
|
-
} catch (
|
|
287
|
-
|
|
299
|
+
const v = J(await c.save(o, { expectedRevision: o.revision, signal: p.signal }));
|
|
300
|
+
if (l !== g) return;
|
|
301
|
+
if (v.id !== o.id) throw new Error("保存服务返回了其他模板的文档");
|
|
302
|
+
u.value = v, b.value = U(v), f.value = b.value, h.value = f.value, j.reset(I()), M("saved", J(v)), M("update:modelValue", J(v));
|
|
303
|
+
} catch (v) {
|
|
304
|
+
l === g && (s.value = v instanceof Error ? v.message : String(v));
|
|
288
305
|
} finally {
|
|
289
|
-
|
|
306
|
+
l === g && (C.value = !1, p = void 0);
|
|
290
307
|
}
|
|
291
308
|
}
|
|
292
|
-
const
|
|
293
|
-
return { ...
|
|
309
|
+
const re = A(() => j.canUndo.value || I() !== j.current.value), S = A(() => j.canRedo.value && I() === j.current.value);
|
|
310
|
+
return { ...i, canUndo: re, canRedo: S, undo: () => Z(-1), redo: () => Z(1), pendingLocalChanges: Q, jsonPending: L, blocked: d, confirmation: H.confirmation, decideDiscard: H.decide, guardChanges: N, draft: u, json: f, selected: m, error: s, saving: C, dirty: T, validation: _, lists: x, activeList: t, headerAlignments: V, previewOptions: w, fetcher: z, messages: B, setName: oe, setDescription: X, setColumn: O, applyJson: F, reset: ae, save: ie };
|
|
294
311
|
}
|
|
295
|
-
|
|
312
|
+
function Le(c, M, u, b) {
|
|
313
|
+
const f = $("fields"), s = $(c.value[0]?.index ?? -1), C = A(() => {
|
|
314
|
+
const p = u.value?.columns[s.value];
|
|
315
|
+
return p ? { column: p, index: s.value } : void 0;
|
|
316
|
+
});
|
|
317
|
+
W(b, () => {
|
|
318
|
+
c.value.some((p) => p.index === s.value) || (s.value = c.value[0]?.index ?? -1);
|
|
319
|
+
}), W(M, () => {
|
|
320
|
+
s.value = c.value[0]?.index ?? -1;
|
|
321
|
+
}), W(u, (p) => {
|
|
322
|
+
p?.columns[s.value] || (s.value = c.value[0]?.index ?? -1);
|
|
323
|
+
});
|
|
324
|
+
function B(p) {
|
|
325
|
+
c.value.some((g) => g.index === p) && (s.value = p);
|
|
326
|
+
}
|
|
327
|
+
function w(p) {
|
|
328
|
+
const g = c.value;
|
|
329
|
+
if (!g.length) return;
|
|
330
|
+
const _ = Math.max(
|
|
331
|
+
0,
|
|
332
|
+
g.findIndex((L) => L.index === s.value)
|
|
333
|
+
), h = {
|
|
334
|
+
ArrowDown: Math.min(_ + 1, g.length - 1),
|
|
335
|
+
ArrowUp: Math.max(_ - 1, 0),
|
|
336
|
+
Home: 0,
|
|
337
|
+
End: g.length - 1
|
|
338
|
+
}[p];
|
|
339
|
+
if (h !== void 0)
|
|
340
|
+
return s.value = g[h].index, s.value;
|
|
341
|
+
}
|
|
342
|
+
return { section: f, activeIndex: s, activeColumn: C, activate: B, moveColumn: w };
|
|
343
|
+
}
|
|
344
|
+
const Ve = ["aria-label", "aria-busy"], Oe = { class: "mr-designer-bar" }, Ie = { class: "mr-designer-heading" }, Je = { class: "mr-designer-actions" }, Ne = { class: "mr-designer-history" }, Pe = ["aria-label", "title", "disabled"], He = ["aria-label", "title", "disabled"], Ge = ["disabled"], Fe = ["disabled"], Ue = ["aria-label"], ze = { class: "mr-designer-body" }, qe = { class: "mr-designer-inspector" }, Ke = ["aria-label"], We = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], Qe = ["id", "aria-labelledby"], Xe = {
|
|
345
|
+
key: 0,
|
|
346
|
+
class: "mr-designer-area"
|
|
347
|
+
}, Ye = ["value"], Ze = {
|
|
296
348
|
key: 1,
|
|
297
349
|
class: "mr-designer-columns"
|
|
298
|
-
},
|
|
299
|
-
key: 0,
|
|
300
|
-
class: "mr-designer-batch"
|
|
301
|
-
}, ze = ["aria-label", "disabled"], Qe = { value: "" }, Xe = { value: "auto" }, Ye = { value: "left" }, Ze = { value: "center" }, et = { value: "right" }, tt = { value: "justify" }, nt = ["aria-label", "disabled"], lt = { value: "" }, ot = { value: "left" }, at = { value: "center" }, st = { value: "right" }, it = { value: "justify" }, rt = {
|
|
350
|
+
}, et = { class: "mr-designer-directory-heading" }, tt = { class: "mr-designer-search" }, nt = ["aria-label", "placeholder"], lt = ["aria-label", "title"], ot = { class: "mr-designer-column-tools" }, at = ["disabled"], st = {
|
|
302
351
|
key: 1,
|
|
303
352
|
role: "status"
|
|
304
|
-
},
|
|
353
|
+
}, it = { key: 2 }, rt = ["aria-label"], dt = ["aria-label", "checked", "disabled", "onChange"], ut = ["data-column-index", "aria-pressed", "tabindex", "onClick"], ct = { class: "mr-designer-column-number" }, vt = { class: "mr-designer-column-name" }, mt = {
|
|
354
|
+
key: 0,
|
|
355
|
+
role: "status",
|
|
356
|
+
class: "mr-designer-empty"
|
|
357
|
+
}, ft = {
|
|
358
|
+
key: 0,
|
|
359
|
+
class: "mr-designer-batch"
|
|
360
|
+
}, gt = ["aria-label", "disabled"], ht = { value: "" }, pt = { value: "auto" }, bt = { value: "left" }, yt = { value: "center" }, _t = { value: "right" }, kt = { value: "justify" }, Ct = ["aria-label", "disabled"], wt = { value: "" }, St = { value: "left" }, xt = { value: "center" }, Et = { value: "right" }, Mt = { value: "justify" }, Tt = ["disabled"], At = ["value"], Dt = ["value"], jt = ["value"], Rt = ["value"], $t = { value: "identifier" }, Bt = { value: "dimension" }, Lt = { value: "measure" }, Vt = { value: "date" }, Ot = { value: "text" }, It = ["value"], Jt = { value: "auto" }, Nt = { value: "left" }, Pt = { value: "center" }, Ht = { value: "right" }, Gt = { value: "justify" }, Ft = ["value"], Ut = { value: "left" }, zt = { value: "center" }, qt = { value: "right" }, Kt = { value: "justify" }, Wt = { class: "mr-designer-toggle" }, Qt = ["checked"], Xt = {
|
|
305
361
|
key: 2,
|
|
306
362
|
role: "status",
|
|
307
|
-
class: "mr-designer-
|
|
308
|
-
},
|
|
363
|
+
class: "mr-designer-empty"
|
|
364
|
+
}, Yt = { class: "mr-designer-stacked" }, Zt = ["value", "disabled"], en = { class: "mr-designer-stacked" }, tn = ["value", "disabled"], nn = { class: "mr-designer-identity" }, ln = { class: "mr-designer-note" }, on = { class: "mr-designer-note" }, an = { class: "mr-designer-stacked" }, sn = ["aria-label", "disabled"], rn = ["disabled"], dn = {
|
|
365
|
+
key: 3,
|
|
366
|
+
role: "status",
|
|
367
|
+
class: "mr-designer-note mr-designer-pending"
|
|
368
|
+
}, un = ["aria-label"], cn = {
|
|
309
369
|
key: 0,
|
|
310
370
|
role: "alert",
|
|
311
371
|
class: "mr-designer-error"
|
|
312
|
-
},
|
|
372
|
+
}, vn = {
|
|
313
373
|
key: 1,
|
|
314
374
|
role: "alert",
|
|
315
375
|
class: "mr-designer-error"
|
|
316
|
-
},
|
|
376
|
+
}, mn = {
|
|
317
377
|
key: 3,
|
|
318
|
-
class: "mr-designer-note"
|
|
319
|
-
},
|
|
378
|
+
class: "mr-designer-note mr-designer-invalid"
|
|
379
|
+
}, fn = /* @__PURE__ */ be({
|
|
320
380
|
__name: "ReportTemplateEditor",
|
|
321
381
|
props: {
|
|
322
382
|
modelValue: {},
|
|
@@ -328,301 +388,554 @@ const Te = ["aria-label"], Re = { class: "mr-designer-bar" }, Ve = { key: 0 }, D
|
|
|
328
388
|
save: { type: Function }
|
|
329
389
|
},
|
|
330
390
|
emits: ["update:modelValue", "saved"],
|
|
331
|
-
setup(c, { expose:
|
|
332
|
-
const
|
|
333
|
-
f(
|
|
334
|
-
}), {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
391
|
+
setup(c, { expose: M, emit: u }) {
|
|
392
|
+
const b = c, f = u, s = Be(b, (S, l) => {
|
|
393
|
+
f(S === "saved" ? "saved" : "update:modelValue", l);
|
|
394
|
+
}), {
|
|
395
|
+
draft: C,
|
|
396
|
+
json: B,
|
|
397
|
+
selected: w,
|
|
398
|
+
error: p,
|
|
399
|
+
saving: g,
|
|
400
|
+
pendingLocalChanges: _,
|
|
401
|
+
jsonPending: T,
|
|
402
|
+
blocked: h,
|
|
403
|
+
confirmation: L,
|
|
404
|
+
canUndo: Q,
|
|
405
|
+
canRedo: I,
|
|
406
|
+
validation: j,
|
|
407
|
+
lists: H,
|
|
408
|
+
activeList: d,
|
|
409
|
+
visibleColumns: r,
|
|
410
|
+
query: i,
|
|
411
|
+
selectedColumns: m,
|
|
412
|
+
fetcher: x,
|
|
413
|
+
messages: t
|
|
414
|
+
} = s, V = Le(
|
|
415
|
+
r,
|
|
416
|
+
w,
|
|
417
|
+
d,
|
|
418
|
+
i
|
|
419
|
+
), { section: O, activeIndex: z, activeColumn: E } = V, G = `mr-designer-${ye()?.uid ?? 0}`, N = ["fields", "template", "advanced"], le = A(
|
|
420
|
+
() => g.value ? t.value.saving : b.readonly ? t.value.readonly : _.value ? t.value.dirty : t.value.ready
|
|
421
|
+
), q = $(null), oe = $(null);
|
|
422
|
+
W(O, async (S) => {
|
|
423
|
+
if (S !== "fields") return;
|
|
424
|
+
await te();
|
|
425
|
+
const l = oe.value, o = l?.querySelector(
|
|
426
|
+
`button[data-column-index="${z.value}"]`
|
|
427
|
+
);
|
|
428
|
+
if (!l || !o) return;
|
|
429
|
+
const v = l.getBoundingClientRect(), D = o.getBoundingClientRect(), ee = v.top + l.clientTop, ve = ee + l.clientHeight;
|
|
430
|
+
D.top < ee ? l.scrollTop += D.top - ee : D.bottom > ve && (l.scrollTop += D.bottom - ve);
|
|
431
|
+
});
|
|
432
|
+
let X = null;
|
|
433
|
+
W(L, async (S) => {
|
|
434
|
+
S ? (X = document.activeElement, await te(), q.value?.focus()) : (await te(), X?.isConnected && X.focus(), X = null);
|
|
435
|
+
}), M({
|
|
436
|
+
get pendingLocalChanges() {
|
|
437
|
+
return _.value;
|
|
438
|
+
},
|
|
439
|
+
get saving() {
|
|
440
|
+
return g.value;
|
|
441
|
+
},
|
|
442
|
+
get blocked() {
|
|
443
|
+
return h.value;
|
|
444
|
+
},
|
|
445
|
+
guardChanges: s.guardChanges,
|
|
446
|
+
reset: s.reset,
|
|
447
|
+
save: s.save
|
|
448
|
+
});
|
|
449
|
+
function F(S) {
|
|
450
|
+
return S.target.value;
|
|
451
|
+
}
|
|
452
|
+
function ae(S) {
|
|
453
|
+
return S.target.checked;
|
|
343
454
|
}
|
|
344
|
-
function
|
|
345
|
-
|
|
455
|
+
function Z(S, l) {
|
|
456
|
+
const o = S.target;
|
|
457
|
+
s.alignColumns(
|
|
458
|
+
l,
|
|
459
|
+
o.value
|
|
460
|
+
), o.value = "";
|
|
346
461
|
}
|
|
347
|
-
function
|
|
348
|
-
const
|
|
349
|
-
|
|
462
|
+
async function ie(S) {
|
|
463
|
+
const l = V.moveColumn(S.key);
|
|
464
|
+
if (l === void 0) return;
|
|
465
|
+
S.preventDefault();
|
|
466
|
+
const o = S.currentTarget.closest(
|
|
467
|
+
".mr-designer-column-list"
|
|
468
|
+
);
|
|
469
|
+
await te();
|
|
470
|
+
const v = o?.querySelector(
|
|
471
|
+
`button[data-column-index="${l}"]`
|
|
472
|
+
);
|
|
473
|
+
v?.focus({ preventScroll: !0 }), v?.scrollIntoView({ block: "nearest" });
|
|
350
474
|
}
|
|
351
|
-
|
|
475
|
+
async function re(S) {
|
|
476
|
+
const o = {
|
|
477
|
+
ArrowRight: 1,
|
|
478
|
+
ArrowLeft: -1,
|
|
479
|
+
Home: -N.length,
|
|
480
|
+
End: N.length
|
|
481
|
+
}[S.key];
|
|
482
|
+
if (o === void 0) return;
|
|
483
|
+
S.preventDefault();
|
|
484
|
+
const v = N.indexOf(O.value), D = S.key === "Home" ? 0 : S.key === "End" ? N.length - 1 : (v + o + N.length) % N.length;
|
|
485
|
+
O.value = N[D];
|
|
486
|
+
const ee = S.currentTarget.parentElement;
|
|
487
|
+
await te(), ee?.querySelector(`#${G}-tab-${O.value}`)?.focus();
|
|
488
|
+
}
|
|
489
|
+
return (S, l) => (y(), k("section", {
|
|
352
490
|
class: "mr-designer",
|
|
353
|
-
"aria-label": e(t).title
|
|
491
|
+
"aria-label": e(t).title,
|
|
492
|
+
"aria-busy": e(g)
|
|
354
493
|
}, [
|
|
355
|
-
n("header",
|
|
356
|
-
n("div",
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
494
|
+
n("header", Oe, [
|
|
495
|
+
n("div", Ie, [
|
|
496
|
+
ne(Y, {
|
|
497
|
+
name: "columns",
|
|
498
|
+
size: 18
|
|
499
|
+
}),
|
|
500
|
+
n("div", null, [
|
|
501
|
+
n("strong", null, a(e(t).heading), 1),
|
|
502
|
+
n("span", {
|
|
503
|
+
class: me({ "mr-designer-dirty": e(_) })
|
|
504
|
+
}, a(le.value), 3)
|
|
361
505
|
])
|
|
362
506
|
]),
|
|
363
|
-
n("div",
|
|
364
|
-
n("
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
507
|
+
n("div", Je, [
|
|
508
|
+
n("div", Ne, [
|
|
509
|
+
n("button", {
|
|
510
|
+
type: "button",
|
|
511
|
+
class: "mr-designer-icon-button",
|
|
512
|
+
"aria-label": e(t).undo,
|
|
513
|
+
title: e(t).undo,
|
|
514
|
+
disabled: c.readonly || e(h) || !e(Q),
|
|
515
|
+
onClick: l[0] || (l[0] = //@ts-ignore
|
|
516
|
+
(...o) => e(s).undo && e(s).undo(...o))
|
|
517
|
+
}, [...l[25] || (l[25] = [
|
|
518
|
+
n("svg", {
|
|
519
|
+
viewBox: "0 0 24 24",
|
|
520
|
+
fill: "none",
|
|
521
|
+
"aria-hidden": "true"
|
|
522
|
+
}, [
|
|
523
|
+
n("path", { d: "M4 10h10a6 6 0 0 1 0 12M4 10l5-5M4 10l5 5" })
|
|
524
|
+
], -1)
|
|
525
|
+
])], 8, Pe),
|
|
526
|
+
n("button", {
|
|
527
|
+
type: "button",
|
|
528
|
+
class: "mr-designer-icon-button",
|
|
529
|
+
"aria-label": e(t).redo,
|
|
530
|
+
title: e(t).redo,
|
|
531
|
+
disabled: c.readonly || e(h) || !e(I),
|
|
532
|
+
onClick: l[1] || (l[1] = //@ts-ignore
|
|
533
|
+
(...o) => e(s).redo && e(s).redo(...o))
|
|
534
|
+
}, [...l[26] || (l[26] = [
|
|
535
|
+
n("svg", {
|
|
536
|
+
viewBox: "0 0 24 24",
|
|
537
|
+
fill: "none",
|
|
538
|
+
"aria-hidden": "true"
|
|
539
|
+
}, [
|
|
540
|
+
n("path", { d: "M20 10H10a6 6 0 0 0 0 12m10-12-5-5m5 5-5 5" })
|
|
541
|
+
], -1)
|
|
542
|
+
])], 8, He)
|
|
543
|
+
]),
|
|
376
544
|
n("button", {
|
|
377
545
|
type: "button",
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
546
|
+
class: "mr-designer-reset",
|
|
547
|
+
disabled: c.readonly || e(h) || !e(_),
|
|
548
|
+
onClick: l[2] || (l[2] = //@ts-ignore
|
|
549
|
+
(...o) => e(s).reset && e(s).reset(...o))
|
|
550
|
+
}, a(e(t).reset), 9, Ge),
|
|
551
|
+
c.save ? (y(), k("button", {
|
|
383
552
|
key: 0,
|
|
384
553
|
type: "button",
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
554
|
+
class: "mr-designer-save",
|
|
555
|
+
disabled: c.readonly || e(h) || e(T) || !e(j).ok || !e(_),
|
|
556
|
+
onClick: l[3] || (l[3] = //@ts-ignore
|
|
557
|
+
(...o) => e(s).save && e(s).save(...o))
|
|
558
|
+
}, [
|
|
559
|
+
ne(Y, {
|
|
560
|
+
name: "file",
|
|
561
|
+
size: 14
|
|
562
|
+
}),
|
|
563
|
+
R(a(e(g) ? e(t).saving : e(t).save), 1)
|
|
564
|
+
], 8, Fe)) : P("", !0)
|
|
389
565
|
])
|
|
390
566
|
]),
|
|
391
|
-
e(
|
|
567
|
+
e(L) ? (y(), k("div", {
|
|
392
568
|
key: 0,
|
|
393
569
|
role: "alertdialog",
|
|
394
570
|
"aria-label": e(t).discardTitle,
|
|
395
571
|
class: "mr-designer-confirm",
|
|
396
|
-
onKeydown:
|
|
572
|
+
onKeydown: l[6] || (l[6] = _e(ke((o) => e(s).decideDiscard(!1), ["prevent"]), ["esc"]))
|
|
397
573
|
}, [
|
|
398
|
-
n("
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
Q(n("input", {
|
|
446
|
-
"onUpdate:modelValue": d[10] || (d[10] = (o) => X(s) ? s.value = o : null),
|
|
447
|
-
type: "search"
|
|
448
|
-
}, null, 512), [
|
|
449
|
-
[oe, e(s)]
|
|
450
|
-
])
|
|
451
|
-
]),
|
|
452
|
-
n("div", Ue, [
|
|
453
|
-
n("button", {
|
|
454
|
-
type: "button",
|
|
455
|
-
disabled: c.readonly || e(m) || e(E) || !e(i).length,
|
|
456
|
-
onClick: d[11] || (d[11] = (o) => e(a).selectVisible(!0))
|
|
457
|
-
}, l(e(t).selectVisible), 9, $e),
|
|
458
|
-
n("button", {
|
|
459
|
-
type: "button",
|
|
460
|
-
disabled: !e(v).length,
|
|
461
|
-
onClick: d[12] || (d[12] = //@ts-ignore
|
|
462
|
-
(...o) => e(a).clearSelection && e(a).clearSelection(...o))
|
|
463
|
-
}, l(e(t).clearSelection), 9, qe),
|
|
464
|
-
n("span", We, l(e(t).columnsSelected) + " " + l(e(v).length) + " / " + l(e(r).columns.length), 1)
|
|
465
|
-
]),
|
|
466
|
-
e(v).length ? (S(), A("div", Ke, [
|
|
467
|
-
n("label", null, [
|
|
468
|
-
D(l(e(t).batchBody), 1),
|
|
469
|
-
n("select", {
|
|
470
|
-
"aria-label": e(t).batchBody,
|
|
471
|
-
disabled: c.readonly || e(m) || e(E),
|
|
472
|
-
onChange: d[13] || (d[13] = (o) => W(o, "align"))
|
|
473
|
-
}, [
|
|
474
|
-
n("option", Qe, l(e(t).chooseAlignment), 1),
|
|
475
|
-
n("option", Xe, l(e(t).auto), 1),
|
|
476
|
-
n("option", Ye, l(e(t).left), 1),
|
|
477
|
-
n("option", Ze, l(e(t).center), 1),
|
|
478
|
-
n("option", et, l(e(t).right), 1),
|
|
479
|
-
n("option", tt, l(e(t).justify), 1)
|
|
480
|
-
], 40, ze)
|
|
481
|
-
]),
|
|
482
|
-
n("label", null, [
|
|
483
|
-
D(l(e(t).batchHeader), 1),
|
|
484
|
-
n("select", {
|
|
485
|
-
"aria-label": e(t).batchHeader,
|
|
486
|
-
disabled: c.readonly || e(m) || e(E),
|
|
487
|
-
onChange: d[14] || (d[14] = (o) => W(o, "headerAlign"))
|
|
574
|
+
n("div", null, [
|
|
575
|
+
n("strong", null, a(e(t).discardTitle), 1),
|
|
576
|
+
n("p", null, a(e(t).discardDescription), 1)
|
|
577
|
+
]),
|
|
578
|
+
n("div", null, [
|
|
579
|
+
n("button", {
|
|
580
|
+
ref_key: "keepButton",
|
|
581
|
+
ref: q,
|
|
582
|
+
type: "button",
|
|
583
|
+
onClick: l[4] || (l[4] = (o) => e(s).decideDiscard(!1))
|
|
584
|
+
}, a(e(t).keepEditing), 513),
|
|
585
|
+
n("button", {
|
|
586
|
+
type: "button",
|
|
587
|
+
onClick: l[5] || (l[5] = (o) => e(s).decideDiscard(!0))
|
|
588
|
+
}, a(e(t).discard), 1)
|
|
589
|
+
])
|
|
590
|
+
], 40, Ue)) : P("", !0),
|
|
591
|
+
n("div", ze, [
|
|
592
|
+
n("aside", qe, [
|
|
593
|
+
n("nav", {
|
|
594
|
+
class: "mr-designer-tabs",
|
|
595
|
+
role: "tablist",
|
|
596
|
+
"aria-label": e(t).sectionsLabel
|
|
597
|
+
}, [
|
|
598
|
+
(y(), k(K, null, se(N, (o) => n("button", {
|
|
599
|
+
id: `${G}-tab-${o}`,
|
|
600
|
+
key: o,
|
|
601
|
+
type: "button",
|
|
602
|
+
role: "tab",
|
|
603
|
+
"aria-selected": e(O) === o,
|
|
604
|
+
"aria-controls": `${G}-panel-${o}`,
|
|
605
|
+
tabindex: e(O) === o ? 0 : -1,
|
|
606
|
+
onClick: (v) => O.value = o,
|
|
607
|
+
onKeydown: re
|
|
608
|
+
}, a(e(t)[`${o}Section`]), 41, We)), 64))
|
|
609
|
+
], 8, Ke),
|
|
610
|
+
n("div", {
|
|
611
|
+
id: `${G}-panel-${e(O)}`,
|
|
612
|
+
class: "mr-designer-panel",
|
|
613
|
+
role: "tabpanel",
|
|
614
|
+
"aria-labelledby": `${G}-tab-${e(O)}`
|
|
615
|
+
}, [
|
|
616
|
+
e(O) === "fields" ? (y(), k(K, { key: 0 }, [
|
|
617
|
+
e(H).length > 1 ? (y(), k("label", Xe, [
|
|
618
|
+
R(a(e(t).area), 1),
|
|
619
|
+
de(n("select", {
|
|
620
|
+
"onUpdate:modelValue": l[7] || (l[7] = (o) => ue(w) ? w.value = o : null)
|
|
488
621
|
}, [
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
])
|
|
496
|
-
])) : H("", !0),
|
|
497
|
-
e(i).length ? H("", !0) : (S(), A("p", rt, l(e(t).noColumns), 1)),
|
|
498
|
-
(S(!0), A(Y, null, Z(e(i), ({ column: o, index: T }) => (S(), A("fieldset", {
|
|
499
|
-
key: T,
|
|
500
|
-
disabled: c.readonly || e(m) || e(E)
|
|
501
|
-
}, [
|
|
502
|
-
n("legend", null, [
|
|
503
|
-
n("label", dt, [
|
|
504
|
-
n("input", {
|
|
505
|
-
type: "checkbox",
|
|
506
|
-
checked: e(v).includes(T),
|
|
507
|
-
onChange: (R) => e(a).toggleColumn(T, z(R))
|
|
508
|
-
}, null, 40, ct),
|
|
509
|
-
D(l(T + 1) + " · " + l(o.header), 1)
|
|
622
|
+
(y(!0), k(K, null, se(e(H), (o, v) => (y(), k("option", {
|
|
623
|
+
key: v,
|
|
624
|
+
value: v
|
|
625
|
+
}, a(o.pageIndex + 1) + " " + a(e(t).page) + " · " + a(o.component.title || o.component.dataset), 9, Ye))), 128))
|
|
626
|
+
], 512), [
|
|
627
|
+
[Ce, e(w)]
|
|
510
628
|
])
|
|
511
|
-
]),
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
629
|
+
])) : P("", !0),
|
|
630
|
+
e(d) ? (y(), k("div", Ze, [
|
|
631
|
+
n("div", et, [
|
|
632
|
+
n("strong", null, a(e(t).columnDirectory), 1),
|
|
633
|
+
n("span", null, a(e(d).columns.length) + " " + a(e(t).fieldsCount), 1)
|
|
634
|
+
]),
|
|
635
|
+
n("div", tt, [
|
|
636
|
+
ne(Y, {
|
|
637
|
+
name: "search",
|
|
638
|
+
size: 15
|
|
639
|
+
}),
|
|
640
|
+
de(n("input", {
|
|
641
|
+
"onUpdate:modelValue": l[8] || (l[8] = (o) => ue(i) ? i.value = o : null),
|
|
642
|
+
type: "search",
|
|
643
|
+
"aria-label": e(t).columnsSearch,
|
|
644
|
+
placeholder: e(t).columnsSearch
|
|
645
|
+
}, null, 8, nt), [
|
|
646
|
+
[fe, e(i)]
|
|
647
|
+
]),
|
|
648
|
+
e(i) ? (y(), k("button", {
|
|
649
|
+
key: 0,
|
|
650
|
+
type: "button",
|
|
651
|
+
class: "mr-designer-icon-button",
|
|
652
|
+
"aria-label": e(t).clearSearch,
|
|
653
|
+
title: e(t).clearSearch,
|
|
654
|
+
onClick: l[9] || (l[9] = (o) => i.value = "")
|
|
655
|
+
}, [
|
|
656
|
+
ne(Y, {
|
|
657
|
+
name: "close",
|
|
658
|
+
size: 14
|
|
659
|
+
})
|
|
660
|
+
], 8, lt)) : P("", !0)
|
|
661
|
+
]),
|
|
662
|
+
n("div", ot, [
|
|
663
|
+
n("button", {
|
|
664
|
+
type: "button",
|
|
665
|
+
disabled: c.readonly || e(h) || e(T) || !e(r).length,
|
|
666
|
+
onClick: l[10] || (l[10] = (o) => e(s).selectVisible(!0))
|
|
667
|
+
}, a(e(t).selectVisible), 9, at),
|
|
668
|
+
e(m).length ? (y(), k("button", {
|
|
669
|
+
key: 0,
|
|
670
|
+
type: "button",
|
|
671
|
+
onClick: l[11] || (l[11] = //@ts-ignore
|
|
672
|
+
(...o) => e(s).clearSelection && e(s).clearSelection(...o))
|
|
673
|
+
}, a(e(t).clearSelection), 1)) : P("", !0),
|
|
674
|
+
e(m).length ? (y(), k("span", st, a(e(t).columnsSelected) + " " + a(e(m).length), 1)) : (y(), k("span", it, a(e(r).length) + " / " + a(e(d).columns.length), 1))
|
|
675
|
+
]),
|
|
676
|
+
n("div", {
|
|
677
|
+
ref_key: "columnList",
|
|
678
|
+
ref: oe,
|
|
679
|
+
class: "mr-designer-column-list",
|
|
680
|
+
"aria-label": e(t).columnDirectory,
|
|
681
|
+
role: "group"
|
|
682
|
+
}, [
|
|
683
|
+
(y(!0), k(K, null, se(e(r), ({ column: o, index: v }) => (y(), k("div", {
|
|
684
|
+
key: v,
|
|
685
|
+
class: me(["mr-designer-column-row", { "is-active": e(z) === v }])
|
|
686
|
+
}, [
|
|
687
|
+
n("input", {
|
|
688
|
+
type: "checkbox",
|
|
689
|
+
"aria-label": `${e(t).selectColumn} ${o.header}`,
|
|
690
|
+
checked: e(m).includes(v),
|
|
691
|
+
disabled: c.readonly || e(h) || e(T),
|
|
692
|
+
onChange: (D) => e(s).toggleColumn(v, ae(D))
|
|
693
|
+
}, null, 40, dt),
|
|
694
|
+
n("button", {
|
|
695
|
+
type: "button",
|
|
696
|
+
"data-column-index": v,
|
|
697
|
+
"aria-pressed": e(z) === v,
|
|
698
|
+
tabindex: e(z) === v ? 0 : -1,
|
|
699
|
+
onClick: (D) => e(V).activate(v),
|
|
700
|
+
onKeydown: ie
|
|
701
|
+
}, [
|
|
702
|
+
n("span", ct, a(v + 1), 1),
|
|
703
|
+
n("span", vt, [
|
|
704
|
+
n("strong", null, a(o.header), 1),
|
|
705
|
+
n("small", null, a(o.field), 1)
|
|
706
|
+
]),
|
|
707
|
+
e(z) === v ? (y(), ge(Y, {
|
|
708
|
+
key: 0,
|
|
709
|
+
name: "chevron-right",
|
|
710
|
+
size: 14
|
|
711
|
+
})) : P("", !0)
|
|
712
|
+
], 40, ut)
|
|
713
|
+
], 2))), 128)),
|
|
714
|
+
e(r).length ? P("", !0) : (y(), k("p", mt, [
|
|
715
|
+
ne(Y, {
|
|
716
|
+
name: "search",
|
|
717
|
+
size: 20
|
|
718
|
+
}),
|
|
719
|
+
R(a(e(t).noColumns), 1)
|
|
720
|
+
]))
|
|
721
|
+
], 8, rt),
|
|
722
|
+
e(m).length ? (y(), k("div", ft, [
|
|
723
|
+
n("label", null, [
|
|
724
|
+
R(a(e(t).batchBody), 1),
|
|
725
|
+
n("select", {
|
|
726
|
+
"aria-label": e(t).batchBody,
|
|
727
|
+
disabled: c.readonly || e(h) || e(T),
|
|
728
|
+
onChange: l[12] || (l[12] = (o) => Z(o, "align"))
|
|
729
|
+
}, [
|
|
730
|
+
n("option", ht, a(e(t).chooseAlignment), 1),
|
|
731
|
+
n("option", pt, a(e(t).auto), 1),
|
|
732
|
+
n("option", bt, a(e(t).left), 1),
|
|
733
|
+
n("option", yt, a(e(t).center), 1),
|
|
734
|
+
n("option", _t, a(e(t).right), 1),
|
|
735
|
+
n("option", kt, a(e(t).justify), 1)
|
|
736
|
+
], 40, gt)
|
|
737
|
+
]),
|
|
738
|
+
n("label", null, [
|
|
739
|
+
R(a(e(t).batchHeader), 1),
|
|
740
|
+
n("select", {
|
|
741
|
+
"aria-label": e(t).batchHeader,
|
|
742
|
+
disabled: c.readonly || e(h) || e(T),
|
|
743
|
+
onChange: l[13] || (l[13] = (o) => Z(o, "headerAlign"))
|
|
744
|
+
}, [
|
|
745
|
+
n("option", wt, a(e(t).chooseAlignment), 1),
|
|
746
|
+
n("option", St, a(e(t).left), 1),
|
|
747
|
+
n("option", xt, a(e(t).center), 1),
|
|
748
|
+
n("option", Et, a(e(t).right), 1),
|
|
749
|
+
n("option", Mt, a(e(t).justify), 1)
|
|
750
|
+
], 40, Ct)
|
|
751
|
+
])
|
|
752
|
+
])) : P("", !0),
|
|
753
|
+
e(E) ? (y(), k("fieldset", {
|
|
754
|
+
key: 1,
|
|
755
|
+
class: "mr-designer-properties",
|
|
756
|
+
disabled: c.readonly || e(h) || e(T)
|
|
757
|
+
}, [
|
|
758
|
+
n("legend", null, [
|
|
759
|
+
R(a(e(t).columnProperties) + " ", 1),
|
|
760
|
+
n("span", null, a(e(E).index + 1) + " · " + a(e(E).column.header), 1)
|
|
761
|
+
]),
|
|
762
|
+
n("label", null, [
|
|
763
|
+
R(a(e(t).header), 1),
|
|
764
|
+
n("input", {
|
|
765
|
+
value: e(E).column.header,
|
|
766
|
+
onInput: l[14] || (l[14] = (o) => e(s).setColumn(
|
|
767
|
+
e(E).index,
|
|
768
|
+
"header",
|
|
769
|
+
F(o)
|
|
770
|
+
))
|
|
771
|
+
}, null, 40, At)
|
|
772
|
+
]),
|
|
773
|
+
n("label", null, [
|
|
774
|
+
R(a(e(t).field), 1),
|
|
775
|
+
n("input", {
|
|
776
|
+
value: e(E).column.field,
|
|
777
|
+
onChange: l[15] || (l[15] = (o) => e(s).setColumn(
|
|
778
|
+
e(E).index,
|
|
779
|
+
"field",
|
|
780
|
+
F(o)
|
|
781
|
+
))
|
|
782
|
+
}, null, 40, Dt)
|
|
783
|
+
]),
|
|
784
|
+
n("label", null, [
|
|
785
|
+
R(a(e(t).width), 1),
|
|
786
|
+
n("input", {
|
|
787
|
+
type: "number",
|
|
788
|
+
min: "0.1",
|
|
789
|
+
step: "0.5",
|
|
790
|
+
value: e(E).column.widthMm,
|
|
791
|
+
onChange: l[16] || (l[16] = (o) => e(s).setColumn(
|
|
792
|
+
e(E).index,
|
|
793
|
+
"widthMm",
|
|
794
|
+
F(o)
|
|
795
|
+
))
|
|
796
|
+
}, null, 40, jt)
|
|
797
|
+
]),
|
|
798
|
+
n("label", null, [
|
|
799
|
+
R(a(e(t).semantic), 1),
|
|
800
|
+
n("select", {
|
|
801
|
+
value: e(E).column.semanticRole || "text",
|
|
802
|
+
onChange: l[17] || (l[17] = (o) => e(s).setColumn(
|
|
803
|
+
e(E).index,
|
|
804
|
+
"semanticRole",
|
|
805
|
+
F(o)
|
|
806
|
+
))
|
|
807
|
+
}, [
|
|
808
|
+
n("option", $t, a(e(t).identifier), 1),
|
|
809
|
+
n("option", Bt, a(e(t).dimension), 1),
|
|
810
|
+
n("option", Lt, a(e(t).measure), 1),
|
|
811
|
+
n("option", Vt, a(e(t).date), 1),
|
|
812
|
+
n("option", Ot, a(e(t).text), 1)
|
|
813
|
+
], 40, Rt)
|
|
814
|
+
]),
|
|
815
|
+
n("label", null, [
|
|
816
|
+
R(a(e(t).bodyAlign), 1),
|
|
817
|
+
n("select", {
|
|
818
|
+
value: e(E).column.align ?? e(E).column.style?.align ?? e(d).align ?? "left",
|
|
819
|
+
onChange: l[18] || (l[18] = (o) => e(s).setColumn(
|
|
820
|
+
e(E).index,
|
|
821
|
+
"align",
|
|
822
|
+
F(o)
|
|
823
|
+
))
|
|
824
|
+
}, [
|
|
825
|
+
n("option", Jt, a(e(t).auto), 1),
|
|
826
|
+
n("option", Nt, a(e(t).left), 1),
|
|
827
|
+
n("option", Pt, a(e(t).center), 1),
|
|
828
|
+
n("option", Ht, a(e(t).right), 1),
|
|
829
|
+
n("option", Gt, a(e(t).justify), 1)
|
|
830
|
+
], 40, It)
|
|
831
|
+
]),
|
|
832
|
+
n("label", null, [
|
|
833
|
+
R(a(e(t).headerAlign), 1),
|
|
834
|
+
n("select", {
|
|
835
|
+
value: e(s).headerAlignments.value[e(E).index],
|
|
836
|
+
onChange: l[19] || (l[19] = (o) => e(s).setColumn(
|
|
837
|
+
e(E).index,
|
|
838
|
+
"headerAlign",
|
|
839
|
+
F(o)
|
|
840
|
+
))
|
|
841
|
+
}, [
|
|
842
|
+
n("option", Ut, a(e(t).left), 1),
|
|
843
|
+
n("option", zt, a(e(t).center), 1),
|
|
844
|
+
n("option", qt, a(e(t).right), 1),
|
|
845
|
+
n("option", Kt, a(e(t).justify), 1)
|
|
846
|
+
], 40, Ft)
|
|
847
|
+
]),
|
|
848
|
+
n("label", Wt, [
|
|
849
|
+
R(a(e(t).editable), 1),
|
|
850
|
+
n("input", {
|
|
851
|
+
type: "checkbox",
|
|
852
|
+
checked: e(E).column.editable === !0,
|
|
853
|
+
onChange: l[20] || (l[20] = (o) => e(s).setColumn(
|
|
854
|
+
e(E).index,
|
|
855
|
+
"editable",
|
|
856
|
+
ae(o)
|
|
857
|
+
))
|
|
858
|
+
}, null, 40, Qt)
|
|
859
|
+
])
|
|
860
|
+
], 8, Tt)) : P("", !0)
|
|
861
|
+
])) : (y(), k("p", Xt, a(e(t).noColumns), 1))
|
|
862
|
+
], 64)) : e(O) === "template" ? (y(), k(K, { key: 1 }, [
|
|
863
|
+
n("h3", null, a(e(t).templateDetails), 1),
|
|
864
|
+
n("label", Yt, [
|
|
865
|
+
R(a(e(t).name), 1),
|
|
528
866
|
n("input", {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
onChange: (R) => e(a).setColumn(T, "widthMm", F(R))
|
|
534
|
-
}, null, 40, ht)
|
|
867
|
+
value: e(C).name,
|
|
868
|
+
disabled: c.readonly || e(h) || e(T),
|
|
869
|
+
onInput: l[21] || (l[21] = (o) => e(s).setName(F(o)))
|
|
870
|
+
}, null, 40, Zt)
|
|
535
871
|
]),
|
|
536
|
-
n("label",
|
|
537
|
-
|
|
538
|
-
n("
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
n("option", bt, l(e(t).measure), 1),
|
|
545
|
-
n("option", yt, l(e(t).date), 1),
|
|
546
|
-
n("option", _t, l(e(t).text), 1)
|
|
547
|
-
], 40, mt)
|
|
872
|
+
n("label", en, [
|
|
873
|
+
R(a(e(t).description), 1),
|
|
874
|
+
n("textarea", {
|
|
875
|
+
rows: "4",
|
|
876
|
+
value: e(C).description,
|
|
877
|
+
disabled: c.readonly || e(h) || e(T),
|
|
878
|
+
onInput: l[22] || (l[22] = (o) => e(s).setDescription(F(o)))
|
|
879
|
+
}, null, 40, tn)
|
|
548
880
|
]),
|
|
549
|
-
n("
|
|
550
|
-
|
|
551
|
-
n("
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}, [
|
|
555
|
-
n("option", St, l(e(t).auto), 1),
|
|
556
|
-
n("option", wt, l(e(t).left), 1),
|
|
557
|
-
n("option", kt, l(e(t).center), 1),
|
|
558
|
-
n("option", Et, l(e(t).right), 1),
|
|
559
|
-
n("option", Mt, l(e(t).justify), 1)
|
|
560
|
-
], 40, Ct)
|
|
881
|
+
n("dl", nn, [
|
|
882
|
+
n("dt", null, a(e(t).templateIdentity), 1),
|
|
883
|
+
n("dd", null, a(e(C).id), 1),
|
|
884
|
+
n("dt", null, a(e(t).templateRevision), 1),
|
|
885
|
+
n("dd", null, a(e(C).revision || e(t).unpublished), 1)
|
|
561
886
|
]),
|
|
562
|
-
n("
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
887
|
+
n("p", ln, a(e(t).note), 1)
|
|
888
|
+
], 64)) : (y(), k(K, { key: 2 }, [
|
|
889
|
+
n("h3", null, a(e(t).advancedTitle), 1),
|
|
890
|
+
n("p", on, a(e(t).advancedDescription), 1),
|
|
891
|
+
n("label", an, [
|
|
892
|
+
R(a(e(t).json), 1),
|
|
893
|
+
de(n("textarea", {
|
|
894
|
+
"onUpdate:modelValue": l[23] || (l[23] = (o) => ue(B) ? B.value = o : null),
|
|
895
|
+
class: "mr-designer-json",
|
|
896
|
+
"aria-label": e(t).json,
|
|
897
|
+
disabled: c.readonly || e(h),
|
|
898
|
+
spellcheck: "false"
|
|
899
|
+
}, null, 8, sn), [
|
|
900
|
+
[fe, e(B)]
|
|
901
|
+
])
|
|
573
902
|
]),
|
|
574
|
-
n("
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
]
|
|
584
|
-
n("details", null, [
|
|
585
|
-
n("summary", null, l(e(t).json), 1),
|
|
586
|
-
Q(n("textarea", {
|
|
587
|
-
"onUpdate:modelValue": d[15] || (d[15] = (o) => X(L) ? L.value = o : null),
|
|
588
|
-
class: "mr-designer-json",
|
|
589
|
-
"aria-label": e(t).json,
|
|
590
|
-
disabled: c.readonly || e(m),
|
|
591
|
-
spellcheck: "false"
|
|
592
|
-
}, null, 8, Jt), [
|
|
593
|
-
[oe, e(L)]
|
|
594
|
-
]),
|
|
595
|
-
n("button", {
|
|
596
|
-
type: "button",
|
|
597
|
-
disabled: c.readonly || e(m),
|
|
598
|
-
onClick: d[16] || (d[16] = //@ts-ignore
|
|
599
|
-
(...o) => e(a).applyJson && e(a).applyJson(...o))
|
|
600
|
-
}, l(e(t).applyJson), 9, Ot)
|
|
601
|
-
]),
|
|
602
|
-
e(E) ? (S(), A("p", Lt, l(e(t).jsonPending), 1)) : H("", !0),
|
|
603
|
-
n("p", Nt, l(e(t).note), 1)
|
|
903
|
+
n("button", {
|
|
904
|
+
type: "button",
|
|
905
|
+
class: "mr-designer-apply-json",
|
|
906
|
+
disabled: c.readonly || e(h),
|
|
907
|
+
onClick: l[24] || (l[24] = //@ts-ignore
|
|
908
|
+
(...o) => e(s).applyJson && e(s).applyJson(...o))
|
|
909
|
+
}, a(e(t).applyJson), 9, rn)
|
|
910
|
+
], 64)),
|
|
911
|
+
e(T) ? (y(), k("p", dn, a(e(t).jsonPending), 1)) : P("", !0)
|
|
912
|
+
], 8, Qe)
|
|
604
913
|
]),
|
|
605
|
-
n("div",
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
914
|
+
n("div", {
|
|
915
|
+
class: "mr-designer-preview",
|
|
916
|
+
"aria-label": e(t).previewTitle
|
|
917
|
+
}, [
|
|
918
|
+
e(p) ? (y(), k("div", cn, a(e(p)), 1)) : P("", !0),
|
|
919
|
+
e(j).ok ? P("", !0) : (y(), k("ul", vn, [
|
|
920
|
+
(y(!0), k(K, null, se(e(j).errors, (o) => (y(), k("li", {
|
|
609
921
|
key: o.path
|
|
610
|
-
},
|
|
922
|
+
}, a(o.path) + ":" + a(o.message), 1))), 128))
|
|
611
923
|
])),
|
|
612
|
-
e(
|
|
924
|
+
e(x) && e(j).ok ? (y(), ge(e(xe), {
|
|
613
925
|
key: 2,
|
|
614
926
|
"report-id": "draft",
|
|
615
|
-
fetcher: e(
|
|
927
|
+
fetcher: e(x),
|
|
616
928
|
"show-params": !1,
|
|
617
929
|
editable: !1,
|
|
618
|
-
"excel-import": !1
|
|
619
|
-
|
|
620
|
-
|
|
930
|
+
"excel-import": !1,
|
|
931
|
+
height: "100%"
|
|
932
|
+
}, null, 8, ["fetcher"])) : (y(), k("p", mn, a(e(t).invalid), 1))
|
|
933
|
+
], 8, un)
|
|
621
934
|
])
|
|
622
|
-
], 8,
|
|
935
|
+
], 8, Ve));
|
|
623
936
|
}
|
|
624
|
-
}),
|
|
937
|
+
}), yn = /* @__PURE__ */ Ee(fn, [["__scopeId", "data-v-8bbff75e"]]);
|
|
625
938
|
export {
|
|
626
|
-
|
|
627
|
-
|
|
939
|
+
yn as ReportTemplateEditor,
|
|
940
|
+
$e as TEMPLATE_EDITOR_MESSAGES
|
|
628
941
|
};
|