@cruk/cruk-react-components 5.0.7 → 6.0.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.
Files changed (359) hide show
  1. package/README.md +20 -7
  2. package/lib/.storybook/main.d.ts +3 -0
  3. package/lib/.storybook/preview.d.ts +3 -0
  4. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  5. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
  6. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +1 -1
  7. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
  8. package/lib/node_modules/@fortawesome/free-solid-svg-icons/index.js +6 -1
  9. package/lib/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +1 -1
  10. package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
  11. package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
  12. package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js +1 -1
  13. package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
  14. package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
  15. package/lib/node_modules/focus-lock/dist/es2015/sibling.js +1 -1
  16. package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
  17. package/lib/node_modules/focus-lock/dist/es2015/solver.js +1 -1
  18. package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
  19. package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
  20. package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js +1 -1
  21. package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
  22. package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
  23. package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
  24. package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
  25. package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
  26. package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
  27. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js +1 -1
  28. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
  29. package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js.map +1 -1
  30. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
  31. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  32. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
  33. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  34. package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
  35. package/lib/node_modules/tslib/tslib.es6.js +1 -1
  36. package/lib/node_modules/tslib/tslib.es6.js.map +1 -1
  37. package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  38. package/lib/{components → src/components}/AddressLookup/AddressLookup.stories.d.ts +4 -4
  39. package/lib/{components → src/components}/AddressLookup/index.d.ts +2 -2
  40. package/lib/src/components/AddressLookup/index.js +1 -1
  41. package/lib/src/components/AddressLookup/index.js.map +1 -1
  42. package/lib/src/components/AddressLookup/styles.js +38 -1
  43. package/lib/src/components/AddressLookup/styles.js.map +1 -1
  44. package/lib/{components → src/components}/Avatar/Avatar.stories.d.ts +1 -1
  45. package/lib/src/components/Avatar/index.js +1 -1
  46. package/lib/src/components/Avatar/index.js.map +1 -1
  47. package/lib/src/components/Avatar/styles.js +10 -1
  48. package/lib/src/components/Avatar/styles.js.map +1 -1
  49. package/lib/{components → src/components}/Badge/Badge.stories.d.ts +1 -1
  50. package/lib/src/components/Badge/index.js +1 -1
  51. package/lib/src/components/Badge/index.js.map +1 -1
  52. package/lib/src/components/Badge/styles.js +17 -1
  53. package/lib/src/components/Badge/styles.js.map +1 -1
  54. package/lib/{components → src/components}/Box/Box.stories.d.ts +2 -2
  55. package/lib/{components → src/components}/Box/index.d.ts +1 -1
  56. package/lib/src/components/Box/index.js +1 -1
  57. package/lib/src/components/Box/index.js.map +1 -1
  58. package/lib/src/components/Box/styles.js +13 -1
  59. package/lib/src/components/Box/styles.js.map +1 -1
  60. package/lib/{components → src/components}/Button/Button.stories.d.ts +2 -2
  61. package/lib/{components → src/components}/Button/index.d.ts +1 -1
  62. package/lib/src/components/Button/index.js +1 -1
  63. package/lib/src/components/Button/index.js.map +1 -1
  64. package/lib/src/components/Button/styles.js +108 -1
  65. package/lib/src/components/Button/styles.js.map +1 -1
  66. package/lib/{components → src/components}/Carousel/Carousel.stories.d.ts +2 -2
  67. package/lib/src/components/Carousel/Dots.js +1 -1
  68. package/lib/src/components/Carousel/Dots.js.map +1 -1
  69. package/lib/src/components/Carousel/index.js +1 -1
  70. package/lib/src/components/Carousel/index.js.map +1 -1
  71. package/lib/src/components/Carousel/styles.js +96 -1
  72. package/lib/src/components/Carousel/styles.js.map +1 -1
  73. package/lib/{components → src/components}/Checkbox/Checkbox.stories.d.ts +3 -3
  74. package/lib/{components → src/components}/Checkbox/index.d.ts +3 -3
  75. package/lib/src/components/Checkbox/index.js +1 -1
  76. package/lib/src/components/Checkbox/index.js.map +1 -1
  77. package/lib/src/components/Checkbox/styles.js +105 -1
  78. package/lib/src/components/Checkbox/styles.js.map +1 -1
  79. package/lib/{components → src/components}/Collapse/Collapse.stories.d.ts +1 -1
  80. package/lib/src/components/Collapse/index.js +1 -1
  81. package/lib/src/components/Collapse/index.js.map +1 -1
  82. package/lib/{components → src/components}/Collapse/styles.d.ts +11 -3
  83. package/lib/src/components/Collapse/styles.js +31 -1
  84. package/lib/src/components/Collapse/styles.js.map +1 -1
  85. package/lib/{components → src/components}/DateField/DateField.stories.d.ts +1 -1
  86. package/lib/src/components/DateField/index.js +1 -1
  87. package/lib/src/components/DateField/index.js.map +1 -1
  88. package/lib/{components → src/components}/DateField/styles.d.ts +12 -6
  89. package/lib/src/components/DateField/styles.js +26 -1
  90. package/lib/src/components/DateField/styles.js.map +1 -1
  91. package/lib/src/components/Divider.js +17 -1
  92. package/lib/src/components/Divider.js.map +1 -1
  93. package/lib/{components → src/components}/ErrorText/ErrorText.stories.d.ts +1 -1
  94. package/lib/src/components/ErrorText/index.js +1 -1
  95. package/lib/src/components/ErrorText/index.js.map +1 -1
  96. package/lib/src/components/ErrorText/styles.d.ts +16 -0
  97. package/lib/src/components/ErrorText/styles.js +5 -1
  98. package/lib/src/components/ErrorText/styles.js.map +1 -1
  99. package/lib/src/components/Flex.js +7 -1
  100. package/lib/src/components/Flex.js.map +1 -1
  101. package/lib/src/components/Fontface.js +1 -1
  102. package/lib/src/components/Fontface.js.map +1 -1
  103. package/lib/{components → src/components}/Footer/Footer.stories.d.ts +2 -2
  104. package/lib/src/components/Footer/index.js +1 -1
  105. package/lib/src/components/Footer/index.js.map +1 -1
  106. package/lib/{components → src/components}/Footer/styles.d.ts +3 -9
  107. package/lib/src/components/Footer/styles.js +69 -1
  108. package/lib/src/components/Footer/styles.js.map +1 -1
  109. package/lib/src/components/GlobalStyle.d.ts +2 -0
  110. package/lib/src/components/GlobalStyle.js +37 -1
  111. package/lib/src/components/GlobalStyle.js.map +1 -1
  112. package/lib/src/components/GlobalStyleNoFontFace.d.ts +2 -0
  113. package/lib/src/components/GlobalStyleNoFontFace.js +37 -1
  114. package/lib/src/components/GlobalStyleNoFontFace.js.map +1 -1
  115. package/lib/{components → src/components}/Header/Header.stories.d.ts +1 -1
  116. package/lib/src/components/Header/index.js +1 -1
  117. package/lib/src/components/Header/index.js.map +1 -1
  118. package/lib/src/components/Header/styles.js +109 -1
  119. package/lib/src/components/Header/styles.js.map +1 -1
  120. package/lib/{components → src/components}/Heading/Heading.stories.d.ts +1 -1
  121. package/lib/src/components/Heading/index.js +1 -1
  122. package/lib/src/components/Heading/index.js.map +1 -1
  123. package/lib/src/components/Heading/styles.js +75 -1
  124. package/lib/src/components/Heading/styles.js.map +1 -1
  125. package/lib/{components → src/components}/IconFa/IconFa.stories.d.ts +1 -1
  126. package/lib/src/components/IconFa/index.js +1 -1
  127. package/lib/src/components/IconFa/index.js.map +1 -1
  128. package/lib/src/components/IconFa/styles.js +10 -1
  129. package/lib/src/components/IconFa/styles.js.map +1 -1
  130. package/lib/{components → src/components}/InfoBox/InfoBox.stories.d.ts +2 -2
  131. package/lib/{components → src/components}/InfoBox/index.d.ts +1 -1
  132. package/lib/src/components/InfoBox/index.js +1 -1
  133. package/lib/src/components/InfoBox/index.js.map +1 -1
  134. package/lib/src/components/InfoBox/styles.d.ts +13 -0
  135. package/lib/src/components/InfoBox/styles.js +12 -1
  136. package/lib/src/components/InfoBox/styles.js.map +1 -1
  137. package/lib/src/components/LabelWrapper/index.js +1 -1
  138. package/lib/src/components/LabelWrapper/index.js.map +1 -1
  139. package/lib/src/components/LabelWrapper/styles.js +15 -1
  140. package/lib/src/components/LabelWrapper/styles.js.map +1 -1
  141. package/lib/{components → src/components}/LegendWrapper/LegendWrapper.stories.d.ts +1 -1
  142. package/lib/src/components/LegendWrapper/index.js +1 -1
  143. package/lib/src/components/LegendWrapper/index.js.map +1 -1
  144. package/lib/src/components/LegendWrapper/styles.js +34 -1
  145. package/lib/src/components/LegendWrapper/styles.js.map +1 -1
  146. package/lib/{components → src/components}/Link/Link.stories.d.ts +5 -2
  147. package/lib/{components → src/components}/Link/index.d.ts +4 -1
  148. package/lib/src/components/Link/index.js +1 -1
  149. package/lib/src/components/Link/index.js.map +1 -1
  150. package/lib/src/components/Link/styles.d.ts +20 -0
  151. package/lib/src/components/Link/styles.js +29 -1
  152. package/lib/src/components/Link/styles.js.map +1 -1
  153. package/lib/{components → src/components}/Loader/Loader.stories.d.ts +1 -1
  154. package/lib/src/components/Loader/index.js +1 -1
  155. package/lib/src/components/Loader/index.js.map +1 -1
  156. package/lib/src/components/Loader/styles.js +45 -1
  157. package/lib/src/components/Loader/styles.js.map +1 -1
  158. package/lib/{components → src/components}/Modal/Modal.stories.d.ts +1 -1
  159. package/lib/src/components/Modal/index.js +1 -1
  160. package/lib/src/components/Modal/index.js.map +1 -1
  161. package/lib/src/components/Modal/styles.d.ts +32 -0
  162. package/lib/src/components/Modal/styles.js +59 -1
  163. package/lib/src/components/Modal/styles.js.map +1 -1
  164. package/lib/{components → src/components}/Pagination/Pagination.stories.d.ts +1 -1
  165. package/lib/src/components/Pagination/index.js +1 -1
  166. package/lib/src/components/Pagination/index.js.map +1 -1
  167. package/lib/src/components/Pagination/styles.js +92 -1
  168. package/lib/src/components/Pagination/styles.js.map +1 -1
  169. package/lib/{components → src/components}/PopOver/Popover.stories.d.ts +1 -1
  170. package/lib/src/components/PopOver/index.js +1 -1
  171. package/lib/src/components/PopOver/index.js.map +1 -1
  172. package/lib/src/components/PopOver/styles.js +81 -1
  173. package/lib/src/components/PopOver/styles.js.map +1 -1
  174. package/lib/{components → src/components}/ProgressBar/ProgressBar.stories.d.ts +1 -1
  175. package/lib/src/components/ProgressBar/index.js +1 -1
  176. package/lib/src/components/ProgressBar/index.js.map +1 -1
  177. package/lib/src/components/ProgressBar/styles.js +132 -1
  178. package/lib/src/components/ProgressBar/styles.js.map +1 -1
  179. package/lib/{components → src/components}/Radio/Radio.stories.d.ts +3 -3
  180. package/lib/{components → src/components}/Radio/index.d.ts +3 -3
  181. package/lib/src/components/Radio/index.js +1 -1
  182. package/lib/src/components/Radio/index.js.map +1 -1
  183. package/lib/src/components/Radio/styles.js +125 -1
  184. package/lib/src/components/Radio/styles.js.map +1 -1
  185. package/lib/{components → src/components}/RadioConsent/Radio.stories.d.ts +1 -1
  186. package/lib/src/components/RadioConsent/index.js +1 -1
  187. package/lib/src/components/RadioConsent/index.js.map +1 -1
  188. package/lib/{components → src/components}/RadioConsent/styles.d.ts +6 -3
  189. package/lib/src/components/RadioConsent/styles.js +26 -1
  190. package/lib/src/components/RadioConsent/styles.js.map +1 -1
  191. package/lib/{components → src/components}/Select/Selelct.stories.d.ts +3 -3
  192. package/lib/{components → src/components}/Select/index.d.ts +3 -3
  193. package/lib/src/components/Select/index.js +1 -1
  194. package/lib/src/components/Select/index.js.map +1 -1
  195. package/lib/src/components/Select/styles.js +41 -1
  196. package/lib/src/components/Select/styles.js.map +1 -1
  197. package/lib/src/components/Spacing/index.js +1 -1
  198. package/lib/src/components/Spacing/index.js.map +1 -1
  199. package/lib/{components → src/components}/Step/Step.stories.d.ts +1 -1
  200. package/lib/src/components/Step/index.js +1 -1
  201. package/lib/src/components/Step/index.js.map +1 -1
  202. package/lib/src/components/Step/styles.js +79 -1
  203. package/lib/src/components/Step/styles.js.map +1 -1
  204. package/lib/{components → src/components}/Text/Text.stories.d.ts +2 -2
  205. package/lib/{components → src/components}/Text/index.d.ts +1 -1
  206. package/lib/src/components/Text/index.js +1 -1
  207. package/lib/src/components/Text/index.js.map +1 -1
  208. package/lib/src/components/Text/styles.js +19 -1
  209. package/lib/src/components/Text/styles.js.map +1 -1
  210. package/lib/{components → src/components}/TextAreaField/TextAreaField.stories.d.ts +2 -2
  211. package/lib/{components → src/components}/TextAreaField/index.d.ts +1 -1
  212. package/lib/src/components/TextAreaField/index.js +1 -1
  213. package/lib/src/components/TextAreaField/index.js.map +1 -1
  214. package/lib/src/components/TextAreaField/styles.js +29 -1
  215. package/lib/src/components/TextAreaField/styles.js.map +1 -1
  216. package/lib/{components → src/components}/TextField/TextField.stories.d.ts +2 -2
  217. package/lib/{components → src/components}/TextField/index.d.ts +1 -1
  218. package/lib/src/components/TextField/index.js +1 -1
  219. package/lib/src/components/TextField/index.js.map +1 -1
  220. package/lib/{components → src/components}/TextField/styles.d.ts +2 -6
  221. package/lib/src/components/TextField/styles.js +110 -1
  222. package/lib/src/components/TextField/styles.js.map +1 -1
  223. package/lib/src/components/ThemeCheatSheet.d.ts +7 -0
  224. package/lib/{components → src/components}/Totaliser/Totaliser.stories.d.ts +1 -1
  225. package/lib/src/components/Totaliser/index.js +1 -1
  226. package/lib/src/components/Totaliser/index.js.map +1 -1
  227. package/lib/src/components/Totaliser/styles.js +59 -1
  228. package/lib/src/components/Totaliser/styles.js.map +1 -1
  229. package/lib/{components → src/components}/UserBlock/UserBlock.stories.d.ts +1 -1
  230. package/lib/src/components/UserBlock/index.js +1 -1
  231. package/lib/src/components/UserBlock/index.js.map +1 -1
  232. package/lib/src/components/UserBlock/styles.js +21 -1
  233. package/lib/src/components/UserBlock/styles.js.map +1 -1
  234. package/lib/{hooks → src/hooks}/useEffectBrowser.d.ts +1 -1
  235. package/lib/src/hooks/useEffectBrowser.js +1 -1
  236. package/lib/src/hooks/useEffectBrowser.js.map +1 -1
  237. package/lib/src/hooks/useKey.js +1 -1
  238. package/lib/src/hooks/useKey.js.map +1 -1
  239. package/lib/{hooks → src/hooks}/useLayoutEffectBrowser.d.ts +1 -1
  240. package/lib/src/hooks/useLayoutEffectBrowser.js +1 -1
  241. package/lib/src/hooks/useLayoutEffectBrowser.js.map +1 -1
  242. package/lib/{hooks → src/hooks}/useScrollPosition.d.ts +2 -2
  243. package/lib/src/hooks/useScrollPosition.js +1 -1
  244. package/lib/src/hooks/useScrollPosition.js.map +1 -1
  245. package/lib/src/themes/bowelbabe.js +1 -1
  246. package/lib/src/themes/bowelbabe.js.map +1 -1
  247. package/lib/src/themes/cruk.js +1 -1
  248. package/lib/src/themes/cruk.js.map +1 -1
  249. package/lib/src/themes/rfl.js +1 -1
  250. package/lib/src/themes/rfl.js.map +1 -1
  251. package/lib/src/themes/su2c.js +1 -1
  252. package/lib/src/themes/su2c.js.map +1 -1
  253. package/lib/{types.d.ts → src/types.d.ts} +1 -3
  254. package/lib/src/utils/Helper.js +1 -1
  255. package/lib/src/utils/Helper.js.map +1 -1
  256. package/lib/src/utils/debounce.d.ts +2 -0
  257. package/lib/src/utils/debounce.js +1 -1
  258. package/lib/src/utils/debounce.js.map +1 -1
  259. package/lib/src/utils/themeUtils.js +1 -1
  260. package/lib/src/utils/themeUtils.js.map +1 -1
  261. package/package.json +37 -44
  262. package/lib/components/ErrorText/styles.d.ts +0 -8
  263. package/lib/components/GlobalStyle.d.ts +0 -2
  264. package/lib/components/GlobalStyleNoFontFace.d.ts +0 -2
  265. package/lib/components/InfoBox/styles.d.ts +0 -10
  266. package/lib/components/Link/styles.d.ts +0 -12
  267. package/lib/components/Modal/styles.d.ts +0 -21
  268. package/lib/components/ThemeCheatSheet.d.ts +0 -7
  269. package/lib/utils/debounce.d.ts +0 -2
  270. /package/lib/{components → src/components}/AddressLookup/AddressLookUp.test.cypress.d.ts +0 -0
  271. /package/lib/{components → src/components}/AddressLookup/styles.d.ts +0 -0
  272. /package/lib/{components → src/components}/AllThemesWrapper.d.ts +0 -0
  273. /package/lib/{components → src/components}/Avatar/Avatar.test.cypress.d.ts +0 -0
  274. /package/lib/{components → src/components}/Avatar/index.d.ts +0 -0
  275. /package/lib/{components → src/components}/Avatar/styles.d.ts +0 -0
  276. /package/lib/{components → src/components}/Badge/Badge.test.cypress.d.ts +0 -0
  277. /package/lib/{components → src/components}/Badge/index.d.ts +0 -0
  278. /package/lib/{components → src/components}/Badge/styles.d.ts +0 -0
  279. /package/lib/{components → src/components}/Box/Box.test.cypress.d.ts +0 -0
  280. /package/lib/{components → src/components}/Box/styles.d.ts +0 -0
  281. /package/lib/{components → src/components}/Button/Button.test.cypress.d.ts +0 -0
  282. /package/lib/{components → src/components}/Button/styles.d.ts +0 -0
  283. /package/lib/{components → src/components}/Carousel/Carousel.test.cypress.d.ts +0 -0
  284. /package/lib/{components → src/components}/Carousel/Dots.d.ts +0 -0
  285. /package/lib/{components → src/components}/Carousel/index.d.ts +0 -0
  286. /package/lib/{components → src/components}/Carousel/styles.d.ts +0 -0
  287. /package/lib/{components → src/components}/Checkbox/CheckBox.test.cypress.d.ts +0 -0
  288. /package/lib/{components → src/components}/Checkbox/styles.d.ts +0 -0
  289. /package/lib/{components → src/components}/Collapse/Collapse.test.cypress.d.ts +0 -0
  290. /package/lib/{components → src/components}/Collapse/index.d.ts +0 -0
  291. /package/lib/{components → src/components}/DateField/DateField.test.cypress.d.ts +0 -0
  292. /package/lib/{components → src/components}/DateField/index.d.ts +0 -0
  293. /package/lib/{components → src/components}/Divider.d.ts +0 -0
  294. /package/lib/{components → src/components}/ErrorText/ErrorText.test.cypress.d.ts +0 -0
  295. /package/lib/{components → src/components}/ErrorText/index.d.ts +0 -0
  296. /package/lib/{components → src/components}/Flex.d.ts +0 -0
  297. /package/lib/{components → src/components}/Fontface.d.ts +0 -0
  298. /package/lib/{components → src/components}/Footer/Footer.test.cypress.d.ts +0 -0
  299. /package/lib/{components → src/components}/Footer/index.d.ts +0 -0
  300. /package/lib/{components → src/components}/Header/Header.test.cypress.d.ts +0 -0
  301. /package/lib/{components → src/components}/Header/index.d.ts +0 -0
  302. /package/lib/{components → src/components}/Header/styles.d.ts +0 -0
  303. /package/lib/{components → src/components}/Heading/Heading.test.cypress.d.ts +0 -0
  304. /package/lib/{components → src/components}/Heading/index.d.ts +0 -0
  305. /package/lib/{components → src/components}/Heading/styles.d.ts +0 -0
  306. /package/lib/{components → src/components}/IconFa/IconFa.test.cypress.d.ts +0 -0
  307. /package/lib/{components → src/components}/IconFa/index.d.ts +0 -0
  308. /package/lib/{components → src/components}/IconFa/styles.d.ts +0 -0
  309. /package/lib/{components → src/components}/InfoBox/InfoBox.test.cypress.d.ts +0 -0
  310. /package/lib/{components → src/components}/LabelWrapper/index.d.ts +0 -0
  311. /package/lib/{components → src/components}/LabelWrapper/styles.d.ts +0 -0
  312. /package/lib/{components → src/components}/LegendWrapper/LegendWrapper.test.cypress.d.ts +0 -0
  313. /package/lib/{components → src/components}/LegendWrapper/index.d.ts +0 -0
  314. /package/lib/{components → src/components}/LegendWrapper/styles.d.ts +0 -0
  315. /package/lib/{components → src/components}/Link/Link.test.cypress.d.ts +0 -0
  316. /package/lib/{components → src/components}/Loader/Loader.test.cypress.d.ts +0 -0
  317. /package/lib/{components → src/components}/Loader/index.d.ts +0 -0
  318. /package/lib/{components → src/components}/Loader/styles.d.ts +0 -0
  319. /package/lib/{components → src/components}/Modal/Modal.test.cypress.d.ts +0 -0
  320. /package/lib/{components → src/components}/Modal/index.d.ts +0 -0
  321. /package/lib/{components → src/components}/Pagination/Pagination.test.cypress.d.ts +0 -0
  322. /package/lib/{components → src/components}/Pagination/index.d.ts +0 -0
  323. /package/lib/{components → src/components}/Pagination/styles.d.ts +0 -0
  324. /package/lib/{components → src/components}/PopOver/PopOver.test.cypress.d.ts +0 -0
  325. /package/lib/{components → src/components}/PopOver/index.d.ts +0 -0
  326. /package/lib/{components → src/components}/PopOver/styles.d.ts +0 -0
  327. /package/lib/{components → src/components}/ProgressBar/ProgressBar.test.cypress.d.ts +0 -0
  328. /package/lib/{components → src/components}/ProgressBar/index.d.ts +0 -0
  329. /package/lib/{components → src/components}/ProgressBar/styles.d.ts +0 -0
  330. /package/lib/{components → src/components}/Radio/Radio.test.cypress.d.ts +0 -0
  331. /package/lib/{components → src/components}/Radio/styles.d.ts +0 -0
  332. /package/lib/{components → src/components}/RadioConsent/RadioConsent.test.cypress.d.ts +0 -0
  333. /package/lib/{components → src/components}/RadioConsent/index.d.ts +0 -0
  334. /package/lib/{components → src/components}/Select/Select.test.cypress.d.ts +0 -0
  335. /package/lib/{components → src/components}/Select/styles.d.ts +0 -0
  336. /package/lib/{components → src/components}/Spacing/index.d.ts +0 -0
  337. /package/lib/{components → src/components}/Step/Step.test.cypress.d.ts +0 -0
  338. /package/lib/{components → src/components}/Step/index.d.ts +0 -0
  339. /package/lib/{components → src/components}/Step/styles.d.ts +0 -0
  340. /package/lib/{components → src/components}/Text/Text.test.cypress.d.ts +0 -0
  341. /package/lib/{components → src/components}/Text/styles.d.ts +0 -0
  342. /package/lib/{components → src/components}/TextAreaField/TextAreaField.test.cypress.d.ts +0 -0
  343. /package/lib/{components → src/components}/TextAreaField/styles.d.ts +0 -0
  344. /package/lib/{components → src/components}/TextField/TextField.test.cypress.d.ts +0 -0
  345. /package/lib/{components → src/components}/Totaliser/Totaliser.test.cypress.d.ts +0 -0
  346. /package/lib/{components → src/components}/Totaliser/index.d.ts +0 -0
  347. /package/lib/{components → src/components}/Totaliser/styles.d.ts +0 -0
  348. /package/lib/{components → src/components}/UserBlock/UserBlock.test.cypress.d.ts +0 -0
  349. /package/lib/{components → src/components}/UserBlock/index.d.ts +0 -0
  350. /package/lib/{components → src/components}/UserBlock/styles.d.ts +0 -0
  351. /package/lib/{components → src/components}/index.d.ts +0 -0
  352. /package/lib/{hooks → src/hooks}/useKey.d.ts +0 -0
  353. /package/lib/{themes → src/themes}/bowelbabe.d.ts +0 -0
  354. /package/lib/{themes → src/themes}/cruk.d.ts +0 -0
  355. /package/lib/{themes → src/themes}/rfl.d.ts +0 -0
  356. /package/lib/{themes → src/themes}/su2c.d.ts +0 -0
  357. /package/lib/{utils → src/utils}/Helper.d.ts +0 -0
  358. /package/lib/{utils → src/utils}/__tests__/testHelpers.test.d.ts +0 -0
  359. /package/lib/{utils → src/utils}/themeUtils.d.ts +0 -0
@@ -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","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,MAAK,SAAUC,GAC/C,OAAOC,EAASD,EAAMR,IAdN,SAAUD,EAASC,GACvC,OAAOU,QAAQC,EAAQZ,EAAQa,iBAAiB,WAAWL,MAAK,SAAUC,GAAQ,OAFnE,SAAUK,EAAOb,GAAiB,OAAOa,IAAUb,CAAgB,CAEOc,CAAaN,EAAMR,EAAe,IAC/H,CAYgDe,CAAkBP,EAAMR,EACxE,GACA","x_google_ignoreList":[0]}
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","undefined","getActiveElement","getFirst","ownerDocument","dataset","focusGuard","getAllAffectedNodes","some","node","contains","Boolean","toArray","querySelectorAll","frame","focusInFrame","focusInsideIframe"],"mappings":"qOAIA,IAQWA,EAAc,SAAUC,EAASC,GAGxC,YADsBC,IAAlBD,IAA4BA,EAAgBE,EAAiBC,EAASJ,GAASK,mBAC9EJ,GAAkBA,EAAcK,SAAWL,EAAcK,QAAQC,aAG/DC,EAAoBR,GAASS,MAAK,SAAUC,GAC/C,OAAOC,EAASD,EAAMT,IAdN,SAAUD,EAASC,GACvC,OAAOW,QAAQC,EAAQb,EAAQc,iBAAiB,WAAWL,MAAK,SAAUC,GAAQ,OAFnE,SAAUK,EAAOd,GAAiB,OAAOc,IAAUd,CAAgB,CAEOe,CAAaN,EAAMT,EAAe,IAC/H,CAYgDgB,CAAkBP,EAAMT,EACxE,GACA","x_google_ignoreList":[0]}
@@ -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","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,MAAK,SAAUC,GAAQ,OAAOC,EAASD,EAAMP,KAC3H","x_google_ignoreList":[0]}
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","undefined","document","activeElement","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"sMAYU,IAACA,EAAgB,SAAUC,QACdC,IAAfD,IAAyBA,EAAaE,UAC1C,IAAIC,EAAgBC,EAAiBJ,GACrC,QAAKG,GAIEE,EAAQL,EAAWM,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,MAAK,SAAUC,GAAQ,OAAOC,EAASD,EAAMP,KAC3H","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{asArray as e,getFirst 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(e(l).length>0?document:i(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};
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":"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,YAAW,WACPT,GAAe,CAClB,GAAE,GAGPD,IACAW,EAAQL,EAAUM,KAAMP,EAAQQ,cAChCb,GACR,CACA","x_google_ignoreList":[0]}
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","undefined","focusable","focusSolver","console","error","setTimeout","focusOn","node","focusOptions"],"mappings":"uFAEA,IAAIA,EAAa,EACbC,GAAe,EAaRC,EAAkB,SAAUC,EAASC,EAAUC,QACtCC,IAAZD,IAAsBA,EAAU,CAAA,GACpC,IAAIE,EAAYC,EAAYL,EAASC,GAErC,IAAIH,GAGAM,EAAW,CAEX,GAAIP,EAAa,EAQb,OANAS,QAAQC,MAAM,qJAEdT,GAAe,OACfU,YAAW,WACPV,GAAe,CAClB,GAAE,GAGPD,IACAY,EAAQL,EAAUM,KAAMR,EAAQS,cAChCd,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","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,IAAO,EAEhD,IAAIE,EAAIF,EAAQ,IAAIC,QAAQD,GAAS,KACrC,OAAO,WAAc,OAAQE,aAA6B,EAASA,EAAEC,UAAY,IAAO,CAC5F,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,EACzB,CACL","x_google_ignoreList":[0]}
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","undefined","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","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,IAAO,EAEhD,IAAIE,EAAIF,EAAQ,IAAIC,QAAQD,GAAS,KACrC,OAAO,WAAc,OAAQE,aAA6BC,EAASD,EAAEE,UAAY,IAAO,CAC5F,CACU,IAACC,EAAwB,SAAUC,GACzC,IAAKA,EACD,OAAO,KAIX,IAFA,IAAIC,EAAQ,GACRC,EAAiBF,EACdE,GAAkBA,IAAmBC,SAASC,MACjDH,EAAMI,KAAK,CACPC,QAASb,EAAQS,GACjBK,OAAQd,EAAQS,EAAeM,eAC/BC,KAAMhB,EAAQS,EAAeQ,wBAC7BC,MAAOlB,EAAQS,EAAeU,sBAElCV,EAAiBA,EAAeM,cAEpC,MAAO,CACHR,QAASP,EAAQO,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,cAA2BV,IAAPoB,OAAgBpB,EAASoB,EAAGY,KAAKF,GAE/E,GAAIC,GAAYf,EAAciB,SAASF,GAAW,CAe9C,IAdA,IAAInB,EAA4B,QAApBS,EAAKS,EAAKlB,YAAyBZ,IAAPqB,OAAgBrB,EAASqB,EAAGW,KAAKF,GACrEI,EAAeJ,EAAKrB,UACpBA,EAAUsB,EAASE,SAASC,GAAgBA,OAAelC,EAC3Dc,EAA8B,QAArBQ,EAAKQ,EAAKhB,aAA0Bd,IAAPsB,OAAgBtB,EAASsB,EAAGU,KAAKF,GACvEK,EAAaC,EAAiB,CAACL,GAAWN,GAC1CY,EAMO,QAJVb,EAEwE,QAFlED,EAAKd,QAAyCA,EAErDG,aAAmCZ,EAASY,EAAKG,0BAAuCf,IAAPuB,EAAgBA,EAEjGT,SAA0Bd,IAAPwB,EAAgBA,EAEnCZ,EACOyB,GAAK,CACR,IAAK,IAAIC,EAAK,EAAGC,EAAeJ,EAAYG,EAAKC,EAAaV,OAAQS,IAAM,CACxE,IAAIE,EAAYD,EAAaD,GAC7B,GAAID,aAAiCrC,EAASqC,EAAIJ,SAASO,EAAUC,MACjE,OAAOD,EAAUC,IAEzC,CACgBJ,EAAMA,EAAItB,kBAC1B,CACY,GAAIoB,EAAWN,OAEX,OAAOM,EAAW,GAAGM,IAErC,CACA,CAGA,CAWeC,CAAevB,EACzB,CACL","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{focusOn as n}from"./commands.js";import{contains as o,getTabbableNodes as e,getFocusableNodes 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(e){return!o(e,n)})))return console.error("Active element is not contained in the scope"),{};var a=c?e(s,new Map):t(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(o,i,c){var s,a,u,f,l=(a=o,u=null===(s=i.onlyTabbable)||void 0===s||s,{first:(f=u?e(r(a),new Map):t(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};
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","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,CAAE,EAEb,IAAIC,EAASC,EAAQL,GACrB,GAAII,EAAOE,OAAM,SAAUC,GAAS,OAAQC,EAASD,EAAOR,EAAS,IAEjE,OADAG,QAAQC,MAAM,gDACP,CAAE,EAEb,IAAIM,EAAaR,EACXS,EAAiBN,EAAQ,IAAIO,KAC7BC,EAAkBR,EAAQ,IAAIO,KAChCE,EAAUJ,EAAWK,WAAU,SAAUC,GAEzC,OADWA,EAAGC,OACEjB,CACxB,IACI,OAAiB,IAAbc,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,GAAS,SAAUT,EAAIgB,GAC1C,IAAIb,EAAOH,EAAGG,KAAMC,EAAQJ,EAAGI,MAC/B,OAAOD,GAASa,GAASZ,CACjC,GACA,EAMWoB,EAAmB,SAAUhB,EAAaC,QACjC,IAAZA,IAAsBA,EAAU,CAAA,GACpCF,EAAUC,EAAaC,GAAS,SAAUT,EAAIgB,GAC1C,IAAId,EAAOF,EAAGE,KAAMG,EAAOL,EAAGK,KAC9B,OAAOH,GAASc,GAASX,CACjC,GACA,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
+ {"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","undefined","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,CAAE,EAEb,IAAIC,EAASC,EAAQL,GACrB,GAAII,EAAOE,OAAM,SAAUC,GAAS,OAAQC,EAASD,EAAOR,EAAS,IAEjE,OADAG,QAAQC,MAAM,gDACP,CAAE,EAEb,IAAIM,EAAaR,EACXS,EAAiBN,EAAQ,IAAIO,KAC7BC,EAAkBR,EAAQ,IAAIO,KAChCE,EAAUJ,EAAWK,WAAU,SAAUC,GAEzC,OADWA,EAAGC,OACEjB,CACxB,IACI,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,QAC5BC,IAAZF,IAAsBA,EAAU,CAAA,GACpC,IAAIG,EATa,SAAUH,GAC3B,OAAOI,OAAOC,OAAO,CACjB7B,MAAO8B,SAASC,KAChBC,OAAO,EACPC,cAAc,GACfT,EACP,CAGqBU,CAAeV,GAC5BW,EAAWrC,EAAqByB,EAAaI,EAAW3B,MAAO2B,EAAWM,cAC9E,GAAKE,EAAL,CAGA,IAAIC,EAASX,EAAGU,EAAUR,EAAWK,OACjCI,GACAC,EAAQD,EAAOpB,KAAMW,EAAWW,aAHxC,CAKA,EAMWC,EAAmB,SAAUhB,EAAaC,QACjCE,IAAZF,IAAsBA,EAAU,CAAA,GACpCF,EAAUC,EAAaC,GAAS,SAAUT,EAAIiB,GAC1C,IAAId,EAAOH,EAAGG,KAAMC,EAAQJ,EAAGI,MAC/B,OAAOD,GAASc,GAASb,CACjC,GACA,EAMWqB,EAAmB,SAAUjB,EAAaC,QACjCE,IAAZF,IAAsBA,EAAU,CAAA,GACpCF,EAAUC,EAAaC,GAAS,SAAUT,EAAIiB,GAC1C,IAAIf,EAAOF,EAAGE,KAAMG,EAAOL,EAAGK,KAC9B,OAAOH,GAASe,GAASZ,CACjC,GACA,EACIqB,EAAe,SAAUzC,EAAOwB,EAASkB,GACzC,IAAI3B,EArDoBX,EAAQH,EAC5B0C,EAsDA3B,GAvDoBZ,EAsDGJ,EAtDKC,EAsDkC,QAA/Bc,EAAKS,EAAQS,oBAAiCP,IAAPX,GAAgBA,EAlDnF,CACHI,OAJAwB,EAAM1C,EACJS,EAAiBL,EAAQD,GAAS,IAAIO,KACtCC,EAAkBP,EAAQD,GAAS,IAAIO,MAE9B,GACXS,KAAMuB,EAAIA,EAAItB,OAAS,KAiDPqB,GAChB1B,GACAqB,EAAQrB,EAAKA,KAAMQ,EAAQc,aAEnC,EAKWM,EAAoB,SAAU5C,EAAOwB,QAC5BE,IAAZF,IAAsBA,EAAU,CAAA,GACpCiB,EAAazC,EAAOwB,EAAS,QACjC,EAKWqB,EAAmB,SAAU7C,EAAOwB,QAC3BE,IAAZF,IAAsBA,EAAU,CAAA,GACpCiB,EAAazC,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 e="NEW_FOCUS",f=function(f,n,o,s,a){var d=f.length,u=f[0],x=f[d-1],O=t(s);if(!(s&&f.indexOf(s)>=0)){var v=void 0!==s?o.indexOf(s):-1,h=a?o.indexOf(a):v,l=a?f.indexOf(a):-1;if(-1===v)return-1!==l?l:e;if(-1===l)return e;var m=v-h,c=o.indexOf(u),b=o.indexOf(x),p=i(o),M=(void 0!==s?p.indexOf(s):-1)-(a?p.indexOf(a):v);if(!m&&l>=0)return l;if(0===n.length)return l;var g=r(f,n[0]),j=r(f,n[n.length-1]);return v<=c&&O&&Math.abs(m)>1?j:v>=b&&O&&Math.abs(m)>1?g:m&&Math.abs(M)>1?l:v<=c?j:v>b?g:m?Math.abs(m)>1?l:(d+l+m)%d:void 0}};export{e as NEW_FOCUS,f as newFocus};
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 correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);\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(correctedIndexDiff) > 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","correctedIndexDiff","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,IAAkB,EACjFW,EAAYV,EAAWF,EAAWS,QAAQP,GAAYQ,EACtDG,EAAiBX,EAAWJ,EAAWW,QAAQP,IAAa,EAEhE,IAAqB,IAAjBQ,EAEA,OAAwB,IAApBG,EACOA,EAEJjB,EAGX,IAAwB,IAApBiB,EACA,OAAOjB,EAEX,IAAIkB,EAAYJ,EAAcE,EAC1BG,EAAiBf,EAAWS,QAAQJ,GACpCW,EAAgBhB,EAAWS,QAAQH,GACnCW,EAAiBC,EAAalB,GAE9BmB,QADmCR,IAAlBV,EAA8BgB,EAAeR,QAAQR,IAAkB,IACjDC,EAAWe,EAAeR,QAAQP,GAAYQ,GAEzF,IAAKI,GAAaD,GAAkB,EAChC,OAAOA,EAGX,GAA8B,IAA1Bd,EAAeK,OAIf,OAAOS,EAEX,IAAIO,EAAkBC,EAAcvB,EAAYC,EAAe,IAC3DuB,EAAiBD,EAAcvB,EAAYC,EAAeA,EAAeK,OAAS,IAEtF,OAAIM,GAAeK,GAAkBR,GAAagB,KAAKC,IAAIV,GAAa,EAC7DQ,EAGPZ,GAAeM,GAAiBT,GAAagB,KAAKC,IAAIV,GAAa,EAC5DM,EAGPN,GAAaS,KAAKC,IAAIL,GAAsB,EACrCN,EAGPH,GAAeK,EACRO,EAGPZ,EAAcM,EACPI,EAGPN,EACIS,KAAKC,IAAIV,GAAa,EACfD,GAEHV,EAAMU,EAAiBC,GAAaX,OAJhD,CAxDJ,CAgEA","x_google_ignoreList":[0]}
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,IAAmB,EAClFW,EAAYV,EAAWF,EAAWS,QAAQP,GAAYQ,EACtDG,EAAiBX,EAAWJ,EAAWW,QAAQP,IAAc,EAEjE,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,IAAmB,EAChGmB,EAAyBlB,EAAWe,EAAeR,QAAQP,GAAYiB,EACvEE,EAAgBJ,EAAeK,QAAO,SAAUC,GAAQ,OAAOA,EAAKC,UAAY,KAChFC,OAAyCd,IAAlBV,EAA8BoB,EAAcZ,QAAQR,IAAmB,EAC9FyB,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 +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","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,QAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,EAAQ,IACzED,QAAO,SAAUC,GAAQ,OAAOE,EAAeF,KACxD,EACWG,EAAsB,SAAUP,EAAOQ,GAE9C,YADc,IAAVA,IAAoBA,EAAQ,IAAIC,KAC7BP,EAAQF,GAAOG,QAAO,SAAUC,GAAQ,OAAOM,EAAyBF,EAAOJ,EAAM,GAChG,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,MAAK,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,GAEA","x_google_ignoreList":[0]}
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","undefined","Map","isAutoFocusAllowedCached","getTabbableNodes","topNodes","withGuards","orderByTabIndex","getFocusables","getFocusableNodes","parentAutofocusables","topNode","getParentAutofocusables","contains","scope","element","shadowRoot","Object","getPrototypeOf","call","children","some","child","_a","HTMLIFrameElement","iframeBody","contentDocument","body"],"mappings":"4PASU,IAACA,EAAkB,SAAUC,EAAOC,GAC1C,OAAOC,EAAQF,GACVG,QAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,EAAQ,IACzED,QAAO,SAAUC,GAAQ,OAAOE,EAAeF,KACxD,EACWG,EAAsB,SAAUP,EAAOQ,GAE9C,YADcC,IAAVD,IAAoBA,EAAQ,IAAIE,KAC7BR,EAAQF,GAAOG,QAAO,SAAUC,GAAQ,OAAOO,EAAyBH,EAAOJ,EAAM,GAChG,EAUWQ,EAAmB,SAAUC,EAAUZ,EAAiBa,GAC/D,OAAOC,EAAgBhB,EAAgBiB,EAAcH,EAAUC,GAAab,IAAkB,EAAMa,EACxG,EAYWG,EAAoB,SAAUJ,EAAUZ,GAC/C,OAAOc,EAAgBhB,EAAgBiB,EAAcH,GAAWZ,IAAkB,EACtF,EAMWiB,EAAuB,SAAUC,EAASlB,GACjD,OAAOF,EAAgBqB,EAAwBD,GAAUlB,EAC7D,EAIWoB,EAAW,SAAUC,EAAOC,GACnC,OAAID,EAAME,WACCH,EAASC,EAAME,WAAYD,UAGYd,IAA1CgB,OAAOC,eAAeJ,GAAOD,WAC7BI,OAAOC,eAAeJ,GAAOD,SAASM,KAAKL,EAAOC,KAG/CrB,EAAQoB,EAAMM,UAAUC,MAAK,SAAUC,GAC1C,IAAIC,EACJ,GAAID,aAAiBE,kBAAmB,CACpC,IAAIC,EAA8C,QAAhCF,EAAKD,EAAMI,uBAAoCzB,IAAPsB,OAAgBtB,EAASsB,EAAGI,KACtF,QAAIF,GACOZ,EAASY,EAAYV,EAGhD,CACY,OAAOF,EAASS,EAAOP,EACnC,GAEA","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{FOCUS_GROUP as r,FOCUS_DISABLED as t}from"../constants.js";import{toArray as e,asArray as n}from"./array.js";var o=function(r){return r.parentNode?o(r.parentNode):r},a=function(a){return n(a).filter(Boolean).reduce((function(n,a){var c=a.getAttribute(r);return n.push.apply(n,c?function(r){for(var t=new Set,e=r.length,n=0;n<e;n+=1)for(var o=n+1;o<e;o+=1){var a=r[n].compareDocumentPosition(r[o]);(a&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(a&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(n)}return r.filter((function(r,e){return!t.has(e)}))}(e(o(a).querySelectorAll("[".concat(r,'="').concat(c,'"]:not([').concat(t,'="disabled"])')))):[a]),n}),[])};export{a as getAllAffectedNodes};
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":"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,KAAI,SAAUC,GAEnC,OADWA,EAAGC,IAEtB,IACQC,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,CACvC,KAQD,OAAIC,GAAiBA,EAAcO,OACxBC,EAAeR,GAEnBQ,EAAeP,EAAoBR,GAC9C","x_google_ignoreList":[0]}
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,KAAI,SAAUC,GAEnC,OADWA,EAAGC,IAEtB,IACQC,EAAgBC,EAAoBL,EAAMM,QAlBlBP,EAkByCD,EAjB9D,SAAUK,GACb,IAAID,EACAK,EAAwC,QAA3BL,EAAKM,EAAWL,UAA0BM,IAAPP,OAAgBO,EAASP,EAAGK,UAChF,OAEAJ,EAAKI,gBAEcE,IAAdF,GAAyC,UAAdA,GAE5BR,EAAeW,QAAQP,IAAS,CACvC,KAQD,OAAIC,GAAiBA,EAAcO,OACxBC,EAAeR,GAEnBQ,EAAeP,EAAoBR,GAC9C","x_google_ignoreList":[0]}
@@ -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","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,GAAU,WAAc,OAAOH,EAAcI,cAAcL,QAAW,IAChHF,EAAiBG,EAAcI,cAAcL,UAC7CC,CANd,CAOA","x_google_ignoreList":[0]}
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","undefined","document","activeElement","shadowRoot","HTMLIFrameElement","safeProbe","contentWindow"],"mappings":"sCAQU,IAACA,EAAmB,SAAUC,GAEpC,QADmBC,IAAfD,IAAyBA,EAAaE,UACrCF,GAAeA,EAAWG,cAA/B,CAGA,IAAIA,EAAgBH,EAAWG,cAC/B,OAAQA,EAAcC,WAChBL,EAAiBI,EAAcC,YAC/BD,aAAyBE,mBAAqBC,GAAU,WAAc,OAAOH,EAAcI,cAAcL,QAAW,IAChHH,EAAiBI,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,QAAW,CAKDC,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
+ {"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,QAAW,CAKDC,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,UAA0BuB,IAAPsB,OAAgBtB,EAASsB,EAAGE,YAAa,EACzIC,EAAc,SAAUhD,GAAQ,OAAQ4C,EAAQ5C,EAAM,EACtDiD,EAAY,SAAUC,GAAK,OAAOJ,QAAQI,EAAG","x_google_ignoreList":[0]}
@@ -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","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,SAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,SAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaO,EAASD,EAAQN,GACnBM,EAGAvB,EAAgBuB,EAAQN,GAGxD,GACA,IAEWA,CACX,EAMWQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKlC,GAAQ,OAAOkC,EAAIC,OAAOC,EAAqBpC,EAAMgC,GAAkB,GAAI,GACpH","x_google_ignoreList":[0]}
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","undefined","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,YALgBC,IAAZD,IAAsBA,EAAU,IACpCA,EAAQE,KAAKH,GACTA,EAAKI,YACLL,EAAWC,EAAKI,WAAWC,MAAQL,EAAKI,WAAYH,GAEjDA,CACX,EAOWK,EAAkB,SAAUC,EAAOC,GAI1C,IAHA,IAAIC,EAAWV,EAAWQ,GACtBG,EAAWX,EAAWS,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,SAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,SAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaO,EAASD,EAAQN,GACnBM,EAGAvB,EAAgBuB,EAAQN,GAGxD,GACA,IAEWA,CACX,EAMWQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKnC,GAAQ,OAAOmC,EAAIC,OAAOC,EAAqBrC,EAAMiC,GAAkB,GAAI,GACpH","x_google_ignoreList":[0]}
@@ -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,OAAQ,CAEpB,CACI,OAAOC,GAAWC,CACtB,EAYWE,EAAkB,SAAUC,EAAOC,EAAgBC,GAC1D,OAAOC,EAAQH,GACVI,KAAI,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,IAA4B,IAAdR,GAAoBW,EAAKG,SAAW,CAAE,GAAEC,WAAa,GAAK,EAAKf,EAE9F,IACIgB,QAAO,SAAUC,GAAQ,OAAQV,GAAkBU,EAAKjB,UAAY,CAAI,IACxEkB,KAAKxB,EACd","x_google_ignoreList":[0]}
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,OAAS,CAErB,CACI,OAAOC,GAAWC,CACtB,EAYWE,EAAkB,SAAUC,EAAOC,EAAgBC,GAC1D,OAAOC,EAAQH,GACVI,KAAI,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,GAAM,EAAIf,EAE9F,IACIgB,QAAO,SAAUC,GAAQ,OAAQV,GAAkBU,EAAKjB,UAAY,CAAI,IACxEkB,KAAKxB,EACd","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"tabUtils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nvar getFocusablesWithShadowDom = function (parent, withGuards) {\n return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nvar getFocusablesWithIFrame = function (parent, withGuards) {\n var _a;\n // contentDocument of iframe will be null if current origin cannot access it\n if (parent instanceof HTMLIFrameElement && ((_a = parent.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n return getFocusables([parent.contentDocument.body], withGuards);\n }\n return [parent];\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n var _a;\n var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);\n var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) { return getFocusablesWithIFrame(node, withGuards); }));\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n focusableWithIframes, \n // add if node is tabbable itself\n parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\n/**\n * return a list of focusable nodes within an area marked as \"auto-focusable\"\n * @param parent\n */\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n"],"names":["queryTabbables","tabbables","join","queryGuardTabbables","concat","getFocusablesWithShadowDom","parent","withGuards","toArray","shadowRoot","children","reduce","acc","child","matches","getFocusables","parents","_a","focusableWithShadowDom","focusableWithIframes","apply","map","node","HTMLIFrameElement","contentDocument","body","getFocusablesWithIFrame","parentNode","querySelectorAll","filter","getParentAutofocusables","parentFocus","FOCUS_AUTO","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBAChDK,EAA6B,SAAUC,EAAQC,GAC/C,OAAOC,GAASF,EAAOG,YAAcH,GAAQI,UAAUC,QAAO,SAAUC,EAAKC,GACzE,OAAOD,EAAIR,OAAOS,EAAMC,QAAQP,EAAaJ,EAAsBH,GAAkB,CAACa,GAAS,GAAIR,EAA2BQ,GACjI,GAAE,GACP,EASWE,EAAgB,SAAUC,EAAST,GAC1C,OAAOS,EAAQL,QAAO,SAAUC,EAAKN,GACjC,IAAIW,EACAC,EAAyBb,EAA2BC,EAAQC,GAC5DY,GAAwBF,EAAK,IAAIb,OAAOgB,MAAMH,EAAIC,EAAuBG,KAAI,SAAUC,GAAQ,OAZ7E,SAAUhB,EAAQC,GAC5C,IAAIU,EAEJ,OAAIX,aAAkBiB,oBAAwD,QAAjCN,EAAKX,EAAOkB,uBAAoC,IAAPP,OAAgB,EAASA,EAAGQ,MACvGV,EAAc,CAACT,EAAOkB,gBAAgBC,MAAOlB,GAEjD,CAACD,EACZ,CAKkHoB,CAAwBJ,EAAMf,EAAY,KACpJ,OAAOK,EAAIR,OAEXe,EAEAb,EAAOqB,WACDnB,EAAQF,EAAOqB,WAAWC,iBAAiB5B,IAAiB6B,QAAO,SAAUP,GAAQ,OAAOA,IAAShB,CAAS,IAC9G,GACT,GAAE,GACP,EAKWwB,EAA0B,SAAUxB,GAC3C,IAAIyB,EAAczB,EAAOsB,iBAAiB,IAAIxB,OAAO4B,EAAY,MACjE,OAAOxB,EAAQuB,GACVV,KAAI,SAAUC,GAAQ,OAAOP,EAAc,CAACO,GAAS,IACrDX,QAAO,SAAUC,EAAKqB,GAAS,OAAOrB,EAAIR,OAAO6B,EAAS,GAAE,GACrE","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"tabUtils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nvar getFocusablesWithShadowDom = function (parent, withGuards) {\n return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nvar getFocusablesWithIFrame = function (parent, withGuards) {\n var _a;\n // contentDocument of iframe will be null if current origin cannot access it\n if (parent instanceof HTMLIFrameElement && ((_a = parent.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n return getFocusables([parent.contentDocument.body], withGuards);\n }\n return [parent];\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n var _a;\n var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);\n var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) { return getFocusablesWithIFrame(node, withGuards); }));\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n focusableWithIframes, \n // add if node is tabbable itself\n parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\n/**\n * return a list of focusable nodes within an area marked as \"auto-focusable\"\n * @param parent\n */\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n"],"names":["queryTabbables","tabbables","join","queryGuardTabbables","concat","getFocusablesWithShadowDom","parent","withGuards","toArray","shadowRoot","children","reduce","acc","child","matches","getFocusables","parents","_a","focusableWithShadowDom","focusableWithIframes","apply","map","node","HTMLIFrameElement","contentDocument","undefined","body","getFocusablesWithIFrame","parentNode","querySelectorAll","filter","getParentAutofocusables","parentFocus","FOCUS_AUTO","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBAChDK,EAA6B,SAAUC,EAAQC,GAC/C,OAAOC,GAASF,EAAOG,YAAcH,GAAQI,UAAUC,QAAO,SAAUC,EAAKC,GACzE,OAAOD,EAAIR,OAAOS,EAAMC,QAAQP,EAAaJ,EAAsBH,GAAkB,CAACa,GAAS,GAAIR,EAA2BQ,GACjI,GAAE,GACP,EASWE,EAAgB,SAAUC,EAAST,GAC1C,OAAOS,EAAQL,QAAO,SAAUC,EAAKN,GACjC,IAAIW,EACAC,EAAyBb,EAA2BC,EAAQC,GAC5DY,GAAwBF,EAAK,IAAIb,OAAOgB,MAAMH,EAAIC,EAAuBG,KAAI,SAAUC,GAAQ,OAZ7E,SAAUhB,EAAQC,GAC5C,IAAIU,EAEJ,OAAIX,aAAkBiB,oBAAwD,QAAjCN,EAAKX,EAAOkB,uBAAoCC,IAAPR,OAAgBQ,EAASR,EAAGS,MACvGX,EAAc,CAACT,EAAOkB,gBAAgBE,MAAOnB,GAEjD,CAACD,EACZ,CAKkHqB,CAAwBL,EAAMf,EAAY,KACpJ,OAAOK,EAAIR,OAEXe,EAEAb,EAAOsB,WACDpB,EAAQF,EAAOsB,WAAWC,iBAAiB7B,IAAiB8B,QAAO,SAAUR,GAAQ,OAAOA,IAAShB,CAAS,IAC9G,GACT,GAAE,GACP,EAKWyB,EAA0B,SAAUzB,GAC3C,IAAI0B,EAAc1B,EAAOuB,iBAAiB,IAAIzB,OAAO6B,EAAY,MACjE,OAAOzB,EAAQwB,GACVX,KAAI,SAAUC,GAAQ,OAAOP,EAAc,CAACO,GAAS,IACrDX,QAAO,SAAUC,EAAKsB,GAAS,OAAOtB,EAAIR,OAAO8B,EAAS,GAAE,GACrE","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import r from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import e from"../../../@babel/runtime/helpers/esm/extends.js";import*as o from"react";import s from"./Lock.js";import t from"./Trap.js";var p=o.forwardRef((function(r,p){return o.createElement(s,e({sideCar:t,ref:p},r))})),m=s.propTypes||{};m.sideCar;var a=r(m,["sideCar"]);p.propTypes="production"!==process.env.NODE_ENV?a:{};export{p as default};
1
+ import e from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import r from"../../../@babel/runtime/helpers/esm/extends.js";import o,{forwardRef as t}from"react";import s from"./Lock.js";import p from"./Trap.js";var m=t((function(e,t){return o.createElement(s,r({sideCar:p,ref:t},e))})),i=s.propTypes||{};i.sideCar;var a=e(i,["sideCar"]);m.propTypes="production"!==process.env.NODE_ENV?a:{};export{m as default};
2
2
  //# sourceMappingURL=Combination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combination.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Combination.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport FocusLockUI from './Lock';\nimport FocusTrap from './Trap';\nvar FocusLockCombination = /*#__PURE__*/React.forwardRef(function FocusLockUICombination(props, ref) {\n return /*#__PURE__*/React.createElement(FocusLockUI, _extends({\n sideCar: FocusTrap,\n ref: ref\n }, props));\n});\nvar _ref = FocusLockUI.propTypes || {},\n sideCar = _ref.sideCar,\n propTypes = _objectWithoutPropertiesLoose(_ref, [\"sideCar\"]);\nFocusLockCombination.propTypes = process.env.NODE_ENV !== \"production\" ? propTypes : {};\nexport default FocusLockCombination;"],"names":["FocusLockCombination","React","forwardRef","props","ref","createElement","FocusLockUI","_extends","sideCar","FocusTrap","_ref","propTypes","_objectWithoutPropertiesLoose","process","env","NODE_ENV"],"mappings":"2NAKG,IAACA,EAAoCC,EAAMC,YAAW,SAAgCC,EAAOC,GAC9F,OAAoBH,EAAMI,cAAcC,EAAaC,EAAS,CAC5DC,QAASC,EACTL,IAAKA,GACJD,GACL,IACIO,EAAOJ,EAAYK,WAAa,CAAE,EAC1BD,EAAKF,QACf,IAAAG,EAAYC,EAA8BF,EAAM,CAAC,YACnDV,EAAqBW,UAAqC,eAAzBE,QAAQC,IAAIC,SAA4BJ,EAAY,CAAE","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"Combination.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Combination.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React, { forwardRef } from 'react';\nimport FocusLockUI from './Lock';\nimport FocusTrap from './Trap';\nvar FocusLockCombination = /*#__PURE__*/forwardRef(function FocusLockUICombination(props, ref) {\n return /*#__PURE__*/React.createElement(FocusLockUI, _extends({\n sideCar: FocusTrap,\n ref: ref\n }, props));\n});\nvar _ref = FocusLockUI.propTypes || {},\n sideCar = _ref.sideCar,\n propTypes = _objectWithoutPropertiesLoose(_ref, [\"sideCar\"]);\nFocusLockCombination.propTypes = process.env.NODE_ENV !== \"production\" ? propTypes : {};\nexport default FocusLockCombination;"],"names":["FocusLockCombination","forwardRef","props","ref","React","createElement","FocusLockUI","_extends","sideCar","FocusTrap","_ref","propTypes","_objectWithoutPropertiesLoose","process","env","NODE_ENV"],"mappings":"yOAKG,IAACA,EAAoCC,GAAW,SAAgCC,EAAOC,GACxF,OAAoBC,EAAMC,cAAcC,EAAaC,EAAS,CAC5DC,QAASC,EACTN,IAAKA,GACJD,GACL,IACIQ,EAAOJ,EAAYK,WAAa,CAAE,EAC1BD,EAAKF,QACf,IAAAG,EAAYC,EAA8BF,EAAM,CAAC,YACnDV,EAAqBW,UAAqC,eAAzBE,QAAQC,IAAIC,SAA4BJ,EAAY,CAAE","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"FocusGuard.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/FocusGuard.js"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nexport var hiddenGuard = {\n width: '1px',\n height: '0px',\n padding: 0,\n overflow: 'hidden',\n position: 'fixed',\n top: '1px',\n left: '1px'\n};\nvar InFocusGuard = function InFocusGuard(_ref) {\n var _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n \"data-focus-auto-guard\": true,\n style: hiddenGuard\n }), children, children && /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-last\",\n \"data-focus-guard\": true,\n \"data-focus-auto-guard\": true,\n style: hiddenGuard\n }));\n};\nInFocusGuard.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node\n} : {};\nexport default InFocusGuard;"],"names":["hiddenGuard","width","height","padding","overflow","position","top","left","process","env","NODE_ENV","PropTypes","node"],"mappings":"wCAEU,IAACA,EAAc,CACvBC,MAAO,MACPC,OAAQ,MACRC,QAAS,EACTC,SAAU,SACVC,SAAU,QACVC,IAAK,MACLC,KAAM,OAiB0C,eAAzBC,QAAQC,IAAIC,UACzBC,EAAUC","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"FocusGuard.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/FocusGuard.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport PropTypes from 'prop-types';\nexport var hiddenGuard = {\n width: '1px',\n height: '0px',\n padding: 0,\n overflow: 'hidden',\n position: 'fixed',\n top: '1px',\n left: '1px'\n};\nvar InFocusGuard = function InFocusGuard(_ref) {\n var _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n \"data-focus-auto-guard\": true,\n style: hiddenGuard\n }), children, children && /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-last\",\n \"data-focus-guard\": true,\n \"data-focus-auto-guard\": true,\n style: hiddenGuard\n }));\n};\nInFocusGuard.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node\n} : {};\nexport default InFocusGuard;"],"names":["hiddenGuard","width","height","padding","overflow","position","top","left","process","env","NODE_ENV","PropTypes","node"],"mappings":"wCAEU,IAACA,EAAc,CACvBC,MAAO,MACPC,OAAQ,MACRC,QAAS,EACTC,SAAU,SACVC,SAAU,QACVC,IAAK,MACLC,KAAM,OAiB0C,eAAzBC,QAAQC,IAAIC,UACzBC,EAAUC","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import e from"../../../@babel/runtime/helpers/esm/extends.js";import*as t from"react";import{node as o,bool as r,oneOfType as s,object as n,func as c,string as a,arrayOf as u,any as i}from"prop-types";import{FOCUS_DISABLED as d,FOCUS_GROUP as l}from"../../../focus-lock/dist/es2015/constants.js";import{hiddenGuard as f}from"./FocusGuard.js";import{mediumFocus as m,mediumSidecar as v,mediumBlur as p}from"./medium.js";import{focusScope as b}from"./scope.js";import{useMergeRefs as F}from"../../../use-callback-ref/dist/es2015/useMergeRef.js";var y=[],h=t.forwardRef((function(o,r){var s,n=t.useState(),c=n[0],a=n[1],u=t.useRef(),i=t.useRef(!1),h=t.useRef(null),k=t.useState({})[1],E=o.children,g=o.disabled,w=void 0!==g&&g,x=o.noFocusGuards,C=void 0!==x&&x,R=o.persistentFocus,j=void 0!==R&&R,N=o.crossFrame,P=void 0===N||N,S=o.autoFocus,D=void 0===S||S,I=o.allowTextSelection,L=o.group,O=o.className,M=o.whiteList,T=o.hasPositiveIndices,A=o.shards,G=void 0===A?y:A,V=o.as,_=void 0===V?"div":V,q=o.lockProps,B=void 0===q?{}:q,z=o.sideCar,H=o.returnFocus,J=void 0!==H&&H,K=o.focusOptions,Q=o.onActivation,U=o.onDeactivation,W=t.useState({})[0],X=t.useCallback((function(e){var t=e.captureFocusRestore;if(!h.current){var o,r=null==(o=document)?void 0:o.activeElement;h.current=r,r!==document.body&&(h.current=t(r))}u.current&&Q&&Q(u.current),i.current=!0,k()}),[Q]),Y=t.useCallback((function(){i.current=!1,U&&U(u.current),k()}),[U]),Z=t.useCallback((function(e){var t=h.current;if(t){var o=("function"==typeof t?t():t)||document.body,r="function"==typeof J?J(o):J;if(r){var s="object"==typeof r?r:void 0;h.current=null,e?Promise.resolve().then((function(){return o.focus(s)})):o.focus(s)}}}),[J]),$=t.useCallback((function(e){i.current&&m.useMedium(e)}),[]),ee=p.useMedium,te=t.useCallback((function(e){u.current!==e&&(u.current=e,a(e))}),[]);"production"!==process.env.NODE_ENV&&(void 0!==I&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),t.useEffect((function(){u.current||"string"==typeof _||console.error("FocusLock: could not obtain ref to internal node")}),[]));var oe=e(((s={})[d]=w&&"disabled",s[l]=L,s),B),re=!0!==C,se=re&&"tail"!==C,ne=F([r,te]),ce=t.useMemo((function(){return{observed:u,shards:G,enabled:!w,active:i.current}}),[w,i.current,G,c]);return t.createElement(t.Fragment,null,re&&[t.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:w?-1:0,style:f}),T?t.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:w?-1:1,style:f}):null],!w&&t.createElement(z,{id:W,sideCar:v,observed:c,disabled:w,persistentFocus:j,crossFrame:P,autoFocus:D,whiteList:M,shards:G,onActivation:X,onDeactivation:Y,returnFocus:Z,focusOptions:K}),t.createElement(_,e({ref:ne},oe,{className:O,onBlur:ee,onFocus:$}),t.createElement(b.Provider,{value:ce},E)),se&&t.createElement("div",{"data-focus-guard":!0,tabIndex:w?-1:0,style:f}))}));h.propTypes="production"!==process.env.NODE_ENV?{children:o,disabled:r,returnFocus:s([r,n,c]),focusOptions:n,noFocusGuards:r,hasPositiveIndices:r,allowTextSelection:r,autoFocus:r,persistentFocus:r,crossFrame:r,group:a,className:a,whiteList:c,shards:u(i),as:s([a,c,n]),lockProps:n,onActivation:c,onDeactivation:c,sideCar:i.isRequired}:{};export{h as default};
1
+ import e from"../../../@babel/runtime/helpers/esm/extends.js";import o,{forwardRef as r,useState as t,useRef as s,useCallback as n,useEffect as c,useMemo as i,Fragment as u}from"react";import{any as a,func as d,object as l,oneOfType as f,arrayOf as v,string as m,bool as p,node as F}from"prop-types";import{FOCUS_DISABLED as b,FOCUS_GROUP as y}from"../../../focus-lock/dist/es2015/constants.js";import{hiddenGuard as h}from"./FocusGuard.js";import{mediumFocus as E,mediumSidecar as g,mediumBlur as k}from"./medium.js";import{focusScope as x}from"./scope.js";import{useMergeRefs as j}from"../../../use-callback-ref/dist/es2015/useMergeRef.js";var w=[],N=r((function(r,a){var d,l=t(),f=l[0],v=l[1],m=s(),p=s(!1),F=s(null),N=t({})[1],P=r.children,D=r.disabled,I=void 0!==D&&D,L=r.noFocusGuards,O=void 0!==L&&L,G=r.persistentFocus,R=void 0!==G&&G,T=r.crossFrame,A=void 0===T||T,C=r.autoFocus,M=void 0===C||C,S=r.allowTextSelection,V=r.group,_=r.className,q=r.whiteList,B=r.hasPositiveIndices,z=r.shards,H=void 0===z?w:z,J=r.as,K=void 0===J?"div":J,Q=r.lockProps,U=void 0===Q?{}:Q,W=r.sideCar,X=r.returnFocus,Y=void 0!==X&&X,Z=r.focusOptions,$=r.onActivation,ee=r.onDeactivation,oe=t({})[0],re=n((function(e){var o=e.captureFocusRestore;if(!F.current){var r,t=null==(r=document)?void 0:r.activeElement;F.current=t,t!==document.body&&(F.current=o(t))}m.current&&$&&$(m.current),p.current=!0,N()}),[$]),te=n((function(){p.current=!1,ee&&ee(m.current),N()}),[ee]),se=n((function(e){var o=F.current;if(o){var r=("function"==typeof o?o():o)||document.body,t="function"==typeof Y?Y(r):Y;if(t){var s="object"==typeof t?t:void 0;F.current=null,e?Promise.resolve().then((function(){return r.focus(s)})):r.focus(s)}}}),[Y]),ne=n((function(e){p.current&&E.useMedium(e)}),[]),ce=k.useMedium,ie=n((function(e){m.current!==e&&(m.current=e,v(e))}),[]);"production"!==process.env.NODE_ENV&&(void 0!==S&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),c((function(){m.current||"string"==typeof K||console.error("FocusLock: could not obtain ref to internal node")}),[]));var ue=e(((d={})[b]=I&&"disabled",d[y]=V,d),U),ae=!0!==O,de=ae&&"tail"!==O,le=j([a,ie]),fe=i((function(){return{observed:m,shards:H,enabled:!I,active:p.current}}),[I,p.current,H,f]);return o.createElement(u,null,ae&&[o.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:I?-1:0,style:h}),B?o.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:I?-1:1,style:h}):null],!I&&o.createElement(W,{id:oe,sideCar:g,observed:f,disabled:I,persistentFocus:R,crossFrame:A,autoFocus:M,whiteList:q,shards:H,onActivation:re,onDeactivation:te,returnFocus:se,focusOptions:Z,noFocusGuards:O}),o.createElement(K,e({ref:le},ue,{className:_,onBlur:ce,onFocus:ne}),o.createElement(x.Provider,{value:fe},P)),de&&o.createElement("div",{"data-focus-guard":!0,tabIndex:I?-1:0,style:h}))}));N.propTypes="production"!==process.env.NODE_ENV?{children:F,disabled:p,returnFocus:f([p,l,d]),focusOptions:l,noFocusGuards:p,hasPositiveIndices:p,allowTextSelection:p,autoFocus:p,persistentFocus:p,crossFrame:p,group:m,className:m,whiteList:d,shards:v(a),as:f([m,d,l]),lockProps:l,onActivation:d,onDeactivation:d,sideCar:a.isRequired}:{};export{N as default};
2
2
  //# sourceMappingURL=Lock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Lock.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { focusScope } from './scope';\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var _React$useState2 = React.useState({}),\n update = _React$useState2[1];\n var children = props.children,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$noFocusGuards = props.noFocusGuards,\n noFocusGuards = _props$noFocusGuards === void 0 ? false : _props$noFocusGuards,\n _props$persistentFocu = props.persistentFocus,\n persistentFocus = _props$persistentFocu === void 0 ? false : _props$persistentFocu,\n _props$crossFrame = props.crossFrame,\n crossFrame = _props$crossFrame === void 0 ? true : _props$crossFrame,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n hasPositiveIndices = props.hasPositiveIndices,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n _props$returnFocus = props.returnFocus,\n shouldReturnFocus = _props$returnFocus === void 0 ? false : _props$returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n var _React$useState3 = React.useState({}),\n id = _React$useState3[0];\n var onActivation = React.useCallback(function (_ref) {\n var captureFocusRestore = _ref.captureFocusRestore;\n if (!originalFocusedElement.current) {\n var _document;\n var activeElement = (_document = document) == null ? void 0 : _document.activeElement;\n originalFocusedElement.current = activeElement;\n if (activeElement !== document.body) {\n originalFocusedElement.current = captureFocusRestore(activeElement);\n }\n }\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n isActive.current = true;\n update();\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n update();\n }, [onDeactivationCallback]);\n var returnFocus = React.useCallback(function (allowDefer) {\n var focusRestore = originalFocusedElement.current;\n if (focusRestore) {\n var returnFocusTo = (typeof focusRestore === 'function' ? focusRestore() : focusRestore) || document.body;\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n if (howToReturnFocus) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n if (allowDefer) {\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]);\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium;\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n React.useEffect(function () {\n if (!observed.current && typeof Container !== 'string') {\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n var focusScopeValue = React.useMemo(function () {\n return {\n observed: observed,\n shards: shards,\n enabled: !disabled,\n active: isActive.current\n };\n }, [disabled, isActive.current, shards, realObserved]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [\n /*#__PURE__*/\n React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }), hasPositiveIndices ? /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) : null], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), /*#__PURE__*/React.createElement(focusScope.Provider, {\n value: focusScopeValue\n }, children)), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n hasPositiveIndices: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","update","children","_props$disabled","disabled","_props$noFocusGuards","noFocusGuards","_props$persistentFocu","persistentFocus","_props$crossFrame","crossFrame","_props$autoFocus","autoFocus","allowTextSelection","group","className","whiteList","hasPositiveIndices","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","_props$returnFocus","returnFocus","shouldReturnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","_ref","captureFocusRestore","current","_document","activeElement","document","body","allowDefer","focusRestore","returnFocusTo","howToReturnFocus","returnFocusOptions","undefined","Promise","resolve","then","focus","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","useEffect","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","focusScopeValue","useMemo","enabled","active","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","focusScope","Provider","value","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired"],"mappings":"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","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"Lock.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React, { forwardRef, useRef, useState, useCallback, useEffect, useMemo, Fragment } from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport { FOCUS_DISABLED, FOCUS_GROUP } from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { focusScope } from './scope';\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n var _useState = useState(),\n realObserved = _useState[0],\n setObserved = _useState[1];\n var observed = useRef();\n var isActive = useRef(false);\n var originalFocusedElement = useRef(null);\n var _useState2 = useState({}),\n update = _useState2[1];\n var children = props.children,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$noFocusGuards = props.noFocusGuards,\n noFocusGuards = _props$noFocusGuards === void 0 ? false : _props$noFocusGuards,\n _props$persistentFocu = props.persistentFocus,\n persistentFocus = _props$persistentFocu === void 0 ? false : _props$persistentFocu,\n _props$crossFrame = props.crossFrame,\n crossFrame = _props$crossFrame === void 0 ? true : _props$crossFrame,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n hasPositiveIndices = props.hasPositiveIndices,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n _props$returnFocus = props.returnFocus,\n shouldReturnFocus = _props$returnFocus === void 0 ? false : _props$returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n var _useState3 = useState({}),\n id = _useState3[0];\n var onActivation = useCallback(function (_ref) {\n var captureFocusRestore = _ref.captureFocusRestore;\n if (!originalFocusedElement.current) {\n var _document;\n var activeElement = (_document = document) == null ? void 0 : _document.activeElement;\n originalFocusedElement.current = activeElement;\n if (activeElement !== document.body) {\n originalFocusedElement.current = captureFocusRestore(activeElement);\n }\n }\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n isActive.current = true;\n update();\n }, [onActivationCallback]);\n var onDeactivation = useCallback(function () {\n isActive.current = false;\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n update();\n }, [onDeactivationCallback]);\n var returnFocus = useCallback(function (allowDefer) {\n var focusRestore = originalFocusedElement.current;\n if (focusRestore) {\n var returnFocusTo = (typeof focusRestore === 'function' ? focusRestore() : focusRestore) || document.body;\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n if (howToReturnFocus) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n if (allowDefer) {\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]);\n var onFocus = useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium;\n var setObserveNode = useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n useEffect(function () {\n if (!observed.current && typeof Container !== 'string') {\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n var lockProps = _extends((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && 'disabled', _extends2[FOCUS_GROUP] = group, _extends2), containerProps);\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n var focusScopeValue = useMemo(function () {\n return {\n observed: observed,\n shards: shards,\n enabled: !disabled,\n active: isActive.current\n };\n }, [disabled, isActive.current, shards, realObserved]);\n return /*#__PURE__*/React.createElement(Fragment, null, hasLeadingGuards && [\n /*#__PURE__*/\n React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }), hasPositiveIndices ? /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) : null], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions,\n noFocusGuards: noFocusGuards\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), /*#__PURE__*/React.createElement(focusScope.Provider, {\n value: focusScopeValue\n }, children)), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n hasPositiveIndices: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","forwardRef","props","parentRef","_extends2","_useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","update","children","_props$disabled","disabled","undefined","_props$noFocusGuards","noFocusGuards","_props$persistentFocu","persistentFocus","_props$crossFrame","crossFrame","_props$autoFocus","autoFocus","allowTextSelection","group","className","whiteList","hasPositiveIndices","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","_props$returnFocus","returnFocus","shouldReturnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","_ref","captureFocusRestore","current","_document","activeElement","document","body","allowDefer","focusRestore","returnFocusTo","howToReturnFocus","returnFocusOptions","Promise","resolve","then","focus","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","useEffect","error","_extends","FOCUS_DISABLED","FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","focusScopeValue","useMemo","enabled","active","React","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","focusScope","Provider","value","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired"],"mappings":"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","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import"react";import e from"prop-types";import t from"../../../react-clientside-effect/lib/index.es.js";import{focusInside as n}from"../../../focus-lock/dist/es2015/focusInside.js";import{focusIsHidden as o}from"../../../focus-lock/dist/es2015/focusIsHidden.js";import{expandFocusableNodes as r}from"../../../focus-lock/dist/es2015/focusables.js";import{moveFocusInside as u}from"../../../focus-lock/dist/es2015/moveFocusInside.js";import{captureFocusRestore as i}from"../../../focus-lock/dist/es2015/return-focus.js";import{focusNextElement as s,focusPrevElement as c,focusFirstElement as d,focusLastElement as a}from"../../../focus-lock/dist/es2015/sibling.js";import{deferAction as f,extractRef as m}from"./util.js";import{mediumFocus as l,mediumBlur as v,mediumEffect as p}from"./medium.js";var E=function(){return document&&document.activeElement===document.body||o()},b=null,g=null,j=null,h=!1,k=function(){return!0};function w(e,t,n,o){var r=null,u=e;do{var i=o[u];if(i.guard)i.node.dataset.focusAutoGuard&&(r=i);else{if(!i.lockItem)break;if(u!==e)return;r=null}}while((u+=n)!==t);r&&(r.node.tabIndex=0)}var F=function e(t,n,o){return n&&(n.host===t&&(!n.activeElement||o.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,o))},I=function(){var e,t=!1;if(b){var o=b,i=o.observed,s=o.persistentFocus,c=o.autoFocus,d=o.shards,a=o.crossFrame,f=o.focusOptions,l=i||j&&j.portaledElement,v=document&&document.activeElement;if(l){var p=[l].concat(d.map(m).filter(Boolean));if(v&&!function(e){return(b.whiteList||k)(e)}(v)||(s||(a?Boolean(h):"meanwhile"===h)||!E()||!g&&c)&&(l&&!(n(p)||v&&function(e,t){return t.some((function(t){return F(e,t,t)}))}(v,p)||(e=v,j&&j.portaledElement===e))&&(document&&!g&&v&&!c?(v.blur&&v.blur(),document.body.focus()):(t=u(p,g,{focusOptions:f}),j={})),h=!1,g=document&&document.activeElement),document&&v!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var I=document&&document.activeElement,L=r(p),x=L.map((function(e){return e.node})).indexOf(I);x>-1&&(L.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),w(x,L.length,1,L),w(x,-1,-1,L))}}}return t},L=function(e){I()&&e&&(e.stopPropagation(),e.preventDefault())},x=function(){return f(I)};"production"===process.env.NODE_ENV||e.node.isRequired;var N=function(){h="just",f((function(){h="meanwhile"}))};var y={moveFocusInside:u,focusInside:n,focusNextElement:s,focusPrevElement:c,focusFirstElement:d,focusLastElement:a,captureFocusRestore:i};l.assignSyncMedium((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(j={observerNode:n,portaledElement:t})})),v.assignMedium(x),p.assignMedium((function(e){return e(y)}));var A=t((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var t=e.slice(-1)[0];t&&!b&&(document.addEventListener("focusin",L),document.addEventListener("focusout",x),window.addEventListener("blur",N));var n=b,o=n&&t&&t.id===n.id;b=t,n&&!o&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(g=null,o&&n.observed===t.observed||t.onActivation(y),I(),f(I)):(document.removeEventListener("focusin",L),document.removeEventListener("focusout",x),window.removeEventListener("blur",N),g=null)}))((function(){return null}));export{A as default};
1
+ import"react";import e from"prop-types";import n from"../../../react-clientside-effect/lib/index.es.js";import{focusInside as t}from"../../../focus-lock/dist/es2015/focusInside.js";import{focusIsHidden as o}from"../../../focus-lock/dist/es2015/focusIsHidden.js";import{expandFocusableNodes as r}from"../../../focus-lock/dist/es2015/focusables.js";import{moveFocusInside as u}from"../../../focus-lock/dist/es2015/moveFocusInside.js";import{captureFocusRestore as i}from"../../../focus-lock/dist/es2015/return-focus.js";import{focusLastElement as c,focusFirstElement as s,focusPrevElement as d,focusNextElement as f}from"../../../focus-lock/dist/es2015/sibling.js";import{getFocusableNodes as a}from"../../../focus-lock/dist/es2015/utils/DOMutils.js";import{deferAction as m,extractRef as l}from"./util.js";import{mediumFocus as v,mediumBlur as p,mediumEffect as E}from"./medium.js";var b=function(){return document&&document.activeElement===document.body},g=null,w=null,j=function(){return null},h=null,L=!1,k=!1,F=function(){return!0};function I(e,n,t,o){var r=null,u=e;do{var i=o[u];if(i.guard)i.node.dataset.focusAutoGuard&&(r=i);else{if(!i.lockItem)break;if(u!==e)return;r=null}}while((u+=t)!==n);r&&(r.node.tabIndex=0)}var y=function e(n,t,o){return t&&(t.host===n&&(!t.activeElement||o.contains(t.activeElement))||t.parentNode&&e(n,t.parentNode,o))},x=function(e){return a(e,new Map)},N=function(){var e,n,c=!1;if(g){var s=g,d=s.observed,f=s.persistentFocus,a=s.autoFocus,m=s.shards,v=s.crossFrame,p=s.focusOptions,E=s.noFocusGuards,N=d||h&&h.portaledElement;if(b()&&w&&w!==document.body&&(!document.body.contains(w)||!x([(n=w).parentNode]).some((function(e){return e.node===n})))){var M=j();M&&M.focus()}var O=document&&document.activeElement;if(N){var A=[N].concat(m.map(l).filter(Boolean));if(O&&!function(e){return(g.whiteList||F)(e)}(O)||(f||function(){if(!(v?Boolean(L):"meanwhile"===L)||!E||!w||k)return!1;var e=x(A),n=e.findIndex((function(e){return e.node===w}));return 0===n||n===e.length-1}()||!b()&&!o()||!w&&a)&&(N&&!(t(A)||O&&function(e,n){return n.some((function(n){return y(e,n,n)}))}(O,A)||(e=O,h&&h.portaledElement===e))&&(document&&!w&&O&&!a?(O.blur&&O.blur(),document.body.focus()):(c=u(A,w,{focusOptions:p}),h={})),(w=document&&document.activeElement)!==document.body&&(j=i(w)),L=!1),document&&O!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var D=document&&document.activeElement,G=r(A),q=G.map((function(e){return e.node})).indexOf(D);q>-1&&(G.filter((function(e){var n=e.guard,t=e.node;return n&&t.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),I(q,G.length,1,G),I(q,-1,-1,G))}}}return c},M=function(e){N()&&e&&(e.stopPropagation(),e.preventDefault())},O=function(){return m(N)};"production"===process.env.NODE_ENV||e.node.isRequired;var A=function(){k=!0},D=function(){k=!1,L="just",m((function(){L="meanwhile"}))};var G={moveFocusInside:u,focusInside:t,focusNextElement:f,focusPrevElement:d,focusFirstElement:s,focusLastElement:c,captureFocusRestore:i};v.assignSyncMedium((function(e){var n=e.target,t=e.currentTarget;t.contains(n)||(h={observerNode:t,portaledElement:n})})),p.assignMedium(O),E.assignMedium((function(e){return e(G)}));var q=n((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var n=e.slice(-1)[0];n&&!g&&(document.addEventListener("focusin",M),document.addEventListener("focusout",O),window.addEventListener("focus",A),window.addEventListener("blur",D));var t=g,o=t&&n&&n.id===t.id;g=n,t&&!o&&(t.onDeactivation(),e.filter((function(e){return e.id===t.id})).length||t.returnFocus(!n)),n?(w=null,o&&t.observed===n.observed||n.onActivation(G),N(),m(N)):(document.removeEventListener("focusin",M),document.removeEventListener("focusout",O),window.removeEventListener("focus",A),window.removeEventListener("blur",D),w=null)}))((function(){return null}));export{q as default};
2
2
  //# sourceMappingURL=Trap.js.map