@infomaximum/widget-sdk 7.0.0-14 → 7.0.0-15
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 +16 -0
- package/dist/index.d.ts +13491 -13202
- package/dist/index.esm.js +1401 -760
- package/dist/index.js +1402 -759
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,46 +102,6 @@ exports.EActionButtonsTypes = void 0;
|
|
|
102
102
|
EActionButtonsTypes["SECONDARY"] = "primary-outlined";
|
|
103
103
|
})(exports.EActionButtonsTypes || (exports.EActionButtonsTypes = {}));
|
|
104
104
|
|
|
105
|
-
/**
|
|
106
|
-
* Глобальный счетчик для генерации ID.
|
|
107
|
-
*
|
|
108
|
-
* @todo
|
|
109
|
-
* В будущем можно заменить единый счетчик на изолированные счетчики в разных контекстах.
|
|
110
|
-
*/
|
|
111
|
-
var id = 1;
|
|
112
|
-
var AutoIdentifiedArrayItemSchema = function (z) {
|
|
113
|
-
return z.object({
|
|
114
|
-
/**
|
|
115
|
-
* Идентификатор, добавляемый системой "на лету" для удобства разработки, не сохраняется на сервер.
|
|
116
|
-
* Гарантируется уникальность id в пределах settings виджета.
|
|
117
|
-
*/
|
|
118
|
-
id: z
|
|
119
|
-
.number()
|
|
120
|
-
.default(-1)
|
|
121
|
-
.transform(function (currentId) { return (currentId === -1 ? id++ : currentId); }),
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
var BaseWidgetSettingsSchema = function (z) {
|
|
125
|
-
return z.object({
|
|
126
|
-
title: z.string().default(""),
|
|
127
|
-
titleSize: themed(z.number().default(14), function (theme) { return theme.widgets.titleSize; }),
|
|
128
|
-
titleColor: themed(ColorSchema(z), function (theme) { return theme.widgets.titleColor; }),
|
|
129
|
-
titleWeight: themed(z.enum(exports.EFontWeight).default(exports.EFontWeight.NORMAL), function (theme) { return theme.widgets.titleWeight; }),
|
|
130
|
-
stateName: z.string().nullable().default(null),
|
|
131
|
-
showMarkdown: z.boolean().default(false),
|
|
132
|
-
markdownMeasures: z.array(MarkdownMeasureSchema(z)).default([]),
|
|
133
|
-
markdownText: z.string().default(""),
|
|
134
|
-
markdownTextSize: z.number().default(14),
|
|
135
|
-
filters: z.array(SettingsFilterSchema(z)).default([]),
|
|
136
|
-
filterMode: z.enum(exports.EWidgetFilterMode).default(exports.EWidgetFilterMode.DEFAULT),
|
|
137
|
-
ignoreFilters: z.boolean().default(false),
|
|
138
|
-
sorting: z.array(WidgetSortingIndicatorSchema(z)).default([]),
|
|
139
|
-
actionButtons: z.array(ActionButtonSchema(z)).default([]),
|
|
140
|
-
paddings: themed(z.union([z.number(), z.string()]).default(8), function (theme) { return theme.widgets.paddings; }),
|
|
141
|
-
viewTheme: z.boolean().default(false),
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
|
|
145
105
|
/******************************************************************************
|
|
146
106
|
Copyright (c) Microsoft Corporation.
|
|
147
107
|
|
|
@@ -158,6 +118,20 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
158
118
|
***************************************************************************** */
|
|
159
119
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
160
120
|
|
|
121
|
+
var extendStatics = function(d, b) {
|
|
122
|
+
extendStatics = Object.setPrototypeOf ||
|
|
123
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
124
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
125
|
+
return extendStatics(d, b);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
function __extends(d, b) {
|
|
129
|
+
if (typeof b !== "function" && b !== null)
|
|
130
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
131
|
+
extendStatics(d, b);
|
|
132
|
+
function __() { this.constructor = d; }
|
|
133
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
134
|
+
}
|
|
161
135
|
|
|
162
136
|
var __assign = function() {
|
|
163
137
|
__assign = Object.assign || function __assign(t) {
|
|
@@ -211,6 +185,16 @@ function __read(o, n) {
|
|
|
211
185
|
return ar;
|
|
212
186
|
}
|
|
213
187
|
|
|
188
|
+
function __spreadArray(to, from, pack) {
|
|
189
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
190
|
+
if (ar || !(i in from)) {
|
|
191
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
192
|
+
ar[i] = from[i];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
196
|
+
}
|
|
197
|
+
|
|
214
198
|
function __makeTemplateObject(cooked, raw) {
|
|
215
199
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
216
200
|
return cooked;
|
|
@@ -220,6 +204,204 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
220
204
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
221
205
|
};
|
|
222
206
|
|
|
207
|
+
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
208
|
+
var compactMap = function (items, f) {
|
|
209
|
+
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
210
|
+
};
|
|
211
|
+
var isNil = function (value) {
|
|
212
|
+
return value === null || value === undefined;
|
|
213
|
+
};
|
|
214
|
+
function memoize(fn) {
|
|
215
|
+
var cache = new Map();
|
|
216
|
+
return function (arg) {
|
|
217
|
+
if (cache.has(arg)) {
|
|
218
|
+
return cache.get(arg);
|
|
219
|
+
}
|
|
220
|
+
var result = fn(arg);
|
|
221
|
+
cache.set(arg, result);
|
|
222
|
+
return result;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/** Добавляет свойства к функции */
|
|
226
|
+
function assignPropsToFn(fn, props) {
|
|
227
|
+
return Object.assign(fn, props);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Фабрика версионированных схем. Не содержит состояния */
|
|
231
|
+
var VersionedSchemaFactory = /** @class */ (function () {
|
|
232
|
+
function VersionedSchemaFactory() {
|
|
233
|
+
}
|
|
234
|
+
VersionedSchemaFactory.compareVersions = function (a, b) {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
var partsA = a.split(".").map(Number);
|
|
237
|
+
var partsB = b.split(".").map(Number);
|
|
238
|
+
var length = Math.max(partsA.length, partsB.length);
|
|
239
|
+
for (var i = 0; i < length; i++) {
|
|
240
|
+
var pa = (_a = partsA[i]) !== null && _a !== void 0 ? _a : 0;
|
|
241
|
+
var pb = (_b = partsB[i]) !== null && _b !== void 0 ? _b : 0;
|
|
242
|
+
var diff = Math.sign(pa - pb);
|
|
243
|
+
if (diff !== 0) {
|
|
244
|
+
return diff;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return 0;
|
|
248
|
+
};
|
|
249
|
+
VersionedSchemaFactory.findClosestVersion = function (versions, targetVersion, compare) {
|
|
250
|
+
return versions
|
|
251
|
+
.toSorted(function (a, b) { return compare(b, a); })
|
|
252
|
+
.find(function (version) { return compare(version, targetVersion) <= 0; });
|
|
253
|
+
};
|
|
254
|
+
/** Добавляет метаданные к схеме (curried) */
|
|
255
|
+
VersionedSchemaFactory.annotateSchema = function (meta) {
|
|
256
|
+
if (meta === undefined) {
|
|
257
|
+
return function (schemaFactory) { return schemaFactory; };
|
|
258
|
+
}
|
|
259
|
+
return function (schemaFactory) {
|
|
260
|
+
return (function (z) {
|
|
261
|
+
var restArgs = [];
|
|
262
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
263
|
+
restArgs[_i - 1] = arguments[_i];
|
|
264
|
+
}
|
|
265
|
+
return schemaFactory.apply(void 0, __spreadArray([z], __read(restArgs), false)).meta(meta);
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
/** Построить версионированную схему */
|
|
270
|
+
VersionedSchemaFactory.build = function (_a) {
|
|
271
|
+
var _this = this;
|
|
272
|
+
var history = _a.history, latestVersion = _a.latestVersion, meta = _a.meta;
|
|
273
|
+
var latestFactory = history[latestVersion];
|
|
274
|
+
if (!latestFactory) {
|
|
275
|
+
throw new Error("Не найдено записи в 'history' по 'latestVersion'");
|
|
276
|
+
}
|
|
277
|
+
var map = this.annotateSchema(meta);
|
|
278
|
+
var schema = assignPropsToFn(map(latestFactory), {
|
|
279
|
+
forVersion: function (targetVersion) {
|
|
280
|
+
if (targetVersion === null || targetVersion === undefined) {
|
|
281
|
+
return map(latestFactory);
|
|
282
|
+
}
|
|
283
|
+
if (targetVersion in history) {
|
|
284
|
+
return map(history[targetVersion]);
|
|
285
|
+
}
|
|
286
|
+
var closestVersion = _this.findClosestVersion(Object.keys(history), targetVersion, VersionedSchemaFactory.compareVersions);
|
|
287
|
+
if (closestVersion === undefined || !(closestVersion in history)) {
|
|
288
|
+
throw new Error("\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0435\u0439 \u0441\u0445\u0435\u043C\u044B \u0434\u043B\u044F \u0432\u0435\u0440\u0441\u0438\u0438 '".concat(targetVersion, "'"));
|
|
289
|
+
}
|
|
290
|
+
return map(history[closestVersion]);
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
return schema;
|
|
294
|
+
};
|
|
295
|
+
return VersionedSchemaFactory;
|
|
296
|
+
}());
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Глобальный реестр версионированных схем (публичный слой, только чтение).
|
|
300
|
+
*
|
|
301
|
+
* Отвечает за:
|
|
302
|
+
*
|
|
303
|
+
* 1. Хранение зарегистрированных схем
|
|
304
|
+
* 2. Поиск схем по ключу
|
|
305
|
+
*
|
|
306
|
+
* Не предоставляет API для модификации registry.
|
|
307
|
+
*/
|
|
308
|
+
var SchemaRegistryReader = /** @class */ (function () {
|
|
309
|
+
function SchemaRegistryReader() {
|
|
310
|
+
}
|
|
311
|
+
/** Получить версионированную схему из `registry` по ключу схемы */
|
|
312
|
+
SchemaRegistryReader.get = function (schemaKey) {
|
|
313
|
+
return this.registry.get(schemaKey);
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Имя поля в метаданных схемы, в котором хранится идентификатор типа схемы.
|
|
317
|
+
*
|
|
318
|
+
* Это поле добавляется ко всем схемам, зарегистрированным через `SchemaRegistry`.
|
|
319
|
+
*/
|
|
320
|
+
SchemaRegistryReader.typeKey = "type";
|
|
321
|
+
SchemaRegistryReader.registry = new Map();
|
|
322
|
+
return SchemaRegistryReader;
|
|
323
|
+
}());
|
|
324
|
+
/**
|
|
325
|
+
* Глобальный реестр версионированных схем (внутренний слой).
|
|
326
|
+
*
|
|
327
|
+
* Расширяет SchemaRegistryReader возможностью создать запись в registry.
|
|
328
|
+
*
|
|
329
|
+
* Отвечает за:
|
|
330
|
+
* 1. Декларацию схем (build + аннотация)
|
|
331
|
+
* 2. Регистрацию схем по ключу
|
|
332
|
+
*/
|
|
333
|
+
var SchemaRegistry = /** @class */ (function (_super) {
|
|
334
|
+
__extends(SchemaRegistry, _super);
|
|
335
|
+
function SchemaRegistry() {
|
|
336
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
337
|
+
}
|
|
338
|
+
/** Объявляет версионированную схему и регистрирует её во внутреннем `registry` */
|
|
339
|
+
SchemaRegistry.define = function (_a) {
|
|
340
|
+
var _b;
|
|
341
|
+
var key = _a.key, history = _a.history, latestVersion = _a.latestVersion;
|
|
342
|
+
var schema = VersionedSchemaFactory.build({
|
|
343
|
+
history: history,
|
|
344
|
+
latestVersion: latestVersion,
|
|
345
|
+
meta: (_b = {}, _b[this.typeKey] = key, _b),
|
|
346
|
+
});
|
|
347
|
+
this.registry.set(key, schema);
|
|
348
|
+
return schema;
|
|
349
|
+
};
|
|
350
|
+
return SchemaRegistry;
|
|
351
|
+
}(SchemaRegistryReader));
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Глобальный счетчик для генерации ID.
|
|
355
|
+
*
|
|
356
|
+
* @todo
|
|
357
|
+
* В будущем можно заменить единый счетчик на изолированные счетчики в разных контекстах.
|
|
358
|
+
*/
|
|
359
|
+
var id = 1;
|
|
360
|
+
var AutoIdentifiedArrayItemSchema = SchemaRegistry.define({
|
|
361
|
+
key: "AutoIdentifiedArrayItem",
|
|
362
|
+
latestVersion: "17",
|
|
363
|
+
history: {
|
|
364
|
+
"17": function (z) {
|
|
365
|
+
return z.object({
|
|
366
|
+
/**
|
|
367
|
+
* Идентификатор, добавляемый системой "на лету" для удобства разработки, не сохраняется на сервер.
|
|
368
|
+
* Гарантируется уникальность id в пределах settings виджета.
|
|
369
|
+
*/
|
|
370
|
+
id: z
|
|
371
|
+
.number()
|
|
372
|
+
.default(-1)
|
|
373
|
+
.transform(function (currentId) { return (currentId === -1 ? id++ : currentId); }),
|
|
374
|
+
});
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
var BaseWidgetSettingsSchema = SchemaRegistry.define({
|
|
379
|
+
key: "BaseWidgetSettings",
|
|
380
|
+
latestVersion: "17",
|
|
381
|
+
history: {
|
|
382
|
+
"17": function (z) {
|
|
383
|
+
return z.object({
|
|
384
|
+
title: z.string().default(""),
|
|
385
|
+
titleSize: themed(z.number().default(14), function (theme) { return theme.widgets.titleSize; }),
|
|
386
|
+
titleColor: themed(ColorSchema.forVersion("17")(z), function (theme) { return theme.widgets.titleColor; }),
|
|
387
|
+
titleWeight: themed(z.enum(exports.EFontWeight).default(exports.EFontWeight.NORMAL), function (theme) { return theme.widgets.titleWeight; }),
|
|
388
|
+
stateName: z.string().nullable().default(null),
|
|
389
|
+
showMarkdown: z.boolean().default(false),
|
|
390
|
+
markdownMeasures: z.array(MarkdownMeasureSchema.forVersion("17")(z)).default([]),
|
|
391
|
+
markdownText: z.string().default(""),
|
|
392
|
+
markdownTextSize: z.number().default(14),
|
|
393
|
+
filters: z.array(SettingsFilterSchema.forVersion("17")(z)).default([]),
|
|
394
|
+
filterMode: z.enum(exports.EWidgetFilterMode).default(exports.EWidgetFilterMode.DEFAULT),
|
|
395
|
+
ignoreFilters: z.boolean().default(false),
|
|
396
|
+
sorting: z.array(WidgetSortingIndicatorSchema.forVersion("17")(z)).default([]),
|
|
397
|
+
actionButtons: z.array(ActionButtonSchema.forVersion("17")(z)).default([]),
|
|
398
|
+
paddings: themed(z.union([z.number(), z.string()]).default(8), function (theme) { return theme.widgets.paddings; }),
|
|
399
|
+
viewTheme: z.boolean().default(false),
|
|
400
|
+
});
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
|
|
223
405
|
exports.EWidgetIndicatorType = void 0;
|
|
224
406
|
(function (EWidgetIndicatorType) {
|
|
225
407
|
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
@@ -359,35 +541,53 @@ exports.EHeightMode = void 0;
|
|
|
359
541
|
EHeightMode["PERCENT"] = "PERCENT";
|
|
360
542
|
})(exports.EHeightMode || (exports.EHeightMode = {}));
|
|
361
543
|
|
|
362
|
-
var SortDirectionSchema =
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
544
|
+
var SortDirectionSchema = SchemaRegistry.define({
|
|
545
|
+
key: "SortDirection",
|
|
546
|
+
latestVersion: "17",
|
|
547
|
+
history: {
|
|
548
|
+
"17": function (z) {
|
|
549
|
+
return z.union([z.literal(exports.ESortDirection.ascend), z.literal(exports.ESortDirection.descend)]);
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
});
|
|
553
|
+
var SortOrderSchema = SchemaRegistry.define({
|
|
554
|
+
key: "SortOrder",
|
|
555
|
+
latestVersion: "17",
|
|
556
|
+
history: {
|
|
557
|
+
"17": function (z) {
|
|
558
|
+
return z.object({
|
|
559
|
+
/** Формула сортировки */
|
|
560
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
561
|
+
/** Тип данных формулы */
|
|
562
|
+
dbDataType: z.string().optional(),
|
|
563
|
+
/** Направление сортировки */
|
|
564
|
+
direction: SortDirectionSchema.forVersion("17")(z),
|
|
565
|
+
/** Условие применения сортировки */
|
|
566
|
+
displayCondition: FormulaSchema.forVersion("17")(z).optional(),
|
|
567
|
+
});
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
});
|
|
571
|
+
var WidgetSortingValueSchema = SchemaRegistry.define({
|
|
572
|
+
key: "WidgetSortingValue",
|
|
573
|
+
latestVersion: "17",
|
|
574
|
+
history: {
|
|
575
|
+
"17": function (z) {
|
|
576
|
+
return z.discriminatedUnion("mode", [
|
|
577
|
+
z.object({
|
|
578
|
+
mode: z.literal(exports.ESortingValueModes.FORMULA),
|
|
579
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
580
|
+
dbDataType: z.string().optional(),
|
|
581
|
+
}),
|
|
582
|
+
z.object({
|
|
583
|
+
mode: z.literal(exports.ESortingValueModes.IN_WIDGET),
|
|
584
|
+
group: z.string(),
|
|
585
|
+
index: z.number(),
|
|
586
|
+
}),
|
|
587
|
+
]);
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
});
|
|
391
591
|
|
|
392
592
|
/** Ключи мета-данных внутри схем настроек */
|
|
393
593
|
exports.ESettingsSchemaMetaKey = void 0;
|
|
@@ -399,35 +599,59 @@ exports.ESettingsSchemaMetaKey = void 0;
|
|
|
399
599
|
})(exports.ESettingsSchemaMetaKey || (exports.ESettingsSchemaMetaKey = {}));
|
|
400
600
|
|
|
401
601
|
var _a$7;
|
|
402
|
-
var RangeSchema =
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
z
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
602
|
+
var RangeSchema = SchemaRegistry.define({
|
|
603
|
+
key: "Range",
|
|
604
|
+
latestVersion: "17",
|
|
605
|
+
history: {
|
|
606
|
+
"17": function (z) {
|
|
607
|
+
return z.object({
|
|
608
|
+
unit: z.string().optional(),
|
|
609
|
+
min: z.number().optional(),
|
|
610
|
+
max: z.number().optional(),
|
|
611
|
+
});
|
|
612
|
+
},
|
|
613
|
+
},
|
|
614
|
+
});
|
|
615
|
+
var DisplayConditionSchema = SchemaRegistry.define({
|
|
616
|
+
key: "DisplayCondition",
|
|
617
|
+
latestVersion: "17",
|
|
618
|
+
history: {
|
|
619
|
+
"17": function (z) {
|
|
620
|
+
return z
|
|
621
|
+
.discriminatedUnion("mode", [
|
|
622
|
+
z.object({
|
|
623
|
+
mode: z.literal(exports.EDisplayConditionMode.DISABLED),
|
|
624
|
+
}),
|
|
625
|
+
z.object({
|
|
626
|
+
mode: z.literal(exports.EDisplayConditionMode.FORMULA),
|
|
627
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
628
|
+
}),
|
|
629
|
+
z.object({
|
|
630
|
+
mode: z.literal(exports.EDisplayConditionMode.VARIABLE),
|
|
631
|
+
variableName: NameNullableSchema.forVersion("17")(z),
|
|
632
|
+
variableValue: z.string().nullable().default(null),
|
|
633
|
+
}),
|
|
634
|
+
])
|
|
635
|
+
.default({ mode: exports.EDisplayConditionMode.DISABLED });
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
});
|
|
427
639
|
/** Схема ключа сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
428
|
-
var KeyNullableSchema =
|
|
640
|
+
var KeyNullableSchema = SchemaRegistry.define({
|
|
641
|
+
key: "KeyNullable",
|
|
642
|
+
latestVersion: "17",
|
|
643
|
+
history: {
|
|
644
|
+
"17": function (z) { return z.string().nullable().default(null); },
|
|
645
|
+
},
|
|
646
|
+
});
|
|
429
647
|
/** Схема имени сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
430
|
-
var NameNullableSchema =
|
|
648
|
+
var NameNullableSchema = SchemaRegistry.define({
|
|
649
|
+
key: "NameNullable",
|
|
650
|
+
latestVersion: "17",
|
|
651
|
+
history: {
|
|
652
|
+
"17": function (z) { return z.string().nullable().default(null); },
|
|
653
|
+
},
|
|
654
|
+
});
|
|
431
655
|
/**
|
|
432
656
|
* Перечисление системных типов сущностей в схеме настроек виджетов.
|
|
433
657
|
* @note при расширении лучше положить на более общий уровень.
|
|
@@ -438,571 +662,929 @@ var EEntity;
|
|
|
438
662
|
})(EEntity || (EEntity = {}));
|
|
439
663
|
var formulaMeta = Object.freeze((_a$7 = {}, _a$7[exports.ESettingsSchemaMetaKey.entity] = EEntity.formula, _a$7));
|
|
440
664
|
/** Схема формулы */
|
|
441
|
-
var FormulaSchema =
|
|
665
|
+
var FormulaSchema = SchemaRegistry.define({
|
|
666
|
+
key: "Formula",
|
|
667
|
+
latestVersion: "17",
|
|
668
|
+
history: {
|
|
669
|
+
"17": function (z) { return z.string().default("").meta(formulaMeta); },
|
|
670
|
+
},
|
|
671
|
+
});
|
|
442
672
|
/**
|
|
443
673
|
* Схема формулы, которая не может быть пустой строкой, но может быть в
|
|
444
674
|
* неинициализированном состоянии null (вместо пустой строки)
|
|
445
675
|
*
|
|
446
676
|
* @note для обратной совместимости без необходимости писать миграции
|
|
447
677
|
*/
|
|
448
|
-
var FormulaNullableSchema =
|
|
449
|
-
|
|
450
|
-
|
|
678
|
+
var FormulaNullableSchema = SchemaRegistry.define({
|
|
679
|
+
key: "FormulaNullable",
|
|
680
|
+
latestVersion: "17",
|
|
681
|
+
history: {
|
|
682
|
+
"17": function (z) { return z.string().nullable().default(null).meta(formulaMeta); },
|
|
683
|
+
},
|
|
684
|
+
});
|
|
451
685
|
|
|
452
|
-
var WidgetIndicatorSchema =
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
};
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
686
|
+
var WidgetIndicatorSchema = SchemaRegistry.define({
|
|
687
|
+
key: "WidgetIndicator",
|
|
688
|
+
latestVersion: "17",
|
|
689
|
+
history: {
|
|
690
|
+
"17": function (z) {
|
|
691
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
692
|
+
name: z.string(),
|
|
693
|
+
});
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
});
|
|
697
|
+
var FormatSchema = SchemaRegistry.define({
|
|
698
|
+
key: "Format",
|
|
699
|
+
latestVersion: "17",
|
|
700
|
+
history: {
|
|
701
|
+
"17": function (z) {
|
|
702
|
+
return z
|
|
703
|
+
.discriminatedUnion("mode", [
|
|
704
|
+
z.object({
|
|
705
|
+
mode: z.literal(exports.EFormatOrFormattingMode.BASE),
|
|
706
|
+
value: z.enum(biFormatting.EFormatTypes).default(biFormatting.EFormatTypes.STRING).optional(),
|
|
707
|
+
}),
|
|
708
|
+
z.object({
|
|
709
|
+
mode: z.literal(exports.EFormatOrFormattingMode.TEMPLATE),
|
|
710
|
+
value: z.string().default("").optional(),
|
|
711
|
+
}),
|
|
712
|
+
])
|
|
713
|
+
.default({ mode: exports.EFormatOrFormattingMode.BASE, value: biFormatting.EFormatTypes.STRING });
|
|
714
|
+
},
|
|
715
|
+
},
|
|
716
|
+
});
|
|
717
|
+
var FormattingSchema = SchemaRegistry.define({
|
|
718
|
+
key: "Formatting",
|
|
719
|
+
latestVersion: "17",
|
|
720
|
+
history: {
|
|
721
|
+
"17": function (z) {
|
|
722
|
+
return z
|
|
723
|
+
.discriminatedUnion("mode", [
|
|
724
|
+
z.object({
|
|
725
|
+
mode: z.literal(exports.EFormatOrFormattingMode.BASE),
|
|
726
|
+
value: z.enum(biFormatting.EFormattingPresets).default(biFormatting.EFormattingPresets.AUTO),
|
|
727
|
+
}),
|
|
728
|
+
z.object({
|
|
729
|
+
mode: z.literal(exports.EFormatOrFormattingMode.TEMPLATE),
|
|
730
|
+
value: z.string().default(""),
|
|
731
|
+
}),
|
|
732
|
+
])
|
|
733
|
+
.default({ mode: exports.EFormatOrFormattingMode.BASE, value: biFormatting.EFormattingPresets.AUTO });
|
|
734
|
+
},
|
|
735
|
+
},
|
|
736
|
+
});
|
|
737
|
+
var WidgetColumnIndicatorSchema = SchemaRegistry.define({
|
|
738
|
+
key: "WidgetColumnIndicator",
|
|
739
|
+
latestVersion: "17",
|
|
740
|
+
history: {
|
|
741
|
+
"17": function (z) {
|
|
742
|
+
return WidgetIndicatorSchema.forVersion("17")(z).extend({
|
|
743
|
+
dbDataType: z.string().optional(),
|
|
744
|
+
format: FormatSchema.forVersion("17")(z).optional(),
|
|
745
|
+
formatting: FormattingSchema.forVersion("17")(z).optional(),
|
|
746
|
+
displayCondition: DisplayConditionSchema.forVersion("17")(z),
|
|
747
|
+
onClick: z.array(ActionsOnClickSchema.forVersion("17")(z)).default([]).optional(),
|
|
748
|
+
});
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
});
|
|
752
|
+
var WidgetIndicatorFormulaValueSchema = SchemaRegistry.define({
|
|
753
|
+
key: "WidgetIndicatorFormulaValue",
|
|
754
|
+
latestVersion: "17",
|
|
755
|
+
history: {
|
|
756
|
+
"17": function (z) {
|
|
757
|
+
return z.object({
|
|
758
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
759
|
+
formula: FormulaSchema.forVersion("17")(z).optional(),
|
|
760
|
+
});
|
|
761
|
+
},
|
|
762
|
+
},
|
|
763
|
+
});
|
|
764
|
+
var WidgetIndicatorTemplateValueSchema = SchemaRegistry.define({
|
|
765
|
+
key: "WidgetIndicatorTemplateValue",
|
|
766
|
+
latestVersion: "17",
|
|
767
|
+
history: {
|
|
768
|
+
"17": function (z) {
|
|
769
|
+
return z.object({
|
|
770
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
771
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
772
|
+
templateName: z.string().optional(),
|
|
773
|
+
/** Имя таблицы */
|
|
774
|
+
tableName: z.string().optional(),
|
|
775
|
+
/** Имя колонки */
|
|
776
|
+
columnName: z.string().optional(),
|
|
777
|
+
});
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
});
|
|
781
|
+
var ColumnIndicatorValueSchema = SchemaRegistry.define({
|
|
782
|
+
key: "ColumnIndicatorValue",
|
|
783
|
+
latestVersion: "17",
|
|
784
|
+
history: {
|
|
785
|
+
"17": function (z) {
|
|
786
|
+
return z.union([MeasureValueSchema.forVersion("17")(z), DimensionValueSchema.forVersion("17")(z)]);
|
|
787
|
+
},
|
|
788
|
+
},
|
|
789
|
+
});
|
|
790
|
+
var MeasureValueSchema = SchemaRegistry.define({
|
|
791
|
+
key: "MeasureValue",
|
|
792
|
+
latestVersion: "17",
|
|
793
|
+
history: {
|
|
794
|
+
"17": function (z) {
|
|
795
|
+
return z.discriminatedUnion("mode", [
|
|
796
|
+
WidgetIndicatorFormulaValueSchema.forVersion("17")(z),
|
|
797
|
+
WidgetIndicatorTemplateValueSchema.forVersion("17")(z).extend({
|
|
798
|
+
innerTemplateName: z.enum(exports.EMeasureInnerTemplateNames).optional(),
|
|
799
|
+
}),
|
|
800
|
+
]);
|
|
801
|
+
},
|
|
802
|
+
},
|
|
803
|
+
});
|
|
804
|
+
var DimensionValueSchema = SchemaRegistry.define({
|
|
805
|
+
key: "DimensionValue",
|
|
806
|
+
latestVersion: "17",
|
|
807
|
+
history: {
|
|
808
|
+
"17": function (z) {
|
|
809
|
+
return z.discriminatedUnion("mode", [
|
|
810
|
+
WidgetIndicatorFormulaValueSchema.forVersion("17")(z),
|
|
811
|
+
WidgetIndicatorTemplateValueSchema.forVersion("17")(z).extend({
|
|
812
|
+
innerTemplateName: z.never().optional(),
|
|
813
|
+
}),
|
|
814
|
+
]);
|
|
815
|
+
},
|
|
816
|
+
},
|
|
817
|
+
});
|
|
818
|
+
var WidgetIndicatorAggregationValueSchema = SchemaRegistry.define({
|
|
819
|
+
key: "WidgetIndicatorAggregationValue",
|
|
820
|
+
latestVersion: "17",
|
|
821
|
+
history: {
|
|
822
|
+
"17": function (z) {
|
|
823
|
+
return z.object({
|
|
824
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.AGGREGATION),
|
|
825
|
+
templateName: z.string(),
|
|
826
|
+
processKey: KeyNullableSchema.forVersion("17")(z),
|
|
827
|
+
eventName: NameNullableSchema.forVersion("17")(z),
|
|
828
|
+
eventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
829
|
+
anyEvent: z.literal(true).optional(),
|
|
830
|
+
caseCaseIdFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
831
|
+
filters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
832
|
+
tableName: z.string().optional(),
|
|
833
|
+
columnName: z.string().optional(),
|
|
834
|
+
eventTimeFormula: FormulaNullableSchema.forVersion("17")(z).optional(),
|
|
570
835
|
innerTemplateName: z.string().optional(),
|
|
571
|
-
})
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
var WidgetDimensionHierarchySchema = function (z, dimensionSchema) {
|
|
582
|
-
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
583
|
-
name: z.string(),
|
|
584
|
-
// Для иерархии является дискриминатором, для него нельзя задавать дефолтное значение.
|
|
585
|
-
hierarchyDimensions: z.array(dimensionSchema),
|
|
586
|
-
displayCondition: DisplayConditionSchema(z),
|
|
587
|
-
});
|
|
588
|
-
};
|
|
589
|
-
var WidgetIndicatorConversionValueSchema = function (z) {
|
|
590
|
-
return z.object({
|
|
591
|
-
mode: z.literal(exports.EWidgetIndicatorValueModes.CONVERSION),
|
|
592
|
-
startEventNameFormula: FormulaNullableSchema(z),
|
|
593
|
-
startEventProcessKey: KeyNullableSchema(z),
|
|
594
|
-
startEventName: NameNullableSchema(z),
|
|
595
|
-
startEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
596
|
-
startEventTimeFormula: FormulaNullableSchema(z),
|
|
597
|
-
endEventNameFormula: FormulaNullableSchema(z),
|
|
598
|
-
endEventProcessKey: KeyNullableSchema(z),
|
|
599
|
-
endEventName: NameNullableSchema(z),
|
|
600
|
-
endEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
601
|
-
endCaseCaseIdFormula: FormulaNullableSchema(z),
|
|
602
|
-
endEventTimeFormula: FormulaNullableSchema(z),
|
|
603
|
-
});
|
|
604
|
-
};
|
|
605
|
-
var WidgetIndicatorDurationValueSchema = function (z) {
|
|
606
|
-
return WidgetIndicatorConversionValueSchema(z).extend({
|
|
607
|
-
mode: z.literal(exports.EWidgetIndicatorValueModes.DURATION),
|
|
608
|
-
templateName: z.string(),
|
|
609
|
-
startEventAppearances: z.enum(exports.EEventAppearances),
|
|
610
|
-
endEventAppearances: z.enum(exports.EEventAppearances),
|
|
611
|
-
});
|
|
612
|
-
};
|
|
613
|
-
var WidgetMeasureSchema = function (z) {
|
|
614
|
-
return WidgetColumnIndicatorSchema(z).extend({
|
|
615
|
-
value: z
|
|
616
|
-
.discriminatedUnion("mode", [
|
|
617
|
-
MeasureValueSchema(z),
|
|
618
|
-
WidgetMeasureAggregationValueSchema(z),
|
|
619
|
-
WidgetIndicatorConversionValueSchema(z),
|
|
620
|
-
WidgetIndicatorDurationValueSchema(z),
|
|
621
|
-
])
|
|
622
|
-
.optional(),
|
|
623
|
-
});
|
|
624
|
-
};
|
|
625
|
-
var MarkdownMeasureSchema = function (z) {
|
|
626
|
-
return WidgetMeasureSchema(z).extend({
|
|
627
|
-
displaySign: z.enum(exports.EMarkdownDisplayMode).default(exports.EMarkdownDisplayMode.NONE),
|
|
628
|
-
});
|
|
629
|
-
};
|
|
630
|
-
var WidgetSortingIndicatorSchema = function (z) {
|
|
631
|
-
return WidgetIndicatorSchema(z).extend({
|
|
632
|
-
direction: SortDirectionSchema(z),
|
|
633
|
-
value: WidgetSortingValueSchema(z),
|
|
634
|
-
});
|
|
635
|
-
};
|
|
636
|
-
var ProcessIndicatorValueSchema = function (z) {
|
|
637
|
-
return z.discriminatedUnion("mode", [
|
|
638
|
-
z.object({
|
|
639
|
-
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
640
|
-
formula: FormulaSchema(z),
|
|
641
|
-
}),
|
|
642
|
-
z.object({
|
|
643
|
-
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
644
|
-
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
645
|
-
templateName: z.string(),
|
|
646
|
-
}),
|
|
647
|
-
]);
|
|
648
|
-
};
|
|
649
|
-
var ProcessIndicatorSchema = function (z) {
|
|
650
|
-
return WidgetIndicatorSchema(z).extend({
|
|
651
|
-
value: ProcessIndicatorValueSchema(z).optional(),
|
|
652
|
-
dbDataType: z.string().optional(),
|
|
653
|
-
format: FormatSchema(z).optional(),
|
|
654
|
-
formatting: FormattingSchema(z).optional(),
|
|
655
|
-
displayCondition: DisplayConditionSchema(z),
|
|
656
|
-
});
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
var FormulaFilterValueSchema = function (z) {
|
|
660
|
-
var _a;
|
|
661
|
-
return z.object({
|
|
662
|
-
name: z.string().nullish(),
|
|
663
|
-
formula: z.string(),
|
|
664
|
-
sliceIndex: z.number().optional(),
|
|
665
|
-
dbDataType: z.string(),
|
|
666
|
-
format: z.union([z.enum(biFormatting.EFormatTypes), z.string()]).optional(),
|
|
667
|
-
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
668
|
-
checkedValues: z.array(z.string().nullable()).optional(),
|
|
669
|
-
formValues: z
|
|
670
|
-
.object((_a = {},
|
|
671
|
-
_a[exports.EFormulaFilterFieldKeys.date] = z.string().nullable(),
|
|
672
|
-
_a[exports.EFormulaFilterFieldKeys.dateRange] = z.tuple([z.string(), z.string()]),
|
|
673
|
-
_a[exports.EFormulaFilterFieldKeys.numberRange] = z.tuple([
|
|
674
|
-
z.number().nullable(),
|
|
675
|
-
z.number().nullable(),
|
|
676
|
-
]),
|
|
677
|
-
_a[exports.EFormulaFilterFieldKeys.string] = z.string(),
|
|
678
|
-
// todo: отказаться от использования z.string(), оставить только z.number() [BI-15912]
|
|
679
|
-
_a[exports.EFormulaFilterFieldKeys.lastTimeValue] = z.number().or(z.string()),
|
|
680
|
-
_a[exports.EFormulaFilterFieldKeys.lastTimeUnit] = z.enum(exports.ELastTimeUnit),
|
|
681
|
-
_a[exports.EFormulaFilterFieldKeys.durationUnit] = z.enum(exports.EDurationUnit),
|
|
682
|
-
_a))
|
|
683
|
-
.partial()
|
|
684
|
-
.optional(),
|
|
685
|
-
});
|
|
686
|
-
};
|
|
687
|
-
var ExtendedFormulaFilterValueSchema = function (z) {
|
|
688
|
-
return z.union([FormulaFilterValueSchema(z), z.object({ formula: z.string() })]);
|
|
689
|
-
};
|
|
690
|
-
var DimensionProcessFilterSchema = function (z) {
|
|
691
|
-
return z.object({
|
|
692
|
-
value: z.union([
|
|
693
|
-
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
836
|
+
});
|
|
837
|
+
},
|
|
838
|
+
},
|
|
839
|
+
});
|
|
840
|
+
var WidgetMeasureAggregationValueSchema = SchemaRegistry.define({
|
|
841
|
+
key: "WidgetMeasureAggregationValue",
|
|
842
|
+
latestVersion: "17",
|
|
843
|
+
history: {
|
|
844
|
+
"17": function (z) {
|
|
845
|
+
return WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
694
846
|
outerAggregation: z.enum(exports.EOuterAggregation),
|
|
695
|
-
})
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
847
|
+
});
|
|
848
|
+
},
|
|
849
|
+
},
|
|
850
|
+
});
|
|
851
|
+
var WidgetIndicatorTimeValueSchema = SchemaRegistry.define({
|
|
852
|
+
key: "WidgetIndicatorTimeValue",
|
|
853
|
+
latestVersion: "17",
|
|
854
|
+
history: {
|
|
855
|
+
"17": function (z) {
|
|
856
|
+
return z.object({
|
|
857
|
+
templateName: z.string(),
|
|
858
|
+
mode: z.union([
|
|
859
|
+
z.literal(exports.EWidgetIndicatorValueModes.START_TIME),
|
|
860
|
+
z.literal(exports.EWidgetIndicatorValueModes.END_TIME),
|
|
861
|
+
]),
|
|
862
|
+
processKey: KeyNullableSchema.forVersion("17")(z),
|
|
863
|
+
eventName: NameNullableSchema.forVersion("17")(z),
|
|
864
|
+
eventTimeFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
865
|
+
caseCaseIdFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
866
|
+
eventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
867
|
+
filters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
868
|
+
});
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
});
|
|
872
|
+
var WidgetDimensionSchema = SchemaRegistry.define({
|
|
873
|
+
key: "WidgetDimension",
|
|
874
|
+
latestVersion: "17",
|
|
875
|
+
history: {
|
|
876
|
+
"17": function (z) {
|
|
877
|
+
return WidgetColumnIndicatorSchema.forVersion("17")(z).extend({
|
|
878
|
+
value: z
|
|
879
|
+
.discriminatedUnion("mode", [
|
|
880
|
+
DimensionValueSchema.forVersion("17")(z),
|
|
881
|
+
WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
882
|
+
innerTemplateName: z.string().optional(),
|
|
883
|
+
}),
|
|
884
|
+
WidgetIndicatorTimeValueSchema.forVersion("17")(z),
|
|
885
|
+
])
|
|
886
|
+
.optional(),
|
|
887
|
+
hideEmptyValues: z.boolean().default(false),
|
|
888
|
+
});
|
|
889
|
+
},
|
|
890
|
+
},
|
|
891
|
+
});
|
|
892
|
+
var WidgetDimensionInHierarchySchema = SchemaRegistry.define({
|
|
893
|
+
key: "WidgetDimensionInHierarchy",
|
|
894
|
+
latestVersion: "17",
|
|
895
|
+
history: {
|
|
896
|
+
"17": function (z) { return WidgetDimensionSchema.forVersion("17")(z).omit({ displayCondition: true }); },
|
|
897
|
+
},
|
|
898
|
+
});
|
|
899
|
+
var WidgetDimensionHierarchySchema = SchemaRegistry.define({
|
|
900
|
+
key: "WidgetDimensionHierarchy",
|
|
901
|
+
latestVersion: "17",
|
|
902
|
+
history: {
|
|
903
|
+
"17": function (z, dimensionSchema) {
|
|
904
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
905
|
+
name: z.string(),
|
|
906
|
+
// Для иерархии является дискриминатором, для него нельзя задавать дефолтное значение.
|
|
907
|
+
hierarchyDimensions: z.array(dimensionSchema),
|
|
908
|
+
displayCondition: DisplayConditionSchema.forVersion("17")(z),
|
|
909
|
+
});
|
|
910
|
+
},
|
|
911
|
+
},
|
|
912
|
+
});
|
|
913
|
+
var WidgetIndicatorConversionValueSchema = SchemaRegistry.define({
|
|
914
|
+
key: "WidgetIndicatorConversionValue",
|
|
915
|
+
latestVersion: "17",
|
|
916
|
+
history: {
|
|
917
|
+
"17": function (z) {
|
|
918
|
+
return z.object({
|
|
919
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.CONVERSION),
|
|
920
|
+
startEventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
921
|
+
startEventProcessKey: KeyNullableSchema.forVersion("17")(z),
|
|
922
|
+
startEventName: NameNullableSchema.forVersion("17")(z),
|
|
923
|
+
startEventFilters: z
|
|
924
|
+
.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z))
|
|
925
|
+
.default([]),
|
|
926
|
+
startEventTimeFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
927
|
+
endEventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
928
|
+
endEventProcessKey: KeyNullableSchema.forVersion("17")(z),
|
|
929
|
+
endEventName: NameNullableSchema.forVersion("17")(z),
|
|
930
|
+
endEventFilters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
931
|
+
endCaseCaseIdFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
932
|
+
endEventTimeFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
933
|
+
});
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
});
|
|
937
|
+
var WidgetIndicatorDurationValueSchema = SchemaRegistry.define({
|
|
938
|
+
key: "WidgetIndicatorDurationValue",
|
|
939
|
+
latestVersion: "17",
|
|
940
|
+
history: {
|
|
941
|
+
"17": function (z) {
|
|
942
|
+
return WidgetIndicatorConversionValueSchema.forVersion("17")(z).extend({
|
|
943
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.DURATION),
|
|
944
|
+
templateName: z.string(),
|
|
945
|
+
startEventAppearances: z.enum(exports.EEventAppearances),
|
|
946
|
+
endEventAppearances: z.enum(exports.EEventAppearances),
|
|
947
|
+
});
|
|
948
|
+
},
|
|
949
|
+
},
|
|
950
|
+
});
|
|
951
|
+
var WidgetMeasureSchema = SchemaRegistry.define({
|
|
952
|
+
key: "WidgetMeasure",
|
|
953
|
+
latestVersion: "17",
|
|
954
|
+
history: {
|
|
955
|
+
"17": function (z) {
|
|
956
|
+
return WidgetColumnIndicatorSchema.forVersion("17")(z).extend({
|
|
957
|
+
value: z
|
|
958
|
+
.discriminatedUnion("mode", [
|
|
959
|
+
MeasureValueSchema.forVersion("17")(z),
|
|
960
|
+
WidgetMeasureAggregationValueSchema.forVersion("17")(z),
|
|
961
|
+
WidgetIndicatorConversionValueSchema.forVersion("17")(z),
|
|
962
|
+
WidgetIndicatorDurationValueSchema.forVersion("17")(z),
|
|
963
|
+
])
|
|
964
|
+
.optional(),
|
|
965
|
+
});
|
|
966
|
+
},
|
|
967
|
+
},
|
|
968
|
+
});
|
|
969
|
+
var MarkdownMeasureSchema = SchemaRegistry.define({
|
|
970
|
+
key: "MarkdownMeasure",
|
|
971
|
+
latestVersion: "17",
|
|
972
|
+
history: {
|
|
973
|
+
"17": function (z) {
|
|
974
|
+
return WidgetMeasureSchema.forVersion("17")(z).extend({
|
|
975
|
+
displaySign: z.enum(exports.EMarkdownDisplayMode).default(exports.EMarkdownDisplayMode.NONE),
|
|
976
|
+
});
|
|
977
|
+
},
|
|
978
|
+
},
|
|
979
|
+
});
|
|
980
|
+
var WidgetSortingIndicatorSchema = SchemaRegistry.define({
|
|
981
|
+
key: "WidgetSortingIndicator",
|
|
982
|
+
latestVersion: "17",
|
|
983
|
+
history: {
|
|
984
|
+
"17": function (z) {
|
|
985
|
+
return WidgetIndicatorSchema.forVersion("17")(z).extend({
|
|
986
|
+
direction: SortDirectionSchema.forVersion("17")(z),
|
|
987
|
+
value: WidgetSortingValueSchema.forVersion("17")(z),
|
|
988
|
+
});
|
|
989
|
+
},
|
|
990
|
+
},
|
|
991
|
+
});
|
|
992
|
+
var ProcessIndicatorValueSchema = SchemaRegistry.define({
|
|
993
|
+
key: "ProcessIndicatorValue",
|
|
994
|
+
latestVersion: "17",
|
|
995
|
+
history: {
|
|
996
|
+
"17": function (z) {
|
|
997
|
+
return z.discriminatedUnion("mode", [
|
|
998
|
+
z.object({
|
|
999
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
1000
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1001
|
+
}),
|
|
1002
|
+
z.object({
|
|
1003
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
1004
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
1005
|
+
templateName: z.string(),
|
|
1006
|
+
}),
|
|
1007
|
+
]);
|
|
1008
|
+
},
|
|
1009
|
+
},
|
|
1010
|
+
});
|
|
1011
|
+
var ProcessIndicatorSchema = SchemaRegistry.define({
|
|
1012
|
+
key: "ProcessIndicator",
|
|
1013
|
+
latestVersion: "17",
|
|
1014
|
+
history: {
|
|
1015
|
+
"17": function (z) {
|
|
1016
|
+
return WidgetIndicatorSchema.forVersion("17")(z).extend({
|
|
1017
|
+
value: ProcessIndicatorValueSchema.forVersion("17")(z).optional(),
|
|
1018
|
+
dbDataType: z.string().optional(),
|
|
1019
|
+
format: FormatSchema.forVersion("17")(z).optional(),
|
|
1020
|
+
formatting: FormattingSchema.forVersion("17")(z).optional(),
|
|
1021
|
+
displayCondition: DisplayConditionSchema.forVersion("17")(z),
|
|
1022
|
+
});
|
|
1023
|
+
},
|
|
1024
|
+
},
|
|
1025
|
+
});
|
|
716
1026
|
|
|
717
|
-
var
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
var
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
};
|
|
830
|
-
var
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
};
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}
|
|
1027
|
+
var FormulaFilterValueSchema = SchemaRegistry.define({
|
|
1028
|
+
key: "FormulaFilterValue",
|
|
1029
|
+
latestVersion: "17",
|
|
1030
|
+
history: {
|
|
1031
|
+
"17": function (z) {
|
|
1032
|
+
var _a;
|
|
1033
|
+
return z.object({
|
|
1034
|
+
name: z.string().nullish(),
|
|
1035
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1036
|
+
sliceIndex: z.number().optional(),
|
|
1037
|
+
dbDataType: z.string(),
|
|
1038
|
+
format: z.union([z.enum(biFormatting.EFormatTypes), z.string()]).optional(),
|
|
1039
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
1040
|
+
checkedValues: z.array(z.string().nullable()).default([]).optional(),
|
|
1041
|
+
formValues: z
|
|
1042
|
+
.object((_a = {},
|
|
1043
|
+
_a[exports.EFormulaFilterFieldKeys.date] = z.string().nullable(),
|
|
1044
|
+
_a[exports.EFormulaFilterFieldKeys.dateRange] = z.tuple([z.string(), z.string()]),
|
|
1045
|
+
_a[exports.EFormulaFilterFieldKeys.numberRange] = z.tuple([
|
|
1046
|
+
z.number().nullable(),
|
|
1047
|
+
z.number().nullable(),
|
|
1048
|
+
]),
|
|
1049
|
+
_a[exports.EFormulaFilterFieldKeys.string] = z.string(),
|
|
1050
|
+
// todo: отказаться от использования z.string(), оставить только z.number() [BI-15912]
|
|
1051
|
+
_a[exports.EFormulaFilterFieldKeys.lastTimeValue] = z.number().or(z.string()),
|
|
1052
|
+
_a[exports.EFormulaFilterFieldKeys.lastTimeUnit] = z.enum(exports.ELastTimeUnit),
|
|
1053
|
+
_a[exports.EFormulaFilterFieldKeys.durationUnit] = z.enum(exports.EDurationUnit),
|
|
1054
|
+
_a))
|
|
1055
|
+
.partial()
|
|
1056
|
+
.optional(),
|
|
1057
|
+
});
|
|
1058
|
+
},
|
|
1059
|
+
},
|
|
1060
|
+
});
|
|
1061
|
+
var ExtendedFormulaFilterValueSchema = SchemaRegistry.define({
|
|
1062
|
+
key: "ExtendedFormulaFilterValue",
|
|
1063
|
+
latestVersion: "17",
|
|
1064
|
+
history: {
|
|
1065
|
+
"17": function (z) {
|
|
1066
|
+
return z.union([
|
|
1067
|
+
FormulaFilterValueSchema.forVersion("17")(z),
|
|
1068
|
+
z.object({ formula: FormulaSchema.forVersion("17")(z) }),
|
|
1069
|
+
]);
|
|
1070
|
+
},
|
|
1071
|
+
},
|
|
1072
|
+
});
|
|
1073
|
+
var DimensionProcessFilterSchema = SchemaRegistry.define({
|
|
1074
|
+
key: "DimensionProcessFilter",
|
|
1075
|
+
latestVersion: "17",
|
|
1076
|
+
history: {
|
|
1077
|
+
"17": function (z) {
|
|
1078
|
+
return z.object({
|
|
1079
|
+
value: z.union([
|
|
1080
|
+
WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
1081
|
+
outerAggregation: z.enum(exports.EOuterAggregation),
|
|
1082
|
+
}),
|
|
1083
|
+
WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
1084
|
+
innerTemplateName: z.string().optional(),
|
|
1085
|
+
}),
|
|
1086
|
+
WidgetIndicatorTimeValueSchema.forVersion("17")(z),
|
|
1087
|
+
z.object({
|
|
1088
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
1089
|
+
formula: FormulaSchema.forVersion("17")(z).optional(),
|
|
1090
|
+
}),
|
|
1091
|
+
]),
|
|
1092
|
+
dbDataType: z.string(),
|
|
1093
|
+
condition: z.object({
|
|
1094
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
1095
|
+
timeUnit: z.enum(exports.EDimensionProcessFilterTimeUnit).optional(),
|
|
1096
|
+
values: z.array(z.string().nullable()),
|
|
1097
|
+
}),
|
|
1098
|
+
});
|
|
1099
|
+
},
|
|
1100
|
+
},
|
|
1101
|
+
});
|
|
1102
|
+
var SettingsFilterSchema = SchemaRegistry.define({
|
|
1103
|
+
key: "SettingsFilter",
|
|
1104
|
+
latestVersion: "17",
|
|
1105
|
+
history: {
|
|
1106
|
+
"17": function (z) {
|
|
1107
|
+
return z.union([
|
|
1108
|
+
ExtendedFormulaFilterValueSchema.forVersion("17")(z),
|
|
1109
|
+
DimensionProcessFilterSchema.forVersion("17")(z),
|
|
1110
|
+
]);
|
|
1111
|
+
},
|
|
1112
|
+
},
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1115
|
+
var ActionOnClickParameterCommonSchema = SchemaRegistry.define({
|
|
1116
|
+
key: "ActionOnClickParameterCommon",
|
|
1117
|
+
latestVersion: "17",
|
|
1118
|
+
history: {
|
|
1119
|
+
"17": function (z) {
|
|
1120
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1121
|
+
name: z.string(),
|
|
1122
|
+
});
|
|
1123
|
+
},
|
|
1124
|
+
},
|
|
1125
|
+
});
|
|
1126
|
+
var ParameterFromColumnSchema = SchemaRegistry.define({
|
|
1127
|
+
key: "ParameterFromColumn",
|
|
1128
|
+
latestVersion: "17",
|
|
1129
|
+
history: {
|
|
1130
|
+
"17": function (z) {
|
|
1131
|
+
return z.object({
|
|
1132
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.COLUMN),
|
|
1133
|
+
tableName: z.string().nullable().default(null),
|
|
1134
|
+
columnName: z.string().nullable().default(null),
|
|
1135
|
+
dbDataType: z.string().optional(),
|
|
1136
|
+
});
|
|
1137
|
+
},
|
|
1138
|
+
},
|
|
1139
|
+
});
|
|
1140
|
+
var ParameterFromVariableSchema = SchemaRegistry.define({
|
|
1141
|
+
key: "ParameterFromVariable",
|
|
1142
|
+
latestVersion: "17",
|
|
1143
|
+
history: {
|
|
1144
|
+
"17": function (z) {
|
|
1145
|
+
return z.object({
|
|
1146
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.VARIABLE),
|
|
1147
|
+
sourceVariable: z.string().nullable().default(null),
|
|
1148
|
+
});
|
|
1149
|
+
},
|
|
1150
|
+
},
|
|
1151
|
+
});
|
|
1152
|
+
var ParameterFromFormulaSchema = SchemaRegistry.define({
|
|
1153
|
+
key: "ParameterFromFormula",
|
|
1154
|
+
latestVersion: "17",
|
|
1155
|
+
history: {
|
|
1156
|
+
"17": function (z) {
|
|
1157
|
+
return z.object({
|
|
1158
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.FORMULA),
|
|
1159
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1160
|
+
considerFilters: z.boolean().default(false),
|
|
1161
|
+
dbDataType: z.string().optional(),
|
|
1162
|
+
});
|
|
1163
|
+
},
|
|
1164
|
+
},
|
|
1165
|
+
});
|
|
1166
|
+
var ParameterFromEventSchema = SchemaRegistry.define({
|
|
1167
|
+
key: "ParameterFromEvent",
|
|
1168
|
+
latestVersion: "17",
|
|
1169
|
+
history: {
|
|
1170
|
+
"17": function (z) {
|
|
1171
|
+
return z.object({
|
|
1172
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.EVENT),
|
|
1173
|
+
});
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
|
+
});
|
|
1177
|
+
var ParameterFromStartEventSchema = SchemaRegistry.define({
|
|
1178
|
+
key: "ParameterFromStartEvent",
|
|
1179
|
+
latestVersion: "17",
|
|
1180
|
+
history: {
|
|
1181
|
+
"17": function (z) {
|
|
1182
|
+
return z.object({
|
|
1183
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.START_EVENT),
|
|
1184
|
+
});
|
|
1185
|
+
},
|
|
1186
|
+
},
|
|
1187
|
+
});
|
|
1188
|
+
var ParameterFromEndEventSchema = SchemaRegistry.define({
|
|
1189
|
+
key: "ParameterFromEndEvent",
|
|
1190
|
+
latestVersion: "17",
|
|
1191
|
+
history: {
|
|
1192
|
+
"17": function (z) {
|
|
1193
|
+
return z.object({
|
|
1194
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.FINISH_EVENT),
|
|
1195
|
+
});
|
|
1196
|
+
},
|
|
1197
|
+
},
|
|
1198
|
+
});
|
|
1199
|
+
var ParameterFromAggregationSchema = SchemaRegistry.define({
|
|
1200
|
+
key: "ParameterFromAggregation",
|
|
1201
|
+
latestVersion: "17",
|
|
1202
|
+
history: {
|
|
1203
|
+
"17": function (z) {
|
|
1204
|
+
return z.object({
|
|
1205
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.AGGREGATION),
|
|
1206
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1207
|
+
considerFilters: z.boolean().default(false),
|
|
1208
|
+
dbDataType: z.string().optional(),
|
|
1209
|
+
});
|
|
1210
|
+
},
|
|
1211
|
+
},
|
|
1212
|
+
});
|
|
1213
|
+
var ParameterFromManualInputSchema = SchemaRegistry.define({
|
|
1214
|
+
key: "ParameterFromManualInput",
|
|
1215
|
+
latestVersion: "17",
|
|
1216
|
+
history: {
|
|
1217
|
+
"17": function (z) {
|
|
1218
|
+
return z.object({
|
|
1219
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.MANUALLY),
|
|
1220
|
+
description: z.string().default(""),
|
|
1221
|
+
defaultValue: FormulaSchema.forVersion("17")(z),
|
|
1222
|
+
dbDataType: z.string().optional(),
|
|
1223
|
+
filterByRows: z.boolean().default(false),
|
|
1224
|
+
validation: FormulaSchema.forVersion("17")(z),
|
|
1225
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1226
|
+
});
|
|
1227
|
+
},
|
|
1228
|
+
},
|
|
1229
|
+
});
|
|
1230
|
+
var ParameterFromStaticListSchema = SchemaRegistry.define({
|
|
1231
|
+
key: "ParameterFromStaticList",
|
|
1232
|
+
latestVersion: "17",
|
|
1233
|
+
history: {
|
|
1234
|
+
"17": function (z) {
|
|
1235
|
+
return z.object({
|
|
1236
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.STATIC_LIST),
|
|
1237
|
+
options: z.string().default(""),
|
|
1238
|
+
defaultValue: z
|
|
1239
|
+
.union([z.string(), z.array(z.string())])
|
|
1240
|
+
.nullable()
|
|
1241
|
+
.default(null),
|
|
1242
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1243
|
+
});
|
|
1244
|
+
},
|
|
1245
|
+
},
|
|
1246
|
+
});
|
|
1247
|
+
var ParameterFromDynamicListSchema = SchemaRegistry.define({
|
|
1248
|
+
key: "ParameterFromDynamicList",
|
|
1249
|
+
latestVersion: "17",
|
|
1250
|
+
history: {
|
|
1251
|
+
"17": function (z) {
|
|
1252
|
+
return z.object({
|
|
1253
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.DYNAMIC_LIST),
|
|
1254
|
+
options: FormulaSchema.forVersion("17")(z),
|
|
1255
|
+
defaultValue: FormulaSchema.forVersion("17")(z),
|
|
1256
|
+
dbDataType: z.string().optional(),
|
|
1257
|
+
displayOptions: FormulaSchema.forVersion("17")(z),
|
|
1258
|
+
filters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
1259
|
+
filterByRows: z.boolean().default(false),
|
|
1260
|
+
considerFilters: z.boolean().default(false),
|
|
1261
|
+
insertAnyValues: z.boolean().default(false),
|
|
1262
|
+
validation: FormulaSchema.forVersion("17")(z),
|
|
1263
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1264
|
+
});
|
|
1265
|
+
},
|
|
1266
|
+
},
|
|
1267
|
+
});
|
|
1268
|
+
var ParameterFromDataModelSchema = SchemaRegistry.define({
|
|
1269
|
+
key: "ParameterFromDataModel",
|
|
1270
|
+
latestVersion: "17",
|
|
1271
|
+
history: {
|
|
1272
|
+
"17": function (z) {
|
|
1273
|
+
return z.object({
|
|
1274
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.DATA_MODEL),
|
|
1275
|
+
option: z.enum(exports.EDataModelOption).default(exports.EDataModelOption.TABLE_LIST),
|
|
1276
|
+
/**
|
|
1277
|
+
* Используется только при COLUMN_LIST. Не делаем union по option, чтобы сохранить
|
|
1278
|
+
* одновременно default для option и работоспособность внешнего discriminated union.
|
|
1279
|
+
*/
|
|
1280
|
+
parent: NameNullableSchema.forVersion("17")(z),
|
|
1281
|
+
});
|
|
1282
|
+
},
|
|
1283
|
+
},
|
|
1284
|
+
});
|
|
1285
|
+
var ActionOnClickParameterSchema = SchemaRegistry.define({
|
|
1286
|
+
key: "ActionOnClickParameter",
|
|
1287
|
+
latestVersion: "17",
|
|
1288
|
+
history: {
|
|
1289
|
+
"17": function (z) {
|
|
1290
|
+
return z.intersection(ActionOnClickParameterCommonSchema.forVersion("17")(z), z.discriminatedUnion("inputMethod", [
|
|
1291
|
+
ParameterFromColumnSchema.forVersion("17")(z),
|
|
1292
|
+
ParameterFromVariableSchema.forVersion("17")(z),
|
|
1293
|
+
ParameterFromFormulaSchema.forVersion("17")(z),
|
|
1294
|
+
ParameterFromEventSchema.forVersion("17")(z),
|
|
1295
|
+
ParameterFromStartEventSchema.forVersion("17")(z),
|
|
1296
|
+
ParameterFromEndEventSchema.forVersion("17")(z),
|
|
1297
|
+
ParameterFromAggregationSchema.forVersion("17")(z),
|
|
1298
|
+
ParameterFromManualInputSchema.forVersion("17")(z),
|
|
1299
|
+
ParameterFromStaticListSchema.forVersion("17")(z),
|
|
1300
|
+
ParameterFromDynamicListSchema.forVersion("17")(z),
|
|
1301
|
+
ParameterFromDataModelSchema.forVersion("17")(z),
|
|
1302
|
+
]));
|
|
1303
|
+
},
|
|
1304
|
+
},
|
|
1305
|
+
});
|
|
1306
|
+
var ActionCommonSchema = SchemaRegistry.define({
|
|
1307
|
+
key: "ActionCommon",
|
|
1308
|
+
latestVersion: "17",
|
|
1309
|
+
history: {
|
|
1310
|
+
"17": function (z) {
|
|
1311
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1312
|
+
name: z.string(),
|
|
1313
|
+
});
|
|
1314
|
+
},
|
|
1315
|
+
},
|
|
1316
|
+
});
|
|
1317
|
+
var ActionDrillDownSchema = SchemaRegistry.define({
|
|
1318
|
+
key: "ActionDrillDown",
|
|
1319
|
+
latestVersion: "17",
|
|
1320
|
+
history: {
|
|
1321
|
+
"17": function (z) {
|
|
1322
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1323
|
+
type: z.literal(exports.EActionTypes.DRILL_DOWN),
|
|
1324
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1325
|
+
});
|
|
1326
|
+
},
|
|
1327
|
+
},
|
|
1328
|
+
});
|
|
1329
|
+
var ActionGoToURLSchema = SchemaRegistry.define({
|
|
1330
|
+
key: "ActionGoToURL",
|
|
1331
|
+
latestVersion: "17",
|
|
1332
|
+
history: {
|
|
1333
|
+
"17": function (z) {
|
|
1334
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1335
|
+
type: z.literal(exports.EActionTypes.OPEN_URL),
|
|
1336
|
+
url: z.string(),
|
|
1337
|
+
newWindow: z.boolean().default(true),
|
|
1338
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1339
|
+
});
|
|
1340
|
+
},
|
|
1341
|
+
},
|
|
1342
|
+
});
|
|
1343
|
+
var ActivateConditionSchema = SchemaRegistry.define({
|
|
1344
|
+
key: "ActivateCondition",
|
|
1345
|
+
latestVersion: "17",
|
|
1346
|
+
history: {
|
|
1347
|
+
"17": function (z) {
|
|
1348
|
+
return z
|
|
1349
|
+
.discriminatedUnion("mode", [
|
|
1350
|
+
z.object({
|
|
1351
|
+
mode: z.literal(exports.EActivateConditionMode.FORMULA),
|
|
1352
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1353
|
+
}),
|
|
1354
|
+
z.object({
|
|
1355
|
+
mode: z.literal(exports.EActivateConditionMode.VARIABLE),
|
|
1356
|
+
variableName: z.string().nullable().default(null),
|
|
1357
|
+
variableValue: z.string().nullable().default(null),
|
|
1358
|
+
}),
|
|
1359
|
+
])
|
|
1360
|
+
.default({ mode: exports.EActivateConditionMode.FORMULA, formula: "" });
|
|
1361
|
+
},
|
|
1362
|
+
},
|
|
1363
|
+
});
|
|
1364
|
+
var ActionRunScriptSchema = SchemaRegistry.define({
|
|
1365
|
+
key: "ActionRunScript",
|
|
1366
|
+
latestVersion: "17",
|
|
1367
|
+
history: {
|
|
1368
|
+
"17": function (z) {
|
|
1369
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1370
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1371
|
+
parameters: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1372
|
+
scriptKey: z.string(),
|
|
1373
|
+
autoUpdate: z.enum(exports.EAutoUpdateMode).default(exports.EAutoUpdateMode.THIS_WIDGET),
|
|
1374
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1375
|
+
activateCondition: ActivateConditionSchema.forVersion("17")(z),
|
|
1376
|
+
hint: z.string().default(""),
|
|
1377
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1378
|
+
runButtonText: z.string().default(""),
|
|
1379
|
+
});
|
|
1380
|
+
},
|
|
1381
|
+
},
|
|
1382
|
+
});
|
|
1383
|
+
var ActionUpdateVariableSchema = SchemaRegistry.define({
|
|
1384
|
+
key: "ActionUpdateVariable",
|
|
1385
|
+
latestVersion: "17",
|
|
1386
|
+
history: {
|
|
1387
|
+
"17": function (z) {
|
|
1388
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1389
|
+
type: z.literal(exports.EActionTypes.UPDATE_VARIABLE),
|
|
1390
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1391
|
+
});
|
|
1392
|
+
},
|
|
1393
|
+
},
|
|
1394
|
+
});
|
|
1395
|
+
var ActionOpenInSchema = SchemaRegistry.define({
|
|
1396
|
+
key: "ActionOpenIn",
|
|
1397
|
+
latestVersion: "17",
|
|
1398
|
+
history: {
|
|
1399
|
+
"17": function (z) {
|
|
1400
|
+
return z.discriminatedUnion("openIn", [
|
|
1401
|
+
z.object({
|
|
1402
|
+
openIn: z.literal(exports.EViewOpenIn.DRAWER_WINDOW),
|
|
1403
|
+
alignment: z.enum(exports.EDrawerPlacement).default(exports.EDrawerPlacement.RIGHT),
|
|
1404
|
+
inheritFilter: z.boolean().default(true),
|
|
1405
|
+
}),
|
|
1406
|
+
z.object({
|
|
1407
|
+
openIn: z.literal(exports.EViewOpenIn.PLACEHOLDER),
|
|
1408
|
+
placeholderName: z.string().optional(),
|
|
1409
|
+
}),
|
|
1410
|
+
z.object({
|
|
1411
|
+
openIn: z.literal(exports.EViewOpenIn.MODAL_WINDOW),
|
|
1412
|
+
positionByClick: z.boolean().default(false),
|
|
1413
|
+
inheritFilter: z.boolean().default(true),
|
|
1414
|
+
}),
|
|
1415
|
+
z.object({
|
|
1416
|
+
openIn: z.literal(exports.EViewOpenIn.WINDOW),
|
|
1417
|
+
newWindow: z.boolean().default(true),
|
|
1418
|
+
inheritFilter: z.boolean().default(true),
|
|
1419
|
+
}),
|
|
1420
|
+
]);
|
|
1421
|
+
},
|
|
1422
|
+
},
|
|
1423
|
+
});
|
|
1424
|
+
var ActionOpenViewCommonSchema = SchemaRegistry.define({
|
|
1425
|
+
key: "ActionOpenViewCommon",
|
|
1426
|
+
latestVersion: "17",
|
|
1427
|
+
history: {
|
|
1428
|
+
"17": function (z) {
|
|
1429
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1430
|
+
type: z.literal(exports.EActionTypes.OPEN_VIEW),
|
|
1431
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1432
|
+
});
|
|
1433
|
+
},
|
|
1434
|
+
},
|
|
1435
|
+
});
|
|
1436
|
+
var ActionOpenViewSchema = SchemaRegistry.define({
|
|
1437
|
+
key: "ActionOpenView",
|
|
1438
|
+
latestVersion: "17",
|
|
1439
|
+
history: {
|
|
1440
|
+
"17": function (z) {
|
|
1441
|
+
return z.intersection(z.discriminatedUnion("mode", [
|
|
1442
|
+
ActionOpenViewCommonSchema.forVersion("17")(z).extend({
|
|
1443
|
+
mode: z.literal(exports.EViewMode.GENERATED_BY_SCRIPT),
|
|
1444
|
+
scriptKey: z.string().optional(),
|
|
1445
|
+
parameters: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1446
|
+
displayName: z.string().default(""),
|
|
1447
|
+
}),
|
|
1448
|
+
ActionOpenViewCommonSchema.forVersion("17")(z).extend({
|
|
1449
|
+
mode: z.literal(exports.EViewMode.EXISTED_VIEW),
|
|
1450
|
+
viewKey: z.string().optional(),
|
|
1451
|
+
parameters: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1452
|
+
}),
|
|
1453
|
+
ActionOpenViewCommonSchema.forVersion("17")(z).extend({
|
|
1454
|
+
mode: z.literal(exports.EViewMode.EMPTY),
|
|
1455
|
+
placeholderName: z.string().optional(),
|
|
1456
|
+
openIn: z.literal(exports.EViewOpenIn.PLACEHOLDER),
|
|
1457
|
+
}),
|
|
1458
|
+
]), ActionOpenInSchema.forVersion("17")(z));
|
|
1459
|
+
},
|
|
1460
|
+
},
|
|
1461
|
+
});
|
|
1462
|
+
var ActionsOnClickSchema = SchemaRegistry.define({
|
|
1463
|
+
key: "ActionsOnClick",
|
|
1464
|
+
latestVersion: "17",
|
|
1465
|
+
history: {
|
|
1466
|
+
"17": function (z) {
|
|
1467
|
+
return z.union([
|
|
1468
|
+
ActionGoToURLSchema.forVersion("17")(z),
|
|
1469
|
+
ActionRunScriptSchema.forVersion("17")(z),
|
|
1470
|
+
ActionUpdateVariableSchema.forVersion("17")(z),
|
|
1471
|
+
ActionOpenViewSchema.forVersion("17")(z),
|
|
1472
|
+
ActionDrillDownSchema.forVersion("17")(z),
|
|
1473
|
+
]);
|
|
1474
|
+
},
|
|
1475
|
+
},
|
|
1476
|
+
});
|
|
1477
|
+
var WidgetActionParameterCommonSchema = SchemaRegistry.define({
|
|
1478
|
+
key: "WidgetActionParameterCommon",
|
|
1479
|
+
latestVersion: "17",
|
|
1480
|
+
history: {
|
|
1481
|
+
"17": function (z) {
|
|
1482
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1483
|
+
name: z.string(),
|
|
1484
|
+
displayName: z.string().default(""),
|
|
1485
|
+
isHidden: z.boolean().default(false),
|
|
1486
|
+
});
|
|
1487
|
+
},
|
|
1488
|
+
},
|
|
1489
|
+
});
|
|
1490
|
+
var WidgetActionParameterSchema = SchemaRegistry.define({
|
|
1491
|
+
key: "WidgetActionParameter",
|
|
1492
|
+
latestVersion: "17",
|
|
1493
|
+
history: {
|
|
1494
|
+
"17": function (z) {
|
|
1495
|
+
return z.intersection(WidgetActionParameterCommonSchema.forVersion("17")(z), z.discriminatedUnion("inputMethod", [
|
|
1496
|
+
ParameterFromColumnSchema.forVersion("17")(z),
|
|
1497
|
+
ParameterFromVariableSchema.forVersion("17")(z),
|
|
1498
|
+
ParameterFromFormulaSchema.forVersion("17")(z),
|
|
1499
|
+
ParameterFromManualInputSchema.forVersion("17")(z),
|
|
1500
|
+
ParameterFromStaticListSchema.forVersion("17")(z),
|
|
1501
|
+
ParameterFromDynamicListSchema.forVersion("17")(z),
|
|
1502
|
+
ParameterFromAggregationSchema.forVersion("17")(z),
|
|
1503
|
+
ParameterFromDataModelSchema.forVersion("17")(z),
|
|
1504
|
+
]));
|
|
1505
|
+
},
|
|
1506
|
+
},
|
|
1507
|
+
});
|
|
1508
|
+
var WidgetActionSchema = SchemaRegistry.define({
|
|
1509
|
+
key: "WidgetAction",
|
|
1510
|
+
latestVersion: "17",
|
|
1511
|
+
history: {
|
|
1512
|
+
"17": function (z) {
|
|
1513
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1514
|
+
parameters: z.array(WidgetActionParameterSchema.forVersion("17")(z)).default([]),
|
|
1515
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1516
|
+
scriptKey: z.string(),
|
|
1517
|
+
autoUpdate: z.enum(exports.EAutoUpdateMode).default(exports.EAutoUpdateMode.THIS_WIDGET),
|
|
1518
|
+
description: z.string().default(""),
|
|
1519
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1520
|
+
hint: z.string().default(""),
|
|
1521
|
+
activateCondition: ActivateConditionSchema.forVersion("17")(z),
|
|
1522
|
+
variables: z.array(WidgetActionParameterSchema.forVersion("17")(z)).default([]),
|
|
1523
|
+
runButtonText: z.string().default(""),
|
|
1524
|
+
});
|
|
1525
|
+
},
|
|
1526
|
+
},
|
|
1527
|
+
});
|
|
1528
|
+
var ViewActionParameterSchema = SchemaRegistry.define({
|
|
1529
|
+
key: "ViewActionParameter",
|
|
1530
|
+
latestVersion: "17",
|
|
1531
|
+
history: {
|
|
1532
|
+
"17": function (z) {
|
|
1533
|
+
return z.intersection(AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({ name: z.string() }), z.discriminatedUnion("inputMethod", [
|
|
1534
|
+
ParameterFromAggregationSchema.forVersion("17")(z),
|
|
1535
|
+
ParameterFromVariableSchema.forVersion("17")(z),
|
|
1536
|
+
]));
|
|
1537
|
+
},
|
|
1538
|
+
},
|
|
1539
|
+
});
|
|
1540
|
+
var ViewActionSchema = SchemaRegistry.define({
|
|
1541
|
+
key: "ViewAction",
|
|
1542
|
+
latestVersion: "17",
|
|
1543
|
+
history: {
|
|
1544
|
+
"17": function (z) {
|
|
1545
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1546
|
+
name: z.string(),
|
|
1547
|
+
buttonType: z.enum(exports.EActionButtonsTypes).default(exports.EActionButtonsTypes.BASE),
|
|
1548
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT).default(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1549
|
+
parameters: z.array(ViewActionParameterSchema.forVersion("17")(z)).default([]),
|
|
1550
|
+
scriptKey: KeyNullableSchema.forVersion("17")(z),
|
|
1551
|
+
autoUpdate: z
|
|
1552
|
+
.union([z.literal(exports.EAutoUpdateMode.NONE), z.literal(exports.EAutoUpdateMode.ALL_VIEWS)])
|
|
1553
|
+
.default(exports.EAutoUpdateMode.NONE),
|
|
1554
|
+
});
|
|
1555
|
+
},
|
|
1556
|
+
},
|
|
1557
|
+
});
|
|
1558
|
+
var ActionSchema = SchemaRegistry.define({
|
|
1559
|
+
key: "Action",
|
|
1560
|
+
latestVersion: "17",
|
|
1561
|
+
history: {
|
|
1562
|
+
"17": function (z) {
|
|
1563
|
+
return z.union([
|
|
1564
|
+
ActionsOnClickSchema.forVersion("17")(z),
|
|
1565
|
+
WidgetActionSchema.forVersion("17")(z),
|
|
1566
|
+
ViewActionSchema.forVersion("17")(z),
|
|
1567
|
+
]);
|
|
1568
|
+
},
|
|
1569
|
+
},
|
|
1570
|
+
});
|
|
1571
|
+
var ActionButtonSchema = SchemaRegistry.define({
|
|
1572
|
+
key: "ActionButton",
|
|
1573
|
+
latestVersion: "17",
|
|
1574
|
+
history: {
|
|
1575
|
+
"17": function (z) {
|
|
1576
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1577
|
+
name: z.string(),
|
|
1578
|
+
onClick: z.array(WidgetActionSchema.forVersion("17")(z)).default([]),
|
|
1579
|
+
buttonType: z.enum(exports.EActionButtonsTypes).default(exports.EActionButtonsTypes.BASE),
|
|
1580
|
+
backgroundColor: ColorSchema.forVersion("17")(z),
|
|
1581
|
+
borderColor: ColorSchema.forVersion("17")(z),
|
|
1582
|
+
color: ColorSchema.forVersion("17")(z),
|
|
1583
|
+
hint: z.string().default(""),
|
|
1584
|
+
});
|
|
1585
|
+
},
|
|
1586
|
+
},
|
|
1587
|
+
});
|
|
1006
1588
|
|
|
1007
1589
|
exports.ESimpleDataType = void 0;
|
|
1008
1590
|
(function (ESimpleDataType) {
|
|
@@ -1087,25 +1669,6 @@ var isFormulaFilterValue = function (value) {
|
|
|
1087
1669
|
};
|
|
1088
1670
|
var isDimensionProcessFilter = function (filter) { return "value" in filter && "condition" in filter; };
|
|
1089
1671
|
|
|
1090
|
-
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
1091
|
-
var compactMap = function (items, f) {
|
|
1092
|
-
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
1093
|
-
};
|
|
1094
|
-
var isNil = function (value) {
|
|
1095
|
-
return value === null || value === undefined;
|
|
1096
|
-
};
|
|
1097
|
-
function memoize(fn) {
|
|
1098
|
-
var cache = new Map();
|
|
1099
|
-
return function (arg) {
|
|
1100
|
-
if (cache.has(arg)) {
|
|
1101
|
-
return cache.get(arg);
|
|
1102
|
-
}
|
|
1103
|
-
var result = fn(arg);
|
|
1104
|
-
cache.set(arg, result);
|
|
1105
|
-
return result;
|
|
1106
|
-
};
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
1672
|
exports.EClickHouseBaseTypes = void 0;
|
|
1110
1673
|
(function (EClickHouseBaseTypes) {
|
|
1111
1674
|
// DATE
|
|
@@ -2670,21 +3233,27 @@ var getColorByIndex = function (index) {
|
|
|
2670
3233
|
return color;
|
|
2671
3234
|
};
|
|
2672
3235
|
|
|
2673
|
-
var WidgetPresetSettingsSchema =
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
}
|
|
3236
|
+
var WidgetPresetSettingsSchema = SchemaRegistry.define({
|
|
3237
|
+
key: "WidgetPresetSettings",
|
|
3238
|
+
latestVersion: "17",
|
|
3239
|
+
history: {
|
|
3240
|
+
"17": function (z) {
|
|
3241
|
+
return BaseWidgetSettingsSchema.forVersion("17")(z)
|
|
3242
|
+
.pick({
|
|
3243
|
+
filterMode: true,
|
|
3244
|
+
ignoreFilters: true,
|
|
3245
|
+
stateName: true,
|
|
3246
|
+
titleColor: true,
|
|
3247
|
+
titleSize: true,
|
|
3248
|
+
titleWeight: true,
|
|
3249
|
+
paddings: true,
|
|
3250
|
+
})
|
|
3251
|
+
.extend({
|
|
3252
|
+
textSize: z.number().default(12),
|
|
3253
|
+
});
|
|
3254
|
+
},
|
|
3255
|
+
},
|
|
3256
|
+
});
|
|
2688
3257
|
|
|
2689
3258
|
/**
|
|
2690
3259
|
* Привязывает мета-информацию о теме к Zod-схеме
|
|
@@ -2709,80 +3278,152 @@ var themed = function (scheme, selectThemeValue) {
|
|
|
2709
3278
|
return scheme.meta((_a = {}, _a[exports.ESettingsSchemaMetaKey.themeValue] = selectThemeValue, _a));
|
|
2710
3279
|
};
|
|
2711
3280
|
|
|
2712
|
-
var ColorBaseSchema =
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
}
|
|
2723
|
-
};
|
|
2724
|
-
var
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
}
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
}
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
.
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
}
|
|
2771
|
-
};
|
|
2772
|
-
var
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
3281
|
+
var ColorBaseSchema = SchemaRegistry.define({
|
|
3282
|
+
key: "ColorBase",
|
|
3283
|
+
latestVersion: "17",
|
|
3284
|
+
history: {
|
|
3285
|
+
"17": function (z) {
|
|
3286
|
+
return z.object({
|
|
3287
|
+
mode: z.literal(exports.EColorMode.BASE),
|
|
3288
|
+
value: z.string(),
|
|
3289
|
+
});
|
|
3290
|
+
},
|
|
3291
|
+
},
|
|
3292
|
+
});
|
|
3293
|
+
var ColorRuleSchema = SchemaRegistry.define({
|
|
3294
|
+
key: "ColorRule",
|
|
3295
|
+
latestVersion: "17",
|
|
3296
|
+
history: {
|
|
3297
|
+
"17": function (z) {
|
|
3298
|
+
return z.object({
|
|
3299
|
+
mode: z.literal(exports.EColorMode.RULE),
|
|
3300
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
3301
|
+
});
|
|
3302
|
+
},
|
|
3303
|
+
},
|
|
3304
|
+
});
|
|
3305
|
+
var ColorAutoSchema = SchemaRegistry.define({
|
|
3306
|
+
key: "ColorAuto",
|
|
3307
|
+
latestVersion: "17",
|
|
3308
|
+
history: {
|
|
3309
|
+
"17": function (z) {
|
|
3310
|
+
return z.object({
|
|
3311
|
+
mode: z.literal(exports.EColorMode.AUTO),
|
|
3312
|
+
});
|
|
3313
|
+
},
|
|
3314
|
+
},
|
|
3315
|
+
});
|
|
3316
|
+
var ColorDisabledSchema = SchemaRegistry.define({
|
|
3317
|
+
key: "ColorDisabled",
|
|
3318
|
+
latestVersion: "17",
|
|
3319
|
+
history: {
|
|
3320
|
+
"17": function (z) {
|
|
3321
|
+
return z.object({
|
|
3322
|
+
mode: z.literal(exports.EColorMode.DISABLED),
|
|
3323
|
+
});
|
|
3324
|
+
},
|
|
3325
|
+
},
|
|
3326
|
+
});
|
|
3327
|
+
var ColorGradientSchema = SchemaRegistry.define({
|
|
3328
|
+
key: "ColorGradient",
|
|
3329
|
+
latestVersion: "17",
|
|
3330
|
+
history: {
|
|
3331
|
+
"17": function (z) {
|
|
3332
|
+
return z.object({
|
|
3333
|
+
mode: z.literal(exports.EColorMode.GRADIENT),
|
|
3334
|
+
startValue: z.string(),
|
|
3335
|
+
endValue: z.string(),
|
|
3336
|
+
classCount: z.number().min(3).max(10).nullish(),
|
|
3337
|
+
});
|
|
3338
|
+
},
|
|
3339
|
+
},
|
|
3340
|
+
});
|
|
3341
|
+
var ColorFormulaSchema = SchemaRegistry.define({
|
|
3342
|
+
key: "ColorFormula",
|
|
3343
|
+
latestVersion: "17",
|
|
3344
|
+
history: {
|
|
3345
|
+
"17": function (z) {
|
|
3346
|
+
return z.object({
|
|
3347
|
+
mode: z.literal(exports.EColorMode.FORMULA),
|
|
3348
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
3349
|
+
});
|
|
3350
|
+
},
|
|
3351
|
+
},
|
|
3352
|
+
});
|
|
3353
|
+
var ColorValuesSchema = SchemaRegistry.define({
|
|
3354
|
+
key: "ColorValues",
|
|
3355
|
+
latestVersion: "17",
|
|
3356
|
+
history: {
|
|
3357
|
+
"17": function (z) {
|
|
3358
|
+
return z.object({
|
|
3359
|
+
mode: z.literal(exports.EColorMode.VALUES),
|
|
3360
|
+
items: z
|
|
3361
|
+
.array(z.object({
|
|
3362
|
+
value: z.string(),
|
|
3363
|
+
color: z.union([
|
|
3364
|
+
ColorBaseSchema.forVersion("17")(z),
|
|
3365
|
+
ColorRuleSchema.forVersion("17")(z),
|
|
3366
|
+
]),
|
|
3367
|
+
}))
|
|
3368
|
+
.default([]),
|
|
3369
|
+
});
|
|
3370
|
+
},
|
|
3371
|
+
},
|
|
3372
|
+
});
|
|
3373
|
+
var ColorByDimensionSchema = SchemaRegistry.define({
|
|
3374
|
+
key: "ColorByDimension",
|
|
3375
|
+
latestVersion: "17",
|
|
3376
|
+
history: {
|
|
3377
|
+
"17": function (z) {
|
|
3378
|
+
return z.object({
|
|
3379
|
+
mode: z.literal(exports.EColorMode.BY_DIMENSION),
|
|
3380
|
+
/** Имя разреза из области видимости правила отображения */
|
|
3381
|
+
dimensionName: z.string(),
|
|
3382
|
+
items: z
|
|
3383
|
+
.array(z.object({
|
|
3384
|
+
value: z.string(),
|
|
3385
|
+
color: z.union([
|
|
3386
|
+
ColorBaseSchema.forVersion("17")(z),
|
|
3387
|
+
ColorRuleSchema.forVersion("17")(z),
|
|
3388
|
+
]),
|
|
3389
|
+
}))
|
|
3390
|
+
.default([]),
|
|
3391
|
+
});
|
|
3392
|
+
},
|
|
3393
|
+
},
|
|
3394
|
+
});
|
|
3395
|
+
var ColoredValueSchema = SchemaRegistry.define({
|
|
3396
|
+
key: "ColoredValue",
|
|
3397
|
+
latestVersion: "17",
|
|
3398
|
+
history: {
|
|
3399
|
+
"17": function (z) {
|
|
3400
|
+
return z.object({
|
|
3401
|
+
value: z.string(),
|
|
3402
|
+
color: z.union([ColorBaseSchema.forVersion("17")(z), ColorRuleSchema.forVersion("17")(z)]),
|
|
3403
|
+
});
|
|
3404
|
+
},
|
|
3405
|
+
},
|
|
3406
|
+
});
|
|
3407
|
+
var ColorSchema = SchemaRegistry.define({
|
|
3408
|
+
key: "Color",
|
|
3409
|
+
latestVersion: "17",
|
|
3410
|
+
history: {
|
|
3411
|
+
"17": function (z) {
|
|
3412
|
+
return z
|
|
3413
|
+
.discriminatedUnion("mode", [
|
|
3414
|
+
ColorAutoSchema.forVersion("17")(z),
|
|
3415
|
+
ColorDisabledSchema.forVersion("17")(z),
|
|
3416
|
+
ColorBaseSchema.forVersion("17")(z),
|
|
3417
|
+
ColorRuleSchema.forVersion("17")(z),
|
|
3418
|
+
ColorGradientSchema.forVersion("17")(z),
|
|
3419
|
+
ColorFormulaSchema.forVersion("17")(z),
|
|
3420
|
+
ColorValuesSchema.forVersion("17")(z),
|
|
3421
|
+
ColorByDimensionSchema.forVersion("17")(z),
|
|
3422
|
+
])
|
|
3423
|
+
.default({ mode: exports.EColorMode.AUTO });
|
|
3424
|
+
},
|
|
3425
|
+
},
|
|
3426
|
+
});
|
|
2786
3427
|
|
|
2787
3428
|
Object.defineProperty(exports, "ELanguages", {
|
|
2788
3429
|
enumerable: true,
|
|
@@ -2854,9 +3495,11 @@ exports.ParameterFromVariableSchema = ParameterFromVariableSchema;
|
|
|
2854
3495
|
exports.ProcessIndicatorSchema = ProcessIndicatorSchema;
|
|
2855
3496
|
exports.ProcessIndicatorValueSchema = ProcessIndicatorValueSchema;
|
|
2856
3497
|
exports.RangeSchema = RangeSchema;
|
|
3498
|
+
exports.SchemaRegistryReader = SchemaRegistryReader;
|
|
2857
3499
|
exports.SettingsFilterSchema = SettingsFilterSchema;
|
|
2858
3500
|
exports.SortDirectionSchema = SortDirectionSchema;
|
|
2859
3501
|
exports.SortOrderSchema = SortOrderSchema;
|
|
3502
|
+
exports.VersionedSchemaFactory = VersionedSchemaFactory;
|
|
2860
3503
|
exports.ViewActionParameterSchema = ViewActionParameterSchema;
|
|
2861
3504
|
exports.ViewActionSchema = ViewActionSchema;
|
|
2862
3505
|
exports.WidgetActionParameterSchema = WidgetActionParameterSchema;
|