@infomaximum/widget-sdk 5.15.0 → 5.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
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
+ ## [5.17.0](https://github.com/Infomaximum/widget-sdk/compare/v5.16.0...v5.17.0) (2025-04-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * в мета-описание добавлена возможность позиционирования поля относительно системных полей ([92b59c2](https://github.com/Infomaximum/widget-sdk/commit/92b59c2944121f6f211c3347ba5c4504b1f16dc6))
11
+ * в фильтрах по формуле поддержана возможность работы с элементами массива ([bfc6dcf](https://github.com/Infomaximum/widget-sdk/commit/bfc6dcfdae761d7c8306b250cd849ae64152b1d8))
12
+ * для способов ввода по формуле, агрегации и динамический список, добавлено поле considerFilters ([b7d8f72](https://github.com/Infomaximum/widget-sdk/commit/b7d8f72d417db755d506ccf29434a16041a13876))
13
+
14
+ ## [5.16.0](https://github.com/Infomaximum/widget-sdk/compare/v5.12.2...v5.16.0) (2025-04-22)
15
+
16
+ ## [5.15.0](https://github.com/Infomaximum/widget-sdk/compare/v5.14.0...v5.15.0) (2025-04-17)
17
+
18
+
19
+ ### Features
20
+
21
+ * в IBaseWidgetSettings добавлено поле markdownTextSize ([816efbf](https://github.com/Infomaximum/widget-sdk/commit/816efbf0602c21529f3b7ffd9178904d761b8a2e))
22
+ * для способа ввода статический список defaultOptionIndexes изменен на defaultValue ([afff970](https://github.com/Infomaximum/widget-sdk/commit/afff9709fbab78470d3ef3a5b8b2c12e233ad613))
23
+ * экспортированы интерфейсы параметров ожидаемых полей действий ([473400c](https://github.com/Infomaximum/widget-sdk/commit/473400ccda532a247927f6f7d0084e91dabb83d0))
24
+
25
+ ## [5.14.0](https://github.com/Infomaximum/widget-sdk/compare/v5.13.0...v5.14.0) (2025-04-16)
26
+
27
+
28
+ ### Features
29
+
30
+ * добавлена возможность автоматического вызова fillSettings при изменении настройки через элемент управления ([e4fce52](https://github.com/Infomaximum/widget-sdk/commit/e4fce528b715fe5e748130402e07052b73c1a4cd))
31
+
32
+ ## [5.13.0](https://github.com/Infomaximum/widget-sdk/compare/v5.12.1...v5.13.0) (2025-04-16)
33
+
34
+
35
+ ### Features
36
+
37
+ * добавлен новый inputMethod DATA_MODEL ([70b3d43](https://github.com/Infomaximum/widget-sdk/commit/70b3d434778f87777acbd18336286dde44dd9814))
38
+ * добавлены шаблоны для фильтрации в FormulaControl [WD-1705] ([ed358c3](https://github.com/Infomaximum/widget-sdk/commit/ed358c3889aac546c481acb4f590a878ccf3d6bd))
39
+ * удалены интефейсы расширенных настроек, добавлено поле paddings в интерфейс базовых настроек виджетов ([d704c81](https://github.com/Infomaximum/widget-sdk/commit/d704c81aa3dbf21d62b74580c654ffd08de17907))
40
+
5
41
  ## [5.15.0](https://github.com/Infomaximum/widget-sdk/compare/v5.14.0...v5.15.0) (2025-04-17)
6
42
 
7
43
 
@@ -27,6 +63,14 @@ All notable changes to this project will be documented in this file. See [standa
27
63
 
28
64
  * удалены интефейсы расширенных настроек, добавлено поле paddings в интерфейс базовых настроек виджетов ([d704c81](https://github.com/Infomaximum/widget-sdk/commit/d704c81aa3dbf21d62b74580c654ffd08de17907))
29
65
 
66
+
67
+ ### [5.12.2](https://github.com/Infomaximum/widget-sdk/compare/v5.12.1...v5.12.2) (2025-04-22)
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * исправленно падение фильтрации из-за комментариев в формуле ([962580c](https://github.com/Infomaximum/widget-sdk/commit/962580c0e86d6b7ebeacfef77481557add9eebf6))
73
+
30
74
  ### [5.12.1](https://github.com/Infomaximum/widget-sdk/compare/v5.12.0...v5.12.1) (2025-04-11)
31
75
 
32
76
  ## [5.12.0](https://github.com/Infomaximum/widget-sdk/compare/v5.11.1...v5.12.0) (2025-04-11)
package/dist/index.d.ts CHANGED
@@ -238,6 +238,7 @@ declare enum EDurationUnit {
238
238
  MINUTES = "MINUTES",
239
239
  SECONDS = "SECONDS"
240
240
  }
241
+ declare const applyIndexToArrayFormula: (formula: string, index: number) => string;
241
242
  declare const mapFormulaFilterToCalculatorInput: (filterValue: TExtendedFormulaFilterValue) => TNullable<ICalculatorFilter>;
242
243
  declare const mapFormulaFiltersToInputs: (filters: TExtendedFormulaFilterValue[]) => ICalculatorFilter[];
243
244
 
@@ -333,7 +334,16 @@ interface IFormulaFilterValue {
333
334
  name: TNullable<string>;
334
335
  /** Формула */
335
336
  formula: string;
336
- /** Тип данных формулы */
337
+ /**
338
+ * Индекс элемента в результате вычисления формулы (если результат - массив).
339
+ *
340
+ * Используется, когда формула возвращает массив значений, но требуется работать только с одним конкретным элементом.
341
+ * Индекс добавляется к вычисляемой формуле, позволяя выбрать нужный элемент из результирующего массива.
342
+ *
343
+ * **Важно:** Индексация начинается с 1, т.к. используется ClickHouse (1-based).
344
+ */
345
+ sliceIndex?: number;
346
+ /** Тип данных формулы (без учета `sliceIndex`) */
337
347
  dbDataType: string;
338
348
  /** Формат */
339
349
  format: EFormatTypes;
@@ -390,8 +400,19 @@ interface IWidgetFiltration {
390
400
  preparedFilterValues: ICalculatorFilter[];
391
401
  /** Добавить фильтр по формуле */
392
402
  addFormulaFilter(value: TSelectivePartial<IFormulaFilterValue, "format" | "formValues">): void;
393
- /** Удалить фильтр по формуле */
394
- removeFormulaFilter(formula: string): void;
403
+ /**
404
+ * Удалить фильтр, заданный формулой, из текущего набора фильтров
405
+ *
406
+ * @param formula Формула фильтра, который необходимо удалить. Должна точно соответствовать
407
+ * формуле ранее добавленного фильтра (с учетом регистра и пробелов).
408
+ * @param [sliceIndex] Опциональный индекс элемента массива. См. {@link IFormulaFilterValue.sliceIndex}.
409
+ *
410
+ * @remarks
411
+ * - Если фильтр был добавлен без указания индекса, его нужно удалять без указания индекса.
412
+ * - Если фильтр был добавлен с индексом, тот же индекс должен быть указан при удалении.
413
+ * - Удаление происходит по точному совпадению формулы и индекса (если он был указан).
414
+ */
415
+ removeFormulaFilter(formula: string, sliceIndex?: number): void;
395
416
  /** Добавить процессный фильтр */
396
417
  addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
397
418
  /** Добавить фильтр по этапам */
@@ -953,10 +974,12 @@ interface IParameterFromVariable {
953
974
  interface IParameterFromFormula {
954
975
  inputMethod: EWidgetActionInputMethod.FORMULA;
955
976
  formula: string;
977
+ considerFilters: boolean;
956
978
  }
957
979
  interface IParameterFromAggregation {
958
980
  inputMethod: EWidgetActionInputMethod.AGGREGATION;
959
981
  formula: string;
982
+ considerFilters: boolean;
960
983
  }
961
984
  interface IParameterFromEvent {
962
985
  inputMethod: EWidgetActionInputMethod.EVENT;
@@ -985,6 +1008,7 @@ interface IParameterFromDynamicList {
985
1008
  displayOptions: string;
986
1009
  filters: TExtendedFormulaFilterValue[];
987
1010
  filterByRows?: boolean;
1011
+ considerFilters: boolean;
988
1012
  }
989
1013
  interface IParameterFromDataModelBase {
990
1014
  inputMethod: EWidgetActionInputMethod.DATA_MODEL;
@@ -1421,6 +1445,37 @@ interface IControlRecord<Settings extends object, T extends TControlConstraint =
1421
1445
  * Предоставлен для удобства разработки. Скрыть элемент можно и условно добавляя его в мета-описание.
1422
1446
  */
1423
1447
  shouldDisplay?: IDisplayPredicate<Settings>;
1448
+ /** Позиционирование поля относительно системных полей (см. {@link IControlRecordPosition}) */
1449
+ position?: IControlRecordPosition;
1450
+ }
1451
+ /**
1452
+ * Контроль позиционирования кастомного поля относительно системных полей
1453
+ *
1454
+ * @remarks
1455
+ * Правила применения:
1456
+ * 1. Работает только с ключами системных полей
1457
+ * 2. Приоритет: `insertBefore` > `insertAfter` (если указаны оба)
1458
+ * 3. Если поле переопределяет системное (через key) - правило игнорируется
1459
+ * 4. Если указанный якорь не найден - правило игнорируется
1460
+ *
1461
+ * Статус реализации:
1462
+ * - Не работает на корневом уровне, работает внутри IGroupSetDescription
1463
+ *
1464
+ * // Планируемое расширение:
1465
+ * // 1. Добавить в IControlRecordPosition свойство strict - при true поле не добавляется, если якорь не найден
1466
+ * // 2. Поддержка на корневом уровне мета-описания
1467
+ */
1468
+ interface IControlRecordPosition {
1469
+ /**
1470
+ * Вставить поле перед указанным системным полем
1471
+ * @param key - ключ системного поля, перед которым нужно вставить
1472
+ */
1473
+ insertBefore?: string;
1474
+ /**
1475
+ * Вставить поле после указанного системного поля
1476
+ * @param key - ключ системного поля, после которого нужно вставить
1477
+ */
1478
+ insertAfter?: string;
1424
1479
  }
1425
1480
  interface IInputControl {
1426
1481
  type: EControlType.input;
@@ -2594,4 +2649,4 @@ declare global {
2594
2649
  }
2595
2650
  }
2596
2651
 
2597
- export { EActionButtonsTypes, EActionTypes, EAutoUpdateMode, EBlockingConditionMode, 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 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 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 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, 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, measureAggregationTemplates, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
2652
+ export { EActionButtonsTypes, EActionTypes, EAutoUpdateMode, EBlockingConditionMode, 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 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 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 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, measureAggregationTemplates, 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
@@ -1466,6 +1466,7 @@ var getFormulaFilterValues = function (filterValue) {
1466
1466
  }
1467
1467
  return [];
1468
1468
  };
1469
+ var applyIndexToArrayFormula = function (formula, index) { return "".concat(formula, "[").concat(index, "]"); };
1469
1470
  var mapFormulaFilterToCalculatorInput = function (filterValue) {
1470
1471
  if (!filterValue) {
1471
1472
  return null;
@@ -1473,13 +1474,23 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
1473
1474
  if (!isFormulaFilterValue(filterValue)) {
1474
1475
  return {
1475
1476
  dbDataType: EClickHouseBaseTypes.Bool,
1476
- formula: fillTemplateString(displayConditionTemplate, { formula: filterValue.formula }),
1477
+ formula: fillTemplateString(displayConditionTemplate, {
1478
+ formula: prepareFormulaForSql(filterValue.formula),
1479
+ }),
1477
1480
  values: ["true"],
1478
1481
  filteringMethod: formulaFilterMethods.EQUAL_TO,
1479
1482
  };
1480
1483
  }
1481
- var formula = filterValue.formula, filteringMethod = filterValue.filteringMethod;
1482
- var dbDataType = filterValue.dbDataType;
1484
+ var filteringMethod = filterValue.filteringMethod, sliceIndex = filterValue.sliceIndex;
1485
+ var formula = filterValue.formula, dbDataType = filterValue.dbDataType;
1486
+ if (typeof sliceIndex === "number") {
1487
+ var _a = parseClickHouseType(dbDataType), dbBaseDataType = _a.dbBaseDataType, containers = _a.containers;
1488
+ if (!containers.includes("Array") || !dbBaseDataType) {
1489
+ throw new Error("Incorrect dbDataType: ".concat(dbDataType));
1490
+ }
1491
+ dbDataType = dbBaseDataType;
1492
+ formula = applyIndexToArrayFormula(formula, sliceIndex);
1493
+ }
1483
1494
  if (filteringMethod === formulaFilterMethods.IN_RANGE ||
1484
1495
  filteringMethod === formulaFilterMethods.NOT_IN_RANGE) {
1485
1496
  var simpleType = parseClickHouseType(dbDataType).simpleType;
@@ -2002,4 +2013,4 @@ var getColorByIndex = function (index) {
2002
2013
  return color;
2003
2014
  };
2004
2015
 
2005
- export { EActionButtonsTypes, EActionTypes, EAutoUpdateMode, EBlockingConditionMode, 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, 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, measureAggregationTemplates, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
2016
+ export { EActionButtonsTypes, EActionTypes, EAutoUpdateMode, EBlockingConditionMode, 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, measureAggregationTemplates, 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
@@ -1467,6 +1467,7 @@ var getFormulaFilterValues = function (filterValue) {
1467
1467
  }
1468
1468
  return [];
1469
1469
  };
1470
+ var applyIndexToArrayFormula = function (formula, index) { return "".concat(formula, "[").concat(index, "]"); };
1470
1471
  var mapFormulaFilterToCalculatorInput = function (filterValue) {
1471
1472
  if (!filterValue) {
1472
1473
  return null;
@@ -1474,13 +1475,23 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
1474
1475
  if (!isFormulaFilterValue(filterValue)) {
1475
1476
  return {
1476
1477
  dbDataType: exports.EClickHouseBaseTypes.Bool,
1477
- formula: fillTemplateString(displayConditionTemplate, { formula: filterValue.formula }),
1478
+ formula: fillTemplateString(displayConditionTemplate, {
1479
+ formula: prepareFormulaForSql(filterValue.formula),
1480
+ }),
1478
1481
  values: ["true"],
1479
1482
  filteringMethod: formulaFilterMethods.EQUAL_TO,
1480
1483
  };
1481
1484
  }
1482
- var formula = filterValue.formula, filteringMethod = filterValue.filteringMethod;
1483
- var dbDataType = filterValue.dbDataType;
1485
+ var filteringMethod = filterValue.filteringMethod, sliceIndex = filterValue.sliceIndex;
1486
+ var formula = filterValue.formula, dbDataType = filterValue.dbDataType;
1487
+ if (typeof sliceIndex === "number") {
1488
+ var _a = parseClickHouseType(dbDataType), dbBaseDataType = _a.dbBaseDataType, containers = _a.containers;
1489
+ if (!containers.includes("Array") || !dbBaseDataType) {
1490
+ throw new Error("Incorrect dbDataType: ".concat(dbDataType));
1491
+ }
1492
+ dbDataType = dbBaseDataType;
1493
+ formula = applyIndexToArrayFormula(formula, sliceIndex);
1494
+ }
1484
1495
  if (filteringMethod === formulaFilterMethods.IN_RANGE ||
1485
1496
  filteringMethod === formulaFilterMethods.NOT_IN_RANGE) {
1486
1497
  var simpleType = parseClickHouseType(dbDataType).simpleType;
@@ -2011,6 +2022,7 @@ Object.defineProperty(exports, "EFilteringMethodValues", {
2011
2022
  enumerable: true,
2012
2023
  get: function () { return baseFilter.EFilteringMethodValues; }
2013
2024
  });
2025
+ exports.applyIndexToArrayFormula = applyIndexToArrayFormula;
2014
2026
  exports.bindContentWithIndicator = bindContentWithIndicator;
2015
2027
  exports.bindContentsWithIndicators = bindContentsWithIndicators;
2016
2028
  exports.checkDisplayCondition = checkDisplayCondition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "5.15.0",
3
+ "version": "5.17.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",