@cruk/cruk-react-components 6.0.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -22
- package/lib/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusInside.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusables.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusables.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/solver.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
- package/lib/node_modules/react-clientside-effect/lib/index.es.js +1 -1
- package/lib/node_modules/react-clientside-effect/lib/index.es.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/medium.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/medium.js.map +1 -1
- package/lib/node_modules/react-intersection-observer/dist/index.js +1 -1
- package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
- package/lib/node_modules/tslib/tslib.es6.js.map +1 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +1 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js +1 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/lib/node_modules/use-sidecar/dist/es2015/medium.js +1 -1
- package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/lib/playwright/index.d.ts +1 -0
- package/lib/playwright/utils.d.ts +19 -0
- package/lib/playwright-ct.config.d.ts +2 -0
- package/lib/{components → src/components}/AddressLookup/AddressLookup.stories.d.ts +1 -1
- package/lib/src/components/AddressLookup/index.js +1 -1
- package/lib/src/components/AddressLookup/index.js.map +1 -1
- package/lib/src/components/AddressLookup/styles.js +1 -1
- package/lib/src/components/AddressLookup/styles.js.map +1 -1
- package/lib/{components → src/components}/Avatar/Avatar.stories.d.ts +1 -1
- package/lib/src/components/Avatar/index.js.map +1 -1
- package/lib/src/components/Avatar/styles.js +1 -1
- package/lib/src/components/Avatar/styles.js.map +1 -1
- package/lib/{components → src/components}/Badge/Badge.stories.d.ts +1 -1
- package/lib/src/components/Badge/index.js.map +1 -1
- package/lib/src/components/Badge/styles.js +1 -1
- package/lib/src/components/Badge/styles.js.map +1 -1
- package/lib/{components → src/components}/Box/Box.stories.d.ts +1 -1
- package/lib/src/components/Box/index.js.map +1 -1
- package/lib/src/components/Box/styles.js +1 -1
- package/lib/src/components/Box/styles.js.map +1 -1
- package/lib/{components → src/components}/Button/Button.stories.d.ts +1 -1
- package/lib/src/components/Button/index.js +1 -1
- package/lib/src/components/Button/index.js.map +1 -1
- package/lib/src/components/Button/styles.js +1 -1
- package/lib/src/components/Button/styles.js.map +1 -1
- package/lib/{components → src/components}/Carousel/Carousel.stories.d.ts +1 -1
- package/lib/src/components/Carousel/Dots.js +1 -1
- package/lib/src/components/Carousel/Dots.js.map +1 -1
- package/lib/src/components/Carousel/index.js +1 -1
- package/lib/src/components/Carousel/index.js.map +1 -1
- package/lib/src/components/Carousel/styles.js +1 -1
- package/lib/src/components/Carousel/styles.js.map +1 -1
- package/lib/{components → src/components}/Checkbox/Checkbox.stories.d.ts +1 -1
- package/lib/src/components/Checkbox/index.js.map +1 -1
- package/lib/src/components/Checkbox/styles.js +1 -1
- package/lib/src/components/Checkbox/styles.js.map +1 -1
- package/lib/{components → src/components}/Collapse/Collapse.stories.d.ts +1 -1
- package/lib/src/components/Collapse/index.js +1 -1
- package/lib/src/components/Collapse/index.js.map +1 -1
- package/lib/src/components/Collapse/styles.js +1 -1
- package/lib/src/components/Collapse/styles.js.map +1 -1
- package/lib/{components → src/components}/DateField/DateField.stories.d.ts +1 -1
- package/lib/src/components/DateField/index.js +1 -1
- package/lib/src/components/DateField/index.js.map +1 -1
- package/lib/src/components/DateField/styles.js +1 -1
- package/lib/src/components/DateField/styles.js.map +1 -1
- package/lib/src/components/Divider.js.map +1 -1
- package/lib/{components → src/components}/ErrorText/ErrorText.stories.d.ts +1 -1
- package/lib/src/components/ErrorText/index.js.map +1 -1
- package/lib/src/components/ErrorText/styles.js +1 -1
- package/lib/src/components/ErrorText/styles.js.map +1 -1
- package/lib/src/components/Flex.js +1 -1
- package/lib/src/components/Flex.js.map +1 -1
- package/lib/src/components/Fontface.js +1 -1
- package/lib/src/components/Fontface.js.map +1 -1
- package/lib/{components → src/components}/Footer/Footer.stories.d.ts +1 -1
- package/lib/src/components/Footer/index.js +1 -1
- package/lib/src/components/Footer/index.js.map +1 -1
- package/lib/src/components/Footer/styles.js +1 -1
- package/lib/src/components/Footer/styles.js.map +1 -1
- package/lib/src/components/GlobalStyle.d.ts +2 -0
- package/lib/src/components/GlobalStyle.js +1 -1
- package/lib/src/components/GlobalStyle.js.map +1 -1
- package/lib/src/components/GlobalStyleNoFontFace.d.ts +2 -0
- package/lib/src/components/GlobalStyleNoFontFace.js +1 -1
- package/lib/src/components/GlobalStyleNoFontFace.js.map +1 -1
- package/lib/{components → src/components}/Header/Header.stories.d.ts +1 -1
- package/lib/src/components/Header/index.js +1 -1
- package/lib/src/components/Header/index.js.map +1 -1
- package/lib/src/components/Header/styles.js +1 -1
- package/lib/src/components/Header/styles.js.map +1 -1
- package/lib/{components → src/components}/Heading/Heading.stories.d.ts +1 -1
- package/lib/src/components/Heading/index.js.map +1 -1
- package/lib/src/components/Heading/styles.js +1 -1
- package/lib/src/components/Heading/styles.js.map +1 -1
- package/lib/{components → src/components}/IconFa/IconFa.stories.d.ts +1 -1
- package/lib/src/components/IconFa/index.js.map +1 -1
- package/lib/src/components/IconFa/styles.js +1 -1
- package/lib/src/components/IconFa/styles.js.map +1 -1
- package/lib/{components → src/components}/InfoBox/InfoBox.stories.d.ts +1 -1
- package/lib/src/components/InfoBox/index.js.map +1 -1
- package/lib/src/components/InfoBox/styles.js +1 -1
- package/lib/src/components/InfoBox/styles.js.map +1 -1
- package/lib/{components → src/components}/LabelWrapper/index.d.ts +4 -4
- package/lib/src/components/LabelWrapper/index.js +1 -1
- package/lib/src/components/LabelWrapper/index.js.map +1 -1
- package/lib/{components → src/components}/LabelWrapper/styles.d.ts +1 -1
- package/lib/src/components/LabelWrapper/styles.js +1 -1
- package/lib/src/components/LabelWrapper/styles.js.map +1 -1
- package/lib/{components → src/components}/LegendWrapper/LegendWrapper.stories.d.ts +1 -1
- package/lib/{components → src/components}/LegendWrapper/index.d.ts +1 -1
- package/lib/src/components/LegendWrapper/index.js +1 -1
- package/lib/src/components/LegendWrapper/index.js.map +1 -1
- package/lib/src/components/LegendWrapper/styles.js +1 -1
- package/lib/src/components/LegendWrapper/styles.js.map +1 -1
- package/lib/{components → src/components}/Link/Link.stories.d.ts +1 -1
- package/lib/src/components/Link/index.js.map +1 -1
- package/lib/src/components/Link/styles.js +1 -1
- package/lib/src/components/Link/styles.js.map +1 -1
- package/lib/{components → src/components}/Loader/Loader.stories.d.ts +1 -1
- package/lib/src/components/Loader/index.js.map +1 -1
- package/lib/src/components/Loader/styles.js +1 -1
- package/lib/src/components/Loader/styles.js.map +1 -1
- package/lib/{components → src/components}/Modal/Modal.stories.d.ts +1 -1
- package/lib/src/components/Modal/TestModalWithContent.d.ts +2 -0
- package/lib/src/components/Modal/TestModalWithState.d.ts +2 -0
- package/lib/src/components/Modal/index.js +1 -1
- package/lib/src/components/Modal/index.js.map +1 -1
- package/lib/src/components/Modal/styles.js +1 -1
- package/lib/src/components/Modal/styles.js.map +1 -1
- package/lib/{components → src/components}/Pagination/Pagination.stories.d.ts +1 -1
- package/lib/src/components/Pagination/index.js.map +1 -1
- package/lib/src/components/Pagination/styles.js +1 -1
- package/lib/src/components/Pagination/styles.js.map +1 -1
- package/lib/{components → src/components}/PopOver/Popover.stories.d.ts +1 -1
- package/lib/src/components/PopOver/TestPopOverWithContent.d.ts +2 -0
- package/lib/src/components/PopOver/index.js +1 -1
- package/lib/src/components/PopOver/index.js.map +1 -1
- package/lib/src/components/PopOver/styles.js +1 -1
- package/lib/src/components/PopOver/styles.js.map +1 -1
- package/lib/{components → src/components}/ProgressBar/ProgressBar.stories.d.ts +1 -1
- package/lib/src/components/ProgressBar/index.js.map +1 -1
- package/lib/src/components/ProgressBar/styles.js +1 -1
- package/lib/src/components/ProgressBar/styles.js.map +1 -1
- package/lib/{components → src/components}/Radio/Radio.stories.d.ts +1 -1
- package/lib/src/components/Radio/index.js.map +1 -1
- package/lib/src/components/Radio/styles.js +1 -1
- package/lib/src/components/Radio/styles.js.map +1 -1
- package/lib/{components → src/components}/RadioConsent/Radio.stories.d.ts +1 -1
- package/lib/src/components/RadioConsent/index.js +1 -1
- package/lib/src/components/RadioConsent/index.js.map +1 -1
- package/lib/src/components/RadioConsent/styles.js +1 -1
- package/lib/src/components/RadioConsent/styles.js.map +1 -1
- package/lib/{components → src/components}/Select/Selelct.stories.d.ts +2 -2
- package/lib/{components → src/components}/Select/index.d.ts +3 -3
- package/lib/src/components/Select/index.js +1 -1
- package/lib/src/components/Select/index.js.map +1 -1
- package/lib/src/components/Select/styles.js +1 -1
- package/lib/src/components/Select/styles.js.map +1 -1
- package/lib/src/components/Spacing/index.js.map +1 -1
- package/lib/{components → src/components}/Step/Step.stories.d.ts +1 -1
- package/lib/src/components/Step/index.js +1 -1
- package/lib/src/components/Step/index.js.map +1 -1
- package/lib/src/components/Step/styles.js +1 -1
- package/lib/src/components/Step/styles.js.map +1 -1
- package/lib/{components → src/components}/Text/Text.stories.d.ts +1 -1
- package/lib/src/components/Text/index.js.map +1 -1
- package/lib/src/components/Text/styles.js +1 -1
- package/lib/src/components/Text/styles.js.map +1 -1
- package/lib/{components → src/components}/TextAreaField/TextAreaField.stories.d.ts +1 -1
- package/lib/src/components/TextAreaField/index.js.map +1 -1
- package/lib/src/components/TextAreaField/styles.js +1 -1
- package/lib/src/components/TextAreaField/styles.js.map +1 -1
- package/lib/{components → src/components}/TextField/TextField.stories.d.ts +2 -2
- package/lib/{components → src/components}/TextField/index.d.ts +3 -3
- package/lib/src/components/TextField/index.js +1 -1
- package/lib/src/components/TextField/index.js.map +1 -1
- package/lib/src/components/TextField/styles.js +1 -1
- package/lib/src/components/TextField/styles.js.map +1 -1
- package/lib/src/components/ThemeCheatSheet.d.ts +7 -0
- package/lib/{components → src/components}/Totaliser/Totaliser.stories.d.ts +1 -1
- package/lib/src/components/Totaliser/index.js.map +1 -1
- package/lib/src/components/Totaliser/styles.js +1 -1
- package/lib/src/components/Totaliser/styles.js.map +1 -1
- package/lib/{components → src/components}/UserBlock/UserBlock.stories.d.ts +1 -1
- package/lib/src/components/UserBlock/index.js.map +1 -1
- package/lib/src/components/UserBlock/styles.js +1 -1
- package/lib/src/components/UserBlock/styles.js.map +1 -1
- package/lib/src/hooks/useEffectBrowser.js +1 -1
- package/lib/src/hooks/useEffectBrowser.js.map +1 -1
- package/lib/src/hooks/useKey.js +1 -1
- package/lib/src/hooks/useKey.js.map +1 -1
- package/lib/src/hooks/useLayoutEffectBrowser.js +1 -1
- package/lib/src/hooks/useLayoutEffectBrowser.js.map +1 -1
- package/lib/src/hooks/useScrollPosition.js +1 -1
- package/lib/src/hooks/useScrollPosition.js.map +1 -1
- package/lib/src/themes/bowelbabe.js +1 -1
- package/lib/src/themes/bowelbabe.js.map +1 -1
- package/lib/src/themes/cruk.js.map +1 -1
- package/lib/src/themes/rfl.js +1 -1
- package/lib/src/themes/rfl.js.map +1 -1
- package/lib/src/themes/su2c.js +1 -1
- package/lib/src/themes/su2c.js.map +1 -1
- package/lib/src/utils/Helper.js +1 -1
- package/lib/src/utils/Helper.js.map +1 -1
- package/lib/src/utils/debounce.js +1 -1
- package/lib/src/utils/debounce.js.map +1 -1
- package/lib/src/utils/themeUtils.js.map +1 -1
- package/lib/vite.config.d.ts +2 -0
- package/package.json +32 -54
- package/lib/components/GlobalStyle.d.ts +0 -2
- package/lib/components/GlobalStyleNoFontFace.d.ts +0 -2
- package/lib/components/ThemeCheatSheet.d.ts +0 -7
- /package/lib/{components/AddressLookup/AddressLookUp.test.cypress.d.ts → src/components/AddressLookup/AddressLookup.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/AddressLookup/index.d.ts +0 -0
- /package/lib/{components → src/components}/AddressLookup/styles.d.ts +0 -0
- /package/lib/{components → src/components}/AllThemesWrapper.d.ts +0 -0
- /package/lib/{components/Avatar/Avatar.test.cypress.d.ts → src/components/Avatar/Avatar.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Avatar/index.d.ts +0 -0
- /package/lib/{components → src/components}/Avatar/styles.d.ts +0 -0
- /package/lib/{components/Badge/Badge.test.cypress.d.ts → src/components/Badge/Badge.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Badge/index.d.ts +0 -0
- /package/lib/{components → src/components}/Badge/styles.d.ts +0 -0
- /package/lib/{components/Box/Box.test.cypress.d.ts → src/components/Box/Box.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Box/index.d.ts +0 -0
- /package/lib/{components → src/components}/Box/styles.d.ts +0 -0
- /package/lib/{components/Button/Button.test.cypress.d.ts → src/components/Button/Button.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Button/index.d.ts +0 -0
- /package/lib/{components → src/components}/Button/styles.d.ts +0 -0
- /package/lib/{components/Carousel/Carousel.test.cypress.d.ts → src/components/Carousel/Carousel.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Carousel/Dots.d.ts +0 -0
- /package/lib/{components → src/components}/Carousel/index.d.ts +0 -0
- /package/lib/{components → src/components}/Carousel/styles.d.ts +0 -0
- /package/lib/{components/Checkbox/CheckBox.test.cypress.d.ts → src/components/Checkbox/Checkbox.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Checkbox/index.d.ts +0 -0
- /package/lib/{components → src/components}/Checkbox/styles.d.ts +0 -0
- /package/lib/{components/Collapse/Collapse.test.cypress.d.ts → src/components/Collapse/Collapse.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Collapse/index.d.ts +0 -0
- /package/lib/{components → src/components}/Collapse/styles.d.ts +0 -0
- /package/lib/{components/DateField/DateField.test.cypress.d.ts → src/components/DateField/DateField.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/DateField/index.d.ts +0 -0
- /package/lib/{components → src/components}/DateField/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Divider.d.ts +0 -0
- /package/lib/{components/ErrorText/ErrorText.test.cypress.d.ts → src/components/ErrorText/ErrorText.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/ErrorText/index.d.ts +0 -0
- /package/lib/{components → src/components}/ErrorText/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Flex.d.ts +0 -0
- /package/lib/{components → src/components}/Fontface.d.ts +0 -0
- /package/lib/{components/Footer/Footer.test.cypress.d.ts → src/components/Footer/Footer.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Footer/index.d.ts +0 -0
- /package/lib/{components → src/components}/Footer/styles.d.ts +0 -0
- /package/lib/{components/Header/Header.test.cypress.d.ts → src/components/Header/Header.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Header/index.d.ts +0 -0
- /package/lib/{components → src/components}/Header/styles.d.ts +0 -0
- /package/lib/{components/Heading/Heading.test.cypress.d.ts → src/components/Heading/Heading.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Heading/index.d.ts +0 -0
- /package/lib/{components → src/components}/Heading/styles.d.ts +0 -0
- /package/lib/{components/IconFa/IconFa.test.cypress.d.ts → src/components/IconFa/IconFa.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/IconFa/index.d.ts +0 -0
- /package/lib/{components → src/components}/IconFa/styles.d.ts +0 -0
- /package/lib/{components/InfoBox/InfoBox.test.cypress.d.ts → src/components/InfoBox/InfoBox.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/InfoBox/index.d.ts +0 -0
- /package/lib/{components → src/components}/InfoBox/styles.d.ts +0 -0
- /package/lib/{components/LegendWrapper/LegendWrapper.test.cypress.d.ts → src/components/LegendWrapper/LegendWrapper.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/LegendWrapper/styles.d.ts +0 -0
- /package/lib/{components/Link/Link.test.cypress.d.ts → src/components/Link/Link.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Link/index.d.ts +0 -0
- /package/lib/{components → src/components}/Link/styles.d.ts +0 -0
- /package/lib/{components/Loader/Loader.test.cypress.d.ts → src/components/Loader/Loader.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Loader/index.d.ts +0 -0
- /package/lib/{components → src/components}/Loader/styles.d.ts +0 -0
- /package/lib/{components/Modal/Modal.test.cypress.d.ts → src/components/Modal/Modal.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Modal/index.d.ts +0 -0
- /package/lib/{components → src/components}/Modal/styles.d.ts +0 -0
- /package/lib/{components/Pagination/Pagination.test.cypress.d.ts → src/components/Pagination/Pagination.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Pagination/index.d.ts +0 -0
- /package/lib/{components → src/components}/Pagination/styles.d.ts +0 -0
- /package/lib/{components/PopOver/PopOver.test.cypress.d.ts → src/components/PopOver/PopOver.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/PopOver/index.d.ts +0 -0
- /package/lib/{components → src/components}/PopOver/styles.d.ts +0 -0
- /package/lib/{components/ProgressBar/ProgressBar.test.cypress.d.ts → src/components/ProgressBar/ProgressBar.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/ProgressBar/index.d.ts +0 -0
- /package/lib/{components → src/components}/ProgressBar/styles.d.ts +0 -0
- /package/lib/{components/Radio/Radio.test.cypress.d.ts → src/components/Radio/Radio.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Radio/index.d.ts +0 -0
- /package/lib/{components → src/components}/Radio/styles.d.ts +0 -0
- /package/lib/{components/RadioConsent/RadioConsent.test.cypress.d.ts → src/components/RadioConsent/RadioConsent.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/RadioConsent/index.d.ts +0 -0
- /package/lib/{components → src/components}/RadioConsent/styles.d.ts +0 -0
- /package/lib/{components/Select/Select.test.cypress.d.ts → src/components/Select/Select.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Select/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Spacing/index.d.ts +0 -0
- /package/lib/{components/Step/Step.test.cypress.d.ts → src/components/Step/Step.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Step/index.d.ts +0 -0
- /package/lib/{components → src/components}/Step/styles.d.ts +0 -0
- /package/lib/{components/Text/Text.test.cypress.d.ts → src/components/Text/Text.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Text/index.d.ts +0 -0
- /package/lib/{components → src/components}/Text/styles.d.ts +0 -0
- /package/lib/{components/TextAreaField/TextAreaField.test.cypress.d.ts → src/components/TextAreaField/TextAreaField.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/TextAreaField/index.d.ts +0 -0
- /package/lib/{components → src/components}/TextAreaField/styles.d.ts +0 -0
- /package/lib/{components/TextField/TextField.test.cypress.d.ts → src/components/TextField/TextField.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/TextField/styles.d.ts +0 -0
- /package/lib/{components/Totaliser/Totaliser.test.cypress.d.ts → src/components/Totaliser/Totaliser.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/Totaliser/index.d.ts +0 -0
- /package/lib/{components → src/components}/Totaliser/styles.d.ts +0 -0
- /package/lib/{components/UserBlock/UserBlock.test.cypress.d.ts → src/components/UserBlock/UserBlock.spec.d.ts} +0 -0
- /package/lib/{components → src/components}/UserBlock/index.d.ts +0 -0
- /package/lib/{components → src/components}/UserBlock/styles.d.ts +0 -0
- /package/lib/{components → src/components}/index.d.ts +0 -0
- /package/lib/{hooks → src/hooks}/useEffectBrowser.d.ts +0 -0
- /package/lib/{hooks → src/hooks}/useKey.d.ts +0 -0
- /package/lib/{hooks → src/hooks}/useLayoutEffectBrowser.d.ts +0 -0
- /package/lib/{hooks → src/hooks}/useScrollPosition.d.ts +0 -0
- /package/lib/{themes → src/themes}/bowelbabe.d.ts +0 -0
- /package/lib/{themes → src/themes}/cruk.d.ts +0 -0
- /package/lib/{themes → src/themes}/rfl.d.ts +0 -0
- /package/lib/{themes → src/themes}/su2c.d.ts +0 -0
- /package/lib/{types.d.ts → src/types.d.ts} +0 -0
- /package/lib/{utils → src/utils}/Helper.d.ts +0 -0
- /package/lib/{utils → src/utils}/__tests__/testHelpers.test.d.ts +0 -0
- /package/lib/{utils → src/utils}/debounce.d.ts +0 -0
- /package/lib/{utils → src/utils}/themeUtils.d.ts +0 -0
package/README.md
CHANGED
|
@@ -103,46 +103,29 @@ you may need to run
|
|
|
103
103
|
npm run build-storybook
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
The docsite still works if you run
|
|
107
|
-
|
|
108
|
-
```sh
|
|
109
|
-
npm run dev
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Then view the docs site at: http://127.0.0.1:8080/
|
|
113
|
-
However this isn't as well maintained as the storybook stories and will soon be deprecated
|
|
114
|
-
|
|
115
106
|
## Testing
|
|
116
107
|
|
|
117
108
|
Node: Unit testing,
|
|
118
|
-
|
|
109
|
+
Playwright: Component function, accessibility
|
|
119
110
|
Chromatic: Image snapshot comparison service, this happens in CI, people are given access to this service via their Github login.
|
|
120
111
|
|
|
121
|
-
Run all tests Unit and
|
|
112
|
+
Run all tests Unit and Playwright
|
|
122
113
|
|
|
123
114
|
```sh
|
|
124
115
|
npm run test
|
|
125
116
|
```
|
|
126
117
|
|
|
127
|
-
Run
|
|
118
|
+
Run Playright interactive testing suite (functional and accessibility tests) you might need to run `npx playwright install` the first time you use Playwright
|
|
128
119
|
|
|
129
120
|
```sh
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Run Cypress headlessly including image snapshots, docker desktop app will need to be running in the background for any headless activities
|
|
134
|
-
|
|
135
|
-
```sh
|
|
136
|
-
npm run cypress-headless
|
|
121
|
+
test-ct:ui
|
|
137
122
|
```
|
|
138
123
|
|
|
139
124
|
## Maintaining
|
|
140
125
|
|
|
141
126
|
### Dependencies
|
|
142
127
|
|
|
143
|
-
If you
|
|
144
|
-
|
|
145
|
-
It is also advices that if you make change to storybook you try and run it before merging and if you make changes to roll up and it's plug ins you try and run
|
|
128
|
+
If you make change to storybook please try and run it locally before merging and if you make changes to roll up and it's plug ins you try and run
|
|
146
129
|
|
|
147
130
|
```bash
|
|
148
131
|
npm run rollup:build-lib
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extends.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply"],"mappings":"AAAA,SAASA,IACP,OAAOA,EAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GACjE,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAAIF,UAAUD,GAClB,IAAK,IAAII,KAAKD,GAAG,CAAG,GAAEE,eAAeC,KAAKH,EAAGC,KAAOL,EAAEK,GAAKD,EAAEC,GACnE,CACI,OAAOL,
|
|
1
|
+
{"version":3,"file":"extends.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply"],"mappings":"AAAA,SAASA,IACP,OAAOA,EAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GACjE,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAAIF,UAAUD,GAClB,IAAK,IAAII,KAAKD,GAAG,CAAG,GAAEE,eAAeC,KAAKH,EAAGC,KAAOL,EAAEK,GAAKD,EAAEC,GACnE,CACI,OAAOL,CACX,EAAKJ,EAASY,MAAM,KAAMN,UAC1B","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectWithoutPropertiesLoose.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n","hasOwnProperty","call","indexOf"],"mappings":"AAAA,SAASA,EAA8BC,EAAGC,GACxC,GAAI,MAAQD,EAAG,MAAO,
|
|
1
|
+
{"version":3,"file":"objectWithoutPropertiesLoose.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n","hasOwnProperty","call","indexOf"],"mappings":"AAAA,SAASA,EAA8BC,EAAGC,GACxC,GAAI,MAAQD,EAAG,MAAO,CAAA,EACtB,IAAIE,EAAI,CAAA,EACR,IAAK,IAAIC,KAAKH,EAAG,GAAI,CAAA,EAAGI,eAAeC,KAAKL,EAAGG,GAAI,CACjD,QAAWF,EAAEK,QAAQH,GAAI,SACzBD,EAAEC,GAAKH,EAAEG,EACb,CACE,OAAOD,CACT","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPrimitive.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"],"sourcesContent":["import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };"],"names":["toPrimitive","t","r","_typeof","e","Symbol","
|
|
1
|
+
{"version":3,"file":"toPrimitive.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"],"sourcesContent":["import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };"],"names":["toPrimitive","t","r","_typeof","e","Symbol","i","call","TypeError","String","Number"],"mappings":"2BACA,SAASA,EAAYC,EAAGC,GACtB,GAAI,UAAYC,EAAQF,KAAOA,EAAG,OAAOA,EACzC,IAAIG,EAAIH,EAAEI,OAAOL,aACjB,QAAI,IAAWI,EAAG,CAChB,IAAIE,EAAIF,EAAEG,KAAKN,EAAGC,GAClB,GAAI,UAAYC,EAAQG,GAAI,OAAOA,EACnC,MAAM,IAAIE,UAAU,+CACxB,CACE,OAAQ,WAAaN,EAAIO,OAASC,QAAQT,EAC5C","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeof.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/typeof.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };"],"names":["_typeof","o","Symbol","iterator","constructor","prototype"],"mappings":"AAAA,SAASA,EAAQC,GAGf,OAAOD,EAAU,mBAAqBE,QAAU,iBAAmBA,OAAOC,SAAW,SAAUF,GAC7F,cAAcA,
|
|
1
|
+
{"version":3,"file":"typeof.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/typeof.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };"],"names":["_typeof","o","Symbol","iterator","constructor","prototype"],"mappings":"AAAA,SAASA,EAAQC,GAGf,OAAOD,EAAU,mBAAqBE,QAAU,iBAAmBA,OAAOC,SAAW,SAAUF,GAC7F,cAAcA,CAClB,EAAM,SAAUA,GACZ,OAAOA,GAAK,mBAAqBC,QAAUD,EAAEG,cAAgBF,QAAUD,IAAMC,OAAOG,UAAY,gBAAkBJ,CACtH,EAAKD,EAAQC,EACb","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{contains as t}from"./utils/DOMutils.js";import{getAllAffectedNodes as r}from"./utils/all-affected.js";import{getFirst as e,toArray as o}from"./utils/array.js";import{getActiveElement as n}from"./utils/getActiveElement.js";var u=function(u,i){return void 0===i&&(i=n(e(u).ownerDocument)),!(!i||i.dataset&&i.dataset.focusGuard)&&r(u).some(
|
|
1
|
+
import{contains as t}from"./utils/DOMutils.js";import{getAllAffectedNodes as r}from"./utils/all-affected.js";import{getFirst as e,toArray as o}from"./utils/array.js";import{getActiveElement as n}from"./utils/getActiveElement.js";var u=function(u,i){return void 0===i&&(i=n(e(u).ownerDocument)),!(!i||i.dataset&&i.dataset.focusGuard)&&r(u).some(function(r){return t(r,i)||function(t,r){return Boolean(o(t.querySelectorAll("iframe")).some(function(t){return function(t,r){return t===r}(t,r)}))}(r,i)})};export{u 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 { contains } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getFirst, toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame, activeElement) { return frame === activeElement; };\nvar focusInsideIframe = function (topNode, activeElement) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node, activeElement); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes.\n * Supports nodes hidden inside shadowDom\n */\nexport var focusInside = function (topNode, activeElement) {\n // const activeElement = document && getActiveElement();\n if (activeElement === void 0) { activeElement = getActiveElement(getFirst(topNode).ownerDocument); }\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) {\n return contains(node, activeElement) || focusInsideIframe(node, activeElement);\n });\n};\n"],"names":["focusInside","topNode","activeElement","
|
|
1
|
+
{"version":3,"file":"focusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusInside.js"],"sourcesContent":["import { contains } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getFirst, toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame, activeElement) { return frame === activeElement; };\nvar focusInsideIframe = function (topNode, activeElement) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node, activeElement); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes.\n * Supports nodes hidden inside shadowDom\n */\nexport var focusInside = function (topNode, activeElement) {\n // const activeElement = document && getActiveElement();\n if (activeElement === void 0) { activeElement = getActiveElement(getFirst(topNode).ownerDocument); }\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) {\n return contains(node, activeElement) || focusInsideIframe(node, activeElement);\n });\n};\n"],"names":["focusInside","topNode","activeElement","getActiveElement","getFirst","ownerDocument","dataset","focusGuard","getAllAffectedNodes","some","node","contains","Boolean","toArray","querySelectorAll","frame","focusInFrame","focusInsideIframe"],"mappings":"qOAIA,IAQWA,EAAc,SAAUC,EAASC,GAGxC,YADsB,IAAlBA,IAA4BA,EAAgBC,EAAiBC,EAASH,GAASI,mBAC9EH,GAAkBA,EAAcI,SAAWJ,EAAcI,QAAQC,aAG/DC,EAAoBP,GAASQ,KAAK,SAAUC,GAC/C,OAAOC,EAASD,EAAMR,IAdN,SAAUD,EAASC,GACvC,OAAOU,QAAQC,EAAQZ,EAAQa,iBAAiB,WAAWL,KAAK,SAAUC,GAAQ,OAFnE,SAAUK,EAAOb,GAAiB,OAAOa,IAAUb,CAAc,CAESc,CAAaN,EAAMR,EAAe,GAC/H,CAYgDe,CAAkBP,EAAMR,EACxE,EACA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FOCUS_ALLOW as t}from"./constants.js";import{contains as r}from"./utils/DOMutils.js";import{toArray as o}from"./utils/array.js";import{getActiveElement as e}from"./utils/getActiveElement.js";var i=function(i){void 0===i&&(i=document);var m=e(i);return!!m&&o(i.querySelectorAll("[".concat(t,"]"))).some(
|
|
1
|
+
import{FOCUS_ALLOW as t}from"./constants.js";import{contains as r}from"./utils/DOMutils.js";import{toArray as o}from"./utils/array.js";import{getActiveElement as e}from"./utils/getActiveElement.js";var i=function(i){void 0===i&&(i=document);var m=e(i);return!!m&&o(i.querySelectorAll("[".concat(t,"]"))).some(function(t){return r(t,m)})};export{i 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 { contains } from './utils/DOMutils';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\n/**\n * checks if focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n *\n * This is a utility function coupled with {@link FOCUS_ALLOW} constant\n *\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n var activeElement = getActiveElement(inDocument);\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(inDocument.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n"],"names":["focusIsHidden","inDocument","
|
|
1
|
+
{"version":3,"file":"focusIsHidden.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js"],"sourcesContent":["import { FOCUS_ALLOW } from './constants';\nimport { contains } from './utils/DOMutils';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\n/**\n * checks if focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n *\n * This is a utility function coupled with {@link FOCUS_ALLOW} constant\n *\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n var activeElement = getActiveElement(inDocument);\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(inDocument.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n"],"names":["focusIsHidden","inDocument","document","activeElement","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"sMAYU,IAACA,EAAgB,SAAUC,QACd,IAAfA,IAAyBA,EAAaC,UAC1C,IAAIC,EAAgBC,EAAiBH,GACrC,QAAKE,GAIEE,EAAQJ,EAAWK,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,KAAK,SAAUC,GAAQ,OAAOC,EAASD,EAAMP,IAC3H","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{newFocus as t,NEW_FOCUS as r}from"./solver.js";import{getFocusableNodes as o}from"./utils/DOMutils.js";import{getAllAffectedNodes as n}from"./utils/all-affected.js";import{getFirst as e,asArray as i}from"./utils/array.js";import{pickAutofocus as u}from"./utils/auto-focus.js";import{getActiveElement as f}from"./utils/getActiveElement.js";import{isNotAGuard as m,isDefined as s}from"./utils/is.js";import{getTopCommonParent as a,allParentAutofocusables as c}from"./utils/parenting.js";var l=function(l,p){var d=f(i(l).length>0?document:e(l).ownerDocument),v=n(l).filter(m),j=a(d||l,l,v),g=new Map,w=o(v,g),M=w.filter(
|
|
1
|
+
import{newFocus as t,NEW_FOCUS as r}from"./solver.js";import{getFocusableNodes as o}from"./utils/DOMutils.js";import{getAllAffectedNodes as n}from"./utils/all-affected.js";import{getFirst as e,asArray as i}from"./utils/array.js";import{pickAutofocus as u}from"./utils/auto-focus.js";import{getActiveElement as f}from"./utils/getActiveElement.js";import{isNotAGuard as m,isDefined as s}from"./utils/is.js";import{getTopCommonParent as a,allParentAutofocusables as c}from"./utils/parenting.js";var l=function(l,p){var d=f(i(l).length>0?document:e(l).ownerDocument),v=n(l).filter(m),j=a(d||l,l,v),g=new Map,w=o(v,g),M=w.filter(function(t){var r=t.node;return m(r)});if(M[0]){var h,x,y,D=o([j],g).map(function(t){return t.node}),E=(h=D,x=M,y=new Map,x.forEach(function(t){return y.set(t.node,t)}),h.map(function(t){return y.get(t)}).filter(s)),b=E.map(function(t){return t.node}),k=E.filter(function(t){return t.tabIndex>=0}).map(function(t){return t.node}),A=t(b,k,D,d,p);if(A===r){var I=u(w,k,c(v,g))||u(w,b,c(v,g));return I?{node:I}:void console.warn("focus-lock: cannot find any node to move focus into")}return void 0===A?A:E[A]}};export{l as focusSolver};
|
|
2
2
|
//# sourceMappingURL=focusSolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusSolver.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusSolver.js"],"sourcesContent":["import { NEW_FOCUS, newFocus } from './solver';\nimport { getFocusableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { asArray, getFirst } from './utils/array';\nimport { pickAutofocus } from './utils/auto-focus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n // no Set(dstNodes) for IE11 :(\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n // remap to dstNodes\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\n/**\n * contains the main logic of the `focus-lock` package.\n *\n * ! you probably dont need this function !\n *\n * given top node(s) and the last active element returns the element to be focused next\n * @returns element which should be focused to move focus inside\n * @param topNode\n * @param lastNode\n */\nexport var focusSolver = function (topNode, lastNode) {\n var activeElement = getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getFocusableNodes(entries, visibilityCache);\n var innerElements = anyFocusable.filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n return undefined;\n }\n var outerNodes = getFocusableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n // collect inner focusable and separately tabbables\n var innerFocusables = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var innerTabbable = orderedInnerElements.filter(function (_a) {\n var tabIndex = _a.tabIndex;\n return tabIndex >= 0;\n }).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerFocusables, innerTabbable, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var focusNode = \n // first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus\n pickAutofocus(anyFocusable, innerTabbable, allParentAutofocusables(entries, visibilityCache)) ||\n pickAutofocus(anyFocusable, innerFocusables, allParentAutofocusables(entries, visibilityCache));\n if (focusNode) {\n return { node: focusNode };\n }\n else {\n console.warn('focus-lock: cannot find any node to move focus into');\n return undefined;\n }\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n"],"names":["focusSolver","topNode","lastNode","activeElement","getActiveElement","asArray","length","document","getFirst","ownerDocument","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","anyFocusable","getFocusableNodes","innerElements","_a","node","srcNodes","dstNodes","remap","outerNodes","map","orderedInnerElements","forEach","entity","set","get","isDefined","innerFocusables","innerTabbable","tabIndex","newId","newFocus","NEW_FOCUS","focusNode","pickAutofocus","allParentAutofocusables","console","warn","undefined"],"mappings":"4eAQA,IAiBWA,EAAc,SAAUC,EAASC,GACxC,IAAIC,EAAgBC,EAAiBC,EAAQJ,GAASK,OAAS,EAAIC,SAAWC,EAASP,GAASQ,eAC5FC,EAAUC,EAAoBV,GAASW,OAAOC,GAC9CC,EAAeC,EAAmBZ,GAAiBF,EAASA,EAASS,GACrEM,EAAkB,IAAIC,IACtBC,EAAeC,EAAkBT,EAASM,GAC1CI,EAAgBF,EAAaN,
|
|
1
|
+
{"version":3,"file":"focusSolver.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusSolver.js"],"sourcesContent":["import { NEW_FOCUS, newFocus } from './solver';\nimport { getFocusableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { asArray, getFirst } from './utils/array';\nimport { pickAutofocus } from './utils/auto-focus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n // no Set(dstNodes) for IE11 :(\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n // remap to dstNodes\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\n/**\n * contains the main logic of the `focus-lock` package.\n *\n * ! you probably dont need this function !\n *\n * given top node(s) and the last active element returns the element to be focused next\n * @returns element which should be focused to move focus inside\n * @param topNode\n * @param lastNode\n */\nexport var focusSolver = function (topNode, lastNode) {\n var activeElement = getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getFocusableNodes(entries, visibilityCache);\n var innerElements = anyFocusable.filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n return undefined;\n }\n var outerNodes = getFocusableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n // collect inner focusable and separately tabbables\n var innerFocusables = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var innerTabbable = orderedInnerElements.filter(function (_a) {\n var tabIndex = _a.tabIndex;\n return tabIndex >= 0;\n }).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerFocusables, innerTabbable, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var focusNode = \n // first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus\n pickAutofocus(anyFocusable, innerTabbable, allParentAutofocusables(entries, visibilityCache)) ||\n pickAutofocus(anyFocusable, innerFocusables, allParentAutofocusables(entries, visibilityCache));\n if (focusNode) {\n return { node: focusNode };\n }\n else {\n console.warn('focus-lock: cannot find any node to move focus into');\n return undefined;\n }\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n"],"names":["focusSolver","topNode","lastNode","activeElement","getActiveElement","asArray","length","document","getFirst","ownerDocument","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","anyFocusable","getFocusableNodes","innerElements","_a","node","srcNodes","dstNodes","remap","outerNodes","map","orderedInnerElements","forEach","entity","set","get","isDefined","innerFocusables","innerTabbable","tabIndex","newId","newFocus","NEW_FOCUS","focusNode","pickAutofocus","allParentAutofocusables","console","warn","undefined"],"mappings":"4eAQA,IAiBWA,EAAc,SAAUC,EAASC,GACxC,IAAIC,EAAgBC,EAAiBC,EAAQJ,GAASK,OAAS,EAAIC,SAAWC,EAASP,GAASQ,eAC5FC,EAAUC,EAAoBV,GAASW,OAAOC,GAC9CC,EAAeC,EAAmBZ,GAAiBF,EAASA,EAASS,GACrEM,EAAkB,IAAIC,IACtBC,EAAeC,EAAkBT,EAASM,GAC1CI,EAAgBF,EAAaN,OAAO,SAAUS,GAC9C,IAAIC,EAAOD,EAAGC,KACd,OAAOT,EAAYS,EAC3B,GACI,GAAKF,EAAc,GAAnB,CAGA,IA9ByBG,EAAUC,EAC/BC,EA6BAC,EAAaP,EAAkB,CAACL,GAAeE,GAAiBW,IAAI,SAAUN,GAE9E,OADWA,EAAGC,IAEtB,GACQM,GAlCqBL,EAkCeG,EAlCLF,EAkCiBJ,EAjChDK,EAAQ,IAAIR,IAEhBO,EAASK,QAAQ,SAAUC,GAAU,OAAOL,EAAMM,IAAID,EAAOR,KAAMQ,EAAQ,GAEpEP,EAASI,IAAI,SAAUL,GAAQ,OAAOG,EAAMO,IAAIV,EAAM,GAAIV,OAAOqB,IA+BpEC,EAAkBN,EAAqBD,IAAI,SAAUN,GAErD,OADWA,EAAGC,IAEtB,GACQa,EAAgBP,EAAqBhB,OAAO,SAAUS,GAEtD,OADeA,EAAGe,UACC,CAC3B,GAAOT,IAAI,SAAUN,GAEb,OADWA,EAAGC,IAEtB,GACQe,EAAQC,EAASJ,EAAiBC,EAAeT,EAAYvB,EAAeD,GAChF,GAAImC,IAAUE,EAAW,CACrB,IAAIC,EAEJC,EAAcvB,EAAciB,EAAeO,EAAwBhC,EAASM,KACxEyB,EAAcvB,EAAcgB,EAAiBQ,EAAwBhC,EAASM,IAClF,OAAIwB,EACO,CAAElB,KAAMkB,QAGfG,QAAQC,KAAK,sDAGzB,CACI,YAAcC,IAAVR,EACOA,EAEJT,EAAqBS,EAnChC,CAoCA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getAllAffectedNodes as r}from"./utils/all-affected.js";import{isNotAGuard as t,isGuard as i}from"./utils/is.js";import{getTopCommonParent as o}from"./utils/parenting.js";import{orderByTabIndex as e}from"./utils/tabOrder.js";import{getFocusables as n}from"./utils/tabUtils.js";var m=function(m){var s=r(m).filter(t),f=o(m,m,s),a=e(n([f],!0),!0,!0),l=n(s,!1);return a.map(
|
|
1
|
+
import{getAllAffectedNodes as r}from"./utils/all-affected.js";import{isNotAGuard as t,isGuard as i}from"./utils/is.js";import{getTopCommonParent as o}from"./utils/parenting.js";import{orderByTabIndex as e}from"./utils/tabOrder.js";import{getFocusables as n}from"./utils/tabUtils.js";var m=function(m){var s=r(m).filter(t),f=o(m,m,s),a=e(n([f],!0),!0,!0),l=n(s,!1);return a.map(function(r){var t=r.node;return{node:t,index:r.index,lockItem:l.indexOf(t)>=0,guard:i(t)}})};export{m as expandFocusableNodes};
|
|
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 { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\nimport { orderByTabIndex } from './utils/tabOrder';\nimport { getFocusables } from './utils/tabUtils';\n/**\n * traverses all related nodes (including groups) returning a list of all nodes(outer and internal) with meta information\n * This is low-level API!\n * @returns list of focusable elements inside a given top(!) node.\n * @see {@link getFocusableNodes} providing a simpler API\n */\nexport var expandFocusableNodes = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var outerNodes = orderByTabIndex(getFocusables([commonParent], true), true, true);\n var innerElements = getFocusables(entries, false);\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":["expandFocusableNodes","topNode","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","outerNodes","orderByTabIndex","getFocusables","innerElements","map","_a","node","index","lockItem","indexOf","guard","isGuard"],"mappings":"2RAWU,IAACA,EAAuB,SAAUC,GACxC,IAAIC,EAAUC,EAAoBF,GAASG,OAAOC,GAC9CC,EAAeC,EAAmBN,EAASA,EAASC,GACpDM,EAAaC,EAAgBC,EAAc,CAACJ,IAAe,IAAO,GAAM,GACxEK,EAAgBD,EAAcR,GAAS,GAC3C,OAAOM,EAAWI,
|
|
1
|
+
{"version":3,"file":"focusables.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusables.js"],"sourcesContent":["import { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\nimport { orderByTabIndex } from './utils/tabOrder';\nimport { getFocusables } from './utils/tabUtils';\n/**\n * traverses all related nodes (including groups) returning a list of all nodes(outer and internal) with meta information\n * This is low-level API!\n * @returns list of focusable elements inside a given top(!) node.\n * @see {@link getFocusableNodes} providing a simpler API\n */\nexport var expandFocusableNodes = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var outerNodes = orderByTabIndex(getFocusables([commonParent], true), true, true);\n var innerElements = getFocusables(entries, false);\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":["expandFocusableNodes","topNode","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","outerNodes","orderByTabIndex","getFocusables","innerElements","map","_a","node","index","lockItem","indexOf","guard","isGuard"],"mappings":"2RAWU,IAACA,EAAuB,SAAUC,GACxC,IAAIC,EAAUC,EAAoBF,GAASG,OAAOC,GAC9CC,EAAeC,EAAmBN,EAASA,EAASC,GACpDM,EAAaC,EAAgBC,EAAc,CAACJ,IAAe,IAAO,GAAM,GACxEK,EAAgBD,EAAcR,GAAS,GAC3C,OAAOM,EAAWI,IAAI,SAAUC,GAC5B,IAAIC,EAAOD,EAAGC,KACd,MAAA,CACIA,KAAMA,EACNC,MAHwBF,EAAGE,MAI3BC,SAAUL,EAAcM,QAAQH,IAAS,EACzCI,MAAOC,EAAQL,GAE3B,EACA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{focusOn as o}from"./commands.js";import{focusSolver as e}from"./focusSolver.js";var t=0,c=!1,s=function(s,i,n){void 0===n&&(n={});var f=e(s,i);if(!c&&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"),c=!0,void setTimeout(
|
|
1
|
+
import{focusOn as o}from"./commands.js";import{focusSolver as e}from"./focusSolver.js";var t=0,c=!1,s=function(s,i,n){void 0===n&&(n={});var f=e(s,i);if(!c&&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"),c=!0,void setTimeout(function(){c=!1},1);t++,o(f.node,n.focusOptions),t--}};export{s as moveFocusInside};
|
|
2
2
|
//# sourceMappingURL=moveFocusInside.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveFocusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/moveFocusInside.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { focusSolver } from './focusSolver';\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * The main functionality of the focus-lock package\n *\n * Contains focus at a given node.\n * The last focused element will help to determine which element(first or last) should be focused.\n * The found element will be focused.\n *\n * This is one time action (move), not a persistent focus-lock\n *\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @see {@link focusSolver} for the same functionality without autofocus\n */\nexport var moveFocusInside = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = focusSolver(topNode, lastNode);\n // global local side effect to countain recursive lock activation and resolve focus-fighting\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n /** +FOCUS-FIGHTING prevention **/\n if (guardCount > 2) {\n // we have recursive entered back the lock activation\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":["guardCount","lockDisabled","moveFocusInside","topNode","lastNode","options","
|
|
1
|
+
{"version":3,"file":"moveFocusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/moveFocusInside.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { focusSolver } from './focusSolver';\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * The main functionality of the focus-lock package\n *\n * Contains focus at a given node.\n * The last focused element will help to determine which element(first or last) should be focused.\n * The found element will be focused.\n *\n * This is one time action (move), not a persistent focus-lock\n *\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @see {@link focusSolver} for the same functionality without autofocus\n */\nexport var moveFocusInside = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = focusSolver(topNode, lastNode);\n // global local side effect to countain recursive lock activation and resolve focus-fighting\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n /** +FOCUS-FIGHTING prevention **/\n if (guardCount > 2) {\n // we have recursive entered back the lock activation\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":["guardCount","lockDisabled","moveFocusInside","topNode","lastNode","options","focusable","focusSolver","console","error","setTimeout","focusOn","node","focusOptions"],"mappings":"uFAEA,IAAIA,EAAa,EACbC,GAAe,EAaRC,EAAkB,SAAUC,EAASC,EAAUC,QACtC,IAAZA,IAAsBA,EAAU,CAAA,GACpC,IAAIC,EAAYC,EAAYJ,EAASC,GAErC,IAAIH,GAGAK,EAAW,CAEX,GAAIN,EAAa,EAQb,OANAQ,QAAQC,MAAM,qJAEdR,GAAe,OACfS,WAAW,WACPT,GAAe,CAC/B,EAAe,GAGPD,IACAW,EAAQL,EAAUM,KAAMP,EAAQQ,cAChCb,GACR,CACA","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-focus.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/return-focus.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nfunction weakRef(value) {\n if (!value)\n return null;\n // #68 Safari 14.1 dont have it yet\n // FIXME: remove in 2025\n if (typeof WeakRef === 'undefined') {\n return function () { return value || null; };\n }\n var w = value ? new WeakRef(value) : null;\n return function () { return (w === null || w === void 0 ? void 0 : w.deref()) || null; };\n}\nexport var recordElementLocation = function (element) {\n if (!element) {\n return null;\n }\n var stack = [];\n var currentElement = element;\n while (currentElement && currentElement !== document.body) {\n stack.push({\n current: weakRef(currentElement),\n parent: weakRef(currentElement.parentElement),\n left: weakRef(currentElement.previousElementSibling),\n right: weakRef(currentElement.nextElementSibling),\n });\n currentElement = currentElement.parentElement;\n }\n return {\n element: weakRef(element),\n stack: stack,\n ownerDocument: element.ownerDocument,\n };\n};\nvar restoreFocusTo = function (location) {\n var _a, _b, _c, _d, _e;\n if (!location) {\n return undefined;\n }\n var stack = location.stack, ownerDocument = location.ownerDocument;\n var visibilityCache = new Map();\n for (var _i = 0, stack_1 = stack; _i < stack_1.length; _i++) {\n var line = stack_1[_i];\n var parent_1 = (_a = line.parent) === null || _a === void 0 ? void 0 : _a.call(line);\n // is it still here?\n if (parent_1 && ownerDocument.contains(parent_1)) {\n var left = (_b = line.left) === null || _b === void 0 ? void 0 : _b.call(line);\n var savedCurrent = line.current();\n var current = parent_1.contains(savedCurrent) ? savedCurrent : undefined;\n var right = (_c = line.right) === null || _c === void 0 ? void 0 : _c.call(line);\n var focusables = getTabbableNodes([parent_1], visibilityCache);\n var aim = \n // that is element itself\n (_e = (_d = current !== null && current !== void 0 ? current : \n // or something in it's place\n left === null || left === void 0 ? void 0 : left.nextElementSibling) !== null && _d !== void 0 ? _d : \n // or somebody to the right, still close enough\n right) !== null && _e !== void 0 ? _e : \n // or somebody to the left, something?\n left;\n while (aim) {\n for (var _f = 0, focusables_1 = focusables; _f < focusables_1.length; _f++) {\n var focusable = focusables_1[_f];\n if (aim === null || aim === void 0 ? void 0 : aim.contains(focusable.node)) {\n return focusable.node;\n }\n }\n aim = aim.nextElementSibling;\n }\n if (focusables.length) {\n // if parent contains a focusable - move there\n return focusables[0].node;\n }\n }\n }\n // nothing matched\n return undefined;\n};\n/**\n * Captures the current focused element to restore focus as close as possible in the future\n * Handles situations where the focused element is removed from the DOM or no longer focusable\n * moving focus to the closest focusable element\n * @param targetElement - element where focus should be restored\n * @returns a function returning a new element to focus\n */\nexport var captureFocusRestore = function (targetElement) {\n var location = recordElementLocation(targetElement);\n return function () {\n return restoreFocusTo(location);\n };\n};\n"],"names":["weakRef","value","WeakRef","w","
|
|
1
|
+
{"version":3,"file":"return-focus.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/return-focus.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nfunction weakRef(value) {\n if (!value)\n return null;\n // #68 Safari 14.1 dont have it yet\n // FIXME: remove in 2025\n if (typeof WeakRef === 'undefined') {\n return function () { return value || null; };\n }\n var w = value ? new WeakRef(value) : null;\n return function () { return (w === null || w === void 0 ? void 0 : w.deref()) || null; };\n}\nexport var recordElementLocation = function (element) {\n if (!element) {\n return null;\n }\n var stack = [];\n var currentElement = element;\n while (currentElement && currentElement !== document.body) {\n stack.push({\n current: weakRef(currentElement),\n parent: weakRef(currentElement.parentElement),\n left: weakRef(currentElement.previousElementSibling),\n right: weakRef(currentElement.nextElementSibling),\n });\n currentElement = currentElement.parentElement;\n }\n return {\n element: weakRef(element),\n stack: stack,\n ownerDocument: element.ownerDocument,\n };\n};\nvar restoreFocusTo = function (location) {\n var _a, _b, _c, _d, _e;\n if (!location) {\n return undefined;\n }\n var stack = location.stack, ownerDocument = location.ownerDocument;\n var visibilityCache = new Map();\n for (var _i = 0, stack_1 = stack; _i < stack_1.length; _i++) {\n var line = stack_1[_i];\n var parent_1 = (_a = line.parent) === null || _a === void 0 ? void 0 : _a.call(line);\n // is it still here?\n if (parent_1 && ownerDocument.contains(parent_1)) {\n var left = (_b = line.left) === null || _b === void 0 ? void 0 : _b.call(line);\n var savedCurrent = line.current();\n var current = parent_1.contains(savedCurrent) ? savedCurrent : undefined;\n var right = (_c = line.right) === null || _c === void 0 ? void 0 : _c.call(line);\n var focusables = getTabbableNodes([parent_1], visibilityCache);\n var aim = \n // that is element itself\n (_e = (_d = current !== null && current !== void 0 ? current : \n // or something in it's place\n left === null || left === void 0 ? void 0 : left.nextElementSibling) !== null && _d !== void 0 ? _d : \n // or somebody to the right, still close enough\n right) !== null && _e !== void 0 ? _e : \n // or somebody to the left, something?\n left;\n while (aim) {\n for (var _f = 0, focusables_1 = focusables; _f < focusables_1.length; _f++) {\n var focusable = focusables_1[_f];\n if (aim === null || aim === void 0 ? void 0 : aim.contains(focusable.node)) {\n return focusable.node;\n }\n }\n aim = aim.nextElementSibling;\n }\n if (focusables.length) {\n // if parent contains a focusable - move there\n return focusables[0].node;\n }\n }\n }\n // nothing matched\n return undefined;\n};\n/**\n * Captures the current focused element to restore focus as close as possible in the future\n * Handles situations where the focused element is removed from the DOM or no longer focusable\n * moving focus to the closest focusable element\n * @param targetElement - element where focus should be restored\n * @returns a function returning a new element to focus\n */\nexport var captureFocusRestore = function (targetElement) {\n var location = recordElementLocation(targetElement);\n return function () {\n return restoreFocusTo(location);\n };\n};\n"],"names":["weakRef","value","WeakRef","w","deref","recordElementLocation","element","stack","currentElement","document","body","push","current","parent","parentElement","left","previousElementSibling","right","nextElementSibling","ownerDocument","captureFocusRestore","targetElement","location","_a","_b","_c","_d","_e","visibilityCache","Map","_i","stack_1","length","line","parent_1","call","contains","savedCurrent","undefined","focusables","getTabbableNodes","aim","_f","focusables_1","focusable","node","restoreFocusTo"],"mappings":"uDACA,SAASA,EAAQC,GACb,IAAKA,EACD,OAAO,KAGX,GAAuB,oBAAZC,QACP,OAAO,WAAc,OAAOD,GAAS,IAAK,EAE9C,IAAIE,EAAIF,EAAQ,IAAIC,QAAQD,GAAS,KACrC,OAAO,WAAc,OAAQE,aAA6B,EAASA,EAAEC,UAAY,IAAK,CAC1F,CACU,IAACC,EAAwB,SAAUC,GACzC,IAAKA,EACD,OAAO,KAIX,IAFA,IAAIC,EAAQ,GACRC,EAAiBF,EACdE,GAAkBA,IAAmBC,SAASC,MACjDH,EAAMI,KAAK,CACPC,QAASZ,EAAQQ,GACjBK,OAAQb,EAAQQ,EAAeM,eAC/BC,KAAMf,EAAQQ,EAAeQ,wBAC7BC,MAAOjB,EAAQQ,EAAeU,sBAElCV,EAAiBA,EAAeM,cAEpC,MAAO,CACHR,QAASN,EAAQM,GACjBC,MAAOA,EACPY,cAAeb,EAAQa,cAE/B,EAoDWC,EAAsB,SAAUC,GACvC,IAAIC,EAAWjB,EAAsBgB,GACrC,OAAO,WACH,OAtDa,SAAUC,GAC3B,IAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EACpB,GAAKL,EAKL,IAFA,IAAIf,EAAQe,EAASf,MAAOY,EAAgBG,EAASH,cACjDS,EAAkB,IAAIC,IACjBC,EAAK,EAAGC,EAAUxB,EAAOuB,EAAKC,EAAQC,OAAQF,IAAM,CACzD,IAAIG,EAAOF,EAAQD,GACfI,EAAkC,QAAtBX,EAAKU,EAAKpB,cAA2B,IAAPU,OAAgB,EAASA,EAAGY,KAAKF,GAE/E,GAAIC,GAAYf,EAAciB,SAASF,GAAW,CAe9C,IAdA,IAAInB,EAA4B,QAApBS,EAAKS,EAAKlB,YAAyB,IAAPS,OAAgB,EAASA,EAAGW,KAAKF,GACrEI,EAAeJ,EAAKrB,UACpBA,EAAUsB,EAASE,SAASC,GAAgBA,OAAeC,EAC3DrB,EAA8B,QAArBQ,EAAKQ,EAAKhB,aAA0B,IAAPQ,OAAgB,EAASA,EAAGU,KAAKF,GACvEM,EAAaC,EAAiB,CAACN,GAAWN,GAC1Ca,EAMO,QAJVd,EAEwE,QAFlED,EAAKd,QAAyCA,EAErDG,aAAmC,EAASA,EAAKG,0BAAuC,IAAPQ,EAAgBA,EAEjGT,SAA0B,IAAPU,EAAgBA,EAEnCZ,EACO0B,GAAK,CACR,IAAK,IAAIC,EAAK,EAAGC,EAAeJ,EAAYG,EAAKC,EAAaX,OAAQU,IAAM,CACxE,IAAIE,EAAYD,EAAaD,GAC7B,GAAID,aAAiC,EAASA,EAAIL,SAASQ,EAAUC,MACjE,OAAOD,EAAUC,IAEzC,CACgBJ,EAAMA,EAAIvB,kBAC1B,CACY,GAAIqB,EAAWP,OAEX,OAAOO,EAAW,GAAGM,IAErC,CACA,CAGA,CAWeC,CAAexB,EAC9B,CACA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{focusOn as n}from"./commands.js";import{getTabbableNodes as o,getFocusableNodes as e,contains as t}from"./utils/DOMutils.js";import{asArray as r}from"./utils/array.js";var i=function(n,i,c){if(!n||!i)return console.error("no element or scope given"),{};var s=r(i);if(s.every(
|
|
1
|
+
import{focusOn as n}from"./commands.js";import{getTabbableNodes as o,getFocusableNodes as e,contains as t}from"./utils/DOMutils.js";import{asArray as r}from"./utils/array.js";var i=function(n,i,c){if(!n||!i)return console.error("no element or scope given"),{};var s=r(i);if(s.every(function(o){return!t(o,n)}))return console.error("Active element is not contained in the scope"),{};var a=c?o(s,new Map):e(s,new Map),u=a.findIndex(function(o){return o.node===n});return-1!==u?{prev:a[u-1],next:a[u+1],first:a[0],last:a[a.length-1]}:void 0},c=function(o,e,t){void 0===e&&(e={});var r=function(n){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},n)}(e),c=i(o,r.scope,r.onlyTabbable);if(c){var s=t(c,r.cycle);s&&n(s.node,r.focusOptions)}},s=function(n,o){void 0===o&&(o={}),c(n,o,function(n,o){var e=n.next,t=n.first;return e||o&&t})},a=function(n,o){void 0===o&&(o={}),c(n,o,function(n,o){var e=n.prev,t=n.last;return e||o&&t})},u=function(t,i,c){var s,a,u,f,l=(a=t,u=null===(s=i.onlyTabbable)||void 0===s||s,{first:(f=u?o(r(a),new Map):e(r(a),new Map))[0],last:f[f.length-1]})[c];l&&n(l.node,i.focusOptions)},f=function(n,o){void 0===o&&(o={}),u(n,o,"first")},l=function(n,o){void 0===o&&(o={}),u(n,o,"last")};export{f as focusFirstElement,l as focusLastElement,s as focusNextElement,a as focusPrevElement,i as getRelativeFocusable};
|
|
2
2
|
//# sourceMappingURL=sibling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sibling.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/sibling.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { getTabbableNodes, contains, getFocusableNodes } from './utils/DOMutils';\nimport { asArray } from './utils/array';\n/**\n * for a given `element` in a given `scope` returns focusable siblings\n * @param element - base element\n * @param scope - common parent. Can be document, but better to narrow it down for performance reasons\n * @returns {prev,next} - references to a focusable element before and after\n * @returns undefined - if operation is not applicable\n */\nexport var getRelativeFocusable = function (element, scope, useTabbables) {\n if (!element || !scope) {\n console.error('no element or scope given');\n return {};\n }\n var shards = asArray(scope);\n if (shards.every(function (shard) { return !contains(shard, element); })) {\n console.error('Active element is not contained in the scope');\n return {};\n }\n var focusables = useTabbables\n ? getTabbableNodes(shards, new Map())\n : getFocusableNodes(shards, new Map());\n var current = focusables.findIndex(function (_a) {\n var node = _a.node;\n return node === element;\n });\n if (current === -1) {\n // an edge case, when anchor element is not found\n return undefined;\n }\n return {\n prev: focusables[current - 1],\n next: focusables[current + 1],\n first: focusables[0],\n last: focusables[focusables.length - 1],\n };\n};\nvar getBoundary = function (shards, useTabbables) {\n var set = useTabbables\n ? getTabbableNodes(asArray(shards), new Map())\n : getFocusableNodes(asArray(shards), new Map());\n return {\n first: set[0],\n last: set[set.length - 1],\n };\n};\nvar defaultOptions = function (options) {\n return Object.assign({\n scope: document.body,\n cycle: true,\n onlyTabbable: true,\n }, options);\n};\nvar moveFocus = function (fromElement, options, cb) {\n if (options === void 0) { options = {}; }\n var newOptions = defaultOptions(options);\n var solution = getRelativeFocusable(fromElement, newOptions.scope, newOptions.onlyTabbable);\n if (!solution) {\n return;\n }\n var target = cb(solution, newOptions.cycle);\n if (target) {\n focusOn(target.node, newOptions.focusOptions);\n }\n};\n/**\n * focuses next element in the tab-order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusNextElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var next = _a.next, first = _a.first;\n return next || (cycle && first);\n });\n};\n/**\n * focuses prev element in the tab order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusPrevElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var prev = _a.prev, last = _a.last;\n return prev || (cycle && last);\n });\n};\nvar pickBoundary = function (scope, options, what) {\n var _a;\n var boundary = getBoundary(scope, (_a = options.onlyTabbable) !== null && _a !== void 0 ? _a : true);\n var node = boundary[what];\n if (node) {\n focusOn(node.node, options.focusOptions);\n }\n};\n/**\n * focuses first element in the tab-order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusFirstElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'first');\n};\n/**\n * focuses last element in the tab order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusLastElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'last');\n};\n"],"names":["getRelativeFocusable","element","scope","useTabbables","console","error","shards","asArray","every","shard","contains","focusables","getTabbableNodes","Map","getFocusableNodes","current","findIndex","_a","node","prev","next","first","last","length","moveFocus","fromElement","options","cb","
|
|
1
|
+
{"version":3,"file":"sibling.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/sibling.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { getTabbableNodes, contains, getFocusableNodes } from './utils/DOMutils';\nimport { asArray } from './utils/array';\n/**\n * for a given `element` in a given `scope` returns focusable siblings\n * @param element - base element\n * @param scope - common parent. Can be document, but better to narrow it down for performance reasons\n * @returns {prev,next} - references to a focusable element before and after\n * @returns undefined - if operation is not applicable\n */\nexport var getRelativeFocusable = function (element, scope, useTabbables) {\n if (!element || !scope) {\n console.error('no element or scope given');\n return {};\n }\n var shards = asArray(scope);\n if (shards.every(function (shard) { return !contains(shard, element); })) {\n console.error('Active element is not contained in the scope');\n return {};\n }\n var focusables = useTabbables\n ? getTabbableNodes(shards, new Map())\n : getFocusableNodes(shards, new Map());\n var current = focusables.findIndex(function (_a) {\n var node = _a.node;\n return node === element;\n });\n if (current === -1) {\n // an edge case, when anchor element is not found\n return undefined;\n }\n return {\n prev: focusables[current - 1],\n next: focusables[current + 1],\n first: focusables[0],\n last: focusables[focusables.length - 1],\n };\n};\nvar getBoundary = function (shards, useTabbables) {\n var set = useTabbables\n ? getTabbableNodes(asArray(shards), new Map())\n : getFocusableNodes(asArray(shards), new Map());\n return {\n first: set[0],\n last: set[set.length - 1],\n };\n};\nvar defaultOptions = function (options) {\n return Object.assign({\n scope: document.body,\n cycle: true,\n onlyTabbable: true,\n }, options);\n};\nvar moveFocus = function (fromElement, options, cb) {\n if (options === void 0) { options = {}; }\n var newOptions = defaultOptions(options);\n var solution = getRelativeFocusable(fromElement, newOptions.scope, newOptions.onlyTabbable);\n if (!solution) {\n return;\n }\n var target = cb(solution, newOptions.cycle);\n if (target) {\n focusOn(target.node, newOptions.focusOptions);\n }\n};\n/**\n * focuses next element in the tab-order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusNextElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var next = _a.next, first = _a.first;\n return next || (cycle && first);\n });\n};\n/**\n * focuses prev element in the tab order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusPrevElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var prev = _a.prev, last = _a.last;\n return prev || (cycle && last);\n });\n};\nvar pickBoundary = function (scope, options, what) {\n var _a;\n var boundary = getBoundary(scope, (_a = options.onlyTabbable) !== null && _a !== void 0 ? _a : true);\n var node = boundary[what];\n if (node) {\n focusOn(node.node, options.focusOptions);\n }\n};\n/**\n * focuses first element in the tab-order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusFirstElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'first');\n};\n/**\n * focuses last element in the tab order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusLastElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'last');\n};\n"],"names":["getRelativeFocusable","element","scope","useTabbables","console","error","shards","asArray","every","shard","contains","focusables","getTabbableNodes","Map","getFocusableNodes","current","findIndex","_a","node","prev","next","first","last","length","moveFocus","fromElement","options","cb","newOptions","Object","assign","document","body","cycle","onlyTabbable","defaultOptions","solution","target","focusOn","focusOptions","focusNextElement","focusPrevElement","pickBoundary","what","set","focusFirstElement","focusLastElement"],"mappings":"+KAUU,IAACA,EAAuB,SAAUC,EAASC,EAAOC,GACxD,IAAKF,IAAYC,EAEb,OADAE,QAAQC,MAAM,6BACP,CAAA,EAEX,IAAIC,EAASC,EAAQL,GACrB,GAAII,EAAOE,MAAM,SAAUC,GAAS,OAAQC,EAASD,EAAOR,EAAS,GAEjE,OADAG,QAAQC,MAAM,gDACP,CAAA,EAEX,IAAIM,EAAaR,EACXS,EAAiBN,EAAQ,IAAIO,KAC7BC,EAAkBR,EAAQ,IAAIO,KAChCE,EAAUJ,EAAWK,UAAU,SAAUC,GAEzC,OADWA,EAAGC,OACEjB,CACxB,GACI,OAAgB,IAAZc,EAIG,CACHI,KAAMR,EAAWI,EAAU,GAC3BK,KAAMT,EAAWI,EAAU,GAC3BM,MAAOV,EAAW,GAClBW,KAAMX,EAAWA,EAAWY,OAAS,SARzC,CAUJ,EAiBIC,EAAY,SAAUC,EAAaC,EAASC,QAC5B,IAAZD,IAAsBA,EAAU,CAAA,GACpC,IAAIE,EATa,SAAUF,GAC3B,OAAOG,OAAOC,OAAO,CACjB5B,MAAO6B,SAASC,KAChBC,OAAO,EACPC,cAAc,GACfR,EACP,CAGqBS,CAAeT,GAC5BU,EAAWpC,EAAqByB,EAAaG,EAAW1B,MAAO0B,EAAWM,cAC9E,GAAKE,EAAL,CAGA,IAAIC,EAASV,EAAGS,EAAUR,EAAWK,OACjCI,GACAC,EAAQD,EAAOnB,KAAMU,EAAWW,aAHxC,CAKA,EAMWC,EAAmB,SAAUf,EAAaC,QACjC,IAAZA,IAAsBA,EAAU,CAAA,GACpCF,EAAUC,EAAaC,EAAS,SAAUT,EAAIgB,GAC1C,IAAIb,EAAOH,EAAGG,KAAMC,EAAQJ,EAAGI,MAC/B,OAAOD,GAASa,GAASZ,CACjC,EACA,EAMWoB,EAAmB,SAAUhB,EAAaC,QACjC,IAAZA,IAAsBA,EAAU,CAAA,GACpCF,EAAUC,EAAaC,EAAS,SAAUT,EAAIgB,GAC1C,IAAId,EAAOF,EAAGE,KAAMG,EAAOL,EAAGK,KAC9B,OAAOH,GAASc,GAASX,CACjC,EACA,EACIoB,EAAe,SAAUxC,EAAOwB,EAASiB,GACzC,IAAI1B,EArDoBX,EAAQH,EAC5ByC,EAsDA1B,GAvDoBZ,EAsDGJ,EAtDKC,EAsDkC,QAA/Bc,EAAKS,EAAQQ,oBAAiC,IAAPjB,GAAgBA,EAlDnF,CACHI,OAJAuB,EAAMzC,EACJS,EAAiBL,EAAQD,GAAS,IAAIO,KACtCC,EAAkBP,EAAQD,GAAS,IAAIO,MAE9B,GACXS,KAAMsB,EAAIA,EAAIrB,OAAS,KAiDPoB,GAChBzB,GACAoB,EAAQpB,EAAKA,KAAMQ,EAAQa,aAEnC,EAKWM,EAAoB,SAAU3C,EAAOwB,QAC5B,IAAZA,IAAsBA,EAAU,CAAA,GACpCgB,EAAaxC,EAAOwB,EAAS,QACjC,EAKWoB,EAAmB,SAAU5C,EAAOwB,QAC3B,IAAZA,IAAsBA,EAAU,CAAA,GACpCgB,EAAaxC,EAAOwB,EAAS,OACjC","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{correctNodes as i}from"./utils/correctFocus.js";import{pickFocusable as r}from"./utils/firstFocus.js";import{isGuard as t}from"./utils/is.js";var n="NEW_FOCUS",e=function(e,f,o,d,a){var s=e.length,u=e[0],x=e[s-1],O=t(d);if(!(d&&e.indexOf(d)>=0)){var v=void 0!==d?o.indexOf(d):-1,h=a?o.indexOf(a):v,l=a?e.indexOf(a):-1;if(-1===v)return-1!==l?l:n;if(-1===l)return n;var c=v-h,m=o.indexOf(u),b=o.indexOf(x),p=i(o),M=void 0!==d?p.indexOf(d):-1,g=a?p.indexOf(a):M,j=p.filter(
|
|
1
|
+
import{correctNodes as i}from"./utils/correctFocus.js";import{pickFocusable as r}from"./utils/firstFocus.js";import{isGuard as t}from"./utils/is.js";var n="NEW_FOCUS",e=function(e,f,o,d,a){var s=e.length,u=e[0],x=e[s-1],O=t(d);if(!(d&&e.indexOf(d)>=0)){var v=void 0!==d?o.indexOf(d):-1,h=a?o.indexOf(a):v,l=a?e.indexOf(a):-1;if(-1===v)return-1!==l?l:n;if(-1===l)return n;var c=v-h,m=o.indexOf(u),b=o.indexOf(x),p=i(o),M=void 0!==d?p.indexOf(d):-1,g=a?p.indexOf(a):M,j=p.filter(function(i){return i.tabIndex>=0}),F=void 0!==d?j.indexOf(d):-1,C=a?j.indexOf(a):F,E=F>=0&&C>=0?C-F:g-M;if(!c&&l>=0)return l;if(0===f.length)return l;var I=r(e,f[0]),N=r(e,f[f.length-1]);return v<=m&&O&&Math.abs(c)>1?N:v>=b&&O&&Math.abs(c)>1?I:c&&Math.abs(E)>1?l:v<=m?N:v>b?I:c?Math.abs(c)>1?l:(s+l+c)%s:void 0}};export{n as NEW_FOCUS,e 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';\n/**\n * Main solver for the \"find next focus\" question\n * @param innerNodes - used to control \"return focus\"\n * @param innerTabbables - used to control \"autofocus\"\n * @param outerNodes\n * @param activeElement\n * @param lastNode\n * @returns {number|string|undefined|*}\n */\nexport var newFocus = function (innerNodes, innerTabbables, 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 // focus is inside\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 // no active focus (or focus is on the body)\n if (activeIndex === -1) {\n // known fallback\n if (lastNodeInside !== -1) {\n return lastNodeInside;\n }\n return NEW_FOCUS;\n }\n // new focus, nothing to calculate\n if (lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var currentFocusableIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var previousFocusableIndex = lastNode ? correctedNodes.indexOf(lastNode) : currentFocusableIndex;\n var tabbableNodes = correctedNodes.filter(function (node) { return node.tabIndex >= 0; });\n var currentTabbableIndex = activeElement !== undefined ? tabbableNodes.indexOf(activeElement) : -1;\n var previousTabbableIndex = lastNode ? tabbableNodes.indexOf(lastNode) : currentTabbableIndex;\n var focusIndexDiff = currentTabbableIndex >= 0 && previousTabbableIndex >= 0\n ? // old/new are tabbables, measure distance in tabbable space\n previousTabbableIndex - currentTabbableIndex\n : // or else measure in focusable space\n previousFocusableIndex - currentFocusableIndex;\n // old focus\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\n // no tabbable elements, autofocus is not possible\n if (innerTabbables.length === 0) {\n // an edge case with no tabbable elements\n // return the last focusable one\n // with some probability this will prevent focus from cycling across the lock, but there is no tabbale elements to cycle to\n return lastNodeInside;\n }\n var returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);\n var returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);\n // first element\n if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnLastNode;\n }\n // last element\n if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnFirstNode;\n }\n // jump out, but not on the guard\n if (indexDiff && Math.abs(focusIndexDiff) > 1) {\n return lastNodeInside;\n }\n // focus above lock\n if (activeIndex <= firstNodeIndex) {\n return returnLastNode;\n }\n // focus below lock\n if (activeIndex > lastNodeIndex) {\n return returnFirstNode;\n }\n // index is inside tab order, but outside Lock\n if (indexDiff) {\n if (Math.abs(indexDiff) > 1) {\n return lastNodeInside;\n }\n return (cnt + lastNodeInside + indexDiff) % cnt;\n }\n // do nothing\n return undefined;\n};\n"],"names":["NEW_FOCUS","newFocus","innerNodes","innerTabbables","outerNodes","activeElement","lastNode","cnt","length","firstFocus","lastFocus","isOnGuard","isGuard","indexOf","activeIndex","undefined","lastIndex","lastNodeInside","indexDiff","firstNodeIndex","lastNodeIndex","correctedNodes","correctNodes","currentFocusableIndex","previousFocusableIndex","tabbableNodes","filter","node","tabIndex","currentTabbableIndex","previousTabbableIndex","focusIndexDiff","returnFirstNode","pickFocusable","returnLastNode","Math","abs"],"mappings":"qJAGU,IAACA,EAAY,YAUZC,EAAW,SAAUC,EAAYC,EAAgBC,EAAYC,EAAeC,GACnF,IAAIC,EAAML,EAAWM,OACjBC,EAAaP,EAAW,GACxBQ,EAAYR,EAAWK,EAAM,GAC7BI,EAAYC,EAAQP,GAExB,KAAIA,GAAiBH,EAAWW,QAAQR,IAAkB,GAA1D,CAGA,IAAIS,OAAgCC,IAAlBV,EAA8BD,EAAWS,QAAQR,
|
|
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';\n/**\n * Main solver for the \"find next focus\" question\n * @param innerNodes - used to control \"return focus\"\n * @param innerTabbables - used to control \"autofocus\"\n * @param outerNodes\n * @param activeElement\n * @param lastNode\n * @returns {number|string|undefined|*}\n */\nexport var newFocus = function (innerNodes, innerTabbables, 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 // focus is inside\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 // no active focus (or focus is on the body)\n if (activeIndex === -1) {\n // known fallback\n if (lastNodeInside !== -1) {\n return lastNodeInside;\n }\n return NEW_FOCUS;\n }\n // new focus, nothing to calculate\n if (lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var currentFocusableIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var previousFocusableIndex = lastNode ? correctedNodes.indexOf(lastNode) : currentFocusableIndex;\n var tabbableNodes = correctedNodes.filter(function (node) { return node.tabIndex >= 0; });\n var currentTabbableIndex = activeElement !== undefined ? tabbableNodes.indexOf(activeElement) : -1;\n var previousTabbableIndex = lastNode ? tabbableNodes.indexOf(lastNode) : currentTabbableIndex;\n var focusIndexDiff = currentTabbableIndex >= 0 && previousTabbableIndex >= 0\n ? // old/new are tabbables, measure distance in tabbable space\n previousTabbableIndex - currentTabbableIndex\n : // or else measure in focusable space\n previousFocusableIndex - currentFocusableIndex;\n // old focus\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\n // no tabbable elements, autofocus is not possible\n if (innerTabbables.length === 0) {\n // an edge case with no tabbable elements\n // return the last focusable one\n // with some probability this will prevent focus from cycling across the lock, but there is no tabbale elements to cycle to\n return lastNodeInside;\n }\n var returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);\n var returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);\n // first element\n if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnLastNode;\n }\n // last element\n if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnFirstNode;\n }\n // jump out, but not on the guard\n if (indexDiff && Math.abs(focusIndexDiff) > 1) {\n return lastNodeInside;\n }\n // focus above lock\n if (activeIndex <= firstNodeIndex) {\n return returnLastNode;\n }\n // focus below lock\n if (activeIndex > lastNodeIndex) {\n return returnFirstNode;\n }\n // index is inside tab order, but outside Lock\n if (indexDiff) {\n if (Math.abs(indexDiff) > 1) {\n return lastNodeInside;\n }\n return (cnt + lastNodeInside + indexDiff) % cnt;\n }\n // do nothing\n return undefined;\n};\n"],"names":["NEW_FOCUS","newFocus","innerNodes","innerTabbables","outerNodes","activeElement","lastNode","cnt","length","firstFocus","lastFocus","isOnGuard","isGuard","indexOf","activeIndex","undefined","lastIndex","lastNodeInside","indexDiff","firstNodeIndex","lastNodeIndex","correctedNodes","correctNodes","currentFocusableIndex","previousFocusableIndex","tabbableNodes","filter","node","tabIndex","currentTabbableIndex","previousTabbableIndex","focusIndexDiff","returnFirstNode","pickFocusable","returnLastNode","Math","abs"],"mappings":"qJAGU,IAACA,EAAY,YAUZC,EAAW,SAAUC,EAAYC,EAAgBC,EAAYC,EAAeC,GACnF,IAAIC,EAAML,EAAWM,OACjBC,EAAaP,EAAW,GACxBQ,EAAYR,EAAWK,EAAM,GAC7BI,EAAYC,EAAQP,GAExB,KAAIA,GAAiBH,EAAWW,QAAQR,IAAkB,GAA1D,CAGA,IAAIS,OAAgCC,IAAlBV,EAA8BD,EAAWS,QAAQR,IAAiB,EAChFW,EAAYV,EAAWF,EAAWS,QAAQP,GAAYQ,EACtDG,EAAiBX,EAAWJ,EAAWW,QAAQP,IAAY,EAE/D,IAAoB,IAAhBQ,EAEA,OAAuB,IAAnBG,EACOA,EAEJjB,EAGX,IAAuB,IAAnBiB,EACA,OAAOjB,EAEX,IAAIkB,EAAYJ,EAAcE,EAC1BG,EAAiBf,EAAWS,QAAQJ,GACpCW,EAAgBhB,EAAWS,QAAQH,GACnCW,EAAiBC,EAAalB,GAC9BmB,OAA0CR,IAAlBV,EAA8BgB,EAAeR,QAAQR,IAAiB,EAC9FmB,EAAyBlB,EAAWe,EAAeR,QAAQP,GAAYiB,EACvEE,EAAgBJ,EAAeK,OAAO,SAAUC,GAAQ,OAAOA,EAAKC,UAAY,IAChFC,OAAyCd,IAAlBV,EAA8BoB,EAAcZ,QAAQR,IAAiB,EAC5FyB,EAAwBxB,EAAWmB,EAAcZ,QAAQP,GAAYuB,EACrEE,EAAiBF,GAAwB,GAAKC,GAAyB,EAEnEA,EAAwBD,EAExBL,EAAyBD,EAEjC,IAAKL,GAAaD,GAAkB,EAChC,OAAOA,EAGX,GAA8B,IAA1Bd,EAAeK,OAIf,OAAOS,EAEX,IAAIe,EAAkBC,EAAc/B,EAAYC,EAAe,IAC3D+B,EAAiBD,EAAc/B,EAAYC,EAAeA,EAAeK,OAAS,IAEtF,OAAIM,GAAeK,GAAkBR,GAAawB,KAAKC,IAAIlB,GAAa,EAC7DgB,EAGPpB,GAAeM,GAAiBT,GAAawB,KAAKC,IAAIlB,GAAa,EAC5Dc,EAGPd,GAAaiB,KAAKC,IAAIL,GAAkB,EACjCd,EAGPH,GAAeK,EACRe,EAGPpB,EAAcM,EACPY,EAGPd,EACIiB,KAAKC,IAAIlB,GAAa,EACfD,GAEHV,EAAMU,EAAiBC,GAAaX,OAJhD,CAhEJ,CAwEA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{toArray as t}from"./array.js";import{isVisibleCached as r,notHiddenInput as n,isAutoFocusAllowedCached as o}from"./is.js";import{orderByTabIndex as e}from"./tabOrder.js";import{getFocusables as i,getParentAutofocusables as u}from"./tabUtils.js";var f=function(o,e){return t(o).filter(
|
|
1
|
+
import{toArray as t}from"./array.js";import{isVisibleCached as r,notHiddenInput as n,isAutoFocusAllowedCached as o}from"./is.js";import{orderByTabIndex as e}from"./tabOrder.js";import{getFocusables as i,getParentAutofocusables as u}from"./tabUtils.js";var f=function(o,e){return t(o).filter(function(t){return r(e,t)}).filter(function(t){return n(t)})},c=function(r,n){return void 0===n&&(n=new Map),t(r).filter(function(t){return o(n,t)})},a=function(t,r,n){return e(f(i(t,n),r),!0,n)},m=function(t,r){return e(f(i(t),r),!1)},s=function(t,r){return f(u(t),r)},l=function(r,n){return r.shadowRoot?l(r.shadowRoot,n):!(void 0===Object.getPrototypeOf(r).contains||!Object.getPrototypeOf(r).contains.call(r,n))||t(r.children).some(function(t){var r;if(t instanceof HTMLIFrameElement){var o=null===(r=t.contentDocument)||void 0===r?void 0:r.body;return!!o&&l(o,n)}return l(t,n)})};export{l as contains,c as filterAutoFocusable,f as filterFocusable,m as getFocusableNodes,a as getTabbableNodes,s as parentAutofocusables};
|
|
2
2
|
//# sourceMappingURL=DOMutils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DOMutils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js"],"sourcesContent":["import { toArray } from './array';\nimport { isAutoFocusAllowedCached, isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\n/**\n * given list of focusable elements keeps the ones user can interact with\n * @param nodes\n * @param visibilityCache\n */\nexport var filterFocusable = function (nodes, visibilityCache) {\n return toArray(nodes)\n .filter(function (node) { return isVisibleCached(visibilityCache, node); })\n .filter(function (node) { return notHiddenInput(node); });\n};\nexport var filterAutoFocusable = function (nodes, cache) {\n if (cache === void 0) { cache = new Map(); }\n return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); });\n};\n/**\n * !__WARNING__! Low level API.\n * @returns all tabbable nodes\n *\n * @see {@link getFocusableNodes} to get any focusable element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * !__WARNING__! Low level API.\n *\n * @returns anything \"focusable\", not only tabbable. The difference is in `tabIndex=-1`\n * (without guards, as long as they are not expected to be ever focused)\n *\n * @see {@link getTabbableNodes} to get only tabble nodes element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getFocusableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\n/**\n * return list of nodes which are expected to be auto-focused\n * @param topNode\n * @param visibilityCache\n */\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n/*\n * Determines if element is contained in scope, including nested shadow DOMs\n */\nexport var contains = function (scope, element) {\n if (scope.shadowRoot) {\n return contains(scope.shadowRoot, element);\n }\n else {\n if (Object.getPrototypeOf(scope).contains !== undefined &&\n Object.getPrototypeOf(scope).contains.call(scope, element)) {\n return true;\n }\n return toArray(scope.children).some(function (child) {\n var _a;\n if (child instanceof HTMLIFrameElement) {\n var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;\n if (iframeBody) {\n return contains(iframeBody, element);\n }\n return false;\n }\n return contains(child, element);\n });\n }\n};\n"],"names":["filterFocusable","nodes","visibilityCache","toArray","filter","node","isVisibleCached","notHiddenInput","filterAutoFocusable","cache","
|
|
1
|
+
{"version":3,"file":"DOMutils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js"],"sourcesContent":["import { toArray } from './array';\nimport { isAutoFocusAllowedCached, isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\n/**\n * given list of focusable elements keeps the ones user can interact with\n * @param nodes\n * @param visibilityCache\n */\nexport var filterFocusable = function (nodes, visibilityCache) {\n return toArray(nodes)\n .filter(function (node) { return isVisibleCached(visibilityCache, node); })\n .filter(function (node) { return notHiddenInput(node); });\n};\nexport var filterAutoFocusable = function (nodes, cache) {\n if (cache === void 0) { cache = new Map(); }\n return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); });\n};\n/**\n * !__WARNING__! Low level API.\n * @returns all tabbable nodes\n *\n * @see {@link getFocusableNodes} to get any focusable element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * !__WARNING__! Low level API.\n *\n * @returns anything \"focusable\", not only tabbable. The difference is in `tabIndex=-1`\n * (without guards, as long as they are not expected to be ever focused)\n *\n * @see {@link getTabbableNodes} to get only tabble nodes element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getFocusableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\n/**\n * return list of nodes which are expected to be auto-focused\n * @param topNode\n * @param visibilityCache\n */\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n/*\n * Determines if element is contained in scope, including nested shadow DOMs\n */\nexport var contains = function (scope, element) {\n if (scope.shadowRoot) {\n return contains(scope.shadowRoot, element);\n }\n else {\n if (Object.getPrototypeOf(scope).contains !== undefined &&\n Object.getPrototypeOf(scope).contains.call(scope, element)) {\n return true;\n }\n return toArray(scope.children).some(function (child) {\n var _a;\n if (child instanceof HTMLIFrameElement) {\n var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;\n if (iframeBody) {\n return contains(iframeBody, element);\n }\n return false;\n }\n return contains(child, element);\n });\n }\n};\n"],"names":["filterFocusable","nodes","visibilityCache","toArray","filter","node","isVisibleCached","notHiddenInput","filterAutoFocusable","cache","Map","isAutoFocusAllowedCached","getTabbableNodes","topNodes","withGuards","orderByTabIndex","getFocusables","getFocusableNodes","parentAutofocusables","topNode","getParentAutofocusables","contains","scope","element","shadowRoot","undefined","Object","getPrototypeOf","call","children","some","child","_a","HTMLIFrameElement","iframeBody","contentDocument","body"],"mappings":"4PASU,IAACA,EAAkB,SAAUC,EAAOC,GAC1C,OAAOC,EAAQF,GACVG,OAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,EAAM,GACvED,OAAO,SAAUC,GAAQ,OAAOE,EAAeF,IACxD,EACWG,EAAsB,SAAUP,EAAOQ,GAE9C,YADc,IAAVA,IAAoBA,EAAQ,IAAIC,KAC7BP,EAAQF,GAAOG,OAAO,SAAUC,GAAQ,OAAOM,EAAyBF,EAAOJ,EAAM,EAChG,EAUWO,EAAmB,SAAUC,EAAUX,EAAiBY,GAC/D,OAAOC,EAAgBf,EAAgBgB,EAAcH,EAAUC,GAAaZ,IAAkB,EAAMY,EACxG,EAYWG,EAAoB,SAAUJ,EAAUX,GAC/C,OAAOa,EAAgBf,EAAgBgB,EAAcH,GAAWX,IAAkB,EACtF,EAMWgB,EAAuB,SAAUC,EAASjB,GACjD,OAAOF,EAAgBoB,EAAwBD,GAAUjB,EAC7D,EAIWmB,EAAW,SAAUC,EAAOC,GACnC,OAAID,EAAME,WACCH,EAASC,EAAME,WAAYD,UAGYE,IAA1CC,OAAOC,eAAeL,GAAOD,WAC7BK,OAAOC,eAAeL,GAAOD,SAASO,KAAKN,EAAOC,KAG/CpB,EAAQmB,EAAMO,UAAUC,KAAK,SAAUC,GAC1C,IAAIC,EACJ,GAAID,aAAiBE,kBAAmB,CACpC,IAAIC,EAA8C,QAAhCF,EAAKD,EAAMI,uBAAoC,IAAPH,OAAgB,EAASA,EAAGI,KACtF,QAAIF,GACOb,EAASa,EAAYX,EAGhD,CACY,OAAOF,EAASU,EAAOR,EACnC,EAEA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FOCUS_GROUP as r,FOCUS_DISABLED as t}from"../constants.js";import{asArray as e,toArray as n}from"./array.js";var o=function(r){return r.parentNode?o(r.parentNode):r},a=function(a){return e(a).filter(Boolean).reduce(
|
|
1
|
+
import{FOCUS_GROUP as r,FOCUS_DISABLED as t}from"../constants.js";import{asArray as e,toArray as n}from"./array.js";var o=function(r){return r.parentNode?o(r.parentNode):r},a=function(a){return e(a).filter(Boolean).reduce(function(e,a){var c=a.getAttribute(r);return e.push.apply(e,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)})}(n(o(a).querySelectorAll("[".concat(r,'="').concat(c,'"]:not([').concat(t,'="disabled"])')))):[a]),e},[])};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';\n/**\n * in case of multiple nodes nested inside each other\n * keeps only top ones\n * this is O(nlogn)\n * @param nodes\n * @returns {*}\n */\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 /* eslint-disable no-bitwise */\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 /* eslint-enable */\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\n/**\n * finds top most parent for a node\n * @param node\n * @returns {*}\n */\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\n/**\n * returns all \"focus containers\" inside a given node\n * @param node - node or nodes to look inside\n * @returns Element[]\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":"oHASA,IAuBIA,EAAe,SAAUC,GACzB,OAAOA,EAAKC,WAAaF,EAAaC,EAAKC,YAAcD,CAC7D,EAMWE,EAAsB,SAAUF,GAEvC,OADYG,EAAQH,GACPI,OAAOC,SAASC,
|
|
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';\n/**\n * in case of multiple nodes nested inside each other\n * keeps only top ones\n * this is O(nlogn)\n * @param nodes\n * @returns {*}\n */\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 /* eslint-disable no-bitwise */\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 /* eslint-enable */\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\n/**\n * finds top most parent for a node\n * @param node\n * @returns {*}\n */\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\n/**\n * returns all \"focus containers\" inside a given node\n * @param node - node or nodes to look inside\n * @returns Element[]\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":"oHASA,IAuBIA,EAAe,SAAUC,GACzB,OAAOA,EAAKC,WAAaF,EAAaC,EAAKC,YAAcD,CAC7D,EAMWE,EAAsB,SAAUF,GAEvC,OADYG,EAAQH,GACPI,OAAOC,SAASC,OAAO,SAAUC,EAAKC,GAC/C,IAAIC,EAAQD,EAAYE,aAAaC,GAIrC,OAHAJ,EAAIK,KAAKC,MAAMN,EAAME,EAnCV,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,KAEjDC,EAAWE,KAAKC,gCAAkC,GACnDT,EAAUU,IAAIL,IAEbC,EAAWE,KAAKG,4BAA8B,GAC/CX,EAAUU,IAAIN,EAG9B,CAEI,OAAOL,EAAMV,OAAO,SAAUuB,EAAGC,GAAS,OAAQb,EAAUc,IAAID,EAAO,EAC3E,CAmBcE,CAAaC,EAAQhC,EAAaS,GAAawB,iBAAiB,IAAIC,OAAOtB,EAAa,MAAOsB,OAAOxB,EAAO,YAAawB,OAAOC,EAAgB,oBACjJ,CAAC1B,IACAD,CACf,EAAO,GACP","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{filterAutoFocusable as o}from"./DOMutils.js";import{pickFirstFocus as r}from"./firstFocus.js";import{getDataset as t}from"./is.js";var i=function(i,n,u){var f,s=i.map(
|
|
1
|
+
import{filterAutoFocusable as o}from"./DOMutils.js";import{pickFirstFocus as r}from"./firstFocus.js";import{getDataset as t}from"./is.js";var i=function(i,n,u){var f,s=i.map(function(o){return o.node}),e=o(s.filter((f=u,function(o){var r,i=null===(r=t(o))||void 0===r?void 0:r.autofocus;return o.autofocus||void 0!==i&&"false"!==i||f.indexOf(o)>=0})));return e&&e.length?r(e):r(o(n))};export{i as pickAutofocus};
|
|
2
2
|
//# sourceMappingURL=auto-focus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-focus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/auto-focus.js"],"sourcesContent":["import { filterAutoFocusable } from './DOMutils';\nimport { pickFirstFocus } from './firstFocus';\nimport { getDataset } from './is';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) {\n var _a;\n var autofocus = (_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus;\n return (\n // @ts-expect-error\n node.autofocus ||\n //\n (autofocus !== undefined && autofocus !== 'false') ||\n //\n autoFocusables.indexOf(node) >= 0);\n };\n};\nexport var pickAutofocus = function (nodesIndexes, orderedNodes, groups) {\n var nodes = nodesIndexes.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups)));\n if (autoFocusable && autoFocusable.length) {\n return pickFirstFocus(autoFocusable);\n }\n return pickFirstFocus(filterAutoFocusable(orderedNodes));\n};\n"],"names":["pickAutofocus","nodesIndexes","orderedNodes","groups","autoFocusables","nodes","map","_a","node","autoFocusable","filterAutoFocusable","filter","autofocus","getDataset","undefined","indexOf","length","pickFirstFocus"],"mappings":"0IAGA,IAaWA,EAAgB,SAAUC,EAAcC,EAAcC,GAC7D,IAd4BC,EAcxBC,EAAQJ,EAAaK,
|
|
1
|
+
{"version":3,"file":"auto-focus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/auto-focus.js"],"sourcesContent":["import { filterAutoFocusable } from './DOMutils';\nimport { pickFirstFocus } from './firstFocus';\nimport { getDataset } from './is';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) {\n var _a;\n var autofocus = (_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus;\n return (\n // @ts-expect-error\n node.autofocus ||\n //\n (autofocus !== undefined && autofocus !== 'false') ||\n //\n autoFocusables.indexOf(node) >= 0);\n };\n};\nexport var pickAutofocus = function (nodesIndexes, orderedNodes, groups) {\n var nodes = nodesIndexes.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups)));\n if (autoFocusable && autoFocusable.length) {\n return pickFirstFocus(autoFocusable);\n }\n return pickFirstFocus(filterAutoFocusable(orderedNodes));\n};\n"],"names":["pickAutofocus","nodesIndexes","orderedNodes","groups","autoFocusables","nodes","map","_a","node","autoFocusable","filterAutoFocusable","filter","autofocus","getDataset","undefined","indexOf","length","pickFirstFocus"],"mappings":"0IAGA,IAaWA,EAAgB,SAAUC,EAAcC,EAAcC,GAC7D,IAd4BC,EAcxBC,EAAQJ,EAAaK,IAAI,SAAUC,GAEnC,OADWA,EAAGC,IAEtB,GACQC,EAAgBC,EAAoBL,EAAMM,QAlBlBP,EAkByCD,EAjB9D,SAAUK,GACb,IAAID,EACAK,EAAwC,QAA3BL,EAAKM,EAAWL,UAA0B,IAAPD,OAAgB,EAASA,EAAGK,UAChF,OAEAJ,EAAKI,gBAEcE,IAAdF,GAAyC,UAAdA,GAE5BR,EAAeW,QAAQP,IAAS,CAC5C,KAQI,OAAIC,GAAiBA,EAAcO,OACxBC,EAAeR,GAEnBQ,EAAeP,EAAoBR,GAC9C","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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(
|
|
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":["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};\n/**\n * giving a set of radio inputs keeps only selected (tabbable) ones\n * @param nodes\n */\nexport var correctNodes = function (nodes) {\n // IE11 has no Set(array) constructor\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n // using filter to support IE11\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,
|
|
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};\n/**\n * giving a set of radio inputs keeps only selected (tabbable) ones\n * @param nodes\n */\nexport var correctNodes = function (nodes) {\n // IE11 has no Set(array) constructor\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n // using filter to support IE11\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,OAAO,SAAUC,GAAM,OAAOA,EAAGF,OAASH,EAAKG,IAAK,GACpDC,OAAO,SAAUC,GAAM,OAAOA,EAAGC,OAAQ,GAAI,IAAMN,CAC5D,CAGeO,CAAkBP,EAAMC,GAE5BD,CACX,EAKWQ,EAAe,SAAUP,GAEhC,IAAIQ,EAAY,IAAIC,IAGpB,OAFAT,EAAMU,QAAQ,SAAUX,GAAQ,OAAOS,EAAUG,IAAIb,EAAYC,EAAMC,GAAQ,GAExEA,EAAMG,OAAO,SAAUJ,GAAQ,OAAOS,EAAUI,IAAIb,IAC/D","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{safeProbe as t}from"./safe.js";var n=function(o){if(void 0===o&&(o=document),o&&o.activeElement){var e=o.activeElement;return e.shadowRoot?n(e.shadowRoot):e instanceof HTMLIFrameElement&&t(
|
|
1
|
+
import{safeProbe as t}from"./safe.js";var n=function(o){if(void 0===o&&(o=document),o&&o.activeElement){var e=o.activeElement;return e.shadowRoot?n(e.shadowRoot):e instanceof HTMLIFrameElement&&t(function(){return e.contentWindow.document})?n(e.contentWindow.document):e}};export{n as getActiveElement};
|
|
2
2
|
//# sourceMappingURL=getActiveElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getActiveElement.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["/**\n * returns active element from document or from nested shadowdoms\n */\nimport { safeProbe } from './safe';\n/**\n * returns current active element. If the active element is a \"container\" itself(shadowRoot or iframe) returns active element inside it\n * @param [inDocument]\n */\nexport var getActiveElement = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n if (!inDocument || !inDocument.activeElement) {\n return undefined;\n }\n var activeElement = inDocument.activeElement;\n return (activeElement.shadowRoot\n ? getActiveElement(activeElement.shadowRoot)\n : activeElement instanceof HTMLIFrameElement && safeProbe(function () { return activeElement.contentWindow.document; })\n ? getActiveElement(activeElement.contentWindow.document)\n : activeElement);\n};\n"],"names":["getActiveElement","inDocument","
|
|
1
|
+
{"version":3,"file":"getActiveElement.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["/**\n * returns active element from document or from nested shadowdoms\n */\nimport { safeProbe } from './safe';\n/**\n * returns current active element. If the active element is a \"container\" itself(shadowRoot or iframe) returns active element inside it\n * @param [inDocument]\n */\nexport var getActiveElement = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n if (!inDocument || !inDocument.activeElement) {\n return undefined;\n }\n var activeElement = inDocument.activeElement;\n return (activeElement.shadowRoot\n ? getActiveElement(activeElement.shadowRoot)\n : activeElement instanceof HTMLIFrameElement && safeProbe(function () { return activeElement.contentWindow.document; })\n ? getActiveElement(activeElement.contentWindow.document)\n : activeElement);\n};\n"],"names":["getActiveElement","inDocument","document","activeElement","shadowRoot","HTMLIFrameElement","safeProbe","contentWindow"],"mappings":"sCAQU,IAACA,EAAmB,SAAUC,GAEpC,QADmB,IAAfA,IAAyBA,EAAaC,UACrCD,GAAeA,EAAWE,cAA/B,CAGA,IAAIA,EAAgBF,EAAWE,cAC/B,OAAQA,EAAcC,WAChBJ,EAAiBG,EAAcC,YAC/BD,aAAyBE,mBAAqBC,EAAU,WAAc,OAAOH,EAAcI,cAAcL,QAAS,GAC9GF,EAAiBG,EAAcI,cAAcL,UAC7CC,CANd,CAOA","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\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 getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isInert = function (node) { return node.hasAttribute('inert'); };\n/**\n * @see https://github.com/testing-library/jest-dom/blob/main/src/to-be-visible.js\n */\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node)));\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};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\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};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\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":["getParentNode","node","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host","isTopNode","document","DOCUMENT_NODE","isVisibleUncached","checkParent","ELEMENT_NODE","computedStyle","window","getComputedStyle","getPropertyValue","isElementHidden","hasAttribute","isInert","isVisibleCached","visibilityCache","cached","get","undefined","result","bind","set","isAutoFocusAllowedCached","cache","isAutoFocusAllowed","isAutoFocusAllowedUncached","getDataset","dataset","isHTMLButtonElement","tagName","isHTMLInputElement","isRadioElement","type","notHiddenInput","disabled","attribute","getAttribute","FOCUS_NO_AUTOFOCUS","includes","isGuard","_a","Boolean","focusGuard","isNotAGuard","isDefined","x"],"mappings":"qDACA,IAYIA,EAAgB,SAAUC,GAE1B,OAAOA,EAAKC,YAAcD,EAAKC,WAAWC,WAAaC,KAAKC,uBAEpDJ,EAAKC,WAAWI,KAClBL,EAAKC,UACf,EACIK,EAAY,SAAUN,GAEtB,OAAOA,IAASO,UAAaP,GAAQA,EAAKE,WAAaC,KAAKK,aAChE,EAKIC,EAAoB,SAAUT,EAAMU,GACpC,OAAQV,GAAQM,EAAUN,KA5BR,SAAUA,GAG5B,GAAIA,EAAKE,WAAaC,KAAKQ,aACvB,OAAO,EAEX,IAAIC,EAAgBC,OAAOC,iBAAiBd,EAAM,MAClD,SAAKY,IAAkBA,EAAcG,kBAGiB,SAA9CH,EAAcG,iBAAiB,YAA0E,WAAjDH,EAAcG,iBAAiB,cACnG,CAiByCC,CAAgBhB,KAL3C,SAAUA,GAAQ,OAAOA,EAAKiB,aAAa,
|
|
1
|
+
{"version":3,"file":"is.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\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 getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isInert = function (node) { return node.hasAttribute('inert'); };\n/**\n * @see https://github.com/testing-library/jest-dom/blob/main/src/to-be-visible.js\n */\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node)));\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};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\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};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\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":["getParentNode","node","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host","isTopNode","document","DOCUMENT_NODE","isVisibleUncached","checkParent","ELEMENT_NODE","computedStyle","window","getComputedStyle","getPropertyValue","isElementHidden","hasAttribute","isInert","isVisibleCached","visibilityCache","cached","get","undefined","result","bind","set","isAutoFocusAllowedCached","cache","isAutoFocusAllowed","isAutoFocusAllowedUncached","getDataset","dataset","isHTMLButtonElement","tagName","isHTMLInputElement","isRadioElement","type","notHiddenInput","disabled","attribute","getAttribute","FOCUS_NO_AUTOFOCUS","includes","isGuard","_a","Boolean","focusGuard","isNotAGuard","isDefined","x"],"mappings":"qDACA,IAYIA,EAAgB,SAAUC,GAE1B,OAAOA,EAAKC,YAAcD,EAAKC,WAAWC,WAAaC,KAAKC,uBAEpDJ,EAAKC,WAAWI,KAClBL,EAAKC,UACf,EACIK,EAAY,SAAUN,GAEtB,OAAOA,IAASO,UAAaP,GAAQA,EAAKE,WAAaC,KAAKK,aAChE,EAKIC,EAAoB,SAAUT,EAAMU,GACpC,OAAQV,GAAQM,EAAUN,KA5BR,SAAUA,GAG5B,GAAIA,EAAKE,WAAaC,KAAKQ,aACvB,OAAO,EAEX,IAAIC,EAAgBC,OAAOC,iBAAiBd,EAAM,MAClD,SAAKY,IAAkBA,EAAcG,kBAGiB,SAA9CH,EAAcG,iBAAiB,YAA0E,WAAjDH,EAAcG,iBAAiB,cACnG,CAiByCC,CAAgBhB,KAL3C,SAAUA,GAAQ,OAAOA,EAAKiB,aAAa,QAAS,CAKCC,CAAQlB,IAASU,EAAYX,EAAcC,GAC9G,EACWmB,EAAkB,SAAUC,EAAiBpB,GACpD,IAAIqB,EAASD,EAAgBE,IAAItB,GACjC,QAAeuB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EAASf,EAAkBT,EAAMmB,EAAgBM,UAAKF,EAAWH,IAErE,OADAA,EAAgBM,IAAI1B,EAAMwB,GACnBA,CACX,EAIWG,EAA2B,SAAUC,EAAO5B,GACnD,IAAIqB,EAASO,EAAMN,IAAItB,GACvB,QAAeuB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EARyB,SAAUxB,EAAMU,GAC7C,QAAOV,IAASM,EAAUN,OAAS6B,EAAmB7B,IAAQU,EAAYX,EAAcC,GAC5F,CAMiB8B,CAA2B9B,EAAM2B,EAAyBF,UAAKF,EAAWK,IAEvF,OADAA,EAAMF,IAAI1B,EAAMwB,GACTA,CACX,EACWO,EAAa,SAAU/B,GAE9B,OAAOA,EAAKgC,OAChB,EACWC,EAAsB,SAAUjC,GAAQ,MAAwB,WAAjBA,EAAKkC,OAAqB,EACzEC,EAAqB,SAAUnC,GAAQ,MAAwB,UAAjBA,EAAKkC,OAAoB,EACvEE,EAAiB,SAAUpC,GAClC,OAAOmC,EAAmBnC,IAAuB,UAAdA,EAAKqC,IAC5C,EACWC,EAAiB,SAAUtC,GAClC,SAAUmC,EAAmBnC,IAASiC,EAAoBjC,MAAyB,WAAdA,EAAKqC,MAAqBrC,EAAKuC,UACxG,EACWV,EAAqB,SAAU7B,GACtC,IAAIwC,EAAYxC,EAAKyC,aAAaC,GAClC,OAAQ,EAAC,EAAM,OAAQ,IAAIC,SAASH,EACxC,EACWI,EAAU,SAAU5C,GAAQ,IAAI6C,EAAI,OAAOC,QAAQ9C,IAAqC,QAA3B6C,EAAKd,EAAW/B,UAA0B,IAAP6C,OAAgB,EAASA,EAAGE,YAAa,EACzIC,EAAc,SAAUhD,GAAQ,OAAQ4C,EAAQ5C,EAAM,EACtDiD,EAAY,SAAUC,GAAK,OAAOJ,QAAQI,EAAG","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{contains as r,parentAutofocusables as n}from"./DOMutils.js";import{asArray as o}from"./array.js";var t=function(r,n){return void 0===n&&(n=[]),n.push(r),r.parentNode&&t(r.parentNode.host||r.parentNode,n),n},e=function(r,n){for(var o=t(r),e=t(n),f=0;f<o.length;f+=1){var u=o[f];if(e.indexOf(u)>=0)return u}return!1},f=function(n,t,f){var u=o(n),a=o(t),i=u[0],c=!1;return a.filter(Boolean).forEach(
|
|
1
|
+
import{contains as r,parentAutofocusables as n}from"./DOMutils.js";import{asArray as o}from"./array.js";var t=function(r,n){return void 0===n&&(n=[]),n.push(r),r.parentNode&&t(r.parentNode.host||r.parentNode,n),n},e=function(r,n){for(var o=t(r),e=t(n),f=0;f<o.length;f+=1){var u=o[f];if(e.indexOf(u)>=0)return u}return!1},f=function(n,t,f){var u=o(n),a=o(t),i=u[0],c=!1;return a.filter(Boolean).forEach(function(n){c=e(c||n,n)||c,f.filter(Boolean).forEach(function(n){var o=e(i,n);o&&(c=!c||r(o,c)?o:e(o,c))})}),c},u=function(r,o){return r.reduce(function(r,t){return r.concat(n(t,o))},[])};export{u as allParentAutofocusables,e as getCommonParent,f 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 { parentAutofocusables } from './DOMutils';\nimport { contains } 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.host || node.parentNode, parents);\n }\n return parents;\n};\n/**\n * finds a parent for both nodeA and nodeB\n * @param nodeA\n * @param nodeB\n * @returns {boolean|*}\n */\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n // tslint:disable-next-line:prefer-for-of\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 || contains(common, topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n // TODO: add assert here?\n return topCommon;\n};\n/**\n * return list of nodes which are expected to be autofocused inside a given top nodes\n * @param entries\n * @param visibilityCache\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","
|
|
1
|
+
{"version":3,"file":"parenting.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js"],"sourcesContent":["import { parentAutofocusables } from './DOMutils';\nimport { contains } 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.host || node.parentNode, parents);\n }\n return parents;\n};\n/**\n * finds a parent for both nodeA and nodeB\n * @param nodeA\n * @param nodeB\n * @returns {boolean|*}\n */\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n // tslint:disable-next-line:prefer-for-of\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 || contains(common, topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n // TODO: add assert here?\n return topCommon;\n};\n/**\n * return list of nodes which are expected to be autofocused inside a given top nodes\n * @param entries\n * @param visibilityCache\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","host","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":"wGAGA,IAAIA,EAAa,SAAUC,EAAMC,GAM7B,YALgB,IAAZA,IAAsBA,EAAU,IACpCA,EAAQC,KAAKF,GACTA,EAAKG,YACLJ,EAAWC,EAAKG,WAAWC,MAAQJ,EAAKG,WAAYF,GAEjDA,CACX,EAOWI,EAAkB,SAAUC,EAAOC,GAI1C,IAHA,IAAIC,EAAWT,EAAWO,GACtBG,EAAWV,EAAWQ,GAEjBG,EAAI,EAAGA,EAAIF,EAASG,OAAQD,GAAK,EAAG,CACzC,IAAIE,EAAgBJ,EAASE,GAC7B,GAAID,EAASI,QAAQD,IAAkB,EACnC,OAAOA,CAEnB,CACI,OAAO,CACX,EACWE,EAAqB,SAAUC,EAAmBC,EAAWC,GACpE,IAAIC,EAAiBC,EAAQJ,GACzBK,EAAcD,EAAQH,GACtBK,EAAgBH,EAAe,GAC/BI,GAAY,EAgBhB,OAfAF,EAAYG,OAAOC,SAASC,QAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,QAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaO,EAASD,EAAQN,GACnBM,EAGAvB,EAAgBuB,EAAQN,GAGxD,EACA,GAEWA,CACX,EAMWQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,OAAO,SAAUC,EAAKlC,GAAQ,OAAOkC,EAAIC,OAAOC,EAAqBpC,EAAMgC,GAAkB,EAAI,GACpH","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{toArray as t}from"./array.js";var n=function(t,n){var r=Math.max(0,t.tabIndex),e=Math.max(0,n.tabIndex),a=r-e,i=t.index-n.index;if(a){if(!r)return 1;if(!e)return-1}return a||i},r=function(r,e,a){return t(r).map(
|
|
1
|
+
import{toArray as t}from"./array.js";var n=function(t,n){var r=Math.max(0,t.tabIndex),e=Math.max(0,n.tabIndex),a=r-e,i=t.index-n.index;if(a){if(!r)return 1;if(!e)return-1}return a||i},r=function(r,e,a){return t(r).map(function(t,n){var r=function(t){return t.tabIndex<0&&!t.hasAttribute("tabindex")?0:t.tabIndex}(t);return{node:t,index:n,tabIndex:a&&-1===r?(t.dataset||{}).focusGuard?0:-1:r}}).filter(function(t){return!e||t.tabIndex>=0}).sort(n)};export{r as orderByTabIndex,n as tabSort};
|
|
2
2
|
//# sourceMappingURL=tabOrder.js.map
|
|
@@ -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 aTab = Math.max(0, a.tabIndex);\n var bTab = Math.max(0, b.tabIndex);\n var tabDiff = aTab - bTab;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!aTab) {\n return 1;\n }\n if (!bTab) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nvar getTabIndex = function (node) {\n if (node.tabIndex < 0) {\n // all \"focusable\" elements are already preselected\n // but some might have implicit negative tabIndex\n // return 0 for <audio without tabIndex attribute - it is \"tabbable\"\n if (!node.hasAttribute('tabindex')) {\n return 0;\n }\n }\n return node.tabIndex;\n};\nexport var orderByTabIndex = function (nodes, filterNegative, keepGuards) {\n return toArray(nodes)\n .map(function (node, index) {\n var tabIndex = getTabIndex(node);\n return {\n node: node,\n index: index,\n tabIndex: keepGuards && tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : tabIndex,\n };\n })\n .filter(function (data) { return !filterNegative || data.tabIndex >= 0; })\n .sort(tabSort);\n};\n"],"names":["tabSort","a","b","aTab","Math","max","tabIndex","bTab","tabDiff","indexDiff","index","orderByTabIndex","nodes","filterNegative","keepGuards","toArray","map","node","hasAttribute","getTabIndex","dataset","focusGuard","filter","data","sort"],"mappings":"qCACU,IAACA,EAAU,SAAUC,EAAGC,GAC9B,IAAIC,EAAOC,KAAKC,IAAI,EAAGJ,EAAEK,UACrBC,EAAOH,KAAKC,IAAI,EAAGH,EAAEI,UACrBE,EAAUL,EAAOI,EACjBE,EAAYR,EAAES,MAAQR,EAAEQ,MAC5B,GAAIF,EAAS,CACT,IAAKL,EACD,OAAO,EAEX,IAAKI,EACD,
|
|
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 aTab = Math.max(0, a.tabIndex);\n var bTab = Math.max(0, b.tabIndex);\n var tabDiff = aTab - bTab;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!aTab) {\n return 1;\n }\n if (!bTab) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nvar getTabIndex = function (node) {\n if (node.tabIndex < 0) {\n // all \"focusable\" elements are already preselected\n // but some might have implicit negative tabIndex\n // return 0 for <audio without tabIndex attribute - it is \"tabbable\"\n if (!node.hasAttribute('tabindex')) {\n return 0;\n }\n }\n return node.tabIndex;\n};\nexport var orderByTabIndex = function (nodes, filterNegative, keepGuards) {\n return toArray(nodes)\n .map(function (node, index) {\n var tabIndex = getTabIndex(node);\n return {\n node: node,\n index: index,\n tabIndex: keepGuards && tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : tabIndex,\n };\n })\n .filter(function (data) { return !filterNegative || data.tabIndex >= 0; })\n .sort(tabSort);\n};\n"],"names":["tabSort","a","b","aTab","Math","max","tabIndex","bTab","tabDiff","indexDiff","index","orderByTabIndex","nodes","filterNegative","keepGuards","toArray","map","node","hasAttribute","getTabIndex","dataset","focusGuard","filter","data","sort"],"mappings":"qCACU,IAACA,EAAU,SAAUC,EAAGC,GAC9B,IAAIC,EAAOC,KAAKC,IAAI,EAAGJ,EAAEK,UACrBC,EAAOH,KAAKC,IAAI,EAAGH,EAAEI,UACrBE,EAAUL,EAAOI,EACjBE,EAAYR,EAAES,MAAQR,EAAEQ,MAC5B,GAAIF,EAAS,CACT,IAAKL,EACD,OAAO,EAEX,IAAKI,EACD,OAAO,CAEnB,CACI,OAAOC,GAAWC,CACtB,EAYWE,EAAkB,SAAUC,EAAOC,EAAgBC,GAC1D,OAAOC,EAAQH,GACVI,IAAI,SAAUC,EAAMP,GACrB,IAAIJ,EAdM,SAAUW,GACxB,OAAIA,EAAKX,SAAW,IAIXW,EAAKC,aAAa,YACZ,EAGRD,EAAKX,QAChB,CAIuBa,CAAYF,GAC3B,MAAO,CACHA,KAAMA,EACNP,MAAOA,EACPJ,SAAUQ,IAA2B,IAAbR,GAAoBW,EAAKG,SAAW,IAAIC,WAAa,GAAI,EAAMf,EAEnG,GACSgB,OAAO,SAAUC,GAAQ,OAAQV,GAAkBU,EAAKjB,UAAY,CAAE,GACtEkB,KAAKxB,EACd","x_google_ignoreList":[0]}
|