taro-ui 3.3.2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +85 -0
- package/{lib → dist}/common/utils.d.ts +2 -1
- package/{lib → dist}/common/utils.js +3 -0
- package/{lib → dist}/common/utils.js.map +1 -1
- package/dist/components/accordion/index.d.ts +17 -0
- package/dist/components/accordion/index.js +101 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/action-sheet/body/index.d.ts +3 -0
- package/dist/components/action-sheet/body/index.js +15 -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 +25 -0
- package/dist/components/action-sheet/footer/index.js.map +1 -0
- package/dist/components/action-sheet/header/index.d.ts +3 -0
- package/dist/components/action-sheet/header/index.js +15 -0
- package/dist/components/action-sheet/header/index.js.map +1 -0
- package/dist/components/action-sheet/index.d.ts +13 -0
- package/dist/components/action-sheet/index.js +72 -0
- package/dist/components/action-sheet/index.js.map +1 -0
- package/dist/components/activity-indicator/index.d.ts +14 -0
- package/dist/components/activity-indicator/index.js +36 -0
- package/dist/components/activity-indicator/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +15 -0
- package/dist/components/avatar/index.js +61 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +13 -0
- package/dist/components/badge/index.js +35 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/button/index.d.ts +30 -0
- package/dist/components/button/index.js +162 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/calendar/body/index.d.ts +3 -0
- package/dist/components/calendar/body/index.js +269 -0
- package/dist/components/calendar/body/index.js.map +1 -0
- package/dist/components/calendar/controller/index.d.ts +3 -0
- package/dist/components/calendar/controller/index.js +55 -0
- package/dist/components/calendar/controller/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.js +262 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/{lib → dist}/components/calendar/ui/date-list/index.d.ts +2 -6
- package/dist/components/calendar/ui/date-list/index.js +49 -0
- package/dist/components/calendar/ui/date-list/index.js.map +1 -0
- package/dist/components/calendar/ui/day-list/index.d.ts +2 -0
- package/dist/components/calendar/ui/day-list/index.js +12 -0
- package/dist/components/calendar/ui/day-list/index.js.map +1 -0
- package/dist/components/card/index.d.ts +17 -0
- package/dist/components/card/index.js +79 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +13 -0
- package/dist/components/checkbox/index.js +54 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/config-provider/context.d.ts +6 -0
- package/dist/components/config-provider/context.js +13 -0
- package/dist/components/config-provider/context.js.map +1 -0
- package/dist/components/config-provider/index.d.ts +7 -0
- package/dist/components/config-provider/index.js +15 -0
- package/dist/components/config-provider/index.js.map +1 -0
- package/dist/components/countdown/index.d.ts +20 -0
- package/dist/components/countdown/index.js +217 -0
- package/dist/components/countdown/index.js.map +1 -0
- package/dist/components/countdown/item/index.d.ts +10 -0
- package/dist/components/countdown/item/index.js +21 -0
- package/dist/components/countdown/item/index.js.map +1 -0
- package/dist/components/curtain/index.d.ts +13 -0
- package/dist/components/curtain/index.js +53 -0
- package/dist/components/curtain/index.js.map +1 -0
- package/dist/components/divider/index.d.ts +15 -0
- package/dist/components/divider/index.js +48 -0
- package/dist/components/divider/index.js.map +1 -0
- package/dist/components/drawer/index.d.ts +14 -0
- package/dist/components/drawer/index.js +121 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/fab/index.d.ts +10 -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 +13 -0
- package/{lib → dist}/components/flex/index.js +17 -18
- package/dist/components/flex/index.js.map +1 -0
- package/dist/components/flex/item/index.d.ts +13 -0
- package/dist/components/flex/item/index.js +33 -0
- package/dist/components/flex/item/index.js.map +1 -0
- package/dist/components/float-layout/index.d.ts +21 -0
- package/dist/components/float-layout/index.js +88 -0
- package/dist/components/float-layout/index.js.map +1 -0
- package/dist/components/form/index.d.ts +13 -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 +24 -0
- package/dist/components/grid/index.js +96 -0
- package/dist/components/grid/index.js.map +1 -0
- package/dist/components/icon/index.d.ts +15 -0
- package/dist/components/icon/index.js +44 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/components/image-picker/index.d.ts +21 -0
- package/dist/components/image-picker/index.js +145 -0
- package/dist/components/image-picker/index.js.map +1 -0
- package/dist/components/indexes/index.d.ts +17 -0
- package/dist/components/indexes/index.js +261 -0
- package/dist/components/indexes/index.js.map +1 -0
- package/dist/components/input/index.d.ts +39 -0
- package/dist/components/input/index.js +223 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input-number/index.d.ts +22 -0
- package/dist/components/input-number/index.js +174 -0
- package/dist/components/input-number/index.js.map +1 -0
- package/dist/components/list/index.d.ts +9 -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 +29 -0
- package/dist/components/list/item/index.js +124 -0
- package/dist/components/list/item/index.js.map +1 -0
- package/dist/components/load-more/index.d.ts +17 -0
- package/dist/components/load-more/index.js +51 -0
- package/dist/components/load-more/index.js.map +1 -0
- package/dist/components/loading/index.d.ts +13 -0
- package/dist/components/loading/index.js +26 -0
- package/dist/components/loading/index.js.map +1 -0
- package/dist/components/message/index.d.ts +10 -0
- package/dist/components/message/index.js +64 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/modal/action/index.d.ts +9 -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 +3 -0
- package/dist/components/modal/content/index.js +15 -0
- package/dist/components/modal/content/index.js.map +1 -0
- package/dist/components/modal/header/index.d.ts +3 -0
- package/dist/components/modal/header/index.js +15 -0
- package/dist/components/modal/header/index.js.map +1 -0
- package/dist/components/modal/index.d.ts +17 -0
- package/dist/components/modal/index.js +92 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/nav-bar/index.d.ts +22 -0
- package/dist/components/nav-bar/index.js +201 -0
- package/dist/components/nav-bar/index.js.map +1 -0
- package/dist/components/noticebar/index.d.ts +18 -0
- package/dist/components/noticebar/index.js +173 -0
- package/dist/components/noticebar/index.js.map +1 -0
- package/dist/components/pagination/index.d.ts +14 -0
- package/dist/components/pagination/index.js +90 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/progress/index.d.ts +13 -0
- package/dist/components/progress/index.js +56 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/radio/index.d.ts +13 -0
- package/dist/components/radio/index.js +50 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/range/index.d.ts +20 -0
- package/dist/components/range/index.js +200 -0
- package/dist/components/range/index.js.map +1 -0
- package/dist/components/rate/index.d.ts +15 -0
- package/dist/components/rate/index.js +67 -0
- package/dist/components/rate/index.js.map +1 -0
- package/dist/components/search-bar/index.d.ts +24 -0
- package/dist/components/search-bar/index.js +150 -0
- package/dist/components/search-bar/index.js.map +1 -0
- package/dist/components/segmented-control/index.d.ts +16 -0
- package/dist/components/segmented-control/index.js +70 -0
- package/dist/components/segmented-control/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +22 -0
- package/dist/components/slider/index.js +91 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/steps/index.d.ts +13 -0
- package/dist/components/steps/index.js +62 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/swipe-action/index.d.ts +14 -0
- package/dist/components/swipe-action/index.js +223 -0
- package/dist/components/swipe-action/index.js.map +1 -0
- package/dist/components/swipe-action/options/index.d.ts +3 -0
- package/dist/components/swipe-action/options/index.js +25 -0
- package/dist/components/swipe-action/options/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +16 -0
- package/dist/components/switch/index.js +54 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/tab-bar/index.d.ts +19 -0
- package/dist/components/tab-bar/index.js +143 -0
- package/dist/components/tab-bar/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +230 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs-pane/index.d.ts +13 -0
- package/dist/components/tabs-pane/index.js +41 -0
- package/dist/components/tabs-pane/index.js.map +1 -0
- package/dist/components/tag/index.d.ts +16 -0
- package/dist/components/tag/index.js +66 -0
- package/dist/components/tag/index.js.map +1 -0
- package/dist/components/textarea/index.d.ts +31 -0
- package/dist/components/textarea/index.js +121 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/timeline/index.d.ts +11 -0
- package/dist/components/timeline/index.js +70 -0
- package/dist/components/timeline/index.js.map +1 -0
- package/dist/components/toast/img.json +5 -0
- package/dist/components/toast/index.d.ts +17 -0
- package/dist/components/toast/index.js +115 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/hooks/useComponentLocale.d.ts +2 -0
- package/dist/hooks/useComponentLocale.js +12 -0
- package/dist/hooks/useComponentLocale.js.map +1 -0
- package/{lib → dist}/index.d.ts +3 -0
- package/dist/index.esm.js +5856 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +5937 -0
- package/dist/index.js.map +1 -0
- package/dist/locale/en_US.d.ts +3 -0
- package/dist/locale/en_US.js +34 -0
- package/dist/locale/en_US.js.map +1 -0
- package/dist/locale/index.d.ts +4 -0
- package/dist/locale/index.js +10 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/locale/types.d.ts +34 -0
- package/dist/locale/types.js +1 -0
- package/dist/locale/types.js.map +1 -0
- package/dist/locale/zh_CN.d.ts +3 -0
- package/dist/locale/zh_CN.js +34 -0
- package/dist/locale/zh_CN.js.map +1 -0
- package/{lib → dist}/style/components/avatar.scss +1 -1
- package/{lib → dist}/style/components/badge.scss +7 -2
- package/{lib → dist}/style/components/calendar.scss +1 -1
- package/{lib → dist}/style/components/countdown.scss +2 -1
- package/{lib → dist}/style/components/flex.scss +1 -1
- package/{lib → dist}/style/components/grid.scss +2 -2
- package/{lib → dist}/style/components/icon.scss +302 -101
- package/{lib → dist}/style/components/input.scss +2 -2
- package/{lib → dist}/style/components/progress.scss +1 -1
- package/{lib → dist}/style/components/search-bar.scss +1 -1
- package/{lib → dist}/style/components/steps.scss +2 -2
- package/{lib → dist}/style/components/tabs.scss +1 -1
- package/{lib → dist}/style/components/tag.scss +1 -1
- package/{lib → dist}/style/components/timeline.scss +1 -1
- package/{lib → dist}/style/components/toast.scss +7 -3
- package/{lib → dist}/style/index.css +176 -176
- package/dist/style/index.css.map +1 -0
- package/{lib → dist}/style/mixins/libs/hairline.scss +4 -19
- package/{lib → dist}/style/mixins/libs/shade.scss +3 -6
- package/{lib → dist}/style/mixins/libs/tint.scss +4 -7
- package/{lib → dist}/style/themes/purple.scss +15 -15
- package/{lib → dist}/style/themes/red.scss +16 -13
- package/{lib → dist}/style/variables/default.scss +69 -73
- package/package.json +45 -12
- package/rn/components/accordion/index.tsx +2 -9
- package/rn/components/action-sheet/body/index.tsx +1 -3
- package/rn/components/action-sheet/body/item/index.tsx +1 -3
- package/rn/components/action-sheet/footer/index.tsx +1 -3
- package/rn/components/action-sheet/header/index.tsx +1 -3
- package/rn/components/activity-indicator/index.tsx +1 -3
- package/rn/components/avatar/index.tsx +5 -5
- package/rn/components/calendar/controller/index.tsx +2 -7
- package/rn/components/card/index.tsx +4 -4
- package/rn/components/countdown/index.scss +5 -4
- package/rn/components/countdown/item/index.tsx +1 -3
- package/rn/components/curtain/index.tsx +5 -5
- package/rn/components/flex/index.scss +2 -2
- package/rn/components/flex/item/index.scss +2 -2
- package/rn/components/grid/index.tsx +15 -15
- package/rn/components/icon/index.tsx +4 -4
- package/rn/components/image-picker/index.tsx +7 -7
- package/rn/components/pagination/index.tsx +7 -7
- package/rn/components/progress/index.tsx +5 -5
- package/rn/components/radio/index.tsx +7 -7
- package/rn/components/rate/index.tsx +4 -4
- package/rn/components/segmented-control/index.tsx +8 -8
- package/rn/components/slider/index.tsx +9 -9
- package/rn/components/steps/index.tsx +8 -8
- package/rn/components/swipe-action/options/index.tsx +1 -3
- package/rn/components/switch/index.tsx +2 -9
- package/rn/components/toast/img.json +3 -6
- package/rn/components/toast/index.tsx +8 -8
- package/rn/style/components/accordion.scss +1 -1
- package/rn/style/components/action-sheet.scss +1 -1
- package/rn/style/components/avatar.scss +1 -1
- package/rn/style/components/badge.scss +8 -3
- package/rn/style/components/button.scss +1 -1
- package/rn/style/components/calendar.scss +1 -1
- package/rn/style/components/checkbox.scss +1 -1
- package/rn/style/components/curtain.scss +1 -1
- package/rn/style/components/fab.scss +1 -4
- package/rn/style/components/flex.scss +1 -1
- package/rn/style/components/grid.scss +2 -6
- package/rn/style/components/icon.scss +302 -101
- package/rn/style/components/index.scss +41 -41
- package/rn/style/components/input.scss +1 -1
- package/rn/style/components/list.scss +2 -4
- package/rn/style/components/loading.scss +4 -4
- package/rn/style/components/message.scss +1 -1
- package/rn/style/components/modal.scss +0 -2
- package/rn/style/components/nav-bar.scss +3 -3
- package/rn/style/components/noticebar.scss +0 -4
- package/rn/style/components/progress.scss +1 -1
- package/rn/style/components/radio.scss +2 -2
- package/rn/style/components/range.scss +1 -1
- package/rn/style/components/search-bar.scss +1 -1
- package/rn/style/components/segmented-control.scss +4 -1
- package/rn/style/components/slider.scss +0 -1
- package/rn/style/components/steps.scss +3 -3
- package/rn/style/components/switch.scss +0 -1
- package/rn/style/components/tabs.scss +2 -2
- package/rn/style/components/tag.scss +1 -1
- package/rn/style/components/timeline.scss +0 -2
- package/rn/style/components/toast.scss +5 -2
- package/rn/style/index.scss +1 -1
- package/rn/style/mixins/libs/hairline.scss +4 -22
- package/rn/style/mixins/libs/shade.scss +1 -4
- package/rn/style/mixins/libs/tint.scss +2 -5
- package/rn/style/themes/purple.scss +15 -15
- package/rn/style/themes/red.scss +16 -13
- package/rn/style/variables/default.scss +69 -73
- package/lib/components/accordion/index.d.ts +0 -14
- package/lib/components/accordion/index.js +0 -121
- package/lib/components/accordion/index.js.map +0 -1
- package/lib/components/action-sheet/body/index.d.ts +0 -5
- package/lib/components/action-sheet/body/index.js +0 -13
- package/lib/components/action-sheet/body/index.js.map +0 -1
- package/lib/components/action-sheet/body/item/index.d.ts +0 -9
- package/lib/components/action-sheet/body/item/index.js +0 -25
- package/lib/components/action-sheet/body/item/index.js.map +0 -1
- package/lib/components/action-sheet/footer/index.d.ts +0 -9
- package/lib/components/action-sheet/footer/index.js +0 -28
- package/lib/components/action-sheet/footer/index.js.map +0 -1
- package/lib/components/action-sheet/header/index.d.ts +0 -5
- package/lib/components/action-sheet/header/index.js +0 -16
- package/lib/components/action-sheet/header/index.js.map +0 -1
- package/lib/components/action-sheet/index.d.ts +0 -14
- package/lib/components/action-sheet/index.js +0 -76
- package/lib/components/action-sheet/index.js.map +0 -1
- package/lib/components/activity-indicator/index.d.ts +0 -8
- package/lib/components/activity-indicator/index.js +0 -39
- package/lib/components/activity-indicator/index.js.map +0 -1
- package/lib/components/avatar/index.d.ts +0 -9
- package/lib/components/avatar/index.js +0 -67
- package/lib/components/avatar/index.js.map +0 -1
- package/lib/components/badge/index.d.ts +0 -10
- package/lib/components/badge/index.js +0 -51
- package/lib/components/badge/index.js.map +0 -1
- package/lib/components/button/index.d.ts +0 -15
- package/lib/components/button/index.js +0 -177
- package/lib/components/button/index.js.map +0 -1
- package/lib/components/calendar/body/index.d.ts +0 -26
- package/lib/components/calendar/body/index.js +0 -289
- package/lib/components/calendar/body/index.js.map +0 -1
- package/lib/components/calendar/controller/index.d.ts +0 -5
- package/lib/components/calendar/controller/index.js +0 -51
- package/lib/components/calendar/controller/index.js.map +0 -1
- package/lib/components/calendar/index.d.ts +0 -20
- package/lib/components/calendar/index.js +0 -244
- package/lib/components/calendar/index.js.map +0 -1
- package/lib/components/calendar/ui/date-list/index.js +0 -54
- package/lib/components/calendar/ui/date-list/index.js.map +0 -1
- package/lib/components/calendar/ui/day-list/index.d.ts +0 -4
- package/lib/components/calendar/ui/day-list/index.js +0 -11
- package/lib/components/calendar/ui/day-list/index.js.map +0 -1
- package/lib/components/card/index.d.ts +0 -9
- package/lib/components/card/index.js +0 -80
- package/lib/components/card/index.js.map +0 -1
- package/lib/components/checkbox/index.d.ts +0 -9
- package/lib/components/checkbox/index.js +0 -59
- package/lib/components/checkbox/index.js.map +0 -1
- package/lib/components/countdown/index.d.ts +0 -20
- package/lib/components/countdown/index.js +0 -152
- package/lib/components/countdown/index.js.map +0 -1
- package/lib/components/countdown/item/index.d.ts +0 -9
- package/lib/components/countdown/item/index.js +0 -24
- package/lib/components/countdown/item/index.js.map +0 -1
- package/lib/components/curtain/index.d.ts +0 -10
- package/lib/components/curtain/index.js +0 -62
- package/lib/components/curtain/index.js.map +0 -1
- package/lib/components/divider/index.d.ts +0 -8
- package/lib/components/divider/index.js +0 -57
- package/lib/components/divider/index.js.map +0 -1
- package/lib/components/drawer/index.d.ts +0 -16
- package/lib/components/drawer/index.js +0 -114
- package/lib/components/drawer/index.js.map +0 -1
- package/lib/components/fab/index.d.ts +0 -9
- package/lib/components/fab/index.js +0 -29
- package/lib/components/fab/index.js.map +0 -1
- package/lib/components/flex/index.d.ts +0 -7
- package/lib/components/flex/index.js.map +0 -1
- package/lib/components/flex/item/index.d.ts +0 -7
- package/lib/components/flex/item/index.js +0 -34
- package/lib/components/flex/item/index.js.map +0 -1
- package/lib/components/float-layout/index.d.ts +0 -13
- package/lib/components/float-layout/index.js +0 -104
- package/lib/components/float-layout/index.js.map +0 -1
- package/lib/components/form/index.d.ts +0 -10
- package/lib/components/form/index.js +0 -43
- package/lib/components/form/index.js.map +0 -1
- package/lib/components/grid/index.d.ts +0 -9
- package/lib/components/grid/index.js +0 -101
- package/lib/components/grid/index.js.map +0 -1
- package/lib/components/icon/index.d.ts +0 -9
- package/lib/components/icon/index.js +0 -54
- package/lib/components/icon/index.js.map +0 -1
- package/lib/components/image-picker/index.d.ts +0 -11
- package/lib/components/image-picker/index.js +0 -164
- package/lib/components/image-picker/index.js.map +0 -1
- package/lib/components/indexes/index.d.ts +0 -29
- package/lib/components/indexes/index.js +0 -272
- package/lib/components/indexes/index.js.map +0 -1
- package/lib/components/input/index.d.ts +0 -17
- package/lib/components/input/index.js +0 -232
- package/lib/components/input/index.js.map +0 -1
- package/lib/components/input-number/index.d.ts +0 -13
- package/lib/components/input-number/index.js +0 -193
- package/lib/components/input-number/index.js.map +0 -1
- package/lib/components/list/index.d.ts +0 -8
- package/lib/components/list/index.js +0 -26
- package/lib/components/list/index.js.map +0 -1
- package/lib/components/list/item/index.d.ts +0 -11
- package/lib/components/list/item/index.js +0 -152
- package/lib/components/list/item/index.js.map +0 -1
- package/lib/components/load-more/index.d.ts +0 -9
- package/lib/components/load-more/index.js +0 -72
- package/lib/components/load-more/index.js.map +0 -1
- package/lib/components/loading/index.d.ts +0 -12
- package/lib/components/loading/index.js +0 -32
- package/lib/components/loading/index.js.map +0 -1
- package/lib/components/message/index.d.ts +0 -15
- package/lib/components/message/index.js +0 -78
- package/lib/components/message/index.js.map +0 -1
- package/lib/components/modal/action/index.d.ts +0 -8
- package/lib/components/modal/action/index.js +0 -26
- package/lib/components/modal/action/index.js.map +0 -1
- package/lib/components/modal/content/index.d.ts +0 -5
- package/lib/components/modal/content/index.js +0 -13
- package/lib/components/modal/content/index.js.map +0 -1
- package/lib/components/modal/header/index.d.ts +0 -5
- package/lib/components/modal/header/index.js +0 -13
- package/lib/components/modal/header/index.js.map +0 -1
- package/lib/components/modal/index.d.ts +0 -15
- package/lib/components/modal/index.js +0 -106
- package/lib/components/modal/index.js.map +0 -1
- package/lib/components/nav-bar/index.d.ts +0 -12
- package/lib/components/nav-bar/index.js +0 -217
- package/lib/components/nav-bar/index.js.map +0 -1
- package/lib/components/noticebar/index.d.ts +0 -16
- package/lib/components/noticebar/index.js +0 -186
- package/lib/components/noticebar/index.js.map +0 -1
- package/lib/components/pagination/index.d.ts +0 -12
- package/lib/components/pagination/index.js +0 -146
- package/lib/components/pagination/index.js.map +0 -1
- package/lib/components/progress/index.d.ts +0 -7
- package/lib/components/progress/index.js +0 -53
- package/lib/components/progress/index.js.map +0 -1
- package/lib/components/radio/index.d.ts +0 -9
- package/lib/components/radio/index.js +0 -54
- package/lib/components/radio/index.js.map +0 -1
- package/lib/components/range/index.d.ts +0 -22
- package/lib/components/range/index.js +0 -207
- package/lib/components/range/index.js.map +0 -1
- package/lib/components/rate/index.d.ts +0 -9
- package/lib/components/rate/index.js +0 -82
- package/lib/components/rate/index.js.map +0 -1
- package/lib/components/search-bar/index.d.ts +0 -16
- package/lib/components/search-bar/index.js +0 -176
- package/lib/components/search-bar/index.js.map +0 -1
- package/lib/components/segmented-control/index.d.ts +0 -9
- package/lib/components/segmented-control/index.js +0 -84
- package/lib/components/segmented-control/index.js.map +0 -1
- package/lib/components/slider/index.d.ts +0 -13
- package/lib/components/slider/index.js +0 -115
- package/lib/components/slider/index.js.map +0 -1
- package/lib/components/steps/index.d.ts +0 -9
- package/lib/components/steps/index.js +0 -67
- package/lib/components/steps/index.js.map +0 -1
- package/lib/components/swipe-action/index.d.ts +0 -27
- package/lib/components/swipe-action/index.js +0 -220
- package/lib/components/swipe-action/index.js.map +0 -1
- package/lib/components/swipe-action/options/index.d.ts +0 -5
- package/lib/components/swipe-action/options/index.js +0 -24
- package/lib/components/swipe-action/options/index.js.map +0 -1
- package/lib/components/switch/index.d.ts +0 -9
- package/lib/components/switch/index.js +0 -59
- package/lib/components/switch/index.js.map +0 -1
- package/lib/components/tab-bar/index.d.ts +0 -9
- package/lib/components/tab-bar/index.js +0 -170
- package/lib/components/tab-bar/index.js.map +0 -1
- package/lib/components/tabs/index.d.ts +0 -24
- package/lib/components/tabs/index.js +0 -219
- package/lib/components/tabs/index.js.map +0 -1
- package/lib/components/tabs-pane/index.d.ts +0 -8
- package/lib/components/tabs-pane/index.js +0 -43
- package/lib/components/tabs-pane/index.js.map +0 -1
- package/lib/components/tag/index.d.ts +0 -9
- package/lib/components/tag/index.js +0 -75
- package/lib/components/tag/index.js.map +0 -1
- package/lib/components/textarea/index.d.ts +0 -13
- package/lib/components/textarea/index.js +0 -141
- package/lib/components/textarea/index.js.map +0 -1
- package/lib/components/timeline/index.d.ts +0 -8
- package/lib/components/timeline/index.js +0 -76
- package/lib/components/timeline/index.js.map +0 -1
- package/lib/components/toast/img.json +0 -8
- package/lib/components/toast/index.d.ts +0 -16
- package/lib/components/toast/index.js +0 -124
- package/lib/components/toast/index.js.map +0 -1
- package/lib/index.js +0 -109
- package/lib/index.js.map +0 -1
- package/lib/style/index.css.map +0 -1
- /package/{lib → dist}/common/component.d.ts +0 -0
- /package/{lib → dist}/common/component.js +0 -0
- /package/{lib → dist}/common/component.js.map +0 -0
- /package/{lib → dist}/components/calendar/common/constant.d.ts +0 -0
- /package/{lib → dist}/components/calendar/common/constant.js +0 -0
- /package/{lib → dist}/components/calendar/common/constant.js.map +0 -0
- /package/{lib → dist}/components/calendar/common/helper.d.ts +0 -0
- /package/{lib → dist}/components/calendar/common/helper.js +0 -0
- /package/{lib → dist}/components/calendar/common/helper.js.map +0 -0
- /package/{lib → dist}/components/calendar/common/plugins.d.ts +0 -0
- /package/{lib → dist}/components/calendar/common/plugins.js +0 -0
- /package/{lib → dist}/components/calendar/common/plugins.js.map +0 -0
- /package/{lib → dist}/style/components/accordion.scss +0 -0
- /package/{lib → dist}/style/components/action-sheet.scss +0 -0
- /package/{lib → dist}/style/components/activity-indicator.scss +0 -0
- /package/{lib → dist}/style/components/article.scss +0 -0
- /package/{lib → dist}/style/components/button.scss +0 -0
- /package/{lib → dist}/style/components/card.scss +0 -0
- /package/{lib → dist}/style/components/checkbox.scss +0 -0
- /package/{lib → dist}/style/components/curtain.scss +0 -0
- /package/{lib → dist}/style/components/divider.scss +0 -0
- /package/{lib → dist}/style/components/drawer.scss +0 -0
- /package/{lib → dist}/style/components/fab.scss +0 -0
- /package/{lib → dist}/style/components/float-layout.scss +0 -0
- /package/{lib → dist}/style/components/form.scss +0 -0
- /package/{lib → dist}/style/components/image-picker.scss +0 -0
- /package/{lib → dist}/style/components/index.scss +0 -0
- /package/{lib → dist}/style/components/indexes.scss +0 -0
- /package/{lib → dist}/style/components/input-number.scss +0 -0
- /package/{lib → dist}/style/components/list.scss +0 -0
- /package/{lib → dist}/style/components/load-more.scss +0 -0
- /package/{lib → dist}/style/components/loading.scss +0 -0
- /package/{lib → dist}/style/components/message.scss +0 -0
- /package/{lib → dist}/style/components/modal.scss +0 -0
- /package/{lib → dist}/style/components/nav-bar.scss +0 -0
- /package/{lib → dist}/style/components/noticebar.scss +0 -0
- /package/{lib → dist}/style/components/pagination.scss +0 -0
- /package/{lib → dist}/style/components/radio.scss +0 -0
- /package/{lib → dist}/style/components/range.scss +0 -0
- /package/{lib → dist}/style/components/rate.scss +0 -0
- /package/{lib → dist}/style/components/segmented-control.scss +0 -0
- /package/{lib → dist}/style/components/slider.scss +0 -0
- /package/{lib → dist}/style/components/swipe-action.scss +0 -0
- /package/{lib → dist}/style/components/switch.scss +0 -0
- /package/{lib → dist}/style/components/tab-bar.scss +0 -0
- /package/{lib → dist}/style/components/textarea.scss +0 -0
- /package/{lib → dist}/style/index.scss +0 -0
- /package/{lib → dist}/style/mixins/index.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/absolute-center.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/active.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/alignhack.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/border.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/clearfix.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/disabled.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/flex.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/line.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/overlay.scss +0 -0
- /package/{lib → dist}/style/mixins/libs/placeholder.scss +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import { defaultLocale } from "../../locale";
|
|
3
|
+
const ConfigContext = createContext({
|
|
4
|
+
locale: defaultLocale
|
|
5
|
+
});
|
|
6
|
+
function useConfig() {
|
|
7
|
+
return useContext(ConfigContext);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
ConfigContext,
|
|
11
|
+
useConfig
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/config-provider/context.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport { defaultLocale } from '../../locale'\nimport { Locale } from '../../locale/types'\n\nexport interface ConfigContextValue {\n locale: Locale\n}\n\nexport const ConfigContext = createContext<ConfigContextValue>({\n locale: defaultLocale\n})\n\nexport function useConfig() {\n return useContext(ConfigContext)\n}\n"],"mappings":"AAAA,SAAS,eAAe,kBAAkB;AAC1C,SAAS,qBAAqB;AAOvB,MAAM,gBAAgB,cAAkC;AAAA,EAC7D,QAAQ;AACV,CAAC;AAEM,SAAS,YAAY;AAC1B,SAAO,WAAW,aAAa;AACjC;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PartialLocale } from '../../locale/types';
|
|
3
|
+
export interface ConfigProviderProps {
|
|
4
|
+
locale?: PartialLocale;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export default function ConfigProvider({ locale, children }: ConfigProviderProps): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import merge from "lodash/merge";
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { defaultLocale } from "../../locale";
|
|
4
|
+
import { ConfigContext } from "./context";
|
|
5
|
+
function ConfigProvider({
|
|
6
|
+
locale,
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
const mergedLocale = useMemo(() => merge({}, defaultLocale, locale), [locale]);
|
|
10
|
+
return /* @__PURE__ */ React.createElement(ConfigContext.Provider, { value: { locale: mergedLocale } }, children);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
ConfigProvider as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/config-provider/index.tsx"],"sourcesContent":["import merge from 'lodash/merge'\nimport React, { useMemo } from 'react'\nimport { defaultLocale } from '../../locale'\nimport { PartialLocale } from '../../locale/types'\nimport { ConfigContext } from './context'\n\nexport interface ConfigProviderProps {\n locale?: PartialLocale\n children?: React.ReactNode\n}\n\nexport default function ConfigProvider({\n locale,\n children\n}: ConfigProviderProps): JSX.Element {\n const mergedLocale = useMemo(() => merge({}, defaultLocale, locale), [locale])\n\n return (\n <ConfigContext.Provider value={{ locale: mergedLocale }}>\n {children}\n </ConfigContext.Provider>\n )\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,OAAO,SAAS,eAAe;AAC/B,SAAS,qBAAqB;AAE9B,SAAS,qBAAqB;AAOf,SAAR,eAAgC;AAAA,EACrC;AAAA,EACA;AACF,GAAqC;AACnC,QAAM,eAAe,QAAQ,MAAM,MAAM,CAAC,GAAG,eAAe,MAAM,GAAG,CAAC,MAAM,CAAC;AAE7E,SACE,oCAAC,cAAc,UAAd,EAAuB,OAAO,EAAE,QAAQ,aAAa,KACnD,QACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtCountDownProps } from '../../../types/countdown';
|
|
3
|
+
declare function AtCountdown({ customStyle, className, format, isCard, isShowDay, isShowHour, isShowMinute, day, hours, minutes, seconds, onTimeUp }: AtCountDownProps): JSX.Element;
|
|
4
|
+
declare namespace AtCountdown {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
7
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
8
|
+
isCard: PropTypes.Requireable<boolean>;
|
|
9
|
+
isShowDay: PropTypes.Requireable<boolean>;
|
|
10
|
+
isShowHour: PropTypes.Requireable<boolean>;
|
|
11
|
+
isShowMinute: PropTypes.Requireable<boolean>;
|
|
12
|
+
format: PropTypes.Requireable<object>;
|
|
13
|
+
day: PropTypes.Requireable<number>;
|
|
14
|
+
hours: PropTypes.Requireable<number>;
|
|
15
|
+
minutes: PropTypes.Requireable<number>;
|
|
16
|
+
seconds: PropTypes.Requireable<number>;
|
|
17
|
+
onTimeUp: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default AtCountdown;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
import { useDidHide, useDidShow } from "@tarojs/taro";
|
|
6
|
+
import { useComponentLocale } from "../../hooks/useComponentLocale";
|
|
7
|
+
import AtCountdownItem from "./item";
|
|
8
|
+
const toSeconds = (day, hours, minutes, seconds) => day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds;
|
|
9
|
+
function AtCountdown({
|
|
10
|
+
customStyle = "",
|
|
11
|
+
className = "",
|
|
12
|
+
format,
|
|
13
|
+
isCard = false,
|
|
14
|
+
isShowDay = false,
|
|
15
|
+
isShowHour = true,
|
|
16
|
+
isShowMinute = true,
|
|
17
|
+
day = 0,
|
|
18
|
+
hours = 0,
|
|
19
|
+
minutes = 0,
|
|
20
|
+
seconds = 0,
|
|
21
|
+
onTimeUp
|
|
22
|
+
}) {
|
|
23
|
+
const locale = useComponentLocale("Countdown");
|
|
24
|
+
const mergedFormat = useMemo(
|
|
25
|
+
() => {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
return {
|
|
28
|
+
day: (_a = format == null ? void 0 : format.day) != null ? _a : locale.day,
|
|
29
|
+
hours: (_b = format == null ? void 0 : format.hours) != null ? _b : locale.hours,
|
|
30
|
+
minutes: (_c = format == null ? void 0 : format.minutes) != null ? _c : locale.minutes,
|
|
31
|
+
seconds: (_d = format == null ? void 0 : format.seconds) != null ? _d : locale.seconds
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
[
|
|
35
|
+
format == null ? void 0 : format.day,
|
|
36
|
+
format == null ? void 0 : format.hours,
|
|
37
|
+
format == null ? void 0 : format.minutes,
|
|
38
|
+
format == null ? void 0 : format.seconds,
|
|
39
|
+
locale.day,
|
|
40
|
+
locale.hours,
|
|
41
|
+
locale.minutes,
|
|
42
|
+
locale.seconds
|
|
43
|
+
]
|
|
44
|
+
);
|
|
45
|
+
const propsRef = useRef({
|
|
46
|
+
customStyle,
|
|
47
|
+
className,
|
|
48
|
+
format: mergedFormat,
|
|
49
|
+
isCard,
|
|
50
|
+
isShowDay,
|
|
51
|
+
isShowHour,
|
|
52
|
+
isShowMinute,
|
|
53
|
+
day,
|
|
54
|
+
hours,
|
|
55
|
+
minutes,
|
|
56
|
+
seconds,
|
|
57
|
+
onTimeUp
|
|
58
|
+
});
|
|
59
|
+
const isMountedRef = useRef(false);
|
|
60
|
+
const secondsRef = useRef(toSeconds(day, hours, minutes, seconds));
|
|
61
|
+
const timerRef = useRef();
|
|
62
|
+
const calculateTime = useCallback(() => {
|
|
63
|
+
let [calcDay, calcHours, calcMinutes, calcSeconds] = [0, 0, 0, 0];
|
|
64
|
+
if (secondsRef.current > 0) {
|
|
65
|
+
calcDay = isShowDay ? Math.floor(secondsRef.current / (60 * 60 * 24)) : 0;
|
|
66
|
+
calcHours = isShowHour ? Math.floor(secondsRef.current / (60 * 60)) - calcDay * 24 : 0;
|
|
67
|
+
calcMinutes = isShowMinute ? Math.floor(secondsRef.current / 60) - calcDay * 24 * 60 - calcHours * 60 : 0;
|
|
68
|
+
calcSeconds = Math.floor(secondsRef.current) - calcDay * 24 * 60 * 60 - calcHours * 60 * 60 - calcMinutes * 60;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
day: calcDay,
|
|
72
|
+
hours: calcHours,
|
|
73
|
+
minutes: calcMinutes,
|
|
74
|
+
seconds: calcSeconds
|
|
75
|
+
};
|
|
76
|
+
}, [isShowDay, isShowHour, isShowMinute]);
|
|
77
|
+
const initialTime = calculateTime();
|
|
78
|
+
const [_day, setDay] = useState(initialTime.day);
|
|
79
|
+
const [_hours, setHours] = useState(initialTime.hours);
|
|
80
|
+
const [_minutes, setMinutes] = useState(initialTime.minutes);
|
|
81
|
+
const [_seconds, setSeconds] = useState(initialTime.seconds);
|
|
82
|
+
const clearTimer = useCallback(() => {
|
|
83
|
+
if (timerRef.current) {
|
|
84
|
+
clearTimeout(timerRef.current);
|
|
85
|
+
timerRef.current = 0;
|
|
86
|
+
}
|
|
87
|
+
}, []);
|
|
88
|
+
const countdown = useCallback(() => {
|
|
89
|
+
const {
|
|
90
|
+
day: calcDay,
|
|
91
|
+
hours: calcHours,
|
|
92
|
+
minutes: calcMinutes,
|
|
93
|
+
seconds: calcSeconds
|
|
94
|
+
} = calculateTime();
|
|
95
|
+
setDay(calcDay);
|
|
96
|
+
setHours(calcHours);
|
|
97
|
+
setMinutes(calcMinutes);
|
|
98
|
+
setSeconds(calcSeconds);
|
|
99
|
+
secondsRef.current--;
|
|
100
|
+
if (secondsRef.current < 0) {
|
|
101
|
+
clearTimer();
|
|
102
|
+
onTimeUp && onTimeUp();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
timerRef.current = setTimeout(() => {
|
|
106
|
+
countdown();
|
|
107
|
+
}, 1e3);
|
|
108
|
+
}, [calculateTime, clearTimer, onTimeUp]);
|
|
109
|
+
const setTimer = useCallback(() => {
|
|
110
|
+
if (!timerRef.current) countdown();
|
|
111
|
+
}, [countdown]);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
propsRef.current = {
|
|
114
|
+
customStyle,
|
|
115
|
+
className,
|
|
116
|
+
format: mergedFormat,
|
|
117
|
+
isCard,
|
|
118
|
+
isShowDay,
|
|
119
|
+
isShowHour,
|
|
120
|
+
isShowMinute,
|
|
121
|
+
day,
|
|
122
|
+
hours,
|
|
123
|
+
minutes,
|
|
124
|
+
seconds,
|
|
125
|
+
onTimeUp
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
const nextProps = {
|
|
130
|
+
customStyle,
|
|
131
|
+
className,
|
|
132
|
+
format: mergedFormat,
|
|
133
|
+
isCard,
|
|
134
|
+
isShowDay,
|
|
135
|
+
isShowHour,
|
|
136
|
+
isShowMinute,
|
|
137
|
+
day,
|
|
138
|
+
hours,
|
|
139
|
+
minutes,
|
|
140
|
+
seconds,
|
|
141
|
+
onTimeUp
|
|
142
|
+
};
|
|
143
|
+
if (!isMountedRef.current) {
|
|
144
|
+
isMountedRef.current = true;
|
|
145
|
+
propsRef.current = nextProps;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (JSON.stringify(propsRef.current) === JSON.stringify(nextProps)) return;
|
|
149
|
+
propsRef.current = nextProps;
|
|
150
|
+
secondsRef.current = toSeconds(day, hours, minutes, seconds);
|
|
151
|
+
clearTimer();
|
|
152
|
+
setTimer();
|
|
153
|
+
}, [
|
|
154
|
+
customStyle,
|
|
155
|
+
className,
|
|
156
|
+
mergedFormat,
|
|
157
|
+
isCard,
|
|
158
|
+
isShowDay,
|
|
159
|
+
isShowHour,
|
|
160
|
+
isShowMinute,
|
|
161
|
+
day,
|
|
162
|
+
hours,
|
|
163
|
+
minutes,
|
|
164
|
+
seconds,
|
|
165
|
+
onTimeUp,
|
|
166
|
+
clearTimer,
|
|
167
|
+
setTimer
|
|
168
|
+
]);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
setTimer();
|
|
171
|
+
return () => {
|
|
172
|
+
clearTimer();
|
|
173
|
+
};
|
|
174
|
+
}, [setTimer, clearTimer]);
|
|
175
|
+
useDidHide(() => {
|
|
176
|
+
clearTimer();
|
|
177
|
+
});
|
|
178
|
+
useDidShow(() => {
|
|
179
|
+
setTimer();
|
|
180
|
+
});
|
|
181
|
+
return /* @__PURE__ */ React.createElement(
|
|
182
|
+
View,
|
|
183
|
+
{
|
|
184
|
+
className: classNames(
|
|
185
|
+
{
|
|
186
|
+
"at-countdown": true,
|
|
187
|
+
"at-countdown--card": isCard
|
|
188
|
+
},
|
|
189
|
+
className
|
|
190
|
+
),
|
|
191
|
+
style: customStyle
|
|
192
|
+
},
|
|
193
|
+
isShowDay && /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _day, separator: mergedFormat.day }),
|
|
194
|
+
isShowHour && /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _hours, separator: mergedFormat.hours }),
|
|
195
|
+
isShowMinute && /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _minutes, separator: mergedFormat.minutes }),
|
|
196
|
+
/* @__PURE__ */ React.createElement(AtCountdownItem, { num: _seconds, separator: mergedFormat.seconds })
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
AtCountdown.propTypes = {
|
|
200
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
201
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
202
|
+
isCard: PropTypes.bool,
|
|
203
|
+
isShowDay: PropTypes.bool,
|
|
204
|
+
isShowHour: PropTypes.bool,
|
|
205
|
+
isShowMinute: PropTypes.bool,
|
|
206
|
+
format: PropTypes.object,
|
|
207
|
+
day: PropTypes.number,
|
|
208
|
+
hours: PropTypes.number,
|
|
209
|
+
minutes: PropTypes.number,
|
|
210
|
+
seconds: PropTypes.number,
|
|
211
|
+
onTimeUp: PropTypes.func
|
|
212
|
+
};
|
|
213
|
+
var countdown_default = AtCountdown;
|
|
214
|
+
export {
|
|
215
|
+
countdown_default as default
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/countdown/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport { useDidHide, useDidShow } from '@tarojs/taro'\nimport { useComponentLocale } from '../../hooks/useComponentLocale'\nimport { AtCountDownProps } from '../../../types/countdown'\nimport AtCountdownItem from './item'\n\ntype TimeObject = {\n day: number\n hours: number\n minutes: number\n seconds: number\n}\n\nconst toSeconds = (\n day: number,\n hours: number,\n minutes: number,\n seconds: number\n): number => day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds\n\nfunction AtCountdown({\n customStyle = '',\n className = '',\n format,\n isCard = false,\n isShowDay = false,\n isShowHour = true,\n isShowMinute = true,\n day = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n onTimeUp\n}: AtCountDownProps): JSX.Element {\n const locale = useComponentLocale('Countdown')\n const mergedFormat = useMemo(\n () => ({\n day: format?.day ?? locale.day,\n hours: format?.hours ?? locale.hours,\n minutes: format?.minutes ?? locale.minutes,\n seconds: format?.seconds ?? locale.seconds\n }),\n [\n format?.day,\n format?.hours,\n format?.minutes,\n format?.seconds,\n locale.day,\n locale.hours,\n locale.minutes,\n locale.seconds\n ]\n )\n const propsRef = useRef<AtCountDownProps>({\n customStyle,\n className,\n format: mergedFormat,\n isCard,\n isShowDay,\n isShowHour,\n isShowMinute,\n day,\n hours,\n minutes,\n seconds,\n onTimeUp\n })\n const isMountedRef = useRef(false)\n const secondsRef = useRef(toSeconds(day, hours, minutes, seconds))\n const timerRef = useRef<NodeJS.Timeout | number>()\n\n const calculateTime = useCallback((): TimeObject => {\n let [calcDay, calcHours, calcMinutes, calcSeconds] = [0, 0, 0, 0]\n\n if (secondsRef.current > 0) {\n calcDay = isShowDay ? Math.floor(secondsRef.current / (60 * 60 * 24)) : 0\n calcHours = isShowHour\n ? Math.floor(secondsRef.current / (60 * 60)) - calcDay * 24\n : 0\n calcMinutes = isShowMinute\n ? Math.floor(secondsRef.current / 60) -\n calcDay * 24 * 60 -\n calcHours * 60\n : 0\n calcSeconds =\n Math.floor(secondsRef.current) -\n calcDay * 24 * 60 * 60 -\n calcHours * 60 * 60 -\n calcMinutes * 60\n }\n return {\n day: calcDay,\n hours: calcHours,\n minutes: calcMinutes,\n seconds: calcSeconds\n }\n }, [isShowDay, isShowHour, isShowMinute])\n\n const initialTime = calculateTime()\n const [_day, setDay] = useState(initialTime.day)\n const [_hours, setHours] = useState(initialTime.hours)\n const [_minutes, setMinutes] = useState(initialTime.minutes)\n const [_seconds, setSeconds] = useState(initialTime.seconds)\n\n const clearTimer = useCallback((): void => {\n if (timerRef.current) {\n clearTimeout(timerRef.current as number)\n timerRef.current = 0\n }\n }, [])\n\n const countdown = useCallback((): void => {\n const {\n day: calcDay,\n hours: calcHours,\n minutes: calcMinutes,\n seconds: calcSeconds\n } = calculateTime()\n\n setDay(calcDay)\n setHours(calcHours)\n setMinutes(calcMinutes)\n setSeconds(calcSeconds)\n secondsRef.current--\n\n if (secondsRef.current < 0) {\n clearTimer()\n onTimeUp && onTimeUp()\n return\n }\n\n timerRef.current = setTimeout(() => {\n countdown()\n }, 1000)\n }, [calculateTime, clearTimer, onTimeUp])\n\n const setTimer = useCallback((): void => {\n if (!timerRef.current) countdown()\n }, [countdown])\n\n useEffect(() => {\n propsRef.current = {\n customStyle,\n className,\n format: mergedFormat,\n isCard,\n isShowDay,\n isShowHour,\n isShowMinute,\n day,\n hours,\n minutes,\n seconds,\n onTimeUp\n }\n })\n\n useEffect(() => {\n const nextProps = {\n customStyle,\n className,\n format: mergedFormat,\n isCard,\n isShowDay,\n isShowHour,\n isShowMinute,\n day,\n hours,\n minutes,\n seconds,\n onTimeUp\n }\n if (!isMountedRef.current) {\n isMountedRef.current = true\n propsRef.current = nextProps\n return\n }\n if (JSON.stringify(propsRef.current) === JSON.stringify(nextProps)) return\n\n propsRef.current = nextProps\n secondsRef.current = toSeconds(day, hours, minutes, seconds)\n clearTimer()\n setTimer()\n }, [\n customStyle,\n className,\n mergedFormat,\n isCard,\n isShowDay,\n isShowHour,\n isShowMinute,\n day,\n hours,\n minutes,\n seconds,\n onTimeUp,\n clearTimer,\n setTimer\n ])\n\n useEffect(() => {\n setTimer()\n return () => {\n clearTimer()\n }\n }, [setTimer, clearTimer])\n\n useDidHide(() => {\n clearTimer()\n })\n\n useDidShow(() => {\n setTimer()\n })\n\n return (\n <View\n className={classNames(\n {\n 'at-countdown': true,\n 'at-countdown--card': isCard\n },\n className\n )}\n style={customStyle}\n >\n {isShowDay && <AtCountdownItem num={_day} separator={mergedFormat.day} />}\n {isShowHour && (\n <AtCountdownItem num={_hours} separator={mergedFormat.hours} />\n )}\n {isShowMinute && (\n <AtCountdownItem num={_minutes} separator={mergedFormat.minutes} />\n )}\n <AtCountdownItem num={_seconds} separator={mergedFormat.seconds} />\n </View>\n )\n}\n\nAtCountdown.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n isCard: PropTypes.bool,\n isShowDay: PropTypes.bool,\n isShowHour: PropTypes.bool,\n isShowMinute: PropTypes.bool,\n format: PropTypes.object,\n day: PropTypes.number,\n hours: PropTypes.number,\n minutes: PropTypes.number,\n seconds: PropTypes.number,\n onTimeUp: PropTypes.func\n}\n\nexport default AtCountdown\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AACzE,SAAS,YAA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AAAA,MACC,WAAW;AAAA,QACT;AAAA,UACE,gBAAgB;AAAA,UAChB,sBAAsB;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO;AAAA;AAAA,IAEN,aAAa,oCAAC,mBAAgB,KAAK,MAAM,WAAW,aAAa,KAAK;AAAA,IACtE,cACC,oCAAC,mBAAgB,KAAK,QAAQ,WAAW,aAAa,OAAO;AAAA,IAE9D,gBACC,oCAAC,mBAAgB,KAAK,UAAU,WAAW,aAAa,SAAS;AAAA,IAEnE,oCAAC,mBAAgB,KAAK,UAAU,WAAW,aAAa,SAAS;AAAA,EACnE;AAEJ;AAEA,YAAY,YAAY;AAAA,EACtB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,cAAc,UAAU;AAAA,EACxB,QAAQ,UAAU;AAAA,EAClB,KAAK,UAAU;AAAA,EACf,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AACtB;AAEA,IAAO,oBAAQ;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtCountdownItemProps } from '../../../../types/countdown';
|
|
3
|
+
declare function AtCountdownItem({ num, separator }: AtCountdownItemProps): JSX.Element;
|
|
4
|
+
declare namespace AtCountdownItem {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
num: PropTypes.Validator<number>;
|
|
7
|
+
separator: PropTypes.Requireable<string>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default AtCountdownItem;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text, View } from "@tarojs/components";
|
|
4
|
+
function formatNum(num) {
|
|
5
|
+
return num <= 9 ? `0${num}` : `${num}`;
|
|
6
|
+
}
|
|
7
|
+
function AtCountdownItem({
|
|
8
|
+
num = 0,
|
|
9
|
+
separator = ":"
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ React.createElement(View, { className: "at-countdown__item" }, /* @__PURE__ */ React.createElement(View, { className: "at-countdown__time-box" }, /* @__PURE__ */ React.createElement(Text, { className: "at-countdown__time" }, formatNum(num))), /* @__PURE__ */ React.createElement(Text, { className: "at-countdown__separator" }, separator));
|
|
12
|
+
}
|
|
13
|
+
AtCountdownItem.propTypes = {
|
|
14
|
+
num: PropTypes.number.isRequired,
|
|
15
|
+
separator: PropTypes.string
|
|
16
|
+
};
|
|
17
|
+
var item_default = AtCountdownItem;
|
|
18
|
+
export {
|
|
19
|
+
item_default as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/countdown/item/index.tsx"],"sourcesContent":["import PropTypes from 'prop-types'\nimport React from 'react'\nimport { Text, View } from '@tarojs/components'\nimport { AtCountdownItemProps } from '../../../../types/countdown'\n\nfunction formatNum(num: number): string {\n return num <= 9 ? `0${num}` : `${num}`\n}\n\nfunction AtCountdownItem({\n num = 0,\n separator = ':'\n}: AtCountdownItemProps): JSX.Element {\n return (\n <View className='at-countdown__item'>\n <View className='at-countdown__time-box'>\n <Text className='at-countdown__time'>{formatNum(num)}</Text>\n </View>\n <Text className='at-countdown__separator'>{separator}</Text>\n </View>\n )\n}\n\nAtCountdownItem.propTypes = {\n num: PropTypes.number.isRequired,\n separator: PropTypes.string\n}\n\nexport default AtCountdownItem\n"],"mappings":"AAAA,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,MAAM,YAAY;AAG3B,SAAS,UAAU,KAAqB;AACtC,SAAO,OAAO,IAAI,IAAI,GAAG,KAAK,GAAG,GAAG;AACtC;AAEA,SAAS,gBAAgB;AAAA,EACvB,MAAM;AAAA,EACN,YAAY;AACd,GAAsC;AACpC,SACE,oCAAC,QAAK,WAAU,wBACd,oCAAC,QAAK,WAAU,4BACd,oCAAC,QAAK,WAAU,wBAAsB,UAAU,GAAG,CAAE,CACvD,GACA,oCAAC,QAAK,WAAU,6BAA2B,SAAU,CACvD;AAEJ;AAEA,gBAAgB,YAAY;AAAA,EAC1B,KAAK,UAAU,OAAO;AAAA,EACtB,WAAW,UAAU;AACvB;AAEA,IAAO,eAAQ;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtCurtainProps } from '../../../types/curtain';
|
|
3
|
+
declare function AtCurtain({ className, customStyle, isOpened, closeBtnPosition, onClose, children }: AtCurtainProps): JSX.Element;
|
|
4
|
+
declare namespace AtCurtain {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
7
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
8
|
+
isOpened: PropTypes.Requireable<boolean>;
|
|
9
|
+
closeBtnPosition: PropTypes.Requireable<string>;
|
|
10
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export default AtCurtain;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
import { noop } from "../../common/utils";
|
|
6
|
+
function AtCurtain({
|
|
7
|
+
className = "",
|
|
8
|
+
customStyle = "",
|
|
9
|
+
isOpened = false,
|
|
10
|
+
closeBtnPosition = "bottom",
|
|
11
|
+
onClose = noop,
|
|
12
|
+
children
|
|
13
|
+
}) {
|
|
14
|
+
const handleClose = (e) => {
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
onClose(e);
|
|
17
|
+
};
|
|
18
|
+
const stopPropagation = (e) => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
};
|
|
21
|
+
const curtainClass = classNames(
|
|
22
|
+
{
|
|
23
|
+
"at-curtain": true,
|
|
24
|
+
"at-curtain--closed": !isOpened
|
|
25
|
+
},
|
|
26
|
+
className
|
|
27
|
+
);
|
|
28
|
+
const btnCloseClass = classNames({
|
|
29
|
+
"at-curtain__btn-close": true,
|
|
30
|
+
[`at-curtain__btn-close--${closeBtnPosition}`]: closeBtnPosition
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ React.createElement(
|
|
33
|
+
View,
|
|
34
|
+
{
|
|
35
|
+
className: curtainClass,
|
|
36
|
+
style: customStyle,
|
|
37
|
+
onClick: stopPropagation
|
|
38
|
+
},
|
|
39
|
+
/* @__PURE__ */ React.createElement(View, { className: "at-curtain__container" }, /* @__PURE__ */ React.createElement(View, { className: "at-curtain__body" }, children, /* @__PURE__ */ React.createElement(View, { className: btnCloseClass, onClick: handleClose })))
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
AtCurtain.propTypes = {
|
|
43
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
44
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
45
|
+
isOpened: PropTypes.bool,
|
|
46
|
+
closeBtnPosition: PropTypes.string,
|
|
47
|
+
onClose: PropTypes.func
|
|
48
|
+
};
|
|
49
|
+
var curtain_default = AtCurtain;
|
|
50
|
+
export {
|
|
51
|
+
curtain_default as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/curtain/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtCurtainProps } from '../../../types/curtain'\nimport { noop } from '../../common/utils'\n\nfunction AtCurtain({\n className = '',\n customStyle = '',\n isOpened = false,\n closeBtnPosition = 'bottom',\n onClose = noop,\n children\n}: AtCurtainProps): JSX.Element {\n const handleClose = (e: CommonEvent): void => {\n e.stopPropagation()\n onClose(e)\n }\n\n const stopPropagation = (e: CommonEvent): void => {\n e.stopPropagation()\n }\n\n const curtainClass = classNames(\n {\n 'at-curtain': true,\n 'at-curtain--closed': !isOpened\n },\n className\n )\n const btnCloseClass = classNames({\n 'at-curtain__btn-close': true,\n [`at-curtain__btn-close--${closeBtnPosition}`]: closeBtnPosition\n })\n\n return (\n <View\n className={curtainClass}\n style={customStyle}\n onClick={stopPropagation}\n >\n <View className='at-curtain__container'>\n <View className='at-curtain__body'>\n {children}\n <View className={btnCloseClass} onClick={handleClose}></View>\n </View>\n </View>\n </View>\n )\n}\n\nAtCurtain.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n isOpened: PropTypes.bool,\n closeBtnPosition: PropTypes.string,\n onClose: PropTypes.func\n}\n\nexport default AtCurtain\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,YAAY;AAGrB,SAAS,YAAY;AAErB,SAAS,UAAU;AAAA,EACjB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV;AACF,GAAgC;AAC9B,QAAM,cAAc,CAAC,MAAyB;AAC5C,MAAE,gBAAgB;AAClB,YAAQ,CAAC;AAAA,EACX;AAEA,QAAM,kBAAkB,CAAC,MAAyB;AAChD,MAAE,gBAAgB;AAAA,EACpB;AAEA,QAAM,eAAe;AAAA,IACnB;AAAA,MACE,cAAc;AAAA,MACd,sBAAsB,CAAC;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AACA,QAAM,gBAAgB,WAAW;AAAA,IAC/B,yBAAyB;AAAA,IACzB,CAAC,0BAA0B,gBAAgB,EAAE,GAAG;AAAA,EAClD,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,OAAO;AAAA,MACP,SAAS;AAAA;AAAA,IAET,oCAAC,QAAK,WAAU,2BACd,oCAAC,QAAK,WAAU,sBACb,UACD,oCAAC,QAAK,WAAW,eAAe,SAAS,aAAa,CACxD,CACF;AAAA,EACF;AAEJ;AAEA,UAAU,YAAY;AAAA,EACpB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,UAAU,UAAU;AAAA,EACpB,kBAAkB,UAAU;AAAA,EAC5B,SAAS,UAAU;AACrB;AAEA,IAAO,kBAAQ;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtDividerProps } from '../../../types/divider';
|
|
3
|
+
declare function AtDivider({ className, customStyle, content, height, fontColor, fontSize, lineColor, children }: AtDividerProps): JSX.Element;
|
|
4
|
+
declare namespace AtDivider {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
customStyle: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
7
|
+
className: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
|
8
|
+
content: PropTypes.Requireable<string>;
|
|
9
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
10
|
+
fontColor: PropTypes.Requireable<string>;
|
|
11
|
+
fontSize: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
12
|
+
lineColor: PropTypes.Requireable<string>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default AtDivider;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
import { mergeStyle, pxTransform } from "../../common/utils";
|
|
6
|
+
function AtDivider({
|
|
7
|
+
className,
|
|
8
|
+
customStyle,
|
|
9
|
+
content = "",
|
|
10
|
+
height = 0,
|
|
11
|
+
fontColor = "",
|
|
12
|
+
fontSize = 0,
|
|
13
|
+
lineColor = "",
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
16
|
+
const rootStyle = {
|
|
17
|
+
height: height ? `${pxTransform(Number(height))}` : ""
|
|
18
|
+
};
|
|
19
|
+
const fontStyle = {
|
|
20
|
+
color: fontColor,
|
|
21
|
+
fontSize: fontSize ? `${pxTransform(Number(fontSize))}` : ""
|
|
22
|
+
};
|
|
23
|
+
const lineStyle = {
|
|
24
|
+
backgroundColor: lineColor
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ React.createElement(
|
|
27
|
+
View,
|
|
28
|
+
{
|
|
29
|
+
className: classNames("at-divider", className),
|
|
30
|
+
style: mergeStyle(rootStyle, customStyle)
|
|
31
|
+
},
|
|
32
|
+
/* @__PURE__ */ React.createElement(View, { className: "at-divider__content", style: fontStyle }, content === "" ? children : content),
|
|
33
|
+
/* @__PURE__ */ React.createElement(View, { className: "at-divider__line", style: lineStyle })
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
AtDivider.propTypes = {
|
|
37
|
+
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
38
|
+
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
39
|
+
content: PropTypes.string,
|
|
40
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
41
|
+
fontColor: PropTypes.string,
|
|
42
|
+
fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
43
|
+
lineColor: PropTypes.string
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
AtDivider as default
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/divider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtDividerProps } from '../../../types/divider'\nimport { mergeStyle, pxTransform } from '../../common/utils'\n\nexport default function AtDivider({\n className,\n customStyle,\n content = '',\n height = 0,\n fontColor = '',\n fontSize = 0,\n lineColor = '',\n children\n}: AtDividerProps): JSX.Element {\n const rootStyle = {\n height: height ? `${pxTransform(Number(height))}` : ''\n }\n\n const fontStyle = {\n color: fontColor,\n fontSize: fontSize ? `${pxTransform(Number(fontSize))}` : ''\n }\n\n const lineStyle: React.CSSProperties = {\n backgroundColor: lineColor\n }\n\n return (\n <View\n className={classNames('at-divider', className)}\n style={mergeStyle(rootStyle, customStyle as object)}\n >\n <View className='at-divider__content' style={fontStyle}>\n {content === '' ? children : content}\n </View>\n <View className='at-divider__line' style={lineStyle}></View>\n </View>\n )\n}\n\nAtDivider.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n content: PropTypes.string,\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n fontColor: PropTypes.string,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n lineColor: PropTypes.string\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,SAAS,YAAY,mBAAmB;AAEzB,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ;AACF,GAAgC;AAC9B,QAAM,YAAY;AAAA,IAChB,QAAQ,SAAS,GAAG,YAAY,OAAO,MAAM,CAAC,CAAC,KAAK;AAAA,EACtD;AAEA,QAAM,YAAY;AAAA,IAChB,OAAO;AAAA,IACP,UAAU,WAAW,GAAG,YAAY,OAAO,QAAQ,CAAC,CAAC,KAAK;AAAA,EAC5D;AAEA,QAAM,YAAiC;AAAA,IACrC,iBAAiB;AAAA,EACnB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,WAAW,cAAc,SAAS;AAAA,MAC7C,OAAO,WAAW,WAAW,WAAqB;AAAA;AAAA,IAElD,oCAAC,QAAK,WAAU,uBAAsB,OAAO,aAC1C,YAAY,KAAK,WAAW,OAC/B;AAAA,IACA,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW;AAAA,EACvD;AAEJ;AAEA,UAAU,YAAY;AAAA,EACpB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAChE,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAClE,WAAW,UAAU;AACvB;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AtDrawerProps } from '../../../types/drawer';
|
|
3
|
+
declare function AtDrawer({ show, mask, width, right, items, className, children, onItemClick, onClose }: AtDrawerProps): JSX.Element;
|
|
4
|
+
declare namespace AtDrawer {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
show: PropTypes.Requireable<boolean>;
|
|
7
|
+
mask: PropTypes.Requireable<boolean>;
|
|
8
|
+
width: PropTypes.Requireable<string>;
|
|
9
|
+
items: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
10
|
+
onItemClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default AtDrawer;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
import AtList from "../list/index";
|
|
6
|
+
import AtListItem from "../list/item/index";
|
|
7
|
+
function AtDrawer({
|
|
8
|
+
show = false,
|
|
9
|
+
mask = true,
|
|
10
|
+
width = "",
|
|
11
|
+
right = false,
|
|
12
|
+
items = [],
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
onItemClick,
|
|
16
|
+
onClose
|
|
17
|
+
}) {
|
|
18
|
+
const [animShow, setAnimShow] = useState(false);
|
|
19
|
+
const [_show, setShow] = useState(show);
|
|
20
|
+
const showStateRef = useRef(show);
|
|
21
|
+
const isMountRef = useRef(true);
|
|
22
|
+
const hideTimerRef = useRef();
|
|
23
|
+
const showTimerRef = useRef();
|
|
24
|
+
const onHide = () => {
|
|
25
|
+
setShow(false);
|
|
26
|
+
onClose && onClose();
|
|
27
|
+
};
|
|
28
|
+
const animHide = () => {
|
|
29
|
+
setAnimShow(false);
|
|
30
|
+
if (hideTimerRef.current) {
|
|
31
|
+
clearTimeout(hideTimerRef.current);
|
|
32
|
+
}
|
|
33
|
+
hideTimerRef.current = setTimeout(() => {
|
|
34
|
+
onHide();
|
|
35
|
+
}, 300);
|
|
36
|
+
};
|
|
37
|
+
const runAnimShow = () => {
|
|
38
|
+
setShow(true);
|
|
39
|
+
if (showTimerRef.current) {
|
|
40
|
+
clearTimeout(showTimerRef.current);
|
|
41
|
+
}
|
|
42
|
+
showTimerRef.current = setTimeout(() => {
|
|
43
|
+
setAnimShow(true);
|
|
44
|
+
}, 200);
|
|
45
|
+
};
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
showStateRef.current = _show;
|
|
48
|
+
}, [_show]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (isMountRef.current) {
|
|
51
|
+
isMountRef.current = false;
|
|
52
|
+
if (show) {
|
|
53
|
+
runAnimShow();
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (show !== showStateRef.current) {
|
|
58
|
+
show ? runAnimShow() : animHide();
|
|
59
|
+
}
|
|
60
|
+
}, [show]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
return () => {
|
|
63
|
+
if (hideTimerRef.current) {
|
|
64
|
+
clearTimeout(hideTimerRef.current);
|
|
65
|
+
}
|
|
66
|
+
if (showTimerRef.current) {
|
|
67
|
+
clearTimeout(showTimerRef.current);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
71
|
+
const onItemClickHandler = (index) => {
|
|
72
|
+
onItemClick && onItemClick(index);
|
|
73
|
+
animHide();
|
|
74
|
+
};
|
|
75
|
+
const onMaskClick = () => {
|
|
76
|
+
animHide();
|
|
77
|
+
};
|
|
78
|
+
const maskStyle = {
|
|
79
|
+
display: mask ? "block" : "none",
|
|
80
|
+
opacity: animShow ? 1 : 0
|
|
81
|
+
};
|
|
82
|
+
const listStyle = {
|
|
83
|
+
width,
|
|
84
|
+
transition: animShow ? "all 225ms cubic-bezier(0, 0, 0.2, 1)" : "all 195ms cubic-bezier(0.4, 0, 0.6, 1)"
|
|
85
|
+
};
|
|
86
|
+
const classObject = {
|
|
87
|
+
"at-drawer--show": animShow,
|
|
88
|
+
"at-drawer--right": right,
|
|
89
|
+
"at-drawer--left": !right
|
|
90
|
+
};
|
|
91
|
+
return _show ? /* @__PURE__ */ React.createElement(View, { className: classNames(["at-drawer"], classObject, className) }, /* @__PURE__ */ React.createElement(
|
|
92
|
+
View,
|
|
93
|
+
{
|
|
94
|
+
className: "at-drawer__mask",
|
|
95
|
+
style: maskStyle,
|
|
96
|
+
onClick: onMaskClick
|
|
97
|
+
}
|
|
98
|
+
), /* @__PURE__ */ React.createElement(View, { className: "at-drawer__content", style: listStyle }, !!items && items.length ? /* @__PURE__ */ React.createElement(AtList, null, items.map((name, index) => /* @__PURE__ */ React.createElement(
|
|
99
|
+
AtListItem,
|
|
100
|
+
{
|
|
101
|
+
key: `${name}-${index}`,
|
|
102
|
+
"data-index": index,
|
|
103
|
+
onClick: () => onItemClickHandler(index),
|
|
104
|
+
title: name,
|
|
105
|
+
arrow: "right"
|
|
106
|
+
}
|
|
107
|
+
))) : children)) : /* @__PURE__ */ React.createElement(View, null);
|
|
108
|
+
}
|
|
109
|
+
AtDrawer.propTypes = {
|
|
110
|
+
show: PropTypes.bool,
|
|
111
|
+
mask: PropTypes.bool,
|
|
112
|
+
width: PropTypes.string,
|
|
113
|
+
items: PropTypes.arrayOf(PropTypes.string),
|
|
114
|
+
onItemClick: PropTypes.func,
|
|
115
|
+
onClose: PropTypes.func
|
|
116
|
+
};
|
|
117
|
+
var drawer_default = AtDrawer;
|
|
118
|
+
export {
|
|
119
|
+
drawer_default as default
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drawer/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes from 'prop-types'\nimport React, { useEffect, useRef, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport { AtDrawerProps } from '../../../types/drawer'\nimport AtList from '../list/index'\nimport AtListItem from '../list/item/index'\n\nfunction AtDrawer({\n show = false,\n mask = true,\n width = '',\n right = false,\n items = [],\n className,\n children,\n onItemClick,\n onClose\n}: AtDrawerProps): JSX.Element {\n const [animShow, setAnimShow] = useState(false)\n const [_show, setShow] = useState(show)\n const showStateRef = useRef(show)\n const isMountRef = useRef(true)\n const hideTimerRef = useRef<ReturnType<typeof setTimeout>>()\n const showTimerRef = useRef<ReturnType<typeof setTimeout>>()\n\n const onHide = (): void => {\n setShow(false)\n onClose && onClose()\n }\n\n const animHide = (): void => {\n setAnimShow(false)\n if (hideTimerRef.current) {\n clearTimeout(hideTimerRef.current)\n }\n hideTimerRef.current = setTimeout(() => {\n onHide()\n }, 300)\n }\n\n const runAnimShow = (): void => {\n setShow(true)\n if (showTimerRef.current) {\n clearTimeout(showTimerRef.current)\n }\n showTimerRef.current = setTimeout(() => {\n setAnimShow(true)\n }, 200)\n }\n\n useEffect(() => {\n showStateRef.current = _show\n }, [_show])\n\n useEffect(() => {\n if (isMountRef.current) {\n isMountRef.current = false\n if (show) {\n runAnimShow()\n }\n return\n }\n if (show !== showStateRef.current) {\n show ? runAnimShow() : animHide()\n }\n }, [show])\n\n useEffect(() => {\n return () => {\n if (hideTimerRef.current) {\n clearTimeout(hideTimerRef.current)\n }\n if (showTimerRef.current) {\n clearTimeout(showTimerRef.current)\n }\n }\n }, [])\n\n const onItemClickHandler = (index: number): void => {\n onItemClick && onItemClick(index)\n animHide()\n }\n\n const onMaskClick = (): void => {\n animHide()\n }\n\n const maskStyle = {\n display: mask ? 'block' : 'none',\n opacity: animShow ? 1 : 0\n }\n const listStyle = {\n width,\n transition: animShow\n ? 'all 225ms cubic-bezier(0, 0, 0.2, 1)'\n : 'all 195ms cubic-bezier(0.4, 0, 0.6, 1)'\n }\n\n const classObject = {\n 'at-drawer--show': animShow,\n 'at-drawer--right': right,\n 'at-drawer--left': !right\n }\n\n return _show ? (\n <View className={classNames(['at-drawer'], classObject, className)}>\n <View\n className='at-drawer__mask'\n style={maskStyle}\n onClick={onMaskClick}\n ></View>\n\n <View className='at-drawer__content' style={listStyle}>\n {!!items && items.length ? (\n <AtList>\n {items.map((name, index) => (\n <AtListItem\n key={`${name}-${index}`}\n data-index={index}\n onClick={() => onItemClickHandler(index)}\n title={name}\n arrow='right'\n ></AtListItem>\n ))}\n </AtList>\n ) : (\n children\n )}\n </View>\n </View>\n ) : (\n <View></View>\n )\n}\n\nAtDrawer.propTypes = {\n show: PropTypes.bool,\n mask: PropTypes.bool,\n width: PropTypes.string,\n items: PropTypes.arrayOf(PropTypes.string),\n onItemClick: PropTypes.func,\n onClose: PropTypes.func\n}\n\nexport default AtDrawer\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,SAAS,WAAW,QAAQ,gBAAgB;AACnD,SAAS,YAAY;AAErB,OAAO,YAAY;AACnB,OAAO,gBAAgB;AAEvB,SAAS,SAAS;AAAA,EAChB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ,CAAC;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA+B;AAC7B,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,CAAC,OAAO,OAAO,IAAI,SAAS,IAAI;AACtC,QAAM,eAAe,OAAO,IAAI;AAChC,QAAM,aAAa,OAAO,IAAI;AAC9B,QAAM,eAAe,OAAsC;AAC3D,QAAM,eAAe,OAAsC;AAE3D,QAAM,SAAS,MAAY;AACzB,YAAQ,KAAK;AACb,eAAW,QAAQ;AAAA,EACrB;AAEA,QAAM,WAAW,MAAY;AAC3B,gBAAY,KAAK;AACjB,QAAI,aAAa,SAAS;AACxB,mBAAa,aAAa,OAAO;AAAA,IACnC;AACA,iBAAa,UAAU,WAAW,MAAM;AACtC,aAAO;AAAA,IACT,GAAG,GAAG;AAAA,EACR;AAEA,QAAM,cAAc,MAAY;AAC9B,YAAQ,IAAI;AACZ,QAAI,aAAa,SAAS;AACxB,mBAAa,aAAa,OAAO;AAAA,IACnC;AACA,iBAAa,UAAU,WAAW,MAAM;AACtC,kBAAY,IAAI;AAAA,IAClB,GAAG,GAAG;AAAA,EACR;AAEA,YAAU,MAAM;AACd,iBAAa,UAAU;AAAA,EACzB,GAAG,CAAC,KAAK,CAAC;AAEV,YAAU,MAAM;AACd,QAAI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