@plusscommunities/pluss-core-app 4.0.4-auth.0 → 6.0.0-auth.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.
Files changed (195) hide show
  1. package/dist/module/actions/FollowerActions.js +34 -0
  2. package/dist/module/actions/FollowerActions.js.map +1 -0
  3. package/dist/module/actions/MediaActions.js +29 -0
  4. package/dist/module/actions/MediaActions.js.map +1 -0
  5. package/dist/module/actions/ResidentActions.js +26 -0
  6. package/dist/module/actions/ResidentActions.js.map +1 -0
  7. package/dist/module/actions/UserActions.js +223 -0
  8. package/dist/module/actions/UserActions.js.map +1 -0
  9. package/dist/module/actions/UserSettingsActions.js +14 -0
  10. package/dist/module/actions/UserSettingsActions.js.map +1 -0
  11. package/dist/module/actions/index.js +6 -0
  12. package/dist/module/actions/index.js.map +1 -0
  13. package/dist/module/actions/types.js +17 -0
  14. package/dist/module/actions/types.js.map +1 -0
  15. package/dist/module/apis/analyticsActions.js +20 -0
  16. package/dist/module/apis/analyticsActions.js.map +1 -0
  17. package/dist/module/apis/contactActions.js +27 -0
  18. package/dist/module/apis/contactActions.js.map +1 -0
  19. package/dist/module/apis/eventActions.js +161 -0
  20. package/dist/module/apis/eventActions.js.map +1 -0
  21. package/dist/module/apis/fileActions.js +86 -0
  22. package/dist/module/apis/fileActions.js.map +1 -0
  23. package/dist/module/apis/followerActions.js +38 -0
  24. package/dist/module/apis/followerActions.js.map +1 -0
  25. package/dist/module/apis/index.js +12 -0
  26. package/dist/module/apis/index.js.map +1 -0
  27. package/dist/module/apis/notificationActions.js +60 -0
  28. package/dist/module/apis/notificationActions.js.map +1 -0
  29. package/dist/module/apis/profileActions.js +14 -0
  30. package/dist/module/apis/profileActions.js.map +1 -0
  31. package/dist/module/apis/reactionActions.js +76 -0
  32. package/dist/module/apis/reactionActions.js.map +1 -0
  33. package/dist/module/apis/stringActions.js +30 -0
  34. package/dist/module/apis/stringActions.js.map +1 -0
  35. package/dist/module/apis/typeActions.js +15 -0
  36. package/dist/module/apis/typeActions.js.map +1 -0
  37. package/dist/module/apis/userActions.js +104 -0
  38. package/dist/module/apis/userActions.js.map +1 -0
  39. package/dist/module/assets/icons/reactions/heart.png +0 -0
  40. package/dist/module/assets/icons/reactions/party.png +0 -0
  41. package/dist/module/assets/icons/reactions/sad.png +0 -0
  42. package/dist/module/assets/icons/reactions/smile.png +0 -0
  43. package/dist/module/colours.js +168 -0
  44. package/dist/module/colours.js.map +1 -0
  45. package/dist/module/components/AddButton.js +43 -0
  46. package/dist/module/components/AddButton.js.map +1 -0
  47. package/dist/module/components/AddToCalendarButton.js +225 -0
  48. package/dist/module/components/AddToCalendarButton.js.map +1 -0
  49. package/dist/module/components/Attachment.js +54 -0
  50. package/dist/module/components/Attachment.js.map +1 -0
  51. package/dist/module/components/AudienceSelectorLauncher.js +64 -0
  52. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
  53. package/dist/module/components/AudienceSelectorPage.js +350 -0
  54. package/dist/module/components/AudienceSelectorPage.js.map +1 -0
  55. package/dist/module/components/AutoOffsetImage.js +186 -0
  56. package/dist/module/components/AutoOffsetImage.js.map +1 -0
  57. package/dist/module/components/BackButton.js +58 -0
  58. package/dist/module/components/BackButton.js.map +1 -0
  59. package/dist/module/components/CategoryTabs.js +154 -0
  60. package/dist/module/components/CategoryTabs.js.map +1 -0
  61. package/dist/module/components/CommentReply.js +328 -0
  62. package/dist/module/components/CommentReply.js.map +1 -0
  63. package/dist/module/components/CommentSection.js +822 -0
  64. package/dist/module/components/CommentSection.js.map +1 -0
  65. package/dist/module/components/ConfirmPopup.js +108 -0
  66. package/dist/module/components/ConfirmPopup.js.map +1 -0
  67. package/dist/module/components/ConfirmationPopup.js +72 -0
  68. package/dist/module/components/ConfirmationPopup.js.map +1 -0
  69. package/dist/module/components/DropDownItem.js +74 -0
  70. package/dist/module/components/DropDownItem.js.map +1 -0
  71. package/dist/module/components/DropDownMenu.js +41 -0
  72. package/dist/module/components/DropDownMenu.js.map +1 -0
  73. package/dist/module/components/EmptyStateMain.js +50 -0
  74. package/dist/module/components/EmptyStateMain.js.map +1 -0
  75. package/dist/module/components/EmptyStateWidget.js +47 -0
  76. package/dist/module/components/EmptyStateWidget.js.map +1 -0
  77. package/dist/module/components/FontScaleButton.js +36 -0
  78. package/dist/module/components/FontScaleButton.js.map +1 -0
  79. package/dist/module/components/FontScalePopup.js +75 -0
  80. package/dist/module/components/FontScalePopup.js.map +1 -0
  81. package/dist/module/components/FormCard.js +25 -0
  82. package/dist/module/components/FormCard.js.map +1 -0
  83. package/dist/module/components/FormCardSection.js +212 -0
  84. package/dist/module/components/FormCardSection.js.map +1 -0
  85. package/dist/module/components/FormCardSectionOptionLauncher.js +72 -0
  86. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
  87. package/dist/module/components/FormattedText.js +131 -0
  88. package/dist/module/components/FormattedText.js.map +1 -0
  89. package/dist/module/components/GenericInput.js +148 -0
  90. package/dist/module/components/GenericInput.js.map +1 -0
  91. package/dist/module/components/GenericInputSection.js +158 -0
  92. package/dist/module/components/GenericInputSection.js.map +1 -0
  93. package/dist/module/components/Header.js +458 -0
  94. package/dist/module/components/Header.js.map +1 -0
  95. package/dist/module/components/ImagePopup.js +240 -0
  96. package/dist/module/components/ImagePopup.js.map +1 -0
  97. package/dist/module/components/ImageUploadProgress.js +68 -0
  98. package/dist/module/components/ImageUploadProgress.js.map +1 -0
  99. package/dist/module/components/ImageUploader.js +795 -0
  100. package/dist/module/components/ImageUploader.js.map +1 -0
  101. package/dist/module/components/InlineButton.js +65 -0
  102. package/dist/module/components/InlineButton.js.map +1 -0
  103. package/dist/module/components/Input.js +154 -0
  104. package/dist/module/components/Input.js.map +1 -0
  105. package/dist/module/components/LoadingCircles.js +220 -0
  106. package/dist/module/components/LoadingCircles.js.map +1 -0
  107. package/dist/module/components/LoadingIndicator.js +86 -0
  108. package/dist/module/components/LoadingIndicator.js.map +1 -0
  109. package/dist/module/components/LoadingStateWidget.js +46 -0
  110. package/dist/module/components/LoadingStateWidget.js.map +1 -0
  111. package/dist/module/components/MediaPlayer.js +418 -0
  112. package/dist/module/components/MediaPlayer.js.map +1 -0
  113. package/dist/module/components/MiddlePopup.js +43 -0
  114. package/dist/module/components/MiddlePopup.js.map +1 -0
  115. package/dist/module/components/PDFPopup.js +191 -0
  116. package/dist/module/components/PDFPopup.js.map +1 -0
  117. package/dist/module/components/PlussChat.js +986 -0
  118. package/dist/module/components/PlussChat.js.map +1 -0
  119. package/dist/module/components/PlussChatMessage.js +262 -0
  120. package/dist/module/components/PlussChatMessage.js.map +1 -0
  121. package/dist/module/components/PlussChatTime.js +58 -0
  122. package/dist/module/components/PlussChatTime.js.map +1 -0
  123. package/dist/module/components/Popup.js +125 -0
  124. package/dist/module/components/Popup.js.map +1 -0
  125. package/dist/module/components/PopupMenu.js +119 -0
  126. package/dist/module/components/PopupMenu.js.map +1 -0
  127. package/dist/module/components/PositionedImage.js +313 -0
  128. package/dist/module/components/PositionedImage.js.map +1 -0
  129. package/dist/module/components/ProfilePic.js +106 -0
  130. package/dist/module/components/ProfilePic.js.map +1 -0
  131. package/dist/module/components/RadioButton.js +77 -0
  132. package/dist/module/components/RadioButton.js.map +1 -0
  133. package/dist/module/components/Reaction.js +116 -0
  134. package/dist/module/components/Reaction.js.map +1 -0
  135. package/dist/module/components/Reactions.js +71 -0
  136. package/dist/module/components/Reactions.js.map +1 -0
  137. package/dist/module/components/SharingTools.js +154 -0
  138. package/dist/module/components/SharingTools.js.map +1 -0
  139. package/dist/module/components/Spinner.js +22 -0
  140. package/dist/module/components/Spinner.js.map +1 -0
  141. package/dist/module/components/StickyFooter.js +34 -0
  142. package/dist/module/components/StickyFooter.js.map +1 -0
  143. package/dist/module/components/TextStyle.js +45 -0
  144. package/dist/module/components/TextStyle.js.map +1 -0
  145. package/dist/module/components/Toggle.js +65 -0
  146. package/dist/module/components/Toggle.js.map +1 -0
  147. package/dist/module/components/TouchableSearchBar.js +67 -0
  148. package/dist/module/components/TouchableSearchBar.js.map +1 -0
  149. package/dist/module/components/UserListPopup.js +135 -0
  150. package/dist/module/components/UserListPopup.js.map +1 -0
  151. package/dist/module/components/UserListing.js +267 -0
  152. package/dist/module/components/UserListing.js.map +1 -0
  153. package/dist/module/components/VideoPopup.js +113 -0
  154. package/dist/module/components/VideoPopup.js.map +1 -0
  155. package/dist/module/components/WarningPopup.js +82 -0
  156. package/dist/module/components/WarningPopup.js.map +1 -0
  157. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +289 -0
  158. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
  159. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +116 -0
  160. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
  161. package/dist/module/components/index.js +55 -0
  162. package/dist/module/components/index.js.map +1 -0
  163. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +385 -0
  164. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
  165. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +387 -0
  166. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
  167. package/dist/module/config.js +32 -0
  168. package/dist/module/config.js.map +1 -0
  169. package/dist/module/constants.js +19 -0
  170. package/dist/module/constants.js.map +1 -0
  171. package/dist/module/fonts/index.js +2 -0
  172. package/dist/module/fonts/index.js.map +1 -0
  173. package/dist/module/fonts/pluss60-icons.js +5 -0
  174. package/dist/module/fonts/pluss60-icons.js.map +1 -0
  175. package/dist/module/fonts/pluss60-icons.json +1097 -0
  176. package/dist/module/helper.js +397 -0
  177. package/dist/module/helper.js.map +1 -0
  178. package/dist/module/index.js +13 -0
  179. package/dist/module/index.js.map +1 -0
  180. package/dist/module/js/images/detectFaces.js +30 -0
  181. package/dist/module/js/images/detectFaces.js.map +1 -0
  182. package/dist/module/js/images/findLandmarkRange.js +93 -0
  183. package/dist/module/js/images/findLandmarkRange.js.map +1 -0
  184. package/dist/module/js/images/getScaledOffset.js +81 -0
  185. package/dist/module/js/images/getScaledOffset.js.map +1 -0
  186. package/dist/module/js/site/getSiteLevelFromState.js +29 -0
  187. package/dist/module/js/site/getSiteLevelFromState.js.map +1 -0
  188. package/dist/module/js/site/isTVEnabled.js +10 -0
  189. package/dist/module/js/site/isTVEnabled.js.map +1 -0
  190. package/dist/module/session.js +58 -0
  191. package/dist/module/session.js.map +1 -0
  192. package/dist/module/styles.js +67 -0
  193. package/dist/module/styles.js.map +1 -0
  194. package/package.json +20 -24
  195. package/src/js/images/detectFaces.js +8 -4
@@ -0,0 +1,36 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { TouchableOpacity, Text } from 'react-native';
3
+ import { TEXT_DARK } from '../colours';
4
+
5
+ /*
6
+ Props-
7
+ style - custom style for container
8
+ */
9
+
10
+ class FontScaleButton extends PureComponent {
11
+ render() {
12
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
13
+ style: [styles.container, this.props.style],
14
+ onPress: this.props.onPress
15
+ }, /*#__PURE__*/React.createElement(Text, {
16
+ style: styles.text
17
+ }, /*#__PURE__*/React.createElement(Text, null, "A"), /*#__PURE__*/React.createElement(Text, null, ` `), /*#__PURE__*/React.createElement(Text, {
18
+ style: styles.largeText
19
+ }, "A")));
20
+ }
21
+ }
22
+ const styles = {
23
+ container: {
24
+ padding: 15
25
+ },
26
+ text: {
27
+ fontFamily: 'sf-medium',
28
+ color: TEXT_DARK,
29
+ fontSize: 14
30
+ },
31
+ largeText: {
32
+ fontSize: 24
33
+ }
34
+ };
35
+ export { FontScaleButton };
36
+ //# sourceMappingURL=FontScaleButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","PureComponent","TouchableOpacity","Text","TEXT_DARK","FontScaleButton","render","createElement","style","styles","container","props","onPress","text","largeText","padding","fontFamily","color","fontSize"],"sources":["FontScaleButton.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { TouchableOpacity, Text } from 'react-native';\nimport { TEXT_DARK } from '../colours';\n\n/* \nProps- \n style - custom style for container\n*/\n\nclass FontScaleButton extends PureComponent {\n render() {\n return (\n <TouchableOpacity style={[styles.container, this.props.style]} onPress={this.props.onPress}>\n <Text style={styles.text}>\n <Text>A</Text>\n <Text>{` `}</Text>\n <Text style={styles.largeText}>A</Text>\n </Text>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = {\n container: {\n padding: 15,\n },\n text: {\n fontFamily: 'sf-medium',\n color: TEXT_DARK,\n fontSize: 14,\n },\n largeText: {\n fontSize: 24,\n },\n};\n\nexport { FontScaleButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,SAAS,QAAQ,YAAY;;AAEtC;AACA;AACA;AACA;;AAEA,MAAMC,eAAe,SAASJ,aAAa,CAAC;EAC1CK,MAAMA,CAAA,EAAG;IACP,oBACEN,KAAA,CAAAO,aAAA,CAACL,gBAAgB;MAACM,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE,IAAI,CAACC,KAAK,CAACH,KAAK,CAAE;MAACI,OAAO,EAAE,IAAI,CAACD,KAAK,CAACC;IAAQ,gBACzFZ,KAAA,CAAAO,aAAA,CAACJ,IAAI;MAACK,KAAK,EAAEC,MAAM,CAACI;IAAK,gBACvBb,KAAA,CAAAO,aAAA,CAACJ,IAAI,QAAC,GAAO,CAAC,eACdH,KAAA,CAAAO,aAAA,CAACJ,IAAI,QAAG,GAAS,CAAC,eAClBH,KAAA,CAAAO,aAAA,CAACJ,IAAI;MAACK,KAAK,EAAEC,MAAM,CAACK;IAAU,GAAC,GAAO,CAClC,CACU,CAAC;EAEvB;AACF;AAEA,MAAML,MAAM,GAAG;EACbC,SAAS,EAAE;IACTK,OAAO,EAAE;EACX,CAAC;EACDF,IAAI,EAAE;IACJG,UAAU,EAAE,WAAW;IACvBC,KAAK,EAAEb,SAAS;IAChBc,QAAQ,EAAE;EACZ,CAAC;EACDJ,SAAS,EAAE;IACTI,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,SAASb,eAAe"}
@@ -0,0 +1,75 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { TouchableOpacity, Text, View } from 'react-native';
3
+ import { TEXT_DARK, LINEGREY } from '../colours';
4
+
5
+ /*
6
+ Props-
7
+ style - custom style for container
8
+ buttonLeftStyle - custom style for left button
9
+ buttonRightStyle - custom style for right button
10
+ onPressSmall - callback function
11
+ onPressLarge - custom style for right button
12
+ */
13
+
14
+ class FontScalePopup extends PureComponent {
15
+ render() {
16
+ if (!this.props.visible) {
17
+ return null;
18
+ }
19
+ return /*#__PURE__*/React.createElement(View, {
20
+ style: [styles.container, this.props.style]
21
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
22
+ style: [styles.button, styles.buttonLeft, this.props.buttonLeftStyle],
23
+ onPress: this.props.onPressSmall
24
+ }, /*#__PURE__*/React.createElement(Text, {
25
+ style: styles.smallText
26
+ }, "A")), /*#__PURE__*/React.createElement(TouchableOpacity, {
27
+ style: [styles.button, styles.buttonRight, this.props.buttonRightStyle],
28
+ onPress: this.props.onPressLarge
29
+ }, /*#__PURE__*/React.createElement(Text, {
30
+ style: styles.largeText
31
+ }, "A")));
32
+ }
33
+ }
34
+ const styles = {
35
+ container: {
36
+ flexDirection: 'row',
37
+ borderRadius: 2,
38
+ shadowColor: '#000',
39
+ shadowOffset: {
40
+ width: 0,
41
+ height: 2
42
+ },
43
+ shadowOpacity: 0.2,
44
+ shadowRadius: 4,
45
+ elevation: 4,
46
+ zIndex: 10,
47
+ backgroundColor: '#fff',
48
+ padding: 2
49
+ },
50
+ button: {
51
+ height: 50,
52
+ width: 64,
53
+ borderColor: LINEGREY,
54
+ alignItems: 'center',
55
+ justifyContent: 'center'
56
+ },
57
+ buttonLeft: {
58
+ borderRightWidth: 1
59
+ },
60
+ buttonRight: {
61
+ borderLeftWidth: 1
62
+ },
63
+ smallText: {
64
+ fontFamily: 'sf-medium',
65
+ color: TEXT_DARK,
66
+ fontSize: 16
67
+ },
68
+ largeText: {
69
+ fontFamily: 'sf-medium',
70
+ color: TEXT_DARK,
71
+ fontSize: 24
72
+ }
73
+ };
74
+ export { FontScalePopup };
75
+ //# sourceMappingURL=FontScalePopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","PureComponent","TouchableOpacity","Text","View","TEXT_DARK","LINEGREY","FontScalePopup","render","props","visible","createElement","style","styles","container","button","buttonLeft","buttonLeftStyle","onPress","onPressSmall","smallText","buttonRight","buttonRightStyle","onPressLarge","largeText","flexDirection","borderRadius","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","zIndex","backgroundColor","padding","borderColor","alignItems","justifyContent","borderRightWidth","borderLeftWidth","fontFamily","color","fontSize"],"sources":["FontScalePopup.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { TouchableOpacity, Text, View } from 'react-native';\nimport { TEXT_DARK, LINEGREY } from '../colours';\n\n/* \nProps- \n style - custom style for container\n buttonLeftStyle - custom style for left button\n buttonRightStyle - custom style for right button\n onPressSmall - callback function \n onPressLarge - custom style for right button\n*/\n\nclass FontScalePopup extends PureComponent {\n render() {\n if (!this.props.visible) {\n return null;\n }\n return (\n <View style={[styles.container, this.props.style]}>\n <TouchableOpacity style={[styles.button, styles.buttonLeft, this.props.buttonLeftStyle]} onPress={this.props.onPressSmall}>\n <Text style={styles.smallText}>A</Text>\n </TouchableOpacity>\n <TouchableOpacity style={[styles.button, styles.buttonRight, this.props.buttonRightStyle]} onPress={this.props.onPressLarge}>\n <Text style={styles.largeText}>A</Text>\n </TouchableOpacity>\n </View>\n );\n }\n}\n\nconst styles = {\n container: {\n flexDirection: 'row',\n borderRadius: 2,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 2,\n },\n shadowOpacity: 0.2,\n shadowRadius: 4,\n elevation: 4,\n zIndex: 10,\n backgroundColor: '#fff',\n padding: 2,\n },\n button: {\n height: 50,\n width: 64,\n borderColor: LINEGREY,\n alignItems: 'center',\n justifyContent: 'center',\n },\n buttonLeft: {\n borderRightWidth: 1,\n },\n buttonRight: {\n borderLeftWidth: 1,\n },\n smallText: {\n fontFamily: 'sf-medium',\n color: TEXT_DARK,\n fontSize: 16,\n },\n largeText: {\n fontFamily: 'sf-medium',\n color: TEXT_DARK,\n fontSize: 24,\n },\n};\n\nexport { FontScalePopup };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC3D,SAASC,SAAS,EAAEC,QAAQ,QAAQ,YAAY;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,cAAc,SAASN,aAAa,CAAC;EACzCO,MAAMA,CAAA,EAAG;IACP,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,OAAO,EAAE;MACvB,OAAO,IAAI;IACb;IACA,oBACEV,KAAA,CAAAW,aAAA,CAACP,IAAI;MAACQ,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE,IAAI,CAACL,KAAK,CAACG,KAAK;IAAE,gBAChDZ,KAAA,CAAAW,aAAA,CAACT,gBAAgB;MAACU,KAAK,EAAE,CAACC,MAAM,CAACE,MAAM,EAAEF,MAAM,CAACG,UAAU,EAAE,IAAI,CAACP,KAAK,CAACQ,eAAe,CAAE;MAACC,OAAO,EAAE,IAAI,CAACT,KAAK,CAACU;IAAa,gBACxHnB,KAAA,CAAAW,aAAA,CAACR,IAAI;MAACS,KAAK,EAAEC,MAAM,CAACO;IAAU,GAAC,GAAO,CACtB,CAAC,eACnBpB,KAAA,CAAAW,aAAA,CAACT,gBAAgB;MAACU,KAAK,EAAE,CAACC,MAAM,CAACE,MAAM,EAAEF,MAAM,CAACQ,WAAW,EAAE,IAAI,CAACZ,KAAK,CAACa,gBAAgB,CAAE;MAACJ,OAAO,EAAE,IAAI,CAACT,KAAK,CAACc;IAAa,gBAC1HvB,KAAA,CAAAW,aAAA,CAACR,IAAI;MAACS,KAAK,EAAEC,MAAM,CAACW;IAAU,GAAC,GAAO,CACtB,CACd,CAAC;EAEX;AACF;AAEA,MAAMX,MAAM,GAAG;EACbC,SAAS,EAAE;IACTW,aAAa,EAAE,KAAK;IACpBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACZC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE;IACV,CAAC;IACDC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,MAAM,EAAE,EAAE;IACVC,eAAe,EAAE,MAAM;IACvBC,OAAO,EAAE;EACX,CAAC;EACDrB,MAAM,EAAE;IACNe,MAAM,EAAE,EAAE;IACVD,KAAK,EAAE,EAAE;IACTQ,WAAW,EAAE/B,QAAQ;IACrBgC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDvB,UAAU,EAAE;IACVwB,gBAAgB,EAAE;EACpB,CAAC;EACDnB,WAAW,EAAE;IACXoB,eAAe,EAAE;EACnB,CAAC;EACDrB,SAAS,EAAE;IACTsB,UAAU,EAAE,WAAW;IACvBC,KAAK,EAAEtC,SAAS;IAChBuC,QAAQ,EAAE;EACZ,CAAC;EACDpB,SAAS,EAAE;IACTkB,UAAU,EAAE,WAAW;IACvBC,KAAK,EAAEtC,SAAS;IAChBuC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,SAASrC,cAAc"}
@@ -0,0 +1,25 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { View } from 'react-native';
3
+ class FormCard extends PureComponent {
4
+ render() {
5
+ return /*#__PURE__*/React.createElement(View, {
6
+ style: [styles.section, this.props.style]
7
+ }, this.props.children);
8
+ }
9
+ }
10
+ const styles = {
11
+ section: {
12
+ backgroundColor: '#fff',
13
+ paddingHorizontal: 16,
14
+ shadowColor: '#000',
15
+ shadowOffset: {
16
+ width: 0,
17
+ height: 1
18
+ },
19
+ shadowOpacity: 0.1,
20
+ shadowRadius: 6,
21
+ elevation: 2
22
+ }
23
+ };
24
+ export { FormCard };
25
+ //# sourceMappingURL=FormCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","PureComponent","View","FormCard","render","createElement","style","styles","section","props","children","backgroundColor","paddingHorizontal","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation"],"sources":["FormCard.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View } from 'react-native';\n\nclass FormCard extends PureComponent {\n render() {\n return <View style={[styles.section, this.props.style]}>{this.props.children}</View>;\n }\n}\n\nconst styles = {\n section: {\n backgroundColor: '#fff',\n paddingHorizontal: 16,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 1,\n },\n shadowOpacity: 0.1,\n shadowRadius: 6,\n elevation: 2,\n },\n};\n\nexport { FormCard };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,cAAc;AAEnC,MAAMC,QAAQ,SAASF,aAAa,CAAC;EACnCG,MAAMA,CAAA,EAAG;IACP,oBAAOJ,KAAA,CAAAK,aAAA,CAACH,IAAI;MAACI,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAE,IAAI,CAACC,KAAK,CAACH,KAAK;IAAE,GAAE,IAAI,CAACG,KAAK,CAACC,QAAe,CAAC;EACtF;AACF;AAEA,MAAMH,MAAM,GAAG;EACbC,OAAO,EAAE;IACPG,eAAe,EAAE,MAAM;IACvBC,iBAAiB,EAAE,EAAE;IACrBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACZC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE;IACV,CAAC;IACDC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb;AACF,CAAC;AAED,SAAShB,QAAQ"}
@@ -0,0 +1,212 @@
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 { Pl60Icon } from '../fonts';
6
+ import { TEXT_LIGHTER, TEXT_DARK, COLOUR_GREEN, LINEGREY, TEXT_LIGHT, COLOUR_GRAPEFRUIT, getMainBrandingColourFromState, getDarkBrandingColourFromState } from '../colours';
7
+ import { getValueOrDefault } from '../helper';
8
+ class FormCardSection extends Component {
9
+ constructor(props) {
10
+ super(props);
11
+ this.state = {
12
+ height: getValueOrDefault(this.props.minHeight, 20),
13
+ focused: false,
14
+ isSecure: true
15
+ };
16
+ }
17
+ onFocus() {
18
+ this.setState({
19
+ focused: true
20
+ });
21
+ if (this.props.onFocus) {
22
+ this.props.onFocus();
23
+ }
24
+ }
25
+ onBlur() {
26
+ this.setState({
27
+ focused: false
28
+ });
29
+ if (this.props.onBlur) {
30
+ this.props.onBlur();
31
+ }
32
+ }
33
+ onGrow(event) {
34
+ this.setState({
35
+ height: Math.max(event.nativeEvent.contentSize.height, this.props.minHeight)
36
+ });
37
+ }
38
+ toggleSecure() {
39
+ const current = this.state.isSecure;
40
+ this.setState({
41
+ isSecure: !current
42
+ });
43
+ }
44
+ showSecure() {
45
+ if (!_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle) {
46
+ return this.state.isSecure;
47
+ }
48
+ return this.props.secureTextEntry;
49
+ }
50
+ isValid() {
51
+ if (this.props.required && _.isEmpty(this.props.textValue)) {
52
+ return false;
53
+ }
54
+ if (this.props.isValid && !this.props.isValid()) {
55
+ return false;
56
+ }
57
+ return true;
58
+ }
59
+ renderErrorDot() {
60
+ if (this.props.required || this.props.hasError) {
61
+ return /*#__PURE__*/React.createElement(View, {
62
+ style: [styles.errorDot, {
63
+ backgroundColor: this.props.colourBrandingMain
64
+ }, !this.isValid() && styles.errorError, this.isValid() && styles.errorValid, this.props.errorDotStyle]
65
+ });
66
+ }
67
+ return null;
68
+ }
69
+ renderLabel() {
70
+ if (_.isEmpty(this.props.label)) {
71
+ return null;
72
+ }
73
+ return /*#__PURE__*/React.createElement(View, {
74
+ style: styles.labelContainer
75
+ }, /*#__PURE__*/React.createElement(Text, {
76
+ style: [styles.labelText, this.state.focused && {
77
+ color: this.props.colourBrandingMain
78
+ }, !this.isValid() && !_.isEmpty(this.props.textValue) && styles.labelError, this.props.labelStyle]
79
+ }, this.props.label), this.renderErrorDot());
80
+ }
81
+ renderInput() {
82
+ return /*#__PURE__*/React.createElement(View, {
83
+ style: {
84
+ flexDirection: 'row'
85
+ }
86
+ }, /*#__PURE__*/React.createElement(View, {
87
+ style: {
88
+ flex: 1
89
+ }
90
+ }, /*#__PURE__*/React.createElement(TextInput, {
91
+ value: this.props.textValue,
92
+ onChangeText: this.props.onChangeText,
93
+ keyboardType: this.props.keyboardType
94
+ /* Main Styling Props */,
95
+ selectionColor: this.props.colourBrandingDark,
96
+ placeholder: this.props.placeholder,
97
+ placeholderTextColor: this.props.placeholderTextColor || TEXT_LIGHTER,
98
+ style: [styles.inputStyle, {
99
+ textAlignVertical: this.props.autoGrow ? 'top' : 'center',
100
+ color: this.props.textColour || TEXT_DARK,
101
+ minHeight: this.props.minHeight || 20
102
+ }, this.props.textStyle],
103
+ underlineColorAndroid: 'rgba(0,0,0,0)'
104
+ /* Other Props */,
105
+ autoFocus: _.isUndefined(this.props.autoFocus) ? false : this.props.autoFocus,
106
+ editable: _.isUndefined(this.props.editable) ? true : this.props.editable,
107
+ secureTextEntry: _.isUndefined(this.props.secureTextEntry) ? false : this.showSecure(),
108
+ autoCorrect: _.isUndefined(this.props.autoCorrect) ? false : this.props.autoCorrect,
109
+ multiline: _.isUndefined(this.props.multiline) ? false : this.props.multiline,
110
+ autoGrow: _.isUndefined(this.props.autoGrow) ? false : this.props.autoGrow,
111
+ autoCapitalize: _.isUndefined(this.props.autoCapitalize) ? 'sentences' : this.props.autoCapitalize,
112
+ onContentSizeChange: this.onGrow.bind(this)
113
+ /* Focus Props */,
114
+ onFocus: this.onFocus.bind(this),
115
+ onBlur: this.onBlur.bind(this)
116
+ })), !_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle && /*#__PURE__*/React.createElement(TouchableOpacity, {
117
+ onPress: this.toggleSecure.bind(this)
118
+ }, /*#__PURE__*/React.createElement(Pl60Icon, {
119
+ name: this.state.isSecure ? 'show' : 'hide',
120
+ style: {
121
+ fontSize: 21,
122
+ lineHeight: 20,
123
+ color: TEXT_LIGHT,
124
+ paddingLeft: 16
125
+ }
126
+ })));
127
+ }
128
+ renderContent() {
129
+ if (this.props.hasContent) {
130
+ return this.props.children;
131
+ }
132
+ if (this.props.pointerEvents) {
133
+ return /*#__PURE__*/React.createElement(View, {
134
+ pointerEvents: this.props.pointerEvents
135
+ }, this.renderInput());
136
+ }
137
+ return this.renderInput();
138
+ }
139
+ render() {
140
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
141
+ style: [styles.sectionItem, this.props.hasUnderline && styles.sectionItemUnderline, this.state.focused && styles.inputFocus, this.state.focused && {
142
+ borderBottomColor: this.props.colourBrandingMain
143
+ }, !this.isValid() && !_.isEmpty(this.props.textValue) && styles.inputError, !_.isUndefined(this.props.showError) && this.props.showError === true && !this.isValid() && styles.inputError, this.props.sectionStyle]
144
+ }, this.renderLabel(), /*#__PURE__*/React.createElement(View, null, this.renderContent())), !_.isUndefined(this.props.showError) && this.props.showError === true && !this.isValid() && /*#__PURE__*/React.createElement(Text, {
145
+ style: styles.errorText
146
+ }, this.props.errorText));
147
+ }
148
+ }
149
+ const styles = StyleSheet.create({
150
+ sectionItem: {
151
+ paddingVertical: 16,
152
+ paddingHorizontal: 8,
153
+ borderBottomColor: LINEGREY
154
+ },
155
+ sectionItemUnderline: {
156
+ borderBottomWidth: 1
157
+ },
158
+ inputFocus: {
159
+ borderBottomWidth: 1
160
+ },
161
+ inputError: {
162
+ borderBottomWidth: 1,
163
+ borderBottomColor: COLOUR_GRAPEFRUIT
164
+ },
165
+ labelContainer: {
166
+ flexDirection: 'row',
167
+ alignItems: 'center',
168
+ marginBottom: 6
169
+ },
170
+ labelText: {
171
+ fontFamily: 'sf-regular',
172
+ fontSize: 13,
173
+ color: TEXT_LIGHT
174
+ },
175
+ labelError: {
176
+ color: COLOUR_GRAPEFRUIT
177
+ },
178
+ errorDot: {
179
+ height: 6,
180
+ width: 6,
181
+ borderRadius: 3,
182
+ marginLeft: 8,
183
+ marginBottom: 3
184
+ },
185
+ errorError: {
186
+ backgroundColor: COLOUR_GRAPEFRUIT
187
+ },
188
+ errorValid: {
189
+ backgroundColor: COLOUR_GREEN
190
+ },
191
+ inputStyle: {
192
+ fontFamily: 'sf-regular',
193
+ fontSize: 17,
194
+ margin: 0,
195
+ padding: 0
196
+ },
197
+ errorText: {
198
+ paddingTop: 8,
199
+ fontSize: 13,
200
+ fontFamily: 'sf-regular',
201
+ color: COLOUR_GRAPEFRUIT
202
+ }
203
+ });
204
+ const mapStateToProps = state => {
205
+ return {
206
+ colourBrandingMain: getMainBrandingColourFromState(state),
207
+ colourBrandingDark: getDarkBrandingColourFromState(state)
208
+ };
209
+ };
210
+ const formCardSection = connect(mapStateToProps, {})(FormCardSection);
211
+ export { formCardSection as FormCardSection };
212
+ //# sourceMappingURL=FormCardSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Component","_","View","Text","TextInput","TouchableOpacity","StyleSheet","connect","Pl60Icon","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","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 { Pl60Icon } from '../fonts';\nimport {\n TEXT_LIGHTER,\n TEXT_DARK,\n COLOUR_GREEN,\n LINEGREY,\n TEXT_LIGHT,\n COLOUR_GRAPEFRUIT,\n getMainBrandingColourFromState,\n getDarkBrandingColourFromState,\n} from '../colours';\nimport { getValueOrDefault } from '../helper';\n\nclass FormCardSection extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n height: getValueOrDefault(this.props.minHeight, 20),\n focused: false,\n isSecure: true,\n };\n }\n\n onFocus() {\n this.setState({ focused: true });\n if (this.props.onFocus) {\n this.props.onFocus();\n }\n }\n\n onBlur() {\n this.setState({ focused: false });\n if (this.props.onBlur) {\n this.props.onBlur();\n }\n }\n\n onGrow(event) {\n this.setState({\n height: Math.max(event.nativeEvent.contentSize.height, this.props.minHeight),\n });\n }\n\n toggleSecure() {\n const current = this.state.isSecure;\n this.setState({ isSecure: !current });\n }\n\n showSecure() {\n if (!_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle) {\n return this.state.isSecure;\n }\n return this.props.secureTextEntry;\n }\n\n isValid() {\n if (this.props.required && _.isEmpty(this.props.textValue)) {\n return false;\n }\n if (this.props.isValid && !this.props.isValid()) {\n return false;\n }\n return true;\n }\n\n renderErrorDot() {\n if (this.props.required || this.props.hasError) {\n return (\n <View\n style={[\n styles.errorDot,\n { backgroundColor: this.props.colourBrandingMain },\n !this.isValid() && styles.errorError,\n this.isValid() && styles.errorValid,\n this.props.errorDotStyle,\n ]}\n />\n );\n }\n return null;\n }\n\n renderLabel() {\n if (_.isEmpty(this.props.label)) {\n return null;\n }\n return (\n <View style={styles.labelContainer}>\n <Text\n style={[\n styles.labelText,\n this.state.focused && { color: this.props.colourBrandingMain },\n !this.isValid() && !_.isEmpty(this.props.textValue) && styles.labelError,\n this.props.labelStyle,\n ]}\n >\n {this.props.label}\n </Text>\n {this.renderErrorDot()}\n </View>\n );\n }\n\n renderInput() {\n return (\n <View style={{ flexDirection: 'row' }}>\n <View style={{ flex: 1 }}>\n <TextInput\n value={this.props.textValue}\n onChangeText={this.props.onChangeText}\n keyboardType={this.props.keyboardType}\n /* Main Styling Props */\n selectionColor={this.props.colourBrandingDark}\n placeholder={this.props.placeholder}\n placeholderTextColor={this.props.placeholderTextColor || TEXT_LIGHTER}\n style={[\n styles.inputStyle,\n {\n textAlignVertical: this.props.autoGrow ? 'top' : 'center',\n color: this.props.textColour || TEXT_DARK,\n minHeight: this.props.minHeight || 20,\n },\n this.props.textStyle,\n ]}\n underlineColorAndroid={'rgba(0,0,0,0)'}\n /* Other Props */\n autoFocus={_.isUndefined(this.props.autoFocus) ? false : this.props.autoFocus}\n editable={_.isUndefined(this.props.editable) ? true : this.props.editable}\n secureTextEntry={_.isUndefined(this.props.secureTextEntry) ? false : this.showSecure()}\n autoCorrect={_.isUndefined(this.props.autoCorrect) ? false : this.props.autoCorrect}\n multiline={_.isUndefined(this.props.multiline) ? false : this.props.multiline}\n autoGrow={_.isUndefined(this.props.autoGrow) ? false : this.props.autoGrow}\n autoCapitalize={_.isUndefined(this.props.autoCapitalize) ? 'sentences' : this.props.autoCapitalize}\n onContentSizeChange={this.onGrow.bind(this)}\n /* Focus Props */\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n </View>\n {!_.isUndefined(this.props.secureTextToggle) && this.props.secureTextToggle && (\n <TouchableOpacity onPress={this.toggleSecure.bind(this)}>\n {/* <Icon\n name={this.state.isSecure ? 'eye' : 'eye-slash'}\n type='font-awesome'\n iconStyle={{ fontSize: 16, color: TEXT_MID, paddingLeft: 16 }}\n /> */}\n <Pl60Icon\n name={this.state.isSecure ? 'show' : 'hide'}\n style={{ fontSize: 21, lineHeight: 20, color: TEXT_LIGHT, paddingLeft: 16 }}\n />\n </TouchableOpacity>\n )}\n </View>\n );\n }\n\n renderContent() {\n if (this.props.hasContent) {\n return this.props.children;\n }\n if (this.props.pointerEvents) {\n return <View pointerEvents={this.props.pointerEvents}>{this.renderInput()}</View>;\n }\n return this.renderInput();\n }\n\n render() {\n return (\n <View>\n <View\n style={[\n styles.sectionItem,\n this.props.hasUnderline && styles.sectionItemUnderline,\n this.state.focused && styles.inputFocus,\n this.state.focused && { borderBottomColor: this.props.colourBrandingMain },\n !this.isValid() && !_.isEmpty(this.props.textValue) && styles.inputError,\n !_.isUndefined(this.props.showError) && this.props.showError === true && !this.isValid() && styles.inputError,\n this.props.sectionStyle,\n ]}\n >\n {this.renderLabel()}\n <View>{this.renderContent()}</View>\n </View>\n {!_.isUndefined(this.props.showError) && this.props.showError === true && !this.isValid() && (\n <Text style={styles.errorText}>{this.props.errorText}</Text>\n )}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n sectionItem: {\n paddingVertical: 16,\n paddingHorizontal: 8,\n borderBottomColor: LINEGREY,\n },\n sectionItemUnderline: {\n borderBottomWidth: 1,\n },\n inputFocus: {\n borderBottomWidth: 1,\n },\n inputError: {\n borderBottomWidth: 1,\n borderBottomColor: COLOUR_GRAPEFRUIT,\n },\n labelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n marginBottom: 6,\n },\n labelText: {\n fontFamily: 'sf-regular',\n fontSize: 13,\n color: TEXT_LIGHT,\n },\n labelError: {\n color: COLOUR_GRAPEFRUIT,\n },\n errorDot: {\n height: 6,\n width: 6,\n borderRadius: 3,\n marginLeft: 8,\n marginBottom: 3,\n },\n errorError: {\n backgroundColor: COLOUR_GRAPEFRUIT,\n },\n errorValid: {\n backgroundColor: COLOUR_GREEN,\n },\n inputStyle: {\n fontFamily: 'sf-regular',\n fontSize: 17,\n margin: 0,\n padding: 0,\n },\n errorText: {\n paddingTop: 8,\n fontSize: 13,\n fontFamily: 'sf-regular',\n color: COLOUR_GRAPEFRUIT,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n colourBrandingDark: getDarkBrandingColourFromState(state),\n };\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;AAClF,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,QAAQ,QAAQ,UAAU;AACnC,SACEC,YAAY,EACZC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,UAAU,EACVC,iBAAiB,EACjBC,8BAA8B,EAC9BC,8BAA8B,QACzB,YAAY;AACnB,SAASC,iBAAiB,QAAQ,WAAW;AAE7C,MAAMC,eAAe,SAASlB,SAAS,CAAC;EACtCmB,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,KAAK,GAAG;MACXC,MAAM,EAAEL,iBAAiB,CAAC,IAAI,CAACG,KAAK,CAACG,SAAS,EAAE,EAAE,CAAC;MACnDC,OAAO,EAAE,KAAK;MACdC,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YAAY;IACxBvB,QAAQ,EAAE,EAAE;IACZ5B,KAAK,EAAE/C;EACT,CAAC;EACDgD,UAAU,EAAE;IACVD,KAAK,EAAE9C;EACT,CAAC;EACDoC,QAAQ,EAAE;IACR5B,MAAM,EAAE,CAAC;IACT0F,KAAK,EAAE,CAAC;IACRC,YAAY,EAAE,CAAC;IACfC,UAAU,EAAE,CAAC;IACbJ,YAAY,EAAE;EAChB,CAAC;EACDzD,UAAU,EAAE;IACVF,eAAe,EAAErC;EACnB,CAAC;EACDwC,UAAU,EAAE;IACVH,eAAe,EAAExC;EACnB,CAAC;EACD8D,UAAU,EAAE;IACVsC,UAAU,EAAE,YAAY;IACxBvB,QAAQ,EAAE,EAAE;IACZ2B,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC;EACDZ,SAAS,EAAE;IACTa,UAAU,EAAE,CAAC;IACb7B,QAAQ,EAAE,EAAE;IACZuB,UAAU,EAAE,YAAY;IACxBnD,KAAK,EAAE9C;EACT;AACF,CAAC,CAAC;AAEF,MAAMwG,eAAe,GAAGjG,KAAK,IAAI;EAC/B,OAAO;IACL+B,kBAAkB,EAAErC,8BAA8B,CAACM,KAAK,CAAC;IACzDiD,kBAAkB,EAAEtD,8BAA8B,CAACK,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMkG,eAAe,GAAGhH,OAAO,CAAC+G,eAAe,EAAE,CAAC,CAAC,CAAC,CAACpG,eAAe,CAAC;AACrE,SAASqG,eAAe,IAAIrG,eAAe"}
@@ -0,0 +1,72 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { View, Text, TouchableOpacity } from 'react-native';
3
+ import { Icon } from 'react-native-elements';
4
+ import { connect } from 'react-redux';
5
+ import { TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState } from '../colours';
6
+ import { FormCardSection } from './FormCardSection';
7
+ class FormCardSectionOptionLauncher extends PureComponent {
8
+ render() {
9
+ const {
10
+ onPress,
11
+ sectionStyle,
12
+ textStyle,
13
+ title,
14
+ description,
15
+ value,
16
+ icon,
17
+ colourBrandingMain
18
+ } = this.props;
19
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
20
+ onPress: onPress
21
+ }, /*#__PURE__*/React.createElement(FormCardSection, {
22
+ hasContent: true,
23
+ sectionStyle: sectionStyle
24
+ }, /*#__PURE__*/React.createElement(View, {
25
+ style: styles.container
26
+ }, /*#__PURE__*/React.createElement(Text, {
27
+ style: [styles.text, {
28
+ marginRight: 16,
29
+ flex: 1
30
+ }, textStyle]
31
+ }, title), /*#__PURE__*/React.createElement(Text, {
32
+ style: [styles.text, {
33
+ marginRight: 16
34
+ }]
35
+ }, value), /*#__PURE__*/React.createElement(Icon, {
36
+ name: icon ? icon : 'angle-right',
37
+ type: "font-awesome",
38
+ iconStyle: [styles.text, {
39
+ fontSize: 20,
40
+ color: colourBrandingMain
41
+ }]
42
+ })), description ? /*#__PURE__*/React.createElement(Text, {
43
+ style: styles.description
44
+ }, description) : null));
45
+ }
46
+ }
47
+ const styles = {
48
+ container: {
49
+ flexDirection: 'row',
50
+ alignSelf: 'stretch',
51
+ alignItems: 'center'
52
+ },
53
+ text: {
54
+ fontFamily: 'sf-regular',
55
+ fontSize: 17,
56
+ color: TEXT_DARK
57
+ },
58
+ description: {
59
+ fontFamily: 'sf-regular',
60
+ fontSize: 15,
61
+ color: TEXT_LIGHT,
62
+ marginTop: 8
63
+ }
64
+ };
65
+ const mapStateToProps = state => {
66
+ return {
67
+ colourBrandingMain: getMainBrandingColourFromState(state)
68
+ };
69
+ };
70
+ const formCardSectionOptionLauncher = connect(mapStateToProps, {})(FormCardSectionOptionLauncher);
71
+ export { formCardSectionOptionLauncher as FormCardSectionOptionLauncher };
72
+ //# sourceMappingURL=FormCardSectionOptionLauncher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","PureComponent","View","Text","TouchableOpacity","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, Text, TouchableOpacity } from 'react-native';\nimport { Icon } from 'react-native-elements';\nimport { connect } from 'react-redux';\nimport { TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState } from '../colours';\nimport { FormCardSection } from './FormCardSection';\n\nclass FormCardSectionOptionLauncher extends PureComponent {\n render() {\n const { onPress, sectionStyle, textStyle, title, description, value, icon, colourBrandingMain } = this.props;\n\n return (\n <TouchableOpacity onPress={onPress}>\n <FormCardSection hasContent sectionStyle={sectionStyle}>\n <View style={styles.container}>\n <Text style={[styles.text, { marginRight: 16, flex: 1 }, textStyle]}>{title}</Text>\n <Text style={[styles.text, { marginRight: 16 }]}>{value}</Text>\n <Icon\n name={icon ? icon : 'angle-right'}\n type=\"font-awesome\"\n iconStyle={[styles.text, { fontSize: 20, color: colourBrandingMain }]}\n />\n </View>\n {description ? <Text style={styles.description}>{description}</Text> : null}\n </FormCardSection>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = {\n container: {\n flexDirection: 'row',\n alignSelf: 'stretch',\n alignItems: 'center',\n },\n text: {\n fontFamily: 'sf-regular',\n fontSize: 17,\n color: TEXT_DARK,\n },\n description: {\n fontFamily: 'sf-regular',\n fontSize: 15,\n color: TEXT_LIGHT,\n marginTop: 8,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst formCardSectionOptionLauncher = connect(mapStateToProps, {})(FormCardSectionOptionLauncher);\nexport { formCardSectionOptionLauncher as FormCardSectionOptionLauncher };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SA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IAAE,CACvE,CACG,CAAC,EACNH,WAAW,gBAAGjB,KAAA,CAAAsB,aAAA,CAACnB,IAAI;MAACqB,KAAK,EAAEC,MAAM,CAACR;IAAY,GAAEA,WAAkB,CAAC,GAAG,IACxD,CACD,CAAC;EAEvB;AACF;AAEA,MAAMQ,MAAM,GAAG;EACbC,SAAS,EAAE;IACTS,aAAa,EAAE,KAAK;IACpBC,SAAS,EAAE,SAAS;IACpBC,UAAU,EAAE;EACd,CAAC;EACDV,IAAI,EAAE;IACJW,UAAU,EAAE,YAAY;IACxBL,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAE3B;EACT,CAAC;EACDU,WAAW,EAAE;IACXqB,UAAU,EAAE,YAAY;IACxBL,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAE1B,UAAU;IACjB+B,SAAS,EAAE;EACb;AACF,CAAC;AAED,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLrB,kBAAkB,EAAEX,8BAA8B,CAACgC,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMC,6BAA6B,GAAGpC,OAAO,CAACkC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC7B,6BAA6B,CAAC;AACjG,SAAS+B,6BAA6B,IAAI/B,6BAA6B"}
@@ -0,0 +1,131 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ import React, { Component } from 'react';
5
+ import { Linking } from 'react-native';
6
+ import { connect } from 'react-redux';
7
+ import ParsedText from 'react-native-parsed-text';
8
+ import { getMainBrandingColourFromState, TEXT_DARKEST } from '../colours';
9
+ import { getValidUrl } from '../helper';
10
+ import { analyticsActions } from '../apis';
11
+ class FormattedText extends Component {
12
+ constructor(...args) {
13
+ super(...args);
14
+ _defineProperty(this, "onPressUrl", url => {
15
+ const urlToUse = getValidUrl(url);
16
+ Linking.openURL(urlToUse);
17
+ this.checkLog('UrlClick', urlToUse);
18
+ });
19
+ _defineProperty(this, "onPressUrlText", urlText => {
20
+ const texts = urlText.match(FormattedText.UrlTextRegex);
21
+ this.onPressUrl(texts[1]);
22
+ });
23
+ _defineProperty(this, "onPressEmail", email => {
24
+ Linking.openURL(`mailto:${email}`);
25
+ this.checkLog('EmailClick', email);
26
+ });
27
+ _defineProperty(this, "onPressPhone", phone => {
28
+ const parsedPhone = phone.replace(/\D/g, '');
29
+ Linking.openURL(`tel:${parsedPhone.replace(/\D/g, '')}`);
30
+ this.checkLog('PhoneClick', parsedPhone);
31
+ });
32
+ _defineProperty(this, "ifEnabled", value => this.props.disabled ? undefined : value);
33
+ }
34
+ static get UrlTextRegex() {
35
+ return /\[([^\]\|\]]+)\|([^\]\|\]]+)\]/i;
36
+ }
37
+ checkLog(type, target) {
38
+ if (this.props.logClicks) {
39
+ analyticsActions.log(this.props.site, type, this.props.entityType, this.props.entityId, {
40
+ target
41
+ });
42
+ }
43
+ }
44
+ renderTextContent(matchingString, matches) {
45
+ return matches[1];
46
+ }
47
+ renderUrlText(matchingString, matches) {
48
+ return matches[2];
49
+ }
50
+ render() {
51
+ const {
52
+ style,
53
+ numberOfLines,
54
+ titleSize,
55
+ colourBrandingMain,
56
+ subtitleSize,
57
+ children
58
+ } = this.props;
59
+ return /*#__PURE__*/React.createElement(ParsedText, {
60
+ style: [styles.text, this.ifEnabled({
61
+ lineHeight: 24
62
+ }), style],
63
+ numberOfLines: numberOfLines,
64
+ parse: [{
65
+ pattern: /\*\*(.*?)\*\*/i,
66
+ style: this.ifEnabled({
67
+ fontFamily: 'sf-bold',
68
+ lineHeight: 24
69
+ }),
70
+ renderText: this.renderTextContent
71
+ }, {
72
+ pattern: /\*t\*(.*?)\*t\*/i,
73
+ style: this.ifEnabled({
74
+ fontSize: titleSize || 22,
75
+ color: colourBrandingMain,
76
+ fontFamily: 'sf-semibold',
77
+ lineHeight: 24
78
+ }),
79
+ renderText: this.renderTextContent
80
+ }, {
81
+ pattern: /\*s\*(.*?)\*s\*/i,
82
+ style: this.ifEnabled({
83
+ fontSize: subtitleSize || 18,
84
+ color: TEXT_DARKEST,
85
+ fontFamily: 'sf-semibold',
86
+ lineHeight: 24
87
+ }),
88
+ renderText: this.renderTextContent
89
+ }, {
90
+ pattern: FormattedText.UrlTextRegex,
91
+ style: this.ifEnabled({
92
+ color: colourBrandingMain
93
+ }),
94
+ onPress: this.ifEnabled(this.onPressUrlText),
95
+ renderText: this.renderUrlText
96
+ }, {
97
+ pattern: /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/im,
98
+ style: this.ifEnabled({
99
+ color: colourBrandingMain
100
+ }),
101
+ onPress: this.ifEnabled(this.onPressUrl)
102
+ }, {
103
+ pattern: /([A-Z0-9._%-]+)@([A-Z0-9.-]+\.[A-Z]{2,4})/im,
104
+ style: this.ifEnabled({
105
+ color: colourBrandingMain
106
+ }),
107
+ onPress: this.ifEnabled(this.onPressEmail)
108
+ }, {
109
+ pattern: /(?:\+?(\d{1,3}))?([-. (]*(\d{1,3})[-. )]*)?((\d{2,4})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/im,
110
+ style: this.ifEnabled({
111
+ color: colourBrandingMain
112
+ }),
113
+ onPress: this.ifEnabled(this.onPressPhone)
114
+ }]
115
+ }, children);
116
+ }
117
+ }
118
+ const styles = {
119
+ text: {
120
+ color: TEXT_DARKEST,
121
+ fontSize: 14,
122
+ fontFamily: 'sf-regular'
123
+ }
124
+ };
125
+ const mapStateToProps = state => {
126
+ return {
127
+ colourBrandingMain: getMainBrandingColourFromState(state)
128
+ };
129
+ };
130
+ export default connect(mapStateToProps, {})(FormattedText);
131
+ //# sourceMappingURL=FormattedText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Component","Linking","connect","ParsedText","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","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 ParsedText from 'react-native-parsed-text';\nimport { getMainBrandingColourFromState, TEXT_DARKEST } from '../colours';\nimport { getValidUrl } from '../helper';\nimport { analyticsActions } from '../apis';\n\nclass FormattedText extends Component {\n static get UrlTextRegex() {\n return /\\[([^\\]\\|\\]]+)\\|([^\\]\\|\\]]+)\\]/i;\n }\n\n checkLog(type, target) {\n if (this.props.logClicks) {\n analyticsActions.log(this.props.site, type, this.props.entityType, this.props.entityId, { target });\n }\n }\n\n onPressUrl = url => {\n const urlToUse = getValidUrl(url);\n Linking.openURL(urlToUse);\n this.checkLog('UrlClick', urlToUse);\n };\n\n onPressUrlText = urlText => {\n const texts = urlText.match(FormattedText.UrlTextRegex);\n this.onPressUrl(texts[1]);\n };\n\n onPressEmail = email => {\n Linking.openURL(`mailto:${email}`);\n this.checkLog('EmailClick', email);\n };\n\n onPressPhone = phone => {\n const parsedPhone = phone.replace(/\\D/g, '');\n Linking.openURL(`tel:${parsedPhone.replace(/\\D/g, '')}`);\n this.checkLog('PhoneClick', parsedPhone);\n };\n\n ifEnabled = value => (this.props.disabled ? undefined : value);\n\n renderTextContent(matchingString, matches) {\n return matches[1];\n }\n\n renderUrlText(matchingString, matches) {\n return matches[2];\n }\n\n render() {\n const { style, numberOfLines, titleSize, colourBrandingMain, subtitleSize, children } = this.props;\n\n return (\n <ParsedText\n style={[styles.text, this.ifEnabled({ lineHeight: 24 }), style]}\n numberOfLines={numberOfLines}\n parse={[\n {\n pattern: /\\*\\*(.*?)\\*\\*/i,\n style: this.ifEnabled({\n fontFamily: 'sf-bold',\n lineHeight: 24,\n }),\n renderText: this.renderTextContent,\n },\n {\n pattern: /\\*t\\*(.*?)\\*t\\*/i,\n style: this.ifEnabled({\n fontSize: titleSize || 22,\n color: colourBrandingMain,\n fontFamily: 'sf-semibold',\n lineHeight: 24,\n }),\n renderText: this.renderTextContent,\n },\n {\n pattern: /\\*s\\*(.*?)\\*s\\*/i,\n style: this.ifEnabled({\n fontSize: subtitleSize || 18,\n color: TEXT_DARKEST,\n fontFamily: 'sf-semibold',\n lineHeight: 24,\n }),\n renderText: this.renderTextContent,\n },\n {\n pattern: FormattedText.UrlTextRegex,\n style: this.ifEnabled({ color: colourBrandingMain }),\n onPress: this.ifEnabled(this.onPressUrlText),\n renderText: this.renderUrlText,\n },\n {\n pattern: /(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#\\/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#\\/%=~_|$])/im,\n style: this.ifEnabled({ color: colourBrandingMain }),\n onPress: this.ifEnabled(this.onPressUrl),\n },\n {\n pattern: /([A-Z0-9._%-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4})/im,\n style: this.ifEnabled({ color: colourBrandingMain }),\n onPress: this.ifEnabled(this.onPressEmail),\n },\n {\n pattern: /(?:\\+?(\\d{1,3}))?([-. (]*(\\d{1,3})[-. )]*)?((\\d{2,4})[-. ]*(\\d{2,4})(?:[-.x ]*(\\d+))?)\\s*$/im,\n style: this.ifEnabled({ color: colourBrandingMain }),\n onPress: this.ifEnabled(this.onPressPhone),\n },\n ]}\n >\n {children}\n </ParsedText>\n );\n }\n}\n\nconst styles = {\n text: {\n color: TEXT_DARKEST,\n fontSize: 14,\n fontFamily: 'sf-regular',\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\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,UAAU,MAAM,0BAA0B;AACjD,SAASC,8BAA8B,EAAEC,YAAY,QAAQ,YAAY;AACzE,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,gBAAgB,QAAQ,SAAS;AAE1C,MAAMC,aAAa,SAASR,SAAS,CAAC;EAAAS,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAWvBC,GAAG,IAAI;MAClB,MAAMC,QAAQ,GAAGP,WAAW,CAACM,GAAG,CAAC;MACjCX,OAAO,CAACa,OAAO,CAACD,QAAQ,CAAC;MACzB,IAAI,CAACE,QAAQ,CAAC,UAAU,EAAEF,QAAQ,CAAC;IACrC,CAAC;IAAAF,eAAA,yBAEgBK,OAAO,IAAI;MAC1B,MAAMC,KAAK,GAAGD,OAAO,CAACE,KAAK,CAACV,aAAa,CAACW,YAAY,CAAC;MACvD,IAAI,CAACC,UAAU,CAACH,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAAAN,eAAA,uBAEcU,KAAK,IAAI;MACtBp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