react-native-input-select 0.24.0 → 0.26.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 +9 -7
- package/lib/commonjs/components/CheckBox/index.js +6 -2
- package/lib/commonjs/components/CheckBox/index.js.map +1 -1
- package/lib/commonjs/components/CheckBox/types.js.map +1 -1
- package/lib/commonjs/components/Dropdown/Dropdown.js +3 -1
- package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownList.js +12 -3
- package/lib/commonjs/components/Dropdown/DropdownList.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownListItem.js +3 -2
- package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js +2 -1
- package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
- package/lib/commonjs/index.js +27 -22
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/colors.js +2 -1
- package/lib/commonjs/styles/colors.js.map +1 -1
- package/lib/commonjs/types/index.types.js.map +1 -1
- package/lib/module/components/CheckBox/index.js +6 -2
- package/lib/module/components/CheckBox/index.js.map +1 -1
- package/lib/module/components/CheckBox/types.js.map +1 -1
- package/lib/module/components/Dropdown/Dropdown.js +3 -1
- package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownList.js +13 -3
- package/lib/module/components/Dropdown/DropdownList.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownListItem.js +3 -2
- package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownSelectedItemsView.js +2 -1
- package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
- package/lib/module/index.js +27 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/colors.js +2 -1
- package/lib/module/styles/colors.js.map +1 -1
- package/lib/module/types/index.types.js.map +1 -1
- package/lib/typescript/components/CheckBox/index.d.ts +1 -1
- package/lib/typescript/components/CheckBox/types.d.ts +1 -0
- package/lib/typescript/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/typescript/components/Dropdown/DropdownList.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 +1 -0
- package/package.json +1 -1
- package/src/components/CheckBox/index.tsx +8 -1
- package/src/components/CheckBox/types.ts +1 -0
- package/src/components/Dropdown/Dropdown.tsx +2 -0
- package/src/components/Dropdown/DropdownList.tsx +8 -0
- package/src/components/Dropdown/DropdownListItem.tsx +4 -1
- package/src/components/Dropdown/DropdownSelectedItemsView.tsx +2 -1
- package/src/index.tsx +34 -27
- package/src/styles/colors.ts +1 -0
- package/src/types/index.types.ts +1 -0
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
56
56
|
| | | |
|
|
57
57
|
|:-------------------------:|:-------------------------:|:-------------------------:|
|
|
58
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">|
|
|
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
60
|
|
|
61
61
|
|
|
62
62
|
# Android
|
|
@@ -64,6 +64,7 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
64
64
|
|:-------------------------:|:-------------------------:|:-------------------------:|
|
|
65
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
66
|
|
|
67
|
+
|
|
67
68
|
## Props
|
|
68
69
|
|
|
69
70
|
| Proptypes | Datatype | Example |
|
|
@@ -80,7 +81,8 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
80
81
|
| isMultiple | `Boolean` | `true` |
|
|
81
82
|
| isSearchable | `Boolean` | `true` |
|
|
82
83
|
| disabled | `Boolean` | `true` |
|
|
83
|
-
| labelStyle | `Object` | `{color: 'red',
|
|
84
|
+
| labelStyle | `Object` | `{color: 'red', fontSize: 15, fontWeight: '500'}` |
|
|
85
|
+
| placeholderStyle | `Object` | `{color: 'red', fontSize: 15, fontWeight: '500'}` |
|
|
84
86
|
| dropdownStyle | `Object` | `{borderColor: 'blue', margin: 5, borderWidth:0 ...}` |
|
|
85
87
|
| dropdownContainerStyle | `Object` | `{backgroundColor: 'red', width: '30%', ...}` |
|
|
86
88
|
| searchInputStyle | `Object` | `{backgroundColor: 'red', borderRadius: 0, ...}` |
|
|
@@ -92,9 +94,9 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
92
94
|
| dropdownErrorTextStyle | `Object` | `{color: 'red', fontWeight:'500'}` |
|
|
93
95
|
| dropdownHelperTextStyle | `Object` | `{color: 'green', fontWeight:'500'}` |
|
|
94
96
|
| primaryColor | `string` | `blue` |
|
|
95
|
-
| checkboxSize | `number` | `
|
|
96
|
-
| checkboxStyle | `Object` | `{backgroundColor: 'blue',
|
|
97
|
-
| checkboxLabelStyle | `Object` | `{color: 'red', fontWeight:'500'`
|
|
97
|
+
| checkboxSize | `number` | `20` |
|
|
98
|
+
| checkboxStyle | `Object` | `{backgroundColor: 'blue', borderRadius: 30, padding: 10}` |
|
|
99
|
+
| checkboxLabelStyle | `Object` | `{color: 'red', fontWeight:'500'}` |
|
|
98
100
|
|
|
99
101
|
|
|
100
102
|
## Contributing
|
|
@@ -105,6 +107,6 @@ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the
|
|
|
105
107
|
|
|
106
108
|
MIT
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
# Video Demo
|
|
111
|
+
https://user-images.githubusercontent.com/9849221/230516294-a1aca5a7-65f5-4d9c-9b7f-a057807cf35f.mov
|
|
109
112
|
|
|
110
|
-
https://user-images.githubusercontent.com/9849221/226240418-efa4fe9f-4055-4c03-888e-8b7093adcd63.mov
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _colors = require("../../styles/colors");
|
|
9
10
|
var _constants = require("../../constants");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
/* eslint-disable react-native/no-inline-styles */
|
|
@@ -14,6 +15,7 @@ const CheckBox = _ref => {
|
|
|
14
15
|
let {
|
|
15
16
|
label,
|
|
16
17
|
value,
|
|
18
|
+
disabled,
|
|
17
19
|
primaryColor,
|
|
18
20
|
checkboxSize,
|
|
19
21
|
checkboxStyle,
|
|
@@ -21,11 +23,13 @@ const CheckBox = _ref => {
|
|
|
21
23
|
onChange
|
|
22
24
|
} = _ref;
|
|
23
25
|
const fillColor = {
|
|
24
|
-
backgroundColor: value ? (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.backgroundColor) || primaryColor || 'green' : 'white'
|
|
26
|
+
backgroundColor: disabled ? '#d3d3d3' : value ? (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.backgroundColor) || primaryColor || 'green' : 'white',
|
|
27
|
+
borderColor: disabled ? _colors.colors.disabled : styles.checkbox.borderColor
|
|
25
28
|
};
|
|
26
29
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
27
30
|
onPress: onChange ? () => onChange(!value) : () => {},
|
|
28
|
-
style: [styles.checkboxContainer]
|
|
31
|
+
style: [styles.checkboxContainer],
|
|
32
|
+
disabled: disabled
|
|
29
33
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
30
34
|
style: [styles.checkbox, checkboxStyle, fillColor]
|
|
31
35
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_constants","obj","__esModule","default","CheckBox","_ref","label","value","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","onChange","fillColor","backgroundColor","createElement","Pressable","onPress","style","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_constants","obj","__esModule","default","CheckBox","_ref","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","onChange","fillColor","backgroundColor","borderColor","colors","styles","checkbox","createElement","Pressable","onPress","style","checkboxContainer","View","Image","source","height","CHECKBOX_SIZE","width","Text","labelStyle","StyleSheet","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","marginLeft","_default","exports"],"sources":["index.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { Pressable, Text, StyleSheet, Image, View } from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { CHECKBOX_SIZE } from '../../constants';\nimport type { CheckboxProps } from './types';\n\nconst CheckBox = ({\n label,\n value,\n disabled,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n onChange,\n}: CheckboxProps) => {\n const fillColor = {\n backgroundColor: disabled\n ? '#d3d3d3'\n : value\n ? checkboxStyle?.backgroundColor || primaryColor || 'green'\n : 'white',\n borderColor: disabled ? colors.disabled : styles.checkbox.borderColor,\n };\n\n return (\n <Pressable\n onPress={onChange ? () => onChange(!value) : () => {}}\n style={[styles.checkboxContainer]}\n disabled={disabled}\n >\n <View style={[styles.checkbox, checkboxStyle, fillColor]}>\n <Image\n source={require('../../asset/check.png')}\n style={[\n {\n height: checkboxSize || CHECKBOX_SIZE,\n width: checkboxSize || CHECKBOX_SIZE,\n },\n ]}\n />\n </View>\n {label && (\n <Text style={[checkboxLabelStyle, styles.labelStyle]}>{label}</Text>\n )}\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n checkboxContainer: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n },\n checkbox: {\n padding: 4,\n borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: 4,\n borderColor: 'black',\n },\n labelStyle: { marginLeft: 10 },\n});\n\nexport default CheckBox;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAA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MACrCC,KAAK,EAAEpB,YAAY,IAAImB;IACzB,CAAC;EACD,EACF,CACG,EACNvB,KAAK,iBACJX,MAAA,CAAAQ,OAAA,CAAAiB,aAAA,CAACtB,YAAA,CAAAiC,IAAI;IAACR,KAAK,EAAE,CAACX,kBAAkB,EAAEM,MAAM,CAACc,UAAU;EAAE,GAAE1B,KAAK,CAC7D,CACS;AAEhB,CAAC;AAED,MAAMY,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/BV,iBAAiB,EAAE;IACjBW,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACDlB,QAAQ,EAAE;IACRmB,OAAO,EAAE,CAAC;IACVC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,OAAO;IACpBC,YAAY,EAAE,CAAC;IACfzB,WAAW,EAAE;EACf,CAAC;EACDgB,UAAU,EAAE;IAAEU,UAAU,EAAE;EAAG;AAC/B,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYvC,QAAQ;AAAAwC,OAAA,CAAAzC,OAAA,GAAAwC,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue, ViewStyle, TextStyle } from 'react-native';\n\nexport type CheckboxProps = {\n label?: string;\n value?: boolean;\n primaryColor?: ColorValue;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n onChange?: (value: boolean | string | number) => void;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue, ViewStyle, TextStyle } from 'react-native';\n\nexport type CheckboxProps = {\n label?: string;\n value?: boolean;\n disabled?: boolean;\n primaryColor?: ColorValue;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n onChange?: (value: boolean | string | number) => void;\n};\n"],"mappings":""}
|
|
@@ -25,6 +25,7 @@ const Dropdown = _ref => {
|
|
|
25
25
|
dropdownStyle,
|
|
26
26
|
dropdownContainerStyle,
|
|
27
27
|
selectedItemStyle,
|
|
28
|
+
placeholderStyle,
|
|
28
29
|
multipleSelectedItemStyle,
|
|
29
30
|
dropdownErrorStyle,
|
|
30
31
|
dropdownErrorTextStyle,
|
|
@@ -49,7 +50,8 @@ const Dropdown = _ref => {
|
|
|
49
50
|
multipleSelectedItemStyle: multipleSelectedItemStyle,
|
|
50
51
|
dropdownErrorStyle: dropdownErrorStyle,
|
|
51
52
|
primaryColor: primaryColor,
|
|
52
|
-
disabled: disabled
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
placeholderStyle: placeholderStyle
|
|
53
55
|
}), error && error !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
54
56
|
style: [styles.error, dropdownErrorTextStyle]
|
|
55
57
|
}, error), helperText && helperText !== '' && !error && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_DropdownSelectedItemsView","_colors","_typography","obj","__esModule","default","Dropdown","_ref","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","labelStyle","dropdownStyle","dropdownContainerStyle","selectedItemStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","createElement","View","style","styles","dropdownInputContainer","Text","helper","StyleSheet","create","marginBottom","color","colors","gray","typography","caption","inputFocusErrorState","borderWidth","borderStyle","borderColor","red","marginTop","primary","width","blackText","black","_default","exports"],"sources":["Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport DropdownSelectedItemsView from './DropdownSelectedItemsView';\nimport { colors } from '../../styles/colors';\nimport { typography } from '../../styles/typography';\n\nconst Dropdown = ({\n label,\n placeholder,\n helperText,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n labelStyle,\n dropdownStyle,\n dropdownContainerStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <View style={[styles.dropdownInputContainer, dropdownContainerStyle]}>\n {label && label !== '' && (\n <Text style={[styles.label, labelStyle]}>{label}</Text>\n )}\n <DropdownSelectedItemsView\n placeholder={placeholder}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n handleToggleModal={handleToggleModal}\n isMultiple={isMultiple}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n dropdownStyle={dropdownStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n primaryColor={primaryColor}\n disabled={disabled}\n />\n\n {error && error !== '' && (\n <Text style={[styles.error, dropdownErrorTextStyle]}>{error}</Text>\n )}\n\n {helperText && helperText !== '' && !error && (\n <Text style={[styles.helper, dropdownHelperTextStyle]}>\n {helperText}\n </Text>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n label: { marginBottom: 16, color: colors.gray, ...typography.caption },\n inputFocusErrorState: {\n borderWidth: 2,\n borderStyle: 'solid',\n borderColor: colors.red,\n },\n error: { color: colors.red, marginTop: 8, ...typography.caption },\n helper: { marginTop: 8, color: colors.primary, ...typography.caption },\n dropdownInputContainer: { marginBottom: 23, width: '100%' },\n blackText: { color: colors.black },\n});\n\nexport default Dropdown;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAqD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErD,MAAMG,QAAQ,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_DropdownSelectedItemsView","_colors","_typography","obj","__esModule","default","Dropdown","_ref","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","labelStyle","dropdownStyle","dropdownContainerStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","createElement","View","style","styles","dropdownInputContainer","Text","helper","StyleSheet","create","marginBottom","color","colors","gray","typography","caption","inputFocusErrorState","borderWidth","borderStyle","borderColor","red","marginTop","primary","width","blackText","black","_default","exports"],"sources":["Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport DropdownSelectedItemsView from './DropdownSelectedItemsView';\nimport { colors } from '../../styles/colors';\nimport { typography } from '../../styles/typography';\n\nconst Dropdown = ({\n label,\n placeholder,\n helperText,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n labelStyle,\n dropdownStyle,\n dropdownContainerStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <View style={[styles.dropdownInputContainer, dropdownContainerStyle]}>\n {label && label !== '' && (\n <Text style={[styles.label, labelStyle]}>{label}</Text>\n )}\n <DropdownSelectedItemsView\n placeholder={placeholder}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n handleToggleModal={handleToggleModal}\n isMultiple={isMultiple}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n dropdownStyle={dropdownStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n primaryColor={primaryColor}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n />\n\n {error && error !== '' && (\n <Text style={[styles.error, dropdownErrorTextStyle]}>{error}</Text>\n )}\n\n {helperText && helperText !== '' && !error && (\n <Text style={[styles.helper, dropdownHelperTextStyle]}>\n {helperText}\n </Text>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n label: { marginBottom: 16, color: colors.gray, ...typography.caption },\n inputFocusErrorState: {\n borderWidth: 2,\n borderStyle: 'solid',\n borderColor: colors.red,\n },\n error: { color: colors.red, marginTop: 8, ...typography.caption },\n helper: { marginTop: 8, color: colors.primary, ...typography.caption },\n dropdownInputContainer: { marginBottom: 23, width: '100%' },\n blackText: { color: colors.black },\n});\n\nexport default Dropdown;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAqD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErD,MAAMG,QAAQ,GAAGC,IAAA,IAqBN;EAAA,IArBO;IAChBC,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,aAAa;IACbC,sBAAsB;IACtBC,iBAAiB;IACjBC,gBAAgB;IAChBC,yBAAyB;IACzBC,kBAAkB;IAClBC,sBAAsB;IACtBC,uBAAuB;IACvBC,YAAY;IACZC;EACG,CAAC,GAAApB,IAAA;EACJ,oBACEX,MAAA,CAAAS,OAAA,CAAAuB,aA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AAM,CAAC;EAC/B5B,KAAK,EAAE;IAAE6B,YAAY,EAAE,EAAE;IAAEC,KAAK,EAAEC,cAAM,CAACC,IAAI;IAAE,GAAGC,sBAAU,CAACC;EAAQ,CAAC;EACtEC,oBAAoB,EAAE;IACpBC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,OAAO;IACpBC,WAAW,EAAEP,cAAM,CAACQ;EACtB,CAAC;EACDpC,KAAK,EAAE;IAAE2B,KAAK,EAAEC,cAAM,CAACQ,GAAG;IAAEC,SAAS,EAAE,CAAC;IAAE,GAAGP,sBAAU,CAACC;EAAQ,CAAC;EACjER,MAAM,EAAE;IAAEc,SAAS,EAAE,CAAC;IAAEV,KAAK,EAAEC,cAAM,CAACU,OAAO;IAAE,GAAGR,sBAAU,CAACC;EAAQ,CAAC;EACtEV,sBAAsB,EAAE;IAAEK,YAAY,EAAE,EAAE;IAAEa,KAAK,EAAE;EAAO,CAAC;EAC3DC,SAAS,EAAE;IAAEb,KAAK,EAAEC,cAAM,CAACa;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY/C,QAAQ;AAAAgD,OAAA,CAAAjD,OAAA,GAAAgD,QAAA"}
|
|
@@ -9,12 +9,14 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _DropdownListItem = _interopRequireDefault(require("./DropdownListItem"));
|
|
10
10
|
var _colors = require("../../styles/colors");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
13
|
const DropdownList = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
options,
|
|
15
16
|
optionLabel,
|
|
16
17
|
optionValue,
|
|
17
18
|
isMultiple,
|
|
19
|
+
isSearchable,
|
|
18
20
|
selectedItems,
|
|
19
21
|
selectedItem,
|
|
20
22
|
handleMultipleSelections,
|
|
@@ -22,15 +24,19 @@ const DropdownList = _ref => {
|
|
|
22
24
|
primaryColor,
|
|
23
25
|
checkboxSize,
|
|
24
26
|
checkboxStyle,
|
|
25
|
-
checkboxLabelStyle
|
|
27
|
+
checkboxLabelStyle,
|
|
28
|
+
...rest
|
|
26
29
|
} = _ref;
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, _extends({
|
|
28
31
|
data: options,
|
|
29
32
|
extraData: isMultiple ? selectedItems : selectedItem,
|
|
30
33
|
initialNumToRender: 5,
|
|
31
34
|
ListEmptyComponent: /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
32
35
|
style: styles.emptyListStyle
|
|
33
36
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "No options available")),
|
|
37
|
+
contentContainerStyle: [isSearchable ? {
|
|
38
|
+
paddingTop: 0
|
|
39
|
+
} : styles.contentContainerStyle],
|
|
34
40
|
ItemSeparatorComponent: () => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
35
41
|
style: styles.itemSeparatorStyle
|
|
36
42
|
}),
|
|
@@ -46,7 +52,7 @@ const DropdownList = _ref => {
|
|
|
46
52
|
checkboxLabelStyle
|
|
47
53
|
}),
|
|
48
54
|
keyExtractor: (_item, index) => `Options${index}`
|
|
49
|
-
});
|
|
55
|
+
}, rest));
|
|
50
56
|
};
|
|
51
57
|
const _renderItem = (_ref2, props) => {
|
|
52
58
|
let {
|
|
@@ -75,6 +81,9 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
75
81
|
alignItems: 'center',
|
|
76
82
|
width: '100%',
|
|
77
83
|
marginVertical: 20
|
|
84
|
+
},
|
|
85
|
+
contentContainerStyle: {
|
|
86
|
+
paddingTop: 20
|
|
78
87
|
}
|
|
79
88
|
});
|
|
80
89
|
var _default = DropdownList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_DropdownListItem","_colors","obj","__esModule","default","DropdownList","_ref","options","optionLabel","optionValue","isMultiple","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","createElement","FlatList","data","extraData","initialNumToRender","ListEmptyComponent","View","style","styles","emptyListStyle","Text","ItemSeparatorComponent","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","keyExtractor","_item","index","_ref2","props","StyleSheet","create","backgroundColor","colors","gray","height","opacity","alignItems","width","marginVertical","_default","exports"],"sources":["DropdownList.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_DropdownListItem","_colors","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","DropdownList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","rest","createElement","FlatList","data","extraData","initialNumToRender","ListEmptyComponent","View","style","styles","emptyListStyle","Text","contentContainerStyle","paddingTop","ItemSeparatorComponent","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","keyExtractor","_item","index","_ref2","props","StyleSheet","create","backgroundColor","colors","gray","height","opacity","alignItems","width","marginVertical","_default","exports"],"sources":["DropdownList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { View, FlatList, StyleSheet, Text } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport { colors } from '../../styles/colors';\n\nconst DropdownList = ({\n options,\n optionLabel,\n optionValue,\n isMultiple,\n isSearchable,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n ...rest\n}: any) => {\n return (\n <FlatList\n data={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <View style={styles.emptyListStyle}>\n <Text>No options available</Text>\n </View>\n }\n contentContainerStyle={[\n isSearchable ? { paddingTop: 0 } : styles.contentContainerStyle,\n ]}\n ItemSeparatorComponent={() => <View style={styles.itemSeparatorStyle} />}\n renderItem={(item) =>\n _renderItem(item, {\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption: isMultiple ? selectedItems : selectedItem,\n onChange: isMultiple\n ? handleMultipleSelections\n : handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n })\n }\n keyExtractor={(_item, index) => `Options${index}`}\n {...rest}\n />\n );\n};\n\nconst _renderItem = ({ item }: any, props: any) => {\n return (\n <DropdownListItem\n item={item}\n optionLabel={props.optionLabel}\n optionValue={props.optionValue}\n isMultiple={props.isMultiple}\n selectedOption={props.selectedOption}\n onChange={props.onChange}\n primaryColor={props.primaryColor}\n checkboxSize={props.checkboxSize}\n checkboxStyle={props.checkboxStyle}\n checkboxLabelStyle={props.checkboxLabelStyle}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n emptyListStyle: { alignItems: 'center', width: '100%', marginVertical: 20 },\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownList;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA6C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC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;EACDtB,cAAc,EAAE;IAAEuB,UAAU,EAAE,QAAQ;IAAEC,KAAK,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAG,CAAC;EAC3EvB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAAC,IAAAuB,QAAA,GAEYnD,YAAY;AAAAoD,OAAA,CAAAnE,OAAA,GAAAkE,QAAA"}
|
|
@@ -26,7 +26,7 @@ const DropdownListItem = _ref => {
|
|
|
26
26
|
const selectedOptionValue = optionValue ?? 'value';
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
28
28
|
style: styles.dropdownModalOptions,
|
|
29
|
-
onPress: () => onChange(item[selectedOptionValue])
|
|
29
|
+
onPress: item.disabled ? () => {} : () => onChange(item[selectedOptionValue]) // intentionally didn't use the disable property
|
|
30
30
|
}, /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
|
|
31
31
|
value: isMultiple ? selectedOption.includes(item[selectedOptionValue]) : [selectedOption].includes(item[selectedOptionValue]),
|
|
32
32
|
label: item[optionLabel ?? ''],
|
|
@@ -34,7 +34,8 @@ const DropdownListItem = _ref => {
|
|
|
34
34
|
primaryColor: primaryColor,
|
|
35
35
|
checkboxSize: checkboxSize,
|
|
36
36
|
checkboxStyle: checkboxStyle,
|
|
37
|
-
checkboxLabelStyle: checkboxLabelStyle
|
|
37
|
+
checkboxLabelStyle: checkboxLabelStyle,
|
|
38
|
+
disabled: item.disabled
|
|
38
39
|
}));
|
|
39
40
|
};
|
|
40
41
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_CheckBox","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownListItem","_ref","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","selectedOptionValue","createElement","TouchableOpacity","style","styles","dropdownModalOptions","onPress","value","includes","label","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems","_default","memo","exports"],"sources":["DropdownListItem.tsx"],"sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\n\nconst DropdownListItem = ({\n item,\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption,\n onChange,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n}: any) => {\n const selectedOptionValue = optionValue ?? 'value';\n return (\n <TouchableOpacity\n style={styles.dropdownModalOptions}\n onPress={() => onChange(item[selectedOptionValue])}\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 />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n dropdownModalOptions: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\n\nexport default memo(DropdownListItem);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmC,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gB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AmB,GAAGR,WAAW,IAAI,OAAO;EAClD,oBACEhC,MAAA,CAAAQ,OAAA,CAAAiC,aAAA,CAACtC,YAAA,CAAAuC,gBAAgB;IACfC,KAAK,EAAEC,MAAM,CAACC,oBAAqB;IACnCC,OAAO,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_CheckBox","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownListItem","_ref","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","selectedOptionValue","createElement","TouchableOpacity","style","styles","dropdownModalOptions","onPress","disabled","value","includes","label","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems","_default","memo","exports"],"sources":["DropdownListItem.tsx"],"sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\n\nconst DropdownListItem = ({\n item,\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption,\n onChange,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n}: any) => {\n const selectedOptionValue = optionValue ?? 'value';\n return (\n <TouchableOpacity\n style={styles.dropdownModalOptions}\n onPress={\n item.disabled ? () => {} : () => onChange(item[selectedOptionValue]) // intentionally didn't use the disable property\n }\n >\n <CheckBox\n value={\n isMultiple\n ? selectedOption.includes(item[selectedOptionValue])\n : [selectedOption].includes(item[selectedOptionValue])\n }\n label={item[optionLabel ?? '']}\n onChange={() => onChange(item[selectedOptionValue])}\n primaryColor={primaryColor}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n disabled={item.disabled}\n />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create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AEjB,IAAI,CAACiB;EAAS,EACxB,CACe;AAEvB,CAAC;AAED,MAAMH,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,oBAAoB,EAAE;IACpBQ,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,gBAEY,IAAAC,WAAI,EAAC9B,gBAAgB,CAAC;AAAA+B,OAAA,CAAAnD,OAAA,GAAAiD,QAAA"}
|
|
@@ -20,6 +20,7 @@ const DropdownSelectedItemsView = _ref => {
|
|
|
20
20
|
selectedItems,
|
|
21
21
|
dropdownStyle,
|
|
22
22
|
selectedItemStyle,
|
|
23
|
+
placeholderStyle,
|
|
23
24
|
multipleSelectedItemStyle,
|
|
24
25
|
dropdownErrorStyle,
|
|
25
26
|
primaryColor,
|
|
@@ -63,7 +64,7 @@ const DropdownSelectedItemsView = _ref => {
|
|
|
63
64
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
64
65
|
style: [styles.blackText, selectedItemStyle]
|
|
65
66
|
}, getSelectedItemsLabel()))), !selectedItem && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0 && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
66
|
-
style: styles.blackText
|
|
67
|
+
style: [styles.blackText, placeholderStyle]
|
|
67
68
|
}, placeholder ?? 'Select an option')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
68
69
|
style: styles.iconStyle
|
|
69
70
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_input","obj","__esModule","default","DropdownSelectedItemsView","_ref","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownStyle","selectedItemStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","createElement","Pressable","onPress","style","_ref2","pressed","inputStyles","inputFocusState","borderColor","input","inputFocusErrorState","ScrollView","horizontal","alwaysBounceHorizontal","showsHorizontalScrollIndicator","View","styles","selectedItemsContainer","onStartShouldSetResponder","map","item","i","TouchableOpacity","key","Math","random","Text","backgroundColor","blackText","length","iconStyle","Image","source","StyleSheet","create","position","right","top","flexDirection","flexWrap","color","colors","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black","_default","exports"],"sources":["DropdownSelectedItemsView.tsx"],"sourcesContent":["import React from 'react';\nimport {\n View,\n Text,\n Pressable,\n ScrollView,\n StyleSheet,\n Image,\n TouchableOpacity,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { inputStyles } from '../../styles/input';\n\nconst DropdownSelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <Pressable\n onPress={() => handleToggleModal()}\n style={({ pressed }) => [\n pressed && {\n ...inputStyles.inputFocusState,\n borderColor: primaryColor,\n },\n inputStyles.input,\n dropdownStyle,\n error && //this must be last\n error !== '' &&\n !pressed && {\n ...inputStyles.inputFocusErrorState,\n ...dropdownErrorStyle,\n },\n ]}\n disabled={disabled}\n >\n <ScrollView\n horizontal\n alwaysBounceHorizontal\n showsHorizontalScrollIndicator={false}\n >\n <View\n style={styles.selectedItemsContainer}\n onStartShouldSetResponder={() => true}\n >\n {isMultiple ? (\n getSelectedItemsLabel().map((item: any, i: Number) => (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n key={`react-native-input-select-${Math.random()}-${i}`}\n disabled={disabled}\n >\n <Text\n style={[\n styles.selectedItems,\n { backgroundColor: primaryColor },\n multipleSelectedItemStyle,\n ]}\n >\n {item}\n </Text>\n </TouchableOpacity>\n ))\n ) : (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n disabled={disabled}\n >\n <Text style={[styles.blackText, selectedItemStyle]}>\n {getSelectedItemsLabel()}\n </Text>\n </TouchableOpacity>\n )}\n </View>\n\n {!selectedItem && selectedItems?.length === 0 && (\n <Text style={styles.blackText}>\n {placeholder ?? 'Select an option'}\n </Text>\n )}\n </ScrollView>\n <View style={styles.iconStyle}>\n <Image source={require('../../asset/arrow-down.png')} />\n </View>\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n iconStyle: { position: 'absolute', right: 25, top: 25 },\n selectedItemsContainer: { flexDirection: 'row', flexWrap: 'nowrap' },\n selectedItems: {\n color: colors.white,\n paddingHorizontal: 10,\n paddingVertical: 5,\n borderRadius: 10,\n backgroundColor: colors.primary,\n marginRight: 10,\n overflow: 'hidden',\n },\n blackText: { color: colors.black },\n});\n\nexport default DropdownSelectedItemsView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAiD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEjD,MAAMG,yBAAyB,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_input","obj","__esModule","default","DropdownSelectedItemsView","_ref","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","createElement","Pressable","onPress","style","_ref2","pressed","inputStyles","inputFocusState","borderColor","input","inputFocusErrorState","ScrollView","horizontal","alwaysBounceHorizontal","showsHorizontalScrollIndicator","View","styles","selectedItemsContainer","onStartShouldSetResponder","map","item","i","TouchableOpacity","key","Math","random","Text","backgroundColor","blackText","length","iconStyle","Image","source","StyleSheet","create","position","right","top","flexDirection","flexWrap","color","colors","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black","_default","exports"],"sources":["DropdownSelectedItemsView.tsx"],"sourcesContent":["import React from 'react';\nimport {\n View,\n Text,\n Pressable,\n ScrollView,\n StyleSheet,\n Image,\n TouchableOpacity,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { inputStyles } from '../../styles/input';\n\nconst DropdownSelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <Pressable\n onPress={() => handleToggleModal()}\n style={({ pressed }) => [\n pressed && {\n ...inputStyles.inputFocusState,\n borderColor: primaryColor,\n },\n inputStyles.input,\n dropdownStyle,\n error && //this must be last\n error !== '' &&\n !pressed && {\n ...inputStyles.inputFocusErrorState,\n ...dropdownErrorStyle,\n },\n ]}\n disabled={disabled}\n >\n <ScrollView\n horizontal\n alwaysBounceHorizontal\n showsHorizontalScrollIndicator={false}\n >\n <View\n style={styles.selectedItemsContainer}\n onStartShouldSetResponder={() => true}\n >\n {isMultiple ? (\n getSelectedItemsLabel().map((item: any, i: Number) => (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n key={`react-native-input-select-${Math.random()}-${i}`}\n disabled={disabled}\n >\n <Text\n style={[\n styles.selectedItems,\n { backgroundColor: primaryColor },\n multipleSelectedItemStyle,\n ]}\n >\n {item}\n </Text>\n </TouchableOpacity>\n ))\n ) : (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n disabled={disabled}\n >\n <Text style={[styles.blackText, selectedItemStyle]}>\n {getSelectedItemsLabel()}\n </Text>\n </TouchableOpacity>\n )}\n </View>\n\n {!selectedItem && selectedItems?.length === 0 && (\n <Text style={[styles.blackText, placeholderStyle]}>\n {placeholder ?? 'Select an option'}\n </Text>\n )}\n </ScrollView>\n <View style={styles.iconStyle}>\n <Image source={require('../../asset/arrow-down.png')} />\n </View>\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n iconStyle: { position: 'absolute', right: 25, top: 25 },\n selectedItemsContainer: { flexDirection: 'row', flexWrap: 'nowrap' },\n selectedItems: {\n color: colors.white,\n paddingHorizontal: 10,\n paddingVertical: 5,\n borderRadius: 10,\n backgroundColor: colors.primary,\n marginRight: 10,\n overflow: 'hidden',\n },\n blackText: { color: colors.black },\n});\n\nexport default DropdownSelectedItemsView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAiD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEjD,MAAMG,yBAAyB,GAAGC,IAAA,IAevB;EAAA,IAfwB;IACjCC,WAAW;IACXC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,aAAa;IACbC,iBAAiB;IACjBC,gBAAgB;IAChBC,yBAAyB;IACzBC,kBAAkB;IAClBC,YAAY;IACZC;EACG,CAAC,GAAAd,IAAA;EACJ,oBACEV,MAAA,CAAAQ,OAAA,CAAAiB,aAAA,CAACtB,YAAA,CAAAuB,SAAS;IACRC,OAAO,EAAEA,CAAA,KAAMb,iBAAiB,EAAG;IACnCc,KAAK,EAAEC,KAAA;MAAA,IAAC;QAAEC;MAAQ,CAAC,GAAAD,KAAA;MAAA,OAAK,CACtBC,OAAO,IAAI;QACT,GAAGC,kBAAW,CAACC,eAAe;QAC9BC,WAAW,EAAEV;MACf,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AAmE,OAAA,CAAApE,OAAA,GAAAmE,QAAA"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -46,6 +46,7 @@ const DropdownSelect = _ref => {
|
|
|
46
46
|
checkboxSize,
|
|
47
47
|
checkboxStyle,
|
|
48
48
|
checkboxLabelStyle,
|
|
49
|
+
placeholderStyle,
|
|
49
50
|
...rest
|
|
50
51
|
} = _ref;
|
|
51
52
|
const [newOptions, setNewOptions] = (0, _react.useState)(options ? options : []);
|
|
@@ -78,7 +79,7 @@ const DropdownSelect = _ref => {
|
|
|
78
79
|
setSelectedItems(selectedValues);
|
|
79
80
|
onValueChange(selectedValues); //send value to parent
|
|
80
81
|
|
|
81
|
-
if (
|
|
82
|
+
if (options.length === selectedValues.length) {
|
|
82
83
|
setSelectAll(true);
|
|
83
84
|
} else {
|
|
84
85
|
setSelectAll(false);
|
|
@@ -87,9 +88,10 @@ const DropdownSelect = _ref => {
|
|
|
87
88
|
const handleSelectAll = () => {
|
|
88
89
|
setSelectAll(prevVal => {
|
|
89
90
|
const selectedValues = [];
|
|
91
|
+
const filteredOptions = newOptions.filter(item => !item.disabled); //don't select disabled items
|
|
90
92
|
if (!prevVal) {
|
|
91
|
-
for (let i = 0; i <
|
|
92
|
-
selectedValues.push(
|
|
93
|
+
for (let i = 0; i < filteredOptions.length; i++) {
|
|
94
|
+
selectedValues.push(filteredOptions[i][optionValue]);
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
setSelectedItems(selectedValues);
|
|
@@ -158,35 +160,38 @@ const DropdownSelect = _ref => {
|
|
|
158
160
|
multipleSelectedItemStyle: multipleSelectedItemStyle,
|
|
159
161
|
isMultiple: isMultiple,
|
|
160
162
|
primaryColor: primary,
|
|
161
|
-
disabled: disabled
|
|
163
|
+
disabled: disabled,
|
|
164
|
+
placeholderStyle: placeholderStyle
|
|
162
165
|
}, rest)), /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
163
166
|
open: open,
|
|
164
167
|
handleToggleModal: handleToggleModal,
|
|
165
168
|
modalBackgroundStyle: modalBackgroundStyle,
|
|
166
169
|
modalOptionsContainer: modalOptionsContainer,
|
|
167
170
|
onRequestClose: () => {}
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement(_DropdownList.default, {
|
|
172
|
+
ListHeaderComponent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isSearchable && /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
173
|
+
value: searchValue,
|
|
174
|
+
onChangeText: text => onSearch(text),
|
|
175
|
+
style: searchInputStyle,
|
|
176
|
+
primaryColor: primary
|
|
177
|
+
}), isMultiple && newOptions.length > 1 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
178
|
+
style: styles.optionsContainerStyle
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
180
|
+
onPress: () => {}
|
|
181
|
+
}, /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
|
|
182
|
+
value: selectAll,
|
|
183
|
+
label: selectAll ? 'Clear all' : 'Select all',
|
|
184
|
+
onChange: () => handleSelectAll(),
|
|
185
|
+
primaryColor: primary,
|
|
186
|
+
checkboxSize: checkboxSize,
|
|
187
|
+
checkboxStyle: checkboxStyle,
|
|
188
|
+
checkboxLabelStyle: checkboxLabelStyle
|
|
189
|
+
})))),
|
|
186
190
|
options: newOptions,
|
|
187
191
|
optionLabel: optionLabel,
|
|
188
192
|
optionValue: optionValue,
|
|
189
193
|
isMultiple: isMultiple,
|
|
194
|
+
isSearchable: isSearchable,
|
|
190
195
|
selectedItems: selectedItems,
|
|
191
196
|
selectedItem: selectedItem,
|
|
192
197
|
handleMultipleSelections: handleMultipleSelections,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Dropdown","_interopRequireDefault","_DropdownList","_CustomModal","_Input","_CheckBox","_colors","_constants","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","labelStyle","dropdownStyle","dropdownContainerStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","selectedItemStyle","multipleSelectedItemStyle","modalBackgroundStyle","modalOptionsContainer","searchInputStyle","primaryColor","disabled","checkboxSize","checkboxStyle","checkboxLabelStyle","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","Array","isArray","undefined","searchValue","setSearchValue","handleSingleSelection","value","handleMultipleSelections","selectedValues","includes","filter","item","push","handleSelectAll","prevVal","getSelectedItemsLabel","selectedLabels","forEach","element","_options$find","selectedItemLabel","find","DEFAULT_OPTION_VALUE","DEFAULT_OPTION_LABEL","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","toLowerCase","search","handleToggleModal","primary","colors","gray","createElement","Fragment","onRequestClose","Input","onChangeText","text","style","View","styles","optionsContainerStyle","TouchableOpacity","onPress","onChange","exports","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TouchableOpacity, StyleSheet, View } from 'react-native';\nimport Dropdown from './components/Dropdown/Dropdown';\nimport DropdownList from './components/Dropdown/DropdownList';\nimport CustomModal from './components/CustomModal';\nimport { Input } from './components/Input';\nimport CheckBox from './components/CheckBox';\nimport { colors } from './styles/colors';\nimport { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';\nimport type { DropdownProps } from './types/index.types';\n\nexport const DropdownSelect = ({\n placeholder,\n label,\n error,\n helperText,\n options,\n optionLabel,\n optionValue,\n onValueChange,\n selectedValue,\n isMultiple,\n isSearchable,\n labelStyle,\n dropdownStyle,\n dropdownContainerStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n modalBackgroundStyle,\n modalOptionsContainer,\n searchInputStyle,\n primaryColor,\n disabled,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n ...rest\n}: DropdownProps) => {\n const [newOptions, setNewOptions] = useState(options ? options : []);\n const [open, setOpen] = useState(false);\n const [selectAll, setSelectAll] = useState(false);\n const [selectedItem, setSelectedItem] = useState(selectedValue); //for single selection\n const [selectedItems, setSelectedItems] = useState(\n Array.isArray(selectedValue)\n ? selectedValue\n : selectedValue === '' || selectedValue === undefined\n ? []\n : [selectedValue]\n ); //for multiple selection\n const [searchValue, setSearchValue] = useState('');\n\n /*===========================================\n * Selection handlers\n *==========================================*/\n const handleSingleSelection = (value: any) => {\n if (selectedItem === value) {\n setSelectedItem(null);\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: any) => {\n let selectedValues = [...selectedItems];\n\n if (selectedValues.includes(value)) {\n selectedValues = selectedValues.filter((item) => item !== value);\n } else {\n selectedValues.push(value);\n }\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n\n if (newOptions.length === selectedValues.length) {\n setSelectAll(true);\n } else {\n setSelectAll(false);\n }\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n if (!prevVal) {\n for (let i = 0; i < newOptions.length; i++) {\n selectedValues.push(newOptions[i][optionValue]);\n }\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n return !prevVal;\n });\n };\n\n /*===========================================\n * Get label handler\n *==========================================*/\n const getSelectedItemsLabel = () => {\n if (isMultiple) {\n let selectedLabels: Array<string> = [];\n selectedItems &&\n selectedItems.forEach((element) => {\n let selectedItemLabel =\n options &&\n options.find(\n (item: any) =>\n item[optionValue ?? DEFAULT_OPTION_VALUE] === element\n )?.[optionLabel];\n selectedLabels.push(selectedItemLabel);\n });\n return selectedLabels;\n }\n\n let selectedItemLabel =\n options &&\n options.find(\n (item: any) =>\n item[optionValue ?? DEFAULT_OPTION_VALUE] === selectedItem\n );\n return selectedItemLabel?.[optionLabel ?? DEFAULT_OPTION_LABEL];\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 const searchResults = options.filter((item: any) => {\n if (\n item[optionLabel ?? DEFAULT_OPTION_LABEL]\n .toString()\n .toLowerCase()\n .search(regexFilter) !== -1 ||\n item[optionValue ?? DEFAULT_OPTION_VALUE]\n .toString(regexFilter)\n .toLowerCase()\n .search(regexFilter) !== -1\n ) {\n return item;\n }\n });\n\n setNewOptions(searchResults);\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n };\n\n let primary = primaryColor || colors.gray;\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 dropdownStyle={dropdownStyle}\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 {...rest}\n />\n <CustomModal\n open={open}\n handleToggleModal={handleToggleModal}\n modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainer={modalOptionsContainer}\n onRequestClose={() => {}}\n >\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchInputStyle}\n primaryColor={primary}\n />\n )}\n {isMultiple && newOptions.length > 1 && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={selectAll ? 'Clear all' : 'Select all'}\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n />\n </TouchableOpacity>\n </View>\n )}\n <DropdownList\n options={newOptions}\n optionLabel={optionLabel}\n optionValue={optionValue}\n isMultiple={isMultiple}\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 />\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,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,S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,CAAA4G,aAAA,CAACjH,SAAA,CAAAK,OAAQ;IACP4E,KAAK,EAAEZ,SAAU;IACjBhC,KAAK,EAAEgC,SAAS,GAAG,WAAW,GAAG,YAAa;IAC9CwD,QAAQ,EAAEA,CAAA,KAAMrC,eAAe,EAAG;IAClC9B,YAAY,EAAEoD,OAAQ;IACtBlD,YAAY,EAAEA,YAAa;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,kBAAkB,EAAEA;EAAmB,EACvC,CACe,CAEtB,eACDvE,MAAA,CAAAc,OAAA,CAAA4G,aAAA,CAACpH,aAAA,CAAAQ,OAAY;IACXmC,OAAO,EAAEwB,UAAW;IACpBvB,WAAW,EAAEA,WAAY;IACzBC,WAAW,EAAEA,WAAY;IACzBG,UAAU,EAAEA,UAAW;IACvB4B,aAAa,EAAEA,aAAc;IAC7BF,YAAY,EAAEA,YAAa;IAC3BW,wBAAwB,EAAEA,wBAAyB;IACnDF,qBAAqB,EAAEA,qBAAsB;IAC7CtB,YAAY,EAAEoD,OAAQ;IACtBlD,YAAY,EAAEA,YAAa;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,kBAAkB,EAAEA;EAAmB,EACvC,CACU,CACb;AAEP,CAAC;AAACgE,OAAA,CAAA5F,cAAA,GAAAA,cAAA;AAEF,MAAMuF,MAAM,GAAGM,uBAAU,CAACC,MAAM,CAAC;EAC/BN,qBAAqB,EAAE;IACrBO,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYlG,cAAc;AAAA4F,OAAA,CAAAzH,OAAA,GAAA+H,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Dropdown","_interopRequireDefault","_DropdownList","_CustomModal","_Input","_CheckBox","_colors","_constants","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","labelStyle","dropdownStyle","dropdownContainerStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","selectedItemStyle","multipleSelectedItemStyle","modalBackgroundStyle","modalOptionsContainer","searchInputStyle","primaryColor","disabled","checkboxSize","checkboxStyle","checkboxLabelStyle","placeholderStyle","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","Array","isArray","undefined","searchValue","setSearchValue","handleSingleSelection","value","handleMultipleSelections","selectedValues","includes","filter","item","push","handleSelectAll","prevVal","filteredOptions","getSelectedItemsLabel","selectedLabels","forEach","element","_options$find","selectedItemLabel","find","DEFAULT_OPTION_VALUE","DEFAULT_OPTION_LABEL","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","toLowerCase","search","handleToggleModal","primary","colors","gray","createElement","Fragment","onRequestClose","ListHeaderComponent","Input","onChangeText","text","style","View","styles","optionsContainerStyle","TouchableOpacity","onPress","onChange","exports","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TouchableOpacity, StyleSheet, View } from 'react-native';\nimport Dropdown from './components/Dropdown/Dropdown';\nimport DropdownList from './components/Dropdown/DropdownList';\nimport CustomModal from './components/CustomModal';\nimport { Input } from './components/Input';\nimport CheckBox from './components/CheckBox';\nimport { colors } from './styles/colors';\nimport { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';\nimport type { DropdownProps } from './types/index.types';\n\nexport const DropdownSelect = ({\n placeholder,\n label,\n error,\n helperText,\n options,\n optionLabel,\n optionValue,\n onValueChange,\n selectedValue,\n isMultiple,\n isSearchable,\n labelStyle,\n dropdownStyle,\n dropdownContainerStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n modalBackgroundStyle,\n modalOptionsContainer,\n searchInputStyle,\n primaryColor,\n disabled,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n placeholderStyle,\n ...rest\n}: DropdownProps) => {\n const [newOptions, setNewOptions] = useState(options ? options : []);\n const [open, setOpen] = useState(false);\n const [selectAll, setSelectAll] = useState(false);\n const [selectedItem, setSelectedItem] = useState(selectedValue); //for single selection\n const [selectedItems, setSelectedItems] = useState(\n Array.isArray(selectedValue)\n ? selectedValue\n : selectedValue === '' || selectedValue === undefined\n ? []\n : [selectedValue]\n ); //for multiple selection\n const [searchValue, setSearchValue] = useState('');\n\n /*===========================================\n * Selection handlers\n *==========================================*/\n const handleSingleSelection = (value: any) => {\n if (selectedItem === value) {\n setSelectedItem(null);\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: any) => {\n let selectedValues = [...selectedItems];\n\n if (selectedValues.includes(value)) {\n selectedValues = selectedValues.filter((item) => item !== value);\n } else {\n selectedValues.push(value);\n }\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n\n if (options.length === selectedValues.length) {\n setSelectAll(true);\n } else {\n setSelectAll(false);\n }\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n const filteredOptions = newOptions.filter((item) => !item.disabled); //don't select disabled items\n if (!prevVal) {\n for (let i = 0; i < filteredOptions.length; i++) {\n selectedValues.push(filteredOptions[i][optionValue]);\n }\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n return !prevVal;\n });\n };\n\n /*===========================================\n * Get label handler\n *==========================================*/\n const getSelectedItemsLabel = () => {\n if (isMultiple) {\n let selectedLabels: Array<string> = [];\n selectedItems &&\n selectedItems.forEach((element) => {\n let selectedItemLabel =\n options &&\n options.find(\n (item: any) =>\n item[optionValue ?? DEFAULT_OPTION_VALUE] === element\n )?.[optionLabel];\n selectedLabels.push(selectedItemLabel);\n });\n return selectedLabels;\n }\n\n let selectedItemLabel =\n options &&\n options.find(\n (item: any) =>\n item[optionValue ?? DEFAULT_OPTION_VALUE] === selectedItem\n );\n return selectedItemLabel?.[optionLabel ?? DEFAULT_OPTION_LABEL];\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 const searchResults = options.filter((item: any) => {\n if (\n item[optionLabel ?? DEFAULT_OPTION_LABEL]\n .toString()\n .toLowerCase()\n .search(regexFilter) !== -1 ||\n item[optionValue ?? DEFAULT_OPTION_VALUE]\n .toString(regexFilter)\n .toLowerCase()\n .search(regexFilter) !== -1\n ) {\n return item;\n }\n });\n\n setNewOptions(searchResults);\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n };\n\n let primary = primaryColor || colors.gray;\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 dropdownStyle={dropdownStyle}\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 {...rest}\n />\n <CustomModal\n open={open}\n handleToggleModal={handleToggleModal}\n modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainer={modalOptionsContainer}\n onRequestClose={() => {}}\n >\n <DropdownList\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 {isMultiple && newOptions.length > 1 && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={selectAll ? 'Clear all' : 'Select all'}\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n />\n </TouchableOpacity>\n </View>\n )}\n </>\n }\n options={newOptions}\n optionLabel={optionLabel}\n optionValue={optionValue}\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 />\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,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAAy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,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["colors","primary","red","black","white","dark","gray","lightGray","exports"],"sources":["colors.ts"],"sourcesContent":["export const colors: any = {\n primary: 'green',\n red: '#FA4169',\n black: '#000000',\n white: '#FFFFFF',\n dark: '#11142D',\n gray: '#808191',\n lightGray: '#F7F7F7',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,MAAW,GAAG;EACzBC,OAAO,EAAE,OAAO;EAChBC,GAAG,EAAE,SAAS;EACdC,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,SAAS;EACfC,IAAI,EAAE,SAAS;EACfC,SAAS,EAAE;
|
|
1
|
+
{"version":3,"names":["colors","primary","red","black","white","dark","gray","lightGray","disabled","exports"],"sources":["colors.ts"],"sourcesContent":["export const colors: any = {\n primary: 'green',\n red: '#FA4169',\n black: '#000000',\n white: '#FFFFFF',\n dark: '#11142D',\n gray: '#808191',\n lightGray: '#F7F7F7',\n disabled: '#d3d3d3',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,MAAW,GAAG;EACzBC,OAAO,EAAE,OAAO;EAChBC,GAAG,EAAE,SAAS;EACdC,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,SAAS;EACfC,IAAI,EAAE,SAAS;EACfC,SAAS,EAAE,SAAS;EACpBC,QAAQ,EAAE;AACZ,CAAC;AAACC,OAAA,CAAAT,MAAA,GAAAA,MAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.types.ts"],"sourcesContent":["import type { ViewStyle, ColorValue, TextStyle } from 'react-native';\n\nexport type DropdownProps = {\n placeholder?: string;\n label?: string;\n error?: string;\n helperText?: string;\n options: any[];\n optionLabel: string;\n optionValue: string;\n onValueChange: Function;\n selectedValue?: string | any[] | null;\n isMultiple?: boolean;\n isSearchable?: boolean;\n labelStyle?: TextStyle;\n dropdownStyle?: ViewStyle;\n dropdownContainerStyle?: ViewStyle;\n dropdownErrorStyle?: ViewStyle;\n dropdownErrorTextStyle?: TextStyle;\n dropdownHelperTextStyle?: TextStyle;\n selectedItemStyle?: ViewStyle;\n multipleSelectedItemStyle?: ViewStyle;\n modalBackgroundStyle?: ViewStyle;\n modalOptionsContainer?: ViewStyle;\n searchInputStyle?: ViewStyle;\n primaryColor?: ColorValue;\n disabled?: boolean;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.types.ts"],"sourcesContent":["import type { ViewStyle, ColorValue, TextStyle } from 'react-native';\n\nexport type DropdownProps = {\n placeholder?: string;\n label?: string;\n error?: string;\n helperText?: string;\n options: any[];\n optionLabel: string;\n optionValue: string;\n onValueChange: Function;\n selectedValue?: string | any[] | null;\n isMultiple?: boolean;\n isSearchable?: boolean;\n labelStyle?: TextStyle;\n dropdownStyle?: ViewStyle;\n dropdownContainerStyle?: ViewStyle;\n dropdownErrorStyle?: ViewStyle;\n dropdownErrorTextStyle?: TextStyle;\n dropdownHelperTextStyle?: TextStyle;\n selectedItemStyle?: ViewStyle;\n multipleSelectedItemStyle?: ViewStyle;\n modalBackgroundStyle?: ViewStyle;\n modalOptionsContainer?: ViewStyle;\n searchInputStyle?: ViewStyle;\n primaryColor?: ColorValue;\n disabled?: boolean;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n placeholderStyle?: TextStyle;\n};\n"],"mappings":""}
|