@widergy/energy-ui 3.44.2 → 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,10 @@
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
+
1
8
  ## [3.44.2](https://github.com/widergy/energy-ui/compare/v3.44.1...v3.44.2) (2024-11-26)
2
9
 
3
10
 
@@ -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.2",
3
+ "version": "3.44.3",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",