#1507 - Add scale for run
This commit is contained in:
@ -2,4 +2,3 @@ export * from "./table-properties";
|
||||
export * from "./table-float-properties";
|
||||
export * from "./table-layout";
|
||||
export * from "./table-borders";
|
||||
export * from "./table-overlap";
|
||||
|
@ -2,8 +2,13 @@ import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
import { RelativeHorizontalPosition, RelativeVerticalPosition, TableAnchorType, TableFloatProperties } from "./table-float-properties";
|
||||
import { OverlapType } from "./table-overlap";
|
||||
import {
|
||||
OverlapType,
|
||||
RelativeHorizontalPosition,
|
||||
RelativeVerticalPosition,
|
||||
TableAnchorType,
|
||||
TableFloatProperties,
|
||||
} from "./table-float-properties";
|
||||
|
||||
describe("Table Float Properties", () => {
|
||||
describe("#constructor", () => {
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
||||
import { StringEnumValueElement, XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
||||
import { signedTwipsMeasureValue, twipsMeasureValue } from "@util/values";
|
||||
|
||||
import { OverlapType, TableOverlap } from "./table-overlap";
|
||||
|
||||
export enum TableAnchorType {
|
||||
MARGIN = "margin",
|
||||
PAGE = "page",
|
||||
@ -26,6 +24,17 @@ export enum RelativeVerticalPosition {
|
||||
TOP = "top",
|
||||
}
|
||||
|
||||
// <xsd:simpleType name="ST_TblOverlap">
|
||||
// <xsd:restriction base="xsd:string">
|
||||
// <xsd:enumeration value="never"/>
|
||||
// <xsd:enumeration value="overlap"/>
|
||||
// </xsd:restriction>
|
||||
// </xsd:simpleType>
|
||||
export enum OverlapType {
|
||||
NEVER = "never",
|
||||
OVERLAP = "overlap",
|
||||
}
|
||||
|
||||
export interface ITableFloatOptions {
|
||||
/* cSpell:disable */
|
||||
/**
|
||||
@ -171,7 +180,10 @@ export class TableFloatProperties extends XmlComponent {
|
||||
);
|
||||
|
||||
if (options.overlap) {
|
||||
this.root.push(new TableOverlap(options.overlap));
|
||||
// <xsd:complexType name="CT_TblOverlap">
|
||||
// <xsd:attribute name="val" type="ST_TblOverlap" use="required"/>
|
||||
// </xsd:complexType>
|
||||
this.root.push(new StringEnumValueElement<OverlapType>("w:tblOverlap", options.overlap));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
import { OverlapType, TableOverlap } from "./table-overlap";
|
||||
|
||||
describe("TableOverlap", () => {
|
||||
describe("#constructor", () => {
|
||||
it("sets the width attribute to the value given", () => {
|
||||
const tableOverlap = new TableOverlap(OverlapType.OVERLAP);
|
||||
const tree = new Formatter().format(tableOverlap);
|
||||
|
||||
expect(tree).to.deep.equal({
|
||||
"w:tblOverlap": {
|
||||
_attr: {
|
||||
"w:val": "overlap",
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,26 +0,0 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
||||
|
||||
// <xsd:simpleType name="ST_TblOverlap">
|
||||
// <xsd:restriction base="xsd:string">
|
||||
// <xsd:enumeration value="never"/>
|
||||
// <xsd:enumeration value="overlap"/>
|
||||
// </xsd:restriction>
|
||||
// </xsd:simpleType>
|
||||
export enum OverlapType {
|
||||
NEVER = "never",
|
||||
OVERLAP = "overlap",
|
||||
}
|
||||
|
||||
// <xsd:complexType name="CT_TblOverlap">
|
||||
// <xsd:attribute name="val" type="ST_TblOverlap" use="required"/>
|
||||
// </xsd:complexType>
|
||||
class TableOverlapAttributes extends XmlAttributeComponent<{ readonly val: OverlapType }> {
|
||||
protected readonly xmlKeys = { val: "w:val" };
|
||||
}
|
||||
|
||||
export class TableOverlap extends XmlComponent {
|
||||
public constructor(type: OverlapType) {
|
||||
super("w:tblOverlap");
|
||||
this.root.push(new TableOverlapAttributes({ val: type }));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user