@synerise/ds-condition 0.17.39 → 0.18.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,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.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.18.0...@synerise/ds-condition@0.18.1) (2022-10-11)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-condition
9
+
10
+
11
+
12
+
13
+
14
+ # [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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **condition:** fixes typo in readme.md ([2480189](https://github.com/Synerise/synerise-design/commit/248018917aea908146d0119453d69ca45d092657))
20
+
21
+
22
+ ### Features
23
+
24
+ * **condition:** adds onDeactivate prop for condition component ([d8a4365](https://github.com/Synerise/synerise-design/commit/d8a43652345b026b8218ba387f1d9cc40ced8cbc))
25
+
26
+
27
+
28
+
29
+
6
30
  ## [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)
7
31
 
8
32
  **Note:** Version bump only for package @synerise/ds-condition
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
- | getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement | null) => HTMLElement; | - |
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.17.39",
3
+ "version": "0.18.1",
4
4
  "description": "Condition UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -33,14 +33,14 @@
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
35
  "@synerise/ds-button": "^0.17.9",
36
- "@synerise/ds-context-selector": "^0.14.2",
36
+ "@synerise/ds-context-selector": "^0.14.3",
37
37
  "@synerise/ds-core": "^0.36.3",
38
38
  "@synerise/ds-cruds": "^0.3.17",
39
- "@synerise/ds-factors": "^0.15.5",
39
+ "@synerise/ds-factors": "^0.15.6",
40
40
  "@synerise/ds-icon": "^0.51.0",
41
- "@synerise/ds-inline-edit": "^0.6.34",
42
- "@synerise/ds-operators": "^0.9.22",
43
- "@synerise/ds-subject": "^0.9.22",
41
+ "@synerise/ds-inline-edit": "^0.6.35",
42
+ "@synerise/ds-operators": "^0.9.23",
43
+ "@synerise/ds-subject": "^0.9.23",
44
44
  "@synerise/ds-tooltip": "^0.11.17",
45
45
  "@synerise/ds-utils": "^0.19.0",
46
46
  "react-sortablejs": "^6.0.0"
@@ -49,5 +49,5 @@
49
49
  "@synerise/ds-core": "*",
50
50
  "react": ">=16.9.0 < 17.0.0"
51
51
  },
52
- "gitHead": "81b52bf3a3b9b3fa38f9e736674720b27b3965d0"
52
+ "gitHead": "41d417bdee4ee513979582394f0b4cdcdb2fed2f"
53
53
  }