2018-06-08 16:03:04 +02:00
|
|
|
// http://officeopenxml.com/drwPicFloating-textWrap.php
|
2018-06-09 23:49:01 +01:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
2019-01-10 02:10:20 +00:00
|
|
|
|
|
|
|
import { IMargins } from "../floating";
|
2018-06-08 16:03:04 +02:00
|
|
|
|
|
|
|
interface IWrapTightAttributes {
|
2018-11-02 02:51:57 +00:00
|
|
|
readonly distT?: number;
|
|
|
|
readonly distB?: number;
|
2018-06-08 16:03:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class WrapTightAttributes extends XmlAttributeComponent<IWrapTightAttributes> {
|
2018-11-02 02:51:57 +00:00
|
|
|
protected readonly xmlKeys = {
|
2018-06-08 16:03:04 +02:00
|
|
|
distT: "distT",
|
|
|
|
distB: "distB",
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class WrapTight extends XmlComponent {
|
2018-11-02 02:51:57 +00:00
|
|
|
constructor(
|
2019-01-10 02:10:20 +00:00
|
|
|
margins: IMargins = {
|
|
|
|
top: 0,
|
|
|
|
bottom: 0,
|
2018-11-02 02:51:57 +00:00
|
|
|
},
|
|
|
|
) {
|
|
|
|
super("wp:wrapTight");
|
2018-06-08 16:03:04 +02:00
|
|
|
|
|
|
|
this.root.push(
|
|
|
|
new WrapTightAttributes({
|
2019-01-10 02:10:20 +00:00
|
|
|
distT: margins.top,
|
|
|
|
distB: margins.bottom,
|
2018-06-08 16:03:04 +02:00
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|