@panneau/core 3.0.14 → 3.0.15
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/es/hooks.js +5 -2
- package/lib/hooks.js +5 -2
- package/package.json +2 -2
package/es/hooks.js
CHANGED
|
@@ -164,6 +164,8 @@ var useForm = function useForm() {
|
|
|
164
164
|
withoutPropagation = _opts$withoutPropagat === void 0 ? true : _opts$withoutPropagat,
|
|
165
165
|
_opts$onComplete = opts.onComplete,
|
|
166
166
|
onComplete = _opts$onComplete === void 0 ? null : _opts$onComplete,
|
|
167
|
+
_opts$onError = opts.onError,
|
|
168
|
+
onError = _opts$onError === void 0 ? null : _opts$onError,
|
|
167
169
|
_opts$locales = opts.locales,
|
|
168
170
|
locales = _opts$locales === void 0 ? [] : _opts$locales;
|
|
169
171
|
var _useState = useState(initialValue || providedValue),
|
|
@@ -228,8 +230,6 @@ var useForm = function useForm() {
|
|
|
228
230
|
onChange: onFieldChange
|
|
229
231
|
}, locales);
|
|
230
232
|
}, fieldsKey);
|
|
231
|
-
// console.log('fk', fieldsKey);
|
|
232
|
-
|
|
233
233
|
var csrfToken = useMemo(function () {
|
|
234
234
|
return getCsrfToken();
|
|
235
235
|
}, []);
|
|
@@ -247,6 +247,9 @@ var useForm = function useForm() {
|
|
|
247
247
|
} else {
|
|
248
248
|
setGeneralError(error.message);
|
|
249
249
|
}
|
|
250
|
+
if (onError !== null) {
|
|
251
|
+
onError(error);
|
|
252
|
+
}
|
|
250
253
|
};
|
|
251
254
|
var onSubmitSuccess = function onSubmitSuccess(resp) {
|
|
252
255
|
setRequestState({
|
package/lib/hooks.js
CHANGED
|
@@ -199,6 +199,8 @@ var useForm = function useForm() {
|
|
|
199
199
|
withoutPropagation = _opts$withoutPropagat === void 0 ? true : _opts$withoutPropagat,
|
|
200
200
|
_opts$onComplete = opts.onComplete,
|
|
201
201
|
onComplete = _opts$onComplete === void 0 ? null : _opts$onComplete,
|
|
202
|
+
_opts$onError = opts.onError,
|
|
203
|
+
onError = _opts$onError === void 0 ? null : _opts$onError,
|
|
202
204
|
_opts$locales = opts.locales,
|
|
203
205
|
locales = _opts$locales === void 0 ? [] : _opts$locales;
|
|
204
206
|
var _useState = react.useState(initialValue || providedValue),
|
|
@@ -263,8 +265,6 @@ var useForm = function useForm() {
|
|
|
263
265
|
onChange: onFieldChange
|
|
264
266
|
}, locales);
|
|
265
267
|
}, fieldsKey);
|
|
266
|
-
// console.log('fk', fieldsKey);
|
|
267
|
-
|
|
268
268
|
var csrfToken = react.useMemo(function () {
|
|
269
269
|
return fetch.getCsrfToken();
|
|
270
270
|
}, []);
|
|
@@ -282,6 +282,9 @@ var useForm = function useForm() {
|
|
|
282
282
|
} else {
|
|
283
283
|
setGeneralError(error.message);
|
|
284
284
|
}
|
|
285
|
+
if (onError !== null) {
|
|
286
|
+
onError(error);
|
|
287
|
+
}
|
|
285
288
|
};
|
|
286
289
|
var onSubmitSuccess = function onSubmitSuccess(resp) {
|
|
287
290
|
setRequestState({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "d744f42946c2862aa29e7ae6f3ca97a3d6b31f15"
|
|
118
118
|
}
|