4 * Provides access to HTMLForm OOUI classes.
6 * @namespace mw.htmlform
11 * @classdesc Allows custom data specific to HTMLFormField to be set for OOUI forms. This picks up the
12 * extra config from a matching PHP widget (defined in HTMLFormElement.php) when constructed using
15 * Currently only supports passing 'cond-state' data.
19 * @description Create an instance of `mw.htmlform.Element`.
20 * @param {Object} [config] Configuration options
21 * @param {Object<string,string[]>} [config.condState] typically corresponds to a data-cond-state attribute
22 * that is found on HTMLForm elements and used during
23 * {@link event:'htmlform.enhance' htmlform.enhance}. For more information on the format see
24 * the private function conditionParse in resources/src/mediawiki.htmlform/cond-state.js.
26 mw.htmlform.Element = function ( config ) {
27 // Configuration initialization
28 config = config || {};
31 this.condState = config.condState;
36 * @extends OO.ui.FieldLayout
37 * @mixes mw.htmlform.Element
38 * @classdesc FieldLayout class.
39 * @memberof mw.htmlform
42 * @description Create a FieldLayout class.
43 * @param {Object} config
45 mw.htmlform.FieldLayout = function ( config ) {
47 mw.htmlform.FieldLayout.super.call( this, config );
49 mw.htmlform.Element.call( this, config );
51 OO.inheritClass( mw.htmlform.FieldLayout, OO.ui.FieldLayout );
52 OO.mixinClass( mw.htmlform.FieldLayout, mw.htmlform.Element );
56 * @extends OO.ui.ActionFieldLayout
57 * @mixes mw.htmlform.Element
58 * @classdesc FieldLayout class.
59 * @memberof mw.htmlform
62 * @description Create an ActionFieldLayout class.
63 * @param {Object} config
65 mw.htmlform.ActionFieldLayout = function ( config ) {
67 mw.htmlform.ActionFieldLayout.super.call( this, config );
69 mw.htmlform.Element.call( this, config );
71 OO.inheritClass( mw.htmlform.ActionFieldLayout, OO.ui.ActionFieldLayout );
72 OO.mixinClass( mw.htmlform.ActionFieldLayout, mw.htmlform.Element );