@infomaximum/widget-sdk 5.33.0 → 6.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +26 -25
- package/dist/index.esm.js +114 -82
- package/dist/index.js +114 -82
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [6.0.0-0](https://github.com/Infomaximum/widget-sdk/compare/v5.33.1...v6.0.0-0) (2025-08-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* получение ф-ии шаблона процессной агрегации для меры через константу "measureAggregationTemplates" заменено на получение через ф-ию "createAggregationFormulaByTemplateName"
|
|
11
|
+
* поле actions удалено из настроек виджетов
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* отказ от поля actions в пользу actionButtons в настройках виджетов ([2ee361a](https://github.com/Infomaximum/widget-sdk/commit/2ee361a5ab1478e1b0ad90feae2256cf90d46058))
|
|
16
|
+
* расширен IInputControl полями hint и hintPlacement. Для запуска скрипта из действий по клику добавлена подсказка ([63d02d6](https://github.com/Infomaximum/widget-sdk/commit/63d02d68bc38bb6d6b1bb2dfd1898d4b948ee6fc))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* From BI-15231 into master (#92) ([8257237](https://github.com/Infomaximum/widget-sdk/commit/8257237e12b42ee403378408d0bb5007853c379d)), closes [#92](https://github.com/Infomaximum/widget-sdk/issues/92)
|
|
20
|
+
|
|
21
|
+
### [5.33.1](https://github.com/Infomaximum/widget-sdk/compare/v5.33.0...v5.33.1) (2025-08-15)
|
|
22
|
+
|
|
5
23
|
## [5.33.0](https://github.com/Infomaximum/widget-sdk/compare/v5.32.1...v5.33.0) (2025-08-06)
|
|
6
24
|
|
|
7
25
|
|
package/dist/index.d.ts
CHANGED
|
@@ -736,8 +736,9 @@ type TWidgetIndicatorAggregationValue = {
|
|
|
736
736
|
templateName: string;
|
|
737
737
|
processKey: string | null;
|
|
738
738
|
eventName: string | null;
|
|
739
|
-
caseCaseIdFormula: string | null;
|
|
740
739
|
eventNameFormula: string | null;
|
|
740
|
+
anyEvent?: true;
|
|
741
|
+
caseCaseIdFormula: string | null;
|
|
741
742
|
filters: TExtendedFormulaFilterValue[];
|
|
742
743
|
tableName?: string;
|
|
743
744
|
columnName?: string;
|
|
@@ -930,7 +931,7 @@ interface IBaseWidgetSettings {
|
|
|
930
931
|
filterMode?: EWidgetFilterMode;
|
|
931
932
|
ignoreFilters?: boolean;
|
|
932
933
|
sorting?: IWidgetSortingIndicator[];
|
|
933
|
-
|
|
934
|
+
actionButtons?: IActionButton[];
|
|
934
935
|
paddings?: number | string;
|
|
935
936
|
}
|
|
936
937
|
|
|
@@ -1084,6 +1085,7 @@ interface IActionRunScript extends IActionCommon {
|
|
|
1084
1085
|
variableName: string;
|
|
1085
1086
|
variableValue: string;
|
|
1086
1087
|
};
|
|
1088
|
+
hint?: string;
|
|
1087
1089
|
}
|
|
1088
1090
|
interface IActionUpdateVariable extends IActionCommon {
|
|
1089
1091
|
type: EActionTypes.UPDATE_VARIABLE;
|
|
@@ -1138,6 +1140,8 @@ interface IWidgetAction extends IActionCommon {
|
|
|
1138
1140
|
scriptKey: string;
|
|
1139
1141
|
autoUpdate: EAutoUpdateMode;
|
|
1140
1142
|
description: string;
|
|
1143
|
+
hideInactiveButton?: boolean;
|
|
1144
|
+
hint?: string;
|
|
1141
1145
|
activateCondition: {
|
|
1142
1146
|
mode: EActivateConditionMode.FORMULA;
|
|
1143
1147
|
formula: string;
|
|
@@ -1146,10 +1150,15 @@ interface IWidgetAction extends IActionCommon {
|
|
|
1146
1150
|
variableName: string;
|
|
1147
1151
|
variableValue: string;
|
|
1148
1152
|
};
|
|
1153
|
+
}
|
|
1154
|
+
interface IActionButton extends IAutoIdentifiedArrayItem {
|
|
1155
|
+
name: string;
|
|
1156
|
+
onClick: IWidgetAction[];
|
|
1149
1157
|
buttonType: EActionButtonsTypes;
|
|
1150
1158
|
backgroundColor?: TColor;
|
|
1151
1159
|
borderColor?: TColor;
|
|
1152
1160
|
color: TColor;
|
|
1161
|
+
hint?: string;
|
|
1153
1162
|
}
|
|
1154
1163
|
type TViewActionParameter = (IParameterFromAggregation | IParameterFromVariable) & {
|
|
1155
1164
|
name: string;
|
|
@@ -1213,18 +1222,18 @@ declare const dimensionTemplateFormulas: Record<EDimensionTemplateNames, string>
|
|
|
1213
1222
|
declare function getDimensionFormula({ value }: IWidgetDimension): string;
|
|
1214
1223
|
|
|
1215
1224
|
declare enum EDimensionAggregationTemplateName {
|
|
1216
|
-
top = "top",
|
|
1217
|
-
firstValue = "firstValue",
|
|
1218
|
-
lastValue = "lastValue",
|
|
1219
|
-
countExecutions = "countExecutions",
|
|
1220
|
-
countReworks = "countReworks",
|
|
1221
1225
|
avg = "avg",
|
|
1222
1226
|
median = "median",
|
|
1223
1227
|
count = "count",
|
|
1224
1228
|
countDistinct = "countDistinct",
|
|
1225
1229
|
min = "min",
|
|
1226
1230
|
max = "max",
|
|
1227
|
-
sum = "sum"
|
|
1231
|
+
sum = "sum",
|
|
1232
|
+
top = "top",
|
|
1233
|
+
firstValue = "firstValue",
|
|
1234
|
+
lastValue = "lastValue",
|
|
1235
|
+
countExecutions = "countExecutions",
|
|
1236
|
+
countReworks = "countReworks"
|
|
1228
1237
|
}
|
|
1229
1238
|
/** Шаблоны процессных метрик разреза с режимом AGGREGATION */
|
|
1230
1239
|
declare const dimensionAggregationTemplates: Record<EDimensionAggregationTemplateName, string>;
|
|
@@ -1291,21 +1300,6 @@ declare enum EMeasureAggregationTemplateName {
|
|
|
1291
1300
|
countExecutions = "countExecutions",
|
|
1292
1301
|
countReworks = "countReworks"
|
|
1293
1302
|
}
|
|
1294
|
-
/** Шаблоны процессных метрик меры с режимом AGGREGATION */
|
|
1295
|
-
declare const measureAggregationTemplates: {
|
|
1296
|
-
agvIf: string;
|
|
1297
|
-
medianIf: string;
|
|
1298
|
-
countIf: string;
|
|
1299
|
-
countIfDistinct: string;
|
|
1300
|
-
minIf: string;
|
|
1301
|
-
maxIf: string;
|
|
1302
|
-
sumIf: string;
|
|
1303
|
-
top: (outerAggregation: EOuterAggregation) => string;
|
|
1304
|
-
firstValue: (outerAggregation: EOuterAggregation) => string;
|
|
1305
|
-
lastValue: (outerAggregation: EOuterAggregation) => string;
|
|
1306
|
-
countExecutions: string;
|
|
1307
|
-
countReworks: string;
|
|
1308
|
-
};
|
|
1309
1303
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
1310
1304
|
declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["value"], {
|
|
1311
1305
|
mode: EWidgetIndicatorValueModes.AGGREGATION;
|
|
@@ -1313,7 +1307,7 @@ declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["v
|
|
|
1313
1307
|
outerAggregation: EOuterAggregation;
|
|
1314
1308
|
eventNameFormula: string;
|
|
1315
1309
|
caseCaseIdFormula: string;
|
|
1316
|
-
eventName: string;
|
|
1310
|
+
eventName: string | null;
|
|
1317
1311
|
objectFilters: string;
|
|
1318
1312
|
filters: string;
|
|
1319
1313
|
eventTimeFormula: string;
|
|
@@ -1336,6 +1330,10 @@ declare const prepareConversionParams: (value: TWidgetIndicatorConversionValue)
|
|
|
1336
1330
|
endEventFilters: string;
|
|
1337
1331
|
} | null;
|
|
1338
1332
|
|
|
1333
|
+
declare function createAggregationTemplate(templateName: EMeasureAggregationTemplateName, { outerAggregation, anyEvent, }: Pick<TWidgetIndicatorAggregationValue, "anyEvent"> & {
|
|
1334
|
+
outerAggregation: EOuterAggregation;
|
|
1335
|
+
}): string;
|
|
1336
|
+
|
|
1339
1337
|
/** Шаблоны процессных метрик меры с режимом DURATION */
|
|
1340
1338
|
declare const durationTemplates: Record<EDurationTemplateName, string>;
|
|
1341
1339
|
/** На основе значения режима DURATION подготовить параметры для подстановки в шаблонную формулу */
|
|
@@ -1403,6 +1401,7 @@ interface IIndicatorLink {
|
|
|
1403
1401
|
}
|
|
1404
1402
|
declare const parseIndicatorLink: (formula: string) => IIndicatorLink | null;
|
|
1405
1403
|
|
|
1404
|
+
type THintPlacement = "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
1406
1405
|
declare enum EControlType {
|
|
1407
1406
|
/** Ввод текста */
|
|
1408
1407
|
input = "input",
|
|
@@ -1557,6 +1556,8 @@ interface IInputControl {
|
|
|
1557
1556
|
/** Использовать ли уменьшенный размер заголовка */
|
|
1558
1557
|
isSmallTitle?: boolean;
|
|
1559
1558
|
disabled?: boolean;
|
|
1559
|
+
hintText?: string;
|
|
1560
|
+
hintPlacement?: THintPlacement;
|
|
1560
1561
|
};
|
|
1561
1562
|
}
|
|
1562
1563
|
interface IInputMarkdownControl {
|
|
@@ -2749,4 +2750,4 @@ declare global {
|
|
|
2749
2750
|
}
|
|
2750
2751
|
}
|
|
2751
2752
|
|
|
2752
|
-
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, type IActionOnClickControl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IAutoIdentifiedArrayItem, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type ICalculatorOptions, type ICollapseRecord, type IColorPickerControl, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayConditionControl, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IEventsColorControl, type IEventsPickerControl, type IExportColumnOrder, type IFillSettings, type IFilterControl, type IFormattingControl, type IFormattingTemplateControl, type IFormulaControl, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type IInputControl, type IInputMarkdownControl, type IInputNumberControl, type IInputRangeControl, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IParameterColumnList, type IParameterFromAggregation, type IParameterFromColumn, type IParameterFromDynamicList, type IParameterFromEndEvent, type IParameterFromEvent, type IParameterFromFormula, type IParameterFromManualInput, type IParameterFromStartEvent, type IParameterFromStaticList, type IParameterFromVariable, type IParameterTableList, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessFilterPreviewParams, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRadioIconGroupControl, type IRange, type ISelectBranchOption, type ISelectControl, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISizeControl, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type IStaticListLabeledOption, type ISwitchControl, type ITagSetControl, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type ITypedFormulaControl, type IVertex, type IViewAction, type IViewContext, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetColumnListVariable, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetDynamicListVariable, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetMigrator, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetPresetSettings, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStaticListVariable, type IWidgetStaticVariable, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, OuterAggregation, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TBoundedContentWithIndicator, type TColor, type TColorBase, type TColorRule, type TColumnIndicatorValue, type TContextMenu, type TContextMenuButton, type TContextMenuButtonActions, type TContextMenuButtonApply, type TContextMenuButtonClose, type TContextMenuButtonCustom, type TContextMenuButtonGroup, type TContextMenuButtonOptions, type TContextMenuList, type TContextMenuPositionUnit, type TContextMenuRow, type TControlUnion, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationAccessibility, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TParameterFromDataModel, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TVersion, type TViewActionParameter, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorAggregationValue, type TWidgetIndicatorConversionValue, type TWidgetIndicatorDurationValue, type TWidgetIndicatorTimeValue, type TWidgetLevelRecord, type TWidgetMeasureData, type TWidgetSortingValue, type TWidgetVariable, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, durationTemplates, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs,
|
|
2753
|
+
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionButton, type IActionGoToUrl, type IActionOnClickControl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IAutoIdentifiedArrayItem, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type ICalculatorOptions, type ICollapseRecord, type IColorPickerControl, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayConditionControl, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IEventsColorControl, type IEventsPickerControl, type IExportColumnOrder, type IFillSettings, type IFilterControl, type IFormattingControl, type IFormattingTemplateControl, type IFormulaControl, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type IInputControl, type IInputMarkdownControl, type IInputNumberControl, type IInputRangeControl, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IParameterColumnList, type IParameterFromAggregation, type IParameterFromColumn, type IParameterFromDynamicList, type IParameterFromEndEvent, type IParameterFromEvent, type IParameterFromFormula, type IParameterFromManualInput, type IParameterFromStartEvent, type IParameterFromStaticList, type IParameterFromVariable, type IParameterTableList, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessFilterPreviewParams, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRadioIconGroupControl, type IRange, type ISelectBranchOption, type ISelectControl, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISizeControl, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type IStaticListLabeledOption, type ISwitchControl, type ITagSetControl, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type ITypedFormulaControl, type IVertex, type IViewAction, type IViewContext, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetColumnListVariable, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetDynamicListVariable, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetMigrator, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetPresetSettings, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStaticListVariable, type IWidgetStaticVariable, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, OuterAggregation, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TBoundedContentWithIndicator, type TColor, type TColorBase, type TColorRule, type TColumnIndicatorValue, type TContextMenu, type TContextMenuButton, type TContextMenuButtonActions, type TContextMenuButtonApply, type TContextMenuButtonClose, type TContextMenuButtonCustom, type TContextMenuButtonGroup, type TContextMenuButtonOptions, type TContextMenuList, type TContextMenuPositionUnit, type TContextMenuRow, type TControlUnion, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationAccessibility, type TGroupLevelRecord, type THintPlacement, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TParameterFromDataModel, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TVersion, type TViewActionParameter, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorAggregationValue, type TWidgetIndicatorConversionValue, type TWidgetIndicatorDurationValue, type TWidgetIndicatorTimeValue, type TWidgetLevelRecord, type TWidgetMeasureData, type TWidgetSortingValue, type TWidgetVariable, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createAggregationTemplate as createMeasureAggregationTemplate, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, durationTemplates, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.esm.js
CHANGED
|
@@ -612,7 +612,7 @@ var formattingConfig = {
|
|
|
612
612
|
},
|
|
613
613
|
};
|
|
614
614
|
|
|
615
|
-
var _a$
|
|
615
|
+
var _a$4;
|
|
616
616
|
var EDimensionTemplateNames;
|
|
617
617
|
(function (EDimensionTemplateNames) {
|
|
618
618
|
EDimensionTemplateNames["dateTime"] = "dateTime";
|
|
@@ -628,19 +628,19 @@ var EDimensionTemplateNames;
|
|
|
628
628
|
EDimensionTemplateNames["hour"] = "hour";
|
|
629
629
|
})(EDimensionTemplateNames || (EDimensionTemplateNames = {}));
|
|
630
630
|
/** Стандартные шаблоны разреза */
|
|
631
|
-
var dimensionTemplateFormulas = (_a$
|
|
632
|
-
_a$
|
|
633
|
-
_a$
|
|
634
|
-
_a$
|
|
635
|
-
_a$
|
|
636
|
-
_a$
|
|
637
|
-
_a$
|
|
638
|
-
_a$
|
|
639
|
-
_a$
|
|
640
|
-
_a$
|
|
641
|
-
_a$
|
|
642
|
-
_a$
|
|
643
|
-
_a$
|
|
631
|
+
var dimensionTemplateFormulas = (_a$4 = {},
|
|
632
|
+
_a$4[EDimensionTemplateNames.dateTime] = "toDateTime({columnFormula})",
|
|
633
|
+
_a$4[EDimensionTemplateNames.date] = "toDate({columnFormula})",
|
|
634
|
+
_a$4[EDimensionTemplateNames.year] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYear({columnFormula}))",
|
|
635
|
+
_a$4[EDimensionTemplateNames.yearAndQuarter] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYear({columnFormula}) * 10 + toQuarter({columnFormula}))",
|
|
636
|
+
_a$4[EDimensionTemplateNames.quarter] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toQuarter({columnFormula}))",
|
|
637
|
+
_a$4[EDimensionTemplateNames.yearAndMonth] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYYYYMM({columnFormula}))",
|
|
638
|
+
_a$4[EDimensionTemplateNames.month] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toMonth({columnFormula}))",
|
|
639
|
+
_a$4[EDimensionTemplateNames.dayOfMonth] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toDayOfMonth({columnFormula}))",
|
|
640
|
+
_a$4[EDimensionTemplateNames.week] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toWeek({columnFormula}))",
|
|
641
|
+
_a$4[EDimensionTemplateNames.dayOfWeek] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toDayOfWeek({columnFormula}))",
|
|
642
|
+
_a$4[EDimensionTemplateNames.hour] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toHour({columnFormula}))",
|
|
643
|
+
_a$4);
|
|
644
644
|
|
|
645
645
|
var EWidgetIndicatorType;
|
|
646
646
|
(function (EWidgetIndicatorType) {
|
|
@@ -744,7 +744,7 @@ var EEventAppearances;
|
|
|
744
744
|
EEventAppearances["LAST"] = "LAST";
|
|
745
745
|
})(EEventAppearances || (EEventAppearances = {}));
|
|
746
746
|
|
|
747
|
-
function
|
|
747
|
+
function createAggregationTemplate$1(functionName, options) {
|
|
748
748
|
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})");
|
|
749
749
|
}
|
|
750
750
|
|
|
@@ -753,13 +753,13 @@ var countExecutionsTemplate = "process(countIf({eventNameFormula} in '{eventName
|
|
|
753
753
|
var lastValueTemplate = "process(argMaxIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
754
754
|
var firstValueTemplate = "process(argMinIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
755
755
|
var topTemplate = "process(topKIf(1)({columnFormula}, {eventNameFormula} = '{eventName}'{filters})[1], {caseCaseIdFormula})";
|
|
756
|
-
var avgTemplate =
|
|
757
|
-
var medianTemplate =
|
|
758
|
-
var countTemplate =
|
|
759
|
-
var countDistinctTemplate =
|
|
760
|
-
var minTemplate =
|
|
761
|
-
var maxTemplate =
|
|
762
|
-
var sumTemplate =
|
|
756
|
+
var avgTemplate = createAggregationTemplate$1("avgIf");
|
|
757
|
+
var medianTemplate = createAggregationTemplate$1("medianIf");
|
|
758
|
+
var countTemplate = createAggregationTemplate$1("countIf");
|
|
759
|
+
var countDistinctTemplate = createAggregationTemplate$1("countIf", { distinct: true });
|
|
760
|
+
var minTemplate = createAggregationTemplate$1("minIf");
|
|
761
|
+
var maxTemplate = createAggregationTemplate$1("maxIf");
|
|
762
|
+
var sumTemplate = createAggregationTemplate$1("sumIf");
|
|
763
763
|
|
|
764
764
|
function fillTemplateString(templateString, params) {
|
|
765
765
|
return templateString.replace(/\{(.*?)\}/g, function (_, key) { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ""; });
|
|
@@ -871,14 +871,9 @@ var convertFiltersToFormula = function (filters) {
|
|
|
871
871
|
return filters.length > 0 ? " AND ".concat(convertToFormulasChain(filters)) : "";
|
|
872
872
|
};
|
|
873
873
|
|
|
874
|
-
var _a$
|
|
874
|
+
var _a$3;
|
|
875
875
|
var EDimensionAggregationTemplateName;
|
|
876
876
|
(function (EDimensionAggregationTemplateName) {
|
|
877
|
-
EDimensionAggregationTemplateName["top"] = "top";
|
|
878
|
-
EDimensionAggregationTemplateName["firstValue"] = "firstValue";
|
|
879
|
-
EDimensionAggregationTemplateName["lastValue"] = "lastValue";
|
|
880
|
-
EDimensionAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
881
|
-
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
882
877
|
EDimensionAggregationTemplateName["avg"] = "avg";
|
|
883
878
|
EDimensionAggregationTemplateName["median"] = "median";
|
|
884
879
|
EDimensionAggregationTemplateName["count"] = "count";
|
|
@@ -886,22 +881,27 @@ var EDimensionAggregationTemplateName;
|
|
|
886
881
|
EDimensionAggregationTemplateName["min"] = "min";
|
|
887
882
|
EDimensionAggregationTemplateName["max"] = "max";
|
|
888
883
|
EDimensionAggregationTemplateName["sum"] = "sum";
|
|
884
|
+
EDimensionAggregationTemplateName["top"] = "top";
|
|
885
|
+
EDimensionAggregationTemplateName["firstValue"] = "firstValue";
|
|
886
|
+
EDimensionAggregationTemplateName["lastValue"] = "lastValue";
|
|
887
|
+
EDimensionAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
888
|
+
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
889
889
|
})(EDimensionAggregationTemplateName || (EDimensionAggregationTemplateName = {}));
|
|
890
890
|
/** Шаблоны процессных метрик разреза с режимом AGGREGATION */
|
|
891
|
-
var dimensionAggregationTemplates = (_a$
|
|
892
|
-
_a$
|
|
893
|
-
_a$
|
|
894
|
-
_a$
|
|
895
|
-
_a$
|
|
896
|
-
_a$
|
|
897
|
-
_a$
|
|
898
|
-
_a$
|
|
899
|
-
_a$
|
|
900
|
-
_a$
|
|
901
|
-
_a$
|
|
902
|
-
_a$
|
|
903
|
-
_a$
|
|
904
|
-
_a$
|
|
891
|
+
var dimensionAggregationTemplates = (_a$3 = {},
|
|
892
|
+
_a$3[EDimensionAggregationTemplateName.avg] = avgTemplate,
|
|
893
|
+
_a$3[EDimensionAggregationTemplateName.median] = medianTemplate,
|
|
894
|
+
_a$3[EDimensionAggregationTemplateName.count] = countTemplate,
|
|
895
|
+
_a$3[EDimensionAggregationTemplateName.countDistinct] = countDistinctTemplate,
|
|
896
|
+
_a$3[EDimensionAggregationTemplateName.min] = minTemplate,
|
|
897
|
+
_a$3[EDimensionAggregationTemplateName.max] = maxTemplate,
|
|
898
|
+
_a$3[EDimensionAggregationTemplateName.sum] = sumTemplate,
|
|
899
|
+
_a$3[EDimensionAggregationTemplateName.top] = topTemplate,
|
|
900
|
+
_a$3[EDimensionAggregationTemplateName.firstValue] = firstValueTemplate,
|
|
901
|
+
_a$3[EDimensionAggregationTemplateName.lastValue] = lastValueTemplate,
|
|
902
|
+
_a$3[EDimensionAggregationTemplateName.countExecutions] = countExecutionsTemplate,
|
|
903
|
+
_a$3[EDimensionAggregationTemplateName.countReworks] = countReworksTemplate,
|
|
904
|
+
_a$3);
|
|
905
905
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
906
906
|
var prepareDimensionAggregationParams = function (value) {
|
|
907
907
|
if (!value.eventName ||
|
|
@@ -1017,7 +1017,6 @@ function getDimensionFormula(_a) {
|
|
|
1017
1017
|
return "";
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
|
-
var _a$3;
|
|
1021
1020
|
var EMeasureAggregationTemplateName;
|
|
1022
1021
|
(function (EMeasureAggregationTemplateName) {
|
|
1023
1022
|
EMeasureAggregationTemplateName["agvIf"] = "agvIf";
|
|
@@ -1033,35 +1032,9 @@ var EMeasureAggregationTemplateName;
|
|
|
1033
1032
|
EMeasureAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
1034
1033
|
EMeasureAggregationTemplateName["countReworks"] = "countReworks";
|
|
1035
1034
|
})(EMeasureAggregationTemplateName || (EMeasureAggregationTemplateName = {}));
|
|
1036
|
-
function createAggregationTemplate(fn, additionalFn) {
|
|
1037
|
-
return "{outerAggregation}If(process(".concat(fn, "(").concat(additionalFn ? additionalFn + " " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula}), {objectFilters})");
|
|
1038
|
-
}
|
|
1039
|
-
/** Шаблоны процессных метрик меры с режимом AGGREGATION */
|
|
1040
|
-
var measureAggregationTemplates = (_a$3 = {},
|
|
1041
|
-
_a$3[EMeasureAggregationTemplateName.agvIf] = createAggregationTemplate("avgIf"),
|
|
1042
|
-
_a$3[EMeasureAggregationTemplateName.medianIf] = createAggregationTemplate("medianIf"),
|
|
1043
|
-
_a$3[EMeasureAggregationTemplateName.countIf] = createAggregationTemplate("countIf"),
|
|
1044
|
-
_a$3[EMeasureAggregationTemplateName.countIfDistinct] = createAggregationTemplate("countIf", "distinct"),
|
|
1045
|
-
_a$3[EMeasureAggregationTemplateName.minIf] = createAggregationTemplate("minIf"),
|
|
1046
|
-
_a$3[EMeasureAggregationTemplateName.maxIf] = createAggregationTemplate("maxIf"),
|
|
1047
|
-
_a$3[EMeasureAggregationTemplateName.sumIf] = createAggregationTemplate("sumIf"),
|
|
1048
|
-
_a$3[EMeasureAggregationTemplateName.top] = createTopLikeTemplate(topTemplate),
|
|
1049
|
-
_a$3[EMeasureAggregationTemplateName.firstValue] = createTopLikeTemplate(firstValueTemplate),
|
|
1050
|
-
_a$3[EMeasureAggregationTemplateName.lastValue] = createTopLikeTemplate(lastValueTemplate),
|
|
1051
|
-
_a$3[EMeasureAggregationTemplateName.countExecutions] = "{outerAggregation}If(".concat(countExecutionsTemplate, ",{objectFilters})"),
|
|
1052
|
-
_a$3[EMeasureAggregationTemplateName.countReworks] = "{outerAggregation}If(".concat(countReworksTemplate, ",{objectFilters})"),
|
|
1053
|
-
_a$3);
|
|
1054
|
-
/** Вспомогательная функция для шаблонов top/firstValue/lastValue */
|
|
1055
|
-
function createTopLikeTemplate(template) {
|
|
1056
|
-
return function (outerAggregation) {
|
|
1057
|
-
return outerAggregation === EOuterAggregation.top
|
|
1058
|
-
? "{outerAggregation}KIf(1)(".concat(template, ", {objectFilters})[1]")
|
|
1059
|
-
: "{outerAggregation}If(".concat(template, ", {objectFilters})");
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
1035
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
1063
1036
|
var prepareMeasureAggregationParams = function (value) {
|
|
1064
|
-
if (!value.eventName ||
|
|
1037
|
+
if ((!value.anyEvent && !value.eventName) ||
|
|
1065
1038
|
!value.caseCaseIdFormula ||
|
|
1066
1039
|
!value.eventNameFormula ||
|
|
1067
1040
|
!value.outerAggregation ||
|
|
@@ -1187,6 +1160,69 @@ var prepareDurationParams = function (value) {
|
|
|
1187
1160
|
};
|
|
1188
1161
|
};
|
|
1189
1162
|
|
|
1163
|
+
function createAnyEventTemplate(aggregatePart) {
|
|
1164
|
+
return "{outerAggregation}If(process(".concat(aggregatePart, ", {caseCaseIdFormula}), {objectFilters})");
|
|
1165
|
+
}
|
|
1166
|
+
function createSpecificEventTemplate(fn, additionalFn) {
|
|
1167
|
+
return "{outerAggregation}If(process(".concat(fn, "(").concat(additionalFn ? "".concat(additionalFn, " ") : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula}), {objectFilters})");
|
|
1168
|
+
}
|
|
1169
|
+
function createTopLikeTemplate(template) {
|
|
1170
|
+
return function (outerAggregation) {
|
|
1171
|
+
return outerAggregation === EOuterAggregation.top
|
|
1172
|
+
? "{outerAggregation}KIf(1)(".concat(template, ", {objectFilters})[1]")
|
|
1173
|
+
: "{outerAggregation}If(".concat(template, ", {objectFilters})");
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
function createAggregationTemplate(templateName, _a) {
|
|
1177
|
+
var outerAggregation = _a.outerAggregation, anyEvent = _a.anyEvent;
|
|
1178
|
+
switch (templateName) {
|
|
1179
|
+
case EMeasureAggregationTemplateName.agvIf:
|
|
1180
|
+
return anyEvent
|
|
1181
|
+
? createAnyEventTemplate("avg({columnFormula})")
|
|
1182
|
+
: createSpecificEventTemplate("avgIf");
|
|
1183
|
+
case EMeasureAggregationTemplateName.medianIf:
|
|
1184
|
+
return anyEvent
|
|
1185
|
+
? createAnyEventTemplate("median({columnFormula})")
|
|
1186
|
+
: createSpecificEventTemplate("medianIf");
|
|
1187
|
+
case EMeasureAggregationTemplateName.countIf:
|
|
1188
|
+
return anyEvent
|
|
1189
|
+
? createAnyEventTemplate("count({columnFormula})")
|
|
1190
|
+
: createSpecificEventTemplate("countIf");
|
|
1191
|
+
case EMeasureAggregationTemplateName.countIfDistinct:
|
|
1192
|
+
return anyEvent
|
|
1193
|
+
? createAnyEventTemplate("count(distinct {columnFormula})")
|
|
1194
|
+
: createSpecificEventTemplate("countIf", "distinct");
|
|
1195
|
+
case EMeasureAggregationTemplateName.minIf:
|
|
1196
|
+
return anyEvent
|
|
1197
|
+
? createAnyEventTemplate("min({columnFormula})")
|
|
1198
|
+
: createSpecificEventTemplate("minIf");
|
|
1199
|
+
case EMeasureAggregationTemplateName.maxIf:
|
|
1200
|
+
return anyEvent
|
|
1201
|
+
? createAnyEventTemplate("max({columnFormula})")
|
|
1202
|
+
: createSpecificEventTemplate("maxIf");
|
|
1203
|
+
case EMeasureAggregationTemplateName.sumIf:
|
|
1204
|
+
return anyEvent
|
|
1205
|
+
? createAnyEventTemplate("sum({columnFormula})")
|
|
1206
|
+
: createSpecificEventTemplate("sumIf");
|
|
1207
|
+
case EMeasureAggregationTemplateName.top:
|
|
1208
|
+
return anyEvent
|
|
1209
|
+
? createAnyEventTemplate("topK(1)({columnFormula})[1]")
|
|
1210
|
+
: createTopLikeTemplate(topTemplate)(outerAggregation);
|
|
1211
|
+
case EMeasureAggregationTemplateName.firstValue:
|
|
1212
|
+
return anyEvent
|
|
1213
|
+
? createAnyEventTemplate("argMin({columnFormula}, {eventTimeFormula})")
|
|
1214
|
+
: createTopLikeTemplate(firstValueTemplate)(outerAggregation);
|
|
1215
|
+
case EMeasureAggregationTemplateName.lastValue:
|
|
1216
|
+
return anyEvent
|
|
1217
|
+
? createAnyEventTemplate("argMax({columnFormula}, {eventTimeFormula})")
|
|
1218
|
+
: createTopLikeTemplate(lastValueTemplate)(outerAggregation);
|
|
1219
|
+
case EMeasureAggregationTemplateName.countExecutions:
|
|
1220
|
+
return "{outerAggregation}If(".concat(countExecutionsTemplate, ", {objectFilters})");
|
|
1221
|
+
case EMeasureAggregationTemplateName.countReworks:
|
|
1222
|
+
return "{outerAggregation}If(".concat(countReworksTemplate, ", {objectFilters})");
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1190
1226
|
function getMeasureFormula(_a) {
|
|
1191
1227
|
var _b;
|
|
1192
1228
|
var value = _a.value;
|
|
@@ -1207,17 +1243,13 @@ function getMeasureFormula(_a) {
|
|
|
1207
1243
|
});
|
|
1208
1244
|
}
|
|
1209
1245
|
if (value.mode === EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1210
|
-
var
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
? templateFormula(preparedParams_1.outerAggregation)
|
|
1218
|
-
: templateFormula;
|
|
1219
|
-
};
|
|
1220
|
-
return fillTemplateString(getTemplateFormula(), preparedParams_1);
|
|
1246
|
+
var preparedParams = prepareMeasureAggregationParams(value);
|
|
1247
|
+
return preparedParams
|
|
1248
|
+
? fillTemplateString(createAggregationTemplate(value.templateName, {
|
|
1249
|
+
outerAggregation: preparedParams.outerAggregation,
|
|
1250
|
+
anyEvent: value.anyEvent,
|
|
1251
|
+
}), preparedParams)
|
|
1252
|
+
: "";
|
|
1221
1253
|
}
|
|
1222
1254
|
if (value.mode === EWidgetIndicatorValueModes.CONVERSION) {
|
|
1223
1255
|
var preparedParams = prepareConversionParams(value);
|
|
@@ -2050,4 +2082,4 @@ var getColorByIndex = function (index) {
|
|
|
2050
2082
|
return color;
|
|
2051
2083
|
};
|
|
2052
2084
|
|
|
2053
|
-
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, OuterAggregation, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, durationTemplates, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs,
|
|
2085
|
+
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, OuterAggregation, applyIndexToArrayFormula, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createAggregationTemplate as createMeasureAggregationTemplate, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, durationTemplates, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.js
CHANGED
|
@@ -613,7 +613,7 @@ var formattingConfig = {
|
|
|
613
613
|
},
|
|
614
614
|
};
|
|
615
615
|
|
|
616
|
-
var _a$
|
|
616
|
+
var _a$4;
|
|
617
617
|
exports.EDimensionTemplateNames = void 0;
|
|
618
618
|
(function (EDimensionTemplateNames) {
|
|
619
619
|
EDimensionTemplateNames["dateTime"] = "dateTime";
|
|
@@ -629,19 +629,19 @@ exports.EDimensionTemplateNames = void 0;
|
|
|
629
629
|
EDimensionTemplateNames["hour"] = "hour";
|
|
630
630
|
})(exports.EDimensionTemplateNames || (exports.EDimensionTemplateNames = {}));
|
|
631
631
|
/** Стандартные шаблоны разреза */
|
|
632
|
-
var dimensionTemplateFormulas = (_a$
|
|
633
|
-
_a$
|
|
634
|
-
_a$
|
|
635
|
-
_a$
|
|
636
|
-
_a$
|
|
637
|
-
_a$
|
|
638
|
-
_a$
|
|
639
|
-
_a$
|
|
640
|
-
_a$
|
|
641
|
-
_a$
|
|
642
|
-
_a$
|
|
643
|
-
_a$
|
|
644
|
-
_a$
|
|
632
|
+
var dimensionTemplateFormulas = (_a$4 = {},
|
|
633
|
+
_a$4[exports.EDimensionTemplateNames.dateTime] = "toDateTime({columnFormula})",
|
|
634
|
+
_a$4[exports.EDimensionTemplateNames.date] = "toDate({columnFormula})",
|
|
635
|
+
_a$4[exports.EDimensionTemplateNames.year] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYear({columnFormula}))",
|
|
636
|
+
_a$4[exports.EDimensionTemplateNames.yearAndQuarter] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYear({columnFormula}) * 10 + toQuarter({columnFormula}))",
|
|
637
|
+
_a$4[exports.EDimensionTemplateNames.quarter] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toQuarter({columnFormula}))",
|
|
638
|
+
_a$4[exports.EDimensionTemplateNames.yearAndMonth] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYYYYMM({columnFormula}))",
|
|
639
|
+
_a$4[exports.EDimensionTemplateNames.month] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toMonth({columnFormula}))",
|
|
640
|
+
_a$4[exports.EDimensionTemplateNames.dayOfMonth] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toDayOfMonth({columnFormula}))",
|
|
641
|
+
_a$4[exports.EDimensionTemplateNames.week] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toWeek({columnFormula}))",
|
|
642
|
+
_a$4[exports.EDimensionTemplateNames.dayOfWeek] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toDayOfWeek({columnFormula}))",
|
|
643
|
+
_a$4[exports.EDimensionTemplateNames.hour] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toHour({columnFormula}))",
|
|
644
|
+
_a$4);
|
|
645
645
|
|
|
646
646
|
exports.EWidgetIndicatorType = void 0;
|
|
647
647
|
(function (EWidgetIndicatorType) {
|
|
@@ -745,7 +745,7 @@ exports.EEventAppearances = void 0;
|
|
|
745
745
|
EEventAppearances["LAST"] = "LAST";
|
|
746
746
|
})(exports.EEventAppearances || (exports.EEventAppearances = {}));
|
|
747
747
|
|
|
748
|
-
function
|
|
748
|
+
function createAggregationTemplate$1(functionName, options) {
|
|
749
749
|
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})");
|
|
750
750
|
}
|
|
751
751
|
|
|
@@ -754,13 +754,13 @@ var countExecutionsTemplate = "process(countIf({eventNameFormula} in '{eventName
|
|
|
754
754
|
var lastValueTemplate = "process(argMaxIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
755
755
|
var firstValueTemplate = "process(argMinIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
756
756
|
var topTemplate = "process(topKIf(1)({columnFormula}, {eventNameFormula} = '{eventName}'{filters})[1], {caseCaseIdFormula})";
|
|
757
|
-
var avgTemplate =
|
|
758
|
-
var medianTemplate =
|
|
759
|
-
var countTemplate =
|
|
760
|
-
var countDistinctTemplate =
|
|
761
|
-
var minTemplate =
|
|
762
|
-
var maxTemplate =
|
|
763
|
-
var sumTemplate =
|
|
757
|
+
var avgTemplate = createAggregationTemplate$1("avgIf");
|
|
758
|
+
var medianTemplate = createAggregationTemplate$1("medianIf");
|
|
759
|
+
var countTemplate = createAggregationTemplate$1("countIf");
|
|
760
|
+
var countDistinctTemplate = createAggregationTemplate$1("countIf", { distinct: true });
|
|
761
|
+
var minTemplate = createAggregationTemplate$1("minIf");
|
|
762
|
+
var maxTemplate = createAggregationTemplate$1("maxIf");
|
|
763
|
+
var sumTemplate = createAggregationTemplate$1("sumIf");
|
|
764
764
|
|
|
765
765
|
function fillTemplateString(templateString, params) {
|
|
766
766
|
return templateString.replace(/\{(.*?)\}/g, function (_, key) { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ""; });
|
|
@@ -872,14 +872,9 @@ var convertFiltersToFormula = function (filters) {
|
|
|
872
872
|
return filters.length > 0 ? " AND ".concat(convertToFormulasChain(filters)) : "";
|
|
873
873
|
};
|
|
874
874
|
|
|
875
|
-
var _a$
|
|
875
|
+
var _a$3;
|
|
876
876
|
exports.EDimensionAggregationTemplateName = void 0;
|
|
877
877
|
(function (EDimensionAggregationTemplateName) {
|
|
878
|
-
EDimensionAggregationTemplateName["top"] = "top";
|
|
879
|
-
EDimensionAggregationTemplateName["firstValue"] = "firstValue";
|
|
880
|
-
EDimensionAggregationTemplateName["lastValue"] = "lastValue";
|
|
881
|
-
EDimensionAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
882
|
-
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
883
878
|
EDimensionAggregationTemplateName["avg"] = "avg";
|
|
884
879
|
EDimensionAggregationTemplateName["median"] = "median";
|
|
885
880
|
EDimensionAggregationTemplateName["count"] = "count";
|
|
@@ -887,22 +882,27 @@ exports.EDimensionAggregationTemplateName = void 0;
|
|
|
887
882
|
EDimensionAggregationTemplateName["min"] = "min";
|
|
888
883
|
EDimensionAggregationTemplateName["max"] = "max";
|
|
889
884
|
EDimensionAggregationTemplateName["sum"] = "sum";
|
|
885
|
+
EDimensionAggregationTemplateName["top"] = "top";
|
|
886
|
+
EDimensionAggregationTemplateName["firstValue"] = "firstValue";
|
|
887
|
+
EDimensionAggregationTemplateName["lastValue"] = "lastValue";
|
|
888
|
+
EDimensionAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
889
|
+
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
890
890
|
})(exports.EDimensionAggregationTemplateName || (exports.EDimensionAggregationTemplateName = {}));
|
|
891
891
|
/** Шаблоны процессных метрик разреза с режимом AGGREGATION */
|
|
892
|
-
var dimensionAggregationTemplates = (_a$
|
|
893
|
-
_a$
|
|
894
|
-
_a$
|
|
895
|
-
_a$
|
|
896
|
-
_a$
|
|
897
|
-
_a$
|
|
898
|
-
_a$
|
|
899
|
-
_a$
|
|
900
|
-
_a$
|
|
901
|
-
_a$
|
|
902
|
-
_a$
|
|
903
|
-
_a$
|
|
904
|
-
_a$
|
|
905
|
-
_a$
|
|
892
|
+
var dimensionAggregationTemplates = (_a$3 = {},
|
|
893
|
+
_a$3[exports.EDimensionAggregationTemplateName.avg] = avgTemplate,
|
|
894
|
+
_a$3[exports.EDimensionAggregationTemplateName.median] = medianTemplate,
|
|
895
|
+
_a$3[exports.EDimensionAggregationTemplateName.count] = countTemplate,
|
|
896
|
+
_a$3[exports.EDimensionAggregationTemplateName.countDistinct] = countDistinctTemplate,
|
|
897
|
+
_a$3[exports.EDimensionAggregationTemplateName.min] = minTemplate,
|
|
898
|
+
_a$3[exports.EDimensionAggregationTemplateName.max] = maxTemplate,
|
|
899
|
+
_a$3[exports.EDimensionAggregationTemplateName.sum] = sumTemplate,
|
|
900
|
+
_a$3[exports.EDimensionAggregationTemplateName.top] = topTemplate,
|
|
901
|
+
_a$3[exports.EDimensionAggregationTemplateName.firstValue] = firstValueTemplate,
|
|
902
|
+
_a$3[exports.EDimensionAggregationTemplateName.lastValue] = lastValueTemplate,
|
|
903
|
+
_a$3[exports.EDimensionAggregationTemplateName.countExecutions] = countExecutionsTemplate,
|
|
904
|
+
_a$3[exports.EDimensionAggregationTemplateName.countReworks] = countReworksTemplate,
|
|
905
|
+
_a$3);
|
|
906
906
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
907
907
|
var prepareDimensionAggregationParams = function (value) {
|
|
908
908
|
if (!value.eventName ||
|
|
@@ -1018,7 +1018,6 @@ function getDimensionFormula(_a) {
|
|
|
1018
1018
|
return "";
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
|
-
var _a$3;
|
|
1022
1021
|
exports.EMeasureAggregationTemplateName = void 0;
|
|
1023
1022
|
(function (EMeasureAggregationTemplateName) {
|
|
1024
1023
|
EMeasureAggregationTemplateName["agvIf"] = "agvIf";
|
|
@@ -1034,35 +1033,9 @@ exports.EMeasureAggregationTemplateName = void 0;
|
|
|
1034
1033
|
EMeasureAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
1035
1034
|
EMeasureAggregationTemplateName["countReworks"] = "countReworks";
|
|
1036
1035
|
})(exports.EMeasureAggregationTemplateName || (exports.EMeasureAggregationTemplateName = {}));
|
|
1037
|
-
function createAggregationTemplate(fn, additionalFn) {
|
|
1038
|
-
return "{outerAggregation}If(process(".concat(fn, "(").concat(additionalFn ? additionalFn + " " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula}), {objectFilters})");
|
|
1039
|
-
}
|
|
1040
|
-
/** Шаблоны процессных метрик меры с режимом AGGREGATION */
|
|
1041
|
-
var measureAggregationTemplates = (_a$3 = {},
|
|
1042
|
-
_a$3[exports.EMeasureAggregationTemplateName.agvIf] = createAggregationTemplate("avgIf"),
|
|
1043
|
-
_a$3[exports.EMeasureAggregationTemplateName.medianIf] = createAggregationTemplate("medianIf"),
|
|
1044
|
-
_a$3[exports.EMeasureAggregationTemplateName.countIf] = createAggregationTemplate("countIf"),
|
|
1045
|
-
_a$3[exports.EMeasureAggregationTemplateName.countIfDistinct] = createAggregationTemplate("countIf", "distinct"),
|
|
1046
|
-
_a$3[exports.EMeasureAggregationTemplateName.minIf] = createAggregationTemplate("minIf"),
|
|
1047
|
-
_a$3[exports.EMeasureAggregationTemplateName.maxIf] = createAggregationTemplate("maxIf"),
|
|
1048
|
-
_a$3[exports.EMeasureAggregationTemplateName.sumIf] = createAggregationTemplate("sumIf"),
|
|
1049
|
-
_a$3[exports.EMeasureAggregationTemplateName.top] = createTopLikeTemplate(topTemplate),
|
|
1050
|
-
_a$3[exports.EMeasureAggregationTemplateName.firstValue] = createTopLikeTemplate(firstValueTemplate),
|
|
1051
|
-
_a$3[exports.EMeasureAggregationTemplateName.lastValue] = createTopLikeTemplate(lastValueTemplate),
|
|
1052
|
-
_a$3[exports.EMeasureAggregationTemplateName.countExecutions] = "{outerAggregation}If(".concat(countExecutionsTemplate, ",{objectFilters})"),
|
|
1053
|
-
_a$3[exports.EMeasureAggregationTemplateName.countReworks] = "{outerAggregation}If(".concat(countReworksTemplate, ",{objectFilters})"),
|
|
1054
|
-
_a$3);
|
|
1055
|
-
/** Вспомогательная функция для шаблонов top/firstValue/lastValue */
|
|
1056
|
-
function createTopLikeTemplate(template) {
|
|
1057
|
-
return function (outerAggregation) {
|
|
1058
|
-
return outerAggregation === exports.EOuterAggregation.top
|
|
1059
|
-
? "{outerAggregation}KIf(1)(".concat(template, ", {objectFilters})[1]")
|
|
1060
|
-
: "{outerAggregation}If(".concat(template, ", {objectFilters})");
|
|
1061
|
-
};
|
|
1062
|
-
}
|
|
1063
1036
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
1064
1037
|
var prepareMeasureAggregationParams = function (value) {
|
|
1065
|
-
if (!value.eventName ||
|
|
1038
|
+
if ((!value.anyEvent && !value.eventName) ||
|
|
1066
1039
|
!value.caseCaseIdFormula ||
|
|
1067
1040
|
!value.eventNameFormula ||
|
|
1068
1041
|
!value.outerAggregation ||
|
|
@@ -1188,6 +1161,69 @@ var prepareDurationParams = function (value) {
|
|
|
1188
1161
|
};
|
|
1189
1162
|
};
|
|
1190
1163
|
|
|
1164
|
+
function createAnyEventTemplate(aggregatePart) {
|
|
1165
|
+
return "{outerAggregation}If(process(".concat(aggregatePart, ", {caseCaseIdFormula}), {objectFilters})");
|
|
1166
|
+
}
|
|
1167
|
+
function createSpecificEventTemplate(fn, additionalFn) {
|
|
1168
|
+
return "{outerAggregation}If(process(".concat(fn, "(").concat(additionalFn ? "".concat(additionalFn, " ") : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula}), {objectFilters})");
|
|
1169
|
+
}
|
|
1170
|
+
function createTopLikeTemplate(template) {
|
|
1171
|
+
return function (outerAggregation) {
|
|
1172
|
+
return outerAggregation === exports.EOuterAggregation.top
|
|
1173
|
+
? "{outerAggregation}KIf(1)(".concat(template, ", {objectFilters})[1]")
|
|
1174
|
+
: "{outerAggregation}If(".concat(template, ", {objectFilters})");
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
function createAggregationTemplate(templateName, _a) {
|
|
1178
|
+
var outerAggregation = _a.outerAggregation, anyEvent = _a.anyEvent;
|
|
1179
|
+
switch (templateName) {
|
|
1180
|
+
case exports.EMeasureAggregationTemplateName.agvIf:
|
|
1181
|
+
return anyEvent
|
|
1182
|
+
? createAnyEventTemplate("avg({columnFormula})")
|
|
1183
|
+
: createSpecificEventTemplate("avgIf");
|
|
1184
|
+
case exports.EMeasureAggregationTemplateName.medianIf:
|
|
1185
|
+
return anyEvent
|
|
1186
|
+
? createAnyEventTemplate("median({columnFormula})")
|
|
1187
|
+
: createSpecificEventTemplate("medianIf");
|
|
1188
|
+
case exports.EMeasureAggregationTemplateName.countIf:
|
|
1189
|
+
return anyEvent
|
|
1190
|
+
? createAnyEventTemplate("count({columnFormula})")
|
|
1191
|
+
: createSpecificEventTemplate("countIf");
|
|
1192
|
+
case exports.EMeasureAggregationTemplateName.countIfDistinct:
|
|
1193
|
+
return anyEvent
|
|
1194
|
+
? createAnyEventTemplate("count(distinct {columnFormula})")
|
|
1195
|
+
: createSpecificEventTemplate("countIf", "distinct");
|
|
1196
|
+
case exports.EMeasureAggregationTemplateName.minIf:
|
|
1197
|
+
return anyEvent
|
|
1198
|
+
? createAnyEventTemplate("min({columnFormula})")
|
|
1199
|
+
: createSpecificEventTemplate("minIf");
|
|
1200
|
+
case exports.EMeasureAggregationTemplateName.maxIf:
|
|
1201
|
+
return anyEvent
|
|
1202
|
+
? createAnyEventTemplate("max({columnFormula})")
|
|
1203
|
+
: createSpecificEventTemplate("maxIf");
|
|
1204
|
+
case exports.EMeasureAggregationTemplateName.sumIf:
|
|
1205
|
+
return anyEvent
|
|
1206
|
+
? createAnyEventTemplate("sum({columnFormula})")
|
|
1207
|
+
: createSpecificEventTemplate("sumIf");
|
|
1208
|
+
case exports.EMeasureAggregationTemplateName.top:
|
|
1209
|
+
return anyEvent
|
|
1210
|
+
? createAnyEventTemplate("topK(1)({columnFormula})[1]")
|
|
1211
|
+
: createTopLikeTemplate(topTemplate)(outerAggregation);
|
|
1212
|
+
case exports.EMeasureAggregationTemplateName.firstValue:
|
|
1213
|
+
return anyEvent
|
|
1214
|
+
? createAnyEventTemplate("argMin({columnFormula}, {eventTimeFormula})")
|
|
1215
|
+
: createTopLikeTemplate(firstValueTemplate)(outerAggregation);
|
|
1216
|
+
case exports.EMeasureAggregationTemplateName.lastValue:
|
|
1217
|
+
return anyEvent
|
|
1218
|
+
? createAnyEventTemplate("argMax({columnFormula}, {eventTimeFormula})")
|
|
1219
|
+
: createTopLikeTemplate(lastValueTemplate)(outerAggregation);
|
|
1220
|
+
case exports.EMeasureAggregationTemplateName.countExecutions:
|
|
1221
|
+
return "{outerAggregation}If(".concat(countExecutionsTemplate, ", {objectFilters})");
|
|
1222
|
+
case exports.EMeasureAggregationTemplateName.countReworks:
|
|
1223
|
+
return "{outerAggregation}If(".concat(countReworksTemplate, ", {objectFilters})");
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1191
1227
|
function getMeasureFormula(_a) {
|
|
1192
1228
|
var _b;
|
|
1193
1229
|
var value = _a.value;
|
|
@@ -1208,17 +1244,13 @@ function getMeasureFormula(_a) {
|
|
|
1208
1244
|
});
|
|
1209
1245
|
}
|
|
1210
1246
|
if (value.mode === exports.EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1211
|
-
var
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
? templateFormula(preparedParams_1.outerAggregation)
|
|
1219
|
-
: templateFormula;
|
|
1220
|
-
};
|
|
1221
|
-
return fillTemplateString(getTemplateFormula(), preparedParams_1);
|
|
1247
|
+
var preparedParams = prepareMeasureAggregationParams(value);
|
|
1248
|
+
return preparedParams
|
|
1249
|
+
? fillTemplateString(createAggregationTemplate(value.templateName, {
|
|
1250
|
+
outerAggregation: preparedParams.outerAggregation,
|
|
1251
|
+
anyEvent: value.anyEvent,
|
|
1252
|
+
}), preparedParams)
|
|
1253
|
+
: "";
|
|
1222
1254
|
}
|
|
1223
1255
|
if (value.mode === exports.EWidgetIndicatorValueModes.CONVERSION) {
|
|
1224
1256
|
var preparedParams = prepareConversionParams(value);
|
|
@@ -2070,6 +2102,7 @@ exports.conversionTemplate = conversionTemplate;
|
|
|
2070
2102
|
exports.convertFiltersToFormula = convertFiltersToFormula;
|
|
2071
2103
|
exports.convertToFormulasChain = convertToFormulasChain;
|
|
2072
2104
|
exports.countExecutionsTemplate = countExecutionsTemplate;
|
|
2105
|
+
exports.createMeasureAggregationTemplate = createAggregationTemplate;
|
|
2073
2106
|
exports.dashboardLinkRegExp = dashboardLinkRegExp;
|
|
2074
2107
|
exports.dimensionAggregationTemplates = dimensionAggregationTemplates;
|
|
2075
2108
|
exports.dimensionTemplateFormulas = dimensionTemplateFormulas;
|
|
@@ -2101,7 +2134,6 @@ exports.mapFormulaFiltersToInputs = mapFormulaFiltersToInputs;
|
|
|
2101
2134
|
exports.mapMeasuresToInputs = mapMeasuresToInputs;
|
|
2102
2135
|
exports.mapSortingToInputs = mapSortingToInputs;
|
|
2103
2136
|
exports.mapTransitionMeasuresToInputs = mapTransitionMeasuresToInputs;
|
|
2104
|
-
exports.measureAggregationTemplates = measureAggregationTemplates;
|
|
2105
2137
|
exports.measureTemplateFormulas = measureTemplateFormulas;
|
|
2106
2138
|
exports.parseClickHouseType = parseClickHouseType;
|
|
2107
2139
|
exports.parseIndicatorLink = parseIndicatorLink;
|