Skip to content

Commit

Permalink
Upgrade the Excelize to the master branch code (#19)
Browse files Browse the repository at this point in the history
- Update and remove unused data types
  • Loading branch information
tianaiyouqing authored Dec 4, 2023
1 parent 1a6a444 commit dd73586
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 26 deletions.
4 changes: 2 additions & 2 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.16
require (
github.com/stretchr/testify v1.8.1
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
github.com/xuri/excelize/v2 v2.8.1-0.20231110160405-c7acf4fafef4
github.com/xuri/excelize/v2 v2.8.1-0.20231202040309-18a160c5be82
golang.org/x/image v0.12.0
golang.org/x/net v0.18.0 // indirect
golang.org/x/net v0.19.0 // indirect
)
8 changes: 8 additions & 0 deletions cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 h1:Chd9DkqERQQuHpXjR/HSV1
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.8.1-0.20231110160405-c7acf4fafef4 h1:9xehxILB3K6+ywiX7KcqMbf357+dtpVxONSoRf3ZXFU=
github.com/xuri/excelize/v2 v2.8.1-0.20231110160405-c7acf4fafef4/go.mod h1:iwipck2q5caqRjROpapZpVqnlcAxBnE7CuLOJ8oNF/I=
github.com/xuri/excelize/v2 v2.8.1-0.20231202040309-18a160c5be82 h1:es9JxZhoZ1AR4+iYfv4fpE/N6k+ZxIaTRivWStc2J9M=
github.com/xuri/excelize/v2 v2.8.1-0.20231202040309-18a160c5be82/go.mod h1:iwipck2q5caqRjROpapZpVqnlcAxBnE7CuLOJ8oNF/I=
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 h1:qhbILQo1K3mphbwKh1vNm4oGezE1eF9fQWmNiIpSfI4=
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand All @@ -30,6 +32,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ=
golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk=
Expand All @@ -43,6 +47,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -55,12 +61,14 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
Expand Down
11 changes: 10 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ func regConstants() {
} {
js.Global().Get("excelize").Set(name, constant)
}
for name, constant := range map[string]int{
"ChartLineSolid": int(excelize.ChartLineSolid),
"ChartLineNone": int(excelize.ChartLineNone),
"ChartLineAutomatic": int(excelize.ChartLineAutomatic),
} {
js.Global().Get("excelize").Set(name, constant)
}
}

// regInteropFunc register all exported JavaScript functions.
Expand Down Expand Up @@ -3437,7 +3444,9 @@ func SetPanes(f *excelize.File) func(this js.Value, args []js.Value) interface{}
}
}

// SetRowHeight provides a function to set the height of a single row.
// SetRowHeight provides a function to set the height of a single row. If the
// value of height is 0, will hide the specified row, if the value of height is
// -1, will unset the custom row height.
func SetRowHeight(f *excelize.File) func(this js.Value, args []js.Value) interface{} {
return func(this js.Value, args []js.Value) interface{} {
ret := map[string]interface{}{"error": nil}
Expand Down
44 changes: 21 additions & 23 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ declare module 'excelize-wasm' {
*/
export type Shape = {
Cell: string;
Macro?: string;
Type?: string;
Macro?: string;
Width?: number;
Height?: number;
Format?: GraphicOptions;
Color?: ShapeColor;
Fill?: Fill;
Line?: ShapeLine;
Paragraph?: ShapeParagraph[];
Paragraph?: RichTextRun[];
};

/**
Expand Down Expand Up @@ -284,28 +284,11 @@ declare module 'excelize-wasm' {
Format?: GraphicOptions;
};

/**
* ShapeParagraph directly maps the format settings of the paragraph in the
* shape.
*/
export type ShapeParagraph = {
Font?: Font;
Text?: string;
};

/**
* ShapeColor directly maps the color settings of the shape.
*/
export type ShapeColor = {
Line?: string;
Fill?: string;
Effect?: string;
};

/**
* ShapeLine directly maps the line settings of the shape.
*/
export type ShapeLine = {
Color?: string;
Width?: number;
};

Expand Down Expand Up @@ -450,6 +433,15 @@ declare module 'excelize-wasm' {
ShowVal?: boolean;
};

/**
* ChartLineType defines the currently supported chart line types enumeration.
*/
export enum ChartLineType {
ChartLineSolid,
ChartLineNone,
ChartLineAutomatic,
}

/**
* ChartType defines the currently supported chart types enumeration.
*/
Expand Down Expand Up @@ -525,6 +517,7 @@ declare module 'excelize-wasm' {
XAxis?: ChartAxis;
YAxis?: ChartAxis;
PlotArea?: ChartPlotArea;
Border?: ChartLine;
ShowBlanksAs?: string;
HoleSize?: number;
};
Expand All @@ -549,7 +542,7 @@ declare module 'excelize-wasm' {
* ChartLine directly maps the format settings of the chart line.
*/
export type ChartLine = {
Color?: string
Type?: ChartLineType;
Smooth?: boolean;
Width?: number;
};
Expand Down Expand Up @@ -2652,7 +2645,9 @@ declare module 'excelize-wasm' {
SetPanes(sheet: string, panes: Panes): { error: string | null }

/**
* SetRowHeight provides a function to set the height of a single row.
* SetRowHeight provides a function to set the height of a single row. If
* the value of height is 0, will hide the specified row, if the value of
* height is -1, will unset the custom row height.
* @param sheet The worksheet name
* @param row The row number
* @param height The height of the row
Expand Down Expand Up @@ -2906,5 +2901,8 @@ declare module 'excelize-wasm' {
WireframeContour: typeof ChartType.WireframeContour;
Bubble: typeof ChartType.Bubble;
Bubble3D: typeof ChartType.Bubble3D;
ChartLineSolid: typeof ChartLineType.ChartLineSolid;
ChartLineNone: typeof ChartLineType.ChartLineNone;
ChartLineAutomatic: typeof ChartLineType.ChartLineAutomatic;
}>;
}

0 comments on commit dd73586

Please sign in to comment.