Commit 89f6acb7 authored by catch's avatar catch
Browse files

Issue #3174884 by raman.b, alexpott, lauriii, zrpnr, nod_: Update yarn...

Issue #3174884 by raman.b, alexpott, lauriii, zrpnr, nod_: Update yarn dependencies for Drupal 9.1.0
parent da115f6c
......@@ -460,7 +460,13 @@
"selector-pseudo-element-colon-notation": null,
"shorthand-property-no-redundant-values": null,
"string-quotes": "double",
"unit-whitelist": ["deg", "em", "ex", "fr", "ms", "rem", "%", "s", "px", "vw", "vh"]
"unit-allowed-list": ["deg", "em", "ex", "fr", "ms", "rem", "%", "s", "px", "vw", "vh"],
"value-keyword-case": ["lower", {
"ignoreProperties": [
"--font-family",
"font-family"
]
}]
},
"ignoreFiles": [
"assets/vendor/**/*.css",
......
......@@ -6,4 +6,4 @@
* Released under the MIT license.
* http://jquery.org/license
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){return e.ui.focusable=function(i,t){var n,a,r,s,o,u=i.nodeName.toLowerCase();return"area"===u?(a=(n=i.parentNode).name,!(!i.href||!a||"map"!==n.nodeName.toLowerCase())&&((r=e("img[usemap='#"+a+"']")).length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(u)?(s=!i.disabled)&&(o=e(i).closest("fieldset")[0])&&(s=!o.disabled):s="a"===u&&i.href||t,s&&e(i).is(":visible")&&function(e){var i=e.css("visibility");for(;"inherit"===i;)e=e.parent(),i=e.css("visibility");return"hidden"!==i}(e(i)))},e.extend(e.expr[":"],{focusable:function(i){return e.ui.focusable(i,null!=e.attr(i,"tabindex"))}}),e.ui.focusable}));
\ No newline at end of file
!function(e){"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){return e.ui.focusable=function(i,t){var n,a,r,s,o,u=i.nodeName.toLowerCase();return"area"===u?(a=(n=i.parentNode).name,!(!i.href||!a||"map"!==n.nodeName.toLowerCase())&&((r=e("img[usemap='#"+a+"']")).length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(u)?(s=!i.disabled)&&(o=e(i).closest("fieldset")[0])&&(s=!o.disabled):s="a"===u&&i.href||t,s&&e(i).is(":visible")&&function(e){var i=e.css("visibility");for(;"inherit"===i;)i=(e=e.parent()).css("visibility");return"hidden"!==i}(e(i)))},e.extend(e.expr[":"],{focusable:function(i){return e.ui.focusable(i,null!=e.attr(i,"tabindex"))}}),e.ui.focusable}));
\ No newline at end of file
......@@ -3,7 +3,7 @@
* Attaches behaviors for Drupal's active link marking.
*/
(function(Drupal, drupalSettings) {
(function (Drupal, drupalSettings) {
/**
* Append is-active class.
*
......@@ -40,15 +40,15 @@
// Add language filtering.
selectors = [].concat(
// Links without any hreflang attributes (most of them).
originalSelectors.map(selector => `${selector}:not([hreflang])`),
originalSelectors.map((selector) => `${selector}:not([hreflang])`),
// Links with hreflang equals to the current language.
originalSelectors.map(
selector => `${selector}[hreflang="${path.currentLanguage}"]`,
(selector) => `${selector}[hreflang="${path.currentLanguage}"]`,
),
);
// Add query string selector for pagers, exposed filters.
selectors = selectors.map(current => current + querySelector);
selectors = selectors.map((current) => current + querySelector);
// Query the DOM.
const activeLinks = context.querySelectorAll(selectors.join(','));
......
......@@ -11,7 +11,7 @@
* included to provide Ajax capabilities.
*/
(function($, window, Drupal, drupalSettings) {
(function ($, window, Drupal, drupalSettings) {
/**
* Attaches the Ajax behavior to each Ajax form element.
*
......@@ -34,7 +34,7 @@
}
$(elementSettings.selector)
.once('drupal-ajax')
.each(function() {
.each(function () {
elementSettings.element = this;
elementSettings.base = base;
Drupal.ajax(elementSettings);
......@@ -42,14 +42,16 @@
}
// Load all Ajax behaviors specified in the settings.
Object.keys(settings.ajax || {}).forEach(base => loadAjaxBehavior(base));
Object.keys(settings.ajax || {}).forEach((base) =>
loadAjaxBehavior(base),
);
Drupal.ajax.bindAjaxLinks(document.body);
// This class means to submit the form to the action using Ajax.
$('.use-ajax-submit')
.once('ajax')
.each(function() {
.each(function () {
const elementSettings = {};
// Ajax submits specified in this manner automatically submit to the
......@@ -72,7 +74,7 @@
detach(context, settings, trigger) {
if (trigger === 'unload') {
Drupal.ajax.expired().forEach(instance => {
Drupal.ajax.expired().forEach((instance) => {
// Set this to null and allow garbage collection to reclaim
// the memory.
Drupal.ajax.instances[instance.instanceIndex] = null;
......@@ -95,7 +97,7 @@
* @param {string} customMessage
* The custom message.
*/
Drupal.AjaxError = function(xmlhttp, uri, customMessage) {
Drupal.AjaxError = function (xmlhttp, uri, customMessage) {
let statusCode;
let statusText;
let responseText;
......@@ -230,7 +232,7 @@
*
* @see Drupal.AjaxCommands
*/
Drupal.ajax = function(settings) {
Drupal.ajax = function (settings) {
if (arguments.length !== 1) {
throw new Error(
'Drupal.ajax() function must be called with one configuration object only',
......@@ -270,9 +272,9 @@
* @return {Array.<Drupal.Ajax>}
* The list of expired {@link Drupal.Ajax} objects.
*/
Drupal.ajax.expired = function() {
Drupal.ajax.expired = function () {
return Drupal.ajax.instances.filter(
instance =>
(instance) =>
instance &&
instance.element !== false &&
!document.body.contains(instance.element),
......@@ -285,7 +287,7 @@
* @param {HTMLElement} element
* Element to enable Ajax functionality for.
*/
Drupal.ajax.bindAjaxLinks = element => {
Drupal.ajax.bindAjaxLinks = (element) => {
// Bind Ajax behaviors to all items showing the class.
$(element)
.find('.use-ajax')
......@@ -375,7 +377,7 @@
* @param {Drupal.Ajax~elementSettings} elementSettings
* Settings for this Ajax object.
*/
Drupal.Ajax = function(base, element, elementSettings) {
Drupal.Ajax = function (base, element, elementSettings) {
const defaults = {
event: element ? 'mousedown' : null,
keypress: true,
......@@ -582,7 +584,7 @@
ajax.options.url += `${Drupal.ajax.WRAPPER_FORMAT}=${wrapper}`;
// Bind the ajaxSubmit function to the element event.
$(ajax.element).on(elementSettings.event, function(event) {
$(ajax.element).on(elementSettings.event, function (event) {
if (
!drupalSettings.ajaxTrustedUrl[ajax.url] &&
!Drupal.url.isLocal(ajax.url)
......@@ -600,7 +602,7 @@
// can be triggered through keyboard input as well as e.g. a mousedown
// action.
if (elementSettings.keypress) {
$(ajax.element).on('keypress', function(event) {
$(ajax.element).on('keypress', function (event) {
return ajax.keypressResponse(this, event);
});
}
......@@ -645,7 +647,7 @@
* pre-serialization fails, the Deferred will be returned in the rejected
* state.
*/
Drupal.Ajax.prototype.execute = function() {
Drupal.Ajax.prototype.execute = function () {
// Do not perform another ajax command if one is already in progress.
if (this.ajaxing) {
return;
......@@ -683,7 +685,7 @@
* @param {jQuery.Event} event
* Triggered event.
*/
Drupal.Ajax.prototype.keypressResponse = function(element, event) {
Drupal.Ajax.prototype.keypressResponse = function (element, event) {
// Create a synonym for this to reduce code confusion.
const ajax = this;
......@@ -719,7 +721,7 @@
* @param {jQuery.Event} event
* Triggered event.
*/
Drupal.Ajax.prototype.eventResponse = function(element, event) {
Drupal.Ajax.prototype.eventResponse = function (element, event) {
event.preventDefault();
event.stopPropagation();
......@@ -769,7 +771,7 @@
* @param {object} options
* jQuery.ajax options.
*/
Drupal.Ajax.prototype.beforeSerialize = function(element, options) {
Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
// Allow detaching behaviors to update field values before collecting them.
// This is only needed when field values are added to the POST data, so only
// when there is a form such that this.$form.ajaxSubmit() is used instead of
......@@ -804,7 +806,7 @@
* @param {object} options
* jQuery.ajax options.
*/
Drupal.Ajax.prototype.beforeSubmit = function(formValues, element, options) {
Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {
// This function is left empty to make it simple to override for modules
// that wish to add functionality here.
};
......@@ -817,7 +819,7 @@
* @param {object} options
* jQuery.ajax options.
*/
Drupal.Ajax.prototype.beforeSend = function(xmlhttprequest, options) {
Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) {
// For forms without file inputs, the jQuery Form plugin serializes the
// form values, and then calls jQuery's $.ajax() function, which invokes
// this handler. In this circumstance, options.extraData is never used. For
......@@ -877,7 +879,7 @@
* @return {string}
* The HTML markup for the throbber.
*/
Drupal.theme.ajaxProgressThrobber = message => {
Drupal.theme.ajaxProgressThrobber = (message) => {
// Build markup without adding extra white space since it affects rendering.
const messageMarkup =
typeof message === 'string'
......@@ -905,7 +907,7 @@
* @return {string}
* The HTML markup for the throbber.
*/
Drupal.theme.ajaxProgressMessage = message =>
Drupal.theme.ajaxProgressMessage = (message) =>
`<div class="message">${message}</div>`;
/**
......@@ -916,13 +918,13 @@
* @return {string}
* The HTML markup for the progress bar.
*/
Drupal.theme.ajaxProgressBar = $element =>
Drupal.theme.ajaxProgressBar = ($element) =>
$('<div class="ajax-progress ajax-progress-bar"></div>').append($element);
/**
* Sets the progress bar progress indicator.
*/
Drupal.Ajax.prototype.setProgressIndicatorBar = function() {
Drupal.Ajax.prototype.setProgressIndicatorBar = function () {
const progressBar = new Drupal.ProgressBar(
`ajax-progress-${this.element.id}`,
$.noop,
......@@ -948,7 +950,7 @@
/**
* Sets the throbber progress indicator.
*/
Drupal.Ajax.prototype.setProgressIndicatorThrobber = function() {
Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
this.progress.element = $(
Drupal.theme('ajaxProgressThrobber', this.progress.message),
);
......@@ -958,7 +960,7 @@
/**
* Sets the fullscreen progress indicator.
*/
Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function() {
Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () {
this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen'));
$('body').append(this.progress.element);
};
......@@ -971,7 +973,7 @@
* @param {number} status
* XMLHttpRequest status.
*/
Drupal.Ajax.prototype.success = function(response, status) {
Drupal.Ajax.prototype.success = function (response, status) {
// Remove the progress element.
if (this.progress.element) {
$(this.progress.element).remove();
......@@ -993,7 +995,7 @@
// Track if any command is altering the focus so we can avoid changing the
// focus set by the Ajax command.
let focusChanged = false;
Object.keys(response || {}).forEach(i => {
Object.keys(response || {}).forEach((i) => {
if (response[i].command && this.commands[response[i].command]) {
this.commands[response[i].command](this, response[i], status);
if (
......@@ -1056,7 +1058,7 @@
* Returns an object with `showEffect`, `hideEffect` and `showSpeed`
* properties.
*/
Drupal.Ajax.prototype.getEffect = function(response) {
Drupal.Ajax.prototype.getEffect = function (response) {
const type = response.effect || this.effect;
const speed = response.speed || this.speed;
......@@ -1088,7 +1090,7 @@
* @param {string} [customMessage]
* Extra message to print with the Ajax error.
*/
Drupal.Ajax.prototype.error = function(xmlhttprequest, uri, customMessage) {
Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
// Remove the progress element.
if (this.progress.element) {
$(this.progress.element).remove();
......@@ -1133,7 +1135,7 @@
Drupal.theme.ajaxWrapperNewContent = ($newContent, ajax, response) =>
(response.effect || ajax.effect) !== 'none' &&
$newContent.filter(
i =>
(i) =>
!(
// We can not consider HTML comments or whitespace text as separate
// roots, since they do not cause visual regression with effect.
......@@ -1161,7 +1163,7 @@
* @todo Add deprecation warning after it is possible. For more information
* see: https://www.drupal.org/project/drupal/issues/2973400
*/
Drupal.theme.ajaxWrapperMultipleRootElements = $elements =>
Drupal.theme.ajaxWrapperMultipleRootElements = ($elements) =>
$('<div></div>').append($elements);
/**
......@@ -1192,7 +1194,7 @@
*
* @constructor
*/
Drupal.AjaxCommands = function() {};
Drupal.AjaxCommands = function () {};
Drupal.AjaxCommands.prototype = {
/**
* Command to insert new content into the DOM.
......@@ -1297,7 +1299,7 @@
remove(ajax, response, status) {
const settings = response.settings || ajax.settings || drupalSettings;
$(response.selector)
.each(function() {
.each(function () {
Drupal.detachBehaviors(this, settings);
})
.remove();
......@@ -1426,7 +1428,7 @@
// Clean up drupalSettings.ajax.
if (ajaxSettings) {
Drupal.ajax.expired().forEach(instance => {
Drupal.ajax.expired().forEach((instance) => {
// If the Ajax object has been created through drupalSettings.ajax
// it will have a selector. When there is no selector the object
// has been initialized with a special class name picked up by the
......
......@@ -18,7 +18,7 @@
* });
*/
(function(Drupal, debounce) {
(function (Drupal, debounce) {
let liveElement;
const announcements = [];
......@@ -102,7 +102,7 @@
*
* @see http://www.w3.org/WAI/PF/aria-practices/#liveprops
*/
Drupal.announce = function(text, priority) {
Drupal.announce = function (text, priority) {
// Save the text and priority into a closure variable. Multiple simultaneous
// announcements will be concatenated and read in sequence.
announcements.push({
......
......@@ -3,7 +3,7 @@
* Autocomplete based on jQuery UI.
*/
(function($, Drupal) {
(function ($, Drupal) {
let autocomplete;
/**
......@@ -196,9 +196,7 @@
* jQuery collection of the ul element.
*/
function renderItem(ul, item) {
return $('<li>')
.append($('<a>').html(item.label))
.appendTo(ul);
return $('<li>').append($('<a>').html(item.label)).appendTo(ul);
}
/**
......@@ -226,7 +224,7 @@
firstCharacterBlacklist: blacklist || '',
});
// Use jQuery UI Autocomplete on the textfield.
$autocomplete.autocomplete(autocomplete.options).each(function() {
$autocomplete.autocomplete(autocomplete.options).each(function () {
$(this).data('ui-autocomplete')._renderItem =
autocomplete.options.renderItem;
});
......
......@@ -3,7 +3,7 @@
* Drupal's batch API.
*/
(function($, Drupal) {
(function ($, Drupal) {
/**
* Attaches the batch behavior to progress bars.
*
......
......@@ -3,7 +3,7 @@
* Defines checkbox theme functions.
*/
(Drupal => {
((Drupal) => {
/**
* Theme function for a checkbox.
*
......
......@@ -3,7 +3,7 @@
* Polyfill for HTML5 details elements.
*/
(function($, Modernizr, Drupal) {
(function ($, Modernizr, Drupal) {
/**
* The collapsible details object represents a single details element.
*
......@@ -140,11 +140,7 @@
* The targeted node as a jQuery object.
*/
const handleFragmentLinkClickOrHashChange = (e, $target) => {
$target
.parents('details')
.not('[open]')
.find('> summary')
.trigger('click');
$target.parents('details').not('[open]').find('> summary').trigger('click');
};
/**
......
......@@ -3,7 +3,7 @@
* Polyfill for HTML5 date input.
*/
(function($, Modernizr, Drupal) {
(function ($, Modernizr, Drupal) {
/**
* Attach datepicker fallback on date elements.
*
......@@ -30,7 +30,7 @@
* @return {string}
* A CSS Selector.
*/
const getDateSelector = elements =>
const getDateSelector = (elements) =>
[
`[${dataFieldElements}="${elements}"]`,
`:not([${dataDatepickerProcessed}="${elements}"])`,
......@@ -41,7 +41,7 @@
if (Modernizr.inputtypes.date === false) {
Array.prototype.forEach.call(
document.querySelectorAll(getDateSelector('date-time')),
dateTime => {
(dateTime) => {
const dateInput = dateTime.querySelector('input[type="date"]');
const timeInput = dateTime.querySelector('input[type="time"]');
const help = Drupal.theme.dateTimeHelp({
......@@ -51,7 +51,7 @@
timeDesc: timeInput.dataset.help,
});
[dateInput, timeInput].forEach(input => {
[dateInput, timeInput].forEach((input) => {
input.setAttribute(
'aria-describedby',
`${input.id}--description`,
......@@ -71,7 +71,7 @@
Array.prototype.forEach.call(
document.querySelectorAll(getDateSelector('date')),
date => {
(date) => {
const dateInput = date.querySelector('input[type="date"]');
const help = Drupal.theme.dateHelp({
dateDesc: dateInput.dataset.help,
......
......@@ -26,12 +26,12 @@
* @return {function}
* The debounced function.
*/
Drupal.debounce = function(func, wait, immediate) {
Drupal.debounce = function (func, wait, immediate) {
let timeout;
let result;
return function(...args) {
return function (...args) {
const context = this;
const later = function() {
const later = function () {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
......
......@@ -3,7 +3,7 @@
* Add aria attribute handling for details and summary elements.
*/
(function($, Drupal) {
(function ($, Drupal) {
/**
* Handles `aria-expanded` and `aria-pressed` attributes on details elements.
*
......@@ -13,7 +13,7 @@
attach() {
$('body')
.once('detailsAria')
.on('click.detailsAria', 'summary', event => {
.on('click.detailsAria', 'summary', (event) => {
const $summary = $(event.currentTarget);
const open =
$(event.currentTarget.parentNode).attr('open') === 'open'
......
......@@ -72,9 +72,7 @@
*/
Drupal.behaviors.detailsSummary = {
attach(context) {
const $detailsElements = $(context)
.find('details')
.once('details');
const $detailsElements = $(context).find('details').once('details');
DetailsSummarizedContent.instances = DetailsSummarizedContent.instances.concat(
$detailsElements
......@@ -103,6 +101,6 @@
* @return {string}
* The formatted summarized content text.
*/
Drupal.theme.detailsSummarizedContentText = text =>
Drupal.theme.detailsSummarizedContentText = (text) =>
text ? ` (${text})` : '';
})(jQuery, Drupal);
......@@ -3,7 +3,7 @@
* Extends the Drupal AJAX functionality to integrate the dialog API.
*/
(function($, Drupal) {
(function ($, Drupal) {
/**
* Initialize dialogs for Ajax purposes.
*
......@@ -44,7 +44,7 @@
const originalClose = settings.dialog.close;
// Overwrite the close method to remove the dialog on closing.
settings.dialog.close = function(event, ...args) {
settings.dialog.close = function (event, ...args) {
originalClose.apply(settings.dialog, [event, ...args]);
$(event.target).remove();
};
......@@ -64,7 +64,7 @@
const $buttons = $dialog.find(
'.form-actions input[type=submit], .form-actions a.button',
);
$buttons.each(function() {
$buttons.each(function () {
const $originalButton = $(this).css({ display: 'none' });
buttons.push({
text: $originalButton.html() || $originalButton.attr('value'),
......@@ -101,7 +101,7 @@
* @return {bool|undefined}
* Returns false if there was no selector property in the response object.
*/
Drupal.AjaxCommands.prototype.openDialog = function(ajax, response, status) {
Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) {
if (!response.selector) {
return false;
}
......@@ -149,10 +149,7 @@
}
// Add the standard Drupal class for buttons for style consistency.
$dialog
.parent()
.find('.ui-dialog-buttonset')
.addClass('form-actions');
$dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions');
};
/**
......@@ -171,7 +168,11 @@
* @param {number} [status]
* The HTTP status code.
*/
Drupal.AjaxCommands.prototype.closeDialog = function(ajax, response, status) {
Drupal.AjaxCommands.prototype.closeDialog = function (
ajax,
response,
status,
) {
const $dialog = $(response.selector);
if ($dialog.length) {