diff --git a/.editorconfig b/.editorconfig
index 87faf3c3a..6dc8ca042 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -16,3 +16,6 @@ indent_size = 4
[*.md]
trim_trailing_whitespace = false
+
+[**.tsv]
+indent_style = tab
diff --git a/.gitattributes b/.gitattributes
index 7d96a6d3d..695270b36 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -9,3 +9,6 @@
*.ttf binary
*.woff binary
*.docx binary
+*.xlsx binary
+*.pptx binary
+*.TTF binary
diff --git a/docs/zh-CN/components/office-viewer-excel.md b/docs/zh-CN/components/office-viewer-excel.md
new file mode 100644
index 000000000..aba71b63d
--- /dev/null
+++ b/docs/zh-CN/components/office-viewer-excel.md
@@ -0,0 +1,66 @@
+---
+title: Office Viewer Excel
+description:
+type: 0
+group: ⚙ 组件
+menuName: OfficeViewer Excel 渲染
+icon:
+order: 24
+---
+
+> 6.3 及以上版本
+
+## 基本用法
+
+```schema: scope="body"
+{
+ "type": "office-viewer",
+ "src": "/examples/static/all.xlsx",
+ "excelOptions": {
+ "height": 500
+ }
+}
+```
+
+除了 `xlsx`,也支持后缀为 `csv` 及 `tsv` 的文件
+
+## 配置项
+
+由于接口可能有变化,这里只列出少量配置项,后续补充
+
+```schema: scope="body"
+{
+ "type": "office-viewer",
+ "excelOptions": {
+ "showSheetTabBar": false,
+ "showFormulaBar": false
+ },
+ "src": "/examples/static/all.xlsx"
+}
+```
+
+| 属性名 | 类型 | 默认值 | 说明 |
+| --------------- | --------- | ------ | ------------------------ |
+| showFormulaBar | `boolean` | true | 是否显示公式拦 |
+| showSheetTabBar | `boolean` | true | 是否显示底部 sheet 切换 |
+| fontURL | `object` | | 字体地址,参考下面的说明 |
+
+## 字体配置
+
+由于浏览器中缺少特定字体,将展现会不一致,这些字体都是有版权的,因此本项目中不提供,需要自行准备,然后配置 `fontURL` 映射到对应的地址,渲染时就会加载。
+
+类似如下配置
+
+```json
+{
+ "type": "office-viewer",
+ "excelOptions": {
+ "fontURL": {
+ "等线": "/static/font/DengXian.ttf",
+ "仿宋": "/static/font/STFANGSO.TTF",
+ "黑体": "/static/font/simhei.ttf"
+ }
+ },
+ "src": "/examples/static/all.xlsx"
+}
+```
diff --git a/docs/zh-CN/components/office-viewer.md b/docs/zh-CN/components/office-viewer.md
index 4b29218db..f56dd4b5c 100644
--- a/docs/zh-CN/components/office-viewer.md
+++ b/docs/zh-CN/components/office-viewer.md
@@ -10,7 +10,7 @@ order: 23
> 2.9.0 及以上版本
-用于渲染 office 文档,目前只支持 docx 格式
+用于渲染 office 文档,目前只支持 docx 和 xlsx 格式,本文档只介绍 docx 的配置,xlsx 的配置请参考 [office-viewer-excel](office-viewer-excel)
## 基本用法
diff --git a/examples/components/Components.tsx b/examples/components/Components.tsx
index 862121267..8bf907488 100644
--- a/examples/components/Components.tsx
+++ b/examples/components/Components.tsx
@@ -991,12 +991,21 @@ export const components = [
)
},
{
- label: 'OfficeViewer 文档渲染',
+ label: 'OfficeViewer Word 渲染',
path: '/zh-CN/components/office-viewer',
component: React.lazy(() =>
import('../../docs/zh-CN/components/office-viewer.md').then(wrapDoc)
)
},
+ {
+ label: 'OfficeViewer Excel 渲染',
+ path: '/zh-CN/components/office-viewer-excel',
+ component: React.lazy(() =>
+ import('../../docs/zh-CN/components/office-viewer-excel.md').then(
+ wrapDoc
+ )
+ )
+ },
{
label: 'PDFViewer 渲染',
path: '/zh-CN/components/pdf-viewer',
diff --git a/examples/components/OfficeViewer.jsx b/examples/components/OfficeViewer.jsx
index 5c18cc581..03c8bc9a4 100644
--- a/examples/components/OfficeViewer.jsx
+++ b/examples/components/OfficeViewer.jsx
@@ -8,14 +8,17 @@ export default {
{
type: 'input-file',
name: 'file',
- label: '选择 Docx 文件预览效果(不会上传到服务器)',
+ label: '选择 Docx/Excel 文件预览效果(不会上传到服务器)',
asBlob: true,
- accept: '.docx'
+ accept: '.docx,.xlsx,.csv,.tsv'
},
{
type: 'office-viewer',
id: 'office-viewer',
- name: 'file'
+ name: 'file',
+ excelOptions: {
+ height: 500
+ }
}
]
}
diff --git a/examples/static/all.xlsx b/examples/static/all.xlsx
new file mode 100644
index 000000000..d475d825e
Binary files /dev/null and b/examples/static/all.xlsx differ
diff --git a/fis-conf.js b/fis-conf.js
index 1080ccf2d..4b3e099a3 100644
--- a/fis-conf.js
+++ b/fis-conf.js
@@ -526,6 +526,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!punycode/**',
'!office-viewer/**',
'!fflate/**',
+ '!numfmt/**',
'!amis-formula/lib/doc.js'
],
@@ -579,7 +580,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'echarts-wordcloud/**'
],
- 'office-viewer.js': ['office-viewer/**', 'fflate/**'],
+ 'office-viewer.js': ['office-viewer/**', 'fflate/**', 'numfmt/**'],
'json-view.js': 'react-json-view/**',
'fomula-doc.js': 'amis-formula/lib/doc.js',
@@ -608,7 +609,8 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!markdown-it/**',
'!markdown-it-html5-media/**',
'!office-viewer/**',
- '!fflate/**'
+ '!fflate/**',
+ '!numfmt/**'
]
}),
postpackager: [
@@ -842,6 +844,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!punycode/**',
'!amis-formula/**',
'!fflate/**',
+ '!numfmt/**',
'!office-viewer/**',
'!amis-core/**',
'!amis-ui/**',
@@ -908,7 +911,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!/examples/components/EChartsEditor/Common.tsx'
],
- 'pkg/office-viewer.js': ['office-viewer/**', 'fflate/**'],
+ 'pkg/office-viewer.js': ['office-viewer/**', 'fflate/**', 'numfmt/**'],
'pkg/rest.js': [
'**.{js,jsx,ts,tsx}',
@@ -933,7 +936,8 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!uc.micro/**',
'!markdown-it/**',
'!markdown-it-html5-media/**',
- '!fflate/**'
+ '!fflate/**',
+ '!numfmt/**'
],
'pkg/npm.css': ['node_modules/*/**.css', '!monaco-editor/**', '!amis/**'],
diff --git a/index.html b/index.html
index 30a549dea..30424bfbe 100644
--- a/index.html
+++ b/index.html
@@ -26,6 +26,7 @@
/>
+
diff --git a/packages/amis/package.json b/packages/amis/package.json
index bac31e3d1..b652d2c31 100644
--- a/packages/amis/package.json
+++ b/packages/amis/package.json
@@ -62,7 +62,7 @@
"moment": "^2.19.4",
"moment-timezone": "^0.5.34",
"mpegts.js": "^1.6.10",
- "office-viewer": "^0.2.1",
+ "office-viewer": "^0.3.5",
"prop-types": "^15.6.1",
"qrcode.react": "^3.1.0",
"react-cropper": "^2.1.8",
@@ -244,4 +244,4 @@
"react-dom": ">=16.8.6"
},
"gitHead": "37d23b4a8eb1c663bc38e8dd9040889ea1526ec4"
-}
+}
\ No newline at end of file
diff --git a/packages/amis/src/renderers/OfficeViewer.tsx b/packages/amis/src/renderers/OfficeViewer.tsx
index f08ec56e5..d7db6b423 100644
--- a/packages/amis/src/renderers/OfficeViewer.tsx
+++ b/packages/amis/src/renderers/OfficeViewer.tsx
@@ -16,7 +16,7 @@ import {
resolveVariableAndFilter,
ScopedContext
} from 'amis-core';
-import type {Word} from 'office-viewer';
+import type {Word, Excel} from 'office-viewer';
import {Spinner} from 'amis-ui';
import {Payload} from '../types';
@@ -55,13 +55,15 @@ export default class OfficeViewer extends React.Component<
> {
rootElement: React.RefObject;
- word: Word;
+ office: Word | Excel;
fileName?: string;
// 文档数据,避免 update 参数的时候重复加载
document?: any;
+ finalSrc?: string;
+
constructor(props: OfficeViewerProps) {
super(props);
this.rootElement = React.createRef();
@@ -112,7 +114,7 @@ export default class OfficeViewer extends React.Component<
this.renderWord();
} else {
// 默认只更新变量提升性能
- this.word?.updateVariable();
+ this.office?.updateVariable();
}
}
}
@@ -124,11 +126,11 @@ export default class OfficeViewer extends React.Component<
const actionType = action?.actionType as string;
if (actionType === 'saveAs') {
- this.word?.download(args?.name || this.fileName);
+ this.office?.download(args?.name || this.fileName);
}
if (actionType === 'print') {
- this.word?.print();
+ this.office?.print();
}
}
@@ -171,6 +173,9 @@ export default class OfficeViewer extends React.Component<
console.warn('file src is empty');
return;
}
+
+ this.finalSrc = finalSrc;
+
let response: Payload;
this.setState({
@@ -195,32 +200,69 @@ export default class OfficeViewer extends React.Component<
}
}
+ async initOffice(officeViewer: any, file?: ArrayBuffer) {
+ const {
+ wordOptions,
+ excelOptions,
+ env,
+ src,
+ data,
+ translate: __
+ } = this.props;
+ const createOfficeViewer = officeViewer.createOfficeViewer;
+ const office = await createOfficeViewer(
+ file || this.document,
+ {},
+ this.finalSrc
+ );
+
+ if (office instanceof officeViewer.Word) {
+ office.updateOptions({
+ ...wordOptions,
+ data,
+ evalVar: this.evalVar.bind(this)
+ });
+ } else if (office instanceof officeViewer.Excel) {
+ office.updateOptions({
+ ...excelOptions,
+ data,
+ evalVar: this.evalVar.bind(this)
+ });
+ await office.loadExcel();
+ }
+
+ return office;
+ }
+
/**
* 渲染远端文件
*/
async renderRemoteWord() {
- const {wordOptions, env, src, data, display, translate: __} = this.props;
+ const {
+ wordOptions,
+ excelOptions,
+ env,
+ src,
+ data,
+ display,
+ translate: __
+ } = this.props;
if (!this.document) {
return;
}
import('office-viewer').then(async (officeViewer: any) => {
- const Word = officeViewer.Word;
- const word = new Word(this.document, {
- ...wordOptions,
- data,
- evalVar: this.evalVar.bind(this)
- });
+ const office = await this.initOffice(officeViewer);
if (display !== false) {
- word.render(this.rootElement?.current!);
+ office.render(this.rootElement?.current!);
} else if (display === false && this.rootElement?.current) {
// 设置为 false 后清空
this.rootElement.current.innerHTML = '';
}
- this.word = word;
+ this.office = office;
});
}
@@ -236,18 +278,14 @@ export default class OfficeViewer extends React.Component<
const data = reader.result as ArrayBuffer;
import('office-viewer').then(async (officeViewer: any) => {
- const Word = officeViewer.Word;
- const word = new Word(data, {
- ...wordOptions,
- evalVar: this.evalVar.bind(this)
- });
+ const office = await this.initOffice(officeViewer, data);
if (display !== false) {
- word.render(this.rootElement?.current!);
+ office.render(this.rootElement?.current!);
} else if (display === false && this.rootElement?.current) {
// 设置为 false 后清空
this.rootElement.current.innerHTML = '';
}
- this.word = word;
+ this.office = office;
});
};
reader.readAsArrayBuffer(file);
diff --git a/packages/office-viewer/.gitignore b/packages/office-viewer/.gitignore
index 955d7bb36..b225099f2 100644
--- a/packages/office-viewer/.gitignore
+++ b/packages/office-viewer/.gitignore
@@ -1,3 +1,5 @@
-/coverage
-/lib
-/esm
+coverage
+lib
+esm
+.rollup.cache
+~$*
diff --git a/packages/office-viewer/.vscode/launch.json b/packages/office-viewer/.vscode/launch.json
new file mode 100644
index 000000000..6858a7770
--- /dev/null
+++ b/packages/office-viewer/.vscode/launch.json
@@ -0,0 +1,52 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "bun",
+ "request": "launch",
+ "name": "Debug Bun",
+
+ // The path to a JavaScript or TypeScript file to run.
+ "program": "${file}",
+
+ // The arguments to pass to the program, if any.
+ "args": [],
+
+ // The working directory of the program.
+ "cwd": "${workspaceFolder}",
+
+ // The environment variables to pass to the program.
+ "env": {},
+
+ // If the environment variables should not be inherited from the parent process.
+ "strictEnv": false,
+
+ // If the program should be run in watch mode.
+ // This is equivalent to passing `--watch` to the `bun` executable.
+ // You can also set this to "hot" to enable hot reloading using `--hot`.
+ "watchMode": false,
+
+ // If the debugger should stop on the first line of the program.
+ "stopOnEntry": false,
+
+ // If the debugger should be disabled. (for example, breakpoints will not be hit)
+ "noDebug": false,
+
+ // The path to the `bun` executable, defaults to your `PATH` environment variable.
+ "runtime": "bun",
+
+ // The arguments to pass to the `bun` executable, if any.
+ // Unlike `args`, these are passed to the executable itself, not the program.
+ "runtimeArgs": []
+ },
+ {
+ "type": "bun",
+ "request": "attach",
+ "name": "Attach to Bun",
+
+ // The URL of the WebSocket inspector to attach to.
+ // This value can be retrieved by using `bun --inspect`.
+ "url": "ws://localhost:6499/"
+ }
+ ]
+}
diff --git a/packages/office-viewer/.vscode/settings.json b/packages/office-viewer/.vscode/settings.json
new file mode 100644
index 000000000..990a3d62e
--- /dev/null
+++ b/packages/office-viewer/.vscode/settings.json
@@ -0,0 +1,29 @@
+{
+ "cSpell.words": [
+ "cellspacing",
+ "cfvo",
+ "colspan",
+ "Consts",
+ "cust",
+ "Divs",
+ "dxfs",
+ "echarts",
+ "Fmla",
+ "Fmts",
+ "Formattings",
+ "hlink",
+ "Lbls",
+ "moize",
+ "numfmt",
+ "openxml",
+ "papaparse",
+ "prst",
+ "rels",
+ "relt",
+ "rowspan",
+ "Sparkline",
+ "sparklines",
+ "sqref",
+ "xfrm"
+ ]
+}
diff --git a/packages/office-viewer/README.md b/packages/office-viewer/README.md
index 5397e4ebe..9de203af7 100644
--- a/packages/office-viewer/README.md
+++ b/packages/office-viewer/README.md
@@ -1,19 +1,23 @@
# 说明
-## 原理
+Word 和 Excel 渲染器,目前接口还未完全稳定,新版可能会修改,请参考 examples
-docx 渲染器,原理是将 docx 里的 xml 格式转成 html
+## Word 渲染
+
+### 原理
+
+Word 渲染器,原理是将 docx 里的 xml 格式转成 html
相对于 Canvas 渲染,这个实现方案比较简单,最终页面也可以很方便复制,但无法保证和原始 docx 文件展现一致,因为有部分功能难以在 HTML 中实现,比如图文环绕效果。
-## 已知不支持的功能
+### 已知不支持的功能
- 艺术字
- 域
- 对象
- wmf,需要使用 https://github.com/SheetJS/js-wmf
-## 参考资料
+### 参考资料
- [官方规范](https://www.ecma-international.org/publications-and-standards/standards/ecma-376/)
- [标签的在线文档](http://webapp.docx4java.org/OnlineDemo/ecma376/WordML/index.html)
@@ -24,3 +28,9 @@ docx 渲染器,原理是将 docx 里的 xml 格式转成 html
- [docx](https://github.com/dolanmiu/docx) 的类型定义
- [docxjs](https://github.com/zVolodymyr/docxjs) 里格式的实现
+
+## Excel 渲染
+
+### 原理
+
+使用 Canvas 渲染
diff --git a/packages/office-viewer/__tests__/xlsx/auto_filter/autofilter.xlsx b/packages/office-viewer/__tests__/xlsx/auto_filter/autofilter.xlsx
new file mode 100644
index 000000000..eb7d17b62
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/auto_filter/autofilter.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/auto_filter/eq.xlsx b/packages/office-viewer/__tests__/xlsx/auto_filter/eq.xlsx
new file mode 100644
index 000000000..fde569934
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/auto_filter/eq.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/auto_filter/init.xlsx b/packages/office-viewer/__tests__/xlsx/auto_filter/init.xlsx
new file mode 100644
index 000000000..ffc2485f7
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/auto_filter/init.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart.xlsx
new file mode 100644
index 000000000..c65ece8dd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_area.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_area.xlsx
new file mode 100644
index 000000000..e46ecc8e9
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_area.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_bar.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_bar.xlsx
new file mode 100644
index 000000000..b1fceb330
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_bar.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_clustered.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_clustered.xlsx
new file mode 100644
index 000000000..695563b46
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_clustered.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_column.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_column.xlsx
new file mode 100644
index 000000000..126046d53
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_column.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_combined.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_combined.xlsx
new file mode 100644
index 000000000..ec078c790
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_combined.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_data_labels.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_data_labels.xlsx
new file mode 100644
index 000000000..35d60c417
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_data_labels.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_data_table.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_data_table.xlsx
new file mode 100644
index 000000000..b89b79309
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_data_table.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_data_tools.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_data_tools.xlsx
new file mode 100644
index 000000000..3504477ae
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_data_tools.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_date_axis.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_date_axis.xlsx
new file mode 100644
index 000000000..9de479408
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_date_axis.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_doughnut.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_doughnut.xlsx
new file mode 100644
index 000000000..651a1eeed
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_doughnut.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_gauge.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_gauge.xlsx
new file mode 100644
index 000000000..b5bebf39f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_gauge.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_gradient.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_gradient.xlsx
new file mode 100644
index 000000000..e34189439
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_gradient.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_line.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_line.xlsx
new file mode 100644
index 000000000..f49f24398
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_line.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_pareto.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_pareto.xlsx
new file mode 100644
index 000000000..5dc0042dd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_pareto.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_pattern.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_pattern.xlsx
new file mode 100644
index 000000000..0ea89db54
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_pattern.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_pie.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_pie.xlsx
new file mode 100644
index 000000000..360738601
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_pie.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_radar.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_radar.xlsx
new file mode 100644
index 000000000..92745c7b9
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_radar.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_scatter.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_scatter.xlsx
new file mode 100644
index 000000000..800c81d32
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_scatter.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_secondary_axis.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_secondary_axis.xlsx
new file mode 100644
index 000000000..9e715ffca
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_secondary_axis.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_stock.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_stock.xlsx
new file mode 100644
index 000000000..af660b572
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_stock.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chart_styles.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chart_styles.xlsx
new file mode 100644
index 000000000..5d1242b2b
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chart_styles.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/chart/chartsheet.xlsx b/packages/office-viewer/__tests__/xlsx/chart/chartsheet.xlsx
new file mode 100644
index 000000000..c7f75c7cd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/chart/chartsheet.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/3color.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/3color.xlsx
new file mode 100644
index 000000000..39c8196fe
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/3color.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/blank.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/blank.xlsx
new file mode 100644
index 000000000..fd2b7bbb1
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/blank.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/bottom_range.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/bottom_range.xlsx
new file mode 100644
index 000000000..2582565d2
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/bottom_range.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/conditional_format.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/conditional_format.xlsx
new file mode 100644
index 000000000..877cac75b
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/conditional_format.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/databar.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/databar.xlsx
new file mode 100644
index 000000000..af5d0af9d
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/databar.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/databar_number.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/databar_number.xlsx
new file mode 100644
index 000000000..b34c8f1f0
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/databar_number.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/date.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/date.xlsx
new file mode 100644
index 000000000..0a5af64bd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/date.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/iconset.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/iconset.xlsx
new file mode 100644
index 000000000..9a875e95b
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/iconset.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/simple.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/simple.xlsx
new file mode 100644
index 000000000..a8c3f47d1
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/simple.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/conditional_format/x14_iconset.xlsx b/packages/office-viewer/__tests__/xlsx/conditional_format/x14_iconset.xlsx
new file mode 100644
index 000000000..b0d139f1a
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/conditional_format/x14_iconset.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/csv/simple.csv b/packages/office-viewer/__tests__/xlsx/csv/simple.csv
new file mode 100644
index 000000000..cfa20f810
--- /dev/null
+++ b/packages/office-viewer/__tests__/xlsx/csv/simple.csv
@@ -0,0 +1,2 @@
+a,b
+1,2
diff --git a/packages/office-viewer/__tests__/xlsx/csv/simple.tsv b/packages/office-viewer/__tests__/xlsx/csv/simple.tsv
new file mode 100644
index 000000000..8b26211c1
--- /dev/null
+++ b/packages/office-viewer/__tests__/xlsx/csv/simple.tsv
@@ -0,0 +1,2 @@
+a b
+1 2
diff --git a/packages/office-viewer/__tests__/xlsx/font/custom_font.xlsx b/packages/office-viewer/__tests__/xlsx/font/custom_font.xlsx
new file mode 100644
index 000000000..5fc3b9cd5
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/font/custom_font.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/formula/Expenses01.xlsx b/packages/office-viewer/__tests__/xlsx/formula/Expenses01.xlsx
new file mode 100644
index 000000000..e53b5360d
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/formula/Expenses01.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/formula/Expenses02.xlsx b/packages/office-viewer/__tests__/xlsx/formula/Expenses02.xlsx
new file mode 100644
index 000000000..f6c5ca9a6
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/formula/Expenses02.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/formula/Expenses03.xlsx b/packages/office-viewer/__tests__/xlsx/formula/Expenses03.xlsx
new file mode 100644
index 000000000..f46565ac5
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/formula/Expenses03.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/formula/array_formula.xlsx b/packages/office-viewer/__tests__/xlsx/formula/array_formula.xlsx
new file mode 100644
index 000000000..9e7e6529c
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/formula/array_formula.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/formula/formula.xlsx b/packages/office-viewer/__tests__/xlsx/formula/formula.xlsx
new file mode 100644
index 000000000..758db5834
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/formula/formula.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/formula/lambda.xlsx b/packages/office-viewer/__tests__/xlsx/formula/lambda.xlsx
new file mode 100644
index 000000000..90a8f36a3
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/formula/lambda.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/freeze/freeze.xlsx b/packages/office-viewer/__tests__/xlsx/freeze/freeze.xlsx
new file mode 100644
index 000000000..fa341a2dd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/freeze/freeze.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/freeze/freeze_col.xlsx b/packages/office-viewer/__tests__/xlsx/freeze/freeze_col.xlsx
new file mode 100644
index 000000000..0e1cc0c12
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/freeze/freeze_col.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/freeze/freeze_row.xlsx b/packages/office-viewer/__tests__/xlsx/freeze/freeze_row.xlsx
new file mode 100644
index 000000000..661be6a2d
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/freeze/freeze_row.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/freeze/panes.xlsx b/packages/office-viewer/__tests__/xlsx/freeze/panes.xlsx
new file mode 100644
index 000000000..11e0a82db
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/freeze/panes.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/image/crop.xlsx b/packages/office-viewer/__tests__/xlsx/image/crop.xlsx
new file mode 100644
index 000000000..ab04a65a9
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/image/crop.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/image/image.xlsx b/packages/office-viewer/__tests__/xlsx/image/image.xlsx
new file mode 100644
index 000000000..857fbdd43
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/image/image.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/image/image_group.xlsx b/packages/office-viewer/__tests__/xlsx/image/image_group.xlsx
new file mode 100644
index 000000000..698e5891c
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/image/image_group.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/image/images.xlsx b/packages/office-viewer/__tests__/xlsx/image/images.xlsx
new file mode 100644
index 000000000..36c00d8f1
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/image/images.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/image/img.xlsx b/packages/office-viewer/__tests__/xlsx/image/img.xlsx
new file mode 100644
index 000000000..9965fc2b7
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/image/img.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/large/100.xlsx b/packages/office-viewer/__tests__/xlsx/large/100.xlsx
new file mode 100644
index 000000000..6258db834
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/large/100.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/large/100k.xlsx b/packages/office-viewer/__tests__/xlsx/large/100k.xlsx
new file mode 100644
index 000000000..681d89cbc
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/large/100k.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/large/10k.xlsx b/packages/office-viewer/__tests__/xlsx/large/10k.xlsx
new file mode 100644
index 000000000..3bc1dc9da
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/large/10k.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/large/1k.xlsx b/packages/office-viewer/__tests__/xlsx/large/1k.xlsx
new file mode 100644
index 000000000..a4b972d34
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/large/1k.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/large/关键词速查表.xlsx b/packages/office-viewer/__tests__/xlsx/large/关键词速查表.xlsx
new file mode 100644
index 000000000..3e15576a5
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/large/关键词速查表.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/malformed/lowcase.xlsx b/packages/office-viewer/__tests__/xlsx/malformed/lowcase.xlsx
new file mode 100644
index 000000000..52c00056e
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/malformed/lowcase.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/merge/merge1.xlsx b/packages/office-viewer/__tests__/xlsx/merge/merge1.xlsx
new file mode 100644
index 000000000..62613070d
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/merge/merge1.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/merge/merge_cell.xlsx b/packages/office-viewer/__tests__/xlsx/merge/merge_cell.xlsx
new file mode 100644
index 000000000..72872b6c6
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/merge/merge_cell.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/merge/merge_rich_string.xlsx b/packages/office-viewer/__tests__/xlsx/merge/merge_rich_string.xlsx
new file mode 100644
index 000000000..5f8bd06b3
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/merge/merge_rich_string.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/merge/scroll_left.xlsx b/packages/office-viewer/__tests__/xlsx/merge/scroll_left.xlsx
new file mode 100644
index 000000000..7aff8dacd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/merge/scroll_left.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/1904.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/1904.xlsx
new file mode 100644
index 000000000..0d2ddde76
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/1904.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/aaa.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/aaa.xlsx
new file mode 100644
index 000000000..5f0864380
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/aaa.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/aaaa.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/aaaa.xlsx
new file mode 100644
index 000000000..2e1c20080
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/aaaa.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/nan.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/nan.xlsx
new file mode 100644
index 000000000..b5409d3fa
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/nan.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/number_as_text.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/number_as_text.xlsx
new file mode 100644
index 000000000..9c9ee6a84
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/number_as_text.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/numfmt_color.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/numfmt_color.xlsx
new file mode 100644
index 000000000..1f59550f1
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/numfmt_color.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/numfmt/rmb.xlsx b/packages/office-viewer/__tests__/xlsx/numfmt/rmb.xlsx
new file mode 100644
index 000000000..dff66d3dc
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/numfmt/rmb.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/outline/outline.xlsx b/packages/office-viewer/__tests__/xlsx/outline/outline.xlsx
new file mode 100644
index 000000000..e910f1a74
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/outline/outline.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/outline/outline_collapsed.xlsx b/packages/office-viewer/__tests__/xlsx/outline/outline_collapsed.xlsx
new file mode 100644
index 000000000..416a062dd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/outline/outline_collapsed.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/pivot/pivot_table_data.xlsx b/packages/office-viewer/__tests__/xlsx/pivot/pivot_table_data.xlsx
new file mode 100644
index 000000000..1102fbbd0
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/pivot/pivot_table_data.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/pivot/simple.xlsx b/packages/office-viewer/__tests__/xlsx/pivot/simple.xlsx
new file mode 100644
index 000000000..9870f796e
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/pivot/simple.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/protect/protect.xlsx b/packages/office-viewer/__tests__/xlsx/protect/protect.xlsx
new file mode 100644
index 000000000..fec01ecdc
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/protect/protect.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/sheet/many_sheet.xlsx b/packages/office-viewer/__tests__/xlsx/sheet/many_sheet.xlsx
new file mode 100644
index 000000000..6f5c0806f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/sheet/many_sheet.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/sheet/sheet_color.xlsx b/packages/office-viewer/__tests__/xlsx/sheet/sheet_color.xlsx
new file mode 100644
index 000000000..3922f6e0b
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/sheet/sheet_color.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/sheet/sheet_hide.xlsx b/packages/office-viewer/__tests__/xlsx/sheet/sheet_hide.xlsx
new file mode 100644
index 000000000..8e6da1ac1
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/sheet/sheet_hide.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/all.xlsx b/packages/office-viewer/__tests__/xlsx/simple/all.xlsx
new file mode 100644
index 000000000..aacd3dbdd
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/all.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/colRowSize.xlsx b/packages/office-viewer/__tests__/xlsx/simple/colRowSize.xlsx
new file mode 100644
index 000000000..43a46c74d
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/colRowSize.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/datetimes.xlsx b/packages/office-viewer/__tests__/xlsx/simple/datetimes.xlsx
new file mode 100644
index 000000000..698857848
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/datetimes.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/defaultColWidth.xlsx b/packages/office-viewer/__tests__/xlsx/simple/defaultColWidth.xlsx
new file mode 100644
index 000000000..464ec630b
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/defaultColWidth.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/definedName.xlsx b/packages/office-viewer/__tests__/xlsx/simple/definedName.xlsx
new file mode 100644
index 000000000..8f4ed04f1
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/definedName.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/demo.xlsx b/packages/office-viewer/__tests__/xlsx/simple/demo.xlsx
new file mode 100644
index 000000000..af1a745bb
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/demo.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/e.xlsx b/packages/office-viewer/__tests__/xlsx/simple/e.xlsx
new file mode 100644
index 000000000..6d4af8cf8
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/e.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/init.xlsx b/packages/office-viewer/__tests__/xlsx/simple/full.xlsx
similarity index 100%
rename from packages/office-viewer/__tests__/xlsx/simple/init.xlsx
rename to packages/office-viewer/__tests__/xlsx/simple/full.xlsx
diff --git a/packages/office-viewer/__tests__/xlsx/simple/gridline.xlsx b/packages/office-viewer/__tests__/xlsx/simple/gridline.xlsx
new file mode 100644
index 000000000..c4d942a54
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/gridline.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/hidden.xlsx b/packages/office-viewer/__tests__/xlsx/simple/hidden.xlsx
new file mode 100644
index 000000000..ced4a194f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/hidden.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/hide.xlsx b/packages/office-viewer/__tests__/xlsx/simple/hide.xlsx
new file mode 100644
index 000000000..932e7c9c0
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/hide.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/hide_row_col.xlsx b/packages/office-viewer/__tests__/xlsx/simple/hide_row_col.xlsx
new file mode 100644
index 000000000..be8df1470
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/hide_row_col.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/multipleSheet.xlsx b/packages/office-viewer/__tests__/xlsx/simple/multipleSheet.xlsx
new file mode 100644
index 000000000..d3f4f521f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/multipleSheet.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/noHeaderGrid.xlsx b/packages/office-viewer/__tests__/xlsx/simple/noHeaderGrid.xlsx
new file mode 100644
index 000000000..39f471341
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/noHeaderGrid.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/simple/presetCellStyles.xlsx b/packages/office-viewer/__tests__/xlsx/simple/presetCellStyles.xlsx
new file mode 100644
index 000000000..ba208eb31
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/simple/presetCellStyles.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/slow/many_text.xlsx b/packages/office-viewer/__tests__/xlsx/slow/many_text.xlsx
new file mode 100644
index 000000000..de77bfe3a
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/slow/many_text.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/sparklines/sparklines1.xlsx b/packages/office-viewer/__tests__/xlsx/sparklines/sparklines1.xlsx
new file mode 100644
index 000000000..7aaab8797
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/sparklines/sparklines1.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/sparklines/sparklines2.xlsx b/packages/office-viewer/__tests__/xlsx/sparklines/sparklines2.xlsx
new file mode 100644
index 000000000..860e22e36
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/sparklines/sparklines2.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/style/border.xlsx b/packages/office-viewer/__tests__/xlsx/style/border.xlsx
new file mode 100644
index 000000000..47b663ea8
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/style/border.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/style/diag_border.xlsx b/packages/office-viewer/__tests__/xlsx/style/diag_border.xlsx
new file mode 100644
index 000000000..391722790
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/style/diag_border.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/table/slicer.xlsx b/packages/office-viewer/__tests__/xlsx/table/slicer.xlsx
new file mode 100644
index 000000000..0b787b2e0
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/table/slicer.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/table/tableFilter.xlsx b/packages/office-viewer/__tests__/xlsx/table/tableFilter.xlsx
new file mode 100644
index 000000000..6ab7b96d6
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/table/tableFilter.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/table/tables.xlsx b/packages/office-viewer/__tests__/xlsx/table/tables.xlsx
new file mode 100644
index 000000000..7af44f4f5
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/table/tables.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/auto_clip.xlsx b/packages/office-viewer/__tests__/xlsx/text/auto_clip.xlsx
new file mode 100644
index 000000000..e6fae29a7
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/auto_clip.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/auto_height.xlsx b/packages/office-viewer/__tests__/xlsx/text/auto_height.xlsx
new file mode 100644
index 000000000..ac54e975b
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/auto_height.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/background.xlsx b/packages/office-viewer/__tests__/xlsx/text/background.xlsx
new file mode 100644
index 000000000..03420102f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/background.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/bottom.xlsx b/packages/office-viewer/__tests__/xlsx/text/bottom.xlsx
new file mode 100644
index 000000000..02f3d2696
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/bottom.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/bug_1.xlsx b/packages/office-viewer/__tests__/xlsx/text/bug_1.xlsx
new file mode 100644
index 000000000..238d1eb1c
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/bug_1.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/cell_indentation.xlsx b/packages/office-viewer/__tests__/xlsx/text/cell_indentation.xlsx
new file mode 100644
index 000000000..3dbfa19bc
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/cell_indentation.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/clip.xlsx b/packages/office-viewer/__tests__/xlsx/text/clip.xlsx
new file mode 100644
index 000000000..fa5d408a8
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/clip.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/fontStyle.xlsx b/packages/office-viewer/__tests__/xlsx/text/fontStyle.xlsx
new file mode 100644
index 000000000..83f1b0b09
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/fontStyle.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/hyperlink.xlsx b/packages/office-viewer/__tests__/xlsx/text/hyperlink.xlsx
new file mode 100644
index 000000000..0cf5201b8
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/hyperlink.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/link.xlsx b/packages/office-viewer/__tests__/xlsx/text/link.xlsx
new file mode 100644
index 000000000..6eaae250f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/link.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/number.xlsx b/packages/office-viewer/__tests__/xlsx/text/number.xlsx
new file mode 100644
index 000000000..3bd0c8669
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/number.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/rich.xlsx b/packages/office-viewer/__tests__/xlsx/text/rich.xlsx
new file mode 100644
index 000000000..2c8ca99d0
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/rich.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/rich_strings.xlsx b/packages/office-viewer/__tests__/xlsx/text/rich_strings.xlsx
new file mode 100644
index 000000000..ba5644c8d
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/rich_strings.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/right_to_left.xlsx b/packages/office-viewer/__tests__/xlsx/text/right_to_left.xlsx
new file mode 100644
index 000000000..5accba67f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/right_to_left.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/sharedString.xlsx b/packages/office-viewer/__tests__/xlsx/text/sharedString.xlsx
new file mode 100644
index 000000000..b77305d61
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/sharedString.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/textFill.xlsx b/packages/office-viewer/__tests__/xlsx/text/textFill.xlsx
new file mode 100644
index 000000000..63cc3f004
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/textFill.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/textRotation.xlsx b/packages/office-viewer/__tests__/xlsx/text/textRotation.xlsx
new file mode 100644
index 000000000..880289ce8
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/textRotation.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/text_indent.xlsx b/packages/office-viewer/__tests__/xlsx/text/text_indent.xlsx
new file mode 100644
index 000000000..e24096a10
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/text_indent.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/text/wrap.xlsx b/packages/office-viewer/__tests__/xlsx/text/wrap.xlsx
new file mode 100644
index 000000000..04bbbb1b8
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/text/wrap.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/textbox/background.xlsx b/packages/office-viewer/__tests__/xlsx/textbox/background.xlsx
new file mode 100644
index 000000000..d424310b3
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/textbox/background.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/textbox/image_group.xlsx b/packages/office-viewer/__tests__/xlsx/textbox/image_group.xlsx
new file mode 100644
index 000000000..8b9678977
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/textbox/image_group.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/textbox/rich.xlsx b/packages/office-viewer/__tests__/xlsx/textbox/rich.xlsx
new file mode 100644
index 000000000..874fbbd63
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/textbox/rich.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/textbox/shape.xlsx b/packages/office-viewer/__tests__/xlsx/textbox/shape.xlsx
new file mode 100644
index 000000000..da5ef21d9
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/textbox/shape.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/textbox/simple.xlsx b/packages/office-viewer/__tests__/xlsx/textbox/simple.xlsx
new file mode 100644
index 000000000..b61a09989
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/textbox/simple.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/textbox/textbox.xlsx b/packages/office-viewer/__tests__/xlsx/textbox/textbox.xlsx
new file mode 100644
index 000000000..d367de24e
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/textbox/textbox.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/autofit.xlsx b/packages/office-viewer/__tests__/xlsx/todo/autofit.xlsx
new file mode 100644
index 000000000..91be1e18a
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/autofit.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/background.xlsx b/packages/office-viewer/__tests__/xlsx/todo/background.xlsx
new file mode 100644
index 000000000..41d677eed
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/background.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/comments.xlsx b/packages/office-viewer/__tests__/xlsx/todo/comments.xlsx
new file mode 100644
index 000000000..1daf2098f
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/comments.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/comments1.xlsx b/packages/office-viewer/__tests__/xlsx/todo/comments1.xlsx
new file mode 100644
index 000000000..ced09b9b6
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/comments1.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/data_validate.xlsx b/packages/office-viewer/__tests__/xlsx/todo/data_validate.xlsx
new file mode 100644
index 000000000..6d7a551d2
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/data_validate.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/defined_name.xlsx b/packages/office-viewer/__tests__/xlsx/todo/defined_name.xlsx
new file mode 100644
index 000000000..a4ddad734
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/defined_name.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/dynamic_arrays.xlsx b/packages/office-viewer/__tests__/xlsx/todo/dynamic_arrays.xlsx
new file mode 100644
index 000000000..54cc47623
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/dynamic_arrays.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/ignore_errors.xlsx b/packages/office-viewer/__tests__/xlsx/todo/ignore_errors.xlsx
new file mode 100644
index 000000000..cf23e06ac
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/ignore_errors.xlsx differ
diff --git a/packages/office-viewer/__tests__/xlsx/todo/protection.xlsx b/packages/office-viewer/__tests__/xlsx/todo/protection.xlsx
new file mode 100644
index 000000000..ad4b26651
Binary files /dev/null and b/packages/office-viewer/__tests__/xlsx/todo/protection.xlsx differ
diff --git a/packages/office-viewer/design/icons.sketch b/packages/office-viewer/design/icons.sketch
new file mode 100644
index 000000000..f2780ce31
Binary files /dev/null and b/packages/office-viewer/design/icons.sketch differ
diff --git a/packages/office-viewer/design/icons/filter.svg b/packages/office-viewer/design/icons/filter.svg
new file mode 100644
index 000000000..8efcd79a8
--- /dev/null
+++ b/packages/office-viewer/design/icons/filter.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/design/icons/filterDown.svg b/packages/office-viewer/design/icons/filterDown.svg
new file mode 100644
index 000000000..bd48e019f
--- /dev/null
+++ b/packages/office-viewer/design/icons/filterDown.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/design/icons/filterUp.svg b/packages/office-viewer/design/icons/filterUp.svg
new file mode 100644
index 000000000..7fab1706f
--- /dev/null
+++ b/packages/office-viewer/design/icons/filterUp.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/design/icons/hasFilter.svg b/packages/office-viewer/design/icons/hasFilter.svg
new file mode 100644
index 000000000..08045ea68
--- /dev/null
+++ b/packages/office-viewer/design/icons/hasFilter.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/design/icons/left.svg b/packages/office-viewer/design/icons/left.svg
new file mode 100644
index 000000000..cec543439
--- /dev/null
+++ b/packages/office-viewer/design/icons/left.svg
@@ -0,0 +1,5 @@
+
diff --git a/packages/office-viewer/design/icons/menu.svg b/packages/office-viewer/design/icons/menu.svg
new file mode 100644
index 000000000..6c16ff3c8
--- /dev/null
+++ b/packages/office-viewer/design/icons/menu.svg
@@ -0,0 +1,5 @@
+
diff --git a/packages/office-viewer/design/icons/plus.svg b/packages/office-viewer/design/icons/plus.svg
new file mode 100644
index 000000000..07e6eafd6
--- /dev/null
+++ b/packages/office-viewer/design/icons/plus.svg
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/design/icons/right.svg b/packages/office-viewer/design/icons/right.svg
new file mode 100644
index 000000000..5bb0bb6be
--- /dev/null
+++ b/packages/office-viewer/design/icons/right.svg
@@ -0,0 +1,5 @@
+
diff --git a/packages/office-viewer/design/icons/sortDown.svg b/packages/office-viewer/design/icons/sortDown.svg
new file mode 100644
index 000000000..50b41272b
--- /dev/null
+++ b/packages/office-viewer/design/icons/sortDown.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/design/icons/sortUP.svg b/packages/office-viewer/design/icons/sortUP.svg
new file mode 100644
index 000000000..09b1c1020
--- /dev/null
+++ b/packages/office-viewer/design/icons/sortUP.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/packages/office-viewer/examples/common.ts b/packages/office-viewer/examples/common.ts
new file mode 100644
index 000000000..8d04f4203
--- /dev/null
+++ b/packages/office-viewer/examples/common.ts
@@ -0,0 +1,133 @@
+import {Excel} from '../src';
+import {OfficeViewer} from '../src/OfficeViewer';
+import {createOfficeViewer} from '../src/createOfficeViewer';
+import XMLPackageParser from '../src/package/XMLPackageParser';
+
+export class App {
+ dir: string;
+ fileLists: Record;
+ viewerElement: HTMLElement;
+ renderOptions: any;
+ initFile: string;
+
+ constructor(
+ dir: string,
+ fileLists: Record,
+ viewerElement: HTMLElement,
+ renderOptions: any
+ ) {
+ this.dir = dir;
+ this.fileLists = fileLists;
+ this.viewerElement = viewerElement;
+ this.renderOptions = renderOptions;
+
+ // 支持临时拖拽文件到页面里显示
+ document.addEventListener('dragover', function (event) {
+ event.preventDefault();
+ });
+
+ document.addEventListener(
+ 'drop',
+ e => {
+ e.preventDefault();
+ let dt = e.dataTransfer!;
+ let files = dt.files;
+ this.renderDrop(files[0]);
+ },
+ false
+ );
+
+ const url = new URL(location.href);
+
+ const initFile = url.searchParams.get('file');
+
+ if (initFile) {
+ this.renderFile(initFile);
+ }
+
+ this.initFile = initFile || '';
+
+ this.renderFileList();
+ }
+
+ renderFileList() {
+ const fileLists = this.fileLists;
+ const fileListElement = document.getElementById('files')!;
+ const html: string[] = ['