@arco-design/mobile-react 2.31.5 → 2.32.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/CHANGELOG.md +23 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/index.d.ts +1 -0
- package/cjs/_helpers/index.js +9 -0
- package/cjs/_helpers/react-dom.js +18 -10
- package/cjs/stepper/style/css/index.css +3 -4
- package/cjs/stepper/style/index.less +1 -2
- package/dist/index.js +91 -66
- package/dist/index.min.js +4 -4
- package/dist/style.css +1 -2
- package/dist/style.min.css +1 -1
- package/esm/_helpers/index.d.ts +1 -0
- package/esm/_helpers/index.js +1 -0
- package/esm/_helpers/react-dom.js +15 -11
- package/esm/stepper/style/css/index.css +3 -4
- package/esm/stepper/style/index.less +1 -2
- package/esnext/_helpers/hooks.d.ts +290 -0
- package/esnext/_helpers/hooks.js +660 -0
- package/esnext/_helpers/index.d.ts +93 -0
- package/esnext/_helpers/index.js +110 -0
- package/esnext/_helpers/react-dom.d.ts +13 -0
- package/esnext/_helpers/react-dom.js +51 -0
- package/esnext/_helpers/render.d.ts +17 -0
- package/esnext/_helpers/render.js +38 -0
- package/esnext/_helpers/type.d.ts +30 -0
- package/esnext/_helpers/type.js +1 -0
- package/esnext/action-sheet/index.d.ts +106 -0
- package/esnext/action-sheet/index.js +53 -0
- package/esnext/action-sheet/methods.d.ts +10 -0
- package/esnext/action-sheet/methods.js +4 -0
- package/esnext/action-sheet/style/css/index.css +741 -0
- package/esnext/action-sheet/style/css/index.d.ts +3 -0
- package/esnext/action-sheet/style/css/index.js +3 -0
- package/esnext/action-sheet/style/index.d.ts +3 -0
- package/esnext/action-sheet/style/index.js +3 -0
- package/esnext/action-sheet/style/index.less +119 -0
- package/esnext/avatar/group.d.ts +9 -0
- package/esnext/avatar/group.js +35 -0
- package/esnext/avatar/index.d.ts +17 -0
- package/esnext/avatar/index.js +87 -0
- package/esnext/avatar/style/css/index.css +792 -0
- package/esnext/avatar/style/css/index.d.ts +3 -0
- package/esnext/avatar/style/css/index.js +3 -0
- package/esnext/avatar/style/index.d.ts +3 -0
- package/esnext/avatar/style/index.js +3 -0
- package/esnext/avatar/style/index.less +201 -0
- package/esnext/avatar/type.d.ts +126 -0
- package/esnext/avatar/type.js +1 -0
- package/esnext/badge/index.d.ts +80 -0
- package/esnext/badge/index.js +29 -0
- package/esnext/badge/style/css/index.css +640 -0
- package/esnext/badge/style/css/index.d.ts +2 -0
- package/esnext/badge/style/css/index.js +2 -0
- package/esnext/badge/style/index.d.ts +2 -0
- package/esnext/badge/style/index.js +2 -0
- package/esnext/badge/style/index.less +109 -0
- package/esnext/button/hooks.d.ts +8 -0
- package/esnext/button/hooks.js +45 -0
- package/esnext/button/index.d.ts +141 -0
- package/esnext/button/index.js +61 -0
- package/esnext/button/style/css/index.css +816 -0
- package/esnext/button/style/css/index.d.ts +3 -0
- package/esnext/button/style/css/index.js +3 -0
- package/esnext/button/style/index.d.ts +3 -0
- package/esnext/button/style/index.js +3 -0
- package/esnext/button/style/index.less +242 -0
- package/esnext/carousel/index.d.ts +383 -0
- package/esnext/carousel/index.js +840 -0
- package/esnext/carousel/style/css/index.css +748 -0
- package/esnext/carousel/style/css/index.d.ts +2 -0
- package/esnext/carousel/style/css/index.js +2 -0
- package/esnext/carousel/style/index.d.ts +2 -0
- package/esnext/carousel/style/index.js +2 -0
- package/esnext/carousel/style/index.less +263 -0
- package/esnext/cell/arrow.d.ts +2 -0
- package/esnext/cell/arrow.js +5 -0
- package/esnext/cell/cell.d.ts +3 -0
- package/esnext/cell/cell.js +24 -0
- package/esnext/cell/group.d.ts +7 -0
- package/esnext/cell/group.js +26 -0
- package/esnext/cell/index.d.ts +14 -0
- package/esnext/cell/index.js +16 -0
- package/esnext/cell/style/css/index.css +1008 -0
- package/esnext/cell/style/css/index.d.ts +2 -0
- package/esnext/cell/style/css/index.js +2 -0
- package/esnext/cell/style/index.d.ts +2 -0
- package/esnext/cell/style/index.js +2 -0
- package/esnext/cell/style/index.less +214 -0
- package/esnext/cell/type.d.ts +125 -0
- package/esnext/cell/type.js +1 -0
- package/esnext/checkbox/checkbox.d.ts +3 -0
- package/esnext/checkbox/checkbox.js +106 -0
- package/esnext/checkbox/group.d.ts +4 -0
- package/esnext/checkbox/group.js +54 -0
- package/esnext/checkbox/hooks/index.d.ts +1 -0
- package/esnext/checkbox/hooks/index.js +1 -0
- package/esnext/checkbox/hooks/useMergeProps.d.ts +3 -0
- package/esnext/checkbox/hooks/useMergeProps.js +20 -0
- package/esnext/checkbox/index.d.ts +19 -0
- package/esnext/checkbox/index.js +22 -0
- package/esnext/checkbox/style/css/index.css +613 -0
- package/esnext/checkbox/style/css/index.d.ts +2 -0
- package/esnext/checkbox/style/css/index.js +2 -0
- package/esnext/checkbox/style/index.d.ts +2 -0
- package/esnext/checkbox/style/index.js +2 -0
- package/esnext/checkbox/style/index.less +119 -0
- package/esnext/checkbox/type.d.ts +162 -0
- package/esnext/checkbox/type.js +27 -0
- package/esnext/circle-progress/index.d.ts +141 -0
- package/esnext/circle-progress/index.js +75 -0
- package/esnext/circle-progress/style/css/index.css +582 -0
- package/esnext/circle-progress/style/css/index.d.ts +2 -0
- package/esnext/circle-progress/style/css/index.js +2 -0
- package/esnext/circle-progress/style/index.d.ts +2 -0
- package/esnext/circle-progress/style/index.js +2 -0
- package/esnext/circle-progress/style/index.less +101 -0
- package/esnext/collapse/collapse.d.ts +3 -0
- package/esnext/collapse/collapse.js +111 -0
- package/esnext/collapse/group.d.ts +21 -0
- package/esnext/collapse/group.js +80 -0
- package/esnext/collapse/index.d.ts +23 -0
- package/esnext/collapse/index.js +14 -0
- package/esnext/collapse/style/css/index.css +662 -0
- package/esnext/collapse/style/css/index.d.ts +2 -0
- package/esnext/collapse/style/css/index.js +2 -0
- package/esnext/collapse/style/index.d.ts +2 -0
- package/esnext/collapse/style/index.js +2 -0
- package/esnext/collapse/style/index.less +106 -0
- package/esnext/collapse/type.d.ts +139 -0
- package/esnext/collapse/type.js +1 -0
- package/esnext/collapse/utils.d.ts +8 -0
- package/esnext/collapse/utils.js +16 -0
- package/esnext/context-provider/index.d.ts +74 -0
- package/esnext/context-provider/index.js +99 -0
- package/esnext/context-provider/style/css/index.css +0 -0
- package/esnext/context-provider/style/css/index.d.ts +2 -0
- package/esnext/context-provider/style/css/index.js +2 -0
- package/esnext/context-provider/style/index.d.ts +2 -0
- package/esnext/context-provider/style/index.js +2 -0
- package/esnext/context-provider/style/index.less +1 -0
- package/esnext/count-down/hooks.d.ts +10 -0
- package/esnext/count-down/hooks.js +107 -0
- package/esnext/count-down/index.d.ts +13 -0
- package/esnext/count-down/index.js +37 -0
- package/esnext/count-down/singleton.d.ts +15 -0
- package/esnext/count-down/singleton.js +52 -0
- package/esnext/count-down/style/css/index.css +534 -0
- package/esnext/count-down/style/css/index.d.ts +2 -0
- package/esnext/count-down/style/css/index.js +2 -0
- package/esnext/count-down/style/index.d.ts +2 -0
- package/esnext/count-down/style/index.js +2 -0
- package/esnext/count-down/style/index.less +37 -0
- package/esnext/count-down/type.d.ts +112 -0
- package/esnext/count-down/type.js +1 -0
- package/esnext/count-down/util.d.ts +8 -0
- package/esnext/count-down/util.js +106 -0
- package/esnext/date-picker/helper.d.ts +5 -0
- package/esnext/date-picker/helper.js +38 -0
- package/esnext/date-picker/index.d.ts +24 -0
- package/esnext/date-picker/index.js +217 -0
- package/esnext/date-picker/style/css/index.css +526 -0
- package/esnext/date-picker/style/css/index.d.ts +3 -0
- package/esnext/date-picker/style/css/index.js +3 -0
- package/esnext/date-picker/style/index.d.ts +3 -0
- package/esnext/date-picker/style/index.js +3 -0
- package/esnext/date-picker/style/index.less +30 -0
- package/esnext/date-picker/type.d.ts +114 -0
- package/esnext/date-picker/type.js +1 -0
- package/esnext/dialog/index.d.ts +213 -0
- package/esnext/dialog/index.js +87 -0
- package/esnext/dialog/methods.d.ts +20 -0
- package/esnext/dialog/methods.js +42 -0
- package/esnext/dialog/style/css/index.css +1111 -0
- package/esnext/dialog/style/css/index.d.ts +3 -0
- package/esnext/dialog/style/css/index.js +3 -0
- package/esnext/dialog/style/index.d.ts +3 -0
- package/esnext/dialog/style/index.js +3 -0
- package/esnext/dialog/style/index.less +376 -0
- package/esnext/divider/index.d.ts +49 -0
- package/esnext/divider/index.js +32 -0
- package/esnext/divider/style/css/index.css +609 -0
- package/esnext/divider/style/css/index.d.ts +2 -0
- package/esnext/divider/style/css/index.js +2 -0
- package/esnext/divider/style/index.d.ts +2 -0
- package/esnext/divider/style/index.js +2 -0
- package/esnext/divider/style/index.less +101 -0
- package/esnext/dropdown/dropdown.d.ts +3 -0
- package/esnext/dropdown/dropdown.js +196 -0
- package/esnext/dropdown/index.d.ts +14 -0
- package/esnext/dropdown/index.js +16 -0
- package/esnext/dropdown/options.d.ts +4 -0
- package/esnext/dropdown/options.js +61 -0
- package/esnext/dropdown/style/css/index.css +653 -0
- package/esnext/dropdown/style/css/index.d.ts +2 -0
- package/esnext/dropdown/style/css/index.js +2 -0
- package/esnext/dropdown/style/index.d.ts +2 -0
- package/esnext/dropdown/style/index.js +2 -0
- package/esnext/dropdown/style/index.less +177 -0
- package/esnext/dropdown/type.d.ts +269 -0
- package/esnext/dropdown/type.js +1 -0
- package/esnext/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/esnext/dropdown-menu/dropdown-menu.js +161 -0
- package/esnext/dropdown-menu/helper.d.ts +34 -0
- package/esnext/dropdown-menu/helper.js +88 -0
- package/esnext/dropdown-menu/index.d.ts +12 -0
- package/esnext/dropdown-menu/index.js +13 -0
- package/esnext/dropdown-menu/style/css/index.css +705 -0
- package/esnext/dropdown-menu/style/css/index.d.ts +3 -0
- package/esnext/dropdown-menu/style/css/index.js +3 -0
- package/esnext/dropdown-menu/style/index.d.ts +3 -0
- package/esnext/dropdown-menu/style/index.js +3 -0
- package/esnext/dropdown-menu/style/index.less +122 -0
- package/esnext/dropdown-menu/type.d.ts +168 -0
- package/esnext/dropdown-menu/type.js +1 -0
- package/esnext/ellipsis/components/js-ellipsis.d.ts +6 -0
- package/esnext/ellipsis/components/js-ellipsis.js +178 -0
- package/esnext/ellipsis/components/native-ellipsis.d.ts +5 -0
- package/esnext/ellipsis/components/native-ellipsis.js +15 -0
- package/esnext/ellipsis/index.d.ts +13 -0
- package/esnext/ellipsis/index.js +31 -0
- package/esnext/ellipsis/style/css/index.css +556 -0
- package/esnext/ellipsis/style/css/index.d.ts +2 -0
- package/esnext/ellipsis/style/css/index.js +2 -0
- package/esnext/ellipsis/style/index.d.ts +2 -0
- package/esnext/ellipsis/style/index.js +2 -0
- package/esnext/ellipsis/style/index.less +63 -0
- package/esnext/ellipsis/type.d.ts +107 -0
- package/esnext/ellipsis/type.js +1 -0
- package/esnext/ellipsis/utils/dom.d.ts +2 -0
- package/esnext/ellipsis/utils/dom.js +35 -0
- package/esnext/ellipsis/utils/is.d.ts +3 -0
- package/esnext/ellipsis/utils/is.js +3 -0
- package/esnext/form/form-item-context.d.ts +3 -0
- package/esnext/form/form-item-context.js +6 -0
- package/esnext/form/form-item.d.ts +4 -0
- package/esnext/form/form-item.js +218 -0
- package/esnext/form/index.d.ts +16 -0
- package/esnext/form/index.js +50 -0
- package/esnext/form/linked-container.d.ts +8 -0
- package/esnext/form/linked-container.js +29 -0
- package/esnext/form/style/css/index.css +670 -0
- package/esnext/form/style/css/index.d.ts +2 -0
- package/esnext/form/style/css/index.js +2 -0
- package/esnext/form/style/index.d.ts +2 -0
- package/esnext/form/style/index.js +2 -0
- package/esnext/form/style/index.less +172 -0
- package/esnext/form/type.d.ts +373 -0
- package/esnext/form/type.js +26 -0
- package/esnext/form/useForm.d.ts +18 -0
- package/esnext/form/useForm.js +203 -0
- package/esnext/form/utils.d.ts +7 -0
- package/esnext/form/utils.js +21 -0
- package/esnext/grid/index.d.ts +112 -0
- package/esnext/grid/index.js +79 -0
- package/esnext/grid/style/css/index.css +661 -0
- package/esnext/grid/style/css/index.d.ts +2 -0
- package/esnext/grid/style/css/index.js +2 -0
- package/esnext/grid/style/index.d.ts +2 -0
- package/esnext/grid/style/index.js +2 -0
- package/esnext/grid/style/index.less +157 -0
- package/esnext/icon/IconAdd/index.d.ts +7 -0
- package/esnext/icon/IconAdd/index.js +7 -0
- package/esnext/icon/IconArrowBack/index.d.ts +7 -0
- package/esnext/icon/IconArrowBack/index.js +7 -0
- package/esnext/icon/IconArrowDown/index.d.ts +7 -0
- package/esnext/icon/IconArrowDown/index.js +7 -0
- package/esnext/icon/IconArrowIn/index.d.ts +7 -0
- package/esnext/icon/IconArrowIn/index.js +7 -0
- package/esnext/icon/IconArrowUp/index.d.ts +7 -0
- package/esnext/icon/IconArrowUp/index.js +7 -0
- package/esnext/icon/IconCheck/index.d.ts +7 -0
- package/esnext/icon/IconCheck/index.js +7 -0
- package/esnext/icon/IconCheckBold/index.d.ts +7 -0
- package/esnext/icon/IconCheckBold/index.js +8 -0
- package/esnext/icon/IconCircleChecked/index.d.ts +7 -0
- package/esnext/icon/IconCircleChecked/index.js +7 -0
- package/esnext/icon/IconCircleDisabled/index.d.ts +7 -0
- package/esnext/icon/IconCircleDisabled/index.js +7 -0
- package/esnext/icon/IconCircleUnchecked/index.d.ts +7 -0
- package/esnext/icon/IconCircleUnchecked/index.js +7 -0
- package/esnext/icon/IconClear/index.d.ts +7 -0
- package/esnext/icon/IconClear/index.js +7 -0
- package/esnext/icon/IconClose/index.d.ts +7 -0
- package/esnext/icon/IconClose/index.js +7 -0
- package/esnext/icon/IconCloseBold/index.d.ts +7 -0
- package/esnext/icon/IconCloseBold/index.js +8 -0
- package/esnext/icon/IconDelete/index.d.ts +7 -0
- package/esnext/icon/IconDelete/index.js +7 -0
- package/esnext/icon/IconDownload/index.d.ts +7 -0
- package/esnext/icon/IconDownload/index.js +7 -0
- package/esnext/icon/IconEdit/index.d.ts +7 -0
- package/esnext/icon/IconEdit/index.js +7 -0
- package/esnext/icon/IconErrorCircle/index.d.ts +7 -0
- package/esnext/icon/IconErrorCircle/index.js +8 -0
- package/esnext/icon/IconEyeInvisible/index.d.ts +7 -0
- package/esnext/icon/IconEyeInvisible/index.js +7 -0
- package/esnext/icon/IconEyeVisible/index.d.ts +7 -0
- package/esnext/icon/IconEyeVisible/index.js +7 -0
- package/esnext/icon/IconEyelashInvisible/index.d.ts +7 -0
- package/esnext/icon/IconEyelashInvisible/index.js +7 -0
- package/esnext/icon/IconFile/index.d.ts +7 -0
- package/esnext/icon/IconFile/index.js +7 -0
- package/esnext/icon/IconGift/index.d.ts +7 -0
- package/esnext/icon/IconGift/index.js +8 -0
- package/esnext/icon/IconHeart/index.d.ts +7 -0
- package/esnext/icon/IconHeart/index.js +8 -0
- package/esnext/icon/IconHome/index.d.ts +7 -0
- package/esnext/icon/IconHome/index.js +7 -0
- package/esnext/icon/IconKeyboard/index.d.ts +7 -0
- package/esnext/icon/IconKeyboard/index.js +8 -0
- package/esnext/icon/IconKeyboardDelete/index.d.ts +7 -0
- package/esnext/icon/IconKeyboardDelete/index.js +8 -0
- package/esnext/icon/IconLikeCircle/index.d.ts +7 -0
- package/esnext/icon/IconLikeCircle/index.js +7 -0
- package/esnext/icon/IconMinus/index.d.ts +7 -0
- package/esnext/icon/IconMinus/index.js +8 -0
- package/esnext/icon/IconMore/index.d.ts +7 -0
- package/esnext/icon/IconMore/index.js +7 -0
- package/esnext/icon/IconNotice/index.d.ts +7 -0
- package/esnext/icon/IconNotice/index.js +8 -0
- package/esnext/icon/IconNoticeOff/index.d.ts +7 -0
- package/esnext/icon/IconNoticeOff/index.js +8 -0
- package/esnext/icon/IconPicture/index.d.ts +7 -0
- package/esnext/icon/IconPicture/index.js +7 -0
- package/esnext/icon/IconPlay/index.d.ts +7 -0
- package/esnext/icon/IconPlay/index.js +8 -0
- package/esnext/icon/IconQuestionCircle/index.d.ts +7 -0
- package/esnext/icon/IconQuestionCircle/index.js +7 -0
- package/esnext/icon/IconRefresh/index.d.ts +7 -0
- package/esnext/icon/IconRefresh/index.js +7 -0
- package/esnext/icon/IconSad/index.d.ts +7 -0
- package/esnext/icon/IconSad/index.js +7 -0
- package/esnext/icon/IconScan/index.d.ts +7 -0
- package/esnext/icon/IconScan/index.js +7 -0
- package/esnext/icon/IconSearch/index.d.ts +7 -0
- package/esnext/icon/IconSearch/index.js +7 -0
- package/esnext/icon/IconSetting/index.d.ts +7 -0
- package/esnext/icon/IconSetting/index.js +8 -0
- package/esnext/icon/IconShop/index.d.ts +7 -0
- package/esnext/icon/IconShop/index.js +8 -0
- package/esnext/icon/IconShopping/index.d.ts +7 -0
- package/esnext/icon/IconShopping/index.js +8 -0
- package/esnext/icon/IconSmileFill/index.d.ts +7 -0
- package/esnext/icon/IconSmileFill/index.js +7 -0
- package/esnext/icon/IconSound/index.d.ts +7 -0
- package/esnext/icon/IconSound/index.js +8 -0
- package/esnext/icon/IconSquareChecked/index.d.ts +7 -0
- package/esnext/icon/IconSquareChecked/index.js +7 -0
- package/esnext/icon/IconSquareDisabled/index.d.ts +7 -0
- package/esnext/icon/IconSquareDisabled/index.js +7 -0
- package/esnext/icon/IconSquareUnchecked/index.d.ts +7 -0
- package/esnext/icon/IconSquareUnchecked/index.js +7 -0
- package/esnext/icon/IconStar/index.d.ts +7 -0
- package/esnext/icon/IconStar/index.js +7 -0
- package/esnext/icon/IconStarFill/index.d.ts +7 -0
- package/esnext/icon/IconStarFill/index.js +8 -0
- package/esnext/icon/IconStarHalf/index.d.ts +7 -0
- package/esnext/icon/IconStarHalf/index.js +7 -0
- package/esnext/icon/IconSubway/index.d.ts +7 -0
- package/esnext/icon/IconSubway/index.js +8 -0
- package/esnext/icon/IconSuccessCircle/index.d.ts +7 -0
- package/esnext/icon/IconSuccessCircle/index.js +8 -0
- package/esnext/icon/IconTriDown/index.d.ts +7 -0
- package/esnext/icon/IconTriDown/index.js +8 -0
- package/esnext/icon/IconTriUp/index.d.ts +7 -0
- package/esnext/icon/IconTriUp/index.js +8 -0
- package/esnext/icon/IconUpload/index.d.ts +7 -0
- package/esnext/icon/IconUpload/index.js +7 -0
- package/esnext/icon/IconUser/index.d.ts +7 -0
- package/esnext/icon/IconUser/index.js +7 -0
- package/esnext/icon/IconUserFill/index.d.ts +7 -0
- package/esnext/icon/IconUserFill/index.js +7 -0
- package/esnext/icon/IconWarnCircle/index.d.ts +7 -0
- package/esnext/icon/IconWarnCircle/index.js +8 -0
- package/esnext/icon/IconWarnCircleFill/index.d.ts +7 -0
- package/esnext/icon/IconWarnCircleFill/index.js +8 -0
- package/esnext/icon/index.d.ts +59 -0
- package/esnext/icon/index.js +59 -0
- package/esnext/icon/type.d.ts +10 -0
- package/esnext/icon/type.js +1 -0
- package/esnext/image/index.d.ts +186 -0
- package/esnext/image/index.js +223 -0
- package/esnext/image/style/css/index.css +734 -0
- package/esnext/image/style/css/index.d.ts +3 -0
- package/esnext/image/style/css/index.js +3 -0
- package/esnext/image/style/index.d.ts +3 -0
- package/esnext/image/style/index.js +3 -0
- package/esnext/image/style/index.less +198 -0
- package/esnext/image-picker/add-icon.d.ts +2 -0
- package/esnext/image-picker/add-icon.js +5 -0
- package/esnext/image-picker/index.d.ts +16 -0
- package/esnext/image-picker/index.js +77 -0
- package/esnext/image-picker/style/css/index.css +688 -0
- package/esnext/image-picker/style/css/index.d.ts +4 -0
- package/esnext/image-picker/style/css/index.js +4 -0
- package/esnext/image-picker/style/index.d.ts +4 -0
- package/esnext/image-picker/style/index.js +4 -0
- package/esnext/image-picker/style/index.less +170 -0
- package/esnext/image-picker/type.d.ts +115 -0
- package/esnext/image-picker/type.js +1 -0
- package/esnext/image-preview/index.d.ts +296 -0
- package/esnext/image-preview/index.js +794 -0
- package/esnext/image-preview/methods.d.ts +13 -0
- package/esnext/image-preview/methods.js +46 -0
- package/esnext/image-preview/style/css/index.css +664 -0
- package/esnext/image-preview/style/css/index.d.ts +5 -0
- package/esnext/image-preview/style/css/index.js +5 -0
- package/esnext/image-preview/style/index.d.ts +5 -0
- package/esnext/image-preview/style/index.js +5 -0
- package/esnext/image-preview/style/index.less +140 -0
- package/esnext/index-bar/context.d.ts +3 -0
- package/esnext/index-bar/context.js +6 -0
- package/esnext/index-bar/group.d.ts +3 -0
- package/esnext/index-bar/group.js +33 -0
- package/esnext/index-bar/index.d.ts +15 -0
- package/esnext/index-bar/index.js +151 -0
- package/esnext/index-bar/side-bar.d.ts +3 -0
- package/esnext/index-bar/side-bar.js +44 -0
- package/esnext/index-bar/style/css/index.css +767 -0
- package/esnext/index-bar/style/css/index.d.ts +3 -0
- package/esnext/index-bar/style/css/index.js +3 -0
- package/esnext/index-bar/style/index.d.ts +3 -0
- package/esnext/index-bar/style/index.js +3 -0
- package/esnext/index-bar/style/index.less +189 -0
- package/esnext/index-bar/type.d.ts +195 -0
- package/esnext/index-bar/type.js +1 -0
- package/esnext/index-bar/utils.d.ts +6 -0
- package/esnext/index-bar/utils.js +44 -0
- package/esnext/index.d.ts +59 -0
- package/esnext/index.js +59 -0
- package/esnext/input/hooks.d.ts +14 -0
- package/esnext/input/hooks.js +174 -0
- package/esnext/input/index.d.ts +60 -0
- package/esnext/input/index.js +28 -0
- package/esnext/input/props.d.ts +182 -0
- package/esnext/input/props.js +1 -0
- package/esnext/input/style/css/index.css +759 -0
- package/esnext/input/style/css/index.d.ts +2 -0
- package/esnext/input/style/css/index.js +2 -0
- package/esnext/input/style/index.d.ts +2 -0
- package/esnext/input/style/index.js +2 -0
- package/esnext/input/style/index.less +195 -0
- package/esnext/keyboard/index.d.ts +13 -0
- package/esnext/keyboard/index.js +159 -0
- package/esnext/keyboard/style/css/index.css +633 -0
- package/esnext/keyboard/style/css/index.d.ts +3 -0
- package/esnext/keyboard/style/css/index.js +3 -0
- package/esnext/keyboard/style/index.d.ts +3 -0
- package/esnext/keyboard/style/index.js +3 -0
- package/esnext/keyboard/style/index.less +131 -0
- package/esnext/keyboard/type.d.ts +102 -0
- package/esnext/keyboard/type.js +1 -0
- package/esnext/load-more/index.d.ts +158 -0
- package/esnext/load-more/index.js +150 -0
- package/esnext/load-more/style/css/index.css +534 -0
- package/esnext/load-more/style/css/index.d.ts +2 -0
- package/esnext/load-more/style/css/index.js +2 -0
- package/esnext/load-more/style/index.d.ts +2 -0
- package/esnext/load-more/style/index.js +2 -0
- package/esnext/load-more/style/index.less +37 -0
- package/esnext/loading/index.d.ts +76 -0
- package/esnext/loading/index.js +123 -0
- package/esnext/loading/style/css/index.css +648 -0
- package/esnext/loading/style/css/index.d.ts +2 -0
- package/esnext/loading/style/css/index.js +2 -0
- package/esnext/loading/style/index.d.ts +2 -0
- package/esnext/loading/style/index.js +2 -0
- package/esnext/loading/style/index.less +147 -0
- package/esnext/masking/index.d.ts +225 -0
- package/esnext/masking/index.js +114 -0
- package/esnext/masking/methods.d.ts +23 -0
- package/esnext/masking/methods.js +56 -0
- package/esnext/masking/style/css/index.css +552 -0
- package/esnext/masking/style/css/index.d.ts +3 -0
- package/esnext/masking/style/css/index.js +3 -0
- package/esnext/masking/style/index.d.ts +3 -0
- package/esnext/masking/style/index.js +3 -0
- package/esnext/masking/style/index.less +55 -0
- package/esnext/nav-bar/back-icon.d.ts +5 -0
- package/esnext/nav-bar/back-icon.js +9 -0
- package/esnext/nav-bar/index.d.ts +135 -0
- package/esnext/nav-bar/index.js +96 -0
- package/esnext/nav-bar/style/css/index.css +706 -0
- package/esnext/nav-bar/style/css/index.d.ts +2 -0
- package/esnext/nav-bar/style/css/index.js +2 -0
- package/esnext/nav-bar/style/index.d.ts +2 -0
- package/esnext/nav-bar/style/index.js +2 -0
- package/esnext/nav-bar/style/index.less +150 -0
- package/esnext/notice-bar/index.d.ts +107 -0
- package/esnext/notice-bar/index.js +126 -0
- package/esnext/notice-bar/style/css/index.css +685 -0
- package/esnext/notice-bar/style/css/index.d.ts +2 -0
- package/esnext/notice-bar/style/css/index.js +2 -0
- package/esnext/notice-bar/style/index.d.ts +2 -0
- package/esnext/notice-bar/style/index.js +2 -0
- package/esnext/notice-bar/style/index.less +160 -0
- package/esnext/notify/index.d.ts +97 -0
- package/esnext/notify/index.js +123 -0
- package/esnext/notify/methods.d.ts +14 -0
- package/esnext/notify/methods.js +63 -0
- package/esnext/notify/style/css/index.css +591 -0
- package/esnext/notify/style/css/index.d.ts +2 -0
- package/esnext/notify/style/css/index.js +2 -0
- package/esnext/notify/style/index.d.ts +2 -0
- package/esnext/notify/style/index.js +2 -0
- package/esnext/notify/style/index.less +90 -0
- package/esnext/notify/type.d.ts +70 -0
- package/esnext/notify/type.js +1 -0
- package/esnext/pagination/arrow.d.ts +2 -0
- package/esnext/pagination/arrow.js +5 -0
- package/esnext/pagination/index.d.ts +124 -0
- package/esnext/pagination/index.js +104 -0
- package/esnext/pagination/style/css/index.css +708 -0
- package/esnext/pagination/style/css/index.d.ts +2 -0
- package/esnext/pagination/style/css/index.js +2 -0
- package/esnext/pagination/style/index.d.ts +2 -0
- package/esnext/pagination/style/index.js +2 -0
- package/esnext/pagination/style/index.less +176 -0
- package/esnext/picker/index.d.ts +50 -0
- package/esnext/picker/index.js +93 -0
- package/esnext/picker/style/css/index.css +592 -0
- package/esnext/picker/style/css/index.d.ts +4 -0
- package/esnext/picker/style/css/index.js +4 -0
- package/esnext/picker/style/index.d.ts +4 -0
- package/esnext/picker/style/index.js +4 -0
- package/esnext/picker/style/index.less +95 -0
- package/esnext/picker/type.d.ts +131 -0
- package/esnext/picker/type.js +1 -0
- package/esnext/picker-view/components/cascader.d.ts +25 -0
- package/esnext/picker-view/components/cascader.js +54 -0
- package/esnext/picker-view/components/multi-picker.d.ts +11 -0
- package/esnext/picker-view/components/multi-picker.js +32 -0
- package/esnext/picker-view/components/picker-cell.d.ts +28 -0
- package/esnext/picker-view/components/picker-cell.js +284 -0
- package/esnext/picker-view/index.d.ts +62 -0
- package/esnext/picker-view/index.js +135 -0
- package/esnext/picker-view/style/css/index.css +750 -0
- package/esnext/picker-view/style/css/index.d.ts +2 -0
- package/esnext/picker-view/style/css/index.js +2 -0
- package/esnext/picker-view/style/index.d.ts +2 -0
- package/esnext/picker-view/style/index.js +2 -0
- package/esnext/picker-view/style/index.less +125 -0
- package/esnext/picker-view/type.d.ts +89 -0
- package/esnext/picker-view/type.js +1 -0
- package/esnext/popover/hooks/index.d.ts +2 -0
- package/esnext/popover/hooks/index.js +2 -0
- package/esnext/popover/hooks/useEvent.d.ts +8 -0
- package/esnext/popover/hooks/useEvent.js +148 -0
- package/esnext/popover/hooks/usePosition.d.ts +18 -0
- package/esnext/popover/hooks/usePosition.js +419 -0
- package/esnext/popover/index.d.ts +14 -0
- package/esnext/popover/index.js +20 -0
- package/esnext/popover/menu.d.ts +3 -0
- package/esnext/popover/menu.js +80 -0
- package/esnext/popover/popover-inner.d.ts +3 -0
- package/esnext/popover/popover-inner.js +79 -0
- package/esnext/popover/popover.d.ts +3 -0
- package/esnext/popover/popover.js +132 -0
- package/esnext/popover/style/css/index.css +993 -0
- package/esnext/popover/style/css/index.d.ts +3 -0
- package/esnext/popover/style/css/index.js +3 -0
- package/esnext/popover/style/css/menu.css +673 -0
- package/esnext/popover/style/index.d.ts +3 -0
- package/esnext/popover/style/index.js +3 -0
- package/esnext/popover/style/index.less +353 -0
- package/esnext/popover/style/menu.less +163 -0
- package/esnext/popover/type.d.ts +447 -0
- package/esnext/popover/type.js +1 -0
- package/esnext/popup/index.d.ts +86 -0
- package/esnext/popup/index.js +39 -0
- package/esnext/popup/methods.d.ts +10 -0
- package/esnext/popup/methods.js +4 -0
- package/esnext/popup/style/css/index.css +638 -0
- package/esnext/popup/style/css/index.d.ts +3 -0
- package/esnext/popup/style/css/index.js +3 -0
- package/esnext/popup/style/index.d.ts +3 -0
- package/esnext/popup/style/index.js +3 -0
- package/esnext/popup/style/index.less +114 -0
- package/esnext/popup-swiper/index.d.ts +93 -0
- package/esnext/popup-swiper/index.js +192 -0
- package/esnext/popup-swiper/methods.d.ts +10 -0
- package/esnext/popup-swiper/methods.js +4 -0
- package/esnext/popup-swiper/style/css/index.css +531 -0
- package/esnext/popup-swiper/style/css/index.d.ts +3 -0
- package/esnext/popup-swiper/style/css/index.js +3 -0
- package/esnext/popup-swiper/style/index.d.ts +3 -0
- package/esnext/popup-swiper/style/index.js +3 -0
- package/esnext/popup-swiper/style/index.less +35 -0
- package/esnext/portal/index.d.ts +23 -0
- package/esnext/portal/index.js +18 -0
- package/esnext/portal/style/css/index.css +0 -0
- package/esnext/portal/style/css/index.d.ts +2 -0
- package/esnext/portal/style/css/index.js +2 -0
- package/esnext/portal/style/index.d.ts +2 -0
- package/esnext/portal/style/index.js +2 -0
- package/esnext/portal/style/index.less +1 -0
- package/esnext/progress/index.d.ts +126 -0
- package/esnext/progress/index.js +66 -0
- package/esnext/progress/style/css/index.css +692 -0
- package/esnext/progress/style/css/index.d.ts +2 -0
- package/esnext/progress/style/css/index.js +2 -0
- package/esnext/progress/style/index.d.ts +2 -0
- package/esnext/progress/style/index.js +2 -0
- package/esnext/progress/style/index.less +205 -0
- package/esnext/pull-refresh/android-pull-refresh.d.ts +3 -0
- package/esnext/pull-refresh/android-pull-refresh.js +168 -0
- package/esnext/pull-refresh/hooks.d.ts +30 -0
- package/esnext/pull-refresh/hooks.js +73 -0
- package/esnext/pull-refresh/index.d.ts +28 -0
- package/esnext/pull-refresh/index.js +21 -0
- package/esnext/pull-refresh/ios-pull-refresh.d.ts +3 -0
- package/esnext/pull-refresh/ios-pull-refresh.js +137 -0
- package/esnext/pull-refresh/model.d.ts +111 -0
- package/esnext/pull-refresh/model.js +8 -0
- package/esnext/pull-refresh/style/css/index.css +650 -0
- package/esnext/pull-refresh/style/css/index.d.ts +3 -0
- package/esnext/pull-refresh/style/css/index.js +3 -0
- package/esnext/pull-refresh/style/index.d.ts +3 -0
- package/esnext/pull-refresh/style/index.js +3 -0
- package/esnext/pull-refresh/style/index.less +131 -0
- package/esnext/radio/group.d.ts +5 -0
- package/esnext/radio/group.js +50 -0
- package/esnext/radio/index.d.ts +19 -0
- package/esnext/radio/index.js +22 -0
- package/esnext/radio/radio.d.ts +5 -0
- package/esnext/radio/radio.js +13 -0
- package/esnext/radio/style/css/index.css +604 -0
- package/esnext/radio/style/css/index.d.ts +2 -0
- package/esnext/radio/style/css/index.js +2 -0
- package/esnext/radio/style/index.d.ts +2 -0
- package/esnext/radio/style/index.js +2 -0
- package/esnext/radio/style/index.less +114 -0
- package/esnext/radio/type.d.ts +31 -0
- package/esnext/radio/type.js +1 -0
- package/esnext/rate/index.d.ts +109 -0
- package/esnext/rate/index.js +87 -0
- package/esnext/rate/style/css/index.css +595 -0
- package/esnext/rate/style/css/index.d.ts +2 -0
- package/esnext/rate/style/css/index.js +2 -0
- package/esnext/rate/style/index.d.ts +2 -0
- package/esnext/rate/style/index.js +2 -0
- package/esnext/rate/style/index.less +106 -0
- package/esnext/search-bar/association.d.ts +3 -0
- package/esnext/search-bar/association.js +51 -0
- package/esnext/search-bar/cancel-button.d.ts +10 -0
- package/esnext/search-bar/cancel-button.js +18 -0
- package/esnext/search-bar/highlight.d.ts +12 -0
- package/esnext/search-bar/highlight.js +46 -0
- package/esnext/search-bar/index.d.ts +13 -0
- package/esnext/search-bar/index.js +109 -0
- package/esnext/search-bar/style/css/index.css +765 -0
- package/esnext/search-bar/style/css/index.d.ts +2 -0
- package/esnext/search-bar/style/css/index.js +2 -0
- package/esnext/search-bar/style/index.d.ts +2 -0
- package/esnext/search-bar/style/index.js +2 -0
- package/esnext/search-bar/style/index.less +198 -0
- package/esnext/search-bar/type.d.ts +163 -0
- package/esnext/search-bar/type.js +1 -0
- package/esnext/show-monitor/index.d.ts +115 -0
- package/esnext/show-monitor/index.js +416 -0
- package/esnext/show-monitor/style/css/index.css +0 -0
- package/esnext/show-monitor/style/css/index.d.ts +2 -0
- package/esnext/show-monitor/style/css/index.js +2 -0
- package/esnext/show-monitor/style/index.d.ts +2 -0
- package/esnext/show-monitor/style/index.js +2 -0
- package/esnext/show-monitor/style/index.less +1 -0
- package/esnext/skeleton/elements.d.ts +7 -0
- package/esnext/skeleton/elements.js +117 -0
- package/esnext/skeleton/index.d.ts +19 -0
- package/esnext/skeleton/index.js +50 -0
- package/esnext/skeleton/skeleton-context.d.ts +3 -0
- package/esnext/skeleton/skeleton-context.js +5 -0
- package/esnext/skeleton/style/css/index.css +712 -0
- package/esnext/skeleton/style/css/index.d.ts +3 -0
- package/esnext/skeleton/style/css/index.js +3 -0
- package/esnext/skeleton/style/index.d.ts +3 -0
- package/esnext/skeleton/style/index.js +3 -0
- package/esnext/skeleton/style/index.less +182 -0
- package/esnext/skeleton/type.d.ts +105 -0
- package/esnext/skeleton/type.js +1 -0
- package/esnext/slider/hooks/index.d.ts +12 -0
- package/esnext/slider/hooks/index.js +33 -0
- package/esnext/slider/hooks/useSliderEvents.d.ts +17 -0
- package/esnext/slider/hooks/useSliderEvents.js +128 -0
- package/esnext/slider/hooks/useSliderIcon.d.ts +7 -0
- package/esnext/slider/hooks/useSliderIcon.js +41 -0
- package/esnext/slider/hooks/useSliderInit.d.ts +14 -0
- package/esnext/slider/hooks/useSliderInit.js +146 -0
- package/esnext/slider/hooks/useSliderStyle.d.ts +13 -0
- package/esnext/slider/hooks/useSliderStyle.js +39 -0
- package/esnext/slider/index.d.ts +163 -0
- package/esnext/slider/index.js +120 -0
- package/esnext/slider/marks.d.ts +11 -0
- package/esnext/slider/marks.js +17 -0
- package/esnext/slider/popover.d.ts +6 -0
- package/esnext/slider/popover.js +13 -0
- package/esnext/slider/style/css/index.css +863 -0
- package/esnext/slider/style/css/index.d.ts +3 -0
- package/esnext/slider/style/css/index.js +3 -0
- package/esnext/slider/style/index.d.ts +3 -0
- package/esnext/slider/style/index.js +3 -0
- package/esnext/slider/style/index.less +366 -0
- package/esnext/slider/thumb.d.ts +9 -0
- package/esnext/slider/thumb.js +21 -0
- package/esnext/stepper/hooks/useButtonClick.d.ts +11 -0
- package/esnext/stepper/hooks/useButtonClick.js +46 -0
- package/esnext/stepper/hooks/useInputEvent.d.ts +10 -0
- package/esnext/stepper/hooks/useInputEvent.js +41 -0
- package/esnext/stepper/hooks/useValue.d.ts +7 -0
- package/esnext/stepper/hooks/useValue.js +33 -0
- package/esnext/stepper/index.d.ts +16 -0
- package/esnext/stepper/index.js +81 -0
- package/esnext/stepper/style/css/index.css +636 -0
- package/esnext/stepper/style/css/index.d.ts +2 -0
- package/esnext/stepper/style/css/index.js +2 -0
- package/esnext/stepper/style/index.d.ts +2 -0
- package/esnext/stepper/style/index.js +2 -0
- package/esnext/stepper/style/index.less +161 -0
- package/esnext/stepper/type.d.ts +159 -0
- package/esnext/stepper/type.js +1 -0
- package/esnext/steps/index.d.ts +19 -0
- package/esnext/steps/index.js +50 -0
- package/esnext/steps/step.d.ts +4 -0
- package/esnext/steps/step.js +43 -0
- package/esnext/steps/style/css/index.css +877 -0
- package/esnext/steps/style/css/index.d.ts +2 -0
- package/esnext/steps/style/css/index.js +2 -0
- package/esnext/steps/style/index.d.ts +2 -0
- package/esnext/steps/style/index.js +2 -0
- package/esnext/steps/style/index.less +407 -0
- package/esnext/steps/type.d.ts +110 -0
- package/esnext/steps/type.js +1 -0
- package/esnext/sticky/index.d.ts +141 -0
- package/esnext/sticky/index.js +165 -0
- package/esnext/sticky/style/css/index.css +526 -0
- package/esnext/sticky/style/css/index.d.ts +2 -0
- package/esnext/sticky/style/css/index.js +2 -0
- package/esnext/sticky/style/index.d.ts +2 -0
- package/esnext/sticky/style/index.js +2 -0
- package/esnext/sticky/style/index.less +30 -0
- package/esnext/style.d.ts +60 -0
- package/esnext/style.js +60 -0
- package/esnext/swipe-action/index.d.ts +13 -0
- package/esnext/swipe-action/index.js +220 -0
- package/esnext/swipe-action/item.d.ts +11 -0
- package/esnext/swipe-action/item.js +20 -0
- package/esnext/swipe-action/style/css/index.css +620 -0
- package/esnext/swipe-action/style/css/index.d.ts +2 -0
- package/esnext/swipe-action/style/css/index.js +2 -0
- package/esnext/swipe-action/style/index.d.ts +2 -0
- package/esnext/swipe-action/style/index.js +2 -0
- package/esnext/swipe-action/style/index.less +132 -0
- package/esnext/swipe-action/type.d.ts +123 -0
- package/esnext/swipe-action/type.js +1 -0
- package/esnext/swipe-load/index.d.ts +13 -0
- package/esnext/swipe-load/index.js +255 -0
- package/esnext/swipe-load/style/css/index.css +561 -0
- package/esnext/swipe-load/style/css/index.d.ts +2 -0
- package/esnext/swipe-load/style/css/index.js +2 -0
- package/esnext/swipe-load/style/index.d.ts +2 -0
- package/esnext/swipe-load/style/index.js +2 -0
- package/esnext/swipe-load/style/index.less +66 -0
- package/esnext/swipe-load/type.d.ts +152 -0
- package/esnext/swipe-load/type.js +1 -0
- package/esnext/switch/index.d.ts +105 -0
- package/esnext/switch/index.js +83 -0
- package/esnext/switch/style/css/index.css +765 -0
- package/esnext/switch/style/css/index.d.ts +2 -0
- package/esnext/switch/style/css/index.js +2 -0
- package/esnext/switch/style/index.d.ts +2 -0
- package/esnext/switch/style/index.js +2 -0
- package/esnext/switch/style/index.less +217 -0
- package/esnext/tab-bar/index.d.ts +14 -0
- package/esnext/tab-bar/index.js +16 -0
- package/esnext/tab-bar/item.d.ts +3 -0
- package/esnext/tab-bar/item.js +31 -0
- package/esnext/tab-bar/style/css/index.css +617 -0
- package/esnext/tab-bar/style/css/index.d.ts +2 -0
- package/esnext/tab-bar/style/css/index.js +2 -0
- package/esnext/tab-bar/style/index.d.ts +2 -0
- package/esnext/tab-bar/style/index.js +2 -0
- package/esnext/tab-bar/style/index.less +96 -0
- package/esnext/tab-bar/tab-bar.d.ts +11 -0
- package/esnext/tab-bar/tab-bar.js +40 -0
- package/esnext/tab-bar/type.d.ts +95 -0
- package/esnext/tab-bar/type.js +1 -0
- package/esnext/tabs/index.d.ts +13 -0
- package/esnext/tabs/index.js +340 -0
- package/esnext/tabs/style/css/index.css +1162 -0
- package/esnext/tabs/style/css/index.d.ts +2 -0
- package/esnext/tabs/style/css/index.js +2 -0
- package/esnext/tabs/style/index.d.ts +2 -0
- package/esnext/tabs/style/index.js +2 -0
- package/esnext/tabs/style/index.less +559 -0
- package/esnext/tabs/tab-cell-underline.d.ts +4 -0
- package/esnext/tabs/tab-cell-underline.js +237 -0
- package/esnext/tabs/tab-cell.d.ts +4 -0
- package/esnext/tabs/tab-cell.js +258 -0
- package/esnext/tabs/tab-pane.d.ts +4 -0
- package/esnext/tabs/tab-pane.js +241 -0
- package/esnext/tabs/type.d.ts +629 -0
- package/esnext/tabs/type.js +1 -0
- package/esnext/tag/index.d.ts +14 -0
- package/esnext/tag/index.js +20 -0
- package/esnext/tag/list.d.ts +3 -0
- package/esnext/tag/list.js +47 -0
- package/esnext/tag/style/css/index.css +738 -0
- package/esnext/tag/style/css/index.d.ts +2 -0
- package/esnext/tag/style/css/index.js +2 -0
- package/esnext/tag/style/index.d.ts +2 -0
- package/esnext/tag/style/index.js +2 -0
- package/esnext/tag/style/index.less +188 -0
- package/esnext/tag/tag.d.ts +3 -0
- package/esnext/tag/tag.js +32 -0
- package/esnext/tag/type.d.ts +159 -0
- package/esnext/tag/type.js +1 -0
- package/esnext/textarea/index.d.ts +96 -0
- package/esnext/textarea/index.js +88 -0
- package/esnext/textarea/style/css/index.css +572 -0
- package/esnext/textarea/style/css/index.d.ts +3 -0
- package/esnext/textarea/style/css/index.js +3 -0
- package/esnext/textarea/style/index.d.ts +3 -0
- package/esnext/textarea/style/index.js +3 -0
- package/esnext/textarea/style/index.less +84 -0
- package/esnext/toast/index.d.ts +257 -0
- package/esnext/toast/index.js +142 -0
- package/esnext/toast/methods.d.ts +16 -0
- package/esnext/toast/methods.js +61 -0
- package/esnext/toast/style/css/index.css +658 -0
- package/esnext/toast/style/css/index.d.ts +4 -0
- package/esnext/toast/style/css/index.js +4 -0
- package/esnext/toast/style/index.d.ts +4 -0
- package/esnext/toast/style/index.js +4 -0
- package/esnext/toast/style/index.less +130 -0
- package/esnext/transition/index.d.ts +49 -0
- package/esnext/transition/index.js +15 -0
- package/esnext/transition/style/css/index.css +549 -0
- package/esnext/transition/style/css/index.d.ts +2 -0
- package/esnext/transition/style/css/index.js +2 -0
- package/esnext/transition/style/index.d.ts +2 -0
- package/esnext/transition/style/index.js +2 -0
- package/esnext/transition/style/index.less +53 -0
- package/esnext/uploader/index.d.ts +16 -0
- package/esnext/uploader/index.js +75 -0
- package/esnext/uploader/style/css/index.css +666 -0
- package/esnext/uploader/style/css/index.d.ts +4 -0
- package/esnext/uploader/style/css/index.js +4 -0
- package/esnext/uploader/style/index.d.ts +4 -0
- package/esnext/uploader/style/index.js +4 -0
- package/esnext/uploader/style/index.less +161 -0
- package/esnext/uploader/type.d.ts +108 -0
- package/esnext/uploader/type.js +1 -0
- package/esnext/uploader/upload/index.d.ts +2 -0
- package/esnext/uploader/upload/index.js +2 -0
- package/esnext/uploader/upload/type.d.ts +107 -0
- package/esnext/uploader/upload/type.js +1 -0
- package/esnext/uploader/upload/upload.d.ts +20 -0
- package/esnext/uploader/upload/upload.js +123 -0
- package/esnext-tsconfig.json +23 -0
- package/package.json +3 -3
- package/umd/_helpers/index.d.ts +1 -0
- package/umd/_helpers/index.js +10 -4
- package/umd/_helpers/react-dom.js +21 -14
- package/umd/stepper/style/css/index.css +3 -4
- package/umd/stepper/style/index.less +1 -2
@@ -0,0 +1,794 @@
|
|
1
|
+
import React, { useRef, forwardRef, useImperativeHandle, useEffect, useState, } from 'react';
|
2
|
+
import { nextTick, componentWrapper, preventEleScroll, freeEleScroll, cls, } from '@arco-design/mobile-utils';
|
3
|
+
import TransformAble from '@arco-design/transformable';
|
4
|
+
import { ContextLayout, CompWithGlobalContext } from '../context-provider';
|
5
|
+
import Carousel from '../carousel';
|
6
|
+
import Transition from '../transition';
|
7
|
+
import BaseImage from '../image';
|
8
|
+
import { useWindowSize, useRefState, usePopupScroll, getStyleWithVendor, useSystem, useSingleAndDoubleClick, } from '../_helpers';
|
9
|
+
import Portal from '../portal';
|
10
|
+
import { open } from './methods';
|
11
|
+
import Loading from '../loading';
|
12
|
+
export * from './methods';
|
13
|
+
const MAX_ZOOM = 5;
|
14
|
+
const MIN_ZOOM = 0.7;
|
15
|
+
const ImagePreview = forwardRef((props, ref) => {
|
16
|
+
const { style, className, images, loop = false, openIndex, fit, noselect = true, displayDuration = 350, spaceBetween = 0, showLoading = true, loadingArea, errorArea, showError = true, retryTime, staticLabel, replaceFallbackWhenLoaded, scrollBezier, lazyloadCount = 1, swipeToClose = true, extra, getMinScale, getMaxScale, getDoubleClickScale, getContainer, getThumbBounds, renderIndicator, onChange, onAfterChange, onImageClick, onImageDoubleClick, onImageLongTap, close, onClose, onTouchStart, onTouchMove, onTouchEnd, indicatorPos = 'start', ...otherProps } = props;
|
17
|
+
const system = useSystem();
|
18
|
+
const domRef = useRef(null);
|
19
|
+
const imagesRef = useRef([]);
|
20
|
+
const carouselRef = useRef(null);
|
21
|
+
const transformersRef = useRef([]);
|
22
|
+
const longTimerRef = useRef(null);
|
23
|
+
const transImageRef = useRef(null);
|
24
|
+
const imageDomsRef = useRef([]);
|
25
|
+
const touchStartXRef = useRef(0);
|
26
|
+
const startTouchingSideRef = useRef(false);
|
27
|
+
const movedRef = useRef(false);
|
28
|
+
const dblClickingRef = useRef(false);
|
29
|
+
const longTapCheckingRef = useRef(false);
|
30
|
+
const innerIndexRef = useRef(openIndex);
|
31
|
+
const touchingSideDisRef = useRef(0);
|
32
|
+
const lastScaleRef = useRef(0);
|
33
|
+
const closingRef = useRef(false);
|
34
|
+
const isInitialMount = useRef(false);
|
35
|
+
const [showPlaceholders, setPlaceholders] = useState({});
|
36
|
+
const [imagesStatus, imagesStatusRef, setImagesStatus] = useRefState([]);
|
37
|
+
const [transImageInfo, setTransImageInfo] = useState(null);
|
38
|
+
const openLoaded = imagesStatus[openIndex]?.loaded;
|
39
|
+
const openAnimated = imagesStatus[openIndex]?.animated;
|
40
|
+
const visible = openIndex >= 0 && openIndex < images.length;
|
41
|
+
const { windowWidth, windowHeight } = useWindowSize(true);
|
42
|
+
useImperativeHandle(ref, () => ({
|
43
|
+
dom: domRef.current,
|
44
|
+
imageDoms: imageDomsRef.current,
|
45
|
+
}));
|
46
|
+
usePopupScroll(visible, domRef.current, () => [], 'top', handlePreventCallback);
|
47
|
+
useEffect(() => {
|
48
|
+
if (visible) {
|
49
|
+
innerIndexRef.current = openIndex;
|
50
|
+
closingRef.current = false;
|
51
|
+
carouselRef.current && carouselRef.current.changeIndex(openIndex, true);
|
52
|
+
setImagesStatus(images.map((_, index) => ({
|
53
|
+
firstLoaded: imagesStatusRef.current[index]?.firstLoaded || false,
|
54
|
+
animated: index !== openIndex,
|
55
|
+
})));
|
56
|
+
setDisplayAnimation(openIndex);
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
// 移除长按事件监听
|
60
|
+
// @en Remove long press event listener
|
61
|
+
longTimerRef.current && clearTimeout(longTimerRef.current);
|
62
|
+
longTapCheckingRef.current = false;
|
63
|
+
// 图片状态重置
|
64
|
+
// @en Reset image state
|
65
|
+
setImagesStatus(imagesStatusRef.current.map(status => ({
|
66
|
+
...status,
|
67
|
+
animated: false,
|
68
|
+
loaded: false,
|
69
|
+
})));
|
70
|
+
transformersRef.current = [];
|
71
|
+
// 移除过渡图片
|
72
|
+
// @en Remove transition image
|
73
|
+
removeChild(transImageRef.current);
|
74
|
+
setTransImageInfo(null);
|
75
|
+
setPlaceholders({});
|
76
|
+
const mounted = isInitialMount.current;
|
77
|
+
setTimeout(() => {
|
78
|
+
mounted && onClose && onClose();
|
79
|
+
}, displayDuration);
|
80
|
+
}
|
81
|
+
isInitialMount.current = true;
|
82
|
+
}, [visible]);
|
83
|
+
useEffect(() => {
|
84
|
+
if (visible && openLoaded && openAnimated) {
|
85
|
+
setTimeout(() => {
|
86
|
+
removeChild(transImageRef.current);
|
87
|
+
transImageRef.current = null;
|
88
|
+
}, 100);
|
89
|
+
}
|
90
|
+
}, [visible, openLoaded, openAnimated]);
|
91
|
+
useEffect(() => {
|
92
|
+
// 执行过渡动画时避免滚动穿透
|
93
|
+
// @en Avoid scroll penetration when performing transition animation
|
94
|
+
if (transImageInfo) {
|
95
|
+
preventEleScroll();
|
96
|
+
}
|
97
|
+
else {
|
98
|
+
nextTick(() => {
|
99
|
+
freeEleScroll();
|
100
|
+
});
|
101
|
+
}
|
102
|
+
}, [transImageInfo]);
|
103
|
+
useEffect(() => {
|
104
|
+
(transformersRef.current || []).forEach((transformer, index) => {
|
105
|
+
transformer && transformer.setMinScale(getImageMinScale(index));
|
106
|
+
});
|
107
|
+
}, [getMinScale]);
|
108
|
+
useEffect(() => {
|
109
|
+
(transformersRef.current || []).forEach((transformer, index) => {
|
110
|
+
transformer && transformer.setMaxScale(getImageMaxScale(index));
|
111
|
+
});
|
112
|
+
}, [getMaxScale]);
|
113
|
+
function removeChild(child) {
|
114
|
+
try {
|
115
|
+
child &&
|
116
|
+
domRef.current
|
117
|
+
?.querySelectorAll('.carousel-item')?.[innerIndexRef.current]?.removeChild(child);
|
118
|
+
}
|
119
|
+
catch (e) { }
|
120
|
+
}
|
121
|
+
// 监听滑动到上下边缘后还在往外滑动的操作,则关闭弹窗
|
122
|
+
// @en Monitor the operation of sliding out after sliding to the upper and lower edges, then close the popup
|
123
|
+
function handlePreventCallback(_, dir) {
|
124
|
+
if (!isTransforming() && dir === 'y') {
|
125
|
+
touchingSideDisRef.current += 1;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
/**
|
129
|
+
* 缩放插件初始化
|
130
|
+
* @en Zoom plugin initialization
|
131
|
+
*/
|
132
|
+
function initTransformer(index) {
|
133
|
+
const imageDom = imagesRef.current[index]?.dom;
|
134
|
+
const wrapDom = imageDom?.parentElement;
|
135
|
+
if (!imageDom || !wrapDom) {
|
136
|
+
return;
|
137
|
+
}
|
138
|
+
if (transformersRef.current[index]) {
|
139
|
+
transformersRef.current[index].setDom(wrapDom);
|
140
|
+
}
|
141
|
+
else {
|
142
|
+
// 缩放插件中对长图的处理:放大状态为模拟手势滚动,还原状态为真实滚动
|
143
|
+
// @en The processing of long images in the zoom plugin: the zoomed state is simulated gesture scrolling, and the restored state is real scrolling
|
144
|
+
transformersRef.current[index] = new TransformAble({
|
145
|
+
// wrapDom为无transform和transition的纯净容器
|
146
|
+
// @en wrapDom is a pure container without transform and transition
|
147
|
+
dom: wrapDom,
|
148
|
+
motionThreshold: 0,
|
149
|
+
dragMode: 'always',
|
150
|
+
transformMode: 'matrix',
|
151
|
+
useDomBoundary: false,
|
152
|
+
preventScroll: false,
|
153
|
+
cubic: {
|
154
|
+
scroll: scrollBezier,
|
155
|
+
},
|
156
|
+
onTransform: () => {
|
157
|
+
// 图片放大再缩小,解决ios图片放大后模糊的问题
|
158
|
+
// @en The image is zoomed in and then zoomed out to solve the problem of blurring after zooming in on ios images
|
159
|
+
const img = imageDomsRef.current[index];
|
160
|
+
const trans = transformersRef.current[index]?.getTransform?.() || {};
|
161
|
+
const width = imagesStatusRef.current[index]?.originWidth;
|
162
|
+
const height = imagesStatusRef.current[index]?.originHeight;
|
163
|
+
const scale = trans.scale || 1;
|
164
|
+
// 判断下只有图片缩放发生改变时重写图片样式
|
165
|
+
// @en It is judged that only the image style is rewritten when the zoom of the image changes.
|
166
|
+
if (img && width && height && lastScaleRef.current !== scale) {
|
167
|
+
lastScaleRef.current = scale;
|
168
|
+
const atCenter = !imageHasOverflow(img) ? ' translateY(-50%)' : '';
|
169
|
+
img.style.width = `${width * scale}px`;
|
170
|
+
img.style.height = `${height * scale}px`;
|
171
|
+
const transform = `scale(${1 / scale}) translateZ(0)${atCenter}`;
|
172
|
+
img.style.transform = transform;
|
173
|
+
img.style.webkitTransform = transform;
|
174
|
+
img.style.transformOrigin = 'top left';
|
175
|
+
img.style.webkitTransformOrigin = 'top left';
|
176
|
+
}
|
177
|
+
},
|
178
|
+
onRestore: () => {
|
179
|
+
lastScaleRef.current = 0;
|
180
|
+
},
|
181
|
+
onZoomEnd: (_1, _2, pinchStartCenter) => {
|
182
|
+
setPlaceholders(holders => ({ ...holders, [index]: false }));
|
183
|
+
const image = imageDomsRef.current[index];
|
184
|
+
const transformer = transformersRef.current[index];
|
185
|
+
if (!image || !transformer || transformer.getTransform().scale < 1) {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
const imageRect = image.getBoundingClientRect();
|
189
|
+
if (imageRect.width > windowWidth && imageRect.height > windowHeight) {
|
190
|
+
if (pinchStartCenter && pinchStartCenter.length) {
|
191
|
+
transformer.setCenter(...pinchStartCenter);
|
192
|
+
}
|
193
|
+
transformer.setFixedX(false);
|
194
|
+
transformer.setFixedY(false);
|
195
|
+
}
|
196
|
+
else if (imageRect.height <= windowHeight) {
|
197
|
+
if (!transformer.fixedY) {
|
198
|
+
transformer.setFixedY(true);
|
199
|
+
transformer.bounce();
|
200
|
+
}
|
201
|
+
}
|
202
|
+
else if (imageRect.width <= windowWidth) {
|
203
|
+
if (!transformer.fixedX) {
|
204
|
+
transformer.setFixedX(true);
|
205
|
+
transformer.bounce();
|
206
|
+
}
|
207
|
+
}
|
208
|
+
},
|
209
|
+
minScale: getImageMinScale(index),
|
210
|
+
maxScale: getImageMaxScale(index),
|
211
|
+
});
|
212
|
+
}
|
213
|
+
setOriginBoundary(index);
|
214
|
+
}
|
215
|
+
function imageHasOverflow(img) {
|
216
|
+
return Boolean(img && !img.classList.contains('preview-fit-contain-y'));
|
217
|
+
}
|
218
|
+
function setOriginBoundary(index) {
|
219
|
+
const imageEle = imagesRef.current[index];
|
220
|
+
const imageDom = imageEle?.dom;
|
221
|
+
// 边界范围变为图片范围和容器范围的并集
|
222
|
+
// @en The bounding range becomes the union of the image range and the container range
|
223
|
+
if (imageDom?.parentElement && imageEle?.image) {
|
224
|
+
const rect = imageEle.image.getBoundingClientRect();
|
225
|
+
const eleRect = imageDom.parentElement.getBoundingClientRect();
|
226
|
+
if (transformersRef.current[index]) {
|
227
|
+
transformersRef.current[index].setBoundary({
|
228
|
+
left: Math.min(rect.left, eleRect.left),
|
229
|
+
right: Math.max(rect.right, eleRect.right),
|
230
|
+
top: Math.min(rect.top, eleRect.top),
|
231
|
+
bottom: Math.max(rect.bottom, eleRect.bottom),
|
232
|
+
}, true);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
/**
|
237
|
+
* 获取最小缩放倍数
|
238
|
+
* @en Get the minimum zoom factor
|
239
|
+
*/
|
240
|
+
function getImageMinScale(index) {
|
241
|
+
const currentIndex = index === void 0 ? innerIndexRef.current : index;
|
242
|
+
const imageDom = imageDomsRef.current[currentIndex];
|
243
|
+
if (!imageDom) {
|
244
|
+
return 1;
|
245
|
+
}
|
246
|
+
if (getMinScale) {
|
247
|
+
return getMinScale(imageDom, currentIndex);
|
248
|
+
}
|
249
|
+
return MIN_ZOOM;
|
250
|
+
}
|
251
|
+
/**
|
252
|
+
* 获取最大缩放倍数
|
253
|
+
* @en Get the maximum zoom factor
|
254
|
+
*/
|
255
|
+
function getImageMaxScale(index) {
|
256
|
+
const currentIndex = index === void 0 ? innerIndexRef.current : index;
|
257
|
+
const imageDom = imageDomsRef.current[currentIndex];
|
258
|
+
if (!imageDom) {
|
259
|
+
return 1;
|
260
|
+
}
|
261
|
+
if (getMaxScale) {
|
262
|
+
return getMaxScale(imageDom, currentIndex);
|
263
|
+
}
|
264
|
+
const imageWidth = imageDom.naturalWidth;
|
265
|
+
const imageHeight = imageDom.naturalHeight;
|
266
|
+
let maxScale = 1;
|
267
|
+
if (imageWidth > imageHeight) {
|
268
|
+
maxScale = (imageWidth / windowWidth) * MAX_ZOOM;
|
269
|
+
}
|
270
|
+
else {
|
271
|
+
maxScale = Math.max(MAX_ZOOM, imageWidth / windowWidth);
|
272
|
+
}
|
273
|
+
return maxScale;
|
274
|
+
}
|
275
|
+
/**
|
276
|
+
* 计算双击时图片缩放倍数
|
277
|
+
* @en Calculate the zoom factor of the image when double-clicking
|
278
|
+
*/
|
279
|
+
function getImageDoubleClickScale(currentScale) {
|
280
|
+
const index = innerIndexRef.current;
|
281
|
+
const imageDom = imageDomsRef.current[index];
|
282
|
+
if (!imageDom) {
|
283
|
+
return 1;
|
284
|
+
}
|
285
|
+
const maxScale = getImageMaxScale(index);
|
286
|
+
if (getDoubleClickScale) {
|
287
|
+
return getDoubleClickScale(currentScale, maxScale, imageDom, index);
|
288
|
+
}
|
289
|
+
const imageWidth = imageDom.naturalWidth;
|
290
|
+
const imageHeight = imageDom.naturalHeight;
|
291
|
+
const fitScale = imageWidth > imageHeight
|
292
|
+
? ((imageWidth / windowWidth) * windowHeight) / imageHeight
|
293
|
+
: 1;
|
294
|
+
let dblScale = 2;
|
295
|
+
if (fitScale >= 2) {
|
296
|
+
dblScale = Math.min(maxScale, fitScale);
|
297
|
+
}
|
298
|
+
const current = Number(currentScale.toFixed(3));
|
299
|
+
const dbl = Number(dblScale.toFixed(3));
|
300
|
+
return current >= 1 && current < dbl ? dbl : 1;
|
301
|
+
}
|
302
|
+
/**
|
303
|
+
* 还原缩放至原始位置
|
304
|
+
* @en Revert zoom to original position
|
305
|
+
*/
|
306
|
+
function restoreTransformer(index) {
|
307
|
+
const transformer = transformersRef.current[index];
|
308
|
+
if (transformer) {
|
309
|
+
transformer.restore();
|
310
|
+
}
|
311
|
+
}
|
312
|
+
/**
|
313
|
+
* 是否正处于缩放状态
|
314
|
+
* @en Whether it is zooming
|
315
|
+
*/
|
316
|
+
function isTransforming(index) {
|
317
|
+
const currentIndex = index === void 0 ? innerIndexRef.current : index;
|
318
|
+
return transformersRef.current[currentIndex]?.busy?.();
|
319
|
+
}
|
320
|
+
/**
|
321
|
+
* 是否已经放大过
|
322
|
+
* @en Whether is has been zoomed in
|
323
|
+
*/
|
324
|
+
function isTransformed() {
|
325
|
+
return transformersRef.current[innerIndexRef.current]?.dirty?.();
|
326
|
+
}
|
327
|
+
function isTapStop() {
|
328
|
+
return transformersRef.current[innerIndexRef.current]?.isTapStop?.();
|
329
|
+
}
|
330
|
+
/**
|
331
|
+
* 计算距离左右侧的距离,如果为0说明到边缘了,可以进行正常轮播操作
|
332
|
+
* @en Calculate the distance from the left and right sides. If it is 0, it means that the edge is reached, and the normal rotation operation can be performed.
|
333
|
+
*/
|
334
|
+
function transformTouchSide() {
|
335
|
+
const transformer = transformersRef.current[innerIndexRef.current];
|
336
|
+
const toLeft = transformer?.toLeft?.();
|
337
|
+
const toRight = transformer?.toRight?.();
|
338
|
+
return {
|
339
|
+
side: !toLeft || !toRight,
|
340
|
+
left: !toLeft,
|
341
|
+
right: !toRight,
|
342
|
+
};
|
343
|
+
}
|
344
|
+
function handleImageWrapTouchStart(e) {
|
345
|
+
if (onTouchStart && onTouchStart(e, innerIndexRef.current)) {
|
346
|
+
return true;
|
347
|
+
}
|
348
|
+
const { touches } = e;
|
349
|
+
touchStartXRef.current = e.touches && e.touches[0] ? e.touches[0].clientX : 0;
|
350
|
+
movedRef.current = false;
|
351
|
+
dblClickingRef.current = false;
|
352
|
+
// 单点长按才触发长按
|
353
|
+
// @en A single long press triggers a long press
|
354
|
+
if (touches.length === 1) {
|
355
|
+
if (!closingRef.current) {
|
356
|
+
longTapCheckingRef.current = true;
|
357
|
+
}
|
358
|
+
longTimerRef.current = window.setTimeout(() => {
|
359
|
+
if (longTapCheckingRef.current) {
|
360
|
+
longTapCheckingRef.current = false;
|
361
|
+
movedRef.current = true;
|
362
|
+
onImageLongTap &&
|
363
|
+
onImageLongTap(innerIndexRef.current, imageDomsRef.current[innerIndexRef.current], e);
|
364
|
+
}
|
365
|
+
}, 300);
|
366
|
+
}
|
367
|
+
else {
|
368
|
+
longTapCheckingRef.current = false;
|
369
|
+
}
|
370
|
+
if (isTapStop()) {
|
371
|
+
movedRef.current = true;
|
372
|
+
}
|
373
|
+
// 缩放状态下,未到边缘时不触发轮播手势
|
374
|
+
// @en In the zoomed state, the carousel gesture is not triggered when the edge is not reached
|
375
|
+
if (isTransforming()) {
|
376
|
+
startTouchingSideRef.current = transformTouchSide().side;
|
377
|
+
return !startTouchingSideRef.current;
|
378
|
+
}
|
379
|
+
}
|
380
|
+
function handleImageWrapTouchMove(e) {
|
381
|
+
movedRef.current = true;
|
382
|
+
longTapCheckingRef.current = false;
|
383
|
+
longTimerRef.current && clearTimeout(longTimerRef.current);
|
384
|
+
if (onTouchMove && onTouchMove(e, innerIndexRef.current)) {
|
385
|
+
return true;
|
386
|
+
}
|
387
|
+
const evt = e.changedTouches[0];
|
388
|
+
const touchMoveX = evt.clientX || 0;
|
389
|
+
const posDisX = touchMoveX - touchStartXRef.current;
|
390
|
+
// 缩放状态下,到边缘时如果还在往外滑动,则触发轮播手势
|
391
|
+
// @en In the zoomed state, if it is still swiped out when reaching the edge, the carousel gesture is triggered
|
392
|
+
if (isTransforming()) {
|
393
|
+
const sideInfo = transformTouchSide();
|
394
|
+
return (!startTouchingSideRef.current ||
|
395
|
+
!((sideInfo.left && posDisX > 0) || (sideInfo.right && posDisX < 0)));
|
396
|
+
}
|
397
|
+
}
|
398
|
+
function handleImageWrapTouchEnd(e) {
|
399
|
+
if (onTouchEnd && onTouchEnd(e, innerIndexRef.current)) {
|
400
|
+
return true;
|
401
|
+
}
|
402
|
+
// 滑动到上下边缘后还在往外滑动,则关闭弹窗
|
403
|
+
// @en After sliding to the upper and lower edges and still sliding outwards, close the popup box
|
404
|
+
// needClose为触发touchmove的次数,6和3是相对值,表示判断在往外滑动的敏感度,当未放大时对向外滑动手势更敏感
|
405
|
+
// @en needClose is the number of times the touchmove is triggered, 6 and 3 are relative values, indicating the sensitivity of judging the outward sliding, and it is more sensitive to the outward sliding gesture when it is not zoomed in
|
406
|
+
const needClose = swipeToClose && touchingSideDisRef.current >= (isTransformed() ? 6 : 3);
|
407
|
+
touchingSideDisRef.current = 0;
|
408
|
+
longTapCheckingRef.current = false;
|
409
|
+
longTimerRef.current && clearTimeout(longTimerRef.current);
|
410
|
+
if (needClose) {
|
411
|
+
goClose(e);
|
412
|
+
return true;
|
413
|
+
}
|
414
|
+
// 缩放状态下,未到边缘时不触发轮播手势
|
415
|
+
// @en In the zoomed state, the carousel gesture is not triggered when the edge is not reached
|
416
|
+
if (isTransforming() && !transformTouchSide().side) {
|
417
|
+
return true;
|
418
|
+
}
|
419
|
+
}
|
420
|
+
function handleImageClick(e) {
|
421
|
+
if (movedRef.current) {
|
422
|
+
return;
|
423
|
+
}
|
424
|
+
// 如果正在触发doubleClick就不触发click
|
425
|
+
// @en If doubleClick is being triggered, click will not be triggered
|
426
|
+
if (!dblClickingRef.current) {
|
427
|
+
if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
|
428
|
+
goClose(e);
|
429
|
+
}
|
430
|
+
}
|
431
|
+
}
|
432
|
+
function handleImageDoubleClick(e) {
|
433
|
+
if (dblClickingRef.current) {
|
434
|
+
// 防止重复触发dblclick
|
435
|
+
return;
|
436
|
+
}
|
437
|
+
dblClickingRef.current = true;
|
438
|
+
const index = innerIndexRef.current;
|
439
|
+
onImageDoubleClick && onImageDoubleClick(index, e);
|
440
|
+
// 双击时根据配置放大或缩小
|
441
|
+
// @en Zoom in or out according to configuration when double-clicking
|
442
|
+
const transformer = transformersRef.current[index];
|
443
|
+
if (transformer) {
|
444
|
+
const trans = transformer.getTransform();
|
445
|
+
const rate = trans.scale || 1;
|
446
|
+
const dblScale = getImageDoubleClickScale(rate);
|
447
|
+
if (dblScale === 1) {
|
448
|
+
const img = imageDomsRef.current[index];
|
449
|
+
// 长图双击还原缩放特殊处理,因为transform和scroll不能完全同步,所以先zoomTo到原点再restore
|
450
|
+
// @en Double-click the long image to restore zoom special processing, because transform and scroll cannot be completely synchronized, so first zoomTo to the origin and then restore
|
451
|
+
if (imageHasOverflow(img)) {
|
452
|
+
transformer.zoomToScreenCenter(1, [windowWidth / 2, windowHeight / 2], {
|
453
|
+
duration: 200,
|
454
|
+
callback: () => transformer.restore(),
|
455
|
+
});
|
456
|
+
}
|
457
|
+
else {
|
458
|
+
transformer.bounce();
|
459
|
+
transformer.restore();
|
460
|
+
}
|
461
|
+
}
|
462
|
+
else {
|
463
|
+
transformer.zoomToScreenCenter(dblScale, [windowWidth / 2, windowHeight / 2], {
|
464
|
+
duration: 200,
|
465
|
+
silent: false,
|
466
|
+
});
|
467
|
+
}
|
468
|
+
}
|
469
|
+
}
|
470
|
+
const handleClick = useSingleAndDoubleClick(handleImageClick, handleImageDoubleClick);
|
471
|
+
// 当使用 getThumbBounds 时,关闭图片预览有缩小效果
|
472
|
+
// @en When using getThumbBounds, closing the image preview has a shrinking effect
|
473
|
+
function animateBeforeClose() {
|
474
|
+
if (isTransformed()) {
|
475
|
+
return;
|
476
|
+
}
|
477
|
+
const index = innerIndexRef.current;
|
478
|
+
const imageDom = imagesRef.current[index]?.image;
|
479
|
+
const thumbBounds = getThumbBounds?.(index);
|
480
|
+
if (!imageDom || !thumbBounds || !thumbBounds.width || !thumbBounds.height) {
|
481
|
+
return;
|
482
|
+
}
|
483
|
+
// 小图超过一半在视野外时,不展示缩小效果
|
484
|
+
// @en When more than half of the thumbnail is outside the field of view, the zoom effect will not be displayed
|
485
|
+
if (thumbBounds.top < (-1 * thumbBounds.height) / 2 ||
|
486
|
+
thumbBounds.top > windowHeight - thumbBounds.height / 2 ||
|
487
|
+
thumbBounds.left < (-1 * thumbBounds.width) / 2 ||
|
488
|
+
thumbBounds.left > windowWidth - thumbBounds.width / 2) {
|
489
|
+
return;
|
490
|
+
}
|
491
|
+
const imageDomRect = imageDom.getBoundingClientRect();
|
492
|
+
if (!imageDomRect.width || !imageDomRect.height) {
|
493
|
+
return;
|
494
|
+
}
|
495
|
+
imageDom.classList.add('closing-animation');
|
496
|
+
setImageBounds(imageDom, imageDomRect, imageDomRect);
|
497
|
+
imageDom.style.objectPosition = images[index].thumbPosition || 'top center';
|
498
|
+
nextTick(() => {
|
499
|
+
imageDom.style.transitionDuration = `${displayDuration}ms`;
|
500
|
+
imageDom.style.webkitTransitionDuration = `${displayDuration}ms`;
|
501
|
+
setImageBounds(imageDom, thumbBounds, imageDomRect);
|
502
|
+
});
|
503
|
+
}
|
504
|
+
function goClose(e) {
|
505
|
+
if (closingRef.current) {
|
506
|
+
return;
|
507
|
+
}
|
508
|
+
closingRef.current = true;
|
509
|
+
animateBeforeClose();
|
510
|
+
close(e);
|
511
|
+
}
|
512
|
+
/**
|
513
|
+
* 更改指定图片状态
|
514
|
+
* @en Change specified image status
|
515
|
+
*/
|
516
|
+
function setImagesStatusByIndex(index, data) {
|
517
|
+
setImagesStatus(current => {
|
518
|
+
const newStatus = current.slice();
|
519
|
+
newStatus[index] = {
|
520
|
+
...(newStatus[index] || {}),
|
521
|
+
...data,
|
522
|
+
};
|
523
|
+
return newStatus;
|
524
|
+
});
|
525
|
+
}
|
526
|
+
/**
|
527
|
+
* 缩略图放大过渡动画设置
|
528
|
+
* @en Set thumbnail zoom transition animation
|
529
|
+
*/
|
530
|
+
function setDisplayAnimation(index) {
|
531
|
+
const firstLoaded = imagesStatusRef.current[index]?.firstLoaded;
|
532
|
+
const fallbackSrc = replaceFallbackWhenLoaded && firstLoaded
|
533
|
+
? images[index].src
|
534
|
+
: images[index].fallbackSrc;
|
535
|
+
// 用户设置了getThumbBounds和images的fallbackSrc属性才有放大过渡效果
|
536
|
+
// @en Set the fallbackSrc attribute of getThumbBounds and images to have a zoom-in transition effect
|
537
|
+
if (!getThumbBounds || !images[index] || !fallbackSrc) {
|
538
|
+
resetAnimation(index);
|
539
|
+
return;
|
540
|
+
}
|
541
|
+
// 获取缩略图的rect,如果没获取到就取消放大过渡效果
|
542
|
+
// @en Get the rect of the thumbnail, if it is gotten, cancel the zoom transition effect
|
543
|
+
const thumbBounds = getThumbBounds(index);
|
544
|
+
if (!thumbBounds || !thumbBounds.width || !thumbBounds.height) {
|
545
|
+
resetAnimation(index);
|
546
|
+
return;
|
547
|
+
}
|
548
|
+
// 伪造一个fixed的图做小图放大效果
|
549
|
+
// @en Forge a fixed image to make a small image enlargement effect
|
550
|
+
const transImage = new Image();
|
551
|
+
transImageRef.current = transImage;
|
552
|
+
transImage.classList.add('image-preview-fake-trans-image');
|
553
|
+
setImageBounds(transImage, thumbBounds, thumbBounds);
|
554
|
+
transImage.src = fallbackSrc;
|
555
|
+
transImage.style.objectPosition = images[index].thumbPosition || 'top center';
|
556
|
+
transImage.style.opacity = '0';
|
557
|
+
transImage.style.transitionDuration = `${displayDuration}ms`;
|
558
|
+
transImage.style.webkitTransitionDuration = `${displayDuration}ms`;
|
559
|
+
domRef.current?.querySelectorAll('.carousel-item')?.[index]?.prepend(transImage);
|
560
|
+
// 拿到放大之后的位置rect,没拿到就取消小图放大效果
|
561
|
+
// @en Get the zoomed-in position rect, and cancel the zoom-in effect if not getting it
|
562
|
+
getNewImageBounds(index, fallbackSrc, transImage, rect => {
|
563
|
+
if (!rect || !rect.width || !rect.height) {
|
564
|
+
removeChild(transImage);
|
565
|
+
resetAnimation(index);
|
566
|
+
return;
|
567
|
+
}
|
568
|
+
// 通过小图rect变换到大图rect加transition做放大效果
|
569
|
+
// @en Transform the small image rect to the large image rect and add transition to make a magnification effect
|
570
|
+
nextTick(() => {
|
571
|
+
transImage.style.opacity = '1';
|
572
|
+
setImageBounds(transImage, rect, thumbBounds);
|
573
|
+
setTimeout(() => {
|
574
|
+
setPlaceholders(holders => ({ ...holders, [index]: true }));
|
575
|
+
}, Math.max(0, displayDuration - 80));
|
576
|
+
const transitionEndDelay = images[index].transitionEndDelay || 30;
|
577
|
+
setTimeout(() => {
|
578
|
+
resetAnimation(index);
|
579
|
+
}, displayDuration + transitionEndDelay);
|
580
|
+
});
|
581
|
+
});
|
582
|
+
}
|
583
|
+
/**
|
584
|
+
* 取消小图放大过渡效果
|
585
|
+
* @en Cancel the thumbnail zoom transition effect
|
586
|
+
*/
|
587
|
+
function resetAnimation(index) {
|
588
|
+
setImagesStatusByIndex(index, { animated: true });
|
589
|
+
setTransImageInfo(null);
|
590
|
+
}
|
591
|
+
/**
|
592
|
+
* 根据rect设置图片的位置
|
593
|
+
* @en Set the position of the image according to the rect
|
594
|
+
*/
|
595
|
+
function setImageBounds(image, rect, thumbRect) {
|
596
|
+
// 这里为保持原有比例,只设置宽度变化,高度会随宽度等比变化
|
597
|
+
image.style.width = `${thumbRect.width}px`;
|
598
|
+
const transform = `translate3d(${rect.left}px, ${rect.top}px, 0) scale(${rect.width / thumbRect.width}`;
|
599
|
+
image.style.transform = transform;
|
600
|
+
image.style.webkitTransform = transform;
|
601
|
+
image.style.transformOrigin = 'left top';
|
602
|
+
image.style.webkitTransformOrigin = 'left top';
|
603
|
+
}
|
604
|
+
/**
|
605
|
+
* 计算放大之后的位置rect
|
606
|
+
* @en Calculate the position rect after zooming in
|
607
|
+
*/
|
608
|
+
function getNewImageBounds(index, transSrc, transImage, callback) {
|
609
|
+
if (!transSrc) {
|
610
|
+
callback(null);
|
611
|
+
return;
|
612
|
+
}
|
613
|
+
setTransImageInfo({
|
614
|
+
src: transSrc,
|
615
|
+
fit: images[index].fit,
|
616
|
+
index,
|
617
|
+
movingImage: transImage,
|
618
|
+
onLoad: (_, image) => {
|
619
|
+
setTimeout(() => {
|
620
|
+
callback(image.getBoundingClientRect());
|
621
|
+
}, 20);
|
622
|
+
},
|
623
|
+
onError: () => callback(null),
|
624
|
+
});
|
625
|
+
}
|
626
|
+
/**
|
627
|
+
* @en 渲染轮播+图片展示
|
628
|
+
* Rendering carousel + displaying image
|
629
|
+
*/
|
630
|
+
function renderContent(carouselProps, allImages, getImageProps) {
|
631
|
+
return (React.createElement(Carousel, Object.assign({ autoPlay: false, loop: loop, lazyloadCount: lazyloadCount, stopPropagation: false }, carouselProps), (allImages || []).map((image, index) => {
|
632
|
+
const innerNode = (React.createElement("div", { key: index, className: "preview-image-wrap", style: { padding: `0 ${spaceBetween}px` } },
|
633
|
+
React.createElement(BaseImage, Object.assign({ className: "preview-image", fit: image.fit || fit || 'preview-y', boxWidth: windowWidth - spaceBetween * 2, boxHeight: windowHeight, bottomOverlap: null }, getImageProps(image, index)))));
|
634
|
+
return (React.createElement("div", { className: "preview-image-wrap-container", key: `outer-${index}` },
|
635
|
+
innerNode,
|
636
|
+
image.extraNode));
|
637
|
+
})));
|
638
|
+
}
|
639
|
+
function getImageClass(index) {
|
640
|
+
const { loaded, animated } = imagesStatus[index] || {};
|
641
|
+
return cls('preview-image', {
|
642
|
+
'preview-hidden': index === openIndex && (!loaded || !animated),
|
643
|
+
});
|
644
|
+
}
|
645
|
+
/**
|
646
|
+
* 每张图片的样式
|
647
|
+
* @en style of each image
|
648
|
+
*/
|
649
|
+
function getImageStyle() {
|
650
|
+
// 因为缩放的容器必须是没有transform和transition的纯净元素
|
651
|
+
// @en Because the scaled container must be a pure element without transform and transition
|
652
|
+
// 所以这里强制设置overflow为visible,溢出滚动的部分交由外层来做
|
653
|
+
// @en So it is forced to set overflow to visible, and the part of overflow scrolling is left to the outer layer.
|
654
|
+
return {
|
655
|
+
overflow: 'visible',
|
656
|
+
};
|
657
|
+
}
|
658
|
+
// 渲染轮播指引器
|
659
|
+
function renderPreviewIndicator(currentIndex, total, lastIndex) {
|
660
|
+
if (renderIndicator) {
|
661
|
+
return renderIndicator(currentIndex, total, lastIndex);
|
662
|
+
}
|
663
|
+
return openLoaded ? (React.createElement(Portal, { getContainer: getContainer },
|
664
|
+
React.createElement("div", { className: "image-preview-indicator" },
|
665
|
+
currentIndex + 1,
|
666
|
+
"/",
|
667
|
+
total))) : null;
|
668
|
+
}
|
669
|
+
// ios在重设style时图片会消失一下造成闪动,因此在底下垫一张图
|
670
|
+
// @en In iOS when resetting the style, the image will disappear and cause flickering, so put a image at the bottom
|
671
|
+
// 优先过渡图,其次用原图
|
672
|
+
// @en Prioritize the transition image, followed by the original image
|
673
|
+
function renderImagePlaceholder(src, index, fitCss) {
|
674
|
+
const { originWidth, originHeight, originLeft, originTop, hasOverflow } = imagesStatus[index] || {};
|
675
|
+
const trans = hasOverflow ? {} : getStyleWithVendor({ transform: 'translateY(-50%)' });
|
676
|
+
const fitObj = fitCss ? { objectFit: fitCss } : {};
|
677
|
+
return system === 'ios' && showPlaceholders[index] && originWidth && originHeight ? (React.createElement("img", { src: src, style: {
|
678
|
+
position: 'absolute',
|
679
|
+
width: originWidth,
|
680
|
+
height: originHeight,
|
681
|
+
left: originLeft,
|
682
|
+
top: originTop,
|
683
|
+
...fitObj,
|
684
|
+
...trans,
|
685
|
+
} })) : null;
|
686
|
+
}
|
687
|
+
function renderLoadingArea() {
|
688
|
+
return (React.createElement("div", { className: "image-preview-loading-area" }, loadingArea || React.createElement(Loading, { type: "circle", className: "loading-icon", radius: 7 })));
|
689
|
+
}
|
690
|
+
return (React.createElement(ContextLayout, null, ({ prefixCls }) => (React.createElement(Portal, { getContainer: getContainer },
|
691
|
+
React.createElement(Transition, { in: visible, timeout: displayDuration, type: "fade", mountOnEnter: true, unmountOnExit: true, nodeRef: domRef },
|
692
|
+
React.createElement("div", { className: cls(`${prefixCls}-image-preview`, 'all-border-box', { noselect }, className), style: style, ref: domRef, onClick: handleClick, onDoubleClick: handleImageDoubleClick },
|
693
|
+
renderContent({
|
694
|
+
indicatorPos,
|
695
|
+
initialIndex: openIndex,
|
696
|
+
ref: carouselRef,
|
697
|
+
renderIndicator: renderPreviewIndicator,
|
698
|
+
onChange: index => {
|
699
|
+
innerIndexRef.current = index;
|
700
|
+
onChange && onChange(index);
|
701
|
+
},
|
702
|
+
onAfterChange: (index, oldIndex) => {
|
703
|
+
onAfterChange && onAfterChange(index);
|
704
|
+
restoreTransformer(oldIndex);
|
705
|
+
nextTick(() => {
|
706
|
+
initTransformer(innerIndexRef.current);
|
707
|
+
});
|
708
|
+
},
|
709
|
+
onTouchMove: handleImageWrapTouchMove,
|
710
|
+
onTouchStart: handleImageWrapTouchStart,
|
711
|
+
onTouchEnd: handleImageWrapTouchEnd,
|
712
|
+
...otherProps,
|
713
|
+
}, images, (image, index) => ({
|
714
|
+
src: image.src,
|
715
|
+
ref: r => {
|
716
|
+
imagesRef.current[index] = r;
|
717
|
+
},
|
718
|
+
showLoading,
|
719
|
+
loadingArea: renderLoadingArea(),
|
720
|
+
errorArea,
|
721
|
+
showError,
|
722
|
+
retryTime,
|
723
|
+
staticLabel,
|
724
|
+
animateDuration: transImageInfo ? 0 : void 0,
|
725
|
+
style: getImageStyle(),
|
726
|
+
className: getImageClass(index),
|
727
|
+
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index, image.fit || fit),
|
728
|
+
onLoad: (_, imageEle) => {
|
729
|
+
imageDomsRef.current[index] = imageEle;
|
730
|
+
setImagesStatusByIndex(index, {
|
731
|
+
loaded: true,
|
732
|
+
firstLoaded: true,
|
733
|
+
originWidth: imageEle.offsetWidth,
|
734
|
+
originHeight: imageEle.offsetHeight,
|
735
|
+
originTop: imageEle.offsetTop,
|
736
|
+
originLeft: imageEle.offsetLeft,
|
737
|
+
hasOverflow: imageHasOverflow(imageEle),
|
738
|
+
});
|
739
|
+
if (index === openIndex) {
|
740
|
+
initTransformer(index);
|
741
|
+
}
|
742
|
+
else {
|
743
|
+
setPlaceholders(holders => ({
|
744
|
+
...holders,
|
745
|
+
[index]: true,
|
746
|
+
}));
|
747
|
+
}
|
748
|
+
},
|
749
|
+
onError: () => {
|
750
|
+
imageDomsRef.current[index] = null;
|
751
|
+
if (index === openIndex) {
|
752
|
+
const transImage = transImageInfo?.movingImage;
|
753
|
+
removeChild(transImage);
|
754
|
+
setImagesStatusByIndex(index, {
|
755
|
+
animated: true,
|
756
|
+
loaded: true,
|
757
|
+
});
|
758
|
+
setTransImageInfo(null);
|
759
|
+
}
|
760
|
+
},
|
761
|
+
})),
|
762
|
+
transImageInfo ? (React.createElement("div", { className: "image-preview-fake-rect" }, renderContent({
|
763
|
+
initialIndex: 0,
|
764
|
+
}, [{ src: transImageInfo.src, fit: transImageInfo.fit }], () => ({
|
765
|
+
staticLabel,
|
766
|
+
src: transImageInfo.src,
|
767
|
+
animateDuration: 0,
|
768
|
+
onLoad: transImageInfo.onLoad,
|
769
|
+
onError: transImageInfo.onError,
|
770
|
+
})))) : null,
|
771
|
+
extra)),
|
772
|
+
transImageInfo ? (React.createElement("div", { className: "image-preview-lock-modal", onClick: goClose })) : null))));
|
773
|
+
});
|
774
|
+
export function methodsGenerator(Comp) {
|
775
|
+
return {
|
776
|
+
/**
|
777
|
+
* 打开图片预览
|
778
|
+
* @desc {en} Open image preview
|
779
|
+
* @param {ImagePreviewProps} config configuration
|
780
|
+
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
781
|
+
*/
|
782
|
+
open: open(Comp),
|
783
|
+
};
|
784
|
+
}
|
785
|
+
const ImagePreviewWithGlobalContext = CompWithGlobalContext(ImagePreview);
|
786
|
+
/**
|
787
|
+
* 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
|
788
|
+
* @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
|
789
|
+
* @type 信息展示
|
790
|
+
* @type_en Data Display
|
791
|
+
* @name 图片预览
|
792
|
+
* @name_en ImagePreview
|
793
|
+
*/
|
794
|
+
export default componentWrapper(ImagePreview, methodsGenerator(ImagePreviewWithGlobalContext));
|