@widergy/energy-ui 3.44.1 → 3.44.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
@@ -1,3 +1,17 @@
1
+ ## [3.44.3](https://github.com/widergy/energy-ui/compare/v3.44.2...v3.44.3) (2024-11-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix checkbox ([#536](https://github.com/widergy/energy-ui/issues/536)) ([14049ff](https://github.com/widergy/energy-ui/commit/14049ffc0ff36b84c7f06b80d07258133faf2d18))
7
+
8
+ ## [3.44.2](https://github.com/widergy/energy-ui/compare/v3.44.1...v3.44.2) (2024-11-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixed useState render bug ([#533](https://github.com/widergy/energy-ui/issues/533)) ([045671d](https://github.com/widergy/energy-ui/commit/045671db42c03f8c82739dab5c90b85c37ddb233))
14
+
1
15
  ## [3.44.1](https://github.com/widergy/energy-ui/compare/v3.44.0...v3.44.1) (2024-11-25)
2
16
 
3
17
 
@@ -83,12 +83,10 @@ const Bars = _ref => {
83
83
  const yInitialPosition = yAxis(value);
84
84
  const selectorWidth = fullSizeBars ? groupWidth - graphXStart : barWidth * groups + highlightSpacing * groups;
85
85
  const selectorPosition = fullSizeBars ? graphXStart : xAxis(index) + xSubAxis(0) - highlightSpacing / 2;
86
- (0, _react.useEffect)(() => {
87
- barRef.current = {
88
- width: selectorWidth,
89
- position: selectorPosition
90
- };
91
- }, [barWidth, groups, highlightSpacing, borderSelector === null || borderSelector === void 0 ? void 0 : borderSelector.widthOffset]);
86
+ barRef.current = {
87
+ width: selectorWidth,
88
+ position: selectorPosition
89
+ };
92
90
  return /*#__PURE__*/_react.default.createElement("g", null, (highlighted || selected) && /*#__PURE__*/_react.default.createElement(_Bar.default, {
93
91
  bar: bar,
94
92
  width: barWidth + 2 * highlightSpacing,
@@ -26,18 +26,18 @@ const UTCheckbox = _ref => {
26
26
  disabled,
27
27
  indeterminate,
28
28
  isSimple = false,
29
- onChange,
29
+ onChange = () => {},
30
30
  required,
31
31
  title,
32
- value,
32
+ value = false,
33
33
  variant = 'default',
34
34
  withMarkdown
35
35
  } = _ref;
36
36
  const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, classNames), [classNames, theme]);
37
37
  const iconName = (0, _react.useMemo)(() => indeterminate ? _constants.INDETERMINATE_ICON : value === true ? _constants.CHECKED_ICON : '', [indeterminate, value]);
38
- const handlePress = (0, _react.useCallback)(() => {
39
- if (!disabled && onChange) onChange(value);
40
- }, [disabled, onChange, value]);
38
+ const handlePress = () => {
39
+ if (!disabled && onChange) onChange(!value);
40
+ };
41
41
  const shouldHighlightLabel = value === true && variant === _constants.BUTTON_VARIANT;
42
42
  const touchableProps = {
43
43
  onMouseDown: handlePress,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.44.1",
3
+ "version": "3.44.3",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",