@agile-team/mach-report 2.22.0 → 2.23.1

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 (171) hide show
  1. package/README.md +8 -6
  2. package/dist/ExcelBindingWizard-BrTmdo7f.cjs +1 -0
  3. package/dist/ExcelBindingWizard-CcDMLO8Q.js +1486 -0
  4. package/dist/ParamEditor-BGjovFUe.js +737 -0
  5. package/dist/ParamEditor-CeNp4_zQ.cjs +1 -0
  6. package/dist/ReportBatchPanel-CHxBtG9R.cjs +1 -0
  7. package/dist/ReportBatchPanel-CJB67WNd.js +351 -0
  8. package/dist/ReportLabelStudio-Tplc1TLJ.js +784 -0
  9. package/dist/ReportLabelStudio-g8PkqJWn.cjs +1 -0
  10. package/dist/ReportParamPanel-C7fZTllk.cjs +1 -0
  11. package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-GI43aGa0.js} +146 -127
  12. package/dist/ReportPreview-BoGBGyRr.cjs +6 -0
  13. package/dist/ReportPreview-QLONCyci.js +6257 -0
  14. package/dist/ReportTemplateLibrary-BFQIX0sg.cjs +1 -0
  15. package/dist/ReportTemplateLibrary-KqX4E2sN.js +312 -0
  16. package/dist/RuleEditor-BZUP9yvL.cjs +1 -0
  17. package/dist/RuleEditor-OPX1awrH.js +2342 -0
  18. package/dist/TemplateOutlinePanel-CVYKVLv_.cjs +1 -0
  19. package/dist/TemplateOutlinePanel-DQS-eOs6.js +97 -0
  20. package/dist/TemplateReusePanel-CY6O93Zk.cjs +1 -0
  21. package/dist/TemplateReusePanel-DKXiFTyB.js +389 -0
  22. package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +1 -0
  23. package/dist/TemplateReviewPanel-Dijwm9YE.js +593 -0
  24. package/dist/analytics.cjs +1 -1
  25. package/dist/analytics.js +26 -26
  26. package/dist/artifact-integrity.json +106 -104
  27. package/dist/assets-D2gHc4Mz.cjs +1 -0
  28. package/dist/assets-T_gDeFaz.js +132 -0
  29. package/dist/auto-BB99S802.js +257 -0
  30. package/dist/auto-BrPWo7Xm.cjs +1 -0
  31. package/dist/capabilities-DiBj4Qgl.cjs +1 -0
  32. package/dist/capabilities-pg7j7VLT.js +106 -0
  33. package/dist/charts-Cjw5AYkg.cjs +1 -0
  34. package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
  35. package/dist/computed-DK6BruFz.cjs +1 -0
  36. package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
  37. package/dist/data-bar-CeZuFmYl.cjs +1 -0
  38. package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
  39. package/dist/designer-BZoVWTgl.js +7172 -0
  40. package/dist/designer-zS2uKJmY.cjs +2 -0
  41. package/dist/designer.cjs +1 -1
  42. package/dist/designer.d.cts +105 -45
  43. package/dist/designer.d.ts +105 -45
  44. package/dist/designer.js +4 -4
  45. package/dist/dom-ChE5D-L-.cjs +1 -0
  46. package/dist/dom-JWrchIre.js +452 -0
  47. package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
  48. package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
  49. package/dist/{encoding-ncQAvyOv.cjs → encoding-7lquyj0w.cjs} +1 -1
  50. package/dist/{encoding-DbnhbwI8.js → encoding-CEd-dq9A.js} +2 -2
  51. package/dist/{font-loader-Di0lQKFf.js → font-loader-CNWXomuV.js} +1 -1
  52. package/dist/{font-loader-BB372_XN.cjs → font-loader-D8pI87fL.cjs} +1 -1
  53. package/dist/grid-strokes-Be24LGuV.cjs +1 -0
  54. package/dist/grid-strokes-EoY66L2f.js +53 -0
  55. package/dist/index.cjs +8 -8
  56. package/dist/index.d.cts +6 -1
  57. package/dist/index.d.ts +6 -1
  58. package/dist/index.js +944 -1259
  59. package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-BRnzKudk.js} +763 -776
  60. package/dist/json-snapshot-DNiIbpOr.cjs +2 -0
  61. package/dist/matrix-B8QWbsGM.cjs +1 -0
  62. package/dist/matrix-C6e_r_vp.js +302 -0
  63. package/dist/{pdf-DmlnL5eB.js → pdf-CJToa81Z.js} +20 -20
  64. package/dist/{pdf-CARdBcuw.cjs → pdf-DpMkW72B.cjs} +42 -42
  65. package/dist/pdf.cjs +1 -1
  66. package/dist/pdf.js +2 -2
  67. package/dist/{plugin-AcAQ2m9X.cjs → plugin-BWTp-X7b.cjs} +1 -1
  68. package/dist/{plugin-w5Nyt08U.js → plugin-_BkUVc2z.js} +1 -1
  69. package/dist/{prefill-BXBxx5We.js → prefill-CWGdnqQd.js} +21 -21
  70. package/dist/prefill-PaAy6wLk.cjs +1 -0
  71. package/dist/prepared-CJy_qk7d.js +94 -0
  72. package/dist/prepared-D0yCSxSO.cjs +1 -0
  73. package/dist/progress-ByiOxUD3.js +250 -0
  74. package/dist/progress-WomPRP3B.cjs +1 -0
  75. package/dist/{protocol-fjaeKkjf.js → protocol-BG16rz6D.js} +3 -3
  76. package/dist/{protocol-C9ZaylID.cjs → protocol-wzhl1Fim.cjs} +1 -1
  77. package/dist/record-bindings-DatJZv_e.js +200 -0
  78. package/dist/record-bindings-MBxbeBsi.cjs +1 -0
  79. package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
  80. package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
  81. package/dist/report-encoding-worker.cjs +1 -1
  82. package/dist/report-encoding-worker.js +1 -1
  83. package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
  84. package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
  85. package/dist/runtime-DYMOS_gz.cjs +1 -0
  86. package/dist/{runtime-BTtpjF3D.js → runtime-PiCax9zQ.js} +52 -51
  87. package/dist/sbom.cdx.json +1 -1
  88. package/dist/server-node.cjs +5 -5
  89. package/dist/server-node.js +1676 -1619
  90. package/dist/server.cjs +1 -1
  91. package/dist/server.js +24 -24
  92. package/dist/style.css +1 -1
  93. package/dist/{template-catalog-JSxSqk5y.js → template-catalog-CRuZL3pi.js} +17 -17
  94. package/dist/template-catalog-DtrtT1FY.cjs +1 -0
  95. package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
  96. package/dist/template-fragments-GVjpew_q.cjs +1 -0
  97. package/dist/template-registry-DI59PXVK.cjs +1 -0
  98. package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
  99. package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
  100. package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
  101. package/dist/textwrap-D4ZksyMK.js +111 -0
  102. package/dist/textwrap-DEHqAjKZ.cjs +4 -0
  103. package/dist/vue/async.d.cts +31 -0
  104. package/dist/vue/async.d.ts +31 -0
  105. package/dist/vue/index.d.cts +32 -1
  106. package/dist/vue/index.d.ts +32 -1
  107. package/dist/vue-async.cjs +1 -1
  108. package/dist/vue-async.js +3 -3
  109. package/dist/vue.cjs +1 -1
  110. package/dist/vue.js +52 -47
  111. package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
  112. package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
  113. package/dist/worker.cjs +1 -1
  114. package/dist/worker.js +4 -4
  115. package/dist/xlsx.cjs +4 -4
  116. package/dist/xlsx.js +184 -179
  117. package/package.json +1 -1
  118. package/dist/ExcelBindingWizard-CW79I6Gl.cjs +0 -1
  119. package/dist/ExcelBindingWizard-CZyppD7I.js +0 -1485
  120. package/dist/ParamEditor-CiYCJI0b.cjs +0 -1
  121. package/dist/ParamEditor-DQit-Gdf.js +0 -732
  122. package/dist/ReportBatchPanel-DKTpV7MU.js +0 -350
  123. package/dist/ReportBatchPanel-Db6TAfG5.cjs +0 -1
  124. package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
  125. package/dist/ReportLabelStudio-BYnRqmje.js +0 -780
  126. package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
  127. package/dist/ReportPreview-BDgKssYR.js +0 -5887
  128. package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
  129. package/dist/ReportTemplateLibrary-BZuKn0YK.js +0 -311
  130. package/dist/ReportTemplateLibrary-DEXH07ND.cjs +0 -1
  131. package/dist/RuleEditor-CIQn547x.js +0 -2341
  132. package/dist/RuleEditor-zSUmPjKa.cjs +0 -1
  133. package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
  134. package/dist/TemplateOutlinePanel-D0PgOSQE.js +0 -96
  135. package/dist/TemplateReusePanel-BKlAEF8-.js +0 -388
  136. package/dist/TemplateReusePanel-DAy_Hwqz.cjs +0 -1
  137. package/dist/TemplateReviewPanel-CowmHaQQ.cjs +0 -1
  138. package/dist/TemplateReviewPanel-div-EH_m.js +0 -592
  139. package/dist/assets-CxHunY_9.js +0 -232
  140. package/dist/assets-vbjAGgk8.cjs +0 -1
  141. package/dist/auto-DcUHlKob.cjs +0 -1
  142. package/dist/auto-moShblh1.js +0 -240
  143. package/dist/charts-aCtoswXq.cjs +0 -1
  144. package/dist/component-tree-1_QCiQJX.js +0 -67
  145. package/dist/component-tree-BjZIp6w9.cjs +0 -1
  146. package/dist/computed-4TnxzgIh.cjs +0 -1
  147. package/dist/data-bar-YltqGTaC.cjs +0 -1
  148. package/dist/designer-B7jJeAeG.js +0 -6914
  149. package/dist/designer-BWQVpJeN.cjs +0 -2
  150. package/dist/grid-geometry-D3SJgWFv.js +0 -136
  151. package/dist/grid-geometry-D8ReblRV.cjs +0 -1
  152. package/dist/json-snapshot-nyV63AbB.cjs +0 -2
  153. package/dist/matrix-0hywp0-F.cjs +0 -1
  154. package/dist/matrix-Dy-tyY7E.js +0 -381
  155. package/dist/prefill-DUvejVt1.cjs +0 -1
  156. package/dist/prepared-YXy-fVLw.cjs +0 -1
  157. package/dist/prepared-rXCKqdHY.js +0 -88
  158. package/dist/progress-B0ctFpKf.cjs +0 -1
  159. package/dist/progress-Hc2vxoCs.js +0 -52
  160. package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
  161. package/dist/record-bindings-VZGS-Qd8.js +0 -155
  162. package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
  163. package/dist/rich-text-layout-wxBhnAS7.js +0 -102
  164. package/dist/runtime-Dq0LUsyS.cjs +0 -1
  165. package/dist/template-catalog-CLAM4w7H.cjs +0 -1
  166. package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
  167. package/dist/template-outline-CDWXptuj.js +0 -88
  168. package/dist/template-outline-K4jGhATu.cjs +0 -1
  169. package/dist/template-registry-CWnuGqyP.cjs +0 -1
  170. package/dist/textwrap-CkGjRFT3.js +0 -110
  171. package/dist/textwrap-OTOUMr4f.cjs +0 -4
@@ -1,2341 +0,0 @@
1
- import { ref as G, computed as j, defineComponent as ce, resolveComponent as ye, openBlock as s, createElementBlock as d, normalizeClass as ve, createElementVNode as a, createTextVNode as k, toDisplayString as t, createCommentVNode as E, Fragment as C, renderList as x, createVNode as re, watch as ne, withDirectives as F, isRef as oe, vModelCheckbox as de, unref as l, vModelSelect as L, vModelText as q, createBlock as fe, vShow as Ee } from "vue";
2
- import { r as Ke, i as be, v as Te, e as Le } from "./computed-C8NRZQss.js";
3
- import { _ as me } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
- import { u as he, D as Be } from "./designer-B7jJeAeG.js";
5
- import { u as ue } from "./useLocalDraft-BnhcxXk_.js";
6
- import { c as Oe } from "./matrix-Dy-tyY7E.js";
7
- import { v as ke } from "./template-registry-Do1Uav2Z.js";
8
- import { c as Ae } from "./template-serialization-CU4n_Miu.js";
9
- function $e(e, A = /* @__PURE__ */ new Set()) {
10
- return typeof e == "string" || ("field" in e && e.field && A.add(e.field), "weightField" in e && e.weightField && A.add(e.weightField), "args" in e && e.condition && Ke(e.condition).forEach(($) => A.add($)), "args" in e && e.args.forEach(($) => $e($, A))), A;
11
- }
12
- function Ve(e, A) {
13
- return typeof e == "string" ? e : "value" in e ? e.value === null ? A.null : String(e.value) : "aggregate" in e ? `${A[e.aggregate]}(${e.field ?? A.allRows})` : "field" in e ? e.field : `${A[e.op]}(${e.args.map(($) => Ve($, A)).join(", ")})`;
14
- }
15
- function Ie(e, A, $) {
16
- const J = G("");
17
- function w(S) {
18
- const U = e.list.columns.find((T) => T.field === S)?.format;
19
- return U && "digits" in U && U.digits !== void 0 ? `${U.digits} ${$.value.digits}` : void 0;
20
- }
21
- const m = j(() => {
22
- const S = /* @__PURE__ */ new Map();
23
- for (const U of e.datasetSchema?.fields ?? []) S.set(U.field, {
24
- field: U.field,
25
- label: U.label ?? U.field,
26
- meta: [U.type, U.unit, w(U.field)].filter(Boolean).join(" · ")
27
- });
28
- for (const U of e.list.columns) S.has(U.field) || S.set(U.field, { field: U.field, label: U.header || U.field, meta: U.semanticRole ?? "" });
29
- return [...S.values()];
30
- }), i = j(() => {
31
- const S = J.value.trim().toLocaleLowerCase();
32
- return m.value.filter((U) => `${U.field} ${U.label} ${U.meta}`.toLocaleLowerCase().includes(S));
33
- }), h = j(() => Ve(A.value.expression, $.value)), V = j(() => {
34
- const S = [...$e(A.value.expression)];
35
- return (e.datasets?.[e.list.dataset] ?? []).slice(0, 5).map((U, T) => ({
36
- row: T + 1,
37
- values: S.map((M) => `${M} = ${U[M] == null ? $.value.null : String(U[M])}`).join(" · ")
38
- }));
39
- });
40
- return { query: J, matches: i, fieldWindow: j(() => i.value.slice(0, 50)), expression: h, sources: V };
41
- }
42
- const We = { class: "mr-predicate__mode" }, Ge = ["aria-label", "value", "disabled"], Je = { value: "comparison" }, He = {
43
- key: 0,
44
- value: "all"
45
- }, je = {
46
- key: 1,
47
- value: "any"
48
- }, Pe = {
49
- key: 2,
50
- value: "not"
51
- }, ze = { class: "mr-predicate__pair" }, qe = ["aria-label", "value", "disabled"], Ze = ["value"], Qe = ["aria-label", "value", "disabled"], Xe = ["value"], Ye = ["value"], pe = ["aria-label", "value", "disabled"], _e = { value: "text" }, el = { value: "number" }, ll = { value: "decimal" }, al = { value: "date" }, tl = { value: "boolean" }, nl = {
52
- key: 0,
53
- class: "mr-predicate__pair"
54
- }, il = ["value", "disabled"], sl = ["value", "disabled"], dl = ["aria-label", "value", "disabled"], ol = { value: "value" }, ul = { value: "field" }, rl = ["value", "aria-label", "disabled"], cl = ["value"], ml = ["value", "aria-label", "disabled"], vl = ["aria-label", "disabled", "onClick"], bl = ["disabled"], gl = /* @__PURE__ */ ce({
55
- __name: "ReportPredicateEditor",
56
- props: {
57
- modelValue: {},
58
- fields: {},
59
- messages: {},
60
- readonly: { type: Boolean },
61
- depth: {}
62
- },
63
- emits: ["update:modelValue"],
64
- setup(e, { emit: A }) {
65
- const $ = e, J = A, w = j(() => "all" in $.modelValue ? "all" : "any" in $.modelValue ? "any" : "not" in $.modelValue ? "not" : "comparison"), m = j(() => "all" in $.modelValue ? $.modelValue.all : "any" in $.modelValue ? $.modelValue.any : "not" in $.modelValue ? [$.modelValue.not] : []), i = j(() => "field" in $.modelValue ? $.modelValue : void 0);
66
- function h(n) {
67
- $.readonly || J("update:modelValue", n);
68
- }
69
- function V() {
70
- return { field: $.fields[0]?.field ?? "", op: ">", value: 0, valueType: "number" };
71
- }
72
- function S(n) {
73
- const b = $.modelValue;
74
- h(n === "all" ? { all: [b] } : n === "any" ? { any: [b] } : n === "not" ? { not: b } : V());
75
- }
76
- function U(n, b) {
77
- const o = [...m.value];
78
- b ? o[n] = b : o.splice(n, 1), h(w.value === "all" ? { all: o } : w.value === "any" ? { any: o } : { not: o[0] });
79
- }
80
- function T() {
81
- const n = [...m.value, V()];
82
- h(w.value === "all" ? { all: n } : { any: n });
83
- }
84
- function M(n) {
85
- i.value && h({ ...i.value, ...n });
86
- }
87
- function W(n) {
88
- if (!i.value) return;
89
- const b = { ...i.value, op: n };
90
- delete b.right, delete b.values, n === "between" ? (b.values = [0, 1], delete b.value) : n === "isNull" || n === "isNotNull" ? delete b.value : b.value = n === "contains" ? "" : 0, h(b);
91
- }
92
- function z(n) {
93
- const b = i.value?.valueType ?? i.value?.numeric;
94
- return b === "number" && n.trim() && Number.isFinite(Number(n)) ? Number(n) : b === "boolean" ? n === "true" : n;
95
- }
96
- function I(n, b) {
97
- if (i.value)
98
- if (b !== void 0) {
99
- const o = [...i.value.values ?? [0, 1]];
100
- o[b] = z(n), M({ values: o });
101
- } else M({ value: z(n), right: void 0 });
102
- }
103
- function r(n) {
104
- M(n === "field" ? { value: void 0, right: { field: $.fields[0]?.field ?? "" } } : { value: 0, right: void 0 });
105
- }
106
- return (n, b) => {
107
- const o = ye("ReportPredicateEditor", !0);
108
- return s(), d("div", {
109
- class: ve(["mr-predicate", { "is-nested": (e.depth ?? 0) > 0 }])
110
- }, [
111
- a("label", We, [
112
- k(t(e.messages.conditionGroup), 1),
113
- a("select", {
114
- "aria-label": e.messages.conditionGroup,
115
- value: w.value,
116
- disabled: e.readonly,
117
- onChange: b[0] || (b[0] = (f) => S(f.target.value))
118
- }, [
119
- a("option", Je, t(e.messages.comparison), 1),
120
- (e.depth ?? 0) < 8 ? (s(), d("option", He, t(e.messages.all), 1)) : E("", !0),
121
- (e.depth ?? 0) < 8 ? (s(), d("option", je, t(e.messages.any), 1)) : E("", !0),
122
- (e.depth ?? 0) < 8 ? (s(), d("option", Pe, t(e.messages.not), 1)) : E("", !0)
123
- ], 40, Ge)
124
- ]),
125
- i.value ? (s(), d(C, { key: 0 }, [
126
- a("div", ze, [
127
- a("label", null, [
128
- k(t(e.messages.field), 1),
129
- a("select", {
130
- "aria-label": e.messages.condition,
131
- value: i.value.field,
132
- disabled: e.readonly,
133
- onChange: b[1] || (b[1] = (f) => M({ field: f.target.value }))
134
- }, [
135
- (s(!0), d(C, null, x(e.fields, (f) => (s(), d("option", {
136
- key: f.field,
137
- value: f.field
138
- }, t(f.label), 9, Ze))), 128))
139
- ], 40, qe)
140
- ]),
141
- a("label", null, [
142
- k(t(e.messages.comparison), 1),
143
- a("select", {
144
- "aria-label": e.messages.comparison,
145
- value: i.value.op,
146
- disabled: e.readonly,
147
- onChange: b[2] || (b[2] = (f) => W(f.target.value))
148
- }, [
149
- (s(), d(C, null, x([">", ">=", "<", "<=", "==", "!="], (f) => a("option", {
150
- key: f,
151
- value: f
152
- }, t(f), 9, Xe)), 64)),
153
- (s(), d(C, null, x(["between", "contains", "isNull", "isNotNull"], (f) => a("option", {
154
- key: f,
155
- value: f
156
- }, t(e.messages[f]), 9, Ye)), 64))
157
- ], 40, Qe)
158
- ])
159
- ]),
160
- ["isNull", "isNotNull"].includes(i.value.op) ? E("", !0) : (s(), d(C, { key: 0 }, [
161
- a("label", null, [
162
- k(t(e.messages.valueKind), 1),
163
- a("select", {
164
- "aria-label": e.messages.valueKind,
165
- value: i.value.valueType ?? i.value.numeric ?? (typeof i.value.value == "number" ? "number" : "text"),
166
- disabled: e.readonly,
167
- onChange: b[3] || (b[3] = (f) => M({ valueType: f.target.value }))
168
- }, [
169
- a("option", _e, t(e.messages.text), 1),
170
- a("option", el, t(e.messages.number), 1),
171
- a("option", ll, t(e.messages.decimal), 1),
172
- a("option", al, t(e.messages.calendarDate), 1),
173
- a("option", tl, t(e.messages.boolean), 1)
174
- ], 40, pe)
175
- ]),
176
- i.value.op === "between" ? (s(), d("div", nl, [
177
- a("label", null, [
178
- k(t(e.messages.lowerBound), 1),
179
- a("input", {
180
- value: i.value.values?.[0],
181
- disabled: e.readonly,
182
- onInput: b[4] || (b[4] = (f) => I(f.target.value, 0))
183
- }, null, 40, il)
184
- ]),
185
- a("label", null, [
186
- k(t(e.messages.upperBound), 1),
187
- a("input", {
188
- value: i.value.values?.[1],
189
- disabled: e.readonly,
190
- onInput: b[5] || (b[5] = (f) => I(f.target.value, 1))
191
- }, null, 40, sl)
192
- ])
193
- ])) : (s(), d(C, { key: 1 }, [
194
- a("label", null, [
195
- k(t(e.messages.threshold), 1),
196
- a("select", {
197
- "aria-label": e.messages.threshold,
198
- value: i.value.right && "field" in i.value.right ? "field" : "value",
199
- disabled: e.readonly,
200
- onChange: b[6] || (b[6] = (f) => r(f.target.value))
201
- }, [
202
- a("option", ol, t(e.messages.compareValue), 1),
203
- a("option", ul, t(e.messages.compareField), 1)
204
- ], 40, dl)
205
- ]),
206
- i.value.right && "field" in i.value.right ? (s(), d("select", {
207
- key: 0,
208
- value: i.value.right.field,
209
- "aria-label": e.messages.compareField,
210
- disabled: e.readonly,
211
- onChange: b[7] || (b[7] = (f) => M({ right: { field: f.target.value } }))
212
- }, [
213
- (s(!0), d(C, null, x(e.fields, (f) => (s(), d("option", {
214
- key: f.field,
215
- value: f.field
216
- }, t(f.label), 9, cl))), 128))
217
- ], 40, rl)) : (s(), d("input", {
218
- key: 1,
219
- value: i.value.right && "value" in i.value.right ? i.value.right.value : i.value.value,
220
- "aria-label": e.messages.compareValue,
221
- disabled: e.readonly,
222
- onInput: b[8] || (b[8] = (f) => I(f.target.value))
223
- }, null, 40, ml))
224
- ], 64))
225
- ], 64))
226
- ], 64)) : (s(), d(C, { key: 1 }, [
227
- (s(!0), d(C, null, x(m.value, (f, O) => (s(), d("div", {
228
- key: O,
229
- class: "mr-predicate__child"
230
- }, [
231
- re(o, {
232
- "model-value": f,
233
- fields: e.fields,
234
- messages: e.messages,
235
- readonly: e.readonly,
236
- depth: (e.depth ?? 0) + 1,
237
- "onUpdate:modelValue": (Z) => U(O, Z)
238
- }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
239
- m.value.length > 1 ? (s(), d("button", {
240
- key: 0,
241
- type: "button",
242
- "aria-label": e.messages.removeCondition,
243
- disabled: e.readonly,
244
- onClick: (Z) => U(O)
245
- }, "×", 8, vl)) : E("", !0)
246
- ]))), 128)),
247
- w.value !== "not" && m.value.length < 8 ? (s(), d("button", {
248
- key: 0,
249
- type: "button",
250
- disabled: e.readonly,
251
- onClick: T
252
- }, "+ " + t(e.messages.addCondition), 9, bl)) : E("", !0)
253
- ], 64))
254
- ], 2);
255
- };
256
- }
257
- }), we = /* @__PURE__ */ me(gl, [["__scopeId", "data-v-33dda0dd"]]), te = (e) => JSON.parse(JSON.stringify(e));
258
- function yl(e, A) {
259
- const $ = G(!1), J = G(""), w = G({
260
- dataset: "",
261
- parentKey: "",
262
- foreignKey: "",
263
- columns: []
264
- }), m = G({
265
- rowFields: [],
266
- columnFields: [],
267
- measures: []
268
- }), i = G({ input: "flat", idField: "id", parentField: "parentId", labelField: "", parentValues: "source" }), h = ue(() => ({ enabled: $.value, detail: w.value, matrix: m.value, tree: i.value }));
269
- let V;
270
- const S = G(), U = j(() => [
271
- .../* @__PURE__ */ new Set([
272
- ...Object.keys(e.datasets ?? {}),
273
- ...Object.keys(e.datasetSchemas ?? {})
274
- ])
275
- ]), T = j(
276
- () => W(e.list.dataset, e.datasetSchema)
277
- ), M = j(() => W(w.value.dataset));
278
- function W(v, D) {
279
- const R = /* @__PURE__ */ new Map();
280
- for (const c of (D ?? e.datasetSchemas?.[v])?.fields ?? [])
281
- R.set(c.field, c.label ?? c.field);
282
- const N = e.datasets?.[v]?.[0];
283
- for (const c of Object.keys(N ?? {}))
284
- R.has(c) || R.set(c, c);
285
- if (v === e.list.dataset)
286
- for (const c of e.list.columns)
287
- R.has(c.field) || R.set(c.field, c.header || c.field);
288
- return [...R].map(([c, u]) => ({ field: c, label: u }));
289
- }
290
- function z() {
291
- if (V === JSON.stringify(e.list)) {
292
- V = void 0;
293
- return;
294
- }
295
- $.value = !!e.list[e.mode];
296
- const v = U.value.find((D) => D !== e.list.dataset) ?? "";
297
- w.value = te(
298
- e.list.detail ?? {
299
- dataset: v,
300
- parentKey: e.list.rowKey ?? e.datasetSchema?.rowKey ?? T.value[0]?.field ?? "",
301
- foreignKey: "",
302
- columns: [],
303
- header: !0,
304
- unmatched: "error"
305
- }
306
- ), m.value = te(
307
- e.list.matrix ?? {
308
- rowFields: [],
309
- columnFields: [],
310
- measures: [],
311
- totals: !0
312
- }
313
- ), m.value.measures = m.value.measures.map((D) => ({ ...D, numeric: D.numeric ?? "number" })), i.value = te(e.list.tree ?? { input: "flat", idField: e.list.rowKey ?? "id", parentField: "parentId", childrenField: "children", labelField: e.list.columns[0]?.field ?? "", parentValues: "source", orphan: "error", indentMm: 3, maxRows: 1e5, maxDepth: 64 }), J.value = "", S.value = void 0, h.accept();
314
- }
315
- ne(() => [e.mode, e.list.dataset, e.list[e.mode]], z, { immediate: !0 });
316
- function I(v) {
317
- w.value.dataset = v, w.value.columns = [], w.value.foreignKey = M.value[0]?.field ?? "", w.value.rowKey = e.datasetSchemas?.[v]?.rowKey;
318
- }
319
- function r(v, D) {
320
- if (D && !w.value.columns.some((R) => R.field === v)) {
321
- const R = e.datasetSchemas?.[w.value.dataset]?.fields.find((N) => N.field === v);
322
- w.value.columns.push({
323
- field: v,
324
- header: M.value.find((N) => N.field === v)?.label ?? v,
325
- widthMm: 30,
326
- align: "auto",
327
- semanticRole: R?.semanticRole,
328
- editable: !1
329
- });
330
- } else D || (w.value.columns = w.value.columns.filter(
331
- (R) => R.field !== v
332
- ));
333
- }
334
- function n(v, D, R) {
335
- if (e.readonly) return;
336
- const N = m.value[v];
337
- b(v, R ? [.../* @__PURE__ */ new Set([...N, D])] : N.filter((c) => c !== D));
338
- }
339
- function b(v, D) {
340
- const R = m.value[v];
341
- m.value[v] = D;
342
- const N = m.value.hierarchy?.[v === "rowFields" ? "row" : "column"];
343
- N && (N.sort && (N.sort = D.map((c) => N.sort?.[R.indexOf(c)] ?? "source")), N.labels && (N.labels = D.map((c) => N.labels?.[R.indexOf(c)] ?? c)), N.subtotals && (N.subtotals = N.subtotals.map((c) => D.indexOf(R[c - 1]) + 1).filter((c) => c > 0 && c < D.length)));
344
- }
345
- function o(v, D, R) {
346
- const N = [...m.value[v]], c = D + R;
347
- e.readonly || D < 0 || D >= N.length || c < 0 || c >= N.length || ([N[D], N[c]] = [N[c], N[D]], b(v, N));
348
- }
349
- function f() {
350
- m.value.measures = [
351
- ...m.value.measures,
352
- { field: T.value[0]?.field ?? "", op: "sum", numeric: "number" }
353
- ];
354
- }
355
- function O(v) {
356
- m.value.measures = m.value.measures.filter(
357
- (D, R) => R !== v
358
- );
359
- }
360
- function Z(v) {
361
- e.readonly || (v ? m.value.hierarchy ??= {} : delete m.value.hierarchy);
362
- }
363
- function X(v, D, R) {
364
- if (e.readonly || !m.value.hierarchy) return;
365
- const N = m.value.hierarchy[v] ??= {}, u = (v === "row" ? m.value.rowFields : m.value.columnFields).map((H, B) => N.sort?.[B] ?? "source");
366
- u[D] = R, N.sort = u;
367
- }
368
- function ee(v, D, R) {
369
- if (e.readonly || !m.value.hierarchy) return;
370
- const N = m.value.hierarchy[v] ??= {};
371
- N.subtotals = [...new Set(R ? [...N.subtotals ?? [], D] : (N.subtotals ?? []).filter((c) => c !== D))];
372
- }
373
- function _() {
374
- i.value.aggregates = [...i.value.aggregates ?? [], { field: T.value.find((v) => v.field !== i.value.labelField && v.field !== i.value.idField)?.field ?? "", op: "sum", numeric: "number" }];
375
- }
376
- function Y(v) {
377
- i.value.aggregates = i.value.aggregates?.filter((D, R) => R !== v);
378
- }
379
- function le() {
380
- J.value = "", S.value = void 0;
381
- try {
382
- const v = e.datasets?.[e.list.dataset] ?? [];
383
- if (!v.length) throw new Error(e.messages.noData);
384
- if (v.length > 1e3) throw new Error(e.messages.treeBudget);
385
- const D = Ae(v, { ...i.value, aggregates: i.value.parentValues === "leaf-aggregate" ? i.value.aggregates : void 0, maxRows: 1e3 }), R = e.list.columns.slice(0, 5);
386
- S.value = { columns: R.map((N) => N.header), rows: D.entries.slice(0, 8).map((N) => R.map((c) => c.field === i.value.labelField ? `${" ".repeat(Math.min(6, N.depth))}${N.row[c.field] ?? ""}` : N.row[c.field])) };
387
- } catch (v) {
388
- J.value = v instanceof Error ? v.message : String(v);
389
- }
390
- }
391
- function p(v) {
392
- if (!$.value) {
393
- delete v.tree;
394
- return;
395
- }
396
- v.tree = te(i.value), v.tree.parentValues !== "leaf-aggregate" && delete v.tree.aggregates, v.rowKey = v.tree.idField, delete v.detail, delete v.matrix, delete v.groupBy, delete v.groups, delete v.rowVisibleWhen;
397
- }
398
- function ie() {
399
- J.value = "", S.value = void 0;
400
- try {
401
- const v = e.datasets?.[e.list.dataset] ?? [];
402
- if (!v.length) throw new Error(e.messages.noData);
403
- const D = Oe(v.slice(0, 1e3), {
404
- ...m.value,
405
- maxInputRows: 1e3
406
- });
407
- S.value = {
408
- columns: D.columns.slice(0, 5).map((R) => R.header),
409
- rows: D.rows.slice(0, 5).map(
410
- (R) => D.columns.slice(0, 5).map((N) => R[N.field])
411
- )
412
- };
413
- } catch (v) {
414
- J.value = v instanceof Error ? v.message : String(v);
415
- }
416
- }
417
- function ae() {
418
- if (e.readonly) return;
419
- const v = te(e.list);
420
- e.mode === "tree" ? p(v) : e.mode === "detail" ? $.value ? (v.detail = te(w.value), delete v.matrix, delete v.tree) : delete v.detail : $.value ? (v.matrix = te(m.value), delete v.detail, delete v.tree, delete v.groups, delete v.groupBy, delete v.grandTotal) : delete v.matrix;
421
- const D = ke({ pages: [{ widthMm: Math.max(1, v.leftMm + v.widthMm), heightMm: 297, components: [v] }] });
422
- if (!D.ok) {
423
- J.value = D.errors.slice(0, 3).map((R) => R.message).join(";");
424
- return;
425
- }
426
- e.accept && !e.accept(v) || (V = JSON.stringify(v), e.accept || A(v), h.accept());
427
- }
428
- return he({ key: () => `${e.recoveryKey ?? "rules:0:0"}:${e.mode}`, baseline: () => JSON.stringify(e.list[e.mode]), pending: () => h.pending.value, reset: () => {
429
- V = void 0, z();
430
- }, snapshot: () => JSON.stringify({ enabled: $.value, detail: w.value, matrix: m.value, tree: i.value, baseline: h.baseline.value }), restore(v) {
431
- const D = JSON.parse(v);
432
- $.value = D.enabled, w.value = D.detail, m.value = D.matrix, i.value = D.tree, h.baseline.value = D.baseline;
433
- } }), {
434
- enabled: $,
435
- pendingLocalChanges: h.pending,
436
- detail: w,
437
- matrix: m,
438
- tree: i,
439
- datasets: U,
440
- sourceFields: T,
441
- childFields: M,
442
- error: J,
443
- preview: S,
444
- chooseDataset: I,
445
- toggleChildColumn: r,
446
- toggleDimension: n,
447
- moveDimension: o,
448
- addMeasure: f,
449
- removeMeasure: O,
450
- checkMatrix: ie,
451
- toggleHierarchy: Z,
452
- setDimensionSort: X,
453
- toggleMatrixSubtotal: ee,
454
- addTreeAggregate: _,
455
- removeTreeAggregate: Y,
456
- checkTree: le,
457
- apply: ae
458
- };
459
- }
460
- const fl = { class: "mr-data-layout" }, hl = { class: "mr-data-layout__check" }, kl = ["disabled"], $l = { class: "mr-data-layout__hint" }, Vl = ["aria-label", "value", "disabled"], wl = {
461
- value: "",
462
- disabled: ""
463
- }, Cl = ["value"], Ul = { class: "mr-data-layout__pair" }, Fl = ["aria-label", "disabled"], Sl = ["value"], Ml = ["aria-label", "disabled"], Dl = {
464
- value: "",
465
- disabled: ""
466
- }, xl = ["value"], Nl = ["aria-label", "disabled"], Rl = { value: void 0 }, El = ["value"], Kl = { class: "mr-data-layout__choices" }, Tl = ["checked", "disabled", "onChange"], Ll = ["aria-label", "disabled"], Bl = { class: "mr-data-layout__pair" }, Ol = ["aria-label", "disabled"], Al = { value: "error" }, Il = { value: "ignore" }, Wl = { class: "mr-data-layout__check" }, Gl = ["disabled"], Jl = { class: "mr-data-layout__hint" }, Hl = { class: "mr-data-layout__pair" }, jl = ["aria-label", "disabled"], Pl = { value: "flat" }, zl = { value: "nested" }, ql = ["aria-label", "disabled"], Zl = ["value"], Ql = { class: "mr-data-layout__pair" }, Xl = { key: 0 }, Yl = ["aria-label", "disabled"], pl = ["value"], _l = { key: 1 }, ea = ["aria-label", "disabled"], la = ["aria-label", "disabled"], aa = ["value"], ta = { class: "mr-data-layout__pair" }, na = ["aria-label", "disabled"], ia = { key: 0 }, sa = ["aria-label", "disabled"], da = { value: "error" }, oa = { value: "root" }, ua = ["aria-label", "disabled"], ra = { value: "source" }, ca = { value: "leaf-aggregate" }, ma = { class: "mr-data-layout__pair" }, va = ["onUpdate:modelValue", "aria-label", "disabled"], ba = ["value"], ga = ["onUpdate:modelValue", "aria-label", "disabled"], ya = ["value"], fa = { key: 0 }, ha = ["onUpdate:modelValue", "aria-label", "disabled"], ka = ["value"], $a = { class: "mr-data-layout__pair" }, Va = ["onUpdate:modelValue", "aria-label", "disabled"], wa = { value: "number" }, Ca = { value: "decimal" }, Ua = ["onUpdate:modelValue", "aria-label", "disabled"], Fa = ["disabled", "onClick"], Sa = ["disabled"], Ma = { class: "mr-data-layout__pair" }, Da = ["aria-label", "disabled"], xa = ["aria-label", "disabled"], Na = { class: "mr-data-layout__hint" }, Ra = { class: "mr-data-layout__hint" }, Ea = ["checked", "disabled", "onChange"], Ka = { class: "mr-data-layout__pair" }, Ta = ["aria-label", "onUpdate:modelValue", "disabled"], La = ["value"], Ba = ["aria-label", "onUpdate:modelValue", "disabled"], Oa = ["value"], Aa = ["aria-label", "onUpdate:modelValue", "disabled", "placeholder"], Ia = { key: 0 }, Wa = ["aria-label", "onUpdate:modelValue", "disabled"], Ga = ["value"], Ja = { class: "mr-data-layout__pair" }, Ha = ["aria-label", "onUpdate:modelValue", "disabled"], ja = { value: "number" }, Pa = { value: "decimal" }, za = ["aria-label", "onUpdate:modelValue", "disabled"], qa = ["disabled", "onClick"], Za = ["disabled"], Qa = { class: "mr-data-layout__check" }, Xa = ["disabled"], Ya = { class: "mr-data-layout__check" }, pa = ["checked", "disabled"], _a = { class: "mr-data-layout__hint" }, et = ["aria-label", "disabled"], lt = ["aria-label", "value", "disabled", "onChange"], at = { value: "source" }, tt = { value: "asc" }, nt = { value: "desc" }, it = ["aria-label", "disabled", "onClick"], st = ["aria-label", "disabled", "onClick"], dt = {
467
- key: 0,
468
- class: "mr-data-layout__check"
469
- }, ot = ["checked", "disabled", "onChange"], ut = { class: "mr-data-layout__pair" }, rt = ["disabled"], ct = ["disabled"], mt = { class: "mr-data-layout__actions" }, vt = ["disabled"], bt = ["disabled"], gt = ["disabled"], yt = {
470
- key: 3,
471
- class: "mr-data-layout__preview"
472
- }, ft = {
473
- key: 4,
474
- class: "mr-data-layout__error",
475
- role: "alert"
476
- }, ht = /* @__PURE__ */ ce({
477
- __name: "RuleDataLayout",
478
- props: {
479
- recoveryKey: {},
480
- list: {},
481
- accept: { type: Function },
482
- mode: {},
483
- datasets: {},
484
- datasetSchema: {},
485
- datasetSchemas: {},
486
- readonly: { type: Boolean },
487
- messages: {}
488
- },
489
- emits: ["change", "dirty"],
490
- setup(e, { emit: A }) {
491
- const $ = e, J = A, w = yl($, (I) => J("change", I)), {
492
- enabled: m,
493
- detail: i,
494
- matrix: h,
495
- tree: V,
496
- datasets: S,
497
- sourceFields: U,
498
- childFields: T,
499
- error: M,
500
- preview: W
501
- } = w;
502
- ne([w.pendingLocalChanges, m, i, h, V], () => J("dirty", w.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
503
- const z = be();
504
- return (I, r) => (s(), d("div", fl, [
505
- a("label", hl, [
506
- F(a("input", {
507
- "onUpdate:modelValue": r[0] || (r[0] = (n) => oe(m) ? m.value = n : null),
508
- type: "checkbox",
509
- disabled: e.readonly
510
- }, null, 8, kl), [
511
- [de, l(m)]
512
- ]),
513
- k(t(e.messages.enabled) + t(e.messages[e.mode]), 1)
514
- ]),
515
- l(m) && e.mode === "detail" ? (s(), d(C, { key: 0 }, [
516
- a("p", $l, t(e.messages.detailHint), 1),
517
- a("label", null, [
518
- k(t(e.messages.childDataset), 1),
519
- a("select", {
520
- "aria-label": e.messages.childDataset,
521
- value: l(i).dataset,
522
- disabled: e.readonly,
523
- onChange: r[1] || (r[1] = (n) => l(w).chooseDataset(n.target.value))
524
- }, [
525
- a("option", wl, t(e.messages.select), 1),
526
- (s(!0), d(C, null, x(l(S), (n) => (s(), d("option", {
527
- key: n,
528
- value: n
529
- }, t(n), 9, Cl))), 128))
530
- ], 40, Vl)
531
- ]),
532
- a("div", Ul, [
533
- a("label", null, [
534
- k(t(e.messages.parentKey), 1),
535
- F(a("select", {
536
- "aria-label": e.messages.parentKey,
537
- "onUpdate:modelValue": r[2] || (r[2] = (n) => l(i).parentKey = n),
538
- disabled: e.readonly
539
- }, [
540
- (s(!0), d(C, null, x(l(U), (n) => (s(), d("option", {
541
- key: n.field,
542
- value: n.field
543
- }, t(n.label), 9, Sl))), 128))
544
- ], 8, Fl), [
545
- [L, l(i).parentKey]
546
- ])
547
- ]),
548
- a("label", null, [
549
- k(t(e.messages.foreignKey), 1),
550
- F(a("select", {
551
- "aria-label": e.messages.foreignKey,
552
- "onUpdate:modelValue": r[3] || (r[3] = (n) => l(i).foreignKey = n),
553
- disabled: e.readonly
554
- }, [
555
- a("option", Dl, t(e.messages.select), 1),
556
- (s(!0), d(C, null, x(l(T), (n) => (s(), d("option", {
557
- key: n.field,
558
- value: n.field
559
- }, t(n.label), 9, xl))), 128))
560
- ], 8, Ml), [
561
- [L, l(i).foreignKey]
562
- ])
563
- ])
564
- ]),
565
- a("label", null, [
566
- k(t(e.messages.rowKey), 1),
567
- F(a("select", {
568
- "aria-label": e.messages.rowKey,
569
- "onUpdate:modelValue": r[4] || (r[4] = (n) => l(i).rowKey = n),
570
- disabled: e.readonly
571
- }, [
572
- a("option", Rl, t(e.messages.noRowKey), 1),
573
- (s(!0), d(C, null, x(l(T), (n) => (s(), d("option", {
574
- key: n.field,
575
- value: n.field
576
- }, t(n.label), 9, El))), 128))
577
- ], 8, Nl), [
578
- [L, l(i).rowKey]
579
- ])
580
- ]),
581
- a("fieldset", Kl, [
582
- a("legend", null, t(e.messages.childColumns), 1),
583
- (s(!0), d(C, null, x(l(T), (n) => (s(), d("label", {
584
- key: n.field
585
- }, [
586
- a("input", {
587
- type: "checkbox",
588
- checked: l(i).columns.some((b) => b.field === n.field),
589
- disabled: e.readonly,
590
- onChange: (b) => l(w).toggleChildColumn(
591
- n.field,
592
- b.target.checked
593
- )
594
- }, null, 40, Tl),
595
- k(t(n.label), 1)
596
- ]))), 128))
597
- ]),
598
- a("label", null, [
599
- k(t(e.messages.title), 1),
600
- F(a("input", {
601
- "aria-label": e.messages.title,
602
- "onUpdate:modelValue": r[5] || (r[5] = (n) => l(i).label = n),
603
- disabled: e.readonly
604
- }, null, 8, Ll), [
605
- [q, l(i).label]
606
- ])
607
- ]),
608
- a("div", Bl, [
609
- a("label", null, [
610
- k(t(e.messages.unmatched), 1),
611
- F(a("select", {
612
- "aria-label": e.messages.unmatched,
613
- "onUpdate:modelValue": r[6] || (r[6] = (n) => l(i).unmatched = n),
614
- disabled: e.readonly
615
- }, [
616
- a("option", Al, t(e.messages.error), 1),
617
- a("option", Il, t(e.messages.ignore), 1)
618
- ], 8, Ol), [
619
- [L, l(i).unmatched]
620
- ])
621
- ]),
622
- a("label", Wl, [
623
- F(a("input", {
624
- "onUpdate:modelValue": r[7] || (r[7] = (n) => l(i).header = n),
625
- type: "checkbox",
626
- disabled: e.readonly
627
- }, null, 8, Gl), [
628
- [de, l(i).header]
629
- ]),
630
- k(t(e.messages.childHeader), 1)
631
- ])
632
- ])
633
- ], 64)) : l(m) && e.mode === "tree" ? (s(), d(C, { key: 1 }, [
634
- a("p", Jl, t(e.messages.treeHint), 1),
635
- a("div", Hl, [
636
- a("label", null, [
637
- k(t(e.messages.treeInput), 1),
638
- F(a("select", {
639
- "onUpdate:modelValue": r[8] || (r[8] = (n) => l(V).input = n),
640
- "aria-label": e.messages.treeInput,
641
- disabled: e.readonly
642
- }, [
643
- a("option", Pl, t(e.messages.treeFlat), 1),
644
- a("option", zl, t(e.messages.treeNested), 1)
645
- ], 8, jl), [
646
- [L, l(V).input]
647
- ])
648
- ]),
649
- a("label", null, [
650
- k(t(e.messages.treeId), 1),
651
- F(a("select", {
652
- "onUpdate:modelValue": r[9] || (r[9] = (n) => l(V).idField = n),
653
- "aria-label": e.messages.treeId,
654
- disabled: e.readonly
655
- }, [
656
- (s(!0), d(C, null, x(l(U), (n) => (s(), d("option", {
657
- key: n.field,
658
- value: n.field
659
- }, t(n.label), 9, Zl))), 128))
660
- ], 8, ql), [
661
- [L, l(V).idField]
662
- ])
663
- ])
664
- ]),
665
- a("div", Ql, [
666
- l(V).input === "flat" ? (s(), d("label", Xl, [
667
- k(t(e.messages.treeParent), 1),
668
- F(a("select", {
669
- "onUpdate:modelValue": r[10] || (r[10] = (n) => l(V).parentField = n),
670
- "aria-label": e.messages.treeParent,
671
- disabled: e.readonly
672
- }, [
673
- (s(!0), d(C, null, x(l(U), (n) => (s(), d("option", {
674
- key: n.field,
675
- value: n.field
676
- }, t(n.label), 9, pl))), 128))
677
- ], 8, Yl), [
678
- [L, l(V).parentField]
679
- ])
680
- ])) : (s(), d("label", _l, [
681
- k(t(e.messages.treeChildren), 1),
682
- F(a("input", {
683
- "onUpdate:modelValue": r[11] || (r[11] = (n) => l(V).childrenField = n),
684
- "aria-label": e.messages.treeChildren,
685
- disabled: e.readonly,
686
- placeholder: "children"
687
- }, null, 8, ea), [
688
- [q, l(V).childrenField]
689
- ])
690
- ])),
691
- a("label", null, [
692
- k(t(e.messages.treeLabel), 1),
693
- F(a("select", {
694
- "onUpdate:modelValue": r[12] || (r[12] = (n) => l(V).labelField = n),
695
- "aria-label": e.messages.treeLabel,
696
- disabled: e.readonly
697
- }, [
698
- (s(!0), d(C, null, x(e.list.columns.filter((n) => !n.hidden), (n) => (s(), d("option", {
699
- key: n.field,
700
- value: n.field
701
- }, t(n.header), 9, aa))), 128))
702
- ], 8, la), [
703
- [L, l(V).labelField]
704
- ])
705
- ])
706
- ]),
707
- a("div", ta, [
708
- a("label", null, [
709
- k(t(e.messages.treeIndent), 1),
710
- F(a("input", {
711
- "onUpdate:modelValue": r[13] || (r[13] = (n) => l(V).indentMm = n),
712
- "aria-label": e.messages.treeIndent,
713
- type: "number",
714
- min: "0",
715
- max: "20",
716
- step: "0.5",
717
- disabled: e.readonly
718
- }, null, 8, na), [
719
- [
720
- q,
721
- l(V).indentMm,
722
- void 0,
723
- { number: !0 }
724
- ]
725
- ])
726
- ]),
727
- l(V).input === "flat" ? (s(), d("label", ia, [
728
- k(t(e.messages.treeOrphan), 1),
729
- F(a("select", {
730
- "onUpdate:modelValue": r[14] || (r[14] = (n) => l(V).orphan = n),
731
- "aria-label": e.messages.treeOrphan,
732
- disabled: e.readonly
733
- }, [
734
- a("option", da, t(e.messages.error), 1),
735
- a("option", oa, t(e.messages.treeAsRoot), 1)
736
- ], 8, sa), [
737
- [L, l(V).orphan]
738
- ])
739
- ])) : E("", !0)
740
- ]),
741
- a("label", null, [
742
- k(t(e.messages.treeValues), 1),
743
- F(a("select", {
744
- "onUpdate:modelValue": r[15] || (r[15] = (n) => l(V).parentValues = n),
745
- "aria-label": e.messages.treeValues,
746
- disabled: e.readonly
747
- }, [
748
- a("option", ra, t(e.messages.treeSource), 1),
749
- a("option", ca, t(e.messages.treeLeaves), 1)
750
- ], 8, ua), [
751
- [L, l(V).parentValues]
752
- ])
753
- ]),
754
- l(V).parentValues === "leaf-aggregate" ? (s(), d(C, { key: 0 }, [
755
- (s(!0), d(C, null, x(l(V).aggregates, (n, b) => (s(), d("div", {
756
- key: b,
757
- class: "mr-data-layout__measure"
758
- }, [
759
- a("div", ma, [
760
- a("label", null, [
761
- k(t(e.messages.measure), 1),
762
- F(a("select", {
763
- "onUpdate:modelValue": (o) => n.field = o,
764
- "aria-label": e.messages.measure,
765
- disabled: e.readonly
766
- }, [
767
- (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
768
- key: o.field,
769
- value: o.field
770
- }, t(o.label), 9, ba))), 128))
771
- ], 8, va), [
772
- [L, n.field]
773
- ])
774
- ]),
775
- a("label", null, [
776
- k(t(e.messages.aggregate), 1),
777
- F(a("select", {
778
- "onUpdate:modelValue": (o) => n.op = o,
779
- "aria-label": e.messages.aggregate,
780
- disabled: e.readonly
781
- }, [
782
- (s(!0), d(C, null, x(l(z).aggregates, (o) => (s(), d("option", {
783
- key: o,
784
- value: o
785
- }, t(e.messages[o]), 9, ya))), 128))
786
- ], 8, ga), [
787
- [L, n.op]
788
- ])
789
- ])
790
- ]),
791
- n.op === "weightedAvg" ? (s(), d("label", fa, [
792
- k(t(e.messages.weight), 1),
793
- F(a("select", {
794
- "onUpdate:modelValue": (o) => n.weightField = o,
795
- "aria-label": e.messages.weight,
796
- disabled: e.readonly
797
- }, [
798
- (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
799
- key: o.field,
800
- value: o.field
801
- }, t(o.label), 9, ka))), 128))
802
- ], 8, ha), [
803
- [L, n.weightField]
804
- ])
805
- ])) : E("", !0),
806
- a("div", $a, [
807
- a("label", null, [
808
- k(t(e.messages.numeric), 1),
809
- F(a("select", {
810
- "onUpdate:modelValue": (o) => n.numeric = o,
811
- "aria-label": e.messages.numeric,
812
- disabled: e.readonly
813
- }, [
814
- a("option", wa, t(e.messages.number), 1),
815
- a("option", Ca, t(e.messages.decimal), 1)
816
- ], 8, Va), [
817
- [L, n.numeric]
818
- ])
819
- ]),
820
- a("label", null, [
821
- k(t(e.messages.digits), 1),
822
- F(a("input", {
823
- "onUpdate:modelValue": (o) => n.digits = o,
824
- "aria-label": e.messages.digits,
825
- type: "number",
826
- min: "0",
827
- max: "100",
828
- disabled: e.readonly
829
- }, null, 8, Ua), [
830
- [
831
- q,
832
- n.digits,
833
- void 0,
834
- { number: !0 }
835
- ]
836
- ])
837
- ])
838
- ]),
839
- a("button", {
840
- type: "button",
841
- disabled: e.readonly,
842
- onClick: (o) => l(w).removeTreeAggregate(b)
843
- }, t(e.messages.remove), 9, Fa)
844
- ]))), 128)),
845
- a("button", {
846
- type: "button",
847
- disabled: e.readonly || (l(V).aggregates?.length ?? 0) >= 32,
848
- onClick: r[16] || (r[16] = //@ts-ignore
849
- (...n) => l(w).addTreeAggregate && l(w).addTreeAggregate(...n))
850
- }, "+ " + t(e.messages.addAggregate), 9, Sa)
851
- ], 64)) : E("", !0),
852
- a("details", null, [
853
- a("summary", null, t(e.messages.advanced), 1),
854
- a("div", Ma, [
855
- a("label", null, [
856
- k(t(e.messages.treeRows), 1),
857
- F(a("input", {
858
- "onUpdate:modelValue": r[17] || (r[17] = (n) => l(V).maxRows = n),
859
- "aria-label": e.messages.treeRows,
860
- type: "number",
861
- min: "1",
862
- max: "1000000",
863
- disabled: e.readonly
864
- }, null, 8, Da), [
865
- [
866
- q,
867
- l(V).maxRows,
868
- void 0,
869
- { number: !0 }
870
- ]
871
- ])
872
- ]),
873
- a("label", null, [
874
- k(t(e.messages.treeDepth), 1),
875
- F(a("input", {
876
- "onUpdate:modelValue": r[18] || (r[18] = (n) => l(V).maxDepth = n),
877
- "aria-label": e.messages.treeDepth,
878
- type: "number",
879
- min: "1",
880
- max: "256",
881
- disabled: e.readonly
882
- }, null, 8, xa), [
883
- [
884
- q,
885
- l(V).maxDepth,
886
- void 0,
887
- { number: !0 }
888
- ]
889
- ])
890
- ])
891
- ])
892
- ]),
893
- a("p", Na, t(e.messages.treeReadonly), 1)
894
- ], 64)) : l(m) ? (s(), d(C, { key: 2 }, [
895
- a("p", Ra, t(e.messages.matrixHint), 1),
896
- (s(), d(C, null, x(["rowFields", "columnFields"], (n) => a("fieldset", {
897
- key: n,
898
- class: "mr-data-layout__choices"
899
- }, [
900
- a("legend", null, t(e.messages[n]), 1),
901
- (s(!0), d(C, null, x(l(U), (b) => (s(), d("label", {
902
- key: b.field
903
- }, [
904
- a("input", {
905
- type: "checkbox",
906
- checked: l(h)[n].includes(b.field),
907
- disabled: e.readonly,
908
- onChange: (o) => l(w).toggleDimension(
909
- n,
910
- b.field,
911
- o.target.checked
912
- )
913
- }, null, 40, Ea),
914
- k(t(b.label), 1)
915
- ]))), 128))
916
- ])), 64)),
917
- (s(!0), d(C, null, x(l(h).measures, (n, b) => (s(), d("div", {
918
- key: b,
919
- class: "mr-data-layout__measure"
920
- }, [
921
- a("div", Ka, [
922
- a("label", null, [
923
- k(t(e.messages.measure), 1),
924
- F(a("select", {
925
- "aria-label": e.messages.measure,
926
- "onUpdate:modelValue": (o) => n.field = o,
927
- disabled: e.readonly
928
- }, [
929
- (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
930
- key: o.field,
931
- value: o.field
932
- }, t(o.label), 9, La))), 128))
933
- ], 8, Ta), [
934
- [L, n.field]
935
- ])
936
- ]),
937
- a("label", null, [
938
- k(t(e.messages.aggregate), 1),
939
- F(a("select", {
940
- "aria-label": e.messages.aggregate,
941
- "onUpdate:modelValue": (o) => n.op = o,
942
- disabled: e.readonly
943
- }, [
944
- (s(!0), d(C, null, x(l(z).aggregates, (o) => (s(), d("option", {
945
- key: o,
946
- value: o
947
- }, t(e.messages[o]), 9, Oa))), 128))
948
- ], 8, Ba), [
949
- [L, n.op]
950
- ])
951
- ])
952
- ]),
953
- a("label", null, [
954
- k(t(e.messages.measureLabel), 1),
955
- F(a("input", {
956
- "aria-label": e.messages.measureLabel,
957
- "onUpdate:modelValue": (o) => n.label = o,
958
- disabled: e.readonly,
959
- placeholder: n.field
960
- }, null, 8, Aa), [
961
- [q, n.label]
962
- ])
963
- ]),
964
- n.op === "weightedAvg" ? (s(), d("label", Ia, [
965
- k(t(e.messages.weight), 1),
966
- F(a("select", {
967
- "aria-label": e.messages.weight,
968
- "onUpdate:modelValue": (o) => n.weightField = o,
969
- disabled: e.readonly
970
- }, [
971
- (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
972
- key: o.field,
973
- value: o.field
974
- }, t(o.label), 9, Ga))), 128))
975
- ], 8, Wa), [
976
- [L, n.weightField]
977
- ])
978
- ])) : E("", !0),
979
- a("div", Ja, [
980
- a("label", null, [
981
- k(t(e.messages.numeric), 1),
982
- F(a("select", {
983
- "aria-label": e.messages.numeric,
984
- "onUpdate:modelValue": (o) => n.numeric = o,
985
- disabled: e.readonly
986
- }, [
987
- a("option", ja, t(e.messages.number), 1),
988
- a("option", Pa, t(e.messages.decimal), 1)
989
- ], 8, Ha), [
990
- [L, n.numeric]
991
- ])
992
- ]),
993
- a("label", null, [
994
- k(t(e.messages.digits), 1),
995
- F(a("input", {
996
- "aria-label": e.messages.digits,
997
- "onUpdate:modelValue": (o) => n.digits = o,
998
- type: "number",
999
- min: "0",
1000
- max: "100",
1001
- disabled: e.readonly
1002
- }, null, 8, za), [
1003
- [
1004
- q,
1005
- n.digits,
1006
- void 0,
1007
- { number: !0 }
1008
- ]
1009
- ])
1010
- ])
1011
- ]),
1012
- a("button", {
1013
- type: "button",
1014
- disabled: e.readonly,
1015
- onClick: (o) => l(w).removeMeasure(b)
1016
- }, t(e.messages.remove), 9, qa)
1017
- ]))), 128)),
1018
- a("button", {
1019
- type: "button",
1020
- disabled: e.readonly || l(h).measures.length >= 32,
1021
- onClick: r[19] || (r[19] = //@ts-ignore
1022
- (...n) => l(w).addMeasure && l(w).addMeasure(...n))
1023
- }, " + " + t(e.messages.addAggregate), 9, Za),
1024
- a("label", Qa, [
1025
- F(a("input", {
1026
- "onUpdate:modelValue": r[20] || (r[20] = (n) => l(h).totals = n),
1027
- type: "checkbox",
1028
- disabled: e.readonly
1029
- }, null, 8, Xa), [
1030
- [de, l(h).totals]
1031
- ]),
1032
- k(t(e.messages.totals), 1)
1033
- ]),
1034
- a("details", null, [
1035
- a("summary", null, t(e.messages.matrixHierarchy), 1),
1036
- a("label", Ya, [
1037
- a("input", {
1038
- type: "checkbox",
1039
- checked: !!l(h).hierarchy,
1040
- disabled: e.readonly,
1041
- onChange: r[21] || (r[21] = (n) => l(w).toggleHierarchy(n.target.checked))
1042
- }, null, 40, pa),
1043
- k(t(e.messages.enabled), 1)
1044
- ]),
1045
- l(h).hierarchy ? (s(), d(C, { key: 0 }, [
1046
- a("p", _a, t(e.messages.matrixHierarchyHint), 1),
1047
- a("label", null, [
1048
- k(t(e.messages.matrixEmptyLabel), 1),
1049
- F(a("input", {
1050
- "onUpdate:modelValue": r[22] || (r[22] = (n) => l(h).hierarchy.emptyLabel = n),
1051
- "aria-label": e.messages.matrixEmptyLabel,
1052
- disabled: e.readonly,
1053
- placeholder: "(空)"
1054
- }, null, 8, et), [
1055
- [q, l(h).hierarchy.emptyLabel]
1056
- ])
1057
- ]),
1058
- (s(), d(C, null, x(["row", "column"], (n) => a("fieldset", {
1059
- key: n,
1060
- class: "mr-data-layout__choices"
1061
- }, [
1062
- a("legend", null, t(n === "row" ? e.messages.rowFields : e.messages.columnFields), 1),
1063
- (s(!0), d(C, null, x(l(h)[n === "row" ? "rowFields" : "columnFields"], (b, o) => (s(), d("div", {
1064
- key: b,
1065
- class: "mr-data-layout__pair"
1066
- }, [
1067
- a("label", null, [
1068
- k(t(b), 1),
1069
- a("select", {
1070
- "aria-label": `${b} · ${e.messages.matrixSort}`,
1071
- value: l(h).hierarchy[n]?.sort?.[o] ?? "source",
1072
- disabled: e.readonly,
1073
- onChange: (f) => l(w).setDimensionSort(n, o, f.target.value)
1074
- }, [
1075
- a("option", at, t(e.messages.matrixSourceOrder), 1),
1076
- a("option", tt, t(e.messages.matrixAscending), 1),
1077
- a("option", nt, t(e.messages.matrixDescending), 1)
1078
- ], 40, lt)
1079
- ]),
1080
- a("div", null, [
1081
- a("button", {
1082
- type: "button",
1083
- "aria-label": `${b} · ${e.messages.moveUp}`,
1084
- disabled: e.readonly || o === 0,
1085
- onClick: (f) => l(w).moveDimension(n === "row" ? "rowFields" : "columnFields", o, -1)
1086
- }, "↑", 8, it),
1087
- a("button", {
1088
- type: "button",
1089
- "aria-label": `${b} · ${e.messages.moveDown}`,
1090
- disabled: e.readonly || o === l(h)[n === "row" ? "rowFields" : "columnFields"].length - 1,
1091
- onClick: (f) => l(w).moveDimension(n === "row" ? "rowFields" : "columnFields", o, 1)
1092
- }, "↓", 8, st)
1093
- ]),
1094
- o < l(h)[n === "row" ? "rowFields" : "columnFields"].length - 1 ? (s(), d("label", dt, [
1095
- a("input", {
1096
- type: "checkbox",
1097
- checked: l(h).hierarchy[n]?.subtotals?.includes(o + 1) ?? !1,
1098
- disabled: e.readonly,
1099
- onChange: (f) => l(w).toggleMatrixSubtotal(n, o + 1, f.target.checked)
1100
- }, null, 40, ot),
1101
- k(t(e.messages.matrixPrefixSubtotal), 1)
1102
- ])) : E("", !0)
1103
- ]))), 128))
1104
- ])), 64))
1105
- ], 64)) : E("", !0)
1106
- ]),
1107
- a("details", null, [
1108
- a("summary", null, t(e.messages.widthSettings), 1),
1109
- a("div", ut, [
1110
- a("label", null, [
1111
- k(t(e.messages.dimensionWidth), 1),
1112
- F(a("input", {
1113
- "onUpdate:modelValue": r[23] || (r[23] = (n) => l(h).rowWidthMm = n),
1114
- type: "number",
1115
- min: "1",
1116
- disabled: e.readonly,
1117
- placeholder: "40"
1118
- }, null, 8, rt), [
1119
- [
1120
- q,
1121
- l(h).rowWidthMm,
1122
- void 0,
1123
- { number: !0 }
1124
- ]
1125
- ])
1126
- ]),
1127
- a("label", null, [
1128
- k(t(e.messages.measureWidth), 1),
1129
- F(a("input", {
1130
- "onUpdate:modelValue": r[24] || (r[24] = (n) => l(h).columnWidthMm = n),
1131
- type: "number",
1132
- min: "1",
1133
- disabled: e.readonly,
1134
- placeholder: "28"
1135
- }, null, 8, ct), [
1136
- [
1137
- q,
1138
- l(h).columnWidthMm,
1139
- void 0,
1140
- { number: !0 }
1141
- ]
1142
- ])
1143
- ])
1144
- ])
1145
- ])
1146
- ], 64)) : E("", !0),
1147
- a("div", mt, [
1148
- l(m) && e.mode === "matrix" ? (s(), d("button", {
1149
- key: 0,
1150
- type: "button",
1151
- disabled: e.readonly,
1152
- onClick: r[25] || (r[25] = //@ts-ignore
1153
- (...n) => l(w).checkMatrix && l(w).checkMatrix(...n))
1154
- }, t(e.messages.check), 9, vt)) : E("", !0),
1155
- l(m) && e.mode === "tree" ? (s(), d("button", {
1156
- key: 1,
1157
- type: "button",
1158
- disabled: e.readonly,
1159
- onClick: r[26] || (r[26] = //@ts-ignore
1160
- (...n) => l(w).checkTree && l(w).checkTree(...n))
1161
- }, t(e.messages.check), 9, bt)) : E("", !0),
1162
- a("button", {
1163
- type: "button",
1164
- class: "mr-data-layout__primary",
1165
- disabled: e.readonly,
1166
- onClick: r[27] || (r[27] = //@ts-ignore
1167
- (...n) => l(w).apply && l(w).apply(...n))
1168
- }, t(e.messages.apply), 9, gt)
1169
- ]),
1170
- l(W) ? (s(), d("div", yt, [
1171
- a("p", null, t(e.messages.sample), 1),
1172
- a("table", null, [
1173
- a("thead", null, [
1174
- a("tr", null, [
1175
- (s(!0), d(C, null, x(l(W).columns, (n, b) => (s(), d("th", { key: b }, t(n), 1))), 128))
1176
- ])
1177
- ]),
1178
- a("tbody", null, [
1179
- (s(!0), d(C, null, x(l(W).rows, (n, b) => (s(), d("tr", { key: b }, [
1180
- (s(!0), d(C, null, x(n, (o, f) => (s(), d("td", { key: f }, t(o ?? "—"), 1))), 128))
1181
- ]))), 128))
1182
- ])
1183
- ])
1184
- ])) : E("", !0),
1185
- l(M) ? (s(), d("p", ft, t(l(M)), 1)) : E("", !0)
1186
- ]));
1187
- }
1188
- }), kt = /* @__PURE__ */ me(ht, [["__scopeId", "data-v-c42e721c"]]), $t = { class: "mr-expression__row" }, Vt = ["value", "disabled", "aria-label"], wt = { value: "field" }, Ct = { value: "constant" }, Ut = {
1189
- key: 0,
1190
- value: "operation"
1191
- }, Ft = { value: "aggregate" }, St = ["value", "disabled", "aria-label"], Mt = ["value"], Dt = ["value", "disabled", "aria-label"], xt = ["value"], Nt = ["value", "disabled", "aria-label"], Rt = ["value"], Et = ["value", "disabled", "aria-label"], Kt = { value: "text" }, Tt = { value: "number" }, Lt = { value: "boolean" }, Bt = { value: "null" }, Ot = ["value", "disabled", "aria-label"], At = {
1192
- key: 0,
1193
- value: ""
1194
- }, It = ["value"], Wt = ["value", "disabled", "aria-label"], Gt = {
1195
- value: "",
1196
- disabled: ""
1197
- }, Jt = ["value"], Ht = ["value", "disabled", "aria-label"], jt = { value: "true" }, Pt = { value: "false" }, zt = ["type", "value", "disabled", "aria-label"], qt = { class: "mr-expression__help" }, Zt = ["disabled", "aria-label", "onClick"], Qt = ["disabled"], Xt = /* @__PURE__ */ ce({
1198
- __name: "ReportExpressionEditor",
1199
- props: {
1200
- modelValue: {},
1201
- fields: {},
1202
- messages: {},
1203
- readonly: { type: Boolean },
1204
- depth: {}
1205
- },
1206
- emits: ["update:modelValue"],
1207
- setup(e, { emit: A }) {
1208
- const $ = e, J = A, w = be(), m = j(() => "op" in $.modelValue ? w.functions.find((r) => r.name === $.modelValue.op) : void 0), i = j(
1209
- () => "aggregate" in $.modelValue ? "aggregate" : "field" in $.modelValue ? "field" : "value" in $.modelValue ? "constant" : "operation"
1210
- ), h = G("text");
1211
- ne(
1212
- () => $.modelValue,
1213
- (r) => {
1214
- "value" in r && (h.value = r.value === null ? "null" : typeof r.value == "string" ? "text" : typeof r.value);
1215
- },
1216
- { immediate: !0 }
1217
- );
1218
- function V(r) {
1219
- $.readonly || J("update:modelValue", r);
1220
- }
1221
- function S(r) {
1222
- V(r === "aggregate" ? { aggregate: "sum", field: $.fields[0]?.field ?? "" } : r === "field" ? { field: $.fields[0]?.field ?? "" } : r === "constant" ? { value: "" } : {
1223
- op: "add",
1224
- args: [{ field: $.fields[0]?.field ?? "" }, { value: 0 }]
1225
- });
1226
- }
1227
- function U(r) {
1228
- const n = r, b = "args" in $.modelValue ? $.modelValue.args : [{ value: 0 }, { value: 0 }], o = w.functions.find((O) => O.name === n), f = [...b.slice(0, o.maxArgs)];
1229
- for (; f.length < o.minArgs; ) f.push({ value: 0 });
1230
- V({ op: n, args: f, ...n === "if" ? { condition: "args" in $.modelValue && $.modelValue.condition ? $.modelValue.condition : { field: $.fields[0]?.field ?? "", op: ">", value: 0 } } : {} });
1231
- }
1232
- function T(r, n) {
1233
- "args" in $.modelValue && V({
1234
- ...$.modelValue,
1235
- args: $.modelValue.args.map(
1236
- (b, o) => o === r ? n : b
1237
- )
1238
- });
1239
- }
1240
- function M(r) {
1241
- if (!("args" in $.modelValue)) return;
1242
- const n = r === void 0 ? [...$.modelValue.args, { value: 0 }] : $.modelValue.args.filter((b, o) => o !== r);
1243
- V({ ...$.modelValue, args: n });
1244
- }
1245
- function W(r) {
1246
- h.value = r, V({
1247
- value: r === "null" ? null : r === "boolean" ? !1 : r === "number" ? 0 : ""
1248
- });
1249
- }
1250
- function z(r) {
1251
- h.value === "number" ? r.trim() && Number.isFinite(Number(r)) && V({ value: Number(r) }) : V({ value: r });
1252
- }
1253
- function I(r, n) {
1254
- if (!("aggregate" in $.modelValue)) return;
1255
- const b = { ...$.modelValue, [r]: n };
1256
- r === "aggregate" && (b.aggregate = n), r === "field" && !n && delete b.field, V(b);
1257
- }
1258
- return (r, n) => {
1259
- const b = ye("ReportExpressionEditor", !0);
1260
- return s(), d("div", {
1261
- class: ve(["mr-expression", { "mr-expression--nested": (e.depth ?? 0) > 0 }])
1262
- }, [
1263
- a("div", $t, [
1264
- a("select", {
1265
- value: i.value,
1266
- disabled: e.readonly,
1267
- "aria-label": e.messages.argument,
1268
- onChange: n[0] || (n[0] = (o) => S(o.target.value))
1269
- }, [
1270
- a("option", wt, t(e.messages.field), 1),
1271
- a("option", Ct, t(e.messages.constant), 1),
1272
- (e.depth ?? 0) < 12 ? (s(), d("option", Ut, t(e.messages.operation), 1)) : E("", !0),
1273
- a("option", Ft, t(e.messages.aggregate), 1)
1274
- ], 40, Vt),
1275
- "field" in e.modelValue && !("aggregate" in e.modelValue) ? (s(), d("select", {
1276
- key: 0,
1277
- value: e.modelValue.field,
1278
- disabled: e.readonly,
1279
- "aria-label": e.messages.field,
1280
- onChange: n[1] || (n[1] = (o) => V({ field: o.target.value }))
1281
- }, [
1282
- (s(!0), d(C, null, x(e.fields, (o) => (s(), d("option", {
1283
- key: o.field,
1284
- value: o.field
1285
- }, t(o.label), 9, Mt))), 128))
1286
- ], 40, St)) : "op" in e.modelValue ? (s(), d("select", {
1287
- key: 1,
1288
- value: e.modelValue.op,
1289
- disabled: e.readonly,
1290
- "aria-label": e.messages.operation,
1291
- onChange: n[2] || (n[2] = (o) => U(o.target.value))
1292
- }, [
1293
- (s(!0), d(C, null, x(l(w).operations, (o) => (s(), d("option", {
1294
- key: o,
1295
- value: o
1296
- }, t(e.messages[o]), 9, xt))), 128))
1297
- ], 40, Dt)) : "aggregate" in e.modelValue ? (s(), d("select", {
1298
- key: 2,
1299
- value: e.modelValue.aggregate,
1300
- disabled: e.readonly,
1301
- "aria-label": e.messages.aggregate,
1302
- onChange: n[3] || (n[3] = (o) => I("aggregate", o.target.value))
1303
- }, [
1304
- (s(!0), d(C, null, x(l(w).aggregates, (o) => (s(), d("option", {
1305
- key: o,
1306
- value: o
1307
- }, t(e.messages[o]), 9, Rt))), 128))
1308
- ], 40, Nt)) : (s(), d("select", {
1309
- key: 3,
1310
- value: h.value,
1311
- disabled: e.readonly,
1312
- "aria-label": e.messages.resultType,
1313
- onChange: n[4] || (n[4] = (o) => W(o.target.value))
1314
- }, [
1315
- a("option", Kt, t(e.messages.text), 1),
1316
- a("option", Tt, t(e.messages.number), 1),
1317
- a("option", Lt, t(e.messages.boolean), 1),
1318
- a("option", Bt, t(e.messages.null), 1)
1319
- ], 40, Et))
1320
- ]),
1321
- "aggregate" in e.modelValue ? (s(), d(C, { key: 0 }, [
1322
- a("select", {
1323
- value: e.modelValue.field ?? "",
1324
- disabled: e.readonly,
1325
- "aria-label": e.messages.measure,
1326
- onChange: n[5] || (n[5] = (o) => I("field", o.target.value))
1327
- }, [
1328
- e.modelValue.aggregate === "count" ? (s(), d("option", At, t(e.messages.allRows), 1)) : E("", !0),
1329
- (s(!0), d(C, null, x(e.fields, (o) => (s(), d("option", {
1330
- key: o.field,
1331
- value: o.field
1332
- }, t(o.label), 9, It))), 128))
1333
- ], 40, Ot),
1334
- e.modelValue.aggregate === "weightedAvg" ? (s(), d("select", {
1335
- key: 0,
1336
- value: e.modelValue.weightField ?? "",
1337
- disabled: e.readonly,
1338
- "aria-label": e.messages.weight,
1339
- onChange: n[6] || (n[6] = (o) => I(
1340
- "weightField",
1341
- o.target.value
1342
- ))
1343
- }, [
1344
- a("option", Gt, t(e.messages.weight), 1),
1345
- (s(!0), d(C, null, x(e.fields, (o) => (s(), d("option", {
1346
- key: o.field,
1347
- value: o.field
1348
- }, t(o.label), 9, Jt))), 128))
1349
- ], 40, Wt)) : E("", !0)
1350
- ], 64)) : "value" in e.modelValue ? (s(), d(C, { key: 1 }, [
1351
- h.value === "boolean" ? (s(), d("select", {
1352
- key: 0,
1353
- value: String(e.modelValue.value),
1354
- disabled: e.readonly,
1355
- "aria-label": e.messages.constant,
1356
- onChange: n[7] || (n[7] = (o) => V({
1357
- value: o.target.value === "true"
1358
- }))
1359
- }, [
1360
- a("option", jt, t(e.messages.true), 1),
1361
- a("option", Pt, t(e.messages.false), 1)
1362
- ], 40, Ht)) : h.value !== "null" ? (s(), d("input", {
1363
- key: 1,
1364
- type: h.value === "number" ? "number" : "text",
1365
- value: e.modelValue.value ?? "",
1366
- disabled: e.readonly,
1367
- "aria-label": e.messages.constant,
1368
- onInput: n[8] || (n[8] = (o) => z(o.target.value))
1369
- }, null, 40, zt)) : E("", !0)
1370
- ], 64)) : "args" in e.modelValue ? (s(), d(C, { key: 2 }, [
1371
- e.modelValue.op === "if" && e.modelValue.condition ? (s(), fe(we, {
1372
- key: 0,
1373
- "model-value": e.modelValue.condition,
1374
- fields: e.fields,
1375
- messages: e.messages,
1376
- readonly: e.readonly,
1377
- "onUpdate:modelValue": n[9] || (n[9] = (o) => V({ ...e.modelValue, condition: o }))
1378
- }, null, 8, ["model-value", "fields", "messages", "readonly"])) : E("", !0),
1379
- a("small", qt, t(m.value?.example), 1),
1380
- (s(!0), d(C, null, x(e.modelValue.args, (o, f) => (s(), d("div", {
1381
- key: f,
1382
- class: "mr-expression__argument"
1383
- }, [
1384
- re(b, {
1385
- "model-value": o,
1386
- fields: e.fields,
1387
- messages: e.messages,
1388
- readonly: e.readonly,
1389
- depth: (e.depth ?? 0) + 1,
1390
- "onUpdate:modelValue": (O) => T(f, O)
1391
- }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
1392
- e.modelValue.args.length > (m.value?.minArgs ?? 2) ? (s(), d("button", {
1393
- key: 0,
1394
- type: "button",
1395
- disabled: e.readonly,
1396
- "aria-label": `${e.messages.remove} ${e.messages.argument} ${f + 1}`,
1397
- onClick: (O) => M(f)
1398
- }, " × ", 8, Zt)) : E("", !0)
1399
- ]))), 128)),
1400
- e.modelValue.args.length < Math.min(16, m.value?.maxArgs ?? 16) ? (s(), d("button", {
1401
- key: 1,
1402
- type: "button",
1403
- disabled: e.readonly,
1404
- onClick: n[10] || (n[10] = (o) => M())
1405
- }, " + " + t(e.messages.addArgument), 9, Qt)) : E("", !0)
1406
- ], 64)) : E("", !0)
1407
- ], 2);
1408
- };
1409
- }
1410
- }), Yt = /* @__PURE__ */ me(Xt, [["__scopeId", "data-v-bfaf6bd5"]]), P = (e) => JSON.parse(JSON.stringify(e));
1411
- function pt(e, A) {
1412
- const $ = j(() => ({
1413
- ...Be,
1414
- ...e.messages
1415
- })), J = G("computations"), w = G(""), m = G(""), i = G({
1416
- field: "",
1417
- expression: { field: "" },
1418
- scope: "row"
1419
- }), h = G([]), V = G(0), S = G(""), U = G(-1), T = G("style"), M = G({ field: "", op: ">", value: 0 }), W = G(null), z = j(() => W.value ?? M.value), I = G({
1420
- color: "#b91c1c",
1421
- backgroundColor: "#fff1f2",
1422
- bold: !1
1423
- }), r = G([]), n = ue(() => i.value), b = ue(() => h.value), o = ue(() => ({ when: M.value, composedWhen: W.value, style: I.value })), f = G(/* @__PURE__ */ new Map()), O = G(/* @__PURE__ */ new Map());
1424
- let Z = "", X = !1;
1425
- const ee = j(() => n.pending.value || b.pending.value || o.pending.value || f.value.size > 0 || O.value.size > 0);
1426
- let _;
1427
- const Y = j(() => {
1428
- const g = /* @__PURE__ */ new Map();
1429
- for (const y of e.datasetSchema?.fields ?? [])
1430
- g.set(y.field, y.label ?? y.field);
1431
- for (const y of e.list.columns)
1432
- g.has(y.field) || g.set(y.field, y.header || y.field);
1433
- for (const y of Object.keys(
1434
- e.datasets?.[e.list.dataset]?.[0] ?? {}
1435
- ))
1436
- g.has(y) || g.set(y, y);
1437
- return [...g].map(([y, K]) => ({ field: y, label: K }));
1438
- }), le = j(() => h.value[V.value]), p = j(
1439
- () => e.list.columns.find((g) => g.field === S.value)
1440
- ), ie = j(() => Te(D()));
1441
- function ae() {
1442
- if (_ === JSON.stringify(e.list)) {
1443
- _ = void 0;
1444
- return;
1445
- }
1446
- X = !0, f.value = /* @__PURE__ */ new Map(), O.value = /* @__PURE__ */ new Map(), h.value = P(
1447
- e.list.groups ?? (e.list.groupBy ? [e.list.groupBy] : [])
1448
- );
1449
- for (const g of h.value) for (const y of g.aggregates ?? []) y.numeric ??= "number";
1450
- e.list.columns.some((g) => g.field === S.value) || (S.value = e.list.columns[0]?.field ?? ""), w.value = "", r.value = [], v(m.value), ge(-1), b.accept(), X = !1;
1451
- }
1452
- ne(() => e.list, ae, { immediate: !0 }), ne(i, () => {
1453
- r.value = [];
1454
- }, { deep: !0 }), ne(() => e.datasets, () => {
1455
- r.value = [];
1456
- }, { deep: !0 });
1457
- function v(g) {
1458
- !X && n.pending.value && (f.value = new Map(f.value).set(m.value, P(i.value))), m.value = g, i.value = P(
1459
- e.list.computed?.find((K) => K.field === g) ?? {
1460
- field: "",
1461
- expression: { field: Y.value[0]?.field ?? "" },
1462
- scope: "row"
1463
- }
1464
- ), i.value.numeric ??= "number", r.value = [], w.value = "", n.accept();
1465
- const y = f.value.get(g);
1466
- if (y) {
1467
- i.value = P(y);
1468
- const K = new Map(f.value);
1469
- K.delete(g), f.value = K;
1470
- }
1471
- }
1472
- function D() {
1473
- return [
1474
- ...(e.list.computed ?? []).filter((y) => y.field !== m.value),
1475
- P(i.value)
1476
- ];
1477
- }
1478
- function R(g) {
1479
- if (e.readonly) return !1;
1480
- const y = ke({
1481
- pages: [
1482
- {
1483
- widthMm: Math.max(1, g.leftMm + g.widthMm),
1484
- heightMm: 297,
1485
- components: [g]
1486
- }
1487
- ]
1488
- });
1489
- return y.ok ? (w.value = "", _ = JSON.stringify(g), A(g), !0) : (w.value = y.errors.map((K) => K.message).slice(0, 3).join(";"), !1);
1490
- }
1491
- function N() {
1492
- if (!i.value.field.trim()) {
1493
- w.value = $.value.missingTarget;
1494
- return;
1495
- }
1496
- const g = P(e.list);
1497
- if (g.computed = D(), g.columns.some((y) => y.field === i.value.field) || g.columns.push({
1498
- field: i.value.field,
1499
- header: i.value.field,
1500
- widthMm: 30,
1501
- semanticRole: "measure",
1502
- align: "right",
1503
- editable: !1,
1504
- format: {
1505
- kind: "number",
1506
- ...i.value.digits === void 0 ? {} : { digits: i.value.digits }
1507
- }
1508
- }), R(g)) {
1509
- const y = new Map(f.value);
1510
- y.delete(m.value), y.delete(i.value.field), f.value = y, m.value = i.value.field, n.accept();
1511
- }
1512
- }
1513
- function c() {
1514
- if (!m.value) return;
1515
- const g = P(e.list);
1516
- if (g.computed = (g.computed ?? []).filter(
1517
- (y) => y.field !== m.value
1518
- ), R(g)) {
1519
- const y = new Map(f.value);
1520
- y.delete(m.value), f.value = y, n.accept(), v("");
1521
- }
1522
- }
1523
- function u() {
1524
- r.value = [], w.value = "";
1525
- const g = e.datasets?.[e.list.dataset];
1526
- if (!g?.length) {
1527
- w.value = $.value.noData;
1528
- return;
1529
- }
1530
- try {
1531
- const y = Le(g.slice(0, 1e3), {
1532
- fields: D(),
1533
- maxRows: 1e3,
1534
- maxCells: 2e6
1535
- });
1536
- r.value = y.rows.slice(0, 5).map((K, Q) => ({
1537
- row: Q + 1,
1538
- value: K[i.value.field]
1539
- }));
1540
- } catch (y) {
1541
- w.value = y instanceof Error ? y.message : String(y);
1542
- }
1543
- }
1544
- function H(g) {
1545
- i.value.expression = g;
1546
- }
1547
- function B(g, y) {
1548
- i.value.groupBy = y ? [...i.value.groupBy ?? [], g] : (i.value.groupBy ?? []).filter((K) => K !== g);
1549
- }
1550
- function Ce() {
1551
- h.value.push({
1552
- field: Y.value[0]?.field ?? "",
1553
- headerTemplate: "{value}",
1554
- subtotalLabel: $.value.subtotalLabel,
1555
- aggregates: [],
1556
- keepWithNext: !0
1557
- }), V.value = h.value.length - 1;
1558
- }
1559
- function Ue(g) {
1560
- const y = V.value, K = y + g;
1561
- K < 0 || K >= h.value.length || ([h.value[y], h.value[K]] = [
1562
- h.value[K],
1563
- h.value[y]
1564
- ], V.value = K);
1565
- }
1566
- function Fe() {
1567
- h.value.splice(V.value, 1), V.value = Math.max(
1568
- 0,
1569
- Math.min(V.value, h.value.length - 1)
1570
- );
1571
- }
1572
- function Se() {
1573
- le.value && (le.value.aggregates ??= []).push({
1574
- field: Y.value[0]?.field ?? "",
1575
- op: "sum",
1576
- numeric: "number"
1577
- });
1578
- }
1579
- function Me() {
1580
- const g = P(e.list);
1581
- g.groups = P(h.value), delete g.groupBy, R(g) && b.accept();
1582
- }
1583
- function De(g) {
1584
- W.value = g && !("field" in g) ? P(g) : null, M.value = P(g && "field" in g ? g : { field: S.value, op: ">", value: 0 });
1585
- }
1586
- function ge(g) {
1587
- !X && o.pending.value && (O.value = new Map(O.value).set(Z, { when: P(M.value), composedWhen: P(W.value), style: { ...I.value } })), Z = `${S.value}|${T.value}|${g}`, U.value = g;
1588
- const y = T.value === "cell" ? p.value?.visibleWhen : T.value === "rowVisibility" ? e.list.rowVisibleWhen : p.value?.rules?.[g]?.when;
1589
- De(y);
1590
- const K = p.value?.rules?.[g]?.style;
1591
- I.value = {
1592
- color: String(K?.color ?? "#b91c1c"),
1593
- backgroundColor: String(K?.backgroundColor ?? "#fff1f2"),
1594
- bold: K?.bold === !0
1595
- }, o.accept();
1596
- const Q = O.value.get(Z);
1597
- if (Q) {
1598
- M.value = P(Q.when), W.value = P(Q.composedWhen), I.value = { ...Q.style };
1599
- const se = new Map(O.value);
1600
- se.delete(Z), O.value = se;
1601
- }
1602
- }
1603
- function xe(g) {
1604
- const y = e.datasetSchema?.fields.find(
1605
- (se) => se.field === M.value.field
1606
- ), K = e.datasets?.[e.list.dataset]?.find(
1607
- (se) => se[M.value.field] != null
1608
- )?.[M.value.field], Q = y?.type === "number" || !y && typeof K == "number";
1609
- y?.type === "decimal" ? M.value.numeric = "decimal" : Q ? M.value.numeric = "number" : delete M.value.numeric, M.value.value = Q && g.trim() && Number.isFinite(Number(g)) ? Number(g) : g;
1610
- }
1611
- function Ne(g = !1) {
1612
- const y = P(e.list), K = y.columns.find((Q) => Q.field === S.value);
1613
- if (!K) {
1614
- w.value = $.value.noSelection;
1615
- return;
1616
- }
1617
- if (T.value === "rowVisibility")
1618
- g ? delete y.rowVisibleWhen : y.rowVisibleWhen = P(z.value);
1619
- else if (T.value === "cell")
1620
- g ? delete K.visibleWhen : K.visibleWhen = P(z.value);
1621
- else if (K.rules ??= [], g && U.value >= 0)
1622
- K.rules.splice(U.value, 1);
1623
- else {
1624
- if (g) return;
1625
- U.value < 0 ? K.rules.push({
1626
- when: P(z.value),
1627
- style: { ...I.value }
1628
- }) : K.rules[U.value] = {
1629
- when: P(z.value),
1630
- style: { ...I.value }
1631
- };
1632
- }
1633
- if (R(y)) {
1634
- const Q = new Map(O.value);
1635
- Q.delete(Z), O.value = Q, o.accept();
1636
- }
1637
- }
1638
- he({ key: () => e.recoveryKey ?? "rules:0:0", baseline: () => JSON.stringify(e.list), pending: () => ee.value, reset: () => {
1639
- _ = void 0, ae();
1640
- }, snapshot: () => JSON.stringify(Re()), restore(g) {
1641
- const y = JSON.parse(g);
1642
- i.value = y.formula, h.value = y.groups, M.value = y.when, W.value = y.composedWhen, I.value = y.style, m.value = y.selectedComputed, S.value = y.column, U.value = y.conditionIndex, Z = y.conditionKey, T.value = y.effect, J.value = y.tab, f.value = new Map(y.computedDrafts), O.value = new Map(y.conditionDrafts), n.baseline.value = y.formulaBaseline, b.baseline.value = y.groupBaseline, o.baseline.value = y.conditionBaseline;
1643
- } });
1644
- function Re() {
1645
- return { formula: i.value, groups: h.value, when: M.value, composedWhen: W.value, style: I.value, selectedComputed: m.value, column: S.value, conditionIndex: U.value, conditionKey: Z, effect: T.value, tab: J.value, computedDrafts: [...f.value], conditionDrafts: [...O.value], formulaBaseline: n.baseline.value, groupBaseline: b.baseline.value, conditionBaseline: o.baseline.value };
1646
- }
1647
- return {
1648
- m: $,
1649
- pendingLocalChanges: ee,
1650
- draftSnapshot: () => JSON.stringify({ formula: i.value, groups: h.value, when: M.value, composedWhen: W.value, style: I.value, computedDrafts: [...f.value], conditionDrafts: [...O.value] }),
1651
- tab: J,
1652
- fields: Y,
1653
- formula: i,
1654
- groups: h,
1655
- groupIndex: V,
1656
- currentGroup: le,
1657
- column: S,
1658
- currentColumn: p,
1659
- conditionIndex: U,
1660
- effect: T,
1661
- when: M,
1662
- condition: z,
1663
- setCondition(g) {
1664
- "field" in g ? (M.value = g, W.value = null) : W.value = g;
1665
- },
1666
- style: I,
1667
- error: w,
1668
- preview: r,
1669
- diagnostics: ie,
1670
- selectedComputed: m,
1671
- loadComputed: v,
1672
- applyComputed: N,
1673
- removeComputed: c,
1674
- check: u,
1675
- setExpression: H,
1676
- toggleGroupField: B,
1677
- addGroup: Ce,
1678
- moveGroup: Ue,
1679
- removeGroup: Fe,
1680
- addAggregate: Se,
1681
- applyGroups: Me,
1682
- loadCondition: ge,
1683
- setThreshold: xe,
1684
- applyCondition: Ne,
1685
- applyLayout: R,
1686
- resetDraft: () => {
1687
- _ = void 0, ae();
1688
- }
1689
- };
1690
- }
1691
- const _t = ["aria-label"], en = { class: "mr-rule-editor__directory" }, ln = ["aria-label"], an = ["aria-selected", "onClick"], tn = { key: 0 }, nn = { key: 1 }, sn = { class: "mr-rule-editor__catalog" }, dn = ["disabled"], on = ["aria-label"], un = { class: "mr-rule-editor__field-list" }, rn = ["disabled", "title", "onClick"], cn = { key: 1 }, mn = {
1692
- key: 0,
1693
- class: "mr-rule-editor__panel"
1694
- }, vn = ["aria-label", "value", "disabled"], bn = { value: "" }, gn = ["value"], yn = ["aria-label", "disabled"], fn = { class: "mr-rule-editor__pair" }, hn = ["aria-label", "disabled"], kn = ["value"], $n = ["aria-label", "disabled"], Vn = { value: "number" }, wn = { value: "decimal" }, Cn = {
1695
- key: 0,
1696
- class: "mr-rule-editor__checks"
1697
- }, Un = ["checked", "disabled", "onChange"], Fn = {
1698
- key: 2,
1699
- class: "mr-rule-editor__hint"
1700
- }, Sn = { class: "mr-rule-editor__advanced" }, Mn = ["aria-label", "disabled"], Dn = ["aria-label", "disabled"], xn = { value: "propagate" }, Nn = { value: "error" }, Rn = ["aria-label", "disabled"], En = { value: "error" }, Kn = { value: "null" }, Tn = {
1701
- key: 3,
1702
- class: "mr-rule-editor__hint"
1703
- }, Ln = {
1704
- key: 4,
1705
- class: "mr-rule-editor__diagnostic"
1706
- }, Bn = { class: "mr-rule-editor__actions" }, On = ["disabled"], An = ["disabled"], In = ["disabled"], Wn = {
1707
- key: 5,
1708
- class: "mr-rule-editor__error"
1709
- }, Gn = {
1710
- key: 1,
1711
- class: "mr-rule-editor__panel"
1712
- }, Jn = { class: "mr-rule-editor__pair" }, Hn = ["aria-label"], jn = ["value"], Pn = {
1713
- key: 0,
1714
- value: 0
1715
- }, zn = ["disabled"], qn = ["aria-label", "disabled"], Zn = ["value"], Qn = { class: "mr-rule-editor__pair" }, Xn = ["aria-label", "disabled"], Yn = ["aria-label", "disabled"], pn = { class: "mr-rule-editor__checks" }, _n = ["disabled"], ei = ["disabled"], li = { class: "mr-rule-editor__pair" }, ai = ["aria-label", "onUpdate:modelValue", "disabled"], ti = ["value"], ni = ["aria-label", "onUpdate:modelValue", "disabled"], ii = ["value"], si = ["aria-label", "onUpdate:modelValue", "disabled"], di = { value: void 0 }, oi = ["value"], ui = { key: 0 }, ri = ["aria-label", "onUpdate:modelValue", "disabled"], ci = ["value"], mi = { class: "mr-rule-editor__pair" }, vi = ["onUpdate:modelValue", "disabled", "aria-label"], bi = { value: "number" }, gi = { value: "decimal" }, yi = ["disabled", "onClick"], fi = ["disabled"], hi = { class: "mr-rule-editor__actions" }, ki = ["disabled", "aria-label"], $i = ["disabled", "aria-label"], Vi = ["disabled"], wi = ["disabled"], Ci = {
1716
- key: 2,
1717
- class: "mr-rule-editor__panel"
1718
- }, Ui = ["aria-label", "disabled"], Fi = ["value"], Si = ["aria-label", "disabled"], Mi = { value: "style" }, Di = { value: "cell" }, xi = { value: "rowVisibility" }, Ni = { key: 0 }, Ri = ["aria-label", "value", "disabled"], Ei = { value: -1 }, Ki = ["value"], Ti = { class: "mr-rule-editor__pair" }, Li = ["disabled"], Bi = ["disabled"], Oi = { class: "mr-rule-editor__check" }, Ai = ["disabled"], Ii = { class: "mr-rule-editor__actions" }, Wi = ["disabled"], Gi = ["disabled"], Ji = { class: "mr-rule-editor__explanation" }, Hi = { key: 0 }, ji = { class: "mr-rule-editor__results" }, Pi = { key: 0 }, zi = { key: 1 }, qi = {
1719
- key: 1,
1720
- class: "mr-rule-editor__error",
1721
- role: "alert"
1722
- }, Zi = /* @__PURE__ */ ce({
1723
- __name: "RuleEditor",
1724
- props: {
1725
- recoveryKey: {},
1726
- list: {},
1727
- datasets: {},
1728
- datasetSchema: {},
1729
- datasetSchemas: {},
1730
- readonly: { type: Boolean },
1731
- messages: {}
1732
- },
1733
- emits: ["change", "dirty"],
1734
- setup(e, { expose: A, emit: $ }) {
1735
- const J = e, w = $, m = pt(J, (N) => w("change", N)), {
1736
- m: i,
1737
- tab: h,
1738
- fields: V,
1739
- formula: S,
1740
- groups: U,
1741
- groupIndex: T,
1742
- currentGroup: M,
1743
- column: W,
1744
- currentColumn: z,
1745
- conditionIndex: I,
1746
- effect: r,
1747
- condition: n,
1748
- style: b,
1749
- error: o,
1750
- preview: f,
1751
- diagnostics: O,
1752
- selectedComputed: Z
1753
- } = m, X = G({}), ee = G(0);
1754
- function _() {
1755
- m.resetDraft(), X.value = {}, ee.value++;
1756
- }
1757
- const Y = j(() => m.pendingLocalChanges.value || Object.values(X.value).some(Boolean));
1758
- ne([Y, m.draftSnapshot, X], () => w("dirty", Y.value), { immediate: !0, deep: !0, flush: "sync" }), A({ get pendingLocalChanges() {
1759
- return Y.value;
1760
- } });
1761
- const le = Ie(J, m.formula, i), { query: p, matches: ie, fieldWindow: ae, expression: v, sources: D } = le, R = be();
1762
- return (N, c) => (s(), d("section", {
1763
- class: "mr-rule-editor",
1764
- "aria-label": l(i).settings
1765
- }, [
1766
- a("aside", en, [
1767
- a("div", {
1768
- class: "mr-rule-editor__tabs",
1769
- role: "tablist",
1770
- "aria-label": l(i).settings
1771
- }, [
1772
- (s(), d(C, null, x([
1773
- "computations",
1774
- "groups",
1775
- "conditions",
1776
- "detail",
1777
- "matrix",
1778
- "tree"
1779
- ], (u) => a("button", {
1780
- key: u,
1781
- type: "button",
1782
- role: "tab",
1783
- "aria-selected": l(h) === u,
1784
- class: ve({ "is-active": l(h) === u }),
1785
- onClick: (H) => h.value = u
1786
- }, [
1787
- k(t(l(i)[u]), 1),
1788
- u === "computations" && e.list.computed?.length ? (s(), d("span", tn, t(e.list.computed.length), 1)) : E("", !0),
1789
- u === "groups" && l(U).length ? (s(), d("span", nn, t(l(U).length), 1)) : E("", !0)
1790
- ], 10, an)), 64))
1791
- ], 8, ln),
1792
- a("div", sn, [
1793
- a("strong", null, t(l(i).catalog), 1),
1794
- Y.value ? (s(), d("button", {
1795
- key: 0,
1796
- type: "button",
1797
- disabled: e.readonly,
1798
- onClick: _
1799
- }, t(l(i).restoreDraft), 9, dn)) : E("", !0),
1800
- a("label", null, [
1801
- k(t(l(i).searchFields), 1),
1802
- F(a("input", {
1803
- "onUpdate:modelValue": c[0] || (c[0] = (u) => oe(p) ? p.value = u : null),
1804
- type: "search",
1805
- "aria-label": l(i).searchFields
1806
- }, null, 8, on), [
1807
- [q, l(p)]
1808
- ])
1809
- ]),
1810
- a("div", un, [
1811
- (s(!0), d(C, null, x(l(ae), (u) => (s(), d("button", {
1812
- key: u.field,
1813
- type: "button",
1814
- disabled: e.readonly || l(h) !== "computations",
1815
- title: l(i).useField,
1816
- onClick: (H) => l(m).setExpression({ field: u.field })
1817
- }, [
1818
- a("strong", null, t(u.label), 1),
1819
- a("code", null, t(u.field), 1),
1820
- a("small", null, t(u.meta), 1)
1821
- ], 8, rn))), 128))
1822
- ]),
1823
- l(ie).length > 50 ? (s(), d("small", cn, t(l(i).shown) + " 50 / " + t(l(ie).length), 1)) : E("", !0)
1824
- ])
1825
- ]),
1826
- l(h) === "computations" ? (s(), d("div", mn, [
1827
- a("label", null, [
1828
- k(t(l(i).existing), 1),
1829
- a("select", {
1830
- "aria-label": l(i).existing,
1831
- value: l(Z),
1832
- disabled: e.readonly,
1833
- onChange: c[1] || (c[1] = (u) => l(m).loadComputed(u.target.value))
1834
- }, [
1835
- a("option", bn, "+ " + t(l(i).newField), 1),
1836
- (s(!0), d(C, null, x(e.list.computed, (u) => (s(), d("option", {
1837
- key: u.field,
1838
- value: u.field
1839
- }, t(u.field), 9, gn))), 128))
1840
- ], 40, vn)
1841
- ]),
1842
- a("label", null, [
1843
- k(t(l(i).target), 1),
1844
- F(a("input", {
1845
- "aria-label": l(i).target,
1846
- "onUpdate:modelValue": c[2] || (c[2] = (u) => l(S).field = u),
1847
- disabled: e.readonly,
1848
- autocomplete: "off"
1849
- }, null, 8, yn), [
1850
- [q, l(S).field]
1851
- ])
1852
- ]),
1853
- a("div", fn, [
1854
- a("label", null, [
1855
- k(t(l(i).scope), 1),
1856
- F(a("select", {
1857
- "aria-label": l(i).scope,
1858
- "onUpdate:modelValue": c[3] || (c[3] = (u) => l(S).scope = u),
1859
- disabled: e.readonly
1860
- }, [
1861
- (s(!0), d(C, null, x(l(R).scopes, (u) => (s(), d("option", {
1862
- key: u,
1863
- value: u
1864
- }, t(l(i)[u]), 9, kn))), 128))
1865
- ], 8, hn), [
1866
- [L, l(S).scope]
1867
- ])
1868
- ]),
1869
- a("label", null, [
1870
- k(t(l(i).numeric), 1),
1871
- F(a("select", {
1872
- "aria-label": l(i).numeric,
1873
- "onUpdate:modelValue": c[4] || (c[4] = (u) => l(S).numeric = u),
1874
- disabled: e.readonly
1875
- }, [
1876
- a("option", Vn, t(l(i).number), 1),
1877
- a("option", wn, t(l(i).decimal), 1)
1878
- ], 8, $n), [
1879
- [L, l(S).numeric]
1880
- ])
1881
- ])
1882
- ]),
1883
- l(S).scope === "group" ? (s(), d("fieldset", Cn, [
1884
- a("legend", null, t(l(i).groupFields), 1),
1885
- (s(!0), d(C, null, x(l(V), (u) => (s(), d("label", {
1886
- key: u.field
1887
- }, [
1888
- a("input", {
1889
- type: "checkbox",
1890
- checked: l(S).groupBy?.includes(u.field),
1891
- disabled: e.readonly,
1892
- onChange: (H) => l(m).toggleGroupField(
1893
- u.field,
1894
- H.target.checked
1895
- )
1896
- }, null, 40, Un),
1897
- k(t(u.label), 1)
1898
- ]))), 128))
1899
- ])) : E("", !0),
1900
- typeof l(S).expression != "string" ? (s(), fe(Yt, {
1901
- key: 1,
1902
- "model-value": l(S).expression,
1903
- fields: l(V),
1904
- messages: l(i),
1905
- readonly: e.readonly,
1906
- "onUpdate:modelValue": l(m).setExpression
1907
- }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"])) : (s(), d("p", Fn, t(l(S).expression), 1)),
1908
- a("details", null, [
1909
- a("summary", null, t(l(i).advanced), 1),
1910
- a("div", Sn, [
1911
- a("label", null, [
1912
- k(t(l(i).digits), 1),
1913
- F(a("input", {
1914
- "aria-label": l(i).digits,
1915
- "onUpdate:modelValue": c[5] || (c[5] = (u) => l(S).digits = u),
1916
- type: "number",
1917
- min: "0",
1918
- max: "100",
1919
- disabled: e.readonly
1920
- }, null, 8, Mn), [
1921
- [
1922
- q,
1923
- l(S).digits,
1924
- void 0,
1925
- { number: !0 }
1926
- ]
1927
- ])
1928
- ]),
1929
- a("label", null, [
1930
- k(t(l(i).nulls), 1),
1931
- F(a("select", {
1932
- "aria-label": l(i).nulls,
1933
- "onUpdate:modelValue": c[6] || (c[6] = (u) => l(S).nulls = u),
1934
- disabled: e.readonly
1935
- }, [
1936
- a("option", xn, t(l(i).propagate), 1),
1937
- a("option", Nn, t(l(i).error), 1)
1938
- ], 8, Dn), [
1939
- [L, l(S).nulls]
1940
- ])
1941
- ]),
1942
- a("label", null, [
1943
- k(t(l(i).division), 1),
1944
- F(a("select", {
1945
- "aria-label": l(i).division,
1946
- "onUpdate:modelValue": c[7] || (c[7] = (u) => l(S).divisionByZero = u),
1947
- disabled: e.readonly
1948
- }, [
1949
- a("option", En, t(l(i).error), 1),
1950
- a("option", Kn, t(l(i).propagate), 1)
1951
- ], 8, Rn), [
1952
- [L, l(S).divisionByZero]
1953
- ])
1954
- ])
1955
- ])
1956
- ]),
1957
- l(S).numeric === "decimal" ? (s(), d("p", Tn, t(l(i).decimalHint), 1)) : E("", !0),
1958
- l(O).valid && l(S).field ? (s(), d("div", Ln, [
1959
- k(t(l(i).dependencies), 1),
1960
- a("strong", null, t(l(O).order.join(" → ")), 1)
1961
- ])) : E("", !0),
1962
- a("div", Bn, [
1963
- a("button", {
1964
- type: "button",
1965
- disabled: e.readonly,
1966
- onClick: c[8] || (c[8] = //@ts-ignore
1967
- (...u) => l(m).check && l(m).check(...u))
1968
- }, t(l(i).check), 9, On),
1969
- a("button", {
1970
- type: "button",
1971
- class: "mr-rule-editor__primary",
1972
- disabled: e.readonly || !l(O).valid,
1973
- onClick: c[9] || (c[9] = //@ts-ignore
1974
- (...u) => l(m).applyComputed && l(m).applyComputed(...u))
1975
- }, t(l(i).apply), 9, An),
1976
- l(Z) ? (s(), d("button", {
1977
- key: 0,
1978
- type: "button",
1979
- disabled: e.readonly,
1980
- onClick: c[10] || (c[10] = //@ts-ignore
1981
- (...u) => l(m).removeComputed && l(m).removeComputed(...u))
1982
- }, t(l(i).remove), 9, In)) : E("", !0)
1983
- ]),
1984
- !l(O).valid && l(S).field ? (s(), d("p", Wn, t(l(O).errors.join(";")), 1)) : E("", !0)
1985
- ])) : l(h) === "groups" ? (s(), d("div", Gn, [
1986
- a("div", Jn, [
1987
- F(a("select", {
1988
- "onUpdate:modelValue": c[11] || (c[11] = (u) => oe(T) ? T.value = u : null),
1989
- "aria-label": l(i).groups
1990
- }, [
1991
- (s(!0), d(C, null, x(l(U), (u, H) => (s(), d("option", {
1992
- key: H,
1993
- value: H
1994
- }, t(H + 1) + " · " + t(u.field), 9, jn))), 128)),
1995
- l(U).length ? E("", !0) : (s(), d("option", Pn, t(l(i).noGroups), 1))
1996
- ], 8, Hn), [
1997
- [
1998
- L,
1999
- l(T),
2000
- void 0,
2001
- { number: !0 }
2002
- ]
2003
- ]),
2004
- a("button", {
2005
- type: "button",
2006
- disabled: e.readonly || l(U).length >= 16,
2007
- onClick: c[12] || (c[12] = //@ts-ignore
2008
- (...u) => l(m).addGroup && l(m).addGroup(...u))
2009
- }, " + " + t(l(i).addGroup), 9, zn)
2010
- ]),
2011
- l(M) ? (s(), d(C, { key: 0 }, [
2012
- a("label", null, [
2013
- k(t(l(i).field), 1),
2014
- F(a("select", {
2015
- "aria-label": l(i).field,
2016
- "onUpdate:modelValue": c[13] || (c[13] = (u) => l(M).field = u),
2017
- disabled: e.readonly
2018
- }, [
2019
- (s(!0), d(C, null, x(l(V), (u) => (s(), d("option", {
2020
- key: u.field,
2021
- value: u.field
2022
- }, t(u.label), 9, Zn))), 128))
2023
- ], 8, qn), [
2024
- [L, l(M).field]
2025
- ])
2026
- ]),
2027
- a("div", Qn, [
2028
- a("label", null, [
2029
- k(t(l(i).header), 1),
2030
- F(a("input", {
2031
- "aria-label": l(i).header,
2032
- "onUpdate:modelValue": c[14] || (c[14] = (u) => l(M).headerTemplate = u),
2033
- disabled: e.readonly,
2034
- placeholder: "{value}"
2035
- }, null, 8, Xn), [
2036
- [q, l(M).headerTemplate]
2037
- ])
2038
- ]),
2039
- a("label", null, [
2040
- k(t(l(i).footer), 1),
2041
- F(a("input", {
2042
- "aria-label": l(i).footer,
2043
- "onUpdate:modelValue": c[15] || (c[15] = (u) => l(M).subtotalLabel = u),
2044
- disabled: e.readonly
2045
- }, null, 8, Yn), [
2046
- [q, l(M).subtotalLabel]
2047
- ])
2048
- ])
2049
- ]),
2050
- a("div", pn, [
2051
- a("label", null, [
2052
- F(a("input", {
2053
- "onUpdate:modelValue": c[16] || (c[16] = (u) => l(M).keepWithNext = u),
2054
- type: "checkbox",
2055
- disabled: e.readonly
2056
- }, null, 8, _n), [
2057
- [de, l(M).keepWithNext]
2058
- ]),
2059
- k(t(l(i).orphan), 1)
2060
- ]),
2061
- a("label", null, [
2062
- F(a("input", {
2063
- "onUpdate:modelValue": c[17] || (c[17] = (u) => l(M).repeatHeader = u),
2064
- type: "checkbox",
2065
- disabled: e.readonly
2066
- }, null, 8, ei), [
2067
- [de, l(M).repeatHeader]
2068
- ]),
2069
- k(t(l(i).repeat), 1)
2070
- ])
2071
- ]),
2072
- (s(!0), d(C, null, x(l(M).aggregates, (u, H) => (s(), d("div", {
2073
- key: H,
2074
- class: "mr-rule-editor__aggregate"
2075
- }, [
2076
- a("div", li, [
2077
- a("label", null, [
2078
- k(t(l(i).output), 1),
2079
- F(a("select", {
2080
- "aria-label": l(i).output,
2081
- "onUpdate:modelValue": (B) => u.field = B,
2082
- disabled: e.readonly
2083
- }, [
2084
- (s(!0), d(C, null, x(l(V), (B) => (s(), d("option", {
2085
- key: B.field,
2086
- value: B.field
2087
- }, t(B.label), 9, ti))), 128))
2088
- ], 8, ai), [
2089
- [L, u.field]
2090
- ])
2091
- ]),
2092
- a("label", null, [
2093
- k(t(l(i).aggregate), 1),
2094
- F(a("select", {
2095
- "aria-label": l(i).aggregate,
2096
- "onUpdate:modelValue": (B) => u.op = B,
2097
- disabled: e.readonly
2098
- }, [
2099
- (s(!0), d(C, null, x(l(R).aggregates, (B) => (s(), d("option", {
2100
- key: B,
2101
- value: B
2102
- }, t(l(i)[B]), 9, ii))), 128))
2103
- ], 8, ni), [
2104
- [L, u.op]
2105
- ])
2106
- ])
2107
- ]),
2108
- a("label", null, [
2109
- k(t(l(i).measure), 1),
2110
- F(a("select", {
2111
- "aria-label": l(i).measure,
2112
- "onUpdate:modelValue": (B) => u.valueField = B,
2113
- disabled: e.readonly
2114
- }, [
2115
- a("option", di, t(u.field), 1),
2116
- (s(!0), d(C, null, x(l(V), (B) => (s(), d("option", {
2117
- key: B.field,
2118
- value: B.field
2119
- }, t(B.label), 9, oi))), 128))
2120
- ], 8, si), [
2121
- [L, u.valueField]
2122
- ])
2123
- ]),
2124
- u.op === "weightedAvg" ? (s(), d("label", ui, [
2125
- k(t(l(i).weight), 1),
2126
- F(a("select", {
2127
- "aria-label": l(i).weight,
2128
- "onUpdate:modelValue": (B) => u.weightField = B,
2129
- disabled: e.readonly
2130
- }, [
2131
- (s(!0), d(C, null, x(l(V), (B) => (s(), d("option", {
2132
- key: B.field,
2133
- value: B.field
2134
- }, t(B.label), 9, ci))), 128))
2135
- ], 8, ri), [
2136
- [L, u.weightField]
2137
- ])
2138
- ])) : E("", !0),
2139
- a("div", mi, [
2140
- F(a("select", {
2141
- "onUpdate:modelValue": (B) => u.numeric = B,
2142
- disabled: e.readonly,
2143
- "aria-label": l(i).numeric
2144
- }, [
2145
- a("option", bi, t(l(i).number), 1),
2146
- a("option", gi, t(l(i).decimal), 1)
2147
- ], 8, vi), [
2148
- [L, u.numeric]
2149
- ]),
2150
- a("button", {
2151
- type: "button",
2152
- disabled: e.readonly,
2153
- onClick: (B) => l(M).aggregates?.splice(H, 1)
2154
- }, t(l(i).remove), 9, yi)
2155
- ])
2156
- ]))), 128)),
2157
- a("button", {
2158
- type: "button",
2159
- disabled: e.readonly,
2160
- onClick: c[18] || (c[18] = //@ts-ignore
2161
- (...u) => l(m).addAggregate && l(m).addAggregate(...u))
2162
- }, " + " + t(l(i).addAggregate), 9, fi),
2163
- a("div", hi, [
2164
- a("button", {
2165
- type: "button",
2166
- disabled: e.readonly || l(T) === 0,
2167
- "aria-label": l(i).moveUp,
2168
- onClick: c[19] || (c[19] = (u) => l(m).moveGroup(-1))
2169
- }, " ↑ " + t(l(i).outer), 9, ki),
2170
- a("button", {
2171
- type: "button",
2172
- disabled: e.readonly || l(T) >= l(U).length - 1,
2173
- "aria-label": l(i).moveDown,
2174
- onClick: c[20] || (c[20] = (u) => l(m).moveGroup(1))
2175
- }, " ↓ " + t(l(i).inner), 9, $i),
2176
- a("button", {
2177
- type: "button",
2178
- disabled: e.readonly,
2179
- onClick: c[21] || (c[21] = //@ts-ignore
2180
- (...u) => l(m).removeGroup && l(m).removeGroup(...u))
2181
- }, t(l(i).remove), 9, Vi)
2182
- ])
2183
- ], 64)) : E("", !0),
2184
- a("button", {
2185
- type: "button",
2186
- class: "mr-rule-editor__primary",
2187
- disabled: e.readonly,
2188
- onClick: c[22] || (c[22] = //@ts-ignore
2189
- (...u) => l(m).applyGroups && l(m).applyGroups(...u))
2190
- }, t(l(i).apply), 9, wi)
2191
- ])) : l(h) === "conditions" ? (s(), d("div", Ci, [
2192
- a("label", null, [
2193
- k(t(l(i).column), 1),
2194
- F(a("select", {
2195
- "aria-label": l(i).column,
2196
- "onUpdate:modelValue": c[23] || (c[23] = (u) => oe(W) ? W.value = u : null),
2197
- disabled: e.readonly,
2198
- onChange: c[24] || (c[24] = (u) => l(m).loadCondition(-1))
2199
- }, [
2200
- (s(!0), d(C, null, x(e.list.columns, (u) => (s(), d("option", {
2201
- key: u.field,
2202
- value: u.field
2203
- }, t(u.header || u.field), 9, Fi))), 128))
2204
- ], 40, Ui), [
2205
- [L, l(W)]
2206
- ])
2207
- ]),
2208
- a("label", null, [
2209
- k(t(l(i).effect), 1),
2210
- F(a("select", {
2211
- "aria-label": l(i).effect,
2212
- "onUpdate:modelValue": c[25] || (c[25] = (u) => oe(r) ? r.value = u : null),
2213
- disabled: e.readonly,
2214
- onChange: c[26] || (c[26] = (u) => l(m).loadCondition(-1))
2215
- }, [
2216
- a("option", Mi, t(l(i).style), 1),
2217
- a("option", Di, t(l(i).cell), 1),
2218
- a("option", xi, t(l(i).rowVisibility), 1)
2219
- ], 40, Si), [
2220
- [L, l(r)]
2221
- ])
2222
- ]),
2223
- l(r) === "style" ? (s(), d("label", Ni, [
2224
- k(t(l(i).existing), 1),
2225
- a("select", {
2226
- "aria-label": l(i).existing,
2227
- value: l(I),
2228
- disabled: e.readonly,
2229
- onChange: c[27] || (c[27] = (u) => l(m).loadCondition(
2230
- Number(u.target.value)
2231
- ))
2232
- }, [
2233
- a("option", Ei, "+ " + t(l(i).newCondition), 1),
2234
- (s(!0), d(C, null, x(l(z)?.rules, (u, H) => (s(), d("option", {
2235
- key: H,
2236
- value: H
2237
- }, t(H + 1) + " · " + t("field" in u.when ? u.when.field : l(i).conditionGroup), 9, Ki))), 128))
2238
- ], 40, Ri)
2239
- ])) : E("", !0),
2240
- re(we, {
2241
- "model-value": l(n),
2242
- fields: l(V),
2243
- messages: l(i),
2244
- readonly: e.readonly,
2245
- "onUpdate:modelValue": l(m).setCondition
2246
- }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"]),
2247
- l(r) === "style" ? (s(), d(C, { key: 1 }, [
2248
- a("div", Ti, [
2249
- a("label", null, [
2250
- k(t(l(i).color), 1),
2251
- F(a("input", {
2252
- "onUpdate:modelValue": c[28] || (c[28] = (u) => l(b).color = u),
2253
- type: "color",
2254
- disabled: e.readonly
2255
- }, null, 8, Li), [
2256
- [q, l(b).color]
2257
- ])
2258
- ]),
2259
- a("label", null, [
2260
- k(t(l(i).background), 1),
2261
- F(a("input", {
2262
- "onUpdate:modelValue": c[29] || (c[29] = (u) => l(b).backgroundColor = u),
2263
- type: "color",
2264
- disabled: e.readonly
2265
- }, null, 8, Bi), [
2266
- [q, l(b).backgroundColor]
2267
- ])
2268
- ])
2269
- ]),
2270
- a("label", Oi, [
2271
- F(a("input", {
2272
- "onUpdate:modelValue": c[30] || (c[30] = (u) => l(b).bold = u),
2273
- type: "checkbox",
2274
- disabled: e.readonly
2275
- }, null, 8, Ai), [
2276
- [de, l(b).bold]
2277
- ]),
2278
- k(t(l(i).bold), 1)
2279
- ])
2280
- ], 64)) : E("", !0),
2281
- a("div", Ii, [
2282
- a("button", {
2283
- type: "button",
2284
- class: "mr-rule-editor__primary",
2285
- disabled: e.readonly,
2286
- onClick: c[31] || (c[31] = (u) => l(m).applyCondition())
2287
- }, t(l(i).apply), 9, Wi),
2288
- l(I) >= 0 || l(r) !== "style" ? (s(), d("button", {
2289
- key: 0,
2290
- type: "button",
2291
- disabled: e.readonly,
2292
- onClick: c[32] || (c[32] = (u) => l(m).applyCondition(!0))
2293
- }, t(l(i).removeCondition), 9, Gi)) : E("", !0)
2294
- ])
2295
- ])) : E("", !0),
2296
- (s(), d(C, null, x(["detail", "matrix", "tree"], (u) => F(re(kt, {
2297
- key: `${u}-${ee.value}`,
2298
- list: e.list,
2299
- "recovery-key": e.recoveryKey,
2300
- mode: u,
2301
- datasets: e.datasets,
2302
- "dataset-schema": e.datasetSchema,
2303
- "dataset-schemas": e.datasetSchemas,
2304
- readonly: e.readonly,
2305
- messages: l(i),
2306
- accept: l(m).applyLayout,
2307
- onDirty: (H) => X.value = { ...X.value, [u]: H }
2308
- }, null, 8, ["list", "recovery-key", "mode", "datasets", "dataset-schema", "dataset-schemas", "readonly", "messages", "accept", "onDirty"]), [
2309
- [Ee, l(h) === u]
2310
- ])), 64)),
2311
- a("aside", Ji, [
2312
- a("header", null, [
2313
- a("strong", null, t(l(i).explanation), 1),
2314
- Y.value ? (s(), d("span", Hi, t(l(i).pending), 1)) : E("", !0)
2315
- ]),
2316
- a("p", null, t(l(i).sourceHint), 1),
2317
- l(h) === "computations" ? (s(), d(C, { key: 0 }, [
2318
- a("h4", null, t(l(i).expression), 1),
2319
- a("code", null, t(l(v)), 1),
2320
- a("div", ji, [
2321
- a("h4", null, t(l(i).sourceValues) + " → " + t(l(i).result), 1),
2322
- (s(!0), d(C, null, x(l(D), (u) => (s(), d("div", {
2323
- key: u.row,
2324
- class: "mr-rule-editor__trace"
2325
- }, [
2326
- a("small", null, "#" + t(u.row), 1),
2327
- a("code", null, t(u.values), 1),
2328
- a("strong", null, t(l(f).find((H) => H.row === u.row)?.value ?? (l(f).length ? "—" : l(i).notChecked)), 1)
2329
- ]))), 128)),
2330
- l(f).some((u) => u.value == null) ? (s(), d("p", Pi, t(l(i).nullReason), 1)) : E("", !0),
2331
- l(f).length ? (s(), d("p", zi, t(l(i).sample), 1)) : E("", !0)
2332
- ])
2333
- ], 64)) : E("", !0),
2334
- l(o) ? (s(), d("p", qi, t(l(o)), 1)) : E("", !0)
2335
- ])
2336
- ], 8, _t));
2337
- }
2338
- }), ns = /* @__PURE__ */ me(Zi, [["__scopeId", "data-v-436ee307"]]);
2339
- export {
2340
- ns as default
2341
- };