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
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { View } from
|
|
5
|
-
import AtActionSheetBody from
|
|
6
|
-
import AtActionSheetFooter from
|
|
7
|
-
import AtActionSheetHeader from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const { title, cancelText, className } = this.props;
|
|
47
|
-
const { _isOpened } = this.state;
|
|
48
|
-
const rootClass = classNames('at-action-sheet', {
|
|
49
|
-
'at-action-sheet--active': _isOpened
|
|
50
|
-
}, className);
|
|
51
|
-
return (React.createElement(View, { className: rootClass, onTouchMove: this.handleTouchMove },
|
|
52
|
-
React.createElement(View, { onClick: this.close, className: 'at-action-sheet__overlay' }),
|
|
53
|
-
React.createElement(View, { className: 'at-action-sheet__container' },
|
|
54
|
-
title && React.createElement(AtActionSheetHeader, null, title),
|
|
55
|
-
React.createElement(AtActionSheetBody, null, this.props.children),
|
|
56
|
-
cancelText && (React.createElement(AtActionSheetFooter, { onClick: this.handleCancel }, cancelText)))));
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
import AtActionSheetBody from "./body/index";
|
|
6
|
+
import AtActionSheetFooter from "./footer/index";
|
|
7
|
+
import AtActionSheetHeader from "./header/index";
|
|
8
|
+
class AtActionSheet extends React.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.handleClose = () => {
|
|
12
|
+
if (typeof this.props.onClose === "function") {
|
|
13
|
+
this.props.onClose();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
this.handleCancel = () => {
|
|
17
|
+
if (typeof this.props.onCancel === "function") {
|
|
18
|
+
return this.props.onCancel();
|
|
19
|
+
}
|
|
20
|
+
this.close();
|
|
21
|
+
};
|
|
22
|
+
this.close = () => {
|
|
23
|
+
this.setState(
|
|
24
|
+
{
|
|
25
|
+
_isOpened: false
|
|
26
|
+
},
|
|
27
|
+
this.handleClose
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
this.handleTouchMove = (e) => {
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
};
|
|
34
|
+
const { isOpened } = props;
|
|
35
|
+
this.state = {
|
|
36
|
+
_isOpened: isOpened
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
40
|
+
const { isOpened } = nextProps;
|
|
41
|
+
if (isOpened !== this.state._isOpened) {
|
|
42
|
+
this.setState({
|
|
43
|
+
_isOpened: isOpened
|
|
44
|
+
});
|
|
45
|
+
!isOpened && this.handleClose();
|
|
57
46
|
}
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
const { title, cancelText, className } = this.props;
|
|
50
|
+
const { _isOpened } = this.state;
|
|
51
|
+
const rootClass = classNames(
|
|
52
|
+
"at-action-sheet",
|
|
53
|
+
{
|
|
54
|
+
"at-action-sheet--active": _isOpened
|
|
55
|
+
},
|
|
56
|
+
className
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootClass, onTouchMove: this.handleTouchMove }, /* @__PURE__ */ React.createElement(View, { onClick: this.close, className: "at-action-sheet__overlay" }), /* @__PURE__ */ React.createElement(View, { className: "at-action-sheet__container" }, title && /* @__PURE__ */ React.createElement(AtActionSheetHeader, null, title), /* @__PURE__ */ React.createElement(AtActionSheetBody, null, this.props.children), cancelText && /* @__PURE__ */ React.createElement(AtActionSheetFooter, { onClick: this.handleCancel }, cancelText)));
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
61
|
AtActionSheet.defaultProps = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
title: "",
|
|
63
|
+
cancelText: "",
|
|
64
|
+
isOpened: false
|
|
63
65
|
};
|
|
64
66
|
AtActionSheet.propTypes = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
title: PropTypes.string,
|
|
68
|
+
onClose: PropTypes.func,
|
|
69
|
+
onCancel: PropTypes.func,
|
|
70
|
+
isOpened: PropTypes.bool.isRequired,
|
|
71
|
+
cancelText: PropTypes.string
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
AtActionSheet as default
|
|
70
75
|
};
|
|
71
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/action-sheet/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport {\n AtActionSheetProps,\n AtActionSheetState\n} from '../../../types/action-sheet'\nimport AtActionSheetBody from './body/index'\nimport AtActionSheetFooter from './footer/index'\nimport AtActionSheetHeader from './header/index'\n\nexport default class AtActionSheet extends React.Component<\n AtActionSheetProps,\n AtActionSheetState\n> {\n public static defaultProps: AtActionSheetProps\n public static propTypes: InferProps<AtActionSheetProps>\n\n public constructor(props: AtActionSheetProps) {\n super(props)\n const { isOpened } = props\n\n this.state = {\n _isOpened: isOpened\n }\n }\n\n public UNSAFE_componentWillReceiveProps(nextProps: AtActionSheetProps): void {\n const { isOpened } = nextProps\n if (isOpened !== this.state._isOpened) {\n this.setState({\n _isOpened: isOpened\n })\n\n !isOpened && this.handleClose()\n }\n }\n\n private handleClose = (): void => {\n if (typeof this.props.onClose === 'function') {\n this.props.onClose()\n }\n }\n\n private handleCancel = (): void => {\n if (typeof this.props.onCancel === 'function') {\n return this.props.onCancel()\n }\n this.close()\n }\n\n private close = (): void => {\n this.setState(\n {\n _isOpened: false\n },\n this.handleClose\n )\n }\n\n private handleTouchMove = (e: CommonEvent): void => {\n e.stopPropagation()\n e.preventDefault()\n }\n\n public render(): JSX.Element {\n const { title, cancelText, className } = this.props\n const { _isOpened } = this.state\n\n const rootClass = classNames(\n 'at-action-sheet',\n {\n 'at-action-sheet--active': _isOpened\n },\n className\n )\n\n return (\n <View className={rootClass} onTouchMove={this.handleTouchMove}>\n <View onClick={this.close} className='at-action-sheet__overlay' />\n <View className='at-action-sheet__container'>\n {title && <AtActionSheetHeader>{title}</AtActionSheetHeader>}\n <AtActionSheetBody>{this.props.children}</AtActionSheetBody>\n {cancelText && (\n <AtActionSheetFooter onClick={this.handleCancel}>\n {cancelText}\n </AtActionSheetFooter>\n )}\n </View>\n </View>\n )\n }\n}\n\nAtActionSheet.defaultProps = {\n title: '',\n cancelText: '',\n isOpened: false\n}\n\nAtActionSheet.propTypes = {\n title: PropTypes.string,\n onClose: PropTypes.func,\n onCancel: PropTypes.func,\n isOpened: PropTypes.bool.isRequired,\n cancelText: PropTypes.string\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAMrB,OAAO,uBAAuB;AAC9B,OAAO,yBAAyB;AAChC,OAAO,yBAAyB;AAEhC,MAAO,sBAAoC,MAAM,UAG/C;AAAA,EAIO,YAAY,OAA2B;AAC5C,UAAM,KAAK;AAmBb,SAAQ,cAAc,MAAY;AAChC,UAAI,OAAO,KAAK,MAAM,YAAY,YAAY;AAC5C,aAAK,MAAM,QAAQ;AAAA,MACrB;AAAA,IACF;AAEA,SAAQ,eAAe,MAAY;AACjC,UAAI,OAAO,KAAK,MAAM,aAAa,YAAY;AAC7C,eAAO,KAAK,MAAM,SAAS;AAAA,MAC7B;AACA,WAAK,MAAM;AAAA,IACb;AAEA,SAAQ,QAAQ,MAAY;AAC1B,WAAK;AAAA,QACH;AAAA,UACE,WAAW;AAAA,QACb;AAAA,QACA,KAAK;AAAA,MACP;AAAA,IACF;AAEA,SAAQ,kBAAkB,CAAC,MAAyB;AAClD,QAAE,gBAAgB;AAClB,QAAE,eAAe;AAAA,IACnB;AA3CE,UAAM,EAAE,SAAS,IAAI;AAErB,SAAK,QAAQ;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEO,iCAAiC,WAAqC;AAC3E,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,aAAa,KAAK,MAAM,WAAW;AACrC,WAAK,SAAS;AAAA,QACZ,WAAW;AAAA,MACb,CAAC;AAED,OAAC,YAAY,KAAK,YAAY;AAAA,IAChC;AAAA,EACF;AAAA,EA6BO,SAAsB;AAC3B,UAAM,EAAE,OAAO,YAAY,UAAU,IAAI,KAAK;AAC9C,UAAM,EAAE,UAAU,IAAI,KAAK;AAE3B,UAAM,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,QACE,2BAA2B;AAAA,MAC7B;AAAA,MACA;AAAA,IACF;AAEA,WACE,oCAAC,QAAK,WAAW,WAAW,aAAa,KAAK,mBAC5C,oCAAC,QAAK,SAAS,KAAK,OAAO,WAAU,4BAA2B,GAChE,oCAAC,QAAK,WAAU,gCACb,SAAS,oCAAC,2BAAqB,KAAM,GACtC,oCAAC,yBAAmB,KAAK,MAAM,QAAS,GACvC,cACC,oCAAC,uBAAoB,SAAS,KAAK,gBAChC,UACH,CAEJ,CACF;AAAA,EAEJ;AACF;AAEA,cAAc,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AACZ;AAEA,cAAc,YAAY;AAAA,EACxB,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU,KAAK;AAAA,EACzB,YAAY,UAAU;AACxB;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtActivityIndicatorProps } from '../../../types/activity-indicator';
|
|
4
|
+
export default class AtActivityIndicator extends React.Component<AtActivityIndicatorProps> {
|
|
5
|
+
static defaultProps: AtActivityIndicatorProps;
|
|
6
|
+
static propTypes: InferProps<AtActivityIndicatorProps>;
|
|
7
|
+
render(): JSX.Element;
|
|
8
|
+
}
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { Text, View } from
|
|
5
|
-
import AtLoading from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Text, View } from "@tarojs/components";
|
|
5
|
+
import AtLoading from "../loading/index";
|
|
6
|
+
class AtActivityIndicator extends React.Component {
|
|
7
|
+
render() {
|
|
8
|
+
const { color, size, mode, content, isOpened } = this.props;
|
|
9
|
+
const rootClass = classNames(
|
|
10
|
+
"at-activity-indicator",
|
|
11
|
+
{
|
|
12
|
+
"at-activity-indicator--center": mode === "center",
|
|
13
|
+
"at-activity-indicator--isopened": isOpened
|
|
14
|
+
},
|
|
15
|
+
this.props.className
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootClass }, /* @__PURE__ */ React.createElement(View, { className: "at-activity-indicator__body" }, /* @__PURE__ */ React.createElement(AtLoading, { size, color })), content && /* @__PURE__ */ React.createElement(Text, { className: "at-activity-indicator__content" }, content));
|
|
18
|
+
}
|
|
18
19
|
}
|
|
19
20
|
AtActivityIndicator.defaultProps = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
size: 0,
|
|
22
|
+
mode: "normal",
|
|
23
|
+
color: "",
|
|
24
|
+
content: "",
|
|
25
|
+
className: "",
|
|
26
|
+
isOpened: true
|
|
26
27
|
};
|
|
27
28
|
AtActivityIndicator.propTypes = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
size: PropTypes.number,
|
|
30
|
+
mode: PropTypes.string,
|
|
31
|
+
color: PropTypes.string,
|
|
32
|
+
content: PropTypes.string,
|
|
33
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
34
|
+
isOpened: PropTypes.bool
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
AtActivityIndicator as default
|
|
34
38
|
};
|
|
35
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/activity-indicator/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Text, View } from '@tarojs/components'\nimport { AtActivityIndicatorProps } from '../../../types/activity-indicator'\nimport AtLoading from '../loading/index'\n\nexport default class AtActivityIndicator extends React.Component<AtActivityIndicatorProps> {\n public static defaultProps: AtActivityIndicatorProps\n public static propTypes: InferProps<AtActivityIndicatorProps>\n\n public render(): JSX.Element {\n const { color, size, mode, content, isOpened } = this.props\n\n const rootClass = classNames(\n 'at-activity-indicator',\n {\n 'at-activity-indicator--center': mode === 'center',\n 'at-activity-indicator--isopened': isOpened\n },\n this.props.className\n )\n\n return (\n <View className={rootClass}>\n <View className='at-activity-indicator__body'>\n <AtLoading size={size} color={color} />\n </View>\n {content && (\n <Text className='at-activity-indicator__content'>{content}</Text>\n )}\n </View>\n )\n }\n}\n\nAtActivityIndicator.defaultProps = {\n size: 0,\n mode: 'normal',\n color: '',\n content: '',\n className: '',\n isOpened: true\n}\n\nAtActivityIndicator.propTypes = {\n size: PropTypes.number,\n mode: PropTypes.string,\n color: PropTypes.string,\n content: PropTypes.string,\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n isOpened: PropTypes.bool\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,MAAM,YAAY;AAE3B,OAAO,eAAe;AAEtB,MAAO,4BAA0C,MAAM,UAAoC;AAAA,EAIlF,SAAsB;AAC3B,UAAM,EAAE,OAAO,MAAM,MAAM,SAAS,SAAS,IAAI,KAAK;AAEtD,UAAM,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,QACE,iCAAiC,SAAS;AAAA,QAC1C,mCAAmC;AAAA,MACrC;AAAA,MACA,KAAK,MAAM;AAAA,IACb;AAEA,WACE,oCAAC,QAAK,WAAW,aACf,oCAAC,QAAK,WAAU,iCACd,oCAAC,aAAU,MAAY,OAAc,CACvC,GACC,WACC,oCAAC,QAAK,WAAU,oCAAkC,OAAQ,CAE9D;AAAA,EAEJ;AACF;AAEA,oBAAoB,eAAe;AAAA,EACjC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AACZ;AAEA,oBAAoB,YAAY;AAAA,EAC9B,MAAM,UAAU;AAAA,EAChB,MAAM,UAAU;AAAA,EAChB,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,UAAU,UAAU;AACtB;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtAvatarProps, AtAvatarState } from '../../../types/avatar';
|
|
4
|
+
export default class AtAvatar extends React.Component<AtAvatarProps, AtAvatarState> {
|
|
5
|
+
static defaultProps: AtAvatarProps;
|
|
6
|
+
static propTypes: InferProps<AtAvatarProps>;
|
|
7
|
+
constructor(props: AtAvatarProps);
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
@@ -1,59 +1,67 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { Image,
|
|
5
|
-
import Taro from
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Image, Text, View } from "@tarojs/components";
|
|
5
|
+
import Taro from "@tarojs/taro";
|
|
6
6
|
const SIZE_CLASS = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
large: "large",
|
|
8
|
+
normal: "normal",
|
|
9
|
+
small: "small"
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
else {
|
|
37
|
-
elem = React.createElement(Text, { className: 'at-avatar__text' }, letter);
|
|
38
|
-
}
|
|
39
|
-
return (React.createElement(View, { className: classNames(rootClassName, classObject, this.props.className), style: customStyle }, elem));
|
|
11
|
+
class AtAvatar extends React.Component {
|
|
12
|
+
constructor(props) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.state = {
|
|
15
|
+
isWEAPP: Taro.getEnv() === Taro.ENV_TYPE.WEAPP
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const { size, circle, image, text, openData, customStyle } = this.props;
|
|
20
|
+
const rootClassName = ["at-avatar"];
|
|
21
|
+
const iconSize = SIZE_CLASS[size || "normal"];
|
|
22
|
+
const classObject = {
|
|
23
|
+
[`at-avatar--${iconSize}`]: iconSize,
|
|
24
|
+
"at-avatar--circle": circle
|
|
25
|
+
};
|
|
26
|
+
let letter = "";
|
|
27
|
+
if (text) letter = text[0];
|
|
28
|
+
let elem;
|
|
29
|
+
if (openData && openData.type === "userAvatarUrl" && this.state.isWEAPP && Taro.canIUse("open-data")) {
|
|
30
|
+
const OpenData = require("@tarojs/components").OpenData;
|
|
31
|
+
elem = /* @__PURE__ */ React.createElement(OpenData, { type: openData.type });
|
|
32
|
+
} else if (image) {
|
|
33
|
+
elem = /* @__PURE__ */ React.createElement(Image, { className: "at-avatar__img", src: image });
|
|
34
|
+
} else {
|
|
35
|
+
elem = /* @__PURE__ */ React.createElement(Text, { className: "at-avatar__text" }, letter);
|
|
40
36
|
}
|
|
37
|
+
return /* @__PURE__ */ React.createElement(
|
|
38
|
+
View,
|
|
39
|
+
{
|
|
40
|
+
className: classNames(rootClassName, classObject, this.props.className),
|
|
41
|
+
style: customStyle
|
|
42
|
+
},
|
|
43
|
+
elem
|
|
44
|
+
);
|
|
45
|
+
}
|
|
41
46
|
}
|
|
42
47
|
AtAvatar.defaultProps = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
size: "normal",
|
|
49
|
+
circle: false,
|
|
50
|
+
text: "",
|
|
51
|
+
image: "",
|
|
52
|
+
customStyle: {},
|
|
53
|
+
className: ""
|
|
49
54
|
};
|
|
50
55
|
AtAvatar.propTypes = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
size: PropTypes.oneOf(["large", "normal", "small"]),
|
|
57
|
+
circle: PropTypes.bool,
|
|
58
|
+
text: PropTypes.string,
|
|
59
|
+
image: PropTypes.string,
|
|
60
|
+
openData: PropTypes.object,
|
|
61
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
62
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
AtAvatar as default
|
|
58
66
|
};
|
|
59
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/avatar/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Image, Text, View } from '@tarojs/components'\nimport Taro from '@tarojs/taro'\nimport { AtAvatarProps, AtAvatarState } from '../../../types/avatar'\n\nconst SIZE_CLASS = {\n large: 'large',\n normal: 'normal',\n small: 'small'\n}\n\nexport default class AtAvatar extends React.Component<\n AtAvatarProps,\n AtAvatarState\n> {\n public static defaultProps: AtAvatarProps\n public static propTypes: InferProps<AtAvatarProps>\n\n public constructor(props: AtAvatarProps) {\n super(props)\n this.state = {\n isWEAPP: Taro.getEnv() === Taro.ENV_TYPE.WEAPP\n }\n }\n\n public render(): JSX.Element {\n const { size, circle, image, text, openData, customStyle } = this.props\n const rootClassName = ['at-avatar']\n const iconSize = SIZE_CLASS[size || 'normal']\n const classObject = {\n [`at-avatar--${iconSize}`]: iconSize,\n 'at-avatar--circle': circle\n }\n\n let letter = ''\n if (text) letter = text[0]\n\n let elem: React.ReactNode\n if (\n openData &&\n openData.type === 'userAvatarUrl' &&\n this.state.isWEAPP &&\n Taro.canIUse('open-data')\n ) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const OpenData = require('@tarojs/components').OpenData\n elem = <OpenData type={openData.type}></OpenData>\n } else if (image) {\n elem = <Image className='at-avatar__img' src={image} />\n } else {\n elem = <Text className='at-avatar__text'>{letter}</Text>\n }\n return (\n <View\n className={classNames(rootClassName, classObject, this.props.className)}\n style={customStyle}\n >\n {elem}\n </View>\n )\n }\n}\n\nAtAvatar.defaultProps = {\n size: 'normal',\n circle: false,\n text: '',\n image: '',\n customStyle: {},\n className: ''\n}\n\nAtAvatar.propTypes = {\n size: PropTypes.oneOf(['large', 'normal', 'small']),\n circle: PropTypes.bool,\n text: PropTypes.string,\n image: PropTypes.string,\n openData: PropTypes.object,\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,OAAO,MAAM,YAAY;AAClC,OAAO,UAAU;AAGjB,MAAM,aAAa;AAAA,EACjB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,MAAO,iBAA+B,MAAM,UAG1C;AAAA,EAIO,YAAY,OAAsB;AACvC,UAAM,KAAK;AACX,SAAK,QAAQ;AAAA,MACX,SAAS,KAAK,OAAO,MAAM,KAAK,SAAS;AAAA,IAC3C;AAAA,EACF;AAAA,EAEO,SAAsB;AAC3B,UAAM,EAAE,MAAM,QAAQ,OAAO,MAAM,UAAU,YAAY,IAAI,KAAK;AAClE,UAAM,gBAAgB,CAAC,WAAW;AAClC,UAAM,WAAW,WAAW,QAAQ,QAAQ;AAC5C,UAAM,cAAc;AAAA,MAClB,CAAC,cAAc,QAAQ,EAAE,GAAG;AAAA,MAC5B,qBAAqB;AAAA,IACvB;AAEA,QAAI,SAAS;AACb,QAAI,KAAM,UAAS,KAAK,CAAC;AAEzB,QAAI;AACJ,QACE,YACA,SAAS,SAAS,mBAClB,KAAK,MAAM,WACX,KAAK,QAAQ,WAAW,GACxB;AAEA,YAAM,WAAW,QAAQ,oBAAoB,EAAE;AAC/C,aAAO,oCAAC,YAAS,MAAM,SAAS,MAAM;AAAA,IACxC,WAAW,OAAO;AAChB,aAAO,oCAAC,SAAM,WAAU,kBAAiB,KAAK,OAAO;AAAA,IACvD,OAAO;AACL,aAAO,oCAAC,QAAK,WAAU,qBAAmB,MAAO;AAAA,IACnD;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,WAAW,eAAe,aAAa,KAAK,MAAM,SAAS;AAAA,QACtE,OAAO;AAAA;AAAA,MAEN;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,SAAS,eAAe;AAAA,EACtB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa,CAAC;AAAA,EACd,WAAW;AACb;AAEA,SAAS,YAAY;AAAA,EACnB,MAAM,UAAU,MAAM,CAAC,SAAS,UAAU,OAAO,CAAC;AAAA,EAClD,QAAQ,UAAU;AAAA,EAClB,MAAM,UAAU;AAAA,EAChB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AACpE;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtBadgeProps } from '../../../types/badge';
|
|
4
|
+
export default class AtBadge extends React.Component<AtBadgeProps> {
|
|
5
|
+
static defaultProps: AtBadgeProps;
|
|
6
|
+
static propTypes: InferProps<AtBadgeProps>;
|
|
7
|
+
constructor(props: AtBadgeProps);
|
|
8
|
+
private formatValue;
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
@@ -1,42 +1,51 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { View } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return numValue > maxValue ? `${maxValue}+` : numValue;
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
const { dot, value, maxValue = 99, customStyle } = this.props;
|
|
21
|
-
const rootClassName = ['at-badge'];
|
|
22
|
-
const val = this.formatValue(value, maxValue);
|
|
23
|
-
return (React.createElement(View, { className: classNames(rootClassName, this.props.className), style: customStyle },
|
|
24
|
-
this.props.children,
|
|
25
|
-
dot ? (React.createElement(View, { className: 'at-badge__dot' })) : (val !== '' && React.createElement(View, { className: 'at-badge__num' }, val))));
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
class AtBadge extends React.Component {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
this.state = {};
|
|
9
|
+
}
|
|
10
|
+
formatValue(value, maxValue) {
|
|
11
|
+
if (value === "" || value === null || typeof value === "undefined")
|
|
12
|
+
return "";
|
|
13
|
+
const numValue = +value;
|
|
14
|
+
if (Number.isNaN(numValue)) {
|
|
15
|
+
return value;
|
|
26
16
|
}
|
|
17
|
+
return numValue > maxValue ? `${maxValue}+` : numValue;
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const { dot, value, maxValue = 99, customStyle } = this.props;
|
|
21
|
+
const rootClassName = ["at-badge"];
|
|
22
|
+
const val = this.formatValue(value, maxValue);
|
|
23
|
+
return /* @__PURE__ */ React.createElement(
|
|
24
|
+
View,
|
|
25
|
+
{
|
|
26
|
+
className: classNames(rootClassName, this.props.className),
|
|
27
|
+
style: customStyle
|
|
28
|
+
},
|
|
29
|
+
this.props.children,
|
|
30
|
+
dot ? /* @__PURE__ */ React.createElement(View, { className: "at-badge__dot" }) : val !== "" && /* @__PURE__ */ React.createElement(View, { className: "at-badge__num" }, val)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
AtBadge.defaultProps = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
dot: false,
|
|
36
|
+
value: "",
|
|
37
|
+
maxValue: 99,
|
|
38
|
+
customStyle: {},
|
|
39
|
+
className: ""
|
|
34
40
|
};
|
|
35
41
|
AtBadge.propTypes = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
dot: PropTypes.bool,
|
|
43
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
44
|
+
maxValue: PropTypes.number,
|
|
45
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
46
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
AtBadge as default
|
|
41
50
|
};
|
|
42
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/badge/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtBadgeProps } from '../../../types/badge'\n\nexport default class AtBadge extends React.Component<AtBadgeProps> {\n public static defaultProps: AtBadgeProps\n public static propTypes: InferProps<AtBadgeProps>\n\n public constructor(props: AtBadgeProps) {\n super(props)\n this.state = {}\n }\n\n private formatValue(\n value: string | number | undefined,\n maxValue: number\n ): string | number {\n if (value === '' || value === null || typeof value === 'undefined')\n return ''\n const numValue = +value\n if (Number.isNaN(numValue)) {\n return value\n }\n return numValue > maxValue ? `${maxValue}+` : numValue\n }\n\n public render(): JSX.Element {\n const { dot, value, maxValue = 99, customStyle } = this.props\n const rootClassName = ['at-badge']\n\n const val = this.formatValue(value, maxValue)\n\n return (\n <View\n className={classNames(rootClassName, this.props.className)}\n style={customStyle}\n >\n {this.props.children}\n {dot ? (\n <View className='at-badge__dot'></View>\n ) : (\n val !== '' && <View className='at-badge__num'>{val}</View>\n )}\n </View>\n )\n }\n}\n\nAtBadge.defaultProps = {\n dot: false,\n value: '',\n maxValue: 99,\n customStyle: {},\n className: ''\n}\n\nAtBadge.propTypes = {\n dot: PropTypes.bool,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n maxValue: PropTypes.number,\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAGrB,MAAO,gBAA8B,MAAM,UAAwB;AAAA,EAI1D,YAAY,OAAqB;AACtC,UAAM,KAAK;AACX,SAAK,QAAQ,CAAC;AAAA,EAChB;AAAA,EAEQ,YACN,OACA,UACiB;AACjB,QAAI,UAAU,MAAM,UAAU,QAAQ,OAAO,UAAU;AACrD,aAAO;AACT,UAAM,WAAW,CAAC;AAClB,QAAI,OAAO,MAAM,QAAQ,GAAG;AAC1B,aAAO;AAAA,IACT;AACA,WAAO,WAAW,WAAW,GAAG,QAAQ,MAAM;AAAA,EAChD;AAAA,EAEO,SAAsB;AAC3B,UAAM,EAAE,KAAK,OAAO,WAAW,IAAI,YAAY,IAAI,KAAK;AACxD,UAAM,gBAAgB,CAAC,UAAU;AAEjC,UAAM,MAAM,KAAK,YAAY,OAAO,QAAQ;AAE5C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,WAAW,eAAe,KAAK,MAAM,SAAS;AAAA,QACzD,OAAO;AAAA;AAAA,MAEN,KAAK,MAAM;AAAA,MACX,MACC,oCAAC,QAAK,WAAU,iBAAgB,IAEhC,QAAQ,MAAM,oCAAC,QAAK,WAAU,mBAAiB,GAAI;AAAA,IAEvD;AAAA,EAEJ;AACF;AAEA,QAAQ,eAAe;AAAA,EACrB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,UAAU;AAAA,EACV,aAAa,CAAC;AAAA,EACd,WAAW;AACb;AAEA,QAAQ,YAAY;AAAA,EAClB,KAAK,UAAU;AAAA,EACf,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC/D,UAAU,UAAU;AAAA,EACpB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AACpE;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtButtonProps, AtButtonState } from '../../../types/button';
|
|
4
|
+
export default class AtButton extends React.Component<AtButtonProps, AtButtonState> {
|
|
5
|
+
static defaultProps: AtButtonProps;
|
|
6
|
+
static propTypes: InferProps<AtButtonProps>;
|
|
7
|
+
constructor(props: AtButtonProps);
|
|
8
|
+
private onClick;
|
|
9
|
+
private onGetUserInfo;
|
|
10
|
+
private onContact;
|
|
11
|
+
private onGetPhoneNumber;
|
|
12
|
+
private onError;
|
|
13
|
+
private onOpenSetting;
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|