@infomaximum/widget-sdk 6.0.2 → 7.0.0-2
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/CHANGELOG.md +295 -20
- package/README.md +2 -1
- package/dist/index.d.ts +9521 -1128
- package/dist/index.esm.js +1262 -431
- package/dist/index.js +1339 -431
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
var localization$1 = require('@infomaximum/localization');
|
|
4
4
|
var baseFilter = require('@infomaximum/base-filter');
|
|
5
5
|
|
|
6
|
+
/** Массив версий в строгом порядке, по которому последовательно выполняется миграция */
|
|
7
|
+
var apiVersions = [
|
|
8
|
+
"1",
|
|
9
|
+
"2",
|
|
10
|
+
"3",
|
|
11
|
+
"4",
|
|
12
|
+
"5",
|
|
13
|
+
"6",
|
|
14
|
+
"7", // Версии от 7 и старше пока не удаляем [BI-15416]
|
|
15
|
+
"8",
|
|
16
|
+
"9",
|
|
17
|
+
"10",
|
|
18
|
+
"10.1",
|
|
19
|
+
"10.2",
|
|
20
|
+
"10.3", // 241223
|
|
21
|
+
"11",
|
|
22
|
+
"12",
|
|
23
|
+
"13", // 2503
|
|
24
|
+
"13.1", // 250314
|
|
25
|
+
"14",
|
|
26
|
+
"15", // Для версии системы 2505
|
|
27
|
+
"15.1", // Для версии системы 250609
|
|
28
|
+
"15.2", // Для версии системы 250614
|
|
29
|
+
"16", // Для версии системы 2507
|
|
30
|
+
"16.1", // Для версии системы 250703
|
|
31
|
+
"16.2", // Для версии системы 250709
|
|
32
|
+
"17", // 2508
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Актуальная версия settings, с которой работает система.
|
|
36
|
+
* Используется единая версия для settings виджетов и показателей.
|
|
37
|
+
*/
|
|
38
|
+
var apiVersion = apiVersions.at(-1);
|
|
39
|
+
|
|
6
40
|
exports.EWidgetActionInputMethod = void 0;
|
|
7
41
|
(function (EWidgetActionInputMethod) {
|
|
8
42
|
EWidgetActionInputMethod["COLUMN"] = "COLUMN";
|
|
@@ -23,6 +57,7 @@ exports.EActionTypes = void 0;
|
|
|
23
57
|
EActionTypes["UPDATE_VARIABLE"] = "UPDATE_VARIABLE";
|
|
24
58
|
EActionTypes["EXECUTE_SCRIPT"] = "EXECUTE_SCRIPT";
|
|
25
59
|
EActionTypes["OPEN_VIEW"] = "OPEN_VIEW";
|
|
60
|
+
EActionTypes["DRILL_DOWN"] = "DRILL_DOWN";
|
|
26
61
|
})(exports.EActionTypes || (exports.EActionTypes = {}));
|
|
27
62
|
exports.EViewMode = void 0;
|
|
28
63
|
(function (EViewMode) {
|
|
@@ -65,6 +100,46 @@ exports.EActionButtonsTypes = void 0;
|
|
|
65
100
|
EActionButtonsTypes["SECONDARY"] = "primary-outlined";
|
|
66
101
|
})(exports.EActionButtonsTypes || (exports.EActionButtonsTypes = {}));
|
|
67
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Глобальный счетчик для генерации ID.
|
|
105
|
+
*
|
|
106
|
+
* @todo
|
|
107
|
+
* В будущем можно заменить единый счетчик на изолированные счетчики в разных контекстах.
|
|
108
|
+
*/
|
|
109
|
+
var id = 1;
|
|
110
|
+
var AutoIdentifiedArrayItemSchema = function (z) {
|
|
111
|
+
return z.object({
|
|
112
|
+
/**
|
|
113
|
+
* Идентификатор, добавляемый системой "на лету" для удобства разработки, не сохраняется на сервер.
|
|
114
|
+
* Гарантируется уникальность id в пределах settings виджета.
|
|
115
|
+
*/
|
|
116
|
+
id: z
|
|
117
|
+
.number()
|
|
118
|
+
.default(-1)
|
|
119
|
+
.transform(function (currentId) { return (currentId === -1 ? id++ : currentId); }),
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
var BaseWidgetSettingsSchema = function (z) {
|
|
123
|
+
return z.object({
|
|
124
|
+
title: z.string().default(""),
|
|
125
|
+
titleSize: themed(z.number().default(14), function (theme) { return theme.widgets.titleSize; }),
|
|
126
|
+
titleColor: themed(ColorSchema(z), function (theme) { return theme.widgets.titleColor; }),
|
|
127
|
+
titleWeight: themed(z.enum(exports.EFontWeight).default(exports.EFontWeight.NORMAL), function (theme) { return theme.widgets.titleWeight; }),
|
|
128
|
+
stateName: z.string().nullable().default(null),
|
|
129
|
+
showMarkdown: z.boolean().default(false),
|
|
130
|
+
markdownMeasures: z.array(MarkdownMeasureSchema(z)).default([]),
|
|
131
|
+
markdownText: z.string().default(""),
|
|
132
|
+
markdownTextSize: z.number().default(14),
|
|
133
|
+
filters: z.array(SettingsFilterSchema(z)).default([]),
|
|
134
|
+
filterMode: z.enum(exports.EWidgetFilterMode).default(exports.EWidgetFilterMode.DEFAULT),
|
|
135
|
+
ignoreFilters: z.boolean().default(false),
|
|
136
|
+
sorting: z.array(WidgetSortingIndicatorSchema(z)).default([]),
|
|
137
|
+
actionButtons: z.array(ActionButtonSchema(z)).default([]),
|
|
138
|
+
paddings: themed(z.union([z.number(), z.string()]).default(8), function (theme) { return theme.widgets.paddings; }),
|
|
139
|
+
viewTheme: z.boolean().default(false),
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
68
143
|
exports.ESimpleDataType = void 0;
|
|
69
144
|
(function (ESimpleDataType) {
|
|
70
145
|
ESimpleDataType["OTHER"] = "OTHER";
|
|
@@ -77,285 +152,6 @@ exports.ESimpleDataType = void 0;
|
|
|
77
152
|
ESimpleDataType["BOOLEAN"] = "BOOLEAN";
|
|
78
153
|
})(exports.ESimpleDataType || (exports.ESimpleDataType = {}));
|
|
79
154
|
|
|
80
|
-
var prepareValuesForSql = function (simpleType, values) {
|
|
81
|
-
return simpleType === exports.ESimpleDataType.INTEGER ||
|
|
82
|
-
simpleType === exports.ESimpleDataType.FLOAT ||
|
|
83
|
-
simpleType === exports.ESimpleDataType.BOOLEAN
|
|
84
|
-
? values
|
|
85
|
-
: values.map(function (value) {
|
|
86
|
-
return value === null ? null : "'".concat(escapeSingularQuotes$1(escapeReverseSlash(value)), "'");
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
var escapeReverseSlash = function (formula) {
|
|
90
|
-
return formula.replaceAll(/\\/gm, "\\\\");
|
|
91
|
-
};
|
|
92
|
-
var escapeSingularQuotes$1 = function (formula) {
|
|
93
|
-
return formula.replaceAll("'", "\\'");
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/******************************************************************************
|
|
97
|
-
Copyright (c) Microsoft Corporation.
|
|
98
|
-
|
|
99
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
100
|
-
purpose with or without fee is hereby granted.
|
|
101
|
-
|
|
102
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
103
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
104
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
105
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
106
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
107
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
108
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
109
|
-
***************************************************************************** */
|
|
110
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var __assign = function() {
|
|
114
|
-
__assign = Object.assign || function __assign(t) {
|
|
115
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
116
|
-
s = arguments[i];
|
|
117
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
118
|
-
}
|
|
119
|
-
return t;
|
|
120
|
-
};
|
|
121
|
-
return __assign.apply(this, arguments);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
function __rest(s, e) {
|
|
125
|
-
var t = {};
|
|
126
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
127
|
-
t[p] = s[p];
|
|
128
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
129
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
130
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
131
|
-
t[p[i]] = s[p[i]];
|
|
132
|
-
}
|
|
133
|
-
return t;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function __values(o) {
|
|
137
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
138
|
-
if (m) return m.call(o);
|
|
139
|
-
if (o && typeof o.length === "number") return {
|
|
140
|
-
next: function () {
|
|
141
|
-
if (o && i >= o.length) o = void 0;
|
|
142
|
-
return { value: o && o[i++], done: !o };
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function __read(o, n) {
|
|
149
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
150
|
-
if (!m) return o;
|
|
151
|
-
var i = m.call(o), r, ar = [], e;
|
|
152
|
-
try {
|
|
153
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
154
|
-
}
|
|
155
|
-
catch (error) { e = { error: error }; }
|
|
156
|
-
finally {
|
|
157
|
-
try {
|
|
158
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
159
|
-
}
|
|
160
|
-
finally { if (e) throw e.error; }
|
|
161
|
-
}
|
|
162
|
-
return ar;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function __makeTemplateObject(cooked, raw) {
|
|
166
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
167
|
-
return cooked;
|
|
168
|
-
}
|
|
169
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
170
|
-
var e = new Error(message);
|
|
171
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
exports.ECalculatorFilterMethods = void 0;
|
|
175
|
-
(function (ECalculatorFilterMethods) {
|
|
176
|
-
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
177
|
-
ECalculatorFilterMethods["NOT_EQUAL_TO"] = "NOT_EQUAL_TO";
|
|
178
|
-
ECalculatorFilterMethods["GREATER_THAN"] = "GREATER_THAN";
|
|
179
|
-
ECalculatorFilterMethods["LESS_THAN"] = "LESS_THAN";
|
|
180
|
-
ECalculatorFilterMethods["GREATER_THAN_OR_EQUAL_TO"] = "GREATER_THAN_OR_EQUAL_TO";
|
|
181
|
-
ECalculatorFilterMethods["LESS_THAN_OR_EQUAL_TO"] = "LESS_THAN_OR_EQUAL_TO";
|
|
182
|
-
ECalculatorFilterMethods["STARTS_WITH"] = "STARTS_WITH";
|
|
183
|
-
ECalculatorFilterMethods["ENDS_WITH"] = "ENDS_WITH";
|
|
184
|
-
ECalculatorFilterMethods["CONTAINS"] = "CONTAINS";
|
|
185
|
-
ECalculatorFilterMethods["NOT_CONTAINS"] = "NOT_CONTAINS";
|
|
186
|
-
ECalculatorFilterMethods["IN_RANGE"] = "IN_RANGE";
|
|
187
|
-
ECalculatorFilterMethods["NOT_IN_RANGE"] = "NOT_IN_RANGE";
|
|
188
|
-
ECalculatorFilterMethods["INCLUDE"] = "INCLUDE";
|
|
189
|
-
ECalculatorFilterMethods["EXCLUDE"] = "EXCLUDE";
|
|
190
|
-
ECalculatorFilterMethods["NONEMPTY"] = "NONEMPTY";
|
|
191
|
-
ECalculatorFilterMethods["EMPTY"] = "EMPTY";
|
|
192
|
-
})(exports.ECalculatorFilterMethods || (exports.ECalculatorFilterMethods = {}));
|
|
193
|
-
|
|
194
|
-
var formulaFilterMethods = __assign(__assign({}, exports.ECalculatorFilterMethods), { LAST_TIME: "LAST_TIME" });
|
|
195
|
-
exports.EProcessFilterNames = void 0;
|
|
196
|
-
(function (EProcessFilterNames) {
|
|
197
|
-
/** Наличие события */
|
|
198
|
-
EProcessFilterNames["presenceOfEvent"] = "presenceOfEvent";
|
|
199
|
-
/** Количество повторов события */
|
|
200
|
-
EProcessFilterNames["repetitionOfEvent"] = "repetitionOfEvent";
|
|
201
|
-
/** Наличие перехода */
|
|
202
|
-
EProcessFilterNames["presenceOfTransition"] = "presenceOfTransition";
|
|
203
|
-
/** Длительность перехода */
|
|
204
|
-
EProcessFilterNames["durationOfTransition"] = "durationOfTransition";
|
|
205
|
-
})(exports.EProcessFilterNames || (exports.EProcessFilterNames = {}));
|
|
206
|
-
exports.EFormulaFilterFieldKeys = void 0;
|
|
207
|
-
(function (EFormulaFilterFieldKeys) {
|
|
208
|
-
EFormulaFilterFieldKeys["date"] = "date";
|
|
209
|
-
EFormulaFilterFieldKeys["dateRange"] = "dateRange";
|
|
210
|
-
EFormulaFilterFieldKeys["numberRange"] = "numberRange";
|
|
211
|
-
EFormulaFilterFieldKeys["string"] = "string";
|
|
212
|
-
EFormulaFilterFieldKeys["lastTimeValue"] = "lastTimeValue";
|
|
213
|
-
EFormulaFilterFieldKeys["lastTimeUnit"] = "lastTimeUnit";
|
|
214
|
-
EFormulaFilterFieldKeys["durationUnit"] = "durationUnit";
|
|
215
|
-
})(exports.EFormulaFilterFieldKeys || (exports.EFormulaFilterFieldKeys = {}));
|
|
216
|
-
exports.EDimensionProcessFilterTimeUnit = void 0;
|
|
217
|
-
(function (EDimensionProcessFilterTimeUnit) {
|
|
218
|
-
EDimensionProcessFilterTimeUnit["YEARS"] = "YEARS";
|
|
219
|
-
EDimensionProcessFilterTimeUnit["MONTHS"] = "MONTHS";
|
|
220
|
-
EDimensionProcessFilterTimeUnit["HOURS"] = "HOURS";
|
|
221
|
-
EDimensionProcessFilterTimeUnit["DAYS"] = "DAYS";
|
|
222
|
-
EDimensionProcessFilterTimeUnit["MINUTES"] = "MINUTES";
|
|
223
|
-
})(exports.EDimensionProcessFilterTimeUnit || (exports.EDimensionProcessFilterTimeUnit = {}));
|
|
224
|
-
var isFormulaFilterValue = function (value) {
|
|
225
|
-
return "filteringMethod" in value;
|
|
226
|
-
};
|
|
227
|
-
var isDimensionProcessFilter = function (filter) { return "value" in filter && "condition" in filter; };
|
|
228
|
-
|
|
229
|
-
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
230
|
-
var compactMap = function (items, f) {
|
|
231
|
-
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
232
|
-
};
|
|
233
|
-
var isNil = function (value) {
|
|
234
|
-
return value === null || value === undefined;
|
|
235
|
-
};
|
|
236
|
-
function memoize(fn) {
|
|
237
|
-
var cache = new Map();
|
|
238
|
-
return function (arg) {
|
|
239
|
-
if (cache.has(arg)) {
|
|
240
|
-
return cache.get(arg);
|
|
241
|
-
}
|
|
242
|
-
var result = fn(arg);
|
|
243
|
-
cache.set(arg, result);
|
|
244
|
-
return result;
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
exports.EClickHouseBaseTypes = void 0;
|
|
249
|
-
(function (EClickHouseBaseTypes) {
|
|
250
|
-
// DATE
|
|
251
|
-
EClickHouseBaseTypes["Date"] = "Date";
|
|
252
|
-
EClickHouseBaseTypes["Date32"] = "Date32";
|
|
253
|
-
// DATETIME
|
|
254
|
-
EClickHouseBaseTypes["DateTime"] = "DateTime";
|
|
255
|
-
EClickHouseBaseTypes["DateTime32"] = "DateTime32";
|
|
256
|
-
// DATETIME64
|
|
257
|
-
EClickHouseBaseTypes["DateTime64"] = "DateTime64";
|
|
258
|
-
// STRING
|
|
259
|
-
EClickHouseBaseTypes["FixedString"] = "FixedString";
|
|
260
|
-
EClickHouseBaseTypes["String"] = "String";
|
|
261
|
-
// FLOAT
|
|
262
|
-
EClickHouseBaseTypes["Decimal"] = "Decimal";
|
|
263
|
-
EClickHouseBaseTypes["Decimal32"] = "Decimal32";
|
|
264
|
-
EClickHouseBaseTypes["Decimal64"] = "Decimal64";
|
|
265
|
-
EClickHouseBaseTypes["Decimal128"] = "Decimal128";
|
|
266
|
-
EClickHouseBaseTypes["Decimal256"] = "Decimal256";
|
|
267
|
-
EClickHouseBaseTypes["Float32"] = "Float32";
|
|
268
|
-
EClickHouseBaseTypes["Float64"] = "Float64";
|
|
269
|
-
// INTEGER
|
|
270
|
-
EClickHouseBaseTypes["Int8"] = "Int8";
|
|
271
|
-
EClickHouseBaseTypes["Int16"] = "Int16";
|
|
272
|
-
EClickHouseBaseTypes["Int32"] = "Int32";
|
|
273
|
-
EClickHouseBaseTypes["Int64"] = "Int64";
|
|
274
|
-
EClickHouseBaseTypes["Int128"] = "Int128";
|
|
275
|
-
EClickHouseBaseTypes["Int256"] = "Int256";
|
|
276
|
-
EClickHouseBaseTypes["UInt8"] = "UInt8";
|
|
277
|
-
EClickHouseBaseTypes["UInt16"] = "UInt16";
|
|
278
|
-
EClickHouseBaseTypes["UInt32"] = "UInt32";
|
|
279
|
-
EClickHouseBaseTypes["UInt64"] = "UInt64";
|
|
280
|
-
EClickHouseBaseTypes["UInt128"] = "UInt128";
|
|
281
|
-
EClickHouseBaseTypes["UInt256"] = "UInt256";
|
|
282
|
-
// BOOLEAN
|
|
283
|
-
EClickHouseBaseTypes["Bool"] = "Bool";
|
|
284
|
-
})(exports.EClickHouseBaseTypes || (exports.EClickHouseBaseTypes = {}));
|
|
285
|
-
var stringTypes = ["String", "FixedString"];
|
|
286
|
-
var parseClickHouseType = memoize(function (type) {
|
|
287
|
-
if (isNil(type)) {
|
|
288
|
-
return {
|
|
289
|
-
simpleBaseType: exports.ESimpleDataType.OTHER,
|
|
290
|
-
dbBaseDataType: undefined,
|
|
291
|
-
containers: [],
|
|
292
|
-
simpleType: exports.ESimpleDataType.OTHER,
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
var _a = extractInnerType(type), containers = _a.containers, dbBaseDataType = _a.dbBaseDataType;
|
|
296
|
-
if (!dbBaseDataType) {
|
|
297
|
-
throw new Error("Invalid ClickHouse type: ".concat(type));
|
|
298
|
-
}
|
|
299
|
-
return {
|
|
300
|
-
dbBaseDataType: dbBaseDataType,
|
|
301
|
-
simpleBaseType: simplifyBaseType(dbBaseDataType),
|
|
302
|
-
containers: containers,
|
|
303
|
-
get simpleType() {
|
|
304
|
-
return containers.includes("Array") ? exports.ESimpleDataType.OTHER : this.simpleBaseType;
|
|
305
|
-
},
|
|
306
|
-
};
|
|
307
|
-
});
|
|
308
|
-
/** 'A(B(C))' -> ['A', 'B', 'C'] */
|
|
309
|
-
var splitByBrackets = function (input) { return input.split(/[\(\)]/).filter(Boolean); };
|
|
310
|
-
/**
|
|
311
|
-
* Отделить внутренний тип от оберток.
|
|
312
|
-
* Не поддерживаются обертки Tuple и LowCardinality.
|
|
313
|
-
*/
|
|
314
|
-
var extractInnerType = function (type) {
|
|
315
|
-
var tokens = splitByBrackets(type);
|
|
316
|
-
// Удаление параметров типа.
|
|
317
|
-
if (tokens.length > 0 && isTypeParameters(tokens.at(-1))) {
|
|
318
|
-
tokens.pop();
|
|
319
|
-
}
|
|
320
|
-
var dbBaseDataType = tokens.pop();
|
|
321
|
-
return { containers: tokens, dbBaseDataType: dbBaseDataType };
|
|
322
|
-
};
|
|
323
|
-
var simplifyBaseType = function (dbBaseType) {
|
|
324
|
-
var isSourceTypeStartsWith = function (prefix) { return dbBaseType.startsWith(prefix); };
|
|
325
|
-
if (isSourceTypeStartsWith("Int") || isSourceTypeStartsWith("UInt")) {
|
|
326
|
-
return exports.ESimpleDataType.INTEGER;
|
|
327
|
-
}
|
|
328
|
-
if (isSourceTypeStartsWith("Decimal") || isSourceTypeStartsWith("Float")) {
|
|
329
|
-
return exports.ESimpleDataType.FLOAT;
|
|
330
|
-
}
|
|
331
|
-
if (stringTypes.some(isSourceTypeStartsWith)) {
|
|
332
|
-
return exports.ESimpleDataType.STRING;
|
|
333
|
-
}
|
|
334
|
-
if (isSourceTypeStartsWith("DateTime64")) {
|
|
335
|
-
return exports.ESimpleDataType.DATETIME64;
|
|
336
|
-
}
|
|
337
|
-
if (isSourceTypeStartsWith("DateTime")) {
|
|
338
|
-
return exports.ESimpleDataType.DATETIME;
|
|
339
|
-
}
|
|
340
|
-
if (isSourceTypeStartsWith("Date")) {
|
|
341
|
-
return exports.ESimpleDataType.DATE;
|
|
342
|
-
}
|
|
343
|
-
if (isSourceTypeStartsWith("Bool")) {
|
|
344
|
-
return exports.ESimpleDataType.BOOLEAN;
|
|
345
|
-
}
|
|
346
|
-
return exports.ESimpleDataType.OTHER;
|
|
347
|
-
};
|
|
348
|
-
/**
|
|
349
|
-
* - `3` -> true
|
|
350
|
-
* - `3, 'Europe/Moscow'` -> true
|
|
351
|
-
* - `3, Europe/Moscow` -> false
|
|
352
|
-
*
|
|
353
|
-
* Пример типа с параметрами: `DateTime64(3, 'Europe/Moscow')`
|
|
354
|
-
*/
|
|
355
|
-
var isTypeParameters = function (stringifiedParameters) {
|
|
356
|
-
return stringifiedParameters.split(", ").some(function (p) { return !Number.isNaN(Number(p)) || p.startsWith("'"); });
|
|
357
|
-
};
|
|
358
|
-
|
|
359
155
|
exports.EFormatTypes = void 0;
|
|
360
156
|
(function (EFormatTypes) {
|
|
361
157
|
/** Дата */
|
|
@@ -649,6 +445,1051 @@ var formattingConfig = {
|
|
|
649
445
|
},
|
|
650
446
|
};
|
|
651
447
|
|
|
448
|
+
/******************************************************************************
|
|
449
|
+
Copyright (c) Microsoft Corporation.
|
|
450
|
+
|
|
451
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
452
|
+
purpose with or without fee is hereby granted.
|
|
453
|
+
|
|
454
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
455
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
456
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
457
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
458
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
459
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
460
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
461
|
+
***************************************************************************** */
|
|
462
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
var __assign = function() {
|
|
466
|
+
__assign = Object.assign || function __assign(t) {
|
|
467
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
468
|
+
s = arguments[i];
|
|
469
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
470
|
+
}
|
|
471
|
+
return t;
|
|
472
|
+
};
|
|
473
|
+
return __assign.apply(this, arguments);
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
function __rest(s, e) {
|
|
477
|
+
var t = {};
|
|
478
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
479
|
+
t[p] = s[p];
|
|
480
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
481
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
482
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
483
|
+
t[p[i]] = s[p[i]];
|
|
484
|
+
}
|
|
485
|
+
return t;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function __values(o) {
|
|
489
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
490
|
+
if (m) return m.call(o);
|
|
491
|
+
if (o && typeof o.length === "number") return {
|
|
492
|
+
next: function () {
|
|
493
|
+
if (o && i >= o.length) o = void 0;
|
|
494
|
+
return { value: o && o[i++], done: !o };
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function __read(o, n) {
|
|
501
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
502
|
+
if (!m) return o;
|
|
503
|
+
var i = m.call(o), r, ar = [], e;
|
|
504
|
+
try {
|
|
505
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
506
|
+
}
|
|
507
|
+
catch (error) { e = { error: error }; }
|
|
508
|
+
finally {
|
|
509
|
+
try {
|
|
510
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
511
|
+
}
|
|
512
|
+
finally { if (e) throw e.error; }
|
|
513
|
+
}
|
|
514
|
+
return ar;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function __makeTemplateObject(cooked, raw) {
|
|
518
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
519
|
+
return cooked;
|
|
520
|
+
}
|
|
521
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
522
|
+
var e = new Error(message);
|
|
523
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
exports.EWidgetIndicatorType = void 0;
|
|
527
|
+
(function (EWidgetIndicatorType) {
|
|
528
|
+
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
529
|
+
EWidgetIndicatorType["EVENT_INDICATOR"] = "EVENT_INDICATOR";
|
|
530
|
+
EWidgetIndicatorType["TRANSITION_INDICATOR"] = "TRANSITION_INDICATOR";
|
|
531
|
+
EWidgetIndicatorType["DIMENSION"] = "DIMENSION";
|
|
532
|
+
EWidgetIndicatorType["SORTING"] = "SORTING";
|
|
533
|
+
})(exports.EWidgetIndicatorType || (exports.EWidgetIndicatorType = {}));
|
|
534
|
+
exports.EOuterAggregation = void 0;
|
|
535
|
+
(function (EOuterAggregation) {
|
|
536
|
+
EOuterAggregation["avg"] = "avg";
|
|
537
|
+
EOuterAggregation["median"] = "median";
|
|
538
|
+
EOuterAggregation["count"] = "count";
|
|
539
|
+
EOuterAggregation["countDistinct"] = "countDistinct";
|
|
540
|
+
EOuterAggregation["min"] = "min";
|
|
541
|
+
EOuterAggregation["max"] = "max";
|
|
542
|
+
EOuterAggregation["sum"] = "sum";
|
|
543
|
+
EOuterAggregation["top"] = "top";
|
|
544
|
+
})(exports.EOuterAggregation || (exports.EOuterAggregation = {}));
|
|
545
|
+
/** Режимы значения показателя (на основе чего генерируется формула) */
|
|
546
|
+
exports.EWidgetIndicatorValueModes = void 0;
|
|
547
|
+
(function (EWidgetIndicatorValueModes) {
|
|
548
|
+
/** Готовая формула (как правило, введенная пользователем через редактор формул) */
|
|
549
|
+
EWidgetIndicatorValueModes["FORMULA"] = "FORMULA";
|
|
550
|
+
/** Шаблон формулы, предоставляемый системой */
|
|
551
|
+
EWidgetIndicatorValueModes["TEMPLATE"] = "TEMPLATE";
|
|
552
|
+
EWidgetIndicatorValueModes["AGGREGATION"] = "AGGREGATION";
|
|
553
|
+
EWidgetIndicatorValueModes["DURATION"] = "DURATION";
|
|
554
|
+
EWidgetIndicatorValueModes["CONVERSION"] = "CONVERSION";
|
|
555
|
+
EWidgetIndicatorValueModes["START_TIME"] = "START_TIME";
|
|
556
|
+
EWidgetIndicatorValueModes["END_TIME"] = "END_TIME";
|
|
557
|
+
})(exports.EWidgetIndicatorValueModes || (exports.EWidgetIndicatorValueModes = {}));
|
|
558
|
+
/** Режимы сортировки (на что ссылается сортировка) */
|
|
559
|
+
exports.ESortingValueModes = void 0;
|
|
560
|
+
(function (ESortingValueModes) {
|
|
561
|
+
/** Сортировка по формуле */
|
|
562
|
+
ESortingValueModes["FORMULA"] = "FORMULA";
|
|
563
|
+
/** Сортировка по показателю(разрезу или мере) виджета */
|
|
564
|
+
ESortingValueModes["IN_WIDGET"] = "IN_WIDGET";
|
|
565
|
+
})(exports.ESortingValueModes || (exports.ESortingValueModes = {}));
|
|
566
|
+
exports.EFormatOrFormattingMode = void 0;
|
|
567
|
+
(function (EFormatOrFormattingMode) {
|
|
568
|
+
EFormatOrFormattingMode["BASE"] = "BASE";
|
|
569
|
+
EFormatOrFormattingMode["TEMPLATE"] = "TEMPLATE";
|
|
570
|
+
})(exports.EFormatOrFormattingMode || (exports.EFormatOrFormattingMode = {}));
|
|
571
|
+
function inheritDisplayConditionFromHierarchy(dimension, hierarchy) {
|
|
572
|
+
return __assign(__assign({}, dimension), { displayCondition: hierarchy.displayCondition });
|
|
573
|
+
}
|
|
574
|
+
/** Тип показателя */
|
|
575
|
+
exports.EIndicatorType = void 0;
|
|
576
|
+
(function (EIndicatorType) {
|
|
577
|
+
/** Показатели процесса */
|
|
578
|
+
EIndicatorType["PROCESS_MEASURE"] = "PROCESS_MEASURE";
|
|
579
|
+
/** Вводимое значение */
|
|
580
|
+
EIndicatorType["STATIC"] = "STATIC";
|
|
581
|
+
/** Статический список */
|
|
582
|
+
EIndicatorType["STATIC_LIST"] = "STATIC_LIST";
|
|
583
|
+
/** Динамический список */
|
|
584
|
+
EIndicatorType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
585
|
+
/** Список колонок */
|
|
586
|
+
EIndicatorType["COLUMN_LIST"] = "COLUMN_LIST";
|
|
587
|
+
/** Разрез */
|
|
588
|
+
EIndicatorType["DIMENSION"] = "DIMENSION";
|
|
589
|
+
/** Мера */
|
|
590
|
+
EIndicatorType["MEASURE"] = "MEASURE";
|
|
591
|
+
/** Иерархия */
|
|
592
|
+
EIndicatorType["DYNAMIC_DIMENSION"] = "DYNAMIC_DIMENSION";
|
|
593
|
+
/** Пользовательская сортировка */
|
|
594
|
+
EIndicatorType["USER_SORTING"] = "USER_SORTING";
|
|
595
|
+
})(exports.EIndicatorType || (exports.EIndicatorType = {}));
|
|
596
|
+
/** Обобщенные типы значений переменных */
|
|
597
|
+
exports.ESimpleInputType = void 0;
|
|
598
|
+
(function (ESimpleInputType) {
|
|
599
|
+
/** Число (точность Float64) */
|
|
600
|
+
ESimpleInputType["NUMBER"] = "FLOAT";
|
|
601
|
+
/** Целое число (точность Int64) */
|
|
602
|
+
ESimpleInputType["INTEGER_NUMBER"] = "INTEGER";
|
|
603
|
+
/** Текст */
|
|
604
|
+
ESimpleInputType["TEXT"] = "STRING";
|
|
605
|
+
/** Дата (точность Date) */
|
|
606
|
+
ESimpleInputType["DATE"] = "DATE";
|
|
607
|
+
/** Дата и время (точность DateTime64) */
|
|
608
|
+
ESimpleInputType["DATE_AND_TIME"] = "DATETIME";
|
|
609
|
+
/** Логический тип */
|
|
610
|
+
ESimpleInputType["BOOLEAN"] = "BOOLEAN";
|
|
611
|
+
})(exports.ESimpleInputType || (exports.ESimpleInputType = {}));
|
|
612
|
+
function isDimensionsHierarchy(indicator) {
|
|
613
|
+
return "hierarchyDimensions" in indicator;
|
|
614
|
+
}
|
|
615
|
+
exports.OuterAggregation = void 0;
|
|
616
|
+
(function (OuterAggregation) {
|
|
617
|
+
OuterAggregation["avg"] = "avgIf";
|
|
618
|
+
OuterAggregation["median"] = "medianIf";
|
|
619
|
+
OuterAggregation["count"] = "countIf";
|
|
620
|
+
OuterAggregation["countDistinct"] = "countIfDistinct";
|
|
621
|
+
OuterAggregation["min"] = "minIf";
|
|
622
|
+
OuterAggregation["max"] = "maxIf";
|
|
623
|
+
OuterAggregation["sum"] = "sumIf";
|
|
624
|
+
})(exports.OuterAggregation || (exports.OuterAggregation = {}));
|
|
625
|
+
exports.EDurationTemplateName = void 0;
|
|
626
|
+
(function (EDurationTemplateName) {
|
|
627
|
+
EDurationTemplateName["avg"] = "avg";
|
|
628
|
+
EDurationTemplateName["median"] = "median";
|
|
629
|
+
})(exports.EDurationTemplateName || (exports.EDurationTemplateName = {}));
|
|
630
|
+
exports.EEventAppearances = void 0;
|
|
631
|
+
(function (EEventAppearances) {
|
|
632
|
+
EEventAppearances["FIRST"] = "FIRST";
|
|
633
|
+
EEventAppearances["LAST"] = "LAST";
|
|
634
|
+
})(exports.EEventAppearances || (exports.EEventAppearances = {}));
|
|
635
|
+
|
|
636
|
+
// Типы, используемые в значениях элементов управления.
|
|
637
|
+
exports.EWidgetFilterMode = void 0;
|
|
638
|
+
(function (EWidgetFilterMode) {
|
|
639
|
+
EWidgetFilterMode["DEFAULT"] = "DEFAULT";
|
|
640
|
+
EWidgetFilterMode["SINGLE"] = "SINGLE";
|
|
641
|
+
EWidgetFilterMode["DISABLED"] = "DISABLED";
|
|
642
|
+
})(exports.EWidgetFilterMode || (exports.EWidgetFilterMode = {}));
|
|
643
|
+
exports.EMarkdownDisplayMode = void 0;
|
|
644
|
+
(function (EMarkdownDisplayMode) {
|
|
645
|
+
EMarkdownDisplayMode["NONE"] = "NONE";
|
|
646
|
+
EMarkdownDisplayMode["INDICATOR"] = "INDICATOR";
|
|
647
|
+
})(exports.EMarkdownDisplayMode || (exports.EMarkdownDisplayMode = {}));
|
|
648
|
+
exports.EDisplayConditionMode = void 0;
|
|
649
|
+
(function (EDisplayConditionMode) {
|
|
650
|
+
EDisplayConditionMode["DISABLED"] = "DISABLED";
|
|
651
|
+
EDisplayConditionMode["FORMULA"] = "FORMULA";
|
|
652
|
+
EDisplayConditionMode["VARIABLE"] = "VARIABLE";
|
|
653
|
+
})(exports.EDisplayConditionMode || (exports.EDisplayConditionMode = {}));
|
|
654
|
+
exports.EFontWeight = void 0;
|
|
655
|
+
(function (EFontWeight) {
|
|
656
|
+
EFontWeight["NORMAL"] = "NORMAL";
|
|
657
|
+
EFontWeight["BOLD"] = "BOLD";
|
|
658
|
+
})(exports.EFontWeight || (exports.EFontWeight = {}));
|
|
659
|
+
exports.EHeightMode = void 0;
|
|
660
|
+
(function (EHeightMode) {
|
|
661
|
+
EHeightMode["FIXED"] = "FIXED";
|
|
662
|
+
EHeightMode["PERCENT"] = "PERCENT";
|
|
663
|
+
})(exports.EHeightMode || (exports.EHeightMode = {}));
|
|
664
|
+
|
|
665
|
+
var SortDirectionSchema = function (z) {
|
|
666
|
+
return z.union([z.literal(exports.ESortDirection.ascend), z.literal(exports.ESortDirection.descend)]);
|
|
667
|
+
};
|
|
668
|
+
var SortOrderSchema = function (z) {
|
|
669
|
+
return z.object({
|
|
670
|
+
/** Формула сортировки */
|
|
671
|
+
formula: FormulaSchema(z),
|
|
672
|
+
/** Тип данных формулы */
|
|
673
|
+
dbDataType: z.string().optional(),
|
|
674
|
+
/** Направление сортировки */
|
|
675
|
+
direction: SortDirectionSchema(z),
|
|
676
|
+
/** Условие применения сортировки */
|
|
677
|
+
displayCondition: FormulaSchema(z).optional(),
|
|
678
|
+
});
|
|
679
|
+
};
|
|
680
|
+
var WidgetSortingValueSchema = function (z) {
|
|
681
|
+
return z.discriminatedUnion("mode", [
|
|
682
|
+
z.object({
|
|
683
|
+
mode: z.literal(exports.ESortingValueModes.FORMULA),
|
|
684
|
+
formula: FormulaSchema(z),
|
|
685
|
+
dbDataType: z.string().optional(),
|
|
686
|
+
}),
|
|
687
|
+
z.object({
|
|
688
|
+
mode: z.literal(exports.ESortingValueModes.IN_WIDGET),
|
|
689
|
+
group: z.string(),
|
|
690
|
+
index: z.number(),
|
|
691
|
+
}),
|
|
692
|
+
]);
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
/** Ключи мета-данных внутри схем настроек */
|
|
696
|
+
exports.ESettingsSchemaMetaKey = void 0;
|
|
697
|
+
(function (ESettingsSchemaMetaKey) {
|
|
698
|
+
/** Привязка значения из темы к настройке */
|
|
699
|
+
ESettingsSchemaMetaKey["themeValue"] = "themeValue";
|
|
700
|
+
/** Тип сущности */
|
|
701
|
+
ESettingsSchemaMetaKey["entity"] = "entity";
|
|
702
|
+
})(exports.ESettingsSchemaMetaKey || (exports.ESettingsSchemaMetaKey = {}));
|
|
703
|
+
|
|
704
|
+
var _a$6;
|
|
705
|
+
var RangeSchema = function (z) {
|
|
706
|
+
return z.object({
|
|
707
|
+
unit: z.string().optional(),
|
|
708
|
+
min: z.number().optional(),
|
|
709
|
+
max: z.number().optional(),
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
var DisplayConditionSchema = function (z) {
|
|
713
|
+
return z
|
|
714
|
+
.discriminatedUnion("mode", [
|
|
715
|
+
z.object({
|
|
716
|
+
mode: z.literal(exports.EDisplayConditionMode.DISABLED),
|
|
717
|
+
}),
|
|
718
|
+
z.object({
|
|
719
|
+
mode: z.literal(exports.EDisplayConditionMode.FORMULA),
|
|
720
|
+
formula: FormulaSchema(z),
|
|
721
|
+
}),
|
|
722
|
+
z.object({
|
|
723
|
+
mode: z.literal(exports.EDisplayConditionMode.VARIABLE),
|
|
724
|
+
variableName: NameNullableSchema(z),
|
|
725
|
+
variableValue: z.string().nullable().default(null),
|
|
726
|
+
}),
|
|
727
|
+
])
|
|
728
|
+
.default({ mode: exports.EDisplayConditionMode.DISABLED });
|
|
729
|
+
};
|
|
730
|
+
/** Схема ключа сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
731
|
+
var KeyNullableSchema = function (z) { return z.string().nullable().default(null); };
|
|
732
|
+
/** Схема имени сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
733
|
+
var NameNullableSchema = function (z) { return z.string().nullable().default(null); };
|
|
734
|
+
/**
|
|
735
|
+
* Перечисление системных типов сущностей в схеме настроек виджетов.
|
|
736
|
+
* @note при расширении лучше положить на более общий уровень.
|
|
737
|
+
*/
|
|
738
|
+
var EEntity;
|
|
739
|
+
(function (EEntity) {
|
|
740
|
+
EEntity["formula"] = "formula";
|
|
741
|
+
})(EEntity || (EEntity = {}));
|
|
742
|
+
var formulaMeta = Object.freeze((_a$6 = {}, _a$6[exports.ESettingsSchemaMetaKey.entity] = EEntity.formula, _a$6));
|
|
743
|
+
/** Схема формулы */
|
|
744
|
+
var FormulaSchema = function (z) { return z.string().default("").meta(formulaMeta); };
|
|
745
|
+
/**
|
|
746
|
+
* Схема формулы, которая не может быть пустой строкой, но может быть в
|
|
747
|
+
* неинициализированном состоянии null (вместо пустой строки)
|
|
748
|
+
*
|
|
749
|
+
* @note для обратной совместимости без необходимости писать миграции
|
|
750
|
+
*/
|
|
751
|
+
var FormulaNullableSchema = function (z) {
|
|
752
|
+
return z.string().nullable().default(null).meta(formulaMeta);
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
var WidgetIndicatorSchema = function (z) {
|
|
756
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
757
|
+
name: z.string(),
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
var FormatSchema = function (z) {
|
|
761
|
+
return z
|
|
762
|
+
.object({
|
|
763
|
+
mode: z.enum(exports.EFormatOrFormattingMode),
|
|
764
|
+
value: z.enum(exports.EFormatTypes).optional(),
|
|
765
|
+
})
|
|
766
|
+
.default({ mode: exports.EFormatOrFormattingMode.BASE, value: exports.EFormatTypes.STRING });
|
|
767
|
+
};
|
|
768
|
+
var FormattingSchema = function (z) {
|
|
769
|
+
return z
|
|
770
|
+
.discriminatedUnion("mode", [
|
|
771
|
+
z.object({
|
|
772
|
+
mode: z.literal(exports.EFormatOrFormattingMode.BASE),
|
|
773
|
+
value: z.enum(exports.EFormattingPresets).default(exports.EFormattingPresets.AUTO),
|
|
774
|
+
}),
|
|
775
|
+
z.object({
|
|
776
|
+
mode: z.literal(exports.EFormatOrFormattingMode.TEMPLATE),
|
|
777
|
+
value: z.string().default(""),
|
|
778
|
+
}),
|
|
779
|
+
])
|
|
780
|
+
.default({ mode: exports.EFormatOrFormattingMode.BASE, value: exports.EFormattingPresets.AUTO });
|
|
781
|
+
};
|
|
782
|
+
var WidgetColumnIndicatorSchema = function (z) {
|
|
783
|
+
return WidgetIndicatorSchema(z).extend({
|
|
784
|
+
dbDataType: z.string().optional(),
|
|
785
|
+
format: FormatSchema(z).optional(),
|
|
786
|
+
formatting: FormattingSchema(z).optional(),
|
|
787
|
+
displayCondition: DisplayConditionSchema(z),
|
|
788
|
+
onClick: z.array(ActionsOnClickSchema(z)).optional(),
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
var WidgetIndicatorFormulaValueSchema = function (z) {
|
|
792
|
+
return z.object({
|
|
793
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
794
|
+
formula: FormulaSchema(z).optional(),
|
|
795
|
+
});
|
|
796
|
+
};
|
|
797
|
+
var WidgetIndicatorTemplateValueSchema = function (z) {
|
|
798
|
+
return z.object({
|
|
799
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
800
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
801
|
+
templateName: z.string().optional(),
|
|
802
|
+
/** Имя таблицы */
|
|
803
|
+
tableName: z.string().optional(),
|
|
804
|
+
/** Имя колонки */
|
|
805
|
+
columnName: z.string().optional(),
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
var ColumnIndicatorValueSchema = function (z) {
|
|
809
|
+
return z.union([MeasureValueSchema(z), DimensionValueSchema(z)]);
|
|
810
|
+
};
|
|
811
|
+
var MeasureValueSchema = function (z) {
|
|
812
|
+
return z.discriminatedUnion("mode", [
|
|
813
|
+
WidgetIndicatorFormulaValueSchema(z),
|
|
814
|
+
WidgetIndicatorTemplateValueSchema(z).extend({
|
|
815
|
+
innerTemplateName: z.enum(exports.EMeasureInnerTemplateNames).optional(),
|
|
816
|
+
}),
|
|
817
|
+
]);
|
|
818
|
+
};
|
|
819
|
+
var DimensionValueSchema = function (z) {
|
|
820
|
+
return z.discriminatedUnion("mode", [
|
|
821
|
+
WidgetIndicatorFormulaValueSchema(z),
|
|
822
|
+
WidgetIndicatorTemplateValueSchema(z).extend({
|
|
823
|
+
innerTemplateName: z.never().optional(),
|
|
824
|
+
}),
|
|
825
|
+
]);
|
|
826
|
+
};
|
|
827
|
+
var WidgetIndicatorAggregationValueSchema = function (z) {
|
|
828
|
+
return z.object({
|
|
829
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.AGGREGATION),
|
|
830
|
+
templateName: z.string(),
|
|
831
|
+
processKey: KeyNullableSchema(z),
|
|
832
|
+
eventName: NameNullableSchema(z),
|
|
833
|
+
eventNameFormula: FormulaNullableSchema(z),
|
|
834
|
+
anyEvent: z.literal(true).optional(),
|
|
835
|
+
caseCaseIdFormula: FormulaNullableSchema(z),
|
|
836
|
+
filters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
837
|
+
tableName: z.string().optional(),
|
|
838
|
+
columnName: z.string().optional(),
|
|
839
|
+
eventTimeFormula: FormulaNullableSchema(z).optional(),
|
|
840
|
+
});
|
|
841
|
+
};
|
|
842
|
+
var WidgetMeasureAggregationValueSchema = function (z) {
|
|
843
|
+
return WidgetIndicatorAggregationValueSchema(z).extend({ outerAggregation: z.enum(exports.EOuterAggregation) });
|
|
844
|
+
};
|
|
845
|
+
var WidgetIndicatorTimeValueSchema = function (z) {
|
|
846
|
+
return z.object({
|
|
847
|
+
templateName: z.string(),
|
|
848
|
+
mode: z.union([
|
|
849
|
+
z.literal(exports.EWidgetIndicatorValueModes.START_TIME),
|
|
850
|
+
z.literal(exports.EWidgetIndicatorValueModes.END_TIME),
|
|
851
|
+
]),
|
|
852
|
+
processKey: KeyNullableSchema(z),
|
|
853
|
+
eventName: NameNullableSchema(z),
|
|
854
|
+
eventTimeFormula: FormulaNullableSchema(z),
|
|
855
|
+
caseCaseIdFormula: FormulaNullableSchema(z),
|
|
856
|
+
eventNameFormula: FormulaNullableSchema(z),
|
|
857
|
+
filters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
858
|
+
});
|
|
859
|
+
};
|
|
860
|
+
var WidgetDimensionSchema = function (z) {
|
|
861
|
+
return WidgetColumnIndicatorSchema(z).extend({
|
|
862
|
+
value: z
|
|
863
|
+
.discriminatedUnion("mode", [
|
|
864
|
+
DimensionValueSchema(z),
|
|
865
|
+
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
866
|
+
innerTemplateName: z.string().optional(),
|
|
867
|
+
}),
|
|
868
|
+
WidgetIndicatorTimeValueSchema(z),
|
|
869
|
+
])
|
|
870
|
+
.optional(),
|
|
871
|
+
hideEmptyValues: z.boolean().default(false),
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
var WidgetDimensionInHierarchySchema = function (z) {
|
|
875
|
+
return WidgetDimensionSchema(z).omit({ displayCondition: true });
|
|
876
|
+
};
|
|
877
|
+
var WidgetDimensionHierarchySchema = function (z, dimensionSchema) {
|
|
878
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
879
|
+
name: z.string(),
|
|
880
|
+
// Для иерархии является дискриминатором, для него нельзя задавать дефолтное значение.
|
|
881
|
+
hierarchyDimensions: z.array(dimensionSchema),
|
|
882
|
+
displayCondition: DisplayConditionSchema(z),
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
var WidgetIndicatorConversionValueSchema = function (z) {
|
|
886
|
+
return z.object({
|
|
887
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.CONVERSION),
|
|
888
|
+
startEventNameFormula: FormulaNullableSchema(z),
|
|
889
|
+
startEventProcessKey: KeyNullableSchema(z),
|
|
890
|
+
startEventName: NameNullableSchema(z),
|
|
891
|
+
startEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
892
|
+
startEventTimeFormula: FormulaNullableSchema(z),
|
|
893
|
+
endEventNameFormula: FormulaNullableSchema(z),
|
|
894
|
+
endEventProcessKey: KeyNullableSchema(z),
|
|
895
|
+
endEventName: NameNullableSchema(z),
|
|
896
|
+
endEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
897
|
+
endCaseCaseIdFormula: FormulaNullableSchema(z),
|
|
898
|
+
endEventTimeFormula: FormulaNullableSchema(z),
|
|
899
|
+
});
|
|
900
|
+
};
|
|
901
|
+
var WidgetIndicatorDurationValueSchema = function (z) {
|
|
902
|
+
return WidgetIndicatorConversionValueSchema(z).extend({
|
|
903
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.DURATION),
|
|
904
|
+
templateName: z.string(),
|
|
905
|
+
startEventAppearances: z.enum(exports.EEventAppearances),
|
|
906
|
+
endEventAppearances: z.enum(exports.EEventAppearances),
|
|
907
|
+
});
|
|
908
|
+
};
|
|
909
|
+
var WidgetMeasureSchema = function (z) {
|
|
910
|
+
return WidgetColumnIndicatorSchema(z).extend({
|
|
911
|
+
value: z
|
|
912
|
+
.discriminatedUnion("mode", [
|
|
913
|
+
MeasureValueSchema(z),
|
|
914
|
+
WidgetMeasureAggregationValueSchema(z),
|
|
915
|
+
WidgetIndicatorConversionValueSchema(z),
|
|
916
|
+
WidgetIndicatorDurationValueSchema(z),
|
|
917
|
+
])
|
|
918
|
+
.optional(),
|
|
919
|
+
});
|
|
920
|
+
};
|
|
921
|
+
var MarkdownMeasureSchema = function (z) {
|
|
922
|
+
return WidgetMeasureSchema(z).extend({
|
|
923
|
+
displaySign: z.enum(exports.EMarkdownDisplayMode).default(exports.EMarkdownDisplayMode.NONE),
|
|
924
|
+
});
|
|
925
|
+
};
|
|
926
|
+
var WidgetSortingIndicatorSchema = function (z) {
|
|
927
|
+
return WidgetIndicatorSchema(z).extend({
|
|
928
|
+
direction: SortDirectionSchema(z),
|
|
929
|
+
value: WidgetSortingValueSchema(z),
|
|
930
|
+
});
|
|
931
|
+
};
|
|
932
|
+
var ProcessIndicatorValueSchema = function (z) {
|
|
933
|
+
return z.discriminatedUnion("mode", [
|
|
934
|
+
z.object({
|
|
935
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
936
|
+
formula: FormulaSchema(z),
|
|
937
|
+
}),
|
|
938
|
+
z.object({
|
|
939
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
940
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
941
|
+
templateName: z.string(),
|
|
942
|
+
}),
|
|
943
|
+
]);
|
|
944
|
+
};
|
|
945
|
+
var ProcessIndicatorSchema = function (z) {
|
|
946
|
+
return WidgetIndicatorSchema(z).extend({
|
|
947
|
+
value: ProcessIndicatorValueSchema(z).optional(),
|
|
948
|
+
dbDataType: z.string().optional(),
|
|
949
|
+
format: FormatSchema(z).optional(),
|
|
950
|
+
formatting: FormattingSchema(z).optional(),
|
|
951
|
+
displayCondition: DisplayConditionSchema(z),
|
|
952
|
+
});
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
var FormulaFilterValueSchema = function (z) {
|
|
956
|
+
var _a;
|
|
957
|
+
return z.object({
|
|
958
|
+
name: z.string().nullish(),
|
|
959
|
+
formula: z.string(),
|
|
960
|
+
sliceIndex: z.number().optional(),
|
|
961
|
+
dbDataType: z.string(),
|
|
962
|
+
format: z.enum(exports.EFormatTypes),
|
|
963
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
964
|
+
checkedValues: z.array(z.string().nullable()).optional(),
|
|
965
|
+
formValues: z
|
|
966
|
+
.object((_a = {},
|
|
967
|
+
_a[exports.EFormulaFilterFieldKeys.date] = z.string().nullable(),
|
|
968
|
+
_a[exports.EFormulaFilterFieldKeys.dateRange] = z.tuple([z.string(), z.string()]),
|
|
969
|
+
_a[exports.EFormulaFilterFieldKeys.numberRange] = z.tuple([
|
|
970
|
+
z.number().optional(),
|
|
971
|
+
z.number().optional(),
|
|
972
|
+
]),
|
|
973
|
+
_a[exports.EFormulaFilterFieldKeys.string] = z.string(),
|
|
974
|
+
// todo: отказаться от использования z.string(), оставить только z.number() [BI-15912]
|
|
975
|
+
_a[exports.EFormulaFilterFieldKeys.lastTimeValue] = z.number().or(z.string()),
|
|
976
|
+
_a[exports.EFormulaFilterFieldKeys.lastTimeUnit] = z.enum(exports.ELastTimeUnit),
|
|
977
|
+
_a[exports.EFormulaFilterFieldKeys.durationUnit] = z.enum(exports.EDurationUnit),
|
|
978
|
+
_a))
|
|
979
|
+
.partial()
|
|
980
|
+
.optional(),
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
var ExtendedFormulaFilterValueSchema = function (z) {
|
|
984
|
+
return z.union([FormulaFilterValueSchema(z), z.object({ formula: z.string() })]);
|
|
985
|
+
};
|
|
986
|
+
var DimensionProcessFilterSchema = function (z) {
|
|
987
|
+
return z.object({
|
|
988
|
+
value: z.union([
|
|
989
|
+
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
990
|
+
outerAggregation: z.enum(exports.EOuterAggregation),
|
|
991
|
+
}),
|
|
992
|
+
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
993
|
+
innerTemplateName: z.string().optional(),
|
|
994
|
+
}),
|
|
995
|
+
WidgetIndicatorTimeValueSchema(z),
|
|
996
|
+
z.object({
|
|
997
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
998
|
+
formula: z.string().optional(),
|
|
999
|
+
}),
|
|
1000
|
+
]),
|
|
1001
|
+
dbDataType: z.string(),
|
|
1002
|
+
condition: z.object({
|
|
1003
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
1004
|
+
timeUnit: z.enum(exports.EDimensionProcessFilterTimeUnit).optional(),
|
|
1005
|
+
values: z.array(z.string().nullable()),
|
|
1006
|
+
}),
|
|
1007
|
+
});
|
|
1008
|
+
};
|
|
1009
|
+
var SettingsFilterSchema = function (z) {
|
|
1010
|
+
return z.union([ExtendedFormulaFilterValueSchema(z), DimensionProcessFilterSchema(z)]);
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
var ActionOnClickParameterCommonSchema = function (z) {
|
|
1014
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1015
|
+
name: z.string(),
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
var ParameterFromColumnSchema = function (z) {
|
|
1019
|
+
return z.object({
|
|
1020
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.COLUMN),
|
|
1021
|
+
tableName: z.string().nullable().default(null),
|
|
1022
|
+
columnName: z.string().nullable().default(null),
|
|
1023
|
+
dbDataType: z.string().optional(),
|
|
1024
|
+
});
|
|
1025
|
+
};
|
|
1026
|
+
var ParameterFromVariableSchema = function (z) {
|
|
1027
|
+
return z.object({
|
|
1028
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.VARIABLE),
|
|
1029
|
+
sourceVariable: z.string().nullable().default(null),
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
1032
|
+
var ParameterFromFormulaSchema = function (z) {
|
|
1033
|
+
return z.object({
|
|
1034
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.FORMULA),
|
|
1035
|
+
formula: FormulaSchema(z),
|
|
1036
|
+
considerFilters: z.boolean().default(false),
|
|
1037
|
+
dbDataType: z.string().optional(),
|
|
1038
|
+
});
|
|
1039
|
+
};
|
|
1040
|
+
var ParameterFromEventSchema = function (z) {
|
|
1041
|
+
return z.object({
|
|
1042
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.EVENT),
|
|
1043
|
+
});
|
|
1044
|
+
};
|
|
1045
|
+
var ParameterFromStartEventSchema = function (z) {
|
|
1046
|
+
return z.object({
|
|
1047
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.START_EVENT),
|
|
1048
|
+
});
|
|
1049
|
+
};
|
|
1050
|
+
var ParameterFromEndEventSchema = function (z) {
|
|
1051
|
+
return z.object({
|
|
1052
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.FINISH_EVENT),
|
|
1053
|
+
});
|
|
1054
|
+
};
|
|
1055
|
+
var ParameterFromAggregationSchema = function (z) {
|
|
1056
|
+
return z.object({
|
|
1057
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.AGGREGATION),
|
|
1058
|
+
formula: FormulaSchema(z),
|
|
1059
|
+
considerFilters: z.boolean().default(false),
|
|
1060
|
+
dbDataType: z.string().optional(),
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
var ParameterFromManualInputSchema = function (z) {
|
|
1064
|
+
return z.object({
|
|
1065
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.MANUALLY),
|
|
1066
|
+
description: z.string().default(""),
|
|
1067
|
+
defaultValue: FormulaSchema(z),
|
|
1068
|
+
dbDataType: z.string().optional(),
|
|
1069
|
+
filterByRows: z.boolean().default(false),
|
|
1070
|
+
validation: FormulaSchema(z),
|
|
1071
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1072
|
+
});
|
|
1073
|
+
};
|
|
1074
|
+
var ParameterFromStaticListSchema = function (z) {
|
|
1075
|
+
return z.object({
|
|
1076
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.STATIC_LIST),
|
|
1077
|
+
options: z.string().default(""),
|
|
1078
|
+
defaultValue: z
|
|
1079
|
+
.union([z.string(), z.array(z.string())])
|
|
1080
|
+
.nullable()
|
|
1081
|
+
.default(null),
|
|
1082
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1083
|
+
});
|
|
1084
|
+
};
|
|
1085
|
+
var ParameterFromDynamicListSchema = function (z) {
|
|
1086
|
+
return z.object({
|
|
1087
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.DYNAMIC_LIST),
|
|
1088
|
+
options: FormulaSchema(z),
|
|
1089
|
+
defaultValue: FormulaSchema(z),
|
|
1090
|
+
dbDataType: z.string().optional(),
|
|
1091
|
+
displayOptions: FormulaSchema(z),
|
|
1092
|
+
filters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
1093
|
+
filterByRows: z.boolean().default(false),
|
|
1094
|
+
considerFilters: z.boolean().default(false),
|
|
1095
|
+
insertAnyValues: z.boolean().default(false),
|
|
1096
|
+
validation: FormulaSchema(z),
|
|
1097
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1098
|
+
});
|
|
1099
|
+
};
|
|
1100
|
+
var ParameterFromDataModelSchema = function (z) {
|
|
1101
|
+
return z.object({
|
|
1102
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.DATA_MODEL),
|
|
1103
|
+
option: z.enum(exports.EDataModelOption).default(exports.EDataModelOption.TABLE_LIST),
|
|
1104
|
+
/**
|
|
1105
|
+
* Используется только при COLUMN_LIST. Не делаем union по option, чтобы сохранить
|
|
1106
|
+
* одновременно default для option и работоспособность внешнего discriminated union.
|
|
1107
|
+
*/
|
|
1108
|
+
parent: NameNullableSchema(z),
|
|
1109
|
+
});
|
|
1110
|
+
};
|
|
1111
|
+
var ActionOnClickParameterSchema = function (z) {
|
|
1112
|
+
return z.intersection(ActionOnClickParameterCommonSchema(z), z.discriminatedUnion("inputMethod", [
|
|
1113
|
+
ParameterFromColumnSchema(z),
|
|
1114
|
+
ParameterFromVariableSchema(z),
|
|
1115
|
+
ParameterFromFormulaSchema(z),
|
|
1116
|
+
ParameterFromEventSchema(z),
|
|
1117
|
+
ParameterFromStartEventSchema(z),
|
|
1118
|
+
ParameterFromEndEventSchema(z),
|
|
1119
|
+
ParameterFromAggregationSchema(z),
|
|
1120
|
+
ParameterFromManualInputSchema(z),
|
|
1121
|
+
ParameterFromStaticListSchema(z),
|
|
1122
|
+
ParameterFromDynamicListSchema(z),
|
|
1123
|
+
ParameterFromDataModelSchema(z),
|
|
1124
|
+
]));
|
|
1125
|
+
};
|
|
1126
|
+
var ActionCommonSchema = function (z) {
|
|
1127
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1128
|
+
name: z.string(),
|
|
1129
|
+
});
|
|
1130
|
+
};
|
|
1131
|
+
var ActionDrillDownSchema = function (z) {
|
|
1132
|
+
return ActionCommonSchema(z).extend({ type: z.literal(exports.EActionTypes.DRILL_DOWN) });
|
|
1133
|
+
};
|
|
1134
|
+
var ActionGoToURLSchema = function (z) {
|
|
1135
|
+
return ActionCommonSchema(z).extend({
|
|
1136
|
+
type: z.literal(exports.EActionTypes.OPEN_URL),
|
|
1137
|
+
url: z.string(),
|
|
1138
|
+
newWindow: z.boolean().default(true),
|
|
1139
|
+
});
|
|
1140
|
+
};
|
|
1141
|
+
var ActivateConditionSchema = function (z) {
|
|
1142
|
+
return z
|
|
1143
|
+
.discriminatedUnion("mode", [
|
|
1144
|
+
z.object({
|
|
1145
|
+
mode: z.literal(exports.EActivateConditionMode.FORMULA),
|
|
1146
|
+
formula: FormulaSchema(z),
|
|
1147
|
+
}),
|
|
1148
|
+
z.object({
|
|
1149
|
+
mode: z.literal(exports.EActivateConditionMode.VARIABLE),
|
|
1150
|
+
variableName: z.string().nullable().default(null),
|
|
1151
|
+
variableValue: z.string().nullable().default(null),
|
|
1152
|
+
}),
|
|
1153
|
+
])
|
|
1154
|
+
.default({ mode: exports.EActivateConditionMode.FORMULA, formula: "" });
|
|
1155
|
+
};
|
|
1156
|
+
var ActionRunScriptSchema = function (z) {
|
|
1157
|
+
return ActionCommonSchema(z).extend({
|
|
1158
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1159
|
+
parameters: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1160
|
+
scriptKey: z.string(),
|
|
1161
|
+
autoUpdate: z.enum(exports.EAutoUpdateMode).default(exports.EAutoUpdateMode.THIS_WIDGET),
|
|
1162
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1163
|
+
activateCondition: ActivateConditionSchema(z),
|
|
1164
|
+
hint: z.string().default(""),
|
|
1165
|
+
});
|
|
1166
|
+
};
|
|
1167
|
+
var ActionUpdateVariableSchema = function (z) {
|
|
1168
|
+
return ActionCommonSchema(z).extend({
|
|
1169
|
+
type: z.literal(exports.EActionTypes.UPDATE_VARIABLE),
|
|
1170
|
+
variables: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1171
|
+
});
|
|
1172
|
+
};
|
|
1173
|
+
var ActionOpenInSchema = function (z) {
|
|
1174
|
+
return z.discriminatedUnion("openIn", [
|
|
1175
|
+
z.object({
|
|
1176
|
+
openIn: z.literal(exports.EViewOpenIn.DRAWER_WINDOW),
|
|
1177
|
+
alignment: z.enum(exports.EDrawerPlacement).default(exports.EDrawerPlacement.RIGHT),
|
|
1178
|
+
inheritFilter: z.boolean().default(true),
|
|
1179
|
+
}),
|
|
1180
|
+
z.object({
|
|
1181
|
+
openIn: z.literal(exports.EViewOpenIn.PLACEHOLDER),
|
|
1182
|
+
placeholderName: z.string(),
|
|
1183
|
+
}),
|
|
1184
|
+
z.object({
|
|
1185
|
+
openIn: z.literal(exports.EViewOpenIn.MODAL_WINDOW),
|
|
1186
|
+
positionByClick: z.boolean().default(false),
|
|
1187
|
+
inheritFilter: z.boolean().default(true),
|
|
1188
|
+
}),
|
|
1189
|
+
z.object({
|
|
1190
|
+
openIn: z.literal(exports.EViewOpenIn.WINDOW),
|
|
1191
|
+
newWindow: z.boolean().default(true),
|
|
1192
|
+
inheritFilter: z.boolean().default(true),
|
|
1193
|
+
}),
|
|
1194
|
+
]);
|
|
1195
|
+
};
|
|
1196
|
+
var ActionOpenViewCommonSchema = function (z) {
|
|
1197
|
+
return ActionCommonSchema(z).extend({ type: z.literal(exports.EActionTypes.OPEN_VIEW) });
|
|
1198
|
+
};
|
|
1199
|
+
var ActionOpenViewSchema = function (z) {
|
|
1200
|
+
return z.intersection(z.discriminatedUnion("mode", [
|
|
1201
|
+
ActionOpenViewCommonSchema(z).extend({
|
|
1202
|
+
mode: z.literal(exports.EViewMode.GENERATED_BY_SCRIPT),
|
|
1203
|
+
scriptKey: z.string(),
|
|
1204
|
+
parameters: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1205
|
+
displayName: z.string().default(""),
|
|
1206
|
+
}),
|
|
1207
|
+
ActionOpenViewCommonSchema(z).extend({
|
|
1208
|
+
mode: z.literal(exports.EViewMode.EXISTED_VIEW),
|
|
1209
|
+
viewKey: z.string(),
|
|
1210
|
+
parameters: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1211
|
+
}),
|
|
1212
|
+
ActionOpenViewCommonSchema(z).extend({
|
|
1213
|
+
mode: z.literal(exports.EViewMode.EMPTY),
|
|
1214
|
+
placeholderName: z.string(),
|
|
1215
|
+
openIn: z.literal(exports.EViewOpenIn.PLACEHOLDER),
|
|
1216
|
+
}),
|
|
1217
|
+
]), ActionOpenInSchema(z));
|
|
1218
|
+
};
|
|
1219
|
+
var ActionsOnClickSchema = function (z) {
|
|
1220
|
+
return z.union([
|
|
1221
|
+
ActionGoToURLSchema(z),
|
|
1222
|
+
ActionRunScriptSchema(z),
|
|
1223
|
+
ActionUpdateVariableSchema(z),
|
|
1224
|
+
ActionOpenViewSchema(z),
|
|
1225
|
+
ActionDrillDownSchema(z),
|
|
1226
|
+
]);
|
|
1227
|
+
};
|
|
1228
|
+
var WidgetActionParameterCommonSchema = function (z) {
|
|
1229
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1230
|
+
name: z.string(),
|
|
1231
|
+
displayName: z.string().default(""),
|
|
1232
|
+
isHidden: z.boolean().default(false),
|
|
1233
|
+
});
|
|
1234
|
+
};
|
|
1235
|
+
var WidgetActionParameterSchema = function (z) {
|
|
1236
|
+
return z.intersection(WidgetActionParameterCommonSchema(z), z.discriminatedUnion("inputMethod", [
|
|
1237
|
+
ParameterFromColumnSchema(z),
|
|
1238
|
+
ParameterFromVariableSchema(z),
|
|
1239
|
+
ParameterFromFormulaSchema(z),
|
|
1240
|
+
ParameterFromManualInputSchema(z),
|
|
1241
|
+
ParameterFromStaticListSchema(z),
|
|
1242
|
+
ParameterFromDynamicListSchema(z),
|
|
1243
|
+
ParameterFromAggregationSchema(z),
|
|
1244
|
+
ParameterFromDataModelSchema(z),
|
|
1245
|
+
]));
|
|
1246
|
+
};
|
|
1247
|
+
var WidgetActionSchema = function (z) {
|
|
1248
|
+
return ActionCommonSchema(z).extend({
|
|
1249
|
+
parameters: z.array(WidgetActionParameterSchema(z)).default([]),
|
|
1250
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1251
|
+
scriptKey: z.string(),
|
|
1252
|
+
autoUpdate: z.enum(exports.EAutoUpdateMode).default(exports.EAutoUpdateMode.THIS_WIDGET),
|
|
1253
|
+
description: z.string().default(""),
|
|
1254
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1255
|
+
hint: z.string().default(""),
|
|
1256
|
+
activateCondition: ActivateConditionSchema(z),
|
|
1257
|
+
});
|
|
1258
|
+
};
|
|
1259
|
+
var ViewActionParameterSchema = function (z) {
|
|
1260
|
+
return z.intersection(AutoIdentifiedArrayItemSchema(z).extend({ name: z.string() }), z.discriminatedUnion("inputMethod", [
|
|
1261
|
+
ParameterFromAggregationSchema(z),
|
|
1262
|
+
ParameterFromVariableSchema(z),
|
|
1263
|
+
]));
|
|
1264
|
+
};
|
|
1265
|
+
var ViewActionSchema = function (z) {
|
|
1266
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1267
|
+
name: z.string(),
|
|
1268
|
+
buttonType: z.enum(exports.EActionButtonsTypes).default(exports.EActionButtonsTypes.BASE),
|
|
1269
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT).default(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1270
|
+
parameters: z.array(ViewActionParameterSchema(z)).default([]),
|
|
1271
|
+
scriptKey: KeyNullableSchema(z),
|
|
1272
|
+
autoUpdate: z
|
|
1273
|
+
.union([z.literal(exports.EAutoUpdateMode.NONE), z.literal(exports.EAutoUpdateMode.ALL_VIEWS)])
|
|
1274
|
+
.default(exports.EAutoUpdateMode.NONE),
|
|
1275
|
+
});
|
|
1276
|
+
};
|
|
1277
|
+
var ActionSchema = function (z) {
|
|
1278
|
+
return z.union([ActionsOnClickSchema(z), WidgetActionSchema(z), ViewActionSchema(z)]);
|
|
1279
|
+
};
|
|
1280
|
+
var ActionButtonSchema = function (z) {
|
|
1281
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1282
|
+
name: z.string(),
|
|
1283
|
+
onClick: z.array(WidgetActionSchema(z)).default([]),
|
|
1284
|
+
buttonType: z.enum(exports.EActionButtonsTypes).default(exports.EActionButtonsTypes.BASE),
|
|
1285
|
+
backgroundColor: ColorSchema(z),
|
|
1286
|
+
borderColor: ColorSchema(z),
|
|
1287
|
+
color: ColorSchema(z),
|
|
1288
|
+
hint: z.string().default(""),
|
|
1289
|
+
});
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
var prepareValuesForSql = function (simpleType, values) {
|
|
1293
|
+
return simpleType === exports.ESimpleDataType.INTEGER ||
|
|
1294
|
+
simpleType === exports.ESimpleDataType.FLOAT ||
|
|
1295
|
+
simpleType === exports.ESimpleDataType.BOOLEAN
|
|
1296
|
+
? values
|
|
1297
|
+
: values.map(function (value) {
|
|
1298
|
+
return value === null ? null : "'".concat(escapeSingularQuotes$1(escapeReverseSlash(value)), "'");
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
var escapeReverseSlash = function (formula) {
|
|
1302
|
+
return formula.replaceAll(/\\/gm, "\\\\");
|
|
1303
|
+
};
|
|
1304
|
+
var escapeSingularQuotes$1 = function (formula) {
|
|
1305
|
+
return formula.replaceAll("'", "\\'");
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
exports.ECalculatorFilterMethods = void 0;
|
|
1309
|
+
(function (ECalculatorFilterMethods) {
|
|
1310
|
+
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
1311
|
+
ECalculatorFilterMethods["NOT_EQUAL_TO"] = "NOT_EQUAL_TO";
|
|
1312
|
+
ECalculatorFilterMethods["GREATER_THAN"] = "GREATER_THAN";
|
|
1313
|
+
ECalculatorFilterMethods["LESS_THAN"] = "LESS_THAN";
|
|
1314
|
+
ECalculatorFilterMethods["GREATER_THAN_OR_EQUAL_TO"] = "GREATER_THAN_OR_EQUAL_TO";
|
|
1315
|
+
ECalculatorFilterMethods["LESS_THAN_OR_EQUAL_TO"] = "LESS_THAN_OR_EQUAL_TO";
|
|
1316
|
+
ECalculatorFilterMethods["STARTS_WITH"] = "STARTS_WITH";
|
|
1317
|
+
ECalculatorFilterMethods["ENDS_WITH"] = "ENDS_WITH";
|
|
1318
|
+
ECalculatorFilterMethods["CONTAINS"] = "CONTAINS";
|
|
1319
|
+
ECalculatorFilterMethods["NOT_CONTAINS"] = "NOT_CONTAINS";
|
|
1320
|
+
ECalculatorFilterMethods["IN_RANGE"] = "IN_RANGE";
|
|
1321
|
+
ECalculatorFilterMethods["NOT_IN_RANGE"] = "NOT_IN_RANGE";
|
|
1322
|
+
ECalculatorFilterMethods["INCLUDE"] = "INCLUDE";
|
|
1323
|
+
ECalculatorFilterMethods["EXCLUDE"] = "EXCLUDE";
|
|
1324
|
+
ECalculatorFilterMethods["NONEMPTY"] = "NONEMPTY";
|
|
1325
|
+
ECalculatorFilterMethods["EMPTY"] = "EMPTY";
|
|
1326
|
+
})(exports.ECalculatorFilterMethods || (exports.ECalculatorFilterMethods = {}));
|
|
1327
|
+
|
|
1328
|
+
var formulaFilterMethods = __assign(__assign({}, exports.ECalculatorFilterMethods), { LAST_TIME: "LAST_TIME" });
|
|
1329
|
+
exports.EProcessFilterNames = void 0;
|
|
1330
|
+
(function (EProcessFilterNames) {
|
|
1331
|
+
/** Наличие события */
|
|
1332
|
+
EProcessFilterNames["presenceOfEvent"] = "presenceOfEvent";
|
|
1333
|
+
/** Количество повторов события */
|
|
1334
|
+
EProcessFilterNames["repetitionOfEvent"] = "repetitionOfEvent";
|
|
1335
|
+
/** Наличие перехода */
|
|
1336
|
+
EProcessFilterNames["presenceOfTransition"] = "presenceOfTransition";
|
|
1337
|
+
/** Длительность перехода */
|
|
1338
|
+
EProcessFilterNames["durationOfTransition"] = "durationOfTransition";
|
|
1339
|
+
})(exports.EProcessFilterNames || (exports.EProcessFilterNames = {}));
|
|
1340
|
+
exports.EFormulaFilterFieldKeys = void 0;
|
|
1341
|
+
(function (EFormulaFilterFieldKeys) {
|
|
1342
|
+
EFormulaFilterFieldKeys["date"] = "date";
|
|
1343
|
+
EFormulaFilterFieldKeys["dateRange"] = "dateRange";
|
|
1344
|
+
EFormulaFilterFieldKeys["numberRange"] = "numberRange";
|
|
1345
|
+
EFormulaFilterFieldKeys["string"] = "string";
|
|
1346
|
+
EFormulaFilterFieldKeys["lastTimeValue"] = "lastTimeValue";
|
|
1347
|
+
EFormulaFilterFieldKeys["lastTimeUnit"] = "lastTimeUnit";
|
|
1348
|
+
EFormulaFilterFieldKeys["durationUnit"] = "durationUnit";
|
|
1349
|
+
})(exports.EFormulaFilterFieldKeys || (exports.EFormulaFilterFieldKeys = {}));
|
|
1350
|
+
exports.EDimensionProcessFilterTimeUnit = void 0;
|
|
1351
|
+
(function (EDimensionProcessFilterTimeUnit) {
|
|
1352
|
+
EDimensionProcessFilterTimeUnit["YEARS"] = "YEARS";
|
|
1353
|
+
EDimensionProcessFilterTimeUnit["MONTHS"] = "MONTHS";
|
|
1354
|
+
EDimensionProcessFilterTimeUnit["HOURS"] = "HOURS";
|
|
1355
|
+
EDimensionProcessFilterTimeUnit["DAYS"] = "DAYS";
|
|
1356
|
+
EDimensionProcessFilterTimeUnit["MINUTES"] = "MINUTES";
|
|
1357
|
+
})(exports.EDimensionProcessFilterTimeUnit || (exports.EDimensionProcessFilterTimeUnit = {}));
|
|
1358
|
+
var isFormulaFilterValue = function (value) {
|
|
1359
|
+
return "filteringMethod" in value;
|
|
1360
|
+
};
|
|
1361
|
+
var isDimensionProcessFilter = function (filter) { return "value" in filter && "condition" in filter; };
|
|
1362
|
+
|
|
1363
|
+
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
1364
|
+
var compactMap = function (items, f) {
|
|
1365
|
+
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
1366
|
+
};
|
|
1367
|
+
var isNil = function (value) {
|
|
1368
|
+
return value === null || value === undefined;
|
|
1369
|
+
};
|
|
1370
|
+
function memoize(fn) {
|
|
1371
|
+
var cache = new Map();
|
|
1372
|
+
return function (arg) {
|
|
1373
|
+
if (cache.has(arg)) {
|
|
1374
|
+
return cache.get(arg);
|
|
1375
|
+
}
|
|
1376
|
+
var result = fn(arg);
|
|
1377
|
+
cache.set(arg, result);
|
|
1378
|
+
return result;
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
exports.EClickHouseBaseTypes = void 0;
|
|
1383
|
+
(function (EClickHouseBaseTypes) {
|
|
1384
|
+
// DATE
|
|
1385
|
+
EClickHouseBaseTypes["Date"] = "Date";
|
|
1386
|
+
EClickHouseBaseTypes["Date32"] = "Date32";
|
|
1387
|
+
// DATETIME
|
|
1388
|
+
EClickHouseBaseTypes["DateTime"] = "DateTime";
|
|
1389
|
+
EClickHouseBaseTypes["DateTime32"] = "DateTime32";
|
|
1390
|
+
// DATETIME64
|
|
1391
|
+
EClickHouseBaseTypes["DateTime64"] = "DateTime64";
|
|
1392
|
+
// STRING
|
|
1393
|
+
EClickHouseBaseTypes["FixedString"] = "FixedString";
|
|
1394
|
+
EClickHouseBaseTypes["String"] = "String";
|
|
1395
|
+
// FLOAT
|
|
1396
|
+
EClickHouseBaseTypes["Decimal"] = "Decimal";
|
|
1397
|
+
EClickHouseBaseTypes["Decimal32"] = "Decimal32";
|
|
1398
|
+
EClickHouseBaseTypes["Decimal64"] = "Decimal64";
|
|
1399
|
+
EClickHouseBaseTypes["Decimal128"] = "Decimal128";
|
|
1400
|
+
EClickHouseBaseTypes["Decimal256"] = "Decimal256";
|
|
1401
|
+
EClickHouseBaseTypes["Float32"] = "Float32";
|
|
1402
|
+
EClickHouseBaseTypes["Float64"] = "Float64";
|
|
1403
|
+
// INTEGER
|
|
1404
|
+
EClickHouseBaseTypes["Int8"] = "Int8";
|
|
1405
|
+
EClickHouseBaseTypes["Int16"] = "Int16";
|
|
1406
|
+
EClickHouseBaseTypes["Int32"] = "Int32";
|
|
1407
|
+
EClickHouseBaseTypes["Int64"] = "Int64";
|
|
1408
|
+
EClickHouseBaseTypes["Int128"] = "Int128";
|
|
1409
|
+
EClickHouseBaseTypes["Int256"] = "Int256";
|
|
1410
|
+
EClickHouseBaseTypes["UInt8"] = "UInt8";
|
|
1411
|
+
EClickHouseBaseTypes["UInt16"] = "UInt16";
|
|
1412
|
+
EClickHouseBaseTypes["UInt32"] = "UInt32";
|
|
1413
|
+
EClickHouseBaseTypes["UInt64"] = "UInt64";
|
|
1414
|
+
EClickHouseBaseTypes["UInt128"] = "UInt128";
|
|
1415
|
+
EClickHouseBaseTypes["UInt256"] = "UInt256";
|
|
1416
|
+
// BOOLEAN
|
|
1417
|
+
EClickHouseBaseTypes["Bool"] = "Bool";
|
|
1418
|
+
})(exports.EClickHouseBaseTypes || (exports.EClickHouseBaseTypes = {}));
|
|
1419
|
+
var stringTypes = ["String", "FixedString"];
|
|
1420
|
+
var parseClickHouseType = memoize(function (type) {
|
|
1421
|
+
if (isNil(type)) {
|
|
1422
|
+
return {
|
|
1423
|
+
simpleBaseType: exports.ESimpleDataType.OTHER,
|
|
1424
|
+
dbBaseDataType: undefined,
|
|
1425
|
+
containers: [],
|
|
1426
|
+
simpleType: exports.ESimpleDataType.OTHER,
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
var _a = extractInnerType(type), containers = _a.containers, dbBaseDataType = _a.dbBaseDataType;
|
|
1430
|
+
if (!dbBaseDataType) {
|
|
1431
|
+
throw new Error("Invalid ClickHouse type: ".concat(type));
|
|
1432
|
+
}
|
|
1433
|
+
return {
|
|
1434
|
+
dbBaseDataType: dbBaseDataType,
|
|
1435
|
+
simpleBaseType: simplifyBaseType(dbBaseDataType),
|
|
1436
|
+
containers: containers,
|
|
1437
|
+
get simpleType() {
|
|
1438
|
+
return containers.includes("Array") ? exports.ESimpleDataType.OTHER : this.simpleBaseType;
|
|
1439
|
+
},
|
|
1440
|
+
};
|
|
1441
|
+
});
|
|
1442
|
+
/** 'A(B(C))' -> ['A', 'B', 'C'] */
|
|
1443
|
+
var splitByBrackets = function (input) { return input.split(/[\(\)]/).filter(Boolean); };
|
|
1444
|
+
/**
|
|
1445
|
+
* Отделить внутренний тип от оберток.
|
|
1446
|
+
* Не поддерживаются обертки Tuple и LowCardinality.
|
|
1447
|
+
*/
|
|
1448
|
+
var extractInnerType = function (type) {
|
|
1449
|
+
var tokens = splitByBrackets(type);
|
|
1450
|
+
// Удаление параметров типа.
|
|
1451
|
+
if (tokens.length > 0 && isTypeParameters(tokens.at(-1))) {
|
|
1452
|
+
tokens.pop();
|
|
1453
|
+
}
|
|
1454
|
+
var dbBaseDataType = tokens.pop();
|
|
1455
|
+
return { containers: tokens, dbBaseDataType: dbBaseDataType };
|
|
1456
|
+
};
|
|
1457
|
+
var simplifyBaseType = function (dbBaseType) {
|
|
1458
|
+
var isSourceTypeStartsWith = function (prefix) { return dbBaseType.startsWith(prefix); };
|
|
1459
|
+
if (isSourceTypeStartsWith("Int") || isSourceTypeStartsWith("UInt")) {
|
|
1460
|
+
return exports.ESimpleDataType.INTEGER;
|
|
1461
|
+
}
|
|
1462
|
+
if (isSourceTypeStartsWith("Decimal") || isSourceTypeStartsWith("Float")) {
|
|
1463
|
+
return exports.ESimpleDataType.FLOAT;
|
|
1464
|
+
}
|
|
1465
|
+
if (stringTypes.some(isSourceTypeStartsWith)) {
|
|
1466
|
+
return exports.ESimpleDataType.STRING;
|
|
1467
|
+
}
|
|
1468
|
+
if (isSourceTypeStartsWith("DateTime64")) {
|
|
1469
|
+
return exports.ESimpleDataType.DATETIME64;
|
|
1470
|
+
}
|
|
1471
|
+
if (isSourceTypeStartsWith("DateTime")) {
|
|
1472
|
+
return exports.ESimpleDataType.DATETIME;
|
|
1473
|
+
}
|
|
1474
|
+
if (isSourceTypeStartsWith("Date")) {
|
|
1475
|
+
return exports.ESimpleDataType.DATE;
|
|
1476
|
+
}
|
|
1477
|
+
if (isSourceTypeStartsWith("Bool")) {
|
|
1478
|
+
return exports.ESimpleDataType.BOOLEAN;
|
|
1479
|
+
}
|
|
1480
|
+
return exports.ESimpleDataType.OTHER;
|
|
1481
|
+
};
|
|
1482
|
+
/**
|
|
1483
|
+
* - `3` -> true
|
|
1484
|
+
* - `3, 'Europe/Moscow'` -> true
|
|
1485
|
+
* - `3, Europe/Moscow` -> false
|
|
1486
|
+
*
|
|
1487
|
+
* Пример типа с параметрами: `DateTime64(3, 'Europe/Moscow')`
|
|
1488
|
+
*/
|
|
1489
|
+
var isTypeParameters = function (stringifiedParameters) {
|
|
1490
|
+
return stringifiedParameters.split(", ").some(function (p) { return !Number.isNaN(Number(p)) || p.startsWith("'"); });
|
|
1491
|
+
};
|
|
1492
|
+
|
|
652
1493
|
var _a$5;
|
|
653
1494
|
exports.EDimensionTemplateNames = void 0;
|
|
654
1495
|
(function (EDimensionTemplateNames) {
|
|
@@ -679,113 +1520,6 @@ var dimensionTemplateFormulas = (_a$5 = {},
|
|
|
679
1520
|
_a$5[exports.EDimensionTemplateNames.hour] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toHour({columnFormula}))",
|
|
680
1521
|
_a$5);
|
|
681
1522
|
|
|
682
|
-
exports.EWidgetIndicatorType = void 0;
|
|
683
|
-
(function (EWidgetIndicatorType) {
|
|
684
|
-
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
685
|
-
EWidgetIndicatorType["EVENT_INDICATOR"] = "EVENT_INDICATOR";
|
|
686
|
-
EWidgetIndicatorType["TRANSITION_INDICATOR"] = "TRANSITION_INDICATOR";
|
|
687
|
-
EWidgetIndicatorType["DIMENSION"] = "DIMENSION";
|
|
688
|
-
EWidgetIndicatorType["SORTING"] = "SORTING";
|
|
689
|
-
})(exports.EWidgetIndicatorType || (exports.EWidgetIndicatorType = {}));
|
|
690
|
-
exports.EOuterAggregation = void 0;
|
|
691
|
-
(function (EOuterAggregation) {
|
|
692
|
-
EOuterAggregation["avg"] = "avg";
|
|
693
|
-
EOuterAggregation["median"] = "median";
|
|
694
|
-
EOuterAggregation["count"] = "count";
|
|
695
|
-
EOuterAggregation["countDistinct"] = "countDistinct";
|
|
696
|
-
EOuterAggregation["min"] = "min";
|
|
697
|
-
EOuterAggregation["max"] = "max";
|
|
698
|
-
EOuterAggregation["sum"] = "sum";
|
|
699
|
-
EOuterAggregation["top"] = "top";
|
|
700
|
-
})(exports.EOuterAggregation || (exports.EOuterAggregation = {}));
|
|
701
|
-
/** Режимы значения показателя (на основе чего генерируется формула) */
|
|
702
|
-
exports.EWidgetIndicatorValueModes = void 0;
|
|
703
|
-
(function (EWidgetIndicatorValueModes) {
|
|
704
|
-
/** Готовая формула (как правило, введенная пользователем через редактор формул) */
|
|
705
|
-
EWidgetIndicatorValueModes["FORMULA"] = "FORMULA";
|
|
706
|
-
/** Шаблон формулы, предоставляемый системой */
|
|
707
|
-
EWidgetIndicatorValueModes["TEMPLATE"] = "TEMPLATE";
|
|
708
|
-
EWidgetIndicatorValueModes["AGGREGATION"] = "AGGREGATION";
|
|
709
|
-
EWidgetIndicatorValueModes["DURATION"] = "DURATION";
|
|
710
|
-
EWidgetIndicatorValueModes["CONVERSION"] = "CONVERSION";
|
|
711
|
-
EWidgetIndicatorValueModes["START_TIME"] = "START_TIME";
|
|
712
|
-
EWidgetIndicatorValueModes["END_TIME"] = "END_TIME";
|
|
713
|
-
})(exports.EWidgetIndicatorValueModes || (exports.EWidgetIndicatorValueModes = {}));
|
|
714
|
-
/** Режимы сортировки (на что ссылается сортировка) */
|
|
715
|
-
exports.ESortingValueModes = void 0;
|
|
716
|
-
(function (ESortingValueModes) {
|
|
717
|
-
/** Сортировка по формуле */
|
|
718
|
-
ESortingValueModes["FORMULA"] = "FORMULA";
|
|
719
|
-
/** Сортировка по показателю(разрезу или мере) виджета */
|
|
720
|
-
ESortingValueModes["IN_WIDGET"] = "IN_WIDGET";
|
|
721
|
-
})(exports.ESortingValueModes || (exports.ESortingValueModes = {}));
|
|
722
|
-
exports.EFormatOrFormattingMode = void 0;
|
|
723
|
-
(function (EFormatOrFormattingMode) {
|
|
724
|
-
EFormatOrFormattingMode["BASE"] = "BASE";
|
|
725
|
-
EFormatOrFormattingMode["TEMPLATE"] = "TEMPLATE";
|
|
726
|
-
})(exports.EFormatOrFormattingMode || (exports.EFormatOrFormattingMode = {}));
|
|
727
|
-
/** Тип показателя */
|
|
728
|
-
exports.EIndicatorType = void 0;
|
|
729
|
-
(function (EIndicatorType) {
|
|
730
|
-
/** Показатели процесса */
|
|
731
|
-
EIndicatorType["PROCESS_MEASURE"] = "PROCESS_MEASURE";
|
|
732
|
-
/** Вводимое значение */
|
|
733
|
-
EIndicatorType["STATIC"] = "STATIC";
|
|
734
|
-
/** Статический список */
|
|
735
|
-
EIndicatorType["STATIC_LIST"] = "STATIC_LIST";
|
|
736
|
-
/** Динамический список */
|
|
737
|
-
EIndicatorType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
738
|
-
/** Список колонок */
|
|
739
|
-
EIndicatorType["COLUMN_LIST"] = "COLUMN_LIST";
|
|
740
|
-
/** Разрез */
|
|
741
|
-
EIndicatorType["DIMENSION"] = "DIMENSION";
|
|
742
|
-
/** Мера */
|
|
743
|
-
EIndicatorType["MEASURE"] = "MEASURE";
|
|
744
|
-
/** Иерархия */
|
|
745
|
-
EIndicatorType["DYNAMIC_DIMENSION"] = "DYNAMIC_DIMENSION";
|
|
746
|
-
/** Пользовательская сортировка */
|
|
747
|
-
EIndicatorType["USER_SORTING"] = "USER_SORTING";
|
|
748
|
-
})(exports.EIndicatorType || (exports.EIndicatorType = {}));
|
|
749
|
-
/** Обобщенные типы значений переменных */
|
|
750
|
-
exports.ESimpleInputType = void 0;
|
|
751
|
-
(function (ESimpleInputType) {
|
|
752
|
-
/** Число (точность Float64) */
|
|
753
|
-
ESimpleInputType["NUMBER"] = "FLOAT";
|
|
754
|
-
/** Целое число (точность Int64) */
|
|
755
|
-
ESimpleInputType["INTEGER_NUMBER"] = "INTEGER";
|
|
756
|
-
/** Текст */
|
|
757
|
-
ESimpleInputType["TEXT"] = "STRING";
|
|
758
|
-
/** Дата (точность Date) */
|
|
759
|
-
ESimpleInputType["DATE"] = "DATE";
|
|
760
|
-
/** Дата и время (точность DateTime64) */
|
|
761
|
-
ESimpleInputType["DATE_AND_TIME"] = "DATETIME";
|
|
762
|
-
/** Логический тип */
|
|
763
|
-
ESimpleInputType["BOOLEAN"] = "BOOLEAN";
|
|
764
|
-
})(exports.ESimpleInputType || (exports.ESimpleInputType = {}));
|
|
765
|
-
function isDimensionsHierarchy(indicator) {
|
|
766
|
-
return "hierarchyDimensions" in indicator;
|
|
767
|
-
}
|
|
768
|
-
exports.OuterAggregation = void 0;
|
|
769
|
-
(function (OuterAggregation) {
|
|
770
|
-
OuterAggregation["avg"] = "avgIf";
|
|
771
|
-
OuterAggregation["median"] = "medianIf";
|
|
772
|
-
OuterAggregation["count"] = "countIf";
|
|
773
|
-
OuterAggregation["countDistinct"] = "countIfDistinct";
|
|
774
|
-
OuterAggregation["min"] = "minIf";
|
|
775
|
-
OuterAggregation["max"] = "maxIf";
|
|
776
|
-
OuterAggregation["sum"] = "sumIf";
|
|
777
|
-
})(exports.OuterAggregation || (exports.OuterAggregation = {}));
|
|
778
|
-
exports.EDurationTemplateName = void 0;
|
|
779
|
-
(function (EDurationTemplateName) {
|
|
780
|
-
EDurationTemplateName["avg"] = "avg";
|
|
781
|
-
EDurationTemplateName["median"] = "median";
|
|
782
|
-
})(exports.EDurationTemplateName || (exports.EDurationTemplateName = {}));
|
|
783
|
-
exports.EEventAppearances = void 0;
|
|
784
|
-
(function (EEventAppearances) {
|
|
785
|
-
EEventAppearances["FIRST"] = "FIRST";
|
|
786
|
-
EEventAppearances["LAST"] = "LAST";
|
|
787
|
-
})(exports.EEventAppearances || (exports.EEventAppearances = {}));
|
|
788
|
-
|
|
789
1523
|
function createAggregationTemplate$1(functionName, options) {
|
|
790
1524
|
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} ={eventName}{filters}), {caseCaseIdFormula})");
|
|
791
1525
|
}
|
|
@@ -820,13 +1554,6 @@ function sanitizeSingleLineComment(formula, wrapInBrackets) {
|
|
|
820
1554
|
return wrapInBrackets ? "(".concat(formula, "\n)") : "".concat(formula, "\n");
|
|
821
1555
|
}
|
|
822
1556
|
|
|
823
|
-
/** @deprecated - следует использовать fillTemplateSql */
|
|
824
|
-
function fillTemplateString(templateString, params) {
|
|
825
|
-
return templateString.replace(/\{(.*?)\}/g, function (_, key) {
|
|
826
|
-
var _a;
|
|
827
|
-
return (_a = params[key]) !== null && _a !== void 0 ? _a : "";
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
1557
|
/** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
|
|
831
1558
|
function fillTemplateSql(templateString, params) {
|
|
832
1559
|
var e_1, _a;
|
|
@@ -851,7 +1578,10 @@ function fillTemplateSql(templateString, params) {
|
|
|
851
1578
|
}
|
|
852
1579
|
finally { if (e_1) throw e_1.error; }
|
|
853
1580
|
}
|
|
854
|
-
return
|
|
1581
|
+
return templateString.replace(/\{(.*?)\}/g, function (_, key) {
|
|
1582
|
+
var _a;
|
|
1583
|
+
return (_a = newParams[key]) !== null && _a !== void 0 ? _a : "";
|
|
1584
|
+
});
|
|
855
1585
|
}
|
|
856
1586
|
|
|
857
1587
|
/** Создать функцию экранирования переданных `specialChars` внутри `str` */
|
|
@@ -1468,30 +2198,6 @@ function getTransitionMeasureFormula(_a, process) {
|
|
|
1468
2198
|
return "";
|
|
1469
2199
|
}
|
|
1470
2200
|
|
|
1471
|
-
// Типы, используемые в значениях элементов управления.
|
|
1472
|
-
exports.EWidgetFilterMode = void 0;
|
|
1473
|
-
(function (EWidgetFilterMode) {
|
|
1474
|
-
EWidgetFilterMode["DEFAULT"] = "DEFAULT";
|
|
1475
|
-
EWidgetFilterMode["SINGLE"] = "SINGLE";
|
|
1476
|
-
EWidgetFilterMode["DISABLED"] = "DISABLED";
|
|
1477
|
-
})(exports.EWidgetFilterMode || (exports.EWidgetFilterMode = {}));
|
|
1478
|
-
exports.EMarkdownDisplayMode = void 0;
|
|
1479
|
-
(function (EMarkdownDisplayMode) {
|
|
1480
|
-
EMarkdownDisplayMode["NONE"] = "NONE";
|
|
1481
|
-
EMarkdownDisplayMode["INDICATOR"] = "INDICATOR";
|
|
1482
|
-
})(exports.EMarkdownDisplayMode || (exports.EMarkdownDisplayMode = {}));
|
|
1483
|
-
exports.EDisplayConditionMode = void 0;
|
|
1484
|
-
(function (EDisplayConditionMode) {
|
|
1485
|
-
EDisplayConditionMode["DISABLED"] = "DISABLED";
|
|
1486
|
-
EDisplayConditionMode["FORMULA"] = "FORMULA";
|
|
1487
|
-
EDisplayConditionMode["VARIABLE"] = "VARIABLE";
|
|
1488
|
-
})(exports.EDisplayConditionMode || (exports.EDisplayConditionMode = {}));
|
|
1489
|
-
exports.EFontWeight = void 0;
|
|
1490
|
-
(function (EFontWeight) {
|
|
1491
|
-
EFontWeight["NORMAL"] = "NORMAL";
|
|
1492
|
-
EFontWeight["BOLD"] = "BOLD";
|
|
1493
|
-
})(exports.EFontWeight || (exports.EFontWeight = {}));
|
|
1494
|
-
|
|
1495
2201
|
function checkDisplayCondition(displayCondition, variables) {
|
|
1496
2202
|
var _a;
|
|
1497
2203
|
if ((displayCondition === null || displayCondition === void 0 ? void 0 : displayCondition.mode) === exports.EDisplayConditionMode.VARIABLE) {
|
|
@@ -1625,7 +2331,7 @@ var getFormulaFilterValues = function (filterValue) {
|
|
|
1625
2331
|
if (filteringMethod === formulaFilterMethods.LAST_TIME) {
|
|
1626
2332
|
var showTime = format === exports.EFormatTypes.DATETIME;
|
|
1627
2333
|
return compact([
|
|
1628
|
-
convertDateToClickHouse(subtractDurationFromDate(new Date(), lastTimeValue !== null && lastTimeValue !== void 0 ? lastTimeValue : 0, lastTimeUnit), showTime),
|
|
2334
|
+
convertDateToClickHouse(subtractDurationFromDate(new Date(), Number(lastTimeValue !== null && lastTimeValue !== void 0 ? lastTimeValue : 0), lastTimeUnit), showTime),
|
|
1629
2335
|
convertDateToClickHouse(new Date(), showTime),
|
|
1630
2336
|
]);
|
|
1631
2337
|
}
|
|
@@ -1837,8 +2543,8 @@ exports.ESortDirection = void 0;
|
|
|
1837
2543
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с одним значением - выбираем следующий за ним разрез
|
|
1838
2544
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с несколькими значениями - выбираем данный разрез
|
|
1839
2545
|
*/
|
|
1840
|
-
function selectDimensionFromHierarchy(
|
|
1841
|
-
var hierarchyDimensions =
|
|
2546
|
+
function selectDimensionFromHierarchy(hierarchy, filters) {
|
|
2547
|
+
var hierarchyDimensions = hierarchy.hierarchyDimensions; hierarchy.displayCondition;
|
|
1842
2548
|
var _loop_1 = function (i) {
|
|
1843
2549
|
var dimension = hierarchyDimensions[i];
|
|
1844
2550
|
// todo: widgets - возможно, стоит использовать Map фильтров для быстрого поиска
|
|
@@ -1851,14 +2557,18 @@ function selectDimensionFromHierarchy(_a, filters) {
|
|
|
1851
2557
|
return "continue";
|
|
1852
2558
|
}
|
|
1853
2559
|
var selectionIndex = matchedFilter.values.length > 1 ? i : Math.min(i + 1, hierarchyDimensions.length - 1);
|
|
1854
|
-
|
|
2560
|
+
var dimensionFromHierarchy_1 = hierarchyDimensions[selectionIndex];
|
|
2561
|
+
return { value: (dimensionFromHierarchy_1 &&
|
|
2562
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy_1, hierarchy)) };
|
|
1855
2563
|
};
|
|
1856
2564
|
for (var i = hierarchyDimensions.length - 1; i >= 0; i--) {
|
|
1857
2565
|
var state_1 = _loop_1(i);
|
|
1858
2566
|
if (typeof state_1 === "object")
|
|
1859
2567
|
return state_1.value;
|
|
1860
2568
|
}
|
|
1861
|
-
|
|
2569
|
+
var dimensionFromHierarchy = hierarchyDimensions[0];
|
|
2570
|
+
return (dimensionFromHierarchy &&
|
|
2571
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy, hierarchy));
|
|
1862
2572
|
}
|
|
1863
2573
|
|
|
1864
2574
|
var getDefaultSortOrders = function (_a) {
|
|
@@ -1874,7 +2584,8 @@ var getDefaultSortOrders = function (_a) {
|
|
|
1874
2584
|
/** Если есть временной разрез, то авто-сортировка по первому такому разрезу (по возрастанию) */
|
|
1875
2585
|
var timeDimension = dimensions.find(function (dimension) {
|
|
1876
2586
|
var _a;
|
|
1877
|
-
return ((_a = dimension.format) === null || _a === void 0 ? void 0 : _a.
|
|
2587
|
+
return ((_a = dimension.format) === null || _a === void 0 ? void 0 : _a.mode) === exports.EFormatOrFormattingMode.BASE &&
|
|
2588
|
+
dimension.format.value !== undefined &&
|
|
1878
2589
|
[
|
|
1879
2590
|
exports.EFormatTypes.DATE,
|
|
1880
2591
|
exports.EFormatTypes.MONTH,
|
|
@@ -1933,9 +2644,9 @@ function mapSortingToInputs(_a) {
|
|
|
1933
2644
|
return;
|
|
1934
2645
|
}
|
|
1935
2646
|
if (getIndicatorType(value.group, indicator) === exports.EWidgetIndicatorType.DIMENSION) {
|
|
1936
|
-
var activeDimensions = isDimensionsHierarchy(indicator)
|
|
2647
|
+
var activeDimensions = (isDimensionsHierarchy(indicator)
|
|
1937
2648
|
? selectDimensionFromHierarchy(indicator, filters)
|
|
1938
|
-
: indicator;
|
|
2649
|
+
: indicator);
|
|
1939
2650
|
var formula = activeDimensions && getDimensionFormula(activeDimensions);
|
|
1940
2651
|
if (!formula || !checkDisplayCondition(indicator.displayCondition, variables)) {
|
|
1941
2652
|
return;
|
|
@@ -1949,10 +2660,11 @@ function mapSortingToInputs(_a) {
|
|
|
1949
2660
|
: undefined,
|
|
1950
2661
|
};
|
|
1951
2662
|
}
|
|
2663
|
+
var measure = indicator;
|
|
1952
2664
|
return {
|
|
1953
|
-
formula: getMeasureFormula(
|
|
2665
|
+
formula: getMeasureFormula(measure),
|
|
1954
2666
|
direction: direction,
|
|
1955
|
-
dbDataType:
|
|
2667
|
+
dbDataType: measure.dbDataType,
|
|
1956
2668
|
};
|
|
1957
2669
|
});
|
|
1958
2670
|
return sortOrder;
|
|
@@ -1966,8 +2678,7 @@ function prepareSortOrders(_a) {
|
|
|
1966
2678
|
var replaceHierarchiesWithDimensions = function (dimensions, filters) {
|
|
1967
2679
|
return compactMap(dimensions, function (indicator) {
|
|
1968
2680
|
if (isDimensionsHierarchy(indicator)) {
|
|
1969
|
-
|
|
1970
|
-
return (selectedDimension && replaceDisplayCondition(selectedDimension, indicator.displayCondition));
|
|
2681
|
+
return selectDimensionFromHierarchy(indicator, filters);
|
|
1971
2682
|
}
|
|
1972
2683
|
return indicator;
|
|
1973
2684
|
});
|
|
@@ -2038,6 +2749,12 @@ exports.EUnitMode = void 0;
|
|
|
2038
2749
|
EUnitMode["PIXEL"] = "PIXEL";
|
|
2039
2750
|
EUnitMode["PERCENT"] = "PERCENT";
|
|
2040
2751
|
})(exports.EUnitMode || (exports.EUnitMode = {}));
|
|
2752
|
+
var defaultActionsConfig = {
|
|
2753
|
+
OPEN_URL: { availability: true },
|
|
2754
|
+
UPDATE_VARIABLE: { availability: true },
|
|
2755
|
+
EXECUTE_SCRIPT: { availability: true },
|
|
2756
|
+
OPEN_VIEW: { availability: true },
|
|
2757
|
+
};
|
|
2041
2758
|
|
|
2042
2759
|
exports.ESelectOptionTypes = void 0;
|
|
2043
2760
|
(function (ESelectOptionTypes) {
|
|
@@ -2226,6 +2943,120 @@ var getColorByIndex = function (index) {
|
|
|
2226
2943
|
return color;
|
|
2227
2944
|
};
|
|
2228
2945
|
|
|
2946
|
+
var WidgetPresetSettingsSchema = function (z) {
|
|
2947
|
+
return BaseWidgetSettingsSchema(z)
|
|
2948
|
+
.pick({
|
|
2949
|
+
filterMode: true,
|
|
2950
|
+
ignoreFilters: true,
|
|
2951
|
+
stateName: true,
|
|
2952
|
+
titleColor: true,
|
|
2953
|
+
titleSize: true,
|
|
2954
|
+
titleWeight: true,
|
|
2955
|
+
paddings: true,
|
|
2956
|
+
})
|
|
2957
|
+
.extend({
|
|
2958
|
+
textSize: z.number().default(12),
|
|
2959
|
+
});
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
/**
|
|
2963
|
+
* Привязывает мета-информацию о теме к Zod-схеме
|
|
2964
|
+
*
|
|
2965
|
+
* @template Value - Тип значения схемы
|
|
2966
|
+
* @template Theme - Тип темы (по умолчанию ITheme)
|
|
2967
|
+
*
|
|
2968
|
+
* @param scheme - Zod схема для привязки
|
|
2969
|
+
* @param selectThemeValue - Функция, возвращающая значение из темы
|
|
2970
|
+
*
|
|
2971
|
+
* @returns Zod схему с мета-информацией о теме
|
|
2972
|
+
*
|
|
2973
|
+
* @example
|
|
2974
|
+
* // Базовое использование
|
|
2975
|
+
* textSize: themed(
|
|
2976
|
+
* z.number().default(12),
|
|
2977
|
+
* (theme) => theme.textSize
|
|
2978
|
+
* )
|
|
2979
|
+
*/
|
|
2980
|
+
var themed = function (scheme, selectThemeValue) {
|
|
2981
|
+
var _a;
|
|
2982
|
+
return scheme.meta((_a = {}, _a[exports.ESettingsSchemaMetaKey.themeValue] = selectThemeValue, _a));
|
|
2983
|
+
};
|
|
2984
|
+
|
|
2985
|
+
var ColorBaseSchema = function (z) {
|
|
2986
|
+
return z.object({
|
|
2987
|
+
mode: z.literal(exports.EColorMode.BASE),
|
|
2988
|
+
value: z.string(),
|
|
2989
|
+
});
|
|
2990
|
+
};
|
|
2991
|
+
var ColorRuleSchema = function (z) {
|
|
2992
|
+
return z.object({
|
|
2993
|
+
mode: z.literal(exports.EColorMode.RULE),
|
|
2994
|
+
formula: FormulaSchema(z),
|
|
2995
|
+
});
|
|
2996
|
+
};
|
|
2997
|
+
var ColorAutoSchema = function (z) {
|
|
2998
|
+
return z.object({
|
|
2999
|
+
mode: z.literal(exports.EColorMode.AUTO),
|
|
3000
|
+
});
|
|
3001
|
+
};
|
|
3002
|
+
var ColorDisabledSchema = function (z) {
|
|
3003
|
+
return z.object({
|
|
3004
|
+
mode: z.literal(exports.EColorMode.DISABLED),
|
|
3005
|
+
});
|
|
3006
|
+
};
|
|
3007
|
+
var ColorGradientSchema = function (z) {
|
|
3008
|
+
return z.object({
|
|
3009
|
+
mode: z.literal(exports.EColorMode.GRADIENT),
|
|
3010
|
+
startValue: z.string(),
|
|
3011
|
+
endValue: z.string(),
|
|
3012
|
+
classCount: z.number().min(3).max(10).nullish(),
|
|
3013
|
+
});
|
|
3014
|
+
};
|
|
3015
|
+
var ColorFormulaSchema = function (z) {
|
|
3016
|
+
return z.object({
|
|
3017
|
+
mode: z.literal(exports.EColorMode.FORMULA),
|
|
3018
|
+
formula: FormulaSchema(z),
|
|
3019
|
+
});
|
|
3020
|
+
};
|
|
3021
|
+
var ColorValuesSchema = function (z) {
|
|
3022
|
+
return z.object({
|
|
3023
|
+
mode: z.literal(exports.EColorMode.VALUES),
|
|
3024
|
+
items: z
|
|
3025
|
+
.array(z.object({ value: z.string(), color: z.union([ColorBaseSchema(z), ColorRuleSchema(z)]) }))
|
|
3026
|
+
.default([]),
|
|
3027
|
+
});
|
|
3028
|
+
};
|
|
3029
|
+
var ColorByDimensionSchema = function (z) {
|
|
3030
|
+
return z.object({
|
|
3031
|
+
mode: z.literal(exports.EColorMode.BY_DIMENSION),
|
|
3032
|
+
/** Имя разреза из области видимости правила отображения */
|
|
3033
|
+
dimensionName: z.string(),
|
|
3034
|
+
items: z
|
|
3035
|
+
.array(z.object({ value: z.string(), color: z.union([ColorBaseSchema(z), ColorRuleSchema(z)]) }))
|
|
3036
|
+
.default([]),
|
|
3037
|
+
});
|
|
3038
|
+
};
|
|
3039
|
+
var ColoredValueSchema = function (z) {
|
|
3040
|
+
return z.object({
|
|
3041
|
+
value: z.string(),
|
|
3042
|
+
color: z.union([ColorBaseSchema(z), ColorRuleSchema(z)]),
|
|
3043
|
+
});
|
|
3044
|
+
};
|
|
3045
|
+
var ColorSchema = function (z) {
|
|
3046
|
+
return z
|
|
3047
|
+
.discriminatedUnion("mode", [
|
|
3048
|
+
ColorAutoSchema(z),
|
|
3049
|
+
ColorDisabledSchema(z),
|
|
3050
|
+
ColorBaseSchema(z),
|
|
3051
|
+
ColorRuleSchema(z),
|
|
3052
|
+
ColorGradientSchema(z),
|
|
3053
|
+
ColorFormulaSchema(z),
|
|
3054
|
+
ColorValuesSchema(z),
|
|
3055
|
+
ColorByDimensionSchema(z),
|
|
3056
|
+
])
|
|
3057
|
+
.default({ mode: exports.EColorMode.AUTO });
|
|
3058
|
+
};
|
|
3059
|
+
|
|
2229
3060
|
Object.defineProperty(exports, "ELanguages", {
|
|
2230
3061
|
enumerable: true,
|
|
2231
3062
|
get: function () { return localization$1.ELanguages; }
|
|
@@ -2234,6 +3065,81 @@ Object.defineProperty(exports, "EFilteringMethodValues", {
|
|
|
2234
3065
|
enumerable: true,
|
|
2235
3066
|
get: function () { return baseFilter.EFilteringMethodValues; }
|
|
2236
3067
|
});
|
|
3068
|
+
exports.ActionButtonSchema = ActionButtonSchema;
|
|
3069
|
+
exports.ActionDrillDownSchema = ActionDrillDownSchema;
|
|
3070
|
+
exports.ActionGoToURLSchema = ActionGoToURLSchema;
|
|
3071
|
+
exports.ActionOnClickParameterSchema = ActionOnClickParameterSchema;
|
|
3072
|
+
exports.ActionOpenInSchema = ActionOpenInSchema;
|
|
3073
|
+
exports.ActionOpenViewSchema = ActionOpenViewSchema;
|
|
3074
|
+
exports.ActionRunScriptSchema = ActionRunScriptSchema;
|
|
3075
|
+
exports.ActionSchema = ActionSchema;
|
|
3076
|
+
exports.ActionUpdateVariableSchema = ActionUpdateVariableSchema;
|
|
3077
|
+
exports.ActionsOnClickSchema = ActionsOnClickSchema;
|
|
3078
|
+
exports.AutoIdentifiedArrayItemSchema = AutoIdentifiedArrayItemSchema;
|
|
3079
|
+
exports.BaseWidgetSettingsSchema = BaseWidgetSettingsSchema;
|
|
3080
|
+
exports.ColorAutoSchema = ColorAutoSchema;
|
|
3081
|
+
exports.ColorBaseSchema = ColorBaseSchema;
|
|
3082
|
+
exports.ColorByDimensionSchema = ColorByDimensionSchema;
|
|
3083
|
+
exports.ColorDisabledSchema = ColorDisabledSchema;
|
|
3084
|
+
exports.ColorFormulaSchema = ColorFormulaSchema;
|
|
3085
|
+
exports.ColorGradientSchema = ColorGradientSchema;
|
|
3086
|
+
exports.ColorRuleSchema = ColorRuleSchema;
|
|
3087
|
+
exports.ColorSchema = ColorSchema;
|
|
3088
|
+
exports.ColorValuesSchema = ColorValuesSchema;
|
|
3089
|
+
exports.ColoredValueSchema = ColoredValueSchema;
|
|
3090
|
+
exports.ColumnIndicatorValueSchema = ColumnIndicatorValueSchema;
|
|
3091
|
+
exports.DimensionProcessFilterSchema = DimensionProcessFilterSchema;
|
|
3092
|
+
exports.DimensionValueSchema = DimensionValueSchema;
|
|
3093
|
+
exports.DisplayConditionSchema = DisplayConditionSchema;
|
|
3094
|
+
exports.ExtendedFormulaFilterValueSchema = ExtendedFormulaFilterValueSchema;
|
|
3095
|
+
exports.FormatSchema = FormatSchema;
|
|
3096
|
+
exports.FormattingSchema = FormattingSchema;
|
|
3097
|
+
exports.FormulaFilterValueSchema = FormulaFilterValueSchema;
|
|
3098
|
+
exports.FormulaNullableSchema = FormulaNullableSchema;
|
|
3099
|
+
exports.FormulaSchema = FormulaSchema;
|
|
3100
|
+
exports.KeyNullableSchema = KeyNullableSchema;
|
|
3101
|
+
exports.MarkdownMeasureSchema = MarkdownMeasureSchema;
|
|
3102
|
+
exports.MeasureValueSchema = MeasureValueSchema;
|
|
3103
|
+
exports.NameNullableSchema = NameNullableSchema;
|
|
3104
|
+
exports.ParameterFromAggregationSchema = ParameterFromAggregationSchema;
|
|
3105
|
+
exports.ParameterFromColumnSchema = ParameterFromColumnSchema;
|
|
3106
|
+
exports.ParameterFromDataModelSchema = ParameterFromDataModelSchema;
|
|
3107
|
+
exports.ParameterFromDynamicListSchema = ParameterFromDynamicListSchema;
|
|
3108
|
+
exports.ParameterFromEndEventSchema = ParameterFromEndEventSchema;
|
|
3109
|
+
exports.ParameterFromEventSchema = ParameterFromEventSchema;
|
|
3110
|
+
exports.ParameterFromFormulaSchema = ParameterFromFormulaSchema;
|
|
3111
|
+
exports.ParameterFromManualInputSchema = ParameterFromManualInputSchema;
|
|
3112
|
+
exports.ParameterFromStartEventSchema = ParameterFromStartEventSchema;
|
|
3113
|
+
exports.ParameterFromStaticListSchema = ParameterFromStaticListSchema;
|
|
3114
|
+
exports.ParameterFromVariableSchema = ParameterFromVariableSchema;
|
|
3115
|
+
exports.ProcessIndicatorSchema = ProcessIndicatorSchema;
|
|
3116
|
+
exports.ProcessIndicatorValueSchema = ProcessIndicatorValueSchema;
|
|
3117
|
+
exports.RangeSchema = RangeSchema;
|
|
3118
|
+
exports.SettingsFilterSchema = SettingsFilterSchema;
|
|
3119
|
+
exports.SortDirectionSchema = SortDirectionSchema;
|
|
3120
|
+
exports.SortOrderSchema = SortOrderSchema;
|
|
3121
|
+
exports.ViewActionParameterSchema = ViewActionParameterSchema;
|
|
3122
|
+
exports.ViewActionSchema = ViewActionSchema;
|
|
3123
|
+
exports.WidgetActionParameterSchema = WidgetActionParameterSchema;
|
|
3124
|
+
exports.WidgetActionSchema = WidgetActionSchema;
|
|
3125
|
+
exports.WidgetColumnIndicatorSchema = WidgetColumnIndicatorSchema;
|
|
3126
|
+
exports.WidgetDimensionHierarchySchema = WidgetDimensionHierarchySchema;
|
|
3127
|
+
exports.WidgetDimensionInHierarchySchema = WidgetDimensionInHierarchySchema;
|
|
3128
|
+
exports.WidgetDimensionSchema = WidgetDimensionSchema;
|
|
3129
|
+
exports.WidgetIndicatorAggregationValueSchema = WidgetIndicatorAggregationValueSchema;
|
|
3130
|
+
exports.WidgetIndicatorConversionValueSchema = WidgetIndicatorConversionValueSchema;
|
|
3131
|
+
exports.WidgetIndicatorDurationValueSchema = WidgetIndicatorDurationValueSchema;
|
|
3132
|
+
exports.WidgetIndicatorFormulaValueSchema = WidgetIndicatorFormulaValueSchema;
|
|
3133
|
+
exports.WidgetIndicatorSchema = WidgetIndicatorSchema;
|
|
3134
|
+
exports.WidgetIndicatorTemplateValueSchema = WidgetIndicatorTemplateValueSchema;
|
|
3135
|
+
exports.WidgetIndicatorTimeValueSchema = WidgetIndicatorTimeValueSchema;
|
|
3136
|
+
exports.WidgetMeasureAggregationValueSchema = WidgetMeasureAggregationValueSchema;
|
|
3137
|
+
exports.WidgetMeasureSchema = WidgetMeasureSchema;
|
|
3138
|
+
exports.WidgetPresetSettingsSchema = WidgetPresetSettingsSchema;
|
|
3139
|
+
exports.WidgetSortingIndicatorSchema = WidgetSortingIndicatorSchema;
|
|
3140
|
+
exports.WidgetSortingValueSchema = WidgetSortingValueSchema;
|
|
3141
|
+
exports.apiVersion = apiVersion;
|
|
3142
|
+
exports.apiVersions = apiVersions;
|
|
2237
3143
|
exports.applyIndexToArrayFormula = applyIndexToArrayFormula;
|
|
2238
3144
|
exports.bindContentWithIndicator = bindContentWithIndicator;
|
|
2239
3145
|
exports.bindContentsWithIndicators = bindContentsWithIndicators;
|
|
@@ -2249,6 +3155,7 @@ exports.createEscaper = createEscaper;
|
|
|
2249
3155
|
exports.createMeasureAggregationTemplate = createAggregationTemplate;
|
|
2250
3156
|
exports.curlyBracketsContentPattern = curlyBracketsContentPattern;
|
|
2251
3157
|
exports.dashboardLinkRegExp = dashboardLinkRegExp;
|
|
3158
|
+
exports.defaultActionsConfig = defaultActionsConfig;
|
|
2252
3159
|
exports.dimensionAggregationTemplates = dimensionAggregationTemplates;
|
|
2253
3160
|
exports.dimensionTemplateFormulas = dimensionTemplateFormulas;
|
|
2254
3161
|
exports.displayConditionTemplate = displayConditionTemplate;
|
|
@@ -2258,7 +3165,6 @@ exports.escapeCurlyBracketLinkName = escapeCurlyBracketLinkName;
|
|
|
2258
3165
|
exports.escapeDoubleQuoteLinkName = escapeDoubleQuoteLinkName;
|
|
2259
3166
|
exports.eventMeasureTemplateFormulas = eventMeasureTemplateFormulas;
|
|
2260
3167
|
exports.fillTemplateSql = fillTemplateSql;
|
|
2261
|
-
exports.fillTemplateString = fillTemplateString;
|
|
2262
3168
|
exports.formattingConfig = formattingConfig;
|
|
2263
3169
|
exports.formulaFilterMethods = formulaFilterMethods;
|
|
2264
3170
|
exports.generateColumnFormula = generateColumnFormula;
|
|
@@ -2272,6 +3178,7 @@ exports.getMeasureFormula = getMeasureFormula;
|
|
|
2272
3178
|
exports.getProcessDimensionValueFormula = getProcessDimensionValueFormula;
|
|
2273
3179
|
exports.getRuleColor = getRuleColor;
|
|
2274
3180
|
exports.getTransitionMeasureFormula = getTransitionMeasureFormula;
|
|
3181
|
+
exports.inheritDisplayConditionFromHierarchy = inheritDisplayConditionFromHierarchy;
|
|
2275
3182
|
exports.isDimensionProcessFilter = isDimensionProcessFilter;
|
|
2276
3183
|
exports.isDimensionsHierarchy = isDimensionsHierarchy;
|
|
2277
3184
|
exports.isFormulaFilterValue = isFormulaFilterValue;
|
|
@@ -2300,6 +3207,7 @@ exports.replaceDisplayCondition = replaceDisplayCondition;
|
|
|
2300
3207
|
exports.replaceFiltersBySelection = replaceFiltersBySelection;
|
|
2301
3208
|
exports.replaceHierarchiesWithDimensions = replaceHierarchiesWithDimensions;
|
|
2302
3209
|
exports.selectDimensionFromHierarchy = selectDimensionFromHierarchy;
|
|
3210
|
+
exports.themed = themed;
|
|
2303
3211
|
exports.timeTemplates = timeTemplates;
|
|
2304
3212
|
exports.transitionMeasureTemplateFormulas = transitionMeasureTemplateFormulas;
|
|
2305
3213
|
exports.unescapeSpecialCharacters = unescapeSpecialCharacters;
|