react-confirm-alert 3.0.0 → 3.0.3

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/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
+ import React, { ButtonHTMLAttributes } from 'react';
2
+
1
3
  declare module 'react-confirm-alert' {
2
4
  export interface ReactConfirmAlertProps {
3
- targetId: string
5
+ targetId?: string
4
6
  title?: string
5
7
  message?: string
6
8
  buttons?: Array<{
7
9
  label: string
8
10
  className?: string
9
- } & HTMLButtonElement>
11
+ } & ButtonHTMLAttributes<HTMLButtonElement>>
10
12
  childrenElement?: () => React.ReactNode
11
13
  customUI?: (customUiOptions: {
12
14
  title: string
@@ -15,7 +17,7 @@ declare module 'react-confirm-alert' {
15
17
  }) => React.ReactNode
16
18
  closeOnClickOutside?: boolean
17
19
  closeOnEscape?: boolean
18
- keyCodeForClose: Array<number>
20
+ keyCodeForClose?: Array<number>
19
21
  willUnmount?: () => void
20
22
  onClickOutside?: () => void
21
23
  onKeypressEscape?: () => void
package/lib/index.js CHANGED
@@ -154,11 +154,12 @@ var ReactConfirmAlert = (_temp2 = _class = function (_Component) {
154
154
  'button',
155
155
  _extends({
156
156
  key: i,
157
- onClick: function onClick() {
158
- return _this2.handleClickButton(button);
159
- },
160
157
  className: button.className
161
- }, button),
158
+ }, button, {
159
+ onClick: function onClick(e) {
160
+ return _this2.handleClickButton(button);
161
+ }
162
+ }),
162
163
  button.label
163
164
  );
164
165
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-confirm-alert",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "react component confirm dialog.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {