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.
- package/README.md +111 -35
- package/lib/commonjs/components/CheckBox/index.js +8 -1
- package/lib/commonjs/components/CheckBox/index.js.map +1 -1
- package/lib/commonjs/components/CheckBox/types.js.map +1 -1
- package/lib/commonjs/components/CustomModal/index.js +7 -0
- package/lib/commonjs/components/CustomModal/index.js.map +1 -1
- package/lib/commonjs/components/Dropdown/Dropdown.js +13 -5
- package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownList.js +11 -1
- package/lib/commonjs/components/Dropdown/DropdownList.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownListItem.js +13 -2
- package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js +16 -9
- package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +10 -1
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/index.js +45 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/colors.js.map +1 -1
- package/lib/commonjs/styles/input.js +4 -0
- package/lib/commonjs/styles/input.js.map +1 -1
- package/lib/commonjs/styles/typography.js +3 -0
- package/lib/commonjs/styles/typography.js.map +1 -1
- package/lib/commonjs/types/index.types.js.map +1 -1
- package/lib/module/components/CheckBox/index.js +2 -0
- package/lib/module/components/CheckBox/index.js.map +1 -1
- package/lib/module/components/CheckBox/types.js.map +1 -1
- package/lib/module/components/CustomModal/index.js +2 -0
- package/lib/module/components/CustomModal/index.js.map +1 -1
- package/lib/module/components/Dropdown/Dropdown.js +6 -5
- package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownList.js +5 -1
- package/lib/module/components/Dropdown/DropdownList.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownListItem.js +5 -2
- package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownSelectedItemsView.js +10 -9
- package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
- package/lib/module/components/Input/index.js +2 -1
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/index.js +29 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/colors.js.map +1 -1
- package/lib/module/styles/input.js.map +1 -1
- package/lib/module/styles/typography.js.map +1 -1
- package/lib/module/types/index.types.js.map +1 -1
- package/lib/typescript/components/CheckBox/types.d.ts +1 -1
- package/lib/typescript/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/typescript/components/Dropdown/DropdownSelectedItemsView.d.ts +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/types/index.types.d.ts +4 -2
- package/package.json +1 -1
- package/src/components/Dropdown/Dropdown.tsx +4 -5
- package/src/components/Dropdown/DropdownSelectedItemsView.tsx +6 -2
- package/src/index.tsx +4 -0
- 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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
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: '
|
|
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` | `{
|
|
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,"
|
|
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,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AAAA,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,"
|
|
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,"
|
|
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,"
|
|
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","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AAhB;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
|
-
|
|
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,"
|
|
1
|
+
{"version":3,"sources":["DropdownList.tsx"],"names":["DropdownList","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","rest","styles","emptyListStyle","paddingTop","contentContainerStyle","itemSeparatorStyle","item","_renderItem","selectedOption","onChange","_item","index","props","StyleSheet","create","backgroundColor","colors","gray","height","opacity","alignItems","width","marginVertical"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,QAeV;AAAA,MAfW;AACpBC,IAAAA,OADoB;AAEpBC,IAAAA,WAFoB;AAGpBC,IAAAA,WAHoB;AAIpBC,IAAAA,UAJoB;AAKpBC,IAAAA,YALoB;AAMpBC,IAAAA,aANoB;AAOpBC,IAAAA,YAPoB;AAQpBC,IAAAA,wBARoB;AASpBC,IAAAA,qBAToB;AAUpBC,IAAAA,YAVoB;AAWpBC,IAAAA,YAXoB;AAYpBC,IAAAA,aAZoB;AAapBC,IAAAA,kBAboB;AAcpB,OAAGC;AAdiB,GAeX;AACT,sBACE,6BAAC,qBAAD;AACE,IAAA,IAAI,EAAEb,OADR;AAEE,IAAA,SAAS,EAAEG,UAAU,GAAGE,aAAH,GAAmBC,YAF1C;AAGE,IAAA,kBAAkB,EAAE,CAHtB;AAIE,IAAA,kBAAkB,eAChB,6BAAC,iBAAD;AAAM,MAAA,KAAK,EAAEQ,MAAM,CAACC;AAApB,oBACE,6BAAC,iBAAD,+BADF,CALJ;AASE,IAAA,qBAAqB,EAAE,CACrBX,YAAY,GAAG;AAAEY,MAAAA,UAAU,EAAE;AAAd,KAAH,GAAuBF,MAAM,CAACG,qBADrB,CATzB;AAYE,IAAA,sBAAsB,EAAE,mBAAM,6BAAC,iBAAD;AAAM,MAAA,KAAK,EAAEH,M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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
|
|
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,"
|
|
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"]}
|