2022-11-03 00:43:26 +08:00
|
|
|
import classNames from 'classnames';
|
2023-05-06 15:49:37 +08:00
|
|
|
import * as React from 'react';
|
2022-11-03 00:43:26 +08:00
|
|
|
import { ConfigContext } from '../config-provider';
|
|
|
|
import { RawPurePanel as PopoverRawPurePanel } from '../popover/PurePanel';
|
2023-02-13 14:30:08 +08:00
|
|
|
import type { TourStepProps } from './interface';
|
|
|
|
import TourPanel from './panelRender';
|
2022-11-03 00:43:26 +08:00
|
|
|
import useStyle from './style';
|
2023-08-08 19:48:41 +08:00
|
|
|
import { withPureRenderTheme } from '../_util/PurePanel';
|
2022-11-03 00:43:26 +08:00
|
|
|
|
|
|
|
export interface PurePanelProps extends TourStepProps {}
|
|
|
|
|
2022-11-19 13:47:33 +08:00
|
|
|
const PurePanel: React.FC<PurePanelProps> = (props) => {
|
2022-11-03 00:43:26 +08:00
|
|
|
const {
|
|
|
|
prefixCls: customizePrefixCls,
|
|
|
|
current = 0,
|
|
|
|
total = 6,
|
|
|
|
className,
|
|
|
|
style,
|
|
|
|
type,
|
|
|
|
...restProps
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
const { getPrefixCls } = React.useContext(ConfigContext);
|
|
|
|
const prefixCls = getPrefixCls('tour', customizePrefixCls);
|
|
|
|
|
2023-12-14 14:58:53 +08:00
|
|
|
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
2022-11-03 00:43:26 +08:00
|
|
|
|
2023-11-08 14:56:15 +08:00
|
|
|
return wrapCSSVar(
|
2022-11-03 00:43:26 +08:00
|
|
|
<PopoverRawPurePanel
|
|
|
|
prefixCls={prefixCls}
|
|
|
|
hashId={hashId}
|
2023-12-14 14:58:53 +08:00
|
|
|
className={classNames(
|
|
|
|
className,
|
|
|
|
`${prefixCls}-pure`,
|
|
|
|
type && `${prefixCls}-${type}`,
|
|
|
|
cssVarCls,
|
|
|
|
)}
|
2022-11-03 00:43:26 +08:00
|
|
|
style={style}
|
|
|
|
>
|
2023-02-13 14:30:08 +08:00
|
|
|
<TourPanel stepProps={{ ...restProps, prefixCls, total }} current={current} type={type} />
|
2022-11-03 00:43:26 +08:00
|
|
|
</PopoverRawPurePanel>,
|
|
|
|
);
|
2022-11-05 14:55:34 +08:00
|
|
|
};
|
|
|
|
|
2023-08-08 19:48:41 +08:00
|
|
|
export default withPureRenderTheme(PurePanel);
|