@infomaximum/widget-sdk 3.26.0 → 3.27.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/dist/index.d.ts +64 -8
- package/dist/index.esm.js +22 -4
- package/dist/index.js +21 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -79,6 +79,9 @@ interface ICalculatorIndicatorOutput {
|
|
|
79
79
|
interface ICalculatorDimensionInput extends ICalculatorIndicatorInput {
|
|
80
80
|
formula: string;
|
|
81
81
|
hideEmpty?: boolean;
|
|
82
|
+
/** Временно поддерживается обратная совместимость с форматом { alias: string; formula: string }[] */
|
|
83
|
+
/** Появилась необходимость в ленточном графике, т.к. разрез длительность используется, как мера */
|
|
84
|
+
additionalFormulas?: Map<string, string>;
|
|
82
85
|
}
|
|
83
86
|
interface ICalculatorDimensionOutput extends ICalculatorIndicatorOutput {
|
|
84
87
|
}
|
|
@@ -425,25 +428,62 @@ type TWidgetFiltering = {
|
|
|
425
428
|
mode: EWidgetFilterMode;
|
|
426
429
|
};
|
|
427
430
|
declare enum EColorMode {
|
|
431
|
+
DISABLED = "DISABLED",
|
|
428
432
|
FORMULA = "FORMULA",
|
|
429
433
|
BASE = "BASE",
|
|
430
434
|
GRADIENT = "GRADIENT",
|
|
431
|
-
AUTO = "AUTO"
|
|
435
|
+
AUTO = "AUTO",
|
|
436
|
+
RULE = "RULE",
|
|
437
|
+
VALUES = "VALUES",
|
|
438
|
+
BY_DIMENSION = "BY_DIMENSION"
|
|
432
439
|
}
|
|
433
|
-
|
|
434
|
-
type TColor = {
|
|
435
|
-
mode: EColorMode.FORMULA;
|
|
436
|
-
formula: string;
|
|
437
|
-
} | {
|
|
440
|
+
type TColorBase = {
|
|
438
441
|
mode: EColorMode.BASE;
|
|
439
442
|
value?: string;
|
|
440
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;
|
|
441
455
|
} | {
|
|
456
|
+
scope: EColorScope.WORKSPACE;
|
|
457
|
+
workspaceGroupId: number | null;
|
|
458
|
+
}) & TColorRuleCommon;
|
|
459
|
+
interface IColoredValue {
|
|
460
|
+
value: string;
|
|
461
|
+
color: TColorBase | TColorRule;
|
|
462
|
+
}
|
|
463
|
+
declare enum EMarkdownDisplayMode {
|
|
464
|
+
NONE = "NONE",
|
|
465
|
+
INDICATOR = "INDICATOR"
|
|
466
|
+
}
|
|
467
|
+
/** Настройка цвета */
|
|
468
|
+
type TColor = {
|
|
469
|
+
mode: EColorMode.FORMULA;
|
|
470
|
+
formula: string;
|
|
471
|
+
} | TColorBase | {
|
|
442
472
|
mode: EColorMode.GRADIENT;
|
|
443
473
|
startValue: string;
|
|
444
474
|
endValue: string;
|
|
445
475
|
} | {
|
|
446
476
|
mode: EColorMode.AUTO;
|
|
477
|
+
} | TColorRule | {
|
|
478
|
+
mode: EColorMode.VALUES;
|
|
479
|
+
dimensionFormula: string;
|
|
480
|
+
items: IColoredValue[];
|
|
481
|
+
} | {
|
|
482
|
+
mode: EColorMode.BY_DIMENSION;
|
|
483
|
+
dimensionName: string;
|
|
484
|
+
items: IColoredValue[];
|
|
485
|
+
} | {
|
|
486
|
+
mode: EColorMode.DISABLED;
|
|
447
487
|
};
|
|
448
488
|
declare enum EDisplayConditionMode {
|
|
449
489
|
DISABLED = "DISABLED",
|
|
@@ -622,6 +662,10 @@ interface IWidgetDimension extends IWidgetColumnIndicator {
|
|
|
622
662
|
interface IWidgetMeasure extends IWidgetColumnIndicator {
|
|
623
663
|
type: EWidgetIndicatorType.MEASURE;
|
|
624
664
|
}
|
|
665
|
+
interface IMarkdownMeasure extends IWidgetMeasure {
|
|
666
|
+
format: EFormatTypes;
|
|
667
|
+
displayMode: EMarkdownDisplayMode;
|
|
668
|
+
}
|
|
625
669
|
/** Тип показателя */
|
|
626
670
|
declare enum EIndicatorType {
|
|
627
671
|
/** Показатели процесса */
|
|
@@ -709,6 +753,9 @@ interface IWidgetTable {
|
|
|
709
753
|
* full - полный
|
|
710
754
|
*/
|
|
711
755
|
type TDisplayMode = "preview" | "full";
|
|
756
|
+
interface IDisplayRule {
|
|
757
|
+
color: TColor;
|
|
758
|
+
}
|
|
712
759
|
interface IWidgetsContext {
|
|
713
760
|
/** используемый язык в системе */
|
|
714
761
|
language: ELanguages;
|
|
@@ -731,6 +778,8 @@ interface IWidgetsContext {
|
|
|
731
778
|
userLogin: string;
|
|
732
779
|
scripts: Map<string, IActionScript>;
|
|
733
780
|
tables: Set<string>;
|
|
781
|
+
reportDisplayRules: Map<string, IDisplayRule>;
|
|
782
|
+
workspaceDisplayRules: Map<number, Map<string, IDisplayRule>>;
|
|
734
783
|
}
|
|
735
784
|
|
|
736
785
|
declare enum EWidgetActionInputMode {
|
|
@@ -785,6 +834,9 @@ interface IBaseWidgetSettings {
|
|
|
785
834
|
type: string;
|
|
786
835
|
header?: string;
|
|
787
836
|
headerSize?: number;
|
|
837
|
+
showMarkdown?: boolean;
|
|
838
|
+
markdownMeasures?: IMarkdownMeasure[];
|
|
839
|
+
markdownText?: string;
|
|
788
840
|
stateGuid?: string | null;
|
|
789
841
|
filters?: (IFormulaFilterValue | string)[];
|
|
790
842
|
filterMode?: EWidgetFilterMode;
|
|
@@ -870,6 +922,10 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
|
|
|
870
922
|
}
|
|
871
923
|
/** Конфигурация левой панели */
|
|
872
924
|
interface IPanelDescription<Settings extends object, GroupSettings extends IGroupSettings = IGroupSettings> {
|
|
925
|
+
/** Добавить заголовок для виджета */
|
|
926
|
+
useHeader?: boolean;
|
|
927
|
+
/** Добавить описание для виджета */
|
|
928
|
+
useMarkdown?: boolean;
|
|
873
929
|
/** Конфигурация настроек данных виджета */
|
|
874
930
|
dataRecords?: TWidgetLevelRecord<Settings>[];
|
|
875
931
|
/** Конфигурация настроек отображения виджета */
|
|
@@ -1121,7 +1177,7 @@ declare const replaceDisplayCondition: <I extends IWidgetColumnIndicator>(dimens
|
|
|
1121
1177
|
declare function mapMeasuresToInputs<T extends IWidgetMeasure>(measures: T[], variables: Map<string, TWidgetVariable>, addFormulas?: (measure: T) => Map<string, string>): ICalculatorMeasureInput[];
|
|
1122
1178
|
|
|
1123
1179
|
/** Конвертировать разрезы виджета во входы для вычислителя */
|
|
1124
|
-
declare function mapDimensionsToInputs(dimensions:
|
|
1180
|
+
declare function mapDimensionsToInputs<T extends IWidgetDimension>(dimensions: T[], variables: Map<string, TWidgetVariable>, addFormulas?: (dimension: T) => Map<string, string>): ICalculatorDimensionInput[];
|
|
1125
1181
|
|
|
1126
1182
|
/** Конвертировать процессные показатели виджета во входы для вычислителя */
|
|
1127
1183
|
declare function mapTransitionMeasuresToInputs<T extends IProcessIndicator>(indicators: T[], process: IWidgetProcess, variables: Map<string, TWidgetVariable>, addFormulas?: (indicator: T) => Map<string, string>): ICalculatorMeasureInput[];
|
|
@@ -1383,4 +1439,4 @@ declare global {
|
|
|
1383
1439
|
}
|
|
1384
1440
|
}
|
|
1385
1441
|
|
|
1386
|
-
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 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 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 };
|
|
1442
|
+
export { ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, 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 IMarkdownMeasure, 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
|
@@ -475,11 +475,25 @@ var EWidgetFilterMode;
|
|
|
475
475
|
})(EWidgetFilterMode || (EWidgetFilterMode = {}));
|
|
476
476
|
var EColorMode;
|
|
477
477
|
(function (EColorMode) {
|
|
478
|
+
EColorMode["DISABLED"] = "DISABLED";
|
|
478
479
|
EColorMode["FORMULA"] = "FORMULA";
|
|
479
480
|
EColorMode["BASE"] = "BASE";
|
|
480
481
|
EColorMode["GRADIENT"] = "GRADIENT";
|
|
481
482
|
EColorMode["AUTO"] = "AUTO";
|
|
483
|
+
EColorMode["RULE"] = "RULE";
|
|
484
|
+
EColorMode["VALUES"] = "VALUES";
|
|
485
|
+
EColorMode["BY_DIMENSION"] = "BY_DIMENSION";
|
|
482
486
|
})(EColorMode || (EColorMode = {}));
|
|
487
|
+
var EColorScope;
|
|
488
|
+
(function (EColorScope) {
|
|
489
|
+
EColorScope["WORKSPACE"] = "WORKSPACE";
|
|
490
|
+
EColorScope["DASHBOARD"] = "DASHBOARD";
|
|
491
|
+
})(EColorScope || (EColorScope = {}));
|
|
492
|
+
var EMarkdownDisplayMode;
|
|
493
|
+
(function (EMarkdownDisplayMode) {
|
|
494
|
+
EMarkdownDisplayMode["NONE"] = "NONE";
|
|
495
|
+
EMarkdownDisplayMode["INDICATOR"] = "INDICATOR";
|
|
496
|
+
})(EMarkdownDisplayMode || (EMarkdownDisplayMode = {}));
|
|
483
497
|
var EDisplayConditionMode;
|
|
484
498
|
(function (EDisplayConditionMode) {
|
|
485
499
|
EDisplayConditionMode["DISABLED"] = "DISABLED";
|
|
@@ -755,7 +769,8 @@ function mapMeasuresToInputs(measures, variables, addFormulas) {
|
|
|
755
769
|
return compactMap(measures, function (measure) { return mapMeasureToInput(measure, variables, addFormulas); });
|
|
756
770
|
}
|
|
757
771
|
|
|
758
|
-
function mapDimensionToInput(dimension, variables) {
|
|
772
|
+
function mapDimensionToInput(dimension, variables, addFormulas) {
|
|
773
|
+
if (addFormulas === void 0) { addFormulas = function () { return new Map(); }; }
|
|
759
774
|
var formula = getDimensionFormula(dimension);
|
|
760
775
|
if (!formula) {
|
|
761
776
|
return null;
|
|
@@ -769,11 +784,14 @@ function mapDimensionToInput(dimension, variables) {
|
|
|
769
784
|
dataType: dimension.dataType,
|
|
770
785
|
hideEmpty: dimension.hideEmptyValues,
|
|
771
786
|
displayConditionFormula: getDisplayConditionFormula(dimension.displayCondition),
|
|
787
|
+
additionalFormulas: addFormulas(dimension),
|
|
772
788
|
};
|
|
773
789
|
}
|
|
774
790
|
/** Конвертировать разрезы виджета во входы для вычислителя */
|
|
775
|
-
function mapDimensionsToInputs(dimensions, variables) {
|
|
776
|
-
return compactMap(dimensions, function (dimension) {
|
|
791
|
+
function mapDimensionsToInputs(dimensions, variables, addFormulas) {
|
|
792
|
+
return compactMap(dimensions, function (dimension) {
|
|
793
|
+
return mapDimensionToInput(dimension, variables, addFormulas);
|
|
794
|
+
});
|
|
777
795
|
}
|
|
778
796
|
|
|
779
797
|
function mapTransitionMeasureToInput(indicator, process, variables, addFormulas) {
|
|
@@ -1048,4 +1066,4 @@ var getLocalizedText = function (language, locObj, props) {
|
|
|
1048
1066
|
return localization.getLocalized(locObj, props);
|
|
1049
1067
|
};
|
|
1050
1068
|
|
|
1051
|
-
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 };
|
|
1069
|
+
export { ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, 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
|
@@ -476,11 +476,25 @@ exports.EWidgetFilterMode = void 0;
|
|
|
476
476
|
})(exports.EWidgetFilterMode || (exports.EWidgetFilterMode = {}));
|
|
477
477
|
exports.EColorMode = void 0;
|
|
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
|
})(exports.EColorMode || (exports.EColorMode = {}));
|
|
488
|
+
exports.EColorScope = void 0;
|
|
489
|
+
(function (EColorScope) {
|
|
490
|
+
EColorScope["WORKSPACE"] = "WORKSPACE";
|
|
491
|
+
EColorScope["DASHBOARD"] = "DASHBOARD";
|
|
492
|
+
})(exports.EColorScope || (exports.EColorScope = {}));
|
|
493
|
+
exports.EMarkdownDisplayMode = void 0;
|
|
494
|
+
(function (EMarkdownDisplayMode) {
|
|
495
|
+
EMarkdownDisplayMode["NONE"] = "NONE";
|
|
496
|
+
EMarkdownDisplayMode["INDICATOR"] = "INDICATOR";
|
|
497
|
+
})(exports.EMarkdownDisplayMode || (exports.EMarkdownDisplayMode = {}));
|
|
484
498
|
exports.EDisplayConditionMode = void 0;
|
|
485
499
|
(function (EDisplayConditionMode) {
|
|
486
500
|
EDisplayConditionMode["DISABLED"] = "DISABLED";
|
|
@@ -756,7 +770,8 @@ function mapMeasuresToInputs(measures, variables, addFormulas) {
|
|
|
756
770
|
return compactMap(measures, function (measure) { return mapMeasureToInput(measure, variables, addFormulas); });
|
|
757
771
|
}
|
|
758
772
|
|
|
759
|
-
function mapDimensionToInput(dimension, variables) {
|
|
773
|
+
function mapDimensionToInput(dimension, variables, addFormulas) {
|
|
774
|
+
if (addFormulas === void 0) { addFormulas = function () { return new Map(); }; }
|
|
760
775
|
var formula = getDimensionFormula(dimension);
|
|
761
776
|
if (!formula) {
|
|
762
777
|
return null;
|
|
@@ -770,11 +785,14 @@ function mapDimensionToInput(dimension, variables) {
|
|
|
770
785
|
dataType: dimension.dataType,
|
|
771
786
|
hideEmpty: dimension.hideEmptyValues,
|
|
772
787
|
displayConditionFormula: getDisplayConditionFormula(dimension.displayCondition),
|
|
788
|
+
additionalFormulas: addFormulas(dimension),
|
|
773
789
|
};
|
|
774
790
|
}
|
|
775
791
|
/** Конвертировать разрезы виджета во входы для вычислителя */
|
|
776
|
-
function mapDimensionsToInputs(dimensions, variables) {
|
|
777
|
-
return compactMap(dimensions, function (dimension) {
|
|
792
|
+
function mapDimensionsToInputs(dimensions, variables, addFormulas) {
|
|
793
|
+
return compactMap(dimensions, function (dimension) {
|
|
794
|
+
return mapDimensionToInput(dimension, variables, addFormulas);
|
|
795
|
+
});
|
|
778
796
|
}
|
|
779
797
|
|
|
780
798
|
function mapTransitionMeasureToInput(indicator, process, variables, addFormulas) {
|