@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 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>;
@@ -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:", ";"], function (_ref) {
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"
@@ -29,6 +29,7 @@ export type ConditionTexts = {
29
29
  duplicateTooltip: string;
30
30
  removeTooltip: string;
31
31
  conditionSuffix: string;
32
+ stepNamePrefix: string;
32
33
  };
33
34
  export type ConditionProps = {
34
35
  steps: ConditionStep[];
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import * as T from './StepHeader.types';
3
- export declare const StepHeader: React.FC<T.StepHeaderProps>;
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 = React.useRef(debounce(updateStepName || NOOP, 300)).current;
19
+ var onChangeNameDebounce = useRef(debounce(updateStepName || NOOP, 300)).current;
21
20
 
22
- var _React$useState = React.useState(stepName),
23
- localName = _React$useState[0],
24
- setLocalName = _React$useState[1];
21
+ var _useState = useState(stepName),
22
+ localName = _useState[0],
23
+ setLocalName = _useState[1];
25
24
 
26
- React.useEffect(function () {
25
+ useEffect(function () {
27
26
  setLocalName(stepName);
28
27
  }, [stepName]);
29
- React.useEffect(function () {
28
+ useEffect(function () {
30
29
  return function () {
31
30
  onChangeNameDebounce.cancel();
32
31
  };
33
32
  }, [onChangeNameDebounce]);
34
- var handleChangeName = React.useCallback(function (event) {
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.8",
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.1",
37
- "@synerise/ds-context-selector": "^0.20.5",
38
- "@synerise/ds-core": "^0.40.11",
39
- "@synerise/ds-cruds": "^0.4.5",
40
- "@synerise/ds-factors": "^0.21.5",
41
- "@synerise/ds-icon": "^0.60.1",
42
- "@synerise/ds-inline-edit": "^0.6.97",
43
- "@synerise/ds-operators": "^0.10.56",
44
- "@synerise/ds-subject": "^0.9.84",
45
- "@synerise/ds-tooltip": "^0.14.18",
46
- "@synerise/ds-utils": "^0.24.25",
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": "cddb99e7a7cf30926aa46cf772a17d6803ff62cf"
61
+ "gitHead": "673df74b628304300c09f0d7e26279b5901cd925"
63
62
  }