@infomaximum/widget-sdk 4.0.0-beta31 → 4.0.0-beta33

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
@@ -44,6 +44,7 @@ interface IControlRecord<Settings extends object, Value, ControlType = EControlT
44
44
  title?: string;
45
45
  /** Тип используемого элемента управления настройкой из предложенных нашей системой */
46
46
  type: ControlType | string;
47
+ marginTop?: number;
47
48
  /** Объект дополнительных параметров элемента управления */
48
49
  props?: object | ((settings: Settings) => object);
49
50
  /** Описание доступа к значению настройки */
@@ -373,6 +374,7 @@ interface IFormulaFilterValue {
373
374
  }>;
374
375
  }
375
376
  interface IStagesFilterItem {
377
+ id: number;
376
378
  /** Название этапа */
377
379
  name: string;
378
380
  /** Формула фильтра этапа */
@@ -859,7 +861,7 @@ type TWidgetActionInputValue = TWidgetActionCommonInputValue & ({
859
861
  columnName: string;
860
862
  } | {
861
863
  mode: EWidgetActionInputMode.FROM_VARIABLE;
862
- name: string;
864
+ sourceVariable: string;
863
865
  } | {
864
866
  mode: EWidgetActionInputMode.FORMULA;
865
867
  formula: string;
@@ -927,10 +929,52 @@ interface ISelectOption {
927
929
  label: string;
928
930
  disabled?: boolean;
929
931
  }
932
+ declare enum ECustomSelectOptionTypes {
933
+ DIVIDER = "DIVIDER",
934
+ SYSTEM = "SYSTEM",
935
+ GROUP = "GROUP",
936
+ BRANCH = "BRANCH",
937
+ LEAF = "LEAF"
938
+ }
939
+ declare enum ECustomSelectTemplates {
940
+ FORMULA = "FORMULA",
941
+ DIMENSION_GROUPS = "DIMENSION_GROUPS"
942
+ }
943
+ interface ICustomSelectDividerOption {
944
+ type: ECustomSelectOptionTypes.DIVIDER;
945
+ }
946
+ interface ICustomSelectSystemOption {
947
+ type: ECustomSelectOptionTypes.SYSTEM;
948
+ template: ECustomSelectTemplates;
949
+ }
950
+ interface ICustomSelectGroupOption {
951
+ type: ECustomSelectOptionTypes.GROUP;
952
+ label: string;
953
+ options: ICustomSelectOption[];
954
+ icon: string;
955
+ }
956
+ type TCustomSelectFetchOptions = () => Promise<ICustomSelectOption[]>;
957
+ type TCustomSelectChildOptions = ICustomSelectOption[] | TCustomSelectFetchOptions;
958
+ interface ICustomSelectBranchOption {
959
+ type: ECustomSelectOptionTypes.BRANCH;
960
+ label: string;
961
+ options: TCustomSelectChildOptions;
962
+ icon?: string;
963
+ disabled?: boolean;
964
+ }
965
+ interface ICustomSelectLeafOption {
966
+ type: ECustomSelectOptionTypes.LEAF;
967
+ label: string;
968
+ value: string;
969
+ onSelect: <T = object>(value: string, update: <R extends object>(f: (prevItems: (T | R)[]) => (T | R)[]) => void) => void;
970
+ icon?: string;
971
+ disabled?: boolean;
972
+ }
973
+ type ICustomSelectOption = ICustomSelectDividerOption | ICustomSelectSystemOption | ICustomSelectGroupOption | ICustomSelectBranchOption | ICustomSelectLeafOption;
930
974
  interface ICustomAddButtonProps {
931
- options?: ISelectOption[];
932
- fetchOptions?: () => Promise<ISelectOption[]>;
933
- onSelect: (value: string, update: <T extends object>(f: (prevItems: T[]) => T[]) => void) => void;
975
+ options: TCustomSelectChildOptions;
976
+ hasDropdown?: boolean;
977
+ onClick?: ICustomSelectLeafOption["onSelect"];
934
978
  }
935
979
  interface IWidgetIndicatorMenuConfig {
936
980
  hideTablesColumnsOptions?: boolean;
@@ -1587,4 +1631,4 @@ declare global {
1587
1631
  }
1588
1632
  }
1589
1633
 
1590
- export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EOpenViewMode, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EViewType, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionCommon, type IActionGoToUrl, type IActionOpenView, type IActionRunScript, type IActionScript, type IActionScriptField, type IActionUpdateVariable, 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 ILaunchActionSubscribers, type ILens, type IMarkdownMeasure, type IMeasureMenuConfig, 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 ISelectOption, type ISortOrder, type ISortingMenuConfig, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetIndicatorMenuConfig, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TActionsOnClick, 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 TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TProcessIndicatorValue, type TRecordAccessor, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionCommonInputValue, type TWidgetActionInputValue, type TWidgetContainer, 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, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
1634
+ export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectOptionTypes, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EOpenViewMode, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EViewType, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionCommon, type IActionGoToUrl, type IActionOpenView, type IActionRunScript, type IActionScript, type IActionScriptField, type IActionUpdateVariable, 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 ICustomSelectBranchOption, type ICustomSelectDividerOption, type ICustomSelectGroupOption, type ICustomSelectLeafOption, type ICustomSelectOption, type ICustomSelectSystemOption, 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 ILaunchActionSubscribers, type ILens, type IMarkdownMeasure, type IMeasureMenuConfig, 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 ISelectOption, type ISortOrder, type ISortingMenuConfig, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetIndicatorMenuConfig, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TActionsOnClick, 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 TCustomSelectChildOptions, type TCustomSelectFetchOptions, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TProcessIndicatorValue, type TRecordAccessor, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionCommonInputValue, type TWidgetActionInputValue, type TWidgetContainer, 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, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
package/dist/index.esm.js CHANGED
@@ -115,7 +115,7 @@ var isActionValid = function (action, _a) {
115
115
  return false;
116
116
  }
117
117
  var value = actionInput.value;
118
- if (value.mode === EWidgetActionInputMode.FROM_VARIABLE && !variables.has(value.name)) {
118
+ if (value.mode === EWidgetActionInputMode.FROM_VARIABLE && !variables.has(value.sourceVariable)) {
119
119
  return false;
120
120
  }
121
121
  if (value.mode === EWidgetActionInputMode.FORMULA && !value.formula) {
@@ -988,6 +988,20 @@ var EControlType;
988
988
  EControlType["eventsPicker"] = "eventsPicker";
989
989
  })(EControlType || (EControlType = {}));
990
990
 
991
+ var ECustomSelectOptionTypes;
992
+ (function (ECustomSelectOptionTypes) {
993
+ ECustomSelectOptionTypes["DIVIDER"] = "DIVIDER";
994
+ ECustomSelectOptionTypes["SYSTEM"] = "SYSTEM";
995
+ ECustomSelectOptionTypes["GROUP"] = "GROUP";
996
+ ECustomSelectOptionTypes["BRANCH"] = "BRANCH";
997
+ ECustomSelectOptionTypes["LEAF"] = "LEAF";
998
+ })(ECustomSelectOptionTypes || (ECustomSelectOptionTypes = {}));
999
+ var ECustomSelectTemplates;
1000
+ (function (ECustomSelectTemplates) {
1001
+ ECustomSelectTemplates["FORMULA"] = "FORMULA";
1002
+ ECustomSelectTemplates["DIMENSION_GROUPS"] = "DIMENSION_GROUPS";
1003
+ })(ECustomSelectTemplates || (ECustomSelectTemplates = {}));
1004
+
991
1005
  var ESortDirection;
992
1006
  (function (ESortDirection) {
993
1007
  ESortDirection["descend"] = "DESC";
@@ -1090,4 +1104,4 @@ var getLocalizedText = function (language, locObj, props) {
1090
1104
  return localization.getLocalized(locObj, props);
1091
1105
  };
1092
1106
 
1093
- export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EOpenViewMode, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EViewType, 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, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
1107
+ export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectOptionTypes, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EOpenViewMode, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EViewType, 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, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
package/dist/index.js CHANGED
@@ -116,7 +116,7 @@ var isActionValid = function (action, _a) {
116
116
  return false;
117
117
  }
118
118
  var value = actionInput.value;
119
- if (value.mode === exports.EWidgetActionInputMode.FROM_VARIABLE && !variables.has(value.name)) {
119
+ if (value.mode === exports.EWidgetActionInputMode.FROM_VARIABLE && !variables.has(value.sourceVariable)) {
120
120
  return false;
121
121
  }
122
122
  if (value.mode === exports.EWidgetActionInputMode.FORMULA && !value.formula) {
@@ -989,6 +989,20 @@ exports.EControlType = void 0;
989
989
  EControlType["eventsPicker"] = "eventsPicker";
990
990
  })(exports.EControlType || (exports.EControlType = {}));
991
991
 
992
+ exports.ECustomSelectOptionTypes = void 0;
993
+ (function (ECustomSelectOptionTypes) {
994
+ ECustomSelectOptionTypes["DIVIDER"] = "DIVIDER";
995
+ ECustomSelectOptionTypes["SYSTEM"] = "SYSTEM";
996
+ ECustomSelectOptionTypes["GROUP"] = "GROUP";
997
+ ECustomSelectOptionTypes["BRANCH"] = "BRANCH";
998
+ ECustomSelectOptionTypes["LEAF"] = "LEAF";
999
+ })(exports.ECustomSelectOptionTypes || (exports.ECustomSelectOptionTypes = {}));
1000
+ exports.ECustomSelectTemplates = void 0;
1001
+ (function (ECustomSelectTemplates) {
1002
+ ECustomSelectTemplates["FORMULA"] = "FORMULA";
1003
+ ECustomSelectTemplates["DIMENSION_GROUPS"] = "DIMENSION_GROUPS";
1004
+ })(exports.ECustomSelectTemplates || (exports.ECustomSelectTemplates = {}));
1005
+
992
1006
  exports.ESortDirection = void 0;
993
1007
  (function (ESortDirection) {
994
1008
  ESortDirection["descend"] = "DESC";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.0.0-beta31",
3
+ "version": "4.0.0-beta33",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",