react-native-input-select 0.29.0 → 0.30.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 (57) hide show
  1. package/README.md +2 -0
  2. package/lib/commonjs/components/CheckBox/index.js +8 -1
  3. package/lib/commonjs/components/CheckBox/index.js.map +1 -1
  4. package/lib/commonjs/components/CheckBox/types.js.map +1 -1
  5. package/lib/commonjs/components/CustomModal/index.js +7 -0
  6. package/lib/commonjs/components/CustomModal/index.js.map +1 -1
  7. package/lib/commonjs/components/Dropdown/Dropdown.js +13 -0
  8. package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
  9. package/lib/commonjs/components/Dropdown/DropdownList.js +11 -1
  10. package/lib/commonjs/components/Dropdown/DropdownList.js.map +1 -1
  11. package/lib/commonjs/components/Dropdown/DropdownListItem.js +13 -2
  12. package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -1
  13. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js +16 -9
  14. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  15. package/lib/commonjs/components/Input/index.js +10 -1
  16. package/lib/commonjs/components/Input/index.js.map +1 -1
  17. package/lib/commonjs/constants/index.js.map +1 -1
  18. package/lib/commonjs/index.js +45 -9
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/styles/colors.js.map +1 -1
  21. package/lib/commonjs/styles/input.js +4 -0
  22. package/lib/commonjs/styles/input.js.map +1 -1
  23. package/lib/commonjs/styles/typography.js +3 -0
  24. package/lib/commonjs/styles/typography.js.map +1 -1
  25. package/lib/commonjs/types/index.types.js.map +1 -1
  26. package/lib/module/components/CheckBox/index.js +2 -0
  27. package/lib/module/components/CheckBox/index.js.map +1 -1
  28. package/lib/module/components/CheckBox/types.js.map +1 -1
  29. package/lib/module/components/CustomModal/index.js +2 -0
  30. package/lib/module/components/CustomModal/index.js.map +1 -1
  31. package/lib/module/components/Dropdown/Dropdown.js +6 -0
  32. package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
  33. package/lib/module/components/Dropdown/DropdownList.js +5 -1
  34. package/lib/module/components/Dropdown/DropdownList.js.map +1 -1
  35. package/lib/module/components/Dropdown/DropdownListItem.js +5 -2
  36. package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -1
  37. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js +10 -9
  38. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  39. package/lib/module/components/Input/index.js +2 -1
  40. package/lib/module/components/Input/index.js.map +1 -1
  41. package/lib/module/constants/index.js.map +1 -1
  42. package/lib/module/index.js +29 -9
  43. package/lib/module/index.js.map +1 -1
  44. package/lib/module/styles/colors.js.map +1 -1
  45. package/lib/module/styles/input.js.map +1 -1
  46. package/lib/module/styles/typography.js.map +1 -1
  47. package/lib/module/types/index.types.js.map +1 -1
  48. package/lib/typescript/components/CheckBox/types.d.ts +1 -1
  49. package/lib/typescript/components/Dropdown/Dropdown.d.ts +1 -1
  50. package/lib/typescript/components/Dropdown/DropdownSelectedItemsView.d.ts +1 -1
  51. package/lib/typescript/index.d.ts +1 -1
  52. package/lib/typescript/types/index.types.d.ts +3 -1
  53. package/package.json +1 -1
  54. package/src/components/Dropdown/Dropdown.tsx +4 -0
  55. package/src/components/Dropdown/DropdownSelectedItemsView.tsx +6 -2
  56. package/src/index.tsx +4 -0
  57. package/src/types/index.types.ts +2 -0
package/README.md CHANGED
@@ -155,10 +155,12 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
155
155
  | isMultiple | `Boolean` | `true` |
156
156
  | isSearchable | `Boolean` | `true` |
157
157
  | disabled | `Boolean` | `true` |
158
+ | dropdownIcon | `React Component` | `Image` or `<Text> Show <Text>` |
158
159
  | labelStyle | `Object` | `{color: 'red', fontSize: 15, fontWeight: '500'}` |
159
160
  | placeholderStyle | `Object` | `{color: 'blue', fontSize: 15, fontWeight: '500'}` |
160
161
  | dropdownStyle | `Object` | `{borderColor: 'blue', margin: 5, borderWidth:0 ...}` |
161
162
  | dropdownContainerStyle | `Object` | `{backgroundColor: 'red', width: '30%', ...}` |
163
+ | dropdownIconStyle | `Object` | `{top: 10 , right: 10, ...}` |
162
164
  | searchInputStyle | `Object` | `{backgroundColor: 'red', borderRadius: 0, ...}` |
163
165
  | selectedItemStyle | `Object` | `{fontWeight: '600', color: 'yellow', ...}` |
164
166
  | multipleSelectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
@@ -4,13 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _colors = require("../../styles/colors");
13
+
10
14
  var _constants = require("../../constants");
15
+
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- /* eslint-disable react-native/no-inline-styles */
13
17
 
18
+ /* eslint-disable react-native/no-inline-styles */
14
19
  const CheckBox = _ref => {
15
20
  let {
16
21
  label,
@@ -42,6 +47,7 @@ const CheckBox = _ref => {
42
47
  style: [checkboxLabelStyle, styles.labelStyle]
43
48
  }, label));
44
49
  };
50
+
45
51
  const styles = _reactNative.StyleSheet.create({
46
52
  checkboxContainer: {
47
53
  flexDirection: 'row',
@@ -59,6 +65,7 @@ const styles = _reactNative.StyleSheet.create({
59
65
  marginLeft: 10
60
66
  }
61
67
  });
68
+
62
69
  var _default = CheckBox;
63
70
  exports.default = _default;
64
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_constants","obj","__esModule","default","CheckBox","_ref","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","onChange","fillColor","backgroundColor","borderColor","colors","styles","checkbox","createElement","Pressable","onPress","style","checkboxContainer","View","Image","source","height","CHECKBOX_SIZE","width","Text","labelStyle","StyleSheet","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","marginLeft","_default","exports"],"sources":["index.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { Pressable, Text, StyleSheet, Image, View } from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { CHECKBOX_SIZE } from '../../constants';\nimport type { CheckboxProps } from './types';\n\nconst CheckBox = ({\n label,\n value,\n disabled,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n onChange,\n}: CheckboxProps) => {\n const fillColor = {\n backgroundColor: disabled\n ? '#d3d3d3'\n : value\n ? checkboxStyle?.backgroundColor || primaryColor || 'green'\n : 'white',\n borderColor: disabled ? colors.disabled : styles.checkbox.borderColor,\n };\n\n return (\n <Pressable\n onPress={onChange ? () => onChange(!value) : null}\n style={[styles.checkboxContainer]}\n disabled={disabled}\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"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAAgD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAA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c,UAAU;EAAE,GAAE1B,KAAK,CAC7D,CACS;AAEhB,CAAC;AAED,MAAMY,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/BV,iBAAiB,EAAE;IACjBW,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACDlB,QAAQ,EAAE;IACRmB,OAAO,EAAE,CAAC;IACVC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,OAAO;IACpBC,YAAY,EAAE,CAAC;IACfzB,WAAW,EAAE;EACf,CAAC;EACDgB,UAAU,EAAE;IAAEU,UAAU,EAAE;EAAG;AAC/B,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYvC,QAAQ;AAAAwC,OAAA,CAAAzC,OAAA,GAAAwC,QAAA"}
1
+ {"version":3,"sources":["index.tsx"],"names":["CheckBox","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","onChange","fillColor","backgroundColor","borderColor","colors","styles","checkbox","checkboxContainer","require","height","CHECKBOX_SIZE","width","labelStyle","StyleSheet","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","marginLeft"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;;;AAJA;AAOA,MAAMA,QAAQ,GAAG,QASI;AAAA,MATH;AAChBC,IAAAA,KADgB;AAEhBC,IAAAA,KAFgB;AAGhBC,IAAAA,QAHgB;AAIhBC,IAAAA,YAJgB;AAKhBC,IAAAA,YALgB;AAMhBC,IAAAA,aANgB;AAOhBC,IAAAA,kBAPgB;AAQhBC,IAAAA;AARgB,GASG;AACnB,QAAMC,SAAS,GAAG;AAChBC,IAAAA,eAAe,EAAEP,QAAQ,GACrB,SADqB,GAErBD,KAAK,GACL,CAAAI,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEI,eAAf,KAAkCN,YAAlC,IAAkD,OAD7C,GAEL,OALY;AAMhBO,IAAAA,WAAW,EAAER,QA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q","sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { Pressable, Text, StyleSheet, Image, View } from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { CHECKBOX_SIZE } from '../../constants';\nimport type { CheckboxProps } from './types';\n\nconst CheckBox = ({\n label,\n value,\n disabled,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n onChange,\n}: CheckboxProps) => {\n const fillColor = {\n backgroundColor: disabled\n ? '#d3d3d3'\n : value\n ? checkboxStyle?.backgroundColor || primaryColor || 'green'\n : 'white',\n borderColor: disabled ? colors.disabled : styles.checkbox.borderColor,\n };\n\n return (\n <Pressable\n onPress={onChange ? () => onChange(!value) : null}\n style={[styles.checkboxContainer]}\n disabled={disabled}\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"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue, ViewStyle, TextStyle } from 'react-native';\n\nexport type CheckboxProps = {\n label?: string;\n value?: boolean;\n disabled?: boolean;\n primaryColor?: ColorValue;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n onChange?: (value: boolean | string | number) => void;\n};\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -4,10 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _colors = require("../../styles/colors");
13
+
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
11
16
  const CustomModal = _ref => {
12
17
  let {
13
18
  open,
@@ -29,6 +34,7 @@ const CustomModal = _ref => {
29
34
  style: [styles.modalOptionsContainer, modalOptionsContainerStyle]
30
35
  }, children)));
31
36
  };
37
+
32
38
  const styles = _reactNative.StyleSheet.create({
33
39
  modalContainer: {
34
40
  flex: 1,
@@ -44,6 +50,7 @@ const styles = _reactNative.StyleSheet.create({
44
50
  borderTopRightRadius: 16
45
51
  }
46
52
  });
53
+
47
54
  var _default = CustomModal;
48
55
  exports.default = _default;
49
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","CustomModal","_ref","open","handleToggleModal","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","children","createElement","Modal","transparent","visible","animationType","TouchableOpacity","onPress","style","styles","modalContainer","SafeAreaView","modalOptionsContainer","StyleSheet","create","flex","justifyContent","backgroundColor","maxHeight","colors","white","borderTopLeftRadius","borderTopRightRadius","_default","exports"],"sources":["index.tsx"],"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"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE7C,MAAMG,WAAW,GAAGC,IAAA,IAOT;EAAA,IAPU;IACnBC,IAAI;IACJC,iBAAiB;IACjBC,cAAc;IACdC,oBAAoB;IACpBC,0BAA0B;IAC1BC;EACG,CAAC,GAAAN,IAAA;EACJ,oBACET,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAc,KAAK;IACJC,WAAW,EAAE,IAAK;IAClBC,OAAO,EAAET,IAAK;IACdE,cAAc,EAAEA,CAAA,KAAMA,cAAc,EAAG;IACvCQ,aAAa,EAAC;EAAM,gBAEpBpB,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAkB,gBAAgB;IACfC,OAAO,EAAEA,CAAA,KAAMX,iBAAiB,EAAG;IACnCY,KAAK,EAAE,CACLC,MAAM,CAACC,cAAc,EACrBD,MAAM,CAACX,oBAAoB,EAC3BA,oBAAoB;EACpB,gBAEFb,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAuB,YAAY;IACXH,KAAK,EAAE,CAACC,MAAM,CAACG,qBAAqB,EAAEb,0BAA0B;EAAE,GAEjEC,QAAQ,CACI,CACE,CACb;AAEZ,CAAC;AAED,MAAMS,MAAM,GAAGI,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,cAAc,EAAE;IACdK,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDlB,oBAAoB,EAAE;IAAEmB,eAAe,EAAE;EAAqB,CAAC;EAC/DL,qBAAqB,EAAE;IACrBM,SAAS,EAAE,KAAK;IAChBD,eAAe,EAAEE,cAAM,CAACC,KAAK;IAC7BC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9B,WAAW;AAAA+B,OAAA,CAAAhC,OAAA,GAAA+B,QAAA"}
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"]}
@@ -4,12 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _DropdownSelectedItemsView = _interopRequireDefault(require("./DropdownSelectedItemsView"));
13
+
10
14
  var _colors = require("../../styles/colors");
15
+
11
16
  var _typography = require("../../styles/typography");
17
+
12
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
13
20
  const Dropdown = _ref => {
14
21
  let {
15
22
  label,
@@ -21,8 +28,10 @@ const Dropdown = _ref => {
21
28
  isMultiple,
22
29
  selectedItem,
23
30
  selectedItems,
31
+ dropdownIcon,
24
32
  labelStyle,
25
33
  dropdownStyle,
34
+ dropdownIconStyle,
26
35
  dropdownContainerStyle,
27
36
  selectedItemStyle,
28
37
  placeholderStyle,
@@ -45,7 +54,9 @@ const Dropdown = _ref => {
45
54
  isMultiple: isMultiple,
46
55
  selectedItem: selectedItem,
47
56
  selectedItems: selectedItems,
57
+ dropdownIcon: dropdownIcon,
48
58
  dropdownStyle: dropdownStyle,
59
+ dropdownIconStyle: dropdownIconStyle,
49
60
  selectedItemStyle: selectedItemStyle,
50
61
  multipleSelectedItemStyle: multipleSelectedItemStyle,
51
62
  dropdownErrorStyle: dropdownErrorStyle,
@@ -58,6 +69,7 @@ const Dropdown = _ref => {
58
69
  style: [styles.helper, dropdownHelperTextStyle]
59
70
  }, helperText));
60
71
  };
72
+
61
73
  const styles = _reactNative.StyleSheet.create({
62
74
  label: {
63
75
  marginBottom: 16,
@@ -82,6 +94,7 @@ const styles = _reactNative.StyleSheet.create({
82
94
  color: _colors.colors.black
83
95
  }
84
96
  });
97
+
85
98
  var _default = Dropdown;
86
99
  exports.default = _default;
87
100
  //# sourceMappingURL=Dropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_DropdownSelectedItemsView","_colors","_typography","obj","__esModule","default","Dropdown","_ref","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","labelStyle","dropdownStyle","dropdownContainerStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","createElement","View","style","styles","dropdownInputContainer","Text","helper","StyleSheet","create","marginBottom","color","colors","gray","typography","caption","red","marginTop","primary","width","blackText","black","_default","exports"],"sources":["Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport DropdownSelectedItemsView from './DropdownSelectedItemsView';\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 placeholderStyle,\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 <DropdownSelectedItemsView\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 placeholderStyle={placeholderStyle}\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 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"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAqD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErD,MAAMG,QAAQ,GAAGC,IAAA,IAqBN;EAAA,IArBO;IAChBC,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,aAAa;IACbC,sBAAsB;IACtBC,iBAAiB;IACjBC,gBAAgB;IAChBC,yBAAyB;IACzBC,kBAAkB;IAClBC,sBAAsB;IACtBC,uBAAuB;IACvBC,YAAY;IACZC;EACG,CAAC,GAAApB,IAAA;EACJ,oBACEX,MAAA,CAAAS,OAAA,CAAAuB,aAAA,CAAC7B,YAAA,CAAA8B,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,sBAAsB,EAAEb,sBAAsB;EAAE,GAClEX,KAAK,IAAIA,KAAK,KAAK,EAAE,iBACpBZ,MAAA,CAAAS,OAAA,CAAAuB,aAAA,CAAC7B,YAAA,CAAAkC,IAAI;IAACH,KAAK,EAAE,CAACC,MAAM,CAACvB,KAAK,EAAES,UAAU;EAAE,GAAET,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AE;IAAEU,SAAS,EAAE,CAAC;IAAEN,KAAK,EAAEC,cAAM,CAACM,OAAO;IAAE,GAAGJ,sBAAU,CAACC;EAAQ,CAAC;EACtEV,sBAAsB,EAAE;IAAEK,YAAY,EAAE,EAAE;IAAES,KAAK,EAAE;EAAO,CAAC;EAC3DC,SAAS,EAAE;IAAET,KAAK,EAAEC,cAAM,CAACS;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY3C,QAAQ;AAAA4C,OAAA,CAAA7C,OAAA,GAAA4C,QAAA"}
1
+ {"version":3,"sources":["Dropdown.tsx"],"names":["Dropdown","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","labelStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","styles","dropdownInputContainer","helper","StyleSheet","create","marginBottom","color","colors","gray","typography","caption","red","marginTop","primary","width","blackText","black"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAG,QAuBN;AAAA,MAvBO;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,YAVgB;AAWhBC,IAAAA,UAXgB;AAYhBC,IAAAA,aAZgB;AAahBC,IAAAA,iBAbgB;AAchBC,IAAAA,sBAdgB;AAehBC,IAAAA,iBAfgB;AAgBhBC,IAAAA,gBAhBgB;AAiBhBC,IAAAA,yBAjBgB;AAkBhBC,IAAAA,kBAlBgB;AAmBhBC,IAAAA,sBAnBgB;AAoBhBC,IAAAA,uBApBgB;A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MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/B1B,EAAAA,KAAK,EAAE;AAAE2B,IAAAA,YAAY,EAAE,EAAhB;AAAoBC,IAAAA,KAAK,EAAEC,eAAOC,IAAlC;AAAwC,OAAGC,uBAAWC;AAAtD,GADwB;AAE/B7B,EAAAA,KAAK,EAAE;AAAEyB,IAAAA,KAAK,EAAEC,eAAOI,GAAhB;AAAqBC,IAAAA,SAAS,EAAE,CAAhC;AAAmC,OAAGH,uBAAWC;AAAjD,GAFwB;AAG/BR,EAAAA,MAAM,EAAE;AAAEU,IAAAA,SAAS,EAAE,CAAb;AAAgBN,IAAAA,KAAK,EAAEC,eAAOM,OAA9B;AAAuC,OAAGJ,uBAAWC;AAArD,GAHuB;AAI/BT,EAAAA,sBAAsB,EAAE;AAAEI,IAAAA,YAAY,EAAE,EAAhB;AAAoBS,IAAAA,KAAK,EAAE;AAA3B,GAJO;AAK/BC,EAAAA,SAAS,EAAE;AAAET,IAAAA,KAAK,EAAEC,eAAOS;AAAhB;AALoB,CAAlB,CAAf;;eAQevC,Q","sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport DropdownSelectedItemsView from './DropdownSelectedItemsView';\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 dropdownIcon,\n labelStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n selectedItemStyle,\n placeholderStyle,\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 <DropdownSelectedItemsView\n placeholder={placeholder}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n handleToggleModal={handleToggleModal}\n isMultiple={isMultiple}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n primaryColor={primaryColor}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\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 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"]}
@@ -4,12 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _DropdownListItem = _interopRequireDefault(require("./DropdownListItem"));
13
+
10
14
  var _colors = require("../../styles/colors");
15
+
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
18
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
+
13
20
  const DropdownList = _ref => {
14
21
  let {
15
22
  options,
@@ -54,6 +61,7 @@ const DropdownList = _ref => {
54
61
  keyExtractor: (_item, index) => `Options${index}`
55
62
  }, rest));
56
63
  };
64
+
57
65
  const _renderItem = (_ref2, props) => {
58
66
  let {
59
67
  item
@@ -71,6 +79,7 @@ const _renderItem = (_ref2, props) => {
71
79
  checkboxLabelStyle: props.checkboxLabelStyle
72
80
  });
73
81
  };
82
+
74
83
  const styles = _reactNative.StyleSheet.create({
75
84
  itemSeparatorStyle: {
76
85
  backgroundColor: _colors.colors.gray,
@@ -86,6 +95,7 @@ const styles = _reactNative.StyleSheet.create({
86
95
  paddingTop: 20
87
96
  }
88
97
  });
98
+
89
99
  var _default = DropdownList;
90
100
  exports.default = _default;
91
101
  //# sourceMappingURL=DropdownList.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_DropdownListItem","_colors","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","DropdownList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","rest","createElement","FlatList","data","extraData","initialNumToRender","ListEmptyComponent","View","style","styles","emptyListStyle","Text","contentContainerStyle","paddingTop","ItemSeparatorComponent","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","keyExtractor","_item","index","_ref2","props","StyleSheet","create","backgroundColor","colors","gray","height","opacity","alignItems","width","marginVertical","_default","exports"],"sources":["DropdownList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport 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 isSearchable,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n ...rest\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 contentContainerStyle={[\n isSearchable ? { paddingTop: 0 } : styles.contentContainerStyle,\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 {...rest}\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 itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n emptyListStyle: { alignItems: 'center', width: '100%', marginVertical: 20 },\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownList;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA6C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAA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,eAAe,EAAEC,cAAM,CAACC,IAAI;IAC5BC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC;EACDtB,cAAc,EAAE;IAAEuB,UAAU,EAAE,QAAQ;IAAEC,KAAK,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAG,CAAC;EAC3EvB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAAC,IAAAuB,QAAA,GAEYnD,YAAY;AAAAoD,OAAA,CAAAnE,OAAA,GAAAkE,QAAA"}
1
+ {"version":3,"sources":["DropdownList.tsx"],"names":["DropdownList","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","rest","styles","emptyListStyle","paddingTop","contentContainerStyle","itemSeparatorStyle","item","_renderItem","selectedOption","onChange","_item","index","props","StyleSheet","create","backgroundColor","colors","gray","height","opacity","alignItems","width","marginVertical"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,QAeV;AAAA,MAfW;AACpBC,IAAAA,OADoB;AAEpBC,IAAAA,WAFoB;AAGpBC,IAAAA,WAHoB;AAIpBC,IAAAA,UAJoB;AAKpBC,IAAAA,YALoB;AAMpBC,IAAAA,aANoB;AAOpBC,IAAAA,YAPoB;AAQpBC,IAAAA,wBARoB;AASpBC,IAAAA,qBAToB;AAUpBC,IAAAA,YAVoB;AAWpBC,IAAAA,YAXoB;AAYpBC,IAAAA,aAZoB;AAapBC,IAAAA,kBAboB;AAcpB,OAAGC;AAdiB,GAeX;AACT,sBACE,6BAAC,qBAAD;AACE,IAAA,IAAI,EAAEb,OADR;AAEE,IAAA,SAAS,EAAEG,UAAU,GAAGE,aAAH,GAAmBC,YAF1C;AAGE,IAAA,kBAAkB,EAAE,CAHtB;AAIE,IAAA,kBAAkB,eAChB,6BAAC,iBAAD;AAAM,MAAA,KAAK,EA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AAEe,KAAK,CAACd,aATvB;AAUE,IAAA,kBAAkB,EAAEc,KAAK,CAACb;AAV5B,IADF;AAcD,CAfD;;AAiBA,MAAME,MAAM,GAAGY,wBAAWC,MAAX,CAAkB;AAC/BT,EAAAA,kBAAkB,EAAE;AAClBU,IAAAA,eAAe,EAAEC,eAAOC,IADN;AAElBC,IAAAA,MAAM,EAAE,CAFU;AAGlBC,IAAAA,OAAO,EAAE;AAHS,GADW;AAM/BjB,EAAAA,cAAc,EAAE;AAAEkB,IAAAA,UAAU,EAAE,QAAd;AAAwBC,IAAAA,KAAK,EAAE,MAA/B;AAAuCC,IAAAA,cAAc,EAAE;AAAvD,GANe;AAO/BlB,EAAAA,qBAAqB,EAAE;AAAED,IAAAA,UAAU,EAAE;AAAd;AAPQ,CAAlB,CAAf;;eAUejB,Y","sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport 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 isSearchable,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n ...rest\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 contentContainerStyle={[\n isSearchable ? { paddingTop: 0 } : styles.contentContainerStyle,\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 {...rest}\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 itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n emptyListStyle: { alignItems: 'center', width: '100%', marginVertical: 20 },\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownList;\n"]}
@@ -4,12 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireWildcard(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _CheckBox = _interopRequireDefault(require("../CheckBox"));
13
+
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
11
16
  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); }
17
+
12
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
13
20
  const DropdownListItem = _ref => {
14
21
  let {
15
22
  item,
@@ -23,13 +30,14 @@ const DropdownListItem = _ref => {
23
30
  checkboxStyle,
24
31
  checkboxLabelStyle
25
32
  } = _ref;
26
- const selectedOptionValue = optionValue ?? 'value';
33
+ const selectedOptionValue = optionValue !== null && optionValue !== void 0 ? optionValue : 'value';
27
34
  return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
28
35
  style: styles.dropdownModalOptions,
29
36
  onPress: item.disabled ? () => {} : () => onChange(item[selectedOptionValue]) // intentionally didn't use the disable property
37
+
30
38
  }, /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
31
39
  value: isMultiple ? selectedOption.includes(item[selectedOptionValue]) : [selectedOption].includes(item[selectedOptionValue]),
32
- label: item[optionLabel ?? ''],
40
+ label: item[optionLabel !== null && optionLabel !== void 0 ? optionLabel : ''],
33
41
  onChange: () => onChange(item[selectedOptionValue]),
34
42
  primaryColor: primaryColor,
35
43
  checkboxSize: checkboxSize,
@@ -38,6 +46,7 @@ const DropdownListItem = _ref => {
38
46
  disabled: item.disabled
39
47
  }));
40
48
  };
49
+
41
50
  const styles = _reactNative.StyleSheet.create({
42
51
  dropdownModalOptions: {
43
52
  paddingHorizontal: 20,
@@ -46,6 +55,8 @@ const styles = _reactNative.StyleSheet.create({
46
55
  alignItems: 'center'
47
56
  }
48
57
  });
58
+
49
59
  var _default = /*#__PURE__*/(0, _react.memo)(DropdownListItem);
60
+
50
61
  exports.default = _default;
51
62
  //# sourceMappingURL=DropdownListItem.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_CheckBox","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownListItem","_ref","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","selectedOptionValue","createElement","TouchableOpacity","style","styles","dropdownModalOptions","onPress","disabled","value","includes","label","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems","_default","memo","exports"],"sources":["DropdownListItem.tsx"],"sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\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.dropdownModalOptions}\n onPress={\n item.disabled ? () => {} : () => onChange(item[selectedOptionValue]) // intentionally didn't use the disable property\n }\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}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n disabled={item.disabled}\n />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n dropdownModalOptions: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\n\nexport default memo(DropdownListItem);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmC,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,G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AA,CAAAnD,OAAA,GAAAiD,QAAA"}
1
+ {"version":3,"sources":["DropdownListItem.tsx"],"names":["DropdownListItem","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","selectedOptionValue","styles","dropdownModalOptions","disabled","includes","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems"],"mappings":";;;;;;;AAAA;;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,oBADhB;AAEE,IAAA,OAAO,EACLZ,IAAI,CAACa,QAAL,GAAgB,MAAM,CAAE,CAAxB,GAA2B,MAAMR,QAAQ,CAACL,IAAI,CAACU,mBAAD,CAAL,CADpC,CACgE;;AAHzE,kBAME,6BAAC,iBAAD;AACE,IAAA,KAAK,EACHP,UAAU,GACNC,cAAc,CAACU,QAAf,CAAwBd,IAAI,CAACU,mBAAD,CAA5B,CADM,GAEN,CAACN,cAAD,EAAiBU,QAAjB,CAA0Bd,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,YARhB;AASE,IAAA,YAAY,EAAEC,YAThB;AAUE,IAAA,aAAa,EAAEC,aAVjB;AAWE,IAAA,kBAAkB,EAAEC,kBAXtB;AAYE,IAAA,QAAQ,EAAET,IAAI,CAACa;AAZjB,IANF,CADF;AAuBD,CApCD;;AAsCA,MAAMF,MAAM,GAAGI,wBAAWC,MAAX,CAAkB;AAC/BJ,EAAAA,oBAAoB,EAAE;AACpBK,IAAAA,iBAAiB,EAAE,EADC;AAEpBC,IAAAA,eAAe,EAAE,EAFG;AAGpBC,IAAAA,aAAa,EAAE,KAHK;AAIpBC,IAAAA,UAAU,EAAE;AAJQ;AADS,CAAlB,CAAf;;4BASe,iBAAKrB,gBAAL,C","sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\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.dropdownModalOptions}\n onPress={\n item.disabled ? () => {} : () => onChange(item[selectedOptionValue]) // intentionally didn't use the disable property\n }\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}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n disabled={item.disabled}\n />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n dropdownModalOptions: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\n\nexport default memo(DropdownListItem);\n"]}
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _colors = require("../../styles/colors");
13
+
10
14
  var _input = require("../../styles/input");
15
+
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
12
18
  const DropdownSelectedItemsView = _ref => {
13
19
  let {
14
20
  placeholder,
@@ -18,7 +24,9 @@ const DropdownSelectedItemsView = _ref => {
18
24
  isMultiple,
19
25
  selectedItem,
20
26
  selectedItems,
27
+ dropdownIcon,
21
28
  dropdownStyle,
29
+ dropdownIconStyle,
22
30
  selectedItemStyle,
23
31
  placeholderStyle,
24
32
  multipleSelectedItemStyle,
@@ -32,13 +40,10 @@ const DropdownSelectedItemsView = _ref => {
32
40
  let {
33
41
  pressed
34
42
  } = _ref2;
35
- return [pressed && {
36
- ..._input.inputStyles.inputFocusState,
43
+ return [pressed && { ..._input.inputStyles.inputFocusState,
37
44
  borderColor: primaryColor
38
- }, _input.inputStyles.input, dropdownStyle, error &&
39
- //this must be last
40
- error !== '' && !pressed && {
41
- ..._input.inputStyles.inputFocusErrorState,
45
+ }, _input.inputStyles.input, dropdownStyle, error && //this must be last
46
+ error !== '' && !pressed && { ..._input.inputStyles.inputFocusErrorState,
42
47
  ...dropdownErrorStyle
43
48
  }];
44
49
  },
@@ -65,12 +70,13 @@ const DropdownSelectedItemsView = _ref => {
65
70
  style: [styles.blackText, selectedItemStyle]
66
71
  }, getSelectedItemsLabel()))), !selectedItem && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0 && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
67
72
  style: [styles.blackText, placeholderStyle]
68
- }, placeholder ?? 'Select an option')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
69
- style: styles.iconStyle
70
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
73
+ }, placeholder !== null && placeholder !== void 0 ? placeholder : 'Select an option')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
74
+ style: [styles.iconStyle, dropdownIconStyle]
75
+ }, dropdownIcon || /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
71
76
  source: require('../../asset/arrow-down.png')
72
77
  })));
73
78
  };
79
+
74
80
  const styles = _reactNative.StyleSheet.create({
75
81
  iconStyle: {
76
82
  position: 'absolute',
@@ -94,6 +100,7 @@ const styles = _reactNative.StyleSheet.create({
94
100
  color: _colors.colors.black
95
101
  }
96
102
  });
103
+
97
104
  var _default = DropdownSelectedItemsView;
98
105
  exports.default = _default;
99
106
  //# sourceMappingURL=DropdownSelectedItemsView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_input","obj","__esModule","default","DropdownSelectedItemsView","_ref","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","createElement","Pressable","onPress","style","_ref2","pressed","inputStyles","inputFocusState","borderColor","input","inputFocusErrorState","ScrollView","horizontal","alwaysBounceHorizontal","showsHorizontalScrollIndicator","View","styles","selectedItemsContainer","onStartShouldSetResponder","map","item","i","TouchableOpacity","key","Math","random","Text","backgroundColor","blackText","length","iconStyle","Image","source","StyleSheet","create","position","right","top","flexDirection","flexWrap","color","colors","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black","_default","exports"],"sources":["DropdownSelectedItemsView.tsx"],"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 DropdownSelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownStyle,\n selectedItemStyle,\n placeholderStyle,\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, placeholderStyle]}>\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 overflow: 'hidden',\n },\n blackText: { color: colors.black },\n});\n\nexport default DropdownSelectedItemsView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IA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AU,gBAC5BvD,MAAA,CAAAQ,OAAA,CAAAiB,aAAA,CAACtB,YAAA,CAAAqD,KAAK;IAACC,MAAM,EAAEvD,OAAO,CAAC,4BAA4B;EAAE,EAAG,CACnD,CACG;AAEhB,CAAC;AAED,MAAMuC,MAAM,GAAGiB,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IAAEK,QAAQ,EAAE,UAAU;IAAEC,KAAK,EAAE,EAAE;IAAEC,GAAG,EAAE;EAAG,CAAC;EACvDpB,sBAAsB,EAAE;IAAEqB,aAAa,EAAE,KAAK;IAAEC,QAAQ,EAAE;EAAS,CAAC;EACpE/C,aAAa,EAAE;IACbgD,KAAK,EAAEC,cAAM,CAACC,KAAK;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE,EAAE;IAChBlB,eAAe,EAAEc,cAAM,CAACK,OAAO;IAC/BC,WAAW,EAAE,EAAE;IACfC,QAAQ,EAAE;EACZ,CAAC;EACDpB,SAAS,EAAE;IAAEY,KAAK,EAAEC,cAAM,CAACQ;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYlE,yBAAyB;AAAAmE,OAAA,CAAApE,OAAA,GAAAmE,QAAA"}
1
+ {"version":3,"sources":["DropdownSelectedItemsView.tsx"],"names":["DropdownSelectedItemsView","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","dropdownStyle","dropdownIconStyle","selectedItemStyle","placeholderStyle","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","overflow","black"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;;;AAEA,MAAMA,yBA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BC,IAAAA,QAAQ,EAAE;AAAlC,GAFO;AAG/BlC,EAAAA,aAAa,EAAE;AACbmC,IAAAA,KAAK,EAAEC,eAAOC,KADD;AAEbC,IAAAA,iBAAiB,EAAE,EAFN;AAGbC,IAAAA,eAAe,EAAE,CAHJ;AAIbC,IAAAA,YAAY,EAAE,EAJD;AAKbjB,IAAAA,eAAe,EAAEa,eAAOK,OALX;AAMbC,IAAAA,WAAW,EAAE,EANA;AAObC,IAAAA,QAAQ,EAAE;AAPG,GAHgB;AAY/BnB,EAAAA,SAAS,EAAE;AAAEW,IAAAA,KAAK,EAAEC,eAAOQ;AAAhB;AAZoB,CAAlB,CAAf;;eAeenD,yB","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 DropdownSelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownIcon,\n dropdownStyle,\n dropdownIconStyle,\n selectedItemStyle,\n placeholderStyle,\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, placeholderStyle]}>\n {placeholder ?? 'Select an option'}\n </Text>\n )}\n </ScrollView>\n <View style={[styles.iconStyle, dropdownIconStyle]}>\n {dropdownIcon || (\n <Image source={require('../../asset/arrow-down.png')} />\n )}\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 overflow: 'hidden',\n },\n blackText: { color: colors.black },\n});\n\nexport default DropdownSelectedItemsView;\n"]}
@@ -4,12 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Input = void 0;
7
+
7
8
  var _react = _interopRequireWildcard(require("react"));
9
+
8
10
  var _reactNative = require("react-native");
11
+
9
12
  var _input = require("../../styles/input");
13
+
10
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
+
11
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
18
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
+
13
20
  const Input = _ref => {
14
21
  let {
15
22
  placeholder,
@@ -37,7 +44,9 @@ const Input = _ref => {
37
44
  onChangeText: onChangeText
38
45
  }, rest)));
39
46
  };
47
+
40
48
  exports.Input = Input;
49
+
41
50
  const styles = _reactNative.StyleSheet.create({
42
51
  container: {
43
52
  margin: 23
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_input","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","Input","_ref","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","useState","createElement","View","styles","container","TextInput","inputStyles","input","Platform","select","web","outlineColor","borderColor","onFocus","onBlur","exports","StyleSheet","create","margin"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } 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 Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => setFocus(true)}\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"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAA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C,YAAA,CAAAgD,SAAS,EAAAxB,QAAA;IACRW,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAE,CACLW,kBAAW,CAACC,KAAK,EACjBC,qBAAQ,CAACC,MAAM,CAAC;MACdC,GAAG,EAAE;QACHC,YAAY,EAAEf;MAChB;IACF,CAAC,CAAC,EACFE,SAAS,IAAI;MAAEc,WAAW,EAAEhB;IAAa,CAAC,EAC1CD,KAAK,CACL;IACFkB,OAAO,EAAEA,CAAA,KAAMd,QAAQ,CAAC,IAAI,CAAE;IAC9Be,MAAM,EAAEA,CAAA,KAAMf,QAAQ,CAAC,KAAK,CAAE;IAC9BN,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA;EAAa,GACvBG,IAAI,EACR,CACG;AAEX,CAAC;AAACkB,OAAA,CAAAzB,KAAA,GAAAA,KAAA;AAEF,MAAMa,MAAM,GAAGa,uBAAU,CAACC,MAAM,CAAC;EAC/Bb,SAAS,EAAE;IAAEc,MAAM,EAAE;EAAG;AAC1B,CAAC,CAAC"}
1
+ {"version":3,"sources":["index.tsx"],"names":["Input","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","styles","container","inputStyles","input","Platform","select","web","outlineColor","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,EAELC,sBAASC,MAAT,CAAgB;AACdC,MAAAA,GAAG,EAAE;AACHC,QAAAA,YAAY,EAAEX;AADX;AADS,KAAhB,CAFK,EAOLE,SAAS,IAAI;AAAEU,MAAAA,WAAW,EAAEZ;AAAf,KAPR,EAQLD,KARK,CAFT;AAYE,IAAA,OAAO,EAAE,MAAMI,QAAQ,CAAC,IAAD,CAZzB;AAaE,IAAA,MAAM,EAAE,MAAMA,QAAQ,CAAC,KAAD,CAbxB;AAcE,IAAA,KAAK,EAAEN,KAdT;AAeE,IAAA,YAAY,EAAEC;AAfhB,KAgBMG,IAhBN,EADF,CADF;AAsBD,CAhCM;;;;AAkCP,MAAMG,MAAM,GAAGS,wBAAWC,MAAX,CAAkB;AAC/BT,EAAAA,SAAS,EAAE;AAAEU,IAAAA,MAAM,EAAE;AAAV;AADoB,CAAlB,CAAf","sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } 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 Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => setFocus(true)}\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 +1 @@
1
- {"version":3,"names":["DEFAULT_OPTION_LABEL","exports","DEFAULT_OPTION_VALUE","CHECKBOX_SIZE"],"sources":["index.ts"],"sourcesContent":["export const DEFAULT_OPTION_LABEL = 'label';\nexport const DEFAULT_OPTION_VALUE = 'value';\nexport const CHECKBOX_SIZE = 14;\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAG,OAAO;AAACC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACrC,MAAME,oBAAoB,GAAG,OAAO;AAACD,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AACrC,MAAMC,aAAa,GAAG,EAAE;AAACF,OAAA,CAAAE,aAAA,GAAAA,aAAA"}
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"]}