@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.
Files changed (97) hide show
  1. package/README.md +27 -3
  2. package/dist/ExcelBindingWizard-CLT2p7P3.cjs +1 -0
  3. package/dist/ExcelBindingWizard-CvsWR8Ga.js +1485 -0
  4. package/dist/{ParamEditor-BLaE5q5W.js → ParamEditor-CflQV3eQ.js} +191 -187
  5. package/dist/ParamEditor-vIDzvpPV.cjs +1 -0
  6. package/dist/ReportBatchPanel-DkxTzBkD.cjs +1 -0
  7. package/dist/{ReportBatchPanel-B5ClP9tm.js → ReportBatchPanel-LqVgiqp7.js} +3 -3
  8. package/dist/ReportPreview-CvbqLUzM.cjs +6 -0
  9. package/dist/ReportPreview-D_ywJ_-H.js +4533 -0
  10. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-MjWEtc7X.js} +1 -1
  11. package/dist/ReportTemplateLibrary-cQ1sqNYo.cjs +1 -0
  12. package/dist/RuleEditor-BaR6xUiI.cjs +1 -0
  13. package/dist/RuleEditor-ChuXMlei.js +2037 -0
  14. package/dist/TemplateOutlinePanel-BHKP89Xz.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-Dci6aRn1.js +96 -0
  16. package/dist/TemplateReusePanel-B7Gmyc1z.js +388 -0
  17. package/dist/TemplateReusePanel-CY5eO2Sh.cjs +1 -0
  18. package/dist/TemplateReviewPanel-DjlX3xpt.js +592 -0
  19. package/dist/TemplateReviewPanel-JvZe9_4G.cjs +1 -0
  20. package/dist/{batch-mRqhhhjt.js → batch-DzaTNLWI.js} +23 -16
  21. package/dist/batch-xMkqYiTr.cjs +1 -0
  22. package/dist/config-0UIohTS7.cjs +1 -0
  23. package/dist/{config-B612mw0x.js → config-Dt9NtCPl.js} +227 -186
  24. package/dist/data-explanation-BktvER5B.cjs +1 -0
  25. package/dist/data-explanation-C_J6jYNi.js +16 -0
  26. package/dist/designer-Ci1LizA9.js +5020 -0
  27. package/dist/designer-rtmVIIdN.cjs +2 -0
  28. package/dist/designer.cjs +1 -2
  29. package/dist/designer.d.cts +306 -3
  30. package/dist/designer.d.ts +306 -3
  31. package/dist/designer.js +21 -4266
  32. package/dist/font-loader-DHto6Lra.js +297 -0
  33. package/dist/font-loader-vhCT8znW.cjs +1 -0
  34. package/dist/index.cjs +8 -8
  35. package/dist/index.d.cts +182 -1
  36. package/dist/index.d.ts +182 -1
  37. package/dist/index.js +728 -628
  38. package/dist/{template-review-BzpcI-tR.js → json-snapshot-BeFT3Tso.js} +867 -637
  39. package/dist/json-snapshot-D1NTP2oI.cjs +2 -0
  40. package/dist/pdf-8UPQebOE.js +36288 -0
  41. package/dist/pdf-AyJGb22z.cjs +101 -0
  42. package/dist/pdf.cjs +1 -101
  43. package/dist/pdf.js +9 -36579
  44. package/dist/plugin-BGKf-Tqg.js +22 -0
  45. package/dist/{plugin-BDTU4D94.cjs → plugin-CktLH_Iy.cjs} +1 -1
  46. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-DEJbhpCv.js} +1 -1
  47. package/dist/server/node.d.cts +46 -11
  48. package/dist/server/node.d.ts +46 -11
  49. package/dist/server-node.cjs +1 -1
  50. package/dist/server-node.js +294 -280
  51. package/dist/server.cjs +1 -1
  52. package/dist/server.d.cts +107 -12
  53. package/dist/server.d.ts +107 -12
  54. package/dist/server.js +713 -453
  55. package/dist/style.css +1 -1
  56. package/dist/template-bindings-BJR4k7qZ.cjs +1 -0
  57. package/dist/template-bindings-Daui7hLF.js +252 -0
  58. package/dist/template-fragments-CLkGo6To.js +187 -0
  59. package/dist/template-fragments-DFUpq5QM.cjs +1 -0
  60. package/dist/template-outline-B3xVkzSv.cjs +1 -0
  61. package/dist/template-outline-CFenM1PV.js +88 -0
  62. package/dist/{template-registry-BjE1VS6g.js → template-registry-COXDEJEM.js} +1 -1
  63. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  64. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  65. package/dist/{validate-DbgEM1Hh.js → validate-CkQBWCeg.js} +3 -3
  66. package/dist/vue/async.d.cts +72 -2
  67. package/dist/vue/async.d.ts +72 -2
  68. package/dist/vue/index.d.cts +124 -5
  69. package/dist/vue/index.d.ts +124 -5
  70. package/dist/vue-async.cjs +1 -1
  71. package/dist/vue-async.js +5 -5
  72. package/dist/vue.cjs +1 -1
  73. package/dist/vue.js +78 -71
  74. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BfK1yHOO.js} +1 -1
  75. package/dist/worker.cjs +1 -1
  76. package/dist/worker.d.cts +46 -11
  77. package/dist/worker.d.ts +46 -11
  78. package/dist/worker.js +59 -55
  79. package/dist/xlsx.js +3 -3
  80. package/package.json +1 -1
  81. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  82. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  83. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  84. package/dist/ReportBatchPanel-Dc-SDkYA.cjs +0 -1
  85. package/dist/ReportPreview-DWXROHBP.cjs +0 -6
  86. package/dist/ReportPreview-DiNXhQI0.js +0 -4138
  87. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  88. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  89. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  90. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  91. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  92. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  93. package/dist/config-BRoLo2oj.cjs +0 -1
  94. package/dist/plugin-Cd5G2QQn.js +0 -22
  95. package/dist/record-bindings-By_UKZ2g.cjs +0 -1
  96. package/dist/record-bindings-D-5jQlTj.js +0 -196
  97. package/dist/template-review-BfCC8Ng9.cjs +0 -2
@@ -1,65 +1,85 @@
1
- import { ref as A, watch as M, computed as x, defineComponent as G, openBlock as d, createElementBlock as u, toDisplayString as v, createCommentVNode as w, createElementVNode as P, Fragment as I, renderList as D, normalizeClass as _, createTextVNode as W, withKeys as q, unref as j, inject as T, provide as K } from "vue";
2
- import { ReportParamValidationError as z, ReportSourceError as J, validateReportParams as L } from "@agile-team/mach-report";
1
+ import { ref as C, watch as A, computed as x, defineComponent as _, openBlock as d, createElementBlock as u, toDisplayString as v, createCommentVNode as w, createElementVNode as P, Fragment as I, renderList as D, normalizeClass as G, createTextVNode as W, withKeys as q, unref as j, inject as T, provide as K } from "vue";
2
+ import { ReportParamValidationError as z, ReportSourceError as J, validateReportParams as O } from "@agile-team/mach-report";
3
3
  import { _ as X } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
4
  import { a as k } from "./injection-keys-e85udZCp.js";
5
+ const Y = {
6
+ printPrepareTimeout: "打印资源准备超时,请检查字体与图片后重试。",
7
+ printImageFailed: "第 {index} 张图片未能加载,已停止打印,避免输出缺失内容。",
8
+ printFontFailed: "打印字体 {family} 未能加载,请检查字体资源后重试。",
9
+ printPrepareFailed: "打印准备失败,请检查打印配置或改用 PDF。",
10
+ printCalibration: "打印校准",
11
+ printOffsetX: "水平偏移(mm)",
12
+ printOffsetY: "垂直偏移(mm)",
13
+ printCalibrationTest: "打印校准页",
14
+ printCalibrationHint: "正值向右/向下移动,负值向左/向上。使用同规格纸张及 100% 比例,先试打一张。系统对话框关闭不代表设备已完成。"
15
+ };
16
+ function Ae(e) {
17
+ const a = e?.calibration?.offsetXmm ?? 0, s = e?.calibration?.offsetYmm ?? 0;
18
+ if (![a, s].every((r) => Number.isFinite(r) && Math.abs(r) <= 20)) throw new RangeError("Print calibration must be within ±20 mm");
19
+ return { x: a, y: s };
20
+ }
21
+ function Se(e = {}) {
22
+ if (e.fonts && (!Array.isArray(e.fonts) || e.fonts.length > 8)) throw new RangeError("At most eight print font faces are allowed");
23
+ return { ...e, ...e.fonts ? { fonts: e.fonts.map((a) => ({ ...a })) } : {}, ...e.calibration ? { calibration: { ...e.calibration } } : {} };
24
+ }
5
25
  class h extends Error {
6
- constructor(r, n, t) {
7
- super(n), this.name = "MachReportError", this.code = r, this.cause = t;
26
+ constructor(a, s, r) {
27
+ super(s), this.name = "MachReportError", this.code = a, this.cause = r;
8
28
  }
9
29
  }
10
- function Pe(e) {
30
+ function Ce(e) {
11
31
  return e instanceof h ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
12
32
  }
13
- function we(e) {
33
+ function Me(e) {
14
34
  if (e instanceof h) return e;
15
35
  if (e instanceof z) return new h("param", e.message, e);
16
36
  if (e instanceof J) return new h(e.code, e.message, e.cause);
17
37
  if (e instanceof Error) {
18
- const r = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, n = e.code;
19
- if (typeof n == "string" && Object.prototype.hasOwnProperty.call(r, n)) return new h(r[n], e.message, e);
38
+ const a = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, s = e.code;
39
+ if (typeof s == "string" && Object.prototype.hasOwnProperty.call(a, s)) return new h(a[s], e.message, e);
20
40
  }
21
41
  return new h("fetch", e instanceof Error ? e.message : "预览加载失败", e);
22
42
  }
23
43
  let Q = 0;
24
- function Y() {
44
+ function Z() {
25
45
  return `mrp-params-${++Q}`;
26
46
  }
27
- function N(e, r, n) {
28
- const t = (Array.isArray(r) ? r.find((l) => l?.field === e.field)?.label : void 0) ?? e.field;
29
- return e.code === "required" ? n.paramRequired.replace("{label}", t) : (n.paramInvalid ?? "{label}:{message}").replace("{label}", t).replace("{message}", e.message);
47
+ function N(e, a, s) {
48
+ const r = (Array.isArray(a) ? a.find((i) => i?.field === e.field)?.label : void 0) ?? e.field;
49
+ return e.code === "required" ? s.paramRequired.replace("{label}", r) : (s.paramInvalid ?? "{label}:{message}").replace("{label}", r).replace("{message}", e.message);
30
50
  }
31
- function Me(e) {
32
- const r = A({}), n = A(!1);
33
- function t() {
51
+ function Fe(e) {
52
+ const a = C({}), s = C(!1);
53
+ function r() {
34
54
  const f = {};
35
55
  for (const g of Array.isArray(e.defs.value) ? e.defs.value : [])
36
56
  typeof g?.field == "string" && Object.defineProperty(f, g.field, { value: e.params()[g.field] ?? g.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
37
- r.value = f, n.value = !1;
57
+ a.value = f, s.value = !1;
38
58
  }
39
- t(), M(e.defs, t), M(e.reportIds, t), M(() => JSON.stringify(e.params()), t);
40
- const l = x(() => L(e.defs.value, { ...e.params(), ...r.value })), o = x(() => !n.value && l.value.issues.length > 0 && l.value.issues.every((f) => f.code === "required"));
59
+ r(), A(e.defs, r), A(e.reportIds, r), A(() => JSON.stringify(e.params()), r);
60
+ const i = x(() => O(e.defs.value, { ...e.params(), ...a.value })), o = x(() => !s.value && i.value.issues.length > 0 && i.value.issues.every((f) => f.code === "required"));
41
61
  function m() {
42
- const f = l.value;
62
+ const f = i.value;
43
63
  if (!f.ok) {
44
64
  const p = f.issues[0];
45
65
  return { quiet: o.value, error: new h(p.code === "definition" ? "config" : "param", N(p, e.defs.value, e.messages()), { issues: f.issues }) };
46
66
  }
47
- const g = { ...f.values }, C = new Set(e.defs.value.filter((p) => p.defaultValue !== void 0).map((p) => p.field));
48
- for (const [p, R] of Object.entries(g)) R === "" && !C.has(p) && delete g[p];
67
+ const g = { ...f.values }, M = new Set(e.defs.value.filter((p) => p.defaultValue !== void 0).map((p) => p.field));
68
+ for (const [p, F] of Object.entries(g)) F === "" && !M.has(p) && delete g[p];
49
69
  return { params: g, quiet: !1 };
50
70
  }
51
- return { values: r, attempted: n, validation: l, pendingRequired: o, reset: t, query: m };
71
+ return { values: a, attempted: s, validation: i, pendingRequired: o, reset: r, query: m };
52
72
  }
53
- const Z = {
73
+ const ee = {
54
74
  key: 0,
55
75
  class: "mrp-params-title"
56
- }, ee = { class: "mrp-params-grid" }, ae = ["id"], te = {
76
+ }, ae = { class: "mrp-params-grid" }, te = ["id"], re = {
57
77
  key: 0,
58
78
  class: "mrp-param-star"
59
- }, re = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], se = ["disabled", "hidden"], ne = ["value"], le = ["aria-labelledby"], oe = ["value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ie = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ce = ["id"], de = {
79
+ }, ne = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], se = ["disabled", "hidden"], ie = ["value"], oe = ["aria-labelledby"], le = ["value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ce = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], de = ["id"], ue = {
60
80
  key: 1,
61
81
  class: "mrp-params-actions"
62
- }, ue = ["disabled"], pe = ["disabled"], fe = /* @__PURE__ */ G({
82
+ }, pe = ["disabled"], fe = ["disabled"], ge = /* @__PURE__ */ _({
63
83
  __name: "ReportParamPanel",
64
84
  props: {
65
85
  defs: {},
@@ -72,149 +92,149 @@ const Z = {
72
92
  disabled: { type: Boolean, default: !1 }
73
93
  },
74
94
  emits: ["update:modelValue", "query", "reset"],
75
- setup(e, { expose: r, emit: n }) {
76
- const t = e, l = n, o = A({ ...t.modelValue }), m = A(null), f = Y();
77
- M(
78
- () => t.modelValue,
79
- (s) => {
80
- o.value = { ...s };
95
+ setup(e, { expose: a, emit: s }) {
96
+ const r = e, i = s, o = C({ ...r.modelValue }), m = C(null), f = Z();
97
+ A(
98
+ () => r.modelValue,
99
+ (n) => {
100
+ o.value = { ...n };
81
101
  }
82
102
  );
83
- const g = x(() => t.issues ?? L(t.defs, o.value).issues), C = x(
84
- () => (Array.isArray(t.defs) ? t.defs : []).filter((s) => s && typeof s.field == "string").map((s, i) => ({
85
- def: s,
86
- id: `${f}-${i}`,
87
- label: s.label ?? s.field,
88
- value: o.value[s.field] ?? "",
89
- error: t.attempted ? g.value.find((a) => a.field === s.field) : void 0
103
+ const g = x(() => r.issues ?? O(r.defs, o.value).issues), M = x(
104
+ () => (Array.isArray(r.defs) ? r.defs : []).filter((n) => n && typeof n.field == "string").map((n, l) => ({
105
+ def: n,
106
+ id: `${f}-${l}`,
107
+ label: n.label ?? n.field,
108
+ value: o.value[n.field] ?? "",
109
+ error: r.attempted ? g.value.find((t) => t.field === n.field) : void 0
90
110
  }))
91
111
  );
92
- function p(s, i) {
93
- o.value = { ...o.value, [s]: i }, l("update:modelValue", { ...o.value });
112
+ function p(n, l) {
113
+ o.value = { ...o.value, [n]: l }, i("update:modelValue", { ...o.value });
94
114
  }
95
- function R(s) {
96
- return s.type === "number" ? "number" : s.type === "date" || s.type === "month" ? s.type : "text";
115
+ function F(n) {
116
+ return n.type === "number" ? "number" : n.type === "date" || n.type === "month" ? n.type : "text";
97
117
  }
98
- function y(s, i) {
99
- return s.split("/")[i] ?? "";
118
+ function y(n, l) {
119
+ return n.split("/")[l] ?? "";
100
120
  }
101
- function O(s, i, a) {
102
- return a ? !!y(s, 0) != !!y(s, 1) ? !y(s, i) || void 0 : !0 : void 0;
121
+ function H(n, l, t) {
122
+ return t ? !!y(n, 0) != !!y(n, 1) ? !y(n, l) || void 0 : !0 : void 0;
103
123
  }
104
- function U(s, i, a) {
105
- const c = [y(o.value[s] ?? "", 0), y(o.value[s] ?? "", 1)];
106
- c[i] = a, p(s, c.every((E) => !E) ? "" : c.join("/"));
124
+ function U(n, l, t) {
125
+ const c = [y(o.value[n] ?? "", 0), y(o.value[n] ?? "", 1)];
126
+ c[l] = t, p(n, c.every((E) => !E) ? "" : c.join("/"));
107
127
  }
108
- function F(s) {
109
- s.isComposing || l("query");
128
+ function R(n) {
129
+ n.isComposing || i("query");
110
130
  }
111
131
  function $() {
112
132
  m.value?.querySelector('[aria-invalid="true"]')?.focus();
113
133
  }
114
- return r({ focusInvalid: $ }), (s, i) => (d(), u("div", {
134
+ return a({ focusInvalid: $ }), (n, l) => (d(), u("div", {
115
135
  ref_key: "root",
116
136
  ref: m,
117
137
  class: "mrp-params"
118
138
  }, [
119
- e.showTitle !== !1 ? (d(), u("span", Z, v(e.messages.paramsTitle), 1)) : w("", !0),
120
- P("div", ee, [
121
- (d(!0), u(I, null, D(C.value, (a) => (d(), u("label", {
122
- key: a.id,
123
- class: _(["mrp-param", { "mrp-param-missing": !!a.error }])
139
+ e.showTitle !== !1 ? (d(), u("span", ee, v(e.messages.paramsTitle), 1)) : w("", !0),
140
+ P("div", ae, [
141
+ (d(!0), u(I, null, D(M.value, (t) => (d(), u("label", {
142
+ key: t.id,
143
+ class: G(["mrp-param", { "mrp-param-missing": !!t.error }])
124
144
  }, [
125
145
  P("span", {
126
- id: `${a.id}-label`,
146
+ id: `${t.id}-label`,
127
147
  class: "mrp-param-label"
128
148
  }, [
129
- W(v(a.label), 1),
130
- a.def.required ? (d(), u("i", te, "*")) : w("", !0)
131
- ], 8, ae),
132
- (a.def.type ?? "text") === "select" ? (d(), u("select", {
149
+ W(v(t.label), 1),
150
+ t.def.required ? (d(), u("i", re, "*")) : w("", !0)
151
+ ], 8, te),
152
+ (t.def.type ?? "text") === "select" ? (d(), u("select", {
133
153
  key: 0,
134
154
  class: "mrp-param-input",
135
- value: a.value,
155
+ value: t.value,
136
156
  disabled: e.disabled,
137
- "aria-labelledby": `${a.id}-label`,
138
- "aria-invalid": a.error ? !0 : void 0,
139
- "aria-describedby": a.error ? `${a.id}-error` : void 0,
140
- "aria-required": a.def.required || void 0,
141
- onChange: (c) => p(a.def.field, c.target.value),
142
- onKeydown: q(F, ["enter"])
157
+ "aria-labelledby": `${t.id}-label`,
158
+ "aria-invalid": t.error ? !0 : void 0,
159
+ "aria-describedby": t.error ? `${t.id}-error` : void 0,
160
+ "aria-required": t.def.required || void 0,
161
+ onChange: (c) => p(t.def.field, c.target.value),
162
+ onKeydown: q(R, ["enter"])
143
163
  }, [
144
164
  P("option", {
145
165
  value: "",
146
- disabled: a.def.required,
147
- hidden: a.def.required
148
- }, v(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, se),
149
- (d(!0), u(I, null, D(a.def.options ?? [], (c) => (d(), u("option", {
166
+ disabled: t.def.required,
167
+ hidden: t.def.required
168
+ }, v(t.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", t.label)), 9, se),
169
+ (d(!0), u(I, null, D(t.def.options ?? [], (c) => (d(), u("option", {
150
170
  key: c.value,
151
171
  value: c.value
152
- }, v(c.label), 9, ne))), 128))
153
- ], 40, re)) : a.def.type === "dateRange" ? (d(), u("div", {
172
+ }, v(c.label), 9, ie))), 128))
173
+ ], 40, ne)) : t.def.type === "dateRange" ? (d(), u("div", {
154
174
  key: 1,
155
175
  class: "mrp-param-range",
156
176
  role: "group",
157
- "aria-labelledby": `${a.id}-label`
177
+ "aria-labelledby": `${t.id}-label`
158
178
  }, [
159
179
  (d(!0), u(I, null, D([e.messages.paramRangeStart ?? "开始日期", e.messages.paramRangeEnd ?? "结束日期"], (c, E) => (d(), u("input", {
160
180
  key: E,
161
181
  class: "mrp-param-input",
162
182
  type: "date",
163
- value: y(a.value, E),
183
+ value: y(t.value, E),
164
184
  disabled: e.disabled,
165
- min: a.def.min,
166
- max: a.def.max,
167
- "aria-label": `${a.label} · ${c}`,
168
- "aria-invalid": O(a.value, E, a.error),
169
- "aria-describedby": a.error ? `${a.id}-error` : void 0,
170
- "aria-required": a.def.required || void 0,
171
- onInput: (V) => U(a.def.field, E, V.target.value),
172
- onKeydown: q(F, ["enter"])
173
- }, null, 40, oe))), 128))
174
- ], 8, le)) : (d(), u("input", {
185
+ min: t.def.min,
186
+ max: t.def.max,
187
+ "aria-label": `${t.label} · ${c}`,
188
+ "aria-invalid": H(t.value, E, t.error),
189
+ "aria-describedby": t.error ? `${t.id}-error` : void 0,
190
+ "aria-required": t.def.required || void 0,
191
+ onInput: (V) => U(t.def.field, E, V.target.value),
192
+ onKeydown: q(R, ["enter"])
193
+ }, null, 40, le))), 128))
194
+ ], 8, oe)) : (d(), u("input", {
175
195
  key: 2,
176
196
  class: "mrp-param-input",
177
- type: R(a.def),
178
- inputmode: a.def.type === "year" ? "numeric" : void 0,
179
- maxlength: a.def.type === "year" ? 4 : void 0,
180
- placeholder: a.def.placeholder ?? (e.messages.paramTextPlaceholder ?? "请输入{label}").replace("{label}", a.label),
181
- value: a.value,
197
+ type: F(t.def),
198
+ inputmode: t.def.type === "year" ? "numeric" : void 0,
199
+ maxlength: t.def.type === "year" ? 4 : void 0,
200
+ placeholder: t.def.placeholder ?? (e.messages.paramTextPlaceholder ?? "请输入{label}").replace("{label}", t.label),
201
+ value: t.value,
182
202
  disabled: e.disabled,
183
- min: a.def.min,
184
- max: a.def.max,
185
- step: a.def.type === "number" ? "any" : void 0,
186
- "aria-labelledby": `${a.id}-label`,
187
- "aria-invalid": a.error ? !0 : void 0,
188
- "aria-describedby": a.error ? `${a.id}-error` : void 0,
189
- "aria-required": a.def.required || void 0,
190
- onInput: (c) => p(a.def.field, c.target.value),
191
- onKeydown: q(F, ["enter"])
192
- }, null, 40, ie)),
193
- a.error ? (d(), u("small", {
203
+ min: t.def.min,
204
+ max: t.def.max,
205
+ step: t.def.type === "number" ? "any" : void 0,
206
+ "aria-labelledby": `${t.id}-label`,
207
+ "aria-invalid": t.error ? !0 : void 0,
208
+ "aria-describedby": t.error ? `${t.id}-error` : void 0,
209
+ "aria-required": t.def.required || void 0,
210
+ onInput: (c) => p(t.def.field, c.target.value),
211
+ onKeydown: q(R, ["enter"])
212
+ }, null, 40, ce)),
213
+ t.error ? (d(), u("small", {
194
214
  key: 3,
195
- id: `${a.id}-error`,
215
+ id: `${t.id}-error`,
196
216
  class: "mrp-param-error",
197
217
  role: "status"
198
- }, v(j(N)(a.error, e.defs, e.messages)), 9, ce)) : w("", !0)
218
+ }, v(j(N)(t.error, e.defs, e.messages)), 9, de)) : w("", !0)
199
219
  ], 2))), 128))
200
220
  ]),
201
- e.showActions !== !1 ? (d(), u("div", de, [
221
+ e.showActions !== !1 ? (d(), u("div", ue, [
202
222
  P("button", {
203
223
  class: "mrp-nav mrp-param-query",
204
224
  type: "button",
205
225
  disabled: e.disabled,
206
- onClick: i[0] || (i[0] = (a) => s.$emit("query"))
207
- }, v(e.messages.query), 9, ue),
226
+ onClick: l[0] || (l[0] = (t) => n.$emit("query"))
227
+ }, v(e.messages.query), 9, pe),
208
228
  P("button", {
209
229
  class: "mrp-nav",
210
230
  type: "button",
211
231
  disabled: e.disabled,
212
- onClick: i[1] || (i[1] = (a) => s.$emit("reset"))
213
- }, v(e.messages.reset), 9, pe)
232
+ onClick: l[1] || (l[1] = (t) => n.$emit("reset"))
233
+ }, v(e.messages.reset), 9, fe)
214
234
  ])) : w("", !0)
215
235
  ], 512));
216
236
  }
217
- }), Se = /* @__PURE__ */ X(fe, [["__scopeId", "data-v-f64e743f"]]), H = {
237
+ }), Re = /* @__PURE__ */ X(ge, [["__scopeId", "data-v-f64e743f"]]), L = {
218
238
  calculationTitle: "选区计算",
219
239
  calculationLocal: "仅本地分析,不写回实绩、不重算原公式。请选取同一单位与量纲的数值。",
220
240
  calculationHint: "点击起点,Shift + 点击终点或方向键扩选。",
@@ -243,16 +263,17 @@ const Z = {
243
263
  calculationErrorOverflow: "结果超出有效数值范围。",
244
264
  calculationErrorPrecision: "数值超出安全精度,或展示小数位不是 0 至 12 的整数。"
245
265
  };
246
- function Ae(e) {
247
- const r = { ...H };
248
- for (const n of Object.keys(r)) {
249
- const t = e[n];
250
- typeof t == "string" && (r[n] = t);
266
+ function Ie(e) {
267
+ const a = { ...L };
268
+ for (const s of Object.keys(a)) {
269
+ const r = e[s];
270
+ typeof r == "string" && (a[s] = r);
251
271
  }
252
- return r;
272
+ return a;
253
273
  }
254
- const ge = {
255
- ...H,
274
+ const me = {
275
+ ...Y,
276
+ ...L,
256
277
  exportMenu: "导出",
257
278
  exportMenuDescription: "选择文件格式",
258
279
  clearSearch: "清除搜索",
@@ -262,6 +283,17 @@ const ge = {
262
283
  pageJumpInvalid: "请输入有效页码",
263
284
  pageJumpHint: "Enter 跳转",
264
285
  pagination: "报表分页",
286
+ recordNavigation: "标签记录",
287
+ recordInfo: "记录 {cur} / {total}",
288
+ prevRecord: "上一条记录",
289
+ nextRecord: "下一条记录",
290
+ dataExplanation: "来源数据说明",
291
+ dataExplanationHint: "按字段查看来源与计算说明",
292
+ dataExplanationSearch: "搜索说明、字段或记录",
293
+ dataExplanationEmpty: "没有匹配的数据说明",
294
+ dataMissingSource: "暂无来源",
295
+ dataNotApplicable: "业务不适用",
296
+ dataNotCalculable: "无法计算",
265
297
  columnSearchHint: "输入列名或字段标识",
266
298
  columnSearchShortcut: "↑ ↓ 选择 · Enter 定位",
267
299
  closeColumnDirectory: "关闭字段目录",
@@ -397,7 +429,7 @@ const ge = {
397
429
  diagnosticImageDecode: "图片加载失败,请检查资源后重试。",
398
430
  diagnosticAssetFailed: "图表或图片生成失败,请重试或联系管理员。",
399
431
  diagnosticAssetBudget: "图片资源超出处理范围,请减少资源或缩小报表范围。"
400
- }, me = {
432
+ }, be = {
401
433
  emptyAccent: "#79a7e8",
402
434
  shellBg: "#f4f7fc",
403
435
  shellFg: "#334155",
@@ -410,10 +442,10 @@ const ge = {
410
442
  btnHoverFg: "#315fba",
411
443
  btnActiveBg: "#3569d4"
412
444
  };
413
- function be(e = {}) {
445
+ function ve(e = {}) {
414
446
  return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
415
447
  }
416
- function Ce(e) {
448
+ function De(e) {
417
449
  return e;
418
450
  }
419
451
  const b = {
@@ -425,23 +457,28 @@ const b = {
425
457
  gapPx: 18,
426
458
  pdfFontUrl: "/simhei.ttf",
427
459
  logger: console
428
- }, Re = { warn: () => {
460
+ }, qe = { warn: () => {
429
461
  }, info: () => {
430
462
  } };
431
- function S(e, r) {
463
+ function he(e, a) {
464
+ if (!(!e && !a))
465
+ return { ...e, ...a, calibration: { ...e?.calibration, ...a?.calibration } };
466
+ }
467
+ function S(e, a) {
432
468
  return {
433
469
  ...e,
434
- ...r,
435
- theme: { ...e?.theme, ...r?.theme },
436
- messages: { ...e?.messages, ...r?.messages },
437
- preview: { ...e?.preview, ...r?.preview },
438
- xlsx: { ...e?.xlsx, ...r?.xlsx },
439
- toolbar: { ...e?.toolbar, ...r?.toolbar },
440
- interaction: { ...e?.interaction, ...r?.interaction },
441
- output: { ...e?.output, ...r?.output }
470
+ ...a,
471
+ theme: { ...e?.theme, ...a?.theme },
472
+ messages: { ...e?.messages, ...a?.messages },
473
+ preview: { ...e?.preview, ...a?.preview },
474
+ xlsx: { ...e?.xlsx, ...a?.xlsx },
475
+ toolbar: { ...e?.toolbar, ...a?.toolbar },
476
+ interaction: { ...e?.interaction, ...a?.interaction },
477
+ output: { ...e?.output, ...a?.output },
478
+ printOptions: he(e?.printOptions, a?.printOptions)
442
479
  };
443
480
  }
444
- function ve(e) {
481
+ function ye(e) {
445
482
  return {
446
483
  showExport: e.showExport ?? b.showExport,
447
484
  showPrint: e.showPrint ?? b.showPrint,
@@ -451,75 +488,79 @@ function ve(e) {
451
488
  gapPx: e.gapPx ?? b.gapPx
452
489
  };
453
490
  }
454
- function Fe(e, r) {
455
- const n = r ? e?.presets?.[r] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, t = S(e?.defaults, n);
491
+ function ke(e, a) {
492
+ const s = a ? e?.presets?.[a] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, r = S(e?.defaults, s);
456
493
  return {
457
- ...ve(t),
458
- pdfFontUrl: t.pdfFontUrl ?? b.pdfFontUrl,
459
- theme: { ...me, ...t.theme },
460
- messages: { ...ge, ...t.messages },
461
- logger: t.logger ?? b.logger,
494
+ ...ye(r),
495
+ pdfFontUrl: r.pdfFontUrl ?? b.pdfFontUrl,
496
+ theme: { ...be, ...r.theme },
497
+ messages: { ...me, ...r.messages },
498
+ logger: r.logger ?? b.logger,
462
499
  preview: {
463
- overscanPages: B(t.preview?.overscanPages, 1, 10, !0),
464
- searchDebounceMs: B(t.preview?.searchDebounceMs, 200, 2e3)
500
+ overscanPages: B(r.preview?.overscanPages, 1, 10, !0),
501
+ searchDebounceMs: B(r.preview?.searchDebounceMs, 200, 2e3)
465
502
  },
466
- xlsx: { ...t.xlsx },
467
- editable: t.editable ?? !1,
468
- excelImport: t.excelImport ?? !1,
469
- toolbar: { ...t.toolbar },
470
- interaction: { ...t.interaction },
471
- preferences: t.preferences,
472
- assets: t.assets,
473
- guardChanges: t.guardChanges ?? !0,
474
- beforeDiscard: t.beforeDiscard,
475
- output: { ...t.output }
503
+ xlsx: { ...r.xlsx },
504
+ editable: r.editable ?? !1,
505
+ excelImport: r.excelImport ?? !1,
506
+ toolbar: { ...r.toolbar },
507
+ interaction: { ...r.interaction },
508
+ preferences: r.preferences,
509
+ assets: r.assets,
510
+ guardChanges: r.guardChanges ?? !0,
511
+ beforeDiscard: r.beforeDiscard,
512
+ output: { ...r.output },
513
+ printOptions: r.printOptions
476
514
  };
477
515
  }
478
- function B(e, r, n, t = !1) {
479
- if (e == null || !Number.isFinite(e)) return r;
480
- const l = Math.max(0, Math.min(n, e));
481
- return t ? Math.floor(l) : l;
516
+ function B(e, a, s, r = !1) {
517
+ if (e == null || !Number.isFinite(e)) return a;
518
+ const i = Math.max(0, Math.min(s, e));
519
+ return r ? Math.floor(i) : i;
482
520
  }
483
- function Ie(e) {
484
- const r = {};
485
- return e.emptyAccent != null && (r["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (r["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (r["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (r["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (r["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (r["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (r["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (r["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (r["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (r["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (r["--mrp-btn-active-bg"] = e.btnActiveBg), r;
521
+ function Be(e) {
522
+ const a = {};
523
+ return e.emptyAccent != null && (a["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (a["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (a["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (a["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (a["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (a["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (a["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (a["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (a["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (a["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (a["--mrp-btn-active-bg"] = e.btnActiveBg), a;
486
524
  }
487
- function De(e) {
488
- const r = T(k, null), n = x(() => {
489
- const t = r?.value ?? null, l = "defaults" in e || "presets" in e || "defaultPreset" in e ? be(e) : { defaults: e, presets: {} };
490
- if (!t) return l;
491
- const o = { ...t.presets, ...l.presets };
525
+ function Te(e) {
526
+ const a = T(k, null), s = x(() => {
527
+ const r = a?.value ?? null, i = "defaults" in e || "presets" in e || "defaultPreset" in e ? ve(e) : { defaults: e, presets: {} };
528
+ if (!r) return i;
529
+ const o = { ...r.presets, ...i.presets };
492
530
  for (const m of Object.keys(o))
493
531
  o[m] = S(
494
- S(t.presets[m], l.defaults),
495
- l.presets[m]
532
+ S(r.presets[m], i.defaults),
533
+ i.presets[m]
496
534
  );
497
535
  return {
498
- defaults: S(t.defaults, l.defaults),
536
+ defaults: S(r.defaults, i.defaults),
499
537
  presets: o,
500
- defaultPreset: l.defaultPreset ?? t.defaultPreset
538
+ defaultPreset: i.defaultPreset ?? r.defaultPreset
501
539
  };
502
540
  });
503
- K(k, n);
541
+ K(k, s);
504
542
  }
505
- function qe() {
543
+ function Oe() {
506
544
  return T(k, x(() => null));
507
545
  }
508
546
  export {
509
- H as D,
547
+ L as D,
510
548
  h as M,
511
- Se as R,
512
- Re as S,
513
- ge as a,
514
- me as b,
515
- Ce as c,
516
- be as d,
517
- Fe as e,
518
- Pe as f,
519
- Me as g,
520
- we as n,
521
- De as p,
522
- Ae as r,
523
- Ie as t,
524
- qe as u
549
+ Re as R,
550
+ qe as S,
551
+ me as a,
552
+ Y as b,
553
+ be as c,
554
+ ve as d,
555
+ De as e,
556
+ Te as f,
557
+ ke as g,
558
+ Ce as h,
559
+ Fe as i,
560
+ Me as n,
561
+ Ae as p,
562
+ Ie as r,
563
+ Se as s,
564
+ Be as t,
565
+ Oe as u
525
566
  };
@@ -0,0 +1 @@
1
+ "use strict";function i(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t,r=a=>typeof a=="string"&&a.trim().length>0&&a.length<=256;return!r(e.datasetId)||!r(e.field)||e.tableId!==void 0&&!r(e.tableId)?!1:e.rowKey===void 0?!0:typeof e.rowKey=="string"?e.rowKey.trim().length>0&&e.rowKey.length<=1024:typeof e.rowKey=="number"&&Number.isFinite(e.rowKey)}function n(t){return t==="missing-source"||t==="not-applicable"||t==="not-calculable"}function o(t){return t.target!==void 0&&!i(t.target)?!1:t.valueState===void 0||n(t.valueState)&&t.target!==void 0}exports.hasValidDataExplanation=o;exports.isReportDataTarget=i;exports.isReportValueState=n;
@@ -0,0 +1,16 @@
1
+ function i(t) {
2
+ if (!t || typeof t != "object" || Array.isArray(t)) return !1;
3
+ const e = t, r = (a) => typeof a == "string" && a.trim().length > 0 && a.length <= 256;
4
+ return !r(e.datasetId) || !r(e.field) || e.tableId !== void 0 && !r(e.tableId) ? !1 : e.rowKey === void 0 ? !0 : typeof e.rowKey == "string" ? e.rowKey.trim().length > 0 && e.rowKey.length <= 1024 : typeof e.rowKey == "number" && Number.isFinite(e.rowKey);
5
+ }
6
+ function n(t) {
7
+ return t === "missing-source" || t === "not-applicable" || t === "not-calculable";
8
+ }
9
+ function o(t) {
10
+ return t.target !== void 0 && !i(t.target) ? !1 : t.valueState === void 0 || n(t.valueState) && t.target !== void 0;
11
+ }
12
+ export {
13
+ n as a,
14
+ o as h,
15
+ i
16
+ };