parent
587d895fad
commit
d041018007
|
@ -21,25 +21,25 @@ import * as wasm from "./pkg";
|
||||||
|
|
||||||
const convertBorderType = (t: BorderType) => {
|
const convertBorderType = (t: BorderType) => {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case "Nil":
|
case "nil":
|
||||||
return wasm.BorderType.Nil;
|
return wasm.BorderType.Nil;
|
||||||
case "None":
|
case "none":
|
||||||
return wasm.BorderType.None;
|
return wasm.BorderType.None;
|
||||||
case "Single":
|
case "single":
|
||||||
return wasm.BorderType.Single;
|
return wasm.BorderType.Single;
|
||||||
case "Thick":
|
case "thick":
|
||||||
return wasm.BorderType.Thick;
|
return wasm.BorderType.Thick;
|
||||||
case "Double":
|
case "double":
|
||||||
return wasm.BorderType.Double;
|
return wasm.BorderType.Double;
|
||||||
case "Dotted":
|
case "dotted":
|
||||||
return wasm.BorderType.Dotted;
|
return wasm.BorderType.Dotted;
|
||||||
case "Dashed":
|
case "dashed":
|
||||||
return wasm.BorderType.Dashed;
|
return wasm.BorderType.Dashed;
|
||||||
case "DotDash":
|
case "dotDash":
|
||||||
return wasm.BorderType.DotDash;
|
return wasm.BorderType.DotDash;
|
||||||
case "DotDotDash":
|
case "dotDotDash":
|
||||||
return wasm.BorderType.DotDotDash;
|
return wasm.BorderType.DotDotDash;
|
||||||
case "Triple":
|
case "triple":
|
||||||
return wasm.BorderType.Triple;
|
return wasm.BorderType.Triple;
|
||||||
default:
|
default:
|
||||||
return wasm.BorderType.Single;
|
return wasm.BorderType.Single;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
export type BorderType =
|
export type BorderType =
|
||||||
| "Nil"
|
| "nil"
|
||||||
| "None"
|
| "none"
|
||||||
| "Single"
|
| "single"
|
||||||
| "Thick"
|
| "thick"
|
||||||
| "Double"
|
| "double"
|
||||||
| "Dotted"
|
| "dotted"
|
||||||
| "Dashed"
|
| "dashed"
|
||||||
| "DotDash"
|
| "dotDash"
|
||||||
| "DotDotDash"
|
| "dotDotDash"
|
||||||
| "Triple";
|
| "triple";
|
||||||
|
|
||||||
export type BorderPosition =
|
export type BorderPosition =
|
||||||
| "left"
|
| "left"
|
||||||
|
|
|
@ -35,7 +35,7 @@ export class TableCellBorders {
|
||||||
}
|
}
|
||||||
|
|
||||||
clear(position: BorderPosition) {
|
clear(position: BorderPosition) {
|
||||||
let nil = new TableCellBorder(position).border_type("Nil");
|
let nil = new TableCellBorder(position).border_type("nil");
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case "top":
|
case "top":
|
||||||
this.top = nil;
|
this.top = nil;
|
||||||
|
@ -54,12 +54,12 @@ export class TableCellBorders {
|
||||||
}
|
}
|
||||||
|
|
||||||
clearAll() {
|
clearAll() {
|
||||||
this.top = new TableCellBorder("top").border_type("Nil");
|
this.top = new TableCellBorder("top").border_type("nil");
|
||||||
this.left = new TableCellBorder("left").border_type("Nil");
|
this.left = new TableCellBorder("left").border_type("nil");
|
||||||
this.bottom = new TableCellBorder("bottom").border_type("Nil");
|
this.bottom = new TableCellBorder("bottom").border_type("nil");
|
||||||
this.right = new TableCellBorder("right").border_type("Nil");
|
this.right = new TableCellBorder("right").border_type("nil");
|
||||||
this.insideH = new TableCellBorder("insideH").border_type("Nil");
|
this.insideH = new TableCellBorder("insideH").border_type("nil");
|
||||||
this.insideV = new TableCellBorder("insideV").border_type("Nil");
|
this.insideV = new TableCellBorder("insideV").border_type("nil");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ export class TableCell {
|
||||||
clearBorder(position: BorderPosition) {
|
clearBorder(position: BorderPosition) {
|
||||||
this.property.borders[
|
this.property.borders[
|
||||||
position.toLowerCase() as PositionKeys
|
position.toLowerCase() as PositionKeys
|
||||||
] = new TableCellBorder(position).border_type("Nil");
|
] = new TableCellBorder(position).border_type("nil");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docx-wasm",
|
"name": "docx-wasm",
|
||||||
"version": "0.0.65",
|
"version": "0.0.66",
|
||||||
"main": "dist/node/index.js",
|
"main": "dist/node/index.js",
|
||||||
"browser": "dist/web/index.js",
|
"browser": "dist/web/index.js",
|
||||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||||
|
|
Loading…
Reference in New Issue