siam-ui-utils 1.1.8 → 1.1.10
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 +3 -0
- package/package.json +2 -4
- package/src/bridges/with-router-bridge.jsx +12 -0
- package/src/index.js +2 -1
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "siam-ui-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ampf-react",
|
|
6
6
|
"ampf-utils",
|
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"moduleResolution": "nodenext",
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build-browser": "npx tsc --allowJs true src/index.js --outDir dist_browser",
|
|
23
|
-
"cpToDistBrowser": "copyfiles --all src/**/*.* dist_browser",
|
|
24
|
-
"publish-npm_2": "npm run cpToDistBrowser & npm run build-browser & npm publish",
|
|
25
22
|
"publish-npm": "npm publish"
|
|
26
23
|
},
|
|
27
24
|
"dependencies": {
|
|
@@ -29,6 +26,7 @@
|
|
|
29
26
|
"prop-types": "^15.8.1",
|
|
30
27
|
"react": "^18.3.1",
|
|
31
28
|
"react-intl": "^6.6.8",
|
|
29
|
+
"react-router": "^6.26.2",
|
|
32
30
|
"react-router-dom": "^5.2.0",
|
|
33
31
|
"react-select": "^5.8.0",
|
|
34
32
|
"reactstrap": "^9.2.2",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router';
|
|
3
|
+
|
|
4
|
+
export const withRouter = (Component) => {
|
|
5
|
+
const Wrapper = (props) => {
|
|
6
|
+
const history = useNavigate();
|
|
7
|
+
return <Component history={history} {...props} />;
|
|
8
|
+
};
|
|
9
|
+
return Wrapper;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default withRouter;
|