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 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/icon/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Text } from '@tarojs/components'\nimport { AtIconProps } from '../../../types/icon'\nimport { mergeStyle, pxTransform } from '../../common/utils'\n\nexport default class AtIcon extends React.Component<AtIconProps> {\n public static defaultProps: AtIconProps\n public static propTypes: InferProps<AtIconProps>\n\n private handleClick(): void {\n this.props.onClick && this.props.onClick(arguments as any)\n }\n\n public render(): JSX.Element {\n const {\n customStyle = {},\n className,\n prefixClass,\n value,\n size,\n color\n } = this.props\n\n const rootStyle = {\n fontSize: `${pxTransform(parseInt(String(size)) * 2)}`,\n color\n }\n\n const iconName = value ? `${prefixClass}-${value}` : ''\n return (\n <Text\n className={classNames(prefixClass, iconName, className)}\n style={mergeStyle(rootStyle, customStyle)}\n onClick={this.handleClick.bind(this)}\n ></Text>\n )\n }\n}\n\nAtIcon.defaultProps = {\n customStyle: '',\n className: '',\n prefixClass: 'at-icon',\n value: '',\n color: '',\n size: 24\n}\n\nAtIcon.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n prefixClass: PropTypes.string,\n value: PropTypes.string,\n color: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onClick: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,SAAS,YAAY,mBAAmB;AAExC,MAAO,eAA6B,MAAM,UAAuB;AAAA,EAIvD,cAAoB;AAC1B,SAAK,MAAM,WAAW,KAAK,MAAM,QAAQ,SAAgB;AAAA,EAC3D;AAAA,EAEO,SAAsB;AAC3B,UAAM;AAAA,MACJ,cAAc,CAAC;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,KAAK;AAET,UAAM,YAAY;AAAA,MAChB,UAAU,GAAG,YAAY,SAAS,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AAAA,MACpD;AAAA,IACF;AAEA,UAAM,WAAW,QAAQ,GAAG,WAAW,IAAI,KAAK,KAAK;AACrD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,WAAW,aAAa,UAAU,SAAS;AAAA,QACtD,OAAO,WAAW,WAAW,WAAW;AAAA,QACxC,SAAS,KAAK,YAAY,KAAK,IAAI;AAAA;AAAA,IACpC;AAAA,EAEL;AACF;AAEA,OAAO,eAAe;AAAA,EACpB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AAEA,OAAO,YAAY;AAAA,EACjB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,aAAa,UAAU;AAAA,EACvB,OAAO,UAAU;AAAA,EACjB,OAAO,UAAU;AAAA,EACjB,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC9D,SAAS,UAAU;AACrB;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtImagePickerProps } from '../../../types/image-picker';
|
|
4
|
+
export default class AtImagePicker extends React.Component<AtImagePickerProps> {
|
|
5
|
+
static defaultProps: AtImagePickerProps;
|
|
6
|
+
static propTypes: InferProps<AtImagePickerProps>;
|
|
7
|
+
private chooseFile;
|
|
8
|
+
private handleImageClick;
|
|
9
|
+
private handleRemoveImg;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
@@ -1,138 +1,164 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import React from
|
|
4
|
-
import { Image, View } from
|
|
5
|
-
import Taro from
|
|
6
|
-
import { uuid } from
|
|
7
|
-
// 生成 jsx 二维矩阵
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Image, View } from "@tarojs/components";
|
|
5
|
+
import Taro from "@tarojs/taro";
|
|
6
|
+
import { uuid } from "../../common/utils";
|
|
8
7
|
const generateMatrix = (files, col, showAddBtn) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
lastArr.push({ type: 'btn', uuid: uuid() });
|
|
19
|
-
}
|
|
20
|
-
// 填补剩下的空列
|
|
21
|
-
for (let j = lastArr.length; j < col; j++) {
|
|
22
|
-
lastArr.push({ type: 'blank', uuid: uuid() });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
matrix.push(lastArr);
|
|
8
|
+
const matrix = [];
|
|
9
|
+
const length = showAddBtn ? files.length + 1 : files.length;
|
|
10
|
+
const row = Math.ceil(length / col);
|
|
11
|
+
for (let i = 0; i < row; i++) {
|
|
12
|
+
if (i === row - 1) {
|
|
13
|
+
const lastArr = files.slice(i * col);
|
|
14
|
+
if (lastArr.length < col) {
|
|
15
|
+
if (showAddBtn) {
|
|
16
|
+
lastArr.push({ type: "btn", uuid: uuid() });
|
|
26
17
|
}
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
for (let j = lastArr.length; j < col; j++) {
|
|
19
|
+
lastArr.push({ type: "blank", uuid: uuid() });
|
|
29
20
|
}
|
|
21
|
+
}
|
|
22
|
+
matrix.push(lastArr);
|
|
23
|
+
} else {
|
|
24
|
+
matrix.push(files.slice(i * col, (i + 1) * col));
|
|
30
25
|
}
|
|
31
|
-
|
|
26
|
+
}
|
|
27
|
+
return matrix;
|
|
32
28
|
};
|
|
33
29
|
const ENV = Taro.getEnv();
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
30
|
+
class AtImagePicker extends React.Component {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.chooseFile = () => {
|
|
34
|
+
const { files = [], multiple, count, sizeType, sourceType } = this.props;
|
|
35
|
+
const filePathName = ENV === Taro.ENV_TYPE.ALIPAY ? "apFilePaths" : "tempFiles";
|
|
36
|
+
const params = {};
|
|
37
|
+
if (multiple) {
|
|
38
|
+
params.count = 99;
|
|
39
|
+
}
|
|
40
|
+
if (count) {
|
|
41
|
+
params.count = count;
|
|
42
|
+
}
|
|
43
|
+
if (sizeType) {
|
|
44
|
+
params.sizeType = sizeType;
|
|
45
|
+
}
|
|
46
|
+
if (sourceType) {
|
|
47
|
+
params.sourceType = sourceType;
|
|
48
|
+
}
|
|
49
|
+
Taro.chooseImage(params).then((res) => {
|
|
50
|
+
const targetFiles = res.tempFilePaths.map((path, i) => ({
|
|
51
|
+
url: path,
|
|
52
|
+
file: res[filePathName][i]
|
|
53
|
+
}));
|
|
54
|
+
const newFiles = files.concat(targetFiles);
|
|
55
|
+
this.props.onChange(newFiles, "add");
|
|
56
|
+
}).catch((err) => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
(_b = (_a = this.props) == null ? void 0 : _a.onFail) == null ? void 0 : _b.call(_a, err);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
this.handleImageClick = (idx) => {
|
|
62
|
+
this.props.onImageClick && this.props.onImageClick(idx, this.props.files[idx]);
|
|
63
|
+
};
|
|
64
|
+
this.handleRemoveImg = (idx, event) => {
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
const { files = [] } = this.props;
|
|
68
|
+
if (ENV === Taro.ENV_TYPE.WEB) {
|
|
69
|
+
window.URL.revokeObjectURL(files[idx].url);
|
|
70
|
+
}
|
|
71
|
+
const newFiles = files.filter((_, i) => i !== idx);
|
|
72
|
+
this.props.onChange(newFiles, "remove", idx);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
const {
|
|
77
|
+
className,
|
|
78
|
+
customStyle,
|
|
79
|
+
files,
|
|
80
|
+
mode,
|
|
81
|
+
length = 4,
|
|
82
|
+
showAddBtn = true
|
|
83
|
+
} = this.props;
|
|
84
|
+
const rowLength = length <= 0 ? 1 : length;
|
|
85
|
+
const matrix = generateMatrix(files, rowLength, showAddBtn);
|
|
86
|
+
const rootCls = classNames("at-image-picker", className);
|
|
87
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: customStyle }, matrix.map((row, i) => /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__flex-box", key: i + 1 }, row.map(
|
|
88
|
+
(item, j) => item.url ? /* @__PURE__ */ React.createElement(
|
|
89
|
+
View,
|
|
90
|
+
{
|
|
91
|
+
className: "at-image-picker__flex-item",
|
|
92
|
+
key: i * length + j
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React.createElement(View, { className: "at-image-picker__item" }, /* @__PURE__ */ React.createElement(
|
|
95
|
+
View,
|
|
96
|
+
{
|
|
97
|
+
className: "at-image-picker__remove-btn",
|
|
98
|
+
onClick: this.handleRemoveImg.bind(this, i * length + j)
|
|
99
|
+
}
|
|
100
|
+
), /* @__PURE__ */ React.createElement(
|
|
101
|
+
Image,
|
|
102
|
+
{
|
|
103
|
+
className: "at-image-picker__preview-img",
|
|
104
|
+
mode,
|
|
105
|
+
src: item.url,
|
|
106
|
+
onClick: this.handleImageClick.bind(this, i * length + j)
|
|
107
|
+
}
|
|
108
|
+
))
|
|
109
|
+
) : /* @__PURE__ */ React.createElement(
|
|
110
|
+
View,
|
|
111
|
+
{
|
|
112
|
+
className: "at-image-picker__flex-item",
|
|
113
|
+
key: `empty_${i * length}${j}`
|
|
114
|
+
},
|
|
115
|
+
item.type === "btn" && /* @__PURE__ */ React.createElement(View, { onClick: this.chooseFile }, this.props.children || /* @__PURE__ */ React.createElement(View, { className: "at-image-picker__item at-image-picker__choose-btn" }, /* @__PURE__ */ React.createElement(View, { className: "add-bar" }), /* @__PURE__ */ React.createElement(View, { className: "add-bar" })))
|
|
116
|
+
)
|
|
117
|
+
))));
|
|
118
|
+
}
|
|
97
119
|
}
|
|
98
120
|
AtImagePicker.defaultProps = {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
121
|
+
className: "",
|
|
122
|
+
customStyle: "",
|
|
123
|
+
files: [],
|
|
124
|
+
mode: "aspectFill",
|
|
125
|
+
showAddBtn: true,
|
|
126
|
+
multiple: false,
|
|
127
|
+
length: 4,
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
129
|
+
onChange: () => {
|
|
130
|
+
}
|
|
108
131
|
};
|
|
109
132
|
AtImagePicker.propTypes = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
134
|
+
customStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
135
|
+
files: PropTypes.array,
|
|
136
|
+
mode: PropTypes.oneOf([
|
|
137
|
+
"scaleToFill",
|
|
138
|
+
"aspectFit",
|
|
139
|
+
"aspectFill",
|
|
140
|
+
"widthFix",
|
|
141
|
+
"top",
|
|
142
|
+
"bottom",
|
|
143
|
+
"center",
|
|
144
|
+
"left",
|
|
145
|
+
"right",
|
|
146
|
+
"top left",
|
|
147
|
+
"top right",
|
|
148
|
+
"bottom left",
|
|
149
|
+
"bottom right"
|
|
150
|
+
]),
|
|
151
|
+
showAddBtn: PropTypes.bool,
|
|
152
|
+
multiple: PropTypes.bool,
|
|
153
|
+
length: PropTypes.number,
|
|
154
|
+
onChange: PropTypes.func,
|
|
155
|
+
onImageClick: PropTypes.func,
|
|
156
|
+
onFail: PropTypes.func,
|
|
157
|
+
count: PropTypes.number,
|
|
158
|
+
sizeType: PropTypes.array,
|
|
159
|
+
sourceType: PropTypes.array
|
|
160
|
+
};
|
|
161
|
+
export {
|
|
162
|
+
AtImagePicker as default
|
|
137
163
|
};
|
|
138
164
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/image-picker/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Image, View } from '@tarojs/components'\nimport { ITouchEvent } from '@tarojs/components/types/common'\nimport Taro from '@tarojs/taro'\nimport { AtImagePickerProps, File } from '../../../types/image-picker'\nimport { uuid } from '../../common/utils'\n\ninterface MatrixFile extends Partial<File> {\n type: 'blank' | 'btn'\n uuid: string\n}\n\n// 生成 jsx 二维矩阵\nconst generateMatrix = (\n files: MatrixFile[],\n col: number,\n showAddBtn: boolean\n): MatrixFile[][] => {\n const matrix: Array<MatrixFile>[] = []\n const length = showAddBtn ? files.length + 1 : files.length\n const row = Math.ceil(length / col)\n for (let i = 0; i < row; i++) {\n if (i === row - 1) {\n // 最后一行数据加上添加按钮\n const lastArr = files.slice(i * col)\n if (lastArr.length < col) {\n if (showAddBtn) {\n lastArr.push({ type: 'btn', uuid: uuid() })\n }\n // 填补剩下的空列\n for (let j = lastArr.length; j < col; j++) {\n lastArr.push({ type: 'blank', uuid: uuid() })\n }\n }\n matrix.push(lastArr)\n } else {\n matrix.push(files.slice(i * col, (i + 1) * col))\n }\n }\n return matrix\n}\n\nconst ENV = Taro.getEnv()\n\nexport default class AtImagePicker extends React.Component<AtImagePickerProps> {\n public static defaultProps: AtImagePickerProps\n public static propTypes: InferProps<AtImagePickerProps>\n\n private chooseFile = (): void => {\n const { files = [], multiple, count, sizeType, sourceType } = this.props\n const filePathName =\n ENV === Taro.ENV_TYPE.ALIPAY ? 'apFilePaths' : 'tempFiles'\n // const count = multiple ? 99 : 1\n const params: any = {}\n if (multiple) {\n params.count = 99\n }\n if (count) {\n params.count = count\n }\n if (sizeType) {\n params.sizeType = sizeType\n }\n if (sourceType) {\n params.sourceType = sourceType\n }\n Taro.chooseImage(params)\n .then(res => {\n const targetFiles = res.tempFilePaths.map((path, i) => ({\n url: path,\n file: res[filePathName][i]\n }))\n const newFiles = files.concat(targetFiles)\n this.props.onChange(newFiles, 'add')\n })\n .catch(err => {\n this.props?.onFail?.(err)\n })\n }\n\n private handleImageClick = (idx: number): void => {\n this.props.onImageClick &&\n this.props.onImageClick(idx, this.props.files[idx])\n }\n\n private handleRemoveImg = (idx: number, event: ITouchEvent): void => {\n event.stopPropagation()\n event.preventDefault()\n const { files = [] } = this.props\n if (ENV === Taro.ENV_TYPE.WEB) {\n window.URL.revokeObjectURL(files[idx].url)\n }\n const newFiles = files.filter((_, i) => i !== idx)\n this.props.onChange(newFiles, 'remove', idx)\n }\n\n public render(): JSX.Element {\n const {\n className,\n customStyle,\n files,\n mode,\n length = 4,\n showAddBtn = true\n } = this.props\n const rowLength = length <= 0 ? 1 : length\n // 行数\n const matrix = generateMatrix(files as MatrixFile[], rowLength, showAddBtn)\n const rootCls = classNames('at-image-picker', className)\n\n return (\n <View className={rootCls} style={customStyle}>\n {matrix.map((row, i) => (\n <View className='at-image-picker__flex-box' key={i + 1}>\n {row.map((item, j) =>\n item.url ? (\n <View\n className='at-image-picker__flex-item'\n key={i * length + j}\n >\n <View className='at-image-picker__item'>\n <View\n className='at-image-picker__remove-btn'\n onClick={this.handleRemoveImg.bind(this, i * length + j)}\n ></View>\n <Image\n className='at-image-picker__preview-img'\n mode={mode}\n src={item.url}\n onClick={this.handleImageClick.bind(this, i * length + j)}\n />\n </View>\n </View>\n ) : (\n <View\n className='at-image-picker__flex-item'\n key={`empty_${i * length}${j}`}\n >\n {item.type === 'btn' && (\n <View onClick={this.chooseFile}>\n {this.props.children || (\n <View className='at-image-picker__item at-image-picker__choose-btn'>\n <View className='add-bar'></View>\n <View className='add-bar'></View>\n </View>\n )}\n </View>\n )}\n </View>\n )\n )}\n </View>\n ))}\n </View>\n )\n }\n}\n\nAtImagePicker.defaultProps = {\n className: '',\n customStyle: '',\n files: [],\n mode: 'aspectFill',\n showAddBtn: true,\n multiple: false,\n length: 4,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange: (): void => {}\n}\n\nAtImagePicker.propTypes = {\n className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n customStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n files: PropTypes.array,\n mode: PropTypes.oneOf([\n 'scaleToFill',\n 'aspectFit',\n 'aspectFill',\n 'widthFix',\n 'top',\n 'bottom',\n 'center',\n 'left',\n 'right',\n 'top left',\n 'top right',\n 'bottom left',\n 'bottom right'\n ]),\n showAddBtn: PropTypes.bool,\n multiple: PropTypes.bool,\n length: PropTypes.number,\n onChange: PropTypes.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AAO,UAAU;AAAA,EACjB,MAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,UAAU;AAAA,EACtB,UAAU,UAAU;AAAA,EACpB,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,QAAQ,UAAU;AAAA,EAClB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AACxB;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtIndexesProps, AtIndexesState } from '../../../types/indexes';
|
|
4
|
+
export default class AtIndexes extends React.Component<AtIndexesProps, AtIndexesState> {
|
|
5
|
+
static defaultProps: AtIndexesProps;
|
|
6
|
+
static propTypes: InferProps<AtIndexesProps>;
|
|
7
|
+
private menuHeight;
|
|
8
|
+
private startTop;
|
|
9
|
+
private itemHeight;
|
|
10
|
+
private currentIndex;
|
|
11
|
+
private listId;
|
|
12
|
+
private timeoutTimer;
|
|
13
|
+
private listRef;
|
|
14
|
+
private indexMap;
|
|
15
|
+
constructor(props: AtIndexesProps);
|
|
16
|
+
private handleClick;
|
|
17
|
+
private handleTouchMove;
|
|
18
|
+
private handleTouchEnd;
|
|
19
|
+
private jumpTarget;
|
|
20
|
+
private __jumpTarget;
|
|
21
|
+
private updateState;
|
|
22
|
+
private initData;
|
|
23
|
+
private handleScroll;
|
|
24
|
+
private getAnchorIndex;
|
|
25
|
+
UNSAFE_componentWillReceiveProps(nextProps: AtIndexesProps): void;
|
|
26
|
+
componentDidMount(): void;
|
|
27
|
+
UNSAFE_componentWillMount(): void;
|
|
28
|
+
render(): JSX.Element;
|
|
29
|
+
}
|