@cruk/cruk-react-components 1.0.8 → 1.0.11
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/lib/cjs/node_modules/focus-lock/dist/es2015/focusInside.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusIsHidden.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusMerge.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusMerge.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusables.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/focusables.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/index.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/solver.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/all-affected.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/correctFocus.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/firstFocus.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +2 -0
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -0
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/is.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/parenting.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
- package/lib/cjs/node_modules/react-clientside-effect/lib/index.es.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/FocusGuard.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/medium.js.map +1 -1
- package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js +1 -1
- package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -1
- package/lib/cjs/node_modules/tslib/tslib.es6.js.map +1 -1
- package/lib/cjs/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/lib/cjs/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/lib/cjs/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/lib/cjs/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js.map +1 -1
- package/lib/cjs/src/components/Checkbox/styles.js +1 -1
- package/lib/cjs/src/components/DateField/styles.js +1 -1
- package/lib/cjs/src/components/GlobalStyle.js +1 -1
- package/lib/cjs/src/components/Heading/styles.js +1 -1
- package/lib/cjs/src/components/LegendWrapper/styles.js +1 -1
- package/lib/cjs/src/components/Link/styles.js +1 -1
- package/lib/cjs/src/components/Text/styles.js +1 -1
- package/lib/cjs/src/themes/cruk.js +1 -1
- package/lib/components/Heading/index.d.ts +7 -1
- package/lib/components/Heading/styles.d.ts +6 -0
- package/lib/components/Link/styles.d.ts +1 -0
- package/lib/components/Text/index.d.ts +5 -3
- package/lib/components/Text/styles.d.ts +3 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusInside.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusIsHidden.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusMerge.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusMerge.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusables.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/focusables.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/index.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/solver.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/all-affected.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/correctFocus.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +2 -0
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -0
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/is.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/parenting.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js +1 -1
- package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -1
- package/lib/es/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/lib/es/src/components/AddressLookup/README.md.js.map +1 -1
- package/lib/es/src/components/Avatar/README.md.js.map +1 -1
- package/lib/es/src/components/Badge/README.md.js.map +1 -1
- package/lib/es/src/components/Box/README.md.js.map +1 -1
- package/lib/es/src/components/Button/README.md.js.map +1 -1
- package/lib/es/src/components/Checkbox/README.md.js.map +1 -1
- package/lib/es/src/components/Checkbox/styles.js +1 -1
- package/lib/es/src/components/Collapse/README.md.js.map +1 -1
- package/lib/es/src/components/DateField/README.md.js.map +1 -1
- package/lib/es/src/components/DateField/styles.js +1 -1
- package/lib/es/src/components/ErrorText/README.md.js.map +1 -1
- package/lib/es/src/components/Footer/README.md.js.map +1 -1
- package/lib/es/src/components/GlobalStyle.js +1 -1
- package/lib/es/src/components/Header/README.md.js.map +1 -1
- package/lib/es/src/components/Heading/README.md.js.map +1 -1
- package/lib/es/src/components/Heading/styles.js +1 -1
- package/lib/es/src/components/Icon/README.md.js.map +1 -1
- package/lib/es/src/components/LegendWrapper/README.md.js.map +1 -1
- package/lib/es/src/components/LegendWrapper/styles.js +1 -1
- package/lib/es/src/components/Link/README.md.js.map +1 -1
- package/lib/es/src/components/Link/styles.js +1 -1
- package/lib/es/src/components/Loader/README.md.js.map +1 -1
- package/lib/es/src/components/Modal/README.md.js.map +1 -1
- package/lib/es/src/components/Pagination/README.md.js.map +1 -1
- package/lib/es/src/components/PopOver/README.md.js.map +1 -1
- package/lib/es/src/components/ProgressBar/README.md.js.map +1 -1
- package/lib/es/src/components/Radio/README.md.js.map +1 -1
- package/lib/es/src/components/RadioConsent/README.md.js.map +1 -1
- package/lib/es/src/components/Select/README.md.js.map +1 -1
- package/lib/es/src/components/Step/README.md.js.map +1 -1
- package/lib/es/src/components/Text/README.md.js.map +1 -1
- package/lib/es/src/components/Text/styles.js +1 -1
- package/lib/es/src/components/TextAreaField/README.md.js.map +1 -1
- package/lib/es/src/components/TextField/README.md.js.map +1 -1
- package/lib/es/src/components/Totaliser/README.md.js.map +1 -1
- package/lib/es/src/components/UserBlock/README.md.js.map +1 -1
- package/lib/es/src/themes/cruk.js +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +13 -13
- package/CHANGELOG.md +0 -159
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, HTMLAttributes } from "react";
|
|
2
2
|
import { SpacingProps } from "../Spacing";
|
|
3
|
-
import { FontSizeType, WordBreakType } from "../../types";
|
|
3
|
+
import { FontSizeType, WordBreakType, OverflowWrapType } from "../../types";
|
|
4
4
|
export declare type HeadingProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
5
5
|
h1?: boolean;
|
|
6
6
|
h2?: boolean;
|
|
@@ -8,12 +8,18 @@ export declare type HeadingProps = SpacingProps & HTMLAttributes<HTMLElement> &
|
|
|
8
8
|
h4?: boolean;
|
|
9
9
|
h5?: boolean;
|
|
10
10
|
h6?: boolean;
|
|
11
|
+
/** font size FontSizeType t-shirt sizes */
|
|
11
12
|
textSize?: FontSizeType;
|
|
13
|
+
/** horizontal alignment of text */
|
|
12
14
|
textAlign?: "left" | "right" | "center";
|
|
15
|
+
/** color of text */
|
|
13
16
|
textColor?: string;
|
|
14
17
|
/** styled-component polymorphic feature so you take the styling of a header and cast the component to be a "span" for example */
|
|
15
18
|
as?: any;
|
|
19
|
+
/** word-break behavior */
|
|
16
20
|
wordBreak?: WordBreakType;
|
|
21
|
+
/** overflow-wrap behavior */
|
|
22
|
+
overflowWrap?: OverflowWrapType;
|
|
17
23
|
};
|
|
18
24
|
/**
|
|
19
25
|
*
|
|
@@ -6,6 +6,7 @@ export declare const H1: import("styled-components").StyledComponent<"h1", any,
|
|
|
6
6
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
7
7
|
textColor?: string | undefined;
|
|
8
8
|
wordBreak?: WordBreakType | undefined;
|
|
9
|
+
overflowWrap?: WordBreakType | undefined;
|
|
9
10
|
}, never>;
|
|
10
11
|
export declare const H2: import("styled-components").StyledComponent<"h2", any, SpacingProps & {
|
|
11
12
|
theme: ThemeType;
|
|
@@ -13,6 +14,7 @@ export declare const H2: import("styled-components").StyledComponent<"h2", any,
|
|
|
13
14
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
14
15
|
textColor?: string | undefined;
|
|
15
16
|
wordBreak?: WordBreakType | undefined;
|
|
17
|
+
overflowWrap?: WordBreakType | undefined;
|
|
16
18
|
}, never>;
|
|
17
19
|
export declare const H3: import("styled-components").StyledComponent<"h3", any, SpacingProps & {
|
|
18
20
|
theme: ThemeType;
|
|
@@ -20,6 +22,7 @@ export declare const H3: import("styled-components").StyledComponent<"h3", any,
|
|
|
20
22
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
21
23
|
textColor?: string | undefined;
|
|
22
24
|
wordBreak?: WordBreakType | undefined;
|
|
25
|
+
overflowWrap?: WordBreakType | undefined;
|
|
23
26
|
}, never>;
|
|
24
27
|
export declare const H4: import("styled-components").StyledComponent<"h4", any, SpacingProps & {
|
|
25
28
|
theme: ThemeType;
|
|
@@ -27,6 +30,7 @@ export declare const H4: import("styled-components").StyledComponent<"h4", any,
|
|
|
27
30
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
28
31
|
textColor?: string | undefined;
|
|
29
32
|
wordBreak?: WordBreakType | undefined;
|
|
33
|
+
overflowWrap?: WordBreakType | undefined;
|
|
30
34
|
}, never>;
|
|
31
35
|
export declare const H5: import("styled-components").StyledComponent<"h5", any, SpacingProps & {
|
|
32
36
|
theme: ThemeType;
|
|
@@ -34,6 +38,7 @@ export declare const H5: import("styled-components").StyledComponent<"h5", any,
|
|
|
34
38
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
35
39
|
textColor?: string | undefined;
|
|
36
40
|
wordBreak?: WordBreakType | undefined;
|
|
41
|
+
overflowWrap?: WordBreakType | undefined;
|
|
37
42
|
}, never>;
|
|
38
43
|
export declare const H6: import("styled-components").StyledComponent<"h6", any, SpacingProps & {
|
|
39
44
|
theme: ThemeType;
|
|
@@ -41,4 +46,5 @@ export declare const H6: import("styled-components").StyledComponent<"h6", any,
|
|
|
41
46
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
42
47
|
textColor?: string | undefined;
|
|
43
48
|
wordBreak?: WordBreakType | undefined;
|
|
49
|
+
overflowWrap?: WordBreakType | undefined;
|
|
44
50
|
}, never>;
|
|
@@ -9,6 +9,7 @@ export declare const StyledLink: import("styled-components").StyledComponent<imp
|
|
|
9
9
|
textWeight?: number | undefined;
|
|
10
10
|
as?: any;
|
|
11
11
|
wordBreak?: import("../../types").WordBreakType | undefined;
|
|
12
|
+
overflowWrap?: import("../../types").OverflowWrapType | undefined;
|
|
12
13
|
ref?: import("react").Ref<HTMLElement> | undefined;
|
|
13
14
|
} & {
|
|
14
15
|
theme: ThemeType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, HTMLAttributes, Ref } from "react";
|
|
2
2
|
import { SpacingProps } from "../Spacing";
|
|
3
|
-
import { WordBreakType, FontSizeType, ColorKeyType } from "../../types";
|
|
3
|
+
import { WordBreakType, FontSizeType, ColorKeyType, OverflowWrapType } from "../../types";
|
|
4
4
|
/**
|
|
5
5
|
* Text is to be used as the main paragraph component (or span using as="span"). Using the Text component is preferred to simply adding text to a div and styling that div, this will guarantee we are always using the correct font and default text colour.
|
|
6
6
|
*/
|
|
@@ -11,12 +11,14 @@ export declare type TextProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
|
11
11
|
textAlign?: "left" | "right" | "center" | "justify";
|
|
12
12
|
/** font size FontSizeType t-shirt sizes */
|
|
13
13
|
textSize?: FontSizeType;
|
|
14
|
-
/** font weight theme.typography{fontWeightHeavy/fontWeightMedium/fontWeightLight/fontWeightVLight} is better than a random number */
|
|
14
|
+
/** font weight theme.typography{fontWeightHeavy/fontWeightNormal/fontWeightMedium/fontWeightLight/fontWeightVLight} is better than a random number */
|
|
15
15
|
textWeight?: number;
|
|
16
16
|
/** styled-components polymorphism where you can set this to "span", "p" or "h2" it default to "p" */
|
|
17
17
|
as?: any;
|
|
18
|
-
/** word
|
|
18
|
+
/** word-break behaviour */
|
|
19
19
|
wordBreak?: WordBreakType;
|
|
20
|
+
/** overflow-wrap behaviour */
|
|
21
|
+
overflowWrap?: OverflowWrapType;
|
|
20
22
|
/** react reference to the DOM element sometime used to scroll to or set focus after an error */
|
|
21
23
|
ref?: Ref<HTMLElement>;
|
|
22
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpacingProps } from "../Spacing";
|
|
2
|
-
import { WordBreakType, FontSizeType, ThemeType, ColorKeyType } from "../../types";
|
|
2
|
+
import { WordBreakType, FontSizeType, ThemeType, ColorKeyType, OverflowWrapType } from "../../types";
|
|
3
3
|
export declare type TextStyledProps = SpacingProps & {
|
|
4
4
|
textColor?: ColorKeyType;
|
|
5
5
|
textAlign?: "left" | "right" | "center" | "justify";
|
|
@@ -7,6 +7,7 @@ export declare type TextStyledProps = SpacingProps & {
|
|
|
7
7
|
textWeight?: number;
|
|
8
8
|
as?: any;
|
|
9
9
|
wordBreak?: WordBreakType;
|
|
10
|
+
overflowWrap?: OverflowWrapType;
|
|
10
11
|
theme: ThemeType;
|
|
11
12
|
};
|
|
12
13
|
export declare const TextStyled: import("styled-components").StyledComponent<"p", any, SpacingProps & {
|
|
@@ -16,5 +17,6 @@ export declare const TextStyled: import("styled-components").StyledComponent<"p"
|
|
|
16
17
|
textWeight?: number | undefined;
|
|
17
18
|
as?: any;
|
|
18
19
|
wordBreak?: WordBreakType | undefined;
|
|
20
|
+
overflowWrap?: OverflowWrapType | undefined;
|
|
19
21
|
theme: ThemeType;
|
|
20
22
|
}, never>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getAllAffectedNodes as t}from"./utils/all-affected.js";import{toArray as e}from"./utils/array.js";var
|
|
1
|
+
import{getAllAffectedNodes as t}from"./utils/all-affected.js";import{toArray as e}from"./utils/array.js";import{getActiveElement as r}from"./utils/getActiveElement.js";var n=function(t){return Boolean(e(t.querySelectorAll("iframe")).some((function(t){return t===document.activeElement})))},o=function(e){var o=document&&r();return!(!o||o.dataset&&o.dataset.focusGuard)&&t(e).reduce((function(t,e){return t||e.contains(o)||n(e)}),!1)};export{o as focusInside};
|
|
2
2
|
//# sourceMappingURL=focusInside.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusInside.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusInside.js"],"sourcesContent":["import { getAllAffectedNodes } from './utils/all-affected';\nimport { toArray } from './utils/array';\nvar focusInFrame = function (frame) { return frame === document.activeElement; };\nvar focusInsideIframe = function (topNode) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node); }));\n};\nexport var focusInside = function (topNode) {\n var activeElement = document &&
|
|
1
|
+
{"version":3,"file":"focusInside.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusInside.js"],"sourcesContent":["import { getAllAffectedNodes } from './utils/all-affected';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame) { return frame === document.activeElement; };\nvar focusInsideIframe = function (topNode) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node); }));\n};\nexport var focusInside = function (topNode) {\n var activeElement = document && getActiveElement();\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).reduce(function (result, node) { return result || node.contains(activeElement) || focusInsideIframe(node); }, false);\n};\n"],"names":["focusInsideIframe","topNode","Boolean","toArray","querySelectorAll","some","node","document","activeElement","focusInside","getActiveElement","dataset","focusGuard","getAllAffectedNodes","reduce","result","contains"],"mappings":"wKAGA,IACIA,EAAoB,SAAUC,GAC9B,OAAOC,QAAQC,EAAQF,EAAQG,iBAAiB,WAAWC,MAAK,SAAUC,GAAQ,OAAoBA,IAFnDC,SAASC,mBAIrDC,EAAc,SAAUR,GAC/B,IAAIO,EAAgBD,UAAYG,IAChC,SAAKF,GAAkBA,EAAcG,SAAWH,EAAcG,QAAQC,aAG/DC,EAAoBZ,GAASa,QAAO,SAAUC,EAAQT,GAAQ,OAAOS,GAAUT,EAAKU,SAASR,IAAkBR,EAAkBM,MAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FOCUS_ALLOW as t}from"./constants.js";import{toArray as
|
|
1
|
+
import{FOCUS_ALLOW as t}from"./constants.js";import{toArray as r}from"./utils/array.js";import{getActiveElement as o}from"./utils/getActiveElement.js";var n=function(){var n=document&&o();return!!n&&r(document.querySelectorAll("[".concat(t,"]"))).some((function(t){return t.contains(n)}))};export{n as focusIsHidden};
|
|
2
2
|
//# sourceMappingURL=focusIsHidden.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusIsHidden.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js"],"sourcesContent":["import { FOCUS_ALLOW } from './constants';\nimport { toArray } from './utils/array';\nexport var focusIsHidden = function () {\n
|
|
1
|
+
{"version":3,"file":"focusIsHidden.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js"],"sourcesContent":["import { FOCUS_ALLOW } from './constants';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nexport var focusIsHidden = function () {\n var activeElement = document && getActiveElement();\n if (!activeElement) {\n return false;\n }\n return toArray(document.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return node.contains(activeElement); });\n};\n"],"names":["focusIsHidden","activeElement","document","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"uJAGU,IAACA,EAAgB,WACvB,IAAIC,EAAgBC,UAAYC,IAChC,QAAKF,GAGEG,EAAQF,SAASG,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,MAAK,SAAUC,GAAQ,OAAOA,EAAKC,SAAST"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{newFocus as t,NEW_FOCUS as r}from"./solver.js";import{
|
|
1
|
+
import{newFocus as t,NEW_FOCUS as r}from"./solver.js";import{getAllTabbableNodes as n,getTabbableNodes as o}from"./utils/DOMutils.js";import{getAllAffectedNodes as i}from"./utils/all-affected.js";import{pickFirstFocus as e}from"./utils/firstFocus.js";import{getActiveElement as u}from"./utils/getActiveElement.js";import{isNotAGuard as f,isDefined as s,getDataset as m}from"./utils/is.js";import{getTopCommonParent as a,allParentAutofocusables as l}from"./utils/parenting.js";var c=function(c,p){var d=document&&u(),v=i(c).filter(f),j=a(d||c,c,v),g=new Map,M=n(v,g),h=o(v,g).filter((function(t){var r=t.node;return f(r)}));if(h[0]||(h=M)[0]){var w,x,E,O,A=n([j],g).map((function(t){return t.node})),D=(w=A,x=h,E=new Map,x.forEach((function(t){return E.set(t.node,t)})),w.map((function(t){return E.get(t)})).filter(s)),F=D.map((function(t){return t.node})),b=t(F,A,d,p);if(b===r){var k=M.map((function(t){return t.node})).filter((O=l(v,g),function(t){var r;return t.autofocus||!!(null===(r=m(t))||void 0===r?void 0:r.autofocus)||O.indexOf(t)>=0}));return{node:k&&k.length?e(k):e(F)}}return void 0===b?b:D[b]}};export{c as getFocusMerge};
|
|
2
2
|
//# sourceMappingURL=focusMerge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusMerge.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusMerge.js"],"sourcesContent":["import { NEW_FOCUS, newFocus } from './solver';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport {
|
|
1
|
+
{"version":3,"file":"focusMerge.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusMerge.js"],"sourcesContent":["import { NEW_FOCUS, newFocus } from './solver';\nimport { getAllTabbableNodes, getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { pickFirstFocus } from './utils/firstFocus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { getDataset, isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) { var _a; return node.autofocus || !!((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus) || autoFocusables.indexOf(node) >= 0; };\n};\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\nexport var getFocusMerge = function (topNode, lastNode) {\n var activeElement = document && getActiveElement();\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getAllTabbableNodes(entries, visibilityCache);\n var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n innerElements = anyFocusable;\n if (!innerElements[0]) {\n return undefined;\n }\n }\n var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n var innerNodes = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var autoFocusable = anyFocusable\n .map(function (_a) {\n var node = _a.node;\n return node;\n })\n .filter(findAutoFocused(allParentAutofocusables(entries, visibilityCache)));\n return {\n node: autoFocusable && autoFocusable.length ? pickFirstFocus(autoFocusable) : pickFirstFocus(innerNodes),\n };\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n"],"names":["getFocusMerge","topNode","lastNode","activeElement","document","getActiveElement","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","anyFocusable","getAllTabbableNodes","innerElements","getTabbableNodes","_a","node","srcNodes","dstNodes","remap","autoFocusables","outerNodes","map","orderedInnerElements","forEach","entity","set","get","isDefined","innerNodes","newId","newFocus","NEW_FOCUS","autoFocusable","allParentAutofocusables","autofocus","getDataset","indexOf","length","pickFirstFocus","undefined"],"mappings":"4dAOA,IAQWA,EAAgB,SAAUC,EAASC,GAC1C,IAAIC,EAAgBC,UAAYC,IAC5BC,EAAUC,EAAoBN,GAASO,OAAOC,GAC9CC,EAAeC,EAAmBR,GAAiBF,EAASA,EAASK,GACrEM,EAAkB,IAAIC,IACtBC,EAAeC,EAAoBT,EAASM,GAC5CI,EAAgBC,EAAiBX,EAASM,GAAiBJ,QAAO,SAAUU,GAC5E,IAAIC,EAAOD,EAAGC,KACd,OAAOV,EAAYU,MAEvB,GAAKH,EAAc,KACfA,EAAgBF,GACG,GAFvB,CAMA,IArByBM,EAAUC,EAC/BC,EAJwBC,EAwBxBC,EAAaT,EAAoB,CAACL,GAAeE,GAAiBa,KAAI,SAAUP,GAEhF,OADWA,EAAGC,QAGdO,GAzBqBN,EAyBeI,EAzBLH,EAyBiBL,EAxBhDM,EAAQ,IAAIT,IAChBQ,EAASM,SAAQ,SAAUC,GAAU,OAAON,EAAMO,IAAID,EAAOT,KAAMS,MAC5DR,EAASK,KAAI,SAAUN,GAAQ,OAAOG,EAAMQ,IAAIX,MAAUX,OAAOuB,IAuBpEC,EAAaN,EAAqBD,KAAI,SAAUP,GAEhD,OADWA,EAAGC,QAGdc,EAAQC,EAASF,EAAYR,EAAYrB,EAAeD,GAC5D,GAAI+B,IAAUE,EAAW,CACrB,IAAIC,EAAgBtB,EACfW,KAAI,SAAUP,GAEf,OADWA,EAAGC,QAGbX,QAxCmBe,EAwCIc,EAAwB/B,EAASM,GAvC1D,SAAUO,GAAQ,IAAID,EAAI,OAAOC,EAAKmB,cAA4C,QAA3BpB,EAAKqB,EAAWpB,UAA0B,IAAPD,OAAgB,EAASA,EAAGoB,YAAcf,EAAeiB,QAAQrB,IAAS,KAwCvK,MAAO,CACHA,KAAMiB,GAAiBA,EAAcK,OAASC,EAAeN,GAAiBM,EAAeV,IAGrG,YAAcW,IAAVV,EACOA,EAEJP,EAAqBO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getTabbableNodes as r}from"./utils/DOMutils.js";import{getAllAffectedNodes as t}from"./utils/all-affected.js";import{isNotAGuard as n,isGuard as i}from"./utils/is.js";import{getTopCommonParent as e}from"./utils/parenting.js";var o=function(o){var u=t(o).filter(n),f=e(o,o,u),a=new Map,m=r([f],a,!0),l=r(u,a).filter((function(r){var t=r.node;return n(t)})).map((function(r){return r.node}));return m.map((function(r){var t=r.node;return{node:t,index:r.index,lockItem:l.indexOf(t)>=0,guard:i(t)}}))};export{o as getFocusabledIn};
|
|
2
2
|
//# sourceMappingURL=focusables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusables.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusables.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"focusables.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusables.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\nexport var getFocusabledIn = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var visibilityCache = new Map();\n var outerNodes = getTabbableNodes([commonParent], visibilityCache, true);\n var innerElements = getTabbableNodes(entries, visibilityCache)\n .filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n })\n .map(function (_a) {\n var node = _a.node;\n return node;\n });\n return outerNodes.map(function (_a) {\n var node = _a.node, index = _a.index;\n return ({\n node: node,\n index: index,\n lockItem: innerElements.indexOf(node) >= 0,\n guard: isGuard(node),\n });\n });\n};\n"],"names":["getFocusabledIn","topNode","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","outerNodes","getTabbableNodes","innerElements","_a","node","map","index","lockItem","indexOf","guard","isGuard"],"mappings":"wOAIU,IAACA,EAAkB,SAAUC,GACnC,IAAIC,EAAUC,EAAoBF,GAASG,OAAOC,GAC9CC,EAAeC,EAAmBN,EAASA,EAASC,GACpDM,EAAkB,IAAIC,IACtBC,EAAaC,EAAiB,CAACL,GAAeE,GAAiB,GAC/DI,EAAgBD,EAAiBT,EAASM,GACzCJ,QAAO,SAAUS,GAClB,IAAIC,EAAOD,EAAGC,KACd,OAAOT,EAAYS,MAElBC,KAAI,SAAUF,GAEf,OADWA,EAAGC,QAGlB,OAAOJ,EAAWK,KAAI,SAAUF,GAC5B,IAAIC,EAAOD,EAAGC,KACd,MAAQ,CACJA,KAAMA,EACNE,MAHwBH,EAAGG,MAI3BC,SAAUL,EAAcM,QAAQJ,IAAS,EACzCK,MAAOC,EAAQN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/index.js"],"sourcesContent":["import * as constants from './constants';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/index.js"],"sourcesContent":["import * as constants from './constants';\nimport { focusInside } from './focusInside';\nimport { focusIsHidden } from './focusIsHidden';\nimport { getFocusMerge as focusMerge } from './focusMerge';\nimport { getFocusabledIn } from './focusables';\nimport { setFocus } from './setFocus';\nimport { focusNextElement, focusPrevElement } from './sibling';\nimport tabHook from './tabHook';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getActiveElement } from './utils/getActiveElement';\nexport { tabHook, focusInside, focusIsHidden, focusMerge, getFocusabledIn, constants, getAllAffectedNodes, focusNextElement, focusPrevElement, getActiveElement, };\nexport default setFocus;\n"],"names":["moveFocusInside","setFocus"],"mappings":"yCAWA,IAAAA,EAAeC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getFocusMerge as o}from"./focusMerge.js";var n=function(o,n){o.focus(n),"contentWindow"in o&&o.contentWindow&&o.contentWindow.focus()},t=0,e=!1,c=function(c,i,s){void 0===s&&(s={});var f=o(c,i);if(!e&&f){if(t>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),e=!0,void setTimeout((function(){e=!1}),1);t++,n(f.node,s.focusOptions),t--}};export{n as focusOn,c as setFocus};
|
|
1
|
+
import{getFocusMerge as o}from"./focusMerge.js";var n=function(o,n){"focus"in o&&o.focus(n),"contentWindow"in o&&o.contentWindow&&o.contentWindow.focus()},t=0,e=!1,c=function(c,i,s){void 0===s&&(s={});var f=o(c,i);if(!e&&f){if(t>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),e=!0,void setTimeout((function(){e=!1}),1);t++,n(f.node,s.focusOptions),t--}};export{n as focusOn,c as setFocus};
|
|
2
2
|
//# sourceMappingURL=setFocus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n target.focus(focusOptions);\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focusOptions","focus","contentWindow","guardCount","lockDisabled","setFocus","topNode","lastNode","options","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"gDACU,IAACA,EAAU,SAAUC,EAAQC,
|
|
1
|
+
{"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n if ('focus' in target) {\n target.focus(focusOptions);\n }\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focusOptions","focus","contentWindow","guardCount","lockDisabled","setFocus","topNode","lastNode","options","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"gDACU,IAACA,EAAU,SAAUC,EAAQC,GAC/B,UAAWD,GACXA,EAAOE,MAAMD,GAEb,kBAAmBD,GAAUA,EAAOG,eACpCH,EAAOG,cAAcD,SAGzBE,EAAa,EACbC,GAAe,EACRC,EAAW,SAAUC,EAASC,EAAUC,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAIC,EAAYC,EAAcJ,EAASC,GACvC,IAAIH,GAGAK,EAAW,CACX,GAAIN,EAAa,EAOb,OANAQ,QAAQC,MAAM,qJAEdR,GAAe,OACfS,YAAW,WACPT,GAAe,IAChB,GAGPD,IACAL,EAAQW,EAAUK,KAAMN,EAAQR,cAChCG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{correctNodes as i}from"./utils/correctFocus.js";import{pickFocusable as t}from"./utils/firstFocus.js";import{isGuard as r}from"./utils/is.js";var f="NEW_FOCUS",
|
|
1
|
+
import{correctNodes as i}from"./utils/correctFocus.js";import{pickFocusable as t}from"./utils/firstFocus.js";import{isGuard as r}from"./utils/is.js";var f="NEW_FOCUS",o=function(f,o,s,e){var n=f.length,a=f[0],d=f[n-1],O=r(s);if(!(s&&f.indexOf(s)>=0)){var x=void 0!==s?o.indexOf(s):-1,u=e?o.indexOf(e):x,m=e?f.indexOf(e):-1,v=x-u,c=o.indexOf(a),h=o.indexOf(d),b=i(o),l=(void 0!==s?b.indexOf(s):-1)-(e?b.indexOf(e):x),p=t(f,0),F=t(f,n-1);return-1===x||-1===m?"NEW_FOCUS":!v&&m>=0?m:x<=c&&O&&Math.abs(v)>1?F:x>=h&&O&&Math.abs(v)>1?p:v&&Math.abs(l)>1?m:x<=c?F:x>h?p:v?Math.abs(v)>1?m:(n+m+v)%n:void 0}};export{f as NEW_FOCUS,o as newFocus};
|
|
2
2
|
//# sourceMappingURL=solver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solver.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/solver.js"],"sourcesContent":["import { correctNodes } from './utils/correctFocus';\nimport { pickFocusable } from './utils/firstFocus';\nimport { isGuard } from './utils/is';\nexport var NEW_FOCUS = 'NEW_FOCUS';\nexport var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) {\n var cnt = innerNodes.length;\n var firstFocus = innerNodes[0];\n var lastFocus = innerNodes[cnt - 1];\n var isOnGuard = isGuard(activeElement);\n if (innerNodes.indexOf(activeElement) >= 0) {\n return undefined;\n }\n var activeIndex = outerNodes.indexOf(activeElement);\n var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;\n var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var
|
|
1
|
+
{"version":3,"file":"solver.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/solver.js"],"sourcesContent":["import { correctNodes } from './utils/correctFocus';\nimport { pickFocusable } from './utils/firstFocus';\nimport { isGuard } from './utils/is';\nexport var NEW_FOCUS = 'NEW_FOCUS';\nexport var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) {\n var cnt = innerNodes.length;\n var firstFocus = innerNodes[0];\n var lastFocus = innerNodes[cnt - 1];\n var isOnGuard = isGuard(activeElement);\n if (activeElement && innerNodes.indexOf(activeElement) >= 0) {\n return undefined;\n }\n var activeIndex = activeElement !== undefined ? outerNodes.indexOf(activeElement) : -1;\n var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;\n var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);\n var returnFirstNode = pickFocusable(innerNodes, 0);\n var returnLastNode = pickFocusable(innerNodes, cnt - 1);\n if (activeIndex === -1 || lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\n if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnLastNode;\n }\n if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnFirstNode;\n }\n if (indexDiff && Math.abs(correctedIndexDiff) > 1) {\n return lastNodeInside;\n }\n if (activeIndex <= firstNodeIndex) {\n return returnLastNode;\n }\n if (activeIndex > lastNodeIndex) {\n return returnFirstNode;\n }\n if (indexDiff) {\n if (Math.abs(indexDiff) > 1) {\n return lastNodeInside;\n }\n return (cnt + lastNodeInside + indexDiff) % cnt;\n }\n return undefined;\n};\n"],"names":["NEW_FOCUS","newFocus","innerNodes","outerNodes","activeElement","lastNode","cnt","length","firstFocus","lastFocus","isOnGuard","isGuard","indexOf","activeIndex","undefined","lastIndex","lastNodeInside","indexDiff","firstNodeIndex","lastNodeIndex","correctedNodes","correctNodes","correctedIndexDiff","returnFirstNode","pickFocusable","returnLastNode","Math","abs"],"mappings":"qJAGU,IAACA,EAAY,YACZC,EAAW,SAAUC,EAAYC,EAAYC,EAAeC,GACnE,IAAIC,EAAMJ,EAAWK,OACjBC,EAAaN,EAAW,GACxBO,EAAYP,EAAWI,EAAM,GAC7BI,EAAYC,EAAQP,GACxB,KAAIA,GAAiBF,EAAWU,QAAQR,IAAkB,GAA1D,CAGA,IAAIS,OAAgCC,IAAlBV,EAA8BD,EAAWS,QAAQR,IAAkB,EACjFW,EAAYV,EAAWF,EAAWS,QAAQP,GAAYQ,EACtDG,EAAiBX,EAAWH,EAAWU,QAAQP,IAAa,EAC5DY,EAAYJ,EAAcE,EAC1BG,EAAiBf,EAAWS,QAAQJ,GACpCW,EAAgBhB,EAAWS,QAAQH,GACnCW,EAAiBC,EAAalB,GAE9BmB,QADmCR,IAAlBV,EAA8BgB,EAAeR,QAAQR,IAAkB,IACjDC,EAAWe,EAAeR,QAAQP,GAAYQ,GACrFU,EAAkBC,EAActB,EAAY,GAC5CuB,EAAiBD,EAActB,EAAYI,EAAM,GACrD,OAAqB,IAAjBO,IAA0C,IAApBG,EApBP,aAuBdC,GAAaD,GAAkB,EACzBA,EAEPH,GAAeK,GAAkBR,GAAagB,KAAKC,IAAIV,GAAa,EAC7DQ,EAEPZ,GAAeM,GAAiBT,GAAagB,KAAKC,IAAIV,GAAa,EAC5DM,EAEPN,GAAaS,KAAKC,IAAIL,GAAsB,EACrCN,EAEPH,GAAeK,EACRO,EAEPZ,EAAcM,EACPI,EAEPN,EACIS,KAAKC,IAAIV,GAAa,EACfD,GAEHV,EAAMU,EAAiBC,GAAaX,OAJhD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FOCUS_GROUP as r,FOCUS_DISABLED as t}from"../constants.js";import{toArray as e,asArray as n}from"./array.js";var o=function(r){return r.parentNode?o(r.parentNode):r},a=function(a){return n(a).filter(Boolean).reduce((function(n,a){var
|
|
1
|
+
import{FOCUS_GROUP as r,FOCUS_DISABLED as t}from"../constants.js";import{toArray as e,asArray as n}from"./array.js";var o=function(r){return r.parentNode?o(r.parentNode):r},a=function(a){return n(a).filter(Boolean).reduce((function(n,a){var c=a.getAttribute(r);return n.push.apply(n,c?function(r){for(var t=new Set,e=r.length,n=0;n<e;n+=1)for(var o=n+1;o<e;o+=1){var a=r[n].compareDocumentPosition(r[o]);(a&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(a&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(n)}return r.filter((function(r,e){return!t.has(e)}))}(e(o(a).querySelectorAll("[".concat(r,'="').concat(c,'"]:not([').concat(t,'="disabled"])')))):[a]),n}),[])};export{a as getAllAffectedNodes};
|
|
2
2
|
//# sourceMappingURL=all-affected.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-affected.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/all-affected.js"],"sourcesContent":["import { FOCUS_DISABLED, FOCUS_GROUP } from '../constants';\nimport { asArray, toArray } from './array';\nvar filterNested = function (nodes) {\n var contained = new Set();\n var l = nodes.length;\n for (var i = 0; i < l; i += 1) {\n for (var j = i + 1; j < l; j += 1) {\n var position = nodes[i].compareDocumentPosition(nodes[j]);\n if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {\n contained.add(j);\n }\n if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) {\n contained.add(i);\n }\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\nexport var getAllAffectedNodes = function (node) {\n var nodes = asArray(node);\n return nodes.filter(Boolean).reduce(function (acc, currentNode) {\n var group = currentNode.getAttribute(FOCUS_GROUP);\n acc.push.apply(acc, (group\n ? filterNested(toArray(getTopParent(currentNode).querySelectorAll(\"[\"
|
|
1
|
+
{"version":3,"file":"all-affected.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/all-affected.js"],"sourcesContent":["import { FOCUS_DISABLED, FOCUS_GROUP } from '../constants';\nimport { asArray, toArray } from './array';\nvar filterNested = function (nodes) {\n var contained = new Set();\n var l = nodes.length;\n for (var i = 0; i < l; i += 1) {\n for (var j = i + 1; j < l; j += 1) {\n var position = nodes[i].compareDocumentPosition(nodes[j]);\n if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {\n contained.add(j);\n }\n if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) {\n contained.add(i);\n }\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\nexport var getAllAffectedNodes = function (node) {\n var nodes = asArray(node);\n return nodes.filter(Boolean).reduce(function (acc, currentNode) {\n var group = currentNode.getAttribute(FOCUS_GROUP);\n acc.push.apply(acc, (group\n ? filterNested(toArray(getTopParent(currentNode).querySelectorAll(\"[\".concat(FOCUS_GROUP, \"=\\\"\").concat(group, \"\\\"]:not([\").concat(FOCUS_DISABLED, \"=\\\"disabled\\\"])\"))))\n : [currentNode]));\n return acc;\n }, []);\n};\n"],"names":["getTopParent","node","parentNode","getAllAffectedNodes","asArray","filter","Boolean","reduce","acc","currentNode","group","getAttribute","FOCUS_GROUP","push","apply","nodes","contained","Set","l","length","i","j","position","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","add","DOCUMENT_POSITION_CONTAINS","_","index","has","filterNested","toArray","querySelectorAll","concat","FOCUS_DISABLED"],"mappings":"oHAEA,IAgBIA,EAAe,SAAUC,GACzB,OAAOA,EAAKC,WAAaF,EAAaC,EAAKC,YAAcD,GAElDE,EAAsB,SAAUF,GAEvC,OADYG,EAAQH,GACPI,OAAOC,SAASC,QAAO,SAAUC,EAAKC,GAC/C,IAAIC,EAAQD,EAAYE,aAAaC,GAIrC,OAHAJ,EAAIK,KAAKC,MAAMN,EAAME,EAvBV,SAAUK,GAGzB,IAFA,IAAIC,EAAY,IAAIC,IAChBC,EAAIH,EAAMI,OACLC,EAAI,EAAGA,EAAIF,EAAGE,GAAK,EACxB,IAAK,IAAIC,EAAID,EAAI,EAAGC,EAAIH,EAAGG,GAAK,EAAG,CAC/B,IAAIC,EAAWP,EAAMK,GAAGG,wBAAwBR,EAAMM,KACjDC,EAAWE,KAAKC,gCAAkC,GACnDT,EAAUU,IAAIL,IAEbC,EAAWE,KAAKG,4BAA8B,GAC/CX,EAAUU,IAAIN,GAI1B,OAAOL,EAAMV,QAAO,SAAUuB,EAAGC,GAAS,OAAQb,EAAUc,IAAID,MAUtDE,CAAaC,EAAQhC,EAAaS,GAAawB,iBAAiB,IAAIC,OAAOtB,EAAa,MAAOsB,OAAOxB,EAAO,YAAawB,OAAOC,EAAgB,oBACjJ,CAAC1B,IACAD,IACR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{isRadioElement as n}from"./is.js";var r=function(r,t){return n(r)&&r.name?function(r,t){return t.filter(n).filter((function(n){return n.name===r.name})).filter((function(n){return n.checked}))[0]||r}(r,t):r},t=function(n){var t=new Set;return n.forEach((function(e){return t.add(r(e,n))})),n.filter((function(n){return t.has(n)}))};export{r as correctNode,t as correctNodes};
|
|
2
2
|
//# sourceMappingURL=correctFocus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correctFocus.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"correctFocus.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js"],"sourcesContent":["import { isRadioElement } from './is';\nvar findSelectedRadio = function (node, nodes) {\n return nodes\n .filter(isRadioElement)\n .filter(function (el) { return el.name === node.name; })\n .filter(function (el) { return el.checked; })[0] || node;\n};\nexport var correctNode = function (node, nodes) {\n if (isRadioElement(node) && node.name) {\n return findSelectedRadio(node, nodes);\n }\n return node;\n};\nexport var correctNodes = function (nodes) {\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n return nodes.filter(function (node) { return resultSet.has(node); });\n};\n"],"names":["correctNode","node","nodes","isRadioElement","name","filter","el","checked","findSelectedRadio","correctNodes","resultSet","Set","forEach","add","has"],"mappings":"yCACA,IAMWA,EAAc,SAAUC,EAAMC,GACrC,OAAIC,EAAeF,IAASA,EAAKG,KAPb,SAAUH,EAAMC,GACpC,OAAOA,EACFG,OAAOF,GACPE,QAAO,SAAUC,GAAM,OAAOA,EAAGF,OAASH,EAAKG,QAC/CC,QAAO,SAAUC,GAAM,OAAOA,EAAGC,WAAY,IAAMN,EAI7CO,CAAkBP,EAAMC,GAE5BD,GAEAQ,EAAe,SAAUP,GAChC,IAAIQ,EAAY,IAAIC,IAEpB,OADAT,EAAMU,SAAQ,SAAUX,GAAQ,OAAOS,EAAUG,IAAIb,EAAYC,EAAMC,OAChEA,EAAMG,QAAO,SAAUJ,GAAQ,OAAOS,EAAUI,IAAIb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getActiveElement.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["export var getActiveElement = function () {\n return (document.activeElement\n ? document.activeElement.shadowRoot\n ? document.activeElement.shadowRoot.activeElement\n : document.activeElement\n : undefined);\n};\n"],"names":["getActiveElement","document","activeElement","shadowRoot","undefined"],"mappings":"AAAU,IAACA,EAAmB,WAC1B,OAAQC,SAASC,cACXD,SAASC,cAAcC,WACnBF,SAASC,cAAcC,WAAWD,cAClCD,SAASC,mBACbE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=function(e,
|
|
1
|
+
var e=function(e,n){return!e||e===document||e&&e.nodeType===Node.DOCUMENT_NODE||!function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var n=window.getComputedStyle(e,null);return!(!n||!n.getPropertyValue||"none"!==n.getPropertyValue("display")&&"hidden"!==n.getPropertyValue("visibility"))}(e)&&n(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode)},n=function(t,r){var o=t.get(r);if(void 0!==o)return o;var u=e(r,n.bind(void 0,t));return t.set(r,u),u},t=function(e){return e.dataset},r=function(e){return"BUTTON"===e.tagName},o=function(e){return"INPUT"===e.tagName},u=function(e){return o(e)&&"radio"===e.type},i=function(e){return!((o(e)||r(e))&&("hidden"===e.type||e.disabled)||e.ariaDisabled)},d=function(e){var n;return Boolean(e&&(null===(n=t(e))||void 0===n?void 0:n.focusGuard))},a=function(e){return!d(e)},N=function(e){return Boolean(e)};export{t as getDataset,N as isDefined,d as isGuard,r as isHTMLButtonElement,o as isHTMLInputElement,a as isNotAGuard,u as isRadioElement,n as isVisibleCached,i as notHiddenInput};
|
|
2
2
|
//# sourceMappingURL=is.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["var isElementHidden = function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar isVisibleUncached = function (node, checkParent) {\n return !node ||\n node === document ||\n (node && node.nodeType === Node.DOCUMENT_NODE) ||\n (!isElementHidden(node) &&\n checkParent(node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n
|
|
1
|
+
{"version":3,"file":"is.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["var isElementHidden = function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar isVisibleUncached = function (node, checkParent) {\n return !node ||\n node === document ||\n (node && node.nodeType === Node.DOCUMENT_NODE) ||\n (!isElementHidden(node) &&\n checkParent(node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ?\n node.parentNode.host\n : node.parentNode));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled)) &&\n !node.ariaDisabled;\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n"],"names":["isVisibleUncached","node","checkParent","document","nodeType","Node","DOCUMENT_NODE","ELEMENT_NODE","computedStyle","window","getComputedStyle","getPropertyValue","isElementHidden","parentNode","DOCUMENT_FRAGMENT_NODE","host","isVisibleCached","visibilityCache","cached","get","undefined","result","bind","set","getDataset","dataset","isHTMLButtonElement","tagName","isHTMLInputElement","isRadioElement","type","notHiddenInput","disabled","ariaDisabled","isGuard","_a","Boolean","focusGuard","isNotAGuard","isDefined","x"],"mappings":"AAAA,IAUIA,EAAoB,SAAUC,EAAMC,GACpC,OAAQD,GACJA,IAASE,UACRF,GAAQA,EAAKG,WAAaC,KAAKC,gBAblB,SAAUL,GAC5B,GAAIA,EAAKG,WAAaC,KAAKE,aACvB,OAAO,EAEX,IAAIC,EAAgBC,OAAOC,iBAAiBT,EAAM,MAClD,SAAKO,IAAkBA,EAAcG,kBAGiB,SAA9CH,EAAcG,iBAAiB,YAA0E,WAAjDH,EAAcG,iBAAiB,eAMzFC,CAAgBX,IACdC,EAAYD,EAAKY,YAAcZ,EAAKY,WAAWT,WAAaC,KAAKS,uBAEzDb,EAAKY,WAAWE,KAClBd,EAAKY,aAEZG,EAAkB,SAAUC,EAAiBhB,GACpD,IAAIiB,EAASD,EAAgBE,IAAIlB,GACjC,QAAemB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EAASrB,EAAkBC,EAAMe,EAAgBM,UAAKF,EAAWH,IAErE,OADAA,EAAgBM,IAAItB,EAAMoB,GACnBA,GAEAG,EAAa,SAAUvB,GAC9B,OAAOA,EAAKwB,SAELC,EAAsB,SAAUzB,GAAQ,MAAwB,WAAjBA,EAAK0B,SACpDC,EAAqB,SAAU3B,GAAQ,MAAwB,UAAjBA,EAAK0B,SACnDE,EAAiB,SAAU5B,GAClC,OAAO2B,EAAmB3B,IAAuB,UAAdA,EAAK6B,MAEjCC,EAAiB,SAAU9B,GAClC,SAAU2B,EAAmB3B,IAASyB,EAAoBzB,MAAyB,WAAdA,EAAK6B,MAAqB7B,EAAK+B,WAC/F/B,EAAKgC,eAEHC,EAAU,SAAUjC,GAAQ,IAAIkC,EAAI,OAAOC,QAAQnC,IAAqC,QAA3BkC,EAAKX,EAAWvB,UAA0B,IAAPkC,OAAgB,EAASA,EAAGE,cAC5HC,EAAc,SAAUrC,GAAQ,OAAQiC,EAAQjC,IAChDsC,EAAY,SAAUC,GAAK,OAAOJ,QAAQI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{parentAutofocusables as r}from"./DOMutils.js";import{asArray as n}from"./array.js";var o=function(r,n){return void 0===n&&(n=[]),n.push(r),r.parentNode&&o(r.parentNode,n),n},t=function(r,n){for(var t=o(r),e=o(n),f=0;f<t.length;f+=1){var i=t[f];if(e.indexOf(i)>=0)return i}return!1},e=function(r,o,e){var f=n(r),i=n(o),u=f[0],a=!1;return i.filter(Boolean).forEach((function(r){a=t(a||r,r)||a,e.filter(Boolean).forEach((function(r){var n=t(u,r);n&&(a=!a||n.contains(a)?n:t(n,a))}))})),a},f=function(n,o){return n.reduce((function(n,t){return n.concat(r(t,o))}),[])};export{f as allParentAutofocusables,t as getCommonParent,e as getTopCommonParent};
|
|
2
2
|
//# sourceMappingURL=parenting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parenting.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"parenting.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js"],"sourcesContent":["import { parentAutofocusables } from './DOMutils';\nimport { asArray } from './array';\nvar getParents = function (node, parents) {\n if (parents === void 0) { parents = []; }\n parents.push(node);\n if (node.parentNode) {\n getParents(node.parentNode, parents);\n }\n return parents;\n};\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n for (var i = 0; i < parentsA.length; i += 1) {\n var currentParent = parentsA[i];\n if (parentsB.indexOf(currentParent) >= 0) {\n return currentParent;\n }\n }\n return false;\n};\nexport var getTopCommonParent = function (baseActiveElement, leftEntry, rightEntries) {\n var activeElements = asArray(baseActiveElement);\n var leftEntries = asArray(leftEntry);\n var activeElement = activeElements[0];\n var topCommon = false;\n leftEntries.filter(Boolean).forEach(function (entry) {\n topCommon = getCommonParent(topCommon || entry, entry) || topCommon;\n rightEntries.filter(Boolean).forEach(function (subEntry) {\n var common = getCommonParent(activeElement, subEntry);\n if (common) {\n if (!topCommon || common.contains(topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n return topCommon;\n};\nexport var allParentAutofocusables = function (entries, visibilityCache) {\n return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []);\n};\n"],"names":["getParents","node","parents","push","parentNode","getCommonParent","nodeA","nodeB","parentsA","parentsB","i","length","currentParent","indexOf","getTopCommonParent","baseActiveElement","leftEntry","rightEntries","activeElements","asArray","leftEntries","activeElement","topCommon","filter","Boolean","forEach","entry","subEntry","common","contains","allParentAutofocusables","entries","visibilityCache","reduce","acc","concat","parentAutofocusables"],"mappings":"0FAEA,IAAIA,EAAa,SAAUC,EAAMC,GAM7B,YALgB,IAAZA,IAAsBA,EAAU,IACpCA,EAAQC,KAAKF,GACTA,EAAKG,YACLJ,EAAWC,EAAKG,WAAYF,GAEzBA,GAEAG,EAAkB,SAAUC,EAAOC,GAG1C,IAFA,IAAIC,EAAWR,EAAWM,GACtBG,EAAWT,EAAWO,GACjBG,EAAI,EAAGA,EAAIF,EAASG,OAAQD,GAAK,EAAG,CACzC,IAAIE,EAAgBJ,EAASE,GAC7B,GAAID,EAASI,QAAQD,IAAkB,EACnC,OAAOA,EAGf,OAAO,GAEAE,EAAqB,SAAUC,EAAmBC,EAAWC,GACpE,IAAIC,EAAiBC,EAAQJ,GACzBK,EAAcD,EAAQH,GACtBK,EAAgBH,EAAe,GAC/BI,GAAY,EAehB,OAdAF,EAAYG,OAAOC,SAASC,SAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,SAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaM,EAAOC,SAASP,GAClBM,EAGAvB,EAAgBuB,EAAQN,UAK7CA,GAEAQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKjC,GAAQ,OAAOiC,EAAIC,OAAOC,EAAqBnC,EAAM+B,MAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabOrder.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabOrder.js"],"sourcesContent":["import { toArray } from './array';\nexport var tabSort = function (a, b) {\n var tabDiff = a.tabIndex - b.tabIndex;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!a.tabIndex) {\n return 1;\n }\n if (!b.tabIndex) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nexport var orderByTabIndex = function (nodes, filterNegative, keepGuards) {\n return toArray(nodes)\n .map(function (node, index) { return ({\n node: node,\n index: index,\n tabIndex: keepGuards && node.tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : node.tabIndex,\n }); })\n .filter(function (data) { return !filterNegative || data.tabIndex >= 0; })\n .sort(tabSort);\n};\n"],"names":["tabSort","a","b","tabDiff","tabIndex","indexDiff","index","orderByTabIndex","nodes","filterNegative","keepGuards","toArray","map","node","dataset","focusGuard","filter","data","sort"],"mappings":"qCACU,IAACA,EAAU,SAAUC,EAAGC,GAC9B,IAAIC,EAAUF,EAAEG,SAAWF,EAAEE,SACzBC,EAAYJ,EAAEK,MAAQJ,EAAEI,MAC5B,GAAIH,EAAS,CACT,IAAKF,EAAEG,SACH,OAAO,EAEX,IAAKF,EAAEE,SACH,OAAQ,EAGhB,OAAOD,GAAWE,GAEXE,EAAkB,SAAUC,EAAOC,EAAgBC,GAC1D,OAAOC,EAAQH,GACVI,KAAI,SAAUC,EAAMP,GAAS,
|
|
1
|
+
{"version":3,"file":"tabOrder.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabOrder.js"],"sourcesContent":["import { toArray } from './array';\nexport var tabSort = function (a, b) {\n var tabDiff = a.tabIndex - b.tabIndex;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!a.tabIndex) {\n return 1;\n }\n if (!b.tabIndex) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nexport var orderByTabIndex = function (nodes, filterNegative, keepGuards) {\n return toArray(nodes)\n .map(function (node, index) { return ({\n node: node,\n index: index,\n tabIndex: keepGuards && node.tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : node.tabIndex,\n }); })\n .filter(function (data) { return !filterNegative || data.tabIndex >= 0; })\n .sort(tabSort);\n};\n"],"names":["tabSort","a","b","tabDiff","tabIndex","indexDiff","index","orderByTabIndex","nodes","filterNegative","keepGuards","toArray","map","node","dataset","focusGuard","filter","data","sort"],"mappings":"qCACU,IAACA,EAAU,SAAUC,EAAGC,GAC9B,IAAIC,EAAUF,EAAEG,SAAWF,EAAEE,SACzBC,EAAYJ,EAAEK,MAAQJ,EAAEI,MAC5B,GAAIH,EAAS,CACT,IAAKF,EAAEG,SACH,OAAO,EAEX,IAAKF,EAAEE,SACH,OAAQ,EAGhB,OAAOD,GAAWE,GAEXE,EAAkB,SAAUC,EAAOC,EAAgBC,GAC1D,OAAOC,EAAQH,GACVI,KAAI,SAAUC,EAAMP,GAAS,MAAQ,CACtCO,KAAMA,EACNP,MAAOA,EACPF,SAAUM,IAAiC,IAAnBG,EAAKT,UAAoBS,EAAKC,SAAW,IAAIC,WAAa,GAAK,EAAKF,EAAKT,aAEhGY,QAAO,SAAUC,GAAQ,OAAQR,GAAkBQ,EAAKb,UAAY,KACpEc,KAAKlB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FOCUS_AUTO as r}from"../constants.js";import{toArray as t}from"./array.js";import{tabbables as
|
|
1
|
+
import{FOCUS_AUTO as r}from"../constants.js";import{toArray as t}from"./array.js";import{tabbables as n}from"./tabbables.js";var e=n.join(","),o="".concat(e,", [data-focus-guard]"),c=function(r,n){return r.reduce((function(r,c){return r.concat(t(c.querySelectorAll(n?o:e)),c.parentNode?t(c.parentNode.querySelectorAll(e)).filter((function(r){return r===c})):[])}),[])},u=function(n){var e=n.querySelectorAll("[".concat(r,"]"));return t(e).map((function(r){return c([r])})).reduce((function(r,t){return r.concat(t)}),[])};export{c as getFocusables,u as getParentAutofocusables};
|
|
2
2
|
//# sourceMappingURL=tabUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabUtils.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = queryTabbables
|
|
1
|
+
{"version":3,"file":"tabUtils.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n return acc.concat(toArray(parent.querySelectorAll(withGuards ? queryGuardTabbables : queryTabbables)), parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n"],"names":["queryTabbables","tabbables","join","queryGuardTabbables","concat","getFocusables","parents","withGuards","reduce","acc","parent","toArray","querySelectorAll","parentNode","filter","node","getParentAutofocusables","parentFocus","FOCUS_AUTO","map","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBACzCK,EAAgB,SAAUC,EAASC,GAC1C,OAAOD,EAAQE,QAAO,SAAUC,EAAKC,GACjC,OAAOD,EAAIL,OAAOO,EAAQD,EAAOE,iBAAiBL,EAAaJ,EAAsBH,IAAkBU,EAAOG,WACxGF,EAAQD,EAAOG,WAAWD,iBAAiBZ,IAAiBc,QAAO,SAAUC,GAAQ,OAAOA,IAASL,KACrG,MACP,KAEIM,EAA0B,SAAUN,GAC3C,IAAIO,EAAcP,EAAOE,iBAAiB,IAAIR,OAAOc,EAAY,MACjE,OAAOP,EAAQM,GACVE,KAAI,SAAUJ,GAAQ,OAAOV,EAAc,CAACU,OAC5CP,QAAO,SAAUC,EAAKW,GAAS,OAAOX,EAAIL,OAAOgB,KAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combination.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Combination.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport FocusLockUI from './Lock';\nimport FocusTrap from './Trap';\n/* that would be a BREAKING CHANGE!\n// delaying sidecar execution till the first usage\nconst RequireSideCar = (props) => {\n // eslint-disable-next-line global-require\n const SideCar = require('./Trap').default;\n return <SideCar {...props} />;\n};\n*/\n\nvar FocusLockCombination = /*#__PURE__*/React.forwardRef(function FocusLockUICombination(props, ref) {\n return /*#__PURE__*/React.createElement(FocusLockUI, _extends({\n sideCar: FocusTrap,\n ref: ref\n }, props));\n});\n\nvar _ref = FocusLockUI.propTypes || {},\n sideCar = _ref.sideCar,\n propTypes = _objectWithoutPropertiesLoose(_ref, [\"sideCar\"]);\n\nFocusLockCombination.propTypes = process.env.NODE_ENV !== \"production\" ? propTypes : {};\nexport default FocusLockCombination;"],"names":["FocusLockCombination","React","forwardRef","props","ref","createElement","FocusLockUI","_extends","sideCar","FocusTrap","_ref","propTypes","_objectWithoutPropertiesLoose","process","env","NODE_ENV"],"mappings":"2NAcA,IAAIA,EAAoCC,EAAMC,YAAW,SAAgCC,EAAOC,GAC9F,OAAoBH,EAAMI,cAAcC,EAAaC,EAAS,CAC5DC,QAASC,EACTL,IAAKA,GACJD,OAGDO,EAAOJ,EAAYK,WAAa,GACtBD,EAAKF,
|
|
1
|
+
{"version":3,"file":"Combination.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Combination.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport FocusLockUI from './Lock';\nimport FocusTrap from './Trap';\n/* that would be a BREAKING CHANGE!\n// delaying sidecar execution till the first usage\nconst RequireSideCar = (props) => {\n // eslint-disable-next-line global-require\n const SideCar = require('./Trap').default;\n return <SideCar {...props} />;\n};\n*/\n\nvar FocusLockCombination = /*#__PURE__*/React.forwardRef(function FocusLockUICombination(props, ref) {\n return /*#__PURE__*/React.createElement(FocusLockUI, _extends({\n sideCar: FocusTrap,\n ref: ref\n }, props));\n});\n\nvar _ref = FocusLockUI.propTypes || {},\n sideCar = _ref.sideCar,\n propTypes = _objectWithoutPropertiesLoose(_ref, [\"sideCar\"]);\n\nFocusLockCombination.propTypes = process.env.NODE_ENV !== \"production\" ? propTypes : {};\nexport default FocusLockCombination;"],"names":["FocusLockCombination","React","forwardRef","props","ref","createElement","FocusLockUI","_extends","sideCar","FocusTrap","_ref","propTypes","_objectWithoutPropertiesLoose","process","env","NODE_ENV","FocusLock"],"mappings":"2NAcA,IAAIA,EAAoCC,EAAMC,YAAW,SAAgCC,EAAOC,GAC9F,OAAoBH,EAAMI,cAAcC,EAAaC,EAAS,CAC5DC,QAASC,EACTL,IAAKA,GACJD,OAGDO,EAAOJ,EAAYK,WAAa,GACtBD,EAAKF,QACf,IAAAG,EAAYC,EAA8BF,EAAM,CAAC,YAErDV,EAAqBW,UAAqC,eAAzBE,QAAQC,IAAIC,SAA4BJ,EAAY,GACrF,IAAAK,EAAehB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.js";import*as o from"react";import{useEffect as t}from"react";import{node as
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.js";import*as o from"react";import{useEffect as t}from"react";import{node as s,bool as r,oneOfType as a,object as n,func as c,string as i,arrayOf as u,any as d}from"prop-types";import{FOCUS_DISABLED as l,FOCUS_GROUP as f}from"../../../focus-lock/dist/es2015/constants.js";import{hiddenGuard as v}from"./FocusGuard.js";import{mediumFocus as m,mediumBlur as p,mediumSidecar as F}from"./medium.js";import{useMergeRefs as b}from"../../../use-callback-ref/dist/es2015/useMergeRef.js";var h=[],k=o.forwardRef((function(s,r){var a,n=o.useState(),c=n[0],i=n[1],u=o.useRef(),d=o.useRef(!1),k=o.useRef(null),E=s.children,g=s.disabled,w=s.noFocusGuards,y=s.persistentFocus,x=s.crossFrame,C=s.autoFocus,N=s.allowTextSelection,P=s.group,R=s.className,j=s.whiteList,D=s.hasPositiveIndices,I=s.shards,L=void 0===I?h:I,O=s.as,S=void 0===O?"div":O,T=s.lockProps,A=void 0===T?{}:T,G=s.sideCar,M=s.returnFocus,V=s.focusOptions,_=s.onActivation,q=s.onDeactivation,B=o.useState({})[0],z=o.useCallback((function(){k.current=k.current||document&&document.activeElement,u.current&&_&&_(u.current),d.current=!0}),[_]),H=o.useCallback((function(){d.current=!1,q&&q(u.current)}),[q]);t((function(){g||(k.current=null)}),[]);var J=o.useCallback((function(e){var o=k.current;if(o&&o.focus){var t="function"==typeof M?M(o):M;if(t){var s="object"==typeof t?t:void 0;k.current=null,e?Promise.resolve().then((function(){return o.focus(s)})):o.focus(s)}}}),[M]),K=o.useCallback((function(e){d.current&&m.useMedium(e)}),[]),Q=p.useMedium,U=o.useCallback((function(e){u.current!==e&&(u.current=e,i(e))}),[]);"production"!==process.env.NODE_ENV&&(void 0!==N&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),o.useEffect((function(){u.current||console.error("FocusLock: could not obtain ref to internal node")}),[]));var W=e(((a={})[l]=g&&"disabled",a[f]=P,a),A),X=!0!==w,Y=X&&"tail"!==w,Z=b([r,U]);return o.createElement(o.Fragment,null,X&&[o.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:g?-1:0,style:v}),D?o.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:g?-1:1,style:v}):null],!g&&o.createElement(G,{id:B,sideCar:F,observed:c,disabled:g,persistentFocus:y,crossFrame:x,autoFocus:C,whiteList:j,shards:L,onActivation:z,onDeactivation:H,returnFocus:J,focusOptions:V}),o.createElement(S,e({ref:Z},W,{className:R,onBlur:Q,onFocus:K}),E),Y&&o.createElement("div",{"data-focus-guard":!0,tabIndex:g?-1:0,style:v}))}));k.propTypes="production"!==process.env.NODE_ENV?{children:s,disabled:r,returnFocus:a([r,n,c]),focusOptions:n,noFocusGuards:r,hasPositiveIndices:r,allowTextSelection:r,autoFocus:r,persistentFocus:r,crossFrame:r,group:i,className:i,whiteList:c,shards:u(d),as:a([i,c,n]),lockProps:n,onActivation:c,onDeactivation:c,sideCar:d.isRequired}:{},k.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var E=k;export{E as default};
|
|
2
2
|
//# sourceMappingURL=Lock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lock.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { useEffect } from \"react\";\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var children = props.children,\n disabled = props.disabled,\n noFocusGuards = props.noFocusGuards,\n persistentFocus = props.persistentFocus,\n crossFrame = props.crossFrame,\n autoFocus = props.autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n shouldReturnFocus = props.returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n\n var _React$useState2 = React.useState({}),\n id = _React$useState2[0]; // SIDE EFFECT CALLBACKS\n\n\n var onActivation = React.useCallback(function () {\n originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement;\n\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n\n isActive.current = true;\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n }, [onDeactivationCallback]);\n useEffect(function () {\n if (!disabled) {\n // cleanup return focus on trap deactivation\n // sideEffect/returnFocus should happen by this time\n originalFocusedElement.current = null;\n }\n }, []);\n var returnFocus = React.useCallback(function (allowDefer) {\n var returnFocusTo = originalFocusedElement.current;\n\n if (returnFocusTo && returnFocusTo.focus) {\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n\n if (Boolean(howToReturnFocus)) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n\n if (allowDefer) {\n // React might return focus after update\n // it's safer to defer the action\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]); // MEDIUM CALLBACKS\n\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium; // REF PROPAGATION\n // not using real refs due to race conditions\n\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n\n React.useEffect(function () {\n if (!observed.current) {\n // eslint-disable-next-line no-console\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }),\n /*#__PURE__*/\n // nearest focus guard\n React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) // first tabbed element guard\n ], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), children), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nFocusLock.defaultProps = {\n children: undefined,\n disabled: false,\n returnFocus: false,\n focusOptions: undefined,\n noFocusGuards: false,\n autoFocus: true,\n persistentFocus: false,\n crossFrame: true,\n allowTextSelection: undefined,\n group: undefined,\n className: undefined,\n whiteList: undefined,\n shards: undefined,\n as: 'div',\n lockProps: {},\n onActivation: undefined,\n onDeactivation: undefined\n};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","children","disabled","noFocusGuards","persistentFocus","crossFrame","autoFocus","allowTextSelection","group","className","whiteList","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","shouldReturnFocus","returnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","current","document","activeElement","useEffect","allowDefer","returnFocusTo","focus","howToReturnFocus","Boolean","returnFocusOptions","undefined","Promise","resolve","then","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired","defaultProps"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Lock.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { useEffect } from 'react';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var children = props.children,\n disabled = props.disabled,\n noFocusGuards = props.noFocusGuards,\n persistentFocus = props.persistentFocus,\n crossFrame = props.crossFrame,\n autoFocus = props.autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n hasPositiveIndices = props.hasPositiveIndices,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n shouldReturnFocus = props.returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n\n var _React$useState2 = React.useState({}),\n id = _React$useState2[0]; // SIDE EFFECT CALLBACKS\n\n\n var onActivation = React.useCallback(function () {\n originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement;\n\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n\n isActive.current = true;\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n }, [onDeactivationCallback]);\n useEffect(function () {\n if (!disabled) {\n // cleanup return focus on trap deactivation\n // sideEffect/returnFocus should happen by this time\n originalFocusedElement.current = null;\n }\n }, []);\n var returnFocus = React.useCallback(function (allowDefer) {\n var returnFocusTo = originalFocusedElement.current;\n\n if (returnFocusTo && returnFocusTo.focus) {\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n\n if (howToReturnFocus) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n\n if (allowDefer) {\n // React might return focus after update\n // it's safer to defer the action\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]); // MEDIUM CALLBACKS\n\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium; // REF PROPAGATION\n // not using real refs due to race conditions\n\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n\n React.useEffect(function () {\n if (!observed.current) {\n // eslint-disable-next-line no-console\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [\n /*#__PURE__*/\n // nearest focus guard\n React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }), // first tabbed element guard\n hasPositiveIndices ? /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) : null], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), children), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n hasPositiveIndices: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nFocusLock.defaultProps = {\n children: undefined,\n disabled: false,\n returnFocus: false,\n focusOptions: undefined,\n noFocusGuards: false,\n autoFocus: true,\n persistentFocus: false,\n crossFrame: true,\n hasPositiveIndices: undefined,\n allowTextSelection: undefined,\n group: undefined,\n className: undefined,\n whiteList: undefined,\n shards: undefined,\n as: 'div',\n lockProps: {},\n onActivation: undefined,\n onDeactivation: undefined\n};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","children","disabled","noFocusGuards","persistentFocus","crossFrame","autoFocus","allowTextSelection","group","className","whiteList","hasPositiveIndices","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","shouldReturnFocus","returnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","current","document","activeElement","useEffect","allowDefer","returnFocusTo","focus","howToReturnFocus","returnFocusOptions","undefined","Promise","resolve","then","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired","defaultProps","FocusLockUI"],"mappings":"yhBAQA,IAAIA,EAAa,GACbC,EAAyBC,EAAMC,YAAW,SAAqBC,EAAOC,GACxE,IAAIC,EAEAC,EAAkBL,EAAMM,WACxBC,EAAeF,EAAgB,GAC/BG,EAAcH,EAAgB,GAE9BI,EAAWT,EAAMU,SACjBC,EAAWX,EAAMU,QAAO,GACxBE,EAAyBZ,EAAMU,OAAO,MACtCG,EAAWX,EAAMW,SACjBC,EAAWZ,EAAMY,SACjBC,EAAgBb,EAAMa,cACtBC,EAAkBd,EAAMc,gBACxBC,EAAaf,EAAMe,WACnBC,EAAYhB,EAAMgB,UAClBC,EAAqBjB,EAAMiB,mBAC3BC,EAAQlB,EAAMkB,MACdC,EAAYnB,EAAMmB,UAClBC,EAAYpB,EAAMoB,UAClBC,EAAqBrB,EAAMqB,mBAC3BC,EAAgBtB,EAAMuB,OACtBA,OAA2B,IAAlBD,EAA2B1B,EAAa0B,EACjDE,EAAYxB,EAAMyB,GAClBC,OAA0B,IAAdF,EAAuB,MAAQA,EAC3CG,EAAmB3B,EAAM4B,UACzBC,OAAsC,IAArBF,EAA8B,GAAKA,EACpDG,EAAU9B,EAAM+B,QAChBC,EAAoBhC,EAAMiC,YAC1BC,EAAelC,EAAMkC,aACrBC,EAAuBnC,EAAMoC,aAC7BC,EAAyBrC,EAAMsC,eAG/BC,EADmBzC,EAAMM,SAAS,IACZ,GAGtBgC,EAAetC,EAAM0C,aAAY,WACnC9B,EAAuB+B,QAAU/B,EAAuB+B,SAAWC,UAAYA,SAASC,cAEpFpC,EAASkC,SAAWN,GACtBA,EAAqB5B,EAASkC,SAGhChC,EAASgC,SAAU,IAClB,CAACN,IACAG,EAAiBxC,EAAM0C,aAAY,WACrC/B,EAASgC,SAAU,EAEfJ,GACFA,EAAuB9B,EAASkC,WAEjC,CAACJ,IACJO,GAAU,WACHhC,IAGHF,EAAuB+B,QAAU,QAElC,IACH,IAAIR,EAAcnC,EAAM0C,aAAY,SAAUK,GAC5C,IAAIC,EAAgBpC,EAAuB+B,QAE3C,GAAIK,GAAiBA,EAAcC,MAAO,CACxC,IAAIC,EAAgD,mBAAtBhB,EAAmCA,EAAkBc,GAAiBd,EAEpG,GAAIgB,EAAkB,CACpB,IAAIC,EAAiD,iBAArBD,EAAgCA,OAAmBE,EACnFxC,EAAuB+B,QAAU,KAE7BI,EAGFM,QAAQC,UAAUC,MAAK,WACrB,OAAOP,EAAcC,MAAME,MAG7BH,EAAcC,MAAME,OAIzB,CAACjB,IAEAsB,EAAUxD,EAAM0C,aAAY,SAAUe,GACpC9C,EAASgC,SACXe,EAAYC,UAAUF,KAEvB,IACCG,EAASC,EAAWF,UAGpBG,EAAiB9D,EAAM0C,aAAY,SAAUqB,GAC3CtD,EAASkC,UAAYoB,IACvBtD,EAASkC,QAAUoB,EACnBvD,EAAYuD,MAEb,IAE0B,eAAzBC,QAAQC,IAAIC,gBACoB,IAAvB/C,GAETgD,QAAQC,KAAK,6EAGfpE,EAAM8C,WAAU,WACTrC,EAASkC,SAEZwB,QAAQE,MAAM,sDAEf,KAGL,IAAIvC,EAAYwC,IAAUlE,EAAY,IAAcmE,GAA4BzD,GAAY,WAAYV,EAAUoE,GAAyBpD,EAAOhB,GAAY2B,GAE1J0C,GAAqC,IAAlB1D,EACnB2D,EAAmBD,GAAsC,SAAlB1D,EACvC4D,EAAYC,EAAa,CAACzE,EAAW2D,IACzC,OAAoB9D,EAAM6E,cAAc7E,EAAM8E,SAAU,KAAML,GAAoB,CAGlFzE,EAAM6E,cAAc,MAAO,CACzBE,IAAK,cACL,oBAAoB,EACpBC,SAAUlE,GAAY,EAAI,EAC1BmE,MAAOC,IAET3D,EAAkCvB,EAAM6E,cAAc,MAAO,CAC3DE,IAAK,gBACL,oBAAoB,EACpBC,SAAUlE,GAAY,EAAI,EAC1BmE,MAAOC,IACJ,OAAQpE,GAAyBd,EAAM6E,cAAc7C,EAAS,CACjES,GAAIA,EACJR,QAASkD,EACT1E,SAAUF,EACVO,SAAUA,EACVE,gBAAiBA,EACjBC,WAAYA,EACZC,UAAWA,EACXI,UAAWA,EACXG,OAAQA,EACRa,aAAcA,EACdE,eAAgBA,EAChBL,YAAaA,EACbC,aAAcA,IACCpC,EAAM6E,cAAcjD,EAAW0C,EAAS,CACvDc,IAAKT,GACJ7C,EAAW,CACZT,UAAWA,EACXuC,OAAQA,EACRJ,QAASA,IACP3C,GAAW6D,GAAiC1E,EAAM6E,cAAc,MAAO,CACzE,oBAAoB,EACpBG,SAAUlE,GAAY,EAAI,EAC1BmE,MAAOC,QAGXnF,EAAUsF,UAAqC,eAAzBrB,QAAQC,IAAIC,SAA4B,CAC5DrD,SAAUyE,EACVxE,SAAUyE,EACVpD,YAAaqD,EAAU,CAACD,EAAME,EAAQC,IACtCtD,aAAcqD,EACd1E,cAAewE,EACfhE,mBAAoBgE,EACpBpE,mBAAoBoE,EACpBrE,UAAWqE,EACXvE,gBAAiBuE,EACjBtE,WAAYsE,EACZnE,MAAOuE,EACPtE,UAAWsE,EACXrE,UAAWoE,EACXjE,OAAQmE,EAAQC,GAChBlE,GAAI6D,EAAU,CAACG,EAAQD,EAAMD,IAC7B3D,UAAW2D,EACXnD,aAAcoD,EACdlD,eAAgBkD,EAChBzD,QAAS4D,EAAIC,YACX,GACJ/F,EAAUgG,aAAe,CACvBlF,cAAUuC,EACVtC,UAAU,EACVqB,aAAa,EACbC,kBAAcgB,EACdrC,eAAe,EACfG,WAAW,EACXF,iBAAiB,EACjBC,YAAY,EACZM,wBAAoB6B,EACpBjC,wBAAoBiC,EACpBhC,WAAOgC,EACP/B,eAAW+B,EACX9B,eAAW8B,EACX3B,YAAQ2B,EACRzB,GAAI,MACJG,UAAW,GACXQ,kBAAcc,EACdZ,oBAAgBY,GAElB,IAAA4C,EAAejG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"react";import e from"prop-types";import n from"../../../react-clientside-effect/lib/index.es.js";import t from"../../../focus-lock/dist/es2015/index.js";import{deferAction as o}from"./util.js";import{mediumFocus as r,mediumBlur as u,mediumEffect as i}from"./medium.js";import{focusInside as c}from"../../../focus-lock/dist/es2015/focusInside.js";import{focusIsHidden as s}from"../../../focus-lock/dist/es2015/focusIsHidden.js";import{getFocusabledIn as d}from"../../../focus-lock/dist/es2015/focusables.js";var a=function(){return document&&document.activeElement===document.body||s()},f=null,m=null,l=null,v=!1,p=function(){return!0};function
|
|
1
|
+
import"react";import e from"prop-types";import n from"../../../react-clientside-effect/lib/index.es.js";import t from"../../../focus-lock/dist/es2015/index.js";import{deferAction as o}from"./util.js";import{mediumFocus as r,mediumBlur as u,mediumEffect as i}from"./medium.js";import{focusInside as c}from"../../../focus-lock/dist/es2015/focusInside.js";import{focusIsHidden as s}from"../../../focus-lock/dist/es2015/focusIsHidden.js";import{getFocusabledIn as d}from"../../../focus-lock/dist/es2015/focusables.js";var a=function(){return document&&document.activeElement===document.body||s()},f=null,m=null,l=null,v=!1,p=function(){return!0};function E(e,n,t,o){var r=null,u=e;do{var i=o[u];if(i.guard)i.node.dataset.focusAutoGuard&&(r=i);else{if(!i.lockItem)break;if(u!==e)return;r=null}}while((u+=t)!==n);r&&(r.node.tabIndex=0)}var b=function(e){return e&&"current"in e?e.current:e},g=function e(n,t,o){return t&&(t.host===n&&(!t.activeElement||o.contains(t.activeElement))||t.parentNode&&e(n,t.parentNode,o))},h=function(){var e,n=!1;if(f){var o=f,r=o.observed,u=o.persistentFocus,i=o.autoFocus,s=o.shards,h=o.crossFrame,j=o.focusOptions,w=r||l&&l.portaledElement,I=document&&document.activeElement;if(w){var L=[w].concat(s.map(b).filter(Boolean));if(I&&!function(e){return(f.whiteList||p)(e)}(I)||(u||(h?Boolean(v):"meanwhile"===v)||!a()||!m&&i)&&(w&&!(c(L)||I&&function(e,n){return n.some((function(n){return g(e,n,n)}))}(I,L)||(e=I,l&&l.portaledElement===e))&&(document&&!m&&I&&!i?(I.blur&&I.blur(),document.body.focus()):(n=t(L,m,{focusOptions:j}),l={})),v=!1,m=document&&document.activeElement),document){var k=document&&document.activeElement,x=d(L),F=x.map((function(e){return e.node})).indexOf(k);F>-1&&(x.filter((function(e){var n=e.guard,t=e.node;return n&&t.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),E(F,x.length,1,x),E(F,-1,-1,x))}}}return n},j=function(e){h()&&e&&(e.stopPropagation(),e.preventDefault())},w=function(){return o(h)};"production"===process.env.NODE_ENV||e.node.isRequired;var I=function(){v="just",setTimeout((function(){v="meanwhile"}),0)};r.assignSyncMedium((function(e){var n=e.target,t=e.currentTarget;t.contains(n)||(l={observerNode:t,portaledElement:n})})),u.assignMedium(w),i.assignMedium((function(e){return e({moveFocusInside:t,focusInside:c})}));var L=n((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var n=e.slice(-1)[0];n&&!f&&(document.addEventListener("focusin",j),document.addEventListener("focusout",w),window.addEventListener("blur",I));var t=f,r=t&&n&&n.id===t.id;f=n,t&&!r&&(t.onDeactivation(),e.filter((function(e){return e.id===t.id})).length||t.returnFocus(!n)),n?(m=null,r&&t.observed===n.observed||n.onActivation(),h(),o(h)):(document.removeEventListener("focusin",j),document.removeEventListener("focusout",w),window.removeEventListener("blur",I),m=null)}))((function(){return null}));export{L as default};
|
|
2
2
|
//# sourceMappingURL=Trap.js.map
|