@acrool/react-picker 0.0.6-alpha.1 → 0.0.6-alpha.3
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.
|
@@ -5477,9 +5477,9 @@ function Hf(t) {
|
|
|
5477
5477
|
}
|
|
5478
5478
|
var Yf = Hf();
|
|
5479
5479
|
const Ys = ({
|
|
5480
|
-
|
|
5481
|
-
}) => (ut(() => (document.addEventListener("
|
|
5482
|
-
document.removeEventListener("
|
|
5480
|
+
onKeyDown: t
|
|
5481
|
+
}) => (ut(() => (document.addEventListener("keydown", t), () => {
|
|
5482
|
+
document.removeEventListener("keydown", t);
|
|
5483
5483
|
}), []), null), Xs = ({
|
|
5484
5484
|
onMousedown: t
|
|
5485
5485
|
}) => (ut(() => (document.addEventListener("mousedown", t), () => {
|
|
@@ -5561,7 +5561,7 @@ function fh(t, e) {
|
|
|
5561
5561
|
const P = mt((w) => {
|
|
5562
5562
|
[Ot.Tab].includes(w.key) && (a(!1), c(!1));
|
|
5563
5563
|
}, []), b = mt((w) => {
|
|
5564
|
-
([Ot.ArrowUp, Ot.ArrowDown, Ot.Enter].includes(w.key) || w.code === "Space") && a(!0);
|
|
5564
|
+
([Ot.ArrowUp, Ot.ArrowDown, Ot.Enter].includes(w.key) || w.code === "Space") && (w.stopPropagation(), a(!0));
|
|
5565
5565
|
}, []), x = mt((w) => {
|
|
5566
5566
|
!d.current && p.current && !p.current.contains(w.target) && c(!1);
|
|
5567
5567
|
}, []), y = mt((w) => {
|
|
@@ -5590,7 +5590,7 @@ function fh(t, e) {
|
|
|
5590
5590
|
onChange: f
|
|
5591
5591
|
},
|
|
5592
5592
|
children: /* @__PURE__ */ O.jsxs("div", { className: dn.root, children: [
|
|
5593
|
-
/* @__PURE__ */ O.jsx("div", { ref: p, className: dn.mainEl,
|
|
5593
|
+
/* @__PURE__ */ O.jsx("div", { ref: p, className: dn.mainEl, onKeyDown: C, children: /* @__PURE__ */ O.jsx(
|
|
5594
5594
|
n,
|
|
5595
5595
|
{
|
|
5596
5596
|
...s,
|
|
@@ -5615,8 +5615,8 @@ function fh(t, e) {
|
|
|
5615
5615
|
r && /* @__PURE__ */ O.jsx(Xf, { onPickerHide: v }),
|
|
5616
5616
|
r && /* @__PURE__ */ O.jsx(Xs, { onMousedown: y }),
|
|
5617
5617
|
l && /* @__PURE__ */ O.jsx(Xs, { onMousedown: x }),
|
|
5618
|
-
l && /* @__PURE__ */ O.jsx(Ys, {
|
|
5619
|
-
l && /* @__PURE__ */ O.jsx(Ys, {
|
|
5618
|
+
l && /* @__PURE__ */ O.jsx(Ys, { onKeyDown: b }),
|
|
5619
|
+
l && /* @__PURE__ */ O.jsx(Ys, { onKeyDown: P })
|
|
5620
5620
|
] })
|
|
5621
5621
|
}
|
|
5622
5622
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
interface HotkeyListenerProps {
|
|
2
|
-
|
|
2
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
5
|
* 透過 mount unmount 註冊 keydown 事件
|
|
6
6
|
* @param onKeydown
|
|
7
7
|
* @constructor
|
|
8
8
|
*/
|
|
9
|
-
declare const HotkeyListener: ({
|
|
9
|
+
declare const HotkeyListener: ({ onKeyDown }: HotkeyListenerProps) => null;
|
|
10
10
|
export default HotkeyListener;
|