@cruk/cruk-react-components 1.0.11 → 1.1.2

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 (188) hide show
  1. package/lib/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +1 -1
  2. package/lib/cjs/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
  3. package/lib/cjs/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -1
  4. package/lib/cjs/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -1
  5. package/lib/cjs/node_modules/@fortawesome/free-solid-svg-icons/index.es.js +8 -0
  6. package/lib/cjs/node_modules/@fortawesome/free-solid-svg-icons/index.es.js.map +1 -0
  7. package/lib/cjs/node_modules/focus-lock/dist/es2015/constants.js +1 -1
  8. package/lib/cjs/node_modules/focus-lock/dist/es2015/constants.js.map +1 -1
  9. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusInside.js +1 -1
  10. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
  11. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusIsHidden.js +1 -1
  12. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
  13. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusMerge.js +1 -1
  14. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusMerge.js.map +1 -1
  15. package/lib/cjs/node_modules/focus-lock/dist/es2015/focusables.js.map +1 -1
  16. package/lib/cjs/node_modules/focus-lock/dist/es2015/index.js.map +1 -1
  17. package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
  18. package/lib/cjs/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
  19. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/DOMutils.js +1 -1
  20. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
  21. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
  22. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/array.js.map +1 -1
  23. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
  24. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +1 -1
  25. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
  26. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/is.js +1 -1
  27. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
  28. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/parenting.js +1 -1
  29. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
  30. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +1 -1
  31. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
  32. package/lib/cjs/node_modules/focus-lock/dist/es2015/utils/tabbables.js.map +1 -1
  33. package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  34. package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js +2 -0
  35. package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js.map +1 -0
  36. package/lib/cjs/node_modules/tslib/tslib.es6.js +1 -16
  37. package/lib/cjs/node_modules/tslib/tslib.es6.js.map +1 -1
  38. package/lib/cjs/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +1 -1
  39. package/lib/cjs/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
  40. package/lib/cjs/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
  41. package/lib/cjs/node_modules/use-sidecar/dist/es2015/medium.js +1 -1
  42. package/lib/cjs/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  43. package/lib/cjs/src/components/AddressLookup/index.js +1 -1
  44. package/lib/cjs/src/components/Avatar/index.js +1 -1
  45. package/lib/cjs/src/components/Button/index.js +1 -1
  46. package/lib/cjs/src/components/Carousel/index.js +1 -1
  47. package/lib/cjs/src/components/Checkbox/index.js +1 -1
  48. package/lib/cjs/src/components/Checkbox/styles.js +1 -1
  49. package/lib/cjs/src/components/Collapse/index.js +1 -1
  50. package/lib/cjs/src/components/Collapse/styles.js +1 -1
  51. package/lib/cjs/src/components/GlobalStyle.js +1 -1
  52. package/lib/cjs/src/components/Icon/README.md.js +1 -1
  53. package/lib/cjs/src/components/Icon/README.md.js.map +1 -1
  54. package/lib/cjs/src/components/IconFa/README.md.js +2 -0
  55. package/lib/cjs/src/components/IconFa/README.md.js.map +1 -0
  56. package/lib/cjs/src/components/IconFa/index.js +2 -0
  57. package/lib/cjs/src/components/IconFa/index.js.map +1 -0
  58. package/lib/cjs/src/components/IconFa/styles.js +2 -0
  59. package/lib/cjs/src/components/IconFa/styles.js.map +1 -0
  60. package/lib/cjs/src/components/Link/README.md.js +1 -1
  61. package/lib/cjs/src/components/Link/README.md.js.map +1 -1
  62. package/lib/cjs/src/components/Link/index.js +1 -1
  63. package/lib/cjs/src/components/Link/styles.js +1 -1
  64. package/lib/cjs/src/components/Modal/index.js +1 -1
  65. package/lib/cjs/src/components/index.js +1 -1
  66. package/lib/cjs/src/themes/cruk.js +1 -1
  67. package/lib/cjs/src/themes/su2c.js +1 -1
  68. package/lib/components/AddressLookup/{test.cypress.d.ts → AddressLookUp.test.cypress.d.ts} +0 -0
  69. package/lib/components/Avatar/{test.cypress.d.ts → Avatar.test.cypress.d.ts} +0 -0
  70. package/lib/components/Avatar/index.d.ts +2 -2
  71. package/lib/components/Badge/{test.cypress.d.ts → Badge.test.cypress.d.ts} +0 -0
  72. package/lib/components/Box/{test.cypress.d.ts → Box.test.cypress.d.ts} +0 -0
  73. package/lib/components/Button/{test.cypress.d.ts → Button.test.cypress.d.ts} +0 -0
  74. package/lib/components/Carousel/{test.cypress.d.ts → Carousel.test.cypress.d.ts} +0 -0
  75. package/lib/components/Checkbox/{test.cypress.d.ts → CheckBox.test.cypress.d.ts} +0 -0
  76. package/lib/components/Checkbox/styles.d.ts +0 -1
  77. package/lib/components/Collapse/{test.cypress.d.ts → Collapse.test.cypress.d.ts} +0 -0
  78. package/lib/components/Collapse/index.d.ts +4 -2
  79. package/lib/components/Collapse/styles.d.ts +1 -1
  80. package/lib/components/DateField/{test.cypress.d.ts → DateField.test.cypress.d.ts} +0 -0
  81. package/lib/components/DateField/index.d.ts +2 -2
  82. package/lib/components/ErrorText/{test.cypress.d.ts → ErrorText.test.cypress.d.ts} +0 -0
  83. package/lib/components/Footer/{test.cypress.d.ts → Footer.test.cypress.d.ts} +0 -0
  84. package/lib/components/Header/{test.cypress.d.ts → Header.test.cypress.d.ts} +0 -0
  85. package/lib/components/Heading/{test.cypress.d.ts → Heading.test.cypress.d.ts} +0 -0
  86. package/lib/components/Icon/{test.cypress.d.ts → Icon.test.cypress.d.ts} +0 -0
  87. package/lib/components/Icon/index.d.ts +1 -1
  88. package/lib/components/IconFa/IconFa.stories.d.ts +6 -0
  89. package/lib/components/{LegendWrapper/test.cypress.d.ts → IconFa/IconFa.test.cypress.d.ts} +0 -0
  90. package/lib/components/IconFa/index.d.ts +17 -0
  91. package/lib/components/IconFa/styles.d.ts +5 -0
  92. package/lib/components/{Link/test.cypress.d.ts → LegendWrapper/LegendWrapper.test.cypress.d.ts} +0 -0
  93. package/lib/components/{Loader/test.cypress.d.ts → Link/Link.test.cypress.d.ts} +0 -0
  94. package/lib/components/Link/styles.d.ts +1 -1
  95. package/lib/components/{Modal/test.cypress.d.ts → Loader/Loader.test.cypress.d.ts} +0 -0
  96. package/lib/components/{Pagination/test.cypress.d.ts → Modal/Modal.test.cypress.d.ts} +0 -0
  97. package/lib/components/{PopOver/test.cypress.d.ts → Pagination/Pagination.test.cypress.d.ts} +0 -0
  98. package/lib/components/{ProgressBar/test.cypress.d.ts → PopOver/PopOver.test.cypress.d.ts} +0 -0
  99. package/lib/components/{Radio/test.cypress.d.ts → ProgressBar/ProgressBar.test.cypress.d.ts} +0 -0
  100. package/lib/components/{RadioConsent/test.cypress.d.ts → Radio/Radio.test.cypress.d.ts} +0 -0
  101. package/lib/components/{Select/test.cypress.d.ts → RadioConsent/RadioConsent.test.cypress.d.ts} +0 -0
  102. package/lib/components/{Step/test.cypress.d.ts → Select/Select.test.cypress.d.ts} +0 -0
  103. package/lib/components/{Text/test.cypress.d.ts → Step/Step.test.cypress.d.ts} +0 -0
  104. package/lib/components/{TextAreaField/test.cypress.d.ts → Text/Text.test.cypress.d.ts} +0 -0
  105. package/lib/components/{TextField/test.cypress.d.ts → TextAreaField/TextAreaField.test.cypress.d.ts} +0 -0
  106. package/lib/components/{Totaliser/test.cypress.d.ts → TextField/TextField.test.cypress.d.ts} +0 -0
  107. package/lib/components/{UserBlock/test.cypress.d.ts → Totaliser/Totaliser.test.cypress.d.ts} +0 -0
  108. package/lib/components/UserBlock/UserBlock.test.cypress.d.ts +1 -0
  109. package/lib/components/index.d.ts +2 -0
  110. package/lib/es/node_modules/@babel/runtime/helpers/esm/extends.js +1 -1
  111. package/lib/es/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
  112. package/lib/es/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -1
  113. package/lib/es/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -1
  114. package/lib/es/node_modules/@fortawesome/free-solid-svg-icons/index.es.js +7 -0
  115. package/lib/es/node_modules/@fortawesome/free-solid-svg-icons/index.es.js.map +1 -0
  116. package/lib/es/node_modules/focus-lock/dist/es2015/constants.js +1 -1
  117. package/lib/es/node_modules/focus-lock/dist/es2015/constants.js.map +1 -1
  118. package/lib/es/node_modules/focus-lock/dist/es2015/focusInside.js +1 -1
  119. package/lib/es/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
  120. package/lib/es/node_modules/focus-lock/dist/es2015/focusIsHidden.js +1 -1
  121. package/lib/es/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
  122. package/lib/es/node_modules/focus-lock/dist/es2015/focusMerge.js +1 -1
  123. package/lib/es/node_modules/focus-lock/dist/es2015/focusMerge.js.map +1 -1
  124. package/lib/es/node_modules/focus-lock/dist/es2015/focusables.js.map +1 -1
  125. package/lib/es/node_modules/focus-lock/dist/es2015/index.js.map +1 -1
  126. package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
  127. package/lib/es/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
  128. package/lib/es/node_modules/focus-lock/dist/es2015/utils/DOMutils.js +1 -1
  129. package/lib/es/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
  130. package/lib/es/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
  131. package/lib/es/node_modules/focus-lock/dist/es2015/utils/array.js.map +1 -1
  132. package/lib/es/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
  133. package/lib/es/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +1 -1
  134. package/lib/es/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
  135. package/lib/es/node_modules/focus-lock/dist/es2015/utils/is.js +1 -1
  136. package/lib/es/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
  137. package/lib/es/node_modules/focus-lock/dist/es2015/utils/parenting.js +1 -1
  138. package/lib/es/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
  139. package/lib/es/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +1 -1
  140. package/lib/es/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
  141. package/lib/es/node_modules/focus-lock/dist/es2015/utils/tabbables.js.map +1 -1
  142. package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  143. package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js +2 -0
  144. package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js.map +1 -0
  145. package/lib/es/node_modules/tslib/tslib.es6.js +0 -14
  146. package/lib/es/node_modules/tslib/tslib.es6.js.map +1 -1
  147. package/lib/es/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +1 -1
  148. package/lib/es/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
  149. package/lib/es/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
  150. package/lib/es/node_modules/use-sidecar/dist/es2015/medium.js +1 -1
  151. package/lib/es/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  152. package/lib/es/src/components/AddressLookup/index.js +1 -1
  153. package/lib/es/src/components/Avatar/index.js +1 -1
  154. package/lib/es/src/components/Button/index.js +1 -1
  155. package/lib/es/src/components/Carousel/index.js +1 -1
  156. package/lib/es/src/components/Checkbox/index.js +1 -1
  157. package/lib/es/src/components/Checkbox/styles.js +1 -1
  158. package/lib/es/src/components/Collapse/index.js +1 -1
  159. package/lib/es/src/components/Collapse/styles.js +1 -1
  160. package/lib/es/src/components/GlobalStyle.js +1 -1
  161. package/lib/es/src/components/Icon/README.md.js +1 -1
  162. package/lib/es/src/components/Icon/README.md.js.map +1 -1
  163. package/lib/es/src/components/IconFa/README.md.js +2 -0
  164. package/lib/es/src/components/IconFa/README.md.js.map +1 -0
  165. package/lib/es/src/components/IconFa/index.js +2 -0
  166. package/lib/es/src/components/IconFa/index.js.map +1 -0
  167. package/lib/es/src/components/IconFa/styles.js +2 -0
  168. package/lib/es/src/components/IconFa/styles.js.map +1 -0
  169. package/lib/es/src/components/Link/README.md.js +1 -1
  170. package/lib/es/src/components/Link/README.md.js.map +1 -1
  171. package/lib/es/src/components/Link/index.js +1 -1
  172. package/lib/es/src/components/Link/styles.js +1 -1
  173. package/lib/es/src/components/Modal/index.js +1 -1
  174. package/lib/es/src/components/index.js +1 -1
  175. package/lib/es/src/themes/cruk.js +1 -1
  176. package/lib/es/src/themes/su2c.js +1 -1
  177. package/lib/hooks/useKey.d.ts +1 -1
  178. package/lib/types.d.ts +2 -1
  179. package/lib/utils/Helper.d.ts +1 -1
  180. package/package.json +40 -36
  181. package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js +0 -2
  182. package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +0 -1
  183. package/lib/cjs/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js +0 -17
  184. package/lib/cjs/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js.map +0 -1
  185. package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js +0 -2
  186. package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +0 -1
  187. package/lib/es/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js +0 -16
  188. package/lib/es/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1,2 +1,2 @@
1
- var a="data-focus-lock",o="data-focus-lock-disabled",c="data-no-focus-lock",d="data-autofocus-inside";export{c as FOCUS_ALLOW,d as FOCUS_AUTO,o as FOCUS_DISABLED,a as FOCUS_GROUP};
1
+ var a="data-focus-lock",o="data-focus-lock-disabled",c="data-no-focus-lock",d="data-autofocus-inside",t="data-no-autofocus";export{c as FOCUS_ALLOW,d as FOCUS_AUTO,o as FOCUS_DISABLED,a as FOCUS_GROUP,t as FOCUS_NO_AUTOFOCUS};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/constants.js"],"sourcesContent":["export var FOCUS_GROUP = 'data-focus-lock';\nexport var FOCUS_DISABLED = 'data-focus-lock-disabled';\nexport var FOCUS_ALLOW = 'data-no-focus-lock';\nexport var FOCUS_AUTO = 'data-autofocus-inside';\n"],"names":["FOCUS_GROUP","FOCUS_DISABLED","FOCUS_ALLOW","FOCUS_AUTO"],"mappings":"AAAU,IAACA,EAAc,kBACdC,EAAiB,2BACjBC,EAAc,qBACdC,EAAa"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/constants.js"],"sourcesContent":["/**\n * defines a focus group\n */\nexport var FOCUS_GROUP = 'data-focus-lock';\n/**\n * disables element discovery inside a group marked by key\n */\nexport var FOCUS_DISABLED = 'data-focus-lock-disabled';\n/**\n * allows uncontrolled focus within the marked area, effectively disabling focus lock for it's content\n */\nexport var FOCUS_ALLOW = 'data-no-focus-lock';\n/**\n * instructs autofocus engine to pick default autofocus inside a given node\n * can be set on the element or container\n */\nexport var FOCUS_AUTO = 'data-autofocus-inside';\n/**\n * instructs autofocus to ignore elements within a given node\n * can be set on the element or container\n */\nexport var FOCUS_NO_AUTOFOCUS = 'data-no-autofocus';\n"],"names":["FOCUS_GROUP","FOCUS_DISABLED","FOCUS_ALLOW","FOCUS_AUTO","FOCUS_NO_AUTOFOCUS"],"mappings":"AAGU,IAACA,EAAc,kBAIdC,EAAiB,2BAIjBC,EAAc,qBAKdC,EAAa,wBAKbC,EAAqB"}
@@ -1,2 +1,2 @@
1
- import{getAllAffectedNodes as t}from"./utils/all-affected.js";import{toArray as e}from"./utils/array.js";import{getActiveElement as r}from"./utils/getActiveElement.js";var n=function(t){return Boolean(e(t.querySelectorAll("iframe")).some((function(t){return t===document.activeElement})))},o=function(e){var o=document&&r();return!(!o||o.dataset&&o.dataset.focusGuard)&&t(e).reduce((function(t,e){return t||e.contains(o)||n(e)}),!1)};export{o as focusInside};
1
+ import{contains as t}from"./utils/DOMutils.js";import{getAllAffectedNodes as e}from"./utils/all-affected.js";import{toArray as r}from"./utils/array.js";import{getActiveElement as o}from"./utils/getActiveElement.js";var u=function(t){return Boolean(r(t.querySelectorAll("iframe")).some((function(t){return t===document.activeElement})))},n=function(r){var n=document&&o();return!(!n||n.dataset&&n.dataset.focusGuard)&&e(r).some((function(e){return t(e,n)||u(e)}))};export{n as focusInside};
2
2
  //# sourceMappingURL=focusInside.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusInside.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusInside.js"],"sourcesContent":["import { getAllAffectedNodes } from './utils/all-affected';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame) { return frame === document.activeElement; };\nvar focusInsideIframe = function (topNode) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node); }));\n};\nexport var focusInside = function (topNode) {\n var activeElement = document && getActiveElement();\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).reduce(function (result, node) { return result || node.contains(activeElement) || focusInsideIframe(node); }, false);\n};\n"],"names":["focusInsideIframe","topNode","Boolean","toArray","querySelectorAll","some","node","document","activeElement","focusInside","getActiveElement","dataset","focusGuard","getAllAffectedNodes","reduce","result","contains"],"mappings":"wKAGA,IACIA,EAAoB,SAAUC,GAC9B,OAAOC,QAAQC,EAAQF,EAAQG,iBAAiB,WAAWC,MAAK,SAAUC,GAAQ,OAAoBA,IAFnDC,SAASC,mBAIrDC,EAAc,SAAUR,GAC/B,IAAIO,EAAgBD,UAAYG,IAChC,SAAKF,GAAkBA,EAAcG,SAAWH,EAAcG,QAAQC,aAG/DC,EAAoBZ,GAASa,QAAO,SAAUC,EAAQT,GAAQ,OAAOS,GAAUT,EAAKU,SAASR,IAAkBR,EAAkBM,MAAU"}
1
+ {"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 { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame) { return frame === document.activeElement; };\nvar focusInsideIframe = function (topNode) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes\n */\nexport var focusInside = function (topNode) {\n var activeElement = document && getActiveElement();\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) { return contains(node, activeElement) || focusInsideIframe(node); });\n};\n"],"names":["focusInsideIframe","topNode","Boolean","toArray","querySelectorAll","some","node","document","activeElement","focusInside","getActiveElement","dataset","focusGuard","getAllAffectedNodes","contains"],"mappings":"uNAIA,IACIA,EAAoB,SAAUC,GAC9B,OAAOC,QAAQC,EAAQF,EAAQG,iBAAiB,WAAWC,MAAK,SAAUC,GAAQ,OAAoBA,IAFnDC,SAASC,mBAOrDC,EAAc,SAAUR,GAC/B,IAAIO,EAAgBD,UAAYG,IAChC,SAAKF,GAAkBA,EAAcG,SAAWH,EAAcG,QAAQC,aAG/DC,EAAoBZ,GAASI,MAAK,SAAUC,GAAQ,OAAOQ,EAASR,EAAME,IAAkBR,EAAkBM"}
@@ -1,2 +1,2 @@
1
- import{FOCUS_ALLOW as t}from"./constants.js";import{toArray as r}from"./utils/array.js";import{getActiveElement as o}from"./utils/getActiveElement.js";var n=function(){var n=document&&o();return!!n&&r(document.querySelectorAll("[".concat(t,"]"))).some((function(t){return t.contains(n)}))};export{n as focusIsHidden};
1
+ import{FOCUS_ALLOW as t}from"./constants.js";import{contains as r}from"./utils/DOMutils.js";import{toArray as o}from"./utils/array.js";import{getActiveElement as e}from"./utils/getActiveElement.js";var m=function(){var m=document&&e();return!!m&&o(document.querySelectorAll("[".concat(t,"]"))).some((function(t){return r(t,m)}))};export{m as focusIsHidden};
2
2
  //# sourceMappingURL=focusIsHidden.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusIsHidden.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js"],"sourcesContent":["import { FOCUS_ALLOW } from './constants';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nexport var focusIsHidden = function () {\n var activeElement = document && getActiveElement();\n if (!activeElement) {\n return false;\n }\n return toArray(document.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return node.contains(activeElement); });\n};\n"],"names":["focusIsHidden","activeElement","document","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"uJAGU,IAACA,EAAgB,WACvB,IAAIC,EAAgBC,UAAYC,IAChC,QAAKF,GAGEG,EAAQF,SAASG,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,MAAK,SAAUC,GAAQ,OAAOA,EAAKC,SAAST"}
1
+ {"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 * focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function () {\n var activeElement = document && getActiveElement();\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(document.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n"],"names":["focusIsHidden","activeElement","document","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"sMASU,IAACA,EAAgB,WACvB,IAAIC,EAAgBC,UAAYC,IAChC,QAAKF,GAIEG,EAAQF,SAASG,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,MAAK,SAAUC,GAAQ,OAAOC,EAASD,EAAMR"}
@@ -1,2 +1,2 @@
1
- import{newFocus as t,NEW_FOCUS as r}from"./solver.js";import{getAllTabbableNodes as n,getTabbableNodes as o}from"./utils/DOMutils.js";import{getAllAffectedNodes as i}from"./utils/all-affected.js";import{pickFirstFocus as e}from"./utils/firstFocus.js";import{getActiveElement as u}from"./utils/getActiveElement.js";import{isNotAGuard as f,isDefined as s,getDataset as m}from"./utils/is.js";import{getTopCommonParent as a,allParentAutofocusables as l}from"./utils/parenting.js";var c=function(c,p){var d=document&&u(),v=i(c).filter(f),j=a(d||c,c,v),g=new Map,M=n(v,g),h=o(v,g).filter((function(t){var r=t.node;return f(r)}));if(h[0]||(h=M)[0]){var w,x,E,O,A=n([j],g).map((function(t){return t.node})),D=(w=A,x=h,E=new Map,x.forEach((function(t){return E.set(t.node,t)})),w.map((function(t){return E.get(t)})).filter(s)),F=D.map((function(t){return t.node})),b=t(F,A,d,p);if(b===r){var k=M.map((function(t){return t.node})).filter((O=l(v,g),function(t){var r;return t.autofocus||!!(null===(r=m(t))||void 0===r?void 0:r.autofocus)||O.indexOf(t)>=0}));return{node:k&&k.length?e(k):e(F)}}return void 0===b?b:D[b]}};export{c as getFocusMerge};
1
+ import{newFocus as t,NEW_FOCUS as r}from"./solver.js";import{getAllTabbableNodes as n,getTabbableNodes as o,filterAutoFocusable as i}from"./utils/DOMutils.js";import{getAllAffectedNodes as e}from"./utils/all-affected.js";import{pickFirstFocus as u}from"./utils/firstFocus.js";import{getActiveElement as f}from"./utils/getActiveElement.js";import{isNotAGuard as s,isDefined as m,getDataset as a}from"./utils/is.js";import{getTopCommonParent as l,allParentAutofocusables as c}from"./utils/parenting.js";var p=function(p,d){var v=document&&f(),j=e(p).filter(s),g=l(v||p,p,j),M=new Map,h=n(j,M),w=o(j,M).filter((function(t){var r=t.node;return s(r)}));if(w[0]||(w=h)[0]){var x,E,O,A,D=n([g],M).map((function(t){return t.node})),F=(x=D,E=w,O=new Map,E.forEach((function(t){return O.set(t.node,t)})),x.map((function(t){return O.get(t)})).filter(m)),b=F.map((function(t){return t.node})),k=t(b,D,v,d);if(k===r){var q=i(h.map((function(t){return t.node}))).filter((A=c(j,M),function(t){var r;return t.autofocus||!!(null===(r=a(t))||void 0===r?void 0:r.autofocus)||A.indexOf(t)>=0}));return{node:q&&q.length?u(q):u(i(b))}}return void 0===k?k:F[k]}};export{p as getFocusMerge};
2
2
  //# sourceMappingURL=focusMerge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusMerge.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusMerge.js"],"sourcesContent":["import { NEW_FOCUS, newFocus } from './solver';\nimport { getAllTabbableNodes, getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { pickFirstFocus } from './utils/firstFocus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { getDataset, isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) { var _a; return node.autofocus || !!((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus) || autoFocusables.indexOf(node) >= 0; };\n};\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\nexport var getFocusMerge = function (topNode, lastNode) {\n var activeElement = document && getActiveElement();\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getAllTabbableNodes(entries, visibilityCache);\n var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n innerElements = anyFocusable;\n if (!innerElements[0]) {\n return undefined;\n }\n }\n var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n var innerNodes = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var autoFocusable = anyFocusable\n .map(function (_a) {\n var node = _a.node;\n return node;\n })\n .filter(findAutoFocused(allParentAutofocusables(entries, visibilityCache)));\n return {\n node: autoFocusable && autoFocusable.length ? pickFirstFocus(autoFocusable) : pickFirstFocus(innerNodes),\n };\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n"],"names":["getFocusMerge","topNode","lastNode","activeElement","document","getActiveElement","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","anyFocusable","getAllTabbableNodes","innerElements","getTabbableNodes","_a","node","srcNodes","dstNodes","remap","autoFocusables","outerNodes","map","orderedInnerElements","forEach","entity","set","get","isDefined","innerNodes","newId","newFocus","NEW_FOCUS","autoFocusable","allParentAutofocusables","autofocus","getDataset","indexOf","length","pickFirstFocus","undefined"],"mappings":"4dAOA,IAQWA,EAAgB,SAAUC,EAASC,GAC1C,IAAIC,EAAgBC,UAAYC,IAC5BC,EAAUC,EAAoBN,GAASO,OAAOC,GAC9CC,EAAeC,EAAmBR,GAAiBF,EAASA,EAASK,GACrEM,EAAkB,IAAIC,IACtBC,EAAeC,EAAoBT,EAASM,GAC5CI,EAAgBC,EAAiBX,EAASM,GAAiBJ,QAAO,SAAUU,GAC5E,IAAIC,EAAOD,EAAGC,KACd,OAAOV,EAAYU,MAEvB,GAAKH,EAAc,KACfA,EAAgBF,GACG,GAFvB,CAMA,IArByBM,EAAUC,EAC/BC,EAJwBC,EAwBxBC,EAAaT,EAAoB,CAACL,GAAeE,GAAiBa,KAAI,SAAUP,GAEhF,OADWA,EAAGC,QAGdO,GAzBqBN,EAyBeI,EAzBLH,EAyBiBL,EAxBhDM,EAAQ,IAAIT,IAChBQ,EAASM,SAAQ,SAAUC,GAAU,OAAON,EAAMO,IAAID,EAAOT,KAAMS,MAC5DR,EAASK,KAAI,SAAUN,GAAQ,OAAOG,EAAMQ,IAAIX,MAAUX,OAAOuB,IAuBpEC,EAAaN,EAAqBD,KAAI,SAAUP,GAEhD,OADWA,EAAGC,QAGdc,EAAQC,EAASF,EAAYR,EAAYrB,EAAeD,GAC5D,GAAI+B,IAAUE,EAAW,CACrB,IAAIC,EAAgBtB,EACfW,KAAI,SAAUP,GAEf,OADWA,EAAGC,QAGbX,QAxCmBe,EAwCIc,EAAwB/B,EAASM,GAvC1D,SAAUO,GAAQ,IAAID,EAAI,OAAOC,EAAKmB,cAA4C,QAA3BpB,EAAKqB,EAAWpB,UAA0B,IAAPD,OAAgB,EAASA,EAAGoB,YAAcf,EAAeiB,QAAQrB,IAAS,KAwCvK,MAAO,CACHA,KAAMiB,GAAiBA,EAAcK,OAASC,EAAeN,GAAiBM,EAAeV,IAGrG,YAAcW,IAAVV,EACOA,EAEJP,EAAqBO"}
1
+ {"version":3,"file":"focusMerge.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusMerge.js"],"sourcesContent":["import { NEW_FOCUS, newFocus } from './solver';\nimport { filterAutoFocusable, getAllTabbableNodes, getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { pickFirstFocus } from './utils/firstFocus';\nimport { getActiveElement } from './utils/getActiveElement';\nimport { getDataset, isDefined, isNotAGuard } from './utils/is';\nimport { allParentAutofocusables, getTopCommonParent } from './utils/parenting';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) { var _a; \n // @ts-expect-error\n return node.autofocus || !!((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus) || autoFocusables.indexOf(node) >= 0; };\n};\nvar reorderNodes = function (srcNodes, dstNodes) {\n var remap = new Map();\n // no Set(dstNodes) for IE11 :(\n dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); });\n // remap to dstNodes\n return srcNodes.map(function (node) { return remap.get(node); }).filter(isDefined);\n};\n/**\n * given top node(s) and the last active element return the element to be focused next\n * @param topNode\n * @param lastNode\n */\nexport var getFocusMerge = function (topNode, lastNode) {\n var activeElement = document && getActiveElement();\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);\n var visibilityCache = new Map();\n var anyFocusable = getAllTabbableNodes(entries, visibilityCache);\n var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n });\n if (!innerElements[0]) {\n innerElements = anyFocusable;\n if (!innerElements[0]) {\n return undefined;\n }\n }\n var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) {\n var node = _a.node;\n return node;\n });\n var orderedInnerElements = reorderNodes(outerNodes, innerElements);\n var innerNodes = orderedInnerElements.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode);\n if (newId === NEW_FOCUS) {\n var autoFocusable = filterAutoFocusable(anyFocusable.map(function (_a) {\n var node = _a.node;\n return node;\n })).filter(findAutoFocused(allParentAutofocusables(entries, visibilityCache)));\n return {\n node: autoFocusable && autoFocusable.length\n ? pickFirstFocus(autoFocusable)\n : pickFirstFocus(filterAutoFocusable(innerNodes)),\n };\n }\n if (newId === undefined) {\n return newId;\n }\n return orderedInnerElements[newId];\n};\n"],"names":["getFocusMerge","topNode","lastNode","activeElement","document","getActiveElement","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","anyFocusable","getAllTabbableNodes","innerElements","getTabbableNodes","_a","node","srcNodes","dstNodes","remap","autoFocusables","outerNodes","map","orderedInnerElements","forEach","entity","set","get","isDefined","innerNodes","newId","newFocus","NEW_FOCUS","autoFocusable","filterAutoFocusable","allParentAutofocusables","autofocus","getDataset","indexOf","length","pickFirstFocus","undefined"],"mappings":"qfAOA,IAiBWA,EAAgB,SAAUC,EAASC,GAC1C,IAAIC,EAAgBC,UAAYC,IAC5BC,EAAUC,EAAoBN,GAASO,OAAOC,GAC9CC,EAAeC,EAAmBR,GAAiBF,EAASA,EAASK,GACrEM,EAAkB,IAAIC,IACtBC,EAAeC,EAAoBT,EAASM,GAC5CI,EAAgBC,EAAiBX,EAASM,GAAiBJ,QAAO,SAAUU,GAC5E,IAAIC,EAAOD,EAAGC,KACd,OAAOV,EAAYU,MAEvB,GAAKH,EAAc,KACfA,EAAgBF,GACG,GAFvB,CAMA,IA5ByBM,EAAUC,EAC/BC,EANwBC,EAiCxBC,EAAaT,EAAoB,CAACL,GAAeE,GAAiBa,KAAI,SAAUP,GAEhF,OADWA,EAAGC,QAGdO,GAhCqBN,EAgCeI,EAhCLH,EAgCiBL,EA/BhDM,EAAQ,IAAIT,IAEhBQ,EAASM,SAAQ,SAAUC,GAAU,OAAON,EAAMO,IAAID,EAAOT,KAAMS,MAE5DR,EAASK,KAAI,SAAUN,GAAQ,OAAOG,EAAMQ,IAAIX,MAAUX,OAAOuB,IA4BpEC,EAAaN,EAAqBD,KAAI,SAAUP,GAEhD,OADWA,EAAGC,QAGdc,EAAQC,EAASF,EAAYR,EAAYrB,EAAeD,GAC5D,GAAI+B,IAAUE,EAAW,CACrB,IAAIC,EAAgBC,EAAoBvB,EAAaW,KAAI,SAAUP,GAE/D,OADWA,EAAGC,SAEdX,QA/CoBe,EA+CGe,EAAwBhC,EAASM,GA9CzD,SAAUO,GAAQ,IAAID,EAE7B,OAAOC,EAAKoB,cAA4C,QAA3BrB,EAAKsB,EAAWrB,UAA0B,IAAPD,OAAgB,EAASA,EAAGqB,YAAchB,EAAekB,QAAQtB,IAAS,KA6CtI,MAAO,CACHA,KAAMiB,GAAiBA,EAAcM,OAC/BC,EAAeP,GACfO,EAAeN,EAAoBL,KAGjD,YAAcY,IAAVX,EACOA,EAEJP,EAAqBO"}
@@ -1 +1 @@
1
- {"version":3,"file":"focusables.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusables.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\nexport var getFocusabledIn = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var visibilityCache = new Map();\n var outerNodes = getTabbableNodes([commonParent], visibilityCache, true);\n var innerElements = getTabbableNodes(entries, visibilityCache)\n .filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n })\n .map(function (_a) {\n var node = _a.node;\n return node;\n });\n return outerNodes.map(function (_a) {\n var node = _a.node, index = _a.index;\n return ({\n node: node,\n index: index,\n lockItem: innerElements.indexOf(node) >= 0,\n guard: isGuard(node),\n });\n });\n};\n"],"names":["getFocusabledIn","topNode","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","outerNodes","getTabbableNodes","innerElements","_a","node","map","index","lockItem","indexOf","guard","isGuard"],"mappings":"wOAIU,IAACA,EAAkB,SAAUC,GACnC,IAAIC,EAAUC,EAAoBF,GAASG,OAAOC,GAC9CC,EAAeC,EAAmBN,EAASA,EAASC,GACpDM,EAAkB,IAAIC,IACtBC,EAAaC,EAAiB,CAACL,GAAeE,GAAiB,GAC/DI,EAAgBD,EAAiBT,EAASM,GACzCJ,QAAO,SAAUS,GAClB,IAAIC,EAAOD,EAAGC,KACd,OAAOT,EAAYS,MAElBC,KAAI,SAAUF,GAEf,OADWA,EAAGC,QAGlB,OAAOJ,EAAWK,KAAI,SAAUF,GAC5B,IAAIC,EAAOD,EAAGC,KACd,MAAQ,CACJA,KAAMA,EACNE,MAHwBH,EAAGG,MAI3BC,SAAUL,EAAcM,QAAQJ,IAAS,EACzCK,MAAOC,EAAQN"}
1
+ {"version":3,"file":"focusables.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/focusables.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { isGuard, isNotAGuard } from './utils/is';\nimport { getTopCommonParent } from './utils/parenting';\n/**\n * return list of focusable elements inside a given top node\n * @deprecated use {@link getFocusableIn}. Yep, there is typo in the function name\n */\nexport var getFocusabledIn = function (topNode) {\n var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);\n var commonParent = getTopCommonParent(topNode, topNode, entries);\n var visibilityCache = new Map();\n var outerNodes = getTabbableNodes([commonParent], visibilityCache, true);\n var innerElements = getTabbableNodes(entries, visibilityCache)\n .filter(function (_a) {\n var node = _a.node;\n return isNotAGuard(node);\n })\n .map(function (_a) {\n var node = _a.node;\n return node;\n });\n return outerNodes.map(function (_a) {\n var node = _a.node, index = _a.index;\n return ({\n node: node,\n index: index,\n lockItem: innerElements.indexOf(node) >= 0,\n guard: isGuard(node),\n });\n });\n};\n/**\n * return list of focusable elements inside a given top node\n */\nexport var getFocusableIn = getFocusabledIn;\n"],"names":["getFocusabledIn","topNode","entries","getAllAffectedNodes","filter","isNotAGuard","commonParent","getTopCommonParent","visibilityCache","Map","outerNodes","getTabbableNodes","innerElements","_a","node","map","index","lockItem","indexOf","guard","isGuard"],"mappings":"wOAQU,IAACA,EAAkB,SAAUC,GACnC,IAAIC,EAAUC,EAAoBF,GAASG,OAAOC,GAC9CC,EAAeC,EAAmBN,EAASA,EAASC,GACpDM,EAAkB,IAAIC,IACtBC,EAAaC,EAAiB,CAACL,GAAeE,GAAiB,GAC/DI,EAAgBD,EAAiBT,EAASM,GACzCJ,QAAO,SAAUS,GAClB,IAAIC,EAAOD,EAAGC,KACd,OAAOT,EAAYS,MAElBC,KAAI,SAAUF,GAEf,OADWA,EAAGC,QAGlB,OAAOJ,EAAWK,KAAI,SAAUF,GAC5B,IAAIC,EAAOD,EAAGC,KACd,MAAQ,CACJA,KAAMA,EACNE,MAHwBH,EAAGG,MAI3BC,SAAUL,EAAcM,QAAQJ,IAAS,EACzCK,MAAOC,EAAQN"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/index.js"],"sourcesContent":["import * as constants from './constants';\nimport { focusInside } from './focusInside';\nimport { focusIsHidden } from './focusIsHidden';\nimport { getFocusMerge as focusMerge } from './focusMerge';\nimport { getFocusabledIn } from './focusables';\nimport { setFocus } from './setFocus';\nimport { focusNextElement, focusPrevElement } from './sibling';\nimport tabHook from './tabHook';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getActiveElement } from './utils/getActiveElement';\nexport { tabHook, focusInside, focusIsHidden, focusMerge, getFocusabledIn, constants, getAllAffectedNodes, focusNextElement, focusPrevElement, getActiveElement, };\nexport default setFocus;\n"],"names":["moveFocusInside","setFocus"],"mappings":"yCAWA,IAAAA,EAAeC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/index.js"],"sourcesContent":["import * as constants from './constants';\nimport { focusInside } from './focusInside';\nimport { focusIsHidden } from './focusIsHidden';\nimport { getFocusMerge as focusMerge } from './focusMerge';\nimport { getFocusabledIn, getFocusableIn } from './focusables';\nimport { setFocus } from './setFocus';\nimport { focusNextElement, focusPrevElement } from './sibling';\nimport tabHook from './tabHook';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getActiveElement } from './utils/getActiveElement';\nexport { tabHook, focusInside, focusIsHidden, focusMerge, getFocusableIn, getFocusabledIn, constants, getAllAffectedNodes, focusNextElement, focusPrevElement, getActiveElement, };\nexport default setFocus;\n//\n"],"names":["moveFocusInside","setFocus"],"mappings":"yCAWA,IAAAA,EAAeC"}
@@ -1 +1 @@
1
- {"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n if ('focus' in target) {\n target.focus(focusOptions);\n }\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focusOptions","focus","contentWindow","guardCount","lockDisabled","setFocus","topNode","lastNode","options","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"gDACU,IAACA,EAAU,SAAUC,EAAQC,GAC/B,UAAWD,GACXA,EAAOE,MAAMD,GAEb,kBAAmBD,GAAUA,EAAOG,eACpCH,EAAOG,cAAcD,SAGzBE,EAAa,EACbC,GAAe,EACRC,EAAW,SAAUC,EAASC,EAAUC,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAIC,EAAYC,EAAcJ,EAASC,GACvC,IAAIH,GAGAK,EAAW,CACX,GAAIN,EAAa,EAOb,OANAQ,QAAQC,MAAM,qJAEdR,GAAe,OACfS,YAAW,WACPT,GAAe,IAChB,GAGPD,IACAL,EAAQW,EAAUK,KAAMN,EAAQR,cAChCG"}
1
+ {"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n if ('focus' in target) {\n target.focus(focusOptions);\n }\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * Sets focus at a given node. The last focused element will help to determine which element(first or last) should be focused.\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @param topNode\n * @param lastNode\n * @param options\n */\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n // tslint:disable-next-line:no-console\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focusOptions","focus","contentWindow","guardCount","lockDisabled","setFocus","topNode","lastNode","options","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"gDACU,IAACA,EAAU,SAAUC,EAAQC,GAC/B,UAAWD,GACXA,EAAOE,MAAMD,GAEb,kBAAmBD,GAAUA,EAAOG,eACpCH,EAAOG,cAAcD,SAGzBE,EAAa,EACbC,GAAe,EAQRC,EAAW,SAAUC,EAASC,EAAUC,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAIC,EAAYC,EAAcJ,EAASC,GACvC,IAAIH,GAGAK,EAAW,CACX,GAAIN,EAAa,EAQb,OANAQ,QAAQC,MAAM,qJAEdR,GAAe,OACfS,YAAW,WACPT,GAAe,IAChB,GAGPD,IACAL,EAAQW,EAAUK,KAAMN,EAAQR,cAChCG"}
@@ -1 +1 @@
1
- {"version":3,"file":"solver.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/solver.js"],"sourcesContent":["import { correctNodes } from './utils/correctFocus';\nimport { pickFocusable } from './utils/firstFocus';\nimport { isGuard } from './utils/is';\nexport var NEW_FOCUS = 'NEW_FOCUS';\nexport var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) {\n var cnt = innerNodes.length;\n var firstFocus = innerNodes[0];\n var lastFocus = innerNodes[cnt - 1];\n var isOnGuard = isGuard(activeElement);\n if (activeElement && innerNodes.indexOf(activeElement) >= 0) {\n return undefined;\n }\n var activeIndex = activeElement !== undefined ? outerNodes.indexOf(activeElement) : -1;\n var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;\n var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;\n var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);\n var returnFirstNode = pickFocusable(innerNodes, 0);\n var returnLastNode = pickFocusable(innerNodes, cnt - 1);\n if (activeIndex === -1 || lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\n if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnLastNode;\n }\n if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {\n return returnFirstNode;\n }\n if (indexDiff && Math.abs(correctedIndexDiff) > 1) {\n return lastNodeInside;\n }\n if (activeIndex <= firstNodeIndex) {\n return returnLastNode;\n }\n if (activeIndex > lastNodeIndex) {\n return returnFirstNode;\n }\n if (indexDiff) {\n if (Math.abs(indexDiff) > 1) {\n return lastNodeInside;\n }\n return (cnt + lastNodeInside + indexDiff) % cnt;\n }\n return undefined;\n};\n"],"names":["NEW_FOCUS","newFocus","innerNodes","outerNodes","activeElement","lastNode","cnt","length","firstFocus","lastFocus","isOnGuard","isGuard","indexOf","activeIndex","undefined","lastIndex","lastNodeInside","indexDiff","firstNodeIndex","lastNodeIndex","correctedNodes","correctNodes","correctedIndexDiff","returnFirstNode","pickFocusable","returnLastNode","Math","abs"],"mappings":"qJAGU,IAACA,EAAY,YACZC,EAAW,SAAUC,EAAYC,EAAYC,EAAeC,GACnE,IAAIC,EAAMJ,EAAWK,OACjBC,EAAaN,EAAW,GACxBO,EAAYP,EAAWI,EAAM,GAC7BI,EAAYC,EAAQP,GACxB,KAAIA,GAAiBF,EAAWU,QAAQR,IAAkB,GAA1D,CAGA,IAAIS,OAAgCC,IAAlBV,EAA8BD,EAAWS,QAAQR,IAAkB,EACjFW,EAAYV,EAAWF,EAAWS,QAAQP,GAAYQ,EACtDG,EAAiBX,EAAWH,EAAWU,QAAQP,IAAa,EAC5DY,EAAYJ,EAAcE,EAC1BG,EAAiBf,EAAWS,QAAQJ,GACpCW,EAAgBhB,EAAWS,QAAQH,GACnCW,EAAiBC,EAAalB,GAE9BmB,QADmCR,IAAlBV,EAA8BgB,EAAeR,QAAQR,IAAkB,IACjDC,EAAWe,EAAeR,QAAQP,GAAYQ,GACrFU,EAAkBC,EAActB,EAAY,GAC5CuB,EAAiBD,EAActB,EAAYI,EAAM,GACrD,OAAqB,IAAjBO,IAA0C,IAApBG,EApBP,aAuBdC,GAAaD,GAAkB,EACzBA,EAEPH,GAAeK,GAAkBR,GAAagB,KAAKC,IAAIV,GAAa,EAC7DQ,EAEPZ,GAAeM,GAAiBT,GAAagB,KAAKC,IAAIV,GAAa,EAC5DM,EAEPN,GAAaS,KAAKC,IAAIL,GAAsB,EACrCN,EAEPH,GAAeK,EACRO,EAEPZ,EAAcM,EACPI,EAEPN,EACIS,KAAKC,IAAIV,GAAa,EACfD,GAEHV,EAAMU,EAAiBC,GAAaX,OAJhD"}
1
+ {"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\n * @param outerNodes\n * @param activeElement\n * @param lastNode\n * @returns {number|string|undefined|*}\n */\nexport var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) {\n var cnt = innerNodes.length;\n var firstFocus = innerNodes[0];\n var lastFocus = innerNodes[cnt - 1];\n var isOnGuard = isGuard(activeElement);\n // 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 var indexDiff = activeIndex - lastIndex;\n var firstNodeIndex = outerNodes.indexOf(firstFocus);\n var lastNodeIndex = outerNodes.indexOf(lastFocus);\n var correctedNodes = correctNodes(outerNodes);\n var correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1;\n var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex);\n var returnFirstNode = pickFocusable(innerNodes, 0);\n var returnLastNode = pickFocusable(innerNodes, cnt - 1);\n // new focus\n if (activeIndex === -1 || lastNodeInside === -1) {\n return NEW_FOCUS;\n }\n // old focus\n if (!indexDiff && lastNodeInside >= 0) {\n return lastNodeInside;\n }\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","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,YASZC,EAAW,SAAUC,EAAYC,EAAYC,EAAeC,GACnE,IAAIC,EAAMJ,EAAWK,OACjBC,EAAaN,EAAW,GACxBO,EAAYP,EAAWI,EAAM,GAC7BI,EAAYC,EAAQP,GAExB,KAAIA,GAAiBF,EAAWU,QAAQR,IAAkB,GAA1D,CAGA,IAAIS,OAAgCC,IAAlBV,EAA8BD,EAAWS,QAAQR,IAAkB,EACjFW,EAAYV,EAAWF,EAAWS,QAAQP,GAAYQ,EACtDG,EAAiBX,EAAWH,EAAWU,QAAQP,IAAa,EAC5DY,EAAYJ,EAAcE,EAC1BG,EAAiBf,EAAWS,QAAQJ,GACpCW,EAAgBhB,EAAWS,QAAQH,GACnCW,EAAiBC,EAAalB,GAE9BmB,QADmCR,IAAlBV,EAA8BgB,EAAeR,QAAQR,IAAkB,IACjDC,EAAWe,EAAeR,QAAQP,GAAYQ,GACrFU,EAAkBC,EAActB,EAAY,GAC5CuB,EAAiBD,EAActB,EAAYI,EAAM,GAErD,OAAqB,IAAjBO,IAA0C,IAApBG,EA9BP,aAkCdC,GAAaD,GAAkB,EACzBA,EAGPH,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"}
@@ -1,2 +1,2 @@
1
- import{toArray as r}from"./array.js";import{isVisibleCached as t,notHiddenInput as n}from"./is.js";import{orderByTabIndex as o}from"./tabOrder.js";import{getFocusables as i,getParentAutofocusables as f}from"./tabUtils.js";var u=function(o,i){return r(o).filter((function(r){return t(i,r)})).filter((function(r){return n(r)}))},e=function(r,t,n){return o(u(i(r,n),t),!0,n)},m=function(r,t){return o(u(i(r),t),!1)},c=function(r,t){return u(f(r),t)};export{u as filterFocusable,m as getAllTabbableNodes,e as getTabbableNodes,c as parentAutofocusables};
1
+ import{toArray as r}from"./array.js";import{isVisibleCached as t,notHiddenInput as n,isAutoFocusAllowedCached as o}from"./is.js";import{orderByTabIndex as i}from"./tabOrder.js";import{getFocusables as e,getParentAutofocusables as u}from"./tabUtils.js";var f=function(o,i){return r(o).filter((function(r){return t(i,r)})).filter((function(r){return n(r)}))},c=function(t,n){return void 0===n&&(n=new Map),r(t).filter((function(r){return o(n,r)}))},a=function(r,t,n){return i(f(e(r,n),t),!0,n)},s=function(r,t){return i(f(e(r),t),!1)},m=function(r,t){return f(u(r),t)},l=function(t,n){return(t.shadowRoot?l(t.shadowRoot,n):Object.getPrototypeOf(t).contains.call(t,n))||r(t.children).some((function(r){return l(r,n)}))};export{l as contains,c as filterAutoFocusable,f as filterFocusable,s as getAllTabbableNodes,a as getTabbableNodes,m as parentAutofocusables};
2
2
  //# sourceMappingURL=DOMutils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DOMutils.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js"],"sourcesContent":["import { toArray } from './array';\nimport { isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\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 getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\nexport var getAllTabbableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n"],"names":["filterFocusable","nodes","visibilityCache","toArray","filter","node","isVisibleCached","notHiddenInput","getTabbableNodes","topNodes","withGuards","orderByTabIndex","getFocusables","getAllTabbableNodes","parentAutofocusables","topNode","getParentAutofocusables"],"mappings":"8NAIU,IAACA,EAAkB,SAAUC,EAAOC,GAC1C,OAAOC,EAAQF,GACVG,QAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,MACjED,QAAO,SAAUC,GAAQ,OAAOE,EAAeF,OAE7CG,EAAmB,SAAUC,EAAUP,EAAiBQ,GAC/D,OAAOC,EAAgBX,EAAgBY,EAAcH,EAAUC,GAAaR,IAAkB,EAAMQ,IAE7FG,EAAsB,SAAUJ,EAAUP,GACjD,OAAOS,EAAgBX,EAAgBY,EAAcH,GAAWP,IAAkB,IAE3EY,EAAuB,SAAUC,EAASb,GACjD,OAAOF,EAAgBgB,EAAwBD,GAAUb"}
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 * only tabbable ones\n * (but with guards which would be ignored)\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * actually anything \"focusable\", not only tabbable\n * (without guards, as long as they are not expected to be focused)\n */\nexport var getAllTabbableNodes = 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 return ((scope.shadowRoot\n ? contains(scope.shadowRoot, element)\n : Object.getPrototypeOf(scope).contains.call(scope, element)) ||\n toArray(scope.children).some(function (child) { return contains(child, element); }));\n};\n"],"names":["filterFocusable","nodes","visibilityCache","toArray","filter","node","isVisibleCached","notHiddenInput","filterAutoFocusable","cache","Map","isAutoFocusAllowedCached","getTabbableNodes","topNodes","withGuards","orderByTabIndex","getFocusables","getAllTabbableNodes","parentAutofocusables","topNode","getParentAutofocusables","contains","scope","element","shadowRoot","Object","getPrototypeOf","call","children","some","child"],"mappings":"4PASU,IAACA,EAAkB,SAAUC,EAAOC,GAC1C,OAAOC,EAAQF,GACVG,QAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,MACjED,QAAO,SAAUC,GAAQ,OAAOE,EAAeF,OAE7CG,EAAsB,SAAUP,EAAOQ,GAE9C,YADc,IAAVA,IAAoBA,EAAQ,IAAIC,KAC7BP,EAAQF,GAAOG,QAAO,SAAUC,GAAQ,OAAOM,EAAyBF,EAAOJ,OAM/EO,EAAmB,SAAUC,EAAUX,EAAiBY,GAC/D,OAAOC,EAAgBf,EAAgBgB,EAAcH,EAAUC,GAAaZ,IAAkB,EAAMY,IAM7FG,EAAsB,SAAUJ,EAAUX,GACjD,OAAOa,EAAgBf,EAAgBgB,EAAcH,GAAWX,IAAkB,IAO3EgB,EAAuB,SAAUC,EAASjB,GACjD,OAAOF,EAAgBoB,EAAwBD,GAAUjB,IAKlDmB,EAAW,SAAUC,EAAOC,GACnC,OAASD,EAAME,WACTH,EAASC,EAAME,WAAYD,GAC3BE,OAAOC,eAAeJ,GAAOD,SAASM,KAAKL,EAAOC,KACpDpB,EAAQmB,EAAMM,UAAUC,MAAK,SAAUC,GAAS,OAAOT,EAASS,EAAOP"}
@@ -1 +1 @@
1
- {"version":3,"file":"all-affected.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/all-affected.js"],"sourcesContent":["import { FOCUS_DISABLED, FOCUS_GROUP } from '../constants';\nimport { asArray, toArray } from './array';\nvar filterNested = function (nodes) {\n var contained = new Set();\n var l = nodes.length;\n for (var i = 0; i < l; i += 1) {\n for (var j = i + 1; j < l; j += 1) {\n var position = nodes[i].compareDocumentPosition(nodes[j]);\n if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {\n contained.add(j);\n }\n if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) {\n contained.add(i);\n }\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\nexport var getAllAffectedNodes = function (node) {\n var nodes = asArray(node);\n return nodes.filter(Boolean).reduce(function (acc, currentNode) {\n var group = currentNode.getAttribute(FOCUS_GROUP);\n acc.push.apply(acc, (group\n ? filterNested(toArray(getTopParent(currentNode).querySelectorAll(\"[\".concat(FOCUS_GROUP, \"=\\\"\").concat(group, \"\\\"]:not([\").concat(FOCUS_DISABLED, \"=\\\"disabled\\\"])\"))))\n : [currentNode]));\n return acc;\n }, []);\n};\n"],"names":["getTopParent","node","parentNode","getAllAffectedNodes","asArray","filter","Boolean","reduce","acc","currentNode","group","getAttribute","FOCUS_GROUP","push","apply","nodes","contained","Set","l","length","i","j","position","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","add","DOCUMENT_POSITION_CONTAINS","_","index","has","filterNested","toArray","querySelectorAll","concat","FOCUS_DISABLED"],"mappings":"oHAEA,IAgBIA,EAAe,SAAUC,GACzB,OAAOA,EAAKC,WAAaF,EAAaC,EAAKC,YAAcD,GAElDE,EAAsB,SAAUF,GAEvC,OADYG,EAAQH,GACPI,OAAOC,SAASC,QAAO,SAAUC,EAAKC,GAC/C,IAAIC,EAAQD,EAAYE,aAAaC,GAIrC,OAHAJ,EAAIK,KAAKC,MAAMN,EAAME,EAvBV,SAAUK,GAGzB,IAFA,IAAIC,EAAY,IAAIC,IAChBC,EAAIH,EAAMI,OACLC,EAAI,EAAGA,EAAIF,EAAGE,GAAK,EACxB,IAAK,IAAIC,EAAID,EAAI,EAAGC,EAAIH,EAAGG,GAAK,EAAG,CAC/B,IAAIC,EAAWP,EAAMK,GAAGG,wBAAwBR,EAAMM,KACjDC,EAAWE,KAAKC,gCAAkC,GACnDT,EAAUU,IAAIL,IAEbC,EAAWE,KAAKG,4BAA8B,GAC/CX,EAAUU,IAAIN,GAI1B,OAAOL,EAAMV,QAAO,SAAUuB,EAAGC,GAAS,OAAQb,EAAUc,IAAID,MAUtDE,CAAaC,EAAQhC,EAAaS,GAAawB,iBAAiB,IAAIC,OAAOtB,EAAa,MAAOsB,OAAOxB,EAAO,YAAawB,OAAOC,EAAgB,oBACjJ,CAAC1B,IACAD,IACR"}
1
+ {"version":3,"file":"all-affected.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/all-affected.js"],"sourcesContent":["import { FOCUS_DISABLED, FOCUS_GROUP } from '../constants';\nimport { asArray, toArray } from './array';\n/**\n * in case of multiple nodes nested inside each other\n * keeps only top ones\n * this is O(nlogn)\n * @param nodes\n * @returns {*}\n */\nvar filterNested = function (nodes) {\n var contained = new Set();\n var l = nodes.length;\n for (var i = 0; i < l; i += 1) {\n for (var j = i + 1; j < l; j += 1) {\n var position = nodes[i].compareDocumentPosition(nodes[j]);\n /* eslint-disable no-bitwise */\n if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {\n contained.add(j);\n }\n if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) {\n contained.add(i);\n }\n /* eslint-enable */\n }\n }\n return nodes.filter(function (_, index) { return !contained.has(index); });\n};\n/**\n * finds top most parent for a node\n * @param node\n * @returns {*}\n */\nvar getTopParent = function (node) {\n return node.parentNode ? getTopParent(node.parentNode) : node;\n};\n/**\n * returns all \"focus containers\" inside a given node\n * @param node\n * @returns {T}\n */\nexport var getAllAffectedNodes = function (node) {\n var nodes = asArray(node);\n return nodes.filter(Boolean).reduce(function (acc, currentNode) {\n var group = currentNode.getAttribute(FOCUS_GROUP);\n acc.push.apply(acc, (group\n ? filterNested(toArray(getTopParent(currentNode).querySelectorAll(\"[\".concat(FOCUS_GROUP, \"=\\\"\").concat(group, \"\\\"]:not([\").concat(FOCUS_DISABLED, \"=\\\"disabled\\\"])\"))))\n : [currentNode]));\n return acc;\n }, []);\n};\n"],"names":["getTopParent","node","parentNode","getAllAffectedNodes","asArray","filter","Boolean","reduce","acc","currentNode","group","getAttribute","FOCUS_GROUP","push","apply","nodes","contained","Set","l","length","i","j","position","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","add","DOCUMENT_POSITION_CONTAINS","_","index","has","filterNested","toArray","querySelectorAll","concat","FOCUS_DISABLED"],"mappings":"oHASA,IAuBIA,EAAe,SAAUC,GACzB,OAAOA,EAAKC,WAAaF,EAAaC,EAAKC,YAAcD,GAOlDE,EAAsB,SAAUF,GAEvC,OADYG,EAAQH,GACPI,OAAOC,SAASC,QAAO,SAAUC,EAAKC,GAC/C,IAAIC,EAAQD,EAAYE,aAAaC,GAIrC,OAHAJ,EAAIK,KAAKC,MAAMN,EAAME,EAnCV,SAAUK,GAGzB,IAFA,IAAIC,EAAY,IAAIC,IAChBC,EAAIH,EAAMI,OACLC,EAAI,EAAGA,EAAIF,EAAGE,GAAK,EACxB,IAAK,IAAIC,EAAID,EAAI,EAAGC,EAAIH,EAAGG,GAAK,EAAG,CAC/B,IAAIC,EAAWP,EAAMK,GAAGG,wBAAwBR,EAAMM,KAEjDC,EAAWE,KAAKC,gCAAkC,GACnDT,EAAUU,IAAIL,IAEbC,EAAWE,KAAKG,4BAA8B,GAC/CX,EAAUU,IAAIN,GAK1B,OAAOL,EAAMV,QAAO,SAAUuB,EAAGC,GAAS,OAAQb,EAAUc,IAAID,MAoBtDE,CAAaC,EAAQhC,EAAaS,GAAawB,iBAAiB,IAAIC,OAAOtB,EAAa,MAAOsB,OAAOxB,EAAO,YAAawB,OAAOC,EAAgB,oBACjJ,CAAC1B,IACAD,IACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/array.js"],"sourcesContent":["export var toArray = function (a) {\n var ret = Array(a.length);\n for (var i = 0; i < a.length; ++i) {\n ret[i] = a[i];\n }\n return ret;\n};\nexport var asArray = function (a) { return (Array.isArray(a) ? a : [a]); };\n"],"names":["toArray","a","ret","Array","length","i","asArray","isArray"],"mappings":"AAAU,IAACA,EAAU,SAAUC,GAE3B,IADA,IAAIC,EAAMC,MAAMF,EAAEG,QACTC,EAAI,EAAGA,EAAIJ,EAAEG,SAAUC,EAC5BH,EAAIG,GAAKJ,EAAEI,GAEf,OAAOH,GAEAI,EAAU,SAAUL,GAAK,OAAQE,MAAMI,QAAQN,GAAKA,EAAI,CAACA"}
1
+ {"version":3,"file":"array.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/array.js"],"sourcesContent":["/*\nIE11 support\n */\nexport var toArray = function (a) {\n var ret = Array(a.length);\n for (var i = 0; i < a.length; ++i) {\n ret[i] = a[i];\n }\n return ret;\n};\nexport var asArray = function (a) { return (Array.isArray(a) ? a : [a]); };\n"],"names":["toArray","a","ret","Array","length","i","asArray","isArray"],"mappings":"AAGU,IAACA,EAAU,SAAUC,GAE3B,IADA,IAAIC,EAAMC,MAAMF,EAAEG,QACTC,EAAI,EAAGA,EAAIJ,EAAEG,SAAUC,EAC5BH,EAAIG,GAAKJ,EAAEI,GAEf,OAAOH,GAEAI,EAAU,SAAUL,GAAK,OAAQE,MAAMI,QAAQN,GAAKA,EAAI,CAACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"correctFocus.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js"],"sourcesContent":["import { isRadioElement } from './is';\nvar findSelectedRadio = function (node, nodes) {\n return nodes\n .filter(isRadioElement)\n .filter(function (el) { return el.name === node.name; })\n .filter(function (el) { return el.checked; })[0] || node;\n};\nexport var correctNode = function (node, nodes) {\n if (isRadioElement(node) && node.name) {\n return findSelectedRadio(node, nodes);\n }\n return node;\n};\nexport var correctNodes = function (nodes) {\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n return nodes.filter(function (node) { return resultSet.has(node); });\n};\n"],"names":["correctNode","node","nodes","isRadioElement","name","filter","el","checked","findSelectedRadio","correctNodes","resultSet","Set","forEach","add","has"],"mappings":"yCACA,IAMWA,EAAc,SAAUC,EAAMC,GACrC,OAAIC,EAAeF,IAASA,EAAKG,KAPb,SAAUH,EAAMC,GACpC,OAAOA,EACFG,OAAOF,GACPE,QAAO,SAAUC,GAAM,OAAOA,EAAGF,OAASH,EAAKG,QAC/CC,QAAO,SAAUC,GAAM,OAAOA,EAAGC,WAAY,IAAMN,EAI7CO,CAAkBP,EAAMC,GAE5BD,GAEAQ,EAAe,SAAUP,GAChC,IAAIQ,EAAY,IAAIC,IAEpB,OADAT,EAAMU,SAAQ,SAAUX,GAAQ,OAAOS,EAAUG,IAAIb,EAAYC,EAAMC,OAChEA,EAAMG,QAAO,SAAUJ,GAAQ,OAAOS,EAAUI,IAAIb"}
1
+ {"version":3,"file":"correctFocus.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js"],"sourcesContent":["import { isRadioElement } from './is';\nvar findSelectedRadio = function (node, nodes) {\n return nodes\n .filter(isRadioElement)\n .filter(function (el) { return el.name === node.name; })\n .filter(function (el) { return el.checked; })[0] || node;\n};\nexport var correctNode = function (node, nodes) {\n if (isRadioElement(node) && node.name) {\n return findSelectedRadio(node, nodes);\n }\n return node;\n};\n/**\n * giving a set of radio inputs keeps only selected (tabbable) ones\n * @param nodes\n */\nexport var correctNodes = function (nodes) {\n // IE11 has no Set(array) constructor\n var resultSet = new Set();\n nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); });\n // using filter to support IE11\n return nodes.filter(function (node) { return resultSet.has(node); });\n};\n"],"names":["correctNode","node","nodes","isRadioElement","name","filter","el","checked","findSelectedRadio","correctNodes","resultSet","Set","forEach","add","has"],"mappings":"yCACA,IAMWA,EAAc,SAAUC,EAAMC,GACrC,OAAIC,EAAeF,IAASA,EAAKG,KAPb,SAAUH,EAAMC,GACpC,OAAOA,EACFG,OAAOF,GACPE,QAAO,SAAUC,GAAM,OAAOA,EAAGF,OAASH,EAAKG,QAC/CC,QAAO,SAAUC,GAAM,OAAOA,EAAGC,WAAY,IAAMN,EAI7CO,CAAkBP,EAAMC,GAE5BD,GAMAQ,EAAe,SAAUP,GAEhC,IAAIQ,EAAY,IAAIC,IAGpB,OAFAT,EAAMU,SAAQ,SAAUX,GAAQ,OAAOS,EAAUG,IAAIb,EAAYC,EAAMC,OAEhEA,EAAMG,QAAO,SAAUJ,GAAQ,OAAOS,EAAUI,IAAIb"}
@@ -1,2 +1,2 @@
1
- var e=function(){return document.activeElement?document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement:void 0};export{e as getActiveElement};
1
+ var e=function(t){return t.activeElement?t.activeElement.shadowRoot?e(t.activeElement.shadowRoot):t.activeElement:void 0},t=function(){return document.activeElement?document.activeElement.shadowRoot?e(document.activeElement.shadowRoot):document.activeElement:void 0};export{t as getActiveElement};
2
2
  //# sourceMappingURL=getActiveElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getActiveElement.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["export var getActiveElement = function () {\n return (document.activeElement\n ? document.activeElement.shadowRoot\n ? document.activeElement.shadowRoot.activeElement\n : document.activeElement\n : undefined);\n};\n"],"names":["getActiveElement","document","activeElement","shadowRoot","undefined"],"mappings":"AAAU,IAACA,EAAmB,WAC1B,OAAQC,SAASC,cACXD,SAASC,cAAcC,WACnBF,SAASC,cAAcC,WAAWD,cAClCD,SAASC,mBACbE"}
1
+ {"version":3,"file":"getActiveElement.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["var getNestedShadowActiveElement = function (shadowRoot) {\n return shadowRoot.activeElement\n ? shadowRoot.activeElement.shadowRoot\n ? getNestedShadowActiveElement(shadowRoot.activeElement.shadowRoot)\n : shadowRoot.activeElement\n : undefined;\n};\n/**\n * returns active element from document or from nested shadowdoms\n */\nexport var getActiveElement = function () {\n return (document.activeElement\n ? document.activeElement.shadowRoot\n ? getNestedShadowActiveElement(document.activeElement.shadowRoot)\n : document.activeElement\n : undefined); // eslint-disable-next-line @typescript-eslint/no-explicit-any\n};\n"],"names":["getNestedShadowActiveElement","shadowRoot","activeElement","undefined","getActiveElement","document"],"mappings":"AAAA,IAAIA,EAA+B,SAAUC,GACzC,OAAOA,EAAWC,cACZD,EAAWC,cAAcD,WACrBD,EAA6BC,EAAWC,cAAcD,YACtDA,EAAWC,mBACfC,GAKCC,EAAmB,WAC1B,OAAQC,SAASH,cACXG,SAASH,cAAcD,WACnBD,EAA6BK,SAASH,cAAcD,YACpDI,SAASH,mBACbC"}
@@ -1,2 +1,2 @@
1
- var e=function(e,n){return!e||e===document||e&&e.nodeType===Node.DOCUMENT_NODE||!function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var n=window.getComputedStyle(e,null);return!(!n||!n.getPropertyValue||"none"!==n.getPropertyValue("display")&&"hidden"!==n.getPropertyValue("visibility"))}(e)&&n(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode)},n=function(t,r){var o=t.get(r);if(void 0!==o)return o;var u=e(r,n.bind(void 0,t));return t.set(r,u),u},t=function(e){return e.dataset},r=function(e){return"BUTTON"===e.tagName},o=function(e){return"INPUT"===e.tagName},u=function(e){return o(e)&&"radio"===e.type},i=function(e){return!((o(e)||r(e))&&("hidden"===e.type||e.disabled)||e.ariaDisabled)},d=function(e){var n;return Boolean(e&&(null===(n=t(e))||void 0===n?void 0:n.focusGuard))},a=function(e){return!d(e)},N=function(e){return Boolean(e)};export{t as getDataset,N as isDefined,d as isGuard,r as isHTMLButtonElement,o as isHTMLInputElement,a as isNotAGuard,u as isRadioElement,n as isVisibleCached,i as notHiddenInput};
1
+ import{FOCUS_NO_AUTOFOCUS as n}from"../constants.js";var t=function(n){return n.parentNode&&n.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?n.parentNode.host:n.parentNode},e=function(n){return n===document||n&&n.nodeType===Node.DOCUMENT_NODE},r=function(n,r){return!n||e(n)||!function(n){if(n.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(n,null);return!(!t||!t.getPropertyValue||"none"!==t.getPropertyValue("display")&&"hidden"!==t.getPropertyValue("visibility"))}(n)&&r(t(n))},o=function(n,t){var e=n.get(t);if(void 0!==e)return e;var u=r(t,o.bind(void 0,n));return n.set(t,u),u},u=function(n,r){var o=n.get(r);if(void 0!==o)return o;var i=function(n,r){return!(n&&!e(n))||!!N(n)&&r(t(n))}(r,u.bind(void 0,n));return n.set(r,i),i},i=function(n){return n.dataset},d=function(n){return"BUTTON"===n.tagName},a=function(n){return"INPUT"===n.tagName},f=function(n){return a(n)&&"radio"===n.type},c=function(n){return!((a(n)||d(n))&&("hidden"===n.type||n.disabled))},N=function(t){var e=t.getAttribute(n);return![!0,"true",""].includes(e)},p=function(n){var t;return Boolean(n&&(null===(t=i(n))||void 0===t?void 0:t.focusGuard))},v=function(n){return!p(n)},l=function(n){return Boolean(n)};export{i as getDataset,N as isAutoFocusAllowed,u as isAutoFocusAllowedCached,l as isDefined,p as isGuard,d as isHTMLButtonElement,a as isHTMLInputElement,v as isNotAGuard,f as isRadioElement,o as isVisibleCached,c as notHiddenInput};
2
2
  //# sourceMappingURL=is.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["var isElementHidden = function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar isVisibleUncached = function (node, checkParent) {\n return !node ||\n node === document ||\n (node && node.nodeType === Node.DOCUMENT_NODE) ||\n (!isElementHidden(node) &&\n checkParent(node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ?\n node.parentNode.host\n : node.parentNode));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled)) &&\n !node.ariaDisabled;\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n"],"names":["isVisibleUncached","node","checkParent","document","nodeType","Node","DOCUMENT_NODE","ELEMENT_NODE","computedStyle","window","getComputedStyle","getPropertyValue","isElementHidden","parentNode","DOCUMENT_FRAGMENT_NODE","host","isVisibleCached","visibilityCache","cached","get","undefined","result","bind","set","getDataset","dataset","isHTMLButtonElement","tagName","isHTMLInputElement","isRadioElement","type","notHiddenInput","disabled","ariaDisabled","isGuard","_a","Boolean","focusGuard","isNotAGuard","isDefined","x"],"mappings":"AAAA,IAU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],"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 isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(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","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,YAEXK,EAAY,SAAUN,GAEtB,OAAOA,IAASO,UAAaP,GAAQA,EAAKE,WAAaC,KAAKK,eAE5DC,EAAoB,SAAUT,EAAMU,GACpC,OAAQV,GAAQM,EAAUN,KAxBR,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,eAc1DC,CAAgBhB,IAASU,EAAYX,EAAcC,KAEjFiB,EAAkB,SAAUC,EAAiBl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push(r),r.parentNode&&o(r.parentNode,n),n},t=function(r,n){for(var t=o(r),e=o(n),f=0;f<t.length;f+=1){var i=t[f];if(e.indexOf(i)>=0)return i}return!1},e=function(r,o,e){var f=n(r),i=n(o),u=f[0],a=!1;return i.filter(Boolean).forEach((function(r){a=t(a||r,r)||a,e.filter(Boolean).forEach((function(r){var n=t(u,r);n&&(a=!a||n.contains(a)?n:t(n,a))}))})),a},f=function(n,o){return n.reduce((function(n,t){return n.concat(r(t,o))}),[])};export{f as allParentAutofocusables,t as getCommonParent,e as getTopCommonParent};
1
+ import{contains as r,parentAutofocusables as n}from"./DOMutils.js";import{asArray as o}from"./array.js";var t=function(r,n){return void 0===n&&(n=[]),n.push(r),r.parentNode&&t(r.parentNode.host||r.parentNode,n),n},e=function(r,n){for(var o=t(r),e=t(n),f=0;f<o.length;f+=1){var u=o[f];if(e.indexOf(u)>=0)return u}return!1},f=function(n,t,f){var u=o(n),a=o(t),i=u[0],c=!1;return a.filter(Boolean).forEach((function(n){c=e(c||n,n)||c,f.filter(Boolean).forEach((function(n){var o=e(i,n);o&&(c=!c||r(o,c)?o:e(o,c))}))})),c},u=function(r,o){return r.reduce((function(r,t){return r.concat(n(t,o))}),[])};export{u as allParentAutofocusables,e as getCommonParent,f as getTopCommonParent};
2
2
  //# sourceMappingURL=parenting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parenting.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js"],"sourcesContent":["import { parentAutofocusables } from './DOMutils';\nimport { asArray } from './array';\nvar getParents = function (node, parents) {\n if (parents === void 0) { parents = []; }\n parents.push(node);\n if (node.parentNode) {\n getParents(node.parentNode, parents);\n }\n return parents;\n};\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n for (var i = 0; i < parentsA.length; i += 1) {\n var currentParent = parentsA[i];\n if (parentsB.indexOf(currentParent) >= 0) {\n return currentParent;\n }\n }\n return false;\n};\nexport var getTopCommonParent = function (baseActiveElement, leftEntry, rightEntries) {\n var activeElements = asArray(baseActiveElement);\n var leftEntries = asArray(leftEntry);\n var activeElement = activeElements[0];\n var topCommon = false;\n leftEntries.filter(Boolean).forEach(function (entry) {\n topCommon = getCommonParent(topCommon || entry, entry) || topCommon;\n rightEntries.filter(Boolean).forEach(function (subEntry) {\n var common = getCommonParent(activeElement, subEntry);\n if (common) {\n if (!topCommon || common.contains(topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n return topCommon;\n};\nexport var allParentAutofocusables = function (entries, visibilityCache) {\n return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []);\n};\n"],"names":["getParents","node","parents","push","parentNode","getCommonParent","nodeA","nodeB","parentsA","parentsB","i","length","currentParent","indexOf","getTopCommonParent","baseActiveElement","leftEntry","rightEntries","activeElements","asArray","leftEntries","activeElement","topCommon","filter","Boolean","forEach","entry","subEntry","common","contains","allParentAutofocusables","entries","visibilityCache","reduce","acc","concat","parentAutofocusables"],"mappings":"0FAEA,IAAIA,EAAa,SAAUC,EAAMC,GAM7B,YALgB,IAAZA,IAAsBA,EAAU,IACpCA,EAAQC,KAAKF,GACTA,EAAKG,YACLJ,EAAWC,EAAKG,WAAYF,GAEzBA,GAEAG,EAAkB,SAAUC,EAAOC,GAG1C,IAFA,IAAIC,EAAWR,EAAWM,GACtBG,EAAWT,EAAWO,GACjBG,EAAI,EAAGA,EAAIF,EAASG,OAAQD,GAAK,EAAG,CACzC,IAAIE,EAAgBJ,EAASE,GAC7B,GAAID,EAASI,QAAQD,IAAkB,EACnC,OAAOA,EAGf,OAAO,GAEAE,EAAqB,SAAUC,EAAmBC,EAAWC,GACpE,IAAIC,EAAiBC,EAAQJ,GACzBK,EAAcD,EAAQH,GACtBK,EAAgBH,EAAe,GAC/BI,GAAY,EAehB,OAdAF,EAAYG,OAAOC,SAASC,SAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,SAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaM,EAAOC,SAASP,GAClBM,EAGAvB,EAAgBuB,EAAQN,UAK7CA,GAEAQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKjC,GAAQ,OAAOiC,EAAIC,OAAOC,EAAqBnC,EAAM+B,MAAsB"}
1
+ {"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,GAQAI,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,EAGf,OAAO,GAEAE,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,UAM7CA,GAOAQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKlC,GAAQ,OAAOkC,EAAIC,OAAOC,EAAqBpC,EAAMgC,MAAsB"}
@@ -1,2 +1,2 @@
1
- import{FOCUS_AUTO as r}from"../constants.js";import{toArray as t}from"./array.js";import{tabbables as n}from"./tabbables.js";var e=n.join(","),o="".concat(e,", [data-focus-guard]"),c=function(r,n){return r.reduce((function(r,c){return r.concat(t(c.querySelectorAll(n?o:e)),c.parentNode?t(c.parentNode.querySelectorAll(e)).filter((function(r){return r===c})):[])}),[])},u=function(n){var e=n.querySelectorAll("[".concat(r,"]"));return t(e).map((function(r){return c([r])})).reduce((function(r,t){return r.concat(t)}),[])};export{c as getFocusables,u as getParentAutofocusables};
1
+ import{FOCUS_AUTO as r}from"../constants.js";import{toArray as n}from"./array.js";import{tabbables as t}from"./tabbables.js";var o=t.join(","),e="".concat(o,", [data-focus-guard]"),c=function(r,t){var u;return n((null===(u=r.shadowRoot)||void 0===u?void 0:u.children)||r.children).reduce((function(r,n){return r.concat(n.matches(t?e:o)?[n]:[],c(n))}),[])},u=function(r,t){return r.reduce((function(r,e){return r.concat(c(e,t),e.parentNode?n(e.parentNode.querySelectorAll(o)).filter((function(r){return r===e})):[])}),[])},a=function(t){var o=t.querySelectorAll("[".concat(r,"]"));return n(o).map((function(r){return u([r])})).reduce((function(r,n){return r.concat(n)}),[])};export{u as getFocusables,a as getParentAutofocusables};
2
2
  //# sourceMappingURL=tabUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabUtils.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n return acc.concat(toArray(parent.querySelectorAll(withGuards ? queryGuardTabbables : queryTabbables)), parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n"],"names":["queryTabbables","tabbables","join","queryGuardTabbables","concat","getFocusables","parents","withGuards","reduce","acc","parent","toArray","querySelectorAll","parentNode","filter","node","getParentAutofocusables","parentFocus","FOCUS_AUTO","map","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBACzCK,EAAgB,SAAUC,EAASC,GAC1C,OAAOD,EAAQE,QAAO,SAAUC,EAAKC,GACjC,OAAOD,EAAIL,OAAOO,EAAQD,EAAOE,iBAAiBL,EAAaJ,EAAsBH,IAAkBU,EAAOG,WACxGF,EAAQD,EAAOG,WAAWD,iBAAiBZ,IAAiBc,QAAO,SAAUC,GAAQ,OAAOA,IAASL,KACrG,MACP,KAEIM,EAA0B,SAAUN,GAC3C,IAAIO,EAAcP,EAAOE,iBAAiB,IAAIR,OAAOc,EAAY,MACjE,OAAOP,EAAQM,GACVE,KAAI,SAAUJ,GAAQ,OAAOV,EAAc,CAACU,OAC5CP,QAAO,SAAUC,EAAKW,GAAS,OAAOX,EAAIL,OAAOgB,KAAW"}
1
+ {"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 var _a;\n return toArray(((_a = parent.shadowRoot) === null || _a === void 0 ? void 0 : _a.children) || parent.children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n getFocusablesWithShadowDom(parent, withGuards), \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","_a","toArray","shadowRoot","children","reduce","acc","child","matches","getFocusables","parents","parentNode","querySelectorAll","filter","node","getParentAutofocusables","parentFocus","FOCUS_AUTO","map","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBAChDK,EAA6B,SAAUC,EAAQC,GAC/C,IAAIC,EACJ,OAAOC,GAAsC,QAA5BD,EAAKF,EAAOI,kBAA+B,IAAPF,OAAgB,EAASA,EAAGG,WAAaL,EAAOK,UAAUC,QAAO,SAAUC,EAAKC,GACjI,OAAOD,EAAIT,OAAOU,EAAMC,QAAQR,EAAaJ,EAAsBH,GAAkB,CAACc,GAAS,GAAIT,EAA2BS,MAC/H,KAEIE,EAAgB,SAAUC,EAASV,GAC1C,OAAOU,EAAQL,QAAO,SAAUC,EAAKP,GACjC,OAAOO,EAAIT,OAEXC,EAA2BC,EAAQC,GAEnCD,EAAOY,WACDT,EAAQH,EAAOY,WAAWC,iBAAiBnB,IAAiBoB,QAAO,SAAUC,GAAQ,OAAOA,IAASf,KACrG,MACP,KAMIgB,EAA0B,SAAUhB,GAC3C,IAAIiB,EAAcjB,EAAOa,iBAAiB,IAAIf,OAAOoB,EAAY,MACjE,OAAOf,EAAQc,GACVE,KAAI,SAAUJ,GAAQ,OAAOL,EAAc,CAACK,OAC5CT,QAAO,SAAUC,EAAKa,GAAS,OAAOb,EAAIT,OAAOsB,KAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"tabbables.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabbables.js"],"sourcesContent":["export var tabbables = [\n 'button:enabled',\n 'select:enabled',\n 'textarea:enabled',\n 'input:enabled',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[tabindex]',\n '[contenteditable]',\n '[autofocus]',\n];\n"],"names":["tabbables"],"mappings":"AAAU,IAACA,EAAY,CACnB,iBACA,iBACA,mBACA,gBACA,UACA,aACA,UACA,SACA,SACA,QACA,kBACA,kBACA,aACA,oBACA"}
1
+ {"version":3,"file":"tabbables.js","sources":["../../../../../../../node_modules/focus-lock/dist/es2015/utils/tabbables.js"],"sourcesContent":["/**\n * list of the object to be considered as focusable\n */\nexport var tabbables = [\n 'button:enabled',\n 'select:enabled',\n 'textarea:enabled',\n 'input:enabled',\n // elements with explicit roles will also use explicit tabindex\n // '[role=\"button\"]',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[tabindex]',\n '[contenteditable]',\n '[autofocus]',\n];\n"],"names":["tabbables"],"mappings":"AAGU,IAACA,EAAY,CACnB,iBACA,iBACA,mBACA,gBAGA,UACA,aACA,UACA,SACA,SACA,QACA,kBACA,kBACA,aACA,oBACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Trap.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport moveFocusInside, { focusInside, focusIsHidden, getFocusabledIn } from 'focus-lock';\nimport { deferAction } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\n\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\n\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\n\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\n\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\n\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\n\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\n\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\n\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n\n do {\n var item = allNodes[i];\n\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n // we will tab to the next element\n return;\n }\n\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\n\nvar extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\n\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n // with cross frame return true for any value\n return Boolean(focusWasOutsideWindow);\n } // in other case return only of focus went a while aho\n\n\n return focusWasOutsideWindow === 'meanwhile';\n};\n\nvar checkInHost = function checkInHost(check, el, boundary) {\n return el // find host equal to active element and check nested active element\n && (el.host === check && (!el.activeElement || boundary.contains(el.activeElement)) // dive up\n || el.parentNode && checkInHost(check, el.parentNode, boundary));\n};\n\nvar withinHost = function withinHost(activeElement, workingArea) {\n return workingArea.some(function (area) {\n return checkInHost(activeElement, area, area);\n });\n};\n\nvar activateTrap = function activateTrap() {\n var result = false;\n\n if (lastActiveTrap) {\n var _lastActiveTrap = lastActiveTrap,\n observed = _lastActiveTrap.observed,\n persistentFocus = _lastActiveTrap.persistentFocus,\n autoFocus = _lastActiveTrap.autoFocus,\n shards = _lastActiveTrap.shards,\n crossFrame = _lastActiveTrap.crossFrame,\n focusOptions = _lastActiveTrap.focusOptions;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n var activeElement = document && document.activeElement;\n\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !( // active element is \"inside\" working area\n focusInside(workingArea) || // check for shadow-dom contained elements\n activeElement && withinHost(activeElement, workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n // Check if blur() exists, which is missing on certain elements on IE\n if (activeElement.blur) {\n activeElement.blur();\n }\n\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus, {\n focusOptions: focusOptions\n });\n lastPortaledElement = {};\n }\n }\n\n focusWasOutsideWindow = false;\n lastActiveFocus = document && document.activeElement;\n }\n }\n\n if (document) {\n var newActiveElement = document && document.activeElement;\n var allNodes = getFocusabledIn(workingArea);\n var focusedIndex = allNodes.map(function (_ref) {\n var node = _ref.node;\n return node;\n }).indexOf(newActiveElement);\n\n if (focusedIndex > -1) {\n // remove old focus\n allNodes.filter(function (_ref2) {\n var guard = _ref2.guard,\n node = _ref2.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref3) {\n var node = _ref3.node;\n return node.removeAttribute('tabIndex');\n });\n autoGuard(focusedIndex, allNodes.length, +1, allNodes);\n autoGuard(focusedIndex, -1, -1, allNodes);\n }\n }\n }\n }\n\n return result;\n};\n\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n // prevent scroll jump\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\n\nvar onFocus = function onFocus(event) {\n // detect portal\n var source = event.target;\n var currentNode = event.currentTarget;\n\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\n\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\n\nvar FocusTrap = function FocusTrap(_ref4) {\n var children = _ref4.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\n\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\n\nvar onWindowBlur = function onWindowBlur() {\n focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction\n\n setTimeout(function () {\n focusWasOutsideWindow = 'meanwhile';\n }, 0);\n};\n\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('blur', onWindowBlur);\n};\n\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('blur', onWindowBlur);\n};\n\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref5) {\n var disabled = _ref5.disabled;\n return !disabled;\n });\n}\n\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation(); // return focus only of last trap was removed\n\n if (!traps.filter(function (_ref6) {\n var id = _ref6.id;\n return id === lastTrap.id;\n }).length) {\n // allow defer is no other trap is awaiting restore\n lastTrap.returnFocus(!trap);\n }\n }\n\n if (trap) {\n lastActiveFocus = null;\n\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation();\n }\n\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n} // bind medium\n\n\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb({\n moveFocusInside: moveFocusInside,\n focusInside: focusInside\n });\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["isFreeFocus","document","activeElement","body","focusIsHidden","lastActiveTrap","lastActiveFocus","lastPortaledElement","focusWasOutsideWindow","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","extractRef","ref","current","checkInHost","check","el","boundary","host","contains","parentNode","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","focusOptions","workingNode","portaledElement","workingArea","concat","map","filter","Boolean","whiteList","focusWhitelisted","focusInside","some","area","withinHost","blur","focus","moveFocusInside","newActiveElement","getFocusabledIn","focusedIndex","_ref","indexOf","_ref2","forEach","_ref3","removeAttribute","length","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowBlur","setTimeout","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","observerNode","mediumBlur","assignMedium","mediumEffect","cb","FocusTrap","withSideEffect","propsList","_ref5","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref6","returnFocus","onActivation","removeEventListener"],"mappings":"kgBAOA,IAIIA,EAAc,WAChB,OAJOC,UAAYA,SAASC,gBAAkBD,SAASE,MAI/BC,KAGtBC,EAAiB,KACjBC,EAAkB,KAClBC,EAAsB,KACtBC,GAAwB,EAExBC,EAAmB,WACrB,OAAO,GAkBT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AiBA,EACjBN,YAAaA,OAGjB,IAAeyC,EAAAC,GAtDf,SAA4BC,GAC1B,OAAOA,EAAU/C,QAAO,SAAUgD,GAEhC,OADeA,EAAMC,eAKzB,SAAmCC,GACjC,IAAIC,EAAOD,EAAME,OAAO,GAAG,GAEvBD,IAAS/F,IArBbJ,SAASqG,iBAAiB,UAAWhC,GACrCrE,SAASqG,iBAAiB,WAAY5B,GACtC6B,OAAOD,iBAAiB,OAAQrB,IAuBhC,IAAIuB,EAAWnG,EACXoG,EAAWD,GAAYJ,GAAQA,EAAKM,KAAOF,EAASE,GACxDrG,EAAiB+F,EAEbI,IAAaC,IACfD,EAASG,iBAEJR,EAAMlD,QAAO,SAAU2D,GAE1B,OADSA,EAAMF,KACDF,EAASE,MACtBrC,QAEDmC,EAASK,aAAaT,IAItBA,GACF9F,EAAkB,KAEbmG,GAAYD,EAASlE,WAAa8D,EAAK9D,UAC1C8D,EAAKU,eAGP5E,IACAyC,EAAYzC,KA3CdjC,SAAS8G,oBAAoB,UAAWzC,GACxCrE,SAAS8G,oBAAoB,WAAYrC,GACzC6B,OAAOQ,oBAAoB,OAAQ9B,GA4CjC3E,EAAkB,QAaPyF,EA1FI,WACjB,OAAO"}
1
+ {"version":3,"file":"Trap.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["/* eslint-disable no-mixed-operators */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport moveFocusInside, { focusInside, focusIsHidden, getFocusabledIn } from 'focus-lock';\nimport { deferAction } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\n\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\n\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\n\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\n\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\n\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\n\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\n\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\n\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n\n do {\n var item = allNodes[i];\n\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n // we will tab to the next element\n return;\n }\n\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\n\nvar extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\n\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n // with cross frame return true for any value\n return Boolean(focusWasOutsideWindow);\n } // in other case return only of focus went a while aho\n\n\n return focusWasOutsideWindow === 'meanwhile';\n};\n\nvar checkInHost = function checkInHost(check, el, boundary) {\n return el && ( // find host equal to active element and check nested active element\n el.host === check && (!el.activeElement || boundary.contains(el.activeElement)) // dive up\n || el.parentNode && checkInHost(check, el.parentNode, boundary));\n};\n\nvar withinHost = function withinHost(activeElement, workingArea) {\n return workingArea.some(function (area) {\n return checkInHost(activeElement, area, area);\n });\n};\n\nvar activateTrap = function activateTrap() {\n var result = false;\n\n if (lastActiveTrap) {\n var _lastActiveTrap = lastActiveTrap,\n observed = _lastActiveTrap.observed,\n persistentFocus = _lastActiveTrap.persistentFocus,\n autoFocus = _lastActiveTrap.autoFocus,\n shards = _lastActiveTrap.shards,\n crossFrame = _lastActiveTrap.crossFrame,\n focusOptions = _lastActiveTrap.focusOptions;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n var activeElement = document && document.activeElement;\n\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !( // active element is \"inside\" working area\n focusInside(workingArea) || // check for shadow-dom contained elements\n activeElement && withinHost(activeElement, workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n // Check if blur() exists, which is missing on certain elements on IE\n if (activeElement.blur) {\n activeElement.blur();\n }\n\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus, {\n focusOptions: focusOptions\n });\n lastPortaledElement = {};\n }\n }\n\n focusWasOutsideWindow = false;\n lastActiveFocus = document && document.activeElement;\n }\n }\n\n if (document) {\n var newActiveElement = document && document.activeElement;\n var allNodes = getFocusabledIn(workingArea);\n var focusedIndex = allNodes.map(function (_ref) {\n var node = _ref.node;\n return node;\n }).indexOf(newActiveElement);\n\n if (focusedIndex > -1) {\n // remove old focus\n allNodes.filter(function (_ref2) {\n var guard = _ref2.guard,\n node = _ref2.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref3) {\n var node = _ref3.node;\n return node.removeAttribute('tabIndex');\n });\n autoGuard(focusedIndex, allNodes.length, +1, allNodes);\n autoGuard(focusedIndex, -1, -1, allNodes);\n }\n }\n }\n }\n\n return result;\n};\n\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n // prevent scroll jump\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\n\nvar onFocus = function onFocus(event) {\n // detect portal\n var source = event.target;\n var currentNode = event.currentTarget;\n\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\n\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\n\nvar FocusTrap = function FocusTrap(_ref4) {\n var children = _ref4.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\n\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\n\nvar onWindowBlur = function onWindowBlur() {\n focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction\n\n setTimeout(function () {\n focusWasOutsideWindow = 'meanwhile';\n }, 0);\n};\n\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('blur', onWindowBlur);\n};\n\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('blur', onWindowBlur);\n};\n\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref5) {\n var disabled = _ref5.disabled;\n return !disabled;\n });\n}\n\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation(); // return focus only of last trap was removed\n\n if (!traps.filter(function (_ref6) {\n var id = _ref6.id;\n return id === lastTrap.id;\n }).length) {\n // allow defer is no other trap is awaiting restore\n lastTrap.returnFocus(!trap);\n }\n }\n\n if (trap) {\n lastActiveFocus = null;\n\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation();\n }\n\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n} // bind medium\n\n\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb({\n moveFocusInside: moveFocusInside,\n focusInside: focusInside\n });\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["isFreeFocus","document","activeElement","body","focusIsHidden","lastActiveTrap","lastActiveFocus","lastPortaledElement","focusWasOutsideWindow","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","extractRef","ref","current","checkInHost","check","el","boundary","host","contains","parentNode","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","focusOptions","workingNode","portaledElement","workingArea","concat","map","filter","Boolean","whiteList","focusWhitelisted","focusInside","some","area","withinHost","blur","focus","moveFocusInside","newActiveElement","getFocusabledIn","focusedIndex","_ref","indexOf","_ref2","forEach","_ref3","removeAttribute","length","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowBlur","setTimeout","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","observerNode","mediumBlur","assignMedium","mediumEffect","cb","FocusTrap","withSideEffect","propsList","_ref5","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref6","returnFocus","onActivation","removeEventListener"],"mappings":"kgBAQA,IAIIA,EAAc,WAChB,OAJOC,UAAYA,SAASC,gBAAkBD,SAASE,MAI/BC,KAGtBC,EAAiB,KACjBC,EAAkB,KAClBC,EAAsB,KACtBC,GAAwB,EAExBC,EAAmB,WACrB,OAAO,GAkBT,SAASC,EAAUC,EAAYC,EAAKC,EAAMC,GACxC,IAAIC,EAAY,KACZC,EAAIL,EAER,EAAG,CACD,IAAIM,EAAOH,EAASE,GAEpB,GAAIC,EAAKC,MACHD,EAAKE,KAAKC,QAAQC,iBACpBN,EAAYE,OAET,KAAIA,EAAKK,SAQd,MAPA,GAAIN,IAAML,EAER,OAGFI,EAAY,aAINC,GAAKH,KAAUD,GAErBG,IACFA,EAAUI,KAAKI,SAAW,GAI9B,IAAIC,EAAa,SAAoBC,GACnC,OAAOA,GAAO,YAAaA,EAAMA,EAAIC,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GACxDrG,EAAiB+F,EAEbI,IAAaC,IACfD,EAASG,iBAEJR,EAAMlD,QAAO,SAAU2D,GAE1B,OADSA,EAAMF,KACDF,EAASE,MACtBrC,QAEDmC,EAASK,aAAaT,IAItBA,GACF9F,EAAkB,KAEbmG,GAAYD,EAASlE,WAAa8D,EAAK9D,UAC1C8D,EAAKU,eAGP5E,IACAyC,EAAYzC,KA3CdjC,SAAS8G,oBAAoB,UAAWzC,GACxCrE,SAAS8G,oBAAoB,WAAYrC,GACzC6B,OAAOQ,oBAAoB,OAAQ9B,GA4CjC3E,EAAkB,QAaPyF,EA1FI,WACjB,OAAO"}
@@ -0,0 +1,2 @@
1
+ import*as e from"react";function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},t.apply(this,arguments)}const i=new Map,n=new WeakMap;let r,s=0;function o(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(i=e.root,i?(n.has(i)||(s+=1,n.set(i,s.toString())),n.get(i)):"0"):e[t]}`;var i})).toString()}function h(e,t,n={},s=r){if(void 0===window.IntersectionObserver&&void 0!==s){const i=e.getBoundingClientRect();return t(s,{isIntersecting:s,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:h,observer:l,elements:a}=function(e){let t=o(e),n=i.get(t);if(!n){const r=new Map;let s;const o=new IntersectionObserver((t=>{t.forEach((t=>{var i;const n=t.isIntersecting&&s.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=n),null==(i=r.get(t.target))||i.forEach((e=>{e(n,t)}))}))}),e);s=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},i.set(t,n)}return n}(n);let c=a.get(e)||[];return a.has(e)||a.set(e,c),c.push(t),l.observe(e),function(){c.splice(c.indexOf(t),1),0===c.length&&(a.delete(e),l.unobserve(e)),0===a.size&&(l.disconnect(),i.delete(h))}}const l=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function a(e){return"function"!=typeof e.children}class c extends e.Component{constructor(e){super(e),this.node=null,this._unobserveCb=null,this.handleNode=e=>{this.node&&(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()},this.handleChange=(e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),a(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)},this.state={inView:!!e.initialInView,entry:void 0}}componentDidUpdate(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:i,trackVisibility:n,delay:r,fallbackInView:s}=this.props;this._unobserveCb=h(this.node,this.handleChange,{threshold:e,root:t,rootMargin:i,trackVisibility:n,delay:r},s)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!a(this.props)){const{inView:e,entry:t}=this.state;return this.props.children({inView:e,entry:t,ref:this.handleNode})}const i=this.props,{children:n,as:r}=i,s=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(i,l);return e.createElement(r||"div",t({ref:this.handleNode},s),n)}}export{c as InView,h as observe};
2
+ //# sourceMappingURL=react-intersection-observer.modern.mjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-intersection-observer.modern.mjs.js","sources":["../../../../node_modules/react-intersection-observer/react-intersection-observer.modern.mjs"],"sourcesContent":["import * as React from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nconst observerMap = new Map();\nconst RootIds = new WeakMap();\nlet rootId = 0;\nlet unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(key => options[key] !== undefined).map(key => {\n return `${key}_${key === 'root' ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n let id = optionsToId(options);\n let instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n const elements = new Map();\n let thresholds;\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n const inView = entry.isIntersecting && thresholds.some(threshold => entry.intersectionRatio >= threshold); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(callback => {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n const {\n id,\n observer,\n elements\n } = createObserver(options); // Register the callback listener for this element\n\n let callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements.delete(element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\nconst _excluded = [\"children\", \"as\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `<InView>` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView>\r\n {({ inView, ref, entry }) => (\r\n <div ref={ref}>\r\n <h2>{`Header inside viewport ${inView}.`}</h2>\r\n </div>\r\n )}\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the `<InView />`, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `<InView>` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\r\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nclass InView extends React.Component {\n constructor(props) {\n super(props);\n this.node = null;\n this._unobserveCb = null;\n\n this.handleNode = node => {\n if (this.node) {\n // Clear the old observer, before we start observing a new element\n this.unobserve();\n\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n this.setState({\n inView: !!this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n this.node = node ? node : null;\n this.observeNode();\n };\n\n this.handleChange = (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n this.unobserve();\n }\n\n if (!isPlainChildren(this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n this.setState({\n inView,\n entry\n });\n }\n\n if (this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n this.props.onChange(inView, entry);\n }\n };\n\n this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n }\n\n componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n\n componentWillUnmount() {\n this.unobserve();\n this.node = null;\n }\n\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n }, fallbackInView);\n }\n\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n }\n\n render() {\n if (!isPlainChildren(this.props)) {\n const {\n inView,\n entry\n } = this.state;\n return this.props.children({\n inView,\n entry,\n ref: this.handleNode\n });\n }\n\n const _this$props = this.props,\n {\n children,\n as\n } = _this$props,\n props = _objectWithoutPropertiesLoose(_this$props, _excluded);\n\n return React.createElement(as || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n }\n\n}\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n * <div ref={ref}>\r\n * <h2>{`Header inside viewport ${inView}.`}</h2>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n const unobserve = React.useRef();\n const callback = React.useRef();\n const [state, setState] = React.useState({\n inView: !!initialInView\n }); // Store the onChange callback in a `ref`, so we can access the latest instance inside the `useCallback`.\n\n callback.current = onChange;\n const setRef = React.useCallback(node => {\n if (unobserve.current !== undefined) {\n unobserve.current();\n unobserve.current = undefined;\n } // Skip creating the observer\n\n\n if (skip) return;\n\n if (node) {\n unobserve.current = observe(node, (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n\n if (entry.isIntersecting && triggerOnce && unobserve.current) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve.current();\n unobserve.current = undefined;\n }\n }, {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n }, fallbackInView);\n }\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n /* eslint-disable-next-line */\n\n React.useEffect(() => {\n if (!unobserve.current && state.entry && !triggerOnce && !skip) {\n // If we don't have a ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n setState({\n inView: !!initialInView\n });\n }\n });\n const result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.modern.mjs.map\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","observerMap","Map","RootIds","WeakMap","unsupportedValue","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","id","observer","elements","instance","thresholds","entries","forEach","entry","_elements$get","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","delete","unobserve","size","disconnect","_excluded","isPlainChildren","props","children","InView","React","Component","constructor","super","node","_unobserveCb","handleNode","triggerOnce","skip","setState","initialInView","observeNode","handleChange","onChange","state","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","render","ref","_this$props","as","excluded","sourceKeys","_objectWithoutPropertiesLoose","createElement"],"mappings":"wBAEA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IAAK,IAAII,KAAOD,EACVN,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAQC,KAC/CL,EAAOK,GAAOD,EAAOC,IAK3B,OAAOL,GAGFH,EAASY,MAAMC,KAAMR,WAkB9B,MAAMS,EAAc,IAAIC,IAClBC,EAAU,IAAIC,QACpB,IACIC,EADAC,EAAS,EA+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AM,MAAOnG,EAAS,CAC/CiG,IAAKpF,KAAKqE,YACTT,GAAQC"}
@@ -1,16 +1,2 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
1
  var r=function(){return r=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},r.apply(this,arguments)};function e(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}function t(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}export{r as __assign,t as __makeTemplateObject,e as __rest};
16
2
  //# sourceMappingURL=tslib.es6.js.map