@agile-team/mach-report 2.12.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/ExcelBindingWizard-CLT2p7P3.cjs +1 -0
- package/dist/ExcelBindingWizard-CvsWR8Ga.js +1485 -0
- package/dist/{ParamEditor-BLaE5q5W.js → ParamEditor-CflQV3eQ.js} +191 -187
- package/dist/ParamEditor-vIDzvpPV.cjs +1 -0
- package/dist/ReportBatchPanel-DkxTzBkD.cjs +1 -0
- package/dist/{ReportBatchPanel-B5ClP9tm.js → ReportBatchPanel-LqVgiqp7.js} +3 -3
- package/dist/ReportPreview-CvbqLUzM.cjs +6 -0
- package/dist/ReportPreview-D_ywJ_-H.js +4533 -0
- package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-MjWEtc7X.js} +1 -1
- package/dist/ReportTemplateLibrary-cQ1sqNYo.cjs +1 -0
- package/dist/RuleEditor-BaR6xUiI.cjs +1 -0
- package/dist/RuleEditor-ChuXMlei.js +2037 -0
- package/dist/TemplateOutlinePanel-BHKP89Xz.cjs +1 -0
- package/dist/TemplateOutlinePanel-Dci6aRn1.js +96 -0
- package/dist/TemplateReusePanel-B7Gmyc1z.js +388 -0
- package/dist/TemplateReusePanel-CY5eO2Sh.cjs +1 -0
- package/dist/TemplateReviewPanel-DjlX3xpt.js +592 -0
- package/dist/TemplateReviewPanel-JvZe9_4G.cjs +1 -0
- package/dist/{batch-mRqhhhjt.js → batch-DzaTNLWI.js} +23 -16
- package/dist/batch-xMkqYiTr.cjs +1 -0
- package/dist/config-0UIohTS7.cjs +1 -0
- package/dist/{config-B612mw0x.js → config-Dt9NtCPl.js} +227 -186
- package/dist/data-explanation-BktvER5B.cjs +1 -0
- package/dist/data-explanation-C_J6jYNi.js +16 -0
- package/dist/designer-Ci1LizA9.js +5020 -0
- package/dist/designer-rtmVIIdN.cjs +2 -0
- package/dist/designer.cjs +1 -2
- package/dist/designer.d.cts +306 -3
- package/dist/designer.d.ts +306 -3
- package/dist/designer.js +21 -4266
- package/dist/font-loader-DHto6Lra.js +297 -0
- package/dist/font-loader-vhCT8znW.cjs +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +182 -1
- package/dist/index.d.ts +182 -1
- package/dist/index.js +728 -628
- package/dist/{template-review-BzpcI-tR.js → json-snapshot-BeFT3Tso.js} +867 -637
- package/dist/json-snapshot-D1NTP2oI.cjs +2 -0
- package/dist/pdf-8UPQebOE.js +36288 -0
- package/dist/pdf-AyJGb22z.cjs +101 -0
- package/dist/pdf.cjs +1 -101
- package/dist/pdf.js +9 -36579
- package/dist/plugin-BGKf-Tqg.js +22 -0
- package/dist/{plugin-BDTU4D94.cjs → plugin-CktLH_Iy.cjs} +1 -1
- package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-DEJbhpCv.js} +1 -1
- package/dist/server/node.d.cts +46 -11
- package/dist/server/node.d.ts +46 -11
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +294 -280
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +107 -12
- package/dist/server.d.ts +107 -12
- package/dist/server.js +713 -453
- package/dist/style.css +1 -1
- package/dist/template-bindings-BJR4k7qZ.cjs +1 -0
- package/dist/template-bindings-Daui7hLF.js +252 -0
- package/dist/template-fragments-CLkGo6To.js +187 -0
- package/dist/template-fragments-DFUpq5QM.cjs +1 -0
- package/dist/template-outline-B3xVkzSv.cjs +1 -0
- package/dist/template-outline-CFenM1PV.js +88 -0
- package/dist/{template-registry-BjE1VS6g.js → template-registry-COXDEJEM.js} +1 -1
- package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
- package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
- package/dist/{validate-DbgEM1Hh.js → validate-CkQBWCeg.js} +3 -3
- package/dist/vue/async.d.cts +72 -2
- package/dist/vue/async.d.ts +72 -2
- package/dist/vue/index.d.cts +124 -5
- package/dist/vue/index.d.ts +124 -5
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +78 -71
- package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BfK1yHOO.js} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +46 -11
- package/dist/worker.d.ts +46 -11
- package/dist/worker.js +59 -55
- package/dist/xlsx.js +3 -3
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
- package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
- package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
- package/dist/ReportBatchPanel-Dc-SDkYA.cjs +0 -1
- package/dist/ReportPreview-DWXROHBP.cjs +0 -6
- package/dist/ReportPreview-DiNXhQI0.js +0 -4138
- package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
- package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
- package/dist/RuleEditor-DzAmW5YH.js +0 -2024
- package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
- package/dist/batch-Bt3Fd27Z.cjs +0 -1
- package/dist/config-BRoLo2oj.cjs +0 -1
- package/dist/plugin-Cd5G2QQn.js +0 -22
- package/dist/record-bindings-By_UKZ2g.cjs +0 -1
- package/dist/record-bindings-D-5jQlTj.js +0 -196
- package/dist/template-review-BfCC8Ng9.cjs +0 -2
package/dist/designer.js
CHANGED
|
@@ -1,4268 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { resolveGridLayout as Ee, parseReportTemplate as de, serializeReportTemplate as _e, validateReportTemplateDocument as pt } from "@agile-team/mach-report";
|
|
4
|
-
import { _ as $e, a as ve } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
5
|
-
import { r as Gt, a as Ot, b as Bt, i as gt, c as zt } from "./record-bindings-D-5jQlTj.js";
|
|
6
|
-
import { c as jt } from "./tree-CqcQ99NM.js";
|
|
7
|
-
import { r as We } from "./style-CQ1PK8ZB.js";
|
|
8
|
-
function Vt(t, d, o = 3) {
|
|
9
|
-
if (!t.tree) return d.slice(0, o).map((i) => t.columns.map((a) => Gt(t, a, i)));
|
|
10
|
-
if (d.length > 200) return [];
|
|
11
|
-
try {
|
|
12
|
-
return jt(d, { ...t.tree, maxRows: Math.min(200, t.tree.maxRows ?? 200), maxAggregationVisits: Math.min(2e3, t.tree.maxAggregationVisits ?? 2e3) }, { computed: t.computed?.length ? { fields: t.computed, maxRows: 200, maxCells: 4096 } : void 0 }).entries.slice(0, o).map((a) => t.columns.map((s) => Ot(t, s, a)));
|
|
13
|
-
} catch {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const at = 96 / 25.4;
|
|
18
|
-
function Ke(t) {
|
|
19
|
-
return t.kind === "list" ? Math.max(
|
|
20
|
-
16,
|
|
21
|
-
(t.headerGrid?.rowHeightsMm?.reduce(
|
|
22
|
-
(d, o) => d + o,
|
|
23
|
-
0
|
|
24
|
-
) ?? 8) + (t.rowHeightMm ?? 8) * 3
|
|
25
|
-
) : t.heightMm;
|
|
26
|
-
}
|
|
27
|
-
function ke(t) {
|
|
28
|
-
return {
|
|
29
|
-
leftMm: t.leftMm,
|
|
30
|
-
topMm: t.topMm,
|
|
31
|
-
widthMm: t.widthMm,
|
|
32
|
-
heightMm: Ke(t)
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function Le(t, d) {
|
|
36
|
-
return d ? t.template.pages[d.pageIndex]?.components[d.componentIndex] : void 0;
|
|
37
|
-
}
|
|
38
|
-
function Wt(t, d = "detail") {
|
|
39
|
-
const o = { leftMm: 10, topMm: 10, widthMm: 60, heightMm: 10 };
|
|
40
|
-
return t === "qrcode" ? { ...o, kind: t, widthMm: 22, heightMm: 22, code: { value: "MACHREPORT", errorCorrection: "M", quietZoneModules: 4 } } : t === "barcode" ? { ...o, kind: t, widthMm: 50, heightMm: 16, code: { value: "MR20261022", symbology: "code128", quietZoneModules: 10, showText: !0 } } : t === "list" ? {
|
|
41
|
-
kind: t,
|
|
42
|
-
leftMm: 10,
|
|
43
|
-
topMm: 30,
|
|
44
|
-
widthMm: 90,
|
|
45
|
-
dataset: d,
|
|
46
|
-
columns: [
|
|
47
|
-
{ header: "字段", field: "field", widthMm: 45 },
|
|
48
|
-
{ header: "数值", field: "value", widthMm: 45 }
|
|
49
|
-
],
|
|
50
|
-
border: !0,
|
|
51
|
-
headerBackgroundColor: "#eaf2fc",
|
|
52
|
-
headerAlign: "center"
|
|
53
|
-
} : t === "text" ? {
|
|
54
|
-
...o,
|
|
55
|
-
kind: t,
|
|
56
|
-
text: "文本",
|
|
57
|
-
style: { fontSize: 12, color: "#233c5c" }
|
|
58
|
-
} : t === "rect" ? {
|
|
59
|
-
...o,
|
|
60
|
-
kind: t,
|
|
61
|
-
style: {
|
|
62
|
-
borderColor: "#cbd5e1",
|
|
63
|
-
lineWidthPt: 0.75,
|
|
64
|
-
backgroundColor: "#eff6ff"
|
|
65
|
-
}
|
|
66
|
-
} : {
|
|
67
|
-
...o,
|
|
68
|
-
kind: t,
|
|
69
|
-
widthMm: 48,
|
|
70
|
-
heightMm: 24,
|
|
71
|
-
imageData: `data:image/svg+xml;charset=utf-8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="180" height="90" viewBox="0 0 180 90"><rect width="180" height="90" rx="5" fill="#eff6ff"/><path d="m25 68 32-32 25 23 27-35 45 44" fill="none" stroke="#94b8e5" stroke-width="3"/><circle cx="45" cy="24" r="7" fill="#bfd5ef"/></svg>')}`
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function Ue(t, d, o = !1) {
|
|
75
|
-
const i = Math.max(2, Math.min(d.widthMm, t.widthMm)), a = Math.max(2, Math.min(d.heightMm, t.heightMm));
|
|
76
|
-
return {
|
|
77
|
-
leftMm: Math.max(0, Math.min(d.widthMm - i, t.leftMm)),
|
|
78
|
-
topMm: Math.max(
|
|
79
|
-
0,
|
|
80
|
-
Math.min(d.heightMm - (o ? 2 : a), t.topMm)
|
|
81
|
-
),
|
|
82
|
-
widthMm: i,
|
|
83
|
-
heightMm: a
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function Ge(t, d) {
|
|
87
|
-
const o = t.widthMm;
|
|
88
|
-
if (Object.assign(t, {
|
|
89
|
-
leftMm: d.leftMm,
|
|
90
|
-
topMm: d.topMm,
|
|
91
|
-
widthMm: d.widthMm
|
|
92
|
-
}), t.kind !== "list") t.heightMm = d.heightMm;
|
|
93
|
-
else if (o > 0 && d.widthMm !== o) {
|
|
94
|
-
const i = d.widthMm / o;
|
|
95
|
-
t.columns.forEach((a) => {
|
|
96
|
-
a.widthMm = Math.round(a.widthMm * i * 100) / 100;
|
|
97
|
-
}), t.widthMm = t.columns.reduce(
|
|
98
|
-
(a, s) => a + s.widthMm,
|
|
99
|
-
0
|
|
100
|
-
), t.headerGrid && (t.headerGrid.colWidthsMm = t.columns.map(
|
|
101
|
-
(a) => a.widthMm
|
|
102
|
-
));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function Ut(t, d, o) {
|
|
106
|
-
if (d === o || !t.columns[d] || !t.columns[o]) return !1;
|
|
107
|
-
if (t.headerGrid) {
|
|
108
|
-
if (Ee(t.headerGrid, t.widthMm, 100).cells.some(({ cell: s }) => (s.colSpan ?? 1) > 1))
|
|
109
|
-
throw new Error("请先拆分跨列合并表头,再调整列顺序,避免改变业务分组。");
|
|
110
|
-
const a = Je(t);
|
|
111
|
-
a.forEach((s) => {
|
|
112
|
-
s.splice(o, 0, s.splice(d, 1)[0]);
|
|
113
|
-
}), t.headerGrid = qe(
|
|
114
|
-
a,
|
|
115
|
-
t.columns.map((s) => s.widthMm),
|
|
116
|
-
t.headerGrid.rowHeightsMm ?? a.map(() => 8)
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
return t.columns.splice(o, 0, t.columns.splice(d, 1)[0]), t.headerGrid && (t.headerGrid.colWidthsMm = t.columns.map((i) => i.widthMm)), !0;
|
|
120
|
-
}
|
|
121
|
-
function Je(t) {
|
|
122
|
-
if (!t.headerGrid)
|
|
123
|
-
return [t.columns.map((o) => ({ text: o.header }))];
|
|
124
|
-
const d = Array.from(
|
|
125
|
-
{ length: t.headerGrid.cells.length },
|
|
126
|
-
() => Array.from({ length: t.columns.length }, () => null)
|
|
127
|
-
);
|
|
128
|
-
for (const { cell: o, ri: i, ci: a } of Ee(
|
|
129
|
-
t.headerGrid,
|
|
130
|
-
t.widthMm,
|
|
131
|
-
100
|
|
132
|
-
).cells)
|
|
133
|
-
d[i][a] = o;
|
|
134
|
-
return d;
|
|
135
|
-
}
|
|
136
|
-
function qe(t, d, o) {
|
|
137
|
-
const i = /* @__PURE__ */ new Set();
|
|
138
|
-
return { cells: t.map(
|
|
139
|
-
(s, v) => s.flatMap((M, f) => {
|
|
140
|
-
if (i.has(`${v}:${f}`)) return [];
|
|
141
|
-
if (!M) return [null];
|
|
142
|
-
for (let p = v; p < v + (M.rowSpan ?? 1); p++)
|
|
143
|
-
for (let k = f; k < f + (M.colSpan ?? 1); k++)
|
|
144
|
-
(p !== v || k !== f) && i.add(`${p}:${k}`);
|
|
145
|
-
return [M];
|
|
146
|
-
})
|
|
147
|
-
), colWidthsMm: d, rowHeightsMm: o };
|
|
148
|
-
}
|
|
149
|
-
function Kt(t) {
|
|
150
|
-
const d = Je(t), o = t.headerGrid?.rowHeightsMm ?? d.map(() => 8);
|
|
151
|
-
d.unshift(
|
|
152
|
-
t.columns.map(() => ({
|
|
153
|
-
text: "分组",
|
|
154
|
-
style: { align: "center", backgroundColor: "#eaf2fc", bold: !0 }
|
|
155
|
-
}))
|
|
156
|
-
), t.headerGrid = qe(
|
|
157
|
-
d,
|
|
158
|
-
t.columns.map((i) => i.widthMm),
|
|
159
|
-
[8, ...o]
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
function Jt(t, d, o, i) {
|
|
163
|
-
if (o >= i || o < 0 || i >= t.columns.length)
|
|
164
|
-
throw new Error("请选择同一行的至少两个连续表头。");
|
|
165
|
-
const a = Je(t), s = a[d];
|
|
166
|
-
if (!s) throw new Error("表头行不存在。");
|
|
167
|
-
const v = s.slice(o, i + 1);
|
|
168
|
-
if (v.some(
|
|
169
|
-
(f) => !f || (f.colSpan ?? 1) !== 1 || (f.rowSpan ?? 1) !== 1
|
|
170
|
-
))
|
|
171
|
-
throw new Error("选择包含合并区域,请先拆分,再重新合并。");
|
|
172
|
-
const M = v[0];
|
|
173
|
-
s[o] = { ...M, colSpan: i - o + 1 };
|
|
174
|
-
for (let f = o + 1; f <= i; f++) s[f] = null;
|
|
175
|
-
t.headerGrid = qe(
|
|
176
|
-
a,
|
|
177
|
-
t.columns.map((f) => f.widthMm),
|
|
178
|
-
t.headerGrid?.rowHeightsMm ?? [8]
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
function qt(t, d, o) {
|
|
182
|
-
if (!t.headerGrid) return;
|
|
183
|
-
const a = Ee(t.headerGrid, t.widthMm, 100).cells.find(
|
|
184
|
-
({ ri: p, ci: k, cell: E }) => d >= p && d < p + (E.rowSpan ?? 1) && o >= k && o < k + (E.colSpan ?? 1)
|
|
185
|
-
);
|
|
186
|
-
if (!a) return;
|
|
187
|
-
const s = Je(t), { ri: v, ci: M, cell: f } = a;
|
|
188
|
-
for (let p = v; p < v + (f.rowSpan ?? 1); p++)
|
|
189
|
-
for (let k = M; k < M + (f.colSpan ?? 1); k++) {
|
|
190
|
-
const E = {
|
|
191
|
-
...f,
|
|
192
|
-
text: p === s.length - 1 ? t.columns[k].header : f.text
|
|
193
|
-
};
|
|
194
|
-
delete E.colSpan, delete E.rowSpan, s[p][k] = E;
|
|
195
|
-
}
|
|
196
|
-
t.headerGrid = qe(
|
|
197
|
-
s,
|
|
198
|
-
t.columns.map((p) => p.widthMm),
|
|
199
|
-
t.headerGrid.rowHeightsMm ?? s.map(() => 8)
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
function Yt(t) {
|
|
203
|
-
const d = W(), o = W(0.8), i = W(0), a = W(0), s = D(() => o.value * at), v = D(() => t.document.template.pages[t.pageIndex]), M = D(() => v.value.widthMm * s.value > a.value - 40);
|
|
204
|
-
let f, p = !!t.document.template.repeat;
|
|
205
|
-
function k(u) {
|
|
206
|
-
const y = d.value;
|
|
207
|
-
if (!y || y.clientWidth <= 40 || y.clientHeight <= 40) return;
|
|
208
|
-
let x = { leftMm: 0, topMm: 0, widthMm: v.value.widthMm, heightMm: v.value.heightMm };
|
|
209
|
-
const C = t.selection?.pageIndex === t.pageIndex ? v.value.components[t.selection.componentIndex] : void 0;
|
|
210
|
-
u === "selection" && C && (x = ke(C));
|
|
211
|
-
const P = (y.clientWidth - 40) / (x.widthMm * at), L = (y.clientHeight - 40) / (x.heightMm * at);
|
|
212
|
-
o.value = Math.max(0.05, Math.min(2, u === "width" ? P : Math.min(P, L))), ce(() => {
|
|
213
|
-
y.scrollLeft = x.leftMm * s.value, y.scrollTop = x.topMm * s.value;
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function E(u) {
|
|
217
|
-
p = !1, k(u);
|
|
218
|
-
}
|
|
219
|
-
function S(u) {
|
|
220
|
-
Number.isFinite(u) && (p = !1, o.value = Math.max(0.05, Math.min(2, u)));
|
|
221
|
-
}
|
|
222
|
-
function I() {
|
|
223
|
-
const u = d.value;
|
|
224
|
-
u && (a.value = u.clientWidth, i.value = u.scrollWidth > u.clientWidth ? Math.round(u.scrollLeft / (u.scrollWidth - u.clientWidth) * 100) : 0);
|
|
225
|
-
}
|
|
226
|
-
function w(u) {
|
|
227
|
-
const y = d.value;
|
|
228
|
-
y && (y.scrollLeft = (y.scrollWidth - y.clientWidth) * u / 100), i.value = u;
|
|
229
|
-
}
|
|
230
|
-
function g() {
|
|
231
|
-
I(), p && t.document.template.repeat && k("page");
|
|
232
|
-
}
|
|
233
|
-
async function $() {
|
|
234
|
-
await ce();
|
|
235
|
-
const u = d.value, y = t.selection;
|
|
236
|
-
if (!u || y?.pageIndex !== t.pageIndex) return;
|
|
237
|
-
const x = v.value.components[y.componentIndex];
|
|
238
|
-
if (!x) return;
|
|
239
|
-
const C = ke(x);
|
|
240
|
-
if (x.kind === "list" && t.columnIndex !== void 0 && t.columnIndex >= 0) {
|
|
241
|
-
const j = x;
|
|
242
|
-
C.leftMm += j.columns.slice(0, t.columnIndex).reduce((te, se) => te + se.widthMm, 0), C.widthMm = j.columns[t.columnIndex]?.widthMm ?? C.widthMm;
|
|
243
|
-
}
|
|
244
|
-
const P = C.leftMm * s.value, L = C.topMm * s.value, F = P + C.widthMm * s.value, G = L + C.heightMm * s.value;
|
|
245
|
-
P < u.scrollLeft ? u.scrollLeft = P : F > u.scrollLeft + u.clientWidth - 40 && (u.scrollLeft = Math.max(0, Math.min(P, F - u.clientWidth + 40))), L < u.scrollTop ? u.scrollTop = L : G > u.scrollTop + u.clientHeight - 40 && (u.scrollTop = Math.max(0, Math.min(L, G - u.clientHeight + 40))), I();
|
|
246
|
-
}
|
|
247
|
-
return le(() => [t.selection, t.columnIndex, t.pageIndex], () => {
|
|
248
|
-
$();
|
|
249
|
-
}), le(() => t.document.id, () => {
|
|
250
|
-
p = !!t.document.template.repeat, ce(g);
|
|
251
|
-
}), le(() => [!!t.document.template.repeat, t.pageIndex, v.value.widthMm, v.value.heightMm], () => {
|
|
252
|
-
ce(g);
|
|
253
|
-
}), yt(() => {
|
|
254
|
-
g(), typeof ResizeObserver < "u" && d.value && (f = new ResizeObserver(g), f.observe(d.value));
|
|
255
|
-
}), He(() => f?.disconnect()), { viewport: d, zoom: o, scale: s, page: v, wide: M, fraction: i, fit: E, setZoom: S, sync: I, navigate: w };
|
|
256
|
-
}
|
|
257
|
-
function Xt(t, d, o) {
|
|
258
|
-
if (t.kind === "list") return { text: t.dataset };
|
|
259
|
-
const i = t.kind === "barcode" || t.kind === "qrcode" ? t.code?.value ?? t.fallbackText ?? t.text ?? "" : t.text ?? t.fallbackText ?? "";
|
|
260
|
-
return t.binding ? Zt(t, d, o) : { text: i, ...t.imageData ? { image: t.imageData } : {} };
|
|
261
|
-
}
|
|
262
|
-
function Zt(t, d, o) {
|
|
263
|
-
const i = t.binding, a = d.template.repeat, s = a ? o?.[a.dataset]?.[0] : void 0;
|
|
264
|
-
if (!s) return { text: i.field, bound: !0 };
|
|
265
|
-
try {
|
|
266
|
-
const v = Bt(i, s, { dataset: a?.dataset, rowIndex: 0 });
|
|
267
|
-
return t.kind === "image" && v && !gt(v) ? { text: i.field, bound: !0, error: "image-binding" } : { text: v, bound: !0, ...t.kind === "image" && gt(v) ? { image: v } : {} };
|
|
268
|
-
} catch (v) {
|
|
269
|
-
return { text: i.field, bound: !0, error: v instanceof Error ? v.message : String(v) };
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function ht(t, d) {
|
|
273
|
-
const i = [1, 2, 5, 10, 20, 50, 100, 200, 500, 1e3].find((s) => s * d >= 36) ?? Math.max(1e3, Math.ceil(t / 200));
|
|
274
|
-
return Array.from({ length: Math.min(201, Math.floor(t / i) + 1) }, (s, v) => ({ mm: v * i, position: v * i * d }));
|
|
275
|
-
}
|
|
276
|
-
const lt = [
|
|
277
|
-
{ id: "label-80-55", widthMm: 80, heightMm: 55 },
|
|
278
|
-
{ id: "label-80-50", widthMm: 80, heightMm: 50 },
|
|
279
|
-
{ id: "label-100-60", widthMm: 100, heightMm: 60 },
|
|
280
|
-
{ id: "a4", widthMm: 210, heightMm: 297 },
|
|
281
|
-
{ id: "a3", widthMm: 297, heightMm: 420 }
|
|
282
|
-
];
|
|
283
|
-
function ot(t, d, o) {
|
|
284
|
-
return typeof t.meta?.title == "string" && t.meta.title.trim() ? t.meta.title : `${o} ${d + 1}`;
|
|
285
|
-
}
|
|
286
|
-
function kt(t) {
|
|
287
|
-
return t.components.flatMap((d, o) => {
|
|
288
|
-
const i = d.kind === "list" ? d.rowHeightMm ?? Ke(d) : d.heightMm;
|
|
289
|
-
return d.leftMm < 0 || d.topMm < 0 || d.leftMm + d.widthMm > t.widthMm + 1e-3 || d.topMm + i > t.heightMm + 1e-3 ? [o] : [];
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
function Qt(t, d) {
|
|
293
|
-
const o = JSON.parse(JSON.stringify(t)), i = new Set(d.flatMap((v) => v.components.map((M) => M.kind === "list" ? M.id : M.nid)).filter(Boolean)), a = /* @__PURE__ */ new Map();
|
|
294
|
-
let s = 0;
|
|
295
|
-
for (const v of o.components) {
|
|
296
|
-
const M = v.kind === "list" ? v.id : v.nid;
|
|
297
|
-
if (!M) continue;
|
|
298
|
-
let f;
|
|
299
|
-
do
|
|
300
|
-
f = `page-copy-${++s}`;
|
|
301
|
-
while (i.has(f));
|
|
302
|
-
i.add(f), a.set(M, f), v.kind === "list" ? v.id = f : (v.nid = f, delete v.rkey);
|
|
303
|
-
}
|
|
304
|
-
return o.flow?.bands.forEach((v) => {
|
|
305
|
-
v.componentIds = v.componentIds.map((M) => a.get(M) ?? M);
|
|
306
|
-
}), o;
|
|
307
|
-
}
|
|
308
|
-
function en(t, d, o) {
|
|
309
|
-
const i = t.template.pages, a = i[d];
|
|
310
|
-
if (!a) return 0;
|
|
311
|
-
if (o.type === "patch")
|
|
312
|
-
return Object.assign(a, o.patch), d;
|
|
313
|
-
if (o.type === "remove")
|
|
314
|
-
return i.length <= 1 ? d : (i.splice(d, 1), Math.min(d, i.length - 1));
|
|
315
|
-
const s = o.type === "duplicate" ? Qt(a, i) : JSON.parse(JSON.stringify(a));
|
|
316
|
-
return o.type === "add" && (s.components = [], delete s.flow, delete s.meta), i.splice(d + 1, 0, s), d + 1;
|
|
317
|
-
}
|
|
318
|
-
function ft(t, d, o) {
|
|
319
|
-
const i = t.filter((a) => a !== d).flatMap((a) => {
|
|
320
|
-
const s = a[o], v = o === "leftMm" ? a.widthMm : Ke(a);
|
|
321
|
-
return [s, s + v / 2, s + v];
|
|
322
|
-
});
|
|
323
|
-
return [...new Set(i)].sort((a, s) => a - s);
|
|
324
|
-
}
|
|
325
|
-
function tn(t, d) {
|
|
326
|
-
if (!t.length) return;
|
|
327
|
-
let o = 0, i = t.length;
|
|
328
|
-
for (; o < i; ) {
|
|
329
|
-
const v = o + i >>> 1;
|
|
330
|
-
t[v] < d ? o = v + 1 : i = v;
|
|
331
|
-
}
|
|
332
|
-
const a = t[Math.max(0, o - 1)], s = t[Math.min(t.length - 1, o)];
|
|
333
|
-
return Math.abs(a - d) < Math.abs(s - d) ? a : s;
|
|
334
|
-
}
|
|
335
|
-
function bt(t, d, o, i) {
|
|
336
|
-
let a = 1 / 0, s = {
|
|
337
|
-
value: Math.round(t * 2) / 2
|
|
338
|
-
};
|
|
339
|
-
for (const v of [0, d / 2, d]) {
|
|
340
|
-
const M = tn(o, t + v);
|
|
341
|
-
if (M === void 0) continue;
|
|
342
|
-
const f = Math.abs(M - t - v);
|
|
343
|
-
f <= i && f < a && (a = f, s = { value: M - v, guide: M });
|
|
344
|
-
}
|
|
345
|
-
return s;
|
|
346
|
-
}
|
|
347
|
-
function nn(t, d, o, i) {
|
|
348
|
-
if (i) {
|
|
349
|
-
const a = Math.abs(d) >= Math.abs(o) ? d : o, s = Math.round((t.widthMm + a) * 2) / 2;
|
|
350
|
-
return { ...t, widthMm: s, heightMm: s };
|
|
351
|
-
}
|
|
352
|
-
return { ...t, widthMm: Math.round((t.widthMm + d) * 2) / 2, heightMm: Math.round((t.heightMm + o) * 2) / 2 };
|
|
353
|
-
}
|
|
354
|
-
function an(t) {
|
|
355
|
-
let d;
|
|
356
|
-
function o(i, a, s = !1) {
|
|
357
|
-
if (t.disabled() || i.button !== 0) return;
|
|
358
|
-
i.preventDefault(), i.stopPropagation(), d?.();
|
|
359
|
-
const v = i.currentTarget.closest(
|
|
360
|
-
"[data-canvas-component]"
|
|
361
|
-
), M = ke(a), f = i.clientX, p = i.clientY;
|
|
362
|
-
let k = M, E = 0;
|
|
363
|
-
const S = t.scale.value, I = v.parentElement;
|
|
364
|
-
let w, g;
|
|
365
|
-
const $ = () => {
|
|
366
|
-
for (const [G, j] of [
|
|
367
|
-
["x", w],
|
|
368
|
-
["y", g]
|
|
369
|
-
])
|
|
370
|
-
I.style.setProperty(
|
|
371
|
-
`--mr-canvas-guide-${G}-display`,
|
|
372
|
-
j === void 0 ? "none" : "block"
|
|
373
|
-
), j !== void 0 && I.style.setProperty(
|
|
374
|
-
`--mr-canvas-guide-${G}`,
|
|
375
|
-
`${j * S}px`
|
|
376
|
-
);
|
|
377
|
-
}, u = () => {
|
|
378
|
-
E = 0, $(), v.style.left = `${k.leftMm * S}px`, v.style.top = `${k.topMm * S}px`, v.style.width = `${k.widthMm * S}px`, v.style.height = `${k.heightMm * S}px`;
|
|
379
|
-
}, y = {
|
|
380
|
-
leftMm: ft(t.page().components, a, "leftMm"),
|
|
381
|
-
topMm: ft(t.page().components, a, "topMm")
|
|
382
|
-
}, x = (G) => {
|
|
383
|
-
const j = (G.clientX - f) / S, te = (G.clientY - p) / S, se = bt(
|
|
384
|
-
M.leftMm + j,
|
|
385
|
-
M.widthMm,
|
|
386
|
-
y.leftMm,
|
|
387
|
-
5 / S
|
|
388
|
-
), r = bt(
|
|
389
|
-
M.topMm + te,
|
|
390
|
-
M.heightMm,
|
|
391
|
-
y.topMm,
|
|
392
|
-
5 / S
|
|
393
|
-
);
|
|
394
|
-
w = s ? void 0 : se.guide, g = s ? void 0 : r.guide, k = Ue(
|
|
395
|
-
s ? nn(M, j, te, a.kind === "qrcode") : { ...M, leftMm: se.value, topMm: r.value },
|
|
396
|
-
t.page(),
|
|
397
|
-
a.kind === "list"
|
|
398
|
-
), s && a.kind === "qrcode" && (k.widthMm = k.heightMm = Math.min(k.widthMm, k.heightMm)), E || (E = requestAnimationFrame(u));
|
|
399
|
-
}, C = (G) => {
|
|
400
|
-
window.removeEventListener("pointermove", x), window.removeEventListener("pointerup", P), window.removeEventListener("pointercancel", L), window.removeEventListener("keydown", F), E && cancelAnimationFrame(E), k = G ? k : M, w = void 0, g = void 0, u(), d = void 0, G && JSON.stringify(k) !== JSON.stringify(M) && t.commit(k);
|
|
401
|
-
}, P = () => C(!0), L = () => C(!1), F = (G) => {
|
|
402
|
-
G.key === "Escape" && (G.preventDefault(), L());
|
|
403
|
-
};
|
|
404
|
-
window.addEventListener("pointermove", x), window.addEventListener("pointerup", P), window.addEventListener("pointercancel", L), window.addEventListener("keydown", F), d = L;
|
|
405
|
-
}
|
|
406
|
-
return le(t.disabled, (i) => {
|
|
407
|
-
i && d?.();
|
|
408
|
-
}), le(t.page, () => d?.()), He(() => d?.()), { start: o };
|
|
409
|
-
}
|
|
410
|
-
const ln = {
|
|
411
|
-
title: "报表模板设计器",
|
|
412
|
-
heading: "模板设计",
|
|
413
|
-
unpublished: "未发布",
|
|
414
|
-
dirty: "有未保存修改",
|
|
415
|
-
reset: "恢复草稿",
|
|
416
|
-
saving: "正在保存…",
|
|
417
|
-
save: "保存草稿",
|
|
418
|
-
name: "模板名称",
|
|
419
|
-
description: "说明",
|
|
420
|
-
area: "明细区域",
|
|
421
|
-
page: "页",
|
|
422
|
-
header: "表头",
|
|
423
|
-
field: "业务字段",
|
|
424
|
-
width: "列宽(mm)",
|
|
425
|
-
semantic: "字段语义",
|
|
426
|
-
identifier: "编号",
|
|
427
|
-
dimension: "分类",
|
|
428
|
-
measure: "数值",
|
|
429
|
-
date: "日期",
|
|
430
|
-
text: "文本",
|
|
431
|
-
bodyAlign: "正文对齐",
|
|
432
|
-
headerAlign: "表头对齐",
|
|
433
|
-
auto: "按字段语义",
|
|
434
|
-
left: "居左",
|
|
435
|
-
center: "居中",
|
|
436
|
-
right: "居右",
|
|
437
|
-
justify: "两端对齐",
|
|
438
|
-
editable: "允许编辑",
|
|
439
|
-
json: "完整模板 JSON",
|
|
440
|
-
applyJson: "校验并应用 JSON",
|
|
441
|
-
note: "字段映射应与数据源契约一致。此编辑器维护模板属性;保存由接入方提供的版本服务处理。",
|
|
442
|
-
invalid: "请先修正模板错误,再预览或保存。"
|
|
443
|
-
}, on = {
|
|
444
|
-
paperAndPages: "纸张与版面",
|
|
445
|
-
pageDirectory: "版面目录",
|
|
446
|
-
pageName: "版面名称",
|
|
447
|
-
addPage: "新增版面",
|
|
448
|
-
duplicatePage: "复制版面",
|
|
449
|
-
removePage: "删除版面",
|
|
450
|
-
removePageConfirm: "此版面包含组件,删除后可通过撤销恢复。",
|
|
451
|
-
confirmRemovePage: "确认删除",
|
|
452
|
-
paperPreset: "纸张规格",
|
|
453
|
-
labelPaper: "标签",
|
|
454
|
-
customPaper: "自定义尺寸",
|
|
455
|
-
paperWidth: "纸宽(mm)",
|
|
456
|
-
paperHeight: "纸高(mm)",
|
|
457
|
-
pageLayout: "展示方式",
|
|
458
|
-
fixedPaper: "固定纸张",
|
|
459
|
-
completeWide: "完整宽表",
|
|
460
|
-
pageMargins: "页边距 · mm",
|
|
461
|
-
marginTop: "上边距",
|
|
462
|
-
marginRight: "右边距",
|
|
463
|
-
marginBottom: "下边距",
|
|
464
|
-
marginLeft: "左边距",
|
|
465
|
-
pageOverflow: "{count} 个组件超出纸张",
|
|
466
|
-
pageOverflowHint: "内容位置和尺寸已保留,请调整组件或纸张后核对打印预览。",
|
|
467
|
-
locateOverflow: "定位超界组件",
|
|
468
|
-
repeatRecords: "按记录生成标签",
|
|
469
|
-
repeatRecordsHint: "每条记录按版面顺序生成,支持多版与多份。",
|
|
470
|
-
recordDataset: "记录数据集",
|
|
471
|
-
recordRowKey: "记录主键字段(可选)",
|
|
472
|
-
labelCopies: "份数来源",
|
|
473
|
-
fixedCopies: "固定份数",
|
|
474
|
-
fieldCopies: "记录字段",
|
|
475
|
-
copiesPerRecord: "每条记录份数",
|
|
476
|
-
copiesField: "份数字段",
|
|
477
|
-
repeatBoundHint: "已有组件绑定此记录;移除全部字段绑定后可关闭。",
|
|
478
|
-
repeatOrderHint: "生成顺序:记录 → 份数 → 版面;预览会使用提供的真实样例。",
|
|
479
|
-
repeatNeedsFixed: "先使用固定纸张、将组件置于纸内,并移除明细表或流式区域。",
|
|
480
|
-
dataBinding: "记录绑定",
|
|
481
|
-
contentSource: "内容来源",
|
|
482
|
-
staticContent: "固定内容",
|
|
483
|
-
recordField: "记录字段",
|
|
484
|
-
bindingField: "绑定字段",
|
|
485
|
-
bindingNeedsRepeat: "先在“模板”开启按记录生成,再选择字段。",
|
|
486
|
-
bindingRecordHint: "字段随当前记录变化,空值与真实的 0 分开处理。",
|
|
487
|
-
bindingImageHint: "图片字段使用 PNG/JPEG base64 data URL;空值不显示,业务 URL 由接入方安全加载。",
|
|
488
|
-
valueFormat: "值格式",
|
|
489
|
-
naturalFormat: "原始显示",
|
|
490
|
-
numberFormat: "数值",
|
|
491
|
-
percentFormat: "百分比",
|
|
492
|
-
dateFormat: "日期",
|
|
493
|
-
decimalPlaces: "小数位",
|
|
494
|
-
datePattern: "日期格式",
|
|
495
|
-
bindingDecoration: "前后缀与空值",
|
|
496
|
-
valuePrefix: "前缀",
|
|
497
|
-
valueSuffix: "后缀",
|
|
498
|
-
emptyValueText: "空值显示",
|
|
499
|
-
insertQrcode: "二维码",
|
|
500
|
-
insertBarcode: "条形码",
|
|
501
|
-
codeSettings: "编码设置",
|
|
502
|
-
codeValue: "固定编码内容",
|
|
503
|
-
codeSymbology: "条码制式",
|
|
504
|
-
codeCorrection: "二维码纠错",
|
|
505
|
-
codeQuietZone: "留白(模块)",
|
|
506
|
-
codeShowText: "显示条码文字",
|
|
507
|
-
eanContentHint: "使用完整的 8 / 13 位数字,包含有效校验位;切换制式不会改写内容。",
|
|
508
|
-
code39ContentHint: "支持大写字母、数字、空格与 - . $ / + %;内容不会自动转换。",
|
|
509
|
-
code128ContentHint: "支持可打印 ASCII 内容;中文请使用二维码。",
|
|
510
|
-
codePlaceholder: "编码区域",
|
|
511
|
-
codePreviewHint: "设计中显示内容标识;切换预览核对实际编码。",
|
|
512
|
-
boundImagePlaceholder: "记录图片",
|
|
513
|
-
rulerLabel: "毫米标尺",
|
|
514
|
-
rulerToggle: "标尺",
|
|
515
|
-
designSample: "样例",
|
|
516
|
-
repeatPage: "每页重复",
|
|
517
|
-
repeatNone: "不重复",
|
|
518
|
-
repeatHeader: "页眉",
|
|
519
|
-
repeatFooter: "页脚",
|
|
520
|
-
textFormat: "文字样式",
|
|
521
|
-
fontSize: "字号(pt)",
|
|
522
|
-
fontBold: "加粗",
|
|
523
|
-
textColor: "文字颜色",
|
|
524
|
-
backgroundColor: "背景颜色",
|
|
525
|
-
canvasGridLimited: "设计窗口仅显示前 2000 个单元格;最终预览与导出保留完整内容。",
|
|
526
|
-
design: "设计",
|
|
527
|
-
preview: "预览",
|
|
528
|
-
componentSection: "组件",
|
|
529
|
-
toolsSection: "工具",
|
|
530
|
-
component: "组件",
|
|
531
|
-
components: "组件目录",
|
|
532
|
-
canvasHint: "点击选择 · 拖动移动 · 方向键微调 · Shift 加速 · Esc 取消",
|
|
533
|
-
zoom: "缩放",
|
|
534
|
-
sampleRows: "数据预览区域",
|
|
535
|
-
treeSampleHint: "树形样例需完整且有界,请在报表预览中验证",
|
|
536
|
-
resizeComponent: "调整组件尺寸",
|
|
537
|
-
resizeColumn: "调整列宽",
|
|
538
|
-
insertComponent: "添加组件",
|
|
539
|
-
insertText: "文本",
|
|
540
|
-
insertList: "明细表",
|
|
541
|
-
insertImage: "图片",
|
|
542
|
-
insertRect: "矩形",
|
|
543
|
-
removeComponent: "删除组件",
|
|
544
|
-
duplicateComponent: "复制组件",
|
|
545
|
-
forward: "向上移动层级",
|
|
546
|
-
backward: "向下移动层级",
|
|
547
|
-
positionGroup: "位置与尺寸 · mm",
|
|
548
|
-
componentContent: "组件内容",
|
|
549
|
-
componentText: "文本内容",
|
|
550
|
-
imageSource: "图片地址或 data URI",
|
|
551
|
-
imageUpload: "上传图片",
|
|
552
|
-
imageBudget: "图片不超过 4 MB,支持 PNG/JPEG/WebP/SVG",
|
|
553
|
-
leftPosition: "左侧",
|
|
554
|
-
topPosition: "顶部",
|
|
555
|
-
componentWidth: "宽度",
|
|
556
|
-
componentHeight: "高度",
|
|
557
|
-
noComponent: "在画布或目录选择组件",
|
|
558
|
-
listDataset: "数据集",
|
|
559
|
-
columnOrder: "列结构",
|
|
560
|
-
moveColumnLeft: "向前移动列",
|
|
561
|
-
moveColumnRight: "向后移动列",
|
|
562
|
-
columnVisible: "显示此列",
|
|
563
|
-
headerStructure: "多层表头",
|
|
564
|
-
addHeaderRow: "添加分组行",
|
|
565
|
-
mergeHeader: "合并所选表头",
|
|
566
|
-
splitHeader: "拆分表头",
|
|
567
|
-
headerRow: "表头行",
|
|
568
|
-
headerFirst: "开始列",
|
|
569
|
-
headerLast: "结束列",
|
|
570
|
-
flowLayout: "区域版式由 Excel 绑定向导管理;可编辑字段、格式与业务规则。",
|
|
571
|
-
paramsTool: "查询参数",
|
|
572
|
-
excelTool: "Excel 绑定",
|
|
573
|
-
rulesTool: "计算与规则",
|
|
574
|
-
reviewTool: "发布检查",
|
|
575
|
-
toolsDescription: "按需绑定数据、定义规则并验证模板。",
|
|
576
|
-
unapplied: "待应用",
|
|
577
|
-
pendingToolsLabel: "待处理配置",
|
|
578
|
-
pendingToolsHint: "应用或恢复后可保存",
|
|
579
|
-
saveReadonly: "当前为只读,无法保存",
|
|
580
|
-
saveConfirmation: "请先处理修改确认",
|
|
581
|
-
saveUnchanged: "没有需要保存的修改",
|
|
582
|
-
saveInvalid: "模板有错误,请先修正",
|
|
583
|
-
saveJsonPending: "完整 JSON 待应用",
|
|
584
|
-
returnToConfiguration: "返回配置",
|
|
585
|
-
rulesNeedList: "请先在字段区域选择明细表。",
|
|
586
|
-
undo: "撤销",
|
|
587
|
-
redo: "重做",
|
|
588
|
-
columnsSearch: "搜索列名或字段",
|
|
589
|
-
columnsSelected: "已选列",
|
|
590
|
-
selectVisible: "选择当前结果",
|
|
591
|
-
clearSelection: "清除选择",
|
|
592
|
-
noColumns: "没有匹配的列",
|
|
593
|
-
batchBody: "批量正文对齐",
|
|
594
|
-
batchHeader: "批量表头对齐",
|
|
595
|
-
chooseAlignment: "选择对齐方式",
|
|
596
|
-
discardTitle: "保留当前修改?",
|
|
597
|
-
discardDescription: "当前包含未保存的属性或尚未应用的 JSON,继续将丢弃这些修改。",
|
|
598
|
-
keepEditing: "继续编辑",
|
|
599
|
-
discard: "丢弃修改并继续",
|
|
600
|
-
jsonPending: "JSON 尚未应用。请先校验并应用,或撤销 JSON 修改后继续属性编辑与保存。",
|
|
601
|
-
fieldsSection: "字段",
|
|
602
|
-
templateSection: "模板",
|
|
603
|
-
advancedSection: "高级",
|
|
604
|
-
sectionsLabel: "模板设置分区",
|
|
605
|
-
columnDirectory: "字段目录",
|
|
606
|
-
columnProperties: "字段属性",
|
|
607
|
-
selectColumn: "选择字段",
|
|
608
|
-
clearSearch: "清除搜索",
|
|
609
|
-
fieldsCount: "个字段",
|
|
610
|
-
templateDetails: "模板信息",
|
|
611
|
-
advancedTitle: "完整配置",
|
|
612
|
-
advancedDescription: "用于批量迁移或配置复杂模板。应用前会校验;未应用的内容会受到草稿保护。",
|
|
613
|
-
templateIdentity: "模板标识",
|
|
614
|
-
templateRevision: "当前修订",
|
|
615
|
-
readonly: "只读",
|
|
616
|
-
ready: "可编辑",
|
|
617
|
-
previewTitle: "实时预览",
|
|
618
|
-
contentGroup: "内容",
|
|
619
|
-
formatGroup: "格式",
|
|
620
|
-
autoShort: "自动",
|
|
621
|
-
previousColumn: "上一字段",
|
|
622
|
-
nextColumn: "下一字段",
|
|
623
|
-
closeDirectory: "关闭字段目录",
|
|
624
|
-
technicalDetails: "标识与修订",
|
|
625
|
-
fieldPosition: "当前字段",
|
|
626
|
-
previewFieldDirectory: "定位字段"
|
|
627
|
-
}, Pe = {
|
|
628
|
-
fitWidth: "适宽",
|
|
629
|
-
fitPage: "适页",
|
|
630
|
-
fitSelection: "选区",
|
|
631
|
-
wideNavigation: "宽表导航",
|
|
632
|
-
alignSelection: "对齐选区",
|
|
633
|
-
leftEdges: "左对齐",
|
|
634
|
-
centers: "水平居中",
|
|
635
|
-
rightEdges: "右对齐",
|
|
636
|
-
topEdges: "顶对齐",
|
|
637
|
-
middles: "垂直居中",
|
|
638
|
-
bottomEdges: "底对齐",
|
|
639
|
-
horizontalSpacing: "水平等距",
|
|
640
|
-
verticalSpacing: "垂直等距",
|
|
641
|
-
lockSelection: "锁定位置",
|
|
642
|
-
unlockSelection: "解锁位置",
|
|
643
|
-
sessionLock: "位置锁定仅当前设计会话有效。",
|
|
644
|
-
toolsPending: "工具中还有未应用的配置,请先应用或恢复后再保存模板。",
|
|
645
|
-
...ln,
|
|
646
|
-
...on
|
|
647
|
-
}, sn = { class: "mr-canvas" }, rn = { class: "mr-canvas-heading" }, dn = { class: "mr-canvas-sheet-info" }, un = ["title"], cn = ["title"], mn = { class: "mr-canvas-gesture-hint" }, vn = { class: "mr-canvas-toolbar" }, pn = { class: "mr-canvas-view-tools" }, gn = ["aria-pressed"], hn = ["disabled"], fn = ["value", "aria-label"], bn = ["value"], yn = ["width", "aria-label"], wn = ["transform"], Mn = {
|
|
648
|
-
x: "3",
|
|
649
|
-
y: "9"
|
|
650
|
-
}, kn = ["height"], xn = ["transform"], Cn = {
|
|
651
|
-
x: "3",
|
|
652
|
-
y: "10"
|
|
653
|
-
}, $n = ["data-canvas-component", "aria-label", "aria-pressed", "tabindex", "onFocus", "onPointerdown", "onClick", "onKeydown"], Sn = { class: "mr-canvas-table" }, _n = {
|
|
654
|
-
key: 1,
|
|
655
|
-
class: "mr-canvas-table-row is-header"
|
|
656
|
-
}, In = ["onPointerdown"], En = {
|
|
657
|
-
key: 2,
|
|
658
|
-
class: "mr-canvas-placeholder"
|
|
659
|
-
}, Pn = ["aria-label", "onPointerdown"], Rn = {
|
|
660
|
-
key: 1,
|
|
661
|
-
class: "mr-canvas-static-grid"
|
|
662
|
-
}, Tn = {
|
|
663
|
-
key: 0,
|
|
664
|
-
class: "mr-canvas-grid-limit"
|
|
665
|
-
}, Ln = ["title"], Dn = { key: 0 }, An = ["src"], Hn = ["title"], Fn = ["aria-label", "onPointerdown"], Nn = {
|
|
666
|
-
key: 0,
|
|
667
|
-
class: "mr-canvas-navigator"
|
|
668
|
-
}, Gn = ["value", "aria-label"], On = /* @__PURE__ */ Ce({
|
|
669
|
-
__name: "TemplateDesignCanvas",
|
|
670
|
-
props: {
|
|
671
|
-
document: {},
|
|
672
|
-
selection: {},
|
|
673
|
-
selections: {},
|
|
674
|
-
locked: { type: Function },
|
|
675
|
-
activeColumnIndex: {},
|
|
676
|
-
pageIndex: {},
|
|
677
|
-
datasets: {},
|
|
678
|
-
disabled: { type: Boolean },
|
|
679
|
-
geometryDisabled: { type: Boolean },
|
|
680
|
-
messages: {}
|
|
681
|
-
},
|
|
682
|
-
emits: ["select", "geometry", "column", "width"],
|
|
683
|
-
setup(t, { emit: d }) {
|
|
684
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), { viewport: s, zoom: v, scale: M, page: f, wide: p, fraction: k, fit: E, setZoom: S, sync: I, navigate: w } = Yt({ get document() {
|
|
685
|
-
return o.document;
|
|
686
|
-
}, get pageIndex() {
|
|
687
|
-
return o.pageIndex;
|
|
688
|
-
}, get selection() {
|
|
689
|
-
return o.selection;
|
|
690
|
-
}, get columnIndex() {
|
|
691
|
-
return o.activeColumnIndex;
|
|
692
|
-
} }), g = D(() => o.disabled === !0 || o.geometryDisabled === !0 || !!f.value.flow), $ = D(() => f.value.components.map((_) => _.kind === "list" ? Vt(_, o.datasets?.[_.dataset] ?? [], f.value.flow || _.cardinality === "record" ? 1 : 3) : [])), u = D(() => f.value.components.map((_) => Xt(_, o.document, o.datasets))), y = W(!0), x = D(() => ht(f.value.widthMm, M.value)), C = D(() => ht(f.value.heightMm, M.value));
|
|
693
|
-
function P(_, R, T) {
|
|
694
|
-
return { width: `${R * M.value}px`, opacity: T ? 0.35 : 1, textAlign: _.style?.align, paddingLeft: _.indentMm ? `${_.indentMm * M.value}px` : void 0, color: _.style?.color, backgroundColor: _.style?.backgroundColor, fontWeight: _.style?.bold ? "700" : "400", fontSize: `${We(_.style).fontSizePx * v.value}px` };
|
|
695
|
-
}
|
|
696
|
-
function L(_) {
|
|
697
|
-
return o.locked?.({ pageIndex: o.pageIndex, componentIndex: _ }) === !0;
|
|
698
|
-
}
|
|
699
|
-
function F(_, R) {
|
|
700
|
-
i("select", { pageIndex: o.pageIndex, componentIndex: R, additive: _.ctrlKey || _.metaKey || _.shiftKey }), !_.ctrlKey && !_.metaKey && !_.shiftKey && !L(R) && G.start(_, f.value.components[R]);
|
|
701
|
-
}
|
|
702
|
-
const G = an({
|
|
703
|
-
scale: M,
|
|
704
|
-
page: () => f.value,
|
|
705
|
-
disabled: () => g.value,
|
|
706
|
-
commit: (_) => i("geometry", _)
|
|
707
|
-
});
|
|
708
|
-
function j(_) {
|
|
709
|
-
return (o.selections ?? (o.selection ? [o.selection] : [])).some((R) => R.pageIndex === o.pageIndex && R.componentIndex === _);
|
|
710
|
-
}
|
|
711
|
-
function te(_) {
|
|
712
|
-
const R = f.value.components[_], T = R.kind === "list" ? R.id : R.nid, z = f.value.flow?.bands.find((J) => J.componentIds.includes(T ?? "")), N = z && R.kind === "list" ? z.topMm + z.heightMm - R.topMm : Ke(R);
|
|
713
|
-
return {
|
|
714
|
-
left: `${R.leftMm * M.value}px`,
|
|
715
|
-
top: `${R.topMm * M.value}px`,
|
|
716
|
-
width: `${R.widthMm * M.value}px`,
|
|
717
|
-
height: `${N * M.value}px`
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
function se(_, R) {
|
|
721
|
-
const T = f.value.components[R];
|
|
722
|
-
if (g.value || L(R) || !j(R)) return;
|
|
723
|
-
const z = {
|
|
724
|
-
ArrowLeft: [-1, 0],
|
|
725
|
-
ArrowRight: [1, 0],
|
|
726
|
-
ArrowUp: [0, -1],
|
|
727
|
-
ArrowDown: [0, 1]
|
|
728
|
-
}, N = z[_.key];
|
|
729
|
-
if (!N) return;
|
|
730
|
-
_.preventDefault(), _.stopPropagation();
|
|
731
|
-
const J = ke(T), ie = _.shiftKey ? 5 : 0.5;
|
|
732
|
-
J.leftMm += N[0] * ie, J.topMm += N[1] * ie, i("geometry", J);
|
|
733
|
-
}
|
|
734
|
-
function r(_) {
|
|
735
|
-
let R = 0;
|
|
736
|
-
return _.columns.map((T) => (R += T.widthMm, R));
|
|
737
|
-
}
|
|
738
|
-
function O(_) {
|
|
739
|
-
return _.grid ? Ee(
|
|
740
|
-
_.grid,
|
|
741
|
-
_.widthMm,
|
|
742
|
-
_.heightMm
|
|
743
|
-
).cells.slice(0, 2e3) : [];
|
|
744
|
-
}
|
|
745
|
-
function V(_) {
|
|
746
|
-
return _.headerGrid ? Ee(
|
|
747
|
-
_.headerGrid,
|
|
748
|
-
_.widthMm,
|
|
749
|
-
_.headerGrid.rowHeightsMm?.reduce(
|
|
750
|
-
(R, T) => R + T,
|
|
751
|
-
0
|
|
752
|
-
) ?? _.headerGrid.cells.length * 8
|
|
753
|
-
).cells : [];
|
|
754
|
-
}
|
|
755
|
-
let B;
|
|
756
|
-
le(
|
|
757
|
-
() => g.value,
|
|
758
|
-
(_) => {
|
|
759
|
-
_ && B?.();
|
|
760
|
-
}
|
|
761
|
-
), le(
|
|
762
|
-
() => o.document,
|
|
763
|
-
() => B?.()
|
|
764
|
-
), He(() => B?.());
|
|
765
|
-
function Q(_, R, T) {
|
|
766
|
-
if (g.value || _.button !== 0) return;
|
|
767
|
-
_.preventDefault(), _.stopPropagation(), B?.();
|
|
768
|
-
const z = _.clientX, N = R.columns[T].widthMm;
|
|
769
|
-
let J = N;
|
|
770
|
-
const ie = _.currentTarget, ne = (ge) => {
|
|
771
|
-
J = Math.max(
|
|
772
|
-
2,
|
|
773
|
-
Math.round((N + (ge.clientX - z) / M.value) * 2) / 2
|
|
774
|
-
), ie.style.transform = `translateX(${(J - N) * M.value}px)`;
|
|
775
|
-
}, fe = () => {
|
|
776
|
-
window.removeEventListener("pointermove", ne), window.removeEventListener("pointerup", me), window.removeEventListener("pointercancel", pe), window.removeEventListener("keydown", oe), ie.style.transform = "", B = void 0;
|
|
777
|
-
}, me = () => {
|
|
778
|
-
fe(), J !== N && i("width", T, J);
|
|
779
|
-
}, pe = () => fe(), oe = (ge) => {
|
|
780
|
-
ge.key === "Escape" && (ge.preventDefault(), pe());
|
|
781
|
-
};
|
|
782
|
-
window.addEventListener("pointermove", ne), window.addEventListener("pointerup", me), window.addEventListener("pointercancel", pe), window.addEventListener("keydown", oe), B = pe;
|
|
783
|
-
}
|
|
784
|
-
return (_, R) => (m(), h("div", sn, [
|
|
785
|
-
n("div", rn, [
|
|
786
|
-
n("div", dn, [
|
|
787
|
-
n("strong", {
|
|
788
|
-
title: e(ot)(e(f), t.pageIndex, a.value.page)
|
|
789
|
-
}, l(e(ot)(e(f), t.pageIndex, a.value.page)), 9, un),
|
|
790
|
-
n("span", null, l(e(f).widthMm) + " × " + l(e(f).heightMm) + " mm", 1),
|
|
791
|
-
t.document.template.repeat ? (m(), h("small", {
|
|
792
|
-
key: 0,
|
|
793
|
-
title: t.document.template.repeat.dataset
|
|
794
|
-
}, l(a.value.designSample) + " · " + l(t.document.template.repeat.dataset), 9, cn)) : A("", !0)
|
|
795
|
-
]),
|
|
796
|
-
n("span", mn, l(a.value.canvasHint), 1),
|
|
797
|
-
n("div", vn, [
|
|
798
|
-
n("nav", pn, [
|
|
799
|
-
n("button", {
|
|
800
|
-
type: "button",
|
|
801
|
-
"aria-pressed": y.value,
|
|
802
|
-
onClick: R[0] || (R[0] = (T) => y.value = !y.value)
|
|
803
|
-
}, l(a.value.rulerToggle), 9, gn),
|
|
804
|
-
n("button", {
|
|
805
|
-
type: "button",
|
|
806
|
-
onClick: R[1] || (R[1] = (T) => e(E)("width"))
|
|
807
|
-
}, l(a.value.fitWidth), 1),
|
|
808
|
-
n("button", {
|
|
809
|
-
type: "button",
|
|
810
|
-
onClick: R[2] || (R[2] = (T) => e(E)("page"))
|
|
811
|
-
}, l(a.value.fitPage), 1),
|
|
812
|
-
n("button", {
|
|
813
|
-
type: "button",
|
|
814
|
-
disabled: !t.selection,
|
|
815
|
-
onClick: R[3] || (R[3] = (T) => e(E)("selection"))
|
|
816
|
-
}, l(a.value.fitSelection), 9, hn)
|
|
817
|
-
]),
|
|
818
|
-
n("label", null, [
|
|
819
|
-
H(l(a.value.zoom), 1),
|
|
820
|
-
n("select", {
|
|
821
|
-
value: e(v),
|
|
822
|
-
"aria-label": a.value.zoom,
|
|
823
|
-
onChange: R[4] || (R[4] = (T) => e(S)(Number(T.target.value)))
|
|
824
|
-
}, [
|
|
825
|
-
[0.5, 0.8, 1, 1.25].includes(e(v)) ? A("", !0) : (m(), h("option", {
|
|
826
|
-
key: 0,
|
|
827
|
-
value: e(v)
|
|
828
|
-
}, l(Math.round(e(v) * 100)) + "%", 9, bn)),
|
|
829
|
-
R[7] || (R[7] = n("option", { value: 0.5 }, "50%", -1)),
|
|
830
|
-
R[8] || (R[8] = n("option", { value: 0.8 }, "80%", -1)),
|
|
831
|
-
R[9] || (R[9] = n("option", { value: 1 }, "100%", -1)),
|
|
832
|
-
R[10] || (R[10] = n("option", { value: 1.25 }, "125%", -1))
|
|
833
|
-
], 40, fn)
|
|
834
|
-
])
|
|
835
|
-
])
|
|
836
|
-
]),
|
|
837
|
-
n("div", {
|
|
838
|
-
ref_key: "viewport",
|
|
839
|
-
ref: s,
|
|
840
|
-
class: "mr-canvas-scroll",
|
|
841
|
-
onScrollPassive: R[5] || (R[5] = //@ts-ignore
|
|
842
|
-
(...T) => e(I) && e(I)(...T))
|
|
843
|
-
}, [
|
|
844
|
-
n("div", {
|
|
845
|
-
class: "mr-canvas-paper",
|
|
846
|
-
style: xe({
|
|
847
|
-
width: `${e(f).widthMm * e(M)}px`,
|
|
848
|
-
height: `${e(f).heightMm * e(M)}px`
|
|
849
|
-
})
|
|
850
|
-
}, [
|
|
851
|
-
y.value ? (m(), h("svg", {
|
|
852
|
-
key: 0,
|
|
853
|
-
class: "mr-canvas-ruler is-horizontal",
|
|
854
|
-
width: e(f).widthMm * e(M),
|
|
855
|
-
height: "17",
|
|
856
|
-
"aria-label": a.value.rulerLabel,
|
|
857
|
-
role: "img"
|
|
858
|
-
}, [
|
|
859
|
-
(m(!0), h(K, null, ee(x.value, (T) => (m(), h("g", {
|
|
860
|
-
key: T.mm,
|
|
861
|
-
transform: `translate(${T.position}, 0)`
|
|
862
|
-
}, [
|
|
863
|
-
R[11] || (R[11] = n("line", {
|
|
864
|
-
y1: "12",
|
|
865
|
-
y2: "17"
|
|
866
|
-
}, null, -1)),
|
|
867
|
-
n("text", Mn, l(T.mm), 1)
|
|
868
|
-
], 8, wn))), 128))
|
|
869
|
-
], 8, yn)) : A("", !0),
|
|
870
|
-
y.value ? (m(), h("svg", {
|
|
871
|
-
key: 1,
|
|
872
|
-
class: "mr-canvas-ruler is-vertical",
|
|
873
|
-
width: "17",
|
|
874
|
-
height: e(f).heightMm * e(M),
|
|
875
|
-
"aria-hidden": "true"
|
|
876
|
-
}, [
|
|
877
|
-
(m(!0), h(K, null, ee(C.value, (T) => (m(), h("g", {
|
|
878
|
-
key: T.mm,
|
|
879
|
-
transform: `translate(0, ${T.position})`
|
|
880
|
-
}, [
|
|
881
|
-
R[12] || (R[12] = n("line", {
|
|
882
|
-
x1: "12",
|
|
883
|
-
x2: "17"
|
|
884
|
-
}, null, -1)),
|
|
885
|
-
n("text", Cn, l(T.mm), 1)
|
|
886
|
-
], 8, xn))), 128))
|
|
887
|
-
], 8, kn)) : A("", !0),
|
|
888
|
-
(m(!0), h(K, null, ee(e(f).components, (T, z) => (m(), h("div", {
|
|
889
|
-
key: z,
|
|
890
|
-
class: Te(["mr-canvas-component", { "is-selected": j(z), "is-locked": L(z) }]),
|
|
891
|
-
"data-canvas-component": z,
|
|
892
|
-
style: xe(te(z)),
|
|
893
|
-
role: "button",
|
|
894
|
-
"aria-label": `${a.value.component} ${z + 1} ${T.kind}`,
|
|
895
|
-
"aria-pressed": j(z),
|
|
896
|
-
tabindex: j(z) ? 0 : -1,
|
|
897
|
-
onFocus: (N) => !j(z) && i("select", { pageIndex: t.pageIndex, componentIndex: z }),
|
|
898
|
-
onPointerdown: (N) => F(N, z),
|
|
899
|
-
onClick: (N) => N.detail === 0 && !j(z) && i("select", { pageIndex: t.pageIndex, componentIndex: z }),
|
|
900
|
-
onKeydown: (N) => se(N, z)
|
|
901
|
-
}, [
|
|
902
|
-
T.kind === "list" ? (m(), h(K, { key: 0 }, [
|
|
903
|
-
n("div", Sn, [
|
|
904
|
-
T.header !== !1 && T.headerGrid ? (m(), h("div", {
|
|
905
|
-
key: 0,
|
|
906
|
-
class: "mr-canvas-merged",
|
|
907
|
-
style: xe({
|
|
908
|
-
height: `${(T.headerGrid.rowHeightsMm?.reduce((N, J) => N + J, 0) ?? T.headerGrid.cells.length * 8) * e(M)}px`
|
|
909
|
-
})
|
|
910
|
-
}, [
|
|
911
|
-
(m(!0), h(K, null, ee(V(T), (N, J) => (m(), h("div", {
|
|
912
|
-
key: J,
|
|
913
|
-
style: xe({
|
|
914
|
-
left: `${N.xMm * e(M)}px`,
|
|
915
|
-
top: `${N.yMm * e(M)}px`,
|
|
916
|
-
width: `${N.widthMm * e(M)}px`,
|
|
917
|
-
height: `${N.heightMm * e(M)}px`,
|
|
918
|
-
textAlign: N.cell.style?.align ?? "center"
|
|
919
|
-
})
|
|
920
|
-
}, l(N.cell.text), 5))), 128))
|
|
921
|
-
], 4)) : T.header !== !1 ? (m(), h("div", _n, [
|
|
922
|
-
(m(!0), h(K, null, ee(T.columns, (N, J) => (m(), h("div", {
|
|
923
|
-
key: J,
|
|
924
|
-
style: xe(P({ text: N.header, style: e(zt)(T, N) }, N.widthMm, N.hidden)),
|
|
925
|
-
onPointerdown: wt((ie) => {
|
|
926
|
-
i("select", { pageIndex: t.pageIndex, componentIndex: z }), i("column", J);
|
|
927
|
-
}, ["stop"])
|
|
928
|
-
}, l(N.header), 45, In))), 128))
|
|
929
|
-
])) : A("", !0),
|
|
930
|
-
(m(!0), h(K, null, ee($.value[z], (N, J) => (m(), h("div", {
|
|
931
|
-
key: J,
|
|
932
|
-
class: "mr-canvas-table-row"
|
|
933
|
-
}, [
|
|
934
|
-
(m(!0), h(K, null, ee(T.columns, (ie, ne) => (m(), h("div", {
|
|
935
|
-
key: ne,
|
|
936
|
-
style: xe(P(N[ne], ie.widthMm, ie.hidden))
|
|
937
|
-
}, l(N[ne].text), 5))), 128))
|
|
938
|
-
]))), 128)),
|
|
939
|
-
$.value[z]?.length ? A("", !0) : (m(), h("div", En, l(T.dataset) + " · " + l(T.tree && t.datasets?.[T.dataset]?.length ? a.value.treeSampleHint : a.value.sampleRows), 1))
|
|
940
|
-
]),
|
|
941
|
-
j(z) && !g.value && !L(z) ? (m(!0), h(K, { key: 0 }, ee(r(T), (N, J) => (m(), h("span", {
|
|
942
|
-
key: J,
|
|
943
|
-
class: "mr-canvas-column-handle",
|
|
944
|
-
"aria-label": `${a.value.resizeColumn} ${T.columns[J]?.header}`,
|
|
945
|
-
role: "separator",
|
|
946
|
-
"aria-orientation": "vertical",
|
|
947
|
-
style: xe({ left: `${N * e(M)}px` }),
|
|
948
|
-
onPointerdown: (ie) => Q(ie, T, J)
|
|
949
|
-
}, null, 44, Pn))), 128)) : A("", !0)
|
|
950
|
-
], 64)) : T.grid ? (m(), h("div", Rn, [
|
|
951
|
-
(m(!0), h(K, null, ee(O(T), (N, J) => (m(), h("div", {
|
|
952
|
-
key: J,
|
|
953
|
-
style: xe({
|
|
954
|
-
left: `${N.xMm * e(M)}px`,
|
|
955
|
-
top: `${N.yMm * e(M)}px`,
|
|
956
|
-
width: `${N.widthMm * e(M)}px`,
|
|
957
|
-
height: `${N.heightMm * e(M)}px`,
|
|
958
|
-
backgroundColor: N.cell.style?.backgroundColor,
|
|
959
|
-
color: N.cell.style?.color,
|
|
960
|
-
fontWeight: N.cell.style?.bold ? "700" : "400",
|
|
961
|
-
fontSize: `${e(We)(N.cell.style).fontSizePx * e(v)}px`,
|
|
962
|
-
textAlign: N.cell.style?.align ?? "left"
|
|
963
|
-
})
|
|
964
|
-
}, l(N.cell.text), 5))), 128)),
|
|
965
|
-
T.grid.cells.reduce((N, J) => N + J.length, 0) > 2e3 ? (m(), h("span", Tn, l(a.value.canvasGridLimited), 1)) : A("", !0)
|
|
966
|
-
])) : (T.kind === "barcode" || T.kind === "qrcode") && !u.value[z]?.image ? (m(), h("div", {
|
|
967
|
-
key: 2,
|
|
968
|
-
class: Te(["mr-canvas-code", { "is-error": u.value[z]?.error }]),
|
|
969
|
-
title: u.value[z]?.error ?? a.value.codePreviewHint
|
|
970
|
-
}, [
|
|
971
|
-
R[13] || (R[13] = n("svg", {
|
|
972
|
-
viewBox: "0 0 32 24",
|
|
973
|
-
"aria-hidden": "true"
|
|
974
|
-
}, [
|
|
975
|
-
n("rect", {
|
|
976
|
-
x: "3",
|
|
977
|
-
y: "3",
|
|
978
|
-
width: "26",
|
|
979
|
-
height: "18",
|
|
980
|
-
rx: "2"
|
|
981
|
-
}),
|
|
982
|
-
n("path", { d: "M10 8 6 12l4 4m12-8 4 4-4 4m-8 2 4-12" })
|
|
983
|
-
], -1)),
|
|
984
|
-
n("strong", null, l(T.kind === "qrcode" ? a.value.insertQrcode : (T.code?.symbology ?? "code128").toUpperCase()), 1),
|
|
985
|
-
n("span", null, l(u.value[z]?.text || a.value.codePlaceholder), 1),
|
|
986
|
-
u.value[z]?.bound ? (m(), h("small", Dn, l(T.binding?.field), 1)) : A("", !0)
|
|
987
|
-
], 10, Ln)) : u.value[z]?.image ? (m(), h("img", {
|
|
988
|
-
key: 3,
|
|
989
|
-
src: u.value[z]?.image,
|
|
990
|
-
alt: "",
|
|
991
|
-
draggable: "false"
|
|
992
|
-
}, null, 8, An)) : (m(), h("div", {
|
|
993
|
-
key: 4,
|
|
994
|
-
class: Te(["mr-canvas-content", { "is-binding-error": u.value[z]?.error, "is-bound-image": T.kind === "image" && T.binding }]),
|
|
995
|
-
title: u.value[z]?.error === "image-binding" ? a.value.bindingImageHint : u.value[z]?.error,
|
|
996
|
-
style: xe({
|
|
997
|
-
color: T.style?.color,
|
|
998
|
-
backgroundColor: T.style?.backgroundColor,
|
|
999
|
-
fontWeight: T.style?.bold ? "700" : "400",
|
|
1000
|
-
fontSize: `${e(We)(T.style).fontSizePx * e(v)}px`,
|
|
1001
|
-
textAlign: T.style?.align,
|
|
1002
|
-
justifyContent: T.style?.verticalAlign === "bottom" ? "flex-end" : T.style?.verticalAlign === "middle" ? "center" : "flex-start"
|
|
1003
|
-
})
|
|
1004
|
-
}, l(u.value[z]?.text || (T.kind === "rect" ? "" : T.kind === "image" && T.binding ? a.value.boundImagePlaceholder : "")), 15, Hn)),
|
|
1005
|
-
j(z) && !g.value && !L(z) ? (m(), h("span", {
|
|
1006
|
-
key: 5,
|
|
1007
|
-
class: "mr-canvas-resize",
|
|
1008
|
-
"aria-label": a.value.resizeComponent,
|
|
1009
|
-
role: "separator",
|
|
1010
|
-
onPointerdown: (N) => e(G).start(N, T, !0)
|
|
1011
|
-
}, null, 40, Fn)) : A("", !0)
|
|
1012
|
-
], 46, $n))), 128))
|
|
1013
|
-
], 4)
|
|
1014
|
-
], 544),
|
|
1015
|
-
e(p) ? (m(), h("footer", Nn, [
|
|
1016
|
-
n("span", null, l(a.value.wideNavigation), 1),
|
|
1017
|
-
n("input", {
|
|
1018
|
-
type: "range",
|
|
1019
|
-
min: "0",
|
|
1020
|
-
max: "100",
|
|
1021
|
-
value: e(k),
|
|
1022
|
-
"aria-label": a.value.wideNavigation,
|
|
1023
|
-
onInput: R[6] || (R[6] = (T) => e(w)(Number(T.target.value)))
|
|
1024
|
-
}, null, 40, Gn),
|
|
1025
|
-
n("span", null, l(e(k)) + "%", 1)
|
|
1026
|
-
])) : A("", !0)
|
|
1027
|
-
]));
|
|
1028
|
-
}
|
|
1029
|
-
}), Bn = /* @__PURE__ */ $e(On, [["__scopeId", "data-v-c512529e"]]), zn = { class: "mr-component-binding" }, jn = ["value", "disabled"], Vn = { value: "static" }, Wn = ["disabled"], Un = {
|
|
1030
|
-
key: 0,
|
|
1031
|
-
class: "mr-binding-hint"
|
|
1032
|
-
}, Kn = ["value", "disabled"], Jn = ["value"], qn = {
|
|
1033
|
-
key: 0,
|
|
1034
|
-
class: "mr-binding-grid"
|
|
1035
|
-
}, Yn = ["value", "disabled"], Xn = { value: "natural" }, Zn = { value: "number" }, Qn = { value: "percent" }, ea = { value: "date" }, ta = { key: 0 }, na = ["value", "disabled"], aa = { key: 1 }, la = ["value", "disabled"], oa = { key: 1 }, ia = { class: "mr-binding-grid" }, sa = ["value", "disabled"], ra = ["value", "disabled"], da = ["value", "disabled"], ua = { class: "mr-binding-hint" }, ca = /* @__PURE__ */ Ce({
|
|
1036
|
-
__name: "ComponentDataBinding",
|
|
1037
|
-
props: {
|
|
1038
|
-
component: {},
|
|
1039
|
-
repeat: {},
|
|
1040
|
-
schema: {},
|
|
1041
|
-
disabled: { type: Boolean },
|
|
1042
|
-
messages: {}
|
|
1043
|
-
},
|
|
1044
|
-
emits: ["change"],
|
|
1045
|
-
setup(t, { emit: d }) {
|
|
1046
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), s = D(() => o.component.binding), v = `mr-component-fields-${st()?.uid ?? 0}`;
|
|
1047
|
-
function M(S) {
|
|
1048
|
-
return S.target.value;
|
|
1049
|
-
}
|
|
1050
|
-
function f(S) {
|
|
1051
|
-
!o.disabled && s.value && i("change", { ...s.value, ...S });
|
|
1052
|
-
}
|
|
1053
|
-
function p(S) {
|
|
1054
|
-
o.disabled || (M(S) === "static" ? i("change", void 0) : o.repeat && i("change", { field: o.schema?.fields[0]?.field ?? "value" }));
|
|
1055
|
-
}
|
|
1056
|
-
function k(S) {
|
|
1057
|
-
if (!s.value || o.disabled) return;
|
|
1058
|
-
const I = { ...s.value }, w = M(S);
|
|
1059
|
-
w === "natural" ? delete I.format : I.format = w === "date" ? { kind: "date", pattern: "YYYY-MM-DD" } : { kind: w, digits: 2 }, i("change", I);
|
|
1060
|
-
}
|
|
1061
|
-
function E(S) {
|
|
1062
|
-
const I = M(S), w = s.value?.format;
|
|
1063
|
-
I.trim() && w && w.kind !== "date" && f({ format: { ...w, digits: Number(I) } });
|
|
1064
|
-
}
|
|
1065
|
-
return (S, I) => (m(), h("div", zn, [
|
|
1066
|
-
n("h3", null, l(a.value.dataBinding), 1),
|
|
1067
|
-
n("label", null, [
|
|
1068
|
-
H(l(a.value.contentSource), 1),
|
|
1069
|
-
n("select", {
|
|
1070
|
-
value: s.value ? "field" : "static",
|
|
1071
|
-
disabled: t.disabled,
|
|
1072
|
-
onChange: p
|
|
1073
|
-
}, [
|
|
1074
|
-
n("option", Vn, l(a.value.staticContent), 1),
|
|
1075
|
-
n("option", {
|
|
1076
|
-
value: "field",
|
|
1077
|
-
disabled: !t.repeat
|
|
1078
|
-
}, l(a.value.recordField), 9, Wn)
|
|
1079
|
-
], 40, jn)
|
|
1080
|
-
]),
|
|
1081
|
-
t.repeat ? A("", !0) : (m(), h("p", Un, l(a.value.bindingNeedsRepeat), 1)),
|
|
1082
|
-
s.value ? (m(), h(K, { key: 1 }, [
|
|
1083
|
-
n("label", null, [
|
|
1084
|
-
H(l(a.value.bindingField), 1),
|
|
1085
|
-
n("input", {
|
|
1086
|
-
value: s.value.field,
|
|
1087
|
-
list: v,
|
|
1088
|
-
disabled: t.disabled,
|
|
1089
|
-
onChange: I[0] || (I[0] = (w) => M(w).trim() && f({ field: M(w).trim() }))
|
|
1090
|
-
}, null, 40, Kn)
|
|
1091
|
-
]),
|
|
1092
|
-
n("datalist", { id: v }, [
|
|
1093
|
-
(m(!0), h(K, null, ee(t.schema?.fields ?? [], (w) => (m(), h("option", {
|
|
1094
|
-
key: w.field,
|
|
1095
|
-
value: w.field
|
|
1096
|
-
}, l(w.label), 9, Jn))), 128))
|
|
1097
|
-
]),
|
|
1098
|
-
t.component.kind === "text" ? (m(), h("div", qn, [
|
|
1099
|
-
n("label", null, [
|
|
1100
|
-
H(l(a.value.valueFormat), 1),
|
|
1101
|
-
n("select", {
|
|
1102
|
-
value: s.value.format?.kind ?? "natural",
|
|
1103
|
-
disabled: t.disabled,
|
|
1104
|
-
onChange: k
|
|
1105
|
-
}, [
|
|
1106
|
-
n("option", Xn, l(a.value.naturalFormat), 1),
|
|
1107
|
-
n("option", Zn, l(a.value.numberFormat), 1),
|
|
1108
|
-
n("option", Qn, l(a.value.percentFormat), 1),
|
|
1109
|
-
n("option", ea, l(a.value.dateFormat), 1)
|
|
1110
|
-
], 40, Yn)
|
|
1111
|
-
]),
|
|
1112
|
-
s.value.format && s.value.format.kind !== "date" ? (m(), h("label", ta, [
|
|
1113
|
-
H(l(a.value.decimalPlaces), 1),
|
|
1114
|
-
n("input", {
|
|
1115
|
-
type: "number",
|
|
1116
|
-
min: "0",
|
|
1117
|
-
max: "100",
|
|
1118
|
-
step: "1",
|
|
1119
|
-
value: s.value.format.digits ?? 2,
|
|
1120
|
-
disabled: t.disabled,
|
|
1121
|
-
onChange: E
|
|
1122
|
-
}, null, 40, na)
|
|
1123
|
-
])) : s.value.format?.kind === "date" ? (m(), h("label", aa, [
|
|
1124
|
-
H(l(a.value.datePattern), 1),
|
|
1125
|
-
n("input", {
|
|
1126
|
-
value: s.value.format.pattern ?? "YYYY-MM-DD",
|
|
1127
|
-
disabled: t.disabled,
|
|
1128
|
-
onChange: I[1] || (I[1] = (w) => f({ format: { kind: "date", pattern: M(w) } }))
|
|
1129
|
-
}, null, 40, la)
|
|
1130
|
-
])) : A("", !0)
|
|
1131
|
-
])) : A("", !0),
|
|
1132
|
-
t.component.kind !== "image" ? (m(), h("details", oa, [
|
|
1133
|
-
n("summary", null, l(a.value.bindingDecoration), 1),
|
|
1134
|
-
n("div", ia, [
|
|
1135
|
-
n("label", null, [
|
|
1136
|
-
H(l(a.value.valuePrefix), 1),
|
|
1137
|
-
n("input", {
|
|
1138
|
-
value: s.value.prefix ?? "",
|
|
1139
|
-
disabled: t.disabled,
|
|
1140
|
-
onChange: I[2] || (I[2] = (w) => f({ prefix: M(w) }))
|
|
1141
|
-
}, null, 40, sa)
|
|
1142
|
-
]),
|
|
1143
|
-
n("label", null, [
|
|
1144
|
-
H(l(a.value.valueSuffix), 1),
|
|
1145
|
-
n("input", {
|
|
1146
|
-
value: s.value.suffix ?? "",
|
|
1147
|
-
disabled: t.disabled,
|
|
1148
|
-
onChange: I[3] || (I[3] = (w) => f({ suffix: M(w) }))
|
|
1149
|
-
}, null, 40, ra)
|
|
1150
|
-
])
|
|
1151
|
-
]),
|
|
1152
|
-
n("label", null, [
|
|
1153
|
-
H(l(a.value.emptyValueText), 1),
|
|
1154
|
-
n("input", {
|
|
1155
|
-
value: s.value.emptyText ?? "",
|
|
1156
|
-
disabled: t.disabled,
|
|
1157
|
-
onChange: I[4] || (I[4] = (w) => f({ emptyText: M(w) }))
|
|
1158
|
-
}, null, 40, da)
|
|
1159
|
-
])
|
|
1160
|
-
])) : A("", !0),
|
|
1161
|
-
n("p", ua, l(t.repeat?.dataset) + " · " + l(t.component.kind === "image" ? a.value.bindingImageHint : a.value.bindingRecordHint), 1)
|
|
1162
|
-
], 64)) : A("", !0)
|
|
1163
|
-
]));
|
|
1164
|
-
}
|
|
1165
|
-
}), ma = /* @__PURE__ */ $e(ca, [["__scopeId", "data-v-4be6f80e"]]), va = { class: "mr-code-properties" }, pa = { key: 0 }, ga = ["value", "disabled"], ha = { key: 1 }, fa = ["value", "disabled"], ba = { key: 2 }, ya = { class: "mr-code-grid" }, wa = { key: 0 }, Ma = ["value", "disabled"], ka = ["min", "value", "disabled"], xa = {
|
|
1166
|
-
key: 3,
|
|
1167
|
-
class: "mr-code-checkbox"
|
|
1168
|
-
}, Ca = ["checked", "disabled"], $a = /* @__PURE__ */ Ce({
|
|
1169
|
-
__name: "CodeComponentInspector",
|
|
1170
|
-
props: {
|
|
1171
|
-
component: {},
|
|
1172
|
-
disabled: { type: Boolean },
|
|
1173
|
-
messages: {}
|
|
1174
|
-
},
|
|
1175
|
-
emits: ["change"],
|
|
1176
|
-
setup(t, { emit: d }) {
|
|
1177
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), s = D(() => o.component.kind === "qrcode" ? 4 : o.component.code?.symbology?.startsWith("ean") ? 11 : 10);
|
|
1178
|
-
function v(p) {
|
|
1179
|
-
return p.target.value;
|
|
1180
|
-
}
|
|
1181
|
-
function M(p) {
|
|
1182
|
-
o.disabled || i("change", { ...o.component.code, ...p });
|
|
1183
|
-
}
|
|
1184
|
-
function f(p) {
|
|
1185
|
-
const k = v(p);
|
|
1186
|
-
M({ symbology: k, quietZoneModules: k.startsWith("ean") ? 11 : 10 });
|
|
1187
|
-
}
|
|
1188
|
-
return (p, k) => (m(), h("div", va, [
|
|
1189
|
-
n("h3", null, l(a.value.codeSettings), 1),
|
|
1190
|
-
t.component.binding ? A("", !0) : (m(), h("label", pa, [
|
|
1191
|
-
H(l(a.value.codeValue), 1),
|
|
1192
|
-
n("textarea", {
|
|
1193
|
-
rows: "2",
|
|
1194
|
-
value: t.component.code?.value ?? t.component.fallbackText ?? t.component.text ?? "",
|
|
1195
|
-
disabled: t.disabled,
|
|
1196
|
-
onChange: k[0] || (k[0] = (E) => M({ value: v(E) }))
|
|
1197
|
-
}, null, 40, ga)
|
|
1198
|
-
])),
|
|
1199
|
-
t.component.kind === "barcode" ? (m(), h("label", ha, [
|
|
1200
|
-
H(l(a.value.codeSymbology), 1),
|
|
1201
|
-
n("select", {
|
|
1202
|
-
value: t.component.code?.symbology ?? "code128",
|
|
1203
|
-
disabled: t.disabled,
|
|
1204
|
-
onChange: f
|
|
1205
|
-
}, [...k[4] || (k[4] = [
|
|
1206
|
-
n("option", { value: "code128" }, "Code 128", -1),
|
|
1207
|
-
n("option", { value: "code39" }, "Code 39", -1),
|
|
1208
|
-
n("option", { value: "ean13" }, "EAN-13", -1),
|
|
1209
|
-
n("option", { value: "ean8" }, "EAN-8", -1)
|
|
1210
|
-
])], 40, fa)
|
|
1211
|
-
])) : A("", !0),
|
|
1212
|
-
t.component.kind === "barcode" ? (m(), h("p", ba, l(t.component.code?.symbology?.startsWith("ean") ? a.value.eanContentHint : t.component.code?.symbology === "code39" ? a.value.code39ContentHint : a.value.code128ContentHint), 1)) : A("", !0),
|
|
1213
|
-
n("div", ya, [
|
|
1214
|
-
t.component.kind === "qrcode" ? (m(), h("label", wa, [
|
|
1215
|
-
H(l(a.value.codeCorrection), 1),
|
|
1216
|
-
n("select", {
|
|
1217
|
-
value: t.component.code?.errorCorrection ?? "M",
|
|
1218
|
-
disabled: t.disabled,
|
|
1219
|
-
onChange: k[1] || (k[1] = (E) => M({ errorCorrection: v(E) }))
|
|
1220
|
-
}, [...k[5] || (k[5] = [
|
|
1221
|
-
n("option", { value: "L" }, "L · 7%", -1),
|
|
1222
|
-
n("option", { value: "M" }, "M · 15%", -1),
|
|
1223
|
-
n("option", { value: "Q" }, "Q · 25%", -1),
|
|
1224
|
-
n("option", { value: "H" }, "H · 30%", -1)
|
|
1225
|
-
])], 40, Ma)
|
|
1226
|
-
])) : A("", !0),
|
|
1227
|
-
n("label", null, [
|
|
1228
|
-
H(l(a.value.codeQuietZone), 1),
|
|
1229
|
-
n("input", {
|
|
1230
|
-
type: "number",
|
|
1231
|
-
min: s.value,
|
|
1232
|
-
max: "64",
|
|
1233
|
-
step: "1",
|
|
1234
|
-
value: t.component.code?.quietZoneModules ?? s.value,
|
|
1235
|
-
disabled: t.disabled,
|
|
1236
|
-
onChange: k[2] || (k[2] = (E) => v(E).trim() && M({ quietZoneModules: Number(v(E)) }))
|
|
1237
|
-
}, null, 40, ka)
|
|
1238
|
-
])
|
|
1239
|
-
]),
|
|
1240
|
-
t.component.kind === "barcode" ? (m(), h("label", xa, [
|
|
1241
|
-
n("input", {
|
|
1242
|
-
type: "checkbox",
|
|
1243
|
-
checked: t.component.code?.showText === !0,
|
|
1244
|
-
disabled: t.disabled,
|
|
1245
|
-
onChange: k[3] || (k[3] = (E) => M({ showText: E.target.checked }))
|
|
1246
|
-
}, null, 40, Ca),
|
|
1247
|
-
H(l(a.value.codeShowText), 1)
|
|
1248
|
-
])) : A("", !0),
|
|
1249
|
-
n("p", null, l(a.value.codePreviewHint), 1)
|
|
1250
|
-
]));
|
|
1251
|
-
}
|
|
1252
|
-
}), Sa = /* @__PURE__ */ $e($a, [["__scopeId", "data-v-35d782cf"]]), _a = ["aria-label"], Ia = ["data-align", "aria-label", "title", "aria-checked", "tabindex", "onClick", "onKeydown"], Ea = { key: 0 }, Pa = {
|
|
1253
|
-
key: 1,
|
|
1254
|
-
viewBox: "0 0 20 20",
|
|
1255
|
-
fill: "none",
|
|
1256
|
-
"aria-hidden": "true"
|
|
1257
|
-
}, Ra = {
|
|
1258
|
-
key: 0,
|
|
1259
|
-
d: "M3 4h14M3 8h9M3 12h14M3 16h9"
|
|
1260
|
-
}, Ta = {
|
|
1261
|
-
key: 1,
|
|
1262
|
-
d: "M3 4h14M6 8h8M3 12h14M6 16h8"
|
|
1263
|
-
}, La = {
|
|
1264
|
-
key: 2,
|
|
1265
|
-
d: "M3 4h14M8 8h9M3 12h14M8 16h9"
|
|
1266
|
-
}, Da = {
|
|
1267
|
-
key: 3,
|
|
1268
|
-
d: "M3 4h14M3 8h14M3 12h14M3 16h14"
|
|
1269
|
-
}, Aa = /* @__PURE__ */ Ce({
|
|
1270
|
-
__name: "AlignmentControl",
|
|
1271
|
-
props: {
|
|
1272
|
-
modelValue: {},
|
|
1273
|
-
label: {},
|
|
1274
|
-
labels: {},
|
|
1275
|
-
autoLabel: {},
|
|
1276
|
-
allowAuto: { type: Boolean }
|
|
1277
|
-
},
|
|
1278
|
-
emits: ["update:modelValue"],
|
|
1279
|
-
setup(t, { emit: d }) {
|
|
1280
|
-
const o = t, i = d, a = () => o.allowAuto ? ["auto", "left", "center", "right", "justify"] : ["left", "center", "right", "justify"];
|
|
1281
|
-
async function s(v, M) {
|
|
1282
|
-
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(v.key)) return;
|
|
1283
|
-
v.preventDefault();
|
|
1284
|
-
const p = a(), k = p.indexOf(M), E = v.key === "Home" ? 0 : v.key === "End" ? p.length - 1 : (k + (v.key === "ArrowRight" ? 1 : -1) + p.length) % p.length;
|
|
1285
|
-
i("update:modelValue", p[E]);
|
|
1286
|
-
const S = v.currentTarget.parentElement;
|
|
1287
|
-
await ce(), S?.querySelector(`[data-align="${p[E]}"]`)?.focus();
|
|
1288
|
-
}
|
|
1289
|
-
return (v, M) => (m(), h("div", {
|
|
1290
|
-
class: "mr-designer-alignment",
|
|
1291
|
-
role: "radiogroup",
|
|
1292
|
-
"aria-label": t.label
|
|
1293
|
-
}, [
|
|
1294
|
-
(m(!0), h(K, null, ee(a(), (f) => (m(), h("button", {
|
|
1295
|
-
key: f,
|
|
1296
|
-
type: "button",
|
|
1297
|
-
role: "radio",
|
|
1298
|
-
"data-align": f,
|
|
1299
|
-
"aria-label": t.labels[f],
|
|
1300
|
-
title: t.labels[f],
|
|
1301
|
-
"aria-checked": t.modelValue === f,
|
|
1302
|
-
tabindex: t.modelValue === f ? 0 : -1,
|
|
1303
|
-
onClick: (p) => i("update:modelValue", f),
|
|
1304
|
-
onKeydown: (p) => s(p, f)
|
|
1305
|
-
}, [
|
|
1306
|
-
f === "auto" ? (m(), h("span", Ea, l(t.autoLabel), 1)) : (m(), h("svg", Pa, [
|
|
1307
|
-
f === "left" ? (m(), h("path", Ra)) : f === "center" ? (m(), h("path", Ta)) : f === "right" ? (m(), h("path", La)) : (m(), h("path", Da))
|
|
1308
|
-
]))
|
|
1309
|
-
], 40, Ia))), 128))
|
|
1310
|
-
], 8, _a));
|
|
1311
|
-
}
|
|
1312
|
-
}), it = /* @__PURE__ */ $e(Aa, [["__scopeId", "data-v-c85770c4"]]), Ha = ["disabled"], Fa = { class: "mr-component-dimensions" }, Na = ["min", "value", "disabled", "onChange"], Ga = { key: 0 }, Oa = ["value", "disabled"], Ba = { value: "" }, za = { value: "header" }, ja = { value: "footer" }, Va = { key: 2 }, Wa = ["value"], Ua = ["value"], Ka = { class: "mr-component-upload" }, Ja = ["aria-label"], qa = {
|
|
1313
|
-
key: 0,
|
|
1314
|
-
role: "alert"
|
|
1315
|
-
}, Ya = {
|
|
1316
|
-
key: 5,
|
|
1317
|
-
class: "mr-component-type"
|
|
1318
|
-
}, Xa = { class: "mr-component-dimensions" }, Za = ["value"], Qa = ["checked"], el = { class: "mr-component-dimensions" }, tl = ["value"], nl = ["value"], al = { key: 6 }, ll = ["value"], ol = /* @__PURE__ */ Ce({
|
|
1319
|
-
__name: "CanvasComponentInspector",
|
|
1320
|
-
props: {
|
|
1321
|
-
component: {},
|
|
1322
|
-
disabled: { type: Boolean },
|
|
1323
|
-
geometryDisabled: { type: Boolean },
|
|
1324
|
-
repeat: {},
|
|
1325
|
-
schema: {},
|
|
1326
|
-
messages: {}
|
|
1327
|
-
},
|
|
1328
|
-
emits: ["geometry", "patch"],
|
|
1329
|
-
setup(t, { emit: d }) {
|
|
1330
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), s = W(""), v = ["leftMm", "topMm", "widthMm", "heightMm"], M = D(() => [
|
|
1331
|
-
a.value.leftPosition,
|
|
1332
|
-
a.value.topPosition,
|
|
1333
|
-
a.value.componentWidth,
|
|
1334
|
-
a.value.componentHeight
|
|
1335
|
-
]);
|
|
1336
|
-
function f(I, w) {
|
|
1337
|
-
if (o.disabled || o.geometryDisabled) return;
|
|
1338
|
-
const g = Number(w.target.value);
|
|
1339
|
-
if (!Number.isFinite(g)) return;
|
|
1340
|
-
const $ = { ...ke(o.component), [I]: g };
|
|
1341
|
-
o.component.kind === "qrcode" && (I === "widthMm" || I === "heightMm") && ($.widthMm = $.heightMm = g), i("geometry", $);
|
|
1342
|
-
}
|
|
1343
|
-
function p(I, w) {
|
|
1344
|
-
if (o.component.kind === "list") return;
|
|
1345
|
-
const g = { ...o.component.style, [I]: w };
|
|
1346
|
-
I === "fontSize" && delete g.fontSizePx, i("patch", { style: g });
|
|
1347
|
-
}
|
|
1348
|
-
const k = D(() => ({
|
|
1349
|
-
auto: a.value.auto,
|
|
1350
|
-
left: a.value.left,
|
|
1351
|
-
center: a.value.center,
|
|
1352
|
-
right: a.value.right,
|
|
1353
|
-
justify: a.value.justify
|
|
1354
|
-
}));
|
|
1355
|
-
function E(I) {
|
|
1356
|
-
return I.target.value;
|
|
1357
|
-
}
|
|
1358
|
-
async function S(I) {
|
|
1359
|
-
const w = I.target, g = w.files?.[0];
|
|
1360
|
-
if (!g) return;
|
|
1361
|
-
s.value = "";
|
|
1362
|
-
const $ = o.component;
|
|
1363
|
-
try {
|
|
1364
|
-
if (g.size > 4 * 1024 * 1024 || !["image/png", "image/jpeg", "image/webp", "image/svg+xml"].includes(
|
|
1365
|
-
g.type
|
|
1366
|
-
))
|
|
1367
|
-
throw new Error(a.value.imageBudget);
|
|
1368
|
-
const u = new FileReader(), y = await new Promise((x, C) => {
|
|
1369
|
-
u.onload = () => x(String(u.result)), u.onerror = () => C(u.error), u.readAsDataURL(g);
|
|
1370
|
-
});
|
|
1371
|
-
!o.disabled && o.component === $ && i("patch", { imageData: y });
|
|
1372
|
-
} catch (u) {
|
|
1373
|
-
s.value = u instanceof Error ? u.message : String(u);
|
|
1374
|
-
} finally {
|
|
1375
|
-
w.value = "";
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
return (I, w) => (m(), h("fieldset", {
|
|
1379
|
-
class: "mr-component-properties",
|
|
1380
|
-
disabled: t.disabled
|
|
1381
|
-
}, [
|
|
1382
|
-
n("h3", null, l(a.value.positionGroup), 1),
|
|
1383
|
-
n("div", Fa, [
|
|
1384
|
-
(m(!0), h(K, null, ee(v.filter(
|
|
1385
|
-
(g) => t.component.kind !== "list" || g !== "heightMm"
|
|
1386
|
-
), (g, $) => (m(), h("label", { key: g }, [
|
|
1387
|
-
H(l(M.value[$]), 1),
|
|
1388
|
-
n("input", {
|
|
1389
|
-
type: "number",
|
|
1390
|
-
step: "0.5",
|
|
1391
|
-
min: g === "widthMm" || g === "heightMm" ? 2 : 0,
|
|
1392
|
-
value: e(ke)(t.component)[g],
|
|
1393
|
-
disabled: t.geometryDisabled,
|
|
1394
|
-
onChange: (u) => f(g, u)
|
|
1395
|
-
}, null, 40, Na)
|
|
1396
|
-
]))), 128))
|
|
1397
|
-
]),
|
|
1398
|
-
t.component.kind !== "list" && !t.repeat ? (m(), h("label", Ga, [
|
|
1399
|
-
H(l(a.value.repeatPage), 1),
|
|
1400
|
-
n("select", {
|
|
1401
|
-
value: t.component.pageAnchor ?? "",
|
|
1402
|
-
disabled: t.geometryDisabled,
|
|
1403
|
-
onChange: w[0] || (w[0] = (g) => i("patch", { pageAnchor: E(g) || void 0 }))
|
|
1404
|
-
}, [
|
|
1405
|
-
n("option", Ba, l(a.value.repeatNone), 1),
|
|
1406
|
-
n("option", za, l(a.value.repeatHeader), 1),
|
|
1407
|
-
n("option", ja, l(a.value.repeatFooter), 1)
|
|
1408
|
-
], 40, Oa)
|
|
1409
|
-
])) : A("", !0),
|
|
1410
|
-
n("h3", null, l(a.value.componentContent), 1),
|
|
1411
|
-
["text", "image", "barcode", "qrcode"].includes(t.component.kind) && t.component.kind !== "list" && !t.component.grid ? (m(), we(ma, {
|
|
1412
|
-
key: 1,
|
|
1413
|
-
component: t.component,
|
|
1414
|
-
repeat: t.repeat,
|
|
1415
|
-
schema: t.schema,
|
|
1416
|
-
disabled: t.disabled,
|
|
1417
|
-
messages: a.value,
|
|
1418
|
-
onChange: w[1] || (w[1] = (g) => i("patch", { binding: g, ...["barcode", "qrcode"].includes(t.component.kind) ? { imageData: void 0 } : {} }))
|
|
1419
|
-
}, null, 8, ["component", "repeat", "schema", "disabled", "messages"])) : A("", !0),
|
|
1420
|
-
t.component.kind === "text" && !t.component.binding ? (m(), h("label", Va, [
|
|
1421
|
-
H(l(a.value.componentText), 1),
|
|
1422
|
-
n("textarea", {
|
|
1423
|
-
rows: "4",
|
|
1424
|
-
value: t.component.text,
|
|
1425
|
-
onChange: w[2] || (w[2] = (g) => i("patch", { text: E(g) }))
|
|
1426
|
-
}, null, 40, Wa)
|
|
1427
|
-
])) : A("", !0),
|
|
1428
|
-
t.component.kind === "image" && !t.component.binding ? (m(), h(K, { key: 3 }, [
|
|
1429
|
-
n("label", null, [
|
|
1430
|
-
H(l(a.value.imageSource), 1),
|
|
1431
|
-
n("textarea", {
|
|
1432
|
-
rows: "2",
|
|
1433
|
-
value: t.component.imageData,
|
|
1434
|
-
onChange: w[3] || (w[3] = (g) => i("patch", { imageData: E(g) }))
|
|
1435
|
-
}, null, 40, Ua)
|
|
1436
|
-
]),
|
|
1437
|
-
n("label", Ka, [
|
|
1438
|
-
H(l(a.value.imageUpload), 1),
|
|
1439
|
-
n("input", {
|
|
1440
|
-
type: "file",
|
|
1441
|
-
accept: "image/png,image/jpeg,image/webp,image/svg+xml",
|
|
1442
|
-
"aria-label": a.value.imageUpload,
|
|
1443
|
-
onChange: S
|
|
1444
|
-
}, null, 40, Ja)
|
|
1445
|
-
]),
|
|
1446
|
-
s.value ? (m(), h("p", qa, l(s.value), 1)) : A("", !0)
|
|
1447
|
-
], 64)) : A("", !0),
|
|
1448
|
-
t.component.kind === "barcode" || t.component.kind === "qrcode" ? (m(), we(Sa, {
|
|
1449
|
-
key: 4,
|
|
1450
|
-
component: t.component,
|
|
1451
|
-
disabled: t.disabled,
|
|
1452
|
-
messages: a.value,
|
|
1453
|
-
onChange: w[4] || (w[4] = (g) => i("patch", { code: g, imageData: void 0 }))
|
|
1454
|
-
}, null, 8, ["component", "disabled", "messages"])) : A("", !0),
|
|
1455
|
-
t.component.kind === "text" ? (m(), h("div", Ya, [
|
|
1456
|
-
n("h3", null, l(a.value.textFormat), 1),
|
|
1457
|
-
n("div", Xa, [
|
|
1458
|
-
n("label", null, [
|
|
1459
|
-
H(l(a.value.fontSize), 1),
|
|
1460
|
-
n("input", {
|
|
1461
|
-
type: "number",
|
|
1462
|
-
min: "1",
|
|
1463
|
-
max: "200",
|
|
1464
|
-
value: e(We)(t.component.style).fontSizePt,
|
|
1465
|
-
onChange: w[5] || (w[5] = (g) => p("fontSize", Number(E(g))))
|
|
1466
|
-
}, null, 40, Za)
|
|
1467
|
-
]),
|
|
1468
|
-
n("label", null, [
|
|
1469
|
-
H(l(a.value.fontBold), 1),
|
|
1470
|
-
n("input", {
|
|
1471
|
-
type: "checkbox",
|
|
1472
|
-
checked: t.component.style?.bold === !0,
|
|
1473
|
-
onChange: w[6] || (w[6] = (g) => p("bold", g.target.checked))
|
|
1474
|
-
}, null, 40, Qa)
|
|
1475
|
-
])
|
|
1476
|
-
]),
|
|
1477
|
-
re(it, {
|
|
1478
|
-
"model-value": t.component.style?.align ?? "left",
|
|
1479
|
-
label: a.value.bodyAlign,
|
|
1480
|
-
labels: k.value,
|
|
1481
|
-
"auto-label": a.value.autoShort,
|
|
1482
|
-
"onUpdate:modelValue": w[7] || (w[7] = (g) => p("align", g))
|
|
1483
|
-
}, null, 8, ["model-value", "label", "labels", "auto-label"]),
|
|
1484
|
-
n("div", el, [
|
|
1485
|
-
n("label", null, [
|
|
1486
|
-
H(l(a.value.textColor), 1),
|
|
1487
|
-
n("input", {
|
|
1488
|
-
type: "color",
|
|
1489
|
-
value: t.component.style?.color ?? "#233c5c",
|
|
1490
|
-
onChange: w[8] || (w[8] = (g) => p("color", E(g)))
|
|
1491
|
-
}, null, 40, tl)
|
|
1492
|
-
]),
|
|
1493
|
-
n("label", null, [
|
|
1494
|
-
H(l(a.value.backgroundColor), 1),
|
|
1495
|
-
n("input", {
|
|
1496
|
-
type: "color",
|
|
1497
|
-
value: t.component.style?.backgroundColor ?? "#ffffff",
|
|
1498
|
-
onChange: w[9] || (w[9] = (g) => p("backgroundColor", E(g)))
|
|
1499
|
-
}, null, 40, nl)
|
|
1500
|
-
])
|
|
1501
|
-
])
|
|
1502
|
-
])) : A("", !0),
|
|
1503
|
-
t.component.kind === "list" ? (m(), h("label", al, [
|
|
1504
|
-
H(l(a.value.listDataset), 1),
|
|
1505
|
-
n("input", {
|
|
1506
|
-
value: t.component.dataset,
|
|
1507
|
-
onChange: w[10] || (w[10] = (g) => i("patch", { dataset: E(g) }))
|
|
1508
|
-
}, null, 40, ll)
|
|
1509
|
-
])) : A("", !0)
|
|
1510
|
-
], 8, Ha));
|
|
1511
|
-
}
|
|
1512
|
-
}), il = /* @__PURE__ */ $e(ol, [["__scopeId", "data-v-4a29619c"]]), sl = ["disabled"], rl = { class: "mr-page-section-heading" }, dl = ["aria-label"], ul = ["aria-pressed", "onClick"], cl = { class: "mr-page-actions" }, ml = ["disabled"], vl = {
|
|
1513
|
-
key: 0,
|
|
1514
|
-
class: "mr-page-confirm",
|
|
1515
|
-
role: "alert"
|
|
1516
|
-
}, pl = ["value", "placeholder"], gl = ["value"], hl = ["value"], fl = { value: "custom" }, bl = { class: "mr-page-grid" }, yl = ["value"], wl = ["value"], Ml = ["value"], kl = { value: "page" }, xl = ["disabled"], Cl = { class: "mr-page-grid" }, $l = ["value", "onChange"], Sl = {
|
|
1517
|
-
key: 1,
|
|
1518
|
-
class: "mr-page-overflow",
|
|
1519
|
-
role: "status"
|
|
1520
|
-
}, _l = /* @__PURE__ */ Ce({
|
|
1521
|
-
__name: "TemplatePageInspector",
|
|
1522
|
-
props: {
|
|
1523
|
-
document: {},
|
|
1524
|
-
pageIndex: {},
|
|
1525
|
-
disabled: { type: Boolean },
|
|
1526
|
-
messages: {}
|
|
1527
|
-
},
|
|
1528
|
-
emits: ["select", "command", "locate"],
|
|
1529
|
-
setup(t, { emit: d }) {
|
|
1530
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), s = D(() => o.document.template.pages[o.pageIndex]), v = D(() => lt.find(($) => $.widthMm === s.value.widthMm && $.heightMm === s.value.heightMm)?.id ?? "custom"), M = D(() => kt(s.value)), f = W(!1);
|
|
1531
|
-
le(() => [o.pageIndex, o.document], () => {
|
|
1532
|
-
f.value = !1;
|
|
1533
|
-
});
|
|
1534
|
-
const p = ["marginTopMm", "marginRightMm", "marginBottomMm", "marginLeftMm"], k = D(() => [a.value.marginTop, a.value.marginRight, a.value.marginBottom, a.value.marginLeft]);
|
|
1535
|
-
function E($) {
|
|
1536
|
-
return $.target.value;
|
|
1537
|
-
}
|
|
1538
|
-
function S($) {
|
|
1539
|
-
o.disabled || i("command", { type: "patch", patch: $ });
|
|
1540
|
-
}
|
|
1541
|
-
function I($) {
|
|
1542
|
-
const u = lt.find((y) => y.id === E($));
|
|
1543
|
-
u && S({ widthMm: u.widthMm, heightMm: u.heightMm, layout: "page" });
|
|
1544
|
-
}
|
|
1545
|
-
function w($, u) {
|
|
1546
|
-
const y = E(u);
|
|
1547
|
-
y.trim() && Number.isFinite(Number(y)) && S({ [$]: Number(y) });
|
|
1548
|
-
}
|
|
1549
|
-
function g() {
|
|
1550
|
-
if (!(o.disabled || o.document.template.pages.length <= 1)) {
|
|
1551
|
-
if (s.value.components.length && !f.value) {
|
|
1552
|
-
f.value = !0;
|
|
1553
|
-
return;
|
|
1554
|
-
}
|
|
1555
|
-
i("command", { type: "remove" }), f.value = !1;
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
return ($, u) => (m(), h("fieldset", {
|
|
1559
|
-
class: "mr-page-properties",
|
|
1560
|
-
disabled: t.disabled
|
|
1561
|
-
}, [
|
|
1562
|
-
n("div", rl, [
|
|
1563
|
-
n("h3", null, l(a.value.paperAndPages), 1),
|
|
1564
|
-
n("span", null, l(s.value.widthMm) + " × " + l(s.value.heightMm) + " mm", 1)
|
|
1565
|
-
]),
|
|
1566
|
-
n("div", {
|
|
1567
|
-
class: "mr-page-list",
|
|
1568
|
-
"aria-label": a.value.pageDirectory
|
|
1569
|
-
}, [
|
|
1570
|
-
(m(!0), h(K, null, ee(t.document.template.pages, (y, x) => (m(), h("button", {
|
|
1571
|
-
key: x,
|
|
1572
|
-
type: "button",
|
|
1573
|
-
"aria-pressed": t.pageIndex === x,
|
|
1574
|
-
onClick: (C) => i("select", x)
|
|
1575
|
-
}, [
|
|
1576
|
-
n("span", null, l(x + 1), 1),
|
|
1577
|
-
n("strong", null, l(e(ot)(y, x, a.value.page)), 1),
|
|
1578
|
-
n("small", null, l(y.widthMm) + " × " + l(y.heightMm), 1)
|
|
1579
|
-
], 8, ul))), 128))
|
|
1580
|
-
], 8, dl),
|
|
1581
|
-
n("div", cl, [
|
|
1582
|
-
n("button", {
|
|
1583
|
-
type: "button",
|
|
1584
|
-
onClick: u[0] || (u[0] = (y) => i("command", { type: "add" }))
|
|
1585
|
-
}, "+ " + l(a.value.addPage), 1),
|
|
1586
|
-
n("button", {
|
|
1587
|
-
type: "button",
|
|
1588
|
-
onClick: u[1] || (u[1] = (y) => i("command", { type: "duplicate" }))
|
|
1589
|
-
}, l(a.value.duplicatePage), 1),
|
|
1590
|
-
n("button", {
|
|
1591
|
-
type: "button",
|
|
1592
|
-
disabled: t.disabled || t.document.template.pages.length <= 1,
|
|
1593
|
-
onClick: g
|
|
1594
|
-
}, l(a.value.removePage), 9, ml)
|
|
1595
|
-
]),
|
|
1596
|
-
f.value ? (m(), h("div", vl, [
|
|
1597
|
-
n("span", null, l(a.value.removePageConfirm), 1),
|
|
1598
|
-
n("button", {
|
|
1599
|
-
type: "button",
|
|
1600
|
-
onClick: u[2] || (u[2] = (y) => f.value = !1)
|
|
1601
|
-
}, l(a.value.keepEditing), 1),
|
|
1602
|
-
n("button", {
|
|
1603
|
-
type: "button",
|
|
1604
|
-
onClick: g
|
|
1605
|
-
}, l(a.value.confirmRemovePage), 1)
|
|
1606
|
-
])) : A("", !0),
|
|
1607
|
-
n("label", null, [
|
|
1608
|
-
H(l(a.value.pageName), 1),
|
|
1609
|
-
n("input", {
|
|
1610
|
-
value: s.value.meta?.title ?? "",
|
|
1611
|
-
placeholder: `${a.value.page} ${t.pageIndex + 1}`,
|
|
1612
|
-
maxlength: "120",
|
|
1613
|
-
onChange: u[3] || (u[3] = (y) => S({ meta: { ...s.value.meta, title: E(y) } }))
|
|
1614
|
-
}, null, 40, pl)
|
|
1615
|
-
]),
|
|
1616
|
-
n("label", null, [
|
|
1617
|
-
H(l(a.value.paperPreset), 1),
|
|
1618
|
-
n("select", {
|
|
1619
|
-
value: v.value,
|
|
1620
|
-
onChange: I
|
|
1621
|
-
}, [
|
|
1622
|
-
(m(!0), h(K, null, ee(e(lt), (y) => (m(), h("option", {
|
|
1623
|
-
key: y.id,
|
|
1624
|
-
value: y.id
|
|
1625
|
-
}, l(y.id.startsWith("label") ? a.value.labelPaper : y.id.toUpperCase()) + " · " + l(y.widthMm) + " × " + l(y.heightMm) + " mm", 9, hl))), 128)),
|
|
1626
|
-
n("option", fl, l(a.value.customPaper), 1)
|
|
1627
|
-
], 40, gl)
|
|
1628
|
-
]),
|
|
1629
|
-
n("div", bl, [
|
|
1630
|
-
n("label", null, [
|
|
1631
|
-
H(l(a.value.paperWidth), 1),
|
|
1632
|
-
n("input", {
|
|
1633
|
-
type: "number",
|
|
1634
|
-
min: "1",
|
|
1635
|
-
step: "0.5",
|
|
1636
|
-
value: s.value.widthMm,
|
|
1637
|
-
onChange: u[4] || (u[4] = (y) => w("widthMm", y))
|
|
1638
|
-
}, null, 40, yl)
|
|
1639
|
-
]),
|
|
1640
|
-
n("label", null, [
|
|
1641
|
-
H(l(a.value.paperHeight), 1),
|
|
1642
|
-
n("input", {
|
|
1643
|
-
type: "number",
|
|
1644
|
-
min: "1",
|
|
1645
|
-
max: "4999",
|
|
1646
|
-
step: "0.5",
|
|
1647
|
-
value: s.value.heightMm,
|
|
1648
|
-
onChange: u[5] || (u[5] = (y) => w("heightMm", y))
|
|
1649
|
-
}, null, 40, wl)
|
|
1650
|
-
])
|
|
1651
|
-
]),
|
|
1652
|
-
n("label", null, [
|
|
1653
|
-
H(l(a.value.pageLayout), 1),
|
|
1654
|
-
n("select", {
|
|
1655
|
-
value: s.value.layout ?? "page",
|
|
1656
|
-
onChange: u[6] || (u[6] = (y) => S({ layout: E(y) }))
|
|
1657
|
-
}, [
|
|
1658
|
-
n("option", kl, l(a.value.fixedPaper), 1),
|
|
1659
|
-
n("option", {
|
|
1660
|
-
value: "wide",
|
|
1661
|
-
disabled: !!t.document.template.repeat
|
|
1662
|
-
}, l(a.value.completeWide), 9, xl)
|
|
1663
|
-
], 40, Ml)
|
|
1664
|
-
]),
|
|
1665
|
-
n("details", null, [
|
|
1666
|
-
n("summary", null, l(a.value.pageMargins), 1),
|
|
1667
|
-
n("div", Cl, [
|
|
1668
|
-
(m(), h(K, null, ee(p, (y, x) => n("label", { key: y }, [
|
|
1669
|
-
H(l(k.value[x]), 1),
|
|
1670
|
-
n("input", {
|
|
1671
|
-
type: "number",
|
|
1672
|
-
min: "0",
|
|
1673
|
-
step: "0.5",
|
|
1674
|
-
value: s.value[y] ?? 0,
|
|
1675
|
-
onChange: (C) => w(y, C)
|
|
1676
|
-
}, null, 40, $l)
|
|
1677
|
-
])), 64))
|
|
1678
|
-
])
|
|
1679
|
-
]),
|
|
1680
|
-
M.value.length ? (m(), h("div", Sl, [
|
|
1681
|
-
n("strong", null, l(a.value.pageOverflow.replace("{count}", String(M.value.length))), 1),
|
|
1682
|
-
n("p", null, l(a.value.pageOverflowHint), 1),
|
|
1683
|
-
n("button", {
|
|
1684
|
-
type: "button",
|
|
1685
|
-
onClick: u[7] || (u[7] = (y) => i("locate", M.value[0]))
|
|
1686
|
-
}, l(a.value.locateOverflow), 1)
|
|
1687
|
-
])) : A("", !0)
|
|
1688
|
-
], 8, sl));
|
|
1689
|
-
}
|
|
1690
|
-
}), Il = /* @__PURE__ */ $e(_l, [["__scopeId", "data-v-da0b7ab6"]]), El = ["disabled"], Pl = { class: "mr-repeat-toggle" }, Rl = ["checked", "disabled"], Tl = ["value", "list"], Ll = ["id"], Dl = ["value"], Al = ["value"], Hl = ["value"], Fl = { class: "mr-repeat-grid" }, Nl = ["value"], Gl = { value: "fixed" }, Ol = { value: "field" }, Bl = { key: 0 }, zl = ["value"], jl = { key: 1 }, Vl = ["value"], Wl = { class: "mr-repeat-note" }, Ul = /* @__PURE__ */ Ce({
|
|
1691
|
-
__name: "TemplateRepeatInspector",
|
|
1692
|
-
props: {
|
|
1693
|
-
document: {},
|
|
1694
|
-
datasets: {},
|
|
1695
|
-
schemas: {},
|
|
1696
|
-
disabled: { type: Boolean },
|
|
1697
|
-
messages: {}
|
|
1698
|
-
},
|
|
1699
|
-
emits: ["change"],
|
|
1700
|
-
setup(t, { emit: d }) {
|
|
1701
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), s = D(() => o.document.template.repeat), v = D(() => o.schemas?.[s.value?.dataset ?? ""]?.fields ?? []), M = D(() => [.../* @__PURE__ */ new Set([...o.datasets ?? [], ...Object.keys(o.schemas ?? {}), ...s.value ? [s.value.dataset] : []])]), f = D(() => o.document.template.pages.some((u) => u.components.some((y) => y.kind !== "list" && y.binding))), p = D(() => o.document.template.pages.some((u) => u.layout === "wide" || !!u.flow || u.components.some((y) => y.kind === "list") || kt(u).length > 0)), k = D(() => typeof s.value?.copies == "object" ? "field" : "fixed"), E = `mr-repeat-fields-${st()?.uid ?? 0}`;
|
|
1702
|
-
function S(u) {
|
|
1703
|
-
return u.target.value;
|
|
1704
|
-
}
|
|
1705
|
-
function I(u) {
|
|
1706
|
-
!o.disabled && s.value && i("change", { ...s.value, ...u });
|
|
1707
|
-
}
|
|
1708
|
-
function w(u) {
|
|
1709
|
-
o.disabled || (u.target.checked ? p.value || i("change", { dataset: M.value[0] ?? "detail", copies: 1 }) : f.value || i("change", void 0));
|
|
1710
|
-
}
|
|
1711
|
-
function g(u) {
|
|
1712
|
-
if (!s.value || o.disabled) return;
|
|
1713
|
-
const y = { ...s.value }, x = S(u).trim();
|
|
1714
|
-
x ? y.rowKey = x : delete y.rowKey, i("change", y);
|
|
1715
|
-
}
|
|
1716
|
-
function $(u) {
|
|
1717
|
-
I({ copies: S(u) === "field" ? { field: v.value.find((y) => y.type === "number")?.field ?? "copies" } : 1 });
|
|
1718
|
-
}
|
|
1719
|
-
return (u, y) => (m(), h("fieldset", {
|
|
1720
|
-
class: "mr-repeat-properties",
|
|
1721
|
-
disabled: t.disabled
|
|
1722
|
-
}, [
|
|
1723
|
-
n("label", Pl, [
|
|
1724
|
-
n("span", null, [
|
|
1725
|
-
n("strong", null, l(a.value.repeatRecords), 1),
|
|
1726
|
-
n("small", null, l(p.value ? a.value.repeatNeedsFixed : a.value.repeatRecordsHint), 1)
|
|
1727
|
-
]),
|
|
1728
|
-
n("input", {
|
|
1729
|
-
type: "checkbox",
|
|
1730
|
-
checked: !!s.value,
|
|
1731
|
-
disabled: t.disabled || !!s.value && f.value || !s.value && p.value,
|
|
1732
|
-
onChange: w
|
|
1733
|
-
}, null, 40, Rl)
|
|
1734
|
-
]),
|
|
1735
|
-
s.value ? (m(), h(K, { key: 0 }, [
|
|
1736
|
-
n("label", null, [
|
|
1737
|
-
H(l(a.value.recordDataset), 1),
|
|
1738
|
-
n("input", {
|
|
1739
|
-
value: s.value.dataset,
|
|
1740
|
-
list: `${E}-datasets`,
|
|
1741
|
-
onChange: y[0] || (y[0] = (x) => S(x).trim() && I({ dataset: S(x).trim() }))
|
|
1742
|
-
}, null, 40, Tl)
|
|
1743
|
-
]),
|
|
1744
|
-
n("datalist", {
|
|
1745
|
-
id: `${E}-datasets`
|
|
1746
|
-
}, [
|
|
1747
|
-
(m(!0), h(K, null, ee(M.value, (x) => (m(), h("option", {
|
|
1748
|
-
key: x,
|
|
1749
|
-
value: x
|
|
1750
|
-
}, null, 8, Dl))), 128))
|
|
1751
|
-
], 8, Ll),
|
|
1752
|
-
n("label", null, [
|
|
1753
|
-
H(l(a.value.recordRowKey), 1),
|
|
1754
|
-
n("input", {
|
|
1755
|
-
value: s.value.rowKey ?? "",
|
|
1756
|
-
list: E,
|
|
1757
|
-
onChange: g
|
|
1758
|
-
}, null, 40, Al)
|
|
1759
|
-
]),
|
|
1760
|
-
n("datalist", { id: E }, [
|
|
1761
|
-
(m(!0), h(K, null, ee(v.value, (x) => (m(), h("option", {
|
|
1762
|
-
key: x.field,
|
|
1763
|
-
value: x.field
|
|
1764
|
-
}, l(x.label), 9, Hl))), 128))
|
|
1765
|
-
]),
|
|
1766
|
-
n("div", Fl, [
|
|
1767
|
-
n("label", null, [
|
|
1768
|
-
H(l(a.value.labelCopies), 1),
|
|
1769
|
-
n("select", {
|
|
1770
|
-
value: k.value,
|
|
1771
|
-
onChange: $
|
|
1772
|
-
}, [
|
|
1773
|
-
n("option", Gl, l(a.value.fixedCopies), 1),
|
|
1774
|
-
n("option", Ol, l(a.value.fieldCopies), 1)
|
|
1775
|
-
], 40, Nl)
|
|
1776
|
-
]),
|
|
1777
|
-
k.value === "fixed" ? (m(), h("label", Bl, [
|
|
1778
|
-
H(l(a.value.copiesPerRecord), 1),
|
|
1779
|
-
n("input", {
|
|
1780
|
-
type: "number",
|
|
1781
|
-
min: "1",
|
|
1782
|
-
max: "1000",
|
|
1783
|
-
step: "1",
|
|
1784
|
-
value: s.value.copies ?? 1,
|
|
1785
|
-
onChange: y[1] || (y[1] = (x) => S(x).trim() && I({ copies: Number(S(x)) }))
|
|
1786
|
-
}, null, 40, zl)
|
|
1787
|
-
])) : (m(), h("label", jl, [
|
|
1788
|
-
H(l(a.value.copiesField), 1),
|
|
1789
|
-
n("input", {
|
|
1790
|
-
value: typeof s.value.copies == "object" ? s.value.copies.field : "",
|
|
1791
|
-
list: E,
|
|
1792
|
-
onChange: y[2] || (y[2] = (x) => S(x).trim() && I({ copies: { field: S(x).trim() } }))
|
|
1793
|
-
}, null, 40, Vl)
|
|
1794
|
-
]))
|
|
1795
|
-
]),
|
|
1796
|
-
n("p", Wl, l(f.value ? a.value.repeatBoundHint : a.value.repeatOrderHint), 1)
|
|
1797
|
-
], 64)) : A("", !0)
|
|
1798
|
-
], 8, El));
|
|
1799
|
-
}
|
|
1800
|
-
}), Kl = /* @__PURE__ */ $e(Ul, [["__scopeId", "data-v-de1ee031"]]), Jl = { class: "mr-header-editor" }, ql = ["disabled"], Yl = ["value"], Xl = ["value"], Zl = ["value"], Ql = ["disabled"], eo = /* @__PURE__ */ Ce({
|
|
1801
|
-
__name: "HeaderStructureEditor",
|
|
1802
|
-
props: {
|
|
1803
|
-
list: {},
|
|
1804
|
-
disabled: { type: Boolean },
|
|
1805
|
-
messages: {}
|
|
1806
|
-
},
|
|
1807
|
-
emits: ["command"],
|
|
1808
|
-
setup(t, { emit: d }) {
|
|
1809
|
-
const o = t, i = d, a = D(() => ({ ...Pe, ...o.messages })), s = W(0), v = W(0), M = W(Math.min(1, o.list.columns.length - 1));
|
|
1810
|
-
return le(
|
|
1811
|
-
() => o.list.columns.length,
|
|
1812
|
-
(f) => {
|
|
1813
|
-
v.value = Math.min(v.value, f - 1), M.value = Math.min(M.value, f - 1);
|
|
1814
|
-
}
|
|
1815
|
-
), (f, p) => (m(), h("details", Jl, [
|
|
1816
|
-
n("summary", null, [
|
|
1817
|
-
H(l(a.value.headerStructure), 1),
|
|
1818
|
-
n("span", null, l(t.list.headerGrid?.cells.length ?? 1) + " " + l(a.value.headerRow), 1)
|
|
1819
|
-
]),
|
|
1820
|
-
n("fieldset", { disabled: t.disabled }, [
|
|
1821
|
-
n("label", null, [
|
|
1822
|
-
H(l(a.value.headerRow), 1),
|
|
1823
|
-
be(n("select", {
|
|
1824
|
-
"onUpdate:modelValue": p[0] || (p[0] = (k) => s.value = k)
|
|
1825
|
-
}, [
|
|
1826
|
-
(m(!0), h(K, null, ee(t.list.headerGrid?.cells.length ?? 1, (k) => (m(), h("option", {
|
|
1827
|
-
key: k,
|
|
1828
|
-
value: k - 1
|
|
1829
|
-
}, l(k), 9, Yl))), 128))
|
|
1830
|
-
], 512), [
|
|
1831
|
-
[
|
|
1832
|
-
Ve,
|
|
1833
|
-
s.value,
|
|
1834
|
-
void 0,
|
|
1835
|
-
{ number: !0 }
|
|
1836
|
-
]
|
|
1837
|
-
])
|
|
1838
|
-
]),
|
|
1839
|
-
n("label", null, [
|
|
1840
|
-
H(l(a.value.headerFirst), 1),
|
|
1841
|
-
be(n("select", {
|
|
1842
|
-
"onUpdate:modelValue": p[1] || (p[1] = (k) => v.value = k)
|
|
1843
|
-
}, [
|
|
1844
|
-
(m(!0), h(K, null, ee(t.list.columns, (k, E) => (m(), h("option", {
|
|
1845
|
-
key: E,
|
|
1846
|
-
value: E
|
|
1847
|
-
}, l(E + 1) + " · " + l(k.header), 9, Xl))), 128))
|
|
1848
|
-
], 512), [
|
|
1849
|
-
[
|
|
1850
|
-
Ve,
|
|
1851
|
-
v.value,
|
|
1852
|
-
void 0,
|
|
1853
|
-
{ number: !0 }
|
|
1854
|
-
]
|
|
1855
|
-
])
|
|
1856
|
-
]),
|
|
1857
|
-
n("label", null, [
|
|
1858
|
-
H(l(a.value.headerLast), 1),
|
|
1859
|
-
be(n("select", {
|
|
1860
|
-
"onUpdate:modelValue": p[2] || (p[2] = (k) => M.value = k)
|
|
1861
|
-
}, [
|
|
1862
|
-
(m(!0), h(K, null, ee(t.list.columns, (k, E) => (m(), h("option", {
|
|
1863
|
-
key: E,
|
|
1864
|
-
value: E
|
|
1865
|
-
}, l(E + 1) + " · " + l(k.header), 9, Zl))), 128))
|
|
1866
|
-
], 512), [
|
|
1867
|
-
[
|
|
1868
|
-
Ve,
|
|
1869
|
-
M.value,
|
|
1870
|
-
void 0,
|
|
1871
|
-
{ number: !0 }
|
|
1872
|
-
]
|
|
1873
|
-
])
|
|
1874
|
-
]),
|
|
1875
|
-
n("div", null, [
|
|
1876
|
-
n("button", {
|
|
1877
|
-
type: "button",
|
|
1878
|
-
onClick: p[3] || (p[3] = (k) => i("command", { action: "add", row: s.value, first: v.value, last: M.value }))
|
|
1879
|
-
}, l(a.value.addHeaderRow), 1),
|
|
1880
|
-
n("button", {
|
|
1881
|
-
type: "button",
|
|
1882
|
-
disabled: v.value >= M.value,
|
|
1883
|
-
onClick: p[4] || (p[4] = (k) => i("command", { action: "merge", row: s.value, first: v.value, last: M.value }))
|
|
1884
|
-
}, l(a.value.mergeHeader), 9, Ql),
|
|
1885
|
-
n("button", {
|
|
1886
|
-
type: "button",
|
|
1887
|
-
onClick: p[5] || (p[5] = (k) => i("command", { action: "split", row: s.value, first: v.value, last: M.value }))
|
|
1888
|
-
}, l(a.value.splitHeader), 1)
|
|
1889
|
-
])
|
|
1890
|
-
], 8, ql)
|
|
1891
|
-
]));
|
|
1892
|
-
}
|
|
1893
|
-
}), to = /* @__PURE__ */ $e(eo, [["__scopeId", "data-v-acd607ef"]]), Ie = (t) => `${t.pageIndex}:${t.componentIndex}`;
|
|
1894
|
-
function no(t, d, o) {
|
|
1895
|
-
const i = W([]), a = W(/* @__PURE__ */ new Set());
|
|
1896
|
-
le(() => t.value.id, () => {
|
|
1897
|
-
i.value = [], a.value = /* @__PURE__ */ new Set();
|
|
1898
|
-
});
|
|
1899
|
-
const s = (S) => !!S && a.value.has(Ie(S));
|
|
1900
|
-
function v(S) {
|
|
1901
|
-
const I = { pageIndex: S.pageIndex, componentIndex: S.componentIndex };
|
|
1902
|
-
if (S.additive && i.value.every((w) => w.pageIndex === S.pageIndex)) {
|
|
1903
|
-
const w = i.value.some((g) => Ie(g) === Ie(S));
|
|
1904
|
-
i.value = w ? i.value.filter((g) => Ie(g) !== Ie(S)) : [...i.value, I], d.value = w ? i.value.at(-1) : I;
|
|
1905
|
-
} else
|
|
1906
|
-
i.value = [I], d.value = I;
|
|
1907
|
-
}
|
|
1908
|
-
const M = D(() => i.value.filter((S) => !s(S)));
|
|
1909
|
-
function f() {
|
|
1910
|
-
const S = new Set(a.value), I = i.value.every(s);
|
|
1911
|
-
for (const w of i.value)
|
|
1912
|
-
I ? S.delete(Ie(w)) : S.add(Ie(w));
|
|
1913
|
-
a.value = S;
|
|
1914
|
-
}
|
|
1915
|
-
function p(S) {
|
|
1916
|
-
M.value.length < 2 || o((I) => {
|
|
1917
|
-
const w = M.value.map((C) => Le(I, C)).filter(Boolean), g = w.map(ke), $ = Math.min(...g.map((C) => C.leftMm)), u = Math.min(...g.map((C) => C.topMm)), y = Math.max(...g.map((C) => C.leftMm + C.widthMm)), x = Math.max(...g.map((C) => C.topMm + C.heightMm));
|
|
1918
|
-
w.forEach((C, P) => {
|
|
1919
|
-
const L = g[P], F = { left: $, center: ($ + y - L.widthMm) / 2, right: y - L.widthMm }, G = { top: u, middle: (u + x - L.heightMm) / 2, bottom: x - L.heightMm };
|
|
1920
|
-
S in F ? L.leftMm = F[S] : L.topMm = G[S], Ge(C, L);
|
|
1921
|
-
});
|
|
1922
|
-
});
|
|
1923
|
-
}
|
|
1924
|
-
function k(S) {
|
|
1925
|
-
M.value.length < 3 || o((I) => {
|
|
1926
|
-
const w = S === "horizontal" ? "leftMm" : "topMm", g = S === "horizontal" ? "widthMm" : "heightMm", $ = M.value.map((P) => ({ component: Le(I, P), box: ke(Le(I, P)) })).sort((P, L) => P.box[w] - L.box[w]), u = $[0].box[w], x = (Math.max(...$.map((P) => P.box[w] + P.box[g])) - u - $.reduce((P, L) => P + L.box[g], 0)) / ($.length - 1);
|
|
1927
|
-
let C = u;
|
|
1928
|
-
for (const P of $)
|
|
1929
|
-
P.box[w] = C, Ge(P.component, P.box), C += P.box[g] + x;
|
|
1930
|
-
});
|
|
1931
|
-
}
|
|
1932
|
-
function E(S, I, w) {
|
|
1933
|
-
function g($) {
|
|
1934
|
-
if ($.pageIndex !== S) return $;
|
|
1935
|
-
const u = $.componentIndex;
|
|
1936
|
-
return w === void 0 ? u === I ? void 0 : { ...$, componentIndex: u > I ? u - 1 : u } : { ...$, componentIndex: u === I ? w : u === w ? I : u };
|
|
1937
|
-
}
|
|
1938
|
-
a.value = new Set([...a.value].flatMap(($) => {
|
|
1939
|
-
const [u, y] = $.split(":").map(Number), x = g({ pageIndex: u, componentIndex: y });
|
|
1940
|
-
return x ? [Ie(x)] : [];
|
|
1941
|
-
})), i.value = i.value.flatMap(($) => {
|
|
1942
|
-
const u = g($);
|
|
1943
|
-
return u ? [u] : [];
|
|
1944
|
-
});
|
|
1945
|
-
}
|
|
1946
|
-
return { clearLocks: () => {
|
|
1947
|
-
a.value = /* @__PURE__ */ new Set();
|
|
1948
|
-
}, selections: i, locked: s, allLocked: D(() => !!i.value.length && i.value.every(s)), toggleLock: f, align: p, distribute: k, select: v, remap: E };
|
|
1949
|
-
}
|
|
1950
|
-
function ao(t, d) {
|
|
1951
|
-
const o = W("preview"), i = W(), a = W(0), s = D(() => !!t.value.template.pages[i.value?.pageIndex ?? a.value]?.flow), v = no(t, i, (g) => s.value ? !1 : d(g)), M = D(
|
|
1952
|
-
() => Le(t.value, i.value)
|
|
1953
|
-
);
|
|
1954
|
-
le(a, (g) => {
|
|
1955
|
-
i.value?.pageIndex !== g && (i.value = void 0, v.selections.value = []);
|
|
1956
|
-
}), le(t, () => {
|
|
1957
|
-
M.value || (i.value = void 0), v.selections.value = v.selections.value.filter((g) => !!Le(t.value, g)), t.value.template.pages[a.value] || (a.value = 0);
|
|
1958
|
-
});
|
|
1959
|
-
function f(g) {
|
|
1960
|
-
v.select(g), a.value = g.pageIndex;
|
|
1961
|
-
}
|
|
1962
|
-
function p(g) {
|
|
1963
|
-
const $ = i.value;
|
|
1964
|
-
return !$ || v.locked($) ? !1 : d((u) => {
|
|
1965
|
-
const y = Le(u, $);
|
|
1966
|
-
y && g(y, u);
|
|
1967
|
-
});
|
|
1968
|
-
}
|
|
1969
|
-
function k(g) {
|
|
1970
|
-
s.value || p(($, u) => {
|
|
1971
|
-
const y = u.template.pages[i.value.pageIndex];
|
|
1972
|
-
Ge(
|
|
1973
|
-
$,
|
|
1974
|
-
Ue(g, y, $.kind === "list")
|
|
1975
|
-
);
|
|
1976
|
-
});
|
|
1977
|
-
}
|
|
1978
|
-
function E(g) {
|
|
1979
|
-
if (t.value.template.pages[a.value]?.flow || g === "list" && t.value.template.repeat) return;
|
|
1980
|
-
let $ = -1;
|
|
1981
|
-
const u = a.value;
|
|
1982
|
-
d((y) => {
|
|
1983
|
-
const x = y.template.pages[u].components, C = Wt(g);
|
|
1984
|
-
Ge(C, Ue(ke(C), y.template.pages[u], C.kind === "list")), C.kind === "qrcode" && (C.widthMm = C.heightMm = Math.min(C.widthMm, C.heightMm)), x.push(C), $ = x.length - 1;
|
|
1985
|
-
}) && f({ pageIndex: u, componentIndex: $ });
|
|
1986
|
-
}
|
|
1987
|
-
function S() {
|
|
1988
|
-
if (s.value) return;
|
|
1989
|
-
const g = i.value;
|
|
1990
|
-
g && !v.locked(g) && d(($) => {
|
|
1991
|
-
$.template.pages[g.pageIndex].components.splice(
|
|
1992
|
-
g.componentIndex,
|
|
1993
|
-
1
|
|
1994
|
-
);
|
|
1995
|
-
}) && (v.remap(g.pageIndex, g.componentIndex), i.value = void 0);
|
|
1996
|
-
}
|
|
1997
|
-
function I() {
|
|
1998
|
-
if (s.value) return;
|
|
1999
|
-
const g = i.value;
|
|
2000
|
-
if (!g) return;
|
|
2001
|
-
let $ = -1;
|
|
2002
|
-
d((u) => {
|
|
2003
|
-
const y = u.template.pages[g.pageIndex], x = JSON.parse(JSON.stringify(Le(u, g))), C = ke(x);
|
|
2004
|
-
C.leftMm += 4, C.topMm += 4, Ge(
|
|
2005
|
-
x,
|
|
2006
|
-
Ue(C, y, x.kind === "list")
|
|
2007
|
-
), x.kind === "list" ? delete x.id : (delete x.nid, delete x.rkey), y.components.push(x), $ = y.components.length - 1;
|
|
2008
|
-
}) && f({ pageIndex: g.pageIndex, componentIndex: $ });
|
|
2009
|
-
}
|
|
2010
|
-
function w(g) {
|
|
2011
|
-
if (s.value) return;
|
|
2012
|
-
const $ = i.value;
|
|
2013
|
-
if (!$ || v.locked($)) return;
|
|
2014
|
-
const u = $.componentIndex + g;
|
|
2015
|
-
t.value.template.pages[$.pageIndex]?.components[u] && d((y) => {
|
|
2016
|
-
const x = y.template.pages[$.pageIndex].components;
|
|
2017
|
-
x.splice(u, 0, x.splice($.componentIndex, 1)[0]);
|
|
2018
|
-
}) && (v.remap($.pageIndex, $.componentIndex, u), f({ pageIndex: $.pageIndex, componentIndex: u }));
|
|
2019
|
-
}
|
|
2020
|
-
return {
|
|
2021
|
-
...v,
|
|
2022
|
-
mode: o,
|
|
2023
|
-
selection: i,
|
|
2024
|
-
pageIndex: a,
|
|
2025
|
-
active: M,
|
|
2026
|
-
geometryDisabled: s,
|
|
2027
|
-
select: f,
|
|
2028
|
-
mutate: p,
|
|
2029
|
-
geometry: k,
|
|
2030
|
-
insert: E,
|
|
2031
|
-
remove: S,
|
|
2032
|
-
duplicate: I,
|
|
2033
|
-
reorder: w
|
|
2034
|
-
};
|
|
2035
|
-
}
|
|
2036
|
-
function lo(t, d, o) {
|
|
2037
|
-
const { draft: i, lists: a, selected: s, activeList: v, blocked: M, jsonPending: f, error: p } = t, { section: k, activeIndex: E } = d, S = ao(i, t.transaction), {
|
|
2038
|
-
mode: I,
|
|
2039
|
-
selection: w,
|
|
2040
|
-
pageIndex: g,
|
|
2041
|
-
active: $
|
|
2042
|
-
} = S, u = W("excel"), y = W(/* @__PURE__ */ new Set());
|
|
2043
|
-
le([k, u], () => {
|
|
2044
|
-
k.value === "tools" && (y.value = /* @__PURE__ */ new Set([...y.value, u.value]));
|
|
2045
|
-
}), le(w, (O) => {
|
|
2046
|
-
if (!O) return;
|
|
2047
|
-
const V = a.value.findIndex(
|
|
2048
|
-
(B) => B.pageIndex === O.pageIndex && B.componentIndex === O.componentIndex
|
|
2049
|
-
);
|
|
2050
|
-
V >= 0 && (s.value = V);
|
|
2051
|
-
}), le([E, s, I, k], () => {
|
|
2052
|
-
if (I.value !== "design" || k.value !== "fields") return;
|
|
2053
|
-
const O = a.value[s.value];
|
|
2054
|
-
O && (w.value?.pageIndex !== O.pageIndex || w.value.componentIndex !== O.componentIndex) && S.select({ pageIndex: O.pageIndex, componentIndex: O.componentIndex });
|
|
2055
|
-
});
|
|
2056
|
-
const x = D(
|
|
2057
|
-
() => t.editingReadonly.value || M.value || f.value
|
|
2058
|
-
), C = D(
|
|
2059
|
-
() => o()?.[v.value?.dataset ?? ""]
|
|
2060
|
-
);
|
|
2061
|
-
function P(O) {
|
|
2062
|
-
I.value = O, k.value === "tools" && (k.value = O === "design" || !a.value.length ? "component" : "fields");
|
|
2063
|
-
}
|
|
2064
|
-
function L(O) {
|
|
2065
|
-
if (!i.value.template.pages[O.pageIndex]?.components[O.componentIndex])
|
|
2066
|
-
return;
|
|
2067
|
-
if (S.select(O), i.value.template.pages[O.pageIndex]?.components[O.componentIndex]?.kind === "list") {
|
|
2068
|
-
const B = a.value.findIndex(
|
|
2069
|
-
(Q) => Q.pageIndex === O.pageIndex && Q.componentIndex === O.componentIndex
|
|
2070
|
-
);
|
|
2071
|
-
B >= 0 && (s.value = B), k.value = "fields";
|
|
2072
|
-
} else k.value = "component";
|
|
2073
|
-
}
|
|
2074
|
-
function F(O) {
|
|
2075
|
-
const V = O.target;
|
|
2076
|
-
V.value && (S.insert(V.value), I.value = "design", k.value = "component", V.value = "");
|
|
2077
|
-
}
|
|
2078
|
-
function G(O) {
|
|
2079
|
-
i.value.template.pages[g.value]?.flow && ["leftMm", "topMm", "widthMm", "heightMm", "pageAnchor", "grid"].some((V) => V in O) || S.mutate((V, B) => {
|
|
2080
|
-
if (V.kind !== "list" && O.pageAnchor !== V.pageAnchor) {
|
|
2081
|
-
const _ = B.template.pages[w.value.pageIndex];
|
|
2082
|
-
O.pageAnchor === "header" && (V.topMm = _.marginTopMm ?? 0), O.pageAnchor === "footer" && (V.topMm = Math.max(
|
|
2083
|
-
0,
|
|
2084
|
-
_.heightMm - (_.marginBottomMm ?? 0) - V.heightMm
|
|
2085
|
-
));
|
|
2086
|
-
}
|
|
2087
|
-
const Q = V;
|
|
2088
|
-
for (const [_, R] of Object.entries(O))
|
|
2089
|
-
R === void 0 ? delete Q[_] : Q[_] = R;
|
|
2090
|
-
});
|
|
2091
|
-
}
|
|
2092
|
-
function j(O) {
|
|
2093
|
-
const V = a.value[s.value];
|
|
2094
|
-
V && t.transaction((B) => {
|
|
2095
|
-
B.template.pages[V.pageIndex].components[V.componentIndex] = O;
|
|
2096
|
-
});
|
|
2097
|
-
}
|
|
2098
|
-
function te(O) {
|
|
2099
|
-
const V = v.value;
|
|
2100
|
-
if (!V || i.value.template.pages[a.value[s.value]?.pageIndex ?? -1]?.flow) return;
|
|
2101
|
-
const B = JSON.parse(JSON.stringify(V));
|
|
2102
|
-
try {
|
|
2103
|
-
Ut(B, E.value, E.value + O) && (j(B), d.activate(E.value + O));
|
|
2104
|
-
} catch (Q) {
|
|
2105
|
-
p.value = Q instanceof Error ? Q.message : String(Q);
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
function se(O) {
|
|
2109
|
-
const V = a.value[s.value];
|
|
2110
|
-
!V || i.value.template.pages[V.pageIndex]?.flow || t.transaction((B) => {
|
|
2111
|
-
const Q = B.template.pages[V.pageIndex].components[V.componentIndex];
|
|
2112
|
-
Q?.kind === "list" && (O.action === "add" ? Kt(Q) : O.action === "merge" ? Jt(Q, O.row, O.first, O.last) : qt(Q, O.row, O.first));
|
|
2113
|
-
});
|
|
2114
|
-
}
|
|
2115
|
-
function r(O) {
|
|
2116
|
-
const V = /\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(O.path ?? ""), B = O.pageIndex ?? (V ? Number(V[1]) : void 0), Q = O.componentIndex ?? (V ? Number(V[2]) : void 0);
|
|
2117
|
-
if (!(B === void 0 || Q === void 0) && (I.value = "design", L({ pageIndex: B, componentIndex: Q }), O.field)) {
|
|
2118
|
-
const _ = v.value?.columns.findIndex(
|
|
2119
|
-
(R) => R.field === O.field
|
|
2120
|
-
);
|
|
2121
|
-
_ !== void 0 && _ >= 0 && d.activate(_);
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
return {
|
|
2125
|
-
mode: I,
|
|
2126
|
-
setMode: P,
|
|
2127
|
-
canvasSelection: w,
|
|
2128
|
-
canvasPage: g,
|
|
2129
|
-
canvasActive: $,
|
|
2130
|
-
tool: u,
|
|
2131
|
-
visitedTools: y,
|
|
2132
|
-
editDisabled: x,
|
|
2133
|
-
dataSchema: C,
|
|
2134
|
-
chooseCanvas: L,
|
|
2135
|
-
insertComponent: F,
|
|
2136
|
-
patchCanvas: G,
|
|
2137
|
-
changeList: j,
|
|
2138
|
-
moveColumn: te,
|
|
2139
|
-
headerCommand: se,
|
|
2140
|
-
locateReview: r,
|
|
2141
|
-
canvas: S
|
|
2142
|
-
};
|
|
2143
|
-
}
|
|
2144
|
-
function oo(t, d, o) {
|
|
2145
|
-
if (!t.length) return;
|
|
2146
|
-
const i = Math.max(0, t.indexOf(d)), s = {
|
|
2147
|
-
ArrowDown: Math.min(i + 1, t.length - 1),
|
|
2148
|
-
ArrowUp: Math.max(i - 1, 0),
|
|
2149
|
-
Home: 0,
|
|
2150
|
-
End: t.length - 1
|
|
2151
|
-
}[o];
|
|
2152
|
-
return s === void 0 ? void 0 : t[s];
|
|
2153
|
-
}
|
|
2154
|
-
function io(t, d, o) {
|
|
2155
|
-
const i = W(!1), a = W(t.activeIndex.value), s = W(null), v = W(null), M = W(null), f = W(null);
|
|
2156
|
-
function p(y = !1) {
|
|
2157
|
-
const x = f.value, C = x?.querySelector(
|
|
2158
|
-
`button[data-column-index="${a.value}"]`
|
|
2159
|
-
);
|
|
2160
|
-
if (!x || !C) return;
|
|
2161
|
-
y && C.focus({ preventScroll: !0 });
|
|
2162
|
-
const P = x.getBoundingClientRect(), L = C.getBoundingClientRect(), F = P.top + x.clientTop, G = F + x.clientHeight;
|
|
2163
|
-
L.top < F ? x.scrollTop += L.top - F : L.bottom > G && (x.scrollTop += L.bottom - G);
|
|
2164
|
-
}
|
|
2165
|
-
async function k(y = !1) {
|
|
2166
|
-
i.value && (i.value = !1, y && (await ce(), s.value?.focus({ preventScroll: !0 })));
|
|
2167
|
-
}
|
|
2168
|
-
async function E() {
|
|
2169
|
-
if (i.value) return k(!0);
|
|
2170
|
-
const y = o.value.map((x) => x.index);
|
|
2171
|
-
a.value = y.includes(t.activeIndex.value) ? t.activeIndex.value : y[0] ?? -1, i.value = !0, await ce(), M.value?.focus({ preventScroll: !0 }), p();
|
|
2172
|
-
}
|
|
2173
|
-
function S(y) {
|
|
2174
|
-
t.activate(y), k(!0);
|
|
2175
|
-
}
|
|
2176
|
-
function I(y) {
|
|
2177
|
-
i.value && (y.preventDefault(), y.stopPropagation(), k(!0));
|
|
2178
|
-
}
|
|
2179
|
-
async function w(y) {
|
|
2180
|
-
const x = oo(
|
|
2181
|
-
o.value.map((C) => C.index),
|
|
2182
|
-
a.value,
|
|
2183
|
-
y.key
|
|
2184
|
-
);
|
|
2185
|
-
x !== void 0 && (a.value = x, y.preventDefault(), await ce(), p(!0));
|
|
2186
|
-
}
|
|
2187
|
-
async function g(y) {
|
|
2188
|
-
if (!["ArrowDown", "ArrowUp", "Enter"].includes(y.key)) return;
|
|
2189
|
-
y.preventDefault(), y.stopPropagation();
|
|
2190
|
-
const x = o.value.map((C) => C.index);
|
|
2191
|
-
if (x.length) {
|
|
2192
|
-
if (y.key === "Enter") {
|
|
2193
|
-
x.includes(a.value) && S(a.value);
|
|
2194
|
-
return;
|
|
2195
|
-
}
|
|
2196
|
-
y.key === "ArrowUp" && (a.value = x.at(-1)), await ce(), p(!0);
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
function $(y) {
|
|
2200
|
-
const x = y.target;
|
|
2201
|
-
!i.value || v.value?.contains(x) || s.value?.contains(x) || k();
|
|
2202
|
-
}
|
|
2203
|
-
function u(y) {
|
|
2204
|
-
const x = y.relatedTarget;
|
|
2205
|
-
!x || v.value?.contains(x) || s.value?.contains(x) || k();
|
|
2206
|
-
}
|
|
2207
|
-
return le(o, (y) => {
|
|
2208
|
-
y.some((x) => x.index === a.value) || (a.value = y[0]?.index ?? -1);
|
|
2209
|
-
}), le(d, () => {
|
|
2210
|
-
k();
|
|
2211
|
-
}), yt(() => document.addEventListener("pointerdown", $)), He(() => document.removeEventListener("pointerdown", $)), {
|
|
2212
|
-
open: i,
|
|
2213
|
-
cursor: a,
|
|
2214
|
-
trigger: s,
|
|
2215
|
-
panel: v,
|
|
2216
|
-
search: M,
|
|
2217
|
-
list: f,
|
|
2218
|
-
toggle: E,
|
|
2219
|
-
close: k,
|
|
2220
|
-
choose: S,
|
|
2221
|
-
escape: I,
|
|
2222
|
-
navigate: w,
|
|
2223
|
-
searchKeydown: g,
|
|
2224
|
-
leave: u
|
|
2225
|
-
};
|
|
2226
|
-
}
|
|
2227
|
-
function so(t, d, o, i) {
|
|
2228
|
-
const a = W(0), s = W(""), v = W([]), M = D(
|
|
2229
|
-
() => t.value.template.pages.flatMap(
|
|
2230
|
-
(x, C) => x.components.flatMap(
|
|
2231
|
-
(P, L) => P.kind === "list" ? [{ component: P, pageIndex: C, componentIndex: L }] : []
|
|
2232
|
-
)
|
|
2233
|
-
)
|
|
2234
|
-
), f = D(
|
|
2235
|
-
() => M.value[a.value]?.component
|
|
2236
|
-
), p = D(() => {
|
|
2237
|
-
const x = f.value;
|
|
2238
|
-
if (!x) return [];
|
|
2239
|
-
const C = x.columns.map(
|
|
2240
|
-
(P) => P.headerStyle?.align ?? P.headerAlign ?? x.headerStyle?.align ?? x.headerAlign ?? P.style?.align ?? "center"
|
|
2241
|
-
);
|
|
2242
|
-
if (x.headerGrid && d())
|
|
2243
|
-
for (const P of Ee(x.headerGrid, x.widthMm, 100).cells)
|
|
2244
|
-
for (let L = P.ci; L < P.ci + (P.cell.colSpan ?? 1); L++)
|
|
2245
|
-
C[L] = P.cell.style?.align ?? "left";
|
|
2246
|
-
return C;
|
|
2247
|
-
}), k = D(() => {
|
|
2248
|
-
const x = s.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
|
|
2249
|
-
return (f.value?.columns ?? []).flatMap((C, P) => {
|
|
2250
|
-
const L = `${C.header} ${C.field}`.toLocaleLowerCase();
|
|
2251
|
-
return x.every((F) => L.includes(F)) ? [{ column: C, index: P }] : [];
|
|
2252
|
-
});
|
|
2253
|
-
});
|
|
2254
|
-
function E(x, C) {
|
|
2255
|
-
v.value = C ? [.../* @__PURE__ */ new Set([...v.value, x])] : v.value.filter((P) => P !== x);
|
|
2256
|
-
}
|
|
2257
|
-
function S(x) {
|
|
2258
|
-
for (const C of k.value) E(C.index, x);
|
|
2259
|
-
}
|
|
2260
|
-
function I() {
|
|
2261
|
-
v.value = [];
|
|
2262
|
-
}
|
|
2263
|
-
function w(x, C, P) {
|
|
2264
|
-
if (!o()) return;
|
|
2265
|
-
const L = M.value[a.value];
|
|
2266
|
-
if ((C === "widthMm" || C === "hidden") && L && t.value.template.pages[L.pageIndex]?.flow) return;
|
|
2267
|
-
const F = f.value?.columns[x];
|
|
2268
|
-
F && (C === "hidden" && P === !0 && !f.value?.columns.some(
|
|
2269
|
-
(G, j) => j !== x && !G.hidden
|
|
2270
|
-
) || (Object.assign(F, { [C]: C === "widthMm" ? Number(P) : P }), C === "header" && $(x, String(P)), C === "headerAlign" && u(
|
|
2271
|
-
x,
|
|
2272
|
-
P
|
|
2273
|
-
), C === "widthMm" && g(), i()));
|
|
2274
|
-
}
|
|
2275
|
-
function g() {
|
|
2276
|
-
const x = M.value[a.value];
|
|
2277
|
-
if (!x) return;
|
|
2278
|
-
const C = x.component, P = t.value.template.pages[x.pageIndex], L = C.columns.map((F) => F.widthMm);
|
|
2279
|
-
C.headerGrid && (C.headerGrid.colWidthsMm = L), P.layout === "wide" && L.every((F) => Number.isFinite(F) && F > 0) && (C.widthMm = L.reduce((F, G) => F + G, 0), P.widthMm = Math.max(
|
|
2280
|
-
...P.components.map(
|
|
2281
|
-
(F) => F.leftMm + F.widthMm
|
|
2282
|
-
)
|
|
2283
|
-
) + (P.marginRightMm ?? 0));
|
|
2284
|
-
}
|
|
2285
|
-
function $(x, C) {
|
|
2286
|
-
const P = f.value;
|
|
2287
|
-
if (!P?.headerGrid) return;
|
|
2288
|
-
const F = Ee(P.headerGrid, P.widthMm, 100).cells.filter(({ ci: G, cell: j }) => G <= x && G + (j.colSpan ?? 1) > x).slice(-1)[0];
|
|
2289
|
-
F && (Object.assign(F.cell, { text: C, rawText: C, value: C }), P.columns.slice(F.ci, F.ci + (F.cell.colSpan ?? 1)).forEach((G) => {
|
|
2290
|
-
G.header = C;
|
|
2291
|
-
}));
|
|
2292
|
-
}
|
|
2293
|
-
function u(x, C) {
|
|
2294
|
-
const P = f.value, L = P?.columns[x];
|
|
2295
|
-
if (L?.headerStyle?.align !== void 0 && (L.headerStyle = { ...L.headerStyle, align: C }), !P?.headerGrid) return;
|
|
2296
|
-
const G = Ee(P.headerGrid, P.widthMm, 100).cells.filter(({ ci: j, cell: te }) => j <= x && j + (te.colSpan ?? 1) > x).slice(-1)[0];
|
|
2297
|
-
G && (G.cell.style = { ...G.cell.style, align: C }, P.columns.slice(G.ci, G.ci + (G.cell.colSpan ?? 1)).forEach((j) => {
|
|
2298
|
-
j.headerAlign = C, j.headerStyle?.align !== void 0 && (j.headerStyle = { ...j.headerStyle, align: C });
|
|
2299
|
-
}));
|
|
2300
|
-
}
|
|
2301
|
-
function y(x, C) {
|
|
2302
|
-
if (!(!o() || x === "headerAlign" && C === "auto")) {
|
|
2303
|
-
for (const P of v.value) {
|
|
2304
|
-
const L = f.value?.columns[P];
|
|
2305
|
-
L && (Object.assign(L, { [x]: C }), x === "headerAlign" && u(
|
|
2306
|
-
P,
|
|
2307
|
-
C
|
|
2308
|
-
));
|
|
2309
|
-
}
|
|
2310
|
-
i();
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
return {
|
|
2314
|
-
selected: a,
|
|
2315
|
-
query: s,
|
|
2316
|
-
selectedColumns: v,
|
|
2317
|
-
lists: M,
|
|
2318
|
-
activeList: f,
|
|
2319
|
-
headerAlignments: p,
|
|
2320
|
-
visibleColumns: k,
|
|
2321
|
-
toggleColumn: E,
|
|
2322
|
-
selectVisible: S,
|
|
2323
|
-
clearSelection: I,
|
|
2324
|
-
setColumn: w,
|
|
2325
|
-
alignColumns: y
|
|
2326
|
-
};
|
|
2327
|
-
}
|
|
2328
|
-
function Re(t) {
|
|
2329
|
-
return t.kind === "snapshot" ? t.value.length * 2 : (t.removed.length + t.inserted.length) * 2 + 16;
|
|
2330
|
-
}
|
|
2331
|
-
function ro(t, d, o = !1) {
|
|
2332
|
-
const i = { kind: "snapshot", value: d };
|
|
2333
|
-
if (o) return i;
|
|
2334
|
-
let a = 0;
|
|
2335
|
-
const s = Math.min(t.length, d.length);
|
|
2336
|
-
for (; a < s && t.charCodeAt(a) === d.charCodeAt(a); ) a++;
|
|
2337
|
-
let v = t.length, M = d.length;
|
|
2338
|
-
for (; v > a && M > a && t.charCodeAt(v - 1) === d.charCodeAt(M - 1); )
|
|
2339
|
-
v--, M--;
|
|
2340
|
-
const f = { kind: "patch", start: a, removed: t.slice(a, v), inserted: d.slice(a, M) };
|
|
2341
|
-
return Re(f) < Re(i) ? f : i;
|
|
2342
|
-
}
|
|
2343
|
-
function je(t, d, o = !1) {
|
|
2344
|
-
if (d.kind === "snapshot") return d.value;
|
|
2345
|
-
const i = o ? d.inserted : d.removed, a = o ? d.removed : d.inserted;
|
|
2346
|
-
return t.slice(0, d.start) + a + t.slice(d.start + i.length);
|
|
2347
|
-
}
|
|
2348
|
-
function uo(t, d = { entries: 100, bytes: 16 * 1024 * 1024 }) {
|
|
2349
|
-
if (![d.entries, d.bytes].every((w) => Number.isSafeInteger(w) && w > 0)) throw new RangeError("History budgets must be positive safe integers");
|
|
2350
|
-
const o = Mt([{ kind: "snapshot", value: t }]), i = W(0), a = W(t), s = D(() => i.value > 0), v = D(() => i.value + 1 < o.value.length), M = D(() => a.value), f = D(() => o.value.reduce((w, g) => w + Re(g), 0));
|
|
2351
|
-
function p(w) {
|
|
2352
|
-
o.value = [{ kind: "snapshot", value: w }], i.value = 0, a.value = w;
|
|
2353
|
-
}
|
|
2354
|
-
function k(w) {
|
|
2355
|
-
let g = w;
|
|
2356
|
-
for (; g > 0 && o.value[g].kind !== "snapshot"; ) g--;
|
|
2357
|
-
let $ = "";
|
|
2358
|
-
for (; g <= w; g++) $ = je($, o.value[g]);
|
|
2359
|
-
return $;
|
|
2360
|
-
}
|
|
2361
|
-
function E(w) {
|
|
2362
|
-
let g = w.reduce(($, u) => $ + Re(u), 0);
|
|
2363
|
-
for (; w.length > 1 && (w.length > d.entries || g > d.bytes); ) {
|
|
2364
|
-
const $ = w[0], u = w[1], y = { kind: "snapshot", value: je($.value, u) };
|
|
2365
|
-
g += Re(y) - Re($) - Re(u), w.splice(0, 2, y);
|
|
2366
|
-
}
|
|
2367
|
-
return w;
|
|
2368
|
-
}
|
|
2369
|
-
function S(w) {
|
|
2370
|
-
if (a.value === w) return;
|
|
2371
|
-
const g = o.value.slice(0, i.value + 1);
|
|
2372
|
-
g.push(ro(a.value, w, g.length % 20 === 0)), o.value = E(g), i.value = o.value.length - 1, a.value = w;
|
|
2373
|
-
}
|
|
2374
|
-
function I(w) {
|
|
2375
|
-
if (w < 0 ? !s.value : !v.value) return;
|
|
2376
|
-
const g = o.value[i.value];
|
|
2377
|
-
return w < 0 && g.kind === "patch" ? a.value = je(a.value, g, !0) : w > 0 ? a.value = je(a.value, o.value[i.value + 1]) : a.value = k(i.value - 1), i.value += w, a.value;
|
|
2378
|
-
}
|
|
2379
|
-
return { canUndo: s, canRedo: v, current: M, retainedBytes: f, reset: p, record: S, move: I };
|
|
2380
|
-
}
|
|
2381
|
-
function co(t) {
|
|
2382
|
-
const d = Mt(null), o = W(!1);
|
|
2383
|
-
let i, a = 0;
|
|
2384
|
-
function s(f) {
|
|
2385
|
-
i?.(f), i = void 0, d.value = null;
|
|
2386
|
-
}
|
|
2387
|
-
function v() {
|
|
2388
|
-
a++, s(!1), o.value = !1;
|
|
2389
|
-
}
|
|
2390
|
-
async function M(f) {
|
|
2391
|
-
v();
|
|
2392
|
-
const p = a, k = t();
|
|
2393
|
-
o.value = !0;
|
|
2394
|
-
try {
|
|
2395
|
-
const E = await new Promise((S, I) => {
|
|
2396
|
-
if (i = S, !k) {
|
|
2397
|
-
d.value = f;
|
|
2398
|
-
return;
|
|
2399
|
-
}
|
|
2400
|
-
Promise.resolve().then(() => a === p ? k(f) : !1).then((w) => {
|
|
2401
|
-
a === p && s(w === !0);
|
|
2402
|
-
}, (w) => {
|
|
2403
|
-
a === p && (i = void 0, d.value = null, I(w));
|
|
2404
|
-
});
|
|
2405
|
-
});
|
|
2406
|
-
return a === p && E === !0;
|
|
2407
|
-
} finally {
|
|
2408
|
-
a === p && (o.value = !1);
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
return He(v), { confirmation: d, pending: o, decide: s, request: M, cancel: v };
|
|
2412
|
-
}
|
|
2413
|
-
function mo(t, d) {
|
|
2414
|
-
const o = W(de(t.modelValue)), i = W(_e(o.value)), a = W(_e(o.value)), s = W(""), v = W(!1), M = D(() => ({
|
|
2415
|
-
...Pe,
|
|
2416
|
-
...t.messages
|
|
2417
|
-
})), f = D(() => ({
|
|
2418
|
-
showExport: !1,
|
|
2419
|
-
showPrint: !1,
|
|
2420
|
-
showPdfWindow: !1,
|
|
2421
|
-
...t.preview,
|
|
2422
|
-
theme: {
|
|
2423
|
-
shellBg: "#f1f5f9",
|
|
2424
|
-
shellFg: "#334155",
|
|
2425
|
-
toolbarBg: "#ffffff",
|
|
2426
|
-
toolbarBorder: "#e2e8f0",
|
|
2427
|
-
toolbarFg: "#334155",
|
|
2428
|
-
btnFg: "#475569",
|
|
2429
|
-
btnBorder: "#cbd5e1",
|
|
2430
|
-
btnHoverBg: "#eff6ff",
|
|
2431
|
-
btnHoverFg: "#1d4ed8",
|
|
2432
|
-
btnActiveBg: "#2563eb",
|
|
2433
|
-
...t.preview?.theme
|
|
2434
|
-
}
|
|
2435
|
-
}));
|
|
2436
|
-
Ht({
|
|
2437
|
-
get defaults() {
|
|
2438
|
-
return f.value;
|
|
2439
|
-
}
|
|
2440
|
-
});
|
|
2441
|
-
let p, k = 0;
|
|
2442
|
-
const E = D(
|
|
2443
|
-
() => pt(o.value)
|
|
2444
|
-
), S = D(() => {
|
|
2445
|
-
try {
|
|
2446
|
-
return _e(o.value) !== i.value;
|
|
2447
|
-
} catch {
|
|
2448
|
-
return !0;
|
|
2449
|
-
}
|
|
2450
|
-
}), I = W(a.value), w = D(() => a.value !== I.value), g = W({}), $ = W(0), u = W(0), y = D(() => Object.values(g.value).some(Boolean)), x = D(() => Object.keys(g.value).filter((q) => g.value[q]));
|
|
2451
|
-
function C(q, Y) {
|
|
2452
|
-
g.value = { ...g.value, [q]: Y }, $.value++;
|
|
2453
|
-
}
|
|
2454
|
-
const P = D(
|
|
2455
|
-
() => S.value || a.value !== I.value || y.value
|
|
2456
|
-
), L = () => JSON.stringify({
|
|
2457
|
-
document: o.value,
|
|
2458
|
-
json: a.value,
|
|
2459
|
-
appliedJson: I.value
|
|
2460
|
-
}), F = uo(L()), G = co(() => t.beforeDiscard), j = D(() => v.value || G.pending.value), te = () => !t.readonly && !j.value && !w.value, se = so(
|
|
2461
|
-
o,
|
|
2462
|
-
() => E.value.ok,
|
|
2463
|
-
te,
|
|
2464
|
-
J
|
|
2465
|
-
), { selected: r, lists: O, activeList: V, headerAlignments: B, setColumn: Q } = se;
|
|
2466
|
-
le(r, () => se.clearSelection());
|
|
2467
|
-
const _ = D(
|
|
2468
|
-
() => E.value.ok ? Ft({
|
|
2469
|
-
draft: {
|
|
2470
|
-
template: o.value.template,
|
|
2471
|
-
datasets: t.datasets ?? {},
|
|
2472
|
-
params: []
|
|
2473
|
-
}
|
|
2474
|
-
}) : void 0
|
|
2475
|
-
);
|
|
2476
|
-
function R() {
|
|
2477
|
-
k++, p?.abort(), p = void 0, v.value = !1;
|
|
2478
|
-
}
|
|
2479
|
-
let T = 0;
|
|
2480
|
-
async function z(q = "replace", Y) {
|
|
2481
|
-
if (!P.value) return !0;
|
|
2482
|
-
const ae = L(), ye = $.value;
|
|
2483
|
-
try {
|
|
2484
|
-
return await G.request({
|
|
2485
|
-
reason: q,
|
|
2486
|
-
document: JSON.parse(
|
|
2487
|
-
JSON.stringify(o.value)
|
|
2488
|
-
),
|
|
2489
|
-
replacement: Y ? de(Y) : void 0,
|
|
2490
|
-
pendingLocalChanges: !0
|
|
2491
|
-
}) && ae === L() && ye === $.value;
|
|
2492
|
-
} catch (Z) {
|
|
2493
|
-
return s.value = Z instanceof Error ? Z.message : String(Z), !1;
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
function N(q) {
|
|
2497
|
-
R(), o.value = q, i.value = _e(q), a.value = i.value, I.value = a.value, s.value = "", r.value = 0, se.clearSelection(), g.value = {}, $.value++, u.value++, F.reset(L());
|
|
2498
|
-
}
|
|
2499
|
-
le(
|
|
2500
|
-
() => t.modelValue,
|
|
2501
|
-
async (q) => {
|
|
2502
|
-
let Y;
|
|
2503
|
-
try {
|
|
2504
|
-
Y = de(q);
|
|
2505
|
-
} catch (ye) {
|
|
2506
|
-
s.value = ye instanceof Error ? ye.message : String(ye);
|
|
2507
|
-
return;
|
|
2508
|
-
}
|
|
2509
|
-
try {
|
|
2510
|
-
if (_e(Y) === _e(o.value))
|
|
2511
|
-
return;
|
|
2512
|
-
} catch {
|
|
2513
|
-
}
|
|
2514
|
-
const ae = ++T;
|
|
2515
|
-
if (R(), !await z("replace", Y)) {
|
|
2516
|
-
ae === T && E.value.ok && d("update:modelValue", de(o.value));
|
|
2517
|
-
return;
|
|
2518
|
-
}
|
|
2519
|
-
ae === T && N(Y);
|
|
2520
|
-
}
|
|
2521
|
-
), He(() => {
|
|
2522
|
-
T++, R();
|
|
2523
|
-
});
|
|
2524
|
-
function J() {
|
|
2525
|
-
G.cancel(), s.value = "", E.value.ok && (a.value = _e(o.value), I.value = a.value, d("update:modelValue", de(o.value))), F.record(L());
|
|
2526
|
-
}
|
|
2527
|
-
function ie(q) {
|
|
2528
|
-
if (!te()) return !1;
|
|
2529
|
-
try {
|
|
2530
|
-
const Y = de(o.value);
|
|
2531
|
-
q(Y);
|
|
2532
|
-
const ae = pt(Y);
|
|
2533
|
-
if (!ae.ok)
|
|
2534
|
-
throw new Error(
|
|
2535
|
-
ae.errors.map((ye) => `${ye.path}: ${ye.message}`).join(`
|
|
2536
|
-
`)
|
|
2537
|
-
);
|
|
2538
|
-
return o.value = Y, J(), !0;
|
|
2539
|
-
} catch (Y) {
|
|
2540
|
-
return s.value = Y instanceof Error ? Y.message : String(Y), !1;
|
|
2541
|
-
}
|
|
2542
|
-
}
|
|
2543
|
-
async function ne(q) {
|
|
2544
|
-
if (!te()) return !1;
|
|
2545
|
-
try {
|
|
2546
|
-
const Y = de(q);
|
|
2547
|
-
return !await z("replace", Y) || !te() ? !1 : (o.value = Y, r.value = 0, se.clearSelection(), J(), !0);
|
|
2548
|
-
} catch (Y) {
|
|
2549
|
-
return s.value = Y instanceof Error ? Y.message : String(Y), !1;
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
function fe(q) {
|
|
2553
|
-
te() && (o.value.name = q, J());
|
|
2554
|
-
}
|
|
2555
|
-
function me(q) {
|
|
2556
|
-
te() && (o.value.description = q, J());
|
|
2557
|
-
}
|
|
2558
|
-
function pe() {
|
|
2559
|
-
if (!(t.readonly || j.value))
|
|
2560
|
-
try {
|
|
2561
|
-
const q = de(a.value);
|
|
2562
|
-
if (q.id !== o.value.id)
|
|
2563
|
-
throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
|
|
2564
|
-
if (q.revision !== o.value.revision)
|
|
2565
|
-
throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
|
|
2566
|
-
o.value = q, r.value = 0, se.clearSelection(), J();
|
|
2567
|
-
} catch (q) {
|
|
2568
|
-
s.value = q instanceof Error ? q.message : String(q);
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
async function oe() {
|
|
2572
|
-
j.value || t.readonly || !await z("reset") || (N(de(i.value)), d("update:modelValue", de(o.value)));
|
|
2573
|
-
}
|
|
2574
|
-
function ge(q) {
|
|
2575
|
-
if (j.value || t.readonly) return;
|
|
2576
|
-
F.record(L());
|
|
2577
|
-
const Y = F.move(q);
|
|
2578
|
-
if (!Y) return;
|
|
2579
|
-
G.cancel();
|
|
2580
|
-
const ae = JSON.parse(Y);
|
|
2581
|
-
o.value = ae.document, a.value = ae.json, I.value = ae.appliedJson, s.value = "", r.value = 0, se.clearSelection(), E.value.ok && d("update:modelValue", de(o.value));
|
|
2582
|
-
}
|
|
2583
|
-
async function Ye() {
|
|
2584
|
-
if (!t.save || !te() || !E.value.ok) return;
|
|
2585
|
-
if (y.value) {
|
|
2586
|
-
s.value = M.value.toolsPending;
|
|
2587
|
-
return;
|
|
2588
|
-
}
|
|
2589
|
-
const q = ++k;
|
|
2590
|
-
p = new AbortController(), v.value = !0, s.value = "";
|
|
2591
|
-
const Y = de(o.value);
|
|
2592
|
-
try {
|
|
2593
|
-
const ae = de(
|
|
2594
|
-
await t.save(Y, {
|
|
2595
|
-
expectedRevision: Y.revision,
|
|
2596
|
-
signal: p.signal
|
|
2597
|
-
})
|
|
2598
|
-
);
|
|
2599
|
-
if (q !== k) return;
|
|
2600
|
-
if (ae.id !== Y.id)
|
|
2601
|
-
throw new Error("保存服务返回了其他模板的文档");
|
|
2602
|
-
o.value = ae, i.value = _e(ae), a.value = i.value, I.value = a.value, F.reset(L()), d("saved", de(ae)), d("update:modelValue", de(ae));
|
|
2603
|
-
} catch (ae) {
|
|
2604
|
-
q === k && (s.value = ae instanceof Error ? ae.message : String(ae));
|
|
2605
|
-
} finally {
|
|
2606
|
-
q === k && (v.value = !1, p = void 0);
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
const Oe = D(
|
|
2610
|
-
() => F.canUndo.value || L() !== F.current.value
|
|
2611
|
-
), Xe = D(
|
|
2612
|
-
() => F.canRedo.value && L() === F.current.value
|
|
2613
|
-
);
|
|
2614
|
-
return {
|
|
2615
|
-
...se,
|
|
2616
|
-
editingReadonly: D(() => t.readonly === !0),
|
|
2617
|
-
transaction: ie,
|
|
2618
|
-
replaceDocument: ne,
|
|
2619
|
-
originalDocument: D(() => de(i.value)),
|
|
2620
|
-
canUndo: Oe,
|
|
2621
|
-
canRedo: Xe,
|
|
2622
|
-
undo: () => ge(-1),
|
|
2623
|
-
redo: () => ge(1),
|
|
2624
|
-
pendingLocalChanges: P,
|
|
2625
|
-
setToolPending: C,
|
|
2626
|
-
isToolPending: (q) => g.value[q] === !0,
|
|
2627
|
-
toolEpoch: u,
|
|
2628
|
-
toolPending: y,
|
|
2629
|
-
pendingTools: x,
|
|
2630
|
-
jsonPending: w,
|
|
2631
|
-
blocked: j,
|
|
2632
|
-
confirmation: G.confirmation,
|
|
2633
|
-
decideDiscard: G.decide,
|
|
2634
|
-
guardChanges: z,
|
|
2635
|
-
draft: o,
|
|
2636
|
-
json: a,
|
|
2637
|
-
selected: r,
|
|
2638
|
-
error: s,
|
|
2639
|
-
saving: v,
|
|
2640
|
-
dirty: S,
|
|
2641
|
-
validation: E,
|
|
2642
|
-
lists: O,
|
|
2643
|
-
activeList: V,
|
|
2644
|
-
headerAlignments: B,
|
|
2645
|
-
previewOptions: f,
|
|
2646
|
-
fetcher: _,
|
|
2647
|
-
messages: M,
|
|
2648
|
-
setName: fe,
|
|
2649
|
-
setDescription: me,
|
|
2650
|
-
setColumn: Q,
|
|
2651
|
-
applyJson: pe,
|
|
2652
|
-
reset: oe,
|
|
2653
|
-
save: Ye
|
|
2654
|
-
};
|
|
2655
|
-
}
|
|
2656
|
-
function vo(t, d) {
|
|
2657
|
-
const o = W(d.value ? "fields" : "component"), i = () => d.value?.columns.length ? 0 : -1, a = W(i()), s = D(() => {
|
|
2658
|
-
const f = d.value?.columns[a.value];
|
|
2659
|
-
return f ? { column: f, index: a.value } : void 0;
|
|
2660
|
-
});
|
|
2661
|
-
le(t, () => {
|
|
2662
|
-
a.value = i();
|
|
2663
|
-
}), le(d, (f) => {
|
|
2664
|
-
f?.columns[a.value] || (a.value = i()), !f && o.value === "fields" && (o.value = "component");
|
|
2665
|
-
});
|
|
2666
|
-
function v(f) {
|
|
2667
|
-
d.value?.columns[f] && (a.value = f);
|
|
2668
|
-
}
|
|
2669
|
-
function M(f) {
|
|
2670
|
-
const p = d.value?.columns.length ?? 0;
|
|
2671
|
-
p && (a.value = Math.max(
|
|
2672
|
-
0,
|
|
2673
|
-
Math.min(p - 1, a.value + f)
|
|
2674
|
-
));
|
|
2675
|
-
}
|
|
2676
|
-
return { section: o, activeIndex: a, activeColumn: s, activate: v, stepColumn: M };
|
|
2677
|
-
}
|
|
2678
|
-
const po = ["aria-label", "aria-busy"], go = { class: "mr-designer-bar" }, ho = { class: "mr-designer-heading" }, fo = ["aria-label"], bo = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], yo = {
|
|
2679
|
-
key: 0,
|
|
2680
|
-
class: "mr-designer-pending-dot",
|
|
2681
|
-
"aria-hidden": "true"
|
|
2682
|
-
}, wo = ["aria-label"], Mo = ["aria-pressed"], ko = ["aria-pressed"], xo = { class: "mr-designer-actions" }, Co = { class: "mr-designer-history" }, $o = ["aria-label", "title", "disabled"], So = ["aria-label", "title", "disabled"], _o = ["disabled"], Io = ["title", "aria-describedby", "disabled"], Eo = ["id"], Po = ["id"], Ro = ["aria-label", "onClick"], To = ["aria-label"], Lo = ["aria-label"], Do = ["id", "aria-pressed", "aria-describedby", "onClick"], Ao = {
|
|
2683
|
-
key: 0,
|
|
2684
|
-
class: "mr-designer-pending-dot",
|
|
2685
|
-
"aria-hidden": "true"
|
|
2686
|
-
}, Ho = { class: "mr-designer-tool-content" }, Fo = {
|
|
2687
|
-
key: 3,
|
|
2688
|
-
class: "mr-designer-rule-workspace"
|
|
2689
|
-
}, No = { key: 0 }, Go = ["value"], Oo = ["value"], Bo = {
|
|
2690
|
-
key: 2,
|
|
2691
|
-
class: "mr-designer-note"
|
|
2692
|
-
}, zo = {
|
|
2693
|
-
key: 1,
|
|
2694
|
-
class: "mr-designer-inspector"
|
|
2695
|
-
}, jo = ["id", "aria-labelledby"], Vo = {
|
|
2696
|
-
key: 0,
|
|
2697
|
-
class: "mr-designer-flow-note"
|
|
2698
|
-
}, Wo = {
|
|
2699
|
-
key: 0,
|
|
2700
|
-
class: "mr-designer-area"
|
|
2701
|
-
}, Uo = ["value"], Ko = ["value"], Jo = { class: "mr-designer-current" }, qo = ["aria-expanded", "aria-controls"], Yo = { class: "mr-designer-current-name" }, Xo = { class: "mr-designer-directory-entry" }, Zo = { class: "mr-designer-field-position" }, Qo = ["aria-label"], ei = ["aria-label", "title", "disabled"], ti = ["aria-label", "title", "disabled"], ni = ["disabled", "aria-label"], ai = { class: "mr-designer-property-group" }, li = ["value"], oi = ["value", "list"], ii = ["id"], si = ["value"], ri = { class: "mr-designer-property-group" }, di = { class: "mr-designer-format-pair" }, ui = { class: "mr-designer-stacked" }, ci = ["value", "disabled"], mi = { class: "mr-designer-stacked" }, vi = ["value"], pi = { value: "identifier" }, gi = { value: "dimension" }, hi = { value: "measure" }, fi = { value: "date" }, bi = { value: "text" }, yi = { class: "mr-designer-control-row" }, wi = { class: "mr-designer-control-row" }, Mi = { class: "mr-designer-toggle" }, ki = ["checked"], xi = { class: "mr-designer-column-structure" }, Ci = ["aria-label", "title", "disabled"], $i = ["aria-label", "title", "disabled"], Si = ["checked", "disabled"], _i = ["id", "aria-label"], Ii = { class: "mr-designer-directory-heading" }, Ei = ["aria-label"], Pi = { class: "mr-designer-search" }, Ri = ["aria-label", "placeholder"], Ti = ["aria-label", "title"], Li = { class: "mr-designer-column-tools" }, Di = ["disabled"], Ai = {
|
|
2702
|
-
key: 1,
|
|
2703
|
-
role: "status"
|
|
2704
|
-
}, Hi = { key: 2 }, Fi = ["aria-label"], Ni = ["aria-label", "checked", "disabled", "onChange"], Gi = ["data-column-index", "aria-pressed", "tabindex", "onClick"], Oi = { class: "mr-designer-column-number" }, Bi = { class: "mr-designer-column-name" }, zi = {
|
|
2705
|
-
key: 0,
|
|
2706
|
-
role: "status",
|
|
2707
|
-
class: "mr-designer-empty"
|
|
2708
|
-
}, ji = {
|
|
2709
|
-
key: 0,
|
|
2710
|
-
class: "mr-designer-batch"
|
|
2711
|
-
}, Vi = ["aria-label", "disabled"], Wi = { value: "" }, Ui = { value: "auto" }, Ki = { value: "left" }, Ji = { value: "center" }, qi = { value: "right" }, Yi = { value: "justify" }, Xi = ["aria-label", "disabled"], Zi = { value: "" }, Qi = { value: "left" }, es = { value: "center" }, ts = { value: "right" }, ns = { value: "justify" }, as = {
|
|
2712
|
-
key: 2,
|
|
2713
|
-
role: "status",
|
|
2714
|
-
class: "mr-designer-empty"
|
|
2715
|
-
}, ls = { class: "mr-designer-object-tools" }, os = ["aria-label", "disabled"], is = { value: "" }, ss = { value: "text" }, rs = ["disabled"], ds = { value: "image" }, us = { value: "rect" }, cs = { value: "qrcode" }, ms = { value: "barcode" }, vs = ["title", "aria-label", "disabled"], ps = ["title", "aria-label", "disabled"], gs = { key: 0 }, hs = ["value"], fs = { class: "mr-designer-stacked" }, bs = ["value"], ys = {
|
|
2716
|
-
value: -1,
|
|
2717
|
-
disabled: ""
|
|
2718
|
-
}, ws = ["value"], Ms = {
|
|
2719
|
-
key: 1,
|
|
2720
|
-
class: "mr-designer-arrange"
|
|
2721
|
-
}, ks = ["disabled"], xs = ["aria-label", "disabled"], Cs = { value: "" }, $s = { value: "left" }, Ss = { value: "center" }, _s = { value: "right" }, Is = { value: "top" }, Es = { value: "middle" }, Ps = { value: "bottom" }, Rs = ["disabled"], Ts = ["disabled"], Ls = { key: 0 }, Ds = { class: "mr-designer-layer-tools" }, As = ["disabled"], Hs = ["disabled"], Fs = {
|
|
2722
|
-
key: 3,
|
|
2723
|
-
class: "mr-designer-empty"
|
|
2724
|
-
}, Ns = { class: "mr-designer-stacked" }, Gs = ["value", "disabled"], Os = { class: "mr-designer-stacked" }, Bs = ["value", "disabled"], zs = { class: "mr-designer-technical" }, js = { class: "mr-designer-identity" }, Vs = { class: "mr-designer-stacked mr-designer-json-label" }, Ws = ["aria-label", "disabled"], Us = ["disabled"], Ks = {
|
|
2725
|
-
key: 5,
|
|
2726
|
-
role: "status",
|
|
2727
|
-
class: "mr-designer-note mr-designer-pending"
|
|
2728
|
-
}, Js = ["aria-label"], qs = {
|
|
2729
|
-
key: 0,
|
|
2730
|
-
role: "alert",
|
|
2731
|
-
class: "mr-designer-error"
|
|
2732
|
-
}, Ys = {
|
|
2733
|
-
key: 1,
|
|
2734
|
-
role: "alert",
|
|
2735
|
-
class: "mr-designer-error"
|
|
2736
|
-
}, Xs = {
|
|
2737
|
-
key: 4,
|
|
2738
|
-
class: "mr-designer-note mr-designer-invalid"
|
|
2739
|
-
}, Zs = /* @__PURE__ */ Ce({
|
|
2740
|
-
__name: "ReportTemplateEditor",
|
|
2741
|
-
props: {
|
|
2742
|
-
modelValue: {},
|
|
2743
|
-
datasets: {},
|
|
2744
|
-
dataSchemas: {},
|
|
2745
|
-
bindingDatasets: {},
|
|
2746
|
-
bindingSession: {},
|
|
2747
|
-
readonly: { type: Boolean },
|
|
2748
|
-
messages: {},
|
|
2749
|
-
preview: {},
|
|
2750
|
-
beforeDiscard: { type: Function },
|
|
2751
|
-
save: { type: Function }
|
|
2752
|
-
},
|
|
2753
|
-
emits: ["update:modelValue", "saved", "excel-bound"],
|
|
2754
|
-
setup(t, { expose: d, emit: o }) {
|
|
2755
|
-
const i = Me(
|
|
2756
|
-
() => import("./ExcelBindingWizard-CeAf4QSE.js")
|
|
2757
|
-
), a = Me(() => import("./ParamEditor-BLaE5q5W.js")), s = Me(() => import("./RuleEditor-DzAmW5YH.js")), v = Me(
|
|
2758
|
-
() => import("./TemplateReviewPanel-BKofGrV9.js")
|
|
2759
|
-
), M = t, f = o, p = mo(M, (U, b) => {
|
|
2760
|
-
f(U === "saved" ? "saved" : "update:modelValue", b);
|
|
2761
|
-
}), {
|
|
2762
|
-
draft: k,
|
|
2763
|
-
json: E,
|
|
2764
|
-
selected: S,
|
|
2765
|
-
error: I,
|
|
2766
|
-
saving: w,
|
|
2767
|
-
pendingLocalChanges: g,
|
|
2768
|
-
jsonPending: $,
|
|
2769
|
-
blocked: u,
|
|
2770
|
-
confirmation: y,
|
|
2771
|
-
canUndo: x,
|
|
2772
|
-
canRedo: C,
|
|
2773
|
-
validation: P,
|
|
2774
|
-
lists: L,
|
|
2775
|
-
activeList: F,
|
|
2776
|
-
visibleColumns: G,
|
|
2777
|
-
query: j,
|
|
2778
|
-
selectedColumns: te,
|
|
2779
|
-
fetcher: se,
|
|
2780
|
-
messages: r
|
|
2781
|
-
} = p;
|
|
2782
|
-
function O(U) {
|
|
2783
|
-
return p.transaction((b) => {
|
|
2784
|
-
b.template.params = U;
|
|
2785
|
-
});
|
|
2786
|
-
}
|
|
2787
|
-
const V = vo(S, F), { section: B, activeIndex: Q, activeColumn: _ } = V, R = `mr-designer-${st()?.uid ?? 0}`, T = D(() => [
|
|
2788
|
-
...L.value.length ? ["fields"] : [],
|
|
2789
|
-
"component",
|
|
2790
|
-
"template",
|
|
2791
|
-
"tools",
|
|
2792
|
-
"advanced"
|
|
2793
|
-
]), z = lo(
|
|
2794
|
-
p,
|
|
2795
|
-
V,
|
|
2796
|
-
() => M.dataSchemas
|
|
2797
|
-
), {
|
|
2798
|
-
mode: N,
|
|
2799
|
-
setMode: J,
|
|
2800
|
-
canvasSelection: ie,
|
|
2801
|
-
canvasPage: ne,
|
|
2802
|
-
canvasActive: fe,
|
|
2803
|
-
tool: me,
|
|
2804
|
-
visitedTools: pe,
|
|
2805
|
-
editDisabled: oe,
|
|
2806
|
-
dataSchema: ge,
|
|
2807
|
-
chooseCanvas: Ye,
|
|
2808
|
-
insertComponent: Oe,
|
|
2809
|
-
patchCanvas: Xe,
|
|
2810
|
-
changeList: q,
|
|
2811
|
-
moveColumn: Y,
|
|
2812
|
-
headerCommand: ae,
|
|
2813
|
-
locateReview: ye,
|
|
2814
|
-
canvas: Z
|
|
2815
|
-
} = z, he = D(() => !!k.value.template.pages[ne.value]?.flow), xt = D(() => M.dataSchemas?.[k.value.template.repeat?.dataset ?? ""]);
|
|
2816
|
-
function Ct(U) {
|
|
2817
|
-
let b = ne.value;
|
|
2818
|
-
p.transaction((c) => {
|
|
2819
|
-
b = en(c, ne.value, U);
|
|
2820
|
-
}) && (U.type !== "patch" && (Z.clearLocks(), Z.selection.value = void 0, Z.selections.value = []), ne.value = b);
|
|
2821
|
-
}
|
|
2822
|
-
const Fe = D(() => !!k.value.template.pages[L.value[S.value]?.pageIndex ?? -1]?.flow);
|
|
2823
|
-
function $t() {
|
|
2824
|
-
B.value = "tools", me.value = "excel";
|
|
2825
|
-
}
|
|
2826
|
-
const De = D(() => {
|
|
2827
|
-
const U = ["excel", "rules", "params"].filter((b) => p.pendingTools.value.includes(b)).map((b) => ({ target: b, label: r.value[`${b}Tool`] }));
|
|
2828
|
-
return $.value && U.push({ target: "json", label: r.value.json }), U;
|
|
2829
|
-
}), Be = D(() => w.value ? r.value.saving : M.readonly ? r.value.saveReadonly : u.value ? r.value.saveConfirmation : De.value.length ? De.value.map((U) => `${U.label} · ${r.value.unapplied}`).join(";") : P.value.ok ? g.value ? "" : r.value.saveUnchanged : r.value.saveInvalid);
|
|
2830
|
-
async function St(U) {
|
|
2831
|
-
U === "json" ? B.value = "advanced" : (B.value = "tools", me.value = U), await ce();
|
|
2832
|
-
const b = U === "json" ? `#${R}-panel-advanced textarea` : `#${R}-tool-${U}`;
|
|
2833
|
-
document.querySelector(b)?.focus({ preventScroll: !0 });
|
|
2834
|
-
}
|
|
2835
|
-
const _t = D(
|
|
2836
|
-
() => w.value ? r.value.saving : M.readonly ? r.value.readonly : g.value ? r.value.dirty : r.value.ready
|
|
2837
|
-
), rt = W(null), Ze = W(null), ue = io(V, B, G), {
|
|
2838
|
-
open: dt,
|
|
2839
|
-
cursor: It,
|
|
2840
|
-
trigger: Et,
|
|
2841
|
-
panel: Pt,
|
|
2842
|
-
search: Rt,
|
|
2843
|
-
list: Tt
|
|
2844
|
-
} = ue;
|
|
2845
|
-
le(B, async () => {
|
|
2846
|
-
await ce(), Ze.value && (Ze.value.scrollTop = 0);
|
|
2847
|
-
});
|
|
2848
|
-
const ut = D(() => ({
|
|
2849
|
-
auto: r.value.auto,
|
|
2850
|
-
left: r.value.left,
|
|
2851
|
-
center: r.value.center,
|
|
2852
|
-
right: r.value.right,
|
|
2853
|
-
justify: r.value.justify
|
|
2854
|
-
}));
|
|
2855
|
-
let ze = null;
|
|
2856
|
-
le(y, async (U) => {
|
|
2857
|
-
U ? (ze = document.activeElement, await ce(), rt.value?.focus()) : (await ce(), ze?.isConnected && ze.focus(), ze = null);
|
|
2858
|
-
}), d({
|
|
2859
|
-
get pendingLocalChanges() {
|
|
2860
|
-
return g.value;
|
|
2861
|
-
},
|
|
2862
|
-
get saving() {
|
|
2863
|
-
return w.value;
|
|
2864
|
-
},
|
|
2865
|
-
get blocked() {
|
|
2866
|
-
return u.value;
|
|
2867
|
-
},
|
|
2868
|
-
guardChanges: p.guardChanges,
|
|
2869
|
-
reset: p.reset,
|
|
2870
|
-
save: p.save
|
|
2871
|
-
});
|
|
2872
|
-
async function Lt(U) {
|
|
2873
|
-
const b = { ...U.document, id: k.value.id };
|
|
2874
|
-
if (k.value.revision === void 0 ? delete b.revision : b.revision = k.value.revision, !await p.replaceDocument(b)) return !1;
|
|
2875
|
-
const c = de(p.draft.value);
|
|
2876
|
-
return f("excel-bound", { ...U, document: c, session: { ...U.session, identity: { id: c.id, name: c.name } } }), !0;
|
|
2877
|
-
}
|
|
2878
|
-
async function Qe(U) {
|
|
2879
|
-
const b = L.value.findIndex((c) => c.pageIndex === U.pageIndex && c.componentIndex === U.componentIndex);
|
|
2880
|
-
b >= 0 && b !== S.value && p.isToolPending("rules") && !await p.guardChanges() || Ye(U);
|
|
2881
|
-
}
|
|
2882
|
-
async function ct(U) {
|
|
2883
|
-
const b = U.target, c = Number(b.value);
|
|
2884
|
-
if (p.isToolPending("rules") && !await p.guardChanges()) {
|
|
2885
|
-
b.value = String(S.value);
|
|
2886
|
-
return;
|
|
2887
|
-
}
|
|
2888
|
-
S.value = c;
|
|
2889
|
-
}
|
|
2890
|
-
function Se(U) {
|
|
2891
|
-
return U.target.value;
|
|
2892
|
-
}
|
|
2893
|
-
function et(U) {
|
|
2894
|
-
return U.target.checked;
|
|
2895
|
-
}
|
|
2896
|
-
function mt(U, b) {
|
|
2897
|
-
const c = U.target;
|
|
2898
|
-
p.alignColumns(
|
|
2899
|
-
b,
|
|
2900
|
-
c.value
|
|
2901
|
-
), c.value = "";
|
|
2902
|
-
}
|
|
2903
|
-
async function Dt(U) {
|
|
2904
|
-
const c = {
|
|
2905
|
-
ArrowRight: 1,
|
|
2906
|
-
ArrowLeft: -1,
|
|
2907
|
-
Home: -T.value.length,
|
|
2908
|
-
End: T.value.length
|
|
2909
|
-
}[U.key];
|
|
2910
|
-
if (c === void 0) return;
|
|
2911
|
-
U.preventDefault();
|
|
2912
|
-
const X = T.value.indexOf(B.value), Ae = U.key === "Home" ? 0 : U.key === "End" ? T.value.length - 1 : (X + c + T.value.length) % T.value.length;
|
|
2913
|
-
B.value = T.value[Ae];
|
|
2914
|
-
const At = U.currentTarget.parentElement;
|
|
2915
|
-
await ce(), At?.querySelector(`#${R}-tab-${B.value}`)?.focus();
|
|
2916
|
-
}
|
|
2917
|
-
return (U, b) => (m(), h("section", {
|
|
2918
|
-
class: "mr-designer",
|
|
2919
|
-
"aria-label": e(r).title,
|
|
2920
|
-
"aria-busy": e(w)
|
|
2921
|
-
}, [
|
|
2922
|
-
n("header", go, [
|
|
2923
|
-
n("div", ho, [
|
|
2924
|
-
re(ve, {
|
|
2925
|
-
name: "columns",
|
|
2926
|
-
size: 15
|
|
2927
|
-
}),
|
|
2928
|
-
n("strong", null, l(e(r).heading), 1),
|
|
2929
|
-
n("span", {
|
|
2930
|
-
class: Te({ "mr-designer-dirty": e(g) })
|
|
2931
|
-
}, l(_t.value), 3)
|
|
2932
|
-
]),
|
|
2933
|
-
n("nav", {
|
|
2934
|
-
class: "mr-designer-tabs",
|
|
2935
|
-
role: "tablist",
|
|
2936
|
-
"aria-label": e(r).sectionsLabel
|
|
2937
|
-
}, [
|
|
2938
|
-
(m(!0), h(K, null, ee(T.value, (c) => (m(), h("button", {
|
|
2939
|
-
id: `${R}-tab-${c}`,
|
|
2940
|
-
key: c,
|
|
2941
|
-
type: "button",
|
|
2942
|
-
role: "tab",
|
|
2943
|
-
"aria-selected": e(B) === c,
|
|
2944
|
-
"aria-controls": `${R}-panel-${c}`,
|
|
2945
|
-
tabindex: e(B) === c ? 0 : -1,
|
|
2946
|
-
onClick: (X) => B.value = c,
|
|
2947
|
-
onKeydown: Dt
|
|
2948
|
-
}, [
|
|
2949
|
-
H(l(e(r)[`${c}Section`]) + " ", 1),
|
|
2950
|
-
c === "tools" && e(p).toolPending.value || c === "advanced" && e($) ? (m(), h("span", yo)) : A("", !0)
|
|
2951
|
-
], 40, bo))), 128))
|
|
2952
|
-
], 8, fo),
|
|
2953
|
-
n("div", {
|
|
2954
|
-
class: "mr-designer-mode",
|
|
2955
|
-
role: "group",
|
|
2956
|
-
"aria-label": e(r).design
|
|
2957
|
-
}, [
|
|
2958
|
-
n("button", {
|
|
2959
|
-
type: "button",
|
|
2960
|
-
"aria-pressed": e(N) === "design",
|
|
2961
|
-
onClick: b[0] || (b[0] = (c) => e(J)("design"))
|
|
2962
|
-
}, l(e(r).design), 9, Mo),
|
|
2963
|
-
n("button", {
|
|
2964
|
-
type: "button",
|
|
2965
|
-
"aria-pressed": e(N) === "preview",
|
|
2966
|
-
onClick: b[1] || (b[1] = (c) => e(J)("preview"))
|
|
2967
|
-
}, l(e(r).preview), 9, ko)
|
|
2968
|
-
], 8, wo),
|
|
2969
|
-
n("div", xo, [
|
|
2970
|
-
n("div", Co, [
|
|
2971
|
-
n("button", {
|
|
2972
|
-
type: "button",
|
|
2973
|
-
class: "mr-designer-icon-button",
|
|
2974
|
-
"aria-label": e(r).undo,
|
|
2975
|
-
title: e(r).undo,
|
|
2976
|
-
disabled: t.readonly || e(u) || !e(x),
|
|
2977
|
-
onClick: b[2] || (b[2] = (c) => {
|
|
2978
|
-
e(Z).clearLocks(), e(p).undo();
|
|
2979
|
-
})
|
|
2980
|
-
}, [...b[56] || (b[56] = [
|
|
2981
|
-
n("svg", {
|
|
2982
|
-
viewBox: "0 0 24 24",
|
|
2983
|
-
fill: "none",
|
|
2984
|
-
"aria-hidden": "true"
|
|
2985
|
-
}, [
|
|
2986
|
-
n("path", { d: "M4 10h10a6 6 0 0 1 0 12M4 10l5-5M4 10l5 5" })
|
|
2987
|
-
], -1)
|
|
2988
|
-
])], 8, $o),
|
|
2989
|
-
n("button", {
|
|
2990
|
-
type: "button",
|
|
2991
|
-
class: "mr-designer-icon-button",
|
|
2992
|
-
"aria-label": e(r).redo,
|
|
2993
|
-
title: e(r).redo,
|
|
2994
|
-
disabled: t.readonly || e(u) || !e(C),
|
|
2995
|
-
onClick: b[3] || (b[3] = (c) => {
|
|
2996
|
-
e(Z).clearLocks(), e(p).redo();
|
|
2997
|
-
})
|
|
2998
|
-
}, [...b[57] || (b[57] = [
|
|
2999
|
-
n("svg", {
|
|
3000
|
-
viewBox: "0 0 24 24",
|
|
3001
|
-
fill: "none",
|
|
3002
|
-
"aria-hidden": "true"
|
|
3003
|
-
}, [
|
|
3004
|
-
n("path", { d: "M20 10H10a6 6 0 0 0 0 12m10-12-5-5m5 5-5 5" })
|
|
3005
|
-
], -1)
|
|
3006
|
-
])], 8, So)
|
|
3007
|
-
]),
|
|
3008
|
-
n("button", {
|
|
3009
|
-
type: "button",
|
|
3010
|
-
class: "mr-designer-reset",
|
|
3011
|
-
disabled: t.readonly || e(u) || !e(g),
|
|
3012
|
-
onClick: b[4] || (b[4] = //@ts-ignore
|
|
3013
|
-
(...c) => e(p).reset && e(p).reset(...c))
|
|
3014
|
-
}, l(e(r).reset), 9, _o),
|
|
3015
|
-
t.save ? (m(), h("button", {
|
|
3016
|
-
key: 0,
|
|
3017
|
-
type: "button",
|
|
3018
|
-
class: "mr-designer-save",
|
|
3019
|
-
title: Be.value || e(r).save,
|
|
3020
|
-
"aria-describedby": De.value.length ? `${R}-pending` : Be.value ? `${R}-save-reason` : void 0,
|
|
3021
|
-
disabled: t.readonly || e(u) || e($) || e(p).toolPending.value || !e(P).ok || !e(g),
|
|
3022
|
-
onClick: b[5] || (b[5] = //@ts-ignore
|
|
3023
|
-
(...c) => e(p).save && e(p).save(...c))
|
|
3024
|
-
}, [
|
|
3025
|
-
re(ve, {
|
|
3026
|
-
name: "file",
|
|
3027
|
-
size: 13
|
|
3028
|
-
}),
|
|
3029
|
-
H(l(e(w) ? e(r).saving : e(r).save), 1)
|
|
3030
|
-
], 8, Io)) : A("", !0),
|
|
3031
|
-
t.save && Be.value && !De.value.length ? (m(), h("span", {
|
|
3032
|
-
key: 1,
|
|
3033
|
-
id: `${R}-save-reason`,
|
|
3034
|
-
class: "mr-designer-save-reason"
|
|
3035
|
-
}, l(Be.value), 9, Eo)) : A("", !0)
|
|
3036
|
-
])
|
|
3037
|
-
]),
|
|
3038
|
-
De.value.length ? (m(), h("div", {
|
|
3039
|
-
key: 0,
|
|
3040
|
-
id: `${R}-pending`,
|
|
3041
|
-
class: "mr-designer-pending",
|
|
3042
|
-
role: "status"
|
|
3043
|
-
}, [
|
|
3044
|
-
n("span", null, l(e(r).pendingToolsLabel), 1),
|
|
3045
|
-
(m(!0), h(K, null, ee(De.value, (c) => (m(), h("button", {
|
|
3046
|
-
key: c.target,
|
|
3047
|
-
type: "button",
|
|
3048
|
-
"aria-label": `${c.label} · ${e(r).unapplied} · ${e(r).returnToConfiguration}`,
|
|
3049
|
-
onClick: (X) => St(c.target)
|
|
3050
|
-
}, [
|
|
3051
|
-
H(l(c.label), 1),
|
|
3052
|
-
n("span", null, l(e(r).unapplied) + " ↗", 1)
|
|
3053
|
-
], 8, Ro))), 128)),
|
|
3054
|
-
n("small", null, l(e(r).pendingToolsHint), 1)
|
|
3055
|
-
], 8, Po)) : A("", !0),
|
|
3056
|
-
e(y) ? (m(), h("div", {
|
|
3057
|
-
key: 1,
|
|
3058
|
-
role: "alertdialog",
|
|
3059
|
-
"aria-label": e(r).discardTitle,
|
|
3060
|
-
class: "mr-designer-confirm",
|
|
3061
|
-
onKeydown: b[8] || (b[8] = tt(wt((c) => e(p).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
|
|
3062
|
-
}, [
|
|
3063
|
-
n("div", null, [
|
|
3064
|
-
n("strong", null, l(e(r).discardTitle), 1),
|
|
3065
|
-
n("p", null, l(e(r).discardDescription), 1)
|
|
3066
|
-
]),
|
|
3067
|
-
n("div", null, [
|
|
3068
|
-
n("button", {
|
|
3069
|
-
ref_key: "keepButton",
|
|
3070
|
-
ref: rt,
|
|
3071
|
-
type: "button",
|
|
3072
|
-
onClick: b[6] || (b[6] = (c) => e(p).decideDiscard(!1))
|
|
3073
|
-
}, l(e(r).keepEditing), 513),
|
|
3074
|
-
n("button", {
|
|
3075
|
-
type: "button",
|
|
3076
|
-
onClick: b[7] || (b[7] = (c) => e(p).decideDiscard(!0))
|
|
3077
|
-
}, l(e(r).discard), 1)
|
|
3078
|
-
])
|
|
3079
|
-
], 40, To)) : A("", !0),
|
|
3080
|
-
n("div", {
|
|
3081
|
-
class: Te(["mr-designer-body", { "is-tools": e(B) === "tools" }])
|
|
3082
|
-
}, [
|
|
3083
|
-
e(pe).size ? be((m(), h("div", {
|
|
3084
|
-
key: e(p).toolEpoch.value,
|
|
3085
|
-
class: "mr-designer-tools"
|
|
3086
|
-
}, [
|
|
3087
|
-
n("nav", {
|
|
3088
|
-
class: "mr-designer-tool-tabs",
|
|
3089
|
-
"aria-label": e(r).toolsSection
|
|
3090
|
-
}, [
|
|
3091
|
-
(m(), h(K, null, ee(["excel", "rules", "params", "review"], (c) => n("button", {
|
|
3092
|
-
key: c,
|
|
3093
|
-
id: `${R}-tool-${c}`,
|
|
3094
|
-
type: "button",
|
|
3095
|
-
"aria-pressed": e(me) === c,
|
|
3096
|
-
"aria-describedby": e(p).isToolPending(c) ? `${R}-pending` : void 0,
|
|
3097
|
-
onClick: (X) => me.value = c
|
|
3098
|
-
}, [
|
|
3099
|
-
H(l(e(r)[`${c}Tool`]) + " ", 1),
|
|
3100
|
-
e(p).isToolPending(c) ? (m(), h("span", Ao)) : A("", !0)
|
|
3101
|
-
], 8, Do)), 64)),
|
|
3102
|
-
n("span", null, l(e(r).toolsDescription), 1)
|
|
3103
|
-
], 8, Lo),
|
|
3104
|
-
n("div", Ho, [
|
|
3105
|
-
e(pe).has("params") ? be((m(), we(e(a), {
|
|
3106
|
-
key: 0,
|
|
3107
|
-
document: e(k),
|
|
3108
|
-
readonly: e(oe),
|
|
3109
|
-
accept: O,
|
|
3110
|
-
onDirty: b[9] || (b[9] = (c) => e(p).setToolPending("params", c))
|
|
3111
|
-
}, null, 8, ["document", "readonly"])), [
|
|
3112
|
-
[Ne, e(me) === "params"]
|
|
3113
|
-
]) : A("", !0),
|
|
3114
|
-
e(pe).has("excel") ? be((m(), we(e(i), {
|
|
3115
|
-
key: 1,
|
|
3116
|
-
datasets: t.bindingDatasets ?? [],
|
|
3117
|
-
session: t.bindingSession,
|
|
3118
|
-
identity: { id: e(k).id, name: e(k).name },
|
|
3119
|
-
"lock-id": "",
|
|
3120
|
-
readonly: e(oe),
|
|
3121
|
-
accept: Lt,
|
|
3122
|
-
onDirty: b[10] || (b[10] = (c) => e(p).setToolPending("excel", c))
|
|
3123
|
-
}, null, 8, ["datasets", "session", "identity", "readonly"])), [
|
|
3124
|
-
[Ne, e(me) === "excel"]
|
|
3125
|
-
]) : A("", !0),
|
|
3126
|
-
e(pe).has("review") ? be((m(), we(e(v), {
|
|
3127
|
-
key: 2,
|
|
3128
|
-
document: e(k),
|
|
3129
|
-
previous: e(p).originalDocument.value,
|
|
3130
|
-
datasets: t.datasets,
|
|
3131
|
-
"data-schemas": t.dataSchemas,
|
|
3132
|
-
onLocate: e(ye)
|
|
3133
|
-
}, null, 8, ["document", "previous", "datasets", "data-schemas", "onLocate"])), [
|
|
3134
|
-
[Ne, e(me) === "review"]
|
|
3135
|
-
]) : A("", !0),
|
|
3136
|
-
e(pe).has("rules") ? be((m(), h("div", Fo, [
|
|
3137
|
-
e(L).length > 1 ? (m(), h("label", No, [
|
|
3138
|
-
H(l(e(r).area), 1),
|
|
3139
|
-
n("select", {
|
|
3140
|
-
value: e(S),
|
|
3141
|
-
onChange: ct
|
|
3142
|
-
}, [
|
|
3143
|
-
(m(!0), h(K, null, ee(e(L), (c, X) => (m(), h("option", {
|
|
3144
|
-
key: X,
|
|
3145
|
-
value: X
|
|
3146
|
-
}, l(c.component.title || c.component.dataset), 9, Oo))), 128))
|
|
3147
|
-
], 40, Go)
|
|
3148
|
-
])) : A("", !0),
|
|
3149
|
-
e(F) ? (m(), we(e(s), {
|
|
3150
|
-
key: 1,
|
|
3151
|
-
list: e(F),
|
|
3152
|
-
datasets: t.datasets,
|
|
3153
|
-
"dataset-schema": e(ge),
|
|
3154
|
-
"dataset-schemas": t.dataSchemas,
|
|
3155
|
-
readonly: e(oe),
|
|
3156
|
-
onChange: e(q),
|
|
3157
|
-
onDirty: b[11] || (b[11] = (c) => e(p).setToolPending("rules", c))
|
|
3158
|
-
}, null, 8, ["list", "datasets", "dataset-schema", "dataset-schemas", "readonly", "onChange"])) : (m(), h("p", Bo, l(e(r).rulesNeedList), 1))
|
|
3159
|
-
], 512)), [
|
|
3160
|
-
[Ne, e(me) === "rules"]
|
|
3161
|
-
]) : A("", !0)
|
|
3162
|
-
])
|
|
3163
|
-
])), [
|
|
3164
|
-
[Ne, e(B) === "tools"]
|
|
3165
|
-
]) : A("", !0),
|
|
3166
|
-
e(B) !== "tools" ? (m(), h("aside", zo, [
|
|
3167
|
-
n("div", {
|
|
3168
|
-
ref_key: "inspectorPanel",
|
|
3169
|
-
ref: Ze,
|
|
3170
|
-
id: `${R}-panel-${e(B)}`,
|
|
3171
|
-
class: Te(["mr-designer-panel", { "is-advanced": e(B) === "advanced" }]),
|
|
3172
|
-
role: "tabpanel",
|
|
3173
|
-
"aria-labelledby": `${R}-tab-${e(B)}`
|
|
3174
|
-
}, [
|
|
3175
|
-
he.value || Fe.value ? (m(), h("div", Vo, [
|
|
3176
|
-
n("small", null, l(e(r).flowLayout), 1),
|
|
3177
|
-
n("button", {
|
|
3178
|
-
type: "button",
|
|
3179
|
-
onClick: $t
|
|
3180
|
-
}, l(e(r).excelTool) + " ↗", 1)
|
|
3181
|
-
])) : A("", !0),
|
|
3182
|
-
e(B) === "fields" ? (m(), h(K, { key: 1 }, [
|
|
3183
|
-
e(L).length > 1 ? (m(), h("label", Wo, [
|
|
3184
|
-
H(l(e(r).area), 1),
|
|
3185
|
-
n("select", {
|
|
3186
|
-
value: e(S),
|
|
3187
|
-
onChange: ct
|
|
3188
|
-
}, [
|
|
3189
|
-
(m(!0), h(K, null, ee(e(L), (c, X) => (m(), h("option", {
|
|
3190
|
-
key: X,
|
|
3191
|
-
value: X
|
|
3192
|
-
}, l(c.pageIndex + 1) + " " + l(e(r).page) + " · " + l(c.component.title || c.component.dataset), 9, Ko))), 128))
|
|
3193
|
-
], 40, Uo)
|
|
3194
|
-
])) : A("", !0),
|
|
3195
|
-
e(F) ? (m(), h(K, { key: 1 }, [
|
|
3196
|
-
n("div", Jo, [
|
|
3197
|
-
n("button", {
|
|
3198
|
-
ref_key: "directoryTrigger",
|
|
3199
|
-
ref: Et,
|
|
3200
|
-
type: "button",
|
|
3201
|
-
class: "mr-designer-field-trigger",
|
|
3202
|
-
"aria-expanded": e(dt),
|
|
3203
|
-
"aria-controls": `${R}-directory`,
|
|
3204
|
-
"aria-haspopup": "dialog",
|
|
3205
|
-
onClick: b[12] || (b[12] = //@ts-ignore
|
|
3206
|
-
(...c) => e(ue).toggle && e(ue).toggle(...c)),
|
|
3207
|
-
onKeydown: b[13] || (b[13] = tt(
|
|
3208
|
-
//@ts-ignore
|
|
3209
|
-
(...c) => e(ue).escape && e(ue).escape(...c),
|
|
3210
|
-
["esc"]
|
|
3211
|
-
))
|
|
3212
|
-
}, [
|
|
3213
|
-
n("span", Yo, [
|
|
3214
|
-
n("strong", null, l(e(_)?.column.header || e(r).noColumns), 1),
|
|
3215
|
-
n("small", null, l(e(_)?.column.field || "—"), 1)
|
|
3216
|
-
]),
|
|
3217
|
-
n("span", Xo, [
|
|
3218
|
-
H(l(e(r).columnDirectory) + " ", 1),
|
|
3219
|
-
n("b", null, l(e(F).columns.length), 1),
|
|
3220
|
-
re(ve, {
|
|
3221
|
-
name: "chevron-down",
|
|
3222
|
-
size: 13
|
|
3223
|
-
})
|
|
3224
|
-
])
|
|
3225
|
-
], 40, qo),
|
|
3226
|
-
n("div", Zo, [
|
|
3227
|
-
n("span", {
|
|
3228
|
-
"aria-label": e(r).fieldPosition
|
|
3229
|
-
}, [
|
|
3230
|
-
H(l(e(Q) >= 0 ? e(Q) + 1 : 0), 1),
|
|
3231
|
-
b[58] || (b[58] = n("i", null, "/", -1)),
|
|
3232
|
-
H(l(e(F).columns.length), 1)
|
|
3233
|
-
], 8, Qo),
|
|
3234
|
-
n("button", {
|
|
3235
|
-
type: "button",
|
|
3236
|
-
class: "mr-designer-icon-button",
|
|
3237
|
-
"aria-label": e(r).previousColumn,
|
|
3238
|
-
title: e(r).previousColumn,
|
|
3239
|
-
disabled: e(Q) <= 0,
|
|
3240
|
-
onClick: b[14] || (b[14] = (c) => e(V).stepColumn(-1))
|
|
3241
|
-
}, [
|
|
3242
|
-
re(ve, {
|
|
3243
|
-
name: "chevron-left",
|
|
3244
|
-
size: 14
|
|
3245
|
-
})
|
|
3246
|
-
], 8, ei),
|
|
3247
|
-
n("button", {
|
|
3248
|
-
type: "button",
|
|
3249
|
-
class: "mr-designer-icon-button",
|
|
3250
|
-
"aria-label": e(r).nextColumn,
|
|
3251
|
-
title: e(r).nextColumn,
|
|
3252
|
-
disabled: e(Q) >= e(F).columns.length - 1,
|
|
3253
|
-
onClick: b[15] || (b[15] = (c) => e(V).stepColumn(1))
|
|
3254
|
-
}, [
|
|
3255
|
-
re(ve, {
|
|
3256
|
-
name: "chevron-right",
|
|
3257
|
-
size: 14
|
|
3258
|
-
})
|
|
3259
|
-
], 8, ti)
|
|
3260
|
-
])
|
|
3261
|
-
]),
|
|
3262
|
-
e(_) ? (m(), h("fieldset", {
|
|
3263
|
-
key: 0,
|
|
3264
|
-
class: "mr-designer-properties",
|
|
3265
|
-
disabled: t.readonly || e(u) || e($),
|
|
3266
|
-
"aria-label": e(r).columnProperties
|
|
3267
|
-
}, [
|
|
3268
|
-
n("div", ai, [
|
|
3269
|
-
n("h3", null, l(e(r).contentGroup), 1),
|
|
3270
|
-
n("label", null, [
|
|
3271
|
-
H(l(e(r).header), 1),
|
|
3272
|
-
n("input", {
|
|
3273
|
-
value: e(_).column.header,
|
|
3274
|
-
onInput: b[16] || (b[16] = (c) => e(p).setColumn(
|
|
3275
|
-
e(_).index,
|
|
3276
|
-
"header",
|
|
3277
|
-
Se(c)
|
|
3278
|
-
))
|
|
3279
|
-
}, null, 40, li)
|
|
3280
|
-
]),
|
|
3281
|
-
n("label", null, [
|
|
3282
|
-
H(l(e(r).field), 1),
|
|
3283
|
-
n("input", {
|
|
3284
|
-
value: e(_).column.field,
|
|
3285
|
-
list: e(ge) ? `${R}-fields` : void 0,
|
|
3286
|
-
onChange: b[17] || (b[17] = (c) => e(p).setColumn(
|
|
3287
|
-
e(_).index,
|
|
3288
|
-
"field",
|
|
3289
|
-
Se(c)
|
|
3290
|
-
))
|
|
3291
|
-
}, null, 40, oi)
|
|
3292
|
-
]),
|
|
3293
|
-
e(ge) ? (m(), h("datalist", {
|
|
3294
|
-
key: 0,
|
|
3295
|
-
id: `${R}-fields`
|
|
3296
|
-
}, [
|
|
3297
|
-
(m(!0), h(K, null, ee(e(ge).fields, (c) => (m(), h("option", {
|
|
3298
|
-
key: c.field,
|
|
3299
|
-
value: c.field
|
|
3300
|
-
}, l(c.label) + " · " + l(c.type) + " " + l(c.unit), 9, si))), 128))
|
|
3301
|
-
], 8, ii)) : A("", !0)
|
|
3302
|
-
]),
|
|
3303
|
-
n("div", ri, [
|
|
3304
|
-
n("h3", null, l(e(r).formatGroup), 1),
|
|
3305
|
-
n("div", di, [
|
|
3306
|
-
n("label", ui, [
|
|
3307
|
-
H(l(e(r).width), 1),
|
|
3308
|
-
n("input", {
|
|
3309
|
-
type: "number",
|
|
3310
|
-
min: "0.1",
|
|
3311
|
-
step: "0.5",
|
|
3312
|
-
value: e(_).column.widthMm,
|
|
3313
|
-
disabled: Fe.value,
|
|
3314
|
-
onChange: b[18] || (b[18] = (c) => e(p).setColumn(
|
|
3315
|
-
e(_).index,
|
|
3316
|
-
"widthMm",
|
|
3317
|
-
Se(c)
|
|
3318
|
-
))
|
|
3319
|
-
}, null, 40, ci)
|
|
3320
|
-
]),
|
|
3321
|
-
n("label", mi, [
|
|
3322
|
-
H(l(e(r).semantic), 1),
|
|
3323
|
-
n("select", {
|
|
3324
|
-
value: e(_).column.semanticRole || "text",
|
|
3325
|
-
onChange: b[19] || (b[19] = (c) => e(p).setColumn(
|
|
3326
|
-
e(_).index,
|
|
3327
|
-
"semanticRole",
|
|
3328
|
-
Se(c)
|
|
3329
|
-
))
|
|
3330
|
-
}, [
|
|
3331
|
-
n("option", pi, l(e(r).identifier), 1),
|
|
3332
|
-
n("option", gi, l(e(r).dimension), 1),
|
|
3333
|
-
n("option", hi, l(e(r).measure), 1),
|
|
3334
|
-
n("option", fi, l(e(r).date), 1),
|
|
3335
|
-
n("option", bi, l(e(r).text), 1)
|
|
3336
|
-
], 40, vi)
|
|
3337
|
-
])
|
|
3338
|
-
]),
|
|
3339
|
-
n("div", yi, [
|
|
3340
|
-
n("span", null, l(e(r).bodyAlign), 1),
|
|
3341
|
-
re(it, {
|
|
3342
|
-
"model-value": e(_).column.align ?? e(_).column.style?.align ?? e(F).align ?? "left",
|
|
3343
|
-
label: e(r).bodyAlign,
|
|
3344
|
-
labels: ut.value,
|
|
3345
|
-
"auto-label": e(r).autoShort,
|
|
3346
|
-
"allow-auto": "",
|
|
3347
|
-
"onUpdate:modelValue": b[20] || (b[20] = (c) => e(p).setColumn(e(_).index, "align", c))
|
|
3348
|
-
}, null, 8, ["model-value", "label", "labels", "auto-label"])
|
|
3349
|
-
]),
|
|
3350
|
-
n("div", wi, [
|
|
3351
|
-
n("span", null, l(e(r).headerAlign), 1),
|
|
3352
|
-
re(it, {
|
|
3353
|
-
"model-value": e(p).headerAlignments.value[e(_).index] || "left",
|
|
3354
|
-
label: e(r).headerAlign,
|
|
3355
|
-
labels: ut.value,
|
|
3356
|
-
"auto-label": e(r).autoShort,
|
|
3357
|
-
"onUpdate:modelValue": b[21] || (b[21] = (c) => e(p).setColumn(
|
|
3358
|
-
e(_).index,
|
|
3359
|
-
"headerAlign",
|
|
3360
|
-
c
|
|
3361
|
-
))
|
|
3362
|
-
}, null, 8, ["model-value", "label", "labels", "auto-label"])
|
|
3363
|
-
])
|
|
3364
|
-
]),
|
|
3365
|
-
n("label", Mi, [
|
|
3366
|
-
H(l(e(r).editable), 1),
|
|
3367
|
-
n("input", {
|
|
3368
|
-
type: "checkbox",
|
|
3369
|
-
role: "switch",
|
|
3370
|
-
checked: e(_).column.editable === !0,
|
|
3371
|
-
onChange: b[22] || (b[22] = (c) => e(p).setColumn(
|
|
3372
|
-
e(_).index,
|
|
3373
|
-
"editable",
|
|
3374
|
-
et(c)
|
|
3375
|
-
))
|
|
3376
|
-
}, null, 40, ki)
|
|
3377
|
-
]),
|
|
3378
|
-
n("div", xi, [
|
|
3379
|
-
n("span", null, l(e(r).columnOrder), 1),
|
|
3380
|
-
n("button", {
|
|
3381
|
-
type: "button",
|
|
3382
|
-
"aria-label": e(r).moveColumnLeft,
|
|
3383
|
-
title: e(r).moveColumnLeft,
|
|
3384
|
-
disabled: Fe.value || e(Q) <= 0,
|
|
3385
|
-
onClick: b[23] || (b[23] = (c) => e(Y)(-1))
|
|
3386
|
-
}, [
|
|
3387
|
-
re(ve, {
|
|
3388
|
-
name: "chevron-left",
|
|
3389
|
-
size: 13
|
|
3390
|
-
})
|
|
3391
|
-
], 8, Ci),
|
|
3392
|
-
n("button", {
|
|
3393
|
-
type: "button",
|
|
3394
|
-
"aria-label": e(r).moveColumnRight,
|
|
3395
|
-
title: e(r).moveColumnRight,
|
|
3396
|
-
disabled: Fe.value || e(Q) >= e(F).columns.length - 1,
|
|
3397
|
-
onClick: b[24] || (b[24] = (c) => e(Y)(1))
|
|
3398
|
-
}, [
|
|
3399
|
-
re(ve, {
|
|
3400
|
-
name: "chevron-right",
|
|
3401
|
-
size: 13
|
|
3402
|
-
})
|
|
3403
|
-
], 8, $i),
|
|
3404
|
-
n("label", null, [
|
|
3405
|
-
H(l(e(r).columnVisible), 1),
|
|
3406
|
-
n("input", {
|
|
3407
|
-
type: "checkbox",
|
|
3408
|
-
checked: e(_).column.hidden !== !0,
|
|
3409
|
-
disabled: Fe.value || e(_).column.hidden !== !0 && e(F).columns.filter((c) => !c.hidden).length === 1,
|
|
3410
|
-
onChange: b[25] || (b[25] = (c) => e(p).setColumn(
|
|
3411
|
-
e(_).index,
|
|
3412
|
-
"hidden",
|
|
3413
|
-
!et(c)
|
|
3414
|
-
))
|
|
3415
|
-
}, null, 40, Si)
|
|
3416
|
-
])
|
|
3417
|
-
])
|
|
3418
|
-
], 8, ni)) : A("", !0),
|
|
3419
|
-
e(dt) ? (m(), h("div", {
|
|
3420
|
-
key: 1,
|
|
3421
|
-
id: `${R}-directory`,
|
|
3422
|
-
ref_key: "directoryPanel",
|
|
3423
|
-
ref: Pt,
|
|
3424
|
-
role: "dialog",
|
|
3425
|
-
"aria-label": e(r).columnDirectory,
|
|
3426
|
-
class: "mr-designer-directory",
|
|
3427
|
-
onKeydown: b[35] || (b[35] = tt(
|
|
3428
|
-
//@ts-ignore
|
|
3429
|
-
(...c) => e(ue).escape && e(ue).escape(...c),
|
|
3430
|
-
["esc"]
|
|
3431
|
-
)),
|
|
3432
|
-
onFocusout: b[36] || (b[36] = //@ts-ignore
|
|
3433
|
-
(...c) => e(ue).leave && e(ue).leave(...c))
|
|
3434
|
-
}, [
|
|
3435
|
-
n("div", Ii, [
|
|
3436
|
-
n("strong", null, [
|
|
3437
|
-
H(l(e(r).columnDirectory) + " ", 1),
|
|
3438
|
-
n("span", null, l(e(F).columns.length), 1)
|
|
3439
|
-
]),
|
|
3440
|
-
n("button", {
|
|
3441
|
-
type: "button",
|
|
3442
|
-
class: "mr-designer-icon-button",
|
|
3443
|
-
"aria-label": e(r).closeDirectory,
|
|
3444
|
-
onClick: b[26] || (b[26] = (c) => e(ue).close(!0))
|
|
3445
|
-
}, [
|
|
3446
|
-
re(ve, {
|
|
3447
|
-
name: "close",
|
|
3448
|
-
size: 15
|
|
3449
|
-
})
|
|
3450
|
-
], 8, Ei)
|
|
3451
|
-
]),
|
|
3452
|
-
n("div", Pi, [
|
|
3453
|
-
re(ve, {
|
|
3454
|
-
name: "search",
|
|
3455
|
-
size: 14
|
|
3456
|
-
}),
|
|
3457
|
-
be(n("input", {
|
|
3458
|
-
ref_key: "directorySearch",
|
|
3459
|
-
ref: Rt,
|
|
3460
|
-
"onUpdate:modelValue": b[27] || (b[27] = (c) => nt(j) ? j.value = c : null),
|
|
3461
|
-
type: "search",
|
|
3462
|
-
"aria-label": e(r).columnsSearch,
|
|
3463
|
-
placeholder: e(r).columnsSearch,
|
|
3464
|
-
onKeydown: b[28] || (b[28] = //@ts-ignore
|
|
3465
|
-
(...c) => e(ue).searchKeydown && e(ue).searchKeydown(...c))
|
|
3466
|
-
}, null, 40, Ri), [
|
|
3467
|
-
[vt, e(j)]
|
|
3468
|
-
]),
|
|
3469
|
-
e(j) ? (m(), h("button", {
|
|
3470
|
-
key: 0,
|
|
3471
|
-
type: "button",
|
|
3472
|
-
class: "mr-designer-icon-button",
|
|
3473
|
-
"aria-label": e(r).clearSearch,
|
|
3474
|
-
title: e(r).clearSearch,
|
|
3475
|
-
onClick: b[29] || (b[29] = (c) => j.value = "")
|
|
3476
|
-
}, [
|
|
3477
|
-
re(ve, {
|
|
3478
|
-
name: "close",
|
|
3479
|
-
size: 13
|
|
3480
|
-
})
|
|
3481
|
-
], 8, Ti)) : A("", !0)
|
|
3482
|
-
]),
|
|
3483
|
-
n("div", Li, [
|
|
3484
|
-
n("button", {
|
|
3485
|
-
type: "button",
|
|
3486
|
-
disabled: t.readonly || e(u) || e($) || !e(G).length,
|
|
3487
|
-
onClick: b[30] || (b[30] = (c) => e(p).selectVisible(!0))
|
|
3488
|
-
}, l(e(r).selectVisible), 9, Di),
|
|
3489
|
-
e(te).length ? (m(), h("button", {
|
|
3490
|
-
key: 0,
|
|
3491
|
-
type: "button",
|
|
3492
|
-
onClick: b[31] || (b[31] = //@ts-ignore
|
|
3493
|
-
(...c) => e(p).clearSelection && e(p).clearSelection(...c))
|
|
3494
|
-
}, l(e(r).clearSelection), 1)) : A("", !0),
|
|
3495
|
-
e(te).length ? (m(), h("span", Ai, l(e(r).columnsSelected) + " " + l(e(te).length), 1)) : (m(), h("span", Hi, l(e(G).length) + " / " + l(e(F).columns.length), 1))
|
|
3496
|
-
]),
|
|
3497
|
-
n("div", {
|
|
3498
|
-
ref_key: "columnList",
|
|
3499
|
-
ref: Tt,
|
|
3500
|
-
class: "mr-designer-column-list",
|
|
3501
|
-
"aria-label": e(r).columnDirectory,
|
|
3502
|
-
role: "group"
|
|
3503
|
-
}, [
|
|
3504
|
-
(m(!0), h(K, null, ee(e(G), ({ column: c, index: X }) => (m(), h("div", {
|
|
3505
|
-
key: X,
|
|
3506
|
-
class: Te(["mr-designer-column-row", { "is-active": e(Q) === X }])
|
|
3507
|
-
}, [
|
|
3508
|
-
n("input", {
|
|
3509
|
-
type: "checkbox",
|
|
3510
|
-
"aria-label": `${e(r).selectColumn} ${c.header}`,
|
|
3511
|
-
checked: e(te).includes(X),
|
|
3512
|
-
disabled: t.readonly || e(u) || e($),
|
|
3513
|
-
onChange: (Ae) => e(p).toggleColumn(X, et(Ae))
|
|
3514
|
-
}, null, 40, Ni),
|
|
3515
|
-
n("button", {
|
|
3516
|
-
type: "button",
|
|
3517
|
-
"data-column-index": X,
|
|
3518
|
-
"aria-pressed": e(Q) === X,
|
|
3519
|
-
tabindex: e(It) === X ? 0 : -1,
|
|
3520
|
-
onClick: (Ae) => e(ue).choose(X),
|
|
3521
|
-
onKeydown: b[32] || (b[32] = //@ts-ignore
|
|
3522
|
-
(...Ae) => e(ue).navigate && e(ue).navigate(...Ae))
|
|
3523
|
-
}, [
|
|
3524
|
-
n("span", Oi, l(X + 1), 1),
|
|
3525
|
-
n("span", Bi, [
|
|
3526
|
-
n("strong", null, l(c.header), 1),
|
|
3527
|
-
n("small", null, l(c.field), 1)
|
|
3528
|
-
]),
|
|
3529
|
-
e(Q) === X ? (m(), we(ve, {
|
|
3530
|
-
key: 0,
|
|
3531
|
-
name: "chevron-right",
|
|
3532
|
-
size: 13
|
|
3533
|
-
})) : A("", !0)
|
|
3534
|
-
], 40, Gi)
|
|
3535
|
-
], 2))), 128)),
|
|
3536
|
-
e(G).length ? A("", !0) : (m(), h("p", zi, [
|
|
3537
|
-
re(ve, {
|
|
3538
|
-
name: "search",
|
|
3539
|
-
size: 20
|
|
3540
|
-
}),
|
|
3541
|
-
H(l(e(r).noColumns), 1)
|
|
3542
|
-
]))
|
|
3543
|
-
], 8, Fi),
|
|
3544
|
-
e(te).length ? (m(), h("div", ji, [
|
|
3545
|
-
n("label", null, [
|
|
3546
|
-
H(l(e(r).batchBody), 1),
|
|
3547
|
-
n("select", {
|
|
3548
|
-
"aria-label": e(r).batchBody,
|
|
3549
|
-
disabled: t.readonly || e(u) || e($),
|
|
3550
|
-
onChange: b[33] || (b[33] = (c) => mt(c, "align"))
|
|
3551
|
-
}, [
|
|
3552
|
-
n("option", Wi, l(e(r).chooseAlignment), 1),
|
|
3553
|
-
n("option", Ui, l(e(r).auto), 1),
|
|
3554
|
-
n("option", Ki, l(e(r).left), 1),
|
|
3555
|
-
n("option", Ji, l(e(r).center), 1),
|
|
3556
|
-
n("option", qi, l(e(r).right), 1),
|
|
3557
|
-
n("option", Yi, l(e(r).justify), 1)
|
|
3558
|
-
], 40, Vi)
|
|
3559
|
-
]),
|
|
3560
|
-
n("label", null, [
|
|
3561
|
-
H(l(e(r).batchHeader), 1),
|
|
3562
|
-
n("select", {
|
|
3563
|
-
"aria-label": e(r).batchHeader,
|
|
3564
|
-
disabled: t.readonly || e(u) || e($),
|
|
3565
|
-
onChange: b[34] || (b[34] = (c) => mt(c, "headerAlign"))
|
|
3566
|
-
}, [
|
|
3567
|
-
n("option", Zi, l(e(r).chooseAlignment), 1),
|
|
3568
|
-
n("option", Qi, l(e(r).left), 1),
|
|
3569
|
-
n("option", es, l(e(r).center), 1),
|
|
3570
|
-
n("option", ts, l(e(r).right), 1),
|
|
3571
|
-
n("option", ns, l(e(r).justify), 1)
|
|
3572
|
-
], 40, Xi)
|
|
3573
|
-
])
|
|
3574
|
-
])) : A("", !0)
|
|
3575
|
-
], 40, _i)) : A("", !0)
|
|
3576
|
-
], 64)) : (m(), h("p", as, l(e(r).noColumns), 1))
|
|
3577
|
-
], 64)) : e(B) === "component" ? (m(), h(K, { key: 2 }, [
|
|
3578
|
-
n("div", ls, [
|
|
3579
|
-
n("select", {
|
|
3580
|
-
"aria-label": e(r).insertComponent,
|
|
3581
|
-
disabled: e(oe) || he.value,
|
|
3582
|
-
onChange: b[37] || (b[37] = //@ts-ignore
|
|
3583
|
-
(...c) => e(Oe) && e(Oe)(...c))
|
|
3584
|
-
}, [
|
|
3585
|
-
n("option", is, l(e(r).insertComponent), 1),
|
|
3586
|
-
n("option", ss, l(e(r).insertText), 1),
|
|
3587
|
-
n("option", {
|
|
3588
|
-
value: "list",
|
|
3589
|
-
disabled: !!e(k).template.repeat
|
|
3590
|
-
}, l(e(r).insertList), 9, rs),
|
|
3591
|
-
n("option", ds, l(e(r).insertImage), 1),
|
|
3592
|
-
n("option", us, l(e(r).insertRect), 1),
|
|
3593
|
-
n("option", cs, l(e(r).insertQrcode), 1),
|
|
3594
|
-
n("option", ms, l(e(r).insertBarcode), 1)
|
|
3595
|
-
], 40, os),
|
|
3596
|
-
n("button", {
|
|
3597
|
-
type: "button",
|
|
3598
|
-
title: e(r).duplicateComponent,
|
|
3599
|
-
"aria-label": e(r).duplicateComponent,
|
|
3600
|
-
disabled: e(oe) || he.value || !e(fe),
|
|
3601
|
-
onClick: b[38] || (b[38] = //@ts-ignore
|
|
3602
|
-
(...c) => e(Z).duplicate && e(Z).duplicate(...c))
|
|
3603
|
-
}, " + ", 8, vs),
|
|
3604
|
-
n("button", {
|
|
3605
|
-
type: "button",
|
|
3606
|
-
title: e(r).removeComponent,
|
|
3607
|
-
"aria-label": e(r).removeComponent,
|
|
3608
|
-
disabled: e(oe) || he.value || !e(fe),
|
|
3609
|
-
onClick: b[39] || (b[39] = //@ts-ignore
|
|
3610
|
-
(...c) => e(Z).remove && e(Z).remove(...c))
|
|
3611
|
-
}, [
|
|
3612
|
-
re(ve, {
|
|
3613
|
-
name: "close",
|
|
3614
|
-
size: 14
|
|
3615
|
-
})
|
|
3616
|
-
], 8, ps)
|
|
3617
|
-
]),
|
|
3618
|
-
e(k).template.pages.length > 1 ? (m(), h("label", gs, [
|
|
3619
|
-
H(l(e(r).page), 1),
|
|
3620
|
-
be(n("select", {
|
|
3621
|
-
"onUpdate:modelValue": b[40] || (b[40] = (c) => nt(ne) ? ne.value = c : null)
|
|
3622
|
-
}, [
|
|
3623
|
-
(m(!0), h(K, null, ee(e(k).template.pages, (c, X) => (m(), h("option", {
|
|
3624
|
-
key: X,
|
|
3625
|
-
value: X
|
|
3626
|
-
}, l(X + 1), 9, hs))), 128))
|
|
3627
|
-
], 512), [
|
|
3628
|
-
[
|
|
3629
|
-
Ve,
|
|
3630
|
-
e(ne),
|
|
3631
|
-
void 0,
|
|
3632
|
-
{ number: !0 }
|
|
3633
|
-
]
|
|
3634
|
-
])
|
|
3635
|
-
])) : A("", !0),
|
|
3636
|
-
n("label", fs, [
|
|
3637
|
-
H(l(e(r).components), 1),
|
|
3638
|
-
n("select", {
|
|
3639
|
-
value: e(ie)?.pageIndex === e(ne) ? e(ie).componentIndex : -1,
|
|
3640
|
-
onChange: b[41] || (b[41] = (c) => Qe({
|
|
3641
|
-
pageIndex: e(ne),
|
|
3642
|
-
componentIndex: Number(Se(c))
|
|
3643
|
-
}))
|
|
3644
|
-
}, [
|
|
3645
|
-
n("option", ys, l(e(r).noComponent), 1),
|
|
3646
|
-
(m(!0), h(K, null, ee(e(k).template.pages[e(ne)]?.components, (c, X) => (m(), h("option", {
|
|
3647
|
-
key: X,
|
|
3648
|
-
value: X
|
|
3649
|
-
}, l(X + 1) + " · " + l(c.kind === "list" ? c.title || c.dataset : c.text || c.kind), 9, ws))), 128))
|
|
3650
|
-
], 40, bs)
|
|
3651
|
-
]),
|
|
3652
|
-
e(Z).selections.value.length ? (m(), h("div", Ms, [
|
|
3653
|
-
n("strong", null, l(e(Z).selections.value.length) + " " + l(e(r).component), 1),
|
|
3654
|
-
n("button", {
|
|
3655
|
-
type: "button",
|
|
3656
|
-
disabled: e(oe),
|
|
3657
|
-
onClick: b[42] || (b[42] = //@ts-ignore
|
|
3658
|
-
(...c) => e(Z).toggleLock && e(Z).toggleLock(...c))
|
|
3659
|
-
}, l(e(Z).allLocked.value ? e(r).unlockSelection : e(r).lockSelection), 9, ks),
|
|
3660
|
-
n("select", {
|
|
3661
|
-
"aria-label": e(r).alignSelection,
|
|
3662
|
-
disabled: e(oe) || he.value || e(Z).selections.value.length < 2,
|
|
3663
|
-
onChange: b[43] || (b[43] = (c) => {
|
|
3664
|
-
e(Z).align(Se(c)), c.target.value = "";
|
|
3665
|
-
})
|
|
3666
|
-
}, [
|
|
3667
|
-
n("option", Cs, l(e(r).alignSelection), 1),
|
|
3668
|
-
n("option", $s, l(e(r).leftEdges), 1),
|
|
3669
|
-
n("option", Ss, l(e(r).centers), 1),
|
|
3670
|
-
n("option", _s, l(e(r).rightEdges), 1),
|
|
3671
|
-
n("option", Is, l(e(r).topEdges), 1),
|
|
3672
|
-
n("option", Es, l(e(r).middles), 1),
|
|
3673
|
-
n("option", Ps, l(e(r).bottomEdges), 1)
|
|
3674
|
-
], 40, xs),
|
|
3675
|
-
n("button", {
|
|
3676
|
-
type: "button",
|
|
3677
|
-
disabled: e(oe) || he.value || e(Z).selections.value.length < 3,
|
|
3678
|
-
onClick: b[44] || (b[44] = (c) => e(Z).distribute("horizontal"))
|
|
3679
|
-
}, l(e(r).horizontalSpacing), 9, Rs),
|
|
3680
|
-
n("button", {
|
|
3681
|
-
type: "button",
|
|
3682
|
-
disabled: e(oe) || he.value || e(Z).selections.value.length < 3,
|
|
3683
|
-
onClick: b[45] || (b[45] = (c) => e(Z).distribute("vertical"))
|
|
3684
|
-
}, l(e(r).verticalSpacing), 9, Ts),
|
|
3685
|
-
e(Z).allLocked.value ? (m(), h("small", Ls, l(e(r).sessionLock), 1)) : A("", !0)
|
|
3686
|
-
])) : A("", !0),
|
|
3687
|
-
e(fe) ? (m(), h(K, { key: 2 }, [
|
|
3688
|
-
n("div", Ds, [
|
|
3689
|
-
n("button", {
|
|
3690
|
-
type: "button",
|
|
3691
|
-
disabled: e(oe) || he.value || e(ie)?.componentIndex === 0,
|
|
3692
|
-
onClick: b[46] || (b[46] = (c) => e(Z).reorder(-1))
|
|
3693
|
-
}, l(e(r).backward), 9, As),
|
|
3694
|
-
n("button", {
|
|
3695
|
-
type: "button",
|
|
3696
|
-
disabled: e(oe) || he.value || e(ie)?.componentIndex === (e(k).template.pages[e(ne)]?.components.length ?? 0) - 1,
|
|
3697
|
-
onClick: b[47] || (b[47] = (c) => e(Z).reorder(1))
|
|
3698
|
-
}, l(e(r).forward), 9, Hs)
|
|
3699
|
-
]),
|
|
3700
|
-
re(il, {
|
|
3701
|
-
component: e(fe),
|
|
3702
|
-
"geometry-disabled": he.value,
|
|
3703
|
-
disabled: e(oe) || e(Z).locked(e(ie)),
|
|
3704
|
-
messages: e(r),
|
|
3705
|
-
repeat: e(k).template.repeat,
|
|
3706
|
-
schema: xt.value,
|
|
3707
|
-
onGeometry: e(Z).geometry,
|
|
3708
|
-
onPatch: e(Xe)
|
|
3709
|
-
}, null, 8, ["component", "geometry-disabled", "disabled", "messages", "repeat", "schema", "onGeometry", "onPatch"]),
|
|
3710
|
-
e(fe).kind === "list" ? (m(), we(to, {
|
|
3711
|
-
key: 0,
|
|
3712
|
-
list: e(fe),
|
|
3713
|
-
disabled: e(oe) || he.value,
|
|
3714
|
-
messages: e(r),
|
|
3715
|
-
onCommand: e(ae)
|
|
3716
|
-
}, null, 8, ["list", "disabled", "messages", "onCommand"])) : A("", !0)
|
|
3717
|
-
], 64)) : (m(), h("p", Fs, l(e(r).noComponent), 1))
|
|
3718
|
-
], 64)) : e(B) === "template" ? (m(), h(K, { key: 3 }, [
|
|
3719
|
-
n("h3", null, l(e(r).templateDetails), 1),
|
|
3720
|
-
n("label", Ns, [
|
|
3721
|
-
H(l(e(r).name), 1),
|
|
3722
|
-
n("input", {
|
|
3723
|
-
value: e(k).name,
|
|
3724
|
-
disabled: t.readonly || e(u) || e($),
|
|
3725
|
-
onInput: b[48] || (b[48] = (c) => e(p).setName(Se(c)))
|
|
3726
|
-
}, null, 40, Gs)
|
|
3727
|
-
]),
|
|
3728
|
-
n("label", Os, [
|
|
3729
|
-
H(l(e(r).description), 1),
|
|
3730
|
-
n("textarea", {
|
|
3731
|
-
rows: "2",
|
|
3732
|
-
value: e(k).description,
|
|
3733
|
-
disabled: t.readonly || e(u) || e($),
|
|
3734
|
-
onInput: b[49] || (b[49] = (c) => e(p).setDescription(Se(c)))
|
|
3735
|
-
}, null, 40, Bs)
|
|
3736
|
-
]),
|
|
3737
|
-
re(Il, {
|
|
3738
|
-
document: e(k),
|
|
3739
|
-
"page-index": e(ne),
|
|
3740
|
-
disabled: e(oe),
|
|
3741
|
-
messages: e(r),
|
|
3742
|
-
onSelect: b[50] || (b[50] = (c) => ne.value = c),
|
|
3743
|
-
onCommand: Ct,
|
|
3744
|
-
onLocate: b[51] || (b[51] = (c) => {
|
|
3745
|
-
Qe({ pageIndex: e(ne), componentIndex: c }), e(J)("design");
|
|
3746
|
-
})
|
|
3747
|
-
}, null, 8, ["document", "page-index", "disabled", "messages"]),
|
|
3748
|
-
re(Kl, {
|
|
3749
|
-
document: e(k),
|
|
3750
|
-
datasets: Object.keys(t.datasets ?? {}),
|
|
3751
|
-
schemas: t.dataSchemas,
|
|
3752
|
-
disabled: e(oe),
|
|
3753
|
-
messages: e(r),
|
|
3754
|
-
onChange: b[52] || (b[52] = (c) => {
|
|
3755
|
-
e(p).transaction((X) => {
|
|
3756
|
-
c ? X.template.repeat = c : delete X.template.repeat;
|
|
3757
|
-
});
|
|
3758
|
-
})
|
|
3759
|
-
}, null, 8, ["document", "datasets", "schemas", "disabled", "messages"]),
|
|
3760
|
-
n("details", zs, [
|
|
3761
|
-
n("summary", null, l(e(r).technicalDetails), 1),
|
|
3762
|
-
n("dl", js, [
|
|
3763
|
-
n("dt", null, l(e(r).templateIdentity), 1),
|
|
3764
|
-
n("dd", null, l(e(k).id), 1),
|
|
3765
|
-
n("dt", null, l(e(r).templateRevision), 1),
|
|
3766
|
-
n("dd", null, l(e(k).revision || e(r).unpublished), 1)
|
|
3767
|
-
])
|
|
3768
|
-
])
|
|
3769
|
-
], 64)) : (m(), h(K, { key: 4 }, [
|
|
3770
|
-
n("h3", null, l(e(r).advancedTitle), 1),
|
|
3771
|
-
n("label", Vs, [
|
|
3772
|
-
H(l(e(r).json), 1),
|
|
3773
|
-
be(n("textarea", {
|
|
3774
|
-
"onUpdate:modelValue": b[53] || (b[53] = (c) => nt(E) ? E.value = c : null),
|
|
3775
|
-
class: "mr-designer-json",
|
|
3776
|
-
"aria-label": e(r).json,
|
|
3777
|
-
disabled: t.readonly || e(u),
|
|
3778
|
-
spellcheck: "false"
|
|
3779
|
-
}, null, 8, Ws), [
|
|
3780
|
-
[vt, e(E)]
|
|
3781
|
-
])
|
|
3782
|
-
]),
|
|
3783
|
-
n("button", {
|
|
3784
|
-
type: "button",
|
|
3785
|
-
class: "mr-designer-apply-json",
|
|
3786
|
-
disabled: t.readonly || e(u),
|
|
3787
|
-
onClick: b[54] || (b[54] = //@ts-ignore
|
|
3788
|
-
(...c) => e(p).applyJson && e(p).applyJson(...c))
|
|
3789
|
-
}, l(e(r).applyJson), 9, Us)
|
|
3790
|
-
], 64)),
|
|
3791
|
-
e($) ? (m(), h("p", Ks, l(e(r).jsonPending), 1)) : A("", !0)
|
|
3792
|
-
], 10, jo)
|
|
3793
|
-
])) : A("", !0),
|
|
3794
|
-
e(B) !== "tools" ? (m(), h("div", {
|
|
3795
|
-
key: 2,
|
|
3796
|
-
class: "mr-designer-preview",
|
|
3797
|
-
"aria-label": e(r).previewTitle
|
|
3798
|
-
}, [
|
|
3799
|
-
e(I) ? (m(), h("div", qs, l(e(I)), 1)) : A("", !0),
|
|
3800
|
-
e(P).ok ? A("", !0) : (m(), h("ul", Ys, [
|
|
3801
|
-
(m(!0), h(K, null, ee(e(P).errors, (c) => (m(), h("li", {
|
|
3802
|
-
key: c.path
|
|
3803
|
-
}, l(c.path) + ":" + l(c.message), 1))), 128))
|
|
3804
|
-
])),
|
|
3805
|
-
e(N) === "design" && e(P).ok ? (m(), we(Bn, {
|
|
3806
|
-
key: 2,
|
|
3807
|
-
document: e(k),
|
|
3808
|
-
selection: e(ie),
|
|
3809
|
-
selections: e(Z).selections.value,
|
|
3810
|
-
locked: e(Z).locked,
|
|
3811
|
-
"active-column-index": e(Q),
|
|
3812
|
-
"page-index": e(ne),
|
|
3813
|
-
datasets: t.datasets,
|
|
3814
|
-
disabled: e(oe) || he.value || e(p).isToolPending("rules"),
|
|
3815
|
-
messages: e(r),
|
|
3816
|
-
onSelect: Qe,
|
|
3817
|
-
onGeometry: e(Z).geometry,
|
|
3818
|
-
onColumn: e(V).activate,
|
|
3819
|
-
onWidth: b[55] || (b[55] = (c, X) => e(p).setColumn(c, "widthMm", String(X)))
|
|
3820
|
-
}, null, 8, ["document", "selection", "selections", "locked", "active-column-index", "page-index", "datasets", "disabled", "messages", "onGeometry", "onColumn"])) : e(se) && e(P).ok ? (m(), we(e(Nt), {
|
|
3821
|
-
key: 3,
|
|
3822
|
-
"report-id": "draft",
|
|
3823
|
-
fetcher: e(se),
|
|
3824
|
-
messages: {
|
|
3825
|
-
title: e(r).previewTitle,
|
|
3826
|
-
columnDirectory: e(r).previewFieldDirectory
|
|
3827
|
-
},
|
|
3828
|
-
"show-params": !1,
|
|
3829
|
-
editable: !1,
|
|
3830
|
-
"excel-import": !1,
|
|
3831
|
-
height: "100%"
|
|
3832
|
-
}, null, 8, ["fetcher", "messages"])) : (m(), h("p", Xs, l(e(r).invalid), 1))
|
|
3833
|
-
], 8, Js)) : A("", !0)
|
|
3834
|
-
], 2)
|
|
3835
|
-
], 8, po));
|
|
3836
|
-
}
|
|
3837
|
-
}), ir = /* @__PURE__ */ $e(Zs, [["__scopeId", "data-v-415052be"]]), sr = {
|
|
3838
|
-
stale: "输入或验收范围已变化,旧结果已失效,请重新运行检查。",
|
|
3839
|
-
scope: "上次实测范围",
|
|
3840
|
-
datasets: "个数据集",
|
|
3841
|
-
treeHint: "树形数据保留完整父子关系;20/100 作为本次总节点预算,超出请选全部或提供完整小样例。",
|
|
3842
|
-
title: "变更与验收",
|
|
3843
|
-
run: "运行检查",
|
|
3844
|
-
running: "检查中…",
|
|
3845
|
-
samples: "验收样例",
|
|
3846
|
-
none: "仅检查结构",
|
|
3847
|
-
first20: "每个数据集前 20 行",
|
|
3848
|
-
first100: "每个数据集前 100 行",
|
|
3849
|
-
all: "全部当前数据(总计 ≤1000 行)",
|
|
3850
|
-
changes: "模板变更",
|
|
3851
|
-
issues: "待处理项",
|
|
3852
|
-
results: "样例结果",
|
|
3853
|
-
noChanges: "与基线一致",
|
|
3854
|
-
noIssues: "本次检查未发现问题",
|
|
3855
|
-
empty: "选择验收样例后运行,检查字段映射、排版与输出能力。",
|
|
3856
|
-
baseline: "未提供上一版本,仅检查当前模板。",
|
|
3857
|
-
errors: "错误",
|
|
3858
|
-
warnings: "提示",
|
|
3859
|
-
locate: "定位",
|
|
3860
|
-
before: "修改前",
|
|
3861
|
-
after: "修改后",
|
|
3862
|
-
breaking: "影响兼容性",
|
|
3863
|
-
acknowledge: "已确认字段与结构变更",
|
|
3864
|
-
truncated: "变更较多,仅展示前 500 项;兼容检查仍包含全部变更。",
|
|
3865
|
-
pages: "页",
|
|
3866
|
-
rows: "行",
|
|
3867
|
-
checked: "检查结果对应本次样例,不代替服务端发布权限与全量数据校验。",
|
|
3868
|
-
categories: { metadata: "信息", structure: "结构", binding: "字段", calculation: "计算", format: "样式" },
|
|
3869
|
-
kinds: { added: "新增", removed: "删除", modified: "修改", moved: "调序" }
|
|
3870
|
-
}, rr = {
|
|
3871
|
-
tableMode: "传统整表",
|
|
3872
|
-
multiRegions: "多区域绑定",
|
|
3873
|
-
multiHint: "点击单元格选择起点,Shift 点击选择终点;每个动态区域选择一行原型。",
|
|
3874
|
-
addRegion: "创建区域",
|
|
3875
|
-
removeRegion: "删除区域",
|
|
3876
|
-
regionProperties: "当前区域",
|
|
3877
|
-
regionReady: "就绪",
|
|
3878
|
-
regionPending: "待补齐",
|
|
3879
|
-
regionError: "需修正",
|
|
3880
|
-
locateIssue: "定位并修正",
|
|
3881
|
-
nextDataset: "下一步:选择业务数据集",
|
|
3882
|
-
nextRowKey: "下一步:选择稳定业务主键",
|
|
3883
|
-
nextField: "下一步:补齐或修正逐列字段映射",
|
|
3884
|
-
nextRange: "下一步:检查原型范围及区域重叠",
|
|
3885
|
-
nextRegion: "下一步:在原始模板中选择一行并创建区域",
|
|
3886
|
-
nextHeader: "下一步:选择整行并标记表头和明细",
|
|
3887
|
-
nextFooter: "下一步:检查重复页尾范围",
|
|
3888
|
-
nextContract: "下一步:检查数据集契约和样例",
|
|
3889
|
-
dataContract: "数据集契约",
|
|
3890
|
-
inspectIssues: "查看待修正项",
|
|
3891
|
-
previousIssues: "上一组问题",
|
|
3892
|
-
nextIssues: "下一组问题",
|
|
3893
|
-
noCellSelection: "请先点击单元格,Shift 点击选择一行范围",
|
|
3894
|
-
limitRegions: "最多创建 128 个区域",
|
|
3895
|
-
applying: "正在确认模板…",
|
|
3896
|
-
regionCoordinates: "原型范围",
|
|
3897
|
-
regionMode: "填充方式",
|
|
3898
|
-
recordMode: "单记录",
|
|
3899
|
-
repeatMode: "纵向重复",
|
|
3900
|
-
recordHint: "接收零或一行数据,保留旁列静态内容;多行输入会明确报错。",
|
|
3901
|
-
repeatHint: "按数据行纵向扩展,下方内容自动顺延;旁列不能放置非空静态内容。",
|
|
3902
|
-
bindRegionHeader: "选区作为表头",
|
|
3903
|
-
noRegionHeader: "无区域表头",
|
|
3904
|
-
clearHeader: "清除区域表头",
|
|
3905
|
-
flowFooter: "重复页尾",
|
|
3906
|
-
flowFooterHint: "选择来源最后几行的完整列宽;为每页预留空间,避免明细覆盖。",
|
|
3907
|
-
bindFooter: "选区作为页尾",
|
|
3908
|
-
clearFooter: "清除重复页尾",
|
|
3909
|
-
concurrency: "业务并发字段",
|
|
3910
|
-
revisionField: "修订字段",
|
|
3911
|
-
sourceTokenField: "来源令牌字段",
|
|
3912
|
-
selectionCellLabel: "选择源单元格",
|
|
3913
|
-
searchFields: "搜索字段名称、编码或单位",
|
|
3914
|
-
fieldLimit: "候选最多显示 64 项;输入字段名筛选,已选映射始终保留。",
|
|
3915
|
-
restoreDraft: "恢复工具草稿",
|
|
3916
|
-
title: "Excel 业务绑定",
|
|
3917
|
-
intro: "保留模板版式,明确数据来源",
|
|
3918
|
-
upload: "选择 Excel 模板",
|
|
3919
|
-
replace: "更换文件",
|
|
3920
|
-
loading: "正在解析模板…",
|
|
3921
|
-
cancel: "取消解析",
|
|
3922
|
-
source: "原始模板",
|
|
3923
|
-
sourceHint: "点击行号选择,Shift 点击扩展;选择整行区域后标记用途。",
|
|
3924
|
-
sourceOnly: "来源样例仅供设计,应用时将全部替换为接口数据。",
|
|
3925
|
-
sheet: "工作表",
|
|
3926
|
-
dataset: "业务数据集",
|
|
3927
|
-
chooseDataset: "选择数据集契约",
|
|
3928
|
-
rowKey: "稳定业务主键",
|
|
3929
|
-
chooseRowKey: "选择业务主键",
|
|
3930
|
-
titleRegion: "标题",
|
|
3931
|
-
headerRegion: "多层表头",
|
|
3932
|
-
detailRegion: "样例明细",
|
|
3933
|
-
footerRegion: "静态尾页",
|
|
3934
|
-
optional: "可选",
|
|
3935
|
-
selectRegion: "标记选中行",
|
|
3936
|
-
clear: "清除",
|
|
3937
|
-
mapping: "逐列映射",
|
|
3938
|
-
coverage: "映射覆盖",
|
|
3939
|
-
physical: "Excel 列",
|
|
3940
|
-
business: "业务字段",
|
|
3941
|
-
chooseField: "选择已声明字段",
|
|
3942
|
-
selected: "已选行",
|
|
3943
|
-
previousRows: "上一组行",
|
|
3944
|
-
nextRows: "下一组行",
|
|
3945
|
-
previousColumns: "上一组列",
|
|
3946
|
-
nextColumns: "下一组列",
|
|
3947
|
-
rowStart: "预览起始行",
|
|
3948
|
-
columnStart: "预览起始列",
|
|
3949
|
-
apply: "校验并使用模板",
|
|
3950
|
-
check: "校验绑定",
|
|
3951
|
-
identity: "新模板",
|
|
3952
|
-
templateId: "模板标识",
|
|
3953
|
-
templateName: "模板名称",
|
|
3954
|
-
issues: "请先修正绑定",
|
|
3955
|
-
ready: "绑定校验通过",
|
|
3956
|
-
noSource: "导入 .xlsx,开始绑定业务数据",
|
|
3957
|
-
noContract: "请由接入方提供数据集字段契约,再配置业务绑定。",
|
|
3958
|
-
fieldType: "类型",
|
|
3959
|
-
precision: "位小数",
|
|
3960
|
-
sample: "契约样例",
|
|
3961
|
-
unnamed: "未标记",
|
|
3962
|
-
applied: "模板已生成,等待接入方确认",
|
|
3963
|
-
readonly: "当前只读",
|
|
3964
|
-
invalidFile: "请选择未加密的 .xlsx 文件",
|
|
3965
|
-
emptySelection: "请先在原始模板中选择行",
|
|
3966
|
-
footerHint: "静态尾页保留为独立页面,不随明细重复;不是每页页脚。",
|
|
3967
|
-
inspectWarning: "来源兼容性提示",
|
|
3968
|
-
session: "绑定会话可随草稿保存,再次传入即可恢复",
|
|
3969
|
-
decimals: "精确小数按原文本保留",
|
|
3970
|
-
selectionLabel: "选择源行",
|
|
3971
|
-
regionLegend: "区域用途",
|
|
3972
|
-
summary: "绑定摘要",
|
|
3973
|
-
stepSource: "选模板",
|
|
3974
|
-
stepRegions: "标区域",
|
|
3975
|
-
stepFields: "绑字段",
|
|
3976
|
-
stepValidate: "校验应用",
|
|
3977
|
-
errors: "项问题",
|
|
3978
|
-
sourceError: "模板解析失败",
|
|
3979
|
-
dimensions: "原始范围",
|
|
3980
|
-
mappedTo: "绑定到",
|
|
3981
|
-
sampleOnly: "仅契约样例",
|
|
3982
|
-
schemaOnly: "契约字段,不执行接口查询"
|
|
3983
|
-
}, dr = {
|
|
3984
|
-
restoreDraft: "恢复工具草稿",
|
|
3985
|
-
catalog: "规则与字段",
|
|
3986
|
-
searchFields: "搜索字段、类型或单位",
|
|
3987
|
-
useField: "使用此字段",
|
|
3988
|
-
shown: "显示",
|
|
3989
|
-
explanation: "计算解释",
|
|
3990
|
-
sourceValues: "源值",
|
|
3991
|
-
expression: "表达式",
|
|
3992
|
-
result: "结果",
|
|
3993
|
-
notChecked: "修改后请重新验算",
|
|
3994
|
-
nullReason: "空值依规则保留;空值传播与除零策略见计算边界。",
|
|
3995
|
-
sourceHint: "最多展示 5 条明细;分组和全量聚合以当前验算范围为准。",
|
|
3996
|
-
pending: "未应用配置",
|
|
3997
|
-
detail: "主从",
|
|
3998
|
-
matrix: "矩阵",
|
|
3999
|
-
tree: "树形",
|
|
4000
|
-
treeInput: "输入结构",
|
|
4001
|
-
treeFlat: "扁平父子表",
|
|
4002
|
-
treeNested: "嵌套子节点",
|
|
4003
|
-
treeId: "节点业务键",
|
|
4004
|
-
treeParent: "父节点键",
|
|
4005
|
-
treeChildren: "子节点数组字段",
|
|
4006
|
-
treeLabel: "层级标签列",
|
|
4007
|
-
treeIndent: "每级缩进 · mm",
|
|
4008
|
-
treeOrphan: "孤儿节点",
|
|
4009
|
-
treeAsRoot: "作为根节点",
|
|
4010
|
-
treeValues: "父级数值来源",
|
|
4011
|
-
treeSource: "保留来源值",
|
|
4012
|
-
treeLeaves: "按后代叶子聚合",
|
|
4013
|
-
treeRows: "最多节点",
|
|
4014
|
-
treeDepth: "最多层级",
|
|
4015
|
-
treeHint: "全量树展示与导出。总计只统计叶子,避免父子重复。应用将替换普通分组、主从、矩阵和行可见条件;可撤销恢复。",
|
|
4016
|
-
treeReadonly: "嵌套输入首版只读;扁平输入的结构键和派生父级聚合只读。",
|
|
4017
|
-
treeBudget: "树形样例最多 1000 个节点,请提供完整关系样例。",
|
|
4018
|
-
measureLabel: "显示名称",
|
|
4019
|
-
childDataset: "明细数据集",
|
|
4020
|
-
parentKey: "主表关联键",
|
|
4021
|
-
foreignKey: "明细外键",
|
|
4022
|
-
rowKey: "明细业务主键",
|
|
4023
|
-
noRowKey: "只读明细,不绑定编辑身份",
|
|
4024
|
-
childColumns: "明细展示字段",
|
|
4025
|
-
title: "明细标题",
|
|
4026
|
-
unmatched: "未关联明细",
|
|
4027
|
-
ignore: "显式忽略",
|
|
4028
|
-
childHeader: "展示明细表头",
|
|
4029
|
-
rowFields: "行维度",
|
|
4030
|
-
columnFields: "列维度",
|
|
4031
|
-
totals: "原始样本总计",
|
|
4032
|
-
widthSettings: "动态列宽 · mm",
|
|
4033
|
-
dimensionWidth: "维度列宽",
|
|
4034
|
-
measureWidth: "度量列宽",
|
|
4035
|
-
detailHint: "以业务键关联宿主提供的数据集。应用主从布局将替换矩阵配置。",
|
|
4036
|
-
matrixHint: "查询时按维度生成动态列。应用矩阵将替换普通分组、主从和总计;可撤销恢复。",
|
|
4037
|
-
computations: "计算",
|
|
4038
|
-
groups: "分组",
|
|
4039
|
-
conditions: "条件",
|
|
4040
|
-
target: "结果字段",
|
|
4041
|
-
newField: "新增计算字段",
|
|
4042
|
-
select: "选择字段",
|
|
4043
|
-
row: "当前行",
|
|
4044
|
-
group: "当前组",
|
|
4045
|
-
dataset: "整个数据集",
|
|
4046
|
-
scope: "计算范围",
|
|
4047
|
-
numeric: "数值模式",
|
|
4048
|
-
number: "普通数值",
|
|
4049
|
-
decimal: "精确小数",
|
|
4050
|
-
digits: "小数位",
|
|
4051
|
-
groupFields: "分组依据",
|
|
4052
|
-
field: "字段",
|
|
4053
|
-
constant: "常量",
|
|
4054
|
-
operation: "运算",
|
|
4055
|
-
aggregate: "聚合",
|
|
4056
|
-
text: "文本",
|
|
4057
|
-
boolean: "布尔",
|
|
4058
|
-
null: "空值",
|
|
4059
|
-
true: "是",
|
|
4060
|
-
false: "否",
|
|
4061
|
-
add: "相加",
|
|
4062
|
-
subtract: "相减",
|
|
4063
|
-
multiply: "相乘",
|
|
4064
|
-
divide: "相除",
|
|
4065
|
-
coalesce: "首个非空值",
|
|
4066
|
-
sum: "求和",
|
|
4067
|
-
count: "计数",
|
|
4068
|
-
avg: "平均值",
|
|
4069
|
-
min: "最小值",
|
|
4070
|
-
max: "最大值",
|
|
4071
|
-
weightedAvg: "加权平均",
|
|
4072
|
-
subtotalLabel: "小计",
|
|
4073
|
-
weight: "权重字段",
|
|
4074
|
-
argument: "参数",
|
|
4075
|
-
addArgument: "添加参数",
|
|
4076
|
-
remove: "移除",
|
|
4077
|
-
apply: "应用规则",
|
|
4078
|
-
check: "样例验算",
|
|
4079
|
-
addGroup: "添加分组",
|
|
4080
|
-
noGroups: "尚未配置分组",
|
|
4081
|
-
header: "组头模板",
|
|
4082
|
-
footer: "组尾标签",
|
|
4083
|
-
repeat: "跨页重复组头",
|
|
4084
|
-
orphan: "组头与首行保持同页",
|
|
4085
|
-
outer: "外层",
|
|
4086
|
-
inner: "内层",
|
|
4087
|
-
addAggregate: "添加聚合",
|
|
4088
|
-
measure: "度量字段",
|
|
4089
|
-
output: "输出字段",
|
|
4090
|
-
condition: "条件字段",
|
|
4091
|
-
comparison: "比较方式",
|
|
4092
|
-
threshold: "比较值",
|
|
4093
|
-
effect: "效果",
|
|
4094
|
-
style: "条件样式",
|
|
4095
|
-
cell: "单元格可见",
|
|
4096
|
-
rowVisibility: "明细行可见",
|
|
4097
|
-
color: "文字颜色",
|
|
4098
|
-
background: "背景颜色",
|
|
4099
|
-
bold: "加粗",
|
|
4100
|
-
column: "目标列",
|
|
4101
|
-
newCondition: "新增条件样式",
|
|
4102
|
-
removeCondition: "移除此规则",
|
|
4103
|
-
advanced: "计算边界",
|
|
4104
|
-
nulls: "空值处理",
|
|
4105
|
-
propagate: "保留为空",
|
|
4106
|
-
error: "报告错误",
|
|
4107
|
-
division: "除零处理",
|
|
4108
|
-
dependencies: "计算顺序",
|
|
4109
|
-
noData: "尚无样例数据",
|
|
4110
|
-
sample: "样例前 1000 行 · 仅验算,不修改来源",
|
|
4111
|
-
preview: "计算结果",
|
|
4112
|
-
existing: "已有规则",
|
|
4113
|
-
ready: "规则已通过结构校验",
|
|
4114
|
-
allRows: "全部行",
|
|
4115
|
-
noFields: "当前数据集尚无字段",
|
|
4116
|
-
resultType: "常量类型",
|
|
4117
|
-
settings: "规则设置",
|
|
4118
|
-
moveUp: "向外移动",
|
|
4119
|
-
moveDown: "向内移动",
|
|
4120
|
-
missingTarget: "请选择或填写结果字段",
|
|
4121
|
-
noSelection: "请先选择列",
|
|
4122
|
-
countHint: "留空度量字段可统计行数",
|
|
4123
|
-
decimalHint: "精确小数以文本保存,避免大数精度丢失。",
|
|
4124
|
-
readonly: "只读",
|
|
4125
|
-
formatMode: "条件规则",
|
|
4126
|
-
rule: "规则",
|
|
4127
|
-
sampleError: "验算未通过",
|
|
4128
|
-
new: "新增",
|
|
4129
|
-
enabled: "启用"
|
|
4130
|
-
}, ur = {
|
|
4131
|
-
paramsTool: "查询参数",
|
|
4132
|
-
paramsDescription: "配置一次,预览与服务端使用同一份校验规则。",
|
|
4133
|
-
paramsDirectory: "参数目录",
|
|
4134
|
-
paramAdd: "添加参数",
|
|
4135
|
-
paramEmpty: "尚未配置查询参数",
|
|
4136
|
-
paramEmptyHint: "添加日期、厂别等条件,报表预览会自动生成查询面板。",
|
|
4137
|
-
paramField: "参数标识",
|
|
4138
|
-
paramLabel: "显示名称",
|
|
4139
|
-
paramType: "控件类型",
|
|
4140
|
-
paramRequired: "必填",
|
|
4141
|
-
paramPlaceholder: "输入提示",
|
|
4142
|
-
paramDefaultEnabled: "设置默认值",
|
|
4143
|
-
paramDefault: "默认值",
|
|
4144
|
-
paramMinimum: "最小值(含边界)",
|
|
4145
|
-
paramMaximum: "最大值(含边界)",
|
|
4146
|
-
paramMinLength: "最少字符数",
|
|
4147
|
-
paramMaxLength: "最多字符数",
|
|
4148
|
-
paramOptions: "静态下拉选项",
|
|
4149
|
-
paramOptionValue: "接口值",
|
|
4150
|
-
paramOptionLabel: "显示文字",
|
|
4151
|
-
paramOptionAdd: "添加选项",
|
|
4152
|
-
paramRemove: "删除参数",
|
|
4153
|
-
paramOptionRemove: "删除选项",
|
|
4154
|
-
paramMoveUp: "上移参数",
|
|
4155
|
-
paramMoveDown: "下移参数",
|
|
4156
|
-
paramApply: "校验并应用参数",
|
|
4157
|
-
paramRestore: "恢复参数草稿",
|
|
4158
|
-
paramPending: "尚未应用",
|
|
4159
|
-
paramReady: "规则有效",
|
|
4160
|
-
paramInvalid: "规则待修正",
|
|
4161
|
-
paramIssueCount: "待修正问题",
|
|
4162
|
-
paramLocateFirst: "定位首个问题",
|
|
4163
|
-
paramUnnamed: "未命名参数",
|
|
4164
|
-
paramRangeStart: "默认开始日期",
|
|
4165
|
-
paramRangeEnd: "默认结束日期",
|
|
4166
|
-
paramConflict: "模板参数已在其他操作中变更。请先恢复参数草稿,再继续编辑。",
|
|
4167
|
-
paramApplyFailed: "参数未应用,请检查模板校验信息。",
|
|
4168
|
-
paramRenameHint: "参数标识决定接口取数键。新增、删除或改名后,请同步检查接入方的数据查询;插件不会修改外部接口。",
|
|
4169
|
-
paramChanges: "接口参数键变更",
|
|
4170
|
-
paramAdded: "新增",
|
|
4171
|
-
paramRemoved: "移除",
|
|
4172
|
-
paramWire: "接口值格式",
|
|
4173
|
-
paramNoDefault: "未设置默认值",
|
|
4174
|
-
paramRangeHint: "两端均须填写,开始日期不能晚于结束日期;边界约束作用于整个范围。",
|
|
4175
|
-
paramText: "文本",
|
|
4176
|
-
paramNumber: "数字",
|
|
4177
|
-
paramDate: "日期",
|
|
4178
|
-
paramMonth: "月份",
|
|
4179
|
-
paramYear: "年份",
|
|
4180
|
-
paramDateRange: "日期范围",
|
|
4181
|
-
paramSelect: "下拉选择"
|
|
4182
|
-
}, cr = {
|
|
4183
|
-
batchTitle: "批量生成",
|
|
4184
|
-
batchDescription: "每组参数独立生成;成功结果由接入方保存,当前页面仅保留回执。",
|
|
4185
|
-
batchAdd: "添加一组",
|
|
4186
|
-
batchDuplicate: "复制参数",
|
|
4187
|
-
batchDuplicateCompleted: "复制为新任务",
|
|
4188
|
-
batchRemove: "删除参数组",
|
|
4189
|
-
batchRun: "生成待处理",
|
|
4190
|
-
batchContinue: "继续未完成",
|
|
4191
|
-
batchRunning: "正在生成",
|
|
4192
|
-
batchRetry: "仅重试失败项",
|
|
4193
|
-
batchCancel: "取消剩余任务",
|
|
4194
|
-
batchCancelling: "正在取消…",
|
|
4195
|
-
batchPending: "待生成",
|
|
4196
|
-
batchCompleted: "已完成",
|
|
4197
|
-
batchCompletedHint: "此组已生成并保留回执;需修改参数或再次生成,请复制为新任务。",
|
|
4198
|
-
batchFailed: "失败",
|
|
4199
|
-
batchCancelled: "已取消",
|
|
4200
|
-
batchCase: "参数组",
|
|
4201
|
-
batchProgress: "本轮已结束 {completed}/{total} · 失败 {failed} · 取消 {cancelled}",
|
|
4202
|
-
batchInvalid: "请修正参数错误后再生成;本次未启动任何任务。",
|
|
4203
|
-
batchEmpty: "添加一组参数开始批量生成",
|
|
4204
|
-
batchNoMatches: "当前状态没有参数组",
|
|
4205
|
-
batchFilter: "按生成状态筛选",
|
|
4206
|
-
batchAll: "全部",
|
|
4207
|
-
batchNextFailure: "下一失败项",
|
|
4208
|
-
batchNoInstance: "已完成,接入方未返回可打开的实例标识。",
|
|
4209
|
-
batchOpen: "打开报表实例",
|
|
4210
|
-
batchLimit: "当前最多支持 {count} 组参数。",
|
|
4211
|
-
batchChanged: "参数定义或执行配置已变更,已请求取消当前批次,请核对后重新生成。",
|
|
4212
|
-
batchPages: "参数组分页",
|
|
4213
|
-
batchPrevious: "上一页",
|
|
4214
|
-
batchNext: "下一页",
|
|
4215
|
-
batchPage: "第 {page}/{pages} 页 · 共 {total} 组"
|
|
4216
|
-
}, mr = {
|
|
4217
|
-
publicationChanged: "发布修订与目录不一致,请刷新目录后重新查看",
|
|
4218
|
-
continueDraft: "继续编辑草稿",
|
|
4219
|
-
viewPublished: "查看发布版",
|
|
4220
|
-
draft: "草稿",
|
|
4221
|
-
published: "已发布",
|
|
4222
|
-
draftPending: "草稿待发布",
|
|
4223
|
-
retrySearch: "重试目录查询",
|
|
4224
|
-
retryOpen: "重试打开模板",
|
|
4225
|
-
retryCopy: "重试创建副本",
|
|
4226
|
-
openingTarget: "正在打开 {name}…",
|
|
4227
|
-
creatingTarget: "正在创建 {name} 的副本…",
|
|
4228
|
-
title: "模板库",
|
|
4229
|
-
subtitle: "按业务分类查找、打开或复制模板",
|
|
4230
|
-
search: "搜索名称、编号或标签",
|
|
4231
|
-
all: "全部模板",
|
|
4232
|
-
refresh: "刷新",
|
|
4233
|
-
open: "打开设计器",
|
|
4234
|
-
copy: "复制模板",
|
|
4235
|
-
empty: "没有匹配的模板",
|
|
4236
|
-
emptyHint: "调整关键词或分类后重试",
|
|
4237
|
-
loadMore: "下一页",
|
|
4238
|
-
previous: "上一页",
|
|
4239
|
-
page: "页",
|
|
4240
|
-
loading: "正在加载…",
|
|
4241
|
-
retry: "重试",
|
|
4242
|
-
revision: "修订",
|
|
4243
|
-
copyTitle: "复制为新模板",
|
|
4244
|
-
newId: "新模板编号",
|
|
4245
|
-
newName: "新模板名称",
|
|
4246
|
-
create: "创建副本",
|
|
4247
|
-
cancel: "取消",
|
|
4248
|
-
count: "项",
|
|
4249
|
-
missing: "模板不存在或已不可访问",
|
|
4250
|
-
stale: "目录返回了重复项或无效分页游标",
|
|
4251
|
-
invalid: "模板目录响应格式无效"
|
|
4252
|
-
}, vr = Me(() => import("./TemplateReviewPanel-BKofGrV9.js")), pr = Me(() => import("./ExcelBindingWizard-CeAf4QSE.js")), gr = Me(() => import("./RuleEditor-DzAmW5YH.js")), hr = Me(() => import("./ParamEditor-BLaE5q5W.js")), fr = Me(() => import("./ReportBatchPanel-B5ClP9tm.js")), br = Me(() => import("./ReportTemplateLibrary-BZB-XWjj.js"));
|
|
1
|
+
import "vue";
|
|
2
|
+
import { E as S, c as T, P as s, d as R, R as t, D as A, e as _, f as r, g as M, h as l, i as P, a as i, b as p, j as m, T as o, k as G, l as L, m as n, n as D } from "./designer-Ci1LizA9.js";
|
|
4253
3
|
export {
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4
|
+
S as EXCEL_BINDING_MESSAGES,
|
|
5
|
+
T as ExcelBindingWizard,
|
|
6
|
+
s as PARAM_EDITOR_MESSAGES,
|
|
7
|
+
R as ParamEditor,
|
|
8
|
+
t as REPORT_BATCH_MESSAGES,
|
|
9
|
+
A as RULE_EDITOR_MESSAGES,
|
|
10
|
+
_ as ReportBatchPanel,
|
|
11
|
+
r as ReportTemplateEditor,
|
|
12
|
+
M as ReportTemplateLibrary,
|
|
13
|
+
l as RuleEditor,
|
|
14
|
+
P as TEMPLATE_EDITOR_MESSAGES,
|
|
15
|
+
i as TEMPLATE_LIBRARY_MESSAGES,
|
|
16
|
+
p as TEMPLATE_PRODUCT_MESSAGES,
|
|
17
|
+
m as TEMPLATE_RECOVERY_MESSAGES,
|
|
18
|
+
o as TEMPLATE_REVIEW_MESSAGES,
|
|
19
|
+
G as TemplateOutlinePanel,
|
|
20
|
+
L as TemplateReusePanel,
|
|
21
|
+
n as TemplateReviewPanel,
|
|
22
|
+
D as createTemplateDraftStorage
|
|
4268
23
|
};
|