@infomaximum/widget-sdk 4.0.0-beta7 → 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 +14 -16
- package/dist/index.esm.js +8 -8
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -308,16 +308,16 @@ interface IProcessFilterValue {
|
|
|
308
308
|
* События, доступные при выборе процесса.
|
|
309
309
|
* Если параметр не передан, используются все события процесса на основе запроса к вычислителю.
|
|
310
310
|
*/
|
|
311
|
-
|
|
311
|
+
eventsNamesByProcessNameMap?: Map<string, (string | null)[]>;
|
|
312
312
|
}
|
|
313
313
|
interface IProcessEventFilterValue extends IProcessFilterValue {
|
|
314
|
-
|
|
314
|
+
processName: string;
|
|
315
315
|
eventName: string;
|
|
316
316
|
}
|
|
317
317
|
interface IProcessTransitionFilterValue extends IProcessFilterValue {
|
|
318
|
-
|
|
318
|
+
startEventProcessName: string;
|
|
319
319
|
startEventName: string;
|
|
320
|
-
|
|
320
|
+
endEventProcessName: string;
|
|
321
321
|
endEventName: string;
|
|
322
322
|
}
|
|
323
323
|
interface IAddPresenceOfEventFilter {
|
|
@@ -451,7 +451,7 @@ type TDisplayCondition = {
|
|
|
451
451
|
formula: TNullable<string>;
|
|
452
452
|
} | {
|
|
453
453
|
mode: EDisplayConditionMode.VARIABLE;
|
|
454
|
-
|
|
454
|
+
variableName: TNullable<string>;
|
|
455
455
|
variableValue: TNullable<string>;
|
|
456
456
|
};
|
|
457
457
|
interface IRange {
|
|
@@ -485,7 +485,7 @@ type TWidgetSortingValue = {
|
|
|
485
485
|
formula: string;
|
|
486
486
|
} | TWidgetSortingValueRelatedWidgetIndicator | {
|
|
487
487
|
mode: ESortingValueModes.IN_DASHBOARD | ESortingValueModes.IN_WORKSPACE;
|
|
488
|
-
|
|
488
|
+
name: string;
|
|
489
489
|
formula: string;
|
|
490
490
|
};
|
|
491
491
|
|
|
@@ -568,7 +568,6 @@ declare enum ESortingValueModes {
|
|
|
568
568
|
IN_WORKSPACE = "IN_WORKSPACE"
|
|
569
569
|
}
|
|
570
570
|
interface ICommonColumnIndicator {
|
|
571
|
-
guid: string;
|
|
572
571
|
name: string;
|
|
573
572
|
formula: string;
|
|
574
573
|
}
|
|
@@ -686,8 +685,8 @@ interface IWidgetTableColumn {
|
|
|
686
685
|
dataType: ESimpleDataType;
|
|
687
686
|
}
|
|
688
687
|
interface IActionScript {
|
|
689
|
-
|
|
690
|
-
|
|
688
|
+
name: string | undefined;
|
|
689
|
+
fieldsNames: Set<string>;
|
|
691
690
|
}
|
|
692
691
|
interface IWidgetTable {
|
|
693
692
|
/** Имя таблицы */
|
|
@@ -710,8 +709,8 @@ interface IWidgetsContext {
|
|
|
710
709
|
/** Переменные отчета */
|
|
711
710
|
variables: Map<string, TWidgetVariable>;
|
|
712
711
|
/** Метод установки значения переменной отчета */
|
|
713
|
-
setVariableValue(
|
|
714
|
-
|
|
712
|
+
setVariableValue(name: string, value: TNullable<string> | string[]): void;
|
|
713
|
+
statesNames: Set<string>;
|
|
715
714
|
reportName: string;
|
|
716
715
|
/**
|
|
717
716
|
* режим дашборда
|
|
@@ -739,7 +738,7 @@ type TWidgetActionInputValue = {
|
|
|
739
738
|
columnName: string;
|
|
740
739
|
} | {
|
|
741
740
|
mode: EWidgetActionInputMode.FROM_VARIABLE;
|
|
742
|
-
|
|
741
|
+
name: string;
|
|
743
742
|
} | {
|
|
744
743
|
mode: EWidgetActionInputMode.FORMULA;
|
|
745
744
|
formula: string;
|
|
@@ -756,7 +755,7 @@ type TWidgetActionInputValue = {
|
|
|
756
755
|
defaultValue: string;
|
|
757
756
|
};
|
|
758
757
|
interface IWidgetActionInput {
|
|
759
|
-
|
|
758
|
+
name: string;
|
|
760
759
|
value: TWidgetActionInputValue;
|
|
761
760
|
}
|
|
762
761
|
interface IWidgetAction {
|
|
@@ -764,7 +763,6 @@ interface IWidgetAction {
|
|
|
764
763
|
name: string;
|
|
765
764
|
description: string;
|
|
766
765
|
filters: (IFormulaFilterValue | string)[];
|
|
767
|
-
scriptGuid?: string;
|
|
768
766
|
/** Поле name необходимо, чтобы показать название скрипта, который был удален */
|
|
769
767
|
scriptName?: string;
|
|
770
768
|
inputs: IWidgetActionInput[];
|
|
@@ -777,7 +775,7 @@ interface IBaseWidgetSettings {
|
|
|
777
775
|
type: string;
|
|
778
776
|
header?: string;
|
|
779
777
|
headerSize?: number;
|
|
780
|
-
|
|
778
|
+
stateName?: string | null;
|
|
781
779
|
filters?: (IFormulaFilterValue | string)[];
|
|
782
780
|
filterMode?: EWidgetFilterMode;
|
|
783
781
|
ignoreFilters?: boolean;
|
|
@@ -1019,7 +1017,7 @@ interface IEdge extends IGraphElement {
|
|
|
1019
1017
|
endName: string | null;
|
|
1020
1018
|
}
|
|
1021
1019
|
interface IProcessGraphCalculatorInput {
|
|
1022
|
-
|
|
1020
|
+
processName: string;
|
|
1023
1021
|
vertexLimit: number | null;
|
|
1024
1022
|
edgeLimit: number;
|
|
1025
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.
|
|
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.
|
|
82
|
-
if (actionInputsMap.size < currentScript.
|
|
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.
|
|
86
|
-
var actionInput = actionInputsMap.get(
|
|
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.
|
|
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
|
|
495
|
-
var currentVariableValue =
|
|
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;
|
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.
|
|
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.
|
|
83
|
-
if (actionInputsMap.size < currentScript.
|
|
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.
|
|
87
|
-
var actionInput = actionInputsMap.get(
|
|
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.
|
|
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
|
|
496
|
-
var currentVariableValue =
|
|
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;
|