@itcase/storybook-config 1.0.51 → 1.0.53
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.
|
@@ -4,8 +4,10 @@ var React = require('react');
|
|
|
4
4
|
|
|
5
5
|
function FormSubmitWrapper(props) {
|
|
6
6
|
var formRef = React.useRef();
|
|
7
|
+
var _props$submit = props.submit,
|
|
8
|
+
submit = _props$submit === void 0 ? true : _props$submit;
|
|
7
9
|
React.useEffect(function () {
|
|
8
|
-
if (formRef != null && formRef.current) {
|
|
10
|
+
if (formRef != null && formRef.current && submit) {
|
|
9
11
|
formRef.current.submit();
|
|
10
12
|
}
|
|
11
13
|
}, [formRef]);
|
|
@@ -2,8 +2,10 @@ import React, { useRef, useEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
function FormSubmitWrapper(props) {
|
|
4
4
|
var formRef = useRef();
|
|
5
|
+
var _props$submit = props.submit,
|
|
6
|
+
submit = _props$submit === void 0 ? true : _props$submit;
|
|
5
7
|
useEffect(function () {
|
|
6
|
-
if (formRef != null && formRef.current) {
|
|
8
|
+
if (formRef != null && formRef.current && submit) {
|
|
7
9
|
formRef.current.submit();
|
|
8
10
|
}
|
|
9
11
|
}, [formRef]);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { delay, http, HttpResponse } from 'msw'
|
|
2
|
+
|
|
3
|
+
const serverErrorHandler = (formUrl, errors) => {
|
|
4
|
+
return http.post(formUrl, async () => {
|
|
5
|
+
return HttpResponse.json(errors, { status: 400 })
|
|
6
|
+
})
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const error500Handler = (formUrl) => {
|
|
10
|
+
http.post(formUrl, async () => {
|
|
11
|
+
return HttpResponse.json(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
status: 500,
|
|
15
|
+
},
|
|
16
|
+
)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const loadingHandler = (formUrl) => {
|
|
21
|
+
http.post(formUrl, async () => {
|
|
22
|
+
await delay(60000)
|
|
23
|
+
return HttpResponse(
|
|
24
|
+
{},
|
|
25
|
+
{
|
|
26
|
+
status: 200,
|
|
27
|
+
},
|
|
28
|
+
)
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { serverErrorHandler, error500Handler, loadingHandler }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/storybook-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets",
|
|
6
6
|
"engines": {
|
|
@@ -57,26 +57,26 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@etchteam/storybook-addon-status": "^5.0.0",
|
|
60
|
-
"@itcase/config": "^1.0.
|
|
60
|
+
"@itcase/config": "^1.0.18",
|
|
61
61
|
"@itcase/storybook-addon-auth": "^1.0.4",
|
|
62
|
-
"@storybook/addon-actions": "^8.6.
|
|
63
|
-
"@storybook/addon-controls": "^8.6.
|
|
62
|
+
"@storybook/addon-actions": "^8.6.1",
|
|
63
|
+
"@storybook/addon-controls": "^8.6.1",
|
|
64
64
|
"@storybook/addon-designs": "^8.2.0",
|
|
65
|
-
"@storybook/addon-essentials": "^8.6.
|
|
66
|
-
"@storybook/addon-interactions": "^8.6.
|
|
67
|
-
"@storybook/addon-links": "^8.6.
|
|
65
|
+
"@storybook/addon-essentials": "^8.6.1",
|
|
66
|
+
"@storybook/addon-interactions": "^8.6.1",
|
|
67
|
+
"@storybook/addon-links": "^8.6.1",
|
|
68
68
|
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
69
|
-
"@storybook/addon-themes": "^8.6.
|
|
70
|
-
"@storybook/addon-viewport": "^8.6.
|
|
69
|
+
"@storybook/addon-themes": "^8.6.1",
|
|
70
|
+
"@storybook/addon-viewport": "^8.6.1",
|
|
71
71
|
"@storybook/addon-webpack5-compiler-swc": "^2.1.0",
|
|
72
|
-
"@storybook/blocks": "^8.6.
|
|
73
|
-
"@storybook/manager-api": "^8.6.
|
|
74
|
-
"@storybook/nextjs": "^8.6.
|
|
75
|
-
"@storybook/preview-api": "^8.6.
|
|
76
|
-
"@storybook/react": "^8.6.
|
|
77
|
-
"@storybook/react-vite": "^8.6.
|
|
78
|
-
"@storybook/react-webpack5": "^8.6.
|
|
79
|
-
"@storybook/theming": "^8.6.
|
|
72
|
+
"@storybook/blocks": "^8.6.1",
|
|
73
|
+
"@storybook/manager-api": "^8.6.1",
|
|
74
|
+
"@storybook/nextjs": "^8.6.1",
|
|
75
|
+
"@storybook/preview-api": "^8.6.1",
|
|
76
|
+
"@storybook/react": "^8.6.1",
|
|
77
|
+
"@storybook/react-vite": "^8.6.1",
|
|
78
|
+
"@storybook/react-webpack5": "^8.6.1",
|
|
79
|
+
"@storybook/theming": "^8.6.1",
|
|
80
80
|
"http-proxy-middleware": "^3.0.3",
|
|
81
81
|
"msw": "^2.7.3",
|
|
82
82
|
"msw-storybook-addon": "^2.0.4",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@commitlint/config-conventional": "^19.7.1",
|
|
90
90
|
"@itcase/common": "^1.2.18",
|
|
91
91
|
"@itcase/lint": "^1.0.41",
|
|
92
|
-
"@itcase/ui": "^1.3.
|
|
92
|
+
"@itcase/ui": "^1.3.28",
|
|
93
93
|
"@rollup/plugin-babel": "^6.0.4",
|
|
94
94
|
"@rollup/plugin-commonjs": "^28.0.2",
|
|
95
95
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"rollup-plugin-copy": "^3.5.0",
|
|
111
111
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
112
112
|
"semantic-release": "^24.2.3",
|
|
113
|
-
"storybook": "^8.6.
|
|
113
|
+
"storybook": "^8.6.1",
|
|
114
114
|
"stylelint": "^16.14.1",
|
|
115
115
|
"typescript": "^5.7.3"
|
|
116
116
|
}
|
|
File without changes
|