mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
fix(docs-quick-insert-ui): hide empty heading and quck-insert menu filter (#5078)
This commit is contained in:
@@ -25,13 +25,14 @@ import styles from './index.module.less';
|
||||
/** @deprecated */
|
||||
export const Menu = React.forwardRef<MenuRef, MenuProps & { wrapperClass?: string }>((props, ref) => {
|
||||
const { mountContainer } = useContext(ConfigContext);
|
||||
const { wrapperClass, ...rest } = props;
|
||||
return mountContainer && (
|
||||
<RcMenu
|
||||
ref={ref}
|
||||
prefixCls={clsx(styles.menu, props.className)}
|
||||
getPopupContainer={() => mountContainer}
|
||||
{...props}
|
||||
className={props.wrapperClass}
|
||||
{...rest}
|
||||
className={wrapperClass}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ export const QuickInsertPlaceholder = () => {
|
||||
<div
|
||||
className={`
|
||||
univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white
|
||||
univer-px-12 univer-py-6 univer-text-gray-400
|
||||
univer-px-12 univer-py-6 univer-text-gray-400 univer-shadow-lg
|
||||
`}
|
||||
>
|
||||
<span>{localeService.t('docQuickInsert.placeholder')}</span>
|
||||
|
||||
@@ -62,6 +62,7 @@ export const QuickInsertButton = ({ className = '' }: IQuickInsertButtonProps) =
|
||||
startOffset: p.startIndex,
|
||||
endOffset: p.startIndex,
|
||||
}]);
|
||||
docQuickInsertPopupService.setInputOffset({ start: p.startIndex - 1, end: p.startIndex - 1 });
|
||||
docQuickInsertPopupService.showPopup({
|
||||
popup,
|
||||
index: p.startIndex - 1,
|
||||
|
||||
@@ -137,7 +137,7 @@ function DocSideMenuContent() {
|
||||
isTitle: p.paragraphStyle?.namedStyleType === NamedStyleType.TITLE,
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as ISideMenuItem[];
|
||||
.filter((item) => item?.text) as ISideMenuItem[];
|
||||
|
||||
const handleScroll = useEvent((params) => {
|
||||
const scrollTop = params.viewportScrollY;
|
||||
|
||||
Reference in New Issue
Block a user