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 $.each( config
.events
, function ( eventName
, eventEmit
) {
26 aggregate
[ eventName
] = eventEmit
;
29 this.aggregate( aggregate
);
32 if ( Array
.isArray( config
.items
) ) {
33 this.addItems( config
.items
);
39 OO
.inheritClass( mw
.rcfilters
.ui
.GroupWidget
, OO
.ui
.Widget
);
40 OO
.mixinClass( mw
.rcfilters
.ui
.GroupWidget
, OO
.ui
.mixin
.GroupWidget
);