@arco-design/mobile-react 2.38.4 → 2.39.1
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/CHANGELOG.md +24 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.js +59 -141
- package/cjs/_helpers/index.js +2 -18
- package/cjs/_helpers/react-dom.js +0 -14
- package/cjs/_helpers/render.js +5 -21
- package/cjs/action-sheet/index.js +10 -30
- package/cjs/action-sheet/methods.js +0 -2
- package/cjs/action-sheet/style/css/index.js +0 -2
- package/cjs/action-sheet/style/index.js +0 -2
- package/cjs/avatar/group.js +12 -24
- package/cjs/avatar/index.js +53 -79
- package/cjs/avatar/style/css/index.js +0 -2
- package/cjs/avatar/style/index.js +0 -2
- package/cjs/badge/index.js +18 -29
- package/cjs/badge/style/css/index.js +0 -1
- package/cjs/badge/style/index.js +0 -1
- package/cjs/button/hooks.js +15 -20
- package/cjs/button/index.js +46 -67
- package/cjs/button/style/css/index.js +0 -2
- package/cjs/button/style/index.js +0 -2
- package/cjs/carousel/index.js +153 -288
- package/cjs/carousel/style/css/index.js +0 -1
- package/cjs/carousel/style/index.js +0 -1
- package/cjs/cell/arrow.js +0 -3
- package/cjs/cell/cell.js +18 -34
- package/cjs/cell/group.js +9 -21
- package/cjs/cell/index.js +1 -7
- package/cjs/cell/style/css/index.js +0 -1
- package/cjs/cell/style/index.js +0 -1
- package/cjs/checkbox/checkbox.js +31 -57
- package/cjs/checkbox/group.js +24 -38
- package/cjs/checkbox/hooks/index.js +0 -2
- package/cjs/checkbox/hooks/useMergeProps.js +7 -14
- package/cjs/checkbox/index.js +1 -8
- package/cjs/checkbox/style/css/index.js +0 -1
- package/cjs/checkbox/style/index.js +0 -1
- package/cjs/checkbox/type.js +0 -2
- package/cjs/circle-progress/index.js +37 -57
- package/cjs/circle-progress/style/css/index.js +0 -1
- package/cjs/circle-progress/style/index.js +0 -1
- package/cjs/collapse/collapse.js +30 -61
- package/cjs/collapse/group.js +20 -44
- package/cjs/collapse/index.js +0 -9
- package/cjs/collapse/style/css/index.js +0 -1
- package/cjs/collapse/style/index.js +0 -1
- package/cjs/collapse/utils.js +0 -7
- package/cjs/context-provider/index.js +18 -43
- package/cjs/context-provider/style/css/index.js +0 -1
- package/cjs/context-provider/style/index.js +0 -1
- package/cjs/count-down/hooks.js +24 -43
- package/cjs/count-down/index.js +29 -37
- package/cjs/count-down/singleton.js +2 -12
- package/cjs/count-down/style/css/index.js +0 -1
- package/cjs/count-down/style/index.js +0 -1
- package/cjs/count-down/util.js +33 -47
- package/cjs/date-picker/helper.js +7 -14
- package/cjs/date-picker/index.js +66 -167
- package/cjs/date-picker/style/css/index.js +0 -2
- package/cjs/date-picker/style/index.js +0 -2
- package/cjs/dialog/index.js +31 -57
- package/cjs/dialog/methods.js +9 -22
- package/cjs/dialog/style/css/index.js +0 -2
- package/cjs/dialog/style/index.js +0 -2
- package/cjs/divider/index.js +8 -20
- package/cjs/divider/style/css/index.js +0 -1
- package/cjs/divider/style/index.js +0 -1
- package/cjs/dropdown/dropdown.js +74 -113
- package/cjs/dropdown/index.js +1 -8
- package/cjs/dropdown/options.js +12 -28
- package/cjs/dropdown/style/css/index.js +0 -1
- package/cjs/dropdown/style/index.js +0 -1
- package/cjs/dropdown-menu/dropdown-menu.js +49 -84
- package/cjs/dropdown-menu/helper.js +4 -24
- package/cjs/dropdown-menu/index.js +0 -6
- package/cjs/dropdown-menu/style/css/index.js +0 -2
- package/cjs/dropdown-menu/style/index.js +0 -2
- package/cjs/ellipsis/components/js-ellipsis.js +32 -70
- package/cjs/ellipsis/components/native-ellipsis.js +9 -14
- package/cjs/ellipsis/index.js +19 -32
- package/cjs/ellipsis/style/css/index.js +0 -1
- package/cjs/ellipsis/style/index.js +0 -1
- package/cjs/ellipsis/utils/dom.js +0 -8
- package/cjs/ellipsis/utils/is.js +1 -5
- package/cjs/form/form-item-context.js +0 -5
- package/cjs/form/form-item.js +74 -163
- package/cjs/form/index.js +18 -38
- package/cjs/form/linked-container.js +5 -24
- package/cjs/form/style/css/index.js +0 -1
- package/cjs/form/style/index.js +0 -1
- package/cjs/form/type.d.ts +11 -1
- package/cjs/form/type.js +0 -5
- package/cjs/form/useForm.js +10 -79
- package/cjs/form/utils.js +4 -22
- package/cjs/grid/index.js +22 -45
- package/cjs/grid/style/css/index.js +0 -1
- package/cjs/grid/style/index.js +0 -1
- package/cjs/icon/IconAdd/index.js +5 -12
- package/cjs/icon/IconArrowBack/index.js +5 -12
- package/cjs/icon/IconArrowDown/index.js +5 -12
- package/cjs/icon/IconArrowIn/index.js +5 -12
- package/cjs/icon/IconArrowUp/index.js +5 -12
- package/cjs/icon/IconCheck/index.js +5 -12
- package/cjs/icon/IconCheckBold/index.js +5 -12
- package/cjs/icon/IconCircleChecked/index.js +5 -12
- package/cjs/icon/IconCircleDisabled/index.js +5 -12
- package/cjs/icon/IconCircleUnchecked/index.js +5 -12
- package/cjs/icon/IconClear/index.js +5 -12
- package/cjs/icon/IconClose/index.js +5 -12
- package/cjs/icon/IconCloseBold/index.js +5 -12
- package/cjs/icon/IconDelete/index.js +5 -12
- package/cjs/icon/IconDownload/index.js +5 -12
- package/cjs/icon/IconEdit/index.js +5 -12
- package/cjs/icon/IconErrorCircle/index.js +5 -12
- package/cjs/icon/IconEyeInvisible/index.js +5 -12
- package/cjs/icon/IconEyeVisible/index.js +5 -12
- package/cjs/icon/IconEyelashInvisible/index.js +5 -12
- package/cjs/icon/IconFile/index.js +5 -12
- package/cjs/icon/IconGift/index.js +5 -12
- package/cjs/icon/IconHeart/index.js +5 -12
- package/cjs/icon/IconHome/index.js +5 -12
- package/cjs/icon/IconKeyboard/index.js +5 -12
- package/cjs/icon/IconKeyboardDelete/index.js +5 -12
- package/cjs/icon/IconLikeCircle/index.js +5 -12
- package/cjs/icon/IconMinus/index.js +5 -12
- package/cjs/icon/IconMore/index.js +5 -12
- package/cjs/icon/IconNotice/index.js +5 -12
- package/cjs/icon/IconNoticeOff/index.js +5 -12
- package/cjs/icon/IconPicture/index.js +5 -12
- package/cjs/icon/IconPlay/index.js +5 -12
- package/cjs/icon/IconQuestionCircle/index.js +5 -12
- package/cjs/icon/IconRefresh/index.js +5 -12
- package/cjs/icon/IconSad/index.js +5 -12
- package/cjs/icon/IconScan/index.js +5 -12
- package/cjs/icon/IconSearch/index.js +5 -12
- package/cjs/icon/IconSetting/index.js +5 -12
- package/cjs/icon/IconShop/index.js +5 -12
- package/cjs/icon/IconShopping/index.js +5 -12
- package/cjs/icon/IconSmileFill/index.js +5 -12
- package/cjs/icon/IconSound/index.js +5 -12
- package/cjs/icon/IconSquareChecked/index.js +5 -12
- package/cjs/icon/IconSquareDisabled/index.js +5 -12
- package/cjs/icon/IconSquareUnchecked/index.js +5 -12
- package/cjs/icon/IconStar/index.js +5 -12
- package/cjs/icon/IconStarFill/index.js +5 -12
- package/cjs/icon/IconStarHalf/index.js +5 -12
- package/cjs/icon/IconSubway/index.js +5 -12
- package/cjs/icon/IconSuccessCircle/index.js +5 -12
- package/cjs/icon/IconTriDown/index.js +5 -12
- package/cjs/icon/IconTriUp/index.js +5 -12
- package/cjs/icon/IconUpload/index.js +5 -12
- package/cjs/icon/IconUser/index.js +5 -12
- package/cjs/icon/IconUserFill/index.js +5 -12
- package/cjs/icon/IconWarnCircle/index.js +5 -12
- package/cjs/icon/IconWarnCircleFill/index.js +5 -12
- package/cjs/icon/index.js +0 -119
- package/cjs/image/index.js +53 -94
- package/cjs/image/style/css/index.js +0 -2
- package/cjs/image/style/index.js +0 -2
- package/cjs/image-picker/add-icon.js +0 -3
- package/cjs/image-picker/index.js +32 -59
- package/cjs/image-picker/style/css/index.js +0 -3
- package/cjs/image-picker/style/index.js +0 -3
- package/cjs/image-preview/index.js +129 -254
- package/cjs/image-preview/methods.js +5 -18
- package/cjs/image-preview/style/css/index.js +0 -4
- package/cjs/image-preview/style/index.js +0 -4
- package/cjs/index-bar/context.js +0 -2
- package/cjs/index-bar/group.js +16 -35
- package/cjs/index-bar/index.js +55 -87
- package/cjs/index-bar/side-bar.js +15 -34
- package/cjs/index-bar/style/css/index.js +0 -2
- package/cjs/index-bar/style/index.js +0 -2
- package/cjs/index-bar/utils.js +3 -17
- package/cjs/index.js +0 -119
- package/cjs/input/hooks.js +45 -84
- package/cjs/input/index.js +26 -40
- package/cjs/input/style/css/index.js +0 -1
- package/cjs/input/style/index.js +0 -1
- package/cjs/keyboard/index.js +37 -73
- package/cjs/keyboard/style/css/index.js +0 -2
- package/cjs/keyboard/style/index.js +0 -2
- package/cjs/load-more/index.js +33 -65
- package/cjs/load-more/style/css/index.js +0 -1
- package/cjs/load-more/style/index.js +0 -1
- package/cjs/loading/index.js +19 -48
- package/cjs/loading/style/css/index.js +0 -1
- package/cjs/loading/style/index.js +0 -1
- package/cjs/masking/index.js +47 -80
- package/cjs/masking/methods.js +5 -21
- package/cjs/masking/style/css/index.js +0 -2
- package/cjs/masking/style/index.js +0 -2
- package/cjs/nav-bar/back-icon.js +2 -8
- package/cjs/nav-bar/index.js +37 -61
- package/cjs/nav-bar/style/css/index.js +0 -1
- package/cjs/nav-bar/style/index.js +0 -1
- package/cjs/notice-bar/index.js +34 -60
- package/cjs/notice-bar/style/css/index.js +0 -1
- package/cjs/notice-bar/style/index.js +0 -1
- package/cjs/notify/index.js +20 -49
- package/cjs/notify/methods.js +2 -17
- package/cjs/notify/style/css/index.js +0 -1
- package/cjs/notify/style/index.js +0 -1
- package/cjs/pagination/arrow.js +0 -3
- package/cjs/pagination/index.js +27 -58
- package/cjs/pagination/style/css/index.js +0 -1
- package/cjs/pagination/style/index.js +0 -1
- package/cjs/picker/index.js +48 -84
- package/cjs/picker/style/css/index.js +0 -3
- package/cjs/picker/style/index.js +0 -3
- package/cjs/picker-view/components/cascader.js +13 -32
- package/cjs/picker-view/components/multi-picker.js +8 -17
- package/cjs/picker-view/components/picker-cell.js +45 -101
- package/cjs/picker-view/index.js +30 -76
- package/cjs/picker-view/style/css/index.js +0 -1
- package/cjs/picker-view/style/index.js +0 -1
- package/cjs/popover/hooks/index.js +0 -4
- package/cjs/popover/hooks/useEvent.js +25 -49
- package/cjs/popover/hooks/usePosition.js +100 -159
- package/cjs/popover/index.js +1 -8
- package/cjs/popover/menu.js +32 -52
- package/cjs/popover/popover-inner.js +30 -48
- package/cjs/popover/popover.js +69 -101
- package/cjs/popover/style/css/index.js +0 -2
- package/cjs/popover/style/index.js +0 -2
- package/cjs/popup/index.js +22 -39
- package/cjs/popup/methods.js +0 -2
- package/cjs/popup/style/css/index.js +0 -2
- package/cjs/popup/style/index.js +0 -2
- package/cjs/popup-swiper/index.js +50 -92
- package/cjs/popup-swiper/methods.js +0 -2
- package/cjs/popup-swiper/style/css/index.js +0 -2
- package/cjs/popup-swiper/style/index.js +0 -2
- package/cjs/portal/index.js +3 -8
- package/cjs/portal/style/css/index.js +0 -1
- package/cjs/portal/style/index.js +0 -1
- package/cjs/progress/index.js +27 -44
- package/cjs/progress/style/css/index.js +0 -1
- package/cjs/progress/style/index.js +0 -1
- package/cjs/pull-refresh/android-pull-refresh.js +56 -95
- package/cjs/pull-refresh/hooks.js +11 -32
- package/cjs/pull-refresh/index.js +3 -14
- package/cjs/pull-refresh/ios-pull-refresh.js +53 -81
- package/cjs/pull-refresh/model.js +0 -1
- package/cjs/pull-refresh/style/css/index.js +0 -2
- package/cjs/pull-refresh/style/index.js +0 -2
- package/cjs/radio/group.js +20 -34
- package/cjs/radio/index.js +1 -8
- package/cjs/radio/radio.js +0 -10
- package/cjs/radio/style/css/index.js +0 -1
- package/cjs/radio/style/index.js +0 -1
- package/cjs/rate/index.js +28 -54
- package/cjs/rate/style/css/index.js +0 -1
- package/cjs/rate/style/index.js +0 -1
- package/cjs/search-bar/association.js +14 -32
- package/cjs/search-bar/cancel-button.js +8 -16
- package/cjs/search-bar/highlight.js +14 -25
- package/cjs/search-bar/index.js +77 -97
- package/cjs/search-bar/style/css/index.js +0 -1
- package/cjs/search-bar/style/index.js +0 -1
- package/cjs/show-monitor/index.js +40 -108
- package/cjs/show-monitor/style/css/index.js +0 -1
- package/cjs/show-monitor/style/index.js +0 -1
- package/cjs/skeleton/elements.js +47 -84
- package/cjs/skeleton/index.js +18 -36
- package/cjs/skeleton/skeleton-context.js +0 -4
- package/cjs/skeleton/style/css/index.js +0 -2
- package/cjs/skeleton/style/index.js +0 -2
- package/cjs/slider/hooks/index.js +0 -13
- package/cjs/slider/hooks/useSliderEvents.js +27 -59
- package/cjs/slider/hooks/useSliderIcon.js +6 -20
- package/cjs/slider/hooks/useSliderInit.js +32 -52
- package/cjs/slider/hooks/useSliderStyle.js +13 -27
- package/cjs/slider/index.js +47 -73
- package/cjs/slider/marks.js +13 -27
- package/cjs/slider/popover.js +4 -13
- package/cjs/slider/style/css/index.js +0 -2
- package/cjs/slider/style/index.js +0 -2
- package/cjs/slider/thumb.js +11 -22
- package/cjs/stepper/hooks/useButtonClick.js +15 -25
- package/cjs/stepper/hooks/useInputEvent.js +10 -19
- package/cjs/stepper/hooks/useValue.js +9 -15
- package/cjs/stepper/index.js +84 -98
- package/cjs/stepper/style/css/index.js +0 -1
- package/cjs/stepper/style/index.js +0 -1
- package/cjs/steps/index.js +25 -43
- package/cjs/steps/step.js +10 -27
- package/cjs/steps/style/css/index.js +0 -1
- package/cjs/steps/style/index.js +0 -1
- package/cjs/sticky/index.js +40 -74
- package/cjs/sticky/style/css/index.js +0 -1
- package/cjs/sticky/style/index.js +0 -1
- package/cjs/style.js +0 -59
- package/cjs/swipe-action/index.js +40 -92
- package/cjs/swipe-action/item.js +9 -17
- package/cjs/swipe-action/style/css/index.js +0 -1
- package/cjs/swipe-action/style/index.js +0 -1
- package/cjs/swipe-load/index.js +78 -113
- package/cjs/swipe-load/style/css/index.js +0 -1
- package/cjs/swipe-load/style/index.js +0 -1
- package/cjs/switch/index.js +28 -49
- package/cjs/switch/style/css/index.js +0 -1
- package/cjs/switch/style/index.js +0 -1
- package/cjs/tab-bar/index.js +0 -7
- package/cjs/tab-bar/item.js +6 -24
- package/cjs/tab-bar/style/css/index.js +0 -1
- package/cjs/tab-bar/style/index.js +0 -1
- package/cjs/tab-bar/tab-bar.js +16 -32
- package/cjs/tabs/index.js +136 -206
- package/cjs/tabs/style/css/index.js +0 -1
- package/cjs/tabs/style/index.js +0 -1
- package/cjs/tabs/tab-cell-underline.js +28 -76
- package/cjs/tabs/tab-cell.js +73 -128
- package/cjs/tabs/tab-pane.js +53 -103
- package/cjs/tag/index.js +1 -8
- package/cjs/tag/list.js +11 -26
- package/cjs/tag/style/css/index.js +0 -1
- package/cjs/tag/style/index.js +0 -1
- package/cjs/tag/tag.js +20 -32
- package/cjs/textarea/index.js +35 -56
- package/cjs/textarea/style/css/index.js +0 -2
- package/cjs/textarea/style/index.js +0 -2
- package/cjs/toast/index.js +26 -61
- package/cjs/toast/methods.js +2 -16
- package/cjs/toast/style/css/index.js +0 -3
- package/cjs/toast/style/index.js +0 -3
- package/cjs/transition/index.js +17 -29
- package/cjs/transition/style/css/index.js +0 -1
- package/cjs/transition/style/index.js +0 -1
- package/cjs/uploader/index.d.ts +1 -1
- package/cjs/uploader/index.js +28 -49
- package/cjs/uploader/style/css/index.js +0 -3
- package/cjs/uploader/style/index.js +0 -3
- package/cjs/uploader/upload/index.js +0 -4
- package/cjs/uploader/upload/upload.js +9 -45
- package/dist/index.js +3838 -6455
- package/dist/index.min.js +2 -2
- package/esm/_helpers/hooks.js +59 -123
- package/esm/_helpers/index.js +4 -6
- package/esm/_helpers/react-dom.js +0 -11
- package/esm/_helpers/render.js +5 -15
- package/esm/action-sheet/index.js +10 -16
- package/esm/avatar/group.js +12 -16
- package/esm/avatar/index.js +53 -64
- package/esm/badge/index.js +18 -22
- package/esm/button/hooks.js +15 -18
- package/esm/button/index.js +46 -57
- package/esm/carousel/index.js +153 -280
- package/esm/cell/cell.js +18 -25
- package/esm/cell/group.js +9 -11
- package/esm/cell/index.js +1 -1
- package/esm/checkbox/checkbox.js +31 -42
- package/esm/checkbox/group.js +24 -28
- package/esm/checkbox/hooks/useMergeProps.js +7 -9
- package/esm/checkbox/index.js +2 -2
- package/esm/checkbox/type.js +0 -1
- package/esm/circle-progress/index.js +37 -49
- package/esm/collapse/collapse.js +30 -51
- package/esm/collapse/group.js +20 -34
- package/esm/collapse/index.js +1 -1
- package/esm/collapse/utils.js +0 -1
- package/esm/context-provider/index.js +18 -33
- package/esm/count-down/hooks.js +24 -37
- package/esm/count-down/index.js +30 -29
- package/esm/count-down/singleton.js +2 -5
- package/esm/count-down/util.js +33 -42
- package/esm/date-picker/helper.js +7 -9
- package/esm/date-picker/index.js +66 -155
- package/esm/dialog/index.js +31 -42
- package/esm/dialog/methods.js +9 -11
- package/esm/divider/index.js +8 -12
- package/esm/dropdown/dropdown.js +74 -102
- package/esm/dropdown/index.js +1 -1
- package/esm/dropdown/options.js +12 -20
- package/esm/dropdown-menu/dropdown-menu.js +49 -74
- package/esm/dropdown-menu/helper.js +4 -14
- package/esm/dropdown-menu/index.js +1 -1
- package/esm/ellipsis/components/js-ellipsis.js +32 -60
- package/esm/ellipsis/components/native-ellipsis.js +9 -11
- package/esm/ellipsis/index.js +20 -21
- package/esm/ellipsis/utils/dom.js +0 -7
- package/esm/ellipsis/utils/is.js +1 -1
- package/esm/form/form-item.js +74 -147
- package/esm/form/index.js +18 -23
- package/esm/form/linked-container.js +5 -14
- package/esm/form/type.d.ts +11 -1
- package/esm/form/type.js +0 -5
- package/esm/form/useForm.js +10 -74
- package/esm/form/utils.js +4 -11
- package/esm/grid/index.js +22 -38
- package/esm/icon/IconAdd/index.js +5 -6
- package/esm/icon/IconArrowBack/index.js +5 -6
- package/esm/icon/IconArrowDown/index.js +5 -6
- package/esm/icon/IconArrowIn/index.js +5 -6
- package/esm/icon/IconArrowUp/index.js +5 -6
- package/esm/icon/IconCheck/index.js +5 -6
- package/esm/icon/IconCheckBold/index.js +5 -6
- package/esm/icon/IconCircleChecked/index.js +5 -6
- package/esm/icon/IconCircleDisabled/index.js +5 -6
- package/esm/icon/IconCircleUnchecked/index.js +5 -6
- package/esm/icon/IconClear/index.js +5 -6
- package/esm/icon/IconClose/index.js +5 -6
- package/esm/icon/IconCloseBold/index.js +5 -6
- package/esm/icon/IconDelete/index.js +5 -6
- package/esm/icon/IconDownload/index.js +5 -6
- package/esm/icon/IconEdit/index.js +5 -6
- package/esm/icon/IconErrorCircle/index.js +5 -6
- package/esm/icon/IconEyeInvisible/index.js +5 -6
- package/esm/icon/IconEyeVisible/index.js +5 -6
- package/esm/icon/IconEyelashInvisible/index.js +5 -6
- package/esm/icon/IconFile/index.js +5 -6
- package/esm/icon/IconGift/index.js +5 -6
- package/esm/icon/IconHeart/index.js +5 -6
- package/esm/icon/IconHome/index.js +5 -6
- package/esm/icon/IconKeyboard/index.js +5 -6
- package/esm/icon/IconKeyboardDelete/index.js +5 -6
- package/esm/icon/IconLikeCircle/index.js +5 -6
- package/esm/icon/IconMinus/index.js +5 -6
- package/esm/icon/IconMore/index.js +5 -6
- package/esm/icon/IconNotice/index.js +5 -6
- package/esm/icon/IconNoticeOff/index.js +5 -6
- package/esm/icon/IconPicture/index.js +5 -6
- package/esm/icon/IconPlay/index.js +5 -6
- package/esm/icon/IconQuestionCircle/index.js +5 -6
- package/esm/icon/IconRefresh/index.js +5 -6
- package/esm/icon/IconSad/index.js +5 -6
- package/esm/icon/IconScan/index.js +5 -6
- package/esm/icon/IconSearch/index.js +5 -6
- package/esm/icon/IconSetting/index.js +5 -6
- package/esm/icon/IconShop/index.js +5 -6
- package/esm/icon/IconShopping/index.js +5 -6
- package/esm/icon/IconSmileFill/index.js +5 -6
- package/esm/icon/IconSound/index.js +5 -6
- package/esm/icon/IconSquareChecked/index.js +5 -6
- package/esm/icon/IconSquareDisabled/index.js +5 -6
- package/esm/icon/IconSquareUnchecked/index.js +5 -6
- package/esm/icon/IconStar/index.js +5 -6
- package/esm/icon/IconStarFill/index.js +5 -6
- package/esm/icon/IconStarHalf/index.js +5 -6
- package/esm/icon/IconSubway/index.js +5 -6
- package/esm/icon/IconSuccessCircle/index.js +5 -6
- package/esm/icon/IconTriDown/index.js +5 -6
- package/esm/icon/IconTriUp/index.js +5 -6
- package/esm/icon/IconUpload/index.js +5 -6
- package/esm/icon/IconUser/index.js +5 -6
- package/esm/icon/IconUserFill/index.js +5 -6
- package/esm/icon/IconWarnCircle/index.js +5 -6
- package/esm/icon/IconWarnCircleFill/index.js +5 -6
- package/esm/image/index.js +53 -85
- package/esm/image-picker/index.js +32 -42
- package/esm/image-preview/index.js +129 -232
- package/esm/image-preview/methods.js +5 -14
- package/esm/index-bar/group.js +16 -25
- package/esm/index-bar/index.js +55 -74
- package/esm/index-bar/side-bar.js +15 -28
- package/esm/index-bar/utils.js +3 -10
- package/esm/input/hooks.js +45 -75
- package/esm/input/index.js +26 -30
- package/esm/keyboard/index.js +40 -63
- package/esm/load-more/index.js +33 -57
- package/esm/loading/index.js +19 -40
- package/esm/masking/index.js +47 -65
- package/esm/masking/methods.js +5 -16
- package/esm/nav-bar/back-icon.js +2 -4
- package/esm/nav-bar/index.js +37 -52
- package/esm/notice-bar/index.js +34 -53
- package/esm/notify/index.js +20 -33
- package/esm/notify/methods.js +2 -13
- package/esm/pagination/index.js +27 -50
- package/esm/picker/index.js +48 -69
- package/esm/picker-view/components/cascader.js +13 -24
- package/esm/picker-view/components/multi-picker.js +8 -14
- package/esm/picker-view/components/picker-cell.js +45 -93
- package/esm/picker-view/index.js +30 -60
- package/esm/popover/hooks/useEvent.js +26 -41
- package/esm/popover/hooks/usePosition.js +100 -152
- package/esm/popover/index.js +2 -2
- package/esm/popover/menu.js +32 -41
- package/esm/popover/popover-inner.js +30 -39
- package/esm/popover/popover.js +69 -90
- package/esm/popup/index.js +22 -25
- package/esm/popup-swiper/index.js +50 -76
- package/esm/portal/index.js +3 -5
- package/esm/progress/index.js +27 -36
- package/esm/pull-refresh/android-pull-refresh.js +56 -83
- package/esm/pull-refresh/hooks.js +11 -23
- package/esm/pull-refresh/index.js +3 -5
- package/esm/pull-refresh/ios-pull-refresh.js +53 -68
- package/esm/pull-refresh/model.js +0 -1
- package/esm/radio/group.js +20 -24
- package/esm/radio/index.js +2 -2
- package/esm/rate/index.js +28 -43
- package/esm/search-bar/association.js +14 -27
- package/esm/search-bar/cancel-button.js +8 -11
- package/esm/search-bar/highlight.js +14 -20
- package/esm/search-bar/index.js +77 -86
- package/esm/show-monitor/index.js +40 -100
- package/esm/skeleton/elements.js +47 -75
- package/esm/skeleton/index.js +18 -24
- package/esm/slider/hooks/useSliderEvents.js +27 -54
- package/esm/slider/hooks/useSliderIcon.js +6 -13
- package/esm/slider/hooks/useSliderInit.js +32 -46
- package/esm/slider/hooks/useSliderStyle.js +13 -22
- package/esm/slider/index.js +47 -63
- package/esm/slider/marks.js +13 -19
- package/esm/slider/popover.js +4 -6
- package/esm/slider/thumb.js +11 -16
- package/esm/stepper/hooks/useButtonClick.js +15 -24
- package/esm/stepper/hooks/useInputEvent.js +10 -17
- package/esm/stepper/hooks/useValue.js +9 -12
- package/esm/stepper/index.js +84 -84
- package/esm/steps/index.js +25 -30
- package/esm/steps/step.js +10 -19
- package/esm/sticky/index.js +40 -65
- package/esm/swipe-action/index.js +40 -80
- package/esm/swipe-action/item.js +9 -12
- package/esm/swipe-load/index.js +79 -104
- package/esm/switch/index.js +28 -41
- package/esm/tab-bar/index.js +0 -1
- package/esm/tab-bar/item.js +6 -13
- package/esm/tab-bar/tab-bar.js +16 -22
- package/esm/tabs/index.js +137 -194
- package/esm/tabs/tab-cell-underline.js +28 -67
- package/esm/tabs/tab-cell.js +73 -118
- package/esm/tabs/tab-pane.js +53 -95
- package/esm/tag/index.js +2 -2
- package/esm/tag/list.js +11 -16
- package/esm/tag/tag.js +20 -22
- package/esm/textarea/index.js +35 -46
- package/esm/toast/index.js +26 -42
- package/esm/toast/methods.js +2 -12
- package/esm/transition/index.js +17 -20
- package/esm/uploader/index.d.ts +1 -1
- package/esm/uploader/index.js +28 -34
- package/esm/uploader/upload/upload.js +9 -38
- package/esnext/form/form-item.js +12 -7
- package/esnext/form/type.d.ts +11 -1
- package/esnext/uploader/index.d.ts +1 -1
- package/esnext/uploader/index.js +1 -1
- package/esnext/uploader/upload/upload.js +1 -1
- package/package.json +5 -3
- package/tokens/app/arcodesign/default/index.js +0 -2
- package/umd/_helpers/hooks.js +59 -138
- package/umd/_helpers/index.js +2 -9
- package/umd/_helpers/react-dom.js +0 -13
- package/umd/_helpers/render.js +5 -17
- package/umd/action-sheet/index.js +10 -22
- package/umd/action-sheet/methods.js +0 -1
- package/umd/avatar/group.js +12 -20
- package/umd/avatar/index.js +53 -70
- package/umd/badge/index.js +18 -25
- package/umd/button/hooks.js +15 -19
- package/umd/button/index.js +46 -60
- package/umd/carousel/index.js +153 -283
- package/umd/cell/arrow.js +0 -2
- package/umd/cell/cell.js +18 -29
- package/umd/cell/group.js +9 -17
- package/umd/cell/index.js +1 -2
- package/umd/checkbox/checkbox.js +31 -45
- package/umd/checkbox/group.js +24 -34
- package/umd/checkbox/hooks/useMergeProps.js +7 -12
- package/umd/checkbox/index.js +1 -3
- package/umd/checkbox/type.js +0 -2
- package/umd/circle-progress/index.js +37 -52
- package/umd/collapse/collapse.js +30 -55
- package/umd/collapse/group.js +20 -38
- package/umd/collapse/index.js +0 -3
- package/umd/collapse/utils.js +0 -5
- package/umd/context-provider/index.js +18 -38
- package/umd/count-down/hooks.js +24 -39
- package/umd/count-down/index.js +29 -31
- package/umd/count-down/singleton.js +2 -10
- package/umd/count-down/util.js +33 -47
- package/umd/date-picker/helper.js +7 -13
- package/umd/date-picker/index.js +66 -158
- package/umd/dialog/index.js +31 -47
- package/umd/dialog/methods.js +9 -18
- package/umd/divider/index.js +8 -15
- package/umd/dropdown/dropdown.js +74 -106
- package/umd/dropdown/index.js +1 -3
- package/umd/dropdown/options.js +12 -24
- package/umd/dropdown-menu/dropdown-menu.js +49 -78
- package/umd/dropdown-menu/helper.js +4 -22
- package/umd/dropdown-menu/index.js +0 -2
- package/umd/ellipsis/components/js-ellipsis.js +32 -66
- package/umd/ellipsis/components/native-ellipsis.js +9 -12
- package/umd/ellipsis/index.js +19 -24
- package/umd/ellipsis/utils/dom.js +0 -8
- package/umd/ellipsis/utils/is.js +1 -5
- package/umd/form/form-item-context.js +0 -3
- package/umd/form/form-item.js +74 -151
- package/umd/form/index.js +18 -28
- package/umd/form/linked-container.js +5 -19
- package/umd/form/type.d.ts +11 -1
- package/umd/form/type.js +0 -5
- package/umd/form/useForm.js +10 -74
- package/umd/form/utils.js +4 -19
- package/umd/grid/index.js +22 -41
- package/umd/icon/IconAdd/index.js +5 -7
- package/umd/icon/IconArrowBack/index.js +5 -7
- package/umd/icon/IconArrowDown/index.js +5 -7
- package/umd/icon/IconArrowIn/index.js +5 -7
- package/umd/icon/IconArrowUp/index.js +5 -7
- package/umd/icon/IconCheck/index.js +5 -7
- package/umd/icon/IconCheckBold/index.js +5 -7
- package/umd/icon/IconCircleChecked/index.js +5 -7
- package/umd/icon/IconCircleDisabled/index.js +5 -7
- package/umd/icon/IconCircleUnchecked/index.js +5 -7
- package/umd/icon/IconClear/index.js +5 -7
- package/umd/icon/IconClose/index.js +5 -7
- package/umd/icon/IconCloseBold/index.js +5 -7
- package/umd/icon/IconDelete/index.js +5 -7
- package/umd/icon/IconDownload/index.js +5 -7
- package/umd/icon/IconEdit/index.js +5 -7
- package/umd/icon/IconErrorCircle/index.js +5 -7
- package/umd/icon/IconEyeInvisible/index.js +5 -7
- package/umd/icon/IconEyeVisible/index.js +5 -7
- package/umd/icon/IconEyelashInvisible/index.js +5 -7
- package/umd/icon/IconFile/index.js +5 -7
- package/umd/icon/IconGift/index.js +5 -7
- package/umd/icon/IconHeart/index.js +5 -7
- package/umd/icon/IconHome/index.js +5 -7
- package/umd/icon/IconKeyboard/index.js +5 -7
- package/umd/icon/IconKeyboardDelete/index.js +5 -7
- package/umd/icon/IconLikeCircle/index.js +5 -7
- package/umd/icon/IconMinus/index.js +5 -7
- package/umd/icon/IconMore/index.js +5 -7
- package/umd/icon/IconNotice/index.js +5 -7
- package/umd/icon/IconNoticeOff/index.js +5 -7
- package/umd/icon/IconPicture/index.js +5 -7
- package/umd/icon/IconPlay/index.js +5 -7
- package/umd/icon/IconQuestionCircle/index.js +5 -7
- package/umd/icon/IconRefresh/index.js +5 -7
- package/umd/icon/IconSad/index.js +5 -7
- package/umd/icon/IconScan/index.js +5 -7
- package/umd/icon/IconSearch/index.js +5 -7
- package/umd/icon/IconSetting/index.js +5 -7
- package/umd/icon/IconShop/index.js +5 -7
- package/umd/icon/IconShopping/index.js +5 -7
- package/umd/icon/IconSmileFill/index.js +5 -7
- package/umd/icon/IconSound/index.js +5 -7
- package/umd/icon/IconSquareChecked/index.js +5 -7
- package/umd/icon/IconSquareDisabled/index.js +5 -7
- package/umd/icon/IconSquareUnchecked/index.js +5 -7
- package/umd/icon/IconStar/index.js +5 -7
- package/umd/icon/IconStarFill/index.js +5 -7
- package/umd/icon/IconStarHalf/index.js +5 -7
- package/umd/icon/IconSubway/index.js +5 -7
- package/umd/icon/IconSuccessCircle/index.js +5 -7
- package/umd/icon/IconTriDown/index.js +5 -7
- package/umd/icon/IconTriUp/index.js +5 -7
- package/umd/icon/IconUpload/index.js +5 -7
- package/umd/icon/IconUser/index.js +5 -7
- package/umd/icon/IconUserFill/index.js +5 -7
- package/umd/icon/IconWarnCircle/index.js +5 -7
- package/umd/icon/IconWarnCircleFill/index.js +5 -7
- package/umd/icon/index.js +0 -1
- package/umd/image/index.js +53 -88
- package/umd/image-picker/add-icon.js +0 -2
- package/umd/image-picker/index.js +32 -47
- package/umd/image-preview/index.js +129 -239
- package/umd/image-preview/methods.js +5 -15
- package/umd/index-bar/group.js +16 -30
- package/umd/index-bar/index.js +55 -79
- package/umd/index-bar/side-bar.js +15 -32
- package/umd/index-bar/utils.js +3 -16
- package/umd/index.js +0 -1
- package/umd/input/hooks.js +45 -79
- package/umd/input/index.js +26 -35
- package/umd/keyboard/index.js +37 -64
- package/umd/load-more/index.js +33 -60
- package/umd/loading/index.js +19 -43
- package/umd/masking/index.js +47 -72
- package/umd/masking/methods.js +5 -18
- package/umd/nav-bar/back-icon.js +2 -5
- package/umd/nav-bar/index.js +37 -55
- package/umd/notice-bar/index.js +34 -56
- package/umd/notify/index.js +20 -40
- package/umd/notify/methods.js +2 -14
- package/umd/pagination/arrow.js +0 -2
- package/umd/pagination/index.js +27 -53
- package/umd/picker/index.js +48 -73
- package/umd/picker-view/components/cascader.js +13 -28
- package/umd/picker-view/components/multi-picker.js +8 -16
- package/umd/picker-view/components/picker-cell.js +45 -97
- package/umd/picker-view/index.js +30 -63
- package/umd/popover/hooks/useEvent.js +25 -44
- package/umd/popover/hooks/usePosition.js +100 -153
- package/umd/popover/index.js +1 -3
- package/umd/popover/menu.js +32 -45
- package/umd/popover/popover-inner.js +30 -43
- package/umd/popover/popover.js +69 -94
- package/umd/popup/index.js +22 -31
- package/umd/popup/methods.js +0 -1
- package/umd/popup-swiper/index.js +50 -83
- package/umd/popup-swiper/methods.js +0 -1
- package/umd/portal/index.js +3 -6
- package/umd/progress/index.js +27 -39
- package/umd/pull-refresh/android-pull-refresh.js +56 -86
- package/umd/pull-refresh/hooks.js +11 -29
- package/umd/pull-refresh/index.js +3 -7
- package/umd/pull-refresh/ios-pull-refresh.js +53 -72
- package/umd/pull-refresh/model.js +0 -1
- package/umd/radio/group.js +20 -30
- package/umd/radio/index.js +1 -3
- package/umd/radio/radio.js +0 -5
- package/umd/rate/index.js +28 -48
- package/umd/search-bar/association.js +14 -29
- package/umd/search-bar/cancel-button.js +8 -14
- package/umd/search-bar/highlight.js +14 -21
- package/umd/search-bar/index.js +77 -87
- package/umd/show-monitor/index.js +40 -104
- package/umd/skeleton/elements.js +47 -78
- package/umd/skeleton/index.js +18 -28
- package/umd/skeleton/skeleton-context.js +0 -3
- package/umd/slider/hooks/index.js +0 -4
- package/umd/slider/hooks/useSliderEvents.js +27 -55
- package/umd/slider/hooks/useSliderIcon.js +6 -17
- package/umd/slider/hooks/useSliderInit.js +32 -50
- package/umd/slider/hooks/useSliderStyle.js +13 -24
- package/umd/slider/index.js +47 -66
- package/umd/slider/marks.js +13 -22
- package/umd/slider/popover.js +4 -10
- package/umd/slider/thumb.js +11 -18
- package/umd/stepper/hooks/useButtonClick.js +15 -24
- package/umd/stepper/hooks/useInputEvent.js +10 -18
- package/umd/stepper/hooks/useValue.js +9 -13
- package/umd/stepper/index.js +84 -89
- package/umd/steps/index.js +25 -35
- package/umd/steps/step.js +10 -22
- package/umd/sticky/index.js +40 -68
- package/umd/style.js +1 -1
- package/umd/swipe-action/index.js +40 -84
- package/umd/swipe-action/item.js +9 -14
- package/umd/swipe-load/index.js +78 -106
- package/umd/switch/index.js +28 -45
- package/umd/tab-bar/index.js +0 -2
- package/umd/tab-bar/item.js +6 -19
- package/umd/tab-bar/tab-bar.js +16 -27
- package/umd/tabs/index.js +136 -197
- package/umd/tabs/tab-cell-underline.js +28 -71
- package/umd/tabs/tab-cell.js +73 -122
- package/umd/tabs/tab-pane.js +53 -98
- package/umd/tag/index.js +1 -3
- package/umd/tag/list.js +11 -20
- package/umd/tag/tag.js +20 -26
- package/umd/textarea/index.js +35 -51
- package/umd/toast/index.js +26 -49
- package/umd/toast/methods.js +2 -13
- package/umd/transition/index.js +16 -22
- package/umd/uploader/index.d.ts +1 -1
- package/umd/uploader/index.js +28 -39
- package/umd/uploader/upload/upload.js +9 -43
package/esm/carousel/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, us
|
|
|
3
3
|
import { nextTick, cls } from '@arco-design/mobile-utils';
|
|
4
4
|
import { ContextLayout, GlobalContext } from '../context-provider';
|
|
5
5
|
import { useRefState, useListenResize, useUpdateEffect, getStyleWithVendor, useSystem, useSwiperInnerScroll, useLatestRef } from '../_helpers';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* 轮播组件,支持自定义轮播索引样式及滑块宽度。**需要注意的是,如果正使用`fastclick`,需要为 touchstart 的 target 添加`needsclick`类**(<a href="https://github.com/ftlabs/fastclick#ignore-certain-elements-with-needsclick" target="_blank">详情戳这里</a>),以规避`fastclick`逻辑与组件内部的手势冲突。(如果使用了`list`属性则无需额外添加)
|
|
9
8
|
* @en Carousel component, supports custom carousel index style and slider width. **Note that if you are using `fastclick`, you need to add a `needsclick` class to the touchstart target ** (<a href="https://github.com/ftlabs/fastclick#ignore-certain-elements- with-needsclick" target="_blank">click here for details</a>) to avoid `fastclick` logic conflicts with gestures inside the component. (no need to add if `list` is set)
|
|
@@ -14,97 +13,95 @@ import { useRefState, useListenResize, useUpdateEffect, getStyleWithVendor, useS
|
|
|
14
13
|
*/
|
|
15
14
|
var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
16
15
|
var className = props.className,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
16
|
+
wrapStyle = props.wrapStyle,
|
|
17
|
+
style = props.style,
|
|
18
|
+
children = props.children,
|
|
19
|
+
_props$list = props.list,
|
|
20
|
+
list = _props$list === void 0 ? [] : _props$list,
|
|
21
|
+
_props$animateDuratio = props.animateDuration,
|
|
22
|
+
animateDuration = _props$animateDuratio === void 0 ? 500 : _props$animateDuratio,
|
|
23
|
+
_props$animateDuratio2 = props.animateDurationSlide,
|
|
24
|
+
animateDurationSlide = _props$animateDuratio2 === void 0 ? 300 : _props$animateDuratio2,
|
|
25
|
+
_props$loop = props.loop,
|
|
26
|
+
loop = _props$loop === void 0 ? true : _props$loop,
|
|
27
|
+
_props$autoPlay = props.autoPlay,
|
|
28
|
+
autoPlay = _props$autoPlay === void 0 ? true : _props$autoPlay,
|
|
29
|
+
_props$autoPlayDirect = props.autoPlayDirection,
|
|
30
|
+
autoPlayDirection = _props$autoPlayDirect === void 0 ? 'normal' : _props$autoPlayDirect,
|
|
31
|
+
_props$swipeable = props.swipeable,
|
|
32
|
+
swipeable = _props$swipeable === void 0 ? true : _props$swipeable,
|
|
33
|
+
_props$stayDuration = props.stayDuration,
|
|
34
|
+
stayDuration = _props$stayDuration === void 0 ? 4000 : _props$stayDuration,
|
|
35
|
+
boxWidth = props.boxWidth,
|
|
36
|
+
boxHeight = props.boxHeight,
|
|
37
|
+
baseBoxWidth = props.baseBoxWidth,
|
|
38
|
+
baseBoxHeight = props.baseBoxHeight,
|
|
39
|
+
_props$width = props.width,
|
|
40
|
+
width = _props$width === void 0 ? 0 : _props$width,
|
|
41
|
+
height = props.height,
|
|
42
|
+
_props$initialIndex = props.initialIndex,
|
|
43
|
+
initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
|
|
44
|
+
renderIndicator = props.renderIndicator,
|
|
45
|
+
_props$indicatorPos = props.indicatorPos,
|
|
46
|
+
indicatorPos = _props$indicatorPos === void 0 ? 'center' : _props$indicatorPos,
|
|
47
|
+
_props$indicatorVerti = props.indicatorVerticalPos,
|
|
48
|
+
indicatorVerticalPos = _props$indicatorVerti === void 0 ? 'left' : _props$indicatorVerti,
|
|
49
|
+
indicatorOutside = props.indicatorOutside,
|
|
50
|
+
_props$showIndicator = props.showIndicator,
|
|
51
|
+
showIndicator = _props$showIndicator === void 0 ? true : _props$showIndicator,
|
|
52
|
+
_props$hideSingleIndi = props.hideSingleIndicator,
|
|
53
|
+
hideSingleIndicator = _props$hideSingleIndi === void 0 ? true : _props$hideSingleIndi,
|
|
54
|
+
_props$indicatorType = props.indicatorType,
|
|
55
|
+
indicatorType = _props$indicatorType === void 0 ? 'square' : _props$indicatorType,
|
|
56
|
+
_props$indicatorClass = props.indicatorClass,
|
|
57
|
+
indicatorClass = _props$indicatorClass === void 0 ? '' : _props$indicatorClass,
|
|
58
|
+
indicatorInverse = props.indicatorInverse,
|
|
59
|
+
_props$spaceBetween = props.spaceBetween,
|
|
60
|
+
spaceBetween = _props$spaceBetween === void 0 ? 0 : _props$spaceBetween,
|
|
61
|
+
_props$offsetBetween = props.offsetBetween,
|
|
62
|
+
offsetBetween = _props$offsetBetween === void 0 ? 0 : _props$offsetBetween,
|
|
63
|
+
currentIndex = props.currentIndex,
|
|
64
|
+
_props$autoHeight = props.autoHeight,
|
|
65
|
+
autoHeight = _props$autoHeight === void 0 ? false : _props$autoHeight,
|
|
66
|
+
_props$percentToChang = props.percentToChange,
|
|
67
|
+
percentToChange = _props$percentToChang === void 0 ? 0.3 : _props$percentToChang,
|
|
68
|
+
_props$distanceToChan = props.distanceToChange,
|
|
69
|
+
distanceToChange = _props$distanceToChan === void 0 ? 10 : _props$distanceToChan,
|
|
70
|
+
_props$speedToChange = props.speedToChange,
|
|
71
|
+
speedToChange = _props$speedToChange === void 0 ? 100 : _props$speedToChange,
|
|
72
|
+
vertical = props.vertical,
|
|
73
|
+
lazyloadCount = props.lazyloadCount,
|
|
74
|
+
_props$inactiveScale = props.inactiveScale,
|
|
75
|
+
inactiveScale = _props$inactiveScale === void 0 ? 1 : _props$inactiveScale,
|
|
76
|
+
_props$stopPropagatio = props.stopPropagation,
|
|
77
|
+
stopPropagation = _props$stopPropagatio === void 0 ? true : _props$stopPropagatio,
|
|
78
|
+
_props$fakeItem = props.fakeItem,
|
|
79
|
+
fakeItem = _props$fakeItem === void 0 ? false : _props$fakeItem,
|
|
80
|
+
_props$allowEndBlank = props.allowEndBlank,
|
|
81
|
+
allowEndBlank = _props$allowEndBlank === void 0 ? false : _props$allowEndBlank,
|
|
82
|
+
_props$bounceWhenNoLo = props.bounceWhenNoLoop,
|
|
83
|
+
bounceWhenNoLoop = _props$bounceWhenNoLo === void 0 ? false : _props$bounceWhenNoLo,
|
|
84
|
+
_props$bounceDampRate = props.bounceDampRate,
|
|
85
|
+
bounceDampRate = _props$bounceDampRate === void 0 ? 3 : _props$bounceDampRate,
|
|
86
|
+
_props$iOSVisibleOpti = props.iOSVisibleOptimize,
|
|
87
|
+
iOSVisibleOptimize = _props$iOSVisibleOpti === void 0 ? true : _props$iOSVisibleOpti,
|
|
88
|
+
renderExtra = props.renderExtra,
|
|
89
|
+
distanceProcessor = props.distanceProcessor,
|
|
90
|
+
getInnerScrollContainer = props.getInnerScrollContainer,
|
|
91
|
+
onChange = props.onChange,
|
|
92
|
+
onAfterChange = props.onAfterChange,
|
|
93
|
+
onTouchStart = props.onTouchStart,
|
|
94
|
+
onTouchMove = props.onTouchMove,
|
|
95
|
+
onTouchEnd = props.onTouchEnd,
|
|
96
|
+
onTransitionStart = props.onTransitionStart,
|
|
97
|
+
onTransitionEnd = props.onTransitionEnd,
|
|
98
|
+
onDistanceChange = props.onDistanceChange,
|
|
99
|
+
_props$stopTouchThres = props.stopTouchThreshold,
|
|
100
|
+
stopTouchThreshold = _props$stopTouchThres === void 0 ? 0 : _props$stopTouchThres,
|
|
101
|
+
onTouchStopped = props.onTouchStopped,
|
|
102
|
+
onPageVisibleChange = props.onPageVisibleChange;
|
|
105
103
|
var _useContext = useContext(GlobalContext),
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
useRtl = _useContext.useRtl;
|
|
108
105
|
var horizontalUseRtl = !vertical && useRtl;
|
|
109
106
|
var domRef = useRef(null);
|
|
110
107
|
var wrapRef = useRef(null);
|
|
@@ -116,70 +113,55 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
116
113
|
var touchStartTimeRef = useRef(0);
|
|
117
114
|
var touchStartedRef = useRef(false);
|
|
118
115
|
var touchMovedRef = useRef(false);
|
|
119
|
-
|
|
120
116
|
var _useState = useState(baseBoxWidth || 0),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
wrapWidth = _useState[0],
|
|
118
|
+
setWrapWidth = _useState[1];
|
|
124
119
|
var _useState2 = useState(baseBoxHeight || 0),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
wrapHeight = _useState2[0],
|
|
121
|
+
setWrapHeight = _useState2[1];
|
|
128
122
|
var touchStartXRef = useRef(0);
|
|
129
123
|
var touchStartYRef = useRef(0);
|
|
130
124
|
var scrollingRef = useRef(null);
|
|
131
125
|
var touchStoppedRef = useRef(false);
|
|
132
126
|
var bouncingRef = useRef(false);
|
|
133
|
-
|
|
134
127
|
var _useState3 = useState('auto'),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
currentItemHeight = _useState3[0],
|
|
129
|
+
setCurrentItemHeight = _useState3[1];
|
|
138
130
|
var _useRefState = useRefState(false),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
131
|
+
posAdjusting = _useRefState[0],
|
|
132
|
+
posAdjustingRef = _useRefState[1],
|
|
133
|
+
setPosAdjusting = _useRefState[2];
|
|
143
134
|
var _useRefState2 = useRefState(0),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
distance = _useRefState2[0],
|
|
136
|
+
distanceRef = _useRefState2[1],
|
|
137
|
+
setDistance = _useRefState2[2];
|
|
148
138
|
var _useState4 = useState(true),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
139
|
+
isAutoJump = _useState4[0],
|
|
140
|
+
setIsAutoJump = _useState4[1];
|
|
152
141
|
var _useRefState3 = useRefState(currentIndex !== void 0 ? currentIndex : initialIndex),
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
142
|
+
index = _useRefState3[0],
|
|
143
|
+
indexRef = _useRefState3[1],
|
|
144
|
+
setIndex = _useRefState3[2];
|
|
157
145
|
var _useRefState4 = useRefState([]),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
146
|
+
transforms = _useRefState4[0],
|
|
147
|
+
transformsRef = _useRefState4[1],
|
|
148
|
+
setTransforms = _useRefState4[2];
|
|
162
149
|
var _useRefState5 = useRefState((autoPlayDirection === 'reverse' || horizontalUseRtl) && autoPlay ? 'right' : 'left'),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
150
|
+
direction = _useRefState5[0],
|
|
151
|
+
directionRef = _useRefState5[1],
|
|
152
|
+
setStateDirection = _useRefState5[2];
|
|
167
153
|
var lastDirectionRef = useRef('');
|
|
168
154
|
var lastShownIndexRef = useRef(-1);
|
|
169
|
-
|
|
170
155
|
var _getAllChildren = getAllChildren(),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
156
|
+
allChildren = _getAllChildren.allChildren,
|
|
157
|
+
fakeTwoChildren = _getAllChildren.fakeTwoChildren;
|
|
174
158
|
var total = allChildren.length;
|
|
175
159
|
var shownTotal = fakeTwoChildren ? 2 : total;
|
|
176
160
|
var indicatorArr = useMemo(function () {
|
|
177
161
|
var arr = [];
|
|
178
|
-
|
|
179
162
|
for (var i = 0; i < shownTotal; i += 1) {
|
|
180
163
|
arr.push(i);
|
|
181
164
|
}
|
|
182
|
-
|
|
183
165
|
return arr;
|
|
184
166
|
}, [shownTotal]);
|
|
185
167
|
var rtlRatio = horizontalUseRtl ? -1 : 1;
|
|
@@ -203,14 +185,12 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
203
185
|
var inactiveValidScale = useMemo(function () {
|
|
204
186
|
return Math.max(0, Math.min(inactiveScale, 1));
|
|
205
187
|
}, [inactiveScale]);
|
|
206
|
-
|
|
207
188
|
var _useState5 = useState([]),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
189
|
+
fakeIndexes = _useState5[0],
|
|
190
|
+
setFakeIndexes = _useState5[1];
|
|
191
|
+
var system = useSystem();
|
|
192
|
+
// 开启自动循环时iOS会有渲染问题需要强刷dom,但不需要autoPlay的不用强刷,这里判断下
|
|
212
193
|
// @en When the automatic loop is turned on, there will be rendering problems in iOS. Need to brush the dom, but if you don't need autoPlay, don't need to brush.
|
|
213
|
-
|
|
214
194
|
var needRefreshDom = !noInterval && system === 'ios' && iOSVisibleOptimize;
|
|
215
195
|
var setDirection = useCallback(function (newDirec) {
|
|
216
196
|
setStateDirection(function (direc) {
|
|
@@ -225,17 +205,14 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
225
205
|
if (onTouchStart && onTouchStart(e, shownTotal, getShownIndex(indexRef.current))) {
|
|
226
206
|
return;
|
|
227
207
|
}
|
|
228
|
-
|
|
229
208
|
if (posAdjustingRef.current) {
|
|
230
209
|
return;
|
|
231
|
-
}
|
|
210
|
+
}
|
|
211
|
+
// touchMove触发时,阻止handleTouchStart多次执行(如点击事件)
|
|
232
212
|
// @en When touchMove is triggered, prevent handleTouchStart from executing multiple times (such as click events)
|
|
233
|
-
|
|
234
|
-
|
|
235
213
|
if (touchStartedRef.current && touchMovedRef.current) {
|
|
236
214
|
return;
|
|
237
215
|
}
|
|
238
|
-
|
|
239
216
|
touchStartedRef.current = true;
|
|
240
217
|
touchMovedRef.current = false;
|
|
241
218
|
clear();
|
|
@@ -249,25 +226,20 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
249
226
|
}, [shownTotal, onTouchStart]);
|
|
250
227
|
var triggerTouchStopped = useCallback(function (posDis) {
|
|
251
228
|
var needStop = Math.abs(posDis) > stopTouchThreshold;
|
|
252
|
-
|
|
253
229
|
if (!touchStoppedRef.current && needStop) {
|
|
254
230
|
onTouchStopped && onTouchStopped(posDis >= 0 ? -1 : 1);
|
|
255
231
|
}
|
|
256
|
-
|
|
257
232
|
touchStoppedRef.current = needStop;
|
|
258
233
|
}, [stopTouchThreshold, onTouchStopped]);
|
|
259
234
|
var handleTouchMove = useCallback(function (e) {
|
|
260
235
|
if (onTouchMove && onTouchMove(e, shownTotal, getShownIndex(indexRef.current))) {
|
|
261
236
|
return;
|
|
262
237
|
}
|
|
263
|
-
|
|
264
238
|
stopPropagation && e.stopPropagation();
|
|
265
|
-
|
|
266
239
|
if (!touchStartedRef.current || posAdjustingRef.current) {
|
|
267
240
|
e.cancelable && e.preventDefault();
|
|
268
241
|
return;
|
|
269
242
|
}
|
|
270
|
-
|
|
271
243
|
touchMovedRef.current = true;
|
|
272
244
|
var evt = e.changedTouches[0];
|
|
273
245
|
var touchMoveX = Math.max(0, evt.clientX || 0);
|
|
@@ -277,41 +249,33 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
277
249
|
var absDisX = Math.abs(posDisX);
|
|
278
250
|
var absDisY = Math.abs(posDisY);
|
|
279
251
|
var originDis = vertical ? posDisY : posDisX;
|
|
280
|
-
|
|
281
252
|
var processor = distanceProcessor || function (dis, size, child) {
|
|
282
253
|
return child * (dis / size);
|
|
283
254
|
};
|
|
284
|
-
|
|
285
255
|
var posDis = processor(originDis, wrapSizeRef.current, childSize);
|
|
286
|
-
|
|
287
256
|
if (total < 2) {
|
|
288
257
|
triggerTouchStopped(posDis);
|
|
289
258
|
return;
|
|
290
259
|
}
|
|
291
|
-
|
|
292
260
|
if (scrollingRef.current === null) {
|
|
293
261
|
scrollingRef.current = vertical ? absDisY < absDisX : absDisX < absDisY;
|
|
294
|
-
}
|
|
262
|
+
}
|
|
263
|
+
// 如果是在滚动页面则禁用轮播图手势
|
|
295
264
|
// @en Disable carousel gestures if scrolling
|
|
296
|
-
|
|
297
|
-
|
|
298
265
|
if (scrollingRef.current) {
|
|
299
|
-
setDistance(0);
|
|
266
|
+
setDistance(0);
|
|
267
|
+
// bugfix: 未触发横滑就不触发touchend逻辑,且这个场景不需要触发onTouchStopped,因此直接设置touchStoppedRef
|
|
300
268
|
// @en bugfix: The touchend event will not be triggered if the horizontal swipe is not triggered, and this scene does not need to trigger onTouchStopped.
|
|
301
|
-
|
|
302
|
-
|
|
269
|
+
touchStoppedRef.current = true;
|
|
270
|
+
// 不会触发jumpTo,但touchstart时clear了,所以要手动设置一次interval
|
|
303
271
|
// @en JumpTo will not be triggered, but it is cleared in touchstart event, so need to manually set interval once
|
|
304
|
-
|
|
305
272
|
setPlayIntervalRef.current();
|
|
306
273
|
return;
|
|
307
274
|
}
|
|
308
|
-
|
|
309
275
|
setDirection(posDis >= 0 ? 'right' : 'left');
|
|
310
276
|
var comparedPos = posDis * rtlRatio;
|
|
311
|
-
|
|
312
277
|
if (noLoop && (indexRef.current === 0 && comparedPos > 0 || indexRef.current === total - 1 && comparedPos < 0)) {
|
|
313
278
|
triggerTouchStopped(posDis);
|
|
314
|
-
|
|
315
279
|
if (bounceWhenNoLoop && bounceDampRate) {
|
|
316
280
|
e.cancelable && e.preventDefault();
|
|
317
281
|
bouncingRef.current = true;
|
|
@@ -319,10 +283,8 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
319
283
|
} else {
|
|
320
284
|
setDistance(0);
|
|
321
285
|
}
|
|
322
|
-
|
|
323
286
|
return;
|
|
324
287
|
}
|
|
325
|
-
|
|
326
288
|
e.cancelable && e.preventDefault();
|
|
327
289
|
touchStoppedRef.current = false;
|
|
328
290
|
var maxDis = childSize;
|
|
@@ -342,14 +304,13 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
342
304
|
useSwiperInnerScroll(getInnerScrollContainer);
|
|
343
305
|
var updateWhenVisible = useCallback(function () {
|
|
344
306
|
fakeWrapRef.current && (fakeWrapRef.current.style.display = 'none');
|
|
345
|
-
wrapRef.current && (wrapRef.current.style.display = '');
|
|
307
|
+
wrapRef.current && (wrapRef.current.style.display = '');
|
|
308
|
+
// 部分情况下页面隐藏后容器宽度变成0,因此页面返回后需重新取一次容器尺寸
|
|
346
309
|
// @en In some cases, the width of the container becomes 0 after the page is invisible, so the container size needs to be resized after the page is visible.
|
|
347
|
-
|
|
348
310
|
updateDataRef.current();
|
|
349
311
|
}, []);
|
|
350
312
|
var updateWhenInvisible = useCallback(function () {
|
|
351
313
|
clear();
|
|
352
|
-
|
|
353
314
|
if (wrapRef.current && fakeWrapRef.current) {
|
|
354
315
|
fakeWrapRef.current.style.height = (wrapRef.current.offsetHeight || 0) + "px";
|
|
355
316
|
fakeWrapRef.current.style.display = 'block';
|
|
@@ -359,10 +320,9 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
359
320
|
useEffect(function () {
|
|
360
321
|
if (onPageVisibleChange) {
|
|
361
322
|
return onPageVisibleChange(updateWhenVisible, updateWhenInvisible);
|
|
362
|
-
}
|
|
323
|
+
}
|
|
324
|
+
// ios 在页面隐藏后返回时会有dom结构正确但渲染错乱的情况,因此在页面隐藏时先用占位符,返回后重新渲染一次dom
|
|
363
325
|
// @en In iOS, When the page is invisible, the DOM will be correct but the rendering is disordered. So use a placeholder when the page is invisible, and re-render the DOM after it is visible.
|
|
364
|
-
|
|
365
|
-
|
|
366
326
|
var update = function update() {
|
|
367
327
|
if (document.visibilityState === 'visible') {
|
|
368
328
|
updateWhenVisible();
|
|
@@ -370,7 +330,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
370
330
|
updateWhenInvisible();
|
|
371
331
|
}
|
|
372
332
|
};
|
|
373
|
-
|
|
374
333
|
document.addEventListener('visibilitychange', update);
|
|
375
334
|
return function () {
|
|
376
335
|
document.removeEventListener('visibilitychange', update);
|
|
@@ -391,7 +350,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
391
350
|
wrapRef.current.addEventListener('touchstart', handleTouchStart);
|
|
392
351
|
wrapRef.current.addEventListener('touchmove', handleTouchMove);
|
|
393
352
|
}
|
|
394
|
-
|
|
395
353
|
return function () {
|
|
396
354
|
if (wrapRef.current && needTouchEvent) {
|
|
397
355
|
wrapRef.current.removeEventListener('touchstart', handleTouchStart);
|
|
@@ -454,43 +412,34 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
454
412
|
if (!fakeItem || posAdjusting) {
|
|
455
413
|
return;
|
|
456
414
|
}
|
|
457
|
-
|
|
458
415
|
setCurrentFakeIndex();
|
|
459
416
|
}, [posAdjusting, index, direction, total, childSize, horizontalUseRtl]);
|
|
460
|
-
|
|
461
417
|
function getShownIndex(nowIndex) {
|
|
462
418
|
var validIndex = nowIndex === total ? 0 : nowIndex;
|
|
463
419
|
var shownInd = nowIndex === -1 ? total - 1 : validIndex;
|
|
464
420
|
return fakeTwoChildren ? shownInd % 2 : shownInd;
|
|
465
421
|
}
|
|
466
|
-
|
|
467
422
|
function getDynamicDuration(autoJump) {
|
|
468
423
|
return autoJump ? animateDuration : animateDurationSlide;
|
|
469
424
|
}
|
|
470
|
-
|
|
471
425
|
function setCurrentHeight() {
|
|
472
426
|
if (!innerRef.current || !autoHeight || vertical) {
|
|
473
427
|
return;
|
|
474
428
|
}
|
|
475
|
-
|
|
476
429
|
var allItemDom = itemsRef.current;
|
|
477
430
|
var nowIndex = getShownIndex(indexRef.current);
|
|
478
431
|
var currentHeight = (allItemDom[nowIndex] || {}).offsetHeight || 'auto';
|
|
479
432
|
setCurrentItemHeight(currentHeight);
|
|
480
433
|
}
|
|
481
|
-
|
|
482
434
|
function getAllChildren() {
|
|
483
435
|
var allChild = [];
|
|
484
436
|
var fakeTwo = false;
|
|
485
|
-
|
|
486
437
|
if (list && list.length) {
|
|
487
438
|
var actualList = list;
|
|
488
|
-
|
|
489
439
|
if (list.length === 2 && fakeItem) {
|
|
490
440
|
fakeTwo = true;
|
|
491
441
|
actualList = list.concat(list);
|
|
492
442
|
}
|
|
493
|
-
|
|
494
443
|
allChild = actualList.map(function (item, i) {
|
|
495
444
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
496
445
|
key: i,
|
|
@@ -504,7 +453,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
504
453
|
});
|
|
505
454
|
} else if (children && Object.prototype.toString.call(children) === '[object Array]') {
|
|
506
455
|
allChild = children;
|
|
507
|
-
|
|
508
456
|
if (allChild.length === 2 && fakeItem) {
|
|
509
457
|
fakeTwo = true;
|
|
510
458
|
allChild = [].concat(allChild, allChild);
|
|
@@ -512,32 +460,25 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
512
460
|
} else {
|
|
513
461
|
allChild = children ? [children] : [];
|
|
514
462
|
}
|
|
515
|
-
|
|
516
463
|
return {
|
|
517
464
|
allChildren: allChild,
|
|
518
465
|
fakeTwoChildren: fakeTwo
|
|
519
466
|
};
|
|
520
467
|
}
|
|
521
|
-
|
|
522
468
|
function getDefaultDirection() {
|
|
523
469
|
var nowIndex = indexRef.current;
|
|
524
|
-
|
|
525
470
|
if (nowIndex === total - 1) {
|
|
526
471
|
return horizontalUseRtl ? 'right' : 'left';
|
|
527
472
|
}
|
|
528
|
-
|
|
529
473
|
if (nowIndex === 0) {
|
|
530
474
|
return horizontalUseRtl ? 'left' : 'right';
|
|
531
475
|
}
|
|
532
|
-
|
|
533
476
|
return '';
|
|
534
477
|
}
|
|
535
|
-
|
|
536
478
|
function changeIndex(newIndex, rightNow, userSetDirec) {
|
|
537
479
|
if (posAdjustingRef.current) {
|
|
538
480
|
return;
|
|
539
481
|
}
|
|
540
|
-
|
|
541
482
|
if (userSetDirec) {
|
|
542
483
|
// rtl 模式取反
|
|
543
484
|
var direcMap = {
|
|
@@ -553,15 +494,12 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
553
494
|
jumpTo(newIndex, true, rightNow);
|
|
554
495
|
}
|
|
555
496
|
}
|
|
556
|
-
|
|
557
497
|
function jumpTo(newIndex, autoJump, rightNow, direc) {
|
|
558
498
|
if (autoJump === void 0) {
|
|
559
499
|
autoJump = true;
|
|
560
500
|
}
|
|
561
|
-
|
|
562
501
|
var oldIndex = getShownIndex(indexRef.current);
|
|
563
502
|
var changedIndex = newIndex !== oldIndex ? getShownIndex(newIndex) : -1;
|
|
564
|
-
|
|
565
503
|
if (direc) {
|
|
566
504
|
setDirection(direc);
|
|
567
505
|
} else if (autoJump) {
|
|
@@ -571,7 +509,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
571
509
|
} else {
|
|
572
510
|
setDirection('');
|
|
573
511
|
}
|
|
574
|
-
|
|
575
512
|
setPosAdjusting(true);
|
|
576
513
|
setIsAutoJump(autoJump);
|
|
577
514
|
setDistance(0);
|
|
@@ -584,7 +521,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
584
521
|
setDirection(getDefaultDirection());
|
|
585
522
|
var newTransform = transformsRef.current.slice();
|
|
586
523
|
var transChanged = false;
|
|
587
|
-
|
|
588
524
|
if (newIndex === -1 && movedChildRef.current >= 0) {
|
|
589
525
|
newTransform[movedChildRef.current] = 0;
|
|
590
526
|
transChanged = true;
|
|
@@ -594,15 +530,12 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
594
530
|
transChanged = true;
|
|
595
531
|
setIndex(0);
|
|
596
532
|
}
|
|
597
|
-
|
|
598
533
|
transChanged && setTransforms(newTransform);
|
|
599
534
|
setIsAutoJump(true);
|
|
600
535
|
onTransitionEnd && onTransitionEnd();
|
|
601
|
-
|
|
602
536
|
if (changedIndex >= 0) {
|
|
603
537
|
onAfterChange && onAfterChange(changedIndex, oldIndex);
|
|
604
538
|
}
|
|
605
|
-
|
|
606
539
|
nextTick(function () {
|
|
607
540
|
setPlayIntervalRef.current();
|
|
608
541
|
});
|
|
@@ -610,40 +543,32 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
610
543
|
}, rightNow ? 0 : getDynamicDuration(autoJump));
|
|
611
544
|
autoJump && setDirection('');
|
|
612
545
|
}
|
|
613
|
-
|
|
614
546
|
function setPlayInterval() {
|
|
615
547
|
clear();
|
|
616
|
-
|
|
617
548
|
if (noInterval) {
|
|
618
549
|
return;
|
|
619
550
|
}
|
|
620
|
-
|
|
621
551
|
timerRef.current = delayTimeout(function () {
|
|
622
552
|
jumpTo(autoPlayDirection === 'reverse' ? indexRef.current - 1 : indexRef.current + 1);
|
|
623
553
|
}, stayDuration);
|
|
624
554
|
}
|
|
625
|
-
|
|
626
555
|
function updateLayoutData() {
|
|
627
556
|
if (wrapRef.current) {
|
|
628
557
|
setWrapWidth(wrapRef.current.offsetWidth);
|
|
629
558
|
setWrapHeight(wrapRef.current.offsetHeight);
|
|
630
559
|
}
|
|
631
|
-
|
|
632
560
|
setCurrentHeight();
|
|
633
561
|
}
|
|
634
|
-
|
|
635
562
|
function updateData() {
|
|
636
563
|
updateLayoutData();
|
|
637
564
|
setPlayIntervalRef.current();
|
|
638
565
|
}
|
|
639
|
-
|
|
640
566
|
function clear() {
|
|
641
567
|
if (timerRef.current) {
|
|
642
568
|
clearTimeout(timerRef.current);
|
|
643
569
|
timerRef.current = null;
|
|
644
570
|
}
|
|
645
571
|
}
|
|
646
|
-
|
|
647
572
|
function getFakeChild() {
|
|
648
573
|
if (noLoop) {
|
|
649
574
|
// 循环状态从有到无时,重置 transforms
|
|
@@ -651,7 +576,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
651
576
|
setTransforms([]);
|
|
652
577
|
return;
|
|
653
578
|
}
|
|
654
|
-
|
|
655
579
|
var nowIndex = indexRef.current;
|
|
656
580
|
var newTransform = transformsRef.current.slice();
|
|
657
581
|
var dis = Math.max(0, childSize);
|
|
@@ -668,53 +592,42 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
668
592
|
});
|
|
669
593
|
setTransforms(newTransform);
|
|
670
594
|
}
|
|
671
|
-
|
|
672
595
|
function delayTimeout(callback, timeout) {
|
|
673
596
|
return setTimeout(callback, timeout);
|
|
674
597
|
}
|
|
675
|
-
|
|
676
598
|
function handleTouchEnd(e) {
|
|
677
599
|
if (!needTouchEvent) {
|
|
678
600
|
return;
|
|
679
601
|
}
|
|
680
|
-
|
|
681
602
|
if (onTouchEnd && onTouchEnd(e.nativeEvent, shownTotal, getShownIndex(indexRef.current))) {
|
|
682
603
|
return;
|
|
683
604
|
}
|
|
684
|
-
|
|
685
605
|
stopPropagation && e.stopPropagation();
|
|
686
|
-
|
|
687
606
|
if (!touchStartedRef.current) {
|
|
688
607
|
return;
|
|
689
608
|
}
|
|
690
|
-
|
|
691
609
|
touchStartedRef.current = false;
|
|
692
|
-
|
|
693
610
|
if (!touchMovedRef.current) {
|
|
694
611
|
setPlayIntervalRef.current();
|
|
695
612
|
return;
|
|
696
613
|
}
|
|
697
|
-
|
|
698
|
-
|
|
614
|
+
touchMovedRef.current = false;
|
|
615
|
+
// bugfix: 回弹判断逻辑需在touchMovedRef标识重置逻辑之后,否则会在触发回弹后导致标识无法重置引起滑动判断问题
|
|
699
616
|
// @en bugfix: The logic for the bounce judgment needs to be after the touchMovedRef reset logic, otherwise it will cause the problem of slide judgment after the bounce is triggered.
|
|
700
|
-
|
|
701
617
|
if (bouncingRef.current) {
|
|
702
618
|
bouncingRef.current = false;
|
|
703
619
|
jumpTo(index, false);
|
|
704
620
|
return;
|
|
705
621
|
}
|
|
706
|
-
|
|
707
622
|
if (posAdjustingRef.current || touchStoppedRef.current) {
|
|
708
623
|
return;
|
|
709
624
|
}
|
|
710
|
-
|
|
711
625
|
var touchEndTime = new Date().getTime();
|
|
712
626
|
var dis = Math.abs(distance);
|
|
713
627
|
var speed = dis / (touchEndTime - touchStartTimeRef.current) * 1000;
|
|
714
628
|
var maxSlice = childSize * percentToChange;
|
|
715
629
|
var needJump = dis > maxSlice && dis > distanceToChange || speed > speedToChange;
|
|
716
630
|
var comparedDis = distance * rtlRatio;
|
|
717
|
-
|
|
718
631
|
if (comparedDis > 0 && needJump) {
|
|
719
632
|
jumpTo(index - 1, false);
|
|
720
633
|
} else if (comparedDis < 0 && needJump) {
|
|
@@ -723,14 +636,12 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
723
636
|
jumpTo(index, false);
|
|
724
637
|
}
|
|
725
638
|
}
|
|
726
|
-
|
|
727
639
|
function getSlideTransitionStyle() {
|
|
728
640
|
return {
|
|
729
641
|
transitionProperty: posAdjusting ? 'transform' : 'none',
|
|
730
642
|
transitionDuration: posAdjusting ? dynamicAnimateDuration + "ms" : '0ms'
|
|
731
643
|
};
|
|
732
644
|
}
|
|
733
|
-
|
|
734
645
|
function getInnerStyle() {
|
|
735
646
|
var transitionStyle = getStyleWithVendor(getSlideTransitionStyle());
|
|
736
647
|
var innerSize = childSize * total;
|
|
@@ -740,24 +651,21 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
740
651
|
var minTransform = horizontalUseRtl ? -1 * max : min;
|
|
741
652
|
var maxTransform = horizontalUseRtl ? -1 * min : max;
|
|
742
653
|
var comparedDis = rtlRatio * distance;
|
|
743
|
-
var noLoopDis = bounceWhenNoLoop && (index === 0 && comparedDis > 0 || index === total - 1 && comparedDis < 0) ? Math.min(minTransform + distance, Math.max(maxTransform + distance, dis)) : Math.min(minTransform, Math.max(maxTransform, dis));
|
|
654
|
+
var noLoopDis = bounceWhenNoLoop && (index === 0 && comparedDis > 0 || index === total - 1 && comparedDis < 0) ? Math.min(minTransform + distance, Math.max(maxTransform + distance, dis)) : Math.min(minTransform, Math.max(maxTransform, dis));
|
|
655
|
+
// noLoop时需要在最后也露出spaceBetween的空白,所以当滑到最后一个时transform向左移动相应宽度
|
|
744
656
|
// @en When noLoop is used, the blank space of spaceBetween needs to be exposed at the end, so when sliding to the last one, the transform value moves to the left by the corresponding width
|
|
745
|
-
|
|
746
657
|
var translateDis = noLoop ? noLoopDis - (total > 1 && index === total - 1 ? spaceBetween : 0) * rtlRatio : dis;
|
|
747
|
-
var initTranslateDis = -1 * index * 100;
|
|
748
|
-
|
|
658
|
+
var initTranslateDis = -1 * index * 100;
|
|
659
|
+
// bugfix: prop `style` did not match in ssr
|
|
749
660
|
var transStr = childSize > 0 ? "" + translateDis + (translateDis ? 'px' : '') : "" + initTranslateDis + (initTranslateDis ? '%' : '');
|
|
750
|
-
|
|
751
661
|
if (vertical) {
|
|
752
662
|
var _translateStyle = getStyleWithVendor({
|
|
753
663
|
transform: "translateY(" + transStr + ") translateZ(0)"
|
|
754
664
|
});
|
|
755
|
-
|
|
756
665
|
return _extends({}, transitionStyle, _translateStyle, {
|
|
757
666
|
width: '100%'
|
|
758
667
|
});
|
|
759
668
|
}
|
|
760
|
-
|
|
761
669
|
var translateStyle = getStyleWithVendor({
|
|
762
670
|
transform: "translateX(" + transStr + ") translateZ(0)"
|
|
763
671
|
});
|
|
@@ -766,41 +674,36 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
766
674
|
height: height
|
|
767
675
|
}, transitionStyle, translateStyle);
|
|
768
676
|
}
|
|
769
|
-
|
|
770
677
|
function getCarouselStyle() {
|
|
771
678
|
if (vertical) {
|
|
772
679
|
return _extends({
|
|
773
680
|
height: userSetBoxHeight
|
|
774
681
|
}, style || {});
|
|
775
682
|
}
|
|
776
|
-
|
|
777
683
|
var heightStyle = currentItemHeight && currentItemHeight !== 'auto' ? {
|
|
778
684
|
height: currentItemHeight
|
|
779
685
|
} : {};
|
|
780
686
|
return _extends({
|
|
781
687
|
width: userSetBoxWidth
|
|
782
688
|
}, heightStyle, style || {});
|
|
783
|
-
}
|
|
784
|
-
// @en When the front or last slider is manually placed to the rear or the front through transform, it can be considered as the total or -1 module in the display layer
|
|
785
|
-
|
|
689
|
+
}
|
|
786
690
|
|
|
691
|
+
// 当最前或最后的滑块通过transform手动被放置到最后或最前时,在展示层可以认为是第total个或第-1个模块
|
|
692
|
+
// @en When the front or last slider is manually placed to the rear or the front through transform, it can be considered as the total or -1 module in the display layer
|
|
787
693
|
function getShownChildIndex(curIndex) {
|
|
788
694
|
var childIndex = curIndex;
|
|
789
|
-
|
|
790
695
|
if (transforms[childIndex] * rtlRatio > 0) {
|
|
791
696
|
childIndex = total;
|
|
792
697
|
} else if (transforms[childIndex] * rtlRatio < 0) {
|
|
793
698
|
childIndex = -1;
|
|
794
699
|
}
|
|
795
|
-
|
|
796
700
|
return childIndex;
|
|
797
|
-
}
|
|
798
|
-
// @en When there is exposed content on both sides, it is necessary to fake the front and rear dom to make visual filling in order to connect circularly.
|
|
799
|
-
|
|
701
|
+
}
|
|
800
702
|
|
|
703
|
+
// 当两侧有露出内容时,为了循环衔接上需要fake前后的dom来做视觉填充
|
|
704
|
+
// @en When there is exposed content on both sides, it is necessary to fake the front and rear dom to make visual filling in order to connect circularly.
|
|
801
705
|
function setCurrentFakeIndex() {
|
|
802
706
|
var newIndexes = fakeIndexes.slice();
|
|
803
|
-
|
|
804
707
|
if (childSize <= 0) {
|
|
805
708
|
if (index === 0) {
|
|
806
709
|
newIndexes[0] = {
|
|
@@ -808,88 +711,73 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
808
711
|
side: 'left'
|
|
809
712
|
};
|
|
810
713
|
}
|
|
811
|
-
|
|
812
714
|
if (index === total - 1) {
|
|
813
715
|
newIndexes[2] = {
|
|
814
716
|
index: 0,
|
|
815
717
|
side: 'right'
|
|
816
718
|
};
|
|
817
719
|
}
|
|
818
|
-
|
|
819
720
|
setFakeIndexes(newIndexes);
|
|
820
721
|
return;
|
|
821
722
|
}
|
|
822
|
-
|
|
823
723
|
if (index === 1 && direction === rightDirec || index === 0 && direction !== rightDirec) {
|
|
824
724
|
newIndexes[0] = {
|
|
825
725
|
index: total - 1,
|
|
826
726
|
side: 'left'
|
|
827
727
|
};
|
|
828
728
|
}
|
|
829
|
-
|
|
830
729
|
if (index === 0 && direction === rightDirec || index === -1) {
|
|
831
730
|
newIndexes[1] = {
|
|
832
731
|
index: total - 2,
|
|
833
732
|
side: 'left'
|
|
834
733
|
};
|
|
835
734
|
}
|
|
836
|
-
|
|
837
735
|
if (index === total - 2 && direction === leftDirec || index === total - 1 && direction !== leftDirec) {
|
|
838
736
|
newIndexes[2] = {
|
|
839
737
|
index: 0,
|
|
840
738
|
side: 'right'
|
|
841
739
|
};
|
|
842
740
|
}
|
|
843
|
-
|
|
844
741
|
if (index === total - 1 && direction === leftDirec || index === total) {
|
|
845
742
|
newIndexes[3] = {
|
|
846
743
|
index: 1,
|
|
847
744
|
side: 'right'
|
|
848
745
|
};
|
|
849
746
|
}
|
|
850
|
-
|
|
851
747
|
setFakeIndexes(newIndexes);
|
|
852
748
|
}
|
|
853
|
-
|
|
854
749
|
function getItemTranslateStyle(childIndex, ratio) {
|
|
855
750
|
var dis = index - childIndex;
|
|
856
751
|
var prefix = dis > 0 ? 1 : -1;
|
|
857
752
|
var transPercent = 1 - inactiveValidScale;
|
|
858
753
|
var ratioWithRtl = ratio * rtlRatio;
|
|
859
754
|
var trans = 0;
|
|
860
|
-
|
|
861
755
|
if (Math.abs(dis) > 1) {
|
|
862
756
|
trans = (prefix * (Math.abs(dis) - 1) - ratioWithRtl) * transPercent * rtlRatio;
|
|
863
757
|
} else if (dis === -1 && ratioWithRtl > 0 || dis === 1 && ratioWithRtl < 0) {
|
|
864
758
|
trans = -1 * ratio * transPercent;
|
|
865
759
|
}
|
|
866
|
-
|
|
867
760
|
return "translate" + (vertical ? 'Y' : 'X') + "(" + trans * 100 + "%)";
|
|
868
761
|
}
|
|
869
|
-
|
|
870
762
|
function getItemScaleStyle(childIndex, ratio) {
|
|
871
|
-
var originScale = inactiveValidScale;
|
|
763
|
+
var originScale = inactiveValidScale;
|
|
764
|
+
// active滑块前后两侧的滑块,根据滑动距离等比放大
|
|
872
765
|
// @en The front and rear sides of the active slider, and zoom in proportionally according to the sliding distance
|
|
873
|
-
|
|
874
766
|
if (childIndex === index - 1 && direction === rightDirec || childIndex === index + 1 && direction === leftDirec) {
|
|
875
767
|
return originScale + (1 - originScale) * Math.abs(ratio);
|
|
876
|
-
}
|
|
768
|
+
}
|
|
769
|
+
// active的滑块,根据滑动距离等比缩小
|
|
877
770
|
// @en The active slider, zoom out proportionally according to the sliding distance
|
|
878
|
-
|
|
879
|
-
|
|
880
771
|
if (childIndex === index) {
|
|
881
772
|
return 1 - (1 - originScale) * Math.abs(ratio);
|
|
882
|
-
}
|
|
773
|
+
}
|
|
774
|
+
// 其他保持inactiveScale即可
|
|
883
775
|
// @en Others remain inactiveScale
|
|
884
|
-
|
|
885
|
-
|
|
886
776
|
return originScale;
|
|
887
777
|
}
|
|
888
|
-
|
|
889
778
|
function getItemOriginStyle(childIndex) {
|
|
890
779
|
var origin = 0.5;
|
|
891
780
|
var dis = childIndex - index;
|
|
892
|
-
|
|
893
781
|
if (dis === 0) {
|
|
894
782
|
// 当前active的卡片,随滑动方向切换origin
|
|
895
783
|
// @en The currently active card, switch origin with the sliding direction
|
|
@@ -903,21 +791,19 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
903
791
|
// @en The cards after the currently active card, the origin is on the far left
|
|
904
792
|
origin = horizontalUseRtl ? 1 : 0;
|
|
905
793
|
}
|
|
906
|
-
|
|
907
794
|
var originStr = origin * 100 + "%";
|
|
908
795
|
return vertical ? "center " + originStr : originStr + " center";
|
|
909
796
|
}
|
|
910
|
-
|
|
911
797
|
function getItemInnerStyle(curIndex) {
|
|
912
798
|
var transitionStyle = getSlideTransitionStyle();
|
|
913
799
|
var childIndex = getShownChildIndex(curIndex);
|
|
914
|
-
var ratio = distance / childSize || 0;
|
|
800
|
+
var ratio = distance / childSize || 0;
|
|
801
|
+
// 有放大效果的item,随着distance变化而变化scale和transform-origin
|
|
915
802
|
// @en Item with magnification effect, scale and transform-origin change with distance
|
|
916
803
|
// transform效果与fake dom时item的transform需隔离,且scale后会影响item的padding展示
|
|
917
804
|
// @en The transform effect of the item needs to be isolated from the fake dom, and the padding display of the item will be affected after scale.
|
|
918
805
|
// 因此需要缩放时多包裹一层item-inner,单独处理缩放逻辑
|
|
919
806
|
// @en Therefore, need to wrap an additional layer of item-inner when scaling, and handle the scaling logic separately
|
|
920
|
-
|
|
921
807
|
var scale = getItemScaleStyle(childIndex, ratio);
|
|
922
808
|
var transformStyle = {
|
|
923
809
|
transform: getItemTranslateStyle(childIndex, ratio) + " scale(" + scale + ")",
|
|
@@ -925,10 +811,8 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
925
811
|
};
|
|
926
812
|
return getStyleWithVendor(_extends({}, transitionStyle, transformStyle));
|
|
927
813
|
}
|
|
928
|
-
|
|
929
814
|
function getItemFakeStyle(childIndex) {
|
|
930
815
|
var _extends2, _ref, _ref2;
|
|
931
|
-
|
|
932
816
|
var styleMap = {
|
|
933
817
|
leftDirec: vertical ? 'top' : leftDirec,
|
|
934
818
|
rightDirec: vertical ? 'bottom' : rightDirec,
|
|
@@ -939,10 +823,8 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
939
823
|
position: 'absolute'
|
|
940
824
|
}, _extends2[styleMap.otherDirec] = 0, _extends2), childIndex >= 0 ? (_ref = {}, _ref[styleMap.leftDirec] = childSize > 0 ? '100%' : total * 100 + "%", _ref.transform = "translate" + styleMap.trans + "(" + (childIndex - total) * rtlRatio * 100 + "%)", _ref) : (_ref2 = {}, _ref2[styleMap.rightDirec] = '100%', _ref2.transform = "translate" + styleMap.trans + "(" + (childIndex + 1) * rtlRatio * 100 + "%)", _ref2));
|
|
941
825
|
}
|
|
942
|
-
|
|
943
826
|
function getItemStyle(childIndex, isFake) {
|
|
944
827
|
var _ref3, _ref4;
|
|
945
|
-
|
|
946
828
|
var initialStartSpace = spaceBetween + leftOffset;
|
|
947
829
|
var initialEndSpace = spaceBetween + rightOffset;
|
|
948
830
|
var initalSize = vertical ? userSetBoxHeight : '100%';
|
|
@@ -953,26 +835,23 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
953
835
|
paddingStart: vertical ? 'paddingTop' : horizontalPaddingStart,
|
|
954
836
|
paddingEnd: vertical ? 'paddingBottom' : horizontalPaddingEnd,
|
|
955
837
|
translate: vertical ? 'translateY' : 'translateX'
|
|
956
|
-
};
|
|
838
|
+
};
|
|
839
|
+
// bugfix: item 为半透明状态下 fakeItem 和普通 item 重叠露馅问题
|
|
957
840
|
// @en bugfix: Solve the problem of overlapping fakeItem and the normal item when item is translucent
|
|
958
|
-
|
|
959
841
|
var transformStyle = isFake ? {
|
|
960
842
|
visibility: childIndex === total && transforms[0] > 0 || childIndex === -1 && transforms[total - 1] < 0 ? 'hidden' : 'initial'
|
|
961
843
|
} : {
|
|
962
844
|
transform: styleMap.translate + "(" + (transforms[childIndex] || 0) + "px)"
|
|
963
|
-
};
|
|
845
|
+
};
|
|
846
|
+
// childSize <= 0 说明是未全部加载完成的首屏情况 做一下特殊处理
|
|
964
847
|
// @en childSize <= 0 indicates that the first screen is not fully loaded, so do some special treatment
|
|
965
|
-
|
|
966
848
|
var layoutStyle = childSize > 0 ? (_ref3 = {}, _ref3[styleMap.size] = childSize - spaceBetween, _ref3[styleMap.paddingStart] = spaceBetween, _ref3.boxSizing = 'content-box', _ref3) : (_ref4 = {}, _ref4[styleMap.size] = initalSize, _ref4[styleMap.paddingStart] = initialStartSpace, _ref4[styleMap.paddingEnd] = initialEndSpace, _ref4.boxSizing = 'border-box', _ref4.transform = styleMap.translate + "(" + (childIndex === index ? 0 : (index - childIndex) * (spaceBetween + leftOffset + rightOffset)) + "px)", _ref4);
|
|
967
849
|
var fakeStyle = isFake ? getItemFakeStyle(childIndex) : {};
|
|
968
|
-
|
|
969
850
|
if (isFake && childSize < 0) {
|
|
970
851
|
delete fakeStyle.transform;
|
|
971
852
|
}
|
|
972
|
-
|
|
973
853
|
return getStyleWithVendor(_extends({}, transformStyle, layoutStyle, fakeStyle));
|
|
974
854
|
}
|
|
975
|
-
|
|
976
855
|
function renderChild(child, childIndex, prefix) {
|
|
977
856
|
// 兼容线上逻辑,不需要切换放大效果的,不包裹item-inner
|
|
978
857
|
// @en No need to switch the magnification effect, do not wrap item-inner
|
|
@@ -981,12 +860,10 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
981
860
|
style: getItemInnerStyle(childIndex)
|
|
982
861
|
}, child);
|
|
983
862
|
}
|
|
984
|
-
|
|
985
863
|
function renderFakeItem(prefix, fakeIndex, side) {
|
|
986
864
|
if (!fakeItem || fakeIndex === void 0) {
|
|
987
865
|
return null;
|
|
988
866
|
}
|
|
989
|
-
|
|
990
867
|
var posIndex = side === 'left' ? fakeIndex - total : fakeIndex + total;
|
|
991
868
|
return /*#__PURE__*/React.createElement("div", {
|
|
992
869
|
key: "" + fakeIndex + posIndex,
|
|
@@ -998,16 +875,13 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
998
875
|
style: getItemStyle(posIndex, true)
|
|
999
876
|
}, renderChild(allChildren[fakeIndex], posIndex, prefix));
|
|
1000
877
|
}
|
|
1001
|
-
|
|
1002
878
|
function renderAllFakeItem(prefix) {
|
|
1003
879
|
return fakeIndexes.map(function (fakeIndex) {
|
|
1004
880
|
return renderFakeItem(prefix, fakeIndex.index, fakeIndex.side);
|
|
1005
881
|
});
|
|
1006
882
|
}
|
|
1007
|
-
|
|
1008
883
|
function renderCarousel(_ref5) {
|
|
1009
884
|
var _cls;
|
|
1010
|
-
|
|
1011
885
|
var prefixCls = _ref5.prefixCls;
|
|
1012
886
|
var prefix = prefixCls + "-carousel";
|
|
1013
887
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1061,7 +935,6 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1061
935
|
});
|
|
1062
936
|
})) : null);
|
|
1063
937
|
}
|
|
1064
|
-
|
|
1065
938
|
return /*#__PURE__*/React.createElement(ContextLayout, null, renderCarousel);
|
|
1066
939
|
});
|
|
1067
940
|
export default Carousel;
|