taro-ui 3.3.0 → 3.3.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/LICENSE +21 -0
- package/lib/common/component.d.ts +10 -0
- package/lib/common/component.js +27 -28
- package/lib/common/component.js.map +1 -1
- package/lib/common/utils.d.ts +41 -0
- package/lib/common/utils.js +169 -192
- package/lib/common/utils.js.map +1 -1
- package/lib/components/accordion/index.d.ts +14 -0
- package/lib/components/accordion/index.js +111 -106
- package/lib/components/accordion/index.js.map +1 -1
- package/lib/components/action-sheet/body/index.d.ts +5 -0
- package/lib/components/action-sheet/body/index.js +11 -8
- package/lib/components/action-sheet/body/index.js.map +1 -1
- package/lib/components/action-sheet/body/item/index.d.ts +9 -0
- package/lib/components/action-sheet/body/item/index.js +21 -18
- package/lib/components/action-sheet/body/item/index.js.map +1 -1
- package/lib/components/action-sheet/footer/index.d.ts +9 -0
- package/lib/components/action-sheet/footer/index.js +24 -18
- package/lib/components/action-sheet/footer/index.js.map +1 -1
- package/lib/components/action-sheet/header/index.d.ts +5 -0
- package/lib/components/action-sheet/header/index.js +14 -8
- package/lib/components/action-sheet/header/index.js.map +1 -1
- package/lib/components/action-sheet/index.d.ts +14 -0
- package/lib/components/action-sheet/index.js +69 -64
- package/lib/components/action-sheet/index.js.map +1 -1
- package/lib/components/activity-indicator/index.d.ts +8 -0
- package/lib/components/activity-indicator/index.js +33 -29
- package/lib/components/activity-indicator/index.js.map +1 -1
- package/lib/components/avatar/index.d.ts +9 -0
- package/lib/components/avatar/index.js +58 -50
- package/lib/components/avatar/index.js.map +1 -1
- package/lib/components/badge/index.d.ts +10 -0
- package/lib/components/badge/index.js +44 -35
- package/lib/components/badge/index.js.map +1 -1
- package/lib/components/button/index.d.ts +15 -0
- package/lib/components/button/index.js +165 -113
- package/lib/components/button/index.js.map +1 -1
- package/lib/components/calendar/body/index.d.ts +26 -0
- package/lib/components/calendar/body/index.js +279 -183
- package/lib/components/calendar/body/index.js.map +1 -1
- package/lib/components/calendar/common/constant.d.ts +3 -0
- package/lib/components/calendar/common/constant.js +8 -3
- package/lib/components/calendar/common/constant.js.map +1 -1
- package/lib/components/calendar/common/helper.d.ts +4 -0
- package/lib/components/calendar/common/helper.js +77 -76
- package/lib/components/calendar/common/helper.js.map +1 -1
- package/lib/components/calendar/common/plugins.d.ts +11 -0
- package/lib/components/calendar/common/plugins.js +50 -66
- package/lib/components/calendar/common/plugins.js.map +1 -1
- package/lib/components/calendar/controller/index.d.ts +5 -0
- package/lib/components/calendar/controller/index.js +49 -28
- package/lib/components/calendar/controller/index.js.map +1 -1
- package/lib/components/calendar/index.d.ts +20 -0
- package/lib/components/calendar/index.js +233 -196
- package/lib/components/calendar/index.js.map +1 -1
- package/lib/components/calendar/ui/date-list/index.d.ts +12 -0
- package/lib/components/calendar/ui/date-list/index.js +50 -39
- package/lib/components/calendar/ui/date-list/index.js.map +1 -1
- package/lib/components/calendar/ui/day-list/index.d.ts +4 -0
- package/lib/components/calendar/ui/day-list/index.js +9 -14
- package/lib/components/calendar/ui/day-list/index.js.map +1 -1
- package/lib/components/card/index.d.ts +9 -0
- package/lib/components/card/index.js +73 -52
- package/lib/components/card/index.js.map +1 -1
- package/lib/components/checkbox/index.d.ts +9 -0
- package/lib/components/checkbox/index.js +52 -48
- package/lib/components/checkbox/index.js.map +1 -1
- package/lib/components/countdown/index.d.ts +20 -0
- package/lib/components/countdown/index.js +140 -125
- package/lib/components/countdown/index.js.map +1 -1
- package/lib/components/countdown/item/index.d.ts +9 -0
- package/lib/components/countdown/item/index.js +18 -18
- package/lib/components/countdown/item/index.js.map +1 -1
- package/lib/components/curtain/index.d.ts +10 -0
- package/lib/components/curtain/index.js +56 -39
- package/lib/components/curtain/index.js.map +1 -1
- package/lib/components/divider/index.d.ts +8 -0
- package/lib/components/divider/index.js +51 -34
- package/lib/components/divider/index.js.map +1 -1
- package/lib/components/drawer/index.d.ts +16 -0
- package/lib/components/drawer/index.js +106 -85
- package/lib/components/drawer/index.js.map +1 -1
- package/lib/components/fab/index.d.ts +9 -0
- package/lib/components/fab/index.js +22 -19
- package/lib/components/fab/index.js.map +1 -1
- package/lib/components/flex/index.d.ts +7 -0
- package/lib/components/flex/index.js +37 -34
- package/lib/components/flex/index.js.map +1 -1
- package/lib/components/flex/item/index.d.ts +7 -0
- package/lib/components/flex/item/index.js +30 -27
- package/lib/components/flex/item/index.js.map +1 -1
- package/lib/components/float-layout/index.d.ts +13 -0
- package/lib/components/float-layout/index.js +96 -68
- package/lib/components/float-layout/index.js.map +1 -1
- package/lib/components/form/index.d.ts +10 -0
- package/lib/components/form/index.js +37 -24
- package/lib/components/form/index.js.map +1 -1
- package/lib/components/grid/index.d.ts +9 -0
- package/lib/components/grid/index.js +92 -62
- package/lib/components/grid/index.js.map +1 -1
- package/lib/components/icon/index.d.ts +9 -0
- package/lib/components/icon/index.js +48 -31
- package/lib/components/icon/index.js.map +1 -1
- package/lib/components/image-picker/index.d.ts +11 -0
- package/lib/components/image-picker/index.js +152 -126
- package/lib/components/image-picker/index.js.map +1 -1
- package/lib/components/indexes/index.d.ts +29 -0
- package/lib/components/indexes/index.js +255 -198
- package/lib/components/indexes/index.js.map +1 -1
- package/lib/components/input/index.d.ts +17 -0
- package/lib/components/input/index.js +224 -160
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/input-number/index.d.ts +13 -0
- package/lib/components/input-number/index.js +180 -152
- package/lib/components/input-number/index.js.map +1 -1
- package/lib/components/list/index.d.ts +8 -0
- package/lib/components/list/index.js +20 -13
- package/lib/components/list/index.js.map +1 -1
- package/lib/components/list/item/index.d.ts +11 -0
- package/lib/components/list/item/index.js +146 -99
- package/lib/components/list/item/index.js.map +1 -1
- package/lib/components/load-more/index.d.ts +9 -0
- package/lib/components/load-more/index.js +65 -41
- package/lib/components/load-more/index.js.map +1 -1
- package/lib/components/loading/index.d.ts +12 -0
- package/lib/components/loading/index.js +26 -26
- package/lib/components/loading/index.js.map +1 -1
- package/lib/components/message/index.d.ts +15 -0
- package/lib/components/message/index.js +72 -63
- package/lib/components/message/index.js.map +1 -1
- package/lib/components/modal/action/index.d.ts +8 -0
- package/lib/components/modal/action/index.js +20 -14
- package/lib/components/modal/action/index.js.map +1 -1
- package/lib/components/modal/content/index.d.ts +5 -0
- package/lib/components/modal/content/index.js +11 -8
- package/lib/components/modal/content/index.js.map +1 -1
- package/lib/components/modal/header/index.d.ts +5 -0
- package/lib/components/modal/header/index.js +11 -8
- package/lib/components/modal/header/index.js.map +1 -1
- package/lib/components/modal/index.d.ts +15 -0
- package/lib/components/modal/index.js +96 -87
- package/lib/components/modal/index.js.map +1 -1
- package/lib/components/nav-bar/index.d.ts +12 -0
- package/lib/components/nav-bar/index.js +210 -98
- package/lib/components/nav-bar/index.js.map +1 -1
- package/lib/components/noticebar/index.d.ts +16 -0
- package/lib/components/noticebar/index.js +177 -154
- package/lib/components/noticebar/index.js.map +1 -1
- package/lib/components/pagination/index.d.ts +12 -0
- package/lib/components/pagination/index.js +133 -102
- package/lib/components/pagination/index.js.map +1 -1
- package/lib/components/progress/index.d.ts +7 -0
- package/lib/components/progress/index.js +48 -40
- package/lib/components/progress/index.js.map +1 -1
- package/lib/components/radio/index.d.ts +9 -0
- package/lib/components/radio/index.js +48 -37
- package/lib/components/radio/index.js.map +1 -1
- package/lib/components/range/index.d.ts +22 -0
- package/lib/components/range/index.js +197 -142
- package/lib/components/range/index.js.map +1 -1
- package/lib/components/rate/index.d.ts +9 -0
- package/lib/components/rate/index.js +74 -48
- package/lib/components/rate/index.js.map +1 -1
- package/lib/components/search-bar/index.d.ts +16 -0
- package/lib/components/search-bar/index.js +167 -112
- package/lib/components/search-bar/index.js.map +1 -1
- package/lib/components/segmented-control/index.d.ts +9 -0
- package/lib/components/segmented-control/index.js +78 -53
- package/lib/components/segmented-control/index.js.map +1 -1
- package/lib/components/slider/index.d.ts +13 -0
- package/lib/components/slider/index.js +107 -69
- package/lib/components/slider/index.js.map +1 -1
- package/lib/components/steps/index.d.ts +9 -0
- package/lib/components/steps/index.js +61 -44
- package/lib/components/steps/index.js.map +1 -1
- package/lib/components/swipe-action/index.d.ts +27 -0
- package/lib/components/swipe-action/index.js +206 -157
- package/lib/components/swipe-action/index.js.map +1 -1
- package/lib/components/swipe-action/options/index.d.ts +5 -0
- package/lib/components/swipe-action/options/index.js +22 -8
- package/lib/components/swipe-action/options/index.js.map +1 -1
- package/lib/components/switch/index.d.ts +9 -0
- package/lib/components/switch/index.js +53 -42
- package/lib/components/switch/index.js.map +1 -1
- package/lib/components/tab-bar/index.d.ts +9 -0
- package/lib/components/tab-bar/index.js +164 -90
- package/lib/components/tab-bar/index.js.map +1 -1
- package/lib/components/tabs/index.d.ts +24 -0
- package/lib/components/tabs/index.js +203 -174
- package/lib/components/tabs/index.js.map +1 -1
- package/lib/components/tabs-pane/index.d.ts +8 -0
- package/lib/components/tabs-pane/index.js +37 -24
- package/lib/components/tabs-pane/index.js.map +1 -1
- package/lib/components/tag/index.d.ts +9 -0
- package/lib/components/tag/index.js +64 -44
- package/lib/components/tag/index.js.map +1 -1
- package/lib/components/textarea/index.d.ts +13 -0
- package/lib/components/textarea/index.js +132 -86
- package/lib/components/textarea/index.js.map +1 -1
- package/lib/components/timeline/index.d.ts +8 -0
- package/lib/components/timeline/index.js +70 -47
- package/lib/components/timeline/index.js.map +1 -1
- package/lib/components/toast/img.json +6 -3
- package/lib/components/toast/index.d.ts +16 -0
- package/lib/components/toast/index.js +111 -104
- package/lib/components/toast/index.js.map +1 -1
- package/lib/index.d.ts +53 -0
- package/lib/index.js +108 -54
- package/lib/index.js.map +1 -1
- package/{dist → lib}/style/components/curtain.scss +3 -3
- package/{dist → lib}/style/components/grid.scss +2 -2
- package/lib/style/components/index.scss +52 -0
- package/{dist → lib}/style/components/list.scss +2 -2
- package/{dist → lib}/style/components/range.scss +2 -2
- package/{dist → lib}/style/components/toast.scss +1 -1
- package/lib/style/index.css +11754 -0
- package/lib/style/index.css.map +1 -0
- package/lib/style/mixins/index.scss +18 -0
- package/{dist → lib}/style/mixins/libs/shade.scss +4 -2
- package/{dist → lib}/style/mixins/libs/tint.scss +4 -2
- package/{dist → lib}/style/variables/default.scss +1 -1
- package/package.json +45 -48
- package/rn/components/action-sheet/index.tsx +8 -14
- package/rn/components/calendar/ui/date-list/index.tsx +1 -1
- package/rn/components/drawer/index.tsx +15 -15
- package/rn/components/float-layout/index.tsx +3 -2
- package/rn/components/input/index.tsx +14 -7
- package/rn/components/input-number/index.tsx +19 -19
- package/rn/components/message/index.tsx +1 -1
- package/rn/components/swipe-action/index.rn.tsx +4 -2
- package/rn/components/swipe-action/index.tsx +6 -5
- package/rn/components/tab-bar/index.tsx +1 -1
- package/rn/components/tabs/index.tsx +14 -14
- package/rn/components/textarea/index.tsx +2 -2
- package/README.md +0 -85
- package/dist/index.esm.js +0 -8407
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -8468
- package/dist/index.js.map +0 -1
- package/dist/style/components/accordion.rn.scss +0 -79
- package/dist/style/components/action-sheet.rn.scss +0 -80
- package/dist/style/components/activity-indicator.rn.scss +0 -30
- package/dist/style/components/article.rn.scss +0 -59
- package/dist/style/components/avatar.rn.scss +0 -46
- package/dist/style/components/badge.rn.scss +0 -52
- package/dist/style/components/button.rn.scss +0 -80
- package/dist/style/components/calendar.rn.scss +0 -182
- package/dist/style/components/card.rn.scss +0 -88
- package/dist/style/components/checkbox.rn.scss +0 -108
- package/dist/style/components/countdown.rn.scss +0 -82
- package/dist/style/components/curtain.rn.scss +0 -129
- package/dist/style/components/divider.rn.scss +0 -33
- package/dist/style/components/drawer.rn.scss +0 -72
- package/dist/style/components/fab.rn.scss +0 -38
- package/dist/style/components/flex.rn.scss +0 -159
- package/dist/style/components/float-layout.rn.scss +0 -119
- package/dist/style/components/form.rn.scss +0 -12
- package/dist/style/components/grid.rn.scss +0 -104
- package/dist/style/components/icon.rn.scss +0 -221
- package/dist/style/components/image-picker.rn.scss +0 -108
- package/dist/style/components/index.rn.scss +0 -51
- package/dist/style/components/index.scss +0 -52
- package/dist/style/components/indexes.rn.scss +0 -53
- package/dist/style/components/input-number.rn.scss +0 -82
- package/dist/style/components/input.rn.scss +0 -149
- package/dist/style/components/list.rn.scss +0 -107
- package/dist/style/components/load-more.rn.scss +0 -28
- package/dist/style/components/loading.rn.scss +0 -45
- package/dist/style/components/message.rn.scss +0 -57
- package/dist/style/components/modal.rn.scss +0 -136
- package/dist/style/components/nav-bar.rn.scss +0 -123
- package/dist/style/components/noticebar.rn.scss +0 -111
- package/dist/style/components/pagination.rn.scss +0 -43
- package/dist/style/components/progress.rn.scss +0 -105
- package/dist/style/components/radio.rn.scss +0 -94
- package/dist/style/components/range.rn.scss +0 -52
- package/dist/style/components/rate.rn.scss +0 -48
- package/dist/style/components/search-bar.rn.scss +0 -134
- package/dist/style/components/segmented-control.rn.scss +0 -44
- package/dist/style/components/slider.rn.scss +0 -33
- package/dist/style/components/steps.rn.scss +0 -131
- package/dist/style/components/swipe-action.rn.scss +0 -53
- package/dist/style/components/switch.rn.scss +0 -61
- package/dist/style/components/tab-bar.rn.scss +0 -74
- package/dist/style/components/tabs.rn.scss +0 -205
- package/dist/style/components/tag.rn.scss +0 -74
- package/dist/style/components/textarea.rn.scss +0 -57
- package/dist/style/components/timeline.rn.scss +0 -89
- package/dist/style/components/toast.rn.scss +0 -112
- package/dist/style/index.rn.scss +0 -14
- package/dist/style/mixins/index.rn.scss +0 -18
- package/dist/style/mixins/index.scss +0 -18
- package/dist/style/mixins/libs/absolute-center.rn.scss +0 -9
- package/dist/style/mixins/libs/active.rn.scss +0 -10
- package/dist/style/mixins/libs/alignhack.rn.scss +0 -11
- package/dist/style/mixins/libs/border.rn.scss +0 -48
- package/dist/style/mixins/libs/clearfix.rn.scss +0 -21
- package/dist/style/mixins/libs/disabled.rn.scss +0 -6
- package/dist/style/mixins/libs/flex.rn.scss +0 -49
- package/dist/style/mixins/libs/hairline.rn.scss +0 -209
- package/dist/style/mixins/libs/line.rn.scss +0 -14
- package/dist/style/mixins/libs/overlay.rn.scss +0 -11
- package/dist/style/mixins/libs/placeholder.rn.scss +0 -12
- package/dist/style/mixins/libs/shade.rn.scss +0 -23
- package/dist/style/mixins/libs/tint.rn.scss +0 -23
- package/dist/style/themes/purple.rn.scss +0 -44
- package/dist/style/themes/red.rn.scss +0 -45
- package/dist/style/variables/default.rn.scss +0 -461
- package/types/accordion.d.ts +0 -49
- package/types/action-sheet.d.ts +0 -55
- package/types/activity-indicator.d.ts +0 -33
- package/types/avatar.d.ts +0 -39
- package/types/badge.d.ts +0 -24
- package/types/base.d.ts +0 -26
- package/types/button.d.ts +0 -70
- package/types/calendar.d.ts +0 -225
- package/types/card.d.ts +0 -48
- package/types/checkbox.d.ts +0 -24
- package/types/countdown.d.ts +0 -95
- package/types/curtain.d.ts +0 -26
- package/types/divider.d.ts +0 -33
- package/types/drawer.d.ts +0 -48
- package/types/fab.d.ts +0 -21
- package/types/flex.d.ts +0 -27
- package/types/float-button.d.ts +0 -26
- package/types/float-layout.d.ts +0 -73
- package/types/form.d.ts +0 -26
- package/types/grid.d.ts +0 -51
- package/types/icon.d.ts +0 -12
- package/types/image-picker.d.ts +0 -73
- package/types/index.d.ts +0 -55
- package/types/indexes.d.ts +0 -76
- package/types/input-number.d.ts +0 -89
- package/types/input.d.ts +0 -162
- package/types/list.d.ts +0 -84
- package/types/load-more.d.ts +0 -43
- package/types/message.d.ts +0 -43
- package/types/modal.d.ts +0 -62
- package/types/nav-bar.d.ts +0 -65
- package/types/noticebar.d.ts +0 -65
- package/types/pagination.d.ts +0 -51
- package/types/progress.d.ts +0 -30
- package/types/radio.d.ts +0 -47
- package/types/range.d.ts +0 -63
- package/types/rate.d.ts +0 -34
- package/types/search-bar.d.ts +0 -105
- package/types/segmented-control.d.ts +0 -44
- package/types/slider.d.ts +0 -73
- package/types/steps.d.ts +0 -69
- package/types/swipe-action.d.ts +0 -86
- package/types/switch.d.ts +0 -38
- package/types/tab-bar.d.ts +0 -98
- package/types/tabs-pane.d.ts +0 -25
- package/types/tabs.d.ts +0 -62
- package/types/tag.d.ts +0 -48
- package/types/textarea.d.ts +0 -113
- package/types/timeline.d.ts +0 -46
- package/types/toast.d.ts +0 -53
- /package/{dist → lib}/style/components/accordion.scss +0 -0
- /package/{dist → lib}/style/components/action-sheet.scss +0 -0
- /package/{dist → lib}/style/components/activity-indicator.scss +0 -0
- /package/{dist → lib}/style/components/article.scss +0 -0
- /package/{dist → lib}/style/components/avatar.scss +0 -0
- /package/{dist → lib}/style/components/badge.scss +0 -0
- /package/{dist → lib}/style/components/button.scss +0 -0
- /package/{dist → lib}/style/components/calendar.scss +0 -0
- /package/{dist → lib}/style/components/card.scss +0 -0
- /package/{dist → lib}/style/components/checkbox.scss +0 -0
- /package/{dist → lib}/style/components/countdown.scss +0 -0
- /package/{dist → lib}/style/components/divider.scss +0 -0
- /package/{dist → lib}/style/components/drawer.scss +0 -0
- /package/{dist → lib}/style/components/fab.scss +0 -0
- /package/{dist → lib}/style/components/flex.scss +0 -0
- /package/{dist → lib}/style/components/float-layout.scss +0 -0
- /package/{dist → lib}/style/components/form.scss +0 -0
- /package/{dist → lib}/style/components/icon.scss +0 -0
- /package/{dist → lib}/style/components/image-picker.scss +0 -0
- /package/{dist → lib}/style/components/indexes.scss +0 -0
- /package/{dist → lib}/style/components/input-number.scss +0 -0
- /package/{dist → lib}/style/components/input.scss +0 -0
- /package/{dist → lib}/style/components/load-more.scss +0 -0
- /package/{dist → lib}/style/components/loading.scss +0 -0
- /package/{dist → lib}/style/components/message.scss +0 -0
- /package/{dist → lib}/style/components/modal.scss +0 -0
- /package/{dist → lib}/style/components/nav-bar.scss +0 -0
- /package/{dist → lib}/style/components/noticebar.scss +0 -0
- /package/{dist → lib}/style/components/pagination.scss +0 -0
- /package/{dist → lib}/style/components/progress.scss +0 -0
- /package/{dist → lib}/style/components/radio.scss +0 -0
- /package/{dist → lib}/style/components/rate.scss +0 -0
- /package/{dist → lib}/style/components/search-bar.scss +0 -0
- /package/{dist → lib}/style/components/segmented-control.scss +0 -0
- /package/{dist → lib}/style/components/slider.scss +0 -0
- /package/{dist → lib}/style/components/steps.scss +0 -0
- /package/{dist → lib}/style/components/swipe-action.scss +0 -0
- /package/{dist → lib}/style/components/switch.scss +0 -0
- /package/{dist → lib}/style/components/tab-bar.scss +0 -0
- /package/{dist → lib}/style/components/tabs.scss +0 -0
- /package/{dist → lib}/style/components/tag.scss +0 -0
- /package/{dist → lib}/style/components/textarea.scss +0 -0
- /package/{dist → lib}/style/components/timeline.scss +0 -0
- /package/{dist → lib}/style/index.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/absolute-center.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/active.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/alignhack.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/border.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/clearfix.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/disabled.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/flex.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/hairline.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/line.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/overlay.scss +0 -0
- /package/{dist → lib}/style/mixins/libs/placeholder.scss +0 -0
- /package/{dist → lib}/style/themes/purple.scss +0 -0
- /package/{dist → lib}/style/themes/red.scss +0 -0
|
@@ -50,27 +50,27 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
50
50
|
public static propTypes: InferProps<AtInputNumberProps>
|
|
51
51
|
|
|
52
52
|
state = {
|
|
53
|
-
width: null
|
|
53
|
+
width: null
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
widths = [] as number[]
|
|
57
57
|
|
|
58
58
|
private handleClick(clickType: 'minus' | 'plus', e: CommonEvent): void {
|
|
59
59
|
const { disabled, value, min = 0, max = 100, step = 1 } = this.props
|
|
60
|
-
const lowThanMin = clickType === 'minus' && value <= min
|
|
61
|
-
const overThanMax = clickType === 'plus' && value >= max
|
|
60
|
+
const lowThanMin = clickType === 'minus' && Number(value) <= min
|
|
61
|
+
const overThanMax = clickType === 'plus' && Number(value) >= max
|
|
62
62
|
if (lowThanMin || overThanMax || disabled) {
|
|
63
63
|
const deltaValue = clickType === 'minus' ? -step : step
|
|
64
64
|
const errorValue = addNum(Number(value), deltaValue)
|
|
65
65
|
if (disabled) {
|
|
66
66
|
this.handleError({
|
|
67
67
|
type: 'DISABLED',
|
|
68
|
-
errorValue
|
|
68
|
+
errorValue
|
|
69
69
|
})
|
|
70
70
|
} else {
|
|
71
71
|
this.handleError({
|
|
72
72
|
type: lowThanMin ? 'LOW' : 'OVER',
|
|
73
|
-
errorValue
|
|
73
|
+
errorValue
|
|
74
74
|
})
|
|
75
75
|
}
|
|
76
76
|
return
|
|
@@ -85,18 +85,18 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
85
85
|
const { max = 100, min = 0 } = this.props
|
|
86
86
|
let resultValue = value === '' ? min : value
|
|
87
87
|
// 此处不能使用 Math.max,会是字符串变数字,并丢失 .
|
|
88
|
-
if (resultValue > max) {
|
|
88
|
+
if (Number(resultValue) > max) {
|
|
89
89
|
resultValue = max
|
|
90
90
|
this.handleError({
|
|
91
91
|
type: 'OVER',
|
|
92
|
-
errorValue: resultValue
|
|
92
|
+
errorValue: resultValue
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
|
-
if (resultValue < min) {
|
|
95
|
+
if (Number(resultValue) < min) {
|
|
96
96
|
resultValue = min
|
|
97
97
|
this.handleError({
|
|
98
98
|
type: 'LOW',
|
|
99
|
-
errorValue: resultValue
|
|
99
|
+
errorValue: resultValue
|
|
100
100
|
})
|
|
101
101
|
}
|
|
102
102
|
if (resultValue && !Number(resultValue)) {
|
|
@@ -104,7 +104,7 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
104
104
|
|
|
105
105
|
this.handleError({
|
|
106
106
|
type: 'OVER',
|
|
107
|
-
errorValue: resultValue
|
|
107
|
+
errorValue: resultValue
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -139,7 +139,7 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
139
139
|
const widths = type === 'input' ? this.widths : this.widths.reverse()
|
|
140
140
|
const [btnWidth, inputWidth] = widths
|
|
141
141
|
this.setState({
|
|
142
|
-
width: btnWidth * 2 + inputWidth + 2
|
|
142
|
+
width: btnWidth * 2 + inputWidth + 2
|
|
143
143
|
})
|
|
144
144
|
}
|
|
145
145
|
// console.log('event.nativeEvent.layout', event.nativeEvent.layout)
|
|
@@ -156,7 +156,7 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
156
156
|
min = 0,
|
|
157
157
|
max = 100,
|
|
158
158
|
size,
|
|
159
|
-
disabledInput
|
|
159
|
+
disabledInput
|
|
160
160
|
} = this.props
|
|
161
161
|
|
|
162
162
|
const inputStyle: any = {}
|
|
@@ -169,13 +169,13 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
169
169
|
rootStyle.width = this.state.width
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
const inputValue = Number(this.handleValue(value))
|
|
172
|
+
const inputValue = Number(this.handleValue(value ?? ''))
|
|
173
173
|
const rootCls = classNames(
|
|
174
174
|
'at-input-number',
|
|
175
175
|
{
|
|
176
|
-
'at-input-number--lg': size === 'large'
|
|
176
|
+
'at-input-number--lg': size === 'large'
|
|
177
177
|
},
|
|
178
|
-
className
|
|
178
|
+
className
|
|
179
179
|
)
|
|
180
180
|
const minusBtnCls = classNames('at-input-number__btn')
|
|
181
181
|
const plusBtnCls = classNames('at-input-number__btn')
|
|
@@ -194,7 +194,7 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
194
194
|
value='subtract'
|
|
195
195
|
className={classNames({
|
|
196
196
|
'at-input-number__btn-subtract': true,
|
|
197
|
-
'at-input-number--disabled': minusDisabled
|
|
197
|
+
'at-input-number--disabled': minusDisabled
|
|
198
198
|
})}
|
|
199
199
|
/>
|
|
200
200
|
</View>
|
|
@@ -216,7 +216,7 @@ export default class AtInputNumber extends React.Component<AtInputNumberProps> {
|
|
|
216
216
|
value='add'
|
|
217
217
|
className={classNames({
|
|
218
218
|
'at-input-number__btn-add': true,
|
|
219
|
-
'at-input-number--disabled': addDisabled
|
|
219
|
+
'at-input-number--disabled': addDisabled
|
|
220
220
|
})}
|
|
221
221
|
/>
|
|
222
222
|
</View>
|
|
@@ -238,7 +238,7 @@ AtInputNumber.defaultProps = {
|
|
|
238
238
|
step: 1,
|
|
239
239
|
size: 'normal',
|
|
240
240
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
241
|
-
onChange: (): void => {}
|
|
241
|
+
onChange: (): void => {}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
AtInputNumber.propTypes = {
|
|
@@ -255,5 +255,5 @@ AtInputNumber.propTypes = {
|
|
|
255
255
|
disabledInput: PropTypes.bool,
|
|
256
256
|
onChange: PropTypes.func,
|
|
257
257
|
onBlur: PropTypes.func,
|
|
258
|
-
onErrorInput: PropTypes.func
|
|
258
|
+
onErrorInput: PropTypes.func
|
|
259
259
|
}
|
|
@@ -108,7 +108,7 @@ export default class AtMessage extends React.Component<
|
|
|
108
108
|
<Animated.View
|
|
109
109
|
className={rootCls}
|
|
110
110
|
onLayout={this.onLayout.bind(this)}
|
|
111
|
-
style={Object.assign({}, customStyle, {
|
|
111
|
+
style={Object.assign({}, customStyle as object, {
|
|
112
112
|
transform: [{ translateY }]
|
|
113
113
|
})}
|
|
114
114
|
>
|
|
@@ -19,13 +19,15 @@ export default class AtSwipeAction extends React.Component<
|
|
|
19
19
|
public constructor(props: AtSwipeActionProps) {
|
|
20
20
|
super(props)
|
|
21
21
|
const { isOpened, maxDistance } = props
|
|
22
|
-
this.maxOffsetSize = maxDistance
|
|
22
|
+
this.maxOffsetSize = maxDistance || 0
|
|
23
23
|
this.state = {
|
|
24
24
|
componentId: uuid(),
|
|
25
25
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
26
26
|
offsetSize: !!isOpened ? -this.maxOffsetSize : 0,
|
|
27
27
|
_isOpened: !!isOpened,
|
|
28
|
-
needAnimation: false
|
|
28
|
+
needAnimation: false,
|
|
29
|
+
eleWidth: 0,
|
|
30
|
+
maxOffsetSize: this.maxOffsetSize
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -25,16 +25,18 @@ export default class AtSwipeAction extends React.Component<
|
|
|
25
25
|
public constructor(props: AtSwipeActionProps) {
|
|
26
26
|
super(props)
|
|
27
27
|
const { isOpened, maxDistance, areaWidth } = props
|
|
28
|
-
this.maxOffsetSize = maxDistance
|
|
28
|
+
this.maxOffsetSize = maxDistance || 0
|
|
29
29
|
this.state = {
|
|
30
30
|
componentId: uuid(),
|
|
31
31
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
32
32
|
offsetSize: !!isOpened ? -this.maxOffsetSize : 0,
|
|
33
33
|
_isOpened: !!isOpened,
|
|
34
|
-
needAnimation: false
|
|
34
|
+
needAnimation: false,
|
|
35
|
+
eleWidth: this.eleWidth,
|
|
36
|
+
maxOffsetSize: this.maxOffsetSize
|
|
35
37
|
}
|
|
36
38
|
this.moveX = this.state.offsetSize
|
|
37
|
-
this.eleWidth = areaWidth
|
|
39
|
+
this.eleWidth = areaWidth || 0
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
public UNSAFE_componentWillReceiveProps(nextProps: AtSwipeActionProps): void {
|
|
@@ -106,8 +108,7 @@ export default class AtSwipeAction extends React.Component<
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
onTouchEnd = e => {
|
|
109
|
-
|
|
110
|
-
if (Math.abs(this.moveX) < maxOffsetSize / 2) {
|
|
111
|
+
if (Math.abs(this.moveX) < this.maxOffsetSize / 2) {
|
|
111
112
|
this._reset(false)
|
|
112
113
|
this.handleClosed(e)
|
|
113
114
|
} else {
|
|
@@ -89,7 +89,7 @@ export default class AtTabBar extends React.Component<AtTabBarProps> {
|
|
|
89
89
|
'at-tab-bar__item--active': current === i
|
|
90
90
|
})}
|
|
91
91
|
style={current === i ? selectedStyle : defaultStyle}
|
|
92
|
-
key={
|
|
92
|
+
key={`tab-bar-${i}`}
|
|
93
93
|
onClick={this.handleClick.bind(this, i)}
|
|
94
94
|
>
|
|
95
95
|
<View>
|
|
@@ -27,7 +27,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
27
27
|
this.state = {
|
|
28
28
|
_scrollLeft: 0,
|
|
29
29
|
_scrollTop: 0,
|
|
30
|
-
_scrollIntoView: ''
|
|
30
|
+
_scrollIntoView: ''
|
|
31
31
|
}
|
|
32
32
|
this._tabId = isTest() ? 'tabs-AOTU2018' : uuid()
|
|
33
33
|
// 触摸时的原点
|
|
@@ -52,7 +52,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
52
52
|
case Taro.ENV_TYPE.SWAN: {
|
|
53
53
|
const index = Math.max(idx - 1, 0)
|
|
54
54
|
this.setState({
|
|
55
|
-
_scrollIntoView: `tab${this._tabId}${index}
|
|
55
|
+
_scrollIntoView: `tab${this._tabId}${index}`
|
|
56
56
|
})
|
|
57
57
|
break
|
|
58
58
|
}
|
|
@@ -62,7 +62,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
62
62
|
prevTabItem &&
|
|
63
63
|
this.setState({
|
|
64
64
|
_scrollTop: prevTabItem.offsetTop,
|
|
65
|
-
_scrollLeft: prevTabItem.offsetLeft
|
|
65
|
+
_scrollLeft: prevTabItem.offsetLeft
|
|
66
66
|
})
|
|
67
67
|
break
|
|
68
68
|
}
|
|
@@ -79,7 +79,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
79
79
|
current--
|
|
80
80
|
}
|
|
81
81
|
this.setState({
|
|
82
|
-
_scrollLeft: width
|
|
82
|
+
_scrollLeft: width
|
|
83
83
|
})
|
|
84
84
|
}
|
|
85
85
|
if (scrollY) {
|
|
@@ -90,7 +90,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
90
90
|
current--
|
|
91
91
|
}
|
|
92
92
|
this.setState({
|
|
93
|
-
_scrollTop: height
|
|
93
|
+
_scrollTop: height
|
|
94
94
|
})
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -124,7 +124,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
124
124
|
const { swipeable, tabDirection, current, tabList } = this.props
|
|
125
125
|
if (!swipeable || tabDirection === 'vertical') return
|
|
126
126
|
|
|
127
|
-
const touchMove = e.nativeEvent.pageX
|
|
127
|
+
const touchMove = (e as any).nativeEvent.pageX
|
|
128
128
|
const moveDistance = touchMove - this._touchDot
|
|
129
129
|
const maxIndex = tabList.length
|
|
130
130
|
if (
|
|
@@ -195,14 +195,14 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
195
195
|
// animated,
|
|
196
196
|
tabList,
|
|
197
197
|
scroll,
|
|
198
|
-
current
|
|
198
|
+
current
|
|
199
199
|
} = this.props
|
|
200
200
|
const { _scrollLeft, _scrollTop, _scrollIntoView } = this.state
|
|
201
201
|
|
|
202
|
-
const heightStyle = { height:
|
|
202
|
+
const heightStyle = height ? { height: parseInt(height) } : {}
|
|
203
203
|
const underlineStyle = {
|
|
204
204
|
height: tabDirection === 'vertical' ? `${tabList.length * 100}%` : 1,
|
|
205
|
-
width: tabDirection === 'horizontal' ? `${tabList.length * 100}%` : 1
|
|
205
|
+
width: tabDirection === 'horizontal' ? `${tabList.length * 100}%` : 1
|
|
206
206
|
}
|
|
207
207
|
const bodyStyle: React.CSSProperties = {}
|
|
208
208
|
// let transformStyle = [{ translateY: '' }]
|
|
@@ -223,7 +223,7 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
223
223
|
'at-tabs__item': true,
|
|
224
224
|
'at-tabs__item--active': current === idx,
|
|
225
225
|
[`at-tabs__item--${tabDirection}`]: true,
|
|
226
|
-
[`at-tabs__item--${tabDirection}--active`]: current === idx
|
|
226
|
+
[`at-tabs__item--${tabDirection}--active`]: current === idx
|
|
227
227
|
})
|
|
228
228
|
|
|
229
229
|
return (
|
|
@@ -251,9 +251,9 @@ export default class AtTabs extends React.Component<AtTabsProps, AtTabsState> {
|
|
|
251
251
|
'at-tabs': true,
|
|
252
252
|
'at-tabs--scroll': scroll,
|
|
253
253
|
[`at-tabs--${tabDirection}`]: true,
|
|
254
|
-
[`at-tabs--${ENV}`]: true
|
|
254
|
+
[`at-tabs--${ENV}`]: true
|
|
255
255
|
},
|
|
256
|
-
className
|
|
256
|
+
className
|
|
257
257
|
)
|
|
258
258
|
const scrollX = tabDirection === 'horizontal'
|
|
259
259
|
const scrollY = tabDirection === 'vertical'
|
|
@@ -308,7 +308,7 @@ AtTabs.defaultProps = {
|
|
|
308
308
|
animated: true,
|
|
309
309
|
tabList: [],
|
|
310
310
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
311
|
-
onClick: (): void => {}
|
|
311
|
+
onClick: (): void => {}
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
AtTabs.propTypes = {
|
|
@@ -321,5 +321,5 @@ AtTabs.propTypes = {
|
|
|
321
321
|
scroll: PropTypes.bool,
|
|
322
322
|
animated: PropTypes.bool,
|
|
323
323
|
tabList: PropTypes.array,
|
|
324
|
-
onClick: PropTypes.func
|
|
324
|
+
onClick: PropTypes.func
|
|
325
325
|
}
|
|
@@ -78,7 +78,7 @@ export default class AtTextarea extends React.Component<AtTextareaProps> {
|
|
|
78
78
|
}
|
|
79
79
|
const rootCls = classNames('at-textarea', `at-textarea--${ENV}`, className)
|
|
80
80
|
|
|
81
|
-
const sizeError = _maxLength < value.length
|
|
81
|
+
const sizeError = _maxLength < (value || '').length
|
|
82
82
|
const placeholderCls = classNames('placeholder', placeholderClass)
|
|
83
83
|
|
|
84
84
|
return (
|
|
@@ -111,7 +111,7 @@ export default class AtTextarea extends React.Component<AtTextareaProps> {
|
|
|
111
111
|
'at-textarea__counter--error': sizeError
|
|
112
112
|
})}
|
|
113
113
|
>
|
|
114
|
-
{`${value.length}/${_maxLength}`}
|
|
114
|
+
{`${(value || '').length}/${_maxLength}`}
|
|
115
115
|
</View>
|
|
116
116
|
)}
|
|
117
117
|
</View>
|
package/README.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Taro UI
|
|
2
|
-
|
|
3
|
-
[![NPM][npm-version-image]][npm-version-url] [![NPM Downloads][npm-downloads-image]][npm-downloads-url] [![david-dm][david-dm-image]][david-dm-url] [![License][license-image]][license-url]
|
|
4
|
-
|
|
5
|
-
一款基于 `Taro` 框架开发的多端 UI 组件库
|
|
6
|
-
|
|
7
|
-
## 特性
|
|
8
|
-
|
|
9
|
-
- 基于 `Taro` 开发 UI 组件
|
|
10
|
-
- 一套组件可以在 `微信小程序`,`支付宝小程序`,`百度小程序`,`H5`,`ReactNative` 多端适配运行
|
|
11
|
-
- 提供友好的 API,可灵活的使用组件
|
|
12
|
-
|
|
13
|
-
## 关于 Taro
|
|
14
|
-
|
|
15
|
-
Taro 是由 [凹凸实验室](https://aotu.io) 倾力打造的多端开发解决方案。现如今市面上端的形态多种多样,Web、ReactNative、微信小程序等各种端大行其道,当业务要求同时在不同的端都要求有所表现的时候,针对不同的端去编写多套代码的成本显然非常高,这时候只编写一套代码就能够适配到多端的能力就显得极为需要。
|
|
16
|
-
|
|
17
|
-
使用 Taro,我们可以只书写一套代码,再通过 Taro 的编译工具,将源代码分别编译出可以在不同端(微信小程序、H5、RN等)运行的代码。
|
|
18
|
-
|
|
19
|
-
## 体验
|
|
20
|
-
|
|
21
|
-
请使用微信扫一扫以下体验码
|
|
22
|
-
|
|
23
|
-

|
|
24
|
-
|
|
25
|
-
## 相关链接
|
|
26
|
-
|
|
27
|
-
- [Taro UI 使用文档](https://taro-ui.taro.zone)
|
|
28
|
-
- [Taro UI 官方示例](https://github.com/NervJS/taro-ui-demo)
|
|
29
|
-
- [Taro](https://taro.jd.com/)
|
|
30
|
-
- [Taro 物料市场](https://taro-ext.jd.com)
|
|
31
|
-
- [Taro 论坛 Taro-UI 板块](https://taro-club.jd.com/category/11/taro-ui)
|
|
32
|
-
|
|
33
|
-
## 安装
|
|
34
|
-
|
|
35
|
-
### 2.x
|
|
36
|
-
当 Taro 版本 < 3 时,使用 2.x 版本
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
$ npm install taro-ui@2.3.4
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 3.x
|
|
43
|
-
当 Taro 版本 ≥ 3 时,使用 3.x 版本
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
$ npm install taro-ui@latest
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## 使用
|
|
50
|
-
|
|
51
|
-
在代码中 `import` 需要的组件并按照文档说明使用
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
import { AtButton } from 'taro-ui'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## 开发交流
|
|
58
|
-
|
|
59
|
-
[官方微信交流群](https://github.com/NervJS/taro-ui/issues/16)
|
|
60
|
-
|
|
61
|
-
## 开发计划
|
|
62
|
-
|
|
63
|
-
[开发计划](./PLANS.md)
|
|
64
|
-
|
|
65
|
-
## 路线图
|
|
66
|
-
|
|
67
|
-
![Roadmap][roadmap-image]
|
|
68
|
-
|
|
69
|
-
## 贡献
|
|
70
|
-
|
|
71
|
-
如果你在使用 `Taro UI` 时遇到问题,或者有好的建议,欢迎给我们提 `Issue` 或 `Pull Request`。在开始之前,请阅读 [贡献指南](https://github.com/NervJS/taro-ui/blob/master/.github/CONTRIBUTING.md)
|
|
72
|
-
|
|
73
|
-
## License
|
|
74
|
-
|
|
75
|
-
MIT
|
|
76
|
-
|
|
77
|
-
[npm-version-image]: https://img.shields.io/npm/v/taro-ui.svg?style=flat-square
|
|
78
|
-
[npm-version-url]: https://www.npmjs.com/package/taro-ui
|
|
79
|
-
[npm-downloads-image]: https://img.shields.io/npm/dm/taro-ui?style=flat-square
|
|
80
|
-
[npm-downloads-url]: https://www.npmjs.com/package/taro-ui
|
|
81
|
-
[david-dm-image]: https://david-dm.org/NervJS/taro-ui.svg?style=flat-square
|
|
82
|
-
[david-dm-url]: https://david-dm.org/NervJS/taro-ui
|
|
83
|
-
[license-image]: https://img.shields.io/github/license/NervJS/taro-ui?style=flat-square
|
|
84
|
-
[license-url]: https://github.com/NervJS/taro-ui/blob/master/LICENSE
|
|
85
|
-
[roadmap-image]: ./docs/assets/taro-ui-roadmap.svg
|