Unverified Commit daf10a06 authored by alexpott's avatar alexpott
Browse files

Issue #3113649 by bnjmnm, ayushmishra206, ilgnerfagundes, lauriii, nod_, xjm,...

Issue #3113649 by bnjmnm, ayushmishra206, ilgnerfagundes, lauriii, nod_, xjm, catch, alexpott, Kristen Pol: Remove drupal.tabbingmanager's jQueryUI dependency
parent cbccba94
......@@ -20,7 +20,8 @@
"Modernizr": true,
"Popper": true,
"Sortable": true,
"CKEDITOR": true
"CKEDITOR": true,
"tabbable": true
},
"settings": {
"react": {
......
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
;(function(root, factory) {
// https://github.com/umdjs/umd/blob/master/returnExports.js
if (typeof exports == 'object') {
// For Node.js.
module.exports = factory(root);
} else if (typeof define == 'function' && define.amd) {
// For AMD. Register as an anonymous module.
define([], factory.bind(root, root));
} else {
// For browser globals (not exposing the function separately).
factory(root);
}
}(typeof global != 'undefined' ? global : this, function(root) {
if (root.CSS && root.CSS.escape) {
return root.CSS.escape;
}
// https://drafts.csswg.org/cssom/#serialize-an-identifier
var cssEscape = function(value) {
if (arguments.length == 0) {
throw new TypeError('`CSS.escape` requires an argument.');
}
var string = String(value);
var length = string.length;
var index = -1;
var codeUnit;
var result = '';
var firstCodeUnit = string.charCodeAt(0);
while (++index < length) {
codeUnit = string.charCodeAt(index);
// Note: there’s no need to special-case astral symbols, surrogate
// pairs, or lone surrogates.
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
// (U+FFFD).
if (codeUnit == 0x0000) {
result += '\uFFFD';
continue;
}
if (
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
// U+007F, […]
(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
// If the character is the first character and is in the range [0-9]
// (U+0030 to U+0039), […]
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
// If the character is the second character and is in the range [0-9]
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
(
index == 1 &&
codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
firstCodeUnit == 0x002D
)
) {
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
result += '\\' + codeUnit.toString(16) + ' ';
continue;
}
if (
// If the character is the first character and is a `-` (U+002D), and
// there is no second character, […]
index == 0 &&
length == 1 &&
codeUnit == 0x002D
) {
result += '\\' + string.charAt(index);
continue;
}
// If the character is not handled by one of the above rules and is
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
// U+005A), or [a-z] (U+0061 to U+007A), […]
if (
codeUnit >= 0x0080 ||
codeUnit == 0x002D ||
codeUnit == 0x005F ||
codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
codeUnit >= 0x0041 && codeUnit <= 0x005A ||
codeUnit >= 0x0061 && codeUnit <= 0x007A
) {
// the character itself
result += string.charAt(index);
continue;
}
// Otherwise, the escaped character.
// https://drafts.csswg.org/cssom/#escape-a-character
result += '\\' + string.charAt(index);
}
return result;
};
if (!root.CSS) {
root.CSS = {};
}
root.CSS.escape = cssEscape;
return cssEscape;
}));
......@@ -31,7 +31,6 @@
"../position",
"../safe-active-element",
"../safe-blur",
"../tabbable",
"../unique-id",
"../version",
"../widget"
......
Drupal core uses the UMD build of tabbable.
To create this build:
Navigate to the root directory of the tabbable library.
Ensure that dependencies have been installed:
```
yarn install
```
Build files for production:
```
yarn build
```
This will create an index.umd.min.js file in dist/ that can be used in Drupal.
/*!
* tabbable 5.1.6
* @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})}));
//# 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":"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"}
\ No newline at end of file
......@@ -22,6 +22,16 @@ ckeditor:
js:
assets/vendor/ckeditor/ckeditor.js: { preprocess: false, minified: true }
css.escape:
remote: https://github.com/mathiasbynens/CSS.escape
version: "1.5.1"
license:
name: MIT
url: https://raw.githubusercontent.com/mathiasbynens/CSS.escape/v1.5.1/LICENSE-MIT.txt
gpl-compatible: true
js:
assets/vendor/css-escape/css.escape.js: { weight: -20 }
drupal:
version: VERSION
js:
......@@ -95,7 +105,6 @@ drupal.autocomplete:
assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/labels-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/widgets/menu-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/tabbable-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/data-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/disable-selection-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/escape-selector-min.js: { weight: -11.8, minified: true }
......@@ -126,6 +135,7 @@ drupal.autocomplete:
- core/drupal
- core/drupalSettings
- core/drupal.ajax
- core/tabbable.jquery.shim
drupal.array.find:
version: VERSION
......@@ -200,7 +210,6 @@ drupal.dialog:
assets/vendor/jquery.ui/ui/form-reset-mixin-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/labels-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/widgets/mouse-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/tabbable-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/data-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/disable-selection-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/form-min.js: { weight: -11.8, minified: true }
......@@ -235,6 +244,7 @@ drupal.dialog:
- core/drupalSettings
- core/drupal.debounce
- core/drupal.displace
- core/tabbable.jquery.shim
drupal.dialog.ajax:
version: VERSION
......@@ -338,37 +348,11 @@ drupal.tabbingmanager:
version: VERSION
js:
misc/tabbingmanager.js: {}
# The remaining JavaScript assets previously came from core/jquery.ui, a
# deprecated library. These assets are used to provide the :tabbable pseudo
# selector to core's JavaScript. It should be possible to remove them once
# :tabbable is provided via a non-jQuery UI based library.
# All weights are based on on the requirements defined within each file.
# @todo replace with solution found in https://drupal.org/node/3113649
assets/vendor/jquery.ui/ui/labels-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/tabbable-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/disable-selection-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/form-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/escape-selector-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/focusable-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/ie-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/jquery-1-7-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/keycode-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/plugin-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/safe-active-element-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/safe-blur-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/scroll-parent-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/unique-id-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/version-min.js: { weight: -11.9, minified: true }
# All CSS assets previously came from core/jquery.ui, a deprecated library.
# @todo replace with solution found in https://drupal.org/node/3113649
css:
component:
assets/vendor/jquery.ui/themes/base/core.css: { weight: -11.8 }
theme:
assets/vendor/jquery.ui/themes/base/theme.css: { weight: -11.8 }
dependencies:
- core/jquery
- core/drupal
- core/tabbable
- core/tabbable.jquery.shim
drupal.tabledrag:
version: VERSION
......@@ -528,7 +512,6 @@ jquery.ui:
gpl-compatible: true
js:
assets/vendor/jquery.ui/ui/labels-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/tabbable-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/data-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/disable-selection-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/escape-selector-min.js: { weight: -11.8, minified: true }
......@@ -550,6 +533,7 @@ jquery.ui:
assets/vendor/jquery.ui/themes/base/theme.css: { weight: -11.8 }
dependencies:
- core/jquery
- core/tabbable.jquery.shim
deprecated: &jquery_ui_unused_deprecated The "%library_id%" asset library is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3067969
jquery.ui.autocomplete:
......@@ -598,7 +582,6 @@ jquery.ui.dialog:
assets/vendor/jquery.ui/ui/form-reset-mixin-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/labels-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/widgets/mouse-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/tabbable-min.js: { weight: -11.7, minified: true }
assets/vendor/jquery.ui/ui/data-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/disable-selection-min.js: { weight: -11.8, minified: true }
assets/vendor/jquery.ui/ui/escape-selector-min.js: { weight: -11.8, minified: true }
......@@ -627,6 +610,7 @@ jquery.ui.dialog:
assets/vendor/jquery.ui/themes/base/theme.css: { weight: -11.8 }
dependencies:
- core/jquery
- core/tabbable.jquery.shim
deprecated: *jquery_ui_unused_deprecated
jquery.ui.draggable:
......@@ -754,6 +738,26 @@ sortable:
js:
assets/vendor/sortable/Sortable.min.js: { minified: true }
tabbable:
remote: https://github.com/focus-trap/tabbable
version: "5.1.6"
license:
name: MIT
url: https://raw.githubusercontent.com/focus-trap/tabbable/v5.1.6/LICENSE
gpl-compatible: true
js:
assets/vendor/tabbable/index.umd.min.js: { weight: -1, minified: true }
dependencies:
- core/css.escape
tabbable.jquery.shim:
version: VERSION
js:
misc/jquery.tabbable.shim.js: {}
dependencies:
- core/tabbable
- core/jquery
underscore:
remote: https://github.com/jashkenas/underscore
version: "1.11.0"
......
......@@ -50,6 +50,11 @@
// Turn the summary into a clickable link.
const $summary = this.$node.find('> summary');
// If this polyfill is in use, the browser does not recognize
// <summary> as a focusable element. The tabindex is set to -1 so the
// tabbable library does not incorrectly identify it as tabbable.
$summary.attr('tabindex', '-1');
$('<span class="details-summary-prefix visually-hidden"></span>')
.append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show'))
.prependTo($summary)
......
......@@ -24,6 +24,7 @@
$.extend(CollapsibleDetails.prototype, {
setupSummaryPolyfill: function setupSummaryPolyfill() {
var $summary = this.$node.find('> summary');
$summary.attr('tabindex', '-1');
$('<span class="details-summary-prefix visually-hidden"></span>').append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show')).prependTo($summary).after(document.createTextNode(' '));
$('<a class="details-title"></a>').attr('href', "#".concat(this.$node.attr('id'))).prepend($summary.contents()).appendTo($summary);
$summary.append(this.$summary).on('click', $.proxy(this.onSummaryClick, this));
......
/**
* @file
* Defines a backwards-compatible shim for the jQuery UI :tabbable selector.
*/
(($, Drupal, { isTabbable }) => {
$.extend($.expr[':'], {
tabbable(element) {
// The tabbable library considers the summary element tabbable, and also
// considers a details element without a summary tabbable. The jQuery UI
// :tabbable selector does not. This is due to those element types being
// inert in IE/Edge.
// @see https://allyjs.io/data-tables/focusable.html
if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') {
const tabIndex = element.getAttribute('tabIndex');
if (tabIndex === null || tabIndex < 0) {
return false;
}
}
return isTabbable(element);
},
});
})(jQuery, Drupal, window.tabbable);
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, _ref) {
var isTabbable = _ref.isTabbable;
$.extend($.expr[':'], {
tabbable: function tabbable(element) {
if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') {
var tabIndex = element.getAttribute('tabIndex');
if (tabIndex === null || tabIndex < 0) {
return false;
}
}
return isTabbable(element);
}
});
})(jQuery, Drupal, window.tabbable);
\ No newline at end of file
<?php
namespace Drupal\tabbable_shim_test\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* For testing the jQuery :tabbable shim as used in a dialog.
*/
class TabbableShimDialogIntegrationTestController extends ControllerBase {
/**
* Provides a page with the jQuery UI dialog library for testing .
*
* @return array
* The render array.
*/
public function build() {
return [
'container' => [
'#type' => 'container',
'#attributes' => [
'id' => 'tabbable-dialog-test-container',
],
],
'#attached' => [
'library' => ['core/jquery.ui.dialog'],
],
];
}
}
<?php
namespace Drupal\tabbable_shim_test\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* For testing the jQuery :tabbable shim.
*/
class TabbableShimTestController extends ControllerBase {
/**
* Provides a page with the tabbingManager library for testing :tabbable.
*
* @return array
* The render array.
*/
public function build() {
return [
'container' => [
'#type' => 'container',
'#attributes' => [
'id' => 'tabbable-test-container',
],
],
'#attached' => ['library' => ['core/drupal.tabbingmanager']],
];
}
}
name: 'Tabbable Shim Test'
type: module
description: 'Module for the testing the :tabbable selector shim'
package: Testing
version: VERSION
tabbable_test_page:
path: '/tabbable-shim-test'
defaults:
_controller: '\Drupal\tabbable_shim_test\Controller\TabbableShimTestController::build'
_title: 'Tabbable testing'
requirements:
_access: 'TRUE'
tabbable_dialog_integration_test_page:
path: '/tabbable-shim-dialog-integration-test'
defaults:
_controller: '\Drupal\tabbable_shim_test\Controller\TabbableShimDialogIntegrationTestController::build'
_title: 'Tabbable dialog integration testing'
requirements:
_access: 'TRUE'
......@@ -58,7 +58,6 @@ protected function setUp(): void {
$libraries_to_check = [
'drupal.autocomplete',
'drupal.dialog',
'drupal.tabbingmanager',
'jquery.ui',
'jquery.ui.autocomplete',
'jquery.ui.button',
......@@ -138,7 +137,6 @@ public function testProperlySetWeights() {
'core/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js',
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/widgets/menu-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/themes/base/autocomplete.css',
'core/assets/vendor/jquery.ui/themes/base/menu.css',
'core/assets/vendor/jquery.ui/ui/widgets/controlgroup-min.js',
......@@ -373,7 +371,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -407,7 +404,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -429,31 +425,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/widgets/dialog-min.js',
],
],
'drupal.tabbingmanager' => [
'library' => 'drupal.tabbingmanager',
'expected_css' => [
'core/assets/vendor/jquery.ui/themes/base/core.css',
'core/assets/vendor/jquery.ui/themes/base/theme.css',
],
'expected_js' => [
'core/assets/vendor/jquery.ui/ui/data-min.js',
'core/assets/vendor/jquery.ui/ui/disable-selection-min.js',
'core/assets/vendor/jquery.ui/ui/form-min.js',
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
'core/assets/vendor/jquery.ui/ui/focusable-min.js',
'core/assets/vendor/jquery.ui/ui/ie-min.js',
'core/assets/vendor/jquery.ui/ui/keycode-min.js',
'core/assets/vendor/jquery.ui/ui/plugin-min.js',
'core/assets/vendor/jquery.ui/ui/safe-active-element-min.js',
'core/assets/vendor/jquery.ui/ui/safe-blur-min.js',
],
],
'jquery.ui' => [
'library' => 'jquery.ui',
'expected_css' => [
......@@ -467,7 +438,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -494,7 +464,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -526,7 +495,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -560,7 +528,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -596,7 +563,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -624,7 +590,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -651,7 +616,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',
'core/assets/vendor/jquery.ui/ui/escape-selector-min.js',
......@@ -678,7 +642,6 @@ public function providerTestAssetLoading() {
'core/assets/vendor/jquery.ui/ui/labels-min.js',
'core/assets/vendor/jquery.ui/ui/jquery-1-7-min.js',
'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
'core/assets/vendor/jquery.ui/ui/tabbable-min.js',
'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
'core/assets/vendor/jquery.ui/ui/version-min.js',