@infomaximum/widget-sdk 6.0.0-view-theme.12 → 6.0.0-view-theme.13
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 +7 -0
- package/dist/index.d.ts +643 -88
- package/dist/index.esm.js +94 -85
- package/dist/index.js +95 -84
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -409,6 +409,84 @@ var formattingConfig = {
|
|
|
409
409
|
},
|
|
410
410
|
};
|
|
411
411
|
|
|
412
|
+
/******************************************************************************
|
|
413
|
+
Copyright (c) Microsoft Corporation.
|
|
414
|
+
|
|
415
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
416
|
+
purpose with or without fee is hereby granted.
|
|
417
|
+
|
|
418
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
419
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
420
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
421
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
422
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
423
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
424
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
425
|
+
***************************************************************************** */
|
|
426
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
var __assign = function() {
|
|
430
|
+
__assign = Object.assign || function __assign(t) {
|
|
431
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
432
|
+
s = arguments[i];
|
|
433
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
434
|
+
}
|
|
435
|
+
return t;
|
|
436
|
+
};
|
|
437
|
+
return __assign.apply(this, arguments);
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
function __rest(s, e) {
|
|
441
|
+
var t = {};
|
|
442
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
443
|
+
t[p] = s[p];
|
|
444
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
445
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
446
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
447
|
+
t[p[i]] = s[p[i]];
|
|
448
|
+
}
|
|
449
|
+
return t;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function __values(o) {
|
|
453
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
454
|
+
if (m) return m.call(o);
|
|
455
|
+
if (o && typeof o.length === "number") return {
|
|
456
|
+
next: function () {
|
|
457
|
+
if (o && i >= o.length) o = void 0;
|
|
458
|
+
return { value: o && o[i++], done: !o };
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function __read(o, n) {
|
|
465
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
466
|
+
if (!m) return o;
|
|
467
|
+
var i = m.call(o), r, ar = [], e;
|
|
468
|
+
try {
|
|
469
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
470
|
+
}
|
|
471
|
+
catch (error) { e = { error: error }; }
|
|
472
|
+
finally {
|
|
473
|
+
try {
|
|
474
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
475
|
+
}
|
|
476
|
+
finally { if (e) throw e.error; }
|
|
477
|
+
}
|
|
478
|
+
return ar;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function __makeTemplateObject(cooked, raw) {
|
|
482
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
483
|
+
return cooked;
|
|
484
|
+
}
|
|
485
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
486
|
+
var e = new Error(message);
|
|
487
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
488
|
+
};
|
|
489
|
+
|
|
412
490
|
var EWidgetIndicatorType;
|
|
413
491
|
(function (EWidgetIndicatorType) {
|
|
414
492
|
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
@@ -454,6 +532,9 @@ var EFormatOrFormattingMode;
|
|
|
454
532
|
EFormatOrFormattingMode["BASE"] = "BASE";
|
|
455
533
|
EFormatOrFormattingMode["TEMPLATE"] = "TEMPLATE";
|
|
456
534
|
})(EFormatOrFormattingMode || (EFormatOrFormattingMode = {}));
|
|
535
|
+
function inheritDisplayConditionFromHierarchy(dimension, hierarchy) {
|
|
536
|
+
return __assign(__assign({}, dimension), { displayCondition: hierarchy.displayCondition });
|
|
537
|
+
}
|
|
457
538
|
/** Тип показателя */
|
|
458
539
|
var EIndicatorType;
|
|
459
540
|
(function (EIndicatorType) {
|
|
@@ -728,6 +809,9 @@ var WidgetDimensionSchema = function (z) {
|
|
|
728
809
|
hideEmptyValues: z.boolean().default(false),
|
|
729
810
|
});
|
|
730
811
|
};
|
|
812
|
+
var WidgetDimensionInHierarchySchema = function (z) {
|
|
813
|
+
return WidgetDimensionSchema(z).omit({ displayCondition: true });
|
|
814
|
+
};
|
|
731
815
|
var WidgetDimensionHierarchySchema = function (z, dimensionSchema) {
|
|
732
816
|
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
733
817
|
name: z.string(),
|
|
@@ -1159,84 +1243,6 @@ var escapeSingularQuotes$1 = function (formula) {
|
|
|
1159
1243
|
return formula.replaceAll("'", "\\'");
|
|
1160
1244
|
};
|
|
1161
1245
|
|
|
1162
|
-
/******************************************************************************
|
|
1163
|
-
Copyright (c) Microsoft Corporation.
|
|
1164
|
-
|
|
1165
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1166
|
-
purpose with or without fee is hereby granted.
|
|
1167
|
-
|
|
1168
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1169
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1170
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1171
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1172
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1173
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1174
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1175
|
-
***************************************************************************** */
|
|
1176
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
var __assign = function() {
|
|
1180
|
-
__assign = Object.assign || function __assign(t) {
|
|
1181
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1182
|
-
s = arguments[i];
|
|
1183
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1184
|
-
}
|
|
1185
|
-
return t;
|
|
1186
|
-
};
|
|
1187
|
-
return __assign.apply(this, arguments);
|
|
1188
|
-
};
|
|
1189
|
-
|
|
1190
|
-
function __rest(s, e) {
|
|
1191
|
-
var t = {};
|
|
1192
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1193
|
-
t[p] = s[p];
|
|
1194
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1195
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1196
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1197
|
-
t[p[i]] = s[p[i]];
|
|
1198
|
-
}
|
|
1199
|
-
return t;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
function __values(o) {
|
|
1203
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
1204
|
-
if (m) return m.call(o);
|
|
1205
|
-
if (o && typeof o.length === "number") return {
|
|
1206
|
-
next: function () {
|
|
1207
|
-
if (o && i >= o.length) o = void 0;
|
|
1208
|
-
return { value: o && o[i++], done: !o };
|
|
1209
|
-
}
|
|
1210
|
-
};
|
|
1211
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
function __read(o, n) {
|
|
1215
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1216
|
-
if (!m) return o;
|
|
1217
|
-
var i = m.call(o), r, ar = [], e;
|
|
1218
|
-
try {
|
|
1219
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
1220
|
-
}
|
|
1221
|
-
catch (error) { e = { error: error }; }
|
|
1222
|
-
finally {
|
|
1223
|
-
try {
|
|
1224
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
1225
|
-
}
|
|
1226
|
-
finally { if (e) throw e.error; }
|
|
1227
|
-
}
|
|
1228
|
-
return ar;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
function __makeTemplateObject(cooked, raw) {
|
|
1232
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
1233
|
-
return cooked;
|
|
1234
|
-
}
|
|
1235
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1236
|
-
var e = new Error(message);
|
|
1237
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
1246
|
var ECalculatorFilterMethods;
|
|
1241
1247
|
(function (ECalculatorFilterMethods) {
|
|
1242
1248
|
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
@@ -2477,8 +2483,8 @@ var ESortDirection;
|
|
|
2477
2483
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с одним значением - выбираем следующий за ним разрез
|
|
2478
2484
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с несколькими значениями - выбираем данный разрез
|
|
2479
2485
|
*/
|
|
2480
|
-
function selectDimensionFromHierarchy(
|
|
2481
|
-
var hierarchyDimensions =
|
|
2486
|
+
function selectDimensionFromHierarchy(hierarchy, filters) {
|
|
2487
|
+
var hierarchyDimensions = hierarchy.hierarchyDimensions; hierarchy.displayCondition;
|
|
2482
2488
|
var _loop_1 = function (i) {
|
|
2483
2489
|
var dimension = hierarchyDimensions[i];
|
|
2484
2490
|
// todo: widgets - возможно, стоит использовать Map фильтров для быстрого поиска
|
|
@@ -2491,14 +2497,18 @@ function selectDimensionFromHierarchy(_a, filters) {
|
|
|
2491
2497
|
return "continue";
|
|
2492
2498
|
}
|
|
2493
2499
|
var selectionIndex = matchedFilter.values.length > 1 ? i : Math.min(i + 1, hierarchyDimensions.length - 1);
|
|
2494
|
-
|
|
2500
|
+
var dimensionFromHierarchy_1 = hierarchyDimensions[selectionIndex];
|
|
2501
|
+
return { value: (dimensionFromHierarchy_1 &&
|
|
2502
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy_1, hierarchy)) };
|
|
2495
2503
|
};
|
|
2496
2504
|
for (var i = hierarchyDimensions.length - 1; i >= 0; i--) {
|
|
2497
2505
|
var state_1 = _loop_1(i);
|
|
2498
2506
|
if (typeof state_1 === "object")
|
|
2499
2507
|
return state_1.value;
|
|
2500
2508
|
}
|
|
2501
|
-
|
|
2509
|
+
var dimensionFromHierarchy = hierarchyDimensions[0];
|
|
2510
|
+
return (dimensionFromHierarchy &&
|
|
2511
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy, hierarchy));
|
|
2502
2512
|
}
|
|
2503
2513
|
|
|
2504
2514
|
var getDefaultSortOrders = function (_a) {
|
|
@@ -2607,8 +2617,7 @@ function prepareSortOrders(_a) {
|
|
|
2607
2617
|
var replaceHierarchiesWithDimensions = function (dimensions, filters) {
|
|
2608
2618
|
return compactMap(dimensions, function (indicator) {
|
|
2609
2619
|
if (isDimensionsHierarchy(indicator)) {
|
|
2610
|
-
|
|
2611
|
-
return (selectedDimension && replaceDisplayCondition(selectedDimension, indicator.displayCondition));
|
|
2620
|
+
return selectDimensionFromHierarchy(indicator, filters);
|
|
2612
2621
|
}
|
|
2613
2622
|
return indicator;
|
|
2614
2623
|
});
|
|
@@ -2982,4 +2991,4 @@ var ColorSchema = function (z) {
|
|
|
2982
2991
|
.default({ mode: EColorMode.AUTO });
|
|
2983
2992
|
};
|
|
2984
2993
|
|
|
2985
|
-
export { ActionButtonSchema, ActionGoToURLSchema, ActionOnClickParameterSchema, ActionOpenInSchema, ActionOpenViewSchema, ActionRunScriptSchema, ActionSchema, ActionUpdateVariableSchema, ActionsOnClickSchema, AutoIdentifiedArrayItemSchema, BaseWidgetSettingsSchema, ColorAutoSchema, ColorBaseSchema, ColorByDimensionSchema, ColorDisabledSchema, ColorFormulaSchema, ColorGradientSchema, ColorRuleSchema, ColorSchema, ColorValuesSchema, ColoredValueSchema, ColumnIndicatorValueSchema, DimensionProcessFilterSchema, DimensionValueSchema, DisplayConditionSchema, EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EHeightMode, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureInnerTemplateNames, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, ExtendedFormulaFilterValueSchema, FormatSchema, FormattingSchema, FormulaFilterValueSchema, FormulaNullableSchema, FormulaSchema, KeyNullableSchema, MarkdownMeasureSchema, MeasureValueSchema, NameNullableSchema, OuterAggregation, ParameterFromAggregationSchema, ParameterFromColumnSchema, ParameterFromDataModelSchema, ParameterFromDynamicListSchema, ParameterFromEndEventSchema, ParameterFromEventSchema, ParameterFromFormulaSchema, ParameterFromManualInputSchema, ParameterFromStartEventSchema, ParameterFromStaticListSchema, ParameterFromVariableSchema, ProcessIndicatorSchema, ProcessIndicatorValueSchema, RangeSchema, SettingsFilterSchema, SortDirectionSchema, SortOrderSchema, ViewActionParameterSchema, ViewActionSchema, WidgetActionParameterSchema, WidgetActionSchema, WidgetColumnIndicatorSchema, WidgetDimensionHierarchySchema, WidgetDimensionSchema, WidgetIndicatorAggregationValueSchema, WidgetIndicatorConversionValueSchema, WidgetIndicatorDurationValueSchema, WidgetIndicatorFormulaValueSchema, WidgetIndicatorSchema, WidgetIndicatorTemplateValueSchema, WidgetIndicatorTimeValueSchema, WidgetMeasureAggregationValueSchema, WidgetMeasureSchema, WidgetPresetSettingsSchema, WidgetSortingIndicatorSchema, WidgetSortingValueSchema, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureInnerTemplateFormulas, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, themeValueMetaKey, themed, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
|
2994
|
+
export { ActionButtonSchema, ActionGoToURLSchema, ActionOnClickParameterSchema, ActionOpenInSchema, ActionOpenViewSchema, ActionRunScriptSchema, ActionSchema, ActionUpdateVariableSchema, ActionsOnClickSchema, AutoIdentifiedArrayItemSchema, BaseWidgetSettingsSchema, ColorAutoSchema, ColorBaseSchema, ColorByDimensionSchema, ColorDisabledSchema, ColorFormulaSchema, ColorGradientSchema, ColorRuleSchema, ColorSchema, ColorValuesSchema, ColoredValueSchema, ColumnIndicatorValueSchema, DimensionProcessFilterSchema, DimensionValueSchema, DisplayConditionSchema, EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EHeightMode, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureInnerTemplateNames, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, ExtendedFormulaFilterValueSchema, FormatSchema, FormattingSchema, FormulaFilterValueSchema, FormulaNullableSchema, FormulaSchema, KeyNullableSchema, MarkdownMeasureSchema, MeasureValueSchema, NameNullableSchema, OuterAggregation, ParameterFromAggregationSchema, ParameterFromColumnSchema, ParameterFromDataModelSchema, ParameterFromDynamicListSchema, ParameterFromEndEventSchema, ParameterFromEventSchema, ParameterFromFormulaSchema, ParameterFromManualInputSchema, ParameterFromStartEventSchema, ParameterFromStaticListSchema, ParameterFromVariableSchema, ProcessIndicatorSchema, ProcessIndicatorValueSchema, RangeSchema, SettingsFilterSchema, SortDirectionSchema, SortOrderSchema, ViewActionParameterSchema, ViewActionSchema, WidgetActionParameterSchema, WidgetActionSchema, WidgetColumnIndicatorSchema, WidgetDimensionHierarchySchema, WidgetDimensionInHierarchySchema, WidgetDimensionSchema, WidgetIndicatorAggregationValueSchema, WidgetIndicatorConversionValueSchema, WidgetIndicatorDurationValueSchema, WidgetIndicatorFormulaValueSchema, WidgetIndicatorSchema, WidgetIndicatorTemplateValueSchema, WidgetIndicatorTimeValueSchema, WidgetMeasureAggregationValueSchema, WidgetMeasureSchema, WidgetPresetSettingsSchema, WidgetSortingIndicatorSchema, WidgetSortingValueSchema, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, inheritDisplayConditionFromHierarchy, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureInnerTemplateFormulas, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, themeValueMetaKey, themed, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.js
CHANGED
|
@@ -410,6 +410,84 @@ var formattingConfig = {
|
|
|
410
410
|
},
|
|
411
411
|
};
|
|
412
412
|
|
|
413
|
+
/******************************************************************************
|
|
414
|
+
Copyright (c) Microsoft Corporation.
|
|
415
|
+
|
|
416
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
417
|
+
purpose with or without fee is hereby granted.
|
|
418
|
+
|
|
419
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
420
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
421
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
422
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
423
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
424
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
425
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
426
|
+
***************************************************************************** */
|
|
427
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
var __assign = function() {
|
|
431
|
+
__assign = Object.assign || function __assign(t) {
|
|
432
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
433
|
+
s = arguments[i];
|
|
434
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
435
|
+
}
|
|
436
|
+
return t;
|
|
437
|
+
};
|
|
438
|
+
return __assign.apply(this, arguments);
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
function __rest(s, e) {
|
|
442
|
+
var t = {};
|
|
443
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
444
|
+
t[p] = s[p];
|
|
445
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
446
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
447
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
448
|
+
t[p[i]] = s[p[i]];
|
|
449
|
+
}
|
|
450
|
+
return t;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function __values(o) {
|
|
454
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
455
|
+
if (m) return m.call(o);
|
|
456
|
+
if (o && typeof o.length === "number") return {
|
|
457
|
+
next: function () {
|
|
458
|
+
if (o && i >= o.length) o = void 0;
|
|
459
|
+
return { value: o && o[i++], done: !o };
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function __read(o, n) {
|
|
466
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
467
|
+
if (!m) return o;
|
|
468
|
+
var i = m.call(o), r, ar = [], e;
|
|
469
|
+
try {
|
|
470
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
471
|
+
}
|
|
472
|
+
catch (error) { e = { error: error }; }
|
|
473
|
+
finally {
|
|
474
|
+
try {
|
|
475
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
476
|
+
}
|
|
477
|
+
finally { if (e) throw e.error; }
|
|
478
|
+
}
|
|
479
|
+
return ar;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function __makeTemplateObject(cooked, raw) {
|
|
483
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
484
|
+
return cooked;
|
|
485
|
+
}
|
|
486
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
487
|
+
var e = new Error(message);
|
|
488
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
489
|
+
};
|
|
490
|
+
|
|
413
491
|
exports.EWidgetIndicatorType = void 0;
|
|
414
492
|
(function (EWidgetIndicatorType) {
|
|
415
493
|
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
@@ -455,6 +533,9 @@ exports.EFormatOrFormattingMode = void 0;
|
|
|
455
533
|
EFormatOrFormattingMode["BASE"] = "BASE";
|
|
456
534
|
EFormatOrFormattingMode["TEMPLATE"] = "TEMPLATE";
|
|
457
535
|
})(exports.EFormatOrFormattingMode || (exports.EFormatOrFormattingMode = {}));
|
|
536
|
+
function inheritDisplayConditionFromHierarchy(dimension, hierarchy) {
|
|
537
|
+
return __assign(__assign({}, dimension), { displayCondition: hierarchy.displayCondition });
|
|
538
|
+
}
|
|
458
539
|
/** Тип показателя */
|
|
459
540
|
exports.EIndicatorType = void 0;
|
|
460
541
|
(function (EIndicatorType) {
|
|
@@ -729,6 +810,9 @@ var WidgetDimensionSchema = function (z) {
|
|
|
729
810
|
hideEmptyValues: z.boolean().default(false),
|
|
730
811
|
});
|
|
731
812
|
};
|
|
813
|
+
var WidgetDimensionInHierarchySchema = function (z) {
|
|
814
|
+
return WidgetDimensionSchema(z).omit({ displayCondition: true });
|
|
815
|
+
};
|
|
732
816
|
var WidgetDimensionHierarchySchema = function (z, dimensionSchema) {
|
|
733
817
|
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
734
818
|
name: z.string(),
|
|
@@ -1160,84 +1244,6 @@ var escapeSingularQuotes$1 = function (formula) {
|
|
|
1160
1244
|
return formula.replaceAll("'", "\\'");
|
|
1161
1245
|
};
|
|
1162
1246
|
|
|
1163
|
-
/******************************************************************************
|
|
1164
|
-
Copyright (c) Microsoft Corporation.
|
|
1165
|
-
|
|
1166
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1167
|
-
purpose with or without fee is hereby granted.
|
|
1168
|
-
|
|
1169
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1170
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1171
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1172
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1173
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1174
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1175
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1176
|
-
***************************************************************************** */
|
|
1177
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
var __assign = function() {
|
|
1181
|
-
__assign = Object.assign || function __assign(t) {
|
|
1182
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1183
|
-
s = arguments[i];
|
|
1184
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1185
|
-
}
|
|
1186
|
-
return t;
|
|
1187
|
-
};
|
|
1188
|
-
return __assign.apply(this, arguments);
|
|
1189
|
-
};
|
|
1190
|
-
|
|
1191
|
-
function __rest(s, e) {
|
|
1192
|
-
var t = {};
|
|
1193
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1194
|
-
t[p] = s[p];
|
|
1195
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1196
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1197
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1198
|
-
t[p[i]] = s[p[i]];
|
|
1199
|
-
}
|
|
1200
|
-
return t;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
function __values(o) {
|
|
1204
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
1205
|
-
if (m) return m.call(o);
|
|
1206
|
-
if (o && typeof o.length === "number") return {
|
|
1207
|
-
next: function () {
|
|
1208
|
-
if (o && i >= o.length) o = void 0;
|
|
1209
|
-
return { value: o && o[i++], done: !o };
|
|
1210
|
-
}
|
|
1211
|
-
};
|
|
1212
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
function __read(o, n) {
|
|
1216
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1217
|
-
if (!m) return o;
|
|
1218
|
-
var i = m.call(o), r, ar = [], e;
|
|
1219
|
-
try {
|
|
1220
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
1221
|
-
}
|
|
1222
|
-
catch (error) { e = { error: error }; }
|
|
1223
|
-
finally {
|
|
1224
|
-
try {
|
|
1225
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
1226
|
-
}
|
|
1227
|
-
finally { if (e) throw e.error; }
|
|
1228
|
-
}
|
|
1229
|
-
return ar;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
function __makeTemplateObject(cooked, raw) {
|
|
1233
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
1234
|
-
return cooked;
|
|
1235
|
-
}
|
|
1236
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1237
|
-
var e = new Error(message);
|
|
1238
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1239
|
-
};
|
|
1240
|
-
|
|
1241
1247
|
exports.ECalculatorFilterMethods = void 0;
|
|
1242
1248
|
(function (ECalculatorFilterMethods) {
|
|
1243
1249
|
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
@@ -2478,8 +2484,8 @@ exports.ESortDirection = void 0;
|
|
|
2478
2484
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с одним значением - выбираем следующий за ним разрез
|
|
2479
2485
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с несколькими значениями - выбираем данный разрез
|
|
2480
2486
|
*/
|
|
2481
|
-
function selectDimensionFromHierarchy(
|
|
2482
|
-
var hierarchyDimensions =
|
|
2487
|
+
function selectDimensionFromHierarchy(hierarchy, filters) {
|
|
2488
|
+
var hierarchyDimensions = hierarchy.hierarchyDimensions; hierarchy.displayCondition;
|
|
2483
2489
|
var _loop_1 = function (i) {
|
|
2484
2490
|
var dimension = hierarchyDimensions[i];
|
|
2485
2491
|
// todo: widgets - возможно, стоит использовать Map фильтров для быстрого поиска
|
|
@@ -2492,14 +2498,18 @@ function selectDimensionFromHierarchy(_a, filters) {
|
|
|
2492
2498
|
return "continue";
|
|
2493
2499
|
}
|
|
2494
2500
|
var selectionIndex = matchedFilter.values.length > 1 ? i : Math.min(i + 1, hierarchyDimensions.length - 1);
|
|
2495
|
-
|
|
2501
|
+
var dimensionFromHierarchy_1 = hierarchyDimensions[selectionIndex];
|
|
2502
|
+
return { value: (dimensionFromHierarchy_1 &&
|
|
2503
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy_1, hierarchy)) };
|
|
2496
2504
|
};
|
|
2497
2505
|
for (var i = hierarchyDimensions.length - 1; i >= 0; i--) {
|
|
2498
2506
|
var state_1 = _loop_1(i);
|
|
2499
2507
|
if (typeof state_1 === "object")
|
|
2500
2508
|
return state_1.value;
|
|
2501
2509
|
}
|
|
2502
|
-
|
|
2510
|
+
var dimensionFromHierarchy = hierarchyDimensions[0];
|
|
2511
|
+
return (dimensionFromHierarchy &&
|
|
2512
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy, hierarchy));
|
|
2503
2513
|
}
|
|
2504
2514
|
|
|
2505
2515
|
var getDefaultSortOrders = function (_a) {
|
|
@@ -2608,8 +2618,7 @@ function prepareSortOrders(_a) {
|
|
|
2608
2618
|
var replaceHierarchiesWithDimensions = function (dimensions, filters) {
|
|
2609
2619
|
return compactMap(dimensions, function (indicator) {
|
|
2610
2620
|
if (isDimensionsHierarchy(indicator)) {
|
|
2611
|
-
|
|
2612
|
-
return (selectedDimension && replaceDisplayCondition(selectedDimension, indicator.displayCondition));
|
|
2621
|
+
return selectDimensionFromHierarchy(indicator, filters);
|
|
2613
2622
|
}
|
|
2614
2623
|
return indicator;
|
|
2615
2624
|
});
|
|
@@ -3049,6 +3058,7 @@ exports.WidgetActionParameterSchema = WidgetActionParameterSchema;
|
|
|
3049
3058
|
exports.WidgetActionSchema = WidgetActionSchema;
|
|
3050
3059
|
exports.WidgetColumnIndicatorSchema = WidgetColumnIndicatorSchema;
|
|
3051
3060
|
exports.WidgetDimensionHierarchySchema = WidgetDimensionHierarchySchema;
|
|
3061
|
+
exports.WidgetDimensionInHierarchySchema = WidgetDimensionInHierarchySchema;
|
|
3052
3062
|
exports.WidgetDimensionSchema = WidgetDimensionSchema;
|
|
3053
3063
|
exports.WidgetIndicatorAggregationValueSchema = WidgetIndicatorAggregationValueSchema;
|
|
3054
3064
|
exports.WidgetIndicatorConversionValueSchema = WidgetIndicatorConversionValueSchema;
|
|
@@ -3100,6 +3110,7 @@ exports.getMeasureFormula = getMeasureFormula;
|
|
|
3100
3110
|
exports.getProcessDimensionValueFormula = getProcessDimensionValueFormula;
|
|
3101
3111
|
exports.getRuleColor = getRuleColor;
|
|
3102
3112
|
exports.getTransitionMeasureFormula = getTransitionMeasureFormula;
|
|
3113
|
+
exports.inheritDisplayConditionFromHierarchy = inheritDisplayConditionFromHierarchy;
|
|
3103
3114
|
exports.isDimensionProcessFilter = isDimensionProcessFilter;
|
|
3104
3115
|
exports.isDimensionsHierarchy = isDimensionsHierarchy;
|
|
3105
3116
|
exports.isFormulaFilterValue = isFormulaFilterValue;
|