@infomaximum/widget-sdk 3.23.0 → 3.25.0-24.3.01-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -34,7 +34,8 @@ declare enum EControlType {
34
34
  eventsColor = "eventsColor",
35
35
  inputMarkdown = "inputMarkdown",
36
36
  filter = "filter",
37
- actionOnClick = "actionOnClick"
37
+ actionOnClick = "actionOnClick",
38
+ eventsPicker = "eventsPicker"
38
39
  }
39
40
  /** Конфигурация элемента управления настройкой */
40
41
  interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
@@ -78,6 +79,9 @@ interface ICalculatorIndicatorOutput {
78
79
  interface ICalculatorDimensionInput extends ICalculatorIndicatorInput {
79
80
  formula: string;
80
81
  hideEmpty?: boolean;
82
+ /** Временно поддерживается обратная совместимость с форматом { alias: string; formula: string }[] */
83
+ /** Появилась необходимость в ленточном графике, т.к. разрез длительность используется, как мера */
84
+ additionalFormulas?: Map<string, string>;
81
85
  }
82
86
  interface ICalculatorDimensionOutput extends ICalculatorIndicatorOutput {
83
87
  }
@@ -260,6 +264,7 @@ declare enum EDurationUnit {
260
264
  declare const mapFormulaFilterToCalculatorInput: (filterValue: IFormulaFilterValue | string) => TNullable<ICalculatorFilter>;
261
265
  declare const mapFormulaFiltersToInputs: (filters: (string | IFormulaFilterValue)[]) => ICalculatorFilter[];
262
266
 
267
+ type TSelectivePartial<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
263
268
  declare const formulaFilterMethods: {
264
269
  readonly LAST_TIME: "LAST_TIME";
265
270
  readonly EQUAL_TO: ECalculatorFilterMethods.EQUAL_TO;
@@ -289,6 +294,7 @@ declare enum EProcessFilterNames {
289
294
  /** Длительность перехода */
290
295
  durationOfTransition = "durationOfTransition"
291
296
  }
297
+ /** @deprecated необходимо использовать @see {@link IFormulaFilterValue} */
292
298
  interface IWidgetFormulaFilterValue extends ICalculatorFilter {
293
299
  /**
294
300
  * Название фильтра
@@ -329,15 +335,6 @@ interface IAddPresenceOfTransitionFilter {
329
335
  interface IAddDurationOfTransitionFilter {
330
336
  (name: EProcessFilterNames.durationOfTransition, value: IProcessTransitionFilterValue): void;
331
337
  }
332
- interface IWidgetFiltration {
333
- /** Значения фильтров, подготовленные для передачи в вычислитель */
334
- preparedFilterValues: ICalculatorFilter[];
335
- /** Добавить фильтр по формуле */
336
- addFormulaFilter(value: IWidgetFormulaFilterValue): void;
337
- /** Удалить фильтр по формуле */
338
- removeFormulaFilter(formula: string): void;
339
- addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
340
- }
341
338
  declare enum EFormulaFilterFieldKeys {
342
339
  date = "date",
343
340
  dateRange = "dateRange",
@@ -361,7 +358,7 @@ interface IFormulaFilterValue {
361
358
  /** Метод фильтрации */
362
359
  filteringMethod: valueof<typeof formulaFilterMethods>;
363
360
  /** Выбранные в списке значения в виде моделей */
364
- checkedValues: string[];
361
+ checkedValues: (string | null)[];
365
362
  /** Значения полей формы редактора */
366
363
  formValues: Partial<{
367
364
  [EFormulaFilterFieldKeys.date]: string | null;
@@ -375,6 +372,40 @@ interface IFormulaFilterValue {
375
372
  [EFormulaFilterFieldKeys.durationUnit]: EDurationUnit;
376
373
  }>;
377
374
  }
375
+ interface IStagesFilterItem {
376
+ /** Название этапа */
377
+ name: string;
378
+ /** Формула фильтра этапа */
379
+ formula: string;
380
+ isSelected: boolean;
381
+ }
382
+ interface IStagesFilterValue {
383
+ /** Ключ виджета */
384
+ widgetKey: string;
385
+ /** Заголовок фильтра */
386
+ name: TNullable<string>;
387
+ /** Этапы */
388
+ stages: IStagesFilterItem[];
389
+ }
390
+ type TWidgetFilterValue = IFormulaFilterValue | IStagesFilterValue | IProcessEventFilterValue | IProcessTransitionFilterValue;
391
+ interface IWidgetFilter {
392
+ filterValue: TWidgetFilterValue;
393
+ preparedFilterValue: ICalculatorFilter;
394
+ }
395
+ interface IWidgetFiltration {
396
+ /** Значения фильтров, подготовленные для передачи в вычислитель */
397
+ preparedFilterValues: ICalculatorFilter[];
398
+ filters: IWidgetFilter[];
399
+ /** Добавить фильтр по формуле */
400
+ addFormulaFilter(value: IWidgetFormulaFilterValue | TSelectivePartial<IFormulaFilterValue, "format" | "formValues">): void;
401
+ /** Удалить фильтр по формуле */
402
+ removeFormulaFilter(formula: string): void;
403
+ addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
404
+ /** Добавить фильтр по этапам */
405
+ addStagesFilter(value: Omit<IStagesFilterValue, "widgetKey">): void;
406
+ /** Удалить фильтр по этапам */
407
+ removeStagesFilter(widgetKey: string): void;
408
+ }
378
409
 
379
410
  interface IPlacement {
380
411
  left: number;
@@ -397,25 +428,58 @@ type TWidgetFiltering = {
397
428
  mode: EWidgetFilterMode;
398
429
  };
399
430
  declare enum EColorMode {
431
+ DISABLED = "DISABLED",
400
432
  FORMULA = "FORMULA",
401
433
  BASE = "BASE",
402
434
  GRADIENT = "GRADIENT",
403
- AUTO = "AUTO"
435
+ AUTO = "AUTO",
436
+ RULE = "RULE",
437
+ VALUES = "VALUES",
438
+ BY_DIMENSION = "BY_DIMENSION"
404
439
  }
405
- /** Настройка цвета */
406
- type TColor = {
407
- mode: EColorMode.FORMULA;
408
- formula: string;
409
- } | {
440
+ type TColorBase = {
410
441
  mode: EColorMode.BASE;
411
442
  value?: string;
412
443
  defaultColor?: string;
444
+ };
445
+ declare enum EColorScope {
446
+ WORKSPACE = "WORKSPACE",
447
+ DASHBOARD = "DASHBOARD"
448
+ }
449
+ type TColorRuleCommon = {
450
+ mode: EColorMode.RULE;
451
+ ruleName: string;
452
+ };
453
+ type TColorRule = ({
454
+ scope: EColorScope.DASHBOARD | null;
413
455
  } | {
456
+ scope: EColorScope.WORKSPACE;
457
+ workspaceGroupId: number | null;
458
+ }) & TColorRuleCommon;
459
+ interface IColoredValue {
460
+ value: string;
461
+ color: TColorBase | TColorRule;
462
+ }
463
+ /** Настройка цвета */
464
+ type TColor = {
465
+ mode: EColorMode.FORMULA;
466
+ formula: string;
467
+ } | TColorBase | {
414
468
  mode: EColorMode.GRADIENT;
415
469
  startValue: string;
416
470
  endValue: string;
417
471
  } | {
418
472
  mode: EColorMode.AUTO;
473
+ } | TColorRule | {
474
+ mode: EColorMode.VALUES;
475
+ dimensionFormula: string;
476
+ items: IColoredValue[];
477
+ } | {
478
+ mode: EColorMode.BY_DIMENSION;
479
+ dimensionName: string;
480
+ items: IColoredValue[];
481
+ } | {
482
+ mode: EColorMode.DISABLED;
419
483
  };
420
484
  declare enum EDisplayConditionMode {
421
485
  DISABLED = "DISABLED",
@@ -680,6 +744,9 @@ interface IWidgetTable {
680
744
  * full - полный
681
745
  */
682
746
  type TDisplayMode = "preview" | "full";
747
+ interface IDisplayRule {
748
+ color: TColor;
749
+ }
683
750
  interface IWidgetsContext {
684
751
  /** используемый язык в системе */
685
752
  language: ELanguages;
@@ -702,6 +769,8 @@ interface IWidgetsContext {
702
769
  userLogin: string;
703
770
  scripts: Map<string, IActionScript>;
704
771
  tables: Set<string>;
772
+ reportDisplayRules: Map<string, IDisplayRule>;
773
+ workspaceDisplayRules: Map<number, Map<string, IDisplayRule>>;
705
774
  }
706
775
 
707
776
  declare enum EWidgetActionInputMode {
@@ -1092,7 +1161,7 @@ declare const replaceDisplayCondition: <I extends IWidgetColumnIndicator>(dimens
1092
1161
  declare function mapMeasuresToInputs<T extends IWidgetMeasure>(measures: T[], variables: Map<string, TWidgetVariable>, addFormulas?: (measure: T) => Map<string, string>): ICalculatorMeasureInput[];
1093
1162
 
1094
1163
  /** Конвертировать разрезы виджета во входы для вычислителя */
1095
- declare function mapDimensionsToInputs(dimensions: IWidgetDimension[], variables: Map<string, TWidgetVariable>): ICalculatorDimensionInput[];
1164
+ declare function mapDimensionsToInputs<T extends IWidgetDimension>(dimensions: T[], variables: Map<string, TWidgetVariable>, addFormulas?: (dimension: T) => Map<string, string>): ICalculatorDimensionInput[];
1096
1165
 
1097
1166
  /** Конвертировать процессные показатели виджета во входы для вычислителя */
1098
1167
  declare function mapTransitionMeasuresToInputs<T extends IProcessIndicator>(indicators: T[], process: IWidgetProcess, variables: Map<string, TWidgetVariable>, addFormulas?: (indicator: T) => Map<string, string>): ICalculatorMeasureInput[];
@@ -1338,7 +1407,7 @@ declare const replaceFiltersBySelection: (filters: ICalculatorFilter[], selectio
1338
1407
  * @param {P} [props] - Дополнительные параметры локализации.
1339
1408
  * @returns {string} - Локализованный текст для указанного языка.
1340
1409
  */
1341
- declare const getLocalizedText: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P | undefined) => string;
1410
+ declare const getLocalizedText: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P) => string;
1342
1411
 
1343
1412
  type TDefineWidgetOptions = {
1344
1413
  manifest?: Record<string, unknown>;
@@ -1354,4 +1423,4 @@ declare global {
1354
1423
  }
1355
1424
  }
1356
1425
 
1357
- export { ECalculatorFilterMethods, EColorMode, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionScript, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, 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 ICalculatorVariable, type ICalculatorVariablesValues, type ICommonColumnIndicator, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILens, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IPlacement, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectOption, type ISortOrder, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetAction, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetMeasure, type IWidgetPlaceholderController, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TBoundedContentWithIndicator, type TColor, type TColumnIndicatorValue, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TGroupLevelRecord, type TLaunchActionParams, type TProcessIndicatorValue, type TRecordAccessor, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionInputValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetSortingValueRelatedWidgetDimension, type TWidgetSortingValueRelatedWidgetIndicator, type TWidgetSortingValueRelatedWidgetMeasure, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
1426
+ export { ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionScript, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, 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 ICalculatorVariable, type ICalculatorVariablesValues, type IColoredValue, type ICommonColumnIndicator, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILens, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IPlacement, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectOption, type ISortOrder, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetAction, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetMeasure, type IWidgetPlaceholderController, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TBoundedContentWithIndicator, type TColor, type TColorRule, type TColumnIndicatorValue, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TGroupLevelRecord, type TLaunchActionParams, type TProcessIndicatorValue, type TRecordAccessor, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionInputValue, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetSortingValueRelatedWidgetDimension, type TWidgetSortingValueRelatedWidgetIndicator, type TWidgetSortingValueRelatedWidgetMeasure, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
package/dist/index.esm.js CHANGED
@@ -476,11 +476,20 @@ var EWidgetFilterMode;
476
476
  })(EWidgetFilterMode || (EWidgetFilterMode = {}));
477
477
  var EColorMode;
478
478
  (function (EColorMode) {
479
+ EColorMode["DISABLED"] = "DISABLED";
479
480
  EColorMode["FORMULA"] = "FORMULA";
480
481
  EColorMode["BASE"] = "BASE";
481
482
  EColorMode["GRADIENT"] = "GRADIENT";
482
483
  EColorMode["AUTO"] = "AUTO";
484
+ EColorMode["RULE"] = "RULE";
485
+ EColorMode["VALUES"] = "VALUES";
486
+ EColorMode["BY_DIMENSION"] = "BY_DIMENSION";
483
487
  })(EColorMode || (EColorMode = {}));
488
+ var EColorScope;
489
+ (function (EColorScope) {
490
+ EColorScope["WORKSPACE"] = "WORKSPACE";
491
+ EColorScope["DASHBOARD"] = "DASHBOARD";
492
+ })(EColorScope || (EColorScope = {}));
484
493
  var EDisplayConditionMode;
485
494
  (function (EDisplayConditionMode) {
486
495
  EDisplayConditionMode["DISABLED"] = "DISABLED";
@@ -760,7 +769,8 @@ function mapMeasuresToInputs(measures, variables, addFormulas) {
760
769
  });
761
770
  }
762
771
 
763
- function mapDimensionToInput(dimension, variables) {
772
+ function mapDimensionToInput(dimension, variables, addFormulas) {
773
+ if (addFormulas === void 0) { addFormulas = function () { return new Map(); }; }
764
774
  var formula = getDimensionFormula(dimension);
765
775
  if (!formula) {
766
776
  return null;
@@ -774,12 +784,13 @@ function mapDimensionToInput(dimension, variables) {
774
784
  dataType: dimension.dataType,
775
785
  hideEmpty: dimension.hideEmptyValues,
776
786
  displayConditionFormula: getDisplayConditionFormula(dimension.displayCondition),
787
+ additionalFormulas: addFormulas(dimension),
777
788
  };
778
789
  }
779
790
  /** Конвертировать разрезы виджета во входы для вычислителя */
780
- function mapDimensionsToInputs(dimensions, variables) {
791
+ function mapDimensionsToInputs(dimensions, variables, addFormulas) {
781
792
  return compactMap(dimensions, function (dimension) {
782
- return mapDimensionToInput(dimension, variables);
793
+ return mapDimensionToInput(dimension, variables, addFormulas);
783
794
  });
784
795
  }
785
796
 
@@ -941,6 +952,7 @@ var EControlType;
941
952
  EControlType["inputMarkdown"] = "inputMarkdown";
942
953
  EControlType["filter"] = "filter";
943
954
  EControlType["actionOnClick"] = "actionOnClick";
955
+ EControlType["eventsPicker"] = "eventsPicker";
944
956
  })(EControlType || (EControlType = {}));
945
957
 
946
958
  var ESortDirection;
@@ -1045,4 +1057,4 @@ var getLocalizedText = function (language, locObj, props) {
1045
1057
  return localization.getLocalized(locObj, props);
1046
1058
  };
1047
1059
 
1048
- export { ECalculatorFilterMethods, EColorMode, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
1060
+ export { ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
package/dist/index.js CHANGED
@@ -477,11 +477,20 @@ exports.EWidgetFilterMode = void 0;
477
477
  })(exports.EWidgetFilterMode || (exports.EWidgetFilterMode = {}));
478
478
  exports.EColorMode = void 0;
479
479
  (function (EColorMode) {
480
+ EColorMode["DISABLED"] = "DISABLED";
480
481
  EColorMode["FORMULA"] = "FORMULA";
481
482
  EColorMode["BASE"] = "BASE";
482
483
  EColorMode["GRADIENT"] = "GRADIENT";
483
484
  EColorMode["AUTO"] = "AUTO";
485
+ EColorMode["RULE"] = "RULE";
486
+ EColorMode["VALUES"] = "VALUES";
487
+ EColorMode["BY_DIMENSION"] = "BY_DIMENSION";
484
488
  })(exports.EColorMode || (exports.EColorMode = {}));
489
+ exports.EColorScope = void 0;
490
+ (function (EColorScope) {
491
+ EColorScope["WORKSPACE"] = "WORKSPACE";
492
+ EColorScope["DASHBOARD"] = "DASHBOARD";
493
+ })(exports.EColorScope || (exports.EColorScope = {}));
485
494
  exports.EDisplayConditionMode = void 0;
486
495
  (function (EDisplayConditionMode) {
487
496
  EDisplayConditionMode["DISABLED"] = "DISABLED";
@@ -761,7 +770,8 @@ function mapMeasuresToInputs(measures, variables, addFormulas) {
761
770
  });
762
771
  }
763
772
 
764
- function mapDimensionToInput(dimension, variables) {
773
+ function mapDimensionToInput(dimension, variables, addFormulas) {
774
+ if (addFormulas === void 0) { addFormulas = function () { return new Map(); }; }
765
775
  var formula = getDimensionFormula(dimension);
766
776
  if (!formula) {
767
777
  return null;
@@ -775,12 +785,13 @@ function mapDimensionToInput(dimension, variables) {
775
785
  dataType: dimension.dataType,
776
786
  hideEmpty: dimension.hideEmptyValues,
777
787
  displayConditionFormula: getDisplayConditionFormula(dimension.displayCondition),
788
+ additionalFormulas: addFormulas(dimension),
778
789
  };
779
790
  }
780
791
  /** Конвертировать разрезы виджета во входы для вычислителя */
781
- function mapDimensionsToInputs(dimensions, variables) {
792
+ function mapDimensionsToInputs(dimensions, variables, addFormulas) {
782
793
  return compactMap(dimensions, function (dimension) {
783
- return mapDimensionToInput(dimension, variables);
794
+ return mapDimensionToInput(dimension, variables, addFormulas);
784
795
  });
785
796
  }
786
797
 
@@ -942,6 +953,7 @@ exports.EControlType = void 0;
942
953
  EControlType["inputMarkdown"] = "inputMarkdown";
943
954
  EControlType["filter"] = "filter";
944
955
  EControlType["actionOnClick"] = "actionOnClick";
956
+ EControlType["eventsPicker"] = "eventsPicker";
945
957
  })(exports.EControlType || (exports.EControlType = {}));
946
958
 
947
959
  exports.ESortDirection = void 0;
@@ -1046,11 +1058,11 @@ var getLocalizedText = function (language, locObj, props) {
1046
1058
  return localization.getLocalized(locObj, props);
1047
1059
  };
1048
1060
 
1049
- Object.defineProperty(exports, 'ELanguages', {
1061
+ Object.defineProperty(exports, "ELanguages", {
1050
1062
  enumerable: true,
1051
1063
  get: function () { return localization$1.ELanguages; }
1052
1064
  });
1053
- Object.defineProperty(exports, 'EFilteringMethodValues', {
1065
+ Object.defineProperty(exports, "EFilteringMethodValues", {
1054
1066
  enumerable: true,
1055
1067
  get: function () { return baseFilter.EFilteringMethodValues; }
1056
1068
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "3.23.0",
3
+ "version": "3.25.0-24.03.01-1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",