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,105 +1,152 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { Image, Switch, Text, View } from
|
|
5
|
-
import { mergeStyle } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Image, Switch, Text, View } from "@tarojs/components";
|
|
5
|
+
import { mergeStyle } from "../../../common/utils";
|
|
6
|
+
class AtListItem extends React.Component {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.handleClick = (event) => {
|
|
10
|
+
if (typeof this.props.onClick === "function" && !this.props.disabled) {
|
|
11
|
+
this.props.onClick(event);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.handleSwitchChange = (event) => {
|
|
15
|
+
if (typeof this.props.onSwitchChange === "function" && !this.props.disabled) {
|
|
16
|
+
this.props.onSwitchChange(event);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
handleSwitchClick(e) {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const {
|
|
25
|
+
note,
|
|
26
|
+
arrow,
|
|
27
|
+
thumb,
|
|
28
|
+
iconInfo,
|
|
29
|
+
disabled,
|
|
30
|
+
isSwitch,
|
|
31
|
+
hasBorder,
|
|
32
|
+
extraThumb,
|
|
33
|
+
switchColor,
|
|
34
|
+
switchIsCheck,
|
|
35
|
+
icon
|
|
36
|
+
} = this.props;
|
|
37
|
+
const { extraText, title } = this.props;
|
|
38
|
+
const rootClass = classNames(
|
|
39
|
+
"at-list__item",
|
|
40
|
+
{
|
|
41
|
+
"at-list__item--thumb": thumb,
|
|
42
|
+
"at-list__item--multiple": note,
|
|
43
|
+
"at-list__item--disabled": disabled,
|
|
44
|
+
"at-list__item--no-border": !hasBorder
|
|
45
|
+
},
|
|
46
|
+
this.props.className
|
|
47
|
+
);
|
|
48
|
+
const renderIcon = () => {
|
|
49
|
+
if (icon) {
|
|
50
|
+
return /* @__PURE__ */ React.createElement(View, { className: "item-icon" }, icon);
|
|
51
|
+
} else if (iconInfo == null ? void 0 : iconInfo.value) {
|
|
52
|
+
const iconClass = classNames(
|
|
53
|
+
iconInfo && iconInfo.prefixClass || "at-icon",
|
|
54
|
+
{
|
|
55
|
+
[`${iconInfo && iconInfo.prefixClass || "at-icon"}-${iconInfo && iconInfo.value}`]: iconInfo && iconInfo.value
|
|
56
|
+
},
|
|
57
|
+
iconInfo && iconInfo.className
|
|
58
|
+
);
|
|
59
|
+
return /* @__PURE__ */ React.createElement(View, { className: "at-list__item-icon item-icon" }, /* @__PURE__ */ React.createElement(
|
|
60
|
+
Text,
|
|
61
|
+
{
|
|
62
|
+
className: iconClass,
|
|
63
|
+
style: mergeStyle(
|
|
64
|
+
{
|
|
65
|
+
color: iconInfo.color || "",
|
|
66
|
+
fontSize: `${iconInfo.size || 24}px`
|
|
67
|
+
},
|
|
68
|
+
iconInfo.customStyle || ""
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
} else if (thumb) {
|
|
73
|
+
return /* @__PURE__ */ React.createElement(View, { className: "at-list__item-thumb item-thumb" }, /* @__PURE__ */ React.createElement(
|
|
74
|
+
Image,
|
|
75
|
+
{
|
|
76
|
+
className: "item-thumb__info",
|
|
77
|
+
mode: "scaleToFill",
|
|
78
|
+
src: thumb
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootClass, onClick: this.handleClick }, /* @__PURE__ */ React.createElement(View, { className: "at-list__item-container" }, renderIcon(), /* @__PURE__ */ React.createElement(View, { className: "at-list__item-content item-content" }, /* @__PURE__ */ React.createElement(View, { className: "item-content__info" }, /* @__PURE__ */ React.createElement(View, { className: "item-content__info-title" }, title), note && /* @__PURE__ */ React.createElement(View, { className: "item-content__info-note" }, note))), /* @__PURE__ */ React.createElement(View, { className: "at-list__item-extra item-extra" }, extraText && /* @__PURE__ */ React.createElement(View, { className: "item-extra__info" }, extraText), extraThumb && !extraText && /* @__PURE__ */ React.createElement(View, { className: "item-extra__image" }, /* @__PURE__ */ React.createElement(
|
|
84
|
+
Image,
|
|
85
|
+
{
|
|
86
|
+
className: "item-extra__image-info",
|
|
87
|
+
mode: "aspectFit",
|
|
88
|
+
src: extraThumb
|
|
89
|
+
}
|
|
90
|
+
)), isSwitch && !extraThumb && !extraText && /* @__PURE__ */ React.createElement(
|
|
91
|
+
View,
|
|
92
|
+
{
|
|
93
|
+
className: "item-extra__switch",
|
|
94
|
+
onClick: this.handleSwitchClick
|
|
95
|
+
},
|
|
96
|
+
/* @__PURE__ */ React.createElement(
|
|
97
|
+
Switch,
|
|
98
|
+
{
|
|
99
|
+
color: switchColor,
|
|
100
|
+
disabled,
|
|
101
|
+
checked: switchIsCheck,
|
|
102
|
+
onChange: this.handleSwitchChange
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
), arrow ? /* @__PURE__ */ React.createElement(View, { className: "item-extra__icon" }, /* @__PURE__ */ React.createElement(
|
|
106
|
+
Text,
|
|
107
|
+
{
|
|
108
|
+
className: `at-icon item-extra__icon-arrow at-icon-chevron-${arrow}`
|
|
109
|
+
}
|
|
110
|
+
)) : null)));
|
|
111
|
+
}
|
|
68
112
|
}
|
|
69
113
|
AtListItem.defaultProps = {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
114
|
+
note: "",
|
|
115
|
+
disabled: false,
|
|
116
|
+
title: "",
|
|
117
|
+
thumb: "",
|
|
118
|
+
isSwitch: false,
|
|
119
|
+
hasBorder: true,
|
|
120
|
+
switchColor: "#6190E8",
|
|
121
|
+
switchIsCheck: false,
|
|
122
|
+
extraText: "",
|
|
123
|
+
extraThumb: "",
|
|
124
|
+
iconInfo: { value: "" }
|
|
81
125
|
};
|
|
82
126
|
AtListItem.propTypes = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
127
|
+
note: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
128
|
+
disabled: PropTypes.bool,
|
|
129
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
130
|
+
thumb: PropTypes.string,
|
|
131
|
+
onClick: PropTypes.func,
|
|
132
|
+
isSwitch: PropTypes.bool,
|
|
133
|
+
hasBorder: PropTypes.bool,
|
|
134
|
+
switchColor: PropTypes.string,
|
|
135
|
+
switchIsCheck: PropTypes.bool,
|
|
136
|
+
extraText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
137
|
+
extraThumb: PropTypes.string,
|
|
138
|
+
onSwitchChange: PropTypes.func,
|
|
139
|
+
arrow: PropTypes.oneOf(["up", "down", "right"]),
|
|
140
|
+
iconInfo: PropTypes.shape({
|
|
141
|
+
size: PropTypes.number,
|
|
142
|
+
value: PropTypes.string,
|
|
143
|
+
color: PropTypes.string,
|
|
144
|
+
prefixClass: PropTypes.string,
|
|
145
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
146
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
|
|
147
|
+
})
|
|
148
|
+
};
|
|
149
|
+
export {
|
|
150
|
+
AtListItem as default
|
|
104
151
|
};
|
|
105
152
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/list/item/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Image, Switch, Text, View } from '@tarojs/components'\nimport { CommonEvent, ITouchEvent } from '@tarojs/components/types/common'\nimport { AtListItemProps } from '../../../../types/list'\nimport { mergeStyle } from '../../../common/utils'\n\nexport default class AtListItem extends React.Component<AtListItemProps> {\n public static defaultProps: AtListItemProps\n public static propTypes: InferProps<AtListItemProps>\n\n private handleClick = (event: ITouchEvent): void => {\n if (typeof this.props.onClick === 'function' && !this.props.disabled) {\n this.props.onClick(event)\n }\n }\n\n private handleSwitchClick(e: CommonEvent): void {\n e.stopPropagation()\n }\n\n private handleSwitchChange = (event: CommonEvent): void => {\n if (\n typeof this.props.onSwitchChange === 'function' &&\n !this.props.disabled\n ) {\n this.props.onSwitchChange(event)\n }\n }\n\n public render(): JSX.Element {\n const {\n note,\n arrow,\n thumb,\n iconInfo,\n disabled,\n isSwitch,\n hasBorder,\n extraThumb,\n switchColor,\n switchIsCheck,\n icon\n } = this.props\n\n const { extraText, title } = this.props\n\n const rootClass = classNames(\n 'at-list__item',\n {\n 'at-list__item--thumb': thumb,\n 'at-list__item--multiple': note,\n 'at-list__item--disabled': disabled,\n 'at-list__item--no-border': !hasBorder\n },\n this.props.className\n )\n\n const renderIcon = () => {\n if (icon) {\n return <View className='item-icon'>{icon}</View>\n } else if (iconInfo?.value) {\n const iconClass = classNames(\n (iconInfo && iconInfo.prefixClass) || 'at-icon',\n {\n [`${(iconInfo && iconInfo.prefixClass) || 'at-icon'}-${\n iconInfo && iconInfo.value\n }`]: iconInfo && iconInfo.value\n },\n iconInfo && iconInfo.className\n )\n return (\n <View className='at-list__item-icon item-icon'>\n <Text\n className={iconClass}\n style={mergeStyle(\n {\n color: iconInfo.color || '',\n fontSize: `${iconInfo.size || 24}px`\n },\n iconInfo.customStyle || ''\n )}\n ></Text>\n </View>\n )\n } else if (thumb) {\n return (\n <View className='at-list__item-thumb item-thumb'>\n <Image\n className='item-thumb__info'\n mode='scaleToFill'\n src={thumb}\n />\n </View>\n )\n }\n }\n\n return (\n <View className={rootClass} onClick={this.handleClick}>\n <View className='at-list__item-container'>\n {renderIcon()}\n <View className='at-list__item-content item-content'>\n <View className='item-content__info'>\n <View className='item-content__info-title'>{title}</View>\n {note && <View className='item-content__info-note'>{note}</View>}\n </View>\n </View>\n <View className='at-list__item-extra item-extra'>\n {extraText && <View className='item-extra__info'>{extraText}</View>}\n\n {extraThumb && !extraText && (\n <View className='item-extra__image'>\n <Image\n className='item-extra__image-info'\n mode='aspectFit'\n src={extraThumb}\n />\n </View>\n )}\n\n {isSwitch && !extraThumb && !extraText && (\n <View\n className='item-extra__switch'\n onClick={this.handleSwitchClick}\n >\n <Switch\n color={switchColor}\n disabled={disabled}\n checked={switchIsCheck}\n onChange={this.handleSwitchChange}\n />\n </View>\n )}\n\n {arrow ? (\n <View className='item-extra__icon'>\n <Text\n className={`at-icon item-extra__icon-arrow at-icon-chevron-${arrow}`}\n />\n </View>\n ) : null}\n </View>\n </View>\n </View>\n )\n }\n}\n\nAtListItem.defaultProps = {\n note: '',\n disabled: false,\n title: '',\n thumb: '',\n isSwitch: false,\n hasBorder: true,\n switchColor: '#6190E8',\n switchIsCheck: false,\n extraText: '',\n extraThumb: '',\n iconInfo: { value: '' }\n}\n\nAtListItem.propTypes = {\n note: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n disabled: PropTypes.bool,\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n thumb: PropTypes.string,\n onClick: PropTypes.func,\n isSwitch: PropTypes.bool,\n hasBorder: PropTypes.bool,\n switchColor: PropTypes.string,\n switchIsCheck: PropTypes.bool,\n extraText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n extraThumb: PropTypes.string,\n onSwitchChange: PropTypes.func,\n arrow: PropTypes.oneOf(['up', 'down', 'right']),\n iconInfo: PropTypes.shape({\n size: PropTypes.number,\n value: PropTypes.string,\n color: PropTypes.string,\n prefixClass: PropTypes.string,\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])\n })\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtLoadMoreProps } from '../../../types/load-more';
|
|
4
|
+
export default class AtLoadMore extends React.Component<AtLoadMoreProps> {
|
|
5
|
+
static defaultProps: AtLoadMoreProps;
|
|
6
|
+
static propTypes: InferProps<AtLoadMoreProps>;
|
|
7
|
+
private onClick;
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
@@ -1,48 +1,72 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { Text, View } from
|
|
5
|
-
import AtActivityIndicator from
|
|
6
|
-
import AtButton from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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 AtActivityIndicator from "../activity-indicator/index";
|
|
6
|
+
import AtButton from "../button/index";
|
|
7
|
+
class AtLoadMore extends React.Component {
|
|
8
|
+
onClick() {
|
|
9
|
+
this.props.onClick && this.props.onClick(arguments);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
const {
|
|
13
|
+
className,
|
|
14
|
+
customStyle,
|
|
15
|
+
loadingText,
|
|
16
|
+
moreText,
|
|
17
|
+
status,
|
|
18
|
+
moreBtnStyle,
|
|
19
|
+
noMoreTextStyle,
|
|
20
|
+
noMoreText
|
|
21
|
+
} = this.props;
|
|
22
|
+
let component = null;
|
|
23
|
+
if (status === "loading") {
|
|
24
|
+
component = /* @__PURE__ */ React.createElement(AtActivityIndicator, { mode: "center", content: loadingText });
|
|
25
|
+
} else if (status === "more") {
|
|
26
|
+
component = /* @__PURE__ */ React.createElement(View, { className: "at-load-more__cnt" }, /* @__PURE__ */ React.createElement(
|
|
27
|
+
AtButton,
|
|
28
|
+
{
|
|
29
|
+
full: true,
|
|
30
|
+
onClick: this.onClick.bind(this),
|
|
31
|
+
customStyle: moreBtnStyle
|
|
32
|
+
},
|
|
33
|
+
moreText
|
|
34
|
+
));
|
|
35
|
+
} else {
|
|
36
|
+
component = /* @__PURE__ */ React.createElement(Text, { className: "at-load-more__tip", style: noMoreTextStyle }, noMoreText);
|
|
25
37
|
}
|
|
38
|
+
return /* @__PURE__ */ React.createElement(
|
|
39
|
+
View,
|
|
40
|
+
{
|
|
41
|
+
className: classNames("at-load-more", className),
|
|
42
|
+
style: customStyle
|
|
43
|
+
},
|
|
44
|
+
component
|
|
45
|
+
);
|
|
46
|
+
}
|
|
26
47
|
}
|
|
27
48
|
AtLoadMore.defaultProps = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
customStyle: "",
|
|
50
|
+
className: "",
|
|
51
|
+
noMoreTextStyle: "",
|
|
52
|
+
moreBtnStyle: "",
|
|
53
|
+
status: "more",
|
|
54
|
+
loadingText: "\u52A0\u8F7D\u4E2D",
|
|
55
|
+
moreText: "\u67E5\u770B\u66F4\u591A",
|
|
56
|
+
noMoreText: "\u6CA1\u6709\u66F4\u591A"
|
|
36
57
|
};
|
|
37
58
|
AtLoadMore.propTypes = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
60
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
61
|
+
noMoreTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
62
|
+
moreBtnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
63
|
+
status: PropTypes.oneOf(["more", "loading", "noMore"]),
|
|
64
|
+
loadingText: PropTypes.string,
|
|
65
|
+
moreText: PropTypes.string,
|
|
66
|
+
noMoreText: PropTypes.string,
|
|
67
|
+
onClick: PropTypes.func
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
AtLoadMore as default
|
|
47
71
|
};
|
|
48
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/load-more/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Text, View } from '@tarojs/components'\nimport { AtLoadMoreProps } from '../../../types/load-more'\nimport AtActivityIndicator from '../activity-indicator/index'\nimport AtButton from '../button/index'\n\nexport default class AtLoadMore extends React.Component<AtLoadMoreProps> {\n public static defaultProps: AtLoadMoreProps\n public static propTypes: InferProps<AtLoadMoreProps>\n\n private onClick(): void {\n this.props.onClick && this.props.onClick(arguments as any)\n }\n\n public render(): JSX.Element {\n const {\n className,\n customStyle,\n loadingText,\n moreText,\n status,\n moreBtnStyle,\n noMoreTextStyle,\n noMoreText\n } = this.props\n\n let component: JSX.Element | null = null\n if (status === 'loading') {\n component = <AtActivityIndicator mode='center' content={loadingText} />\n } else if (status === 'more') {\n component = (\n <View className='at-load-more__cnt'>\n <AtButton\n full\n onClick={this.onClick.bind(this)}\n customStyle={moreBtnStyle}\n >\n {moreText}\n </AtButton>\n </View>\n )\n } else {\n component = (\n <Text className='at-load-more__tip' style={noMoreTextStyle}>\n {noMoreText}\n </Text>\n )\n }\n\n return (\n <View\n className={classNames('at-load-more', className)}\n style={customStyle}\n >\n {component}\n </View>\n )\n }\n}\n\nAtLoadMore.defaultProps = {\n customStyle: '',\n className: '',\n noMoreTextStyle: '',\n moreBtnStyle: '',\n status: 'more',\n loadingText: '加载中',\n moreText: '查看更多',\n noMoreText: '没有更多'\n}\n\nAtLoadMore.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n noMoreTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n moreBtnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n status: PropTypes.oneOf(['more', 'loading', 'noMore']),\n loadingText: PropTypes.string,\n moreText: PropTypes.string,\n noMoreText: PropTypes.string,\n onClick: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,MAAM,YAAY;AAE3B,OAAO,yBAAyB;AAChC,OAAO,cAAc;AAErB,MAAO,mBAAiC,MAAM,UAA2B;AAAA,EAI/D,UAAgB;AACtB,SAAK,MAAM,WAAW,KAAK,MAAM,QAAQ,SAAgB;AAAA,EAC3D;AAAA,EAEO,SAAsB;AAC3B,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,KAAK;AAET,QAAI,YAAgC;AACpC,QAAI,WAAW,WAAW;AACxB,kBAAY,oCAAC,uBAAoB,MAAK,UAAS,SAAS,aAAa;AAAA,IACvE,WAAW,WAAW,QAAQ;AAC5B,kBACE,oCAAC,QAAK,WAAU,uBACd;AAAA,QAAC;AAAA;AAAA,UACC,MAAI;AAAA,UACJ,SAAS,KAAK,QAAQ,KAAK,IAAI;AAAA,UAC/B,aAAa;AAAA;AAAA,QAEZ;AAAA,MACH,CACF;AAAA,IAEJ,OAAO;AACL,kBACE,oCAAC,QAAK,WAAU,qBAAoB,OAAO,mBACxC,UACH;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,WAAW,gBAAgB,SAAS;AAAA,QAC/C,OAAO;AAAA;AAAA,MAEN;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,eAAe;AAAA,EACxB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACd;AAEA,WAAW,YAAY;AAAA,EACrB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,iBAAiB,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACzE,cAAc,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACtE,QAAQ,UAAU,MAAM,CAAC,QAAQ,WAAW,QAAQ,CAAC;AAAA,EACrD,aAAa,UAAU;AAAA,EACvB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AACrB;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface AtLoadingProps {
|
|
4
|
+
size?: string | number;
|
|
5
|
+
color?: string | number;
|
|
6
|
+
}
|
|
7
|
+
export default class AtLoading extends React.Component<AtLoadingProps> {
|
|
8
|
+
static defaultProps: AtLoadingProps;
|
|
9
|
+
static propTypes: InferProps<AtLoadingProps>;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import PropTypes from
|
|
2
|
-
import React from
|
|
3
|
-
import { View } from
|
|
4
|
-
import { pxTransform } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
React.createElement(View, { className: 'at-loading__ring', style: ringStyle }),
|
|
21
|
-
React.createElement(View, { className: 'at-loading__ring', style: ringStyle })));
|
|
22
|
-
}
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "@tarojs/components";
|
|
4
|
+
import { pxTransform } from "../../common/utils";
|
|
5
|
+
class AtLoading extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const { color, size } = this.props;
|
|
8
|
+
const loadingSize = typeof size === "string" ? size : String(size);
|
|
9
|
+
const sizeStyle = {
|
|
10
|
+
width: size ? `${pxTransform(parseInt(loadingSize))}` : "",
|
|
11
|
+
height: size ? `${pxTransform(parseInt(loadingSize))}` : ""
|
|
12
|
+
};
|
|
13
|
+
const colorStyle = {
|
|
14
|
+
border: color ? `1px solid ${color}` : "",
|
|
15
|
+
borderColor: color ? `${color} transparent transparent transparent` : ""
|
|
16
|
+
};
|
|
17
|
+
const ringStyle = Object.assign({}, colorStyle, sizeStyle);
|
|
18
|
+
return /* @__PURE__ */ React.createElement(View, { className: "at-loading", style: sizeStyle }, /* @__PURE__ */ React.createElement(View, { className: "at-loading__ring", style: ringStyle }), /* @__PURE__ */ React.createElement(View, { className: "at-loading__ring", style: ringStyle }), /* @__PURE__ */ React.createElement(View, { className: "at-loading__ring", style: ringStyle }));
|
|
19
|
+
}
|
|
23
20
|
}
|
|
24
21
|
AtLoading.defaultProps = {
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
size: 0,
|
|
23
|
+
color: ""
|
|
27
24
|
};
|
|
28
25
|
AtLoading.propTypes = {
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
27
|
+
color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
AtLoading as default
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/loading/index.tsx"],"sourcesContent":["import PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { pxTransform } from '../../common/utils'\n\ninterface AtLoadingProps {\n size?: string | number\n color?: string | number\n}\n\nexport default class AtLoading extends React.Component<AtLoadingProps> {\n public static defaultProps: AtLoadingProps\n public static propTypes: InferProps<AtLoadingProps>\n\n public render(): JSX.Element {\n const { color, size } = this.props\n const loadingSize = typeof size === 'string' ? size : String(size)\n const sizeStyle = {\n width: size ? `${pxTransform(parseInt(loadingSize))}` : '',\n height: size ? `${pxTransform(parseInt(loadingSize))}` : ''\n }\n const colorStyle = {\n border: color ? `1px solid ${color}` : '',\n borderColor: color ? `${color} transparent transparent transparent` : ''\n }\n const ringStyle = Object.assign({}, colorStyle, sizeStyle)\n\n return (\n <View className='at-loading' style={sizeStyle}>\n <View className='at-loading__ring' style={ringStyle}></View>\n <View className='at-loading__ring' style={ringStyle}></View>\n <View className='at-loading__ring' style={ringStyle}></View>\n </View>\n )\n }\n}\n\nAtLoading.defaultProps = {\n size: 0,\n color: ''\n}\n\nAtLoading.propTypes = {\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n}\n"],"mappings":"AAAA,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAO5B,MAAO,kBAAgC,MAAM,UAA0B;AAAA,EAI9D,SAAsB;AAC3B,UAAM,EAAE,OAAO,KAAK,IAAI,KAAK;AAC7B,UAAM,cAAc,OAAO,SAAS,WAAW,OAAO,OAAO,IAAI;AACjE,UAAM,YAAY;AAAA,MAChB,OAAO,OAAO,GAAG,YAAY,SAAS,WAAW,CAAC,CAAC,KAAK;AAAA,MACxD,QAAQ,OAAO,GAAG,YAAY,SAAS,WAAW,CAAC,CAAC,KAAK;AAAA,IAC3D;AACA,UAAM,aAAa;AAAA,MACjB,QAAQ,QAAQ,aAAa,KAAK,KAAK;AAAA,MACvC,aAAa,QAAQ,GAAG,KAAK,yCAAyC;AAAA,IACxE;AACA,UAAM,YAAY,OAAO,OAAO,CAAC,GAAG,YAAY,SAAS;AAEzD,WACE,oCAAC,QAAK,WAAU,cAAa,OAAO,aAClC,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW,GACrD,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW,GACrD,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW,CACvD;AAAA,EAEJ;AACF;AAEA,UAAU,eAAe;AAAA,EACvB,MAAM;AAAA,EACN,OAAO;AACT;AAEA,UAAU,YAAY;AAAA,EACpB,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC9D,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AACjE;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtMessageProps, AtMessageState } from '../../../types/message';
|
|
4
|
+
export default class AtMessage extends React.Component<AtMessageProps, AtMessageState> {
|
|
5
|
+
static defaultProps: AtMessageProps;
|
|
6
|
+
static propTypes: InferProps<AtMessageProps>;
|
|
7
|
+
private _timer;
|
|
8
|
+
constructor(props: AtMessageProps);
|
|
9
|
+
private bindMessageListener;
|
|
10
|
+
componentDidShow(): void;
|
|
11
|
+
componentDidMount(): void;
|
|
12
|
+
componentDidHide(): void;
|
|
13
|
+
componentWillUnmount(): void;
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|