@infomaximum/widget-sdk 3.14.0 → 3.15.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 +4 -2
- package/dist/index.esm.js +15 -1
- package/dist/index.js +16 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ELanguages } from '@infomaximum/localization';
|
|
1
|
+
import { ELanguages, TLocalizationDescription, ILocalizationProps, TExtractLocalizationParams } from '@infomaximum/localization';
|
|
2
2
|
export { ELanguages } from '@infomaximum/localization';
|
|
3
3
|
export { EFilteringMethodValues } from '@infomaximum/base-filter';
|
|
4
4
|
|
|
@@ -1279,10 +1279,12 @@ declare const updateSingleModeSelection: TUpdateSelection;
|
|
|
1279
1279
|
declare const updateMultiModeSelection: TUpdateSelection;
|
|
1280
1280
|
declare const replaceFiltersBySelection: (filters: ICalculatorFilter[], selection: IDimensionSelectionByFormula) => ICalculatorFilter[];
|
|
1281
1281
|
|
|
1282
|
+
declare const getLocalized: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P | undefined) => string;
|
|
1283
|
+
|
|
1282
1284
|
declare global {
|
|
1283
1285
|
interface Infomaximum {
|
|
1284
1286
|
defineWidget: <WidgetSettings extends IBaseWidgetSettings, GroupSettings extends IGroupSettings>(uuid: string, Widget: IWidgetEntity<WidgetSettings, GroupSettings>) => void;
|
|
1285
1287
|
}
|
|
1286
1288
|
}
|
|
1287
1289
|
|
|
1288
|
-
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 TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TGroupLevelRecord, 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, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
|
|
1290
|
+
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 TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TGroupLevelRecord, 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, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalized, 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Localization } from '@infomaximum/localization';
|
|
1
2
|
export { ELanguages } from '@infomaximum/localization';
|
|
2
3
|
export { EFilteringMethodValues } from '@infomaximum/base-filter';
|
|
3
4
|
|
|
@@ -963,4 +964,17 @@ var replaceFiltersBySelection = function (filters, selection) {
|
|
|
963
964
|
}, []);
|
|
964
965
|
};
|
|
965
966
|
|
|
966
|
-
|
|
967
|
+
var localization = null;
|
|
968
|
+
var supportedLanguages = [Localization.Language.ru, Localization.Language.en];
|
|
969
|
+
var getLocalized = function (language, locObj, props) {
|
|
970
|
+
if (!localization || localization.getLanguage() !== language) {
|
|
971
|
+
var isSupportLanguage = supportedLanguages.includes(language);
|
|
972
|
+
!isSupportLanguage &&
|
|
973
|
+
console.error("An unsupported \"".concat(language, "\" language has been passed. The default language is English"));
|
|
974
|
+
var lang = isSupportLanguage ? language : Localization.Language.en;
|
|
975
|
+
localization = new Localization({ language: lang });
|
|
976
|
+
}
|
|
977
|
+
return localization.getLocalized(locObj, props);
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
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, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalized, 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var localization = require('@infomaximum/localization');
|
|
3
|
+
var localization$1 = require('@infomaximum/localization');
|
|
4
4
|
var baseFilter = require('@infomaximum/base-filter');
|
|
5
5
|
|
|
6
6
|
/******************************************************************************
|
|
@@ -965,9 +965,22 @@ var replaceFiltersBySelection = function (filters, selection) {
|
|
|
965
965
|
}, []);
|
|
966
966
|
};
|
|
967
967
|
|
|
968
|
+
var localization = null;
|
|
969
|
+
var supportedLanguages = [localization$1.Localization.Language.ru, localization$1.Localization.Language.en];
|
|
970
|
+
var getLocalized = function (language, locObj, props) {
|
|
971
|
+
if (!localization || localization.getLanguage() !== language) {
|
|
972
|
+
var isSupportLanguage = supportedLanguages.includes(language);
|
|
973
|
+
!isSupportLanguage &&
|
|
974
|
+
console.error("An unsupported \"".concat(language, "\" language has been passed. The default language is English"));
|
|
975
|
+
var lang = isSupportLanguage ? language : localization$1.Localization.Language.en;
|
|
976
|
+
localization = new localization$1.Localization({ language: lang });
|
|
977
|
+
}
|
|
978
|
+
return localization.getLocalized(locObj, props);
|
|
979
|
+
};
|
|
980
|
+
|
|
968
981
|
Object.defineProperty(exports, 'ELanguages', {
|
|
969
982
|
enumerable: true,
|
|
970
|
-
get: function () { return localization.ELanguages; }
|
|
983
|
+
get: function () { return localization$1.ELanguages; }
|
|
971
984
|
});
|
|
972
985
|
Object.defineProperty(exports, 'EFilteringMethodValues', {
|
|
973
986
|
enumerable: true,
|
|
@@ -984,6 +997,7 @@ exports.generateColumnFormula = generateColumnFormula;
|
|
|
984
997
|
exports.getDimensionFormula = getDimensionFormula;
|
|
985
998
|
exports.getDisplayConditionFormula = getDisplayConditionFormula;
|
|
986
999
|
exports.getEventMeasureFormula = getEventMeasureFormula;
|
|
1000
|
+
exports.getLocalized = getLocalized;
|
|
987
1001
|
exports.getMeasureFormula = getMeasureFormula;
|
|
988
1002
|
exports.getTransitionMeasureFormula = getTransitionMeasureFormula;
|
|
989
1003
|
exports.isActionValid = isActionValid;
|