@agile-team/mach-report 2.17.0 → 2.18.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 (168) hide show
  1. package/README.md +18 -9
  2. package/dist/{ExcelBindingWizard-Bq6FYME6.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
  3. package/dist/{ExcelBindingWizard-Co1svTsw.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
  4. package/dist/ParamEditor-KzDQvbHY.js +732 -0
  5. package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
  6. package/dist/{ReportBatchPanel-uQh06usx.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
  7. package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
  8. package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
  9. package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
  10. package/dist/ReportPreview-BxWWTUL5.js +5583 -0
  11. package/dist/ReportPreview-Yf99omi3.cjs +6 -0
  12. package/dist/{ReportTemplateLibrary-TIL_Oj2l.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
  13. package/dist/{ReportTemplateLibrary-CnP7_1pH.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
  14. package/dist/RuleEditor-CqxT1a-W.js +2337 -0
  15. package/dist/RuleEditor-D7YWigD9.cjs +1 -0
  16. package/dist/{TemplateOutlinePanel-BlLxRrfu.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
  17. package/dist/{TemplateOutlinePanel-BouxsuqQ.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
  18. package/dist/{TemplateReusePanel-yxsHSO40.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
  19. package/dist/{TemplateReusePanel-BEACLPaN.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
  20. package/dist/{TemplateReviewPanel-D9Cx0m2N.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
  21. package/dist/{TemplateReviewPanel-B1OGRY2i.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
  22. package/dist/analytics.cjs +1 -1
  23. package/dist/analytics.d.cts +100 -41
  24. package/dist/analytics.d.ts +100 -41
  25. package/dist/analytics.js +76 -141
  26. package/dist/artifact-integrity.json +108 -102
  27. package/dist/assets-2eC3mOcV.js +232 -0
  28. package/dist/assets-B0Hxn4l6.cjs +1 -0
  29. package/dist/{auto-DDHflI9v.cjs → auto-B0EZFIK1.cjs} +1 -1
  30. package/dist/{auto-BIOmtVhk.js → auto-BlchZ1b8.js} +19 -19
  31. package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
  32. package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
  33. package/dist/charts-Dlv8j2AG.js +141 -0
  34. package/dist/charts-aCtoswXq.cjs +1 -0
  35. package/dist/codes.cjs +9 -9
  36. package/dist/codes.d.cts +54 -0
  37. package/dist/codes.d.ts +54 -0
  38. package/dist/codes.js +12097 -13668
  39. package/dist/column-visual-BpgQVWwT.js +238 -0
  40. package/dist/column-visual-CtYxnBCP.cjs +1 -0
  41. package/dist/component-tree-6TV7W6Yj.cjs +1 -0
  42. package/dist/component-tree-CvW4lzpv.js +67 -0
  43. package/dist/computed-4TnxzgIh.cjs +1 -0
  44. package/dist/computed-C8NRZQss.js +739 -0
  45. package/dist/data-bar-Ce38juRZ.cjs +1 -0
  46. package/dist/data-bar-PtjXhMgN.js +9 -0
  47. package/dist/designer--TKECSEc.cjs +2 -0
  48. package/dist/designer-d6hJS41w.js +5683 -0
  49. package/dist/designer.cjs +1 -1
  50. package/dist/designer.d.cts +710 -42
  51. package/dist/designer.d.ts +710 -42
  52. package/dist/designer.js +23 -20
  53. package/dist/{encoding-BFMFIc4r.cjs → encoding-B--eZpp1.cjs} +1 -1
  54. package/dist/{encoding-DP_Eaf0A.js → encoding-mctOLocI.js} +2 -2
  55. package/dist/{font-loader-7FWVlykp.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
  56. package/dist/{font-loader-CQZowp0I.js → font-loader-DW8tIaNp.js} +1 -1
  57. package/dist/index-CPh6tqge.js +1575 -0
  58. package/dist/index-CUNw7dL9.cjs +1 -0
  59. package/dist/index.cjs +7 -7
  60. package/dist/index.d.cts +361 -15
  61. package/dist/index.d.ts +361 -15
  62. package/dist/index.js +876 -835
  63. package/dist/json-snapshot-By4ZVVUt.js +1967 -0
  64. package/dist/json-snapshot-jiXff4lc.cjs +2 -0
  65. package/dist/matrix-0hywp0-F.cjs +1 -0
  66. package/dist/matrix-Dy-tyY7E.js +381 -0
  67. package/dist/param-validation-C-8sRJLq.cjs +1 -0
  68. package/dist/param-validation-CnDEd2l-.js +333 -0
  69. package/dist/{pdf-l3ea86di.js → pdf-CKROKygt.js} +1851 -1849
  70. package/dist/{pdf-B8JouyYv.cjs → pdf-DqyxJ96U.cjs} +46 -46
  71. package/dist/pdf.cjs +1 -1
  72. package/dist/pdf.d.cts +54 -0
  73. package/dist/pdf.d.ts +54 -0
  74. package/dist/pdf.js +2 -2
  75. package/dist/{plugin-BBp74CQZ.js → plugin-ByjF2kiV.js} +5 -5
  76. package/dist/{plugin-CtFX9PFG.cjs → plugin-DM1M2wlI.cjs} +1 -1
  77. package/dist/prefill-B8H9qwE4.js +371 -0
  78. package/dist/prefill-D7EswyTI.cjs +1 -0
  79. package/dist/{prepared-CARicKYh.js → prepared-BE-4jfX5.js} +2 -2
  80. package/dist/{prepared-Ch1x_Gog.cjs → prepared-CGVphji3.cjs} +1 -1
  81. package/dist/{protocol-B5A2uom4.cjs → protocol-ByRVzzQG.cjs} +1 -1
  82. package/dist/{protocol-BaiWjq5w.js → protocol-Cr81vFSQ.js} +3 -3
  83. package/dist/{record-bindings-D4TuMzHs.js → record-bindings-DEJtmo3p.js} +67 -107
  84. package/dist/record-bindings-ehjnCDHt.cjs +1 -0
  85. package/dist/{region-binding-workflow-BNasF5kz.js → region-binding-workflow-CBg0l_tj.js} +1 -1
  86. package/dist/{region-binding-workflow-O2Cni3mF.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
  87. package/dist/report-encoding-worker.cjs +1 -1
  88. package/dist/report-encoding-worker.js +1 -1
  89. package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
  90. package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
  91. package/dist/runtime-CDA6d263.cjs +1 -0
  92. package/dist/runtime-CEMvybO7.js +170 -0
  93. package/dist/sbom.cdx.json +1 -1
  94. package/dist/server/node.d.cts +75 -7
  95. package/dist/server/node.d.ts +75 -7
  96. package/dist/server-node.cjs +4 -4
  97. package/dist/server-node.js +2692 -1990
  98. package/dist/server.cjs +1 -1
  99. package/dist/server.d.cts +243 -28
  100. package/dist/server.d.ts +243 -28
  101. package/dist/server.js +28 -28
  102. package/dist/sha256-BDQ1Qk7A.js +158 -0
  103. package/dist/sha256-DgZAKXqI.cjs +1 -0
  104. package/dist/style.css +1 -1
  105. package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
  106. package/dist/template-bindings-TKnXM7ll.js +62 -0
  107. package/dist/{template-catalog-wT1fNeAP.js → template-catalog-CmbWOJqy.js} +16 -16
  108. package/dist/{template-catalog-Dua8h9ZA.cjs → template-catalog-Utu4GP09.cjs} +1 -1
  109. package/dist/{template-fragments-BajTajb4.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
  110. package/dist/{template-fragments-DmX5XK4N.js → template-fragments-DWgo9tlZ.js} +2 -2
  111. package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
  112. package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
  113. package/dist/{template-registry-u11fPd8D.js → template-registry-BIhIHOab.js} +319 -314
  114. package/dist/template-registry-DzWswQI5.cjs +1 -0
  115. package/dist/vue/async.d.cts +528 -33
  116. package/dist/vue/async.d.ts +528 -33
  117. package/dist/vue/index.d.cts +616 -64
  118. package/dist/vue/index.d.ts +616 -64
  119. package/dist/vue-async.cjs +1 -1
  120. package/dist/vue-async.js +3 -3
  121. package/dist/vue.cjs +1 -1
  122. package/dist/vue.js +94 -89
  123. package/dist/{workbook-session-DN5LSA5C.cjs → workbook-session-B94EwVa_.cjs} +1 -1
  124. package/dist/{workbook-session-B8pNW24X.js → workbook-session-BoScoOg-.js} +2 -2
  125. package/dist/worker.cjs +1 -1
  126. package/dist/worker.d.cts +75 -7
  127. package/dist/worker.d.ts +75 -7
  128. package/dist/worker.js +4 -4
  129. package/dist/xlsx.cjs +4 -4
  130. package/dist/xlsx.d.cts +120 -13
  131. package/dist/xlsx.d.ts +120 -13
  132. package/dist/xlsx.js +313 -279
  133. package/package.json +1 -1
  134. package/dist/ParamEditor-B5UZRgxv.cjs +0 -1
  135. package/dist/ParamEditor-DNNARyeB.js +0 -594
  136. package/dist/ReportBatchPanel-Ctvs2t_9.cjs +0 -1
  137. package/dist/ReportPreview-BdQawRh0.js +0 -4879
  138. package/dist/ReportPreview-CJC_-j2I.cjs +0 -6
  139. package/dist/RuleEditor-DkRjOLlr.js +0 -2141
  140. package/dist/RuleEditor-h5anGsDB.cjs +0 -1
  141. package/dist/assets-BIMVwjQe.js +0 -231
  142. package/dist/assets-Dfs2ElxI.cjs +0 -1
  143. package/dist/component-tree-Ca6YYfHq.js +0 -61
  144. package/dist/component-tree-DkGLEfZC.cjs +0 -1
  145. package/dist/computed-BW5a8QFk.js +0 -612
  146. package/dist/computed-C2GD3XcE.cjs +0 -1
  147. package/dist/config-Dg_o8e7m.cjs +0 -1
  148. package/dist/config-XQ4qrQ7Q.js +0 -844
  149. package/dist/designer-D9XAxqSc.js +0 -5178
  150. package/dist/designer-uCDo5XSK.cjs +0 -2
  151. package/dist/drill-ByN8COs_.cjs +0 -1
  152. package/dist/drill-CKW3Xtfa.js +0 -145
  153. package/dist/json-snapshot-D7PE1NsU.cjs +0 -2
  154. package/dist/json-snapshot-DYmEe3sO.js +0 -1779
  155. package/dist/matrix-JLAXlux-.js +0 -302
  156. package/dist/matrix-gTHpDTGm.cjs +0 -1
  157. package/dist/param-validation-C3HlcLLO.cjs +0 -1
  158. package/dist/param-validation-Do7Eg8Zv.js +0 -181
  159. package/dist/record-bindings-B86Sur_y.cjs +0 -1
  160. package/dist/runtime-DakRXui3.js +0 -170
  161. package/dist/runtime-dL5ygIfa.cjs +0 -1
  162. package/dist/sha256-BshdOkCC.cjs +0 -1
  163. package/dist/sha256-DTG-Gq8i.js +0 -157
  164. package/dist/template-bindings-C2SpvsMU.js +0 -58
  165. package/dist/template-bindings-CEtWyiLX.cjs +0 -1
  166. package/dist/template-registry-CpysHAxy.cjs +0 -1
  167. package/dist/tree-CLpxYbKa.cjs +0 -1
  168. package/dist/tree-DNJorJUf.js +0 -172
@@ -1,844 +0,0 @@
1
- import { ref as x, watch as M, nextTick as B, onMounted as se, onBeforeUnmount as X, computed as O, shallowRef as de, defineComponent as Y, openBlock as f, createElementBlock as v, createElementVNode as q, normalizeClass as K, createVNode as j, unref as p, toDisplayString as k, createCommentVNode as $, Fragment as N, renderList as U, withModifiers as ue, createTextVNode as Q, createBlock as ce, withKeys as z, inject as Z, provide as fe } from "vue";
2
- import { ReportParamValidationError as pe, ReportSourceError as ve, validateReportParams as _ } from "@agile-team/mach-report";
3
- import { w as me } from "./progress-Hc2vxoCs.js";
4
- import { a as G, _ as ee } from "./_plugin-vue_export-helper-8SL1F89S.js";
5
- import { a as W } from "./injection-keys-e85udZCp.js";
6
- const ge = {
7
- printPrepareTimeout: "打印资源准备超时,请检查字体与图片后重试。",
8
- printImageFailed: "第 {index} 张图片未能加载,已停止打印,避免输出缺失内容。",
9
- printFontFailed: "打印字体 {family} 未能加载,请检查字体资源后重试。",
10
- printPrepareFailed: "打印准备失败,请检查打印配置或改用 PDF。",
11
- printCalibration: "打印校准",
12
- printOffsetX: "水平偏移(mm)",
13
- printOffsetY: "垂直偏移(mm)",
14
- printCalibrationTest: "打印校准页",
15
- printCalibrationHint: "正值向右/向下移动,负值向左/向上。使用同规格纸张及 100% 比例,先试打一张。系统对话框关闭不代表设备已完成。"
16
- };
17
- function ia(e) {
18
- const t = e?.calibration?.offsetXmm ?? 0, r = e?.calibration?.offsetYmm ?? 0;
19
- if (![t, r].every((n) => Number.isFinite(n) && Math.abs(n) <= 20)) throw new RangeError("Print calibration must be within ±20 mm");
20
- return { x: t, y: r };
21
- }
22
- function oa(e = {}) {
23
- if (e.fonts && (!Array.isArray(e.fonts) || e.fonts.length > 8)) throw new RangeError("At most eight print font faces are allowed");
24
- return { ...e, ...e.fonts ? { fonts: e.fonts.map((t) => ({ ...t })) } : {}, ...e.calibration ? { calibration: { ...e.calibration } } : {} };
25
- }
26
- function be(e = {}) {
27
- const t = x(!1), r = x(null), n = x(null), o = x(null);
28
- function u(i = !1) {
29
- t.value = !1, i && B(() => n.value?.focus());
30
- }
31
- function g(i) {
32
- i.target instanceof Node && !r.value?.contains(i.target) && u();
33
- }
34
- function c(i) {
35
- i.key !== "Escape" || !t.value || i.isComposing || (i.preventDefault(), i.stopPropagation(), u(!0));
36
- }
37
- return M(t, (i) => {
38
- !i || e.focusOnOpen === !1 || B(() => (o.value?.querySelector("input") ?? o.value?.querySelector("button:not(:disabled)"))?.focus());
39
- }), se(() => {
40
- document.addEventListener("pointerdown", g), document.addEventListener("focusin", g);
41
- }), X(() => {
42
- document.removeEventListener("pointerdown", g), document.removeEventListener("focusin", g);
43
- }), { opened: t, root: r, trigger: n, panel: o, close: u, onKeydown: c };
44
- }
45
- class L extends Error {
46
- constructor(t, r, n) {
47
- super(r), this.name = "MachReportError", this.code = t, this.cause = n;
48
- }
49
- }
50
- function sa(e) {
51
- return e instanceof L ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
52
- }
53
- function da(e) {
54
- if (e instanceof L) return e;
55
- if (e instanceof pe) return new L("param", e.message, e);
56
- if (e instanceof ve) return new L(e.code, e.message, e.cause);
57
- if (e instanceof Error) {
58
- const t = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, r = e.code;
59
- if (typeof r == "string" && Object.prototype.hasOwnProperty.call(t, r)) return new L(t[r], e.message, e);
60
- }
61
- return new L("fetch", e instanceof Error ? e.message : "预览加载失败", e);
62
- }
63
- let ye = 0;
64
- function he() {
65
- return `mrp-params-${++ye}`;
66
- }
67
- function ae(e, t, r) {
68
- const n = (Array.isArray(t) ? t.find((o) => o?.field === e.field)?.label : void 0) ?? e.field;
69
- return e.code === "required" ? r.paramRequired.replace("{label}", n) : (r.paramInvalid ?? "{label}:{message}").replace("{label}", n).replace("{message}", e.message);
70
- }
71
- function ua(e) {
72
- const t = x({}), r = x(!1);
73
- function n() {
74
- const c = {};
75
- for (const i of Array.isArray(e.defs.value) ? e.defs.value : [])
76
- typeof i?.field == "string" && Object.defineProperty(c, i.field, { value: e.params()[i.field] ?? i.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
77
- t.value = c, r.value = !1;
78
- }
79
- n(), M(e.defs, n), M(e.reportIds, n), M(() => JSON.stringify(e.params()), n);
80
- const o = O(() => _(e.defs.value, { ...e.params(), ...t.value })), u = O(() => !r.value && o.value.issues.length > 0 && o.value.issues.every((c) => c.code === "required"));
81
- function g() {
82
- const c = o.value;
83
- if (!c.ok) {
84
- const m = c.issues[0];
85
- return { quiet: u.value, error: new L(m.code === "definition" ? "config" : "param", ae(m, e.defs.value, e.messages()), { issues: c.issues }) };
86
- }
87
- const i = { ...c.values }, C = new Set(e.defs.value.filter((m) => m.defaultValue !== void 0).map((m) => m.field));
88
- for (const [m, h] of Object.entries(i)) h === "" && !C.has(m) && delete i[m];
89
- return { params: i, quiet: !1 };
90
- }
91
- return { values: t, attempted: r, validation: o, pendingRequired: u, reset: n, query: g };
92
- }
93
- const te = {
94
- paramOptionsLoading: "正在搜索选项…",
95
- paramOptionsEmpty: "没有匹配选项",
96
- paramOptionsFailed: "选项加载失败,请重试",
97
- paramOptionsMissingLoader: "尚未配置选项加载服务",
98
- paramOptionsDependencies: "请先选择上级条件",
99
- paramOptionsClear: "清除选择"
100
- }, ne = 100, Ee = 32, we = 6e4, Pe = 15e3;
101
- function xe(e) {
102
- if (!Array.isArray(e) || e.length > ne) throw new Error("Invalid option response");
103
- const t = /* @__PURE__ */ new Set();
104
- return Object.freeze(e.map((r) => {
105
- if (!r || typeof r.value != "string" || !r.value || r.value.length > 1024 || typeof r.label != "string" || r.label.length > 1024 || t.has(r.value)) throw new Error("Invalid option response");
106
- return t.add(r.value), Object.freeze({ label: r.label, value: r.value });
107
- }));
108
- }
109
- function Se(e) {
110
- const t = x(""), r = de([]), n = x(!1), o = x(!1), u = O(() => Object.fromEntries((Array.isArray(e.def().dependsOn) ? e.def().dependsOn : []).map((E) => [E, e.values()[E] ?? ""]))), g = O(() => Object.values(u.value).some((E) => !E.trim())), c = O(() => !e.loader()), i = /* @__PURE__ */ new Map();
111
- let C, m, h = 0;
112
- function A() {
113
- h++, C?.abort(), C = void 0, clearTimeout(m), n.value = !1;
114
- }
115
- async function b() {
116
- A(), o.value = !1;
117
- const E = e.loader(), w = e.def();
118
- if (!E || !w.optionsSource || g.value || e.disabled() || !e.opened()) return;
119
- const I = { source: w.optionsSource, field: w.field, query: t.value.trim().slice(0, 256), params: Object.freeze({ ...u.value }), limit: ne }, l = JSON.stringify(I), d = i.get(l);
120
- if (d && Date.now() - d.at < we) {
121
- i.delete(l), i.set(l, d), r.value = d.options;
122
- return;
123
- }
124
- const a = h, s = new AbortController();
125
- C = s, n.value = !0;
126
- const P = setTimeout(() => s.abort(), Pe);
127
- try {
128
- const S = xe(await me(E(Object.freeze({ ...I, signal: s.signal })), s.signal));
129
- if (a !== h) return;
130
- for (r.value = S, i.delete(l), i.set(l, { at: Date.now(), options: S }); i.size > Ee; ) i.delete(i.keys().next().value);
131
- } catch {
132
- a === h && (o.value = !0);
133
- } finally {
134
- clearTimeout(P), a === h && (n.value = !1, C = void 0);
135
- }
136
- }
137
- function F() {
138
- A(), r.value = [], o.value = !1, m = setTimeout(() => {
139
- b();
140
- }, 180);
141
- }
142
- return M(t, F, { flush: "sync" }), M([() => e.def().field, () => e.def().optionsSource, () => JSON.stringify(u.value), e.loader], () => {
143
- i.clear(), t.value = "", A(), r.value = [], o.value = !1, e.opened() && b();
144
- }, { flush: "sync" }), M([e.opened, e.disabled], () => {
145
- !e.opened() || e.disabled() ? A() : b();
146
- }), X(() => {
147
- A(), i.clear();
148
- }), { query: t, options: r, loading: n, failed: o, waiting: g, missingLoader: c, request: b, cancel: A };
149
- }
150
- const Oe = ["id", "value", "aria-labelledby", "aria-invalid", "aria-required", "aria-describedby", "aria-expanded", "aria-controls", "aria-activedescendant", "disabled", "placeholder"], Ce = ["aria-label", "disabled"], Ae = ["aria-label", "disabled"], ke = ["id"], Me = ["id", "aria-label", "aria-busy"], Fe = ["id", "aria-selected", "disabled", "onPointermove", "onClick"], Re = { key: 0 }, Ie = {
151
- key: 0,
152
- role: "status"
153
- }, De = /* @__PURE__ */ Y({
154
- __name: "ReportRemoteParamSelect",
155
- props: {
156
- def: {},
157
- value: {},
158
- values: {},
159
- loadOptions: { type: Function },
160
- messages: {},
161
- disabled: { type: Boolean },
162
- id: {},
163
- invalid: { type: Boolean }
164
- },
165
- emits: ["change"],
166
- setup(e, { emit: t }) {
167
- const r = e, n = t, o = be({ focusOnOpen: !1 }), { root: u, panel: g, opened: c } = o, i = Se({ def: () => r.def, values: () => r.values, loader: () => r.loadOptions, opened: () => c.value, disabled: () => r.disabled === !0 }), { query: C, options: m, loading: h, failed: A, waiting: b, missingLoader: F } = i, E = O(() => ({ ...te, ...r.messages })), w = x(0), I = x(""), l = x(), d = O(() => `${r.id}-options`), a = O(() => b.value ? E.value.paramOptionsDependencies : F.value ? E.value.paramOptionsMissingLoader : A.value ? E.value.paramOptionsFailed : h.value ? E.value.paramOptionsLoading : m.value.length ? "" : E.value.paramOptionsEmpty);
168
- M(() => r.value, () => {
169
- I.value = "";
170
- }), M(m, () => {
171
- w.value = 0;
172
- }), M(c, (y) => {
173
- y && B(() => l.value?.focus());
174
- });
175
- function s(y) {
176
- r.disabled || b.value || h.value || A.value || (n("change", y.value), o.close(), B(() => {
177
- I.value = y.label, l.value?.focus();
178
- }));
179
- }
180
- function P(y) {
181
- y.isComposing || (c.value = !0, C.value = y.target.value);
182
- }
183
- function S() {
184
- !r.disabled && !b.value && !F.value && (C.value = "", c.value = !0);
185
- }
186
- function le(y) {
187
- if (!(y.isComposing || y.keyCode === 229)) {
188
- if (y.key === "Escape") {
189
- c.value && (y.preventDefault(), y.stopPropagation(), o.close());
190
- return;
191
- }
192
- if (["ArrowUp", "ArrowDown", "Enter"].includes(y.key)) {
193
- if (y.preventDefault(), y.stopPropagation(), !c.value) {
194
- S();
195
- return;
196
- }
197
- if (y.key === "Enter") {
198
- const D = m.value[w.value];
199
- D && s(D);
200
- return;
201
- }
202
- m.value.length && (w.value = (w.value + (y.key === "ArrowDown" ? 1 : -1) + m.value.length) % m.value.length, B(() => g.value?.querySelector(`[id="${d.value}-${w.value}"]`)?.scrollIntoView?.({ block: "nearest" })));
203
- }
204
- }
205
- }
206
- function ie() {
207
- r.disabled || (n("change", ""), I.value = "", o.close());
208
- }
209
- return (y, D) => (f(), v("div", {
210
- ref_key: "root",
211
- ref: u,
212
- class: "mrp-remote-param"
213
- }, [
214
- q("div", {
215
- class: K(["mrp-remote-control", { "is-invalid": e.invalid }])
216
- }, [
217
- j(G, {
218
- name: "search",
219
- size: 14
220
- }),
221
- q("input", {
222
- id: e.id,
223
- ref_key: "input",
224
- ref: l,
225
- type: "text",
226
- role: "combobox",
227
- autocomplete: "off",
228
- value: p(c) ? p(C) : I.value || e.value,
229
- maxlength: 256,
230
- "aria-labelledby": `${e.id}-label`,
231
- "aria-invalid": e.invalid || void 0,
232
- "aria-required": e.def.required || void 0,
233
- "aria-describedby": e.invalid ? `${e.id}-error` : p(b) || p(F) ? `${e.id}-remote-status` : void 0,
234
- "aria-autocomplete": "list",
235
- "aria-expanded": p(c),
236
- "aria-controls": p(c) ? d.value : void 0,
237
- "aria-activedescendant": p(c) && p(m).length ? `${d.value}-${w.value}` : void 0,
238
- disabled: e.disabled || p(b) || p(F),
239
- placeholder: e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field),
240
- onClick: S,
241
- onInput: P,
242
- onCompositionend: P,
243
- onKeydown: le
244
- }, null, 40, Oe),
245
- e.value ? (f(), v("button", {
246
- key: 0,
247
- type: "button",
248
- "aria-label": E.value.paramOptionsClear,
249
- disabled: e.disabled,
250
- onClick: ie
251
- }, [
252
- j(G, {
253
- name: "close",
254
- size: 12
255
- })
256
- ], 8, Ce)) : (f(), v("button", {
257
- key: 1,
258
- type: "button",
259
- "aria-label": e.def.label ?? e.def.field,
260
- disabled: e.disabled || p(b) || p(F),
261
- onClick: D[0] || (D[0] = (R) => p(c) ? p(o).close() : S())
262
- }, [
263
- j(G, {
264
- name: "chevron-down",
265
- size: 12
266
- })
267
- ], 8, Ae))
268
- ], 2),
269
- p(b) || p(F) ? (f(), v("small", {
270
- key: 0,
271
- id: `${e.id}-remote-status`,
272
- role: "status"
273
- }, k(a.value), 9, ke)) : $("", !0),
274
- p(c) ? (f(), v("div", {
275
- key: 1,
276
- ref_key: "panel",
277
- ref: g,
278
- class: "mrp-remote-options"
279
- }, [
280
- q("div", {
281
- id: d.value,
282
- role: "listbox",
283
- "aria-label": e.def.label ?? e.def.field,
284
- "aria-busy": p(h)
285
- }, [
286
- (f(!0), v(N, null, U(p(m), (R, V) => (f(), v("button", {
287
- id: `${d.value}-${V}`,
288
- key: R.value,
289
- type: "button",
290
- role: "option",
291
- tabindex: "-1",
292
- "aria-selected": e.value === R.value,
293
- class: K({ active: V === w.value }),
294
- disabled: p(h),
295
- onPointermove: (oe) => w.value = V,
296
- onMousedown: D[1] || (D[1] = ue(() => {
297
- }, ["prevent"])),
298
- onClick: (oe) => s(R)
299
- }, [
300
- q("span", null, k(R.label), 1),
301
- R.label !== R.value ? (f(), v("small", Re, k(R.value), 1)) : $("", !0)
302
- ], 42, Fe))), 128))
303
- ], 8, Me),
304
- a.value ? (f(), v("p", Ie, [
305
- Q(k(a.value), 1),
306
- p(A) ? (f(), v("button", {
307
- key: 0,
308
- type: "button",
309
- onClick: D[2] || (D[2] = //@ts-ignore
310
- (...R) => p(i).request && p(i).request(...R))
311
- }, k(e.messages.retry), 1)) : $("", !0)
312
- ])) : $("", !0)
313
- ], 512)) : $("", !0)
314
- ], 512));
315
- }
316
- }), qe = /* @__PURE__ */ ee(De, [["__scopeId", "data-v-5dbac6ad"]]), $e = {
317
- key: 0,
318
- class: "mrp-params-title"
319
- }, Te = { class: "mrp-params-grid" }, Le = ["id"], Be = {
320
- key: 0,
321
- class: "mrp-param-star",
322
- "aria-hidden": "true"
323
- }, Ne = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], Ue = ["disabled", "hidden"], He = ["value"], Ve = ["aria-labelledby"], je = ["value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ze = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], Ge = ["id"], Ke = {
324
- key: 1,
325
- class: "mrp-params-actions"
326
- }, We = ["disabled"], Je = ["disabled"], Xe = /* @__PURE__ */ Y({
327
- __name: "ReportParamPanel",
328
- props: {
329
- defs: {},
330
- modelValue: {},
331
- messages: {},
332
- attempted: { type: Boolean },
333
- issues: { default: void 0 },
334
- showActions: { type: Boolean, default: !0 },
335
- showTitle: { type: Boolean, default: !0 },
336
- disabled: { type: Boolean, default: !1 },
337
- loadOptions: { type: Function, default: void 0 }
338
- },
339
- emits: ["update:modelValue", "query", "reset"],
340
- setup(e, { expose: t, emit: r }) {
341
- const n = e, o = r, u = x({ ...n.modelValue }), g = x(null), c = he();
342
- M(
343
- () => n.modelValue,
344
- (l) => {
345
- u.value = { ...l };
346
- }
347
- );
348
- const i = O(() => n.issues ?? _(n.defs, u.value).issues), C = O(
349
- () => (Array.isArray(n.defs) ? n.defs : []).filter((l) => l && typeof l.field == "string").map((l, d) => ({
350
- def: l,
351
- id: `${c}-${d}`,
352
- label: l.label ?? l.field,
353
- value: u.value[l.field] ?? "",
354
- error: n.attempted ? i.value.find((a) => a.field === l.field) : void 0
355
- }))
356
- ), m = O(() => {
357
- const l = /* @__PURE__ */ new Map();
358
- for (const d of n.defs) for (const a of Array.isArray(d.dependsOn) ? d.dependsOn : []) {
359
- const s = l.get(a) ?? [];
360
- s.push(d.field), l.set(a, s);
361
- }
362
- return l;
363
- });
364
- function h(l, d) {
365
- if (n.disabled || u.value[l] === d) return;
366
- u.value = { ...u.value, [l]: d };
367
- const a = /* @__PURE__ */ new Set([l]), s = [l];
368
- for (let P = 0; P < s.length; P++) for (const S of m.value.get(s[P]) ?? [])
369
- a.has(S) || (u.value[S] = "", a.add(S), s.push(S));
370
- o("update:modelValue", { ...u.value });
371
- }
372
- function A(l) {
373
- return l.type === "number" ? "number" : l.type === "date" || l.type === "month" ? l.type : "text";
374
- }
375
- function b(l, d) {
376
- return l.split("/")[d] ?? "";
377
- }
378
- function F(l, d, a) {
379
- return a ? !!b(l, 0) != !!b(l, 1) ? !b(l, d) || void 0 : !0 : void 0;
380
- }
381
- function E(l, d, a) {
382
- const s = [b(u.value[l] ?? "", 0), b(u.value[l] ?? "", 1)];
383
- s[d] = a, h(l, s.every((P) => !P) ? "" : s.join("/"));
384
- }
385
- function w(l) {
386
- l.isComposing || o("query");
387
- }
388
- function I() {
389
- g.value?.querySelector('[aria-invalid="true"]')?.focus();
390
- }
391
- return t({ focusInvalid: I }), (l, d) => (f(), v("div", {
392
- ref_key: "root",
393
- ref: g,
394
- class: "mrp-params"
395
- }, [
396
- e.showTitle !== !1 ? (f(), v("span", $e, k(e.messages.paramsTitle), 1)) : $("", !0),
397
- q("div", Te, [
398
- (f(!0), v(N, null, U(C.value, (a) => (f(), v("label", {
399
- key: a.id,
400
- class: K(["mrp-param", { "mrp-param-missing": !!a.error }])
401
- }, [
402
- q("span", {
403
- id: `${a.id}-label`,
404
- class: "mrp-param-label"
405
- }, [
406
- Q(k(a.label), 1),
407
- a.def.required ? (f(), v("i", Be, "*")) : $("", !0)
408
- ], 8, Le),
409
- a.def.optionsSource ? (f(), ce(qe, {
410
- key: 0,
411
- id: a.id,
412
- def: a.def,
413
- value: a.value,
414
- values: u.value,
415
- "load-options": e.loadOptions,
416
- messages: e.messages,
417
- disabled: e.disabled,
418
- invalid: !!a.error,
419
- onChange: (s) => h(a.def.field, s)
420
- }, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : (a.def.type ?? "text") === "select" ? (f(), v("select", {
421
- key: 1,
422
- class: "mrp-param-input",
423
- value: a.value,
424
- disabled: e.disabled,
425
- "aria-labelledby": `${a.id}-label`,
426
- "aria-invalid": a.error ? !0 : void 0,
427
- "aria-describedby": a.error ? `${a.id}-error` : void 0,
428
- "aria-required": a.def.required || void 0,
429
- onChange: (s) => h(a.def.field, s.target.value),
430
- onKeydown: z(w, ["enter"])
431
- }, [
432
- q("option", {
433
- value: "",
434
- disabled: a.def.required,
435
- hidden: a.def.required
436
- }, k(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, Ue),
437
- (f(!0), v(N, null, U(a.def.options ?? [], (s) => (f(), v("option", {
438
- key: s.value,
439
- value: s.value
440
- }, k(s.label), 9, He))), 128))
441
- ], 40, Ne)) : a.def.type === "dateRange" ? (f(), v("div", {
442
- key: 2,
443
- class: "mrp-param-range",
444
- role: "group",
445
- "aria-labelledby": `${a.id}-label`
446
- }, [
447
- (f(!0), v(N, null, U([e.messages.paramRangeStart ?? "开始日期", e.messages.paramRangeEnd ?? "结束日期"], (s, P) => (f(), v("input", {
448
- key: P,
449
- class: "mrp-param-input",
450
- type: "date",
451
- value: b(a.value, P),
452
- disabled: e.disabled,
453
- min: a.def.min,
454
- max: a.def.max,
455
- "aria-label": `${a.label} · ${s}`,
456
- "aria-invalid": F(a.value, P, a.error),
457
- "aria-describedby": a.error ? `${a.id}-error` : void 0,
458
- "aria-required": a.def.required || void 0,
459
- onInput: (S) => E(a.def.field, P, S.target.value),
460
- onKeydown: z(w, ["enter"])
461
- }, null, 40, je))), 128))
462
- ], 8, Ve)) : (f(), v("input", {
463
- key: 3,
464
- class: "mrp-param-input",
465
- type: A(a.def),
466
- inputmode: a.def.type === "year" ? "numeric" : void 0,
467
- maxlength: a.def.type === "year" ? 4 : void 0,
468
- placeholder: a.def.placeholder ?? (e.messages.paramTextPlaceholder ?? "请输入{label}").replace("{label}", a.label),
469
- value: a.value,
470
- disabled: e.disabled,
471
- min: a.def.min,
472
- max: a.def.max,
473
- step: a.def.type === "number" ? "any" : void 0,
474
- "aria-labelledby": `${a.id}-label`,
475
- "aria-invalid": a.error ? !0 : void 0,
476
- "aria-describedby": a.error ? `${a.id}-error` : void 0,
477
- "aria-required": a.def.required || void 0,
478
- onInput: (s) => h(a.def.field, s.target.value),
479
- onKeydown: z(w, ["enter"])
480
- }, null, 40, ze)),
481
- a.error ? (f(), v("small", {
482
- key: 4,
483
- id: `${a.id}-error`,
484
- class: "mrp-param-error",
485
- role: "status"
486
- }, k(p(ae)(a.error, e.defs, e.messages)), 9, Ge)) : $("", !0)
487
- ], 2))), 128))
488
- ]),
489
- e.showActions !== !1 ? (f(), v("div", Ke, [
490
- q("button", {
491
- class: "mrp-nav mrp-param-query",
492
- type: "button",
493
- disabled: e.disabled,
494
- onClick: d[0] || (d[0] = (a) => l.$emit("query"))
495
- }, k(e.messages.query), 9, We),
496
- q("button", {
497
- class: "mrp-nav",
498
- type: "button",
499
- disabled: e.disabled,
500
- onClick: d[1] || (d[1] = (a) => l.$emit("reset"))
501
- }, k(e.messages.reset), 9, Je)
502
- ])) : $("", !0)
503
- ], 512));
504
- }
505
- }), ca = /* @__PURE__ */ ee(Xe, [["__scopeId", "data-v-5fa48e40"]]), re = {
506
- calculationTitle: "选区计算",
507
- calculationLocal: "仅本地分析,不写回实绩、不重算原公式。请选取同一单位与量纲的数值。",
508
- calculationHint: "点击起点,Shift + 点击终点或方向键扩选。",
509
- calculationFormula: "计算方式",
510
- calculationExpression: "组合公式",
511
- calculationExpressionHint: "支持 SUM、AVERAGE/AVG、MIN、MAX、COUNT、MEDIAN 及 + - * / 和括号,不执行 Excel 公式;采用浮点数,精度仅用于展示。",
512
- calculationPrecision: "展示小数位",
513
- calculationRun: "计算选区",
514
- calculationCancel: "取消计算",
515
- calculationResult: "计算结果",
516
- calculationIncluded: "参与数值",
517
- calculationExcluded: "排除单元格",
518
- calculationEmpty: "选区没有可计算数值,计数为 0,其余结果为空。",
519
- calculationNoSelection: "先关闭设置并选择数据,再从底部工具栏打开选区计算。",
520
- calculationSum: "求和 SUM",
521
- calculationAverage: "平均值 AVERAGE",
522
- calculationMin: "最小值 MIN",
523
- calculationMax: "最大值 MAX",
524
- calculationCount: "数值计数 COUNT",
525
- calculationMedian: "中位数 MEDIAN",
526
- calculationCustom: "组合公式",
527
- calculationErrorSelection: "请选择同一明细区域中的数据。",
528
- calculationErrorLimit: "选区超过计算预算,请缩小范围后重试。",
529
- calculationErrorExpression: "公式无效,请使用支持的摘要名称、运算符与括号。",
530
- calculationErrorDivision: "除数不能为 0。",
531
- calculationErrorOverflow: "结果超出有效数值范围。",
532
- calculationErrorPrecision: "数值超出安全精度,或展示小数位不是 0 至 12 的整数。"
533
- };
534
- function fa(e) {
535
- const t = { ...re };
536
- for (const r of Object.keys(t)) {
537
- const n = e[r];
538
- typeof n == "string" && (t[r] = n);
539
- }
540
- return t;
541
- }
542
- const Ye = {
543
- ...te,
544
- drillActions: "查看关联",
545
- drillOpening: "正在打开…",
546
- drillMissingValue: "当前单元格缺少关联参数",
547
- drillFailed: "关联内容打开失败,请重试",
548
- ...ge,
549
- ...re,
550
- exportMenu: "导出",
551
- exportMenuDescription: "选择文件格式",
552
- clearSearch: "清除搜索",
553
- searchHint: "Enter 下一个 · Shift+Enter 上一个",
554
- searchNoMatches: "没有匹配内容",
555
- pageJump: "跳至页",
556
- pageJumpInvalid: "请输入有效页码",
557
- pageJumpHint: "Enter 跳转",
558
- pagination: "报表分页",
559
- recordNavigation: "标签记录",
560
- recordInfo: "记录 {cur} / {total}",
561
- prevRecord: "上一条记录",
562
- nextRecord: "下一条记录",
563
- dataExplanation: "来源数据说明",
564
- dataExplanationHint: "按字段查看来源与计算说明",
565
- dataExplanationSearch: "搜索说明、字段或记录",
566
- dataExplanationEmpty: "没有匹配的数据说明",
567
- dataMissingSource: "暂无来源",
568
- dataNotApplicable: "业务不适用",
569
- dataNotCalculable: "无法计算",
570
- columnSearchHint: "输入列名或字段标识",
571
- columnSearchShortcut: "↑ ↓ 选择 · Enter 定位",
572
- closeColumnDirectory: "关闭字段目录",
573
- columnResultsMore: "{count} 个匹配字段,显示前 {limit} 个;继续输入可缩小范围",
574
- columnCount: "{count} 个字段",
575
- settingsGeneral: "常规",
576
- settingsTools: "工具",
577
- settingsAdvanced: "高级",
578
- settingsAdvancedDescription: "按需开启分析能力,保持日常阅读简洁。",
579
- settingsCalculations: "启用选区计算",
580
- settingsCalculationsDescription: "选取数值后计算求和、平均值或组合公式,仅用于本地分析。",
581
- title: "报表预览",
582
- prevPage: "‹ 上一页",
583
- nextPage: "下一页 ›",
584
- pageInfo: "{cur} / {total}",
585
- fitWidth: "适宽",
586
- exportHtml: "导出 HTML",
587
- exportPdf: "导出 PDF",
588
- exportExcel: "导出 Excel",
589
- exportImage: "导出图片",
590
- exportWord: "导出 Word",
591
- exporting: "正在生成 {format}…",
592
- print: "打印",
593
- pdfWindow: "PDF 窗口",
594
- loading: "报表渲染中…",
595
- empty: "暂无预览数据",
596
- errorPrefix: "",
597
- retry: "重试",
598
- pdfFontUnavailable: "PDF 字体尚未就绪,请联系管理员检查字体配置;预览及其它导出仍可使用。",
599
- searchPlaceholder: "搜索报表内容",
600
- matchInfo: "{cur}/{total}",
601
- prevMatch: "‹",
602
- nextMatch: "›",
603
- thumbnails: "缩略图",
604
- paramsTitle: "查询条件",
605
- query: "查 询",
606
- reset: "重 置",
607
- paramRequired: "请填写{label}",
608
- paramInvalid: "{label}:{message}",
609
- paramPrompt: "请先完善查询条件",
610
- paramPromptDescription: "填写必填条件后点击查询,即可生成报表。",
611
- paramSelectPlaceholder: "请选择{label}",
612
- paramTextPlaceholder: "请输入{label}",
613
- paramRangeStart: "开始日期",
614
- paramRangeEnd: "结束日期",
615
- searching: "搜索中…",
616
- importExcel: "导入 Excel 模板",
617
- importing: "正在导入 Excel…",
618
- editCell: "编辑单元格",
619
- editingHint: "双击单元格编辑 · Enter 确认 · Esc 取消",
620
- saving: "正在保存修改…",
621
- editInvalidNumber: "请输入有效数字;清空表示无值",
622
- editInvalidBoolean: "请输入 true / false、是 / 否或 1 / 0",
623
- editConflict: "该单元格已变化,请重新打开编辑",
624
- settings: "设置",
625
- settingsDisplay: "阅读工具",
626
- settingsExport: "导出与打印",
627
- settingsData: "数据操作",
628
- settingsUnavailable: "需由接入方配置启用",
629
- settingsReset: "恢复默认",
630
- settingsClose: "关闭设置",
631
- search: "内容搜索",
632
- closeSearch: "关闭搜索",
633
- prevSearchMatch: "上一个匹配",
634
- nextSearchMatch: "下一个匹配",
635
- zoom: "缩放工具",
636
- settingsLocal: "按需启用工具,仅作用于当前预览。",
637
- editingLocal: "修改为本地草稿;不会自动写入业务数据库。",
638
- editingSaved: "修改将通过接入方配置的保存回调提交。",
639
- importLocal: "导入仅生成本地预览,不自动替换业务数据。",
640
- emptyDescription: "当前查询没有明细,请调整查询条件后重试。",
641
- undo: "撤销",
642
- redo: "重做",
643
- restoreChanges: "恢复来源值",
644
- changes: "修改明细",
645
- changesCount: "{count} 处修改",
646
- changesEmpty: "尚无修改",
647
- changesBefore: "来源值",
648
- changesAfter: "当前值",
649
- editAtomicRequired: "批量保存需要接入方提供原子 saveBatch 回调;本次未写入任何单元格。",
650
- clipboardLimit: "单次最多粘贴 10000 个单元格,请分批处理。",
651
- preferencesError: "偏好存储不可用,设置仍在当前预览中生效。",
652
- freezeHeaders: "冻结表头",
653
- frozenColumns: "冻结前列",
654
- sections: "工作表与章节",
655
- locateField: "定位字段",
656
- locateFieldPlaceholder: "输入字段标识,Enter 定位",
657
- locateFieldMissing: "未找到该字段,请核对字段标识。",
658
- importSummary: "Excel 导入摘要",
659
- importPreserved: "已导入 {sheets} 个工作表,保留内容、合并和样式。",
660
- importWarnings: "兼容性提示",
661
- importReadOnly: "公式、日期及受保护单元格保持只读;公式不重算。",
662
- conflicts: "保存冲突",
663
- editReadOnly: "选区包含只读或无权限单元格,本次修改未应用。",
664
- editMissing: "选区超出报表范围或缺少业务来源,请重新选择。",
665
- editRecalculationUnavailable: "此报表缺少重算会话或稳定数据来源,暂不支持编辑;请使用 reports/本地数据源重新加载。",
666
- editDuplicate: "选区包含同一业务字段的重复单元格,请缩小选区。",
667
- clipboardInvalid: "剪贴板内容无法识别,请使用矩形表格文本重新粘贴。",
668
- editSaved: "修改已通过保存回调确认",
669
- settingsPanes: "冻结窗格",
670
- columnDirectory: "字段目录",
671
- columnSearch: "搜索列名或字段",
672
- columnNoMatches: "未找到匹配字段",
673
- columnResults: "匹配字段",
674
- columnGroup: "明细区域",
675
- discardTitle: "保留当前修改?",
676
- discardDescription: "当前报表有尚未保存的输入或本地草稿,继续操作将替换这些内容。",
677
- discardKeep: "继续编辑",
678
- discardProceed: "放弃修改并继续",
679
- taskQuery: "正在获取数据…",
680
- taskValidate: "正在校验数据…",
681
- taskLayout: "正在生成版式…",
682
- taskAssets: "正在准备图片和字体…",
683
- taskEncode: "正在生成文件…",
684
- taskDownload: "正在准备下载…",
685
- taskPrint: "正在准备打印…",
686
- taskCancel: "取消任务",
687
- taskCancelled: "任务已取消,可重新操作。",
688
- diagnosticsSearch: "搜索提示、错误码或位置",
689
- diagnosticsMore: "共 {count} 条匹配,当前展示前 100 条;请搜索缩小范围。",
690
- diagnosticsTitle: "输出兼容性提示",
691
- diagnosticsLocate: "定位",
692
- diagnosticsLocation: "第 {page} 页 · 组件 {component}",
693
- diagnosticsStrict: "当前格式存在已知内容降级,请查看兼容性提示或选择其他输出格式。",
694
- diagnosticsDetails: "查看技术详情",
695
- diagnosticMissingImage: "图片或图表资源尚未准备完成,请重试或联系管理员。",
696
- diagnosticUnsupported: "当前输出格式会省略此内容,建议选择 PDF 或图片格式。",
697
- diagnosticUnsupportedStyle: "当前格式无法保留部分样式,请查看位置并选择适合的输出格式。",
698
- diagnosticImageFormat: "当前图片格式无法直接导出,请转换资源后重试。",
699
- diagnosticRichText: "文字内容会保留,部分字体与段落样式将简化。",
700
- diagnosticNested: "单元格中的嵌套内容会省略,单元格文字会保留。",
701
- diagnosticImageAsync: "图片需要完成加载后才能输出。",
702
- diagnosticImageDecode: "图片加载失败,请检查资源后重试。",
703
- diagnosticAssetFailed: "图表或图片生成失败,请重试或联系管理员。",
704
- diagnosticAssetBudget: "图片资源超出处理范围,请减少资源或缩小报表范围。"
705
- }, Qe = {
706
- emptyAccent: "#79a7e8",
707
- shellBg: "#f4f7fc",
708
- shellFg: "#334155",
709
- toolbarBg: "#ffffff",
710
- toolbarBorder: "#e4eaf3",
711
- toolbarFg: "#334155",
712
- btnFg: "#526078",
713
- btnBorder: "#dbe3ef",
714
- btnHoverBg: "#edf3ff",
715
- btnHoverFg: "#315fba",
716
- btnActiveBg: "#3569d4"
717
- };
718
- function Ze(e = {}) {
719
- return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
720
- }
721
- function pa(e) {
722
- return e;
723
- }
724
- const T = {
725
- showExport: !0,
726
- showPrint: !0,
727
- showPdfWindow: !0,
728
- showSettings: !0,
729
- showParams: !0,
730
- gapPx: 18,
731
- pdfFontUrl: "/simhei.ttf",
732
- logger: console
733
- }, va = { warn: () => {
734
- }, info: () => {
735
- } };
736
- function _e(e, t) {
737
- if (!(!e && !t))
738
- return { ...e, ...t, calibration: { ...e?.calibration, ...t?.calibration } };
739
- }
740
- function H(e, t) {
741
- return {
742
- ...e,
743
- ...t,
744
- theme: { ...e?.theme, ...t?.theme },
745
- messages: { ...e?.messages, ...t?.messages },
746
- preview: { ...e?.preview, ...t?.preview },
747
- xlsx: { ...e?.xlsx, ...t?.xlsx },
748
- toolbar: { ...e?.toolbar, ...t?.toolbar },
749
- interaction: { ...e?.interaction, ...t?.interaction },
750
- output: { ...e?.output, ...t?.output },
751
- printOptions: _e(e?.printOptions, t?.printOptions)
752
- };
753
- }
754
- function ea(e) {
755
- return {
756
- showExport: e.showExport ?? T.showExport,
757
- showPrint: e.showPrint ?? T.showPrint,
758
- showPdfWindow: e.showPdfWindow ?? T.showPdfWindow,
759
- showSettings: e.showSettings ?? T.showSettings,
760
- showParams: e.showParams ?? T.showParams,
761
- gapPx: e.gapPx ?? T.gapPx
762
- };
763
- }
764
- function ma(e, t) {
765
- const r = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, n = H(e?.defaults, r);
766
- return {
767
- drill: n.drill,
768
- exportExecution: n.exportExecution,
769
- loadParamOptions: n.loadParamOptions,
770
- ...ea(n),
771
- pdfFontUrl: n.pdfFontUrl ?? T.pdfFontUrl,
772
- theme: { ...Qe, ...n.theme },
773
- messages: { ...Ye, ...n.messages },
774
- logger: n.logger ?? T.logger,
775
- preview: {
776
- overscanPages: J(n.preview?.overscanPages, 1, 10, !0),
777
- searchDebounceMs: J(n.preview?.searchDebounceMs, 200, 2e3)
778
- },
779
- xlsx: { ...n.xlsx },
780
- editable: n.editable ?? !1,
781
- excelImport: n.excelImport ?? !1,
782
- toolbar: { ...n.toolbar },
783
- interaction: { ...n.interaction },
784
- preferences: n.preferences,
785
- assets: n.assets,
786
- guardChanges: n.guardChanges ?? !0,
787
- beforeDiscard: n.beforeDiscard,
788
- output: { ...n.output },
789
- printOptions: n.printOptions
790
- };
791
- }
792
- function J(e, t, r, n = !1) {
793
- if (e == null || !Number.isFinite(e)) return t;
794
- const o = Math.max(0, Math.min(r, e));
795
- return n ? Math.floor(o) : o;
796
- }
797
- function ga(e) {
798
- const t = {};
799
- return e.emptyAccent != null && (t["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (t["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (t["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (t["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (t["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (t["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (t["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (t["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (t["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (t["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (t["--mrp-btn-active-bg"] = e.btnActiveBg), t;
800
- }
801
- function ba(e) {
802
- const t = Z(W, null), r = O(() => {
803
- const n = t?.value ?? null, o = "defaults" in e || "presets" in e || "defaultPreset" in e ? Ze(e) : { defaults: e, presets: {} };
804
- if (!n) return o;
805
- const u = { ...n.presets, ...o.presets };
806
- for (const g of Object.keys(u))
807
- u[g] = H(
808
- H(n.presets[g], o.defaults),
809
- o.presets[g]
810
- );
811
- return {
812
- defaults: H(n.defaults, o.defaults),
813
- presets: u,
814
- defaultPreset: o.defaultPreset ?? n.defaultPreset
815
- };
816
- });
817
- fe(W, r);
818
- }
819
- function ya() {
820
- return Z(W, O(() => null));
821
- }
822
- export {
823
- re as D,
824
- L as M,
825
- te as P,
826
- ca as R,
827
- va as S,
828
- Ye as a,
829
- ge as b,
830
- Qe as c,
831
- Ze as d,
832
- pa as e,
833
- ba as f,
834
- ma as g,
835
- sa as h,
836
- be as i,
837
- ua as j,
838
- da as n,
839
- ia as p,
840
- fa as r,
841
- oa as s,
842
- ga as t,
843
- ya as u
844
- };