@infomaximum/widget-sdk 4.11.0 → 4.11.2

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
@@ -740,6 +740,7 @@ interface IParameterFromManualInput {
740
740
  inputMethod: EWidgetActionInputMethod.MANUALLY;
741
741
  description: string;
742
742
  defaultValue?: string;
743
+ filterByRows?: boolean;
743
744
  }
744
745
  interface IParameterFromStaticList {
745
746
  inputMethod: EWidgetActionInputMethod.STATIC_LIST;
@@ -752,6 +753,7 @@ interface IParameterFromDynamicList {
752
753
  defaultValue: string;
753
754
  displayOptions: string;
754
755
  filters: TExtendedFormulaFilterValue[];
756
+ filterByRows?: boolean;
755
757
  }
756
758
  interface IWidgetActionParameterCommon {
757
759
  name: string;
@@ -850,12 +852,14 @@ declare enum ESortDirection {
850
852
  type TSortDirection = ESortDirection.ascend | ESortDirection.descend;
851
853
  interface ISortOrder {
852
854
  formula: string;
855
+ dataType?: ESimpleDataType;
853
856
  direction: TSortDirection;
854
857
  displayCondition?: TNullable<string>;
855
858
  }
856
859
  type TWidgetSortingValue = {
857
860
  mode: ESortingValueModes.FORMULA;
858
861
  formula: string;
862
+ dataType?: ESimpleDataType;
859
863
  } | {
860
864
  mode: ESortingValueModes.IN_WIDGET;
861
865
  group: string;
@@ -1708,7 +1712,25 @@ interface IWidgetPlaceholderValues {
1708
1712
  isOverlay: boolean;
1709
1713
  }
1710
1714
 
1711
- interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings extends IGroupSettings> {
1715
+ type TVersion = string;
1716
+ type TMigrationStruct = Record<string, any>;
1717
+ interface IWidgetStruct<Settings extends IBaseWidgetSettings = IBaseWidgetSettings> {
1718
+ key: string;
1719
+ apiVersion: string;
1720
+ type: string;
1721
+ settings: Settings;
1722
+ localApiVersion?: string;
1723
+ }
1724
+ type TMigrateProcessor<T extends TMigrationStruct> = (struct: T) => void;
1725
+ interface ISettingsMigratorParams {
1726
+ versions: ReadonlyArray<TVersion>;
1727
+ defaultVersion?: TVersion;
1728
+ }
1729
+ interface IWidgetMigrator<T extends TMigrationStruct = IWidgetStruct> {
1730
+ registerProcessor(version: TVersion, processor: TMigrateProcessor<T>, type?: string, versionPath?: string): void;
1731
+ }
1732
+
1733
+ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings extends IGroupSettings, MigrationStruct extends TMigrationStruct = IWidgetStruct> {
1712
1734
  /** иконка виджета отображаемая в системе (в base64, svg или png) */
1713
1735
  icon?: string;
1714
1736
  /** возвращает конфигурацию настроек для отображения */
@@ -1717,6 +1739,12 @@ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings
1717
1739
  fillSettings: IFillSettings<WidgetSettings>;
1718
1740
  /** возвращает ключи показателей(разрезов или мер), для которых должна работать системная сортировка */
1719
1741
  getSortableIndicatorsKeys?(): Readonly<StringKeyOf<WidgetSettings>[]>;
1742
+ /** Регистрация системных миграторов виджета */
1743
+ registerSystemMigrateProcessors?(migrator: IWidgetMigrator<MigrationStruct>, globalContext: IGlobalContext): void;
1744
+ /** Регистрация собственных миграторов виджета */
1745
+ registerLocalMigrateProcessors?(migrator: IWidgetMigrator<MigrationStruct>, globalContext: IGlobalContext): void;
1746
+ /** Возвращает массив версий локальных миграций виджета */
1747
+ getLocalMigrateVersions(): string[];
1720
1748
  }
1721
1749
 
1722
1750
  type TContextMenu = (TContextMenuList | TContextMenuButtonGroup) & {
@@ -1977,4 +2005,4 @@ declare global {
1977
2005
  }
1978
2006
  }
1979
2007
 
1980
- export { EActionButtonsTypes, EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, 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 IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, 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 IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectBranchOption, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type IVertex, type IViewContext, type IViewInputValue, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TAppearanceSettings, type TBoundedContentWithIndicator, type TColor, 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 TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorData, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, colors, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareSortOrders, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
2008
+ export { EActionButtonsTypes, EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, 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 IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, 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 IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectBranchOption, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type IVertex, type IViewContext, type IViewInputValue, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, 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 IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TAppearanceSettings, type TBoundedContentWithIndicator, type TColor, 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 TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TVersion, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorData, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, colors, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareSortOrders, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
package/dist/index.esm.js CHANGED
@@ -1093,7 +1093,13 @@ var getDefaultSortOrders = function (_a) {
1093
1093
  ].includes(dimension.format);
1094
1094
  });
1095
1095
  if (timeDimension) {
1096
- return [{ formula: getDimensionFormula(timeDimension), direction: ESortDirection.ascend }];
1096
+ return [
1097
+ {
1098
+ formula: getDimensionFormula(timeDimension),
1099
+ dataType: timeDimension.dataType,
1100
+ direction: ESortDirection.ascend,
1101
+ },
1102
+ ];
1097
1103
  }
1098
1104
  if (measures.length > 0) {
1099
1105
  var firstMeasure = measures[0];
@@ -1102,6 +1108,7 @@ var getDefaultSortOrders = function (_a) {
1102
1108
  {
1103
1109
  direction: ESortDirection.descend,
1104
1110
  formula: getMeasureFormula(firstMeasure),
1111
+ dataType: firstMeasure.dataType,
1105
1112
  },
1106
1113
  ];
1107
1114
  }
@@ -1115,7 +1122,9 @@ function mapSortingToInputs(_a) {
1115
1122
  var _b;
1116
1123
  var direction = _a.direction, value = _a.value;
1117
1124
  if (value.mode === ESortingValueModes.FORMULA) {
1118
- return value.formula ? { formula: value.formula, direction: direction } : undefined;
1125
+ return value.formula
1126
+ ? { formula: value.formula, direction: direction, dataType: value.dataType }
1127
+ : undefined;
1119
1128
  }
1120
1129
  var indicatorsGroup = settings[value.group];
1121
1130
  var indicator = indicatorsGroup === null || indicatorsGroup === void 0 ? void 0 : indicatorsGroup[value.index];
@@ -1133,6 +1142,7 @@ function mapSortingToInputs(_a) {
1133
1142
  return {
1134
1143
  formula: formula,
1135
1144
  direction: direction,
1145
+ dataType: activeDimensions.dataType,
1136
1146
  displayCondition: ((_b = indicator.displayCondition) === null || _b === void 0 ? void 0 : _b.mode) === EDisplayConditionMode.FORMULA
1137
1147
  ? indicator.displayCondition.formula
1138
1148
  : undefined,
@@ -1141,6 +1151,7 @@ function mapSortingToInputs(_a) {
1141
1151
  return {
1142
1152
  formula: getMeasureFormula(indicator),
1143
1153
  direction: direction,
1154
+ dataType: indicator.dataType,
1144
1155
  };
1145
1156
  });
1146
1157
  return sortOrder;
package/dist/index.js CHANGED
@@ -1094,7 +1094,13 @@ var getDefaultSortOrders = function (_a) {
1094
1094
  ].includes(dimension.format);
1095
1095
  });
1096
1096
  if (timeDimension) {
1097
- return [{ formula: getDimensionFormula(timeDimension), direction: exports.ESortDirection.ascend }];
1097
+ return [
1098
+ {
1099
+ formula: getDimensionFormula(timeDimension),
1100
+ dataType: timeDimension.dataType,
1101
+ direction: exports.ESortDirection.ascend,
1102
+ },
1103
+ ];
1098
1104
  }
1099
1105
  if (measures.length > 0) {
1100
1106
  var firstMeasure = measures[0];
@@ -1103,6 +1109,7 @@ var getDefaultSortOrders = function (_a) {
1103
1109
  {
1104
1110
  direction: exports.ESortDirection.descend,
1105
1111
  formula: getMeasureFormula(firstMeasure),
1112
+ dataType: firstMeasure.dataType,
1106
1113
  },
1107
1114
  ];
1108
1115
  }
@@ -1116,7 +1123,9 @@ function mapSortingToInputs(_a) {
1116
1123
  var _b;
1117
1124
  var direction = _a.direction, value = _a.value;
1118
1125
  if (value.mode === exports.ESortingValueModes.FORMULA) {
1119
- return value.formula ? { formula: value.formula, direction: direction } : undefined;
1126
+ return value.formula
1127
+ ? { formula: value.formula, direction: direction, dataType: value.dataType }
1128
+ : undefined;
1120
1129
  }
1121
1130
  var indicatorsGroup = settings[value.group];
1122
1131
  var indicator = indicatorsGroup === null || indicatorsGroup === void 0 ? void 0 : indicatorsGroup[value.index];
@@ -1134,6 +1143,7 @@ function mapSortingToInputs(_a) {
1134
1143
  return {
1135
1144
  formula: formula,
1136
1145
  direction: direction,
1146
+ dataType: activeDimensions.dataType,
1137
1147
  displayCondition: ((_b = indicator.displayCondition) === null || _b === void 0 ? void 0 : _b.mode) === exports.EDisplayConditionMode.FORMULA
1138
1148
  ? indicator.displayCondition.formula
1139
1149
  : undefined,
@@ -1142,6 +1152,7 @@ function mapSortingToInputs(_a) {
1142
1152
  return {
1143
1153
  formula: getMeasureFormula(indicator),
1144
1154
  direction: direction,
1155
+ dataType: indicator.dataType,
1145
1156
  };
1146
1157
  });
1147
1158
  return sortOrder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.11.0",
3
+ "version": "4.11.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",