2 * A wrapper for OO.ui.SelectFileInputWidget
8 function UploadSelectFileParamWidget() {
9 UploadSelectFileParamWidget
.super.call( this );
12 OO
.inheritClass( UploadSelectFileParamWidget
, OO
.ui
.SelectFileInputWidget
);
17 UploadSelectFileParamWidget
.prototype.getApiValueForDisplay = function () {
24 UploadSelectFileParamWidget
.prototype.requiresFormData = function () {
31 UploadSelectFileParamWidget
.prototype.getApiValue = function () {
32 return this.getValue();
36 * There should be `@param {any} newValue` but that results in
37 * `no-unused-vars` eslint rule failing
39 UploadSelectFileParamWidget
.prototype.setApiValue = function () {
44 * @param {boolean} shouldSuppressErrors
45 * @return {jQuery.Promise}
47 UploadSelectFileParamWidget
.prototype.apiCheckValid = function ( shouldSuppressErrors
) {
48 const ok
= this.getValue() !== null && this.getValue() !== undefined || shouldSuppressErrors
;
49 this.info
.setIcon( ok
? null : 'alert' );
50 this.setTitle( ok
? '' : mw
.message( 'apisandbox-alert-field' ).plain() );
51 return $.Deferred().resolve( ok
).promise();
54 module
.exports
= UploadSelectFileParamWidget
;