@availity/change-password 2.0.3 → 2.1.0
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 +9 -0
- package/package.json +2 -2
- package/src/ChangePasswordForm.js +15 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [2.1.0](https://github.com/Availity/availity-react/compare/@availity/change-password@2.0.3...@availity/change-password@2.1.0) (2024-05-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **change-password:** add support for custom alert toggles ([1903267](https://github.com/Availity/availity-react/commit/190326702c187f6ec82c7ef551856cd64161a175))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [2.0.3](https://github.com/Availity/availity-react/compare/@availity/change-password@2.0.2...@availity/change-password@2.0.3) (2024-04-23)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/change-password",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Easy to use change-password components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@availity/block-ui": "^1.1.3",
|
|
29
|
-
"@availity/form": "1.
|
|
29
|
+
"@availity/form": "1.9.0",
|
|
30
30
|
"@availity/icon": "0.11.7",
|
|
31
31
|
"@tanstack/react-query": "^4.36.1",
|
|
32
32
|
"classnames": "^2.3.2",
|
|
@@ -9,6 +9,8 @@ import ChangePasswordFeedback from './ChangePasswordFeedback';
|
|
|
9
9
|
import './ChangePasswordForm.scss';
|
|
10
10
|
|
|
11
11
|
const ChangePasswordForm = ({
|
|
12
|
+
onErrorToggle,
|
|
13
|
+
onSuccessToggle,
|
|
12
14
|
onHandleSubmit,
|
|
13
15
|
onError,
|
|
14
16
|
additionalButtons,
|
|
@@ -58,6 +60,15 @@ const ChangePasswordForm = ({
|
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
|
|
63
|
+
const _onErrorToggle =
|
|
64
|
+
onErrorToggle && typeof onErrorToggle === 'function'
|
|
65
|
+
? () => onErrorToggle({ setLoading, setError, setSuccess, setSubmitted })
|
|
66
|
+
: () => setError(null);
|
|
67
|
+
const _onSuccessToggle =
|
|
68
|
+
onSuccessToggle && typeof onSuccessToggle === 'function'
|
|
69
|
+
? () => onSuccessToggle({ setLoading, setError, setSuccess, setSubmitted })
|
|
70
|
+
: () => setSuccess(null);
|
|
71
|
+
|
|
61
72
|
return (
|
|
62
73
|
<BlockUI blocking={loading}>
|
|
63
74
|
<Form
|
|
@@ -69,10 +80,10 @@ const ChangePasswordForm = ({
|
|
|
69
80
|
{header}
|
|
70
81
|
<Row>
|
|
71
82
|
<Col>
|
|
72
|
-
<Alert isOpen={!!error} color="danger" toggle={
|
|
83
|
+
<Alert isOpen={!!error} color="danger" toggle={_onErrorToggle}>
|
|
73
84
|
{error}
|
|
74
85
|
</Alert>
|
|
75
|
-
<Alert isOpen={!!success} color="success" toggle={
|
|
86
|
+
<Alert isOpen={!!success} color="success" toggle={_onSuccessToggle}>
|
|
76
87
|
{success}
|
|
77
88
|
</Alert>
|
|
78
89
|
<div className="password-with-icon">
|
|
@@ -192,6 +203,8 @@ const ChangePasswordForm = ({
|
|
|
192
203
|
};
|
|
193
204
|
|
|
194
205
|
ChangePasswordForm.propTypes = {
|
|
206
|
+
onErrorToggle: PropTypes.func,
|
|
207
|
+
onSuccessToggle: PropTypes.func,
|
|
195
208
|
onHandleSubmit: PropTypes.func,
|
|
196
209
|
onError: PropTypes.func,
|
|
197
210
|
additionalButtons: PropTypes.node,
|