@telia-ace/widget-components-tab-stop 1.3.25-rc.2 → 1.3.25-rc.4
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/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +4 -4
- package/tab-stop-0c61b1b8.js +4 -0
- package/tab-stop-bfd62a90.mjs +41 -0
- package/tab-stop-a53e4966.mjs +0 -39
- package/tab-stop-bd0fb6e0.js +0 -4
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@telia-ace/widget-ui"),o=e=>t.createReactComponent(e,"tab-stop",Promise.resolve().then(()=>require("./tab-stop-
|
|
1
|
+
"use strict";const t=require("@telia-ace/widget-ui"),o=e=>t.createReactComponent(e,"tab-stop",Promise.resolve().then(()=>require("./tab-stop-0c61b1b8.js")));module.exports=o;
|
package/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-components-tab-stop",
|
|
3
|
-
"version": "1.3.25-rc.
|
|
3
|
+
"version": "1.3.25-rc.4",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/widget-core": "^1.3.25-rc.
|
|
14
|
-
"@telia-ace/widget-ui": "^1.3.25-rc.
|
|
15
|
-
"@telia-ace/widget-utilities": "^1.3.25-rc.
|
|
13
|
+
"@telia-ace/widget-core": "^1.3.25-rc.4",
|
|
14
|
+
"@telia-ace/widget-ui": "^1.3.25-rc.4",
|
|
15
|
+
"@telia-ace/widget-utilities": "^1.3.25-rc.4",
|
|
16
16
|
"@webprovisions/platform": "^1.1.4"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),y=require("@emotion/styled"),f=require("@telia-ace/widget-ui"),w=require("@telia-ace/widget-utilities"),n=require("react"),x=({className:l,...p})=>{const e=n.useRef(),u=f.useContainer(),{position:r="end"}=f.useProperties(),c=n.useRef(r);n.useEffect(()=>{c.current=r},[r]);const a=t=>{const[g]=u.get("widgetDOMElements"),s=Array.from(g.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]):not(.humany-tab-stop):not([tabindex=""])')),m=s.indexOf(t.relatedTarget)<s.indexOf(t.target),o=s.filter(i=>typeof window>"u"?!0:!(window.getComputedStyle(i).display==="none"||i.offsetWidth<=0&&i.offsetHeight<=0)),d=c.current==="end"||m?o[0]:o[o.length-1];d&&d.focus()};return n.useEffect(()=>{const[t]=u.get("widgetDOMElements");return e.current&&t&&e.current.addEventListener("focus",a),()=>{e.current&&e.current.removeEventListener("focus",a)}},[]),b.jsx(E,{...p,tabIndex:0,ref:e,className:w.appendClassNames(l,"humany-tab-stop")})},E=y.div`
|
|
2
|
+
opacity: 0;
|
|
3
|
+
position: absolute;
|
|
4
|
+
`;exports.default=x;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import y from "@emotion/styled";
|
|
3
|
+
import { useContainer as x, useProperties as w } from "@telia-ace/widget-ui";
|
|
4
|
+
import { appendClassNames as E } from "@telia-ace/widget-utilities";
|
|
5
|
+
import { useRef as c, useEffect as d } from "react";
|
|
6
|
+
const A = ({ className: l, ...m }) => {
|
|
7
|
+
const t = c(), i = x(), { position: n = "end" } = w(), a = c(n);
|
|
8
|
+
d(() => {
|
|
9
|
+
a.current = n;
|
|
10
|
+
}, [n]);
|
|
11
|
+
const f = (e) => {
|
|
12
|
+
const [p] = i.get(
|
|
13
|
+
"widgetDOMElements"
|
|
14
|
+
), o = Array.from(
|
|
15
|
+
p.querySelectorAll(
|
|
16
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]):not(.humany-tab-stop):not([tabindex=""])'
|
|
17
|
+
)
|
|
18
|
+
), g = o.indexOf(e.relatedTarget) < o.indexOf(e.target), r = o.filter((s) => typeof window > "u" ? !0 : !(window.getComputedStyle(s).display === "none" || s.offsetWidth <= 0 && s.offsetHeight <= 0)), u = a.current === "end" || g ? r[0] : r[r.length - 1];
|
|
19
|
+
u && u.focus();
|
|
20
|
+
};
|
|
21
|
+
return d(() => {
|
|
22
|
+
const [e] = i.get("widgetDOMElements");
|
|
23
|
+
return t.current && e && t.current.addEventListener("focus", f), () => {
|
|
24
|
+
t.current && t.current.removeEventListener("focus", f);
|
|
25
|
+
};
|
|
26
|
+
}, []), /* @__PURE__ */ b(
|
|
27
|
+
O,
|
|
28
|
+
{
|
|
29
|
+
...m,
|
|
30
|
+
tabIndex: 0,
|
|
31
|
+
ref: t,
|
|
32
|
+
className: E(l, "humany-tab-stop")
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}, O = y.div`
|
|
36
|
+
opacity: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
`;
|
|
39
|
+
export {
|
|
40
|
+
A as default
|
|
41
|
+
};
|
package/tab-stop-a53e4966.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import b from "@emotion/styled";
|
|
3
|
-
import { useContainer as g, useProperties as y } from "@telia-ace/widget-ui";
|
|
4
|
-
import { appendClassNames as w } from "@telia-ace/widget-utilities";
|
|
5
|
-
import { useRef as u, useEffect as a } from "react";
|
|
6
|
-
const C = ({ className: d, ...l }) => {
|
|
7
|
-
const t = u(), s = g(), { position: e = "end" } = y(), i = u(e);
|
|
8
|
-
a(() => {
|
|
9
|
-
i.current = e;
|
|
10
|
-
}, [e]);
|
|
11
|
-
const c = () => {
|
|
12
|
-
const [n] = s.get(
|
|
13
|
-
"widgetDOMElements"
|
|
14
|
-
), p = n.querySelectorAll(
|
|
15
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]):not(.humany-tab-stop):not([tabindex=""])'
|
|
16
|
-
), o = [].filter.call(p, (r) => typeof window > "u" ? !0 : !(window.getComputedStyle(r).display === "none" || r.offsetWidth <= 0 && r.offsetHeight <= 0)), f = i.current === "end" ? o[0] : o[o.length - 1];
|
|
17
|
-
f && f.focus();
|
|
18
|
-
};
|
|
19
|
-
return a(() => {
|
|
20
|
-
const [n] = s.get("widgetDOMElements");
|
|
21
|
-
return t.current && n && t.current.addEventListener("focus", c), () => {
|
|
22
|
-
t.current && t.current.removeEventListener("focus", c);
|
|
23
|
-
};
|
|
24
|
-
}, []), /* @__PURE__ */ m(
|
|
25
|
-
x,
|
|
26
|
-
{
|
|
27
|
-
...l,
|
|
28
|
-
tabIndex: 0,
|
|
29
|
-
ref: t,
|
|
30
|
-
className: w(d, "humany-tab-stop")
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}, x = b.div`
|
|
34
|
-
opacity: 0;
|
|
35
|
-
position: absolute;
|
|
36
|
-
`;
|
|
37
|
-
export {
|
|
38
|
-
C as default
|
|
39
|
-
};
|
package/tab-stop-bd0fb6e0.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),b=require("@emotion/styled"),d=require("@telia-ace/widget-ui"),m=require("@telia-ace/widget-utilities"),t=require("react"),y=({className:f,...l})=>{const e=t.useRef(),i=d.useContainer(),{position:n="end"}=d.useProperties(),u=t.useRef(n);t.useEffect(()=>{u.current=n},[n]);const c=()=>{const[s]=i.get("widgetDOMElements"),p=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]):not(.humany-tab-stop):not([tabindex=""])'),r=[].filter.call(p,o=>typeof window>"u"?!0:!(window.getComputedStyle(o).display==="none"||o.offsetWidth<=0&&o.offsetHeight<=0)),a=u.current==="end"?r[0]:r[r.length-1];a&&a.focus()};return t.useEffect(()=>{const[s]=i.get("widgetDOMElements");return e.current&&s&&e.current.addEventListener("focus",c),()=>{e.current&&e.current.removeEventListener("focus",c)}},[]),g.jsx(w,{...l,tabIndex:0,ref:e,className:m.appendClassNames(f,"humany-tab-stop")})},w=b.div`
|
|
2
|
-
opacity: 0;
|
|
3
|
-
position: absolute;
|
|
4
|
-
`;exports.default=y;
|