#1784 Add more alignment options according to spec
This commit is contained in:
@ -60,29 +60,29 @@ const doc = new Document({
|
|||||||
|
|
||||||
This is the list of options for a paragraph. A detailed explanation is below:
|
This is the list of options for a paragraph. A detailed explanation is below:
|
||||||
|
|
||||||
| Property | Type | Mandatory? | Possible Values |
|
| Property | Type | Mandatory? | Possible Values |
|
||||||
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------- |
|
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [text](#text) | `string` | Optional | |
|
| [text](#text) | `string` | Optional | |
|
||||||
| [heading](#heading) | `HeadingLevel` | Optional | `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`, `TITLE` |
|
| [heading](#heading) | `HeadingLevel` | Optional | `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`, `TITLE` |
|
||||||
| [border](#border) | `IBorderOptions` | Optional | `top`, `bottom`, `left`, `right`. Each of these are of type IBorderPropertyOptions. Click here for Example |
|
| [border](#border) | `IBorderOptions` | Optional | `top`, `bottom`, `left`, `right`. Each of these are of type IBorderPropertyOptions. Click here for Example |
|
||||||
| [spacing](#spacing) | `ISpacingProperties` | Optional | See below for ISpacingProperties |
|
| [spacing](#spacing) | `ISpacingProperties` | Optional | See below for ISpacingProperties |
|
||||||
| [outlineLevel](#outline-level) | `number` | Optional | |
|
| [outlineLevel](#outline-level) | `number` | Optional | |
|
||||||
| alignment | `AlignmentType` | Optional | |
|
| alignment | `AlignmentType` | Optional | `START`, `CENTER`, `END`, `BOTH`, `MEDIUM_KASHIDA`, `DISTRIBUTE`, `NUM_TAB`, `HIGH_KASHIDA`, `LOW_KASHIDA`, `THAI_DISTRIBUTE`, `LEFT`, `RIGHT`, `JUSTIFIED` |
|
||||||
| heading | `HeadingLevel` | Optional | |
|
| heading | `HeadingLevel` | Optional | |
|
||||||
| bidirectional | `boolean` | Optional | |
|
| bidirectional | `boolean` | Optional | |
|
||||||
| thematicBreak | `boolean` | Optional | |
|
| thematicBreak | `boolean` | Optional | |
|
||||||
| pageBreakBefore | `boolean` | Optional | |
|
| pageBreakBefore | `boolean` | Optional | |
|
||||||
| contextualSpacing | `boolean` | Optional | |
|
| contextualSpacing | `boolean` | Optional | |
|
||||||
| indent | `IIndentAttributesProperties` | Optional | |
|
| indent | `IIndentAttributesProperties` | Optional | |
|
||||||
| keepLines | `boolean` | Optional | |
|
| keepLines | `boolean` | Optional | |
|
||||||
| keepNext | `boolean` | Optional | |
|
| keepNext | `boolean` | Optional | |
|
||||||
| children | `(TextRun or ImageRun or Hyperlink)[]` | Optional | |
|
| children | `(TextRun or ImageRun or Hyperlink)[]` | Optional | |
|
||||||
| style | `string` | Optional | |
|
| style | `string` | Optional | |
|
||||||
| [tabStop](usage/tab-stops) | `{ left?: ITabStopOptions; right?: ITabStopOptions; maxRight?: { leader: LeaderType; }; center?: ITabStopOptions }` | Optional | |
|
| [tabStop](usage/tab-stops) | `{ left?: ITabStopOptions; right?: ITabStopOptions; maxRight?: { leader: LeaderType; }; center?: ITabStopOptions }` | Optional | |
|
||||||
| [bullet](usage/bullet-points) | `{ level: number }` | Optional | |
|
| [bullet](usage/bullet-points) | `{ level: number }` | Optional | |
|
||||||
| [numbering](usage/numbering) | `{ num: ConcreteNumbering; level: number; custom?: boolean }` | Optional | |
|
| [numbering](usage/numbering) | `{ num: ConcreteNumbering; level: number; custom?: boolean }` | Optional | |
|
||||||
| [widowControl](#widow-control) | `boolean` | Optional | |
|
| [widowControl](#widow-control) | `boolean` | Optional | |
|
||||||
| [frame](usage/text-frames.md) | `IFrameOptions` | Optional | |
|
| [frame](usage/text-frames.md) | `IFrameOptions` | Optional | |
|
||||||
|
|
||||||
## Text
|
## Text
|
||||||
|
|
||||||
|
@ -1,16 +1,51 @@
|
|||||||
// http://officeopenxml.com/WPalignment.php
|
// http://officeopenxml.com/WPalignment.php
|
||||||
// http://officeopenxml.com/WPtableAlignment.php
|
// http://officeopenxml.com/WPtableAlignment.php
|
||||||
|
// http://www.datypic.com/sc/ooxml/t-w_ST_Jc.html
|
||||||
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
||||||
|
|
||||||
|
// <xsd:simpleType name="ST_Jc">
|
||||||
|
// <xsd:restriction base="xsd:string">
|
||||||
|
// <xsd:enumeration value="start"/>
|
||||||
|
// <xsd:enumeration value="center"/>
|
||||||
|
// <xsd:enumeration value="end"/>
|
||||||
|
// <xsd:enumeration value="both"/>
|
||||||
|
// <xsd:enumeration value="mediumKashida"/>
|
||||||
|
// <xsd:enumeration value="distribute"/>
|
||||||
|
// <xsd:enumeration value="numTab"/>
|
||||||
|
// <xsd:enumeration value="highKashida"/>
|
||||||
|
// <xsd:enumeration value="lowKashida"/>
|
||||||
|
// <xsd:enumeration value="thaiDistribute"/>
|
||||||
|
// <xsd:enumeration value="left"/>
|
||||||
|
// <xsd:enumeration value="right"/>
|
||||||
|
// </xsd:restriction>
|
||||||
|
// </xsd:simpleType>
|
||||||
export enum AlignmentType {
|
export enum AlignmentType {
|
||||||
|
/** Align Start */
|
||||||
START = "start",
|
START = "start",
|
||||||
END = "end",
|
/** Align Center */
|
||||||
CENTER = "center",
|
CENTER = "center",
|
||||||
|
/** End */
|
||||||
|
END = "end",
|
||||||
|
/** Justified */
|
||||||
BOTH = "both",
|
BOTH = "both",
|
||||||
JUSTIFIED = "both",
|
/** Medium Kashida Length */
|
||||||
|
MEDIUM_KASHIDA = "mediumKashida",
|
||||||
|
/** Distribute All Characters Equally */
|
||||||
DISTRIBUTE = "distribute",
|
DISTRIBUTE = "distribute",
|
||||||
|
/** Align to List Tab */
|
||||||
|
NUM_TAB = "numTab",
|
||||||
|
/** Widest Kashida Length */
|
||||||
|
HIGH_KASHIDA = "highKashida",
|
||||||
|
/** Low Kashida Length */
|
||||||
|
LOW_KASHIDA = "lowKashida",
|
||||||
|
/** Thai Language Justification */
|
||||||
|
THAI_DISTRIBUTE = "thaiDistribute",
|
||||||
|
/** Align Left */
|
||||||
LEFT = "left",
|
LEFT = "left",
|
||||||
|
/** Align Right */
|
||||||
RIGHT = "right",
|
RIGHT = "right",
|
||||||
|
/** Justified */
|
||||||
|
JUSTIFIED = "both",
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> {
|
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> {
|
||||||
|
Reference in New Issue
Block a user