@plusscommunities/pluss-core-app 8.0.13-beta.4 → 8.0.14-beta.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/components/AddButton.js +1 -1
- package/dist/module/components/AddButton.js.map +1 -1
- package/dist/module/components/Attachment.js +2 -1
- package/dist/module/components/Attachment.js.map +1 -1
- package/dist/module/components/BackButton.js +1 -1
- package/dist/module/components/BackButton.js.map +1 -1
- package/dist/module/components/CalendarPopup.js +1 -1
- package/dist/module/components/CalendarPopup.js.map +1 -1
- package/dist/module/components/CategoryTabs.js +2 -1
- package/dist/module/components/CategoryTabs.js.map +1 -1
- package/dist/module/components/CommentReply.js +1 -0
- package/dist/module/components/CommentReply.js.map +1 -1
- package/dist/module/components/CommentSection.js +2 -1
- package/dist/module/components/CommentSection.js.map +1 -1
- package/dist/module/components/ConfirmPopup.js +2 -1
- package/dist/module/components/ConfirmPopup.js.map +1 -1
- package/dist/module/components/ConfirmationPopup.js +2 -2
- package/dist/module/components/ConfirmationPopup.js.map +1 -1
- package/dist/module/components/DropDownItem.js +2 -1
- package/dist/module/components/DropDownItem.js.map +1 -1
- package/dist/module/components/EmptyStateMain.js +2 -1
- package/dist/module/components/EmptyStateMain.js.map +1 -1
- package/dist/module/components/EmptyStateWidget.js +2 -1
- package/dist/module/components/EmptyStateWidget.js.map +1 -1
- package/dist/module/components/FontScaleButton.js +2 -1
- package/dist/module/components/FontScaleButton.js.map +1 -1
- package/dist/module/components/FontScalePopup.js +2 -1
- package/dist/module/components/FontScalePopup.js.map +1 -1
- package/dist/module/components/Forbidden.js +3 -3
- package/dist/module/components/Forbidden.js.map +1 -1
- package/dist/module/components/FormCardSection.js +18 -17
- package/dist/module/components/FormCardSection.js.map +1 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js +2 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
- package/dist/module/components/FormattedText.js +2 -1
- package/dist/module/components/FormattedText.js.map +1 -1
- package/dist/module/components/GenericInput.js +4 -2
- package/dist/module/components/GenericInput.js.map +1 -1
- package/dist/module/components/GenericInputSection.js +2 -1
- package/dist/module/components/GenericInputSection.js.map +1 -1
- package/dist/module/components/Header.js +1 -1
- package/dist/module/components/Header.js.map +1 -1
- package/dist/module/components/ImagePopup.js +1 -1
- package/dist/module/components/ImagePopup.js.map +1 -1
- package/dist/module/components/ImageUploadProgress.js +2 -1
- package/dist/module/components/ImageUploadProgress.js.map +1 -1
- package/dist/module/components/InlineButton.js +2 -1
- package/dist/module/components/InlineButton.js.map +1 -1
- package/dist/module/components/Input.js +3 -1
- package/dist/module/components/Input.js.map +1 -1
- package/dist/module/components/PDFPopup.js +3 -2
- package/dist/module/components/PDFPopup.js.map +1 -1
- package/dist/module/components/PlussChat.js +4 -3
- package/dist/module/components/PlussChat.js.map +1 -1
- package/dist/module/components/PlussChatMessage.js +4 -4
- package/dist/module/components/PlussChatMessage.js.map +1 -1
- package/dist/module/components/PlussChatTime.js +2 -1
- package/dist/module/components/PlussChatTime.js.map +1 -1
- package/dist/module/components/Popup.js +2 -1
- package/dist/module/components/Popup.js.map +1 -1
- package/dist/module/components/Reaction.js +2 -1
- package/dist/module/components/Reaction.js.map +1 -1
- package/dist/module/components/SharingTools.js +2 -1
- package/dist/module/components/SharingTools.js.map +1 -1
- package/dist/module/components/{TextStyle.js → Text.js} +18 -6
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TickIcon.js +1 -1
- package/dist/module/components/TickIcon.js.map +1 -1
- package/dist/module/components/Toggle.js +2 -1
- package/dist/module/components/Toggle.js.map +1 -1
- package/dist/module/components/TouchableSearchBar.js +3 -2
- package/dist/module/components/TouchableSearchBar.js.map +1 -1
- package/dist/module/components/UserListing.js +2 -1
- package/dist/module/components/UserListing.js.map +1 -1
- package/dist/module/components/VideoPopup.js +1 -1
- package/dist/module/components/VideoPopup.js.map +1 -1
- package/dist/module/components/WarningPopup.js +3 -2
- package/dist/module/components/WarningPopup.js.map +1 -1
- package/dist/module/components/index.js +1 -2
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/helper.js +2 -1
- package/dist/module/helper.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AddButton.js +1 -1
- package/src/components/Attachment.js +2 -1
- package/src/components/BackButton.js +1 -1
- package/src/components/CalendarPopup.js +1 -1
- package/src/components/CategoryTabs.js +2 -1
- package/src/components/CommentReply.js +1 -0
- package/src/components/CommentSection.js +2 -1
- package/src/components/ConfirmPopup.js +2 -1
- package/src/components/ConfirmationPopup.js +2 -2
- package/src/components/DropDownItem.js +2 -1
- package/src/components/EmptyStateMain.js +2 -1
- package/src/components/EmptyStateWidget.js +2 -1
- package/src/components/FontScaleButton.js +2 -1
- package/src/components/FontScalePopup.js +2 -1
- package/src/components/Forbidden.js +5 -5
- package/src/components/FormCardSection.js +96 -47
- package/src/components/FormCardSectionOptionLauncher.js +2 -1
- package/src/components/FormattedText.js +2 -1
- package/src/components/GenericInput.js +4 -2
- package/src/components/GenericInputSection.js +2 -1
- package/src/components/Header.js +1 -1
- package/src/components/ImagePopup.js +1 -1
- package/src/components/ImageUploadProgress.js +2 -1
- package/src/components/InlineButton.js +2 -1
- package/src/components/Input.js +3 -1
- package/src/components/PDFPopup.js +3 -2
- package/src/components/PlussChat.js +4 -4
- package/src/components/PlussChatMessage.js +6 -12
- package/src/components/PlussChatTime.js +2 -1
- package/src/components/Popup.js +2 -1
- package/src/components/Reaction.js +2 -1
- package/src/components/SharingTools.js +2 -1
- package/src/components/{TextStyle.js → Text.js} +19 -5
- package/src/components/TickIcon.js +1 -1
- package/src/components/Toggle.js +2 -1
- package/src/components/TouchableSearchBar.js +3 -2
- package/src/components/UserListing.js +2 -1
- package/src/components/VideoPopup.js +1 -1
- package/src/components/WarningPopup.js +3 -2
- package/src/components/index.js +1 -2
- package/src/helper.js +2 -1
- package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +0 -4205
- package/dist/module/components/Icon.js +0 -109
- package/dist/module/components/Icon.js.map +0 -1
- package/dist/module/components/TextStyle.js.map +0 -1
- package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/src/assets/icons/fontawesome/fa7-glyphmap.json +0 -4205
- package/src/components/Icon.js +0 -99
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_","View","
|
|
1
|
+
{"version":3,"names":["React","_","View","Text","getMainBrandingColourFromState","InlineButton","Services","connect","Header","Forbidden","colourBrandingMain","title","description","goBack","navigation","createElement","style","flex","backgroundColor","leftIcon","onPressLeft","padding","type","color","isEmpty","marginTop","onPress","mapStateToProps","state","forbidden","forwardRef"],"sources":["Forbidden.js"],"sourcesContent":["import React from \"react\";\nimport _ from \"lodash\";\nimport { View } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { getMainBrandingColourFromState } from \"../colours\";\nimport { InlineButton } from \"./InlineButton\";\nimport { Services } from \"../config\";\nimport { connect } from \"react-redux\";\nimport Header from \"./Header\";\n\nconst Forbidden = ({ colourBrandingMain, title, description }) => {\n\tconst goBack = () => {\n\t\tServices.navigation.goBack();\n\t};\n\n\treturn (\n\t\t<View\n\t\t\tstyle={{\n\t\t\t\tflex: 1,\n\t\t\t\tbackgroundColor: \"#fff\",\n\t\t\t}}\n\t\t>\n\t\t\t<Header leftIcon=\"angle-left\" onPressLeft={goBack} />\n\t\t\t<View\n\t\t\t\tstyle={{\n\t\t\t\t\tpadding: 16,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<Text type=\"pageHeading\" style={{ color: colourBrandingMain }}>\n\t\t\t\t\t{!_.isEmpty(title) ? title : \"Oops!\"}\n\t\t\t\t</Text>\n\t\t\t\t<Text type=\"body\" style={{ marginTop: 10 }}>\n\t\t\t\t\t{!_.isEmpty(description)\n\t\t\t\t\t\t? description\n\t\t\t\t\t\t: \"It seems this item is no longer accessible. It may have been removed or your access might have changed.\"}\n\t\t\t\t</Text>\n\t\t\t\t<View style={{ marginTop: 20 }}>\n\t\t\t\t\t<InlineButton onPress={goBack} color={colourBrandingMain}>\n\t\t\t\t\t\tGo back\n\t\t\t\t\t</InlineButton>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst forbidden = connect(mapStateToProps, {}, null, { forwardRef: true })(\n\tForbidden,\n);\nexport { forbidden as Forbidden };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,8BAA8B,QAAQ,YAAY;AAC3D,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,UAAU;AAE7B,MAAMC,SAAS,GAAGA,CAAC;EAAEC,kBAAkB;EAAEC,KAAK;EAAEC;AAAY,CAAC,KAAK;EACjE,MAAMC,MAAM,GAAGA,CAAA,KAAM;IACpBP,QAAQ,CAACQ,UAAU,CAACD,MAAM,CAAC,CAAC;EAC7B,CAAC;EAED,oBACCb,KAAA,CAAAe,aAAA,CAACb,IAAI;IACJc,KAAK,EAAE;MACNC,IAAI,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{ View, Text, TextInput, TouchableOpacity, StyleSheet } from
|
|
4
|
-
import { connect } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { View, Text, TextInput, TouchableOpacity, StyleSheet } from "react-native";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import { FontAwesome } from "@expo/vector-icons";
|
|
6
|
+
import { TEXT_LIGHTER, TEXT_DARK, COLOUR_GREEN, LINEGREY, TEXT_LIGHT, COLOUR_GRAPEFRUIT, getMainBrandingColourFromState, getDarkBrandingColourFromState } from "../colours";
|
|
7
|
+
import { getValueOrDefault } from "../helper";
|
|
8
8
|
class FormCardSection extends Component {
|
|
9
9
|
constructor(props) {
|
|
10
10
|
super(props);
|
|
@@ -81,13 +81,14 @@ class FormCardSection extends Component {
|
|
|
81
81
|
renderInput() {
|
|
82
82
|
return /*#__PURE__*/React.createElement(View, {
|
|
83
83
|
style: {
|
|
84
|
-
flexDirection:
|
|
84
|
+
flexDirection: "row"
|
|
85
85
|
}
|
|
86
86
|
}, /*#__PURE__*/React.createElement(View, {
|
|
87
87
|
style: {
|
|
88
88
|
flex: 1
|
|
89
89
|
}
|
|
90
90
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
91
|
+
maxFontSizeMultiplier: 1.2,
|
|
91
92
|
value: this.props.textValue,
|
|
92
93
|
onChangeText: this.props.onChangeText,
|
|
93
94
|
keyboardType: this.props.keyboardType
|
|
@@ -96,11 +97,11 @@ class FormCardSection extends Component {
|
|
|
96
97
|
placeholder: this.props.placeholder,
|
|
97
98
|
placeholderTextColor: this.props.placeholderTextColor || TEXT_LIGHTER,
|
|
98
99
|
style: [styles.inputStyle, {
|
|
99
|
-
textAlignVertical: this.props.autoGrow ?
|
|
100
|
+
textAlignVertical: this.props.autoGrow ? "top" : "center",
|
|
100
101
|
color: this.props.textColour || TEXT_DARK,
|
|
101
102
|
minHeight: this.props.minHeight || 20
|
|
102
103
|
}, this.props.textStyle],
|
|
103
|
-
underlineColorAndroid:
|
|
104
|
+
underlineColorAndroid: "rgba(0,0,0,0)"
|
|
104
105
|
/* Other Props */,
|
|
105
106
|
autoFocus: _.isUndefined(this.props.autoFocus) ? false : this.props.autoFocus,
|
|
106
107
|
editable: _.isUndefined(this.props.editable) ? true : this.props.editable,
|
|
@@ -108,7 +109,7 @@ class FormCardSection extends Component {
|
|
|
108
109
|
autoCorrect: _.isUndefined(this.props.autoCorrect) ? false : this.props.autoCorrect,
|
|
109
110
|
multiline: _.isUndefined(this.props.multiline) ? false : this.props.multiline,
|
|
110
111
|
autoGrow: _.isUndefined(this.props.autoGrow) ? false : this.props.autoGrow,
|
|
111
|
-
autoCapitalize: _.isUndefined(this.props.autoCapitalize) ?
|
|
112
|
+
autoCapitalize: _.isUndefined(this.props.autoCapitalize) ? "sentences" : this.props.autoCapitalize,
|
|
112
113
|
onContentSizeChange: this.onGrow.bind(this)
|
|
113
114
|
/* Focus Props */,
|
|
114
115
|
onFocus: this.onFocus.bind(this),
|
|
@@ -116,7 +117,7 @@ class FormCardSection extends Component {
|
|
|
116
117
|
})), !_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
117
118
|
onPress: this.toggleSecure.bind(this)
|
|
118
119
|
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
119
|
-
name: this.state.isSecure ?
|
|
120
|
+
name: this.state.isSecure ? "eye" : "eye-slash",
|
|
120
121
|
style: {
|
|
121
122
|
fontSize: 21,
|
|
122
123
|
lineHeight: 20,
|
|
@@ -163,12 +164,12 @@ const styles = StyleSheet.create({
|
|
|
163
164
|
borderBottomColor: COLOUR_GRAPEFRUIT
|
|
164
165
|
},
|
|
165
166
|
labelContainer: {
|
|
166
|
-
flexDirection:
|
|
167
|
-
alignItems:
|
|
167
|
+
flexDirection: "row",
|
|
168
|
+
alignItems: "center",
|
|
168
169
|
marginBottom: 6
|
|
169
170
|
},
|
|
170
171
|
labelText: {
|
|
171
|
-
fontFamily:
|
|
172
|
+
fontFamily: "sf-regular",
|
|
172
173
|
fontSize: 13,
|
|
173
174
|
color: TEXT_LIGHT
|
|
174
175
|
},
|
|
@@ -189,7 +190,7 @@ const styles = StyleSheet.create({
|
|
|
189
190
|
backgroundColor: COLOUR_GREEN
|
|
190
191
|
},
|
|
191
192
|
inputStyle: {
|
|
192
|
-
fontFamily:
|
|
193
|
+
fontFamily: "sf-regular",
|
|
193
194
|
fontSize: 17,
|
|
194
195
|
margin: 0,
|
|
195
196
|
padding: 0
|
|
@@ -197,7 +198,7 @@ const styles = StyleSheet.create({
|
|
|
197
198
|
errorText: {
|
|
198
199
|
paddingTop: 8,
|
|
199
200
|
fontSize: 13,
|
|
200
|
-
fontFamily:
|
|
201
|
+
fontFamily: "sf-regular",
|
|
201
202
|
color: COLOUR_GRAPEFRUIT
|
|
202
203
|
}
|
|
203
204
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","View","Text","TextInput","TouchableOpacity","StyleSheet","connect","TEXT_LIGHTER","TEXT_DARK","COLOUR_GREEN","LINEGREY","TEXT_LIGHT","COLOUR_GRAPEFRUIT","getMainBrandingColourFromState","getDarkBrandingColourFromState","getValueOrDefault","FontAwesome","FormCardSection","constructor","props","state","height","minHeight","focused","isSecure","onFocus","setState","onBlur","onGrow","event","Math","max","nativeEvent","contentSize","toggleSecure","current","showSecure","isUndefined","secureTextToggle","secureTextEntry","isValid","required","isEmpty","textValue","renderErrorDot","hasError","createElement","style","styles","errorDot","backgroundColor","colourBrandingMain","errorError","errorValid","errorDotStyle","renderLabel","label","labelContainer","labelText","color","labelError","labelStyle","renderInput","flexDirection","flex","value","onChangeText","keyboardType","selectionColor","colourBrandingDark","placeholder","placeholderTextColor","inputStyle","textAlignVertical","autoGrow","textColour","textStyle","underlineColorAndroid","autoFocus","editable","autoCorrect","multiline","autoCapitalize","onContentSizeChange","bind","onPress","name","fontSize","lineHeight","paddingLeft","renderContent","hasContent","children","pointerEvents","render","sectionItem","hasUnderline","sectionItemUnderline","inputFocus","borderBottomColor","inputError","showError","sectionStyle","errorText","create","paddingVertical","paddingHorizontal","borderBottomWidth","alignItems","marginBottom","fontFamily","width","borderRadius","marginLeft","margin","padding","paddingTop","mapStateToProps","formCardSection"],"sources":["FormCardSection.js"],"sourcesContent":["import React, { Component } from 'react';\nimport _ from 'lodash';\nimport { View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native';\nimport { connect } from 'react-redux';\nimport {\n\tTEXT_LIGHTER,\n\tTEXT_DARK,\n\tCOLOUR_GREEN,\n\tLINEGREY,\n\tTEXT_LIGHT,\n\tCOLOUR_GRAPEFRUIT,\n\tgetMainBrandingColourFromState,\n\tgetDarkBrandingColourFromState,\n} from '../colours';\nimport { getValueOrDefault } from '../helper';\nimport { FontAwesome } from './Icon';\n\nclass FormCardSection extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\theight: getValueOrDefault(this.props.minHeight, 20),\n\t\t\tfocused: false,\n\t\t\tisSecure: true,\n\t\t};\n\t}\n\n\tonFocus() {\n\t\tthis.setState({ focused: true });\n\t\tif (this.props.onFocus) {\n\t\t\tthis.props.onFocus();\n\t\t}\n\t}\n\n\tonBlur() {\n\t\tthis.setState({ focused: false });\n\t\tif (this.props.onBlur) {\n\t\t\tthis.props.onBlur();\n\t\t}\n\t}\n\n\tonGrow(event) {\n\t\tthis.setState({\n\t\t\theight: Math.max(event.nativeEvent.contentSize.height, this.props.minHeight),\n\t\t});\n\t}\n\n\ttoggleSecure() {\n\t\tconst current = this.state.isSecure;\n\t\tthis.setState({ isSecure: !current });\n\t}\n\n\tshowSecure() {\n\t\tif (!_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle) {\n\t\t\treturn this.state.isSecure;\n\t\t}\n\t\treturn this.props.secureTextEntry;\n\t}\n\n\tisValid() {\n\t\tif (this.props.required && _.isEmpty(this.props.textValue)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.props.isValid && !this.props.isValid()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\trenderErrorDot() {\n\t\tif (this.props.required || this.props.hasError) {\n\t\t\treturn (\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.errorDot,\n\t\t\t\t\t\t{ backgroundColor: this.props.colourBrandingMain },\n\t\t\t\t\t\t!this.isValid() && styles.errorError,\n\t\t\t\t\t\tthis.isValid() && styles.errorValid,\n\t\t\t\t\t\tthis.props.errorDotStyle,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trenderLabel() {\n\t\tif (_.isEmpty(this.props.label)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={styles.labelContainer}>\n\t\t\t\t<Text\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.labelText,\n\t\t\t\t\t\tthis.state.focused && { color: this.props.colourBrandingMain },\n\t\t\t\t\t\t!this.isValid() && !_.isEmpty(this.props.textValue) && styles.labelError,\n\t\t\t\t\t\tthis.props.labelStyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{this.props.label}\n\t\t\t\t</Text>\n\t\t\t\t{this.renderErrorDot()}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderInput() {\n\t\treturn (\n\t\t\t<View style={{ flexDirection: 'row' }}>\n\t\t\t\t<View style={{ flex: 1 }}>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tvalue={this.props.textValue}\n\t\t\t\t\t\tonChangeText={this.props.onChangeText}\n\t\t\t\t\t\tkeyboardType={this.props.keyboardType}\n\t\t\t\t\t\t/* Main Styling Props */\n\t\t\t\t\t\tselectionColor={this.props.colourBrandingDark}\n\t\t\t\t\t\tplaceholder={this.props.placeholder}\n\t\t\t\t\t\tplaceholderTextColor={this.props.placeholderTextColor || TEXT_LIGHTER}\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.inputStyle,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextAlignVertical: this.props.autoGrow ? 'top' : 'center',\n\t\t\t\t\t\t\t\tcolor: this.props.textColour || TEXT_DARK,\n\t\t\t\t\t\t\t\tminHeight: this.props.minHeight || 20,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.textStyle,\n\t\t\t\t\t\t]}\n\t\t\t\t\t\tunderlineColorAndroid={'rgba(0,0,0,0)'}\n\t\t\t\t\t\t/* Other Props */\n\t\t\t\t\t\tautoFocus={_.isUndefined(this.props.autoFocus) ? false : this.props.autoFocus}\n\t\t\t\t\t\teditable={_.isUndefined(this.props.editable) ? true : this.props.editable}\n\t\t\t\t\t\tsecureTextEntry={_.isUndefined(this.props.secureTextEntry) ? false : this.showSecure()}\n\t\t\t\t\t\tautoCorrect={_.isUndefined(this.props.autoCorrect) ? false : this.props.autoCorrect}\n\t\t\t\t\t\tmultiline={_.isUndefined(this.props.multiline) ? false : this.props.multiline}\n\t\t\t\t\t\tautoGrow={_.isUndefined(this.props.autoGrow) ? false : this.props.autoGrow}\n\t\t\t\t\t\tautoCapitalize={_.isUndefined(this.props.autoCapitalize) ? 'sentences' : this.props.autoCapitalize}\n\t\t\t\t\t\tonContentSizeChange={this.onGrow.bind(this)}\n\t\t\t\t\t\t/* Focus Props */\n\t\t\t\t\t\tonFocus={this.onFocus.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlur.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t{!_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle && (\n\t\t\t\t\t<TouchableOpacity onPress={this.toggleSecure.bind(this)}>\n\t\t\t\t\t\t{/* <Icon\n name={this.state.isSecure ? 'eye' : 'eye-slash'}\n type='font-awesome'\n iconStyle={{ fontSize: 16, color: TEXT_MID, paddingLeft: 16 }}\n /> */}\n\t\t\t\t\t\t<FontAwesome\n\t\t\t\t\t\t\tname={this.state.isSecure ? 'eye' : 'eye-slash'}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tfontSize: 21,\n\t\t\t\t\t\t\t\tlineHeight: 20,\n\t\t\t\t\t\t\t\tcolor: TEXT_LIGHT,\n\t\t\t\t\t\t\t\tpaddingLeft: 16,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderContent() {\n\t\tif (this.props.hasContent) {\n\t\t\treturn this.props.children;\n\t\t}\n\t\tif (this.props.pointerEvents) {\n\t\t\treturn <View pointerEvents={this.props.pointerEvents}>{this.renderInput()}</View>;\n\t\t}\n\t\treturn this.renderInput();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.sectionItem,\n\t\t\t\t\t\tthis.props.hasUnderline && styles.sectionItemUnderline,\n\t\t\t\t\t\tthis.state.focused && styles.inputFocus,\n\t\t\t\t\t\tthis.state.focused && {\n\t\t\t\t\t\t\tborderBottomColor: this.props.colourBrandingMain,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t!this.isValid() && !_.isEmpty(this.props.textValue) && styles.inputError,\n\t\t\t\t\t\t!_.isUndefined(this.props.showError) && this.props.showError === true && !this.isValid() && styles.inputError,\n\t\t\t\t\t\tthis.props.sectionStyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{this.renderLabel()}\n\t\t\t\t\t<View>{this.renderContent()}</View>\n\t\t\t\t</View>\n\t\t\t\t{!_.isUndefined(this.props.showError) && this.props.showError === true && !this.isValid() && (\n\t\t\t\t\t<Text style={styles.errorText}>{this.props.errorText}</Text>\n\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tsectionItem: {\n\t\tpaddingVertical: 16,\n\t\tpaddingHorizontal: 8,\n\t\tborderBottomColor: LINEGREY,\n\t},\n\tsectionItemUnderline: {\n\t\tborderBottomWidth: 1,\n\t},\n\tinputFocus: {\n\t\tborderBottomWidth: 1,\n\t},\n\tinputError: {\n\t\tborderBottomWidth: 1,\n\t\tborderBottomColor: COLOUR_GRAPEFRUIT,\n\t},\n\tlabelContainer: {\n\t\tflexDirection: 'row',\n\t\talignItems: 'center',\n\t\tmarginBottom: 6,\n\t},\n\tlabelText: {\n\t\tfontFamily: 'sf-regular',\n\t\tfontSize: 13,\n\t\tcolor: TEXT_LIGHT,\n\t},\n\tlabelError: {\n\t\tcolor: COLOUR_GRAPEFRUIT,\n\t},\n\terrorDot: {\n\t\theight: 6,\n\t\twidth: 6,\n\t\tborderRadius: 3,\n\t\tmarginLeft: 8,\n\t\tmarginBottom: 3,\n\t},\n\terrorError: {\n\t\tbackgroundColor: COLOUR_GRAPEFRUIT,\n\t},\n\terrorValid: {\n\t\tbackgroundColor: COLOUR_GREEN,\n\t},\n\tinputStyle: {\n\t\tfontFamily: 'sf-regular',\n\t\tfontSize: 17,\n\t\tmargin: 0,\n\t\tpadding: 0,\n\t},\n\terrorText: {\n\t\tpaddingTop: 8,\n\t\tfontSize: 13,\n\t\tfontFamily: 'sf-regular',\n\t\tcolor: COLOUR_GRAPEFRUIT,\n\t},\n});\n\nconst mapStateToProps = state => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tcolourBrandingDark: getDarkBrandingColourFromState(state),\n\t};\n};\n\nconst formCardSection = connect(mapStateToProps, {})(FormCardSection);\nexport { formCardSection as FormCardSection };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AA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B,CAACM,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMkG,eAAe,GAAGhH,OAAO,CAAC+G,eAAe,EAAE,CAAC,CAAC,CAAC,CAACpG,eAAe,CAAC;AACrE,SAASqG,eAAe,IAAIrG,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","_","View","Text","TextInput","TouchableOpacity","StyleSheet","connect","FontAwesome","TEXT_LIGHTER","TEXT_DARK","COLOUR_GREEN","LINEGREY","TEXT_LIGHT","COLOUR_GRAPEFRUIT","getMainBrandingColourFromState","getDarkBrandingColourFromState","getValueOrDefault","FormCardSection","constructor","props","state","height","minHeight","focused","isSecure","onFocus","setState","onBlur","onGrow","event","Math","max","nativeEvent","contentSize","toggleSecure","current","showSecure","isUndefined","secureTextToggle","secureTextEntry","isValid","required","isEmpty","textValue","renderErrorDot","hasError","createElement","style","styles","errorDot","backgroundColor","colourBrandingMain","errorError","errorValid","errorDotStyle","renderLabel","label","labelContainer","labelText","color","labelError","labelStyle","renderInput","flexDirection","flex","maxFontSizeMultiplier","value","onChangeText","keyboardType","selectionColor","colourBrandingDark","placeholder","placeholderTextColor","inputStyle","textAlignVertical","autoGrow","textColour","textStyle","underlineColorAndroid","autoFocus","editable","autoCorrect","multiline","autoCapitalize","onContentSizeChange","bind","onPress","name","fontSize","lineHeight","paddingLeft","renderContent","hasContent","children","pointerEvents","render","sectionItem","hasUnderline","sectionItemUnderline","inputFocus","borderBottomColor","inputError","showError","sectionStyle","errorText","create","paddingVertical","paddingHorizontal","borderBottomWidth","alignItems","marginBottom","fontFamily","width","borderRadius","marginLeft","margin","padding","paddingTop","mapStateToProps","formCardSection"],"sources":["FormCardSection.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport {\n\tView,\n\tText,\n\tTextInput,\n\tTouchableOpacity,\n\tStyleSheet,\n} from \"react-native\";\nimport { connect } from \"react-redux\";\nimport { FontAwesome } from \"@expo/vector-icons\";\nimport {\n\tTEXT_LIGHTER,\n\tTEXT_DARK,\n\tCOLOUR_GREEN,\n\tLINEGREY,\n\tTEXT_LIGHT,\n\tCOLOUR_GRAPEFRUIT,\n\tgetMainBrandingColourFromState,\n\tgetDarkBrandingColourFromState,\n} from \"../colours\";\nimport { getValueOrDefault } from \"../helper\";\n\nclass FormCardSection extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\theight: getValueOrDefault(this.props.minHeight, 20),\n\t\t\tfocused: false,\n\t\t\tisSecure: true,\n\t\t};\n\t}\n\n\tonFocus() {\n\t\tthis.setState({ focused: true });\n\t\tif (this.props.onFocus) {\n\t\t\tthis.props.onFocus();\n\t\t}\n\t}\n\n\tonBlur() {\n\t\tthis.setState({ focused: false });\n\t\tif (this.props.onBlur) {\n\t\t\tthis.props.onBlur();\n\t\t}\n\t}\n\n\tonGrow(event) {\n\t\tthis.setState({\n\t\t\theight: Math.max(\n\t\t\t\tevent.nativeEvent.contentSize.height,\n\t\t\t\tthis.props.minHeight,\n\t\t\t),\n\t\t});\n\t}\n\n\ttoggleSecure() {\n\t\tconst current = this.state.isSecure;\n\t\tthis.setState({ isSecure: !current });\n\t}\n\n\tshowSecure() {\n\t\tif (\n\t\t\t!_.isUndefined(this.props.secureTextToggle) &&\n\t\t\tthis.props.secureTextToggle\n\t\t) {\n\t\t\treturn this.state.isSecure;\n\t\t}\n\t\treturn this.props.secureTextEntry;\n\t}\n\n\tisValid() {\n\t\tif (this.props.required && _.isEmpty(this.props.textValue)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.props.isValid && !this.props.isValid()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\trenderErrorDot() {\n\t\tif (this.props.required || this.props.hasError) {\n\t\t\treturn (\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.errorDot,\n\t\t\t\t\t\t{ backgroundColor: this.props.colourBrandingMain },\n\t\t\t\t\t\t!this.isValid() && styles.errorError,\n\t\t\t\t\t\tthis.isValid() && styles.errorValid,\n\t\t\t\t\t\tthis.props.errorDotStyle,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trenderLabel() {\n\t\tif (_.isEmpty(this.props.label)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={styles.labelContainer}>\n\t\t\t\t<Text\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.labelText,\n\t\t\t\t\t\tthis.state.focused && { color: this.props.colourBrandingMain },\n\t\t\t\t\t\t!this.isValid() &&\n\t\t\t\t\t\t\t!_.isEmpty(this.props.textValue) &&\n\t\t\t\t\t\t\tstyles.labelError,\n\t\t\t\t\t\tthis.props.labelStyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{this.props.label}\n\t\t\t\t</Text>\n\t\t\t\t{this.renderErrorDot()}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderInput() {\n\t\treturn (\n\t\t\t<View style={{ flexDirection: \"row\" }}>\n\t\t\t\t<View style={{ flex: 1 }}>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tmaxFontSizeMultiplier={1.2}\n\t\t\t\t\t\tvalue={this.props.textValue}\n\t\t\t\t\t\tonChangeText={this.props.onChangeText}\n\t\t\t\t\t\tkeyboardType={this.props.keyboardType}\n\t\t\t\t\t\t/* Main Styling Props */\n\t\t\t\t\t\tselectionColor={this.props.colourBrandingDark}\n\t\t\t\t\t\tplaceholder={this.props.placeholder}\n\t\t\t\t\t\tplaceholderTextColor={\n\t\t\t\t\t\t\tthis.props.placeholderTextColor || TEXT_LIGHTER\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.inputStyle,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextAlignVertical: this.props.autoGrow ? \"top\" : \"center\",\n\t\t\t\t\t\t\t\tcolor: this.props.textColour || TEXT_DARK,\n\t\t\t\t\t\t\t\tminHeight: this.props.minHeight || 20,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.textStyle,\n\t\t\t\t\t\t]}\n\t\t\t\t\t\tunderlineColorAndroid={\"rgba(0,0,0,0)\"}\n\t\t\t\t\t\t/* Other Props */\n\t\t\t\t\t\tautoFocus={\n\t\t\t\t\t\t\t_.isUndefined(this.props.autoFocus) ? false : this.props.autoFocus\n\t\t\t\t\t\t}\n\t\t\t\t\t\teditable={\n\t\t\t\t\t\t\t_.isUndefined(this.props.editable) ? true : this.props.editable\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecureTextEntry={\n\t\t\t\t\t\t\t_.isUndefined(this.props.secureTextEntry)\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: this.showSecure()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tautoCorrect={\n\t\t\t\t\t\t\t_.isUndefined(this.props.autoCorrect)\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: this.props.autoCorrect\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmultiline={\n\t\t\t\t\t\t\t_.isUndefined(this.props.multiline) ? false : this.props.multiline\n\t\t\t\t\t\t}\n\t\t\t\t\t\tautoGrow={\n\t\t\t\t\t\t\t_.isUndefined(this.props.autoGrow) ? false : this.props.autoGrow\n\t\t\t\t\t\t}\n\t\t\t\t\t\tautoCapitalize={\n\t\t\t\t\t\t\t_.isUndefined(this.props.autoCapitalize)\n\t\t\t\t\t\t\t\t? \"sentences\"\n\t\t\t\t\t\t\t\t: this.props.autoCapitalize\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonContentSizeChange={this.onGrow.bind(this)}\n\t\t\t\t\t\t/* Focus Props */\n\t\t\t\t\t\tonFocus={this.onFocus.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlur.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t{!_.isUndefined(this.props.secureTextToggle) &&\n\t\t\t\t\tthis.props.secureTextToggle && (\n\t\t\t\t\t\t<TouchableOpacity onPress={this.toggleSecure.bind(this)}>\n\t\t\t\t\t\t\t{/* <Icon\n name={this.state.isSecure ? 'eye' : 'eye-slash'}\n type='font-awesome'\n iconStyle={{ fontSize: 16, color: TEXT_MID, paddingLeft: 16 }}\n /> */}\n\t\t\t\t\t\t\t<FontAwesome\n\t\t\t\t\t\t\t\tname={this.state.isSecure ? \"eye\" : \"eye-slash\"}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontSize: 21,\n\t\t\t\t\t\t\t\t\tlineHeight: 20,\n\t\t\t\t\t\t\t\t\tcolor: TEXT_LIGHT,\n\t\t\t\t\t\t\t\t\tpaddingLeft: 16,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderContent() {\n\t\tif (this.props.hasContent) {\n\t\t\treturn this.props.children;\n\t\t}\n\t\tif (this.props.pointerEvents) {\n\t\t\treturn (\n\t\t\t\t<View pointerEvents={this.props.pointerEvents}>\n\t\t\t\t\t{this.renderInput()}\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\treturn this.renderInput();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.sectionItem,\n\t\t\t\t\t\tthis.props.hasUnderline && styles.sectionItemUnderline,\n\t\t\t\t\t\tthis.state.focused && styles.inputFocus,\n\t\t\t\t\t\tthis.state.focused && {\n\t\t\t\t\t\t\tborderBottomColor: this.props.colourBrandingMain,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t!this.isValid() &&\n\t\t\t\t\t\t\t!_.isEmpty(this.props.textValue) &&\n\t\t\t\t\t\t\tstyles.inputError,\n\t\t\t\t\t\t!_.isUndefined(this.props.showError) &&\n\t\t\t\t\t\t\tthis.props.showError === true &&\n\t\t\t\t\t\t\t!this.isValid() &&\n\t\t\t\t\t\t\tstyles.inputError,\n\t\t\t\t\t\tthis.props.sectionStyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{this.renderLabel()}\n\t\t\t\t\t<View>{this.renderContent()}</View>\n\t\t\t\t</View>\n\t\t\t\t{!_.isUndefined(this.props.showError) &&\n\t\t\t\t\tthis.props.showError === true &&\n\t\t\t\t\t!this.isValid() && (\n\t\t\t\t\t\t<Text style={styles.errorText}>{this.props.errorText}</Text>\n\t\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tsectionItem: {\n\t\tpaddingVertical: 16,\n\t\tpaddingHorizontal: 8,\n\t\tborderBottomColor: LINEGREY,\n\t},\n\tsectionItemUnderline: {\n\t\tborderBottomWidth: 1,\n\t},\n\tinputFocus: {\n\t\tborderBottomWidth: 1,\n\t},\n\tinputError: {\n\t\tborderBottomWidth: 1,\n\t\tborderBottomColor: COLOUR_GRAPEFRUIT,\n\t},\n\tlabelContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tmarginBottom: 6,\n\t},\n\tlabelText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 13,\n\t\tcolor: TEXT_LIGHT,\n\t},\n\tlabelError: {\n\t\tcolor: COLOUR_GRAPEFRUIT,\n\t},\n\terrorDot: {\n\t\theight: 6,\n\t\twidth: 6,\n\t\tborderRadius: 3,\n\t\tmarginLeft: 8,\n\t\tmarginBottom: 3,\n\t},\n\terrorError: {\n\t\tbackgroundColor: COLOUR_GRAPEFRUIT,\n\t},\n\terrorValid: {\n\t\tbackgroundColor: COLOUR_GREEN,\n\t},\n\tinputStyle: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 17,\n\t\tmargin: 0,\n\t\tpadding: 0,\n\t},\n\terrorText: {\n\t\tpaddingTop: 8,\n\t\tfontSize: 13,\n\t\tfontFamily: \"sf-regular\",\n\t\tcolor: COLOUR_GRAPEFRUIT,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tcolourBrandingDark: getDarkBrandingColourFromState(state),\n\t};\n};\n\nconst formCardSection = connect(mapStateToProps, {})(FormCardSection);\nexport { formCardSection as FormCardSection };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SACCC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,QACJ,cAAc;AACrB,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SACCC,YAAY,EACZC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,UAAU,EACVC,iBAAiB,EACjBC,8BAA8B,EAC9BC,8BAA8B,QACxB,YAAY;AACnB,SAASC,iBAAiB,QAAQ,WAAW;AAE7C,MAAMC,eAAe,SAASlB,SAAS,CAAC;EACvCmB,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,KAAK,GAAG;MACZC,MAAM,EAAEL,iBAAiB,CAAC,IAAI,CAACG,KAAK,CAACG,SAAS,EAAE,EAAE,CAAC;MACnDC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE;IACX,CAAC;EACF;EAEAC,OAAOA,CAAA,EAAG;IACT,IAAI,CAACC,QAAQ,CAAC;MAAEH,OAAO,EAAE;IAAK,CAAC,CAAC;IAChC,IAAI,IAAI,CAACJ,KAAK,CAACM,OAAO,EAAE;MACvB,IAAI,CAACN,KAAK,CAACM,OAAO,CAAC,CAAC;IACrB;EACD;EAEAE,MAAMA,CAAA,EAAG;IACR,IAAI,CAACD,QAAQ,CAAC;MAAEH,OAAO,EAAE;IAAM,CAAC,CAAC;IACjC,IAAI,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,CAAC;EACD+D,UAAU,EAAE;IACXsC,UAAU,EAAE,YAAY;IACxBvB,QAAQ,EAAE,EAAE;IACZ2B,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACV,CAAC;EACDZ,SAAS,EAAE;IACVa,UAAU,EAAE,CAAC;IACb7B,QAAQ,EAAE,EAAE;IACZuB,UAAU,EAAE,YAAY;IACxBpD,KAAK,EAAE9C;EACR;AACD,CAAC,CAAC;AAEF,MAAMyG,eAAe,GAAIlG,KAAK,IAAK;EAClC,OAAO;IACN+B,kBAAkB,EAAErC,8BAA8B,CAACM,KAAK,CAAC;IACzDkD,kBAAkB,EAAEvD,8BAA8B,CAACK,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMmG,eAAe,GAAGjH,OAAO,CAACgH,eAAe,EAAE,CAAC,CAAC,CAAC,CAACrG,eAAe,CAAC;AACrE,SAASsG,eAAe,IAAItG,eAAe","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from "react";
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, TouchableOpacity } from "react-native";
|
|
3
|
+
import { Text } from "./Text";
|
|
3
4
|
import { Icon } from "@rneui/themed";
|
|
4
5
|
import { connect } from "react-redux";
|
|
5
6
|
import { TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState } from "../colours";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","View","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","TouchableOpacity","Text","Icon","connect","TEXT_DARK","TEXT_LIGHT","getMainBrandingColourFromState","FormCardSection","FormCardSectionOptionLauncher","render","onPress","sectionStyle","textStyle","title","description","value","icon","colourBrandingMain","props","createElement","hasContent","style","styles","container","text","marginRight","flex","name","type","iconStyle","fontSize","color","flexDirection","alignSelf","alignItems","fontFamily","marginTop","mapStateToProps","state","formCardSectionOptionLauncher"],"sources":["FormCardSectionOptionLauncher.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View, TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"@rneui/themed\";\nimport { connect } from \"react-redux\";\nimport {\n\tTEXT_DARK,\n\tTEXT_LIGHT,\n\tgetMainBrandingColourFromState,\n} from \"../colours\";\nimport { FormCardSection } from \"./FormCardSection\";\n\nclass FormCardSectionOptionLauncher extends PureComponent {\n\trender() {\n\t\tconst {\n\t\t\tonPress,\n\t\t\tsectionStyle,\n\t\t\ttextStyle,\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tvalue,\n\t\t\ticon,\n\t\t\tcolourBrandingMain,\n\t\t} = this.props;\n\n\t\treturn (\n\t\t\t<TouchableOpacity onPress={onPress}>\n\t\t\t\t<FormCardSection hasContent sectionStyle={sectionStyle}>\n\t\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={[styles.text, { marginRight: 16, flex: 1 }, textStyle]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text style={[styles.text, { marginRight: 16 }]}>{value}</Text>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname={icon ? icon : \"angle-right\"}\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\t\tstyles.text,\n\t\t\t\t\t\t\t\t{ fontSize: 20, color: colourBrandingMain },\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t\t{description ? (\n\t\t\t\t\t\t<Text style={styles.description}>{description}</Text>\n\t\t\t\t\t) : null}\n\t\t\t\t</FormCardSection>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t\talignSelf: \"stretch\",\n\t\talignItems: \"center\",\n\t},\n\ttext: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 17,\n\t\tcolor: TEXT_DARK,\n\t},\n\tdescription: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 15,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginTop: 8,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst formCardSectionOptionLauncher = connect(\n\tmapStateToProps,\n\t{},\n)(FormCardSectionOptionLauncher);\nexport { formCardSectionOptionLauncher as FormCardSectionOptionLauncher };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACrD,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,OAAO,QAAQ,aAAa;AACrC,SACCC,SAAS,EACTC,UAAU,EACVC,8BAA8B,QACxB,YAAY;AACnB,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,MAAMC,6BAA6B,SAASV,aAAa,CAAC;EACzDW,MAAMA,CAAA,EAAG;IACR,MAAM;MACLC,OAAO;MACPC,YAAY;MACZC,SAAS;MACTC,KAAK;MACLC,WAAW;MACXC,KAAK;MACLC,IAAI;MACJC;IACD,CAAC,GAAG,IAAI,CAACC,KAAK;IAEd,oBACCrB,KAAA,CAAAsB,aAAA,CAACnB,gBAAgB;MAACU,OAAO,EAAEA;IAAQ,gBAClCb,KAAA,CAAAsB,aAAA,CAACZ,eAAe;MAACa,UAAU;MAACT,YAAY,EAAEA;IAAa,gBACtDd,KAAA,CAAAsB,aAAA,CAACpB,IAAI;MAACsB,KAAK,EAAEC,MAAM,CAACC;IAAU,gBAC7B1B,KAAA,CAAAsB,aAAA,CAAClB,IAAI;MACJoB,KAAK,EAAE,CAACC,MAAM,CAACE,IAAI,EAAE;QAAEC,WAAW,EAAE,EAAE;QAAEC,IAAI,EAAE;MAAE,CAAC,E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imitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
4
4
|
import React, { Component } from "react";
|
|
5
5
|
import { Linking } from "react-native";
|
|
6
6
|
import { connect } from "react-redux";
|
|
7
|
-
import
|
|
7
|
+
import Parsed from "react-native-parsed-text";
|
|
8
|
+
import { Text } from "./Text";
|
|
8
9
|
import { getMainBrandingColourFromState, TEXT_DARKEST } from "../colours";
|
|
9
10
|
import { getValidUrl } from "../helper";
|
|
10
11
|
import { analyticsActions } from "../apis";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","Linking","connect","
|
|
1
|
+
{"version":3,"names":["React","Component","Linking","connect","Parsed","Text","getMainBrandingColourFromState","TEXT_DARKEST","getValidUrl","analyticsActions","FormattedText","constructor","args","_defineProperty","url","urlToUse","openURL","checkLog","urlText","texts","match","UrlTextRegex","onPressUrl","email","phone","parsedPhone","replace","value","props","disabled","undefined","type","target","logClicks","log","site","entityType","entityId","renderTextContent","matchingString","matches","renderUrlText","render","style","numberOfLines","titleSize","colourBrandingMain","subtitleSize","children","createElement","ParsedText","styles","text","ifEnabled","lineHeight","parse","pattern","fontFamily","renderText","fontSize","color","onPress","onPressUrlText","onPressEmail","onPressPhone","mapStateToProps","state"],"sources":["FormattedText.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { Linking } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport Parsed from \"react-native-parsed-text\";\nimport { Text } from \"./Text\";\nimport { getMainBrandingColourFromState, TEXT_DARKEST } from \"../colours\";\nimport { getValidUrl } from \"../helper\";\nimport { analyticsActions } from \"../apis\";\n\nclass FormattedText extends Component {\n\tstatic get UrlTextRegex() {\n\t\treturn /\\[([^\\]\\|\\]]+)\\|([^\\]\\|\\]]+)\\]/i;\n\t}\n\n\tcheckLog(type, target) {\n\t\tif (this.props.logClicks) {\n\t\t\tanalyticsActions.log(\n\t\t\t\tthis.props.site,\n\t\t\t\ttype,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.entityId,\n\t\t\t\t{ target },\n\t\t\t);\n\t\t}\n\t}\n\n\tonPressUrl = (url) => {\n\t\tconst urlToUse = getValidUrl(url);\n\t\tLinking.openURL(urlToUse);\n\t\tthis.checkLog(\"UrlClick\", urlToUse);\n\t};\n\n\tonPressUrlText = (urlText) => {\n\t\tconst texts = urlText.match(FormattedText.UrlTextRegex);\n\t\tthis.onPressUrl(texts[1]);\n\t};\n\n\tonPressEmail = (email) => {\n\t\tLinking.openURL(`mailto:${email}`);\n\t\tthis.checkLog(\"EmailClick\", email);\n\t};\n\n\tonPressPhone = (phone) => {\n\t\tconst parsedPhone = phone.replace(/\\D/g, \"\");\n\t\tLinking.openURL(`tel:${parsedPhone.replace(/\\D/g, \"\")}`);\n\t\tthis.checkLog(\"PhoneClick\", parsedPhone);\n\t};\n\n\tifEnabled = (value) => (this.props.disabled ? undefined : value);\n\n\trenderTextContent(matchingString, matches) {\n\t\treturn matches[1];\n\t}\n\n\trenderUrlText(matchingString, matches) {\n\t\treturn matches[2];\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tstyle,\n\t\t\tnumberOfLines,\n\t\t\ttitleSize,\n\t\t\tcolourBrandingMain,\n\t\t\tsubtitleSize,\n\t\t\tchildren,\n\t\t} = this.props;\n\n\t\treturn (\n\t\t\t<ParsedText\n\t\t\t\tstyle={[styles.text, this.ifEnabled({ lineHeight: 24 }), style]}\n\t\t\t\tnumberOfLines={numberOfLines}\n\t\t\t\tparse={[\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: /\\*\\*(.*?)\\*\\*/i,\n\t\t\t\t\t\tstyle: this.ifEnabled({\n\t\t\t\t\t\t\tfontFamily: \"sf-bold\",\n\t\t\t\t\t\t\tlineHeight: 24,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trenderText: this.renderTextContent,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: /\\*t\\*(.*?)\\*t\\*/i,\n\t\t\t\t\t\tstyle: this.ifEnabled({\n\t\t\t\t\t\t\tfontSize: titleSize || 22,\n\t\t\t\t\t\t\tcolor: colourBrandingMain,\n\t\t\t\t\t\t\tfontFamily: \"sf-semibold\",\n\t\t\t\t\t\t\tlineHeight: 24,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trenderText: this.renderTextContent,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: /\\*s\\*(.*?)\\*s\\*/i,\n\t\t\t\t\t\tstyle: this.ifEnabled({\n\t\t\t\t\t\t\tfontSize: subtitleSize || 18,\n\t\t\t\t\t\t\tcolor: TEXT_DARKEST,\n\t\t\t\t\t\t\tfontFamily: \"sf-semibold\",\n\t\t\t\t\t\t\tlineHeight: 24,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trenderText: this.renderTextContent,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: FormattedText.UrlTextRegex,\n\t\t\t\t\t\tstyle: this.ifEnabled({ color: colourBrandingMain }),\n\t\t\t\t\t\tonPress: this.ifEnabled(this.onPressUrlText),\n\t\t\t\t\t\trenderText: this.renderUrlText,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern:\n\t\t\t\t\t\t\t/(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#\\/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#\\/%=~_|$])/im,\n\t\t\t\t\t\tstyle: this.ifEnabled({ color: colourBrandingMain }),\n\t\t\t\t\t\tonPress: this.ifEnabled(this.onPressUrl),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: /([A-Z0-9._%-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4})/im,\n\t\t\t\t\t\tstyle: this.ifEnabled({ color: colourBrandingMain }),\n\t\t\t\t\t\tonPress: this.ifEnabled(this.onPressEmail),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern:\n\t\t\t\t\t\t\t/(?:\\+?(\\d{1,3}))?([-. (]*(\\d{1,3})[-. )]*)?((\\d{2,4})[-. ]*(\\d{2,4})(?:[-.x ]*(\\d+))?)\\s*$/im,\n\t\t\t\t\t\tstyle: this.ifEnabled({ color: colourBrandingMain }),\n\t\t\t\t\t\tonPress: this.ifEnabled(this.onPressPhone),\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</ParsedText>\n\t\t);\n\t}\n}\n\nconst styles = {\n\ttext: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontSize: 14,\n\t\tfontFamily: \"sf-regular\",\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nexport default connect(mapStateToProps, {})(FormattedText);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,0BAA0B;AAC7C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,8BAA8B,EAAEC,YAAY,QAAQ,YAAY;AACzE,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,gBAAgB,QAAQ,SAAS;AAE1C,MAAMC,aAAa,SAAST,SAAS,CAAC;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAiBvBC,GAAG,IAAK;MACrB,MAAMC,QAAQ,GAAGP,WAAW,CAACM,GAAG,CAAC;MACjCZ,OAAO,CAACc,OAAO,CAACD,QAAQ,CAAC;MACzB,IAAI,CAACE,QAAQ,CAAC,UAAU,EAAEF,QAAQ,CAAC;IACpC,CAAC;IAAAF,eAAA,yBAEiBK,OAAO,IAA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CAAC;QAC5CJ,UAAU,EAAE,IAAI,CAACjB;MAClB,CAAC,EACD;QACCe,OAAO,EACN,mKAAmK;QACpKb,KAAK,EAAE,IAAI,CAACU,SAAS,CAAC;UAAEO,KAAK,EAAEd;QAAmB,CAAC,CAAC;QACpDe,OAAO,EAAE,IAAI,CAACR,SAAS,CAAC,IAAI,CAAC/B,UAAU;MACxC,CAAC,EACD;QACCkC,OAAO,EAAE,6CAA6C;QACtDb,KAAK,EAAE,IAAI,CAACU,SAAS,CAAC;UAAEO,KAAK,EAAEd;QAAmB,CAAC,CAAC;QACpDe,OAAO,EAAE,IAAI,CAACR,SAAS,CAAC,IAAI,CAACU,YAAY;MAC1C,CAAC,EACD;QACCP,OAAO,EACN,8FAA8F;QAC/Fb,KAAK,EAAE,IAAI,CAACU,SAAS,CAAC;UAAEO,KAAK,EAAEd;QAAmB,CAAC,CAAC;QACpDe,OAAO,EAAE,IAAI,CAACR,SAAS,CAAC,IAAI,CAACW,YAAY;MAC1C,CAAC;IACA,GAEDhB,QACU,CAAC;EAEf;AACD;AAEA,MAAMG,MAAM,GAAG;EACdC,IAAI,EAAE;IACLQ,KAAK,EAAErD,YAAY;IACnBoD,QAAQ,EAAE,EAAE;IACZF,UAAU,EAAE;EACb;AACD,CAAC;AAED,MAAMQ,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNpB,kBAAkB,EAAExC,8BAA8B,CAAC4D,KAAK;EACzD,CAAC;AACF,CAAC;AAED,eAAe/D,OAAO,CAAC8D,eAAe,EAAE,CAAC,CAAC,CAAC,CAACvD,aAAa,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { Component } from "react";
|
|
2
2
|
import _ from "lodash";
|
|
3
|
-
import {
|
|
3
|
+
import { Input, View, TouchableWithoutFeedback } from "react-native";
|
|
4
|
+
import { Text } from "./Text";
|
|
4
5
|
import { Icon } from "@rneui/themed";
|
|
5
6
|
import { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from "../colours";
|
|
6
|
-
import { FontAwesome } from "
|
|
7
|
+
import { FontAwesome } from "@expo/vector-icons";
|
|
7
8
|
class GenericInput extends Component {
|
|
8
9
|
constructor(props) {
|
|
9
10
|
super(props);
|
|
@@ -82,6 +83,7 @@ class GenericInput extends Component {
|
|
|
82
83
|
height: 36
|
|
83
84
|
}, this.props.containerStyle]
|
|
84
85
|
}, this.renderLeftIcon(), /*#__PURE__*/React.createElement(TextInput, {
|
|
86
|
+
maxFontSizeMultiplier: 1.2,
|
|
85
87
|
ref: this.inputRef,
|
|
86
88
|
placeholder: this.props.placeholder,
|
|
87
89
|
placeholderTextColor: TEXT_LIGHT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","TextInput","View","TouchableWithoutFeedback","Icon","TEXT_LIGHT","TEXT_DARK","TEXT_DARKEST","FontAwesome","GenericInput","constructor","props","state","showSecureText","inputRef","createRef","blur","current","toggleSecureText","setState","renderLeftIcon","icon","iconType","createElement","name","style","styles","searchIcon","type","iconStyle","renderRightIcon","secureTextEntry","onPress","bind","clearIcon","secureIcon","rightIcon","rightIconAction","hasClear","isEmpty","value","onChangeText","render","searchInputContainer","squaredCorners","squaredSearchInputContainer","autoGrow","paddingVertical","minHeight","height","containerStyle","ref","placeholder","placeholderTextColor","autoCorrect","autoFocus","multiline","searchText","textAlignVertical","keyboardType","returnKeyType","selectionColor","underlineColorAndroid","editable","autoCapitalize","onKeyPress","onSubmitEditing","onFocus","onBlur","flex","borderRadius","backgroundColor","alignItems","flexDirection","paddingHorizontal","fontSize","color","marginRight","marginLeft","marginTop","marginBottom","fontFamily"],"sources":["GenericInput.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { TextInput, View, TouchableWithoutFeedback } from \"react-native\";\nimport { Icon } from \"@rneui/themed\";\nimport { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from \"../colours\";\nimport { FontAwesome } from \"./Icon\";\n\nclass GenericInput extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tshowSecureText: false,\n\t\t};\n\t\tthis.inputRef = React.createRef();\n\t}\n\n\tblur() {\n\t\tthis.inputRef.current.blur();\n\t}\n\n\ttoggleSecureText() {\n\t\tthis.setState({\n\t\t\tshowSecureText: !this.state.showSecureText,\n\t\t});\n\t}\n\n\trenderLeftIcon() {\n\t\tif (!this.props.icon) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.props.iconType && this.props.iconType === \"pl60\") {\n\t\t\treturn <FontAwesome name={this.props.icon} style={styles.searchIcon} />;\n\t\t}\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\ttype=\"font-awesome\"\n\t\t\t\tname={this.props.icon}\n\t\t\t\ticonStyle={styles.searchIcon}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderRightIcon() {\n\t\tif (this.props.secureTextEntry) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback onPress={this.toggleSecureText.bind(this)}>\n\t\t\t\t\t<FontAwesome\n\t\t\t\t\t\tname={this.state.showSecureText ? \"eye-slash\" : \"eye\"}\n\t\t\t\t\t\tstyle={[styles.clearIcon, styles.secureIcon]}\n\t\t\t\t\t/>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\tif (this.props.rightIcon) {\n\t\t\tif (this.props.rightIconAction) {\n\t\t\t\treturn (\n\t\t\t\t\t<TouchableWithoutFeedback onPress={this.props.rightIconAction}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Icon\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif (this.props.hasClear && !_.isEmpty(this.props.value)) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\tthis.props.onChangeText(\"\");\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesome name=\"circle-x\" style={styles.clearIcon} />\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.searchInputContainer,\n\t\t\t\t\tthis.props.squaredCorners && styles.squaredSearchInputContainer,\n\t\t\t\t\tthis.props.autoGrow\n\t\t\t\t\t\t? { paddingVertical: 8, minHeight: 40 }\n\t\t\t\t\t\t: { height: 36 },\n\t\t\t\t\tthis.props.containerStyle,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{this.renderLeftIcon()}\n\t\t\t\t<TextInput\n\t\t\t\t\tref={this.inputRef}\n\t\t\t\t\tplaceholder={this.props.placeholder}\n\t\t\t\t\tplaceholderTextColor={TEXT_LIGHT}\n\t\t\t\t\tautoCorrect={\n\t\t\t\t\t\tthis.props.autoCorrect != null ? this.props.autoCorrect : false\n\t\t\t\t\t}\n\t\t\t\t\tautoFocus={\n\t\t\t\t\t\tthis.props.autoFocus != null ? this.props.autoFocus : false\n\t\t\t\t\t}\n\t\t\t\t\tautoGrow={this.props.autoGrow != null ? this.props.autoGrow : false}\n\t\t\t\t\tmultiline={\n\t\t\t\t\t\tthis.props.multiline != null ? this.props.multiline : false\n\t\t\t\t\t}\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.searchText,\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t\t{ textAlignVertical: this.props.multiline ? \"top\" : \"center\" },\n\t\t\t\t\t\tthis.props.minHeight && { minHeight: this.props.minHeight },\n\t\t\t\t\t]}\n\t\t\t\t\tvalue={this.props.value}\n\t\t\t\t\tonChangeText={this.props.onChangeText}\n\t\t\t\t\tkeyboardType={this.props.keyboardType}\n\t\t\t\t\treturnKeyType={this.props.returnKeyType}\n\t\t\t\t\tselectionColor={TEXT_DARK}\n\t\t\t\t\tunderlineColorAndroid=\"rgba(0,0,0,0)\"\n\t\t\t\t\teditable={this.props.editable != null ? this.props.editable : true}\n\t\t\t\t\tautoCapitalize={this.props.autoCapitalize || \"none\"}\n\t\t\t\t\tonKeyPress={this.props.onKeyPress}\n\t\t\t\t\tonSubmitEditing={this.props.onSubmitEditing}\n\t\t\t\t\tonFocus={this.props.onFocus}\n\t\t\t\t\tonBlur={this.props.onBlur}\n\t\t\t\t\tsecureTextEntry={\n\t\t\t\t\t\tthis.props.secureTextEntry && !this.state.showSecureText\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{this.renderRightIcon()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tsearchInputContainer: {\n\t\tflex: 1,\n\t\tborderRadius: 25,\n\t\tbackgroundColor: \"#ebeff2\",\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tpaddingHorizontal: 16,\n\t},\n\tsquaredSearchInputContainer: {\n\t\tborderRadius: 5,\n\t\tpaddingHorizontal: 8,\n\t},\n\tsearchIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginRight: 8,\n\t},\n\tclearIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginLeft: 8,\n\t\tmarginTop: 8,\n\t\tmarginBottom: 8,\n\t},\n\tsecureIcon: {\n\t\tfontSize: 20,\n\t},\n\tsearchText: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tflex: 1,\n\t},\n};\n\nexport { GenericInput };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAI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EAAE;IAChBC,eAAe,EAAE,SAAS;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACD7B,2BAA2B,EAAE;IAC5ByB,YAAY,EAAE,CAAC;IACfI,iBAAiB,EAAE;EACpB,CAAC;EACD/C,UAAU,EAAE;IACXgD,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEvE,UAAU;IACjBwE,WAAW,EAAE;EACd,CAAC;EACD3C,SAAS,EAAE;IACVyC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEvE,UAAU;IACjByE,UAAU,EAAE,CAAC;IACbC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EACf,CAAC;EACD7C,UAAU,EAAE;IACXwC,QAAQ,EAAE;EACX,CAAC;EACDlB,UAAU,EAAE;IACXmB,KAAK,EAAErE,YAAY;IACnB0E,UAAU,EAAE,YAAY;IACxBN,QAAQ,EAAE,EAAE;IACZN,IAAI,EAAE;EACP;AACD,CAAC;AAED,SAAS5D,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","_","Input","View","TouchableWithoutFeedback","Text","Icon","TEXT_LIGHT","TEXT_DARK","TEXT_DARKEST","FontAwesome","GenericInput","constructor","props","state","showSecureText","inputRef","createRef","blur","current","toggleSecureText","setState","renderLeftIcon","icon","iconType","createElement","name","style","styles","searchIcon","type","iconStyle","renderRightIcon","secureTextEntry","onPress","bind","clearIcon","secureIcon","rightIcon","rightIconAction","hasClear","isEmpty","value","onChangeText","render","searchInputContainer","squaredCorners","squaredSearchInputContainer","autoGrow","paddingVertical","minHeight","height","containerStyle","TextInput","maxFontSizeMultiplier","ref","placeholder","placeholderTextColor","autoCorrect","autoFocus","multiline","searchText","textAlignVertical","keyboardType","returnKeyType","selectionColor","underlineColorAndroid","editable","autoCapitalize","onKeyPress","onSubmitEditing","onFocus","onBlur","flex","borderRadius","backgroundColor","alignItems","flexDirection","paddingHorizontal","fontSize","color","marginRight","marginLeft","marginTop","marginBottom","fontFamily"],"sources":["GenericInput.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { Input, View, TouchableWithoutFeedback } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"@rneui/themed\";\nimport { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from \"../colours\";\nimport { FontAwesome } from \"@expo/vector-icons\";\n\nclass GenericInput extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tshowSecureText: false,\n\t\t};\n\t\tthis.inputRef = React.createRef();\n\t}\n\n\tblur() {\n\t\tthis.inputRef.current.blur();\n\t}\n\n\ttoggleSecureText() {\n\t\tthis.setState({\n\t\t\tshowSecureText: !this.state.showSecureText,\n\t\t});\n\t}\n\n\trenderLeftIcon() {\n\t\tif (!this.props.icon) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.props.iconType && this.props.iconType === \"pl60\") {\n\t\t\treturn <FontAwesome name={this.props.icon} style={styles.searchIcon} />;\n\t\t}\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\ttype=\"font-awesome\"\n\t\t\t\tname={this.props.icon}\n\t\t\t\ticonStyle={styles.searchIcon}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderRightIcon() {\n\t\tif (this.props.secureTextEntry) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback onPress={this.toggleSecureText.bind(this)}>\n\t\t\t\t\t<FontAwesome\n\t\t\t\t\t\tname={this.state.showSecureText ? \"eye-slash\" : \"eye\"}\n\t\t\t\t\t\tstyle={[styles.clearIcon, styles.secureIcon]}\n\t\t\t\t\t/>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\tif (this.props.rightIcon) {\n\t\t\tif (this.props.rightIconAction) {\n\t\t\t\treturn (\n\t\t\t\t\t<TouchableWithoutFeedback onPress={this.props.rightIconAction}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Icon\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif (this.props.hasClear && !_.isEmpty(this.props.value)) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\tthis.props.onChangeText(\"\");\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesome name=\"circle-x\" style={styles.clearIcon} />\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.searchInputContainer,\n\t\t\t\t\tthis.props.squaredCorners && styles.squaredSearchInputContainer,\n\t\t\t\t\tthis.props.autoGrow\n\t\t\t\t\t\t? { paddingVertical: 8, minHeight: 40 }\n\t\t\t\t\t\t: { height: 36 },\n\t\t\t\t\tthis.props.containerStyle,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{this.renderLeftIcon()}\n\t\t\t\t<TextInput\n\t\t\t\t\tmaxFontSizeMultiplier={1.2}\n\t\t\t\t\tref={this.inputRef}\n\t\t\t\t\tplaceholder={this.props.placeholder}\n\t\t\t\t\tplaceholderTextColor={TEXT_LIGHT}\n\t\t\t\t\tautoCorrect={\n\t\t\t\t\t\tthis.props.autoCorrect != null ? this.props.autoCorrect : false\n\t\t\t\t\t}\n\t\t\t\t\tautoFocus={\n\t\t\t\t\t\tthis.props.autoFocus != null ? this.props.autoFocus : false\n\t\t\t\t\t}\n\t\t\t\t\tautoGrow={this.props.autoGrow != null ? this.props.autoGrow : false}\n\t\t\t\t\tmultiline={\n\t\t\t\t\t\tthis.props.multiline != null ? this.props.multiline : false\n\t\t\t\t\t}\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.searchText,\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t\t{ textAlignVertical: this.props.multiline ? \"top\" : \"center\" },\n\t\t\t\t\t\tthis.props.minHeight && { minHeight: this.props.minHeight },\n\t\t\t\t\t]}\n\t\t\t\t\tvalue={this.props.value}\n\t\t\t\t\tonChangeText={this.props.onChangeText}\n\t\t\t\t\tkeyboardType={this.props.keyboardType}\n\t\t\t\t\treturnKeyType={this.props.returnKeyType}\n\t\t\t\t\tselectionColor={TEXT_DARK}\n\t\t\t\t\tunderlineColorAndroid=\"rgba(0,0,0,0)\"\n\t\t\t\t\teditable={this.props.editable != null ? this.props.editable : true}\n\t\t\t\t\tautoCapitalize={this.props.autoCapitalize || \"none\"}\n\t\t\t\t\tonKeyPress={this.props.onKeyPress}\n\t\t\t\t\tonSubmitEditing={this.props.onSubmitEditing}\n\t\t\t\t\tonFocus={this.props.onFocus}\n\t\t\t\t\tonBlur={this.props.onBlur}\n\t\t\t\t\tsecureTextEntry={\n\t\t\t\t\t\tthis.props.secureTextEntry && !this.state.showSecureText\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{this.renderRightIcon()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tsearchInputContainer: {\n\t\tflex: 1,\n\t\tborderRadius: 25,\n\t\tbackgroundColor: \"#ebeff2\",\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tpaddingHorizontal: 16,\n\t},\n\tsquaredSearchInputContainer: {\n\t\tborderRadius: 5,\n\t\tpaddingHorizontal: 8,\n\t},\n\tsearchIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginRight: 8,\n\t},\n\tclearIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginLeft: 8,\n\t\tmarginTop: 8,\n\t\tmarginBottom: 8,\n\t},\n\tsecureIcon: {\n\t\tfontSize: 20,\n\t},\n\tsearchText: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tflex: 1,\n\t},\n};\n\nexport { GenericInput };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,KAAK,EAAEC,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;AACpE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,UAAU,EAAEC,SAAS,EAAEC,YAAY,QAAQ,YAAY;AAChE,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,MAAMC,YAAY,SAASX,SAAS,CAAC;EACpCY,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MACZC,cAAc,EAAE;IACjB,CAAC;IACD,IAAI,CAACC,QAAQ,gBAAGjB,KAAK,CAACkB,SAAS,CAAC,CAAC;EAClC;EAEAC,IAAIA,CAAA,EAAG;IACN,IAAI,CAACF,QAAQ,CAACG,OAAO,CAACD,IAAI,CAAC,CAAC;EAC7B;EAEAE,gBAAgBA,CAAA,EAAG;IAClB,IAAI,CAACC,QAAQ,CAAC;MACbN,cAAc,EAAE,CAAC,IAAI,CAACD,KAAK,CAACC;IAC7B,CAAC,CAAC;EACH;EAEAO,cAAcA,CAAA,EAAG;IAChB,IAAI,CAAC,IAAI,CAACT,KAAK,CAACU,IAAI,EAAE;MACrB,OAAO,IAAI;IACZ;IACA,IAAI,IAAI,CAACV,KAAK,CAACW,QAAQ,IAAI,IAAI,CAACX,KAAK,CAACW,QAAQ,KAAK,MAAM,E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AAgB;MAC5CC,OAAO,EAAE,IAAI,CAAC1D,KAAK,CAAC0D,OAAQ;MAC5BC,MAAM,EAAE,IAAI,CAAC3D,KAAK,CAAC2D,MAAO;MAC1BvC,eAAe,EACd,IAAI,CAACpB,KAAK,CAACoB,eAAe,IAAI,CAAC,IAAI,CAACnB,KAAK,CAACC;IAC1C,CACD,CAAC,EACD,IAAI,CAACiB,eAAe,CAAC,CACjB,CAAC;EAET;AACD;AAEA,MAAMJ,MAAM,GAAG;EACdiB,oBAAoB,EAAE;IACrB4B,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,SAAS;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACD/B,2BAA2B,EAAE;IAC5B2B,YAAY,EAAE,CAAC;IACfI,iBAAiB,EAAE;EACpB,CAAC;EACDjD,UAAU,EAAE;IACXkD,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEzE,UAAU;IACjB0E,WAAW,EAAE;EACd,CAAC;EACD7C,SAAS,EAAE;IACV2C,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEzE,UAAU;IACjB2E,UAAU,EAAE,CAAC;IACbC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EACf,CAAC;EACD/C,UAAU,EAAE;IACX0C,QAAQ,EAAE;EACX,CAAC;EACDlB,UAAU,EAAE;IACXmB,KAAK,EAAEvE,YAAY;IACnB4E,UAAU,EAAE,YAAY;IACxBN,QAAQ,EAAE,EAAE;IACZN,IAAI,EAAE;EACP;AACD,CAAC;AAED,SAAS9D,YAAY","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { PureComponent } from "react";
|
|
3
|
-
import { View,
|
|
3
|
+
import { View, TouchableOpacity } from "react-native";
|
|
4
|
+
import { Text } from "./Text";
|
|
4
5
|
import { Icon } from "@rneui/themed";
|
|
5
6
|
import { connect } from "react-redux";
|
|
6
7
|
import { GenericInput } from "./GenericInput";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","View","Text","TouchableOpacity","Icon","connect","GenericInput","TEXT_DARKEST","COLOUR_GREEN","COLOUR_GRAPEFRUIT","getMainBrandingColourFromState","RadioButton","GenericInputSection","renderValidationDot","props","required","createElement","style","styles","validatorDot","isValid","validatorTrue","validatorFalse","renderLabel","label","labelContainer","labelText","labelStyle","renderRadioOption","value","isActive","onChange","onPress","key","radioOption","hitSlop","top","left","bottom","right","iconSize","radioOptionButton","radioOptionText","renderInput","children","inputType","radioOptionsContainer","options","map","o","Label","Value","radioOptionVertical","optionSelector","optionSelectorText","name","type","iconStyle","optionSelectorIcon","color","colourBrandingMain","_extends","containerStyle","input","renderError","showError","errorText","render","container","sectionStyle","flexDirection","alignItems","fontFamily","fontSize","marginTop","height","width","borderRadius","marginLeft","backgroundColor","marginRight","flex","justifyContent","paddingHorizontal","paddingTop","mapStateToProps","state","genericInputSection"],"sources":["GenericInputSection.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View, Text, TouchableOpacity } from \"react-native\";\nimport { Icon } from \"@rneui/themed\";\nimport { connect } from \"react-redux\";\nimport { GenericInput } from \"./GenericInput\";\nimport {\n\tTEXT_DARKEST,\n\tCOLOUR_GREEN,\n\tCOLOUR_GRAPEFRUIT,\n\tgetMainBrandingColourFromState,\n} from \"../colours\";\nimport { RadioButton } from \"./RadioButton\";\n\nclass GenericInputSection extends PureComponent {\n\trenderValidationDot() {\n\t\tif (!this.props.required) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.validatorDot,\n\t\t\t\t\tthis.props.isValid() ? styles.validatorTrue : styles.validatorFalse,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderLabel() {\n\t\tif (!this.props.label) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={styles.labelContainer}>\n\t\t\t\t<Text style={[styles.labelText, this.props.labelStyle]}>\n\t\t\t\t\t{this.props.label}\n\t\t\t\t</Text>\n\t\t\t\t{this.renderValidationDot()}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderRadioOption(label, value, isActive, onChange, style) {\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tonPress={() => onChange(value)}\n\t\t\t\tkey={label}\n\t\t\t\tstyle={[styles.radioOption, style]}\n\t\t\t\thitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n\t\t\t>\n\t\t\t\t<RadioButton\n\t\t\t\t\tonPress={() => onChange(value)}\n\t\t\t\t\tisActive={isActive}\n\t\t\t\t\ticonSize={22}\n\t\t\t\t\tstyle={styles.radioOptionButton}\n\t\t\t\t/>\n\t\t\t\t<Text style={styles.radioOptionText}>{label}</Text>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif (this.props.children) {\n\t\t\treturn this.props.children;\n\t\t}\n\t\tif (this.props.inputType === \"toggle\") {\n\t\t\treturn (\n\t\t\t\t<View style={styles.radioOptionsContainer}>\n\t\t\t\t\t{this.renderRadioOption(\n\t\t\t\t\t\t\"Yes\",\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tthis.props.value === true,\n\t\t\t\t\t\tthis.props.onChange,\n\t\t\t\t\t)}\n\t\t\t\t\t{this.renderRadioOption(\n\t\t\t\t\t\t\"No\",\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tthis.props.value === false,\n\t\t\t\t\t\tthis.props.onChange,\n\t\t\t\t\t)}\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\tif (this.props.inputType === \"radio\") {\n\t\t\treturn (\n\t\t\t\t<View>\n\t\t\t\t\t{this.props.options.map((o) => {\n\t\t\t\t\t\treturn this.renderRadioOption(\n\t\t\t\t\t\t\to.Label,\n\t\t\t\t\t\t\to.Value,\n\t\t\t\t\t\t\tthis.props.value === o.Value,\n\t\t\t\t\t\t\tthis.props.onChange,\n\t\t\t\t\t\t\tstyles.radioOptionVertical,\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\tif (this.props.inputType === \"optionSelector\") {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity onPress={this.props.onPress}>\n\t\t\t\t\t<View style={styles.optionSelector}>\n\t\t\t\t\t\t<Text style={styles.optionSelectorText}>{this.props.value}</Text>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"angle-right\"\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\t\tstyles.optionSelectorIcon,\n\t\t\t\t\t\t\t\t{ color: this.props.colourBrandingMain },\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<GenericInput\n\t\t\t\t{...this.props}\n\t\t\t\tcontainerStyle={[styles.input, this.props.containerStyle]}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderError() {\n\t\tif (this.props.showError === true && !this.props.isValid()) {\n\t\t\treturn (\n\t\t\t\t<Text style={styles.errorText}>\n\t\t\t\t\t{this.props.errorText || \"Required\"}\n\t\t\t\t</Text>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.sectionStyle]}>\n\t\t\t\t{this.renderLabel()}\n\t\t\t\t{this.renderInput()}\n\t\t\t\t{this.renderError()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {},\n\tlabelContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t},\n\tlabelText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_DARKEST,\n\t},\n\tinput: {\n\t\tmarginTop: 8,\n\t},\n\tvalidatorDot: {\n\t\theight: 6,\n\t\twidth: 6,\n\t\tborderRadius: 3,\n\t\tmarginLeft: 8,\n\t},\n\tvalidatorTrue: {\n\t\tbackgroundColor: COLOUR_GREEN,\n\t},\n\tvalidatorFalse: {\n\t\tbackgroundColor: COLOUR_GRAPEFRUIT,\n\t},\n\tradioOptionsContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tmarginTop: 8,\n\t},\n\tradioOptionVertical: {\n\t\tmarginTop: 16,\n\t},\n\tradioOption: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tmarginRight: 24,\n\t},\n\tradioOptionButton: {\n\t\tmarginRight: 8,\n\t},\n\tradioOptionText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 14,\n\t\tcolor: TEXT_DARKEST,\n\t},\n\toptionSelector: {\n\t\tmarginTop: 8,\n\t\tflex: 1,\n\t\theight: 36,\n\t\tbackgroundColor: \"#ebeff2\",\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t\tborderRadius: 5,\n\t\tpaddingHorizontal: 8,\n\t},\n\toptionSelectorText: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t},\n\terrorText: {\n\t\tpaddingTop: 4,\n\t\tfontSize: 13,\n\t\tfontFamily: \"sf-regular\",\n\t\tcolor: COLOUR_GRAPEFRUIT,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst genericInputSection = connect(mapStateToProps, {})(GenericInputSection);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SAAS,EAAE;EACZ,CAAC;EACDxC,WAAW,EAAE;IACZoC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBS,WAAW,EAAE;EACd,CAAC;EACDvC,iBAAiB,EAAE;IAClBuC,WAAW,EAAE;EACd,CAAC;EACDtC,eAAe,EAAE;IAChB8B,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZd,KAAK,EAAEpD;EACR,CAAC;EACD8C,cAAc,EAAE;IACfqB,SAAS,EAAE,CAAC;IACZO,IAAI,EAAE,CAAC;IACPN,MAAM,EAAE,EAAE;IACVI,eAAe,EAAE,SAAS;IAC1BR,UAAU,EAAE,QAAQ;IACpBD,aAAa,EAAE,KAAK;IACpBY,cAAc,EAAE,eAAe;IAC/BL,YAAY,EAAE,CAAC;IACfM,iBAAiB,EAAE;EACpB,CAAC;EACD7B,kBAAkB,EAAE;IACnBK,KAAK,EAAEpD,YAAY;IACnBiE,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE;EACX,CAAC;EACDP,SAAS,EAAE;IACVkB,UAAU,EAAE,CAAC;IACbX,QAAQ,EAAE,EAAE;IACZD,UAAU,EAAE,YAAY;IACxBb,KAAK,EAAElD;EACR;AACD,CAAC;AAED,MAAM4E,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACN1B,kBAAkB,EAAElD,8BAA8B,CAAC4E,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,mBAAmB,GAAGlF,OAAO,CAACgF,eAAe,EAAE,CAAC,CAAC,CAAC,CAACzE,mBAAmB,CAAC;AAC7E,SAAS2E,mBAAmB,IAAI3E,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","TouchableOpacity","Text","Icon","connect","GenericInput","TEXT_DARKEST","COLOUR_GREEN","COLOUR_GRAPEFRUIT","getMainBrandingColourFromState","RadioButton","GenericInputSection","renderValidationDot","props","required","createElement","style","styles","validatorDot","isValid","validatorTrue","validatorFalse","renderLabel","label","labelContainer","labelText","labelStyle","renderRadioOption","value","isActive","onChange","onPress","key","radioOption","hitSlop","top","left","bottom","right","iconSize","radioOptionButton","radioOptionText","renderInput","children","inputType","radioOptionsContainer","options","map","o","Label","Value","radioOptionVertical","optionSelector","optionSelectorText","name","type","iconStyle","optionSelectorIcon","color","colourBrandingMain","_extends","containerStyle","input","renderError","showError","errorText","render","container","sectionStyle","flexDirection","alignItems","fontFamily","fontSize","marginTop","height","width","borderRadius","marginLeft","backgroundColor","marginRight","flex","justifyContent","paddingHorizontal","paddingTop","mapStateToProps","state","genericInputSection"],"sources":["GenericInputSection.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View, TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"@rneui/themed\";\nimport { connect } from \"react-redux\";\nimport { GenericInput } from \"./GenericInput\";\nimport {\n\tTEXT_DARKEST,\n\tCOLOUR_GREEN,\n\tCOLOUR_GRAPEFRUIT,\n\tgetMainBrandingColourFromState,\n} from \"../colours\";\nimport { RadioButton } from \"./RadioButton\";\n\nclass GenericInputSection extends PureComponent {\n\trenderValidationDot() {\n\t\tif (!this.props.required) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.validatorDot,\n\t\t\t\t\tthis.props.isValid() ? styles.validatorTrue : styles.validatorFalse,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderLabel() {\n\t\tif (!this.props.label) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={styles.labelContainer}>\n\t\t\t\t<Text style={[styles.labelText, this.props.labelStyle]}>\n\t\t\t\t\t{this.props.label}\n\t\t\t\t</Text>\n\t\t\t\t{this.renderValidationDot()}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderRadioOption(label, value, isActive, onChange, style) {\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tonPress={() => onChange(value)}\n\t\t\t\tkey={label}\n\t\t\t\tstyle={[styles.radioOption, style]}\n\t\t\t\thitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n\t\t\t>\n\t\t\t\t<RadioButton\n\t\t\t\t\tonPress={() => onChange(value)}\n\t\t\t\t\tisActive={isActive}\n\t\t\t\t\ticonSize={22}\n\t\t\t\t\tstyle={styles.radioOptionButton}\n\t\t\t\t/>\n\t\t\t\t<Text style={styles.radioOptionText}>{label}</Text>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif (this.props.children) {\n\t\t\treturn this.props.children;\n\t\t}\n\t\tif (this.props.inputType === \"toggle\") {\n\t\t\treturn (\n\t\t\t\t<View style={styles.radioOptionsContainer}>\n\t\t\t\t\t{this.renderRadioOption(\n\t\t\t\t\t\t\"Yes\",\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tthis.props.value === true,\n\t\t\t\t\t\tthis.props.onChange,\n\t\t\t\t\t)}\n\t\t\t\t\t{this.renderRadioOption(\n\t\t\t\t\t\t\"No\",\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tthis.props.value === false,\n\t\t\t\t\t\tthis.props.onChange,\n\t\t\t\t\t)}\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\tif (this.props.inputType === \"radio\") {\n\t\t\treturn (\n\t\t\t\t<View>\n\t\t\t\t\t{this.props.options.map((o) => {\n\t\t\t\t\t\treturn this.renderRadioOption(\n\t\t\t\t\t\t\to.Label,\n\t\t\t\t\t\t\to.Value,\n\t\t\t\t\t\t\tthis.props.value === o.Value,\n\t\t\t\t\t\t\tthis.props.onChange,\n\t\t\t\t\t\t\tstyles.radioOptionVertical,\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\tif (this.props.inputType === \"optionSelector\") {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity onPress={this.props.onPress}>\n\t\t\t\t\t<View style={styles.optionSelector}>\n\t\t\t\t\t\t<Text style={styles.optionSelectorText}>{this.props.value}</Text>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"angle-right\"\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\t\tstyles.optionSelectorIcon,\n\t\t\t\t\t\t\t\t{ color: this.props.colourBrandingMain },\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<GenericInput\n\t\t\t\t{...this.props}\n\t\t\t\tcontainerStyle={[styles.input, this.props.containerStyle]}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderError() {\n\t\tif (this.props.showError === true && !this.props.isValid()) {\n\t\t\treturn (\n\t\t\t\t<Text style={styles.errorText}>\n\t\t\t\t\t{this.props.errorText || \"Required\"}\n\t\t\t\t</Text>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.sectionStyle]}>\n\t\t\t\t{this.renderLabel()}\n\t\t\t\t{this.renderInput()}\n\t\t\t\t{this.renderError()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {},\n\tlabelContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t},\n\tlabelText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_DARKEST,\n\t},\n\tinput: {\n\t\tmarginTop: 8,\n\t},\n\tvalidatorDot: {\n\t\theight: 6,\n\t\twidth: 6,\n\t\tborderRadius: 3,\n\t\tmarginLeft: 8,\n\t},\n\tvalidatorTrue: {\n\t\tbackgroundColor: COLOUR_GREEN,\n\t},\n\tvalidatorFalse: {\n\t\tbackgroundColor: COLOUR_GRAPEFRUIT,\n\t},\n\tradioOptionsContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tmarginTop: 8,\n\t},\n\tradioOptionVertical: {\n\t\tmarginTop: 16,\n\t},\n\tradioOption: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tmarginRight: 24,\n\t},\n\tradioOptionButton: {\n\t\tmarginRight: 8,\n\t},\n\tradioOptionText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 14,\n\t\tcolor: TEXT_DARKEST,\n\t},\n\toptionSelector: {\n\t\tmarginTop: 8,\n\t\tflex: 1,\n\t\theight: 36,\n\t\tbackgroundColor: \"#ebeff2\",\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t\tborderRadius: 5,\n\t\tpaddingHorizontal: 8,\n\t},\n\toptionSelectorText: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t},\n\terrorText: {\n\t\tpaddingTop: 4,\n\t\tfontSize: 13,\n\t\tfontFamily: \"sf-regular\",\n\t\tcolor: COLOUR_GRAPEFRUIT,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst genericInputSection = connect(mapStateToProps, {})(GenericInputSection);\nexport { genericInputSection as GenericInputSection };\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACrD,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SACCC,YAAY,EACZC,YAAY,EACZC,iBAAiB,EACjBC,8BAA8B,QACxB,YAAY;AACnB,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,mBAAmB,SAASZ,aAAa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eAAe,EAAE,SAAS;IAC1BR,UAAU,EAAE,QAAQ;IACpBD,aAAa,EAAE,KAAK;IACpBY,cAAc,EAAE,eAAe;IAC/BL,YAAY,EAAE,CAAC;IACfM,iBAAiB,EAAE;EACpB,CAAC;EACD7B,kBAAkB,EAAE;IACnBK,KAAK,EAAEpD,YAAY;IACnBiE,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE;EACX,CAAC;EACDP,SAAS,EAAE;IACVkB,UAAU,EAAE,CAAC;IACbX,QAAQ,EAAE,EAAE;IACZD,UAAU,EAAE,YAAY;IACxBb,KAAK,EAAElD;EACR;AACD,CAAC;AAED,MAAM4E,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACN1B,kBAAkB,EAAElD,8BAA8B,CAAC4E,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,mBAAmB,GAAGlF,OAAO,CAACgF,eAAe,EAAE,CAAC,CAAC,CAAC,CAACzE,mBAAmB,CAAC;AAC7E,SAAS2E,mBAAmB,IAAI3E,mBAAmB","ignoreList":[]}
|
|
@@ -16,7 +16,7 @@ import { connect } from "react-redux";
|
|
|
16
16
|
// } from '../../js';
|
|
17
17
|
import { StatusBarHeight, getSiteSettingFromState } from "../helper";
|
|
18
18
|
import { COLOUR_TRANSPARENT, TEXT_DARK, TEXT_LIGHT, LINEGREY, COLOUR_GREEN, getMainBrandingColourFromState, hexToRGBAstring } from "../colours";
|
|
19
|
-
import { FontAwesome } from "
|
|
19
|
+
import { FontAwesome } from "@expo/vector-icons";
|
|
20
20
|
import Config from "../config";
|
|
21
21
|
// import { HAS_GRADIENT_HEADER } from '../../config';
|
|
22
22
|
|