@infomaximum/widget-sdk 6.0.0-2508.2 → 6.0.0-2508.3

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 CHANGED
@@ -2,6 +2,8 @@
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-2508.3](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.2...v6.0.0-2508.3) (2025-09-30)
6
+
5
7
  ## [6.0.0-2508.2](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-2508.1...v6.0.0-2508.2) (2025-09-23)
6
8
 
7
9
 
package/dist/index.d.ts CHANGED
@@ -2086,10 +2086,7 @@ declare const transitionMeasureTemplateFormulas: {
2086
2086
 
2087
2087
  declare const countExecutionsTemplate = "process(countIf({eventNameFormula} in '{eventName}'{filters}), {caseCaseIdFormula})";
2088
2088
 
2089
- /** @deprecated - следует использовать fillTemplateSql */
2090
2089
  declare function fillTemplateString(templateString: string, params: Record<string, any>): string;
2091
- /** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
2092
- declare function fillTemplateSql(templateString: string, params: Record<string, any>): string;
2093
2090
 
2094
2091
  declare function generateColumnFormula(tableName: string, columnName: string): string;
2095
2092
 
@@ -2752,4 +2749,4 @@ declare global {
2752
2749
  }
2753
2750
  }
2754
2751
 
2755
- 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 };
2752
+ 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 };
package/dist/index.esm.js CHANGED
@@ -132,35 +132,6 @@ 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
-
164
135
  function __makeTemplateObject(cooked, raw) {
165
136
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
166
137
  return cooked;
@@ -802,41 +773,8 @@ var minTemplate = createAggregationTemplate$1("minIf");
802
773
  var maxTemplate = createAggregationTemplate$1("maxIf");
803
774
  var sumTemplate = createAggregationTemplate$1("sumIf");
804
775
 
805
- /** @deprecated - следует использовать fillTemplateSql */
806
776
  function fillTemplateString(templateString, params) {
807
- return templateString.replace(/\{(.*?)\}/g, function (_, key) {
808
- var _a;
809
- return (_a = params[key]) !== null && _a !== void 0 ? _a : "";
810
- });
811
- }
812
- /** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
813
- function fillTemplateSql(templateString, params) {
814
- var e_1, _a;
815
- var newParams = {};
816
- try {
817
- for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
818
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
819
- if (!value) {
820
- newParams[key] = value;
821
- break;
822
- }
823
- /** Эвристическая проверка на возможное присутствие sql-комментария в значении подставляемом в template
824
- */
825
- if (typeof value === "string" && value.indexOf("--") >= 0) {
826
- newParams[key] = "".concat(value, "\n");
827
- break;
828
- }
829
- newParams[key] = value;
830
- }
831
- }
832
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
833
- finally {
834
- try {
835
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
836
- }
837
- finally { if (e_1) throw e_1.error; }
838
- }
839
- return fillTemplateString(templateString, newParams);
777
+ return templateString.replace(/\{(.*?)\}/g, function (_, key) { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ""; });
840
778
  }
841
779
 
842
780
  /** Создать функцию экранирования переданных `specialChars` внутри `str` */
@@ -1064,7 +1002,7 @@ var timeTemplates = (function () {
1064
1002
  var generateTemplates = function (innerTemplate) {
1065
1003
  var templates = {};
1066
1004
  for (var key in dimensionTemplateFormulas) {
1067
- templates[key] = fillTemplateSql(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
1005
+ templates[key] = fillTemplateString(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
1068
1006
  }
1069
1007
  return templates;
1070
1008
  };
@@ -1107,7 +1045,7 @@ function getDimensionFormula(_a) {
1107
1045
  if (!templateFormula || !tableName || !columnName) {
1108
1046
  return "";
1109
1047
  }
1110
- return fillTemplateSql(templateFormula, {
1048
+ return fillTemplateString(templateFormula, {
1111
1049
  columnFormula: generateColumnFormula(tableName, columnName),
1112
1050
  });
1113
1051
  }
@@ -1123,10 +1061,10 @@ function getProcessDimensionValueFormula(value) {
1123
1061
  ? dimensionTemplateFormulas[value.innerTemplateName]
1124
1062
  : null;
1125
1063
  var columnFormula = innerTemplate
1126
- ? fillTemplateSql(innerTemplate, { columnFormula: preparedParams.columnFormula })
1064
+ ? fillTemplateString(innerTemplate, { columnFormula: preparedParams.columnFormula })
1127
1065
  : preparedParams.columnFormula;
1128
1066
  var dimensionAggregationTemplate = dimensionAggregationTemplates[value.templateName];
1129
- return fillTemplateSql(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
1067
+ return fillTemplateString(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
1130
1068
  }
1131
1069
  if (value.mode === EWidgetIndicatorValueModes.START_TIME ||
1132
1070
  value.mode === EWidgetIndicatorValueModes.END_TIME) {
@@ -1135,7 +1073,7 @@ function getProcessDimensionValueFormula(value) {
1135
1073
  return "";
1136
1074
  }
1137
1075
  var templateFormula = timeTemplates[value.mode][value.templateName];
1138
- return fillTemplateSql(templateFormula, preparedParams);
1076
+ return fillTemplateString(templateFormula, preparedParams);
1139
1077
  }
1140
1078
  }
1141
1079
 
@@ -1357,14 +1295,14 @@ function getMeasureFormula(_a) {
1357
1295
  if (!templateFormula || !tableName || !columnName) {
1358
1296
  return "";
1359
1297
  }
1360
- return fillTemplateSql(templateFormula, {
1298
+ return fillTemplateString(templateFormula, {
1361
1299
  columnFormula: generateColumnFormula(tableName, columnName),
1362
1300
  });
1363
1301
  }
1364
1302
  if (value.mode === EWidgetIndicatorValueModes.AGGREGATION) {
1365
1303
  var preparedParams = prepareMeasureAggregationParams(value);
1366
1304
  return preparedParams
1367
- ? fillTemplateSql(createAggregationTemplate(value.templateName, {
1305
+ ? fillTemplateString(createAggregationTemplate(value.templateName, {
1368
1306
  outerAggregation: preparedParams.outerAggregation,
1369
1307
  anyEvent: value.anyEvent,
1370
1308
  }), preparedParams)
@@ -1375,14 +1313,14 @@ function getMeasureFormula(_a) {
1375
1313
  if (!preparedParams) {
1376
1314
  return "";
1377
1315
  }
1378
- return fillTemplateSql(conversionTemplate, preparedParams);
1316
+ return fillTemplateString(conversionTemplate, preparedParams);
1379
1317
  }
1380
1318
  if (value.mode === EWidgetIndicatorValueModes.DURATION) {
1381
1319
  var preparedParams = prepareDurationParams(value);
1382
1320
  if (!preparedParams) {
1383
1321
  return "";
1384
1322
  }
1385
- return fillTemplateSql(durationTemplates[value.templateName], preparedParams);
1323
+ return fillTemplateString(durationTemplates[value.templateName], preparedParams);
1386
1324
  }
1387
1325
  return "";
1388
1326
  }
@@ -1408,7 +1346,7 @@ function getEventMeasureFormula(_a, process) {
1408
1346
  }
1409
1347
  if (value.mode === EWidgetIndicatorValueModes.TEMPLATE) {
1410
1348
  var templateFormula = eventMeasureTemplateFormulas[value.templateName];
1411
- return templateFormula && fillTemplateSql(templateFormula, process);
1349
+ return templateFormula && fillTemplateString(templateFormula, process);
1412
1350
  }
1413
1351
  return "";
1414
1352
  }
@@ -1434,7 +1372,7 @@ function getTransitionMeasureFormula(_a, process) {
1434
1372
  }
1435
1373
  if (value.mode === EWidgetIndicatorValueModes.TEMPLATE) {
1436
1374
  var templateFormula = transitionMeasureTemplateFormulas[value.templateName];
1437
- return templateFormula && fillTemplateSql(templateFormula, process);
1375
+ return templateFormula && fillTemplateString(templateFormula, process);
1438
1376
  }
1439
1377
  return "";
1440
1378
  }
@@ -1626,7 +1564,7 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
1626
1564
  if (!isFormulaFilterValue(filterValue)) {
1627
1565
  return {
1628
1566
  dbDataType: EClickHouseBaseTypes.Bool,
1629
- formula: fillTemplateSql(displayConditionTemplate, {
1567
+ formula: fillTemplateString(displayConditionTemplate, {
1630
1568
  formula: prepareFormulaForSql(filterValue.formula),
1631
1569
  }),
1632
1570
  values: ["true"],
@@ -2195,4 +2133,4 @@ var getColorByIndex = function (index) {
2195
2133
  return color;
2196
2134
  };
2197
2135
 
2198
- 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 };
2136
+ 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 };
package/dist/index.js CHANGED
@@ -133,35 +133,6 @@ 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
-
165
136
  function __makeTemplateObject(cooked, raw) {
166
137
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
167
138
  return cooked;
@@ -803,41 +774,8 @@ var minTemplate = createAggregationTemplate$1("minIf");
803
774
  var maxTemplate = createAggregationTemplate$1("maxIf");
804
775
  var sumTemplate = createAggregationTemplate$1("sumIf");
805
776
 
806
- /** @deprecated - следует использовать fillTemplateSql */
807
777
  function fillTemplateString(templateString, params) {
808
- return templateString.replace(/\{(.*?)\}/g, function (_, key) {
809
- var _a;
810
- return (_a = params[key]) !== null && _a !== void 0 ? _a : "";
811
- });
812
- }
813
- /** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
814
- function fillTemplateSql(templateString, params) {
815
- var e_1, _a;
816
- var newParams = {};
817
- try {
818
- for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
819
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
820
- if (!value) {
821
- newParams[key] = value;
822
- break;
823
- }
824
- /** Эвристическая проверка на возможное присутствие sql-комментария в значении подставляемом в template
825
- */
826
- if (typeof value === "string" && value.indexOf("--") >= 0) {
827
- newParams[key] = "".concat(value, "\n");
828
- break;
829
- }
830
- newParams[key] = value;
831
- }
832
- }
833
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
834
- finally {
835
- try {
836
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
837
- }
838
- finally { if (e_1) throw e_1.error; }
839
- }
840
- return fillTemplateString(templateString, newParams);
778
+ return templateString.replace(/\{(.*?)\}/g, function (_, key) { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ""; });
841
779
  }
842
780
 
843
781
  /** Создать функцию экранирования переданных `specialChars` внутри `str` */
@@ -1065,7 +1003,7 @@ var timeTemplates = (function () {
1065
1003
  var generateTemplates = function (innerTemplate) {
1066
1004
  var templates = {};
1067
1005
  for (var key in dimensionTemplateFormulas) {
1068
- templates[key] = fillTemplateSql(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
1006
+ templates[key] = fillTemplateString(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
1069
1007
  }
1070
1008
  return templates;
1071
1009
  };
@@ -1108,7 +1046,7 @@ function getDimensionFormula(_a) {
1108
1046
  if (!templateFormula || !tableName || !columnName) {
1109
1047
  return "";
1110
1048
  }
1111
- return fillTemplateSql(templateFormula, {
1049
+ return fillTemplateString(templateFormula, {
1112
1050
  columnFormula: generateColumnFormula(tableName, columnName),
1113
1051
  });
1114
1052
  }
@@ -1124,10 +1062,10 @@ function getProcessDimensionValueFormula(value) {
1124
1062
  ? dimensionTemplateFormulas[value.innerTemplateName]
1125
1063
  : null;
1126
1064
  var columnFormula = innerTemplate
1127
- ? fillTemplateSql(innerTemplate, { columnFormula: preparedParams.columnFormula })
1065
+ ? fillTemplateString(innerTemplate, { columnFormula: preparedParams.columnFormula })
1128
1066
  : preparedParams.columnFormula;
1129
1067
  var dimensionAggregationTemplate = dimensionAggregationTemplates[value.templateName];
1130
- return fillTemplateSql(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
1068
+ return fillTemplateString(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
1131
1069
  }
1132
1070
  if (value.mode === exports.EWidgetIndicatorValueModes.START_TIME ||
1133
1071
  value.mode === exports.EWidgetIndicatorValueModes.END_TIME) {
@@ -1136,7 +1074,7 @@ function getProcessDimensionValueFormula(value) {
1136
1074
  return "";
1137
1075
  }
1138
1076
  var templateFormula = timeTemplates[value.mode][value.templateName];
1139
- return fillTemplateSql(templateFormula, preparedParams);
1077
+ return fillTemplateString(templateFormula, preparedParams);
1140
1078
  }
1141
1079
  }
1142
1080
 
@@ -1358,14 +1296,14 @@ function getMeasureFormula(_a) {
1358
1296
  if (!templateFormula || !tableName || !columnName) {
1359
1297
  return "";
1360
1298
  }
1361
- return fillTemplateSql(templateFormula, {
1299
+ return fillTemplateString(templateFormula, {
1362
1300
  columnFormula: generateColumnFormula(tableName, columnName),
1363
1301
  });
1364
1302
  }
1365
1303
  if (value.mode === exports.EWidgetIndicatorValueModes.AGGREGATION) {
1366
1304
  var preparedParams = prepareMeasureAggregationParams(value);
1367
1305
  return preparedParams
1368
- ? fillTemplateSql(createAggregationTemplate(value.templateName, {
1306
+ ? fillTemplateString(createAggregationTemplate(value.templateName, {
1369
1307
  outerAggregation: preparedParams.outerAggregation,
1370
1308
  anyEvent: value.anyEvent,
1371
1309
  }), preparedParams)
@@ -1376,14 +1314,14 @@ function getMeasureFormula(_a) {
1376
1314
  if (!preparedParams) {
1377
1315
  return "";
1378
1316
  }
1379
- return fillTemplateSql(conversionTemplate, preparedParams);
1317
+ return fillTemplateString(conversionTemplate, preparedParams);
1380
1318
  }
1381
1319
  if (value.mode === exports.EWidgetIndicatorValueModes.DURATION) {
1382
1320
  var preparedParams = prepareDurationParams(value);
1383
1321
  if (!preparedParams) {
1384
1322
  return "";
1385
1323
  }
1386
- return fillTemplateSql(durationTemplates[value.templateName], preparedParams);
1324
+ return fillTemplateString(durationTemplates[value.templateName], preparedParams);
1387
1325
  }
1388
1326
  return "";
1389
1327
  }
@@ -1409,7 +1347,7 @@ function getEventMeasureFormula(_a, process) {
1409
1347
  }
1410
1348
  if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
1411
1349
  var templateFormula = eventMeasureTemplateFormulas[value.templateName];
1412
- return templateFormula && fillTemplateSql(templateFormula, process);
1350
+ return templateFormula && fillTemplateString(templateFormula, process);
1413
1351
  }
1414
1352
  return "";
1415
1353
  }
@@ -1435,7 +1373,7 @@ function getTransitionMeasureFormula(_a, process) {
1435
1373
  }
1436
1374
  if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
1437
1375
  var templateFormula = transitionMeasureTemplateFormulas[value.templateName];
1438
- return templateFormula && fillTemplateSql(templateFormula, process);
1376
+ return templateFormula && fillTemplateString(templateFormula, process);
1439
1377
  }
1440
1378
  return "";
1441
1379
  }
@@ -1627,7 +1565,7 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
1627
1565
  if (!isFormulaFilterValue(filterValue)) {
1628
1566
  return {
1629
1567
  dbDataType: exports.EClickHouseBaseTypes.Bool,
1630
- formula: fillTemplateSql(displayConditionTemplate, {
1568
+ formula: fillTemplateString(displayConditionTemplate, {
1631
1569
  formula: prepareFormulaForSql(filterValue.formula),
1632
1570
  }),
1633
1571
  values: ["true"],
@@ -2227,7 +2165,6 @@ exports.durationTemplates = durationTemplates;
2227
2165
  exports.escapeCurlyBracketLinkName = escapeCurlyBracketLinkName;
2228
2166
  exports.escapeDoubleQuoteLinkName = escapeDoubleQuoteLinkName;
2229
2167
  exports.eventMeasureTemplateFormulas = eventMeasureTemplateFormulas;
2230
- exports.fillTemplateSql = fillTemplateSql;
2231
2168
  exports.fillTemplateString = fillTemplateString;
2232
2169
  exports.formattingConfig = formattingConfig;
2233
2170
  exports.formulaFilterMethods = formulaFilterMethods;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "6.0.0-2508.2",
3
+ "version": "6.0.0-2508.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",