This commit is contained in:
2026-05-25 17:08:18 +08:00
parent df501f6151
commit f1259b71b5
9178 changed files with 1626125 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
"use client";
import * as React from 'react';
import { clsx } from 'clsx';
import { useClosable } from '../_util/hooks';
import { withPureRenderTheme } from '../_util/PurePanel';
import { cloneElement } from '../_util/reactNode';
import { ConfigContext } from '../config-provider';
import { RawPurePanel as PopoverRawPurePanel } from '../popover/PurePanel';
import TourPanel from './panelRender';
import useStyle from './style';
const PurePanel = props => {
const {
prefixCls: customizePrefixCls,
current = 0,
total = 6,
className,
style,
type,
closable,
closeIcon,
...restProps
} = props;
const {
getPrefixCls
} = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('tour', customizePrefixCls);
const [hashId, cssVarCls] = useStyle(prefixCls);
const [mergedClosable, mergedCloseIcon] = useClosable({
closable,
closeIcon
}, null, {
closable: true,
closeIconRender: icon => /*#__PURE__*/React.isValidElement(icon) ? cloneElement(icon, {
className: clsx(icon.props?.className, `${prefixCls}-close-icon`)
}) : icon
});
return /*#__PURE__*/React.createElement(PopoverRawPurePanel, {
prefixCls: prefixCls,
hashId: hashId,
className: clsx(className, `${prefixCls}-pure`, type && `${prefixCls}-${type}`, cssVarCls),
style: style
}, /*#__PURE__*/React.createElement(TourPanel, {
stepProps: {
...restProps,
prefixCls,
total,
closable: mergedClosable ? {
closeIcon: mergedCloseIcon
} : undefined
},
current: current,
type: type
}));
};
export default withPureRenderTheme(PurePanel);