@@ -141,17 +146,18 @@ export const SheetTableThemePanel = (props: ISheetTableThemePanelProps) => {
);
})}
@@ -179,8 +185,8 @@ export const SheetTableThemePanel = (props: ISheetTableThemePanelProps) => {
{
className={clsx(`
univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center
univer-leading-9
- `, borderClassName)}
+ `, borderClassName, {
+ 'univer-text-white': headerBgIsDark,
+ 'univer-text-gray-900': !headerBgIsDark,
+ })}
style={{
background: headerBg,
- color: new ColorKit(headerBg).isDark() ? '#fff' : '#000',
}}
>
{localeService.t('sheets-table.header')}
@@ -256,10 +264,12 @@ export const SheetTableThemePanel = (props: ISheetTableThemePanelProps) => {
`, borderClassName)}
>
@@ -271,10 +281,12 @@ export const SheetTableThemePanel = (props: ISheetTableThemePanelProps) => {
className={clsx(`
univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center
univer-leading-9
- `, borderClassName)}
+ `, borderClassName, {
+ 'univer-text-white': firstRowBgIsDark,
+ 'univer-text-gray-900': !firstRowBgIsDark,
+ })}
style={{
background: firstRowBg,
- color: new ColorKit(firstRowBg).isDark() ? '#fff' : '#000',
}}
>
{localeService.t('sheets-table.firstLine')}
@@ -319,10 +331,12 @@ export const SheetTableThemePanel = (props: ISheetTableThemePanelProps) => {
className={clsx(`
univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center
univer-leading-9
- `, borderClassName)}
+ `, borderClassName, {
+ 'univer-text-white': secondRowBgIsDark,
+ 'univer-text-gray-900': !secondRowBgIsDark,
+ })}
style={{
background: secondRowBg,
- color: new ColorKit(secondRowBg).isDark() ? '#fff' : '#000',
}}
>
{localeService.t('sheets-table.secondLine')}
@@ -365,10 +379,12 @@ export const SheetTableThemePanel = (props: ISheetTableThemePanelProps) => {
className={clsx(`
univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center
univer-leading-9
- `, borderClassName)}
+ `, borderClassName, {
+ 'univer-text-white': lastRowBgIsDark,
+ 'univer-text-gray-900': !lastRowBgIsDark,
+ })}
style={{
background: lastRowBg,
- color: new ColorKit(lastRowBg).isDark() ? '#fff' : '#000',
}}
>
{localeService.t('sheets-table.footer')}
diff --git a/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx b/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx
index 67712a13d5..209bcd0c5d 100644
--- a/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx
+++ b/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx
@@ -67,6 +67,7 @@ export const MenuItemInput = (props: IMenuItemInputProps) => {
e.stopPropagation()}>
{
)
)
: (FormulaEditor && (
-
+
{
/>
-
+
{validString}
-
+
+
);
@@ -150,7 +150,7 @@ const SelectList = (props: ISelectListProps) => {
<>
diff --git a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
index 7b68420476..0fdd7fd81b 100644
--- a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
+++ b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
@@ -255,13 +255,13 @@ export function FormulaBar(props: IProps) {
@@ -301,12 +301,12 @@ export function FormulaBar(props: IProps) {
@@ -316,10 +316,10 @@ export function FormulaBar(props: IProps) {
{FormulaEditor && (
@@ -354,17 +354,14 @@ export function FormulaBar(props: IProps) {
)}
{/* When the editor is hidden, we just cover a div on the editor because re-instantiate
the formula editor will be expensive. */}
- {hideEditor
- ? (
-
- )
- : null}
+ {hideEditor && (
+
+ )}
- {arrowDirection === ArrowDirection.Down
- ? (
-
- )
- : (
-
- )}
+
diff --git a/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx b/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx
index 88254c66fd..4b5e918c1d 100644
--- a/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx
@@ -15,7 +15,7 @@
*/
import type { IScrollState } from './sheet-bar-tabs/utils/slide-tab-bar';
-import { ICommandService, IPermissionService } from '@univerjs/core';
+import { ICommandService, IPermissionService, throttle } from '@univerjs/core';
import { IncreaseSingle, MoreSingle } from '@univerjs/icons';
import { InsertSheetCommand, WorkbookCreateSheetPermission, WorkbookEditablePermission } from '@univerjs/sheets';
import { useDependency, useObservable } from '@univerjs/ui';
@@ -42,22 +42,22 @@ export const SheetBar = () => {
const workbookEditablePermission = useObservable(permissionService.getPermissionPoint$(new WorkbookEditablePermission(unitId)?.id));
const workbookCreateSheetPermission = useObservable(permissionService.getPermissionPoint$(new WorkbookCreateSheetPermission(unitId)?.id));
- useEffect(() => {
- const subscription = sheetBarService.scroll$.subscribe((state: IScrollState) => {
- updateScrollButtonState(state);
- });
-
- return () => {
- subscription.unsubscribe();
- };
- }, []);
-
const updateScrollButtonState = (state: IScrollState) => {
const { leftEnd, rightEnd } = state;
setLeftScrollState(leftEnd);
setRightScrollState(rightEnd);
};
+ useEffect(() => {
+ const subscription = sheetBarService.scroll$.subscribe(throttle((state: IScrollState) => {
+ updateScrollButtonState(state);
+ }, 100));
+
+ return () => {
+ subscription.unsubscribe();
+ };
+ }, []);
+
// Complete the _addSheet, handleScrollLeft, and handleScrollRight functions
const addSheet = () => {
commandService.executeCommand(InsertSheetCommand.id);
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/SheetBarButton.tsx b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/SheetBarButton.tsx
index 7a5fc8ea50..366b7c36bb 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/SheetBarButton.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/SheetBarButton.tsx
@@ -53,7 +53,16 @@ export function SheetBarButton(props: IBaseSheetBarButtonProps) {
};
return (
-
);
};
diff --git a/packages/ui/src/common/component-manager.ts b/packages/ui/src/common/component-manager.ts
index 25b42b84d2..7299d89ef0 100644
--- a/packages/ui/src/common/component-manager.ts
+++ b/packages/ui/src/common/component-manager.ts
@@ -298,12 +298,11 @@ export class ComponentManager {
return value.component;
} else if (value?.framework === 'vue3') {
// TODO: slot support
- return (props: any) => cloneElement(
+ // eslint-disable-next-line ts/no-explicit-any, react/no-clone-element
+ return (props: Record
) => cloneElement(
createElement(VueComponentWrapper, {
component: value.component,
- props: {
- ...props,
- },
+ props,
})
);
} else {
@@ -329,6 +328,7 @@ async function renderVue3Component(VueComponent: ReturnType);
+ nodes.push(
+
+ );
} else {
- nodes.push({localeService.t(labelName)});
+ nodes.push(
+
+ {localeService.t(labelName)}
+
+ );
}
}
if (title) {
- nodes.push({typeof title === 'string' ? localeService.t(title) : title});
+ nodes.push(
+
+ {typeof title === 'string' ? localeService.t(title) : title}
+
+ );
}
return <>{nodes}>;
diff --git a/packages/ui/src/components/heading-item/index.tsx b/packages/ui/src/components/heading-item/index.tsx
index c400ac3f91..26b5199119 100644
--- a/packages/ui/src/components/heading-item/index.tsx
+++ b/packages/ui/src/components/heading-item/index.tsx
@@ -16,6 +16,7 @@
import type { NamedStyleType } from '@univerjs/core';
import { LocaleService, NAMED_STYLE_MAP } from '@univerjs/core';
+import { clsx } from '@univerjs/design';
import { useDependency } from '../../utils/di';
export const HeadingItem = (props: { value: NamedStyleType; text: string }) => {
@@ -26,10 +27,11 @@ export const HeadingItem = (props: { value: NamedStyleType; text: string }) => {
return (
diff --git a/packages/ui/src/views/components/dom/FloatDom.tsx b/packages/ui/src/views/components/dom/FloatDom.tsx
index 11063ec463..73f7fd66f3 100644
--- a/packages/ui/src/views/components/dom/FloatDom.tsx
+++ b/packages/ui/src/views/components/dom/FloatDom.tsx
@@ -147,8 +147,8 @@ export const FloatDomSingle = memo((props: { layer: IFloatDom; id: string }) =>
{component}
diff --git a/packages/ui/src/views/components/dom/print.tsx b/packages/ui/src/views/components/dom/print.tsx
index 37f83249ab..9276c89cf3 100644
--- a/packages/ui/src/views/components/dom/print.tsx
+++ b/packages/ui/src/views/components/dom/print.tsx
@@ -71,16 +71,13 @@ export const PrintFloatDomSingle = memo((props: { layer: IFloatDom; id: string;
return (
{
layer.onPointerMove(e.nativeEvent);
@@ -96,10 +93,10 @@ export const PrintFloatDomSingle = memo((props: { layer: IFloatDom; id: string;
}}
>
{component}
diff --git a/packages/ui/src/views/components/popup/RectPopup.tsx b/packages/ui/src/views/components/popup/RectPopup.tsx
index 6718277f8e..811b9dd305 100644
--- a/packages/ui/src/views/components/popup/RectPopup.tsx
+++ b/packages/ui/src/views/components/popup/RectPopup.tsx
@@ -19,6 +19,7 @@ import type { RefObject } from 'react';
import type { Observable } from 'rxjs';
import type { IUniverUIConfig } from '../../../controllers/config.schema';
import { IConfigService } from '@univerjs/core';
+import { clsx } from '@univerjs/design';
import React, { createContext, useContext, useEffect, useRef } from 'react';
import { createPortal } from 'react-dom';
import { useEvent } from '../../../components/hooks/event';
@@ -323,10 +324,13 @@ function RectPopup(props: IRectPopupProps) {
e.stopPropagation()}
onClick={onClick}
onPointerEnter={onPointerEnter}
diff --git a/packages/ui/src/views/components/ribbon/Ribbon.tsx b/packages/ui/src/views/components/ribbon/Ribbon.tsx
index 9271dd9cf8..6a0307a9e3 100644
--- a/packages/ui/src/views/components/ribbon/Ribbon.tsx
+++ b/packages/ui/src/views/components/ribbon/Ribbon.tsx
@@ -220,7 +220,7 @@ export function Ribbon(props: IRibbonProps) {
for (const { width, key } of sortedToolbarItems) {
totalWidth += width + 8;
- if (totalWidth >= avaliableWidth) {
+ if (totalWidth > avaliableWidth) {
newCollapsedIds.push(key);
}
}
@@ -372,6 +372,7 @@ export function Ribbon(props: IRibbonProps) {
univer-pl-3 univer-pr-2 univer-text-sm univer-text-white
dark:!univer-bg-gray-200 dark:!univer-text-gray-800
`}
+ onClick={() => setGroupSelectorVisible(true)}
>
{localeService.t(activatedTab)}
0 && (
-
+
((pro
return (
@@ -81,7 +81,7 @@ export const TooltipWrapper = forwardRef((pro
export function DropdownWrapper(props: Omit, 'overlay'> & { overlay: ReactNode; align?: 'start' | 'end' | 'center' }) {
const { children, overlay, disabled, align = 'start' } = props;
- const { setDropdownVisible } = useContext(TooltipWrapperContext);
+ const { dropdownVisible, setDropdownVisible } = useContext(TooltipWrapperContext);
function handleVisibleChange(visible: boolean) {
setDropdownVisible(visible);
@@ -96,6 +96,7 @@ export function DropdownWrapper(props: Omit, 'overlay'>
)}
disabled={disabled}
+ open={dropdownVisible}
onOpenChange={handleVisibleChange}
>
e.stopPropagation()}>
@@ -157,7 +158,7 @@ export function DropdownMenuWrapper({
disabled?: boolean;
onOptionSelect: (option: IValueOption) => void;
}) {
- const { setDropdownVisible } = useContext(TooltipWrapperContext);
+ const { dropdownVisible, setDropdownVisible } = useContext(TooltipWrapperContext);
const menuManagerService = useDependency(IMenuManagerService);
const [hiddenStates, setHiddenStates] = useState>({});
@@ -280,6 +281,7 @@ export function DropdownMenuWrapper({
align="start"
items={items}
disabled={disabled}
+ open={dropdownVisible}
onOpenChange={handleVisibleChange}
>
{children}
@@ -327,6 +329,7 @@ export function DropdownMenuWrapper({
align="start"
items={items}
disabled={disabled}
+ open={dropdownVisible}
onOpenChange={handleVisibleChange}
>
{children}