react-native-input-select 0.22.0 → 0.24.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 +17 -6
- package/lib/commonjs/components/CheckBox/index.js +2 -8
- package/lib/commonjs/components/CheckBox/index.js.map +1 -1
- package/lib/commonjs/components/CheckBox/types.js.map +1 -1
- package/lib/commonjs/components/CustomModal/index.js +0 -7
- package/lib/commonjs/components/CustomModal/index.js.map +1 -1
- package/lib/commonjs/components/Dropdown/Dropdown.js +2 -11
- package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownList.js +0 -22
- package/lib/commonjs/components/Dropdown/DropdownList.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownListItem.js +5 -17
- package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -1
- package/lib/commonjs/components/Dropdown/{SelectedItemsView.js → DropdownSelectedItemsView.js} +12 -16
- package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -0
- package/lib/commonjs/components/Input/index.js +1 -10
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/index.js +52 -35
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/colors.js +1 -1
- package/lib/commonjs/styles/colors.js.map +1 -1
- package/lib/commonjs/styles/input.js +0 -4
- package/lib/commonjs/styles/input.js.map +1 -1
- package/lib/commonjs/styles/typography.js +0 -3
- package/lib/commonjs/styles/typography.js.map +1 -1
- package/lib/commonjs/types/index.types.js.map +1 -1
- package/lib/module/components/CheckBox/index.js +1 -3
- package/lib/module/components/CheckBox/index.js.map +1 -1
- package/lib/module/components/CheckBox/types.js.map +1 -1
- package/lib/module/components/CustomModal/index.js +0 -2
- package/lib/module/components/CustomModal/index.js.map +1 -1
- package/lib/module/components/Dropdown/Dropdown.js +2 -4
- package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownList.js +0 -16
- package/lib/module/components/Dropdown/DropdownList.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownListItem.js +5 -8
- package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -1
- package/lib/module/components/Dropdown/{SelectedItemsView.js → DropdownSelectedItemsView.js} +12 -10
- package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -0
- package/lib/module/components/Input/index.js +1 -2
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/index.js +52 -23
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/colors.js +1 -1
- package/lib/module/styles/colors.js.map +1 -1
- package/lib/module/styles/input.js.map +1 -1
- package/lib/module/styles/typography.js.map +1 -1
- package/lib/module/types/index.types.js.map +1 -1
- package/lib/typescript/components/CheckBox/types.d.ts +1 -1
- package/lib/typescript/components/Dropdown/DropdownSelectedItemsView.d.ts +3 -0
- package/lib/typescript/types/index.types.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/CheckBox/index.tsx +3 -1
- package/src/components/Dropdown/Dropdown.tsx +2 -2
- package/src/components/Dropdown/DropdownList.tsx +0 -11
- package/src/components/Dropdown/DropdownListItem.tsx +3 -4
- package/src/components/Dropdown/{SelectedItemsView.tsx → DropdownSelectedItemsView.tsx} +3 -2
- package/src/index.tsx +50 -2
- package/src/styles/colors.ts +1 -1
- package/src/types/index.types.ts +1 -1
- package/lib/commonjs/components/Dropdown/SelectedItemsView.js.map +0 -1
- package/lib/module/components/Dropdown/SelectedItemsView.js.map +0 -1
- package/lib/typescript/components/Dropdown/SelectedItemsView.d.ts +0 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# react-native-input-select
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A fully customizable dropdown selection package for react-native android and iOS with multiple select and search capabilities.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -15,11 +15,6 @@ With yarn
|
|
|
15
15
|
```sh
|
|
16
16
|
yarn add react-native-input-select
|
|
17
17
|
```
|
|
18
|
-
|
|
19
|
-
## Demo
|
|
20
|
-
|
|
21
|
-
https://user-images.githubusercontent.com/9849221/226240418-efa4fe9f-4055-4c03-888e-8b7093adcd63.mov
|
|
22
|
-
|
|
23
18
|
|
|
24
19
|
## Basic Usage
|
|
25
20
|
|
|
@@ -57,6 +52,18 @@ export default function App() {
|
|
|
57
52
|
For more examples visit our [wiki page](https://github.com/azeezat/react-native-select/wiki)
|
|
58
53
|
|
|
59
54
|
|
|
55
|
+
# iOS
|
|
56
|
+
| | | |
|
|
57
|
+
|:-------------------------:|:-------------------------:|:-------------------------:|
|
|
58
|
+
|<img width="529" alt="Screenshot 2023-03-23 at 5 11 54 PM" src="https://user-images.githubusercontent.com/9849221/227392644-a039424a-9bdf-4253-b984-7b043e4a9545.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 00 19 PM" src="https://user-images.githubusercontent.com/9849221/227391036-44b5e935-bc5e-48d6-a3a9-7a285a4879fd.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 00 29 PM" src="https://user-images.githubusercontent.com/9849221/227391040-45772980-e51c-4ebf-aabf-30886ff06e7c.png">|
|
|
59
|
+
|<img width="529" alt="Screenshot 2023-03-23 at 5 00 35 PM" src="https://user-images.githubusercontent.com/9849221/227391043-9e5fe1aa-86aa-438c-9e84-8c38975d3d57.png"> | <img width="529" alt="Screenshot 2023-03-23 at 5 11 54 PM" src="https://user-images.githubusercontent.com/9849221/227391594-f672b97a-c3c0-466c-b615-a887e4a8a6c0.png">|
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Android
|
|
63
|
+
| | | |
|
|
64
|
+
|:-------------------------:|:-------------------------:|:-------------------------:|
|
|
65
|
+
|<img width="456" alt="Screenshot 2023-03-23 at 5 25 07 PM" src="https://user-images.githubusercontent.com/9849221/227393546-3aba8a28-f437-4f8f-9611-bf300c5af8f2.png"> | <img width="456" alt="Screenshot 2023-03-23 at 5 26 58 PM" src="https://user-images.githubusercontent.com/9849221/227393548-28796d7b-9760-43a9-8ed3-fb1618cd1b7d.png"> | <img width="456" alt="Screenshot 2023-03-23 at 5 28 49 PM" src="https://user-images.githubusercontent.com/9849221/227393554-91ed1a92-d229-4814-84d8-5f9095e8d048.png">|
|
|
66
|
+
|
|
60
67
|
## Props
|
|
61
68
|
|
|
62
69
|
| Proptypes | Datatype | Example |
|
|
@@ -97,3 +104,7 @@ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the
|
|
|
97
104
|
## License
|
|
98
105
|
|
|
99
106
|
MIT
|
|
107
|
+
|
|
108
|
+
## Demo
|
|
109
|
+
|
|
110
|
+
https://user-images.githubusercontent.com/9849221/226240418-efa4fe9f-4055-4c03-888e-8b7093adcd63.mov
|
|
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _constants = require("../../constants");
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
/* eslint-disable react-native/no-inline-styles */
|
|
12
|
+
|
|
17
13
|
const CheckBox = _ref => {
|
|
18
14
|
let {
|
|
19
15
|
label,
|
|
@@ -25,7 +21,7 @@ const CheckBox = _ref => {
|
|
|
25
21
|
onChange
|
|
26
22
|
} = _ref;
|
|
27
23
|
const fillColor = {
|
|
28
|
-
backgroundColor: value ? primaryColor || 'green' : 'white'
|
|
24
|
+
backgroundColor: value ? (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.backgroundColor) || primaryColor || 'green' : 'white'
|
|
29
25
|
};
|
|
30
26
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
31
27
|
onPress: onChange ? () => onChange(!value) : () => {},
|
|
@@ -42,7 +38,6 @@ const CheckBox = _ref => {
|
|
|
42
38
|
style: [checkboxLabelStyle, styles.labelStyle]
|
|
43
39
|
}, label));
|
|
44
40
|
};
|
|
45
|
-
|
|
46
41
|
const styles = _reactNative.StyleSheet.create({
|
|
47
42
|
checkboxContainer: {
|
|
48
43
|
flexDirection: 'row',
|
|
@@ -60,7 +55,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
60
55
|
marginLeft: 10
|
|
61
56
|
}
|
|
62
57
|
});
|
|
63
|
-
|
|
64
58
|
var _default = CheckBox;
|
|
65
59
|
exports.default = _default;
|
|
66
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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","styles","checkboxContainer","View","checkbox","Image","source","height","CHECKBOX_SIZE","width","Text","labelStyle","StyleSheet","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","borderColor","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 { CHECKBOX_SIZE } from '../../constants';\nimport type { CheckboxProps } from './types';\n\nconst CheckBox = ({\n label,\n value,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n onChange,\n}: CheckboxProps) => {\n const fillColor = {\n backgroundColor: value\n ? checkboxStyle?.backgroundColor || primaryColor || 'green'\n : 'white',\n };\n return (\n <Pressable\n onPress={onChange ? () => onChange(!value) : () => {}}\n style={[styles.checkboxContainer]}\n >\n <View style={[styles.checkbox, checkboxStyle, fillColor]}>\n <Image\n source={require('../../asset/check.png')}\n style={[\n {\n height: checkboxSize || CHECKBOX_SIZE,\n width: checkboxSize || CHECKBOX_SIZE,\n },\n ]}\n />\n </View>\n {label && (\n <Text style={[checkboxLabelStyle, styles.labelStyle]}>{label}</Text>\n )}\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n checkboxContainer: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n },\n checkbox: {\n padding: 4,\n borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: 4,\n borderColor: 'black',\n },\n labelStyle: { marginLeft: 10 },\n});\n\nexport default CheckBox;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAgD,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAHhD;;AAMA,MAAMG,QAAQ,GAAGC,IAAA,IAQI;EAAA,IARH;IAChBC,KAAK;IACLC,KAAK;IACLC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC,kBAAkB;IAClBC;EACa,CAAC,GAAAP,IAAA;EACd,MAAMQ,SAAS,GAAG;IAChBC,eAAe,EAAEP,KAAK,GAClB,CAAAG,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEI,eAAe,KAAIN,YAAY,IAAI,OAAO,GACzD;EACN,CAAC;EACD,oBACEZ,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAChB,YAAA,CAAAiB,SAAS;IACRC,OAAO,EAAEL,QAAQ,GAAG,MAAMA,QAAQ,CAAC,CAACL,KAAK,CAAC,GAAG,MAAM,CAAC,CAAE;IACtDW,KAAK,EAAE,CAACC,MAAM,CAACC,iBAAiB;EAAE,gBAElCxB,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAChB,YAAA,CAAAsB,IAAI;IAACH,KAAK,EAAE,CAACC,MAAM,CAACG,QAAQ,EAAEZ,aAAa,EAAEG,SAAS;EAAE,gBACvDjB,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAChB,YAAA,CAAAwB,KAAK;IACJC,MAAM,EAAE1B,OAAO,CAAC,uBAAuB,CAAE;IACzCoB,KAAK,EAAE,CACL;MACEO,MAAM,EAAEhB,YAAY,IAAIiB,wBAAa;MACrCC,KAAK,EAAElB,YAAY,IAAIiB;IACzB,CAAC;EACD,EACF,CACG,EACNpB,KAAK,iBACJV,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAChB,YAAA,CAAA6B,IAAI;IAACV,KAAK,EAAE,CAACP,kBAAkB,EAAEQ,MAAM,CAACU,UAAU;EAAE,GAAEvB,KAAK,CAC7D,CACS;AAEhB,CAAC;AAED,MAAMa,MAAM,GAAGW,uBAAU,CAACC,MAAM,CAAC;EAC/BX,iBAAiB,EAAE;IACjBY,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACDZ,QAAQ,EAAE;IACRa,OAAO,EAAE,CAAC;IACVC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,OAAO;IACpBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACDV,UAAU,EAAE;IAAEW,UAAU,EAAE;EAAG;AAC/B,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYrC,QAAQ;AAAAsC,OAAA,CAAAvC,OAAA,GAAAsC,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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":""}
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _colors = require("../../styles/colors");
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
const CustomModal = _ref => {
|
|
17
12
|
let {
|
|
18
13
|
open,
|
|
@@ -34,7 +29,6 @@ const CustomModal = _ref => {
|
|
|
34
29
|
style: [styles.modalOptionsContainer, modalOptionsContainerStyle]
|
|
35
30
|
}, children)));
|
|
36
31
|
};
|
|
37
|
-
|
|
38
32
|
const styles = _reactNative.StyleSheet.create({
|
|
39
33
|
modalContainer: {
|
|
40
34
|
flex: 1,
|
|
@@ -50,7 +44,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
50
44
|
borderTopRightRadius: 16
|
|
51
45
|
}
|
|
52
46
|
});
|
|
53
|
-
|
|
54
47
|
var _default = CustomModal;
|
|
55
48
|
exports.default = _default;
|
|
56
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","CustomModal","_ref","open","handleToggleModal","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","children","createElement","Modal","transparent","visible","animationType","TouchableOpacity","onPress","style","styles","modalContainer","SafeAreaView","modalOptionsContainer","StyleSheet","create","flex","justifyContent","backgroundColor","maxHeight","colors","white","borderTopLeftRadius","borderTopRightRadius","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Modal,\n TouchableOpacity,\n SafeAreaView,\n StyleSheet,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nconst CustomModal = ({\n open,\n handleToggleModal,\n onRequestClose,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n children,\n}: any) => {\n return (\n <Modal\n transparent={true}\n visible={open}\n onRequestClose={() => onRequestClose()}\n animationType=\"fade\"\n >\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n style={[\n styles.modalContainer,\n styles.modalBackgroundStyle,\n modalBackgroundStyle,\n ]}\n >\n <SafeAreaView\n style={[styles.modalOptionsContainer, modalOptionsContainerStyle]}\n >\n {children}\n </SafeAreaView>\n </TouchableOpacity>\n </Modal>\n );\n};\n\nconst styles = StyleSheet.create({\n modalContainer: {\n flex: 1,\n justifyContent: 'flex-end',\n },\n modalBackgroundStyle: { backgroundColor: 'rgba(0, 0, 0, 0.5)' },\n modalOptionsContainer: {\n maxHeight: '50%',\n backgroundColor: colors.white,\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n },\n});\n\nexport default CustomModal;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE7C,MAAMG,WAAW,GAAGC,IAAA,IAOT;EAAA,IAPU;IACnBC,IAAI;IACJC,iBAAiB;IACjBC,cAAc;IACdC,oBAAoB;IACpBC,0BAA0B;IAC1BC;EACG,CAAC,GAAAN,IAAA;EACJ,oBACET,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAc,KAAK;IACJC,WAAW,EAAE,IAAK;IAClBC,OAAO,EAAET,IAAK;IACdE,cAAc,EAAEA,CAAA,KAAMA,cAAc,EAAG;IACvCQ,aAAa,EAAC;EAAM,gBAEpBpB,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAkB,gBAAgB;IACfC,OAAO,EAAEA,CAAA,KAAMX,iBAAiB,EAAG;IACnCY,KAAK,EAAE,CACLC,MAAM,CAACC,cAAc,EACrBD,MAAM,CAACX,oBAAoB,EAC3BA,oBAAoB;EACpB,gBAEFb,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAuB,YAAY;IACXH,KAAK,EAAE,CAACC,MAAM,CAACG,qBAAqB,EAAEb,0BAA0B;EAAE,GAEjEC,QAAQ,CACI,CACE,CACb;AAEZ,CAAC;AAED,MAAMS,MAAM,GAAGI,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,cAAc,EAAE;IACdK,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDlB,oBAAoB,EAAE;IAAEmB,eAAe,EAAE;EAAqB,CAAC;EAC/DL,qBAAqB,EAAE;IACrBM,SAAS,EAAE,KAAK;IAChBD,eAAe,EAAEE,cAAM,CAACC,KAAK;IAC7BC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9B,WAAW;AAAA+B,OAAA,CAAAhC,OAAA,GAAA+B,QAAA"}
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _SelectedItemsView = _interopRequireDefault(require("./SelectedItemsView"));
|
|
13
|
-
|
|
9
|
+
var _DropdownSelectedItemsView = _interopRequireDefault(require("./DropdownSelectedItemsView"));
|
|
14
10
|
var _colors = require("../../styles/colors");
|
|
15
|
-
|
|
16
11
|
var _typography = require("../../styles/typography");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
const Dropdown = _ref => {
|
|
21
14
|
let {
|
|
22
15
|
label,
|
|
@@ -43,7 +36,7 @@ const Dropdown = _ref => {
|
|
|
43
36
|
style: [styles.dropdownInputContainer, dropdownContainerStyle]
|
|
44
37
|
}, label && label !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
45
38
|
style: [styles.label, labelStyle]
|
|
46
|
-
}, label), /*#__PURE__*/_react.default.createElement(
|
|
39
|
+
}, label), /*#__PURE__*/_react.default.createElement(_DropdownSelectedItemsView.default, {
|
|
47
40
|
placeholder: placeholder,
|
|
48
41
|
error: error,
|
|
49
42
|
getSelectedItemsLabel: getSelectedItemsLabel,
|
|
@@ -63,7 +56,6 @@ const Dropdown = _ref => {
|
|
|
63
56
|
style: [styles.helper, dropdownHelperTextStyle]
|
|
64
57
|
}, helperText));
|
|
65
58
|
};
|
|
66
|
-
|
|
67
59
|
const styles = _reactNative.StyleSheet.create({
|
|
68
60
|
label: {
|
|
69
61
|
marginBottom: 16,
|
|
@@ -93,7 +85,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
93
85
|
color: _colors.colors.black
|
|
94
86
|
}
|
|
95
87
|
});
|
|
96
|
-
|
|
97
88
|
var _default = Dropdown;
|
|
98
89
|
exports.default = _default;
|
|
99
90
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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: { marginB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AE;IAAEK,YAAY,EAAE,EAAE;IAAEa,KAAK,EAAE;EAAO,CAAC;EAC3DC,SAAS,EAAE;IAAEb,KAAK,EAAEC,cAAM,CAACa;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9C,QAAQ;AAAA+C,OAAA,CAAAhD,OAAA,GAAA+C,QAAA"}
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _DropdownListItem = _interopRequireDefault(require("./DropdownListItem"));
|
|
13
|
-
|
|
14
10
|
var _colors = require("../../styles/colors");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
const DropdownList = _ref => {
|
|
19
13
|
let {
|
|
20
14
|
options,
|
|
@@ -54,7 +48,6 @@ const DropdownList = _ref => {
|
|
|
54
48
|
keyExtractor: (_item, index) => `Options${index}`
|
|
55
49
|
});
|
|
56
50
|
};
|
|
57
|
-
|
|
58
51
|
const _renderItem = (_ref2, props) => {
|
|
59
52
|
let {
|
|
60
53
|
item
|
|
@@ -72,21 +65,7 @@ const _renderItem = (_ref2, props) => {
|
|
|
72
65
|
checkboxLabelStyle: props.checkboxLabelStyle
|
|
73
66
|
});
|
|
74
67
|
};
|
|
75
|
-
|
|
76
68
|
const styles = _reactNative.StyleSheet.create({
|
|
77
|
-
modalContainer: {
|
|
78
|
-
flex: 1,
|
|
79
|
-
justifyContent: 'flex-end'
|
|
80
|
-
},
|
|
81
|
-
modalBackgroundStyle: {
|
|
82
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
83
|
-
},
|
|
84
|
-
modalOptionsContainer: {
|
|
85
|
-
maxHeight: '50%',
|
|
86
|
-
backgroundColor: _colors.colors.white,
|
|
87
|
-
borderTopLeftRadius: 16,
|
|
88
|
-
borderTopRightRadius: 16
|
|
89
|
-
},
|
|
90
69
|
itemSeparatorStyle: {
|
|
91
70
|
backgroundColor: _colors.colors.gray,
|
|
92
71
|
height: 1,
|
|
@@ -98,7 +77,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
98
77
|
marginVertical: 20
|
|
99
78
|
}
|
|
100
79
|
});
|
|
101
|
-
|
|
102
80
|
var _default = DropdownList;
|
|
103
81
|
exports.default = _default;
|
|
104
82
|
//# sourceMappingURL=DropdownList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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":["import 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 selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\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 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 />\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});\n\nexport default DropdownList;\n"],"mappings":";;;;;;AAAA,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;AAE7C,MAAMG,YAAY,GAAGC,IAAA,IAaV;EAAA,IAbW;IACpBC,OAAO;IACPC,WAAW;IACXC,WAAW;IACXC,UAAU;IACVC,aAAa;IACbC,YAAY;IACZC,wBAAwB;IACxBC,qBAAqB;IACrBC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC;EACG,CAAC,GAAAZ,IAAA;EACJ,oBACEV,MAAA,CAAAQ,OAAA,CAAAe,aAAA,CAACpB,YAAA,CAAAqB,QA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CAACL,QAAS;IACzBrB,YAAY,EAAE0B,KAAK,CAAC1B,YAAa;IACjCC,YAAY,EAAEyB,KAAK,CAACzB,YAAa;IACjCC,aAAa,EAAEwB,KAAK,CAACxB,aAAc;IACnCC,kBAAkB,EAAEuB,KAAK,CAACvB;EAAmB,EAC7C;AAEN,CAAC;AAED,MAAMS,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/BZ,kBAAkB,EAAE;IAClBa,eAAe,EAAEC,cAAM,CAACC,IAAI;IAC5BC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC;EACDpB,cAAc,EAAE;IAAEqB,UAAU,EAAE,QAAQ;IAAEC,KAAK,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAG;AAC5E,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY/C,YAAY;AAAAgD,OAAA,CAAAjD,OAAA,GAAAgD,QAAA"}
|
|
@@ -4,21 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _CheckBox = _interopRequireDefault(require("../CheckBox"));
|
|
13
|
-
|
|
14
|
-
var _colors = require("../../styles/colors");
|
|
15
|
-
|
|
16
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
13
|
const DropdownListItem = _ref => {
|
|
23
14
|
let {
|
|
24
15
|
item,
|
|
@@ -32,31 +23,28 @@ const DropdownListItem = _ref => {
|
|
|
32
23
|
checkboxStyle,
|
|
33
24
|
checkboxLabelStyle
|
|
34
25
|
} = _ref;
|
|
35
|
-
const selectedOptionValue = optionValue
|
|
26
|
+
const selectedOptionValue = optionValue ?? 'value';
|
|
36
27
|
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
37
|
-
style: styles.
|
|
28
|
+
style: styles.dropdownModalOptions,
|
|
38
29
|
onPress: () => onChange(item[selectedOptionValue])
|
|
39
30
|
}, /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
|
|
40
31
|
value: isMultiple ? selectedOption.includes(item[selectedOptionValue]) : [selectedOption].includes(item[selectedOptionValue]),
|
|
41
|
-
label: item[optionLabel
|
|
32
|
+
label: item[optionLabel ?? ''],
|
|
42
33
|
onChange: () => onChange(item[selectedOptionValue]),
|
|
43
|
-
primaryColor: primaryColor
|
|
34
|
+
primaryColor: primaryColor,
|
|
44
35
|
checkboxSize: checkboxSize,
|
|
45
36
|
checkboxStyle: checkboxStyle,
|
|
46
37
|
checkboxLabelStyle: checkboxLabelStyle
|
|
47
38
|
}));
|
|
48
39
|
};
|
|
49
|
-
|
|
50
40
|
const styles = _reactNative.StyleSheet.create({
|
|
51
|
-
|
|
41
|
+
dropdownModalOptions: {
|
|
52
42
|
paddingHorizontal: 20,
|
|
53
43
|
paddingVertical: 10,
|
|
54
44
|
flexDirection: 'row',
|
|
55
45
|
alignItems: 'center'
|
|
56
46
|
}
|
|
57
47
|
});
|
|
58
|
-
|
|
59
48
|
var _default = /*#__PURE__*/(0, _react.memo)(DropdownListItem);
|
|
60
|
-
|
|
61
49
|
exports.default = _default;
|
|
62
50
|
//# sourceMappingURL=DropdownListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAK,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,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAAgB,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAA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c;IAC7BC,kBAAkB,EAAEA;EAAmB,EACvC,CACe;AAEvB,CAAC;AAED,MAAMK,MAAM,GAAGM,uBAAU,CAACC,MAAM,CAAC;EAC/BN,oBAAoB,EAAE;IACpBO,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,gBAEY,IAAAC,WAAI,EAAC7B,gBAAgB,CAAC;AAAA8B,OAAA,CAAAlD,OAAA,GAAAgD,QAAA"}
|
package/lib/commonjs/components/Dropdown/{SelectedItemsView.js → DropdownSelectedItemsView.js}
RENAMED
|
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _colors = require("../../styles/colors");
|
|
13
|
-
|
|
14
10
|
var _input = require("../../styles/input");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
const SelectedItemsView = _ref => {
|
|
12
|
+
const DropdownSelectedItemsView = _ref => {
|
|
19
13
|
let {
|
|
20
14
|
placeholder,
|
|
21
15
|
error,
|
|
@@ -37,10 +31,13 @@ const SelectedItemsView = _ref => {
|
|
|
37
31
|
let {
|
|
38
32
|
pressed
|
|
39
33
|
} = _ref2;
|
|
40
|
-
return [pressed && {
|
|
34
|
+
return [pressed && {
|
|
35
|
+
..._input.inputStyles.inputFocusState,
|
|
41
36
|
borderColor: primaryColor
|
|
42
|
-
}, _input.inputStyles.input, dropdownStyle, error &&
|
|
43
|
-
|
|
37
|
+
}, _input.inputStyles.input, dropdownStyle, error &&
|
|
38
|
+
//this must be last
|
|
39
|
+
error !== '' && !pressed && {
|
|
40
|
+
..._input.inputStyles.inputFocusErrorState,
|
|
44
41
|
...dropdownErrorStyle
|
|
45
42
|
}];
|
|
46
43
|
},
|
|
@@ -67,13 +64,12 @@ const SelectedItemsView = _ref => {
|
|
|
67
64
|
style: [styles.blackText, selectedItemStyle]
|
|
68
65
|
}, getSelectedItemsLabel()))), !selectedItem && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0 && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
69
66
|
style: styles.blackText
|
|
70
|
-
}, placeholder
|
|
67
|
+
}, placeholder ?? 'Select an option')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
71
68
|
style: styles.iconStyle
|
|
72
69
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
73
70
|
source: require('../../asset/arrow-down.png')
|
|
74
71
|
})));
|
|
75
72
|
};
|
|
76
|
-
|
|
77
73
|
const styles = _reactNative.StyleSheet.create({
|
|
78
74
|
iconStyle: {
|
|
79
75
|
position: 'absolute',
|
|
@@ -90,13 +86,13 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
90
86
|
paddingVertical: 5,
|
|
91
87
|
borderRadius: 10,
|
|
92
88
|
backgroundColor: _colors.colors.primary,
|
|
93
|
-
marginRight: 10
|
|
89
|
+
marginRight: 10,
|
|
90
|
+
overflow: 'hidden'
|
|
94
91
|
},
|
|
95
92
|
blackText: {
|
|
96
93
|
color: _colors.colors.black
|
|
97
94
|
}
|
|
98
95
|
});
|
|
99
|
-
|
|
100
|
-
var _default = SelectedItemsView;
|
|
96
|
+
var _default = DropdownSelectedItemsView;
|
|
101
97
|
exports.default = _default;
|
|
102
|
-
//# sourceMappingURL=
|
|
98
|
+
//# sourceMappingURL=DropdownSelectedItemsView.js.map
|
|
@@ -0,0 +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,IAcvB;EAAA,IAdwB;IACjCC,WAAW;IACXC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,aAAa;IACbC,iBAAiB;IACjBC,yBAAyB;IACzBC,kBAAkB;IAClBC,YAAY;IACZC;EACG,CAAC,GAAAb,IAAA;EACJ,oBACEV,MAAA,CAAAQ,OAAA,CAAAgB,aAAA,CAACrB,YAA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Ae,EAAEc,cAAM,CAACK,OAAO;IAC/BC,WAAW,EAAE,EAAE;IACfC,QAAQ,EAAE;EACZ,CAAC;EACDpB,SAAS,EAAE;IAAEY,KAAK,EAAEC,cAAM,CAACQ;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYjE,yBAAyB;AAAAkE,OAAA,CAAAnE,OAAA,GAAAkE,QAAA"}
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Input = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _input = require("../../styles/input");
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
-
|
|
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); }
|
|
20
13
|
const Input = _ref => {
|
|
21
14
|
let {
|
|
22
15
|
placeholder,
|
|
@@ -42,9 +35,7 @@ const Input = _ref => {
|
|
|
42
35
|
onChangeText: onChangeText
|
|
43
36
|
}, rest)));
|
|
44
37
|
};
|
|
45
|
-
|
|
46
38
|
exports.Input = Input;
|
|
47
|
-
|
|
48
39
|
const styles = _reactNative.StyleSheet.create({
|
|
49
40
|
container: {
|
|
50
41
|
margin: 23
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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","inputFocusState","borderColor","onFocus","onBlur","exports","StyleSheet","create","margin"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View } 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 isFocused &&\n inputStyles.inputFocusState && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\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"],"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,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,G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,CAAE;IACFY,MAAM,EAAEA,CAAA,KAAMZ,QAAQ,CAAC,KAAK,CAAE;IAC9BN,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA;EAAa,GACvBG,IAAI,EACR,CACG;AAEX,CAAC;AAACe,OAAA,CAAAtB,KAAA,GAAAA,KAAA;AAEF,MAAMa,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,SAAS,EAAE;IAAEW,MAAM,EAAE;EAAG;AAC1B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DEFAULT_OPTION_LABEL","exports","DEFAULT_OPTION_VALUE","CHECKBOX_SIZE"],"sources":["index.ts"],"sourcesContent":["export const DEFAULT_OPTION_LABEL = 'label';\nexport const DEFAULT_OPTION_VALUE = 'value';\nexport const CHECKBOX_SIZE = 14;\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAG,OAAO;AAACC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACrC,MAAME,oBAAoB,GAAG,OAAO;AAACD,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AACrC,MAAMC,aAAa,GAAG,EAAE;AAACF,OAAA,CAAAE,aAAA,GAAAA,aAAA"}
|