rn-custom-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +477 -0
- package/lib/module/assets/images/close.png +0 -0
- package/lib/module/components/CustomCheckbox/index.js +99 -0
- package/lib/module/components/CustomCheckbox/index.js.map +1 -0
- package/lib/module/components/CustomCheckbox/styles.js +213 -0
- package/lib/module/components/CustomCheckbox/styles.js.map +1 -0
- package/lib/module/components/CustomCheckbox/types.js +4 -0
- package/lib/module/components/CustomCheckbox/types.js.map +1 -0
- package/lib/module/components/closeButton/index.js +45 -0
- package/lib/module/components/closeButton/index.js.map +1 -0
- package/lib/module/components/closeButton/types.js +4 -0
- package/lib/module/components/closeButton/types.js.map +1 -0
- package/lib/module/components/customButton/index.js +176 -0
- package/lib/module/components/customButton/index.js.map +1 -0
- package/lib/module/components/customButton/styles.js +282 -0
- package/lib/module/components/customButton/styles.js.map +1 -0
- package/lib/module/components/customButton/types.js +4 -0
- package/lib/module/components/customButton/types.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownBottomSheet.js +57 -0
- package/lib/module/components/customDropDown/DropDownBottomSheet.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownList.js +51 -0
- package/lib/module/components/customDropDown/DropDownList.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownListItem.js +38 -0
- package/lib/module/components/customDropDown/DropDownListItem.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownListModal.js +63 -0
- package/lib/module/components/customDropDown/DropDownListModal.js.map +1 -0
- package/lib/module/components/customDropDown/index.js +143 -0
- package/lib/module/components/customDropDown/index.js.map +1 -0
- package/lib/module/components/customDropDown/styles.js +189 -0
- package/lib/module/components/customDropDown/styles.js.map +1 -0
- package/lib/module/components/customDropDown/types.js +4 -0
- package/lib/module/components/customDropDown/types.js.map +1 -0
- package/lib/module/components/customDropDown/utils.js +17 -0
- package/lib/module/components/customDropDown/utils.js.map +1 -0
- package/lib/module/components/customList/ListEmpty.js +33 -0
- package/lib/module/components/customList/ListEmpty.js.map +1 -0
- package/lib/module/components/customList/ListFooterLoader.js +14 -0
- package/lib/module/components/customList/ListFooterLoader.js.map +1 -0
- package/lib/module/components/customList/defaultKeyExtractor.js +9 -0
- package/lib/module/components/customList/defaultKeyExtractor.js.map +1 -0
- package/lib/module/components/customList/getFlashList.js +19 -0
- package/lib/module/components/customList/getFlashList.js.map +1 -0
- package/lib/module/components/customList/index.js +117 -0
- package/lib/module/components/customList/index.js.map +1 -0
- package/lib/module/components/customList/styles.js +45 -0
- package/lib/module/components/customList/styles.js.map +1 -0
- package/lib/module/components/customList/types.js +4 -0
- package/lib/module/components/customList/types.js.map +1 -0
- package/lib/module/components/customModal/ModalFooter.js +44 -0
- package/lib/module/components/customModal/ModalFooter.js.map +1 -0
- package/lib/module/components/customModal/index.js +132 -0
- package/lib/module/components/customModal/index.js.map +1 -0
- package/lib/module/components/customModal/styles.js +123 -0
- package/lib/module/components/customModal/styles.js.map +1 -0
- package/lib/module/components/customModal/types.js +4 -0
- package/lib/module/components/customModal/types.js.map +1 -0
- package/lib/module/components/customModal/useCustomModal.js +23 -0
- package/lib/module/components/customModal/useCustomModal.js.map +1 -0
- package/lib/module/components/customNumberPad/NumberPadKey.js +39 -0
- package/lib/module/components/customNumberPad/NumberPadKey.js.map +1 -0
- package/lib/module/components/customNumberPad/index.js +156 -0
- package/lib/module/components/customNumberPad/index.js.map +1 -0
- package/lib/module/components/customNumberPad/styles.js +131 -0
- package/lib/module/components/customNumberPad/styles.js.map +1 -0
- package/lib/module/components/customNumberPad/types.js +4 -0
- package/lib/module/components/customNumberPad/types.js.map +1 -0
- package/lib/module/components/customNumberPad/useNumberPadInput.js +44 -0
- package/lib/module/components/customNumberPad/useNumberPadInput.js.map +1 -0
- package/lib/module/components/customNumberPad/utils.js +38 -0
- package/lib/module/components/customNumberPad/utils.js.map +1 -0
- package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js +66 -0
- package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js.map +1 -0
- package/lib/module/components/customSlideTabs/TabBarItem.js +61 -0
- package/lib/module/components/customSlideTabs/TabBarItem.js.map +1 -0
- package/lib/module/components/customSlideTabs/TabScene.js +88 -0
- package/lib/module/components/customSlideTabs/TabScene.js.map +1 -0
- package/lib/module/components/customSlideTabs/index.js +277 -0
- package/lib/module/components/customSlideTabs/index.js.map +1 -0
- package/lib/module/components/customSlideTabs/styles.js +132 -0
- package/lib/module/components/customSlideTabs/styles.js.map +1 -0
- package/lib/module/components/customSlideTabs/tabBarScroll.js +65 -0
- package/lib/module/components/customSlideTabs/tabBarScroll.js.map +1 -0
- package/lib/module/components/customSlideTabs/types.js +4 -0
- package/lib/module/components/customSlideTabs/types.js.map +1 -0
- package/lib/module/components/loading/index.js +34 -0
- package/lib/module/components/loading/index.js.map +1 -0
- package/lib/module/customFunctions/array.js +61 -0
- package/lib/module/customFunctions/array.js.map +1 -0
- package/lib/module/customFunctions/async.js +62 -0
- package/lib/module/customFunctions/async.js.map +1 -0
- package/lib/module/customFunctions/date.js +109 -0
- package/lib/module/customFunctions/date.js.map +1 -0
- package/lib/module/customFunctions/general.js +29 -0
- package/lib/module/customFunctions/general.js.map +1 -0
- package/lib/module/customFunctions/id.js +20 -0
- package/lib/module/customFunctions/id.js.map +1 -0
- package/lib/module/customFunctions/index.js +29 -0
- package/lib/module/customFunctions/index.js.map +1 -0
- package/lib/module/customFunctions/number.js +94 -0
- package/lib/module/customFunctions/number.js.map +1 -0
- package/lib/module/customFunctions/object.js +39 -0
- package/lib/module/customFunctions/object.js.map +1 -0
- package/lib/module/customFunctions/string.js +63 -0
- package/lib/module/customFunctions/string.js.map +1 -0
- package/lib/module/customFunctions/types.js +2 -0
- package/lib/module/customFunctions/types.js.map +1 -0
- package/lib/module/customFunctions/validation.js +34 -0
- package/lib/module/customFunctions/validation.js.map +1 -0
- package/lib/module/customHooks/errors.js +61 -0
- package/lib/module/customHooks/errors.js.map +1 -0
- package/lib/module/customHooks/fetchJson.js +36 -0
- package/lib/module/customHooks/fetchJson.js.map +1 -0
- package/lib/module/customHooks/index.js +10 -0
- package/lib/module/customHooks/index.js.map +1 -0
- package/lib/module/customHooks/internal.js +49 -0
- package/lib/module/customHooks/internal.js.map +1 -0
- package/lib/module/customHooks/types.js +2 -0
- package/lib/module/customHooks/types.js.map +1 -0
- package/lib/module/customHooks/useApi.js +91 -0
- package/lib/module/customHooks/useApi.js.map +1 -0
- package/lib/module/customHooks/useLazyApi.js +80 -0
- package/lib/module/customHooks/useLazyApi.js.map +1 -0
- package/lib/module/customHooks/useMutation.js +69 -0
- package/lib/module/customHooks/useMutation.js.map +1 -0
- package/lib/module/customHooks/usePaginatedApi.js +127 -0
- package/lib/module/customHooks/usePaginatedApi.js.map +1 -0
- package/lib/module/customHooks/usePollingApi.js +37 -0
- package/lib/module/customHooks/usePollingApi.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/multiply.js +6 -0
- package/lib/module/multiply.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/CustomCheckbox/index.d.ts +5 -0
- package/lib/typescript/src/components/CustomCheckbox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomCheckbox/styles.d.ts +67 -0
- package/lib/typescript/src/components/CustomCheckbox/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomCheckbox/types.d.ts +28 -0
- package/lib/typescript/src/components/CustomCheckbox/types.d.ts.map +1 -0
- package/lib/typescript/src/components/closeButton/index.d.ts +4 -0
- package/lib/typescript/src/components/closeButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/closeButton/types.d.ts +8 -0
- package/lib/typescript/src/components/closeButton/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customButton/index.d.ts +5 -0
- package/lib/typescript/src/components/customButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customButton/styles.d.ts +231 -0
- package/lib/typescript/src/components/customButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customButton/types.d.ts +46 -0
- package/lib/typescript/src/components/customButton/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts +18 -0
- package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownList.d.ts +17 -0
- package/lib/typescript/src/components/customDropDown/DropDownList.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts +15 -0
- package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts +19 -0
- package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/index.d.ts +5 -0
- package/lib/typescript/src/components/customDropDown/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/styles.d.ts +190 -0
- package/lib/typescript/src/components/customDropDown/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/types.d.ts +37 -0
- package/lib/typescript/src/components/customDropDown/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/utils.d.ts +4 -0
- package/lib/typescript/src/components/customDropDown/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/ListEmpty.d.ts +10 -0
- package/lib/typescript/src/components/customList/ListEmpty.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/ListFooterLoader.d.ts +3 -0
- package/lib/typescript/src/components/customList/ListFooterLoader.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts +2 -0
- package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/getFlashList.d.ts +6 -0
- package/lib/typescript/src/components/customList/getFlashList.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/index.d.ts +11 -0
- package/lib/typescript/src/components/customList/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/styles.d.ts +42 -0
- package/lib/typescript/src/components/customList/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/types.d.ts +33 -0
- package/lib/typescript/src/components/customList/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/ModalFooter.d.ts +12 -0
- package/lib/typescript/src/components/customModal/ModalFooter.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/index.d.ts +6 -0
- package/lib/typescript/src/components/customModal/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/styles.d.ts +83 -0
- package/lib/typescript/src/components/customModal/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/types.d.ts +36 -0
- package/lib/typescript/src/components/customModal/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/useCustomModal.d.ts +8 -0
- package/lib/typescript/src/components/customModal/useCustomModal.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts +23 -0
- package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/index.d.ts +7 -0
- package/lib/typescript/src/components/customNumberPad/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/styles.d.ts +37 -0
- package/lib/typescript/src/components/customNumberPad/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/types.d.ts +47 -0
- package/lib/typescript/src/components/customNumberPad/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts +16 -0
- package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/utils.d.ts +4 -0
- package/lib/typescript/src/components/customNumberPad/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts +16 -0
- package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts +23 -0
- package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts +21 -0
- package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/index.d.ts +5 -0
- package/lib/typescript/src/components/customSlideTabs/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/styles.d.ts +130 -0
- package/lib/typescript/src/components/customSlideTabs/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts +15 -0
- package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/types.d.ts +68 -0
- package/lib/typescript/src/components/customSlideTabs/types.d.ts.map +1 -0
- package/lib/typescript/src/components/loading/index.d.ts +7 -0
- package/lib/typescript/src/components/loading/index.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/array.d.ts +7 -0
- package/lib/typescript/src/customFunctions/array.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/async.d.ts +9 -0
- package/lib/typescript/src/customFunctions/async.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/date.d.ts +18 -0
- package/lib/typescript/src/customFunctions/date.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/general.d.ts +7 -0
- package/lib/typescript/src/customFunctions/general.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/id.d.ts +4 -0
- package/lib/typescript/src/customFunctions/id.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/index.d.ts +26 -0
- package/lib/typescript/src/customFunctions/index.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/number.d.ts +15 -0
- package/lib/typescript/src/customFunctions/number.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/object.d.ts +6 -0
- package/lib/typescript/src/customFunctions/object.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/string.d.ts +20 -0
- package/lib/typescript/src/customFunctions/string.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/types.d.ts +22 -0
- package/lib/typescript/src/customFunctions/types.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/validation.d.ts +11 -0
- package/lib/typescript/src/customFunctions/validation.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/errors.d.ts +16 -0
- package/lib/typescript/src/customHooks/errors.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/fetchJson.d.ts +5 -0
- package/lib/typescript/src/customHooks/fetchJson.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/index.d.ts +9 -0
- package/lib/typescript/src/customHooks/index.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/internal.d.ts +12 -0
- package/lib/typescript/src/customHooks/internal.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/types.d.ts +49 -0
- package/lib/typescript/src/customHooks/types.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/useApi.d.ts +13 -0
- package/lib/typescript/src/customHooks/useApi.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/useLazyApi.d.ts +14 -0
- package/lib/typescript/src/customHooks/useLazyApi.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/useMutation.d.ts +15 -0
- package/lib/typescript/src/customHooks/useMutation.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/usePaginatedApi.d.ts +19 -0
- package/lib/typescript/src/customHooks/usePaginatedApi.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/usePollingApi.d.ts +13 -0
- package/lib/typescript/src/customHooks/usePollingApi.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +11 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/multiply.d.ts +2 -0
- package/lib/typescript/src/multiply.d.ts.map +1 -0
- package/package.json +181 -0
- package/src/assets/images/close.png +0 -0
- package/src/components/CustomCheckbox/index.tsx +143 -0
- package/src/components/CustomCheckbox/styles.ts +146 -0
- package/src/components/CustomCheckbox/types.ts +33 -0
- package/src/components/closeButton/index.tsx +40 -0
- package/src/components/closeButton/types.ts +13 -0
- package/src/components/customButton/index.tsx +288 -0
- package/src/components/customButton/styles.ts +247 -0
- package/src/components/customButton/types.ts +71 -0
- package/src/components/customDropDown/DropDownBottomSheet.tsx +70 -0
- package/src/components/customDropDown/DropDownList.tsx +88 -0
- package/src/components/customDropDown/DropDownListItem.tsx +74 -0
- package/src/components/customDropDown/DropDownListModal.tsx +86 -0
- package/src/components/customDropDown/index.tsx +213 -0
- package/src/components/customDropDown/styles.ts +184 -0
- package/src/components/customDropDown/types.ts +48 -0
- package/src/components/customDropDown/utils.ts +24 -0
- package/src/components/customList/ListEmpty.tsx +36 -0
- package/src/components/customList/ListFooterLoader.tsx +11 -0
- package/src/components/customList/defaultKeyExtractor.ts +7 -0
- package/src/components/customList/getFlashList.ts +26 -0
- package/src/components/customList/index.tsx +142 -0
- package/src/components/customList/styles.ts +43 -0
- package/src/components/customList/types.ts +60 -0
- package/src/components/customModal/ModalFooter.tsx +57 -0
- package/src/components/customModal/index.tsx +166 -0
- package/src/components/customModal/styles.ts +131 -0
- package/src/components/customModal/types.ts +48 -0
- package/src/components/customModal/useCustomModal.ts +25 -0
- package/src/components/customNumberPad/NumberPadKey.tsx +81 -0
- package/src/components/customNumberPad/index.tsx +204 -0
- package/src/components/customNumberPad/styles.ts +146 -0
- package/src/components/customNumberPad/types.ts +53 -0
- package/src/components/customNumberPad/useNumberPadInput.ts +56 -0
- package/src/components/customNumberPad/utils.ts +54 -0
- package/src/components/customSlideTabs/AnimatedTabIndicator.tsx +103 -0
- package/src/components/customSlideTabs/TabBarItem.tsx +118 -0
- package/src/components/customSlideTabs/TabScene.tsx +136 -0
- package/src/components/customSlideTabs/index.tsx +385 -0
- package/src/components/customSlideTabs/styles.ts +136 -0
- package/src/components/customSlideTabs/tabBarScroll.ts +92 -0
- package/src/components/customSlideTabs/types.ts +87 -0
- package/src/components/loading/index.tsx +34 -0
- package/src/customFunctions/array.ts +83 -0
- package/src/customFunctions/async.ts +85 -0
- package/src/customFunctions/date.ts +158 -0
- package/src/customFunctions/general.ts +35 -0
- package/src/customFunctions/id.ts +25 -0
- package/src/customFunctions/index.ts +91 -0
- package/src/customFunctions/number.ts +139 -0
- package/src/customFunctions/object.ts +59 -0
- package/src/customFunctions/string.ts +119 -0
- package/src/customFunctions/types.ts +25 -0
- package/src/customFunctions/validation.ts +49 -0
- package/src/customHooks/errors.ts +87 -0
- package/src/customHooks/fetchJson.ts +49 -0
- package/src/customHooks/index.ts +20 -0
- package/src/customHooks/internal.ts +67 -0
- package/src/customHooks/types.ts +71 -0
- package/src/customHooks/useApi.ts +107 -0
- package/src/customHooks/useLazyApi.ts +92 -0
- package/src/customHooks/useMutation.ts +97 -0
- package/src/customHooks/usePaginatedApi.ts +168 -0
- package/src/customHooks/usePollingApi.ts +48 -0
- package/src/index.tsx +63 -0
- package/src/multiply.tsx +3 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
const baseButton = {
|
|
5
|
+
paddingHorizontal: 20,
|
|
6
|
+
paddingVertical: 15,
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
alignSelf: 'stretch'
|
|
10
|
+
};
|
|
11
|
+
export const sizeStyles = {
|
|
12
|
+
sm: {
|
|
13
|
+
paddingHorizontal: 12,
|
|
14
|
+
paddingVertical: 8
|
|
15
|
+
},
|
|
16
|
+
md: {},
|
|
17
|
+
lg: {
|
|
18
|
+
paddingHorizontal: 24,
|
|
19
|
+
paddingVertical: 18
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export const iconOnlySizeStyles = {
|
|
23
|
+
sm: {
|
|
24
|
+
button: {
|
|
25
|
+
width: 36,
|
|
26
|
+
height: 36,
|
|
27
|
+
paddingHorizontal: 0,
|
|
28
|
+
paddingVertical: 0,
|
|
29
|
+
alignSelf: 'flex-start'
|
|
30
|
+
},
|
|
31
|
+
iconSize: 16,
|
|
32
|
+
imageSize: 18
|
|
33
|
+
},
|
|
34
|
+
md: {
|
|
35
|
+
button: {
|
|
36
|
+
width: 44,
|
|
37
|
+
height: 44,
|
|
38
|
+
paddingHorizontal: 0,
|
|
39
|
+
paddingVertical: 0,
|
|
40
|
+
alignSelf: 'flex-start'
|
|
41
|
+
},
|
|
42
|
+
iconSize: 20,
|
|
43
|
+
imageSize: 22
|
|
44
|
+
},
|
|
45
|
+
lg: {
|
|
46
|
+
button: {
|
|
47
|
+
width: 52,
|
|
48
|
+
height: 52,
|
|
49
|
+
paddingHorizontal: 0,
|
|
50
|
+
paddingVertical: 0,
|
|
51
|
+
alignSelf: 'flex-start'
|
|
52
|
+
},
|
|
53
|
+
iconSize: 24,
|
|
54
|
+
imageSize: 26
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export const variantTheme = {
|
|
58
|
+
default: {
|
|
59
|
+
button: {
|
|
60
|
+
backgroundColor: '#FFFFFF'
|
|
61
|
+
},
|
|
62
|
+
text: {
|
|
63
|
+
color: '#000000',
|
|
64
|
+
fontWeight: '600'
|
|
65
|
+
},
|
|
66
|
+
loaderColor: '#000000'
|
|
67
|
+
},
|
|
68
|
+
primary: {
|
|
69
|
+
button: {
|
|
70
|
+
backgroundColor: '#0D6EFD'
|
|
71
|
+
},
|
|
72
|
+
text: {
|
|
73
|
+
color: '#FFFFFF',
|
|
74
|
+
fontWeight: '600'
|
|
75
|
+
},
|
|
76
|
+
imageTint: '#FFFFFF',
|
|
77
|
+
loaderColor: '#FFFFFF'
|
|
78
|
+
},
|
|
79
|
+
danger: {
|
|
80
|
+
button: {
|
|
81
|
+
backgroundColor: '#DC3545'
|
|
82
|
+
},
|
|
83
|
+
text: {
|
|
84
|
+
color: '#FFFFFF',
|
|
85
|
+
fontWeight: '600'
|
|
86
|
+
},
|
|
87
|
+
imageTint: '#FFFFFF',
|
|
88
|
+
loaderColor: '#FFFFFF'
|
|
89
|
+
},
|
|
90
|
+
warning: {
|
|
91
|
+
button: {
|
|
92
|
+
backgroundColor: '#FFC107'
|
|
93
|
+
},
|
|
94
|
+
text: {
|
|
95
|
+
color: '#212529',
|
|
96
|
+
fontWeight: '600'
|
|
97
|
+
},
|
|
98
|
+
imageTint: '#212529',
|
|
99
|
+
loaderColor: '#212529'
|
|
100
|
+
},
|
|
101
|
+
info: {
|
|
102
|
+
button: {
|
|
103
|
+
backgroundColor: '#407BFF'
|
|
104
|
+
},
|
|
105
|
+
text: {
|
|
106
|
+
color: '#FFFFFF',
|
|
107
|
+
fontWeight: '600'
|
|
108
|
+
},
|
|
109
|
+
imageTint: '#FFFFFF',
|
|
110
|
+
loaderColor: '#FFFFFF'
|
|
111
|
+
},
|
|
112
|
+
success: {
|
|
113
|
+
button: {
|
|
114
|
+
backgroundColor: '#198754'
|
|
115
|
+
},
|
|
116
|
+
text: {
|
|
117
|
+
color: '#FFFFFF',
|
|
118
|
+
fontWeight: '600'
|
|
119
|
+
},
|
|
120
|
+
imageTint: '#FFFFFF',
|
|
121
|
+
loaderColor: '#FFFFFF'
|
|
122
|
+
},
|
|
123
|
+
secondary: {
|
|
124
|
+
button: {
|
|
125
|
+
backgroundColor: '#6C757D'
|
|
126
|
+
},
|
|
127
|
+
text: {
|
|
128
|
+
color: '#FFFFFF',
|
|
129
|
+
fontWeight: '600'
|
|
130
|
+
},
|
|
131
|
+
imageTint: '#FFFFFF',
|
|
132
|
+
loaderColor: '#FFFFFF'
|
|
133
|
+
},
|
|
134
|
+
light: {
|
|
135
|
+
button: {
|
|
136
|
+
backgroundColor: '#F8F9FA'
|
|
137
|
+
},
|
|
138
|
+
text: {
|
|
139
|
+
color: '#212529',
|
|
140
|
+
fontWeight: '600'
|
|
141
|
+
},
|
|
142
|
+
imageTint: '#212529',
|
|
143
|
+
loaderColor: '#212529'
|
|
144
|
+
},
|
|
145
|
+
dark: {
|
|
146
|
+
button: {
|
|
147
|
+
backgroundColor: '#212529'
|
|
148
|
+
},
|
|
149
|
+
text: {
|
|
150
|
+
color: '#FFFFFF',
|
|
151
|
+
fontWeight: '600'
|
|
152
|
+
},
|
|
153
|
+
imageTint: '#FFFFFF',
|
|
154
|
+
loaderColor: '#FFFFFF'
|
|
155
|
+
},
|
|
156
|
+
link: {
|
|
157
|
+
button: {
|
|
158
|
+
backgroundColor: 'transparent',
|
|
159
|
+
paddingHorizontal: 4,
|
|
160
|
+
paddingVertical: 4
|
|
161
|
+
},
|
|
162
|
+
text: {
|
|
163
|
+
color: '#0D6EFD',
|
|
164
|
+
fontWeight: '600',
|
|
165
|
+
textDecorationLine: 'underline'
|
|
166
|
+
},
|
|
167
|
+
loaderColor: '#0D6EFD'
|
|
168
|
+
},
|
|
169
|
+
outline: {
|
|
170
|
+
button: {
|
|
171
|
+
backgroundColor: 'transparent',
|
|
172
|
+
borderWidth: 1,
|
|
173
|
+
borderColor: '#0D6EFD'
|
|
174
|
+
},
|
|
175
|
+
text: {
|
|
176
|
+
color: '#0D6EFD',
|
|
177
|
+
fontWeight: '600'
|
|
178
|
+
},
|
|
179
|
+
imageTint: '#0D6EFD',
|
|
180
|
+
loaderColor: '#0D6EFD'
|
|
181
|
+
},
|
|
182
|
+
ghost: {
|
|
183
|
+
button: {
|
|
184
|
+
backgroundColor: 'transparent',
|
|
185
|
+
borderWidth: 1,
|
|
186
|
+
borderColor: '#DEE2E6'
|
|
187
|
+
},
|
|
188
|
+
text: {
|
|
189
|
+
color: '#212529',
|
|
190
|
+
fontWeight: '600'
|
|
191
|
+
},
|
|
192
|
+
imageTint: '#212529',
|
|
193
|
+
loaderColor: '#212529'
|
|
194
|
+
},
|
|
195
|
+
text: {
|
|
196
|
+
button: {
|
|
197
|
+
backgroundColor: 'transparent',
|
|
198
|
+
paddingHorizontal: 4,
|
|
199
|
+
paddingVertical: 4
|
|
200
|
+
},
|
|
201
|
+
text: {
|
|
202
|
+
color: '#212529',
|
|
203
|
+
fontWeight: '600'
|
|
204
|
+
},
|
|
205
|
+
imageTint: '#212529',
|
|
206
|
+
loaderColor: '#212529'
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
export const contentAlignStyles = {
|
|
210
|
+
left: {
|
|
211
|
+
container: {
|
|
212
|
+
alignSelf: 'stretch',
|
|
213
|
+
justifyContent: 'flex-start'
|
|
214
|
+
},
|
|
215
|
+
text: {
|
|
216
|
+
textAlign: 'left'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
center: {
|
|
220
|
+
container: {
|
|
221
|
+
justifyContent: 'center'
|
|
222
|
+
},
|
|
223
|
+
text: {
|
|
224
|
+
textAlign: 'center'
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
right: {
|
|
228
|
+
container: {
|
|
229
|
+
alignSelf: 'stretch',
|
|
230
|
+
justifyContent: 'flex-end'
|
|
231
|
+
},
|
|
232
|
+
text: {
|
|
233
|
+
textAlign: 'right'
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
export const styles = StyleSheet.create({
|
|
238
|
+
button: baseButton,
|
|
239
|
+
container: {
|
|
240
|
+
flexDirection: 'row',
|
|
241
|
+
alignItems: 'center',
|
|
242
|
+
justifyContent: 'center',
|
|
243
|
+
gap: 8
|
|
244
|
+
},
|
|
245
|
+
iconOnlyContainer: {
|
|
246
|
+
gap: 0
|
|
247
|
+
},
|
|
248
|
+
text: {},
|
|
249
|
+
leftImage: {
|
|
250
|
+
height: 20,
|
|
251
|
+
width: 25,
|
|
252
|
+
marginRight: 2
|
|
253
|
+
},
|
|
254
|
+
rightImage: {
|
|
255
|
+
height: 20,
|
|
256
|
+
width: 20,
|
|
257
|
+
marginLeft: 2
|
|
258
|
+
},
|
|
259
|
+
disabledButton: {
|
|
260
|
+
opacity: 0.55
|
|
261
|
+
},
|
|
262
|
+
disabledText: {
|
|
263
|
+
opacity: 0.7
|
|
264
|
+
},
|
|
265
|
+
countContainer: {
|
|
266
|
+
position: 'absolute',
|
|
267
|
+
top: -10,
|
|
268
|
+
right: -10,
|
|
269
|
+
height: 35,
|
|
270
|
+
width: 35,
|
|
271
|
+
borderRadius: 17.5,
|
|
272
|
+
backgroundColor: '#FFFFFF',
|
|
273
|
+
justifyContent: 'center',
|
|
274
|
+
alignItems: 'center',
|
|
275
|
+
zIndex: 2
|
|
276
|
+
},
|
|
277
|
+
countText: {
|
|
278
|
+
color: '#000000',
|
|
279
|
+
fontWeight: '600'
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","baseButton","paddingHorizontal","paddingVertical","alignItems","justifyContent","alignSelf","sizeStyles","sm","md","lg","iconOnlySizeStyles","button","width","height","iconSize","imageSize","variantTheme","default","backgroundColor","text","color","fontWeight","loaderColor","primary","imageTint","danger","warning","info","success","secondary","light","dark","link","textDecorationLine","outline","borderWidth","borderColor","ghost","contentAlignStyles","left","container","textAlign","center","right","styles","create","flexDirection","gap","iconOnlyContainer","leftImage","marginRight","rightImage","marginLeft","disabledButton","opacity","disabledText","countContainer","position","top","borderRadius","zIndex","countText"],"sourceRoot":"../../../../src","sources":["components/customButton/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAwC,cAAc;AAIzE,MAAMC,UAAqB,GAAG;EAC5BC,iBAAiB,EAAE,EAAE;EACrBC,eAAe,EAAE,EAAE;EACnBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,SAAS,EAAE;AACb,CAAC;AAED,OAAO,MAAMC,UAAyC,GAAG;EACvDC,EAAE,EAAE;IACFN,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDM,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE;IACFR,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB;AACF,CAAC;AAED,OAAO,MAAMQ,kBAGZ,GAAG;EACFH,EAAE,EAAE;IACFI,MAAM,EAAE;MACNC,KAA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oot":"../../../../src","sources":["components/customButton/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Modal, Pressable, Text, View } from 'react-native';
|
|
4
|
+
import DropDownList from "./DropDownList.js";
|
|
5
|
+
import { dropdownStyles } from "./styles.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const DropDownBottomSheet = ({
|
|
8
|
+
data,
|
|
9
|
+
visible,
|
|
10
|
+
title,
|
|
11
|
+
selectedText,
|
|
12
|
+
onClose,
|
|
13
|
+
onSelect,
|
|
14
|
+
maxListHeight,
|
|
15
|
+
itemImageAlign,
|
|
16
|
+
itemImageGap,
|
|
17
|
+
itemTextStyle,
|
|
18
|
+
itemImageStyle
|
|
19
|
+
}) => {
|
|
20
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
21
|
+
transparent: true,
|
|
22
|
+
visible: visible,
|
|
23
|
+
supportedOrientations: ['landscape', 'portrait'],
|
|
24
|
+
animationType: "slide",
|
|
25
|
+
onRequestClose: onClose,
|
|
26
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
27
|
+
style: dropdownStyles.bottomSheetBackdrop,
|
|
28
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
29
|
+
style: dropdownStyles.backdropDismiss,
|
|
30
|
+
onPress: onClose
|
|
31
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
32
|
+
style: dropdownStyles.bottomSheetContent,
|
|
33
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
34
|
+
style: dropdownStyles.bottomSheetHandle
|
|
35
|
+
}), !!title && /*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: dropdownStyles.bottomSheetTitle,
|
|
37
|
+
children: title
|
|
38
|
+
}), /*#__PURE__*/_jsx(DropDownList, {
|
|
39
|
+
data: data,
|
|
40
|
+
selectedText: selectedText,
|
|
41
|
+
maxHeight: maxListHeight,
|
|
42
|
+
itemImageAlign: itemImageAlign,
|
|
43
|
+
itemImageGap: itemImageGap,
|
|
44
|
+
itemTextStyle: itemTextStyle,
|
|
45
|
+
itemImageStyle: itemImageStyle,
|
|
46
|
+
containerStyle: dropdownStyles.bottomSheetList,
|
|
47
|
+
onSelect: (item, index) => {
|
|
48
|
+
onSelect(item, index);
|
|
49
|
+
onClose();
|
|
50
|
+
}
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default DropDownBottomSheet;
|
|
57
|
+
//# sourceMappingURL=DropDownBottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Modal","Pressable","Text","View","DropDownList","dropdownStyles","jsx","_jsx","jsxs","_jsxs","DropDownBottomSheet","data","visible","title","selectedText","onClose","onSelect","maxListHeight","itemImageAlign","itemImageGap","itemTextStyle","itemImageStyle","transparent","supportedOrientations","animationType","onRequestClose","children","style","bottomSheetBackdrop","backdropDismiss","onPress","bottomSheetContent","bottomSheetHandle","bottomSheetTitle","maxHeight","containerStyle","bottomSheetList","item","index"],"sourceRoot":"../../../../src","sources":["components/customDropDown/DropDownBottomSheet.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAG3D,OAAOC,YAAY,MAAM,mBAAgB;AACzC,SAASC,cAAc,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiB1C,MAAMC,mBAAmB,GAAGA,CAAC;EAC3BC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,YAAY;EACZC,OAAO;EACPC,QAAQ;EACRC,aAAa;EACbC,cAAc;EACdC,YAAY;EACZC,aAAa;EACbC;AACwB,CAAC,KAAK;EAC9B,oBACEd,IAAA,CAACP,KAAK;IACJsB,WAAW;IACXV,OAAO,EAAEA,O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
import { useMemo } from 'react';
|
|
5
|
+
import DropDownOptionRow from "./DropDownListItem.js";
|
|
6
|
+
import { dropdownStyles } from "./styles.js";
|
|
7
|
+
import { normalizeListItems } from "./utils.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const DropDownList = ({
|
|
10
|
+
data,
|
|
11
|
+
selectedText,
|
|
12
|
+
onSelect,
|
|
13
|
+
maxHeight = 220,
|
|
14
|
+
itemImageAlign = 'left',
|
|
15
|
+
itemImageGap = 10,
|
|
16
|
+
listStyle,
|
|
17
|
+
itemTextStyle,
|
|
18
|
+
itemImageStyle,
|
|
19
|
+
containerStyle
|
|
20
|
+
}) => {
|
|
21
|
+
const normalizedData = useMemo(() => normalizeListItems(data), [data]);
|
|
22
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
23
|
+
style: [dropdownStyles.list, styles.scrollView, {
|
|
24
|
+
maxHeight
|
|
25
|
+
}, listStyle, containerStyle],
|
|
26
|
+
nestedScrollEnabled: true,
|
|
27
|
+
keyboardShouldPersistTaps: "handled",
|
|
28
|
+
showsVerticalScrollIndicator: false,
|
|
29
|
+
children: normalizedData.map((item, index) => {
|
|
30
|
+
const isLast = index === normalizedData.length - 1;
|
|
31
|
+
const isSelected = selectedText === item.label || selectedText === item.value;
|
|
32
|
+
return /*#__PURE__*/_jsx(DropDownOptionRow, {
|
|
33
|
+
item: item,
|
|
34
|
+
isSelected: isSelected,
|
|
35
|
+
isLast: isLast,
|
|
36
|
+
imageAlign: itemImageAlign,
|
|
37
|
+
imageGap: itemImageGap,
|
|
38
|
+
itemTextStyle: itemTextStyle,
|
|
39
|
+
itemImageStyle: itemImageStyle,
|
|
40
|
+
onPress: () => onSelect(item.label, index)
|
|
41
|
+
}, `${item.value}-${index}`);
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export default DropDownList;
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
scrollView: {
|
|
48
|
+
flexGrow: 0
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=DropDownList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScrollView","StyleSheet","useMemo","DropDownOptionRow","dropdownStyles","normalizeListItems","jsx","_jsx","DropDownList","data","selectedText","onSelect","maxHeight","itemImageAlign","itemImageGap","listStyle","itemTextStyle","itemImageStyle","containerStyle","normalizedData","style","list","styles","scrollView","nestedScrollEnabled","keyboardShouldPersistTaps","showsVerticalScrollIndicator","children","map","item","index","isLast","length","isSelected","label","value","imageAlign","imageGap","onPress","create","flexGrow"],"sourceRoot":"../../../../src","sources":["components/customDropDown/DropDownList.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,UAAU,QAKL,cAAc;AACrB,SAASC,OAAO,QAAQ,OAAO;AAE/B,OAAOC,iBAAiB,MAAM,uBAAoB;AAClD,SAASC,cAAc,QAAQ,aAAU;AAKzC,SAASC,kBAAkB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAe7C,MAAMC,YAAY,GAAGA,CAAC;EACpBC,IAAI;EACJC,YAAY;EACZC,QAAQ;EACRC,SAAS,GAAG,GAAG;EACfC,cAAc,GAAG,MAAM;EACvBC,YAAY,GAAG,EAAE;EACjBC,SAAS;EACTC,aAAa;EACbC,cAAc;EACdC;AACiB,CAAC,KAAK;EACvB,MAAMC,cAAc,GAAGjB,OAAO,CAAC,MAAMG,kBAAkB,CAACI,IAAI,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EAEtE,oBACEF,IAAA,CAACP,UAAU;IACToB,KAAK,EAAE,CACLhB,cAAc,CAACiB,IAAI,EACnBC,MAAM,CAACC,UAAU,EACjB;MAAEX;IAAU,CAAC,EACbG,SAAS,EACTG,cAAc,CACd;IACFM,mBAAmB;IACnBC,yBAAyB,EAAC,SAAS;IACnCC,4BAA4B,EAAE,KAAM;IAAAC,QAAA,EAEnCR,cAAc,CAACS,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;MACnC,MAAMC,MAAM,GAAGD,KAAK,KAAKX,cAAc,CAACa,MAAM,GAAG,CAAC;MAClD,MAAMC,UAAU,GACdvB,YAAY,KAAKmB,IAAI,CAACK,KAAK,IAAIxB,YAAY,KAAKmB,IAAI,CAACM,KAAK;MAE5D,oBACE5B,IAAA,CAACJ,iBAAiB;QAEhB0B,IAAI,EAAEA,IAAK;QACXI,UAAU,EAAEA,UAAW;QACvBF,MAAM,EAAEA,MAAO;QACfK,UAAU,EAAEvB,cAAe;QAC3BwB,QAAQ,EAAEvB,YAAa;QACvBE,aAAa,EAAEA,aAAc;QAC7BC,cAAc,EAAEA,cAAe;QAC/BqB,OAAO,EAAEA,CAAA,KAAM3B,QAAQ,CAACkB,IAAI,CAACK,KAAK,EAAEJ,KAAK;MAAE,GARtC,GAAGD,IAAI,CAACM,KAAK,IAAIL,KAAK,EAS5B,CAAC;IAEN,CAAC;EAAC,CACQ,CAAC;AAEjB,CAAC;AAED,eAAetB,YAAY;AAE3B,MAAMc,MAAM,GAAGrB,UAAU,CAACsC,MAAM,CAAC;EAC/BhB,UAAU,EAAE;IACViB,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Image, Text, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { dropdownStyles } from "./styles.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const DropDownListItem = ({
|
|
7
|
+
item,
|
|
8
|
+
isSelected,
|
|
9
|
+
isLast,
|
|
10
|
+
imageAlign,
|
|
11
|
+
imageGap,
|
|
12
|
+
itemTextStyle,
|
|
13
|
+
itemImageStyle,
|
|
14
|
+
onPress
|
|
15
|
+
}) => {
|
|
16
|
+
const imageNode = item.image ? /*#__PURE__*/_jsx(Image, {
|
|
17
|
+
resizeMode: "contain",
|
|
18
|
+
source: item.image,
|
|
19
|
+
style: [dropdownStyles.itemImage, itemImageStyle]
|
|
20
|
+
}) : null;
|
|
21
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
22
|
+
activeOpacity: 0.6,
|
|
23
|
+
style: [dropdownStyles.listItem, isLast && dropdownStyles.listItemLast],
|
|
24
|
+
onPress: onPress,
|
|
25
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
26
|
+
style: [dropdownStyles.itemRow, imageAlign === 'right' && dropdownStyles.itemRowImageRight, {
|
|
27
|
+
gap: imageGap
|
|
28
|
+
}],
|
|
29
|
+
children: [imageAlign === 'left' && imageNode, /*#__PURE__*/_jsx(Text, {
|
|
30
|
+
style: [dropdownStyles.itemText, imageAlign === 'right' && dropdownStyles.itemTextWithRightImage, isSelected && dropdownStyles.itemTextSelected, itemTextStyle],
|
|
31
|
+
numberOfLines: 1,
|
|
32
|
+
children: item.label
|
|
33
|
+
}), imageAlign === 'right' && imageNode]
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export default DropDownListItem;
|
|
38
|
+
//# sourceMappingURL=DropDownListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","Text","TouchableOpacity","View","dropdownStyles","jsx","_jsx","jsxs","_jsxs","DropDownListItem","item","isSelected","isLast","imageAlign","imageGap","itemTextStyle","itemImageStyle","onPress","imageNode","image","resizeMode","source","style","itemImage","activeOpacity","listItem","listItemLast","children","itemRow","itemRowImageRight","gap","itemText","itemTextWithRightImage","itemTextSelected","numberOfLines","label"],"sourceRoot":"../../../../src","sources":["components/customDropDown/DropDownListItem.tsx"],"mappings":";;AAAA,SACEA,KAAK,EACLC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QAIC,cAAc;AAErB,SAASC,cAAc,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAc1C,MA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3
|
+
import { Modal, Pressable, Text, View } from 'react-native';
|
|
4
|
+
import CloseButton from "../closeButton/index.js";
|
|
5
|
+
import DropDownList from "./DropDownList.js";
|
|
6
|
+
import { dropdownStyles } from "./styles.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const DropDownListModal = ({
|
|
9
|
+
data,
|
|
10
|
+
visible,
|
|
11
|
+
title,
|
|
12
|
+
selectedText,
|
|
13
|
+
onClose,
|
|
14
|
+
onSelect,
|
|
15
|
+
maxListHeight,
|
|
16
|
+
itemImageAlign,
|
|
17
|
+
itemImageGap,
|
|
18
|
+
itemTextStyle,
|
|
19
|
+
itemImageStyle,
|
|
20
|
+
closeImage
|
|
21
|
+
}) => {
|
|
22
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
23
|
+
transparent: true,
|
|
24
|
+
visible: visible,
|
|
25
|
+
supportedOrientations: ['landscape', 'portrait'],
|
|
26
|
+
onRequestClose: onClose,
|
|
27
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
28
|
+
style: dropdownStyles.modalContainer,
|
|
29
|
+
onPress: onClose,
|
|
30
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
31
|
+
style: dropdownStyles.modalContent,
|
|
32
|
+
onPress: () => {},
|
|
33
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
34
|
+
style: dropdownStyles.modalHeader,
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: dropdownStyles.modalTitle,
|
|
37
|
+
numberOfLines: 1,
|
|
38
|
+
children: title || 'Select an option'
|
|
39
|
+
}), /*#__PURE__*/_jsx(CloseButton, {
|
|
40
|
+
closeImage: closeImage,
|
|
41
|
+
onPress: onClose,
|
|
42
|
+
containerStyle: dropdownStyles.modalCloseButton
|
|
43
|
+
})]
|
|
44
|
+
}), /*#__PURE__*/_jsx(DropDownList, {
|
|
45
|
+
data: data,
|
|
46
|
+
selectedText: selectedText,
|
|
47
|
+
maxHeight: maxListHeight,
|
|
48
|
+
itemImageAlign: itemImageAlign,
|
|
49
|
+
itemImageGap: itemImageGap,
|
|
50
|
+
itemTextStyle: itemTextStyle,
|
|
51
|
+
itemImageStyle: itemImageStyle,
|
|
52
|
+
containerStyle: dropdownStyles.modalList,
|
|
53
|
+
onSelect: (item, index) => {
|
|
54
|
+
onSelect(item, index);
|
|
55
|
+
onClose();
|
|
56
|
+
}
|
|
57
|
+
})]
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
export default DropDownListModal;
|
|
63
|
+
//# sourceMappingURL=DropDownListModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Modal","Pressable","Text","View","CloseButton","DropDownList","dropdownStyles","jsx","_jsx","jsxs","_jsxs","DropDownListModal","data","visible","title","selectedText","onClose","onSelect","maxListHeight","itemImageAlign","itemImageGap","itemTextStyle","itemImageStyle","closeImage","transparent","supportedOrientations","onRequestClose","children","style","modalContainer","onPress","modalContent","modalHeader","modalTitle","numberOfLines","containerStyle","modalCloseButton","maxHeight","modalList","item","index"],"sourceRoot":"../../../../src","sources":["components/customDropDown/DropDownListModal.tsx"],"mappings":";;AAAA,SACEA,KAAK,EACLC,SAAS,EACTC,IAAI,EACJC,IAAI,QAKC,cAAc;AAErB,OAAOC,WAAW,MAAM,yBAAgB;AACxC,OAAOC,YAAY,MAAM,mBAAgB;AACzC,SAASC,cAAc,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkB1C,MAAMC,iBAAiB,GAAGA,CAAC;EACzBC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,YAAY;EACZC,OAAO;EACPC,QAAQ;EACRC,aAAa;EACbC,cAAc;EACdC,YAAY;EACZC,aAAa;EACbC,cAAc;EACdC;AACsB,CAAC,KAAK;EAC5B,oBACEf,IAAA,CAACR,KAAK;IAC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ignoreList":[]}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
|
+
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import DropDownBottomSheet from "./DropDownBottomSheet.js";
|
|
6
|
+
import DropDownList from "./DropDownList.js";
|
|
7
|
+
import DropDownListModal from "./DropDownListModal.js";
|
|
8
|
+
import { dropdownStyles } from "./styles.js";
|
|
9
|
+
import { findSelectedOption, normalizeListItems } from "./utils.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const CustomDropDown = ({
|
|
12
|
+
mode = 'modal',
|
|
13
|
+
label = '',
|
|
14
|
+
selectedText,
|
|
15
|
+
listItems,
|
|
16
|
+
onSelect,
|
|
17
|
+
isSelected = false,
|
|
18
|
+
disabled = false,
|
|
19
|
+
placeholder = 'Select an option',
|
|
20
|
+
maxListHeight = 220,
|
|
21
|
+
itemImageAlign = 'left',
|
|
22
|
+
itemImageGap = 10,
|
|
23
|
+
toggleImageAlign,
|
|
24
|
+
itemImageStyle,
|
|
25
|
+
toggleImageStyle,
|
|
26
|
+
styleDropdown = {},
|
|
27
|
+
labelTextStyle,
|
|
28
|
+
dropdownTextStyles,
|
|
29
|
+
listStyle,
|
|
30
|
+
itemTextStyle,
|
|
31
|
+
closeImage
|
|
32
|
+
}) => {
|
|
33
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
34
|
+
const normalizedItems = useMemo(() => normalizeListItems(listItems), [listItems]);
|
|
35
|
+
const selectedOption = useMemo(() => findSelectedOption(normalizedItems, selectedText), [normalizedItems, selectedText]);
|
|
36
|
+
const displayText = selectedText || placeholder;
|
|
37
|
+
const hasSelection = isSelected || Boolean(selectedText);
|
|
38
|
+
const isOverlayOpen = isOpen && (mode === 'inline' || mode === 'anchored');
|
|
39
|
+
const resolvedToggleImageAlign = toggleImageAlign ?? itemImageAlign;
|
|
40
|
+
const rotation = isOpen ? '180deg' : '0deg';
|
|
41
|
+
const textStyle = useMemo(() => [dropdownStyles.selectedText, hasSelection && dropdownStyles.selectedTextActive, dropdownTextStyles], [hasSelection, dropdownTextStyles]);
|
|
42
|
+
const close = () => setIsOpen(false);
|
|
43
|
+
const toggle = () => {
|
|
44
|
+
if (disabled) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (mode === 'inline' || mode === 'anchored') {
|
|
48
|
+
setIsOpen(current => !current);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
setIsOpen(true);
|
|
52
|
+
};
|
|
53
|
+
const handleSelect = (item, index) => {
|
|
54
|
+
onSelect(item, index);
|
|
55
|
+
close();
|
|
56
|
+
};
|
|
57
|
+
const listContainerStyle = mode === 'anchored' ? [dropdownStyles.anchoredList, dropdownStyles.inlineList] : dropdownStyles.inlineList;
|
|
58
|
+
const listProps = {
|
|
59
|
+
data: listItems,
|
|
60
|
+
selectedText,
|
|
61
|
+
maxHeight: maxListHeight,
|
|
62
|
+
itemImageAlign,
|
|
63
|
+
itemImageGap,
|
|
64
|
+
listStyle,
|
|
65
|
+
itemTextStyle,
|
|
66
|
+
itemImageStyle,
|
|
67
|
+
onSelect: handleSelect
|
|
68
|
+
};
|
|
69
|
+
const renderToggleImage = () => {
|
|
70
|
+
if (!selectedOption?.image) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return /*#__PURE__*/_jsx(Image, {
|
|
74
|
+
resizeMode: "contain",
|
|
75
|
+
source: selectedOption.image,
|
|
76
|
+
style: [dropdownStyles.toggleImage, toggleImageStyle]
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const renderToggleLabel = () => /*#__PURE__*/_jsx(Text, {
|
|
80
|
+
style: textStyle,
|
|
81
|
+
numberOfLines: 1,
|
|
82
|
+
children: displayText
|
|
83
|
+
});
|
|
84
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
85
|
+
style: [dropdownStyles.container, isOverlayOpen && dropdownStyles.toggleWrapperOpen],
|
|
86
|
+
children: [!!label && /*#__PURE__*/_jsx(Text, {
|
|
87
|
+
style: [dropdownStyles.labelText, labelTextStyle],
|
|
88
|
+
children: label
|
|
89
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
90
|
+
style: [dropdownStyles.toggleWrapper, isOverlayOpen && dropdownStyles.toggleWrapperOpen],
|
|
91
|
+
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
92
|
+
activeOpacity: 0.5,
|
|
93
|
+
disabled: disabled,
|
|
94
|
+
style: [dropdownStyles.dropDown, disabled && dropdownStyles.dropDownDisabled, styleDropdown, isOverlayOpen && styles.toggleOpen],
|
|
95
|
+
onPress: toggle,
|
|
96
|
+
accessibilityRole: "button",
|
|
97
|
+
accessibilityState: {
|
|
98
|
+
disabled,
|
|
99
|
+
expanded: isOpen
|
|
100
|
+
},
|
|
101
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
102
|
+
style: [dropdownStyles.itemRow, {
|
|
103
|
+
flex: 1,
|
|
104
|
+
gap: itemImageGap
|
|
105
|
+
}, resolvedToggleImageAlign === 'right' && dropdownStyles.itemRowImageRight],
|
|
106
|
+
children: [resolvedToggleImageAlign === 'left' && renderToggleImage(), renderToggleLabel(), resolvedToggleImageAlign === 'right' && renderToggleImage()]
|
|
107
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
108
|
+
style: [dropdownStyles.arrow, {
|
|
109
|
+
transform: [{
|
|
110
|
+
rotate: rotation
|
|
111
|
+
}]
|
|
112
|
+
}],
|
|
113
|
+
children: "\u25BC"
|
|
114
|
+
})]
|
|
115
|
+
}), isOverlayOpen && /*#__PURE__*/_jsx(DropDownList, {
|
|
116
|
+
...listProps,
|
|
117
|
+
containerStyle: listContainerStyle
|
|
118
|
+
})]
|
|
119
|
+
}), mode === 'modal' && /*#__PURE__*/_jsx(DropDownListModal, {
|
|
120
|
+
...listProps,
|
|
121
|
+
visible: isOpen,
|
|
122
|
+
title: label || undefined,
|
|
123
|
+
closeImage: closeImage,
|
|
124
|
+
maxListHeight: maxListHeight,
|
|
125
|
+
onClose: close,
|
|
126
|
+
onSelect: handleSelect
|
|
127
|
+
}), mode === 'bottomSheet' && /*#__PURE__*/_jsx(DropDownBottomSheet, {
|
|
128
|
+
...listProps,
|
|
129
|
+
visible: isOpen,
|
|
130
|
+
title: label || undefined,
|
|
131
|
+
maxListHeight: maxListHeight,
|
|
132
|
+
onClose: close,
|
|
133
|
+
onSelect: handleSelect
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
export default CustomDropDown;
|
|
138
|
+
const styles = StyleSheet.create({
|
|
139
|
+
toggleOpen: {
|
|
140
|
+
borderColor: '#0d6efd'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=index.js.map
|