( function () { /** * @classdesc A JavaScript version of CheckMatrixWidget. * * @class * @extends OO.ui.Widget * * @constructor * @description Create an instance of `mw.widgets.CheckMatrixWidget`. * @param {Object} [config] Configuration options * @param {Object} config.columns Required object mapping column labels (as HTML) to * their tags. * @param {Object} config.rows Required object mapping row labels (as HTML) to their * tags. * @param {string[]} [config.forcedOn] Array of column-row tags to be displayed as * enabled but unavailable to change. * @param {string[]} [config.forcedOff] Array of column-row tags to be displayed as * disabled but unavailable to change. * @param {Object} [config.tooltips] Optional object mapping row labels to tooltips * (as text, will be escaped). * @param {Object} [config.tooltipsHtml] Optional object mapping row labels to tooltips * (as HTML). Takes precedence over text tooltips. */ mw.widgets.CheckMatrixWidget = function MWWCheckMatrixWidget( config ) { config = config || {}; // Parent constructor mw.widgets.CheckMatrixWidget.super.call( this, config ); this.checkboxes = {}; this.name = config.name; this.id = config.id; this.rows = config.rows || {}; this.columns = config.columns || {}; this.tooltips = config.tooltips || []; this.tooltipsHtml = config.tooltipsHtml || []; this.values = config.values || []; this.forcedOn = config.forcedOn || []; this.forcedOff = config.forcedOff || []; // Build header const $headRow = $( '