react-native-input-select 1.3.6 → 1.3.7

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 (97) hide show
  1. package/lib/commonjs/components/CheckBox/checkbox.types.js.map +1 -1
  2. package/lib/commonjs/components/CheckBox/index.js +21 -24
  3. package/lib/commonjs/components/CheckBox/index.js.map +1 -1
  4. package/lib/commonjs/components/CustomModal/index.js +21 -24
  5. package/lib/commonjs/components/CustomModal/index.js.map +1 -1
  6. package/lib/commonjs/components/Dropdown/Dropdown.js +26 -28
  7. package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
  8. package/lib/commonjs/components/Dropdown/DropdownFlatList.js +37 -42
  9. package/lib/commonjs/components/Dropdown/DropdownFlatList.js.map +1 -1
  10. package/lib/commonjs/components/Dropdown/DropdownListItem.js +21 -23
  11. package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -1
  12. package/lib/commonjs/components/Dropdown/DropdownSectionList.js +45 -52
  13. package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -1
  14. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js +42 -51
  15. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  16. package/lib/commonjs/components/Input/index.js +12 -14
  17. package/lib/commonjs/components/Input/index.js.map +1 -1
  18. package/lib/commonjs/components/Others/index.js +17 -21
  19. package/lib/commonjs/components/Others/index.js.map +1 -1
  20. package/lib/commonjs/constants/index.js +3 -6
  21. package/lib/commonjs/constants/index.js.map +1 -1
  22. package/lib/commonjs/index.js +92 -84
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/styles/colors.js +1 -2
  25. package/lib/commonjs/styles/colors.js.map +1 -1
  26. package/lib/commonjs/styles/input.js +1 -2
  27. package/lib/commonjs/styles/input.js.map +1 -1
  28. package/lib/commonjs/styles/typography.js +1 -2
  29. package/lib/commonjs/styles/typography.js.map +1 -1
  30. package/lib/commonjs/types/index.types.js.map +1 -1
  31. package/lib/commonjs/utils/index.js +1 -1
  32. package/lib/commonjs/utils/index.js.map +1 -1
  33. package/lib/module/components/CheckBox/checkbox.types.js.map +1 -1
  34. package/lib/module/components/CheckBox/index.js +20 -22
  35. package/lib/module/components/CheckBox/index.js.map +1 -1
  36. package/lib/module/components/CustomModal/index.js +20 -22
  37. package/lib/module/components/CustomModal/index.js.map +1 -1
  38. package/lib/module/components/Dropdown/Dropdown.js +25 -26
  39. package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
  40. package/lib/module/components/Dropdown/DropdownFlatList.js +34 -38
  41. package/lib/module/components/Dropdown/DropdownFlatList.js.map +1 -1
  42. package/lib/module/components/Dropdown/DropdownListItem.js +18 -19
  43. package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -1
  44. package/lib/module/components/Dropdown/DropdownSectionList.js +42 -48
  45. package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -1
  46. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js +41 -49
  47. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  48. package/lib/module/components/Input/index.js +9 -10
  49. package/lib/module/components/Input/index.js.map +1 -1
  50. package/lib/module/components/Others/index.js +17 -21
  51. package/lib/module/components/Others/index.js.map +1 -1
  52. package/lib/module/constants/index.js.map +1 -1
  53. package/lib/module/index.js +91 -82
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/styles/colors.js.map +1 -1
  56. package/lib/module/styles/input.js.map +1 -1
  57. package/lib/module/styles/typography.js.map +1 -1
  58. package/lib/module/types/index.types.js.map +1 -1
  59. package/lib/module/utils/index.js +1 -1
  60. package/lib/module/utils/index.js.map +1 -1
  61. package/lib/typescript/components/CheckBox/checkbox.types.d.ts +1 -0
  62. package/lib/typescript/components/CheckBox/checkbox.types.d.ts.map +1 -0
  63. package/lib/typescript/components/CheckBox/index.d.ts +3 -2
  64. package/lib/typescript/components/CheckBox/index.d.ts.map +1 -0
  65. package/lib/typescript/components/CustomModal/index.d.ts +3 -2
  66. package/lib/typescript/components/CustomModal/index.d.ts.map +1 -0
  67. package/lib/typescript/components/Dropdown/Dropdown.d.ts +3 -2
  68. package/lib/typescript/components/Dropdown/Dropdown.d.ts.map +1 -0
  69. package/lib/typescript/components/Dropdown/DropdownFlatList.d.ts +3 -2
  70. package/lib/typescript/components/Dropdown/DropdownFlatList.d.ts.map +1 -0
  71. package/lib/typescript/components/Dropdown/DropdownListItem.d.ts +2 -1
  72. package/lib/typescript/components/Dropdown/DropdownListItem.d.ts.map +1 -0
  73. package/lib/typescript/components/Dropdown/DropdownSectionList.d.ts +3 -2
  74. package/lib/typescript/components/Dropdown/DropdownSectionList.d.ts.map +1 -0
  75. package/lib/typescript/components/Dropdown/DropdownSelectedItemsView.d.ts +3 -2
  76. package/lib/typescript/components/Dropdown/DropdownSelectedItemsView.d.ts.map +1 -0
  77. package/lib/typescript/components/Input/index.d.ts +3 -2
  78. package/lib/typescript/components/Input/index.d.ts.map +1 -0
  79. package/lib/typescript/components/Others/index.d.ts +8 -7
  80. package/lib/typescript/components/Others/index.d.ts.map +1 -0
  81. package/lib/typescript/constants/index.d.ts +1 -0
  82. package/lib/typescript/constants/index.d.ts.map +1 -0
  83. package/lib/typescript/index.d.ts +1 -0
  84. package/lib/typescript/index.d.ts.map +1 -0
  85. package/lib/typescript/styles/colors.d.ts +1 -0
  86. package/lib/typescript/styles/colors.d.ts.map +1 -0
  87. package/lib/typescript/styles/input.d.ts +1 -0
  88. package/lib/typescript/styles/input.d.ts.map +1 -0
  89. package/lib/typescript/styles/typography.d.ts +1 -0
  90. package/lib/typescript/styles/typography.d.ts.map +1 -0
  91. package/lib/typescript/types/index.types.d.ts +1 -0
  92. package/lib/typescript/types/index.types.d.ts.map +1 -0
  93. package/lib/typescript/utils/index.d.ts +1 -0
  94. package/lib/typescript/utils/index.d.ts.map +1 -0
  95. package/package.json +21 -20
  96. package/src/components/CustomModal/index.tsx +2 -2
  97. package/src/index.tsx +24 -2
@@ -3,46 +3,41 @@ import React from 'react';
3
3
  import { View, Text, Pressable, ScrollView, StyleSheet, Image, TouchableOpacity } from 'react-native';
4
4
  import { colors } from '../../styles/colors';
5
5
  import { inputStyles } from '../../styles/input';
6
- const DropdownSelectedItemsView = _ref => {
7
- var _getSelectedItemsLabe;
8
- let {
9
- placeholder,
10
- error,
11
- getSelectedItemsLabel,
12
- handleToggleModal,
13
- isMultiple,
14
- selectedItem,
15
- selectedItems,
16
- dropdownIcon,
17
- dropdownStyle,
18
- dropdownIconStyle,
19
- selectedItemStyle,
20
- placeholderStyle,
21
- multipleSelectedItemStyle,
22
- dropdownErrorStyle,
23
- primaryColor,
24
- disabled,
25
- setIndexOfSelectedItem
26
- } = _ref;
6
+ const DropdownSelectedItemsView = ({
7
+ placeholder,
8
+ error,
9
+ getSelectedItemsLabel,
10
+ handleToggleModal,
11
+ isMultiple,
12
+ selectedItem,
13
+ selectedItems,
14
+ dropdownIcon,
15
+ dropdownStyle,
16
+ dropdownIconStyle,
17
+ selectedItemStyle,
18
+ placeholderStyle,
19
+ multipleSelectedItemStyle,
20
+ dropdownErrorStyle,
21
+ primaryColor,
22
+ disabled,
23
+ setIndexOfSelectedItem
24
+ }) => {
27
25
  return /*#__PURE__*/React.createElement(Pressable, {
28
26
  onPress: () => handleToggleModal(),
29
- style: _ref2 => {
30
- let {
31
- pressed
32
- } = _ref2;
33
- return [pressed && {
34
- ...inputStyles.inputFocusState,
35
- borderColor: primaryColor
36
- }, {
37
- ...inputStyles.input,
38
- ...dropdownStyle
39
- }, error &&
40
- //this must be last
41
- error !== '' && !pressed && {
42
- ...inputStyles.inputFocusErrorState,
43
- ...dropdownErrorStyle
44
- }];
45
- },
27
+ style: ({
28
+ pressed
29
+ }) => [pressed && {
30
+ ...inputStyles.inputFocusState,
31
+ borderColor: primaryColor
32
+ }, {
33
+ ...inputStyles.input,
34
+ ...dropdownStyle
35
+ }, error &&
36
+ //this must be last
37
+ error !== '' && !pressed && {
38
+ ...inputStyles.inputFocusErrorState,
39
+ ...dropdownErrorStyle
40
+ }],
46
41
  disabled: disabled
47
42
  }, /*#__PURE__*/React.createElement(ScrollView, {
48
43
  horizontal: true,
@@ -51,12 +46,11 @@ const DropdownSelectedItemsView = _ref => {
51
46
  }, /*#__PURE__*/React.createElement(View, {
52
47
  style: styles.selectedItemsContainer,
53
48
  onStartShouldSetResponder: () => true
54
- }, isMultiple ? (_getSelectedItemsLabe = getSelectedItemsLabel()) === null || _getSelectedItemsLabe === void 0 ? void 0 : _getSelectedItemsLabe.map((label, i) => /*#__PURE__*/React.createElement(DropdownContent, {
49
+ }, isMultiple ? getSelectedItemsLabel()?.map((label, i) => /*#__PURE__*/React.createElement(DropdownContent, {
55
50
  onPress: () => {
56
51
  handleToggleModal();
57
52
  setIndexOfSelectedItem(label); // immediately scrolls to list item with the specified label when modal
58
53
  },
59
-
60
54
  key: `react-native-input-select-${Math.random()}-${i}`,
61
55
  style: [styles.selectedItems, {
62
56
  backgroundColor: primaryColor
@@ -68,11 +62,10 @@ const DropdownSelectedItemsView = _ref => {
68
62
  handleToggleModal();
69
63
  setIndexOfSelectedItem(getSelectedItemsLabel()); // immediately scrolls to list item with the specified label when modal
70
64
  },
71
-
72
65
  style: [styles.blackText, selectedItemStyle],
73
66
  label: getSelectedItemsLabel(),
74
67
  disabled: disabled
75
- }), !selectedItem && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0 && /*#__PURE__*/React.createElement(DropdownContent, {
68
+ }), !selectedItem && selectedItems?.length === 0 && /*#__PURE__*/React.createElement(DropdownContent, {
76
69
  onPress: () => handleToggleModal(),
77
70
  style: [styles.blackText, placeholderStyle],
78
71
  label: placeholder ?? 'Select an option',
@@ -83,13 +76,12 @@ const DropdownSelectedItemsView = _ref => {
83
76
  source: require('../../asset/arrow-down.png')
84
77
  })));
85
78
  };
86
- const DropdownContent = _ref3 => {
87
- let {
88
- onPress,
89
- style,
90
- label,
91
- ...rest
92
- } = _ref3;
79
+ const DropdownContent = ({
80
+ onPress,
81
+ style,
82
+ label,
83
+ ...rest
84
+ }) => {
93
85
  return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
94
86
  onPress: () => onPress()
95
87
  }, rest), /*#__PURE__*/React.createElement(Text, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","Pressable","ScrollView","StyleSheet","Image","TouchableOpacity","colors","inputStyles","DropdownSelectedItemsView","_ref","_getSelectedItemsLabe","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","dropdownStyle","dropdownIconStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","setIndexOfSelectedItem","createElement","onPress","style","_ref2","pressed","inputFocusState","borderColor","input","inputFocusErrorState","horizontal","alwaysBounceHorizontal","showsHorizontalScrollIndicator","styles","selectedItemsContainer","onStartShouldSetResponder","map","label","i","DropdownContent","key","Math","random","backgroundColor","blackText","length","iconStyle","source","require","_ref3","rest","_extends","create","position","right","top","flexDirection","flexWrap","alignItems","color","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black"],"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 dropdownIcon,\n dropdownStyle,\n dropdownIconStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n primaryColor,\n disabled,\n setIndexOfSelectedItem,\n}: any) => {\n return (\n <Pressable\n onPress={() => handleToggleModal()}\n style={({ pressed }) => [\n pressed && {\n ...inputStyles.inputFocusState,\n borderColor: primaryColor,\n },\n { ...inputStyles.input, ...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((label: string, i: Number) => (\n <DropdownContent\n onPress={() => {\n handleToggleModal();\n setIndexOfSelectedItem(label); // immediately scrolls to list item with the specified label when modal\n }}\n key={`react-native-input-select-${Math.random()}-${i}`}\n style={[\n styles.selectedItems,\n { backgroundColor: primaryColor },\n multipleSelectedItemStyle,\n ]}\n label={label}\n disabled={disabled}\n />\n ))\n ) : (\n <DropdownContent\n onPress={() => {\n handleToggleModal();\n setIndexOfSelectedItem(getSelectedItemsLabel()); // immediately scrolls to list item with the specified label when modal\n }}\n style={[styles.blackText, selectedItemStyle]}\n label={getSelectedItemsLabel()}\n disabled={disabled}\n />\n )}\n {!selectedItem && selectedItems?.length === 0 && (\n <DropdownContent\n onPress={() => handleToggleModal()}\n style={[styles.blackText, placeholderStyle]}\n label={placeholder ?? 'Select an option'}\n disabled={disabled}\n />\n )}\n </View>\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 DropdownContent = ({ onPress, style, label, ...rest }: any) => {\n return (\n <TouchableOpacity onPress={() => onPress()} {...rest}>\n <Text style={style}>{label}</Text>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n iconStyle: { position: 'absolute', right: 25, top: 25 },\n selectedItemsContainer: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n },\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,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,gBAAgB,QACX,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,MAAMC,yBAAyB,GAAGC,IAAA,IAkBvB;EAAA,IAAAC,qBAAA;EAAA,IAlBwB;IACjCC,WAAW;IACXC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,YAAY;IACZC,aAAa;IACbC,iBAAiB;IACjBC,iBAAiB;IACjBC,gBAAgB;IAChBC,yBAAyB;IACzBC,kBAAkB;IAClBC,YAAY;IACZC,QAAQ;IACRC;EACG,CAAC,GAAAlB,IAAA;EACJ,oBACEX,KAAA,CAAA8B,aAAA,CAAC3B,SAAS;IACR4B,OAAO,EAAEA,CAAA,KAAMf,iBAAiB,CAAC,CAAE;IACnCgB,KAAK,EAAEC,KAAA;MAAA,IAAC;QAAEC;MAAQ,CAAC,GAAAD,KAAA;MAAA,OAAK,CACtBC,OAAO,IAAI;QACT,GAAGzB,WAAW,CAAC0B,eAAe;QAC9BC,WAAW,EAAET;MACf,CAAC,EACD;QAAE,GAAGlB,WAAW,CAAC4B,KAAK;QAAE,GAAGhB;MAAc,CAAC,EAC1CP,KAAK;MAAI;MACPA,KAAK,KAAK,EAAE,IACZ,CAACoB,OAAO,IAAI;QACV,GAAGzB,WAAW,CAAC6B,oBAAoB;QACnC,GAAGZ;MACL,CAAC,CACJ;IAAA,CAAC;IACFE,QAAQ,EAAEA;EAAS,gBAEnB5B,KAAA,CAAA8B,aAAA,CAAC1B,UAAU;IACTmC,UAAU;IACVC,sBAAsB;IACtBC,8BAA8B,EAAE;EAAM,gBAEt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;EACZ,CAAC;EACDtB,SAAS,EAAE;IAAEe,KAAK,EAAE5D,MAAM,CAACoE;EAAM;AACnC,CAAC,CAAC;AAEF,eAAelE,yBAAyB"}
1
+ {"version":3,"names":["React","View","Text","Pressable","ScrollView","StyleSheet","Image","TouchableOpacity","colors","inputStyles","DropdownSelectedItemsView","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","dropdownStyle","dropdownIconStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","setIndexOfSelectedItem","createElement","onPress","style","pressed","inputFocusState","borderColor","input","inputFocusErrorState","horizontal","alwaysBounceHorizontal","showsHorizontalScrollIndicator","styles","selectedItemsContainer","onStartShouldSetResponder","map","label","i","DropdownContent","key","Math","random","backgroundColor","blackText","length","iconStyle","source","require","rest","_extends","create","position","right","top","flexDirection","flexWrap","alignItems","color","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black"],"sourceRoot":"../../../../src","sources":["components/Dropdown/DropdownSelectedItemsView.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,gBAAgB,QACX,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,MAAMC,yBAAyB,GAAGA,CAAC;EACjCC,WAAW;EACXC,KAAK;EACLC,qBAAqB;EACrBC,iBAAiB;EACjBC,UAAU;EACVC,YAAY;EACZC,aAAa;EACbC,YAAY;EACZC,aAAa;EACbC,iBAAiB;EACjBC,iBAAiB;EACjBC,gBAAgB;EAChBC,yBAAyB;EACzBC,kBAAkB;EAClBC,YAAY;EACZC,QAAQ;EACRC;AACG,CAAC,KAAK;EACT,oBACE3B,KAAA,CAAA4B,aAAA,CAACzB,SAAS;IACR0B,OAAO,EAAEA,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IAAEC,KAAK,EAAE,EAAE;IAAEC,GAAG,EAAE;EAAG,CAAC;EACvDpB,sBAAsB,EAAE;IACtBqB,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACD9C,aAAa,EAAE;IACb+C,KAAK,EAAExD,MAAM,CAACyD,KAAK;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE,EAAE;IAChBnB,eAAe,EAAEzC,MAAM,CAAC6D,OAAO;IAC/BC,WAAW,EAAE,EAAE;IACfC,QAAQ,EAAE;EACZ,CAAC;EACDrB,SAAS,EAAE;IAAEc,KAAK,EAAExD,MAAM,CAACgE;EAAM;AACnC,CAAC,CAAC;AAEF,eAAe9D,yBAAyB","ignoreList":[]}
@@ -2,16 +2,15 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2
2
  import React, { useState } from 'react';
3
3
  import { TextInput, StyleSheet, View, Platform } from 'react-native';
4
4
  import { inputStyles } from '../../styles/input';
5
- export const Input = _ref => {
6
- let {
7
- placeholder,
8
- value,
9
- onChangeText,
10
- style,
11
- primaryColor,
12
- textInputContainerStyle,
13
- ...rest
14
- } = _ref;
5
+ export const Input = ({
6
+ placeholder,
7
+ value,
8
+ onChangeText,
9
+ style,
10
+ primaryColor,
11
+ textInputContainerStyle,
12
+ ...rest
13
+ }) => {
15
14
  const [isFocused, setFocus] = useState(false);
16
15
  return /*#__PURE__*/React.createElement(View, {
17
16
  style: [styles.container, textInputContainerStyle]
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","TextInput","StyleSheet","View","Platform","inputStyles","Input","_ref","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","rest","isFocused","setFocus","createElement","styles","container","_extends","input","select","web","outlineColor","borderColor","onFocus","onBlur","returnKeyType","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 textInputContainerStyle,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\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={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n returnKeyType=\"search\"\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACpE,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,KAAK,GAAGC,IAAA,IAQV;EAAA,IARW;IACpBC,WAAW;IACXC,KAAK;IACLC,YAAY;IACZC,KAAK;IACLC,YAAY;IACZC,uBAAuB;IACvB,GAAGC;EACA,CAAC,GAAAP,IAAA;EACJ,MAAM,CAACQ,SAAS,EAAEC,QAAQ,CAAC,GAAGhB,QAAQ,CAAC,KAAK,CAAC;EAE7C,oBACED,KAAA,CAAAkB,aAAA,CAACd,IAAI;IAACQ,KAAK,EAAE,CAACO,MAAM,CAACC,SAAS,EAAEN,uBAAuB;EAAE,gBACvDd,KAAA,CAAAkB,aAAA,CAAChB,SAAS,EAAAmB,QAAA;IACRZ,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAE,CACLN,WAAW,CAACgB,KAAK,EACjBjB,QAAQ,CAACkB,MAAM,CAAC;MACdC,GAAG,EAAE;QACHC,YAAY,EAAEZ;MAChB;IACF,CAAC,CAAC,EACFG,SAAS,IAAI;MAAEU,WAAW,EAAEb;IAAa,CAAC,EAC1CD,KAAK,CACL;IACFe,OAAO,EAAEA,CAAA,KAAM;MACbV,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAE;IACFW,MAAM,EAAEA,CAAA,KAAMX,QAAQ,CAAC,KAAK,CAAE;IAC9BP,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BkB,aAAa,EAAC;EAAQ,GAClBd,IAAI,CACT,CACG,CAAC;AAEX,CAAC;AAED,MAAMI,MAAM,GAAGhB,UAAU,CAAC2B,MAAM,CAAC;EAC/BV,SAAS,EAAE;IAAEW,MAAM,EAAE;EAAG;AAC1B,CAAC,CAAC;AAEF,eAAexB,KAAK"}
1
+ {"version":3,"names":["React","useState","TextInput","StyleSheet","View","Platform","inputStyles","Input","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","rest","isFocused","setFocus","createElement","styles","container","_extends","input","select","web","outlineColor","borderColor","onFocus","onBlur","returnKeyType","create","margin"],"sourceRoot":"../../../../src","sources":["components/Input/index.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACpE,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,KAAK,GAAGA,CAAC;EACpBC,WAAW;EACXC,KAAK;EACLC,YAAY;EACZC,KAAK;EACLC,YAAY;EACZC,uBAAuB;EACvB,GAAGC;AACA,CAAC,KAAK;EACT,MAAM,CAACC,SAAS,EAAEC,QAAQ,CAAC,GAAGf,QAAQ,CAAC,KAAK,CAAC;EAE7C,oBACED,KAAA,CAAAiB,aAAA,CAACb,IAAI;IAACO,KAAK,EAAE,CAACO,MAAM,CAACC,SAAS,EAAEN,uBAAuB;EAAE,gBACvDb,KAAA,CAAAiB,aAAA,CAACf,SAAS,EAAAkB,QAAA;IACRZ,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAE,CACLL,WAAW,CAACe,KAAK,EACjBhB,QAAQ,CAACiB,MAAM,CAAC;MACdC,GAAG,EAAE;QACHC,YAAY,EAAEZ;MAChB;IACF,CAAC,CAAC,EACFG,SAAS,IAAI;MAAEU,WAAW,EAAEb;IAAa,CAAC,EAC1CD,KAAK,CACL;IACFe,OAAO,EAAEA,CAAA,KAAM;MACbV,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAE;IACFW,MAAM,EAAEA,CAAA,KAAMX,QAAQ,CAAC,KAAK,CAAE;IAC9BP,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BkB,aAAa,EAAC;EAAQ,GAClBd,IAAI,CACT,CACG,CAAC;AAEX,CAAC;AAED,MAAMI,MAAM,GAAGf,UAAU,CAAC0B,MAAM,CAAC;EAC/BV,SAAS,EAAE;IAAEW,MAAM,EAAE;EAAG;AAC1B,CAAC,CAAC;AAEF,eAAevB,KAAK","ignoreList":[]}
@@ -1,41 +1,37 @@
1
1
  import React from 'react';
2
2
  import { View, Text, StyleSheet, TouchableOpacity, Image } from 'react-native';
3
3
  import { colors } from '../../styles/colors';
4
- export const ListEmptyComponent = _ref => {
5
- let {
6
- listEmptyComponentStyle,
7
- emptyListMessage
8
- } = _ref;
4
+ export const ListEmptyComponent = ({
5
+ listEmptyComponentStyle,
6
+ emptyListMessage
7
+ }) => {
9
8
  return /*#__PURE__*/React.createElement(View, {
10
9
  style: styles.listEmptyComponentStyle
11
10
  }, /*#__PURE__*/React.createElement(Text, {
12
11
  style: listEmptyComponentStyle
13
12
  }, emptyListMessage || 'No options available'));
14
13
  };
15
- export const ItemSeparatorComponent = _ref2 => {
16
- let {
17
- itemSeparatorStyle
18
- } = _ref2;
14
+ export const ItemSeparatorComponent = ({
15
+ itemSeparatorStyle
16
+ }) => {
19
17
  return /*#__PURE__*/React.createElement(View, {
20
18
  style: [styles.itemSeparatorStyle, itemSeparatorStyle]
21
19
  });
22
20
  };
23
- export const ListItemContainer = _ref3 => {
24
- let {
25
- children,
26
- listItemContainerStyle
27
- } = _ref3;
21
+ export const ListItemContainer = ({
22
+ children,
23
+ listItemContainerStyle
24
+ }) => {
28
25
  return /*#__PURE__*/React.createElement(View, {
29
26
  style: [styles.listItemContainerStyle, listItemContainerStyle]
30
27
  }, children);
31
28
  };
32
- export const SectionHeaderTitle = _ref4 => {
33
- let {
34
- title,
35
- sectionHeaderStyle,
36
- onPress,
37
- isExpanded
38
- } = _ref4;
29
+ export const SectionHeaderTitle = ({
30
+ title,
31
+ sectionHeaderStyle,
32
+ onPress,
33
+ isExpanded
34
+ }) => {
39
35
  return /*#__PURE__*/React.createElement(TouchableOpacity, {
40
36
  onPress: onPress
41
37
  }, /*#__PURE__*/React.createElement(ListItemContainer, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","StyleSheet","TouchableOpacity","Image","colors","ListEmptyComponent","_ref","listEmptyComponentStyle","emptyListMessage","createElement","style","styles","ItemSeparatorComponent","_ref2","itemSeparatorStyle","ListItemContainer","_ref3","children","listItemContainerStyle","SectionHeaderTitle","_ref4","title","sectionHeaderStyle","onPress","isExpanded","accordionStyle","rotatedIcon90","source","require","create","alignItems","width","marginVertical","backgroundColor","gray","height","opacity","paddingHorizontal","paddingVertical","flexDirection","fontWeight","flexWrap","justifyContent","alignContent","transform","rotate"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport {\n View,\n Text,\n StyleSheet,\n TouchableOpacity,\n TextStyle,\n Image,\n ViewStyle,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nexport const ListEmptyComponent = ({\n listEmptyComponentStyle,\n emptyListMessage,\n}: any) => {\n return (\n <View style={styles.listEmptyComponentStyle}>\n <Text style={listEmptyComponentStyle}>\n {emptyListMessage || 'No options available'}\n </Text>\n </View>\n );\n};\n\nexport const ItemSeparatorComponent = ({\n itemSeparatorStyle,\n}: {\n itemSeparatorStyle: ViewStyle;\n}) => {\n return <View style={[styles.itemSeparatorStyle, itemSeparatorStyle]} />;\n};\n\nexport const ListItemContainer = ({\n children,\n listItemContainerStyle,\n}: {\n children: ReactNode;\n listItemContainerStyle: ViewStyle;\n}) => {\n return (\n <View style={[styles.listItemContainerStyle, listItemContainerStyle]}>\n {children}\n </View>\n );\n};\n\nexport const SectionHeaderTitle = ({\n title,\n sectionHeaderStyle,\n onPress,\n isExpanded,\n}: {\n title: string;\n sectionHeaderStyle?: TextStyle;\n onPress?: () => void;\n isExpanded: Boolean;\n}) => {\n return (\n <TouchableOpacity onPress={onPress}>\n <ListItemContainer listItemContainerStyle={styles.accordionStyle}>\n <Text style={[styles.sectionHeaderStyle, sectionHeaderStyle]}>\n {title}\n </Text>\n <View style={isExpanded ? null : styles.rotatedIcon90}>\n <Image source={require('../../asset/arrow-down.png')} />\n </View>\n </ListItemContainer>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n listEmptyComponentStyle: {\n alignItems: 'center',\n width: '100%',\n marginVertical: 20,\n },\n itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n listItemContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n sectionHeaderStyle: { fontWeight: '500' },\n accordionStyle: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n justifyContent: 'space-between',\n alignContent: 'center',\n },\n rotatedIcon90: {\n transform: [{ rotate: '-90deg' }],\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAEhBC,KAAK,QAEA,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAE5C,OAAO,MAAMC,kBAAkB,GAAGC,IAAA,IAGvB;EAAA,IAHwB;IACjCC,uBAAuB;IACvBC;EACG,CAAC,GAAAF,IAAA;EACJ,oBACER,KAAA,CAAAW,aAAA,CAACV,IAAI;IAACW,KAAK,EAAEC,MAA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ACH,CAAC;AAEvB,CAAC;AAED,MAAMjB,MAAM,GAAGV,UAAU,CAAC4B,MAAM,CAAC;EAC/BtB,uBAAuB,EAAE;IACvBuB,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,cAAc,EAAE;EAClB,CAAC;EACDlB,kBAAkB,EAAE;IAClBmB,eAAe,EAAE7B,MAAM,CAAC8B,IAAI;IAC5BC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC;EACDlB,sBAAsB,EAAE;IACtBmB,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBT,UAAU,EAAE;EACd,CAAC;EACDR,kBAAkB,EAAE;IAAEkB,UAAU,EAAE;EAAM,CAAC;EACzCf,cAAc,EAAE;IACdc,aAAa,EAAE,KAAK;IACpBE,QAAQ,EAAE,QAAQ;IAClBC,cAAc,EAAE,eAAe;IAC/BC,YAAY,EAAE;EAChB,CAAC;EACDjB,aAAa,EAAE;IACbkB,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","View","Text","StyleSheet","TouchableOpacity","Image","colors","ListEmptyComponent","listEmptyComponentStyle","emptyListMessage","createElement","style","styles","ItemSeparatorComponent","itemSeparatorStyle","ListItemContainer","children","listItemContainerStyle","SectionHeaderTitle","title","sectionHeaderStyle","onPress","isExpanded","accordionStyle","rotatedIcon90","source","require","create","alignItems","width","marginVertical","backgroundColor","gray","height","opacity","paddingHorizontal","paddingVertical","flexDirection","fontWeight","flexWrap","justifyContent","alignContent","transform","rotate"],"sourceRoot":"../../../../src","sources":["components/Others/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAEhBC,KAAK,QAEA,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAE5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AACoB,MAAM,EAAEC,OAAO,CAAC,4BAA4B;EAAE,CAAE,CACnD,CACW,CACH,CAAC;AAEvB,CAAC;AAED,MAAMd,MAAM,GAAGT,UAAU,CAACwB,MAAM,CAAC;EAC/BnB,uBAAuB,EAAE;IACvBoB,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,cAAc,EAAE;EAClB,CAAC;EACDhB,kBAAkB,EAAE;IAClBiB,eAAe,EAAEzB,MAAM,CAAC0B,IAAI;IAC5BC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC;EACDjB,sBAAsB,EAAE;IACtBkB,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBT,UAAU,EAAE;EACd,CAAC;EACDR,kBAAkB,EAAE;IAAEkB,UAAU,EAAE;EAAM,CAAC;EACzCf,cAAc,EAAE;IACdc,aAAa,EAAE,KAAK;IACpBE,QAAQ,EAAE,QAAQ;IAClBC,cAAc,EAAE,eAAe;IAC/BC,YAAY,EAAE;EAChB,CAAC;EACDjB,aAAa,EAAE;IACbkB,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_OPTION_LABEL","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":"AAAA,OAAO,MAAMA,oBAAoB,GAAG,OAAO;AAC3C,OAAO,MAAMC,oBAAoB,GAAG,OAAO;AAC3C,OAAO,MAAMC,aAAa,GAAG,EAAE"}
1
+ {"version":3,"names":["DEFAULT_OPTION_LABEL","DEFAULT_OPTION_VALUE","CHECKBOX_SIZE"],"sourceRoot":"../../../src","sources":["constants/index.ts"],"mappings":"AAAA,OAAO,MAAMA,oBAAoB,GAAG,OAAO;AAC3C,OAAO,MAAMC,oBAAoB,GAAG,OAAO;AAC3C,OAAO,MAAMC,aAAa,GAAG,EAAE","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  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); }
2
- import React, { useState, useEffect, useCallback } from 'react';
3
- import { TouchableOpacity, StyleSheet, View } from 'react-native';
2
+ import React, { useState, useEffect, useCallback, useRef } from 'react';
3
+ import { TouchableOpacity, StyleSheet, View, Platform } from 'react-native';
4
4
  import Input from './components/Input';
5
5
  import CheckBox from './components/CheckBox';
6
6
  import Dropdown from './components/Dropdown/Dropdown';
@@ -10,61 +10,59 @@ import CustomModal from './components/CustomModal';
10
10
  import { colors } from './styles/colors';
11
11
  import { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';
12
12
  import { escapeRegExp, extractPropertyFromArray } from './utils';
13
- export const DropdownSelect = _ref => {
14
- var _extractPropertyFromA, _searchControls$textI;
15
- let {
16
- placeholder,
17
- label,
18
- error,
19
- helperText,
20
- options,
21
- optionLabel,
22
- optionValue,
23
- onValueChange,
24
- selectedValue,
25
- isMultiple,
26
- isSearchable,
27
- dropdownIcon,
28
- labelStyle,
29
- placeholderStyle,
30
- dropdownStyle,
31
- dropdownIconStyle,
32
- dropdownContainerStyle,
33
- dropdownErrorStyle,
34
- dropdownErrorTextStyle,
35
- dropdownHelperTextStyle,
36
- selectedItemStyle,
37
- multipleSelectedItemStyle,
38
- modalBackgroundStyle,
39
- // kept for backwards compatibility
40
- modalOptionsContainerStyle,
41
- // kept for backwards compatibility
42
- searchInputStyle,
43
- // kept for backwards compatibility
44
- primaryColor,
45
- disabled,
46
- checkboxSize,
47
- // kept for backwards compatibility
48
- checkboxStyle,
49
- // kept for backwards compatibility
50
- checkboxLabelStyle,
51
- // kept for backwards compatibility
52
- checkboxComponentStyles,
53
- // kept for backwards compatibility
54
- checkboxComponent,
55
- // kept for backwards compatibility
56
- listHeaderComponent,
57
- listFooterComponent,
58
- listComponentStyles,
59
- modalProps,
60
- // kept for backwards compatibility
61
- hideModal = false,
62
- listControls,
63
- searchControls,
64
- modalControls,
65
- checkboxControls,
66
- ...rest
67
- } = _ref;
13
+ export const DropdownSelect = ({
14
+ placeholder,
15
+ label,
16
+ error,
17
+ helperText,
18
+ options,
19
+ optionLabel,
20
+ optionValue,
21
+ onValueChange,
22
+ selectedValue,
23
+ isMultiple,
24
+ isSearchable,
25
+ dropdownIcon,
26
+ labelStyle,
27
+ placeholderStyle,
28
+ dropdownStyle,
29
+ dropdownIconStyle,
30
+ dropdownContainerStyle,
31
+ dropdownErrorStyle,
32
+ dropdownErrorTextStyle,
33
+ dropdownHelperTextStyle,
34
+ selectedItemStyle,
35
+ multipleSelectedItemStyle,
36
+ modalBackgroundStyle,
37
+ // kept for backwards compatibility
38
+ modalOptionsContainerStyle,
39
+ // kept for backwards compatibility
40
+ searchInputStyle,
41
+ // kept for backwards compatibility
42
+ primaryColor,
43
+ disabled,
44
+ checkboxSize,
45
+ // kept for backwards compatibility
46
+ checkboxStyle,
47
+ // kept for backwards compatibility
48
+ checkboxLabelStyle,
49
+ // kept for backwards compatibility
50
+ checkboxComponentStyles,
51
+ // kept for backwards compatibility
52
+ checkboxComponent,
53
+ // kept for backwards compatibility
54
+ listHeaderComponent,
55
+ listFooterComponent,
56
+ listComponentStyles,
57
+ modalProps,
58
+ // kept for backwards compatibility
59
+ hideModal = false,
60
+ listControls,
61
+ searchControls,
62
+ modalControls,
63
+ checkboxControls,
64
+ ...rest
65
+ }) => {
68
66
  const [newOptions, setNewOptions] = useState([]);
69
67
  const [open, setOpen] = useState(false);
70
68
  const [selectAll, setSelectAll] = useState(false);
@@ -90,9 +88,9 @@ export const DropdownSelect = _ref => {
90
88
  *==========================================*/
91
89
 
92
90
  // check the structure of the new options array to determine if it is a section list or a
93
- const isSectionList = newOptions === null || newOptions === void 0 ? void 0 : newOptions.some(item => item.title && item.data && Array.isArray(item.data));
91
+ const isSectionList = newOptions?.some(item => item.title && item.data && Array.isArray(item.data));
94
92
  const ListTypeComponent = isSectionList ? DropdownSectionList : DropdownFlatList;
95
- const modifiedSectionData = (_extractPropertyFromA = extractPropertyFromArray(newOptions, 'data')) === null || _extractPropertyFromA === void 0 ? void 0 : _extractPropertyFromA.flat();
93
+ const modifiedSectionData = extractPropertyFromArray(newOptions, 'data')?.flat();
96
94
 
97
95
  /**
98
96
  * `options` is the original array, it never changes. (Do not use except you really need the original array) .
@@ -116,12 +114,10 @@ export const DropdownSelect = _ref => {
116
114
  setOpen(false); // close modal upon selection
117
115
  }
118
116
  };
119
-
120
117
  const handleMultipleSelections = value => {
121
118
  setSelectedItems(prevVal => {
122
- var _selectedValues;
123
119
  let selectedValues = [...prevVal];
124
- if ((_selectedValues = selectedValues) !== null && _selectedValues !== void 0 && _selectedValues.includes(value)) {
120
+ if (selectedValues?.includes(value)) {
125
121
  selectedValues = selectedValues.filter(item => item !== value);
126
122
  } else {
127
123
  selectedValues.push(value);
@@ -131,7 +127,7 @@ export const DropdownSelect = _ref => {
131
127
  });
132
128
  };
133
129
  const removeDisabledItems = items => {
134
- return items === null || items === void 0 ? void 0 : items.filter(item => !item.disabled);
130
+ return items?.filter(item => !item.disabled);
135
131
  };
136
132
  const handleSelectAll = () => {
137
133
  setSelectAll(prevVal => {
@@ -148,10 +144,10 @@ export const DropdownSelect = _ref => {
148
144
  onValueChange(selectedValues); // send value to parent
149
145
  return !prevVal;
150
146
  });
151
- if (typeof (listControls === null || listControls === void 0 ? void 0 : listControls.selectAllCallback) === 'function' && !selectAll) {
147
+ if (typeof listControls?.selectAllCallback === 'function' && !selectAll) {
152
148
  listControls.selectAllCallback();
153
149
  }
154
- if (typeof (listControls === null || listControls === void 0 ? void 0 : listControls.unselectAllCallback) === 'function' && selectAll) {
150
+ if (typeof listControls?.unselectAllCallback === 'function' && selectAll) {
155
151
  listControls.unselectAllCallback();
156
152
  }
157
153
  };
@@ -160,9 +156,8 @@ export const DropdownSelect = _ref => {
160
156
  * Handle side effects
161
157
  *==========================================*/
162
158
  const checkSelectAll = useCallback(selectedValues => {
163
- var _removeDisabledItems;
164
159
  //if the list contains disabled values, those values will not be selected
165
- if (((_removeDisabledItems = removeDisabledItems(modifiedOptions)) === null || _removeDisabledItems === void 0 ? void 0 : _removeDisabledItems.length) === (selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length)) {
160
+ if (removeDisabledItems(modifiedOptions)?.length === selectedValues?.length) {
166
161
  setSelectAll(true);
167
162
  } else {
168
163
  setSelectAll(false);
@@ -183,15 +178,14 @@ export const DropdownSelect = _ref => {
183
178
  const getSelectedItemsLabel = () => {
184
179
  if (isMultiple && Array.isArray(selectedItems)) {
185
180
  let selectedLabels = [];
186
- selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.forEach(element => {
187
- var _modifiedOptions$find;
188
- let selectedItemLabel = modifiedOptions === null || modifiedOptions === void 0 || (_modifiedOptions$find = modifiedOptions.find(item => item[optValue] === element)) === null || _modifiedOptions$find === void 0 ? void 0 : _modifiedOptions$find[optLabel];
181
+ selectedItems?.forEach(element => {
182
+ let selectedItemLabel = modifiedOptions?.find(item => item[optValue] === element)?.[optLabel];
189
183
  selectedLabels.push(selectedItemLabel);
190
184
  });
191
185
  return selectedLabels;
192
186
  }
193
- let selectedItemLabel = modifiedOptions === null || modifiedOptions === void 0 ? void 0 : modifiedOptions.find(item => item[optValue] === selectedItem);
194
- return selectedItemLabel === null || selectedItemLabel === void 0 ? void 0 : selectedItemLabel[optLabel];
187
+ let selectedItemLabel = modifiedOptions?.find(item => item[optValue] === selectedItem);
188
+ return selectedItemLabel?.[optLabel];
195
189
  };
196
190
 
197
191
  /*===========================================
@@ -231,6 +225,22 @@ export const DropdownSelect = _ref => {
231
225
  return searchResults;
232
226
  };
233
227
 
228
+ /**
229
+ * To prevent triggering on modalProps.onDismiss on first render, we perform this check
230
+ */
231
+ const hasComponentBeenRendered = useRef(false);
232
+
233
+ /**
234
+ * Explicitly adding this here because the onDismiss only works on iOS Modals
235
+ * https://reactnative.dev/docs/modal#ondismiss-ios
236
+ */
237
+ useEffect(() => {
238
+ if (hasComponentBeenRendered.current && !open && Platform.OS === 'android') {
239
+ modalControls?.modalProps?.onDismiss?.();
240
+ }
241
+ hasComponentBeenRendered.current = true;
242
+ }, [open]);
243
+
234
244
  /*===========================================
235
245
  * Modal
236
246
  *==========================================*/
@@ -259,9 +269,8 @@ export const DropdownSelect = _ref => {
259
269
  * setIndexOfSelectedItem - For ScrollToIndex
260
270
  *==========================================*/
261
271
  const setIndexOfSelectedItem = selectedLabel => {
262
- isSectionList ? options === null || options === void 0 ? void 0 : options.map((item, sectionIndex) => {
263
- var _item$data;
264
- item === null || item === void 0 || (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.find((dataItem, itemIndex) => {
272
+ isSectionList ? options?.map((item, sectionIndex) => {
273
+ item?.data?.find((dataItem, itemIndex) => {
265
274
  if (dataItem[optLabel] === selectedLabel) {
266
275
  setListIndex({
267
276
  sectionIndex,
@@ -269,7 +278,7 @@ export const DropdownSelect = _ref => {
269
278
  });
270
279
  }
271
280
  });
272
- }) : options === null || options === void 0 ? void 0 : options.find((item, itemIndex) => {
281
+ }) : options?.find((item, itemIndex) => {
273
282
  if (item[optLabel] === selectedLabel) {
274
283
  setListIndex({
275
284
  itemIndex
@@ -314,17 +323,17 @@ export const DropdownSelect = _ref => {
314
323
  ListHeaderComponent: /*#__PURE__*/React.createElement(React.Fragment, null, isSearchable && /*#__PURE__*/React.createElement(Input, _extends({
315
324
  value: searchValue,
316
325
  onChangeText: text => onSearch(text),
317
- style: (searchControls === null || searchControls === void 0 ? void 0 : searchControls.textInputStyle) || searchInputStyle,
326
+ style: searchControls?.textInputStyle || searchInputStyle,
318
327
  primaryColor: primary,
319
- textInputContainerStyle: searchControls === null || searchControls === void 0 ? void 0 : searchControls.textInputContainerStyle,
320
- placeholder: (searchControls === null || searchControls === void 0 || (_searchControls$textI = searchControls.textInputProps) === null || _searchControls$textI === void 0 ? void 0 : _searchControls$textI.placeholder) || 'Search'
321
- }, searchControls === null || searchControls === void 0 ? void 0 : searchControls.textInputProps)), listHeaderComponent, !(listControls !== null && listControls !== void 0 && listControls.hideSelectAll) && isMultiple && (modifiedOptions === null || modifiedOptions === void 0 ? void 0 : modifiedOptions.length) > 1 && /*#__PURE__*/React.createElement(View, {
328
+ textInputContainerStyle: searchControls?.textInputContainerStyle,
329
+ placeholder: searchControls?.textInputProps?.placeholder || 'Search'
330
+ }, searchControls?.textInputProps)), listHeaderComponent, !listControls?.hideSelectAll && isMultiple && modifiedOptions?.length > 1 && /*#__PURE__*/React.createElement(View, {
322
331
  style: styles.optionsContainerStyle
323
332
  }, /*#__PURE__*/React.createElement(TouchableOpacity, {
324
333
  onPress: () => {}
325
334
  }, /*#__PURE__*/React.createElement(CheckBox, {
326
335
  value: selectAll,
327
- label: selectAll ? (listControls === null || listControls === void 0 ? void 0 : listControls.unselectAllText) || 'Clear all' : (listControls === null || listControls === void 0 ? void 0 : listControls.selectAllText) || 'Select all',
336
+ label: selectAll ? listControls?.unselectAllText || 'Clear all' : listControls?.selectAllText || 'Select all',
328
337
  onChange: () => handleSelectAll(),
329
338
  primaryColor: primary,
330
339
  checkboxControls: checkboxControls,
@@ -353,7 +362,7 @@ export const DropdownSelect = _ref => {
353
362
  checkboxComponent: checkboxComponent,
354
363
  checkboxControls: checkboxControls,
355
364
  listIndex: listIndex,
356
- emptyListMessage: listControls === null || listControls === void 0 ? void 0 : listControls.emptyListMessage
365
+ emptyListMessage: listControls?.emptyListMessage
357
366
  })));
358
367
  };
359
368
  const styles = StyleSheet.create({