super-page-runtime 2.3.26 → 2.3.27

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.
@@ -1,20 +1,20 @@
1
1
  import t from "../../../../assets/chart-themes/bar-theme.js";
2
2
  import e from "../../../../assets/chart-themes/gauge-theme.js";
3
- import i from "../../../../assets/chart-themes/pie-theme.js";
4
- import n from "../../../../assets/chart-themes/radar-theme.js";
3
+ import n from "../../../../assets/chart-themes/pie-theme.js";
4
+ import i from "../../../../assets/chart-themes/radar-theme.js";
5
5
  import s from "../../../../assets/chart-themes/scatter-theme.js";
6
6
  import { getDefaultValue as r } from "../page-init-util.js";
7
- import { getValueFromSource as o, setValueForVariableName as a, getParamNames as l, getValueFromVariable as c, formatVariableValue as f, setVariableValue as u } from "../page-helper-util.js";
7
+ import { getValueFromSource as o, setValueForVariableName as a, getParamNames as l, formatVariableValue as c, getValueFromVariable as f, setVariableValue as u } from "../page-helper-util.js";
8
8
  import { getI18n as d } from "agilebuilder-ui/src/utils/util";
9
9
  import { appendDefaultMethods as p } from "../events/event-util.js";
10
10
  var h = ((t2) => (t2.X_FIELD_NAME = "__x", t2.Y_TEMP_NAME = "__y", t2))(h || {});
11
11
  function g(r2, o2 = "bar") {
12
- return "bar" === o2 ? t[r2] : "gauge" === o2 ? e[r2] : "pie" === o2 ? i[r2] : "radar" === o2 ? n[r2] : "scatter" === o2 ? s[r2] : t[r2];
12
+ return "bar" === o2 ? t[r2] : "gauge" === o2 ? e[r2] : "pie" === o2 ? n[r2] : "radar" === o2 ? i[r2] : "scatter" === o2 ? s[r2] : t[r2];
13
13
  }
14
14
  function m() {
15
15
  return [{ value: "theme1", label: "主题1" }, { value: "theme2", label: "主题2" }, { value: "theme3", label: "主题3" }];
16
16
  }
17
- function x(t2, e2, i2, n2, s2) {
17
+ function x(t2, e2, n2, i2, s2) {
18
18
  return function(r2) {
19
19
  let o2 = r2 == null ? void 0 : r2.value;
20
20
  if (s2 && (o2 = r2), null == o2 || null == o2) return o2;
@@ -25,22 +25,22 @@ function x(t2, e2, i2, n2, s2) {
25
25
  (null == t3 || isNaN(t3)) && (t3 = 2), o2 = parseFloat(parseFloat(o2).toFixed(t3));
26
26
  }
27
27
  let a2 = "";
28
- t2.indexOf("prefix") > -1 && i2 && (a2 = i2);
28
+ t2.indexOf("prefix") > -1 && n2 && (a2 = n2);
29
29
  let l2 = "";
30
- return t2.indexOf("append") > -1 && n2 && (l2 = n2), a2 + o2.toLocaleString() + l2;
30
+ return t2.indexOf("append") > -1 && i2 && (l2 = i2), a2 + o2.toLocaleString() + l2;
31
31
  };
32
32
  }
33
33
  function b(t2, e2) {
34
34
  if (!e2) return;
35
35
  if (e2.tooltipFormatterArgs && (e2.tooltip || (e2.tooltip = {}), e2.tooltip.valueFormatter = x.apply(e2, e2.tooltipFormatterArgs)), e2.series) {
36
- const i3 = t2.props ? t2.props.enableDrill : null;
37
- for (const n3 of e2.series) e2.radar || (n3.data = []), n3.labelFormatterArgs && (n3.label || (n3.label = {}), n3.label.formatter = x.apply(n3, n3.labelFormatterArgs)), !i3 && t2.clickSet && t2.clickSet.selected && n3.emphasis && (n3.emphasis.disabled = false), "pie" === n3.type && t2.clickSet && t2.clickSet.selected && (t2.clickSet.multiple ? n3.selectedMode = "multiple" : n3.selectedMode = "single");
36
+ const n3 = t2.props ? t2.props.enableDrill : null;
37
+ for (const i3 of e2.series) e2.radar || (i3.data = []), i3.labelFormatterArgs && (i3.label || (i3.label = {}), i3.label.formatter = x.apply(i3, i3.labelFormatterArgs)), !n3 && t2.clickSet && t2.clickSet.selected && i3.emphasis && (i3.emphasis.disabled = false), "pie" === i3.type && t2.clickSet && t2.clickSet.selected && (t2.clickSet.multiple ? i3.selectedMode = "multiple" : i3.selectedMode = "single");
38
38
  }
39
39
  if (e2.radar) for (const t3 of e2.radar) t3.indicator = [];
40
- const i2 = e2.series;
41
- t2.defaultSeries = i2;
42
- const n2 = e2.xAxis;
43
- n2 && n2.length > 0 && n2[0].data && (n2[0].data = []), t2.defaultXaxis = n2;
40
+ const n2 = e2.series;
41
+ t2.defaultSeries = n2;
42
+ const i2 = e2.xAxis;
43
+ i2 && i2.length > 0 && i2[0].data && (i2[0].data = []), t2.defaultXaxis = i2;
44
44
  const s2 = e2.yAxis;
45
45
  if (s2) for (const t3 of s2) t3.data && (t3.data = []), "auto" === t3._dataMin && (t3.min = function(t4) {
46
46
  if (t4.min) return 10 * Math.floor(t4.min / 10);
@@ -49,19 +49,19 @@ function b(t2, e2) {
49
49
  });
50
50
  t2.defaultYaxis = s2;
51
51
  }
52
- function I(t2, e2, i2) {
53
- if (!(i2 && e2 && e2.clickSet && t2)) return;
54
- const n2 = e2.clickSet;
55
- i2.on("click", function(s2) {
52
+ function I(t2, e2, n2) {
53
+ if (!(n2 && e2 && e2.clickSet && t2)) return;
54
+ const i2 = e2.clickSet;
55
+ n2.on("click", function(s2) {
56
56
  let r2 = e2.highlightInfos ? e2.highlightInfos : [], o2 = -1;
57
57
  if (r2) {
58
58
  const t3 = [];
59
59
  for (let a2 = 0; a2 < r2.length; a2++) {
60
60
  const l2 = r2[a2], c2 = l2.seriesIndex === s2.seriesIndex && l2.dataIndex === s2.dataIndex;
61
- if (c2 || !n2.multiple) {
62
- if (n2.selected) {
61
+ if (c2 || !i2.multiple) {
62
+ if (i2.selected) {
63
63
  const t4 = "chart-pie" === e2.name ? "unselect" : "downplay";
64
- i2.dispatchAction({ type: t4, seriesIndex: l2.seriesIndex, dataIndex: l2.dataIndex });
64
+ n2.dispatchAction({ type: t4, seriesIndex: l2.seriesIndex, dataIndex: l2.dataIndex });
65
65
  }
66
66
  } else t3.push(l2);
67
67
  c2 && (o2 = a2);
@@ -69,53 +69,49 @@ function I(t2, e2, i2) {
69
69
  r2 = t3;
70
70
  }
71
71
  if (-1 === o2) {
72
- if (n2.selected) {
72
+ if (i2.selected) {
73
73
  const t3 = "chart-pie" === e2.name ? "select" : "highlight";
74
- i2.dispatchAction({ type: t3, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
74
+ n2.dispatchAction({ type: t3, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
75
75
  }
76
76
  r2.push({ seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
77
77
  }
78
78
  e2.highlightInfos = r2, N(t2, e2);
79
79
  });
80
80
  }
81
- function v(t2, e2, i2) {
82
- if (!i2 || !e2 || !t2) return;
83
- const n2 = e2.highlightInfos ? e2.highlightInfos : [];
84
- for (let t3 = 0; t3 < n2.length; t3++) {
85
- const s2 = n2[t3], r2 = "chart-pie" === e2.name ? "unselect" : "downplay";
86
- i2.dispatchAction({ type: r2, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
81
+ function v(t2, e2, n2) {
82
+ if (!n2 || !e2 || !t2) return;
83
+ const i2 = e2.highlightInfos ? e2.highlightInfos : [];
84
+ for (let t3 = 0; t3 < i2.length; t3++) {
85
+ const s2 = i2[t3], r2 = "chart-pie" === e2.name ? "unselect" : "downplay";
86
+ n2.dispatchAction({ type: r2, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
87
87
  }
88
88
  e2.highlightInfos = [], N(t2, e2);
89
89
  }
90
90
  function N(t2, e2) {
91
91
  if (!e2.clickSet) return;
92
- const i2 = e2.clickSet, n2 = i2.variables;
93
- if (!n2 || 0 == n2.length) return;
92
+ const n2 = e2.clickSet, i2 = n2.variables;
93
+ if (!i2 || 0 == i2.length) return;
94
94
  const s2 = e2.highlightInfos ? e2.highlightInfos : [], r2 = e2.cacheDatas ? e2.cacheDatas : [], l2 = [], c2 = [];
95
95
  for (const t3 of s2) c2.includes(t3.dataIndex) || (c2.push(t3.dataIndex), t3.dataIndex < r2.length && l2.push(r2[t3.dataIndex]));
96
- for (const e3 of n2) {
96
+ for (const e3 of i2) {
97
97
  if (!e3.fieldName || !e3.variable) continue;
98
- const n3 = [];
98
+ const i3 = [];
99
99
  for (const t3 of l2) {
100
- const i3 = o(t3, e3.fieldName, void 0);
101
- null != i3 && n3.push(i3);
100
+ const n3 = o(t3, e3.fieldName, void 0);
101
+ null != n3 && i3.push(n3);
102
102
  }
103
- i2.multiple ? a(t2.entity, e3.variable, n3) : a(t2.entity, e3.variable, n3.length > 0 ? n3[0] : void 0);
103
+ n2.multiple ? a(t2.entity, e3.variable, i3) : a(t2.entity, e3.variable, i3.length > 0 ? i3[0] : void 0);
104
104
  }
105
105
  }
106
- function y(t2, e2, i2) {
107
- const n2 = e2.items ? e2.items : [], s2 = e2.props ? e2.props.orderByTarget : "";
106
+ function y(t2, e2, n2) {
107
+ const i2 = e2.items ? e2.items : [], s2 = e2.props ? e2.props.orderByTarget : "";
108
108
  let r2 = null;
109
109
  if ("x" == s2 || "X" == s2) r2 = "__x";
110
110
  else if (s2) {
111
- for (const t3 of n2) if (t3.uuid == s2) {
112
- const e3 = t3.props ? t3.props : {}, i3 = e3.yaxisSource, n3 = e3.yaxisField;
113
- if (n3 && (!i3 || "variable" == i3)) {
114
- r2 = n3;
115
- break;
116
- }
117
- if ("formula" == i3 && e3.formula) {
118
- r2 = t3.uuid + "_field";
111
+ for (const t3 of i2) if (t3.uuid == s2) {
112
+ const e3 = t3.props ? t3.props : {}, n3 = e3.yaxisSource, i3 = e3.yaxisField;
113
+ if (i3 && (!n3 || "variable" == n3)) {
114
+ r2 = i3;
119
115
  break;
120
116
  }
121
117
  }
@@ -124,137 +120,137 @@ function y(t2, e2, i2) {
124
120
  const a2 = e2.props ? e2.props.orderSource : "";
125
121
  let l2 = e2.props ? e2.props.orderFix : "";
126
122
  if ("variable" == a2) {
127
- const i3 = e2.props ? e2.props.orderVariable : "";
128
- l2 = f(t2, i3);
123
+ const n3 = e2.props ? e2.props.orderVariable : "";
124
+ l2 = c(t2, n3);
129
125
  }
130
- l2 = "desc" == l2 || "DESC" == l2 ? "desc" : "asc", i2.sort((t3, e3) => {
131
- const i3 = o(t3, r2, void 0), n3 = o(e3, r2, void 0);
132
- return "desc" === l2 ? n3 - i3 : i3 - n3;
126
+ l2 = "desc" == l2 || "DESC" == l2 ? "desc" : "asc", n2.sort((t3, e3) => {
127
+ const n3 = o(t3, r2, void 0), i3 = o(e3, r2, void 0);
128
+ return "desc" === l2 ? i3 - n3 : n3 - i3;
133
129
  });
134
130
  }
135
- function S(t2, e2, i2, n2, s2) {
136
- if (!i2) return i2;
131
+ function S(t2, e2, n2, i2, s2) {
132
+ if (!n2) return n2;
137
133
  const r2 = e2.props ? e2.props : {};
138
- if (!r2.limitQuantity) return i2;
134
+ if (!r2.limitQuantity) return n2;
139
135
  let a2 = null;
140
- if (r2.itemNumVariable ? (a2 = f(t2, r2.itemNumVariable), a2 = parseInt(a2)) : a2 = r2.itemNumFix ? r2.itemNumFix : 10, null == a2 || null == a2 || isNaN(a2)) return i2;
141
- if (i2.length < a2) return i2;
142
- const l2 = r2.overItemAlias, c2 = [], u2 = {};
143
- n2 = n2 || [], s2 = s2 || [];
144
- for (let t3 = 0; t3 < i2.length; t3++) {
145
- const e3 = i2[t3];
146
- if (t3 < a2) c2.push(e3);
136
+ if (r2.itemNumVariable ? (a2 = c(t2, r2.itemNumVariable), a2 = parseInt(a2)) : a2 = r2.itemNumFix ? r2.itemNumFix : 10, null == a2 || null == a2 || isNaN(a2)) return n2;
137
+ if (n2.length < a2) return n2;
138
+ const l2 = r2.overItemAlias, f2 = [], u2 = {};
139
+ i2 = i2 || [], s2 = s2 || [];
140
+ for (let t3 = 0; t3 < n2.length; t3++) {
141
+ const e3 = n2[t3];
142
+ if (t3 < a2) f2.push(e3);
147
143
  else {
148
144
  if (!l2) break;
149
- for (const t4 of n2) {
145
+ for (const t4 of i2) {
150
146
  if (!t4) continue;
151
- let i3 = o(e3, t4, void 0);
152
- i3 = null == i3 || null == i3 ? "" : i3, u2[t4] || (u2[t4] = []);
153
- const n3 = u2[t4];
154
- n3.includes(i3) || n3.push(i3);
147
+ let n3 = o(e3, t4, void 0);
148
+ n3 = null == n3 || null == n3 ? "" : n3, u2[t4] || (u2[t4] = []);
149
+ const i3 = u2[t4];
150
+ i3.includes(n3) || i3.push(n3);
155
151
  }
156
152
  for (const t4 of s2) {
157
153
  if (!t4) continue;
158
- const i3 = o(e3, t4, void 0);
159
- if (isNaN(i3)) continue;
160
- const n3 = u2[t4];
161
- isNaN(n3) ? u2[t4] = i3 : u2[t4] = i3 + n3;
154
+ const n3 = o(e3, t4, void 0);
155
+ if (isNaN(n3)) continue;
156
+ const i3 = u2[t4];
157
+ isNaN(i3) ? u2[t4] = n3 : u2[t4] = n3 + i3;
162
158
  }
163
159
  }
164
160
  }
165
- return l2 && (u2.__x = l2, c2.push(u2)), c2;
161
+ return l2 && (u2.__x = l2, f2.push(u2)), f2;
166
162
  }
167
- function F(t2, e2, i2) {
168
- const n2 = {};
163
+ function F(t2, e2, n2) {
164
+ const i2 = {};
169
165
  for (const s2 of t2) {
170
166
  const t3 = s2.props ? s2.props : {};
171
167
  if ("formula" === t3.yaxisSource) {
172
168
  const s3 = l(t3.formula);
173
- for (const t4 of s3) if (!(t4 in n2)) {
174
- if (t4.startsWith("${min.")) n2[t4] = _(e2, t4.substring(6, t4.length - 1));
175
- else if (t4.startsWith("${max.")) n2[t4] = A(e2, t4.substring(6, t4.length - 1));
176
- else if (t4.startsWith("${sum.")) n2[t4] = M(e2, t4.substring(6, t4.length - 1));
177
- else if (t4.startsWith("${avg.")) n2[t4] = k(e2, t4.substring(6, t4.length - 1));
169
+ for (const t4 of s3) if (!(t4 in i2)) {
170
+ if (t4.startsWith("${min.")) i2[t4] = _(e2, t4.substring(6, t4.length - 1));
171
+ else if (t4.startsWith("${max.")) i2[t4] = A(e2, t4.substring(6, t4.length - 1));
172
+ else if (t4.startsWith("${sum.")) i2[t4] = M(e2, t4.substring(6, t4.length - 1));
173
+ else if (t4.startsWith("${avg.")) i2[t4] = k(e2, t4.substring(6, t4.length - 1));
178
174
  else if (t4.startsWith("${add.")) {
179
175
  const e3 = t4.substring(6, t4.length - 1);
180
- i2.add(e3);
176
+ n2.add(e3);
181
177
  }
182
178
  }
183
179
  }
184
180
  }
185
- return n2;
181
+ return i2;
186
182
  }
187
183
  function _(t2, e2) {
188
- let i2;
189
- for (const n2 of t2) {
190
- const t3 = parseFloat(o(n2, e2, null));
191
- (void 0 === i2 || !isNaN(t3) && t3 < i2) && (i2 = t3);
184
+ let n2;
185
+ for (const i2 of t2) {
186
+ const t3 = parseFloat(o(i2, e2, null));
187
+ (void 0 === n2 || !isNaN(t3) && t3 < n2) && (n2 = t3);
192
188
  }
193
- return i2;
189
+ return n2;
194
190
  }
195
191
  function A(t2, e2) {
196
- let i2;
197
- for (const n2 of t2) {
198
- const t3 = parseFloat(o(n2, e2, null));
199
- (void 0 === i2 || !isNaN(t3) && t3 > i2) && (i2 = t3);
192
+ let n2;
193
+ for (const i2 of t2) {
194
+ const t3 = parseFloat(o(i2, e2, null));
195
+ (void 0 === n2 || !isNaN(t3) && t3 > n2) && (n2 = t3);
200
196
  }
201
- return i2;
197
+ return n2;
202
198
  }
203
199
  function M(t2, e2) {
204
- let i2;
205
- for (const n2 of t2) {
206
- const t3 = parseFloat(o(n2, e2, null));
207
- void 0 === i2 ? i2 = t3 : isNaN(t3) || (i2 += t3);
200
+ let n2;
201
+ for (const i2 of t2) {
202
+ const t3 = parseFloat(o(i2, e2, null));
203
+ void 0 === n2 ? n2 = t3 : isNaN(t3) || (n2 += t3);
208
204
  }
209
- return i2;
205
+ return n2;
210
206
  }
211
207
  function k(t2, e2) {
212
- const i2 = M(t2, e2);
213
- return void 0 === i2 || 0 === t2.length ? i2 : parseFloat((i2 / t2.length).toFixed(5));
208
+ const n2 = M(t2, e2);
209
+ return void 0 === n2 || 0 === t2.length ? n2 : parseFloat((n2 / t2.length).toFixed(5));
214
210
  }
215
- function w(t2, e2, i2, n2) {
211
+ function w(t2, e2, n2, i2) {
216
212
  if (!t2) return;
217
- if (e2) for (const i3 in e2) t2 = t2.replace(new RegExp("\\${add." + i3 + "}", "g"), e2[i3]);
213
+ if (e2) for (const n3 in e2) t2 = t2.replace(new RegExp("\\${add." + n3 + "}", "g"), e2[n3]);
218
214
  const s2 = l(t2);
219
215
  for (const e3 of s2) {
220
216
  let s3 = null;
221
- s3 = e3.startsWith("${row.") ? o(i2, e3.substring(6, e3.length - 1), null) : c(n2.entity, e3), t2 = t2.replace(new RegExp(e3.replace("$", "\\$"), "g"), s3);
217
+ s3 = e3.startsWith("${row.") ? o(n2, e3.substring(6, e3.length - 1), null) : f(i2.entity, e3), t2 = t2.replace(new RegExp(e3.replace("$", "\\$"), "g"), s3);
222
218
  }
223
219
  t2.includes("return ") || (t2 = "return " + t2);
224
220
  const r2 = new Function("params", t2);
225
- return p(r2, n2), r2({ pageContext: n2, row: i2 });
221
+ return p(r2, i2), r2({ pageContext: i2, row: n2 });
226
222
  }
227
223
  function $(t2, e2) {
228
224
  if (!t2 || !t2.$el) return;
229
- const i2 = t2.$el.getElementsByTagName("canvas");
230
- if (!i2 || 0 === i2.length) return;
231
- const n2 = i2[0], s2 = n2.width + ":" + n2.height;
232
- return { isTable: false, fileContent: n2.toDataURL(), fileSize: s2, title: e2 == null ? void 0 : e2.title };
225
+ const n2 = t2.$el.getElementsByTagName("canvas");
226
+ if (!n2 || 0 === n2.length) return;
227
+ const i2 = n2[0], s2 = i2.width + ":" + i2.height;
228
+ return { isTable: false, fileContent: i2.toDataURL(), fileSize: s2, title: e2 == null ? void 0 : e2.title };
233
229
  }
234
- function j(t2, e2, i2) {
235
- const n2 = window.localStorage.getItem("HOME_MY_CHARTS_CONDITIONS");
230
+ function j(t2, e2, n2) {
231
+ const i2 = window.localStorage.getItem("HOME_MY_CHARTS_CONDITIONS");
236
232
  let s2 = true;
237
- if (n2) {
238
- const t3 = JSON.parse(n2);
239
- if (t3[i2]) {
240
- const n3 = t3[i2];
241
- if (Object.keys(n3).length > 0) {
233
+ if (i2) {
234
+ const t3 = JSON.parse(i2);
235
+ if (t3[n2]) {
236
+ const i3 = t3[n2];
237
+ if (Object.keys(i3).length > 0) {
242
238
  s2 = false;
243
- for (const t4 in n3) null !== n3[t4] && void 0 !== n3[t4] && a(e2.entity, t4, n3[t4]);
239
+ for (const t4 in i3) null !== i3[t4] && void 0 !== i3[t4] && a(e2.entity, t4, i3[t4]);
244
240
  }
245
241
  }
246
242
  }
247
243
  if (s2 && t2) {
248
- for (const i3 of t2) if (i3.prop && i3.value) {
249
- const t3 = r(e2, i3.value, "input-text", false), n3 = i3.prop.substring(2, i3.prop.length - 1).split(".");
250
- null != t3 && u(e2.entity, n3, t3);
244
+ for (const n3 of t2) if (n3.prop && n3.value) {
245
+ const t3 = r(e2, n3.value, "input-text", false), i3 = n3.prop.substring(2, n3.prop.length - 1).split(".");
246
+ null != t3 && u(e2.entity, i3, t3);
251
247
  }
252
248
  }
253
249
  }
254
250
  function O(t2) {
255
251
  if (t2 == null ? void 0 : t2.grid) {
256
- const e2 = t2.grid, i2 = (t3) => !t3 || "0" === t3;
257
- i2(e2.top) && i2(e2.right) && i2(e2.bottom) && i2(e2.left) && Object.assign(e2, { right: "10%", bottom: "60", left: "10%" });
252
+ const e2 = t2.grid, n2 = (t3) => !t3 || "0" === t3;
253
+ n2(e2.top) && n2(e2.right) && n2(e2.bottom) && n2(e2.left) && Object.assign(e2, { right: "10%", bottom: "60", left: "10%" });
258
254
  }
259
255
  }
260
256
  function E(t2) {