@synerise/ds-completed-within 0.5.0 → 0.5.3

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,37 @@
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.5.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-completed-within@0.5.2...@synerise/ds-completed-within@0.5.3) (2022-06-15)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-completed-within
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.5.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-completed-within@0.5.1...@synerise/ds-completed-within@0.5.2) (2022-05-15)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **completed-within:** set max width of dropdown ([49c881e](https://github.com/Synerise/synerise-design/commit/49c881e27b8a2cb22c1770645d987a55d03a05cb))
20
+
21
+
22
+
23
+
24
+
25
+ ## [0.5.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-completed-within@0.5.0...@synerise/ds-completed-within@0.5.1) (2022-05-13)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **completed-within:** fixes clearing tooltip ([b9e0520](https://github.com/Synerise/synerise-design/commit/b9e05208d75069b03e9671981ea061f0e6183c99))
31
+ * **completed-within:** fixes maxValues in btn label ([46c73ad](https://github.com/Synerise/synerise-design/commit/46c73ad326737bd355ba949fcfeceb58b0035d3e))
32
+
33
+
34
+
35
+
36
+
6
37
  # [0.5.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-completed-within@0.4.0...@synerise/ds-completed-within@0.5.0) (2022-04-29)
7
38
 
8
39
 
@@ -70,21 +70,25 @@ var CompletedWithin = function CompletedWithin(_ref) {
70
70
  tooltipVisible = _React$useState3[0],
71
71
  setTooltipVisible = _React$useState3[1];
72
72
 
73
+ var _React$useState4 = React.useState(false),
74
+ settingsVisible = _React$useState4[0],
75
+ setSettingsVisible = _React$useState4[1];
76
+
73
77
  var hasValue = React.useMemo(function () {
74
78
  return value.value !== undefined && value.value > 0;
75
79
  }, [value]);
76
80
  var handleVisibleChange = React.useCallback(function (visible) {
81
+ setSettingsVisible(visible);
82
+ setTooltipVisible(false);
83
+
77
84
  if (!visible && innerValue && innerPeriod) {
85
+ var newValue = maxValue && maxValue < innerValue ? maxValue : innerValue;
78
86
  onSetValue({
79
- value: Number(innerValue),
87
+ value: Number(newValue),
80
88
  period: innerPeriod
81
89
  });
82
90
  }
83
-
84
- if (visible) {
85
- setTooltipVisible(false);
86
- }
87
- }, [innerPeriod, innerValue, onSetValue]);
91
+ }, [innerPeriod, innerValue, maxValue, onSetValue]);
88
92
  var handleClear = React.useCallback(function () {
89
93
  setInnerPeriod(undefined);
90
94
  setInnerValue(undefined);
@@ -120,13 +124,17 @@ var CompletedWithin = function CompletedWithin(_ref) {
120
124
  }),
121
125
  trigger: ['click'],
122
126
  onVisibleChange: handleVisibleChange,
123
- placement: "topLeft"
127
+ placement: "topLeft",
128
+ overlayStyle: {
129
+ maxWidth: '238px',
130
+ minWidth: '238px'
131
+ }
124
132
  }, /*#__PURE__*/React.createElement(Tooltip, {
125
133
  type: "largeSimple",
126
134
  description: tooltip,
127
135
  trigger: ['hover'],
128
136
  onVisibleChange: setTooltipVisible,
129
- visible: tooltipVisible
137
+ visible: !settingsVisible && tooltipVisible
130
138
  }, /*#__PURE__*/React.createElement(S.TriggerButton, {
131
139
  className: "ds-completed-within",
132
140
  type: "tertiary",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-completed-within",
3
- "version": "0.5.0",
3
+ "version": "0.5.3",
4
4
  "description": "CompletedWithin UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -33,7 +33,7 @@
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
35
  "@synerise/ds-button": "^0.17.2",
36
- "@synerise/ds-dropdown": "^0.17.17",
36
+ "@synerise/ds-dropdown": "^0.17.18",
37
37
  "@synerise/ds-icon": "^0.49.0",
38
38
  "@synerise/ds-input-number": "^0.3.45",
39
39
  "@synerise/ds-select": "^0.14.11",
@@ -43,5 +43,5 @@
43
43
  "@synerise/ds-core": "*",
44
44
  "react": ">=16.9.0 < 17.0.0"
45
45
  },
46
- "gitHead": "4a658911645846d1e329609ba9db06a7bc64962b"
46
+ "gitHead": "d787395998e479858cb58f6d56555e4c51fe45d5"
47
47
  }