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
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Input, Text, View } from "@tarojs/components";
|
|
5
|
-
class AtSearchBar extends React.Component {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super(props);
|
|
8
|
-
this.handleFocus = (event) => {
|
|
9
|
-
this.setState({
|
|
10
|
-
isFocus: true
|
|
11
|
-
});
|
|
12
|
-
this.props.onFocus && this.props.onFocus(event);
|
|
13
|
-
};
|
|
14
|
-
this.handleBlur = (event) => {
|
|
15
|
-
this.setState({
|
|
16
|
-
isFocus: false
|
|
17
|
-
});
|
|
18
|
-
this.props.onBlur && this.props.onBlur(event);
|
|
19
|
-
};
|
|
20
|
-
this.handleChange = (e) => {
|
|
21
|
-
this.props.onChange(e.detail.value, e);
|
|
22
|
-
};
|
|
23
|
-
this.handleClear = (event) => {
|
|
24
|
-
if (this.props.onClear) {
|
|
25
|
-
this.props.onClear(event);
|
|
26
|
-
} else {
|
|
27
|
-
this.props.onChange("", event);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
this.handleConfirm = (event) => {
|
|
31
|
-
this.props.onConfirm && this.props.onConfirm(event);
|
|
32
|
-
};
|
|
33
|
-
this.handleActionClick = (event) => {
|
|
34
|
-
this.props.onActionClick && this.props.onActionClick(event);
|
|
35
|
-
};
|
|
36
|
-
this.state = {
|
|
37
|
-
isFocus: !!props.focus
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
41
|
-
if (nextProps.focus !== this.props.focus) {
|
|
42
|
-
this.setState({ isFocus: !!nextProps.focus });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
render() {
|
|
46
|
-
const {
|
|
47
|
-
value,
|
|
48
|
-
placeholder,
|
|
49
|
-
maxLength,
|
|
50
|
-
fixed,
|
|
51
|
-
disabled,
|
|
52
|
-
showActionButton,
|
|
53
|
-
actionName = "\u641C\u7D22",
|
|
54
|
-
inputType,
|
|
55
|
-
// 处理issue#464
|
|
56
|
-
className,
|
|
57
|
-
customStyle,
|
|
58
|
-
enableNative
|
|
59
|
-
} = this.props;
|
|
60
|
-
const { isFocus } = this.state;
|
|
61
|
-
const fontSize = 14;
|
|
62
|
-
const rootCls = classNames(
|
|
63
|
-
"at-search-bar",
|
|
64
|
-
{
|
|
65
|
-
"at-search-bar--fixed": fixed
|
|
66
|
-
},
|
|
67
|
-
className
|
|
68
|
-
);
|
|
69
|
-
const placeholderWrapStyle = {};
|
|
70
|
-
const actionStyle = {};
|
|
71
|
-
if (isFocus || !isFocus && value) {
|
|
72
|
-
actionStyle.opacity = 1;
|
|
73
|
-
actionStyle.marginRight = `0`;
|
|
74
|
-
placeholderWrapStyle.flexGrow = 0;
|
|
75
|
-
} else if (!isFocus && !value) {
|
|
76
|
-
placeholderWrapStyle.flexGrow = 1;
|
|
77
|
-
actionStyle.opacity = 0;
|
|
78
|
-
actionStyle.marginRight = `-${(actionName.length + 1) * fontSize + fontSize / 2 + 10}px`;
|
|
79
|
-
}
|
|
80
|
-
if (showActionButton) {
|
|
81
|
-
actionStyle.opacity = 1;
|
|
82
|
-
actionStyle.marginRight = `0`;
|
|
83
|
-
}
|
|
84
|
-
const clearIconStyle = { display: "flex" };
|
|
85
|
-
const placeholderStyle = { visibility: "hidden" };
|
|
86
|
-
if (!value.length) {
|
|
87
|
-
clearIconStyle.display = "none";
|
|
88
|
-
placeholderStyle.visibility = "visible";
|
|
89
|
-
}
|
|
90
|
-
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: customStyle }, /* @__PURE__ */ React.createElement(View, { className: "at-search-bar__input-cnt" }, /* @__PURE__ */ React.createElement(
|
|
91
|
-
View,
|
|
92
|
-
{
|
|
93
|
-
className: "at-search-bar__placeholder-wrap",
|
|
94
|
-
style: placeholderWrapStyle
|
|
95
|
-
},
|
|
96
|
-
/* @__PURE__ */ React.createElement(Text, { className: "at-icon at-icon-search" }),
|
|
97
|
-
/* @__PURE__ */ React.createElement(
|
|
98
|
-
Text,
|
|
99
|
-
{
|
|
100
|
-
className: "at-search-bar__placeholder",
|
|
101
|
-
style: placeholderStyle
|
|
102
|
-
},
|
|
103
|
-
isFocus ? "" : placeholder
|
|
104
|
-
)
|
|
105
|
-
), /* @__PURE__ */ React.createElement(
|
|
106
|
-
Input,
|
|
107
|
-
{
|
|
108
|
-
className: "at-search-bar__input",
|
|
109
|
-
type: inputType,
|
|
110
|
-
confirmType: "search",
|
|
111
|
-
value,
|
|
112
|
-
focus: isFocus,
|
|
113
|
-
disabled,
|
|
114
|
-
maxlength: maxLength,
|
|
115
|
-
enableNative,
|
|
116
|
-
onInput: this.handleChange,
|
|
117
|
-
onFocus: this.handleFocus,
|
|
118
|
-
onBlur: this.handleBlur,
|
|
119
|
-
onConfirm: this.handleConfirm
|
|
120
|
-
}
|
|
121
|
-
), /* @__PURE__ */ React.createElement(
|
|
122
|
-
View,
|
|
123
|
-
{
|
|
124
|
-
className: "at-search-bar__clear",
|
|
125
|
-
style: clearIconStyle,
|
|
126
|
-
onTouchStart: this.handleClear
|
|
127
|
-
},
|
|
128
|
-
/* @__PURE__ */ React.createElement(Text, { className: "at-icon at-icon-close-circle" })
|
|
129
|
-
)), /* @__PURE__ */ React.createElement(
|
|
130
|
-
View,
|
|
131
|
-
{
|
|
132
|
-
className: "at-search-bar__action",
|
|
133
|
-
style: actionStyle,
|
|
134
|
-
onClick: this.handleActionClick
|
|
135
|
-
},
|
|
136
|
-
actionName
|
|
137
|
-
));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
AtSearchBar.defaultProps = {
|
|
141
|
-
value: "",
|
|
142
|
-
placeholder: "\u641C\u7D22",
|
|
143
|
-
maxLength: 140,
|
|
144
|
-
fixed: false,
|
|
145
|
-
focus: false,
|
|
146
|
-
disabled: false,
|
|
147
|
-
showActionButton: false,
|
|
148
|
-
actionName: "\u641C\u7D22",
|
|
149
|
-
inputType: "text",
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
151
|
-
onChange: () => {
|
|
152
|
-
},
|
|
153
|
-
enableNative: true
|
|
154
|
-
};
|
|
155
|
-
AtSearchBar.propTypes = {
|
|
156
|
-
value: PropTypes.string,
|
|
157
|
-
placeholder: PropTypes.string,
|
|
158
|
-
maxLength: PropTypes.number,
|
|
159
|
-
fixed: PropTypes.bool,
|
|
160
|
-
focus: PropTypes.bool,
|
|
161
|
-
disabled: PropTypes.bool,
|
|
162
|
-
showActionButton: PropTypes.bool,
|
|
163
|
-
actionName: PropTypes.string,
|
|
164
|
-
inputType: PropTypes.oneOf(["text", "number", "idcard", "digit"]),
|
|
165
|
-
onChange: PropTypes.func,
|
|
166
|
-
onFocus: PropTypes.func,
|
|
167
|
-
onBlur: PropTypes.func,
|
|
168
|
-
onConfirm: PropTypes.func,
|
|
169
|
-
onActionClick: PropTypes.func,
|
|
170
|
-
onClear: PropTypes.func,
|
|
171
|
-
enableNative: PropTypes.bool
|
|
172
|
-
};
|
|
173
|
-
export {
|
|
174
|
-
AtSearchBar as default
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/search-bar/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Input, Text, View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtSearchBarProps, AtSearchBarState } from '../../../types/search-bar'\n\ntype ExtendEvent = {\n target: {\n value: string\n }\n}\n\nexport default class AtSearchBar extends React.Component<\n AtSearchBarProps,\n AtSearchBarState\n> {\n public static defaultProps: AtSearchBarProps\n public static propTypes: InferProps<AtSearchBarProps>\n\n public constructor(props: AtSearchBarProps) {\n super(props)\n this.state = {\n isFocus: !!props.focus\n }\n }\n\n private handleFocus = (event: CommonEvent): void => {\n this.setState({\n isFocus: true\n })\n this.props.onFocus && this.props.onFocus(event)\n }\n\n private handleBlur = (event: CommonEvent): void => {\n this.setState({\n isFocus: false\n })\n this.props.onBlur && this.props.onBlur(event)\n }\n\n private handleChange = (e: CommonEvent & ExtendEvent): void => {\n this.props.onChange(e.detail.value, e)\n }\n\n private handleClear = (event: CommonEvent): void => {\n if (this.props.onClear) {\n this.props.onClear(event)\n } else {\n this.props.onChange('', event)\n }\n }\n\n private handleConfirm = (event: CommonEvent): void => {\n this.props.onConfirm && this.props.onConfirm(event)\n }\n\n private handleActionClick = (event: CommonEvent): void => {\n this.props.onActionClick && this.props.onActionClick(event)\n }\n\n public UNSAFE_componentWillReceiveProps(nextProps: AtSearchBarProps): void {\n if (nextProps.focus !== this.props.focus) {\n this.setState({ isFocus: !!nextProps.focus })\n }\n }\n\n public render(): JSX.Element {\n const {\n value,\n placeholder,\n maxLength,\n fixed,\n disabled,\n showActionButton,\n actionName = '搜索',\n inputType, // 处理issue#464\n className,\n customStyle,\n enableNative\n } = this.props\n const { isFocus } = this.state\n const fontSize = 14\n const rootCls = classNames(\n 'at-search-bar',\n {\n 'at-search-bar--fixed': fixed\n },\n className\n )\n const placeholderWrapStyle: React.CSSProperties = {}\n const actionStyle: React.CSSProperties = {}\n if (isFocus || (!isFocus && value)) {\n actionStyle.opacity = 1\n actionStyle.marginRight = `0`\n placeholderWrapStyle.flexGrow = 0\n } else if (!isFocus && !value) {\n placeholderWrapStyle.flexGrow = 1\n actionStyle.opacity = 0\n actionStyle.marginRight = `-${\n (actionName.length + 1) * fontSize + fontSize / 2 + 10\n }px`\n }\n if (showActionButton) {\n actionStyle.opacity = 1\n actionStyle.marginRight = `0`\n }\n\n const clearIconStyle: React.CSSProperties = { display: 'flex' }\n const placeholderStyle: React.CSSProperties = { visibility: 'hidden' }\n if (!value.length) {\n clearIconStyle.display = 'none'\n placeholderStyle.visibility = 'visible'\n }\n\n return (\n <View className={rootCls} style={customStyle}>\n <View className='at-search-bar__input-cnt'>\n <View\n className='at-search-bar__placeholder-wrap'\n style={placeholderWrapStyle}\n >\n <Text className='at-icon at-icon-search'></Text>\n <Text\n className='at-search-bar__placeholder'\n style={placeholderStyle}\n >\n {isFocus ? '' : placeholder}\n </Text>\n </View>\n <Input\n className='at-search-bar__input'\n type={inputType}\n confirmType='search'\n value={value}\n focus={isFocus}\n disabled={disabled}\n maxlength={maxLength}\n // @ts-ignore ci 上面这个检查不通过, 暂时跳过ts检查\n enableNative={enableNative}\n onInput={this.handleChange}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onConfirm={this.handleConfirm}\n />\n <View\n className='at-search-bar__clear'\n style={clearIconStyle}\n onTouchStart={this.handleClear}\n >\n <Text className='at-icon at-icon-close-circle'></Text>\n </View>\n </View>\n <View\n className='at-search-bar__action'\n style={actionStyle}\n onClick={this.handleActionClick}\n >\n {actionName}\n </View>\n </View>\n )\n }\n}\n\nAtSearchBar.defaultProps = {\n value: '',\n placeholder: '搜索',\n maxLength: 140,\n fixed: false,\n focus: false,\n disabled: false,\n showActionButton: false,\n actionName: '搜索',\n inputType: 'text',\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange: (): void => {},\n enableNative: true\n}\n\nAtSearchBar.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string,\n maxLength: PropTypes.number,\n fixed: PropTypes.bool,\n focus: PropTypes.bool,\n disabled: PropTypes.bool,\n showActionButton: PropTypes.bool,\n actionName: PropTypes.string,\n inputType: PropTypes.oneOf(['text', 'number', 'idcard', 'digit']),\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onConfirm: PropTypes.func,\n onActionClick: PropTypes.func,\n onClear: PropTypes.func,\n enableNative: PropTypes.bool\n}\n"],"m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AAAA,QACA,SAAS,KAAK;AAAA,QACd,SAAS,KAAK;AAAA,QACd,QAAQ,KAAK;AAAA,QACb,WAAW,KAAK;AAAA;AAAA,IAClB,GACA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,QACP,cAAc,KAAK;AAAA;AAAA,MAEnB,oCAAC,QAAK,WAAU,gCAA+B;AAAA,IACjD,CACF,GACA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,QACP,SAAS,KAAK;AAAA;AAAA,MAEb;AAAA,IACH,CACF;AAAA,EAEJ;AACF;AAEA,YAAY,eAAe;AAAA,EACzB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA;AAAA,EAEX,UAAU,MAAY;AAAA,EAAC;AAAA,EACvB,cAAc;AAChB;AAEA,YAAY,YAAY;AAAA,EACtB,OAAO,UAAU;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,OAAO,UAAU;AAAA,EACjB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,kBAAkB,UAAU;AAAA,EAC5B,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU,MAAM,CAAC,QAAQ,UAAU,UAAU,OAAO,CAAC;AAAA,EAChE,UAAU,UAAU;AAAA,EACpB,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,eAAe,UAAU;AAAA,EACzB,SAAS,UAAU;AAAA,EACnB,cAAc,UAAU;AAC1B;","names":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InferProps } from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { AtSegmentedControlProps } from '../../../types/segmented-control';
|
|
4
|
-
export default class AtSegmentedControl extends React.Component<AtSegmentedControlProps> {
|
|
5
|
-
static defaultProps: AtSegmentedControlProps;
|
|
6
|
-
static propTypes: InferProps<AtSegmentedControlProps>;
|
|
7
|
-
private handleClick;
|
|
8
|
-
render(): JSX.Element;
|
|
9
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
class AtSegmentedControl extends React.Component {
|
|
7
|
-
handleClick(index, event) {
|
|
8
|
-
if (this.props.disabled) return;
|
|
9
|
-
this.props.onClick(index, event);
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
const {
|
|
13
|
-
customStyle = "",
|
|
14
|
-
className,
|
|
15
|
-
disabled,
|
|
16
|
-
values,
|
|
17
|
-
selectedColor,
|
|
18
|
-
current,
|
|
19
|
-
color,
|
|
20
|
-
fontSize = 28
|
|
21
|
-
} = this.props;
|
|
22
|
-
const rootStyle = {
|
|
23
|
-
borderColor: selectedColor
|
|
24
|
-
};
|
|
25
|
-
const itemStyle = {
|
|
26
|
-
color: selectedColor,
|
|
27
|
-
fontSize: pxTransform(fontSize),
|
|
28
|
-
borderColor: selectedColor,
|
|
29
|
-
backgroundColor: color
|
|
30
|
-
};
|
|
31
|
-
const selectedItemStyle = {
|
|
32
|
-
color,
|
|
33
|
-
fontSize: pxTransform(fontSize),
|
|
34
|
-
borderColor: selectedColor,
|
|
35
|
-
backgroundColor: selectedColor
|
|
36
|
-
};
|
|
37
|
-
const rootCls = classNames(
|
|
38
|
-
"at-segmented-control",
|
|
39
|
-
{
|
|
40
|
-
"at-segmented-control--disabled": disabled
|
|
41
|
-
},
|
|
42
|
-
className
|
|
43
|
-
);
|
|
44
|
-
return /* @__PURE__ */ React.createElement(View, { className: rootCls, style: mergeStyle(rootStyle, customStyle) }, values.map((value, i) => /* @__PURE__ */ React.createElement(
|
|
45
|
-
View,
|
|
46
|
-
{
|
|
47
|
-
className: classNames("at-segmented-control__item", {
|
|
48
|
-
"at-segmented-control__item--active": current === i
|
|
49
|
-
}),
|
|
50
|
-
style: current === i ? selectedItemStyle : itemStyle,
|
|
51
|
-
key: value,
|
|
52
|
-
onClick: this.handleClick.bind(this, i)
|
|
53
|
-
},
|
|
54
|
-
value
|
|
55
|
-
)));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
AtSegmentedControl.defaultProps = {
|
|
59
|
-
customStyle: "",
|
|
60
|
-
className: "",
|
|
61
|
-
current: 0,
|
|
62
|
-
color: "",
|
|
63
|
-
fontSize: 28,
|
|
64
|
-
disabled: false,
|
|
65
|
-
selectedColor: "",
|
|
66
|
-
values: [],
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
68
|
-
onClick: () => {
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
AtSegmentedControl.propTypes = {
|
|
72
|
-
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
73
|
-
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
74
|
-
current: PropTypes.number,
|
|
75
|
-
color: PropTypes.string,
|
|
76
|
-
fontSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
77
|
-
disabled: PropTypes.bool,
|
|
78
|
-
values: PropTypes.array,
|
|
79
|
-
onClick: PropTypes.func
|
|
80
|
-
};
|
|
81
|
-
export {
|
|
82
|
-
AtSegmentedControl as default
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/segmented-control/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtSegmentedControlProps } from '../../../types/segmented-control'\nimport { mergeStyle, pxTransform } from '../../common/utils'\n\nexport default class AtSegmentedControl extends React.Component<AtSegmentedControlProps> {\n public static defaultProps: AtSegmentedControlProps\n public static propTypes: InferProps<AtSegmentedControlProps>\n\n private handleClick(index: number, event: CommonEvent): void {\n if (this.props.disabled) return\n this.props.onClick(index, event)\n }\n\n public render(): JSX.Element {\n const {\n customStyle = '',\n className,\n disabled,\n values,\n selectedColor,\n current,\n color,\n fontSize = 28\n } = this.props\n\n const rootStyle = {\n borderColor: selectedColor\n }\n const itemStyle = {\n color: selectedColor,\n fontSize: pxTransform(fontSize),\n borderColor: selectedColor,\n backgroundColor: color\n }\n const selectedItemStyle = {\n color,\n fontSize: pxTransform(fontSize),\n borderColor: selectedColor,\n backgroundColor: selectedColor\n }\n const rootCls = classNames(\n 'at-segmented-control',\n {\n 'at-segmented-control--disabled': disabled\n },\n className\n )\n\n return (\n <View className={rootCls} style={mergeStyle(rootStyle, customStyle)}>\n {values.map((value, i) => (\n <View\n className={classNames('at-segmented-control__item', {\n 'at-segmented-control__item--active': current === i\n })}\n style={current === i ? selectedItemStyle : itemStyle}\n key={value}\n onClick={this.handleClick.bind(this, i)}\n >\n {value}\n </View>\n ))}\n </View>\n )\n }\n}\n\nAtSegmentedControl.defaultProps = {\n customStyle: '',\n className: '',\n current: 0,\n color: '',\n fontSize: 28,\n disabled: false,\n selectedColor: '',\n values: [],\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClick: (): void => {}\n}\n\nAtSegmentedControl.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n current: PropTypes.number,\n color: PropTypes.string,\n fontSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n disabled: PropTypes.bool,\n values: PropTypes.array,\n onClick: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,W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AAAA;AAAA,EAET,SAAS,MAAY;AAAA,EAAC;AACxB;AAEA,mBAAmB,YAAY;AAAA,EAC7B,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,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAClE,UAAU,UAAU;AAAA,EACpB,QAAQ,UAAU;AAAA,EAClB,SAAS,UAAU;AACrB;","names":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { InferProps } from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { AtSliderProps, AtSliderState } from '../../../types/slider';
|
|
4
|
-
export default class AtSlider extends React.Component<AtSliderProps, AtSliderState> {
|
|
5
|
-
static defaultProps: AtSliderProps;
|
|
6
|
-
static propTypes: InferProps<AtSliderProps>;
|
|
7
|
-
constructor(props: AtSliderProps);
|
|
8
|
-
protected static clampNumber(value: number, lower: number, upper: number): number;
|
|
9
|
-
private handleChanging;
|
|
10
|
-
private handleChange;
|
|
11
|
-
UNSAFE_componentWillReceiveProps(props: AtSliderProps): void;
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Slider, View } from "@tarojs/components";
|
|
5
|
-
class AtSlider extends React.Component {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super(props);
|
|
8
|
-
const { value = 0, min = 0, max = 100 } = props;
|
|
9
|
-
this.state = {
|
|
10
|
-
_value: AtSlider.clampNumber(value, min, max)
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
static clampNumber(value, lower, upper) {
|
|
14
|
-
return Math.max(lower, Math.min(upper, value));
|
|
15
|
-
}
|
|
16
|
-
handleChanging(e) {
|
|
17
|
-
const { _value } = this.state;
|
|
18
|
-
const { value } = e.detail;
|
|
19
|
-
if (value !== _value) {
|
|
20
|
-
this.setState({ _value: value });
|
|
21
|
-
}
|
|
22
|
-
this.props.onChanging && this.props.onChanging(value);
|
|
23
|
-
}
|
|
24
|
-
handleChange(e) {
|
|
25
|
-
const { value } = e.detail;
|
|
26
|
-
this.setState({ _value: value });
|
|
27
|
-
this.props.onChange && this.props.onChange(value);
|
|
28
|
-
}
|
|
29
|
-
UNSAFE_componentWillReceiveProps(props) {
|
|
30
|
-
const { value = 0, min = 0, max = 100 } = props;
|
|
31
|
-
this.setState({
|
|
32
|
-
_value: AtSlider.clampNumber(value, min, max)
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
render() {
|
|
36
|
-
const { _value } = this.state;
|
|
37
|
-
const {
|
|
38
|
-
customStyle,
|
|
39
|
-
className,
|
|
40
|
-
min,
|
|
41
|
-
max,
|
|
42
|
-
step,
|
|
43
|
-
disabled,
|
|
44
|
-
activeColor,
|
|
45
|
-
backgroundColor,
|
|
46
|
-
blockSize,
|
|
47
|
-
blockColor,
|
|
48
|
-
showValue
|
|
49
|
-
} = this.props;
|
|
50
|
-
return /* @__PURE__ */ React.createElement(
|
|
51
|
-
View,
|
|
52
|
-
{
|
|
53
|
-
className: classNames(
|
|
54
|
-
{
|
|
55
|
-
"at-slider": true,
|
|
56
|
-
"at-slider--disabled": disabled
|
|
57
|
-
},
|
|
58
|
-
className
|
|
59
|
-
),
|
|
60
|
-
style: customStyle
|
|
61
|
-
},
|
|
62
|
-
/* @__PURE__ */ React.createElement(View, { className: "at-slider__inner" }, /* @__PURE__ */ React.createElement(
|
|
63
|
-
Slider,
|
|
64
|
-
{
|
|
65
|
-
min,
|
|
66
|
-
max,
|
|
67
|
-
step,
|
|
68
|
-
value: _value,
|
|
69
|
-
disabled,
|
|
70
|
-
activeColor,
|
|
71
|
-
backgroundColor,
|
|
72
|
-
blockSize,
|
|
73
|
-
blockColor,
|
|
74
|
-
onChanging: this.handleChanging.bind(this),
|
|
75
|
-
onChange: this.handleChange.bind(this)
|
|
76
|
-
}
|
|
77
|
-
)),
|
|
78
|
-
showValue && /* @__PURE__ */ React.createElement(View, { className: "at-slider__text" }, `${_value}`)
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
AtSlider.defaultProps = {
|
|
83
|
-
customStyle: "",
|
|
84
|
-
className: "",
|
|
85
|
-
min: 0,
|
|
86
|
-
max: 100,
|
|
87
|
-
step: 1,
|
|
88
|
-
value: 0,
|
|
89
|
-
disabled: false,
|
|
90
|
-
activeColor: "#6190e8",
|
|
91
|
-
backgroundColor: "#e9e9e9",
|
|
92
|
-
blockSize: 28,
|
|
93
|
-
blockColor: "#ffffff",
|
|
94
|
-
showValue: false
|
|
95
|
-
};
|
|
96
|
-
AtSlider.propTypes = {
|
|
97
|
-
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
98
|
-
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
99
|
-
min: PropTypes.number,
|
|
100
|
-
max: PropTypes.number,
|
|
101
|
-
step: PropTypes.number,
|
|
102
|
-
value: PropTypes.number,
|
|
103
|
-
disabled: PropTypes.bool,
|
|
104
|
-
activeColor: PropTypes.string,
|
|
105
|
-
backgroundColor: PropTypes.string,
|
|
106
|
-
blockSize: PropTypes.number,
|
|
107
|
-
blockColor: PropTypes.string,
|
|
108
|
-
showValue: PropTypes.bool,
|
|
109
|
-
onChange: PropTypes.func,
|
|
110
|
-
onChanging: PropTypes.func
|
|
111
|
-
};
|
|
112
|
-
export {
|
|
113
|
-
AtSlider as default
|
|
114
|
-
};
|
|
115
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/slider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Slider, View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtSliderProps, AtSliderState } from '../../../types/slider'\n\nexport default class AtSlider extends React.Component<\n AtSliderProps,\n AtSliderState\n> {\n public static defaultProps: AtSliderProps\n public static propTypes: InferProps<AtSliderProps>\n\n public constructor(props: AtSliderProps) {\n super(props)\n const { value = 0, min = 0, max = 100 } = props\n this.state = {\n _value: AtSlider.clampNumber(value, min, max)\n }\n }\n\n protected static clampNumber(\n value: number,\n lower: number,\n upper: number\n ): number {\n return Math.max(lower, Math.min(upper, value))\n }\n\n private handleChanging(e: CommonEvent): void {\n const { _value } = this.state\n const { value }: { value: number } = e.detail\n\n if (value !== _value) {\n this.setState({ _value: value })\n }\n this.props.onChanging && this.props.onChanging(value)\n }\n\n private handleChange(e: CommonEvent): void {\n const { value } = e.detail\n\n this.setState({ _value: value })\n this.props.onChange && this.props.onChange(value)\n }\n\n public UNSAFE_componentWillReceiveProps(props: AtSliderProps): void {\n const { value = 0, min = 0, max = 100 } = props\n this.setState({\n _value: AtSlider.clampNumber(value, min, max)\n })\n }\n\n public render(): JSX.Element {\n const { _value } = this.state\n const {\n customStyle,\n className,\n min,\n max,\n step,\n disabled,\n activeColor,\n backgroundColor,\n blockSize,\n blockColor,\n showValue\n } = this.props\n\n return (\n <View\n className={classNames(\n {\n 'at-slider': true,\n 'at-slider--disabled': disabled\n },\n className\n )}\n style={customStyle}\n >\n <View className='at-slider__inner'>\n <Slider\n min={min}\n max={max}\n step={step}\n value={_value}\n disabled={disabled}\n activeColor={activeColor}\n backgroundColor={backgroundColor}\n blockSize={blockSize}\n blockColor={blockColor}\n onChanging={this.handleChanging.bind(this)}\n onChange={this.handleChange.bind(this)}\n ></Slider>\n </View>\n {showValue && <View className='at-slider__text'>{`${_value}`}</View>}\n </View>\n )\n }\n}\n\nAtSlider.defaultProps = {\n customStyle: '',\n className: '',\n min: 0,\n max: 100,\n step: 1,\n value: 0,\n disabled: false,\n activeColor: '#6190e8',\n backgroundColor: '#e9e9e9',\n blockSize: 28,\n blockColor: '#ffffff',\n showValue: false\n}\n\nAtSlider.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n min: PropTypes.number,\n max: PropTypes.number,\n step: PropTypes.number,\n value: PropTypes.number,\n disabled: PropTypes.bool,\n activeColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n blockSize: PropTypes.number,\n blockColor: PropTypes.string,\n showValue: PropTypes.bool,\n onChange: PropTypes.func,\n onChanging: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,QAAQ,YAAY;AAI7B,MAAO,iBAA+B,MAAM,UAG1C;AAAA,EAIO,YAAY,OAAsB;AACvC,UAAM,KAAK;AACX,UAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,IAAI,IAAI;AAC1C,SAAK,QAAQ;AAAA,MACX,QAAQ,SAAS,YAAY,OAAO,KAAK,GAAG;AAAA,IAC9C;AAAA,EACF;AAAA,EAEA,OAAiB,YACf,OACA,OACA,OACQ;AACR,WAAO,KAAK,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC;AAAA,EAC/C;AAAA,EAEQ,eAAe,GAAsB;AAC3C,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,UAAM,EAAE,MAAM,IAAuB,EAAE;AAEvC,QAAI,UAAU,QAAQ;AACpB,WAAK,SAAS,EAAE,QAAQ,MAAM,CAAC;AAAA,IACjC;AACA,SAAK,MAAM,cAAc,KAAK,MAAM,WAAW,KAAK;AAAA,EACtD;AAAA,EAEQ,aAAa,GAAsB;AACzC,UAAM,EAAE,MAAM,IAAI,EAAE;AAEpB,SAAK,SAAS,EAAE,QAAQ,MAAM,CAAC;AAC/B,SAAK,MAAM,YAAY,KAAK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Q,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,KAAK,UAAU;AAAA,EACf,KAAK,UAAU;AAAA,EACf,MAAM,UAAU;AAAA,EAChB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,aAAa,UAAU;AAAA,EACvB,iBAAiB,UAAU;AAAA,EAC3B,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AACxB;","names":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InferProps } from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { AtStepsProps } from '../../../types/steps';
|
|
4
|
-
export default class AtSteps extends React.Component<AtStepsProps> {
|
|
5
|
-
static defaultProps: AtStepsProps;
|
|
6
|
-
static propTypes: InferProps<AtStepsProps>;
|
|
7
|
-
private handleClick;
|
|
8
|
-
render(): JSX.Element;
|
|
9
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Text, View } from "@tarojs/components";
|
|
5
|
-
class AtSteps extends React.Component {
|
|
6
|
-
handleClick(current, event) {
|
|
7
|
-
this.props.onChange(current, event);
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
const { customStyle, className, items, current } = this.props;
|
|
11
|
-
return /* @__PURE__ */ React.createElement(View, { className: classNames("at-steps", className), style: customStyle }, !!items && items.map((item, i) => /* @__PURE__ */ React.createElement(
|
|
12
|
-
View,
|
|
13
|
-
{
|
|
14
|
-
key: item.title,
|
|
15
|
-
className: classNames({
|
|
16
|
-
"at-steps__item": true,
|
|
17
|
-
"at-steps__item--active": i === current,
|
|
18
|
-
"at-steps__item--inactive": i !== current
|
|
19
|
-
}),
|
|
20
|
-
onClick: this.handleClick.bind(this, i)
|
|
21
|
-
},
|
|
22
|
-
/* @__PURE__ */ React.createElement(View, { className: "at-steps__circular-wrap" }, i !== 0 && /* @__PURE__ */ React.createElement(View, { className: "at-steps__left-line" }), item.status ? /* @__PURE__ */ React.createElement(
|
|
23
|
-
View,
|
|
24
|
-
{
|
|
25
|
-
className: classNames({
|
|
26
|
-
"at-icon": true,
|
|
27
|
-
"at-icon-check-circle": item.status === "success",
|
|
28
|
-
"at-icon-close-circle": item.status === "error",
|
|
29
|
-
"at-steps__single-icon": true,
|
|
30
|
-
"at-steps__single-icon--success": item.status === "success",
|
|
31
|
-
"at-steps__single-icon--error": item.status === "error"
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
) : /* @__PURE__ */ React.createElement(View, { className: "at-steps__circular" }, item.icon ? /* @__PURE__ */ React.createElement(
|
|
35
|
-
Text,
|
|
36
|
-
{
|
|
37
|
-
className: classNames("at-icon", {
|
|
38
|
-
[`at-icon-${item.icon.value}`]: item.icon.value,
|
|
39
|
-
"at-steps__circle-icon": true
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
) : /* @__PURE__ */ React.createElement(Text, { className: "at-steps__num" }, i + 1)), i !== items.length - 1 && /* @__PURE__ */ React.createElement(View, { className: "at-steps__right-line" })),
|
|
43
|
-
/* @__PURE__ */ React.createElement(View, { className: "at-steps__title" }, item.title),
|
|
44
|
-
/* @__PURE__ */ React.createElement(View, { className: "at-steps__desc" }, item.desc)
|
|
45
|
-
)));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
AtSteps.defaultProps = {
|
|
49
|
-
customStyle: "",
|
|
50
|
-
className: "",
|
|
51
|
-
current: 0,
|
|
52
|
-
items: [],
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
54
|
-
onChange: () => {
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
AtSteps.propTypes = {
|
|
58
|
-
customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
59
|
-
className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
60
|
-
current: PropTypes.number,
|
|
61
|
-
items: PropTypes.array,
|
|
62
|
-
onChange: PropTypes.func
|
|
63
|
-
};
|
|
64
|
-
export {
|
|
65
|
-
AtSteps as default
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/steps/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Text, View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtStepsProps } from '../../../types/steps'\n\nexport default class AtSteps extends React.Component<AtStepsProps> {\n public static defaultProps: AtStepsProps\n public static propTypes: InferProps<AtStepsProps>\n\n private handleClick(current: number, event: CommonEvent): void {\n this.props.onChange(current, event)\n }\n\n public render(): JSX.Element {\n const { customStyle, className, items, current } = this.props\n\n return (\n <View className={classNames('at-steps', className)} style={customStyle}>\n {!!items &&\n items.map((item, i) => (\n <View\n key={item.title}\n className={classNames({\n 'at-steps__item': true,\n 'at-steps__item--active': i === current,\n 'at-steps__item--inactive': i !== current\n })}\n onClick={this.handleClick.bind(this, i)}\n >\n <View className='at-steps__circular-wrap'>\n {i !== 0 && <View className='at-steps__left-line'></View>}\n {item.status ? (\n <View\n className={classNames({\n 'at-icon': true,\n 'at-icon-check-circle': item.status === 'success',\n 'at-icon-close-circle': item.status === 'error',\n 'at-steps__single-icon': true,\n 'at-steps__single-icon--success':\n item.status === 'success',\n 'at-steps__single-icon--error': item.status === 'error'\n })}\n ></View>\n ) : (\n <View className='at-steps__circular'>\n {item.icon ? (\n <Text\n className={classNames('at-icon', {\n [`at-icon-${item.icon.value}`]: item.icon.value,\n 'at-steps__circle-icon': true\n })}\n ></Text>\n ) : (\n <Text className='at-steps__num'>{i + 1}</Text>\n )}\n </View>\n )}\n {i !== items.length - 1 && (\n <View className='at-steps__right-line'></View>\n )}\n </View>\n <View className='at-steps__title'>{item.title}</View>\n <View className='at-steps__desc'>{item.desc}</View>\n </View>\n ))}\n </View>\n )\n }\n}\n\nAtSteps.defaultProps = {\n customStyle: '',\n className: '',\n current: 0,\n items: [],\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange: (): void => {}\n}\n\nAtSteps.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n current: PropTypes.number,\n items: PropTypes.array,\n onChange: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,MAAM,YAAY;AAI3B,MAAO,gBAA8B,MAAM,UAAwB;AAAA,EAIzD,YAAY,SAAiB,OAA0B;AAC7D,SAAK,MAAM,SAAS,SAAS,KAAK;AAAA,EACpC;AAAA,EAEO,SAAsB;AAC3B,UAAM,EAAE,aAAa,WAAW,OAAO,QAAQ,IAAI,KAAK;AAExD,WACE,oCAAC,QAAK,WAAW,WAAW,YAAY,SAAS,GAAG,OAAO,eACxD,CAAC,CAAC,SACD,MAAM,IAAI,CAAC,MAAM,MACf;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,KAAK;AAAA,QACV,WAAW,WAAW;AAAA,UACpB,kBAAkB;AAAA,UAClB,0BAA0B,MAAM;AAAA,UAChC,4BAA4B,MAAM;AAAA,QACpC,CAAC;AAAA,QACD,SAAS,KAAK,YAAY,KAAK,MAAM,CAAC;AAAA;AAAA,MAEtC,oCAAC,QAAK,WAAU,6BACb,MAAM,KAAK,oCAAC,QAAK,WAAU,uBAAsB,GACjD,KAAK,SACJ;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,WAAW;AAAA,YACpB,WAAW;AAAA,YACX,wBAAwB,KAAK,WAAW;AAAA,YACxC,wBAAwB,KAAK,WAAW;AAAA,YACxC,yBAAyB;AAAA,YACzB,kCACE,KAAK,WAAW;AAAA,YAClB,gCAAgC,KAAK,WAAW;AAAA,UAClD,CAAC;AAAA;AAAA,MACF,IAED,oCAAC,QAAK,WAAU,wBACb,KAAK,OACJ;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,WAAW,WAAW;AAAA,YAC/B,CAAC,WAAW,KAAK,KAAK,KAAK,EAAE,GAAG,KAAK,KAAK;AAAA,YAC1C,yBAAyB;AAAA,UAC3B,CAAC;AAAA;AAAA,MACF,IAED,oCAAC,QAAK,WAAU,mBAAiB,IAAI,CAAE,CAE3C,GAED,MAAM,MAAM,SAAS,KACpB,oCAAC,QAAK,WAAU,wBAAuB,CAE3C;AAAA,MACA,oCAAC,QAAK,WAAU,qBAAmB,KAAK,KAAM;AAAA,MAC9C,oCAAC,QAAK,WAAU,oBAAkB,KAAK,IAAK;AAAA,IAC9C,CACD,CACL;AAAA,EAEJ;AACF;AAEA,QAAQ,eAAe;AAAA,EACrB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO,CAAC;AAAA;AAAA,EAER,UAAU,MAAY;AAAA,EAAC;AACzB;AAEA,QAAQ,YAAY;AAAA,EAClB,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,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AACtB;","names":[]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { InferProps } from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { AtSwipeActionProps, AtSwipeActionState } from '../../../types/swipe-action';
|
|
4
|
-
export default class AtSwipeAction extends React.Component<AtSwipeActionProps, AtSwipeActionState> {
|
|
5
|
-
static defaultProps: AtSwipeActionProps;
|
|
6
|
-
static propTypes: InferProps<AtSwipeActionProps>;
|
|
7
|
-
private moveX;
|
|
8
|
-
constructor(props: AtSwipeActionProps);
|
|
9
|
-
componentDidMount(): void;
|
|
10
|
-
componentDidUpdate(_: any, prevState: AtSwipeActionState): void;
|
|
11
|
-
UNSAFE_componentWillReceiveProps(nextProps: AtSwipeActionProps): void;
|
|
12
|
-
/**
|
|
13
|
-
* 获取滑动区域宽度
|
|
14
|
-
*/
|
|
15
|
-
private getAreaWidth;
|
|
16
|
-
/**
|
|
17
|
-
* 获取最大偏移量
|
|
18
|
-
*/
|
|
19
|
-
private getMaxOffsetSize;
|
|
20
|
-
private _reset;
|
|
21
|
-
private handleOpened;
|
|
22
|
-
private handleClosed;
|
|
23
|
-
private handleClick;
|
|
24
|
-
onTouchEnd: (e: any) => void;
|
|
25
|
-
onChange: (e: any) => void;
|
|
26
|
-
render(): JSX.Element;
|
|
27
|
-
}
|