taro-ui 3.3.1 → 3.3.3
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/dist/common/component.d.ts +10 -0
- package/dist/common/component.js +32 -0
- package/dist/common/component.js.map +1 -0
- package/dist/common/utils.d.ts +41 -0
- package/dist/common/utils.js +203 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/components/accordion/index.d.ts +14 -0
- package/dist/components/accordion/index.js +121 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/action-sheet/body/index.d.ts +5 -0
- package/dist/components/action-sheet/body/index.js +13 -0
- package/dist/components/action-sheet/body/index.js.map +1 -0
- package/dist/components/action-sheet/body/item/index.d.ts +9 -0
- package/dist/components/action-sheet/body/item/index.js +25 -0
- package/dist/components/action-sheet/body/item/index.js.map +1 -0
- package/dist/components/action-sheet/footer/index.d.ts +9 -0
- package/dist/components/action-sheet/footer/index.js +28 -0
- package/dist/components/action-sheet/footer/index.js.map +1 -0
- package/dist/components/action-sheet/header/index.d.ts +5 -0
- package/dist/components/action-sheet/header/index.js +16 -0
- package/dist/components/action-sheet/header/index.js.map +1 -0
- package/dist/components/action-sheet/index.d.ts +14 -0
- package/dist/components/action-sheet/index.js +76 -0
- package/dist/components/action-sheet/index.js.map +1 -0
- package/dist/components/activity-indicator/index.d.ts +8 -0
- package/dist/components/activity-indicator/index.js +39 -0
- package/dist/components/activity-indicator/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +9 -0
- package/dist/components/avatar/index.js +68 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +10 -0
- package/dist/components/badge/index.js +51 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/button/index.d.ts +15 -0
- package/dist/components/button/index.js +177 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/calendar/body/index.d.ts +26 -0
- package/dist/components/calendar/body/index.js +289 -0
- package/dist/components/calendar/body/index.js.map +1 -0
- package/dist/components/calendar/common/constant.d.ts +3 -0
- package/dist/components/calendar/common/constant.js +9 -0
- package/dist/components/calendar/common/constant.js.map +1 -0
- package/dist/components/calendar/common/helper.d.ts +4 -0
- package/dist/components/calendar/common/helper.js +84 -0
- package/dist/components/calendar/common/helper.js.map +1 -0
- package/dist/components/calendar/common/plugins.d.ts +11 -0
- package/dist/components/calendar/common/plugins.js +55 -0
- package/dist/components/calendar/common/plugins.js.map +1 -0
- package/dist/components/calendar/controller/index.d.ts +5 -0
- package/dist/components/calendar/controller/index.js +51 -0
- package/dist/components/calendar/controller/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +20 -0
- package/dist/components/calendar/index.js +244 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/calendar/ui/date-list/index.d.ts +12 -0
- package/dist/components/calendar/ui/date-list/index.js +54 -0
- package/dist/components/calendar/ui/date-list/index.js.map +1 -0
- package/dist/components/calendar/ui/day-list/index.d.ts +4 -0
- package/dist/components/calendar/ui/day-list/index.js +11 -0
- package/dist/components/calendar/ui/day-list/index.js.map +1 -0
- package/dist/components/card/index.d.ts +9 -0
- package/dist/components/card/index.js +80 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +59 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/countdown/index.d.ts +20 -0
- package/dist/components/countdown/index.js +152 -0
- package/dist/components/countdown/index.js.map +1 -0
- package/dist/components/countdown/item/index.d.ts +9 -0
- package/dist/components/countdown/item/index.js +24 -0
- package/dist/components/countdown/item/index.js.map +1 -0
- package/dist/components/curtain/index.d.ts +10 -0
- package/dist/components/curtain/index.js +62 -0
- package/dist/components/curtain/index.js.map +1 -0
- package/dist/components/divider/index.d.ts +8 -0
- package/dist/components/divider/index.js +57 -0
- package/dist/components/divider/index.js.map +1 -0
- package/dist/components/drawer/index.d.ts +16 -0
- package/dist/components/drawer/index.js +114 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/fab/index.d.ts +9 -0
- package/dist/components/fab/index.js +29 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/components/flex/index.d.ts +7 -0
- package/dist/components/flex/index.js +41 -0
- package/dist/components/flex/index.js.map +1 -0
- package/dist/components/flex/item/index.d.ts +7 -0
- package/dist/components/flex/item/index.js +34 -0
- package/dist/components/flex/item/index.js.map +1 -0
- package/dist/components/float-layout/index.d.ts +13 -0
- package/dist/components/float-layout/index.js +104 -0
- package/dist/components/float-layout/index.js.map +1 -0
- package/dist/components/form/index.d.ts +10 -0
- package/dist/components/form/index.js +43 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/grid/index.d.ts +9 -0
- package/dist/components/grid/index.js +101 -0
- package/dist/components/grid/index.js.map +1 -0
- package/dist/components/icon/index.d.ts +9 -0
- package/dist/components/icon/index.js +54 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/components/image-picker/index.d.ts +11 -0
- package/dist/components/image-picker/index.js +164 -0
- package/dist/components/image-picker/index.js.map +1 -0
- package/dist/components/indexes/index.d.ts +29 -0
- package/dist/components/indexes/index.js +272 -0
- package/dist/components/indexes/index.js.map +1 -0
- package/dist/components/input/index.d.ts +17 -0
- package/dist/components/input/index.js +232 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input-number/index.d.ts +13 -0
- package/dist/components/input-number/index.js +193 -0
- package/dist/components/input-number/index.js.map +1 -0
- package/dist/components/list/index.d.ts +8 -0
- package/dist/components/list/index.js +26 -0
- package/dist/components/list/index.js.map +1 -0
- package/dist/components/list/item/index.d.ts +11 -0
- package/dist/components/list/item/index.js +152 -0
- package/dist/components/list/item/index.js.map +1 -0
- package/dist/components/load-more/index.d.ts +9 -0
- package/dist/components/load-more/index.js +72 -0
- package/dist/components/load-more/index.js.map +1 -0
- package/dist/components/loading/index.d.ts +12 -0
- package/dist/components/loading/index.js +32 -0
- package/dist/components/loading/index.js.map +1 -0
- package/dist/components/message/index.d.ts +15 -0
- package/dist/components/message/index.js +78 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/modal/action/index.d.ts +8 -0
- package/dist/components/modal/action/index.js +26 -0
- package/dist/components/modal/action/index.js.map +1 -0
- package/dist/components/modal/content/index.d.ts +5 -0
- package/dist/components/modal/content/index.js +13 -0
- package/dist/components/modal/content/index.js.map +1 -0
- package/dist/components/modal/header/index.d.ts +5 -0
- package/dist/components/modal/header/index.js +13 -0
- package/dist/components/modal/header/index.js.map +1 -0
- package/dist/components/modal/index.d.ts +15 -0
- package/dist/components/modal/index.js +106 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/nav-bar/index.d.ts +12 -0
- package/dist/components/nav-bar/index.js +217 -0
- package/dist/components/nav-bar/index.js.map +1 -0
- package/dist/components/noticebar/index.d.ts +16 -0
- package/dist/components/noticebar/index.js +186 -0
- package/dist/components/noticebar/index.js.map +1 -0
- package/dist/components/pagination/index.d.ts +12 -0
- package/dist/components/pagination/index.js +146 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/progress/index.d.ts +7 -0
- package/dist/components/progress/index.js +53 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/radio/index.d.ts +9 -0
- package/dist/components/radio/index.js +54 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/range/index.d.ts +22 -0
- package/dist/components/range/index.js +207 -0
- package/dist/components/range/index.js.map +1 -0
- package/dist/components/rate/index.d.ts +9 -0
- package/dist/components/rate/index.js +82 -0
- package/dist/components/rate/index.js.map +1 -0
- package/dist/components/search-bar/index.d.ts +16 -0
- package/dist/components/search-bar/index.js +176 -0
- package/dist/components/search-bar/index.js.map +1 -0
- package/dist/components/segmented-control/index.d.ts +9 -0
- package/dist/components/segmented-control/index.js +84 -0
- package/dist/components/segmented-control/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +13 -0
- package/dist/components/slider/index.js +115 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/steps/index.d.ts +9 -0
- package/dist/components/steps/index.js +67 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/swipe-action/index.d.ts +27 -0
- package/dist/components/swipe-action/index.js +220 -0
- package/dist/components/swipe-action/index.js.map +1 -0
- package/dist/components/swipe-action/options/index.d.ts +5 -0
- package/dist/components/swipe-action/options/index.js +24 -0
- package/dist/components/swipe-action/options/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +9 -0
- package/dist/components/switch/index.js +59 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/tab-bar/index.d.ts +9 -0
- package/dist/components/tab-bar/index.js +170 -0
- package/dist/components/tab-bar/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +24 -0
- package/dist/components/tabs/index.js +219 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs-pane/index.d.ts +8 -0
- package/dist/components/tabs-pane/index.js +43 -0
- package/dist/components/tabs-pane/index.js.map +1 -0
- package/dist/components/tag/index.d.ts +9 -0
- package/dist/components/tag/index.js +75 -0
- package/dist/components/tag/index.js.map +1 -0
- package/dist/components/textarea/index.d.ts +13 -0
- package/dist/components/textarea/index.js +141 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/timeline/index.d.ts +8 -0
- package/dist/components/timeline/index.js +76 -0
- package/dist/components/timeline/index.js.map +1 -0
- package/dist/components/toast/img.json +8 -0
- package/dist/components/toast/index.d.ts +16 -0
- package/dist/components/toast/index.js +124 -0
- package/dist/components/toast/index.js.map +1 -0
- package/{lib/index.js → dist/index.d.ts} +0 -2
- package/dist/index.esm.js +6020 -8272
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6104 -8332
- package/dist/index.js.map +1 -1
- package/dist/style/components/grid.scss +2 -2
- package/dist/style/components/index.scss +48 -48
- package/dist/style/components/list.scss +2 -2
- package/dist/style/index.css +11754 -0
- package/dist/style/index.css.map +1 -0
- package/dist/style/mixins/index.scss +13 -13
- package/dist/style/mixins/libs/shade.scss +4 -2
- package/dist/style/mixins/libs/tint.scss +4 -2
- package/dist/style/variables/default.scss +1 -1
- package/package.json +56 -33
- 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/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/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/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/lib/common/component.js +0 -33
- package/lib/common/component.js.map +0 -1
- package/lib/common/utils.js +0 -226
- package/lib/common/utils.js.map +0 -1
- package/lib/components/accordion/index.js +0 -116
- package/lib/components/accordion/index.js.map +0 -1
- package/lib/components/action-sheet/body/index.js +0 -10
- package/lib/components/action-sheet/body/index.js.map +0 -1
- package/lib/components/action-sheet/body/item/index.js +0 -22
- package/lib/components/action-sheet/body/item/index.js.map +0 -1
- package/lib/components/action-sheet/footer/index.js +0 -22
- package/lib/components/action-sheet/footer/index.js.map +0 -1
- package/lib/components/action-sheet/header/index.js +0 -10
- package/lib/components/action-sheet/header/index.js.map +0 -1
- package/lib/components/action-sheet/index.js +0 -71
- package/lib/components/action-sheet/index.js.map +0 -1
- package/lib/components/activity-indicator/index.js +0 -35
- package/lib/components/activity-indicator/index.js.map +0 -1
- package/lib/components/avatar/index.js +0 -64
- package/lib/components/avatar/index.js.map +0 -1
- package/lib/components/badge/index.js +0 -42
- package/lib/components/badge/index.js.map +0 -1
- package/lib/components/button/index.js +0 -125
- package/lib/components/button/index.js.map +0 -1
- package/lib/components/calendar/body/index.js +0 -193
- package/lib/components/calendar/body/index.js.map +0 -1
- package/lib/components/calendar/common/constant.js +0 -4
- package/lib/components/calendar/common/constant.js.map +0 -1
- package/lib/components/calendar/common/helper.js +0 -83
- package/lib/components/calendar/common/helper.js.map +0 -1
- package/lib/components/calendar/common/plugins.js +0 -71
- package/lib/components/calendar/common/plugins.js.map +0 -1
- package/lib/components/calendar/controller/index.js +0 -30
- package/lib/components/calendar/controller/index.js.map +0 -1
- package/lib/components/calendar/index.js +0 -207
- package/lib/components/calendar/index.js.map +0 -1
- package/lib/components/calendar/ui/date-list/index.js +0 -43
- package/lib/components/calendar/ui/date-list/index.js.map +0 -1
- package/lib/components/calendar/ui/day-list/index.js +0 -16
- package/lib/components/calendar/ui/day-list/index.js.map +0 -1
- package/lib/components/card/index.js +0 -59
- package/lib/components/card/index.js.map +0 -1
- package/lib/components/checkbox/index.js +0 -55
- package/lib/components/checkbox/index.js.map +0 -1
- package/lib/components/countdown/index.js +0 -137
- package/lib/components/countdown/index.js.map +0 -1
- package/lib/components/countdown/item/index.js +0 -24
- package/lib/components/countdown/item/index.js.map +0 -1
- package/lib/components/curtain/index.js +0 -45
- package/lib/components/curtain/index.js.map +0 -1
- package/lib/components/divider/index.js +0 -40
- package/lib/components/divider/index.js.map +0 -1
- package/lib/components/drawer/index.js +0 -93
- package/lib/components/drawer/index.js.map +0 -1
- package/lib/components/fab/index.js +0 -26
- package/lib/components/fab/index.js.map +0 -1
- package/lib/components/flex/index.js +0 -38
- package/lib/components/flex/index.js.map +0 -1
- package/lib/components/flex/item/index.js +0 -31
- package/lib/components/flex/item/index.js.map +0 -1
- package/lib/components/float-layout/index.js +0 -76
- package/lib/components/float-layout/index.js.map +0 -1
- package/lib/components/form/index.js +0 -30
- package/lib/components/form/index.js.map +0 -1
- package/lib/components/grid/index.js +0 -71
- package/lib/components/grid/index.js.map +0 -1
- package/lib/components/icon/index.js +0 -37
- package/lib/components/icon/index.js.map +0 -1
- package/lib/components/image-picker/index.js +0 -138
- package/lib/components/image-picker/index.js.map +0 -1
- package/lib/components/indexes/index.js +0 -215
- package/lib/components/indexes/index.js.map +0 -1
- package/lib/components/input/index.js +0 -168
- package/lib/components/input/index.js.map +0 -1
- package/lib/components/input-number/index.js +0 -165
- package/lib/components/input-number/index.js.map +0 -1
- package/lib/components/list/index.js +0 -19
- package/lib/components/list/index.js.map +0 -1
- package/lib/components/list/item/index.js +0 -105
- package/lib/components/list/item/index.js.map +0 -1
- package/lib/components/load-more/index.js +0 -48
- package/lib/components/load-more/index.js.map +0 -1
- package/lib/components/loading/index.js +0 -32
- package/lib/components/loading/index.js.map +0 -1
- package/lib/components/message/index.js +0 -69
- package/lib/components/message/index.js.map +0 -1
- package/lib/components/modal/action/index.js +0 -20
- package/lib/components/modal/action/index.js.map +0 -1
- package/lib/components/modal/content/index.js +0 -10
- package/lib/components/modal/content/index.js.map +0 -1
- package/lib/components/modal/header/index.js +0 -10
- package/lib/components/modal/header/index.js.map +0 -1
- package/lib/components/modal/index.js +0 -97
- package/lib/components/modal/index.js.map +0 -1
- package/lib/components/nav-bar/index.js +0 -105
- package/lib/components/nav-bar/index.js.map +0 -1
- package/lib/components/noticebar/index.js +0 -163
- package/lib/components/noticebar/index.js.map +0 -1
- package/lib/components/pagination/index.js +0 -115
- package/lib/components/pagination/index.js.map +0 -1
- package/lib/components/progress/index.js +0 -45
- package/lib/components/progress/index.js.map +0 -1
- package/lib/components/radio/index.js +0 -43
- package/lib/components/radio/index.js.map +0 -1
- package/lib/components/range/index.js +0 -152
- package/lib/components/range/index.js.map +0 -1
- package/lib/components/rate/index.js +0 -56
- package/lib/components/rate/index.js.map +0 -1
- package/lib/components/search-bar/index.js +0 -121
- package/lib/components/search-bar/index.js.map +0 -1
- package/lib/components/segmented-control/index.js +0 -59
- package/lib/components/segmented-control/index.js.map +0 -1
- package/lib/components/slider/index.js +0 -77
- package/lib/components/slider/index.js.map +0 -1
- package/lib/components/steps/index.js +0 -50
- package/lib/components/steps/index.js.map +0 -1
- package/lib/components/swipe-action/index.js +0 -171
- package/lib/components/swipe-action/index.js.map +0 -1
- package/lib/components/swipe-action/options/index.js +0 -10
- package/lib/components/swipe-action/options/index.js.map +0 -1
- package/lib/components/switch/index.js +0 -48
- package/lib/components/switch/index.js.map +0 -1
- package/lib/components/tab-bar/index.js +0 -96
- package/lib/components/tab-bar/index.js.map +0 -1
- package/lib/components/tabs/index.js +0 -190
- package/lib/components/tabs/index.js.map +0 -1
- package/lib/components/tabs-pane/index.js +0 -30
- package/lib/components/tabs-pane/index.js.map +0 -1
- package/lib/components/tag/index.js +0 -55
- package/lib/components/tag/index.js.map +0 -1
- package/lib/components/textarea/index.js +0 -95
- package/lib/components/textarea/index.js.map +0 -1
- package/lib/components/timeline/index.js +0 -53
- package/lib/components/timeline/index.js.map +0 -1
- package/lib/components/toast/img.json +0 -5
- package/lib/components/toast/index.js +0 -117
- package/lib/components/toast/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- 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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import _toString from "lodash/toString";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Input, Text, View } from "@tarojs/components";
|
|
6
|
+
import { pxTransform } from "../../common/utils";
|
|
7
|
+
function addNum(num1, num2) {
|
|
8
|
+
let sq1, sq2;
|
|
9
|
+
try {
|
|
10
|
+
sq1 = _toString(num1).split(".")[1].length;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
sq1 = 0;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
sq2 = _toString(num2).split(".")[1].length;
|
|
16
|
+
} catch (e) {
|
|
17
|
+
sq2 = 0;
|
|
18
|
+
}
|
|
19
|
+
const m = Math.pow(10, Math.max(sq1, sq2));
|
|
20
|
+
return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
|
|
21
|
+
}
|
|
22
|
+
function parseValue(num) {
|
|
23
|
+
if (num === "") return "0";
|
|
24
|
+
const numStr = _toString(num);
|
|
25
|
+
if (numStr.indexOf("0") === 0 && numStr.indexOf(".") === -1) {
|
|
26
|
+
return _toString(parseFloat(num));
|
|
27
|
+
}
|
|
28
|
+
return _toString(num);
|
|
29
|
+
}
|
|
30
|
+
class AtInputNumber extends React.Component {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.handleValue = (value) => {
|
|
34
|
+
const { max = 100, min = 0 } = this.props;
|
|
35
|
+
let resultValue = value === "" ? min : value;
|
|
36
|
+
if (Number(resultValue) > max) {
|
|
37
|
+
resultValue = max;
|
|
38
|
+
this.handleError({
|
|
39
|
+
type: "OVER",
|
|
40
|
+
errorValue: resultValue
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (Number(resultValue) < min) {
|
|
44
|
+
resultValue = min;
|
|
45
|
+
this.handleError({
|
|
46
|
+
type: "LOW",
|
|
47
|
+
errorValue: resultValue
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (resultValue && !Number(resultValue)) {
|
|
51
|
+
resultValue = parseFloat(String(resultValue)) || min;
|
|
52
|
+
this.handleError({
|
|
53
|
+
type: "OVER",
|
|
54
|
+
errorValue: resultValue
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
resultValue = parseValue(String(resultValue));
|
|
58
|
+
return resultValue;
|
|
59
|
+
};
|
|
60
|
+
this.handleInput = (e) => {
|
|
61
|
+
const { value } = e.target;
|
|
62
|
+
const { disabled } = this.props;
|
|
63
|
+
if (disabled) return "";
|
|
64
|
+
const newValue = this.handleValue(value);
|
|
65
|
+
this.props.onChange(Number(newValue), e);
|
|
66
|
+
return newValue;
|
|
67
|
+
};
|
|
68
|
+
this.handleBlur = (event) => this.props.onBlur && this.props.onBlur(event);
|
|
69
|
+
this.handleError = (errorValue) => {
|
|
70
|
+
if (!this.props.onErrorInput) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.props.onErrorInput(errorValue);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
handleClick(clickType, e) {
|
|
77
|
+
const { disabled, value, min = 0, max = 100, step = 1 } = this.props;
|
|
78
|
+
const lowThanMin = clickType === "minus" && Number(value) <= min;
|
|
79
|
+
const overThanMax = clickType === "plus" && Number(value) >= max;
|
|
80
|
+
if (lowThanMin || overThanMax || disabled) {
|
|
81
|
+
const deltaValue2 = clickType === "minus" ? -step : step;
|
|
82
|
+
const errorValue = addNum(Number(value), deltaValue2);
|
|
83
|
+
if (disabled) {
|
|
84
|
+
this.handleError({
|
|
85
|
+
type: "DISABLED",
|
|
86
|
+
errorValue
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
this.handleError({
|
|
90
|
+
type: lowThanMin ? "LOW" : "OVER",
|
|
91
|
+
errorValue
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const deltaValue = clickType === "minus" ? -step : step;
|
|
97
|
+
let newValue = addNum(Number(value), deltaValue);
|
|
98
|
+
newValue = Number(this.handleValue(newValue));
|
|
99
|
+
this.props.onChange(newValue, e);
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
const {
|
|
103
|
+
customStyle,
|
|
104
|
+
className,
|
|
105
|
+
width,
|
|
106
|
+
disabled,
|
|
107
|
+
value,
|
|
108
|
+
type,
|
|
109
|
+
min = 0,
|
|
110
|
+
max = 100,
|
|
111
|
+
size,
|
|
112
|
+
disabledInput
|
|
113
|
+
} = this.props;
|
|
114
|
+
const inputStyle = {
|
|
115
|
+
width: width ? `${pxTransform(width)}` : ""
|
|
116
|
+
};
|
|
117
|
+
const inputValue = typeof value !== "undefined" ? Number(this.handleValue(value)) : null;
|
|
118
|
+
const rootCls = classNames(
|
|
119
|
+
"at-input-number",
|
|
120
|
+
{
|
|
121
|
+
"at-input-number--lg": size === "large"
|
|
122
|
+
},
|
|
123
|
+
className
|
|
124
|
+
);
|
|
125
|
+
const minusBtnCls = classNames("at-input-number__btn", {
|
|
126
|
+
"at-input-number--disabled": inputValue !== null && inputValue <= min || disabled
|
|
127
|
+
});
|
|
128
|
+
const plusBtnCls = classNames("at-input-number__btn", {
|
|
129
|
+
"at-input-number--disabled": inputValue !== null && inputValue >= max || disabled
|
|
130
|
+
});
|
|
131
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: customStyle }, /* @__PURE__ */ React.createElement(
|
|
132
|
+
View,
|
|
133
|
+
{
|
|
134
|
+
className: minusBtnCls,
|
|
135
|
+
onClick: this.handleClick.bind(this, "minus")
|
|
136
|
+
},
|
|
137
|
+
/* @__PURE__ */ React.createElement(Text, { className: "at-icon at-icon-subtract at-input-number__btn-subtract" })
|
|
138
|
+
), /* @__PURE__ */ React.createElement(
|
|
139
|
+
Input,
|
|
140
|
+
{
|
|
141
|
+
className: "at-input-number__input",
|
|
142
|
+
style: inputStyle,
|
|
143
|
+
type,
|
|
144
|
+
value: inputValue !== null ? String(inputValue) : "",
|
|
145
|
+
disabled: disabledInput || disabled,
|
|
146
|
+
onInput: this.handleInput,
|
|
147
|
+
onBlur: this.handleBlur
|
|
148
|
+
}
|
|
149
|
+
), /* @__PURE__ */ React.createElement(
|
|
150
|
+
View,
|
|
151
|
+
{
|
|
152
|
+
className: plusBtnCls,
|
|
153
|
+
onClick: this.handleClick.bind(this, "plus")
|
|
154
|
+
},
|
|
155
|
+
/* @__PURE__ */ React.createElement(Text, { className: "at-icon at-icon-add at-input-number__btn-add" })
|
|
156
|
+
));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
AtInputNumber.defaultProps = {
|
|
160
|
+
customStyle: {},
|
|
161
|
+
className: "",
|
|
162
|
+
disabled: false,
|
|
163
|
+
disabledInput: false,
|
|
164
|
+
type: "number",
|
|
165
|
+
width: 0,
|
|
166
|
+
min: 0,
|
|
167
|
+
max: 100,
|
|
168
|
+
step: 1,
|
|
169
|
+
size: "normal",
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
171
|
+
onChange: () => {
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
AtInputNumber.propTypes = {
|
|
175
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
176
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
177
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
178
|
+
type: PropTypes.oneOf(["number", "digit"]),
|
|
179
|
+
disabled: PropTypes.bool,
|
|
180
|
+
width: PropTypes.number,
|
|
181
|
+
min: PropTypes.number,
|
|
182
|
+
max: PropTypes.number,
|
|
183
|
+
step: PropTypes.number,
|
|
184
|
+
size: PropTypes.oneOf(["normal", "large"]),
|
|
185
|
+
disabledInput: PropTypes.bool,
|
|
186
|
+
onChange: PropTypes.func,
|
|
187
|
+
onBlur: PropTypes.func,
|
|
188
|
+
onErrorInput: PropTypes.func
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
AtInputNumber as default
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/input-number/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport _toString from 'lodash/toString'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Input, Text, View } from '@tarojs/components'\nimport { CommonEvent, ITouchEvent } from '@tarojs/components/types/common'\nimport { AtInputNumberProps, InputError } from '../../../types/input-number'\nimport { pxTransform } from '../../common/utils'\n\n// TODO: Check all types\n\n// 实现两数相加并保留小数点后最短尾数\nfunction addNum(num1: number, num2: number): number {\n let sq1: number, sq2: number\n try {\n sq1 = _toString(num1).split('.')[1].length\n } catch (e) {\n sq1 = 0\n }\n try {\n sq2 = _toString(num2).split('.')[1].length\n } catch (e) {\n sq2 = 0\n }\n const m = Math.pow(10, Math.max(sq1, sq2))\n return (Math.round(num1 * m) + Math.round(num2 * m)) / m\n}\n\n// 格式化数字,处理01变成1,并且不处理1. 这种情况\nfunction parseValue(num: string): string {\n if (num === '') return '0'\n\n const numStr = _toString(num)\n if (numStr.indexOf('0') === 0 && numStr.indexOf('.') === -1) {\n // 处理01变成1,并且不处理1.\n return _toString(parseFloat(num))\n }\n return _toString(num)\n}\n\ntype ExtendEvent = {\n target: {\n value: string | number\n }\n}\n\nexport default class AtInputNumber extends React.Component<AtInputNumberProps> {\n public static defaultProps: AtInputNumberProps\n public static propTypes: InferProps<AtInputNumberProps>\n\n private handleClick(clickType: 'minus' | 'plus', e: CommonEvent): void {\n const { disabled, value, min = 0, max = 100, step = 1 } = this.props\n const lowThanMin = clickType === 'minus' && Number(value) <= min\n const overThanMax = clickType === 'plus' && Number(value) >= max\n if (lowThanMin || overThanMax || disabled) {\n const deltaValue = clickType === 'minus' ? -step : step\n const errorValue = addNum(Number(value), deltaValue)\n if (disabled) {\n this.handleError({\n type: 'DISABLED',\n errorValue\n })\n } else {\n this.handleError({\n type: lowThanMin ? 'LOW' : 'OVER',\n errorValue\n })\n }\n return\n }\n const deltaValue = clickType === 'minus' ? -step : step\n let newValue = addNum(Number(value), deltaValue)\n newValue = Number(this.handleValue(newValue))\n this.props.onChange(newValue, e)\n }\n\n private handleValue = (value: string | number): string => {\n const { max = 100, min = 0 } = this.props\n let resultValue = value === '' ? min : value\n // 此处不能使用 Math.max,会是字符串变数字,并丢失 .\n if (Number(resultValue) > max) {\n resultValue = max\n this.handleError({\n type: 'OVER',\n errorValue: resultValue\n })\n }\n if (Number(resultValue) < min) {\n resultValue = min\n this.handleError({\n type: 'LOW',\n errorValue: resultValue\n })\n }\n if (resultValue && !Number(resultValue)) {\n resultValue = parseFloat(String(resultValue)) || min\n\n this.handleError({\n type: 'OVER',\n errorValue: resultValue\n })\n }\n\n resultValue = parseValue(String(resultValue))\n return resultValue\n }\n\n private handleInput = (e: CommonEvent & ExtendEvent): string => {\n const { value } = e.target\n const { disabled } = this.props\n if (disabled) return ''\n\n const newValue = this.handleValue(value)\n this.props.onChange(Number(newValue), e)\n return newValue\n }\n\n private handleBlur = (event: ITouchEvent): void =>\n this.props.onBlur && this.props.onBlur(event)\n\n private handleError = (errorValue: InputError): void => {\n if (!this.props.onErrorInput) {\n return\n }\n this.props.onErrorInput(errorValue)\n }\n\n public render(): JSX.Element {\n const {\n customStyle,\n className,\n width,\n disabled,\n value,\n type,\n min = 0,\n max = 100,\n size,\n disabledInput\n } = this.props\n\n const inputStyle = {\n width: width ? `${pxTransform(width)}` : ''\n }\n const inputValue =\n typeof value !== 'undefined' ? Number(this.handleValue(value)) : null\n const rootCls = classNames(\n 'at-input-number',\n {\n 'at-input-number--lg': size === 'large'\n },\n className\n )\n const minusBtnCls = classNames('at-input-number__btn', {\n 'at-input-number--disabled':\n (inputValue !== null && inputValue <= min) || disabled\n })\n const plusBtnCls = classNames('at-input-number__btn', {\n 'at-input-number--disabled':\n (inputValue !== null && inputValue >= max) || disabled\n })\n\n return (\n <View className={rootCls} style={customStyle}>\n <View\n className={minusBtnCls}\n onClick={this.handleClick.bind(this, 'minus')}\n >\n <Text className='at-icon at-icon-subtract at-input-number__btn-subtract'></Text>\n </View>\n <Input\n className='at-input-number__input'\n style={inputStyle}\n type={type}\n value={inputValue !== null ? String(inputValue) : ''}\n disabled={disabledInput || disabled}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n />\n <View\n className={plusBtnCls}\n onClick={this.handleClick.bind(this, 'plus')}\n >\n <Text className='at-icon at-icon-add at-input-number__btn-add'></Text>\n </View>\n </View>\n )\n }\n}\n\nAtInputNumber.defaultProps = {\n customStyle: {},\n className: '',\n disabled: false,\n disabledInput: false,\n type: 'number',\n width: 0,\n min: 0,\n max: 100,\n step: 1,\n size: 'normal',\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange: (): void => {}\n}\n\nAtInputNumber.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n type: PropTypes.oneOf(['number', 'digit']),\n disabled: PropTypes.bool,\n width: PropTypes.number,\n min: PropTypes.number,\n max: PropTypes.number,\n step: PropTypes.number,\n size: PropTypes.oneOf(['normal', 'large']),\n disabledInput: PropTypes.bool,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n onErrorInput: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,OAAO,MAAM,YAAY;AAGlC,SAAS,mBAAmB;AAK5B,SAAS,OAAO,MAAc,MAAsB;AAClD,MAAI,KAAa;AACjB,MAAI;AACF,UAAM,UAAU,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE;AAAA,EACtC,SAAS,GAAG;AACV,UAAM;AAAA,EACR;AACA,MAAI;AACF,UAAM,UAAU,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE;AAAA,EACtC,SAAS,GAAG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aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC/D,MAAM,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC;AAAA,EACzC,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU;AAAA,EACjB,KAAK,UAAU;AAAA,EACf,KAAK,UAAU;AAAA,EACf,MAAM,UAAU;AAAA,EAChB,MAAM,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC;AAAA,EACzC,eAAe,UAAU;AAAA,EACzB,UAAU,UAAU;AAAA,EACpB,QAAQ,UAAU;AAAA,EAClB,cAAc,UAAU;AAC1B;","names":["deltaValue"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtListProps } from '../../../types/list';
|
|
4
|
+
export default class AtList extends React.Component<AtListProps> {
|
|
5
|
+
static defaultProps: AtListProps;
|
|
6
|
+
static propTypes: InferProps<AtListProps>;
|
|
7
|
+
render(): JSX.Element;
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
class AtList extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const rootClass = classNames(
|
|
8
|
+
"at-list",
|
|
9
|
+
{
|
|
10
|
+
"at-list--no-border": !this.props.hasBorder
|
|
11
|
+
},
|
|
12
|
+
this.props.className
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ React.createElement(View, { className: rootClass }, this.props.children);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
AtList.defaultProps = {
|
|
18
|
+
hasBorder: true
|
|
19
|
+
};
|
|
20
|
+
AtList.propTypes = {
|
|
21
|
+
hasBorder: PropTypes.bool
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
AtList as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/list/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtListProps } from '../../../types/list'\n\nexport default class AtList extends React.Component<AtListProps> {\n public static defaultProps: AtListProps\n public static propTypes: InferProps<AtListProps>\n\n public render(): JSX.Element {\n const rootClass = classNames(\n 'at-list',\n {\n 'at-list--no-border': !this.props.hasBorder\n },\n this.props.className\n )\n\n return <View className={rootClass}>{this.props.children}</View>\n }\n}\n\nAtList.defaultProps = {\n hasBorder: true\n}\n\nAtList.propTypes = {\n hasBorder: PropTypes.bool\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAGrB,MAAO,eAA6B,MAAM,UAAuB;AAAA,EAIxD,SAAsB;AAC3B,UAAM,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,QACE,sBAAsB,CAAC,KAAK,MAAM;AAAA,MACpC;AAAA,MACA,KAAK,MAAM;AAAA,IACb;AAEA,WAAO,oCAAC,QAAK,WAAW,aAAY,KAAK,MAAM,QAAS;AAAA,EAC1D;AACF;AAEA,OAAO,eAAe;AAAA,EACpB,WAAW;AACb;AAEA,OAAO,YAAY;AAAA,EACjB,WAAW,UAAU;AACvB;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InferProps } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AtListItemProps } from '../../../../types/list';
|
|
4
|
+
export default class AtListItem extends React.Component<AtListItemProps> {
|
|
5
|
+
static defaultProps: AtListItemProps;
|
|
6
|
+
static propTypes: InferProps<AtListItemProps>;
|
|
7
|
+
private handleClick;
|
|
8
|
+
private handleSwitchClick;
|
|
9
|
+
private handleSwitchChange;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
}
|
|
112
|
+
}
|
|
113
|
+
AtListItem.defaultProps = {
|
|
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: "" }
|
|
125
|
+
};
|
|
126
|
+
AtListItem.propTypes = {
|
|
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
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,OAAO,QAAQ,MAAM,YAAY;AAG1C,SAAS,kBAAkB;AAE3B,MAAO,mBAAiC,MAAM,UAA2B;AAAA,EAAzE;AAAA;AAIE,SAAQ,cAAc,CAAC,UAA6B;AA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AAA,EACX,YAAY;AAAA,EACZ,UAAU,EAAE,OAAO,GAAG;AACxB;AAEA,WAAW,YAAY;AAAA,EACrB,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC;AAAA,EAC/D,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC;AAAA,EAChE,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC;AAAA,EACpE,YAAY,UAAU;AAAA,EACtB,gBAAgB,UAAU;AAAA,EAC1B,OAAO,UAAU,MAAM,CAAC,MAAM,QAAQ,OAAO,CAAC;AAAA,EAC9C,UAAU,UAAU,MAAM;AAAA,IACxB,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU;AAAA,IACjB,OAAO,UAAU;AAAA,IACjB,aAAa,UAAU;AAAA,IACvB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,IACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EACpE,CAAC;AACH;","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
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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);
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ React.createElement(
|
|
39
|
+
View,
|
|
40
|
+
{
|
|
41
|
+
className: classNames("at-load-more", className),
|
|
42
|
+
style: customStyle
|
|
43
|
+
},
|
|
44
|
+
component
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
AtLoadMore.defaultProps = {
|
|
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"
|
|
57
|
+
};
|
|
58
|
+
AtLoadMore.propTypes = {
|
|
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
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
20
|
+
}
|
|
21
|
+
AtLoading.defaultProps = {
|
|
22
|
+
size: 0,
|
|
23
|
+
color: ""
|
|
24
|
+
};
|
|
25
|
+
AtLoading.propTypes = {
|
|
26
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
27
|
+
color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
AtLoading as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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
|
+
}
|