@ryuzaki13/react-foundation-lib 2.33.0 → 2.35.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/analytical-table/index.js +1 -1
- package/dist/binary/binaryToBlob.d.ts +4 -0
- package/dist/binary/binaryToBlob.d.ts.map +1 -1
- package/dist/binary/index.d.ts +2 -2
- package/dist/binary/index.d.ts.map +1 -1
- package/dist/binary/index.js +73 -54
- package/dist/binary/index.js.map +1 -1
- package/dist/binary/useBinaryFile.d.ts +14 -5
- package/dist/binary/useBinaryFile.d.ts.map +1 -1
- package/dist/chunks/{formatters-CMfD97RB.js → formatters-4P9iq3wB.js} +384 -377
- package/dist/chunks/formatters-4P9iq3wB.js.map +1 -0
- package/dist/chunks/{validate-rivmPJyV.js → validate-Drrm-CCz.js} +177 -168
- package/dist/chunks/validate-Drrm-CCz.js.map +1 -0
- package/dist/error-report/index.js +1 -1
- package/dist/excel/index.js +114 -112
- package/dist/excel/index.js.map +1 -1
- package/dist/excel/tableExport.d.ts.map +1 -1
- package/dist/formatters/index.js +3 -3
- package/dist/formatters/number/formatNumber.d.ts +2 -2
- package/dist/formatters/number/formatNumber.d.ts.map +1 -1
- package/dist/formatters/number/index.d.ts +1 -0
- package/dist/formatters/number/index.d.ts.map +1 -1
- package/dist/formatters/number/numberFormatConstants.d.ts +5 -0
- package/dist/formatters/number/numberFormatConstants.d.ts.map +1 -1
- package/dist/formatters/number/numberPresetNameConstants.d.ts +1 -0
- package/dist/formatters/number/numberPresetNameConstants.d.ts.map +1 -1
- package/dist/formatters/number/presets.d.ts +2 -1
- package/dist/formatters/number/presets.d.ts.map +1 -1
- package/dist/formatters/number/types.d.ts +3 -1
- package/dist/formatters/number/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/binary/README.mdx +38 -78
- package/src/excel/README.mdx +12 -0
- package/src/formatters/number/README.mdx +41 -7
- package/dist/chunks/formatters-CMfD97RB.js.map +0 -1
- package/dist/chunks/validate-rivmPJyV.js.map +0 -1
|
@@ -1,76 +1,82 @@
|
|
|
1
1
|
import { at as e } from "./scalarTypeClassification-D4YcGxtQ.js";
|
|
2
2
|
import { g as t, h as n, p as r, t as i } from "./formulas-BZtCqzBj.js";
|
|
3
3
|
//#region src/formatters/number/numberFormatConstants.ts
|
|
4
|
-
var a = "round", o = "floor", s = "ceil", c = "trunc", l = "ru-RU", u = "
|
|
4
|
+
var a = "round", o = "floor", s = "ceil", c = "trunc", l = "ru-RU", u = "decimal", d = "percent", f = "group", ee = "decimal", te = "percentSign", ne = "literal", p = "integer", m = "decimal", h = "decimal-2", g = "decimal-3", _ = "currency", v = "price", y = "percent", b = "ratio-percent", x = "tonnage", re = "compact-currency", S = "compact-currency-round", C = "compact-percent", w = "compact-percent-round", T = "compact-tonnage", E = "compact-tonnage-round", D = {
|
|
5
5
|
decimals: 1,
|
|
6
6
|
decimalSeparator: ",",
|
|
7
7
|
grouping: !0,
|
|
8
8
|
groupingSeparator: new Intl.NumberFormat("ru-RU").formatToParts(1e3).find((e) => e.type === "group")?.value ?? "\xA0",
|
|
9
9
|
groupingSize: 3
|
|
10
|
-
},
|
|
11
|
-
integer:
|
|
12
|
-
decimal:
|
|
13
|
-
decimal2:
|
|
14
|
-
decimal3:
|
|
15
|
-
currency:
|
|
16
|
-
price:
|
|
17
|
-
percent:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
}, ie = Object.freeze({
|
|
11
|
+
integer: p,
|
|
12
|
+
decimal: m,
|
|
13
|
+
decimal2: h,
|
|
14
|
+
decimal3: g,
|
|
15
|
+
currency: _,
|
|
16
|
+
price: v,
|
|
17
|
+
percent: y,
|
|
18
|
+
ratioPercent: b,
|
|
19
|
+
tonnage: x,
|
|
20
|
+
compactCurrency: re,
|
|
21
|
+
compactCurrencyRound: S,
|
|
22
|
+
compactPercent: C,
|
|
23
|
+
compactPercentRound: w,
|
|
24
|
+
compactTonnage: T,
|
|
25
|
+
compactTonnageRound: E
|
|
26
|
+
}), ae = [
|
|
26
27
|
{
|
|
27
|
-
name:
|
|
28
|
+
name: p,
|
|
28
29
|
decimals: 0,
|
|
29
30
|
decimalSeparator: ""
|
|
30
31
|
},
|
|
31
|
-
{ name:
|
|
32
|
+
{ name: m },
|
|
32
33
|
{
|
|
33
|
-
name:
|
|
34
|
+
name: h,
|
|
34
35
|
decimals: 2
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
|
-
name:
|
|
38
|
+
name: g,
|
|
38
39
|
decimals: 3
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
|
-
name:
|
|
42
|
+
name: _,
|
|
42
43
|
decimals: 0,
|
|
43
44
|
decimalSeparator: ""
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
|
-
name:
|
|
47
|
+
name: v,
|
|
47
48
|
decimals: 0,
|
|
48
49
|
decimalSeparator: ""
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
|
-
name:
|
|
52
|
+
name: y,
|
|
52
53
|
decimals: 2
|
|
53
54
|
},
|
|
54
|
-
{ name: y },
|
|
55
55
|
{
|
|
56
56
|
name: b,
|
|
57
|
+
decimals: 2,
|
|
58
|
+
style: d
|
|
59
|
+
},
|
|
60
|
+
{ name: x },
|
|
61
|
+
{
|
|
62
|
+
name: re,
|
|
57
63
|
decimals: 0,
|
|
58
64
|
decimalSeparator: "",
|
|
59
65
|
compact: {}
|
|
60
66
|
},
|
|
61
67
|
{
|
|
62
|
-
name:
|
|
68
|
+
name: S,
|
|
63
69
|
decimals: 0,
|
|
64
70
|
decimalSeparator: "",
|
|
65
71
|
compact: { roundingMode: a }
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
|
-
name:
|
|
74
|
+
name: C,
|
|
69
75
|
decimals: 2,
|
|
70
76
|
compact: { maxDecimals: 2 }
|
|
71
77
|
},
|
|
72
78
|
{
|
|
73
|
-
name:
|
|
79
|
+
name: w,
|
|
74
80
|
decimals: 2,
|
|
75
81
|
compact: {
|
|
76
82
|
maxDecimals: 2,
|
|
@@ -78,71 +84,74 @@ var a = "round", o = "floor", s = "ceil", c = "trunc", l = "ru-RU", u = "group",
|
|
|
78
84
|
}
|
|
79
85
|
},
|
|
80
86
|
{
|
|
81
|
-
name:
|
|
87
|
+
name: T,
|
|
82
88
|
compact: { maxDecimals: 1 }
|
|
83
89
|
},
|
|
84
90
|
{
|
|
85
|
-
name:
|
|
91
|
+
name: E,
|
|
86
92
|
compact: {
|
|
87
93
|
maxDecimals: 1,
|
|
88
94
|
roundingMode: a
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
|
-
],
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
], O = /* @__PURE__ */ new Map();
|
|
98
|
+
function k(e) {
|
|
99
|
+
if (e.style === "percent" && e.compact !== void 0) throw Error("Процентный style предустановки не поддерживает compact.");
|
|
100
|
+
}
|
|
101
|
+
function A() {
|
|
102
|
+
for (let e of ae) O.set(e.name, {
|
|
103
|
+
...D,
|
|
95
104
|
...e
|
|
96
105
|
});
|
|
97
106
|
}
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
return
|
|
107
|
+
A();
|
|
108
|
+
function j(e) {
|
|
109
|
+
return O.get(e);
|
|
101
110
|
}
|
|
102
|
-
function
|
|
103
|
-
return Array.from(
|
|
111
|
+
function oe() {
|
|
112
|
+
return Array.from(O.keys());
|
|
104
113
|
}
|
|
105
|
-
function
|
|
114
|
+
function se(e) {
|
|
106
115
|
let t = {
|
|
107
|
-
...
|
|
116
|
+
...D,
|
|
108
117
|
...e
|
|
109
118
|
};
|
|
110
|
-
return
|
|
119
|
+
return k(t), O.set(t.name, t), t;
|
|
111
120
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
121
|
+
function ce() {
|
|
122
|
+
O.clear(), A();
|
|
114
123
|
}
|
|
115
|
-
function
|
|
116
|
-
if (typeof e != "string") return e;
|
|
117
|
-
let t =
|
|
124
|
+
function le(e) {
|
|
125
|
+
if (typeof e != "string") return k(e), e;
|
|
126
|
+
let t = j(e);
|
|
118
127
|
if (!t) throw Error(`Предустановка "${e}" не найдена`);
|
|
119
|
-
return t;
|
|
128
|
+
return k(t), t;
|
|
120
129
|
}
|
|
121
130
|
//#endregion
|
|
122
131
|
//#region src/formatters/valueState/valueStateResolverConstants.ts
|
|
123
|
-
var
|
|
132
|
+
var ue = "fixed", M = "threshold", de = "lower", fe = "upper", N = "normalizeLeadingZeros", P = "rowBasedOverride", F = "resolveValueState", I = "typedValueFormat", L = "source", R = "sink", pe = "field", me = "formula", he = "value", ge = "left", _e = "right", ve = "plain", ye = "tree", be = "group", xe = "totals", Se = "formula";
|
|
124
133
|
//#endregion
|
|
125
134
|
//#region src/formatters/pipeline/clone.ts
|
|
126
|
-
function
|
|
135
|
+
function z(e) {
|
|
127
136
|
return e ? { ...e } : void 0;
|
|
128
137
|
}
|
|
129
|
-
function
|
|
138
|
+
function B(e) {
|
|
130
139
|
return e ? { ...e } : void 0;
|
|
131
140
|
}
|
|
132
|
-
function
|
|
141
|
+
function V(e) {
|
|
133
142
|
return e.mode === "formula" ? {
|
|
134
143
|
...e,
|
|
135
144
|
dependencyIds: e.dependencyIds ? [...e.dependencyIds] : void 0
|
|
136
145
|
} : { ...e };
|
|
137
146
|
}
|
|
138
|
-
function
|
|
147
|
+
function H(e) {
|
|
139
148
|
return {
|
|
140
149
|
resolver: e.resolver.kind === "fixed" ? {
|
|
141
|
-
kind:
|
|
150
|
+
kind: ue,
|
|
142
151
|
entries: { ...e.resolver.entries },
|
|
143
152
|
fallbackState: e.resolver.fallbackState
|
|
144
153
|
} : {
|
|
145
|
-
kind:
|
|
154
|
+
kind: M,
|
|
146
155
|
thresholds: e.resolver.thresholds.map((e) => typeof e == "number" ? e : { ...e }),
|
|
147
156
|
states: [...e.resolver.states],
|
|
148
157
|
invalidState: e.resolver.invalidState
|
|
@@ -154,82 +163,82 @@ function B(e) {
|
|
|
154
163
|
icon: e.icon ? { ...e.icon } : void 0
|
|
155
164
|
};
|
|
156
165
|
}
|
|
157
|
-
function
|
|
166
|
+
function U(e) {
|
|
158
167
|
switch (e.type) {
|
|
159
|
-
case
|
|
168
|
+
case I: return {
|
|
160
169
|
...e,
|
|
161
|
-
config:
|
|
170
|
+
config: z(e.config)
|
|
162
171
|
};
|
|
163
|
-
case
|
|
172
|
+
case N: return {
|
|
164
173
|
...e,
|
|
165
|
-
config:
|
|
174
|
+
config: B(e.config)
|
|
166
175
|
};
|
|
167
|
-
case
|
|
176
|
+
case P: return {
|
|
168
177
|
...e,
|
|
169
|
-
config:
|
|
178
|
+
config: V(e.config)
|
|
170
179
|
};
|
|
171
|
-
case
|
|
180
|
+
case F: return {
|
|
172
181
|
...e,
|
|
173
|
-
config:
|
|
182
|
+
config: H(e.config)
|
|
174
183
|
};
|
|
175
184
|
}
|
|
176
185
|
throw Error(`Недопустимый тип '${e?.type}' для шага FormatterPipeline`);
|
|
177
186
|
}
|
|
178
|
-
function
|
|
187
|
+
function W(e, t) {
|
|
179
188
|
switch (e.type) {
|
|
180
|
-
case
|
|
189
|
+
case I: return {
|
|
181
190
|
...e,
|
|
182
191
|
position: { ...t },
|
|
183
|
-
config:
|
|
192
|
+
config: z(e.config)
|
|
184
193
|
};
|
|
185
|
-
case
|
|
194
|
+
case N: return {
|
|
186
195
|
...e,
|
|
187
196
|
position: { ...t },
|
|
188
|
-
config:
|
|
197
|
+
config: B(e.config)
|
|
189
198
|
};
|
|
190
|
-
case
|
|
199
|
+
case P: return {
|
|
191
200
|
...e,
|
|
192
201
|
position: { ...t },
|
|
193
|
-
config:
|
|
202
|
+
config: V(e.config)
|
|
194
203
|
};
|
|
195
|
-
case
|
|
204
|
+
case F: return {
|
|
196
205
|
...e,
|
|
197
206
|
position: { ...t },
|
|
198
|
-
config:
|
|
207
|
+
config: H(e.config)
|
|
199
208
|
};
|
|
200
209
|
}
|
|
201
210
|
throw Error(`Недопустимый тип '${e?.type}' для шага FormatterPipeline`);
|
|
202
211
|
}
|
|
203
|
-
function
|
|
212
|
+
function Ce(e) {
|
|
204
213
|
switch (e.type) {
|
|
205
|
-
case
|
|
206
|
-
case
|
|
214
|
+
case L:
|
|
215
|
+
case R: return {
|
|
207
216
|
...e,
|
|
208
217
|
position: { ...e.position }
|
|
209
218
|
};
|
|
210
|
-
default: return
|
|
219
|
+
default: return W(e, e.position);
|
|
211
220
|
}
|
|
212
221
|
}
|
|
213
|
-
function
|
|
222
|
+
function we(e) {
|
|
214
223
|
return {
|
|
215
|
-
nodes: e.nodes.map(
|
|
224
|
+
nodes: e.nodes.map(Ce),
|
|
216
225
|
edges: e.edges.map((e) => ({ ...e })),
|
|
217
226
|
viewport: e.viewport ? { ...e.viewport } : void 0
|
|
218
227
|
};
|
|
219
228
|
}
|
|
220
|
-
function
|
|
221
|
-
return { steps: e.steps.map(
|
|
229
|
+
function Te(e) {
|
|
230
|
+
return { steps: e.steps.map(U) };
|
|
222
231
|
}
|
|
223
|
-
function
|
|
232
|
+
function Ee(e) {
|
|
224
233
|
if (e) return {
|
|
225
234
|
version: e.version,
|
|
226
|
-
graph: e.graph ?
|
|
227
|
-
plan: e.plan ?
|
|
235
|
+
graph: e.graph ? we(e.graph) : void 0,
|
|
236
|
+
plan: e.plan ? Te(e.plan) : void 0
|
|
228
237
|
};
|
|
229
238
|
}
|
|
230
239
|
//#endregion
|
|
231
240
|
//#region src/formatters/rowBased/context.ts
|
|
232
|
-
function
|
|
241
|
+
function G(t) {
|
|
233
242
|
let n = [...t.keys ?? []], r = (e) => {
|
|
234
243
|
if (!Number.isInteger(e) || e < 0) {
|
|
235
244
|
t.instrumentation?.onOutOfRangeIndex?.(e);
|
|
@@ -258,7 +267,7 @@ function U(t) {
|
|
|
258
267
|
}
|
|
259
268
|
//#endregion
|
|
260
269
|
//#region src/formatters/rowBased/registry.ts
|
|
261
|
-
function
|
|
270
|
+
function K(e) {
|
|
262
271
|
let t = /* @__PURE__ */ new Map(), n = [];
|
|
263
272
|
for (let r of e) {
|
|
264
273
|
let e = r.id.trim();
|
|
@@ -277,53 +286,53 @@ function W(e) {
|
|
|
277
286
|
byId: t
|
|
278
287
|
});
|
|
279
288
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
|
|
289
|
+
var q = K([]);
|
|
290
|
+
function De(e) {
|
|
291
|
+
q = e;
|
|
283
292
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
293
|
+
function Oe() {
|
|
294
|
+
return q.list;
|
|
286
295
|
}
|
|
287
|
-
function
|
|
296
|
+
function J(e) {
|
|
288
297
|
let t = e?.trim();
|
|
289
|
-
if (t) return
|
|
298
|
+
if (t) return q.byId.get(t);
|
|
290
299
|
}
|
|
291
300
|
//#endregion
|
|
292
301
|
//#region src/formatters/pipeline/pipelineValidationConstants.ts
|
|
293
|
-
var
|
|
294
|
-
function
|
|
302
|
+
var ke = "config_not_defined", Ae = "unsupported_version", je = "graph_or_plan_required", Me = "node_id_duplicate", Ne = "edge_id_duplicate", Pe = "edge_node_not_found", Fe = "source_count_invalid", Ie = "sink_count_invalid", Le = "source_incoming_invalid", Re = "sink_outgoing_invalid", Y = "node_degree_invalid", X = "path_broken", ze = "path_cycle_detected", Be = "path_disconnected_nodes", Ve = "step_id_duplicate", He = "step_resolve_value_state_multiple", Ue = "step_typed_value_format_multiple", We = "step_row_based_override_multiple", Ge = "step_normalize_leading_zeros_multiple", Ke = "step_typed_before_value_state", qe = "step_row_based_override_field_key_empty", Je = "step_row_based_override_formula_id_empty", Ye = "step_row_based_override_formula_not_found", Xe = "step_row_based_override_dependency_index_out_of_range", Ze = "step_row_based_override_unused_dependencies", Qe = "step_row_based_override_formula_does_not_use_dependencies", $e = "step_row_based_override_formula_runtime_error", et = "step_value_state_formula_id_empty", tt = "step_value_state_formula_not_found", nt = "step_value_state_dependency_id_empty", rt = "step_value_state_dependency_index_out_of_range", it = "step_value_state_unused_dependencies", at = "step_value_state_formula_does_not_use_dependencies", ot = "step_value_state_formula_runtime_error", st = "step_threshold_states_count_invalid", ct = "step_value_hidden_without_icon", lt = "step_typed_value_format_preset_empty", ut = "step_typed_value_format_preset_not_found", dt = 100;
|
|
303
|
+
function Z(e, t, n) {
|
|
295
304
|
e.errors.push({
|
|
296
305
|
code: t,
|
|
297
306
|
message: n
|
|
298
307
|
});
|
|
299
308
|
}
|
|
300
|
-
function
|
|
309
|
+
function Q(e, t, n) {
|
|
301
310
|
e.warnings.push({
|
|
302
311
|
code: t,
|
|
303
312
|
message: n
|
|
304
313
|
});
|
|
305
314
|
}
|
|
306
|
-
function
|
|
315
|
+
function ft(e) {
|
|
307
316
|
return [...e].sort((e, t) => e - t);
|
|
308
317
|
}
|
|
309
|
-
function
|
|
318
|
+
function $(e, t) {
|
|
310
319
|
return e.reduce((e, n, r) => (e[n] = (r + 1) * t, e), {});
|
|
311
320
|
}
|
|
312
|
-
function
|
|
321
|
+
function pt(e, t) {
|
|
313
322
|
if (!e.formulaId.trim()) {
|
|
314
|
-
|
|
323
|
+
Z(t, Je, "Для rowBasedOverride (formula) необходимо заполнить formulaId.");
|
|
315
324
|
return;
|
|
316
325
|
}
|
|
317
|
-
let n =
|
|
326
|
+
let n = J(e.formulaId), r = [...e.dependencyIds ?? []];
|
|
318
327
|
if (!n) {
|
|
319
|
-
|
|
328
|
+
Z(t, Ye, "Формула rowBasedOverride не найдена в реестре.");
|
|
320
329
|
return;
|
|
321
330
|
}
|
|
322
331
|
let i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = 0, s = (e) => {
|
|
323
332
|
try {
|
|
324
|
-
let t =
|
|
333
|
+
let t = G({
|
|
325
334
|
rowData: e,
|
|
326
|
-
rawValue:
|
|
335
|
+
rawValue: dt,
|
|
327
336
|
columnId: "__validation__",
|
|
328
337
|
keys: r,
|
|
329
338
|
instrumentation: {
|
|
@@ -340,19 +349,19 @@ function st(e, t) {
|
|
|
340
349
|
o += 1;
|
|
341
350
|
}
|
|
342
351
|
};
|
|
343
|
-
s(
|
|
344
|
-
let c =
|
|
345
|
-
a.size > 0 &&
|
|
352
|
+
s($(r, dt)), s($(r, -100));
|
|
353
|
+
let c = ft(i), l = c.length > 0 ? c[c.length - 1] + 1 : 0;
|
|
354
|
+
a.size > 0 && Z(t, Xe, `Формула rowBasedOverride обращается к несуществующим индексам. Минимально требуется зависимостей: ${l}, выбрано: ${r.length}.`), c.length === 0 && Q(t, Qe, "Формула rowBasedOverride не использует dependencyIds.");
|
|
346
355
|
let u = r.filter((e, t) => !i.has(t));
|
|
347
|
-
u.length > 0 &&
|
|
356
|
+
u.length > 0 && Q(t, Ze, `Выбраны, но не используются формулой rowBasedOverride: ${u.join(", ")}.`), o > 0 && Q(t, $e, "На тестовых данных формула rowBasedOverride завершилась с ошибкой.");
|
|
348
357
|
}
|
|
349
|
-
function
|
|
358
|
+
function mt(e, a) {
|
|
350
359
|
if (!e.formulaId.trim()) {
|
|
351
|
-
|
|
360
|
+
Z(a, et, "Для источника состояния необходимо выбрать формулу.");
|
|
352
361
|
return;
|
|
353
362
|
}
|
|
354
363
|
if (e.dependencyIds.some((e) => !e.trim())) {
|
|
355
|
-
|
|
364
|
+
Z(a, nt, "Зависимость формулы состояния не может иметь пустой id.");
|
|
356
365
|
return;
|
|
357
366
|
}
|
|
358
367
|
let o = i({
|
|
@@ -360,18 +369,18 @@ function ct(e, a) {
|
|
|
360
369
|
dependencies: e.dependencyIds,
|
|
361
370
|
availableColumnIds: e.dependencyIds
|
|
362
371
|
});
|
|
363
|
-
for (let e of o.errors) e.code === "formula_not_found" ?
|
|
372
|
+
for (let e of o.errors) e.code === "formula_not_found" ? Z(a, tt, "Формула источника состояния не найдена в реестре.") : e.code === "dependency_index_out_of_range" && Z(a, rt, e.message);
|
|
364
373
|
for (let e of o.warnings) switch (e.code) {
|
|
365
374
|
case n:
|
|
366
|
-
|
|
375
|
+
Q(a, it, e.message);
|
|
367
376
|
break;
|
|
368
377
|
case r:
|
|
369
|
-
|
|
378
|
+
Q(a, at, e.message);
|
|
370
379
|
break;
|
|
371
|
-
case t:
|
|
380
|
+
case t: Q(a, ot, e.message);
|
|
372
381
|
}
|
|
373
382
|
}
|
|
374
|
-
function
|
|
383
|
+
function ht(e, t) {
|
|
375
384
|
let n = /* @__PURE__ */ new Set(), r = {
|
|
376
385
|
normalizeLeadingZeros: 0,
|
|
377
386
|
rowBasedOverride: 0,
|
|
@@ -381,99 +390,99 @@ function lt(e, t) {
|
|
|
381
390
|
for (let i of e) {
|
|
382
391
|
let e = i.id.trim();
|
|
383
392
|
if (!e) {
|
|
384
|
-
|
|
393
|
+
Z(t, Ve, "Шаг pipeline не может иметь пустой id.");
|
|
385
394
|
continue;
|
|
386
395
|
}
|
|
387
|
-
switch (n.has(e) &&
|
|
388
|
-
case
|
|
396
|
+
switch (n.has(e) && Z(t, Ve, `Найден дублирующийся id шага pipeline: ${e}.`), n.add(e), i.type) {
|
|
397
|
+
case N:
|
|
389
398
|
r.normalizeLeadingZeros += 1;
|
|
390
399
|
break;
|
|
391
|
-
case
|
|
392
|
-
r.rowBasedOverride += 1, i.config.mode === "field" && !i.config.fieldKey.trim() &&
|
|
400
|
+
case P:
|
|
401
|
+
r.rowBasedOverride += 1, i.config.mode === "field" && !i.config.fieldKey.trim() && Z(t, qe, "Для rowBasedOverride (field) необходимо заполнить fieldKey."), i.config.mode === "formula" && pt(i.config, t);
|
|
393
402
|
break;
|
|
394
|
-
case
|
|
395
|
-
r.resolveValueState += 1, i.config.valueSource?.kind === "formula" &&
|
|
403
|
+
case F:
|
|
404
|
+
r.resolveValueState += 1, i.config.valueSource?.kind === "formula" && mt(i.config.valueSource, t), i.config.resolver.kind === "threshold" && i.config.resolver.states.length !== i.config.resolver.thresholds.length + 1 && Z(t, st, "Для threshold-резолвера количество states должно быть равно thresholds + 1.");
|
|
396
405
|
break;
|
|
397
|
-
case
|
|
406
|
+
case I: if (r.typedValueFormat += 1, i.config?.numberPresetName !== void 0) {
|
|
398
407
|
let e = i.config.numberPresetName.trim();
|
|
399
408
|
if (!e) {
|
|
400
|
-
|
|
409
|
+
Z(t, lt, "Для typedValueFormat указан пустой numberPresetName.");
|
|
401
410
|
break;
|
|
402
411
|
}
|
|
403
|
-
|
|
412
|
+
j(e) || Z(t, ut, `Для typedValueFormat указан неизвестный пресет: ${e}.`);
|
|
404
413
|
}
|
|
405
414
|
}
|
|
406
415
|
}
|
|
407
|
-
r.normalizeLeadingZeros > 1 &&
|
|
408
|
-
let i = e.findIndex((e) => e.type ===
|
|
409
|
-
i !== -1 && a !== -1 && a < i &&
|
|
410
|
-
for (let n of e) n.type === "resolveValueState" && !n.config.icon?.enabled && n.config.icon?.showValue === !1 &&
|
|
416
|
+
r.normalizeLeadingZeros > 1 && Z(t, Ge, "В pipeline может быть только один шаг normalizeLeadingZeros."), r.rowBasedOverride > 1 && Z(t, We, "В pipeline может быть только один шаг rowBasedOverride."), r.resolveValueState > 1 && Z(t, He, "В pipeline может быть только один шаг resolveValueState."), r.typedValueFormat > 1 && Z(t, Ue, "В pipeline может быть только один шаг typedValueFormat.");
|
|
417
|
+
let i = e.findIndex((e) => e.type === F), a = e.findIndex((e) => e.type === I);
|
|
418
|
+
i !== -1 && a !== -1 && a < i && Z(t, Ke, "Шаг typedValueFormat не может выполняться до шага resolveValueState.");
|
|
419
|
+
for (let n of e) n.type === "resolveValueState" && !n.config.icon?.enabled && n.config.icon?.showValue === !1 && Q(t, ct, "Для resolveValueState установлено showValue=false при выключенной иконке: значение не будет отображаться.");
|
|
411
420
|
}
|
|
412
|
-
function
|
|
421
|
+
function gt(e) {
|
|
413
422
|
let t = {
|
|
414
423
|
errors: [],
|
|
415
424
|
warnings: []
|
|
416
425
|
};
|
|
417
|
-
return
|
|
426
|
+
return ht(e.steps, t), {
|
|
418
427
|
ok: t.errors.length === 0,
|
|
419
428
|
errors: t.errors,
|
|
420
429
|
warnings: t.warnings,
|
|
421
430
|
plan: t.errors.length === 0 ? { steps: [...e.steps] } : void 0
|
|
422
431
|
};
|
|
423
432
|
}
|
|
424
|
-
function
|
|
433
|
+
function _t(e, t, n) {
|
|
425
434
|
let r = new Map(e.map((e) => [e.id, e])), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
426
435
|
for (let t of e) i.set(t.id, []), a.set(t.id, []);
|
|
427
436
|
for (let e of t) {
|
|
428
437
|
let t = e.source.trim(), o = e.target.trim();
|
|
429
438
|
if (!r.has(t) || !r.has(o)) {
|
|
430
|
-
|
|
439
|
+
Z(n, Pe, `Ребро ${e.id} ссылается на несуществующий узел: ${t} -> ${o}.`);
|
|
431
440
|
continue;
|
|
432
441
|
}
|
|
433
442
|
i.get(t)?.push(o), a.get(o)?.push(t);
|
|
434
443
|
}
|
|
435
|
-
let o = e.filter((e) => e.type ===
|
|
436
|
-
if (o.length !== 1 &&
|
|
444
|
+
let o = e.filter((e) => e.type === L), s = e.filter((e) => e.type === R);
|
|
445
|
+
if (o.length !== 1 && Z(n, Fe, "В графе должен быть ровно один узел source."), s.length !== 1 && Z(n, Ie, "В графе должен быть ровно один узел sink."), n.errors.length > 0) return;
|
|
437
446
|
let c = o[0].id, l = s[0].id;
|
|
438
447
|
for (let t of e) {
|
|
439
448
|
let e = a.get(t.id)?.length ?? 0, r = i.get(t.id)?.length ?? 0;
|
|
440
449
|
if (t.type === "source") {
|
|
441
|
-
e !== 0 &&
|
|
450
|
+
e !== 0 && Z(n, Le, "Узел source не должен иметь входящих рёбер."), r !== 1 && Z(n, Y, "Узел source должен иметь ровно одно исходящее ребро.");
|
|
442
451
|
continue;
|
|
443
452
|
}
|
|
444
453
|
if (t.type === "sink") {
|
|
445
|
-
r !== 0 &&
|
|
454
|
+
r !== 0 && Z(n, Re, "Узел sink не должен иметь исходящих рёбер."), e !== 1 && Z(n, Y, "Узел sink должен иметь ровно одно входящее ребро.");
|
|
446
455
|
continue;
|
|
447
456
|
}
|
|
448
|
-
(e !== 1 || r !== 1) &&
|
|
457
|
+
(e !== 1 || r !== 1) && Z(n, Y, `Узел ${t.id} должен иметь ровно одно входящее и одно исходящее ребро для линейного pipeline.`);
|
|
449
458
|
}
|
|
450
459
|
if (n.errors.length > 0) return;
|
|
451
460
|
let u = /* @__PURE__ */ new Set(), d = [], f = c;
|
|
452
461
|
for (;;) {
|
|
453
462
|
if (u.has(f)) {
|
|
454
|
-
|
|
463
|
+
Z(n, ze, "В графе pipeline обнаружен цикл.");
|
|
455
464
|
return;
|
|
456
465
|
}
|
|
457
466
|
if (u.add(f), d.push(f), f === l) break;
|
|
458
467
|
let e = i.get(f) ?? [];
|
|
459
468
|
if (e.length !== 1) {
|
|
460
|
-
|
|
469
|
+
Z(n, X, "Не удалось построить линейный путь от source к sink.");
|
|
461
470
|
return;
|
|
462
471
|
}
|
|
463
472
|
f = e[0];
|
|
464
473
|
}
|
|
465
474
|
if (u.size !== e.length) {
|
|
466
|
-
|
|
475
|
+
Z(n, Be, "Граф содержит узлы, которые не входят в линейный путь source -> sink.");
|
|
467
476
|
return;
|
|
468
477
|
}
|
|
469
478
|
return d;
|
|
470
479
|
}
|
|
471
|
-
function
|
|
480
|
+
function vt(e) {
|
|
472
481
|
let t = {
|
|
473
482
|
errors: [],
|
|
474
483
|
warnings: []
|
|
475
484
|
};
|
|
476
|
-
if (!e.nodes.length) return
|
|
485
|
+
if (!e.nodes.length) return Z(t, X, "Граф pipeline не содержит узлов."), {
|
|
477
486
|
ok: !1,
|
|
478
487
|
errors: t.errors,
|
|
479
488
|
warnings: t.warnings
|
|
@@ -482,11 +491,11 @@ function ft(e) {
|
|
|
482
491
|
for (let r of e.nodes) {
|
|
483
492
|
let e = r.id.trim();
|
|
484
493
|
if (!e) {
|
|
485
|
-
|
|
494
|
+
Z(t, Me, "Узел pipeline не может иметь пустой id.");
|
|
486
495
|
continue;
|
|
487
496
|
}
|
|
488
497
|
if (n.has(e)) {
|
|
489
|
-
|
|
498
|
+
Z(t, Me, `Найден дублирующийся id узла pipeline: ${e}.`);
|
|
490
499
|
continue;
|
|
491
500
|
}
|
|
492
501
|
n.set(e, r);
|
|
@@ -495,11 +504,11 @@ function ft(e) {
|
|
|
495
504
|
for (let n of e.edges) {
|
|
496
505
|
let e = n.id.trim();
|
|
497
506
|
if (!e) {
|
|
498
|
-
|
|
507
|
+
Z(t, Ne, "Ребро pipeline не может иметь пустой id.");
|
|
499
508
|
continue;
|
|
500
509
|
}
|
|
501
510
|
if (r.has(e)) {
|
|
502
|
-
|
|
511
|
+
Z(t, Ne, `Найден дублирующийся id ребра pipeline: ${e}.`);
|
|
503
512
|
continue;
|
|
504
513
|
}
|
|
505
514
|
r.add(e);
|
|
@@ -509,7 +518,7 @@ function ft(e) {
|
|
|
509
518
|
errors: t.errors,
|
|
510
519
|
warnings: t.warnings
|
|
511
520
|
};
|
|
512
|
-
let i =
|
|
521
|
+
let i = _t(e.nodes, e.edges, t);
|
|
513
522
|
if (!i) return {
|
|
514
523
|
ok: !1,
|
|
515
524
|
errors: t.errors,
|
|
@@ -519,73 +528,73 @@ function ft(e) {
|
|
|
519
528
|
for (let e of i) {
|
|
520
529
|
let t = n.get(e);
|
|
521
530
|
if (!(!t || t.type === "source" || t.type === "sink")) switch (t.type) {
|
|
522
|
-
case
|
|
531
|
+
case N:
|
|
523
532
|
a.push({
|
|
524
533
|
id: t.id,
|
|
525
|
-
type:
|
|
534
|
+
type: N,
|
|
526
535
|
config: t.config ? { ...t.config } : void 0
|
|
527
536
|
});
|
|
528
537
|
break;
|
|
529
|
-
case
|
|
538
|
+
case P:
|
|
530
539
|
a.push({
|
|
531
540
|
id: t.id,
|
|
532
|
-
type:
|
|
541
|
+
type: P,
|
|
533
542
|
config: t.config.mode === "formula" ? {
|
|
534
543
|
...t.config,
|
|
535
544
|
dependencyIds: t.config.dependencyIds ? [...t.config.dependencyIds] : void 0
|
|
536
545
|
} : { ...t.config }
|
|
537
546
|
});
|
|
538
547
|
break;
|
|
539
|
-
case
|
|
548
|
+
case F:
|
|
540
549
|
a.push({
|
|
541
550
|
id: t.id,
|
|
542
|
-
type:
|
|
543
|
-
config:
|
|
551
|
+
type: F,
|
|
552
|
+
config: H(t.config)
|
|
544
553
|
});
|
|
545
554
|
break;
|
|
546
|
-
case
|
|
555
|
+
case I: a.push({
|
|
547
556
|
id: t.id,
|
|
548
|
-
type:
|
|
557
|
+
type: I,
|
|
549
558
|
config: t.config ? { ...t.config } : void 0
|
|
550
559
|
});
|
|
551
560
|
}
|
|
552
561
|
}
|
|
553
|
-
return
|
|
562
|
+
return ht(a, t), {
|
|
554
563
|
ok: t.errors.length === 0,
|
|
555
564
|
errors: t.errors,
|
|
556
565
|
warnings: t.warnings,
|
|
557
566
|
plan: t.errors.length === 0 ? { steps: a } : void 0
|
|
558
567
|
};
|
|
559
568
|
}
|
|
560
|
-
function
|
|
569
|
+
function yt(e) {
|
|
561
570
|
let t = {
|
|
562
571
|
errors: [],
|
|
563
572
|
warnings: []
|
|
564
573
|
};
|
|
565
|
-
if (!e) return
|
|
574
|
+
if (!e) return Z(t, ke, "Конфигурация pipeline не задана."), {
|
|
566
575
|
ok: !1,
|
|
567
576
|
errors: t.errors,
|
|
568
577
|
warnings: t.warnings
|
|
569
578
|
};
|
|
570
|
-
if (e.version !== 1) return
|
|
579
|
+
if (e.version !== 1) return Z(t, Ae, `Неподдерживаемая версия pipeline: ${String(e.version)}.`), {
|
|
571
580
|
ok: !1,
|
|
572
581
|
errors: t.errors,
|
|
573
582
|
warnings: t.warnings
|
|
574
583
|
};
|
|
575
|
-
if (!e.plan && !e.graph) return
|
|
584
|
+
if (!e.plan && !e.graph) return Z(t, je, "Для pipeline должен быть задан хотя бы один источник: graph или plan."), {
|
|
576
585
|
ok: !1,
|
|
577
586
|
errors: t.errors,
|
|
578
587
|
warnings: t.warnings
|
|
579
588
|
};
|
|
580
589
|
if (e.plan) {
|
|
581
|
-
let n =
|
|
590
|
+
let n = gt(e.plan);
|
|
582
591
|
if (t.errors.push(...n.errors), t.warnings.push(...n.warnings), n.ok && n.plan) return {
|
|
583
592
|
ok: !0,
|
|
584
593
|
errors: t.errors,
|
|
585
594
|
warnings: t.warnings,
|
|
586
595
|
plan: n.plan
|
|
587
596
|
};
|
|
588
|
-
if (e.graph)
|
|
597
|
+
if (e.graph) Q(t, X, "Линейный plan невалиден. Выполнена попытка построить план из graph."), t.errors.length = 0;
|
|
589
598
|
else return {
|
|
590
599
|
ok: !1,
|
|
591
600
|
errors: t.errors,
|
|
@@ -593,7 +602,7 @@ function pt(e) {
|
|
|
593
602
|
};
|
|
594
603
|
}
|
|
595
604
|
if (e.graph) {
|
|
596
|
-
let n =
|
|
605
|
+
let n = vt(e.graph);
|
|
597
606
|
return {
|
|
598
607
|
ok: n.ok,
|
|
599
608
|
errors: [...t.errors, ...n.errors],
|
|
@@ -608,6 +617,6 @@ function pt(e) {
|
|
|
608
617
|
};
|
|
609
618
|
}
|
|
610
619
|
//#endregion
|
|
611
|
-
export {
|
|
620
|
+
export { x as $, xe as A, j as B, _e as C, me as D, pe as E, fe as F, _ as G, se as H, ue as I, g as J, m as K, M as L, Se as M, he as N, be as O, de as P, b as Q, ie as R, ge as S, L as T, ce as U, oe as V, le as W, y as X, p as Y, v as Z, z as _, tt as a, f as at, P as b, J as c, l as ct, U as d, s as et, W as f, V as g, H as h, Ye as i, ee as it, ye as j, ve as k, Oe as l, u as lt, B as m, vt as n, a as nt, De as o, ne as ot, Ee as p, h as q, gt as r, c as rt, K as s, te as st, yt as t, o as tt, G as u, d as ut, N as v, R as w, I as x, F as y, D as z };
|
|
612
621
|
|
|
613
|
-
//# sourceMappingURL=validate-
|
|
622
|
+
//# sourceMappingURL=validate-Drrm-CCz.js.map
|