react-native-input-select 1.3.2 → 1.3.4
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 +48 -40
- package/lib/commonjs/components/CheckBox/{types.js → checkbox.types.js} +1 -1
- package/lib/commonjs/components/CheckBox/checkbox.types.js.map +1 -0
- package/lib/commonjs/components/CheckBox/index.js +9 -28
- package/lib/commonjs/components/CheckBox/index.js.map +1 -1
- package/lib/commonjs/components/CustomModal/index.js +11 -7
- package/lib/commonjs/components/CustomModal/index.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownSectionList.js +1 -1
- package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +2 -1
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Others/index.js.map +1 -1
- package/lib/commonjs/index.js +14 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/index.types.js.map +1 -1
- package/lib/commonjs/utils/index.js +5 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/CheckBox/checkbox.types.js +2 -0
- package/lib/module/components/CheckBox/checkbox.types.js.map +1 -0
- package/lib/module/components/CheckBox/index.js +9 -28
- package/lib/module/components/CheckBox/index.js.map +1 -1
- package/lib/module/components/CustomModal/index.js +11 -7
- package/lib/module/components/CustomModal/index.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownSectionList.js +1 -1
- package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -1
- package/lib/module/components/Input/index.js +2 -1
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Others/index.js.map +1 -1
- package/lib/module/index.js +15 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/index.types.js.map +1 -1
- package/lib/module/utils/index.js +3 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/CheckBox/checkbox.types.d.ts +9 -0
- package/lib/typescript/components/CheckBox/index.d.ts +2 -19
- package/lib/typescript/components/CustomModal/index.d.ts +3 -1
- package/lib/typescript/components/Others/index.d.ts +3 -1
- package/lib/typescript/types/index.types.d.ts +46 -15
- package/lib/typescript/utils/index.d.ts +2 -1
- package/package.json +2 -2
- package/src/components/CheckBox/checkbox.types.ts +10 -0
- package/src/components/CheckBox/index.tsx +15 -26
- package/src/components/CustomModal/index.tsx +19 -11
- package/src/components/Dropdown/DropdownSectionList.tsx +1 -1
- package/src/components/Input/index.tsx +1 -0
- package/src/components/Others/index.tsx +5 -1
- package/src/index.tsx +16 -11
- package/src/types/index.types.ts +56 -15
- package/src/utils/index.ts +5 -1
- package/lib/commonjs/components/CheckBox/types.js.map +0 -1
- package/lib/module/components/CheckBox/types.js +0 -2
- package/lib/module/components/CheckBox/types.js.map +0 -1
- package/lib/typescript/components/CheckBox/types.d.ts +0 -18
- package/src/components/CheckBox/types.ts +0 -19
package/README.md
CHANGED
|
@@ -239,52 +239,49 @@ For more examples visit our [wiki page](https://github.com/azeezat/react-native-
|
|
|
239
239
|
|
|
240
240
|
## Props
|
|
241
241
|
|
|
242
|
-
| Proptypes
|
|
243
|
-
|
|
|
244
|
-
| label
|
|
245
|
-
| placeholder
|
|
246
|
-
| options
|
|
247
|
-
| optionLabel
|
|
248
|
-
| optionValue
|
|
249
|
-
| error
|
|
250
|
-
| helperText
|
|
251
|
-
| selectedValue
|
|
252
|
-
| onValueChange
|
|
253
|
-
| isMultiple
|
|
254
|
-
| isSearchable
|
|
255
|
-
| disabled
|
|
256
|
-
| dropdownIcon
|
|
257
|
-
| labelStyle
|
|
258
|
-
| placeholderStyle
|
|
259
|
-
| dropdownStyle
|
|
260
|
-
| dropdownContainerStyle
|
|
261
|
-
| dropdownIconStyle
|
|
262
|
-
| selectedItemStyle
|
|
263
|
-
| multipleSelectedItemStyle
|
|
264
|
-
|
|
|
265
|
-
|
|
|
266
|
-
|
|
|
267
|
-
|
|
|
268
|
-
|
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
|
|
|
272
|
-
|
|
|
273
|
-
|
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
| checkboxComponent | `React Component` | `<View style={styles.radioButton} />` |
|
|
277
|
-
| listControls | `Object` | `{ selectAllText: 'Choose all', unselectAllText: 'Remove all', selectAllCallback: () => {}, unselectAllCallback: () => {}, hideSelectAll: boolean, emptyListMessage: 'No record found'}` |
|
|
278
|
-
| searchControls | `Object` | `{ textInputStyle: ViewStyle \| TextStyle, textInputContainerStyle: ViewStyle, textInputProps: TextInputProps}` |
|
|
242
|
+
| Proptypes | Datatype | Example |
|
|
243
|
+
| ------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
244
|
+
| label | `string` | Countries |
|
|
245
|
+
| placeholder | `string` | Select a country |
|
|
246
|
+
| options | `Array` | `[{ name: 'Nigeria', code: 'NG' }, { name: 'Albania', code: 'AL' }]` |
|
|
247
|
+
| optionLabel | `string` | `name` |
|
|
248
|
+
| optionValue | `string` | `code` |
|
|
249
|
+
| error | `string` | `This is a requiredfield` |
|
|
250
|
+
| helperText | `string` | `Only few countries are listed` |
|
|
251
|
+
| selectedValue | `string` or `Array` | `AL` or `[AL, AX]` |
|
|
252
|
+
| onValueChange | `function` | `()=>{}` |
|
|
253
|
+
| isMultiple | `Boolean` | `true` |
|
|
254
|
+
| isSearchable | `Boolean` | `true` |
|
|
255
|
+
| disabled | `Boolean` | `true` |
|
|
256
|
+
| dropdownIcon | `React Component` | `Image` or `<Text> Show <Text>` |
|
|
257
|
+
| labelStyle | `Object` | `{color: 'red', fontSize: 15, fontWeight: '500'}` |
|
|
258
|
+
| placeholderStyle | `Object` | `{color: 'blue', fontSize: 15, fontWeight: '500'}` |
|
|
259
|
+
| dropdownStyle | `Object` | `{borderColor: 'blue', margin: 5, borderWidth:0 ...}` |
|
|
260
|
+
| dropdownContainerStyle | `Object` | `{backgroundColor: 'red', width: '30%', ...}` |
|
|
261
|
+
| dropdownIconStyle | `Object` | `{top: 10 , right: 10, ...}` |
|
|
262
|
+
| selectedItemStyle | `Object` | `{fontWeight: '600', color: 'yellow', ...}` |
|
|
263
|
+
| multipleSelectedItemStyle | `Object` | `{backgroundColor: 'red', color: 'yellow', ...}` |
|
|
264
|
+
| dropdownErrorStyle | `Object` | `{borderWidth: 2, borderStyle: 'solid'}` |
|
|
265
|
+
| dropdownErrorTextStyle | `Object` | `{color: 'red', fontWeight:'500'}` |
|
|
266
|
+
| dropdownHelperTextStyle | `Object` | `{color: 'green', fontWeight:'500'}` |
|
|
267
|
+
| primaryColor | `string` | `blue` |
|
|
268
|
+
| listHeaderComponent | `React Component` | `<Text> You can add any component here </Text>` |
|
|
269
|
+
| listFooterComponent | `React Component` | `<Text> You can add any component here <Text>` |
|
|
270
|
+
| hideModal | `Boolean` | Use this to hide the modal as needed |
|
|
271
|
+
| listComponentStyles | `Object` | `{listEmptyComponentStyle: ViewStyle, itemSeparatorStyle: ViewStyle, sectionHeaderStyle: TextStyle}` |
|
|
272
|
+
| checkboxControls | `Object` | `{checkboxSize: number, checkboxStyle: ViewStyle, checkboxLabelStyle: TextStyle, checkboxComponent?: React.ReactNode}` |
|
|
273
|
+
| listControls | `Object` | `{ selectAllText: 'Choose all', unselectAllText: 'Remove all', selectAllCallback: () => {}, unselectAllCallback: () => {}, hideSelectAll: boolean, emptyListMessage: 'No record found'}` |
|
|
274
|
+
| searchControls | `Object` | `{ textInputStyle: ViewStyle \| TextStyle, textInputContainerStyle: ViewStyle, textInputProps: TextInputProps}` |
|
|
275
|
+
| modalControls | `Object` | `{ modalBackgroundStyle: ViewStyle, modalOptionsContainerStyle: ViewStyle, modalProps: ModalProps}` |
|
|
279
276
|
|
|
280
277
|
## Deprecation Notice
|
|
281
278
|
|
|
282
279
|
The following props would be removed in coming releases.
|
|
283
280
|
|
|
284
|
-
- Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle` would be replaced with a single object `
|
|
281
|
+
- Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle`, `checkboxComponent` would be replaced with a single object `checkboxControls` e.g
|
|
285
282
|
|
|
286
283
|
```js
|
|
287
|
-
|
|
284
|
+
checkboxControls = {
|
|
288
285
|
checkboxSize: 20,
|
|
289
286
|
checkboxStyle: {
|
|
290
287
|
backgroundColor: 'purple',
|
|
@@ -293,11 +290,12 @@ checkboxComponentStyles = {
|
|
|
293
290
|
borderColor: 'red',
|
|
294
291
|
},
|
|
295
292
|
checkboxLabelStyle: { color: 'red', fontSize: 20 },
|
|
293
|
+
checkboxComponent: <View style={styles.radioButton} />
|
|
296
294
|
...
|
|
297
295
|
};
|
|
298
296
|
```
|
|
299
297
|
|
|
300
|
-
- `searchInputStyle` would now be
|
|
298
|
+
- `searchInputStyle` would now be replaced with `textInputStyle` in the `searchControls` object
|
|
301
299
|
|
|
302
300
|
```js
|
|
303
301
|
searchControls = {
|
|
@@ -324,6 +322,16 @@ searchControls = {
|
|
|
324
322
|
};
|
|
325
323
|
```
|
|
326
324
|
|
|
325
|
+
Individual props `modalBackgroundStyle`, `modalOptionsContainerStyle`, `modalProps` would be replaced with a single object `modalControls`
|
|
326
|
+
|
|
327
|
+
```js
|
|
328
|
+
modalControls={
|
|
329
|
+
modalBackgroundStyle: ViewStyle,
|
|
330
|
+
modalOptionsContainerStyle: ViewStyle,
|
|
331
|
+
modalProps: ModalProps, //Use this to pass in react-native default modal props
|
|
332
|
+
};
|
|
333
|
+
```
|
|
334
|
+
|
|
327
335
|
## Contributing
|
|
328
336
|
|
|
329
337
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["checkbox.types.ts"],"sourcesContent":["import type { ColorValue } from 'react-native';\nimport { TCheckboxControls } from 'src/types/index.types';\n\nexport type CheckboxProps = {\n label?: string;\n value?: boolean;\n disabled?: boolean;\n primaryColor?: ColorValue;\n onChange?: (value: boolean | string | number) => void;\n} & TCheckboxControls;\n"],"mappings":""}
|
|
@@ -9,26 +9,8 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _colors = require("../../styles/colors");
|
|
10
10
|
var _constants = require("../../constants");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
/**
|
|
13
|
-
* Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle` would be replaced in future releases
|
|
14
|
-
* and replaced with a single object `checkboxComponentStyles` e.g
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
const checkboxComponentStyles = {
|
|
18
|
-
checkboxSize: 20,
|
|
19
|
-
checkboxStyle: {
|
|
20
|
-
backgroundColor: 'purple',
|
|
21
|
-
borderRadius: 30,
|
|
22
|
-
padding: 10,
|
|
23
|
-
borderColor: 'red',
|
|
24
|
-
},
|
|
25
|
-
checkboxLabelStyle: { color: 'red', fontSize: 20 },
|
|
26
|
-
};
|
|
27
|
-
```
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
12
|
const CheckBox = _ref => {
|
|
31
|
-
var _checkboxComponentSty, _checkboxComponentSty2;
|
|
13
|
+
var _checkboxControls$che, _checkboxComponentSty, _checkboxControls$che2, _checkboxComponentSty2;
|
|
32
14
|
let {
|
|
33
15
|
label,
|
|
34
16
|
value,
|
|
@@ -39,28 +21,27 @@ const CheckBox = _ref => {
|
|
|
39
21
|
checkboxLabelStyle,
|
|
40
22
|
checkboxComponentStyles,
|
|
41
23
|
checkboxComponent,
|
|
24
|
+
checkboxControls,
|
|
42
25
|
onChange
|
|
43
26
|
} = _ref;
|
|
44
|
-
// const { checkboxSize, checkboxStyle, checkboxLabelStyle } =
|
|
45
|
-
// checkboxComponentStyles || undefined;
|
|
46
27
|
const fillColor = {
|
|
47
|
-
backgroundColor: disabled ? '#d3d3d3' : value ? (checkboxComponentStyles === null || checkboxComponentStyles === void 0 || (_checkboxComponentSty = checkboxComponentStyles.checkboxStyle) === null || _checkboxComponentSty === void 0 ? void 0 : _checkboxComponentSty.backgroundColor) || (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.backgroundColor) || primaryColor || 'green' : 'white',
|
|
48
|
-
borderColor: disabled ? _colors.colors.disabled : (checkboxComponentStyles === null || checkboxComponentStyles === void 0 || (_checkboxComponentSty2 = checkboxComponentStyles.checkboxStyle) === null || _checkboxComponentSty2 === void 0 ? void 0 : _checkboxComponentSty2.borderColor) || (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.borderColor) || styles.checkbox.borderColor
|
|
28
|
+
backgroundColor: disabled ? '#d3d3d3' : value ? (checkboxControls === null || checkboxControls === void 0 || (_checkboxControls$che = checkboxControls.checkboxStyle) === null || _checkboxControls$che === void 0 ? void 0 : _checkboxControls$che.backgroundColor) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 || (_checkboxComponentSty = checkboxComponentStyles.checkboxStyle) === null || _checkboxComponentSty === void 0 ? void 0 : _checkboxComponentSty.backgroundColor) || (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.backgroundColor) || primaryColor || 'green' : 'white',
|
|
29
|
+
borderColor: disabled ? _colors.colors.disabled : (checkboxControls === null || checkboxControls === void 0 || (_checkboxControls$che2 = checkboxControls.checkboxStyle) === null || _checkboxControls$che2 === void 0 ? void 0 : _checkboxControls$che2.borderColor) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 || (_checkboxComponentSty2 = checkboxComponentStyles.checkboxStyle) === null || _checkboxComponentSty2 === void 0 ? void 0 : _checkboxComponentSty2.borderColor) || (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.borderColor) || styles.checkbox.borderColor
|
|
49
30
|
};
|
|
50
31
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
51
32
|
onPress: onChange ? () => onChange(!value) : null,
|
|
52
33
|
style: [styles.checkboxContainer],
|
|
53
34
|
disabled: disabled
|
|
54
35
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
55
|
-
style: [styles.checkbox, (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxStyle) || checkboxStyle, fillColor]
|
|
56
|
-
}, checkboxComponent || /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
36
|
+
style: [styles.checkbox, (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxStyle) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxStyle) || checkboxStyle, fillColor]
|
|
37
|
+
}, (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxComponent) || checkboxComponent || /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
57
38
|
source: require('../../asset/check.png'),
|
|
58
39
|
style: [{
|
|
59
|
-
height: (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || _constants.CHECKBOX_SIZE,
|
|
60
|
-
width: (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || _constants.CHECKBOX_SIZE
|
|
40
|
+
height: (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxSize) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || _constants.CHECKBOX_SIZE,
|
|
41
|
+
width: (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxSize) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || _constants.CHECKBOX_SIZE
|
|
61
42
|
}]
|
|
62
43
|
})), label && label !== '' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
63
|
-
style: [(checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxLabelStyle) || checkboxLabelStyle, styles.labelStyle]
|
|
44
|
+
style: [(checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxLabelStyle) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxLabelStyle) || checkboxLabelStyle, styles.labelStyle]
|
|
64
45
|
}, label));
|
|
65
46
|
};
|
|
66
47
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_constants","obj","__esModule","default","CheckBox","_ref","_checkboxComponentSty","_checkboxComponentSty2","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","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":["import 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\
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_constants","obj","__esModule","default","CheckBox","_ref","_checkboxControls$che","_checkboxComponentSty","_checkboxControls$che2","_checkboxComponentSty2","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","checkboxControls","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":["import 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 './checkbox.types';\n\nconst CheckBox = ({\n label,\n value,\n disabled,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n checkboxComponentStyles,\n checkboxComponent,\n checkboxControls,\n onChange,\n}: CheckboxProps) => {\n const fillColor = {\n backgroundColor: disabled\n ? '#d3d3d3'\n : value\n ? checkboxControls?.checkboxStyle?.backgroundColor ||\n checkboxComponentStyles?.checkboxStyle?.backgroundColor ||\n checkboxStyle?.backgroundColor ||\n primaryColor ||\n 'green'\n : 'white',\n borderColor: disabled\n ? colors.disabled\n : checkboxControls?.checkboxStyle?.borderColor ||\n checkboxComponentStyles?.checkboxStyle?.borderColor ||\n checkboxStyle?.borderColor ||\n styles.checkbox.borderColor,\n };\n\n return (\n <Pressable\n onPress={onChange ? () => onChange(!value) : null}\n style={[styles.checkboxContainer]}\n disabled={disabled}\n >\n <View\n style={[\n styles.checkbox,\n checkboxControls?.checkboxStyle ||\n checkboxComponentStyles?.checkboxStyle ||\n checkboxStyle,\n fillColor,\n ]}\n >\n {checkboxControls?.checkboxComponent || checkboxComponent || (\n <Image\n source={require('../../asset/check.png')}\n style={[\n {\n height:\n checkboxControls?.checkboxSize ||\n checkboxComponentStyles?.checkboxSize ||\n checkboxSize ||\n CHECKBOX_SIZE,\n width:\n checkboxControls?.checkboxSize ||\n checkboxComponentStyles?.checkboxSize ||\n checkboxSize ||\n CHECKBOX_SIZE,\n },\n ]}\n />\n )}\n </View>\n {label && label !== '' && (\n <Text\n style={[\n checkboxControls?.checkboxLabelStyle ||\n checkboxComponentStyles?.checkboxLabelStyle ||\n checkboxLabelStyle,\n styles.labelStyle,\n ]}\n >\n {label}\n </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 border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BAAhBA,gBAAgB,CAAEL,YAAY,MAC9BG,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEH,YAAY,KACrCA,YAAY,IACZsB;IACJ,CAAC;EACD,CACH,CAEC,CAAC,EACN1B,KAAK,IAAIA,KAAK,KAAK,EAAE,iBACpBf,MAAA,CAAAQ,OAAA,CAAAwB,aAAA,CAAC7B,YAAA,CAAAwC,IAAI;IACHR,KAAK,EAAE,CACL,CAAAX,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAEH,kBAAkB,MAClCC,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAED,kBAAkB,KAC3CA,kBAAkB,EACpBS,MAAM,CAACc,UAAU;EACjB,GAED7B,KACG,CAEC,CAAC;AAEhB,CAAC;AAED,MAAMe,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,GAEY9C,QAAQ;AAAA+C,OAAA,CAAAhD,OAAA,GAAA+C,QAAA"}
|
|
@@ -11,25 +11,29 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
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
12
|
const CustomModal = _ref => {
|
|
13
13
|
let {
|
|
14
|
-
|
|
14
|
+
visible,
|
|
15
15
|
onRequestClose,
|
|
16
16
|
modalBackgroundStyle,
|
|
17
|
+
//kept for backwards compatibility
|
|
17
18
|
modalOptionsContainerStyle,
|
|
19
|
+
//kept for backwards compatibility
|
|
20
|
+
modalControls,
|
|
18
21
|
modalProps,
|
|
22
|
+
//kept for backwards compatibility
|
|
19
23
|
children
|
|
20
24
|
} = _ref;
|
|
21
25
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Modal, _extends({
|
|
22
26
|
transparent: true,
|
|
23
|
-
visible:
|
|
24
|
-
onRequestClose: () => onRequestClose(),
|
|
27
|
+
visible: visible,
|
|
28
|
+
onRequestClose: () => onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose(),
|
|
25
29
|
animationType: "fade"
|
|
26
|
-
}, modalProps), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
27
|
-
onPress: () => onRequestClose(),
|
|
28
|
-
style: [styles.modalContainer, styles.modalBackgroundStyle, modalBackgroundStyle]
|
|
30
|
+
}, modalControls === null || modalControls === void 0 ? void 0 : modalControls.modalProps, modalProps), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
31
|
+
onPress: () => onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose(),
|
|
32
|
+
style: [styles.modalContainer, styles.modalBackgroundStyle, (modalControls === null || modalControls === void 0 ? void 0 : modalControls.modalBackgroundStyle) || modalBackgroundStyle]
|
|
29
33
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
30
34
|
onPress: () => {}
|
|
31
35
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
32
|
-
style: [styles.modalOptionsContainer, modalOptionsContainerStyle]
|
|
36
|
+
style: [styles.modalOptionsContainer, (modalControls === null || modalControls === void 0 ? void 0 : modalControls.modalOptionsContainerStyle) || modalOptionsContainerStyle]
|
|
33
37
|
}, children))));
|
|
34
38
|
};
|
|
35
39
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","CustomModal","_ref","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","CustomModal","_ref","visible","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","modalControls","modalProps","children","createElement","Modal","transparent","animationType","TouchableOpacity","onPress","style","styles","modalContainer","TouchableWithoutFeedback","SafeAreaView","modalOptionsContainer","StyleSheet","create","flex","justifyContent","backgroundColor","maxHeight","colors","white","borderTopLeftRadius","borderTopRightRadius","zIndex","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Modal,\n TouchableOpacity,\n SafeAreaView,\n StyleSheet,\n TouchableWithoutFeedback,\n ModalProps,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { TCustomModalControls } from 'src/types/index.types';\n\nconst CustomModal = ({\n visible,\n onRequestClose,\n modalBackgroundStyle, //kept for backwards compatibility\n modalOptionsContainerStyle, //kept for backwards compatibility\n modalControls,\n modalProps, //kept for backwards compatibility\n children,\n}: TCustomModalControls & ModalProps) => {\n return (\n <Modal\n transparent={true}\n visible={visible}\n onRequestClose={() => onRequestClose?.()}\n animationType=\"fade\"\n {...modalControls?.modalProps}\n {...modalProps} //kept for backwards compatibility\n >\n <TouchableOpacity\n onPress={() => onRequestClose?.()}\n style={[\n styles.modalContainer,\n styles.modalBackgroundStyle,\n modalControls?.modalBackgroundStyle || modalBackgroundStyle,\n ]}\n >\n {/* Added this `TouchableWithoutFeedback` wrapper because of the closing modal on expo web */}\n <TouchableWithoutFeedback onPress={() => {}}>\n <SafeAreaView\n style={[\n styles.modalOptionsContainer,\n modalControls?.modalOptionsContainerStyle ||\n modalOptionsContainerStyle,\n ]}\n >\n {children}\n </SafeAreaView>\n </TouchableWithoutFeedback>\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 zIndex: 5,\n },\n});\n\nexport default CustomModal;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAG7C,MAAMQ,WAAW,GAAGC,IAAA,IAQqB;EAAA,IARpB;IACnBC,OAAO;IACPC,cAAc;IACdC,oBAAoB;IAAE;IACtBC,0BAA0B;IAAE;IAC5BC,aAAa;IACbC,UAAU;IAAE;IACZC;EACiC,CAAC,GAAAP,IAAA;EAClC,oBACEvB,MAAA,C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CAACC,KAAK;IAC7BC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYhC,WAAW;AAAAiC,OAAA,CAAAhD,OAAA,GAAA+C,QAAA"}
|
|
@@ -68,7 +68,7 @@ const DropdownSectionList = _ref => {
|
|
|
68
68
|
const sectionlistRef = (0, _react.useRef)(null);
|
|
69
69
|
const scrollToLocation = listIndex => {
|
|
70
70
|
var _sectionlistRef$curre;
|
|
71
|
-
(_sectionlistRef$curre = sectionlistRef.current) === null || _sectionlistRef$curre === void 0 ? void 0 : _sectionlistRef$curre.scrollToLocation({
|
|
71
|
+
sectionlistRef === null || sectionlistRef === void 0 || (_sectionlistRef$curre = sectionlistRef.current) === null || _sectionlistRef$curre === void 0 ? void 0 : _sectionlistRef$curre.scrollToLocation({
|
|
72
72
|
sectionIndex: listIndex.sectionIndex,
|
|
73
73
|
animated: true,
|
|
74
74
|
itemIndex: listIndex.itemIndex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_DropdownListItem","_interopRequireDefault","_Others","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSectionList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","listComponentStyles","listIndex","emptyListMessage","rest","expandedSections","setExpandedSections","useState","Set","useEffect","initialState","extractPropertyFromArray","handleToggleListExpansion","title","expandedSectionsState","next","delete","add","sectionlistRef","useRef","scrollToLocation","_sectionlistRef$curre","current","sectionIndex","animated","itemIndex","createElement","SectionList","sections","extraData","initialNumToRender","ListEmptyComponent","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","ItemSeparatorComponent","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","renderSectionHeader","_ref2","section","SectionHeaderTitle","sectionHeaderStyle","onPress","isExpanded","keyExtractor","_item","index","stickySectionHeadersEnabled","ref","onScrollToIndexFailed","setTimeout","_ref3","props","StyleSheet","create","_default","exports"],"sources":["DropdownSectionList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React, { useEffect, useState, useRef } from 'react';\nimport { SectionList, StyleSheet } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport {\n ItemSeparatorComponent,\n ListEmptyComponent,\n SectionHeaderTitle,\n} from '../Others';\nimport { extractPropertyFromArray } from '../../utils';\nimport { TSectionList } from 'src/types/index.types';\n\nconst DropdownSectionList = ({\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 checkboxComponentStyles,\n checkboxComponent,\n listComponentStyles,\n listIndex,\n emptyListMessage,\n ...rest\n}: any) => {\n const [expandedSections, setExpandedSections] = useState(new Set());\n\n /**\n * Expand all sections\n */\n useEffect(() => {\n let initialState = new Set(extractPropertyFromArray(options, 'title'));\n setExpandedSections(initialState);\n }, [options]);\n\n /**\n * @param title\n */\n const handleToggleListExpansion = (title: string) => {\n setExpandedSections((expandedSectionsState) => {\n // Using Set here but you can use an array too\n const next = new Set(expandedSectionsState);\n if (next.has(title)) {\n next.delete(title);\n } else {\n next.add(title);\n }\n return next;\n });\n };\n\n /**\n * @description Scroll to item location\n */\n\n const sectionlistRef = useRef<SectionList<TSectionList>>(null);\n\n const scrollToLocation = (listIndex: any) => {\n sectionlistRef.current?.scrollToLocation({\n sectionIndex: listIndex.sectionIndex,\n animated: true,\n itemIndex: listIndex.itemIndex,\n });\n };\n\n useEffect(() => {\n if (listIndex.itemIndex >= 0 && listIndex.sectionIndex >= 0) {\n scrollToLocation(listIndex);\n }\n }, [listIndex]);\n\n return (\n <SectionList\n sections={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <ListEmptyComponent\n listEmptyComponentStyle={listComponentStyles?.listEmptyComponentStyle}\n emptyListMessage={emptyListMessage}\n />\n }\n contentContainerStyle={[\n isSearchable ? { paddingTop: 0 } : styles.contentContainerStyle,\n ]}\n ItemSeparatorComponent={() => (\n <ItemSeparatorComponent\n itemSeparatorStyle={listComponentStyles?.itemSeparatorStyle}\n />\n )}\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, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n checkboxComponent,\n expandedSections,\n })\n }\n renderSectionHeader={({ section: { title } }) => (\n <SectionHeaderTitle\n title={title}\n sectionHeaderStyle={listComponentStyles?.sectionHeaderStyle}\n onPress={() => handleToggleListExpansion(title)}\n isExpanded={expandedSections.has(title)}\n />\n )}\n keyExtractor={(_item, index) => `Options${index}`}\n stickySectionHeadersEnabled={false}\n ref={sectionlistRef}\n onScrollToIndexFailed={() => {\n setTimeout(() => {\n scrollToLocation(listIndex);\n }, 500);\n }}\n {...rest}\n />\n );\n};\n\nconst _renderItem = ({ section: { title }, item }: any, props: any) => {\n const isExpanded = props?.expandedSections.has(title);\n\n //return null if it is not expanded\n if (!isExpanded) return null;\n\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 checkboxComponentStyles={props.checkboxComponentStyles}\n checkboxComponent={props.checkboxComponent}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownSectionList;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAAuD,SAAAG,uBAAAG,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,SAAAX,wBAAAO,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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AAE8D,KAAK,CAAC9D,YAAa;IACjCC,aAAa,EAAE6D,KAAK,CAAC7D,aAAc;IACnCC,kBAAkB,EAAE4D,KAAK,CAAC5D,kBAAmB;IAC7CC,uBAAuB,EAAE2D,KAAK,CAAC3D,uBAAwB;IACvDC,iBAAiB,EAAE0D,KAAK,CAAC1D;EAAkB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMmC,MAAM,GAAGwB,uBAAU,CAACC,MAAM,CAAC;EAC/B3B,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAAC,IAAA2B,QAAA,GAEY7E,mBAAmB;AAAA8E,OAAA,CAAA3G,OAAA,GAAA0G,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_DropdownListItem","_interopRequireDefault","_Others","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSectionList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","listComponentStyles","listIndex","emptyListMessage","rest","expandedSections","setExpandedSections","useState","Set","useEffect","initialState","extractPropertyFromArray","handleToggleListExpansion","title","expandedSectionsState","next","delete","add","sectionlistRef","useRef","scrollToLocation","_sectionlistRef$curre","current","sectionIndex","animated","itemIndex","createElement","SectionList","sections","extraData","initialNumToRender","ListEmptyComponent","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","ItemSeparatorComponent","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","renderSectionHeader","_ref2","section","SectionHeaderTitle","sectionHeaderStyle","onPress","isExpanded","keyExtractor","_item","index","stickySectionHeadersEnabled","ref","onScrollToIndexFailed","setTimeout","_ref3","props","StyleSheet","create","_default","exports"],"sources":["DropdownSectionList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React, { useEffect, useState, useRef } from 'react';\nimport { SectionList, StyleSheet } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport {\n ItemSeparatorComponent,\n ListEmptyComponent,\n SectionHeaderTitle,\n} from '../Others';\nimport { extractPropertyFromArray } from '../../utils';\nimport { TSectionList } from 'src/types/index.types';\n\nconst DropdownSectionList = ({\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 checkboxComponentStyles,\n checkboxComponent,\n listComponentStyles,\n listIndex,\n emptyListMessage,\n ...rest\n}: any) => {\n const [expandedSections, setExpandedSections] = useState(new Set());\n\n /**\n * Expand all sections\n */\n useEffect(() => {\n let initialState = new Set(extractPropertyFromArray(options, 'title'));\n setExpandedSections(initialState);\n }, [options]);\n\n /**\n * @param title\n */\n const handleToggleListExpansion = (title: string) => {\n setExpandedSections((expandedSectionsState) => {\n // Using Set here but you can use an array too\n const next = new Set(expandedSectionsState);\n if (next.has(title)) {\n next.delete(title);\n } else {\n next.add(title);\n }\n return next;\n });\n };\n\n /**\n * @description Scroll to item location\n */\n\n const sectionlistRef = useRef<SectionList<TSectionList>>(null);\n\n const scrollToLocation = (listIndex: any) => {\n sectionlistRef?.current?.scrollToLocation({\n sectionIndex: listIndex.sectionIndex,\n animated: true,\n itemIndex: listIndex.itemIndex,\n });\n };\n\n useEffect(() => {\n if (listIndex.itemIndex >= 0 && listIndex.sectionIndex >= 0) {\n scrollToLocation(listIndex);\n }\n }, [listIndex]);\n\n return (\n <SectionList\n sections={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <ListEmptyComponent\n listEmptyComponentStyle={listComponentStyles?.listEmptyComponentStyle}\n emptyListMessage={emptyListMessage}\n />\n }\n contentContainerStyle={[\n isSearchable ? { paddingTop: 0 } : styles.contentContainerStyle,\n ]}\n ItemSeparatorComponent={() => (\n <ItemSeparatorComponent\n itemSeparatorStyle={listComponentStyles?.itemSeparatorStyle}\n />\n )}\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, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n checkboxComponent,\n expandedSections,\n })\n }\n renderSectionHeader={({ section: { title } }) => (\n <SectionHeaderTitle\n title={title}\n sectionHeaderStyle={listComponentStyles?.sectionHeaderStyle}\n onPress={() => handleToggleListExpansion(title)}\n isExpanded={expandedSections.has(title)}\n />\n )}\n keyExtractor={(_item, index) => `Options${index}`}\n stickySectionHeadersEnabled={false}\n ref={sectionlistRef}\n onScrollToIndexFailed={() => {\n setTimeout(() => {\n scrollToLocation(listIndex);\n }, 500);\n }}\n {...rest}\n />\n );\n};\n\nconst _renderItem = ({ section: { title }, item }: any, props: any) => {\n const isExpanded = props?.expandedSections.has(title);\n\n //return null if it is not expanded\n if (!isExpanded) return null;\n\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 checkboxComponentStyles={props.checkboxComponentStyles}\n checkboxComponent={props.checkboxComponent}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownSectionList;\n"],"mappings":";;;;;;AAC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1D;EAAkB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMmC,MAAM,GAAGwB,uBAAU,CAACC,MAAM,CAAC;EAC/B3B,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAAC,IAAA2B,QAAA,GAEY7E,mBAAmB;AAAA8E,OAAA,CAAA3G,OAAA,GAAA0G,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_input","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","Input","_ref","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","rest","isFocused","setFocus","useState","createElement","View","styles","container","TextInput","inputStyles","input","Platform","select","web","outlineColor","borderColor","onFocus","onBlur","exports","StyleSheet","create","margin","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n textInputContainerStyle,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,Y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A;
|
|
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","textInputContainerStyle","rest","isFocused","setFocus","useState","createElement","View","styles","container","TextInput","inputStyles","input","Platform","select","web","outlineColor","borderColor","onFocus","onBlur","returnKeyType","exports","StyleSheet","create","margin","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n textInputContainerStyle,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n returnKeyType=\"search\"\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,W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AAC;AAAC,IAAAC,QAAA,GAEY/B,KAAK;AAAA2B,OAAA,CAAAnD,OAAA,GAAAuD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","ListEmptyComponent","_ref","listEmptyComponentStyle","emptyListMessage","createElement","View","style","styles","Text","exports","ItemSeparatorComponent","_ref2","itemSeparatorStyle","ListItemContainer","_ref3","children","listItemContainerStyle","SectionHeaderTitle","_ref4","title","sectionHeaderStyle","onPress","isExpanded","TouchableOpacity","accordionStyle","rotatedIcon90","Image","source","StyleSheet","create","alignItems","width","marginVertical","backgroundColor","colors","gray","height","opacity","paddingHorizontal","paddingVertical","flexDirection","fontWeight","flexWrap","justifyContent","alignContent","transform","rotate"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport {\n View,\n Text,\n StyleSheet,\n TouchableOpacity,\n TextStyle,\n Image,\n ViewStyle,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nexport const ListEmptyComponent = ({\n listEmptyComponentStyle,\n emptyListMessage,\n}: any) => {\n return (\n <View style={styles.listEmptyComponentStyle}>\n <Text style={listEmptyComponentStyle}>\n {emptyListMessage || 'No options available'}\n </Text>\n </View>\n );\n};\n\nexport const ItemSeparatorComponent = ({ itemSeparatorStyle }
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","ListEmptyComponent","_ref","listEmptyComponentStyle","emptyListMessage","createElement","View","style","styles","Text","exports","ItemSeparatorComponent","_ref2","itemSeparatorStyle","ListItemContainer","_ref3","children","listItemContainerStyle","SectionHeaderTitle","_ref4","title","sectionHeaderStyle","onPress","isExpanded","TouchableOpacity","accordionStyle","rotatedIcon90","Image","source","StyleSheet","create","alignItems","width","marginVertical","backgroundColor","colors","gray","height","opacity","paddingHorizontal","paddingVertical","flexDirection","fontWeight","flexWrap","justifyContent","alignContent","transform","rotate"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport {\n View,\n Text,\n StyleSheet,\n TouchableOpacity,\n TextStyle,\n Image,\n ViewStyle,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nexport const ListEmptyComponent = ({\n listEmptyComponentStyle,\n emptyListMessage,\n}: any) => {\n return (\n <View style={styles.listEmptyComponentStyle}>\n <Text style={listEmptyComponentStyle}>\n {emptyListMessage || 'No options available'}\n </Text>\n </View>\n );\n};\n\nexport const ItemSeparatorComponent = ({\n itemSeparatorStyle,\n}: {\n itemSeparatorStyle: ViewStyle;\n}) => {\n return <View style={[styles.itemSeparatorStyle, itemSeparatorStyle]} />;\n};\n\nexport const ListItemContainer = ({\n children,\n listItemContainerStyle,\n}: {\n children: ReactNode;\n listItemContainerStyle: ViewStyle;\n}) => {\n return (\n <View style={[styles.listItemContainerStyle, listItemContainerStyle]}>\n {children}\n </View>\n );\n};\n\nexport const SectionHeaderTitle = ({\n title,\n sectionHeaderStyle,\n onPress,\n isExpanded,\n}: {\n title: string;\n sectionHeaderStyle?: TextStyle;\n onPress?: () => void;\n isExpanded: Boolean;\n}) => {\n return (\n <TouchableOpacity onPress={onPress}>\n <ListItemContainer listItemContainerStyle={styles.accordionStyle}>\n <Text style={[styles.sectionHeaderStyle, sectionHeaderStyle]}>\n {title}\n </Text>\n <View style={isExpanded ? null : styles.rotatedIcon90}>\n <Image source={require('../../asset/arrow-down.png')} />\n </View>\n </ListItemContainer>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n listEmptyComponentStyle: {\n alignItems: 'center',\n width: '100%',\n marginVertical: 20,\n },\n itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n listItemContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n sectionHeaderStyle: { fontWeight: '500' },\n accordionStyle: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n justifyContent: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;IACnBC,aAAa,EAAE,KAAK;IACpBV,UAAU,EAAE;EACd,CAAC;EACDV,kBAAkB,EAAE;IAAEqB,UAAU,EAAE;EAAM,CAAC;EACzCjB,cAAc,EAAE;IACdgB,aAAa,EAAE,KAAK;IACpBE,QAAQ,EAAE,QAAQ;IAClBC,cAAc,EAAE,eAAe;IAC/BC,YAAY,EAAE;EAChB,CAAC;EACDnB,aAAa,EAAE;IACboB,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC;AACF,CAAC,CAAC"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -45,7 +45,9 @@ const DropdownSelect = _ref => {
|
|
|
45
45
|
selectedItemStyle,
|
|
46
46
|
multipleSelectedItemStyle,
|
|
47
47
|
modalBackgroundStyle,
|
|
48
|
+
// kept for backwards compatibility
|
|
48
49
|
modalOptionsContainerStyle,
|
|
50
|
+
// kept for backwards compatibility
|
|
49
51
|
searchInputStyle,
|
|
50
52
|
// kept for backwards compatibility
|
|
51
53
|
primaryColor,
|
|
@@ -62,9 +64,12 @@ const DropdownSelect = _ref => {
|
|
|
62
64
|
listFooterComponent,
|
|
63
65
|
listComponentStyles,
|
|
64
66
|
modalProps,
|
|
67
|
+
// kept for backwards compatibility
|
|
65
68
|
hideModal = false,
|
|
66
69
|
listControls,
|
|
67
70
|
searchControls,
|
|
71
|
+
modalControls,
|
|
72
|
+
checkboxControls,
|
|
68
73
|
...rest
|
|
69
74
|
} = _ref;
|
|
70
75
|
const [newOptions, setNewOptions] = (0, _react.useState)([]);
|
|
@@ -201,7 +206,7 @@ const DropdownSelect = _ref => {
|
|
|
201
206
|
*==========================================*/
|
|
202
207
|
const onSearch = value => {
|
|
203
208
|
setSearchValue(value);
|
|
204
|
-
let searchText = value.toString().toLocaleLowerCase().trim();
|
|
209
|
+
let searchText = (0, _utils.escapeRegExp)(value).toString().toLocaleLowerCase().trim();
|
|
205
210
|
const regexFilter = new RegExp(searchText, 'i');
|
|
206
211
|
|
|
207
212
|
// Because the options array will be mutated while searching, we have to search with the original array
|
|
@@ -304,11 +309,14 @@ const DropdownSelect = _ref => {
|
|
|
304
309
|
placeholderStyle: placeholderStyle,
|
|
305
310
|
setIndexOfSelectedItem: setIndexOfSelectedItem
|
|
306
311
|
}, rest)), /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
307
|
-
|
|
308
|
-
modalBackgroundStyle: modalBackgroundStyle
|
|
309
|
-
|
|
312
|
+
visible: open,
|
|
313
|
+
modalBackgroundStyle: modalBackgroundStyle // kept for backwards compatibility
|
|
314
|
+
,
|
|
315
|
+
modalOptionsContainerStyle: modalOptionsContainerStyle // kept for backwards compatibility
|
|
316
|
+
,
|
|
310
317
|
onRequestClose: () => handleToggleModal(),
|
|
311
|
-
|
|
318
|
+
modalControls: modalControls,
|
|
319
|
+
modalProps: modalProps // kept for backwards compatibility
|
|
312
320
|
}, /*#__PURE__*/_react.default.createElement(ListTypeComponent, {
|
|
313
321
|
ListHeaderComponent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isSearchable && /*#__PURE__*/_react.default.createElement(_Input.default, _extends({
|
|
314
322
|
value: searchValue,
|
|
@@ -349,6 +357,7 @@ const DropdownSelect = _ref => {
|
|
|
349
357
|
checkboxLabelStyle: checkboxLabelStyle,
|
|
350
358
|
checkboxComponentStyles: checkboxComponentStyles,
|
|
351
359
|
checkboxComponent: checkboxComponent,
|
|
360
|
+
checkboxControls: checkboxControls,
|
|
352
361
|
listIndex: listIndex,
|
|
353
362
|
emptyListMessage: listControls === null || listControls === void 0 ? void 0 : listControls.emptyListMessage
|
|
354
363
|
})));
|