@synerise/ds-condition 0.12.8 → 0.13.1
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.13.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.13.0...@synerise/ds-condition@0.13.1) (2022-01-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-condition
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.13.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.12.10...@synerise/ds-condition@0.13.0) (2022-01-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-condition
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.12.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.12.9...@synerise/ds-condition@0.12.10) (2022-01-05)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-condition
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.12.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.12.8...@synerise/ds-condition@0.12.9) (2022-01-04)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-condition
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [0.12.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.12.7...@synerise/ds-condition@0.12.8) (2021-12-29)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-condition
|
|
@@ -30,8 +30,12 @@ export var ConditionRow = function ConditionRow(_ref) {
|
|
|
30
30
|
setStepConditionFactorValue = _ref.setStepConditionFactorValue,
|
|
31
31
|
getPopupContainerOverride = _ref.getPopupContainerOverride,
|
|
32
32
|
onActivate = _ref.onActivate,
|
|
33
|
+
hasPriority = _ref.hasPriority,
|
|
33
34
|
texts = _ref.texts;
|
|
34
35
|
return /*#__PURE__*/React.createElement(S.ConditionRow, {
|
|
36
|
+
style: hasPriority ? {
|
|
37
|
+
zIndex: 10001
|
|
38
|
+
} : undefined,
|
|
35
39
|
key: "condition-row-" + conditionId,
|
|
36
40
|
index: index
|
|
37
41
|
}, /*#__PURE__*/React.createElement(S.ConditionConnections, {
|
|
@@ -4,6 +4,7 @@ import { OperatorsProps } from '@synerise/ds-operators/dist/Operator.types';
|
|
|
4
4
|
import { ConditionProps, ConditionTexts } from '../../Condition.types';
|
|
5
5
|
export declare type ConditionRowProps = {
|
|
6
6
|
index: number;
|
|
7
|
+
hasPriority?: boolean;
|
|
7
8
|
onActivate?: () => void;
|
|
8
9
|
conditionId: React.ReactText;
|
|
9
10
|
addCondition: ConditionProps['addCondition'];
|
|
@@ -41,6 +41,10 @@ export var ConditionStep = function ConditionStep(_ref) {
|
|
|
41
41
|
currentConditionId = _ref.currentConditionId,
|
|
42
42
|
currentField = _ref.currentField;
|
|
43
43
|
|
|
44
|
+
var _React$useState = React.useState(null),
|
|
45
|
+
activeConditionId = _React$useState[0],
|
|
46
|
+
setActiveConditionId = _React$useState[1];
|
|
47
|
+
|
|
44
48
|
var _useIntl = useIntl(),
|
|
45
49
|
formatMessage = _useIntl.formatMessage;
|
|
46
50
|
|
|
@@ -118,8 +122,16 @@ export var ConditionStep = function ConditionStep(_ref) {
|
|
|
118
122
|
var renderConditionRow = React.useCallback(function (condition, conditionIndex) {
|
|
119
123
|
var _step$context2;
|
|
120
124
|
|
|
125
|
+
var handleActivation = function handleActivation(conditionId) {
|
|
126
|
+
return function () {
|
|
127
|
+
setActiveConditionId(conditionId);
|
|
128
|
+
onActivate && onActivate();
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
121
132
|
return /*#__PURE__*/React.createElement(ConditionRow, {
|
|
122
133
|
key: "step-" + step.id + "-condition-" + condition.id,
|
|
134
|
+
hasPriority: hasPriority && activeConditionId === condition.id,
|
|
123
135
|
index: conditionIndex,
|
|
124
136
|
conditionId: condition.id,
|
|
125
137
|
addCondition: addCondition,
|
|
@@ -130,7 +142,7 @@ export var ConditionStep = function ConditionStep(_ref) {
|
|
|
130
142
|
minConditionLength: minConditionsLength,
|
|
131
143
|
maxConditionLength: maxConditionsLength,
|
|
132
144
|
conditionsNumber: step.conditions.length,
|
|
133
|
-
onActivate:
|
|
145
|
+
onActivate: handleActivation(condition.id),
|
|
134
146
|
stepId: step.id,
|
|
135
147
|
currentStepId: currentStepId,
|
|
136
148
|
currentConditionId: currentConditionId,
|
|
@@ -145,7 +157,7 @@ export var ConditionStep = function ConditionStep(_ref) {
|
|
|
145
157
|
texts: text,
|
|
146
158
|
stepType: (_step$context2 = step.context) == null ? void 0 : _step$context2.type
|
|
147
159
|
});
|
|
148
|
-
}, [getPopupContainerOverride, addCondition, currentConditionId, currentField, currentStepId, maxConditionsLength, minConditionsLength, removeCondition, selectOperator, selectParameter, setStepConditionFactorType, setStepConditionFactorValue, step.conditions.length, step.context, step.id, text, onActivate]);
|
|
160
|
+
}, [getPopupContainerOverride, addCondition, currentConditionId, currentField, currentStepId, maxConditionsLength, minConditionsLength, removeCondition, selectOperator, selectParameter, setStepConditionFactorType, setStepConditionFactorValue, step.conditions.length, step.context, step.id, text, onActivate, activeConditionId, hasPriority]);
|
|
149
161
|
return /*#__PURE__*/React.createElement(S.Step, {
|
|
150
162
|
key: step.id,
|
|
151
163
|
id: "condition-step-" + step.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-condition",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Condition UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-button": "^0.16.
|
|
36
|
-
"@synerise/ds-context-selector": "^0.
|
|
35
|
+
"@synerise/ds-button": "^0.16.4",
|
|
36
|
+
"@synerise/ds-context-selector": "^0.10.1",
|
|
37
37
|
"@synerise/ds-core": "^0.31.2",
|
|
38
|
-
"@synerise/ds-cruds": "^0.3.
|
|
39
|
-
"@synerise/ds-factors": "^0.
|
|
40
|
-
"@synerise/ds-icon": "^0.
|
|
41
|
-
"@synerise/ds-inline-edit": "^0.
|
|
42
|
-
"@synerise/ds-operators": "^0.
|
|
43
|
-
"@synerise/ds-subject": "^0.
|
|
44
|
-
"@synerise/ds-tooltip": "^0.11.
|
|
38
|
+
"@synerise/ds-cruds": "^0.3.4",
|
|
39
|
+
"@synerise/ds-factors": "^0.11.1",
|
|
40
|
+
"@synerise/ds-icon": "^0.47.0",
|
|
41
|
+
"@synerise/ds-inline-edit": "^0.6.1",
|
|
42
|
+
"@synerise/ds-operators": "^0.7.1",
|
|
43
|
+
"@synerise/ds-subject": "^0.7.1",
|
|
44
|
+
"@synerise/ds-tooltip": "^0.11.4",
|
|
45
45
|
"@synerise/ds-utils": "^0.19.0",
|
|
46
46
|
"react-sortablejs": "^6.0.0"
|
|
47
47
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@synerise/ds-core": "*",
|
|
50
50
|
"react": ">=16.9.0 < 17.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "56c08eca6e2a1e41b8a39e28a9ec657ac1bdec83"
|
|
53
53
|
}
|