@steroidsjs/core 3.0.0-beta.58 → 3.0.0-beta.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "3.0.0-beta.58",
3
+ "version": "3.0.0-beta.59",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -31,12 +31,12 @@ var hooks_1 = require("../../../hooks");
31
31
  var useDataProvider_1 = __importDefault(require("../../../hooks/useDataProvider"));
32
32
  var DEFAULT_BUTTON_GROUP_SIZE = 'md';
33
33
  function ButtonGroup(props) {
34
- var _a;
34
+ var _a, _b;
35
35
  var components = (0, hooks_1.useComponents)();
36
36
  var items = (0, useDataProvider_1["default"])({
37
37
  items: props.items
38
38
  }).items;
39
- var _b = (0, react_1.useState)(props.activeButton || props.defaultActiveButton || items[0].id), activeButton = _b[0], setActiveButton = _b[1];
39
+ var _c = (0, react_1.useState)(props.activeButton || props.defaultActiveButton || ((_a = items[0]) === null || _a === void 0 ? void 0 : _a.id)), activeButton = _c[0], setActiveButton = _c[1];
40
40
  react_1["default"].useEffect(function () {
41
41
  if (props.activeButton) {
42
42
  setActiveButton(props.activeButton);
@@ -50,7 +50,7 @@ function ButtonGroup(props) {
50
50
  className: props.className,
51
51
  style: props.style,
52
52
  buttonProps: props.buttonProps,
53
- size: ((_a = props.buttonProps) === null || _a === void 0 ? void 0 : _a.size) || DEFAULT_BUTTON_GROUP_SIZE,
53
+ size: ((_b = props.buttonProps) === null || _b === void 0 ? void 0 : _b.size) || DEFAULT_BUTTON_GROUP_SIZE,
54
54
  activeButton: activeButton,
55
55
  items: items,
56
56
  onClick: onClick