From 088f3043a4555c29f4f57ba29d287ac9bd6e0b7c Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 10 Sep 2021 00:01:24 +0000 Subject: [PATCH] External Libraries: Update jQuery UI to 1.13.0-rc2. The final release is expected at the beginning of October. Updating to rc2 now gives everybody plenty of time to test and report any issues either with UI 1.13.0 or with the WordPress implementation. Props Clorith, mgol, azaozz. See #52163. git-svn-id: https://develop.svn.wordpress.org/trunk@51794 602fd350-edb4-49c9-b593-d223f7449a82 --- .../_enqueues/vendor/jquery/ui/accordion.js | 25 +- .../vendor/jquery/ui/autocomplete.js | 55 +-- src/js/_enqueues/vendor/jquery/ui/button.js | 101 ++++- .../vendor/jquery/ui/checkboxradio.js | 18 +- .../vendor/jquery/ui/controlgroup.js | 16 +- src/js/_enqueues/vendor/jquery/ui/core.js | 255 ++++++----- .../_enqueues/vendor/jquery/ui/datepicker.js | 230 +++++++--- src/js/_enqueues/vendor/jquery/ui/dialog.js | 76 ++-- .../_enqueues/vendor/jquery/ui/draggable.js | 35 +- .../_enqueues/vendor/jquery/ui/droppable.js | 32 +- .../vendor/jquery/ui/effect-blind.js | 9 +- .../vendor/jquery/ui/effect-bounce.js | 9 +- .../_enqueues/vendor/jquery/ui/effect-clip.js | 9 +- .../_enqueues/vendor/jquery/ui/effect-drop.js | 9 +- .../vendor/jquery/ui/effect-explode.js | 13 +- .../_enqueues/vendor/jquery/ui/effect-fade.js | 9 +- .../_enqueues/vendor/jquery/ui/effect-fold.js | 9 +- .../vendor/jquery/ui/effect-highlight.js | 9 +- .../_enqueues/vendor/jquery/ui/effect-puff.js | 9 +- .../vendor/jquery/ui/effect-pulsate.js | 9 +- .../vendor/jquery/ui/effect-scale.js | 9 +- .../vendor/jquery/ui/effect-shake.js | 9 +- .../_enqueues/vendor/jquery/ui/effect-size.js | 11 +- .../vendor/jquery/ui/effect-slide.js | 9 +- .../vendor/jquery/ui/effect-transfer.js | 9 +- src/js/_enqueues/vendor/jquery/ui/effect.js | 273 +++++++----- src/js/_enqueues/vendor/jquery/ui/menu.js | 126 ++++-- src/js/_enqueues/vendor/jquery/ui/mouse.js | 25 +- .../_enqueues/vendor/jquery/ui/progressbar.js | 15 +- .../_enqueues/vendor/jquery/ui/resizable.js | 54 ++- .../_enqueues/vendor/jquery/ui/selectable.js | 19 +- .../_enqueues/vendor/jquery/ui/selectmenu.js | 23 +- src/js/_enqueues/vendor/jquery/ui/slider.js | 17 +- src/js/_enqueues/vendor/jquery/ui/sortable.js | 404 ++++++++++-------- src/js/_enqueues/vendor/jquery/ui/spinner.js | 33 +- src/js/_enqueues/vendor/jquery/ui/tabs.js | 24 +- src/js/_enqueues/vendor/jquery/ui/tooltip.js | 26 +- src/wp-includes/script-loader.php | 78 ++-- 38 files changed, 1298 insertions(+), 803 deletions(-) diff --git a/src/js/_enqueues/vendor/jquery/ui/accordion.js b/src/js/_enqueues/vendor/jquery/ui/accordion.js index c1b3f26e8e..283380a10b 100644 --- a/src/js/_enqueues/vendor/jquery/ui/accordion.js +++ b/src/js/_enqueues/vendor/jquery/ui/accordion.js @@ -1,5 +1,5 @@ /*! - * jQuery UI Accordion 1.12.1 + * jQuery UI Accordion 1.13.0-rc.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -9,9 +9,9 @@ //>>label: Accordion //>>group: Widgets -// jscs:disable maximumLineLength +/* eslint-disable max-len */ //>>description: Displays collapsible content panels for presenting information in a limited amount of space. -// jscs:enable maximumLineLength +/* eslint-enable max-len */ //>>docs: http://api.jqueryui.com/accordion/ //>>demos: http://jqueryui.com/accordion/ //>>css.structure: ../../themes/base/core.css @@ -19,6 +19,8 @@ //>>css.theme: ../../themes/base/theme.css ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -31,10 +33,11 @@ // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; return $.widget( "ui.accordion", { - version: "1.12.1", + version: "1.13.0-rc.2", options: { active: 0, animate: {}, @@ -45,7 +48,9 @@ return $.widget( "ui.accordion", { }, collapsible: false, event: "click", - header: "> li > :first-child, > :not(li):even", + header: function( elem ) { + return elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() ); + }, heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", @@ -276,7 +281,11 @@ return $.widget( "ui.accordion", { var prevHeaders = this.headers, prevPanels = this.panels; - this.headers = this.element.find( this.options.header ); + if ( typeof this.options.header === "function" ) { + this.headers = this.options.header( this.element ); + } else { + this.headers = this.element.find( this.options.header ); + } this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", "ui-state-default" ); @@ -607,4 +616,4 @@ return $.widget( "ui.accordion", { } } ); -} ) ); +} ); diff --git a/src/js/_enqueues/vendor/jquery/ui/autocomplete.js b/src/js/_enqueues/vendor/jquery/ui/autocomplete.js index f5f58213f1..7f4117e41a 100644 --- a/src/js/_enqueues/vendor/jquery/ui/autocomplete.js +++ b/src/js/_enqueues/vendor/jquery/ui/autocomplete.js @@ -1,5 +1,5 @@ /*! - * jQuery UI Autocomplete 1.12.1 + * jQuery UI Autocomplete 1.13.0-rc.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -17,6 +17,8 @@ //>>css.theme: ../../themes/base/theme.css ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -30,10 +32,11 @@ // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; $.widget( "ui.autocomplete", { - version: "1.12.1", + version: "1.13.0-rc.2", defaultElement: "", options: { appendTo: null, @@ -196,11 +199,6 @@ $.widget( "ui.autocomplete", { this.previous = this._value(); }, blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - clearTimeout( this.searching ); this.close( event ); this._change( event ); @@ -216,31 +214,24 @@ $.widget( "ui.autocomplete", { role: null } ) .hide() + + // Support: IE 11 only, Edge <= 14 + // For other browsers, we preventDefault() on the mousedown event + // to keep the dropdown from taking focus from the input. This doesn't + // work for IE/Edge, causing problems with selection and scrolling (#9638) + // Happily, IE and Edge support an "unselectable" attribute that + // prevents an element from receiving focus, exactly what we want here. + .attr( { + "unselectable": "on" + } ) .menu( "instance" ); this._addClass( this.menu.element, "ui-autocomplete", "ui-front" ); this._on( this.menu.element, { mousedown: function( event ) { - // prevent moving focus out of the text field + // Prevent moving focus out of the text field event.preventDefault(); - - // IE doesn't prevent moving focus even with event.preventDefault() - // so we set a flag to know when we should ignore the blur event - this.cancelBlur = true; - this._delay( function() { - delete this.cancelBlur; - - // Support: IE 8 only - // Right clicking a menu item or selecting text from the menu items will - // result in focus moving out of the input. However, we've already received - // and ignored the blur event because of the cancelBlur flag set above. So - // we restore focus to ensure that the menu closes properly based on the user's - // next actions. - if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) { - this.element.trigger( "focus" ); - } - } ); }, menufocus: function( event, ui ) { var label, item; @@ -271,7 +262,7 @@ $.widget( "ui.autocomplete", { // Announce the value in the liveRegion label = ui.item.attr( "aria-label" ) || item.value; - if ( label && $.trim( label ).length ) { + if ( label && String.prototype.trim.call( label ).length ) { this.liveRegion.children().hide(); $( "
" ).text( label ).appendTo( this.liveRegion ); } @@ -383,7 +374,7 @@ $.widget( "ui.autocomplete", { _initSource: function() { var array, url, that = this; - if ( $.isArray( this.options.source ) ) { + if ( Array.isArray( this.options.source ) ) { array = this.options.source; this.source = function( request, response ) { response( $.ui.autocomplete.filter( array, request.term ) ); @@ -455,7 +446,7 @@ $.widget( "ui.autocomplete", { _response: function() { var index = ++this.requestIndex; - return $.proxy( function( content ) { + return function( content ) { if ( index === this.requestIndex ) { this.__response( content ); } @@ -464,7 +455,7 @@ $.widget( "ui.autocomplete", { if ( !this.pending ) { this._removeClass( "ui-autocomplete-loading" ); } - }, this ); + }.bind( this ); }, __response: function( content ) { @@ -624,7 +615,7 @@ $.widget( "ui.autocomplete", { var editable = element.prop( "contentEditable" ); if ( editable === "inherit" ) { - return this._isContentEditable( element.parent() ); + return this._isContentEditable( element.parent() ); } return editable === "true"; @@ -675,4 +666,4 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, { return $.ui.autocomplete; -} ) ); +} ); diff --git a/src/js/_enqueues/vendor/jquery/ui/button.js b/src/js/_enqueues/vendor/jquery/ui/button.js index 17348b7166..a48cc6a3f3 100644 --- a/src/js/_enqueues/vendor/jquery/ui/button.js +++ b/src/js/_enqueues/vendor/jquery/ui/button.js @@ -1,5 +1,5 @@ /*! - * jQuery UI Button 1.12.1 + * jQuery UI Button 1.13.0-rc.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -17,6 +17,8 @@ //>>css.theme: ../../themes/base/theme.css ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -35,10 +37,11 @@ // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; $.widget( "ui.button", { - version: "1.12.1", + version: "1.13.0-rc.2", defaultElement: "" ).addClass( this._triggerClass ). - html( !buttonImage ? buttonText : $( "" ).attr( - { src:buttonImage, alt:buttonText, title:buttonText } ) ) ); + + if ( this._get( inst, "buttonImageOnly" ) ) { + inst.trigger = $( "" ) + .addClass( this._triggerClass ) + .attr( { + src: buttonImage, + alt: buttonText, + title: buttonText + } ); + } else { + inst.trigger = $( "" : "" ); + controls = ""; + if ( !inst.inline ) { + controls = $( "" : "" ) + ( isRTL ? "" : controls ) + "
" : ""; + buttonPanel = ""; + if ( showButtonPanel ) { + buttonPanel = $( "
" ) + .append( isRTL ? controls : "" ) + .append( this._isInRange( inst, gotoDate ) ? + $( "