@occmundial/occ-atomic 3.0.0-beta.12 → 3.0.0-beta.14
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.14](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2024-06-13)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Fix toggle background on focus when hovered ([8c35f96](https://github.com/occmundial/occ-atomic/commit/8c35f96b77fdb3d1692d864159561842a3213bba))
|
7
|
+
|
8
|
+
# [3.0.0-beta.13](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.12...v3.0.0-beta.13) (2024-06-13)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Add form nav behavior to SwitchToggle ([e1e74ed](https://github.com/occmundial/occ-atomic/commit/e1e74edf8306250d0ae7a723b758c9426593c295))
|
14
|
+
|
1
15
|
# [3.0.0-beta.12](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2024-06-07)
|
2
16
|
|
3
17
|
|
@@ -79,9 +79,19 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
|
|
79
79
|
if (onChange) onChange(value, id);
|
80
80
|
}
|
81
81
|
}
|
82
|
+
}, {
|
83
|
+
key: "handleKeyDown",
|
84
|
+
value: function handleKeyDown(e) {
|
85
|
+
if (e.keyCode == 13 || e.keyCode == 32) {
|
86
|
+
e.preventDefault();
|
87
|
+
this.toggle();
|
88
|
+
}
|
89
|
+
}
|
82
90
|
}, {
|
83
91
|
key: "render",
|
84
92
|
value: function render() {
|
93
|
+
var _this2 = this;
|
94
|
+
|
85
95
|
var value = this.state.value;
|
86
96
|
var _this$props2 = this.props,
|
87
97
|
classes = _this$props2.classes,
|
@@ -95,14 +105,17 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
|
|
95
105
|
testId = _this$props2.testId;
|
96
106
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
97
107
|
id: id,
|
98
|
-
tabIndex: -1,
|
108
|
+
tabIndex: disabled ? -1 : 0,
|
109
|
+
onKeyDown: function onKeyDown(e) {
|
110
|
+
return _this2.handleKeyDown(e);
|
111
|
+
},
|
112
|
+
onClick: this.toggle,
|
99
113
|
className: "".concat(classes.cont).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
|
100
114
|
style: style
|
101
115
|
}, /*#__PURE__*/_react["default"].createElement("div", _extends({
|
102
116
|
id: trk,
|
103
117
|
name: name,
|
104
118
|
className: "".concat(classes["switch"]).concat(value ? " ".concat(classes.checked) : ''),
|
105
|
-
onClick: this.toggle,
|
106
119
|
"data-testid": testId
|
107
120
|
}, testId && {
|
108
121
|
'data-value': value ? 1 : 0
|
@@ -48,7 +48,7 @@ describe("SlideToggle", function () {
|
|
48
48
|
classes: classes
|
49
49
|
}));
|
50
50
|
expect(wrapper.find('.cont').exists()).toEqual(true);
|
51
|
-
wrapper.
|
51
|
+
wrapper.simulate('click');
|
52
52
|
expect(wrapper.find('.switch').hasClass('checked')).toEqual(true);
|
53
53
|
});
|
54
54
|
it('calls onChange function', function () {
|
@@ -57,7 +57,7 @@ describe("SlideToggle", function () {
|
|
57
57
|
classes: classes,
|
58
58
|
onChange: onChange
|
59
59
|
}));
|
60
|
-
wrapper.
|
60
|
+
wrapper.simulate('click');
|
61
61
|
expect(onChange.mock.calls.length).toBe(1);
|
62
62
|
});
|
63
63
|
it('shows the label', function () {
|
@@ -26,7 +26,7 @@ Object {
|
|
26
26
|
"background": "#083CAE",
|
27
27
|
},
|
28
28
|
"&:hover $switch:not($checked), &:active $switch:not($checked)": Object {
|
29
|
-
"background": "#CAD5EE",
|
29
|
+
"background": "#CAD5EE !important",
|
30
30
|
},
|
31
31
|
"alignItems": "start",
|
32
32
|
"boxSizing": "border-box",
|
@@ -53,12 +53,12 @@ Object {
|
|
53
53
|
"width": "100%",
|
54
54
|
},
|
55
55
|
"label": Object {
|
56
|
+
"cursor": "pointer",
|
56
57
|
"marginLeft": "8px",
|
57
58
|
},
|
58
59
|
"slider": Object {
|
59
60
|
"background": "#fff",
|
60
61
|
"borderRadius": "50%",
|
61
|
-
"cursor": "pointer",
|
62
62
|
"height": 20,
|
63
63
|
"left": 2,
|
64
64
|
"position": "absolute",
|
@@ -34,7 +34,7 @@ var _default = {
|
|
34
34
|
background: toggle['selected']['bg']['default']
|
35
35
|
},
|
36
36
|
'&:hover $switch:not($checked), &:active $switch:not($checked)': {
|
37
|
-
background: toggle['unselected']['bg']['hover']
|
37
|
+
background: "".concat(toggle['unselected']['bg']['hover'], " !important")
|
38
38
|
},
|
39
39
|
'&:focus $switch:not($checked)': {
|
40
40
|
background: toggle['unselected']['bg']['default'],
|
@@ -62,7 +62,6 @@ var _default = {
|
|
62
62
|
},
|
63
63
|
slider: {
|
64
64
|
position: 'absolute',
|
65
|
-
cursor: 'pointer',
|
66
65
|
top: 2,
|
67
66
|
left: 2,
|
68
67
|
width: 20,
|
@@ -88,7 +87,8 @@ var _default = {
|
|
88
87
|
pointerEvents: 'none'
|
89
88
|
},
|
90
89
|
label: {
|
91
|
-
marginLeft: _spacing["default"]['size-2']
|
90
|
+
marginLeft: _spacing["default"]['size-2'],
|
91
|
+
cursor: 'pointer'
|
92
92
|
}
|
93
93
|
};
|
94
94
|
exports["default"] = _default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@occmundial/occ-atomic",
|
3
|
-
"version": "3.0.0-beta.
|
3
|
+
"version": "3.0.0-beta.14",
|
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",
|
@@ -120,5 +120,8 @@
|
|
120
120
|
"roots": [
|
121
121
|
"<rootDir>/lib/"
|
122
122
|
]
|
123
|
+
},
|
124
|
+
"volta": {
|
125
|
+
"node": "16.18.0"
|
123
126
|
}
|
124
127
|
}
|