血小板减少吃什么能补回来| 什么是微信号| 目前是什么意思| 查黄体酮做什么检查| 借条和欠条有什么区别| 叶子发黄缺什么肥| 酒精胶是粘什么的| 梦到狗是什么征兆| 杀马特是什么意思| 睡觉咳嗽是什么原因| 鸽子拉水便是什么原因| 靶向药是什么药| 山竹树长什么样子图片| 争宠是什么意思| 一本线是什么意思| 绿色痰是什么原因| 脚气真菌最怕什么| 天生丽质是什么生肖| 鑫字属于五行属什么| 盆腔镜检查是查什么的| 女人切除子宫有什么影响| 儿童贫血吃什么补血最快| 画什么才好看| 24度穿什么衣服合适| 血糖高能吃什么主食| 龙虎山是什么地貌| 梦见自己吐了是什么意思| Q什么意思| hpv病毒是什么原因引起的| 特异性是什么意思| 木薯粉是什么做的| 星标朋友是什么意思| 形态是什么意思| 仁义道德是什么意思| im医学上是什么意思| 最多笔画的汉字是什么| 吃什么食物增加黑色素| 嵌顿是什么意思| 女人怀孕的最佳时间是什么时间| 南京市徽为什么是貔貅| 茶色是什么颜色| 双鱼座的幸运色是什么| 性质是什么| 经常放屁是什么原因造成的| 八月20号是什么星座| 用神是什么意思| 诱导是什么意思| 桂鱼吃什么食物| 2月14日是什么星座| 45岁属什么| 飞克手表什么档次| 聚酯纤维是什么面料优缺点| 梦见龙是什么意思| 开颅手术有什么后遗症| 二是什么意思| 不可翻转干燥是什么意思| 过期的维生素c有什么用途| camel是什么意思| 婴儿蚊虫叮咬红肿用什么药| 头晕为什么做眼震检查| 吃什么立马排便| 牡丹花什么季节开| 拔火罐对身体有什么好处| psp是什么| 美背是什么| 心火大吃什么药| 基础代谢是什么| 脸上起红疙瘩是什么原因| 无性婚姻会有什么好处| 什么树叶| 北极为什么没有企鹅| cas号是什么| 经常打呼噜是什么原因| 梦见采蘑菇是什么预兆| 最好的烟是什么牌子| 裳能组什么词| 霉菌性阴道炎用什么药最好| 男人都喜欢什么样的女人| 腰酸背痛挂什么科| 5个月宝宝吃什么辅食| 脾肾两虚吃什么中成药最好| 浮世是什么意思| 韩国人为什么叫棒子| 30岁属什么的生肖| 骨龄是什么| 结婚送什么| 易孕期是什么时候| 甲沟炎应该挂什么科| 自渎是什么意思| 麝香保心丸治什么病| 势利是什么意思| 放屁多是什么原因呢| 驰字五行属什么| 身上长红点很痒是什么原因| 好好的什么意思| 1972年出生属什么生肖| hpv52阳性有什么症状| 青少年耳鸣是什么原因引起的| 不安腿是什么症状| 坐月子吃什么水果好| 十二月四号是什么星座| 什么情况需要打破伤风| 消肿吃什么食物好| 积分落户是什么意思| 左旋肉碱是什么东西| 感冒应该挂什么科| 红楼梦是一部什么小说| 胃下垂有什么症状表现| 普通感冒吃什么药| 八月20号是什么星座| 升学宴选什么日子好| 铁蛋白低吃什么可以补| 告状是什么意思| 脾虚如何调理吃什么药| 3月份什么星座| 无花果不能和什么一起吃| 什么什么分明的成语| 纤维瘤是什么| 得了性疾病有什么症状| 女性分泌物带血是什么原因| 贪嗔痴是什么意思| 口红什么牌子最好| 消化不良大便什么颜色| 喝什么茶去湿气最好| 迷茫是什么意思| 捡帽子有什么说法吗| 为什么睡久了会头疼| 静脉曲张吃什么药| 撒野是什么意思| 鱼加思读什么| 咏柳的咏是什么意思| 曼龙鱼能和什么鱼混养| 包皮龟头炎吃什么药| 常吃阿司匹林有什么副作用| 海盐是什么盐| 香菜什么时候种最合适| 榴莲不能和什么同吃| 头痛挂什么科| 结婚35周年是什么婚| 什么是认知行为疗法| 毅力是什么意思| 提上日程是什么意思| 什么样的智齿需要拔| 肝裂不宽是什么意思| 喝红茶有什么好处和坏处| 复合是什么意思| 手麻木吃什么药好| 吃什么增强记忆力| 掂过碌蔗是什么意思| 骨盆倾斜有什么症状| 黄体破裂是什么意思| 被蚂蚁咬了涂什么药| 橘白猫是什么品种| 席梦思床垫什么牌子好| 心率低是什么原因| 腰椎退行性变是什么病| 灵芝孢子粉是什么| 义眼是什么| 胃大肚子大是什么原因| 合肥以前叫什么| 早上起来嘴巴发苦是什么原因| 感冒了吃什么水果比较好| 冒汗是什么原因| 怀孕3天有什么症状| 五行属什么怎么看| 计数单位是指什么| 属马的生什么属相的宝宝好| rp是什么意思| 圆坟是什么意思| 狗狗感冒了吃什么药| 回族不能吃什么肉| 做什么生意好挣钱| 花椒泡脚有什么好处| 武警支队长是什么级别| 什么是尊严| 血小板压积偏低是什么原因| 宫颈癌早期什么症状| 倒牙是什么意思| 牙膏什么牌子最好| 11月5号是什么星座| 病毒感染有什么症状| 世界上最贵的狗是什么| 牙龈萎缩吃什么药| 私联是什么意思| 443是什么意思| 皮肤瘙痒是什么原因| 金钱草什么样| 抬头头晕是什么原因| 餐饮sop是什么意思| 心火旺吃什么药效果最好| 小腿发痒是什么原因| 肾小球滤过率是什么意思| 眼睛胀是什么原因| 中暑是什么症状表现| 为什么会得肺结核| 颈部疼痛挂什么科| 六月初一有什么讲究| 什么药一吃就哑巴了| 骨头疼是什么病的征兆| 做恐怖的梦预示着什么| 揪心是什么意思| 平血头晕吃什么药最好| 佛手柑是什么| 贡菜是什么菜| 骨加客读什么| 儿童诺如病毒吃什么药| 梦见芝麻是什么意思| 湄公鱼是什么鱼| 猪肉排酸是什么意思| 结婚九年是什么婚| 硫酸亚铁是什么东西| 12月9号是什么星座| 芡实和什么搭配最好| 饽饽是什么意思| 定坤丹适合什么人吃| 玉髓是什么材质| 什么药通便最快| 承德有什么大学| 野人是什么意思| 金牛座是什么象| 渣滓是什么意思| 舌系带长有什么影响吗| 拉肚子吃什么药| 白醋洗脸有什么效果| 什么的态度| ca125是查什么的| 什么牌子好| 孔雀的尾巴有什么作用| 卵泡生成素高是什么原因| 什么王| 受凉咳嗽吃什么药| 明天是什么生肖| 插入阴道是什么感觉| 冠状沟有白色分泌物是什么原因| 宫缩是什么感觉| 家里有小蜘蛛预示什么| 子是什么生肖| 乌龟的天敌是什么动物| 肾阳虚吃什么药最好最有效| 6月15日是什么星座| 吃什么补充维生素b| 什么是音色| hpv阳性是什么意思| 松弛是什么意思| 肿瘤长什么样| 嘌呤高会引起什么症状| oa是什么意思| 桃不能和什么一起吃| 胚胎停育是什么原因造成的| 宫内积液什么意思| 端午节有什么活动| 喝葡萄糖有什么功效与作用| 美国为什么打越南| 吃什么降血脂和胆固醇| 红烧肉可以放什么配菜| 氨水对人体有什么危害| 手上长水泡是什么原因| 流产的血是什么颜色| 白敬亭父母是干什么的| 杏子不能和什么一起吃| 什么是庚日| 女儿是小棉袄儿子是什么| 身上痒但是什么都没有| 孕妇血糖高吃什么| 百度Jump to content

From mediawiki.org
百度 下一步,支队将不断加强党风廉政管理教育工作的针对性、有效性、全面性,并以求真务实的工作作风,继续深入推进“廉政消防”建设工作取得新成效。

OOUI Input widgets, which include text, checkbox, radio, and button inputs, are a subset of HTML form elements (they are, in fact, wrappers around HTML inputs) and can be used with form layouts. They can be configured (to use an icon, for example) and have been designed to work reliably across browsers. Events, such as changes to the value of an input, are handled by the library, which takes care of the (often tedious) work of extracting a meaningful value.

Optionally, input widgets can be configured with an input filter, which modifies the value of an input before it is accepted. An input widget that collects phone numbers might use an input filter to ignore values that contain non-numerical characters, for example. If the input value must be a MediaWiki page title, an input filter could also be used to convert values to start with an upper-case letter. Input filters are written by the developer and are assigned to an input widget via the inputFilter config option, which takes the name of the filter function.

InputWidgets support a number of methods, including setDir( direction ), which can be used to set the direction of the input (ltr for left-to-right, rtl for right-to-left, or auto which is the default value and inherits the directionality of the parent element) and setValue() and getValue(), which set and get the value of the input, respectively. For a complete list of supported methods and configuration options, please see the code-level documentation.

Text inputs

[edit]

TextInputWidgets can be configured with options that customize the size of the input field as well as its presentation. Text inputs can be assigned placeholder text or an initial value. Text inputs can also be configured with an optional validation-pattern, which is used to determine if a value is valid or not. (This is distinct from the input filters, which modify incoming values rather than validate them.)

Create a text input with the TextInputWidget class:

Example of a TextInputWidget.

// Creating a TextInputWidget. Specify a default value with the 'value' config.
// A single-line TextInput (the default)
var textInput = new OO.ui.TextInputWidget( {
		value: 'Text input'
	} );
$( document.body ).append( textInput.$element );

Add placeholder copy with the placeholder option:

Example of a TextInputWidget with placeholder

// Add placeholder copy using the 'placeholder' config.
var textInputPlaceholder = new OO.ui.TextInputWidget( {
		placeholder: 'Text input with placeholder'
	} );
$( document.body ).append( textInputPlaceholder.$element );

Make the value read-only with the readOnly option:

Example of a TextInputWidget with readOnly config option set to true

// Prevent users from changing the value of a text input with the 'readOnly' config. 
var textInputReadOnly = new OO.ui.TextInputWidget( {
		value: 'Readonly value, which cannot be changed by the user',
		readOnly: true
	} );
$( document.body ).append( textInputReadOnly.$element );

Change the type of the input with the type config:

Example of a TextInputWidget with password type

// Specify an input type (e.g., password or number) with the 'type' config. By default, the type is 'text'. Note that types such as 'date' can be specified, but they are not rendered reliably across browsers.
var textInput = new OO.ui.TextInputWidget( {
		type: 'password'
	} );
$( document.body ).append( textInput.$element );

Specify a filter that the input has to go through with the inputFilter method:

// Filter out a Wikidata item ID from the input
var textInput = new OO.ui.TextInputWidget();
textInput.inputFilter = function(value){
	return value.replace(/.*(Q[1-9]\d*).*/, '$1');
};
$( document.body ).append( textInput.$element );

For type="search" please see class SearchInputWidget further below.

Specify a validation pattern with the validate config:

// Specify a validation pattern. Validation patterns can be either a regular expression or the name of a pattern used by the library: 'non-empty' (the value cannot be an empty string) or 'integer' (the value must contain only numbers). When a validation pattern is specified, the isValid() method returns a promise that will resolve to a Boolean value: 'true', if the value is valid, or 'false' if not. 
var textInput = new OO.ui.TextInputWidget( {
		validate: 'integer'
	} );
$( document.body ).append( textInput.$element );

textInput.on( 'change', function () {
	textInput.isValid().then( function ( valid ) {
		console.log( valid );
	} );
} );

Use icon, indicator, and disabled config options: Example of a TextInputWidget .

// Configuring a TextInputWidget to use an icon or indicator, or to disable it.

// A TextInput with an icon.
var textInputIcon = new OO.ui.TextInputWidget( {
		value: 'Text input with icon',
		label: 'default textInput',
		icon: 'search'
	} ),
 
// A TextInput with an indicator.
	textInputIndicator = new OO.ui.TextInputWidget( {
		value: 'Text input with indicator',
		label: 'textInput',
		indicator: 'required'
	} ),
 
// A disabled TextInput.
	textInputDisabled = new OO.ui.TextInputWidget( {
		value: 'Disabled text input',
		label: 'textInput',
		disabled: true
	} );
 
$( document.body ).append( textInputIcon.$element, textInputIndicator.$element, textInputDisabled.$element );

TextInputWidgets support a number of methods that can be used to adjust the size of the text input, check validity, and handle events. For a complete list for supported methods and configuration options, please see the code-level documentation.

SearchInputWidget

[edit]

SearchInputWidgets are extending TextInputWidgets with type="search" applied.

MultilineTextInputWidget

[edit]

Create a multiline input with the MultilineTextInputWidget class:

Example of a MultilineTextInputWidget

// A MultilineTextInput 
var multilineInput = new OO.ui.MultilineTextInputWidget( { 
		value: 'Multiline text input\n\nMore text in separate paragraph'
	} );
$( document.body ).append( multilineInput.$element );

Create an autosized input with the autosize and maxRows options:

Example of a MultilineTextInputWidget with autosize and maxRows options .

// Autosize the input to fit the content. Configure the maximum number of rows to 
// display with the 'maxRows' config option. 
// By default, at most 10 rows will be made visible.
var autosizeInput = new OO.ui.MultilineTextInputWidget( { 
		value: 'Autosized text input, set to display a maximum of 4 rows',
		multiline: true,
		autosize: true,
		maxRows: 4
	} );
$( document.body ).append( autosizeInput.$element );

Checkbox inputs

[edit]

CheckboxInputWidgets, like HTML checkboxes, can be selected and/or configured with a value. Use the setSelected() and isSelected() methods to set or get the checked state of the box. A checkbox can also be selected via its selected configuration option.

A checkbox value, which is useful when the checkbox is part of an HTML ?<form> element, can be assigned or gotten with the setValue() and getValue() methods. A value can also be configured with the value configuration option (by default, the value is an empty string).

Note that CheckboxInputWidgets are best laid out in FieldLayout s that use the inline alignment, as in the below example.

An example of a CheckboxInputWidget

// An example of checkboxes. Note that the checkboxes are laid out in fields in a fieldset layout, with a field alignment set to 'inline'. The 'inline' setting displays the checkbox to the left of the label, with both on the same line.

// An example of an active checkbox. Use the 'selected' option to specify a checked state. 
var checkbox1 = new OO.ui.CheckboxInputWidget( {
		value: 'a',
		selected: true
	} ),
// An example of an unselected checkbox.
	checkbox2 = new OO.ui.CheckboxInputWidget( {
		value: 'b'
	} ),
// An example of a disabled checkbox.
	checkbox3 = new OO.ui.CheckboxInputWidget( {
		value:'c',
		disabled: true
	} ),
 
// Create a fieldset layout with fields for each checkbox.
	fieldset = new OO.ui.FieldsetLayout( { 
		label: 'Checkboxes'
	} );

fieldset.addItems( [
	new OO.ui.FieldLayout( checkbox1, { label: 'Selected checkbox', align: 'inline' } ),
	new OO.ui.FieldLayout( checkbox2, { label: 'Unselected checkbox', align: 'inline' } ),
	new OO.ui.FieldLayout( checkbox3, { label: 'Disabled checkbox', align: 'inline' } ),
] );

$( document.body ).append( fieldset.$element );

The isSelected() and setSelected() methods can be used to get or set the state of the checkbox. For a complete list of supported methods and configuration options, please see the code-level documentation.

Horizontal layout

[edit]

For specific forms, for example when the checkboxes are direct modifiers of an input element, it might be considered to use a HorizontalLayout for side-by-side alignment.

Radio inputs

[edit]

Radio inputs are usually used as a set, and in most cases you will want to use a RadioSelectWidget with RadioOptionWidgets instead of the RadioInputWidget itself. However, if you have need for a single radio input, the RadioInputWidget works much as a CheckboxInputWidget does. The selected state can be set with either the setSelected() method or via the widget’s selected configuration option.

For more information about RadioInputWidgets, please see the code-level documentation.

Button inputs

[edit]

ButtonInputWidgets, together with FormLayout s, are used to submit HTML forms. By default, ButtonInputWidgets are rendered as an HTML ?<button> and can be configured with options such as icons, indicators, and a value.

If you don’t need the button to work with HTML forms, you probably want to use a ButtonWidget instead.

ButtonInputWidgets can also be rendered as an HTML ?<input> using the useInputTag configuration. Widgets configured to be an ?<input> do not support config options such as icons, indicators, and values, and can only use plaintext labels. In general, ButtonInputsWidgets should only be configured as an ?<input> when there’s need for IE6 support in a form with multiple buttons.

Create an input button with the ButtonInputWidget class:

An example of ButtonInputWidgets

// This example illustrates the two different types of ButtonInputs: button and input.  The buttons are laid out with a FieldsetLayout, which is added to a FormLayout to create an HTML form. 
 
// An example of a ButtonInputWidget rendered as an HTML button, the default.
var button1Input = new OO.ui.ButtonInputWidget( {
		label: 'Button',
		value: 'Check'     
	} ),
 
// An example of a ButtonInputWidget rendered as an HTML <input>.
	button2Input = new OO.ui.ButtonInputWidget( {
		label: 'Button',
		useInputTag: true,
		value: 'Check'      
	} ),

// The buttons are arranged using a FieldsetLayout.
	fieldset = new OO.ui.FieldsetLayout( {
		label: 'Input Buttons'
	} );

fieldset.addItems( [
	new OO.ui.FieldLayout( button1Input, {
		label: 'HTML <button>'
	} ),
	new OO.ui.FieldLayout( button2Input, {
		label: 'HTML <input type="button">'
	} )
] );

// Use a form layout to create a form. Add the fieldset to the form with the $content option.
var form = new OO.ui.FormLayout( {
		$content: fieldset.$element,
		action: '/api/formhandler',
		method: 'get'
	} );

$( document.body ).append( form.$element );

For a complete list of supported methods and configuration options, please see the code-level documentation.

[edit]

DropdownInputWidgets are dropdown widgets that are intended to be used within an HTML <form> . The selected value is synchronized with the value of a hidden HTML <input> tag.

// Example: A DropdownInputWidget with three options
var dropDown = new OO.ui.DropdownInputWidget( {
		label: 'Dropdown menu: Select a menu option',
		options: [
			{ data: 'a', label: 'First' } ,
			{ data: 'b', label: 'Second'} ,
			{ data: 'c', label: 'Third' }
		]
	} );
$( document.body ).append( dropDown.$element );

For a complete list of supported methods and configuration options, please see the code-level documentation.

吃什么养头发 九一年属什么生肖 胃下垂是什么症状 打更的人叫什么 非那根又叫什么
副省长是什么级别 蛇胆是什么 什么是厌氧菌感染 角化型脚气用什么药最好 菱角是什么意思
手机合约版是什么意思 胆碱是什么 犬瘟是什么原因引起的 草字头加西读什么 乙肝145阳性是什么意思
月经来了不走是什么原因 什么泡水喝治口臭 杰瑞是什么品种的老鼠 腥辣食物指的是什么 什么是碱中毒
长的像蛇的鱼是什么鱼hcv7jop7ns2r.cn 肾阳虚是什么意思hcv9jop8ns2r.cn 舌头两边锯齿状是什么原因hcv7jop5ns4r.cn 芒果什么人不适合吃huizhijixie.com 柠檬蜂蜜水有什么功效hcv8jop5ns3r.cn
甘油三酯低有什么危害hcv8jop0ns7r.cn 南瓜和窝瓜有什么区别hcv8jop0ns3r.cn 鸽子吃什么粮食hcv8jop6ns5r.cn 血小板减少会出现什么症状hcv8jop9ns0r.cn 梦见买面条有什么预兆hcv9jop5ns2r.cn
珍珠五行属什么hcv8jop6ns3r.cn 什么什么泪下hcv9jop6ns4r.cn 夹不住尿是什么原因hcv9jop6ns2r.cn 乳腺囊实性结节是什么意思weuuu.com 硬度不够吃什么药调理liaochangning.com
单位工会主席是什么级别hcv7jop6ns1r.cn 梦见自己流血是什么预兆hcv8jop4ns3r.cn 凿是什么意思hcv9jop4ns4r.cn 凉烟都有什么牌子hkuteam.com 双重人格是什么意思hcv9jop0ns9r.cn
百度