2019-08-20 20:40:40 +01:00
|
|
|
// http://www.datypic.com/sc/ooxml/e-m_naryPr-1.html
|
2025-04-14 16:43:15 +05:30
|
|
|
import { BuilderElement, XmlComponent } from "@file/xml-components";
|
2019-08-20 20:40:40 +01:00
|
|
|
|
2025-04-14 16:43:15 +05:30
|
|
|
import { createMathAccentCharacter } from "./math-accent-character";
|
|
|
|
import { createMathLimitLocation } from "./math-limit-location";
|
|
|
|
import { createMathSubScriptHide } from "./math-sub-script-hide";
|
|
|
|
import { createMathSuperScriptHide } from "./math-super-script-hide";
|
2019-08-20 20:40:40 +01:00
|
|
|
|
2025-04-14 16:43:15 +05:30
|
|
|
type MathNAryPropertiesOptions = {
|
|
|
|
readonly accent: string;
|
|
|
|
readonly hasSuperScript: boolean;
|
|
|
|
readonly hasSubScript: boolean;
|
|
|
|
readonly limitLocationVal?: string;
|
|
|
|
};
|
2019-08-20 20:40:40 +01:00
|
|
|
|
2025-04-14 16:43:15 +05:30
|
|
|
export const createMathNAryProperties = ({
|
|
|
|
accent,
|
|
|
|
hasSuperScript,
|
|
|
|
hasSubScript,
|
|
|
|
limitLocationVal,
|
|
|
|
}: MathNAryPropertiesOptions): XmlComponent =>
|
|
|
|
new BuilderElement({
|
|
|
|
name: "m:naryPr",
|
|
|
|
children: [
|
|
|
|
...(!!accent ? [createMathAccentCharacter({ accent })] : []),
|
|
|
|
createMathLimitLocation({ value: limitLocationVal }),
|
|
|
|
...(!hasSuperScript ? [createMathSuperScriptHide()] : []),
|
|
|
|
...(!hasSubScript ? [createMathSubScriptHide()] : []),
|
|
|
|
],
|
|
|
|
});
|