taro-ui 3.3.1 → 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/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 -55
- 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/grid.scss +2 -2
- package/lib/style/components/index.scss +52 -0
- package/{dist → lib}/style/components/list.scss +2 -2
- 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 +24 -32
- 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/dist/index.esm.js +0 -8506
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -8567
- 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/curtain.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/range.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/components/toast.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
|
@@ -1,165 +1,193 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import _toString from
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import React from
|
|
5
|
-
import { Input, Text, View } from
|
|
6
|
-
import { pxTransform } from
|
|
7
|
-
// TODO: Check all types
|
|
8
|
-
// 实现两数相加并保留小数点后最短尾数
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import _toString from "lodash/toString";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Input, Text, View } from "@tarojs/components";
|
|
6
|
+
import { pxTransform } from "../../common/utils";
|
|
9
7
|
function addNum(num1, num2) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const m = Math.pow(10, Math.max(sq1, sq2));
|
|
24
|
-
return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
|
|
8
|
+
let sq1, sq2;
|
|
9
|
+
try {
|
|
10
|
+
sq1 = _toString(num1).split(".")[1].length;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
sq1 = 0;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
sq2 = _toString(num2).split(".")[1].length;
|
|
16
|
+
} catch (e) {
|
|
17
|
+
sq2 = 0;
|
|
18
|
+
}
|
|
19
|
+
const m = Math.pow(10, Math.max(sq1, sq2));
|
|
20
|
+
return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
|
|
25
21
|
}
|
|
26
|
-
// 格式化数字,处理01变成1,并且不处理1. 这种情况
|
|
27
22
|
function parseValue(num) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
return _toString(num);
|
|
23
|
+
if (num === "") return "0";
|
|
24
|
+
const numStr = _toString(num);
|
|
25
|
+
if (numStr.indexOf("0") === 0 && numStr.indexOf(".") === -1) {
|
|
26
|
+
return _toString(parseFloat(num));
|
|
27
|
+
}
|
|
28
|
+
return _toString(num);
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
errorValue: resultValue
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
resultValue = parseValue(String(resultValue));
|
|
66
|
-
return resultValue;
|
|
67
|
-
};
|
|
68
|
-
this.handleInput = (e) => {
|
|
69
|
-
const { value } = e.target;
|
|
70
|
-
const { disabled } = this.props;
|
|
71
|
-
if (disabled)
|
|
72
|
-
return '';
|
|
73
|
-
const newValue = this.handleValue(value);
|
|
74
|
-
this.props.onChange(Number(newValue), e);
|
|
75
|
-
return newValue;
|
|
76
|
-
};
|
|
77
|
-
this.handleBlur = (event) => this.props.onBlur && this.props.onBlur(event);
|
|
78
|
-
this.handleError = (errorValue) => {
|
|
79
|
-
if (!this.props.onErrorInput) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this.props.onErrorInput(errorValue);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
handleClick(clickType, e) {
|
|
86
|
-
const { disabled, value, min = 0, max = 100, step = 1 } = this.props;
|
|
87
|
-
const lowThanMin = clickType === 'minus' && Number(value) <= min;
|
|
88
|
-
const overThanMax = clickType === 'plus' && Number(value) >= max;
|
|
89
|
-
if (lowThanMin || overThanMax || disabled) {
|
|
90
|
-
const deltaValue = clickType === 'minus' ? -step : step;
|
|
91
|
-
const errorValue = addNum(Number(value), deltaValue);
|
|
92
|
-
if (disabled) {
|
|
93
|
-
this.handleError({
|
|
94
|
-
type: 'DISABLED',
|
|
95
|
-
errorValue
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.handleError({
|
|
100
|
-
type: lowThanMin ? 'LOW' : 'OVER',
|
|
101
|
-
errorValue
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const deltaValue = clickType === 'minus' ? -step : step;
|
|
107
|
-
let newValue = addNum(Number(value), deltaValue);
|
|
108
|
-
newValue = Number(this.handleValue(newValue));
|
|
109
|
-
this.props.onChange(newValue, e);
|
|
110
|
-
}
|
|
111
|
-
render() {
|
|
112
|
-
const { customStyle, className, width, disabled, value, type, min = 0, max = 100, size, disabledInput } = this.props;
|
|
113
|
-
const inputStyle = {
|
|
114
|
-
width: width ? `${pxTransform(width)}` : ''
|
|
115
|
-
};
|
|
116
|
-
const inputValue = Number(this.handleValue(value));
|
|
117
|
-
const rootCls = classNames('at-input-number', {
|
|
118
|
-
'at-input-number--lg': size === 'large'
|
|
119
|
-
}, className);
|
|
120
|
-
const minusBtnCls = classNames('at-input-number__btn', {
|
|
121
|
-
'at-input-number--disabled': inputValue <= min || disabled
|
|
30
|
+
class AtInputNumber extends React.Component {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.handleValue = (value) => {
|
|
34
|
+
const { max = 100, min = 0 } = this.props;
|
|
35
|
+
let resultValue = value === "" ? min : value;
|
|
36
|
+
if (Number(resultValue) > max) {
|
|
37
|
+
resultValue = max;
|
|
38
|
+
this.handleError({
|
|
39
|
+
type: "OVER",
|
|
40
|
+
errorValue: resultValue
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (Number(resultValue) < min) {
|
|
44
|
+
resultValue = min;
|
|
45
|
+
this.handleError({
|
|
46
|
+
type: "LOW",
|
|
47
|
+
errorValue: resultValue
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (resultValue && !Number(resultValue)) {
|
|
51
|
+
resultValue = parseFloat(String(resultValue)) || min;
|
|
52
|
+
this.handleError({
|
|
53
|
+
type: "OVER",
|
|
54
|
+
errorValue: resultValue
|
|
122
55
|
});
|
|
123
|
-
|
|
124
|
-
|
|
56
|
+
}
|
|
57
|
+
resultValue = parseValue(String(resultValue));
|
|
58
|
+
return resultValue;
|
|
59
|
+
};
|
|
60
|
+
this.handleInput = (e) => {
|
|
61
|
+
const { value } = e.target;
|
|
62
|
+
const { disabled } = this.props;
|
|
63
|
+
if (disabled) return "";
|
|
64
|
+
const newValue = this.handleValue(value);
|
|
65
|
+
this.props.onChange(Number(newValue), e);
|
|
66
|
+
return newValue;
|
|
67
|
+
};
|
|
68
|
+
this.handleBlur = (event) => this.props.onBlur && this.props.onBlur(event);
|
|
69
|
+
this.handleError = (errorValue) => {
|
|
70
|
+
if (!this.props.onErrorInput) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.props.onErrorInput(errorValue);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
handleClick(clickType, e) {
|
|
77
|
+
const { disabled, value, min = 0, max = 100, step = 1 } = this.props;
|
|
78
|
+
const lowThanMin = clickType === "minus" && Number(value) <= min;
|
|
79
|
+
const overThanMax = clickType === "plus" && Number(value) >= max;
|
|
80
|
+
if (lowThanMin || overThanMax || disabled) {
|
|
81
|
+
const deltaValue2 = clickType === "minus" ? -step : step;
|
|
82
|
+
const errorValue = addNum(Number(value), deltaValue2);
|
|
83
|
+
if (disabled) {
|
|
84
|
+
this.handleError({
|
|
85
|
+
type: "DISABLED",
|
|
86
|
+
errorValue
|
|
125
87
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
88
|
+
} else {
|
|
89
|
+
this.handleError({
|
|
90
|
+
type: lowThanMin ? "LOW" : "OVER",
|
|
91
|
+
errorValue
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return;
|
|
132
95
|
}
|
|
96
|
+
const deltaValue = clickType === "minus" ? -step : step;
|
|
97
|
+
let newValue = addNum(Number(value), deltaValue);
|
|
98
|
+
newValue = Number(this.handleValue(newValue));
|
|
99
|
+
this.props.onChange(newValue, e);
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
const {
|
|
103
|
+
customStyle,
|
|
104
|
+
className,
|
|
105
|
+
width,
|
|
106
|
+
disabled,
|
|
107
|
+
value,
|
|
108
|
+
type,
|
|
109
|
+
min = 0,
|
|
110
|
+
max = 100,
|
|
111
|
+
size,
|
|
112
|
+
disabledInput
|
|
113
|
+
} = this.props;
|
|
114
|
+
const inputStyle = {
|
|
115
|
+
width: width ? `${pxTransform(width)}` : ""
|
|
116
|
+
};
|
|
117
|
+
const inputValue = typeof value !== "undefined" ? Number(this.handleValue(value)) : null;
|
|
118
|
+
const rootCls = classNames(
|
|
119
|
+
"at-input-number",
|
|
120
|
+
{
|
|
121
|
+
"at-input-number--lg": size === "large"
|
|
122
|
+
},
|
|
123
|
+
className
|
|
124
|
+
);
|
|
125
|
+
const minusBtnCls = classNames("at-input-number__btn", {
|
|
126
|
+
"at-input-number--disabled": inputValue !== null && inputValue <= min || disabled
|
|
127
|
+
});
|
|
128
|
+
const plusBtnCls = classNames("at-input-number__btn", {
|
|
129
|
+
"at-input-number--disabled": inputValue !== null && inputValue >= max || disabled
|
|
130
|
+
});
|
|
131
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: customStyle }, /* @__PURE__ */ React.createElement(
|
|
132
|
+
View,
|
|
133
|
+
{
|
|
134
|
+
className: minusBtnCls,
|
|
135
|
+
onClick: this.handleClick.bind(this, "minus")
|
|
136
|
+
},
|
|
137
|
+
/* @__PURE__ */ React.createElement(Text, { className: "at-icon at-icon-subtract at-input-number__btn-subtract" })
|
|
138
|
+
), /* @__PURE__ */ React.createElement(
|
|
139
|
+
Input,
|
|
140
|
+
{
|
|
141
|
+
className: "at-input-number__input",
|
|
142
|
+
style: inputStyle,
|
|
143
|
+
type,
|
|
144
|
+
value: inputValue !== null ? String(inputValue) : "",
|
|
145
|
+
disabled: disabledInput || disabled,
|
|
146
|
+
onInput: this.handleInput,
|
|
147
|
+
onBlur: this.handleBlur
|
|
148
|
+
}
|
|
149
|
+
), /* @__PURE__ */ React.createElement(
|
|
150
|
+
View,
|
|
151
|
+
{
|
|
152
|
+
className: plusBtnCls,
|
|
153
|
+
onClick: this.handleClick.bind(this, "plus")
|
|
154
|
+
},
|
|
155
|
+
/* @__PURE__ */ React.createElement(Text, { className: "at-icon at-icon-add at-input-number__btn-add" })
|
|
156
|
+
));
|
|
157
|
+
}
|
|
133
158
|
}
|
|
134
159
|
AtInputNumber.defaultProps = {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
160
|
+
customStyle: {},
|
|
161
|
+
className: "",
|
|
162
|
+
disabled: false,
|
|
163
|
+
disabledInput: false,
|
|
164
|
+
type: "number",
|
|
165
|
+
width: 0,
|
|
166
|
+
min: 0,
|
|
167
|
+
max: 100,
|
|
168
|
+
step: 1,
|
|
169
|
+
size: "normal",
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
171
|
+
onChange: () => {
|
|
172
|
+
}
|
|
148
173
|
};
|
|
149
174
|
AtInputNumber.propTypes = {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
175
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
176
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
177
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
178
|
+
type: PropTypes.oneOf(["number", "digit"]),
|
|
179
|
+
disabled: PropTypes.bool,
|
|
180
|
+
width: PropTypes.number,
|
|
181
|
+
min: PropTypes.number,
|
|
182
|
+
max: PropTypes.number,
|
|
183
|
+
step: PropTypes.number,
|
|
184
|
+
size: PropTypes.oneOf(["normal", "large"]),
|
|
185
|
+
disabledInput: PropTypes.bool,
|
|
186
|
+
onChange: PropTypes.func,
|
|
187
|
+
onBlur: PropTypes.func,
|
|
188
|
+
onErrorInput: PropTypes.func
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
AtInputNumber as default
|
|
164
192
|
};
|
|
165
193
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/input-number/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,SAAS,MAAM,iBAAiB,CAAA;AACvC,OAAO,SAAyB,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,wBAAwB;AAExB,oBAAoB;AACpB,SAAS,MAAM,CAAC,IAAY,EAAE,IAAY;IACxC,IAAI,GAAW,EAAE,GAAW,CAAA;IAC5B,IAAI;QACF,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;KAC3C;IAAC,OAAO,CAAC,EAAE;QACV,GAAG,GAAG,CAAC,CAAA;KACR;IACD,IAAI;QACF,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;KAC3C;IAAC,OAAO,CAAC,EAAE;QACV,GAAG,GAAG,CAAC,CAAA;KACR;IACD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;IAC1C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,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,YAAY,EAAE,SAAS,CAAC,IAAI;CAC7B,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/input-number/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport _toString from 'lodash/toString'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Input, Text, View } from '@tarojs/components'\nimport { CommonEvent, ITouchEvent } from '@tarojs/components/types/common'\nimport { AtInputNumberProps, InputError } from '../../../types/input-number'\nimport { pxTransform } from '../../common/utils'\n\n// TODO: Check all types\n\n// 实现两数相加并保留小数点后最短尾数\nfunction addNum(num1: number, num2: number): number {\n let sq1: number, sq2: number\n try {\n sq1 = _toString(num1).split('.')[1].length\n } catch (e) {\n sq1 = 0\n }\n try {\n sq2 = _toString(num2).split('.')[1].length\n } catch (e) {\n sq2 = 0\n }\n const m = Math.pow(10, Math.max(sq1, sq2))\n return (Math.round(num1 * m) + Math.round(num2 * m)) / m\n}\n\n// 格式化数字,处理01变成1,并且不处理1. 这种情况\nfunction parseValue(num: string): string {\n if (num === '') return '0'\n\n const numStr = _toString(num)\n if (numStr.indexOf('0') === 0 && numStr.indexOf('.') === -1) {\n // 处理01变成1,并且不处理1.\n return _toString(parseFloat(num))\n }\n return _toString(num)\n}\n\ntype ExtendEvent = {\n target: {\n value: string | number\n }\n}\n\nexport default class AtInputNumber extends React.Component<AtInputNumberProps> {\n public static defaultProps: AtInputNumberProps\n public static propTypes: InferProps<AtInputNumberProps>\n\n private handleClick(clickType: 'minus' | 'plus', e: CommonEvent): void {\n const { disabled, value, min = 0, max = 100, step = 1 } = this.props\n const lowThanMin = clickType === 'minus' && Number(value) <= min\n const overThanMax = clickType === 'plus' && Number(value) >= max\n if (lowThanMin || overThanMax || disabled) {\n const deltaValue = clickType === 'minus' ? -step : step\n const errorValue = addNum(Number(value), deltaValue)\n if (disabled) {\n this.handleError({\n type: 'DISABLED',\n errorValue\n })\n } else {\n this.handleError({\n type: lowThanMin ? 'LOW' : 'OVER',\n errorValue\n })\n }\n return\n }\n const deltaValue = clickType === 'minus' ? -step : step\n let newValue = addNum(Number(value), deltaValue)\n newValue = Number(this.handleValue(newValue))\n this.props.onChange(newValue, e)\n }\n\n private handleValue = (value: string | number): string => {\n const { max = 100, min = 0 } = this.props\n let resultValue = value === '' ? min : value\n // 此处不能使用 Math.max,会是字符串变数字,并丢失 .\n if (Number(resultValue) > max) {\n resultValue = max\n this.handleError({\n type: 'OVER',\n errorValue: resultValue\n })\n }\n if (Number(resultValue) < min) {\n resultValue = min\n this.handleError({\n type: 'LOW',\n errorValue: resultValue\n })\n }\n if (resultValue && !Number(resultValue)) {\n resultValue = parseFloat(String(resultValue)) || min\n\n this.handleError({\n type: 'OVER',\n errorValue: resultValue\n })\n }\n\n resultValue = parseValue(String(resultValue))\n return resultValue\n }\n\n private handleInput = (e: CommonEvent & ExtendEvent): string => {\n const { value } = e.target\n const { disabled } = this.props\n if (disabled) return ''\n\n const newValue = this.handleValue(value)\n this.props.onChange(Number(newValue), e)\n return newValue\n }\n\n private handleBlur = (event: ITouchEvent): void =>\n this.props.onBlur && this.props.onBlur(event)\n\n private handleError = (errorValue: InputError): void => {\n if (!this.props.onErrorInput) {\n return\n }\n this.props.onErrorInput(errorValue)\n }\n\n public render(): JSX.Element {\n const {\n customStyle,\n className,\n width,\n disabled,\n value,\n type,\n min = 0,\n max = 100,\n size,\n disabledInput\n } = this.props\n\n const inputStyle = {\n width: width ? `${pxTransform(width)}` : ''\n }\n const inputValue =\n typeof value !== 'undefined' ? Number(this.handleValue(value)) : null\n const rootCls = classNames(\n 'at-input-number',\n {\n 'at-input-number--lg': size === 'large'\n },\n className\n )\n const minusBtnCls = classNames('at-input-number__btn', {\n 'at-input-number--disabled':\n (inputValue !== null && inputValue <= min) || disabled\n })\n const plusBtnCls = classNames('at-input-number__btn', {\n 'at-input-number--disabled':\n (inputValue !== null && inputValue >= max) || disabled\n })\n\n return (\n <View className={rootCls} style={customStyle}>\n <View\n className={minusBtnCls}\n onClick={this.handleClick.bind(this, 'minus')}\n >\n <Text className='at-icon at-icon-subtract at-input-number__btn-subtract'></Text>\n </View>\n <Input\n className='at-input-number__input'\n style={inputStyle}\n type={type}\n value={inputValue !== null ? String(inputValue) : ''}\n disabled={disabledInput || disabled}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n />\n <View\n className={plusBtnCls}\n onClick={this.handleClick.bind(this, 'plus')}\n >\n <Text className='at-icon at-icon-add at-input-number__btn-add'></Text>\n </View>\n </View>\n )\n }\n}\n\nAtInputNumber.defaultProps = {\n customStyle: {},\n className: '',\n disabled: false,\n disabledInput: false,\n type: 'number',\n width: 0,\n min: 0,\n max: 100,\n step: 1,\n size: 'normal',\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange: (): void => {}\n}\n\nAtInputNumber.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n type: PropTypes.oneOf(['number', 'digit']),\n disabled: PropTypes.bool,\n width: PropTypes.number,\n min: PropTypes.number,\n max: PropTypes.number,\n step: PropTypes.number,\n size: PropTypes.oneOf(['normal', 'large']),\n disabledInput: PropTypes.bool,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n onErrorInput: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,OAAO,MAAM,YAAY;AAGlC,SAAS,mBAAmB;AAK5B,SAAS,OAAO,MAAc,MAAsB;AAClD,MAAI,KAAa;AACjB,MAAI;AACF,UAAM,UAAU,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE;AAAA,EACtC,SAAS,GAAG;AACV,UAAM;AAAA,EACR;AACA,MAAI;AACF,UAAM,UAAU,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE;AAAA,EACtC,SAAS,GAAG;A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Aa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC/D,MAAM,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC;AAAA,EACzC,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU;AAAA,EACjB,KAAK,UAAU;AAAA,EACf,KAAK,UAAU;AAAA,EACf,MAAM,UAAU;AAAA,EAChB,MAAM,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC;AAAA,EACzC,eAAe,UAAU;AAAA,EACzB,UAAU,UAAU;AAAA,EACpB,QAAQ,UAAU;AAAA,EAClB,cAAc,UAAU;AAC1B;","names":["deltaValue"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtListProps } from '../../../types/list';
|
|
4
|
+
export default class AtList extends React.Component<AtListProps> {
|
|
5
|
+
static defaultProps: AtListProps;
|
|
6
|
+
static propTypes: InferProps<AtListProps>;
|
|
7
|
+
render(): JSX.Element;
|
|
8
|
+
}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { View } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
class AtList extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const rootClass = classNames(
|
|
8
|
+
"at-list",
|
|
9
|
+
{
|
|
10
|
+
"at-list--no-border": !this.props.hasBorder
|
|
11
|
+
},
|
|
12
|
+
this.props.className
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootClass }, this.props.children);
|
|
15
|
+
}
|
|
12
16
|
}
|
|
13
17
|
AtList.defaultProps = {
|
|
14
|
-
|
|
18
|
+
hasBorder: true
|
|
15
19
|
};
|
|
16
20
|
AtList.propTypes = {
|
|
17
|
-
|
|
21
|
+
hasBorder: PropTypes.bool
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
AtList as default
|
|
18
25
|
};
|
|
19
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/list/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtListProps } from '../../../types/list'\n\nexport default class AtList extends React.Component<AtListProps> {\n public static defaultProps: AtListProps\n public static propTypes: InferProps<AtListProps>\n\n public render(): JSX.Element {\n const rootClass = classNames(\n 'at-list',\n {\n 'at-list--no-border': !this.props.hasBorder\n },\n this.props.className\n )\n\n return <View className={rootClass}>{this.props.children}</View>\n }\n}\n\nAtList.defaultProps = {\n hasBorder: true\n}\n\nAtList.propTypes = {\n hasBorder: PropTypes.bool\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAGrB,MAAO,eAA6B,MAAM,UAAuB;AAAA,EAIxD,SAAsB;AAC3B,UAAM,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,QACE,sBAAsB,CAAC,KAAK,MAAM;AAAA,MACpC;AAAA,MACA,KAAK,MAAM;AAAA,IACb;AAEA,WAAO,oCAAC,QAAK,WAAW,aAAY,KAAK,MAAM,QAAS;AAAA,EAC1D;AACF;AAEA,OAAO,eAAe;AAAA,EACpB,WAAW;AACb;AAEA,OAAO,YAAY;AAAA,EACjB,WAAW,UAAU;AACvB;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtListItemProps } from '../../../../types/list';
|
|
4
|
+
export default class AtListItem extends React.Component<AtListItemProps> {
|
|
5
|
+
static defaultProps: AtListItemProps;
|
|
6
|
+
static propTypes: InferProps<AtListItemProps>;
|
|
7
|
+
private handleClick;
|
|
8
|
+
private handleSwitchClick;
|
|
9
|
+
private handleSwitchChange;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|