@dhis2-ui/button 8.2.5 → 8.3.1

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -4,3 +4,5 @@
4
4
  > See the [Getting started
5
5
  > guide](https://github.com/dhis2/ui/blob/master/docs/getting-started.md)
6
6
  > for more information.
7
+
8
+ For usage instructions see [the documentation for this component](https://ui.dhis2.nu/components/button).
@@ -39,7 +39,7 @@ describe('<DropdownButton>', () => {
39
39
  // TODO: https://github.com/popperjs/react-popper/issues/350
40
40
  const wrapper = (0, _enzyme.mount)(Component);
41
41
  await (0, _testUtils.act)(async () => await null);
42
- wrapper.find(_layer.Layer).simulate('click');
42
+ wrapper.find(_layer.Layer).find('.backdrop').simulate('click');
43
43
  expect(onClick).toHaveBeenCalledTimes(1);
44
44
  const args = onClick.mock.calls[0];
45
45
  expect(args).toHaveLength(2);
@@ -157,7 +157,7 @@ class DropdownButton extends _react.Component {
157
157
  }, children, /*#__PURE__*/_react.default.createElement(ArrowIconComponent, {
158
158
  className: "jsx-3163060161" + " " + (arrow.className || "")
159
159
  })), open && /*#__PURE__*/_react.default.createElement(_layer.Layer, {
160
- onClick: this.onClickHandler,
160
+ onBackdropClick: this.onClickHandler,
161
161
  transparent: true
162
162
  }, /*#__PURE__*/_react.default.createElement(_popper.Popper, {
163
163
  dataTest: "".concat(dataTest, "-popper"),
@@ -121,7 +121,7 @@ class SplitButton extends _react.Component {
121
121
  className: (0, _classnames.default)(className, rightButton.className),
122
122
  dataTest: "".concat(dataTest, "-toggle")
123
123
  }, arrow), open && /*#__PURE__*/_react.default.createElement(_layer.Layer, {
124
- onClick: this.onToggle,
124
+ onBackdropClick: this.onToggle,
125
125
  transparent: true
126
126
  }, /*#__PURE__*/_react.default.createElement(_popper.Popper, {
127
127
  dataTest: "".concat(dataTest, "-menu"),
@@ -26,7 +26,7 @@ describe('<DropdownButton>', () => {
26
26
  // TODO: https://github.com/popperjs/react-popper/issues/350
27
27
  const wrapper = mount(Component);
28
28
  await act(async () => await null);
29
- wrapper.find(Layer).simulate('click');
29
+ wrapper.find(Layer).find('.backdrop').simulate('click');
30
30
  expect(onClick).toHaveBeenCalledTimes(1);
31
31
  const args = onClick.mock.calls[0];
32
32
  expect(args).toHaveLength(2);
@@ -138,7 +138,7 @@ class DropdownButton extends Component {
138
138
  }, children, /*#__PURE__*/React.createElement(ArrowIconComponent, {
139
139
  className: "jsx-3163060161" + " " + (arrow.className || "")
140
140
  })), open && /*#__PURE__*/React.createElement(Layer, {
141
- onClick: this.onClickHandler,
141
+ onBackdropClick: this.onClickHandler,
142
142
  transparent: true
143
143
  }, /*#__PURE__*/React.createElement(Popper, {
144
144
  dataTest: "".concat(dataTest, "-popper"),
@@ -100,7 +100,7 @@ class SplitButton extends Component {
100
100
  className: cx(className, rightButton.className),
101
101
  dataTest: "".concat(dataTest, "-toggle")
102
102
  }, arrow), open && /*#__PURE__*/React.createElement(Layer, {
103
- onClick: this.onToggle,
103
+ onBackdropClick: this.onToggle,
104
104
  transparent: true
105
105
  }, /*#__PURE__*/React.createElement(Popper, {
106
106
  dataTest: "".concat(dataTest, "-menu"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/button",
3
- "version": "8.2.5",
3
+ "version": "8.3.1",
4
4
  "description": "UI Button",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,12 +31,12 @@
31
31
  "styled-jsx": "^4"
32
32
  },
33
33
  "dependencies": {
34
- "@dhis2/prop-types": "^3.0.0-beta.1",
35
- "@dhis2-ui/layer": "8.2.5",
36
- "@dhis2-ui/loader": "8.2.5",
37
- "@dhis2-ui/popper": "8.2.5",
38
- "@dhis2/ui-constants": "8.2.5",
39
- "@dhis2/ui-icons": "8.2.5",
34
+ "@dhis2/prop-types": "^3.1.2",
35
+ "@dhis2-ui/layer": "8.3.1",
36
+ "@dhis2-ui/loader": "8.3.1",
37
+ "@dhis2-ui/popper": "8.3.1",
38
+ "@dhis2/ui-constants": "8.3.1",
39
+ "@dhis2/ui-icons": "8.3.1",
40
40
  "classnames": "^2.3.1",
41
41
  "prop-types": "^15.7.2"
42
42
  },