MCPcopy Create free account
hub / github.com/AllenFang/react-bootstrap-table / render

Method render

src/TableEditColumn.js:189–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187 }
188
189 render() {
190 const {
191 editable,
192 format,
193 customEditor,
194 isFocus,
195 customStyleWithNav,
196 row,
197 attrs
198 } = this.props;
199 const { shakeEditor } = this.state;
200 const attr = {
201 ...editable.attrs,
202 ref: this.getInputRef(editable.attrs && editable.attrs.ref),
203 onKeyDown: this.getHandleKeyPress(editable.attrs && editable.attrs.onKeyDown),
204 onBlur: this.getHandleBlur(editable.attrs && editable.attrs.onBlur)
205 };
206 let style = { position: 'relative' };
207 let { fieldValue } = this.props;
208 let { className } = this.state;
209
210 if (editable.placeholder) {
211 attr.placeholder = editable.placeholder;
212 /* eslint-disable no-console */
213 console.warn(
214 'Setting editable.placeholder is deprecated. Use editable.attrs to set input attributes');
215 /* eslint-enable no-console */
216 }
217
218 const editorClass = classSet({ 'animated': shakeEditor, 'shake': shakeEditor });
219 fieldValue = fieldValue === 0 ? '0' : fieldValue;
220 let cellEditor;
221 if (customEditor) {
222 const customEditorProps = {
223 row,
224 ...attr,
225 defaultValue: this.valueShortCircuit(fieldValue),
226 ...customEditor.customEditorParameters
227 };
228 cellEditor = customEditor.getElement(this.handleCustomUpdate, customEditorProps);
229 } else {
230 cellEditor = editor(editable, attr, format, editorClass, this.valueShortCircuit(fieldValue),
231 null, row);
232 }
233
234 if (isFocus) {
235 if (customStyleWithNav) {
236 const customStyle = Util.isFunction(customStyleWithNav) ?
237 customStyleWithNav(fieldValue, row) : customStyleWithNav;
238 style = {
239 ...style,
240 ...customStyle
241 };
242 } else {
243 className = `${className} default-focus-cell`;
244 }
245 }
246

Callers

nothing calls this directly

Calls 3

valueShortCircuitMethod · 0.95
classSetFunction · 0.85
editorFunction · 0.85

Tested by

no test coverage detected