@infomaximum/widget-sdk 6.0.0-view-theme.1 → 6.0.0-view-theme.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +68 -13
- package/dist/index.js +68 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,40 +2,76 @@
|
|
|
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-view-theme.2](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-15...v6.0.0-view-theme.2) (2025-10-02)
|
|
6
|
+
|
|
7
|
+
## [6.0.0-view-theme.1](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-14...v6.0.0-view-theme.1) (2025-10-01)
|
|
8
|
+
|
|
9
|
+
## [6.0.0-view-theme.0](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-12...v6.0.0-view-theme.0) (2025-09-29)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* поддержен флаг для темы [BI-15496] ([5196fa6](https://github.com/Infomaximum/widget-sdk/commit/5196fa6c69a521c4529a355e674bcb1f8c1aac39))
|
|
15
|
+
|
|
5
16
|
## [6.0.0-view-theme.1](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.4...v6.0.0-view-theme.1) (2025-10-01)
|
|
6
17
|
|
|
7
|
-
## [6.0.0-
|
|
18
|
+
## [6.0.0-15](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-14...v6.0.0-15) (2025-10-02)
|
|
19
|
+
|
|
20
|
+
## [6.0.0-14](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.4...v6.0.0-14) (2025-10-01)
|
|
8
21
|
|
|
22
|
+
## [6.0.0-13](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.3...v6.0.0-13) (2025-10-01)
|
|
9
23
|
|
|
10
24
|
### Bug Fixes
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
- исправлены шаблоны формул и функции подготовки параметров наполнения шаблонов. Отказ от удаления однострочных и многострочных комментариев ([97332be](https://github.com/Infomaximum/widget-sdk/commit/97332be7bddd6942f3670ff806470b9c1a59c122))
|
|
13
27
|
|
|
14
28
|
## [6.0.0-view-theme.0](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-12...v6.0.0-view-theme.0) (2025-09-29)
|
|
15
29
|
|
|
16
30
|
## [6.0.0-12](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-11...v6.0.0-12) (2025-09-29)
|
|
17
31
|
|
|
18
|
-
|
|
19
32
|
### Features
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
- поддержен флаг для темы [BI-15496] ([5196fa6](https://github.com/Infomaximum/widget-sdk/commit/5196fa6c69a521c4529a355e674bcb1f8c1aac39))
|
|
22
35
|
|
|
23
36
|
## [6.0.0-11](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.2...v6.0.0-11) (2025-09-23)
|
|
24
37
|
|
|
25
|
-
|
|
26
38
|
### Features
|
|
27
39
|
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
- для параметров действий образа добавлен id ([4b92d35](https://github.com/Infomaximum/widget-sdk/commit/4b92d3547a6048b8326db94ec360515d99e17b1a))
|
|
41
|
+
- удален флаг isBordered для IInputControl [BI-15461] ([d60c32d](https://github.com/Infomaximum/widget-sdk/commit/d60c32d02134c10b1aa799dc5a45e2656fe5aefd))
|
|
30
42
|
|
|
31
43
|
## [6.0.0-10](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.1...v6.0.0-10) (2025-09-12)
|
|
32
44
|
|
|
33
45
|
## [6.0.0-9](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-8...v6.0.0-9) (2025-09-12)
|
|
34
46
|
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
- исправлен баг с подстановкой значений в template строки ([12166b5](https://github.com/Infomaximum/widget-sdk/commit/12166b587b74e0ff912822b0d065463b8f23121e))
|
|
50
|
+
|
|
51
|
+
## [6.0.0-8](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.0...v6.0.0-8) (2025-09-11)
|
|
52
|
+
|
|
53
|
+
## [6.0.0-13](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-12...v6.0.0-13) (2025-10-01)
|
|
35
54
|
|
|
36
55
|
### Bug Fixes
|
|
37
56
|
|
|
38
|
-
|
|
57
|
+
- исправлены шаблоны формул и функции подготовки параметров наполнения шаблонов. Отказ от удаления однострочных и многострочных комментариев ([97332be](https://github.com/Infomaximum/widget-sdk/commit/97332be7bddd6942f3670ff806470b9c1a59c122))
|
|
58
|
+
|
|
59
|
+
## [6.0.0-12](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-11...v6.0.0-12) (2025-09-29)
|
|
60
|
+
|
|
61
|
+
## [6.0.0-11](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.2...v6.0.0-11) (2025-09-23)
|
|
62
|
+
|
|
63
|
+
### Features
|
|
64
|
+
|
|
65
|
+
- для параметров действий образа добавлен id ([4b92d35](https://github.com/Infomaximum/widget-sdk/commit/4b92d3547a6048b8326db94ec360515d99e17b1a))
|
|
66
|
+
- удален флаг isBordered для IInputControl [BI-15461] ([d60c32d](https://github.com/Infomaximum/widget-sdk/commit/d60c32d02134c10b1aa799dc5a45e2656fe5aefd))
|
|
67
|
+
|
|
68
|
+
## [6.0.0-10](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.1...v6.0.0-10) (2025-09-12)
|
|
69
|
+
|
|
70
|
+
## [6.0.0-9](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-8...v6.0.0-9) (2025-09-12)
|
|
71
|
+
|
|
72
|
+
### Bug Fixes
|
|
73
|
+
|
|
74
|
+
- исправлен баг с подстановкой значений в template строки ([12166b5](https://github.com/Infomaximum/widget-sdk/commit/12166b587b74e0ff912822b0d065463b8f23121e))
|
|
39
75
|
|
|
40
76
|
## [6.0.0-8](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.0...v6.0.0-8) (2025-09-11)
|
|
41
77
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2089,6 +2089,8 @@ declare const countExecutionsTemplate = "process(countIf({eventNameFormula} in {
|
|
|
2089
2089
|
|
|
2090
2090
|
/** @deprecated - следует использовать fillTemplateSql */
|
|
2091
2091
|
declare function fillTemplateString(templateString: string, params: Record<string, any>): string;
|
|
2092
|
+
/** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
|
|
2093
|
+
declare function fillTemplateSql(templateString: string, params: Record<string, string>): string;
|
|
2092
2094
|
|
|
2093
2095
|
declare function generateColumnFormula(tableName: string, columnName: string): string;
|
|
2094
2096
|
|
|
@@ -2753,4 +2755,4 @@ declare global {
|
|
|
2753
2755
|
}
|
|
2754
2756
|
}
|
|
2755
2757
|
|
|
2756
|
-
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, 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 IDimensionProcessFilter, 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 IInputTemplatedControl, 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 TSettingsFilter, 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, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
|
2758
|
+
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, 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 IDimensionProcessFilter, 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 IInputTemplatedControl, 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 TSettingsFilter, 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, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.esm.js
CHANGED
|
@@ -132,6 +132,35 @@ function __rest(s, e) {
|
|
|
132
132
|
return t;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
function __values(o) {
|
|
136
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
137
|
+
if (m) return m.call(o);
|
|
138
|
+
if (o && typeof o.length === "number") return {
|
|
139
|
+
next: function () {
|
|
140
|
+
if (o && i >= o.length) o = void 0;
|
|
141
|
+
return { value: o && o[i++], done: !o };
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function __read(o, n) {
|
|
148
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
149
|
+
if (!m) return o;
|
|
150
|
+
var i = m.call(o), r, ar = [], e;
|
|
151
|
+
try {
|
|
152
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
153
|
+
}
|
|
154
|
+
catch (error) { e = { error: error }; }
|
|
155
|
+
finally {
|
|
156
|
+
try {
|
|
157
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
158
|
+
}
|
|
159
|
+
finally { if (e) throw e.error; }
|
|
160
|
+
}
|
|
161
|
+
return ar;
|
|
162
|
+
}
|
|
163
|
+
|
|
135
164
|
function __makeTemplateObject(cooked, raw) {
|
|
136
165
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
137
166
|
return cooked;
|
|
@@ -797,6 +826,32 @@ function fillTemplateString(templateString, params) {
|
|
|
797
826
|
return (_a = params[key]) !== null && _a !== void 0 ? _a : "";
|
|
798
827
|
});
|
|
799
828
|
}
|
|
829
|
+
/** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
|
|
830
|
+
function fillTemplateSql(templateString, params) {
|
|
831
|
+
var e_1, _a;
|
|
832
|
+
var newParams = {};
|
|
833
|
+
if (templateString.indexOf("'{") >= 0) {
|
|
834
|
+
throw new Error("\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0448\u0430\u0431\u043B\u043E\u043D: \u043F\u043B\u0435\u0439\u0441\u0445\u043E\u043B\u0434\u0435\u0440\u044B \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u044B \u0437\u0430\u043A\u043B\u044E\u0447\u0430\u0442\u044C\u0441\u044F \u0432 \u043E\u0434\u0438\u043D\u0430\u0440\u043D\u044B\u0435 \u043A\u0430\u0432\u044B\u0447\u043A\u0438.\n \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 {placeholder} \u0432\u043C\u0435\u0441\u0442\u043E '{placeholder}'.\n \u041A\u0430\u0432\u044B\u0447\u043A\u0438 \u0434\u043E\u043B\u0436\u043D\u044B \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0445 \u043F\u043E\u043B\u0435\u0439 \u043F\u0440\u0438 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.");
|
|
835
|
+
}
|
|
836
|
+
try {
|
|
837
|
+
for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
838
|
+
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
839
|
+
if (String(value).indexOf("--") >= 0) {
|
|
840
|
+
newParams[key] = "".concat(value, "\n");
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
newParams[key] = sanitizeSingleLineComment(String(value));
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
847
|
+
finally {
|
|
848
|
+
try {
|
|
849
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
850
|
+
}
|
|
851
|
+
finally { if (e_1) throw e_1.error; }
|
|
852
|
+
}
|
|
853
|
+
return fillTemplateString(templateString, newParams);
|
|
854
|
+
}
|
|
800
855
|
|
|
801
856
|
/** Создать функцию экранирования переданных `specialChars` внутри `str` */
|
|
802
857
|
var createEscaper = function (specialChars) { return function (str) {
|
|
@@ -1023,7 +1078,7 @@ var timeTemplates = (function () {
|
|
|
1023
1078
|
var generateTemplates = function (innerTemplate) {
|
|
1024
1079
|
var templates = {};
|
|
1025
1080
|
for (var key in dimensionTemplateFormulas) {
|
|
1026
|
-
templates[key] =
|
|
1081
|
+
templates[key] = fillTemplateSql(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
|
|
1027
1082
|
}
|
|
1028
1083
|
return templates;
|
|
1029
1084
|
};
|
|
@@ -1066,7 +1121,7 @@ function getDimensionFormula(_a) {
|
|
|
1066
1121
|
if (!templateFormula || !tableName || !columnName) {
|
|
1067
1122
|
return "";
|
|
1068
1123
|
}
|
|
1069
|
-
return
|
|
1124
|
+
return fillTemplateSql(templateFormula, {
|
|
1070
1125
|
columnFormula: generateColumnFormula(tableName, columnName),
|
|
1071
1126
|
});
|
|
1072
1127
|
}
|
|
@@ -1082,10 +1137,10 @@ function getProcessDimensionValueFormula(value) {
|
|
|
1082
1137
|
? dimensionTemplateFormulas[value.innerTemplateName]
|
|
1083
1138
|
: null;
|
|
1084
1139
|
var columnFormula = innerTemplate
|
|
1085
|
-
?
|
|
1140
|
+
? fillTemplateSql(innerTemplate, { columnFormula: preparedParams.columnFormula })
|
|
1086
1141
|
: preparedParams.columnFormula;
|
|
1087
1142
|
var dimensionAggregationTemplate = dimensionAggregationTemplates[value.templateName];
|
|
1088
|
-
return
|
|
1143
|
+
return fillTemplateSql(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
|
|
1089
1144
|
}
|
|
1090
1145
|
if (value.mode === EWidgetIndicatorValueModes.START_TIME ||
|
|
1091
1146
|
value.mode === EWidgetIndicatorValueModes.END_TIME) {
|
|
@@ -1094,7 +1149,7 @@ function getProcessDimensionValueFormula(value) {
|
|
|
1094
1149
|
return "";
|
|
1095
1150
|
}
|
|
1096
1151
|
var templateFormula = timeTemplates[value.mode][value.templateName];
|
|
1097
|
-
return
|
|
1152
|
+
return fillTemplateSql(templateFormula, preparedParams);
|
|
1098
1153
|
}
|
|
1099
1154
|
}
|
|
1100
1155
|
|
|
@@ -1316,14 +1371,14 @@ function getMeasureFormula(_a) {
|
|
|
1316
1371
|
if (!templateFormula || !tableName || !columnName) {
|
|
1317
1372
|
return "";
|
|
1318
1373
|
}
|
|
1319
|
-
return
|
|
1374
|
+
return fillTemplateSql(templateFormula, {
|
|
1320
1375
|
columnFormula: generateColumnFormula(tableName, columnName),
|
|
1321
1376
|
});
|
|
1322
1377
|
}
|
|
1323
1378
|
if (value.mode === EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1324
1379
|
var preparedParams = prepareMeasureAggregationParams(value);
|
|
1325
1380
|
return preparedParams
|
|
1326
|
-
?
|
|
1381
|
+
? fillTemplateSql(createAggregationTemplate(value.templateName, {
|
|
1327
1382
|
outerAggregation: preparedParams.outerAggregation,
|
|
1328
1383
|
anyEvent: value.anyEvent,
|
|
1329
1384
|
}), preparedParams)
|
|
@@ -1334,14 +1389,14 @@ function getMeasureFormula(_a) {
|
|
|
1334
1389
|
if (!preparedParams) {
|
|
1335
1390
|
return "";
|
|
1336
1391
|
}
|
|
1337
|
-
return
|
|
1392
|
+
return fillTemplateSql(conversionTemplate, preparedParams);
|
|
1338
1393
|
}
|
|
1339
1394
|
if (value.mode === EWidgetIndicatorValueModes.DURATION) {
|
|
1340
1395
|
var preparedParams = prepareDurationParams(value);
|
|
1341
1396
|
if (!preparedParams) {
|
|
1342
1397
|
return "";
|
|
1343
1398
|
}
|
|
1344
|
-
return
|
|
1399
|
+
return fillTemplateSql(durationTemplates[value.templateName], preparedParams);
|
|
1345
1400
|
}
|
|
1346
1401
|
return "";
|
|
1347
1402
|
}
|
|
@@ -1367,7 +1422,7 @@ function getEventMeasureFormula(_a, process) {
|
|
|
1367
1422
|
}
|
|
1368
1423
|
if (value.mode === EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1369
1424
|
var templateFormula = eventMeasureTemplateFormulas[value.templateName];
|
|
1370
|
-
return templateFormula &&
|
|
1425
|
+
return templateFormula && fillTemplateSql(templateFormula, process);
|
|
1371
1426
|
}
|
|
1372
1427
|
return "";
|
|
1373
1428
|
}
|
|
@@ -1393,7 +1448,7 @@ function getTransitionMeasureFormula(_a, process) {
|
|
|
1393
1448
|
}
|
|
1394
1449
|
if (value.mode === EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1395
1450
|
var templateFormula = transitionMeasureTemplateFormulas[value.templateName];
|
|
1396
|
-
return templateFormula &&
|
|
1451
|
+
return templateFormula && fillTemplateSql(templateFormula, process);
|
|
1397
1452
|
}
|
|
1398
1453
|
return "";
|
|
1399
1454
|
}
|
|
@@ -1585,7 +1640,7 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
|
|
|
1585
1640
|
if (!isFormulaFilterValue(filterValue)) {
|
|
1586
1641
|
return {
|
|
1587
1642
|
dbDataType: EClickHouseBaseTypes.Bool,
|
|
1588
|
-
formula:
|
|
1643
|
+
formula: fillTemplateSql(displayConditionTemplate, {
|
|
1589
1644
|
formula: prepareFormulaForSql(filterValue.formula),
|
|
1590
1645
|
}),
|
|
1591
1646
|
values: ["true"],
|
|
@@ -2154,4 +2209,4 @@ var getColorByIndex = function (index) {
|
|
|
2154
2209
|
return color;
|
|
2155
2210
|
};
|
|
2156
2211
|
|
|
2157
|
-
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, 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, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
|
2212
|
+
export { EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, 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, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
package/dist/index.js
CHANGED
|
@@ -133,6 +133,35 @@ function __rest(s, e) {
|
|
|
133
133
|
return t;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
function __values(o) {
|
|
137
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
138
|
+
if (m) return m.call(o);
|
|
139
|
+
if (o && typeof o.length === "number") return {
|
|
140
|
+
next: function () {
|
|
141
|
+
if (o && i >= o.length) o = void 0;
|
|
142
|
+
return { value: o && o[i++], done: !o };
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function __read(o, n) {
|
|
149
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
150
|
+
if (!m) return o;
|
|
151
|
+
var i = m.call(o), r, ar = [], e;
|
|
152
|
+
try {
|
|
153
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
154
|
+
}
|
|
155
|
+
catch (error) { e = { error: error }; }
|
|
156
|
+
finally {
|
|
157
|
+
try {
|
|
158
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
159
|
+
}
|
|
160
|
+
finally { if (e) throw e.error; }
|
|
161
|
+
}
|
|
162
|
+
return ar;
|
|
163
|
+
}
|
|
164
|
+
|
|
136
165
|
function __makeTemplateObject(cooked, raw) {
|
|
137
166
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
138
167
|
return cooked;
|
|
@@ -798,6 +827,32 @@ function fillTemplateString(templateString, params) {
|
|
|
798
827
|
return (_a = params[key]) !== null && _a !== void 0 ? _a : "";
|
|
799
828
|
});
|
|
800
829
|
}
|
|
830
|
+
/** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
|
|
831
|
+
function fillTemplateSql(templateString, params) {
|
|
832
|
+
var e_1, _a;
|
|
833
|
+
var newParams = {};
|
|
834
|
+
if (templateString.indexOf("'{") >= 0) {
|
|
835
|
+
throw new Error("\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0448\u0430\u0431\u043B\u043E\u043D: \u043F\u043B\u0435\u0439\u0441\u0445\u043E\u043B\u0434\u0435\u0440\u044B \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u044B \u0437\u0430\u043A\u043B\u044E\u0447\u0430\u0442\u044C\u0441\u044F \u0432 \u043E\u0434\u0438\u043D\u0430\u0440\u043D\u044B\u0435 \u043A\u0430\u0432\u044B\u0447\u043A\u0438.\n \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 {placeholder} \u0432\u043C\u0435\u0441\u0442\u043E '{placeholder}'.\n \u041A\u0430\u0432\u044B\u0447\u043A\u0438 \u0434\u043E\u043B\u0436\u043D\u044B \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0445 \u043F\u043E\u043B\u0435\u0439 \u043F\u0440\u0438 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.");
|
|
836
|
+
}
|
|
837
|
+
try {
|
|
838
|
+
for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
839
|
+
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
840
|
+
if (String(value).indexOf("--") >= 0) {
|
|
841
|
+
newParams[key] = "".concat(value, "\n");
|
|
842
|
+
continue;
|
|
843
|
+
}
|
|
844
|
+
newParams[key] = sanitizeSingleLineComment(String(value));
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
848
|
+
finally {
|
|
849
|
+
try {
|
|
850
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
851
|
+
}
|
|
852
|
+
finally { if (e_1) throw e_1.error; }
|
|
853
|
+
}
|
|
854
|
+
return fillTemplateString(templateString, newParams);
|
|
855
|
+
}
|
|
801
856
|
|
|
802
857
|
/** Создать функцию экранирования переданных `specialChars` внутри `str` */
|
|
803
858
|
var createEscaper = function (specialChars) { return function (str) {
|
|
@@ -1024,7 +1079,7 @@ var timeTemplates = (function () {
|
|
|
1024
1079
|
var generateTemplates = function (innerTemplate) {
|
|
1025
1080
|
var templates = {};
|
|
1026
1081
|
for (var key in dimensionTemplateFormulas) {
|
|
1027
|
-
templates[key] =
|
|
1082
|
+
templates[key] = fillTemplateSql(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
|
|
1028
1083
|
}
|
|
1029
1084
|
return templates;
|
|
1030
1085
|
};
|
|
@@ -1067,7 +1122,7 @@ function getDimensionFormula(_a) {
|
|
|
1067
1122
|
if (!templateFormula || !tableName || !columnName) {
|
|
1068
1123
|
return "";
|
|
1069
1124
|
}
|
|
1070
|
-
return
|
|
1125
|
+
return fillTemplateSql(templateFormula, {
|
|
1071
1126
|
columnFormula: generateColumnFormula(tableName, columnName),
|
|
1072
1127
|
});
|
|
1073
1128
|
}
|
|
@@ -1083,10 +1138,10 @@ function getProcessDimensionValueFormula(value) {
|
|
|
1083
1138
|
? dimensionTemplateFormulas[value.innerTemplateName]
|
|
1084
1139
|
: null;
|
|
1085
1140
|
var columnFormula = innerTemplate
|
|
1086
|
-
?
|
|
1141
|
+
? fillTemplateSql(innerTemplate, { columnFormula: preparedParams.columnFormula })
|
|
1087
1142
|
: preparedParams.columnFormula;
|
|
1088
1143
|
var dimensionAggregationTemplate = dimensionAggregationTemplates[value.templateName];
|
|
1089
|
-
return
|
|
1144
|
+
return fillTemplateSql(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
|
|
1090
1145
|
}
|
|
1091
1146
|
if (value.mode === exports.EWidgetIndicatorValueModes.START_TIME ||
|
|
1092
1147
|
value.mode === exports.EWidgetIndicatorValueModes.END_TIME) {
|
|
@@ -1095,7 +1150,7 @@ function getProcessDimensionValueFormula(value) {
|
|
|
1095
1150
|
return "";
|
|
1096
1151
|
}
|
|
1097
1152
|
var templateFormula = timeTemplates[value.mode][value.templateName];
|
|
1098
|
-
return
|
|
1153
|
+
return fillTemplateSql(templateFormula, preparedParams);
|
|
1099
1154
|
}
|
|
1100
1155
|
}
|
|
1101
1156
|
|
|
@@ -1317,14 +1372,14 @@ function getMeasureFormula(_a) {
|
|
|
1317
1372
|
if (!templateFormula || !tableName || !columnName) {
|
|
1318
1373
|
return "";
|
|
1319
1374
|
}
|
|
1320
|
-
return
|
|
1375
|
+
return fillTemplateSql(templateFormula, {
|
|
1321
1376
|
columnFormula: generateColumnFormula(tableName, columnName),
|
|
1322
1377
|
});
|
|
1323
1378
|
}
|
|
1324
1379
|
if (value.mode === exports.EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1325
1380
|
var preparedParams = prepareMeasureAggregationParams(value);
|
|
1326
1381
|
return preparedParams
|
|
1327
|
-
?
|
|
1382
|
+
? fillTemplateSql(createAggregationTemplate(value.templateName, {
|
|
1328
1383
|
outerAggregation: preparedParams.outerAggregation,
|
|
1329
1384
|
anyEvent: value.anyEvent,
|
|
1330
1385
|
}), preparedParams)
|
|
@@ -1335,14 +1390,14 @@ function getMeasureFormula(_a) {
|
|
|
1335
1390
|
if (!preparedParams) {
|
|
1336
1391
|
return "";
|
|
1337
1392
|
}
|
|
1338
|
-
return
|
|
1393
|
+
return fillTemplateSql(conversionTemplate, preparedParams);
|
|
1339
1394
|
}
|
|
1340
1395
|
if (value.mode === exports.EWidgetIndicatorValueModes.DURATION) {
|
|
1341
1396
|
var preparedParams = prepareDurationParams(value);
|
|
1342
1397
|
if (!preparedParams) {
|
|
1343
1398
|
return "";
|
|
1344
1399
|
}
|
|
1345
|
-
return
|
|
1400
|
+
return fillTemplateSql(durationTemplates[value.templateName], preparedParams);
|
|
1346
1401
|
}
|
|
1347
1402
|
return "";
|
|
1348
1403
|
}
|
|
@@ -1368,7 +1423,7 @@ function getEventMeasureFormula(_a, process) {
|
|
|
1368
1423
|
}
|
|
1369
1424
|
if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1370
1425
|
var templateFormula = eventMeasureTemplateFormulas[value.templateName];
|
|
1371
|
-
return templateFormula &&
|
|
1426
|
+
return templateFormula && fillTemplateSql(templateFormula, process);
|
|
1372
1427
|
}
|
|
1373
1428
|
return "";
|
|
1374
1429
|
}
|
|
@@ -1394,7 +1449,7 @@ function getTransitionMeasureFormula(_a, process) {
|
|
|
1394
1449
|
}
|
|
1395
1450
|
if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1396
1451
|
var templateFormula = transitionMeasureTemplateFormulas[value.templateName];
|
|
1397
|
-
return templateFormula &&
|
|
1452
|
+
return templateFormula && fillTemplateSql(templateFormula, process);
|
|
1398
1453
|
}
|
|
1399
1454
|
return "";
|
|
1400
1455
|
}
|
|
@@ -1586,7 +1641,7 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
|
|
|
1586
1641
|
if (!isFormulaFilterValue(filterValue)) {
|
|
1587
1642
|
return {
|
|
1588
1643
|
dbDataType: exports.EClickHouseBaseTypes.Bool,
|
|
1589
|
-
formula:
|
|
1644
|
+
formula: fillTemplateSql(displayConditionTemplate, {
|
|
1590
1645
|
formula: prepareFormulaForSql(filterValue.formula),
|
|
1591
1646
|
}),
|
|
1592
1647
|
values: ["true"],
|
|
@@ -2186,6 +2241,7 @@ exports.durationTemplates = durationTemplates;
|
|
|
2186
2241
|
exports.escapeCurlyBracketLinkName = escapeCurlyBracketLinkName;
|
|
2187
2242
|
exports.escapeDoubleQuoteLinkName = escapeDoubleQuoteLinkName;
|
|
2188
2243
|
exports.eventMeasureTemplateFormulas = eventMeasureTemplateFormulas;
|
|
2244
|
+
exports.fillTemplateSql = fillTemplateSql;
|
|
2189
2245
|
exports.fillTemplateString = fillTemplateString;
|
|
2190
2246
|
exports.formattingConfig = formattingConfig;
|
|
2191
2247
|
exports.formulaFilterMethods = formulaFilterMethods;
|