UNPKG

@douyinfe/semi-ui

Version:

A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.

91 lines (90 loc) 4.19 kB
import React from "react"; import BaseComponent from "../_base/baseComponent"; import PropTypes from "prop-types"; import { PreviewProps, PreviewState } from "./interface"; import PreviewInner from "./previewInner"; import PreviewFoundation from '@douyinfe/semi-foundation/lib/cjs/image/previewFoundation'; import '@douyinfe/semi-foundation/lib/cjs/image/image.css'; export default class Preview extends BaseComponent<PreviewProps, PreviewState> { static propTypes: { style: PropTypes.Requireable<object>; className: PropTypes.Requireable<string>; visible: PropTypes.Requireable<boolean>; src: PropTypes.Requireable<NonNullable<string | any[]>>; currentIndex: PropTypes.Requireable<number>; defaultCurrentIndex: PropTypes.Requireable<number>; defaultVisible: PropTypes.Requireable<boolean>; maskClosable: PropTypes.Requireable<boolean>; closable: PropTypes.Requireable<boolean>; zoomStep: PropTypes.Requireable<number>; infinite: PropTypes.Requireable<boolean>; showTooltip: PropTypes.Requireable<boolean>; closeOnEsc: PropTypes.Requireable<boolean>; prevTip: PropTypes.Requireable<string>; nextTip: PropTypes.Requireable<string>; zoomInTip: PropTypes.Requireable<string>; zoomOutTip: PropTypes.Requireable<string>; downloadTip: PropTypes.Requireable<string>; adaptiveTip: PropTypes.Requireable<string>; originTip: PropTypes.Requireable<string>; lazyLoad: PropTypes.Requireable<boolean>; lazyLoadMargin: PropTypes.Requireable<string>; preLoad: PropTypes.Requireable<boolean>; preLoadGap: PropTypes.Requireable<number>; previewCls: PropTypes.Requireable<string>; previewStyle: PropTypes.Requireable<object>; disableDownload: PropTypes.Requireable<boolean>; zIndex: PropTypes.Requireable<number>; renderHeader: PropTypes.Requireable<(...args: any[]) => any>; renderPreviewMenu: PropTypes.Requireable<(...args: any[]) => any>; getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>; onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>; onChange: PropTypes.Requireable<(...args: any[]) => any>; onClose: PropTypes.Requireable<(...args: any[]) => any>; onZoomIn: PropTypes.Requireable<(...args: any[]) => any>; onZoomOut: PropTypes.Requireable<(...args: any[]) => any>; onPrev: PropTypes.Requireable<(...args: any[]) => any>; onNext: PropTypes.Requireable<(...args: any[]) => any>; onDownload: PropTypes.Requireable<(...args: any[]) => any>; onRotateLeft: PropTypes.Requireable<(...args: any[]) => any>; onRatioChange: PropTypes.Requireable<(...args: any[]) => any>; }; static defaultProps: { src: any[]; lazyLoad: boolean; lazyLoadMargin: string; closable: boolean; }; get adapter(): { getContext(key: string): any; getContexts(): any; getProp(key: string): any; getProps(): PreviewProps; getState(key: string): any; getStates(): PreviewState; setState<K extends keyof PreviewState>(s: Pick<PreviewState, K>, callback?: any): void; getCache(c: string): any; getCaches(): any; setCache(key: any, value: any): void; stopPropagation(e: any): void; persistEvent: (event: any) => void; }; foundation: PreviewFoundation; previewGroupId: string; previewRef: React.RefObject<PreviewInner>; previewObserver: IntersectionObserver; constructor(props: any); componentDidMount(): void; componentDidUpdate(prevProps: any): void; observerImages: () => void; static getDerivedStateFromProps(props: PreviewProps, state: PreviewState): Partial<PreviewState>; componentWillUnmount(): void; handleVisibleChange: (newVisible: boolean) => void; handleCurrentIndexChange: (index: number) => void; loopImageIndex: () => { srcListInChildren: any[]; newChildren: any; titles: React.ReactNode[]; }; render(): React.JSX.Element; }