@okam/stack-ui 1.39.2 → 1.40.0
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/CHANGELOG.md +10 -0
- package/index.d.ts +1 -0
- package/index143.js +1 -1
- package/index143.mjs +1 -1
- package/index144.js +1 -1
- package/index144.mjs +4 -4
- package/index145.js +1 -1
- package/index145.mjs +2 -2
- package/index146.js +1 -1
- package/index146.mjs +9 -9
- package/index168.js +1 -1
- package/index168.mjs +1 -1
- package/index171.js +1 -1
- package/index171.mjs +1 -1
- package/index172.js +1 -1
- package/index172.mjs +3 -3
- package/index203.js +1 -1
- package/index203.mjs +1 -1
- package/index204.js +1 -1
- package/index204.mjs +122 -138
- package/index205.js +1 -1
- package/index205.mjs +129 -192
- package/index206.js +1 -1
- package/index206.mjs +44 -22
- package/index207.js +1 -1
- package/index207.mjs +14 -49
- package/index208.js +1 -1
- package/index208.mjs +93 -46
- package/index209.js +1 -1
- package/index209.mjs +98 -89
- package/index210.js +1 -1
- package/index210.mjs +5 -72
- package/index211.js +1 -1
- package/index211.mjs +3 -68
- package/index212.js +1 -1
- package/index212.mjs +125 -7
- package/index213.js +1 -1
- package/index213.mjs +29 -11
- package/index214.js +1 -1
- package/index214.mjs +40 -113
- package/index215.js +1 -1
- package/index215.mjs +41 -131
- package/index216.js +1 -1
- package/index216.mjs +36 -43
- package/index217.js +1 -1
- package/index217.mjs +110 -11
- package/index218.js +1 -1
- package/index218.mjs +59 -77
- package/index219.js +1 -1
- package/index219.mjs +94 -99
- package/index220.js +1 -1
- package/index220.mjs +98 -5
- package/index221.js +1 -1
- package/index221.mjs +140 -3
- package/index222.js +1 -1
- package/index222.mjs +191 -119
- package/index223.js +1 -1
- package/index223.mjs +22 -29
- package/index224.js +1 -1
- package/index224.mjs +49 -51
- package/index225.js +1 -1
- package/index225.mjs +47 -43
- package/index226.js +1 -1
- package/index226.mjs +95 -35
- package/index227.js +1 -1
- package/index227.mjs +72 -114
- package/index228.js +1 -1
- package/index228.mjs +67 -76
- package/index229.js +1 -1
- package/index229.mjs +7 -101
- package/index230.js +1 -1
- package/index230.mjs +12 -98
- package/index260.js +1 -1
- package/index260.mjs +1 -1
- package/index263.js +1 -1
- package/index263.mjs +5 -5
- package/index264.js +1 -1
- package/index264.mjs +1 -1
- package/index265.js +1 -1
- package/index265.mjs +4 -4
- package/index266.js +1 -1
- package/index266.mjs +1 -1
- package/index267.js +1 -1
- package/index267.mjs +1 -1
- package/index268.js +1 -1
- package/index268.mjs +4 -4
- package/index269.js +1 -1
- package/index269.mjs +4 -4
- package/index270.js +1 -1
- package/index270.mjs +1 -1
- package/index271.js +1 -1
- package/index271.mjs +4 -4
- package/index272.js +1 -1
- package/index272.mjs +4 -4
- package/index273.js +1 -1
- package/index273.mjs +1 -1
- package/index274.js +1 -1
- package/index274.mjs +4 -4
- package/index275.js +1 -1
- package/index275.mjs +4 -4
- package/index276.js +1 -1
- package/index276.mjs +1 -1
- package/index277.js +1 -1
- package/index277.mjs +1 -1
- package/index278.js +1 -1
- package/index278.mjs +4 -4
- package/index279.js +1 -1
- package/index279.mjs +4 -4
- package/index280.js +1 -1
- package/index280.mjs +1 -1
- package/index281.js +1 -1
- package/index281.mjs +4 -4
- package/index282.js +1 -1
- package/index282.mjs +4 -4
- package/index283.js +1 -1
- package/index283.mjs +4 -4
- package/index284.js +1 -1
- package/index284.mjs +1 -1
- package/index285.js +1 -1
- package/index285.mjs +4 -4
- package/index286.js +1 -1
- package/index286.mjs +4 -4
- package/index287.js +1 -1
- package/index287.mjs +4 -4
- package/index288.js +1 -1
- package/index288.mjs +4 -4
- package/index289.js +1 -1
- package/index289.mjs +4 -4
- package/index290.js +1 -1
- package/index290.mjs +1 -1
- package/index291.js +1 -1
- package/index291.mjs +1 -1
- package/index292.js +1 -1
- package/index292.mjs +1 -1
- package/index293.js +1 -1
- package/index293.mjs +4 -4
- package/index294.js +1 -1
- package/index294.mjs +4 -4
- package/index295.js +1 -1
- package/index295.mjs +4 -4
- package/index296.js +1 -1
- package/index296.mjs +4 -4
- package/index297.js +1 -1
- package/index297.mjs +5 -5
- package/index306.js +1 -1
- package/index306.mjs +63 -7
- package/index307.js +1 -1
- package/index307.mjs +7 -28
- package/index308.js +1 -1
- package/index308.mjs +24 -89
- package/index309.js +1 -1
- package/index309.mjs +88 -58
- package/index316.js +1 -1
- package/index316.mjs +1 -1
- package/index317.js +1 -1
- package/index317.mjs +1 -1
- package/package.json +2 -2
package/index306.mjs
CHANGED
|
@@ -1,9 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ignoreFocusEvent as b } from "./index309.mjs";
|
|
2
|
+
import { getOwnerDocument as v, getOwnerWindow as s } from "./index179.mjs";
|
|
3
|
+
import { isMac as L } from "./index184.mjs";
|
|
4
|
+
import { isVirtualClick as y } from "./index198.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
let f = null, w = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = !1, c = !1;
|
|
7
|
+
function u(e, n) {
|
|
8
|
+
for (let t of w) t(e, n);
|
|
9
|
+
}
|
|
10
|
+
function g(e) {
|
|
11
|
+
return !(e.metaKey || !L() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
12
|
+
}
|
|
13
|
+
function d(e) {
|
|
14
|
+
a = !0, g(e) && (f = "keyboard", u("keyboard", e));
|
|
15
|
+
}
|
|
16
|
+
function o(e) {
|
|
17
|
+
f = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (a = !0, u("pointer", e));
|
|
18
|
+
}
|
|
19
|
+
function l(e) {
|
|
20
|
+
y(e) && (a = !0, f = "virtual");
|
|
21
|
+
}
|
|
22
|
+
function p(e) {
|
|
23
|
+
e.target === window || e.target === document || b || !e.isTrusted || (!a && !c && (f = "virtual", u("virtual", e)), a = !1, c = !1);
|
|
24
|
+
}
|
|
25
|
+
function E() {
|
|
26
|
+
b || (a = !1, c = !0);
|
|
27
|
+
}
|
|
28
|
+
function $(e) {
|
|
29
|
+
if (typeof window > "u" || i.get(s(e))) return;
|
|
30
|
+
const n = s(e), t = v(e);
|
|
31
|
+
let r = n.HTMLElement.prototype.focus;
|
|
32
|
+
n.HTMLElement.prototype.focus = function() {
|
|
33
|
+
a = !0, r.apply(this, arguments);
|
|
34
|
+
}, t.addEventListener("keydown", d, !0), t.addEventListener("keyup", d, !0), t.addEventListener("click", l, !0), n.addEventListener("focus", p, !0), n.addEventListener("blur", E, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", o, !0), t.addEventListener("pointermove", o, !0), t.addEventListener("pointerup", o, !0)) : process.env.NODE_ENV === "test" && (t.addEventListener("mousedown", o, !0), t.addEventListener("mousemove", o, !0), t.addEventListener("mouseup", o, !0)), n.addEventListener("beforeunload", () => {
|
|
35
|
+
m(e);
|
|
36
|
+
}, {
|
|
37
|
+
once: !0
|
|
38
|
+
}), i.set(n, {
|
|
39
|
+
focus: r
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const m = (e, n) => {
|
|
43
|
+
const t = s(e), r = v(e);
|
|
44
|
+
n && r.removeEventListener("DOMContentLoaded", n), i.has(t) && (t.HTMLElement.prototype.focus = i.get(t).focus, r.removeEventListener("keydown", d, !0), r.removeEventListener("keyup", d, !0), r.removeEventListener("click", l, !0), t.removeEventListener("focus", p, !0), t.removeEventListener("blur", E, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", o, !0), r.removeEventListener("pointermove", o, !0), r.removeEventListener("pointerup", o, !0)) : process.env.NODE_ENV === "test" && (r.removeEventListener("mousedown", o, !0), r.removeEventListener("mousemove", o, !0), r.removeEventListener("mouseup", o, !0)), i.delete(t));
|
|
45
|
+
};
|
|
46
|
+
function k(e) {
|
|
47
|
+
const n = v(e);
|
|
48
|
+
let t;
|
|
49
|
+
return n.readyState !== "loading" ? $(e) : (t = () => {
|
|
50
|
+
$(e);
|
|
51
|
+
}, n.addEventListener("DOMContentLoaded", t)), () => m(e, t);
|
|
52
|
+
}
|
|
53
|
+
typeof document < "u" && k();
|
|
54
|
+
function D() {
|
|
55
|
+
return f;
|
|
56
|
+
}
|
|
57
|
+
function F(e) {
|
|
58
|
+
f = e, u(e, null);
|
|
59
|
+
}
|
|
7
60
|
export {
|
|
8
|
-
|
|
61
|
+
k as addWindowFocusTracking,
|
|
62
|
+
D as getInteractionModality,
|
|
63
|
+
i as hasSetupGlobalListeners,
|
|
64
|
+
F as setInteractionModality
|
|
9
65
|
};
|
package/index307.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),e=t.createContext({register:()=>{}});e.displayName="PressResponderContext";exports.PressResponderContext=e;
|
package/index307.mjs
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const c = u((e) => {
|
|
8
|
-
if (e.target === e.currentTarget)
|
|
9
|
-
return o && o(e), t && t(!1), !0;
|
|
10
|
-
}, [
|
|
11
|
-
o,
|
|
12
|
-
t
|
|
13
|
-
]), f = l(c), i = u((e) => {
|
|
14
|
-
const s = m(e.target), $ = s ? a(s) : a();
|
|
15
|
-
e.target === e.currentTarget && $ === p(e.nativeEvent) && (n && n(e), t && t(!0), f(e));
|
|
16
|
-
}, [
|
|
17
|
-
t,
|
|
18
|
-
n,
|
|
19
|
-
f
|
|
20
|
-
]);
|
|
21
|
-
return {
|
|
22
|
-
focusProps: {
|
|
23
|
-
onFocus: !r && (n || t || o) ? i : void 0,
|
|
24
|
-
onBlur: !r && (o || t) ? c : void 0
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
1
|
+
import e from "react";
|
|
2
|
+
const t = e.createContext({
|
|
3
|
+
register: () => {
|
|
4
|
+
}
|
|
5
|
+
});
|
|
6
|
+
t.displayName = "PressResponderContext";
|
|
28
7
|
export {
|
|
29
|
-
|
|
8
|
+
t as PressResponderContext
|
|
30
9
|
};
|
package/index308.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index309.js"),a=require("react"),r=require("./index178.js"),F=require("./index179.js");function v(l){let{isDisabled:u,onFocus:o,onBlur:n,onFocusChange:t}=l;const c=a.useCallback(e=>{if(e.target===e.currentTarget)return n&&n(e),t&&t(!1),!0},[n,t]),s=g.useSyntheticBlurEvent(c),d=a.useCallback(e=>{const i=F.getOwnerDocument(e.target),f=i?r.getActiveElement(i):r.getActiveElement();e.target===e.currentTarget&&f===r.getEventTarget(e.nativeEvent)&&(o&&o(e),t&&t(!0),s(e))},[t,o,s]);return{focusProps:{onFocus:!u&&(o||t||n)?d:void 0,onBlur:!u&&(n||t)?c:void 0}}}exports.useFocus=v;
|
package/index308.mjs
CHANGED
|
@@ -1,95 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, e;
|
|
11
|
-
}
|
|
12
|
-
function h(r, e) {
|
|
13
|
-
Object.defineProperty(r, "target", {
|
|
14
|
-
value: e
|
|
15
|
-
}), Object.defineProperty(r, "currentTarget", {
|
|
16
|
-
value: e
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function I(r) {
|
|
20
|
-
let e = E({
|
|
21
|
-
isFocused: !1,
|
|
22
|
-
observer: null
|
|
23
|
-
});
|
|
24
|
-
v(() => {
|
|
25
|
-
const t = e.current;
|
|
26
|
-
return () => {
|
|
27
|
-
t.observer && (t.observer.disconnect(), t.observer = null);
|
|
28
|
-
};
|
|
29
|
-
}, []);
|
|
30
|
-
let a = m((t) => {
|
|
31
|
-
r == null || r(t);
|
|
32
|
-
});
|
|
33
|
-
return $((t) => {
|
|
34
|
-
if (t.target instanceof HTMLButtonElement || t.target instanceof HTMLInputElement || t.target instanceof HTMLTextAreaElement || t.target instanceof HTMLSelectElement) {
|
|
35
|
-
e.current.isFocused = !0;
|
|
36
|
-
let o = t.target, u = (c) => {
|
|
37
|
-
if (e.current.isFocused = !1, o.disabled) {
|
|
38
|
-
let s = g(c);
|
|
39
|
-
a(s);
|
|
40
|
-
}
|
|
41
|
-
e.current.observer && (e.current.observer.disconnect(), e.current.observer = null);
|
|
42
|
-
};
|
|
43
|
-
o.addEventListener("focusout", u, {
|
|
44
|
-
once: !0
|
|
45
|
-
}), e.current.observer = new MutationObserver(() => {
|
|
46
|
-
if (e.current.isFocused && o.disabled) {
|
|
47
|
-
var c;
|
|
48
|
-
(c = e.current.observer) === null || c === void 0 || c.disconnect();
|
|
49
|
-
let s = o === document.activeElement ? null : document.activeElement;
|
|
50
|
-
o.dispatchEvent(new FocusEvent("blur", {
|
|
51
|
-
relatedTarget: s
|
|
52
|
-
})), o.dispatchEvent(new FocusEvent("focusout", {
|
|
53
|
-
bubbles: !0,
|
|
54
|
-
relatedTarget: s
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
}), e.current.observer.observe(o, {
|
|
58
|
-
attributes: !0,
|
|
59
|
-
attributeFilter: [
|
|
60
|
-
"disabled"
|
|
61
|
-
]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
1
|
+
import { useSyntheticBlurEvent as l } from "./index309.mjs";
|
|
2
|
+
import { useCallback as u } from "react";
|
|
3
|
+
import { getActiveElement as a, getEventTarget as p } from "./index178.mjs";
|
|
4
|
+
import { getOwnerDocument as m } from "./index179.mjs";
|
|
5
|
+
function x(d) {
|
|
6
|
+
let { isDisabled: r, onFocus: n, onBlur: o, onFocusChange: t } = d;
|
|
7
|
+
const c = u((e) => {
|
|
8
|
+
if (e.target === e.currentTarget)
|
|
9
|
+
return o && o(e), t && t(!1), !0;
|
|
64
10
|
}, [
|
|
65
|
-
|
|
11
|
+
o,
|
|
12
|
+
t
|
|
13
|
+
]), f = l(c), i = u((e) => {
|
|
14
|
+
const s = m(e.target), $ = s ? a(s) : a();
|
|
15
|
+
e.target === e.currentTarget && $ === p(e.nativeEvent) && (n && n(e), t && t(!0), f(e));
|
|
16
|
+
}, [
|
|
17
|
+
t,
|
|
18
|
+
n,
|
|
19
|
+
f
|
|
66
20
|
]);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!a || a === r) return;
|
|
73
|
-
d = !0;
|
|
74
|
-
let t = !1, o = (n) => {
|
|
75
|
-
(n.target === a || t) && n.stopImmediatePropagation();
|
|
76
|
-
}, u = (n) => {
|
|
77
|
-
(n.target === a || t) && (n.stopImmediatePropagation(), !r && !t && (t = !0, l(a), i()));
|
|
78
|
-
}, c = (n) => {
|
|
79
|
-
(n.target === r || t) && n.stopImmediatePropagation();
|
|
80
|
-
}, s = (n) => {
|
|
81
|
-
(n.target === r || t) && (n.stopImmediatePropagation(), t || (t = !0, l(a), i()));
|
|
21
|
+
return {
|
|
22
|
+
focusProps: {
|
|
23
|
+
onFocus: !r && (n || t || o) ? i : void 0,
|
|
24
|
+
onBlur: !r && (o || t) ? c : void 0
|
|
25
|
+
}
|
|
82
26
|
};
|
|
83
|
-
e.addEventListener("blur", o, !0), e.addEventListener("focusout", u, !0), e.addEventListener("focusin", s, !0), e.addEventListener("focus", c, !0);
|
|
84
|
-
let i = () => {
|
|
85
|
-
cancelAnimationFrame(f), e.removeEventListener("blur", o, !0), e.removeEventListener("focusout", u, !0), e.removeEventListener("focusin", s, !0), e.removeEventListener("focus", c, !0), d = !1, t = !1;
|
|
86
|
-
}, f = requestAnimationFrame(i);
|
|
87
|
-
return i;
|
|
88
27
|
}
|
|
89
28
|
export {
|
|
90
|
-
|
|
91
|
-
d as ignoreFocusEvent,
|
|
92
|
-
y as preventFocus,
|
|
93
|
-
h as setEventTarget,
|
|
94
|
-
I as useSyntheticBlurEvent
|
|
29
|
+
x as useFocus
|
|
95
30
|
};
|
package/index309.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index179.js"),l=require("./index182.js"),E=require("./index174.js"),m=require("./index196.js"),p=require("./index202.js"),d=require("react");function f(r){let e=r;return e.nativeEvent=r,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function g(r,e){Object.defineProperty(r,"target",{value:e}),Object.defineProperty(r,"currentTarget",{value:e})}function F(r){let e=d.useRef({isFocused:!1,observer:null});E.useLayoutEffect(()=>{const t=e.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let u=m.useEffectEvent(t=>{r==null||r(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){e.current.isFocused=!0;let o=t.target,s=c=>{if(e.current.isFocused=!1,o.disabled){let i=f(c);u(i)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&o.disabled){var c;(c=e.current.observer)===null||c===void 0||c.disconnect();let i=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:i})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:i}))}}),e.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[u])}exports.ignoreFocusEvent=!1;function L(r){for(;r&&!p.isFocusable(r);)r=r.parentElement;let e=b.getOwnerWindow(r),u=e.document.activeElement;if(!u||u===r)return;exports.ignoreFocusEvent=!0;let t=!1,o=n=>{(n.target===u||t)&&n.stopImmediatePropagation()},s=n=>{(n.target===u||t)&&(n.stopImmediatePropagation(),!r&&!t&&(t=!0,l.focusWithoutScrolling(u),a()))},c=n=>{(n.target===r||t)&&n.stopImmediatePropagation()},i=n=>{(n.target===r||t)&&(n.stopImmediatePropagation(),t||(t=!0,l.focusWithoutScrolling(u),a()))};e.addEventListener("blur",o,!0),e.addEventListener("focusout",s,!0),e.addEventListener("focusin",i,!0),e.addEventListener("focus",c,!0);let a=()=>{cancelAnimationFrame(v),e.removeEventListener("blur",o,!0),e.removeEventListener("focusout",s,!0),e.removeEventListener("focusin",i,!0),e.removeEventListener("focus",c,!0),exports.ignoreFocusEvent=!1,t=!1},v=requestAnimationFrame(a);return a}exports.createSyntheticEvent=f;exports.preventFocus=L;exports.setEventTarget=g;exports.useSyntheticBlurEvent=F;
|
package/index309.mjs
CHANGED
|
@@ -1,65 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
1
|
+
import { getOwnerWindow as b } from "./index179.mjs";
|
|
2
|
+
import { focusWithoutScrolling as l } from "./index182.mjs";
|
|
3
|
+
import { useLayoutEffect as v } from "./index174.mjs";
|
|
4
|
+
import { useEffectEvent as m } from "./index196.mjs";
|
|
5
|
+
import { isFocusable as p } from "./index202.mjs";
|
|
6
|
+
import { useRef as E, useCallback as $ } from "react";
|
|
7
|
+
function g(r) {
|
|
8
|
+
let e = r;
|
|
9
|
+
return e.nativeEvent = r, e.isDefaultPrevented = () => e.defaultPrevented, e.isPropagationStopped = () => e.cancelBubble, e.persist = () => {
|
|
10
|
+
}, e;
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
function o(e) {
|
|
17
|
-
f = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (a = !0, u("pointer", e));
|
|
18
|
-
}
|
|
19
|
-
function l(e) {
|
|
20
|
-
y(e) && (a = !0, f = "virtual");
|
|
21
|
-
}
|
|
22
|
-
function p(e) {
|
|
23
|
-
e.target === window || e.target === document || b || !e.isTrusted || (!a && !c && (f = "virtual", u("virtual", e)), a = !1, c = !1);
|
|
24
|
-
}
|
|
25
|
-
function E() {
|
|
26
|
-
b || (a = !1, c = !0);
|
|
27
|
-
}
|
|
28
|
-
function $(e) {
|
|
29
|
-
if (typeof window > "u" || i.get(s(e))) return;
|
|
30
|
-
const n = s(e), t = v(e);
|
|
31
|
-
let r = n.HTMLElement.prototype.focus;
|
|
32
|
-
n.HTMLElement.prototype.focus = function() {
|
|
33
|
-
a = !0, r.apply(this, arguments);
|
|
34
|
-
}, t.addEventListener("keydown", d, !0), t.addEventListener("keyup", d, !0), t.addEventListener("click", l, !0), n.addEventListener("focus", p, !0), n.addEventListener("blur", E, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", o, !0), t.addEventListener("pointermove", o, !0), t.addEventListener("pointerup", o, !0)) : process.env.NODE_ENV === "test" && (t.addEventListener("mousedown", o, !0), t.addEventListener("mousemove", o, !0), t.addEventListener("mouseup", o, !0)), n.addEventListener("beforeunload", () => {
|
|
35
|
-
m(e);
|
|
36
|
-
}, {
|
|
37
|
-
once: !0
|
|
38
|
-
}), i.set(n, {
|
|
39
|
-
focus: r
|
|
12
|
+
function h(r, e) {
|
|
13
|
+
Object.defineProperty(r, "target", {
|
|
14
|
+
value: e
|
|
15
|
+
}), Object.defineProperty(r, "currentTarget", {
|
|
16
|
+
value: e
|
|
40
17
|
});
|
|
41
18
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
19
|
+
function I(r) {
|
|
20
|
+
let e = E({
|
|
21
|
+
isFocused: !1,
|
|
22
|
+
observer: null
|
|
23
|
+
});
|
|
24
|
+
v(() => {
|
|
25
|
+
const t = e.current;
|
|
26
|
+
return () => {
|
|
27
|
+
t.observer && (t.observer.disconnect(), t.observer = null);
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
let a = m((t) => {
|
|
31
|
+
r == null || r(t);
|
|
32
|
+
});
|
|
33
|
+
return $((t) => {
|
|
34
|
+
if (t.target instanceof HTMLButtonElement || t.target instanceof HTMLInputElement || t.target instanceof HTMLTextAreaElement || t.target instanceof HTMLSelectElement) {
|
|
35
|
+
e.current.isFocused = !0;
|
|
36
|
+
let o = t.target, u = (c) => {
|
|
37
|
+
if (e.current.isFocused = !1, o.disabled) {
|
|
38
|
+
let s = g(c);
|
|
39
|
+
a(s);
|
|
40
|
+
}
|
|
41
|
+
e.current.observer && (e.current.observer.disconnect(), e.current.observer = null);
|
|
42
|
+
};
|
|
43
|
+
o.addEventListener("focusout", u, {
|
|
44
|
+
once: !0
|
|
45
|
+
}), e.current.observer = new MutationObserver(() => {
|
|
46
|
+
if (e.current.isFocused && o.disabled) {
|
|
47
|
+
var c;
|
|
48
|
+
(c = e.current.observer) === null || c === void 0 || c.disconnect();
|
|
49
|
+
let s = o === document.activeElement ? null : document.activeElement;
|
|
50
|
+
o.dispatchEvent(new FocusEvent("blur", {
|
|
51
|
+
relatedTarget: s
|
|
52
|
+
})), o.dispatchEvent(new FocusEvent("focusout", {
|
|
53
|
+
bubbles: !0,
|
|
54
|
+
relatedTarget: s
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}), e.current.observer.observe(o, {
|
|
58
|
+
attributes: !0,
|
|
59
|
+
attributeFilter: [
|
|
60
|
+
"disabled"
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}, [
|
|
65
|
+
a
|
|
66
|
+
]);
|
|
56
67
|
}
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
let d = !1;
|
|
69
|
+
function y(r) {
|
|
70
|
+
for (; r && !p(r); ) r = r.parentElement;
|
|
71
|
+
let e = b(r), a = e.document.activeElement;
|
|
72
|
+
if (!a || a === r) return;
|
|
73
|
+
d = !0;
|
|
74
|
+
let t = !1, o = (n) => {
|
|
75
|
+
(n.target === a || t) && n.stopImmediatePropagation();
|
|
76
|
+
}, u = (n) => {
|
|
77
|
+
(n.target === a || t) && (n.stopImmediatePropagation(), !r && !t && (t = !0, l(a), i()));
|
|
78
|
+
}, c = (n) => {
|
|
79
|
+
(n.target === r || t) && n.stopImmediatePropagation();
|
|
80
|
+
}, s = (n) => {
|
|
81
|
+
(n.target === r || t) && (n.stopImmediatePropagation(), t || (t = !0, l(a), i()));
|
|
82
|
+
};
|
|
83
|
+
e.addEventListener("blur", o, !0), e.addEventListener("focusout", u, !0), e.addEventListener("focusin", s, !0), e.addEventListener("focus", c, !0);
|
|
84
|
+
let i = () => {
|
|
85
|
+
cancelAnimationFrame(f), e.removeEventListener("blur", o, !0), e.removeEventListener("focusout", u, !0), e.removeEventListener("focusin", s, !0), e.removeEventListener("focus", c, !0), d = !1, t = !1;
|
|
86
|
+
}, f = requestAnimationFrame(i);
|
|
87
|
+
return i;
|
|
59
88
|
}
|
|
60
89
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
90
|
+
g as createSyntheticEvent,
|
|
91
|
+
d as ignoreFocusEvent,
|
|
92
|
+
y as preventFocus,
|
|
93
|
+
h as setEventTarget,
|
|
94
|
+
I as useSyntheticBlurEvent
|
|
65
95
|
};
|
package/index316.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index317.js"),d=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index317.js"),d=require("./index308.js"),P=require("./index310.js"),n=require("./index134.js"),x=require("./index190.js"),r=require("react");let a=r.createContext(null);function y(e){let t=r.useContext(a)||{};x.useSyncRef(t,e);let{ref:u,...o}=t;return o}function $(e,t){let{focusProps:u}=d.useFocus(e),{keyboardProps:o}=P.useKeyboard(e),f=n.mergeProps(u,o),l=y(t),i=e.isDisabled?{}:l,s=r.useRef(e.autoFocus);r.useEffect(()=>{s.current&&t.current&&b.focusSafely(t.current),s.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:n.mergeProps({...f,tabIndex:c},i)}}exports.FocusableContext=a;exports.useFocusable=$;
|
package/index316.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { focusSafely as d } from "./index317.mjs";
|
|
2
|
-
import { useFocus as n } from "./
|
|
2
|
+
import { useFocus as n } from "./index308.mjs";
|
|
3
3
|
import { useKeyboard as $ } from "./index310.mjs";
|
|
4
4
|
import { mergeProps as c } from "./index134.mjs";
|
|
5
5
|
import { useSyncRef as l } from "./index190.mjs";
|
package/index317.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index306.js"),o=require("./index178.js"),u=require("./index179.js"),i=require("./index182.js"),s=require("./index185.js");function l(e){const t=u.getOwnerDocument(e),n=o.getActiveElement(t);if(r.getInteractionModality()==="virtual"){let c=n;s.runAfterTransition(()=>{o.getActiveElement(t)===c&&e.isConnected&&i.focusWithoutScrolling(e)})}else i.focusWithoutScrolling(e)}exports.focusSafely=l;
|
package/index317.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getInteractionModality as a } from "./
|
|
1
|
+
import { getInteractionModality as a } from "./index306.mjs";
|
|
2
2
|
import { getActiveElement as o } from "./index178.mjs";
|
|
3
3
|
import { getOwnerDocument as i } from "./index179.mjs";
|
|
4
4
|
import { focusWithoutScrolling as f } from "./index182.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/stack-ui",
|
|
3
3
|
"main": "./index.js",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.40.0",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@internationalized/date": "3.8.0",
|
|
26
|
-
"@okam/core-lib": "1.
|
|
26
|
+
"@okam/core-lib": "1.17.0",
|
|
27
27
|
"@okam/logger": "1.1.0",
|
|
28
28
|
"@react-aria/accordion": "^3.0.0-alpha.36",
|
|
29
29
|
"@react-aria/checkbox": "3.15.4",
|