react-native-input-select 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -5
- package/lib/commonjs/components/CustomModal/index.js +1 -2
- package/lib/commonjs/components/CustomModal/index.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +7 -2
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/index.js +34 -22
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/index.types.js.map +1 -1
- package/lib/commonjs/utils/index.js +2 -12
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/CustomModal/index.js +1 -2
- package/lib/module/components/CustomModal/index.js.map +1 -1
- package/lib/module/components/Input/index.js +7 -2
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/index.js +35 -23
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/index.types.js.map +1 -1
- package/lib/module/utils/index.js +1 -10
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/CustomModal/index.d.ts +1 -1
- package/lib/typescript/components/Input/index.d.ts +1 -1
- package/lib/typescript/types/index.types.d.ts +6 -1
- package/lib/typescript/utils/index.d.ts +0 -2
- package/package.json +1 -1
- package/src/components/CustomModal/index.tsx +1 -2
- package/src/components/Input/index.tsx +7 -2
- package/src/index.tsx +43 -42
- package/src/types/index.types.ts +6 -0
- package/src/utils/index.ts +1 -17
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://nodei.co/npm/react-native-input-select/)
|
|
2
2
|
|
|
3
|
-
[](https://github.com/azeezat/react-native-select/actions/workflows/codeql.yml) [](https://github.com/azeezat/react-native-select/actions/workflows/release-and-publish-to-npm.yml)
|
|
3
|
+
[](https://badge.fury.io/js/react-native-input-select) [](https://github.com/azeezat/react-native-select/stargazers) [](https://github.com/azeezat/react-native-select/actions/workflows/codeql.yml) [](https://github.com/azeezat/react-native-select/actions/workflows/release-and-publish-to-npm.yml)
|
|
4
4
|
|
|
5
5
|
# react-native-input-select
|
|
6
6
|
|
|
@@ -237,6 +237,7 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
237
237
|
| <img width="456" alt="Screenshot 2023-05-16 at 6 17 09 AM" src="https://github.com/azeezat/react-native-select/assets/9849221/d695657f-d840-4368-b841-42af479d6543"> | <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"> |
|
|
238
238
|
|
|
239
239
|
## Props
|
|
240
|
+
|
|
240
241
|
| Proptypes | Datatype | Example |
|
|
241
242
|
| -------------------------- | ------------------------ | -------------------------------------------------------------------- |
|
|
242
243
|
| label | `string` | Countries |
|
|
@@ -257,7 +258,6 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
257
258
|
| dropdownStyle | `Object` | `{borderColor: 'blue', margin: 5, borderWidth:0 ...}` |
|
|
258
259
|
| dropdownContainerStyle | `Object` | `{backgroundColor: 'red', width: '30%', ...}` |
|
|
259
260
|
| dropdownIconStyle | `Object` | `{top: 10 , right: 10, ...}` |
|
|
260
|
-
| searchInputStyle | `Object` | `{backgroundColor: 'red', borderRadius: 0, ...}` |
|
|
261
261
|
| selectedItemStyle | `Object` | `{fontWeight: '600', color: 'yellow', ...}` |
|
|
262
262
|
| multipleSelectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
|
|
263
263
|
| modalBackgroundStyle | `Object` | `{backgroundColor: 'rgba(196, 198, 246, 0.5)'}` |
|
|
@@ -271,9 +271,10 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
271
271
|
| listFooterComponent | `React Component` | `<Text> You can add any component here <Text>` |
|
|
272
272
|
| hideModal | `Boolean` | Use this to hide the modal as needed |
|
|
273
273
|
| listComponentStyles | `Object` | `{listEmptyComponentStyle: ViewStyle, itemSeparatorStyle: ViewStyle, sectionHeaderStyle: TextStyle}` |
|
|
274
|
-
| checkboxComponentStyles | `Object` | `{checkboxSize
|
|
274
|
+
| checkboxComponentStyles | `Object` | `{checkboxSize: number, checkboxStyle: ViewStyle, checkboxLabelStyle: TextStyle}` |
|
|
275
275
|
| checkboxComponent | `React Component` | `<View style={styles.radioButton} />` |
|
|
276
|
-
| listControls
|
|
276
|
+
| listControls | `Object` | `{ selectAllText: 'Choose all', unselectAllText: 'Remove all', selectAllCallback: () => {}, unselectAllCallback: () => {}}` |
|
|
277
|
+
| searchControls | `Object` | `{ textInputStyle: ViewStyle \| TextStyle, textInputContainerStyle: ViewStyle, textInputProps: TextInputProps}` |
|
|
277
278
|
|
|
278
279
|
## Deprecation Notice
|
|
279
280
|
|
|
@@ -282,7 +283,7 @@ The following props would be removed in coming releases.
|
|
|
282
283
|
- Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle` would be replaced with a single object `checkboxComponentStyles` e.g
|
|
283
284
|
|
|
284
285
|
```js
|
|
285
|
-
|
|
286
|
+
checkboxComponentStyles = {
|
|
286
287
|
checkboxSize: 20,
|
|
287
288
|
checkboxStyle: {
|
|
288
289
|
backgroundColor: 'purple',
|
|
@@ -294,6 +295,31 @@ const checkboxComponentStyles = {
|
|
|
294
295
|
};
|
|
295
296
|
```
|
|
296
297
|
|
|
298
|
+
- `searchInputStyle` would now be inside replaced with `textInputStyle` in the `searchControls` object
|
|
299
|
+
|
|
300
|
+
```js
|
|
301
|
+
searchControls={
|
|
302
|
+
textInputStyle: {
|
|
303
|
+
color: 'blue',
|
|
304
|
+
fontWeight: '500',
|
|
305
|
+
minHeight: 10,
|
|
306
|
+
paddingVertical: 10,
|
|
307
|
+
paddingHorizontal: 5,
|
|
308
|
+
width: '50%',
|
|
309
|
+
textAlign: 'center',
|
|
310
|
+
},
|
|
311
|
+
textInputContainerStyle: {
|
|
312
|
+
flex: 1,
|
|
313
|
+
justifyContent: 'center',
|
|
314
|
+
alignItems: 'center',
|
|
315
|
+
},
|
|
316
|
+
textInputProps: {
|
|
317
|
+
placeholder: 'Search anything here',
|
|
318
|
+
placeholderTextColor: 'gray',
|
|
319
|
+
},
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
297
323
|
## Contributing
|
|
298
324
|
|
|
299
325
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
@@ -12,7 +12,6 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
12
12
|
const CustomModal = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
open,
|
|
15
|
-
handleToggleModal,
|
|
16
15
|
onRequestClose,
|
|
17
16
|
modalBackgroundStyle,
|
|
18
17
|
modalOptionsContainerStyle,
|
|
@@ -25,7 +24,7 @@ const CustomModal = _ref => {
|
|
|
25
24
|
onRequestClose: () => onRequestClose(),
|
|
26
25
|
animationType: "fade"
|
|
27
26
|
}, modalProps), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
28
|
-
onPress: () =>
|
|
27
|
+
onPress: () => onRequestClose(),
|
|
29
28
|
style: [styles.modalContainer, styles.modalBackgroundStyle, modalBackgroundStyle]
|
|
30
29
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
31
30
|
style: [styles.modalOptionsContainer, modalOptionsContainerStyle]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","CustomModal","_ref","open","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","CustomModal","_ref","open","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","modalProps","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 onRequestClose,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n modalProps,\n children,\n}: any) => {\n return (\n <Modal\n transparent={true}\n visible={open}\n onRequestClose={() => onRequestClose()}\n animationType=\"fade\"\n {...modalProps}\n >\n <TouchableOpacity\n onPress={() => onRequestClose()}\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;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC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c,EAAE;EAClB,CAAC;EACDnB,oBAAoB,EAAE;IAAEoB,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,CAAA9C,OAAA,GAAA6C,QAAA"}
|
|
@@ -17,11 +17,13 @@ const Input = _ref => {
|
|
|
17
17
|
onChangeText,
|
|
18
18
|
style,
|
|
19
19
|
primaryColor,
|
|
20
|
+
textInputContainerStyle,
|
|
21
|
+
openModal,
|
|
20
22
|
...rest
|
|
21
23
|
} = _ref;
|
|
22
24
|
const [isFocused, setFocus] = (0, _react.useState)(false);
|
|
23
25
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
24
|
-
style: styles.container
|
|
26
|
+
style: [styles.container, textInputContainerStyle]
|
|
25
27
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, _extends({
|
|
26
28
|
placeholder: placeholder,
|
|
27
29
|
style: [_input.inputStyles.input, _reactNative.Platform.select({
|
|
@@ -31,7 +33,10 @@ const Input = _ref => {
|
|
|
31
33
|
}), isFocused && {
|
|
32
34
|
borderColor: primaryColor
|
|
33
35
|
}, style],
|
|
34
|
-
onFocus: () =>
|
|
36
|
+
onFocus: () => {
|
|
37
|
+
setFocus(true);
|
|
38
|
+
openModal();
|
|
39
|
+
},
|
|
35
40
|
onBlur: () => setFocus(false),
|
|
36
41
|
value: value,
|
|
37
42
|
onChangeText: onChangeText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_input","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","Input","_ref","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","useState","createElement","View","styles","container","TextInput","inputStyles","input","Platform","select","web","outlineColor","borderColor","onFocus","onBlur","exports","StyleSheet","create","margin","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={styles.container}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => setFocus(true)}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,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NodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","Input","_ref","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","openModal","rest","isFocused","setFocus","useState","createElement","View","styles","container","TextInput","inputStyles","input","Platform","select","web","outlineColor","borderColor","onFocus","onBlur","exports","StyleSheet","create","margin","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n textInputContainerStyle,\n openModal,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n openModal();\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GA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GED
|
@@ -46,6 +46,7 @@ const DropdownSelect = _ref => {
|
|
|
46
46
|
modalBackgroundStyle,
|
|
47
47
|
modalOptionsContainerStyle,
|
|
48
48
|
searchInputStyle,
|
|
49
|
+
// kept for backwards compatibility
|
|
49
50
|
primaryColor,
|
|
50
51
|
disabled,
|
|
51
52
|
checkboxSize,
|
|
@@ -62,6 +63,7 @@ const DropdownSelect = _ref => {
|
|
|
62
63
|
modalProps,
|
|
63
64
|
hideModal = false,
|
|
64
65
|
listControls,
|
|
66
|
+
searchControls,
|
|
65
67
|
...rest
|
|
66
68
|
} = _ref;
|
|
67
69
|
const [newOptions, setNewOptions] = (0, _react.useState)([]);
|
|
@@ -74,10 +76,11 @@ const DropdownSelect = _ref => {
|
|
|
74
76
|
itemIndex: 0
|
|
75
77
|
}); // for scrollToIndex in Sectionlist and Flatlist
|
|
76
78
|
|
|
79
|
+
if (!options || options.length === 0) {
|
|
80
|
+
throw new Error('Options array cannot be empty or undefined');
|
|
81
|
+
}
|
|
77
82
|
(0, _react.useEffect)(() => {
|
|
78
|
-
|
|
79
|
-
setNewOptions(options);
|
|
80
|
-
}
|
|
83
|
+
setNewOptions(options);
|
|
81
84
|
return () => {};
|
|
82
85
|
}, [options]);
|
|
83
86
|
(0, _react.useEffect)(() => {
|
|
@@ -89,13 +92,19 @@ const DropdownSelect = _ref => {
|
|
|
89
92
|
* List type
|
|
90
93
|
*==========================================*/
|
|
91
94
|
|
|
95
|
+
// check the structure of the new options array to determine if it is a section list or a
|
|
92
96
|
const isSectionList = newOptions.some(item => item.title && item.data && Array.isArray(item.data));
|
|
93
97
|
const ListTypeComponent = isSectionList ? _DropdownSectionList.default : _DropdownFlatList.default;
|
|
94
98
|
const modifiedSectionData = (0, _utils.extractPropertyFromArray)(newOptions, 'data').flat();
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
*`modifiedOptions` should only be used for computations newOptions remains the default array.
|
|
102
|
+
* At this point modifiedOptions now has the same structure for both `FlatList` and `SectionList`
|
|
103
|
+
*/
|
|
95
104
|
const modifiedOptions = isSectionList ? modifiedSectionData : newOptions;
|
|
96
105
|
const optLabel = optionLabel || _constants.DEFAULT_OPTION_LABEL;
|
|
97
106
|
const optValue = optionValue || _constants.DEFAULT_OPTION_VALUE;
|
|
98
|
-
const optionsCopy = JSON.parse(JSON.stringify(options)); //copy of the original options array
|
|
107
|
+
const optionsCopy = JSON.parse(JSON.stringify(options)); // copy of the original options array
|
|
99
108
|
|
|
100
109
|
/*===========================================
|
|
101
110
|
* Selection handlers
|
|
@@ -103,11 +112,11 @@ const DropdownSelect = _ref => {
|
|
|
103
112
|
const handleSingleSelection = value => {
|
|
104
113
|
if (selectedItem === value) {
|
|
105
114
|
setSelectedItem(null);
|
|
106
|
-
onValueChange(null); //send value to parent
|
|
115
|
+
onValueChange(null); // send value to parent
|
|
107
116
|
} else {
|
|
108
117
|
setSelectedItem(value);
|
|
109
|
-
onValueChange(value); //send value to parent
|
|
110
|
-
setOpen(false); //close modal upon selection
|
|
118
|
+
onValueChange(value); // send value to parent
|
|
119
|
+
setOpen(false); // close modal upon selection
|
|
111
120
|
}
|
|
112
121
|
};
|
|
113
122
|
|
|
@@ -120,23 +129,26 @@ const DropdownSelect = _ref => {
|
|
|
120
129
|
} else {
|
|
121
130
|
selectedValues.push(value);
|
|
122
131
|
}
|
|
123
|
-
onValueChange(selectedValues); //send value to parent
|
|
132
|
+
onValueChange(selectedValues); // send value to parent
|
|
124
133
|
return selectedValues;
|
|
125
134
|
});
|
|
126
135
|
};
|
|
136
|
+
const removeDisabledItems = items => {
|
|
137
|
+
return items.filter(item => !item.disabled);
|
|
138
|
+
};
|
|
127
139
|
const handleSelectAll = () => {
|
|
128
140
|
setSelectAll(prevVal => {
|
|
129
141
|
const selectedValues = [];
|
|
130
142
|
|
|
131
|
-
//don't select disabled items
|
|
132
|
-
const filteredOptions =
|
|
143
|
+
// don't select disabled items
|
|
144
|
+
const filteredOptions = removeDisabledItems(isSectionList ? (0, _utils.extractPropertyFromArray)(optionsCopy, 'data').flat() : optionsCopy);
|
|
133
145
|
if (!prevVal) {
|
|
134
146
|
for (let i = 0; i < filteredOptions.length; i++) {
|
|
135
147
|
selectedValues.push(filteredOptions[i][optValue]);
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
setSelectedItems(selectedValues);
|
|
139
|
-
onValueChange(selectedValues); //send value to parent
|
|
151
|
+
onValueChange(selectedValues); // send value to parent
|
|
140
152
|
return !prevVal;
|
|
141
153
|
});
|
|
142
154
|
if (typeof (listControls === null || listControls === void 0 ? void 0 : listControls.selectAllCallback) === 'function' && !selectAll) {
|
|
@@ -152,7 +164,7 @@ const DropdownSelect = _ref => {
|
|
|
152
164
|
*==========================================*/
|
|
153
165
|
const checkSelectAll = (0, _react.useCallback)(selectedValues => {
|
|
154
166
|
//if the list contains disabled values, those values will not be selected
|
|
155
|
-
if (modifiedOptions
|
|
167
|
+
if (removeDisabledItems(modifiedOptions).length === selectedValues.length) {
|
|
156
168
|
setSelectAll(true);
|
|
157
169
|
} else {
|
|
158
170
|
setSelectAll(false);
|
|
@@ -192,14 +204,14 @@ const DropdownSelect = _ref => {
|
|
|
192
204
|
let searchText = value.toString().toLocaleLowerCase().trim();
|
|
193
205
|
const regexFilter = new RegExp(searchText, 'i');
|
|
194
206
|
|
|
195
|
-
//Because
|
|
207
|
+
// Because the options array will be mutated after Search, we have to search with a copy of the original array
|
|
196
208
|
const searchResults = isSectionList ? searchSectionList(optionsCopy, regexFilter) : searchFlatList(optionsCopy, regexFilter);
|
|
197
209
|
setNewOptions(searchResults);
|
|
198
210
|
};
|
|
199
211
|
const searchFlatList = (flatList, regexFilter) => {
|
|
200
212
|
const searchResults = flatList.filter(item => {
|
|
201
213
|
if (item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 || item[optValue].toString().toLowerCase().search(regexFilter) !== -1) {
|
|
202
|
-
return
|
|
214
|
+
return true;
|
|
203
215
|
}
|
|
204
216
|
return;
|
|
205
217
|
});
|
|
@@ -237,8 +249,6 @@ const DropdownSelect = _ref => {
|
|
|
237
249
|
return () => {};
|
|
238
250
|
}, [hideModal]);
|
|
239
251
|
let primary = primaryColor || _colors.colors.gray;
|
|
240
|
-
const sectionListMaxLength = (0, _utils.getMaxLengthOfSectionListProperty)(newOptions, 'data');
|
|
241
|
-
const listIsEmpty = isSectionList ? sectionListMaxLength > 1 : newOptions.length > 1;
|
|
242
252
|
|
|
243
253
|
/*===========================================
|
|
244
254
|
* setIndexOfSelectedItem - For ScrollToIndex
|
|
@@ -288,18 +298,20 @@ const DropdownSelect = _ref => {
|
|
|
288
298
|
setIndexOfSelectedItem: setIndexOfSelectedItem
|
|
289
299
|
}, rest)), /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
290
300
|
open: open,
|
|
291
|
-
handleToggleModal: handleToggleModal,
|
|
292
301
|
modalBackgroundStyle: modalBackgroundStyle,
|
|
293
302
|
modalOptionsContainerStyle: modalOptionsContainerStyle,
|
|
294
|
-
onRequestClose: () =>
|
|
303
|
+
onRequestClose: () => handleToggleModal(),
|
|
295
304
|
modalProps: modalProps
|
|
296
305
|
}, /*#__PURE__*/_react.default.createElement(ListTypeComponent, {
|
|
297
|
-
|
|
306
|
+
removeClippedSubviews: false,
|
|
307
|
+
ListHeaderComponent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isSearchable && /*#__PURE__*/_react.default.createElement(_Input.default, _extends({
|
|
298
308
|
value: searchValue,
|
|
299
309
|
onChangeText: text => onSearch(text),
|
|
300
|
-
style: searchInputStyle,
|
|
301
|
-
primaryColor: primary
|
|
302
|
-
|
|
310
|
+
style: (searchControls === null || searchControls === void 0 ? void 0 : searchControls.textInputStyle) || searchInputStyle,
|
|
311
|
+
primaryColor: primary,
|
|
312
|
+
textInputContainerStyle: searchControls === null || searchControls === void 0 ? void 0 : searchControls.textInputContainerStyle,
|
|
313
|
+
openModal: () => setOpen(true) // There seems to a known issue on expo web that closes the modal when the input is focused
|
|
314
|
+
}, searchControls === null || searchControls === void 0 ? void 0 : searchControls.textInputProps)), listHeaderComponent, isMultiple && modifiedOptions.length > 1 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
303
315
|
style: styles.optionsContainerStyle
|
|
304
316
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
305
317
|
onPress: () => {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Input","_interopRequireDefault","_CheckBox","_Dropdown","_DropdownFlatList","_DropdownSectionList","_CustomModal","_colors","_constants","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSelect","_ref","placeholder","label","error","helperText","options","optionLabel","optionValue","onValueChange","selectedValue","isMultiple","isSearchable","dropdownIcon","labelStyle","placeholderStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","selectedItemStyle","multipleSelectedItemStyle","modalBackgroundStyle","modalOptionsContainerStyle","searchInputStyle","primaryColor","disabled","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","listHeaderComponent","listFooterComponent","listComponentStyles","modalProps","hideModal","listControls","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","searchValue","setSearchValue","listIndex","setListIndex","itemIndex","useEffect","Array","isArray","isSectionList","some","item","title","data","ListTypeComponent","DropdownSectionList","DropdownFlatList","modifiedSectionData","extractPropertyFromArray","flat","modifiedOptions","optLabel","DEFAULT_OPTION_LABEL","optValue","DEFAULT_OPTION_VALUE","optionsCopy","JSON","parse","stringify","handleSingleSelection","value","handleMultipleSelections","prevVal","_selectedValues","selectedValues","includes","filter","push","handleSelectAll","filteredOptions","selectAllCallback","unselectAllCallback","checkSelectAll","useCallback","getSelectedItemsLabel","selectedLabels","forEach","element","_modifiedOptions$find","selectedItemLabel","find","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","searchSectionList","searchFlatList","flatList","toLowerCase","search","sectionList","map","listItem","handleToggleModal","sectionIndex","primary","colors","gray","sectionListMaxLength","getMaxLengthOfSectionListProperty","listIsEmpty","setIndexOfSelectedItem","selectedLabel","_item$data","dataItem","createElement","Fragment","onRequestClose","ListHeaderComponent","onChangeText","text","style","View","styles","optionsContainerStyle","TouchableOpacity","onPress","unselectAllText","selectAllText","onChange","ListFooterComponent","exports","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport { TouchableOpacity, StyleSheet, View } from 'react-native';\nimport Input from './components/Input';\nimport CheckBox from './components/CheckBox';\nimport Dropdown from './components/Dropdown/Dropdown';\nimport DropdownFlatList from './components/Dropdown/DropdownFlatList';\nimport DropdownSectionList from './components/Dropdown/DropdownSectionList';\nimport CustomModal from './components/CustomModal';\nimport { colors } from './styles/colors';\nimport { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';\nimport type {\n DropdownProps,\n TFlatList,\n TFlatListItem,\n TSectionList,\n TSectionListItem,\n} from './types/index.types';\nimport {\n extractPropertyFromArray,\n getMaxLengthOfSectionListProperty,\n} from './utils';\n\nexport const DropdownSelect: React.FC<DropdownProps> = ({\n placeholder,\n label,\n error,\n helperText,\n options,\n optionLabel,\n optionValue,\n onValueChange,\n selectedValue,\n isMultiple,\n isSearchable,\n dropdownIcon,\n labelStyle,\n placeholderStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n searchInputStyle,\n primaryColor,\n disabled,\n checkboxSize, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n checkboxComponent,\n listHeaderComponent,\n listFooterComponent,\n listComponentStyles,\n modalProps,\n hideModal = false,\n listControls,\n ...rest\n}) => {\n const [newOptions, setNewOptions] = useState<TFlatList | TSectionList>([]);\n const [open, setOpen] = useState<boolean>(false);\n const [selectAll, setSelectAll] = useState<boolean>(false);\n const [selectedItem, setSelectedItem] = useState<any>(''); // for single selection\n const [selectedItems, setSelectedItems] = useState<any[]>([]); // for multiple selection\n const [searchValue, setSearchValue] = useState<string>('');\n const [listIndex, setListIndex] = useState<{\n sectionIndex?: number;\n itemIndex: number;\n }>({ itemIndex: 0 }); // for scrollToIndex in Sectionlist and Flatlist\n\n useEffect(() => {\n if (options) {\n setNewOptions(options);\n }\n return () => {};\n }, [options]);\n\n useEffect(() => {\n isMultiple\n ? setSelectedItems(Array.isArray(selectedValue) ? selectedValue : [])\n : setSelectedItem(selectedValue);\n\n return () => {};\n }, [selectedValue, isMultiple, onValueChange]);\n\n /*===========================================\n * List type\n *==========================================*/\n\n const isSectionList = newOptions.some(\n (item) => item.title && item.data && Array.isArray(item.data)\n );\n\n const ListTypeComponent = isSectionList\n ? DropdownSectionList\n : DropdownFlatList;\n const modifiedSectionData = extractPropertyFromArray(\n newOptions,\n 'data'\n ).flat();\n const modifiedOptions = isSectionList ? modifiedSectionData : newOptions;\n\n const optLabel = optionLabel || DEFAULT_OPTION_LABEL;\n const optValue = optionValue || DEFAULT_OPTION_VALUE;\n const optionsCopy = JSON.parse(JSON.stringify(options)); //copy of the original options array\n\n /*===========================================\n * Selection handlers\n *==========================================*/\n const handleSingleSelection = (value: string | number) => {\n if (selectedItem === value) {\n setSelectedItem(null);\n onValueChange(null); //send value to parent\n } else {\n setSelectedItem(value);\n onValueChange(value); //send value to parent\n setOpen(false); //close modal upon selection\n }\n };\n\n const handleMultipleSelections = (value: string[] | number[]) => {\n setSelectedItems((prevVal) => {\n let selectedValues = [...prevVal];\n\n if (selectedValues?.includes(value)) {\n selectedValues = selectedValues.filter((item) => item !== value);\n } else {\n selectedValues.push(value);\n }\n onValueChange(selectedValues); //send value to parent\n return selectedValues;\n });\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n //don't select disabled items\n const filteredOptions = modifiedOptions.filter(\n (item: TFlatListItem) => !item.disabled\n );\n\n if (!prevVal) {\n for (let i = 0; i < filteredOptions.length; i++) {\n selectedValues.push(filteredOptions[i][optValue]);\n }\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n return !prevVal;\n });\n\n if (\n typeof listControls?.selectAllCallback === 'function' &&\n !selectAll\n ) {\n listControls.selectAllCallback();\n }\n\n if (\n typeof listControls?.unselectAllCallback === 'function' &&\n selectAll\n ) {\n listControls.unselectAllCallback();\n }\n };\n\n /*===========================================\n * Handle side effects\n *==========================================*/\n const checkSelectAll = useCallback(\n (selectedValues: any[]) => {\n //if the list contains disabled values, those values will not be selected\n if (\n modifiedOptions.filter((item: TFlatListItem) => !item.disabled)\n .length === selectedValues.length\n ) {\n setSelectAll(true);\n } else {\n setSelectAll(false);\n }\n },\n [modifiedOptions]\n );\n\n // anytime the selected items change, check if it is time to set `selectAll` to true\n useEffect(() => {\n if (isMultiple) {\n checkSelectAll(selectedItems);\n }\n return () => {};\n }, [checkSelectAll, isMultiple, selectedItems]);\n\n /*===========================================\n * Get label handler\n *==========================================*/\n const getSelectedItemsLabel = () => {\n if (isMultiple && Array.isArray(selectedItems)) {\n let selectedLabels: Array<string> = [];\n\n selectedItems?.forEach((element: number | string) => {\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === element\n )?.[optLabel];\n selectedLabels.push(selectedItemLabel);\n });\n return selectedLabels;\n }\n\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === selectedItem\n );\n return selectedItemLabel?.[optLabel];\n };\n\n /*===========================================\n * Search\n *==========================================*/\n const onSearch = (value: string) => {\n setSearchValue(value);\n\n let searchText = value.toString().toLocaleLowerCase().trim();\n\n const regexFilter = new RegExp(searchText, 'i');\n\n //Because Search mutates the initial state, we have to search with a copy of the original array\n const searchResults = isSectionList\n ? searchSectionList(optionsCopy as TSectionList, regexFilter)\n : searchFlatList(optionsCopy as TFlatList, regexFilter);\n\n setNewOptions(searchResults);\n };\n\n const searchFlatList = (flatList: TFlatList, regexFilter: RegExp) => {\n const searchResults = flatList.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return item;\n }\n return;\n });\n return searchResults;\n };\n\n const searchSectionList = (\n sectionList: TSectionList,\n regexFilter: RegExp\n ) => {\n const searchResults = sectionList.map((listItem: TSectionListItem) => {\n listItem.data = listItem.data.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return listItem.data.push(item);\n }\n return;\n });\n\n return listItem;\n });\n\n return searchResults;\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n setListIndex({ itemIndex: 0, sectionIndex: 0 });\n };\n\n useEffect(() => {\n if (hideModal) {\n setOpen(false);\n }\n return () => {};\n }, [hideModal]);\n\n let primary = primaryColor || colors.gray;\n\n const sectionListMaxLength = getMaxLengthOfSectionListProperty(\n newOptions as TSectionList,\n 'data'\n );\n\n const listIsEmpty = isSectionList\n ? sectionListMaxLength > 1\n : newOptions.length > 1;\n\n /*===========================================\n * setIndexOfSelectedItem - For ScrollToIndex\n *==========================================*/\n const setIndexOfSelectedItem = (selectedLabel: string) => {\n isSectionList\n ? optionsCopy.map((item: TSectionListItem, sectionIndex: number) => {\n item.data?.find((dataItem: TFlatListItem, itemIndex: number) => {\n if (dataItem[optLabel] === selectedLabel) {\n setListIndex({ sectionIndex, itemIndex });\n }\n });\n })\n : optionsCopy?.find((item: TFlatListItem, itemIndex: number) => {\n if (item[optLabel] === selectedLabel) {\n setListIndex({ itemIndex });\n }\n });\n };\n\n return (\n <>\n <Dropdown\n label={label}\n placeholder={placeholder}\n helperText={helperText}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n handleToggleModal={handleToggleModal}\n labelStyle={labelStyle}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n dropdownContainerStyle={dropdownContainerStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n dropdownErrorTextStyle={dropdownErrorTextStyle}\n dropdownHelperTextStyle={dropdownHelperTextStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n isMultiple={isMultiple}\n primaryColor={primary}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n setIndexOfSelectedItem={setIndexOfSelectedItem}\n {...rest}\n />\n <CustomModal\n open={open}\n handleToggleModal={handleToggleModal}\n modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainerStyle={modalOptionsContainerStyle}\n onRequestClose={() => {}}\n modalProps={modalProps}\n >\n <ListTypeComponent\n ListHeaderComponent={\n <>\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchInputStyle}\n primaryColor={primary}\n />\n )}\n {listHeaderComponent}\n {isMultiple && listIsEmpty && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={\n selectAll\n ? listControls?.unselectAllText || 'Clear all'\n : listControls?.selectAllText || 'Select all'\n }\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n checkboxComponent={checkboxComponent}\n />\n </TouchableOpacity>\n </View>\n )}\n </>\n }\n ListFooterComponent={listFooterComponent}\n listComponentStyles={listComponentStyles}\n options={newOptions}\n optionLabel={optLabel}\n optionValue={optValue}\n isMultiple={isMultiple}\n isSearchable={isSearchable}\n selectedItems={selectedItems}\n selectedItem={selectedItem}\n handleMultipleSelections={handleMultipleSelections}\n handleSingleSelection={handleSingleSelection}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n checkboxComponent={checkboxComponent}\n listIndex={listIndex}\n />\n </CustomModal>\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n optionsContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n },\n});\n\nexport default DropdownSelect;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,oBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,YAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAQA,IAAAW,MAAA,GAAAX,OAAA;AAGiB,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC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BAAmB,EAAEA,mBAAoB;IACzC9B,OAAO,EAAEmC,UAAW;IACpBlC,WAAW,EAAEiE,QAAS;IACtBhE,WAAW,EAAEkE,QAAS;IACtB/D,UAAU,EAAEA,UAAW;IACvBC,YAAY,EAAEA,YAAa;IAC3BsC,aAAa,EAAEA,aAAc;IAC7BF,YAAY,EAAEA,YAAa;IAC3BkC,wBAAwB,EAAEA,wBAAyB;IACnDF,qBAAqB,EAAEA,qBAAsB;IAC7CrD,YAAY,EAAE6F,OAAQ;IACtB3F,YAAY,EAAEA,YAAa;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,kBAAkB,EAAEA,kBAAmB;IACvCC,uBAAuB,EAAEA,uBAAwB;IACjDC,iBAAiB,EAAEA,iBAAkB;IACrCqB,SAAS,EAAEA;EAAU,CACtB,CACU,CACb,CAAC;AAEP,CAAC;AAAC4F,OAAA,CAAAlJ,cAAA,GAAAA,cAAA;AAEF,MAAM0I,MAAM,GAAGS,uBAAU,CAACC,MAAM,CAAC;EAC/BT,qBAAqB,EAAE;IACrBU,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYxJ,cAAc;AAAAkJ,OAAA,CAAA/K,OAAA,GAAAqL,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Input","_interopRequireDefault","_CheckBox","_Dropdown","_DropdownFlatList","_DropdownSectionList","_CustomModal","_colors","_constants","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSelect","_ref","placeholder","label","error","helperText","options","optionLabel","optionValue","onValueChange","selectedValue","isMultiple","isSearchable","dropdownIcon","labelStyle","placeholderStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","selectedItemStyle","multipleSelectedItemStyle","modalBackgroundStyle","modalOptionsContainerStyle","searchInputStyle","primaryColor","disabled","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","listHeaderComponent","listFooterComponent","listComponentStyles","modalProps","hideModal","listControls","searchControls","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","searchValue","setSearchValue","listIndex","setListIndex","itemIndex","Error","useEffect","Array","isArray","isSectionList","some","item","title","data","ListTypeComponent","DropdownSectionList","DropdownFlatList","modifiedSectionData","extractPropertyFromArray","flat","modifiedOptions","optLabel","DEFAULT_OPTION_LABEL","optValue","DEFAULT_OPTION_VALUE","optionsCopy","JSON","parse","stringify","handleSingleSelection","value","handleMultipleSelections","prevVal","_selectedValues","selectedValues","includes","filter","push","removeDisabledItems","items","handleSelectAll","filteredOptions","selectAllCallback","unselectAllCallback","checkSelectAll","useCallback","getSelectedItemsLabel","selectedLabels","forEach","element","_modifiedOptions$find","selectedItemLabel","find","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","searchSectionList","searchFlatList","flatList","toLowerCase","search","sectionList","map","listItem","handleToggleModal","sectionIndex","primary","colors","gray","setIndexOfSelectedItem","selectedLabel","_item$data","dataItem","createElement","Fragment","onRequestClose","removeClippedSubviews","ListHeaderComponent","onChangeText","text","style","textInputStyle","textInputContainerStyle","openModal","textInputProps","View","styles","optionsContainerStyle","TouchableOpacity","onPress","unselectAllText","selectAllText","onChange","ListFooterComponent","exports","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport { TouchableOpacity, StyleSheet, View } from 'react-native';\nimport Input from './components/Input';\nimport CheckBox from './components/CheckBox';\nimport Dropdown from './components/Dropdown/Dropdown';\nimport DropdownFlatList from './components/Dropdown/DropdownFlatList';\nimport DropdownSectionList from './components/Dropdown/DropdownSectionList';\nimport CustomModal from './components/CustomModal';\nimport { colors } from './styles/colors';\nimport { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';\nimport type {\n DropdownProps,\n TFlatList,\n TFlatListItem,\n TSectionList,\n TSectionListItem,\n} from './types/index.types';\nimport { extractPropertyFromArray } from './utils';\n\nexport const DropdownSelect: React.FC<DropdownProps> = ({\n placeholder,\n label,\n error,\n helperText,\n options,\n optionLabel,\n optionValue,\n onValueChange,\n selectedValue,\n isMultiple,\n isSearchable,\n dropdownIcon,\n labelStyle,\n placeholderStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n searchInputStyle, // kept for backwards compatibility\n primaryColor,\n disabled,\n checkboxSize, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n checkboxComponent,\n listHeaderComponent,\n listFooterComponent,\n listComponentStyles,\n modalProps,\n hideModal = false,\n listControls,\n searchControls,\n ...rest\n}) => {\n const [newOptions, setNewOptions] = useState<TFlatList | TSectionList>([]);\n const [open, setOpen] = useState<boolean>(false);\n const [selectAll, setSelectAll] = useState<boolean>(false);\n const [selectedItem, setSelectedItem] = useState<any>(''); // for single selection\n const [selectedItems, setSelectedItems] = useState<any[]>([]); // for multiple selection\n const [searchValue, setSearchValue] = useState<string>('');\n const [listIndex, setListIndex] = useState<{\n sectionIndex?: number;\n itemIndex: number;\n }>({ itemIndex: 0 }); // for scrollToIndex in Sectionlist and Flatlist\n\n if (!options || options.length === 0) {\n throw new Error('Options array cannot be empty or undefined');\n }\n\n useEffect(() => {\n setNewOptions(options);\n return () => {};\n }, [options]);\n\n useEffect(() => {\n isMultiple\n ? setSelectedItems(Array.isArray(selectedValue) ? selectedValue : [])\n : setSelectedItem(selectedValue);\n\n return () => {};\n }, [selectedValue, isMultiple, onValueChange]);\n\n /*===========================================\n * List type\n *==========================================*/\n\n // check the structure of the new options array to determine if it is a section list or a\n const isSectionList = newOptions.some(\n (item) => item.title && item.data && Array.isArray(item.data)\n );\n\n const ListTypeComponent = isSectionList\n ? DropdownSectionList\n : DropdownFlatList;\n const modifiedSectionData = extractPropertyFromArray(\n newOptions,\n 'data'\n ).flat();\n\n /**\n *`modifiedOptions` should only be used for computations newOptions remains the default array.\n * At this point modifiedOptions now has the same structure for both `FlatList` and `SectionList`\n */\n const modifiedOptions = isSectionList ? modifiedSectionData : newOptions;\n\n const optLabel = optionLabel || DEFAULT_OPTION_LABEL;\n const optValue = optionValue || DEFAULT_OPTION_VALUE;\n const optionsCopy = JSON.parse(JSON.stringify(options)); // copy of the original options array\n\n /*===========================================\n * Selection handlers\n *==========================================*/\n const handleSingleSelection = (value: string | number) => {\n if (selectedItem === value) {\n setSelectedItem(null);\n onValueChange(null); // send value to parent\n } else {\n setSelectedItem(value);\n onValueChange(value); // send value to parent\n setOpen(false); // close modal upon selection\n }\n };\n\n const handleMultipleSelections = (value: string[] | number[]) => {\n setSelectedItems((prevVal) => {\n let selectedValues = [...prevVal];\n\n if (selectedValues?.includes(value)) {\n selectedValues = selectedValues.filter((item) => item !== value);\n } else {\n selectedValues.push(value);\n }\n onValueChange(selectedValues); // send value to parent\n return selectedValues;\n });\n };\n\n const removeDisabledItems = (items: TFlatList) => {\n return items.filter((item: TFlatListItem) => !item.disabled);\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n // don't select disabled items\n const filteredOptions = removeDisabledItems(\n isSectionList\n ? extractPropertyFromArray(optionsCopy, 'data').flat()\n : optionsCopy\n );\n\n if (!prevVal) {\n for (let i = 0; i < filteredOptions.length; i++) {\n selectedValues.push(filteredOptions[i][optValue]);\n }\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); // send value to parent\n return !prevVal;\n });\n\n if (typeof listControls?.selectAllCallback === 'function' && !selectAll) {\n listControls.selectAllCallback();\n }\n\n if (typeof listControls?.unselectAllCallback === 'function' && selectAll) {\n listControls.unselectAllCallback();\n }\n };\n\n /*===========================================\n * Handle side effects\n *==========================================*/\n const checkSelectAll = useCallback(\n (selectedValues: any[]) => {\n //if the list contains disabled values, those values will not be selected\n if (\n removeDisabledItems(modifiedOptions).length === selectedValues.length\n ) {\n setSelectAll(true);\n } else {\n setSelectAll(false);\n }\n },\n [modifiedOptions]\n );\n\n // anytime the selected items change, check if it is time to set `selectAll` to true\n useEffect(() => {\n if (isMultiple) {\n checkSelectAll(selectedItems);\n }\n return () => {};\n }, [checkSelectAll, isMultiple, selectedItems]);\n\n /*===========================================\n * Get label handler\n *==========================================*/\n const getSelectedItemsLabel = () => {\n if (isMultiple && Array.isArray(selectedItems)) {\n let selectedLabels: Array<string> = [];\n\n selectedItems?.forEach((element: number | string) => {\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === element\n )?.[optLabel];\n selectedLabels.push(selectedItemLabel);\n });\n return selectedLabels;\n }\n\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === selectedItem\n );\n return selectedItemLabel?.[optLabel];\n };\n\n /*===========================================\n * Search\n *==========================================*/\n const onSearch = (value: string) => {\n setSearchValue(value);\n\n let searchText = value.toString().toLocaleLowerCase().trim();\n\n const regexFilter = new RegExp(searchText, 'i');\n\n // Because the options array will be mutated after Search, we have to search with a copy of the original array\n const searchResults = isSectionList\n ? searchSectionList(optionsCopy as TSectionList, regexFilter)\n : searchFlatList(optionsCopy as TFlatList, regexFilter);\n\n setNewOptions(searchResults);\n };\n\n const searchFlatList = (flatList: TFlatList, regexFilter: RegExp) => {\n const searchResults = flatList.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return true;\n }\n return;\n });\n return searchResults;\n };\n\n const searchSectionList = (\n sectionList: TSectionList,\n regexFilter: RegExp\n ) => {\n const searchResults = sectionList.map((listItem: TSectionListItem) => {\n listItem.data = listItem.data.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return listItem.data.push(item);\n }\n return;\n });\n\n return listItem;\n });\n\n return searchResults;\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n setListIndex({ itemIndex: 0, sectionIndex: 0 });\n };\n\n useEffect(() => {\n if (hideModal) {\n setOpen(false);\n }\n return () => {};\n }, [hideModal]);\n\n let primary = primaryColor || colors.gray;\n\n /*===========================================\n * setIndexOfSelectedItem - For ScrollToIndex\n *==========================================*/\n const setIndexOfSelectedItem = (selectedLabel: string) => {\n isSectionList\n ? optionsCopy.map((item: TSectionListItem, sectionIndex: number) => {\n item.data?.find((dataItem: TFlatListItem, itemIndex: number) => {\n if (dataItem[optLabel] === selectedLabel) {\n setListIndex({ sectionIndex, itemIndex });\n }\n });\n })\n : optionsCopy?.find((item: TFlatListItem, itemIndex: number) => {\n if (item[optLabel] === selectedLabel) {\n setListIndex({ itemIndex });\n }\n });\n };\n\n return (\n <>\n <Dropdown\n label={label}\n placeholder={placeholder}\n helperText={helperText}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n handleToggleModal={handleToggleModal}\n labelStyle={labelStyle}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n dropdownContainerStyle={dropdownContainerStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n dropdownErrorTextStyle={dropdownErrorTextStyle}\n dropdownHelperTextStyle={dropdownHelperTextStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n isMultiple={isMultiple}\n primaryColor={primary}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n setIndexOfSelectedItem={setIndexOfSelectedItem}\n {...rest}\n />\n <CustomModal\n open={open}\n modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainerStyle={modalOptionsContainerStyle}\n onRequestClose={() => handleToggleModal()}\n modalProps={modalProps}\n >\n <ListTypeComponent\n removeClippedSubviews={false}\n ListHeaderComponent={\n <>\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchControls?.textInputStyle || searchInputStyle}\n primaryColor={primary}\n textInputContainerStyle={\n searchControls?.textInputContainerStyle\n }\n openModal={() => setOpen(true)} // There seems to a known issue on expo web that closes the modal when the input is focused\n {...searchControls?.textInputProps}\n />\n )}\n {listHeaderComponent}\n {isMultiple && modifiedOptions.length > 1 && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={\n selectAll\n ? listControls?.unselectAllText || 'Clear all'\n : listControls?.selectAllText || 'Select all'\n }\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n checkboxComponent={checkboxComponent}\n />\n </TouchableOpacity>\n </View>\n )}\n </>\n }\n ListFooterComponent={listFooterComponent}\n listComponentStyles={listComponentStyles}\n options={newOptions}\n optionLabel={optLabel}\n optionValue={optValue}\n isMultiple={isMultiple}\n isSearchable={isSearchable}\n selectedItems={selectedItems}\n selectedItem={selectedItem}\n handleMultipleSelections={handleMultipleSelections}\n handleSingleSelection={handleSingleSelection}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n checkboxComponent={checkboxComponent}\n listIndex={listIndex}\n />\n </CustomModal>\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n optionsContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n },\n});\n\nexport default DropdownSelect;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,oBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,YAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAQA,IAAAW,MAAA,GAAAX,OAAA;AAAmD,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAjB,wBAAAa,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAA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,EAAEA,mBAAoB;IACzC9B,OAAO,EAAEoC,UAAW;IACpBnC,WAAW,EAAEmE,QAAS;IACtBlE,WAAW,EAAEoE,QAAS;IACtBjE,UAAU,EAAEA,UAAW;IACvBC,YAAY,EAAEA,YAAa;IAC3BuC,aAAa,EAAEA,aAAc;IAC7BF,YAAY,EAAEA,YAAa;IAC3BmC,wBAAwB,EAAEA,wBAAyB;IACnDF,qBAAqB,EAAEA,qBAAsB;IAC7CvD,YAAY,EAAEiG,OAAQ;IACtB/F,YAAY,EAAEA,YAAa;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,kBAAkB,EAAEA,kBAAmB;IACvCC,uBAAuB,EAAEA,uBAAwB;IACjDC,iBAAiB,EAAEA,iBAAkB;IACrCsB,SAAS,EAAEA;EAAU,CACtB,CACU,CACb,CAAC;AAEP,CAAC;AAACiG,OAAA,CAAAxJ,cAAA,GAAAA,cAAA;AAEF,MAAMgJ,MAAM,GAAGS,uBAAU,CAACC,MAAM,CAAC;EAC/BT,qBAAqB,EAAE;IACrBU,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9J,cAAc;AAAAwJ,OAAA,CAAArL,OAAA,GAAA2L,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.types.ts"],"sourcesContent":["import type {\n ViewStyle,\n ColorValue,\n TextStyle,\n ModalProps,\n} from 'react-native';\n\nexport type DropdownProps = {\n placeholder?: string;\n label?: string;\n error?: string;\n helperText?: string;\n options: TFlatList | TSectionList;\n optionLabel?: string;\n optionValue?: string;\n onValueChange: Function;\n selectedValue?:\n | string\n | boolean\n | number\n | string[]\n | boolean[]\n | number[]\n | null;\n isMultiple?: boolean;\n isSearchable?: boolean;\n dropdownIcon?: React.ReactNode;\n labelStyle?: TextStyle;\n dropdownStyle?: ViewStyle;\n dropdownIconStyle?: ViewStyle;\n dropdownContainerStyle?: ViewStyle;\n dropdownErrorStyle?: ViewStyle;\n dropdownErrorTextStyle?: TextStyle;\n dropdownHelperTextStyle?: TextStyle;\n selectedItemStyle?: TextStyle;\n multipleSelectedItemStyle?: TextStyle;\n modalBackgroundStyle?: ViewStyle;\n modalOptionsContainerStyle?: ViewStyle;\n searchInputStyle?: ViewStyle;\n primaryColor?: ColorValue;\n disabled?: boolean;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n checkboxComponentStyles?: {\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n };\n checkboxComponent?: React.ReactNode;\n placeholderStyle?: TextStyle;\n listHeaderComponent?: React.ReactNode;\n listFooterComponent?: React.ReactNode;\n hideModal?: boolean;\n modalProps?: ModalProps;\n listComponentStyles?: {\n listEmptyComponentStyle?: TextStyle;\n itemSeparatorStyle?: ViewStyle;\n sectionHeaderStyle?: TextStyle;\n };\n listControls?: {\n selectAllText?: string;\n unselectAllText?: string;\n selectAllCallback?: () => void;\n unselectAllCallback?: () => void;\n };\n};\n\nexport type TFlatList = TFlatListItem[];\nexport type TFlatListItem = {\n [key: string]: string | number | boolean;\n};\n\nexport type TSectionList = TSectionListItem[];\nexport type TSectionListItem = { title: string; data: TFlatList };\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.types.ts"],"sourcesContent":["import type {\n ViewStyle,\n ColorValue,\n TextStyle,\n ModalProps,\n TextInputProps,\n} from 'react-native';\n\nexport type DropdownProps = {\n placeholder?: string;\n label?: string;\n error?: string;\n helperText?: string;\n options: TFlatList | TSectionList;\n optionLabel?: string;\n optionValue?: string;\n onValueChange: Function;\n selectedValue?:\n | string\n | boolean\n | number\n | string[]\n | boolean[]\n | number[]\n | null;\n isMultiple?: boolean;\n isSearchable?: boolean;\n dropdownIcon?: React.ReactNode;\n labelStyle?: TextStyle;\n dropdownStyle?: ViewStyle;\n dropdownIconStyle?: ViewStyle;\n dropdownContainerStyle?: ViewStyle;\n dropdownErrorStyle?: ViewStyle;\n dropdownErrorTextStyle?: TextStyle;\n dropdownHelperTextStyle?: TextStyle;\n selectedItemStyle?: TextStyle;\n multipleSelectedItemStyle?: TextStyle;\n modalBackgroundStyle?: ViewStyle;\n modalOptionsContainerStyle?: ViewStyle;\n searchInputStyle?: ViewStyle;\n primaryColor?: ColorValue;\n disabled?: boolean;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n checkboxComponentStyles?: {\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n };\n checkboxComponent?: React.ReactNode;\n placeholderStyle?: TextStyle;\n listHeaderComponent?: React.ReactNode;\n listFooterComponent?: React.ReactNode;\n hideModal?: boolean;\n modalProps?: ModalProps;\n listComponentStyles?: {\n listEmptyComponentStyle?: TextStyle;\n itemSeparatorStyle?: ViewStyle;\n sectionHeaderStyle?: TextStyle;\n };\n listControls?: {\n selectAllText?: string;\n unselectAllText?: string;\n selectAllCallback?: () => void;\n unselectAllCallback?: () => void;\n };\n searchControls?: {\n textInputStyle?: ViewStyle | TextStyle;\n textInputContainerStyle?: ViewStyle;\n textInputProps?: TextInputProps;\n };\n};\n\nexport type TFlatList = TFlatListItem[];\nexport type TFlatListItem = {\n [key: string]: string | number | boolean;\n};\n\nexport type TSectionList = TSectionListItem[];\nexport type TSectionListItem = { title: string; data: TFlatList };\n"],"mappings":""}
|
|
@@ -3,24 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.extractPropertyFromArray = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Extract property from array
|
|
9
9
|
*/
|
|
10
|
+
|
|
10
11
|
const extractPropertyFromArray = (arr, property) => {
|
|
11
12
|
let extractedValue = arr.map(item => item[property]);
|
|
12
13
|
return extractedValue;
|
|
13
14
|
};
|
|
14
15
|
exports.extractPropertyFromArray = extractPropertyFromArray;
|
|
15
|
-
const getMaxLengthOfSectionListProperty = (sectionList, property) => {
|
|
16
|
-
let maxLength = 0;
|
|
17
|
-
sectionList.forEach(obj => {
|
|
18
|
-
var _obj$property;
|
|
19
|
-
if (((_obj$property = obj[property]) === null || _obj$property === void 0 ? void 0 : _obj$property.length) > maxLength) {
|
|
20
|
-
maxLength = obj.data.length;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return maxLength;
|
|
24
|
-
};
|
|
25
|
-
exports.getMaxLengthOfSectionListProperty = getMaxLengthOfSectionListProperty;
|
|
26
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["extractPropertyFromArray","arr","property","extractedValue","map","item","exports"
|
|
1
|
+
{"version":3,"names":["extractPropertyFromArray","arr","property","extractedValue","map","item","exports"],"sources":["index.ts"],"sourcesContent":["/**\n * Extract property from array\n */\n\nexport const extractPropertyFromArray = (arr: any, property: string) => {\n let extractedValue = arr.map((item: any) => item[property]);\n\n return extractedValue;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEO,MAAMA,wBAAwB,GAAGA,CAACC,GAAQ,EAAEC,QAAgB,KAAK;EACtE,IAAIC,cAAc,GAAGF,GAAG,CAACG,GAAG,CAAEC,IAAS,IAAKA,IAAI,CAACH,QAAQ,CAAC,CAAC;EAE3D,OAAOC,cAAc;AACvB,CAAC;AAACG,OAAA,CAAAN,wBAAA,GAAAA,wBAAA"}
|
|
@@ -5,7 +5,6 @@ import { colors } from '../../styles/colors';
|
|
|
5
5
|
const CustomModal = _ref => {
|
|
6
6
|
let {
|
|
7
7
|
open,
|
|
8
|
-
handleToggleModal,
|
|
9
8
|
onRequestClose,
|
|
10
9
|
modalBackgroundStyle,
|
|
11
10
|
modalOptionsContainerStyle,
|
|
@@ -18,7 +17,7 @@ const CustomModal = _ref => {
|
|
|
18
17
|
onRequestClose: () => onRequestClose(),
|
|
19
18
|
animationType: "fade"
|
|
20
19
|
}, modalProps), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
21
|
-
onPress: () =>
|
|
20
|
+
onPress: () => onRequestClose(),
|
|
22
21
|
style: [styles.modalContainer, styles.modalBackgroundStyle, modalBackgroundStyle]
|
|
23
22
|
}, /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
24
23
|
style: [styles.modalOptionsContainer, modalOptionsContainerStyle]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Modal","TouchableOpacity","SafeAreaView","StyleSheet","colors","CustomModal","_ref","open","
|
|
1
|
+
{"version":3,"names":["React","Modal","TouchableOpacity","SafeAreaView","StyleSheet","colors","CustomModal","_ref","open","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","modalProps","children","createElement","_extends","transparent","visible","animationType","onPress","style","styles","modalContainer","modalOptionsContainer","create","flex","justifyContent","backgroundColor","maxHeight","white","borderTopLeftRadius","borderTopRightRadius"],"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 onRequestClose,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n modalProps,\n children,\n}: any) => {\n return (\n <Modal\n transparent={true}\n visible={open}\n onRequestClose={() => onRequestClose()}\n animationType=\"fade\"\n {...modalProps}\n >\n <TouchableOpacity\n onPress={() => onRequestClose()}\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,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,KAAK,EACLC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,QACL,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAE5C,MAAMC,WAAW,GAAGC,IAAA,IAOT;EAAA,IAPU;IACnBC,IAAI;IACJC,cAAc;IACdC,oBAAoB;IACpBC,0BAA0B;IAC1BC,UAAU;IACVC;EACG,CAAC,GAAAN,IAAA;EACJ,oBACEP,KAAA,CAAAc,aAAA,CAACb,KAAK,EAAAc,QAAA;IACJC,WAAW,EAAE,IAAK;IAClBC,OAAO,EAAET,IAAK;IACdC,cAAc,EAAEA,CAAA,KAAMA,cAAc,CAAC,CAAE;IACvCS,aAAa,EAAC;EAAM,GAChBN,UAAU,gBAEdZ,KAAA,CAAAc,aAAA,CAACZ,gBAAgB;IACfiB,OAAO,EAAEA,CAAA,KAAMV,cAAc,CAAC,CAAE;IAChCW,KAAK,EAAE,CACLC,MAAM,CAACC,cAAc,EACrBD,MAAM,CAACX,oBAAoB,EAC3BA,oBAAoB;EACpB,gBAEFV,KAAA,CAAAc,aAAA,CAACX,YAAY;IACXiB,KAAK,EAAE,CAACC,MAAM,CAACE,qBAAqB,EAAEZ,0BAA0B;EAAE,GAEjEE,QACW,CACE,CACb,CAAC;AAEZ,CAAC;AAED,MAAMQ,MAAM,GAAGjB,UAAU,CAACoB,MAAM,CAAC;EAC/BF,cAAc,EAAE;IACdG,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDhB,oBAAoB,EAAE;IAAEiB,eAAe,EAAE;EAAqB,CAAC;EAC/DJ,qBAAqB,EAAE;IACrBK,SAAS,EAAE,KAAK;IAChBD,eAAe,EAAEtB,MAAM,CAACwB,KAAK;IAC7BC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC;AAEF,eAAezB,WAAW"}
|
|
@@ -9,11 +9,13 @@ export const Input = _ref => {
|
|
|
9
9
|
onChangeText,
|
|
10
10
|
style,
|
|
11
11
|
primaryColor,
|
|
12
|
+
textInputContainerStyle,
|
|
13
|
+
openModal,
|
|
12
14
|
...rest
|
|
13
15
|
} = _ref;
|
|
14
16
|
const [isFocused, setFocus] = useState(false);
|
|
15
17
|
return /*#__PURE__*/React.createElement(View, {
|
|
16
|
-
style: styles.container
|
|
18
|
+
style: [styles.container, textInputContainerStyle]
|
|
17
19
|
}, /*#__PURE__*/React.createElement(TextInput, _extends({
|
|
18
20
|
placeholder: placeholder,
|
|
19
21
|
style: [inputStyles.input, Platform.select({
|
|
@@ -23,7 +25,10 @@ export const Input = _ref => {
|
|
|
23
25
|
}), isFocused && {
|
|
24
26
|
borderColor: primaryColor
|
|
25
27
|
}, style],
|
|
26
|
-
onFocus: () =>
|
|
28
|
+
onFocus: () => {
|
|
29
|
+
setFocus(true);
|
|
30
|
+
openModal();
|
|
31
|
+
},
|
|
27
32
|
onBlur: () => setFocus(false),
|
|
28
33
|
value: value,
|
|
29
34
|
onChangeText: onChangeText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","TextInput","StyleSheet","View","Platform","inputStyles","Input","_ref","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","createElement","styles","container","_extends","input","select","web","outlineColor","borderColor","onFocus","onBlur","create","margin"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={styles.container}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => setFocus(true)}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACpE,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,KAAK,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"names":["React","useState","TextInput","StyleSheet","View","Platform","inputStyles","Input","_ref","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","openModal","rest","isFocused","setFocus","createElement","styles","container","_extends","input","select","web","outlineColor","borderColor","onFocus","onBlur","create","margin"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n textInputContainerStyle,\n openModal,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n openModal();\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ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