@synerise/ds-condition 0.17.38 → 0.18.0
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 +24 -0
- package/README.md +3 -2
- package/dist/Condition.js +4 -2
- package/dist/Condition.types.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.18.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.17.39...@synerise/ds-condition@0.18.0) (2022-09-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **condition:** fixes typo in readme.md ([2480189](https://github.com/Synerise/synerise-design/commit/248018917aea908146d0119453d69ca45d092657))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **condition:** adds onDeactivate prop for condition component ([d8a4365](https://github.com/Synerise/synerise-design/commit/d8a43652345b026b8218ba387f1d9cc40ced8cbc))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.17.39](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.17.38...@synerise/ds-condition@0.17.39) (2022-09-29)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-condition
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [0.17.38](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.17.37...@synerise/ds-condition@0.17.38) (2022-09-29)
|
|
7
31
|
|
|
8
32
|
|
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ import Condition from '@synerise/ds-condition'
|
|
|
102
102
|
## API
|
|
103
103
|
|
|
104
104
|
| Property | Description | Type | Default |
|
|
105
|
-
|
|
105
|
+
|---------------------------|---------------------------------------------------------------|---------------------------------------------------------------------------------------------------| --- |
|
|
106
106
|
| addCondition | Callback called when user adds new row of conditions | (stepId: React.ReactText) => void | - |
|
|
107
107
|
| removeCondition | Callback called when user clicks on remove row of condtions | (stepId: React.ReactText, conditionRowId: React.ReactText) => void | - |
|
|
108
108
|
| steps | Array contains all steps of condition | ConditionStep[] | - |
|
|
@@ -122,7 +122,8 @@ import Condition from '@synerise/ds-condition'
|
|
|
122
122
|
| onChangeFactorValue | Callback called when user change value of condition factor | (stepId: React.ReactText, conditionId: React.ReactText, value: OperatorsType \ undefined) => void | - |
|
|
123
123
|
| onChangeFactorType | Callback called when user change type of condition factor | (stepId: React.ReactText, conditionId: React.ReactText, value: FactorType \ undefined) => void | - |
|
|
124
124
|
| onUpdateStepName | Callback called when user change the name of step condition | (stepId: React.ReactText, value: string) => void | - |
|
|
125
|
-
|
|
|
125
|
+
| onDeactivate | Callback called when user blur on of the condition inputs | (stepId: React.ReactText, conditionId: string) => void | - |
|
|
126
|
+
| getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement | null) => HTMLElement; | - |
|
|
126
127
|
| defaultOpenedComponent | Component which should be opened after render | 'subject' \ 'operator' \ 'factor' \ 'parameter' \ 'context' | - |
|
|
127
128
|
| inputProps | group of props from ds-factors types | InputProps | - |
|
|
128
129
|
|
package/dist/Condition.js
CHANGED
|
@@ -57,7 +57,8 @@ var Condition = function Condition(props) {
|
|
|
57
57
|
hoverDisabled = props.hoverDisabled,
|
|
58
58
|
_props$autoOpenedComp = props.autoOpenedComponent,
|
|
59
59
|
autoOpenedComponent = _props$autoOpenedComp === void 0 ? DEFAULT_FIELD : _props$autoOpenedComp,
|
|
60
|
-
inputProps = props.inputProps
|
|
60
|
+
inputProps = props.inputProps,
|
|
61
|
+
onDeactivate = props.onDeactivate;
|
|
61
62
|
|
|
62
63
|
var _useIntl = useIntl(),
|
|
63
64
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -229,10 +230,11 @@ var Condition = function Condition(props) {
|
|
|
229
230
|
};
|
|
230
231
|
}, [addCondition]);
|
|
231
232
|
var handleClearActiveCondition = React.useCallback(function () {
|
|
233
|
+
onDeactivate && onDeactivate(currentStepId, currentConditionId);
|
|
232
234
|
setCurrentConditionId(DEFAULT_CONDITION);
|
|
233
235
|
setCurrentStepId(DEFAULT_STEP);
|
|
234
236
|
setCurrentField(DEFAULT_FIELD);
|
|
235
|
-
}, []);
|
|
237
|
+
}, [currentConditionId, currentStepId, onDeactivate]);
|
|
236
238
|
return React.useMemo(function () {
|
|
237
239
|
return /*#__PURE__*/React.createElement(S.Condition, {
|
|
238
240
|
className: "ds-conditions",
|
|
@@ -54,4 +54,5 @@ export declare type ConditionProps = {
|
|
|
54
54
|
hoverDisabled?: boolean;
|
|
55
55
|
autoOpenedComponent?: 'subject' | 'operator' | 'factor' | 'parameter' | 'context';
|
|
56
56
|
inputProps?: InputProps;
|
|
57
|
+
onDeactivate?: (currentStepId: React.ReactText, currentConditionId: React.ReactText) => void;
|
|
57
58
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-condition",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Condition UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@synerise/ds-context-selector": "^0.14.2",
|
|
37
37
|
"@synerise/ds-core": "^0.36.3",
|
|
38
38
|
"@synerise/ds-cruds": "^0.3.17",
|
|
39
|
-
"@synerise/ds-factors": "^0.15.
|
|
39
|
+
"@synerise/ds-factors": "^0.15.5",
|
|
40
40
|
"@synerise/ds-icon": "^0.51.0",
|
|
41
41
|
"@synerise/ds-inline-edit": "^0.6.34",
|
|
42
42
|
"@synerise/ds-operators": "^0.9.22",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@synerise/ds-core": "*",
|
|
50
50
|
"react": ">=16.9.0 < 17.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "b7689ffd7c6d7c880597c0466f1193da24cac6ef"
|
|
53
53
|
}
|