Unverified Commit 38c47a96 authored by lauriii's avatar lauriii
Browse files

Issue #3211606 by nod_, mherchel: Update Tabbable to version 5.2.0

(cherry picked from commit 4214cd75)
parent 422a704a
/*!
* tabbable 5.1.6
* tabbable 5.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.tabbable,r=e.tabbable={};t(r),r.noConflict=function(){return e.tabbable=n,r}}())}(this,(function(e){"use strict";var t=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],n=t.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,o=function(e,t,o){var i=Array.prototype.slice.apply(e.querySelectorAll(n));return t&&r.call(e,n)&&i.unshift(e),i=i.filter(o)},i=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},a=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},u=function(e){return"INPUT"===e.tagName},c=function(e){return function(e){return u(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||e.ownerDocument,r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},l=function(e){return!(e.disabled||function(e){return u(e)&&"hidden"===e.type}(e)||function(e){if("hidden"===getComputedStyle(e).visibility)return!0;var t=r.call(e,"details>summary:first-of-type")?e.parentElement:e;if(r.call(t,"details:not([open]) *"))return!0;for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(e))},d=function(e){return!(!l(e)||c(e)||i(e)<0)},f=t.concat("iframe").join(",");e.focusable=function(e,t){return o(e,(t=t||{}).includeContainer,l)},e.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==r.call(e,f)&&l(e)},e.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==r.call(e,n)&&d(e)},e.tabbable=function(e,t){var n=[],r=[];return o(e,(t=t||{}).includeContainer,d).forEach((function(e,t){var o=i(e);0===o?n.push(e):r.push({documentOrder:t,tabIndex:o,node:e})})),r.sort(a).map((function(e){return e.node})).concat(n)},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.tabbable,r=e.tabbable={};t(r),r.noConflict=function(){return e.tabbable=n,r}}())}(this,(function(e){"use strict";var t=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],n=t.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,o=function(e,t,o){var i=Array.prototype.slice.apply(e.querySelectorAll(n));return t&&r.call(e,n)&&i.unshift(e),i=i.filter(o)},i=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},a=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},u=function(e){return"INPUT"===e.tagName},l=function(e){return function(e){return u(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||e.ownerDocument,r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},c=function(e,t){return!(t.disabled||function(e){return u(e)&&"hidden"===e.type}(t)||function(e,t){if("hidden"===getComputedStyle(e).visibility)return!0;var n=r.call(e,"details>summary:first-of-type")?e.parentElement:e;if(r.call(n,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var o=e.getBoundingClientRect(),i=o.width,a=o.height;return 0===i&&0===a}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t))},d=function(e,t){return!(!c(e,t)||l(t)||i(t)<0)},f=t.concat("iframe").join(",");e.focusable=function(e,t){return o(e,(t=t||{}).includeContainer,c.bind(null,t))},e.isFocusable=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==r.call(e,f)&&c(t,e)},e.isTabbable=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==r.call(e,n)&&d(t,e)},e.tabbable=function(e,t){var n=[],r=[];return o(e,(t=t||{}).includeContainer,d.bind(null,t)).forEach((function(e,t){var o=i(e);0===o?n.push(e):r.push({documentOrder:t,tabIndex:o,node:e})})),r.sort(a).map((function(e){return e.node})).concat(n)},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{"version":3,"file":"index.umd.min.js","sources":["../src/index.js"],"sourcesContent":["const candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'details>summary:first-of-type',\n 'details',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst matches =\n typeof Element === 'undefined'\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getCandidates = function (el, includeContainer, filter) {\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\nconst isContentEditable = function (node) {\n return node.contentEditable === 'true';\n};\n\nconst getTabindex = function (node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);\n\n if (!isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n if (isContentEditable(node)) {\n return 0;\n }\n\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n if (\n (node.nodeName === 'AUDIO' ||\n node.nodeName === 'VIDEO' ||\n node.nodeName === 'DETAILS') &&\n node.getAttribute('tabindex') === null\n ) {\n return 0;\n }\n\n return node.tabIndex;\n};\n\nconst sortOrderedTabbables = function (a, b) {\n return a.tabIndex === b.tabIndex\n ? a.documentOrder - b.documentOrder\n : a.tabIndex - b.tabIndex;\n};\n\nconst isInput = function (node) {\n return node.tagName === 'INPUT';\n};\n\nconst isHiddenInput = function (node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nconst isDetailsWithSummary = function (node) {\n const r =\n node.tagName === 'DETAILS' &&\n Array.prototype.slice\n .apply(node.children)\n .some((child) => child.tagName === 'SUMMARY');\n return r;\n};\n\nconst getCheckedRadio = function (nodes, form) {\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nconst isTabbableRadio = function (node) {\n if (!node.name) {\n return true;\n }\n const radioScope = node.form || node.ownerDocument;\n\n const queryRadios = function (name) {\n return radioScope.querySelectorAll(\n 'input[type=\"radio\"][name=\"' + name + '\"]'\n );\n };\n\n let radioSet;\n if (\n typeof window !== 'undefined' &&\n typeof window.CSS !== 'undefined' &&\n typeof window.CSS.escape === 'function'\n ) {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(\n 'Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s',\n err.message\n );\n return false;\n }\n }\n\n const checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nconst isRadio = function (node) {\n return isInput(node) && node.type === 'radio';\n};\n\nconst isNonTabbableRadio = function (node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\nconst isHidden = function (node) {\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n\n const isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n const nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n\n while (node) {\n if (getComputedStyle(node).display === 'none') {\n return true;\n }\n node = node.parentElement;\n }\n\n return false;\n};\n\nconst isNodeMatchingSelectorFocusable = function (node) {\n if (\n node.disabled ||\n isHiddenInput(node) ||\n isHidden(node) ||\n /* For a details element with a summary, the summary element gets the focused */\n isDetailsWithSummary(node)\n ) {\n return false;\n }\n return true;\n};\n\nconst isNodeMatchingSelectorTabbable = function (node) {\n if (\n !isNodeMatchingSelectorFocusable(node) ||\n isNonTabbableRadio(node) ||\n getTabindex(node) < 0\n ) {\n return false;\n }\n return true;\n};\n\nconst tabbable = function (el, options) {\n options = options || {};\n\n const regularTabbables = [];\n const orderedTabbables = [];\n\n const candidates = getCandidates(\n el,\n options.includeContainer,\n isNodeMatchingSelectorTabbable\n );\n\n candidates.forEach(function (candidate, i) {\n const candidateTabindex = getTabindex(candidate);\n if (candidateTabindex === 0) {\n regularTabbables.push(candidate);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n node: candidate,\n });\n }\n });\n\n const tabbableNodes = orderedTabbables\n .sort(sortOrderedTabbables)\n .map((a) => a.node)\n .concat(regularTabbables);\n\n return tabbableNodes;\n};\n\nconst focusable = function (el, options) {\n options = options || {};\n\n const candidates = getCandidates(\n el,\n options.includeContainer,\n isNodeMatchingSelectorFocusable\n );\n\n return candidates;\n};\n\nconst isTabbable = function (node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(node);\n};\n\nconst focusableCandidateSelector = /* #__PURE__ */ candidateSelectors\n .concat('iframe')\n .join(',');\n\nconst isFocusable = function (node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(node);\n};\n\nexport { tabbable, focusable, isTabbable, isFocusable };\n"],"names":["candidateSelectors","candidateSelector","join","matches","Element","prototype","msMatchesSelector","webkitMatchesSelector","getCandidates","el","includeContainer","filter","candidates","Array","slice","apply","querySelectorAll","call","unshift","getTabindex","node","tabindexAttr","parseInt","getAttribute","isNaN","contentEditable","isContentEditable","nodeName","tabIndex","sortOrderedTabbables","a","b","documentOrder","isInput","tagName","isNonTabbableRadio","type","isRadio","name","radioSet","radioScope","form","ownerDocument","queryRadios","window","CSS","escape","err","console","error","message","checked","nodes","i","length","getCheckedRadio","isTabbableRadio","isNodeMatchingSelectorFocusable","disabled","isHiddenInput","getComputedStyle","visibility","nodeUnderDetails","parentElement","display","isHidden","children","some","child","isDetailsWithSummary","isNodeMatchingSelectorTabbable","focusableCandidateSelector","concat","options","Error","regularTabbables","orderedTabbables","forEach","candidate","candidateTabindex","push","sort","map"],"mappings":";;;;oUAAA,IAAMA,EAAqB,CACzB,QACA,SACA,WACA,UACA,SACA,aACA,kBACA,kBACA,mDACA,gCACA,WAEIC,EAAoCD,EAAmBE,KAAK,KAE5DC,EACe,oBAAZC,QACH,aACAA,QAAQC,UAAUF,SAClBC,QAAQC,UAAUC,mBAClBF,QAAQC,UAAUE,sBAElBC,EAAgB,SAAUC,EAAIC,EAAkBC,OAChDC,EAAaC,MAAMR,UAAUS,MAAMC,MACrCN,EAAGO,iBAAiBf,WAElBS,GAAoBP,EAAQc,KAAKR,EAAIR,IACvCW,EAAWM,QAAQT,GAErBG,EAAaA,EAAWD,OAAOA,IAQ3BQ,EAAc,SAAUC,OACtBC,EAAeC,SAASF,EAAKG,aAAa,YAAa,WAExDC,MAAMH,GAPa,SAAUD,SACF,SAAzBA,EAAKK,gBAYRC,CAAkBN,GACb,EASY,UAAlBA,EAAKO,UACc,UAAlBP,EAAKO,UACa,YAAlBP,EAAKO,UAC2B,OAAlCP,EAAKG,aAAa,YAKbH,EAAKQ,SAHH,EApBAP,GA0BLQ,EAAuB,SAAUC,EAAGC,UACjCD,EAAEF,WAAaG,EAAEH,SACpBE,EAAEE,cAAgBD,EAAEC,cACpBF,EAAEF,SAAWG,EAAEH,UAGfK,EAAU,SAAUb,SACA,UAAjBA,EAAKc,SAgERC,EAAqB,SAAUf,UAJrB,SAAUA,UACjBa,EAAQb,IAAuB,UAAdA,EAAKgB,KAItBC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AAUO,EAAIgE,UAGXjE,EACjBC,GAHFgE,EAAUA,GAAW,IAIX/D,iBACR+C,kBAoBgB,SAAUrC,OACvBA,QACG,IAAIsD,MAAM,2BAEqC,IAAnDvE,EAAQc,KAAKG,EAAMmD,IAGhBd,EAAgCrC,iBArBtB,SAAUA,OACtBA,QACG,IAAIsD,MAAM,2BAE4B,IAA1CvE,EAAQc,KAAKG,EAAMnB,IAGhBqE,EAA+BlD,eApDvB,SAAUX,EAAIgE,OAGvBE,EAAmB,GACnBC,EAAmB,UAENpE,EACjBC,GANFgE,EAAUA,GAAW,IAOX/D,iBACR4D,GAGSO,SAAQ,SAAUC,EAAWzB,OAChC0B,EAAoB5D,EAAY2D,GACZ,IAAtBC,EACFJ,EAAiBK,KAAKF,GAEtBF,EAAiBI,KAAK,CACpBhD,cAAeqB,EACfzB,SAAUmD,EACV3D,KAAM0D,OAKUF,EACnBK,KAAKpD,GACLqD,KAAI,SAACpD,UAAMA,EAAEV,QACboD,OAAOG"}
\ No newline at end of file
{"version":3,"file":"index.umd.min.js","sources":["../src/index.js"],"sourcesContent":["const candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'details>summary:first-of-type',\n 'details',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst matches =\n typeof Element === 'undefined'\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getCandidates = function (el, includeContainer, filter) {\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\nconst isContentEditable = function (node) {\n return node.contentEditable === 'true';\n};\n\nconst getTabindex = function (node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);\n\n if (!isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n if (isContentEditable(node)) {\n return 0;\n }\n\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n if (\n (node.nodeName === 'AUDIO' ||\n node.nodeName === 'VIDEO' ||\n node.nodeName === 'DETAILS') &&\n node.getAttribute('tabindex') === null\n ) {\n return 0;\n }\n\n return node.tabIndex;\n};\n\nconst sortOrderedTabbables = function (a, b) {\n return a.tabIndex === b.tabIndex\n ? a.documentOrder - b.documentOrder\n : a.tabIndex - b.tabIndex;\n};\n\nconst isInput = function (node) {\n return node.tagName === 'INPUT';\n};\n\nconst isHiddenInput = function (node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nconst isDetailsWithSummary = function (node) {\n const r =\n node.tagName === 'DETAILS' &&\n Array.prototype.slice\n .apply(node.children)\n .some((child) => child.tagName === 'SUMMARY');\n return r;\n};\n\nconst getCheckedRadio = function (nodes, form) {\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nconst isTabbableRadio = function (node) {\n if (!node.name) {\n return true;\n }\n const radioScope = node.form || node.ownerDocument;\n\n const queryRadios = function (name) {\n return radioScope.querySelectorAll(\n 'input[type=\"radio\"][name=\"' + name + '\"]'\n );\n };\n\n let radioSet;\n if (\n typeof window !== 'undefined' &&\n typeof window.CSS !== 'undefined' &&\n typeof window.CSS.escape === 'function'\n ) {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(\n 'Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s',\n err.message\n );\n return false;\n }\n }\n\n const checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nconst isRadio = function (node) {\n return isInput(node) && node.type === 'radio';\n};\n\nconst isNonTabbableRadio = function (node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\nconst isHidden = function (node, displayCheck) {\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n\n const isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n const nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n if (!displayCheck || displayCheck === 'full') {\n while (node) {\n if (getComputedStyle(node).display === 'none') {\n return true;\n }\n node = node.parentElement;\n }\n } else if (displayCheck === 'non-zero-area') {\n const { width, height } = node.getBoundingClientRect();\n return width === 0 && height === 0;\n }\n\n return false;\n};\n\nconst isNodeMatchingSelectorFocusable = function (options, node) {\n if (\n node.disabled ||\n isHiddenInput(node) ||\n isHidden(node, options.displayCheck) ||\n /* For a details element with a summary, the summary element gets the focused */\n isDetailsWithSummary(node)\n ) {\n return false;\n }\n return true;\n};\n\nconst isNodeMatchingSelectorTabbable = function (options, node) {\n if (\n !isNodeMatchingSelectorFocusable(options, node) ||\n isNonTabbableRadio(node) ||\n getTabindex(node) < 0\n ) {\n return false;\n }\n return true;\n};\n\nconst tabbable = function (el, options) {\n options = options || {};\n\n const regularTabbables = [];\n const orderedTabbables = [];\n\n const candidates = getCandidates(\n el,\n options.includeContainer,\n isNodeMatchingSelectorTabbable.bind(null, options)\n );\n\n candidates.forEach(function (candidate, i) {\n const candidateTabindex = getTabindex(candidate);\n if (candidateTabindex === 0) {\n regularTabbables.push(candidate);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n node: candidate,\n });\n }\n });\n\n const tabbableNodes = orderedTabbables\n .sort(sortOrderedTabbables)\n .map((a) => a.node)\n .concat(regularTabbables);\n\n return tabbableNodes;\n};\n\nconst focusable = function (el, options) {\n options = options || {};\n\n const candidates = getCandidates(\n el,\n options.includeContainer,\n isNodeMatchingSelectorFocusable.bind(null, options)\n );\n\n return candidates;\n};\n\nconst isTabbable = function (node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(options, node);\n};\n\nconst focusableCandidateSelector = /* #__PURE__ */ candidateSelectors\n .concat('iframe')\n .join(',');\n\nconst isFocusable = function (node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { tabbable, focusable, isTabbable, isFocusable };\n"],"names":["candidateSelectors","candidateSelector","join","matches","Element","prototype","msMatchesSelector","webkitMatchesSelector","getCandidates","el","includeContainer","filter","candidates","Array","slice","apply","querySelectorAll","call","unshift","getTabindex","node","tabindexAttr","parseInt","getAttribute","isNaN","contentEditable","isContentEditable","nodeName","tabIndex","sortOrderedTabbables","a","b","documentOrder","isInput","tagName","isNonTabbableRadio","type","isRadio","name","radioSet","radioScope","form","ownerDocument","queryRadios","window","CSS","escape","err","console","error","message","checked","nodes","i","length","getCheckedRadio","isTabbableRadio","isNodeMatchingSelectorFocusable","options","disabled","isHiddenInput","displayCheck","getComputedStyle","visibility","nodeUnderDetails","parentElement","getBoundingClientRect","width","height","display","isHidden","children","some","child","isDetailsWithSummary","isNodeMatchingSelectorTabbable","focusableCandidateSelector","concat","bind","Error","regularTabbables","orderedTabbables","forEach","candidate","candidateTabindex","push","sort","map"],"mappings":";;;;oUAAA,IAAMA,EAAqB,CACzB,QACA,SACA,WACA,UACA,SACA,aACA,kBACA,kBACA,mDACA,gCACA,WAEIC,EAAoCD,EAAmBE,KAAK,KAE5DC,EACe,oBAAZC,QACH,aACAA,QAAQC,UAAUF,SAClBC,QAAQC,UAAUC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+BjB,EAAStC,eArDhC,SAAUX,EAAIiD,OAGvBsB,EAAmB,GACnBC,EAAmB,UAENzE,EACjBC,GANFiD,EAAUA,GAAW,IAOXhD,iBACRiE,EAA+BG,KAAK,KAAMpB,IAGjCwB,SAAQ,SAAUC,EAAW9B,OAChC+B,EAAoBjE,EAAYgE,GACZ,IAAtBC,EACFJ,EAAiBK,KAAKF,GAEtBF,EAAiBI,KAAK,CACpBrD,cAAeqB,EACfzB,SAAUwD,EACVhE,KAAM+D,OAKUF,EACnBK,KAAKzD,GACL0D,KAAI,SAACzD,UAAMA,EAAEV,QACbyD,OAAOG"}
\ No newline at end of file
......@@ -776,10 +776,10 @@ sortable:
tabbable:
remote: https://github.com/focus-trap/tabbable
version: "5.1.6"
version: "5.2.0"
license:
name: MIT
url: https://raw.githubusercontent.com/focus-trap/tabbable/v5.1.6/LICENSE
url: https://raw.githubusercontent.com/focus-trap/tabbable/v5.2.0/LICENSE
gpl-compatible: true
js:
assets/vendor/tabbable/index.umd.min.js: { weight: -1, minified: true }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment