UNPKG

@fruits-chain/react-native-xiaoshu

Version:
83 lines (77 loc) 2 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React, { memo } from 'react'; import Cell from '../cell'; import TextInput from '../text-input'; /** * Field 输入框 * @description 表单中的输入框组件。 * @description TODO 自定义输入项 * @description TODO 解决多行输入高度没对齐的问题 */ const FieldTextInput = _ref => { let { value, // TODO 优化属性传递 innerStyle, title, titleStyle, titleTextStyle, titleExtra, valueStyle, valueExtra, contentStyle, bordered = true, isLink = false, onPressLink, center = false, arrowDirection = 'right', required = false, vertical = false, valueTextNumberOfLines, textAlign = 'right', // TextInput 属性 placeholder, type, textInputStyle, textInputBordered, ...restProps } = _ref; if (vertical) { textAlign = 'left'; type = 'textarea'; } if (type === 'textarea') { textInputBordered = true; } const cellProps = { innerStyle, title, titleStyle, titleTextStyle, titleExtra, valueStyle, valueExtra, contentStyle, bordered, isLink, onPressLink, center, arrowDirection, required, vertical, valueTextNumberOfLines, textAlign }; return /*#__PURE__*/React.createElement(Cell, _extends({}, cellProps, { value: /*#__PURE__*/React.createElement(TextInput, _extends({}, restProps, { style: textInputStyle, type: type, bordered: textInputBordered, value: value, placeholder: placeholder, textAlign: textAlign })) })); }; export default /*#__PURE__*/memo(FieldTextInput); //# sourceMappingURL=text-input.js.map