react-native-input-select 1.3.3 → 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.
Files changed (47) hide show
  1. package/README.md +48 -40
  2. package/lib/commonjs/components/CheckBox/{types.js → checkbox.types.js} +1 -1
  3. package/lib/commonjs/components/CheckBox/checkbox.types.js.map +1 -0
  4. package/lib/commonjs/components/CheckBox/index.js +9 -28
  5. package/lib/commonjs/components/CheckBox/index.js.map +1 -1
  6. package/lib/commonjs/components/CustomModal/index.js +11 -7
  7. package/lib/commonjs/components/CustomModal/index.js.map +1 -1
  8. package/lib/commonjs/components/Dropdown/DropdownSectionList.js +1 -1
  9. package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -1
  10. package/lib/commonjs/components/Others/index.js.map +1 -1
  11. package/lib/commonjs/index.js +13 -4
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/types/index.types.js.map +1 -1
  14. package/lib/commonjs/utils/index.js.map +1 -1
  15. package/lib/module/components/CheckBox/checkbox.types.js +2 -0
  16. package/lib/module/components/CheckBox/checkbox.types.js.map +1 -0
  17. package/lib/module/components/CheckBox/index.js +9 -28
  18. package/lib/module/components/CheckBox/index.js.map +1 -1
  19. package/lib/module/components/CustomModal/index.js +11 -7
  20. package/lib/module/components/CustomModal/index.js.map +1 -1
  21. package/lib/module/components/Dropdown/DropdownSectionList.js +1 -1
  22. package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -1
  23. package/lib/module/components/Others/index.js.map +1 -1
  24. package/lib/module/index.js +13 -4
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/types/index.types.js.map +1 -1
  27. package/lib/module/utils/index.js.map +1 -1
  28. package/lib/typescript/components/CheckBox/checkbox.types.d.ts +9 -0
  29. package/lib/typescript/components/CheckBox/index.d.ts +2 -19
  30. package/lib/typescript/components/CustomModal/index.d.ts +3 -1
  31. package/lib/typescript/components/Others/index.d.ts +3 -1
  32. package/lib/typescript/types/index.types.d.ts +46 -15
  33. package/lib/typescript/utils/index.d.ts +1 -1
  34. package/package.json +2 -2
  35. package/src/components/CheckBox/checkbox.types.ts +10 -0
  36. package/src/components/CheckBox/index.tsx +15 -26
  37. package/src/components/CustomModal/index.tsx +19 -11
  38. package/src/components/Dropdown/DropdownSectionList.tsx +1 -1
  39. package/src/components/Others/index.tsx +5 -1
  40. package/src/index.tsx +11 -7
  41. package/src/types/index.types.ts +56 -15
  42. package/src/utils/index.ts +1 -1
  43. package/lib/commonjs/components/CheckBox/types.js.map +0 -1
  44. package/lib/module/components/CheckBox/types.js +0 -2
  45. package/lib/module/components/CheckBox/types.js.map +0 -1
  46. package/lib/typescript/components/CheckBox/types.d.ts +0 -18
  47. 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 | 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
- | modalBackgroundStyle | `Object` | `{backgroundColor: 'rgba(196, 198, 246, 0.5)'}` |
265
- | modalOptionsContainerStyle | `Object` | `{padding: 10, backgroundColor: 'cyan',}` |
266
- | modalProps | `ReactNative.ModalProps` | `{supportedOrientations:{['landscape-left', landscape-right']}` |
267
- | dropdownErrorStyle | `Object` | `{borderWidth: 2, borderStyle: 'solid'}` |
268
- | dropdownErrorTextStyle | `Object` | `{color: 'red', fontWeight:'500'}` |
269
- | dropdownHelperTextStyle | `Object` | `{color: 'green', fontWeight:'500'}` |
270
- | primaryColor | `string` | `blue` |
271
- | listHeaderComponent | `React Component` | `<Text> You can add any component here </Text>` |
272
- | listFooterComponent | `React Component` | `<Text> You can add any component here <Text>` |
273
- | hideModal | `Boolean` | Use this to hide the modal as needed |
274
- | listComponentStyles | `Object` | `{listEmptyComponentStyle: ViewStyle, itemSeparatorStyle: ViewStyle, sectionHeaderStyle: TextStyle}` |
275
- | checkboxComponentStyles | `Object` | `{checkboxSize: number, checkboxStyle: ViewStyle, checkboxLabelStyle: TextStyle}` |
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 `checkboxComponentStyles` e.g
281
+ - Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle`, `checkboxComponent` would be replaced with a single object `checkboxControls` e.g
285
282
 
286
283
  ```js
287
- checkboxComponentStyles = {
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 inside replaced with `textInputStyle` in the `searchControls` object
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.
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- //# sourceMappingURL=types.js.map
6
+ //# sourceMappingURL=checkbox.types.js.map
@@ -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\n/**\n * Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle` would be replaced in future releases\n * and replaced with a single object `checkboxComponentStyles` e.g\n\n```js\nconst checkboxComponentStyles = {\n checkboxSize: 20,\n checkboxStyle: {\n backgroundColor: 'purple',\n borderRadius: 30,\n padding: 10,\n borderColor: 'red',\n },\n checkboxLabelStyle: { color: 'red', fontSize: 20 },\n};\n```\n */\n\nconst CheckBox = ({\n label,\n value,\n disabled,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n checkboxComponentStyles,\n checkboxComponent,\n onChange,\n}: CheckboxProps) => {\n // const { checkboxSize, checkboxStyle, checkboxLabelStyle } =\n // checkboxComponentStyles || undefined;\n const fillColor = {\n backgroundColor: disabled\n ? '#d3d3d3'\n : value\n ? checkboxComponentStyles?.checkboxStyle?.backgroundColor ||\n checkboxStyle?.backgroundColor ||\n primaryColor ||\n 'green'\n : 'white',\n borderColor: disabled\n ? colors.disabled\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 checkboxComponentStyles?.checkboxStyle || checkboxStyle,\n fillColor,\n ]}\n >\n {checkboxComponent || (\n <Image\n source={require('../../asset/check.png')}\n style={[\n {\n height:\n checkboxComponentStyles?.checkboxSize ||\n checkboxSize ||\n CHECKBOX_SIZE,\n width:\n checkboxComponentStyles?.checkboxSize ||\n checkboxSize ||\n CHECKBOX_SIZE,\n },\n ]}\n />\n )}\n </View>\n {label && label !== '' && (\n <Text\n style={[\n checkboxComponentStyles?.checkboxLabelStyle || 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 borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: 4,\n borderColor: 'black',\n },\n labelStyle: { marginLeft: 10 },\n});\n\nexport default CheckBox;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAAgD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMG,QAAQ,GAAGC,IAAA,IAWI;EAAA,IA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T,GAEDF,iBAAiB,iBAChBrB,MAAA,CAAAQ,OAAA,CAAAqB,aAAA,CAAC1B,YAAA,CAAAgC,KAAK;IACJC,MAAM,EAAElC,OAAO,CAAC,uBAAuB,CAAE;IACzC8B,KAAK,EAAE,CACL;MACEK,MAAM,EACJ,CAAAjB,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEH,YAAY,KACrCA,YAAY,IACZqB,wBAAa;MACfC,KAAK,EACH,CAAAnB,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEH,YAAY,KACrCA,YAAY,IACZqB;IACJ,CAAC;EACD,CACH,CAEC,CAAC,EACNzB,KAAK,IAAIA,KAAK,KAAK,EAAE,iBACpBb,MAAA,CAAAQ,OAAA,CAAAqB,aAAA,CAAC1B,YAAA,CAAAqC,IAAI;IACHR,KAAK,EAAE,CACL,CAAAZ,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAED,kBAAkB,KAAIA,kBAAkB,EACjEQ,MAAM,CAACc,UAAU;EACjB,GAED5B,KACG,CAEC,CAAC;AAEhB,CAAC;AAED,MAAMc,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,GAEY3C,QAAQ;AAAA4C,OAAA,CAAA7C,OAAA,GAAA4C,QAAA"}
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 borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: 4,\n borderColor: 'black',\n },\n labelStyle: { marginLeft: 10 },\n});\n\nexport default CheckBox;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAAgD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGhD,MAAMG,QAAQ,GAAGC,IAAA,IAYI;EAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EAAA,IAZH;IAChBC,KAAK;IACLC,KAAK;IACLC,QAAQ;IACRC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC,kBAAkB;IAClBC,uBAAuB;IACvBC,iBAAiB;IACjBC,gBAAgB;IAChBC;EACa,CAAC,GAAAf,IAAA;EACd,MAAMgB,SAAS,GAAG;IAChBC,eAAe,EAAEV,QAAQ,GACrB,SAAS,GACTD,KAAK,GACL,CAAAQ,gBAAgB,aAAhBA,gBAAgB,gBAAAb,qBAAA,GAAhBa,gBAAgB,CAAEJ,aAAa,cAAAT,qBAAA,uBAA/BA,qBAAA,CAAiCgB,eAAe,MAChDL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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
- open,
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: open,
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","open","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","modalProps","children","createElement","Modal","transparent","visible","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} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nconst CustomModal = ({\n open,\n onRequestClose,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n modalProps,\n children,\n}: any) => {\n return (\n <Modal\n transparent={true}\n visible={open}\n onRequestClose={() => onRequestClose()}\n animationType=\"fade\"\n {...modalProps}\n >\n <TouchableOpacity\n onPress={() => onRequestClose()}\n style={[\n styles.modalContainer,\n styles.modalBackgroundStyle,\n modalBackgroundStyle,\n ]}\n >\n {/* Added this `TouchableWithoutFeedback` wrapper because of the closing modal on expo web */}\n <TouchableWithoutFeedback onPress={() => {}}>\n <SafeAreaView\n style={[styles.modalOptionsContainer, modalOptionsContainerStyle]}\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;AAOA,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;AAE7C,MAAMQ,WAAW,GAAGC,IAAA,IAOT;EAAA,IAPU;IACnBC,IAAI;IACJC,cAAc;IACdC,oBAAoB;IACpBC,0BAA0B;IAC1BC,UAAU;IACVC;EACG,CAAC,GAAAN,IAAA;EACJ,oBACEvB,MAAA,CAAAO,OAAA,CAAAuB,aAAA,CAAC3B,YAAA,CAAA4B,KAAK,EAAAvB,QAAA;IACJwB,WAAW,EAAE,IAAK;IAClBC,OAAO,EAAET,IAAK;IACdC,cAAc,EAAEA,CAAA,KAAMA,cAAc,CAAC,CAAE;IACvCS,aAAa,EAAC;EAAM,GAChBN,UAAU,gBAEd5B,MAAA,CAAAO,OAAA,CAAAuB,aAAA,CAAC3B,YAAA,CAAAgC,gBAAgB;IACfC,OAAO,EAAEA,CAAA,KAAMX,cAAc,CAAC,CAAE;IAChCY,KAAK,EAAE,CACLC,MAAM,CAACC,cAAc,EACrBD,MAAM,CAACZ,oBAAoB,EAC3BA,oBAAoB;EACpB,gBAGF1B,MAAA,CAAAO,OAAA,CAAAuB,aAAA,CAAC3B,YAAA,CAAAqC,wBAAwB;IAACJ,OAAO,EAAEA,CAAA,KAAM,CAAC;EAAE,gBAC1CpC,MAAA,CAAAO,OAAA,CAAAuB,aAAA,CAAC3B,YAAA,CAAAsC,YAAY;IACXJ,KAAK,EAAE,CAACC,MAAM,CAACI,qBAAqB,EAAEf,0BAA0B;EAAE,GAEjEE,QACW,CACU,CACV,CACb,CAAC;AAEZ,CAAC;AAED,MAAMS,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,cAAc,EAAE;IACdM,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDpB,oBAAoB,EAAE;IAAEqB,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,EAAE;IACxBC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYhC,WAAW;AAAAiC,OAAA,CAAAhD,OAAA,GAAA+C,QAAA"}
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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,EAC3B,CAAAE,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEF,oBAAoB,KAAIA,oBAAoB;EAC3D,gBAGF1B,MAAA,CAAAO,OAAA,CAAAwB,aAAA,CAAC5B,YAAA,CAAAqC,wBAAwB;IAACJ,OAAO,EAAEA,CAAA,KAAM,CAAC;EAAE,gBAC1CpC,MAAA,CAAAO,OAAA,CAAAwB,aAAA,CAAC5B,YAAA,CAAAsC,YAAY;IACXJ,KAAK,EAAE,CACLC,MAAM,CAACI,qBAAqB,EAC5B,CAAAd,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAED,0BAA0B,KACvCA,0BAA0B;EAC5B,GAEDG,QACW,CACU,CACV,CACb,CAAC;AAEZ,CAAC;AAED,MAAMQ,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,cAAc,EAAE;IACdM,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDpB,oBAAoB,EAAE;IAAEqB,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,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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,EAAoCC,KAAU,KAAK;EAAA,IAAlD;IAAEb,OAAO,EAAE;MAAEhC;IAAM,CAAC;IAAE0B;EAAU,CAAC,GAAAkB,KAAA;EACpD,MAAMR,UAAU,GAAGS,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAErD,gBAAgB,CAAC3C,GAAG,CAACmD,KAAK,CAAC;;EAErD;EACA,IAAI,CAACoC,UAAU,EAAE,OAAO,IAAI;EAE5B,oBACExG,MAAA,CAAAU,OAAA,CAAAuE,aAAA,CAAC7E,iBAAA,CAAAM,OAAgB;IACfoF,IAAI,EAAEA,IAAK;IACXpD,WAAW,EAAEuE,KAAK,CAACvE,WAAY;IAC/BC,WAAW,EAAEsE,KAAK,CAACtE,WAAY;IAC/BC,UAAU,EAAEqE,KAAK,CAACrE,UAAW;IAC7BoD,cAAc,EAAEiB,KAAK,CAACjB,cAAe;IACrCC,QAAQ,EAAEgB,KAAK,CAAChB,QAAS;IACzB/C,YAAY,EAAE+D,KAAK,CAAC/D,YAAa;IACjCC,YAAY,EAAE8D,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":";;;;;;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,GA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AK,CAAC;;EAErD;EACA,IAAI,CAACoC,UAAU,EAAE,OAAO,IAAI;EAE5B,oBACExG,MAAA,CAAAU,OAAA,CAAAuE,aAAA,CAAC7E,iBAAA,CAAAM,OAAgB;IACfoF,IAAI,EAAEA,IAAK;IACXpD,WAAW,EAAEuE,KAAK,CAACvE,WAAY;IAC/BC,WAAW,EAAEsE,KAAK,CAACtE,WAAY;IAC/BC,UAAU,EAAEqE,KAAK,CAACrE,UAAW;IAC7BoD,cAAc,EAAEiB,KAAK,CAACjB,cAAe;IACrCC,QAAQ,EAAEgB,KAAK,CAAChB,QAAS;IACzB/C,YAAY,EAAE+D,KAAK,CAAC/D,YAAa;IACjCC,YAAY,EAAE8D,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 +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 }: any) => {\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: 'space-between',\n alignContent: 'center',\n },\n rotatedIcon90: {\n transform: [{ rotate: '-90deg' }],\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC,MAAMG,kBAAkB,GAAGC,IAAA,IAGvB;EAAA,IAHwB;IACjCC,uBAAuB;IACvBC;EACG,CAAC,GAAAF,IAAA;EACJ,oBACET,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACL;EAAwB,gBAC1CV,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAa,IAAI;IAACF,KAAK,EAAEJ;EAAwB,GAClCC,gBAAgB,IAAI,sBACjB,CACF,CAAC;AAEX,CAAC;AAACM,OAAA,CAAAT,kBAAA,GAAAA,kBAAA;AAEK,MAAMU,sBAAsB,GAAGC,KAAA,IAAiC;EAAA,IAAhC;IAAEC;EAAwB,CAAC,GAAAD,KAAA;EAChE,oBAAOnB,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACK,kBAAkB,EAAEA,kBAAkB;EAAE,CAAE,CAAC;AACzE,CAAC;AAACH,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AAEK,MAAMG,iBAAiB,GAAGC,KAAA,IAM3B;EAAA,IAN4B;IAChCC,QAAQ;IACRC;EAIF,CAAC,GAAAF,KAAA;EACC,oBACEtB,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACS,sBAAsB,EAAEA,s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EAAE,EAAE;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"}
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: 'space-between',\n alignContent: 'center',\n },\n rotatedIcon90: {\n transform: [{ rotate: '-90deg' }],\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC,MAAMG,kBAAkB,GAAGC,IAAA,IAGvB;EAAA,IAHwB;IACjCC,uBAAuB;IACvBC;EACG,CAAC,GAAAF,IAAA;EACJ,oBACET,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EA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AM,CAACa,kBAAkB,EAAEA,kBAAkB;EAAE,GAC1DD,KACG,CAAC,eACP3B,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EAAEgB,UAAU,GAAG,IAAI,GAAGf,MAAM,CAACkB;EAAc,gBACpDjC,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAA+B,KAAK;IAACC,MAAM,EAAEjC,OAAO,CAAC,4BAA4B;EAAE,CAAE,CACnD,CACW,CACH,CAAC;AAEvB,CAAC;AAACe,OAAA,CAAAQ,kBAAA,GAAAA,kBAAA;AAEF,MAAMV,MAAM,GAAGqB,uBAAU,CAACC,MAAM,CAAC;EAC/B3B,uBAAuB,EAAE;IACvB4B,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,cAAc,EAAE;EAClB,CAAC;EACDpB,kBAAkB,EAAE;IAClBqB,eAAe,EAAEC,cAAM,CAACC,IAAI;IAC5BC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC;EACDrB,sBAAsB,EAAE;IACtBsB,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;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"}
@@ -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)([]);
@@ -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
- open: open,
308
- modalBackgroundStyle: modalBackgroundStyle,
309
- modalOptionsContainerStyle: modalOptionsContainerStyle,
312
+ visible: open,
313
+ modalBackgroundStyle: modalBackgroundStyle // kept for backwards compatibility
314
+ ,
315
+ modalOptionsContainerStyle: modalOptionsContainerStyle // kept for backwards compatibility
316
+ ,
310
317
  onRequestClose: () => handleToggleModal(),
311
- modalProps: modalProps
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
  })));