@codeleap/mobile 1.9.33 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionIcon/index.d.ts +13 -0
- package/dist/components/ActionIcon/index.js +54 -0
- package/dist/components/ActionIcon/index.js.map +1 -0
- package/dist/components/ActionIcon/styles.d.ts +64 -0
- package/dist/components/ActionIcon/styles.js +57 -0
- package/dist/components/ActionIcon/styles.js.map +1 -0
- package/dist/components/{ActivityIndicator.d.ts → ActivityIndicator/index.d.ts} +4 -2
- package/dist/components/{ActivityIndicator.js → ActivityIndicator/index.js} +5 -1
- package/dist/components/ActivityIndicator/index.js.map +1 -0
- package/dist/components/ActivityIndicator/styles.d.ts +59 -0
- package/dist/components/ActivityIndicator/styles.js +52 -0
- package/dist/components/ActivityIndicator/styles.js.map +1 -0
- package/dist/components/AutoComplete/index.d.ts +33 -0
- package/dist/components/AutoComplete/index.js +129 -0
- package/dist/components/AutoComplete/index.js.map +1 -0
- package/dist/components/AutoComplete/styles.d.ts +57 -0
- package/dist/components/AutoComplete/styles.js +28 -0
- package/dist/components/AutoComplete/styles.js.map +1 -0
- package/dist/components/Backdrop/index.d.ts +14 -0
- package/dist/components/{Backdrop.js → Backdrop/index.js} +21 -30
- package/dist/components/Backdrop/index.js.map +1 -0
- package/dist/components/{Backdrop.d.ts → Backdrop/styles.d.ts} +7 -20
- package/dist/components/Backdrop/styles.js +28 -0
- package/dist/components/Backdrop/styles.js.map +1 -0
- package/dist/components/Button/index.d.ts +247 -0
- package/dist/components/{Button.js → Button/index.js} +45 -13
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Button/styles.d.ts +65 -0
- package/dist/components/Button/styles.js +61 -0
- package/dist/components/Button/styles.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +15 -0
- package/dist/components/Calendar/index.js +80 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Calendar/style.d.ts +4 -0
- package/dist/components/Calendar/style.js +36 -0
- package/dist/components/Calendar/style.js.map +1 -0
- package/dist/components/Calendar/types.d.ts +95 -0
- package/dist/components/Calendar/types.js +3 -0
- package/dist/components/Calendar/types.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/Checkbox/index.js +5 -3
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +53 -53
- package/dist/components/Checkbox/styles.js +6 -2
- package/dist/components/Checkbox/styles.js.map +1 -1
- package/dist/components/{ContentView.d.ts → ContentView/index.d.ts} +5 -3
- package/dist/components/{ContentView.js → ContentView/index.js} +19 -4
- package/dist/components/ContentView/index.js.map +1 -0
- package/dist/components/ContentView/styles.d.ts +53 -0
- package/dist/components/ContentView/styles.js +26 -0
- package/dist/components/ContentView/styles.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +7 -0
- package/dist/components/{View.js → Drawer/index.js} +18 -15
- package/dist/components/Drawer/index.js.map +1 -0
- package/dist/components/{NewModal → Drawer}/styles.d.ts +55 -56
- package/dist/components/Drawer/styles.js +37 -0
- package/dist/components/Drawer/styles.js.map +1 -0
- package/dist/components/{EmptyPlaceholder.d.ts → EmptyPlaceholder/index.d.ts} +4 -2
- package/dist/components/{EmptyPlaceholder.js → EmptyPlaceholder/index.js} +9 -5
- package/dist/components/EmptyPlaceholder/index.js.map +1 -0
- package/dist/components/EmptyPlaceholder/styles.d.ts +55 -0
- package/dist/components/EmptyPlaceholder/styles.js +32 -0
- package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
- package/dist/components/{FileInput.d.ts → FileInput/index.d.ts} +8 -6
- package/dist/components/{FileInput.js → FileInput/index.js} +13 -30
- package/dist/components/FileInput/index.js.map +1 -0
- package/dist/components/FileInput/styles.d.ts +53 -0
- package/dist/components/FileInput/styles.js +19 -0
- package/dist/components/FileInput/styles.js.map +1 -0
- package/dist/components/Grid/index.d.ts +30 -0
- package/dist/components/Grid/index.js +69 -0
- package/dist/components/Grid/index.js.map +1 -0
- package/dist/components/Grid/styles.d.ts +5 -0
- package/dist/components/Grid/styles.js +19 -0
- package/dist/components/Grid/styles.js.map +1 -0
- package/dist/components/{Icon.d.ts → Icon/index.d.ts} +3 -1
- package/dist/components/{Icon.js → Icon/index.js} +6 -2
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/{NewPager → Icon}/styles.d.ts +59 -86
- package/dist/components/Icon/styles.js +45 -0
- package/dist/components/Icon/styles.js.map +1 -0
- package/dist/components/{Image.d.ts → Image/index.d.ts} +6 -4
- package/dist/components/{Image.js → Image/index.js} +38 -7
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Image/styles.d.ts +54 -0
- package/dist/components/Image/styles.js +25 -0
- package/dist/components/Image/styles.js.map +1 -0
- package/dist/components/ImageView/Spotlight.d.ts +25 -0
- package/dist/components/ImageView/Spotlight.js +155 -0
- package/dist/components/ImageView/Spotlight.js.map +1 -0
- package/dist/components/ImageView/component.d.ts +5 -0
- package/dist/components/ImageView/component.js +54 -0
- package/dist/components/ImageView/component.js.map +1 -0
- package/dist/components/ImageView/index.d.ts +2 -0
- package/dist/components/ImageView/index.js +19 -0
- package/dist/components/ImageView/index.js.map +1 -0
- package/dist/components/List/PaginationIndicator.d.ts +67 -0
- package/dist/components/List/PaginationIndicator.js +51 -0
- package/dist/components/List/PaginationIndicator.js.map +1 -0
- package/dist/components/{List.d.ts → List/index.d.ts} +12 -15
- package/dist/components/List/index.js +68 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/List/styles.d.ts +5 -0
- package/dist/components/List/styles.js +24 -0
- package/dist/components/List/styles.js.map +1 -0
- package/dist/components/Modal/index.d.ts +13 -3
- package/dist/components/Modal/index.js +23 -8
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +55 -55
- package/dist/components/Modal/styles.js +4 -3
- package/dist/components/Modal/styles.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +6 -0
- package/dist/components/MultiSelect/index.js +106 -0
- package/dist/components/MultiSelect/index.js.map +1 -0
- package/dist/components/MultiSelect/styles.d.ts +58 -0
- package/dist/components/MultiSelect/styles.js +22 -0
- package/dist/components/MultiSelect/styles.js.map +1 -0
- package/dist/components/MultiSelect/types.d.ts +32 -0
- package/dist/components/MultiSelect/types.js +3 -0
- package/dist/components/MultiSelect/types.js.map +1 -0
- package/dist/components/Navigation/Navigation.js +1 -5
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/utils.js +0 -1
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/Pager/index.d.ts +18 -12
- package/dist/components/Pager/index.js +54 -134
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.d.ts +42 -9
- package/dist/components/Pager/styles.js +53 -25
- package/dist/components/Pager/styles.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +4 -4
- package/dist/components/RadioInput/index.js +3 -1
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +12 -7
- package/dist/components/RadioInput/styles.js.map +1 -1
- package/dist/components/Scroll/index.d.ts +18 -0
- package/dist/components/{Scroll.js → Scroll/index.js} +14 -11
- package/dist/components/Scroll/index.js.map +1 -0
- package/dist/components/Scroll/styles.d.ts +4 -0
- package/dist/components/Scroll/styles.js +27 -0
- package/dist/components/Scroll/styles.js.map +1 -0
- package/dist/components/Sections/index.d.ts +11 -0
- package/dist/components/{Sections.js → Sections/index.js} +4 -5
- package/dist/components/Sections/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts +10 -1
- package/dist/components/SegmentedControl/index.js +27 -27
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.d.ts +56 -51
- package/dist/components/SegmentedControl/styles.js +10 -3
- package/dist/components/SegmentedControl/styles.js.map +1 -1
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Select/index.js +37 -80
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +57 -7
- package/dist/components/Select/styles.js +17 -41
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Select/types.d.ts +16 -25
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +4 -0
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +53 -0
- package/dist/components/Slider/styles.js +61 -0
- package/dist/components/Slider/styles.js.map +1 -0
- package/dist/components/Slider/types.d.ts +3 -2
- package/dist/components/{Switch.d.ts → Switch/index.d.ts} +3 -2
- package/dist/components/{Switch.js → Switch/index.js} +9 -5
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Switch/styles.d.ts +54 -0
- package/dist/components/Switch/styles.js +34 -0
- package/dist/components/Switch/styles.js.map +1 -0
- package/dist/components/{Text.d.ts → Text/index.d.ts} +7 -3
- package/dist/components/{Text.js → Text/index.js} +53 -5
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Text/styles.d.ts +70 -0
- package/dist/components/Text/styles.js +31 -0
- package/dist/components/Text/styles.js.map +1 -0
- package/dist/components/TextInput/Label.d.ts +9 -0
- package/dist/components/TextInput/Label.js +34 -0
- package/dist/components/TextInput/Label.js.map +1 -0
- package/dist/components/{TextInput.d.ts → TextInput/index.d.ts} +42 -45
- package/dist/components/TextInput/index.js +204 -0
- package/dist/components/TextInput/index.js.map +1 -0
- package/dist/components/TextInput/styles.d.ts +62 -0
- package/dist/components/TextInput/styles.js +68 -0
- package/dist/components/TextInput/styles.js.map +1 -0
- package/dist/components/Touchable/index.d.ts +20 -0
- package/dist/components/Touchable/index.js +165 -0
- package/dist/components/Touchable/index.js.map +1 -0
- package/dist/components/Touchable/styles.d.ts +58 -0
- package/dist/components/Touchable/styles.js +24 -0
- package/dist/components/Touchable/styles.js.map +1 -0
- package/dist/components/{View.d.ts → View/index.d.ts} +6 -0
- package/dist/components/View/index.js +99 -0
- package/dist/components/View/index.js.map +1 -0
- package/dist/components/View/styles.d.ts +54 -0
- package/dist/components/View/styles.js +29 -0
- package/dist/components/View/styles.js.map +1 -0
- package/dist/components/components.d.ts +10 -3
- package/dist/components/components.js +23 -3
- package/dist/components/components.js.map +1 -1
- package/dist/components/defaultStyles.d.ts +1364 -0
- package/dist/components/defaultStyles.js +63 -0
- package/dist/components/defaultStyles.js.map +1 -0
- package/dist/components/{_Modal → legacy/Modal}/index.d.ts +3 -3
- package/dist/components/{_Modal → legacy/Modal}/index.js +6 -6
- package/dist/components/legacy/Modal/index.js.map +1 -0
- package/dist/components/{_Modal → legacy/Modal}/styles.d.ts +6 -6
- package/dist/components/{_Modal → legacy/Modal}/styles.js +0 -0
- package/dist/components/legacy/Modal/styles.js.map +1 -0
- package/dist/components/legacy/Pager/index.d.ts +20 -0
- package/dist/components/legacy/Pager/index.js +168 -0
- package/dist/components/legacy/Pager/index.js.map +1 -0
- package/dist/components/legacy/Pager/styles.d.ts +54 -0
- package/dist/components/legacy/Pager/styles.js +44 -0
- package/dist/components/legacy/Pager/styles.js.map +1 -0
- package/dist/components/legacy/index.d.ts +2 -0
- package/dist/components/legacy/index.js +19 -0
- package/dist/components/legacy/index.js.map +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/modules/reactNavigation.d.ts +2 -0
- package/dist/modules/reactNavigation.js +16 -1
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.d.ts +1 -0
- package/dist/modules/textInputMask.js +15 -0
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/KeyboardAware/index.d.ts +6 -0
- package/dist/utils/KeyboardAware/index.js +31 -0
- package/dist/utils/KeyboardAware/index.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +9 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +67 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +451 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +7 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +4 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +10 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +10 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +1 -0
- package/dist/utils/KeyboardAware/types.d.ts +1 -0
- package/dist/utils/KeyboardAware/types.js +7 -0
- package/dist/utils/KeyboardAware/types.js.map +1 -0
- package/dist/utils/ModalManager/components.d.ts +10 -2
- package/dist/utils/ModalManager/components.js +39 -7
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.d.ts +1 -0
- package/dist/utils/ModalManager/context.js +6 -0
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.d.ts +3 -2
- package/dist/utils/ModalManager/index.js +1 -0
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/OSAlert.d.ts +6 -5
- package/dist/utils/OSAlert.js +7 -6
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +0 -7
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/hooks.d.ts +34 -1
- package/dist/utils/hooks.js +54 -1
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +38 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/misc.d.ts +5 -1
- package/dist/utils/misc.js +62 -1
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/notifications.d.ts +34 -0
- package/dist/utils/notifications.js +268 -0
- package/dist/utils/notifications.js.map +1 -0
- package/package.json +13 -4
- package/src/components/ActionIcon/index.tsx +31 -0
- package/src/components/ActionIcon/styles.ts +92 -0
- package/src/components/{ActivityIndicator.tsx → ActivityIndicator/index.tsx} +7 -3
- package/src/components/ActivityIndicator/styles.ts +68 -0
- package/src/components/AutoComplete/index.tsx +158 -0
- package/src/components/AutoComplete/styles.ts +49 -0
- package/src/components/{Backdrop.tsx → Backdrop/index.tsx} +9 -42
- package/src/components/Backdrop/styles.ts +33 -0
- package/src/components/{Button.tsx → Button/index.tsx} +62 -13
- package/src/components/Button/styles.ts +129 -0
- package/src/components/Calendar/index.tsx +65 -0
- package/src/components/Calendar/style.ts +35 -0
- package/src/components/Calendar/types.ts +102 -0
- package/src/components/Checkbox/index.tsx +10 -5
- package/src/components/Checkbox/styles.ts +8 -3
- package/src/components/{ContentView.tsx → ContentView/index.tsx} +11 -6
- package/src/components/ContentView/styles.ts +25 -0
- package/src/components/Drawer/index.tsx +24 -0
- package/src/components/Drawer/styles.ts +38 -0
- package/src/components/{EmptyPlaceholder.tsx → EmptyPlaceholder/index.tsx} +14 -7
- package/src/components/EmptyPlaceholder/styles.ts +58 -0
- package/src/components/{FileInput.tsx → FileInput/index.tsx} +19 -28
- package/src/components/FileInput/styles.ts +15 -0
- package/src/components/Grid/index.tsx +107 -0
- package/src/components/Grid/styles.ts +11 -0
- package/src/components/{Icon.tsx → Icon/index.tsx} +8 -3
- package/src/components/Icon/styles.ts +52 -0
- package/src/components/Image/index.tsx +91 -0
- package/src/components/Image/styles.ts +20 -0
- package/src/components/ImageView/Spotlight.tsx +158 -0
- package/src/components/ImageView/component.tsx +38 -0
- package/src/components/ImageView/index.ts +2 -0
- package/src/components/List/PaginationIndicator.tsx +71 -0
- package/src/components/List/index.tsx +108 -0
- package/src/components/List/styles.ts +15 -0
- package/src/components/Modal/index.tsx +75 -39
- package/src/components/Modal/styles.ts +7 -5
- package/src/components/MultiSelect/index.tsx +120 -0
- package/src/components/MultiSelect/styles.ts +18 -0
- package/src/components/MultiSelect/types.ts +39 -0
- package/src/components/Navigation/Navigation.tsx +1 -5
- package/src/components/Navigation/utils.tsx +0 -2
- package/src/components/Pager/index.tsx +81 -202
- package/src/components/Pager/styles.ts +57 -27
- package/src/components/RadioInput/index.tsx +8 -7
- package/src/components/RadioInput/styles.ts +10 -11
- package/src/components/{Scroll.tsx → Scroll/index.tsx} +22 -24
- package/src/components/Scroll/styles.ts +18 -0
- package/src/components/{Sections.tsx → Sections/index.tsx} +5 -15
- package/src/components/SegmentedControl/index.tsx +30 -17
- package/src/components/SegmentedControl/styles.ts +29 -7
- package/src/components/Select/index.tsx +78 -142
- package/src/components/Select/styles.ts +52 -74
- package/src/components/Select/types.ts +16 -23
- package/src/components/Slider/index.tsx +2 -0
- package/src/components/Slider/styles.ts +75 -0
- package/src/components/Slider/types.ts +7 -2
- package/src/components/{Switch.tsx → Switch/index.tsx} +10 -5
- package/src/components/Switch/styles.ts +37 -0
- package/src/components/Text/index.tsx +102 -0
- package/src/components/Text/styles.ts +50 -0
- package/src/components/TextInput/Label.tsx +26 -0
- package/src/components/{TextInput.tsx → TextInput/index.tsx} +124 -75
- package/src/components/TextInput/styles.ts +130 -0
- package/src/components/Touchable/index.tsx +182 -0
- package/src/components/Touchable/styles.ts +28 -0
- package/src/components/View/index.tsx +89 -0
- package/src/components/View/styles.ts +24 -0
- package/src/components/components.ts +14 -4
- package/src/components/defaultStyles.ts +60 -0
- package/src/components/{_Modal → legacy/Modal}/index.tsx +7 -7
- package/src/components/{_Modal → legacy/Modal}/styles.ts +0 -0
- package/src/components/legacy/Pager/index.tsx +242 -0
- package/src/components/legacy/Pager/styles.ts +51 -0
- package/src/components/legacy/index.ts +2 -0
- package/src/index.ts +4 -9
- package/src/modules/reactNavigation.ts +11 -0
- package/src/modules/textInputMask.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/utils/KeyboardAware/index.ts +15 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +4 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +618 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +13 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +6 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +6 -0
- package/src/utils/KeyboardAware/types.ts +159 -0
- package/src/utils/ModalManager/components.tsx +57 -14
- package/src/utils/ModalManager/context.tsx +10 -0
- package/src/utils/ModalManager/index.ts +4 -1
- package/src/utils/OSAlert.ts +10 -10
- package/src/utils/PermissionManager/context.tsx +1 -7
- package/src/utils/hooks.ts +82 -2
- package/src/utils/index.ts +9 -0
- package/src/utils/misc.ts +61 -2
- package/src/utils/notifications.ts +206 -0
- package/dist/components/ActivityIndicator.js.map +0 -1
- package/dist/components/Backdrop.js.map +0 -1
- package/dist/components/Button.d.ts +0 -132
- package/dist/components/Button.js.map +0 -1
- package/dist/components/ContentView.js.map +0 -1
- package/dist/components/EmptyPlaceholder.js.map +0 -1
- package/dist/components/FileInput.js.map +0 -1
- package/dist/components/Gap.d.ts +0 -8
- package/dist/components/Gap.js +0 -60
- package/dist/components/Gap.js.map +0 -1
- package/dist/components/Icon.js.map +0 -1
- package/dist/components/Image.js.map +0 -1
- package/dist/components/List.js +0 -101
- package/dist/components/List.js.map +0 -1
- package/dist/components/NewModal/index.d.ts +0 -27
- package/dist/components/NewModal/index.js +0 -99
- package/dist/components/NewModal/index.js.map +0 -1
- package/dist/components/NewModal/styles.js +0 -58
- package/dist/components/NewModal/styles.js.map +0 -1
- package/dist/components/NewPager/index.d.ts +0 -26
- package/dist/components/NewPager/index.js +0 -88
- package/dist/components/NewPager/index.js.map +0 -1
- package/dist/components/NewPager/styles.js +0 -70
- package/dist/components/NewPager/styles.js.map +0 -1
- package/dist/components/Overlay.d.ts +0 -16
- package/dist/components/Overlay.js +0 -74
- package/dist/components/Overlay.js.map +0 -1
- package/dist/components/Scroll.d.ts +0 -15
- package/dist/components/Scroll.js.map +0 -1
- package/dist/components/Sections.d.ts +0 -11
- package/dist/components/Sections.js.map +0 -1
- package/dist/components/SegmentedControl.d.ts +0 -5
- package/dist/components/SegmentedControl.js +0 -32
- package/dist/components/SegmentedControl.js.map +0 -1
- package/dist/components/Switch.js.map +0 -1
- package/dist/components/Text.js.map +0 -1
- package/dist/components/TextInput.js +0 -181
- package/dist/components/TextInput.js.map +0 -1
- package/dist/components/Touchable.d.ts +0 -16
- package/dist/components/Touchable.js +0 -83
- package/dist/components/Touchable.js.map +0 -1
- package/dist/components/View.js.map +0 -1
- package/dist/components/_Modal/index.js.map +0 -1
- package/dist/components/_Modal/styles.js.map +0 -1
- package/dist/utils/PermissionManager/components.d.ts +0 -18
- package/dist/utils/PermissionManager/components.js +0 -52
- package/dist/utils/PermissionManager/components.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -1
- package/dist/utils/styles.js +0 -13
- package/dist/utils/styles.js.map +0 -1
- package/src/components/Gap.tsx +0 -40
- package/src/components/Image.tsx +0 -62
- package/src/components/List.tsx +0 -155
- package/src/components/NewPager/index.tsx +0 -121
- package/src/components/NewPager/styles.ts +0 -76
- package/src/components/Overlay.tsx +0 -86
- package/src/components/Text.tsx +0 -43
- package/src/components/Touchable.tsx +0 -89
- package/src/components/View.tsx +0 -48
- package/src/utils/styles.ts +0 -14
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.MaskedTextInput = void 0;
|
|
4
18
|
// @ts-ignore
|
|
5
19
|
// import MaskInput from 'react-native-mask-input'
|
|
6
20
|
var react_native_masked_text_1 = require("react-native-masked-text");
|
|
7
21
|
exports.MaskedTextInput = react_native_masked_text_1.TextInputMask;
|
|
22
|
+
__exportStar(require("./types/textInputMask"), exports);
|
|
8
23
|
//# sourceMappingURL=textInputMask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textInputMask.js","sourceRoot":"","sources":["../../src/modules/textInputMask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textInputMask.js","sourceRoot":"","sources":["../../src/modules/textInputMask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,kDAAkD;AAClD,qEAAwD;AAI3C,QAAA,eAAe,GAAG,wCAE7B,CAAA;AAEF,wDAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utility';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utility"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import listenToKeyboardEvents from './lib/KeyboardAwareHOC';
|
|
2
|
+
import KeyboardAwareScrollView from './lib/KeyboardAwareScrollView';
|
|
3
|
+
import KeyboardAwareFlatList from './lib/KeyboardAwareFlatList';
|
|
4
|
+
import KeyboardAwareSectionList from './lib/KeyboardAwareSectionList';
|
|
5
|
+
export { listenToKeyboardEvents, KeyboardAwareFlatList, KeyboardAwareSectionList, KeyboardAwareScrollView, };
|
|
6
|
+
export * from './types';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* @flow */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.KeyboardAwareScrollView = exports.KeyboardAwareSectionList = exports.KeyboardAwareFlatList = exports.listenToKeyboardEvents = void 0;
|
|
22
|
+
var KeyboardAwareHOC_1 = __importDefault(require("./lib/KeyboardAwareHOC"));
|
|
23
|
+
exports.listenToKeyboardEvents = KeyboardAwareHOC_1.default;
|
|
24
|
+
var KeyboardAwareScrollView_1 = __importDefault(require("./lib/KeyboardAwareScrollView"));
|
|
25
|
+
exports.KeyboardAwareScrollView = KeyboardAwareScrollView_1.default;
|
|
26
|
+
var KeyboardAwareFlatList_1 = __importDefault(require("./lib/KeyboardAwareFlatList"));
|
|
27
|
+
exports.KeyboardAwareFlatList = KeyboardAwareFlatList_1.default;
|
|
28
|
+
var KeyboardAwareSectionList_1 = __importDefault(require("./lib/KeyboardAwareSectionList"));
|
|
29
|
+
exports.KeyboardAwareSectionList = KeyboardAwareSectionList_1.default;
|
|
30
|
+
__exportStar(require("./types"), exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/KeyboardAware/index.ts"],"names":[],"mappings":";AAAA,WAAW;;;;;;;;;;;;;;;;;;;;AAEX,4EAA2D;AAMzD,iCANK,0BAAsB,CAML;AALxB,0FAAmE;AAQjE,kCARK,iCAAuB,CAQL;AAPzB,sFAA+D;AAK7D,gCALK,+BAAqB,CAKL;AAJvB,4FAAqE;AAKnE,mCALK,kCAAwB,CAKL;AAI1B,0CAAuB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_native_1 = require("react-native");
|
|
7
|
+
var KeyboardAwareHOC_1 = __importDefault(require("./KeyboardAwareHOC"));
|
|
8
|
+
exports.default = (0, KeyboardAwareHOC_1.default)(react_native_1.FlatList);
|
|
9
|
+
//# sourceMappingURL=KeyboardAwareFlatList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyboardAwareFlatList.js","sourceRoot":"","sources":["../../../../src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts"],"names":[],"mappings":";;;;;AAAA,6CAAuC;AACvC,wEAAuD;AAEvD,kBAAe,IAAA,0BAAsB,EAAC,uBAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="chai" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function isIphoneX(): boolean;
|
|
4
|
+
declare const keyboardAwareHOCTypeEvents: {
|
|
5
|
+
constructor: Function;
|
|
6
|
+
toString(): string;
|
|
7
|
+
toLocaleString(): string;
|
|
8
|
+
valueOf(): Object;
|
|
9
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
10
|
+
isPrototypeOf(v: Object): boolean;
|
|
11
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
12
|
+
should: Chai.Assertion;
|
|
13
|
+
};
|
|
14
|
+
export declare type KeyboardAwareHOCProps = {
|
|
15
|
+
viewIsInsideTabBar?: boolean;
|
|
16
|
+
resetScrollToCoords?: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
enableResetScrollToCoords?: boolean;
|
|
21
|
+
enableAutomaticScroll?: boolean;
|
|
22
|
+
extraHeight?: number;
|
|
23
|
+
extraScrollHeight?: number;
|
|
24
|
+
keyboardOpeningTime?: number;
|
|
25
|
+
onScroll?: Function;
|
|
26
|
+
update?: Function;
|
|
27
|
+
contentContainerStyle?: any;
|
|
28
|
+
enableOnAndroid?: boolean;
|
|
29
|
+
Scrollable: any;
|
|
30
|
+
innerRef?: Function;
|
|
31
|
+
hocOptions?: any;
|
|
32
|
+
} & typeof keyboardAwareHOCTypeEvents;
|
|
33
|
+
export declare type KeyboardAwareHOCState = {
|
|
34
|
+
keyboardSpace: number;
|
|
35
|
+
};
|
|
36
|
+
export declare type ElementLayout = {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
};
|
|
42
|
+
export declare type ContentOffset = {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
};
|
|
46
|
+
export declare type ScrollPosition = {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
animated: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare type ScrollIntoViewOptions = {
|
|
52
|
+
getScrollPosition?: (parentLayout: ElementLayout, childLayout: ElementLayout, contentOffset: ContentOffset) => ScrollPosition;
|
|
53
|
+
};
|
|
54
|
+
export declare type KeyboardAwareHOCOptions = {
|
|
55
|
+
enableOnAndroid: boolean;
|
|
56
|
+
contentContainerStyle?: Object;
|
|
57
|
+
enableAutomaticScroll: boolean;
|
|
58
|
+
extraHeight: number;
|
|
59
|
+
extraScrollHeight: number;
|
|
60
|
+
enableResetScrollToCoords: boolean;
|
|
61
|
+
keyboardOpeningTime: number;
|
|
62
|
+
viewIsInsideTabBar: boolean;
|
|
63
|
+
refPropName: string;
|
|
64
|
+
extractNativeRef: Function;
|
|
65
|
+
};
|
|
66
|
+
declare const listenToKeyboardEvents: <C extends React.ComponentType<{}> | React.ComponentClass<{}, any>>(configOrComp: C) => C;
|
|
67
|
+
export default listenToKeyboardEvents;
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable max-lines */
|
|
3
|
+
/* @flow */
|
|
4
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5
|
+
var extendStatics = function (d, b) {
|
|
6
|
+
extendStatics = Object.setPrototypeOf ||
|
|
7
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
8
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
9
|
+
return extendStatics(d, b);
|
|
10
|
+
};
|
|
11
|
+
return function (d, b) {
|
|
12
|
+
if (typeof b !== "function" && b !== null)
|
|
13
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
14
|
+
extendStatics(d, b);
|
|
15
|
+
function __() { this.constructor = d; }
|
|
16
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
var __assign = (this && this.__assign) || function () {
|
|
20
|
+
__assign = Object.assign || function(t) {
|
|
21
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
22
|
+
s = arguments[i];
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
28
|
+
return __assign.apply(this, arguments);
|
|
29
|
+
};
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
41
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (_) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
67
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
68
|
+
};
|
|
69
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
exports.isIphoneX = void 0;
|
|
71
|
+
var react_1 = __importDefault(require("react"));
|
|
72
|
+
var prop_types_1 = __importDefault(require("prop-types"));
|
|
73
|
+
var react_native_1 = require("react-native");
|
|
74
|
+
function isIphoneX() {
|
|
75
|
+
var dimen = react_native_1.Dimensions.get('window');
|
|
76
|
+
return (react_native_1.Platform.OS === 'ios' &&
|
|
77
|
+
!react_native_1.Platform.isPad &&
|
|
78
|
+
!react_native_1.Platform.isTVOS &&
|
|
79
|
+
((dimen.height === 780 || dimen.width === 780)
|
|
80
|
+
|| (dimen.height === 812 || dimen.width === 812)
|
|
81
|
+
|| (dimen.height === 844 || dimen.width === 844)
|
|
82
|
+
|| (dimen.height === 896 || dimen.width === 896)
|
|
83
|
+
|| (dimen.height === 926 || dimen.width === 926)));
|
|
84
|
+
}
|
|
85
|
+
exports.isIphoneX = isIphoneX;
|
|
86
|
+
var _KAM_DEFAULT_TAB_BAR_HEIGHT = isIphoneX() ? 83 : 49;
|
|
87
|
+
var _KAM_KEYBOARD_OPENING_TIME = 250;
|
|
88
|
+
var _KAM_EXTRA_HEIGHT = 75;
|
|
89
|
+
var supportedKeyboardEvents = [
|
|
90
|
+
'keyboardWillShow',
|
|
91
|
+
'keyboardDidShow',
|
|
92
|
+
'keyboardWillHide',
|
|
93
|
+
'keyboardDidHide',
|
|
94
|
+
'keyboardWillChangeFrame',
|
|
95
|
+
'keyboardDidChangeFrame',
|
|
96
|
+
];
|
|
97
|
+
var keyboardEventToCallbackName = function (eventName) { return 'on' + eventName[0].toUpperCase() + eventName.substring(1); };
|
|
98
|
+
var keyboardEventPropTypes = supportedKeyboardEvents.reduce(function (acc, eventName) {
|
|
99
|
+
var _a;
|
|
100
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[keyboardEventToCallbackName(eventName)] = prop_types_1.default.func, _a)));
|
|
101
|
+
}, {});
|
|
102
|
+
var keyboardAwareHOCTypeEvents = supportedKeyboardEvents.reduce(function (acc, eventName) {
|
|
103
|
+
var _a;
|
|
104
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[keyboardEventToCallbackName(eventName)] = Function, _a)));
|
|
105
|
+
}, {});
|
|
106
|
+
function getDisplayName(WrappedComponent) {
|
|
107
|
+
return ((WrappedComponent &&
|
|
108
|
+
(WrappedComponent.displayName || WrappedComponent.name)) ||
|
|
109
|
+
'Component');
|
|
110
|
+
}
|
|
111
|
+
var ScrollIntoViewDefaultOptions = {
|
|
112
|
+
enableOnAndroid: false,
|
|
113
|
+
contentContainerStyle: undefined,
|
|
114
|
+
enableAutomaticScroll: true,
|
|
115
|
+
extraHeight: _KAM_EXTRA_HEIGHT,
|
|
116
|
+
extraScrollHeight: 0,
|
|
117
|
+
enableResetScrollToCoords: true,
|
|
118
|
+
keyboardOpeningTime: _KAM_KEYBOARD_OPENING_TIME,
|
|
119
|
+
viewIsInsideTabBar: false,
|
|
120
|
+
// The ref prop name that will be passed to the wrapped component to obtain a ref
|
|
121
|
+
// If your ScrollView is already wrapped, maybe the wrapper permit to get a ref
|
|
122
|
+
// For example, with glamorous-native ScrollView, you should use "innerRef"
|
|
123
|
+
refPropName: 'ref',
|
|
124
|
+
// Sometimes the ref you get is a ref to a wrapped view (ex: Animated.ScrollView)
|
|
125
|
+
// We need access to the imperative API of a real native ScrollView so we need extraction logic
|
|
126
|
+
extractNativeRef: function (ref) {
|
|
127
|
+
// getNode() permit to support Animated.ScrollView automatically, but is deprecated since RN 0.62
|
|
128
|
+
// see https://github.com/facebook/react-native/issues/19650
|
|
129
|
+
// see https://stackoverflow.com/questions/42051368/scrollto-is-undefined-on-animated-scrollview/48786374
|
|
130
|
+
// see https://github.com/facebook/react-native/commit/66e72bb4e00aafbcb9f450ed5db261d98f99f82a
|
|
131
|
+
var shouldCallGetNode = !react_native_1.Platform.constants || (react_native_1.Platform.constants.reactNativeVersion.major === 0 && react_native_1.Platform.constants.reactNativeVersion.minor < 62);
|
|
132
|
+
if (ref.getNode && shouldCallGetNode) {
|
|
133
|
+
return ref.getNode();
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return ref;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
var KeyboardAwareScrollable = /** @class */ (function (_super) {
|
|
141
|
+
__extends(KeyboardAwareScrollable, _super);
|
|
142
|
+
function KeyboardAwareScrollable(props) {
|
|
143
|
+
var _this = _super.call(this, props) || this;
|
|
144
|
+
_this.getScrollResponder = function () {
|
|
145
|
+
return (_this._rnkasv_keyboardView &&
|
|
146
|
+
_this._rnkasv_keyboardView.getScrollResponder &&
|
|
147
|
+
_this._rnkasv_keyboardView.getScrollResponder());
|
|
148
|
+
};
|
|
149
|
+
_this.scrollToPosition = function (x, y, animated) {
|
|
150
|
+
if (animated === void 0) { animated = true; }
|
|
151
|
+
var responder = _this.getScrollResponder();
|
|
152
|
+
if (!responder) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (responder.scrollResponderScrollTo) {
|
|
156
|
+
// React Native < 0.65
|
|
157
|
+
responder.scrollResponderScrollTo({ x: x, y: y, animated: animated });
|
|
158
|
+
}
|
|
159
|
+
else if (responder.scrollTo) {
|
|
160
|
+
// React Native >= 0.65
|
|
161
|
+
responder.scrollTo({ x: x, y: y, animated: animated });
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
_this.scrollToEnd = function (animated) {
|
|
165
|
+
if (animated === void 0) { animated = true; }
|
|
166
|
+
var responder = _this.getScrollResponder();
|
|
167
|
+
if (!responder) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (responder.scrollResponderScrollToEnd) {
|
|
171
|
+
// React Native < 0.65
|
|
172
|
+
responder.scrollResponderScrollToEnd({ animated: animated });
|
|
173
|
+
}
|
|
174
|
+
else if (responder.scrollToEnd) {
|
|
175
|
+
// React Native >= 0.65
|
|
176
|
+
responder.scrollToEnd({ animated: animated });
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
_this.scrollForExtraHeightOnAndroid = function (extraHeight) {
|
|
180
|
+
_this.scrollToPosition(0, _this.position.y + extraHeight, true);
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* @param keyboardOpeningTime: takes a different keyboardOpeningTime in consideration.
|
|
184
|
+
* @param extraHeight: takes an extra height in consideration.
|
|
185
|
+
*/
|
|
186
|
+
_this.scrollToFocusedInput = function (reactNode, extraHeight, keyboardOpeningTime) {
|
|
187
|
+
if (extraHeight === undefined) {
|
|
188
|
+
extraHeight = _this.props.extraHeight || 0;
|
|
189
|
+
}
|
|
190
|
+
if (keyboardOpeningTime === undefined) {
|
|
191
|
+
keyboardOpeningTime = _this.props.keyboardOpeningTime || 0;
|
|
192
|
+
}
|
|
193
|
+
setTimeout(function () {
|
|
194
|
+
if (!_this.mountedComponent) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
var responder = _this.getScrollResponder();
|
|
198
|
+
responder &&
|
|
199
|
+
responder.scrollResponderScrollNativeHandleToKeyboard(reactNode, extraHeight, true);
|
|
200
|
+
}, keyboardOpeningTime);
|
|
201
|
+
};
|
|
202
|
+
_this.scrollIntoView = function (element, options) {
|
|
203
|
+
if (options === void 0) { options = {}; }
|
|
204
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
205
|
+
var _a, parentLayout, childLayout, getScrollPosition, _b, x, y, animated;
|
|
206
|
+
return __generator(this, function (_c) {
|
|
207
|
+
switch (_c.label) {
|
|
208
|
+
case 0:
|
|
209
|
+
if (!this._rnkasv_keyboardView || !element) {
|
|
210
|
+
return [2 /*return*/];
|
|
211
|
+
}
|
|
212
|
+
return [4 /*yield*/, Promise.all([
|
|
213
|
+
this._measureElement(this._rnkasv_keyboardView),
|
|
214
|
+
this._measureElement(element),
|
|
215
|
+
])];
|
|
216
|
+
case 1:
|
|
217
|
+
_a = _c.sent(), parentLayout = _a[0], childLayout = _a[1];
|
|
218
|
+
getScrollPosition = options.getScrollPosition || this._defaultGetScrollPosition;
|
|
219
|
+
_b = getScrollPosition(parentLayout, childLayout, this.position), x = _b.x, y = _b.y, animated = _b.animated;
|
|
220
|
+
this.scrollToPosition(x, y, animated);
|
|
221
|
+
return [2 /*return*/];
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
_this._defaultGetScrollPosition = function (parentLayout, childLayout, contentOffset) {
|
|
227
|
+
return {
|
|
228
|
+
x: 0,
|
|
229
|
+
y: Math.max(0, childLayout.y - parentLayout.y + contentOffset.y),
|
|
230
|
+
animated: true,
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
_this._measureElement = function (element) {
|
|
234
|
+
var node = (0, react_native_1.findNodeHandle)(element);
|
|
235
|
+
return new Promise(function (resolve) {
|
|
236
|
+
react_native_1.UIManager.measureInWindow(node, function (x, y, width, height) {
|
|
237
|
+
resolve({ x: x, y: y, width: width, height: height });
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
// Keyboard actions
|
|
242
|
+
_this._updateKeyboardSpace = function (frames) {
|
|
243
|
+
// Automatically scroll to focused TextInput
|
|
244
|
+
if (_this.props.enableAutomaticScroll) {
|
|
245
|
+
var keyboardSpace_1 = frames.endCoordinates.height + _this.props.extraScrollHeight;
|
|
246
|
+
if (_this.props.viewIsInsideTabBar) {
|
|
247
|
+
keyboardSpace_1 -= _KAM_DEFAULT_TAB_BAR_HEIGHT;
|
|
248
|
+
}
|
|
249
|
+
_this.setState({ keyboardSpace: keyboardSpace_1 });
|
|
250
|
+
var currentlyFocusedField_1 = react_native_1.TextInput.State.currentlyFocusedInput ?
|
|
251
|
+
(0, react_native_1.findNodeHandle)(react_native_1.TextInput.State.currentlyFocusedInput()) : react_native_1.TextInput.State.currentlyFocusedField();
|
|
252
|
+
var responder = _this.getScrollResponder();
|
|
253
|
+
if (!currentlyFocusedField_1 || !responder) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
// @ts-ignore
|
|
257
|
+
react_native_1.UIManager.viewIsDescendantOf(currentlyFocusedField_1, responder.getInnerViewNode(), function (isAncestor) {
|
|
258
|
+
if (isAncestor) {
|
|
259
|
+
// Check if the TextInput will be hidden by the keyboard
|
|
260
|
+
react_native_1.UIManager.measureInWindow(currentlyFocusedField_1, function (x, y, width, height) {
|
|
261
|
+
var textInputBottomPosition = y + height;
|
|
262
|
+
var keyboardPosition = frames.endCoordinates.screenY;
|
|
263
|
+
var totalExtraHeight = _this.props.extraScrollHeight + _this.props.extraHeight;
|
|
264
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
265
|
+
if (textInputBottomPosition >
|
|
266
|
+
keyboardPosition - totalExtraHeight) {
|
|
267
|
+
_this._scrollToFocusedInputWithNodeHandle(currentlyFocusedField_1);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
// On android, the system would scroll the text input just
|
|
272
|
+
// above the keyboard so we just neet to scroll the extra
|
|
273
|
+
// height part
|
|
274
|
+
if (textInputBottomPosition > keyboardPosition) {
|
|
275
|
+
// Since the system already scrolled the whole view up
|
|
276
|
+
// we should reduce that amount
|
|
277
|
+
keyboardSpace_1 =
|
|
278
|
+
keyboardSpace_1 -
|
|
279
|
+
(textInputBottomPosition - keyboardPosition);
|
|
280
|
+
_this.setState({ keyboardSpace: keyboardSpace_1 });
|
|
281
|
+
_this.scrollForExtraHeightOnAndroid(totalExtraHeight);
|
|
282
|
+
}
|
|
283
|
+
else if (textInputBottomPosition >
|
|
284
|
+
keyboardPosition - totalExtraHeight) {
|
|
285
|
+
_this.scrollForExtraHeightOnAndroid(totalExtraHeight -
|
|
286
|
+
(keyboardPosition - textInputBottomPosition));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (!_this.props.resetScrollToCoords) {
|
|
294
|
+
if (!_this.defaultResetScrollToCoords) {
|
|
295
|
+
_this.defaultResetScrollToCoords = _this.position;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
_this._resetKeyboardSpace = function () {
|
|
300
|
+
var keyboardSpace = _this.props.viewIsInsideTabBar
|
|
301
|
+
? _KAM_DEFAULT_TAB_BAR_HEIGHT
|
|
302
|
+
: 0;
|
|
303
|
+
_this.setState({ keyboardSpace: keyboardSpace });
|
|
304
|
+
// Reset scroll position after keyboard dismissal
|
|
305
|
+
if (_this.props.enableResetScrollToCoords === false) {
|
|
306
|
+
_this.defaultResetScrollToCoords = null;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
else if (_this.props.resetScrollToCoords) {
|
|
310
|
+
_this.scrollToPosition(_this.props.resetScrollToCoords.x, _this.props.resetScrollToCoords.y, true);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
if (_this.defaultResetScrollToCoords) {
|
|
314
|
+
_this.scrollToPosition(_this.defaultResetScrollToCoords.x, _this.defaultResetScrollToCoords.y, true);
|
|
315
|
+
_this.defaultResetScrollToCoords = null;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
_this.scrollToPosition(0, 0, true);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
_this._scrollToFocusedInputWithNodeHandle = function (nodeID, extraHeight, keyboardOpeningTime) {
|
|
323
|
+
if (extraHeight === undefined) {
|
|
324
|
+
extraHeight = _this.props.extraHeight;
|
|
325
|
+
}
|
|
326
|
+
var reactNode = (0, react_native_1.findNodeHandle)(nodeID);
|
|
327
|
+
_this.scrollToFocusedInput(reactNode, extraHeight + _this.props.extraScrollHeight, keyboardOpeningTime !== undefined
|
|
328
|
+
? keyboardOpeningTime
|
|
329
|
+
: _this.props.keyboardOpeningTime || 0);
|
|
330
|
+
};
|
|
331
|
+
_this._handleOnScroll = function (e) {
|
|
332
|
+
_this.position = e.nativeEvent.contentOffset;
|
|
333
|
+
};
|
|
334
|
+
_this._handleRef = function (ref) {
|
|
335
|
+
_this._rnkasv_keyboardView = ref ? _this.props.hocOptions.extractNativeRef(ref) : ref;
|
|
336
|
+
if (_this.props.innerRef) {
|
|
337
|
+
_this.props.innerRef(_this._rnkasv_keyboardView);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
_this.update = function () {
|
|
341
|
+
var currentlyFocusedField = react_native_1.TextInput.State.currentlyFocusedInput ?
|
|
342
|
+
(0, react_native_1.findNodeHandle)(react_native_1.TextInput.State.currentlyFocusedInput()) : react_native_1.TextInput.State.currentlyFocusedField();
|
|
343
|
+
var responder = _this.getScrollResponder();
|
|
344
|
+
if (!currentlyFocusedField || !responder) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
_this._scrollToFocusedInputWithNodeHandle(currentlyFocusedField);
|
|
348
|
+
};
|
|
349
|
+
_this.keyboardWillShowEvent = undefined;
|
|
350
|
+
_this.keyboardWillHideEvent = undefined;
|
|
351
|
+
_this.callbacks = {};
|
|
352
|
+
_this.position = { x: 0, y: 0 };
|
|
353
|
+
_this.defaultResetScrollToCoords = null;
|
|
354
|
+
var keyboardSpace = props.viewIsInsideTabBar
|
|
355
|
+
? _KAM_DEFAULT_TAB_BAR_HEIGHT
|
|
356
|
+
: 0;
|
|
357
|
+
_this.state = { keyboardSpace: keyboardSpace };
|
|
358
|
+
return _this;
|
|
359
|
+
}
|
|
360
|
+
KeyboardAwareScrollable.prototype.componentDidMount = function () {
|
|
361
|
+
var _this = this;
|
|
362
|
+
this.mountedComponent = true;
|
|
363
|
+
// Keyboard events
|
|
364
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
365
|
+
this.keyboardWillShowEvent = react_native_1.Keyboard.addListener('keyboardWillShow', this._updateKeyboardSpace);
|
|
366
|
+
this.keyboardWillHideEvent = react_native_1.Keyboard.addListener('keyboardWillHide', this._resetKeyboardSpace);
|
|
367
|
+
}
|
|
368
|
+
else if (react_native_1.Platform.OS === 'android' && this.props.enableOnAndroid) {
|
|
369
|
+
this.keyboardWillShowEvent = react_native_1.Keyboard.addListener('keyboardDidShow', this._updateKeyboardSpace);
|
|
370
|
+
this.keyboardWillHideEvent = react_native_1.Keyboard.addListener('keyboardDidHide', this._resetKeyboardSpace);
|
|
371
|
+
}
|
|
372
|
+
supportedKeyboardEvents.forEach(function (eventName) {
|
|
373
|
+
var callbackName = keyboardEventToCallbackName(eventName);
|
|
374
|
+
if (_this.props[callbackName]) {
|
|
375
|
+
_this.callbacks[eventName] = react_native_1.Keyboard.addListener(eventName, _this.props[callbackName]);
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
};
|
|
379
|
+
KeyboardAwareScrollable.prototype.componentDidUpdate = function (prevProps) {
|
|
380
|
+
if (this.props.viewIsInsideTabBar !== prevProps.viewIsInsideTabBar) {
|
|
381
|
+
var keyboardSpace = this.props.viewIsInsideTabBar
|
|
382
|
+
? _KAM_DEFAULT_TAB_BAR_HEIGHT
|
|
383
|
+
: 0;
|
|
384
|
+
if (this.state.keyboardSpace !== keyboardSpace) {
|
|
385
|
+
this.setState({ keyboardSpace: keyboardSpace });
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
KeyboardAwareScrollable.prototype.componentWillUnmount = function () {
|
|
390
|
+
this.mountedComponent = false;
|
|
391
|
+
this.keyboardWillShowEvent && this.keyboardWillShowEvent.remove();
|
|
392
|
+
this.keyboardWillHideEvent && this.keyboardWillHideEvent.remove();
|
|
393
|
+
Object.values(this.callbacks).forEach(function (callback) { return callback.remove(); });
|
|
394
|
+
};
|
|
395
|
+
KeyboardAwareScrollable.prototype.render = function () {
|
|
396
|
+
var _a;
|
|
397
|
+
var _b = this.props, enableOnAndroid = _b.enableOnAndroid, contentContainerStyle = _b.contentContainerStyle, onScroll = _b.onScroll, Scrollable = _b.Scrollable;
|
|
398
|
+
var newContentContainerStyle;
|
|
399
|
+
if (react_native_1.Platform.OS === 'android' && enableOnAndroid) {
|
|
400
|
+
newContentContainerStyle = [].concat(contentContainerStyle).concat({
|
|
401
|
+
paddingBottom: ((contentContainerStyle || {}).paddingBottom || 0) +
|
|
402
|
+
this.state.keyboardSpace,
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
var refProps = (_a = {}, _a[this.props.hocOptions.refPropName] = this._handleRef, _a);
|
|
406
|
+
return (<Scrollable {...refProps} keyboardDismissMode='interactive' contentInset={{ bottom: this.state.keyboardSpace }} automaticallyAdjustContentInsets={false} showsVerticalScrollIndicator={true} scrollEventThrottle={1} {...this.props} contentContainerStyle={newContentContainerStyle || contentContainerStyle} keyboardSpace={this.state.keyboardSpace} getScrollResponder={this.getScrollResponder} scrollToPosition={this.scrollToPosition} scrollToEnd={this.scrollToEnd} scrollForExtraHeightOnAndroid={this.scrollForExtraHeightOnAndroid} scrollToFocusedInput={this.scrollToFocusedInput} scrollIntoView={this.scrollIntoView} resetKeyboardSpace={this._resetKeyboardSpace} handleOnScroll={this._handleOnScroll} update={this.update}
|
|
407
|
+
// @ts-ignore
|
|
408
|
+
onScroll={react_native_1.Animated.forkEvent(onScroll, this._handleOnScroll)}/>);
|
|
409
|
+
};
|
|
410
|
+
KeyboardAwareScrollable.displayName = "KeyboardAware";
|
|
411
|
+
KeyboardAwareScrollable.propTypes = __assign({ viewIsInsideTabBar: prop_types_1.default.bool, resetScrollToCoords: prop_types_1.default.shape({
|
|
412
|
+
x: prop_types_1.default.number.isRequired,
|
|
413
|
+
y: prop_types_1.default.number.isRequired,
|
|
414
|
+
}), enableResetScrollToCoords: prop_types_1.default.bool, enableAutomaticScroll: prop_types_1.default.bool, extraHeight: prop_types_1.default.number, extraScrollHeight: prop_types_1.default.number, keyboardOpeningTime: prop_types_1.default.number, onScroll: prop_types_1.default.oneOfType([
|
|
415
|
+
prop_types_1.default.func,
|
|
416
|
+
prop_types_1.default.object, // Animated.event listener
|
|
417
|
+
]), update: prop_types_1.default.func, contentContainerStyle: prop_types_1.default.any, enableOnAndroid: prop_types_1.default.bool, innerRef: prop_types_1.default.func }, keyboardEventPropTypes);
|
|
418
|
+
// HOC options are used to init default props, so that these options can be overriden with component props
|
|
419
|
+
KeyboardAwareScrollable.defaultProps = {
|
|
420
|
+
enableAutomaticScroll: ScrollIntoViewDefaultOptions.enableAutomaticScroll,
|
|
421
|
+
extraHeight: ScrollIntoViewDefaultOptions.extraHeight,
|
|
422
|
+
extraScrollHeight: ScrollIntoViewDefaultOptions.extraScrollHeight,
|
|
423
|
+
enableResetScrollToCoords: ScrollIntoViewDefaultOptions.enableResetScrollToCoords,
|
|
424
|
+
keyboardOpeningTime: ScrollIntoViewDefaultOptions.keyboardOpeningTime,
|
|
425
|
+
viewIsInsideTabBar: ScrollIntoViewDefaultOptions.viewIsInsideTabBar,
|
|
426
|
+
enableOnAndroid: ScrollIntoViewDefaultOptions.enableOnAndroid,
|
|
427
|
+
};
|
|
428
|
+
return KeyboardAwareScrollable;
|
|
429
|
+
}(react_1.default.Component));
|
|
430
|
+
function KeyboardAwareHOC(ScrollableComponent, userOptions) {
|
|
431
|
+
if (userOptions === void 0) { userOptions = ScrollIntoViewDefaultOptions; }
|
|
432
|
+
var hocOptions = __assign(__assign({}, ScrollIntoViewDefaultOptions), userOptions);
|
|
433
|
+
return react_1.default.forwardRef(function (props, ref) { return <KeyboardAwareScrollable hocOptions={hocOptions}
|
|
434
|
+
// @ts-ignore
|
|
435
|
+
ref={ref} Scrollable={ScrollableComponent} {...props}/>; });
|
|
436
|
+
}
|
|
437
|
+
// Allow to pass options, without breaking change, and curried for composition
|
|
438
|
+
// listenToKeyboardEvents(ScrollView);
|
|
439
|
+
// listenToKeyboardEvents(options)(Comp);
|
|
440
|
+
var listenToKeyboardEvents = function (configOrComp) {
|
|
441
|
+
//@ts-ignore
|
|
442
|
+
if (typeof configOrComp === 'object' && !configOrComp.displayName) {
|
|
443
|
+
return (function (Comp) { return KeyboardAwareHOC(Comp, configOrComp); });
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
//@ts-ignore
|
|
447
|
+
return KeyboardAwareHOC(configOrComp);
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
exports.default = listenToKeyboardEvents;
|
|
451
|
+
//# sourceMappingURL=KeyboardAwareHOC.js.map
|