@etsoo/react 1.5.45 → 1.5.48
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/lib/app/ServiceApp.js +2 -0
- package/lib/mu/RLink.js +8 -11
- package/package.json +26 -26
- package/src/app/ServiceApp.ts +3 -0
- package/src/mu/RLink.tsx +8 -10
package/lib/app/ServiceApp.js
CHANGED
package/lib/mu/RLink.js
CHANGED
|
@@ -10,12 +10,10 @@ import { useDelayedExecutor } from '../uses/useDelayedExecutor';
|
|
|
10
10
|
export const RLink = React.forwardRef((props, ref) => {
|
|
11
11
|
// Destruct
|
|
12
12
|
const { delay = 0, href, target, onClick, ...rest } = props;
|
|
13
|
-
const delayed =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, delay)
|
|
18
|
-
: null;
|
|
13
|
+
const delayed = useDelayedExecutor((href) => {
|
|
14
|
+
// Router push
|
|
15
|
+
globalApp.history.push(href);
|
|
16
|
+
}, delay);
|
|
19
17
|
// Click handler
|
|
20
18
|
const onClickLocl = (event) => {
|
|
21
19
|
if (onClick)
|
|
@@ -26,14 +24,13 @@ export const RLink = React.forwardRef((props, ref) => {
|
|
|
26
24
|
globalApp) {
|
|
27
25
|
// Prevent href action
|
|
28
26
|
event.preventDefault();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
else
|
|
32
|
-
globalApp.history.push(href);
|
|
27
|
+
// Delayed excution
|
|
28
|
+
delayed.call(undefined, href);
|
|
33
29
|
}
|
|
34
30
|
};
|
|
31
|
+
// Clear when exit
|
|
35
32
|
React.useEffect(() => {
|
|
36
|
-
return () => delayed
|
|
33
|
+
return () => delayed.clear();
|
|
37
34
|
}, [delayed]);
|
|
38
35
|
// Component
|
|
39
36
|
return (React.createElement(Link, { ...rest, onClick: onClickLocl, href: href, target: target, ref: ref }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.48",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -47,51 +47,51 @@
|
|
|
47
47
|
"homepage": "https://github.com/ETSOO/AppReact#readme",
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@emotion/css": "^11.9.0",
|
|
50
|
-
"@emotion/react": "^11.9.
|
|
50
|
+
"@emotion/react": "^11.9.3",
|
|
51
51
|
"@emotion/style": "^0.8.0",
|
|
52
|
-
"@emotion/styled": "^11.
|
|
53
|
-
"@etsoo/appscript": "^1.2.
|
|
52
|
+
"@emotion/styled": "^11.9.3",
|
|
53
|
+
"@etsoo/appscript": "^1.2.62",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.4",
|
|
55
55
|
"@etsoo/shared": "^1.1.40",
|
|
56
|
-
"@mui/icons-material": "^5.8.
|
|
57
|
-
"@mui/material": "^5.
|
|
58
|
-
"@types/pica": "^9.0.
|
|
56
|
+
"@mui/icons-material": "^5.8.4",
|
|
57
|
+
"@mui/material": "^5.9.1",
|
|
58
|
+
"@types/pica": "^9.0.1",
|
|
59
59
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
60
|
-
"@types/react": "^18.0.
|
|
60
|
+
"@types/react": "^18.0.15",
|
|
61
61
|
"@types/react-avatar-editor": "^12.0.0",
|
|
62
62
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
63
|
-
"@types/react-dom": "^18.0.
|
|
63
|
+
"@types/react-dom": "^18.0.6",
|
|
64
64
|
"@types/react-input-mask": "^3.0.1",
|
|
65
65
|
"@types/react-window": "^1.8.5",
|
|
66
66
|
"pica": "^9.0.1",
|
|
67
67
|
"pulltorefreshjs": "^0.1.22",
|
|
68
|
-
"react": "^18.
|
|
68
|
+
"react": "^18.2.0",
|
|
69
69
|
"react-avatar-editor": "^13.0.0",
|
|
70
70
|
"react-beautiful-dnd": "^13.1.0",
|
|
71
|
-
"react-dom": "^18.
|
|
71
|
+
"react-dom": "^18.2.0",
|
|
72
72
|
"react-draggable": "^4.4.5",
|
|
73
73
|
"react-imask": "^6.4.2",
|
|
74
74
|
"react-router-dom": "^6.3.0",
|
|
75
75
|
"react-window": "^1.8.7"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@babel/cli": "^7.
|
|
79
|
-
"@babel/core": "^7.18.
|
|
80
|
-
"@babel/plugin-transform-runtime": "^7.18.
|
|
81
|
-
"@babel/preset-env": "^7.18.
|
|
82
|
-
"@babel/runtime-corejs3": "^7.18.
|
|
83
|
-
"@types/jest": "^
|
|
78
|
+
"@babel/cli": "^7.18.9",
|
|
79
|
+
"@babel/core": "^7.18.9",
|
|
80
|
+
"@babel/plugin-transform-runtime": "^7.18.9",
|
|
81
|
+
"@babel/preset-env": "^7.18.9",
|
|
82
|
+
"@babel/runtime-corejs3": "^7.18.9",
|
|
83
|
+
"@types/jest": "^28.1.6",
|
|
84
84
|
"@types/react-test-renderer": "^18.0.0",
|
|
85
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
86
|
-
"@typescript-eslint/parser": "^5.
|
|
87
|
-
"eslint": "^8.
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
86
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
87
|
+
"eslint": "^8.20.0",
|
|
88
88
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
89
89
|
"eslint-plugin-import": "^2.26.0",
|
|
90
|
-
"eslint-plugin-react": "^7.30.
|
|
91
|
-
"jest": "^28.1.
|
|
92
|
-
"jest-environment-jsdom": "^28.1.
|
|
93
|
-
"react-test-renderer": "^18.
|
|
94
|
-
"ts-jest": "^28.0.
|
|
95
|
-
"typescript": "^4.7.
|
|
90
|
+
"eslint-plugin-react": "^7.30.1",
|
|
91
|
+
"jest": "^28.1.3",
|
|
92
|
+
"jest-environment-jsdom": "^28.1.3",
|
|
93
|
+
"react-test-renderer": "^18.2.0",
|
|
94
|
+
"ts-jest": "^28.0.7",
|
|
95
|
+
"typescript": "^4.7.4"
|
|
96
96
|
}
|
|
97
97
|
}
|
package/src/app/ServiceApp.ts
CHANGED
package/src/mu/RLink.tsx
CHANGED
|
@@ -20,13 +20,10 @@ export const RLink = React.forwardRef<HTMLAnchorElement, RLinkProps>(
|
|
|
20
20
|
// Destruct
|
|
21
21
|
const { delay = 0, href, target, onClick, ...rest } = props;
|
|
22
22
|
|
|
23
|
-
const delayed =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
globalApp.history.push(href);
|
|
28
|
-
}, delay)
|
|
29
|
-
: null;
|
|
23
|
+
const delayed = useDelayedExecutor((href: string) => {
|
|
24
|
+
// Router push
|
|
25
|
+
globalApp.history.push(href);
|
|
26
|
+
}, delay);
|
|
30
27
|
|
|
31
28
|
// Click handler
|
|
32
29
|
const onClickLocl = (
|
|
@@ -43,13 +40,14 @@ export const RLink = React.forwardRef<HTMLAnchorElement, RLinkProps>(
|
|
|
43
40
|
// Prevent href action
|
|
44
41
|
event.preventDefault();
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
// Delayed excution
|
|
44
|
+
delayed.call(undefined, href);
|
|
48
45
|
}
|
|
49
46
|
};
|
|
50
47
|
|
|
48
|
+
// Clear when exit
|
|
51
49
|
React.useEffect(() => {
|
|
52
|
-
return () => delayed
|
|
50
|
+
return () => delayed.clear();
|
|
53
51
|
}, [delayed]);
|
|
54
52
|
|
|
55
53
|
// Component
|