MCPcopy Create free account
hub / github.com/ElemeFE/element-react / render

Method render

src/message-box/MessageBox.jsx:124–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 }
123
124 render(): React.DOM {
125 const { willUnmount, title, showClose, message, showInput, inputPlaceholder, showCancelButton, cancelButtonClass, showConfirmButton, confirmButtonClass, customClass, inputType } = this.props;
126 const { visible, editorErrorMessage } = this.state;
127
128 return (
129 <div>
130 <div style={{ position: 'absolute', zIndex: 2001 }}>
131 <Transition
132 name="msgbox-fade"
133 onAfterLeave={() => { willUnmount && willUnmount() }}
134 >
135 <View show={visible}>
136 <div className={this.classNames('el-message-box__wrapper', customClass)}>
137 <div className="el-message-box">
138 {
139 title && (
140 <div className="el-message-box__header">
141 <div className="el-message-box__title">{title}</div>
142 {
143 showClose && (
144 <button type="button" className="el-message-box__headerbtn" aria-label="Close" onClick={this.handleAction.bind(this, 'cancel')}>
145 <i className="el-message-box__close el-icon-close" />
146 </button>
147 )
148 }
149 </div>
150 )
151 }
152 {
153 message && (
154 <div className="el-message-box__content">
155 <div className={this.classNames('el-message-box__status', this.typeClass())} />
156 <div className="el-message-box__message" style={{ marginLeft: this.typeClass() ? '50px' : '0' }}>
157 <div>{message}</div>
158 </div>
159 <View show={showInput}>
160 <div className="el-message-box__input">
161 <Input
162 className={this.classNames({
163 'invalid': editorErrorMessage
164 })}
165 type={inputType}
166 value={this.state.inputValue}
167 placeholder={inputPlaceholder}
168 onChange={this.onChange.bind(this)}
169 />
170 <div className="el-message-box__errormsg" style={{
171 visibility: editorErrorMessage ? 'visible' : 'hidden'
172 }}>{editorErrorMessage}</div>
173 </div>
174 </View>
175 </div>
176 )
177 }
178 <div className="el-message-box__btns">
179 <View show={showCancelButton}>
180 <Button className={cancelButtonClass} onClick={this.handleAction.bind(this, 'cancel')}>{this.cancelButtonText()}</Button>
181 </View>

Callers 1

nextFunction · 0.45

Calls 5

typeClassMethod · 0.95
cancelButtonTextMethod · 0.95
confirmButtonTextMethod · 0.95
willUnmountFunction · 0.85
classNamesMethod · 0.80

Tested by

no test coverage detected