10
10
11
11
'use strict' ;
12
12
13
+ const DeprecatedViewPropTypes = require ( 'DeprecatedViewPropTypes' ) ;
14
+ const DeprecatedColorPropType = require ( 'DeprecatedColorPropType' ) ;
15
+ const DocumentSelectionState = require ( 'DocumentSelectionState' ) ;
16
+ const TextStylePropTypes = require ( 'TextStylePropTypes' ) ;
13
17
const Platform = require ( 'Platform' ) ;
18
+ const PropTypes = require ( 'prop-types' ) ;
14
19
const React = require ( 'React' ) ;
15
20
const ReactNative = require ( 'ReactNative' ) ;
16
21
const StyleSheet = require ( 'StyleSheet' ) ;
@@ -28,7 +33,6 @@ const {
28
33
29
34
const emptyFunction = require ( 'fbjs/lib/emptyFunction' ) ;
30
35
const invariant = require ( 'fbjs/lib/invariant' ) ;
31
- const requireNativeComponent = require ( 'requireNativeComponent' ) ;
32
36
const warning = require ( 'fbjs/lib/warning' ) ;
33
37
const nullthrows = require ( 'nullthrows' ) ;
34
38
const setAndForwardRef = require ( 'setAndForwardRef' ) ;
@@ -587,6 +591,144 @@ const TextInputWithRef = React.forwardRef((props, ref) => (
587
591
588
592
TextInputWithRef . displayName = 'TextInput' ;
589
593
594
+ const DataDetectorTypes = [
595
+ 'phoneNumber' ,
596
+ 'link' ,
597
+ 'address' ,
598
+ 'calendarEvent' ,
599
+ 'none' ,
600
+ 'all' ,
601
+ ] ;
602
+
603
+ TextInputWithRef . propTypes = {
604
+ ...DeprecatedViewPropTypes ,
605
+ autoCapitalize : PropTypes . oneOf ( [ 'none' , 'sentences' , 'words' , 'characters' ] ) ,
606
+ autoCorrect : PropTypes . bool ,
607
+ spellCheck : PropTypes . bool ,
608
+ autoFocus : PropTypes . bool ,
609
+ allowFontScaling : PropTypes . bool ,
610
+ maxFontSizeMultiplier : PropTypes . number ,
611
+ editable : PropTypes . bool ,
612
+ keyboardType : PropTypes . oneOf ( [
613
+ // Cross-platform
614
+ 'default' ,
615
+ 'email-address' ,
616
+ 'numeric' ,
617
+ 'phone-pad' ,
618
+ 'number-pad' ,
619
+ // iOS-only
620
+ 'ascii-capable' ,
621
+ 'numbers-and-punctuation' ,
622
+ 'url' ,
623
+ 'name-phone-pad' ,
624
+ 'decimal-pad' ,
625
+ 'twitter' ,
626
+ 'web-search' ,
627
+ // Android-only
628
+ 'visible-password' ,
629
+ ] ) ,
630
+ keyboardAppearance : PropTypes . oneOf ( [ 'default' , 'light' , 'dark' ] ) ,
631
+ returnKeyType : PropTypes . oneOf ( [
632
+ // Cross-platform
633
+ 'done' ,
634
+ 'go' ,
635
+ 'next' ,
636
+ 'search' ,
637
+ 'send' ,
638
+ // Android-only
639
+ 'none' ,
640
+ 'previous' ,
641
+ // iOS-only
642
+ 'default' ,
643
+ 'emergency-call' ,
644
+ 'google' ,
645
+ 'join' ,
646
+ 'route' ,
647
+ 'yahoo' ,
648
+ ] ) ,
649
+ returnKeyLabel : PropTypes . string ,
650
+ maxLength : PropTypes . number ,
651
+ numberOfLines : PropTypes . number ,
652
+ disableFullscreenUI : PropTypes . bool ,
653
+ enablesReturnKeyAutomatically : PropTypes . bool ,
654
+ multiline : PropTypes . bool ,
655
+ textBreakStrategy : PropTypes . oneOf ( [ 'simple' , 'highQuality' , 'balanced' ] ) ,
656
+ onBlur : PropTypes . func ,
657
+ onFocus : PropTypes . func ,
658
+ onChange : PropTypes . func ,
659
+ onChangeText : PropTypes . func ,
660
+ onContentSizeChange : PropTypes . func ,
661
+ onTextInput : PropTypes . func ,
662
+ onEndEditing : PropTypes . func ,
663
+ onSelectionChange : PropTypes . func ,
664
+ onSubmitEditing : PropTypes . func ,
665
+ onKeyPress : PropTypes . func ,
666
+ onLayout : PropTypes . func ,
667
+ onScroll : PropTypes . func ,
668
+ placeholder : PropTypes . string ,
669
+ placeholderTextColor : DeprecatedColorPropType ,
670
+ scrollEnabled : PropTypes . bool ,
671
+ secureTextEntry : PropTypes . bool ,
672
+ selectionColor : DeprecatedColorPropType ,
673
+ selectionState : PropTypes . instanceOf ( DocumentSelectionState ) ,
674
+ selection : PropTypes . shape ( {
675
+ start : PropTypes . number . isRequired ,
676
+ end : PropTypes . number ,
677
+ } ) ,
678
+ value : PropTypes . string ,
679
+ defaultValue : PropTypes . string ,
680
+ clearButtonMode : PropTypes . oneOf ( [
681
+ 'never' ,
682
+ 'while-editing' ,
683
+ 'unless-editing' ,
684
+ 'always' ,
685
+ ] ) ,
686
+ clearTextOnFocus : PropTypes . bool ,
687
+ selectTextOnFocus : PropTypes . bool ,
688
+ blurOnSubmit : PropTypes . bool ,
689
+ style : TextStylePropTypes ,
690
+ underlineColorAndroid : DeprecatedColorPropType ,
691
+ inlineImageLeft : PropTypes . string ,
692
+ inlineImagePadding : PropTypes . number ,
693
+ dataDetectorTypes : PropTypes . oneOfType ( [
694
+ PropTypes . oneOf ( DataDetectorTypes ) ,
695
+ PropTypes . arrayOf ( PropTypes . oneOf ( DataDetectorTypes ) ) ,
696
+ ] ) ,
697
+ caretHidden : PropTypes . bool ,
698
+ contextMenuHidden : PropTypes . bool ,
699
+ inputAccessoryViewID : PropTypes . string ,
700
+ textContentType : PropTypes . oneOf ( [
701
+ 'none' ,
702
+ 'URL' ,
703
+ 'addressCity' ,
704
+ 'addressCityAndState' ,
705
+ 'addressState' ,
706
+ 'countryName' ,
707
+ 'creditCardNumber' ,
708
+ 'emailAddress' ,
709
+ 'familyName' ,
710
+ 'fullStreetAddress' ,
711
+ 'givenName' ,
712
+ 'jobTitle' ,
713
+ 'location' ,
714
+ 'middleName' ,
715
+ 'name' ,
716
+ 'namePrefix' ,
717
+ 'nameSuffix' ,
718
+ 'nickname' ,
719
+ 'organizationName' ,
720
+ 'postalCode' ,
721
+ 'streetAddressLine1' ,
722
+ 'streetAddressLine2' ,
723
+ 'sublocality' ,
724
+ 'telephoneNumber' ,
725
+ 'username' ,
726
+ 'password' ,
727
+ 'newPassword' ,
728
+ 'oneTimeCode' ,
729
+ ] ) ,
730
+ } ;
731
+
590
732
const styles = StyleSheet . create ( {
591
733
multilineInput : {
592
734
// This default top inset makes RCTMultilineTextInputView seem as close as possible
0 commit comments