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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
feat(sheets-ui): support disable defined name (#4854)
ZhangWei0565b0d5b73c
diff --git a/packages/sheets-ui/src/views/defined-name/DefinedName.tsx b/packages/sheets-ui/src/views/defined-name/DefinedName.tsxindex 8320942c49..6dcfa6645b 100644--- a/packages/sheets-ui/src/views/defined-name/DefinedName.tsx+++ b/packages/sheets-ui/src/views/defined-name/DefinedName.tsx@@ -67,6 +67,7 @@ export function DefinedName({ disable }: { disable: boolean }) {<DefinedNameOverlay /></div>)}+ disabled={disable}><aclassName={clsx(`diff --git a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsxindex f88c99c704..5002523a1c 100644--- a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx+++ b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx@@ -42,10 +42,11 @@ enum ArrowDirection {interface IProps {className?: string;+ disableDefinedName?: boolean;}export function FormulaBar(props: IProps) {- const { className } = props;+ const { className, disableDefinedName } = props;const [iconStyle, setIconStyle] = useState<string>(styles.formulaGrey);const [arrowDirection, setArrowDirection] = useState<ArrowDirection>(ArrowDirection.Down);@@ -264,7 +265,7 @@ export function FormulaBar(props: IProps) {}}><div className={styles.nameRanges}>- <DefinedName disable={editDisable} />+ <DefinedName disable={disableDefinedName ?? editDisable} /></div><div className={styles.formulaBar}>