@infomaximum/widget-sdk 4.0.0-beta6 → 4.0.0-beta9

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
@@ -34,7 +34,8 @@ declare enum EControlType {
34
34
  eventsColor = "eventsColor",
35
35
  inputMarkdown = "inputMarkdown",
36
36
  filter = "filter",
37
- actionOnClick = "actionOnClick"
37
+ actionOnClick = "actionOnClick",
38
+ eventsPicker = "eventsPicker"
38
39
  }
39
40
  /** Конфигурация элемента управления настройкой */
40
41
  interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
@@ -307,16 +308,16 @@ interface IProcessFilterValue {
307
308
  * События, доступные при выборе процесса.
308
309
  * Если параметр не передан, используются все события процесса на основе запроса к вычислителю.
309
310
  */
310
- eventsNamesByProcessGuidMap?: Map<string, (string | null)[]>;
311
+ eventsNamesByProcessNameMap?: Map<string, (string | null)[]>;
311
312
  }
312
313
  interface IProcessEventFilterValue extends IProcessFilterValue {
313
- processGuid: string;
314
+ processName: string;
314
315
  eventName: string;
315
316
  }
316
317
  interface IProcessTransitionFilterValue extends IProcessFilterValue {
317
- startEventProcessGuid: string;
318
+ startEventProcessName: string;
318
319
  startEventName: string;
319
- endEventProcessGuid: string;
320
+ endEventProcessName: string;
320
321
  endEventName: string;
321
322
  }
322
323
  interface IAddPresenceOfEventFilter {
@@ -450,7 +451,7 @@ type TDisplayCondition = {
450
451
  formula: TNullable<string>;
451
452
  } | {
452
453
  mode: EDisplayConditionMode.VARIABLE;
453
- variableGuid: TNullable<string>;
454
+ variableName: TNullable<string>;
454
455
  variableValue: TNullable<string>;
455
456
  };
456
457
  interface IRange {
@@ -484,7 +485,7 @@ type TWidgetSortingValue = {
484
485
  formula: string;
485
486
  } | TWidgetSortingValueRelatedWidgetIndicator | {
486
487
  mode: ESortingValueModes.IN_DASHBOARD | ESortingValueModes.IN_WORKSPACE;
487
- guid: string;
488
+ name: string;
488
489
  formula: string;
489
490
  };
490
491
 
@@ -567,7 +568,6 @@ declare enum ESortingValueModes {
567
568
  IN_WORKSPACE = "IN_WORKSPACE"
568
569
  }
569
570
  interface ICommonColumnIndicator {
570
- guid: string;
571
571
  name: string;
572
572
  formula: string;
573
573
  }
@@ -685,8 +685,8 @@ interface IWidgetTableColumn {
685
685
  dataType: ESimpleDataType;
686
686
  }
687
687
  interface IActionScript {
688
- guid: string | undefined;
689
- fieldsGuids: Set<string>;
688
+ name: string | undefined;
689
+ fieldsNames: Set<string>;
690
690
  }
691
691
  interface IWidgetTable {
692
692
  /** Имя таблицы */
@@ -709,8 +709,8 @@ interface IWidgetsContext {
709
709
  /** Переменные отчета */
710
710
  variables: Map<string, TWidgetVariable>;
711
711
  /** Метод установки значения переменной отчета */
712
- setVariableValue(guid: string, value: TNullable<string> | string[]): void;
713
- statesGuids: Set<string>;
712
+ setVariableValue(name: string, value: TNullable<string> | string[]): void;
713
+ statesNames: Set<string>;
714
714
  reportName: string;
715
715
  /**
716
716
  * режим дашборда
@@ -738,7 +738,7 @@ type TWidgetActionInputValue = {
738
738
  columnName: string;
739
739
  } | {
740
740
  mode: EWidgetActionInputMode.FROM_VARIABLE;
741
- guid: string;
741
+ name: string;
742
742
  } | {
743
743
  mode: EWidgetActionInputMode.FORMULA;
744
744
  formula: string;
@@ -755,7 +755,7 @@ type TWidgetActionInputValue = {
755
755
  defaultValue: string;
756
756
  };
757
757
  interface IWidgetActionInput {
758
- guid: string;
758
+ name: string;
759
759
  value: TWidgetActionInputValue;
760
760
  }
761
761
  interface IWidgetAction {
@@ -763,7 +763,6 @@ interface IWidgetAction {
763
763
  name: string;
764
764
  description: string;
765
765
  filters: (IFormulaFilterValue | string)[];
766
- scriptGuid?: string;
767
766
  /** Поле name необходимо, чтобы показать название скрипта, который был удален */
768
767
  scriptName?: string;
769
768
  inputs: IWidgetActionInput[];
@@ -776,7 +775,7 @@ interface IBaseWidgetSettings {
776
775
  type: string;
777
776
  header?: string;
778
777
  headerSize?: number;
779
- stateGuid?: string | null;
778
+ stateName?: string | null;
780
779
  filters?: (IFormulaFilterValue | string)[];
781
780
  filterMode?: EWidgetFilterMode;
782
781
  ignoreFilters?: boolean;
@@ -1018,7 +1017,7 @@ interface IEdge extends IGraphElement {
1018
1017
  endName: string | null;
1019
1018
  }
1020
1019
  interface IProcessGraphCalculatorInput {
1021
- processGuid: string;
1020
+ processName: string;
1022
1021
  vertexLimit: number | null;
1023
1022
  edgeLimit: number;
1024
1023
  vertexMeasures: ICalculatorMeasureInput[];
package/dist/index.esm.js CHANGED
@@ -74,21 +74,21 @@ var EWidgetActionInputMode;
74
74
  var isActionValid = function (action, _a) {
75
75
  var _b;
76
76
  var scripts = _a.scripts, tables = _a.tables;
77
- var currentScript = scripts.get((_b = action.scriptGuid) !== null && _b !== void 0 ? _b : "");
77
+ var currentScript = scripts.get((_b = action.scriptName) !== null && _b !== void 0 ? _b : "");
78
78
  if (!currentScript) {
79
79
  return false;
80
80
  }
81
- var actionInputsMap = new Map(action.inputs.map(function (input) { return [input.guid, input]; }));
82
- if (actionInputsMap.size < currentScript.fieldsGuids.size) {
81
+ var actionInputsMap = new Map(action.inputs.map(function (input) { return [input.name, input]; }));
82
+ if (actionInputsMap.size < currentScript.fieldsNames.size) {
83
83
  return false;
84
84
  }
85
- return __spreadArray([], __read(currentScript.fieldsGuids), false).every(function (guid) {
86
- var actionInput = actionInputsMap.get(guid !== null && guid !== void 0 ? guid : "");
85
+ return __spreadArray([], __read(currentScript.fieldsNames), false).every(function (name) {
86
+ var actionInput = actionInputsMap.get(name !== null && name !== void 0 ? name : "");
87
87
  if (!actionInput) {
88
88
  return false;
89
89
  }
90
90
  var value = actionInput.value;
91
- if (value.mode === EWidgetActionInputMode.FROM_VARIABLE && !value.guid) {
91
+ if (value.mode === EWidgetActionInputMode.FROM_VARIABLE && !value.name) {
92
92
  return false;
93
93
  }
94
94
  if (value.mode === EWidgetActionInputMode.FORMULA && !value.formula) {
@@ -491,8 +491,8 @@ var EDisplayConditionMode;
491
491
  function checkDisplayCondition(displayCondition, variables) {
492
492
  var _a;
493
493
  if ((displayCondition === null || displayCondition === void 0 ? void 0 : displayCondition.mode) === EDisplayConditionMode.VARIABLE) {
494
- var variableGuid = displayCondition.variableGuid, variableValue = displayCondition.variableValue;
495
- var currentVariableValue = variableGuid && ((_a = variables.get(variableGuid)) === null || _a === void 0 ? void 0 : _a.value);
494
+ var variableName = displayCondition.variableName, variableValue = displayCondition.variableValue;
495
+ var currentVariableValue = variableName && ((_a = variables.get(variableName)) === null || _a === void 0 ? void 0 : _a.value);
496
496
  var isCurrentVariableMatch = Array.isArray(currentVariableValue)
497
497
  ? !!variableValue && (currentVariableValue === null || currentVariableValue === void 0 ? void 0 : currentVariableValue.includes(variableValue))
498
498
  : currentVariableValue === variableValue;
@@ -941,6 +941,7 @@ var EControlType;
941
941
  EControlType["inputMarkdown"] = "inputMarkdown";
942
942
  EControlType["filter"] = "filter";
943
943
  EControlType["actionOnClick"] = "actionOnClick";
944
+ EControlType["eventsPicker"] = "eventsPicker";
944
945
  })(EControlType || (EControlType = {}));
945
946
 
946
947
  var ESortDirection;
package/dist/index.js CHANGED
@@ -75,21 +75,21 @@ exports.EWidgetActionInputMode = void 0;
75
75
  var isActionValid = function (action, _a) {
76
76
  var _b;
77
77
  var scripts = _a.scripts, tables = _a.tables;
78
- var currentScript = scripts.get((_b = action.scriptGuid) !== null && _b !== void 0 ? _b : "");
78
+ var currentScript = scripts.get((_b = action.scriptName) !== null && _b !== void 0 ? _b : "");
79
79
  if (!currentScript) {
80
80
  return false;
81
81
  }
82
- var actionInputsMap = new Map(action.inputs.map(function (input) { return [input.guid, input]; }));
83
- if (actionInputsMap.size < currentScript.fieldsGuids.size) {
82
+ var actionInputsMap = new Map(action.inputs.map(function (input) { return [input.name, input]; }));
83
+ if (actionInputsMap.size < currentScript.fieldsNames.size) {
84
84
  return false;
85
85
  }
86
- return __spreadArray([], __read(currentScript.fieldsGuids), false).every(function (guid) {
87
- var actionInput = actionInputsMap.get(guid !== null && guid !== void 0 ? guid : "");
86
+ return __spreadArray([], __read(currentScript.fieldsNames), false).every(function (name) {
87
+ var actionInput = actionInputsMap.get(name !== null && name !== void 0 ? name : "");
88
88
  if (!actionInput) {
89
89
  return false;
90
90
  }
91
91
  var value = actionInput.value;
92
- if (value.mode === exports.EWidgetActionInputMode.FROM_VARIABLE && !value.guid) {
92
+ if (value.mode === exports.EWidgetActionInputMode.FROM_VARIABLE && !value.name) {
93
93
  return false;
94
94
  }
95
95
  if (value.mode === exports.EWidgetActionInputMode.FORMULA && !value.formula) {
@@ -492,8 +492,8 @@ exports.EDisplayConditionMode = void 0;
492
492
  function checkDisplayCondition(displayCondition, variables) {
493
493
  var _a;
494
494
  if ((displayCondition === null || displayCondition === void 0 ? void 0 : displayCondition.mode) === exports.EDisplayConditionMode.VARIABLE) {
495
- var variableGuid = displayCondition.variableGuid, variableValue = displayCondition.variableValue;
496
- var currentVariableValue = variableGuid && ((_a = variables.get(variableGuid)) === null || _a === void 0 ? void 0 : _a.value);
495
+ var variableName = displayCondition.variableName, variableValue = displayCondition.variableValue;
496
+ var currentVariableValue = variableName && ((_a = variables.get(variableName)) === null || _a === void 0 ? void 0 : _a.value);
497
497
  var isCurrentVariableMatch = Array.isArray(currentVariableValue)
498
498
  ? !!variableValue && (currentVariableValue === null || currentVariableValue === void 0 ? void 0 : currentVariableValue.includes(variableValue))
499
499
  : currentVariableValue === variableValue;
@@ -942,6 +942,7 @@ exports.EControlType = void 0;
942
942
  EControlType["inputMarkdown"] = "inputMarkdown";
943
943
  EControlType["filter"] = "filter";
944
944
  EControlType["actionOnClick"] = "actionOnClick";
945
+ EControlType["eventsPicker"] = "eventsPicker";
945
946
  })(exports.EControlType || (exports.EControlType = {}));
946
947
 
947
948
  exports.ESortDirection = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.0.0-beta6",
3
+ "version": "4.0.0-beta9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",