@synerise/ds-condition 0.20.53 → 0.20.55

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,22 @@
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.20.55](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.20.54...@synerise/ds-condition@0.20.55) (2023-10-06)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-condition
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.20.54](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.20.53...@synerise/ds-condition@0.20.54) (2023-10-02)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-condition
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.20.53](https://github.com/Synerise/synerise-design/compare/@synerise/ds-condition@0.20.52...@synerise/ds-condition@0.20.53) (2023-09-26)
7
23
 
8
24
  **Note:** Version bump only for package @synerise/ds-condition
@@ -3,13 +3,13 @@ import { SubjectItem, SubjectProps } from '@synerise/ds-subject/dist/Subject.typ
3
3
  import { FactorsProps, FactorType, FactorValueType, InputProps } from '@synerise/ds-factors/dist/Factors.types';
4
4
  import { OperatorsItem, OperatorsProps } from '@synerise/ds-operators/dist/Operator.types';
5
5
  import { ContextGroup, ContextItem, ContextProps } from '@synerise/ds-context-selector/dist/ContextSelector.types';
6
- export declare type StepConditions = {
6
+ export type StepConditions = {
7
7
  id: React.ReactText;
8
8
  parameter?: Omit<FactorsProps, 'onChangeValue'>;
9
9
  operator?: Omit<OperatorsProps, 'onChange'>;
10
10
  factor?: Omit<FactorsProps, 'onChangeValue' | 'setSelectedFactorType'>;
11
11
  };
12
- export declare type ConditionStep = {
12
+ export type ConditionStep = {
13
13
  id: React.ReactText;
14
14
  subject?: Omit<SubjectProps, 'onSelectItem'>;
15
15
  context?: Omit<ContextProps, 'onSelectItem'>;
@@ -17,7 +17,7 @@ export declare type ConditionStep = {
17
17
  conditions: StepConditions[];
18
18
  addConditionErrorText?: React.ReactNode | string;
19
19
  };
20
- export declare type ConditionTexts = {
20
+ export type ConditionTexts = {
21
21
  stepNamePlaceholder: string;
22
22
  removeConditionRowTooltip: string;
23
23
  addFirstConditionRowButton: string;
@@ -29,7 +29,7 @@ export declare type ConditionTexts = {
29
29
  removeTooltip: string;
30
30
  conditionSuffix: string;
31
31
  };
32
- export declare type ConditionProps = {
32
+ export type ConditionProps = {
33
33
  steps: ConditionStep[];
34
34
  getPopupContainerOverride?: (trigger: HTMLElement | null) => HTMLElement;
35
35
  addCondition?: (stepId: React.ReactText) => string | void;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ConditionTexts } from '../../Condition.types';
3
- export declare type AddConditionProps = {
3
+ export type AddConditionProps = {
4
4
  addCondition: (stepId: React.ReactText) => void;
5
5
  stepId: React.ReactText;
6
6
  conditionsNumber: number;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { FactorsProps, InputProps } from '@synerise/ds-factors/dist/Factors.types';
3
3
  import { OperatorsProps } from '@synerise/ds-operators/dist/Operator.types';
4
4
  import { ConditionProps, ConditionTexts } from '../../Condition.types';
5
- export declare type ConditionRowProps = {
5
+ export type ConditionRowProps = {
6
6
  index: number;
7
7
  error?: boolean;
8
8
  hasPriority?: boolean;
@@ -100,9 +100,11 @@ export var ConditionStep = function ConditionStep(_ref) {
100
100
  })
101
101
  }, texts);
102
102
  }, [texts, formatMessage]);
103
- var onActivate = setCurrentStep ? function () {
104
- return setCurrentStep(step.id);
105
- } : undefined;
103
+ var onActivate = React.useCallback(function () {
104
+ return setCurrentStep ? function () {
105
+ return setCurrentStep(step.id);
106
+ } : undefined;
107
+ }, [step.id, setCurrentStep]);
106
108
  var onAddCondition = React.useCallback(function (stepId) {
107
109
  addCondition && addCondition(stepId);
108
110
  onActivate && onActivate();
@@ -4,7 +4,7 @@ import { ContextGroup, ContextItem } from '@synerise/ds-context-selector/dist/Co
4
4
  import { SubjectItem } from '@synerise/ds-subject/dist/Subject.types';
5
5
  import { OperatorsGroup, OperatorsItem } from '@synerise/ds-operators/dist/Operator.types';
6
6
  import { ConditionStep, ConditionTexts, ConditionProps } from '../Condition.types';
7
- export declare type ConditionStepProps = {
7
+ export type ConditionStepProps = {
8
8
  index: number;
9
9
  step: ConditionStep;
10
10
  hasPriority?: boolean;
@@ -17,7 +17,7 @@ export var StepHeader = function StepHeader(_ref) {
17
17
  draggableEnabled = _ref.draggableEnabled,
18
18
  _ref$readOnly = _ref.readOnly,
19
19
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
20
- var onChangeNameDebounce = React.useCallback(debounce(updateStepName || NOOP, 300), [updateStepName]);
20
+ var onChangeNameDebounce = React.useRef(debounce(updateStepName || NOOP, 300)).current;
21
21
 
22
22
  var _React$useState = React.useState(stepName),
23
23
  localName = _React$useState[0],
@@ -26,6 +26,11 @@ export var StepHeader = function StepHeader(_ref) {
26
26
  React.useEffect(function () {
27
27
  setLocalName(stepName);
28
28
  }, [stepName]);
29
+ React.useEffect(function () {
30
+ return function () {
31
+ onChangeNameDebounce.cancel();
32
+ };
33
+ }, [onChangeNameDebounce]);
29
34
  var handleChangeName = React.useCallback(function (event) {
30
35
  setLocalName(event.target.value);
31
36
  onChangeNameDebounce(stepId, event.target.value);
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ConditionProps, ConditionTexts } from '../../Condition.types';
3
- export declare type StepHeaderProps = {
3
+ export type StepHeaderProps = {
4
4
  index: number;
5
5
  texts: Partial<ConditionTexts>;
6
6
  stepName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-condition",
3
- "version": "0.20.53",
3
+ "version": "0.20.55",
4
4
  "description": "Condition UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -32,17 +32,17 @@
32
32
  ],
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
- "@synerise/ds-button": "^0.18.2",
36
- "@synerise/ds-context-selector": "^0.19.10",
37
- "@synerise/ds-core": "^0.40.2",
38
- "@synerise/ds-cruds": "^0.3.34",
39
- "@synerise/ds-factors": "^0.20.3",
40
- "@synerise/ds-icon": "^0.58.2",
41
- "@synerise/ds-inline-edit": "^0.6.80",
42
- "@synerise/ds-operators": "^0.10.39",
43
- "@synerise/ds-subject": "^0.9.67",
44
- "@synerise/ds-tooltip": "^0.14.4",
45
- "@synerise/ds-utils": "^0.24.16",
35
+ "@synerise/ds-button": "^0.18.3",
36
+ "@synerise/ds-context-selector": "^0.19.12",
37
+ "@synerise/ds-core": "^0.40.3",
38
+ "@synerise/ds-cruds": "^0.3.35",
39
+ "@synerise/ds-factors": "^0.20.5",
40
+ "@synerise/ds-icon": "^0.58.3",
41
+ "@synerise/ds-inline-edit": "^0.6.82",
42
+ "@synerise/ds-operators": "^0.10.41",
43
+ "@synerise/ds-subject": "^0.9.69",
44
+ "@synerise/ds-tooltip": "^0.14.5",
45
+ "@synerise/ds-utils": "^0.24.17",
46
46
  "lodash": "^4.17.19",
47
47
  "react-intl": "3.12.0",
48
48
  "react-sortablejs": "^6.0.0"
@@ -57,5 +57,5 @@
57
57
  "@testing-library/react": "10.0.1",
58
58
  "uuid": "^8.3.2"
59
59
  },
60
- "gitHead": "f1f520c4c5ef9f90bacb5d5e0b2e778ceb8fdf79"
60
+ "gitHead": "d944339a738211d8f74b27360481aafd7ef51ddd"
61
61
  }