@synerise/ds-condition 0.21.8 → 0.21.9
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 +11 -0
- package/dist/Condition.js +4 -0
- package/dist/Condition.style.d.ts +1 -3
- package/dist/Condition.style.js +1 -4
- package/dist/Condition.types.d.ts +1 -0
- package/dist/ConditionStep/StepHeader/StepHeader.d.ts +1 -2
- package/dist/ConditionStep/StepHeader/StepHeader.js +10 -13
- package/package.json +14 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.21.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.21.8...@synerise/ds-condition@0.21.9) (2024-02-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **condition:** updated step name prefix styles ([b6b53fe](https://github.com/Synerise/synerise-design/commit/b6b53feabe10428ab9e11ce9ebd7167dd881cd11))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.21.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.21.7...@synerise/ds-condition@0.21.8) (2024-02-19)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-condition
|
package/dist/Condition.js
CHANGED
|
@@ -74,6 +74,10 @@ var Condition = function Condition(props) {
|
|
|
74
74
|
conditionSuffix: formatMessage({
|
|
75
75
|
id: 'DS.CONDITION.SUFFIX',
|
|
76
76
|
defaultMessage: 'and'
|
|
77
|
+
}),
|
|
78
|
+
stepNamePrefix: formatMessage({
|
|
79
|
+
id: 'DS.CONDITION.STEP_NAME-PREFIX',
|
|
80
|
+
defaultMessage: 'Step'
|
|
77
81
|
})
|
|
78
82
|
}, texts);
|
|
79
83
|
}, [texts, formatMessage]);
|
|
@@ -7,9 +7,7 @@ export declare const StepConditions: import("styled-components").StyledComponent
|
|
|
7
7
|
withoutStepName: boolean;
|
|
8
8
|
}, never>;
|
|
9
9
|
export declare const StepName: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
-
export declare const StepIndexWrapper: import("styled-components").StyledComponent<"span", any, {
|
|
11
|
-
readOnly?: boolean | undefined;
|
|
12
|
-
}, never>;
|
|
10
|
+
export declare const StepIndexWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
13
11
|
export declare const Condition: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
12
|
export declare const ConditionStepWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
13
|
export declare const And: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/dist/Condition.style.js
CHANGED
|
@@ -31,10 +31,7 @@ export var StepName = styled.div.withConfig({
|
|
|
31
31
|
export var StepIndexWrapper = styled.span.withConfig({
|
|
32
32
|
displayName: "Conditionstyle__StepIndexWrapper",
|
|
33
33
|
componentId: "sc-1lk06p3-5"
|
|
34
|
-
})(["font-size:13px;font-weight:
|
|
35
|
-
var readOnly = _ref.readOnly;
|
|
36
|
-
return readOnly ? '500' : '400';
|
|
37
|
-
});
|
|
34
|
+
})(["font-size:13px;font-weight:500;margin-right:8px;"]);
|
|
38
35
|
export var Condition = styled.div.withConfig({
|
|
39
36
|
displayName: "Conditionstyle__Condition",
|
|
40
37
|
componentId: "sc-1lk06p3-6"
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as T from './StepHeader.types';
|
|
3
|
-
export declare const StepHeader:
|
|
2
|
+
export declare const StepHeader: ({ stepName, stepId, texts, updateStepName, duplicateStep, removeStep, index, draggableEnabled, readOnly, }: T.StepHeaderProps) => JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { debounce } from 'lodash';
|
|
1
3
|
import InlineEdit from '@synerise/ds-inline-edit';
|
|
2
|
-
import * as React from 'react';
|
|
3
4
|
import Cruds from '@synerise/ds-cruds';
|
|
4
5
|
import { DragHandleM } from '@synerise/ds-icon';
|
|
5
6
|
import { NOOP } from '@synerise/ds-utils';
|
|
6
|
-
import { debounce } from 'lodash';
|
|
7
7
|
import * as S from '../../Condition.style';
|
|
8
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
9
8
|
export var StepHeader = function StepHeader(_ref) {
|
|
10
9
|
var stepName = _ref.stepName,
|
|
11
10
|
stepId = _ref.stepId,
|
|
@@ -17,21 +16,21 @@ export var StepHeader = function StepHeader(_ref) {
|
|
|
17
16
|
draggableEnabled = _ref.draggableEnabled,
|
|
18
17
|
_ref$readOnly = _ref.readOnly,
|
|
19
18
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
20
|
-
var onChangeNameDebounce =
|
|
19
|
+
var onChangeNameDebounce = useRef(debounce(updateStepName || NOOP, 300)).current;
|
|
21
20
|
|
|
22
|
-
var
|
|
23
|
-
localName =
|
|
24
|
-
setLocalName =
|
|
21
|
+
var _useState = useState(stepName),
|
|
22
|
+
localName = _useState[0],
|
|
23
|
+
setLocalName = _useState[1];
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
useEffect(function () {
|
|
27
26
|
setLocalName(stepName);
|
|
28
27
|
}, [stepName]);
|
|
29
|
-
|
|
28
|
+
useEffect(function () {
|
|
30
29
|
return function () {
|
|
31
30
|
onChangeNameDebounce.cancel();
|
|
32
31
|
};
|
|
33
32
|
}, [onChangeNameDebounce]);
|
|
34
|
-
var handleChangeName =
|
|
33
|
+
var handleChangeName = useCallback(function (event) {
|
|
35
34
|
setLocalName(event.target.value);
|
|
36
35
|
onChangeNameDebounce(stepId, event.target.value);
|
|
37
36
|
}, [onChangeNameDebounce, stepId]);
|
|
@@ -63,7 +62,5 @@ export var StepHeader = function StepHeader(_ref) {
|
|
|
63
62
|
draggable: draggableEnabled
|
|
64
63
|
}, /*#__PURE__*/React.createElement(S.LeftSide, null, dragHandleElement, /*#__PURE__*/React.createElement(S.StepName, {
|
|
65
64
|
className: "ds-condition-step-name"
|
|
66
|
-
}, /*#__PURE__*/React.createElement(S.StepIndexWrapper,
|
|
67
|
-
readOnly: readOnly
|
|
68
|
-
}, "" + (index + 1)), stepNameElement)), crudElement);
|
|
65
|
+
}, /*#__PURE__*/React.createElement(S.StepIndexWrapper, null, texts.stepNamePrefix, " ", "" + (index + 1)), stepNameElement)), crudElement);
|
|
69
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-condition",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.9",
|
|
4
4
|
"description": "Condition UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-button": "^0.19.
|
|
37
|
-
"@synerise/ds-context-selector": "^0.20.
|
|
38
|
-
"@synerise/ds-core": "^0.40.
|
|
39
|
-
"@synerise/ds-cruds": "^0.4.
|
|
40
|
-
"@synerise/ds-factors": "^0.21.
|
|
41
|
-
"@synerise/ds-icon": "^0.60.
|
|
42
|
-
"@synerise/ds-inline-edit": "^0.6.
|
|
43
|
-
"@synerise/ds-operators": "^0.10.
|
|
44
|
-
"@synerise/ds-subject": "^0.9.
|
|
45
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
46
|
-
"@synerise/ds-utils": "^0.24.
|
|
36
|
+
"@synerise/ds-button": "^0.19.2",
|
|
37
|
+
"@synerise/ds-context-selector": "^0.20.6",
|
|
38
|
+
"@synerise/ds-core": "^0.40.12",
|
|
39
|
+
"@synerise/ds-cruds": "^0.4.6",
|
|
40
|
+
"@synerise/ds-factors": "^0.21.6",
|
|
41
|
+
"@synerise/ds-icon": "^0.60.2",
|
|
42
|
+
"@synerise/ds-inline-edit": "^0.6.98",
|
|
43
|
+
"@synerise/ds-operators": "^0.10.57",
|
|
44
|
+
"@synerise/ds-subject": "^0.9.85",
|
|
45
|
+
"@synerise/ds-tooltip": "^0.14.19",
|
|
46
|
+
"@synerise/ds-utils": "^0.24.26",
|
|
47
47
|
"lodash": "^4.17.19",
|
|
48
48
|
"react-intl": "3.12.0",
|
|
49
49
|
"react-sortablejs": "^6.0.0",
|
|
@@ -56,8 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@testing-library/jest-dom": "5.1.1",
|
|
59
|
-
"@testing-library/react": "10.0.1"
|
|
60
|
-
"uuid": "^8.3.2"
|
|
59
|
+
"@testing-library/react": "10.0.1"
|
|
61
60
|
},
|
|
62
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "673df74b628304300c09f0d7e26279b5901cd925"
|
|
63
62
|
}
|