Update OOUI to v0.26.3
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-core.js
index 12e5ef6..84454ef 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOUI v0.25.2
+ * OOUI v0.26.3
  * 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-02-07T00:27:24Z
+ * Date: 2018-04-10T22:15:39Z
  */
 ( function ( OO ) {
 
@@ -533,7 +533,7 @@ OO.ui.isSafeUrl = function ( url ) {
  * It is left up to implementors to decide how to compute this
  * so the default implementation always returns false.
  *
- * @return {boolean} Use is on a mobile device
+ * @return {boolean} User is on a mobile device
  */
 OO.ui.isMobile = function () {
        return false;
@@ -7171,8 +7171,16 @@ OO.ui.MenuOptionWidget = function OoUiMenuOptionWidget( config ) {
        // Parent constructor
        OO.ui.MenuOptionWidget.parent.call( this, config );
 
+       // Properties
+       this.checkIcon = new OO.ui.IconWidget( {
+               icon: 'check',
+               classes: [ 'oo-ui-menuOptionWidget-checkIcon' ]
+       } );
+
        // Initialization
-       this.$element.addClass( 'oo-ui-menuOptionWidget' );
+       this.$element
+               .prepend( this.checkIcon.$element )
+               .addClass( 'oo-ui-menuOptionWidget' );
 };
 
 /* Setup */
@@ -9080,11 +9088,17 @@ OO.ui.CheckboxInputWidget = function OoUiCheckboxInputWidget( config ) {
        // Parent constructor
        OO.ui.CheckboxInputWidget.parent.call( this, config );
 
+       // Properties
+       this.checkIcon = new OO.ui.IconWidget( {
+               icon: 'check',
+               classes: [ 'oo-ui-checkboxInputWidget-checkIcon' ]
+       } );
+
        // Initialization
        this.$element
                .addClass( 'oo-ui-checkboxInputWidget' )
                // Required for pretty styling in WikimediaUI theme
-               .append( $( '<span>' ) );
+               .append( this.checkIcon.$element );
        this.setSelected( config.selected !== undefined ? config.selected : false );
 };
 
@@ -9245,7 +9259,7 @@ OO.ui.DropdownInputWidget = function OoUiDropdownInputWidget( config ) {
        this.$element
                .addClass( 'oo-ui-dropdownInputWidget' )
                .append( this.dropdownWidget.$element );
-       this.setTabIndexedElement( null );
+       this.setTabIndexedElement( this.dropdownWidget.$tabIndexed );
 };
 
 /* Setup */
@@ -9336,26 +9350,51 @@ OO.ui.DropdownInputWidget.prototype.setOptionsData = function ( options ) {
        this.optionsDirty = true;
 
        optionWidgets = options.map( function ( opt ) {
-               var optValue, optionWidget;
+               var optValue;
 
-               if ( opt.optgroup === undefined ) {
-                       optValue = widget.cleanUpValue( opt.data );
-                       optionWidget = new OO.ui.MenuOptionWidget( {
-                               data: optValue,
-                               label: opt.label !== undefined ? opt.label : optValue
-                       } );
-               } else {
-                       optionWidget = new OO.ui.MenuSectionOptionWidget( {
-                               label: opt.optgroup
-                       } );
+               if ( opt.optgroup !== undefined ) {
+                       return widget.createMenuSectionOptionWidget( opt.optgroup );
                }
 
-               return optionWidget;
+               optValue = widget.cleanUpValue( opt.data );
+               return widget.createMenuOptionWidget(
+                       optValue,
+                       opt.label !== undefined ? opt.label : optValue
+               );
+
        } );
 
        this.dropdownWidget.getMenu().clearItems().addItems( optionWidgets );
 };
 
+/**
+ * Create a menu option widget.
+ *
+ * @protected
+ * @param {string} data Item data
+ * @param {string} label Item label
+ * @return {OO.ui.MenuOptionWidget} Option widget
+ */
+OO.ui.DropdownInputWidget.prototype.createMenuOptionWidget = function ( data, label ) {
+       return new OO.ui.MenuOptionWidget( {
+               data: data,
+               label: label
+       } );
+};
+
+/**
+ * Create a menu section option widget.
+ *
+ * @protected
+ * @param {string} label Section item label
+ * @return {OO.ui.MenuSectionOptionWidget} Menu section option widget
+ */
+OO.ui.DropdownInputWidget.prototype.createMenuSectionOptionWidget = function ( label ) {
+       return new OO.ui.MenuSectionOptionWidget( {
+               label: label
+       } );
+};
+
 /**
  * Update the user-visible interface to match the internal list of options and value.
  *
@@ -9603,7 +9642,7 @@ OO.ui.RadioSelectInputWidget = function OoUiRadioSelectInputWidget( config ) {
        this.$element
                .addClass( 'oo-ui-radioSelectInputWidget' )
                .append( this.radioSelectWidget.$element );
-       this.setTabIndexedElement( null );
+       this.setTabIndexedElement( this.radioSelectWidget.$tabIndexed );
 };
 
 /* Setup */
@@ -9767,6 +9806,8 @@ OO.ui.CheckboxMultiselectInputWidget = function OoUiCheckboxMultiselectInputWidg
 
        // Properties (must be done before parent constructor which calls #setDisabled)
        this.checkboxMultiselectWidget = new OO.ui.CheckboxMultiselectWidget();
+       // Must be set before the #setOptionsData call below
+       this.inputName = config.name;
        // Set up the options before parent constructor, which uses them to validate config.value.
        // Use this instead of setOptions() because this.$input is not set up yet
        this.setOptionsData( config.options || [] );
@@ -9774,9 +9815,6 @@ OO.ui.CheckboxMultiselectInputWidget = function OoUiCheckboxMultiselectInputWidg
        // Parent constructor
        OO.ui.CheckboxMultiselectInputWidget.parent.call( this, config );
 
-       // Properties
-       this.inputName = config.name;
-
        // Events
        this.checkboxMultiselectWidget.connect( this, { select: 'onCheckboxesSelect' } );
 
@@ -10810,6 +10848,7 @@ OO.ui.MultilineTextInputWidget = function OoUiMultilineTextInputWidget( config )
                this.$input.attr( 'rows', config.rows );
        }
        if ( this.autosize ) {
+               this.$input.addClass( 'oo-ui-textInputWidget-autosized' );
                this.isWaitingToBeAttached = true;
                this.installParentChangeDetector();
        }
@@ -11438,7 +11477,7 @@ OO.ui.FieldLayout.prototype.makeMessage = function ( kind, text ) {
                $icon = new OO.ui.IconWidget( { icon: 'alert', flags: [ 'warning' ] } ).$element;
                $listItem.attr( 'role', 'alert' );
        } else if ( kind === 'notice' ) {
-               $icon = new OO.ui.IconWidget( { icon: 'info' } ).$element;
+               $icon = new OO.ui.IconWidget( { icon: 'notice' } ).$element;
        } else {
                $icon = '';
        }