react-native-system-ui 0.0.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -31
- package/dist/cjs/components/action-sheet/ActionSheet.js +97 -105
- package/dist/cjs/components/action-sheet/tokens.js +16 -27
- package/dist/cjs/components/area/Area.js +54 -67
- package/dist/cjs/components/area/tokens.js +6 -3
- package/dist/cjs/components/avatar/Avatar.js +25 -23
- package/dist/cjs/components/badge/Badge.js +31 -31
- package/dist/cjs/components/badge/tokens.js +6 -8
- package/dist/cjs/components/button/Button.js +115 -151
- package/dist/cjs/components/button/ButtonGroup.js +8 -42
- package/dist/cjs/components/button/tokens.js +1 -8
- package/dist/cjs/components/calendar/Calendar.js +212 -223
- package/dist/cjs/components/calendar/tokens.js +3 -3
- package/dist/cjs/components/cascader/Cascader.js +177 -180
- package/dist/cjs/components/cascader/tokens.js +2 -2
- package/dist/cjs/components/cascader/useCascaderExtend.js +25 -29
- package/dist/cjs/components/cell/Cell.js +70 -83
- package/dist/cjs/components/cell/CellGroup.js +16 -29
- package/dist/cjs/components/checkbox/Checkbox.js +139 -132
- package/dist/cjs/components/checkbox/CheckboxGroup.js +4 -35
- package/dist/cjs/components/checkbox/tokens.js +7 -10
- package/dist/cjs/components/circle/Circle.js +25 -24
- package/dist/cjs/components/collapse/Collapse.js +75 -91
- package/dist/cjs/components/config-provider/ConfigProvider.js +16 -3
- package/dist/cjs/components/config-provider/DirectionContext.js +15 -0
- package/dist/cjs/components/config-provider/index.js +7 -0
- package/dist/cjs/components/config-provider/locale/en-US.js +32 -0
- package/dist/cjs/components/config-provider/locale/zh-CN.js +32 -0
- package/dist/cjs/components/config-provider/useDirection.js +16 -0
- package/dist/cjs/components/count-down/CountDown.js +20 -15
- package/dist/cjs/components/datetime-picker/DatetimePicker.js +61 -84
- package/dist/cjs/components/datetime-picker/tokens.js +14 -3
- package/dist/cjs/components/dialog/Dialog.js +153 -121
- package/dist/cjs/components/dialog/imperative.js +17 -30
- package/dist/cjs/components/divider/Divider.js +26 -28
- package/dist/cjs/components/empty/Empty.js +35 -39
- package/dist/cjs/components/error-boundary/ErrorBoundary.js +73 -0
- package/dist/cjs/components/error-boundary/index.js +19 -0
- package/dist/cjs/components/field/Field.js +109 -106
- package/dist/cjs/components/flex/Flex.js +18 -18
- package/dist/cjs/components/flex/FlexItem.js +26 -27
- package/dist/cjs/components/form/Form.js +142 -161
- package/dist/cjs/components/form/FormItem.js +69 -97
- package/dist/cjs/components/form/FormList.js +49 -37
- package/dist/cjs/components/form/tokens.js +6 -3
- package/dist/cjs/components/form/utils.js +15 -34
- package/dist/cjs/components/grid/Grid.js +30 -29
- package/dist/cjs/components/grid/GridItem.js +84 -85
- package/dist/cjs/components/image/Image.js +55 -59
- package/dist/cjs/components/image/tokens.js +2 -2
- package/dist/cjs/components/image-preview/ImagePreview.js +124 -112
- package/dist/cjs/components/image-preview/imperative.js +4 -13
- package/dist/cjs/components/index.js +13 -0
- package/dist/cjs/components/input/Input.js +30 -22
- package/dist/cjs/components/loading/Loading.js +14 -15
- package/dist/cjs/components/nav-bar/NavBar.js +68 -83
- package/dist/cjs/components/nav-bar/tokens.js +1 -9
- package/dist/cjs/components/notice-bar/NoticeBar.js +74 -77
- package/dist/cjs/components/notify/Notify.js +88 -84
- package/dist/cjs/components/notify/imperative.js +20 -43
- package/dist/cjs/components/notify/tokens.js +1 -11
- package/dist/cjs/components/number-keyboard/NumberKeyboard.js +187 -209
- package/dist/cjs/components/overlay/Overlay.js +37 -52
- package/dist/cjs/components/overlay/tokens.js +5 -3
- package/dist/cjs/components/password-input/PasswordInput.js +98 -79
- package/dist/cjs/components/picker/Picker.js +440 -421
- package/dist/cjs/components/picker/tokens.js +1 -1
- package/dist/cjs/components/popup/Popup.js +263 -293
- package/dist/cjs/components/portal/Portal.js +12 -29
- package/dist/cjs/components/portal/PortalHost.js +151 -234
- package/dist/cjs/components/progress/Progress.js +51 -48
- package/dist/cjs/components/radio/Radio.js +45 -42
- package/dist/cjs/components/radio/RadioGroup.js +8 -40
- package/dist/cjs/components/radio/tokens.js +7 -10
- package/dist/cjs/components/safe-area-view/SafeAreaView.js +22 -26
- package/dist/cjs/components/search/Search.js +51 -43
- package/dist/cjs/components/selector/Selector.js +14 -13
- package/dist/cjs/components/share-sheet/ShareSheet.js +160 -161
- package/dist/cjs/components/sidebar/Sidebar.js +39 -45
- package/dist/cjs/components/sidebar/SidebarContext.js +1 -2
- package/dist/cjs/components/sidebar/SidebarItem.js +13 -16
- package/dist/cjs/components/sidebar/tokens.js +1 -3
- package/dist/cjs/components/skeleton/Skeleton.js +30 -37
- package/dist/cjs/components/skeleton/tokens.js +1 -2
- package/dist/cjs/components/slider/Slider.js +156 -135
- package/dist/cjs/components/space/Space.js +46 -69
- package/dist/cjs/components/stepper/Stepper.js +177 -155
- package/dist/cjs/components/swiper/Swiper.js +251 -253
- package/dist/cjs/components/swiper/SwiperPagIndicator.js +25 -27
- package/dist/cjs/components/swiper/tokens.js +10 -3
- package/dist/cjs/components/switch/Switch.js +13 -15
- package/dist/cjs/components/tabbar/Tabbar.js +35 -27
- package/dist/cjs/components/tabbar/TabbarContext.js +1 -2
- package/dist/cjs/components/tabbar/TabbarItem.js +65 -68
- package/dist/cjs/components/tabs/Tabs.js +286 -313
- package/dist/cjs/components/tag/Tag.js +46 -37
- package/dist/cjs/components/toast/Toast.js +90 -90
- package/dist/cjs/components/toast/imperative.js +16 -41
- package/dist/cjs/components/typography/Typography.js +3 -5
- package/dist/cjs/components/water-mark/WaterMark.js +31 -29
- package/dist/cjs/design-system/ThemeProvider.js +5 -11
- package/dist/cjs/design-system/createComponentTokensHook.js +11 -13
- package/dist/cjs/design-system/presets.js +2 -3
- package/dist/cjs/design-system/tokens.js +2 -11
- package/dist/cjs/hooks/animation/index.js +25 -0
- package/dist/cjs/hooks/animation/useAnimatedTransition.js +72 -0
- package/dist/cjs/hooks/animation/useReducedMotion.js +75 -0
- package/dist/cjs/hooks/aria/useAriaListBox.js +8 -16
- package/dist/cjs/hooks/aria/useAriaOverlay.js +3 -3
- package/dist/cjs/hooks/aria/useAriaPress.js +8 -21
- package/dist/cjs/hooks/aria/useAriaToggle.js +3 -3
- package/dist/cjs/hooks/gesture/useGestureScroll.js +60 -61
- package/dist/cjs/hooks/index.js +12 -0
- package/dist/cjs/hooks/overlay/OverlayStackStore.js +49 -69
- package/dist/cjs/hooks/overlay/useOverlayStack.js +13 -19
- package/dist/cjs/hooks/useControllableValue.js +10 -21
- package/dist/cjs/hooks/useCountDown.js +14 -22
- package/dist/cjs/hooks/useHairline.js +17 -29
- package/dist/cjs/hooks/useSafeAreaPadding.js +1 -4
- package/dist/cjs/index.js +67 -1
- package/dist/cjs/platform/animation.js +10 -2
- package/dist/cjs/platform/measure.js +18 -36
- package/dist/cjs/utils/color.js +21 -35
- package/dist/cjs/utils/compare.js +7 -12
- package/dist/cjs/utils/createPlatformShadow.js +28 -39
- package/dist/cjs/utils/date.js +20 -50
- package/dist/cjs/utils/deepMerge.js +16 -26
- package/dist/cjs/utils/hairline.js +74 -71
- package/dist/cjs/utils/index.js +22 -0
- package/dist/cjs/utils/number.js +21 -29
- package/dist/cjs/utils/render.js +27 -0
- package/dist/cjs/utils/rtl.js +25 -0
- package/dist/cjs/utils/string.js +8 -25
- package/dist/es/components/action-sheet/ActionSheet.js +99 -107
- package/dist/es/components/action-sheet/tokens.js +16 -27
- package/dist/es/components/area/Area.js +55 -68
- package/dist/es/components/area/tokens.js +6 -3
- package/dist/es/components/avatar/Avatar.js +25 -23
- package/dist/es/components/avatar/index.js +1 -2
- package/dist/es/components/badge/Badge.js +33 -33
- package/dist/es/components/badge/tokens.js +6 -8
- package/dist/es/components/button/Button.js +116 -152
- package/dist/es/components/button/ButtonGroup.js +9 -43
- package/dist/es/components/button/tokens.js +2 -3
- package/dist/es/components/calendar/Calendar.js +214 -225
- package/dist/es/components/calendar/tokens.js +3 -3
- package/dist/es/components/cascader/Cascader.js +180 -183
- package/dist/es/components/cascader/tokens.js +2 -2
- package/dist/es/components/cascader/useCascaderExtend.js +25 -29
- package/dist/es/components/cell/Cell.js +71 -84
- package/dist/es/components/cell/CellGroup.js +16 -28
- package/dist/es/components/checkbox/Checkbox.js +140 -133
- package/dist/es/components/checkbox/CheckboxGroup.js +5 -36
- package/dist/es/components/checkbox/tokens.js +7 -10
- package/dist/es/components/circle/Circle.js +25 -23
- package/dist/es/components/collapse/Collapse.js +77 -92
- package/dist/es/components/config-provider/ConfigProvider.js +10 -3
- package/dist/es/components/config-provider/DirectionContext.js +2 -0
- package/dist/es/components/config-provider/index.js +1 -0
- package/dist/es/components/config-provider/locale/en-US.js +32 -0
- package/dist/es/components/config-provider/locale/zh-CN.js +32 -0
- package/dist/es/components/config-provider/useDirection.js +3 -0
- package/dist/es/components/count-down/CountDown.js +23 -18
- package/dist/es/components/datetime-picker/DatetimePicker.js +61 -84
- package/dist/es/components/datetime-picker/tokens.js +14 -3
- package/dist/es/components/dialog/Dialog.js +154 -121
- package/dist/es/components/dialog/imperative.js +17 -30
- package/dist/es/components/divider/Divider.js +28 -29
- package/dist/es/components/empty/Empty.js +36 -39
- package/dist/es/components/error-boundary/ErrorBoundary.js +61 -0
- package/dist/es/components/error-boundary/index.js +1 -0
- package/dist/es/components/field/Field.js +109 -106
- package/dist/es/components/flex/Flex.js +18 -17
- package/dist/es/components/flex/FlexItem.js +27 -27
- package/dist/es/components/form/Form.js +143 -162
- package/dist/es/components/form/FormItem.js +68 -95
- package/dist/es/components/form/FormList.js +49 -37
- package/dist/es/components/form/tokens.js +6 -3
- package/dist/es/components/form/utils.js +15 -34
- package/dist/es/components/grid/Grid.js +30 -28
- package/dist/es/components/grid/GridItem.js +84 -84
- package/dist/es/components/image/Image.js +58 -62
- package/dist/es/components/image/tokens.js +2 -2
- package/dist/es/components/image-preview/ImagePreview.js +124 -112
- package/dist/es/components/image-preview/imperative.js +4 -13
- package/dist/es/components/index.js +3 -1
- package/dist/es/components/input/Input.js +31 -23
- package/dist/es/components/loading/Loading.js +16 -16
- package/dist/es/components/nav-bar/NavBar.js +68 -83
- package/dist/es/components/nav-bar/tokens.js +1 -3
- package/dist/es/components/notice-bar/NoticeBar.js +74 -76
- package/dist/es/components/notify/Notify.js +92 -87
- package/dist/es/components/notify/imperative.js +21 -44
- package/dist/es/components/notify/tokens.js +1 -5
- package/dist/es/components/number-keyboard/NumberKeyboard.js +187 -209
- package/dist/es/components/overlay/Overlay.js +36 -51
- package/dist/es/components/overlay/tokens.js +5 -3
- package/dist/es/components/password-input/PasswordInput.js +98 -79
- package/dist/es/components/picker/Picker.js +440 -421
- package/dist/es/components/picker/tokens.js +1 -1
- package/dist/es/components/popup/Popup.js +263 -292
- package/dist/es/components/portal/Portal.js +13 -29
- package/dist/es/components/portal/PortalHost.js +152 -234
- package/dist/es/components/progress/Progress.js +51 -48
- package/dist/es/components/radio/Radio.js +47 -44
- package/dist/es/components/radio/RadioGroup.js +10 -41
- package/dist/es/components/radio/tokens.js +7 -10
- package/dist/es/components/safe-area-view/SafeAreaView.js +22 -25
- package/dist/es/components/search/Search.js +52 -44
- package/dist/es/components/selector/Selector.js +14 -13
- package/dist/es/components/share-sheet/ShareSheet.js +162 -163
- package/dist/es/components/sidebar/Sidebar.js +41 -47
- package/dist/es/components/sidebar/SidebarContext.js +1 -2
- package/dist/es/components/sidebar/SidebarItem.js +13 -15
- package/dist/es/components/sidebar/tokens.js +1 -3
- package/dist/es/components/skeleton/Skeleton.js +30 -37
- package/dist/es/components/skeleton/tokens.js +1 -2
- package/dist/es/components/slider/Slider.js +156 -134
- package/dist/es/components/space/Space.js +48 -71
- package/dist/es/components/stepper/Stepper.js +178 -156
- package/dist/es/components/swiper/Swiper.js +252 -254
- package/dist/es/components/swiper/SwiperPagIndicator.js +25 -27
- package/dist/es/components/swiper/tokens.js +10 -3
- package/dist/es/components/switch/Switch.js +13 -15
- package/dist/es/components/tabbar/Tabbar.js +36 -28
- package/dist/es/components/tabbar/TabbarContext.js +1 -2
- package/dist/es/components/tabbar/TabbarItem.js +66 -69
- package/dist/es/components/tabs/Tabs.js +286 -313
- package/dist/es/components/tag/Tag.js +49 -39
- package/dist/es/components/toast/Toast.js +93 -91
- package/dist/es/components/toast/imperative.js +16 -41
- package/dist/es/components/typography/Typography.js +3 -5
- package/dist/es/components/water-mark/WaterMark.js +32 -30
- package/dist/es/design-system/ThemeProvider.js +5 -11
- package/dist/es/design-system/createComponentTokensHook.js +11 -13
- package/dist/es/design-system/presets.js +2 -3
- package/dist/es/design-system/tokens.js +1 -9
- package/dist/es/hooks/animation/index.js +2 -0
- package/dist/es/hooks/animation/useAnimatedTransition.js +53 -0
- package/dist/es/hooks/animation/useReducedMotion.js +54 -0
- package/dist/es/hooks/aria/useAriaListBox.js +8 -16
- package/dist/es/hooks/aria/useAriaOverlay.js +3 -3
- package/dist/es/hooks/aria/useAriaPress.js +8 -21
- package/dist/es/hooks/aria/useAriaToggle.js +3 -3
- package/dist/es/hooks/gesture/useGestureScroll.js +60 -61
- package/dist/es/hooks/index.js +1 -0
- package/dist/es/hooks/overlay/OverlayStackStore.js +49 -69
- package/dist/es/hooks/overlay/useOverlayStack.js +13 -19
- package/dist/es/hooks/useControllableValue.js +10 -21
- package/dist/es/hooks/useCountDown.js +14 -22
- package/dist/es/hooks/useHairline.js +16 -28
- package/dist/es/hooks/useSafeAreaPadding.js +1 -4
- package/dist/es/index.js +8 -1
- package/dist/es/platform/animation.js +9 -1
- package/dist/es/platform/measure.js +18 -36
- package/dist/es/utils/color.js +21 -35
- package/dist/es/utils/compare.js +7 -12
- package/dist/es/utils/createPlatformShadow.js +28 -39
- package/dist/es/utils/date.js +20 -50
- package/dist/es/utils/deepMerge.js +16 -26
- package/dist/es/utils/hairline.js +73 -65
- package/dist/es/utils/index.js +2 -0
- package/dist/es/utils/number.js +21 -29
- package/dist/es/utils/render.js +7 -0
- package/dist/es/utils/rtl.js +17 -0
- package/dist/es/utils/string.js +8 -25
- package/dist/types/components/action-sheet/ActionSheet.d.ts +1 -1
- package/dist/types/components/area/Area.d.ts +1 -1
- package/dist/types/components/area/tokens.d.ts +4 -0
- package/dist/types/components/avatar/Avatar.d.ts +1 -1
- package/dist/types/components/avatar/index.d.ts +1 -2
- package/dist/types/components/badge/Badge.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +1 -1
- package/dist/types/components/button/index.d.ts +1 -1
- package/dist/types/components/calendar/Calendar.d.ts +1 -1
- package/dist/types/components/cascader/Cascader.d.ts +1 -1
- package/dist/types/components/cell/Cell.d.ts +1 -1
- package/dist/types/components/cell/CellGroup.d.ts +1 -1
- package/dist/types/components/cell/index.d.ts +2 -2
- package/dist/types/components/checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/circle/Circle.d.ts +1 -1
- package/dist/types/components/collapse/Collapse.d.ts +1 -2
- package/dist/types/components/config-provider/DirectionContext.d.ts +3 -0
- package/dist/types/components/config-provider/index.d.ts +2 -1
- package/dist/types/components/config-provider/locale/en-US.d.ts +32 -0
- package/dist/types/components/config-provider/locale/zh-CN.d.ts +32 -0
- package/dist/types/components/config-provider/useDirection.d.ts +1 -0
- package/dist/types/components/count-down/CountDown.d.ts +1 -1
- package/dist/types/components/datetime-picker/DatetimePicker.d.ts +1 -1
- package/dist/types/components/datetime-picker/tokens.d.ts +12 -0
- package/dist/types/components/dialog/Dialog.d.ts +1 -1
- package/dist/types/components/divider/Divider.d.ts +1 -1
- package/dist/types/components/empty/Empty.d.ts +1 -1
- package/dist/types/components/error-boundary/ErrorBoundary.d.ts +6 -0
- package/dist/types/components/error-boundary/index.d.ts +2 -0
- package/dist/types/components/field/Field.d.ts +1 -1
- package/dist/types/components/flex/Flex.d.ts +1 -1
- package/dist/types/components/flex/FlexItem.d.ts +1 -1
- package/dist/types/components/flex/index.d.ts +2 -2
- package/dist/types/components/form/Form.d.ts +1 -1
- package/dist/types/components/form/FormItem.d.ts +2 -1
- package/dist/types/components/form/index.d.ts +2 -2
- package/dist/types/components/form/tokens.d.ts +4 -0
- package/dist/types/components/grid/Grid.d.ts +1 -1
- package/dist/types/components/grid/GridItem.d.ts +1 -1
- package/dist/types/components/grid/index.d.ts +2 -2
- package/dist/types/components/image/Image.d.ts +1 -1
- package/dist/types/components/image-preview/ImagePreview.d.ts +1 -1
- package/dist/types/components/index.d.ts +4 -1
- package/dist/types/components/input/Input.d.ts +3 -3
- package/dist/types/components/loading/Loading.d.ts +1 -1
- package/dist/types/components/nav-bar/NavBar.d.ts +1 -1
- package/dist/types/components/notice-bar/NoticeBar.d.ts +1 -1
- package/dist/types/components/notify/Notify.d.ts +2 -2
- package/dist/types/components/notify/index.d.ts +1 -1
- package/dist/types/components/overlay/Overlay.d.ts +1 -5
- package/dist/types/components/overlay/tokens.d.ts +3 -0
- package/dist/types/components/password-input/PasswordInput.d.ts +1 -1
- package/dist/types/components/picker/Picker.d.ts +5 -5
- package/dist/types/components/popup/Popup.d.ts +3 -42
- package/dist/types/components/portal/Portal.d.ts +9 -6
- package/dist/types/components/portal/PortalHost.d.ts +1 -1
- package/dist/types/components/radio/RadioGroup.d.ts +1 -1
- package/dist/types/components/safe-area-view/SafeAreaView.d.ts +1 -1
- package/dist/types/components/search/Search.d.ts +1 -1
- package/dist/types/components/share-sheet/ShareSheet.d.ts +1 -1
- package/dist/types/components/sidebar/Sidebar.d.ts +1 -1
- package/dist/types/components/sidebar/SidebarContext.d.ts +1 -1
- package/dist/types/components/sidebar/SidebarItem.d.ts +1 -1
- package/dist/types/components/sidebar/index.d.ts +2 -2
- package/dist/types/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/types/components/slider/Slider.d.ts +1 -1
- package/dist/types/components/stepper/Stepper.d.ts +1 -1
- package/dist/types/components/swiper/Swiper.d.ts +1 -1
- package/dist/types/components/swiper/index.d.ts +1 -1
- package/dist/types/components/swiper/tokens.d.ts +8 -0
- package/dist/types/components/tabbar/Tabbar.d.ts +2 -2
- package/dist/types/components/tabbar/TabbarContext.d.ts +1 -1
- package/dist/types/components/tabbar/TabbarItem.d.ts +2 -2
- package/dist/types/components/tabs/Tabs.d.ts +1 -1
- package/dist/types/components/tabs/index.d.ts +1 -1
- package/dist/types/components/tag/Tag.d.ts +1 -1
- package/dist/types/components/toast/Toast.d.ts +2 -2
- package/dist/types/components/toast/index.d.ts +1 -1
- package/dist/types/components/water-mark/WaterMark.d.ts +1 -1
- package/dist/types/design-system/tokens.d.ts +0 -1
- package/dist/types/hooks/animation/index.d.ts +3 -0
- package/dist/types/hooks/animation/useAnimatedTransition.d.ts +13 -0
- package/dist/types/hooks/animation/useReducedMotion.d.ts +3 -0
- package/dist/types/hooks/aria/useAriaOverlay.d.ts +1 -1
- package/dist/types/hooks/gesture/useGestureScroll.d.ts +11 -10
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/overlay/OverlayStackStore.d.ts +8 -8
- package/dist/types/hooks/useHairline.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/platform/animation.d.ts +8 -0
- package/dist/types/platform/measure.d.ts +1 -1
- package/dist/types/utils/compare.d.ts +1 -1
- package/dist/types/utils/createPlatformShadow.d.ts +2 -2
- package/dist/types/utils/date.d.ts +2 -2
- package/dist/types/utils/hairline.d.ts +5 -10
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/number.d.ts +2 -2
- package/dist/types/utils/render.d.ts +5 -0
- package/dist/types/utils/rtl.d.ts +5 -0
- package/package.json +9 -2
|
@@ -1,50 +1,39 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const g = bigint >> 8 & 255;
|
|
11
|
-
const b = bigint & 255;
|
|
12
|
-
const clampedAlpha = Math.max(0, Math.min(1, alpha));
|
|
13
|
-
return `rgba(${r}, ${g}, ${b}, ${clampedAlpha})`;
|
|
14
|
-
};
|
|
15
|
-
const ensureRgbaColor = (color, alpha) => {
|
|
16
|
-
const trimmed = color.trim().toLowerCase();
|
|
17
|
-
if (trimmed.startsWith('#')) {
|
|
18
|
-
return hexToRgba(trimmed, alpha);
|
|
19
|
-
}
|
|
20
|
-
if (trimmed.startsWith('rgba')) {
|
|
21
|
-
return color;
|
|
22
|
-
}
|
|
23
|
-
if (trimmed.startsWith('rgb(')) {
|
|
24
|
-
return color.replace(/rgb\(([^)]*)\)/i, (_, inner) => `rgba(${inner}, ${alpha})`);
|
|
2
|
+
const toRgba = (color, alpha) => {
|
|
3
|
+
const t = color.trim();
|
|
4
|
+
if (t.startsWith('#')) {
|
|
5
|
+
const h = t.replace('#', '');
|
|
6
|
+
const e = h.length === 3 ? h.split('').map(c => c + c).join('') : h;
|
|
7
|
+
if (e.length < 6) return color;
|
|
8
|
+
const n = parseInt(e.slice(0, 6), 16);
|
|
9
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${Math.max(0, Math.min(1, alpha))})`;
|
|
25
10
|
}
|
|
11
|
+
if (t.startsWith('rgba')) return color;
|
|
12
|
+
if (t.startsWith('rgb(')) return color.replace(/rgb\(([^)]*)\)/i, (_, i) => `rgba(${i}, ${alpha})`);
|
|
26
13
|
return color;
|
|
27
14
|
};
|
|
28
|
-
export const createPlatformShadow =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
export const createPlatformShadow = ({
|
|
16
|
+
color,
|
|
17
|
+
opacity,
|
|
18
|
+
radius,
|
|
19
|
+
offsetY,
|
|
20
|
+
offsetX = 0,
|
|
21
|
+
elevation
|
|
22
|
+
}) => {
|
|
23
|
+
if (Platform.OS !== 'web') return {
|
|
24
|
+
shadowColor: color,
|
|
25
|
+
shadowOpacity: opacity,
|
|
26
|
+
shadowRadius: radius,
|
|
33
27
|
shadowOffset: {
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
28
|
+
width: offsetX,
|
|
29
|
+
height: offsetY
|
|
36
30
|
},
|
|
37
|
-
...(
|
|
38
|
-
elevation
|
|
39
|
-
}
|
|
31
|
+
...(elevation !== undefined && {
|
|
32
|
+
elevation
|
|
33
|
+
})
|
|
40
34
|
};
|
|
41
|
-
if (Platform.OS !== 'web') {
|
|
42
|
-
return nativeShadow;
|
|
43
|
-
}
|
|
44
|
-
const blur = Math.max(config.radius * 1.5, config.radius);
|
|
45
|
-
const boxShadowColor = ensureRgbaColor(config.color, config.opacity);
|
|
46
35
|
return {
|
|
47
|
-
boxShadow: `${
|
|
36
|
+
boxShadow: `${offsetX}px ${offsetY}px ${radius * 1.5}px ${toRgba(color, opacity)}`
|
|
48
37
|
};
|
|
49
38
|
};
|
|
50
39
|
export default createPlatformShadow;
|
package/dist/es/utils/date.js
CHANGED
|
@@ -1,63 +1,33 @@
|
|
|
1
1
|
export const padZero = (value, length = 2) => {
|
|
2
|
-
const
|
|
3
|
-
return
|
|
4
|
-
};
|
|
5
|
-
export const times = (count, iteratee) => {
|
|
6
|
-
return Array.from({
|
|
7
|
-
length: count
|
|
8
|
-
}, (_, index) => iteratee(index));
|
|
2
|
+
const s = String(value);
|
|
3
|
+
return s.length >= length ? s : `${'0'.repeat(length - s.length)}${s}`;
|
|
9
4
|
};
|
|
5
|
+
export const times = (count, fn) => Array.from({
|
|
6
|
+
length: count
|
|
7
|
+
}, (_, i) => fn(i));
|
|
10
8
|
export const getTrueValue = value => {
|
|
11
9
|
if (!value) return 0;
|
|
12
|
-
const
|
|
13
|
-
return Number.isNaN(
|
|
14
|
-
};
|
|
15
|
-
export const getMonthEndDay = (year, month) => {
|
|
16
|
-
return 32 - new Date(year, month - 1, 32).getDate();
|
|
10
|
+
const n = parseInt(value, 10);
|
|
11
|
+
return Number.isNaN(n) ? 0 : n;
|
|
17
12
|
};
|
|
18
|
-
export const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const formatDuration = (format, currentTime) => {
|
|
22
|
-
const {
|
|
23
|
-
days
|
|
24
|
-
} = currentTime;
|
|
13
|
+
export const getMonthEndDay = (year, month) => 32 - new Date(year, month - 1, 32).getDate();
|
|
14
|
+
export const isValidDate = value => value instanceof Date && !Number.isNaN(value.getTime());
|
|
15
|
+
export const formatDuration = (format, time) => {
|
|
25
16
|
let {
|
|
17
|
+
days,
|
|
26
18
|
hours,
|
|
27
19
|
minutes,
|
|
28
20
|
seconds,
|
|
29
21
|
milliseconds
|
|
30
|
-
} =
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (template.includes('HH')) {
|
|
38
|
-
template = template.replace('HH', padZero(hours));
|
|
39
|
-
} else {
|
|
40
|
-
minutes += hours * 60;
|
|
41
|
-
}
|
|
42
|
-
if (template.includes('mm')) {
|
|
43
|
-
template = template.replace('mm', padZero(minutes));
|
|
44
|
-
} else {
|
|
45
|
-
seconds += minutes * 60;
|
|
46
|
-
}
|
|
47
|
-
if (template.includes('ss')) {
|
|
48
|
-
template = template.replace('ss', padZero(seconds));
|
|
49
|
-
} else {
|
|
50
|
-
milliseconds += seconds * 1000;
|
|
51
|
-
}
|
|
52
|
-
if (template.includes('S')) {
|
|
22
|
+
} = time;
|
|
23
|
+
let t = format;
|
|
24
|
+
if (t.includes('DD')) t = t.replace('DD', padZero(days));else hours += days * 24;
|
|
25
|
+
if (t.includes('HH')) t = t.replace('HH', padZero(hours));else minutes += hours * 60;
|
|
26
|
+
if (t.includes('mm')) t = t.replace('mm', padZero(minutes));else seconds += minutes * 60;
|
|
27
|
+
if (t.includes('ss')) t = t.replace('ss', padZero(seconds));else milliseconds += seconds * 1000;
|
|
28
|
+
if (t.includes('S')) {
|
|
53
29
|
const ms = padZero(milliseconds, 3);
|
|
54
|
-
if (
|
|
55
|
-
template = template.replace('SSS', ms);
|
|
56
|
-
} else if (template.includes('SS')) {
|
|
57
|
-
template = template.replace('SS', ms.slice(0, 2));
|
|
58
|
-
} else {
|
|
59
|
-
template = template.replace('S', ms.charAt(0));
|
|
60
|
-
}
|
|
30
|
+
if (t.includes('SSS')) t = t.replace('SSS', ms);else if (t.includes('SS')) t = t.replace('SS', ms.slice(0, 2));else t = t.replace('S', ms.charAt(0));
|
|
61
31
|
}
|
|
62
|
-
return
|
|
32
|
+
return t;
|
|
63
33
|
};
|
|
@@ -1,31 +1,21 @@
|
|
|
1
|
-
const isPlainObject =
|
|
2
|
-
return Object.prototype.toString.call(value) === '[object Object]';
|
|
3
|
-
};
|
|
1
|
+
const isPlainObject = v => Object.prototype.toString.call(v) === '[object Object]';
|
|
4
2
|
export function deepMerge(target, source) {
|
|
5
|
-
if (!source)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (!Array.isArray(target) && !isPlainObject(target)) {
|
|
9
|
-
return source;
|
|
10
|
-
}
|
|
11
|
-
const output = Array.isArray(target) ? [...target] : {
|
|
3
|
+
if (!source) return target;
|
|
4
|
+
if (!Array.isArray(target) && !isPlainObject(target)) return source;
|
|
5
|
+
const out = Array.isArray(target) ? [...target] : {
|
|
12
6
|
...target
|
|
13
7
|
};
|
|
14
|
-
Object.keys(source)
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
|
|
8
|
+
for (const key of Object.keys(source)) {
|
|
9
|
+
const sv = source[key];
|
|
10
|
+
if (sv === undefined) continue;
|
|
11
|
+
const tv = target[key];
|
|
12
|
+
if (isPlainObject(tv) && isPlainObject(sv)) {
|
|
13
|
+
out[key] = deepMerge(tv, sv);
|
|
14
|
+
continue;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
;
|
|
26
|
-
output[key] = Array.isArray(sourceValue) ? [...sourceValue] : isPlainObject(sourceValue) ? {
|
|
27
|
-
...sourceValue
|
|
28
|
-
} : sourceValue;
|
|
29
|
-
});
|
|
30
|
-
return output;
|
|
16
|
+
out[key] = Array.isArray(sv) ? [...sv] : isPlainObject(sv) ? {
|
|
17
|
+
...sv
|
|
18
|
+
} : sv;
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
31
21
|
}
|
|
@@ -1,36 +1,26 @@
|
|
|
1
1
|
import { Platform, StyleSheet } from 'react-native';
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
2
|
+
const isWeb = Platform.OS === 'web';
|
|
3
|
+
export const getHairlineWidth = () => StyleSheet.hairlineWidth;
|
|
4
|
+
const ORIGINS = {
|
|
5
|
+
top: 'center top',
|
|
6
|
+
bottom: 'center bottom',
|
|
7
|
+
left: 'left center',
|
|
8
|
+
right: 'right center'
|
|
9
|
+
};
|
|
10
|
+
const SCALES = {
|
|
11
|
+
top: {
|
|
12
|
+
scaleY: 0.5
|
|
13
|
+
},
|
|
14
|
+
bottom: {
|
|
15
|
+
scaleY: 0.5
|
|
16
|
+
},
|
|
17
|
+
left: {
|
|
18
|
+
scaleX: 0.5
|
|
19
|
+
},
|
|
20
|
+
right: {
|
|
21
|
+
scaleX: 0.5
|
|
22
|
+
}
|
|
17
23
|
};
|
|
18
|
-
export const createHairlineBorderTop = color => createHairlineBorder({
|
|
19
|
-
color,
|
|
20
|
-
position: 'top'
|
|
21
|
-
});
|
|
22
|
-
export const createHairlineBorderRight = color => createHairlineBorder({
|
|
23
|
-
color,
|
|
24
|
-
position: 'right'
|
|
25
|
-
});
|
|
26
|
-
export const createHairlineBorderBottom = color => createHairlineBorder({
|
|
27
|
-
color,
|
|
28
|
-
position: 'bottom'
|
|
29
|
-
});
|
|
30
|
-
export const createHairlineBorderLeft = color => createHairlineBorder({
|
|
31
|
-
color,
|
|
32
|
-
position: 'left'
|
|
33
|
-
});
|
|
34
24
|
export const createHairlineView = ({
|
|
35
25
|
left,
|
|
36
26
|
right,
|
|
@@ -38,11 +28,50 @@ export const createHairlineView = ({
|
|
|
38
28
|
bottom,
|
|
39
29
|
width,
|
|
40
30
|
color,
|
|
41
|
-
position = 'bottom'
|
|
31
|
+
position = 'bottom',
|
|
32
|
+
enabled = true,
|
|
33
|
+
borderRadius
|
|
42
34
|
} = {}) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
if (!enabled) return {};
|
|
36
|
+
if (position === 'all') {
|
|
37
|
+
const bw = width ?? (isWeb ? 1 : StyleSheet.hairlineWidth);
|
|
38
|
+
if (isWeb && bw > 0 && bw <= 1) return {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
top: 0,
|
|
41
|
+
left: 0,
|
|
42
|
+
width: '200%',
|
|
43
|
+
height: '200%',
|
|
44
|
+
borderWidth: 1,
|
|
45
|
+
...(color && {
|
|
46
|
+
borderColor: color
|
|
47
|
+
}),
|
|
48
|
+
...(borderRadius != null && {
|
|
49
|
+
borderRadius: borderRadius * 2
|
|
50
|
+
}),
|
|
51
|
+
transform: [{
|
|
52
|
+
scale: 0.5
|
|
53
|
+
}],
|
|
54
|
+
transformOrigin: 'left top',
|
|
55
|
+
pointerEvents: 'none'
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
top: 0,
|
|
60
|
+
left: 0,
|
|
61
|
+
right: 0,
|
|
62
|
+
bottom: 0,
|
|
63
|
+
borderWidth: bw,
|
|
64
|
+
...(color && {
|
|
65
|
+
borderColor: color
|
|
66
|
+
}),
|
|
67
|
+
...(borderRadius != null && {
|
|
68
|
+
borderRadius
|
|
69
|
+
}),
|
|
70
|
+
pointerEvents: 'none'
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const bw = width ?? (isWeb ? 1 : StyleSheet.hairlineWidth);
|
|
74
|
+
const s = {
|
|
46
75
|
position: 'absolute',
|
|
47
76
|
pointerEvents: 'none',
|
|
48
77
|
left,
|
|
@@ -50,35 +79,14 @@ export const createHairlineView = ({
|
|
|
50
79
|
top,
|
|
51
80
|
bottom
|
|
52
81
|
};
|
|
53
|
-
if (position
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (isWeb && (!width || width === 1 || width === StyleSheet.hairlineWidth)) {
|
|
62
|
-
const scales = {
|
|
63
|
-
top: {
|
|
64
|
-
scaleY: 0.5
|
|
65
|
-
},
|
|
66
|
-
bottom: {
|
|
67
|
-
scaleY: 0.5
|
|
68
|
-
},
|
|
69
|
-
left: {
|
|
70
|
-
scaleX: 0.5
|
|
71
|
-
},
|
|
72
|
-
right: {
|
|
73
|
-
scaleX: 0.5
|
|
74
|
-
},
|
|
75
|
-
all: {
|
|
76
|
-
scale: 0.5
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
if (scales[position]) {
|
|
80
|
-
style.transform = [scales[position]];
|
|
81
|
-
}
|
|
82
|
+
if (s[position] === undefined) s[position] = 0;
|
|
83
|
+
const k = `border${position[0].toUpperCase()}${position.slice(1)}`;
|
|
84
|
+
s[`${k}Width`] = bw;
|
|
85
|
+
if (color) s[`${k}Color`] = color;
|
|
86
|
+
if (isWeb && bw > 0 && bw <= 1) {
|
|
87
|
+
s[`${k}Width`] = 1;
|
|
88
|
+
s.transform = [SCALES[position]];
|
|
89
|
+
s.transformOrigin = ORIGINS[position];
|
|
82
90
|
}
|
|
83
|
-
return
|
|
91
|
+
return s;
|
|
84
92
|
};
|
package/dist/es/utils/index.js
CHANGED
package/dist/es/utils/number.js
CHANGED
|
@@ -4,53 +4,45 @@ export const clamp01 = value => clamp(value, 0, 1);
|
|
|
4
4
|
export const parseNumberLike = (value, fallback) => {
|
|
5
5
|
if (isFiniteNumber(value)) return value;
|
|
6
6
|
if (isString(value)) {
|
|
7
|
-
const
|
|
8
|
-
return Number.isFinite(
|
|
7
|
+
const n = Number.parseFloat(value);
|
|
8
|
+
return Number.isFinite(n) ? n : fallback;
|
|
9
9
|
}
|
|
10
10
|
return fallback;
|
|
11
11
|
};
|
|
12
12
|
export const parseNumber = (value, fallback = 0) => parseNumberLike(value, fallback) ?? fallback;
|
|
13
|
-
export const parsePercentage =
|
|
14
|
-
if (isNumber(
|
|
15
|
-
if (isString(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
return Number.isNaN(parsed) ? 0 : parsed;
|
|
13
|
+
export const parsePercentage = value => {
|
|
14
|
+
if (isNumber(value)) return value;
|
|
15
|
+
if (isString(value)) {
|
|
16
|
+
const n = Number(value.trim().replace('%', ''));
|
|
17
|
+
return Number.isNaN(n) ? 0 : n;
|
|
19
18
|
}
|
|
20
19
|
return 0;
|
|
21
20
|
};
|
|
22
21
|
export const isNumericLike = value => isNumber(value) || isString(value) && value.trim() !== '' && !Number.isNaN(Number(value));
|
|
23
|
-
export const addNumber = (
|
|
24
|
-
const
|
|
25
|
-
return Math.round((
|
|
22
|
+
export const addNumber = (a, b) => {
|
|
23
|
+
const c = 10 ** 10;
|
|
24
|
+
return Math.round((a + b) * c) / c;
|
|
26
25
|
};
|
|
27
26
|
export const formatNumber = (value, integer, decimalLength) => {
|
|
28
|
-
let
|
|
29
|
-
if (integer) next = Math.trunc(next);
|
|
27
|
+
let n = integer ? Math.trunc(value) : value;
|
|
30
28
|
if (decimalLength !== undefined) {
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
const f = 10 ** decimalLength;
|
|
30
|
+
n = Math.round(n * f) / f;
|
|
33
31
|
}
|
|
34
|
-
return
|
|
32
|
+
return n;
|
|
35
33
|
};
|
|
36
34
|
export const numberToString = (value, decimalLength) => {
|
|
37
35
|
if (value === null || value === undefined || !Number.isFinite(value)) return '';
|
|
38
|
-
|
|
39
|
-
return String(value);
|
|
36
|
+
return decimalLength !== undefined ? value.toFixed(decimalLength) : String(value);
|
|
40
37
|
};
|
|
41
38
|
export const parseDecimalLength = value => {
|
|
42
39
|
if (value === undefined) return undefined;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
return Math.max(0, Math.floor(parsed));
|
|
40
|
+
const n = isNumber(value) ? value : Number.parseInt(value, 10);
|
|
41
|
+
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : undefined;
|
|
46
42
|
};
|
|
47
43
|
export const clampValue = (value, min, max) => {
|
|
48
|
-
let
|
|
49
|
-
if (isFiniteNumber(min))
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (isFiniteNumber(max)) {
|
|
53
|
-
next = Math.min(next, max);
|
|
54
|
-
}
|
|
55
|
-
return next;
|
|
44
|
+
let n = value;
|
|
45
|
+
if (isFiniteNumber(min)) n = Math.max(n, min);
|
|
46
|
+
if (isFiniteNumber(max)) n = Math.min(n, max);
|
|
47
|
+
return n;
|
|
56
48
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Text } from 'react-native';
|
|
4
|
+
import { isText } from './validate';
|
|
5
|
+
export const renderTextOrNode = (content, textStyle, textProps) => isText(content) ? /*#__PURE__*/React.createElement(Text, _extends({
|
|
6
|
+
style: textStyle
|
|
7
|
+
}, textProps), content) : content;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const swaps = [['paddingLeft', 'paddingRight'], ['marginLeft', 'marginRight'], ['borderLeftWidth', 'borderRightWidth'], ['borderTopLeftRadius', 'borderTopRightRadius'], ['borderBottomLeftRadius', 'borderBottomRightRadius'], ['left', 'right']];
|
|
2
|
+
export const flipStyle = (style, dir) => {
|
|
3
|
+
if (dir !== 'rtl') return style;
|
|
4
|
+
const out = {
|
|
5
|
+
...style
|
|
6
|
+
};
|
|
7
|
+
for (const [a, b] of swaps) {
|
|
8
|
+
if (a in out || b in out) {
|
|
9
|
+
const t = out[a];
|
|
10
|
+
out[a] = out[b];
|
|
11
|
+
out[b] = t;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (out.flexDirection === 'row') out.flexDirection = 'row-reverse';else if (out.flexDirection === 'row-reverse') out.flexDirection = 'row';
|
|
15
|
+
return out;
|
|
16
|
+
};
|
|
17
|
+
export const rtlRow = dir => dir === 'rtl' ? 'row-reverse' : 'row';
|
package/dist/es/utils/string.js
CHANGED
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
import { isTwoCNChar } from './validate';
|
|
2
|
-
export const ensureSpace = (value, autoInsertSpace) =>
|
|
3
|
-
if (!autoInsertSpace) {
|
|
4
|
-
return value;
|
|
5
|
-
}
|
|
6
|
-
return isTwoCNChar(value) ? value.split('').join(' ') : value;
|
|
7
|
-
};
|
|
2
|
+
export const ensureSpace = (value, autoInsertSpace) => autoInsertSpace && isTwoCNChar(value) ? value.split('').join(' ') : value;
|
|
8
3
|
export const trimExtraChar = (value, char, regExp) => {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
if (char === '-' &&
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
return value.slice(0, index + 1) + value.slice(index).replace(regExp, '');
|
|
4
|
+
const i = value.indexOf(char);
|
|
5
|
+
if (i === -1) return value;
|
|
6
|
+
if (char === '-' && i !== 0) return value.slice(0, i);
|
|
7
|
+
return value.slice(0, i + 1) + value.slice(i).replace(regExp, '');
|
|
15
8
|
};
|
|
16
9
|
export const formatNumberInput = (value, allowDot = true, allowMinus = true) => {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} else {
|
|
21
|
-
next = next.split('.')[0];
|
|
22
|
-
}
|
|
23
|
-
if (allowMinus) {
|
|
24
|
-
next = trimExtraChar(next, '-', /-/g);
|
|
25
|
-
} else {
|
|
26
|
-
next = next.replace(/-/g, '');
|
|
27
|
-
}
|
|
28
|
-
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
29
|
-
return next.replace(regExp, '');
|
|
10
|
+
let n = allowDot ? trimExtraChar(value, '.', /\./g) : value.split('.')[0];
|
|
11
|
+
n = allowMinus ? trimExtraChar(n, '-', /-/g) : n.replace(/-/g, '');
|
|
12
|
+
return n.replace(allowDot ? /[^-0-9.]/g : /[^-0-9]/g, '');
|
|
30
13
|
};
|
|
@@ -3,5 +3,5 @@ import { Text, View } from 'react-native';
|
|
|
3
3
|
import type { AvatarFallbackTextProps, AvatarImageProps, AvatarProps } from './types';
|
|
4
4
|
export declare const AvatarFallbackText: React.ForwardRefExoticComponent<AvatarFallbackTextProps & React.RefAttributes<Text>>;
|
|
5
5
|
export declare const AvatarImage: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<import("react-native").Image>>;
|
|
6
|
-
export declare const Avatar: React.
|
|
6
|
+
export declare const Avatar: React.NamedExoticComponent<AvatarProps & React.RefAttributes<View>>;
|
|
7
7
|
export default Avatar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { BadgeProps } from './types';
|
|
4
|
-
export declare const Badge: React.
|
|
4
|
+
export declare const Badge: React.NamedExoticComponent<BadgeProps & React.RefAttributes<View>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { ButtonProps } from './types';
|
|
4
|
-
export declare const Button: React.
|
|
4
|
+
export declare const Button: React.NamedExoticComponent<ButtonProps & React.RefAttributes<View>>;
|
|
5
5
|
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const Button: import("react").
|
|
1
|
+
declare const Button: import("react").NamedExoticComponent<import("./types").ButtonProps & import("react").RefAttributes<import("react-native").View>> & {
|
|
2
2
|
Group: import("react").NamedExoticComponent<import("./ButtonGroup").ButtonGroupProps>;
|
|
3
3
|
};
|
|
4
4
|
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { CellProps } from './types';
|
|
4
|
-
export declare const Cell: React.
|
|
4
|
+
export declare const Cell: React.NamedExoticComponent<CellProps & React.RefAttributes<View>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CellGroup } from './CellGroup';
|
|
2
|
-
declare const Cell: import("react").
|
|
3
|
-
Group: import("react").
|
|
2
|
+
declare const Cell: import("react").NamedExoticComponent<import("./types").CellProps & import("react").RefAttributes<import("react-native").View>> & {
|
|
3
|
+
Group: import("react").NamedExoticComponent<import("./types").CellGroupProps>;
|
|
4
4
|
};
|
|
5
5
|
export default Cell;
|
|
6
6
|
export { Cell };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { CheckboxProps } from './types';
|
|
4
|
-
export declare const Checkbox: React.
|
|
4
|
+
export declare const Checkbox: React.NamedExoticComponent<CheckboxProps & React.RefAttributes<View>>;
|
|
5
5
|
export default Checkbox;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CircleProps } from './types';
|
|
3
|
-
export declare const Circle: React.
|
|
3
|
+
export declare const Circle: React.NamedExoticComponent<CircleProps>;
|
|
4
4
|
export type { CircleLineCap, CircleProps, CircleStartPosition, CircleTokens } from './types';
|
|
5
5
|
export default Circle;
|
|
@@ -36,9 +36,8 @@ export interface CollapsePanelProps extends ViewProps {
|
|
|
36
36
|
export type CollapsePanelInstance = {
|
|
37
37
|
toggle: (expand?: boolean) => void;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
export declare const Collapse: React.NamedExoticComponent<CollapseProps> & {
|
|
40
40
|
Panel: React.ForwardRefExoticComponent<CollapsePanelProps & React.RefAttributes<CollapsePanelInstance>>;
|
|
41
41
|
Item: React.ForwardRefExoticComponent<CollapsePanelProps & React.RefAttributes<CollapsePanelInstance>>;
|
|
42
42
|
};
|
|
43
|
-
export declare const Collapse: CollapseComponent;
|
|
44
43
|
export default Collapse;
|