@occmundial/occ-atomic 1.28.0 → 1.29.1
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 +15 -0
- package/build/Droplist/Droplist.js +2 -2
- package/build/Radio/Radio.js +11 -3
- package/build/SlideToggle/SlideToggle.js +15 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## [1.29.1](https://github.com/occmundial/occ-atomic/compare/v1.29.0...v1.29.1) (2023-04-17)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* data-testid in Droplist ([c02b8f8](https://github.com/occmundial/occ-atomic/commit/c02b8f89e205e0338630f52b3280b9d7d85f5990))
|
7
|
+
|
8
|
+
# [1.29.0](https://github.com/occmundial/occ-atomic/compare/v1.28.0...v1.29.0) (2023-04-12)
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* Add testid to slidetoggle and add data value to radio component ([253690f](https://github.com/occmundial/occ-atomic/commit/253690f1e8bc9fc7a0a82a4430b9e74712be84ba))
|
14
|
+
* Update radio data value condition ([b501a24](https://github.com/occmundial/occ-atomic/commit/b501a2450cbb40cdb6ab6e13c637281c84ad7840))
|
15
|
+
|
1
16
|
# [1.28.0](https://github.com/occmundial/occ-atomic/compare/v1.27.0...v1.28.0) (2023-02-16)
|
2
17
|
|
3
18
|
|
@@ -425,7 +425,7 @@ var Droplist = /*#__PURE__*/function (_React$Component) {
|
|
425
425
|
},
|
426
426
|
className: "".concat(classes.item).concat(selectedGroup && currentItem === i ? " ".concat(classes.onFocus) : '').concat(!item.disabled ? " ".concat(classes.itemPointer) : '')
|
427
427
|
}, testId && {
|
428
|
-
'data-testid': "".concat(testId, "__droplist-item-").concat(
|
428
|
+
'data-testid': "".concat(testId, "__droplist-item-").concat(i)
|
429
429
|
}), /*#__PURE__*/_react["default"].createElement("div", null, item.iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
430
430
|
iconName: item.iconName,
|
431
431
|
width: iconSmall,
|
@@ -465,7 +465,7 @@ var Droplist = /*#__PURE__*/function (_React$Component) {
|
|
465
465
|
},
|
466
466
|
className: "".concat(classes.item).concat(selectedGroup && currentItem === i ? " ".concat(classes.onFocus) : '')
|
467
467
|
}, testId && {
|
468
|
-
'data-testid': "".concat(testId, "__droplist-item-").concat(
|
468
|
+
'data-testid': "".concat(testId, "__droplist-item-").concat(i)
|
469
469
|
}), /*#__PURE__*/_react["default"].createElement("div", null, item.iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
470
470
|
iconName: item.iconName,
|
471
471
|
width: 14,
|
package/build/Radio/Radio.js
CHANGED
@@ -15,6 +15,8 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17
17
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
|
+
|
18
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19
21
|
|
20
22
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -89,16 +91,19 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
89
91
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
90
92
|
id: id
|
91
93
|
}, options.map(function (option) {
|
92
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
94
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
93
95
|
id: option.trk,
|
94
|
-
"data-testid": option.testId,
|
95
96
|
key: option.value,
|
97
|
+
"data-testid": option.testId
|
98
|
+
}, option.testId && {
|
99
|
+
'data-value': selected == option.value ? 1 : 0
|
100
|
+
}, {
|
96
101
|
className: "".concat(classes.cont).concat(selected == option.value ? " ".concat(classes.active) : '').concat(option.disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
|
97
102
|
onClick: function onClick() {
|
98
103
|
_this2.onChange(option);
|
99
104
|
},
|
100
105
|
style: style
|
101
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
106
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
102
107
|
className: classes.radio,
|
103
108
|
id: option.trk
|
104
109
|
}), option.label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
@@ -134,6 +139,9 @@ Radio.propTypes = {
|
|
134
139
|
label: _propTypes["default"].string,
|
135
140
|
right: _propTypes["default"].string,
|
136
141
|
trk: _propTypes["default"].string,
|
142
|
+
|
143
|
+
/** The testId property adds the data attribute data-testid to
|
144
|
+
* the main element and should be used for testing only. */
|
137
145
|
testId: _propTypes["default"].string
|
138
146
|
})),
|
139
147
|
|
@@ -15,6 +15,8 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17
17
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
|
+
|
18
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19
21
|
|
20
22
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -89,17 +91,21 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
|
|
89
91
|
className = _this$props2.className,
|
90
92
|
style = _this$props2.style,
|
91
93
|
name = _this$props2.name,
|
92
|
-
trk = _this$props2.trk
|
94
|
+
trk = _this$props2.trk,
|
95
|
+
testId = _this$props2.testId;
|
93
96
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
94
97
|
id: id,
|
95
98
|
className: "".concat(classes.cont).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
|
96
99
|
style: style
|
97
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
100
|
+
}, /*#__PURE__*/_react["default"].createElement("div", _extends({
|
98
101
|
id: trk,
|
99
102
|
name: name,
|
100
103
|
className: "".concat(classes["switch"]).concat(value ? " ".concat(classes.checked) : ''),
|
101
|
-
onClick: this.toggle
|
102
|
-
|
104
|
+
onClick: this.toggle,
|
105
|
+
"data-testid": testId
|
106
|
+
}, testId && {
|
107
|
+
'data-value': value ? 1 : 0
|
108
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
103
109
|
className: classes.slider
|
104
110
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
105
111
|
className: classes.icon
|
@@ -135,7 +141,11 @@ SlideToggle.propTypes = {
|
|
135
141
|
trk: _propTypes["default"].string,
|
136
142
|
id: _propTypes["default"].string,
|
137
143
|
className: _propTypes["default"].string,
|
138
|
-
style: _propTypes["default"].object
|
144
|
+
style: _propTypes["default"].object,
|
145
|
+
|
146
|
+
/** The testId property adds the data attribute data-testid to
|
147
|
+
* the main element and should be used for testing only. */
|
148
|
+
testId: _propTypes["default"].string
|
139
149
|
};
|
140
150
|
var _default = SlideToggle;
|
141
151
|
exports["default"] = _default;
|
package/package.json
CHANGED