@occmundial/occ-atomic 3.0.0-beta.17 → 3.0.0-beta.19

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.0.0-beta.19](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.18...v3.0.0-beta.19) (2024-06-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Prevent default to avoid scroll on key down ([9ee17d2](https://github.com/occmundial/occ-atomic/commit/9ee17d2a247a02a7be7e1c743669c8833d3f5748))
7
+
8
+ # [3.0.0-beta.18](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.17...v3.0.0-beta.18) (2024-06-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Replace onKeyDown for onKeyUp ([e574e9c](https://github.com/occmundial/occ-atomic/commit/e574e9c42f7a55723794269ede7a4f58dd899e58))
14
+
1
15
  # [3.0.0-beta.17](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.16...v3.0.0-beta.17) (2024-06-19)
2
16
 
3
17
 
@@ -57,6 +57,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
57
57
  undetermined: props.undetermined
58
58
  };
59
59
  _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
60
+ _this.handleKeyUp = _this.handleKeyUp.bind(_assertThisInitialized(_this));
60
61
  return _this;
61
62
  }
62
63
 
@@ -90,14 +91,18 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
90
91
  value: function handleKeyDown(e) {
91
92
  if (e.keyCode == 13 || e.keyCode == 32) {
92
93
  e.preventDefault();
94
+ }
95
+ }
96
+ }, {
97
+ key: "handleKeyUp",
98
+ value: function handleKeyUp(e) {
99
+ if (e.keyCode == 13 || e.keyCode == 32) {
93
100
  this.toggle();
94
101
  }
95
102
  }
96
103
  }, {
97
104
  key: "render",
98
105
  value: function render() {
99
- var _this2 = this;
100
-
101
106
  var _this$state = this.state,
102
107
  value = _this$state.value,
103
108
  undetermined = _this$state.undetermined;
@@ -118,9 +123,8 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
118
123
  return /*#__PURE__*/_react["default"].createElement("div", _extends({
119
124
  id: id,
120
125
  tabIndex: disabled ? -1 : 0,
121
- onKeyDown: function onKeyDown(e) {
122
- return _this2.handleKeyDown(e);
123
- },
126
+ onKeyDown: this.handleKeyDown,
127
+ onKeyUp: this.handleKeyUp,
124
128
  className: "".concat(classes.cont).concat(iconClass).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
125
129
  onClick: this.toggle,
126
130
  style: style,
@@ -54,6 +54,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
54
54
  selected: props.selected
55
55
  };
56
56
  _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
57
+ _this.handleKeyUp = _this.handleKeyUp.bind(_assertThisInitialized(_this));
57
58
  return _this;
58
59
  }
59
60
 
@@ -79,9 +80,15 @@ var Radio = /*#__PURE__*/function (_React$Component) {
79
80
  }
80
81
  }, {
81
82
  key: "handleKeyDown",
82
- value: function handleKeyDown(e, option) {
83
+ value: function handleKeyDown(e) {
83
84
  if (e.keyCode == 13 || e.keyCode == 32) {
84
85
  e.preventDefault();
86
+ }
87
+ }
88
+ }, {
89
+ key: "handleKeyUp",
90
+ value: function handleKeyUp(e, option) {
91
+ if (e.keyCode == 13 || e.keyCode == 32) {
85
92
  this.onChange(option);
86
93
  }
87
94
  }
@@ -106,8 +113,9 @@ var Radio = /*#__PURE__*/function (_React$Component) {
106
113
  id: option.trk,
107
114
  key: option.value,
108
115
  tabIndex: option.disabled ? -1 : 0,
109
- onKeyDown: function onKeyDown(e) {
110
- return _this2.handleKeyDown(e, option);
116
+ onKeyDown: _this2.handleKeyDown,
117
+ onKeyUp: function onKeyUp(e) {
118
+ return _this2.handleKeyUp(e, option);
111
119
  },
112
120
  "data-testid": option.testId
113
121
  }, option.testId && {
@@ -56,6 +56,7 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
56
56
  value: props.value
57
57
  };
58
58
  _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
59
+ _this.handleKeyUp = _this.handleKeyUp.bind(_assertThisInitialized(_this));
59
60
  return _this;
60
61
  }
61
62
 
@@ -88,14 +89,18 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
88
89
  value: function handleKeyDown(e) {
89
90
  if (e.keyCode == 13 || e.keyCode == 32) {
90
91
  e.preventDefault();
92
+ }
93
+ }
94
+ }, {
95
+ key: "handleKeyUp",
96
+ value: function handleKeyUp(e) {
97
+ if (e.keyCode == 13 || e.keyCode == 32) {
91
98
  this.toggle();
92
99
  }
93
100
  }
94
101
  }, {
95
102
  key: "render",
96
103
  value: function render() {
97
- var _this2 = this;
98
-
99
104
  var value = this.state.value;
100
105
  var _this$props2 = this.props,
101
106
  classes = _this$props2.classes,
@@ -111,9 +116,8 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
111
116
  return /*#__PURE__*/_react["default"].createElement("div", {
112
117
  id: id,
113
118
  tabIndex: disabled ? -1 : 0,
114
- onKeyDown: function onKeyDown(e) {
115
- return _this2.handleKeyDown(e);
116
- },
119
+ onKeyDown: this.handleKeyDown,
120
+ onKeyUp: this.handleKeyUp,
117
121
  onClick: this.toggle,
118
122
  className: "".concat(classes.cont).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
119
123
  style: style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@occmundial/occ-atomic",
3
- "version": "3.0.0-beta.17",
3
+ "version": "3.0.0-beta.19",
4
4
  "description": "Collection of shareable styled React components for OCC applications.",
5
5
  "homepage": "http://occmundial.github.io/occ-atomic",
6
6
  "main": "build/index.js",