react-native-input-select 0.18.0 → 0.20.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 (75) hide show
  1. package/README.md +15 -9
  2. package/lib/commonjs/asset/check.png +0 -0
  3. package/lib/commonjs/components/CheckBox/index.js +66 -0
  4. package/lib/commonjs/components/CheckBox/index.js.map +1 -0
  5. package/lib/commonjs/components/CheckBox/types.js +6 -0
  6. package/lib/commonjs/components/CheckBox/types.js.map +1 -0
  7. package/lib/commonjs/{Modal.js → components/CustomModal/index.js} +2 -2
  8. package/lib/commonjs/{Modal.js.map → components/CustomModal/index.js.map} +1 -1
  9. package/lib/commonjs/components/Dropdown/Dropdown.js +99 -0
  10. package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -0
  11. package/lib/commonjs/{DropdownList.js → components/Dropdown/DropdownList.js} +13 -4
  12. package/lib/commonjs/components/Dropdown/DropdownList.js.map +1 -0
  13. package/lib/commonjs/{DropdownListItem.js → components/Dropdown/DropdownListItem.js} +13 -20
  14. package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -0
  15. package/lib/commonjs/{Dropdown.js → components/Dropdown/SelectedItemsView.js} +10 -50
  16. package/lib/commonjs/components/Dropdown/SelectedItemsView.js.map +1 -0
  17. package/lib/commonjs/{Input.js → components/Input/index.js} +2 -2
  18. package/lib/commonjs/{Input.js.map → components/Input/index.js.map} +1 -1
  19. package/lib/commonjs/constants/index.js +3 -1
  20. package/lib/commonjs/constants/index.js.map +1 -1
  21. package/lib/commonjs/index.js +21 -10
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/module/asset/check.png +0 -0
  24. package/lib/module/components/CheckBox/index.js +53 -0
  25. package/lib/module/components/CheckBox/index.js.map +1 -0
  26. package/lib/module/components/CheckBox/types.js +2 -0
  27. package/lib/module/components/CheckBox/types.js.map +1 -0
  28. package/lib/module/{Modal.js → components/CustomModal/index.js} +2 -2
  29. package/lib/module/{Modal.js.map → components/CustomModal/index.js.map} +1 -1
  30. package/lib/module/components/Dropdown/Dropdown.js +84 -0
  31. package/lib/module/components/Dropdown/Dropdown.js.map +1 -0
  32. package/lib/module/{DropdownList.js → components/Dropdown/DropdownList.js} +13 -4
  33. package/lib/module/components/Dropdown/DropdownList.js.map +1 -0
  34. package/lib/module/{DropdownListItem.js → components/Dropdown/DropdownListItem.js} +13 -20
  35. package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -0
  36. package/lib/module/{Dropdown.js → components/Dropdown/SelectedItemsView.js} +10 -49
  37. package/lib/module/components/Dropdown/SelectedItemsView.js.map +1 -0
  38. package/lib/module/{Input.js → components/Input/index.js} +2 -2
  39. package/lib/module/{Input.js.map → components/Input/index.js.map} +1 -1
  40. package/lib/module/constants/index.js +1 -0
  41. package/lib/module/constants/index.js.map +1 -1
  42. package/lib/module/index.js +19 -9
  43. package/lib/module/index.js.map +1 -1
  44. package/lib/typescript/components/CheckBox/index.d.ts +4 -0
  45. package/lib/typescript/components/CheckBox/types.d.ts +10 -0
  46. package/lib/typescript/{Modal.d.ts → components/CustomModal/index.d.ts} +1 -0
  47. package/lib/typescript/{Dropdown.d.ts → components/Dropdown/Dropdown.d.ts} +1 -0
  48. package/lib/typescript/{DropdownList.d.ts → components/Dropdown/DropdownList.d.ts} +2 -1
  49. package/lib/typescript/{DropdownListItem.d.ts → components/Dropdown/DropdownListItem.d.ts} +1 -1
  50. package/lib/typescript/components/Dropdown/SelectedItemsView.d.ts +3 -0
  51. package/lib/typescript/{Input.d.ts → components/Input/index.d.ts} +1 -0
  52. package/lib/typescript/constants/index.d.ts +1 -0
  53. package/lib/typescript/index.d.ts +2 -1
  54. package/lib/typescript/types/index.types.d.ts +25 -22
  55. package/package.json +8 -9
  56. package/src/asset/check.png +0 -0
  57. package/src/components/CheckBox/index.tsx +58 -0
  58. package/src/components/CheckBox/types.ts +11 -0
  59. package/src/{Modal.tsx → components/CustomModal/index.tsx} +1 -1
  60. package/src/components/Dropdown/Dropdown.tsx +75 -0
  61. package/src/{DropdownList.tsx → components/Dropdown/DropdownList.tsx} +10 -1
  62. package/src/components/Dropdown/DropdownListItem.tsx +50 -0
  63. package/src/components/Dropdown/SelectedItemsView.tsx +114 -0
  64. package/src/{Input.tsx → components/Input/index.tsx} +1 -1
  65. package/src/constants/index.ts +1 -0
  66. package/src/index.tsx +43 -36
  67. package/src/types/index.types.ts +25 -22
  68. package/lib/commonjs/Dropdown.js.map +0 -1
  69. package/lib/commonjs/DropdownList.js.map +0 -1
  70. package/lib/commonjs/DropdownListItem.js.map +0 -1
  71. package/lib/module/Dropdown.js.map +0 -1
  72. package/lib/module/DropdownList.js.map +0 -1
  73. package/lib/module/DropdownListItem.js.map +0 -1
  74. package/src/Dropdown.tsx +0 -145
  75. package/src/DropdownListItem.tsx +0 -52
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ [![CodeQL](https://github.com/azeezat/react-native-select/actions/workflows/codeql.yml/badge.svg)](https://github.com/azeezat/react-native-select/actions/workflows/codeql.yml)
2
+
1
3
  # react-native-input-select
2
4
 
3
- A customizable dropdown selection package for react-native for android and iOS with multiple select and search capabilities.
5
+ A fully customizable dropdown selection package for react-native android and iOS with multiple select and search capabilities.
4
6
 
5
7
  ## Installation
6
8
 
@@ -11,11 +13,11 @@ yarn add react-native-input-select
11
13
 
12
14
  ## Demo
13
15
 
14
- | Multiple Select | Single Select | Search |
15
- | :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: |
16
- | <video src='https://user-images.githubusercontent.com/9849221/148039859-9eb4ef87-60ca-4300-9899-fbe81dcb0fb6.mov' width=90/> | <video src='https://user-images.githubusercontent.com/9849221/148039800-9c30509a-6115-415e-aa3c-0402d64ec578.mov' width=90/> | <video src='https://user-images.githubusercontent.com/9849221/148668734-a48aad4d-99bb-4942-a167-561ed59fe38e.mov' width=90/> |
16
+ |<video src='https://user-images.githubusercontent.com/9849221/148668734-a48aad4d-99bb-4942-a167-561ed59fe38e.mov' width=90/> |
17
+
18
+ ## Basic Usage
17
19
 
18
- ## Usage
20
+ For more examples visit our (wiki page)[https://github.com/azeezat/react-native-select/wiki]
19
21
 
20
22
  ```js
21
23
  import React from 'react';
@@ -65,18 +67,22 @@ export default function App() {
65
67
  | isMultiple | `Boolean` | `true` |
66
68
  | isSearchable | `Boolean` | `true` |
67
69
  | disabled | `Boolean` | `true` |
68
- | labelStyle | `Object` | `{backgroundColor: 'red', borderRadius: 0, ...}` |
70
+ | labelStyle | `Object` | `{color: 'red', borderRadius: 0, ...}` |
69
71
  | dropdownStyle | `Object` | `{borderColor: 'blue', margin: 5, borderWidth:0 ...}` |
70
72
  | dropdownContainerStyle | `Object` | `{backgroundColor: 'red', width: '30%', ...}` |
71
73
  | searchInputStyle | `Object` | `{backgroundColor: 'red', borderRadius: 0, ...}` |
72
74
  | selectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
73
75
  | multipleSelectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
74
- | modalBackgroundStyle | `Object` | `{backgroundColor: 'blue', ...}` |
76
+ | modalBackgroundStyle | `Object` | `{backgroundColor: 'rgba(196, 198, 246, 0.5)'}` |
75
77
  | modalOptionsContainer | `Object` | `{padding: 5}` |
76
78
  | dropdownErrorStyle | `Object` | `{borderWidth: 2, borderStyle: 'solid'}` |
77
- | dropdownErrorTextStyle | `Object` | `{color: 'red', fontWeight:500}` |
78
- | dropdownHelperTextStyle | `Object` | `{color: 'green', fontWeight:500}` |
79
+ | dropdownErrorTextStyle | `Object` | `{color: 'red', fontWeight:'500'}` |
80
+ | dropdownHelperTextStyle | `Object` | `{color: 'green', fontWeight:'500'}` |
79
81
  | primaryColor | `string` | `blue` |
82
+ | checkboxSize | `number` | `5` |
83
+ | checkboxStyle | `Object` | `{backgroundColor: 'blue', ...}` |
84
+ | checkboxLabelStyle | `Object` | `{color: 'red', fontWeight:'500'` |
85
+
80
86
 
81
87
  ## Contributing
82
88
 
Binary file
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _constants = require("../../constants");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ /* eslint-disable react-native/no-inline-styles */
17
+ const CheckBox = _ref => {
18
+ let {
19
+ label,
20
+ value,
21
+ primaryColor,
22
+ checkboxSize,
23
+ checkboxStyle,
24
+ checkboxLabelStyle,
25
+ onChange
26
+ } = _ref;
27
+ const fillColor = {
28
+ backgroundColor: value ? primaryColor || 'green' : 'white'
29
+ };
30
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
31
+ onPress: onChange ? () => onChange(!value) : () => {},
32
+ style: [styles.checkboxContainer]
33
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
34
+ style: [styles.checkbox, checkboxStyle, fillColor]
35
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
36
+ source: require('../../asset/check.png'),
37
+ style: [{
38
+ height: checkboxSize || _constants.CHECKBOX_SIZE,
39
+ width: checkboxSize || _constants.CHECKBOX_SIZE
40
+ }]
41
+ })), label && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
42
+ style: [checkboxLabelStyle, styles.labelStyle]
43
+ }, label));
44
+ };
45
+
46
+ const styles = _reactNative.StyleSheet.create({
47
+ checkboxContainer: {
48
+ flexDirection: 'row',
49
+ flexWrap: 'nowrap',
50
+ alignItems: 'center'
51
+ },
52
+ checkbox: {
53
+ padding: 4,
54
+ borderWidth: 1,
55
+ borderStyle: 'solid',
56
+ borderRadius: 4,
57
+ borderColor: 'black'
58
+ },
59
+ labelStyle: {
60
+ marginLeft: 10
61
+ }
62
+ });
63
+
64
+ var _default = CheckBox;
65
+ exports.default = _default;
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.tsx"],"names":["CheckBox","label","value","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","onChange","fillColor","backgroundColor","styles","checkboxContainer","checkbox","require","height","CHECKBOX_SIZE","width","labelStyle","StyleSheet","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","borderColor","marginLeft"],"mappings":";;;;;;;AACA;;AACA;;AACA;;;;AAHA;AAMA,MAAMA,QAAQ,GAAG,QAQI;AAAA,MARH;AAChBC,IAAAA,KADgB;AAEhBC,IAAAA,KAFgB;AAGhBC,IAAAA,YAHgB;AAIhBC,IAAAA,YAJgB;AAKhBC,IAAAA,aALgB;AAMhBC,IAAAA,kBANgB;AAOhBC,IAAAA;AAPgB,GAQG;AACnB,QAAMC,SAAS,GAAG;AAChBC,IAAAA,eAAe,EAAEP,KAAK,GAAGC,YAAY,IAAI,OAAnB,GAA6B;AADnC,GAAlB;AAGA,sBACE,6BAAC,sBAAD;AACE,IAAA,OAAO,EAAEI,QAAQ,GAAG,MAAMA,QAAQ,CAAC,CAACL,KAAF,CAAjB,GAA4B,MAAM,CAAE,CADvD;AAEE,IAAA,KAAK,EAAE,CAACQ,MAAM,CAACC,iBAAR;AAFT,kBAIE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACD,MAAM,CAACE,QAAR,EAAkBP,aAAlB,EAAiCG,SAAjC;AAAb,kBACE,6BAAC,kBAAD;AACE,IAAA,MAAM,EAAEK,OAAO,CAAC,uBAAD,CADjB;AAEE,IAAA,KAAK,EAAE,CACL;AACEC,MAAAA,MAAM,EAAEV,YAAY,IAAIW,wBAD1B;AAEEC,MAAAA,KAAK,EAAEZ,YAAY,IAAIW;AAFzB,KADK;AAFT,IADF,CAJF,EAeGd,KAAK,iBACJ,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACK,kBAAD,EAAqBI,MAAM,CAACO,UAA5B;AAAb,KAAuDhB,KAAvD,CAhBJ,CADF;AAqBD,CAjCD;;AAmCA,MAAMS,MAAM,GAAGQ,wBAAWC,MAAX,CAAkB;AAC/BR,EAAAA,iBAAiB,EAAE;AACjBS,IAAAA,aAAa,EAAE,KADE;AAEjBC,IAAAA,QAAQ,EAAE,QAFO;AAGjBC,IAAAA,UAAU,EAAE;AAHK,GADY;AAM/BV,EAAAA,QAAQ,EAAE;AACRW,IAAAA,OAAO,EAAE,CADD;AAERC,IAAAA,WAAW,EAAE,CAFL;AAGRC,IAAAA,WAAW,EAAE,OAHL;AAIRC,IAAAA,YAAY,EAAE,CAJN;AAKRC,IAAAA,WAAW,EAAE;AALL,GANqB;AAa/BV,EAAAA,UAAU,EAAE;AAAEW,IAAAA,UAAU,EAAE;AAAd;AAbmB,CAAlB,CAAf;;eAgBe5B,Q","sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { Pressable, Text, StyleSheet, Image, View } from 'react-native';\nimport { CHECKBOX_SIZE } from '../../constants';\nimport type { CheckboxProps } from './types';\n\nconst CheckBox = ({\n label,\n value,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n onChange,\n}: CheckboxProps) => {\n const fillColor = {\n backgroundColor: value ? primaryColor || 'green' : 'white',\n };\n return (\n <Pressable\n onPress={onChange ? () => onChange(!value) : () => {}}\n style={[styles.checkboxContainer]}\n >\n <View style={[styles.checkbox, checkboxStyle, fillColor]}>\n <Image\n source={require('../../asset/check.png')}\n style={[\n {\n height: checkboxSize || CHECKBOX_SIZE,\n width: checkboxSize || CHECKBOX_SIZE,\n },\n ]}\n />\n </View>\n {label && (\n <Text style={[checkboxLabelStyle, styles.labelStyle]}>{label}</Text>\n )}\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n checkboxContainer: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n },\n checkbox: {\n padding: 4,\n borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: 4,\n borderColor: 'black',\n },\n labelStyle: { marginLeft: 10 },\n});\n\nexport default CheckBox;\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _colors = require("./styles/colors");
12
+ var _colors = require("../../styles/colors");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
@@ -53,4 +53,4 @@ const styles = _reactNative.StyleSheet.create({
53
53
 
54
54
  var _default = CustomModal;
55
55
  exports.default = _default;
56
- //# sourceMappingURL=Modal.js.map
56
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Modal.tsx"],"names":["CustomModal","open","handleToggleModal","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","children","styles","modalContainer","modalOptionsContainer","StyleSheet","create","flex","justifyContent","backgroundColor","maxHeight","colors","white","borderTopLeftRadius","borderTopRightRadius"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;;;AAEA,MAAMA,WAAW,GAAG,QAOT;AAAA,MAPU;AACnBC,IAAAA,IADmB;AAEnBC,IAAAA,iBAFmB;AAGnBC,IAAAA,cAHmB;AAInBC,IAAAA,oBAJmB;AAKnBC,IAAAA,0BALmB;AAMnBC,IAAAA;AANmB,GAOV;AACT,sBACE,6BAAC,kBAAD;AACE,IAAA,WAAW,EAAE,IADf;AAEE,IAAA,OAAO,EAAEL,IAFX;AAGE,IAAA,cAAc,EAAE,MAAME,cAAc,EAHtC;AAIE,IAAA,aAAa,EAAC;AAJhB,kBAME,6BAAC,6BAAD;AACE,IAAA,OAAO,EAAE,MAAMD,iBAAiB,EADlC;AAEE,IAAA,KAAK,EAAE,CACLK,MAAM,CAACC,cADF,EAELD,MAAM,CAACH,oBAFF,EAGLA,oBAHK;AAFT,kBAQE,6BAAC,yBAAD;AACE,IAAA,KAAK,EAAE,CAACG,MAAM,CAACE,qBAAR,EAA+BJ,0BAA/B;AADT,KAGGC,QAHH,CARF,CANF,CADF;AAuBD,CA/BD;;AAiCA,MAAMC,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,cAAc,EAAE;AACdI,IAAAA,IAAI,EAAE,CADQ;AAEdC,IAAAA,cAAc,EAAE;AAFF,GADe;AAK/BT,EAAAA,oBAAoB,EAAE;AAAEU,IAAAA,eAAe,EAAE;AAAnB,GALS;AAM/BL,EAAAA,qBAAqB,EAAE;AACrBM,IAAAA,SAAS,EAAE,KADU;AAErBD,IAAAA,eAAe,EAAEE,eAAOC,KAFH;AAGrBC,IAAAA,mBAAmB,EAAE,EAHA;AAIrBC,IAAAA,oBAAoB,EAAE;AAJD;AANQ,CAAlB,CAAf;;eAcenB,W","sourcesContent":["import React from 'react';\nimport {\n Modal,\n TouchableOpacity,\n SafeAreaView,\n StyleSheet,\n} from 'react-native';\nimport { colors } from './styles/colors';\n\nconst CustomModal = ({\n open,\n handleToggleModal,\n onRequestClose,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n children,\n}: any) => {\n return (\n <Modal\n transparent={true}\n visible={open}\n onRequestClose={() => onRequestClose()}\n animationType=\"fade\"\n >\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n style={[\n styles.modalContainer,\n styles.modalBackgroundStyle,\n modalBackgroundStyle,\n ]}\n >\n <SafeAreaView\n style={[styles.modalOptionsContainer, modalOptionsContainerStyle]}\n >\n {children}\n </SafeAreaView>\n </TouchableOpacity>\n </Modal>\n );\n};\n\nconst styles = StyleSheet.create({\n modalContainer: {\n flex: 1,\n justifyContent: 'flex-end',\n },\n modalBackgroundStyle: { backgroundColor: 'rgba(0, 0, 0, 0.5)' },\n modalOptionsContainer: {\n maxHeight: '50%',\n backgroundColor: colors.white,\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n },\n});\n\nexport default CustomModal;\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["CustomModal","open","handleToggleModal","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","children","styles","modalContainer","modalOptionsContainer","StyleSheet","create","flex","justifyContent","backgroundColor","maxHeight","colors","white","borderTopLeftRadius","borderTopRightRadius"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;;;AAEA,MAAMA,WAAW,GAAG,QAOT;AAAA,MAPU;AACnBC,IAAAA,IADmB;AAEnBC,IAAAA,iBAFmB;AAGnBC,IAAAA,cAHmB;AAInBC,IAAAA,oBAJmB;AAKnBC,IAAAA,0BALmB;AAMnBC,IAAAA;AANmB,GAOV;AACT,sBACE,6BAAC,kBAAD;AACE,IAAA,WAAW,EAAE,IADf;AAEE,IAAA,OAAO,EAAEL,IAFX;AAGE,IAAA,cAAc,EAAE,MAAME,cAAc,EAHtC;AAIE,IAAA,aAAa,EAAC;AAJhB,kBAME,6BAAC,6BAAD;AACE,IAAA,OAAO,EAAE,MAAMD,iBAAiB,EADlC;AAEE,IAAA,KAAK,EAAE,CACLK,MAAM,CAACC,cADF,EAELD,MAAM,CAACH,oBAFF,EAGLA,oBAHK;AAFT,kBAQE,6BAAC,yBAAD;AACE,IAAA,KAAK,EAAE,CAACG,MAAM,CAACE,qBAAR,EAA+BJ,0BAA/B;AADT,KAGGC,QAHH,CARF,CANF,CADF;AAuBD,CA/BD;;AAiCA,MAAMC,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,cAAc,EAAE;AACdI,IAAAA,IAAI,EAAE,CADQ;AAEdC,IAAAA,cAAc,EAAE;AAFF,GADe;AAK/BT,EAAAA,oBAAoB,EAAE;AAAEU,IAAAA,eAAe,EAAE;AAAnB,GALS;AAM/BL,EAAAA,qBAAqB,EAAE;AACrBM,IAAAA,SAAS,EAAE,KADU;AAErBD,IAAAA,eAAe,EAAEE,eAAOC,KAFH;AAGrBC,IAAAA,mBAAmB,EAAE,EAHA;AAIrBC,IAAAA,oBAAoB,EAAE;AAJD;AANQ,CAAlB,CAAf;;eAcenB,W","sourcesContent":["import React from 'react';\nimport {\n Modal,\n TouchableOpacity,\n SafeAreaView,\n StyleSheet,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nconst CustomModal = ({\n open,\n handleToggleModal,\n onRequestClose,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n children,\n}: any) => {\n return (\n <Modal\n transparent={true}\n visible={open}\n onRequestClose={() => onRequestClose()}\n animationType=\"fade\"\n >\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n style={[\n styles.modalContainer,\n styles.modalBackgroundStyle,\n modalBackgroundStyle,\n ]}\n >\n <SafeAreaView\n style={[styles.modalOptionsContainer, modalOptionsContainerStyle]}\n >\n {children}\n </SafeAreaView>\n </TouchableOpacity>\n </Modal>\n );\n};\n\nconst styles = StyleSheet.create({\n modalContainer: {\n flex: 1,\n justifyContent: 'flex-end',\n },\n modalBackgroundStyle: { backgroundColor: 'rgba(0, 0, 0, 0.5)' },\n modalOptionsContainer: {\n maxHeight: '50%',\n backgroundColor: colors.white,\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n },\n});\n\nexport default CustomModal;\n"]}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _SelectedItemsView = _interopRequireDefault(require("./SelectedItemsView"));
13
+
14
+ var _colors = require("../../styles/colors");
15
+
16
+ var _typography = require("../../styles/typography");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const Dropdown = _ref => {
21
+ let {
22
+ label,
23
+ placeholder,
24
+ helperText,
25
+ error,
26
+ getSelectedItemsLabel,
27
+ handleToggleModal,
28
+ isMultiple,
29
+ selectedItem,
30
+ selectedItems,
31
+ labelStyle,
32
+ dropdownStyle,
33
+ dropdownContainerStyle,
34
+ selectedItemStyle,
35
+ multipleSelectedItemStyle,
36
+ dropdownErrorStyle,
37
+ dropdownErrorTextStyle,
38
+ dropdownHelperTextStyle,
39
+ primaryColor,
40
+ disabled
41
+ } = _ref;
42
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
43
+ style: [styles.dropdownInputContainer, dropdownContainerStyle]
44
+ }, label && label !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
45
+ style: [styles.label, labelStyle]
46
+ }, label), /*#__PURE__*/_react.default.createElement(_SelectedItemsView.default, {
47
+ placeholder: placeholder,
48
+ error: error,
49
+ getSelectedItemsLabel: getSelectedItemsLabel,
50
+ handleToggleModal: handleToggleModal,
51
+ isMultiple: isMultiple,
52
+ selectedItem: selectedItem,
53
+ selectedItems: selectedItems,
54
+ dropdownStyle: dropdownStyle,
55
+ selectedItemStyle: selectedItemStyle,
56
+ multipleSelectedItemStyle: multipleSelectedItemStyle,
57
+ dropdownErrorStyle: dropdownErrorStyle,
58
+ primaryColor: primaryColor,
59
+ disabled: disabled
60
+ }), error && error !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
61
+ style: [styles.error, dropdownErrorTextStyle]
62
+ }, error), helperText && helperText !== '' && !error && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
63
+ style: [styles.helper, dropdownHelperTextStyle]
64
+ }, helperText));
65
+ };
66
+
67
+ const styles = _reactNative.StyleSheet.create({
68
+ label: {
69
+ marginBottom: 16,
70
+ color: _colors.colors.gray,
71
+ ..._typography.typography.caption
72
+ },
73
+ inputFocusErrorState: {
74
+ borderWidth: 2,
75
+ borderStyle: 'solid',
76
+ borderColor: _colors.colors.red
77
+ },
78
+ error: {
79
+ color: _colors.colors.red,
80
+ marginTop: 8,
81
+ ..._typography.typography.caption
82
+ },
83
+ helper: {
84
+ marginTop: 8,
85
+ color: _colors.colors.primary,
86
+ ..._typography.typography.caption
87
+ },
88
+ dropdownInputContainer: {
89
+ marginBottom: 23,
90
+ width: '100%'
91
+ },
92
+ blackText: {
93
+ color: _colors.colors.black
94
+ }
95
+ });
96
+
97
+ var _default = Dropdown;
98
+ exports.default = _default;
99
+ //# sourceMappingURL=Dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Dropdown.tsx"],"names":["Dropdown","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","labelStyle","dropdownStyle","dropdownContainerStyle","selectedItemStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","styles","dropdownInputContainer","helper","StyleSheet","create","marginBottom","color","colors","gray","typography","caption","inputFocusErrorState","borderWidth","borderStyle","borderColor","red","marginTop","primary","width","blackText","black"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAG,QAoBN;AAAA,MApBO;AAChBC,IAAAA,KADgB;AAEhBC,IAAAA,WAFgB;AAGhBC,IAAAA,UAHgB;AAIhBC,IAAAA,KAJgB;AAKhBC,IAAAA,qBALgB;AAMhBC,IAAAA,iBANgB;AAOhBC,IAAAA,UAPgB;AAQhBC,IAAAA,YARgB;AAShBC,IAAAA,aATgB;AAUhBC,IAAAA,UAVgB;AAWhBC,IAAAA,aAXgB;AAYhBC,IAAAA,sBAZgB;AAahBC,IAAAA,iBAbgB;AAchBC,IAAAA,yBAdgB;AAehBC,IAAAA,kBAfgB;AAgBhBC,IAAAA,sBAhBgB;AAiBhBC,IAAAA,uBAjBgB;AAkBhBC,IAAAA,YAlBgB;AAmBhBC,IAAAA;AAnBgB,GAoBP;AACT,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACC,MAAM,CAACC,sBAAR,EAAgCT,sBAAhC;AAA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,EAAE,OAFO;AAGpBC,IAAAA,WAAW,EAAEP,eAAOQ;AAHA,GAFS;AAO/B/B,EAAAA,KAAK,EAAE;AAAEsB,IAAAA,KAAK,EAAEC,eAAOQ,GAAhB;AAAqBC,IAAAA,SAAS,EAAE,CAAhC;AAAmC,OAAGP,uBAAWC;AAAjD,GAPwB;AAQ/BR,EAAAA,MAAM,EAAE;AAAEc,IAAAA,SAAS,EAAE,CAAb;AAAgBV,IAAAA,KAAK,EAAEC,eAAOU,OAA9B;AAAuC,OAAGR,uBAAWC;AAArD,GARuB;AAS/BT,EAAAA,sBAAsB,EAAE;AAAEI,IAAAA,YAAY,EAAE,EAAhB;AAAoBa,IAAAA,KAAK,EAAE;AAA3B,GATO;AAU/BC,EAAAA,SAAS,EAAE;AAAEb,IAAAA,KAAK,EAAEC,eAAOa;AAAhB;AAVoB,CAAlB,CAAf;;eAaexC,Q","sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport SelectedItemsView from './SelectedItemsView';\nimport { colors } from '../../styles/colors';\nimport { typography } from '../../styles/typography';\n\nconst Dropdown = ({\n label,\n placeholder,\n helperText,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n labelStyle,\n dropdownStyle,\n dropdownContainerStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <View style={[styles.dropdownInputContainer, dropdownContainerStyle]}>\n {label && label !== '' && (\n <Text style={[styles.label, labelStyle]}>{label}</Text>\n )}\n <SelectedItemsView\n placeholder={placeholder}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n handleToggleModal={handleToggleModal}\n isMultiple={isMultiple}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n dropdownStyle={dropdownStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n primaryColor={primaryColor}\n disabled={disabled}\n />\n\n {error && error !== '' && (\n <Text style={[styles.error, dropdownErrorTextStyle]}>{error}</Text>\n )}\n\n {helperText && helperText !== '' && !error && (\n <Text style={[styles.helper, dropdownHelperTextStyle]}>\n {helperText}\n </Text>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n label: { marginBottom: 16, color: colors.gray, ...typography.caption },\n inputFocusErrorState: {\n borderWidth: 2,\n borderStyle: 'solid',\n borderColor: colors.red,\n },\n error: { color: colors.red, marginTop: 8, ...typography.caption },\n helper: { marginTop: 8, color: colors.primary, ...typography.caption },\n dropdownInputContainer: { marginBottom: 23, width: '100%' },\n blackText: { color: colors.black },\n});\n\nexport default Dropdown;\n"]}
@@ -11,7 +11,7 @@ var _reactNative = require("react-native");
11
11
 
12
12
  var _DropdownListItem = _interopRequireDefault(require("./DropdownListItem"));
13
13
 
14
- var _colors = require("./styles/colors");
14
+ var _colors = require("../../styles/colors");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
@@ -25,7 +25,10 @@ const DropdownList = _ref => {
25
25
  selectedItem,
26
26
  handleMultipleSelections,
27
27
  handleSingleSelection,
28
- primaryColor
28
+ primaryColor,
29
+ checkboxSize,
30
+ checkboxStyle,
31
+ checkboxLabelStyle
29
32
  } = _ref;
30
33
  return /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
31
34
  data: options,
@@ -43,7 +46,10 @@ const DropdownList = _ref => {
43
46
  isMultiple,
44
47
  selectedOption: isMultiple ? selectedItems : selectedItem,
45
48
  onChange: isMultiple ? handleMultipleSelections : handleSingleSelection,
46
- primaryColor
49
+ primaryColor,
50
+ checkboxSize,
51
+ checkboxStyle,
52
+ checkboxLabelStyle
47
53
  }),
48
54
  keyExtractor: (_item, index) => `Options${index}`
49
55
  });
@@ -60,7 +66,10 @@ const _renderItem = (_ref2, props) => {
60
66
  isMultiple: props.isMultiple,
61
67
  selectedOption: props.selectedOption,
62
68
  onChange: props.onChange,
63
- primaryColor: props.primaryColor
69
+ primaryColor: props.primaryColor,
70
+ checkboxSize: props.checkboxSize,
71
+ checkboxStyle: props.checkboxStyle,
72
+ checkboxLabelStyle: props.checkboxLabelStyle
64
73
  });
65
74
  };
66
75
 
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["DropdownList.tsx"],"names":["DropdownList","options","optionLabel","optionValue","isMultiple","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","styles","emptyListStyle","itemSeparatorStyle","item","_renderItem","selectedOption","onChange","_item","index","props","StyleSheet","create","modalContainer","flex","justifyContent","modalBackgroundStyle","backgroundColor","modalOptionsContainer","maxHeight","colors","white","borderTopLeftRadius","borderTopRightRadius","gray","height","opacity","alignItems","width","marginVertical"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,QAaV;AAAA,MAbW;AACpBC,IAAAA,OADoB;AAEpBC,IAAAA,WAFoB;AAGpBC,IAAAA,WAHoB;AAIpBC,IAAAA,UAJoB;AAKpBC,IAAAA,aALoB;AAMpBC,IAAAA,YANoB;AAOpBC,IAAAA,wBAPoB;AAQpBC,IAAAA,qBARoB;AASpBC,IAAAA,YAToB;AAUpBC,IAAAA,YAVoB;AAWpBC,IAAAA,aAXoB;AAYpBC,IAAAA;AAZoB,GAaX;AACT,sBACE,6BAAC,qBAAD;AACE,IAAA,IAAI,EAAEX,OADR;AAEE,IAAA,SAAS,EAAEG,UAAU,GAAGC,aAAH,GAAmBC,YAF1C;AAGE,IAAA,kBAAkB,EAAE,CAHtB;AAIE,IAAA,kBAAkB,eAChB,6BAAC,iBAAD;AAAM,MAAA,KAAK,EAAEO,MAAM,CAACC;AAApB,oBACE,6BAAC,iBAAD,+BADF,CALJ;AASE,IAAA,sBAAsB,EAAE,mBAAM,6BAAC,iBAAD;AAA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AA,oBAAoB,EAAE;AAAEC,IAAAA,eAAe,EAAE;AAAnB,GALS;AAM/BC,EAAAA,qBAAqB,EAAE;AACrBC,IAAAA,SAAS,EAAE,KADU;AAErBF,IAAAA,eAAe,EAAEG,eAAOC,KAFH;AAGrBC,IAAAA,mBAAmB,EAAE,EAHA;AAIrBC,IAAAA,oBAAoB,EAAE;AAJD,GANQ;AAY/BpB,EAAAA,kBAAkB,EAAE;AAClBc,IAAAA,eAAe,EAAEG,eAAOI,IADN;AAElBC,IAAAA,MAAM,EAAE,CAFU;AAGlBC,IAAAA,OAAO,EAAE;AAHS,GAZW;AAiB/BxB,EAAAA,cAAc,EAAE;AAAEyB,IAAAA,UAAU,EAAE,QAAd;AAAwBC,IAAAA,KAAK,EAAE,MAA/B;AAAuCC,IAAAA,cAAc,EAAE;AAAvD;AAjBe,CAAlB,CAAf;;eAoBezC,Y","sourcesContent":["import React from 'react';\nimport { View, FlatList, StyleSheet, Text } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport { colors } from '../../styles/colors';\n\nconst DropdownList = ({\n options,\n optionLabel,\n optionValue,\n isMultiple,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n}: any) => {\n return (\n <FlatList\n data={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <View style={styles.emptyListStyle}>\n <Text>No options available</Text>\n </View>\n }\n ItemSeparatorComponent={() => <View style={styles.itemSeparatorStyle} />}\n renderItem={(item) =>\n _renderItem(item, {\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption: isMultiple ? selectedItems : selectedItem,\n onChange: isMultiple\n ? handleMultipleSelections\n : handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n })\n }\n keyExtractor={(_item, index) => `Options${index}`}\n />\n );\n};\n\nconst _renderItem = ({ item }: any, props: any) => {\n return (\n <DropdownListItem\n item={item}\n optionLabel={props.optionLabel}\n optionValue={props.optionValue}\n isMultiple={props.isMultiple}\n selectedOption={props.selectedOption}\n onChange={props.onChange}\n primaryColor={props.primaryColor}\n checkboxSize={props.checkboxSize}\n checkboxStyle={props.checkboxStyle}\n checkboxLabelStyle={props.checkboxLabelStyle}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n modalContainer: {\n flex: 1,\n justifyContent: 'flex-end',\n },\n modalBackgroundStyle: { backgroundColor: 'rgba(0, 0, 0, 0.5)' },\n modalOptionsContainer: {\n maxHeight: '50%',\n backgroundColor: colors.white,\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n },\n itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n emptyListStyle: { alignItems: 'center', width: '100%', marginVertical: 20 },\n});\n\nexport default DropdownList;\n"]}
@@ -9,9 +9,9 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _checkbox = _interopRequireDefault(require("@react-native-community/checkbox"));
12
+ var _CheckBox = _interopRequireDefault(require("../CheckBox"));
13
13
 
14
- var _colors = require("./styles/colors");
14
+ var _colors = require("../../styles/colors");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
@@ -27,34 +27,27 @@ const DropdownListItem = _ref => {
27
27
  isMultiple,
28
28
  selectedOption,
29
29
  onChange,
30
- primaryColor
30
+ primaryColor,
31
+ checkboxSize,
32
+ checkboxStyle,
33
+ checkboxLabelStyle
31
34
  } = _ref;
32
35
  const selectedOptionValue = optionValue !== null && optionValue !== void 0 ? optionValue : 'value';
33
36
  return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
34
37
  style: styles.modalOptions,
35
38
  onPress: () => onChange(item[selectedOptionValue])
36
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
37
- style: styles.spacing
38
- }, /*#__PURE__*/_react.default.createElement(_checkbox.default, {
39
+ }, /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
39
40
  value: isMultiple ? selectedOption.includes(item[selectedOptionValue]) : [selectedOption].includes(item[selectedOptionValue]),
41
+ label: item[optionLabel !== null && optionLabel !== void 0 ? optionLabel : ''],
40
42
  onChange: () => onChange(item[selectedOptionValue]),
41
- boxType: "circle" //works on ios only
42
- ,
43
- tintColors: {
44
- true: primaryColor || _colors.colors.primary
45
- } //android control
46
- ,
47
- onCheckColor: primaryColor || _colors.colors.primary //ios checkmark colour control
48
- ,
49
- onTintColor: primaryColor || _colors.colors.primary //ios box colour control
50
-
51
- })), /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, item[optionLabel !== null && optionLabel !== void 0 ? optionLabel : 'label'])));
43
+ primaryColor: primaryColor || _colors.colors.primary,
44
+ checkboxSize: checkboxSize,
45
+ checkboxStyle: checkboxStyle,
46
+ checkboxLabelStyle: checkboxLabelStyle
47
+ }));
52
48
  };
53
49
 
54
50
  const styles = _reactNative.StyleSheet.create({
55
- spacing: {
56
- marginRight: 10
57
- },
58
51
  modalOptions: {
59
52
  paddingHorizontal: 20,
60
53
  paddingVertical: 10,
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["DropdownListItem.tsx"],"names":["DropdownListItem","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","selectedOptionValue","styles","modalOptions","includes","colors","primary","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,QAWd;AAAA,MAXe;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,WAFwB;AAGxBC,IAAAA,WAHwB;AAIxBC,IAAAA,UAJwB;AAKxBC,IAAAA,cALwB;AAMxBC,IAAAA,QANwB;AAOxBC,IAAAA,YAPwB;AAQxBC,IAAAA,YARwB;AASxBC,IAAAA,aATwB;AAUxBC,IAAAA;AAVwB,GAWf;AACT,QAAMC,mBAAmB,GAAGR,WAAH,aAAGA,WAAH,cAAGA,WAAH,GAAkB,OAA3C;AACA,sBACE,6BAAC,6BAAD;AACE,IAAA,KAAK,EAAES,MAAM,CAACC,YADhB;AAEE,IAAA,OAAO,EAAE,MAAMP,QAAQ,CAACL,IAAI,CAACU,mBAAD,CAAL;AAFzB,kBAIE,6BAAC,iBAAD;AACE,IAAA,KAAK,EACHP,UAAU,GACNC,cAAc,CAACS,QAAf,CAAwBb,IAAI,CAACU,mBAAD,CAA5B,CADM,GAEN,CAACN,cAAD,EAAiBS,QAAjB,CAA0Bb,IAAI,CAACU,mBAAD,CAA9B,CAJR;AAME,IAAA,KAAK,EAAEV,IAAI,CAACC,WAAD,aAACA,WAAD,cAACA,WAAD,GAAgB,EAAhB,CANb;AAOE,IAAA,QAAQ,EAAE,MAAMI,QAAQ,CAACL,IAAI,CAACU,mBAAD,CAAL,CAP1B;AAQE,IAAA,YAAY,EAAEJ,YAAY,IAAIQ,eAAOC,OARvC;AASE,IAAA,YAAY,EAAER,YAThB;AAUE,IAAA,aAAa,EAAEC,aAVjB;AAWE,IAAA,kBAAkB,EAAEC;AAXtB,IAJF,CADF;AAoBD,CAjCD;;AAmCA,MAAME,MAAM,GAAGK,wBAAWC,MAAX,CAAkB;AAC/BL,EAAAA,YAAY,EAAE;AACZM,IAAAA,iBAAiB,EAAE,EADP;AAEZC,IAAAA,eAAe,EAAE,EAFL;AAGZC,IAAAA,aAAa,EAAE,KAHH;AAIZC,IAAAA,UAAU,EAAE;AAJA;AADiB,CAAlB,CAAf;;4BASe,iBAAKtB,gBAAL,C","sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\nimport { colors } from '../../styles/colors';\n\nconst DropdownListItem = ({\n item,\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption,\n onChange,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n}: any) => {\n const selectedOptionValue = optionValue ?? 'value';\n return (\n <TouchableOpacity\n style={styles.modalOptions}\n onPress={() => onChange(item[selectedOptionValue])}\n >\n <CheckBox\n value={\n isMultiple\n ? selectedOption.includes(item[selectedOptionValue])\n : [selectedOption].includes(item[selectedOptionValue])\n }\n label={item[optionLabel ?? '']}\n onChange={() => onChange(item[selectedOptionValue])}\n primaryColor={primaryColor || colors.primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n modalOptions: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\n\nexport default memo(DropdownListItem);\n"]}
@@ -9,41 +9,29 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _colors = require("./styles/colors");
12
+ var _colors = require("../../styles/colors");
13
13
 
14
- var _input = require("./styles/input");
15
-
16
- var _typography = require("./styles/typography");
14
+ var _input = require("../../styles/input");
17
15
 
18
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
17
 
20
- const Dropdown = _ref => {
18
+ const SelectedItemsView = _ref => {
21
19
  let {
22
- label,
23
20
  placeholder,
24
- helperText,
25
21
  error,
26
22
  getSelectedItemsLabel,
27
23
  handleToggleModal,
28
24
  isMultiple,
29
25
  selectedItem,
30
26
  selectedItems,
31
- labelStyle,
32
27
  dropdownStyle,
33
- dropdownContainerStyle,
34
28
  selectedItemStyle,
35
29
  multipleSelectedItemStyle,
36
30
  dropdownErrorStyle,
37
- dropdownErrorTextStyle,
38
- dropdownHelperTextStyle,
39
31
  primaryColor,
40
32
  disabled
41
33
  } = _ref;
42
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
43
- style: [styles.dropdownInputContainer, dropdownContainerStyle]
44
- }, label && label !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
45
- style: [styles.label, labelStyle]
46
- }, label), /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
34
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
47
35
  onPress: () => handleToggleModal(),
48
36
  style: _ref2 => {
49
37
  let {
@@ -51,7 +39,7 @@ const Dropdown = _ref => {
51
39
  } = _ref2;
52
40
  return [pressed && { ..._input.inputStyles.inputFocusState,
53
41
  borderColor: primaryColor
54
- }, _input.inputStyles.input, dropdownStyle, error && //order matters
42
+ }, _input.inputStyles.input, dropdownStyle, error && //this must be last
55
43
  error !== '' && !pressed && { ..._input.inputStyles.inputFocusErrorState,
56
44
  ...dropdownErrorStyle
57
45
  }];
@@ -66,7 +54,7 @@ const Dropdown = _ref => {
66
54
  onStartShouldSetResponder: () => true
67
55
  }, isMultiple ? getSelectedItemsLabel().map((item, i) => /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
68
56
  onPress: () => handleToggleModal(),
69
- key: `SelectedItems${i}`,
57
+ key: `react-native-input-select-${Math.random()}-${i}`,
70
58
  disabled: disabled
71
59
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
72
60
  style: [styles.selectedItems, {
@@ -82,44 +70,16 @@ const Dropdown = _ref => {
82
70
  }, placeholder !== null && placeholder !== void 0 ? placeholder : 'Select an option')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
83
71
  style: styles.iconStyle
84
72
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
85
- source: require('../src/asset/arrow-down.png')
86
- }))), error && error !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
87
- style: [styles.error, dropdownErrorTextStyle]
88
- }, error), helperText && helperText !== '' && !error && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
89
- style: [styles.helper, dropdownHelperTextStyle]
90
- }, helperText));
73
+ source: require('../../asset/arrow-down.png')
74
+ })));
91
75
  };
92
76
 
93
77
  const styles = _reactNative.StyleSheet.create({
94
- label: {
95
- marginBottom: 16,
96
- color: _colors.colors.gray,
97
- ..._typography.typography.caption
98
- },
99
- inputFocusErrorState: {
100
- borderWidth: 2,
101
- borderStyle: 'solid',
102
- borderColor: _colors.colors.red
103
- },
104
78
  iconStyle: {
105
79
  position: 'absolute',
106
80
  right: 25,
107
81
  top: 25
108
82
  },
109
- error: {
110
- color: _colors.colors.red,
111
- marginTop: 8,
112
- ..._typography.typography.caption
113
- },
114
- helper: {
115
- marginTop: 8,
116
- color: _colors.colors.primary,
117
- ..._typography.typography.caption
118
- },
119
- dropdownInputContainer: {
120
- marginBottom: 23,
121
- width: '100%'
122
- },
123
83
  selectedItemsContainer: {
124
84
  flexDirection: 'row',
125
85
  flexWrap: 'nowrap'
@@ -137,6 +97,6 @@ const styles = _reactNative.StyleSheet.create({
137
97
  }
138
98
  });
139
99
 
140
- var _default = Dropdown;
100
+ var _default = SelectedItemsView;
141
101
  exports.default = _default;
142
- //# sourceMappingURL=Dropdown.js.map
102
+ //# sourceMappingURL=SelectedItemsView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["SelectedItemsView.tsx"],"names":["SelectedItemsView","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownStyle","selectedItemStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","pressed","inputStyles","inputFocusState","borderColor","input","inputFocusErrorState","styles","selectedItemsContainer","map","item","i","Math","random","backgroundColor","blackText","length","iconStyle","require","StyleSheet","create","position","right","top","flexDirection","flexWrap","color","colors","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","black"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;;;AAEA,MAAMA,iBAAiB,GAAG,QAcf;AAAA,MAdgB;AACzBC,IAAAA,WADyB;AAEzBC,IAAAA,KAFyB;AAGzBC,IAAAA,qBAHyB;AAIzBC,IAAAA,iBAJyB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A,GAHgB;AAW/BlB,EAAAA,SAAS,EAAE;AAAEW,IAAAA,KAAK,EAAEC,eAAOO;AAAhB;AAXoB,CAAlB,CAAf;;eAce/C,iB","sourcesContent":["import React from 'react';\nimport {\n View,\n Text,\n Pressable,\n ScrollView,\n StyleSheet,\n Image,\n TouchableOpacity,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { inputStyles } from '../../styles/input';\n\nconst SelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <Pressable\n onPress={() => handleToggleModal()}\n style={({ pressed }) => [\n pressed && {\n ...inputStyles.inputFocusState,\n borderColor: primaryColor,\n },\n inputStyles.input,\n dropdownStyle,\n error && //this must be last\n error !== '' &&\n !pressed && {\n ...inputStyles.inputFocusErrorState,\n ...dropdownErrorStyle,\n },\n ]}\n disabled={disabled}\n >\n <ScrollView\n horizontal\n alwaysBounceHorizontal\n showsHorizontalScrollIndicator={false}\n >\n <View\n style={styles.selectedItemsContainer}\n onStartShouldSetResponder={() => true}\n >\n {isMultiple ? (\n getSelectedItemsLabel().map((item: any, i: Number) => (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n key={`react-native-input-select-${Math.random()}-${i}`}\n disabled={disabled}\n >\n <Text\n style={[\n styles.selectedItems,\n { backgroundColor: primaryColor },\n multipleSelectedItemStyle,\n ]}\n >\n {item}\n </Text>\n </TouchableOpacity>\n ))\n ) : (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n disabled={disabled}\n >\n <Text style={[styles.blackText, selectedItemStyle]}>\n {getSelectedItemsLabel()}\n </Text>\n </TouchableOpacity>\n )}\n </View>\n\n {!selectedItem && selectedItems?.length === 0 && (\n <Text style={styles.blackText}>\n {placeholder ?? 'Select an option'}\n </Text>\n )}\n </ScrollView>\n <View style={styles.iconStyle}>\n <Image source={require('../../asset/arrow-down.png')} />\n </View>\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n iconStyle: { position: 'absolute', right: 25, top: 25 },\n selectedItemsContainer: { flexDirection: 'row', flexWrap: 'nowrap' },\n selectedItems: {\n color: colors.white,\n paddingHorizontal: 10,\n paddingVertical: 5,\n borderRadius: 10,\n backgroundColor: colors.primary,\n marginRight: 10,\n },\n blackText: { color: colors.black },\n});\n\nexport default SelectedItemsView;\n"]}
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _input = require("./styles/input");
12
+ var _input = require("../../styles/input");
13
13
 
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
 
@@ -50,4 +50,4 @@ const styles = _reactNative.StyleSheet.create({
50
50
  margin: 23
51
51
  }
52
52
  });
53
- //# sourceMappingURL=Input.js.map
53
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Input.tsx"],"names":["Input","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","styles","container","inputStyles","input","inputFocusState","borderColor","StyleSheet","create","margin"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,KAAK,GAAG,QAOV;AAAA,MAPW;AACpBC,IAAAA,WADoB;AAEpBC,IAAAA,KAFoB;AAGpBC,IAAAA,YAHoB;AAIpBC,IAAAA,KAJoB;AAKpBC,IAAAA,YALoB;AAMpB,OAAGC;AANiB,GAOX;AACT,QAAM,CAACC,SAAD,EAAYC,QAAZ,IAAwB,qBAAS,KAAT,CAA9B;AAEA,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,kBACE,6BAAC,sBAAD;AACE,IAAA,WAAW,EAAET,WADf;AAEE,IAAA,KAAK,EAAE,CACLU,mBAAYC,KADP,EAELL,SAAS,IACPI,mBAAYE,eADd,IACiC;AAAEC,MAAAA,WAAW,EAAET;AAAf,KAH5B,EAILD,KAJK,CAFT;AAQE,IAAA,OAAO,EAAE,MAAM;AACbI,MAAAA,QAAQ,CAAC,IAAD,CAAR;AACD,KAVH;AAWE,IAAA,MAAM,EAAE,MAAMA,QAAQ,CAAC,KAAD,CAXxB;AAYE,IAAA,KAAK,EAAEN,KAZT;AAaE,IAAA,YAAY,EAAEC;AAbhB,KAcMG,IAdN,EADF,CADF;AAoBD,CA9BM;;;;AAgCP,MAAMG,MAAM,GAAGM,wBAAWC,MAAX,CAAkB;AAC/BN,EAAAA,SAAS,EAAE;AAAEO,IAAAA,MAAM,EAAE;AAAV;AADoB,CAAlB,CAAf","sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View } from 'react-native';\nimport { inputStyles } from './styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={styles.container}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n isFocused &&\n inputStyles.inputFocusState && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["Input","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","styles","container","inputStyles","input","inputFocusState","borderColor","StyleSheet","create","margin"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,KAAK,GAAG,QAOV;AAAA,MAPW;AACpBC,IAAAA,WADoB;AAEpBC,IAAAA,KAFoB;AAGpBC,IAAAA,YAHoB;AAIpBC,IAAAA,KAJoB;AAKpBC,IAAAA,YALoB;AAMpB,OAAGC;AANiB,GAOX;AACT,QAAM,CAACC,SAAD,EAAYC,QAAZ,IAAwB,qBAAS,KAAT,CAA9B;AAEA,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,kBACE,6BAAC,sBAAD;AACE,IAAA,WAAW,EAAET,WADf;AAEE,IAAA,KAAK,EAAE,CACLU,mBAAYC,KADP,EAELL,SAAS,IACPI,mBAAYE,eADd,IACiC;AAAEC,MAAAA,WAAW,EAAET;AAAf,KAH5B,EAILD,KAJK,CAFT;AAQE,IAAA,OAAO,EAAE,MAAM;AACbI,MAAAA,QAAQ,CAAC,IAAD,CAAR;AACD,KAVH;AAWE,IAAA,MAAM,EAAE,MAAMA,QAAQ,CAAC,KAAD,CAXxB;AAYE,IAAA,KAAK,EAAEN,KAZT;AAaE,IAAA,YAAY,EAAEC;AAbhB,KAcMG,IAdN,EADF,CADF;AAoBD,CA9BM;;;;AAgCP,MAAMG,MAAM,GAAGM,wBAAWC,MAAX,CAAkB;AAC/BN,EAAAA,SAAS,EAAE;AAAEO,IAAAA,MAAM,EAAE;AAAV;AADoB,CAAlB,CAAf","sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={styles.container}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n isFocused &&\n inputStyles.inputFocusState && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n"]}
@@ -3,9 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DEFAULT_OPTION_VALUE = exports.DEFAULT_OPTION_LABEL = void 0;
6
+ exports.DEFAULT_OPTION_VALUE = exports.DEFAULT_OPTION_LABEL = exports.CHECKBOX_SIZE = void 0;
7
7
  const DEFAULT_OPTION_LABEL = 'label';
8
8
  exports.DEFAULT_OPTION_LABEL = DEFAULT_OPTION_LABEL;
9
9
  const DEFAULT_OPTION_VALUE = 'value';
10
10
  exports.DEFAULT_OPTION_VALUE = DEFAULT_OPTION_VALUE;
11
+ const CHECKBOX_SIZE = 14;
12
+ exports.CHECKBOX_SIZE = CHECKBOX_SIZE;
11
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["DEFAULT_OPTION_LABEL","DEFAULT_OPTION_VALUE"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAG,OAA7B;;AACA,MAAMC,oBAAoB,GAAG,OAA7B","sourcesContent":["export const DEFAULT_OPTION_LABEL = 'label';\nexport const DEFAULT_OPTION_VALUE = 'value';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["DEFAULT_OPTION_LABEL","DEFAULT_OPTION_VALUE","CHECKBOX_SIZE"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAG,OAA7B;;AACA,MAAMC,oBAAoB,GAAG,OAA7B;;AACA,MAAMC,aAAa,GAAG,EAAtB","sourcesContent":["export const DEFAULT_OPTION_LABEL = 'label';\nexport const DEFAULT_OPTION_VALUE = 'value';\nexport const CHECKBOX_SIZE = 14;\n"]}