7a95e3dd4ce462978ada67065d4832b1e4661cbe
3 * A group widget to allow for aggregation of events
5 * @extends OO.ui.Widget
8 * @param {Object} [config] Configuration object
9 * @param {Object} [events] Events to aggregate. The object represent the
10 * event name to aggregate and the event value to emit on aggregate for items.
12 mw
.rcfilters
.ui
.GroupWidget
= function MwRcfiltersUiViewSwitchWidget( config
) {
15 config
= config
|| {};
18 mw
.rcfilters
.ui
.GroupWidget
.parent
.call( this, config
);
21 OO
.ui
.mixin
.GroupElement
.call( this, $.extend( {}, config
, { $group
: this.$element
} ) );
23 if ( config
.events
) {
25 // eslint-disable-next-line no-restricted-properties
26 $.each( config
.events
, function ( eventName
, eventEmit
) {
27 aggregate
[ eventName
] = eventEmit
;
30 this.aggregate( aggregate
);
33 if ( Array
.isArray( config
.items
) ) {
34 this.addItems( config
.items
);
40 OO
.inheritClass( mw
.rcfilters
.ui
.GroupWidget
, OO
.ui
.Widget
);
41 OO
.mixinClass( mw
.rcfilters
.ui
.GroupWidget
, OO
.ui
.mixin
.GroupWidget
);