soda-heroui 0.5.0 → 0.5.2
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.
|
@@ -24,17 +24,17 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
27
|
+
AutoRefresh: ()=>AutoRefresh
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const react_namespaceObject = require("@heroui/react");
|
|
31
31
|
const external_soda_hooks_namespaceObject = require("soda-hooks");
|
|
32
|
-
const AutoRefresh = ({ children,
|
|
32
|
+
const AutoRefresh = ({ children, onRefresh, ...rest })=>{
|
|
33
33
|
if ("development" === process.env.NODE_ENV) return children;
|
|
34
34
|
function onPress(e) {
|
|
35
35
|
const closeButton = e.target.parentElement?.querySelector(`[aria-label="关闭"]`);
|
|
36
36
|
closeButton?.click();
|
|
37
|
-
|
|
37
|
+
onRefresh?.();
|
|
38
38
|
}
|
|
39
39
|
(0, external_soda_hooks_namespaceObject.useAutoRefresh)(()=>(0, react_namespaceObject.addToast)({
|
|
40
40
|
title: "检测到页面更新",
|
|
@@ -52,10 +52,9 @@ const AutoRefresh = ({ children, onNavigate, ...rest })=>{
|
|
|
52
52
|
}));
|
|
53
53
|
return children;
|
|
54
54
|
};
|
|
55
|
-
|
|
56
|
-
exports["default"] = __webpack_exports__["default"];
|
|
55
|
+
exports.AutoRefresh = __webpack_exports__.AutoRefresh;
|
|
57
56
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
58
|
-
"
|
|
57
|
+
"AutoRefresh"
|
|
59
58
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
60
59
|
Object.defineProperty(exports, '__esModule', {
|
|
61
60
|
value: true
|
|
@@ -2,8 +2,7 @@ import { FC, ReactNode } from "react";
|
|
|
2
2
|
import { addToast } from "@heroui/react";
|
|
3
3
|
import { FirstParameter } from "soda-type";
|
|
4
4
|
export interface AutoRefreshProps extends FirstParameter<typeof addToast> {
|
|
5
|
-
|
|
5
|
+
onRefresh?: () => void;
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare const AutoRefresh: FC<AutoRefreshProps>;
|
|
9
|
-
export default AutoRefresh;
|
|
8
|
+
export declare const AutoRefresh: FC<AutoRefreshProps>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_soda_hooks_b1fef7dd__ from "soda-hooks";
|
|
4
|
-
const AutoRefresh = ({ children,
|
|
4
|
+
const AutoRefresh = ({ children, onRefresh, ...rest })=>{
|
|
5
5
|
if ("development" === process.env.NODE_ENV) return children;
|
|
6
6
|
function onPress(e) {
|
|
7
7
|
const closeButton = e.target.parentElement?.querySelector(`[aria-label="关闭"]`);
|
|
8
8
|
closeButton?.click();
|
|
9
|
-
|
|
9
|
+
onRefresh?.();
|
|
10
10
|
}
|
|
11
11
|
(0, __WEBPACK_EXTERNAL_MODULE_soda_hooks_b1fef7dd__.useAutoRefresh)(()=>(0, __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__.addToast)({
|
|
12
12
|
title: "检测到页面更新",
|
|
@@ -24,5 +24,4 @@ const AutoRefresh = ({ children, onNavigate, ...rest })=>{
|
|
|
24
24
|
}));
|
|
25
25
|
return children;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
export { AutoRefresh_rslib_entry_ as default };
|
|
27
|
+
export { AutoRefresh };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soda-heroui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@internationalized/date": "^3.7.0",
|
|
39
39
|
"@tanstack/react-form": "^1.3.0",
|
|
40
|
-
"deepsea-tools": "5.
|
|
41
|
-
"soda-type": "6.2.0",
|
|
40
|
+
"deepsea-tools": "5.26.0",
|
|
42
41
|
"soda-tanstack-form": "0.1.0",
|
|
43
|
-
"soda-hooks": "6.8.
|
|
42
|
+
"soda-hooks": "6.8.1",
|
|
43
|
+
"soda-type": "6.2.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
@@ -4,17 +4,17 @@ import { useAutoRefresh } from "soda-hooks"
|
|
|
4
4
|
import { FirstParameter } from "soda-type"
|
|
5
5
|
|
|
6
6
|
export interface AutoRefreshProps extends FirstParameter<typeof addToast> {
|
|
7
|
-
|
|
7
|
+
onRefresh?: () => void
|
|
8
8
|
children?: ReactNode
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const AutoRefresh: FC<AutoRefreshProps> = ({ children,
|
|
11
|
+
export const AutoRefresh: FC<AutoRefreshProps> = ({ children, onRefresh, ...rest }) => {
|
|
12
12
|
if (process.env.NODE_ENV === "development") return children
|
|
13
13
|
|
|
14
14
|
function onPress(e: PressEvent) {
|
|
15
15
|
const closeButton = e.target.parentElement?.querySelector(`[aria-label="关闭"]`) as HTMLButtonElement
|
|
16
16
|
closeButton?.click()
|
|
17
|
-
|
|
17
|
+
onRefresh?.()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
useAutoRefresh(() =>
|
|
@@ -34,5 +34,3 @@ const AutoRefresh: FC<AutoRefreshProps> = ({ children, onNavigate, ...rest }) =>
|
|
|
34
34
|
|
|
35
35
|
return children
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
export default AutoRefresh
|