@plusscommunities/pluss-core-app 1.4.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/actions/FollowerActions.js +34 -0
- package/dist/module/actions/FollowerActions.js.map +1 -0
- package/dist/module/actions/MediaActions.js +20 -0
- package/dist/module/actions/MediaActions.js.map +1 -0
- package/dist/module/actions/ResidentActions.js +26 -0
- package/dist/module/actions/ResidentActions.js.map +1 -0
- package/dist/module/actions/UserActions.js +214 -0
- package/dist/module/actions/UserActions.js.map +1 -0
- package/dist/module/actions/index.js +5 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +14 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/apis/analyticsActions.js +20 -0
- package/dist/module/apis/analyticsActions.js.map +1 -0
- package/dist/module/apis/contactActions.js +27 -0
- package/dist/module/apis/contactActions.js.map +1 -0
- package/dist/module/apis/eventActions.js +163 -0
- package/dist/module/apis/eventActions.js.map +1 -0
- package/dist/module/apis/fileActions.js +96 -0
- package/dist/module/apis/fileActions.js.map +1 -0
- package/dist/module/apis/followerActions.js +38 -0
- package/dist/module/apis/followerActions.js.map +1 -0
- package/dist/module/apis/index.js +11 -0
- package/dist/module/apis/index.js.map +1 -0
- package/dist/module/apis/notificationActions.js +60 -0
- package/dist/module/apis/notificationActions.js.map +1 -0
- package/dist/module/apis/profileActions.js +14 -0
- package/dist/module/apis/profileActions.js.map +1 -0
- package/dist/module/apis/reactionActions.js +78 -0
- package/dist/module/apis/reactionActions.js.map +1 -0
- package/dist/module/apis/typeActions.js +15 -0
- package/dist/module/apis/typeActions.js.map +1 -0
- package/dist/module/apis/userActions.js +104 -0
- package/dist/module/apis/userActions.js.map +1 -0
- package/{assets → dist/module/assets}/icons/reactions/heart.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/party.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/sad.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +149 -0
- package/dist/module/colours.js.map +1 -0
- package/dist/module/components/AddButton.js +45 -0
- package/dist/module/components/AddButton.js.map +1 -0
- package/dist/module/components/Attachment.js +59 -0
- package/dist/module/components/Attachment.js.map +1 -0
- package/dist/module/components/AudienceSelectorLauncher.js +70 -0
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
- package/dist/module/components/AudienceSelectorPage.js +376 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/BackButton.js +62 -0
- package/dist/module/components/BackButton.js.map +1 -0
- package/dist/module/components/CategoryTabs.js +171 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +363 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +785 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +85 -0
- package/dist/module/components/ConfirmPopup.js.map +1 -0
- package/dist/module/components/ConfirmationPopup.js +77 -0
- package/dist/module/components/ConfirmationPopup.js.map +1 -0
- package/dist/module/components/DropDownItem.js +82 -0
- package/dist/module/components/DropDownItem.js.map +1 -0
- package/dist/module/components/DropDownMenu.js +46 -0
- package/dist/module/components/DropDownMenu.js.map +1 -0
- package/dist/module/components/EmptyStateMain.js +50 -0
- package/dist/module/components/EmptyStateMain.js.map +1 -0
- package/dist/module/components/EmptyStateWidget.js +52 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +37 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +77 -0
- package/dist/module/components/FontScalePopup.js.map +1 -0
- package/dist/module/components/FormCard.js +28 -0
- package/dist/module/components/FormCard.js.map +1 -0
- package/dist/module/components/FormCardSection.js +240 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +77 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +145 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +161 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +174 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +491 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/ImagePopup.js +257 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +72 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +850 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +72 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +164 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +224 -0
- package/dist/module/components/LoadingCircles.js.map +1 -0
- package/dist/module/components/LoadingIndicator.js +95 -0
- package/dist/module/components/LoadingIndicator.js.map +1 -0
- package/dist/module/components/LoadingStateWidget.js +51 -0
- package/dist/module/components/LoadingStateWidget.js.map +1 -0
- package/dist/module/components/MediaPlayer.js +440 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +46 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +188 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +997 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +204 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +66 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +138 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +128 -0
- package/dist/module/components/PopupMenu.js.map +1 -0
- package/dist/module/components/PositionedImage.js +333 -0
- package/dist/module/components/PositionedImage.js.map +1 -0
- package/dist/module/components/ProfilePic.js +119 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +84 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +129 -0
- package/dist/module/components/Reaction.js.map +1 -0
- package/dist/module/components/Reactions.js +84 -0
- package/dist/module/components/Reactions.js.map +1 -0
- package/dist/module/components/SharingTools.js +162 -0
- package/dist/module/components/SharingTools.js.map +1 -0
- package/dist/module/components/Spinner.js +25 -0
- package/dist/module/components/Spinner.js.map +1 -0
- package/dist/module/components/StickyFooter.js +37 -0
- package/dist/module/components/StickyFooter.js.map +1 -0
- package/dist/module/components/TextStyle.js +34 -0
- package/dist/module/components/TextStyle.js.map +1 -0
- package/dist/module/components/Toggle.js +70 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +73 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +146 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +291 -0
- package/dist/module/components/UserListing.js.map +1 -0
- package/dist/module/components/VideoPopup.js +123 -0
- package/dist/module/components/VideoPopup.js.map +1 -0
- package/dist/module/components/WarningPopup.js +87 -0
- package/dist/module/components/WarningPopup.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +325 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +123 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +53 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +416 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +405 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
- package/dist/module/config.js +27 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +16 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/fonts/index.js +2 -0
- package/dist/module/fonts/index.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.js +5 -0
- package/dist/module/fonts/pluss60-icons.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.json +1097 -0
- package/dist/module/helper.js +436 -0
- package/dist/module/helper.js.map +1 -0
- package/dist/module/index.js +13 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/session.js +54 -0
- package/dist/module/session.js.map +1 -0
- package/dist/module/styles.js +67 -0
- package/dist/module/styles.js.map +1 -0
- package/package.json +22 -5
- package/src/assets/icons/reactions/heart.png +0 -0
- package/src/assets/icons/reactions/party.png +0 -0
- package/src/assets/icons/reactions/sad.png +0 -0
- package/src/assets/icons/reactions/smile.png +0 -0
- package/src/components/CommentReply.js +0 -2
- package/src/constants.js +4 -4
- package/src/helper.js +4 -4
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import { TextInput, View, TouchableWithoutFeedback } from 'react-native';
|
|
4
|
+
import { Icon } from 'react-native-elements';
|
|
5
|
+
import { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from '../colours';
|
|
6
|
+
import { Pl60Icon } from '../fonts';
|
|
7
|
+
|
|
8
|
+
class GenericInput extends Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = {
|
|
12
|
+
showSecureText: false
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
blur() {
|
|
17
|
+
this.refs.input.blur();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
toggleSecureText() {
|
|
21
|
+
this.setState({
|
|
22
|
+
showSecureText: !this.state.showSecureText
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
renderLeftIcon() {
|
|
27
|
+
if (!this.props.icon) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (this.props.iconType && this.props.iconType === 'pl60') {
|
|
32
|
+
return /*#__PURE__*/React.createElement(Pl60Icon, {
|
|
33
|
+
name: this.props.icon,
|
|
34
|
+
style: styles.searchIcon
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
39
|
+
type: "font-awesome",
|
|
40
|
+
name: this.props.icon,
|
|
41
|
+
iconStyle: styles.searchIcon
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
renderRightIcon() {
|
|
46
|
+
if (this.props.secureTextEntry) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
48
|
+
onPress: this.toggleSecureText.bind(this)
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Pl60Icon, {
|
|
50
|
+
name: this.state.showSecureText ? 'hide' : 'show',
|
|
51
|
+
style: [styles.clearIcon, styles.secureIcon]
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (this.props.rightIcon) {
|
|
56
|
+
if (this.props.rightIconAction) {
|
|
57
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
58
|
+
onPress: this.props.rightIconAction
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
60
|
+
type: "font-awesome",
|
|
61
|
+
name: this.props.rightIcon,
|
|
62
|
+
iconStyle: styles.clearIcon
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
67
|
+
type: "font-awesome",
|
|
68
|
+
name: this.props.rightIcon,
|
|
69
|
+
iconStyle: styles.clearIcon
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (this.props.hasClear && !_.isEmpty(this.props.value)) {
|
|
74
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
75
|
+
onPress: () => {
|
|
76
|
+
this.props.onChangeText('');
|
|
77
|
+
}
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Pl60Icon, {
|
|
79
|
+
name: "clear",
|
|
80
|
+
style: styles.clearIcon
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
render() {
|
|
88
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
89
|
+
style: [styles.searchInputContainer, this.props.squaredCorners && styles.squaredSearchInputContainer, this.props.autoGrow ? {
|
|
90
|
+
paddingVertical: 8,
|
|
91
|
+
minHeight: 40
|
|
92
|
+
} : {
|
|
93
|
+
height: 36
|
|
94
|
+
}, this.props.containerStyle]
|
|
95
|
+
}, this.renderLeftIcon(), /*#__PURE__*/React.createElement(TextInput, {
|
|
96
|
+
ref: "input",
|
|
97
|
+
placeholder: this.props.placeholder,
|
|
98
|
+
placeholderTextColor: TEXT_LIGHT,
|
|
99
|
+
autoCorrect: this.props.autoCorrect != null ? this.props.autoCorrect : false,
|
|
100
|
+
autoFocus: this.props.autoFocus != null ? this.props.autoFocus : false,
|
|
101
|
+
autoGrow: this.props.autoGrow != null ? this.props.autoGrow : false,
|
|
102
|
+
multiline: this.props.multiline != null ? this.props.multiline : false,
|
|
103
|
+
style: [styles.searchText, this.props.style, {
|
|
104
|
+
textAlignVertical: this.props.multiline ? 'top' : 'center'
|
|
105
|
+
}, this.props.minHeight && {
|
|
106
|
+
minHeight: this.props.minHeight
|
|
107
|
+
}],
|
|
108
|
+
value: this.props.value,
|
|
109
|
+
onChangeText: this.props.onChangeText,
|
|
110
|
+
keyboardType: this.props.keyboardType,
|
|
111
|
+
selectionColor: TEXT_DARK,
|
|
112
|
+
underlineColorAndroid: "rgba(0,0,0,0)",
|
|
113
|
+
editable: this.props.editable != null ? this.props.editable : true,
|
|
114
|
+
autoCapitalize: this.props.autoCapitalize || 'none',
|
|
115
|
+
onKeyPress: this.props.onKeyPress,
|
|
116
|
+
onSubmitEditing: this.props.onSubmitEditing,
|
|
117
|
+
onFocus: this.props.onFocus,
|
|
118
|
+
onBlur: this.props.onBlur,
|
|
119
|
+
secureTextEntry: this.props.secureTextEntry && !this.state.showSecureText
|
|
120
|
+
}), this.renderRightIcon());
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const styles = {
|
|
126
|
+
searchInputContainer: {
|
|
127
|
+
flex: 1,
|
|
128
|
+
borderRadius: 25,
|
|
129
|
+
backgroundColor: '#ebeff2',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
flexDirection: 'row',
|
|
132
|
+
paddingHorizontal: 16
|
|
133
|
+
},
|
|
134
|
+
squaredSearchInputContainer: {
|
|
135
|
+
borderRadius: 5,
|
|
136
|
+
paddingHorizontal: 8
|
|
137
|
+
},
|
|
138
|
+
searchIcon: {
|
|
139
|
+
fontSize: 14,
|
|
140
|
+
color: TEXT_LIGHT,
|
|
141
|
+
marginRight: 8
|
|
142
|
+
},
|
|
143
|
+
clearIcon: {
|
|
144
|
+
fontSize: 14,
|
|
145
|
+
color: TEXT_LIGHT,
|
|
146
|
+
marginLeft: 8,
|
|
147
|
+
marginTop: 8,
|
|
148
|
+
marginBottom: 8
|
|
149
|
+
},
|
|
150
|
+
secureIcon: {
|
|
151
|
+
fontSize: 20
|
|
152
|
+
},
|
|
153
|
+
searchText: {
|
|
154
|
+
color: TEXT_DARKEST,
|
|
155
|
+
fontFamily: 'sf-regular',
|
|
156
|
+
fontSize: 16,
|
|
157
|
+
flex: 1
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
export { GenericInput };
|
|
161
|
+
//# sourceMappingURL=GenericInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["GenericInput.js"],"names":["React","Component","_","TextInput","View","TouchableWithoutFeedback","Icon","TEXT_LIGHT","TEXT_DARK","TEXT_DARKEST","Pl60Icon","GenericInput","constructor","props","state","showSecureText","blur","refs","input","toggleSecureText","setState","renderLeftIcon","icon","iconType","styles","searchIcon","renderRightIcon","secureTextEntry","bind","clearIcon","secureIcon","rightIcon","rightIconAction","hasClear","isEmpty","value","onChangeText","render","searchInputContainer","squaredCorners","squaredSearchInputContainer","autoGrow","paddingVertical","minHeight","height","containerStyle","placeholder","autoCorrect","autoFocus","multiline","searchText","style","textAlignVertical","keyboardType","editable","autoCapitalize","onKeyPress","onSubmitEditing","onFocus","onBlur","flex","borderRadius","backgroundColor","alignItems","flexDirection","paddingHorizontal","fontSize","color","marginRight","marginLeft","marginTop","marginBottom","fontFamily"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,SAASC,SAAT,EAAoBC,IAApB,EAA0BC,wBAA1B,QAA0D,cAA1D;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,YAAhC,QAAoD,YAApD;AACA,SAASC,QAAT,QAAyB,UAAzB;;AAEA,MAAMC,YAAN,SAA2BV,SAA3B,CAAqC;AACnCW,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,UAAMA,KAAN;AACA,SAAKC,KAAL,GAAa;AACXC,MAAAA,cAAc,EAAE;AADL,KAAb;AAGD;;AAEDC,EAAAA,IAAI,GAAG;AACL,SAAKC,IAAL,CAAUC,KAAV,CAAgBF,IAAhB;AACD;;AAEDG,EAAAA,gBAAgB,GAAG;AACjB,SAAKC,QAAL,CAAc;AACZL,MAAAA,cAAc,EAAE,CAAC,KAAKD,KAAL,CAAWC;AADhB,KAAd;AAGD;;AAEDM,EAAAA,cAAc,GAAG;AACf,QAAI,CAAC,KAAKR,K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AWc,eAAX,IAA8B,CAAC,KAAKb,KAAL,CAAWC;AAzB7D,MATF,EAoCG,KAAKW,eAAL,EApCH,CADF;AAwCD;;AArGkC;;AAwGrC,MAAMF,MAAM,GAAG;AACbc,EAAAA,oBAAoB,EAAE;AACpBsB,IAAAA,IAAI,EAAE,CADc;AAEpBC,IAAAA,YAAY,EAAE,EAFM;AAGpBC,IAAAA,eAAe,EAAE,SAHG;AAIpBC,IAAAA,UAAU,EAAE,QAJQ;AAKpBC,IAAAA,aAAa,EAAE,KALK;AAMpBC,IAAAA,iBAAiB,EAAE;AANC,GADT;AASbzB,EAAAA,2BAA2B,EAAE;AAC3BqB,IAAAA,YAAY,EAAE,CADa;AAE3BI,IAAAA,iBAAiB,EAAE;AAFQ,GAThB;AAabxC,EAAAA,UAAU,EAAE;AACVyC,IAAAA,QAAQ,EAAE,EADA;AAEVC,IAAAA,KAAK,EAAE5D,UAFG;AAGV6D,IAAAA,WAAW,EAAE;AAHH,GAbC;AAkBbvC,EAAAA,SAAS,EAAE;AACTqC,IAAAA,QAAQ,EAAE,EADD;AAETC,IAAAA,KAAK,EAAE5D,UAFE;AAGT8D,IAAAA,UAAU,EAAE,CAHH;AAITC,IAAAA,SAAS,EAAE,CAJF;AAKTC,IAAAA,YAAY,EAAE;AALL,GAlBE;AAyBbzC,EAAAA,UAAU,EAAE;AACVoC,IAAAA,QAAQ,EAAE;AADA,GAzBC;AA4BbhB,EAAAA,UAAU,EAAE;AACViB,IAAAA,KAAK,EAAE1D,YADG;AAEV+D,IAAAA,UAAU,EAAE,YAFF;AAGVN,IAAAA,QAAQ,EAAE,EAHA;AAIVN,IAAAA,IAAI,EAAE;AAJI;AA5BC,CAAf;AAoCA,SAASjD,YAAT","sourcesContent":["import React, { Component } from 'react';\nimport _ from 'lodash';\nimport { TextInput, View, TouchableWithoutFeedback } from 'react-native';\nimport { Icon } from 'react-native-elements';\nimport { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from '../colours';\nimport { Pl60Icon } from '../fonts';\n\nclass GenericInput extends Component {\n constructor(props) {\n super(props);\n this.state = {\n showSecureText: false,\n };\n }\n\n blur() {\n this.refs.input.blur();\n }\n\n toggleSecureText() {\n this.setState({\n showSecureText: !this.state.showSecureText,\n });\n }\n\n renderLeftIcon() {\n if (!this.props.icon) {\n return null;\n }\n if (this.props.iconType && this.props.iconType === 'pl60') {\n return <Pl60Icon name={this.props.icon} style={styles.searchIcon} />;\n }\n return <Icon type=\"font-awesome\" name={this.props.icon} iconStyle={styles.searchIcon} />;\n }\n\n renderRightIcon() {\n if (this.props.secureTextEntry) {\n return (\n <TouchableWithoutFeedback onPress={this.toggleSecureText.bind(this)}>\n <Pl60Icon name={this.state.showSecureText ? 'hide' : 'show'} style={[styles.clearIcon, styles.secureIcon]} />\n </TouchableWithoutFeedback>\n );\n }\n if (this.props.rightIcon) {\n if (this.props.rightIconAction) {\n return (\n <TouchableWithoutFeedback onPress={this.props.rightIconAction}>\n <Icon type=\"font-awesome\" name={this.props.rightIcon} iconStyle={styles.clearIcon} />\n </TouchableWithoutFeedback>\n );\n }\n return <Icon type=\"font-awesome\" name={this.props.rightIcon} iconStyle={styles.clearIcon} />;\n }\n if (this.props.hasClear && !_.isEmpty(this.props.value)) {\n return (\n <TouchableWithoutFeedback\n onPress={() => {\n this.props.onChangeText('');\n }}\n >\n <Pl60Icon name=\"clear\" style={styles.clearIcon} />\n </TouchableWithoutFeedback>\n );\n }\n return null;\n }\n\n render() {\n return (\n <View\n style={[\n styles.searchInputContainer,\n this.props.squaredCorners && styles.squaredSearchInputContainer,\n this.props.autoGrow ? { paddingVertical: 8, minHeight: 40 } : { height: 36 },\n this.props.containerStyle,\n ]}\n >\n {this.renderLeftIcon()}\n <TextInput\n ref=\"input\"\n placeholder={this.props.placeholder}\n placeholderTextColor={TEXT_LIGHT}\n autoCorrect={this.props.autoCorrect != null ? this.props.autoCorrect : false}\n autoFocus={this.props.autoFocus != null ? this.props.autoFocus : false}\n autoGrow={this.props.autoGrow != null ? this.props.autoGrow : false}\n multiline={this.props.multiline != null ? this.props.multiline : false}\n style={[\n styles.searchText,\n this.props.style,\n { textAlignVertical: this.props.multiline ? 'top' : 'center' },\n this.props.minHeight && { minHeight: this.props.minHeight },\n ]}\n value={this.props.value}\n onChangeText={this.props.onChangeText}\n keyboardType={this.props.keyboardType}\n selectionColor={TEXT_DARK}\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n editable={this.props.editable != null ? this.props.editable : true}\n autoCapitalize={this.props.autoCapitalize || 'none'}\n onKeyPress={this.props.onKeyPress}\n onSubmitEditing={this.props.onSubmitEditing}\n onFocus={this.props.onFocus}\n onBlur={this.props.onBlur}\n secureTextEntry={this.props.secureTextEntry && !this.state.showSecureText}\n />\n {this.renderRightIcon()}\n </View>\n );\n }\n}\n\nconst styles = {\n searchInputContainer: {\n flex: 1,\n borderRadius: 25,\n backgroundColor: '#ebeff2',\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: 16,\n },\n squaredSearchInputContainer: {\n borderRadius: 5,\n paddingHorizontal: 8,\n },\n searchIcon: {\n fontSize: 14,\n color: TEXT_LIGHT,\n marginRight: 8,\n },\n clearIcon: {\n fontSize: 14,\n color: TEXT_LIGHT,\n marginLeft: 8,\n marginTop: 8,\n marginBottom: 8,\n },\n secureIcon: {\n fontSize: 20,\n },\n searchText: {\n color: TEXT_DARKEST,\n fontFamily: 'sf-regular',\n fontSize: 16,\n flex: 1,\n },\n};\n\nexport { GenericInput };\n"]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import React, { PureComponent } from 'react';
|
|
4
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
5
|
+
import { Icon } from 'react-native-elements';
|
|
6
|
+
import { connect } from 'react-redux';
|
|
7
|
+
import { GenericInput } from './GenericInput';
|
|
8
|
+
import { TEXT_DARKEST, COLOUR_GREEN, COLOUR_GRAPEFRUIT, getMainBrandingColourFromState } from '../colours';
|
|
9
|
+
import { RadioButton } from './RadioButton';
|
|
10
|
+
|
|
11
|
+
class GenericInputSection extends PureComponent {
|
|
12
|
+
renderValidationDot() {
|
|
13
|
+
if (!this.props.required) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
18
|
+
style: [styles.validatorDot, this.props.isValid() ? styles.validatorTrue : styles.validatorFalse]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
renderLabel() {
|
|
23
|
+
if (!this.props.label) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: styles.labelContainer
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
30
|
+
style: [styles.labelText, this.props.labelStyle]
|
|
31
|
+
}, this.props.label), this.renderValidationDot());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
renderRadioOption(label, value, isActive, onChange, style) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
36
|
+
onPress: () => onChange(value),
|
|
37
|
+
key: label,
|
|
38
|
+
style: [styles.radioOption, style],
|
|
39
|
+
hitSlop: {
|
|
40
|
+
top: 8,
|
|
41
|
+
left: 8,
|
|
42
|
+
bottom: 8,
|
|
43
|
+
right: 8
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement(RadioButton, {
|
|
46
|
+
onPress: () => onChange(value),
|
|
47
|
+
isActive: isActive,
|
|
48
|
+
iconSize: 22,
|
|
49
|
+
style: styles.radioOptionButton
|
|
50
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
51
|
+
style: styles.radioOptionText
|
|
52
|
+
}, label));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
renderInput() {
|
|
56
|
+
if (this.props.children) {
|
|
57
|
+
return this.props.children;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (this.props.inputType === 'toggle') {
|
|
61
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
62
|
+
style: styles.radioOptionsContainer
|
|
63
|
+
}, this.renderRadioOption('Yes', true, this.props.value === true, this.props.onChange), this.renderRadioOption('No', false, this.props.value === false, this.props.onChange));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (this.props.inputType === 'radio') {
|
|
67
|
+
return /*#__PURE__*/React.createElement(View, null, this.props.options.map(o => {
|
|
68
|
+
return this.renderRadioOption(o.Label, o.Value, this.props.value === o.Value, this.props.onChange, styles.radioOptionVertical);
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (this.props.inputType === 'optionSelector') {
|
|
73
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
74
|
+
onPress: this.props.onPress
|
|
75
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
76
|
+
style: styles.optionSelector
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
78
|
+
style: styles.optionSelectorText
|
|
79
|
+
}, this.props.value), /*#__PURE__*/React.createElement(Icon, {
|
|
80
|
+
name: "angle-right",
|
|
81
|
+
type: "font-awesome",
|
|
82
|
+
iconStyle: [styles.optionSelectorIcon, {
|
|
83
|
+
color: this.props.colourBrandingMain
|
|
84
|
+
}]
|
|
85
|
+
})));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return /*#__PURE__*/React.createElement(GenericInput, _extends({}, this.props, {
|
|
89
|
+
containerStyle: [styles.input, this.props.containerStyle]
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
render() {
|
|
94
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
style: [styles.container, this.props.sectionStyle]
|
|
96
|
+
}, this.renderLabel(), this.renderInput());
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const styles = {
|
|
102
|
+
container: {},
|
|
103
|
+
labelContainer: {
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
alignItems: 'center'
|
|
106
|
+
},
|
|
107
|
+
labelText: {
|
|
108
|
+
fontFamily: 'sf-semibold',
|
|
109
|
+
fontSize: 16,
|
|
110
|
+
color: TEXT_DARKEST
|
|
111
|
+
},
|
|
112
|
+
input: {
|
|
113
|
+
marginTop: 8
|
|
114
|
+
},
|
|
115
|
+
validatorDot: {
|
|
116
|
+
height: 6,
|
|
117
|
+
width: 6,
|
|
118
|
+
borderRadius: 3,
|
|
119
|
+
marginLeft: 8
|
|
120
|
+
},
|
|
121
|
+
validatorTrue: {
|
|
122
|
+
backgroundColor: COLOUR_GREEN
|
|
123
|
+
},
|
|
124
|
+
validatorFalse: {
|
|
125
|
+
backgroundColor: COLOUR_GRAPEFRUIT
|
|
126
|
+
},
|
|
127
|
+
radioOptionsContainer: {
|
|
128
|
+
flexDirection: 'row',
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
marginTop: 8
|
|
131
|
+
},
|
|
132
|
+
radioOptionVertical: {
|
|
133
|
+
marginTop: 16
|
|
134
|
+
},
|
|
135
|
+
radioOption: {
|
|
136
|
+
flexDirection: 'row',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
marginRight: 24
|
|
139
|
+
},
|
|
140
|
+
radioOptionButton: {
|
|
141
|
+
marginRight: 8
|
|
142
|
+
},
|
|
143
|
+
radioOptionText: {
|
|
144
|
+
fontFamily: 'sf-medium',
|
|
145
|
+
fontSize: 14,
|
|
146
|
+
color: TEXT_DARKEST
|
|
147
|
+
},
|
|
148
|
+
optionSelector: {
|
|
149
|
+
marginTop: 8,
|
|
150
|
+
flex: 1,
|
|
151
|
+
height: 36,
|
|
152
|
+
backgroundColor: '#ebeff2',
|
|
153
|
+
alignItems: 'center',
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
justifyContent: 'space-between',
|
|
156
|
+
borderRadius: 5,
|
|
157
|
+
paddingHorizontal: 8
|
|
158
|
+
},
|
|
159
|
+
optionSelectorText: {
|
|
160
|
+
color: TEXT_DARKEST,
|
|
161
|
+
fontFamily: 'sf-regular',
|
|
162
|
+
fontSize: 16
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const mapStateToProps = state => {
|
|
167
|
+
return {
|
|
168
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const genericInputSection = connect(mapStateToProps, {})(GenericInputSection);
|
|
173
|
+
export { genericInputSection as GenericInputSection };
|
|
174
|
+
//# sourceMappingURL=GenericInputSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["GenericInputSection.js"],"names":["React","PureComponent","View","Text","TouchableOpacity","Icon","connect","GenericInput","TEXT_DARKEST","COLOUR_GREEN","COLOUR_GRAPEFRUIT","getMainBrandingColourFromState","RadioButton","GenericInputSection","renderValidationDot","props","required","styles","validatorDot","isValid","validatorTrue","validatorFalse","renderLabel","label","labelContainer","labelText","labelStyle","renderRadioOption","value","isActive","onChange","style","radioOption","top","left","bottom","right","radioOptionButton","radioOptionText","renderInput","children","inputType","radioOptionsContainer","options","map","o","Label","Value","radioOptionVertical","onPress","optionSelector","optionSelectorText","optionSelectorIcon","color","colourBrandingMain","input","containerStyle","render","container","sectionStyle","flexDirection","alignItems","fontFamily","fontSize","marginTop","height","width","borderRadius","marginLeft","backgroundColor","marginRight","flex","justifyContent","paddingHorizontal","mapStateToProps","state","genericInputSection"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,gBAArB,QAA6C,cAA7C;AACA,SAASC,IAAT,QAAqB,uB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AAE,eAPF;AAQdL,IAAAA,YAAY,EAAE,CARA;AASdM,IAAAA,iBAAiB,EAAE;AATL,GA/CH;AA0DbtB,EAAAA,kBAAkB,EAAE;AAClBE,IAAAA,KAAK,EAAE7C,YADW;AAElBsD,IAAAA,UAAU,EAAE,YAFM;AAGlBC,IAAAA,QAAQ,EAAE;AAHQ;AA1DP,CAAf;;AAiEA,MAAMW,eAAe,GAAGC,KAAK,IAAI;AAC/B,SAAO;AACLrB,IAAAA,kBAAkB,EAAE3C,8BAA8B,CAACgE,KAAD;AAD7C,GAAP;AAGD,CAJD;;AAMA,MAAMC,mBAAmB,GAAGtE,OAAO,CAACoE,eAAD,EAAkB,EAAlB,CAAP,CAA6B7D,mBAA7B,CAA5B;AACA,SAAS+D,mBAAmB,IAAI/D,mBAAhC","sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, Text, TouchableOpacity } from 'react-native';\nimport { Icon } from 'react-native-elements';\nimport { connect } from 'react-redux';\nimport { GenericInput } from './GenericInput';\nimport { TEXT_DARKEST, COLOUR_GREEN, COLOUR_GRAPEFRUIT, getMainBrandingColourFromState } from '../colours';\nimport { RadioButton } from './RadioButton';\n\nclass GenericInputSection extends PureComponent {\n renderValidationDot() {\n if (!this.props.required) {\n return null;\n }\n return <View style={[styles.validatorDot, this.props.isValid() ? styles.validatorTrue : styles.validatorFalse]} />;\n }\n\n renderLabel() {\n if (!this.props.label) {\n return null;\n }\n return (\n <View style={styles.labelContainer}>\n <Text style={[styles.labelText, this.props.labelStyle]}>{this.props.label}</Text>\n {this.renderValidationDot()}\n </View>\n );\n }\n\n renderRadioOption(label, value, isActive, onChange, style) {\n return (\n <TouchableOpacity\n onPress={() => onChange(value)}\n key={label}\n style={[styles.radioOption, style]}\n hitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n >\n <RadioButton onPress={() => onChange(value)} isActive={isActive} iconSize={22} style={styles.radioOptionButton} />\n <Text style={styles.radioOptionText}>{label}</Text>\n </TouchableOpacity>\n );\n }\n\n renderInput() {\n if (this.props.children) {\n return this.props.children;\n }\n if (this.props.inputType === 'toggle') {\n return (\n <View style={styles.radioOptionsContainer}>\n {this.renderRadioOption('Yes', true, this.props.value === true, this.props.onChange)}\n {this.renderRadioOption('No', false, this.props.value === false, this.props.onChange)}\n </View>\n );\n }\n if (this.props.inputType === 'radio') {\n return (\n <View>\n {this.props.options.map(o => {\n return this.renderRadioOption(o.Label, o.Value, this.props.value === o.Value, this.props.onChange, styles.radioOptionVertical);\n })}\n </View>\n );\n }\n if (this.props.inputType === 'optionSelector') {\n return (\n <TouchableOpacity onPress={this.props.onPress}>\n <View style={styles.optionSelector}>\n <Text style={styles.optionSelectorText}>{this.props.value}</Text>\n <Icon\n name=\"angle-right\"\n type=\"font-awesome\"\n iconStyle={[styles.optionSelectorIcon, { color: this.props.colourBrandingMain }]}\n />\n </View>\n </TouchableOpacity>\n );\n }\n return <GenericInput {...this.props} containerStyle={[styles.input, this.props.containerStyle]} />;\n }\n\n render() {\n return (\n <View style={[styles.container, this.props.sectionStyle]}>\n {this.renderLabel()}\n {this.renderInput()}\n </View>\n );\n }\n}\n\nconst styles = {\n container: {},\n labelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n labelText: {\n fontFamily: 'sf-semibold',\n fontSize: 16,\n color: TEXT_DARKEST,\n },\n input: {\n marginTop: 8,\n },\n validatorDot: {\n height: 6,\n width: 6,\n borderRadius: 3,\n marginLeft: 8,\n },\n validatorTrue: {\n backgroundColor: COLOUR_GREEN,\n },\n validatorFalse: {\n backgroundColor: COLOUR_GRAPEFRUIT,\n },\n radioOptionsContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: 8,\n },\n radioOptionVertical: {\n marginTop: 16,\n },\n radioOption: {\n flexDirection: 'row',\n alignItems: 'center',\n marginRight: 24,\n },\n radioOptionButton: {\n marginRight: 8,\n },\n radioOptionText: {\n fontFamily: 'sf-medium',\n fontSize: 14,\n color: TEXT_DARKEST,\n },\n optionSelector: {\n marginTop: 8,\n flex: 1,\n height: 36,\n backgroundColor: '#ebeff2',\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n borderRadius: 5,\n paddingHorizontal: 8,\n },\n optionSelectorText: {\n color: TEXT_DARKEST,\n fontFamily: 'sf-regular',\n fontSize: 16,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst genericInputSection = connect(mapStateToProps, {})(GenericInputSection);\nexport { genericInputSection as GenericInputSection };\n"]}
|