@ryuzaki13/react-foundation-lib 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{formatters-DVE1YVNQ.js → formatters-BJ6VySIq.js} +346 -450
- package/dist/chunks/formatters-BJ6VySIq.js.map +1 -0
- package/dist/chunks/{validate-DyzojM0w.js → validate-DnkaY38p.js} +213 -93
- package/dist/chunks/validate-DnkaY38p.js.map +1 -0
- package/dist/error-report/index.js +1 -1
- package/dist/excel/index.js +18 -18
- package/dist/excel/index.js.map +1 -1
- package/dist/formatters/index.js +5 -5
- package/dist/formatters/pipeline/clone.d.ts.map +1 -1
- package/dist/formatters/pipeline/dependencies.d.ts +1 -0
- package/dist/formatters/pipeline/dependencies.d.ts.map +1 -1
- package/dist/formatters/pipeline/execute.d.ts +1 -1
- package/dist/formatters/pipeline/execute.d.ts.map +1 -1
- package/dist/formatters/pipeline/normalize.d.ts.map +1 -1
- package/dist/formatters/pipeline/rekey.d.ts.map +1 -1
- package/dist/formatters/pipeline/runtime.d.ts.map +1 -1
- package/dist/formatters/pipeline/types.d.ts +28 -4
- package/dist/formatters/pipeline/types.d.ts.map +1 -1
- package/dist/formatters/pipeline/validate.d.ts +1 -1
- package/dist/formatters/pipeline/validate.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/formatters/pipeline/README.mdx +35 -2
- package/dist/chunks/formatters-DVE1YVNQ.js.map +0 -1
- package/dist/chunks/validate-DyzojM0w.js.map +0 -1
|
@@ -2,10 +2,10 @@ import { _ as e, r as t, x as n } from "./array-D-_yMMUK.js";
|
|
|
2
2
|
import { i as r } from "./isRecord-DXDTW-jA.js";
|
|
3
3
|
import { uuidv4 as i } from "../crypto/index.js";
|
|
4
4
|
import { Bt as a, Rt as o, Sn as s, _t as c, pn as l, vn as u } from "./odata-service-CWkHASdw.js";
|
|
5
|
-
import { c as ee, d,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { S as d, _ as f, c as ee, d as p, g as m, n as te, o as ne, p as re, t as h, v as ie } from "./validate-DnkaY38p.js";
|
|
6
|
+
import { compileTableFormula as ae } from "../formulas/index.js";
|
|
7
|
+
import { t as oe } from "./string-comparison-BKT7PXmq.js";
|
|
8
|
+
import { isSafe as se } from "../validators/index.js";
|
|
9
9
|
//#region src/formatters/strings/formatRussianPlural.ts
|
|
10
10
|
var ce = new Intl.PluralRules("ru-RU");
|
|
11
11
|
function le(e, t) {
|
|
@@ -28,7 +28,7 @@ function de(e, t) {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/formatters/strings/stripInnerSpaces.ts
|
|
31
|
-
function
|
|
31
|
+
function g(e) {
|
|
32
32
|
let t = "", n = !1;
|
|
33
33
|
for (let r = 0; r < e.length; r++) {
|
|
34
34
|
let i = e.charCodeAt(r);
|
|
@@ -42,7 +42,7 @@ function fe(e) {
|
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/formatters/strings/stripLeadingZeros.ts
|
|
45
|
-
function
|
|
45
|
+
function fe(e) {
|
|
46
46
|
if (e == null) return "";
|
|
47
47
|
let t = e.trim();
|
|
48
48
|
if (t === "") return "0";
|
|
@@ -53,199 +53,199 @@ function pe(e) {
|
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/formatters/strings/truncateText.ts
|
|
56
|
-
function
|
|
56
|
+
function pe(t, n) {
|
|
57
57
|
let r = e(t);
|
|
58
58
|
if (r) return r.length > n ? `${r.slice(0, n)}...` : r;
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region src/formatters/boolean/toAbapBoolean.ts
|
|
62
|
-
function
|
|
62
|
+
function me(e) {
|
|
63
63
|
return typeof e == "string" && (e = e !== "0"), e ? "X" : " ";
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region src/formatters/formatName.ts
|
|
67
|
-
function
|
|
67
|
+
function he(e) {
|
|
68
68
|
if (!e) return "";
|
|
69
69
|
let t = e.trim().replace(/\s+/g, " ").replace(/\s*\./, " ").replace(/\s*\.\s*/g, ". ").toLowerCase().split(" ");
|
|
70
70
|
if (t.length === 0) return "";
|
|
71
|
-
let n =
|
|
71
|
+
let n = _(t[0]);
|
|
72
72
|
if (t.length === 1) return n;
|
|
73
|
-
let r = t[1].includes(".") ?
|
|
74
|
-
return t.length === 2 ? `${n} ${r}` : `${n} ${r} ${t[2].includes(".") ?
|
|
73
|
+
let r = t[1].includes(".") ? _e(t[1]) : _(t[1]);
|
|
74
|
+
return t.length === 2 ? `${n} ${r}` : `${n} ${r} ${t[2].includes(".") ? _e(t[2]) : _(t[2])}`;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ge(e) {
|
|
77
77
|
if (!e) return "";
|
|
78
78
|
let t = e.trim().replace(/\s+/g, " ").replace(/\s*\.\s*/g, ".").toLowerCase().split(" ");
|
|
79
79
|
if (t.length === 0) return "";
|
|
80
|
-
let n =
|
|
80
|
+
let n = _(t[0]);
|
|
81
81
|
if (t.length === 1) return n;
|
|
82
82
|
let r = t[1].startsWith(".") ? t[1][1] : t[1][0];
|
|
83
83
|
if (t.length === 2) return t[1].includes("."), `${n} ${r.toUpperCase()}.`;
|
|
84
84
|
let i = t[2].startsWith(".") ? t[2][1] : t[2][0];
|
|
85
85
|
return `${n} ${r.toUpperCase()}.${i.toUpperCase()}.`;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function _(e) {
|
|
88
88
|
return e ? e[0].toUpperCase() + e.slice(1) : "";
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
90
|
+
function _e(e) {
|
|
91
|
+
return _(e);
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/formatters/formatPhone.ts
|
|
95
|
-
function
|
|
96
|
-
let t =
|
|
95
|
+
function ve(e) {
|
|
96
|
+
let t = v(e).match(/^(\+7)(\d{3})(\d{3})(\d{2})(\d{2})$/);
|
|
97
97
|
return t ? `+7 (${t[2]}) ${t[3]}-${t[4]}-${t[5]}` : e;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function v(e) {
|
|
100
100
|
return `+7${e.replace(/\D/g, "").slice(0, 11).replace(/^(7|8)/, "")}`;
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/formatters/date/calendarDate.ts
|
|
104
|
-
function
|
|
104
|
+
function y(e, t, n, r = 0, i = 0, a = 0, o = 0) {
|
|
105
105
|
return new Date(e, t, n, r, i, a, o);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
107
|
+
function b(e) {
|
|
108
|
+
return y(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0, 0);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
110
|
+
function x(e) {
|
|
111
|
+
return y(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 0);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function S(e) {
|
|
114
|
+
return y(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
116
|
+
function ye(e) {
|
|
117
|
+
return y(e.getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let n = Number.isInteger(t) ? (t % 7 + 7) % 7 : 1, r =
|
|
121
|
-
return
|
|
119
|
+
function be(e, t = 1) {
|
|
120
|
+
let n = Number.isInteger(t) ? (t % 7 + 7) % 7 : 1, r = b(e);
|
|
121
|
+
return C(r, -((r.getDay() - n + 7) % 7));
|
|
122
|
+
}
|
|
123
|
+
function C(e, t) {
|
|
124
|
+
return y(e.getFullYear(), e.getMonth(), e.getDate() + t, 0, 0, 0, 0);
|
|
122
125
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
126
|
+
function xe(e, t) {
|
|
127
|
+
return y(e.getFullYear(), e.getMonth() + t, e.getDate(), 0, 0, 0, 0);
|
|
125
128
|
}
|
|
126
129
|
function Se(e, t) {
|
|
127
|
-
return
|
|
130
|
+
return y(e.getFullYear() + t, e.getMonth(), e.getDate(), 0, 0, 0, 0);
|
|
128
131
|
}
|
|
129
132
|
function Ce(e, t) {
|
|
130
|
-
return g(e.getFullYear() + t, e.getMonth(), e.getDate(), 0, 0, 0, 0);
|
|
131
|
-
}
|
|
132
|
-
function we(e, t) {
|
|
133
133
|
return !(e instanceof Date) || !(t instanceof Date) ? !1 : e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/formatters/date/calendarPeriod.ts
|
|
137
|
-
var
|
|
137
|
+
var we = {
|
|
138
138
|
friday: 4,
|
|
139
139
|
saturday: 5,
|
|
140
140
|
sunday: 6
|
|
141
141
|
};
|
|
142
|
-
function
|
|
142
|
+
function Te(e) {
|
|
143
143
|
return e instanceof Date && Number.isFinite(e.getTime());
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Ee(e) {
|
|
146
146
|
return e ?? "sunday";
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function De(e) {
|
|
149
149
|
return e ?? "day";
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
if (!
|
|
153
|
-
switch (
|
|
151
|
+
function Oe(e, t = {}) {
|
|
152
|
+
if (!Te(e)) return null;
|
|
153
|
+
switch (De(t.selectionMode)) {
|
|
154
154
|
case "day": return {
|
|
155
|
-
start:
|
|
156
|
-
end:
|
|
155
|
+
start: b(e),
|
|
156
|
+
end: x(e)
|
|
157
157
|
};
|
|
158
158
|
case "week": {
|
|
159
|
-
let n =
|
|
159
|
+
let n = be(e), r = we[Ee(t.weekEndDay)];
|
|
160
160
|
return {
|
|
161
161
|
start: n,
|
|
162
|
-
end:
|
|
162
|
+
end: x(C(n, r))
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
case "month": return {
|
|
166
|
-
start:
|
|
167
|
-
end:
|
|
166
|
+
start: S(e),
|
|
167
|
+
end: x(y(e.getFullYear(), e.getMonth() + 1, 0))
|
|
168
168
|
};
|
|
169
169
|
case "year": return {
|
|
170
|
-
start:
|
|
171
|
-
end:
|
|
170
|
+
start: ye(e),
|
|
171
|
+
end: x(y(e.getFullYear(), 11, 31))
|
|
172
172
|
};
|
|
173
173
|
default: return null;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
if (!
|
|
178
|
-
let n =
|
|
176
|
+
function ke(e, t) {
|
|
177
|
+
if (!Te(e) || !t) return !1;
|
|
178
|
+
let n = b(e).getTime();
|
|
179
179
|
return n >= t.start.getTime() && n <= t.end.getTime();
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return !(!e || t.minDate && e.start.getTime() <
|
|
181
|
+
function Ae(e, t = {}) {
|
|
182
|
+
return !(!e || t.minDate && e.start.getTime() < b(t.minDate).getTime() || t.maxDate && e.end.getTime() > x(t.maxDate).getTime());
|
|
183
183
|
}
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region src/formatters/date/dateRange.ts
|
|
186
|
-
var
|
|
187
|
-
function
|
|
186
|
+
var je = 864e5;
|
|
187
|
+
function w(e) {
|
|
188
188
|
return e instanceof Date && Number.isFinite(e.getTime());
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function Me(e) {
|
|
191
191
|
return Array.isArray(e);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function T(e) {
|
|
194
194
|
return new Date(e.getTime());
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function E(e, t) {
|
|
197
197
|
return e.getTime() <= t.getTime() ? [e, t] : [t, e];
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
if (
|
|
201
|
-
let [t, n] = e, r =
|
|
202
|
-
return r && i ?
|
|
199
|
+
function D(e) {
|
|
200
|
+
if (Me(e)) {
|
|
201
|
+
let [t, n] = e, r = w(t), i = w(n);
|
|
202
|
+
return r && i ? E(t, n) : r ? [t, t] : i ? [n, n] : null;
|
|
203
203
|
}
|
|
204
|
-
return
|
|
204
|
+
return w(e) ? [e, e] : null;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
let n =
|
|
206
|
+
function O(e, t = {}) {
|
|
207
|
+
let n = D(e);
|
|
208
208
|
if (!n) return null;
|
|
209
209
|
let [r, i] = n;
|
|
210
|
-
return t.timeMode === "preserve" ? [
|
|
210
|
+
return t.timeMode === "preserve" ? [T(r), T(i)] : [b(r), x(i)];
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
let n =
|
|
212
|
+
function Ne(e, t) {
|
|
213
|
+
let n = O(e, t);
|
|
214
214
|
if (!n) throw Error("Диапазон дат не задан");
|
|
215
215
|
return n;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Pe(e) {
|
|
218
218
|
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
219
219
|
}
|
|
220
220
|
function Fe(e) {
|
|
221
|
-
let t =
|
|
221
|
+
let t = O(e);
|
|
222
222
|
if (!t) return null;
|
|
223
223
|
let [n, r] = t;
|
|
224
|
-
return Math.floor((
|
|
224
|
+
return Math.floor((Pe(r) - Pe(n)) / je) + 1;
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/formatters/date/educationDate.ts
|
|
228
228
|
var Ie = /^(\d{4})-(\d{2})-(\d{2})$/, Le = /^(\d{2}):(\d{2})(?::(\d{2}))?$/, Re = 8, ze = 1, Be = 7, Ve = 31, He = 6;
|
|
229
|
-
function
|
|
229
|
+
function k(e, t) {
|
|
230
230
|
return Number.isInteger(e) && e >= 0 && e <= t;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function A(e) {
|
|
233
233
|
let t = e?.match(Ie);
|
|
234
234
|
if (!t) return null;
|
|
235
|
-
let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), a =
|
|
235
|
+
let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), a = y(n, r - 1, i);
|
|
236
236
|
return a.getFullYear() === n && a.getMonth() === r - 1 && a.getDate() === i ? a : null;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function j(e) {
|
|
239
239
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
240
240
|
}
|
|
241
241
|
function Ue(e) {
|
|
242
242
|
return `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}`;
|
|
243
243
|
}
|
|
244
244
|
function We(e, t) {
|
|
245
|
-
let n =
|
|
245
|
+
let n = A(e), r = t.match(Le);
|
|
246
246
|
if (!n || !r) return null;
|
|
247
247
|
let i = Number(r[1]), a = Number(r[2]), o = Number(r[3] ?? 0);
|
|
248
|
-
return !
|
|
248
|
+
return !k(i, 23) || !k(a, 59) || !k(o, 59) ? null : y(n.getFullYear(), n.getMonth(), n.getDate(), i, a, o);
|
|
249
249
|
}
|
|
250
250
|
function Ge(e = /* @__PURE__ */ new Date()) {
|
|
251
251
|
return e.getMonth() < Re ? e.getFullYear() - 1 : e.getFullYear();
|
|
@@ -254,47 +254,47 @@ function Ke(e = /* @__PURE__ */ new Date()) {
|
|
|
254
254
|
let t = Ge(e);
|
|
255
255
|
return {
|
|
256
256
|
year: t,
|
|
257
|
-
start:
|
|
258
|
-
end:
|
|
257
|
+
start: y(t, Re, ze),
|
|
258
|
+
end: y(t + 1, Be, Ve)
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
let n =
|
|
261
|
+
function M(e, t = /* @__PURE__ */ new Date()) {
|
|
262
|
+
let n = b(e), { start: r, end: i } = Ke(t);
|
|
263
263
|
return n >= r && n <= i;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
let t =
|
|
267
|
-
return
|
|
265
|
+
function N(e) {
|
|
266
|
+
let t = b(e), n = (t.getDay() + 6) % 7;
|
|
267
|
+
return C(t, n === 6 ? 1 : -n);
|
|
268
268
|
}
|
|
269
269
|
function qe(e) {
|
|
270
|
-
let t =
|
|
270
|
+
let t = N(e);
|
|
271
271
|
return {
|
|
272
272
|
start: t,
|
|
273
|
-
end:
|
|
273
|
+
end: C(t, 5)
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
276
|
function Je(e) {
|
|
277
|
-
let t = typeof e == "string" ?
|
|
278
|
-
return Array.from({ length: He }, (e, n) =>
|
|
277
|
+
let t = typeof e == "string" ? A(e) ?? N(/* @__PURE__ */ new Date()) : N(e);
|
|
278
|
+
return Array.from({ length: He }, (e, n) => j(C(t, n)));
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function P(e = /* @__PURE__ */ new Date()) {
|
|
281
|
+
return j(N(e));
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
let n =
|
|
285
|
-
if (!n || !
|
|
286
|
-
let r =
|
|
287
|
-
return
|
|
283
|
+
function F(e, t = /* @__PURE__ */ new Date()) {
|
|
284
|
+
let n = A(e);
|
|
285
|
+
if (!n || !M(n, t)) return;
|
|
286
|
+
let r = N(n);
|
|
287
|
+
return M(r, t) ? j(r) : void 0;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
return
|
|
289
|
+
function I(e, t = /* @__PURE__ */ new Date()) {
|
|
290
|
+
return F(e, t) ?? P(t);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
return
|
|
292
|
+
function Ye(e, t = /* @__PURE__ */ new Date()) {
|
|
293
|
+
return I(e, t) === P(t);
|
|
294
294
|
}
|
|
295
295
|
//#endregion
|
|
296
296
|
//#region src/formatters/date/formatInstantDateTime.ts
|
|
297
|
-
function
|
|
297
|
+
function Xe(e, t) {
|
|
298
298
|
let n = u(e), r = t.fallback ?? "";
|
|
299
299
|
if (!n || n.kind !== "date-time") return r;
|
|
300
300
|
try {
|
|
@@ -309,32 +309,32 @@ function Qe(e, t) {
|
|
|
309
309
|
}
|
|
310
310
|
//#endregion
|
|
311
311
|
//#region src/formatters/date/relativeRanges.ts
|
|
312
|
-
function
|
|
313
|
-
return
|
|
312
|
+
function L(e) {
|
|
313
|
+
return b(e);
|
|
314
|
+
}
|
|
315
|
+
function Ze({ referenceDate: e }) {
|
|
316
|
+
let t = L(e), n = S(t), r = C(t, -1);
|
|
317
|
+
return [n, x(r < n ? n : r)];
|
|
318
|
+
}
|
|
319
|
+
function Qe({ referenceDate: e }) {
|
|
320
|
+
let t = L(e);
|
|
321
|
+
return [S(t), x(t)];
|
|
314
322
|
}
|
|
315
323
|
function $e({ referenceDate: e }) {
|
|
316
|
-
let t =
|
|
317
|
-
return [
|
|
324
|
+
let t = L(e);
|
|
325
|
+
return [t, x(t)];
|
|
318
326
|
}
|
|
319
327
|
function et({ referenceDate: e }) {
|
|
320
|
-
let t =
|
|
321
|
-
return [
|
|
328
|
+
let t = C(L(e), -1);
|
|
329
|
+
return [t, x(t)];
|
|
322
330
|
}
|
|
323
331
|
function tt({ referenceDate: e }) {
|
|
324
|
-
let t =
|
|
325
|
-
return [t,
|
|
326
|
-
}
|
|
327
|
-
function nt({ referenceDate: e }) {
|
|
328
|
-
let t = b(N(e), -1);
|
|
329
|
-
return [t, v(t)];
|
|
330
|
-
}
|
|
331
|
-
function rt({ referenceDate: e }) {
|
|
332
|
-
let t = N(e);
|
|
333
|
-
return [_(Se(t, -1)), v(t)];
|
|
332
|
+
let t = L(e);
|
|
333
|
+
return [b(xe(t, -1)), x(t)];
|
|
334
334
|
}
|
|
335
335
|
//#endregion
|
|
336
336
|
//#region src/formatters/number/compact.ts
|
|
337
|
-
var
|
|
337
|
+
var nt = [
|
|
338
338
|
{
|
|
339
339
|
value: 0xe8d4a51000,
|
|
340
340
|
suffix: "трлн"
|
|
@@ -351,12 +351,12 @@ var it = [
|
|
|
351
351
|
value: 1e3,
|
|
352
352
|
suffix: "тыс"
|
|
353
353
|
}
|
|
354
|
-
],
|
|
354
|
+
], R = {
|
|
355
355
|
minCompactValue: 1e3,
|
|
356
356
|
roundingMode: "trunc",
|
|
357
357
|
suffixSeparator: " "
|
|
358
|
-
},
|
|
359
|
-
function
|
|
358
|
+
}, rt = ",";
|
|
359
|
+
function z(e, t) {
|
|
360
360
|
switch (t) {
|
|
361
361
|
case "round": return Math.round(e);
|
|
362
362
|
case "floor": return Math.floor(e);
|
|
@@ -364,43 +364,43 @@ function ot(e, t) {
|
|
|
364
364
|
case "trunc": return Math.trunc(e);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
if (t === 0) return
|
|
367
|
+
function it(e, t, n) {
|
|
368
|
+
if (t === 0) return z(e, n);
|
|
369
369
|
let r = 10 ** t;
|
|
370
|
-
return
|
|
370
|
+
return z(e * r, n) / r;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function at(e) {
|
|
373
373
|
return e >= 10 ? 0 : 1;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function ot(e, t) {
|
|
376
376
|
if (t === 0) return 0;
|
|
377
377
|
let n = e.toFixed(t), r = n.indexOf(".");
|
|
378
378
|
return r === -1 ? 0 : n.slice(r + 1).replace(/0+$/, "").length;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function st(e, t) {
|
|
381
381
|
return t.findIndex((t) => e >= t.value);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function ct(e, t) {
|
|
384
384
|
return {
|
|
385
385
|
name: e.name,
|
|
386
386
|
decimals: t,
|
|
387
|
-
decimalSeparator: t > 0 ? e.decimalSeparator ||
|
|
387
|
+
decimalSeparator: t > 0 ? e.decimalSeparator || rt : e.decimalSeparator,
|
|
388
388
|
grouping: e.grouping,
|
|
389
389
|
groupingSeparator: e.groupingSeparator,
|
|
390
390
|
groupingSize: e.groupingSize
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function B(e, t, n, r, i) {
|
|
394
394
|
let a = n.units[t];
|
|
395
395
|
if (!a) return i(e, r);
|
|
396
|
-
let o = e / a.value, s = n.maxDecimals ??
|
|
397
|
-
return c >= 1e3 && t > 0 ?
|
|
396
|
+
let o = e / a.value, s = n.maxDecimals ?? at(o), c = it(o, s, n.roundingMode);
|
|
397
|
+
return c >= 1e3 && t > 0 ? B(e, t - 1, n, r, i) : `${i(c, ct(r, ot(c, s)))}${n.suffixSeparator}${a.suffix}`;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
let { minCompactValue: t =
|
|
399
|
+
function lt(e) {
|
|
400
|
+
let { minCompactValue: t = R.minCompactValue, roundingMode: n = R.roundingMode, suffixSeparator: r = R.suffixSeparator, maxDecimals: i, units: a = nt } = e.options, o = Math.abs(e.value);
|
|
401
401
|
if (o < t) return e.formatPlainNumber(e.value, e.preset);
|
|
402
|
-
let s =
|
|
403
|
-
return s === -1 ? e.formatPlainNumber(e.value, e.preset) : `${e.value < 0 ? "-" : ""}${
|
|
402
|
+
let s = st(o, a);
|
|
403
|
+
return s === -1 ? e.formatPlainNumber(e.value, e.preset) : `${e.value < 0 ? "-" : ""}${B(o, s, {
|
|
404
404
|
roundingMode: n,
|
|
405
405
|
suffixSeparator: r,
|
|
406
406
|
maxDecimals: i,
|
|
@@ -409,112 +409,112 @@ function ft(e) {
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region src/formatters/number/isZeroValue.ts
|
|
412
|
-
function
|
|
412
|
+
function V(e) {
|
|
413
413
|
let t = o(e);
|
|
414
414
|
return typeof t == "number" ? t === 0 : typeof t == "bigint" && t === 0n;
|
|
415
415
|
}
|
|
416
416
|
//#endregion
|
|
417
417
|
//#region src/formatters/number/formatNumber.ts
|
|
418
|
-
var
|
|
419
|
-
function
|
|
418
|
+
var H = /* @__PURE__ */ new Map();
|
|
419
|
+
function ut(e, t) {
|
|
420
420
|
if (t === 0) return Math.trunc(e);
|
|
421
421
|
let n = 10 ** t;
|
|
422
422
|
return Math.trunc(e * n) / n;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
let n = `${e}:${+!!t}`, r =
|
|
424
|
+
function U(e, t) {
|
|
425
|
+
let n = `${e}:${+!!t}`, r = H.get(n);
|
|
426
426
|
return r || (r = new Intl.NumberFormat("ru-RU", {
|
|
427
427
|
minimumFractionDigits: e,
|
|
428
428
|
maximumFractionDigits: e,
|
|
429
429
|
useGrouping: t
|
|
430
|
-
}),
|
|
430
|
+
}), H.set(n, r)), r;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
return e.groupingSize === 3 && (e.groupingSeparator ===
|
|
432
|
+
function dt(e) {
|
|
433
|
+
return e.groupingSize === 3 && (e.groupingSeparator === f.groupingSeparator || !e.grouping) && (e.decimalSeparator === "," || e.decimals === 0);
|
|
434
434
|
}
|
|
435
|
-
function
|
|
436
|
-
return
|
|
435
|
+
function ft(e, t, n) {
|
|
436
|
+
return U(t, n).format(e);
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
let n =
|
|
438
|
+
function pt(e, t) {
|
|
439
|
+
let n = U(t.decimals, t.grouping).formatToParts(e), r = "";
|
|
440
440
|
for (let e of n) e.type === "group" ? r += t.groupingSeparator : e.type === "decimal" ? r += t.decimalSeparator : r += e.value;
|
|
441
441
|
return r;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
let n =
|
|
443
|
+
function mt(e, t) {
|
|
444
|
+
let n = U(t.decimals, !1).format(e), r = n.indexOf(","), i = r === -1 ? n : n.slice(0, r), a = r === -1 ? null : n.slice(r + 1), o = i.startsWith("-"), s = o ? i.slice(1) : i, c = t.groupingSize, l = [];
|
|
445
445
|
for (let e = s.length; e > 0; e -= c) l.unshift(s.slice(Math.max(0, e - c), e));
|
|
446
446
|
let u = (o ? "-" : "") + l.join(t.groupingSeparator);
|
|
447
447
|
return a !== null && (u += t.decimalSeparator + a), u;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return
|
|
449
|
+
function W(e, t) {
|
|
450
|
+
return dt(t) ? ft(e, t.decimals, t.grouping) : t.groupingSize === 3 || !t.grouping ? pt(e, t) : mt(e, t);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function G(e, t) {
|
|
453
453
|
if (typeof e == "string" && e.trim() === "") return "0";
|
|
454
454
|
let n = Number(e);
|
|
455
455
|
if (!Number.isFinite(n)) return "0";
|
|
456
|
-
let r =
|
|
457
|
-
return r.compact ?
|
|
456
|
+
let r = d(t);
|
|
457
|
+
return r.compact ? lt({
|
|
458
458
|
value: n,
|
|
459
459
|
preset: r,
|
|
460
460
|
options: r.compact,
|
|
461
|
-
formatPlainNumber:
|
|
462
|
-
}) :
|
|
461
|
+
formatPlainNumber: W
|
|
462
|
+
}) : W(n, r);
|
|
463
|
+
}
|
|
464
|
+
function ht(e) {
|
|
465
|
+
return G(e, m.integer);
|
|
466
|
+
}
|
|
467
|
+
function gt(e) {
|
|
468
|
+
return G(e, m.currency);
|
|
469
|
+
}
|
|
470
|
+
function _t(e) {
|
|
471
|
+
return G(e, m.decimal);
|
|
463
472
|
}
|
|
464
473
|
function vt(e) {
|
|
465
|
-
return
|
|
474
|
+
return G(e, m.decimal2);
|
|
466
475
|
}
|
|
467
476
|
function yt(e) {
|
|
468
|
-
return
|
|
477
|
+
return G(e, m.decimal3);
|
|
469
478
|
}
|
|
470
479
|
function bt(e) {
|
|
471
|
-
return
|
|
480
|
+
return G(e, m.percent);
|
|
472
481
|
}
|
|
473
482
|
function xt(e) {
|
|
474
|
-
return
|
|
483
|
+
return G(e, m.price);
|
|
475
484
|
}
|
|
476
485
|
function St(e) {
|
|
477
|
-
return
|
|
486
|
+
return G(e, m.tonnage);
|
|
478
487
|
}
|
|
479
488
|
function Ct(e) {
|
|
480
|
-
return
|
|
489
|
+
return V(e) ? "" : G(e, m.integer);
|
|
481
490
|
}
|
|
482
491
|
function wt(e) {
|
|
483
|
-
return
|
|
492
|
+
return V(e) ? "" : G(e, m.currency);
|
|
484
493
|
}
|
|
485
494
|
function Tt(e) {
|
|
486
|
-
return
|
|
495
|
+
return V(e) ? "" : G(e, m.decimal);
|
|
487
496
|
}
|
|
488
497
|
function Et(e) {
|
|
489
|
-
return
|
|
498
|
+
return V(e) ? "" : G(e, m.decimal2);
|
|
490
499
|
}
|
|
491
500
|
function Dt(e) {
|
|
492
|
-
return
|
|
501
|
+
return V(e) ? "" : G(e, m.decimal3);
|
|
493
502
|
}
|
|
494
503
|
function Ot(e) {
|
|
495
|
-
return
|
|
504
|
+
return V(e) ? "" : G(e, m.percent);
|
|
496
505
|
}
|
|
497
506
|
function kt(e) {
|
|
498
|
-
return
|
|
507
|
+
return V(e) ? "" : G(e, m.price);
|
|
499
508
|
}
|
|
500
509
|
function At(e) {
|
|
501
|
-
return
|
|
502
|
-
}
|
|
503
|
-
function jt(e) {
|
|
504
|
-
return I(e) ? "" : B(e, f.percent);
|
|
505
|
-
}
|
|
506
|
-
function Mt(e) {
|
|
507
|
-
return I(e) ? "" : B(e, f.price);
|
|
510
|
+
return V(e) ? "" : G(e, m.tonnage);
|
|
508
511
|
}
|
|
509
|
-
function
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
function Pt() {
|
|
513
|
-
L.clear();
|
|
512
|
+
function jt() {
|
|
513
|
+
H.clear();
|
|
514
514
|
}
|
|
515
515
|
//#endregion
|
|
516
516
|
//#region src/formatters/normalizeLeadingZeros.ts
|
|
517
|
-
function
|
|
517
|
+
function Mt(e, t) {
|
|
518
518
|
let n = typeof e == "number" ? e : Number(e);
|
|
519
519
|
if (!Number.isFinite(n)) return e;
|
|
520
520
|
let r = String(n);
|
|
@@ -528,11 +528,11 @@ function V(e, t) {
|
|
|
528
528
|
}
|
|
529
529
|
return r;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Nt(e, t) {
|
|
532
532
|
if (!t || !Number.isFinite(t)) return e;
|
|
533
533
|
if (typeof e == "number") {
|
|
534
534
|
if (!Number.isFinite(e)) return e;
|
|
535
|
-
let n =
|
|
535
|
+
let n = Pt(String(e), t), r = Number(n);
|
|
536
536
|
return Number.isFinite(r) ? r : e;
|
|
537
537
|
}
|
|
538
538
|
if (typeof e == "string") {
|
|
@@ -544,11 +544,11 @@ function Ft(e, t) {
|
|
|
544
544
|
break;
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
return !n || o(e) === void 0 ? e :
|
|
547
|
+
return !n || o(e) === void 0 ? e : Pt(e, t);
|
|
548
548
|
}
|
|
549
549
|
return e;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Pt(e, t) {
|
|
552
552
|
let n = e.trim();
|
|
553
553
|
if (!n) return e;
|
|
554
554
|
let r = 0, i = "", a = n.charCodeAt(0);
|
|
@@ -562,7 +562,7 @@ function It(e, t) {
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
let s = o === -1 ? n.length : o, c = o === -1 ? "" : n.slice(o), l = n.slice(r, s);
|
|
565
|
-
l =
|
|
565
|
+
l = g(l), l.length === 0 && (l = "0");
|
|
566
566
|
let u = t | 0;
|
|
567
567
|
if (u <= 0) {
|
|
568
568
|
let e = 0;
|
|
@@ -575,123 +575,27 @@ function It(e, t) {
|
|
|
575
575
|
return i + l + c;
|
|
576
576
|
}
|
|
577
577
|
//#endregion
|
|
578
|
-
//#region src/formatters/pipeline/clone.ts
|
|
579
|
-
function H(e) {
|
|
580
|
-
return e ? { ...e } : void 0;
|
|
581
|
-
}
|
|
582
|
-
function U(e) {
|
|
583
|
-
return e ? { ...e } : void 0;
|
|
584
|
-
}
|
|
585
|
-
function W(e) {
|
|
586
|
-
return e.mode === "formula" ? {
|
|
587
|
-
...e,
|
|
588
|
-
dependencyIds: e.dependencyIds ? [...e.dependencyIds] : void 0
|
|
589
|
-
} : { ...e };
|
|
590
|
-
}
|
|
591
|
-
function G(e) {
|
|
592
|
-
return {
|
|
593
|
-
resolver: e.resolver.kind === "fixed" ? {
|
|
594
|
-
kind: "fixed",
|
|
595
|
-
entries: { ...e.resolver.entries },
|
|
596
|
-
fallbackState: e.resolver.fallbackState
|
|
597
|
-
} : {
|
|
598
|
-
kind: "threshold",
|
|
599
|
-
thresholds: e.resolver.thresholds.map((e) => typeof e == "number" ? e : { ...e }),
|
|
600
|
-
states: [...e.resolver.states],
|
|
601
|
-
invalidState: e.resolver.invalidState
|
|
602
|
-
},
|
|
603
|
-
icon: e.icon ? { ...e.icon } : void 0
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
function Lt(e) {
|
|
607
|
-
switch (e.type) {
|
|
608
|
-
case "typedValueFormat": return {
|
|
609
|
-
...e,
|
|
610
|
-
config: H(e.config)
|
|
611
|
-
};
|
|
612
|
-
case "normalizeLeadingZeros": return {
|
|
613
|
-
...e,
|
|
614
|
-
config: U(e.config)
|
|
615
|
-
};
|
|
616
|
-
case "rowBasedOverride": return {
|
|
617
|
-
...e,
|
|
618
|
-
config: W(e.config)
|
|
619
|
-
};
|
|
620
|
-
case "resolveValueState": return {
|
|
621
|
-
...e,
|
|
622
|
-
config: G(e.config)
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
throw Error(`Недопустимый тип '${e?.type}' для шага FormatterPipeline`);
|
|
626
|
-
}
|
|
627
|
-
function Rt(e, t) {
|
|
628
|
-
switch (e.type) {
|
|
629
|
-
case "typedValueFormat": return {
|
|
630
|
-
...e,
|
|
631
|
-
position: { ...t },
|
|
632
|
-
config: H(e.config)
|
|
633
|
-
};
|
|
634
|
-
case "normalizeLeadingZeros": return {
|
|
635
|
-
...e,
|
|
636
|
-
position: { ...t },
|
|
637
|
-
config: U(e.config)
|
|
638
|
-
};
|
|
639
|
-
case "rowBasedOverride": return {
|
|
640
|
-
...e,
|
|
641
|
-
position: { ...t },
|
|
642
|
-
config: W(e.config)
|
|
643
|
-
};
|
|
644
|
-
case "resolveValueState": return {
|
|
645
|
-
...e,
|
|
646
|
-
position: { ...t },
|
|
647
|
-
config: G(e.config)
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
throw Error(`Недопустимый тип '${e?.type}' для шага FormatterPipeline`);
|
|
651
|
-
}
|
|
652
|
-
function zt(e) {
|
|
653
|
-
switch (e.type) {
|
|
654
|
-
case "source":
|
|
655
|
-
case "sink": return {
|
|
656
|
-
...e,
|
|
657
|
-
position: { ...e.position }
|
|
658
|
-
};
|
|
659
|
-
default: return Rt(e, e.position);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
function Bt(e) {
|
|
663
|
-
return {
|
|
664
|
-
nodes: e.nodes.map(zt),
|
|
665
|
-
edges: e.edges.map((e) => ({ ...e })),
|
|
666
|
-
viewport: e.viewport ? { ...e.viewport } : void 0
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
function Vt(e) {
|
|
670
|
-
return { steps: e.steps.map(Lt) };
|
|
671
|
-
}
|
|
672
|
-
function Ht(e) {
|
|
673
|
-
if (e) return {
|
|
674
|
-
version: e.version,
|
|
675
|
-
graph: e.graph ? Bt(e.graph) : void 0,
|
|
676
|
-
plan: e.plan ? Vt(e.plan) : void 0
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
//#endregion
|
|
680
578
|
//#region src/formatters/pipeline/dependencies.ts
|
|
681
|
-
function
|
|
682
|
-
let n =
|
|
579
|
+
function Ft(e) {
|
|
580
|
+
let n = h(e);
|
|
683
581
|
if (!n.ok || !n.plan) return [];
|
|
684
582
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
685
|
-
for (let e of n.plan.steps)
|
|
686
|
-
if (e.config.
|
|
687
|
-
t(r, i,
|
|
583
|
+
for (let e of n.plan.steps) {
|
|
584
|
+
if (e.type === "resolveValueState" && e.config.valueSource?.kind === "formula") {
|
|
585
|
+
for (let n of e.config.valueSource.dependencyIds) t(r, i, n);
|
|
688
586
|
continue;
|
|
689
587
|
}
|
|
690
|
-
|
|
588
|
+
if (e.type === "rowBasedOverride") {
|
|
589
|
+
if (e.config.mode === "field") {
|
|
590
|
+
t(r, i, e.config.fieldKey);
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
for (let n of e.config.dependencyIds ?? []) t(r, i, n);
|
|
594
|
+
}
|
|
691
595
|
}
|
|
692
596
|
return r;
|
|
693
597
|
}
|
|
694
|
-
function
|
|
598
|
+
function It(e, n) {
|
|
695
599
|
let r = [], i = [], a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
696
600
|
let s = e?.trim();
|
|
697
601
|
if (s) {
|
|
@@ -706,7 +610,7 @@ function Wt(e, n) {
|
|
|
706
610
|
let e = n[t];
|
|
707
611
|
if (e) {
|
|
708
612
|
for (let t of Object.values(e.cellRenderer?.bindings ?? {})) s(t);
|
|
709
|
-
for (let t of
|
|
613
|
+
for (let t of Ft(e.formattersPipeline)) s(t);
|
|
710
614
|
}
|
|
711
615
|
}
|
|
712
616
|
return {
|
|
@@ -717,7 +621,7 @@ function Wt(e, n) {
|
|
|
717
621
|
//#endregion
|
|
718
622
|
//#region src/formatters/valueState/valueStateRegistry.ts
|
|
719
623
|
var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map();
|
|
720
|
-
function
|
|
624
|
+
function Lt(e) {
|
|
721
625
|
let t = 5381;
|
|
722
626
|
for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n) >>> 0;
|
|
723
627
|
return "id_" + t.toString(36);
|
|
@@ -728,7 +632,7 @@ function J(e, t) {
|
|
|
728
632
|
id: n,
|
|
729
633
|
isNew: !1
|
|
730
634
|
};
|
|
731
|
-
let r =
|
|
635
|
+
let r = Lt(e), i = t();
|
|
732
636
|
return K.set(r, i), q.set(e, r), {
|
|
733
637
|
id: r,
|
|
734
638
|
isNew: !0
|
|
@@ -738,25 +642,25 @@ function Y(e) {
|
|
|
738
642
|
let t = q.get(e);
|
|
739
643
|
if (t) return K.get(t);
|
|
740
644
|
}
|
|
741
|
-
function
|
|
645
|
+
function X(e, t) {
|
|
742
646
|
let n = K.get(e);
|
|
743
647
|
return n ? n(t) : "none";
|
|
744
648
|
}
|
|
745
|
-
function
|
|
649
|
+
function Rt(e) {
|
|
746
650
|
return K.get(e);
|
|
747
651
|
}
|
|
748
|
-
function
|
|
652
|
+
function zt() {
|
|
749
653
|
return Array.from(K.keys());
|
|
750
654
|
}
|
|
751
|
-
function
|
|
655
|
+
function Bt() {
|
|
752
656
|
K.clear(), q.clear();
|
|
753
657
|
}
|
|
754
658
|
//#endregion
|
|
755
659
|
//#region src/formatters/valueState/fixedValueStateResolver.ts
|
|
756
|
-
function
|
|
660
|
+
function Vt(e, t) {
|
|
757
661
|
return `fixed|${e.map(([e, t]) => `${e}:${t}`).join(",")}|${t}`;
|
|
758
662
|
}
|
|
759
|
-
function
|
|
663
|
+
function Ht(e, t) {
|
|
760
664
|
let n = new Map(Object.entries(e));
|
|
761
665
|
return (e) => {
|
|
762
666
|
if (e == null) return t;
|
|
@@ -764,25 +668,25 @@ function Zt(e, t) {
|
|
|
764
668
|
return n.get(r) ?? t;
|
|
765
669
|
};
|
|
766
670
|
}
|
|
767
|
-
function
|
|
768
|
-
let t = e.fallbackState ?? "none", n =
|
|
671
|
+
function Ut(e) {
|
|
672
|
+
let t = e.fallbackState ?? "none", n = Vt(Object.entries(e.entries).sort(([e], [t]) => oe(e, t)), t);
|
|
769
673
|
return {
|
|
770
674
|
entries: e.entries,
|
|
771
675
|
fallbackState: t,
|
|
772
676
|
canonicalKey: n
|
|
773
677
|
};
|
|
774
678
|
}
|
|
775
|
-
function
|
|
776
|
-
let { entries: t, fallbackState: n, canonicalKey: r } =
|
|
679
|
+
function Wt(e) {
|
|
680
|
+
let { entries: t, fallbackState: n, canonicalKey: r } = Ut(e), { id: i } = J(r, () => Ht(t, n));
|
|
777
681
|
return i;
|
|
778
682
|
}
|
|
779
|
-
function
|
|
780
|
-
let { entries: t, fallbackState: n, canonicalKey: r } =
|
|
781
|
-
return Y(r) || (J(r, () =>
|
|
683
|
+
function Gt(e) {
|
|
684
|
+
let { entries: t, fallbackState: n, canonicalKey: r } = Ut(e);
|
|
685
|
+
return Y(r) || (J(r, () => Ht(t, n)), Y(r));
|
|
782
686
|
}
|
|
783
687
|
//#endregion
|
|
784
688
|
//#region src/formatters/valueState/thresholdValueStateResolver.ts
|
|
785
|
-
function
|
|
689
|
+
function Kt(e) {
|
|
786
690
|
return typeof e == "number" ? {
|
|
787
691
|
value: e,
|
|
788
692
|
boundary: "upper"
|
|
@@ -791,15 +695,15 @@ function tn(e) {
|
|
|
791
695
|
boundary: e.boundary ?? "upper"
|
|
792
696
|
};
|
|
793
697
|
}
|
|
794
|
-
function
|
|
698
|
+
function qt(e, t, n) {
|
|
795
699
|
return `threshold|${e.map((e) => `${e.value}:${e.boundary}`).join(",")}|${t.join(",")}|${n}`;
|
|
796
700
|
}
|
|
797
|
-
function
|
|
701
|
+
function Jt(e, t) {
|
|
798
702
|
if (t.length !== e.length + 1) throw Error(`Количество состояний (${t.length}) должно быть равно количеству порогов + 1 (${e.length + 1})`);
|
|
799
703
|
let n = /* @__PURE__ */ new Set();
|
|
800
704
|
for (let t of e) n.has(t.value) && console.warn(`Дублирующееся пороговое значение: ${t.value}`), n.add(t.value);
|
|
801
705
|
}
|
|
802
|
-
function
|
|
706
|
+
function Yt(e, t, n) {
|
|
803
707
|
let r = e.map((e) => e.value), i = e.map((e) => e.boundary === "lower"), a = [...t];
|
|
804
708
|
return (e) => {
|
|
805
709
|
if (e === "" || e == null) return n;
|
|
@@ -809,46 +713,46 @@ function an(e, t, n) {
|
|
|
809
713
|
return a[a.length - 1];
|
|
810
714
|
};
|
|
811
715
|
}
|
|
812
|
-
function
|
|
813
|
-
let t = e.invalidState ?? "none", n = e.thresholds.map(
|
|
814
|
-
return
|
|
716
|
+
function Xt(e) {
|
|
717
|
+
let t = e.invalidState ?? "none", n = e.thresholds.map(Kt).sort((e, t) => e.value - t.value);
|
|
718
|
+
return Jt(n, e.states), {
|
|
815
719
|
sortedThresholds: n,
|
|
816
720
|
invalidState: t,
|
|
817
|
-
canonicalKey:
|
|
721
|
+
canonicalKey: qt(n, e.states, t),
|
|
818
722
|
states: e.states
|
|
819
723
|
};
|
|
820
724
|
}
|
|
821
|
-
function
|
|
822
|
-
let { sortedThresholds: t, invalidState: n, canonicalKey: r, states: i } =
|
|
725
|
+
function Zt(e) {
|
|
726
|
+
let { sortedThresholds: t, invalidState: n, canonicalKey: r, states: i } = Xt(e), { id: a } = J(r, () => Yt(t, i, n));
|
|
823
727
|
return a;
|
|
824
728
|
}
|
|
825
|
-
function
|
|
826
|
-
let { sortedThresholds: t, invalidState: n, canonicalKey: r, states: i } =
|
|
827
|
-
return Y(r) || (J(r, () =>
|
|
729
|
+
function Qt(e) {
|
|
730
|
+
let { sortedThresholds: t, invalidState: n, canonicalKey: r, states: i } = Xt(e);
|
|
731
|
+
return Y(r) || (J(r, () => Yt(t, i, n)), Y(r));
|
|
828
732
|
}
|
|
829
733
|
//#endregion
|
|
830
734
|
//#region src/formatters/pipeline/execute.ts
|
|
831
|
-
var
|
|
735
|
+
var $t = Object.freeze({
|
|
832
736
|
number: "decimal",
|
|
833
737
|
date: "date"
|
|
834
738
|
});
|
|
835
|
-
function
|
|
836
|
-
if (!
|
|
739
|
+
function Z(e, t, r) {
|
|
740
|
+
if (!se(e)) return "";
|
|
837
741
|
let i = c(t.type);
|
|
838
742
|
if (i === "number") {
|
|
839
743
|
let t = r?.numberPresetName?.trim();
|
|
840
|
-
return
|
|
744
|
+
return G(e, t && ie(t) ? t : $t.number);
|
|
841
745
|
}
|
|
842
746
|
if (i === "date") {
|
|
843
|
-
let t = r?.datePresetName?.trim(), n = t && s(t) ? t :
|
|
747
|
+
let t = r?.datePresetName?.trim(), n = t && s(t) ? t : $t.date;
|
|
844
748
|
return a(l(e), n);
|
|
845
749
|
}
|
|
846
750
|
return n(e);
|
|
847
751
|
}
|
|
848
|
-
function
|
|
752
|
+
function en(e) {
|
|
849
753
|
if (e === "success" || e === "warning" || e === "error" || e === "information") return e;
|
|
850
754
|
}
|
|
851
|
-
function
|
|
755
|
+
function tn(e, t) {
|
|
852
756
|
switch (e.rowKind) {
|
|
853
757
|
case "group":
|
|
854
758
|
case "plain":
|
|
@@ -856,24 +760,35 @@ function dn(e, t) {
|
|
|
856
760
|
case "totals": return t === "formula";
|
|
857
761
|
}
|
|
858
762
|
}
|
|
859
|
-
function
|
|
860
|
-
let t =
|
|
861
|
-
if (!t.ok || !t.plan) return t.errors.some((e) => e.code === "
|
|
763
|
+
function nn(e) {
|
|
764
|
+
let t = h(e.config);
|
|
765
|
+
if (!t.ok || !t.plan) return t.errors.some((e) => e.code === "step_value_state_formula_not_found") ? {
|
|
766
|
+
ok: !1,
|
|
767
|
+
reason: "value_state_formula_not_found"
|
|
768
|
+
} : t.errors.some((e) => e.code === "step_row_based_override_formula_not_found") ? {
|
|
862
769
|
ok: !1,
|
|
863
770
|
reason: "row_based_formula_not_found"
|
|
864
771
|
} : {
|
|
865
772
|
ok: !1,
|
|
866
773
|
reason: "pipeline_invalid"
|
|
867
774
|
};
|
|
868
|
-
let { steps: n } = t.plan, r = n.some((e) => e.type === "rowBasedOverride"), i = n.some((e) => e.type === "typedValueFormat"), a = n.find((e) => e.type === "resolveValueState"), o = a?.config.
|
|
775
|
+
let { steps: n } = t.plan, r = n.some((e) => e.type === "rowBasedOverride"), i = n.some((e) => e.type === "typedValueFormat"), a = n.find((e) => e.type === "resolveValueState"), o = a?.config.valueSource, s = o?.kind === "formula" ? ae({
|
|
776
|
+
formulaId: o.formulaId,
|
|
777
|
+
keys: o.dependencyIds
|
|
778
|
+
}) : void 0;
|
|
779
|
+
if (s && !s.ok) return {
|
|
780
|
+
ok: !1,
|
|
781
|
+
reason: "value_state_formula_not_found"
|
|
782
|
+
};
|
|
783
|
+
let c = a?.config.resolver.kind === "fixed" ? Wt({
|
|
869
784
|
entries: a.config.resolver.entries,
|
|
870
785
|
fallbackState: a.config.resolver.fallbackState
|
|
871
|
-
}) : a?.config.resolver.kind === "threshold" ?
|
|
786
|
+
}) : a?.config.resolver.kind === "threshold" ? Zt({
|
|
872
787
|
thresholds: a.config.resolver.thresholds,
|
|
873
788
|
states: a.config.resolver.states,
|
|
874
789
|
invalidState: a.config.resolver.invalidState
|
|
875
|
-
}) : void 0,
|
|
876
|
-
return
|
|
790
|
+
}) : void 0, l = n.find((e) => e.type === "rowBasedOverride"), u = l?.config.mode === "formula" ? ne(l.config.formulaId) : void 0;
|
|
791
|
+
return l?.config.mode === "formula" && !u ? {
|
|
877
792
|
ok: !1,
|
|
878
793
|
reason: "row_based_formula_not_found"
|
|
879
794
|
} : {
|
|
@@ -882,22 +797,22 @@ function fn(e) {
|
|
|
882
797
|
hasRowBasedOverride: r,
|
|
883
798
|
hasTypedValueFormat: i,
|
|
884
799
|
execute: (t) => {
|
|
885
|
-
let r = t.value, a = "none",
|
|
800
|
+
let r = t.value, a = "none", l = !1, d = !0, f = "left", p;
|
|
886
801
|
for (let i of n) switch (i.type) {
|
|
887
802
|
case "normalizeLeadingZeros":
|
|
888
|
-
r =
|
|
803
|
+
r = Mt(r, i.config?.fixed);
|
|
889
804
|
break;
|
|
890
805
|
case "rowBasedOverride":
|
|
891
|
-
if (!
|
|
806
|
+
if (!tn(t, i.config.mode)) break;
|
|
892
807
|
if (i.config.mode === "field") {
|
|
893
808
|
let e = t.rowData[i.config.fieldKey];
|
|
894
809
|
if (e == null && i.config.fallbackToRaw !== !1) break;
|
|
895
810
|
r = e;
|
|
896
811
|
break;
|
|
897
812
|
}
|
|
898
|
-
if (!
|
|
813
|
+
if (!u) break;
|
|
899
814
|
try {
|
|
900
|
-
let e =
|
|
815
|
+
let e = u.fn(ee({
|
|
901
816
|
rowData: t.rowData,
|
|
902
817
|
rawValue: r,
|
|
903
818
|
columnId: t.columnId,
|
|
@@ -910,18 +825,22 @@ function fn(e) {
|
|
|
910
825
|
}
|
|
911
826
|
break;
|
|
912
827
|
case "resolveValueState":
|
|
913
|
-
if (!
|
|
914
|
-
|
|
828
|
+
if (!c) break;
|
|
829
|
+
if (o?.kind === "formula") {
|
|
830
|
+
let e = t.valueStateFormulaRowData ?? t.rowData, n = o.dependencyIds.every((t) => Object.hasOwn(e, t) && e[t] != null && (typeof e[t] != "string" || e[t].trim() !== "")) && s?.ok ? s.execute(e) : void 0;
|
|
831
|
+
a = n?.ok ? X(c, n.value) : "none";
|
|
832
|
+
} else a = X(c, r);
|
|
833
|
+
l = i.config.icon?.enabled ?? !1, d = i.config.icon?.showValue ?? !0, f = i.config.icon?.position ?? "left", p = l ? en(a) : void 0, o?.kind === "formula" && a === "none" && (l = !1);
|
|
915
834
|
break;
|
|
916
|
-
case "typedValueFormat": r =
|
|
835
|
+
case "typedValueFormat": r = Z(r, e.column, i.config);
|
|
917
836
|
}
|
|
918
837
|
return {
|
|
919
838
|
value: r,
|
|
920
839
|
state: a,
|
|
921
|
-
icon:
|
|
922
|
-
showIcon:
|
|
923
|
-
showValue:
|
|
924
|
-
iconPosition:
|
|
840
|
+
icon: p,
|
|
841
|
+
showIcon: l,
|
|
842
|
+
showValue: d,
|
|
843
|
+
iconPosition: f,
|
|
925
844
|
hasTypedValueFormat: i
|
|
926
845
|
};
|
|
927
846
|
}
|
|
@@ -930,7 +849,7 @@ function fn(e) {
|
|
|
930
849
|
}
|
|
931
850
|
//#endregion
|
|
932
851
|
//#region src/formatters/pipeline/normalize.ts
|
|
933
|
-
var
|
|
852
|
+
var rn = [
|
|
934
853
|
"",
|
|
935
854
|
"none",
|
|
936
855
|
"information",
|
|
@@ -938,56 +857,56 @@ var pn = [
|
|
|
938
857
|
"warning",
|
|
939
858
|
"error"
|
|
940
859
|
];
|
|
941
|
-
function Z(e) {
|
|
942
|
-
return typeof e == "string" && pn.some((t) => t === e);
|
|
943
|
-
}
|
|
944
860
|
function Q(e) {
|
|
861
|
+
return typeof e == "string" && rn.some((t) => t === e);
|
|
862
|
+
}
|
|
863
|
+
function $(e) {
|
|
945
864
|
return e === void 0 || typeof e == "boolean";
|
|
946
865
|
}
|
|
947
|
-
function
|
|
866
|
+
function an(e) {
|
|
948
867
|
return e === void 0 || typeof e == "string";
|
|
949
868
|
}
|
|
950
|
-
function
|
|
951
|
-
return e === void 0 ? !0 : r(e) ?
|
|
869
|
+
function on(e) {
|
|
870
|
+
return e === void 0 ? !0 : r(e) ? an(e.numberPresetName) && an(e.datePresetName) : !1;
|
|
952
871
|
}
|
|
953
|
-
function
|
|
954
|
-
return r(e) ? e.mode === "field" ? typeof e.fieldKey == "string" &&
|
|
872
|
+
function sn(e) {
|
|
873
|
+
return r(e) ? e.mode === "field" ? typeof e.fieldKey == "string" && $(e.fallbackToRaw) : e.mode === "formula" && typeof e.formulaId == "string" && (e.dependencyIds === void 0 || Array.isArray(e.dependencyIds) && e.dependencyIds.every((e) => typeof e == "string")) && $(e.fallbackToRaw) : !1;
|
|
955
874
|
}
|
|
956
|
-
function
|
|
875
|
+
function cn(e) {
|
|
957
876
|
return typeof e == "number" || r(e) && typeof e.value == "number" && (e.boundary === void 0 || e.boundary === "lower" || e.boundary === "upper");
|
|
958
877
|
}
|
|
959
|
-
function
|
|
878
|
+
function ln(e) {
|
|
960
879
|
if (!r(e) || !r(e.resolver)) return !1;
|
|
961
|
-
let { resolver: t, icon: n } = e;
|
|
962
|
-
return n === void 0 || r(n) &&
|
|
880
|
+
let { resolver: t, icon: n } = e, i = e.valueSource, a = i === void 0 || r(i) && (i.kind === "value" || i.kind === "formula" && typeof i.formulaId == "string" && Array.isArray(i.dependencyIds) && i.dependencyIds.every((e) => typeof e == "string"));
|
|
881
|
+
return !(n === void 0 || r(n) && $(n.enabled) && $(n.showValue) && (n.position === void 0 || n.position === "left" || n.position === "right")) || !a ? !1 : t.kind === "fixed" ? r(t.entries) && Object.values(t.entries).every(Q) && (t.fallbackState === void 0 || Q(t.fallbackState)) : t.kind === "threshold" && Array.isArray(t.thresholds) && t.thresholds.every(cn) && Array.isArray(t.states) && t.states.every(Q) && (t.invalidState === void 0 || Q(t.invalidState));
|
|
963
882
|
}
|
|
964
|
-
function
|
|
965
|
-
return !r(e) || typeof e.id != "string" ? !1 : e.type === "normalizeLeadingZeros" ? e.config === void 0 || r(e.config) && (e.config.fixed === void 0 || typeof e.config.fixed == "number") : e.type === "rowBasedOverride" ?
|
|
883
|
+
function un(e) {
|
|
884
|
+
return !r(e) || typeof e.id != "string" ? !1 : e.type === "normalizeLeadingZeros" ? e.config === void 0 || r(e.config) && (e.config.fixed === void 0 || typeof e.config.fixed == "number") : e.type === "rowBasedOverride" ? sn(e.config) : e.type === "resolveValueState" ? ln(e.config) : e.type === "typedValueFormat" && on(e.config);
|
|
966
885
|
}
|
|
967
|
-
function
|
|
968
|
-
return r(e) && Array.isArray(e.steps) && e.steps.every(
|
|
886
|
+
function dn(e) {
|
|
887
|
+
return r(e) && Array.isArray(e.steps) && e.steps.every(un);
|
|
969
888
|
}
|
|
970
|
-
function
|
|
889
|
+
function fn(e) {
|
|
971
890
|
return r(e) && typeof e.x == "number" && typeof e.y == "number";
|
|
972
891
|
}
|
|
973
|
-
function
|
|
974
|
-
return !r(e) || typeof e.id != "string" || !
|
|
892
|
+
function pn(e) {
|
|
893
|
+
return !r(e) || typeof e.id != "string" || !fn(e.position) ? !1 : e.type === "source" || e.type === "sink" || un(e);
|
|
975
894
|
}
|
|
976
|
-
function
|
|
895
|
+
function mn(e) {
|
|
977
896
|
return r(e) && typeof e.id == "string" && typeof e.source == "string" && typeof e.target == "string";
|
|
978
897
|
}
|
|
979
|
-
function
|
|
980
|
-
return r(e) && Array.isArray(e.nodes) && e.nodes.every(
|
|
898
|
+
function hn(e) {
|
|
899
|
+
return r(e) && Array.isArray(e.nodes) && e.nodes.every(pn) && Array.isArray(e.edges) && e.edges.every(mn);
|
|
981
900
|
}
|
|
982
|
-
function
|
|
983
|
-
return r(e) && e.version === 1 && (e.plan === void 0 ||
|
|
901
|
+
function gn(e) {
|
|
902
|
+
return r(e) && e.version === 1 && (e.plan === void 0 || dn(e.plan)) && (e.graph === void 0 || hn(e.graph)) && (dn(e.plan) || hn(e.graph));
|
|
984
903
|
}
|
|
985
|
-
function
|
|
986
|
-
if (
|
|
904
|
+
function _n(e) {
|
|
905
|
+
if (gn(e) && h(e).ok) return p(e);
|
|
987
906
|
}
|
|
988
907
|
//#endregion
|
|
989
908
|
//#region src/formatters/pipeline/definitions.ts
|
|
990
|
-
var
|
|
909
|
+
var vn = Object.freeze([
|
|
991
910
|
{
|
|
992
911
|
id: "normalizeLeadingZeros",
|
|
993
912
|
name: "Нормализация ведущих нулей",
|
|
@@ -1008,19 +927,19 @@ var En = Object.freeze([
|
|
|
1008
927
|
name: "Типизированное форматирование",
|
|
1009
928
|
description: "Формирует итоговый внешний вид значения по типу и роли столбца."
|
|
1010
929
|
}
|
|
1011
|
-
]),
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
930
|
+
]), yn = new Map(vn.map((e) => [e.id, e]));
|
|
931
|
+
function bn() {
|
|
932
|
+
return vn;
|
|
1014
933
|
}
|
|
1015
|
-
function
|
|
1016
|
-
return
|
|
934
|
+
function xn(e) {
|
|
935
|
+
return yn.get(e);
|
|
1017
936
|
}
|
|
1018
937
|
//#endregion
|
|
1019
938
|
//#region src/formatters/pipeline/rekey.ts
|
|
1020
|
-
function
|
|
939
|
+
function Sn(e) {
|
|
1021
940
|
return e.type === "source" || e.type === "sink";
|
|
1022
941
|
}
|
|
1023
|
-
function
|
|
942
|
+
function Cn(e, t) {
|
|
1024
943
|
switch (e.type) {
|
|
1025
944
|
case "source":
|
|
1026
945
|
case "sink": return {
|
|
@@ -1053,37 +972,25 @@ function jn(e, t) {
|
|
|
1053
972
|
...e,
|
|
1054
973
|
id: t,
|
|
1055
974
|
position: { ...e.position },
|
|
1056
|
-
config:
|
|
1057
|
-
resolver: e.config.resolver.kind === "fixed" ? {
|
|
1058
|
-
kind: "fixed",
|
|
1059
|
-
entries: { ...e.config.resolver.entries },
|
|
1060
|
-
fallbackState: e.config.resolver.fallbackState
|
|
1061
|
-
} : {
|
|
1062
|
-
kind: "threshold",
|
|
1063
|
-
thresholds: e.config.resolver.thresholds.map((e) => typeof e == "number" ? e : { ...e }),
|
|
1064
|
-
states: [...e.config.resolver.states],
|
|
1065
|
-
invalidState: e.config.resolver.invalidState
|
|
1066
|
-
},
|
|
1067
|
-
icon: e.config.icon ? { ...e.config.icon } : void 0
|
|
1068
|
-
}
|
|
975
|
+
config: re(e.config)
|
|
1069
976
|
};
|
|
1070
977
|
}
|
|
1071
978
|
}
|
|
1072
|
-
function
|
|
979
|
+
function wn(e, t) {
|
|
1073
980
|
let n = /* @__PURE__ */ new Map();
|
|
1074
|
-
for (let r of e.nodes) n.set(r.id,
|
|
981
|
+
for (let r of e.nodes) n.set(r.id, Sn(r) ? r.id : t());
|
|
1075
982
|
let r = e.edges.map((e) => ({
|
|
1076
983
|
id: t(),
|
|
1077
984
|
source: n.get(e.source) ?? e.source,
|
|
1078
985
|
target: n.get(e.target) ?? e.target
|
|
1079
986
|
}));
|
|
1080
987
|
return {
|
|
1081
|
-
nodes: e.nodes.map((e) =>
|
|
988
|
+
nodes: e.nodes.map((e) => Cn(e, n.get(e.id) ?? e.id)),
|
|
1082
989
|
edges: r,
|
|
1083
990
|
viewport: e.viewport ? { ...e.viewport } : void 0
|
|
1084
991
|
};
|
|
1085
992
|
}
|
|
1086
|
-
function
|
|
993
|
+
function Tn(e, t) {
|
|
1087
994
|
return { steps: e.steps.map((e) => {
|
|
1088
995
|
switch (e.type) {
|
|
1089
996
|
case "typedValueFormat": return {
|
|
@@ -1107,39 +1014,27 @@ function Nn(e, t) {
|
|
|
1107
1014
|
case "resolveValueState": return {
|
|
1108
1015
|
...e,
|
|
1109
1016
|
id: t(),
|
|
1110
|
-
config:
|
|
1111
|
-
resolver: e.config.resolver.kind === "fixed" ? {
|
|
1112
|
-
kind: "fixed",
|
|
1113
|
-
entries: { ...e.config.resolver.entries },
|
|
1114
|
-
fallbackState: e.config.resolver.fallbackState
|
|
1115
|
-
} : {
|
|
1116
|
-
kind: "threshold",
|
|
1117
|
-
thresholds: e.config.resolver.thresholds.map((e) => typeof e == "number" ? e : { ...e }),
|
|
1118
|
-
states: [...e.config.resolver.states],
|
|
1119
|
-
invalidState: e.config.resolver.invalidState
|
|
1120
|
-
},
|
|
1121
|
-
icon: e.config.icon ? { ...e.config.icon } : void 0
|
|
1122
|
-
}
|
|
1017
|
+
config: re(e.config)
|
|
1123
1018
|
};
|
|
1124
1019
|
}
|
|
1125
1020
|
}) };
|
|
1126
1021
|
}
|
|
1127
|
-
function
|
|
1022
|
+
function En(e, t = i) {
|
|
1128
1023
|
if (!e) return;
|
|
1129
|
-
let n = e.graph ?
|
|
1024
|
+
let n = e.graph ? wn(e.graph, t) : void 0, r = n ? te(n) : void 0;
|
|
1130
1025
|
return {
|
|
1131
1026
|
version: e.version,
|
|
1132
1027
|
graph: n,
|
|
1133
|
-
plan: r?.ok && r.plan ? r.plan : e.plan ?
|
|
1028
|
+
plan: r?.ok && r.plan ? r.plan : e.plan ? Tn(e.plan, t) : void 0
|
|
1134
1029
|
};
|
|
1135
1030
|
}
|
|
1136
1031
|
//#endregion
|
|
1137
1032
|
//#region src/formatters/pipeline/runtime.ts
|
|
1138
|
-
var
|
|
1033
|
+
var Dn = () => ({
|
|
1139
1034
|
ok: !1,
|
|
1140
1035
|
reason: "formula_not_found"
|
|
1141
1036
|
});
|
|
1142
|
-
function
|
|
1037
|
+
function On(e, t) {
|
|
1143
1038
|
return {
|
|
1144
1039
|
value: e,
|
|
1145
1040
|
state: "none",
|
|
@@ -1149,18 +1044,18 @@ function In(e, t) {
|
|
|
1149
1044
|
overflowTooltip: t
|
|
1150
1045
|
};
|
|
1151
1046
|
}
|
|
1152
|
-
function
|
|
1153
|
-
return t ?
|
|
1047
|
+
function kn(e, t) {
|
|
1048
|
+
return t ? Z(e, t) : n(e);
|
|
1154
1049
|
}
|
|
1155
|
-
function
|
|
1050
|
+
function An(e) {
|
|
1156
1051
|
if (!e.formulaId) return;
|
|
1157
|
-
let t =
|
|
1052
|
+
let t = ae({
|
|
1158
1053
|
formulaId: e.formulaId,
|
|
1159
1054
|
keys: e.formulaDependencies
|
|
1160
1055
|
});
|
|
1161
|
-
return t.ok ? t.execute :
|
|
1056
|
+
return t.ok ? t.execute : Dn;
|
|
1162
1057
|
}
|
|
1163
|
-
function
|
|
1058
|
+
function jn(e, t, n) {
|
|
1164
1059
|
if (!n.formulaId) return {
|
|
1165
1060
|
value: e,
|
|
1166
1061
|
shouldRenderEmpty: !1
|
|
@@ -1178,12 +1073,13 @@ function zn(e, t, n) {
|
|
|
1178
1073
|
shouldRenderEmpty: n.purelyDerived === !0
|
|
1179
1074
|
};
|
|
1180
1075
|
}
|
|
1181
|
-
function
|
|
1076
|
+
function Mn(e, t, n) {
|
|
1182
1077
|
let r = n.formattersPipelineExecutor;
|
|
1183
|
-
if (!r) return
|
|
1078
|
+
if (!r) return On(kn(t, n), n.overflowTooltip === !0);
|
|
1184
1079
|
let i = r.execute({
|
|
1185
1080
|
value: t,
|
|
1186
1081
|
rowData: e.rowData,
|
|
1082
|
+
valueStateFormulaRowData: e.valueStateFormulaRowData,
|
|
1187
1083
|
rowKind: e.rowKind,
|
|
1188
1084
|
isGroupRow: e.rowKind === "group",
|
|
1189
1085
|
isTotalsRow: e.rowKind === "totals",
|
|
@@ -1192,7 +1088,7 @@ function Bn(e, t, n) {
|
|
|
1192
1088
|
columnId: n.id
|
|
1193
1089
|
});
|
|
1194
1090
|
return {
|
|
1195
|
-
value: i.hasTypedValueFormat ? i.value :
|
|
1091
|
+
value: i.hasTypedValueFormat ? i.value : kn(i.value, n),
|
|
1196
1092
|
state: i.state,
|
|
1197
1093
|
icon: i.icon,
|
|
1198
1094
|
showIcon: i.showIcon,
|
|
@@ -1201,40 +1097,40 @@ function Bn(e, t, n) {
|
|
|
1201
1097
|
overflowTooltip: n.overflowTooltip === !0
|
|
1202
1098
|
};
|
|
1203
1099
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return t.shouldRenderEmpty || n.emptyWhenZero &&
|
|
1100
|
+
function Nn(e, t, n) {
|
|
1101
|
+
return t.shouldRenderEmpty || n.emptyWhenZero && V(t.value) ? {
|
|
1206
1102
|
...e,
|
|
1207
1103
|
value: ""
|
|
1208
1104
|
} : e;
|
|
1209
1105
|
}
|
|
1210
|
-
function
|
|
1211
|
-
let t =
|
|
1106
|
+
function Pn(e) {
|
|
1107
|
+
let t = An(e);
|
|
1212
1108
|
if (t ? e.formulaExecutor = t : delete e.formulaExecutor, !e.formattersPipeline) return delete e.formattersPipelineExecutor, e;
|
|
1213
|
-
let n =
|
|
1109
|
+
let n = nn({
|
|
1214
1110
|
config: e.formattersPipeline,
|
|
1215
1111
|
column: e
|
|
1216
1112
|
});
|
|
1217
1113
|
return n.ok ? e.formattersPipelineExecutor = n.executor : delete e.formattersPipelineExecutor, e;
|
|
1218
1114
|
}
|
|
1219
|
-
function
|
|
1115
|
+
function Fn(e) {
|
|
1220
1116
|
let t = {};
|
|
1221
|
-
for (let [n, r] of Object.entries(e)) r && (t[n] =
|
|
1117
|
+
for (let [n, r] of Object.entries(e)) r && (t[n] = Pn(r));
|
|
1222
1118
|
return t;
|
|
1223
1119
|
}
|
|
1224
|
-
function
|
|
1225
|
-
if (!e.field) return
|
|
1226
|
-
let t =
|
|
1227
|
-
return
|
|
1120
|
+
function In(e) {
|
|
1121
|
+
if (!e.field) return On(n(e.rawValue), !1);
|
|
1122
|
+
let t = jn(e.rawValue, e.rowData, e.field);
|
|
1123
|
+
return Nn(Mn(e, t.value, e.field), t, e.field);
|
|
1228
1124
|
}
|
|
1229
1125
|
//#endregion
|
|
1230
1126
|
//#region src/formatters/valueState/presentation.ts
|
|
1231
|
-
var
|
|
1127
|
+
var Ln = [
|
|
1232
1128
|
"none",
|
|
1233
1129
|
"information",
|
|
1234
1130
|
"success",
|
|
1235
1131
|
"warning",
|
|
1236
1132
|
"error"
|
|
1237
|
-
],
|
|
1133
|
+
], Rn = {
|
|
1238
1134
|
"": "transparent",
|
|
1239
1135
|
none: "var(--content-1)",
|
|
1240
1136
|
information: "var(--status-info-text)",
|
|
@@ -1244,7 +1140,7 @@ var Gn = [
|
|
|
1244
1140
|
};
|
|
1245
1141
|
//#endregion
|
|
1246
1142
|
//#region src/formatters/valueState/resolveValueStateClassName.ts
|
|
1247
|
-
function
|
|
1143
|
+
function zn(e, t) {
|
|
1248
1144
|
switch (e) {
|
|
1249
1145
|
case "success": return "statusSuccess";
|
|
1250
1146
|
case "warning": return "statusWarning";
|
|
@@ -1254,6 +1150,6 @@ function qn(e, t) {
|
|
|
1254
1150
|
}
|
|
1255
1151
|
}
|
|
1256
1152
|
//#endregion
|
|
1257
|
-
export {
|
|
1153
|
+
export { et as $, gt as A, x as At, bt as B, me as Bt, X as C, Oe as Ct, Nt as D, xe as Dt, Mt as E, C as Et, yt as F, Ce as Ft, At as G, ue as Gt, xt as H, fe as Ht, Dt as I, v as It, L as J, ut as K, le as Kt, Tt as L, ve as Lt, _t as M, S as Mt, vt as N, be as Nt, jt as O, Se as Ot, Et as P, ye as Pt, $e as Q, ht as R, he as Rt, Bt as S, D as St, It as T, ke as Tt, kt as U, g as Ut, Ot as V, pe as Vt, St as W, de as Wt, Qe as X, tt as Y, Ze as Z, Lt as _, Me as _t, Fn as a, Je as at, zt as b, E as bt, xn as c, Ge as ct, nn as d, M as dt, Xe as et, Z as f, F as ft, Wt as g, Fe as gt, Gt as h, T as ht, Pn as i, P as it, wt as j, b as jt, G as k, y as kt, bn as l, Ke as lt, Zt as m, I as mt, Ln as n, j as nt, In as o, qe as ot, Qt as p, A as pt, V as q, Rn as r, Ue as rt, En as s, N as st, zn as t, We as tt, _n as u, Ye as ut, Y as v, w as vt, Ft as w, Ae as wt, J as x, Ne as xt, Rt as y, O as yt, Ct as z, ge as zt };
|
|
1258
1154
|
|
|
1259
|
-
//# sourceMappingURL=formatters-
|
|
1155
|
+
//# sourceMappingURL=formatters-BJ6VySIq.js.map
|