Update OOUI to v0.28.0
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-widgets.js
index 60c3875..991bbfb 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOUI v0.27.4
+ * OOUI v0.28.0
  * https://www.mediawiki.org/wiki/OOUI
  *
  * Copyright 2011–2018 OOUI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2018-06-27T17:25:08Z
+ * Date: 2018-08-14T23:16:18Z
  */
 ( function ( OO ) {
 
@@ -846,6 +846,7 @@ OO.ui.mixin.LookupElement.prototype.populateLookupMenu = function () {
                        } )
                        .fail( function () {
                                widget.lookupMenu.clearItems();
+                               widget.lookupMenu.toggle( false );
                        } );
        }
 
@@ -1003,7 +1004,9 @@ OO.ui.TabPanelLayout = function OoUiTabPanelLayout( name, config ) {
        this.active = false;
 
        // Initialization
-       this.$element.addClass( 'oo-ui-tabPanelLayout' );
+       this.$element
+               .addClass( 'oo-ui-tabPanelLayout' )
+               .attr( 'role', 'tabpanel' );
 };
 
 /* Setup */
@@ -1085,6 +1088,10 @@ OO.ui.TabPanelLayout.prototype.setTabItem = function ( tabItem ) {
  * @chainable
  */
 OO.ui.TabPanelLayout.prototype.setupTabItem = function () {
+       this.$element.attr( 'aria-labelledby', this.tabItem.getElementId() );
+
+       this.tabItem.$element.attr( 'aria-controls', this.getElementId() );
+
        if ( this.label ) {
                this.tabItem.setLabel( this.label );
        }
@@ -3529,7 +3536,9 @@ OO.ui.TabOptionWidget = function OoUiTabOptionWidget( config ) {
        OO.ui.TabOptionWidget.parent.call( this, config );
 
        // Initialization
-       this.$element.addClass( 'oo-ui-tabOptionWidget' );
+       this.$element
+               .addClass( 'oo-ui-tabOptionWidget' )
+               .attr( 'role', 'tab' );
 };
 
 /* Setup */
@@ -3570,7 +3579,9 @@ OO.ui.TabSelectWidget = function OoUiTabSelectWidget( config ) {
        } );
 
        // Initialization
-       this.$element.addClass( 'oo-ui-tabSelectWidget' );
+       this.$element
+               .addClass( 'oo-ui-tabSelectWidget' )
+               .attr( 'role', 'tablist' );
 };
 
 /* Setup */
@@ -3591,6 +3602,7 @@ OO.mixinClass( OO.ui.TabSelectWidget, OO.ui.mixin.TabIndexedElement );
  *
  * @constructor
  * @param {Object} [config] Configuration options
+ * @deprecated
  */
 OO.ui.CapsuleItemWidget = function OoUiCapsuleItemWidget( config ) {
        // Configuration initialization
@@ -3749,6 +3761,7 @@ OO.ui.CapsuleItemWidget.prototype.onKeyDown = function ( e ) {
  *  the containing `<div>` and has a larger area. By default, the menu uses
  *  relative positioning.
  *  See <https://www.mediawiki.org/wiki/OOUI/Concepts#Overlays>.
+ * @deprecated
  */
 OO.ui.CapsuleMultiselectWidget = function OoUiCapsuleMultiselectWidget( config ) {
        var $tabFocus;
@@ -3876,6 +3889,9 @@ OO.ui.CapsuleMultiselectWidget = function OoUiCapsuleMultiselectWidget( config )
        }.bind( this ) );
 
        this.onMenuItemsChange();
+
+       // Deprecation warning
+       OO.ui.warnDeprecation( 'CapsuleMultiselectWidget: Deprecated widget. Use TagMultiselectWidget instead. See T183299.' );
 };
 
 /* Setup */
@@ -5933,6 +5949,19 @@ OO.ui.MenuTagMultiselectWidget.prototype.onTagSelect = function ( tagItem ) {
        }
 };
 
+/**
+ * @inheritdoc
+ */
+OO.ui.MenuTagMultiselectWidget.prototype.setDisabled = function ( isDisabled ) {
+       // Parent method
+       OO.ui.MenuTagMultiselectWidget.parent.prototype.setDisabled.call( this, isDisabled );
+
+       if ( this.menu ) {
+               // Protect against calling setDisabled() before the menu was initialized
+               this.menu.setDisabled( isDisabled );
+       }
+};
+
 /**
  * Highlight the first selectable item in the menu, if configured.
  *