react-native-input-select 1.1.1 → 1.1.2

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 (36) hide show
  1. package/lib/commonjs/components/CheckBox/index.js +17 -7
  2. package/lib/commonjs/components/CheckBox/index.js.map +1 -1
  3. package/lib/commonjs/components/Dropdown/Dropdown.js +4 -2
  4. package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
  5. package/lib/commonjs/components/Dropdown/DropdownFlatList.js +29 -4
  6. package/lib/commonjs/components/Dropdown/DropdownFlatList.js.map +1 -1
  7. package/lib/commonjs/components/Dropdown/DropdownSectionList.js +25 -1
  8. package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -1
  9. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js +41 -9
  10. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  11. package/lib/commonjs/index.js +60 -15
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/module/components/CheckBox/index.js +17 -6
  14. package/lib/module/components/CheckBox/index.js.map +1 -1
  15. package/lib/module/components/Dropdown/Dropdown.js +4 -2
  16. package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
  17. package/lib/module/components/Dropdown/DropdownFlatList.js +27 -4
  18. package/lib/module/components/Dropdown/DropdownFlatList.js.map +1 -1
  19. package/lib/module/components/Dropdown/DropdownSectionList.js +26 -2
  20. package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -1
  21. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js +42 -10
  22. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  23. package/lib/module/index.js +61 -16
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/typescript/components/CheckBox/index.d.ts +16 -4
  26. package/lib/typescript/components/Dropdown/Dropdown.d.ts +1 -1
  27. package/lib/typescript/components/Dropdown/DropdownFlatList.d.ts +1 -1
  28. package/lib/typescript/components/Dropdown/DropdownSectionList.d.ts +1 -1
  29. package/lib/typescript/components/Dropdown/DropdownSelectedItemsView.d.ts +1 -1
  30. package/package.json +1 -1
  31. package/src/components/CheckBox/index.tsx +17 -6
  32. package/src/components/Dropdown/Dropdown.tsx +3 -0
  33. package/src/components/Dropdown/DropdownFlatList.tsx +24 -1
  34. package/src/components/Dropdown/DropdownSectionList.tsx +27 -1
  35. package/src/components/Dropdown/DropdownSelectedItemsView.tsx +32 -13
  36. package/src/index.tsx +61 -18
@@ -65,9 +65,13 @@ const DropdownSelect = _ref => {
65
65
  const [newOptions, setNewOptions] = (0, _react.useState)([]);
66
66
  const [open, setOpen] = (0, _react.useState)(false);
67
67
  const [selectAll, setSelectAll] = (0, _react.useState)(false);
68
- const [selectedItem, setSelectedItem] = (0, _react.useState)(''); //for single selection
69
- const [selectedItems, setSelectedItems] = (0, _react.useState)([]); //for multiple selection
68
+ const [selectedItem, setSelectedItem] = (0, _react.useState)(''); // for single selection
69
+ const [selectedItems, setSelectedItems] = (0, _react.useState)([]); // for multiple selection
70
70
  const [searchValue, setSearchValue] = (0, _react.useState)('');
71
+ const [listIndex, setListIndex] = (0, _react.useState)({
72
+ itemIndex: 0
73
+ }); // for scrollToIndex in Sectionlist and Flatlist
74
+
71
75
  (0, _react.useEffect)(() => {
72
76
  if (options) {
73
77
  setNewOptions(options);
@@ -85,10 +89,11 @@ const DropdownSelect = _ref => {
85
89
 
86
90
  const isSectionList = newOptions.some(item => item.title && item.data && Array.isArray(item.data));
87
91
  const ListTypeComponent = isSectionList ? _DropdownSectionList.default : _DropdownFlatList.default;
88
- let modifiedSectionData = (0, _utils.extractPropertyFromArray)(newOptions, 'data').flat();
89
- let modifiedOptions = isSectionList ? modifiedSectionData : newOptions;
92
+ const modifiedSectionData = (0, _utils.extractPropertyFromArray)(newOptions, 'data').flat();
93
+ const modifiedOptions = isSectionList ? modifiedSectionData : newOptions;
90
94
  const optLabel = optionLabel || _constants.DEFAULT_OPTION_LABEL;
91
95
  const optValue = optionValue || _constants.DEFAULT_OPTION_VALUE;
96
+ const optionsCopy = JSON.parse(JSON.stringify(options)); //copy of the original options array
92
97
 
93
98
  /*===========================================
94
99
  * Selection handlers
@@ -113,15 +118,7 @@ const DropdownSelect = _ref => {
113
118
  } else {
114
119
  selectedValues.push(value);
115
120
  }
116
- setSelectedItems(selectedValues);
117
121
  onValueChange(selectedValues); //send value to parent
118
-
119
- //select all checkbox should not be checked if the list contains disabled values
120
- if (modifiedOptions.filter(item => !item.disabled).length === selectedValues.length) {
121
- setSelectAll(true);
122
- } else {
123
- setSelectAll(false);
124
- }
125
122
  return selectedValues;
126
123
  });
127
124
  };
@@ -142,6 +139,26 @@ const DropdownSelect = _ref => {
142
139
  });
143
140
  };
144
141
 
142
+ /*===========================================
143
+ * Handle side effects
144
+ *==========================================*/
145
+ const checkSelectAll = (0, _react.useCallback)(selectedValues => {
146
+ //if the list contains disabled values, those values will not be selected
147
+ if (modifiedOptions.filter(item => !item.disabled).length === selectedValues.length) {
148
+ setSelectAll(true);
149
+ } else {
150
+ setSelectAll(false);
151
+ }
152
+ }, [modifiedOptions]);
153
+
154
+ // anytime the selected items change, check if it is time to set `selectAll` to true
155
+ (0, _react.useEffect)(() => {
156
+ if (isMultiple) {
157
+ checkSelectAll(selectedItems);
158
+ }
159
+ return () => {};
160
+ }, [checkSelectAll, isMultiple, selectedItems]);
161
+
145
162
  /*===========================================
146
163
  * Get label handler
147
164
  *==========================================*/
@@ -168,7 +185,6 @@ const DropdownSelect = _ref => {
168
185
  const regexFilter = new RegExp(searchText, 'i');
169
186
 
170
187
  //Because Search mutates the initial state, we have to search with a copy of the original array
171
- const optionsCopy = JSON.parse(JSON.stringify(options));
172
188
  const searchResults = isSectionList ? searchSectionList(optionsCopy, regexFilter) : searchFlatList(optionsCopy, regexFilter);
173
189
  setNewOptions(searchResults);
174
190
  };
@@ -201,6 +217,10 @@ const DropdownSelect = _ref => {
201
217
  setOpen(!open);
202
218
  setSearchValue('');
203
219
  setNewOptions(options);
220
+ setListIndex({
221
+ itemIndex: 0,
222
+ sectionIndex: 0
223
+ });
204
224
  };
205
225
  (0, _react.useEffect)(() => {
206
226
  if (hideModal) {
@@ -211,6 +231,29 @@ const DropdownSelect = _ref => {
211
231
  let primary = primaryColor || _colors.colors.gray;
212
232
  const sectionListMaxLength = (0, _utils.getMaxLengthOfSectionListProperty)(newOptions, 'data');
213
233
  const listIsEmpty = isSectionList ? sectionListMaxLength > 1 : newOptions.length > 1;
234
+
235
+ /*===========================================
236
+ * setIndexOfSelectedItem - For ScrollToIndex
237
+ *==========================================*/
238
+ const setIndexOfSelectedItem = selectedLabel => {
239
+ isSectionList ? optionsCopy.map((item, sectionIndex) => {
240
+ var _item$data;
241
+ (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.find((dataItem, itemIndex) => {
242
+ if (dataItem[optLabel] === selectedLabel) {
243
+ setListIndex({
244
+ sectionIndex,
245
+ itemIndex
246
+ });
247
+ }
248
+ });
249
+ }) : optionsCopy === null || optionsCopy === void 0 ? void 0 : optionsCopy.find((item, itemIndex) => {
250
+ if (item[optLabel] === selectedLabel) {
251
+ setListIndex({
252
+ itemIndex
253
+ });
254
+ }
255
+ });
256
+ };
214
257
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({
215
258
  label: label,
216
259
  placeholder: placeholder,
@@ -233,7 +276,8 @@ const DropdownSelect = _ref => {
233
276
  isMultiple: isMultiple,
234
277
  primaryColor: primary,
235
278
  disabled: disabled,
236
- placeholderStyle: placeholderStyle
279
+ placeholderStyle: placeholderStyle,
280
+ setIndexOfSelectedItem: setIndexOfSelectedItem
237
281
  }, rest)), /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
238
282
  open: open,
239
283
  handleToggleModal: handleToggleModal,
@@ -276,7 +320,8 @@ const DropdownSelect = _ref => {
276
320
  checkboxSize: checkboxSize,
277
321
  checkboxStyle: checkboxStyle,
278
322
  checkboxLabelStyle: checkboxLabelStyle,
279
- checkboxComponentStyles: checkboxComponentStyles
323
+ checkboxComponentStyles: checkboxComponentStyles,
324
+ listIndex: listIndex
280
325
  })));
281
326
  };
282
327
  exports.DropdownSelect = DropdownSelect;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Input","_interopRequireDefault","_CheckBox","_Dropdown","_DropdownFlatList","_DropdownSectionList","_CustomModal","_colors","_constants","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSelect","_ref","placeholder","label","error","helperText","options","optionLabel","optionValue","onValueChange","selectedValue","isMultiple","isSearchable","dropdownIcon","labelStyle","placeholderStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","selectedItemStyle","multipleSelectedItemStyle","modalBackgroundStyle","modalOptionsContainerStyle","searchInputStyle","primaryColor","disabled","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listHeaderComponent","listFooterComponent","listComponentStyles","modalProps","hideModal","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","searchValue","setSearchValue","useEffect","Array","isArray","isSectionList","some","item","title","data","ListTypeComponent","DropdownSectionList","DropdownFlatList","modifiedSectionData","extractPropertyFromArray","flat","modifiedOptions","optLabel","DEFAULT_OPTION_LABEL","optValue","DEFAULT_OPTION_VALUE","handleSingleSelection","value","handleMultipleSelections","prevVal","_selectedValues","selectedValues","includes","filter","push","handleSelectAll","filteredOptions","getSelectedItemsLabel","selectedLabels","forEach","element","_modifiedOptions$find","selectedItemLabel","find","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","optionsCopy","JSON","parse","stringify","searchResults","searchSectionList","searchFlatList","flatList","toLowerCase","search","sectionList","map","listItem","handleToggleModal","primary","colors","gray","sectionListMaxLength","getMaxLengthOfSectionListProperty","listIsEmpty","createElement","Fragment","onRequestClose","ListHeaderComponent","onChangeText","text","style","View","styles","optionsContainerStyle","TouchableOpacity","onPress","onChange","ListFooterComponent","exports","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { TouchableOpacity, StyleSheet, View } from 'react-native';\nimport Input from './components/Input';\nimport CheckBox from './components/CheckBox';\nimport Dropdown from './components/Dropdown/Dropdown';\nimport DropdownFlatList from './components/Dropdown/DropdownFlatList';\nimport DropdownSectionList from './components/Dropdown/DropdownSectionList';\nimport CustomModal from './components/CustomModal';\nimport { colors } from './styles/colors';\nimport { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';\nimport type {\n DropdownProps,\n TFlatList,\n TFlatListItem,\n TSectionList,\n TSectionListItem,\n} from './types/index.types';\nimport {\n extractPropertyFromArray,\n getMaxLengthOfSectionListProperty,\n} from './utils';\n\nexport const DropdownSelect: React.FC<DropdownProps> = ({\n placeholder,\n label,\n error,\n helperText,\n options,\n optionLabel,\n optionValue,\n onValueChange,\n selectedValue,\n isMultiple,\n isSearchable,\n dropdownIcon,\n labelStyle,\n placeholderStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n searchInputStyle,\n primaryColor,\n disabled,\n checkboxSize, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n listHeaderComponent,\n listFooterComponent,\n listComponentStyles,\n modalProps,\n hideModal = false,\n ...rest\n}) => {\n const [newOptions, setNewOptions] = useState<TFlatList | TSectionList>([]);\n const [open, setOpen] = useState<boolean>(false);\n const [selectAll, setSelectAll] = useState<boolean>(false);\n const [selectedItem, setSelectedItem] = useState<any>(''); //for single selection\n const [selectedItems, setSelectedItems] = useState<any[]>([]); //for multiple selection\n const [searchValue, setSearchValue] = useState<string>('');\n\n useEffect(() => {\n if (options) {\n setNewOptions(options);\n }\n return () => {};\n }, [options]);\n\n useEffect(() => {\n isMultiple\n ? setSelectedItems(Array.isArray(selectedValue) ? selectedValue : [])\n : setSelectedItem(selectedValue);\n\n return () => {};\n }, [selectedValue, isMultiple, onValueChange]);\n\n /*===========================================\n * List type\n *==========================================*/\n\n const isSectionList = newOptions.some(\n (item) => item.title && item.data && Array.isArray(item.data)\n );\n\n const ListTypeComponent = isSectionList\n ? DropdownSectionList\n : DropdownFlatList;\n let modifiedSectionData = extractPropertyFromArray(newOptions, 'data').flat();\n let modifiedOptions = isSectionList ? modifiedSectionData : newOptions;\n\n const optLabel = optionLabel || DEFAULT_OPTION_LABEL;\n const optValue = optionValue || DEFAULT_OPTION_VALUE;\n\n /*===========================================\n * Selection handlers\n *==========================================*/\n const handleSingleSelection = (value: string | number) => {\n if (selectedItem === value) {\n setSelectedItem(null);\n onValueChange(null); //send value to parent\n } else {\n setSelectedItem(value);\n onValueChange(value); //send value to parent\n setOpen(false); //close modal upon selection\n }\n };\n\n const handleMultipleSelections = (value: string[] | number[]) => {\n setSelectedItems((prevVal) => {\n let selectedValues = [...prevVal];\n\n if (selectedValues?.includes(value)) {\n selectedValues = selectedValues.filter((item) => item !== value);\n } else {\n selectedValues.push(value);\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n\n //select all checkbox should not be checked if the list contains disabled values\n if (\n modifiedOptions.filter((item: TFlatListItem) => !item.disabled)\n .length === selectedValues.length\n ) {\n setSelectAll(true);\n } else {\n setSelectAll(false);\n }\n return selectedValues;\n });\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n //don't select disabled items\n const filteredOptions = modifiedOptions.filter(\n (item: TFlatListItem) => !item.disabled\n );\n\n if (!prevVal) {\n for (let i = 0; i < filteredOptions.length; i++) {\n selectedValues.push(filteredOptions[i][optValue]);\n }\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n return !prevVal;\n });\n };\n\n /*===========================================\n * Get label handler\n *==========================================*/\n const getSelectedItemsLabel = () => {\n if (isMultiple && Array.isArray(selectedItems)) {\n let selectedLabels: Array<string> = [];\n\n selectedItems?.forEach((element: number | string) => {\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === element\n )?.[optLabel];\n selectedLabels.push(selectedItemLabel);\n });\n return selectedLabels;\n }\n\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === selectedItem\n );\n return selectedItemLabel?.[optLabel];\n };\n\n /*===========================================\n * Search\n *==========================================*/\n const onSearch = (value: string) => {\n setSearchValue(value);\n\n let searchText = value.toString().toLocaleLowerCase().trim();\n\n const regexFilter = new RegExp(searchText, 'i');\n\n //Because Search mutates the initial state, we have to search with a copy of the original array\n const optionsCopy = JSON.parse(JSON.stringify(options));\n const searchResults = isSectionList\n ? searchSectionList(optionsCopy as TSectionList, regexFilter)\n : searchFlatList(optionsCopy as TFlatList, regexFilter);\n\n setNewOptions(searchResults);\n };\n\n const searchFlatList = (flatList: TFlatList, regexFilter: RegExp) => {\n const searchResults = flatList.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return item;\n }\n return;\n });\n return searchResults;\n };\n\n const searchSectionList = (\n sectionList: TSectionList,\n regexFilter: RegExp\n ) => {\n const searchResults = sectionList.map((listItem: TSectionListItem) => {\n listItem.data = listItem.data.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return listItem.data.push(item);\n }\n return;\n });\n\n return listItem;\n });\n\n return searchResults;\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n };\n\n useEffect(() => {\n if (hideModal) {\n setOpen(false);\n }\n return () => {};\n }, [hideModal]);\n\n let primary = primaryColor || colors.gray;\n\n const sectionListMaxLength = getMaxLengthOfSectionListProperty(\n newOptions as TSectionList,\n 'data'\n );\n\n const listIsEmpty = isSectionList\n ? sectionListMaxLength > 1\n : newOptions.length > 1;\n\n return (\n <>\n <Dropdown\n label={label}\n placeholder={placeholder}\n helperText={helperText}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n handleToggleModal={handleToggleModal}\n labelStyle={labelStyle}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n dropdownContainerStyle={dropdownContainerStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n dropdownErrorTextStyle={dropdownErrorTextStyle}\n dropdownHelperTextStyle={dropdownHelperTextStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n isMultiple={isMultiple}\n primaryColor={primary}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n {...rest}\n />\n <CustomModal\n open={open}\n handleToggleModal={handleToggleModal}\n modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainerStyle={modalOptionsContainerStyle}\n onRequestClose={() => {}}\n modalProps={modalProps}\n >\n <ListTypeComponent\n ListHeaderComponent={\n <>\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchInputStyle}\n primaryColor={primary}\n />\n )}\n {listHeaderComponent}\n {isMultiple && listIsEmpty && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={selectAll ? 'Clear all' : 'Select all'}\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n />\n </TouchableOpacity>\n </View>\n )}\n </>\n }\n ListFooterComponent={listFooterComponent}\n listComponentStyles={listComponentStyles}\n options={newOptions}\n optionLabel={optLabel}\n optionValue={optValue}\n isMultiple={isMultiple}\n isSearchable={isSearchable}\n selectedItems={selectedItems}\n selectedItem={selectedItem}\n handleMultipleSelections={handleMultipleSelections}\n handleSingleSelection={handleSingleSelection}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n />\n </CustomModal>\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n optionsContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n },\n});\n\nexport default DropdownSelect;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,oBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,YAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAQA,IAAAW,MAAA,GAAAX,OAAA;AAGiB,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,O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AwB,CAClD,CACU,CACb,CAAC;AAEP,CAAC;AAACkG,OAAA,CAAAlI,cAAA,GAAAA,cAAA;AAEF,MAAM4H,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,qBAAqB,EAAE;IACrBQ,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYxI,cAAc;AAAAkI,OAAA,CAAA/J,OAAA,GAAAqK,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Input","_interopRequireDefault","_CheckBox","_Dropdown","_DropdownFlatList","_DropdownSectionList","_CustomModal","_colors","_constants","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSelect","_ref","placeholder","label","error","helperText","options","optionLabel","optionValue","onValueChange","selectedValue","isMultiple","isSearchable","dropdownIcon","labelStyle","placeholderStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","selectedItemStyle","multipleSelectedItemStyle","modalBackgroundStyle","modalOptionsContainerStyle","searchInputStyle","primaryColor","disabled","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listHeaderComponent","listFooterComponent","listComponentStyles","modalProps","hideModal","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","searchValue","setSearchValue","listIndex","setListIndex","itemIndex","useEffect","Array","isArray","isSectionList","some","item","title","data","ListTypeComponent","DropdownSectionList","DropdownFlatList","modifiedSectionData","extractPropertyFromArray","flat","modifiedOptions","optLabel","DEFAULT_OPTION_LABEL","optValue","DEFAULT_OPTION_VALUE","optionsCopy","JSON","parse","stringify","handleSingleSelection","value","handleMultipleSelections","prevVal","_selectedValues","selectedValues","includes","filter","push","handleSelectAll","filteredOptions","checkSelectAll","useCallback","getSelectedItemsLabel","selectedLabels","forEach","element","_modifiedOptions$find","selectedItemLabel","find","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","searchSectionList","searchFlatList","flatList","toLowerCase","search","sectionList","map","listItem","handleToggleModal","sectionIndex","primary","colors","gray","sectionListMaxLength","getMaxLengthOfSectionListProperty","listIsEmpty","setIndexOfSelectedItem","selectedLabel","_item$data","dataItem","createElement","Fragment","onRequestClose","ListHeaderComponent","onChangeText","text","style","View","styles","optionsContainerStyle","TouchableOpacity","onPress","onChange","ListFooterComponent","exports","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport { TouchableOpacity, StyleSheet, View } from 'react-native';\nimport Input from './components/Input';\nimport CheckBox from './components/CheckBox';\nimport Dropdown from './components/Dropdown/Dropdown';\nimport DropdownFlatList from './components/Dropdown/DropdownFlatList';\nimport DropdownSectionList from './components/Dropdown/DropdownSectionList';\nimport CustomModal from './components/CustomModal';\nimport { colors } from './styles/colors';\nimport { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';\nimport type {\n DropdownProps,\n TFlatList,\n TFlatListItem,\n TSectionList,\n TSectionListItem,\n} from './types/index.types';\nimport {\n extractPropertyFromArray,\n getMaxLengthOfSectionListProperty,\n} from './utils';\n\nexport const DropdownSelect: React.FC<DropdownProps> = ({\n placeholder,\n label,\n error,\n helperText,\n options,\n optionLabel,\n optionValue,\n onValueChange,\n selectedValue,\n isMultiple,\n isSearchable,\n dropdownIcon,\n labelStyle,\n placeholderStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n selectedItemStyle,\n multipleSelectedItemStyle,\n modalBackgroundStyle,\n modalOptionsContainerStyle,\n searchInputStyle,\n primaryColor,\n disabled,\n checkboxSize, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n listHeaderComponent,\n listFooterComponent,\n listComponentStyles,\n modalProps,\n hideModal = false,\n ...rest\n}) => {\n const [newOptions, setNewOptions] = useState<TFlatList | TSectionList>([]);\n const [open, setOpen] = useState<boolean>(false);\n const [selectAll, setSelectAll] = useState<boolean>(false);\n const [selectedItem, setSelectedItem] = useState<any>(''); // for single selection\n const [selectedItems, setSelectedItems] = useState<any[]>([]); // for multiple selection\n const [searchValue, setSearchValue] = useState<string>('');\n const [listIndex, setListIndex] = useState<{\n sectionIndex?: number;\n itemIndex: number;\n }>({ itemIndex: 0 }); // for scrollToIndex in Sectionlist and Flatlist\n\n useEffect(() => {\n if (options) {\n setNewOptions(options);\n }\n return () => {};\n }, [options]);\n\n useEffect(() => {\n isMultiple\n ? setSelectedItems(Array.isArray(selectedValue) ? selectedValue : [])\n : setSelectedItem(selectedValue);\n\n return () => {};\n }, [selectedValue, isMultiple, onValueChange]);\n\n /*===========================================\n * List type\n *==========================================*/\n\n const isSectionList = newOptions.some(\n (item) => item.title && item.data && Array.isArray(item.data)\n );\n\n const ListTypeComponent = isSectionList\n ? DropdownSectionList\n : DropdownFlatList;\n const modifiedSectionData = extractPropertyFromArray(\n newOptions,\n 'data'\n ).flat();\n const modifiedOptions = isSectionList ? modifiedSectionData : newOptions;\n\n const optLabel = optionLabel || DEFAULT_OPTION_LABEL;\n const optValue = optionValue || DEFAULT_OPTION_VALUE;\n const optionsCopy = JSON.parse(JSON.stringify(options)); //copy of the original options array\n\n /*===========================================\n * Selection handlers\n *==========================================*/\n const handleSingleSelection = (value: string | number) => {\n if (selectedItem === value) {\n setSelectedItem(null);\n onValueChange(null); //send value to parent\n } else {\n setSelectedItem(value);\n onValueChange(value); //send value to parent\n setOpen(false); //close modal upon selection\n }\n };\n\n const handleMultipleSelections = (value: string[] | number[]) => {\n setSelectedItems((prevVal) => {\n let selectedValues = [...prevVal];\n\n if (selectedValues?.includes(value)) {\n selectedValues = selectedValues.filter((item) => item !== value);\n } else {\n selectedValues.push(value);\n }\n onValueChange(selectedValues); //send value to parent\n return selectedValues;\n });\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n //don't select disabled items\n const filteredOptions = modifiedOptions.filter(\n (item: TFlatListItem) => !item.disabled\n );\n\n if (!prevVal) {\n for (let i = 0; i < filteredOptions.length; i++) {\n selectedValues.push(filteredOptions[i][optValue]);\n }\n }\n\n setSelectedItems(selectedValues);\n onValueChange(selectedValues); //send value to parent\n return !prevVal;\n });\n };\n\n /*===========================================\n * Handle side effects\n *==========================================*/\n const checkSelectAll = useCallback(\n (selectedValues: any[]) => {\n //if the list contains disabled values, those values will not be selected\n if (\n modifiedOptions.filter((item: TFlatListItem) => !item.disabled)\n .length === selectedValues.length\n ) {\n setSelectAll(true);\n } else {\n setSelectAll(false);\n }\n },\n [modifiedOptions]\n );\n\n // anytime the selected items change, check if it is time to set `selectAll` to true\n useEffect(() => {\n if (isMultiple) {\n checkSelectAll(selectedItems);\n }\n return () => {};\n }, [checkSelectAll, isMultiple, selectedItems]);\n\n /*===========================================\n * Get label handler\n *==========================================*/\n const getSelectedItemsLabel = () => {\n if (isMultiple && Array.isArray(selectedItems)) {\n let selectedLabels: Array<string> = [];\n\n selectedItems?.forEach((element: number | string) => {\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === element\n )?.[optLabel];\n selectedLabels.push(selectedItemLabel);\n });\n return selectedLabels;\n }\n\n let selectedItemLabel = modifiedOptions?.find(\n (item: TFlatListItem) => item[optValue] === selectedItem\n );\n return selectedItemLabel?.[optLabel];\n };\n\n /*===========================================\n * Search\n *==========================================*/\n const onSearch = (value: string) => {\n setSearchValue(value);\n\n let searchText = value.toString().toLocaleLowerCase().trim();\n\n const regexFilter = new RegExp(searchText, 'i');\n\n //Because Search mutates the initial state, we have to search with a copy of the original array\n const searchResults = isSectionList\n ? searchSectionList(optionsCopy as TSectionList, regexFilter)\n : searchFlatList(optionsCopy as TFlatList, regexFilter);\n\n setNewOptions(searchResults);\n };\n\n const searchFlatList = (flatList: TFlatList, regexFilter: RegExp) => {\n const searchResults = flatList.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return item;\n }\n return;\n });\n return searchResults;\n };\n\n const searchSectionList = (\n sectionList: TSectionList,\n regexFilter: RegExp\n ) => {\n const searchResults = sectionList.map((listItem: TSectionListItem) => {\n listItem.data = listItem.data.filter((item: TFlatListItem) => {\n if (\n item[optLabel].toString().toLowerCase().search(regexFilter) !== -1 ||\n item[optValue].toString().toLowerCase().search(regexFilter) !== -1\n ) {\n return listItem.data.push(item);\n }\n return;\n });\n\n return listItem;\n });\n\n return searchResults;\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n setListIndex({ itemIndex: 0, sectionIndex: 0 });\n };\n\n useEffect(() => {\n if (hideModal) {\n setOpen(false);\n }\n return () => {};\n }, [hideModal]);\n\n let primary = primaryColor || colors.gray;\n\n const sectionListMaxLength = getMaxLengthOfSectionListProperty(\n newOptions as TSectionList,\n 'data'\n );\n\n const listIsEmpty = isSectionList\n ? sectionListMaxLength > 1\n : newOptions.length > 1;\n\n /*===========================================\n * setIndexOfSelectedItem - For ScrollToIndex\n *==========================================*/\n const setIndexOfSelectedItem = (selectedLabel: string) => {\n isSectionList\n ? optionsCopy.map((item: TSectionListItem, sectionIndex: number) => {\n item.data?.find((dataItem: TFlatListItem, itemIndex: number) => {\n if (dataItem[optLabel] === selectedLabel) {\n setListIndex({ sectionIndex, itemIndex });\n }\n });\n })\n : optionsCopy?.find((item: TFlatListItem, itemIndex: number) => {\n if (item[optLabel] === selectedLabel) {\n setListIndex({ itemIndex });\n }\n });\n };\n\n return (\n <>\n <Dropdown\n label={label}\n placeholder={placeholder}\n helperText={helperText}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n handleToggleModal={handleToggleModal}\n labelStyle={labelStyle}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n dropdownContainerStyle={dropdownContainerStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n dropdownErrorTextStyle={dropdownErrorTextStyle}\n dropdownHelperTextStyle={dropdownHelperTextStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n isMultiple={isMultiple}\n primaryColor={primary}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n setIndexOfSelectedItem={setIndexOfSelectedItem}\n {...rest}\n />\n <CustomModal\n open={open}\n handleToggleModal={handleToggleModal}\n modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainerStyle={modalOptionsContainerStyle}\n onRequestClose={() => {}}\n modalProps={modalProps}\n >\n <ListTypeComponent\n ListHeaderComponent={\n <>\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchInputStyle}\n primaryColor={primary}\n />\n )}\n {listHeaderComponent}\n {isMultiple && listIsEmpty && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={selectAll ? 'Clear all' : 'Select all'}\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n />\n </TouchableOpacity>\n </View>\n )}\n </>\n }\n ListFooterComponent={listFooterComponent}\n listComponentStyles={listComponentStyles}\n options={newOptions}\n optionLabel={optLabel}\n optionValue={optValue}\n isMultiple={isMultiple}\n isSearchable={isSearchable}\n selectedItems={selectedItems}\n selectedItem={selectedItem}\n handleMultipleSelections={handleMultipleSelections}\n handleSingleSelection={handleSingleSelection}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n listIndex={listIndex}\n />\n </CustomModal>\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n optionsContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n },\n});\n\nexport default DropdownSelect;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,oBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,YAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAQA,IAAAW,MAAA,GAAAX,OAAA;AAGiB,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAjB,wBAAAa,GAAA,EAAAI,WAAA,SAAA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jB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYlJ,cAAc;AAAA4I,OAAA,CAAAzK,OAAA,GAAA+K,QAAA"}
@@ -1,13 +1,24 @@
1
- /* eslint-disable react-native/no-inline-styles */
2
1
  import React from 'react';
3
2
  import { Pressable, Text, StyleSheet, Image, View } from 'react-native';
4
3
  import { colors } from '../../styles/colors';
5
4
  import { CHECKBOX_SIZE } from '../../constants';
6
5
  /**
7
- *
8
- *`checkboxSize`, `checkboxStyle`,`checkboxLabelStyle` Will be deleted in version 1.0.
9
- * and replaced with `checkboxComponentStyles`
10
- */
6
+ * Individual props `checkboxSize`, `checkboxStyle`, `checkboxLabelStyle` would be replaced in future releases
7
+ * and replaced with a single object `checkboxComponentStyles` e.g
8
+
9
+ ```js
10
+ const checkboxComponentStyles = {
11
+ checkboxSize: 20,
12
+ checkboxStyle: {
13
+ backgroundColor: 'purple',
14
+ borderRadius: 30,
15
+ padding: 10,
16
+ borderColor: 'red',
17
+ },
18
+ checkboxLabelStyle: { color: 'red', fontSize: 20 },
19
+ };
20
+ ```
21
+ */
11
22
 
12
23
  const CheckBox = _ref => {
13
24
  var _checkboxComponentSty, _checkboxComponentSty2;
@@ -23,7 +34,7 @@ const CheckBox = _ref => {
23
34
  onChange
24
35
  } = _ref;
25
36
  // const { checkboxSize, checkboxStyle, checkboxLabelStyle } =
26
- // checkboxComponentStyles;
37
+ // checkboxComponentStyles || undefined;
27
38
  const fillColor = {
28
39
  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',
29
40
  borderColor: disabled ? 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
@@ -1 +1 @@
1
- {"version":3,"names":["React","Pressable","Text","StyleSheet","Image","View","colors","CHECKBOX_SIZE","CheckBox","_ref","_checkboxComponentSty","_checkboxComponentSty2","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","onChange","fillColor","backgroundColor","borderColor","styles","checkbox","createElement","onPress","style","checkboxContainer","source","require","height","width","labelStyle","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","marginLeft"],"sources":["index.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { Pressable, Text, StyleSheet, Image, View } from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { CHECKBOX_SIZE } from '../../constants';\nimport type { CheckboxProps } from './types';\n\n/**\n *\n *`checkboxSize`, `checkboxStyle`,`checkboxLabelStyle` Will be deleted in version 1.0.\n * and replaced with `checkboxComponentStyles`\n */\n\nconst CheckBox = ({\n label,\n value,\n disabled,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n checkboxComponentStyles,\n onChange,\n}: CheckboxProps) => {\n // const { checkboxSize, checkboxStyle, checkboxLabelStyle } =\n // checkboxComponentStyles;\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 style={[styles.checkbox, checkboxStyle, fillColor]}>\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 </View>\n {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;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,aAAa,QAAQ,iBAAiB;AAG/C;AACA;AACA;AACA;AACA;;AAEA,MAAMC,QAAQ,GAAGC,IAAA,IAUI;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAAA,IAVH;IAChBC,KAAK;IACLC,KAAK;IACLC,QAAQ;IACRC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC,kBAAkB;IAClBC,uBAAuB;IACvBC;EACa,CAAC,GAAAX,IAAA;EACd;EACA;EACA,MAAMY,SAAS,GAAG;IAChBC,eAAe,EAAER,QAAQ,GACrB,SAAS,GACTD,KAAK,GACL,CAAAM,uBAAuB,aAAvBA,uBAAuB,gBAAAT,qBAAA,GAAvBS,uBAAuB,CAAEF,aAAa,cAAAP,qBAAA,uBAAtCA,qBAAA,CAAwCY,eAAe,MACvDL,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEK,eAAe,KAC9B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AAED,MAAMY,MAAM,GAAGrB,UAAU,CAACgC,MAAM,CAAC;EAC/BN,iBAAiB,EAAE;IACjBO,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACDb,QAAQ,EAAE;IACRc,OAAO,EAAE,CAAC;IACVC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,OAAO;IACpBC,YAAY,EAAE,CAAC;IACfnB,WAAW,EAAE;EACf,CAAC;EACDW,UAAU,EAAE;IAAES,UAAU,EAAE;EAAG;AAC/B,CAAC,CAAC;AAEF,eAAenC,QAAQ"}
1
+ {"version":3,"names":["React","Pressable","Text","StyleSheet","Image","View","colors","CHECKBOX_SIZE","CheckBox","_ref","_checkboxComponentSty","_checkboxComponentSty2","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","onChange","fillColor","backgroundColor","borderColor","styles","checkbox","createElement","onPress","style","checkboxContainer","source","require","height","width","labelStyle","create","flexDirection","flexWrap","alignItems","padding","borderWidth","borderStyle","borderRadius","marginLeft"],"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 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 style={[styles.checkbox, checkboxStyle, fillColor]}>\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 </View>\n {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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,aAAa,QAAQ,iBAAiB;AAG/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,QAAQ,GAAGC,IAAA,IAUI;EAAA,IAAAC,qBAAA,EAAAC,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,uBAAuB,uBAAvBA,uBAAuB,CAAEH,YAAY,KACrCA,YAAY,IACZT,aAAa;MACf0B,KAAK,EACH,CAAAd,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEH,YAAY,KACrCA,YAAY,IACZT;IACJ,CAAC;EACD,CACH,CACG,CAAC,EACNK,KAAK,iBACJZ,KAAA,CAAA0B,aAAA,CAACxB,IAAI;IACH0B,KAAK,EAAE,CACL,CAAAT,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAED,kBAAkB,KAAIA,kBAAkB,EACjEM,MAAM,CAACU,UAAU;EACjB,GAEDtB,KACG,CAEC,CAAC;AAEhB,CAAC;AAED,MAAMY,MAAM,GAAGrB,UAAU,CAACgC,MAAM,CAAC;EAC/BN,iBAAiB,EAAE;IACjBO,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACDb,QAAQ,EAAE;IACRc,OAAO,EAAE,CAAC;IACVC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,OAAO;IACpBC,YAAY,EAAE,CAAC;IACfnB,WAAW,EAAE;EACf,CAAC;EACDW,UAAU,EAAE;IAAES,UAAU,EAAE;EAAG;AAC/B,CAAC,CAAC;AAEF,eAAenC,QAAQ"}
@@ -26,7 +26,8 @@ const Dropdown = _ref => {
26
26
  dropdownErrorTextStyle,
27
27
  dropdownHelperTextStyle,
28
28
  primaryColor,
29
- disabled
29
+ disabled,
30
+ setIndexOfSelectedItem
30
31
  } = _ref;
31
32
  return /*#__PURE__*/React.createElement(View, {
32
33
  style: [styles.dropdownInputContainer, dropdownContainerStyle]
@@ -48,7 +49,8 @@ const Dropdown = _ref => {
48
49
  dropdownErrorStyle: dropdownErrorStyle,
49
50
  primaryColor: primaryColor,
50
51
  disabled: disabled,
51
- placeholderStyle: placeholderStyle
52
+ placeholderStyle: placeholderStyle,
53
+ setIndexOfSelectedItem: setIndexOfSelectedItem
52
54
  }), error && error !== '' && /*#__PURE__*/React.createElement(Text, {
53
55
  style: [styles.error, dropdownErrorTextStyle]
54
56
  }, error), helperText && helperText !== '' && !error && /*#__PURE__*/React.createElement(Text, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","StyleSheet","DropdownSelectedItemsView","colors","typography","Dropdown","_ref","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","labelStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","createElement","style","styles","dropdownInputContainer","helper","create","marginBottom","color","gray","caption","red","marginTop","primary","width","blackText","black"],"sources":["Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport DropdownSelectedItemsView from './DropdownSelectedItemsView';\nimport { colors } from '../../styles/colors';\nimport { typography } from '../../styles/typography';\n\nconst Dropdown = ({\n label,\n placeholder,\n helperText,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownIcon,\n labelStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <View style={[styles.dropdownInputContainer, dropdownContainerStyle]}>\n {label && label !== '' && (\n <Text style={[styles.label, labelStyle]}>{label}</Text>\n )}\n <DropdownSelectedItemsView\n placeholder={placeholder}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n handleToggleModal={handleToggleModal}\n isMultiple={isMultiple}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n primaryColor={primaryColor}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n />\n\n {error && error !== '' && (\n <Text style={[styles.error, dropdownErrorTextStyle]}>{error}</Text>\n )}\n\n {helperText && helperText !== '' && !error && (\n <Text style={[styles.helper, dropdownHelperTextStyle]}>\n {helperText}\n </Text>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n label: { marginBottom: 16, color: colors.gray, ...typography.caption },\n error: { color: colors.red, marginTop: 8, ...typography.caption },\n helper: { marginTop: 8, color: colors.primary, ...typography.caption },\n dropdownInputContainer: { marginBottom: 23, width: '100%' },\n blackText: { color: colors.black },\n});\n\nexport default Dropdown;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,MAAMC,QAAQ,GAAGC,IAAA,IAuBN;EAAA,IAvBO;IAChBC,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,YAAY;IACZC,UAAU;IACVC,aAAa;IACbC,iBAAiB;IACjBC,sBAAsB;IACtBC,iBAAiB;IACjBC,gBAAgB;IAChBC,yBAAyB;IACzBC,kBAAkB;IAClBC,sBAAsB;IACtBC,uBAAuB;IACvBC,YAAY;IACZC;EACG,CAAC,GAAAtB,IAAA;EACJ,oBACER,KAAA,CAAA+B,aAAA,CAAC9B,IAAI;IAAC+B,KAAK,EAAE,CAACC,MAAM,CAACC,sBAAsB,EAAEZ,sBAAsB;EAAE,GAClEb,KAAK,IAAIA,KAAK,KAAK,EAAE,iBAC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AAK,EAAEjC,MAAM,CAACoC,GAAG;IAAEC,SAAS,EAAE,CAAC;IAAE,GAAGpC,UAAU,CAACkC;EAAQ,CAAC;EACjEL,MAAM,EAAE;IAAEO,SAAS,EAAE,CAAC;IAAEJ,KAAK,EAAEjC,MAAM,CAACsC,OAAO;IAAE,GAAGrC,UAAU,CAACkC;EAAQ,CAAC;EACtEN,sBAAsB,EAAE;IAAEG,YAAY,EAAE,EAAE;IAAEO,KAAK,EAAE;EAAO,CAAC;EAC3DC,SAAS,EAAE;IAAEP,KAAK,EAAEjC,MAAM,CAACyC;EAAM;AACnC,CAAC,CAAC;AAEF,eAAevC,QAAQ"}
1
+ {"version":3,"names":["React","View","Text","StyleSheet","DropdownSelectedItemsView","colors","typography","Dropdown","_ref","label","placeholder","helperText","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","labelStyle","dropdownStyle","dropdownIconStyle","dropdownContainerStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","dropdownErrorTextStyle","dropdownHelperTextStyle","primaryColor","disabled","setIndexOfSelectedItem","createElement","style","styles","dropdownInputContainer","helper","create","marginBottom","color","gray","caption","red","marginTop","primary","width","blackText","black"],"sources":["Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport DropdownSelectedItemsView from './DropdownSelectedItemsView';\nimport { colors } from '../../styles/colors';\nimport { typography } from '../../styles/typography';\n\nconst Dropdown = ({\n label,\n placeholder,\n helperText,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownIcon,\n labelStyle,\n dropdownStyle,\n dropdownIconStyle,\n dropdownContainerStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n dropdownErrorTextStyle,\n dropdownHelperTextStyle,\n primaryColor,\n disabled,\n setIndexOfSelectedItem,\n}: any) => {\n return (\n <View style={[styles.dropdownInputContainer, dropdownContainerStyle]}>\n {label && label !== '' && (\n <Text style={[styles.label, labelStyle]}>{label}</Text>\n )}\n\n <DropdownSelectedItemsView\n placeholder={placeholder}\n error={error}\n getSelectedItemsLabel={getSelectedItemsLabel}\n handleToggleModal={handleToggleModal}\n isMultiple={isMultiple}\n selectedItem={selectedItem}\n selectedItems={selectedItems}\n dropdownIcon={dropdownIcon}\n dropdownStyle={dropdownStyle}\n dropdownIconStyle={dropdownIconStyle}\n selectedItemStyle={selectedItemStyle}\n multipleSelectedItemStyle={multipleSelectedItemStyle}\n dropdownErrorStyle={dropdownErrorStyle}\n primaryColor={primaryColor}\n disabled={disabled}\n placeholderStyle={placeholderStyle}\n setIndexOfSelectedItem={setIndexOfSelectedItem}\n />\n\n {error && error !== '' && (\n <Text style={[styles.error, dropdownErrorTextStyle]}>{error}</Text>\n )}\n\n {helperText && helperText !== '' && !error && (\n <Text style={[styles.helper, dropdownHelperTextStyle]}>\n {helperText}\n </Text>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n label: { marginBottom: 16, color: colors.gray, ...typography.caption },\n error: { color: colors.red, marginTop: 8, ...typography.caption },\n helper: { marginTop: 8, color: colors.primary, ...typography.caption },\n dropdownInputContainer: { marginBottom: 23, width: '100%' },\n blackText: { color: colors.black },\n});\n\nexport default Dropdown;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,MAAMC,QAAQ,GAAGC,IAAA,IAwBN;EAAA,IAxBO;IAChBC,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,KAAK;IACLC,qBAAqB;IACrBC,iBAAiB;IACjBC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,YAAY;IACZC,UAAU;IAC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IAAI,CAACC,KAAK,iBACxCZ,KAAA,CAAAgC,aAAA,CAAC9B,IAAI;IAAC+B,KAAK,EAAE,CAACC,MAAM,CAACE,MAAM,EAAER,uBAAuB;EAAE,GACnDjB,UACG,CAEJ,CAAC;AAEX,CAAC;AAED,MAAMuB,MAAM,GAAG/B,UAAU,CAACkC,MAAM,CAAC;EAC/B5B,KAAK,EAAE;IAAE6B,YAAY,EAAE,EAAE;IAAEC,KAAK,EAAElC,MAAM,CAACmC,IAAI;IAAE,GAAGlC,UAAU,CAACmC;EAAQ,CAAC;EACtE7B,KAAK,EAAE;IAAE2B,KAAK,EAAElC,MAAM,CAACqC,GAAG;IAAEC,SAAS,EAAE,CAAC;IAAE,GAAGrC,UAAU,CAACmC;EAAQ,CAAC;EACjEL,MAAM,EAAE;IAAEO,SAAS,EAAE,CAAC;IAAEJ,KAAK,EAAElC,MAAM,CAACuC,OAAO;IAAE,GAAGtC,UAAU,CAACmC;EAAQ,CAAC;EACtEN,sBAAsB,EAAE;IAAEG,YAAY,EAAE,EAAE;IAAEO,KAAK,EAAE;EAAO,CAAC;EAC3DC,SAAS,EAAE;IAAEP,KAAK,EAAElC,MAAM,CAAC0C;EAAM;AACnC,CAAC,CAAC;AAEF,eAAexC,QAAQ"}
@@ -1,6 +1,6 @@
1
1
  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); }
2
2
  /* eslint-disable react-native/no-inline-styles */
3
- import React from 'react';
3
+ import React, { useEffect, useRef } from 'react';
4
4
  import { FlatList, StyleSheet } from 'react-native';
5
5
  import DropdownListItem from './DropdownListItem';
6
6
  import { ItemSeparatorComponent, ListEmptyComponent } from '../Others';
@@ -24,8 +24,20 @@ const DropdownFlatList = _ref => {
24
24
  // kept for backwards compatibility to be removed in future release
25
25
  checkboxComponentStyles,
26
26
  listComponentStyles,
27
+ listIndex,
27
28
  ...rest
28
29
  } = _ref;
30
+ const flatlistRef = useRef(null);
31
+ const scrollToItem = index => {
32
+ var _flatlistRef$current;
33
+ (_flatlistRef$current = flatlistRef.current) === null || _flatlistRef$current === void 0 ? void 0 : _flatlistRef$current.scrollToIndex({
34
+ index,
35
+ animated: true
36
+ });
37
+ };
38
+ useEffect(() => {
39
+ scrollToItem(listIndex.itemIndex);
40
+ }, [listIndex]);
29
41
  return /*#__PURE__*/React.createElement(FlatList, _extends({
30
42
  data: options,
31
43
  extraData: isMultiple ? selectedItems : selectedItem,
@@ -45,6 +57,7 @@ const DropdownFlatList = _ref => {
45
57
  isMultiple,
46
58
  selectedOption: isMultiple ? selectedItems : selectedItem,
47
59
  onChange: isMultiple ? handleMultipleSelections : handleSingleSelection,
60
+ scrollToItem,
48
61
  primaryColor,
49
62
  checkboxSize,
50
63
  // kept for backwards compatibility
@@ -54,13 +67,22 @@ const DropdownFlatList = _ref => {
54
67
  // kept for backwards compatibility
55
68
  checkboxComponentStyles
56
69
  }),
57
- keyExtractor: (_item, index) => `Options${index}`
70
+ keyExtractor: (_item, index) => `Options${index}`,
71
+ ref: flatlistRef,
72
+ onScrollToIndexFailed: _ref2 => {
73
+ let {
74
+ index
75
+ } = _ref2;
76
+ setTimeout(() => {
77
+ scrollToItem(index);
78
+ }, 500);
79
+ }
58
80
  }, rest));
59
81
  };
60
- const _renderItem = (_ref2, props) => {
82
+ const _renderItem = (_ref3, props) => {
61
83
  let {
62
84
  item
63
- } = _ref2;
85
+ } = _ref3;
64
86
  return /*#__PURE__*/React.createElement(DropdownListItem, {
65
87
  item: item,
66
88
  optionLabel: props.optionLabel,
@@ -72,6 +94,7 @@ const _renderItem = (_ref2, props) => {
72
94
  checkboxSize: props.checkboxSize,
73
95
  checkboxStyle: props.checkboxStyle,
74
96
  checkboxLabelStyle: props.checkboxLabelStyle,
97
+ scrollToItem: props.scrollToItem,
75
98
  checkboxComponentStyles: props.checkboxComponentStyles
76
99
  });
77
100
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","FlatList","StyleSheet","DropdownListItem","ItemSeparatorComponent","ListEmptyComponent","DropdownFlatList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listComponentStyles","rest","createElement","_extends","data","extraData","initialNumToRender","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","keyExtractor","_item","index","_ref2","props","create"],"sources":["DropdownFlatList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React from 'react';\nimport { FlatList, StyleSheet } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport { ItemSeparatorComponent, ListEmptyComponent } from '../Others';\n\nconst DropdownFlatList = ({\n options,\n optionLabel,\n optionValue,\n isMultiple,\n isSearchable,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize, // kept for backwards compatibility to be removed in future release\n checkboxStyle, // kept for backwards compatibility to be removed in future release\n checkboxLabelStyle, // kept for backwards compatibility to be removed in future release\n checkboxComponentStyles,\n listComponentStyles,\n ...rest\n}: any) => {\n return (\n <FlatList\n data={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <ListEmptyComponent\n listEmptyComponentStyle={listComponentStyles?.listEmptyComponentStyle}\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 })\n }\n keyExtractor={(_item, index) => `Options${index}`}\n {...rest}\n />\n );\n};\n\nconst _renderItem = ({ item }: any, props: any) => {\n return (\n <DropdownListItem\n item={item}\n optionLabel={props.optionLabel}\n optionValue={props.optionValue}\n isMultiple={props.isMultiple}\n selectedOption={props.selectedOption}\n onChange={props.onChange}\n primaryColor={props.primaryColor}\n checkboxSize={props.checkboxSize}\n checkboxStyle={props.checkboxStyle}\n checkboxLabelStyle={props.checkboxLabelStyle}\n checkboxComponentStyles={props.checkboxComponentStyles}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownFlatList;\n"],"mappings":";AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ,WAAW;AAEtE,MAAMC,gBAAgB,GAAGC,IAAA,IAiBd;EAAA,IAjBe;IACxBC,OAAO;IACPC,WAAW;IACXC,WAAW;IACXC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,YAAY;IACZC,wBAAwB;IACxBC,qBAAqB;IACrBC,YAAY;IACZC,YAAY;IAAE;IACdC,aAAa;IAAE;IACfC,kBAAkB;IAAE;IACpBC,uBAAuB;IACvBC,mBAAmB;IACnB,GAAGC;EACA,CAAC,GAAAhB,IAAA;EACJ,oBACEP,KAAA,CAAAwB,aAAA,CAACvB,QAAQ,EAAAwB,QAAA;IACPC,IAAI,EAAElB,OAAQ;IACdmB,SAAS,EAAEhB,UAAU,GAAGE,aAAa,GAAGC,YAAa;IACrDc,kBAAkB,EAAE,CAAE;IACtBvB,kBAAkB,eAChBL,KAAA,CAAAwB,aAAA,CAACnB,kBA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yB,KAAK,CAACzB,YAAa;IACjCC,aAAa,EAAEwB,KAAK,CAACxB,aAAc;IACnCC,kBAAkB,EAAEuB,KAAK,CAACvB,kBAAmB;IAC7CC,uBAAuB,EAAEsB,KAAK,CAACtB;EAAwB,CACxD,CAAC;AAEN,CAAC;AAED,MAAMW,MAAM,GAAG9B,UAAU,CAAC0C,MAAM,CAAC;EAC/Bd,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAEF,eAAezB,gBAAgB"}
1
+ {"version":3,"names":["React","useEffect","useRef","FlatList","StyleSheet","DropdownListItem","ItemSeparatorComponent","ListEmptyComponent","DropdownFlatList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listComponentStyles","listIndex","rest","flatlistRef","scrollToItem","index","_flatlistRef$current","current","scrollToIndex","animated","itemIndex","createElement","_extends","data","extraData","initialNumToRender","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","keyExtractor","_item","ref","onScrollToIndexFailed","_ref2","setTimeout","_ref3","props","create"],"sources":["DropdownFlatList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React, { useEffect, useRef } from 'react';\nimport { FlatList, StyleSheet } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport { ItemSeparatorComponent, ListEmptyComponent } from '../Others';\nimport { TFlatList } from 'src/types/index.types';\n\nconst DropdownFlatList = ({\n options,\n optionLabel,\n optionValue,\n isMultiple,\n isSearchable,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize, // kept for backwards compatibility to be removed in future release\n checkboxStyle, // kept for backwards compatibility to be removed in future release\n checkboxLabelStyle, // kept for backwards compatibility to be removed in future release\n checkboxComponentStyles,\n listComponentStyles,\n listIndex,\n ...rest\n}: any) => {\n const flatlistRef = useRef<FlatList<TFlatList>>(null);\n\n const scrollToItem = (index: number) => {\n flatlistRef.current?.scrollToIndex({\n index,\n animated: true,\n });\n };\n\n useEffect(() => {\n scrollToItem(listIndex.itemIndex);\n }, [listIndex]);\n\n return (\n <FlatList\n data={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <ListEmptyComponent\n listEmptyComponentStyle={listComponentStyles?.listEmptyComponentStyle}\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 scrollToItem,\n primaryColor,\n checkboxSize, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n })\n }\n keyExtractor={(_item, index) => `Options${index}`}\n ref={flatlistRef}\n onScrollToIndexFailed={({ index }) => {\n setTimeout(() => {\n scrollToItem(index);\n }, 500);\n }}\n {...rest}\n />\n );\n};\n\nconst _renderItem = ({ item }: any, props: any) => {\n return (\n <DropdownListItem\n item={item}\n optionLabel={props.optionLabel}\n optionValue={props.optionValue}\n isMultiple={props.isMultiple}\n selectedOption={props.selectedOption}\n onChange={props.onChange}\n primaryColor={props.primaryColor}\n checkboxSize={props.checkboxSize}\n checkboxStyle={props.checkboxStyle}\n checkboxLabelStyle={props.checkboxLabelStyle}\n scrollToItem={props.scrollToItem}\n checkboxComponentStyles={props.checkboxComponentStyles}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownFlatList;\n"],"mappings":";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C,cAAc,EAAES,KAAK,CAACT,cAAe;IACrCC,QAAQ,EAAEQ,KAAK,CAACR,QAAS;IACzB9B,YAAY,EAAEsC,KAAK,CAACtC,YAAa;IACjCC,YAAY,EAAEqC,KAAK,CAACrC,YAAa;IACjCC,aAAa,EAAEoC,KAAK,CAACpC,aAAc;IACnCC,kBAAkB,EAAEmC,KAAK,CAACnC,kBAAmB;IAC7CM,YAAY,EAAE6B,KAAK,CAAC7B,YAAa;IACjCL,uBAAuB,EAAEkC,KAAK,CAAClC;EAAwB,CACxD,CAAC;AAEN,CAAC;AAED,MAAMoB,MAAM,GAAGvC,UAAU,CAACsD,MAAM,CAAC;EAC/BjB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAEF,eAAelC,gBAAgB"}
@@ -1,6 +1,6 @@
1
1
  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); }
2
2
  /* eslint-disable react-native/no-inline-styles */
3
- import React, { useEffect, useState } from 'react';
3
+ import React, { useEffect, useState, useRef } from 'react';
4
4
  import { SectionList, StyleSheet } from 'react-native';
5
5
  import DropdownListItem from './DropdownListItem';
6
6
  import { ItemSeparatorComponent, ListEmptyComponent, SectionHeaderTitle } from '../Others';
@@ -22,6 +22,7 @@ const DropdownSectionList = _ref => {
22
22
  checkboxLabelStyle,
23
23
  checkboxComponentStyles,
24
24
  listComponentStyles,
25
+ listIndex,
25
26
  ...rest
26
27
  } = _ref;
27
28
  const [expandedSections, setExpandedSections] = useState(new Set());
@@ -49,6 +50,23 @@ const DropdownSectionList = _ref => {
49
50
  return next;
50
51
  });
51
52
  };
53
+
54
+ /**
55
+ * @description Scroll to item location
56
+ */
57
+
58
+ const sectionlistRef = useRef(null);
59
+ const scrollToLocation = listIndex => {
60
+ var _sectionlistRef$curre;
61
+ (_sectionlistRef$curre = sectionlistRef.current) === null || _sectionlistRef$curre === void 0 ? void 0 : _sectionlistRef$curre.scrollToLocation({
62
+ sectionIndex: listIndex.sectionIndex,
63
+ animated: true,
64
+ itemIndex: listIndex.itemIndex
65
+ });
66
+ };
67
+ useEffect(() => {
68
+ scrollToLocation(listIndex);
69
+ }, [listIndex]);
52
70
  return /*#__PURE__*/React.createElement(SectionList, _extends({
53
71
  sections: options,
54
72
  extraData: isMultiple ? selectedItems : selectedItem,
@@ -93,7 +111,13 @@ const DropdownSectionList = _ref => {
93
111
  });
94
112
  },
95
113
  keyExtractor: (_item, index) => `Options${index}`,
96
- stickySectionHeadersEnabled: false
114
+ stickySectionHeadersEnabled: false,
115
+ ref: sectionlistRef,
116
+ onScrollToIndexFailed: () => {
117
+ setTimeout(() => {
118
+ scrollToLocation(listIndex);
119
+ }, 500);
120
+ }
97
121
  }, rest));
98
122
  };
99
123
  const _renderItem = (_ref3, props) => {
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useState","SectionList","StyleSheet","DropdownListItem","ItemSeparatorComponent","ListEmptyComponent","SectionHeaderTitle","extractPropertyFromArray","DropdownSectionList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listComponentStyles","rest","expandedSections","setExpandedSections","Set","initialState","handleToggleListExpansion","title","expandedSectionsState","next","has","delete","add","createElement","_extends","sections","extraData","initialNumToRender","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","renderSectionHeader","_ref2","section","data","length","sectionHeaderStyle","onPress","isExpanded","keyExtractor","_item","index","stickySectionHeadersEnabled","_ref3","props","create"],"sources":["DropdownSectionList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React, { useEffect, useState } 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';\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 listComponentStyles,\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 return (\n <SectionList\n sections={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <ListEmptyComponent\n listEmptyComponentStyle={listComponentStyles?.listEmptyComponentStyle}\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 expandedSections,\n })\n }\n renderSectionHeader={({ section: { title, data } }) =>\n data.length > 0 && (\n <SectionHeaderTitle\n title={title}\n sectionHeaderStyle={listComponentStyles?.sectionHeaderStyle}\n onPress={() => handleToggleListExpansion(title)}\n isExpanded={expandedSections.has(title)}\n />\n )\n }\n keyExtractor={(_item, index) => `Options${index}`}\n stickySectionHeadersEnabled={false}\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 />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownSectionList;\n"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,WAAW,EAAEC,UAAU,QAAQ,cAAc;AACtD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SACEC,sBAAsB,EACtBC,kBAAkB,EAClBC,kBAAkB,QACb,WAAW;AAClB,SAASC,wBAAwB,QAAQ,aAAa;AAEtD,MAAMC,mBAAmB,GAAGC,IAAA,IAiBjB;EAAA,IAjBkB;IAC3BC,OAAO;IACPC,WAAW;IACXC,WAAW;IACXC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,YAAY;IACZC,wBAAwB;IACxBC,qBAAqB;IACrBC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC,kBAAkB;IAClBC,uBAAuB;IACvBC,mBAAmB;IACnB,GAAGC;EACA,CAAC,GAAAhB,IAAA;EACJ,MAAM,CAACiB,gBAAgB,EAAEC,mBAAmB,CAAC,GAAG3B,QAAQ,CAAC,IAAI4B,GAAG,CAAC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,gBAAgB;IACf6C,IAAI,EAAEA,IAAK;IACXrC,WAAW,EAAEsD,KAAK,CAACtD,WAAY;IAC/BC,WAAW,EAAEqD,KAAK,CAACrD,WAAY;IAC/BC,UAAU,EAAEoD,KAAK,CAACpD,UAAW;IAC7BqC,cAAc,EAAEe,KAAK,CAACf,cAAe;IACrCC,QAAQ,EAAEc,KAAK,CAACd,QAAS;IACzBhC,YAAY,EAAE8C,KAAK,CAAC9C,YAAa;IACjCC,YAAY,EAAE6C,KAAK,CAAC7C,YAAa;IACjCC,aAAa,EAAE4C,KAAK,CAAC5C,aAAc;IACnCC,kBAAkB,EAAE2C,KAAK,CAAC3C,kBAAmB;IAC7CC,uBAAuB,EAAE0C,KAAK,CAAC1C;EAAwB,CACxD,CAAC;AAEN,CAAC;AAED,MAAMsB,MAAM,GAAG3C,UAAU,CAACgE,MAAM,CAAC;EAC/BvB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAEF,eAAepC,mBAAmB"}
1
+ {"version":3,"names":["React","useEffect","useState","useRef","SectionList","StyleSheet","DropdownListItem","ItemSeparatorComponent","ListEmptyComponent","SectionHeaderTitle","extractPropertyFromArray","DropdownSectionList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listComponentStyles","listIndex","rest","expandedSections","setExpandedSections","Set","initialState","handleToggleListExpansion","title","expandedSectionsState","next","has","delete","add","sectionlistRef","scrollToLocation","_sectionlistRef$curre","current","sectionIndex","animated","itemIndex","createElement","_extends","sections","extraData","initialNumToRender","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","renderSectionHeader","_ref2","section","data","length","sectionHeaderStyle","onPress","isExpanded","keyExtractor","_item","index","stickySectionHeadersEnabled","ref","onScrollToIndexFailed","setTimeout","_ref3","props","create"],"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 listComponentStyles,\n listIndex,\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 scrollToLocation(listIndex);\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 />\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 expandedSections,\n })\n }\n renderSectionHeader={({ section: { title, data } }) =>\n data.length > 0 && (\n <SectionHeaderTitle\n title={title}\n sectionHeaderStyle={listComponentStyles?.sectionHeaderStyle}\n onPress={() => handleToggleListExpansion(title)}\n isExpanded={expandedSections.has(title)}\n />\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 />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownSectionList;\n"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAC1D,SAASC,WAAW,EAAEC,UAAU,QAAQ,cAAc;AACtD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SACEC,sBA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