Documentation and Refactoring (#3028)
* Documentation and Refactoring * Documentation and Refactoring * Fix lint issues * Convert components to Builder style --------- Co-authored-by: Dolan Miu <dmiu@bloomberg.net>
This commit is contained in:
@ -1,9 +1,17 @@
|
||||
// http://officeopenxml.com/drwPicFloating-position.php
|
||||
import { XmlComponent } from "@file/xml-components";
|
||||
import { BuilderElement, XmlComponent } from "@file/xml-components";
|
||||
|
||||
export class PositionOffset extends XmlComponent {
|
||||
public constructor(offsetValue: number) {
|
||||
super("wp:posOffset");
|
||||
this.root.push(offsetValue.toString());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* # Absolute Position Offset
|
||||
*
|
||||
* This element specifies an absolute measurement for the positioning of a floating DrawingML object within a WordprocessingML document. This measurement shall be calculated relative to the top left edge of the positioning base specified by the parent element's `relativeFrom` attribute.
|
||||
*
|
||||
* References:
|
||||
* - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_posOffset_topic_ID0EMG6OB.html
|
||||
* - http://officeopenxml.com/drwPicFloating-position.php
|
||||
*/
|
||||
export const createPositionOffset = (offsetValue: number): XmlComponent =>
|
||||
new BuilderElement({
|
||||
name: "wp:posOffset",
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
children: [offsetValue.toString() as any],
|
||||
});
|
||||
|
Reference in New Issue
Block a user