@codeleap/mobile 2.4.7 → 3.1.1
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/mobile-packages.code-workspace +27 -0
- package/package.json +25 -33
- package/src/components/ActionIcon/index.tsx +16 -6
- package/src/components/ActionIcon/styles.ts +3 -90
- package/src/components/ActivityIndicator/index.tsx +28 -9
- package/src/components/ActivityIndicator/styles.ts +2 -59
- package/src/components/Autocomplete/index.tsx +235 -0
- package/src/components/Autocomplete/styles.ts +18 -0
- package/src/components/Autocomplete/types.ts +75 -0
- package/src/components/Avatar/index.tsx +126 -0
- package/src/components/Avatar/styles.ts +22 -0
- package/src/components/AvatarGroup/index.tsx +76 -0
- package/src/components/AvatarGroup/styles.ts +11 -0
- package/src/components/Backdrop/index.tsx +14 -13
- package/src/components/Backdrop/styles.ts +3 -24
- package/src/components/Badge/index.tsx +134 -0
- package/src/components/Badge/styles.ts +14 -0
- package/src/components/Button/index.tsx +39 -49
- package/src/components/Button/styles.ts +6 -107
- package/src/components/Calendar/index.tsx +3 -3
- package/src/components/Calendar/style.ts +2 -31
- package/src/components/Checkbox/index.tsx +137 -74
- package/src/components/Checkbox/styles.ts +13 -73
- package/src/components/ContentView/index.tsx +2 -2
- package/src/components/ContentView/styles.ts +1 -17
- package/src/components/DatePickerModal/index.tsx +240 -0
- package/src/components/DatePickerModal/styles.ts +15 -0
- package/src/components/DatePickerModal/types.ts +55 -0
- package/src/components/Drawer/index.tsx +2 -2
- package/src/components/Drawer/styles.ts +4 -39
- package/src/components/EmptyPlaceholder/index.tsx +3 -3
- package/src/components/EmptyPlaceholder/styles.ts +2 -47
- package/src/components/FileInput/styles.ts +1 -8
- package/src/components/Grid/index.tsx +76 -72
- package/src/components/Grid/styles.ts +4 -7
- package/src/components/Icon/index.tsx +46 -8
- package/src/components/Icon/styles.ts +3 -51
- package/src/components/Image/index.tsx +18 -22
- package/src/components/Image/styles.ts +1 -14
- package/src/components/ImageView/Spotlight.tsx +4 -2
- package/src/components/ImageView/component.tsx +0 -3
- package/src/components/InputBase/index.tsx +101 -0
- package/src/components/InputBase/styles.ts +135 -0
- package/src/components/InputBase/types.ts +28 -0
- package/src/components/InputBase/utils.ts +42 -0
- package/src/components/InputLabel/index.tsx +3 -3
- package/src/components/InputLabel/styles.ts +2 -14
- package/src/components/List/PaginationIndicator.tsx +4 -21
- package/src/components/List/index.tsx +84 -46
- package/src/components/List/styles.ts +8 -20
- package/src/components/LoadingOverlay/index.tsx +45 -45
- package/src/components/LoadingOverlay/styles.ts +5 -27
- package/src/components/Modal/index.tsx +56 -32
- package/src/components/Modal/styles.ts +3 -114
- package/src/components/NumberIncrement/index.tsx +318 -0
- package/src/components/NumberIncrement/styles.ts +14 -0
- package/src/components/NumberIncrement/types.ts +44 -0
- package/src/components/NumberIncrement/utils.ts +27 -0
- package/src/components/Pager/index.tsx +120 -67
- package/src/components/Pager/styles.ts +2 -69
- package/src/components/RadioInput/index.tsx +145 -68
- package/src/components/RadioInput/styles.ts +8 -61
- package/src/components/RefreshControl/index.tsx +28 -0
- package/src/components/RefreshControl/styles.ts +7 -0
- package/src/components/Scroll/index.tsx +22 -37
- package/src/components/Scroll/styles.ts +2 -16
- package/src/components/Sections/index.tsx +116 -54
- package/src/components/Sections/styles.ts +7 -0
- package/src/components/SegmentedControl/Option.tsx +51 -0
- package/src/components/SegmentedControl/index.tsx +51 -67
- package/src/components/SegmentedControl/styles.ts +7 -63
- package/src/components/Select/index.tsx +268 -95
- package/src/components/Select/styles.ts +11 -131
- package/src/components/Select/types.ts +47 -11
- package/src/components/Slider/index.tsx +151 -94
- package/src/components/Slider/styles.ts +7 -72
- package/src/components/Slider/types.ts +18 -20
- package/src/components/Switch/index.tsx +115 -63
- package/src/components/Switch/styles.ts +13 -30
- package/src/components/Text/index.tsx +14 -31
- package/src/components/Text/styles.ts +2 -41
- package/src/components/TextInput/index.tsx +237 -259
- package/src/components/TextInput/styles.ts +6 -120
- package/src/components/Touchable/index.tsx +74 -27
- package/src/components/Touchable/styles.ts +1 -12
- package/src/components/View/index.tsx +11 -26
- package/src/components/View/styles.ts +1 -17
- package/src/components/components.ts +9 -5
- package/src/components/defaultStyles.ts +74 -61
- package/src/index.ts +0 -1
- package/src/modules/PressableRipple/index.ts +5 -0
- package/src/modules/PressableRipple/ripple.js +258 -0
- package/src/modules/PressableRipple/styles.js +22 -0
- package/src/modules/PressableRipple/type.ts +17 -0
- package/src/modules/textInputMask.tsx +13 -0
- package/src/types/index.ts +5 -0
- package/src/types/utility.ts +2 -2
- package/src/utils/KeyboardAware/index.ts +0 -13
- package/src/utils/KeyboardAware/keyboardHooks.ts +69 -79
- package/src/utils/hooks.ts +63 -36
- package/src/utils/index.ts +1 -0
- package/src/utils/locale.ts +7 -0
- package/src/utils/theme.ts +1 -21
- package/dist/components/ActionIcon/index.d.ts +0 -13
- package/dist/components/ActionIcon/index.js +0 -51
- package/dist/components/ActionIcon/index.js.map +0 -1
- package/dist/components/ActionIcon/styles.d.ts +0 -65
- package/dist/components/ActionIcon/styles.js +0 -61
- package/dist/components/ActionIcon/styles.js.map +0 -1
- package/dist/components/ActivityIndicator/index.d.ts +0 -15
- package/dist/components/ActivityIndicator/index.js +0 -55
- package/dist/components/ActivityIndicator/index.js.map +0 -1
- package/dist/components/ActivityIndicator/styles.d.ts +0 -59
- package/dist/components/ActivityIndicator/styles.js +0 -52
- package/dist/components/ActivityIndicator/styles.js.map +0 -1
- package/dist/components/Animated.d.ts +0 -15
- package/dist/components/Animated.js +0 -55
- package/dist/components/Animated.js.map +0 -1
- package/dist/components/AutoComplete/index.d.ts +0 -34
- package/dist/components/AutoComplete/index.js +0 -126
- package/dist/components/AutoComplete/index.js.map +0 -1
- package/dist/components/AutoComplete/styles.d.ts +0 -57
- package/dist/components/AutoComplete/styles.js +0 -89
- package/dist/components/AutoComplete/styles.js.map +0 -1
- package/dist/components/Backdrop/index.d.ts +0 -14
- package/dist/components/Backdrop/index.js +0 -59
- package/dist/components/Backdrop/index.js.map +0 -1
- package/dist/components/Backdrop/styles.d.ts +0 -53
- package/dist/components/Backdrop/styles.js +0 -28
- package/dist/components/Backdrop/styles.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -246
- package/dist/components/Button/index.js +0 -115
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/styles.d.ts +0 -65
- package/dist/components/Button/styles.js +0 -61
- package/dist/components/Button/styles.js.map +0 -1
- package/dist/components/Calendar/index.d.ts +0 -15
- package/dist/components/Calendar/index.js +0 -76
- package/dist/components/Calendar/index.js.map +0 -1
- package/dist/components/Calendar/style.d.ts +0 -4
- package/dist/components/Calendar/style.js +0 -36
- package/dist/components/Calendar/style.js.map +0 -1
- package/dist/components/Calendar/types.d.ts +0 -95
- package/dist/components/Calendar/types.js +0 -3
- package/dist/components/Calendar/types.js.map +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -15
- package/dist/components/Checkbox/index.js +0 -81
- package/dist/components/Checkbox/index.js.map +0 -1
- package/dist/components/Checkbox/styles.d.ts +0 -56
- package/dist/components/Checkbox/styles.js +0 -53
- package/dist/components/Checkbox/styles.js.map +0 -1
- package/dist/components/ContentView/index.d.ts +0 -12
- package/dist/components/ContentView/index.js +0 -62
- package/dist/components/ContentView/index.js.map +0 -1
- package/dist/components/ContentView/styles.d.ts +0 -53
- package/dist/components/ContentView/styles.js +0 -26
- package/dist/components/ContentView/styles.js.map +0 -1
- package/dist/components/Drawer/index.d.ts +0 -7
- package/dist/components/Drawer/index.js +0 -66
- package/dist/components/Drawer/index.js.map +0 -1
- package/dist/components/Drawer/styles.d.ts +0 -56
- package/dist/components/Drawer/styles.js +0 -39
- package/dist/components/Drawer/styles.js.map +0 -1
- package/dist/components/EmptyPlaceholder/index.d.ts +0 -25
- package/dist/components/EmptyPlaceholder/index.js +0 -88
- package/dist/components/EmptyPlaceholder/index.js.map +0 -1
- package/dist/components/EmptyPlaceholder/styles.d.ts +0 -55
- package/dist/components/EmptyPlaceholder/styles.js +0 -30
- package/dist/components/EmptyPlaceholder/styles.js.map +0 -1
- package/dist/components/FileInput/index.d.ts +0 -24
- package/dist/components/FileInput/index.js +0 -179
- package/dist/components/FileInput/index.js.map +0 -1
- package/dist/components/FileInput/styles.d.ts +0 -53
- package/dist/components/FileInput/styles.js +0 -19
- package/dist/components/FileInput/styles.js.map +0 -1
- package/dist/components/Grid/index.d.ts +0 -32
- package/dist/components/Grid/index.js +0 -80
- package/dist/components/Grid/index.js.map +0 -1
- package/dist/components/Grid/styles.d.ts +0 -54
- package/dist/components/Grid/styles.js +0 -19
- package/dist/components/Grid/styles.js.map +0 -1
- package/dist/components/Icon/index.d.ts +0 -14
- package/dist/components/Icon/index.js +0 -75
- package/dist/components/Icon/index.js.map +0 -1
- package/dist/components/Icon/styles.d.ts +0 -61
- package/dist/components/Icon/styles.js +0 -49
- package/dist/components/Icon/styles.js.map +0 -1
- package/dist/components/Image/index.d.ts +0 -25
- package/dist/components/Image/index.js +0 -130
- package/dist/components/Image/index.js.map +0 -1
- package/dist/components/Image/styles.d.ts +0 -55
- package/dist/components/Image/styles.js +0 -25
- package/dist/components/Image/styles.js.map +0 -1
- package/dist/components/ImageView/Spotlight.d.ts +0 -25
- package/dist/components/ImageView/Spotlight.js +0 -150
- package/dist/components/ImageView/Spotlight.js.map +0 -1
- package/dist/components/ImageView/component.d.ts +0 -5
- package/dist/components/ImageView/component.js +0 -50
- package/dist/components/ImageView/component.js.map +0 -1
- package/dist/components/ImageView/index.d.ts +0 -2
- package/dist/components/ImageView/index.js +0 -15
- package/dist/components/ImageView/index.js.map +0 -1
- package/dist/components/InputLabel/index.d.ts +0 -12
- package/dist/components/InputLabel/index.js +0 -58
- package/dist/components/InputLabel/index.js.map +0 -1
- package/dist/components/InputLabel/styles.d.ts +0 -4
- package/dist/components/InputLabel/styles.js +0 -26
- package/dist/components/InputLabel/styles.js.map +0 -1
- package/dist/components/List/PaginationIndicator.d.ts +0 -67
- package/dist/components/List/PaginationIndicator.js +0 -51
- package/dist/components/List/PaginationIndicator.js.map +0 -1
- package/dist/components/List/index.d.ts +0 -31
- package/dist/components/List/index.js +0 -77
- package/dist/components/List/index.js.map +0 -1
- package/dist/components/List/styles.d.ts +0 -54
- package/dist/components/List/styles.js +0 -28
- package/dist/components/List/styles.js.map +0 -1
- package/dist/components/LoadingOverlay/index.d.ts +0 -11
- package/dist/components/LoadingOverlay/index.js +0 -60
- package/dist/components/LoadingOverlay/index.js.map +0 -1
- package/dist/components/LoadingOverlay/styles.d.ts +0 -7
- package/dist/components/LoadingOverlay/styles.js +0 -34
- package/dist/components/LoadingOverlay/styles.js.map +0 -1
- package/dist/components/Modal/index.d.ts +0 -43
- package/dist/components/Modal/index.js +0 -147
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/styles.d.ts +0 -58
- package/dist/components/Modal/styles.js +0 -74
- package/dist/components/Modal/styles.js.map +0 -1
- package/dist/components/MultiSelect/index.d.ts +0 -6
- package/dist/components/MultiSelect/index.js +0 -119
- package/dist/components/MultiSelect/index.js.map +0 -1
- package/dist/components/MultiSelect/styles.d.ts +0 -7
- package/dist/components/MultiSelect/styles.js +0 -84
- package/dist/components/MultiSelect/styles.js.map +0 -1
- package/dist/components/MultiSelect/types.d.ts +0 -43
- package/dist/components/MultiSelect/types.js +0 -3
- package/dist/components/MultiSelect/types.js.map +0 -1
- package/dist/components/Navigation/Navigation.d.ts +0 -3
- package/dist/components/Navigation/Navigation.js +0 -80
- package/dist/components/Navigation/Navigation.js.map +0 -1
- package/dist/components/Navigation/constants.d.ts +0 -5
- package/dist/components/Navigation/constants.js +0 -11
- package/dist/components/Navigation/constants.js.map +0 -1
- package/dist/components/Navigation/index.d.ts +0 -3
- package/dist/components/Navigation/index.js +0 -16
- package/dist/components/Navigation/index.js.map +0 -1
- package/dist/components/Navigation/types.d.ts +0 -26
- package/dist/components/Navigation/types.js +0 -8
- package/dist/components/Navigation/types.js.map +0 -1
- package/dist/components/Navigation/utils.d.ts +0 -3
- package/dist/components/Navigation/utils.js +0 -69
- package/dist/components/Navigation/utils.js.map +0 -1
- package/dist/components/Pager/index.d.ts +0 -26
- package/dist/components/Pager/index.js +0 -84
- package/dist/components/Pager/index.js.map +0 -1
- package/dist/components/Pager/styles.d.ts +0 -87
- package/dist/components/Pager/styles.js +0 -72
- package/dist/components/Pager/styles.js.map +0 -1
- package/dist/components/RadioInput/index.d.ts +0 -27
- package/dist/components/RadioInput/index.js +0 -72
- package/dist/components/RadioInput/index.js.map +0 -1
- package/dist/components/RadioInput/styles.d.ts +0 -58
- package/dist/components/RadioInput/styles.js +0 -50
- package/dist/components/RadioInput/styles.js.map +0 -1
- package/dist/components/Scroll/index.d.ts +0 -124
- package/dist/components/Scroll/index.js +0 -97
- package/dist/components/Scroll/index.js.map +0 -1
- package/dist/components/Scroll/styles.d.ts +0 -53
- package/dist/components/Scroll/styles.js +0 -26
- package/dist/components/Scroll/styles.js.map +0 -1
- package/dist/components/Sections/index.d.ts +0 -115
- package/dist/components/Sections/index.js +0 -76
- package/dist/components/Sections/index.js.map +0 -1
- package/dist/components/SegmentedControl/index.d.ts +0 -52
- package/dist/components/SegmentedControl/index.js +0 -131
- package/dist/components/SegmentedControl/index.js.map +0 -1
- package/dist/components/SegmentedControl/styles.d.ts +0 -60
- package/dist/components/SegmentedControl/styles.js +0 -43
- package/dist/components/SegmentedControl/styles.js.map +0 -1
- package/dist/components/Select/index.d.ts +0 -16
- package/dist/components/Select/index.js +0 -122
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Select/styles.d.ts +0 -60
- package/dist/components/Select/styles.js +0 -83
- package/dist/components/Select/styles.js.map +0 -1
- package/dist/components/Select/types.d.ts +0 -43
- package/dist/components/Select/types.js +0 -3
- package/dist/components/Select/types.js.map +0 -1
- package/dist/components/Slider/Mark.d.ts +0 -3
- package/dist/components/Slider/Mark.js +0 -32
- package/dist/components/Slider/Mark.js.map +0 -1
- package/dist/components/Slider/Thumb.d.ts +0 -7
- package/dist/components/Slider/Thumb.js +0 -30
- package/dist/components/Slider/Thumb.js.map +0 -1
- package/dist/components/Slider/index.d.ts +0 -4
- package/dist/components/Slider/index.js +0 -99
- package/dist/components/Slider/index.js.map +0 -1
- package/dist/components/Slider/styles.d.ts +0 -54
- package/dist/components/Slider/styles.js +0 -61
- package/dist/components/Slider/styles.js.map +0 -1
- package/dist/components/Slider/types.d.ts +0 -26
- package/dist/components/Slider/types.js +0 -3
- package/dist/components/Slider/types.js.map +0 -1
- package/dist/components/Switch/index.d.ts +0 -14
- package/dist/components/Switch/index.js +0 -81
- package/dist/components/Switch/index.js.map +0 -1
- package/dist/components/Switch/styles.d.ts +0 -55
- package/dist/components/Switch/styles.js +0 -34
- package/dist/components/Switch/styles.js.map +0 -1
- package/dist/components/Text/index.d.ts +0 -25
- package/dist/components/Text/index.js +0 -121
- package/dist/components/Text/index.js.map +0 -1
- package/dist/components/Text/styles.d.ts +0 -70
- package/dist/components/Text/styles.js +0 -34
- package/dist/components/Text/styles.js.map +0 -1
- package/dist/components/TextInput/index.d.ts +0 -181
- package/dist/components/TextInput/index.js +0 -213
- package/dist/components/TextInput/index.js.map +0 -1
- package/dist/components/TextInput/styles.d.ts +0 -63
- package/dist/components/TextInput/styles.js +0 -65
- package/dist/components/TextInput/styles.js.map +0 -1
- package/dist/components/Touchable/index.d.ts +0 -22
- package/dist/components/Touchable/index.js +0 -165
- package/dist/components/Touchable/index.js.map +0 -1
- package/dist/components/Touchable/styles.d.ts +0 -58
- package/dist/components/Touchable/styles.js +0 -24
- package/dist/components/Touchable/styles.js.map +0 -1
- package/dist/components/View/index.d.ts +0 -25
- package/dist/components/View/index.js +0 -107
- package/dist/components/View/index.js.map +0 -1
- package/dist/components/View/styles.d.ts +0 -54
- package/dist/components/View/styles.js +0 -29
- package/dist/components/View/styles.js.map +0 -1
- package/dist/components/components.d.ts +0 -37
- package/dist/components/components.js +0 -50
- package/dist/components/components.js.map +0 -1
- package/dist/components/defaultStyles.d.ts +0 -1468
- package/dist/components/defaultStyles.js +0 -67
- package/dist/components/defaultStyles.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -39
- package/dist/index.js.map +0 -1
- package/dist/modules/documentPicker.d.ts +0 -3
- package/dist/modules/documentPicker.js +0 -12
- package/dist/modules/documentPicker.js.map +0 -1
- package/dist/modules/fastImage.d.ts +0 -1
- package/dist/modules/fastImage.js +0 -10
- package/dist/modules/fastImage.js.map +0 -1
- package/dist/modules/reactNavigation.d.ts +0 -5
- package/dist/modules/reactNavigation.js +0 -26
- package/dist/modules/reactNavigation.js.map +0 -1
- package/dist/modules/rnDeviceInfo.d.ts +0 -2
- package/dist/modules/rnDeviceInfo.js +0 -10
- package/dist/modules/rnDeviceInfo.js.map +0 -1
- package/dist/modules/textInputMask.d.ts +0 -10
- package/dist/modules/textInputMask.js +0 -19
- package/dist/modules/textInputMask.js.map +0 -1
- package/dist/modules/types/fileTypes.d.ts +0 -138
- package/dist/modules/types/fileTypes.js +0 -3
- package/dist/modules/types/fileTypes.js.map +0 -1
- package/dist/modules/types/textInputMask.d.ts +0 -7
- package/dist/modules/types/textInputMask.js +0 -3
- package/dist/modules/types/textInputMask.js.map +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -14
- package/dist/types/index.js.map +0 -1
- package/dist/types/utility.d.ts +0 -14
- package/dist/types/utility.js +0 -3
- package/dist/types/utility.js.map +0 -1
- package/dist/utils/KeyboardAware/context.d.ts +0 -13
- package/dist/utils/KeyboardAware/context.js +0 -63
- package/dist/utils/KeyboardAware/context.js.map +0 -1
- package/dist/utils/KeyboardAware/index.d.ts +0 -8
- package/dist/utils/KeyboardAware/index.js +0 -29
- package/dist/utils/KeyboardAware/index.js.map +0 -1
- package/dist/utils/KeyboardAware/keyboardHooks.d.ts +0 -26
- package/dist/utils/KeyboardAware/keyboardHooks.js +0 -87
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +0 -9
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +0 -67
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +0 -439
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +0 -7
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +0 -4
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +0 -10
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +0 -10
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +0 -1
- package/dist/utils/KeyboardAware/types.d.ts +0 -1
- package/dist/utils/KeyboardAware/types.js +0 -7
- package/dist/utils/KeyboardAware/types.js.map +0 -1
- package/dist/utils/ModalManager/components.d.ts +0 -20
- package/dist/utils/ModalManager/components.js +0 -114
- package/dist/utils/ModalManager/components.js.map +0 -1
- package/dist/utils/ModalManager/context.d.ts +0 -48
- package/dist/utils/ModalManager/context.js +0 -201
- package/dist/utils/ModalManager/context.js.map +0 -1
- package/dist/utils/ModalManager/index.d.ts +0 -11
- package/dist/utils/ModalManager/index.js +0 -13
- package/dist/utils/ModalManager/index.js.map +0 -1
- package/dist/utils/OSAlert.d.ts +0 -32
- package/dist/utils/OSAlert.js +0 -143
- package/dist/utils/OSAlert.js.map +0 -1
- package/dist/utils/PermissionManager/context.d.ts +0 -53
- package/dist/utils/PermissionManager/context.js +0 -320
- package/dist/utils/PermissionManager/context.js.map +0 -1
- package/dist/utils/PermissionManager/index.d.ts +0 -4
- package/dist/utils/PermissionManager/index.js +0 -9
- package/dist/utils/PermissionManager/index.js.map +0 -1
- package/dist/utils/PermissionManager/types.d.ts +0 -13
- package/dist/utils/PermissionManager/types.js +0 -3
- package/dist/utils/PermissionManager/types.js.map +0 -1
- package/dist/utils/hooks.d.ts +0 -61
- package/dist/utils/hooks.js +0 -233
- package/dist/utils/hooks.js.map +0 -1
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -36
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/input.d.ts +0 -35
- package/dist/utils/input.js +0 -49
- package/dist/utils/input.js.map +0 -1
- package/dist/utils/misc.d.ts +0 -6
- package/dist/utils/misc.js +0 -87
- package/dist/utils/misc.js.map +0 -1
- package/dist/utils/notifications.d.ts +0 -34
- package/dist/utils/notifications.js +0 -268
- package/dist/utils/notifications.js.map +0 -1
- package/dist/utils/theme.d.ts +0 -42
- package/dist/utils/theme.js +0 -50
- package/dist/utils/theme.js.map +0 -1
- package/src/components/Animated.tsx +0 -34
- package/src/components/AutoComplete/index.tsx +0 -167
- package/src/components/AutoComplete/styles.ts +0 -150
- package/src/components/MultiSelect/index.tsx +0 -148
- package/src/components/MultiSelect/styles.ts +0 -131
- package/src/components/MultiSelect/types.ts +0 -51
- package/src/components/Slider/Mark.tsx +0 -46
- package/src/components/Slider/Thumb.tsx +0 -29
- package/src/modules/textInputMask.ts +0 -11
- package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +0 -4
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +0 -592
- package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +0 -13
- package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +0 -6
- package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +0 -6
|
@@ -3,46 +3,45 @@ import { forwardRef } from 'react'
|
|
|
3
3
|
import {
|
|
4
4
|
useDefaultComponentStyle,
|
|
5
5
|
ComponentVariants,
|
|
6
|
+
useCallback,
|
|
7
|
+
useCodeleapContext,
|
|
6
8
|
} from '@codeleap/common'
|
|
7
9
|
|
|
8
|
-
import {
|
|
9
|
-
import { RefreshControl, StyleSheet, RefreshControlProps, ScrollView } from 'react-native'
|
|
10
|
+
import { StyleSheet, ListRenderItemInfo } from 'react-native'
|
|
10
11
|
import { View, ViewProps } from '../View'
|
|
11
|
-
import { EmptyPlaceholder
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { EmptyPlaceholder } from '../EmptyPlaceholder'
|
|
13
|
+
import { RefreshControl } from '../RefreshControl'
|
|
14
|
+
import { List } from '../List'
|
|
15
|
+
import { GridPresets } from './styles'
|
|
16
|
+
import { FlatListProps, AugmentedRenderItemInfo } from '../List'
|
|
17
|
+
import { KeyboardAwareFlatList } from 'react-native-keyboard-aware-scroll-view'
|
|
18
|
+
|
|
19
|
+
export * from './styles'
|
|
15
20
|
|
|
16
21
|
export type DataboundFlatGridPropsTypes = 'data' | 'renderItem' | 'keyExtractor' | 'getItemLayout'
|
|
17
22
|
|
|
18
|
-
export type
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onRefresh?: () => void
|
|
23
|
-
getItemLayout?: ((
|
|
24
|
-
data:T,
|
|
25
|
-
index: number,
|
|
26
|
-
) => { length: number; offset: number; index: number })
|
|
23
|
+
export type GridAugmentedRenderItemInfo<T> = AugmentedRenderItemInfo<T> & {
|
|
24
|
+
isFirstInRow: boolean
|
|
25
|
+
isLastInRow: boolean
|
|
26
|
+
isOnlyInRow: boolean
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
export * from './styles'
|
|
31
|
-
|
|
32
29
|
export type GridProps<
|
|
33
30
|
T = any[],
|
|
34
31
|
Data = T extends Array<infer D> ? D : never
|
|
35
|
-
> =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
> = Omit<FlatListProps<T, Data>, 'variants' | 'renderItem'> & ComponentVariants<typeof GridPresets> & {
|
|
33
|
+
spacing?: number
|
|
34
|
+
itemDimension?: number
|
|
35
|
+
renderItem: (data: GridAugmentedRenderItemInfo<T>) => React.ReactElement
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const RenderSeparator = (props: { separatorStyles: ViewProps['style'] }) => {
|
|
39
|
+
return (
|
|
40
|
+
<View style={props.separatorStyles}></View>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const GridCP = forwardRef<KeyboardAwareFlatList, GridProps>(
|
|
46
45
|
(flatGridProps, ref) => {
|
|
47
46
|
const {
|
|
48
47
|
variants = [],
|
|
@@ -51,68 +50,73 @@ const GridCP = forwardRef<ScrollView, GridProps>(
|
|
|
51
50
|
onRefresh,
|
|
52
51
|
refreshing,
|
|
53
52
|
placeholder,
|
|
54
|
-
keyboardAware,
|
|
55
|
-
debugName,
|
|
56
53
|
refreshControlProps = {},
|
|
54
|
+
spacing,
|
|
55
|
+
numColumns,
|
|
57
56
|
...props
|
|
58
57
|
} = flatGridProps
|
|
59
|
-
|
|
60
|
-
const variantStyles = useDefaultComponentStyle<'u:Grid', typeof
|
|
58
|
+
const { Theme } = useCodeleapContext()
|
|
59
|
+
const variantStyles = useDefaultComponentStyle<'u:Grid', typeof GridPresets>('u:Grid', {
|
|
61
60
|
variants,
|
|
62
61
|
styles,
|
|
63
62
|
transform: StyleSheet.flatten,
|
|
64
|
-
|
|
65
63
|
})
|
|
66
64
|
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
)
|
|
71
|
-
}
|
|
65
|
+
const renderItem = useCallback((data: ListRenderItemInfo<any>) => {
|
|
66
|
+
if (!props?.renderItem) return null
|
|
67
|
+
const listLength = props?.data?.length || 0
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const isFirst = data.index === 0
|
|
70
|
+
const isLast = data.index === listLength - 1
|
|
71
|
+
const isOnly = isFirst && isLast
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
const idx = data.index + 1
|
|
74
|
+
const isLastInRow = !isFirst && idx % (numColumns) === 0
|
|
75
|
+
const isFirstInRow = isFirst || data.index % numColumns === 0
|
|
76
|
+
const isOnlyInRow = !isFirstInRow && !isLastInRow
|
|
79
77
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
ref: ref ,
|
|
84
|
-
ItemSeparatorComponent: separator,
|
|
85
|
-
refreshControl:
|
|
86
|
-
!!onRefresh && (
|
|
87
|
-
<RefreshControl
|
|
88
|
-
refreshing={refreshing}
|
|
89
|
-
onRefresh={onRefresh}
|
|
90
|
-
tintColor={refreshStyles?.color}
|
|
91
|
-
colors={[refreshStyles?.color]}
|
|
92
|
-
{...refreshControlProps}
|
|
93
|
-
/>
|
|
94
|
-
),
|
|
78
|
+
let gap = Theme.spacing.marginRight(spacing / 2)
|
|
79
|
+
if (isLastInRow) gap = Theme.spacing.marginLeft(spacing / 2)
|
|
80
|
+
else if (isOnlyInRow) gap = Theme.spacing.marginHorizontal(spacing / 2)
|
|
95
81
|
|
|
96
|
-
|
|
82
|
+
const _itemProps = { isFirst, isLast, isOnly, isFirstInRow, isLastInRow, isOnlyInRow }
|
|
83
|
+
const RenderItem = props?.renderItem
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<View style={{ ...variantStyles.itemWrapper, ...gap }}>
|
|
87
|
+
<RenderItem {...data} {..._itemProps} />
|
|
88
|
+
</View>
|
|
89
|
+
)
|
|
90
|
+
}, [props?.renderItem, props?.data?.length])
|
|
91
|
+
|
|
92
|
+
const separatorStyles = { height: Theme.spacing.value(spacing), ...variantStyles.separator }
|
|
93
|
+
const separator = props?.separators || (!!spacing ? <RenderSeparator separatorStyles={separatorStyles}/> : null)
|
|
94
|
+
const refreshControl = !!onRefresh && <RefreshControl refreshing={refreshing} onRefresh={onRefresh} {...refreshControlProps}/>
|
|
95
|
+
const _gridProps = {
|
|
97
96
|
...props,
|
|
97
|
+
ref: ref,
|
|
98
|
+
ListEmptyComponent: <EmptyPlaceholder {...placeholder}/>,
|
|
99
|
+
ListHeaderComponentStyle: variantStyles.header,
|
|
100
|
+
ListFooterComponentStyle: variantStyles.footer,
|
|
101
|
+
ItemSeparatorComponent: separator,
|
|
102
|
+
refreshControl,
|
|
103
|
+
style: [variantStyles.wrapper, style],
|
|
104
|
+
contentContainerStyle: [variantStyles.content, props?.contentContainerStyle],
|
|
105
|
+
showsVerticalScrollIndicator: false,
|
|
106
|
+
numColumns,
|
|
107
|
+
renderItem,
|
|
98
108
|
}
|
|
99
|
-
|
|
100
|
-
debugName,
|
|
101
|
-
})
|
|
102
|
-
const gridProps = keyboard.getKeyboardAwareProps(_gridProps, {
|
|
103
|
-
baseStyleProp: 'contentContainerStyle',
|
|
104
|
-
adapt: 'paddingBottom',
|
|
105
|
-
...keyboardAware,
|
|
106
|
-
})
|
|
109
|
+
|
|
107
110
|
return (
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
<List
|
|
113
|
+
{..._gridProps}
|
|
110
114
|
/>
|
|
111
115
|
)
|
|
112
116
|
},
|
|
113
117
|
)
|
|
114
118
|
|
|
115
|
-
export type GridComponentType = <T extends any[] = any[]>(props:
|
|
119
|
+
export type GridComponentType = <T extends any[] = any[]>(props: GridProps<T>) => React.ReactElement
|
|
116
120
|
|
|
117
|
-
export const Grid = GridCP as GridComponentType
|
|
121
|
+
export const Grid = GridCP as unknown as GridComponentType
|
|
118
122
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { createDefaultVariantFactory } from '@codeleap/common'
|
|
2
|
-
import { ListComposition
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
import { ListComposition } from '../List'
|
|
3
3
|
|
|
4
|
-
export type GridComposition = ListComposition
|
|
4
|
+
export type GridComposition = ListComposition | 'itemWrapper' | 'footer'
|
|
5
5
|
|
|
6
6
|
const createGridStyle = createDefaultVariantFactory<GridComposition>()
|
|
7
7
|
|
|
8
|
-
export const
|
|
9
|
-
...ListStyles,
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
export const GridPresets = includePresets(style => createGridStyle(() => ({ content: style })))
|
|
@@ -8,32 +8,51 @@ import {
|
|
|
8
8
|
IconPlaceholder,
|
|
9
9
|
onMount,
|
|
10
10
|
onUpdate,
|
|
11
|
+
PropsOf,
|
|
12
|
+
StylesOf,
|
|
13
|
+
TypeGuards,
|
|
14
|
+
getNestedStylesByKey,
|
|
11
15
|
} from '@codeleap/common'
|
|
12
16
|
import { StyleSheet } from 'react-native'
|
|
13
17
|
import { View } from '../View'
|
|
14
18
|
export * from './styles'
|
|
15
19
|
|
|
16
20
|
import {
|
|
17
|
-
|
|
21
|
+
IconComposition,
|
|
22
|
+
IconPresets,
|
|
18
23
|
} from './styles'
|
|
24
|
+
import { Badge, BadgeComponentProps } from '../Badge'
|
|
19
25
|
|
|
20
26
|
export type IconProps = {
|
|
21
27
|
name: IconPlaceholder
|
|
22
28
|
style?: any
|
|
23
29
|
color?: string
|
|
24
|
-
variants?: ComponentVariants<typeof
|
|
25
|
-
|
|
30
|
+
variants?: ComponentVariants<typeof IconPresets>['variants']
|
|
31
|
+
wrapperProps?: Partial<PropsOf<typeof View>>
|
|
26
32
|
size?: number
|
|
27
|
-
|
|
33
|
+
styles?: StylesOf<IconComposition>
|
|
34
|
+
} & BadgeComponentProps
|
|
35
|
+
|
|
36
|
+
export const IconComponent: React.FC<IconProps> = (props) => {
|
|
37
|
+
const {
|
|
38
|
+
name,
|
|
39
|
+
style,
|
|
40
|
+
variants,
|
|
41
|
+
badge = false,
|
|
42
|
+
badgeProps = {},
|
|
43
|
+
wrapperProps = {},
|
|
44
|
+
styles = {},
|
|
45
|
+
...otherProps
|
|
46
|
+
} = props
|
|
28
47
|
|
|
29
|
-
export const IconComponent: React.FC<IconProps> = ({ name, style, variants, renderEmptySpace, ...otherProps }) => {
|
|
30
48
|
const { Theme, logger } = useCodeleapContext()
|
|
31
49
|
|
|
32
|
-
const variantStyles = useDefaultComponentStyle<'u:Icon', typeof
|
|
50
|
+
const variantStyles = useDefaultComponentStyle<'u:Icon', typeof IconPresets>('u:Icon', {
|
|
33
51
|
variants,
|
|
34
52
|
transform: StyleSheet.flatten,
|
|
35
53
|
styles: {
|
|
36
54
|
icon: style,
|
|
55
|
+
...styles,
|
|
37
56
|
},
|
|
38
57
|
rootElement: 'icon',
|
|
39
58
|
})
|
|
@@ -48,8 +67,27 @@ export const IconComponent: React.FC<IconProps> = ({ name, style, variants, rend
|
|
|
48
67
|
}
|
|
49
68
|
}, [name])
|
|
50
69
|
|
|
70
|
+
if (badge || TypeGuards.isNumber(badge)) {
|
|
71
|
+
const badgeStyles = getNestedStylesByKey('badge', variantStyles)
|
|
72
|
+
|
|
73
|
+
const sized = {
|
|
74
|
+
height: variantStyles.icon?.size || variantStyles.icon?.height || props?.size,
|
|
75
|
+
width: variantStyles.icon?.size || variantStyles.icon?.width || props?.size,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const wrapperStyle = [
|
|
79
|
+
sized,
|
|
80
|
+
(variantStyles.iconBadgeWrapper ?? {}),
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
return <View {...wrapperProps} style={wrapperStyle}>
|
|
84
|
+
<Component {...otherProps} style={variantStyles.icon} />
|
|
85
|
+
<Badge styles={badgeStyles} badge={badge} {...badgeProps} />
|
|
86
|
+
</View>
|
|
87
|
+
}
|
|
88
|
+
|
|
51
89
|
if (!name) {
|
|
52
|
-
return
|
|
90
|
+
return null
|
|
53
91
|
}
|
|
54
92
|
|
|
55
93
|
if (!Component) {
|
|
@@ -60,7 +98,7 @@ export const IconComponent: React.FC<IconProps> = ({ name, style, variants, rend
|
|
|
60
98
|
}
|
|
61
99
|
|
|
62
100
|
function areEqual(prevProps, nextProps) {
|
|
63
|
-
const check = ['name', 'style', 'variants', 'renderEmptySpace']
|
|
101
|
+
const check = ['name', 'style', 'variants', 'renderEmptySpace', 'badgeProps', 'badge']
|
|
64
102
|
const res = arePropsEqual(prevProps, nextProps, { check })
|
|
65
103
|
return res
|
|
66
104
|
}
|
|
@@ -1,57 +1,9 @@
|
|
|
1
1
|
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
import { BadgeComposition } from '../Badge'
|
|
2
3
|
|
|
3
|
-
export type IconComposition = 'icon'
|
|
4
|
+
export type IconComposition = 'icon' | 'iconBadgeWrapper' | `badge${Capitalize<BadgeComposition>}`
|
|
4
5
|
|
|
5
6
|
const createIconStyle = createDefaultVariantFactory<IconComposition>()
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
+
export const IconPresets = includePresets((styles) => createIconStyle(() => ({ icon: styles })))
|
|
8
9
|
|
|
9
|
-
export const IconStyles = {
|
|
10
|
-
...presets,
|
|
11
|
-
default: createIconStyle((theme) => ({
|
|
12
|
-
icon: {
|
|
13
|
-
color: theme.colors.icon,
|
|
14
|
-
},
|
|
15
|
-
})),
|
|
16
|
-
originalColor: createIconStyle(theme => ({
|
|
17
|
-
icon: {
|
|
18
|
-
color: 'auto',
|
|
19
|
-
},
|
|
20
|
-
})),
|
|
21
|
-
white: createIconStyle((theme) => ({
|
|
22
|
-
icon: {
|
|
23
|
-
color: theme.colors.white,
|
|
24
|
-
},
|
|
25
|
-
})),
|
|
26
|
-
|
|
27
|
-
primary: createIconStyle((theme) => ({
|
|
28
|
-
icon: {
|
|
29
|
-
color: theme.colors.primary,
|
|
30
|
-
},
|
|
31
|
-
})),
|
|
32
|
-
negative: createIconStyle((theme) => ({
|
|
33
|
-
icon: {
|
|
34
|
-
color: theme.colors.negative,
|
|
35
|
-
},
|
|
36
|
-
})),
|
|
37
|
-
positive: createIconStyle((theme) => ({
|
|
38
|
-
icon: {
|
|
39
|
-
color: theme.colors.positive,
|
|
40
|
-
},
|
|
41
|
-
})),
|
|
42
|
-
small: createIconStyle((theme) => ({
|
|
43
|
-
icon: {
|
|
44
|
-
...theme.sized(1),
|
|
45
|
-
},
|
|
46
|
-
})),
|
|
47
|
-
medium: createIconStyle((theme) => ({
|
|
48
|
-
icon: {
|
|
49
|
-
...theme.sized(2),
|
|
50
|
-
},
|
|
51
|
-
})),
|
|
52
|
-
large: createIconStyle((theme) => ({
|
|
53
|
-
icon: {
|
|
54
|
-
...theme.sized(3),
|
|
55
|
-
},
|
|
56
|
-
})),
|
|
57
|
-
}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import { FastImage } from '../../modules/fastImage'
|
|
22
22
|
import {
|
|
23
23
|
ImageComposition,
|
|
24
|
-
|
|
24
|
+
ImagePresets,
|
|
25
25
|
} from './styles'
|
|
26
26
|
import { useImageSpotlight } from '../ImageView/Spotlight'
|
|
27
27
|
import { Touchable } from '../Touchable'
|
|
@@ -31,7 +31,7 @@ import { StylesOf } from '../../types'
|
|
|
31
31
|
export * from './styles'
|
|
32
32
|
type NativeImageProps = ComponentPropsWithoutRef<typeof NativeImage>
|
|
33
33
|
export type ImageProps = Omit<NativeImageProps, 'source' | 'style'> & {
|
|
34
|
-
variants?: ComponentVariants<typeof
|
|
34
|
+
variants?: ComponentVariants<typeof ImagePresets>['variants']
|
|
35
35
|
fast?: boolean
|
|
36
36
|
styles?: StylesOf<ImageComposition>
|
|
37
37
|
style?: StyleProp<ImageStyle | TextStyle | ViewStyle>
|
|
@@ -48,9 +48,6 @@ export type ImageProps = Omit<NativeImageProps, 'source' | 'style'> & {
|
|
|
48
48
|
withLoadingOverlay?: boolean | React.FC<LoadingOverlayProps>
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
51
|
export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
55
52
|
const {
|
|
56
53
|
variants,
|
|
@@ -65,11 +62,11 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
|
65
62
|
...imageProps
|
|
66
63
|
} = props
|
|
67
64
|
|
|
68
|
-
const variantStyles = useDefaultComponentStyle<'u:Image', typeof
|
|
65
|
+
const variantStyles = useDefaultComponentStyle<'u:Image', typeof ImagePresets>('u:Image', { variants, styles: componentStyleSheet, transform: StyleSheet.flatten })
|
|
69
66
|
const [loading, setLoading] = React.useState(false)
|
|
70
67
|
|
|
71
68
|
const styles = StyleSheet.flatten([variantStyles.wrapper, style])
|
|
72
|
-
|
|
69
|
+
|
|
73
70
|
let imSource = source
|
|
74
71
|
if (isFile(imSource)) {
|
|
75
72
|
imSource = toMultipartFile(imSource)
|
|
@@ -86,7 +83,7 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
const aspectRatioStyle = React.useMemo(() => {
|
|
89
|
-
if (!maintainAspectRatio|| !imSource) return null
|
|
86
|
+
if (!maintainAspectRatio || !imSource) return null
|
|
90
87
|
try {
|
|
91
88
|
// @ts-ignore
|
|
92
89
|
const assetSource = NativeImage.resolveAssetSource(imSource)
|
|
@@ -109,17 +106,17 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
|
109
106
|
|
|
110
107
|
const loadProps = React.useRef({
|
|
111
108
|
onLoadStart: () => {
|
|
112
|
-
if(withLoadingOverlay) {
|
|
109
|
+
if (withLoadingOverlay) {
|
|
113
110
|
setTimeout(() => {
|
|
114
|
-
if(!loadEndedEarly.current){
|
|
111
|
+
if (!loadEndedEarly.current) {
|
|
115
112
|
setLoading(true)
|
|
116
113
|
}
|
|
117
|
-
},60)
|
|
114
|
+
}, 60)
|
|
118
115
|
}
|
|
119
116
|
}, onLoadEnd: () => {
|
|
120
117
|
loadEndedEarly.current = true
|
|
121
|
-
if(withLoadingOverlay) setLoading(false)
|
|
122
|
-
}
|
|
118
|
+
if (withLoadingOverlay) setLoading(false)
|
|
119
|
+
},
|
|
123
120
|
})
|
|
124
121
|
|
|
125
122
|
const Loading = TypeGuards.isFunction(withLoadingOverlay) ? withLoadingOverlay : LoadingOverlay
|
|
@@ -127,14 +124,13 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
|
127
124
|
|
|
128
125
|
const overlayStyle = React.useMemo(() => getNestedStylesByKey('overlay', variantStyles), [variantStyles])
|
|
129
126
|
|
|
130
|
-
const loadingElement = React.useMemo(() =>
|
|
127
|
+
const loadingElement = React.useMemo(() => {
|
|
131
128
|
return showLoading ? (
|
|
132
129
|
<Loading visible={loading} styles={overlayStyle}/>
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
|
|
131
|
+
) : null
|
|
135
132
|
}, [showLoading, loading])
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
|
|
138
134
|
if (fast) {
|
|
139
135
|
return (
|
|
140
136
|
<Wrapper {...wrapperProps}>
|
|
@@ -153,10 +149,10 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
|
153
149
|
)
|
|
154
150
|
}
|
|
155
151
|
return <Wrapper {...wrapperProps}>
|
|
156
|
-
<NativeImage
|
|
157
|
-
style={[aspectRatioStyle, styles]}
|
|
158
|
-
resizeMode={resizeMode}
|
|
159
|
-
source={imSource} {...(imageProps as any)}
|
|
152
|
+
<NativeImage
|
|
153
|
+
style={[aspectRatioStyle, styles]}
|
|
154
|
+
resizeMode={resizeMode}
|
|
155
|
+
source={imSource} {...(imageProps as any)}
|
|
160
156
|
{...loadProps.current}
|
|
161
157
|
/>
|
|
162
158
|
{
|
|
@@ -4,18 +4,5 @@ import { LoadingOverlayComposition } from '../LoadingOverlay/styles'
|
|
|
4
4
|
export type ImageComposition = 'wrapper' | 'touchable' | `overlay${Capitalize<LoadingOverlayComposition>}`
|
|
5
5
|
const createImageStyle = createDefaultVariantFactory<ImageComposition>()
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
)
|
|
7
|
+
export const ImagePresets = includePresets((styles) => createImageStyle(() => ({ wrapper: styles, touchable: styles })))
|
|
9
8
|
|
|
10
|
-
export const ImageStyles = {
|
|
11
|
-
...presets,
|
|
12
|
-
default: createImageStyle(() => ({
|
|
13
|
-
wrapper: {},
|
|
14
|
-
})),
|
|
15
|
-
|
|
16
|
-
round: createImageStyle(() => ({
|
|
17
|
-
wrapper: {
|
|
18
|
-
borderRadius: 100,
|
|
19
|
-
},
|
|
20
|
-
})),
|
|
21
|
-
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react'
|
|
2
2
|
import { deepEqual, onUpdate, ReactState, TypeGuards, usePrevious, useUnmount } from '@codeleap/common'
|
|
3
|
-
|
|
4
|
-
import { ImageSource } from 'react-native-image-viewing/dist/@types'
|
|
3
|
+
|
|
5
4
|
import uuid from 'react-native-uuid'
|
|
6
5
|
import { ImageView } from './component'
|
|
7
6
|
import { ImageProps } from '../Image'
|
|
7
|
+
import {ImageURISource, ImageRequireSource} from 'react-native'
|
|
8
|
+
type ImageSource = ImageURISource | ImageRequireSource
|
|
9
|
+
|
|
8
10
|
type TImage = {
|
|
9
11
|
source: ImageSource
|
|
10
12
|
created: number
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import { onUpdate, PropsOf } from '@codeleap/common'
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
4
|
import _ImageView from 'react-native-image-viewing'
|
|
7
5
|
import { StatusBar } from 'react-native'
|
|
8
6
|
import { View } from '../View'
|
|
@@ -24,7 +22,6 @@ export type ImageViewProps = PropsOf<typeof _ImageView>
|
|
|
24
22
|
export const ImageView: React.FC<ImageViewProps> = (props) => {
|
|
25
23
|
onUpdate(() => {
|
|
26
24
|
StatusBar.setHidden(props.visible)
|
|
27
|
-
// StatusBar.setBarStyle(`${props.visible ? 'light' : 'dark'}-content`)
|
|
28
25
|
}, [props.visible])
|
|
29
26
|
|
|
30
27
|
return (
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { TypeGuards, getRenderedComponent } from '@codeleap/common'
|
|
3
|
+
import { ActionIcon, ActionIconProps } from '../ActionIcon'
|
|
4
|
+
import { View } from '../View'
|
|
5
|
+
import { useInputBaseStyles } from './styles'
|
|
6
|
+
import { InputBaseProps } from './types'
|
|
7
|
+
import { Text } from '../Text'
|
|
8
|
+
|
|
9
|
+
export * from './styles'
|
|
10
|
+
export * from './utils'
|
|
11
|
+
export * from './types'
|
|
12
|
+
|
|
13
|
+
export const InputBaseDefaultOrder:InputBaseProps['order'] = [
|
|
14
|
+
'label',
|
|
15
|
+
'description',
|
|
16
|
+
'innerWrapper',
|
|
17
|
+
'error',
|
|
18
|
+
]
|
|
19
|
+
const KeyPassthrough = (props: React.PropsWithChildren<any>) => {
|
|
20
|
+
return <>{props.children}</>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const InputBase = React.forwardRef<any, InputBaseProps>((props, ref) => {
|
|
24
|
+
const {
|
|
25
|
+
children,
|
|
26
|
+
error = null,
|
|
27
|
+
label,
|
|
28
|
+
description = null,
|
|
29
|
+
leftIcon = null,
|
|
30
|
+
rightIcon = null,
|
|
31
|
+
styles,
|
|
32
|
+
wrapper,
|
|
33
|
+
debugName,
|
|
34
|
+
innerWrapper,
|
|
35
|
+
focused,
|
|
36
|
+
innerWrapperProps = {},
|
|
37
|
+
wrapperProps = {},
|
|
38
|
+
disabled = false,
|
|
39
|
+
order = InputBaseDefaultOrder,
|
|
40
|
+
style,
|
|
41
|
+
labelAsRow = false,
|
|
42
|
+
hideErrorMessage = false,
|
|
43
|
+
...otherProps
|
|
44
|
+
} = props
|
|
45
|
+
|
|
46
|
+
const WrapperComponent = wrapper || View
|
|
47
|
+
const InnerWrapperComponent = innerWrapper || View
|
|
48
|
+
|
|
49
|
+
const _styles = useInputBaseStyles(props)
|
|
50
|
+
|
|
51
|
+
const _leftIcon = getRenderedComponent<Partial<ActionIconProps>>(leftIcon, ActionIcon, {
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
styles: _styles.leftIconStyles,
|
|
54
|
+
debugName: `${debugName} left icon`,
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const _rightIcon = getRenderedComponent<Partial<ActionIconProps>>(rightIcon, ActionIcon, {
|
|
58
|
+
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
styles: _styles.rightIconStyles,
|
|
61
|
+
debugName: `${debugName} right icon`,
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const _label = TypeGuards.isString(label) ? <Text text={label} style={_styles.labelStyle}/> : label
|
|
65
|
+
|
|
66
|
+
const _error = TypeGuards.isString(error) ? <Text text={error} style={_styles.errorStyle}/> : error
|
|
67
|
+
|
|
68
|
+
const _description = TypeGuards.isString(description) ? <Text text={description} style={_styles.descriptionStyle}/> : description
|
|
69
|
+
|
|
70
|
+
const parts = {
|
|
71
|
+
label: labelAsRow ? <View style={_styles.labelRowStyle}>
|
|
72
|
+
{_label}
|
|
73
|
+
{_description}
|
|
74
|
+
</View> : _label,
|
|
75
|
+
description: labelAsRow ? null : _description,
|
|
76
|
+
innerWrapper: <InnerWrapperComponent style={[
|
|
77
|
+
_styles.innerWrapperStyle,
|
|
78
|
+
]} {...innerWrapperProps}>
|
|
79
|
+
{_leftIcon}
|
|
80
|
+
{children}
|
|
81
|
+
{_rightIcon}
|
|
82
|
+
</InnerWrapperComponent>,
|
|
83
|
+
error: hideErrorMessage ? null : (
|
|
84
|
+
_error || <Text text={''} style={_styles.errorStyle}/>
|
|
85
|
+
),
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return <WrapperComponent
|
|
89
|
+
style={[_styles.wrapperStyle, style]}
|
|
90
|
+
{...otherProps}
|
|
91
|
+
{...wrapperProps}
|
|
92
|
+
>
|
|
93
|
+
{
|
|
94
|
+
order.map((key) => <KeyPassthrough key={key}>
|
|
95
|
+
{parts[key]}
|
|
96
|
+
</KeyPassthrough>)
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
</WrapperComponent>
|
|
101
|
+
})
|