@agile-team/mach-report 2.22.0 → 2.23.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 +7 -6
- package/dist/{ExcelBindingWizard-CZyppD7I.js → ExcelBindingWizard-D4FLind-.js} +3 -3
- package/dist/{ExcelBindingWizard-CW79I6Gl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
- package/dist/{ParamEditor-CiYCJI0b.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
- package/dist/{ParamEditor-DQit-Gdf.js → ParamEditor-CASZt-Ma.js} +2 -2
- package/dist/{ReportBatchPanel-DKTpV7MU.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
- package/dist/{ReportBatchPanel-Db6TAfG5.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
- package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
- package/dist/{ReportLabelStudio-BYnRqmje.js → ReportLabelStudio-Dj7GXhuv.js} +295 -292
- package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-Dgmqro1Y.js} +93 -79
- package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
- package/dist/ReportPreview-FFIryrIr.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DEXH07ND.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-BZuKn0YK.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
- package/dist/{RuleEditor-CIQn547x.js → RuleEditor-D2UwQGF6.js} +59 -59
- package/dist/{RuleEditor-zSUmPjKa.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
- package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
- package/dist/{TemplateOutlinePanel-D0PgOSQE.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
- package/dist/{TemplateReusePanel-BKlAEF8-.js → TemplateReusePanel-4eejkNqi.js} +2 -2
- package/dist/{TemplateReusePanel-DAy_Hwqz.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
- package/dist/{TemplateReviewPanel-div-EH_m.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
- package/dist/{TemplateReviewPanel-CowmHaQQ.cjs → TemplateReviewPanel-DnYImiXu.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-4pK9HePf.cjs +1 -0
- package/dist/auto-CTIJ6PnR.js +257 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-DhrE7jzw.js +7169 -0
- package/dist/designer-IAZu6kBX.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +98 -45
- package/dist/designer.d.ts +98 -45
- package/dist/designer.js +3 -3
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-BefcaHdp.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CL6rXEkR.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-OqkPyUk5.js} +763 -776
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
- package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BFANt-i8.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-DeYYAL6F.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-Dk4C6S5R.js} +21 -21
- package/dist/prefill-DsUD5OoK.cjs +1 -0
- package/dist/prepared-DCIxhKFo.js +94 -0
- package/dist/prepared-Dv-XM3i1.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-C9ZaylID.cjs → protocol-B9YgfQ_d.cjs} +1 -1
- package/dist/{protocol-fjaeKkjf.js → protocol-DxeUKGYG.js} +3 -3
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-75Y5Oq5B.js} +52 -51
- package/dist/runtime-DKlGd_D4.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1642 -1586
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog--cjxzgH7.js} +17 -17
- package/dist/template-catalog-CoT7jm_6.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
- package/dist/textwrap-Cy7o1hIR.cjs +4 -0
- package/dist/vue/async.d.cts +24 -0
- package/dist/vue/async.d.ts +24 -0
- package/dist/vue/index.d.cts +25 -1
- package/dist/vue/index.d.ts +25 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { computed as b, shallowRef as
|
|
1
|
+
import { computed as b, shallowRef as Ce, ref as D, onMounted as vt, onScopeDispose as Ge, watch as ee, defineComponent as pt, markRaw as bt, nextTick as gt, openBlock as S, createElementBlock as k, unref as t, normalizeClass as qe, createElementVNode as r, createVNode as me, toDisplayString as d, createTextVNode as L, Fragment as ve, renderList as Ne, createCommentVNode as E, withDirectives as j, isRef as ie, vModelText as Se, vModelSelect as ht, withKeys as yt, withModifiers as wt, createBlock as Be, withCtx as St, vModelCheckbox as Mt, vShow as He, resolveDynamicComponent as Ct } from "vue";
|
|
2
2
|
import { useMachReport as kt, provideMachReportConfig as _t, ReportPreview as Lt } from "@agile-team/mach-report/vue";
|
|
3
3
|
import { a as pe } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
4
|
-
import { defineReportTemplate as Rt, createLabelTemplate as Dt, parseReportTemplate as T, serializeReportTemplate as
|
|
5
|
-
import {
|
|
6
|
-
import { L as Tt, c as Vt } from "./designer-
|
|
7
|
-
function
|
|
4
|
+
import { defineReportTemplate as Rt, createLabelTemplate as Dt, parseReportTemplate as T, serializeReportTemplate as Me, createReportSource as Ft, defineLabelReport as Et, inspectReportTemplateCompatibility as Nt, imposeLabelSheets as xt } from "@agile-team/mach-report";
|
|
5
|
+
import { v as Ke } from "./progress-ByiOxUD3.js";
|
|
6
|
+
import { L as Tt, c as Vt, d as Ot } from "./designer-DhrE7jzw.js";
|
|
7
|
+
function $t() {
|
|
8
8
|
let e;
|
|
9
9
|
const s = () => e ??= import("@agile-team/mach-report/codes").then((i) => i.createCodeAssetRenderers()).catch((i) => {
|
|
10
10
|
throw e = void 0, i;
|
|
11
11
|
}), o = (i) => async (u) => {
|
|
12
|
-
|
|
12
|
+
Ke(u.signal);
|
|
13
13
|
const l = await s();
|
|
14
|
-
return
|
|
14
|
+
return Ke(u.signal), l[i](u);
|
|
15
15
|
};
|
|
16
16
|
return { assetRenderers: { barcode: o("barcode"), qrcode: o("qrcode") } };
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function It(e) {
|
|
19
19
|
const s = e.pages[0];
|
|
20
20
|
if (!s || e.pages.some((u) => u.layout === "wide" || u.widthMm !== s.widthMm || u.heightMm !== s.heightMm)) return;
|
|
21
21
|
const o = Math.floor(190 / (s.widthMm + 4)), i = Math.floor(277 / (s.heightMm + 4));
|
|
22
22
|
if (!(o < 1 || i < 1 || o * i > 1e3))
|
|
23
23
|
return { paper: "a4", columns: o, rows: i, marginMm: 12, gapMm: 4, capacity: o * i };
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const ke = [
|
|
26
26
|
{ id: "material", widthMm: 80, heightMm: 55, faces: 1 },
|
|
27
27
|
{ id: "paired", widthMm: 80, heightMm: 55, faces: 2 },
|
|
28
28
|
{ id: "warehouse", widthMm: 100, heightMm: 60, faces: 1 }
|
|
29
29
|
];
|
|
30
|
-
function
|
|
30
|
+
function Qe(e, s) {
|
|
31
31
|
return s ?? e.fields.find((o) => o.semanticRole === "identifier" && o.field !== e.rowKey)?.field ?? e.rowKey ?? e.fields[0]?.field;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Le(e, s, o) {
|
|
34
34
|
const i = e.fields.filter((a) => a.field !== s && a.field !== e.rowKey);
|
|
35
35
|
if (o === void 0)
|
|
36
|
-
return i.map((a, m) => ({ field: a, index: m, priority:
|
|
36
|
+
return i.map((a, m) => ({ field: a, index: m, priority: Pt(a) })).sort((a, m) => a.priority - m.priority || a.index - m.index).slice(0, 5).map((a) => a.field);
|
|
37
37
|
const u = new Map(i.map((a) => [a.field, a])), l = [...new Set(o)];
|
|
38
38
|
if (l.length > 5) throw new Error("成品标签最多显示 5 个字段,请先精简显示字段");
|
|
39
39
|
return l.map((a) => {
|
|
@@ -42,13 +42,13 @@ function Re(e, s, o) {
|
|
|
42
42
|
return m;
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Pt(e) {
|
|
46
46
|
return /^(?:name|title|label|category)$/i.test(e.field) || /名称|品名|品类|类别/.test(e.label ?? "") ? 0 : e.semanticRole === "dimension" ? 1 : e.semanticRole === "measure" && e.unit ? 2 : e.semanticRole === "identifier" ? 3 : e.semanticRole === "date" ? 4 : 5;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
48
|
+
function zt(e = "paired") {
|
|
49
|
+
return ke.find((s) => s.id === e) ?? ke[1];
|
|
50
50
|
}
|
|
51
|
-
const Te = "#173450",
|
|
51
|
+
const Te = "#173450", Re = "#586c82";
|
|
52
52
|
function q(e, s, o, i, u = 4, l = 7) {
|
|
53
53
|
return {
|
|
54
54
|
kind: "text",
|
|
@@ -70,7 +70,7 @@ function Ve(e, s) {
|
|
|
70
70
|
style: { lineColor: "#c9d7e5", lineWidthPt: 0.55 }
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Ye(e, s, o) {
|
|
74
74
|
const i = [];
|
|
75
75
|
let u = 4;
|
|
76
76
|
if (o?.logoData) {
|
|
@@ -78,107 +78,107 @@ function Qe(e, s, o) {
|
|
|
78
78
|
throw new Error("标签Logo须使用PNG或JPEG图片数据");
|
|
79
79
|
i.push({ kind: "image", leftMm: 4, topMm: 3, widthMm: 12, heightMm: 7, imageData: o.logoData, meta: { labelBrandLogo: !0 } }), u = 19;
|
|
80
80
|
}
|
|
81
|
-
return i.push({ ...q(o?.name?.trim() || e, u, 3, s - u - 4, 5, 9), style: { fontSize: 9, color: "#205582" }, meta: { labelStudioRole: "brand-name" } }), o?.tagline?.trim() && i.push({ ...q(o.tagline.trim(), u, 8, s - u - 4, 3, 5.5), style: { fontSize: 5.5, color:
|
|
81
|
+
return i.push({ ...q(o?.name?.trim() || e, u, 3, s - u - 4, 5, 9), style: { fontSize: 9, color: "#205582" }, meta: { labelStudioRole: "brand-name" } }), o?.tagline?.trim() && i.push({ ...q(o.tagline.trim(), u, 8, s - u - 4, 3, 5.5), style: { fontSize: 5.5, color: Re }, meta: { labelStudioRole: "brand-tagline" } }), i.push(Ve(12, s)), i;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Ze(e, s, o, i, u = 4.7) {
|
|
84
84
|
return e.flatMap((l, a) => {
|
|
85
85
|
const m = s + a * u;
|
|
86
86
|
return [
|
|
87
|
-
{ ...q(l.label ?? l.field, 4, m, o, 4, 6), style: { fontSize: 6, color:
|
|
87
|
+
{ ...q(l.label ?? l.field, 4, m, o, 4, 6), style: { fontSize: 6, color: Re }, meta: { labelStudioRole: "field-label", labelStudioField: l.field } },
|
|
88
88
|
{ ...q("", 4 + o, m, i, 4, 7), binding: { field: l.field, ...l.format ? { format: l.format } : {} }, meta: { labelStudioRole: "field-value", labelStudioField: l.field } }
|
|
89
89
|
];
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Jt(e, s) {
|
|
93
93
|
return e ? [{ ...q("", 4, 14, s, 7, 14), binding: { field: e }, style: { fontSize: 14, color: Te } }] : [];
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
const u =
|
|
97
|
-
...
|
|
98
|
-
...
|
|
99
|
-
...
|
|
95
|
+
function At(e, s, o, i) {
|
|
96
|
+
const u = Le(e, o, i.fields), l = [
|
|
97
|
+
...Ye(s, 80, i.brand),
|
|
98
|
+
...Jt(o, 71),
|
|
99
|
+
...Ze(u, 23, 21, 27)
|
|
100
100
|
];
|
|
101
101
|
o && l.push({ kind: "qrcode", leftMm: 55, topMm: 23, widthMm: 20, heightMm: 20, binding: { field: o }, code: { quietZoneModules: 4, errorCorrection: "M" } }), l.push(Ve(48, 80));
|
|
102
102
|
const a = e.fields.find((m) => m.field === o)?.label ?? s;
|
|
103
|
-
return l.push({ ...q(a, 4, 49, 71, 3, 5.8), style: { fontSize: 5.8, color:
|
|
103
|
+
return l.push({ ...q(a, 4, 49, 71, 3, 5.8), style: { fontSize: 5.8, color: Re } }), l;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const l =
|
|
105
|
+
function Ue(e, s, o, i, u = 80) {
|
|
106
|
+
const l = Ye(s, u, i.brand);
|
|
107
107
|
o && (l.push({ ...q("", 4, 14, u - 8, 8, 16), binding: { field: o }, style: { fontSize: 16, align: "center", color: Te } }), l.push({ kind: "qrcode", leftMm: (u - 20) / 2, topMm: 23, widthMm: 20, heightMm: 20, binding: { field: o }, code: { quietZoneModules: 4, errorCorrection: "M" } })), l.push(Ve(44, u));
|
|
108
|
-
const a =
|
|
109
|
-
return u === 100 ? a.forEach((m,
|
|
110
|
-
const
|
|
111
|
-
l.push({ ...q(m.label ?? m.field,
|
|
112
|
-
}) : l.push(...
|
|
108
|
+
const a = Le(e, o, i.fields);
|
|
109
|
+
return u === 100 ? a.forEach((m, y) => {
|
|
110
|
+
const g = y % 2 === 0 ? 4 : 52, v = 46 + Math.floor(y / 2) * 4.3;
|
|
111
|
+
l.push({ ...q(m.label ?? m.field, g, v, 19, 3.7, 5.8), style: { fontSize: 5.8, color: Re }, meta: { labelStudioRole: "field-label", labelStudioField: m.field } }), l.push({ ...q("", g + 19, v, 25, 3.7, 6.5), binding: { field: m.field, ...m.format ? { format: m.format } : {} }, meta: { labelStudioRole: "field-value", labelStudioField: m.field } });
|
|
112
|
+
}) : l.push(...Ze(a.slice(0, 1), 46, 24, u - 32, 5)), l;
|
|
113
113
|
}
|
|
114
114
|
function be(e, s, o, i = {}, u) {
|
|
115
|
-
const l =
|
|
116
|
-
const M = i.brand?.[
|
|
117
|
-
return typeof M == "string" ? [[
|
|
118
|
-
})),
|
|
119
|
-
return a.faces === 2 && v.push({ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 2`, labelStudio:
|
|
115
|
+
const l = Qe(e, o), a = zt(i.preset), m = Object.fromEntries(["name", "tagline"].flatMap((h) => {
|
|
116
|
+
const M = i.brand?.[h];
|
|
117
|
+
return typeof M == "string" ? [[h, M]] : [];
|
|
118
|
+
})), y = { preset: a.id, brand: m, fields: Le(e, l, i.fields).map((h) => h.field) }, g = a.id === "warehouse" ? Ue(e, s, l, i, a.widthMm) : At(e, s, l, i), v = [{ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 1`, labelStudio: y }, components: g }];
|
|
119
|
+
return a.faces === 2 && v.push({ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 2`, labelStudio: y }, components: Ue(e, s, l, i) }), Rt({ id: "record-label", name: s, template: { ...Dt({ dataset: "records", rowKey: e.rowKey, pages: v }), ...u ? { dataContract: u } : {} } });
|
|
120
120
|
}
|
|
121
121
|
const P = (e) => e.meta?.labelStudioRole, xe = (e) => typeof P(e) == "string";
|
|
122
|
-
function
|
|
122
|
+
function _e(e) {
|
|
123
123
|
const s = { ...e, ...e.meta ? { meta: { ...e.meta } } : {} };
|
|
124
124
|
return s.meta && (delete s.meta.labelStudioRole, delete s.meta.labelStudioField, Object.keys(s.meta).length || delete s.meta), s;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function qt(e, s) {
|
|
127
127
|
for (const o of s.components.filter(xe)) {
|
|
128
128
|
if (e.components.some((u) => P(u) === P(o) && u.meta?.labelStudioField === o.meta?.labelStudioField)) continue;
|
|
129
|
-
const i = e.components.find((u) => !xe(u) && JSON.stringify(
|
|
129
|
+
const i = e.components.find((u) => !xe(u) && JSON.stringify(_e(u)) === JSON.stringify(_e(o)));
|
|
130
130
|
i && (i.meta = { ...i.meta, ...o.meta });
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Bt(e, s) {
|
|
134
134
|
const o = e.kind === "list" ? Number.POSITIVE_INFINITY : e.heightMm, i = s.kind === "list" ? Number.POSITIVE_INFINITY : s.heightMm;
|
|
135
135
|
return e.leftMm < s.leftMm + s.widthMm && e.leftMm + e.widthMm > s.leftMm && e.topMm < s.topMm + i && e.topMm + o > s.topMm;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function Ht(e, s) {
|
|
138
138
|
const o = { ...e, meta: { ...e.meta, ...s.meta } };
|
|
139
139
|
return o.kind === "text" && s.kind === "text" && (o.text = s.text, s.binding ? o.binding = s.binding : delete o.binding), o;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Kt(e, s, o, i) {
|
|
142
142
|
const u = i.has("field-value");
|
|
143
|
-
|
|
144
|
-
const l = new Set(e.components.filter((v) => P(v) === "field-label" || P(v) === "field-value")), a = [...l], m = /* @__PURE__ */ new Map(),
|
|
143
|
+
qt(e, s);
|
|
144
|
+
const l = new Set(e.components.filter((v) => P(v) === "field-label" || P(v) === "field-value")), a = [...l], m = /* @__PURE__ */ new Map(), y = [];
|
|
145
145
|
for (const v of o.components.filter(xe)) {
|
|
146
|
-
const
|
|
147
|
-
if (!i.has(String(
|
|
148
|
-
const M =
|
|
149
|
-
M ? m.set(M,
|
|
146
|
+
const h = P(v);
|
|
147
|
+
if (!i.has(String(h))) continue;
|
|
148
|
+
const M = h === "field-label" || h === "field-value" ? a.find((F) => P(F) === h && !m.has(F)) : e.components.find((F) => P(F) === h);
|
|
149
|
+
M ? m.set(M, Ht(M, v)) : y.push(v);
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
for (const v of
|
|
153
|
-
if (
|
|
154
|
-
|
|
151
|
+
const g = e.components.filter((v) => (!u || !l.has(v) || m.has(v)) && (!i.has("brand-tagline") || P(v) !== "brand-tagline" || o.components.some((h) => P(h) === "brand-tagline"))).map((v) => m.get(v) ?? v);
|
|
152
|
+
for (const v of y) {
|
|
153
|
+
if (g.some((h) => Bt(h, v))) return !1;
|
|
154
|
+
g.push(v);
|
|
155
155
|
}
|
|
156
|
-
return e.components =
|
|
156
|
+
return e.components = g, e.meta = { ...e.meta, labelStudio: o.meta?.labelStudio }, !0;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
const a = be(s, o, i, u), m = be(s, o, i, l),
|
|
160
|
-
JSON.stringify(u.fields) !== JSON.stringify(l.fields) && (
|
|
161
|
-
for (const [v,
|
|
158
|
+
function Ut(e, s, o, i, u, l) {
|
|
159
|
+
const a = be(s, o, i, u), m = be(s, o, i, l), y = T(e), g = /* @__PURE__ */ new Set();
|
|
160
|
+
JSON.stringify(u.fields) !== JSON.stringify(l.fields) && (g.add("field-label"), g.add("field-value")), (u.brand?.name ?? "").trim() !== (l.brand?.name ?? "").trim() && g.add("brand-name"), (u.brand?.tagline ?? "").trim() !== (l.brand?.tagline ?? "").trim() && g.add("brand-tagline");
|
|
161
|
+
for (const [v, h] of y.template.pages.entries()) {
|
|
162
162
|
const M = a.template.pages[v], F = m.template.pages[v];
|
|
163
|
-
if (M && F && !
|
|
163
|
+
if (M && F && !Kt(h, M, F, g)) return;
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return y;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function jt(e, s) {
|
|
168
168
|
const o = e.template.pages, i = s.template.pages;
|
|
169
169
|
return o.length !== i.length || o.some((u, l) => u.components.length !== i[l].components.length) ? !0 : o.some((u, l) => {
|
|
170
|
-
const a = i[l], m = { ...u, meta: void 0, components: void 0 },
|
|
171
|
-
return JSON.stringify(m) !== JSON.stringify(
|
|
170
|
+
const a = i[l], m = { ...u, meta: void 0, components: void 0 }, y = { ...a, meta: void 0, components: void 0 };
|
|
171
|
+
return JSON.stringify(m) !== JSON.stringify(y) || u.components.some((g, v) => JSON.stringify(_e(g)) !== JSON.stringify(_e(a.components[v])));
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Gt(e, s, o, i, u) {
|
|
175
175
|
const l = { ...e, template: be(s, o, i, u, e.template.dataContract).template }, a = e.template.repeat;
|
|
176
176
|
return a?.copies !== void 0 && l.template.repeat && (l.template.repeat.copies = a.copies), l;
|
|
177
177
|
}
|
|
178
178
|
function I(e) {
|
|
179
179
|
const s = e.template.pages[0]?.meta?.labelStudio;
|
|
180
180
|
if (!s || typeof s != "object") return;
|
|
181
|
-
const o = s, i =
|
|
181
|
+
const o = s, i = ke.find((m) => m.id === o.preset);
|
|
182
182
|
if (!i) return;
|
|
183
183
|
const u = Array.isArray(o.fields) ? o.fields.filter((m) => typeof m == "string") : void 0;
|
|
184
184
|
if (u && u.length > 5) return;
|
|
@@ -187,143 +187,143 @@ function I(e) {
|
|
|
187
187
|
typeof l[m] == "string" && (a[m] = l[m]);
|
|
188
188
|
return { preset: i.id, fields: u, brand: a };
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function je(e, s, o) {
|
|
191
191
|
const i = new Set(e.fields.filter((l) => l.field !== s && l.field !== e.rowKey).map((l) => l.field)), u = o?.filter((l) => i.has(l));
|
|
192
|
-
return
|
|
192
|
+
return Le(e, s, u).map((l) => l.field);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const o = kt(), i = b(() => ({ ...Tt, ...e.messages })), u = b(() => e.title ?? i.value.title), l = { preset: e.preset, brand: e.brand, fields: e.fields }, a =
|
|
196
|
-
let v,
|
|
197
|
-
|
|
194
|
+
function Qt(e, s) {
|
|
195
|
+
const o = kt(), i = b(() => ({ ...Tt, ...e.messages })), u = b(() => e.title ?? i.value.title), l = { preset: e.preset, brand: e.brand, fields: e.fields }, a = Ce(e.modelValue ? T(e.modelValue) : be(e.schema, u.value, e.identityField, l, e.dataContract)), m = Ce(T(a.value)), y = D(!1), g = Ce();
|
|
196
|
+
let v, h;
|
|
197
|
+
vt(() => {
|
|
198
198
|
e.modelValue || s(T(a.value));
|
|
199
199
|
});
|
|
200
|
-
const M = D("preview"), F = D("all"), V = D(1),
|
|
200
|
+
const M = D("preview"), F = D("all"), V = D(1), se = D(!1), oe = D(!1), w = D(), G = Vt(() => e.beforeDiscard), B = b(() => oe.value || G.pending.value || y.value && !w.value || w.value?.saving === !0 || w.value?.blocked === !0 || o.state.printing || o.state.exporting !== null), _ = D(""), te = b(() => Qe(e.schema, e.identityField)), z = D(I(a.value)?.preset ?? (e.modelValue ? void 0 : e.preset ?? "paired")), O = D(I(a.value)?.brand?.name ?? e.brand?.name ?? ""), Q = D(I(a.value)?.brand?.tagline ?? e.brand?.tagline ?? ""), R = D(je(e.schema, te.value, I(a.value)?.fields ?? e.fields)), ae = D(""), Y = b(() => e.schema.fields.filter((n) => n.field !== te.value && n.field !== e.schema.rowKey)), re = b(() => R.value.map((n) => ({ field: n, label: e.schema.fields.find((p) => p.field === n)?.label ?? n }))), ge = b(() => {
|
|
201
201
|
const n = ae.value.trim().toLocaleLowerCase();
|
|
202
|
-
return
|
|
203
|
-
}),
|
|
202
|
+
return Y.value.filter((p) => `${p.label ?? ""} ${p.field}`.toLocaleLowerCase().includes(n)).slice(0, 30);
|
|
203
|
+
}), Z = b(() => {
|
|
204
204
|
const n = a.value.template.pages[0]?.components.find((p) => p.kind === "image" && p.meta?.labelBrandLogo);
|
|
205
205
|
return n?.kind === "image" ? n.imageData : e.brand?.logoData;
|
|
206
206
|
}), he = b(() => ({
|
|
207
207
|
preset: z.value,
|
|
208
208
|
fields: R.value,
|
|
209
|
-
brand: { ...e.brand, ...
|
|
209
|
+
brand: { ...e.brand, ...Z.value ? { logoData: Z.value } : {}, name: O.value, tagline: Q.value }
|
|
210
210
|
}));
|
|
211
|
-
let
|
|
212
|
-
const
|
|
211
|
+
let W = JSON.stringify(I(a.value));
|
|
212
|
+
const De = b(() => {
|
|
213
213
|
const n = I(a.value);
|
|
214
214
|
if (!n) return !0;
|
|
215
215
|
try {
|
|
216
|
-
const p = be(e.schema, u.value, e.identityField, { ...n, brand: { ...n.brand, ...
|
|
217
|
-
return
|
|
216
|
+
const p = be(e.schema, u.value, e.identityField, { ...n, brand: { ...n.brand, ...Z.value ? { logoData: Z.value } : {} } });
|
|
217
|
+
return jt(a.value, p);
|
|
218
218
|
} catch {
|
|
219
219
|
return !0;
|
|
220
220
|
}
|
|
221
|
-
}), $ = D(!1),
|
|
222
|
-
function
|
|
221
|
+
}), $ = D(!1), X = b(() => z.value !== I(a.value)?.preset), le = () => JSON.stringify({ preset: z.value, fields: R.value, name: O.value, tagline: Q.value }), ue = D(le()), J = b(() => le() !== ue.value), de = b(() => Me(a.value)), ye = b(() => Me(m.value)), ne = b(() => de.value !== ye.value), Fe = b(() => J.value || ne.value || w.value?.pendingLocalChanges === !0);
|
|
222
|
+
function ce() {
|
|
223
223
|
$.value = !1;
|
|
224
224
|
const n = I(a.value);
|
|
225
|
-
z.value = n?.preset, R.value =
|
|
225
|
+
z.value = n?.preset, R.value = je(e.schema, te.value, n?.fields ?? e.fields), O.value = n?.brand?.name ?? e.brand?.name ?? "", Q.value = n?.brand?.tagline ?? e.brand?.tagline ?? "", W = JSON.stringify(n), ue.value = le();
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function H(n) {
|
|
228
228
|
const p = I(n), C = JSON.stringify(p);
|
|
229
|
-
C !==
|
|
229
|
+
C !== W && (W = C, ce());
|
|
230
230
|
}
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
let N = !1;
|
|
232
|
+
Ge(() => {
|
|
233
|
+
N = !0, h?.abort();
|
|
234
234
|
});
|
|
235
|
-
const
|
|
235
|
+
const fe = $t();
|
|
236
236
|
_t({ get defaults() {
|
|
237
|
-
return { ...e.preview, assets: { ...
|
|
237
|
+
return { ...e.preview, assets: { ...fe, ...e.preview?.assets, assetRenderers: { ...fe.assetRenderers, ...e.preview?.assets?.assetRenderers } } };
|
|
238
238
|
} }), ee(w, (n) => {
|
|
239
|
-
const p =
|
|
239
|
+
const p = g.value;
|
|
240
240
|
if (!n || !p) return;
|
|
241
241
|
const C = a.value;
|
|
242
|
-
|
|
243
|
-
}, { flush: "post" }), ee([z, R, O,
|
|
242
|
+
Me(p) !== de.value && n.applyTemplate?.(C.template), g.value = void 0, v = void 0;
|
|
243
|
+
}, { flush: "post" }), ee([z, R, O, Q], () => {
|
|
244
244
|
$.value = !1;
|
|
245
245
|
}), ee(() => e.modelValue, (n) => {
|
|
246
|
-
n &&
|
|
246
|
+
n && Me(n) !== de.value && (a.value = T(n), m.value = T(n), v = void 0, H(n));
|
|
247
247
|
}), ee(() => e.rows, () => {
|
|
248
248
|
F.value = "all", V.value = 1;
|
|
249
249
|
});
|
|
250
|
-
function
|
|
251
|
-
_.value = "", a.value = n,
|
|
250
|
+
function A(n) {
|
|
251
|
+
_.value = "", a.value = n, H(n), s(n);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function K(n, p) {
|
|
254
254
|
p && R.value.length < 5 && !R.value.includes(n) ? R.value = [...R.value, n] : p || (R.value = R.value.filter((C) => C !== n));
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
if (B.value ||
|
|
256
|
+
function f(n = !1) {
|
|
257
|
+
if (B.value || N) return !1;
|
|
258
258
|
if (!z.value)
|
|
259
259
|
return _.value = i.value.choosePreset, !1;
|
|
260
260
|
if (w.value?.canApply === !1)
|
|
261
261
|
return _.value = w.value.saveReason || i.value.applyFirst, !1;
|
|
262
|
-
if (
|
|
262
|
+
if (X.value && !n)
|
|
263
263
|
return $.value = !0, !1;
|
|
264
264
|
try {
|
|
265
265
|
const p = I(a.value);
|
|
266
266
|
let C;
|
|
267
|
-
if (n ? C =
|
|
267
|
+
if (n ? C = Gt(a.value, e.schema, u.value, e.identityField, he.value) : p && (C = Ut(a.value, e.schema, u.value, e.identityField, p, he.value)), !C)
|
|
268
268
|
return _.value = i.value.contentNeedsDesign, !1;
|
|
269
269
|
if (w.value?.applyTemplate) {
|
|
270
270
|
if (!w.value.applyTemplate(C.template))
|
|
271
271
|
return _.value = i.value.saveFailed, !1;
|
|
272
272
|
} else
|
|
273
|
-
v = T(a.value),
|
|
274
|
-
return $.value = !1,
|
|
273
|
+
v = T(a.value), A(C);
|
|
274
|
+
return $.value = !1, ue.value = le(), !0;
|
|
275
275
|
} catch (p) {
|
|
276
276
|
return _.value = p instanceof Error ? p.message : i.value.saveFailed, !1;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const c = b(() => F.value === "all" ? e.rows : Number.isSafeInteger(V.value) && e.rows[V.value - 1] ? [e.rows[V.value - 1]] : []), U = b(() => a.value.template.repeat?.dataset ?? "records"), We = b(() => ({ [U.value]: c.value })), Xe = b(() => ({ [U.value]: c.value.slice(0, 3) })), et = b(() => ({ [U.value]: e.schema })), tt = b(() => [{ id: U.value, label: u.value, rowKey: e.schema.rowKey, fields: e.schema.fields }]), at = b(() => a.value.template.pages[0]), Oe = b(() => a.value.template.pages.length), lt = b(() => {
|
|
280
280
|
const n = a.value.template.repeat?.copies ?? 1;
|
|
281
281
|
return typeof n == "number" ? n : void 0;
|
|
282
|
-
}),
|
|
282
|
+
}), nt = b(() => {
|
|
283
283
|
const n = a.value.template.repeat?.copies;
|
|
284
284
|
return typeof n == "object" ? n.field : void 0;
|
|
285
285
|
}), $e = b(() => {
|
|
286
|
-
const n =
|
|
286
|
+
const n = nt.value;
|
|
287
287
|
if (!n) return;
|
|
288
288
|
let p = 0;
|
|
289
|
-
for (const C of
|
|
289
|
+
for (const C of c.value) {
|
|
290
290
|
const x = Object.getOwnPropertyDescriptor(C, n)?.value;
|
|
291
291
|
if (typeof x != "number" || !Number.isSafeInteger(x) || x < 1 || x > 1e3) return;
|
|
292
292
|
p += x;
|
|
293
293
|
}
|
|
294
294
|
return p;
|
|
295
|
-
}),
|
|
296
|
-
const n =
|
|
297
|
-
return n !== void 0 ? Number.isSafeInteger(n) && n >= 1 && n <= 1e3 ?
|
|
298
|
-
}),
|
|
299
|
-
const n =
|
|
295
|
+
}), it = b(() => {
|
|
296
|
+
const n = lt.value;
|
|
297
|
+
return n !== void 0 ? Number.isSafeInteger(n) && n >= 1 && n <= 1e3 ? c.value.length * n * Oe.value : void 0 : $e.value === void 0 ? void 0 : $e.value * Oe.value;
|
|
298
|
+
}), we = b(() => It(a.value.template)), st = b(() => {
|
|
299
|
+
const n = we.value;
|
|
300
300
|
return n ? i.value.sheetHint.replace("{columns}", String(n.columns)).replace("{rows}", String(n.rows)).replace("{capacity}", String(n.capacity)) : i.value.sheetUnavailable;
|
|
301
301
|
});
|
|
302
|
-
ee(
|
|
303
|
-
n || (
|
|
302
|
+
ee(we, (n) => {
|
|
303
|
+
n || (se.value = !1);
|
|
304
304
|
});
|
|
305
|
-
const
|
|
306
|
-
const n = Ft({ labels: Et({ template: a.value.template, rows:
|
|
305
|
+
const ot = b(() => {
|
|
306
|
+
const n = Ft({ labels: Et({ template: a.value.template, rows: c.value, dataSchema: e.schema }) }), p = se.value ? we.value : void 0, C = e.dataContract ? Nt(a.value.template, e.dataContract) : void 0;
|
|
307
307
|
return async (x) => {
|
|
308
|
-
if (C && !C.ok) throw new Error(C.issues.map((
|
|
308
|
+
if (C && !C.ok) throw new Error(C.issues.map((mt) => mt.message).join(";"));
|
|
309
309
|
const Ae = await n(x);
|
|
310
310
|
return p ? xt(Ae, { ...p, signal: x.signal }) : Ae;
|
|
311
311
|
};
|
|
312
312
|
}), Ie = async (n, p) => {
|
|
313
|
-
if (
|
|
313
|
+
if (N || p.signal.aborted) throw new DOMException("标签模板保存已取消", "AbortError");
|
|
314
314
|
const C = T(n), x = T(e.save ? await e.save(C, p) : C);
|
|
315
315
|
if (x.id !== n.id) throw new Error(i.value.invalidSavedTemplate);
|
|
316
|
-
if (
|
|
317
|
-
return m.value = T(x),
|
|
316
|
+
if (N || p.signal.aborted) throw new DOMException("标签模板保存已取消", "AbortError");
|
|
317
|
+
return m.value = T(x), A(x), x;
|
|
318
318
|
};
|
|
319
319
|
async function Pe() {
|
|
320
|
-
if (!(B.value ||
|
|
321
|
-
if (J.value &&
|
|
320
|
+
if (!(B.value || N)) {
|
|
321
|
+
if (J.value && X.value) {
|
|
322
322
|
_.value = i.value.applyLayoutFirst;
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
if (!(J.value && !
|
|
326
|
-
|
|
325
|
+
if (!(J.value && !f())) {
|
|
326
|
+
oe.value = !0;
|
|
327
327
|
try {
|
|
328
328
|
if (w.value) {
|
|
329
329
|
if (w.value.canApply === !1) {
|
|
@@ -334,38 +334,38 @@ function Gt(e, s) {
|
|
|
334
334
|
_.value = i.value.saveFailed;
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
|
-
} else ne.value && (
|
|
338
|
-
if (!
|
|
337
|
+
} else ne.value && (h = new AbortController(), await Ie(a.value, { expectedRevision: a.value.revision, signal: h.signal }), v = void 0);
|
|
338
|
+
if (!N)
|
|
339
339
|
return _.value = "", T(a.value);
|
|
340
340
|
} catch (n) {
|
|
341
|
-
|
|
341
|
+
N || (_.value = n instanceof Error ? n.message : i.value.saveFailed);
|
|
342
342
|
} finally {
|
|
343
|
-
|
|
343
|
+
oe.value = !1, h = void 0;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
async function ze(n) {
|
|
349
349
|
if (!(B.value || n === M.value))
|
|
350
|
-
if (n === "design" && !
|
|
351
|
-
if (J.value &&
|
|
350
|
+
if (n === "design" && !y.value) {
|
|
351
|
+
if (J.value && X.value) {
|
|
352
352
|
_.value = i.value.applyLayoutFirst;
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
|
-
if (J.value && !
|
|
356
|
-
|
|
355
|
+
if (J.value && !f()) return;
|
|
356
|
+
g.value = v, y.value = !0, M.value = n;
|
|
357
357
|
} else await Pe() && (M.value = n);
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
359
|
+
function rt(n) {
|
|
360
|
+
y.value = !1, M.value = "preview", _.value = `${i.value.designLoadFailed} ${n instanceof Error ? n.message : String(n)}`;
|
|
361
361
|
}
|
|
362
362
|
let Ee = !1;
|
|
363
|
-
const
|
|
364
|
-
async function
|
|
363
|
+
const ut = (n) => Ee || G.request(n);
|
|
364
|
+
async function dt() {
|
|
365
365
|
if (B.value) return !1;
|
|
366
366
|
const n = w.value?.pendingLocalChanges === !0;
|
|
367
367
|
if (!n && !ne.value && !J.value) return !0;
|
|
368
|
-
if (!(n && w.value ? await w.value.guardChanges() : await
|
|
368
|
+
if (!(n && w.value ? await w.value.guardChanges() : await G.request({ reason: "replace", document: T(a.value), pendingLocalChanges: !0 })) || N) return !1;
|
|
369
369
|
if (n && w.value) {
|
|
370
370
|
Ee = !0;
|
|
371
371
|
try {
|
|
@@ -374,46 +374,46 @@ function Gt(e, s) {
|
|
|
374
374
|
Ee = !1;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
return
|
|
377
|
+
return A(T(m.value)), v = void 0, ce(), !0;
|
|
378
378
|
}
|
|
379
379
|
const Je = b(() => M.value === "preview" && !B.value && o.state.canPrint);
|
|
380
|
-
async function dt() {
|
|
381
|
-
return await ze("preview"), !E && M.value === "preview";
|
|
382
|
-
}
|
|
383
380
|
async function ct() {
|
|
381
|
+
return await ze("preview"), !N && M.value === "preview";
|
|
382
|
+
}
|
|
383
|
+
async function ft() {
|
|
384
384
|
Je.value && await o.print();
|
|
385
385
|
}
|
|
386
|
-
return { m: i, notice: _, title: u, document: a, mode: M, preview: o, showPreview:
|
|
386
|
+
return { m: i, notice: _, title: u, document: a, mode: M, preview: o, showPreview: ct, print: ft, canPrint: Je, editorVisited: y, editorInitialDocument: g, failDesignLoad: rt, sheetLayout: we, sheetHint: st, rebuilding: $, layoutChanged: X, record: F, recordIndex: V, sheet: se, busy: B, editor: w, rows: c, datasets: We, designDatasets: Xe, schemas: et, bindings: tt, paper: at, labelCount: it, fetcher: ot, update: A, save: Ie, navigate: ze, prepare: Pe, guardChanges: dt, preset: z, presets: ke, brandName: O, brandTagline: Q, fields: R, fieldQuery: ae, selectedFields: re, availableFields: ge, fieldCount: b(() => Y.value.length), configurationDirty: J, pendingLocalChanges: Fe, custom: De, toggleField: K, applyConfiguration: f, requestRebuild: () => {
|
|
387
387
|
$.value = !0;
|
|
388
388
|
}, cancelRebuild: () => {
|
|
389
389
|
$.value = !1;
|
|
390
|
-
}, restoreConfiguration:
|
|
390
|
+
}, restoreConfiguration: ce, beforeDiscard: ut, confirmation: G.confirmation, decideDiscard: G.decide };
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const Yt = ["aria-label"], Zt = { class: "mr-label-context" }, Wt = { class: "mr-label-identity" }, Xt = { class: "mr-label-spec" }, ea = ["disabled"], ta = ["aria-label"], aa = ["aria-pressed", "onClick"], la = { class: "mr-label-fields" }, na = {
|
|
393
393
|
key: 0,
|
|
394
394
|
class: "mr-label-selected-fields"
|
|
395
|
-
},
|
|
395
|
+
}, ia = ["aria-label", "onClick"], sa = { class: "mr-label-field-search" }, oa = ["aria-label", "placeholder"], ra = { class: "mr-label-field-options" }, ua = ["checked", "disabled", "onChange"], da = { key: 0 }, ca = { key: 1 }, fa = { class: "mr-label-brand" }, ma = ["placeholder"], va = ["disabled"], pa = {
|
|
396
396
|
key: 1,
|
|
397
397
|
class: "mr-label-rebuild",
|
|
398
398
|
role: "alert"
|
|
399
|
-
},
|
|
399
|
+
}, ba = {
|
|
400
400
|
key: 3,
|
|
401
401
|
class: "mr-label-reflow-hint"
|
|
402
|
-
},
|
|
402
|
+
}, ga = { class: "mr-label-reflow-hint" }, ha = { class: "mr-label-record" }, ya = ["disabled"], wa = { value: "all" }, Sa = { value: "single" }, Ma = {
|
|
403
403
|
key: 0,
|
|
404
404
|
class: "mr-label-record-index"
|
|
405
|
-
},
|
|
405
|
+
}, Ca = ["max", "aria-label", "disabled"], ka = { class: "mr-label-count" }, _a = { class: "mr-label-help" }, La = { class: "mr-label-main" }, Ra = { class: "mr-label-bar" }, Da = ["aria-label"], Fa = ["aria-pressed", "disabled"], Ea = ["aria-pressed", "disabled"], Na = {
|
|
406
406
|
key: 0,
|
|
407
407
|
class: "mr-label-notice",
|
|
408
408
|
role: "status"
|
|
409
|
-
},
|
|
409
|
+
}, xa = ["aria-label"], Ta = { class: "mr-label-imposition" }, Va = ["disabled"], Oa = {
|
|
410
410
|
key: 3,
|
|
411
411
|
class: "mr-label-editor"
|
|
412
|
-
},
|
|
412
|
+
}, $a = {
|
|
413
413
|
key: 0,
|
|
414
414
|
class: "mr-label-editor-loading",
|
|
415
415
|
role: "status"
|
|
416
|
-
},
|
|
416
|
+
}, Ba = /* @__PURE__ */ pt({
|
|
417
417
|
__name: "ReportLabelStudio",
|
|
418
418
|
props: {
|
|
419
419
|
showSave: { type: Boolean, default: !0 },
|
|
@@ -433,23 +433,23 @@ const Qt = ["aria-label"], Yt = { class: "mr-label-context" }, Zt = { class: "mr
|
|
|
433
433
|
},
|
|
434
434
|
emits: ["update:modelValue"],
|
|
435
435
|
setup(e, { expose: s, emit: o }) {
|
|
436
|
-
const i = e, u = o, l =
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}), ee(l.editorVisited, async (
|
|
441
|
-
if (!(!
|
|
436
|
+
const i = e, u = o, l = Qt(i, (K) => u("update:modelValue", K)), { m: a, notice: m, title: y, document: g, mode: v, record: h, recordIndex: M, sheet: F, busy: V, editor: se, rows: oe, designDatasets: w, schemas: G, bindings: B, paper: _, labelCount: te, fetcher: z, preset: O, presets: Q, brandName: R, brandTagline: ae, fields: Y, fieldQuery: re, selectedFields: ge, availableFields: Z, fieldCount: he, configurationDirty: W, pendingLocalChanges: De, custom: $, confirmation: X, editorVisited: le, editorInitialDocument: ue, sheetLayout: J, sheetHint: de, rebuilding: ye, layoutChanged: ne } = l, { previewVisited: Fe, visibleFetcher: ce } = Ot(g, v, z), H = Ce();
|
|
437
|
+
let N = !1;
|
|
438
|
+
Ge(() => {
|
|
439
|
+
N = !0;
|
|
440
|
+
}), ee(l.editorVisited, async (K) => {
|
|
441
|
+
if (!(!K || H.value))
|
|
442
442
|
try {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
} catch (
|
|
446
|
-
|
|
443
|
+
const f = await import("./designer-DhrE7jzw.js").then((c) => c.w);
|
|
444
|
+
N || (H.value = bt(f.default));
|
|
445
|
+
} catch (f) {
|
|
446
|
+
N || l.failDesignLoad(f);
|
|
447
447
|
}
|
|
448
448
|
});
|
|
449
449
|
const fe = D();
|
|
450
|
-
let
|
|
451
|
-
return ee(
|
|
452
|
-
|
|
450
|
+
let A = null;
|
|
451
|
+
return ee(X, async (K) => {
|
|
452
|
+
K ? (A = window.document.activeElement, await gt(), fe.value?.focus()) : A?.isConnected && (A.focus(), A = null);
|
|
453
453
|
}), s({ guardChanges: l.guardChanges, prepare: l.prepare, preview: l.showPreview, print: l.print, get mode() {
|
|
454
454
|
return v.value;
|
|
455
455
|
}, get canPrint() {
|
|
@@ -457,27 +457,27 @@ const Qt = ["aria-label"], Yt = { class: "mr-label-context" }, Zt = { class: "mr
|
|
|
457
457
|
}, get busy() {
|
|
458
458
|
return V.value;
|
|
459
459
|
}, get pendingLocalChanges() {
|
|
460
|
-
return
|
|
461
|
-
} }), (
|
|
460
|
+
return De.value;
|
|
461
|
+
} }), (K, f) => (S(), k("section", {
|
|
462
462
|
class: qe(["mr-label-studio", { "is-design": t(v) === "design" }]),
|
|
463
|
-
"aria-label": t(
|
|
463
|
+
"aria-label": t(y)
|
|
464
464
|
}, [
|
|
465
|
-
r("aside",
|
|
466
|
-
r("div",
|
|
465
|
+
r("aside", Zt, [
|
|
466
|
+
r("div", Wt, [
|
|
467
467
|
me(pe, {
|
|
468
468
|
name: "file",
|
|
469
469
|
size: 18
|
|
470
470
|
}),
|
|
471
|
-
r("strong", null, d(t(
|
|
471
|
+
r("strong", null, d(t(y)), 1),
|
|
472
472
|
r("small", null, d(t($) ? t(a).customTemplate : t(a).readyTemplate), 1)
|
|
473
473
|
]),
|
|
474
|
-
r("div",
|
|
474
|
+
r("div", Xt, [
|
|
475
475
|
r("strong", null, [
|
|
476
476
|
L(d(t(_)?.widthMm) + " ", 1),
|
|
477
|
-
|
|
477
|
+
f[16] || (f[16] = r("i", null, "×", -1)),
|
|
478
478
|
L(" " + d(t(_)?.heightMm), 1)
|
|
479
479
|
]),
|
|
480
|
-
r("span", null, "mm · " + d(t(
|
|
480
|
+
r("span", null, "mm · " + d(t(g).template.pages.length) + " " + d(t(a).faces), 1)
|
|
481
481
|
]),
|
|
482
482
|
r("fieldset", {
|
|
483
483
|
class: "mr-label-quick",
|
|
@@ -488,175 +488,175 @@ const Qt = ["aria-label"], Yt = { class: "mr-label-context" }, Zt = { class: "mr
|
|
|
488
488
|
class: "mr-label-presets",
|
|
489
489
|
"aria-label": t(a).layout
|
|
490
490
|
}, [
|
|
491
|
-
(S(!0), k(ve, null, Ne(t(
|
|
492
|
-
key:
|
|
491
|
+
(S(!0), k(ve, null, Ne(t(Q), (c) => (S(), k("button", {
|
|
492
|
+
key: c.id,
|
|
493
493
|
type: "button",
|
|
494
|
-
"aria-pressed": t(O) ===
|
|
495
|
-
onClick: (
|
|
494
|
+
"aria-pressed": t(O) === c.id,
|
|
495
|
+
onClick: (U) => O.value = c.id
|
|
496
496
|
}, [
|
|
497
497
|
r("span", {
|
|
498
|
-
class: qe(["mr-label-preset-art", `is-${
|
|
498
|
+
class: qe(["mr-label-preset-art", `is-${c.id}`]),
|
|
499
499
|
"aria-hidden": "true"
|
|
500
|
-
}, [...
|
|
500
|
+
}, [...f[17] || (f[17] = [
|
|
501
501
|
r("i", null, null, -1),
|
|
502
502
|
r("i", null, null, -1),
|
|
503
503
|
r("i", null, null, -1)
|
|
504
504
|
])], 2),
|
|
505
505
|
r("span", null, [
|
|
506
|
-
r("strong", null, d(t(a)[`${
|
|
507
|
-
r("small", null, d(
|
|
506
|
+
r("strong", null, d(t(a)[`${c.id}Preset`]), 1),
|
|
507
|
+
r("small", null, d(c.widthMm) + " × " + d(c.heightMm) + " · " + d(c.faces) + " " + d(t(a).faces), 1)
|
|
508
508
|
])
|
|
509
|
-
], 8,
|
|
510
|
-
], 8,
|
|
511
|
-
r("details",
|
|
509
|
+
], 8, aa))), 128))
|
|
510
|
+
], 8, ta),
|
|
511
|
+
r("details", la, [
|
|
512
512
|
r("summary", null, [
|
|
513
513
|
L(d(t(a).fields) + " ", 1),
|
|
514
|
-
r("span", null, d(t(
|
|
514
|
+
r("span", null, d(t(Y).length) + " / 5", 1)
|
|
515
515
|
]),
|
|
516
|
-
t(ge).length ? (S(), k("div",
|
|
517
|
-
(S(!0), k(ve, null, Ne(t(ge), (
|
|
518
|
-
key:
|
|
516
|
+
t(ge).length ? (S(), k("div", na, [
|
|
517
|
+
(S(!0), k(ve, null, Ne(t(ge), (c) => (S(), k("button", {
|
|
518
|
+
key: c.field,
|
|
519
519
|
type: "button",
|
|
520
|
-
"aria-label": `${t(a).removeField} ${
|
|
521
|
-
onClick: (
|
|
520
|
+
"aria-label": `${t(a).removeField} ${c.label}`,
|
|
521
|
+
onClick: (U) => t(l).toggleField(c.field, !1)
|
|
522
522
|
}, [
|
|
523
|
-
L(d(
|
|
524
|
-
|
|
525
|
-
], 8,
|
|
526
|
-
])) :
|
|
527
|
-
r("label",
|
|
523
|
+
L(d(c.label) + " ", 1),
|
|
524
|
+
f[18] || (f[18] = r("span", { "aria-hidden": "true" }, "×", -1))
|
|
525
|
+
], 8, ia))), 128))
|
|
526
|
+
])) : E("", !0),
|
|
527
|
+
r("label", sa, [
|
|
528
528
|
me(pe, {
|
|
529
529
|
name: "search",
|
|
530
530
|
size: 13
|
|
531
531
|
}),
|
|
532
|
-
|
|
533
|
-
"onUpdate:modelValue":
|
|
532
|
+
j(r("input", {
|
|
533
|
+
"onUpdate:modelValue": f[0] || (f[0] = (c) => ie(re) ? re.value = c : null),
|
|
534
534
|
type: "search",
|
|
535
535
|
"aria-label": t(a).findField,
|
|
536
536
|
placeholder: t(a).findField
|
|
537
|
-
}, null, 8,
|
|
538
|
-
[
|
|
537
|
+
}, null, 8, oa), [
|
|
538
|
+
[Se, t(re)]
|
|
539
539
|
])
|
|
540
540
|
]),
|
|
541
|
-
r("div",
|
|
542
|
-
(S(!0), k(ve, null, Ne(t(
|
|
543
|
-
key:
|
|
541
|
+
r("div", ra, [
|
|
542
|
+
(S(!0), k(ve, null, Ne(t(Z), (c) => (S(), k("label", {
|
|
543
|
+
key: c.field
|
|
544
544
|
}, [
|
|
545
545
|
r("input", {
|
|
546
546
|
type: "checkbox",
|
|
547
|
-
checked: t(
|
|
548
|
-
disabled: !t(
|
|
549
|
-
onChange: (
|
|
550
|
-
}, null, 40,
|
|
551
|
-
r("span", null, d(
|
|
547
|
+
checked: t(Y).includes(c.field),
|
|
548
|
+
disabled: !t(Y).includes(c.field) && t(Y).length >= 5,
|
|
549
|
+
onChange: (U) => t(l).toggleField(c.field, U.target.checked)
|
|
550
|
+
}, null, 40, ua),
|
|
551
|
+
r("span", null, d(c.label ?? c.field), 1)
|
|
552
552
|
]))), 128)),
|
|
553
|
-
t(
|
|
553
|
+
t(Z).length ? E("", !0) : (S(), k("p", da, d(t(a).noFields), 1))
|
|
554
554
|
]),
|
|
555
555
|
r("small", null, d(t(a).fieldLimit), 1),
|
|
556
|
-
t(he) > 30 ? (S(), k("small",
|
|
556
|
+
t(he) > 30 ? (S(), k("small", ca, d(t(a).fieldSearchHint), 1)) : E("", !0)
|
|
557
557
|
]),
|
|
558
|
-
r("details",
|
|
558
|
+
r("details", fa, [
|
|
559
559
|
r("summary", null, d(t(a).brand), 1),
|
|
560
560
|
r("label", null, [
|
|
561
561
|
L(d(t(a).brandName), 1),
|
|
562
|
-
|
|
563
|
-
"onUpdate:modelValue":
|
|
562
|
+
j(r("input", {
|
|
563
|
+
"onUpdate:modelValue": f[1] || (f[1] = (c) => ie(R) ? R.value = c : null),
|
|
564
564
|
maxlength: "80",
|
|
565
|
-
placeholder: t(
|
|
566
|
-
}, null, 8,
|
|
567
|
-
[
|
|
565
|
+
placeholder: t(y)
|
|
566
|
+
}, null, 8, ma), [
|
|
567
|
+
[Se, t(R)]
|
|
568
568
|
])
|
|
569
569
|
]),
|
|
570
570
|
r("label", null, [
|
|
571
571
|
L(d(t(a).brandTagline), 1),
|
|
572
|
-
|
|
573
|
-
"onUpdate:modelValue":
|
|
572
|
+
j(r("input", {
|
|
573
|
+
"onUpdate:modelValue": f[2] || (f[2] = (c) => ie(ae) ? ae.value = c : null),
|
|
574
574
|
maxlength: "120"
|
|
575
575
|
}, null, 512), [
|
|
576
|
-
[
|
|
576
|
+
[Se, t(ae)]
|
|
577
577
|
])
|
|
578
578
|
])
|
|
579
579
|
]),
|
|
580
580
|
r("button", {
|
|
581
581
|
class: "mr-label-apply",
|
|
582
582
|
type: "button",
|
|
583
|
-
disabled: !t(
|
|
584
|
-
onClick:
|
|
583
|
+
disabled: !t(W) || !t(O),
|
|
584
|
+
onClick: f[3] || (f[3] = (c) => t(l).applyConfiguration())
|
|
585
585
|
}, [
|
|
586
586
|
me(pe, {
|
|
587
587
|
name: "arrow-right",
|
|
588
588
|
size: 13
|
|
589
589
|
}),
|
|
590
590
|
L(d(t(ne) ? t(a).applyLayout : t(a).applyContent), 1)
|
|
591
|
-
], 8,
|
|
591
|
+
], 8, va),
|
|
592
592
|
t($) && t(O) && !t(ye) ? (S(), k("button", {
|
|
593
593
|
key: 0,
|
|
594
594
|
class: "mr-label-reset-configuration mr-label-rebuild-current",
|
|
595
595
|
type: "button",
|
|
596
|
-
onClick:
|
|
597
|
-
(...
|
|
598
|
-
}, d(t(a).rebuildCurrent), 1)) :
|
|
599
|
-
t(ye) ? (S(), k("div",
|
|
596
|
+
onClick: f[4] || (f[4] = //@ts-ignore
|
|
597
|
+
(...c) => t(l).requestRebuild && t(l).requestRebuild(...c))
|
|
598
|
+
}, d(t(a).rebuildCurrent), 1)) : E("", !0),
|
|
599
|
+
t(ye) ? (S(), k("div", pa, [
|
|
600
600
|
r("strong", null, d(t(a).rebuildTitle), 1),
|
|
601
601
|
r("p", null, d(t(a).rebuildDescription), 1),
|
|
602
602
|
r("div", null, [
|
|
603
603
|
r("button", {
|
|
604
604
|
type: "button",
|
|
605
|
-
onClick:
|
|
606
|
-
(...
|
|
605
|
+
onClick: f[5] || (f[5] = //@ts-ignore
|
|
606
|
+
(...c) => t(l).cancelRebuild && t(l).cancelRebuild(...c))
|
|
607
607
|
}, d(t(a).cancelRebuild), 1),
|
|
608
608
|
r("button", {
|
|
609
609
|
type: "button",
|
|
610
|
-
onClick:
|
|
610
|
+
onClick: f[6] || (f[6] = (c) => t(l).applyConfiguration(!0))
|
|
611
611
|
}, d(t(a).confirmRebuild), 1)
|
|
612
612
|
])
|
|
613
|
-
])) :
|
|
614
|
-
t(
|
|
613
|
+
])) : E("", !0),
|
|
614
|
+
t(W) ? (S(), k("button", {
|
|
615
615
|
key: 2,
|
|
616
616
|
class: "mr-label-reset-configuration",
|
|
617
617
|
type: "button",
|
|
618
|
-
onClick:
|
|
619
|
-
(...
|
|
620
|
-
}, d(t(a).restoreConfiguration), 1)) :
|
|
621
|
-
t(
|
|
622
|
-
r("p",
|
|
623
|
-
], 8,
|
|
624
|
-
r("label",
|
|
618
|
+
onClick: f[7] || (f[7] = //@ts-ignore
|
|
619
|
+
(...c) => t(l).restoreConfiguration && t(l).restoreConfiguration(...c))
|
|
620
|
+
}, d(t(a).restoreConfiguration), 1)) : E("", !0),
|
|
621
|
+
t(W) && !t(O) ? (S(), k("p", ba, d(t(a).choosePreset), 1)) : E("", !0),
|
|
622
|
+
r("p", ga, d(t(ne) ? t(a).reflowHint : t(a).contentHint), 1)
|
|
623
|
+
], 8, ea),
|
|
624
|
+
r("label", ha, [
|
|
625
625
|
L(d(t(a).records), 1),
|
|
626
|
-
|
|
627
|
-
"onUpdate:modelValue":
|
|
626
|
+
j(r("select", {
|
|
627
|
+
"onUpdate:modelValue": f[8] || (f[8] = (c) => ie(h) ? h.value = c : null),
|
|
628
628
|
disabled: t(V) || !i.rows.length
|
|
629
629
|
}, [
|
|
630
|
-
r("option",
|
|
631
|
-
r("option",
|
|
632
|
-
], 8,
|
|
633
|
-
[
|
|
630
|
+
r("option", wa, d(t(a).all) + " · " + d(i.rows.length), 1),
|
|
631
|
+
r("option", Sa, d(t(a).single), 1)
|
|
632
|
+
], 8, ya), [
|
|
633
|
+
[ht, t(h)]
|
|
634
634
|
])
|
|
635
635
|
]),
|
|
636
|
-
t(
|
|
636
|
+
t(h) === "single" ? (S(), k("label", Ma, [
|
|
637
637
|
L(d(t(a).record), 1),
|
|
638
|
-
|
|
639
|
-
"onUpdate:modelValue":
|
|
638
|
+
j(r("input", {
|
|
639
|
+
"onUpdate:modelValue": f[9] || (f[9] = (c) => ie(M) ? M.value = c : null),
|
|
640
640
|
type: "number",
|
|
641
641
|
min: "1",
|
|
642
642
|
max: i.rows.length,
|
|
643
643
|
"aria-label": t(a).record,
|
|
644
644
|
disabled: t(V)
|
|
645
|
-
}, null, 8,
|
|
645
|
+
}, null, 8, Ca), [
|
|
646
646
|
[
|
|
647
|
-
|
|
647
|
+
Se,
|
|
648
648
|
t(M),
|
|
649
649
|
void 0,
|
|
650
650
|
{ number: !0 }
|
|
651
651
|
]
|
|
652
652
|
]),
|
|
653
653
|
L(" / " + d(i.rows.length), 1)
|
|
654
|
-
])) :
|
|
655
|
-
r("p",
|
|
656
|
-
r("strong", null, d(t(
|
|
654
|
+
])) : E("", !0),
|
|
655
|
+
r("p", ka, [
|
|
656
|
+
r("strong", null, d(t(oe).length), 1),
|
|
657
657
|
L(" " + d(t(a).count) + " ", 1),
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
f[19] || (f[19] = r("span", null, "→", -1)),
|
|
659
|
+
f[20] || (f[20] = L()),
|
|
660
660
|
t(te) !== void 0 ? (S(), k(ve, { key: 0 }, [
|
|
661
661
|
r("strong", null, d(t(te)), 1),
|
|
662
662
|
L(" " + d(t(a).labels), 1)
|
|
@@ -664,49 +664,49 @@ const Qt = ["aria-label"], Yt = { class: "mr-label-context" }, Zt = { class: "mr
|
|
|
664
664
|
L(d(t(a).invalidCopies), 1)
|
|
665
665
|
], 64))
|
|
666
666
|
]),
|
|
667
|
-
r("details",
|
|
667
|
+
r("details", _a, [
|
|
668
668
|
r("summary", null, d(t(a).guide), 1),
|
|
669
669
|
r("p", null, d(t(a).help), 1),
|
|
670
670
|
r("p", null, d(t(a).printHint), 1)
|
|
671
671
|
])
|
|
672
672
|
]),
|
|
673
|
-
r("div",
|
|
674
|
-
r("header",
|
|
675
|
-
r("nav", { "aria-label": t(
|
|
673
|
+
r("div", La, [
|
|
674
|
+
r("header", Ra, [
|
|
675
|
+
r("nav", { "aria-label": t(y) }, [
|
|
676
676
|
r("button", {
|
|
677
677
|
type: "button",
|
|
678
678
|
"aria-pressed": t(v) === "preview",
|
|
679
679
|
disabled: t(V),
|
|
680
|
-
onClick:
|
|
680
|
+
onClick: f[10] || (f[10] = (c) => t(l).navigate("preview"))
|
|
681
681
|
}, [
|
|
682
682
|
me(pe, {
|
|
683
683
|
name: "file",
|
|
684
684
|
size: 14
|
|
685
685
|
}),
|
|
686
686
|
L(d(t(a).preview), 1)
|
|
687
|
-
], 8,
|
|
687
|
+
], 8, Fa),
|
|
688
688
|
r("button", {
|
|
689
689
|
type: "button",
|
|
690
690
|
"aria-pressed": t(v) === "design",
|
|
691
691
|
disabled: t(V),
|
|
692
|
-
onClick:
|
|
692
|
+
onClick: f[11] || (f[11] = (c) => t(l).navigate("design"))
|
|
693
693
|
}, [
|
|
694
694
|
me(pe, {
|
|
695
695
|
name: "settings",
|
|
696
696
|
size: 14
|
|
697
697
|
}),
|
|
698
698
|
L(d(t(a).design), 1)
|
|
699
|
-
], 8,
|
|
700
|
-
], 8,
|
|
699
|
+
], 8, Ea)
|
|
700
|
+
], 8, Da),
|
|
701
701
|
r("span", null, d(t(v) === "design" ? t(a).designHint : t(a).flow), 1)
|
|
702
702
|
]),
|
|
703
|
-
t(m) ? (S(), k("p",
|
|
704
|
-
t(
|
|
703
|
+
t(m) ? (S(), k("p", Na, d(t(m)), 1)) : E("", !0),
|
|
704
|
+
t(X) ? (S(), k("div", {
|
|
705
705
|
key: 1,
|
|
706
706
|
class: "mr-label-confirm",
|
|
707
707
|
role: "alertdialog",
|
|
708
708
|
"aria-label": t(a).discardTitle,
|
|
709
|
-
onKeydown:
|
|
709
|
+
onKeydown: f[14] || (f[14] = yt(wt((c) => t(l).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
|
|
710
710
|
}, [
|
|
711
711
|
r("div", null, [
|
|
712
712
|
r("strong", null, d(t(a).discardTitle), 1),
|
|
@@ -716,65 +716,68 @@ const Qt = ["aria-label"], Yt = { class: "mr-label-context" }, Zt = { class: "mr
|
|
|
716
716
|
ref_key: "keepEditingButton",
|
|
717
717
|
ref: fe,
|
|
718
718
|
type: "button",
|
|
719
|
-
onClick:
|
|
719
|
+
onClick: f[12] || (f[12] = (c) => t(l).decideDiscard(!1))
|
|
720
720
|
}, d(t(a).keepEditing), 513),
|
|
721
721
|
r("button", {
|
|
722
722
|
type: "button",
|
|
723
|
-
onClick:
|
|
723
|
+
onClick: f[13] || (f[13] = (c) => t(l).decideDiscard(!0))
|
|
724
724
|
}, d(t(a).discard), 1)
|
|
725
|
-
], 40,
|
|
726
|
-
t(
|
|
727
|
-
key:
|
|
725
|
+
], 40, xa)) : E("", !0),
|
|
726
|
+
t(Fe) ? j((S(), Be(t(Lt), {
|
|
727
|
+
key: t(g).id,
|
|
728
728
|
ref: t(l).preview.ref,
|
|
729
729
|
"report-id": "labels",
|
|
730
|
-
fetcher: t(
|
|
730
|
+
fetcher: t(ce),
|
|
731
|
+
refresh: { retainPrevious: !0, key: t(g).id },
|
|
731
732
|
"show-params": !1,
|
|
732
733
|
height: "100%",
|
|
733
734
|
toolbar: { exportFormats: ["pdf", "png", "html"], editing: !1, excelImport: !1 },
|
|
734
|
-
messages: { title: t(
|
|
735
|
+
messages: { title: t(y), empty: t(a).empty }
|
|
735
736
|
}, {
|
|
736
|
-
settings:
|
|
737
|
-
r("label",
|
|
738
|
-
|
|
739
|
-
"onUpdate:modelValue":
|
|
737
|
+
settings: St(() => [
|
|
738
|
+
r("label", Ta, [
|
|
739
|
+
j(r("input", {
|
|
740
|
+
"onUpdate:modelValue": f[15] || (f[15] = (c) => ie(F) ? F.value = c : null),
|
|
740
741
|
type: "checkbox",
|
|
741
742
|
disabled: !t(J)
|
|
742
|
-
}, null, 8,
|
|
743
|
-
[
|
|
743
|
+
}, null, 8, Va), [
|
|
744
|
+
[Mt, t(F)]
|
|
744
745
|
]),
|
|
745
746
|
L(d(t(a).sheet), 1),
|
|
746
|
-
r("small", null, d(t(
|
|
747
|
+
r("small", null, d(t(de)), 1)
|
|
747
748
|
])
|
|
748
749
|
]),
|
|
749
750
|
_: 1
|
|
750
|
-
}, 8, ["fetcher", "messages"]))
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
751
|
+
}, 8, ["fetcher", "refresh", "messages"])), [
|
|
752
|
+
[He, t(v) === "preview"]
|
|
753
|
+
]) : E("", !0),
|
|
754
|
+
t(le) ? j((S(), k("div", Oa, [
|
|
755
|
+
H.value ? E("", !0) : (S(), k("p", $a, d(t(a).designLoading), 1)),
|
|
756
|
+
H.value ? (S(), Be(Ct(H.value), {
|
|
754
757
|
key: 1,
|
|
755
758
|
ref_key: "editor",
|
|
756
|
-
ref:
|
|
757
|
-
"model-value": t(
|
|
759
|
+
ref: se,
|
|
760
|
+
"model-value": t(ue) ?? t(g),
|
|
758
761
|
mode: "design",
|
|
759
762
|
"show-mode-switch": !1,
|
|
760
763
|
"show-save": e.showSave,
|
|
761
764
|
capabilities: { params: !1 },
|
|
762
765
|
datasets: t(w),
|
|
763
|
-
"data-schemas": t(
|
|
766
|
+
"data-schemas": t(G),
|
|
764
767
|
"binding-datasets": t(B),
|
|
765
768
|
"binding-data-contract": e.dataContract,
|
|
766
769
|
save: t(l).save,
|
|
767
770
|
"before-discard": t(l).beforeDiscard,
|
|
768
771
|
preview: e.preview,
|
|
769
772
|
"onUpdate:modelValue": t(l).update
|
|
770
|
-
}, null, 8, ["model-value", "show-save", "datasets", "data-schemas", "binding-datasets", "binding-data-contract", "save", "before-discard", "preview", "onUpdate:modelValue"])) :
|
|
773
|
+
}, null, 8, ["model-value", "show-save", "datasets", "data-schemas", "binding-datasets", "binding-data-contract", "save", "before-discard", "preview", "onUpdate:modelValue"])) : E("", !0)
|
|
771
774
|
], 512)), [
|
|
772
|
-
[
|
|
773
|
-
]) :
|
|
775
|
+
[He, t(v) === "design"]
|
|
776
|
+
]) : E("", !0)
|
|
774
777
|
])
|
|
775
|
-
], 10,
|
|
778
|
+
], 10, Yt));
|
|
776
779
|
}
|
|
777
780
|
});
|
|
778
781
|
export {
|
|
779
|
-
|
|
782
|
+
Ba as default
|
|
780
783
|
};
|