Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheets): improve conditional formatting rule layout (#7578)

wpxp12345645377b158b69
diff --git a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx
index 01a8381524..aafb6b8c80 100644
--- a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx
@@ -69,7 +69,7 @@ const TextInput = (props: { id: string; type: CFValueType | 'none'; value: numbe
if (type === CFValueType.formula) {
return (
- <div className="univer-ml-1 univer-w-full">
+ <div className="univer-w-full">
<FormulaEditor
ref={formulaEditorRef}
className={clsx(`
@@ -283,7 +283,6 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
/>
<TextInput
id="min"
- className="univer-ml-1"
value={minValue}
type={minType}
onChange={(v) => {
@@ -302,7 +301,6 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
}}
/>
<ColorPicker
- className="univer-ml-1"
color={minColor}
onChange={(v) => {
setMinColor(v);
@@ -353,7 +351,6 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
<TextInput
id="median"
- className="univer-ml-1"
value={medianValue}
type={medianType}
onChange={(v) => {
@@ -371,26 +368,27 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
});
}}
/>
- {medianType !== 'none' && (
- <ColorPicker
- className="univer-ml-1"
- color={medianColor}
- onChange={(v) => {
- setMedianColor(v);
- handleChange({
- minType,
- medianType,
- maxType,
- minValue,
- medianValue,
- maxValue,
- minColor,
- medianColor: v,
- maxColor,
- });
- }}
- />
- )}
+ {medianType !== 'none'
+ ? (
+ <ColorPicker
+ color={medianColor}
+ onChange={(v) => {
+ setMedianColor(v);
+ handleChange({
+ minType,
+ medianType,
+ maxType,
+ minValue,
+ medianValue,
+ maxValue,
+ minColor,
+ medianColor: v,
+ maxColor,
+ });
+ }}
+ />
+ )
+ : <div aria-hidden className="univer-size-6 univer-flex-shrink-0" />}
</div>
<div
diff --git a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx
index fb53bd9df8..b47f688295 100644
--- a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx
@@ -347,6 +347,7 @@ const IconSetRuleEdit = (props: {
`}
>
{localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.when')}
+ {' '}
{localeService.t(`sheets-conditional-formatting-ui.symbol.${getOppositeOperator(preItem.operator)}`)}
{lessThanText}
{isEnd ? '' : ` ${localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.and')} `}
@@ -405,6 +406,7 @@ const IconSetRuleEdit = (props: {
{localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.rule')}
<span className="univer-font-medium">
{localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.when')}
+ {' '}
{localeService.t(`sheets-conditional-formatting-ui.symbol.${getOppositeOperator(preItem.operator)}`)}
{lessThanText}
{isEnd ? '' : ` ${localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.and')} `}