react-native-input-select 0.28.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 +111 -35
  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 -5
  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 -5
  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 +4 -2
  53. package/package.json +1 -1
  54. package/src/components/Dropdown/Dropdown.tsx +4 -5
  55. package/src/components/Dropdown/DropdownSelectedItemsView.tsx +6 -2
  56. package/src/index.tsx +4 -0
  57. package/src/types/index.types.ts +3 -1
package/README.md CHANGED
@@ -7,15 +7,17 @@ A fully customizable dropdown selection package for react-native android and iOS
7
7
  ## Installation
8
8
 
9
9
  With npm
10
+
10
11
  ```sh
11
12
  npm install react-native-input-select
12
13
  ```
14
+
13
15
  With yarn
14
16
 
15
17
  ```sh
16
18
  yarn add react-native-input-select
17
19
  ```
18
-
20
+
19
21
  ## Basic Usage
20
22
 
21
23
  ```js
@@ -26,44 +28,116 @@ export default function App() {
26
28
  const [country, setCountry] = React.useState();
27
29
 
28
30
  return (
29
- <Dropdown
30
- label="Country"
31
- placeholder="Select an option..."
32
- options={[
33
- { name: 'Albania', code: 'AL' },
34
- { name: 'Åland Islands', code: 'AX' },
35
- { name: 'Algeria', code: 'DZ' },
36
- { name: 'American Samoa', code: 'AS' },
37
- { name: 'Andorra', code: 'AD' },
38
- { name: 'Angola', code: 'AO' },
39
- { name: 'Anguilla', code: 'AI' },
40
- { name: 'Antarctica', code: 'AQ' },
41
- { name: 'Antigua and Barbuda', code: 'AG' },
42
- ]}
43
- optionLabel={'name'}
44
- optionValue={'code'}
45
- selectedValue={country}
46
- onValueChange={(value) => setCountry(value)}
47
- primaryColor={'green'}
48
- />
31
+ <Dropdown
32
+ label="Country"
33
+ placeholder="Select an option..."
34
+ options={[
35
+ { name: 'Albania', code: 'AL' },
36
+ { name: 'Åland Islands', code: 'AX' },
37
+ { name: 'Algeria', code: 'DZ' },
38
+ { name: 'American Samoa', code: 'AS' },
39
+ { name: 'Andorra', code: 'AD' },
40
+ { name: 'Angola', code: 'AO' },
41
+ { name: 'Anguilla', code: 'AI' },
42
+ { name: 'Antarctica', code: 'AQ' },
43
+ { name: 'Antigua and Barbuda', code: 'AG' },
44
+ ]}
45
+ optionLabel={'name'}
46
+ optionValue={'code'}
47
+ selectedValue={country}
48
+ onValueChange={(value) => setCountry(value)}
49
+ primaryColor={'green'}
50
+ />
49
51
  );
50
52
  }
51
53
  ```
52
- For more examples visit our [wiki page](https://github.com/azeezat/react-native-select/wiki)
53
54
 
55
+ ## Advanced Usage
56
+
57
+ ```js
58
+ import React from 'react';
59
+ import Dropdown from 'react-native-input-select';
60
+
61
+ export default function App() {
62
+ const [country, setCountry] = React.useState();
63
+
64
+ return (
65
+ <Dropdown
66
+ label="Customized components in list"
67
+ placeholder="Select multiple options..."
68
+ options={countries.slice(0, 3)}
69
+ optionLabel={'name'}
70
+ optionValue={'code'}
71
+ selectedValue={country}
72
+ onValueChange={(itemValue: any) => setCountry(itemValue)}
73
+ isMultiple
74
+ primaryColor={'orange'}
75
+ dropdownStyle={{
76
+ borderWidth: 0, // To remove border, set borderWidth to 0
77
+ }}
78
+ placeholderStyle={{
79
+ color: 'purple',
80
+ fontSize: 15,
81
+ fontWeight: '500',
82
+ }}
83
+ labelStyle={{ color: 'teal', fontSize: 15, fontWeight: '500' }}
84
+ dropdownHelperTextStyle={{
85
+ color: 'green',
86
+ fontWeight: '900',
87
+ }}
88
+ modalBackgroundStyle={{
89
+ backgroundColor: 'rgba(196, 198, 246, 0.5)',
90
+ }}
91
+ helperText="The placeholder has been styled"
92
+ checkboxSize={20}
93
+ checkboxStyle={{
94
+ backgroundColor: 'purple',
95
+ borderRadius: 30, // To get a circle - add the checkboxSize and the padding size
96
+ padding: 10,
97
+ }}
98
+ checkboxLabelStyle={{ color: 'red', fontSize: 30 }}
99
+ listHeaderComponent={
100
+ <View style={styles.customComponentContainer}>
101
+ <Text style={styles.text}>
102
+ 💡 You can add any component to the top of this list
103
+ </Text>
104
+ <View style={styles.fixToText}>
105
+ <Button
106
+ title="Left button"
107
+ onPress={() => Alert.alert('Left button pressed')}
108
+ color="#007AFF"
109
+ />
110
+ <Button
111
+ title="Right button"
112
+ onPress={() => Alert.alert('Right button pressed')}
113
+ />
114
+ </View>
115
+ </View>
116
+ }
117
+ listFooterComponent={
118
+ <View style={styles.customComponentContainer}>
119
+ <Text>You can add any component to the bottom of this list</Text>
120
+ </View>
121
+ }
122
+ />
123
+ );
124
+ }
125
+ ```
126
+
127
+ For more examples visit our [wiki page](https://github.com/azeezat/react-native-select/wiki)
54
128
 
55
129
  # iOS
56
- | | | |
57
- |:-------------------------:|:-------------------------:|:-------------------------:|
58
- |<img width="529" alt="Screenshot 2023-03-23 at 5 11 54 PM" src="https://user-images.githubusercontent.com/9849221/227392644-a039424a-9bdf-4253-b984-7b043e4a9545.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 00 19 PM" src="https://user-images.githubusercontent.com/9849221/227391036-44b5e935-bc5e-48d6-a3a9-7a285a4879fd.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 00 29 PM" src="https://user-images.githubusercontent.com/9849221/227391040-45772980-e51c-4ebf-aabf-30886ff06e7c.png">|
59
- |<img width="529" alt="Screenshot 2023-03-23 at 5 00 35 PM" src="https://user-images.githubusercontent.com/9849221/227391043-9e5fe1aa-86aa-438c-9e84-8c38975d3d57.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 11 54 PM" src="https://user-images.githubusercontent.com/9849221/227391594-f672b97a-c3c0-466c-b615-a887e4a8a6c0.png">| <img width="529" alt="Screenshot 2023-04-06 at 5 26 46 PM" src="https://user-images.githubusercontent.com/9849221/230516858-b11168be-3144-4914-a31a-15663c5d0404.png">|
60
130
 
131
+ | | | |
132
+ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
133
+ | <img width="529" alt="Screenshot 2023-04-18 at 10 06 15 AM" src="https://user-images.githubusercontent.com/9849221/232854077-d5f8436a-55d8-4826-af44-5a7d47626765.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 00 19 PM" src="https://user-images.githubusercontent.com/9849221/227391036-44b5e935-bc5e-48d6-a3a9-7a285a4879fd.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 00 29 PM" src="https://user-images.githubusercontent.com/9849221/227391040-45772980-e51c-4ebf-aabf-30886ff06e7c.png"> |
134
+ | <img width="529" alt="Screenshot 2023-03-23 at 5 00 35 PM" src="https://user-images.githubusercontent.com/9849221/227391043-9e5fe1aa-86aa-438c-9e84-8c38975d3d57.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 11 54 PM" src="https://user-images.githubusercontent.com/9849221/227391594-f672b97a-c3c0-466c-b615-a887e4a8a6c0.png"> | <img width="529" alt="Screenshot 2023-04-06 at 5 26 46 PM" src="https://user-images.githubusercontent.com/9849221/230516858-b11168be-3144-4914-a31a-15663c5d0404.png"> |
61
135
 
62
136
  # Android
63
- | | | |
64
- |:-------------------------:|:-------------------------:|:-------------------------:|
65
- |<img width="456" alt="Screenshot 2023-03-23 at 5 25 07 PM" src="https://user-images.githubusercontent.com/9849221/227393546-3aba8a28-f437-4f8f-9611-bf300c5af8f2.png"> | <img width="456" alt="Screenshot 2023-03-23 at 5 26 58 PM" src="https://user-images.githubusercontent.com/9849221/227393548-28796d7b-9760-43a9-8ed3-fb1618cd1b7d.png"> | <img width="456" alt="Screenshot 2023-03-23 at 5 28 49 PM" src="https://user-images.githubusercontent.com/9849221/227393554-91ed1a92-d229-4814-84d8-5f9095e8d048.png">|
66
137
 
138
+ | | | |
139
+ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
140
+ | <img width="456" alt="Screenshot 2023-03-23 at 5 25 07 PM" src="https://user-images.githubusercontent.com/9849221/227393546-3aba8a28-f437-4f8f-9611-bf300c5af8f2.png"> | <img width="456" alt="Screenshot 2023-03-23 at 5 26 58 PM" src="https://user-images.githubusercontent.com/9849221/227393548-28796d7b-9760-43a9-8ed3-fb1618cd1b7d.png"> | <img width="456" alt="Screenshot 2023-03-23 at 5 28 49 PM" src="https://user-images.githubusercontent.com/9849221/227393554-91ed1a92-d229-4814-84d8-5f9095e8d048.png"> |
67
141
 
68
142
  ## Props
69
143
 
@@ -75,18 +149,20 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
75
149
  | optionLabel | `string` | `name` |
76
150
  | optionValue | `string` | `code` |
77
151
  | error | `string` | `This is a required field` |
78
- | helperText | `string` | `Only countries in the east are listed` |
152
+ | helperText | `string` | `Only few countries are listed` |
79
153
  | selectedValue | `string` or `Array` | `AL` or `[AL, AX]` |
80
154
  | onValueChange | `function` | `()=>{}` |
81
155
  | isMultiple | `Boolean` | `true` |
82
156
  | isSearchable | `Boolean` | `true` |
83
157
  | disabled | `Boolean` | `true` |
158
+ | dropdownIcon | `React Component` | `Image` or `<Text> Show <Text>` |
84
159
  | labelStyle | `Object` | `{color: 'red', fontSize: 15, fontWeight: '500'}` |
85
- | placeholderStyle | `Object` | `{color: 'red', fontSize: 15, fontWeight: '500'}` |
160
+ | placeholderStyle | `Object` | `{color: 'blue', fontSize: 15, fontWeight: '500'}` |
86
161
  | dropdownStyle | `Object` | `{borderColor: 'blue', margin: 5, borderWidth:0 ...}` |
87
162
  | dropdownContainerStyle | `Object` | `{backgroundColor: 'red', width: '30%', ...}` |
163
+ | dropdownIconStyle | `Object` | `{top: 10 , right: 10, ...}` |
88
164
  | searchInputStyle | `Object` | `{backgroundColor: 'red', borderRadius: 0, ...}` |
89
- | selectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
165
+ | selectedItemStyle | `Object` | `{fontWeight: '600', color: 'yellow', ...}` |
90
166
  | multipleSelectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
91
167
  | modalBackgroundStyle | `Object` | `{backgroundColor: 'rgba(196, 198, 246, 0.5)'}` |
92
168
  | modalOptionsContainer | `Object` | `{padding: 5}` |
@@ -97,8 +173,8 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
97
173
  | checkboxSize | `number` | `20` |
98
174
  | checkboxStyle | `Object` | `{backgroundColor: 'blue', borderRadius: 30, padding: 10}` |
99
175
  | checkboxLabelStyle | `Object` | `{color: 'red', fontWeight:'500'}` |
100
- | listHeaderComponent | `React Component` | `<Text You can add any component to the top of this list <Text>` |
101
- | listFooterComponent | `React Component` | `<Text You can add any component to the bottom of this list <Text>` |
176
+ | listHeaderComponent | `React Component` | `<Text> You can add any component to the top of this list <Text>` |
177
+ | listFooterComponent | `React Component` | `<Text> You can add any component to the bottom of this list <Text>` |
102
178
 
103
179
  ## Contributing
104
180
 
@@ -109,5 +185,5 @@ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the
109
185
  MIT
110
186
 
111
187
  # Video Demo
112
- https://user-images.githubusercontent.com/9849221/230516294-a1aca5a7-65f5-4d9c-9b7f-a057807cf35f.mov
113
188
 
189
+ https://user-images.githubusercontent.com/9849221/232344214-55fa5557-cfdd-42c4-a334-f93c15341b0b.mov
@@ -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,KAAAE,OAAA,EAAAF,GAAA;AAJhD;;AAOA,MAAMG,QAAQ,GAAGC,IAAA,IASI;EAAA,IATH;IAChBC,KAAK;IACLC,KAAK;IACLC,QAAQ;IACRC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC,kBAAkB;IAClBC;EACa,CAAC,GAAAR,IAAA;E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d,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,QAAQ,GAAGS,eAAOT,QAAV,GAAqBU,MAAM,CAACC,QAAP,CAAgBH;AAN1C,GAAlB;AASA,sBACE,6BAAC,sBAAD;AACE,IAAA,OAAO,EAAEH,QAAQ,GAAG,MAAMA,QAAQ,CAAC,CAACN,KAAF,CAAjB,GAA4B,IAD/C;AAEE,IAAA,KAAK,EAAE,CAACW,MAAM,CAACE,iBAAR,CAFT;AAGE,IAAA,QAAQ,EAAEZ;AAHZ,kBAKE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACU,MAAM,CAACC,QAAR,EAAkBR,aAAlB,EAAiCG,SAAjC;AAAb,kBACE,6BAAC,kBAAD;AACE,IAAA,MAAM,EAAEO,OAAO,CAAC,uBAAD,CADjB;AAEE,IAAA,KAAK,EAAE,CACL;AACEC,MAAAA,MAAM,EAAEZ,YAAY,IAAIa,wBAD1B;AAEEC,MAAAA,KAAK,EAAEd,YAAY,IAAIa;AAFzB,KADK;AAFT,IADF,CALF,EAgBGjB,KAAK,iBACJ,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACM,kBAAD,EAAqBM,MAAM,CAACO,UAA5B;AAAb,KAAuDnB,KAAvD,CAjBJ,CADF;AAsBD,CAzCD;;AA2CA,MAAMY,MAAM,GAAGQ,wBAAWC,MAAX,CAAkB;AAC/BP,EAAAA,iBAAiB,EAAE;AACjBQ,IAAAA,aAAa,EAAE,KADE;AAEjBC,IAAAA,QAAQ,EAAE,QAFO;AAGjBC,IAAAA,UAAU,EAAE;AAHK,GADY;AAM/BX,EAAAA,QAAQ,EAAE;AACRY,IAAAA,OAAO,EAAE,CADD;AAERC,IAAAA,WAAW,EAAE,CAFL;AAGRC,IAAAA,WAAW,EAAE,OAHL;AAIRC,IAAAA,YAAY,EAAE,CAJN;AAKRlB,IAAAA,WAAW,EAAE;AALL,GANqB;AAa/BS,EAAAA,UAAU,EAAE;AAAEU,IAAAA,UAAU,EAAE;AAAd;AAbmB,CAAlB,CAAf;;eAgBe9B,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,17 +69,13 @@ 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,
64
76
  color: _colors.colors.gray,
65
77
  ..._typography.typography.caption
66
78
  },
67
- inputFocusErrorState: {
68
- borderWidth: 2,
69
- borderStyle: 'solid',
70
- borderColor: _colors.colors.red
71
- },
72
79
  error: {
73
80
  color: _colors.colors.red,
74
81
  marginTop: 8,
@@ -87,6 +94,7 @@ const styles = _reactNative.StyleSheet.create({
87
94
  color: _colors.colors.black
88
95
  }
89
96
  });
97
+
90
98
  var _default = Dropdown;
91
99
  exports.default = _default;
92
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","inputFocusErrorState","borderWidth","borderStyle","borderColor","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 inputFocusErrorState: {\n borderWidth: 2,\n borderStyle: 'solid',\n borderColor: colors.red,\n },\n error: { color: colors.red, marginTop: 8, ...typography.caption },\n helper: { marginTop: 8, color: colors.primary, ...typography.caption },\n dropdownInputContainer: { marginBottom: 23, width: '100%' },\n blackText: { color: colors.black },\n});\n\nexport default Dropdown;\n"],"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,IAA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;IACpBC,WAAW,EAAEP,cAAM,CAACQ;EACtB,CAAC;EACDpC,KAAK,EAAE;IAAE2B,KAAK,EAAEC,cAAM,CAACQ,GAAG;IAAEC,SAAS,EAAE,CAAC;IAAE,GAAGP,sBAAU,CAACC;EAAQ,CAAC;EACjER,MAAM,EAAE;IAAEc,SAAS,EAAE,CAAC;IAAEV,KAAK,EAAEC,cAAM,CAACU,OAAO;IAAE,GAAGR,sBAAU,CAACC;EAAQ,CAAC;EACtEV,sBAAsB,EAAE;IAAEK,YAAY,EAAE,EAAE;IAAEa,KAAK,EAAE;EAAO,CAAC;EAC3DC,SAAS,EAAE;IAAEb,KAAK,EAAEC,cAAM,CAACa;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY/C,QAAQ;AAAAgD,OAAA,CAAAjD,OAAA,GAAAgD,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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UAAU,KAAK,EAA7B,IAAmC,CAACC,KAApC,iBACC,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACmB,MAAM,CAACE,MAAR,EAAgBL,uBAAhB;AAAb,KACGjB,UADH,CA5BJ,CADF;AAmCD,CA3DD;;AA6DA,MAAMoB,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,O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ACjCC,aAAa,EAAE2B,KAAK,CAAC3B,aAAc;IACnCC,kBAAkB,EAAE0B,KAAK,CAAC1B;EAAmB,EAC7C;AAEN,CAAC;AAED,MAAMU,MAAM,GAAGiB,uBAAU,CAACC,MAAM,CAAC;EAC/BZ,kBAAkB,EAAE;IAClBa,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,qBA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A,cAAc,EAAEsB,KAAK,CAACJ,cALxB;AAME,IAAA,QAAQ,EAAEI,KAAK,CAACH,QANlB;AAOE,IAAA,YAAY,EAAEG,KAAK,CAAChB,YAPtB;AAQE,IAAA,YAAY,EAAEgB,KAAK,CAACf,YARtB;AASE,IAAA,aAAa,EAAEe,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,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,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,gBAEY,IAAAC,WAAI,EAAC9B,gBAAgB,CAAC;AAAA+B,OAAA,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"]}