react-native-input-select 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -40
- package/lib/commonjs/components/CheckBox/{types.js → checkbox.types.js} +1 -1
- package/lib/commonjs/components/CheckBox/checkbox.types.js.map +1 -0
- package/lib/commonjs/components/CheckBox/index.js +9 -28
- package/lib/commonjs/components/CheckBox/index.js.map +1 -1
- package/lib/commonjs/components/CustomModal/index.js +11 -7
- package/lib/commonjs/components/CustomModal/index.js.map +1 -1
- package/lib/commonjs/components/Dropdown/DropdownSectionList.js +1 -1
- package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +2 -1
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Others/index.js.map +1 -1
- package/lib/commonjs/index.js +14 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/index.types.js.map +1 -1
- package/lib/commonjs/utils/index.js +5 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/CheckBox/checkbox.types.js +2 -0
- package/lib/module/components/CheckBox/checkbox.types.js.map +1 -0
- package/lib/module/components/CheckBox/index.js +9 -28
- package/lib/module/components/CheckBox/index.js.map +1 -1
- package/lib/module/components/CustomModal/index.js +11 -7
- package/lib/module/components/CustomModal/index.js.map +1 -1
- package/lib/module/components/Dropdown/DropdownSectionList.js +1 -1
- package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -1
- package/lib/module/components/Input/index.js +2 -1
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Others/index.js.map +1 -1
- package/lib/module/index.js +15 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/index.types.js.map +1 -1
- package/lib/module/utils/index.js +3 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/CheckBox/checkbox.types.d.ts +9 -0
- package/lib/typescript/components/CheckBox/index.d.ts +2 -19
- package/lib/typescript/components/CustomModal/index.d.ts +3 -1
- package/lib/typescript/components/Others/index.d.ts +3 -1
- package/lib/typescript/types/index.types.d.ts +46 -15
- package/lib/typescript/utils/index.d.ts +2 -1
- package/package.json +2 -2
- package/src/components/CheckBox/checkbox.types.ts +10 -0
- package/src/components/CheckBox/index.tsx +15 -26
- package/src/components/CustomModal/index.tsx +19 -11
- package/src/components/Dropdown/DropdownSectionList.tsx +1 -1
- package/src/components/Input/index.tsx +1 -0
- package/src/components/Others/index.tsx +5 -1
- package/src/index.tsx +16 -11
- package/src/types/index.types.ts +56 -15
- package/src/utils/index.ts +5 -1
- package/lib/commonjs/components/CheckBox/types.js.map +0 -1
- package/lib/module/components/CheckBox/types.js +0 -2
- package/lib/module/components/CheckBox/types.js.map +0 -1
- package/lib/typescript/components/CheckBox/types.d.ts +0 -18
- package/src/components/CheckBox/types.ts +0 -19
|
@@ -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","_extractPropertyFromA","_searchControls$textI","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","checkboxComponent","listHeaderComponent","listFooterComponent","listComponentStyles","modalProps","hideModal","listControls","searchControls","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","searchValue","setSearchValue","listIndex","setListIndex","itemIndex","sectionIndex","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","removeDisabledItems","items","handleSelectAll","filteredOptions","selectAllCallback","unselectAllCallback","checkSelectAll","useCallback","_removeDisabledItems","getSelectedItemsLabel","selectedLabels","forEach","element","_modifiedOptions$find","selectedItemLabel","find","onSearch","searchText","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","searchSectionList","searchFlatList","flatList","toLowerCase","search","sectionList","map","listItem","filteredData","handleToggleModal","primary","colors","gray","setIndexOfSelectedItem","selectedLabel","_item$data","dataItem","createElement","Fragment","onRequestClose","ListHeaderComponent","onChangeText","text","style","textInputStyle","textInputContainerStyle","textInputProps","hideSelectAll","View","styles","optionsContainerStyle","TouchableOpacity","onPress","unselectAllText","selectAllText","onChange","ListFooterComponent","emptyListMessage","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 { extractPropertyFromArray } 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, // kept for backwards compatibility\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 checkboxComponent,\n listHeaderComponent,\n listFooterComponent,\n listComponentStyles,\n modalProps,\n hideModal = false,\n listControls,\n searchControls,\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: -1, sectionIndex: -1 }); // for scrollToIndex in Sectionlist and Flatlist\n\n useEffect(() => {\n setNewOptions(options);\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 // check the structure of the new options array to determine if it is a section list or a\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\n /**\n * `options` is the original array, it never changes. (Do not use except you really need the original array) .\n * `newOptions` is a copy of options but can be mutated by `setNewOptions`, as a result, the value many change.\n * `modifiedOptions` should only be used for computations. It has the same structure for both `FlatList` and `SectionList`\n */\n const 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 onValueChange(selectedValues); // send value to parent\n return selectedValues;\n });\n };\n\n const removeDisabledItems = (items: TFlatList) => {\n return items?.filter((item: TFlatListItem) => !item.disabled);\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n // don't select disabled items\n const filteredOptions = removeDisabledItems(\n isSectionList\n ? extractPropertyFromArray(options, 'data').flat()\n : options\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 if (typeof listControls?.selectAllCallback === 'function' && !selectAll) {\n listControls.selectAllCallback();\n }\n\n if (typeof listControls?.unselectAllCallback === 'function' && selectAll) {\n listControls.unselectAllCallback();\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 removeDisabledItems(modifiedOptions)?.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 the options array will be mutated while searching, we have to search with the original array\n const searchResults = isSectionList\n ? searchSectionList(options as TSectionList, regexFilter)\n : searchFlatList(options 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 true;\n }\n return false;\n });\n return searchResults;\n };\n\n const searchSectionList = (\n sectionList: TSectionList,\n regexFilter: RegExp\n ) => {\n const searchResults = sectionList.map((listItem: TSectionListItem) => {\n const filteredData = 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 true;\n }\n return false;\n });\n\n return { ...listItem, data: filteredData };\n });\n\n return searchResults;\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n if (disabled){ // protecting any toggleModal invocation when Dropdown is disabled by not activating state\n return; \n }\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n setListIndex({ itemIndex: -1, sectionIndex: -1 });\n };\n\n useEffect(() => {\n if (hideModal) {\n setOpen(false);\n }\n return () => {};\n }, [hideModal]);\n\n let primary = primaryColor || colors.gray;\n\n /*===========================================\n * setIndexOfSelectedItem - For ScrollToIndex\n *==========================================*/\n const setIndexOfSelectedItem = (selectedLabel: string) => {\n isSectionList\n ? (options as TSectionListItem[] | undefined)?.map(\n (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 )\n : (options as TFlatListItem[] | undefined)?.find(\n (item: TFlatListItem, itemIndex: number) => {\n if (item[optLabel] === selectedLabel) {\n setListIndex({ itemIndex });\n }\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 modalBackgroundStyle={modalBackgroundStyle}\n modalOptionsContainerStyle={modalOptionsContainerStyle}\n onRequestClose={() => handleToggleModal()}\n modalProps={modalProps}\n >\n <ListTypeComponent\n ListHeaderComponent={\n <>\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchControls?.textInputStyle || searchInputStyle}\n primaryColor={primary}\n textInputContainerStyle={\n searchControls?.textInputContainerStyle\n }\n placeholder={\n searchControls?.textInputProps?.placeholder || 'Search'\n }\n {...searchControls?.textInputProps}\n />\n )}\n {listHeaderComponent}\n {!listControls?.hideSelectAll &&\n isMultiple &&\n modifiedOptions?.length > 1 && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={\n selectAll\n ? listControls?.unselectAllText || 'Clear all'\n : listControls?.selectAllText || 'Select all'\n }\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n checkboxComponent={checkboxComponent}\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 checkboxComponent={checkboxComponent}\n listIndex={listIndex}\n emptyListMessage={listControls?.emptyListMessage}\n />\n </CustomModal>\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n optionsContainerStyle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;MAC7BC,kBAAkB,EAAEA,kBAAmB;MACvCC,uBAAuB,EAAEA,uBAAwB;MACjDC,iBAAiB,EAAEA;IAAkB,CACtC,CACe,CACd,CAEV,CACH;IACDkH,mBAAmB,EAAEhH,mBAAoB;IACzCC,mBAAmB,EAAEA,mBAAoB;IACzC9B,OAAO,EAAEoC,UAAW;IACpBnC,WAAW,EAAEmE,QAAS;IACtBlE,WAAW,EAAEoE,QAAS;IACtBjE,UAAU,EAAEA,UAAW;IACvBC,YAAY,EAAEA,YAAa;IAC3BuC,aAAa,EAAEA,aAAc;IAC7BF,YAAY,EAAEA,YAAa;IAC3B+B,wBAAwB,EAAEA,wBAAyB;IACnDF,qBAAqB,EAAEA,qBAAsB;IAC7CnD,YAAY,EAAE8F,OAAQ;IACtB5F,YAAY,EAAEA,YAAa;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,kBAAkB,EAAEA,kBAAmB;IACvCC,uBAAuB,EAAEA,uBAAwB;IACjDC,iBAAiB,EAAEA,iBAAkB;IACrCsB,SAAS,EAAEA,SAAU;IACrB6F,gBAAgB,EAAE7G,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAE6G;EAAiB,CAClD,CACU,CACb,CAAC;AAEP,CAAC;AAACC,OAAA,CAAAvJ,cAAA,GAAAA,cAAA;AAEF,MAAM8I,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,qBAAqB,EAAE;IACrBW,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY7J,cAAc;AAAAuJ,OAAA,CAAApL,OAAA,GAAA0L,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","_extractPropertyFromA","_searchControls$textI","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","checkboxComponent","listHeaderComponent","listFooterComponent","listComponentStyles","modalProps","hideModal","listControls","searchControls","modalControls","checkboxControls","rest","newOptions","setNewOptions","useState","open","setOpen","selectAll","setSelectAll","selectedItem","setSelectedItem","selectedItems","setSelectedItems","searchValue","setSearchValue","listIndex","setListIndex","itemIndex","sectionIndex","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","removeDisabledItems","items","handleSelectAll","filteredOptions","selectAllCallback","unselectAllCallback","checkSelectAll","useCallback","_removeDisabledItems","getSelectedItemsLabel","selectedLabels","forEach","element","_modifiedOptions$find","selectedItemLabel","find","onSearch","searchText","escapeRegExp","toString","toLocaleLowerCase","trim","regexFilter","RegExp","searchResults","searchSectionList","searchFlatList","flatList","toLowerCase","search","sectionList","map","listItem","filteredData","handleToggleModal","primary","colors","gray","setIndexOfSelectedItem","selectedLabel","_item$data","dataItem","createElement","Fragment","visible","onRequestClose","ListHeaderComponent","onChangeText","text","style","textInputStyle","textInputContainerStyle","textInputProps","hideSelectAll","View","styles","optionsContainerStyle","TouchableOpacity","onPress","unselectAllText","selectAllText","onChange","ListFooterComponent","emptyListMessage","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 { escapeRegExp, extractPropertyFromArray } 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, // kept for backwards compatibility\n modalOptionsContainerStyle, // kept for backwards compatibility\n searchInputStyle, // kept for backwards compatibility\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 checkboxComponent,\n listHeaderComponent,\n listFooterComponent,\n listComponentStyles,\n modalProps, // kept for backwards compatibility\n hideModal = false,\n listControls,\n searchControls,\n modalControls,\n checkboxControls,\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: -1, sectionIndex: -1 }); // for scrollToIndex in Sectionlist and Flatlist\n\n useEffect(() => {\n setNewOptions(options);\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 // check the structure of the new options array to determine if it is a section list or a\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\n /**\n * `options` is the original array, it never changes. (Do not use except you really need the original array) .\n * `newOptions` is a copy of options but can be mutated by `setNewOptions`, as a result, the value many change.\n * `modifiedOptions` should only be used for computations. It has the same structure for both `FlatList` and `SectionList`\n */\n const 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 onValueChange(selectedValues); // send value to parent\n return selectedValues;\n });\n };\n\n const removeDisabledItems = (items: TFlatList) => {\n return items?.filter((item: TFlatListItem) => !item.disabled);\n };\n\n const handleSelectAll = () => {\n setSelectAll((prevVal) => {\n const selectedValues = [];\n\n // don't select disabled items\n const filteredOptions = removeDisabledItems(\n isSectionList\n ? extractPropertyFromArray(options, 'data').flat()\n : options\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 if (typeof listControls?.selectAllCallback === 'function' && !selectAll) {\n listControls.selectAllCallback();\n }\n\n if (typeof listControls?.unselectAllCallback === 'function' && selectAll) {\n listControls.unselectAllCallback();\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 removeDisabledItems(modifiedOptions)?.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 = escapeRegExp(value).toString().toLocaleLowerCase().trim();\n\n const regexFilter = new RegExp(searchText, 'i');\n\n // Because the options array will be mutated while searching, we have to search with the original array\n const searchResults = isSectionList\n ? searchSectionList(options as TSectionList, regexFilter)\n : searchFlatList(options 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 true;\n }\n return false;\n });\n return searchResults;\n };\n\n const searchSectionList = (\n sectionList: TSectionList,\n regexFilter: RegExp\n ) => {\n const searchResults = sectionList.map((listItem: TSectionListItem) => {\n const filteredData = 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 true;\n }\n return false;\n });\n\n return { ...listItem, data: filteredData };\n });\n\n return searchResults;\n };\n\n /*===========================================\n * Modal\n *==========================================*/\n const handleToggleModal = () => {\n if (disabled) {\n // protecting any toggleModal invocation when Dropdown is disabled by not activating state\n return;\n }\n setOpen(!open);\n setSearchValue('');\n setNewOptions(options);\n setListIndex({ itemIndex: -1, sectionIndex: -1 });\n };\n\n useEffect(() => {\n if (hideModal) {\n setOpen(false);\n }\n return () => {};\n }, [hideModal]);\n\n let primary = primaryColor || colors.gray;\n\n /*===========================================\n * setIndexOfSelectedItem - For ScrollToIndex\n *==========================================*/\n const setIndexOfSelectedItem = (selectedLabel: string) => {\n isSectionList\n ? (options as TSectionListItem[] | undefined)?.map(\n (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 )\n : (options as TFlatListItem[] | undefined)?.find(\n (item: TFlatListItem, itemIndex: number) => {\n if (item[optLabel] === selectedLabel) {\n setListIndex({ itemIndex });\n }\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 visible={open}\n modalBackgroundStyle={modalBackgroundStyle} // kept for backwards compatibility\n modalOptionsContainerStyle={modalOptionsContainerStyle} // kept for backwards compatibility\n onRequestClose={() => handleToggleModal()}\n modalControls={modalControls}\n modalProps={modalProps} // kept for backwards compatibility\n >\n <ListTypeComponent\n ListHeaderComponent={\n <>\n {isSearchable && (\n <Input\n value={searchValue}\n onChangeText={(text: string) => onSearch(text)}\n style={searchControls?.textInputStyle || searchInputStyle}\n primaryColor={primary}\n textInputContainerStyle={\n searchControls?.textInputContainerStyle\n }\n placeholder={\n searchControls?.textInputProps?.placeholder || 'Search'\n }\n {...searchControls?.textInputProps}\n />\n )}\n {listHeaderComponent}\n {!listControls?.hideSelectAll &&\n isMultiple &&\n modifiedOptions?.length > 1 && (\n <View style={styles.optionsContainerStyle}>\n <TouchableOpacity onPress={() => {}}>\n <CheckBox\n value={selectAll}\n label={\n selectAll\n ? listControls?.unselectAllText || 'Clear all'\n : listControls?.selectAllText || 'Select all'\n }\n onChange={() => handleSelectAll()}\n primaryColor={primary}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n checkboxComponentStyles={checkboxComponentStyles}\n checkboxComponent={checkboxComponent}\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 checkboxComponent={checkboxComponent}\n checkboxControls={checkboxControls}\n listIndex={listIndex}\n emptyListMessage={listControls?.emptyListMessage}\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;AAAiE,SAAAG,uBAAAS,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qB,EAAEA,qBAAsB;IAC7CrD,YAAY,EAAEiG,OAAQ;IACtB/F,YAAY,EAAEA,YAAa;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,kBAAkB,EAAEA,kBAAmB;IACvCC,uBAAuB,EAAEA,uBAAwB;IACjDC,iBAAiB,EAAEA,iBAAkB;IACrCS,gBAAgB,EAAEA,gBAAiB;IACnCe,SAAS,EAAEA,SAAU;IACrB+F,gBAAgB,EAAEjH,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEiH;EAAiB,CAClD,CACU,CACb,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA3J,cAAA,GAAAA,cAAA;AAEF,MAAMkJ,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,qBAAqB,EAAE;IACrBW,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYjK,cAAc;AAAA2J,OAAA,CAAAxL,OAAA,GAAA8L,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.types.ts"],"sourcesContent":["import type {\n ViewStyle,\n ColorValue,\n TextStyle,\n ModalProps,\n TextInputProps,\n} from 'react-native';\n\nexport type DropdownProps =
|
|
1
|
+
{"version":3,"names":[],"sources":["index.types.ts"],"sourcesContent":["import type {\n ViewStyle,\n ColorValue,\n TextStyle,\n ModalProps,\n TextInputProps,\n} from 'react-native';\n\nexport type DropdownProps = CommonDropdownProps &\n TDropdownInputProps &\n TSearchControls &\n TCheckboxControls &\n TCustomModalControls &\n TListControls;\n\nexport type CommonDropdownProps = {\n label?: string;\n options: TFlatList | TSectionList;\n optionLabel?: string;\n optionValue?: string;\n onValueChange: Function;\n selectedValue?:\n | string\n | boolean\n | number\n | string[]\n | boolean[]\n | number[]\n | null;\n};\n\nexport type TDropdownInputProps = {\n placeholder?: string;\n error?: string;\n helperText?: string;\n isMultiple?: boolean;\n isSearchable?: boolean;\n dropdownIcon?: React.ReactNode;\n labelStyle?: TextStyle;\n dropdownStyle?: ViewStyle;\n dropdownIconStyle?: ViewStyle;\n dropdownContainerStyle?: ViewStyle;\n dropdownErrorStyle?: ViewStyle;\n dropdownErrorTextStyle?: TextStyle;\n dropdownHelperTextStyle?: TextStyle;\n selectedItemStyle?: TextStyle;\n multipleSelectedItemStyle?: TextStyle;\n primaryColor?: ColorValue;\n disabled?: boolean;\n placeholderStyle?: TextStyle;\n hideModal?: boolean;\n};\n\nexport type TSearchControls = {\n /** @deprecated Use `searchControls = {{textInputStyle: ViewStyle | TextStyle }}` instead.*/\n searchInputStyle?: ViewStyle;\n searchControls?: {\n textInputStyle?: ViewStyle | TextStyle;\n textInputContainerStyle?: ViewStyle;\n textInputProps?: TextInputProps;\n };\n};\nexport type TCheckboxControls = {\n /** @deprecated Use `checkboxControls = {{checkboxSize: number }}` instead.*/\n checkboxSize?: number;\n /** @deprecated Use `checkboxControls = {{checkboxStyle: ViewStyle }}` instead.*/\n checkboxStyle?: ViewStyle;\n /** @deprecated Use `checkboxControls = {{checkboxLabelStyle: TextStyle }}` instead.*/\n checkboxLabelStyle?: TextStyle;\n /** @deprecated Use `checkboxControls` instead.*/\n checkboxComponentStyles?: {\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n };\n /** @deprecated Use `checkboxControls = {{checkboxComponent: <View></View> }}` instead.*/\n checkboxComponent?: React.ReactNode;\n checkboxControls?: {\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n checkboxComponent?: React.ReactNode;\n };\n};\n\nexport type TCustomModalControls = {\n /** @deprecated Use `modalControls = {{modalBackgroundStyle: ViewStyle}} instead.*/\n modalBackgroundStyle?: ViewStyle;\n /** @deprecated Use `modalControls = {{ modalOptionsContainerStyle: ViewStyle}} instead.*/\n modalOptionsContainerStyle?: ViewStyle;\n /** @deprecated Use `modalControls = {{modalProps: ModalProps }}` instead.*/\n modalProps?: ModalProps;\n modalControls?: {\n modalBackgroundStyle?: ViewStyle;\n modalOptionsContainerStyle?: ViewStyle;\n modalProps?: ModalProps;\n };\n};\n\nexport type TListControls = {\n listHeaderComponent?: React.ReactNode;\n listFooterComponent?: React.ReactNode;\n listComponentStyles?: {\n listEmptyComponentStyle?: TextStyle;\n itemSeparatorStyle?: ViewStyle;\n sectionHeaderStyle?: TextStyle;\n };\n listControls?: {\n selectAllText?: string;\n unselectAllText?: string;\n selectAllCallback?: () => void;\n unselectAllCallback?: () => void;\n hideSelectAll?: boolean;\n emptyListMessage?: string;\n };\n};\n\nexport type TFlatList = TFlatListItem[];\nexport type TFlatListItem = {\n [key: string]: string | number | boolean;\n};\n\nexport type TSectionList = TSectionListItem[];\nexport type TSectionListItem = { title: string; data: TFlatList };\n"],"mappings":""}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.extractPropertyFromArray = void 0;
|
|
6
|
+
exports.extractPropertyFromArray = exports.escapeRegExp = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Extract property from array
|
|
9
9
|
*/
|
|
@@ -13,4 +13,8 @@ const extractPropertyFromArray = (arr, property) => {
|
|
|
13
13
|
return extractedValue;
|
|
14
14
|
};
|
|
15
15
|
exports.extractPropertyFromArray = extractPropertyFromArray;
|
|
16
|
+
const escapeRegExp = text => {
|
|
17
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
18
|
+
};
|
|
19
|
+
exports.escapeRegExp = escapeRegExp;
|
|
16
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["extractPropertyFromArray","arr","property","extractedValue","map","item","exports"],"sources":["index.ts"],"sourcesContent":["/**\n * Extract property from array\n */\n\nexport const extractPropertyFromArray = (arr: any, property: string) => {\n let extractedValue = arr?.map((item: any) => item[property]);\n\n return extractedValue;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEO,MAAMA,wBAAwB,GAAGA,CAACC,
|
|
1
|
+
{"version":3,"names":["extractPropertyFromArray","arr","property","extractedValue","map","item","exports","escapeRegExp","text","replace"],"sources":["index.ts"],"sourcesContent":["/**\n * Extract property from array\n */\n\nexport const extractPropertyFromArray = (arr: any[], property: string) => {\n let extractedValue = arr?.map((item: any) => item[property]);\n\n return extractedValue;\n};\n\nexport const escapeRegExp = (text: string) => {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEO,MAAMA,wBAAwB,GAAGA,CAACC,GAAU,EAAEC,QAAgB,KAAK;EACxE,IAAIC,cAAc,GAAGF,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEG,GAAG,CAAEC,IAAS,IAAKA,IAAI,CAACH,QAAQ,CAAC,CAAC;EAE5D,OAAOC,cAAc;AACvB,CAAC;AAACG,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAEK,MAAMO,YAAY,GAAIC,IAAY,IAAK;EAC5C,OAAOA,IAAI,CAACC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AACpD,CAAC;AAACH,OAAA,CAAAC,YAAA,GAAAA,YAAA"}
|
|
@@ -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":""}
|
|
@@ -2,26 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Pressable, Text, StyleSheet, Image, View } from 'react-native';
|
|
3
3
|
import { colors } from '../../styles/colors';
|
|
4
4
|
import { CHECKBOX_SIZE } from '../../constants';
|
|
5
|
-
/**
|
|
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
|
-
*/
|
|
22
|
-
|
|
23
5
|
const CheckBox = _ref => {
|
|
24
|
-
var _checkboxComponentSty, _checkboxComponentSty2;
|
|
6
|
+
var _checkboxControls$che, _checkboxComponentSty, _checkboxControls$che2, _checkboxComponentSty2;
|
|
25
7
|
let {
|
|
26
8
|
label,
|
|
27
9
|
value,
|
|
@@ -32,28 +14,27 @@ const CheckBox = _ref => {
|
|
|
32
14
|
checkboxLabelStyle,
|
|
33
15
|
checkboxComponentStyles,
|
|
34
16
|
checkboxComponent,
|
|
17
|
+
checkboxControls,
|
|
35
18
|
onChange
|
|
36
19
|
} = _ref;
|
|
37
|
-
// const { checkboxSize, checkboxStyle, checkboxLabelStyle } =
|
|
38
|
-
// checkboxComponentStyles || undefined;
|
|
39
20
|
const fillColor = {
|
|
40
|
-
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',
|
|
41
|
-
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
|
|
21
|
+
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',
|
|
22
|
+
borderColor: disabled ? 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
|
|
42
23
|
};
|
|
43
24
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
44
25
|
onPress: onChange ? () => onChange(!value) : null,
|
|
45
26
|
style: [styles.checkboxContainer],
|
|
46
27
|
disabled: disabled
|
|
47
28
|
}, /*#__PURE__*/React.createElement(View, {
|
|
48
|
-
style: [styles.checkbox, (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxStyle) || checkboxStyle, fillColor]
|
|
49
|
-
}, checkboxComponent || /*#__PURE__*/React.createElement(Image, {
|
|
29
|
+
style: [styles.checkbox, (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxStyle) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxStyle) || checkboxStyle, fillColor]
|
|
30
|
+
}, (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxComponent) || checkboxComponent || /*#__PURE__*/React.createElement(Image, {
|
|
50
31
|
source: require('../../asset/check.png'),
|
|
51
32
|
style: [{
|
|
52
|
-
height: (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || CHECKBOX_SIZE,
|
|
53
|
-
width: (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || CHECKBOX_SIZE
|
|
33
|
+
height: (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxSize) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || CHECKBOX_SIZE,
|
|
34
|
+
width: (checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxSize) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxSize) || checkboxSize || CHECKBOX_SIZE
|
|
54
35
|
}]
|
|
55
36
|
})), label && label !== '' && /*#__PURE__*/React.createElement(Text, {
|
|
56
|
-
style: [(checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxLabelStyle) || checkboxLabelStyle, styles.labelStyle]
|
|
37
|
+
style: [(checkboxControls === null || checkboxControls === void 0 ? void 0 : checkboxControls.checkboxLabelStyle) || (checkboxComponentStyles === null || checkboxComponentStyles === void 0 ? void 0 : checkboxComponentStyles.checkboxLabelStyle) || checkboxLabelStyle, styles.labelStyle]
|
|
57
38
|
}, label));
|
|
58
39
|
};
|
|
59
40
|
const styles = StyleSheet.create({
|
|
@@ -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","checkboxComponent","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\
|
|
1
|
+
{"version":3,"names":["React","Pressable","Text","StyleSheet","Image","View","colors","CHECKBOX_SIZE","CheckBox","_ref","_checkboxControls$che","_checkboxComponentSty","_checkboxControls$che2","_checkboxComponentSty2","label","value","disabled","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","checkboxComponent","checkboxControls","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 './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,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,MAAMC,QAAQ,GAAGC,IAAA,IAYI;EAAA,IAAAC,qBAAA,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,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,eAAevC,QAAQ"}
|
|
@@ -4,25 +4,29 @@ import { Modal, TouchableOpacity, SafeAreaView, StyleSheet, TouchableWithoutFeed
|
|
|
4
4
|
import { colors } from '../../styles/colors';
|
|
5
5
|
const CustomModal = _ref => {
|
|
6
6
|
let {
|
|
7
|
-
|
|
7
|
+
visible,
|
|
8
8
|
onRequestClose,
|
|
9
9
|
modalBackgroundStyle,
|
|
10
|
+
//kept for backwards compatibility
|
|
10
11
|
modalOptionsContainerStyle,
|
|
12
|
+
//kept for backwards compatibility
|
|
13
|
+
modalControls,
|
|
11
14
|
modalProps,
|
|
15
|
+
//kept for backwards compatibility
|
|
12
16
|
children
|
|
13
17
|
} = _ref;
|
|
14
18
|
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
15
19
|
transparent: true,
|
|
16
|
-
visible:
|
|
17
|
-
onRequestClose: () => onRequestClose(),
|
|
20
|
+
visible: visible,
|
|
21
|
+
onRequestClose: () => onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose(),
|
|
18
22
|
animationType: "fade"
|
|
19
|
-
}, modalProps), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
20
|
-
onPress: () => onRequestClose(),
|
|
21
|
-
style: [styles.modalContainer, styles.modalBackgroundStyle, modalBackgroundStyle]
|
|
23
|
+
}, modalControls === null || modalControls === void 0 ? void 0 : modalControls.modalProps, modalProps), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
24
|
+
onPress: () => onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose(),
|
|
25
|
+
style: [styles.modalContainer, styles.modalBackgroundStyle, (modalControls === null || modalControls === void 0 ? void 0 : modalControls.modalBackgroundStyle) || modalBackgroundStyle]
|
|
22
26
|
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
23
27
|
onPress: () => {}
|
|
24
28
|
}, /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
25
|
-
style: [styles.modalOptionsContainer, modalOptionsContainerStyle]
|
|
29
|
+
style: [styles.modalOptionsContainer, (modalControls === null || modalControls === void 0 ? void 0 : modalControls.modalOptionsContainerStyle) || modalOptionsContainerStyle]
|
|
26
30
|
}, children))));
|
|
27
31
|
};
|
|
28
32
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Modal","TouchableOpacity","SafeAreaView","StyleSheet","TouchableWithoutFeedback","colors","CustomModal","_ref","
|
|
1
|
+
{"version":3,"names":["React","Modal","TouchableOpacity","SafeAreaView","StyleSheet","TouchableWithoutFeedback","colors","CustomModal","_ref","visible","onRequestClose","modalBackgroundStyle","modalOptionsContainerStyle","modalControls","modalProps","children","createElement","_extends","transparent","animationType","onPress","style","styles","modalContainer","modalOptionsContainer","create","flex","justifyContent","backgroundColor","maxHeight","white","borderTopLeftRadius","borderTopRightRadius","zIndex"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,KAAK,EACLC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,wBAAwB,QAEnB,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAG5C,MAAMC,WAAW,GAAGC,IAAA,IAQqB;EAAA,IARpB;IACnBC,OAAO;IACPC,cAAc;IACdC,oBAAoB;IAAE;IACtBC,0BAA0B;IAAE;IAC5BC,aAAa;IACbC,UAAU;IAAE;IACZC;EACiC,CAAC,GAAAP,IAAA;EAClC,oBACER,KAAA,CAAAgB,aAAA,CAACf,KAAK,EAAAgB,QAAA;IACJC,WAAW,EAAE,IAAK;IAClBT,OAAO,EAAEA,OAAQ;IACjBC,cAAc,EAAEA,CAAA,KAAMA,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAG,CAAE;IACzCS,aAAa,EAAC;EAAM,GAChBN,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEC,UAAU,EACzBA,UAAU,gBAEdd,KAAA,CAAAgB,aAAA,CAACd,gBAAgB;IACfkB,OAAO,EAAEA,CAAA,KAAMV,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAG,CAAE;IAClCW,KAAK,EAAE,CACLC,MAAM,CAACC,cAAc,EACrBD,MAAM,CAACX,oBAAoB,EAC3B,CAAAE,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEF,oBAAoB,KAAIA,oBAAoB;EAC3D,gBAGFX,KAAA,CAAAgB,aAAA,CAACX,wBAAwB;IAACe,OAAO,EAAEA,CAAA,KAAM,CAAC;EAAE,gBAC1CpB,KAAA,CAAAgB,aAAA,CAACb,YAAY;IACXkB,KAAK,EAAE,CACLC,MAAM,CAACE,qBAAqB,EAC5B,CAAAX,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAED,0BAA0B,KACvCA,0BAA0B;EAC5B,GAEDG,QACW,CACU,CACV,CACb,CAAC;AAEZ,CAAC;AAED,MAAMO,MAAM,GAAGlB,UAAU,CAACqB,MAAM,CAAC;EAC/BF,cAAc,EAAE;IACdG,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDhB,oBAAoB,EAAE;IAAEiB,eAAe,EAAE;EAAqB,CAAC;EAC/DJ,qBAAqB,EAAE;IACrBK,SAAS,EAAE,KAAK;IAChBD,eAAe,EAAEtB,MAAM,CAACwB,KAAK;IAC7BC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAe1B,WAAW"}
|
|
@@ -60,7 +60,7 @@ const DropdownSectionList = _ref => {
|
|
|
60
60
|
const sectionlistRef = useRef(null);
|
|
61
61
|
const scrollToLocation = listIndex => {
|
|
62
62
|
var _sectionlistRef$curre;
|
|
63
|
-
(_sectionlistRef$curre = sectionlistRef.current) === null || _sectionlistRef$curre === void 0 ? void 0 : _sectionlistRef$curre.scrollToLocation({
|
|
63
|
+
sectionlistRef === null || sectionlistRef === void 0 || (_sectionlistRef$curre = sectionlistRef.current) === null || _sectionlistRef$curre === void 0 ? void 0 : _sectionlistRef$curre.scrollToLocation({
|
|
64
64
|
sectionIndex: listIndex.sectionIndex,
|
|
65
65
|
animated: true,
|
|
66
66
|
itemIndex: listIndex.itemIndex
|
|
@@ -1 +1 @@
|
|
|
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","checkboxComponent","listComponentStyles","listIndex","emptyListMessage","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","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 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":";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,sBAAsB,EACtBC,kBAAkB,EAClBC,kBAAkB,QACb,WAAW;AAClB,SAASC,wBAAwB,QAAQ,aAAa;AAGtD,MAAMC,mBAAmB,GAAGC,IAAA,IAoBjB;EAAA,IApBkB;IAC3BC,OAAO;IACPC,WAAW;IACXC,WAAW;IACXC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,YAAY;I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CC,QAAQ,EAAEe,KAAK,CAACf,QAAS;IACzB1C,YAAY,EAAEyD,KAAK,CAACzD,YAAa;IACjCC,YAAY,EAAEwD,KAAK,CAACxD,YAAa;IACjCC,aAAa,EAAEuD,KAAK,CAACvD,aAAc;IACnCC,kBAAkB,EAAEsD,KAAK,CAACtD,kBAAmB;IAC7CC,uBAAuB,EAAEqD,KAAK,CAACrD,uBAAwB;IACvDC,iBAAiB,EAAEoD,KAAK,CAACpD;EAAkB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAM+B,MAAM,GAAGrD,UAAU,CAAC2E,MAAM,CAAC;EAC/BxB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAEF,eAAe9C,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","checkboxComponent","listComponentStyles","listIndex","emptyListMessage","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","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 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":";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,sBAAsB,EACtBC,kBAAkB,EAClBC,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AAA,CAAC5C,gBAAgB;IACfuD,IAAI,EAAEA,IAAK;IACX/C,WAAW,EAAEiE,KAAK,CAACjE,WAAY;IAC/BC,WAAW,EAAEgE,KAAK,CAAChE,WAAY;IAC/BC,UAAU,EAAE+D,KAAK,CAAC/D,UAAW;IAC7B+C,cAAc,EAAEgB,KAAK,CAAChB,cAAe;IACrCC,QAAQ,EAAEe,KAAK,CAACf,QAAS;IACzB1C,YAAY,EAAEyD,KAAK,CAACzD,YAAa;IACjCC,YAAY,EAAEwD,KAAK,CAACxD,YAAa;IACjCC,aAAa,EAAEuD,KAAK,CAACvD,aAAc;IACnCC,kBAAkB,EAAEsD,KAAK,CAACtD,kBAAmB;IAC7CC,uBAAuB,EAAEqD,KAAK,CAACrD,uBAAwB;IACvDC,iBAAiB,EAAEoD,KAAK,CAACpD;EAAkB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAM+B,MAAM,GAAGrD,UAAU,CAAC2E,MAAM,CAAC;EAC/BxB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAEF,eAAe9C,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","TextInput","StyleSheet","View","Platform","inputStyles","Input","_ref","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","rest","isFocused","setFocus","createElement","styles","container","_extends","input","select","web","outlineColor","borderColor","onFocus","onBlur","create","margin"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n textInputContainerStyle,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACpE,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,KAAK,GAAGC,IAAA,IAQV;EAAA,IARW;IACpBC,WAAW;IACXC,KAAK;IACLC,YAAY;IACZC,KAAK;IACLC,YAAY;IACZC,uBAAuB;IACvB,GAAGC;EACA,CAAC,GAAAP,IAAA;EACJ,MAAM,CAACQ,SAAS,EAAEC,QAAQ,CAAC,GAAGhB,QAAQ,CAAC,KAAK,CAAC;EAE7C,oBACED,KAAA,CAAAkB,aAAA,CAACd,IAAI;IAACQ,KAAK,EAAE,CAACO,MAAM,CAACC,SAAS,EAAEN,uBAAuB;EAAE,gBACvDd,KAAA,CAAAkB,aAAA,CAAChB,SAAS,EAAAmB,QAAA;IACRZ,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAE,CACLN,WAAW,CAACgB,KAAK,EACjBjB,QAAQ,CAACkB,MAAM,CAAC;MACdC,GAAG,EAAE;QACHC,YAAY,EAAEZ;MAChB;IACF,CAAC,CAAC,EACFG,SAAS,IAAI;MAAEU,WAAW,EAAEb;IAAa,CAAC,EAC1CD,KAAK,CACL;IACFe,OAAO,EAAEA,CAAA,KAAM;MACbV,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAE;IACFW,MAAM,EAAEA,CAAA,KAAMX,QAAQ,CAAC,KAAK,CAAE;IAC9BP,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA;
|
|
1
|
+
{"version":3,"names":["React","useState","TextInput","StyleSheet","View","Platform","inputStyles","Input","_ref","placeholder","value","onChangeText","style","primaryColor","textInputContainerStyle","rest","isFocused","setFocus","createElement","styles","container","_extends","input","select","web","outlineColor","borderColor","onFocus","onBlur","returnKeyType","create","margin"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n textInputContainerStyle,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={[styles.container, textInputContainerStyle]}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n returnKeyType=\"search\"\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACpE,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,KAAK,GAAGC,IAAA,IAQV;EAAA,IARW;IACpBC,WAAW;IACXC,KAAK;IACLC,YAAY;IACZC,KAAK;IACLC,YAAY;IACZC,uBAAuB;IACvB,GAAGC;EACA,CAAC,GAAAP,IAAA;EACJ,MAAM,CAACQ,SAAS,EAAEC,QAAQ,CAAC,GAAGhB,QAAQ,CAAC,KAAK,CAAC;EAE7C,oBACED,KAAA,CAAAkB,aAAA,CAACd,IAAI;IAACQ,KAAK,EAAE,CAACO,MAAM,CAACC,SAAS,EAAEN,uBAAuB;EAAE,gBACvDd,KAAA,CAAAkB,aAAA,CAAChB,SAAS,EAAAmB,QAAA;IACRZ,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAE,CACLN,WAAW,CAACgB,KAAK,EACjBjB,QAAQ,CAACkB,MAAM,CAAC;MACdC,GAAG,EAAE;QACHC,YAAY,EAAEZ;MAChB;IACF,CAAC,CAAC,EACFG,SAAS,IAAI;MAAEU,WAAW,EAAEb;IAAa,CAAC,EAC1CD,KAAK,CACL;IACFe,OAAO,EAAEA,CAAA,KAAM;MACbV,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAE;IACFW,MAAM,EAAEA,CAAA,KAAMX,QAAQ,CAAC,KAAK,CAAE;IAC9BP,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BkB,aAAa,EAAC;EAAQ,GAClBd,IAAI,CACT,CACG,CAAC;AAEX,CAAC;AAED,MAAMI,MAAM,GAAGhB,UAAU,CAAC2B,MAAM,CAAC;EAC/BV,SAAS,EAAE;IAAEW,MAAM,EAAE;EAAG;AAC1B,CAAC,CAAC;AAEF,eAAexB,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","StyleSheet","TouchableOpacity","Image","colors","ListEmptyComponent","_ref","listEmptyComponentStyle","emptyListMessage","createElement","style","styles","ItemSeparatorComponent","_ref2","itemSeparatorStyle","ListItemContainer","_ref3","children","listItemContainerStyle","SectionHeaderTitle","_ref4","title","sectionHeaderStyle","onPress","isExpanded","accordionStyle","rotatedIcon90","source","require","create","alignItems","width","marginVertical","backgroundColor","gray","height","opacity","paddingHorizontal","paddingVertical","flexDirection","fontWeight","flexWrap","justifyContent","alignContent","transform","rotate"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport {\n View,\n Text,\n StyleSheet,\n TouchableOpacity,\n TextStyle,\n Image,\n ViewStyle,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nexport const ListEmptyComponent = ({\n listEmptyComponentStyle,\n emptyListMessage,\n}: any) => {\n return (\n <View style={styles.listEmptyComponentStyle}>\n <Text style={listEmptyComponentStyle}>\n {emptyListMessage || 'No options available'}\n </Text>\n </View>\n );\n};\n\nexport const ItemSeparatorComponent = ({ itemSeparatorStyle }
|
|
1
|
+
{"version":3,"names":["React","View","Text","StyleSheet","TouchableOpacity","Image","colors","ListEmptyComponent","_ref","listEmptyComponentStyle","emptyListMessage","createElement","style","styles","ItemSeparatorComponent","_ref2","itemSeparatorStyle","ListItemContainer","_ref3","children","listItemContainerStyle","SectionHeaderTitle","_ref4","title","sectionHeaderStyle","onPress","isExpanded","accordionStyle","rotatedIcon90","source","require","create","alignItems","width","marginVertical","backgroundColor","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,OAAOA,KAAK,MAAqB,OAAO;AACxC,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAEhBC,KAAK,QAEA,cAAc;AACrB,SAASC,MAAM,QAAQ,qBAAqB;AAE5C,OAAO,MAAMC,kBAAkB,GAAGC,IAAA,IAGvB;EAAA,IAHwB;IACjCC,uBAAuB;IACvBC;EACG,CAAC,GAAAF,IAAA;EACJ,oBACER,KAAA,CAAAW,aAAA,CAACV,IAAI;IAACW,KAAK,EAAEC,MAAM,CAACJ;EAAwB,gBAC1CT,KAAA,CAAAW,aAAA,CAACT,IAAI;IAACU,KAAK,EAAEH;EAAwB,GAClCC,gBAAgB,IAAI,sBACjB,CACF,CAAC;AAEX,CAAC;AAED,OAAO,MAAMI,sBAAsB,GAAGC,KAAA,IAIhC;EAAA,IAJiC;IACrCC;EAGF,CAAC,GAAAD,KAAA;EACC,oBAAOf,KAAA,CAAAW,aAAA,CAACV,IAAI;IAACW,KAAK,EAAE,CAACC,MAAM,CAACG,kBAAkB,EAAEA,kBAAkB;EAAE,CAAE,CAAC;AACzE,CAAC;AAED,OA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E,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBT,UAAU,EAAE;EACd,CAAC;EACDR,kBAAkB,EAAE;IAAEkB,UAAU,EAAE;EAAM,CAAC;EACzCf,cAAc,EAAE;IACdc,aAAa,EAAE,KAAK;IACpBE,QAAQ,EAAE,QAAQ;IAClBC,cAAc,EAAE,eAAe;IAC/BC,YAAY,EAAE;EAChB,CAAC;EACDjB,aAAa,EAAE;IACbkB,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC;AACF,CAAC,CAAC"}
|
package/lib/module/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import DropdownSectionList from './components/Dropdown/DropdownSectionList';
|
|
|
9
9
|
import CustomModal from './components/CustomModal';
|
|
10
10
|
import { colors } from './styles/colors';
|
|
11
11
|
import { DEFAULT_OPTION_LABEL, DEFAULT_OPTION_VALUE } from './constants';
|
|
12
|
-
import { extractPropertyFromArray } from './utils';
|
|
12
|
+
import { escapeRegExp, extractPropertyFromArray } from './utils';
|
|
13
13
|
export const DropdownSelect = _ref => {
|
|
14
14
|
var _extractPropertyFromA, _searchControls$textI;
|
|
15
15
|
let {
|
|
@@ -36,7 +36,9 @@ export const DropdownSelect = _ref => {
|
|
|
36
36
|
selectedItemStyle,
|
|
37
37
|
multipleSelectedItemStyle,
|
|
38
38
|
modalBackgroundStyle,
|
|
39
|
+
// kept for backwards compatibility
|
|
39
40
|
modalOptionsContainerStyle,
|
|
41
|
+
// kept for backwards compatibility
|
|
40
42
|
searchInputStyle,
|
|
41
43
|
// kept for backwards compatibility
|
|
42
44
|
primaryColor,
|
|
@@ -53,9 +55,12 @@ export const DropdownSelect = _ref => {
|
|
|
53
55
|
listFooterComponent,
|
|
54
56
|
listComponentStyles,
|
|
55
57
|
modalProps,
|
|
58
|
+
// kept for backwards compatibility
|
|
56
59
|
hideModal = false,
|
|
57
60
|
listControls,
|
|
58
61
|
searchControls,
|
|
62
|
+
modalControls,
|
|
63
|
+
checkboxControls,
|
|
59
64
|
...rest
|
|
60
65
|
} = _ref;
|
|
61
66
|
const [newOptions, setNewOptions] = useState([]);
|
|
@@ -192,7 +197,7 @@ export const DropdownSelect = _ref => {
|
|
|
192
197
|
*==========================================*/
|
|
193
198
|
const onSearch = value => {
|
|
194
199
|
setSearchValue(value);
|
|
195
|
-
let searchText = value.toString().toLocaleLowerCase().trim();
|
|
200
|
+
let searchText = escapeRegExp(value).toString().toLocaleLowerCase().trim();
|
|
196
201
|
const regexFilter = new RegExp(searchText, 'i');
|
|
197
202
|
|
|
198
203
|
// Because the options array will be mutated while searching, we have to search with the original array
|
|
@@ -295,11 +300,14 @@ export const DropdownSelect = _ref => {
|
|
|
295
300
|
placeholderStyle: placeholderStyle,
|
|
296
301
|
setIndexOfSelectedItem: setIndexOfSelectedItem
|
|
297
302
|
}, rest)), /*#__PURE__*/React.createElement(CustomModal, {
|
|
298
|
-
|
|
299
|
-
modalBackgroundStyle: modalBackgroundStyle
|
|
300
|
-
|
|
303
|
+
visible: open,
|
|
304
|
+
modalBackgroundStyle: modalBackgroundStyle // kept for backwards compatibility
|
|
305
|
+
,
|
|
306
|
+
modalOptionsContainerStyle: modalOptionsContainerStyle // kept for backwards compatibility
|
|
307
|
+
,
|
|
301
308
|
onRequestClose: () => handleToggleModal(),
|
|
302
|
-
|
|
309
|
+
modalControls: modalControls,
|
|
310
|
+
modalProps: modalProps // kept for backwards compatibility
|
|
303
311
|
}, /*#__PURE__*/React.createElement(ListTypeComponent, {
|
|
304
312
|
ListHeaderComponent: /*#__PURE__*/React.createElement(React.Fragment, null, isSearchable && /*#__PURE__*/React.createElement(Input, _extends({
|
|
305
313
|
value: searchValue,
|
|
@@ -340,6 +348,7 @@ export const DropdownSelect = _ref => {
|
|
|
340
348
|
checkboxLabelStyle: checkboxLabelStyle,
|
|
341
349
|
checkboxComponentStyles: checkboxComponentStyles,
|
|
342
350
|
checkboxComponent: checkboxComponent,
|
|
351
|
+
checkboxControls: checkboxControls,
|
|
343
352
|
listIndex: listIndex,
|
|
344
353
|
emptyListMessage: listControls === null || listControls === void 0 ? void 0 : listControls.emptyListMessage
|
|
345
354
|
})));
|