@infomaximum/widget-sdk 5.33.1 → 6.0.0-1
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 +27 -0
- package/dist/index.d.ts +27 -33
- package/dist/index.esm.js +119 -62
- package/dist/index.js +119 -62
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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-1](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-0...v6.0.0-1) (2025-08-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* если виджет использовал guid, то требуется поддержка
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* удален guid из интерфейсов. ([f50d978](https://github.com/Infomaximum/widget-sdk/commit/f50d9781ab2fc41ed1deb3fafee262e4c4057db1))
|
|
15
|
+
|
|
16
|
+
## [6.0.0-0](https://github.com/Infomaximum/widget-sdk/compare/v5.33.1...v6.0.0-0) (2025-08-20)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### ⚠ BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
* получение ф-ии шаблона процессной агрегации для меры через константу "measureAggregationTemplates" заменено на получение через ф-ию "createAggregationFormulaByTemplateName"
|
|
22
|
+
* поле actions удалено из настроек виджетов
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* отказ от поля actions в пользу actionButtons в настройках виджетов ([2ee361a](https://github.com/Infomaximum/widget-sdk/commit/2ee361a5ab1478e1b0ad90feae2256cf90d46058))
|
|
27
|
+
* расширен IInputControl полями hint и hintPlacement. Для запуска скрипта из действий по клику добавлена подсказка ([63d02d6](https://github.com/Infomaximum/widget-sdk/commit/63d02d68bc38bb6d6b1bb2dfd1898d4b948ee6fc))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
* 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)
|
|
31
|
+
|
|
5
32
|
### [5.33.1](https://github.com/Infomaximum/widget-sdk/compare/v5.33.0...v5.33.1) (2025-08-15)
|
|
6
33
|
|
|
7
34
|
## [5.33.0](https://github.com/Infomaximum/widget-sdk/compare/v5.32.1...v5.33.0) (2025-08-06)
|
package/dist/index.d.ts
CHANGED
|
@@ -571,13 +571,9 @@ declare enum ESortingValueModes {
|
|
|
571
571
|
}
|
|
572
572
|
interface ICommonState {
|
|
573
573
|
name: string;
|
|
574
|
-
/** @deprecated */
|
|
575
|
-
guid: string;
|
|
576
574
|
}
|
|
577
575
|
interface ICommonMeasures {
|
|
578
576
|
name: string;
|
|
579
|
-
/** @deprecated */
|
|
580
|
-
guid: string;
|
|
581
577
|
formula: string;
|
|
582
578
|
}
|
|
583
579
|
interface ICommonDimensions {
|
|
@@ -649,8 +645,6 @@ declare enum EIndicatorType {
|
|
|
649
645
|
interface IBaseWidgetVariable {
|
|
650
646
|
/** Имя переменной */
|
|
651
647
|
name: string;
|
|
652
|
-
/** @deprecated */
|
|
653
|
-
guid: string;
|
|
654
648
|
}
|
|
655
649
|
/** Обобщенные типы значений переменных */
|
|
656
650
|
declare enum ESimpleInputType {
|
|
@@ -736,8 +730,9 @@ type TWidgetIndicatorAggregationValue = {
|
|
|
736
730
|
templateName: string;
|
|
737
731
|
processKey: string | null;
|
|
738
732
|
eventName: string | null;
|
|
739
|
-
caseCaseIdFormula: string | null;
|
|
740
733
|
eventNameFormula: string | null;
|
|
734
|
+
anyEvent?: true;
|
|
735
|
+
caseCaseIdFormula: string | null;
|
|
741
736
|
filters: TExtendedFormulaFilterValue[];
|
|
742
737
|
tableName?: string;
|
|
743
738
|
columnName?: string;
|
|
@@ -785,16 +780,12 @@ interface IWidgetTableColumn {
|
|
|
785
780
|
dbDataType: string;
|
|
786
781
|
}
|
|
787
782
|
interface IScriptField {
|
|
788
|
-
/** @deprecated */
|
|
789
|
-
guid: string;
|
|
790
783
|
name: string;
|
|
791
784
|
isRequired: boolean;
|
|
792
785
|
isArray: boolean;
|
|
793
786
|
}
|
|
794
787
|
interface IActionScript {
|
|
795
788
|
key: string;
|
|
796
|
-
/** @deprecated */
|
|
797
|
-
guid: string;
|
|
798
789
|
name: string;
|
|
799
790
|
fields: IScriptField[];
|
|
800
791
|
}
|
|
@@ -814,8 +805,6 @@ interface IGlobalContext {
|
|
|
814
805
|
reportName: string;
|
|
815
806
|
/** Имена образов по их ключу(в текущем отчете) */
|
|
816
807
|
viewNameByKey: Map<string, string>;
|
|
817
|
-
/** @deprecated имя группы пространства по ее id */
|
|
818
|
-
workspaceGroupNameById: Map<number, string>;
|
|
819
808
|
/** Меры уровня отчета */
|
|
820
809
|
reportMeasures: TNullable<Map<string, ICommonMeasures>>;
|
|
821
810
|
/** Меры уровня пространства(из модели данных) */
|
|
@@ -930,7 +919,7 @@ interface IBaseWidgetSettings {
|
|
|
930
919
|
filterMode?: EWidgetFilterMode;
|
|
931
920
|
ignoreFilters?: boolean;
|
|
932
921
|
sorting?: IWidgetSortingIndicator[];
|
|
933
|
-
|
|
922
|
+
actionButtons?: IActionButton[];
|
|
934
923
|
paddings?: number | string;
|
|
935
924
|
}
|
|
936
925
|
|
|
@@ -1084,6 +1073,7 @@ interface IActionRunScript extends IActionCommon {
|
|
|
1084
1073
|
variableName: string;
|
|
1085
1074
|
variableValue: string;
|
|
1086
1075
|
};
|
|
1076
|
+
hint?: string;
|
|
1087
1077
|
}
|
|
1088
1078
|
interface IActionUpdateVariable extends IActionCommon {
|
|
1089
1079
|
type: EActionTypes.UPDATE_VARIABLE;
|
|
@@ -1138,6 +1128,8 @@ interface IWidgetAction extends IActionCommon {
|
|
|
1138
1128
|
scriptKey: string;
|
|
1139
1129
|
autoUpdate: EAutoUpdateMode;
|
|
1140
1130
|
description: string;
|
|
1131
|
+
hideInactiveButton?: boolean;
|
|
1132
|
+
hint?: string;
|
|
1141
1133
|
activateCondition: {
|
|
1142
1134
|
mode: EActivateConditionMode.FORMULA;
|
|
1143
1135
|
formula: string;
|
|
@@ -1146,10 +1138,15 @@ interface IWidgetAction extends IActionCommon {
|
|
|
1146
1138
|
variableName: string;
|
|
1147
1139
|
variableValue: string;
|
|
1148
1140
|
};
|
|
1141
|
+
}
|
|
1142
|
+
interface IActionButton extends IAutoIdentifiedArrayItem {
|
|
1143
|
+
name: string;
|
|
1144
|
+
onClick: IWidgetAction[];
|
|
1149
1145
|
buttonType: EActionButtonsTypes;
|
|
1150
1146
|
backgroundColor?: TColor;
|
|
1151
1147
|
borderColor?: TColor;
|
|
1152
1148
|
color: TColor;
|
|
1149
|
+
hint?: string;
|
|
1153
1150
|
}
|
|
1154
1151
|
type TViewActionParameter = (IParameterFromAggregation | IParameterFromVariable) & {
|
|
1155
1152
|
name: string;
|
|
@@ -1213,6 +1210,13 @@ declare const dimensionTemplateFormulas: Record<EDimensionTemplateNames, string>
|
|
|
1213
1210
|
declare function getDimensionFormula({ value }: IWidgetDimension): string;
|
|
1214
1211
|
|
|
1215
1212
|
declare enum EDimensionAggregationTemplateName {
|
|
1213
|
+
avg = "avg",
|
|
1214
|
+
median = "median",
|
|
1215
|
+
count = "count",
|
|
1216
|
+
countDistinct = "countDistinct",
|
|
1217
|
+
min = "min",
|
|
1218
|
+
max = "max",
|
|
1219
|
+
sum = "sum",
|
|
1216
1220
|
top = "top",
|
|
1217
1221
|
firstValue = "firstValue",
|
|
1218
1222
|
lastValue = "lastValue",
|
|
@@ -1284,21 +1288,6 @@ declare enum EMeasureAggregationTemplateName {
|
|
|
1284
1288
|
countExecutions = "countExecutions",
|
|
1285
1289
|
countReworks = "countReworks"
|
|
1286
1290
|
}
|
|
1287
|
-
/** Шаблоны процессных метрик меры с режимом AGGREGATION */
|
|
1288
|
-
declare const measureAggregationTemplates: {
|
|
1289
|
-
agvIf: string;
|
|
1290
|
-
medianIf: string;
|
|
1291
|
-
countIf: string;
|
|
1292
|
-
countIfDistinct: string;
|
|
1293
|
-
minIf: string;
|
|
1294
|
-
maxIf: string;
|
|
1295
|
-
sumIf: string;
|
|
1296
|
-
top: (outerAggregation: EOuterAggregation) => string;
|
|
1297
|
-
firstValue: (outerAggregation: EOuterAggregation) => string;
|
|
1298
|
-
lastValue: (outerAggregation: EOuterAggregation) => string;
|
|
1299
|
-
countExecutions: string;
|
|
1300
|
-
countReworks: string;
|
|
1301
|
-
};
|
|
1302
1291
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
1303
1292
|
declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["value"], {
|
|
1304
1293
|
mode: EWidgetIndicatorValueModes.AGGREGATION;
|
|
@@ -1306,7 +1295,7 @@ declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["v
|
|
|
1306
1295
|
outerAggregation: EOuterAggregation;
|
|
1307
1296
|
eventNameFormula: string;
|
|
1308
1297
|
caseCaseIdFormula: string;
|
|
1309
|
-
eventName: string;
|
|
1298
|
+
eventName: string | null;
|
|
1310
1299
|
objectFilters: string;
|
|
1311
1300
|
filters: string;
|
|
1312
1301
|
eventTimeFormula: string;
|
|
@@ -1329,6 +1318,10 @@ declare const prepareConversionParams: (value: TWidgetIndicatorConversionValue)
|
|
|
1329
1318
|
endEventFilters: string;
|
|
1330
1319
|
} | null;
|
|
1331
1320
|
|
|
1321
|
+
declare function createAggregationTemplate(templateName: EMeasureAggregationTemplateName, { outerAggregation, anyEvent, }: Pick<TWidgetIndicatorAggregationValue, "anyEvent"> & {
|
|
1322
|
+
outerAggregation: EOuterAggregation;
|
|
1323
|
+
}): string;
|
|
1324
|
+
|
|
1332
1325
|
/** Шаблоны процессных метрик меры с режимом DURATION */
|
|
1333
1326
|
declare const durationTemplates: Record<EDurationTemplateName, string>;
|
|
1334
1327
|
/** На основе значения режима DURATION подготовить параметры для подстановки в шаблонную формулу */
|
|
@@ -1396,6 +1389,7 @@ interface IIndicatorLink {
|
|
|
1396
1389
|
}
|
|
1397
1390
|
declare const parseIndicatorLink: (formula: string) => IIndicatorLink | null;
|
|
1398
1391
|
|
|
1392
|
+
type THintPlacement = "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
1399
1393
|
declare enum EControlType {
|
|
1400
1394
|
/** Ввод текста */
|
|
1401
1395
|
input = "input",
|
|
@@ -1550,6 +1544,8 @@ interface IInputControl {
|
|
|
1550
1544
|
/** Использовать ли уменьшенный размер заголовка */
|
|
1551
1545
|
isSmallTitle?: boolean;
|
|
1552
1546
|
disabled?: boolean;
|
|
1547
|
+
hintText?: string;
|
|
1548
|
+
hintPlacement?: THintPlacement;
|
|
1553
1549
|
};
|
|
1554
1550
|
}
|
|
1555
1551
|
interface IInputMarkdownControl {
|
|
@@ -2327,8 +2323,6 @@ interface IPanelDescription<Settings extends object, GroupSettings extends IGrou
|
|
|
2327
2323
|
filtrationModes?: EWidgetFilterMode[];
|
|
2328
2324
|
}
|
|
2329
2325
|
interface IWidgetProcess {
|
|
2330
|
-
/** @deprecated */
|
|
2331
|
-
guid: string;
|
|
2332
2326
|
/** Ключ процесса */
|
|
2333
2327
|
key: string;
|
|
2334
2328
|
/** Имя процесса */
|
|
@@ -2742,4 +2736,4 @@ declare global {
|
|
|
2742
2736
|
}
|
|
2743
2737
|
}
|
|
2744
2738
|
|
|
2745
|
-
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,
|
|
2739
|
+
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,11 +744,22 @@ var EEventAppearances;
|
|
|
744
744
|
EEventAppearances["LAST"] = "LAST";
|
|
745
745
|
})(EEventAppearances || (EEventAppearances = {}));
|
|
746
746
|
|
|
747
|
+
function createAggregationTemplate$1(functionName, options) {
|
|
748
|
+
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})");
|
|
749
|
+
}
|
|
750
|
+
|
|
747
751
|
var countReworksTemplate = "process(if(countIf({eventNameFormula} = '{eventName}'{filters}) > 0, countIf({eventNameFormula} = '{eventName}'{filters}) - 1, 0), {caseCaseIdFormula})";
|
|
748
752
|
var countExecutionsTemplate = "process(countIf({eventNameFormula} in '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
749
753
|
var lastValueTemplate = "process(argMaxIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
750
754
|
var firstValueTemplate = "process(argMinIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
751
755
|
var topTemplate = "process(topKIf(1)({columnFormula}, {eventNameFormula} = '{eventName}'{filters})[1], {caseCaseIdFormula})";
|
|
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");
|
|
752
763
|
|
|
753
764
|
function fillTemplateString(templateString, params) {
|
|
754
765
|
return templateString.replace(/\{(.*?)\}/g, function (_, key) { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ""; });
|
|
@@ -860,9 +871,16 @@ var convertFiltersToFormula = function (filters) {
|
|
|
860
871
|
return filters.length > 0 ? " AND ".concat(convertToFormulasChain(filters)) : "";
|
|
861
872
|
};
|
|
862
873
|
|
|
863
|
-
var _a$
|
|
874
|
+
var _a$3;
|
|
864
875
|
var EDimensionAggregationTemplateName;
|
|
865
876
|
(function (EDimensionAggregationTemplateName) {
|
|
877
|
+
EDimensionAggregationTemplateName["avg"] = "avg";
|
|
878
|
+
EDimensionAggregationTemplateName["median"] = "median";
|
|
879
|
+
EDimensionAggregationTemplateName["count"] = "count";
|
|
880
|
+
EDimensionAggregationTemplateName["countDistinct"] = "countDistinct";
|
|
881
|
+
EDimensionAggregationTemplateName["min"] = "min";
|
|
882
|
+
EDimensionAggregationTemplateName["max"] = "max";
|
|
883
|
+
EDimensionAggregationTemplateName["sum"] = "sum";
|
|
866
884
|
EDimensionAggregationTemplateName["top"] = "top";
|
|
867
885
|
EDimensionAggregationTemplateName["firstValue"] = "firstValue";
|
|
868
886
|
EDimensionAggregationTemplateName["lastValue"] = "lastValue";
|
|
@@ -870,13 +888,20 @@ var EDimensionAggregationTemplateName;
|
|
|
870
888
|
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
871
889
|
})(EDimensionAggregationTemplateName || (EDimensionAggregationTemplateName = {}));
|
|
872
890
|
/** Шаблоны процессных метрик разреза с режимом AGGREGATION */
|
|
873
|
-
var dimensionAggregationTemplates = (_a$
|
|
874
|
-
_a$
|
|
875
|
-
_a$
|
|
876
|
-
_a$
|
|
877
|
-
_a$
|
|
878
|
-
_a$
|
|
879
|
-
_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);
|
|
880
905
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
881
906
|
var prepareDimensionAggregationParams = function (value) {
|
|
882
907
|
if (!value.eventName ||
|
|
@@ -992,7 +1017,6 @@ function getDimensionFormula(_a) {
|
|
|
992
1017
|
return "";
|
|
993
1018
|
}
|
|
994
1019
|
|
|
995
|
-
var _a$3;
|
|
996
1020
|
var EMeasureAggregationTemplateName;
|
|
997
1021
|
(function (EMeasureAggregationTemplateName) {
|
|
998
1022
|
EMeasureAggregationTemplateName["agvIf"] = "agvIf";
|
|
@@ -1008,35 +1032,9 @@ var EMeasureAggregationTemplateName;
|
|
|
1008
1032
|
EMeasureAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
1009
1033
|
EMeasureAggregationTemplateName["countReworks"] = "countReworks";
|
|
1010
1034
|
})(EMeasureAggregationTemplateName || (EMeasureAggregationTemplateName = {}));
|
|
1011
|
-
function createAggregationTemplate(fn, additionalFn) {
|
|
1012
|
-
return "{outerAggregation}If(process(".concat(fn, "(").concat(additionalFn ? additionalFn + " " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula}), {objectFilters})");
|
|
1013
|
-
}
|
|
1014
|
-
/** Шаблоны процессных метрик меры с режимом AGGREGATION */
|
|
1015
|
-
var measureAggregationTemplates = (_a$3 = {},
|
|
1016
|
-
_a$3[EMeasureAggregationTemplateName.agvIf] = createAggregationTemplate("avgIf"),
|
|
1017
|
-
_a$3[EMeasureAggregationTemplateName.medianIf] = createAggregationTemplate("medianIf"),
|
|
1018
|
-
_a$3[EMeasureAggregationTemplateName.countIf] = createAggregationTemplate("countIf"),
|
|
1019
|
-
_a$3[EMeasureAggregationTemplateName.countIfDistinct] = createAggregationTemplate("countIf", "distinct"),
|
|
1020
|
-
_a$3[EMeasureAggregationTemplateName.minIf] = createAggregationTemplate("minIf"),
|
|
1021
|
-
_a$3[EMeasureAggregationTemplateName.maxIf] = createAggregationTemplate("maxIf"),
|
|
1022
|
-
_a$3[EMeasureAggregationTemplateName.sumIf] = createAggregationTemplate("sumIf"),
|
|
1023
|
-
_a$3[EMeasureAggregationTemplateName.top] = createTopLikeTemplate(topTemplate),
|
|
1024
|
-
_a$3[EMeasureAggregationTemplateName.firstValue] = createTopLikeTemplate(firstValueTemplate),
|
|
1025
|
-
_a$3[EMeasureAggregationTemplateName.lastValue] = createTopLikeTemplate(lastValueTemplate),
|
|
1026
|
-
_a$3[EMeasureAggregationTemplateName.countExecutions] = "{outerAggregation}If(".concat(countExecutionsTemplate, ",{objectFilters})"),
|
|
1027
|
-
_a$3[EMeasureAggregationTemplateName.countReworks] = "{outerAggregation}If(".concat(countReworksTemplate, ",{objectFilters})"),
|
|
1028
|
-
_a$3);
|
|
1029
|
-
/** Вспомогательная функция для шаблонов top/firstValue/lastValue */
|
|
1030
|
-
function createTopLikeTemplate(template) {
|
|
1031
|
-
return function (outerAggregation) {
|
|
1032
|
-
return outerAggregation === EOuterAggregation.top
|
|
1033
|
-
? "{outerAggregation}KIf(1)(".concat(template, ", {objectFilters})[1]")
|
|
1034
|
-
: "{outerAggregation}If(".concat(template, ", {objectFilters})");
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1037
1035
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
1038
1036
|
var prepareMeasureAggregationParams = function (value) {
|
|
1039
|
-
if (!value.eventName ||
|
|
1037
|
+
if ((!value.anyEvent && !value.eventName) ||
|
|
1040
1038
|
!value.caseCaseIdFormula ||
|
|
1041
1039
|
!value.eventNameFormula ||
|
|
1042
1040
|
!value.outerAggregation ||
|
|
@@ -1162,6 +1160,69 @@ var prepareDurationParams = function (value) {
|
|
|
1162
1160
|
};
|
|
1163
1161
|
};
|
|
1164
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
|
+
|
|
1165
1226
|
function getMeasureFormula(_a) {
|
|
1166
1227
|
var _b;
|
|
1167
1228
|
var value = _a.value;
|
|
@@ -1182,17 +1243,13 @@ function getMeasureFormula(_a) {
|
|
|
1182
1243
|
});
|
|
1183
1244
|
}
|
|
1184
1245
|
if (value.mode === EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1185
|
-
var
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
? templateFormula(preparedParams_1.outerAggregation)
|
|
1193
|
-
: templateFormula;
|
|
1194
|
-
};
|
|
1195
|
-
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
|
+
: "";
|
|
1196
1253
|
}
|
|
1197
1254
|
if (value.mode === EWidgetIndicatorValueModes.CONVERSION) {
|
|
1198
1255
|
var preparedParams = prepareConversionParams(value);
|
|
@@ -2025,4 +2082,4 @@ var getColorByIndex = function (index) {
|
|
|
2025
2082
|
return color;
|
|
2026
2083
|
};
|
|
2027
2084
|
|
|
2028
|
-
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,11 +745,22 @@ exports.EEventAppearances = void 0;
|
|
|
745
745
|
EEventAppearances["LAST"] = "LAST";
|
|
746
746
|
})(exports.EEventAppearances || (exports.EEventAppearances = {}));
|
|
747
747
|
|
|
748
|
+
function createAggregationTemplate$1(functionName, options) {
|
|
749
|
+
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})");
|
|
750
|
+
}
|
|
751
|
+
|
|
748
752
|
var countReworksTemplate = "process(if(countIf({eventNameFormula} = '{eventName}'{filters}) > 0, countIf({eventNameFormula} = '{eventName}'{filters}) - 1, 0), {caseCaseIdFormula})";
|
|
749
753
|
var countExecutionsTemplate = "process(countIf({eventNameFormula} in '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
750
754
|
var lastValueTemplate = "process(argMaxIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
751
755
|
var firstValueTemplate = "process(argMinIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula})";
|
|
752
756
|
var topTemplate = "process(topKIf(1)({columnFormula}, {eventNameFormula} = '{eventName}'{filters})[1], {caseCaseIdFormula})";
|
|
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");
|
|
753
764
|
|
|
754
765
|
function fillTemplateString(templateString, params) {
|
|
755
766
|
return templateString.replace(/\{(.*?)\}/g, function (_, key) { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ""; });
|
|
@@ -861,9 +872,16 @@ var convertFiltersToFormula = function (filters) {
|
|
|
861
872
|
return filters.length > 0 ? " AND ".concat(convertToFormulasChain(filters)) : "";
|
|
862
873
|
};
|
|
863
874
|
|
|
864
|
-
var _a$
|
|
875
|
+
var _a$3;
|
|
865
876
|
exports.EDimensionAggregationTemplateName = void 0;
|
|
866
877
|
(function (EDimensionAggregationTemplateName) {
|
|
878
|
+
EDimensionAggregationTemplateName["avg"] = "avg";
|
|
879
|
+
EDimensionAggregationTemplateName["median"] = "median";
|
|
880
|
+
EDimensionAggregationTemplateName["count"] = "count";
|
|
881
|
+
EDimensionAggregationTemplateName["countDistinct"] = "countDistinct";
|
|
882
|
+
EDimensionAggregationTemplateName["min"] = "min";
|
|
883
|
+
EDimensionAggregationTemplateName["max"] = "max";
|
|
884
|
+
EDimensionAggregationTemplateName["sum"] = "sum";
|
|
867
885
|
EDimensionAggregationTemplateName["top"] = "top";
|
|
868
886
|
EDimensionAggregationTemplateName["firstValue"] = "firstValue";
|
|
869
887
|
EDimensionAggregationTemplateName["lastValue"] = "lastValue";
|
|
@@ -871,13 +889,20 @@ exports.EDimensionAggregationTemplateName = void 0;
|
|
|
871
889
|
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
872
890
|
})(exports.EDimensionAggregationTemplateName || (exports.EDimensionAggregationTemplateName = {}));
|
|
873
891
|
/** Шаблоны процессных метрик разреза с режимом AGGREGATION */
|
|
874
|
-
var dimensionAggregationTemplates = (_a$
|
|
875
|
-
_a$
|
|
876
|
-
_a$
|
|
877
|
-
_a$
|
|
878
|
-
_a$
|
|
879
|
-
_a$
|
|
880
|
-
_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);
|
|
881
906
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
882
907
|
var prepareDimensionAggregationParams = function (value) {
|
|
883
908
|
if (!value.eventName ||
|
|
@@ -993,7 +1018,6 @@ function getDimensionFormula(_a) {
|
|
|
993
1018
|
return "";
|
|
994
1019
|
}
|
|
995
1020
|
|
|
996
|
-
var _a$3;
|
|
997
1021
|
exports.EMeasureAggregationTemplateName = void 0;
|
|
998
1022
|
(function (EMeasureAggregationTemplateName) {
|
|
999
1023
|
EMeasureAggregationTemplateName["agvIf"] = "agvIf";
|
|
@@ -1009,35 +1033,9 @@ exports.EMeasureAggregationTemplateName = void 0;
|
|
|
1009
1033
|
EMeasureAggregationTemplateName["countExecutions"] = "countExecutions";
|
|
1010
1034
|
EMeasureAggregationTemplateName["countReworks"] = "countReworks";
|
|
1011
1035
|
})(exports.EMeasureAggregationTemplateName || (exports.EMeasureAggregationTemplateName = {}));
|
|
1012
|
-
function createAggregationTemplate(fn, additionalFn) {
|
|
1013
|
-
return "{outerAggregation}If(process(".concat(fn, "(").concat(additionalFn ? additionalFn + " " : "", "{columnFormula}, {eventNameFormula} = '{eventName}'{filters}), {caseCaseIdFormula}), {objectFilters})");
|
|
1014
|
-
}
|
|
1015
|
-
/** Шаблоны процессных метрик меры с режимом AGGREGATION */
|
|
1016
|
-
var measureAggregationTemplates = (_a$3 = {},
|
|
1017
|
-
_a$3[exports.EMeasureAggregationTemplateName.agvIf] = createAggregationTemplate("avgIf"),
|
|
1018
|
-
_a$3[exports.EMeasureAggregationTemplateName.medianIf] = createAggregationTemplate("medianIf"),
|
|
1019
|
-
_a$3[exports.EMeasureAggregationTemplateName.countIf] = createAggregationTemplate("countIf"),
|
|
1020
|
-
_a$3[exports.EMeasureAggregationTemplateName.countIfDistinct] = createAggregationTemplate("countIf", "distinct"),
|
|
1021
|
-
_a$3[exports.EMeasureAggregationTemplateName.minIf] = createAggregationTemplate("minIf"),
|
|
1022
|
-
_a$3[exports.EMeasureAggregationTemplateName.maxIf] = createAggregationTemplate("maxIf"),
|
|
1023
|
-
_a$3[exports.EMeasureAggregationTemplateName.sumIf] = createAggregationTemplate("sumIf"),
|
|
1024
|
-
_a$3[exports.EMeasureAggregationTemplateName.top] = createTopLikeTemplate(topTemplate),
|
|
1025
|
-
_a$3[exports.EMeasureAggregationTemplateName.firstValue] = createTopLikeTemplate(firstValueTemplate),
|
|
1026
|
-
_a$3[exports.EMeasureAggregationTemplateName.lastValue] = createTopLikeTemplate(lastValueTemplate),
|
|
1027
|
-
_a$3[exports.EMeasureAggregationTemplateName.countExecutions] = "{outerAggregation}If(".concat(countExecutionsTemplate, ",{objectFilters})"),
|
|
1028
|
-
_a$3[exports.EMeasureAggregationTemplateName.countReworks] = "{outerAggregation}If(".concat(countReworksTemplate, ",{objectFilters})"),
|
|
1029
|
-
_a$3);
|
|
1030
|
-
/** Вспомогательная функция для шаблонов top/firstValue/lastValue */
|
|
1031
|
-
function createTopLikeTemplate(template) {
|
|
1032
|
-
return function (outerAggregation) {
|
|
1033
|
-
return outerAggregation === exports.EOuterAggregation.top
|
|
1034
|
-
? "{outerAggregation}KIf(1)(".concat(template, ", {objectFilters})[1]")
|
|
1035
|
-
: "{outerAggregation}If(".concat(template, ", {objectFilters})");
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
1036
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
1039
1037
|
var prepareMeasureAggregationParams = function (value) {
|
|
1040
|
-
if (!value.eventName ||
|
|
1038
|
+
if ((!value.anyEvent && !value.eventName) ||
|
|
1041
1039
|
!value.caseCaseIdFormula ||
|
|
1042
1040
|
!value.eventNameFormula ||
|
|
1043
1041
|
!value.outerAggregation ||
|
|
@@ -1163,6 +1161,69 @@ var prepareDurationParams = function (value) {
|
|
|
1163
1161
|
};
|
|
1164
1162
|
};
|
|
1165
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
|
+
|
|
1166
1227
|
function getMeasureFormula(_a) {
|
|
1167
1228
|
var _b;
|
|
1168
1229
|
var value = _a.value;
|
|
@@ -1183,17 +1244,13 @@ function getMeasureFormula(_a) {
|
|
|
1183
1244
|
});
|
|
1184
1245
|
}
|
|
1185
1246
|
if (value.mode === exports.EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1186
|
-
var
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
? templateFormula(preparedParams_1.outerAggregation)
|
|
1194
|
-
: templateFormula;
|
|
1195
|
-
};
|
|
1196
|
-
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
|
+
: "";
|
|
1197
1254
|
}
|
|
1198
1255
|
if (value.mode === exports.EWidgetIndicatorValueModes.CONVERSION) {
|
|
1199
1256
|
var preparedParams = prepareConversionParams(value);
|
|
@@ -2045,6 +2102,7 @@ exports.conversionTemplate = conversionTemplate;
|
|
|
2045
2102
|
exports.convertFiltersToFormula = convertFiltersToFormula;
|
|
2046
2103
|
exports.convertToFormulasChain = convertToFormulasChain;
|
|
2047
2104
|
exports.countExecutionsTemplate = countExecutionsTemplate;
|
|
2105
|
+
exports.createMeasureAggregationTemplate = createAggregationTemplate;
|
|
2048
2106
|
exports.dashboardLinkRegExp = dashboardLinkRegExp;
|
|
2049
2107
|
exports.dimensionAggregationTemplates = dimensionAggregationTemplates;
|
|
2050
2108
|
exports.dimensionTemplateFormulas = dimensionTemplateFormulas;
|
|
@@ -2076,7 +2134,6 @@ exports.mapFormulaFiltersToInputs = mapFormulaFiltersToInputs;
|
|
|
2076
2134
|
exports.mapMeasuresToInputs = mapMeasuresToInputs;
|
|
2077
2135
|
exports.mapSortingToInputs = mapSortingToInputs;
|
|
2078
2136
|
exports.mapTransitionMeasuresToInputs = mapTransitionMeasuresToInputs;
|
|
2079
|
-
exports.measureAggregationTemplates = measureAggregationTemplates;
|
|
2080
2137
|
exports.measureTemplateFormulas = measureTemplateFormulas;
|
|
2081
2138
|
exports.parseClickHouseType = parseClickHouseType;
|
|
2082
2139
|
exports.parseIndicatorLink = parseIndicatorLink;
|