@eslam-elmeniawy/react-native-common-components
Version:
Common `ReactNative` components packed in library for usage in projects.
39 lines (36 loc) • 1.17 kB
JavaScript
;
// External imports.
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { TextInput } from 'react-native-paper';
import { omit } from 'lodash';
// Types imports.
// Internal imports.
import styles from "./TextInput.styles.js";
import DefaultInput from "./DefaultInput.js";
import { trimStringToLength } from "../../utils/index.js";
import { jsx as _jsx } from "react/jsx-runtime";
const SelectInputInput = /*#__PURE__*/React.memo(props => {
const {
value,
selectProps,
right,
onPress,
style,
...other
} = props;
const _inputProps = omit(other, ['editable', 'value']);
return /*#__PURE__*/_jsx(DefaultInput, {
onPress: onPress,
editable: false,
value: trimStringToLength(value, selectProps?.trimLength),
right: right ?? /*#__PURE__*/_jsx(TextInput.Icon, {
icon: "menu-down",
onPress: onPress
}),
style: StyleSheet.flatten([styles.noVerticalMargin, styles.selectInputInput, omit(style ?? {}, ['marginVertical', 'marginTop', 'marginBottom', 'width'])]),
..._inputProps
});
});
export default SelectInputInput;
//# sourceMappingURL=SelectInputInput.js.map