@rufous/ui 0.1.53 → 0.1.55
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/dist/Buttons/index.cjs +6 -4
- package/dist/Buttons/index.js +1 -1
- package/dist/Buttons/submitButton.cjs +6 -4
- package/dist/Buttons/submitButton.d.cts +2 -2
- package/dist/Buttons/submitButton.d.ts +2 -2
- package/dist/Buttons/submitButton.js +1 -1
- package/dist/Dialogs/BaseDialog.js +1 -1
- package/dist/Dialogs/index.js +1 -1
- package/dist/{chunk-Q4AO4QJY.js → chunk-SG65CGSF.js} +6 -4
- package/dist/main.cjs +6 -4
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/Buttons/index.cjs
CHANGED
|
@@ -86,7 +86,8 @@ var SubmitButton = ({
|
|
|
86
86
|
}) => {
|
|
87
87
|
const [loading, setLoading] = React3.useState(false);
|
|
88
88
|
const clickTimeout = React3.useRef(null);
|
|
89
|
-
const handleClick = async () => {
|
|
89
|
+
const handleClick = async (e) => {
|
|
90
|
+
e.persist();
|
|
90
91
|
if (loading) return;
|
|
91
92
|
if (clickTimeout.current) {
|
|
92
93
|
clearTimeout(clickTimeout.current);
|
|
@@ -96,14 +97,15 @@ var SubmitButton = ({
|
|
|
96
97
|
if (onClick) {
|
|
97
98
|
setLoading(true);
|
|
98
99
|
try {
|
|
99
|
-
await onClick();
|
|
100
|
+
await onClick(e);
|
|
100
101
|
} finally {
|
|
101
102
|
setLoading(false);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
}, 250);
|
|
105
106
|
};
|
|
106
|
-
const handleDoubleClick = async () => {
|
|
107
|
+
const handleDoubleClick = async (e) => {
|
|
108
|
+
e.persist();
|
|
107
109
|
if (loading) return;
|
|
108
110
|
if (clickTimeout.current) {
|
|
109
111
|
clearTimeout(clickTimeout.current);
|
|
@@ -112,7 +114,7 @@ var SubmitButton = ({
|
|
|
112
114
|
if (onDoubleClick) {
|
|
113
115
|
setLoading(true);
|
|
114
116
|
try {
|
|
115
|
-
await onDoubleClick();
|
|
117
|
+
await onDoubleClick(e);
|
|
116
118
|
} finally {
|
|
117
119
|
setLoading(false);
|
|
118
120
|
}
|
package/dist/Buttons/index.js
CHANGED
|
@@ -74,7 +74,8 @@ var SubmitButton = ({
|
|
|
74
74
|
}) => {
|
|
75
75
|
const [loading, setLoading] = React2.useState(false);
|
|
76
76
|
const clickTimeout = React2.useRef(null);
|
|
77
|
-
const handleClick = async () => {
|
|
77
|
+
const handleClick = async (e) => {
|
|
78
|
+
e.persist();
|
|
78
79
|
if (loading) return;
|
|
79
80
|
if (clickTimeout.current) {
|
|
80
81
|
clearTimeout(clickTimeout.current);
|
|
@@ -84,14 +85,15 @@ var SubmitButton = ({
|
|
|
84
85
|
if (onClick) {
|
|
85
86
|
setLoading(true);
|
|
86
87
|
try {
|
|
87
|
-
await onClick();
|
|
88
|
+
await onClick(e);
|
|
88
89
|
} finally {
|
|
89
90
|
setLoading(false);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
}, 250);
|
|
93
94
|
};
|
|
94
|
-
const handleDoubleClick = async () => {
|
|
95
|
+
const handleDoubleClick = async (e) => {
|
|
96
|
+
e.persist();
|
|
95
97
|
if (loading) return;
|
|
96
98
|
if (clickTimeout.current) {
|
|
97
99
|
clearTimeout(clickTimeout.current);
|
|
@@ -100,7 +102,7 @@ var SubmitButton = ({
|
|
|
100
102
|
if (onDoubleClick) {
|
|
101
103
|
setLoading(true);
|
|
102
104
|
try {
|
|
103
|
-
await onDoubleClick();
|
|
105
|
+
await onDoubleClick(e);
|
|
104
106
|
} finally {
|
|
105
107
|
setLoading(false);
|
|
106
108
|
}
|
|
@@ -4,8 +4,8 @@ interface SubmitButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
type?: "button" | "submit" | "reset";
|
|
6
6
|
bgGradiant?: boolean;
|
|
7
|
-
onClick?: () => Promise<void> | void;
|
|
8
|
-
onDoubleClick?: () => Promise<void> | void;
|
|
7
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
|
|
8
|
+
onDoubleClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
}
|
|
11
11
|
declare const SubmitButton: React.FC<SubmitButtonProps>;
|
|
@@ -4,8 +4,8 @@ interface SubmitButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
type?: "button" | "submit" | "reset";
|
|
6
6
|
bgGradiant?: boolean;
|
|
7
|
-
onClick?: () => Promise<void> | void;
|
|
8
|
-
onDoubleClick?: () => Promise<void> | void;
|
|
7
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
|
|
8
|
+
onDoubleClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
}
|
|
11
11
|
declare const SubmitButton: React.FC<SubmitButtonProps>;
|
|
@@ -61,7 +61,7 @@ import "../chunk-QPGJCRBS.js";
|
|
|
61
61
|
import "../chunk-U7SARO5B.js";
|
|
62
62
|
import "../chunk-BMMDUQDJ.js";
|
|
63
63
|
import "../chunk-R3GARAVJ.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-SG65CGSF.js";
|
|
65
65
|
import "../chunk-YRFUVQDN.js";
|
|
66
66
|
export {
|
|
67
67
|
BaseDialog_default as default
|
package/dist/Dialogs/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import "../chunk-QPGJCRBS.js";
|
|
|
61
61
|
import "../chunk-U7SARO5B.js";
|
|
62
62
|
import "../chunk-BMMDUQDJ.js";
|
|
63
63
|
import "../chunk-R3GARAVJ.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-SG65CGSF.js";
|
|
65
65
|
import "../chunk-YRFUVQDN.js";
|
|
66
66
|
export {
|
|
67
67
|
BaseDialog_default as BaseDialog
|
|
@@ -15,7 +15,8 @@ var SubmitButton = ({
|
|
|
15
15
|
}) => {
|
|
16
16
|
const [loading, setLoading] = React.useState(false);
|
|
17
17
|
const clickTimeout = React.useRef(null);
|
|
18
|
-
const handleClick = async () => {
|
|
18
|
+
const handleClick = async (e) => {
|
|
19
|
+
e.persist();
|
|
19
20
|
if (loading) return;
|
|
20
21
|
if (clickTimeout.current) {
|
|
21
22
|
clearTimeout(clickTimeout.current);
|
|
@@ -25,14 +26,15 @@ var SubmitButton = ({
|
|
|
25
26
|
if (onClick) {
|
|
26
27
|
setLoading(true);
|
|
27
28
|
try {
|
|
28
|
-
await onClick();
|
|
29
|
+
await onClick(e);
|
|
29
30
|
} finally {
|
|
30
31
|
setLoading(false);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
}, 250);
|
|
34
35
|
};
|
|
35
|
-
const handleDoubleClick = async () => {
|
|
36
|
+
const handleDoubleClick = async (e) => {
|
|
37
|
+
e.persist();
|
|
36
38
|
if (loading) return;
|
|
37
39
|
if (clickTimeout.current) {
|
|
38
40
|
clearTimeout(clickTimeout.current);
|
|
@@ -41,7 +43,7 @@ var SubmitButton = ({
|
|
|
41
43
|
if (onDoubleClick) {
|
|
42
44
|
setLoading(true);
|
|
43
45
|
try {
|
|
44
|
-
await onDoubleClick();
|
|
46
|
+
await onDoubleClick(e);
|
|
45
47
|
} finally {
|
|
46
48
|
setLoading(false);
|
|
47
49
|
}
|
package/dist/main.cjs
CHANGED
|
@@ -1136,7 +1136,8 @@ var SubmitButton = ({
|
|
|
1136
1136
|
}) => {
|
|
1137
1137
|
const [loading, setLoading] = React56.useState(false);
|
|
1138
1138
|
const clickTimeout = React56.useRef(null);
|
|
1139
|
-
const handleClick = async () => {
|
|
1139
|
+
const handleClick = async (e) => {
|
|
1140
|
+
e.persist();
|
|
1140
1141
|
if (loading) return;
|
|
1141
1142
|
if (clickTimeout.current) {
|
|
1142
1143
|
clearTimeout(clickTimeout.current);
|
|
@@ -1146,14 +1147,15 @@ var SubmitButton = ({
|
|
|
1146
1147
|
if (onClick) {
|
|
1147
1148
|
setLoading(true);
|
|
1148
1149
|
try {
|
|
1149
|
-
await onClick();
|
|
1150
|
+
await onClick(e);
|
|
1150
1151
|
} finally {
|
|
1151
1152
|
setLoading(false);
|
|
1152
1153
|
}
|
|
1153
1154
|
}
|
|
1154
1155
|
}, 250);
|
|
1155
1156
|
};
|
|
1156
|
-
const handleDoubleClick = async () => {
|
|
1157
|
+
const handleDoubleClick = async (e) => {
|
|
1158
|
+
e.persist();
|
|
1157
1159
|
if (loading) return;
|
|
1158
1160
|
if (clickTimeout.current) {
|
|
1159
1161
|
clearTimeout(clickTimeout.current);
|
|
@@ -1162,7 +1164,7 @@ var SubmitButton = ({
|
|
|
1162
1164
|
if (onDoubleClick) {
|
|
1163
1165
|
setLoading(true);
|
|
1164
1166
|
try {
|
|
1165
|
-
await onDoubleClick();
|
|
1167
|
+
await onDoubleClick(e);
|
|
1166
1168
|
} finally {
|
|
1167
1169
|
setLoading(false);
|
|
1168
1170
|
}
|
package/dist/main.js
CHANGED