@arco-design/mobile-react 2.30.2 → 2.30.4
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 +27 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/action-sheet/index.d.ts +2 -2
- package/cjs/action-sheet/style/css/index.css +30 -30
- package/cjs/action-sheet/style/index.less +1 -1
- package/cjs/avatar/style/css/index.css +54 -30
- package/cjs/avatar/style/index.less +3 -3
- package/cjs/badge/style/css/index.css +30 -30
- package/cjs/badge/style/index.less +1 -1
- package/cjs/button/style/css/index.css +30 -30
- package/cjs/button/style/index.less +1 -1
- package/cjs/carousel/index.d.ts +5 -0
- package/cjs/carousel/index.js +2 -1
- package/cjs/carousel/style/css/index.css +30 -30
- package/cjs/carousel/style/index.less +1 -1
- package/cjs/cell/style/css/index.css +30 -30
- package/cjs/cell/style/index.less +1 -1
- package/cjs/checkbox/style/css/index.css +30 -30
- package/cjs/checkbox/style/index.less +1 -1
- package/cjs/circle-progress/style/css/index.css +30 -30
- package/cjs/circle-progress/style/index.less +1 -1
- package/cjs/collapse/style/css/index.css +30 -30
- package/cjs/collapse/style/index.less +1 -1
- package/cjs/count-down/style/css/index.css +30 -30
- package/cjs/count-down/style/index.less +1 -1
- package/cjs/date-picker/style/css/index.css +30 -30
- package/cjs/date-picker/style/index.less +1 -1
- package/cjs/dialog/index.d.ts +2 -2
- package/cjs/dialog/style/css/index.css +30 -30
- package/cjs/dialog/style/index.less +1 -1
- package/cjs/divider/style/css/index.css +38 -30
- package/cjs/divider/style/index.less +3 -3
- package/cjs/dropdown/style/css/index.css +37 -30
- package/cjs/dropdown/style/index.less +3 -4
- package/cjs/dropdown-menu/style/css/index.css +38 -30
- package/cjs/dropdown-menu/style/index.less +3 -3
- package/cjs/ellipsis/style/css/index.css +30 -30
- package/cjs/ellipsis/style/index.less +1 -1
- package/cjs/form/style/css/index.css +30 -30
- package/cjs/form/style/index.less +1 -1
- package/cjs/form/type.d.ts +2 -2
- package/cjs/grid/index.js +10 -4
- package/cjs/grid/style/css/index.css +37 -30
- package/cjs/grid/style/index.less +3 -3
- package/cjs/image/index.js +10 -5
- package/cjs/image/style/css/index.css +30 -30
- package/cjs/image/style/index.less +1 -1
- package/cjs/image-picker/style/css/index.css +30 -30
- package/cjs/image-picker/style/index.less +1 -1
- package/cjs/image-preview/index.d.ts +9 -3
- package/cjs/image-preview/index.js +54 -16
- package/cjs/image-preview/style/css/index.css +32 -31
- package/cjs/image-preview/style/index.less +3 -2
- package/cjs/index-bar/style/css/index.css +30 -30
- package/cjs/index-bar/style/index.less +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +6 -6
- package/cjs/input/style/css/index.css +30 -30
- package/cjs/input/style/index.less +1 -1
- package/cjs/keyboard/style/css/index.css +30 -30
- package/cjs/keyboard/style/index.less +1 -1
- package/cjs/load-more/style/css/index.css +30 -30
- package/cjs/load-more/style/index.less +1 -1
- package/cjs/loading/style/css/index.css +30 -30
- package/cjs/loading/style/index.less +1 -1
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/masking/style/css/index.css +30 -30
- package/cjs/masking/style/index.less +1 -1
- package/cjs/nav-bar/style/css/index.css +30 -30
- package/cjs/nav-bar/style/index.less +1 -1
- package/cjs/notice-bar/style/css/index.css +30 -30
- package/cjs/notice-bar/style/index.less +1 -1
- package/cjs/notify/style/css/index.css +30 -30
- package/cjs/notify/style/index.less +1 -1
- package/cjs/pagination/style/css/index.css +30 -30
- package/cjs/pagination/style/index.less +1 -1
- package/cjs/picker/style/css/index.css +30 -30
- package/cjs/picker/style/index.less +1 -1
- package/cjs/picker-view/style/css/index.css +30 -30
- package/cjs/picker-view/style/index.less +1 -1
- package/cjs/popover/style/css/index.css +39 -32
- package/cjs/popover/style/css/menu.css +34 -30
- package/cjs/popover/style/index.less +2 -3
- package/cjs/popover/style/menu.less +2 -2
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup/style/css/index.css +30 -30
- package/cjs/popup/style/index.less +1 -1
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/popup-swiper/style/css/index.css +30 -30
- package/cjs/popup-swiper/style/index.less +1 -1
- package/cjs/progress/style/css/index.css +30 -30
- package/cjs/progress/style/index.less +1 -1
- package/cjs/pull-refresh/style/css/index.css +34 -30
- package/cjs/pull-refresh/style/index.less +2 -2
- package/cjs/radio/style/css/index.css +30 -30
- package/cjs/radio/style/index.less +1 -1
- package/cjs/rate/style/css/index.css +30 -30
- package/cjs/rate/style/index.less +1 -1
- package/cjs/search-bar/style/css/index.css +30 -30
- package/cjs/search-bar/style/index.less +1 -1
- package/cjs/skeleton/index.d.ts +1 -0
- package/cjs/skeleton/index.js +10 -0
- package/cjs/skeleton/style/css/index.css +30 -30
- package/cjs/skeleton/style/index.less +1 -1
- package/cjs/slider/hooks/useSliderEvents.js +14 -8
- package/cjs/slider/hooks/useSliderStyle.js +13 -7
- package/cjs/slider/index.js +4 -2
- package/cjs/slider/marks.js +4 -2
- package/cjs/slider/style/css/index.css +58 -30
- package/cjs/slider/style/index.less +14 -5
- package/cjs/stepper/style/css/index.css +30 -30
- package/cjs/stepper/style/index.less +1 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/steps/style/css/index.css +66 -30
- package/cjs/steps/style/index.less +10 -10
- package/cjs/sticky/style/css/index.css +30 -30
- package/cjs/sticky/style/index.less +1 -1
- package/cjs/style.d.ts +2 -2
- package/cjs/style.js +3 -3
- package/cjs/swipe-action/style/css/index.css +30 -30
- package/cjs/swipe-action/style/index.less +1 -1
- package/cjs/swipe-load/style/css/index.css +30 -30
- package/cjs/swipe-load/style/index.less +1 -1
- package/cjs/switch/style/css/index.css +30 -30
- package/cjs/switch/style/index.less +1 -1
- package/cjs/tab-bar/style/css/index.css +30 -30
- package/cjs/tab-bar/style/index.less +1 -1
- package/cjs/tabs/style/css/index.css +30 -30
- package/cjs/tabs/style/index.less +1 -1
- package/cjs/tag/style/css/index.css +42 -30
- package/cjs/tag/style/index.less +4 -4
- package/cjs/textarea/style/css/index.css +30 -30
- package/cjs/textarea/style/index.less +1 -1
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/style/css/index.css +30 -30
- package/cjs/toast/style/index.less +1 -1
- package/cjs/transition/style/css/index.css +30 -30
- package/cjs/transition/style/index.less +1 -1
- package/dist/index.js +2337 -2279
- package/dist/index.min.js +4 -4
- package/dist/style.css +3110 -2971
- package/dist/style.min.css +1 -1
- package/esm/action-sheet/index.d.ts +2 -2
- package/esm/action-sheet/style/css/index.css +30 -30
- package/esm/action-sheet/style/index.less +1 -1
- package/esm/avatar/style/css/index.css +54 -30
- package/esm/avatar/style/index.less +3 -3
- package/esm/badge/style/css/index.css +30 -30
- package/esm/badge/style/index.less +1 -1
- package/esm/button/style/css/index.css +30 -30
- package/esm/button/style/index.less +1 -1
- package/esm/carousel/index.d.ts +5 -0
- package/esm/carousel/index.js +2 -1
- package/esm/carousel/style/css/index.css +30 -30
- package/esm/carousel/style/index.less +1 -1
- package/esm/cell/style/css/index.css +30 -30
- package/esm/cell/style/index.less +1 -1
- package/esm/checkbox/style/css/index.css +30 -30
- package/esm/checkbox/style/index.less +1 -1
- package/esm/circle-progress/style/css/index.css +30 -30
- package/esm/circle-progress/style/index.less +1 -1
- package/esm/collapse/style/css/index.css +30 -30
- package/esm/collapse/style/index.less +1 -1
- package/esm/count-down/style/css/index.css +30 -30
- package/esm/count-down/style/index.less +1 -1
- package/esm/date-picker/style/css/index.css +30 -30
- package/esm/date-picker/style/index.less +1 -1
- package/esm/dialog/index.d.ts +2 -2
- package/esm/dialog/style/css/index.css +30 -30
- package/esm/dialog/style/index.less +1 -1
- package/esm/divider/style/css/index.css +38 -30
- package/esm/divider/style/index.less +3 -3
- package/esm/dropdown/style/css/index.css +37 -30
- package/esm/dropdown/style/index.less +3 -4
- package/esm/dropdown-menu/style/css/index.css +38 -30
- package/esm/dropdown-menu/style/index.less +3 -3
- package/esm/ellipsis/style/css/index.css +30 -30
- package/esm/ellipsis/style/index.less +1 -1
- package/esm/form/style/css/index.css +30 -30
- package/esm/form/style/index.less +1 -1
- package/esm/form/type.d.ts +2 -2
- package/esm/grid/index.js +12 -6
- package/esm/grid/style/css/index.css +37 -30
- package/esm/grid/style/index.less +3 -3
- package/esm/image/index.js +10 -5
- package/esm/image/style/css/index.css +30 -30
- package/esm/image/style/index.less +1 -1
- package/esm/image-picker/style/css/index.css +30 -30
- package/esm/image-picker/style/index.less +1 -1
- package/esm/image-preview/index.d.ts +9 -3
- package/esm/image-preview/index.js +54 -16
- package/esm/image-preview/style/css/index.css +32 -31
- package/esm/image-preview/style/index.less +3 -2
- package/esm/index-bar/style/css/index.css +30 -30
- package/esm/index-bar/style/index.less +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/input/style/css/index.css +30 -30
- package/esm/input/style/index.less +1 -1
- package/esm/keyboard/style/css/index.css +30 -30
- package/esm/keyboard/style/index.less +1 -1
- package/esm/load-more/style/css/index.css +30 -30
- package/esm/load-more/style/index.less +1 -1
- package/esm/loading/style/css/index.css +30 -30
- package/esm/loading/style/index.less +1 -1
- package/esm/masking/index.d.ts +2 -2
- package/esm/masking/style/css/index.css +30 -30
- package/esm/masking/style/index.less +1 -1
- package/esm/nav-bar/style/css/index.css +30 -30
- package/esm/nav-bar/style/index.less +1 -1
- package/esm/notice-bar/style/css/index.css +30 -30
- package/esm/notice-bar/style/index.less +1 -1
- package/esm/notify/style/css/index.css +30 -30
- package/esm/notify/style/index.less +1 -1
- package/esm/pagination/style/css/index.css +30 -30
- package/esm/pagination/style/index.less +1 -1
- package/esm/picker/style/css/index.css +30 -30
- package/esm/picker/style/index.less +1 -1
- package/esm/picker-view/style/css/index.css +30 -30
- package/esm/picker-view/style/index.less +1 -1
- package/esm/popover/style/css/index.css +39 -32
- package/esm/popover/style/css/menu.css +34 -30
- package/esm/popover/style/index.less +2 -3
- package/esm/popover/style/menu.less +2 -2
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup/style/css/index.css +30 -30
- package/esm/popup/style/index.less +1 -1
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/popup-swiper/style/css/index.css +30 -30
- package/esm/popup-swiper/style/index.less +1 -1
- package/esm/progress/style/css/index.css +30 -30
- package/esm/progress/style/index.less +1 -1
- package/esm/pull-refresh/style/css/index.css +34 -30
- package/esm/pull-refresh/style/index.less +2 -2
- package/esm/radio/style/css/index.css +30 -30
- package/esm/radio/style/index.less +1 -1
- package/esm/rate/style/css/index.css +30 -30
- package/esm/rate/style/index.less +1 -1
- package/esm/search-bar/style/css/index.css +30 -30
- package/esm/search-bar/style/index.less +1 -1
- package/esm/skeleton/index.d.ts +1 -0
- package/esm/skeleton/index.js +1 -0
- package/esm/skeleton/style/css/index.css +30 -30
- package/esm/skeleton/style/index.less +1 -1
- package/esm/slider/hooks/useSliderEvents.js +13 -8
- package/esm/slider/hooks/useSliderStyle.js +12 -7
- package/esm/slider/index.js +4 -2
- package/esm/slider/marks.js +4 -2
- package/esm/slider/style/css/index.css +58 -30
- package/esm/slider/style/index.less +14 -5
- package/esm/stepper/style/css/index.css +30 -30
- package/esm/stepper/style/index.less +1 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/steps/style/css/index.css +66 -30
- package/esm/steps/style/index.less +10 -10
- package/esm/sticky/style/css/index.css +30 -30
- package/esm/sticky/style/index.less +1 -1
- package/esm/style.d.ts +2 -2
- package/esm/style.js +2 -2
- package/esm/swipe-action/style/css/index.css +30 -30
- package/esm/swipe-action/style/index.less +1 -1
- package/esm/swipe-load/style/css/index.css +30 -30
- package/esm/swipe-load/style/index.less +1 -1
- package/esm/switch/style/css/index.css +30 -30
- package/esm/switch/style/index.less +1 -1
- package/esm/tab-bar/style/css/index.css +30 -30
- package/esm/tab-bar/style/index.less +1 -1
- package/esm/tabs/style/css/index.css +30 -30
- package/esm/tabs/style/index.less +1 -1
- package/esm/tag/style/css/index.css +42 -30
- package/esm/tag/style/index.less +4 -4
- package/esm/textarea/style/css/index.css +30 -30
- package/esm/textarea/style/index.less +1 -1
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/style/css/index.css +30 -30
- package/esm/toast/style/index.less +1 -1
- package/esm/transition/style/css/index.css +30 -30
- package/esm/transition/style/index.less +1 -1
- package/package.json +3 -3
- package/style/css/public.css +30 -30
- package/tokens/app/arcodesign/default/css-variables.less +1 -1
- package/tokens/app/arcodesign/default/index.d.ts +1 -1
- package/tokens/app/arcodesign/default/index.js +1 -1
- package/tokens/app/arcodesign/default/index.json +7 -7
- package/tokens/app/arcodesign/default/index.less +1 -1
- package/tokens/mixin/index.less +31 -31
- package/umd/action-sheet/index.d.ts +2 -2
- package/umd/action-sheet/style/css/index.css +30 -30
- package/umd/action-sheet/style/index.less +1 -1
- package/umd/avatar/style/css/index.css +54 -30
- package/umd/avatar/style/index.less +3 -3
- package/umd/badge/style/css/index.css +30 -30
- package/umd/badge/style/index.less +1 -1
- package/umd/button/style/css/index.css +30 -30
- package/umd/button/style/index.less +1 -1
- package/umd/carousel/index.d.ts +5 -0
- package/umd/carousel/index.js +2 -1
- package/umd/carousel/style/css/index.css +30 -30
- package/umd/carousel/style/index.less +1 -1
- package/umd/cell/style/css/index.css +30 -30
- package/umd/cell/style/index.less +1 -1
- package/umd/checkbox/style/css/index.css +30 -30
- package/umd/checkbox/style/index.less +1 -1
- package/umd/circle-progress/style/css/index.css +30 -30
- package/umd/circle-progress/style/index.less +1 -1
- package/umd/collapse/style/css/index.css +30 -30
- package/umd/collapse/style/index.less +1 -1
- package/umd/count-down/style/css/index.css +30 -30
- package/umd/count-down/style/index.less +1 -1
- package/umd/date-picker/style/css/index.css +30 -30
- package/umd/date-picker/style/index.less +1 -1
- package/umd/dialog/index.d.ts +2 -2
- package/umd/dialog/style/css/index.css +30 -30
- package/umd/dialog/style/index.less +1 -1
- package/umd/divider/style/css/index.css +38 -30
- package/umd/divider/style/index.less +3 -3
- package/umd/dropdown/style/css/index.css +37 -30
- package/umd/dropdown/style/index.less +3 -4
- package/umd/dropdown-menu/style/css/index.css +38 -30
- package/umd/dropdown-menu/style/index.less +3 -3
- package/umd/ellipsis/style/css/index.css +30 -30
- package/umd/ellipsis/style/index.less +1 -1
- package/umd/form/style/css/index.css +30 -30
- package/umd/form/style/index.less +1 -1
- package/umd/form/type.d.ts +2 -2
- package/umd/grid/index.js +10 -4
- package/umd/grid/style/css/index.css +37 -30
- package/umd/grid/style/index.less +3 -3
- package/umd/image/index.js +10 -5
- package/umd/image/style/css/index.css +30 -30
- package/umd/image/style/index.less +1 -1
- package/umd/image-picker/style/css/index.css +30 -30
- package/umd/image-picker/style/index.less +1 -1
- package/umd/image-preview/index.d.ts +9 -3
- package/umd/image-preview/index.js +54 -16
- package/umd/image-preview/style/css/index.css +32 -31
- package/umd/image-preview/style/index.less +3 -2
- package/umd/index-bar/style/css/index.css +30 -30
- package/umd/index-bar/style/index.less +1 -1
- package/umd/index.d.ts +2 -2
- package/umd/index.js +8 -8
- package/umd/input/style/css/index.css +30 -30
- package/umd/input/style/index.less +1 -1
- package/umd/keyboard/style/css/index.css +30 -30
- package/umd/keyboard/style/index.less +1 -1
- package/umd/load-more/style/css/index.css +30 -30
- package/umd/load-more/style/index.less +1 -1
- package/umd/loading/style/css/index.css +30 -30
- package/umd/loading/style/index.less +1 -1
- package/umd/masking/index.d.ts +2 -2
- package/umd/masking/style/css/index.css +30 -30
- package/umd/masking/style/index.less +1 -1
- package/umd/nav-bar/style/css/index.css +30 -30
- package/umd/nav-bar/style/index.less +1 -1
- package/umd/notice-bar/style/css/index.css +30 -30
- package/umd/notice-bar/style/index.less +1 -1
- package/umd/notify/style/css/index.css +30 -30
- package/umd/notify/style/index.less +1 -1
- package/umd/pagination/style/css/index.css +30 -30
- package/umd/pagination/style/index.less +1 -1
- package/umd/picker/style/css/index.css +30 -30
- package/umd/picker/style/index.less +1 -1
- package/umd/picker-view/style/css/index.css +30 -30
- package/umd/picker-view/style/index.less +1 -1
- package/umd/popover/style/css/index.css +39 -32
- package/umd/popover/style/css/menu.css +34 -30
- package/umd/popover/style/index.less +2 -3
- package/umd/popover/style/menu.less +2 -2
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup/style/css/index.css +30 -30
- package/umd/popup/style/index.less +1 -1
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/popup-swiper/style/css/index.css +30 -30
- package/umd/popup-swiper/style/index.less +1 -1
- package/umd/progress/style/css/index.css +30 -30
- package/umd/progress/style/index.less +1 -1
- package/umd/pull-refresh/style/css/index.css +34 -30
- package/umd/pull-refresh/style/index.less +2 -2
- package/umd/radio/style/css/index.css +30 -30
- package/umd/radio/style/index.less +1 -1
- package/umd/rate/style/css/index.css +30 -30
- package/umd/rate/style/index.less +1 -1
- package/umd/search-bar/style/css/index.css +30 -30
- package/umd/search-bar/style/index.less +1 -1
- package/umd/skeleton/index.d.ts +1 -0
- package/umd/skeleton/index.js +11 -4
- package/umd/skeleton/style/css/index.css +30 -30
- package/umd/skeleton/style/index.less +1 -1
- package/umd/slider/hooks/useSliderEvents.js +16 -12
- package/umd/slider/hooks/useSliderStyle.js +15 -11
- package/umd/slider/index.js +4 -2
- package/umd/slider/marks.js +4 -2
- package/umd/slider/style/css/index.css +58 -30
- package/umd/slider/style/index.less +14 -5
- package/umd/stepper/style/css/index.css +30 -30
- package/umd/stepper/style/index.less +1 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/steps/style/css/index.css +66 -30
- package/umd/steps/style/index.less +10 -10
- package/umd/sticky/style/css/index.css +30 -30
- package/umd/sticky/style/index.less +1 -1
- package/umd/style.d.ts +2 -2
- package/umd/style.js +2 -2
- package/umd/swipe-action/style/css/index.css +30 -30
- package/umd/swipe-action/style/index.less +1 -1
- package/umd/swipe-load/style/css/index.css +30 -30
- package/umd/swipe-load/style/index.less +1 -1
- package/umd/switch/style/css/index.css +30 -30
- package/umd/switch/style/index.less +1 -1
- package/umd/tab-bar/style/css/index.css +30 -30
- package/umd/tab-bar/style/index.less +1 -1
- package/umd/tabs/style/css/index.css +30 -30
- package/umd/tabs/style/index.less +1 -1
- package/umd/tag/style/css/index.css +42 -30
- package/umd/tag/style/index.less +4 -4
- package/umd/textarea/style/css/index.css +30 -30
- package/umd/textarea/style/index.less +1 -1
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/style/css/index.css +30 -30
- package/umd/toast/style/index.less +1 -1
- package/umd/transition/style/css/index.css +30 -30
- package/umd/transition/style/index.less +1 -1
package/esm/image/index.js
CHANGED
@@ -121,7 +121,7 @@ export var BaseImage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
121
121
|
// 图片有宽高认为正常加载,否则认为加载错误
|
122
122
|
// @en If the image has width and height, it is considered to be loaded normally, otherwise it is considered to be a loading error
|
123
123
|
if (imageDomRef.current.naturalWidth || imageDomRef.current.naturalHeight) {
|
124
|
-
|
124
|
+
handleStaticImageLoaded(null, imageDomRef.current);
|
125
125
|
} else {
|
126
126
|
handleStaticImageError(null);
|
127
127
|
}
|
@@ -147,7 +147,7 @@ export var BaseImage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
147
147
|
}
|
148
148
|
}
|
149
149
|
|
150
|
-
function handleImageLoaded(
|
150
|
+
function handleImageLoaded(image) {
|
151
151
|
hasLoadedRef.current = true;
|
152
152
|
changeStatus('loaded');
|
153
153
|
var _image$width = image.width,
|
@@ -181,7 +181,6 @@ export var BaseImage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
181
181
|
|
182
182
|
extraClass && image.classList.add(extraClass);
|
183
183
|
setWrapClass(extraClass ? extraClass + "-container" : '');
|
184
|
-
onLoad && onLoad(evt, image);
|
185
184
|
}
|
186
185
|
|
187
186
|
function loadImage(isFromRetry) {
|
@@ -209,8 +208,9 @@ export var BaseImage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
209
208
|
image.onload = function (evt) {
|
210
209
|
loadingImageRef.current = null;
|
211
210
|
imageDomRef.current = image;
|
212
|
-
handleImageLoaded(
|
211
|
+
handleImageLoaded(image);
|
213
212
|
replaceChild(image);
|
213
|
+
onLoad && onLoad(evt, image);
|
214
214
|
};
|
215
215
|
|
216
216
|
image.onerror = function (evt) {
|
@@ -235,6 +235,11 @@ export var BaseImage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
235
235
|
});
|
236
236
|
}
|
237
237
|
|
238
|
+
function handleStaticImageLoaded(evt, image) {
|
239
|
+
handleImageLoaded(image);
|
240
|
+
onLoad && onLoad(evt, image);
|
241
|
+
}
|
242
|
+
|
238
243
|
function handleStaticImageError(e) {
|
239
244
|
var evt = e ? e.nativeEvent : null;
|
240
245
|
|
@@ -304,7 +309,7 @@ export var BaseImage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
304
309
|
}, staticLabel && showImage && !staticRetrying ? /*#__PURE__*/React.createElement("img", _extends({}, nativeProps, attrs, {
|
305
310
|
ref: imageDomRef,
|
306
311
|
onLoad: function onLoad(e) {
|
307
|
-
return
|
312
|
+
return handleStaticImageLoaded(e.nativeEvent, imageDomRef.current);
|
308
313
|
},
|
309
314
|
onError: handleStaticImageError
|
310
315
|
})) : null), showLoading && validStatus === 'loading' ? /*#__PURE__*/React.createElement("div", {
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* @name_en General Mixin
|
5
5
|
*/
|
6
6
|
/**
|
7
|
-
* 根据base-font-size,设置单位尺寸为rem
|
7
|
+
* 根据 base-font-size,设置单位尺寸为 rem
|
8
8
|
* @desc {en} set the unit size to rem based on base-font-size
|
9
9
|
* @param @property css属性名
|
10
10
|
* @param @property {en} css property
|
@@ -21,7 +21,7 @@
|
|
21
21
|
* ```
|
22
22
|
*/
|
23
23
|
/**
|
24
|
-
* 根据base-font-size,设置常规模式和rtl模式下单位尺寸为rem
|
24
|
+
* 根据 base-font-size,设置常规模式和 rtl 模式下单位尺寸为 rem
|
25
25
|
* @desc {en} set the unit size to rem for regular and RTL modes based on the base-font-size
|
26
26
|
* @param @property css属性名
|
27
27
|
* @param @property {en} css property
|
@@ -38,8 +38,8 @@
|
|
38
38
|
* ```
|
39
39
|
*/
|
40
40
|
/**
|
41
|
-
* 当less变量use-dark-mode=1
|
42
|
-
* @desc {en}
|
41
|
+
* 当 less 变量 use-dark-mode=1 时,自定义暗黑模式样式规则
|
42
|
+
* @desc {en} Customize dark mode style rules when the less variable use-dark-mode=1.
|
43
43
|
* @param @rules 对应的暗黑模式规则
|
44
44
|
* @param @rules {en} Corresponding dark mode rules
|
45
45
|
* @example
|
@@ -54,7 +54,7 @@
|
|
54
54
|
* ```
|
55
55
|
*/
|
56
56
|
/**
|
57
|
-
* 为属性设置arco提供的token变量
|
57
|
+
* 为属性设置 arco 提供的 token 变量
|
58
58
|
* @desc {en} set the token variable provided by Arco for the attribute
|
59
59
|
* @param @property css属性名
|
60
60
|
* @param @property {en} css property
|
@@ -76,11 +76,11 @@
|
|
76
76
|
* ```
|
77
77
|
*/
|
78
78
|
/**
|
79
|
-
* 在常规模式和rtl模式下为属性设置arco提供的token变量
|
79
|
+
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
80
80
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
81
|
-
* @param @property css属性名
|
81
|
+
* @param @property css 属性名
|
82
82
|
* @param @property {en} css property
|
83
|
-
* @param @variables token变量名
|
83
|
+
* @param @variables token 变量名
|
84
84
|
* @param @variables {en} token variable name
|
85
85
|
* @param @preValues
|
86
86
|
* @param @preValues {en}
|
@@ -96,9 +96,9 @@
|
|
96
96
|
* ```
|
97
97
|
*/
|
98
98
|
/**
|
99
|
-
* 0.5px的边框线
|
99
|
+
* 0.5px 的边框线
|
100
100
|
* @desc {en} a border line of 0.5 pixels
|
101
|
-
* @param @color 使用css变量为线设置颜色
|
101
|
+
* @param @color 使用 css 变量为线设置颜色
|
102
102
|
* @param @color {en} set border-color by CSS variable
|
103
103
|
* @param @direction 边框方向,默认为全部方向
|
104
104
|
* @param @direction {en} border direction,default to all directions.
|
@@ -115,9 +115,9 @@
|
|
115
115
|
/**
|
116
116
|
* 字体加粗
|
117
117
|
* @desc {en} font bold
|
118
|
-
* @param @color 使用css变量设置加粗的字体颜色,默认继承文字当前颜色
|
118
|
+
* @param @color 使用 css 变量设置加粗的字体颜色,默认继承文字当前颜色
|
119
119
|
* @param @color {en} set color by CSS variable
|
120
|
-
* @param @stroke 字体粗细,默认0.3px
|
120
|
+
* @param @stroke 字体粗细,默认 0.3px
|
121
121
|
* @param @stroke {en} font weight, default 0.3 pixel
|
122
122
|
* @example
|
123
123
|
* ```
|
@@ -130,17 +130,17 @@
|
|
130
130
|
* ```
|
131
131
|
*/
|
132
132
|
/**
|
133
|
-
* 1px边框
|
133
|
+
* 1px 边框
|
134
134
|
* @desc {en} 1 pixel border
|
135
135
|
* @param @direction 边框方向
|
136
136
|
* @param @direction {en} border direction
|
137
|
-
* @param @borderColor 使用css变量设置边框颜色
|
137
|
+
* @param @borderColor 使用 css 变量设置边框颜色
|
138
138
|
* @param @borderColor {en} set border-color by CSS variable
|
139
|
-
* @param @borderRadius border-radius,默认为0
|
139
|
+
* @param @borderRadius border-radius,默认为 0
|
140
140
|
* @param @borderRadius {en} border-radius, default value is 0
|
141
|
-
* @param @borderWidth border-width,默认为1px
|
141
|
+
* @param @borderWidth border-width,默认为 1px
|
142
142
|
* @param @borderWidth {en} border-width, default value is 1 pixel
|
143
|
-
* @param @borderStyle border-style,默认为solid
|
143
|
+
* @param @borderStyle border-style,默认为 solid
|
144
144
|
* @param @borderStyle {en} border-style, default value is solid
|
145
145
|
* @example
|
146
146
|
* ```
|
@@ -153,9 +153,9 @@
|
|
153
153
|
* ```
|
154
154
|
*/
|
155
155
|
/**
|
156
|
-
* 元素右下0.5px边框
|
156
|
+
* 元素右下 0.5px 边框
|
157
157
|
* @desc {en} 0.5px border on bottom right
|
158
|
-
* @param @color 使用css变量设置边框颜色
|
158
|
+
* @param @color 使用 css 变量设置边框颜色
|
159
159
|
* @param @color {en} set border-color by CSS variable
|
160
160
|
* @example
|
161
161
|
* ```
|
@@ -167,9 +167,9 @@
|
|
167
167
|
* ```
|
168
168
|
*/
|
169
169
|
/**
|
170
|
-
* 元素左上0.5px边框
|
170
|
+
* 元素左上 0.5px 边框
|
171
171
|
* @desc {en} 0.5px border on top left
|
172
|
-
* @param @color 使用css变量设置边框颜色
|
172
|
+
* @param @color 使用 css 变量设置边框颜色
|
173
173
|
* @param @color {en} set border-color by CSS variable
|
174
174
|
* @example
|
175
175
|
* ```
|
@@ -181,9 +181,9 @@
|
|
181
181
|
* ```
|
182
182
|
*/
|
183
183
|
/**
|
184
|
-
* 设置Loading组件颜色
|
184
|
+
* 设置 Loading 组件颜色
|
185
185
|
* @desc {en} set Loading component color
|
186
|
-
* @param @color 使用css变量设置颜色
|
186
|
+
* @param @color 使用 css 变量设置颜色
|
187
187
|
* @param @color {en} set color by CSS variable
|
188
188
|
* @example
|
189
189
|
* ```
|
@@ -197,9 +197,9 @@
|
|
197
197
|
/**
|
198
198
|
* 设置最小字号
|
199
199
|
* @desc {en} set minimum font-size
|
200
|
-
* @param @size 使用css变量设置最小字号
|
200
|
+
* @param @size 使用 css 变量设置最小字号
|
201
201
|
* @param @size {en} set minimum font-size by CSS variable
|
202
|
-
* @param @scale 设置最小字号下文字缩放比例,默认为0.9
|
202
|
+
* @param @scale 设置最小字号下文字缩放比例,默认为 0.9
|
203
203
|
* @param @scale {en} set minimum font-size down text scale,default value is 0.9
|
204
204
|
* @example
|
205
205
|
* ```
|
@@ -212,9 +212,9 @@
|
|
212
212
|
* ```
|
213
213
|
*/
|
214
214
|
/**
|
215
|
-
* 设置content-box盒模型下元素宽度
|
215
|
+
* 设置 content-box 盒模型下元素宽度
|
216
216
|
* @desc {en} set box width in content-box
|
217
|
-
* @param @property css属性名
|
217
|
+
* @param @property css 属性名
|
218
218
|
* @param @property {en} css property
|
219
219
|
* @param @width 元素总宽度,包含内边距
|
220
220
|
* @param @width element width, include padding
|
@@ -232,11 +232,11 @@
|
|
232
232
|
* ```
|
233
233
|
*/
|
234
234
|
/**
|
235
|
-
* 设置Steps组件颜色
|
235
|
+
* 设置 Steps 组件颜色
|
236
236
|
* @desc {en} set Steps component color
|
237
|
-
* @param @color 使用css变量设置主颜色
|
237
|
+
* @param @color 使用 css 变量设置主颜色
|
238
238
|
* @param @color {en} set main step color by CSS variable
|
239
|
-
* @param @finish-color 使用css变量设置已完成步骤的颜色
|
239
|
+
* @param @finish-color 使用 css 变量设置已完成步骤的颜色
|
240
240
|
* @param @finish-color {en} set finished step color by CSS variable
|
241
241
|
* @example
|
242
242
|
* ```
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* @name_en General Mixin
|
5
5
|
*/
|
6
6
|
/**
|
7
|
-
* 根据base-font-size,设置单位尺寸为rem
|
7
|
+
* 根据 base-font-size,设置单位尺寸为 rem
|
8
8
|
* @desc {en} set the unit size to rem based on base-font-size
|
9
9
|
* @param @property css属性名
|
10
10
|
* @param @property {en} css property
|
@@ -21,7 +21,7 @@
|
|
21
21
|
* ```
|
22
22
|
*/
|
23
23
|
/**
|
24
|
-
* 根据base-font-size,设置常规模式和rtl模式下单位尺寸为rem
|
24
|
+
* 根据 base-font-size,设置常规模式和 rtl 模式下单位尺寸为 rem
|
25
25
|
* @desc {en} set the unit size to rem for regular and RTL modes based on the base-font-size
|
26
26
|
* @param @property css属性名
|
27
27
|
* @param @property {en} css property
|
@@ -38,8 +38,8 @@
|
|
38
38
|
* ```
|
39
39
|
*/
|
40
40
|
/**
|
41
|
-
* 当less变量use-dark-mode=1
|
42
|
-
* @desc {en}
|
41
|
+
* 当 less 变量 use-dark-mode=1 时,自定义暗黑模式样式规则
|
42
|
+
* @desc {en} Customize dark mode style rules when the less variable use-dark-mode=1.
|
43
43
|
* @param @rules 对应的暗黑模式规则
|
44
44
|
* @param @rules {en} Corresponding dark mode rules
|
45
45
|
* @example
|
@@ -54,7 +54,7 @@
|
|
54
54
|
* ```
|
55
55
|
*/
|
56
56
|
/**
|
57
|
-
* 为属性设置arco提供的token变量
|
57
|
+
* 为属性设置 arco 提供的 token 变量
|
58
58
|
* @desc {en} set the token variable provided by Arco for the attribute
|
59
59
|
* @param @property css属性名
|
60
60
|
* @param @property {en} css property
|
@@ -76,11 +76,11 @@
|
|
76
76
|
* ```
|
77
77
|
*/
|
78
78
|
/**
|
79
|
-
* 在常规模式和rtl模式下为属性设置arco提供的token变量
|
79
|
+
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
80
80
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
81
|
-
* @param @property css属性名
|
81
|
+
* @param @property css 属性名
|
82
82
|
* @param @property {en} css property
|
83
|
-
* @param @variables token变量名
|
83
|
+
* @param @variables token 变量名
|
84
84
|
* @param @variables {en} token variable name
|
85
85
|
* @param @preValues
|
86
86
|
* @param @preValues {en}
|
@@ -96,9 +96,9 @@
|
|
96
96
|
* ```
|
97
97
|
*/
|
98
98
|
/**
|
99
|
-
* 0.5px的边框线
|
99
|
+
* 0.5px 的边框线
|
100
100
|
* @desc {en} a border line of 0.5 pixels
|
101
|
-
* @param @color 使用css变量为线设置颜色
|
101
|
+
* @param @color 使用 css 变量为线设置颜色
|
102
102
|
* @param @color {en} set border-color by CSS variable
|
103
103
|
* @param @direction 边框方向,默认为全部方向
|
104
104
|
* @param @direction {en} border direction,default to all directions.
|
@@ -115,9 +115,9 @@
|
|
115
115
|
/**
|
116
116
|
* 字体加粗
|
117
117
|
* @desc {en} font bold
|
118
|
-
* @param @color 使用css变量设置加粗的字体颜色,默认继承文字当前颜色
|
118
|
+
* @param @color 使用 css 变量设置加粗的字体颜色,默认继承文字当前颜色
|
119
119
|
* @param @color {en} set color by CSS variable
|
120
|
-
* @param @stroke 字体粗细,默认0.3px
|
120
|
+
* @param @stroke 字体粗细,默认 0.3px
|
121
121
|
* @param @stroke {en} font weight, default 0.3 pixel
|
122
122
|
* @example
|
123
123
|
* ```
|
@@ -130,17 +130,17 @@
|
|
130
130
|
* ```
|
131
131
|
*/
|
132
132
|
/**
|
133
|
-
* 1px边框
|
133
|
+
* 1px 边框
|
134
134
|
* @desc {en} 1 pixel border
|
135
135
|
* @param @direction 边框方向
|
136
136
|
* @param @direction {en} border direction
|
137
|
-
* @param @borderColor 使用css变量设置边框颜色
|
137
|
+
* @param @borderColor 使用 css 变量设置边框颜色
|
138
138
|
* @param @borderColor {en} set border-color by CSS variable
|
139
|
-
* @param @borderRadius border-radius,默认为0
|
139
|
+
* @param @borderRadius border-radius,默认为 0
|
140
140
|
* @param @borderRadius {en} border-radius, default value is 0
|
141
|
-
* @param @borderWidth border-width,默认为1px
|
141
|
+
* @param @borderWidth border-width,默认为 1px
|
142
142
|
* @param @borderWidth {en} border-width, default value is 1 pixel
|
143
|
-
* @param @borderStyle border-style,默认为solid
|
143
|
+
* @param @borderStyle border-style,默认为 solid
|
144
144
|
* @param @borderStyle {en} border-style, default value is solid
|
145
145
|
* @example
|
146
146
|
* ```
|
@@ -153,9 +153,9 @@
|
|
153
153
|
* ```
|
154
154
|
*/
|
155
155
|
/**
|
156
|
-
* 元素右下0.5px边框
|
156
|
+
* 元素右下 0.5px 边框
|
157
157
|
* @desc {en} 0.5px border on bottom right
|
158
|
-
* @param @color 使用css变量设置边框颜色
|
158
|
+
* @param @color 使用 css 变量设置边框颜色
|
159
159
|
* @param @color {en} set border-color by CSS variable
|
160
160
|
* @example
|
161
161
|
* ```
|
@@ -167,9 +167,9 @@
|
|
167
167
|
* ```
|
168
168
|
*/
|
169
169
|
/**
|
170
|
-
* 元素左上0.5px边框
|
170
|
+
* 元素左上 0.5px 边框
|
171
171
|
* @desc {en} 0.5px border on top left
|
172
|
-
* @param @color 使用css变量设置边框颜色
|
172
|
+
* @param @color 使用 css 变量设置边框颜色
|
173
173
|
* @param @color {en} set border-color by CSS variable
|
174
174
|
* @example
|
175
175
|
* ```
|
@@ -181,9 +181,9 @@
|
|
181
181
|
* ```
|
182
182
|
*/
|
183
183
|
/**
|
184
|
-
* 设置Loading组件颜色
|
184
|
+
* 设置 Loading 组件颜色
|
185
185
|
* @desc {en} set Loading component color
|
186
|
-
* @param @color 使用css变量设置颜色
|
186
|
+
* @param @color 使用 css 变量设置颜色
|
187
187
|
* @param @color {en} set color by CSS variable
|
188
188
|
* @example
|
189
189
|
* ```
|
@@ -197,9 +197,9 @@
|
|
197
197
|
/**
|
198
198
|
* 设置最小字号
|
199
199
|
* @desc {en} set minimum font-size
|
200
|
-
* @param @size 使用css变量设置最小字号
|
200
|
+
* @param @size 使用 css 变量设置最小字号
|
201
201
|
* @param @size {en} set minimum font-size by CSS variable
|
202
|
-
* @param @scale 设置最小字号下文字缩放比例,默认为0.9
|
202
|
+
* @param @scale 设置最小字号下文字缩放比例,默认为 0.9
|
203
203
|
* @param @scale {en} set minimum font-size down text scale,default value is 0.9
|
204
204
|
* @example
|
205
205
|
* ```
|
@@ -212,9 +212,9 @@
|
|
212
212
|
* ```
|
213
213
|
*/
|
214
214
|
/**
|
215
|
-
* 设置content-box盒模型下元素宽度
|
215
|
+
* 设置 content-box 盒模型下元素宽度
|
216
216
|
* @desc {en} set box width in content-box
|
217
|
-
* @param @property css属性名
|
217
|
+
* @param @property css 属性名
|
218
218
|
* @param @property {en} css property
|
219
219
|
* @param @width 元素总宽度,包含内边距
|
220
220
|
* @param @width element width, include padding
|
@@ -232,11 +232,11 @@
|
|
232
232
|
* ```
|
233
233
|
*/
|
234
234
|
/**
|
235
|
-
* 设置Steps组件颜色
|
235
|
+
* 设置 Steps 组件颜色
|
236
236
|
* @desc {en} set Steps component color
|
237
|
-
* @param @color 使用css变量设置主颜色
|
237
|
+
* @param @color 使用 css 变量设置主颜色
|
238
238
|
* @param @color {en} set main step color by CSS variable
|
239
|
-
* @param @finish-color 使用css变量设置已完成步骤的颜色
|
239
|
+
* @param @finish-color 使用 css 变量设置已完成步骤的颜色
|
240
240
|
* @param @finish-color {en} set finished step color by CSS variable
|
241
241
|
* @example
|
242
242
|
* ```
|
@@ -18,6 +18,12 @@ export interface PreviewImageProps {
|
|
18
18
|
* @en Transition image url
|
19
19
|
*/
|
20
20
|
fallbackSrc?: string;
|
21
|
+
/**
|
22
|
+
* 过渡图到原图放大动效完成后,移除过渡图的延迟时间(ms),一般当原图过大时有调整需求
|
23
|
+
* @en After the transition image to the original image enlargement effect is completed, the delay time (ms) before the transition image is removed
|
24
|
+
* @default 30
|
25
|
+
*/
|
26
|
+
transitionEndDelay?: number;
|
21
27
|
/**
|
22
28
|
* 缩略图填充方式(backgroundPosition),默认top center
|
23
29
|
* @en Thumbnail fill mode (backgroundPosition), default value is top center
|
@@ -29,7 +35,7 @@ export interface PreviewImageProps {
|
|
29
35
|
*/
|
30
36
|
extraNode?: ReactNode;
|
31
37
|
}
|
32
|
-
export interface ImagePreviewProps extends Pick<CarouselProps, 'animateDurationSlide' | 'showIndicator' | 'hideSingleIndicator' | 'indicatorPos' | 'percentToChange' | 'distanceToChange' | 'speedToChange' | 'swipeable'> {
|
38
|
+
export interface ImagePreviewProps extends Pick<CarouselProps, 'animateDurationSlide' | 'showIndicator' | 'hideSingleIndicator' | 'indicatorPos' | 'percentToChange' | 'distanceToChange' | 'speedToChange' | 'swipeable' | 'offsetBetween' | 'renderExtra'> {
|
33
39
|
/**
|
34
40
|
* 自定义样式
|
35
41
|
* @en Custom stylesheet
|
@@ -274,9 +280,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
274
280
|
* @param {ImagePreviewProps} config configuration
|
275
281
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
276
282
|
*/
|
277
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
283
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "offsetBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "renderExtra" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
278
284
|
close: () => void;
|
279
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
285
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "offsetBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "renderExtra" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
280
286
|
};
|
281
287
|
};
|
282
288
|
/**
|
@@ -145,7 +145,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
145
145
|
transformersRef.current = []; // 移除过渡图片
|
146
146
|
// @en Remove transition image
|
147
147
|
|
148
|
-
removeChild(
|
148
|
+
removeChild(transImageRef.current);
|
149
149
|
setTransImageInfo(null);
|
150
150
|
setPlaceholders({});
|
151
151
|
var mounted = isInitialMount.current;
|
@@ -188,7 +188,9 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
188
188
|
|
189
189
|
function removeChild(child) {
|
190
190
|
try {
|
191
|
-
|
191
|
+
var _domRef$current, _domRef$current$query, _domRef$current$query2;
|
192
|
+
|
193
|
+
child && ((_domRef$current = domRef.current) == null ? void 0 : (_domRef$current$query = _domRef$current.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current$query2 = _domRef$current$query[innerIndexRef.current]) == null ? void 0 : _domRef$current$query2.removeChild(child));
|
192
194
|
} catch (e) {}
|
193
195
|
} // 监听滑动到上下边缘后还在往外滑动的操作,则关闭弹窗
|
194
196
|
// @en Monitor the operation of sliding out after sliding to the upper and lower edges, then close the popup
|
@@ -607,7 +609,45 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
607
609
|
}
|
608
610
|
}
|
609
611
|
|
610
|
-
var handleClick = useSingleAndDoubleClick(handleImageClick, handleImageDoubleClick);
|
612
|
+
var handleClick = useSingleAndDoubleClick(handleImageClick, handleImageDoubleClick); // 当使用 getThumbBounds 时,关闭图片预览有缩小效果
|
613
|
+
// @en When using getThumbBounds, closing the image preview has a shrinking effect
|
614
|
+
|
615
|
+
function animateBeforeClose() {
|
616
|
+
var _imagesRef$current$in2;
|
617
|
+
|
618
|
+
if (isTransformed()) {
|
619
|
+
return;
|
620
|
+
}
|
621
|
+
|
622
|
+
var index = innerIndexRef.current;
|
623
|
+
var imageDom = (_imagesRef$current$in2 = imagesRef.current[index]) == null ? void 0 : _imagesRef$current$in2.image;
|
624
|
+
var thumbBounds = getThumbBounds == null ? void 0 : getThumbBounds(index);
|
625
|
+
|
626
|
+
if (!imageDom || !thumbBounds || !thumbBounds.width || !thumbBounds.height) {
|
627
|
+
return;
|
628
|
+
} // 小图超过一半在视野外时,不展示缩小效果
|
629
|
+
// @en When more than half of the thumbnail is outside the field of view, the zoom effect will not be displayed
|
630
|
+
|
631
|
+
|
632
|
+
if (thumbBounds.top < -1 * thumbBounds.height / 2 || thumbBounds.top > windowHeight - thumbBounds.height / 2 || thumbBounds.left < -1 * thumbBounds.width / 2 || thumbBounds.left > windowWidth - thumbBounds.width / 2) {
|
633
|
+
return;
|
634
|
+
}
|
635
|
+
|
636
|
+
var imageDomRect = imageDom.getBoundingClientRect();
|
637
|
+
|
638
|
+
if (!imageDomRect.width || !imageDomRect.height) {
|
639
|
+
return;
|
640
|
+
}
|
641
|
+
|
642
|
+
imageDom.classList.add('closing-animation');
|
643
|
+
setImageBounds(imageDom, imageDomRect, imageDomRect);
|
644
|
+
imageDom.style.objectPosition = images[index].thumbPosition || 'top center';
|
645
|
+
nextTick(function () {
|
646
|
+
imageDom.style.transitionDuration = displayDuration + "ms";
|
647
|
+
imageDom.style.webkitTransitionDuration = displayDuration + "ms";
|
648
|
+
setImageBounds(imageDom, thumbBounds, imageDomRect);
|
649
|
+
});
|
650
|
+
}
|
611
651
|
|
612
652
|
function goClose(e) {
|
613
653
|
if (closingRef.current) {
|
@@ -615,6 +655,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
615
655
|
}
|
616
656
|
|
617
657
|
closingRef.current = true;
|
658
|
+
animateBeforeClose();
|
618
659
|
close(e);
|
619
660
|
}
|
620
661
|
/**
|
@@ -637,7 +678,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
637
678
|
|
638
679
|
|
639
680
|
function setDisplayAnimation(index) {
|
640
|
-
var _imagesStatusRef$curr4;
|
681
|
+
var _imagesStatusRef$curr4, _domRef$current2, _domRef$current2$quer, _domRef$current2$quer2;
|
641
682
|
|
642
683
|
var firstLoaded = (_imagesStatusRef$curr4 = imagesStatusRef.current[index]) == null ? void 0 : _imagesStatusRef$curr4.firstLoaded;
|
643
684
|
var fallbackSrc = replaceFallbackWhenLoaded && firstLoaded ? images[index].src : images[index].fallbackSrc; // 用户设置了getThumbBounds和images的fallbackSrc属性才有放大过渡效果
|
@@ -668,7 +709,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
668
709
|
transImage.style.opacity = '0';
|
669
710
|
transImage.style.transitionDuration = displayDuration + "ms";
|
670
711
|
transImage.style.webkitTransitionDuration = displayDuration + "ms";
|
671
|
-
|
712
|
+
(_domRef$current2 = domRef.current) == null ? void 0 : (_domRef$current2$quer = _domRef$current2.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current2$quer2 = _domRef$current2$quer[index]) == null ? void 0 : _domRef$current2$quer2.prepend(transImage); // 拿到放大之后的位置rect,没拿到就取消小图放大效果
|
672
713
|
// @en Get the zoomed-in position rect, and cancel the zoom-in effect if not getting it
|
673
714
|
|
674
715
|
getNewImageBounds(index, fallbackSrc, transImage, function (rect) {
|
@@ -690,9 +731,10 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
690
731
|
return _extends({}, holders, (_extends3 = {}, _extends3[index] = true, _extends3));
|
691
732
|
});
|
692
733
|
}, Math.max(0, displayDuration - 80));
|
734
|
+
var transitionEndDelay = images[index].transitionEndDelay || 30;
|
693
735
|
setTimeout(function () {
|
694
736
|
resetAnimation(index);
|
695
|
-
}, displayDuration +
|
737
|
+
}, displayDuration + transitionEndDelay);
|
696
738
|
});
|
697
739
|
});
|
698
740
|
}
|
@@ -776,10 +818,10 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
776
818
|
boxHeight: windowHeight,
|
777
819
|
bottomOverlap: null
|
778
820
|
}, getImageProps(image, index))));
|
779
|
-
return
|
821
|
+
return /*#__PURE__*/React.createElement("div", {
|
780
822
|
className: "preview-image-wrap-container",
|
781
823
|
key: "outer-" + index
|
782
|
-
}, innerNode, image.extraNode)
|
824
|
+
}, innerNode, image.extraNode);
|
783
825
|
}));
|
784
826
|
}
|
785
827
|
|
@@ -851,18 +893,14 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
851
893
|
}) : null;
|
852
894
|
}
|
853
895
|
|
854
|
-
function renderLoadingArea(
|
855
|
-
|
856
|
-
// @en The loadingArea is extracted and placed on the upper layer of the transition image
|
857
|
-
return index === openIndex ? /*#__PURE__*/React.createElement(Portal, {
|
858
|
-
getContainer: getContainer
|
859
|
-
}, /*#__PURE__*/React.createElement("div", {
|
896
|
+
function renderLoadingArea() {
|
897
|
+
return /*#__PURE__*/React.createElement("div", {
|
860
898
|
className: "image-preview-loading-area"
|
861
899
|
}, loadingArea || /*#__PURE__*/React.createElement(Loading, {
|
862
900
|
type: "circle",
|
863
901
|
className: "loading-icon",
|
864
902
|
radius: 7
|
865
|
-
}))
|
903
|
+
}));
|
866
904
|
}
|
867
905
|
|
868
906
|
return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref3) {
|
@@ -910,7 +948,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
910
948
|
imagesRef.current[index] = r;
|
911
949
|
},
|
912
950
|
showLoading: showLoading,
|
913
|
-
loadingArea: renderLoadingArea(
|
951
|
+
loadingArea: renderLoadingArea(),
|
914
952
|
errorArea: errorArea,
|
915
953
|
showError: showError,
|
916
954
|
retryTime: retryTime,
|