UNPKG

@sishuguojixuefu/react-native-form

Version:
55 lines 2.15 kB
"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importStar(require("react")); const react_native_1 = require("react-native"); class TextareaWrap extends react_1.Component { render() { const { required, label, children, error, count, inputed, last } = this.props; return (react_1.default.createElement(react_native_1.View, { style: !last && styles.container }, react_1.default.createElement(react_native_1.View, { style: styles.label }, react_1.default.createElement(react_native_1.Image, { source: require('../../../images/required.png'), style: { width: 9, height: required ? 9 : 0, marginHorizontal: 3 } }), react_1.default.createElement(react_native_1.Text, { style: styles.labelText }, label), react_1.default.createElement(react_native_1.Text, { style: styles.count }, count ? `${inputed} / ${count}` : '')), children, error ? react_1.default.createElement(react_native_1.Text, { style: styles.errorText }, error) : null)); } } exports.default = TextareaWrap; const styles = react_native_1.StyleSheet.create({ container: { borderBottomColor: '#dddddd', borderBottomWidth: react_native_1.StyleSheet.hairlineWidth, }, count: { flex: 1, textAlign: 'right', }, errorText: { color: 'red', fontSize: 14, includeFontPadding: true, marginLeft: 15, paddingBottom: 6, textAlignVertical: 'center', }, label: { alignItems: 'center', backgroundColor: '#ffffff', flexDirection: 'row', paddingRight: 15, paddingTop: 6, }, labelText: { color: '#000000', fontSize: 17, textAlignVertical: 'center', }, }); //# sourceMappingURL=TextareaWrap.js.map