jy-headless 0.2.5 → 0.2.7
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/buttons/Button/index.js +4 -4
- package/cjs/buttons/Button/index.js +4 -4
- package/package.json +1 -1
- package/version.txt +1 -1
package/buttons/Button/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const Button = ({ onClick, debounce = false, loading = false, readOnly = false, disabled = false, children, ...props }) => {
|
|
5
|
-
const timer =
|
|
5
|
+
const timer = useRef(0);
|
|
6
6
|
const handleClick = (() => {
|
|
7
7
|
if (!onClick)
|
|
8
8
|
return;
|
|
@@ -14,7 +14,7 @@ const Button = ({ onClick, debounce = false, loading = false, readOnly = false,
|
|
|
14
14
|
}
|
|
15
15
|
return onClick;
|
|
16
16
|
})();
|
|
17
|
-
return (
|
|
17
|
+
return (jsx("button", { onClick: handleClick, disabled: disabled || loading || readOnly, ...props, children: children }));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export { Button as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var jsxRuntime = require('
|
|
4
|
-
var
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
5
|
|
|
6
6
|
const Button = ({ onClick, debounce = false, loading = false, readOnly = false, disabled = false, children, ...props }) => {
|
|
7
|
-
const timer =
|
|
7
|
+
const timer = react.useRef(0);
|
|
8
8
|
const handleClick = (() => {
|
|
9
9
|
if (!onClick)
|
|
10
10
|
return;
|
|
@@ -16,7 +16,7 @@ const Button = ({ onClick, debounce = false, loading = false, readOnly = false,
|
|
|
16
16
|
}
|
|
17
17
|
return onClick;
|
|
18
18
|
})();
|
|
19
|
-
return (jsxRuntime.
|
|
19
|
+
return (jsxRuntime.jsx("button", { onClick: handleClick, disabled: disabled || loading || readOnly, ...props, children: children }));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
module.exports = Button;
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.7
|