@agile-team/mach-report 2.8.2 → 2.8.4

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/dist/designer.js CHANGED
@@ -1,122 +1,266 @@
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 }] : [];
1
+ import { defineComponent as Ce, openBlock as p, createElementBlock as y, Fragment as X, renderList as oe, toDisplayString as s, nextTick as Y, ref as D, watch as te, onMounted as Ee, onBeforeUnmount as be, computed as j, shallowRef as Ae, getCurrentInstance as Te, unref as e, createElementVNode as n, createVNode as q, normalizeClass as me, createTextVNode as P, createCommentVNode as H, withKeys as ge, withModifiers as De, withDirectives as fe, isRef as he, vModelSelect as $e, vModelText as _e, createBlock as ke } from "vue";
2
+ import { provideMachReportConfig as je, createLocalFetcher as Ve, ReportPreview as Le } from "@agile-team/mach-report/vue";
3
+ import { _ as Se, a as W } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
+ import { resolveGridLayout as pe, parseReportTemplate as U, serializeReportTemplate as ee, validateReportTemplateDocument as Re } from "@agile-team/mach-report";
5
+ const Be = ["aria-label"], Pe = ["data-align", "aria-label", "title", "aria-checked", "tabindex", "onClick", "onKeydown"], Oe = { key: 0 }, Ie = {
6
+ key: 1,
7
+ viewBox: "0 0 20 20",
8
+ fill: "none",
9
+ "aria-hidden": "true"
10
+ }, Je = {
11
+ key: 0,
12
+ d: "M3 4h14M3 8h9M3 12h14M3 16h9"
13
+ }, Ne = {
14
+ key: 1,
15
+ d: "M3 4h14M6 8h8M3 12h14M6 16h8"
16
+ }, Ge = {
17
+ key: 2,
18
+ d: "M3 4h14M8 8h9M3 12h14M8 16h9"
19
+ }, He = {
20
+ key: 3,
21
+ d: "M3 4h14M3 8h14M3 12h14M3 16h14"
22
+ }, Ue = /* @__PURE__ */ Ce({
23
+ __name: "AlignmentControl",
24
+ props: {
25
+ modelValue: {},
26
+ label: {},
27
+ labels: {},
28
+ autoLabel: {},
29
+ allowAuto: { type: Boolean }
30
+ },
31
+ emits: ["update:modelValue"],
32
+ setup(r, { emit: w }) {
33
+ const c = r, g = w, u = () => c.allowAuto ? ["auto", "left", "center", "right", "justify"] : ["left", "center", "right", "justify"];
34
+ async function i(b, $) {
35
+ if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(b.key)) return;
36
+ b.preventDefault();
37
+ const _ = u(), k = _.indexOf($), C = b.key === "Home" ? 0 : b.key === "End" ? _.length - 1 : (k + (b.key === "ArrowRight" ? 1 : -1) + _.length) % _.length;
38
+ g("update:modelValue", _[C]);
39
+ const A = b.currentTarget.parentElement;
40
+ await Y(), A?.querySelector(`[data-align="${_[C]}"]`)?.focus();
41
+ }
42
+ return (b, $) => (p(), y("div", {
43
+ class: "mr-designer-alignment",
44
+ role: "radiogroup",
45
+ "aria-label": r.label
46
+ }, [
47
+ (p(!0), y(X, null, oe(u(), (m) => (p(), y("button", {
48
+ key: m,
49
+ type: "button",
50
+ role: "radio",
51
+ "data-align": m,
52
+ "aria-label": r.labels[m],
53
+ title: r.labels[m],
54
+ "aria-checked": r.modelValue === m,
55
+ tabindex: r.modelValue === m ? 0 : -1,
56
+ onClick: (_) => g("update:modelValue", m),
57
+ onKeydown: (_) => i(_, m)
58
+ }, [
59
+ m === "auto" ? (p(), y("span", Oe, s(r.autoLabel), 1)) : (p(), y("svg", Ie, [
60
+ m === "left" ? (p(), y("path", Je)) : m === "center" ? (p(), y("path", Ne)) : m === "right" ? (p(), y("path", Ge)) : (p(), y("path", He))
61
+ ]))
62
+ ], 40, Pe))), 128))
63
+ ], 8, Be));
64
+ }
65
+ }), we = /* @__PURE__ */ Se(Ue, [["__scopeId", "data-v-c85770c4"]]);
66
+ function Fe(r, w, c) {
67
+ if (!r.length) return;
68
+ const g = Math.max(0, r.indexOf(w)), i = {
69
+ ArrowDown: Math.min(g + 1, r.length - 1),
70
+ ArrowUp: Math.max(g - 1, 0),
71
+ Home: 0,
72
+ End: r.length - 1
73
+ }[c];
74
+ return i === void 0 ? void 0 : r[i];
75
+ }
76
+ function ze(r, w, c) {
77
+ const g = D(!1), u = D(r.activeIndex.value), i = D(null), b = D(null), $ = D(null), m = D(null);
78
+ function _(f = !1) {
79
+ const o = m.value, d = o?.querySelector(
80
+ `button[data-column-index="${u.value}"]`
81
+ );
82
+ if (!o || !d) return;
83
+ f && d.focus({ preventScroll: !0 });
84
+ const v = o.getBoundingClientRect(), h = d.getBoundingClientRect(), x = v.top + o.clientTop, t = x + o.clientHeight;
85
+ h.top < x ? o.scrollTop += h.top - x : h.bottom > t && (o.scrollTop += h.bottom - t);
86
+ }
87
+ async function k(f = !1) {
88
+ g.value && (g.value = !1, f && (await Y(), i.value?.focus({ preventScroll: !0 })));
89
+ }
90
+ async function C() {
91
+ if (g.value) return k(!0);
92
+ const f = c.value.map((o) => o.index);
93
+ u.value = f.includes(r.activeIndex.value) ? r.activeIndex.value : f[0] ?? -1, g.value = !0, await Y(), $.value?.focus({ preventScroll: !0 }), _();
94
+ }
95
+ function A(f) {
96
+ r.activate(f), k(!0);
97
+ }
98
+ function S(f) {
99
+ g.value && (f.preventDefault(), f.stopPropagation(), k(!0));
100
+ }
101
+ async function G(f) {
102
+ const o = Fe(
103
+ c.value.map((d) => d.index),
104
+ u.value,
105
+ f.key
106
+ );
107
+ o !== void 0 && (u.value = o, f.preventDefault(), await Y(), _(!0));
108
+ }
109
+ async function Z(f) {
110
+ if (!["ArrowDown", "ArrowUp", "Enter"].includes(f.key)) return;
111
+ f.preventDefault(), f.stopPropagation();
112
+ const o = c.value.map((d) => d.index);
113
+ if (o.length) {
114
+ if (f.key === "Enter") {
115
+ o.includes(u.value) && A(u.value);
116
+ return;
117
+ }
118
+ f.key === "ArrowUp" && (u.value = o.at(-1)), await Y(), _(!0);
119
+ }
120
+ }
121
+ function O(f) {
122
+ const o = f.target;
123
+ !g.value || b.value?.contains(o) || i.value?.contains(o) || k();
124
+ }
125
+ function V(f) {
126
+ const o = f.relatedTarget;
127
+ !o || b.value?.contains(o) || i.value?.contains(o) || k();
128
+ }
129
+ return te(c, (f) => {
130
+ f.some((o) => o.index === u.value) || (u.value = f[0]?.index ?? -1);
131
+ }), te(w, () => {
132
+ k();
133
+ }), Ee(() => document.addEventListener("pointerdown", O)), be(() => document.removeEventListener("pointerdown", O)), {
134
+ open: g,
135
+ cursor: u,
136
+ trigger: i,
137
+ panel: b,
138
+ search: $,
139
+ list: m,
140
+ toggle: C,
141
+ close: k,
142
+ choose: A,
143
+ escape: S,
144
+ navigate: G,
145
+ searchKeydown: Z,
146
+ leave: V
147
+ };
148
+ }
149
+ function Ke(r, w, c, g) {
150
+ const u = D(0), i = D(""), b = D([]), $ = j(() => r.value.template.pages.flatMap((o, d) => o.components.flatMap((v, h) => v.kind === "list" ? [{ component: v, pageIndex: d, componentIndex: h }] : []))), m = j(() => $.value[u.value]?.component), _ = j(() => {
151
+ const o = m.value;
152
+ if (!o) return [];
153
+ const d = o.columns.map((v) => v.headerStyle?.align ?? v.headerAlign ?? o.headerStyle?.align ?? o.headerAlign ?? v.style?.align ?? "center");
154
+ if (o.headerGrid && w())
155
+ for (const v of pe(o.headerGrid, o.widthMm, 100).cells)
156
+ for (let h = v.ci; h < v.ci + (v.cell.colSpan ?? 1); h++) d[h] = v.cell.style?.align ?? "left";
157
+ return d;
158
+ }), k = j(() => {
159
+ const o = i.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
160
+ return (m.value?.columns ?? []).flatMap((d, v) => {
161
+ const h = `${d.header} ${d.field}`.toLocaleLowerCase();
162
+ return o.every((x) => h.includes(x)) ? [{ column: d, index: v }] : [];
19
163
  });
20
164
  });
21
- function _(d, r) {
22
- C.value = r ? [.../* @__PURE__ */ new Set([...C.value, d])] : C.value.filter((i) => i !== d);
23
- }
24
- function T(d) {
25
- for (const r of g.value) _(r.index, d);
26
- }
27
- function h() {
28
- C.value = [];
29
- }
30
- function L(d, r, i) {
31
- if (!u()) return;
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
- }
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
- }
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;
165
+ function C(o, d) {
166
+ b.value = d ? [.../* @__PURE__ */ new Set([...b.value, o])] : b.value.filter((v) => v !== o);
167
+ }
168
+ function A(o) {
169
+ for (const d of k.value) C(d.index, o);
170
+ }
171
+ function S() {
172
+ b.value = [];
173
+ }
174
+ function G(o, d, v) {
175
+ if (!c()) return;
176
+ const h = m.value?.columns[o];
177
+ h && (Object.assign(h, { [d]: d === "widthMm" ? Number(v) : v }), d === "header" && O(o, String(v)), d === "headerAlign" && V(o, v), d === "widthMm" && Z(), g());
178
+ }
179
+ function Z() {
180
+ const o = $.value[u.value];
181
+ if (!o) return;
182
+ const d = o.component, v = r.value.template.pages[o.pageIndex], h = d.columns.map((x) => x.widthMm);
183
+ d.headerGrid && (d.headerGrid.colWidthsMm = h), v.layout === "wide" && h.every((x) => Number.isFinite(x) && x > 0) && (d.widthMm = h.reduce((x, t) => x + t, 0), v.widthMm = Math.max(...v.components.map((x) => x.leftMm + x.widthMm)) + (v.marginRightMm ?? 0));
184
+ }
185
+ function O(o, d) {
186
+ const v = m.value;
187
+ if (!v?.headerGrid) return;
188
+ const x = pe(v.headerGrid, v.widthMm, 100).cells.filter(({ ci: t, cell: I }) => t <= o && t + (I.colSpan ?? 1) > o).slice(-1)[0];
189
+ x && (Object.assign(x.cell, { text: d, rawText: d, value: d }), v.columns.slice(x.ci, x.ci + (x.cell.colSpan ?? 1)).forEach((t) => {
190
+ t.header = d;
47
191
  }));
48
192
  }
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 });
193
+ function V(o, d) {
194
+ const v = m.value, h = v?.columns[o];
195
+ if (h?.headerStyle?.align !== void 0 && (h.headerStyle = { ...h.headerStyle, align: d }), !v?.headerGrid) return;
196
+ const t = pe(v.headerGrid, v.widthMm, 100).cells.filter(({ ci: I, cell: R }) => I <= o && I + (R.colSpan ?? 1) > o).slice(-1)[0];
197
+ t && (t.cell.style = { ...t.cell.style, align: d }, v.columns.slice(t.ci, t.ci + (t.cell.colSpan ?? 1)).forEach((I) => {
198
+ I.headerAlign = d, I.headerStyle?.align !== void 0 && (I.headerStyle = { ...I.headerStyle, align: d });
55
199
  }));
56
200
  }
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));
201
+ function f(o, d) {
202
+ if (!(!c() || o === "headerAlign" && d === "auto")) {
203
+ for (const v of b.value) {
204
+ const h = m.value?.columns[v];
205
+ h && (Object.assign(h, { [o]: d }), o === "headerAlign" && V(v, d));
62
206
  }
63
- b();
207
+ g();
64
208
  }
65
209
  }
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 };
210
+ return { selected: u, query: i, selectedColumns: b, lists: $, activeList: m, headerAlignments: _, visibleColumns: k, toggleColumn: C, selectVisible: A, clearSelection: S, setColumn: G, alignColumns: f };
67
211
  }
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
- }
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
- }
81
- function p(g) {
82
- if (!(g < 0 ? !f.value : !s.value))
83
- return b.value += g, u.value[b.value];
84
- }
85
- return { canUndo: f, canRedo: s, current: C, reset: B, record: w, move: p };
212
+ function qe(r, w = { entries: 100, bytes: 16 * 1024 * 1024 }) {
213
+ const c = D([r]), g = D(0), u = j(() => g.value > 0), i = j(() => g.value + 1 < c.value.length), b = j(() => c.value[g.value]);
214
+ function $(k) {
215
+ c.value = [k], g.value = 0;
216
+ }
217
+ function m(k) {
218
+ if (c.value[g.value] === k) return;
219
+ const C = c.value.slice(0, g.value + 1);
220
+ C.push(k);
221
+ let A = C.reduce((S, G) => S + G.length * 2, 0);
222
+ for (; C.length > 1 && (C.length > w.entries || A > w.bytes); ) A -= C.shift().length * 2;
223
+ c.value = C, g.value = c.value.length - 1;
224
+ }
225
+ function _(k) {
226
+ if (!(k < 0 ? !u.value : !i.value))
227
+ return g.value += k, c.value[g.value];
228
+ }
229
+ return { canUndo: u, canRedo: i, current: b, reset: $, record: m, move: _ };
86
230
  }
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
- }
93
- function C() {
94
- f++, s(!1), u.value = !1;
95
- }
96
- async function B(w) {
97
- C();
98
- const p = f, g = c();
99
- u.value = !0;
231
+ function We(r) {
232
+ const w = Ae(null), c = D(!1);
233
+ let g, u = 0;
234
+ function i(m) {
235
+ g?.(m), g = void 0, w.value = null;
236
+ }
237
+ function b() {
238
+ u++, i(!1), c.value = !1;
239
+ }
240
+ async function $(m) {
241
+ b();
242
+ const _ = u, k = r();
243
+ c.value = !0;
100
244
  try {
101
- const _ = await new Promise((T, h) => {
102
- if (b = T, !g) {
103
- M.value = w;
245
+ const C = await new Promise((A, S) => {
246
+ if (g = A, !k) {
247
+ w.value = m;
104
248
  return;
105
249
  }
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));
250
+ Promise.resolve().then(() => u === _ ? k(m) : !1).then((G) => {
251
+ u === _ && i(G === !0);
252
+ }, (G) => {
253
+ u === _ && (g = void 0, w.value = null, S(G));
110
254
  });
111
255
  });
112
- return f === p && _ === !0;
256
+ return u === _ && C === !0;
113
257
  } finally {
114
- f === p && (u.value = !1);
258
+ u === _ && (c.value = !1);
115
259
  }
116
260
  }
117
- return he(C), { confirmation: M, pending: u, decide: s, request: B, cancel: C };
261
+ return be(b), { confirmation: w, pending: c, decide: i, request: $, cancel: b };
118
262
  }
119
- const je = {
263
+ const Qe = {
120
264
  title: "报表模板属性编辑器",
121
265
  heading: "模板属性",
122
266
  unpublished: "未发布",
@@ -149,7 +293,7 @@ const je = {
149
293
  applyJson: "校验并应用 JSON",
150
294
  note: "字段映射应与数据源契约一致。此编辑器维护模板属性;保存由接入方提供的版本服务处理。",
151
295
  invalid: "请先修正模板错误,再预览或保存。"
152
- }, Re = {
296
+ }, Xe = {
153
297
  undo: "撤销",
154
298
  redo: "重做",
155
299
  columnsSearch: "搜索列名或字段",
@@ -181,14 +325,26 @@ const je = {
181
325
  templateRevision: "当前修订",
182
326
  readonly: "只读",
183
327
  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(() => ({
328
+ previewTitle: "实时预览",
329
+ contentGroup: "内容",
330
+ formatGroup: "格式",
331
+ autoShort: "自动",
332
+ previousColumn: "上一字段",
333
+ nextColumn: "下一字段",
334
+ closeDirectory: "关闭字段目录",
335
+ technicalDetails: "标识与修订",
336
+ fieldPosition: "当前字段",
337
+ previewFieldDirectory: "定位字段"
338
+ }, Ye = {
339
+ ...Qe,
340
+ ...Xe
341
+ };
342
+ function Ze(r, w) {
343
+ const c = D(U(r.modelValue)), g = D(ee(c.value)), u = D(ee(c.value)), i = D(""), b = D(!1), $ = j(() => ({ ...Ye, ...r.messages })), m = j(() => ({
188
344
  showExport: !1,
189
345
  showPrint: !1,
190
346
  showPdfWindow: !1,
191
- ...c.preview,
347
+ ...r.preview,
192
348
  theme: {
193
349
  shellBg: "#f1f5f9",
194
350
  shellFg: "#334155",
@@ -200,183 +356,170 @@ function Be(c, M) {
200
356
  btnHoverBg: "#eff6ff",
201
357
  btnHoverFg: "#1d4ed8",
202
358
  btnActiveBg: "#2563eb",
203
- ...c.preview?.theme
359
+ ...r.preview?.theme
204
360
  }
205
361
  }));
206
- we({ get defaults() {
207
- return w.value;
362
+ je({ get defaults() {
363
+ return m.value;
208
364
  } });
209
- let p, g = 0;
210
- const _ = A(() => Me(u.value)), T = A(() => {
365
+ let _, k = 0;
366
+ const C = j(() => Re(c.value)), A = j(() => {
211
367
  try {
212
- return U(u.value) !== b.value;
368
+ return ee(c.value) !== g.value;
213
369
  } catch {
214
370
  return !0;
215
371
  }
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;
221
- }
222
- let G = 0;
223
- async function N(l = "replace", o) {
224
- if (!Q.value) return !0;
225
- const v = I();
372
+ }), S = D(u.value), G = j(() => u.value !== S.value), Z = j(() => A.value || u.value !== S.value), O = () => JSON.stringify({ document: c.value, json: u.value, appliedJson: S.value }), V = qe(O()), f = We(() => r.beforeDiscard), o = j(() => b.value || f.pending.value), d = () => !r.readonly && !o.value && !G.value, v = Ke(c, () => C.value.ok, d, ne), { selected: h, lists: x, activeList: t, headerAlignments: I, setColumn: R } = v;
373
+ te(h, () => v.clearSelection());
374
+ const Q = j(() => C.value.ok ? Ve({ draft: { template: c.value.template, datasets: r.datasets ?? {}, params: [] } }) : void 0);
375
+ function T() {
376
+ k++, _?.abort(), _ = void 0, b.value = !1;
377
+ }
378
+ let F = 0;
379
+ async function z(M = "replace", L) {
380
+ if (!Z.value) return !0;
381
+ const E = O();
226
382
  try {
227
- return await H.request({
228
- reason: l,
229
- document: JSON.parse(JSON.stringify(u.value)),
230
- replacement: o ? J(o) : void 0,
383
+ return await f.request({
384
+ reason: M,
385
+ document: JSON.parse(JSON.stringify(c.value)),
386
+ replacement: L ? U(L) : void 0,
231
387
  pendingLocalChanges: !0
232
- }) && v === I();
233
- } catch (D) {
234
- return s.value = D instanceof Error ? D.message : String(D), !1;
388
+ }) && E === O();
389
+ } catch (K) {
390
+ return i.value = K instanceof Error ? K.message : String(K), !1;
235
391
  }
236
392
  }
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());
393
+ function se(M) {
394
+ T(), c.value = M, g.value = ee(M), u.value = g.value, S.value = u.value, i.value = "", h.value = 0, v.clearSelection(), V.reset(O());
239
395
  }
240
- W(() => c.modelValue, async (l) => {
241
- let o;
396
+ te(() => r.modelValue, async (M) => {
397
+ let L;
242
398
  try {
243
- o = J(l);
244
- } catch (D) {
245
- s.value = D instanceof Error ? D.message : String(D);
399
+ L = U(M);
400
+ } catch (K) {
401
+ i.value = K instanceof Error ? K.message : String(K);
246
402
  return;
247
403
  }
248
404
  try {
249
- if (U(o) === U(u.value)) return;
405
+ if (ee(L) === ee(c.value)) return;
250
406
  } catch {
251
407
  }
252
- const v = ++G;
253
- if (E(), !await N("replace", o)) {
254
- v === G && _.value.ok && M("update:modelValue", J(u.value));
408
+ const E = ++F;
409
+ if (T(), !await z("replace", L)) {
410
+ E === F && C.value.ok && w("update:modelValue", U(c.value));
255
411
  return;
256
412
  }
257
- v === G && le(o);
258
- }), he(() => {
259
- G++, E();
413
+ E === F && se(L);
414
+ }), be(() => {
415
+ F++, T();
260
416
  });
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());
417
+ function ne() {
418
+ f.cancel(), i.value = "", C.value.ok && (u.value = ee(c.value), S.value = u.value, w("update:modelValue", U(c.value))), V.record(O());
263
419
  }
264
- function oe(l) {
265
- r() && (u.value.name = l, q());
420
+ function ae(M) {
421
+ d() && (c.value.name = M, ne());
266
422
  }
267
- function X(l) {
268
- r() && (u.value.description = l, q());
423
+ function B(M) {
424
+ d() && (c.value.description = M, ne());
269
425
  }
270
- function F() {
271
- if (!(c.readonly || d.value))
426
+ function ie() {
427
+ if (!(r.readonly || o.value))
272
428
  try {
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);
429
+ const M = U(u.value);
430
+ if (M.id !== c.value.id) throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
431
+ if (M.revision !== c.value.revision) throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
432
+ c.value = M, h.value = 0, v.clearSelection(), ne();
433
+ } catch (M) {
434
+ i.value = M instanceof Error ? M.message : String(M);
279
435
  }
280
436
  }
281
- async function ae() {
282
- d.value || c.readonly || !await N("reset") || (le(J(b.value)), M("update:modelValue", J(u.value)));
437
+ async function ue() {
438
+ o.value || r.readonly || !await z("reset") || (se(U(g.value)), w("update:modelValue", U(c.value)));
283
439
  }
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));
292
- }
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);
440
+ function re(M) {
441
+ if (o.value || r.readonly) return;
442
+ V.record(O());
443
+ const L = V.move(M);
444
+ if (!L) return;
445
+ f.cancel();
446
+ const E = JSON.parse(L);
447
+ c.value = E.document, u.value = E.json, S.value = E.appliedJson, i.value = "", h.value = 0, v.clearSelection(), C.value.ok && w("update:modelValue", U(c.value));
448
+ }
449
+ async function de() {
450
+ if (!r.save || !d() || !C.value.ok) return;
451
+ const M = ++k;
452
+ _ = new AbortController(), b.value = !0, i.value = "";
453
+ const L = U(c.value);
298
454
  try {
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));
455
+ const E = U(await r.save(L, { expectedRevision: L.revision, signal: _.signal }));
456
+ if (M !== k) return;
457
+ if (E.id !== L.id) throw new Error("保存服务返回了其他模板的文档");
458
+ c.value = E, g.value = ee(E), u.value = g.value, S.value = u.value, V.reset(O()), w("saved", U(E)), w("update:modelValue", U(E));
459
+ } catch (E) {
460
+ M === k && (i.value = E instanceof Error ? E.message : String(E));
305
461
  } finally {
306
- l === g && (C.value = !1, p = void 0);
462
+ M === k && (b.value = !1, _ = void 0);
307
463
  }
308
464
  }
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 };
465
+ const ce = j(() => V.canUndo.value || O() !== V.current.value), ve = j(() => V.canRedo.value && O() === V.current.value);
466
+ return { ...v, canUndo: ce, canRedo: ve, undo: () => re(-1), redo: () => re(1), pendingLocalChanges: Z, jsonPending: G, blocked: o, confirmation: f.confirmation, decideDiscard: f.decide, guardChanges: z, draft: c, json: u, selected: h, error: i, saving: b, dirty: A, validation: C, lists: x, activeList: t, headerAlignments: I, previewOptions: m, fetcher: Q, messages: $, setName: ae, setDescription: B, setColumn: R, applyJson: ie, reset: ue, save: de };
311
467
  }
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;
468
+ function et(r, w) {
469
+ const c = D("fields"), g = () => w.value?.columns.length ? 0 : -1, u = D(g()), i = j(() => {
470
+ const m = w.value?.columns[u.value];
471
+ return m ? { column: m, index: u.value } : void 0;
316
472
  });
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);
473
+ te(r, () => {
474
+ u.value = g();
475
+ }), te(w, (m) => {
476
+ m?.columns[u.value] || (u.value = g());
323
477
  });
324
- function B(p) {
325
- c.value.some((g) => g.index === p) && (s.value = p);
478
+ function b(m) {
479
+ w.value?.columns[m] && (u.value = m);
326
480
  }
327
- function w(p) {
328
- const g = c.value;
329
- if (!g.length) return;
330
- const _ = Math.max(
481
+ function $(m) {
482
+ const _ = w.value?.columns.length ?? 0;
483
+ _ && (u.value = Math.max(
331
484
  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 };
485
+ Math.min(_ - 1, u.value + m)
486
+ ));
487
+ }
488
+ return { section: c, activeIndex: u, activeColumn: i, activate: b, stepColumn: $ };
343
489
  }
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 = {
490
+ const tt = ["aria-label", "aria-busy"], nt = { class: "mr-designer-bar" }, lt = { class: "mr-designer-heading" }, at = ["aria-label"], ot = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], st = { class: "mr-designer-actions" }, it = { class: "mr-designer-history" }, rt = ["aria-label", "title", "disabled"], ut = ["aria-label", "title", "disabled"], dt = ["disabled"], ct = ["disabled"], vt = ["aria-label"], mt = { class: "mr-designer-body" }, gt = { class: "mr-designer-inspector" }, ft = ["id", "aria-labelledby"], ht = {
345
491
  key: 0,
346
492
  class: "mr-designer-area"
347
- }, Ye = ["value"], Ze = {
348
- key: 1,
349
- class: "mr-designer-columns"
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 = {
493
+ }, pt = ["value"], bt = { class: "mr-designer-current" }, yt = ["aria-expanded", "aria-controls"], _t = { class: "mr-designer-current-name" }, kt = { class: "mr-designer-directory-entry" }, wt = { class: "mr-designer-field-position" }, Ct = ["aria-label"], St = ["aria-label", "title", "disabled"], xt = ["aria-label", "title", "disabled"], Mt = ["disabled", "aria-label"], Et = { class: "mr-designer-property-group" }, At = ["value"], Tt = ["value"], Dt = { class: "mr-designer-property-group" }, $t = { class: "mr-designer-format-pair" }, jt = { class: "mr-designer-stacked" }, Vt = ["value"], Lt = { class: "mr-designer-stacked" }, Rt = ["value"], Bt = { value: "identifier" }, Pt = { value: "dimension" }, Ot = { value: "measure" }, It = { value: "date" }, Jt = { value: "text" }, Nt = { class: "mr-designer-control-row" }, Gt = { class: "mr-designer-control-row" }, Ht = { class: "mr-designer-toggle" }, Ut = ["checked"], Ft = ["id", "aria-label"], zt = { class: "mr-designer-directory-heading" }, Kt = ["aria-label"], qt = { class: "mr-designer-search" }, Wt = ["aria-label", "placeholder"], Qt = ["aria-label", "title"], Xt = { class: "mr-designer-column-tools" }, Yt = ["disabled"], Zt = {
351
494
  key: 1,
352
495
  role: "status"
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 = {
496
+ }, en = { key: 2 }, tn = ["aria-label"], nn = ["aria-label", "checked", "disabled", "onChange"], ln = ["data-column-index", "aria-pressed", "tabindex", "onClick"], an = { class: "mr-designer-column-number" }, on = { class: "mr-designer-column-name" }, sn = {
354
497
  key: 0,
355
498
  role: "status",
356
499
  class: "mr-designer-empty"
357
- }, ft = {
500
+ }, rn = {
358
501
  key: 0,
359
502
  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 = {
503
+ }, un = ["aria-label", "disabled"], dn = { value: "" }, cn = { value: "auto" }, vn = { value: "left" }, mn = { value: "center" }, gn = { value: "right" }, fn = { value: "justify" }, hn = ["aria-label", "disabled"], pn = { value: "" }, bn = { value: "left" }, yn = { value: "center" }, _n = { value: "right" }, kn = { value: "justify" }, wn = {
361
504
  key: 2,
362
505
  role: "status",
363
506
  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 = {
507
+ }, Cn = { class: "mr-designer-stacked" }, Sn = ["value", "disabled"], xn = { class: "mr-designer-stacked" }, Mn = ["value", "disabled"], En = { class: "mr-designer-technical" }, An = { class: "mr-designer-identity" }, Tn = { class: "mr-designer-stacked mr-designer-json-label" }, Dn = ["aria-label", "disabled"], $n = ["disabled"], jn = {
365
508
  key: 3,
366
509
  role: "status",
367
510
  class: "mr-designer-note mr-designer-pending"
368
- }, un = ["aria-label"], cn = {
511
+ }, Vn = ["aria-label"], Ln = {
369
512
  key: 0,
370
513
  role: "alert",
371
514
  class: "mr-designer-error"
372
- }, vn = {
515
+ }, Rn = {
373
516
  key: 1,
374
517
  role: "alert",
375
518
  class: "mr-designer-error"
376
- }, mn = {
519
+ }, Bn = {
377
520
  key: 3,
378
521
  class: "mr-designer-note mr-designer-invalid"
379
- }, fn = /* @__PURE__ */ be({
522
+ }, Pn = /* @__PURE__ */ Ce({
380
523
  __name: "ReportTemplateEditor",
381
524
  props: {
382
525
  modelValue: {},
@@ -388,133 +531,137 @@ const Ve = ["aria-label", "aria-busy"], Oe = { class: "mr-designer-bar" }, Ie =
388
531
  save: { type: Function }
389
532
  },
390
533
  emits: ["update:modelValue", "saved"],
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);
534
+ setup(r, { expose: w, emit: c }) {
535
+ const g = r, u = c, i = Ze(g, (J, a) => {
536
+ u(J === "saved" ? "saved" : "update:modelValue", a);
394
537
  }), {
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,
538
+ draft: b,
539
+ json: $,
540
+ selected: m,
541
+ error: _,
542
+ saving: k,
543
+ pendingLocalChanges: C,
544
+ jsonPending: A,
545
+ blocked: S,
546
+ confirmation: G,
547
+ canUndo: Z,
548
+ canRedo: O,
549
+ validation: V,
550
+ lists: f,
551
+ activeList: o,
552
+ visibleColumns: d,
553
+ query: v,
554
+ selectedColumns: h,
412
555
  fetcher: x,
413
556
  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);
557
+ } = i, I = et(m, o), { section: R, activeIndex: Q, activeColumn: T } = I, F = `mr-designer-${Te()?.uid ?? 0}`, z = ["fields", "template", "advanced"], se = j(
558
+ () => k.value ? t.value.saving : g.readonly ? t.value.readonly : C.value ? t.value.dirty : t.value.ready
559
+ ), ne = D(null), ae = D(null), B = ze(I, R, d), {
560
+ open: ie,
561
+ cursor: ue,
562
+ trigger: re,
563
+ panel: de,
564
+ search: ce,
565
+ list: ve
566
+ } = B;
567
+ te(R, async () => {
568
+ await Y(), ae.value && (ae.value.scrollTop = 0);
431
569
  });
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({
570
+ const M = j(() => ({
571
+ auto: t.value.auto,
572
+ left: t.value.left,
573
+ center: t.value.center,
574
+ right: t.value.right,
575
+ justify: t.value.justify
576
+ }));
577
+ let L = null;
578
+ te(G, async (J) => {
579
+ J ? (L = document.activeElement, await Y(), ne.value?.focus()) : (await Y(), L?.isConnected && L.focus(), L = null);
580
+ }), w({
436
581
  get pendingLocalChanges() {
437
- return _.value;
582
+ return C.value;
438
583
  },
439
584
  get saving() {
440
- return g.value;
585
+ return k.value;
441
586
  },
442
587
  get blocked() {
443
- return h.value;
588
+ return S.value;
444
589
  },
445
- guardChanges: s.guardChanges,
446
- reset: s.reset,
447
- save: s.save
590
+ guardChanges: i.guardChanges,
591
+ reset: i.reset,
592
+ save: i.save
448
593
  });
449
- function F(S) {
450
- return S.target.value;
451
- }
452
- function ae(S) {
453
- return S.target.checked;
594
+ function E(J) {
595
+ return J.target.value;
454
596
  }
455
- function Z(S, l) {
456
- const o = S.target;
457
- s.alignColumns(
458
- l,
459
- o.value
460
- ), o.value = "";
597
+ function K(J) {
598
+ return J.target.checked;
461
599
  }
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" });
600
+ function ye(J, a) {
601
+ const l = J.target;
602
+ i.alignColumns(
603
+ a,
604
+ l.value
605
+ ), l.value = "";
474
606
  }
475
- async function re(S) {
476
- const o = {
607
+ async function xe(J) {
608
+ const l = {
477
609
  ArrowRight: 1,
478
610
  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();
611
+ Home: -z.length,
612
+ End: z.length
613
+ }[J.key];
614
+ if (l === void 0) return;
615
+ J.preventDefault();
616
+ const N = z.indexOf(R.value), le = J.key === "Home" ? 0 : J.key === "End" ? z.length - 1 : (N + l + z.length) % z.length;
617
+ R.value = z[le];
618
+ const Me = J.currentTarget.parentElement;
619
+ await Y(), Me?.querySelector(`#${F}-tab-${R.value}`)?.focus();
488
620
  }
489
- return (S, l) => (y(), k("section", {
621
+ return (J, a) => (p(), y("section", {
490
622
  class: "mr-designer",
491
623
  "aria-label": e(t).title,
492
- "aria-busy": e(g)
624
+ "aria-busy": e(k)
493
625
  }, [
494
- n("header", Oe, [
495
- n("div", Ie, [
496
- ne(Y, {
626
+ n("header", nt, [
627
+ n("div", lt, [
628
+ q(W, {
497
629
  name: "columns",
498
- size: 18
630
+ size: 15
499
631
  }),
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)
505
- ])
632
+ n("strong", null, s(e(t).heading), 1),
633
+ n("span", {
634
+ class: me({ "mr-designer-dirty": e(C) })
635
+ }, s(se.value), 3)
506
636
  ]),
507
- n("div", Je, [
508
- n("div", Ne, [
637
+ n("nav", {
638
+ class: "mr-designer-tabs",
639
+ role: "tablist",
640
+ "aria-label": e(t).sectionsLabel
641
+ }, [
642
+ (p(), y(X, null, oe(z, (l) => n("button", {
643
+ id: `${F}-tab-${l}`,
644
+ key: l,
645
+ type: "button",
646
+ role: "tab",
647
+ "aria-selected": e(R) === l,
648
+ "aria-controls": `${F}-panel-${l}`,
649
+ tabindex: e(R) === l ? 0 : -1,
650
+ onClick: (N) => R.value = l,
651
+ onKeydown: xe
652
+ }, s(e(t)[`${l}Section`]), 41, ot)), 64))
653
+ ], 8, at),
654
+ n("div", st, [
655
+ n("div", it, [
509
656
  n("button", {
510
657
  type: "button",
511
658
  class: "mr-designer-icon-button",
512
659
  "aria-label": e(t).undo,
513
660
  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] = [
661
+ disabled: r.readonly || e(S) || !e(Z),
662
+ onClick: a[0] || (a[0] = //@ts-ignore
663
+ (...l) => e(i).undo && e(i).undo(...l))
664
+ }, [...a[34] || (a[34] = [
518
665
  n("svg", {
519
666
  viewBox: "0 0 24 24",
520
667
  fill: "none",
@@ -522,16 +669,16 @@ const Ve = ["aria-label", "aria-busy"], Oe = { class: "mr-designer-bar" }, Ie =
522
669
  }, [
523
670
  n("path", { d: "M4 10h10a6 6 0 0 1 0 12M4 10l5-5M4 10l5 5" })
524
671
  ], -1)
525
- ])], 8, Pe),
672
+ ])], 8, rt),
526
673
  n("button", {
527
674
  type: "button",
528
675
  class: "mr-designer-icon-button",
529
676
  "aria-label": e(t).redo,
530
677
  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] = [
678
+ disabled: r.readonly || e(S) || !e(O),
679
+ onClick: a[1] || (a[1] = //@ts-ignore
680
+ (...l) => e(i).redo && e(i).redo(...l))
681
+ }, [...a[35] || (a[35] = [
535
682
  n("svg", {
536
683
  viewBox: "0 0 24 24",
537
684
  fill: "none",
@@ -539,403 +686,492 @@ const Ve = ["aria-label", "aria-busy"], Oe = { class: "mr-designer-bar" }, Ie =
539
686
  }, [
540
687
  n("path", { d: "M20 10H10a6 6 0 0 0 0 12m10-12-5-5m5 5-5 5" })
541
688
  ], -1)
542
- ])], 8, He)
689
+ ])], 8, ut)
543
690
  ]),
544
691
  n("button", {
545
692
  type: "button",
546
693
  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", {
694
+ disabled: r.readonly || e(S) || !e(C),
695
+ onClick: a[2] || (a[2] = //@ts-ignore
696
+ (...l) => e(i).reset && e(i).reset(...l))
697
+ }, s(e(t).reset), 9, dt),
698
+ r.save ? (p(), y("button", {
552
699
  key: 0,
553
700
  type: "button",
554
701
  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))
702
+ disabled: r.readonly || e(S) || e(A) || !e(V).ok || !e(C),
703
+ onClick: a[3] || (a[3] = //@ts-ignore
704
+ (...l) => e(i).save && e(i).save(...l))
558
705
  }, [
559
- ne(Y, {
706
+ q(W, {
560
707
  name: "file",
561
- size: 14
708
+ size: 13
562
709
  }),
563
- R(a(e(g) ? e(t).saving : e(t).save), 1)
564
- ], 8, Fe)) : P("", !0)
710
+ P(s(e(k) ? e(t).saving : e(t).save), 1)
711
+ ], 8, ct)) : H("", !0)
565
712
  ])
566
713
  ]),
567
- e(L) ? (y(), k("div", {
714
+ e(G) ? (p(), y("div", {
568
715
  key: 0,
569
716
  role: "alertdialog",
570
717
  "aria-label": e(t).discardTitle,
571
718
  class: "mr-designer-confirm",
572
- onKeydown: l[6] || (l[6] = _e(ke((o) => e(s).decideDiscard(!1), ["prevent"]), ["esc"]))
719
+ onKeydown: a[6] || (a[6] = ge(De((l) => e(i).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
573
720
  }, [
574
721
  n("div", null, [
575
- n("strong", null, a(e(t).discardTitle), 1),
576
- n("p", null, a(e(t).discardDescription), 1)
722
+ n("strong", null, s(e(t).discardTitle), 1),
723
+ n("p", null, s(e(t).discardDescription), 1)
577
724
  ]),
578
725
  n("div", null, [
579
726
  n("button", {
580
727
  ref_key: "keepButton",
581
- ref: q,
728
+ ref: ne,
582
729
  type: "button",
583
- onClick: l[4] || (l[4] = (o) => e(s).decideDiscard(!1))
584
- }, a(e(t).keepEditing), 513),
730
+ onClick: a[4] || (a[4] = (l) => e(i).decideDiscard(!1))
731
+ }, s(e(t).keepEditing), 513),
585
732
  n("button", {
586
733
  type: "button",
587
- onClick: l[5] || (l[5] = (o) => e(s).decideDiscard(!0))
588
- }, a(e(t).discard), 1)
734
+ onClick: a[5] || (a[5] = (l) => e(i).decideDiscard(!0))
735
+ }, s(e(t).discard), 1)
589
736
  ])
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),
737
+ ], 40, vt)) : H("", !0),
738
+ n("div", mt, [
739
+ n("aside", gt, [
610
740
  n("div", {
611
- id: `${G}-panel-${e(O)}`,
612
- class: "mr-designer-panel",
741
+ ref_key: "inspectorPanel",
742
+ ref: ae,
743
+ id: `${F}-panel-${e(R)}`,
744
+ class: me(["mr-designer-panel", { "is-advanced": e(R) === "advanced" }]),
613
745
  role: "tabpanel",
614
- "aria-labelledby": `${G}-tab-${e(O)}`
746
+ "aria-labelledby": `${F}-tab-${e(R)}`
615
747
  }, [
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)
748
+ e(R) === "fields" ? (p(), y(X, { key: 0 }, [
749
+ e(f).length > 1 ? (p(), y("label", ht, [
750
+ P(s(e(t).area), 1),
751
+ fe(n("select", {
752
+ "onUpdate:modelValue": a[7] || (a[7] = (l) => he(m) ? m.value = l : null)
621
753
  }, [
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))
754
+ (p(!0), y(X, null, oe(e(f), (l, N) => (p(), y("option", {
755
+ key: N,
756
+ value: N
757
+ }, s(l.pageIndex + 1) + " " + s(e(t).page) + " · " + s(l.component.title || l.component.dataset), 9, pt))), 128))
626
758
  ], 512), [
627
- [Ce, e(w)]
759
+ [$e, e(m)]
628
760
  ])
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, [
761
+ ])) : H("", !0),
762
+ e(o) ? (p(), y(X, { key: 1 }, [
763
+ n("div", bt, [
663
764
  n("button", {
765
+ ref_key: "directoryTrigger",
766
+ ref: re,
664
767
  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 }])
768
+ class: "mr-designer-field-trigger",
769
+ "aria-expanded": e(ie),
770
+ "aria-controls": `${F}-directory`,
771
+ "aria-haspopup": "dialog",
772
+ onClick: a[8] || (a[8] = //@ts-ignore
773
+ (...l) => e(B).toggle && e(B).toggle(...l)),
774
+ onKeydown: a[9] || (a[9] = ge(
775
+ //@ts-ignore
776
+ (...l) => e(B).escape && e(B).escape(...l),
777
+ ["esc"]
778
+ ))
686
779
  }, [
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),
780
+ n("span", _t, [
781
+ n("strong", null, s(e(T)?.column.header || e(t).noColumns), 1),
782
+ n("small", null, s(e(T)?.column.field || "—"), 1)
783
+ ]),
784
+ n("span", kt, [
785
+ P(s(e(t).columnDirectory) + " ", 1),
786
+ n("b", null, s(e(o).columns.length), 1),
787
+ q(W, {
788
+ name: "chevron-down",
789
+ size: 13
790
+ })
791
+ ])
792
+ ], 40, yt),
793
+ n("div", wt, [
794
+ n("span", {
795
+ "aria-label": e(t).fieldPosition
796
+ }, [
797
+ P(s(e(Q) >= 0 ? e(Q) + 1 : 0), 1),
798
+ a[36] || (a[36] = n("i", null, "/", -1)),
799
+ P(s(e(o).columns.length), 1)
800
+ ], 8, Ct),
694
801
  n("button", {
695
802
  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
803
+ class: "mr-designer-icon-button",
804
+ "aria-label": e(t).previousColumn,
805
+ title: e(t).previousColumn,
806
+ disabled: e(Q) <= 0,
807
+ onClick: a[10] || (a[10] = (l) => e(I).stepColumn(-1))
701
808
  }, [
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",
809
+ q(W, {
810
+ name: "chevron-left",
710
811
  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"))
812
+ })
813
+ ], 8, St),
814
+ n("button", {
815
+ type: "button",
816
+ class: "mr-designer-icon-button",
817
+ "aria-label": e(t).nextColumn,
818
+ title: e(t).nextColumn,
819
+ disabled: e(Q) >= e(o).columns.length - 1,
820
+ onClick: a[11] || (a[11] = (l) => e(I).stepColumn(1))
744
821
  }, [
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)
822
+ q(W, {
823
+ name: "chevron-right",
824
+ size: 14
825
+ })
826
+ ], 8, xt)
751
827
  ])
752
- ])) : P("", !0),
753
- e(E) ? (y(), k("fieldset", {
754
- key: 1,
828
+ ]),
829
+ e(T) ? (p(), y("fieldset", {
830
+ key: 0,
755
831
  class: "mr-designer-properties",
756
- disabled: c.readonly || e(h) || e(T)
832
+ disabled: r.readonly || e(S) || e(A),
833
+ "aria-label": e(t).columnProperties
757
834
  }, [
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)
835
+ n("div", Et, [
836
+ n("h3", null, s(e(t).contentGroup), 1),
837
+ n("label", null, [
838
+ P(s(e(t).header), 1),
839
+ n("input", {
840
+ value: e(T).column.header,
841
+ onInput: a[12] || (a[12] = (l) => e(i).setColumn(
842
+ e(T).index,
843
+ "header",
844
+ E(l)
845
+ ))
846
+ }, null, 40, At)
847
+ ]),
848
+ n("label", null, [
849
+ P(s(e(t).field), 1),
850
+ n("input", {
851
+ value: e(T).column.field,
852
+ onChange: a[13] || (a[13] = (l) => e(i).setColumn(
853
+ e(T).index,
854
+ "field",
855
+ E(l)
856
+ ))
857
+ }, null, 40, Tt)
858
+ ])
772
859
  ]),
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)
860
+ n("div", Dt, [
861
+ n("h3", null, s(e(t).formatGroup), 1),
862
+ n("div", $t, [
863
+ n("label", jt, [
864
+ P(s(e(t).width), 1),
865
+ n("input", {
866
+ type: "number",
867
+ min: "0.1",
868
+ step: "0.5",
869
+ value: e(T).column.widthMm,
870
+ onChange: a[14] || (a[14] = (l) => e(i).setColumn(
871
+ e(T).index,
872
+ "widthMm",
873
+ E(l)
874
+ ))
875
+ }, null, 40, Vt)
876
+ ]),
877
+ n("label", Lt, [
878
+ P(s(e(t).semantic), 1),
879
+ n("select", {
880
+ value: e(T).column.semanticRole || "text",
881
+ onChange: a[15] || (a[15] = (l) => e(i).setColumn(
882
+ e(T).index,
883
+ "semanticRole",
884
+ E(l)
885
+ ))
886
+ }, [
887
+ n("option", Bt, s(e(t).identifier), 1),
888
+ n("option", Pt, s(e(t).dimension), 1),
889
+ n("option", Ot, s(e(t).measure), 1),
890
+ n("option", It, s(e(t).date), 1),
891
+ n("option", Jt, s(e(t).text), 1)
892
+ ], 40, Rt)
893
+ ])
894
+ ]),
895
+ n("div", Nt, [
896
+ n("span", null, s(e(t).bodyAlign), 1),
897
+ q(we, {
898
+ "model-value": e(T).column.align ?? e(T).column.style?.align ?? e(o).align ?? "left",
899
+ label: e(t).bodyAlign,
900
+ labels: M.value,
901
+ "auto-label": e(t).autoShort,
902
+ "allow-auto": "",
903
+ "onUpdate:modelValue": a[16] || (a[16] = (l) => e(i).setColumn(e(T).index, "align", l))
904
+ }, null, 8, ["model-value", "label", "labels", "auto-label"])
905
+ ]),
906
+ n("div", Gt, [
907
+ n("span", null, s(e(t).headerAlign), 1),
908
+ q(we, {
909
+ "model-value": e(i).headerAlignments.value[e(T).index] || "left",
910
+ label: e(t).headerAlign,
911
+ labels: M.value,
912
+ "auto-label": e(t).autoShort,
913
+ "onUpdate:modelValue": a[17] || (a[17] = (l) => e(i).setColumn(
914
+ e(T).index,
915
+ "headerAlign",
916
+ l
917
+ ))
918
+ }, null, 8, ["model-value", "label", "labels", "auto-label"])
919
+ ])
783
920
  ]),
784
- n("label", null, [
785
- R(a(e(t).width), 1),
921
+ n("label", Ht, [
922
+ P(s(e(t).editable), 1),
786
923
  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)
924
+ type: "checkbox",
925
+ role: "switch",
926
+ checked: e(T).column.editable === !0,
927
+ onChange: a[18] || (a[18] = (l) => e(i).setColumn(
928
+ e(T).index,
929
+ "editable",
930
+ K(l)
806
931
  ))
932
+ }, null, 40, Ut)
933
+ ])
934
+ ], 8, Mt)) : H("", !0),
935
+ e(ie) ? (p(), y("div", {
936
+ key: 1,
937
+ id: `${F}-directory`,
938
+ ref_key: "directoryPanel",
939
+ ref: de,
940
+ role: "dialog",
941
+ "aria-label": e(t).columnDirectory,
942
+ class: "mr-designer-directory",
943
+ onKeydown: a[28] || (a[28] = ge(
944
+ //@ts-ignore
945
+ (...l) => e(B).escape && e(B).escape(...l),
946
+ ["esc"]
947
+ )),
948
+ onFocusout: a[29] || (a[29] = //@ts-ignore
949
+ (...l) => e(B).leave && e(B).leave(...l))
950
+ }, [
951
+ n("div", zt, [
952
+ n("strong", null, [
953
+ P(s(e(t).columnDirectory) + " ", 1),
954
+ n("span", null, s(e(o).columns.length), 1)
955
+ ]),
956
+ n("button", {
957
+ type: "button",
958
+ class: "mr-designer-icon-button",
959
+ "aria-label": e(t).closeDirectory,
960
+ onClick: a[19] || (a[19] = (l) => e(B).close(!0))
807
961
  }, [
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)
962
+ q(W, {
963
+ name: "close",
964
+ size: 15
965
+ })
966
+ ], 8, Kt)
814
967
  ]),
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
- ))
968
+ n("div", qt, [
969
+ q(W, {
970
+ name: "search",
971
+ size: 14
972
+ }),
973
+ fe(n("input", {
974
+ ref_key: "directorySearch",
975
+ ref: ce,
976
+ "onUpdate:modelValue": a[20] || (a[20] = (l) => he(v) ? v.value = l : null),
977
+ type: "search",
978
+ "aria-label": e(t).columnsSearch,
979
+ placeholder: e(t).columnsSearch,
980
+ onKeydown: a[21] || (a[21] = //@ts-ignore
981
+ (...l) => e(B).searchKeydown && e(B).searchKeydown(...l))
982
+ }, null, 40, Wt), [
983
+ [_e, e(v)]
984
+ ]),
985
+ e(v) ? (p(), y("button", {
986
+ key: 0,
987
+ type: "button",
988
+ class: "mr-designer-icon-button",
989
+ "aria-label": e(t).clearSearch,
990
+ title: e(t).clearSearch,
991
+ onClick: a[22] || (a[22] = (l) => v.value = "")
824
992
  }, [
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)
993
+ q(W, {
994
+ name: "close",
995
+ size: 13
996
+ })
997
+ ], 8, Qt)) : H("", !0)
831
998
  ]),
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)
999
+ n("div", Xt, [
1000
+ n("button", {
1001
+ type: "button",
1002
+ disabled: r.readonly || e(S) || e(A) || !e(d).length,
1003
+ onClick: a[23] || (a[23] = (l) => e(i).selectVisible(!0))
1004
+ }, s(e(t).selectVisible), 9, Yt),
1005
+ e(h).length ? (p(), y("button", {
1006
+ key: 0,
1007
+ type: "button",
1008
+ onClick: a[24] || (a[24] = //@ts-ignore
1009
+ (...l) => e(i).clearSelection && e(i).clearSelection(...l))
1010
+ }, s(e(t).clearSelection), 1)) : H("", !0),
1011
+ e(h).length ? (p(), y("span", Zt, s(e(t).columnsSelected) + " " + s(e(h).length), 1)) : (p(), y("span", en, s(e(d).length) + " / " + s(e(o).columns.length), 1))
847
1012
  ]),
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),
1013
+ n("div", {
1014
+ ref_key: "columnList",
1015
+ ref: ve,
1016
+ class: "mr-designer-column-list",
1017
+ "aria-label": e(t).columnDirectory,
1018
+ role: "group"
1019
+ }, [
1020
+ (p(!0), y(X, null, oe(e(d), ({ column: l, index: N }) => (p(), y("div", {
1021
+ key: N,
1022
+ class: me(["mr-designer-column-row", { "is-active": e(Q) === N }])
1023
+ }, [
1024
+ n("input", {
1025
+ type: "checkbox",
1026
+ "aria-label": `${e(t).selectColumn} ${l.header}`,
1027
+ checked: e(h).includes(N),
1028
+ disabled: r.readonly || e(S) || e(A),
1029
+ onChange: (le) => e(i).toggleColumn(N, K(le))
1030
+ }, null, 40, nn),
1031
+ n("button", {
1032
+ type: "button",
1033
+ "data-column-index": N,
1034
+ "aria-pressed": e(Q) === N,
1035
+ tabindex: e(ue) === N ? 0 : -1,
1036
+ onClick: (le) => e(B).choose(N),
1037
+ onKeydown: a[25] || (a[25] = //@ts-ignore
1038
+ (...le) => e(B).navigate && e(B).navigate(...le))
1039
+ }, [
1040
+ n("span", an, s(N + 1), 1),
1041
+ n("span", on, [
1042
+ n("strong", null, s(l.header), 1),
1043
+ n("small", null, s(l.field), 1)
1044
+ ]),
1045
+ e(Q) === N ? (p(), ke(W, {
1046
+ key: 0,
1047
+ name: "chevron-right",
1048
+ size: 13
1049
+ })) : H("", !0)
1050
+ ], 40, ln)
1051
+ ], 2))), 128)),
1052
+ e(d).length ? H("", !0) : (p(), y("p", sn, [
1053
+ q(W, {
1054
+ name: "search",
1055
+ size: 20
1056
+ }),
1057
+ P(s(e(t).noColumns), 1)
1058
+ ]))
1059
+ ], 8, tn),
1060
+ e(h).length ? (p(), y("div", rn, [
1061
+ n("label", null, [
1062
+ P(s(e(t).batchBody), 1),
1063
+ n("select", {
1064
+ "aria-label": e(t).batchBody,
1065
+ disabled: r.readonly || e(S) || e(A),
1066
+ onChange: a[26] || (a[26] = (l) => ye(l, "align"))
1067
+ }, [
1068
+ n("option", dn, s(e(t).chooseAlignment), 1),
1069
+ n("option", cn, s(e(t).auto), 1),
1070
+ n("option", vn, s(e(t).left), 1),
1071
+ n("option", mn, s(e(t).center), 1),
1072
+ n("option", gn, s(e(t).right), 1),
1073
+ n("option", fn, s(e(t).justify), 1)
1074
+ ], 40, un)
1075
+ ]),
1076
+ n("label", null, [
1077
+ P(s(e(t).batchHeader), 1),
1078
+ n("select", {
1079
+ "aria-label": e(t).batchHeader,
1080
+ disabled: r.readonly || e(S) || e(A),
1081
+ onChange: a[27] || (a[27] = (l) => ye(l, "headerAlign"))
1082
+ }, [
1083
+ n("option", pn, s(e(t).chooseAlignment), 1),
1084
+ n("option", bn, s(e(t).left), 1),
1085
+ n("option", yn, s(e(t).center), 1),
1086
+ n("option", _n, s(e(t).right), 1),
1087
+ n("option", kn, s(e(t).justify), 1)
1088
+ ], 40, hn)
1089
+ ])
1090
+ ])) : H("", !0)
1091
+ ], 40, Ft)) : H("", !0)
1092
+ ], 64)) : (p(), y("p", wn, s(e(t).noColumns), 1))
1093
+ ], 64)) : e(R) === "template" ? (p(), y(X, { key: 1 }, [
1094
+ n("h3", null, s(e(t).templateDetails), 1),
1095
+ n("label", Cn, [
1096
+ P(s(e(t).name), 1),
866
1097
  n("input", {
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)
1098
+ value: e(b).name,
1099
+ disabled: r.readonly || e(S) || e(A),
1100
+ onInput: a[30] || (a[30] = (l) => e(i).setName(E(l)))
1101
+ }, null, 40, Sn)
871
1102
  ]),
872
- n("label", en, [
873
- R(a(e(t).description), 1),
1103
+ n("label", xn, [
1104
+ P(s(e(t).description), 1),
874
1105
  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)
880
- ]),
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)
1106
+ rows: "2",
1107
+ value: e(b).description,
1108
+ disabled: r.readonly || e(S) || e(A),
1109
+ onInput: a[31] || (a[31] = (l) => e(i).setDescription(E(l)))
1110
+ }, null, 40, Mn)
886
1111
  ]),
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),
1112
+ n("details", En, [
1113
+ n("summary", null, s(e(t).technicalDetails), 1),
1114
+ n("dl", An, [
1115
+ n("dt", null, s(e(t).templateIdentity), 1),
1116
+ n("dd", null, s(e(b).id), 1),
1117
+ n("dt", null, s(e(t).templateRevision), 1),
1118
+ n("dd", null, s(e(b).revision || e(t).unpublished), 1)
1119
+ ])
1120
+ ])
1121
+ ], 64)) : (p(), y(X, { key: 2 }, [
1122
+ n("h3", null, s(e(t).advancedTitle), 1),
1123
+ n("label", Tn, [
1124
+ P(s(e(t).json), 1),
1125
+ fe(n("textarea", {
1126
+ "onUpdate:modelValue": a[32] || (a[32] = (l) => he($) ? $.value = l : null),
895
1127
  class: "mr-designer-json",
896
1128
  "aria-label": e(t).json,
897
- disabled: c.readonly || e(h),
1129
+ disabled: r.readonly || e(S),
898
1130
  spellcheck: "false"
899
- }, null, 8, sn), [
900
- [fe, e(B)]
1131
+ }, null, 8, Dn), [
1132
+ [_e, e($)]
901
1133
  ])
902
1134
  ]),
903
1135
  n("button", {
904
1136
  type: "button",
905
1137
  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)
1138
+ disabled: r.readonly || e(S),
1139
+ onClick: a[33] || (a[33] = //@ts-ignore
1140
+ (...l) => e(i).applyJson && e(i).applyJson(...l))
1141
+ }, s(e(t).applyJson), 9, $n)
910
1142
  ], 64)),
911
- e(T) ? (y(), k("p", dn, a(e(t).jsonPending), 1)) : P("", !0)
912
- ], 8, Qe)
1143
+ e(A) ? (p(), y("p", jn, s(e(t).jsonPending), 1)) : H("", !0)
1144
+ ], 10, ft)
913
1145
  ]),
914
1146
  n("div", {
915
1147
  class: "mr-designer-preview",
916
1148
  "aria-label": e(t).previewTitle
917
1149
  }, [
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", {
921
- key: o.path
922
- }, a(o.path) + ":" + a(o.message), 1))), 128))
1150
+ e(_) ? (p(), y("div", Ln, s(e(_)), 1)) : H("", !0),
1151
+ e(V).ok ? H("", !0) : (p(), y("ul", Rn, [
1152
+ (p(!0), y(X, null, oe(e(V).errors, (l) => (p(), y("li", {
1153
+ key: l.path
1154
+ }, s(l.path) + ":" + s(l.message), 1))), 128))
923
1155
  ])),
924
- e(x) && e(j).ok ? (y(), ge(e(xe), {
1156
+ e(x) && e(V).ok ? (p(), ke(e(Le), {
925
1157
  key: 2,
926
1158
  "report-id": "draft",
927
1159
  fetcher: e(x),
1160
+ messages: {
1161
+ title: e(t).previewTitle,
1162
+ columnDirectory: e(t).previewFieldDirectory
1163
+ },
928
1164
  "show-params": !1,
929
1165
  editable: !1,
930
1166
  "excel-import": !1,
931
1167
  height: "100%"
932
- }, null, 8, ["fetcher"])) : (y(), k("p", mn, a(e(t).invalid), 1))
933
- ], 8, un)
1168
+ }, null, 8, ["fetcher", "messages"])) : (p(), y("p", Bn, s(e(t).invalid), 1))
1169
+ ], 8, Vn)
934
1170
  ])
935
- ], 8, Ve));
1171
+ ], 8, tt));
936
1172
  }
937
- }), yn = /* @__PURE__ */ Ee(fn, [["__scopeId", "data-v-8bbff75e"]]);
1173
+ }), Gn = /* @__PURE__ */ Se(Pn, [["__scopeId", "data-v-10c10f4e"]]);
938
1174
  export {
939
- yn as ReportTemplateEditor,
940
- $e as TEMPLATE_EDITOR_MESSAGES
1175
+ Gn as ReportTemplateEditor,
1176
+ Ye as TEMPLATE_EDITOR_MESSAGES
941
1177
  };