@infomaximum/widget-sdk 4.0.0-beta65 → 4.0.0-beta66

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
@@ -505,6 +505,8 @@ interface IGlobalContext {
505
505
  workspaceGroupNameById: Map<number, string>;
506
506
  /** Переменные отчета */
507
507
  variables: Map<string, TWidgetVariable>;
508
+ /** Системные переменные */
509
+ systemVariables: Map<string, TSystemVariable>;
508
510
  /** Метод установки значения переменной отчета */
509
511
  setVariableValue(name: string, value: TNullable<string> | string[]): void;
510
512
  states: Map<string, ICommonState>;
@@ -736,7 +738,7 @@ interface IWidgetAction extends IActionCommon {
736
738
  type TAction = TActionsOnClick | IWidgetAction;
737
739
  declare const isExecuteScriptActionValid: (action: Extract<TAction, {
738
740
  type: EActionTypes.EXECUTE_SCRIPT;
739
- }>, { scripts, tables, variables }: Pick<IGlobalContext, "scripts" | "tables" | "variables">) => boolean;
741
+ }>, { scripts, tables, variables, systemVariables, }: Pick<IGlobalContext, "scripts" | "tables" | "variables" | "systemVariables">) => boolean;
740
742
 
741
743
  declare enum ESortDirection {
742
744
  descend = "DESC",
@@ -895,6 +897,14 @@ declare enum EIndicatorType {
895
897
  /** Пользовательская сортировка */
896
898
  USER_SORTING = "USER_SORTING"
897
899
  }
900
+ type TSystemVariable = {
901
+ /** Имя переменной */
902
+ name: string;
903
+ /** Значение */
904
+ value: string;
905
+ /** Тип данных */
906
+ dataType: ESimpleDataType;
907
+ };
898
908
  type TWidgetVariable = {
899
909
  /** Тип переменной */
900
910
  type: EIndicatorType.STATIC;
@@ -1189,15 +1199,6 @@ declare const escapeSpecialCharacters: (formula: string) => string;
1189
1199
  /** Удалить из строки символы экранирования */
1190
1200
  declare function unescapeSpecialCharacters(str: string): string;
1191
1201
 
1192
- /** Вид переменной для калькулятора */
1193
- interface ICalculatorVariable {
1194
- dataType: ESimpleDataType;
1195
- value: string | string[];
1196
- }
1197
- /** Коллекция значений переменных по их имени */
1198
- interface ICalculatorVariablesValues extends Map<string, ICalculatorVariable> {
1199
- }
1200
-
1201
1202
  interface ICalculatorFactory {
1202
1203
  general: () => IGeneralCalculator;
1203
1204
  pie: () => IPieCalculator;
@@ -1720,4 +1721,4 @@ declare global {
1720
1721
  }
1721
1722
  }
1722
1723
 
1723
- export { EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, 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 ICalculatorVariable, type ICalculatorVariablesValues, 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 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 IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionsOnClick, type TAddButton, 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 TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
1724
+ export { EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, 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 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 IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionsOnClick, type TAddButton, 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 TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
package/dist/index.esm.js CHANGED
@@ -42,7 +42,7 @@ var EDrawerPlacement;
42
42
  })(EDrawerPlacement || (EDrawerPlacement = {}));
43
43
  var isExecuteScriptActionValid = function (action, _a) {
44
44
  var _b;
45
- var scripts = _a.scripts, tables = _a.tables, variables = _a.variables;
45
+ var scripts = _a.scripts, tables = _a.tables, variables = _a.variables, systemVariables = _a.systemVariables;
46
46
  var currentScript = scripts.get((_b = action.scriptKey) !== null && _b !== void 0 ? _b : "");
47
47
  if (!currentScript) {
48
48
  return false;
@@ -58,7 +58,8 @@ var isExecuteScriptActionValid = function (action, _a) {
58
58
  return false;
59
59
  }
60
60
  if (actionInput.inputMethod === EWidgetActionInputMethod.VARIABLE &&
61
- !variables.has(actionInput.sourceVariable)) {
61
+ !variables.has(actionInput.sourceVariable) &&
62
+ !systemVariables.has(actionInput.sourceVariable)) {
62
63
  return false;
63
64
  }
64
65
  if (actionInput.inputMethod === EWidgetActionInputMethod.FORMULA && !actionInput.formula) {
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ exports.EDrawerPlacement = void 0;
43
43
  })(exports.EDrawerPlacement || (exports.EDrawerPlacement = {}));
44
44
  var isExecuteScriptActionValid = function (action, _a) {
45
45
  var _b;
46
- var scripts = _a.scripts, tables = _a.tables, variables = _a.variables;
46
+ var scripts = _a.scripts, tables = _a.tables, variables = _a.variables, systemVariables = _a.systemVariables;
47
47
  var currentScript = scripts.get((_b = action.scriptKey) !== null && _b !== void 0 ? _b : "");
48
48
  if (!currentScript) {
49
49
  return false;
@@ -59,7 +59,8 @@ var isExecuteScriptActionValid = function (action, _a) {
59
59
  return false;
60
60
  }
61
61
  if (actionInput.inputMethod === exports.EWidgetActionInputMethod.VARIABLE &&
62
- !variables.has(actionInput.sourceVariable)) {
62
+ !variables.has(actionInput.sourceVariable) &&
63
+ !systemVariables.has(actionInput.sourceVariable)) {
63
64
  return false;
64
65
  }
65
66
  if (actionInput.inputMethod === exports.EWidgetActionInputMethod.FORMULA && !actionInput.formula) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.0.0-beta65",
3
+ "version": "4.0.0-beta66",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",