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 @@ + + + filter + + + + + + + + + + \ 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 @@ + + + filterDown + + + + + + + + \ 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 @@ + + + filterUp + + + + + + + + \ 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 @@ + + + hasFilter + + + + + + + + \ 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 @@ + + + plus + + + + + + + \ 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 @@ + + + sortDown + + + + + A + + + Z + + + + \ 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 @@ + + + sortUP + + + + + A + + + Z + + + + \ 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[] = [' + + +

+
+ +
+
+
+ + + + + diff --git a/packages/office-viewer/examples/app.ts b/packages/office-viewer/examples/word.ts similarity index 52% rename from packages/office-viewer/examples/app.ts rename to packages/office-viewer/examples/word.ts index eec814332..dec2ef073 100644 --- a/packages/office-viewer/examples/app.ts +++ b/packages/office-viewer/examples/word.ts @@ -1,13 +1,11 @@ /** * 本地测试例子 */ - -import XMLPackageParser from '../src/package/XMLPackageParser'; -import Word from '../src/Word'; +import {App} from './common'; const viewerElement = document.getElementById('viewer') as HTMLElement; -const testDir = '__tests__/docx'; +const testDir = '/__tests__/docx'; const fileLists = { simple: [ @@ -94,28 +92,6 @@ if (page) { location.reload(); }; -/** - * 生成左侧文件列表 - */ - -const fileListElement = document.getElementById('fileList')!; -for (const dirName in fileLists) { - fileListElement.innerHTML += `

${dirName}

`; - const dir = dirName as keyof typeof fileLists; - for (const file of fileLists[dir]) { - const fileName = file.split('.')[0]; - fileListElement.innerHTML += `
${fileName}
`; - } -} - -document.querySelectorAll('.file').forEach(file => { - file.addEventListener('click', elm => { - const fileName = (elm.target as Element).getAttribute('data-path')!; - history.pushState({fileName}, fileName, `?file=${fileName}`); - renderDocx(fileName); - }); -}); - const data = { date: 'amis', list: [ @@ -153,65 +129,4 @@ const renderOptions = { enableVar: true }; -async function renderDocx(fileName: string) { - const filePath = `${testDir}/${fileName}`; - const file = await (await fetch(filePath)).arrayBuffer(); - renderWord(file, fileName); -} - -const url = new URL(location.href); - -const initFile = url.searchParams.get('file'); - -if (initFile) { - renderDocx(initFile); -} - -// 支持临时拖拽文件到页面里显示 -document.addEventListener('dragover', function (event) { - event.preventDefault(); -}); - -document.addEventListener( - 'drop', - e => { - e.preventDefault(); - let dt = e.dataTransfer!; - let files = dt.files; - renderDropWord(files[0]); - }, - false -); - -function renderWord(data: ArrayBuffer, fileName: string) { - let word: Word; - if (fileName.endsWith('.xml')) { - word = new Word(data, renderOptions, new XMLPackageParser()); - } else { - word = new Word(data, renderOptions); - } - const fileNameSplit = fileName.split('/'); - const downloadName = fileNameSplit[fileNameSplit.length - 1].replace( - '.xml', - '.docx' - ); - - (window as any).downloadDocx = () => { - word.download(downloadName); - }; - - (window as any).printDocx = () => { - word.print(); - }; - - word.render(viewerElement); -} - -function renderDropWord(file: File) { - const reader = new FileReader(); - reader.onload = _e => { - const data = reader.result as ArrayBuffer; - renderWord(data, file.name); - }; - reader.readAsArrayBuffer(file); -} +new App(testDir, fileLists, viewerElement, renderOptions); diff --git a/packages/office-viewer/index.html b/packages/office-viewer/index.html index 623ba1c95..1146e7f99 100644 --- a/packages/office-viewer/index.html +++ b/packages/office-viewer/index.html @@ -4,30 +4,15 @@ office viewer - -
-
- - -

- page - -

-
-
-
-
-
- - + diff --git a/packages/office-viewer/package.json b/packages/office-viewer/package.json index d9254991e..34bf5fba0 100644 --- a/packages/office-viewer/package.json +++ b/packages/office-viewer/package.json @@ -1,23 +1,34 @@ { "name": "office-viewer", - "version": "0.2.1", + "version": "0.3.5", "description": "office 文档在线预览", "main": "lib/index.js", "module": "esm/index.js", "types": "lib/index.d.ts", "scripts": { - "dev": "vite", - "start": "vite", - "build": "npm run clean-dist && cross-env NODE_ENV=production rollup -c ", - "build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js", + "dev": "vite --host", + "start": "vite --host", + "build": "npm run clean-dist && cross-env NODE_ENV=production rollup -c && sass scss/office.scss dist/office.css", + "build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js", "test": "jest", "lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c", "update-snapshot": "jest --updateSnapshot", "coverage": "jest --coverage", "declaration": "tsc --project tsconfig-for-declaration.json --allowJs --declaration --emitDeclarationOnly --declarationDir ./lib --rootDir ./src", "clean-dist": "rimraf lib/** esm/**", - "xsd2ts": "cd tools && ts-node --transpileOnly xsd2ts.ts", - "conver-preset": "cd tools && ts-node --transpileOnly converDrawingML.ts" + "xsd2excel": "cd tools && ts-node --transpileOnly xsd2excel.ts", + "xsd2excelExt": "cd tools && ts-node --transpileOnly xsd2excelExt.ts", + "xsd2word": "cd tools && ts-node --transpileOnly xsd2word.ts", + "xsd2dml": "cd tools && ts-node --transpileOnly xsd2dml.ts", + "xsd2chart": "cd tools && ts-node --transpileOnly xsd2chart.ts", + "convertDrawingML": "cd tools && ts-node --transpileOnly convertDrawingML.ts", + "convertPresetTableStyles": "cd tools && ts-node --transpileOnly convertPresetTableStyles.ts", + "convertPresetCellStyles": "cd tools && ts-node --transpileOnly convertPresetCellStyles.ts", + "genPresetIcons": "cd tools && ts-node --transpileOnly genPresetIcons.ts", + "genIcons": "ts-node --transpileOnly tools/genIcons.ts", + "emptyExcel": "ts-node --transpileOnly tools/convertFileToBase64.ts src/excel/io/csv/empty.xlsx src/excel/io/csv/emptyXLSX.ts", + "genExampleFileList": "ts-node --transpileOnly tools/genExampleFileList.ts", + "typecheck": "tsc --noEmit" }, "exports": { ".": { @@ -31,11 +42,15 @@ }, "files": [ "lib", + "dist", "esm" ], "keywords": [ "office", - "docx" + "word", + "excel", + "docx", + "xlsx" ], "license": "Apache 2.0", "bugs": { @@ -43,7 +58,10 @@ }, "homepage": "https://github.com/baidu/amis#readme", "dependencies": { - "fflate": "^0.7.4", + "echarts": "^5.4.0", + "fflate": "^0.8.1", + "numfmt": "^2.5.2", + "papaparse": "^5.4.1", "tslib": "^2.3.1" }, "devDependencies": { @@ -51,15 +69,16 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^14.1.0", "@rollup/plugin-typescript": "^8.3.4", + "@swc/jest": "^0.2.34", "@testing-library/jest-dom": "^5.17.0", "@types/jest": "^28.1.0", "@types/prettier": "^2.7.3", "amis-formula": "^2.7.2", - "fast-xml-parser": "4.1.3", "jest": "^29.0.3", "jest-environment-jsdom": "^29.0.3", "rollup": "^2.60.2", "rollup-plugin-terser": "^7.0.2", + "sass": "^1.69.7", "ts-jest": "^29.0.2", "ts-loader": "^9.2.3", "ts-node": "^10.4.0", @@ -81,17 +100,12 @@ "js" ], "transform": { - "\\.(ts|tsx)$": [ - "ts-jest", - { - "diagnostics": false - } - ] + "^.+\\.(t|j)sx?$": "@swc/jest" }, "setupFiles": [ "jest-canvas-mock" ], - "testRegex": "/.*\\.test\\.(ts|tsx|js)$", + "testRegex": "/.*\\.test\\.(ts|tsx)$", "moduleNameMapper": { "\\.(css|less|sass|scss)$": "/../__mocks__/styleMock.js", "\\.(svg)$": "/../__mocks__/svgMock.js" diff --git a/packages/office-viewer/rollup.config.js b/packages/office-viewer/rollup.config.js index b2589bb79..2601914dc 100644 --- a/packages/office-viewer/rollup.config.js +++ b/packages/office-viewer/rollup.config.js @@ -20,37 +20,27 @@ const external = id => .join('|')})` ).test(id); +function outputFile(fileName, format) { + return { + input: [fileName], + output: [ + { + ...settings, + dir: format === 'cjs' ? path.dirname(main) : path.dirname(module), + format: format, + exports: 'named', + preserveModulesRoot: './src', + preserveModules: true // Keep directory structure and files + } + ], + external: external, + plugins: getPlugins(format) + }; +} + export default [ - { - input: ['./src/index.ts'], - output: [ - { - ...settings, - dir: path.dirname(main), - format: 'cjs', - exports: 'named', - preserveModulesRoot: './src', - preserveModules: true // Keep directory structure and files - } - ], - external: external, - plugins: getPlugins('cjs') - }, - { - input: ['./src/index.ts'], - output: [ - { - ...settings, - dir: path.dirname(module), - format: 'esm', - exports: 'named', - preserveModulesRoot: './src', - preserveModules: true // Keep directory structure and files - } - ], - external: external, - plugins: getPlugins('esm') - } + outputFile('./src/index.ts', 'cjs'), + outputFile('./src/index.ts', 'esm') ]; function getPlugins(format = 'esm') { diff --git a/packages/office-viewer/scss/excel/auto-filter.scss b/packages/office-viewer/scss/excel/auto-filter.scss new file mode 100644 index 000000000..b9240671d --- /dev/null +++ b/packages/office-viewer/scss/excel/auto-filter.scss @@ -0,0 +1,37 @@ +.ov-excel-auto-filter-icon-container { + position: absolute; +} + +.ov-excel-auto-filter-icon { + cursor: pointer; + position: absolute; + right: 2px; + top: 2px; + bottom: 2px; + z-index: $filter-icon-z-index; +} + +.ov-excel-auto-filter-icon svg { + width: 100%; + height: 100%; +} + +.ov-excel-auto-filter-menu { + position: absolute; + display: none; + flex-direction: column; + right: -240px; + width: 240px; + height: 440px; + border-radius: 4px; + box-shadow: rgba(0, 0, 0, 0.133) 0px 3.2px 7.2px 0px, + rgba(0, 0, 0, 0.11) 0px 0.6px 1.8px 0px; + z-index: $filter-menu-z-index; + background-color: white; +} + +@import './auto-filter/sort-state.scss'; + +@import './auto-filter/filters.scss'; + +@import './auto-filter/custom-filters.scss'; diff --git a/packages/office-viewer/scss/excel/auto-filter/custom-filters.scss b/packages/office-viewer/scss/excel/auto-filter/custom-filters.scss new file mode 100644 index 000000000..4746e5dc1 --- /dev/null +++ b/packages/office-viewer/scss/excel/auto-filter/custom-filters.scss @@ -0,0 +1,21 @@ +.ov-excel-auto-filter-menu__custom-filters { + display: flex; + flex-direction: column; + padding: 8px; +} + +/** 单个规则 */ +.ov-excel-auto-filter-menu__custom-filters-item-input { + display: flex; + flex-direction: row; + margin-bottom: 4px; +} + +.ov-excel-auto-filter-menu__custom-filters-item-input > select { + margin-right: 4px; +} + +.ov-excel-auto-filter-menu__custom-filters .excel-radio-wrapper { + margin: 4px 0; + text-align: center; +} diff --git a/packages/office-viewer/scss/excel/auto-filter/filters.scss b/packages/office-viewer/scss/excel/auto-filter/filters.scss new file mode 100644 index 000000000..3e62d5b96 --- /dev/null +++ b/packages/office-viewer/scss/excel/auto-filter/filters.scss @@ -0,0 +1,20 @@ +.ov-excel-auto-filter__menu-filter-filters { + flex-grow: 1; + display: flex; + flex-direction: column; + min-height: 0; +} + +.ov-excel-auto-filter__menu-filter-filters .excel-checkbox-list-wrapper { + display: flex; + flex-grow: 1; + flex-direction: column; + padding: 8px; + min-height: 0; +} + +.ov-excel-auto-filter__menu-filter-filters .excel-checkbox-list { + flex-grow: 1; + overflow-y: auto; + overflow-x: hidden; +} diff --git a/packages/office-viewer/scss/excel/auto-filter/sort-state.scss b/packages/office-viewer/scss/excel/auto-filter/sort-state.scss new file mode 100644 index 000000000..363cebc6e --- /dev/null +++ b/packages/office-viewer/scss/excel/auto-filter/sort-state.scss @@ -0,0 +1,38 @@ +.excel-auto-filter__menu-sort { + display: flex; + flex-direction: row; + column-gap: 4px; + padding: 8px; +} + +.ov-excel-auto-filter__sort-button { + cursor: pointer; + flex: 1; + display: flex; + flex-direction: row; + line-height: 24px; + height: 24px; + padding: 2px; +} + +.ov-excel-auto-filter__sort-button-text { + flex: 1; +} + +.ov-excel-auto-filter__sort-button-icon { + height: 24px; + width: 24px; +} + +.ov-excel-auto-filter__sort-button-icon svg { + height: 100%; + width: 100%; +} + +.ov-excel-auto-filter__sort-button:hover { + background-color: #f5f5f5; +} + +.ov-excel-auto-filter__sort-button-active { + background-color: #f5f5f5; +} diff --git a/packages/office-viewer/scss/excel/button.scss b/packages/office-viewer/scss/excel/button.scss new file mode 100644 index 000000000..96980eae9 --- /dev/null +++ b/packages/office-viewer/scss/excel/button.scss @@ -0,0 +1,22 @@ +.excel-button { + height: 32px; + color: rgb(255, 255, 255); + padding: 0px 11px; + box-sizing: border-box; + border: 1px solid transparent; + display: inline-block; + text-decoration: none; + text-align: center; + cursor: pointer; + vertical-align: top; + border-radius: 2px; + font-size: 14px; + font-weight: 600; + position: relative; + margin-right: 4px; + width: 64px; +} + +.excel-button-primary { + background-color: rgb(0, 120, 212); +} diff --git a/packages/office-viewer/scss/excel/cell-editor.scss b/packages/office-viewer/scss/excel/cell-editor.scss new file mode 100644 index 000000000..87f61d3f1 --- /dev/null +++ b/packages/office-viewer/scss/excel/cell-editor.scss @@ -0,0 +1,3 @@ +.excel-cell-editor { + position: absolute; +} diff --git a/packages/office-viewer/scss/excel/chart.scss b/packages/office-viewer/scss/excel/chart.scss new file mode 100644 index 000000000..4feadcf7b --- /dev/null +++ b/packages/office-viewer/scss/excel/chart.scss @@ -0,0 +1,4 @@ +.excel-chart { + position: absolute; + z-index: $chart-z-index; +} diff --git a/packages/office-viewer/scss/excel/checkbox.scss b/packages/office-viewer/scss/excel/checkbox.scss new file mode 100644 index 000000000..0ec47bf5a --- /dev/null +++ b/packages/office-viewer/scss/excel/checkbox.scss @@ -0,0 +1,21 @@ +.excel-checkbox-list-wrapper .excel-checkbox-list { + margin-top: 4px; +} + +.excel-checkbox-container label { + cursor: pointer; + padding: 4px 0; + display: block; +} + +.excel-checkbox-container label:hover { + background-color: #f6f6f6; +} + +.excel-checkbox-container input { + vertical-align: middle; +} + +.excel-checkbox-container span { + vertical-align: middle; +} diff --git a/packages/office-viewer/scss/excel/content.scss b/packages/office-viewer/scss/excel/content.scss new file mode 100644 index 000000000..6144401b6 --- /dev/null +++ b/packages/office-viewer/scss/excel/content.scss @@ -0,0 +1,23 @@ +/* Excel 内容区域,这个包含表头 */ +.ov-excel-content { + flex: 1; + position: relative; + overflow: hidden; + z-index: $content-z-index; +} + +/** Excel 数据区域,不包含表头,目前这个区域主要是给 drawing 用 */ +.ov-excel-data { + position: absolute; + right: 0; + bottom: 0; + overflow: hidden; + user-select: none; + z-index: $data-z-index; +} + +.ov-excel-canvas { + position: absolute; + left: 0; + top: 0; +} diff --git a/packages/office-viewer/scss/excel/divider.scss b/packages/office-viewer/scss/excel/divider.scss new file mode 100644 index 000000000..03870b0e1 --- /dev/null +++ b/packages/office-viewer/scss/excel/divider.scss @@ -0,0 +1,8 @@ +.excel-divider { + display: block; + height: 1px; + background-color: rgb(225, 223, 221); + margin: 2px 12px 2px; + color: rgb(200, 198, 196); + border-radius: 0.5px; +} diff --git a/packages/office-viewer/scss/excel/excel.scss b/packages/office-viewer/scss/excel/excel.scss new file mode 100644 index 000000000..92102bfa3 --- /dev/null +++ b/packages/office-viewer/scss/excel/excel.scss @@ -0,0 +1,61 @@ +/* 默认 CSS 样式,目前主要是 Excel 使用 */ + +.ov-excel { + /* 从 office 365 中复制的默认字体 */ + font-family: 'Aptos Narrow', 'Segoe UI', 'Segoe UI Web (West European)', + 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', + sans-serif; + display: flex; + flex-direction: column; + --bar-bg-color: #f5f5f5; + --bar-input-bg-color: #ffffff; + --active-sheet-color: #217346; +} + +$content-z-index: 1; +$data-z-index: 2; +$filter-icon-z-index: 3; +$filter-menu-z-index: 4; +$scroll-bar-z-index: 3; +$resize-box-z-index: 4; +$resize-box-control-z-index: 5; +$cell-editor-z-index: 6; + +$chart-z-index: 10; +$pic-z-index: 10; + +$sheet-tab-menu-index: 15; + +$hover-bg-color: #e1dfdd; + +$input-border: 1px solid rgb(209, 209, 209); + +@import './button.scss'; + +@import './toolbar.scss'; + +@import './checkbox.scss'; + +@import './divider.scss'; + +@import './input.scss'; + +@import './select.scss'; + +@import './formula-bar.scss'; + +@import './sheet-tab-bar.scss'; + +@import './content.scss'; + +@import './scroll-bar.scss'; + +@import './resize-box.scss'; + +@import './auto-filter.scss'; + +@import './cell-editor.scss'; + +@import './chart.scss'; + +@import './pic.scss'; diff --git a/packages/office-viewer/scss/excel/formula-bar.scss b/packages/office-viewer/scss/excel/formula-bar.scss new file mode 100644 index 000000000..90f11f9fc --- /dev/null +++ b/packages/office-viewer/scss/excel/formula-bar.scss @@ -0,0 +1,32 @@ +/* Excel 公式栏 */ +.ov-excel-formula-bar { + height: 34px; + display: flex; + flex-direction: row; + background-color: var(--bar-bg-color); +} + +.ov-excel-formula-bar__name-box { + text-align: center; + width: 64px; + margin: 4px 0 4px 4px; + padding: 0 4px; + line-height: 26px; + border: 1px solid #e1dfdd; + background-color: var(--bar-input-bg-color); +} + +/* fx 按钮 */ +.ov-excel-formula-bar__function-button { + width: 30px; +} + +/* fx 按钮右边的输入框 */ +.ov-excel-formula-bar__text-box { + margin: 4px; + line-height: 26px; + border: 1px solid #e1dfdd; + flex: 1; + padding: 0 4px; + background-color: var(--bar-input-bg-color); +} diff --git a/packages/office-viewer/scss/excel/input.scss b/packages/office-viewer/scss/excel/input.scss new file mode 100644 index 000000000..c2f73bb11 --- /dev/null +++ b/packages/office-viewer/scss/excel/input.scss @@ -0,0 +1,20 @@ +.excel-input { + display: inline-block; + box-sizing: border-box; + width: 100%; + border-radius: 4px; + padding: 4px 12px; + border: $input-border; +} + +.excel-input-border-less { + display: block; + border: none; + width: 100%; + height: 100%; + padding: 0 2px; +} + +.excel-input-border-less:focus { + outline: none; +} diff --git a/packages/office-viewer/scss/excel/pic.scss b/packages/office-viewer/scss/excel/pic.scss new file mode 100644 index 000000000..328e45055 --- /dev/null +++ b/packages/office-viewer/scss/excel/pic.scss @@ -0,0 +1,5 @@ +.excel-pic { + position: absolute; + z-index: $pic-z-index; + overflow: hidden; +} diff --git a/packages/office-viewer/scss/excel/resize-box.scss b/packages/office-viewer/scss/excel/resize-box.scss new file mode 100644 index 000000000..f24527b48 --- /dev/null +++ b/packages/office-viewer/scss/excel/resize-box.scss @@ -0,0 +1,19 @@ +/** 缩放的控制界面 */ + +.ov-excel-resize-box { + position: absolute; + border: 1px solid #4af; + z-index: $scroll-bar-z-index; +} + +.ov-excel-resize-box-control { + position: absolute; + width: 14px; + height: 14px; + border-radius: 50%; + border: 2px solid #fff; + box-sizing: border-box; + background: #4af; + border: 2px solid #fff; + z-index: $resize-box-control-z-index; +} diff --git a/packages/office-viewer/scss/excel/scroll-bar.scss b/packages/office-viewer/scss/excel/scroll-bar.scss new file mode 100644 index 000000000..4025afcfa --- /dev/null +++ b/packages/office-viewer/scss/excel/scroll-bar.scss @@ -0,0 +1,24 @@ +.ov-excel-scrollbar-y { + position: absolute; + top: 0; + right: 0; + bottom: 0; + z-index: $scroll-bar-z-index; +} + +.ov-excel-scrollbar-x { + position: absolute; + left: 0; + right: 0; + bottom: 0; + z-index: $scroll-bar-z-index; +} + +.ov-excel-scrollbar-content-x { + overflow-x: auto; + overflow-y: hidden; +} + +.ov-excel-scrollbar-content-y { + overflow-x: hidden; +} diff --git a/packages/office-viewer/scss/excel/select.scss b/packages/office-viewer/scss/excel/select.scss new file mode 100644 index 000000000..3ed6cb755 --- /dev/null +++ b/packages/office-viewer/scss/excel/select.scss @@ -0,0 +1,4 @@ +.excel-select { + border-color: rgb(209, 209, 209); + border-radius: 4px; +} diff --git a/packages/office-viewer/scss/excel/sheet-tab-bar.scss b/packages/office-viewer/scss/excel/sheet-tab-bar.scss new file mode 100644 index 000000000..7370753ef --- /dev/null +++ b/packages/office-viewer/scss/excel/sheet-tab-bar.scss @@ -0,0 +1,34 @@ +/* Excel sheet 标签页 */ +.ov-excel-sheet-tab-bar { + height: 32px; + line-height: 32px; + display: flex; + flex-direction: row; + background-color: var(--bar-bg-color); +} + +@import './sheet-tab/tab-list.scss'; + +.ov-excel-sheet-tab-bar__status { + margin-left: 12px; + margin-right: 12px; +} + +.ov-excel-sheet-tab-bar__status-text { + margin-right: 16px; +} + +.ov-excel-sheet-tab-bar__zoom-level { + display: flex; + flex-direction: row; + padding: 0 8px; +} + +.ov-excel-sheet-tab-bar__zoom-value { + margin: 0 8px; +} + +.ov-excel-sheet-tab-bar__zoom-in, +.ov-excel-sheet-tab-bar__zoom-out { + cursor: pointer; +} diff --git a/packages/office-viewer/scss/excel/sheet-tab/tab-list.scss b/packages/office-viewer/scss/excel/sheet-tab/tab-list.scss new file mode 100644 index 000000000..05441ac0c --- /dev/null +++ b/packages/office-viewer/scss/excel/sheet-tab/tab-list.scss @@ -0,0 +1,145 @@ +.ov-excel-sheet-tab-bar__nav { + display: flex; +} + +.ov-excel-sheet-tab-bar__nav-icon { + height: 16px; + padding: 4px 4px; +} + +.ov-excel-sheet-tab-bar__nav-icon svg { + height: 16px; + width: 16px; +} + +.ov-excel-sheet-tab-bar__nav-icon svg path { + fill: #b1b1b1; +} + +.ov-excel-sheet-tab-bar__nav-icon--enabled { + cursor: pointer; +} + +.ov-excel-sheet-tab-bar__nav-icon--enabled svg path { + fill: #000000; +} + +.ov-excel-sheet-tab-bar__menu { + position: relative; +} + +.ov-excel-sheet-tab-bar__menu-icon { + cursor: pointer; + height: 16px; + padding: 4px 8px; +} + +.ov-excel-sheet-tab-bar__menu-icon svg { + height: 16px; + width: 16px; +} + +.ov-excel-sheet-tab-bar__menu-list { + background-color: #fff; + border-radius: 4px; + border: 1px solid rgb(199, 199, 199); + box-shadow: rgba(0, 0, 0, 0.133) 0px 3.2px 7.2px 0px, + rgba(0, 0, 0, 0.11) 0px 0.6px 1.8px 0px; + display: none; + position: absolute; + bottom: 32px; + left: 0; + max-height: 400px; + overflow-x: hidden; + overflow-y: auto; + z-index: $sheet-tab-menu-index; + user-select: none; +} + +.ov-excel-sheet-tab-bar__menu-list-item { + padding: 4px 8px; + cursor: pointer; + white-space: nowrap; +} + +.ov-excel-sheet-tab-bar__menu-list-item:hover { + background-color: $hover-bg-color; +} + +.ov-excel-sheet-tab-bar__menu-list-item--active { + background-color: $hover-bg-color; +} + +.ov-excel-sheet-tab-bar__list-container { + position: relative; + overflow: hidden; + flex: 1 1 0; + user-select: none; +} + +.ov-excel-sheet-tab-bar__list-container--enable-left-nav::before { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 30px; + background-image: linear-gradient( + to right, + #dcdcdc, + rgba(220, 220, 220, 0.1) + ); +} + +.ov-excel-sheet-tab-bar__list-container--enable-right-nav::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 30px; + background-image: linear-gradient(to left, #dcdcdc, rgba(220, 220, 220, 0.1)); +} + +.ov-excel-sheet-tab-bar__list { + width: 0; + display: flex; + flex-direction: row; +} + +.ov-excel-sheet-tab-bar__list-tab { + display: inline-block; + position: relative; + padding: 0 8px; + font-size: 14px; + margin: 4px 4px; + border-radius: 4px; + line-height: 24px; + + white-space: nowrap; + + &:hover { + cursor: pointer; + background-color: $hover-bg-color; + } +} + +.ov-excel-sheet-tab-bar__list-tab--active { + cursor: default; +} + +.ov-excel-sheet-tab-bar__list-tab--active::before { + content: ''; + position: absolute; + display: inline-block; + top: 0; + bottom: -4px; + left: 0; + right: 0; + color: transparent; + border-bottom: 3px solid var(--active-sheet-color); + padding-bottom: 5px; + width: calc(100% - 18px); + margin: auto; + transition: width 0.4s cubic-bezier(0.17, 0.17, 0, 1) 0s; +} diff --git a/packages/office-viewer/scss/excel/toolbar.scss b/packages/office-viewer/scss/excel/toolbar.scss new file mode 100644 index 000000000..759a2aecb --- /dev/null +++ b/packages/office-viewer/scss/excel/toolbar.scss @@ -0,0 +1,5 @@ +/* Excel 工具栏,目前没编辑功能所以还没实现 */ +.ov-excel-toolbar { + height: 30px; + line-height: 30px; +} diff --git a/packages/office-viewer/scss/office.scss b/packages/office-viewer/scss/office.scss new file mode 100644 index 000000000..710f1a981 --- /dev/null +++ b/packages/office-viewer/scss/office.scss @@ -0,0 +1 @@ +@import "./excel/excel.scss" diff --git a/packages/office-viewer/src/Excel.ts b/packages/office-viewer/src/Excel.ts new file mode 100644 index 000000000..b1d4bf8ec --- /dev/null +++ b/packages/office-viewer/src/Excel.ts @@ -0,0 +1,238 @@ +/** + * Excel 渲染主入口 + */ + +import {OfficeViewer} from './OfficeViewer'; +import {get} from './util/get'; +import {PackageParser} from './package/PackageParser'; +import ZipPackageParser from './package/ZipPackageParser'; +import {ExcelFile} from './excel/types/ExcelFile'; +import {parseExcel} from './excel/io/parseExcel'; +import {ExcelRender} from './excel/render/ExcelRender'; +import {Workbook} from './excel/Workbook'; +import {LocalDataProvider} from './excel/data/LocalDataProvider'; +import {ExcelRenderOptions} from './excel/sheet/ExcelRenderOptions'; +import {printIframe} from './util/print'; +import {emptyXLSX} from './excel/io/csv/emptyXLSX'; +import {arrayBufferToString} from './util/arrayBufferToString'; + +/** + * 默认渲染配置项 + */ +const defaultRenderOptions: ExcelRenderOptions = { + data: {}, + evalVar: (path: string, data: any) => { + return get(data, path); + }, + useWorker: false, + height: 500, + + gridLineColor: '#D4D4D4', + gridLineWidth: 1, + dragGridLineColor: '#5D5D5D', + frozenLineColor: '#00A92F', + gridLineHitRange: 4, + + showRowColHeaders: true, + rowColHeadersColor: '#575757', + rowColHeadersBackgroundColor: '#F5F5F5', + rowColHeadersLineColor: '#E3E2E2', + hiddenRowColHeadersColor: '#575757', + hiddenRowColHeadersLineColor: '#217346', + hiddenRowColHeadersLineSize: 3, + + // 选区的配置 + selectionBorderColor: '#005500', + selectionSquareSize: 4, + selectionBackgroundColor: '#00B683', + selectionBackgroundOpacity: 0.2, + + // 大概 2 个数字的宽度 + indentSize: 15.845, + + backgroundColor: '#F5F5F5', + cellBackgroundColor: '#FFFFFF', + + showFormulaBar: true, + showSheetTabBar: true, + + locale: 'zh-CN', + + // 默认嵌入模式 + embed: true, + + editable: false, + + fontURL: {} +}; + +export default class Excel implements OfficeViewer { + /** + * 全局 id,用于一个页面渲染多个文档 + */ + static globalId = 0; + + /** + * 当前渲染 id + */ + id: number; + + renderOptions: ExcelRenderOptions; + + /** + * 渲染根节点 + */ + rootElement?: HTMLElement; + + /** + * 文件解析器 + */ + parser: PackageParser; + + /** + * 文件内容 + */ + excelFile?: ExcelFile; + + /** + * 渲染实例 + */ + excelRender?: ExcelRender; + + workbook?: Workbook; + + docFile: ArrayBuffer; + + fileName?: string; + + constructor( + docFile: ArrayBuffer, + fileName?: string, + renderOptions?: Partial, + parser: PackageParser = new ZipPackageParser() + ) { + this.id = Excel.globalId++; + this.parser = parser; + this.docFile = docFile; + this.fileName = fileName; + this.updateOptions(renderOptions || {}); + } + + updateOptions(options: any): void { + this.renderOptions = {...defaultRenderOptions, ...options}; + } + + /** + * 加载 Excel 文件 + */ + async loadExcel() { + if (this.loaded) { + return; + } + this.parser.load(this.docFile); + const startParse = performance.now(); + this.excelFile = await parseExcel(this.parser); + if (this.renderOptions.debug) { + console.log('parse time', performance.now() - startParse, 'ms'); + console.log('excelFile', this.excelFile); + } + this.loaded = true; + } + + // 后续优化一下 + loaded = false; + + /** + * 加载 CSV 文件 + */ + async loadCSV(fileExt: 'csv' | 'tsv') { + if (this.loaded) { + return; + } + // 目前 csv 的实现复用了 xlsx 的解析 + this.parser.load(emptyXLSX); + this.excelFile = await parseExcel(this.parser); + const papaparse = await import('papaparse'); + const result = papaparse.parse(arrayBufferToString(this.docFile), { + delimiter: fileExt === 'csv' ? ',' : '\t' + }); + + this.excelFile.workbook.sheets[0].worksheet!.cellData = + result.data as string[][]; + + if (this.fileName) { + this.excelFile.workbook.sheets[0].name = this.fileName.split('/').pop()!; + } + this.loaded = true; + } + + /** + * Excel 渲染入口 + * @param root 渲染根节点 + * @param renderOptionsOverride 临时覆盖某些渲选项 + */ + async render( + root: HTMLElement, + renderOptionsOverride: Partial = {} + ) { + this.rootElement = root; + root.innerHTML = ''; + const renderOptions = {...this.renderOptions, ...renderOptionsOverride}; + root.style.position = 'relative'; + + let {height} = root.getBoundingClientRect(); + if (height === 0) { + height = renderOptions.height!; + root.style.height = height + 'px'; + } + + if (!this.excelFile) { + console.warn('excel file not loaded'); + return; + } + + const workbookData = this.excelFile.workbook; + const workbook = new Workbook( + root, + workbookData, + new LocalDataProvider(workbookData, renderOptions), + renderOptions + ); + + await workbook.render(); + + this.workbook = workbook; + } + + async download(fileName: string) { + throw new Error('must implement this method'); + } + + async print(): Promise { + if (!this.workbook) { + return; + } + const iframe = document.createElement('iframe') as HTMLIFrameElement; + iframe.style.position = 'absolute'; + iframe.style.top = '-10000px'; + document.body.appendChild(iframe); + const printDocument = iframe.contentDocument; + if (!printDocument) { + console.warn('printDocument is null'); + return; + } + this.workbook!.renderInIframe(iframe); + + setTimeout(() => { + iframe.focus(); + printIframe(iframe); + }, this.renderOptions.printWaitTime || 100); // 需要等一下图片渲染 + window.focus(); + } + + getWorkbook() { + return this.workbook; + } + + updateVariable() {} +} diff --git a/packages/office-viewer/src/OfficeViewer.ts b/packages/office-viewer/src/OfficeViewer.ts new file mode 100644 index 000000000..e4244b4c0 --- /dev/null +++ b/packages/office-viewer/src/OfficeViewer.ts @@ -0,0 +1,15 @@ +/** + * 对外统一接口 + */ + +export interface OfficeViewer { + render(root: HTMLElement, options: any): Promise; + + updateOptions(options: any): void; + + download(fileName: string): Promise; + + print(): void; + + updateVariable(): void; +} diff --git a/packages/office-viewer/src/RenderOptions.ts b/packages/office-viewer/src/RenderOptions.ts new file mode 100644 index 000000000..687b99f26 --- /dev/null +++ b/packages/office-viewer/src/RenderOptions.ts @@ -0,0 +1,32 @@ +/** + * 一些通用的渲染配置项 + */ +export interface RenderOptions { + /** + * 是否开启变量替换功能 + */ + enableVar?: boolean; + + /** + * 上下文数据,用于替换变量 + */ + data?: any; + + /** + * 进行表达式计算的函数,第一个参数是文本变量,第二个参数是上下文数据 + */ + evalVar: ( + text: string, + data?: Object + ) => Object | string | number | boolean | null | undefined; + + /** + * 是否开启调试模式 + */ + debug?: boolean; + + /** + * 字体映射,用于替换文档中的字体 + */ + fontMapping?: Record; +} diff --git a/packages/office-viewer/src/UnSupport.ts b/packages/office-viewer/src/UnSupport.ts new file mode 100644 index 000000000..ff38ffa40 --- /dev/null +++ b/packages/office-viewer/src/UnSupport.ts @@ -0,0 +1,26 @@ +import {OfficeViewer} from './OfficeViewer'; + +/** + * 不支持的文件类型,主要用于显示报错信息 + */ +export default class UnSupport implements OfficeViewer { + errorMessage: string; + constructor(errorMessage: string) { + this.errorMessage = errorMessage; + } + updateOptions(options: any): void { + throw new Error('Method not implemented.'); + } + updateVariable(): void { + throw new Error('Method not implemented.'); + } + async render(root: HTMLElement, options: any): Promise { + root.innerHTML = this.errorMessage; + } + download(fileName: string): Promise { + throw new Error('Method not implemented.'); + } + print(): void { + throw new Error('Method not implemented.'); + } +} diff --git a/packages/office-viewer/src/Word.ts b/packages/office-viewer/src/Word.ts index 50551b3aa..69580107d 100644 --- a/packages/office-viewer/src/Word.ts +++ b/packages/office-viewer/src/Word.ts @@ -3,40 +3,42 @@ import {FontTable} from './openxml/word/FontTable'; * 总入口,它将包括所有 word 文档信息,后续渲染的时候依赖它来获取关联信息 */ -import {parseRelationships, Relationship} from './parse/parseRelationship'; +import {parseRelationships, Relationship} from './word/parse/parseRelationship'; import {ContentTypes, parseContentType} from './openxml/ContentType'; import {parseStyles, Styles} from './openxml/Style'; import {parseTheme, Theme} from './openxml/Theme'; -import renderDocument from './render/renderDocument'; +import renderDocument from './word/render/renderDocument'; import {blobToDataURL, downloadBlob} from './util/blob'; import {Numbering} from './openxml/word/numbering/Numbering'; import {appendChild, createElement} from './util/dom'; -import {renderStyle} from './render/renderStyle'; +import {renderStyle} from './word/render/renderStyle'; import {mergeRun} from './util/mergeRun'; import {WDocument} from './openxml/word/WDocument'; import {PackageParser} from './package/PackageParser'; -import {updateVariableText} from './render/renderRun'; +import {updateVariableText} from './word/render/renderRun'; import ZipPackageParser from './package/ZipPackageParser'; import {buildXML} from './util/xml'; import {Paragraph} from './openxml/word/Paragraph'; import {deobfuscate} from './openxml/word/Font'; -import {renderFont} from './render/renderFont'; +import {renderFont} from './word/render/renderFont'; import {replaceT, replaceVar} from './util/replaceVar'; import {Note} from './openxml/word/Note'; -import {parseFootnotes} from './parse/Footnotes'; -import {parseEndnotes} from './parse/parseEndnotes'; -import {renderNotes} from './render/renderNotes'; +import {parseFootnotes} from './word/parse/Footnotes'; +import {parseEndnotes} from './word/parse/parseEndnotes'; +import {renderNotes} from './word/render/renderNotes'; import {Section} from './openxml/word/Section'; import {printIframe} from './util/print'; import {Settings} from './openxml/Settings'; import {get} from './util/get'; import {fileTypeFromBuffer} from './util/fileType'; +import {OfficeViewer} from './OfficeViewer'; +import {RenderOptions} from './RenderOptions'; /** * 渲染配置 */ -export interface WordRenderOptions { +export interface WordRenderOptions extends RenderOptions { /** * css 类前缀 */ @@ -67,34 +69,6 @@ export interface WordRenderOptions { */ minLineHeight?: number; - /** - * 是否开启变量替换功能 - */ - enableVar?: boolean; - - /** - * 上下文数据,用于替换变量 - */ - data?: any; - - /** - * 进行表达式计算的函数,第一个参数是文本变量,第二个参数是上下文数据 - */ - evalVar: ( - text: string, - data?: Object - ) => Object | string | number | boolean | null | undefined; - - /** - * 是否开启调试模式 - */ - debug?: boolean; - - /** - * 字体映射,用于替换文档中的字体 - */ - fontMapping?: Record; - /** * 强制行高,设置之后所有文本都使用这个行高,可以优化排版效果 */ @@ -192,7 +166,7 @@ const defaultRenderOptions: WordRenderOptions = { } }; -export default class Word { +export default class Word implements OfficeViewer { /** * 全局 id,用于一个页面渲染多个 word 文档 */ @@ -211,7 +185,7 @@ export default class Word { /** * 解析 [Content_Types].xml 里的数据 */ - conentTypes: ContentTypes; + contentTypes: ContentTypes; /** * 解析 theme 目录里的数据 @@ -303,11 +277,7 @@ export default class Word { parser.load(docFile); this.id = Word.globalId++; this.parser = parser; - this.renderOptions = {...defaultRenderOptions, ...renderOptions}; - if (this.renderOptions.page) { - this.renderOptions.ignoreHeight = false; - this.renderOptions.ignoreWidth = false; - } + this.updateOptions(renderOptions); } inited = false; @@ -349,11 +319,19 @@ export default class Word { this.inited = true; } + updateOptions(options: any) { + this.renderOptions = {...defaultRenderOptions, ...options}; + if (this.renderOptions.page) { + this.renderOptions.ignoreHeight = false; + this.renderOptions.ignoreWidth = false; + } + } + /** * 解析全局主题配置 */ initTheme() { - for (const override of this.conentTypes.overrides) { + for (const override of this.contentTypes.overrides) { if (override.partName.startsWith('/word/theme')) { const theme = this.parser.getXML(override.partName); this.themes.push(parseTheme(theme)); @@ -365,7 +343,7 @@ export default class Word { * 解析全局样式 */ initStyle() { - for (const override of this.conentTypes.overrides) { + for (const override of this.contentTypes.overrides) { if (override.partName.startsWith('/word/styles.xml')) { this.styles = parseStyles(this, this.parser.getXML('/word/styles.xml')); } @@ -376,7 +354,7 @@ export default class Word { * 解析全局配置 */ initSettings() { - for (const override of this.conentTypes.overrides) { + for (const override of this.contentTypes.overrides) { if (override.partName.startsWith('/word/settings.xml')) { this.settings = Settings.parse( this, @@ -390,7 +368,7 @@ export default class Word { * 解析字体表 */ initFontTable() { - for (const override of this.conentTypes.overrides) { + for (const override of this.contentTypes.overrides) { if (override.partName.startsWith('/word/fontTable.xml')) { this.fontTable = FontTable.fromXML( this, @@ -435,14 +413,14 @@ export default class Word { */ initContentType() { const contentType = this.parser.getXML('[Content_Types].xml'); - this.conentTypes = parseContentType(contentType); + this.contentTypes = parseContentType(contentType); } /** * 解析 numbering */ initNumbering() { - for (const override of this.conentTypes.overrides) { + for (const override of this.contentTypes.overrides) { if (override.partName.startsWith('/word/numbering')) { const numberingData = this.parser.getXML(override.partName); this.numbering = Numbering.fromXML(this, numberingData); @@ -451,7 +429,7 @@ export default class Word { } initNotes() { - for (const override of this.conentTypes.overrides) { + for (const override of this.contentTypes.overrides) { if (override.partName.startsWith('/word/footnotes.xml')) { const notesData = this.parser.getXML(override.partName); this.footNotes = parseFootnotes(this, notesData); diff --git a/packages/office-viewer/src/common/__tests__/autoParse.test.ts b/packages/office-viewer/src/common/__tests__/autoParse.test.ts new file mode 100644 index 000000000..97cfbdaf3 --- /dev/null +++ b/packages/office-viewer/src/common/__tests__/autoParse.test.ts @@ -0,0 +1,24 @@ +import {CT_Marker_Attributes} from '../../openxml/ExcelTypes'; +import {xml2json} from '../../util/xml'; +import {autoParse} from '../autoParse'; + +test('from', async () => { + const fromNode = await xml2json( + ` + + 0 + 0 + 6 + 0 + ` + ); + + const from = autoParse(fromNode, CT_Marker_Attributes); + + expect(from).toEqual({ + col: [0], + colOff: ['0'], + row: [6], + rowOff: ['0'] + }); +}); diff --git a/packages/office-viewer/src/common/autoParse.ts b/packages/office-viewer/src/common/autoParse.ts new file mode 100644 index 000000000..df41c73fc --- /dev/null +++ b/packages/office-viewer/src/common/autoParse.ts @@ -0,0 +1,162 @@ +import {ANY_KEY, Attributes} from '../openxml/Attributes'; +import {normalizeBoolean} from '../OpenXML'; +import {XMLNode} from '../util/xml'; + +/** + * 目前不支持这两种 name space + */ +function removeNamespace(tag: string) { + return tag.replace('a:', '').replace('xdr:', '').replace('c:', ''); +} + +/** + * 通用属性解析 + * @param node xml 节点 + * @param attributes 属性定义 + * @param fillDefault 是否补上默认值 + */ + +export function autoParse( + node: XMLNode | null, + attributes: Attributes, + fillDefault = false +) { + const result: any = {}; + const attrs = node?.attrs || {}; + for (const key in attrs) { + const resultKey = removeNamespace(key); + if (resultKey in attributes) { + const attribute = attributes[resultKey]; + const value = attrs[key]; + if (attribute.type === 'int') { + result[resultKey] = parseInt(value, 10); + } else if (attribute.type === 'double') { + result[resultKey] = parseFloat(value); + } else if (attribute.type === 'boolean') { + result[resultKey] = normalizeBoolean( + value, + attribute.defaultValue as boolean + ); + } else if (attribute.type === 'string') { + result[resultKey] = value; + } + } else { + result[resultKey] = attrs[key]; + if (key.startsWith('xmlns') || key.startsWith('mc:Ignorable')) { + continue; + } + // xr: 先不处理 + if ( + result[resultKey] === undefined && + !( + key.startsWith('xr:') || + key === 'xr3:uid' || + key === 'xr2:uid' || + key === 'x14ac:dyDescent' + ) + ) { + console.log( + `parseAttributes: ${node?.tag}'s attribute: ${key} is not supported` + ); + } + } + } + // 补上默认值 + if (fillDefault) { + for (const key in attributes) { + const attribute = attributes[key]; + if (attribute.defaultValue !== undefined && result[key] === undefined) { + result[key] = attribute.defaultValue; + } + } + } + + // 自定义类型 + for (const attributeKey in attributes) { + const attribute = attributes[attributeKey]; + if (attribute.type === 'child') { + for (const child of node?.children || []) { + let tag = removeNamespace(child.tag); + if (tag === attributeKey) { + const childElement = autoParse(child, attribute.childAttributes!); + if (attribute.childIsArray) { + if (Array.isArray(result[attributeKey])) { + result[attributeKey].push(childElement); + } else { + result[attributeKey] = [childElement]; + } + } else { + result[attributeKey] = childElement; + } + } + } + } else if (attribute.childIsArray) { + // 这种情况是用子节点当成数组,比如 CT_CfRule 里的 formula + const type = attribute.type; + if ( + type === 'string' || + type === 'int' || + type === 'double' || + type === 'boolean' || + type === 'child-string' || + type === 'child-int' + ) { + const childArray = node?.children || []; + const resultArray = childArray + .map(child => { + let tag = removeNamespace(child.tag); + const text = child.text || ''; + if (type === 'int') { + return parseInt(text, 10); + } + if (type === 'double') { + return parseFloat(text); + } + if (type === 'boolean') { + return normalizeBoolean(text, false); + } + if (type === 'child-string') { + if (tag === attributeKey) { + return text; + } else { + return undefined; + } + } + if (type === 'child-int') { + if (tag === attributeKey) { + return parseInt(text, 10); + } else { + return undefined; + } + } + + return text; + }) + .filter(function (element) { + return element !== undefined; + }); + result[attributeKey] = resultArray; + } else { + console.log('unsupported attribute array type', type); + } + } else if (attribute.type === 'child-string') { + for (const child of node?.children || []) { + let tag = removeNamespace(child.tag); + if (tag === attributeKey) { + result[tag] = child.text; + } + } + } else if (attribute.type === 'child-int') { + for (const child of node?.children || []) { + let tag = removeNamespace(child.tag); + if (tag === attributeKey) { + result[tag] = parseInt(child.text || '0', 10); + } + } + } else if (attribute.type === 'any') { + result[ANY_KEY] = node?.children || []; + } + } + + return result; +} diff --git a/packages/office-viewer/src/common/parseAttributes.ts b/packages/office-viewer/src/common/parseAttributes.ts new file mode 100644 index 000000000..3db29bcf7 --- /dev/null +++ b/packages/office-viewer/src/common/parseAttributes.ts @@ -0,0 +1,19 @@ +import {Attributes} from '../openxml/Attributes'; + +import {XMLNode} from '../util/xml'; +import {autoParse} from './autoParse'; + +/** + * 解析子节点的属性 + */ +export function parseChildrenAttributes( + node: XMLNode | null, + attributes: Attributes, + fillDefault = false +) { + const result: any = []; + for (const child of node?.children || []) { + result.push(autoParse(child, attributes, fillDefault)); + } + return result; +} diff --git a/packages/office-viewer/src/common/parseChildren.ts b/packages/office-viewer/src/common/parseChildren.ts new file mode 100644 index 000000000..6e90221f1 --- /dev/null +++ b/packages/office-viewer/src/common/parseChildren.ts @@ -0,0 +1,15 @@ +import {XMLNode} from '../util/xml'; + +/** + * 用于子节点只有一种的情况,调用函数来解析为数组格式 + * @param node 节点 + * @param parse 解析函数 + * @returns 解析结果数组 + */ +export function parseChildren(node: XMLNode, parse: (node: XMLNode) => any) { + const result = []; + for (const child of node.children || []) { + result.push(parse(child)); + } + return result; +} diff --git a/packages/office-viewer/src/common/parseContentType.ts b/packages/office-viewer/src/common/parseContentType.ts new file mode 100644 index 000000000..6c6b19087 --- /dev/null +++ b/packages/office-viewer/src/common/parseContentType.ts @@ -0,0 +1,31 @@ +import {xml2json} from '../util/xml'; +import {ContentTypes} from '../openxml/ContentType'; +import {PackageParser} from '../package/PackageParser'; + +/** + * 解析 [Content_Types].xml + * @param xml + */ +export async function parseContentType( + parser: PackageParser +): Promise { + const xml = parser.getString('[Content_Types].xml'); + const contentType: ContentTypes = {overrides: [], defaults: []}; + const node = await xml2json(xml); + + for (const child of node.children || []) { + if (child.tag === 'Override') { + contentType.overrides.push({ + partName: child.attrs.PartName, + contentType: child.attrs.ContentType + }); + } else if (child.tag === 'Default') { + contentType.defaults.push({ + extension: child.attrs.Extension, + contentType: child.attrs.ContentType + }); + } + } + + return contentType; +} diff --git a/packages/office-viewer/src/common/parseRelationship.ts b/packages/office-viewer/src/common/parseRelationship.ts new file mode 100644 index 000000000..0f822eec5 --- /dev/null +++ b/packages/office-viewer/src/common/parseRelationship.ts @@ -0,0 +1,25 @@ +/** + * 解析 relationship 的 xml 文件 + */ + +import {IRelationship} from '../excel/types/IRelationship'; +import {xml2json} from '../util/xml'; + +export async function parseRelationship(xml: string) { + const relationships: IRelationship[] = []; + if (xml) { + const node = await xml2json(xml); + for (const child of node.children || []) { + if (child.tag === 'Relationship') { + relationships.push({ + id: child.attrs.Id, + target: child.attrs.Target, + targetMode: child.attrs.TargetMode, + type: child.attrs.Type + }); + } + } + return relationships; + } + return []; +} diff --git a/packages/office-viewer/src/createOfficeViewer.ts b/packages/office-viewer/src/createOfficeViewer.ts new file mode 100644 index 000000000..66e673c02 --- /dev/null +++ b/packages/office-viewer/src/createOfficeViewer.ts @@ -0,0 +1,82 @@ +/** + * 统一对外接口,自动识别文件类型后渲染 + */ + +import Excel from './Excel'; +import {RenderOptions} from './RenderOptions'; +import UnSupport from './UnSupport'; +import Word from './Word'; +import {parseContentType} from './openxml/ContentType'; +import {PackageParser} from './package/PackageParser'; +import ZipPackageParser from './package/ZipPackageParser'; +import {fileTypeFromArrayBuffer, fileTypeFromBuffer} from './util/fileType'; + +/** + * 创建 OfficeViewer 实例的工厂函数,会自动识别文件类型 + * @param docFile 文件内容,可以是 ArrayBuffer 或者 url 地址 + * @param renderOptions 渲染配置项,根据不同的文件类型,配置项不同 + * @param parser 文件解析器,支持 zip 和 xml 两种,也可以扩展 + * @returns OfficeViewer 实例 + */ +export async function createOfficeViewer( + docFile: ArrayBuffer, + renderOptions?: Partial, + fileName?: string, + parser: PackageParser = new ZipPackageParser() +) { + if (fileName) { + const fileExt = fileName.split('.').pop(); + if (fileExt === 'csv' || fileExt === 'tsv') { + const excel = new Excel(docFile, fileName, renderOptions, parser); + await excel.loadCSV(fileExt); + return excel; + } + } + + const fileType = fileTypeFromArrayBuffer(docFile); + + if (fileType === null || fileType.ext !== 'zip') { + if (fileType?.ext === 'cfb') { + return new UnSupport('不支持加密文件'); + } + return new UnSupport('不支持的文件类型: ' + fileType?.ext); + } + + try { + parser.load(docFile); + } catch (error) { + return new UnSupport('文件解析失败'); + } + + let isWord = false; + let isExcel = false; + // 有些程序生成的文件没有这个,兼容一下 + if (parser.fileExists('[Content_Types].xml')) { + const contentTypes = parseContentType(parser.getXML('[Content_Types].xml')); + + for (const item of contentTypes.overrides) { + if (item.contentType.indexOf('wordprocessingml') != -1) { + isWord = true; + break; + } else if (item.contentType.indexOf('spreadsheetml') !== -1) { + isExcel = true; + break; + } + } + } else { + if (fileName?.endsWith('.xlsx')) { + isExcel = true; + } else if (fileName?.endsWith('.docx')) { + isWord = true; + } + } + + if (isWord) { + return new Word(docFile, renderOptions, parser); + } else if (isExcel) { + const excel = new Excel(docFile, fileName, renderOptions, parser); + return excel; + } else { + throw new Error('not support file type'); + } +} diff --git a/packages/office-viewer/src/excel/StyleSheet.ts b/packages/office-viewer/src/excel/StyleSheet.ts new file mode 100644 index 000000000..8c7337395 --- /dev/null +++ b/packages/office-viewer/src/excel/StyleSheet.ts @@ -0,0 +1,13 @@ +/** + * Style 相关的操作 + */ + +import {IDataProvider} from './types/IDataProvider'; + +export class StyleSheet { + dataProvider: IDataProvider; + + constructor(dataProvider: IDataProvider) { + this.dataProvider = dataProvider; + } +} diff --git a/packages/office-viewer/src/excel/Workbook.ts b/packages/office-viewer/src/excel/Workbook.ts new file mode 100644 index 000000000..31bd254a0 --- /dev/null +++ b/packages/office-viewer/src/excel/Workbook.ts @@ -0,0 +1,380 @@ +/** + * 这个类作为主要入口,包含运行时数据及相关操作 + */ + +import type {ExcelRenderOptions} from './sheet/ExcelRenderOptions'; +import {EventEmitter} from '../util/EventEmitter'; +import {StyleSheet} from './StyleSheet'; +import {ExcelRender} from './render/ExcelRender'; +import {Sheet} from './sheet/Sheet'; +import {IDataProvider} from './types/IDataProvider'; +import {SheetSelection} from './render/selection/SheetSelection'; +import {Scroll} from './render/scroll/Scroll'; +import {handleKeydown} from './render/keyboard/handleKeydown'; +import {handlePaste} from './render/keyboard/handlePaste'; +import {FormulaBar} from './render/formulaBar/FormulaBar'; +import {SheetTabBar} from './render/sheetTab/SheetTabBar'; +import {H} from '../util/H'; +import {IWorkbook} from './types/IWorkbook'; +import {EnKeys} from './lang/en_US'; +import {getTranslate} from './lang/lang'; +import {RangeRef} from './types/RangeRef'; +import {MAX_COL, MAX_ROW} from './render/Consts'; +import {rangeToHTML} from './render/selection/buildHTML/rangeToHTML'; +import {printIframe} from '../util/print'; +import {renderInIframe} from './print/renderInIframe'; + +export class Workbook { + /** + * 总容器 + */ + container: HTMLElement; + + /** + * 顶部公式栏容器 + */ + formulaBarContainer?: HTMLElement; + + /** + * 内容容器,包括表头 + */ + contentContainer?: HTMLElement; + + /** + * 数据容器,不包括表头 + */ + dataContainer?: HTMLElement; + + /** + * 底部 sheet 页签容器 + */ + sheetTabBarContainer?: HTMLElement; + + workbookData: IWorkbook; + + /** + * 数据提供者 + */ + dataProvider: IDataProvider; + + /** + * 当前工作表 + */ + private currentSheet?: Sheet; + + /** + * 所有的工作表 + */ + sheets: Sheet[] = []; + + /** + * 样式表 + */ + styleSheet: StyleSheet; + + /** + * 渲染配置项 + */ + renderOptions: ExcelRenderOptions; + + /** + * 公式栏 + */ + formulaBar: FormulaBar; + + /** + * 渲染实例 + */ + excelRender: ExcelRender; + + /** + * 底部 sheet 页签 + */ + sheetTabBar: SheetTabBar; + + translator: (key: EnKeys) => string; + + /** + * UI 交互事件监听,主要是和数据无关的变化 + */ + uiEvent = new EventEmitter<{ + /** + * 水平滚动 + */ + SCROLL_X: (x: number) => void; + + /** + * 垂直滚动 + */ + SCROLL_Y: (y: number) => void; + + /** + * 滚动后触发 + */ + AFTER_SCROLL: (scroll: Scroll) => void; + + /** + * 切换 sheet + */ + SWITCH_SHEET: (sheet: Sheet) => void; + + /** + * 选区变化 + */ + CHANGE_SELECTION: (selection: SheetSelection) => void; + + /** + * 拖动行网格线过程中 + */ + DRAG_ROW_GRID_LINE: (y: number) => void; + + /** + * 拖动列网格线过程中 + */ + DRAG_COL_GRID_LINE: (x: number) => void; + + /** + * 拖动列网格线结束 + */ + DRAG_COL_GRID_LINE_END: (col: number, width: number) => void; + + /** + * 拖动行网格线结束 + */ + DRAG_ROW_GRID_LINE_END: (row: number, height: number) => void; + + /** + * 改变缩放等级 + */ + CHANGE_ZOOM_LEVEL: (zoomLevel: number) => void; + + /** + * 复制选区 + */ + COPY_SELECTION: () => void; + + /** + * 应用自动过滤 + */ + APPLY_AUTO_FILTER: (sheetIndex: number) => void; + + /** + * 范围内的数据更新 + */ + UPDATE_RANGE: (sheetIndex: number, rangeRef: RangeRef) => void; + + UPDATE_ROW_HEIGHT: (row: number, height: number) => void; + + UPDATE_COL_WIDTH: (col: number, width: number) => void; + }>(); + + constructor( + container: HTMLElement, + workbookData: IWorkbook, + dataProvider: IDataProvider, + renderOptions: ExcelRenderOptions, + sheetName?: string + ) { + this.renderOptions = renderOptions; + this.container = container; + this.dataProvider = dataProvider; + dataProvider.getSheets().forEach((sheetData, index) => { + this.sheets.push( + new Sheet(index, dataProvider, sheetData, this, renderOptions) + ); + }); + + this.workbookData = workbookData; + + this.initActiveSheet(); + + this.initDom(container); + + // 公式栏 + this.formulaBar = new FormulaBar( + this.formulaBarContainer!, + this, + renderOptions + ); + + this.styleSheet = new StyleSheet(dataProvider); + this.excelRender = new ExcelRender( + this.contentContainer!, + this.dataContainer!, + this, + dataProvider, + renderOptions + ); + + // 底部 sheet 切换 + this.sheetTabBar = new SheetTabBar( + this.sheetTabBarContainer!, + this, + renderOptions + ); + + this.handleKeydown = this.handleKeydown.bind(this); + document.addEventListener('keydown', this.handleKeydown); + this.handlePaste = this.handlePaste.bind(this); + document.addEventListener('paste', this.handlePaste); + + this.translator = getTranslate(this.renderOptions.locale); + } + + initActiveSheet() { + let activeTabIndex = 0; + if (this.workbookData.workbookView?.activeTab) { + activeTabIndex = this.workbookData.workbookView.activeTab; + } + this.currentSheet = this.sheets[activeTabIndex]; + } + + /** + * 初始化 dom 结构,这个要先运行才能保证后面 Canvas 能正确拿到高宽 + */ + initDom(container: HTMLElement) { + // 清空容器 + container.innerHTML = ''; + container.classList.add('ov-excel'); + + if (this.renderOptions.showFormulaBar) { + this.formulaBarContainer = H('div', { + className: 'ov-excel-formula-bar', + parent: container + }); + } + + this.contentContainer = H('div', { + className: 'ov-excel-content', + parent: container + }); + + this.dataContainer = H('div', { + className: 'ov-excel-data', + parent: this.contentContainer + }); + + if (this.renderOptions.showSheetTabBar) { + this.sheetTabBarContainer = H('div', { + className: 'ov-excel-sheet-tab-bar', + parent: container + }); + } + } + + /** + * 销毁 + */ + destroy() { + document.removeEventListener('keydown', this.handleKeydown); + } + + handleKeydown(e: KeyboardEvent) { + handleKeydown(e, this); + } + + handlePaste(e: ClipboardEvent) { + handlePaste(e, this); + } + + /** + * 初始渲染 + */ + render() { + this.excelRender.draw(); + } + + /** + * 设置当前显示的 sheet + */ + setActiveSheet(sheetName?: string) { + if (!sheetName) { + this.currentSheet = this.sheets[0]; + this.uiEvent.emit('SWITCH_SHEET', this.currentSheet); + } else { + for (const sheet of this.sheets) { + if (sheet.getSheetName() === sheetName && this.currentSheet !== sheet) { + this.currentSheet = sheet; + this.uiEvent.emit('SWITCH_SHEET', this.currentSheet); + break; + } + } + if (!this.currentSheet) { + console.warn( + `Workbook 中没有找到 ${sheetName} 对应的 sheet,所以使用第一个 sheet` + ); + } + } + } + + /** + * 获取当前的 sheet + */ + getActiveSheet() { + return this.currentSheet!; + } + + /** + * 查找对应的 sheet + */ + getSheetByName(sheet: string) { + for (const s of this.sheets) { + if (s.getSheetName() === sheet) { + return s; + } + } + return null; + } + + /** + * 获取样式表 + */ + getStyleSheet() { + return this.styleSheet; + } + + /** + * 获取可视区域大小 + */ + getViewpointSize() { + const {width, height} = this.contentContainer!.getBoundingClientRect(); + const currentSheet = this.currentSheet; + const zoom = currentSheet!.getZoomLevel(); + return { + width: width / zoom, + height: height / zoom + }; + } + + getDataProvider() { + return this.dataProvider; + } + + is1904() { + return this.dataProvider.is1904(); + } + + getContainer() { + return this.container; + } + + getDataContainer() { + return this.dataContainer!; + } + + updateDataContainerSize(rowHeaderWidth: number, colHeaderHeight: number) { + this.dataContainer!.style.left = `${rowHeaderWidth}px`; + this.dataContainer!.style.top = `${colHeaderHeight}px`; + } + + getWorkbookData() { + return this.workbookData; + } + + /** + * 在 iframe 中打印 + */ + renderInIframe(iframe: HTMLIFrameElement) { + renderInIframe(iframe, this); + } +} diff --git a/packages/office-viewer/src/excel/data/LocalDataProvider.ts b/packages/office-viewer/src/excel/data/LocalDataProvider.ts new file mode 100644 index 000000000..ff276c712 --- /dev/null +++ b/packages/office-viewer/src/excel/data/LocalDataProvider.ts @@ -0,0 +1,787 @@ +/** + * 本地数据,这个主要用于不远程协作的情况 + */ + +import { + CT_Border, + CT_CellAlignment, + CT_Color, + CT_Fill, + CT_Font +} from '../../openxml/ExcelTypes'; +import {pt2px} from '../../util/ptToPx'; +import {baseColWidth2px, colWidth2px, px2colWidth} from '../sheet/ColWidth'; +import {IDataProvider} from '../types/IDataProvider'; +import {FontSize} from '../types/FontSize'; +import {FontStyle} from '../types/FontStyle'; +import {CellInfo} from '../types/CellInfo'; +import {IWorkbook} from '../types/IWorkbook'; +import {CellData, hasValue} from '../types/worksheet/CellData'; +import defaultFont from './defaultFont'; +// @ts-ignore 这个没类型定义 +import numfmt from 'numfmt'; +import type {ExcelRenderOptions} from '../sheet/ExcelRenderOptions'; +import BuiltInNumFmt from '../sheet/BuiltInNumFmt'; +import {rgbTint} from '../../util/color'; +import {AUTO_COLOR, DEFAULT_FONT_SIZE, MAX_ROW} from '../render/Consts'; +import {measureTextWithCache} from '../render/cell/measureTextWithCache'; +import {genFontStr} from '../render/cell/genFontStr'; +import {IndexedColors} from '../render/IndexedColors'; +import {PresetColorMap} from '../../openxml/colorNameMap'; +import {HiddenRange} from '../sheet/getViewRange'; +import {ISheet} from '../types/ISheet'; +import {IDrawing} from '../types/IDrawing'; +import {RangeRef} from '../types/RangeRef'; +import {CellValue} from '../types/CellValue'; +import {applyAutoFilter} from './applyAutoFilter'; +import {fromExcelDate} from '../io/excel/util/fromExcelDate'; +import {getChineseDay} from '../../util/getChineseDay'; +import {numfmtExtend} from './numfmtExtend'; +import {getThemeColor} from './getThemeColor'; +import {emuToPx} from '../../util/emuToPx'; +import {getAbsoluteAnchorPosition} from '../render/drawing/getAbsoluteAnchorPosition'; +import {sortByRange} from './autoFilter/sortByRange'; +import {px2pt} from '../../util/px2pt'; + +export class LocalDataProvider implements IDataProvider { + /** + * 工作簿,包含所有数据定义 + */ + workbook: IWorkbook; + + renderOptions: ExcelRenderOptions; + + /** + * numfmt 实例,用于提升性能 + */ + numfmtInstances: any[] = []; + + defaultFont: CT_Font; + + defaultFontStyle: FontStyle; + + constructor(workbook: IWorkbook, renderOptions: ExcelRenderOptions) { + this.workbook = workbook; + this.renderOptions = renderOptions; + this.initNumfmt(); + this.defaultFont = this.getDefaultFont(); + this.defaultFontStyle = this.getFontStyle(this.defaultFont); + this.applyFilter(); + } + + /** + * 初始化 numfmt 实例 + */ + private initNumfmt() { + const locale = this.renderOptions.locale; + BuiltInNumFmt.forEach((numFmt, index) => { + const instance = numfmt(numFmt, { + locale + }); + this.numfmtInstances[index] = instance; + }); + for (const numFmt of this.workbook.styleSheet?.numFmts?.numFmt || []) { + let instance; + try { + // 不知为啥还有 aaaa 这种写法,在稻壳里比较常见 + instance = numfmt( + numFmt.formatCode?.replace('aaaa', 'dddd').replace('aaa', 'ddd'), + { + locale + } + ); + } catch (error) { + console.warn('numfmt error', error); + instance = numfmtExtend(numFmt.formatCode); + } + const numFmtId = numFmt.numFmtId || 0; + this.numfmtInstances[numFmtId] = instance; + } + } + + /** + * 应用自动过滤 + */ + applyFilter() { + for (const [sheetIndex, sheet] of this.workbook.sheets.entries()) { + // sheet 本身的 autoFilter 配置 + if (sheet.worksheet?.autoFilter) { + const autoFilter = sheet.worksheet.autoFilter; + applyAutoFilter(sheetIndex, this.workbook, sheet, this, autoFilter); + } + + // 应用表格中的自动过滤 + for (const tableParts of sheet.worksheet?.tableParts || []) { + if (tableParts.autoFilter) { + const headerRowCount = tableParts.headerRowCount || 1; + applyAutoFilter( + sheetIndex, + this.workbook, + sheet, + this, + tableParts.autoFilter, + headerRowCount + ); + } + } + } + } + + getSheets() { + return this.workbook.sheets; + } + + /** + * 获取指定行的数据 + * @param sheetName 表名 + * @param row + */ + getSheetRowData(sheetIndex: number, row: number): CellData[] { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const rowData = sheet.worksheet?.cellData[row] || []; + return rowData; + } + return []; + } + + getCellData( + sheetIndex: number, + row: number, + col: number + ): CellData | undefined { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + return sheet.worksheet?.cellData[row]?.[col] || undefined; + } + return undefined; + } + + /** + * 更新单元格数据 + */ + updateCellData(sheetIndex: number, row: number, col: number, data: CellData) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet && sheet.worksheet) { + if (!sheet.worksheet.cellData[row]) { + sheet.worksheet.cellData[row] = []; + } + sheet.worksheet.cellData[row][col] = data; + } + } + + /** + * 获取指定行高 + * TODO: 加缓存 + * @param sheetIndex + * @param rowIndex + * @returns px 为单位的行高 + */ + getRowHeight(sheetIndex: number, rowIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const row = sheet.worksheet?.rows[rowIndex]; + if (row?.hidden) { + return 0; + } + let rowHeight = row?.ht; + if (!rowHeight) { + rowHeight = sheet.worksheet?.sheetFormatPr?.defaultRowHeight || 16; + } + return pt2px(rowHeight); + } + return 0; + } + + setRowHeight(sheetIndex: number, row: number, height: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet && sheet.worksheet) { + if (!sheet.worksheet?.rows[row]) { + sheet.worksheet.rows[row] = {}; + } + sheet.worksheet.rows[row].ht = px2pt(height); + } + } + + /** + * 这个行是否隐藏 + */ + isRowHidden(sheetIndex: number, rowIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const row = sheet.worksheet?.rows[rowIndex]; + if (row?.hidden) { + return true; + } + } + return false; + } + + /** + * 获取隐藏的列 + * @param sheetIndex + * @returns + */ + getColHiddenRange(sheetIndex: number): HiddenRange[] { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const cols = sheet.worksheet?.cols || []; + const ranges: HiddenRange[] = []; + for (const col of cols) { + if (col && col.hidden) { + ranges.push({min: col.min || 0, max: col.max || 0}); + } + } + return ranges; + } + return []; + } + + /** + * 这个列是否隐藏 + */ + isColHidden(sheetIndex: number, colIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const cols = sheet.worksheet?.cols || []; + for (const col of cols) { + if (col && col.hidden) { + if (colIndex >= (col.min || 0) && colIndex <= (col.max || 0)) { + return true; + } + } + } + } + return false; + } + + /** + * 获取指定列宽,这个一开始就能确定 + * @param sheetIndex + * @param colIndex + * @returns px 为单位的列宽 + */ + getColWidth(sheetIndex: number, colIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const cols = sheet.worksheet?.cols || []; + for (const [index, col] of cols.entries()) { + if (!col) { + continue; + } + const min = col.min ?? index; + const max = col.max ?? index; + if (colIndex >= min && colIndex <= max) { + if (col.hidden) { + return 0; + } + + const colWidth = col.width; + if (colWidth) { + if (colWidth === 0) { + return 0; + } + const defaultFontSize = this.getDefaultFontSize(); + return colWidth2px(colWidth, defaultFontSize.width); + } + + return this.getDefaultWidth(sheet); + } + } + return this.getDefaultWidth(sheet); + } + // 默认必须有个值,不然可能导致死循环 + return 71.73828125; + } + + setColWidth(sheetIndex: number, col: number, width: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet && sheet.worksheet) { + if (!sheet.worksheet?.cols[col]) { + sheet.worksheet.cols[col] = {}; + } + const defaultFontSize = this.getDefaultFontSize(); + sheet.worksheet.cols[col].width = px2colWidth( + width, + defaultFontSize.width + ); + } + } + + private getDefaultWidth(sheet: ISheet) { + let defaultColWidth = sheet.worksheet?.sheetFormatPr?.defaultColWidth; + + if (!defaultColWidth) { + const defaultFontSize = this.getDefaultFontSize(); + // 虽然 xsd 里的默认值是 8,但用 Excel 生成的默认值是 10,所以用 10 作为默认值 + const baseColWidth = sheet.worksheet?.sheetFormatPr?.baseColWidth || 10; + return baseColWidth2px(baseColWidth, defaultFontSize.width); + } + + return defaultColWidth * 8; + } + + getMaxRow(sheetIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const cellData = sheet.worksheet?.cellData || []; + return cellData.length; + } + return 0; + } + + sheetTotalHeightCache: Map = new Map(); + + /** + * 获取表的中数据高度,这个可能会返回预估值 + * @param sheetIndex 表索引 + */ + getTotalHeight(sheetIndex: number) { + if (this.sheetTotalHeightCache.has(sheetIndex)) { + return this.sheetTotalHeightCache.get(sheetIndex)!; + } + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const maxRow = this.getMaxRow(sheetIndex); + let totalHeight = 0; + for (let i = 0; i < maxRow; i++) { + totalHeight += this.getRowHeight(sheetIndex, i); + } + this.sheetTotalHeightCache.set(sheetIndex, totalHeight); + return totalHeight; + } + return 0; + } + + /** + * 获取最大列数 + */ + getMaxCol(sheetIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const cellData = sheet.worksheet?.cellData || []; + let maxCol = 0; + let index = 0; + for (const rowData of cellData) { + maxCol = Math.max(rowData?.length || 0, maxCol); + index++; + // 就测试 100 行 + if (index > 100) { + break; + } + } + return maxCol; + } + return 0; + } + + sheetTotalWidthCache: Map = new Map(); + + /** + * 获取表的中数据宽度,这个可能会返回预估值 + * @param sheetIndex 表索引 + */ + getTotalWidth(sheetIndex: number) { + if (this.sheetTotalWidthCache.has(sheetIndex)) { + return this.sheetTotalWidthCache.get(sheetIndex)!; + } + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const maxCol = this.getMaxCol(sheetIndex); + let totalWidth = 0; + for (let i = 0; i < maxCol; i++) { + totalWidth += this.getColWidth(sheetIndex, i); + } + this.sheetTotalWidthCache.set(sheetIndex, totalWidth); + return totalWidth; + } + return 0; + } + + /** + * 根据索引获取表 + * @param sheetIndex + * @returns 对应的表 + */ + getSheetByIndex(sheetIndex: number) { + return this.workbook.sheets[sheetIndex]; + } + + /** + * + * @param sheetName + * @returns + */ + getSheetByName(sheetName: string) { + return this.workbook.sheets.find(sheet => sheet.name === sheetName); + } + + /** + * 获取默认字体 + */ + getDefaultFont(): CT_Font { + return this.workbook.styleSheet?.fonts?.font?.[0] || defaultFont; + } + + getColor(color?: CT_Color, defaultColor = 'none') { + if (!color) { + return defaultColor; + } + if (color.rgb) { + const rgb = color.rgb; + if (rgb in PresetColorMap) { + return PresetColorMap[rgb as keyof typeof PresetColorMap]; + } + if (rgb.length === 8) { + return '#' + rgb.slice(2); + } + // 兼容带 # 的情况 + if (rgb.length === 7 && rgb[0] === '#') { + return rgb; + } + return '#' + color.rgb; + } + if (typeof color.theme !== 'undefined') { + const themeColor = this.getThemeColor(color.theme); + if (color.tint) { + return '#' + rgbTint(themeColor, color.tint); + } + return '#' + themeColor; + } + if (color.auto) { + return AUTO_COLOR; + } + if (typeof color.indexed !== 'undefined') { + if (IndexedColors[color.indexed]) { + return '#' + IndexedColors[color.indexed]; + } + } + + console.warn('unknown color', color); + + return 'none'; + } + + getFontStyle(font?: CT_Font): FontStyle { + const defaultFont = this.defaultFont; + const family = font?.name?.val || defaultFont.name?.val || 'Arial'; + const size = font?.sz?.val || defaultFont.sz?.val || DEFAULT_FONT_SIZE; + const defaultColor = this.getColor(defaultFont.color, '#000000'); + const color = this.getColor(font?.color, defaultColor); + const b = !!(font?.b || defaultFont.b) || false; + const i = !!(font?.i || defaultFont.i) || false; + const u = font?.u?.val || defaultFont.u?.val || 'none'; + const strike = font?.strike?.val || defaultFont.strike?.val || false; + const outline = font?.outline?.val || defaultFont.outline?.val || false; + const shadow = font?.shadow?.val || defaultFont.shadow?.val || false; + const condense = font?.condense?.val || defaultFont.condense?.val || false; + + return { + family, + size, + color, + b, + i, + u, + strike, + outline, + shadow, + condense + }; + } + + /** + * 获取单元格信息 + */ + getCellInfo(sheetIndex: number, row: number, col: number): CellInfo { + // 获取默认样式 + let font = this.defaultFont; + const sheet = this.getSheetByIndex(sheetIndex); + let text = ''; + let cellData: CellData = ''; + let fill: CT_Fill | undefined; + let border: CT_Border | undefined; + let alignment: CT_CellAlignment | undefined; + let value = ''; + if (sheet) { + const cellValue = this.getCellValueByData( + sheet.worksheet?.cellData || [], + row, + col + ); + const cell = sheet.worksheet?.cellData[row]?.[col]; + if (cell) { + text = cellValue.text; + value = cellValue.value; + cellData = cell; + if (typeof cell === 'object' && 's' in cell) { + const cellXfxIndex = cell.s || 0; + const cellXfx = + this.workbook?.styleSheet?.cellXfs?.xf?.[cellXfxIndex]; + if (cellXfx) { + const fontId = cellXfx.fontId || 0; + const customFont = this.workbook?.styleSheet?.fonts?.font?.[fontId]; + if (customFont) { + font = customFont; + } + // numfmt 带来的颜色 + if (cellValue.color) { + font.color = { + rgb: cellValue.color + }; + } + const fillId = cellXfx.fillId || 0; + fill = this.workbook?.styleSheet?.fills?.fill?.[fillId]; + + const borderId = cellXfx.borderId || 0; + border = this.workbook?.styleSheet?.borders?.border?.[borderId]; + + alignment = cellXfx.alignment; + } else { + console.warn(`没有找到 cellXfxIndex 为 ${cellXfxIndex} 的样式`); + } + } else if (typeof cell === 'string') { + text = cell; + // 这种情况下默认值会变成 center + alignment = { + vertical: 'center' + }; + } + } + } + return { + row, + col, + font, + value, + text, + fill, + border, + cellData, + alignment + }; + } + + getCellValue(sheetIndex: number, row: number, col: number): CellValue { + const sheet = this.getSheetByIndex(sheetIndex); + let text = ''; + let value = ''; + let color = ''; + + if (sheet) { + return this.getCellValueByData(sheet.worksheet?.cellData || [], row, col); + } + return { + row, + col, + color, + text, + value + }; + } + + getCellValueByData( + cellData: CellData[][], + row: number, + col: number + ): CellValue { + let text = ''; + let value = ''; + let isDate1904 = this.is1904(); + let color = ''; + let isDate; + const cell = cellData[row]?.[col]; + if (cell) { + if (typeof cell === 'object' && 's' in cell) { + const cellXfxIndex = cell.s || 0; + const cellXfx = this.workbook?.styleSheet?.cellXfs?.xf?.[cellXfxIndex]; + if (cellXfx) { + const numFmtId = cellXfx.numFmtId || 0; + if (numFmtId !== 0) { + const numFmt = this.numfmtInstances[numFmtId]; + if (numFmt?.pattern === 'General') { + // 不知道为何有时候会出现这种情况,这时不能做解析 + if (typeof cell === 'string') { + text = cell; + value = text; + } else if (typeof cell === 'object' && 'value' in cell) { + // 公式等其它情况 + text = cell.value; + value = text; + } + } else { + if (numFmt && 'value' in cell) { + const cellValue = parseFloat(cell.value); + if (isNaN(cellValue)) { + value = cell.value; + text = cell.value; + } else { + if (numFmt.isDate()) { + isDate = true; + let dateValue = cellValue; + if (isDate1904) { + dateValue += 1462; + } + text = numFmt(dateValue); + } else { + text = numFmt(cellValue); + } + + if (numFmt.info.color) { + color = numFmt.color(cellValue); + } + } + } + } + } else if ('value' in cell) { + text = cell.value || ''; + value = text; + } + } else { + console.warn(`没有找到 cellXfxIndex 为 ${cellXfxIndex} 的样式`); + } + } else if (typeof cell === 'string') { + text = cell; + value = text; + } else if (typeof cell === 'object' && 'value' in cell) { + // 公式等其它情况 + text = cell.value; + value = text; + } + } + return { + row, + col, + color, + text, + value, + isDate + }; + } + + /** + * 获取范围内的数据 + */ + getCellValueByRange( + sheetIndex: number, + range: RangeRef, + includeHidden: boolean + ): CellValue[] { + const result: CellValue[] = []; + + let endRow = range.endRow; + if (endRow === MAX_ROW) { + endRow = this.getMaxRow(sheetIndex); + } + let endCol = range.endCol; + if (endCol === MAX_ROW) { + endCol = this.getMaxCol(sheetIndex); + } + for (let row = range.startRow; row <= endRow; row++) { + if (!includeHidden && this.isRowHidden(sheetIndex, row)) { + continue; + } + for (let col = range.startCol; col <= range.endCol; col++) { + if (!includeHidden && this.isColHidden(sheetIndex, col)) { + continue; + } + const cellValue = this.getCellValue(sheetIndex, row, col); + if (hasValue(cellValue.text)) { + result.push(cellValue); + } + } + } + return result; + } + + searchText(sheetIndex: number, text: string): CellValue[] { + const result: CellValue[] = []; + const sheet = this.getSheetByIndex(sheetIndex); + + if (sheet) { + const cellData = sheet.worksheet?.cellData || []; + cellData.forEach((rowData, rowIndex) => { + (rowData || []).forEach((cell, colIndex) => { + const cellValue = this.getCellValue(sheetIndex, rowIndex, colIndex); + if (cellValue.text.includes(text)) { + result.push(cellValue); + } + }); + }); + } + return result; + } + + getThemeColor(themeId: number): string { + return getThemeColor(themeId, this.workbook); + } + + defaultFontSize?: FontSize; + + /** + * 获取默认字体高宽 + * @param ctx + * @returns + */ + getDefaultFontSize() { + if (this.defaultFontSize) { + return this.defaultFontSize; + } + const offscreen = new OffscreenCanvas(256, 256); + const ctx = offscreen.getContext( + '2d' + )! as OffscreenCanvasRenderingContext2D; + const defaultFont = genFontStr(this.defaultFontStyle); + ctx.font = defaultFont; + const size = measureTextWithCache(ctx, defaultFont, '1'); + this.defaultFontSize = size; + return this.defaultFontSize; + } + + getDefaultFontStyle(): FontStyle { + return this.defaultFontStyle; + } + + getMergeCells(sheetIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + return sheet.worksheet?.mergeCells || []; + } + return []; + } + + getDrawing(sheetIndex: number): IDrawing | null { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + return sheet.worksheet?.drawing || null; + } + return null; + } + + getConditionalFormatting(sheetIndex: number) { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + return sheet.worksheet?.conditionalFormatting || []; + } + return []; + } + + getDxf(index: number) { + return this.workbook.styleSheet?.dxfs?.dxf?.[index] || null; + } + + is1904() { + return this.workbook.workbookPr?.date1904 || false; + } + + /** + * 设置行排序 + */ + sortColumn(sheetIndex: number, range: RangeRef, sortOrder: 'asc' | 'desc') { + const sheet = this.getSheetByIndex(sheetIndex); + if (sheet) { + const cellData = sheet.worksheet?.cellData || []; + sortByRange(cellData, range, sortOrder); + } + } +} diff --git a/packages/office-viewer/src/excel/data/applyAutoFilter.ts b/packages/office-viewer/src/excel/data/applyAutoFilter.ts new file mode 100644 index 000000000..d2f157c12 --- /dev/null +++ b/packages/office-viewer/src/excel/data/applyAutoFilter.ts @@ -0,0 +1,93 @@ +import {CT_AutoFilter, CT_Row} from '../../openxml/ExcelTypes'; +import {parseRange} from '../io/excel/util/Range'; +import {IDataProvider} from '../types/IDataProvider'; +import {ISheet} from '../types/ISheet'; +import {customFilter} from './autoFilter/customFilter'; +import {filters} from './autoFilter/filters'; +import {IWorkbook} from '../types/IWorkbook'; +import {applySortState} from './autoFilter/applySortState'; + +/** + * 应用 autoFilter,将相关行隐藏 + * + * @headerRowCount 表头行数,需要忽略这些行 + */ +export function applyAutoFilter( + sheetIndex: number, + workbook: IWorkbook, + sheet: ISheet, + dataProvider: IDataProvider, + autoFilter: CT_AutoFilter, + headerRowCount: number = 1 +) { + const {ref} = autoFilter; + if (!ref) { + console.warn('缺少 ref 字段', autoFilter); + return; + } + + const rangeRef = parseRange(ref); + + rangeRef.startRow += headerRowCount; + + // 排序需要先应用 + applySortState(sheetIndex, dataProvider, autoFilter, headerRowCount); + + // 首先将行的隐藏状态重置 + for (let r = rangeRef.startRow; r <= rangeRef.endRow; r++) { + if (sheet.worksheet?.rows[r]) { + sheet.worksheet.rows[r].hidden = false; + } + } + + const is1904 = workbook.workbookPr?.date1904 ?? false; + + let hiddenRows = new Set(); + + for (const filterColumn of autoFilter.filterColumn || []) { + const colId = filterColumn.colId || 0; + const cellValues = dataProvider.getCellValueByRange( + sheetIndex, + { + startRow: rangeRef.startRow, + startCol: rangeRef.startCol + colId, + endRow: rangeRef.endRow, + endCol: rangeRef.startCol + colId + }, + true + ); + + const cellValuesBigNumber = cellValues.map(cellValue => { + let num; + try { + num = parseFloat(cellValue.value); + } catch (e) {} + return {row: cellValue.row, num, value: cellValue.value}; + }); + + const customFiltersHiddenRows = customFilter( + cellValuesBigNumber, + filterColumn.customFilters + ); + + hiddenRows = new Set([...hiddenRows, ...customFiltersHiddenRows]); + + const filtersHiddenRows = filters( + cellValuesBigNumber, + filterColumn.filters, + is1904 + ); + + hiddenRows = new Set([...hiddenRows, ...filtersHiddenRows]); + } + + for (const row of hiddenRows) { + if (!sheet.worksheet!.rows[row]) { + sheet.worksheet!.rows[row] = { + hidden: true + }; + } else { + sheet.worksheet!.rows[row].hidden = true; + } + } +} diff --git a/packages/office-viewer/src/excel/data/autoFilter/CellValueNum.ts b/packages/office-viewer/src/excel/data/autoFilter/CellValueNum.ts new file mode 100644 index 000000000..8739c2b47 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/CellValueNum.ts @@ -0,0 +1,5 @@ +export type CellValueNum = { + row: number; + num: number | undefined; + value: string; +}; diff --git a/packages/office-viewer/src/excel/data/autoFilter/__test__/customFilter.test.ts b/packages/office-viewer/src/excel/data/autoFilter/__test__/customFilter.test.ts new file mode 100644 index 000000000..ccc53e7a0 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/__test__/customFilter.test.ts @@ -0,0 +1,213 @@ +import {CellValueNum} from '../CellValueNum'; +import {customFilter} from '../customFilter'; + +const values: CellValueNum[] = [...Array(10)].map((_, i) => { + return { + row: i, + num: i, + value: i.toString() + }; +}); + +test('equal', () => { + const hiddenRows = customFilter(values, { + customFilter: [ + { + operator: 'equal', + val: '1' + } + ] + }); + expect(hiddenRows).toEqual(new Set([0, 2, 3, 4, 5, 6, 7, 8, 9])); +}); + +test('notEqual', () => { + const hiddenRows = customFilter(values, { + customFilter: [ + { + operator: 'notEqual', + val: '1' + } + ] + }); + expect(hiddenRows).toEqual(new Set([1])); +}); + +test('lessThan', () => { + const hiddenRows = customFilter(values, { + customFilter: [ + { + operator: 'lessThan', + val: '5' + } + ] + }); + expect(hiddenRows).toEqual(new Set([5, 6, 7, 8, 9])); +}); + +test('lessThanOrEqual', () => { + const hiddenRows = customFilter(values, { + customFilter: [ + { + operator: 'lessThanOrEqual', + val: '5' + } + ] + }); + expect(hiddenRows).toEqual(new Set([6, 7, 8, 9])); +}); + +test('greaterThan', () => { + const hiddenRows = customFilter(values, { + customFilter: [ + { + operator: 'greaterThan', + val: '5' + } + ] + }); + expect(hiddenRows).toEqual(new Set([0, 1, 2, 3, 4, 5])); +}); + +test('greaterThanOrEqual', () => { + const hiddenRows = customFilter(values, { + customFilter: [ + { + operator: 'greaterThanOrEqual', + val: '5' + } + ] + }); + expect(hiddenRows).toEqual(new Set([0, 1, 2, 3, 4])); +}); + +test('and equal', () => { + const hiddenRows = customFilter(values, { + and: true, + customFilter: [ + { + operator: 'greaterThanOrEqual', + val: '2' + }, + { + operator: 'greaterThanOrEqual', + val: '3' + } + ] + }); + expect(hiddenRows).toEqual(new Set([0, 1, 2])); +}); + +test('or equal', () => { + const hiddenRows = customFilter(values, { + and: false, + customFilter: [ + { + operator: 'equal', + val: '2' + }, + { + operator: 'equal', + val: '4' + } + ] + }); + expect(hiddenRows).toEqual(new Set([0, 1, 3, 5, 6, 7, 8, 9])); +}); + +const strValues: CellValueNum[] = [ + { + row: 1, + value: 'ab', + num: 1 + }, + { + row: 2, + value: 'bc', + num: 2 + }, + { + row: 3, + value: 'cd', + num: 3 + }, + { + row: 4, + value: 'de', + num: 4 + }, + { + row: 5, + value: 'ef', + num: 5 + } +]; + +test('startsWith', () => { + const hiddenRows = customFilter(strValues, { + customFilter: [ + { + val: 'e*' + } + ] + }); + expect(hiddenRows).toEqual(new Set([1, 2, 3, 4])); +}); + +test('not startsWith', () => { + const hiddenRows = customFilter(strValues, { + customFilter: [ + { + operator: 'notEqual', + val: 'e*' + } + ] + }); + expect(hiddenRows).toEqual(new Set([5])); +}); + +test('endsWith', () => { + const hiddenRows = customFilter(strValues, { + customFilter: [ + { + val: '*e' + } + ] + }); + expect(hiddenRows).toEqual(new Set([1, 2, 3, 5])); +}); + +test('not endsWith', () => { + const hiddenRows = customFilter(strValues, { + customFilter: [ + { + operator: 'notEqual', + val: '*e' + } + ] + }); + expect(hiddenRows).toEqual(new Set([4])); +}); + +test('contains', () => { + const hiddenRows = customFilter(strValues, { + customFilter: [ + { + val: '*e*' + } + ] + }); + expect(hiddenRows).toEqual(new Set([1, 2, 3])); +}); + +test('not contains', () => { + const hiddenRows = customFilter(strValues, { + customFilter: [ + { + operator: 'notEqual', + val: '*e*' + } + ] + }); + expect(hiddenRows).toEqual(new Set([4, 5])); +}); diff --git a/packages/office-viewer/src/excel/data/autoFilter/__test__/filters.test.ts b/packages/office-viewer/src/excel/data/autoFilter/__test__/filters.test.ts new file mode 100644 index 000000000..c676994bd --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/__test__/filters.test.ts @@ -0,0 +1,94 @@ +import {CellValueNum} from '../CellValueNum'; +import {filters} from '../filters'; +import {toExcelDate} from '../../../io/excel/util/fromExcelDate'; + +const values: CellValueNum[] = [...Array(5)].map((_, i) => { + return { + row: i, + num: i, + value: i.toString() + }; +}); + +test('equal', () => { + const hiddenRows = filters(values, { + filter: [ + { + val: '1' + } + ] + }); + expect(hiddenRows).toEqual(new Set([0, 2, 3, 4])); +}); + +test('equal2', () => { + const hiddenRows = filters(values, { + filter: [ + { + val: '1' + }, + {val: '2'} + ] + }); + expect(hiddenRows).toEqual(new Set([0, 3, 4])); +}); + +const datesData: CellValueNum[] = [ + { + row: 1, + num: 1, + value: String(toExcelDate(new Date(Date.parse('2019-01-01T00:00:00.000Z')))) + }, + { + row: 2, + num: 2, + value: String(toExcelDate(new Date(Date.parse('2020-01-01T00:00:00.000Z')))) + }, + { + row: 3, + num: 3, + value: String(toExcelDate(new Date(Date.parse('2020-02-01T00:00:00.000Z')))) + } +]; + +test('date-group-year', () => { + const hiddenRows = filters(datesData, { + dateGroupItem: [ + { + dateTimeGrouping: 'year', + year: 2020 + } + ] + }); + + expect(hiddenRows).toEqual(new Set([1])); +}); + +test('date-group-month', () => { + const hiddenRows = filters(datesData, { + dateGroupItem: [ + { + dateTimeGrouping: 'month', + year: 2020, + month: 2 + } + ] + }); + + expect(hiddenRows).toEqual(new Set([1, 2])); +}); + +test('date-group-day', () => { + const hiddenRows = filters(datesData, { + dateGroupItem: [ + { + dateTimeGrouping: 'day', + year: 2020, + month: 2, + day: 1 + } + ] + }); + + expect(hiddenRows).toEqual(new Set([1, 2])); +}); diff --git a/packages/office-viewer/src/excel/data/autoFilter/__test__/sortByRange.test.ts b/packages/office-viewer/src/excel/data/autoFilter/__test__/sortByRange.test.ts new file mode 100644 index 000000000..7c162b1be --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/__test__/sortByRange.test.ts @@ -0,0 +1,50 @@ +import {CellData} from '../../../types/worksheet/CellData'; +import {sortByRange} from '../sortByRange'; +function shuffle(array: any[]) { + let currentIndex = array.length, + randomIndex; + + // While there remain elements to shuffle. + while (currentIndex > 0) { + // Pick a remaining element. + randomIndex = Math.floor(Math.random() * currentIndex); + currentIndex--; + + // And swap it with the current element. + [array[currentIndex], array[randomIndex]] = [ + array[randomIndex], + array[currentIndex] + ]; + } + + return array; +} + +const cellData: CellData[][] = [ + ['8', 'h', {type: 'style', value: 'h'}], + ['1', 'a', {type: 'style', value: 'a'}], + ['5', 'e', {type: 'style', value: 'e'}], + ['2', 'b', {type: 'style', value: 'b'}], + ['4', 'd', {type: 'style', value: 'd'}], + ['6', 'f', {type: 'style', value: 'f'}], + ['3', 'c', {type: 'style', value: 'c'}], + ['7', 'g', {type: 'style', value: 'g'}] +]; + +test('string', () => { + sortByRange( + cellData, + {startRow: 1, endRow: 6, startCol: 1, endCol: 1}, + 'asc' + ); + + expect(cellData[1][1]).toBe('a'); + + sortByRange( + cellData, + {startRow: 1, endRow: 6, startCol: 1, endCol: 1}, + 'desc' + ); + + expect(cellData[1][1]).toBe('f'); +}); diff --git a/packages/office-viewer/src/excel/data/autoFilter/applySortState.ts b/packages/office-viewer/src/excel/data/autoFilter/applySortState.ts new file mode 100644 index 000000000..4c2e3a673 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/applySortState.ts @@ -0,0 +1,31 @@ +import {CT_AutoFilter} from '../../../openxml/ExcelTypes'; +import {parseRange} from '../../io/excel/util/Range'; +import {IDataProvider} from '../../types/IDataProvider'; +import {ISheet} from '../../types/ISheet'; +import {IWorkbook} from '../../types/IWorkbook'; + +/** + * 应用排序状态 + */ + +export function applySortState( + sheetIndex: number, + dataProvider: IDataProvider, + autoFilter: CT_AutoFilter, + headerRowCount: number = 1 +) { + const sortState = autoFilter.sortState; + if (!sortState) { + return; + } + for (const sortCondition of sortState.sortCondition || []) { + const ref = sortCondition.ref; + if (!ref) { + continue; + } + const rangeRef = parseRange(ref); + rangeRef.startRow += headerRowCount; + const sortOrder = sortCondition.descending ? 'desc' : 'asc'; + dataProvider.sortColumn(sheetIndex, rangeRef, sortOrder); + } +} diff --git a/packages/office-viewer/src/excel/data/autoFilter/customFilter.ts b/packages/office-viewer/src/excel/data/autoFilter/customFilter.ts new file mode 100644 index 000000000..b2f741ed3 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/customFilter.ts @@ -0,0 +1,53 @@ +import {CT_CustomFilters} from '../../../openxml/ExcelTypes'; +import {CellValueNum} from './CellValueNum'; +import {evalCustomFilter} from './evalCustomFilter'; + +/** + * 自定义筛选 + */ +export function customFilter( + values: CellValueNum[], + customFilters?: CT_CustomFilters +) { + if (!customFilters) { + return new Set(); + } + const hiddenRows = new Set(); + const showRows = new Set(); + const and = customFilters.and; + const filters = customFilters.customFilter || []; + + for (const cellValue of values) { + for (const filter of filters) { + const operator = filter.operator; + const val = filter.val; + if (val === undefined) { + continue; + } + + const evalResult = evalCustomFilter(operator, val, cellValue); + + // 在并的场景下,只要有个条件不匹配就隐藏 + if (and) { + if (!evalResult) { + hiddenRows.add(cellValue.row); + break; + } + } else { + // 在或的场景下,只要有个条件匹配就显示 + hiddenRows.add(cellValue.row); + if (evalResult) { + showRows.add(cellValue.row); + } + } + } + } + + if (!and) { + for (const row of showRows) { + hiddenRows.delete(row); + } + } + + return hiddenRows; +} diff --git a/packages/office-viewer/src/excel/data/autoFilter/evalCustomFilter.ts b/packages/office-viewer/src/excel/data/autoFilter/evalCustomFilter.ts new file mode 100644 index 000000000..7a40a7714 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/evalCustomFilter.ts @@ -0,0 +1,72 @@ +import {ST_FilterOperator} from '../../../openxml/ExcelTypes'; +import {gt, gte, lt, lte} from '../../../util/number'; +import {CellValueNum} from './CellValueNum'; + +/** + * 判断是否匹配 + * @param operator + * @param val + * @param cellValueNum + */ +export function evalCustomFilter( + operator: ST_FilterOperator | undefined, + val: string, + cellValueNum: CellValueNum +) { + val = val.toLowerCase(); + const value = cellValueNum.value.toLowerCase(); + const num = cellValueNum.num; + operator = operator || 'equal'; + + switch (operator) { + case 'equal': + if (val.startsWith('*') && val.endsWith('*')) { + return value.includes(val.slice(1, -1)); + } + if (val.endsWith('*')) { + return value.startsWith(val.slice(0, -1)); + } + if (val.startsWith('*')) { + return value.endsWith(val.slice(1)); + } + + return value === val; + + case 'notEqual': + if (val.startsWith('*') && val.endsWith('*')) { + return !value.includes(val.slice(1, -1)); + } + if (val.endsWith('*')) { + return !value.startsWith(val.slice(0, -1)); + } + if (val.startsWith('*')) { + return !value.endsWith(val.slice(1)); + } + return value !== val; + + case 'lessThan': + if (num === undefined) { + return false; + } + return lt(num, parseFloat(val)); + + case 'lessThanOrEqual': + if (num === undefined) { + return false; + } + return lte(num, parseFloat(val)); + + case 'greaterThan': + if (num === undefined) { + return false; + } + return gt(num, parseFloat(val)); + + case 'greaterThanOrEqual': + if (num === undefined) { + return false; + } + return gte(num, parseFloat(val)); + } + return false; +} diff --git a/packages/office-viewer/src/excel/data/autoFilter/filters.ts b/packages/office-viewer/src/excel/data/autoFilter/filters.ts new file mode 100644 index 000000000..5abd6e370 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/filters.ts @@ -0,0 +1,60 @@ +import {CT_Filters} from '../../../openxml/ExcelTypes'; +import {fromExcelDate} from '../../io/excel/util/fromExcelDate'; +import {CellValueNum} from './CellValueNum'; +import {DateGroupItem, inDateGroupItems} from './inDateGroupItems'; + +export function filters( + values: CellValueNum[], + filters?: CT_Filters, + is1904: boolean = false +) { + const hiddenRows = new Set(); + if (!filters) { + return hiddenRows; + } + + const filter = filters.filter || []; + const filterValues = new Set(filter.map(f => f.val)); + + const dateGroupItem = filters.dateGroupItem || []; + + const dateGroupItemDates = dateGroupItem + .map(item => { + const dateTimeGrouping = item.dateTimeGrouping; + const year = item.year || 2024; + const month = item.month || 1; + const day = item.day || 1; + const hour = item.hour || 0; + const minute = item.minute || 0; + const second = item.second || 0; + + const date = new Date( + Date.UTC(year, month - 1, day, hour, minute, second) + ); + return { + date, + dateTimeGrouping + }; + }) + .filter(Boolean) as DateGroupItem[]; + + for (const cellValue of values) { + // 不在筛选范围内就隐藏 + if (filterValues.size > 0 && !filterValues.has(cellValue.value)) { + hiddenRows.add(cellValue.row); + } + + if (dateGroupItemDates.length > 0) { + if ( + !inDateGroupItems( + dateGroupItemDates, + fromExcelDate(cellValue.value, is1904) + ) + ) { + hiddenRows.add(cellValue.row); + } + } + } + + return hiddenRows; +} diff --git a/packages/office-viewer/src/excel/data/autoFilter/inDateGroupItems.ts b/packages/office-viewer/src/excel/data/autoFilter/inDateGroupItems.ts new file mode 100644 index 000000000..9ee2c1591 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/inDateGroupItems.ts @@ -0,0 +1,81 @@ +import {ST_DateTimeGrouping} from '../../../openxml/ExcelTypes'; + +export type DateGroupItem = { + date: Date; + dateTimeGrouping: ST_DateTimeGrouping; +}; + +export function inDateGroupItems(dateGroupItems: DateGroupItem[], date: Date) { + let inGroup = false; + + for (const item of dateGroupItems) { + const {date: groupDate, dateTimeGrouping} = item; + switch (dateTimeGrouping) { + case 'year': + if (date.getFullYear() === groupDate.getFullYear()) { + inGroup = true; + } + break; + + case 'month': + if ( + date.getFullYear() === groupDate.getFullYear() && + date.getMonth() === groupDate.getMonth() + ) { + inGroup = true; + } + break; + + case 'day': + if ( + date.getFullYear() === groupDate.getFullYear() && + date.getMonth() === groupDate.getMonth() && + date.getDate() === groupDate.getDate() + ) { + inGroup = true; + } + break; + + case 'hour': + if ( + date.getFullYear() === groupDate.getFullYear() && + date.getMonth() === groupDate.getMonth() && + date.getDate() === groupDate.getDate() && + date.getHours() === groupDate.getHours() + ) { + inGroup = true; + } + break; + + case 'minute': + if ( + date.getFullYear() === groupDate.getFullYear() && + date.getMonth() === groupDate.getMonth() && + date.getDate() === groupDate.getDate() && + date.getHours() === groupDate.getHours() && + date.getMinutes() === groupDate.getMinutes() + ) { + inGroup = true; + } + break; + + case 'second': + if ( + date.getFullYear() === groupDate.getFullYear() && + date.getMonth() === groupDate.getMonth() && + date.getDate() === groupDate.getDate() && + date.getHours() === groupDate.getHours() && + date.getMinutes() === groupDate.getMinutes() && + date.getSeconds() === groupDate.getSeconds() + ) { + inGroup = true; + } + break; + + default: + break; + } + } + + return inGroup; +} diff --git a/packages/office-viewer/src/excel/data/autoFilter/sortByRange.ts b/packages/office-viewer/src/excel/data/autoFilter/sortByRange.ts new file mode 100644 index 000000000..f0407eb72 --- /dev/null +++ b/packages/office-viewer/src/excel/data/autoFilter/sortByRange.ts @@ -0,0 +1,63 @@ +import {RangeRef} from '../../types/RangeRef'; +import {CellData} from '../../types/worksheet/CellData'; + +/** + * 比较两个单元格的值,目前还有很多类型没有处理,比如富文本 + * @returns 如果 a > b 返回 1,如果 a < b 返回 -1,如果 a === b 返回 0 + */ +export function compareCellData(a?: CellData, b?: CellData) { + if (a === b) { + return 0; + } + if (typeof a === 'string' && typeof b === 'string') { + return a.localeCompare(b, undefined, {numeric: true, sensitivity: 'base'}); + } + + if (a === undefined) { + return 1; + } + + if (b === undefined) { + return -1; + } + + if ( + typeof a === 'object' && + 'value' in a && + typeof b === 'object' && + 'value' in b + ) { + const aValue = a.value; + const bValue = b.value; + return aValue.localeCompare(bValue, undefined, { + numeric: true, + sensitivity: 'base' + }); + } + + return 0; +} + +export function sortByRange( + cellData: CellData[][], + range: RangeRef, + sortOrder: 'asc' | 'desc' +) { + const rows = cellData.slice(range.startRow, range.endRow + 1); + + rows.sort((a, b) => { + const aVal = a[range.startCol]; + const bVal = b[range.startCol]; + const compareResult = compareCellData(aVal, bVal); + + if (sortOrder === 'asc') { + return compareResult; + } else { + return -compareResult; + } + }); + // 似乎不需要 + for (let i = 0; i < rows.length; i++) { + cellData[i + range.startRow] = rows[i]; + } +} diff --git a/packages/office-viewer/src/excel/data/defaultFont.ts b/packages/office-viewer/src/excel/data/defaultFont.ts new file mode 100644 index 000000000..e9f4440ff --- /dev/null +++ b/packages/office-viewer/src/excel/data/defaultFont.ts @@ -0,0 +1,27 @@ +import {CT_Font, ST_FontScheme} from '../../openxml/ExcelTypes'; +import {DEFAULT_FONT_SIZE} from '../render/Consts'; + +/** + * 默认字体 + */ + +export default { + name: { + val: '等线' + }, + charset: { + val: 134 + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: DEFAULT_FONT_SIZE + }, + scheme: { + val: 'minor' as ST_FontScheme + } +}; diff --git a/packages/office-viewer/src/excel/data/getThemeColor.ts b/packages/office-viewer/src/excel/data/getThemeColor.ts new file mode 100644 index 000000000..b565376e2 --- /dev/null +++ b/packages/office-viewer/src/excel/data/getThemeColor.ts @@ -0,0 +1,76 @@ +import {IWorkbook} from '../types/IWorkbook'; + +const themeColorMap: Record = { + dk1: '#000000', + lt1: '#FFFFFF', + dk2: '#1F497D', + lt2: '#EEECE1', + accent1: '#4F81BD', + accent2: '#C0504D', + accent3: '#9BBB59', + accent4: '#8064A2', + accent5: '#4BACC6', + accent6: '#F79646', + hlink: '#0000FF', + folHlink: '#800080' +}; + +function normalizeColor(color: string) { + switch (color) { + case 'light1': + case 'bg1': + return 'lt1'; + case 'light2': + case 'bg2': + return 'lt2'; + + case 'dark1': + case 'tx1': + return 'dk1'; + + case 'dark2': + return 'dk2'; + + default: + break; + } + + return color; +} + +export function getThemeColor(themeId: number | string, workbook?: IWorkbook) { + if (typeof themeId === 'string') { + themeId = normalizeColor(themeId); + } + // TODO: 这个主要是为了支持图形 + if (themeId in themeColorMap) { + return themeColorMap[themeId]; + } + + const theme = workbook?.theme?.themeElements?.clrSchemes; + // TODO: 从 LuckyExcel 抄来的,不知道为啥这几个是反的 + if (themeId == 0) { + themeId = 1; + } else if (themeId == 1) { + themeId = 0; + } else if (themeId == 2) { + themeId = 3; + } else if (themeId == 3) { + themeId = 2; + } + if (theme) { + const color = theme[themeId as number]; + if (color) { + const rgbColor = color.srgbClr; + if (rgbColor) { + return rgbColor.val!; + } + const sysColor = color.sysClr; + if (sysColor) { + return sysColor.lastClr!; + } + } + } + console.warn('unknown theme color', themeId, theme); + return 'none'; +} diff --git a/packages/office-viewer/src/excel/data/numfmt/amountInWords.ts b/packages/office-viewer/src/excel/data/numfmt/amountInWords.ts new file mode 100644 index 000000000..ab2047f7a --- /dev/null +++ b/packages/office-viewer/src/excel/data/numfmt/amountInWords.ts @@ -0,0 +1,41 @@ +/** + * 将数字转换为大写的中文金额 + */ +export function amountInWords(n: number) { + const maxLen = 14; + if (n.toString().split('.')[0]?.length > maxLen) { + return `最大数额只支持到兆(既小数点前${maxLen}位)`; + } + + const fraction = ['角', '分']; + const digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; + const unit = [ + ['元', '万', '亿', '兆'], + ['', '拾', '佰', '仟'] + ]; + const head = n < 0 ? '欠' : ''; + n = Math.abs(n); + let s = ''; + for (let i = 0; i < fraction.length; i++) { + s += ( + digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i] + ).replace(/零./, ''); + } + s = s || '整'; + n = Math.floor(n); + for (let i = 0; i < unit[0].length && n > 0; i++) { + let p = ''; + for (let j = 0; j < unit[1].length && n > 0; j++) { + p = digit[n % 10] + unit[1][j] + p; + n = Math.floor(n / 10); + } + s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s; + } + return ( + head + + s + .replace(/(零.)*零元/, '元') + .replace(/(零.)+/g, '零') + .replace(/^整$/, '零元整') + ); +} diff --git a/packages/office-viewer/src/excel/data/numfmtExtend.ts b/packages/office-viewer/src/excel/data/numfmtExtend.ts new file mode 100644 index 000000000..438e99925 --- /dev/null +++ b/packages/office-viewer/src/excel/data/numfmtExtend.ts @@ -0,0 +1,31 @@ +/** + * 应对 numfmt 不识别的情况 + */ + +import {amountInWords} from './numfmt/amountInWords'; + +export function numfmtExtend(formatCode?: string) { + const numfmtInstance = function (val: string) { + switch (formatCode) { + case '[DBNum2][$RMB]General;[Red][DBNum2][$RMB]General': + const num = parseFloat(val); + if (isNaN(num)) { + return val; + } + return amountInWords(parseFloat(num.toFixed(2))); + default: + console.warn('numfmtExtend: formatCode not found', formatCode); + return val; + } + }; + + numfmtInstance.isDate = () => { + return false; + }; + + numfmtInstance.info = { + color: 0 + }; + + return numfmtInstance; +} diff --git a/packages/office-viewer/src/excel/dev.md b/packages/office-viewer/src/excel/dev.md new file mode 100644 index 000000000..4f62b8063 --- /dev/null +++ b/packages/office-viewer/src/excel/dev.md @@ -0,0 +1,29 @@ +# 开发 + +## 各模块主要分工 + +- Workbook 主入口,一个 Excel 示例主要就是一个 Workbook 实例 +- sheet,单个表的实例,其中包含表数据及运行时状态,比如当前滚动位置等 +- render,Canvas 渲染 +- data provider,封装所有数据相关操作,所有数据处理都必须通过调用这个类的函数,后续方便支持多人协同,这里存放的数据都是存储相关的,UI 展现相关的不放这里,比如滚动条位置 + +## todo + +- 滚动条 + - 滚动的时候是按单元格滚动 + - 测试触摸板效果 + - 滚动到底部或顶部的时候不 prevent 事件 +- 单元格 + - 单元格渲染缓存 +- 选区 + - 选区需要被遮挡 + - 支持多选区 +- 表格操作 + - 按日期年月日过滤 +- sheetTab + - 超长水平滚动 +- 公式栏 + - 名称列表 +- 嵌入单元格的图片,目前看 wps 等都不支持 +- 还不支持的功能 + - x14_iconset.xlsx diff --git a/packages/office-viewer/src/excel/edit/Command.ts b/packages/office-viewer/src/excel/edit/Command.ts new file mode 100644 index 000000000..df3c3685d --- /dev/null +++ b/packages/office-viewer/src/excel/edit/Command.ts @@ -0,0 +1,36 @@ +/** + * 所有对数据的改动都通过这里 + */ + +export interface ICommand { + execute: () => void; + undo: () => void; +} + +export class ChangeRowHeightCommand implements ICommand { + type: 'changeRowHeight'; + sheetIndex: string; + row: number; + height: number; + oldHeight: number; + constructor( + sheetIndex: string, + row: number, + height: number, + oldHeight: number + ) { + this.type = 'changeRowHeight'; + this.sheetIndex = sheetIndex; + this.row = row; + this.height = height; + this.oldHeight = oldHeight; + } + execute() { + // todo + } + undo() { + // todo + } +} + +export class CommandManager {} diff --git a/packages/office-viewer/src/excel/edit/ui/CellEditor.ts b/packages/office-viewer/src/excel/edit/ui/CellEditor.ts new file mode 100644 index 000000000..3363d1ae7 --- /dev/null +++ b/packages/office-viewer/src/excel/edit/ui/CellEditor.ts @@ -0,0 +1,122 @@ +import {onClickOutside} from '../../../util/onClickOutside'; +import {Workbook} from '../../Workbook'; +import {HitTestResult} from '../../render/selection/hitTest'; +import {Input} from '../../render/ui/Input'; +import {Sheet} from '../../sheet/Sheet'; +import {CellData, updateValue} from '../../types/worksheet/CellData'; + +/** + * 单元格编辑 + */ +export class CellEditor { + /** + * 编辑器容器 + */ + editorContainer: HTMLElement; + + workbook: Workbook; + + hitTestResult: HitTestResult; + + value?: string; + + initValue?: string; + + cellData: CellData | undefined; + + sheet: Sheet; + + row: number; + + col: number; + + constructor( + dataContainer: HTMLElement, + workbook: Workbook, + hitTest: HitTestResult + ) { + this.workbook = workbook; + this.editorContainer = document.createElement('div'); + this.editorContainer.className = 'excel-cell-editor'; + dataContainer.appendChild(this.editorContainer); + this.hitTestResult = hitTest; + + const activeSheet = this.workbook.getActiveSheet(); + this.sheet = activeSheet; + + this.row = hitTest.startRow; + this.col = hitTest.startCol; + + const cellInfo = activeSheet.getCellInfo( + hitTest.startRow, + hitTest.startCol + ); + + this.cellData = activeSheet.getCellData(hitTest.startRow, hitTest.startCol); + + let {x, y, width, height} = activeSheet.getCellDisplaySize( + hitTest.realRow ?? hitTest.startRow, + hitTest.realCol ?? hitTest.startCol, + hitTest.x, + hitTest.y + ); + + const {rowHeaderWidth, colHeaderHeight} = activeSheet.getRowColSize(); + const padding = 1; + + x = x - rowHeaderWidth + padding; + y = y - colHeaderHeight + padding; + width = width - padding * 2; + height = height - padding * 2; + + this.initValue = cellInfo.value; + this.value = cellInfo.value; + + const input = new Input( + this.editorContainer, + '', + cellInfo.value, + value => { + this.handleInput(value); + }, + 'borderLess' + ); + + input.force(); + + this.editorContainer.style.left = `${x}px`; + this.editorContainer.style.top = `${y}px`; + this.editorContainer.style.width = `${width}px`; + this.editorContainer.style.height = `${height}px`; + + onClickOutside(this.editorContainer, () => { + this.close(); + }); + } + + handleInput(value: string) { + this.value = value; + } + + /** + * 关闭编辑器 + */ + close() { + this.editorContainer.remove(); + + if (this.value !== undefined && this.value !== this.initValue) { + this.sheet.updateCellValue( + this.row, + this.col, + updateValue(this.value, this.cellData) + ); + + this.workbook.uiEvent.emit('UPDATE_RANGE', this.sheet.getIndex(), { + startRow: this.row, + startCol: this.col, + endRow: this.row, + endCol: this.col + }); + } + } +} diff --git a/packages/office-viewer/src/excel/io/csv/empty.xlsx b/packages/office-viewer/src/excel/io/csv/empty.xlsx new file mode 100644 index 000000000..9b32e8f49 Binary files /dev/null and b/packages/office-viewer/src/excel/io/csv/empty.xlsx differ diff --git a/packages/office-viewer/src/excel/io/csv/emptyXLSX.ts b/packages/office-viewer/src/excel/io/csv/emptyXLSX.ts new file mode 100644 index 000000000..9310b294b --- /dev/null +++ b/packages/office-viewer/src/excel/io/csv/emptyXLSX.ts @@ -0,0 +1,7 @@ +/** generated by convertFileToBase64.ts, do not edit */ + +import {base64ToArrayBuffer} from '../../../util/base64ToArrayBuffer'; + +export const emptyXLSX = base64ToArrayBuffer( + 'UEsDBBQABgAIAAAAIQCkU8XPTgEAAAgEAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsk8tOwzAQRfdI/EPkLYrdskAINe2CxxK6KB9g4kli1S953NL+PRP3sUChFWo3sWLP3HM9M57MNtYUa4iovavYmI9YAa72Sru2Yp+Lt/KRFZikU9J4BxXbArLZ9PZmstgGwIKyHVasSyk8CYF1B1Yi9wEcnTQ+WpnoN7YiyHopWxD3o9GDqL1L4FKZeg02nbxAI1cmFa8b2t45iWCQFc+7wJ5VMRmC0bVM5FSsnfpFKfcETpk5Bjsd8I5sMDFI6E/+BuzzPqg0USso5jKmd2nJhtgY8e3j8sv7JT8tMuDSN42uQfl6ZakCHEMEqbADSNbwvHIrtTv4PsHPwSjyMr6ykf5+WfiMj0T9BpG/l1vIMmeAmLYG8Nplz6KnyNSvefQBaXIj/J9+GM0+uwwkBDFpOA7nUJOPRJr6i68L/btSoAbYIr/j6Q8AAAD//wMAUEsDBBQABgAIAAAAIQC1VTAj9AAAAEwCAAALAAgCX3JlbHMvLnJlbHMgogQCKKAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArJJNT8MwDIbvSPyHyPfV3ZAQQkt3QUi7IVR+gEncD7WNoyQb3b8nHBBUGoMDR3+9fvzK2908jerIIfbiNKyLEhQ7I7Z3rYaX+nF1ByomcpZGcazhxBF21fXV9plHSnkodr2PKqu4qKFLyd8jRtPxRLEQzy5XGgkTpRyGFj2ZgVrGTVneYviuAdVCU+2thrC3N6Dqk8+bf9eWpukNP4g5TOzSmRXIc2Jn2a58yGwh9fkaVVNoOWmwYp5yOiJ5X2RswPNEm78T/XwtTpzIUiI0Evgyz0fHJaD1f1q0NPHLnXnENwnDq8jwyYKLH6jeAQAA//8DAFBLAwQUAAYACAAAACEAjYfacOAAAAAtAgAAGgAIAXhsL19yZWxzL3dvcmtib29rLnhtbC5yZWxzIKIEASigAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArJHLasMwEEX3hf6DmH09dgqllMjZlEK2xf0AIY8fxJaEZpLWf1/hgt1ASDbZCK4G3XMkbXc/46BOFLn3TkOR5aDIWV/3rtXwVX08vYJiMa42g3ekYSKGXfn4sP2kwUg6xF0fWKUWxxo6kfCGyLaj0XDmA7k0aXwcjaQYWwzGHkxLuMnzF4z/O6A861T7WkPc18+gqikk8u1u3zS9pXdvjyM5uYBAlmlIF1CViS2Jhr+cJUfAy/jNPfGSnoVW+hxxXotrDsU9Hb59PHBHJKvHssU4TxYZPPvk8hcAAP//AwBQSwMEFAAGAAgAAAAhAKvyIgCYAwAA9wgAAA8AAAB4bC93b3JrYm9vay54bWysVW1vozgQ/n7S/QfEd2qbtySodAUJ6Cq1qyrNtnefVi44xSrgnO28VNX+9x0TSNvN6ZTtbpTY2B4ePzPzzOT8066prQ2Tios2tskZti3WFqLk7WNsf1nkzti2lKZtSWvRsth+Zsr+dPHnH+dbIZ8ehHiyAKBVsV1pvYoQUkXFGqrOxIq1cLIUsqEalvIRqZVktFQVY7qpkYtxiBrKW3uPEMlTMMRyyQs2E8W6Ya3eg0hWUw30VcVXakBrilPgGiqf1iunEM0KIB54zfVzB2pbTRFdPrZC0oca3N6RwNpJ+IbwIxgGd7gJjo6uanghhRJLfQbQaE/6yH+CESHvQrA7jsFpSD6SbMNNDg+sZPhBVuEBK3wFI/iX0QhIq9NKBMH7IFpw4ObaF+dLXrO7vXQtulp9po3JVG1bNVU6K7lmZWyPYCm27N2GXK/SNa/hlGCXEBtdHOR8I62SLem61gsQ8gAf2y52PYyNJQgjqTWTLdVsKloNOuz9+lXNddjTSoDCrTn7d80lg8ICfYGvMNIiog/qhurKWss6ttEXBc6jdsvbEplyhJpFtOHqdXB66a1o8UQfmeql6Gw42zKJlCwQ2xWsRlygQm3QG03T4wL6CVXTwoQKQaz2/uyff4wbuCWjQbk3WlrwfDm7guzd0g3kEhRT9qV+Cckaf33JZyPP99Opk6Rh6niZP3PSUThyQpzkXp5hb5Tk38ALGUaFoGtd9fowmLHtgxiOjq7pbjghOFrz8vX+F9x/HDP/MAxn34ynphPeQVDVq5LM0trdQ3LENrYD7IM3z8OSjEFMlsmc2N7zUlegsLERWL/3F+OPFTAmI9+8BxVjmMX2SzbFSYhx4ARukpsATJwk8VNnEvoTL/Q9knukY4TeUOp6LlDrZqvt6uTW9GECzd3MJrrwLCNzh7wsu5JAw2sFrQuoCzN1hmOomonxmu30ldLdDJLkQI/4OBnhie/gzAscfzxxnbHvuc7Un7lZMMpmWRqY/Jj/jOh3dM6uMqLhz8iwrKjUCwmCh3KYs2VKFShp7xDwfUs2DcYp9oCin5Pc8ckEO2ka+k4wy71gRGbTLOjEtCdr3F9+sG+NUfc2o3oNNW3KuVtHZsz73cPmcr/R5+ld0UXzmYl7//b/Gd6C9zU70Ti/O9Fw+vl6cX2i7VW2+Hqfn2qcXKez5HT7ZD5P/llkfw9XoP8MKDQ3SLgZO5l2TdKUxcV3AAAA//8DAFBLAwQUAAYACAAAACEAXP/u5toCAAD8BgAADQAAAHhsL3N0eWxlcy54bWy0VcuK2zAU3Rf6D0J7jx+J0yTYHprJGAamUJgpdKvYciKqR5CU4LR0102/pKvuh276NWX6Gb2yncRhYGhn6CaRbnTPOfce6SY5rwVHW6oNUzLF4VmAEZWFKplcpvjdbe6NMTKWyJJwJWmKd9Tg8+zli8TYHac3K0otAghpUryydj31fVOsqCDmTK2phF8qpQWxsNVL36w1JaVxSYL7URCMfEGYxC3CVBR/AyKI/rBZe4USa2LZgnFmdw0WRqKYXi2l0mTBQWodDkmB6nCkI1TrPUkTfcAjWKGVUZU9A1xfVRUr6EO5E3/ik+KIBMhPQwpjP4hOaq/1E5GGvqZb5uzDWVIpaQ0q1EbaFEddIEvMR7QlHOyNsJ8lheJKIwsuQZNCF5FE0PbE/fev9z9+ulhFBOO7NtqmrYg24HaLNBi6Q43XXapg0HkX9J2KVsuRevLfeBo6A3yM89PaIZAlcEks1TKHDerWt7s1VC7hPrdym3Mu/ZHTS012YRT3EvyGMEsWSpfwfvZdD6HrbShLOK0sNESz5cp9W7WGz4WyFu5YlpSMLJUk3LVsn9EtoJyCcn7j3tj76gS7rpDciFzYqzLF8Fpds/dLKKFbtnjtJksIZ0spqATzqLascHehgC1t/aorUNDna9mfTYzq6l8VAGev9JPCDwKRu64p/nV39/vbF3iMHQlabBi3TLaUrqmHDMAs62MbA+eidUOiafCBBbpZ0opsuL09/Jji4/oNLdlGRIdTb9lW2QYixcf1tXM7HDkOWttrA08BvtFGsxR/upy9mswv88gbB7OxNxzQ2JvEs7kXDy9m83k+CaLg4nNvVD1jUDWTNUtg3k0Nh3Gmu2K7Em+OsRT3Nq385p6D7L72STQKXsdh4OWDIPSGIzL2xqNB7OVxGM1Hw9llnMc97fETB1rgh2E7Gp34eGqZoJzJvVd7h/pRMAm2jxTh753wj39b2R8AAAD//wMAUEsDBBQABgAIAAAAIQARCadEygcAABgiAAATAAAAeGwvdGhlbWUvdGhlbWUxLnhtbOxazY/cthW/F+j/QOg+HknzvfA4mE9v7N31wjt2kSN3hjOilxIFkrO7gyJA4JyCAAUKJEEuBYpeegiCBmiAGu2h/0td2EjTP6KPlGYk7nBirz/QtNidPUjU7z3++N7j4xOp2x9cxgydEyEpT7pecMv3EEmmfEaTRdd7NBlX2h6SCiczzHhCut6KSO+DO7/8xW28pyISEwTyidzDXS9SKt2rVuUUmrG8xVOSwLM5FzFWcCsW1ZnAF6A3ZtXQ95vVGNPEQwmOQe2D+ZxOCfrns7/98Iev//HJ5/Dv3Vn3MWLQUaKkbpgycaJ7IJagwc7OAo2QKzlgAp1j1vWguxm/mJBL5SGGpYIHXc83f171zu0q3suFmNohW5Ibm79cLheYnYWmT7E43XTqj8J2PdjoNwCmtnGjtv5t9BkAnk5hpBmXss6g0fTbYY4tgbJLh+5OK6jZ+JL+2hbnoNPsh3VLvwFl+uvbYxx3RsOGhTegDN/Ywvf8sN+pWXgDyvDNLXx91GuFIwtvQBGjydk2utlqt5s5egOZc7bvhHeaTb81zOEFCqJhE126izlP1K5Yi/ETLsYA0ECGFU2QWqVkjqcQzL1UcYmGVKYMrzyU4oRLaPbDIIDQq/vh5mcsjvcILklrXsBEbjVpPkhOBU1V17sHWr0S5MWzZ8+ffv/86V+ef/rp86d/Qgd0EalMlSW3j5NFWe7HP/7237/7BP3rz7//8Ysv3XhZxr/89rOXf/37T6mHqVaY4sVX3738/rsXX//mh2++cGjvCXxahk9oTCQ6IhfoIY9hgMYUNn9yKq4nMYkwtSRwBLodqkcqsoBHK8xcuD6xTfhYQJZxAe8un1hcTyKxVNTR8/0otoCHnLM+F04D3Nd9lSw8WSYLd+diWcY9xPjc1fcAJ5aDR8sU0it1qRxExKJ5zHCi8IIkRCH9jJ8R4hjdR5Radj2kU8Elnyv0EUV9TJ0mmdBTK5AKoX0ag19WLoLgass2h49RnzPXqIfk3EbCtMDMQX5CmGXGu3ipcOxSOcExKxv8AKvIRfJkJaZl3Egq8PSCMI5GMyKlS+aBgPGWnH4fQ2Jzuv2QrWIbKRQ9c+k8wJyXkUN+NohwnDo50yQqYz+UZxCiGB1z5YIfcnuG6HvwA052uvsxJZa7X50IHkGCK1MqAkQ/WQqHL+8Sbs/HFZtj4soyPRFb2bUnqDM6+suFFdoHhDB8gWeEoEcfOhj0eWrZvCB9L4Kssk9cgXUP27Gq7xMiCTJ1zXaKPKDSCtkTsuA7+ByuriSeFU5iLHZpPgKvW6F7KmAyOsb5gE3PysAjClUgxIvTKA8k6CgF92iX1uMIW2uXvpfueF0Jy3+vM8dgXj657rwEGXJtGUjsr22bCWZWB0XATDBFB650CyKW+wsRva4asaVTbm5P2sINUBhZ9U5Mk1cVP0dYCH7x36l93lvV41b8NvXOrryyf6XK2YX7H6xthniZHBNYTrYT101pc1PaeP/3pc2uuXxT0NwUNDcFjesV7L0UNEUNA+VNsdVjNn7infs+c8rYiVoxciDN1o+E15rZGBrNnpTZmNzsA6YRXOrxQAcWbiGwkUGCq19RFZ1EOIX9ocDsYi5krnohUcolbBuZZrOtSq7oNptPy/iQz7LtTrO/5GcmlFgV7X4DNp6ydtiqUhm62cobNb81dcN2YbZa1wS07HVIlDqzSdQcJFrrxleQ0Dtn74ZFx8GirdWvXbVlCqC28Qq8dyN4W+96jXrGCHbkoEafaT9lrl57VzvnnXp6lzFZOQJga3Hb0x3Ndefw9OiyUHsNT1skjFOysLJJGF+ZAk9G8DacR2d53/2nAu66vu4ULrXoaVOsZ0NBo9V+H77WSeRKbmBJOVOwBF3AHA9h0nloitOuN4d9Y7iMUwgeqd+9MFvAGcxUiWzGv0lqSYVUQyyjzOIm62T+iakiAjEadz09/k04sMQkkYxcB6buz5VcqCfcz40ceN32MpnPyVSV/V5q0ZbObiHFZ8nC+dSIvzlYS/IluPskml2gU7YUDzGEWKMVaO/OqITjgyBz9YzCedgmkxXxd2VlyrO/dchV5GPM0gjnS0o5m2dws6Bs6Ji7jQ1Kd/mYwaDbJjxd6BX2rZfdV6/V2nLF+tgpFk0rrehl051N398qX2JVrKIWqyx3X825nXWyg0B1LhNvv/aXqBWdWdQ04+08rJN23mpTe4cVQWn1ae6w22aRcFriTZd+kLsatXqFWBeWJvDN+Xn5bJufPoHkMYRTxCXLTrtZAnemtEyPhfHtKZ+t8ksms0ST+VwXpVkqf0jmiM4uu17oqhzzw+O8GmAJoE3NCzNsI+is9mxBvdjlotmE3QhnZeyVetUW3kisj1k3wmZr0UVbXa5P1HWtbnrWDstGbdKwsRRcbVsRjv8FhtI5O8zNci/kmUuVV9pwhZaCdr1f+41efRA2BhW/3RhV6rW6X2k3erVKr9GoBaNG4A/74cdAT0Vx0Mg+gBjDaRBb5Z9BmPatTyHi9YHXrSmPq9x86lA13jefQgSh61OIif7IwQNHAq1wFNTDXjioDIZBs1IPh81Ku1XrVQZhcxj2YNFujnsfe+jcgIP+cDgeN8JKcwC4ut9rVHr92qDSbI/64TgY1Yc+gPPl5xLeYnTOzW0Bl4bXnf8AAAD//wMAUEsDBBQABgAIAAAAIQDJFVyvFgIAAMsDAAAYAAAAeGwvd29ya3NoZWV0cy9zaGVldDEueG1snNNba4MwFADg98H+Q8i7jVrn2lI7tjrZ3sauzzEea2gukqQ3xv77oqXtoC9loKBHz3dyzHF6t5UCrcFYrlWGo0GIESimK64WGf54L4IRRtZRVVGhFWR4Bxbfza6vphttlrYBcMgLyma4ca6dEGJZA5LagW5B+Se1NpI6f2sWxLYGaNUnSUHiMEyJpFzhvTAxlxi6rjmDXLOVBOX2iAFBnV+/bXhrD5pkl3CSmuWqDZiWrSdKLrjb9ShGkk2eF0obWgrf9zZKKENb44/Yn8NDmT5+VklyZrTVtRt4mezXfN7+mIwJZUfpvP+LmCghBta828ATFf9vSdHN0YpP2PCfWHrEus9lJiteZfg7fbzNh1ERB0k+T4I0Tm6Dh5tiHiSPo3CYJsU4zvMfPJtW3O9w1xUyUGf4PsJkNu2H55PDxv65Ro6WbyCAOfAFIoy62Sy1XnYvPvtQ2KWSs9yin80Xg0pqYa7FF69c4wH/D1RQ05Vwr3rzBHzROB9NPfILAAD//wAAAP//sinOSE0tcUksSdS3AwAAAP//AAAA//80zcEKwjAQBNBfCfsBVhHppenFkwehvxDbbRLUnbBZFP/eKuQ2bw4zQ0kQtjxP6laIXRZPB3L2KexJcIa8WGuGUDcOJUS+Bo1Zqnvwap72u56c5phaNpR/eyJ3gxmeTYnDwvrTkbYnWMO2272h95qYbfwCAAD//wMAUEsDBBQABgAIAAAAIQDtiaT2oQEAABoDAAAQAAgBZG9jUHJvcHMvYXBwLnhtbCCiBAEooAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJySwW7bMAyG7wP2DobujZxuKIpAVjGkG3pYsQBJe+dkOhYmS4bEGsmeZZcdBvQNdtrbrMAeY7SNps7a024kf+LnJ4rqYte4rMOYbPCFmM9ykaE3obR+W4ibzYeTc5ElAl+CCx4LscckLvTrV2oVQ4uRLKaMLXwqRE3ULqRMpsYG0oxlz0oVYgPEadzKUFXW4GUwdw16kqd5fiZxR+hLLE/ag6EYHRcd/a9pGUzPl243+5aBtXrXts4aIH6lvrYmhhQqyq7BWE8h1dn7nUGn5LRNMecazV20tNe5ktNUrQ04XPIIXYFLqORTQV0h9OtbgY1Jq44WHRoKMUv2Ky/wVGSfIWEPVogOogVPDNi3jckQuzZR1A8/f/z+9e3P93slWR9rQzhtncb2rZ4PDRwcN/YGIwcLx4QbSw7Tp2oFkV4Ank+BB4YRd8RZ14g0zpzyDS/mSf94L0PTgt+zcIg+Wv8l3bSbcAmEj9s8Lqp1DRFL/oDDtg8FdcWLjK43Wdbgt1g+9jwX+iu4HU9dz89m+Zucv3VSU/LpqPVfAAAA//8DAFBLAwQUAAYACAAAACEAAbRx1j8BAABdAgAAEQAIAWRvY1Byb3BzL2NvcmUueG1sIKIEASigAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjJJRS8MwFIXfBf9DyXubpJ1zhLYDlT05EJwovoXkbis2aUii3f69abvVynzwMfec+91zL8mXB1VHX2Bd1egC0YSgCLRoZKV3BXrZrOIFipznWvK60VCgIzi0LK+vcmGYaCw82caA9RW4KJC0Y8IUaO+9YRg7sQfFXRIcOojbxiruw9PusOHig+8Ap4TMsQLPJfccd8DYjER0QkoxIs2nrXuAFBhqUKC9wzSh+MfrwSr3Z0OvTJyq8kcTdjrFnbKlGMTRfXDVaGzbNmmzPkbIT/Hb+vG5XzWudHcrAajMpWDCAveNLXl6S7JFjiel7nw1d34dLr2tQN4dR9elElh99AEIMgph2BD9rLxm9w+bFSpTks5iksX0dkPmjFJ2k753g3/1d+GGgjqN/z8xZXQ2IZ4BZY4vPkT5DQAA//8DAFBLAQItABQABgAIAAAAIQCkU8XPTgEAAAgEAAATAAAAAAAAAAAAAAAAAAAAAABbQ29udGVudF9UeXBlc10ueG1sUEsBAi0AFAAGAAgAAAAhALVVMCP0AAAATAIAAAsAAAAAAAAAAAAAAAAAhwMAAF9yZWxzLy5yZWxzUEsBAi0AFAAGAAgAAAAhAI2H2nDgAAAALQIAABoAAAAAAAAAAAAAAAAArAYAAHhsL19yZWxzL3dvcmtib29rLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAKvyIgCYAwAA9wgAAA8AAAAAAAAAAAAAAAAAzAgAAHhsL3dvcmtib29rLnhtbFBLAQItABQABgAIAAAAIQBc/+7m2gIAAPwGAAANAAAAAAAAAAAAAAAAAJEMAAB4bC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhABEJp0TKBwAAGCIAABMAAAAAAAAAAAAAAAAAlg8AAHhsL3RoZW1lL3RoZW1lMS54bWxQSwECLQAUAAYACAAAACEAyRVcrxYCAADLAwAAGAAAAAAAAAAAAAAAAACRFwAAeGwvd29ya3NoZWV0cy9zaGVldDEueG1sUEsBAi0AFAAGAAgAAAAhAO2JpPahAQAAGgMAABAAAAAAAAAAAAAAAAAA3RkAAGRvY1Byb3BzL2FwcC54bWxQSwECLQAUAAYACAAAACEAAbRx1j8BAABdAgAAEQAAAAAAAAAAAAAAAAC0HAAAZG9jUHJvcHMvY29yZS54bWxQSwUGAAAAAAkACQA+AgAAKh8AAAAA' +); diff --git a/packages/office-viewer/src/excel/io/excel/__tests__/parseSharedStrings.test.ts b/packages/office-viewer/src/excel/io/excel/__tests__/parseSharedStrings.test.ts new file mode 100644 index 000000000..2f7c6bc20 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/__tests__/parseSharedStrings.test.ts @@ -0,0 +1,200 @@ +import {parseSharedStrings} from '../parseSharedStrings'; + +test('sharedString', async () => { + const result = await parseSharedStrings( + ` + + + text + + + + background + + + + + + + + + + + + rich + + + + + + + + + + + t + + + + + + + + + + e + + + + + + + + + + + x + + + + + + + + + + t + + + + + + + + + + d + + + + + bold + + + + italic + + + + underline + + + + bottom align + + + + top align + + + + align right + + + + align center + + + ` + ); + expect(result).toEqual([ + 'text', + 'background', + { + richText: [ + { + rPr: { + sz: 12, + color: { + rgb: 'FFFF0000' + }, + rFont: '等线', + family: 3, + charset: 134 + }, + t: 'rich' + }, + { + rPr: { + sz: 12, + color: { + theme: 1 + }, + rFont: '等线', + family: 2, + charset: 134, + scheme: 'minor' + }, + t: 't' + }, + { + rPr: { + sz: 14, + color: { + theme: 1 + }, + rFont: '等线', + family: 3, + charset: 134 + }, + t: 'e' + }, + { + rPr: { + sz: 12, + color: { + theme: 1 + }, + rFont: '等线', + family: 2, + charset: 134, + scheme: 'minor' + }, + t: 'x' + }, + { + rPr: { + sz: 14, + color: { + theme: 1 + }, + rFont: '等线', + family: 3, + charset: 134 + }, + t: 't' + }, + { + rPr: { + sz: 12, + color: { + theme: 1 + }, + rFont: '等线', + family: 4, + charset: 134 + }, + t: 'd' + } + ], + type: 'rich' + }, + 'bold', + 'italic', + 'underline', + 'bottom align', + 'top align', + 'align right', + 'align center' + ]); +}); diff --git a/packages/office-viewer/src/excel/io/excel/drawing/getRelationPath.ts b/packages/office-viewer/src/excel/io/excel/drawing/getRelationPath.ts new file mode 100644 index 000000000..bc1d8aefc --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/drawing/getRelationPath.ts @@ -0,0 +1,16 @@ +import {joinPath} from '../../../../util/joinPath'; +import {IRelationship} from '../../../types/IRelationship'; + +export function getRelationPath( + drawingPath: string, + relationships: IRelationship[], + rId: string +) { + const relationship = relationships.find( + relationship => relationship.id === rId + ); + if (relationship) { + return joinPath(drawingPath, '..', relationship.target); + } + return null; +} diff --git a/packages/office-viewer/src/excel/io/excel/drawing/parseAnchorCommon.ts b/packages/office-viewer/src/excel/io/excel/drawing/parseAnchorCommon.ts new file mode 100644 index 000000000..8aec55232 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/drawing/parseAnchorCommon.ts @@ -0,0 +1,60 @@ +import {PackageParser} from '../../../../package/PackageParser'; +import {XMLNode, getNodeByTagName, xml2json} from '../../../../util/xml'; +import {IAnchorCommon} from '../../../types/IDrawing'; +import {IRelationship} from '../../../types/IRelationship'; +import {IWorkbook} from '../../../types/IWorkbook'; +import {getRelationPath} from './getRelationPath'; +import {parseChart} from './parseChart'; +import {parsePic} from './parsePic'; +import {parseShape} from './parseShape'; + +/** + * 解析一些 anchor 的通用属性,这些属性大多需要读取另一个文件,所以直接在这里解析简化后续操作 + */ +export async function parseAnchorCommon( + workbook: IWorkbook, + parser: PackageParser, + drawingPath: string, + drawingNode: XMLNode, + relationships: IRelationship[], + anchorCommon: IAnchorCommon, + element: Element +) { + for (const child of drawingNode.children || []) { + const tag = child.tag; + switch (tag) { + case 'xdr:pic': + anchorCommon.pic = parsePic(child, relationships, parser, drawingPath); + break; + + case 'xdr:sp': + anchorCommon.shape = parseShape(workbook, child, element); + break; + + case 'xdr:from': + case 'xdr:to': + case 'xdr:clientData': + // 这些前面已经自动解析了 + break; + + case 'xdr:graphicFrame': + // 目就支持图表这种形式 + const chartNode = getNodeByTagName(child, 'c:chart', true); + if (chartNode) { + const chartPath = getRelationPath( + drawingPath, + relationships, + chartNode.attrs['r:id'] + ); + if (chartPath) { + const chartXML = await xml2json(parser.getString(chartPath)); + anchorCommon.chartSpace = parseChart(chartXML); + } + } + break; + + default: + console.warn(`unhandled tag: ${tag}`); + } + } +} diff --git a/packages/office-viewer/src/excel/io/excel/drawing/parseChart.ts b/packages/office-viewer/src/excel/io/excel/drawing/parseChart.ts new file mode 100644 index 000000000..fb2af0f04 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/drawing/parseChart.ts @@ -0,0 +1,15 @@ +import {autoParse} from '../../../../common/autoParse'; +import { + CT_ChartSpace, + CT_ChartSpace_Attributes +} from '../../../../openxml/ChartTypes'; +import {XMLNode} from '../../../../util/xml'; +import {IChartSpace} from '../../../types/IChartSpace'; + +let chartId = 0; + +export function parseChart(node: XMLNode) { + const chart = autoParse(node, CT_ChartSpace_Attributes) as IChartSpace; + chart.gid = `chart${chartId++}`; + return chart; +} diff --git a/packages/office-viewer/src/excel/io/excel/drawing/parseDrawing.ts b/packages/office-viewer/src/excel/io/excel/drawing/parseDrawing.ts new file mode 100644 index 000000000..bfef8b99e --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/drawing/parseDrawing.ts @@ -0,0 +1,127 @@ +import {autoParse} from '../../../../common/autoParse'; +import {parseRelationship} from '../../../../common/parseRelationship'; +import { + CT_AbsoluteAnchor_Attributes, + CT_OneCellAnchor_Attributes, + CT_Picture_Attributes, + CT_TwoCellAnchor_Attributes +} from '../../../../openxml/ExcelTypes'; +import {PackageParser} from '../../../../package/PackageParser'; +import {joinPath} from '../../../../util/joinPath'; +import {parseXML, xml2json} from '../../../../util/xml'; +import {IDrawing} from '../../../types/IDrawing'; +import {IRelationship} from '../../../types/IRelationship'; +import {IWorkbook} from '../../../types/IWorkbook'; +import {getRelPath} from '../getRelPath'; +import {parseAnchorCommon} from './parseAnchorCommon'; + +/** + * 解析 xl/drawings/drawing1.xml 文件 + * P3155 + */ +export async function parseDrawing( + workbook: IWorkbook, + parser: PackageParser, + drawingPath: string +) { + const drawing: IDrawing = { + oneCellAnchors: [], + twoCellAnchors: [], + absoluteAnchors: [] + }; + const drawingXML = parser.getString(drawingPath); + + let relationships: IRelationship[] = []; + + const drawingRelationPath = getRelPath(drawingPath); + + if (parser.fileExists(drawingRelationPath)) { + relationships = await parseRelationship( + parser.getString(drawingRelationPath) + ); + } + + const node = await xml2json(drawingXML); + + // 因为要用到 Word 里之前的方法,而之前的方法是使用 DOMParser 的,所以这里也用 DOMParser,后面再统一成 xml2json 版本 + const nodeElement = parseXML(drawingXML); + + const oneCellAnchorElements = + nodeElement.getElementsByTagName('xdr:oneCellAnchor'); + + const twoCellAnchorElements = + nodeElement.getElementsByTagName('xdr:twoCellAnchor'); + + const absoluteAnchorElements = + nodeElement.getElementsByTagName('xdr:absoluteAnchor'); + + for (const [index, drawingNode] of (node.children || []).entries()) { + const childTag = drawingNode.tag; + switch (childTag) { + case 'xdr:oneCellAnchor': + const oneCellAnchor = autoParse( + drawingNode, + CT_OneCellAnchor_Attributes + ); + + const oneCellAnchorElement = oneCellAnchorElements[index]; + + await parseAnchorCommon( + workbook, + parser, + drawingPath, + drawingNode, + relationships, + oneCellAnchor, + oneCellAnchorElement + ); + + drawing.oneCellAnchors.push(oneCellAnchor); + break; + + case 'xdr:twoCellAnchor': + // 不知为何这个定义里不包含 pic + const twoCellAnchor = autoParse( + drawingNode, + CT_TwoCellAnchor_Attributes + ); + + const twoCellAnchorElement = twoCellAnchorElements[index]; + + await parseAnchorCommon( + workbook, + parser, + drawingPath, + drawingNode, + relationships, + twoCellAnchor, + twoCellAnchorElement + ); + drawing.twoCellAnchors.push(twoCellAnchor); + break; + + case 'xdr:absoluteAnchor': + const absoluteAnchor = autoParse( + drawingNode, + CT_AbsoluteAnchor_Attributes + ); + const absoluteAnchorElement = absoluteAnchorElements[index]; + await parseAnchorCommon( + workbook, + parser, + drawingPath, + drawingNode, + relationships, + absoluteAnchor, + absoluteAnchorElement + ); + drawing.absoluteAnchors.push(absoluteAnchor); + break; + + default: + console.warn(`unhandled tag: ${childTag}`); + } + } + + return drawing; +} diff --git a/packages/office-viewer/src/excel/io/excel/drawing/parsePic.ts b/packages/office-viewer/src/excel/io/excel/drawing/parsePic.ts new file mode 100644 index 000000000..5223b26df --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/drawing/parsePic.ts @@ -0,0 +1,30 @@ +import {autoParse} from '../../../../common/autoParse'; +import {CT_Picture_Attributes} from '../../../../openxml/ExcelTypes'; +import {PackageParser} from '../../../../package/PackageParser'; +import {joinPath} from '../../../../util/joinPath'; +import {XMLNode} from '../../../../util/xml'; +import {IRelationship} from '../../../types/IRelationship'; +import {getRelationPath} from './getRelationPath'; + +let picId = 0; + +export function parsePic( + child: XMLNode, + relationships: IRelationship[], + parser: PackageParser, + drawingPath: string +) { + const pic = autoParse(child, CT_Picture_Attributes); + const embedId = pic.blipFill?.blip?.['r:embed']; + if (embedId) { + const imagePath = getRelationPath(drawingPath, relationships, embedId); + if (imagePath) { + const data = parser.getFileByType(imagePath, 'blob'); + if (data && URL.createObjectURL) { + pic.imgURL = URL.createObjectURL(data as Blob); + pic.gid = `pic-${picId++}`; + } + } + } + return pic; +} diff --git a/packages/office-viewer/src/excel/io/excel/drawing/parseShape.ts b/packages/office-viewer/src/excel/io/excel/drawing/parseShape.ts new file mode 100644 index 000000000..e163bc387 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/drawing/parseShape.ts @@ -0,0 +1,134 @@ +import {autoParse} from '../../../../common/autoParse'; +import {CT_Shape_Attributes} from '../../../../openxml/ExcelTypes'; +import {parseOutline} from '../../../../openxml/drawing/ShapeProperties'; +import {XMLNode} from '../../../../util/xml'; +import {parseChildColor} from '../../../../word/parse/parseChildColor'; +import {getThemeColor} from '../../../data/getThemeColor'; +import {IShape, StyleColor} from '../../../types/IDrawing'; +import {IRElt} from '../../../types/IRElt'; +import {IRPrElt} from '../../../types/IRPrElt'; +import {IWorkbook} from '../../../types/IWorkbook'; + +export function parseShape( + workbook: IWorkbook, + child: XMLNode, + twoCellAnchorElement: Element +) { + const shape = autoParse(child, CT_Shape_Attributes) as IShape; + // 下面是转成渲染需要的数据 + if (twoCellAnchorElement) { + const spPrs = twoCellAnchorElement.getElementsByTagName('xdr:spPr'); + if (spPrs.length && shape.spPr) { + const spPr = spPrs[0]; + for (const spPrChild of spPr.children || []) { + const tag = spPrChild.tagName; + switch (tag) { + case 'a:ln': + const outline = parseOutline(c => { + return getThemeColor(c, workbook); + }, spPrChild); + shape.spPr.outline = outline; + break; + case 'a:solidFill': + shape.spPr.fillColor = parseChildColor(c => { + return getThemeColor(c, workbook); + }, spPrChild); + break; + + default: + break; + } + } + } + + const style = twoCellAnchorElement.getElementsByTagName('xdr:style'); + if (style.length) { + const styleColor: StyleColor = {}; + shape.styleColor = styleColor; + for (const styleChild of style[0].children || []) { + const tagName = styleChild.tagName; + switch (tagName) { + case 'a:lnRef': + styleColor.lnRefColor = parseChildColor(c => { + return getThemeColor(c, workbook); + }, styleChild); + break; + case 'a:fillRef': + styleColor.fillRefColor = parseChildColor(c => { + return getThemeColor(c, workbook); + }, styleChild); + break; + case 'a:effectRef': + styleColor.effectRefColor = parseChildColor(c => { + return getThemeColor(c, workbook); + }, styleChild); + break; + case 'a:fontRef': + styleColor.fontRefColor = parseChildColor(c => { + return getThemeColor(c, workbook); + }, styleChild); + break; + + default: + break; + } + } + } + + const txBodies = twoCellAnchorElement.getElementsByTagName('xdr:txBody'); + if (txBodies.length) { + const txBody = txBodies[0]; + const ts: IRElt[] = []; + // 转成富文本格式方便渲染 + const ps = txBody.getElementsByTagName('a:p'); + for (const p of ps) { + const rs = p.getElementsByTagName('a:r'); + for (const r of rs) { + const t = r.getElementsByTagName('a:t'); + if (t.length) { + const rPrNodes = r.getElementsByTagName('a:rPr'); + let rPr: IRPrElt = {}; + if (rPrNodes.length) { + const rPrNode = rPrNodes[0]; + const sz = rPrNode.getAttribute('sz'); + if (sz) { + // 不知为何拿到的是 100 倍的值 + rPr.sz = parseInt(sz, 10) / 100; + } + + const b = rPrNode.getAttribute('b'); + if (b) { + rPr.b = true; + } + + const solidFill = rPrNode.getElementsByTagName('a:solidFill'); + + if (solidFill.length) { + rPr.color = { + rgb: parseChildColor(c => { + return getThemeColor(c, workbook); + }, solidFill[0]) + }; + } + } + + const text = t[0].textContent; + if (text) { + ts.push({ + rPr, + t: text + }); + } + } + } + } + + shape.richText = { + type: 'rich', + richText: ts + }; + } + } + + return shape; +} diff --git a/packages/office-viewer/src/excel/io/excel/getRelPath.ts b/packages/office-viewer/src/excel/io/excel/getRelPath.ts new file mode 100644 index 000000000..8660e728b --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/getRelPath.ts @@ -0,0 +1,9 @@ +/** + * 获取 rels 文件的相对路径,比如将 xl/worksheets/sheet1.xml 转换为 xl/worksheets/_rels/sheet1.xml.rels + */ + +export function getRelPath(path: string) { + const arr = path.split('/'); + arr[arr.length - 1] = '_rels/' + arr[arr.length - 1] + '.rels'; + return arr.join('/'); +} diff --git a/packages/office-viewer/src/excel/io/excel/initValueForContainsBlanks.ts b/packages/office-viewer/src/excel/io/excel/initValueForContainsBlanks.ts new file mode 100644 index 000000000..0e77c4556 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/initValueForContainsBlanks.ts @@ -0,0 +1,25 @@ +import {IWorksheet} from '../../types/IWorksheet'; +import {parseRange} from './util/Range'; +import {makeBlankValue} from './util/makeBlankValue'; + +/** + * 后面判断 containsBlanks 时需要单元格有值,不然 getViewPointData 会拿不到数据导致无法判断 + * 这个方法的作用是保证在 containsBlanks 检测范围内的单元格都有值 + */ +export function initValueForContainsBlanks(worksheet: IWorksheet) { + for (const formatting of worksheet.conditionalFormatting) { + const cfRules = formatting.cfRule || []; + for (const cfRule of cfRules) { + if (cfRule.type === 'containsBlanks') { + const sqref = formatting.sqref; + if (!sqref) { + continue; + } + const ranges = sqref.split(' ').map(parseRange); + for (const range of ranges) { + makeBlankValue(worksheet.cellData, range); + } + } + } + } +} diff --git a/packages/office-viewer/src/excel/io/excel/initValueForTable.ts b/packages/office-viewer/src/excel/io/excel/initValueForTable.ts new file mode 100644 index 000000000..ac1fcd795 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/initValueForTable.ts @@ -0,0 +1,19 @@ +import {IWorksheet} from '../../types/IWorksheet'; +import {parseRange} from './util/Range'; +import {makeBlankValue} from './util/makeBlankValue'; + +/** + * 表格渲染需要有值,所以加个空值 + */ +export function initValueForTable(worksheet: IWorksheet) { + const tableParts = worksheet.tableParts || []; + + for (const tablePart of tableParts) { + if (!tablePart.ref) { + console.warn('表格缺少 ref 字段', tablePart); + continue; + } + const ref = parseRange(tablePart.ref); + makeBlankValue(worksheet.cellData, ref); + } +} diff --git a/packages/office-viewer/src/excel/io/excel/parseDefinedNames.ts b/packages/office-viewer/src/excel/io/excel/parseDefinedNames.ts new file mode 100644 index 000000000..d6be91b1b --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseDefinedNames.ts @@ -0,0 +1,10 @@ +import {parseChildrenAttributes} from '../../../common/parseAttributes'; +import {CT_DefinedName_Attributes} from '../../../openxml/ExcelTypes'; +import {XMLNode} from '../../../util/xml'; + +/** + * 解析 definedNames + */ +export function parseDefinedNames(node: XMLNode) { + return parseChildrenAttributes(node, CT_DefinedName_Attributes); +} diff --git a/packages/office-viewer/src/excel/io/excel/parseSharedStrings.ts b/packages/office-viewer/src/excel/io/excel/parseSharedStrings.ts new file mode 100644 index 000000000..9830392eb --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseSharedStrings.ts @@ -0,0 +1,128 @@ +/** + * 解析 sharedStrings.xml 文件 + */ + +import {ST_FontScheme, ST_VerticalAlignRun} from '../../../openxml/ExcelTypes'; +import {XMLNode, xml2json} from '../../../util/xml'; +import {IRPrElt} from '../../types/IRPrElt'; +import {RichText} from '../../types/RichText'; +import {StringItem} from '../../types/StringItem'; +import {parseColor} from './stylesheet/parseColor'; + +/** + * 解析 CT_RPrElt + */ +function parseRPr(node: XMLNode) { + const rPr: IRPrElt = {}; + for (const child of node.children || []) { + const tag = child.tag; + + switch (tag) { + case 'rFont': + rPr.rFont = child.attrs.val; + break; + case 'charset': + rPr.charset = parseInt(child.attrs.val, 10); + break; + case 'family': + rPr.family = parseInt(child.attrs.val, 10); + break; + case 'b': + rPr.b = true; + break; + case 'i': + rPr.i = true; + break; + case 'strike': + rPr.strike = true; + break; + case 'outline': + rPr.outline = true; + break; + case 'shadow': + rPr.shadow = true; + break; + case 'condense': + rPr.condense = true; + break; + case 'extend': + rPr.extend = true; + break; + case 'color': + rPr.color = parseColor(child); + break; + case 'sz': + rPr.sz = parseInt(child.attrs.val, 10); + break; + case 'u': + rPr.u = true; + break; + case 'vertAlign': + rPr.vertAlign = child.attrs.val as ST_VerticalAlignRun; + break; + case 'scheme': + rPr.scheme = child.attrs.val as ST_FontScheme; + break; + + default: + console.warn(`parseRPr: ${tag} is not supported`); + } + } + return rPr; +} + +/** + * 这里接口使用字符串是为了方便单测 + * @param xml + */ +export async function parseSharedStrings(xml: string) { + const sharedStrings: StringItem[] = []; + if (!xml) { + return sharedStrings; + } + + // 对应 CT_Sst 类型,子节点只有可能是 si 或 extLst + const sst = await xml2json(xml); + for (const si of sst.children || []) { + // 对应 CT_Rst 类型,子节点只有可能是 t、r、rPh、phoneticPr + if (si.tag === 'si') { + let isSimple = true; + let text = ''; + let richText: RichText = { + type: 'rich', + richText: [] + }; + for (const rst of si.children || []) { + if (rst.tag === 'r') { + isSimple = false; + let rPr = {}; + let t = ''; + // 对应 CT_RElt + for (const relt of rst.children || []) { + const tag = relt.tag; + if (tag === 'rPr') { + rPr = parseRPr(relt); + } + if (tag === 't') { + t = relt.text || ''; + } + } + richText.richText.push({ + rPr, + t + }); + } + if (rst.tag === 't') { + text = rst.text || ''; + } + } + if (isSimple) { + sharedStrings.push(text); + } else { + sharedStrings.push(richText); + } + } + } + + return sharedStrings; +} diff --git a/packages/office-viewer/src/excel/io/excel/parseSheet.ts b/packages/office-viewer/src/excel/io/excel/parseSheet.ts new file mode 100644 index 000000000..9b3d0383f --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseSheet.ts @@ -0,0 +1,61 @@ +/** + * 解析 sheet,并集成 sheet 里的数据 + */ + +import {XMLNode} from '../../../util/xml'; +import {StringItem} from '../../types/StringItem'; +import {ISheet, ISheet_Attributes} from '../../types/ISheet'; +import {IWorkbook} from '../../types/IWorkbook'; + +import {PackageParser} from '../../../package/PackageParser'; +import {parseWorksheet} from './parseWorksheet'; +import {IWorksheet} from '../../types/IWorksheet'; +import {parseRelationship} from '../../../common/parseRelationship'; +import {IRelationship} from '../../types/IRelationship'; +import {autoParse} from '../../../common/autoParse'; +import {getRelPath} from './getRelPath'; + +export async function parseSheets( + node: XMLNode, + parser: PackageParser, + workbook: IWorkbook, + sharedStrings: StringItem[] +) { + const sheets: ISheet[] = []; + for (const sheetNode of node.children || []) { + const sheet = autoParse(sheetNode, ISheet_Attributes) as ISheet; + sheets.push(sheet); + + // 读取 sheet 里的数据 + const rId = sheet['r:id']; + const state = sheet.state; + const relationship = workbook.workbookRelationships?.find( + relationship => relationship.id === rId + ); + + const target = relationship?.target; + if (target) { + // 有些老文件是绝对路径 + const worksheetPath = target.startsWith('/') ? target : `xl/${target}`; + const sheetXML = parser.getString(worksheetPath); + if (sheetXML) { + const worksheetRelationPath = getRelPath(worksheetPath); + let worksheetRelationships: IRelationship[] = []; + if (parser.fileExists(worksheetRelationPath)) { + worksheetRelationships = await parseRelationship( + parser.getString(worksheetRelationPath) + ); + } + sheet.worksheet = (await parseWorksheet( + workbook, + parser, + worksheetPath, + sheetXML, + worksheetRelationships, + sharedStrings + )) as IWorksheet; + } + } + } + return sheets; +} diff --git a/packages/office-viewer/src/excel/io/excel/parseTableParts.ts b/packages/office-viewer/src/excel/io/excel/parseTableParts.ts new file mode 100644 index 000000000..885a22df9 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseTableParts.ts @@ -0,0 +1,31 @@ +import {autoParse} from '../../../common/autoParse'; +import {CT_Table, CT_Table_Attributes} from '../../../openxml/ExcelTypes'; +import {PackageParser} from '../../../package/PackageParser'; +import {joinPath} from '../../../util/joinPath'; +import {XMLNode, xml2json} from '../../../util/xml'; +import {IRelationship} from '../../types/IRelationship'; + +export async function parseTableParts( + worksheetPath: string, + parser: PackageParser, + relationships: IRelationship[], + tablePartsNode: XMLNode +) { + const tables: CT_Table[] = []; + + for (const tableParts of tablePartsNode.children || []) { + const rId = tableParts.attrs['r:id']; + + const relationship = relationships.find( + relationship => relationship.id === rId + ); + if (relationship) { + const target = relationship.target; + const path = joinPath(worksheetPath, '..', target); + const tableXML = parser.getString(path); + const tableNode = await xml2json(tableXML); + tables.push(autoParse(tableNode, CT_Table_Attributes)); + } + } + return tables; +} diff --git a/packages/office-viewer/src/excel/io/excel/parseTableStyleDef.ts b/packages/office-viewer/src/excel/io/excel/parseTableStyleDef.ts new file mode 100644 index 000000000..6ea17ece0 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseTableStyleDef.ts @@ -0,0 +1,26 @@ +import {autoParse} from '../../../common/autoParse'; +import { + CT_Dxfs_Attributes, + CT_TableStyles_Attributes +} from '../../../openxml/ExcelTypes'; +import {XMLNode} from '../../../util/xml'; +import {TableStyleDef} from '../../types/TableStyleDef'; + +export function parseTableStyleDef(node: XMLNode): TableStyleDef | null { + let dxfs; + let tableStyles; + for (const child of node.children) { + if (child.tag === 'dxfs') { + dxfs = autoParse(child, CT_Dxfs_Attributes); + } else if (child.tag === 'tableStyles') { + tableStyles = autoParse(child, CT_TableStyles_Attributes); + } + } + if (!dxfs || !tableStyles) { + return null; + } + return { + dxfs, + tableStyles + }; +} diff --git a/packages/office-viewer/src/excel/io/excel/parseTheme.ts b/packages/office-viewer/src/excel/io/excel/parseTheme.ts new file mode 100644 index 000000000..313dd8bf0 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseTheme.ts @@ -0,0 +1,34 @@ +/** + * 解析主题,由于类型冲突,这里是用 DMLTypes + * @param xml + */ + +import {autoParse} from '../../../common/autoParse'; +import {CT_OfficeStyleSheet_Attributes} from '../../../openxml/DMLTypes'; +import {xml2json} from '../../../util/xml'; +import {CT_Theme} from '../../types/CT_Theme'; + +export async function parseTheme(xml: string): Promise { + if (!xml) { + throw new Error('xml is empty'); + } + const node = await xml2json(xml); + const theme = autoParse(node, CT_OfficeStyleSheet_Attributes, true); + + // 因为后面查询是根据索引,所以这里将属性转成索引 + const colorList: string[] = []; + for (const key in theme?.themeElements?.clrScheme || {}) { + // 解析后包含了 name 属性,这里要过滤掉 + if (key === 'name') { + continue; + } + const color = theme?.themeElements?.clrScheme[key]; + colorList.push(color); + } + + if (theme.themeElements) { + theme.themeElements.clrSchemes = colorList; + } + + return theme; +} diff --git a/packages/office-viewer/src/excel/io/excel/parseWorkbook.ts b/packages/office-viewer/src/excel/io/excel/parseWorkbook.ts new file mode 100644 index 000000000..a4ea25861 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseWorkbook.ts @@ -0,0 +1,85 @@ +import {PackageParser} from '../../../package/PackageParser'; +import {xml2json} from '../../../util/xml'; +import {IWorkbook} from '../../types/IWorkbook'; + +import {parseDefinedNames} from './parseDefinedNames'; +import {parseSheets} from './parseSheet'; +import {parseWorkbookPr} from './parseWorkbookPr'; +import {parseWorkbookView} from './parseWorkbookView'; +import {parseRelationship} from '../../../common/parseRelationship'; +import {parseSharedStrings} from './parseSharedStrings'; + +import {CT_CalcPr_Attributes, CT_Stylesheet} from '../../../openxml/ExcelTypes'; +import {parseTheme} from './parseTheme'; +import {StringItem} from '../../types/StringItem'; +import {autoParse} from '../../../common/autoParse'; +import {defaultThemeString} from './preset/defaultTheme'; + +/** + * 解析 WorkBook + * @param xml workbook.xml 文件内容 + */ +export async function parseWorkbook( + parser: PackageParser, + styleSheet: CT_Stylesheet +): Promise { + // 理论上这里应该是通过 _rels/.rels 来获取,但这个文件位置几乎不会变,所以直接写死 + const workbookXML = parser.getString('xl/workbook.xml'); + + // 这个要在前面,因为后面有些解析依赖这个数据 + const workbookRelationships = await parseRelationship( + parser.getString('xl/_rels/workbook.xml.rels') + ); + + const node = await xml2json(workbookXML); + + const workbookPr = parseWorkbookPr(node); + + const workbookView = parseWorkbookView(node); + + let theme; + + if (parser.fileExists('xl/theme/theme1.xml')) { + theme = await parseTheme(parser.getString('xl/theme/theme1.xml')); + } else { + theme = await parseTheme(defaultThemeString); + } + + const workbook: IWorkbook = { + sheets: [], + workbookPr, + workbookView, + workbookRelationships, + styleSheet, + theme + }; + + let sharedStrings: StringItem[] = []; + if (parser.fileExists('xl/sharedStrings.xml')) { + sharedStrings = await parseSharedStrings( + parser.getString('xl/sharedStrings.xml') + ); + } + + for (const child of node.children || []) { + const tag = child.tag; + switch (tag) { + case 'sheets': + workbook.sheets = await parseSheets( + child, + parser, + workbook, + sharedStrings + ); + break; + case 'calcPr': + workbook.calcPr = autoParse(child, CT_CalcPr_Attributes); + break; + case 'definedNames': + workbook.definedNames = parseDefinedNames(child); + break; + } + } + + return workbook; +} diff --git a/packages/office-viewer/src/excel/io/excel/parseWorkbookPr.ts b/packages/office-viewer/src/excel/io/excel/parseWorkbookPr.ts new file mode 100644 index 000000000..8587cbdc5 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseWorkbookPr.ts @@ -0,0 +1,14 @@ +import {autoParse} from '../../../common/autoParse'; +import { + CT_WorkbookPr, + CT_WorkbookPr_Attributes +} from '../../../openxml/ExcelTypes'; +import {XMLNode, getNodeByTagName} from '../../../util/xml'; + +/** + * workbook 配置项,这个要优先处理 + */ +export function parseWorkbookPr(workbookNode: XMLNode): CT_WorkbookPr { + const workbookPrNode = getNodeByTagName(workbookNode, 'workbookPr'); + return autoParse(workbookPrNode, CT_WorkbookPr_Attributes); +} diff --git a/packages/office-viewer/src/excel/io/excel/parseWorkbookView.ts b/packages/office-viewer/src/excel/io/excel/parseWorkbookView.ts new file mode 100644 index 000000000..76f30fa6e --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseWorkbookView.ts @@ -0,0 +1,11 @@ +import {autoParse} from '../../../common/autoParse'; +import {CT_BookView, CT_BookView_Attributes} from '../../../openxml/ExcelTypes'; +import {XMLNode, getNodeByTagName} from '../../../util/xml'; + +/** + * workbookView 配置项,后续依赖这个来延迟解析 sheet + */ +export function parseWorkbookView(workbookNode: XMLNode): CT_BookView { + const workbookViewNode = getNodeByTagName(workbookNode, 'workbookView', true); + return autoParse(workbookViewNode, CT_BookView_Attributes); +} diff --git a/packages/office-viewer/src/excel/io/excel/parseWorksheet.ts b/packages/office-viewer/src/excel/io/excel/parseWorksheet.ts new file mode 100644 index 000000000..145587df3 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/parseWorksheet.ts @@ -0,0 +1,165 @@ +import {xml2json} from '../../../util/xml'; +import {IWorksheet} from '../../types/IWorksheet'; + +import {StringItem} from '../../types/StringItem'; +import {parseChildrenAttributes} from '../../../common/parseAttributes'; + +import {parseSheetData} from './worksheet/parseSheetData'; +import { + CT_AutoFilter_Attributes, + CT_Col_Attributes, + CT_ConditionalFormatting_Attributes, + CT_SheetFormatPr_Attributes, + CT_SheetPr_Attributes, + CT_SheetView_Attributes +} from '../../../openxml/ExcelTypes'; +import {decodeAddress} from './util/decodeAddress'; +import {IRelationship} from '../../types/IRelationship'; +import {PackageParser} from '../../../package/PackageParser'; +import {joinPath} from '../../../util/joinPath'; +import {parseDrawing} from './drawing/parseDrawing'; +import {autoParse} from '../../../common/autoParse'; +import {CT_ExtensionList_Attributes} from '../../types/CT_ExtensionList'; +import {initValueForContainsBlanks} from './initValueForContainsBlanks'; +import {parseTableParts} from './parseTableParts'; +import {initValueForTable} from './initValueForTable'; +import {IWorkbook} from '../../types/IWorkbook'; + +/** + * 解析 xl/worksheets/sheet*.xml 文件 + */ +export async function parseWorksheet( + workbook: IWorkbook, + parser: PackageParser, + worksheetPath: string, + xml: string, + relationships: IRelationship[], + sharedStrings: StringItem[] +) { + if (!xml) { + return null; + } + const node = await xml2json(xml); + const worksheet: IWorksheet = { + cols: [], + rows: [], + cellData: [], + mergeCells: [], + conditionalFormatting: [] + }; + for (const child of node.children) { + const tag = child.tag; + switch (tag) { + case 'dimension': + worksheet.dimension = { + ref: child.attrs.ref + }; + break; + + case 'sheetViews': + worksheet.sheetViews = parseChildrenAttributes( + child, + CT_SheetView_Attributes, + true + ); + break; + + case 'sheetFormatPr': + worksheet.sheetFormatPr = autoParse(child, CT_SheetFormatPr_Attributes); + break; + + case 'cols': + const cols = parseChildrenAttributes(child, CT_Col_Attributes); + // 修正一下索引为 0 开始 + for (const col of cols) { + col.min = (col.min || 1) - 1; + col.max = (col.max || 1) - 1; + } + worksheet.cols = cols; + break; + + case 'sheetData': + const sheetData = parseSheetData(child, sharedStrings); + worksheet.rows = sheetData.rows; + worksheet.cellData = sheetData.cellData; + break; + + case 'mergeCells': + const mergeCellNodes = child.children || []; + for (const mergeCellNode of mergeCellNodes) { + const ref = mergeCellNode.attrs?.ref; + if (ref) { + const refs = ref.split(':'); + if (refs.length === 2) { + const startIndex = decodeAddress(refs[0]); + const endIndex = decodeAddress(refs[1]); + worksheet.mergeCells.push({ + startCol: startIndex.col, + startRow: startIndex.row, + endCol: endIndex.col, + endRow: endIndex.row + }); + } else { + console.warn('error ref', ref); + } + } + } + break; + + case 'conditionalFormatting': + const conditionalFormatting = autoParse( + child, + CT_ConditionalFormatting_Attributes + ); + worksheet.conditionalFormatting.push(conditionalFormatting); + break; + + case 'drawing': + const rId = child.attrs['r:id']; + const relationship = relationships.find( + relationship => relationship.id === rId + ); + if (relationship) { + const target = relationship.target; + const path = joinPath(worksheetPath, '..', target); + worksheet.drawing = await parseDrawing(workbook, parser, path); + } + break; + + case 'phoneticPr': + case 'pageMargins': + // 暂时不处理 + break; + + case 'extLst': + worksheet.extLst = autoParse(child, CT_ExtensionList_Attributes); + break; + + case 'tableParts': + worksheet.tableParts = await parseTableParts( + worksheetPath, + parser, + relationships, + child + ); + break; + + case 'autoFilter': + worksheet.autoFilter = autoParse(child, CT_AutoFilter_Attributes); + break; + + case 'sheetPr': + worksheet.sheetPr = autoParse(child, CT_SheetPr_Attributes); + break; + + default: + console.warn('unknown tag', tag); + break; + } + } + + initValueForContainsBlanks(worksheet); + initValueForTable(worksheet); + + return worksheet; +} diff --git a/packages/office-viewer/src/excel/io/excel/preset/defaultTheme.ts b/packages/office-viewer/src/excel/io/excel/preset/defaultTheme.ts new file mode 100644 index 000000000..e58ac3198 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/defaultTheme.ts @@ -0,0 +1,318 @@ +export const defaultThemeString = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`; diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/checkGreen.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/checkGreen.svg new file mode 100644 index 000000000..8704bb2bc --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/checkGreen.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/checkSymbolGreen.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/checkSymbolGreen.svg new file mode 100644 index 000000000..a09ab55b8 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/checkSymbolGreen.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleBlack.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleBlack.svg new file mode 100644 index 000000000..193e328cf --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleBlack.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleGray.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleGray.svg new file mode 100644 index 000000000..1703980ef --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleGray.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleGreen.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleGreen.svg new file mode 100644 index 000000000..957d3991b --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleGreen.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleLightRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleLightRed.svg new file mode 100644 index 000000000..7fbec684c --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleLightRed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleOneWhiteQuarter.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleOneWhiteQuarter.svg new file mode 100644 index 000000000..e2c96dc86 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleOneWhiteQuarter.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleRed.svg new file mode 100644 index 000000000..8fd587141 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleRed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleThreeWhiteQuarters.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleThreeWhiteQuarters.svg new file mode 100644 index 000000000..16b3072c9 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleThreeWhiteQuarters.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleTwoWhiteQuarters.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleTwoWhiteQuarters.svg new file mode 100644 index 000000000..36f71edf0 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleTwoWhiteQuarters.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleWhite.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleWhite.svg new file mode 100644 index 000000000..962433df6 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleWhite.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/circleYellow.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/circleYellow.svg new file mode 100644 index 000000000..a6c2a331e --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/circleYellow.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/crossRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/crossRed.svg new file mode 100644 index 000000000..85fb966e2 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/crossRed.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/crossSymbolRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/crossSymbolRed.svg new file mode 100644 index 000000000..d6298b692 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/crossSymbolRed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/diamondRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/diamondRed.svg new file mode 100644 index 000000000..156d13a2d --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/diamondRed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/down.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/down.svg new file mode 100644 index 000000000..b68f89761 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/down.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/downGray.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/downGray.svg new file mode 100644 index 000000000..140f16e6d --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/downGray.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/downIncline.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/downIncline.svg new file mode 100644 index 000000000..1f23873ba --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/downIncline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/downInclineGray.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/downInclineGray.svg new file mode 100644 index 000000000..140f16e6d --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/downInclineGray.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/exclamationSymbolYellow.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/exclamationSymbolYellow.svg new file mode 100644 index 000000000..ba1fd1ccb --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/exclamationSymbolYellow.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/exclamationYellow.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/exclamationYellow.svg new file mode 100644 index 000000000..206a2a850 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/exclamationYellow.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/flagGreen.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/flagGreen.svg new file mode 100644 index 000000000..f01b94cc5 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/flagGreen.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/flagRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/flagRed.svg new file mode 100644 index 000000000..b90070b86 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/flagRed.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/flagYellow.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/flagYellow.svg new file mode 100644 index 000000000..d56a49adc --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/flagYellow.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/fourFilledBars.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/fourFilledBars.svg new file mode 100644 index 000000000..8db71478e --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/fourFilledBars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/oneFilledBars.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/oneFilledBars.svg new file mode 100644 index 000000000..ed2ec8227 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/oneFilledBars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/side.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/side.svg new file mode 100644 index 000000000..0e8e7264a --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/side.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/sideGray.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/sideGray.svg new file mode 100644 index 000000000..111673ae3 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/sideGray.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/threeFilledBars.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/threeFilledBars.svg new file mode 100644 index 000000000..5be39bb62 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/threeFilledBars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightGreen.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightGreen.svg new file mode 100644 index 000000000..cfc60b243 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightGreen.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightRed.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightRed.svg new file mode 100644 index 000000000..319e82b5f --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightRed.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightYellow.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightYellow.svg new file mode 100644 index 000000000..3add7fedb --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/trafficLightYellow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/triangleYellow.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/triangleYellow.svg new file mode 100644 index 000000000..736875306 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/triangleYellow.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/twoFilledBars.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/twoFilledBars.svg new file mode 100644 index 000000000..c9061973a --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/twoFilledBars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/up.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/up.svg new file mode 100644 index 000000000..6e2791054 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/up.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/upGray.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/upGray.svg new file mode 100644 index 000000000..cc0446dbf --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/upGray.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/upIncline.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/upIncline.svg new file mode 100644 index 000000000..6a6daaed9 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/upIncline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/upInclineGray.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/upInclineGray.svg new file mode 100644 index 000000000..c4aa93950 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/upInclineGray.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/icons/zeroFilledBars.svg b/packages/office-viewer/src/excel/io/excel/preset/icons/zeroFilledBars.svg new file mode 100644 index 000000000..57aebf679 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/icons/zeroFilledBars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/office-viewer/src/excel/io/excel/preset/presetCellStyles.ts b/packages/office-viewer/src/excel/io/excel/preset/presetCellStyles.ts new file mode 100644 index 000000000..9ed8819f3 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/presetCellStyles.ts @@ -0,0 +1,7077 @@ +/** generated by tools/convertPresetCellStyles.ts, do not edit */ +import {CT_Stylesheet} from '../../../../openxml/ExcelTypes'; +export const presetCellStyles: Record = { + '0': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 9, + fontId: 1, + fillId: 0, + borderId: 0, + applyFont: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 9, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 1, + applyFont: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Percent', + xfId: 1, + builtinId: 5 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '1': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyNumberFormat: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'RowLevel_7', + xfId: 1, + builtinId: 1, + iLevel: 6 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '2': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyNumberFormat: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'ColLevel_7', + xfId: 1, + builtinId: 2, + iLevel: 6 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '3': { + numFmts: { + count: 1, + numFmt: [ + { + numFmtId: 43, + formatCode: '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)' + } + ] + }, + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 43, + fontId: 1, + fillId: 0, + borderId: 0, + applyFont: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 3, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0, + applyBorder: true + }, + { + numFmtId: 43, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 1, + applyFont: true, + applyBorder: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Comma', + xfId: 1, + builtinId: 3 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '4': { + numFmts: { + count: 1, + numFmt: [ + { + numFmtId: 44, + formatCode: + '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)' + } + ] + }, + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 44, + fontId: 1, + fillId: 0, + borderId: 0, + applyFont: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 44, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 1, + applyFont: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Currency', + xfId: 1, + builtinId: 4 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '5': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 9, + fontId: 1, + fillId: 0, + borderId: 0, + applyFont: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 9, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 1, + applyFont: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Percent', + xfId: 1, + builtinId: 5 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '6': { + numFmts: { + count: 1, + numFmt: [ + { + numFmtId: 41, + formatCode: '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)' + } + ] + }, + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 41, + fontId: 1, + fillId: 0, + borderId: 0, + applyFont: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 41, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 1, + applyFont: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Comma [0]', + xfId: 1, + builtinId: 6 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '7': { + numFmts: { + count: 1, + numFmt: [ + { + numFmtId: 42, + formatCode: '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)' + } + ] + }, + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 42, + fontId: 1, + fillId: 0, + borderId: 0, + applyFont: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 42, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 1, + applyFont: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Currency [0]', + xfId: 1, + builtinId: 7 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '8': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 10 + }, + sz: { + val: 11 + }, + u: {} + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyNumberFormat: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false, + alignment: { + vertical: 'top' + }, + protection: { + locked: false + } + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1, + applyAlignment: true, + applyProtection: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Hyperlink', + xfId: 1, + builtinId: 8 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '9': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 11 + }, + sz: { + val: 11 + }, + u: {} + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyNumberFormat: false, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false, + alignment: { + vertical: 'top' + }, + protection: { + locked: false + } + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1, + applyAlignment: true, + applyProtection: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Followed Hyperlink', + xfId: 1, + builtinId: 9 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '10': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFFFFFCC' + } + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: { + style: 'thin', + color: { + rgb: 'FFB2B2B2' + } + }, + right: { + style: 'thin', + color: { + rgb: 'FFB2B2B2' + } + }, + top: { + style: 'thin', + color: { + rgb: 'FFB2B2B2' + } + }, + bottom: { + style: 'thin', + color: { + rgb: 'FFB2B2B2' + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + applyFont: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 0, + fillId: 2, + borderId: 1, + xfId: 1, + applyFont: true + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Note', + xfId: 1 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '11': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + rgb: 'FFFF0000' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Warning Text', + xfId: 1 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '15': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Cambria' + }, + family: { + val: 2 + }, + b: {}, + color: { + theme: 3 + }, + sz: { + val: 18 + }, + scheme: { + val: 'major' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Title', + xfId: 1 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '17': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + theme: 3 + }, + sz: { + val: 15 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: {}, + right: {}, + top: {}, + bottom: { + style: 'thick', + color: { + theme: 4 + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + applyFill: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Heading 1', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '18': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + theme: 3 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: {}, + right: {}, + top: {}, + bottom: { + style: 'medium', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + applyFill: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Heading 3', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '19': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + theme: 3 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Heading 4', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '20': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + rgb: 'FF3F3F76' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFFFCC99' + } + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + right: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + top: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + bottom: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Input', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '21': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + rgb: 'FF3F3F3F' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFF2F2F2' + } + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: { + style: 'thin', + color: { + rgb: 'FF3F3F3F' + } + }, + right: { + style: 'thin', + color: { + rgb: 'FF3F3F3F' + } + }, + top: { + style: 'thin', + color: { + rgb: 'FF3F3F3F' + } + }, + bottom: { + style: 'thin', + color: { + rgb: 'FF3F3F3F' + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Output', + xfId: 1 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '22': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + rgb: 'FFFA7D00' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFF2F2F2' + } + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + right: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + top: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + bottom: { + style: 'thin', + color: { + rgb: 'FF7F7F7F' + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Calculation', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '23': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFA5A5A5' + } + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: { + style: 'double', + color: { + rgb: 'FF3F3F3F' + } + }, + right: { + style: 'double', + color: { + rgb: 'FF3F3F3F' + } + }, + top: { + style: 'double', + color: { + rgb: 'FF3F3F3F' + } + }, + bottom: { + style: 'double', + color: { + rgb: 'FF3F3F3F' + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Check Cell', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '24': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + rgb: 'FFFA7D00' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: {}, + right: {}, + top: {}, + bottom: { + style: 'double', + color: { + rgb: 'FFFF8001' + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + applyFill: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Linked Cell', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '25': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + b: {}, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 2, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + }, + { + left: {}, + right: {}, + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'double', + color: { + theme: 4 + } + }, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + applyFill: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 1, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Normal', + xfId: 0, + builtinId: 0 + }, + { + name: 'Total', + xfId: 1 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '26': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + rgb: 'FF006100' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFC6EFCE' + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Good', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '27': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + rgb: 'FF9C0006' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFFFC7CE' + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Bad', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '28': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + rgb: 'FF9C6500' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + rgb: 'FFFFEB9C' + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Neutral', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '29': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Accent1', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '30': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '20% - Accent1', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '31': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '40% - Accent1', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '32': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.3999755851924192 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '60% - Accent1 2', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '33': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Accent2', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '34': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '20% - Accent2', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '35': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '40% - Accent2', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '36': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.3999755851924192 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '60% - Accent2', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '38': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '20% - Accent3', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '39': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '40% - Accent3', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '40': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.3999755851924192 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '60% - Accent3', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '41': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Accent4 2', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '42': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '20% - Accent4', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '43': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '40% - Accent4', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '44': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.3999755851924192 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '60% - Accent4', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '45': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Accent5', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '46': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '20% - Accent5', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '47': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '40% - Accent5', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '48': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.3999755851924192 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '60% - Accent5', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '49': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Accent6', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '50': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '20% - Accent6', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '51': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '40% - Accent6', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '52': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.3999755851924192 + }, + bgColor: { + indexed: 65 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: '60% - Accent6', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + '53': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + i: {}, + color: { + rgb: 'FF7F7F7F' + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 2, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + applyFill: false, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 0, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Explanatory Text', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + }, + 'undefined': { + fonts: { + count: 2, + font: [ + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 1 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + }, + { + name: { + val: 'Calibri' + }, + family: { + val: 2 + }, + color: { + theme: 0 + }, + sz: { + val: 11 + }, + scheme: { + val: 'minor' + } + } + ] + }, + fills: { + count: 3, + fill: [ + { + patternFill: { + patternType: 'none' + } + }, + { + patternFill: { + patternType: 'gray125' + } + }, + { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + } + } + } + ] + }, + borders: { + count: 1, + border: [ + { + left: {}, + right: {}, + top: {}, + bottom: {}, + diagonal: {} + } + ] + }, + cellStyleXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + applyBorder: false, + applyAlignment: false, + applyProtection: false + } + ] + }, + cellXfs: { + count: 2, + xf: [ + { + numFmtId: 0, + fontId: 0, + fillId: 0, + borderId: 0, + xfId: 0 + }, + { + numFmtId: 0, + fontId: 1, + fillId: 2, + borderId: 0, + xfId: 1 + } + ] + }, + cellStyles: { + count: 2, + cellStyle: [ + { + name: 'Accent3', + xfId: 1 + }, + { + name: 'Normal', + xfId: 0, + builtinId: 0 + } + ] + }, + dxfs: { + count: 0 + }, + tableStyles: { + count: 0, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16' + } + } +}; diff --git a/packages/office-viewer/src/excel/io/excel/preset/presetIconSet.ts b/packages/office-viewer/src/excel/io/excel/preset/presetIconSet.ts new file mode 100644 index 000000000..6cb1feb36 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/presetIconSet.ts @@ -0,0 +1,57 @@ +/** + * 图标定义 + */ + +import {ST_IconSetType} from '../../../../openxml/ExcelTypes'; +import {IconNames} from './presetIcons'; + +export const presetIconSet: Record = { + '3Arrows': ['down', 'side', 'up'], + '3ArrowsGray': ['downGray', 'sideGray', 'upGray'], + '3Flags': ['flagRed', 'flagYellow', 'flagGreen'], + '3Signs': ['diamondRed', 'triangleYellow', 'circleGreen'], + '3Symbols': ['crossRed', 'exclamationYellow', 'checkGreen'], + '3Symbols2': [ + 'crossSymbolRed', + 'exclamationSymbolYellow', + 'checkSymbolGreen' + ], + '3TrafficLights1': ['circleRed', 'circleYellow', 'circleGreen'], + '3TrafficLights2': [ + 'trafficLightRed', + 'trafficLightYellow', + 'trafficLightGreen' + ], + '4Arrows': ['down', 'downIncline', 'upIncline', 'up'], + '4ArrowsGray': ['downGray', 'downInclineGray', 'upInclineGray', 'upGray'], + '4Rating': [ + 'oneFilledBars', + 'twoFilledBars', + 'threeFilledBars', + 'fourFilledBars' + ], + '4RedToBlack': ['circleBlack', 'circleGray', 'circleLightRed', 'circleRed'], + '4TrafficLights': ['circleBlack', 'circleRed', 'circleYellow', 'circleGreen'], + '5Arrows': ['down', 'downIncline', 'side', 'upIncline', 'up'], + '5ArrowsGray': [ + 'downGray', + 'downInclineGray', + 'sideGray', + 'upInclineGray', + 'upGray' + ], + '5Quarters': [ + 'circleWhite', + 'circleThreeWhiteQuarters', + 'circleTwoWhiteQuarters', + 'circleOneWhiteQuarter', + 'circleBlack' + ], + '5Rating': [ + 'zeroFilledBars', + 'oneFilledBars', + 'twoFilledBars', + 'threeFilledBars', + 'fourFilledBars' + ] +}; diff --git a/packages/office-viewer/src/excel/io/excel/preset/presetIcons.ts b/packages/office-viewer/src/excel/io/excel/preset/presetIcons.ts new file mode 100644 index 000000000..a95342285 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/presetIcons.ts @@ -0,0 +1,120 @@ +/** generated by genPresetIcons.ts, do not edit */ + +export type IconNames = + | 'down' + | 'side' + | 'up' + | 'downGray' + | 'sideGray' + | 'upGray' + | 'flagRed' + | 'flagYellow' + | 'flagGreen' + | 'diamondRed' + | 'triangleYellow' + | 'circleGreen' + | 'crossRed' + | 'exclamationYellow' + | 'checkGreen' + | 'crossSymbolRed' + | 'exclamationSymbolYellow' + | 'checkSymbolGreen' + | 'circleRed' + | 'circleYellow' + | 'trafficLightRed' + | 'trafficLightYellow' + | 'trafficLightGreen' + | 'downIncline' + | 'upIncline' + | 'downInclineGray' + | 'upInclineGray' + | 'oneFilledBars' + | 'twoFilledBars' + | 'threeFilledBars' + | 'fourFilledBars' + | 'circleBlack' + | 'circleGray' + | 'circleLightRed' + | 'circleWhite' + | 'circleThreeWhiteQuarters' + | 'circleTwoWhiteQuarters' + | 'circleOneWhiteQuarter' + | 'zeroFilledBars'; + +export const presetIcons: Record = { + down: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNy41IDE1TDAuNSA4SDVWMUgxMFY4SDE0LjVMNy41IDE1WiIgZmlsbD0iI0ZGOTE5OCIgLz4KCTxwYXRoIGQ9Ik0xMCA4LjVIMTMuMjkyOUw3LjUgMTQuMjkyOUwxLjcwNzExIDguNUg1SDUuNVY4VjEuNUg5LjVWOFY4LjVIMTBaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + side: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUgOC41TDggMTUuNUw4IDExTDEgMTFMMSA2TDggNkw4IDEuNUwxNSA4LjVaIiBmaWxsPSIjRjhEQjhGIiAvPgoJPHBhdGggZD0iTTguNSA2TDguNSAyLjcwNzExTDE0LjI5MjkgOC41TDguNSAxNC4yOTI5TDguNSAxMUw4LjUgMTAuNUw4IDEwLjVMMS41IDEwLjVMMS41IDYuNUw4IDYuNUw4LjUgNi41TDguNSA2WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + up: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNy41IDFMMTQuNSA4TDEwIDhWMTVMNSAxNUw1IDhMMC41IDhMNy41IDFaIiBmaWxsPSIjQTJEREFBIiAvPgoJPHBhdGggZD0iTTUgNy41TDEuNzA3MTEgNy41TDcuNSAxLjcwNzExTDEzLjI5MjkgNy41TDEwIDcuNUg5LjVWOFYxNC41TDUuNSAxNC41TDUuNSA4VjcuNUg1WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + downGray: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiPgoJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQgMTRMNC4xMDA1MSAxNEw3LjI4MjQ5IDEwLjgxOEwyLjMzMjc0IDUuODY4MjdMNS44NjgyNyAyLjMzMjc0TDEwLjgxOCA3LjI4MjQ5TDE0IDQuMTAwNTFMMTQgMTRaIiBmaWxsPSIjNTA1MDUwIiAvPgoJCTxwYXRoIGQ9Ik0xMS4xNzE2IDcuNjM2MDRMMTMuNSA1LjMwNzYxTDEzLjUgMTMuNUw1LjMwNzYxIDEzLjVMNy42MzYwNCAxMS4xNzE2TDcuOTg5NTkgMTAuODE4TDcuNjM2MDQgMTAuNDY0NUwzLjAzOTg0IDUuODY4MjdMNS44NjgyNyAzLjAzOTg0TDEwLjQ2NDUgNy42MzYwNEwxMC44MTggNy45ODk1OUwxMS4xNzE2IDcuNjM2MDRaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPC9nPgoJPGRlZnM+CgkJPGNsaXBQYXRoIGlkPSJjbGlwMCI+CgkJCTxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIC8+CgkJPC9jbGlwUGF0aD4KCTwvZGVmcz4KPC9zdmc+Cg==', + sideGray: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUgOC41TDggMTUuNUw4IDExTDEgMTFMMSA2TDggNkw4IDEuNUwxNSA4LjVaIiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTguNSA2TDguNSAyLjcwNzExTDE0LjI5MjkgOC41TDguNSAxNC4yOTI5TDguNSAxMUw4LjUgMTAuNUw4IDEwLjVMMS41IDEwLjVMMS41IDYuNUw4IDYuNUw4LjUgNi41TDguNSA2WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + upGray: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNy41IDFMMTQuNSA4TDEwIDhWMTVMNSAxNUw1IDhMMC41IDhMNy41IDFaIiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTUgNy41TDEuNzA3MTEgNy41TDcuNSAxLjcwNzExTDEzLjI5MjkgNy41TDEwIDcuNUg5LjVWOFYxNC41TDUuNSAxNC41TDUuNSA4VjcuNUg1WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + flagRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik01IDFMNSAxMEwxNCA1LjVMNSAxWiIgZmlsbD0iI0ZGOTE5OCIgLz4KCTxwYXRoIGQ9Ik0xMi44ODIgNS41TDUuNSA5LjE5MDk4TDUuNSAxLjgwOTAyTDEyLjg4MiA1LjVaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iMiIgeT0iMC45OTk5OTYiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiBmaWxsPSIjNzI3MjcyIiAvPgo8L3N2Zz4K', + flagYellow: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik01IDFMNSAxMEwxNCA1LjVMNSAxWiIgZmlsbD0iI0Y4REI4RiIgLz4KCTxwYXRoIGQ9Ik0xMi44ODIgNS41TDUuNSA5LjE5MDk4TDUuNSAxLjgwOTAyTDEyLjg4MiA1LjVaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iMiIgeT0iMC45OTk5OTYiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiBmaWxsPSIjNzI3MjcyIiAvPgo8L3N2Zz4K', + flagGreen: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik01IDFMNSAxMEwxNCA1LjVMNSAxWiIgZmlsbD0iI0EyRERBQSIgLz4KCTxwYXRoIGQ9Ik0xMi44ODIgNS41TDUuNSA5LjE5MDk4TDUuNSAxLjgwOTAyTDEyLjg4MiA1LjVaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iMiIgeT0iMC45OTk5OTYiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiBmaWxsPSIjNzI3MjcyIiAvPgo8L3N2Zz4K', + diamondRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxyZWN0IHg9IjgiIHk9IjEiIHdpZHRoPSI5Ljg5OTUiIGhlaWdodD0iOS44OTk1IiByeD0iMiIgdHJhbnNmb3JtPSJyb3RhdGUoNDUgOCAxKSIgZmlsbD0iI0ZGOTE5OCIgLz4KCTxyZWN0IHg9IjgiIHk9IjEuNzA3MTEiIHdpZHRoPSI4Ljg5OTUiIGhlaWdodD0iOC44OTk1IiByeD0iMS41IiB0cmFuc2Zvcm09InJvdGF0ZSg0NSA4IDEuNzA3MTEpIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + triangleYellow: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xIDE1SDE1TDggMUwxIDE1WiIgZmlsbD0iI0Y4REI4RiIgLz4KCTxwYXRoIGQ9Ik04IDIuMTE4MDNMMTQuMTkxIDE0LjVIMS44MDkwMkw4IDIuMTE4MDNaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + circleGreen: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNSA4QzE1IDExLjg2NiAxMS44NjYgMTUgOCAxNUM0LjEzNDAxIDE1IDEgMTEuODY2IDEgOEMxIDQuMTM0MDEgNC4xMzQwMSAxIDggMUMxMS44NjYgMSAxNSA0LjEzNDAxIDE1IDhaIiBmaWxsPSIjQTJEREFBIiAvPgoJPHBhdGggZD0iTTE0LjUgOEMxNC41IDExLjU4OTkgMTEuNTg5OSAxNC41IDggMTQuNUM0LjQxMDE1IDE0LjUgMS41IDExLjU4OTkgMS41IDhDMS41IDQuNDEwMTUgNC40MTAxNSAxLjUgOCAxLjVDMTEuNTg5OSAxLjUgMTQuNSA0LjQxMDE1IDE0LjUgOFoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cjwvc3ZnPgo=', + crossRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNC45OTk5IDcuOTk5OTZDMTQuOTk5OSAxMS44NjU5IDExLjg2NTkgMTQuOTk5OSA3Ljk5OTk2IDE0Ljk5OTlDNC4xMzM5OSAxNC45OTk5IDEgMTEuODY1OSAxIDcuOTk5OTZDMSA0LjEzMzk5IDQuMTMzOTkgMSA3Ljk5OTk2IDFDMTEuODY1OSAxIDE0Ljk5OTkgNC4xMzM5OSAxNC45OTk5IDcuOTk5OTZaIiBmaWxsPSIjRkY5MTk4IiAvPgoJPHBhdGggZD0iTTE0LjQ5OTkgNy45OTk5NkMxNC40OTk5IDExLjU4OTggMTEuNTg5OCAxNC40OTk5IDcuOTk5OTYgMTQuNDk5OUM0LjQxMDEzIDE0LjQ5OTkgMS41IDExLjU4OTggMS41IDcuOTk5OTZDMS41IDQuNDEwMTMgNC40MTAxMyAxLjUgNy45OTk5NiAxLjVDMTEuNTg5OCAxLjUgMTQuNDk5OSA0LjQxMDEzIDE0LjQ5OTkgNy45OTk5NloiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuNTg1OCA4TDQuMjkyOTEgNS43MDcxMUw1LjcwNzEyIDQuMjkyODlMOC4wMDAwMSA2LjU4NTc5TDEwLjI5MjkgNC4yOTI4OUwxMS43MDcxIDUuNzA3MTFMOS40MTQyMyA4TDExLjcwNzEgMTAuMjkyOUwxMC4yOTI5IDExLjcwNzFMOC4wMDAwMSA5LjQxNDIxTDUuNzA3MTIgMTEuNzA3MUw0LjI5MjkxIDEwLjI5MjlMNi41ODU4IDhaIiBmaWxsPSJ3aGl0ZSIgLz4KPC9zdmc+Cg==', + exclamationYellow: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNSA4QzE1IDExLjg2NiAxMS44NjYgMTUgOCAxNUM0LjEzNDAxIDE1IDEgMTEuODY2IDEgOEMxIDQuMTM0MDEgNC4xMzQwMSAxIDggMUMxMS44NjYgMSAxNSA0LjEzNDAxIDE1IDhaIiBmaWxsPSIjRjhEQjhGIiAvPgoJPHBhdGggZD0iTTE0LjUgOEMxNC41IDExLjU4OTkgMTEuNTg5OSAxNC41IDggMTQuNUM0LjQxMDE1IDE0LjUgMS41IDExLjU4OTkgMS41IDhDMS41IDQuNDEwMTUgNC40MTAxNSAxLjUgOCAxLjVDMTEuNTg5OSAxLjUgMTQuNSA0LjQxMDE1IDE0LjUgOFoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cGF0aCBkPSJNNy4yNzE1MiA4LjY1MzlMNy4wNTk2IDUuNDkwMDlDNy4wMTk4NyA0Ljg3MzYyIDcgNC40MzEwOSA3IDQuMTYyNDhDNyAzLjc5NzAxIDcuMDk0OTIgMy41MTI5OSA3LjI4NDc3IDMuMzEwNDRDNy40NzkwMyAzLjEwMzQ4IDcuNzMyODkgMyA4LjA0NjM2IDNDOC40MjYwNSAzIDguNjc5OTEgMy4xMzIxIDguODA3OTUgMy4zOTYzQzguOTM1OTggMy42NTYxIDkgNC4wMzI1OCA5IDQuNTI1NzZDOSA0LjgxNjM4IDguOTg0NTUgNS4xMTE0IDguOTUzNjQgNS40MTA4M0w4LjY2ODg3IDguNjY3MTFDOC42Mzc5NyA5LjA1NDYgOC41NzE3NCA5LjM1MTgzIDguNDcwMiA5LjU1ODc4QzguMzY4NjUgOS43NjU3NCA4LjIwMDg4IDkuODY5MjIgNy45NjY4OSA5Ljg2OTIyQzcuNzI4NDggOS44NjkyMiA3LjU2MjkxIDkuNzcwMTUgNy40NzAyIDkuNTcxOTlDNy4zNzc0OCA5LjM2OTQ0IDcuMzExMjYgOS4wNjM0MSA3LjI3MTUyIDguNjUzOVpNOC4wMDY2MiAxM0M3LjczNzMxIDEzIDcuNTAxMSAxMi45MTQxIDcuMjk4MDEgMTIuNzQyNEM3LjA5OTM0IDEyLjU2NjMgNyAxMi4zMjE5IDcgMTIuMDA5MkM3IDExLjczNjIgNy4wOTQ5MiAxMS41MDUxIDcuMjg0NzcgMTEuMzE1N0M3LjQ3OTAzIDExLjEyMiA3LjcxNTIzIDExLjAyNTEgNy45OTMzOCAxMS4wMjUxQzguMjcxNTIgMTEuMDI1MSA4LjUwNzczIDExLjEyMiA4LjcwMTk5IDExLjMxNTdDOC45MDA2NiAxMS41MDUxIDkgMTEuNzM2MiA5IDEyLjAwOTJDOSAxMi4zMTc1IDguOTAwNjYgMTIuNTU5NyA4LjcwMTk5IDEyLjczNThDOC41MDMzMSAxMi45MTE5IDguMjcxNTIgMTMgOC4wMDY2MiAxM1oiIGZpbGw9IndoaXRlIiAvPgo8L3N2Zz4K', + checkGreen: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNSA4QzE1IDExLjg2NiAxMS44NjYgMTUgOCAxNUM0LjEzNDAxIDE1IDEgMTEuODY2IDEgOEMxIDQuMTM0MDEgNC4xMzQwMSAxIDggMUMxMS44NjYgMSAxNSA0LjEzNDAxIDE1IDhaIiBmaWxsPSIjQTJEREFBIiAvPgoJPHBhdGggZD0iTTE0LjUgOEMxNC41IDExLjU4OTkgMTEuNTg5OSAxNC41IDggMTQuNUM0LjQxMDE1IDE0LjUgMS41IDExLjU4OTkgMS41IDhDMS41IDQuNDEwMTUgNC40MTAxNSAxLjUgOCAxLjVDMTEuNTg5OSAxLjUgMTQuNSA0LjQxMDE1IDE0LjUgOFoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyLjgwNSA1LjU5MzJMNy42MzkxNSAxMi42MDQxTDQuMjQxNjcgOC42NTE4OUw1Ljc1ODMgNy4zNDgxMUw3LjUxODcyIDkuMzk1OTRMMTEuMTk0OSA0LjQwNjhMMTIuODA1IDUuNTkzMloiIGZpbGw9IndoaXRlIiAvPgo8L3N2Zz4K', + crossSymbolRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNi4xOTczNSA4TDIgMy44MDI2NUwzLjgwMjY1IDJMOCA2LjE5NzM1TDEyLjE5NzMgMkwxNCAzLjgwMjY1TDkuODAyNjUgOEwxNCAxMi4xOTczTDEyLjE5NzMgMTRMOCA5LjgwMjY1TDMuODAyNjUgMTRMMiAxMi4xOTczTDYuMTk3MzUgOFoiIGZpbGw9IiNGRjkxOTgiIC8+Cgk8cGF0aCBkPSJNOC4zNTM1NSA2LjU1MDlMMTIuMTk3MyAyLjcwNzExTDEzLjI5MjkgMy44MDI2NUw5LjQ0OTEgNy42NDY0NUw5LjA5NTU1IDhMOS40NDkxIDguMzUzNTVMMTMuMjkyOSAxMi4xOTczTDEyLjE5NzMgMTMuMjkyOUw4LjM1MzU1IDkuNDQ5MUw4IDkuMDk1NTVMNy42NDY0NSA5LjQ0OTFMMy44MDI2NSAxMy4yOTI5TDIuNzA3MTEgMTIuMTk3M0w2LjU1MDkgOC4zNTM1NUw2LjkwNDQ1IDhMNi41NTA5IDcuNjQ2NDVMMi43MDcxMSAzLjgwMjY1TDMuODAyNjUgMi43MDcxMUw3LjY0NjQ1IDYuNTUwOUw4IDYuOTA0NDVMOC4zNTM1NSA2LjU1MDlaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + exclamationSymbolYellow: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik03LjQwNzI4IDguOTE1NDZMNy4wODk0IDQuNDg2MTNDNy4wMjk4IDMuNjIzMDcgNyAzLjAwMzUyIDcgMi42Mjc0OEM3IDIuMTE1ODEgNy4xNDIzOCAxLjcxODE5IDcuNDI3MTUgMS40MzQ2MUM3LjcxODU0IDEuMTQ0ODcgOC4wOTkzNCAxIDguNTY5NTQgMUM5LjEzOTA3IDEgOS41MTk4NyAxLjE4NDk0IDkuNzExOTIgMS41NTQ4MkM5LjkwMzk3IDEuOTE4NTQgMTAgMi40NDU2MiAxMCAzLjEzNjA2QzEwIDMuNTQyOTMgOS45NzY4MiAzLjk1NTk3IDkuOTMwNDYgNC4zNzUxNkw5LjUwMzMxIDguOTMzOTVDOS40NTY5NSA5LjQ3NjQ0IDkuMzU3NjIgOS44OTI1NiA5LjIwNTMgMTAuMTgyM0M5LjA1Mjk4IDEwLjQ3MiA4LjgwMTMyIDEwLjYxNjkgOC40NTAzMyAxMC42MTY5QzguMDkyNzIgMTAuNjE2OSA3Ljg0NDM3IDEwLjQ3ODIgNy43MDUzIDEwLjIwMDhDNy41NjYyMyA5LjkxNzIyIDcuNDY2ODkgOS40ODg3NyA3LjQwNzI4IDguOTE1NDZaTTguNTA5OTMgMTVDOC4xMDU5NiAxNSA3Ljc1MTY2IDE0Ljg3OTggNy40NDcwMiAxNC42Mzk0QzcuMTQ5MDEgMTQuMzkyOCA3IDE0LjA1MDYgNyAxMy42MTI5QzcgMTMuMjMwNyA3LjE0MjM4IDEyLjkwNzEgNy40MjcxNSAxMi42NDJDNy43MTg1NCAxMi4zNzA4IDguMDcyODUgMTIuMjM1MSA4LjQ5MDA3IDEyLjIzNTFDOC45MDcyOCAxMi4yMzUxIDkuMjYxNTkgMTIuMzcwOCA5LjU1Mjk4IDEyLjY0MkM5Ljg1MDk5IDEyLjkwNzEgMTAgMTMuMjMwNyAxMCAxMy42MTI5QzEwIDE0LjA0NDUgOS44NTA5OSAxNC4zODM1IDkuNTUyOTggMTQuNjMwMUM5LjI1NDk3IDE0Ljg3NjcgOC45MDcyOCAxNSA4LjUwOTkzIDE1WiIgZmlsbD0iI0Y4REI4RiIgLz4KCTxwYXRoIGQ9Ik05LjI2ODE3IDEuNzg1MjNMOS4yNjgxNiAxLjc4NTIzTDkuMjY5NzcgMS43ODgyOUM5LjQwNjI4IDIuMDQ2ODEgOS41IDIuNDc4NTEgOS41IDMuMTM2MDZDOS41IDMuNTIzOTIgOS40Nzc5MSAzLjkxODYgOS40MzM0OSA0LjMyMDIxTDkuNDMzNDIgNC4zMjAyTDkuNDMyNjQgNC4zMjg1Mkw5LjAwNTQ5IDguODg3M0w5LjAwNTQ4IDguODg3M0w5LjAwNTEzIDguODkxMzhDOC45NjExNyA5LjQwNTczIDguODcwMDkgOS43NDU0MSA4Ljc2MjczIDkuOTQ5NjRDOC43MjQ4NyAxMC4wMjE3IDguNjg2NDkgMTAuMDU1NiA4LjY1Mjg3IDEwLjA3NDlDOC42MTczMSAxMC4wOTU0IDguNTU2NTIgMTAuMTE2OSA4LjQ1MDMzIDEwLjExNjlDOC4zMzUyOSAxMC4xMTY5IDguMjcyNTEgMTAuMDk0NyA4LjIzOTY3IDEwLjA3NjRDOC4yMTEyNCAxMC4wNjA1IDguMTgxNzggMTAuMDM0OSA4LjE1MzE2IDkuOTc4NDdDOC4wNTQxMSA5Ljc3NTMxIDcuOTYyOTUgOS40MiA3LjkwNTQyIDguODcxNThMNy41ODgyMiA0LjQ1MTY4QzcuNTg4MiA0LjQ1MTQ1IDcuNTg4MTggNC40NTEyMyA3LjU4ODE3IDQuNDUxQzcuNTI4NjQgMy41ODg5NSA3LjUgMi45ODQ2NiA3LjUgMi42Mjc0OEM3LjUgMi4yMTA3MiA3LjYxMzM0IDEuOTU0OSA3Ljc3OTg0IDEuNzg5MDNDNy45NjM4MiAxLjYwNjE2IDguMjEwODcgMS41IDguNTY5NTQgMS41QzkuMDMxMTYgMS41IDkuMTkzMiAxLjY0MDg0IDkuMjY4MTcgMS43ODUyM1pNOS4yMTIzIDEzLjAwOEw5LjIxMjIyIDEzLjAwODFMOS4yMjA2NyAxMy4wMTU2QzkuNDE3MjkgMTMuMTkwNSA5LjUgMTMuMzgwNCA5LjUgMTMuNjEyOUM5LjUgMTMuOTE0OSA5LjQwMzI1IDE0LjEwNSA5LjIzNDIzIDE0LjI0NDlDOS4wMjg1IDE0LjQxNTEgOC43OTQzNyAxNC41IDguNTA5OTMgMTQuNUM4LjIxNTU5IDE0LjUgNy45NzI5NyAxNC40MTU5IDcuNzYxNDkgMTQuMjUwNkM3LjU5Njg0IDE0LjExMjUgNy41IDEzLjkyMSA3LjUgMTMuNjEyOUM3LjUgMTMuMzcyNCA3LjU4MjYxIDEzLjE4MDQgNy43Njc4MyAxMy4wMDhDNy45NjE5MSAxMi44MjczIDguMTkyNTggMTIuNzM1MSA4LjQ5MDA3IDEyLjczNTFDOC43ODc1NSAxMi43MzUxIDkuMDE4MjMgMTIuODI3MyA5LjIxMjMgMTMuMDA4WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + checkSymbolGreen: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQgNC4yOTU3OEw2LjY4MjAzIDE0TDIgOC42NzgyMUwzLjYzNDE3IDcuMjU2MDhMNi41NTIxOCAxMC41NzI4TDEyLjI2MjggM0wxNCA0LjI5NTc4WiIgZmlsbD0iI0EyRERBQSIgLz4KCTxwYXRoIGQ9Ik02Ljk1MTM5IDEwLjg3MzlMMTIuMzYyNiAzLjY5ODE4TDEzLjI5ODIgNC4zOTYwNEw2LjY1MjIgMTMuMjA5MUwyLjcwNzQ2IDguNzI1MzdMMy41ODcyNyA3Ljk1OTczTDYuMTc2NzggMTAuOTAzMUw2LjU4MjAyIDExLjM2MzdMNi45NTEzOSAxMC44NzM5WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + circleRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNSA4QzE1IDExLjg2NiAxMS44NjYgMTUgOCAxNUM0LjEzNDAxIDE1IDEgMTEuODY2IDEgOEMxIDQuMTM0MDEgNC4xMzQwMSAxIDggMUMxMS44NjYgMSAxNSA0LjEzNDAxIDE1IDhaIiBmaWxsPSIjRkY5MTk4IiAvPgoJPHBhdGggZD0iTTE0LjUgOEMxNC41IDExLjU4OTkgMTEuNTg5OSAxNC41IDggMTQuNUM0LjQxMDE1IDE0LjUgMS41IDExLjU4OTkgMS41IDhDMS41IDQuNDEwMTUgNC40MTAxNSAxLjUgOCAxLjVDMTEuNTg5OSAxLjUgMTQuNSA0LjQxMDE1IDE0LjUgOFoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cjwvc3ZnPgo=', + circleYellow: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNSA4QzE1IDExLjg2NiAxMS44NjYgMTUgOCAxNUM0LjEzNDAxIDE1IDEgMTEuODY2IDEgOEMxIDQuMTM0MDEgNC4xMzQwMSAxIDggMUMxMS44NjYgMSAxNSA0LjEzNDAxIDE1IDhaIiBmaWxsPSIjRjhEQjhGIiAvPgoJPHBhdGggZD0iTTE0LjUgOEMxNC41IDExLjU4OTkgMTEuNTg5OSAxNC41IDggMTQuNUM0LjQxMDE1IDE0LjUgMS41IDExLjU4OTkgMS41IDhDMS41IDQuNDEwMTUgNC40MTAxNSAxLjUgOCAxLjVDMTEuNTg5OSAxLjUgMTQuNSA0LjQxMDE1IDE0LjUgOFoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cjwvc3ZnPgo=', + trafficLightRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xIDNDMSAxLjg5NTQzIDEuODk1NDMgMSAzIDFIMTNDMTQuMTA0NiAxIDE1IDEuODk1NDMgMTUgM1YxM0MxNSAxNC4xMDQ2IDE0LjEwNDYgMTUgMTMgMTVIM0MxLjg5NTQzIDE1IDEgMTQuMTA0NiAxIDEzVjNaIiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTMgMS41SDEzQzEzLjgyODQgMS41IDE0LjUgMi4xNzE1NyAxNC41IDNWMTNDMTQuNSAxMy44Mjg0IDEzLjgyODQgMTQuNSAxMyAxNC41SDNDMi4xNzE1NyAxNC41IDEuNSAxMy44Mjg0IDEuNSAxM1YzQzEuNSAyLjE3MTU3IDIuMTcxNTcgMS41IDMgMS41WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KCTxwYXRoIGQ9Ik0xNCA4QzE0IDQuNjg2MjkgMTEuMzEzNyAyIDggMkM0LjY4NjI5IDIgMiA0LjY4NjI5IDIgOEMyIDExLjMxMzcgNC42ODYyOSAxNCA4IDE0QzExLjMxMzcgMTQgMTQgMTEuMzEzNyAxNCA4WiIgZmlsbD0id2hpdGUiIC8+Cgk8cGF0aCBkPSJNMTMgOEMxMyA1LjIzODU4IDEwLjc2MTQgMyA4IDNDNS4yMzg1OCAzIDMgNS4yMzg1OCAzIDhDMyAxMC43NjE0IDUuMjM4NTggMTMgOCAxM0MxMC43NjE0IDEzIDEzIDEwLjc2MTQgMTMgOFoiIGZpbGw9IiNGRjkxOTgiIC8+Cjwvc3ZnPgo=', + trafficLightYellow: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xIDNDMSAxLjg5NTQzIDEuODk1NDMgMSAzIDFIMTNDMTQuMTA0NiAxIDE1IDEuODk1NDMgMTUgM1YxM0MxNSAxNC4xMDQ2IDE0LjEwNDYgMTUgMTMgMTVIM0MxLjg5NTQzIDE1IDEgMTQuMTA0NiAxIDEzVjNaIiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTMgMS41SDEzQzEzLjgyODQgMS41IDE0LjUgMi4xNzE1NyAxNC41IDNWMTNDMTQuNSAxMy44Mjg0IDEzLjgyODQgMTQuNSAxMyAxNC41SDNDMi4xNzE1NyAxNC41IDEuNSAxMy44Mjg0IDEuNSAxM1YzQzEuNSAyLjE3MTU3IDIuMTcxNTcgMS41IDMgMS41WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KCTxwYXRoIGQ9Ik0xNCA4QzE0IDQuNjg2MjkgMTEuMzEzNyAyIDggMkM0LjY4NjI5IDIgMiA0LjY4NjI5IDIgOEMyIDExLjMxMzcgNC42ODYyOSAxNCA4IDE0QzExLjMxMzcgMTQgMTQgMTEuMzEzNyAxNCA4WiIgZmlsbD0id2hpdGUiIC8+Cgk8cGF0aCBkPSJNMTMgOEMxMyA1LjIzODU4IDEwLjc2MTQgMyA4IDNDNS4yMzg1OCAzIDMgNS4yMzg1OCAzIDhDMyAxMC43NjE0IDUuMjM4NTggMTMgOCAxM0MxMC43NjE0IDEzIDEzIDEwLjc2MTQgMTMgOFoiIGZpbGw9IiNGOERCOEYiIC8+Cjwvc3ZnPgo=', + trafficLightGreen: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xIDNDMSAxLjg5NTQzIDEuODk1NDMgMSAzIDFIMTNDMTQuMTA0NiAxIDE1IDEuODk1NDMgMTUgM1YxM0MxNSAxNC4xMDQ2IDE0LjEwNDYgMTUgMTMgMTVIM0MxLjg5NTQzIDE1IDEgMTQuMTA0NiAxIDEzVjNaIiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTMgMS41SDEzQzEzLjgyODQgMS41IDE0LjUgMi4xNzE1NyAxNC41IDNWMTNDMTQuNSAxMy44Mjg0IDEzLjgyODQgMTQuNSAxMyAxNC41SDNDMi4xNzE1NyAxNC41IDEuNSAxMy44Mjg0IDEuNSAxM1YzQzEuNSAyLjE3MTU3IDIuMTcxNTcgMS41IDMgMS41WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KCTxwYXRoIGQ9Ik0xNCA4QzE0IDQuNjg2MjkgMTEuMzEzNyAyIDggMkM0LjY4NjI5IDIgMiA0LjY4NjI5IDIgOEMyIDExLjMxMzcgNC42ODYyOSAxNCA4IDE0QzExLjMxMzcgMTQgMTQgMTEuMzEzNyAxNCA4WiIgZmlsbD0id2hpdGUiIC8+Cgk8cGF0aCBkPSJNMTMgOEMxMyA1LjIzODU4IDEwLjc2MTQgMyA4IDNDNS4yMzg1OCAzIDMgNS4yMzg1OCAzIDhDMyAxMC43NjE0IDUuMjM4NTggMTMgOCAxM0MxMC43NjE0IDEzIDEzIDEwLjc2MTQgMTMgOFoiIGZpbGw9IiNBMkREQUEiIC8+Cjwvc3ZnPgo=', + downIncline: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTMgMTVMMy4xMDA1MyAxNUw2LjI4MjUxIDExLjgxOEwxLjMzMjc2IDYuODY4MjdMNC44NjgzIDMuMzMyNzNMOS44MTgwNSA4LjI4MjQ4TDEzIDUuMTAwNUwxMyAxNVoiIGZpbGw9IiNGOERCOEYiIC8+Cgk8cGF0aCBkPSJNNi42MzYwNyAxMS40NjQ1TDIuMDM5ODcgNi44NjgyN0w0Ljg2ODMgNC4wMzk4NEw5LjQ2NDQ5IDguNjM2MDNMOS44MTgwNSA4Ljk4OTU5TDEwLjE3MTYgOC42MzYwM0wxMi41IDYuMzA3NjFMMTIuNSAxNC41TDQuMzA3NjQgMTQuNUw2LjYzNjA3IDEyLjE3MTZMNi45ODk2MiAxMS44MThMNi42MzYwNyAxMS40NjQ1WiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + upIncline: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTMgM0wzLjEwMDUgM0w2LjI4MjQ4IDYuMTgxOThMMS4zMzI3MyAxMS4xMzE3TDQuODY4MjcgMTQuNjY3M0w5LjgxODAxIDkuNzE3NTFMMTMgMTIuODk5NVYzWiIgZmlsbD0iI0Y4REI4RiIgLz4KCTxwYXRoIGQ9Ik02LjYzNjAzIDUuODI4NDNMNC4zMDc2MSAzLjVMMTIuNSAzLjVWMTEuNjkyNEwxMC4xNzE2IDkuMzYzOTZMOS44MTgwMSA5LjAxMDQxTDkuNDY0NDYgOS4zNjM5Nkw0Ljg2ODI3IDEzLjk2MDJMMi4wMzk4NCAxMS4xMzE3TDYuNjM2MDMgNi41MzU1M0w2Ljk4OTU5IDYuMTgxOThMNi42MzYwMyA1LjgyODQzWiIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + downInclineGray: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiPgoJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQgMTRMNC4xMDA1MSAxNEw3LjI4MjQ5IDEwLjgxOEwyLjMzMjc0IDUuODY4MjdMNS44NjgyNyAyLjMzMjc0TDEwLjgxOCA3LjI4MjQ5TDE0IDQuMTAwNTFMMTQgMTRaIiBmaWxsPSIjNTA1MDUwIiAvPgoJCTxwYXRoIGQ9Ik0xMS4xNzE2IDcuNjM2MDRMMTMuNSA1LjMwNzYxTDEzLjUgMTMuNUw1LjMwNzYxIDEzLjVMNy42MzYwNCAxMS4xNzE2TDcuOTg5NTkgMTAuODE4TDcuNjM2MDQgMTAuNDY0NUwzLjAzOTg0IDUuODY4MjdMNS44NjgyNyAzLjAzOTg0TDEwLjQ2NDUgNy42MzYwNEwxMC44MTggNy45ODk1OUwxMS4xNzE2IDcuNjM2MDRaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPC9nPgoJPGRlZnM+CgkJPGNsaXBQYXRoIGlkPSJjbGlwMCI+CgkJCTxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIC8+CgkJPC9jbGlwUGF0aD4KCTwvZGVmcz4KPC9zdmc+Cg==', + upInclineGray: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiPgoJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQgMkw0LjEwMDUxIDJMNy4yODI0OSA1LjE4MTk4TDIuMzMyNzQgMTAuMTMxN0w1Ljg2ODI3IDEzLjY2NzNMMTAuODE4IDguNzE3NTFMMTQgMTEuODk5NUwxNCAyWiIgZmlsbD0iIzUwNTA1MCIgLz4KCQk8cGF0aCBkPSJNMTEuMTcxNiA4LjM2Mzk2TDEzLjUgMTAuNjkyNEwxMy41IDIuNUw1LjMwNzYxIDIuNUw3LjYzNjA0IDQuODI4NDNMNy45ODk1OSA1LjE4MTk4TDcuNjM2MDQgNS41MzU1M0wzLjAzOTg1IDEwLjEzMTdMNS44NjgyNyAxMi45NjAyTDEwLjQ2NDUgOC4zNjM5NkwxMC44MTggOC4wMTA0MUwxMS4xNzE2IDguMzYzOTZaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPC9nPgoJPGRlZnM+CgkJPGNsaXBQYXRoIGlkPSJjbGlwMCI+CgkJCTxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIC8+CgkJPC9jbGlwUGF0aD4KCTwvZGVmcz4KPC9zdmc+Cg==', + oneFilledBars: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxyZWN0IHg9IjEiIHk9IjEwIiB3aWR0aD0iMyIgaGVpZ2h0PSI1IiBmaWxsPSIjODRCREVDIiAvPgoJPHJlY3QgeD0iMS41IiB5PSIxMC41IiB3aWR0aD0iMiIgaGVpZ2h0PSI0IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iNSIgeT0iNyIgd2lkdGg9IjMiIGhlaWdodD0iOCIgZmlsbD0iI0NDQ0NDQyIgLz4KCTxyZWN0IHg9IjUuNSIgeT0iNy41IiB3aWR0aD0iMiIgaGVpZ2h0PSI3IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iOSIgeT0iNCIgd2lkdGg9IjMiIGhlaWdodD0iMTEiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSI5LjUiIHk9IjQuNSIgd2lkdGg9IjIiIGhlaWdodD0iMTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cmVjdCB4PSIxMyIgeT0iMSIgd2lkdGg9IjMiIGhlaWdodD0iMTQiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSIxMy41IiB5PSIxLjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + twoFilledBars: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxyZWN0IHg9IjEiIHk9IjEwIiB3aWR0aD0iMyIgaGVpZ2h0PSI1IiBmaWxsPSIjODRCREVDIiAvPgoJPHJlY3QgeD0iMS41IiB5PSIxMC41IiB3aWR0aD0iMiIgaGVpZ2h0PSI0IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iNSIgeT0iNyIgd2lkdGg9IjMiIGhlaWdodD0iOCIgZmlsbD0iIzg0QkRFQyIgLz4KCTxyZWN0IHg9IjUuNSIgeT0iNy41IiB3aWR0aD0iMiIgaGVpZ2h0PSI3IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iOSIgeT0iNCIgd2lkdGg9IjMiIGhlaWdodD0iMTEiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSI5LjUiIHk9IjQuNSIgd2lkdGg9IjIiIGhlaWdodD0iMTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cmVjdCB4PSIxMyIgeT0iMSIgd2lkdGg9IjMiIGhlaWdodD0iMTQiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSIxMy41IiB5PSIxLjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + threeFilledBars: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxyZWN0IHg9IjEiIHk9IjEwIiB3aWR0aD0iMyIgaGVpZ2h0PSI1IiBmaWxsPSIjODRCREVDIiAvPgoJPHJlY3QgeD0iMS41IiB5PSIxMC41IiB3aWR0aD0iMiIgaGVpZ2h0PSI0IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iNSIgeT0iNyIgd2lkdGg9IjMiIGhlaWdodD0iOCIgZmlsbD0iIzg0QkRFQyIgLz4KCTxyZWN0IHg9IjUuNSIgeT0iNy41IiB3aWR0aD0iMiIgaGVpZ2h0PSI3IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iOSIgeT0iNCIgd2lkdGg9IjMiIGhlaWdodD0iMTEiIGZpbGw9IiM4NEJERUMiIC8+Cgk8cmVjdCB4PSI5LjUiIHk9IjQuNSIgd2lkdGg9IjIiIGhlaWdodD0iMTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cmVjdCB4PSIxMyIgeT0iMSIgd2lkdGg9IjMiIGhlaWdodD0iMTQiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSIxMy41IiB5PSIxLjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + fourFilledBars: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxyZWN0IHg9IjEiIHk9IjEwIiB3aWR0aD0iMyIgaGVpZ2h0PSI1IiBmaWxsPSIjODRCREVDIiAvPgoJPHJlY3QgeD0iMS41IiB5PSIxMC41IiB3aWR0aD0iMiIgaGVpZ2h0PSI0IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iNSIgeT0iNyIgd2lkdGg9IjMiIGhlaWdodD0iOCIgZmlsbD0iIzg0QkRFQyIgLz4KCTxyZWN0IHg9IjUuNSIgeT0iNy41IiB3aWR0aD0iMiIgaGVpZ2h0PSI3IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iOSIgeT0iNCIgd2lkdGg9IjMiIGhlaWdodD0iMTEiIGZpbGw9IiM4NEJERUMiIC8+Cgk8cmVjdCB4PSI5LjUiIHk9IjQuNSIgd2lkdGg9IjIiIGhlaWdodD0iMTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cmVjdCB4PSIxMyIgeT0iMSIgd2lkdGg9IjMiIGhlaWdodD0iMTQiIGZpbGw9IiM4NEJERUMiIC8+Cgk8cmVjdCB4PSIxMy41IiB5PSIxLjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + circleBlack: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI3IiBmaWxsPSIjNTA1MDUwIiAvPgoJPGNpcmNsZSBjeD0iOCIgY3k9IjgiIHI9IjYuNSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + circleGray: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI3IiBmaWxsPSIjOUI5QjlCIiAvPgoJPGNpcmNsZSBjeD0iOCIgY3k9IjgiIHI9IjYuNSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9IjAuMiIgLz4KPC9zdmc+Cg==', + circleLightRed: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxlbGxpcHNlIGN4PSI4IiBjeT0iOCIgcng9IjciIHJ5PSI3IiB0cmFuc2Zvcm09InJvdGF0ZSgtMTgwIDggOCkiIGZpbGw9IiNGRjgwODAiIC8+Cgk8cGF0aCBkPSJNMS41IDhDMS41IDQuNDEwMTUgNC40MTAxNSAxLjUgOCAxLjVDMTEuNTg5OSAxLjUgMTQuNSA0LjQxMDE1IDE0LjUgOEMxNC41IDExLjU4OTkgMTEuNTg5OSAxNC41IDggMTQuNUM0LjQxMDE1IDE0LjUgMS41IDExLjU4OTggMS41IDhaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K', + circleWhite: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI3IiBmaWxsPSIjNTA1MDUwIiAvPgoJPGNpcmNsZSBjeD0iOCIgY3k9IjgiIHI9IjYiIHRyYW5zZm9ybT0icm90YXRlKC05MCA4IDgpIiBmaWxsPSJ3aGl0ZSIgLz4KPC9zdmc+Cg==', + circleThreeWhiteQuarters: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI3IiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTggMkM2LjgxMzMxIDIgNS42NTMyOCAyLjM1MTg5IDQuNjY2NTggMy4wMTExOEMzLjY3OTg5IDMuNjcwNDcgMi45MTA4NSA0LjYwNzU0IDIuNDU2NzMgNS43MDM5QzIuMDAyNiA2LjgwMDI1IDEuODgzNzggOC4wMDY2NSAyLjExNTI5IDkuMTcwNTRDMi4zNDY4IDEwLjMzNDQgMi45MTgyNSAxMS40MDM1IDMuNzU3MzYgMTIuMjQyNkM0LjU5NjQ4IDEzLjA4MTggNS42NjU1OCAxMy42NTMyIDYuODI5NDYgMTMuODg0N0M3Ljk5MzM1IDE0LjExNjIgOS4xOTk3NSAxMy45OTc0IDEwLjI5NjEgMTMuNTQzM0MxMS4zOTI1IDEzLjA4OTEgMTIuMzI5NSAxMi4zMjAxIDEyLjk4ODggMTEuMzMzNEMxMy42NDgxIDEwLjM0NjcgMTQgOS4xODY2OCAxNCA4TDggOEw4IDJaIiBmaWxsPSJ3aGl0ZSIgLz4KPC9zdmc+Cg==', + circleTwoWhiteQuarters: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI3IiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTggMkM2LjQwODcgMiA0Ljg4MjU4IDIuNjMyMTQgMy43NTczNiAzLjc1NzM2QzIuNjMyMTQgNC44ODI1OCAyIDYuNDA4NyAyIDhDMiA5LjU5MTMgMi42MzIxNCAxMS4xMTc0IDMuNzU3MzYgMTIuMjQyNkM0Ljg4MjU4IDEzLjM2NzkgNi40MDg3IDE0IDggMTRMOCA4TDggMloiIGZpbGw9IndoaXRlIiAvPgo8L3N2Zz4K', + circleOneWhiteQuarter: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI3IiBmaWxsPSIjNTA1MDUwIiAvPgoJPHBhdGggZD0iTTggMkM3LjIxMjA3IDIgNi40MzE4NSAyLjE1NTE5IDUuNzAzOSAyLjQ1NjcyQzQuOTc1OTUgMi43NTgyNSA0LjMxNDUxIDMuMjAwMjEgMy43NTczNiAzLjc1NzM2QzMuMjAwMjEgNC4zMTQ1MSAyLjc1ODI1IDQuOTc1OTUgMi40NTY3MiA1LjcwMzlDMi4xNTUxOSA2LjQzMTg1IDIgNy4yMTIwNyAyIDhMOCA4TDggMloiIGZpbGw9IndoaXRlIiAvPgo8L3N2Zz4K', + zeroFilledBars: + 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxyZWN0IHg9IjEiIHk9IjEwIiB3aWR0aD0iMyIgaGVpZ2h0PSI1IiBmaWxsPSIjQ0NDQ0NDIiAvPgoJPHJlY3QgeD0iMS41IiB5PSIxMC41IiB3aWR0aD0iMiIgaGVpZ2h0PSI0IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iNSIgeT0iNyIgd2lkdGg9IjMiIGhlaWdodD0iOCIgZmlsbD0iI0NDQ0NDQyIgLz4KCTxyZWN0IHg9IjUuNSIgeT0iNy41IiB3aWR0aD0iMiIgaGVpZ2h0PSI3IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgoJPHJlY3QgeD0iOSIgeT0iNCIgd2lkdGg9IjMiIGhlaWdodD0iMTEiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSI5LjUiIHk9IjQuNSIgd2lkdGg9IjIiIGhlaWdodD0iMTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjIiIC8+Cgk8cmVjdCB4PSIxMyIgeT0iMSIgd2lkdGg9IjMiIGhlaWdodD0iMTQiIGZpbGw9IiNDQ0NDQ0MiIC8+Cgk8cmVjdCB4PSIxMy41IiB5PSIxLjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4yIiAvPgo8L3N2Zz4K' +}; diff --git a/packages/office-viewer/src/excel/io/excel/preset/presetTableStyles.ts b/packages/office-viewer/src/excel/io/excel/preset/presetTableStyles.ts new file mode 100644 index 000000000..0a16f7750 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/preset/presetTableStyles.ts @@ -0,0 +1,35117 @@ +/** generated by tools/convertPresetTableStyle.ts, do not edit */ +import {TableStyleDef} from '../../../types/TableStyleDef'; +export const presetTableStyles: Record = { + TableStyleMedium28: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + vertical: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium28', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium27: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + vertical: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium27', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium26: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + vertical: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium26', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium25: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + vertical: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium25', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium24: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + vertical: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium24', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium23: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + vertical: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium23', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium22: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + }, + right: { + style: 'thin', + color: { + theme: 1 + } + }, + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + }, + vertical: { + style: 'thin', + color: { + theme: 1 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium22', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium21: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium21', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium20: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium20', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium19: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium19', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium18: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium18', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium17: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium17', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium16: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium16', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium15: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + }, + right: { + style: 'thin', + color: { + theme: 1 + } + }, + top: { + style: 'medium', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1 + } + }, + vertical: { + style: 'thin', + color: { + theme: 1 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium15', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium14: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium14', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium13: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium13', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium12: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium12', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium11: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium11', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium10: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium10', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium9: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium9', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium8: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + top: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'thick', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium8', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium7: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium7', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium6: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium6', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium5: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium5', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium4: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium4', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium3: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium3', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium2: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium2', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleMedium1: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + }, + right: { + style: 'thin', + color: { + theme: 1 + } + }, + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleMedium1', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight21: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9 + } + }, + right: { + style: 'thin', + color: { + theme: 9 + } + }, + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + }, + vertical: { + style: 'thin', + color: { + theme: 9 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight21', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight20: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8 + } + }, + right: { + style: 'thin', + color: { + theme: 8 + } + }, + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + }, + vertical: { + style: 'thin', + color: { + theme: 8 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight20', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight19: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7 + } + }, + right: { + style: 'thin', + color: { + theme: 7 + } + }, + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + }, + vertical: { + style: 'thin', + color: { + theme: 7 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight19', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight18: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6 + } + }, + right: { + style: 'thin', + color: { + theme: 6 + } + }, + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + }, + vertical: { + style: 'thin', + color: { + theme: 6 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight18', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight17: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5 + } + }, + right: { + style: 'thin', + color: { + theme: 5 + } + }, + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + }, + vertical: { + style: 'thin', + color: { + theme: 5 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight17', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight16: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4 + } + }, + right: { + style: 'thin', + color: { + theme: 4 + } + }, + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + }, + vertical: { + style: 'thin', + color: { + theme: 4 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight16', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight15: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + }, + right: { + style: 'thin', + color: { + theme: 1 + } + }, + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + }, + vertical: { + style: 'thin', + color: { + theme: 1 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight15', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight14: { + dxfs: { + count: 10, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9 + } + }, + right: { + style: 'thin', + color: { + theme: 9 + } + }, + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight14 ', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight13: { + dxfs: { + count: 9, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8 + } + }, + right: { + style: 'thin', + color: { + theme: 8 + } + }, + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight13', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight12: { + dxfs: { + count: 9, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7 + } + }, + right: { + style: 'thin', + color: { + theme: 7 + } + }, + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight12', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight11: { + dxfs: { + count: 9, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6 + } + }, + right: { + style: 'thin', + color: { + theme: 6 + } + }, + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight11', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight10: { + dxfs: { + count: 9, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5 + } + }, + right: { + style: 'thin', + color: { + theme: 5 + } + }, + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight10', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight9: { + dxfs: { + count: 9, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4 + } + }, + right: { + style: 'thin', + color: { + theme: 4 + } + }, + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight9', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight8: { + dxfs: { + count: 9, + dxf: [ + { + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 1 + } + }, + right: { + style: 'thin', + color: { + theme: 1 + } + }, + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight8', + pivot: false, + count: 9, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'lastColumn', + dxfId: 5 + }, + { + type: 'firstRowStripe', + dxfId: 4 + }, + { + type: 'secondRowStripe', + dxfId: 3 + }, + { + type: 'firstColumnStripe', + dxfId: 2 + }, + { + type: 'secondColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight7: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight7', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight6: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight6', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight5: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight5', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight4: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight4', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight3: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight3', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight2: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight2', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleLight1: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleLight1', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark11: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark11', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark10: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark10', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark9: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark9 2', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark8: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark8', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark7: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.499984740745262 + }, + bgColor: { + theme: 9, + tint: -0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark7', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark6: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.499984740745262 + }, + bgColor: { + theme: 8, + tint: -0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark6', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark5: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.499984740745262 + }, + bgColor: { + theme: 7, + tint: -0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark5', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark4: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.499984740745262 + }, + bgColor: { + theme: 6, + tint: -0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark4', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark3: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.499984740745262 + }, + bgColor: { + theme: 5, + tint: -0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark3', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark2: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.499984740745262 + }, + bgColor: { + theme: 4, + tint: -0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark2', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + TableStyleDark1: { + dxfs: { + count: 7, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + }, + border: { + right: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.1499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.1499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.4499954222235786 + }, + bgColor: { + theme: 1, + tint: 0.4499954222235786 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'TableStyleDark1', + pivot: false, + count: 7, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 7 + }, + { + type: 'headerRow', + dxfId: 6 + }, + { + type: 'totalRow', + dxfId: 5 + }, + { + type: 'firstColumn', + dxfId: 4 + }, + { + type: 'lastColumn', + dxfId: 3 + }, + { + type: 'firstRowStripe', + dxfId: 2 + }, + { + type: 'firstColumnStripe', + dxfId: 1 + } + ] + } + ] + } + }, + PivotStyleMedium28: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium28', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium27: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium27', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium26: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium26', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium25: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium25', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium24: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium24', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium23: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + b: {}, + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium23', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium22: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium22', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'secondRowStripe', + dxfId: 5 + }, + { + type: 'secondColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalRow', + dxfId: 3 + }, + { + type: 'secondSubtotalRow', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium21: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium21', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium20: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium20', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium19: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium19', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium18: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium18', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium17: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium17', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium16: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium16', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium15: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + }, + border: { + left: {}, + right: {}, + vertical: {} + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.0499893185216834 + }, + bgColor: { + theme: 0, + tint: -0.0499893185216834 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + vertical: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium15', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstSubtotalColumn', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstRowSubheading', + dxfId: 4 + }, + { + type: 'secondRowSubheading', + dxfId: 3 + }, + { + type: 'thirdRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium14: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + right: { + style: 'medium', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + top: { + style: 'medium', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'medium', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium14', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium13: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + right: { + style: 'medium', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + top: { + style: 'medium', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'medium', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium13', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium12: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + right: { + style: 'medium', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + top: { + style: 'medium', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'medium', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium12', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium11: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + right: { + style: 'medium', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + top: { + style: 'medium', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'medium', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium11', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium10: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + right: { + style: 'medium', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + top: { + style: 'medium', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'medium', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium10', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium9: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + right: { + style: 'medium', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + top: { + style: 'medium', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'medium', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium9', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium8: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'medium', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + top: { + style: 'medium', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'medium', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium8', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium7: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 9, + tint: 0.3999755851924192 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium7', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium6: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 8, + tint: 0.3999755851924192 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium6', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium5: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 7, + tint: 0.3999755851924192 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium5', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium4: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 6, + tint: 0.3999755851924192 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium4', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium3: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 5, + tint: 0.3999755851924192 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium3', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium2: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 4, + tint: 0.3999755851924192 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium2', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleMedium1: { + dxfs: { + count: 13, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'double', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleMedium1', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'firstRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'firstHeaderCell', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondSubtotalRow', + dxfId: 5 + }, + { + type: 'firstColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight28: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9 + } + }, + right: { + style: 'thin', + color: { + theme: 9 + } + }, + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + }, + vertical: { + style: 'thin', + color: { + theme: 9 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight28', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight27: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8 + } + }, + right: { + style: 'thin', + color: { + theme: 8 + } + }, + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + }, + vertical: { + style: 'thin', + color: { + theme: 8 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight27', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight26: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7 + } + }, + right: { + style: 'thin', + color: { + theme: 7 + } + }, + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + }, + vertical: { + style: 'thin', + color: { + theme: 7 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight26', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight25: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6 + } + }, + right: { + style: 'thin', + color: { + theme: 6 + } + }, + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + }, + vertical: { + style: 'thin', + color: { + theme: 6 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight25', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight24: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5 + } + }, + right: { + style: 'thin', + color: { + theme: 5 + } + }, + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + }, + vertical: { + style: 'thin', + color: { + theme: 5 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight24', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight23: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4 + } + }, + right: { + style: 'thin', + color: { + theme: 4 + } + }, + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + }, + vertical: { + style: 'thin', + color: { + theme: 4 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight23', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight22: { + dxfs: { + count: 10, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + vertical: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight22', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'firstColumn', + dxfId: 6 + }, + { + type: 'firstRowStripe', + dxfId: 5 + }, + { + type: 'firstColumnStripe', + dxfId: 4 + }, + { + type: 'firstSubtotalColumn', + dxfId: 3 + }, + { + type: 'firstSubtotalRow', + dxfId: 2 + }, + { + type: 'secondSubtotalRow', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight21: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight21', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight20: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight20', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight19: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight19', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight18: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight18', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight17: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight17', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight16: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight16', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight15: { + dxfs: { + count: 11, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight15', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstRowStripe', + dxfId: 8 + }, + { + type: 'firstColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalColumn', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight14: { + dxfs: { + count: 12, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9 + } + }, + right: { + style: 'thin', + color: { + theme: 9 + } + }, + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 9 + } + }, + right: { + style: 'medium', + color: { + theme: 9 + } + }, + top: { + style: 'medium', + color: { + theme: 9 + } + }, + bottom: { + style: 'medium', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 9 + } + }, + right: { + style: 'medium', + color: { + theme: 9 + } + }, + top: { + style: 'medium', + color: { + theme: 9 + } + }, + bottom: { + style: 'medium', + color: { + theme: 9 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: -0.249977111117893 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight14', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'secondColumnSubheading', + dxfId: 3 + }, + { + type: 'thirdColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight13: { + dxfs: { + count: 12, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8 + } + }, + right: { + style: 'thin', + color: { + theme: 8 + } + }, + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 8 + } + }, + right: { + style: 'medium', + color: { + theme: 8 + } + }, + top: { + style: 'medium', + color: { + theme: 8 + } + }, + bottom: { + style: 'medium', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 8 + } + }, + right: { + style: 'medium', + color: { + theme: 8 + } + }, + top: { + style: 'medium', + color: { + theme: 8 + } + }, + bottom: { + style: 'medium', + color: { + theme: 8 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: -0.249977111117893 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight13', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'secondColumnSubheading', + dxfId: 3 + }, + { + type: 'thirdColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight12: { + dxfs: { + count: 12, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7 + } + }, + right: { + style: 'thin', + color: { + theme: 7 + } + }, + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 7 + } + }, + right: { + style: 'medium', + color: { + theme: 7 + } + }, + top: { + style: 'medium', + color: { + theme: 7 + } + }, + bottom: { + style: 'medium', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 7 + } + }, + right: { + style: 'medium', + color: { + theme: 7 + } + }, + top: { + style: 'medium', + color: { + theme: 7 + } + }, + bottom: { + style: 'medium', + color: { + theme: 7 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: -0.249977111117893 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight12', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'secondColumnSubheading', + dxfId: 3 + }, + { + type: 'thirdColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight11: { + dxfs: { + count: 12, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6 + } + }, + right: { + style: 'thin', + color: { + theme: 6 + } + }, + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 6 + } + }, + right: { + style: 'medium', + color: { + theme: 6 + } + }, + top: { + style: 'medium', + color: { + theme: 6 + } + }, + bottom: { + style: 'medium', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 6 + } + }, + right: { + style: 'medium', + color: { + theme: 6 + } + }, + top: { + style: 'medium', + color: { + theme: 6 + } + }, + bottom: { + style: 'medium', + color: { + theme: 6 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: -0.249977111117893 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight11', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'secondColumnSubheading', + dxfId: 3 + }, + { + type: 'thirdColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight10: { + dxfs: { + count: 12, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5 + } + }, + right: { + style: 'thin', + color: { + theme: 5 + } + }, + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 5 + } + }, + right: { + style: 'medium', + color: { + theme: 5 + } + }, + top: { + style: 'medium', + color: { + theme: 5 + } + }, + bottom: { + style: 'medium', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 5 + } + }, + right: { + style: 'medium', + color: { + theme: 5 + } + }, + top: { + style: 'medium', + color: { + theme: 5 + } + }, + bottom: { + style: 'medium', + color: { + theme: 5 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: -0.249977111117893 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight10', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'secondColumnSubheading', + dxfId: 3 + }, + { + type: 'thirdColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight9: { + dxfs: { + count: 12, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4 + } + }, + right: { + style: 'thin', + color: { + theme: 4 + } + }, + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 4 + } + }, + right: { + style: 'medium', + color: { + theme: 4 + } + }, + top: { + style: 'medium', + color: { + theme: 4 + } + }, + bottom: { + style: 'medium', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 4 + } + }, + right: { + style: 'medium', + color: { + theme: 4 + } + }, + top: { + style: 'medium', + color: { + theme: 4 + } + }, + bottom: { + style: 'medium', + color: { + theme: 4 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: -0.249977111117893 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight9', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'secondColumnSubheading', + dxfId: 3 + }, + { + type: 'thirdColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight8: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + }, + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + border: { + right: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight8', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstColumn', + dxfId: 7 + }, + { + type: 'firstRowStripe', + dxfId: 6 + }, + { + type: 'firstColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'secondColumnSubheading', + dxfId: 2 + }, + { + type: 'firstRowSubheading', + dxfId: 1 + }, + { + type: 'secondRowSubheading', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight7: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 9 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 9 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight7', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight6: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 8 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 8 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight6', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight5: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 7 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 7 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight5', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight4: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 6 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 6 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight4', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight3: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 5 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 5 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight3', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight2: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 4 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + color: { + theme: 4 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + vertical: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight2', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleLight1: { + dxfs: { + count: 11, + dxf: [ + { + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + vertical: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0 + }, + bgColor: { + theme: 0 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleLight1', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalRow', + dxfId: 5 + }, + { + type: 'secondSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark28: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark28', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark27: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark27', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark26: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark26', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark25: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark25', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark24: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark24', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark23: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark23', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark22: { + dxfs: { + count: 12, + dxf: [ + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.4499954222235786 + }, + bgColor: { + theme: 0, + tint: -0.4499954222235786 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.4499954222235786 + }, + bgColor: { + theme: 0, + tint: -0.4499954222235786 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + border: { + top: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0 + } + } + } + }, + { + font: { + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.499984740745262 + } + } + }, + border: { + vertical: { + style: 'thin', + color: { + theme: 0 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark22', + table: false, + count: 12, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 11 + }, + { + type: 'headerRow', + dxfId: 10 + }, + { + type: 'totalRow', + dxfId: 9 + }, + { + type: 'firstColumn', + dxfId: 8 + }, + { + type: 'secondRowStripe', + dxfId: 7 + }, + { + type: 'secondColumnStripe', + dxfId: 6 + }, + { + type: 'firstHeaderCell', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'secondSubtotalRow', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark21: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.249977111117893 + }, + bgColor: { + theme: 9, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 9, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9 + }, + bgColor: { + theme: 9 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark21', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark20: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.249977111117893 + }, + bgColor: { + theme: 8, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 8, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8 + }, + bgColor: { + theme: 8 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark20', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark19: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.249977111117893 + }, + bgColor: { + theme: 7, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 7, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7 + }, + bgColor: { + theme: 7 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark19', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark18: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.249977111117893 + }, + bgColor: { + theme: 6, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 6, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6 + }, + bgColor: { + theme: 6 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark18', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark17: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.249977111117893 + }, + bgColor: { + theme: 5, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 5, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5 + }, + bgColor: { + theme: 5 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark17', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark16: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.249977111117893 + }, + bgColor: { + theme: 4, + tint: -0.249977111117893 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 4, + tint: 0.7999816888943144 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark16', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark15: { + dxfs: { + count: 11, + dxf: [ + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1 + }, + bgColor: { + theme: 1 + } + } + } + }, + { + font: { + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.4499954222235786 + }, + bgColor: { + theme: 0, + tint: -0.4499954222235786 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark15', + table: false, + count: 11, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 10 + }, + { + type: 'headerRow', + dxfId: 9 + }, + { + type: 'totalRow', + dxfId: 8 + }, + { + type: 'firstRowStripe', + dxfId: 7 + }, + { + type: 'firstColumnStripe', + dxfId: 6 + }, + { + type: 'firstSubtotalColumn', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstColumnSubheading', + dxfId: 3 + }, + { + type: 'firstRowSubheading', + dxfId: 2 + }, + { + type: 'secondRowSubheading', + dxfId: 1 + }, + { + type: 'pageFieldLabels', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark14: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark14', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark13: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark13', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark12: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark12', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark11: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark11', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark10: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark10', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark9: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark9', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark8: { + dxfs: { + count: 13, + dxf: [ + { + border: { + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + }, + border: { + bottom: { + style: 'medium', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + top: { + style: 'medium', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.4499954222235786 + } + } + } + }, + { + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.249977111117893 + }, + bgColor: { + theme: 1, + tint: 0.249977111117893 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + left: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + right: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + top: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + }, + bottom: { + style: 'medium', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark8', + table: false, + count: 13, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 12 + }, + { + type: 'headerRow', + dxfId: 11 + }, + { + type: 'totalRow', + dxfId: 10 + }, + { + type: 'secondRowStripe', + dxfId: 9 + }, + { + type: 'firstColumnStripe', + dxfId: 8 + }, + { + type: 'secondColumnStripe', + dxfId: 7 + }, + { + type: 'firstSubtotalRow', + dxfId: 6 + }, + { + type: 'secondColumnSubheading', + dxfId: 5 + }, + { + type: 'thirdColumnSubheading', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark7: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.499984740745262 + }, + bgColor: { + theme: 9, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.499984740745262 + }, + bgColor: { + theme: 9, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 9, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + }, + right: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 9, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.499984740745262 + }, + bgColor: { + theme: 9, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: -0.499984740745262 + }, + bgColor: { + theme: 9, + tint: -0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 9 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 9, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 9, + tint: 0.5999938962981048 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 9, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark7', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark6: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.499984740745262 + }, + bgColor: { + theme: 8, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.499984740745262 + }, + bgColor: { + theme: 8, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 8, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + }, + right: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 8, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.499984740745262 + }, + bgColor: { + theme: 8, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: -0.499984740745262 + }, + bgColor: { + theme: 8, + tint: -0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 8 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 8, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 8, + tint: 0.5999938962981048 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 8, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark6', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark5: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.499984740745262 + }, + bgColor: { + theme: 7, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.499984740745262 + }, + bgColor: { + theme: 7, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 7, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + }, + right: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 7, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.499984740745262 + }, + bgColor: { + theme: 7, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: -0.499984740745262 + }, + bgColor: { + theme: 7, + tint: -0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 7 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 7, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 7, + tint: 0.5999938962981048 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 7, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark5', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark4: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.499984740745262 + }, + bgColor: { + theme: 6, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.499984740745262 + }, + bgColor: { + theme: 6, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 6, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + }, + right: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 6, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.499984740745262 + }, + bgColor: { + theme: 6, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: -0.499984740745262 + }, + bgColor: { + theme: 6, + tint: -0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 6 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 6, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 6, + tint: 0.5999938962981048 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 6, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark4', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark3: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.499984740745262 + }, + bgColor: { + theme: 5, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.499984740745262 + }, + bgColor: { + theme: 5, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 5, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + }, + right: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 5, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.499984740745262 + }, + bgColor: { + theme: 5, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: -0.499984740745262 + }, + bgColor: { + theme: 5, + tint: -0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 5 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 5, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 5, + tint: 0.5999938962981048 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 5, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark3', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark2: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.499984740745262 + }, + bgColor: { + theme: 4, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.499984740745262 + }, + bgColor: { + theme: 4, + tint: -0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.7999816888943144 + }, + bgColor: { + theme: 4, + tint: 0.7999816888943144 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + }, + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + }, + right: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.3999755851924192 + }, + bgColor: { + theme: 4, + tint: 0.3999755851924192 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.499984740745262 + }, + bgColor: { + theme: 4, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: -0.499984740745262 + }, + bgColor: { + theme: 4, + tint: -0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 4 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: -0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 4, + tint: 0.7999816888943144 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark2', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + }, + PivotStyleDark1: { + dxfs: { + count: 10, + dxf: [ + { + font: { + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.1499984740745262 + }, + bgColor: { + theme: 0, + tint: -0.1499984740745262 + } + } + }, + border: { + top: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + }, + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 1 + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + border: { + left: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + }, + right: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + }, + { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.3499862666707358 + }, + bgColor: { + theme: 0, + tint: -0.3499862666707358 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + b: {}, + color: { + theme: 0 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 1, + tint: 0.499984740745262 + }, + bgColor: { + theme: 1, + tint: 0.499984740745262 + } + } + }, + border: { + bottom: { + style: 'thin', + color: { + theme: 0 + } + }, + horizontal: { + style: 'thin', + color: { + theme: 1, + tint: 0.499984740745262 + } + } + } + }, + { + font: { + color: { + theme: 1 + } + }, + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 0, + tint: -0.249977111117893 + }, + bgColor: { + theme: 0, + tint: -0.249977111117893 + } + } + }, + border: { + horizontal: { + style: 'thin', + color: { + theme: 0, + tint: -0.1499984740745262 + } + } + } + } + ] + }, + tableStyles: { + count: 1, + defaultTableStyle: 'TableStyleMedium9', + defaultPivotStyle: 'PivotStyleLight16', + tableStyle: [ + { + name: 'PivotStyleDark1', + table: false, + count: 10, + tableStyleElement: [ + { + type: 'wholeTable', + dxfId: 9 + }, + { + type: 'headerRow', + dxfId: 8 + }, + { + type: 'totalRow', + dxfId: 7 + }, + { + type: 'secondRowStripe', + dxfId: 6 + }, + { + type: 'secondColumnStripe', + dxfId: 5 + }, + { + type: 'firstSubtotalRow', + dxfId: 4 + }, + { + type: 'firstRowSubheading', + dxfId: 3 + }, + { + type: 'secondRowSubheading', + dxfId: 2 + }, + { + type: 'pageFieldLabels', + dxfId: 1 + }, + { + type: 'pageFieldValues', + dxfId: 0 + } + ] + } + ] + } + } +}; diff --git a/packages/office-viewer/src/excel/io/excel/stylesheet/parseColor.ts b/packages/office-viewer/src/excel/io/excel/stylesheet/parseColor.ts new file mode 100644 index 000000000..a2fcc06ea --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/stylesheet/parseColor.ts @@ -0,0 +1,11 @@ +/** + * 这个比较常用就封装了一下 + */ + +import {autoParse} from '../../../../common/autoParse'; +import {CT_Color_Attributes} from '../../../../openxml/ExcelTypes'; +import {XMLNode} from '../../../../util/xml'; + +export function parseColor(node: XMLNode) { + return autoParse(node, CT_Color_Attributes); +} diff --git a/packages/office-viewer/src/excel/io/excel/util/Range.ts b/packages/office-viewer/src/excel/io/excel/util/Range.ts new file mode 100644 index 000000000..91cbdb37e --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/Range.ts @@ -0,0 +1,150 @@ +/** + * 处理选区相关的工具函数 + */ + +import {ViewRange} from '../../../sheet/ViewRange'; +import {RangeRef} from '../../../types/RangeRef'; +import {decodeAddress} from './decodeAddress'; +import {numberToLetters} from './numberToLetters'; + +/** + * 解析选区字符串,比如 A1:B2 + */ +export function parseRange(range: string): RangeRef { + if (range.indexOf(':') !== -1) { + const parts = range.split(':'); + if (parts.length !== 2) { + throw new Error('range 格式错误'); + } + const [start, end] = parts; + const startRange = decodeAddress(start); + const endRange = decodeAddress(end); + return { + startRow: startRange.row, + startCol: startRange.col, + endRow: endRange.row, + endCol: endRange.col + }; + } else { + const startRange = decodeAddress(range); + return { + startRow: startRange.row, + startCol: startRange.col, + endRow: startRange.row, + endCol: startRange.col + }; + } +} + +/** + * 将 RangeRef 转换为字符串 + */ +export function rangeRefToString(rangeRef: RangeRef) { + return ( + numberToLetters(rangeRef.startCol) + + (rangeRef.startRow + 1) + + ':' + + numberToLetters(rangeRef.endCol) + + (rangeRef.endRow + 1) + ); +} + +/** + * 扩展选区,取这两个选区合并后最大值 + * @param range1 + * @param range2 + * @returns + */ +export function mergeRange(range1: RangeRef, range2: RangeRef) { + return { + startRow: Math.min(range1.startRow, range2.startRow), + startCol: Math.min(range1.startCol, range2.startCol), + endRow: Math.max(range1.endRow, range2.endRow), + endCol: Math.max(range1.endCol, range2.endCol) + }; +} + +/** + * 判断一个选区是否在另一个选区内 + * @param 主选区 + * @param 被包含的选区 + */ +export function inRange(range: RangeRef, otherRange: RangeRef) { + return ( + range.startRow <= otherRange.startRow && + range.startCol <= otherRange.startCol && + range.endRow >= otherRange.endRow && + range.endCol >= otherRange.endCol + ); +} + +/** + * 判断两个选区是否相等 + * @param range1 + * @param range2 + */ +export function rangeEqual(range1: RangeRef, range2: RangeRef) { + return ( + range1.startRow === range2.startRow && + range1.startCol === range2.startCol && + range1.endRow === range2.endRow && + range1.endCol === range2.endCol + ); +} + +/** + * 判断两个选区是否相交 + */ +export function rangeIntersect(range1: RangeRef, range2: RangeRef) { + return ( + range1.startRow <= range2.endRow && + range1.endRow >= range2.startRow && + range1.startCol <= range2.endCol && + range1.endCol >= range2.startCol + ); +} + +/** + * 这个单元格是否是个合并单元格 + * @param range + * @param mergeCells + * @returns + */ +export function isMergeCell(range: RangeRef, mergeCells: RangeRef[]) { + return mergeCells.some(mergeCell => rangeEqual(mergeCell, range)); +} + +/** + * 是否是单个单元格 + * @param range + */ +export function isSingleCell(range: RangeRef) { + return range.startRow === range.endRow && range.startCol === range.endCol; +} + +/** + * 判断单元格是否在选区内 + */ +export function isCellInRange(range: RangeRef, row: number, col: number) { + return ( + range.startRow <= row && + range.startCol <= col && + range.endRow >= row && + range.endCol >= col + ); +} + +/** + * 基于 viewRange 构建出 RangeRef + */ +export function viewRangeToRangeRef(viewRange: ViewRange) { + const rows = viewRange.rows; + const cols = viewRange.cols; + + return { + startRow: rows[0], + startCol: cols[0], + endRow: rows[rows.length - 1], + endCol: cols[cols.length - 1] + }; +} diff --git a/packages/office-viewer/src/excel/io/excel/util/__tests__/makeBlankValue.test.ts b/packages/office-viewer/src/excel/io/excel/util/__tests__/makeBlankValue.test.ts new file mode 100644 index 000000000..759d05b1a --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/__tests__/makeBlankValue.test.ts @@ -0,0 +1,15 @@ +import {makeBlankValue} from '../makeBlankValue'; + +test('makeBlankValue', () => { + const cellData: any[] = []; + makeBlankValue(cellData, { + startRow: 3, + endRow: 6, + startCol: 2, + endCol: 4 + }); + + expect(cellData[3][3]).toEqual({ + type: 'blank' + }); +}); diff --git a/packages/office-viewer/src/excel/io/excel/util/decodeAddress.ts b/packages/office-viewer/src/excel/io/excel/util/decodeAddress.ts new file mode 100644 index 000000000..24a1b0393 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/decodeAddress.ts @@ -0,0 +1,69 @@ +/** + * 缓存解析结果 + */ +const addressCache: { + [key: string]: { + col: number; + row: number; + }; +} = {}; + +/** + * 将 A1 转成 {col: 0, row: 0} + * 从 exceljs 中拷贝过来的方法 + * 简单进行了修改,必须同时有行和列,如果只有一个就用 lettersToNumber + * 返回结果是从 0 开始的 + * @param value + */ +export function decodeAddress(value: string) { + const addr = value.length < 5 && addressCache[value]; + if (addr) { + return addr; + } + let hasCol = false; + let col = ''; + let colNumber: number = 0; + let hasRow = false; + let row = ''; + let rowNumber: number = 0; + for (let i = 0, char; i < value.length; i++) { + char = value.charCodeAt(i); + // col should before row + if (!hasRow && char >= 65 && char <= 90) { + // 65 = 'A'.charCodeAt(0) + // 90 = 'Z'.charCodeAt(0) + hasCol = true; + col += value[i]; + // colNumber starts from 1 + colNumber = colNumber * 26 + char - 64; + } else if (char >= 48 && char <= 57) { + // 48 = '0'.charCodeAt(0) + // 57 = '9'.charCodeAt(0) + hasRow = true; + row += value[i]; + // rowNumber starts from 0 + rowNumber = rowNumber * 10 + char - 48; + } else if (hasRow && hasCol && char !== 36) { + // 36 = '$'.charCodeAt(0) + break; + } + } + if (colNumber > 16384) { + throw new Error(`Out of bounds. Invalid column letter: ${col}`); + } + + // in case $row$col + value = col + row; + + const address = { + col: colNumber - 1, + row: rowNumber - 1 + }; + + // mem fix - cache only the tl 100x100 square + if (colNumber && colNumber <= 100 && rowNumber && rowNumber <= 100) { + addressCache[value] = address; + } + + return address; +} diff --git a/packages/office-viewer/src/excel/io/excel/util/fromExcelDate.ts b/packages/office-viewer/src/excel/io/excel/util/fromExcelDate.ts new file mode 100644 index 000000000..bd8901629 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/fromExcelDate.ts @@ -0,0 +1,42 @@ +const pasteCache: Record = {}; + +/** + * 将 Excel 日期转换为 Date 对象 + * 来自 https://github.com/RaschidJFR/js-excel-date-convert + * @param excelDate Excel 日期 + * @param date1904 是否使用 1904 年作为基准 + */ + +export function fromExcelDate(excelDate: number | string, date1904: boolean) { + const cacheKey = `${excelDate}-${date1904}`; + if (pasteCache[cacheKey]) { + return new Date(pasteCache[cacheKey]); + } + if (typeof excelDate === 'string') { + excelDate = parseInt(excelDate, 10); + } + const daysIn4Years = 1461; + const daysIn70years = Math.round(25567.5 + 1); // +1 because of the leap-year bug + const daysFrom1900 = excelDate + (date1904 ? daysIn4Years + 1 : 0); + const daysFrom1970 = daysFrom1900 - daysIn70years; + const secondsFrom1970 = daysFrom1970 * (3600 * 24); + const utc = new Date(secondsFrom1970 * 1000); + pasteCache[cacheKey] = utc.getTime(); + return utc; +} + +/** + * Encode date to excel + * @param {Date} date + * @param {boolean} [date1904] Whether to use the 1904 Date System. See https://bettersolutions.com/excel/dates-times/1904-date-system.htm + * @author Raschid JF Rafaelly + */ +export function toExcelDate(date: Date, date1904: boolean = false) { + // see https://bettersolutions.com/excel/dates-times/1904-date-system.htm + const daysIn4Years = 1461; + const daysIn70years = Math.round(25567.5 + 1); // +1 because of the leap-year bug + const daysFrom1970 = date.getTime() / 1000 / 3600 / 24; + const daysFrom1900 = daysFrom1970 + daysIn70years; + const daysFrom1904Jan2nd = daysFrom1900 - daysIn4Years - 1; + return Math.round(date1904 ? daysFrom1904Jan2nd : daysFrom1900); +} diff --git a/packages/office-viewer/src/excel/io/excel/util/lettersToNumber.ts b/packages/office-viewer/src/excel/io/excel/util/lettersToNumber.ts new file mode 100644 index 000000000..8092ea43c --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/lettersToNumber.ts @@ -0,0 +1,9 @@ +/** + * 将字母转成数字 + */ +export function lettersToNumber(letters: string) { + for (var p = 0, n = 0; p < letters.length; p++) { + n = letters[p].charCodeAt(0) - 64 + n * 26; + } + return n; +} diff --git a/packages/office-viewer/src/excel/io/excel/util/makeBlankValue.ts b/packages/office-viewer/src/excel/io/excel/util/makeBlankValue.ts new file mode 100644 index 000000000..68b0e1276 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/makeBlankValue.ts @@ -0,0 +1,23 @@ +import {CellData} from '../../../types/worksheet/CellData'; + +import {RangeRef} from '../../../types/RangeRef'; + +/** + * 制造空值,这个主要是给 containsBlanks 条件格式用,目前的实现下如果没有值就没法渲染 + */ +export function makeBlankValue(cellData: CellData[][], range: RangeRef) { + for (let i = range.startRow; i <= range.endRow; i++) { + let rowData = cellData[i]; + if (!rowData) { + rowData = []; + cellData[i] = rowData; + } + for (let j = range.startCol; j <= range.endCol; j++) { + if (rowData[j] === undefined) { + rowData[j] = { + type: 'blank' + }; + } + } + } +} diff --git a/packages/office-viewer/src/excel/io/excel/util/numberToLetters.ts b/packages/office-viewer/src/excel/io/excel/util/numberToLetters.ts new file mode 100644 index 000000000..b553ff6b2 --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/util/numberToLetters.ts @@ -0,0 +1,12 @@ +/** + * 数字转成字母名,这个输入是从 0 开始,所以不需要加 1 + */ + +export function numberToLetters(num: number) { + let letters = ''; + while (num >= 0) { + letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[num % 26] + letters; + num = Math.floor(num / 26) - 1; + } + return letters; +} diff --git a/packages/office-viewer/src/excel/io/excel/worksheet/parseSheetData.ts b/packages/office-viewer/src/excel/io/excel/worksheet/parseSheetData.ts new file mode 100644 index 000000000..15cfc3e6e --- /dev/null +++ b/packages/office-viewer/src/excel/io/excel/worksheet/parseSheetData.ts @@ -0,0 +1,121 @@ +import {CT_Row, CT_Row_Attributes} from '../../../../openxml/ExcelTypes'; +import {XMLNode} from '../../../../util/xml'; +import {StringItem} from '../../../types/StringItem'; +import {ICell, CT_Cell_Attributes} from '../../../types/worksheet/ICell'; + +import {CellData, BlankData} from '../../../types/worksheet/CellData'; +import {decodeAddress} from '../util/decodeAddress'; +import {autoParse} from '../../../../common/autoParse'; + +/** + * 解析 sheetData + */ + +export function parseSheetData( + sheetDataNode: XMLNode, + sharedStrings: StringItem[] +) { + const rows: CT_Row[] = []; + const cellData: CellData[][] = []; + + for (const rowNode of sheetDataNode.children || []) { + // 这里不自动填充默认值,因为数据量可能很大,后面代码里判断 + const row = autoParse(rowNode, CT_Row_Attributes) as CT_Row; + // 行号,改成从 0 开始 + const r = (row.r || 1) - 1; + rows[r] = row; + + for (const cellNode of rowNode.children || []) { + const cell = autoParse(cellNode, CT_Cell_Attributes) as ICell; + const cellType = cell.t; + const styleIndex = cell.s; + /** + * 列号,改成从 0 开始 + */ + const colNumber = decodeAddress(cell.r!).col!; + // 开始解析 cell 里的数据 + let value: CellData = ''; + let formula = ''; + for (const cellNodeChild of cellNode.children || []) { + const tag = cellNodeChild.tag; + switch (tag) { + case 'v': + // shared string + if (cellType === 's') { + const index = parseInt(cellNodeChild.text || ''); + value = sharedStrings[index]; + } else if (cellType == 'd') { + value = { + type: 'date', + value: cellNodeChild.text || '' + }; + } else { + value = cellNodeChild.text || ''; + } + break; + case 'f': + formula = cellNodeChild.text || ''; + break; + + case 'is': + // 这种基本上是 inlineStr + for (const isNode of cellNodeChild.children || []) { + const tag = isNode.tag; + if (tag === 't' && cellType === 'inlineStr') { + value = isNode.text || ''; + } + } + break; + + default: + break; + } + + if (formula && typeof value === 'string') { + value = { + type: 'formula', + formula, + value: value + }; + } + + if (styleIndex) { + if (typeof value === 'string') { + value = { + type: 'style', + s: styleIndex, + value: value + }; + } else if (typeof value === 'object') { + value.s = styleIndex; + } + } + + if (cellData[r]) { + cellData[r][colNumber] = value; + } else { + cellData[r] = []; + cellData[r][colNumber] = value; + } + } + // 有些节点没数据,就只有边框样式或合并单元格 + if (!cellNode.children || cellNode.children.length === 0) { + const emptyValue: BlankData = { + type: 'blank', + s: styleIndex + }; + if (cellData[r]) { + cellData[r][colNumber] = emptyValue; + } else { + cellData[r] = []; + cellData[r][colNumber] = emptyValue; + } + } + } + } + + return { + rows, + cellData + }; +} diff --git a/packages/office-viewer/src/excel/io/parseCSV.ts b/packages/office-viewer/src/excel/io/parseCSV.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/office-viewer/src/excel/io/parseExcel.ts b/packages/office-viewer/src/excel/io/parseExcel.ts new file mode 100644 index 000000000..5d5dad8e0 --- /dev/null +++ b/packages/office-viewer/src/excel/io/parseExcel.ts @@ -0,0 +1,29 @@ +/** + * 解析 Excel 格式,转成内部数据结构 + */ + +import {PackageParser} from '../../package/PackageParser'; +import {ExcelFile} from '../types/ExcelFile'; +import {parseWorkbook} from './excel/parseWorkbook'; +import {parseContentType} from '../../common/parseContentType'; +import {xml2json} from '../../util/xml'; + +import {CT_Stylesheet_Attributes} from '../../openxml/ExcelTypes'; +import {autoParse} from '../../common/autoParse'; + +/** + * 解析 Excel + * @param parser + */ +export async function parseExcel(parser: PackageParser): Promise { + const contentTypes = await parseContentType(parser); + + const styleSheetNode = await xml2json(parser.getString('xl/styles.xml')); + const styleSheet = autoParse(styleSheetNode, CT_Stylesheet_Attributes); + + const workbook = await parseWorkbook(parser, styleSheet); + return { + contentTypes, + workbook + }; +} diff --git a/packages/office-viewer/src/excel/lang/en_US.ts b/packages/office-viewer/src/excel/lang/en_US.ts new file mode 100644 index 000000000..55d35c283 --- /dev/null +++ b/packages/office-viewer/src/excel/lang/en_US.ts @@ -0,0 +1,25 @@ +export const en_US = { + 'autoFilter.sortAscending': 'Ascending', + 'autoFilter.sortDescending': 'Descending', + 'checkBox.selectAll': '(Select All)', + 'checkBox.search': 'Search', + 'customFilter.equal': 'Equals', + 'customFilter.notEqual': 'Does not equal', + 'customFilter.greaterThan': 'Greater than', + 'customFilter.greaterThanOrEqual': 'Greater than or equal to', + 'customFilter.lessThan': 'Less than', + 'customFilter.lessThanOrEqual': 'Less than or equal to', + 'customFilter.beginsWith': 'Begins with', + 'customFilter.notBeginsWith': 'Does not begin with', + 'customFilter.endsWith': 'Ends with', + 'customFilter.notEndsWith': 'Does not end with', + 'customFilter.contains': 'Contains', + 'customFilter.notContains': 'Does not contain', + 'customFilter.and': 'And', + 'customFilter.or': 'Or', + 'average': 'Average', + 'count': 'Count', + 'sum': 'SUM' +}; + +export type EnKeys = keyof typeof en_US; diff --git a/packages/office-viewer/src/excel/lang/lang.ts b/packages/office-viewer/src/excel/lang/lang.ts new file mode 100644 index 000000000..485710f0d --- /dev/null +++ b/packages/office-viewer/src/excel/lang/lang.ts @@ -0,0 +1,20 @@ +import {en_US, EnKeys} from './en_US'; +import {zh_CN} from './zh_CN'; + +const languages = { + en_US, + zh_CN +}; + +export type Language = keyof typeof languages; + +export function getTranslate(language: string) { + language = language.replace('-', '_'); + if (!(language in languages)) { + console.warn('language not found, use en_US instead', language); + language = 'en_US'; + } + return (key: EnKeys) => { + return languages[language as Language][key]; + }; +} diff --git a/packages/office-viewer/src/excel/lang/zh_CN.ts b/packages/office-viewer/src/excel/lang/zh_CN.ts new file mode 100644 index 000000000..9e40938f1 --- /dev/null +++ b/packages/office-viewer/src/excel/lang/zh_CN.ts @@ -0,0 +1,25 @@ +import type {EnKeys} from './en_US'; + +export const zh_CN: Record = { + 'autoFilter.sortAscending': '升序', + 'autoFilter.sortDescending': '降序', + 'checkBox.selectAll': '全选', + 'checkBox.search': '搜索', + 'customFilter.equal': '等于', + 'customFilter.notEqual': '不等于', + 'customFilter.greaterThan': '大于', + 'customFilter.greaterThanOrEqual': '大于或等于', + 'customFilter.lessThan': '小于', + 'customFilter.lessThanOrEqual': '小于或等于', + 'customFilter.beginsWith': '开头是', + 'customFilter.notBeginsWith': '开头不是', + 'customFilter.endsWith': '结尾是', + 'customFilter.notEndsWith': '结尾不是', + 'customFilter.contains': '包含', + 'customFilter.notContains': '不包含', + 'customFilter.and': '与', + 'customFilter.or': '或', + 'average': '平均值', + 'count': '计数', + 'sum': '求和' +}; diff --git a/packages/office-viewer/src/excel/print/printStyle.ts b/packages/office-viewer/src/excel/print/printStyle.ts new file mode 100644 index 000000000..abd32359c --- /dev/null +++ b/packages/office-viewer/src/excel/print/printStyle.ts @@ -0,0 +1,24 @@ +/** + * 打印样式 + */ +export function printStyle(gridLineColor: string) { + return ` + +`; +} diff --git a/packages/office-viewer/src/excel/print/renderInIframe.ts b/packages/office-viewer/src/excel/print/renderInIframe.ts new file mode 100644 index 000000000..ba389589b --- /dev/null +++ b/packages/office-viewer/src/excel/print/renderInIframe.ts @@ -0,0 +1,30 @@ +import {Workbook} from '../Workbook'; +import {MAX_COL, MAX_ROW} from '../render/Consts'; +import {rangeToHTML} from '../render/selection/buildHTML/rangeToHTML'; +import {printStyle} from './printStyle'; + +/** + * 目前打印基于拷贝功能实现,所以还不支持图表及图片等 drawing 元素 + * @param iframe + * @param workbook + */ +export function renderInIframe(iframe: HTMLIFrameElement, workbook: Workbook) { + const printDocument = iframe.contentDocument!; + + const allRange = { + startRow: 0, + startCol: 0, + endRow: MAX_ROW, + endCol: MAX_COL + }; + + const {table} = rangeToHTML(workbook, allRange); + + let borderColor = workbook.renderOptions.gridLineColor; + + if (workbook.getActiveSheet().showGridLines() === false) { + borderColor = 'transparent'; + } + + printDocument.write(printStyle(borderColor) + table); +} diff --git a/packages/office-viewer/src/excel/render/Canvas.ts b/packages/office-viewer/src/excel/render/Canvas.ts new file mode 100644 index 000000000..7c97abe87 --- /dev/null +++ b/packages/office-viewer/src/excel/render/Canvas.ts @@ -0,0 +1,434 @@ +/** + * Canvas 的简单封装,方便绘制图形 + */ + +import {Line} from './Line'; +import {drawOffscreenCanvas} from './canvas/drawOffscreenCanvas'; +import {setPixelRatio} from './canvas/setPixelRatio'; +import {Widget} from './widget/Widget'; + +export class Canvas { + canvas: HTMLCanvasElement; + ctx: CanvasRenderingContext2D; + + width: number; + height: number; + + widgets: Map = new Map(); + + /** + * 缩放比例 + */ + zoom: number = 1; + + ratio: number = 1; + + constructor(width: number, height: number, zoom: number, className: string) { + this.canvas = document.createElement('canvas'); + this.ctx = this.canvas.getContext('2d')!; + this.width = width; + this.height = height; + this.ratio = setPixelRatio(this.canvas, width, height); + this.canvas.className = className; + this.zoom = zoom; + this.setZoom(); + this.canvas.addEventListener('mousemove', this.handleMousemove.bind(this)); + } + + private setZoom() { + const zoom = this.zoom; + if (zoom && zoom !== 1) { + this.ctx.scale(zoom, zoom); + } + } + + async renderWidget(widget: Widget) { + const ratio = this.ratio * this.zoom; + const {x, y, width, height} = widget.getClientBounding(); + const imageData = await widget.draw(); + this.ctx.putImageData(imageData, x * ratio, y * ratio); + } + + lastTarget: Widget | null = null; + + /** + * 鼠标移动的时候判断是否在某个 widget 上 + */ + handleMousemove(event: MouseEvent) { + let {offsetX, offsetY} = event; + offsetX = offsetX / this.zoom; + offsetY = offsetY / this.zoom; + + for (const widget of this.widgets.values()) { + if (widget.isPointInWidget(offsetX, offsetY)) { + if (this.lastTarget && this.lastTarget !== widget) { + this.lastTarget.onMouseout(); + } else { + this.lastTarget = widget; + widget.onMouseover(); + } + } + } + } + + updateCursor(cursor: string) { + this.canvas.style.cursor = cursor; + } + + hasWidget(key: string) { + return this.widgets.has(key); + } + + addWidget(key: string, widget: Widget) { + this.widgets.set(key, widget); + this.renderWidget(widget); + } + + getRealRatio() { + return this.ratio * this.zoom; + } + + getCanvasElement() { + return this.canvas; + } + + getContext() { + return this.ctx; + } + + updateZoom(zoom: number) { + this.zoom = zoom; + this.ctx.resetTransform(); + this.ctx.scale(this.ratio * zoom, this.ratio * zoom); + this.clearCache(); + } + + /** + * 清空画布 + */ + clear(width?: number, height?: number) { + const ctx = this.ctx; + ctx.clearRect( + 0, + 0, + (width || this.width) / this.zoom, + (height || this.height) / this.zoom + ); + } + + clearRect(x: number, y: number, width: number, height: number) { + const ctx = this.ctx; + ctx.clearRect(x, y, width, height); + } + + clearRectPadding( + x: number, + y: number, + width: number, + height: number, + padding: number + ) { + this.clearRect( + x + padding, + y + padding, + width - padding * 2, + height - padding * 2 + ); + } + + /** + * 绘制线条 + * @param line 线条配置 + * @param color + * @param width + */ + drawLine(line: Line, color: string, width = 1) { + const ctx = this.ctx; + ctx.beginPath(); + ctx.moveTo(line.x1, line.y1); + ctx.lineTo(line.x2, line.y2); + ctx.strokeStyle = color; + ctx.lineWidth = width; + ctx.stroke(); + } + + setLineDash(line: Line, segments: number[], color: string, width = 1) { + const ctx = this.ctx; + ctx.beginPath(); + ctx.moveTo(line.x1, line.y1); + ctx.lineTo(line.x2, line.y2); + ctx.strokeStyle = color; + ctx.lineWidth = width; + ctx.setLineDash(segments); + ctx.stroke(); + ctx.setLineDash([]); + } + + /** + * 绘制多个线条 + * @param line 多个线条配置 + * @param width + * @param height + * @param color + */ + drawLines(lines: Line[], color: string, width = 1) { + const ctx = this.ctx; + ctx.beginPath(); + lines.forEach(line => { + ctx.moveTo(line.x1, line.y1); + ctx.lineTo(line.x2, line.y2); + }); + ctx.strokeStyle = color; + ctx.lineWidth = width; + ctx.stroke(); + } + + /** + * 绘制字体 + * @param font + * @param color + * @param text + * @param x + * @param y + * @param textBaseline + */ + drawText( + font: string, + color = '#000', + text: string, + x: number, + y: number, + textBaseline: CanvasTextBaseline = 'middle' + ) { + const ctx = this.ctx; + ctx.font = font; + ctx.fillStyle = color; + ctx.textBaseline = textBaseline; + ctx.fillText(text, x, y); + } + + /** + * 绘制矩形 + */ + drawRect(x: number, y: number, width: number, height: number, color: string) { + const ctx = this.ctx; + ctx.fillStyle = color; + ctx.fillRect(x, y, width, height); + } + + /** + * 绘制带 padding 的矩形 + */ + drawRectWithPadding( + x: number, + y: number, + width: number, + height: number, + color: string, + padding: number + ) { + const ctx = this.ctx; + ctx.fillStyle = color; + ctx.fillRect( + x + padding, + y + padding, + width - padding * 2, + height - padding * 2 + ); + } + + drawRectLinearGradientWithPadding( + x: number, + y: number, + width: number, + height: number, + color: string, + colorEnd: string, + padding: number + ) { + const displayWidth = Math.max(1, width - padding * 2); + const ctx = this.ctx; + // gradient 坐标是全局的 + const grd = ctx.createLinearGradient( + x + padding, + y + padding, + x + padding + displayWidth, + y + padding + ); + grd.addColorStop(0, color); + grd.addColorStop(1, colorEnd); + ctx.fillStyle = grd; + ctx.fillRect(x + padding, y + padding, displayWidth, height - padding * 2); + } + + /** + * 绘制带透明度的矩形 + */ + drawAlphaRect( + x: number, + y: number, + width: number, + height: number, + color: string, + alpha: number + ) { + const ctx = this.ctx; + ctx.globalAlpha = alpha; + ctx.fillStyle = color; + ctx.fillRect(x, y, width, height); + ctx.globalAlpha = 1; + } + + /** + * 绘制带透明度的矩形,加 padding + */ + drawAlphaRectPadding( + x: number, + y: number, + width: number, + height: number, + padding: number, + color: string, + alpha: number + ) { + return this.drawAlphaRect( + x + padding, + y + padding, + width - padding * 2, + height - padding * 2, + color, + alpha + ); + } + + /** + * 绘制矩形边框 + */ + drawStrokeRect( + x: number, + y: number, + width: number, + height: number, + color: string, + lineWidth = 1 + ) { + const ctx = this.ctx; + ctx.strokeStyle = color; + ctx.lineWidth = lineWidth; + ctx.strokeRect(x, y, width, height); + } + + /** + * 绘制带 padding 的矩形边框 + */ + drawStrokeRectPadding( + x: number, + y: number, + width: number, + height: number, + color: string, + lineWidth = 1, + padding = 1 + ) { + this.drawStrokeRect( + x + padding, + y + padding, + width - padding * 2, + height - padding * 2, + color, + lineWidth + ); + } + + drawImage(url: string, x: number, y: number, width: number, height: number) { + const img = new Image(); + img.src = url; + img.onload = () => { + this.ctx.drawImage(img, x, y, width, height); + }; + } + + imageCache = new Map(); + + /** + * 绘制图片,并使用缓存 + * @param url + * @param x + * @param y + * @param width + * @param height + */ + async drawImageWithCache( + url: string, + x: number, + y: number, + width: number, + height: number + ): Promise { + return new Promise((resolve, reject) => { + const ratio = this.ratio * this.zoom; + const cacheKey = `${url}-${width}-${height}`; + // 根据 mdn 文档,最好是整数 + // https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Optimizing_canvas#avoid_floating-point_coordinates_and_use_integers_instead + width = Math.floor(width); + height = Math.floor(height); + // 避免报错 + if (width === 0 || height === 0) { + resolve(); + return; + } + const cache = this.imageCache.get(cacheKey); + if (cache) { + this.ctx.drawImage(cache, x, y, width, height); + resolve(); + return; + } + const img = new Image(); + img.src = url; + img.onload = () => { + const imageBitmap = drawOffscreenCanvas(ratio, width, height, ctx => { + ctx.drawImage(img, 0, 0, width, height); + }); + this.ctx.drawImage(imageBitmap, x, y, width, height); + this.imageCache.set(cacheKey, imageBitmap); + resolve(); + }; + img.onerror = reject; + }); + } + + /** + * 运行绘制并缓存 + */ + async customDrawWithCache( + cacheKey: string, + x: number, + y: number, + width: number, + height: number, + func: (ctx: OffscreenCanvasRenderingContext2D, ratio: number) => void + ): Promise { + return new Promise((resolve, reject) => { + const ratio = this.ratio * this.zoom; + const cache = this.imageCache.get(cacheKey); + if (cache) { + this.ctx.drawImage(cache, x, y, width, height); + resolve(); + return; + } + const imageBitmap = drawOffscreenCanvas(ratio, width, height, ctx => { + func(ctx, ratio); + }); + this.ctx.drawImage(imageBitmap, x, y, width, height); + this.imageCache.set(cacheKey, imageBitmap); + resolve(); + }); + } + + /** + * 清空缓存 + */ + clearCache() { + this.imageCache.clear(); + } +} diff --git a/packages/office-viewer/src/excel/render/Consts.ts b/packages/office-viewer/src/excel/render/Consts.ts new file mode 100644 index 000000000..fa33ca330 --- /dev/null +++ b/packages/office-viewer/src/excel/render/Consts.ts @@ -0,0 +1,25 @@ +/** + * 统一放一些常量方便修改 + */ + +export const DEFAULT_FONT_SIZE = 12; + +/** + * 默认颜色,目前应该就是边框用到 + */ +export const AUTO_COLOR = '#000000'; + +/** + * 单元格的 padding + */ +export const PADDING_SIZE = 4; + +/** + * 最长列数,从 0 开始 + */ +export const MAX_COL = 16383; + +/** + * 最大行数,从 0 开始 + */ +export const MAX_ROW = 1048575; diff --git a/packages/office-viewer/src/excel/render/ExcelRender.ts b/packages/office-viewer/src/excel/render/ExcelRender.ts new file mode 100644 index 000000000..818aca64a --- /dev/null +++ b/packages/office-viewer/src/excel/render/ExcelRender.ts @@ -0,0 +1,606 @@ +/** + * 实现 Excel 渲染 + */ + +import type {Workbook} from '../Workbook'; +import {ScrollBar} from './ScrollBar'; +import {Sheet} from '../sheet/Sheet'; +import {SheetCanvas} from './SheetCanvas'; +import type {ExcelRenderOptions} from '../sheet/ExcelRenderOptions'; + +import {throttle} from '../../util/throttle'; +import {IDataProvider} from '../types/IDataProvider'; +import {FontSize} from '../types/FontSize'; +import {drawGridLines} from './grid/drawGridLines'; +import {drawCells} from './cell/drawCells'; +import {drawRowColHeaders} from './header/drawRowColHeaders'; +import {debounce} from '../../util/debounce'; +import {drawFrozen} from './cell/frozen/drawFrozen'; +import {SelectionCanvas} from './SelectionCanvas'; +import {updateCursor} from './selection/updateCursor'; +import {dragState, handleMousedown} from './dnd/handleMousedown'; +import {Scroll} from './scroll/Scroll'; +import {drawDrawing} from './drawing/drawDrawing'; +import {drawSparkline} from './sparkline/drawSparkline'; +import {isValidURL} from '../../util/isValidURL'; +import {LinkPosition} from './cell/LinkPosition'; +import {isPointerOnLink} from './cell/isPointerOnLink'; +import {ResizeBox} from './drawing/ResizeBox'; +import {renderAutoFilter} from './autoFilter/renderAutoFilter'; +import {AutoFilterIconUI} from './autoFilter/AutoFilterIconUI'; +import {getMouseRelativePosition} from './dnd/getMouseRelativePosition'; +import {CellEditor} from '../edit/ui/CellEditor'; +import {getAllNotAvailableFont} from './cell/checkFont'; +import {inValidTextSizeCache} from './cell/measureTextWithCache'; + +export class ExcelRender { + /** + * 主内容区 + */ + private contentContainer: HTMLElement; + + /** + * 数据区 + */ + private dataContainer: HTMLElement; + + private workbook: Workbook; + + /** + * 主内容区的 Canvas + */ + private sheetCanvas: SheetCanvas; + + /** + * 选区的 Canvas + */ + private selectionCanvas: SelectionCanvas; + + /** + * 滚动条 + */ + scrollbar: ScrollBar; + + /** + * 调整大小的操作框 + */ + resizeBox: ResizeBox; + + renderOptions: ExcelRenderOptions; + + dataProvider: IDataProvider; + + /** + * 默认字体大小,用于一些计算 + */ + defaultFontSize: FontSize; + + /** + * 上一次滚动的位置,这个是为了滚动时固定某个方向 + */ + lastScroll: Scroll = {left: 0, top: 0}; + + linkPositionCache: LinkPosition[] = []; + + autoFiltersUI: AutoFilterIconUI[] = []; + + constructor( + contentContainer: HTMLElement, + dataContainer: HTMLElement, + workbook: Workbook, + dataProvider: IDataProvider, + renderOptions: ExcelRenderOptions + ) { + this.contentContainer = contentContainer; + + this.dataContainer = dataContainer; + this.workbook = workbook; + this.renderOptions = renderOptions; + + this.contentContainer.addEventListener( + 'wheel', + this.handleWheel.bind(this), + { + passive: false + } + ); + + this.contentContainer.addEventListener( + 'mousedown', + this.handleMousedown.bind(this) + ); + + this.contentContainer.addEventListener( + 'mouseup', + this.handleMouseup.bind(this) + ); + + this.contentContainer.addEventListener( + 'touchstart', + this.handleMousedown.bind(this) + ); + + // 避免过于频繁 + this.handleMousemove = debounce(this.handleMousemove, 16); + this.contentContainer.addEventListener( + 'mousemove', + this.handleMousemove.bind(this) + ); + + this.dataContainer.addEventListener( + 'dblclick', + this.handleDblclick.bind(this) + ); + + this.sheetCanvas = new SheetCanvas(workbook, dataProvider); + const sheetCanvasElement = this.sheetCanvas.getCanvasElement(); + + this.contentContainer.appendChild(sheetCanvasElement); + + this.selectionCanvas = new SelectionCanvas(workbook, dataProvider); + this.contentContainer.appendChild(this.selectionCanvas.getCanvasElement()); + + this.scrollbar = new ScrollBar(contentContainer, workbook); + + this.resizeBox = new ResizeBox(contentContainer); + + this.defaultFontSize = dataProvider.getDefaultFontSize(); + this.dataProvider = dataProvider; + + this.draw = this.draw.bind(this); + + workbook.uiEvent.on('SWITCH_SHEET', (sheet: Sheet) => { + // 这里面会有一些 HTML,清空一下避免问题 + this.dataContainer.innerHTML = ''; + + this.draw(); + }); + + workbook.uiEvent.on('CHANGE_ZOOM_LEVEL', scale => { + this.sheetCanvas.updateZoom(scale); + this.selectionCanvas.updateZoom(scale); + this.draw(); + this.selectionCanvas.draw(); + }); + + workbook.uiEvent.on('SCROLL_X', (x: number) => { + this.workbook.getActiveSheet().setScrollLeft(x); + this.draw(); + }); + + workbook.uiEvent.on('SCROLL_Y', (y: number) => { + this.workbook.getActiveSheet().setScrollTop(y); + this.draw(); + }); + + workbook.uiEvent.on('APPLY_AUTO_FILTER', (sheetIndex: number) => { + const currentSheetIndex = this.workbook.getActiveSheet().getIndex(); + if (currentSheetIndex === sheetIndex) { + this.draw(); + } + }); + + workbook.uiEvent.on('UPDATE_RANGE', (sheetIndex: number) => { + // 目前简单处理,后面需要支持局部渲染 + const currentSheetIndex = this.workbook.getActiveSheet().getIndex(); + if (currentSheetIndex === sheetIndex) { + this.draw(); + } + }); + + workbook.uiEvent.on('UPDATE_ROW_HEIGHT', (row: number, height: number) => { + this.draw(); + }); + + workbook.uiEvent.on('UPDATE_COL_WIDTH', (col: number, width: number) => { + this.draw(); + }); + + this.watchResize(); + } + + lastScrollDirection: 'vertical' | 'horizontal' = 'vertical'; + + lastScrollDirectionTime = 0; + + scrollDirectionLockTime = 100; + + getSelectionCanvas() { + return this.selectionCanvas; + } + + watchResize() { + const contentContainer = this.contentContainer; + // 监听容器大小变化 + let lastWidth = contentContainer.clientWidth; + let lastHeight = contentContainer.clientHeight; + const containerObserver = new ResizeObserver(entries => { + const entry = entries[0]; + const {width, height} = entry.contentRect; + if ( + Math.floor(lastWidth) === Math.floor(width) && + Math.floor(lastHeight) === Math.floor(height) + ) { + return; + } + lastWidth = width; + lastHeight = height; + this.draw(); + }); + + containerObserver.observe(contentContainer); + } + + /** + * 处理滚轮事件 + */ + handleWheel(event: WheelEvent) { + let {deltaX, deltaY, deltaMode} = event; + const currentSheet = this.workbook.getActiveSheet(); + // 按住 shift 键就当成水平滚动 + const isScrollingHorizontally = + event.shiftKey || Math.abs(deltaX) > Math.abs(deltaY); + + event.preventDefault(); + event.stopPropagation(); + if (this.ignoreScrollDirection(isScrollingHorizontally)) { + return false; + } + + deltaX = Math.floor(deltaX); + deltaY = Math.floor(deltaY); + + // 按住 shift 就只有水平滚动 + if (isScrollingHorizontally) { + currentSheet.deltaScrollLeft(deltaX); + } else { + currentSheet.deltaScrollTop(deltaY); + } + + const scroll = { + left: Math.floor(currentSheet.getScrollLeft()), + top: Math.floor(currentSheet.getScrollTop()) + }; + + if ( + this.lastScroll.left !== scroll.left || + this.lastScroll.top !== scroll.top + ) { + this.lastScroll = scroll; + this.draw(); + // 滚动结束后触发 + this.afterScroll(scroll); + } + + return false; + } + + /** + * 处理单元格双击事件 + */ + handleDblclick(event: MouseEvent) { + if (this.renderOptions.editable === false) { + return; + } + const {offsetX, offsetY} = this.getMouseRelativePosition(event); + + const hitTestResult = this.workbook + .getActiveSheet() + .hitTest(offsetX, offsetY); + + if (hitTestResult && hitTestResult.type === 'cell') { + new CellEditor(this.dataContainer, this.workbook, hitTestResult); + } + } + + /** + * 处理鼠标按下事件 + */ + handleMousedown(event: MouseEvent) { + let {offsetX, offsetY} = this.getMouseRelativePosition(event); + + const hitTestResult = this.workbook + .getActiveSheet() + .hitTest(offsetX, offsetY); + + if (hitTestResult) { + handleMousedown( + this.workbook, + hitTestResult, + this.contentContainer, + event + ); + } + } + + /** + * 处理鼠标松开事件,目前主要是处理点击链接的场景 + */ + handleMouseup(event: MouseEvent) { + // 拖动过程中就不处理这个事件 + if (dragState.isDragging) { + return; + } + let {offsetX, offsetY} = this.getMouseRelativePosition(event); + + const pointerOnLink = isPointerOnLink( + offsetX, + offsetY, + this.linkPositionCache + ); + + if (pointerOnLink) { + window.open(pointerOnLink); + } + + const hitTestResult = this.workbook + .getActiveSheet() + .hitTest(offsetX, offsetY); + + this.resizeBox.hide(); + + if (hitTestResult) { + if (hitTestResult.type === 'drawing') { + this.selectionCanvas.clearSelection(); + this.resizeBox.updatePosition( + hitTestResult.x, + hitTestResult.y, + hitTestResult.width, + hitTestResult.height + ); + } + } + } + + /** + * 处理鼠标移动事件 + */ + handleMousemove(event: MouseEvent) { + // 拖动过程中就不处理这个事件 + if (dragState.isDragging) { + return; + } + + let {offsetX, offsetY} = this.getMouseRelativePosition(event); + + offsetX = Math.round(offsetX); + offsetY = Math.round(offsetY); + + // 重置鼠标样式 + this.contentContainer.style.cursor = 'cell'; + const hitTestResult = this.workbook + .getActiveSheet() + .hitTest(offsetX, offsetY); + + // 用于快速了解当前鼠标位置 + if (this.renderOptions.debug) { + this.renderOptions.mousePositionTracker?.( + offsetX, + offsetY, + hitTestResult + ); + } + + // 是否在链接上 + const pointerOnLink = isPointerOnLink( + offsetX, + offsetY, + this.linkPositionCache + ); + + updateCursor(this.contentContainer, hitTestResult, pointerOnLink); + } + + /** + * 获取鼠标相对位置,会考虑缩放 + */ + getMouseRelativePosition(event: MouseEvent) { + let {offsetX, offsetY} = getMouseRelativePosition( + this.contentContainer, + event + ); + const zoomLevel = this.workbook.getActiveSheet().getZoomLevel(); + offsetX = offsetX / zoomLevel; + offsetY = offsetY / zoomLevel; + return {offsetX, offsetY}; + } + + /** + * 是否忽略这个滚动方向 + * @param isScrollingHorizontally + * @returns 如果返回 true 说明被锁定了,这时要忽略后面的行为 + */ + ignoreScrollDirection(isScrollingHorizontally: boolean) { + // 避免滚动方向频繁切换,在短时间内只允许一个方向 + if ( + Date.now() - this.lastScrollDirectionTime < + this.scrollDirectionLockTime + ) { + if ( + this.lastScrollDirection === 'horizontal' && + !isScrollingHorizontally + ) { + return true; + } + if (this.lastScrollDirection === 'vertical' && isScrollingHorizontally) { + return true; + } + } + this.lastScrollDirection = isScrollingHorizontally + ? 'horizontal' + : 'vertical'; + this.lastScrollDirectionTime = Date.now(); + return false; + } + + afterScroll(scroll: Scroll) { + this.workbook.uiEvent.emit('AFTER_SCROLL', scroll); + } + + /** + * 获取可视区域高宽 + */ + getWidthAndHeight() { + const {width, height} = this.workbook.getViewpointSize(); + return { + width, + height + }; + } + + /** + * 是否需要重新绘制,主要是渲染过程中发现行高变化等情况 + */ + needReDraw: boolean | number = false; + + /** + * 渲染总入库,包括数据区域和选区 + */ + async draw(fromReRender = false) { + const startDraw = performance.now(); + + const mainCanvas = this.sheetCanvas; + const currentSheet = this.workbook.getActiveSheet(); + const {width, height} = this.getWidthAndHeight(); + + this.linkPositionCache = []; + + // 获取可视区域范围 + const viewRange = currentSheet.getViewPointRange(width, height); + this.workbook.getActiveSheet().updateViewRange(viewRange); + + // 获取可视区域内的信息 + const displayData = currentSheet.getViewPointData(viewRange); + + mainCanvas.clear(); + + // 这个需要提前执行,保证 rowHeaderWidth 是正确的 + currentSheet.updateRowHeaderWidth(viewRange); + + // 绘制网格线 + drawGridLines( + currentSheet, + viewRange, + mainCanvas, + height, + width, + this.renderOptions + ); + + // 绘制 Sparkline,这个要在单元格前面 + drawSparkline(currentSheet, viewRange, mainCanvas); + + // 绘制单元格 + drawCells( + this, + currentSheet, + this.renderOptions, + mainCanvas, + displayData, + this.linkPositionCache + ); + + // 绘制自动筛选功能 + renderAutoFilter(currentSheet, this.dataContainer); + + // 绘制图片及文本框 + drawDrawing(this, currentSheet, viewRange, mainCanvas); + + // 表头晚于内容区绘制 + drawRowColHeaders( + currentSheet, + viewRange, + mainCanvas, + this.renderOptions, + this.defaultFontSize, + this.dataProvider.getDefaultFontStyle() + ); + + // 绘制冻结区 + const frozenViewRange = drawFrozen( + this, + currentSheet, + this.dataProvider, + this.renderOptions, + mainCanvas, + height, + width, + this.linkPositionCache + ); + + this.workbook.getActiveSheet().updateFrozenViewRange(frozenViewRange); + + if (this.renderOptions.debug) { + console.log( + 'draw time', + (performance.now() - startDraw).toFixed(2), + 'ms' + ); + } + + // 目前只有渲染后才知道字体是否加载 + await this.loadFont(); + + if (this.needReDraw && fromReRender === false) { + this.needReDraw = false; + // 避免死循环 + this.draw(true); + } + } + + /** + * 已经加载的字体 + */ + loadedFont: Set = new Set(); + + /** + * 加载字体 + */ + async loadFont() { + const fontURL = this.renderOptions.fontURL; + const notAvailableFonts = getAllNotAvailableFont(); + let needReDraw = false; + for (const font of notAvailableFonts) { + if (this.loadedFont.has(font)) { + continue; + } + if (font in fontURL) { + this.loadedFont.add(font); + const fontFace = new FontFace(font, `url(${fontURL[font]})`); + await fontFace.load(); + document.fonts.add(fontFace); + needReDraw = true; + } else { + console.warn('font not found', font); + } + } + if (needReDraw) { + // 宽度可能变化 + inValidTextSizeCache(); + this.setNeedReDraw(); + } + } + + setNeedReDraw() { + const now = new Date().getTime(); + if (this.needReDraw) { + // 避免频繁调用 + if (now - (this.needReDraw as number) < 100) { + return; + } + } + + this.needReDraw = new Date().getTime(); + } + + /** + * 销毁 + */ + destroy() { + this.contentContainer.removeEventListener('wheel', this.handleWheel); + this.contentContainer.removeEventListener( + 'mousedown', + this.handleMousedown + ); + } +} diff --git a/packages/office-viewer/src/excel/render/Icons.ts b/packages/office-viewer/src/excel/render/Icons.ts new file mode 100644 index 000000000..563d75eec --- /dev/null +++ b/packages/office-viewer/src/excel/render/Icons.ts @@ -0,0 +1,21 @@ +/** generated by genIcons.ts, do not edit */ + +export const Icons = { + filter: + '\n\n filter\n \n \n \n \n \n \n \n \n \n', + filterDown: + '\n\n filterDown\n \n \n \n \n \n \n \n', + filterUp: + '\n\n filterUp\n \n \n \n \n \n \n \n', + hasFilter: + '\n\n hasFilter\n \n \n \n \n \n \n \n', + left: '\n \n\n', + menu: '\n \n\n', + plus: '\n\n plus\n \n \n \n \n \n \n', + right: + '\n \n\n', + sortDown: + '\n\n sortDown\n \n \n \n \n A\n \n \n Z\n \n \n \n', + sortUP: + '\n\n sortUP\n \n \n \n \n A\n \n \n Z\n \n \n \n' +}; diff --git a/packages/office-viewer/src/excel/render/IndexedColors.ts b/packages/office-viewer/src/excel/render/IndexedColors.ts new file mode 100644 index 000000000..bda1a5d1f --- /dev/null +++ b/packages/office-viewer/src/excel/render/IndexedColors.ts @@ -0,0 +1,68 @@ +export const IndexedColors = [ + '000000', + 'FFFFFF', + 'FF0000', + '00FF00', + '0000FF', + 'FFFF00', + 'FF00FF', + '00FFFF', + '000000', + 'FFFFFF', + 'FF0000', + '00FF00', + '0000FF', + 'FFFF00', + 'FF00FF', + '00FFFF', + '800000', + '008000', + '000080', + '808000', + '800080', + '008080', + 'C0C0C0', + '808080', + '9999FF', + '993366', + 'FFFFCC', + 'CCFFFF', + '660066', + 'FF8080', + '0066CC', + 'CCCCFF', + '000080', + 'FF00FF', + 'FFFF00', + '00FFFF', + '800080', + '800000', + '008080', + '0000FF', + '00CCFF', + 'CCFFFF', + 'CCFFCC', + 'FFFF99', + '99CCFF', + 'FF99CC', + 'CC99FF', + 'FFCC99', + '3366FF', + '33CCCC', + '99CC00', + 'FFCC00', + 'FF9900', + 'FF6600', + '666699', + '969696', + '003366', + '339966', + '003300', + '333300', + '993300', + '993366', + '333399', + '333333', + '000000', + 'FFFFFF' +]; diff --git a/packages/office-viewer/src/excel/render/Line.ts b/packages/office-viewer/src/excel/render/Line.ts new file mode 100644 index 000000000..a3e1e9ce5 --- /dev/null +++ b/packages/office-viewer/src/excel/render/Line.ts @@ -0,0 +1,6 @@ +export interface Line { + x1: number; + y1: number; + x2: number; + y2: number; +} diff --git a/packages/office-viewer/src/excel/render/Rect.ts b/packages/office-viewer/src/excel/render/Rect.ts new file mode 100644 index 000000000..a5a1d0bb7 --- /dev/null +++ b/packages/office-viewer/src/excel/render/Rect.ts @@ -0,0 +1,33 @@ +/** + * 矩形定义 + */ +export interface Rect { + x: number; + y: number; + width: number; + height: number; +} + +/** + * 判断点是否在矩形内 + */ +export function pointInRect(x: number, y: number, rect: Rect) { + return ( + x >= rect.x && + x <= rect.x + rect.width && + y >= rect.y && + y <= rect.y + rect.height + ); +} + +/** + * 判断两个矩形是否相交 + */ +export function rectIntersect(rect1: Rect, rect2: Rect) { + return ( + rect1.x < rect2.x + rect2.width && + rect1.x + rect1.width > rect2.x && + rect1.y < rect2.y + rect2.height && + rect1.y + rect1.height > rect2.y + ); +} diff --git a/packages/office-viewer/src/excel/render/ScrollBar.ts b/packages/office-viewer/src/excel/render/ScrollBar.ts new file mode 100644 index 000000000..adf6a7ad4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/ScrollBar.ts @@ -0,0 +1,231 @@ +/** + * 模拟滚动条,目前暂时只支持浏览模式,也就是最大高宽是固定的 + */ + +import {H} from '../../util/H'; +import type {Workbook} from '../Workbook'; + +export type ScrollBarOptions = { + /** + * 是否自动隐藏 + */ + autoHide: boolean; + + scrollBarSize: number; +}; + +const defaultOptions: ScrollBarOptions = { + autoHide: true, + scrollBarSize: 15 +}; + +export class ScrollBar { + /** + * 容器 + */ + container: HTMLElement; + + /** + * 当前 workbook + */ + workbook: Workbook; + + /** + * 垂直滚动条的轨道 + */ + yScrollBarTruck: HTMLElement; + + /** + * 定义垂直滚动条最大高度 + */ + yScrollBarTotal: HTMLElement; + + /** + * 垂直滚动条内容区域 + */ + yScrollBarContent: HTMLElement; + + /** + * 水平滚动条的轨道 + */ + xScrollBarTruck: HTMLElement; + + /** + * 水平滚动条最大宽度 + */ + xScrollBarTotal: HTMLElement; + + /** + * 水平滚动条 + */ + xScrollBarContent: HTMLElement; + + /** + * 滚动条配置项 + */ + scrollOptions: ScrollBarOptions; + + constructor( + container: HTMLElement, + workbook: Workbook, + scrollOptions?: Partial + ) { + this.container = container; + this.workbook = workbook; + + this.scrollOptions = {...defaultOptions, ...scrollOptions}; + workbook.uiEvent.on('AFTER_SCROLL', () => { + this.sync(); + }); + workbook.uiEvent.on('SWITCH_SHEET', () => { + this.sync(); + }); + + const scrollBarSize = this.scrollOptions.scrollBarSize; + + container.style.position = 'relative'; + + const yScrollBarContent = H('div', { + className: 'ov-excel-scrollbar-content-y', + style: { + width: `${scrollBarSize}px` + } + }); + + this.yScrollBarContent = yScrollBarContent; + + yScrollBarContent.addEventListener('scroll', event => { + const currentSheet = this.workbook.getActiveSheet(); + const sheetScrollTop = currentSheet.getScrollTop(); + const scrollBarTop = yScrollBarContent.scrollTop; + if (Math.round(sheetScrollTop) !== Math.round(scrollBarTop)) { + currentSheet.setScrollTop(yScrollBarContent.scrollTop); + this.workbook.uiEvent.emit('SCROLL_Y', yScrollBarContent.scrollTop); + } + + event.preventDefault(); + event.stopPropagation(); + }); + + // 避免误触发选中事件 + yScrollBarContent.addEventListener('mousedown', event => { + event.stopPropagation(); + }); + + const yScrollBarTotal = H('div', { + className: 'ov-excel-scrollbar-total-y', + style: { + width: `${scrollBarSize}px` + }, + parent: yScrollBarContent + }); + this.yScrollBarTotal = yScrollBarTotal; + + const yScrollBarTruck = H( + 'div', + { + className: 'ov-excel-scrollbar-y', + style: { + width: `${scrollBarSize}px` + }, + parent: container + }, + yScrollBarContent + ); + + this.yScrollBarTruck = yScrollBarTruck; + + const xScrollBarContent = H('div', { + className: 'ov-excel-scrollbar-content-x', + style: { + height: `${scrollBarSize}px` + } + }); + this.xScrollBarContent = xScrollBarContent; + + xScrollBarContent.addEventListener('scroll', event => { + const currentSheet = this.workbook.getActiveSheet(); + const sheetScrollLeft = currentSheet.getScrollLeft(); + const scrollBarLeft = xScrollBarContent.scrollLeft; + if (Math.round(sheetScrollLeft) !== Math.round(scrollBarLeft)) { + currentSheet.setScrollLeft(xScrollBarContent.scrollLeft); + this.workbook.uiEvent.emit('SCROLL_X', xScrollBarContent.scrollLeft); + } + event.preventDefault(); + event.stopPropagation(); + }); + + // 避免误触发选中事件 + xScrollBarContent.addEventListener('mousedown', event => { + event.stopPropagation(); + }); + + const xScrollBarTotal = H('div', { + className: 'ov-excel-scrollbar-total-x', + style: { + height: `${scrollBarSize}px` + }, + parent: xScrollBarContent + }); + this.xScrollBarTotal = xScrollBarTotal; + + const xScrollBarTruck = H( + 'div', + { + className: 'ov-excel-scrollbar-x', + style: { + height: `${scrollBarSize}px` + }, + parent: container + }, + xScrollBarContent + ); + this.xScrollBarTruck = xScrollBarTruck; + + this.sync(); + } + + /** + * 同步滚动条 + */ + sync() { + const currentSheet = this.workbook.getActiveSheet(); + const scrollBarSize = this.scrollOptions.scrollBarSize; + const {width, height} = this.workbook.getViewpointSize(); + const scrollLeft = currentSheet.getScrollLeft(); + const scrollTop = currentSheet.getScrollTop(); + const {rowHeaderWidth, colHeaderHeight} = currentSheet.getRowColSize(); + + this.xScrollBarContent.style.width = `${width}px`; + this.yScrollBarContent.style.height = `${height}px`; + + const totalWidth = Math.max( + width + scrollLeft, + currentSheet.getTotalWidth() + rowHeaderWidth + scrollBarSize + ); + const totalHeight = Math.max( + height + scrollTop, + currentSheet.getTotalHeight() + colHeaderHeight + scrollBarSize + ); + + if (totalWidth <= width) { + this.xScrollBarTruck.style.display = 'none'; + } else { + this.xScrollBarTruck.style.display = 'block'; + } + + if (totalHeight <= height) { + this.yScrollBarTruck.style.display = 'none'; + } else { + this.yScrollBarTruck.style.display = 'block'; + } + + this.xScrollBarTotal.style.width = `${totalWidth}px`; + + this.xScrollBarContent.scrollLeft = scrollLeft; + + this.yScrollBarTotal.style.height = `${totalHeight}px`; + + this.yScrollBarContent.scrollTop = scrollTop; + } +} diff --git a/packages/office-viewer/src/excel/render/SelectionCanvas.ts b/packages/office-viewer/src/excel/render/SelectionCanvas.ts new file mode 100644 index 000000000..1d36b5a4a --- /dev/null +++ b/packages/office-viewer/src/excel/render/SelectionCanvas.ts @@ -0,0 +1,139 @@ +/** + * 选区使用的 canvas,独立是为了提高渲染性能,在选取变的时候只有这里变化 + */ + +import {Workbook} from '../Workbook'; +import {ExcelRenderOptions} from '../sheet/ExcelRenderOptions'; +import {IDataProvider} from '../types/IDataProvider'; +import {Canvas} from './Canvas'; +import {SheetSelection} from './selection/SheetSelection'; +import {drawCellRanges} from './selection/drawCellRanges'; + +export class SelectionCanvas extends Canvas { + workbook: Workbook; + + dataProvider: IDataProvider; + + renderOptions: ExcelRenderOptions; + + /** + * 选区的信息 + */ + selection?: SheetSelection; + + /** + * 临时行线网格线位置 + */ + tmpRowGridLineY?: number; + + /** + * 临时列线网格线位置 + */ + tmpColGridLineX?: number; + + constructor(workbook: Workbook, dataProvider: IDataProvider) { + const {width, height} = workbook.getViewpointSize(); + super( + width, + height, + workbook.renderOptions.scale || 1, + 'ov-excel-selection-canvas ov-excel-canvas' + ); + + this.workbook = workbook; + this.renderOptions = workbook.renderOptions; + this.dataProvider = dataProvider; + workbook.uiEvent.on( + 'CHANGE_SELECTION', + this.handleChangeSelection.bind(this) + ); + workbook.uiEvent.on('AFTER_SCROLL', this.draw.bind(this)); + workbook.uiEvent.on('SWITCH_SHEET', this.draw.bind(this)); + workbook.uiEvent.on('DRAG_ROW_GRID_LINE', this.dragRowGridLine.bind(this)); + workbook.uiEvent.on('DRAG_COL_GRID_LINE', this.dragColGridLine.bind(this)); + workbook.uiEvent.on( + 'DRAG_COL_GRID_LINE_END', + (col: number, width: number) => { + const sheet = this.workbook.getActiveSheet(); + sheet.setColWidth(col, width); + this.clearTmpGridLine(); + workbook.uiEvent.emit('UPDATE_COL_WIDTH', col, width); + this.draw(); + } + ); + workbook.uiEvent.on( + 'DRAG_ROW_GRID_LINE_END', + (row: number, height: number) => { + const sheet = this.workbook.getActiveSheet(); + sheet.setRowHeight(row, height); + this.clearTmpGridLine(); + workbook.uiEvent.emit('UPDATE_ROW_HEIGHT', row, height); + this.draw(); + } + ); + } + + handleChangeSelection(selection: SheetSelection) { + this.selection = selection; + this.draw(); + } + + dragRowGridLine(y: number) { + if (y !== this.tmpRowGridLineY) { + this.tmpRowGridLineY = y; + this.draw(); + } + } + + dragColGridLine(x: number) { + if (x !== this.tmpColGridLineX) { + this.tmpColGridLineX = x; + this.draw(); + } + } + + clearTmpGridLine() { + this.tmpRowGridLineY = 0; + this.tmpColGridLineX = 0; + this.draw(); + } + + draw() { + this.clear(); + this.drawTmpGridLine(); + if (this.selection) { + drawCellRanges(this.workbook, this, this.selection); + } + } + + clearSelection() { + this.selection = undefined; + this.draw(); + } + + drawTmpGridLine() { + const {width, height} = this.workbook.getViewpointSize(); + if (this.tmpColGridLineX) { + this.drawLine( + { + x1: this.tmpColGridLineX, + y1: 0, + x2: this.tmpColGridLineX, + y2: height + }, + this.renderOptions.dragGridLineColor + ); + } + if (this.tmpRowGridLineY) { + this.drawLine( + { + x1: 0, + y1: this.tmpRowGridLineY, + x2: width, + y2: this.tmpRowGridLineY + }, + this.renderOptions.dragGridLineColor + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/SheetCanvas.ts b/packages/office-viewer/src/excel/render/SheetCanvas.ts new file mode 100644 index 000000000..3fd86e570 --- /dev/null +++ b/packages/office-viewer/src/excel/render/SheetCanvas.ts @@ -0,0 +1,85 @@ +/** + * 内容区 Canvas 封装,方便图形绘制 + */ + +import type {Workbook} from '../Workbook'; +import {IDataProvider} from '../types/IDataProvider'; +import {CellInfo} from '../types/CellInfo'; +import {Canvas} from './Canvas'; +import {drawCell} from './cell/drawCell'; +import {LinkPosition} from './cell/LinkPosition'; +import {CellInfoWithSize} from './cell/CellInfoWithSize'; +import {autoClip} from './cell/autoClip'; +import {ExcelRender} from './ExcelRender'; + +export interface Line { + x1: number; + y1: number; + x2: number; + y2: number; +} + +export class SheetCanvas extends Canvas { + workbook: Workbook; + + dataProvider: IDataProvider; + + // 调试的时候开启,会绘制文字的包围盒 + debugFontBoundingBox = false; + + constructor(workbook: Workbook, dataProvider: IDataProvider) { + const {width, height} = workbook.getViewpointSize(); + super( + width, + height, + workbook.renderOptions.scale || 1, + 'ov-excel-content-canvas ov-excel-canvas' + ); + + this.workbook = workbook; + this.dataProvider = dataProvider; + } + + /** + * 绘制单元格 + * @param font + * @param text + * @param x + * @param y + * @param width + * @param height + */ + drawCell( + excelRender: ExcelRender, + cellInfo: CellInfo, + x: number, + y: number, + width: number, + height: number, + indentSize: number, + padding: number, + needClear = false, + linkPositionCache: LinkPosition[] = [] + ) { + const sheet = this.workbook.getActiveSheet(); + drawCell( + excelRender, + sheet, + this, + this.dataProvider, + cellInfo, + x, + y, + width, + height, + indentSize, + padding, + needClear, + linkPositionCache + ); + } + + autoClip(cellInfoMap: Map) { + autoClip(this.ctx, this.dataProvider, cellInfoMap); + } +} diff --git a/packages/office-viewer/src/excel/render/__test__/autoWrapText.test.ts b/packages/office-viewer/src/excel/render/__test__/autoWrapText.test.ts new file mode 100644 index 000000000..c570f8e6d --- /dev/null +++ b/packages/office-viewer/src/excel/render/__test__/autoWrapText.test.ts @@ -0,0 +1,238 @@ +import {stringToArray} from '../../../util/stringToArray'; +import {FontStyle} from '../../types/FontStyle'; + +import {autoWrapText} from '../cell/autoWrapText'; + +/** + * canvas 在不同操作系统下表现不一致,所以这里 mock 一下来保证测试的稳定性 + */ +const mockCtx = { + save: jest.fn(), + restore: jest.fn(), + measureText: (text: string) => { + const width = stringToArray(text).length * 10; + return { + actualBoundingBoxRight: 0, + actualBoundingBoxLeft: width, + width, + actualBoundingBoxAscent: 0, + actualBoundingBoxDescent: 10, + fontBoundingBoxAscent: 0, + fontBoundingBoxDescent: 12 + }; + } +} as any; + +const defaultFont: FontStyle = { + family: '等线', + size: 12, + color: '#000000', + b: false, + i: false, + u: 'none', + strike: false, + outline: false, + shadow: false, + condense: false +}; + +test('breakline', () => { + expect(autoWrapText(mockCtx, '中\nabc', 30, defaultFont)).toEqual([ + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: '中', + w: 10 + } + ] + }, + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'abc', + w: 30 + } + ] + } + ]); +}); + +test('breaklineBefore', () => { + expect(autoWrapText(mockCtx, '\nabc', 30, defaultFont)).toEqual([ + { + maxHeight: 12, + tokens: [] + }, + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'abc', + w: 30 + } + ] + } + ]); +}); + +test('wrapTwoLine', () => { + expect(autoWrapText(mockCtx, '中abc', 30, defaultFont)).toEqual([ + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: '中', + w: 10 + } + ] + }, + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'abc', + w: 30 + } + ] + } + ]); +}); + +test('wrapTwoLineMore', () => { + // 虽然是一个单词但太长了也得折行 + expect(autoWrapText(mockCtx, 'abcd', 30, defaultFont)).toEqual([ + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'abc', + w: 30 + } + ] + }, + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'd', + w: 10 + } + ] + } + ]); +}); + +test('wrapTwoLineMoreMerge', () => { + // 虽然是一个单词但太长了也得折行 + expect(autoWrapText(mockCtx, '中abcdef文', 30, defaultFont)).toEqual([ + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: '中', + w: 10 + }, + { + type: 'w', + t: 'ab', + w: 20 + } + ] + }, + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'cde', + w: 30 + } + ] + }, + { + maxHeight: 12, + tokens: [ + { + type: 'w', + t: 'f', + w: 10 + }, + { + type: 'w', + t: '文', + w: 10 + } + ] + } + ]); +}); + +test('richText', () => { + // 富文本 + expect( + autoWrapText( + mockCtx, + [ + { + rPr: {}, + t: 'ric\n' + }, + { + rPr: { + sz: 12, + color: { + rgb: 'FFFF0000' + }, + rFont: '等线', + family: 3, + charset: 134 + }, + t: 'tex' + } + ], + 30, + defaultFont + ) + ).toEqual([ + { + maxHeight: 12, + tokens: [ + { + rPr: {}, + type: 'w', + t: 'ric', + w: 30 + } + ] + }, + { + maxHeight: 12, + tokens: [ + { + rPr: { + sz: 12, + color: { + rgb: 'FFFF0000' + }, + rFont: '等线', + family: 3, + charset: 134 + }, + type: 'w', + t: 'tex', + w: 30 + } + ] + } + ]); +}); diff --git a/packages/office-viewer/src/excel/render/__test__/tokenizer.test.ts b/packages/office-viewer/src/excel/render/__test__/tokenizer.test.ts new file mode 100644 index 000000000..8bf8a2643 --- /dev/null +++ b/packages/office-viewer/src/excel/render/__test__/tokenizer.test.ts @@ -0,0 +1,55 @@ +import {tokenizer} from '../cell/tokenizer'; + +test('wordspace', () => { + expect(tokenizer('hello world')).toEqual([ + {t: 'hello', type: 'w'}, + {t: ' ', type: 's'}, + {t: 'world', type: 'w'} + ]); +}); + +test('chinese', () => { + expect(tokenizer('hello中文world')).toEqual([ + {t: 'hello', type: 'w'}, + {t: '中', type: 'w'}, + {t: '文', type: 'w'}, + {t: 'world', type: 'w'} + ]); +}); + +test('chinesenumber', () => { + expect(tokenizer('hello 123中文world')).toEqual([ + {t: 'hello', type: 'w'}, + {t: ' ', type: 's'}, + {t: '123', type: 'w'}, + {t: '中', type: 'w'}, + {t: '文', type: 'w'}, + {t: 'world', type: 'w'} + ]); +}); + +test('linebreak', () => { + expect(tokenizer('he\nllo中文')).toEqual([ + {t: 'he', type: 'w'}, + {t: '\n', type: 'br'}, + {t: 'llo', type: 'w'}, + {t: '中', type: 'w'}, + {t: '文', type: 'w'} + ]); +}); + +test('plural', () => { + expect(tokenizer("let's try")).toEqual([ + {t: "let's", type: 'w'}, + {t: ' ', type: 's'}, + {t: 'try', type: 'w'} + ]); +}); + +test('dash', () => { + expect(tokenizer('hello-world')).toEqual([ + {t: 'hello', type: 'w'}, + {t: '-', type: 'h'}, + {t: 'world', type: 'w'} + ]); +}); diff --git a/packages/office-viewer/src/excel/render/autoFilter/AutoFilterIconUI.ts b/packages/office-viewer/src/excel/render/autoFilter/AutoFilterIconUI.ts new file mode 100644 index 000000000..0cd4304bd --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/AutoFilterIconUI.ts @@ -0,0 +1,139 @@ +import {CT_AutoFilter} from '../../../openxml/ExcelTypes'; +import {H} from '../../../util/H'; +import {onClickOutside} from '../../../util/onClickOutside'; +import {Sheet} from '../../sheet/Sheet'; +import {RangeRef} from '../../types/RangeRef'; +import {Icons} from '../Icons'; +import {AutoFilterMenuUI} from './AutoFilterMenuUI'; +import {hasFilterColumn} from './filterColumn/hasFilterColumn'; +import {getColumnSortOrder} from './sortState/getColumnSortOrder'; + +export class AutoFilterIconUI { + /** + * 过滤图标容器 + */ + filterIconContainer: HTMLElement; + + /** + * 过滤图标 + */ + filterIcon: HTMLElement; + + /** + * 过滤界面 + */ + filterMenu: AutoFilterMenuUI; + + sheet: Sheet; + + rangeRef: RangeRef; + + colIndex: number; + + autoFilter: CT_AutoFilter; + + constructor( + sheet: Sheet, + dataContainer: HTMLElement, + autoFilter: CT_AutoFilter, + rangeRef: RangeRef, + colIndex: number, + fid: string, + headerRowCount: number = 1 + ) { + this.sheet = sheet; + this.rangeRef = rangeRef; + this.colIndex = colIndex; + this.autoFilter = autoFilter; + const filterIconContainer = H('div', { + className: 'ov-excel-auto-filter-icon-container', + parent: dataContainer + }); + filterIconContainer.dataset.fid = fid; + this.filterIconContainer = filterIconContainer; + // 默认隐藏 + filterIconContainer.style.display = 'none'; + + const filterIcon = H('div', { + className: 'ov-excel-auto-filter-icon', + parent: filterIconContainer + }); + filterIcon.innerHTML = this.getFilterIcon(); + this.filterIcon = filterIcon; + + this.filterMenu = new AutoFilterMenuUI( + this, + filterIconContainer, + sheet, + autoFilter, + rangeRef, + colIndex, + headerRowCount + ); + + filterIcon.addEventListener('click', this.handleClick.bind(this)); + onClickOutside(filterIconContainer, () => { + this.hideMenu(); + }); + } + + /** + * 更新过滤图标 + */ + syncFilterIcon() { + this.filterIcon.innerHTML = this.getFilterIcon(); + } + + getFilterIcon() { + const columnSortState = getColumnSortOrder( + this.colIndex, + this.rangeRef, + this.autoFilter.sortState + ); + let filterIconSrc = Icons.filter; + + const filterColumn = hasFilterColumn(this.autoFilter, this.colIndex); + + if (filterColumn) { + filterIconSrc = Icons.hasFilter; + } + + if (columnSortState === 'asc') { + filterIconSrc = Icons.filterUp; + } else if (columnSortState === 'desc') { + filterIconSrc = Icons.filterDown; + } + return filterIconSrc; + } + + updatePosition(x: number, y: number, height: number, width: number) { + this.filterIconContainer.style.display = 'block'; + this.filterIconContainer.style.left = `${x}px`; + this.filterIconContainer.style.top = `${y}px`; + this.filterIconContainer.style.width = `${width}px`; + this.filterIconContainer.style.height = `${height}px`; + + this.filterIcon.style.width = `${height - 4}px`; + } + + handleClick() { + const lastAutoFilter = this.sheet.getLastAutoFilterIcon(); + if (lastAutoFilter) { + lastAutoFilter.hideMenu(); + } + this.sheet.setLastAutoFilterIcon(this); + this.showMenu(); + } + + showMenu() { + this.filterMenu.show(); + } + + hideMenu() { + this.filterMenu.hide(); + } + + hide() { + this.filterIconContainer.style.display = 'none'; + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/AutoFilterMenuUI.ts b/packages/office-viewer/src/excel/render/autoFilter/AutoFilterMenuUI.ts new file mode 100644 index 000000000..dc58e4bd8 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/AutoFilterMenuUI.ts @@ -0,0 +1,73 @@ +import {CT_AutoFilter} from '../../../openxml/ExcelTypes'; +import {H} from '../../../util/H'; +import {Sheet} from '../../sheet/Sheet'; +import {RangeRef} from '../../types/RangeRef'; +import {FilterColumnUI} from './filterColumn/FilterColumnUI'; +import {SortStateUI} from './sortState/SortStateUI'; +import type {AutoFilterIconUI} from './AutoFilterIconUI'; + +export class AutoFilterMenuUI { + menuContainer: HTMLElement; + + sheet: Sheet; + + autoFilter: CT_AutoFilter; + + colIndex: number; + + constructor( + autoFilterIcon: AutoFilterIconUI, + container: HTMLElement, + sheet: Sheet, + autoFilter: CT_AutoFilter, + rangeRef: RangeRef, + colIndex: number, + headerRowCount: number = 1 + ) { + const menuContainer = H('div', { + className: 'ov-excel-auto-filter-menu', + parent: container + }); + this.menuContainer = menuContainer; + + const autoFilterMenuSort = new SortStateUI( + autoFilterIcon, + menuContainer, + sheet, + autoFilter, + rangeRef, + colIndex, + headerRowCount + ); + + const autoFilterMenuFilterColumn = new FilterColumnUI( + autoFilterIcon, + menuContainer, + sheet, + autoFilter, + rangeRef, + colIndex, + headerRowCount + ); + + this.autoFilter = autoFilter; + this.colIndex = colIndex; + this.sheet = sheet; + + menuContainer.addEventListener('mousedown', e => { + e.stopPropagation(); + }); + + menuContainer.addEventListener('wheel', e => { + e.stopPropagation(); + }); + } + + hide() { + this.menuContainer.style.display = 'none'; + } + + show() { + this.menuContainer.style.display = 'flex'; + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/CustomFiltersUI.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/CustomFiltersUI.ts new file mode 100644 index 000000000..31f625011 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/CustomFiltersUI.ts @@ -0,0 +1,225 @@ +import { + CT_AutoFilter, + CT_CustomFilter, + ST_FilterOperator +} from '../../../../openxml/ExcelTypes'; +import {H} from '../../../../util/H'; +import {isNumeric} from '../../../../util/isNumeric'; +import {Sheet} from '../../../sheet/Sheet'; +import {Input} from '../../ui/Input'; +import {Radio} from '../../ui/Radio'; +import {Select, SelectOption} from '../../ui/Select'; +import type {AutoFilterIconUI} from '../AutoFilterIconUI'; +import {OperatorOptions, OperatorTypeUI} from './OperatorTypeUI'; +import {buildOperatorOptions} from './buildOperatorOptions'; +import {fromOperatorUI} from './fromOperatorUI'; +import {getCustomFilters} from './getCustomFilters'; +import {setCustomFilters} from './setCustomFilters'; +import {toOperatorUI} from './toOperatorUI'; + +type CustomFilterItem = { + select: Select; + input: Input; +}; + +type AND = 'and' | 'or'; + +export class CustomFiltersUI { + customFiltersContainer: HTMLDivElement; + + /** + * 操作符选项,会根据值不同类型变化 + */ + operatorOptions: OperatorOptions[] = []; + + /** + * 值类型 + */ + valueType: 'text' | 'number' | 'date' = 'text'; + + sheet: Sheet; + + customFilterItems: CustomFilterItem[] = []; + + autoFilter: CT_AutoFilter; + + colIndex: number; + + headerRowCount: number; + + autoFilterIcon: AutoFilterIconUI; + + texts: string[]; + + andRadio?: Radio; + + constructor( + autoFilterIcon: AutoFilterIconUI, + container: HTMLElement, + sheet: Sheet, + autoFilter: CT_AutoFilter, + colIndex: number, + headerRowCount: number, + texts: string[], + isDate: boolean + ) { + this.sheet = sheet; + this.colIndex = colIndex; + this.autoFilter = autoFilter; + this.headerRowCount = headerRowCount; + this.autoFilterIcon = autoFilterIcon; + this.texts = texts; + + if (texts.every(isNumeric)) { + this.valueType = 'number'; + } + + if (isDate) { + this.valueType = 'date'; + } + + this.buildOperatorOptions(); + + const customFiltersContainer = H('div', { + className: 'ov-excel-auto-filter-menu__custom-filters', + parent: container + }) as HTMLDivElement; + + this.customFiltersContainer = customFiltersContainer; + + const customFilters = getCustomFilters(autoFilter, colIndex); + + const customFilter = customFilters?.customFilter || []; + + if (customFilter.length) { + if (customFilter.length === 1) { + this.buildCustomFilterItem(customFilter[0]); + this.buildCustomFilterItemAnd(); + // 生成一个空的 + this.buildCustomFilterItem(); + } else if (customFilter.length === 2) { + this.buildCustomFilterItem(customFilter[0]); + this.buildCustomFilterItemAnd(); + this.buildCustomFilterItem(customFilter[1]); + } else { + for (const filter of customFilter) { + this.buildCustomFilterItem(filter); + } + } + } else { + // 默认生成一个空的 + this.buildCustomFilterItem(); + } + } + + /** + * 构建操作符选项 + */ + buildOperatorOptions() { + this.operatorOptions = buildOperatorOptions( + this.valueType, + this.sheet.translate.bind(this.sheet) + ); + } + + /** + * 构建 and 或 or 选项 + */ + buildCustomFilterItemAnd(and?: boolean): void { + if (and === undefined) { + and = true; + } + const radioOptions = [ + { + text: this.sheet.translate('customFilter.and'), + value: 'and' + }, + { + text: this.sheet.translate('customFilter.or'), + value: 'or' + } + ] as Array<{ + text: string; + value: AND; + }>; + + this.andRadio = new Radio( + this.customFiltersContainer, + radioOptions, + and ? 'and' : 'or', + value => { + this.syncCustomFilters(); + } + ); + } + + buildCustomFilterItem(customFilter?: CT_CustomFilter) { + const operator = customFilter?.operator || 'equal'; + // 这里直接将 * 全都去掉了 + const value = (customFilter?.val || '').replace(/\*/g, ''); + const customFiltersContainer = this.customFiltersContainer; + + const customFilterItemInput = H('div', { + className: 'ov-excel-auto-filter-menu__custom-filters-item-input', + parent: customFiltersContainer + }); + + const select = new Select( + customFilterItemInput, + this.operatorOptions, + toOperatorUI(operator, value), + () => { + this.syncCustomFilters(); + } + ); + + const input = new Input( + customFilterItemInput, + '', + value, + () => { + this.syncCustomFilters(); + }, + 'normal', + this.texts + ); + + this.customFilterItems.push({input, select}); + } + + /** + * 同步自定义筛选 + */ + syncCustomFilters() { + const sheet = this.sheet; + const autoFilter = this.autoFilter; + const headerRowCount = this.headerRowCount; + const customFilters = this.customFilterItems + .map(item => { + return fromOperatorUI(item.select.getValue(), item.input.getValue()); + }) + .filter(item => item.val !== ''); + + const andValue = this.andRadio?.getValue(); + + let and = true; + if (andValue === 'or') { + and = false; + } + + // 当有输入内容且当前 + if (this.customFilterItems.length === 1 && customFilters.length === 1) { + this.buildCustomFilterItemAnd(); + this.buildCustomFilterItem(); + } + + setCustomFilters(autoFilter, this.colIndex, { + and, + customFilter: customFilters + }); + + sheet.applyAutoFilter(autoFilter, headerRowCount); + sheet.getWorkbook().uiEvent.emit('APPLY_AUTO_FILTER', sheet.getIndex()); + this.autoFilterIcon.syncFilterIcon(); + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/FilterColumnUI.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/FilterColumnUI.ts new file mode 100644 index 000000000..748a705bf --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/FilterColumnUI.ts @@ -0,0 +1,71 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; +import {Sheet} from '../../../sheet/Sheet'; +import {RangeRef} from '../../../types/RangeRef'; +import {Divider} from '../../ui/Divider'; +import type {AutoFilterIconUI} from '../AutoFilterIconUI'; +import {CustomFiltersUI} from './CustomFiltersUI'; +import {FiltersUI} from './FiltersUI'; + +/** + * 对应 filterColumn 配置项 + */ +export class FilterColumnUI { + constructor( + autoFilterIcon: AutoFilterIconUI, + container: HTMLElement, + sheet: Sheet, + autoFilter: CT_AutoFilter, + rangeRef: RangeRef, + colIndex: number, + headerRowCount: number + ) { + const columnDataRange = {...rangeRef}; + columnDataRange.startRow += headerRowCount; + + columnDataRange.startCol += colIndex; + columnDataRange.endCol = columnDataRange.startCol; + + const values = sheet.getCellValueByRange(columnDataRange, true); + + const uniqueTexts: Set = new Set(); + + let isDate = false; + + for (const value of values) { + if (value === null || value === undefined || value.text === '') { + continue; + } + if (value.isDate) { + isDate = true; + } + uniqueTexts.add(value.text); + } + + const texts = Array.from(uniqueTexts).sort(); + + new Divider(container); + + const customFilters = new CustomFiltersUI( + autoFilterIcon, + container, + sheet, + autoFilter, + colIndex, + headerRowCount, + texts, + isDate + ); + + new Divider(container); + + const filters = new FiltersUI( + autoFilterIcon, + container, + sheet, + autoFilter, + colIndex, + headerRowCount, + texts + ); + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/FiltersUI.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/FiltersUI.ts new file mode 100644 index 000000000..f1f4d2936 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/FiltersUI.ts @@ -0,0 +1,59 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; +import {H} from '../../../../util/H'; +import {Sheet} from '../../../sheet/Sheet'; +import {CheckBoxOption} from '../../ui/CheckBox'; +import {CheckBoxList} from '../../ui/CheckBoxList'; +import {AutoFilterIconUI} from '../AutoFilterIconUI'; +import {getFilterValues} from './getFilterValues'; +import {setFilterValues} from './setFilterValues'; + +/** + * 按文本分类进行过滤 + */ +export class FiltersUI { + filtersContainer: HTMLElement; + + constructor( + autoFilterIcon: AutoFilterIconUI, + container: HTMLElement, + sheet: Sheet, + autoFilter: CT_AutoFilter, + colIndex: number, + headerRowCount: number, + texts: string[] + ) { + const filtersContainer = H('div', { + className: 'ov-excel-auto-filter__menu-filter-filters', + parent: container + }) as HTMLElement; + + this.filtersContainer = filtersContainer; + + const filterValues = getFilterValues(autoFilter, colIndex); + + const selectAll = filterValues.size === 0; + + const options: CheckBoxOption[] = texts.map(text => { + return { + text, + value: text, + checked: selectAll || filterValues.has(text) + }; + }); + + const selectAllText = sheet.translate('checkBox.selectAll'); + const searchPlaceholder = sheet.translate('checkBox.search'); + const checkBoxList = new CheckBoxList( + filtersContainer, + selectAllText, + searchPlaceholder, + options, + (checked, option, options) => { + setFilterValues(autoFilter, colIndex, options); + sheet.applyAutoFilter(autoFilter, headerRowCount); + sheet.getWorkbook().uiEvent.emit('APPLY_AUTO_FILTER', sheet.getIndex()); + autoFilterIcon.syncFilterIcon(); + } + ); + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/OperatorTypeUI.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/OperatorTypeUI.ts new file mode 100644 index 000000000..07c2bf069 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/OperatorTypeUI.ts @@ -0,0 +1,18 @@ +export type OperatorTypeUI = + | 'equal' + | 'notEqual' + | 'beginsWith' + | 'notBeginsWith' + | 'endsWith' + | 'notEndsWith' + | 'contains' + | 'notContains' + | 'greaterThan' + | 'greaterThanOrEqual' + | 'lessThan' + | 'lessThanOrEqual'; + +export type OperatorOptions = { + text: string; + value: OperatorTypeUI; +}; diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/buildOperatorOptions.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/buildOperatorOptions.ts new file mode 100644 index 000000000..a5cf7f1be --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/buildOperatorOptions.ts @@ -0,0 +1,100 @@ +import {OperatorOptions} from './OperatorTypeUI'; + +export function buildOperatorOptions( + valueType: 'text' | 'number' | 'date', + translate: (key: string) => string +): OperatorOptions[] { + switch (valueType) { + case 'text': + return [ + { + text: translate('customFilter.equal'), + value: 'equal' + }, + { + text: translate('customFilter.notEqual'), + value: 'notEqual' + }, + { + text: translate('customFilter.beginsWith'), + value: 'beginsWith' + }, + { + text: translate('customFilter.notBeginsWith'), + value: 'notBeginsWith' + }, + { + text: translate('customFilter.endsWith'), + value: 'endsWith' + }, + { + text: translate('customFilter.notEndsWith'), + value: 'notEndsWith' + }, + { + text: translate('customFilter.contains'), + value: 'contains' + }, + { + text: translate('customFilter.notContains'), + value: 'notContains' + } + ]; + + case 'number': + return [ + { + text: translate('customFilter.equal'), + value: 'equal' + }, + { + text: translate('customFilter.notEqual'), + value: 'notEqual' + }, + { + text: translate('customFilter.greaterThan'), + value: 'greaterThan' + }, + { + text: translate('customFilter.greaterThanOrEqual'), + value: 'greaterThanOrEqual' + }, + { + text: translate('customFilter.lessThan'), + value: 'lessThan' + }, + { + text: translate('customFilter.lessThanOrEqual'), + value: 'lessThanOrEqual' + } + ]; + + case 'date': + return [ + { + text: translate('customFilter.equal'), + value: 'equal' + }, + { + text: translate('customFilter.notEqual'), + value: 'notEqual' + }, + { + text: translate('customFilter.greaterThan'), + value: 'greaterThan' + }, + { + text: translate('customFilter.greaterThanOrEqual'), + value: 'greaterThanOrEqual' + }, + { + text: translate('customFilter.lessThan'), + value: 'lessThan' + }, + { + text: translate('customFilter.lessThanOrEqual'), + value: 'lessThanOrEqual' + } + ]; + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/fromOperatorUI.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/fromOperatorUI.ts new file mode 100644 index 000000000..b96783224 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/fromOperatorUI.ts @@ -0,0 +1,60 @@ +import { + CT_CustomFilter, + ST_FilterOperator +} from '../../../../openxml/ExcelTypes'; +import {OperatorTypeUI} from './OperatorTypeUI'; + +/** + * 将界面上的操作符转换为 xml 中的操作符 + */ +export function fromOperatorUI( + operator: OperatorTypeUI, + value: string +): CT_CustomFilter { + if (operator === 'contains') { + return { + operator: 'equal', + val: `*${value}*` + }; + } + if (operator === 'beginsWith') { + return { + operator: 'equal', + val: `${value}*` + }; + } + + if (operator === 'endsWith') { + return { + operator: 'equal', + val: `*${value}` + }; + } + + if (operator === 'notContains') { + return { + operator: 'notEqual', + val: `*${value}*` + }; + } + + if (operator === 'notBeginsWith') { + return { + operator: 'notEqual', + val: `${value}*` + }; + } + + if (operator === 'notEndsWith') { + return { + operator: 'notEqual', + val: `*${value}` + }; + } + + // 前面应该已经处理完了 + return { + operator: operator as ST_FilterOperator, + val: value + }; +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/getCustomFilters.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/getCustomFilters.ts new file mode 100644 index 000000000..47a31f4cf --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/getCustomFilters.ts @@ -0,0 +1,13 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; + +export function getCustomFilters(autoFilter: CT_AutoFilter, colIndex: number) { + const filterColumn = autoFilter.filterColumn?.find( + column => column.colId === colIndex + ); + + if (filterColumn) { + return filterColumn.customFilters; + } + + return null; +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/getFilterValues.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/getFilterValues.ts new file mode 100644 index 000000000..5c829fb36 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/getFilterValues.ts @@ -0,0 +1,22 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; + +/** + * 获取配置中的过滤值,目前子支持 val 的情况 + */ +export function getFilterValues(autoFilter: CT_AutoFilter, colIndex: number) { + const filterValues: Set = new Set(); + + const filterColumn = autoFilter.filterColumn?.find( + column => column.colId === colIndex + ); + + if (filterColumn) { + for (const filter of filterColumn.filters?.filter || []) { + if (filter.val) { + filterValues.add(filter.val); + } + } + } + + return filterValues; +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/hasFilterColumn.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/hasFilterColumn.ts new file mode 100644 index 000000000..7a85b2216 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/hasFilterColumn.ts @@ -0,0 +1,25 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; + +/** + * 判断是否有任意列过滤条件 + */ +export function hasFilterColumn(autoFilter: CT_AutoFilter, colIndex: number) { + const filterColumn = autoFilter.filterColumn; + if (!filterColumn) { + return false; + } + + for (const column of filterColumn) { + if (column.colId !== colIndex) { + continue; + } + if (column.filters && column.filters?.filter?.length) { + return true; + } + if (column.customFilters && column.customFilters?.customFilter?.length) { + return true; + } + } + + return false; +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/setCustomFilters.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/setCustomFilters.ts new file mode 100644 index 000000000..cfb01a40f --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/setCustomFilters.ts @@ -0,0 +1,24 @@ +import {CT_AutoFilter, CT_CustomFilters} from '../../../../openxml/ExcelTypes'; + +/** + * 设置自定义过滤条件 + */ +export function setCustomFilters( + autoFilter: CT_AutoFilter, + colIndex: number, + customFilters: CT_CustomFilters +) { + const filterColumn = autoFilter.filterColumn?.find( + column => column.colId === colIndex + ); + + if (filterColumn) { + filterColumn.customFilters = customFilters; + } else { + autoFilter.filterColumn = autoFilter.filterColumn || []; + autoFilter.filterColumn.push({ + colId: colIndex, + customFilters + }); + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/setFilterValues.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/setFilterValues.ts new file mode 100644 index 000000000..dbdadb6da --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/setFilterValues.ts @@ -0,0 +1,39 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; +import {CheckBoxOption} from '../../ui/CheckBox'; + +/** + * 获取配置中的过滤值,目前子支持 val 的情况 + */ +export function setFilterValues( + autoFilter: CT_AutoFilter, + colIndex: number, + options: CheckBoxOption[] +) { + const allChecked = options.every(option => option.checked); + + const filterColumn = autoFilter.filterColumn?.find( + column => column.colId === colIndex + ); + const filters = []; + for (const option of options) { + if (option.checked) { + filters.push({val: option.value}); + } + } + + if (filterColumn) { + if (allChecked) { + filterColumn.filters = undefined; + return; + } + filterColumn.filters = {filter: filters}; + } else { + if (!allChecked) { + autoFilter.filterColumn = autoFilter.filterColumn || []; + autoFilter.filterColumn.push({ + colId: colIndex, + filters: {filter: filters} + }); + } + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/filterColumn/toOperatorUI.ts b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/toOperatorUI.ts new file mode 100644 index 000000000..9152db23a --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/filterColumn/toOperatorUI.ts @@ -0,0 +1,37 @@ +import {ST_FilterOperator} from '../../../../openxml/ExcelTypes'; +import {OperatorTypeUI} from './OperatorTypeUI'; + +/** + * 将 xml 中的操作符转换为界面上的操作符,界面操作的格式会更多 + */ + +export function toOperatorUI( + operator: ST_FilterOperator, + value: string +): OperatorTypeUI { + if (operator === 'equal') { + if (value.startsWith('*') && value.endsWith('*')) { + return 'contains'; + } + if (value.endsWith('*')) { + return 'beginsWith'; + } + if (value.startsWith('*')) { + return 'endsWith'; + } + } + + if (operator === 'notEqual') { + if (value.startsWith('*') && value.endsWith('*')) { + return 'notContains'; + } + if (value.endsWith('*')) { + return 'notBeginsWith'; + } + if (value.startsWith('*')) { + return 'notEndsWith'; + } + } + + return operator; +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/renderAutoFilter.ts b/packages/office-viewer/src/excel/render/autoFilter/renderAutoFilter.ts new file mode 100644 index 000000000..badb886e6 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/renderAutoFilter.ts @@ -0,0 +1,35 @@ +import {Sheet} from '../../sheet/Sheet'; +import {ViewRange} from '../../sheet/ViewRange'; +import {renderAutoFilterIcon} from './renderAutoFilterIcon'; + +let tableId = 0; + +export function renderAutoFilter( + currentSheet: Sheet, + dataContainer: HTMLElement +) { + const autoFilter = currentSheet.getAutoFilter(); + + if (autoFilter) { + // sheet 级别的 autoFilter + renderAutoFilterIcon( + currentSheet, + autoFilter, + 'sheetAutoFilter', + dataContainer + ); + } + + // 表格级别的 autoFilter + const tables = currentSheet.getTables(); + for (const table of tables) { + if (table.autoFilter) { + renderAutoFilterIcon( + currentSheet, + table.autoFilter, + `table-${tableId++}`, + dataContainer + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/renderAutoFilterIcon.ts b/packages/office-viewer/src/excel/render/autoFilter/renderAutoFilterIcon.ts new file mode 100644 index 000000000..8c8dfe38f --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/renderAutoFilterIcon.ts @@ -0,0 +1,76 @@ +import {CT_AutoFilter} from '../../../openxml/ExcelTypes'; +import {parseRange} from '../../io/excel/util/Range'; +import {Sheet} from '../../sheet/Sheet'; +import {rectIntersect} from '../Rect'; +import {AutoFilterIconUI} from './AutoFilterIconUI'; + +const AutoFilterIconCache: Record = {}; + +/** + * 渲染 AutoFilter 图标 + */ +export function renderAutoFilterIcon( + sheet: Sheet, + autoFilter: CT_AutoFilter, + id: string, + dataContainer: HTMLElement, + headerRowCount: number = 1 +) { + const {ref} = autoFilter; + if (!ref) { + console.warn('缺少 ref 字段', autoFilter); + return; + } + + const sheetDataRect = sheet.getDataDisplayRect(); + + const {rowHeaderWidth, colHeaderHeight} = sheet.getRowColSize(); + + const rangeRef = parseRange(ref); + const startRow = rangeRef.startRow; + const startCol = rangeRef.startCol; + const endCol = rangeRef.endCol; + + let colIndex = -1; + // 初始化 dom 结构及对象结构 + for (let i = startCol; i <= endCol; i++) { + colIndex++; + const fid = `autoFilter-${id}-${colIndex}`; + const filterIconElement = dataContainer.querySelector( + `[data-fid="${fid}"]` + ); + if (filterIconElement) { + continue; + } + const filterIcon = new AutoFilterIconUI( + sheet, + dataContainer, + autoFilter, + rangeRef, + colIndex, + fid, + headerRowCount + ); + AutoFilterIconCache[fid] = filterIcon; + } + + colIndex = -1; + // 判断是否需要显示 + for (let i = startCol; i <= endCol; i++) { + colIndex++; + const fid = `autoFilter-${id}-${colIndex}`; + const position = sheet.getCellPosition(startRow, i); + const autoFilerIcon = AutoFilterIconCache[fid]!; + if (rectIntersect(sheetDataRect, position)) { + autoFilerIcon.updatePosition( + position.x - rowHeaderWidth, + position.y - colHeaderHeight, + // 避免过高展示效果不好 + Math.min(28, position.height), + position.width + ); + } else { + autoFilerIcon.hide(); + } + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/sortState/ColumnSortOrder.ts b/packages/office-viewer/src/excel/render/autoFilter/sortState/ColumnSortOrder.ts new file mode 100644 index 000000000..c46b99919 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/sortState/ColumnSortOrder.ts @@ -0,0 +1 @@ +export type ColumnSortOrder = 'asc' | 'desc' | 'none'; diff --git a/packages/office-viewer/src/excel/render/autoFilter/sortState/SortButtonUI.ts b/packages/office-viewer/src/excel/render/autoFilter/sortState/SortButtonUI.ts new file mode 100644 index 000000000..3606b65ce --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/sortState/SortButtonUI.ts @@ -0,0 +1,55 @@ +import {H} from '../../../../util/H'; + +/** + * 排序按钮 + */ +export class SortButtonUI { + element: HTMLElement; + + /** + * 是否是激活状态 + */ + active: boolean; + + constructor( + container: HTMLElement, + text: string, + onClick: (active: boolean) => void, + active: boolean, + iconSVG: string + ) { + const element = H('div', { + className: 'ov-excel-auto-filter__sort-button', + parent: container + }); + + this.element = element; + + element.addEventListener('click', () => { + onClick(this.active); + }); + + const icon = H('div', { + className: 'ov-excel-auto-filter__sort-button-icon', + parent: element + }); + icon.innerHTML = iconSVG; + + const textElement = H('div', { + className: 'ov-excel-auto-filter__sort-button-text', + parent: element + }); + textElement.textContent = text; + + this.active = active; + } + + setActive(active: boolean) { + this.active = active; + if (active) { + this.element.classList.add('ov-excel-auto-filter__sort-button-active'); + } else { + this.element.classList.remove('ov-excel-auto-filter__sort-button-active'); + } + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/sortState/SortStateUI.ts b/packages/office-viewer/src/excel/render/autoFilter/sortState/SortStateUI.ts new file mode 100644 index 000000000..38fa5fa3c --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/sortState/SortStateUI.ts @@ -0,0 +1,122 @@ +import {CT_AutoFilter} from '../../../../openxml/ExcelTypes'; +import {H} from '../../../../util/H'; +import {Sheet} from '../../../sheet/Sheet'; +import {RangeRef} from '../../../types/RangeRef'; +import {Icons} from '../../Icons'; +import type {AutoFilterIconUI} from '../AutoFilterIconUI'; +import {SortButtonUI} from './SortButtonUI'; +import {getColumnSortOrder} from './getColumnSortOrder'; +import {setColumnSortOrder} from './setColumnSortOrder'; + +/** + * 排序相关的操作 + */ +export class SortStateUI { + sortContainer: HTMLElement; + + sortAscButton: SortButtonUI; + + sortDescButton: SortButtonUI; + + autoFilter: CT_AutoFilter; + + rangeRef: RangeRef; + + colIndex: number; + + headerRowCount: number; + + sheet: Sheet; + + autoFilterIcon: AutoFilterIconUI; + + constructor( + autoFilterIcon: AutoFilterIconUI, + container: HTMLElement, + sheet: Sheet, + autoFilter: CT_AutoFilter, + rangeRef: RangeRef, + colIndex: number, + headerRowCount: number = 1 + ) { + this.autoFilterIcon = autoFilterIcon; + this.rangeRef = rangeRef; + const sortContainer = H('div', { + className: 'excel-auto-filter__menu-sort', + parent: container + }); + this.sortContainer = sortContainer; + this.colIndex = colIndex; + this.autoFilter = autoFilter; + this.headerRowCount = headerRowCount; + this.sheet = sheet; + + const sortAscButton = new SortButtonUI( + sortContainer, + sheet.translate('autoFilter.sortAscending'), + checked => { + this.clickButton('asc'); + }, + false, + Icons.sortUP + ); + + this.sortAscButton = sortAscButton; + + const sortDescButton = new SortButtonUI( + sortContainer, + sheet.translate('autoFilter.sortDescending'), + checked => { + this.clickButton('desc'); + }, + false, + Icons.sortDown + ); + + this.sortDescButton = sortDescButton; + + this.syncButtonActive(); + } + + clickButton(sortState: 'asc' | 'desc') { + const sheet = this.sheet; + const colIndex = this.colIndex; + const rangeRef = this.rangeRef; + const autoFilter = this.autoFilter; + const headerRowCount = this.headerRowCount; + setColumnSortOrder( + sheet, + colIndex, + rangeRef, + autoFilter, + sortState, + headerRowCount + ); + + this.sheet + .getWorkbook() + .uiEvent.emit('APPLY_AUTO_FILTER', this.sheet.getIndex()); + + this.syncButtonActive(); + this.autoFilterIcon.syncFilterIcon(); + } + + syncButtonActive() { + const colIndex = this.colIndex; + const rangeRef = this.rangeRef; + const autoFilter = this.autoFilter; + const columnSortState = getColumnSortOrder( + colIndex, + rangeRef, + autoFilter.sortState + ); + + if (columnSortState === 'asc') { + this.sortAscButton.setActive(true); + this.sortDescButton.setActive(false); + } else if (columnSortState === 'desc') { + this.sortAscButton.setActive(false); + this.sortDescButton.setActive(true); + } + } +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/sortState/getColumnSortOrder.ts b/packages/office-viewer/src/excel/render/autoFilter/sortState/getColumnSortOrder.ts new file mode 100644 index 000000000..9f0f288a1 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/sortState/getColumnSortOrder.ts @@ -0,0 +1,31 @@ +/** + * 获取配置中这一列的排序状态 + */ + +import {CT_SortState} from '../../../../openxml/ExcelTypes'; +import {parseRange} from '../../../io/excel/util/Range'; +import {RangeRef} from '../../../types/RangeRef'; + +export function getColumnSortOrder( + colIndex: number, + rangeRef: RangeRef, + sortState?: CT_SortState +) { + if (!sortState) { + return 'none'; + } + + for (const condition of sortState.sortCondition || []) { + const ref = condition.ref; + if (!ref) { + continue; + } + const conditionRangeRef = parseRange(ref); + const {startCol, endCol} = rangeRef; + if (startCol + colIndex === conditionRangeRef.startCol) { + return condition.descending ? 'desc' : 'asc'; + } + } + + return 'none'; +} diff --git a/packages/office-viewer/src/excel/render/autoFilter/sortState/setColumnSortOrder.ts b/packages/office-viewer/src/excel/render/autoFilter/sortState/setColumnSortOrder.ts new file mode 100644 index 000000000..845957480 --- /dev/null +++ b/packages/office-viewer/src/excel/render/autoFilter/sortState/setColumnSortOrder.ts @@ -0,0 +1,60 @@ +import {CT_AutoFilter, CT_SortState} from '../../../../openxml/ExcelTypes'; +import {parseRange, rangeRefToString} from '../../../io/excel/util/Range'; +import {Sheet} from '../../../sheet/Sheet'; +import {RangeRef} from '../../../types/RangeRef'; +import {ColumnSortOrder} from './ColumnSortOrder'; + +/** + * 设置列排序,这里实际上应该是命令,但目前只当成一种状态变化,主要是因为现阶段只支持浏览 + */ +export function setColumnSortOrder( + sheet: Sheet, + colIndex: number, + rangeRef: RangeRef, + autoFilter: CT_AutoFilter, + sortOrder: 'asc' | 'desc', + headerRowCount: number +) { + const sortStateRangeRef = {...rangeRef}; + sortStateRangeRef.startCol += colIndex; + sortStateRangeRef.endCol += colIndex; + + const sortConditionRef = rangeRefToString(sortStateRangeRef); + const sortCondition = { + ref: sortConditionRef, + descending: sortOrder === 'desc' + }; + + if (!autoFilter.sortState) { + const sortStateRangeRef = {...rangeRef}; + + sortStateRangeRef.startRow += headerRowCount; + + const sortStateRef = rangeRefToString(sortStateRangeRef); + + autoFilter.sortState = { + ref: sortStateRef, + sortCondition: [sortCondition] + }; + sheet.applyAutoFilter(autoFilter, headerRowCount); + return; + } + + if (autoFilter.sortState.sortCondition === undefined) { + autoFilter.sortState.sortCondition = []; + } + + for (const condition of autoFilter.sortState?.sortCondition || []) { + const rangeRef = parseRange(condition.ref || ''); + if (sortStateRangeRef.startCol === rangeRef.startCol) { + // 统一一下 endRow + rangeRef.endRow = sortStateRangeRef.endRow; + condition.descending = sortOrder === 'desc'; + sheet.applyAutoFilter(autoFilter, headerRowCount); + return; + } + } + + autoFilter.sortState.sortCondition.push(sortCondition); + sheet.applyAutoFilter(autoFilter, headerRowCount); +} diff --git a/packages/office-viewer/src/excel/render/canvas/draw.ts b/packages/office-viewer/src/excel/render/canvas/draw.ts new file mode 100644 index 000000000..3e7484377 --- /dev/null +++ b/packages/office-viewer/src/excel/render/canvas/draw.ts @@ -0,0 +1,51 @@ +/** + * 绘制圆角矩形路径 + * @param cornerRadius 圆角半径 + */ + +export function drawRoundedRectPath( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + width: number, + height: number, + cornerRadius: number | number[] +) { + let topLeft = 0; + let topRight = 0; + let bottomLeft = 0; + let bottomRight = 0; + if (typeof cornerRadius === 'number') { + topLeft = + topRight = + bottomLeft = + bottomRight = + Math.min(cornerRadius, width / 2, height / 2); + } else { + topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2); + topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2); + bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2); + bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2); + } + ctx.moveTo(topLeft, 0); + ctx.lineTo(width - topRight, 0); + ctx.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false); + ctx.lineTo(width, height - bottomRight); + ctx.arc( + width - bottomRight, + height - bottomRight, + bottomRight, + 0, + Math.PI / 2, + false + ); + ctx.lineTo(bottomLeft, height); + ctx.arc( + bottomLeft, + height - bottomLeft, + bottomLeft, + Math.PI / 2, + Math.PI, + false + ); + ctx.lineTo(0, topLeft); + ctx.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false); +} diff --git a/packages/office-viewer/src/excel/render/canvas/drawOffscreenCanvas.ts b/packages/office-viewer/src/excel/render/canvas/drawOffscreenCanvas.ts new file mode 100644 index 000000000..995912468 --- /dev/null +++ b/packages/office-viewer/src/excel/render/canvas/drawOffscreenCanvas.ts @@ -0,0 +1,19 @@ +/** + * 使用 OffscreenCanvas 渲染后获取内容 + * @param func 执行的调用函数 + * @returns + */ +export function drawOffscreenCanvas( + ratio: number, + width: number, + height: number, + func: (ctx: OffscreenCanvasRenderingContext2D) => void +) { + const cacheCanvas = new OffscreenCanvas(width * ratio, height * ratio); + const cacheCtx = cacheCanvas.getContext( + '2d' + )! as OffscreenCanvasRenderingContext2D; + cacheCtx.scale(ratio, ratio); + func(cacheCtx); + return cacheCanvas; +} diff --git a/packages/office-viewer/src/excel/render/canvas/setPixelRatio.ts b/packages/office-viewer/src/excel/render/canvas/setPixelRatio.ts new file mode 100644 index 000000000..6f112b9b6 --- /dev/null +++ b/packages/office-viewer/src/excel/render/canvas/setPixelRatio.ts @@ -0,0 +1,19 @@ +/** + * 设置像素比来支持高清屏幕,参考 Mozilla 里的文档 + */ +export function setPixelRatio( + canvas: HTMLCanvasElement, + width: number, + height: number +) { + const ratio = window.devicePixelRatio || 1; + canvas.width = Math.floor(width * ratio); + canvas.height = Math.floor(height * ratio); + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + const ctx = canvas.getContext('2d'); + if (ctx) { + ctx.scale(ratio, ratio); + } + return ratio; +} diff --git a/packages/office-viewer/src/excel/render/cell/CellInfoWithSize.ts b/packages/office-viewer/src/excel/render/cell/CellInfoWithSize.ts new file mode 100644 index 000000000..3724aab30 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/CellInfoWithSize.ts @@ -0,0 +1,6 @@ +import {CellInfo} from '../../types/CellInfo'; + +export type CellInfoWithSize = CellInfo & { + width: number; + height: number; +}; diff --git a/packages/office-viewer/src/excel/render/cell/LinkPosition.ts b/packages/office-viewer/src/excel/render/cell/LinkPosition.ts new file mode 100644 index 000000000..2a76033b6 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/LinkPosition.ts @@ -0,0 +1,15 @@ +import {Rect} from '../Rect'; + +/** + * 链接位置 + */ +export type LinkPosition = { + /** + * 链接位置 + */ + url: string; + /** + * 如果有多个位置,表示折行了,需要每一行都判断 + */ + pos: Rect[]; +}; diff --git a/packages/office-viewer/src/excel/render/cell/autoClip.ts b/packages/office-viewer/src/excel/render/cell/autoClip.ts new file mode 100644 index 000000000..d263f3e65 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/autoClip.ts @@ -0,0 +1,40 @@ +/** + * 自动裁剪,Excel 中似乎会自动避免遮挡,目前还不清楚是怎么实现的 + */ + +import {CellInfo} from '../../types/CellInfo'; +import {IDataProvider} from '../../types/IDataProvider'; +import {CellInfoWithSize} from './CellInfoWithSize'; +import {measureTextWithCache} from './measureTextWithCache'; +import {genFontStr} from './genFontStr'; + +export function autoClip( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + cellInfoMap: Map +) { + for (const [key, cellInfo] of cellInfoMap) { + const row = parseInt(key.split(',')[0]); + const col = parseInt(key.split(',')[1]); + + const nextCol = col + 1; + // 如果当前单元格右边有单元格且当前单元格不是 wrap + if (cellInfoMap.has(`${row},${nextCol}`)) { + const nextCellInfo = cellInfoMap.get(`${row},${nextCol}`)!; + // 当前和后面单元格都有文本,且当前单元格不是 wrap + if ( + cellInfo.alignment?.wrapText !== true && + cellInfo.text && + nextCellInfo.text + ) { + const fontStyle = dataProvider.getFontStyle(cellInfo.font); + // 如果当前文本过长,可能会折叠后面的文本,就设置为 needClip + const font = genFontStr(fontStyle); + const size = measureTextWithCache(ctx, font, cellInfo.text); + if (size.width > cellInfo.width) { + cellInfo.needClip = true; + } + } + } + } +} diff --git a/packages/office-viewer/src/excel/render/cell/autoWrapText.ts b/packages/office-viewer/src/excel/render/cell/autoWrapText.ts new file mode 100644 index 000000000..dab5cc7d6 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/autoWrapText.ts @@ -0,0 +1,150 @@ +/** + * 自动换行 + */ + +import {stringToArray} from '../../../util/stringToArray'; +import {FontStyle} from '../../types/FontStyle'; + +import {IRElt} from '../../types/IRElt'; +import {genFontStr, genFontStrFromRPr} from './genFontStr'; +import {measureTextWithCache} from './measureTextWithCache'; +import {Token, tokenizer} from './tokenizer'; + +/** + * 拆分出来每一行的数据 + */ +export interface WrapLine { + tokens: Token[]; + /** + * 最大高度,减少后续计算,这个结果可能为 0,这时需要加上默认字体高度 + */ + maxHeight: number; +} + +/** + * 自动折行 + * @param ctx canvas context + * @param text 文字 + * @param fontStyle 字体样式 + * @returns 拆分的行,有可能空行 + */ +export function autoWrapText( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + text: string | IRElt[], + width: number, + fontStyle: FontStyle +) { + ctx.save(); + + let tokens: Token[] = []; + const lines: WrapLine[] = []; + + if (typeof text === 'string') { + tokens = tokenizer(text); + } else { + for (const t of text) { + const newTokens = tokenizer(t.t); + newTokens.forEach(token => { + token.rPr = t.rPr; + }); + tokens = tokens.concat(newTokens); + } + } + // 限制一千 token 避免性能问题 + if (tokens.length > 1000) { + tokens = tokens.slice(0, 1000); + } + const defaultFont = genFontStr(fontStyle); + let currentWidth = 0; + // 计算默认字体高度 + const defaultSize = measureTextWithCache(ctx, defaultFont, '1'); + const defaultFontHeight = defaultSize.fontHeight; + let currentMaxHeight = defaultFontHeight; + let currentToken: Token[] = []; + + function pushToken(newToken?: Token) { + lines.push({ + tokens: currentToken, + maxHeight: currentMaxHeight + }); + if (newToken) { + currentToken = [newToken]; + } else { + currentToken = []; + } + + currentWidth = 0; + currentMaxHeight = defaultFontHeight; + } + for (const token of tokens) { + let font = defaultFont; + if (token.type === 'br') { + pushToken(); + continue; + } + if (token.rPr && Object.keys(token.rPr).length > 0) { + font = genFontStrFromRPr(token.rPr, fontStyle); + } + const size = measureTextWithCache(ctx, font, token.t); + + const tokenWidth = size.width; + // 字体高度 + const tokenFontHeight = size.fontHeight; + token.w = tokenWidth; + if (tokenFontHeight > currentMaxHeight) { + currentMaxHeight = tokenFontHeight; + } + + // 如果这一行宽度就比要求高度宽了,那还得拆分,这时就只能一个个字母算了 + if (tokenWidth > width) { + let currentText = ''; + // 当前拆分出来的文字宽度 + let currentSplitWidth = 0; + for (const char of stringToArray(token.t)) { + // 避免太多 token,这里会对 token 进行合并 + const charSize = measureTextWithCache(ctx, font, char); + const charWidth = charSize.width; + if (currentWidth + charWidth > width) { + const splitToken = { + ...token, + w: currentSplitWidth, + t: currentText + }; + currentToken.push(splitToken); + // 后面会处理新行 + pushToken(); + currentText = char; + currentWidth = charWidth; + currentSplitWidth = charWidth; + currentMaxHeight = currentMaxHeight; + } else { + currentWidth += charWidth; + currentSplitWidth += charWidth; + currentText += char; + } + } + if (currentText) { + const splitToken = { + ...token, + w: currentSplitWidth, + t: currentText + }; + currentToken.push(splitToken); + } + } else if (currentWidth + tokenWidth > width) { + pushToken(token); + } else { + currentWidth += size.width; + currentToken.push(token); + } + } + if (currentToken.length) { + lines.push({ + tokens: currentToken, + maxHeight: currentMaxHeight + }); + } + + ctx.restore(); + return lines; +} diff --git a/packages/office-viewer/src/excel/render/cell/border/drawDoubleBorder.ts b/packages/office-viewer/src/excel/render/cell/border/drawDoubleBorder.ts new file mode 100644 index 000000000..cd47164bb --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/border/drawDoubleBorder.ts @@ -0,0 +1,100 @@ +import {CT_Border, CT_BorderPr} from '../../../../openxml/ExcelTypes'; + +function isDoubleBorder(borderPr: CT_BorderPr | undefined) { + return borderPr && borderPr.style === 'double'; +} + +export function drawDoubleBorder( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + border: CT_Border, + position: 'left' | 'right' | 'top' | 'bottom' | 'diagonalDown' | 'diagonalUp', + startX: number, + startY: number, + endX: number, + endY: number +) { + ctx.lineWidth = 1; + const lineOffset = 1; + switch (position) { + case 'top': + ctx.moveTo(startX - lineOffset, startY - lineOffset); + ctx.lineTo(endX + lineOffset, startY - lineOffset); + + // 避免双边框重叠 + if (isDoubleBorder(border.left)) { + startX += 1; + } + + if (isDoubleBorder(border.right)) { + endX -= 1; + } + + ctx.moveTo(startX, startY + lineOffset); + ctx.lineTo(endX, startY + lineOffset); + break; + case 'bottom': + ctx.moveTo(startX - lineOffset, endY + lineOffset); + ctx.lineTo(endX + lineOffset, endY + lineOffset); + + // 避免双边框重叠 + if (isDoubleBorder(border.left)) { + startX += 1; + } + + if (isDoubleBorder(border.right)) { + endX -= 1; + } + + ctx.moveTo(startX, endY - lineOffset); + ctx.lineTo(endX, endY - lineOffset); + + break; + case 'left': + ctx.moveTo(startX - lineOffset, startY - lineOffset); + ctx.lineTo(startX - lineOffset, endY + lineOffset); + + // 避免双边框重叠 + if (isDoubleBorder(border.top)) { + startY += 1; + } + + if (isDoubleBorder(border.bottom)) { + endY -= 1; + } + + ctx.moveTo(startX + lineOffset, startY); + ctx.lineTo(startX + lineOffset, endY); + + break; + case 'right': + ctx.moveTo(endX + lineOffset, startY - lineOffset); + ctx.lineTo(endX + lineOffset, endY + lineOffset); + + // 避免双边框重叠 + if (isDoubleBorder(border.top)) { + startY += 1; + } + + if (isDoubleBorder(border.bottom)) { + endY -= 1; + } + ctx.moveTo(endX - lineOffset, startY); + ctx.lineTo(endX - lineOffset, endY); + + break; + + case 'diagonalDown': + ctx.moveTo(startX - lineOffset, startY + lineOffset); + ctx.lineTo(endX - lineOffset, endY + lineOffset); + ctx.moveTo(startX + lineOffset, startY - lineOffset); + ctx.lineTo(endX + lineOffset, endY - lineOffset); + break; + + case 'diagonalUp': + ctx.moveTo(startX - lineOffset, startY - lineOffset); + ctx.lineTo(endX - lineOffset, endY - lineOffset); + ctx.moveTo(startX + lineOffset, startY + lineOffset); + ctx.lineTo(endX + lineOffset, endY + lineOffset); + break; + } +} diff --git a/packages/office-viewer/src/excel/render/cell/border/setLineStyle.ts b/packages/office-viewer/src/excel/render/cell/border/setLineStyle.ts new file mode 100644 index 000000000..9c5a01f9e --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/border/setLineStyle.ts @@ -0,0 +1,53 @@ +import {ST_BorderStyle} from '../../../../openxml/ExcelTypes'; + +/** + * 参考 18.18.3 (p2436) + */ + +export function setLineStyle( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + style?: ST_BorderStyle +) { + ctx.lineWidth = 1; + if (style) { + switch (style) { + case 'hair': + ctx.setLineDash([1, 2]); + break; + + case 'dashDotDot': + case 'mediumDashDotDot': + ctx.setLineDash([2, 2, 5, 2, 2]); + break; + + case 'dashDot': + case 'mediumDashDot': + case 'slantDashDot': + ctx.setLineDash([2, 5, 2]); + break; + + case 'dotted': + ctx.setLineDash([2]); + break; + + case 'dashed': + case 'mediumDashed': + ctx.setLineDash([3]); + break; + + case 'medium': + ctx.lineWidth = 2; + break; + + case 'thick': + ctx.lineWidth = 3; + break; + + default: + ctx.setLineDash([0]); + break; + } + } else { + ctx.setLineDash([]); + } +} diff --git a/packages/office-viewer/src/excel/render/cell/cellToMergeCell.ts b/packages/office-viewer/src/excel/render/cell/cellToMergeCell.ts new file mode 100644 index 000000000..231028182 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/cellToMergeCell.ts @@ -0,0 +1,29 @@ +import {RangeRef} from '../../types/RangeRef'; + +/** + * 将单元格转成合并单元格 + * @param row + * @param col + * @param mergeCells + */ +export function cellToMergeCell( + row: number, + col: number, + mergeCells: RangeRef[] +): RangeRef { + for (const mergeCell of mergeCells) { + const {startRow, endRow, startCol, endCol} = mergeCell; + if (row >= startRow && row <= endRow && col >= startCol && col <= endCol) { + return { + ...mergeCell + }; + } + } + + return { + startRow: row, + startCol: col, + endRow: row, + endCol: col + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/checkFont.ts b/packages/office-viewer/src/excel/render/cell/checkFont.ts new file mode 100644 index 000000000..d8759d63d --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/checkFont.ts @@ -0,0 +1,24 @@ +import {isFontAvailable} from '../../../util/isFontAvailable'; + +const FontAvailableCache = new Map(); + +/** + * 检查字体是否存在,这里主要是为了加缓存和 warning + */ +export function checkFont(font: string) { + if (FontAvailableCache.has(font)) { + return FontAvailableCache.get(font); + } + const result = isFontAvailable(font); + FontAvailableCache.set(font, result); + return result; +} + +/** + * 获取所有不可用的字体 + */ +export function getAllNotAvailableFont(): string[] { + return Array.from(FontAvailableCache.entries()) + .filter(([_, v]) => v === false) + .map(([k]) => k); +} diff --git a/packages/office-viewer/src/excel/render/cell/drawCell.ts b/packages/office-viewer/src/excel/render/cell/drawCell.ts new file mode 100644 index 000000000..0fe0d7f26 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawCell.ts @@ -0,0 +1,78 @@ +import {Sheet} from '../../sheet/Sheet'; +import {CellInfo} from '../../types/CellInfo'; +import {IDataProvider} from '../../types/IDataProvider'; +import {Canvas} from '../Canvas'; +import type {ExcelRender} from '../ExcelRender'; +import {LinkPosition} from './LinkPosition'; +import {drawCellBackground} from './drawCellBackground'; +import {drawCellBorder} from './drawCellBorder'; +import {drawCellDataBar} from './drawDataBar'; +import {drawIconSet} from './drawIconSet'; +import {drawTextInCell} from './drawTextInCell'; + +/** + * 绘制单元格的实现逻辑 + * @param ctx + * @param dataProvider + * @param cellInfo + * @param x + * @param y + * @param width + * @param height + * @param padding + * @param needClear + */ +export function drawCell( + excelRender: ExcelRender, + sheet: Sheet, + canvas: Canvas, + dataProvider: IDataProvider, + cellInfo: CellInfo, + x: number, + y: number, + width: number, + height: number, + indentSize: number, + padding: number, + needClear = false, + linkPositionCache: LinkPosition[] = [] +) { + const ctx = canvas.ctx; + if (needClear) { + // 这里减 1 是为了避免清除网格线,不过后续需要更好的实现 + ctx.clearRect(x + 1, y + 1, width - 2, height - 2); + } + + drawCellBackground(ctx, dataProvider, cellInfo, x, y, width, height); + + let drawText = true; + if (cellInfo.dataBarDisplay) { + //数据条的绘制 + drawCellDataBar(canvas, cellInfo.dataBarDisplay, x, y, width, height); + drawText = cellInfo.dataBarDisplay.showValue; + } + + if (cellInfo.icon) { + drawIconSet(canvas, cellInfo.icon, x, y, width, height); + } + + if (drawText) { + drawTextInCell( + excelRender, + sheet, + ctx, + dataProvider, + cellInfo, + x, + y, + width, + height, + indentSize, + padding, + linkPositionCache + ); + } + + // Excel 里似乎是后绘制 border + drawCellBorder(ctx, dataProvider, cellInfo, x, y, width, height); +} diff --git a/packages/office-viewer/src/excel/render/cell/drawCellBackground.ts b/packages/office-viewer/src/excel/render/cell/drawCellBackground.ts new file mode 100644 index 000000000..5e138b58e --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawCellBackground.ts @@ -0,0 +1,19 @@ +import {CellInfo} from '../../types/CellInfo'; +import {IDataProvider} from '../../types/IDataProvider'; +import {getBackgroundColor} from './getBackgroundColor'; + +export function drawCellBackground( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + cellInfo: CellInfo, + x: number, + y: number, + width: number, + height: number +) { + const backgroundColor = getBackgroundColor(dataProvider, cellInfo.fill); + if (backgroundColor !== 'none') { + ctx.fillStyle = backgroundColor; + ctx.fillRect(x, y, width, height); + } +} diff --git a/packages/office-viewer/src/excel/render/cell/drawCellBorder.ts b/packages/office-viewer/src/excel/render/cell/drawCellBorder.ts new file mode 100644 index 000000000..870a325ad --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawCellBorder.ts @@ -0,0 +1,132 @@ +import {CT_Border, CT_BorderPr} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {IDataProvider} from '../../types/IDataProvider'; + +import {AUTO_COLOR} from '../Consts'; +import {drawDoubleBorder} from './border/drawDoubleBorder'; +import {setLineStyle} from './border/setLineStyle'; + +/** + * 绘制单个边框 + */ +function drawSingleBorder( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + border: CT_Border, + borderPr: CT_BorderPr | undefined, + position: 'left' | 'right' | 'top' | 'bottom' | 'diagonalDown' | 'diagonalUp', + startX: number, + startY: number, + endX: number, + endY: number +) { + if (borderPr && borderPr.style && borderPr.style !== 'none') { + ctx.beginPath(); + + ctx.strokeStyle = dataProvider.getColor(borderPr.color, AUTO_COLOR); + if (borderPr.style === 'double') { + drawDoubleBorder(ctx, border, position, startX, startY, endX, endY); + } else { + setLineStyle(ctx, borderPr.style); + ctx.moveTo(startX, startY); + ctx.lineTo(endX, endY); + } + + ctx.stroke(); + } +} + +/** + * 绘制单元格边框 + */ +export function drawCellBorder( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + cellInfo: CellInfo, + x: number, + y: number, + width: number, + height: number +) { + const border = cellInfo.border; + if (!border) { + return; + } + // 绘制边框 + ctx.save(); + ctx.lineWidth = 1; + drawSingleBorder( + ctx, + dataProvider, + border, + border.top, + 'top', + x, + y, + x + width, + y + ); + drawSingleBorder( + ctx, + dataProvider, + border, + border.bottom, + 'bottom', + x, + y + height, + x + width, + y + height + ); + drawSingleBorder( + ctx, + dataProvider, + border, + border.left, + 'left', + x, + y, + x, + y + height + ); + drawSingleBorder( + ctx, + dataProvider, + border, + border.right, + 'right', + x + width, + y, + x + width, + y + height + ); + + if (border.diagonalDown) { + drawSingleBorder( + ctx, + dataProvider, + border, + border.diagonal, + 'diagonalDown', + x, + y, + x + width, + y + height + ); + } + + if (border.diagonalUp) { + drawSingleBorder( + ctx, + dataProvider, + border, + border.diagonal, + 'diagonalUp', + x, + y + height, + x + width, + y + ); + } + + ctx.restore(); +} diff --git a/packages/office-viewer/src/excel/render/cell/drawCells.ts b/packages/office-viewer/src/excel/render/cell/drawCells.ts new file mode 100644 index 000000000..7fcc304f4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawCells.ts @@ -0,0 +1,58 @@ +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; +import {DisplayData, Sheet} from '../../sheet/Sheet'; +import {SheetCanvas} from '../SheetCanvas'; +import {PADDING_SIZE} from '../Consts'; +import {LinkPosition} from './LinkPosition'; +import {CellInfo} from '../../types/CellInfo'; +import {autoClip} from './autoClip'; +import {CellInfoWithSize} from './CellInfoWithSize'; +import type {ExcelRender} from '../ExcelRender'; + +/** + * 绘制所有单元格的主入口 + */ +export function drawCells( + excelRender: ExcelRender, + currentSheet: Sheet, + excelRenderOptions: ExcelRenderOptions, + canvas: SheetCanvas, + displayData: DisplayData[], + linkPositionCache: LinkPosition[] +) { + const cellInfoMap: Map = new Map(); + for (const data of displayData) { + const {row, col, width, height} = data; + if (width <= 0 || height <= 0) { + continue; + } + const cellInfo = currentSheet.getCellInfo(row, col); + if (cellInfo) { + cellInfoMap.set(`${row},${col}`, {...cellInfo, width, height}); + } + } + + canvas.autoClip(cellInfoMap); + + for (const data of displayData) { + const {row, col, x, y, width, height, needClear} = data; + if (width <= 0 || height <= 0) { + continue; + } + const key = `${row},${col}`; + if (cellInfoMap.has(key)) { + const cellInfo = cellInfoMap.get(key)!; + canvas.drawCell( + excelRender, + cellInfo, + x, + y, + width, + height, + excelRenderOptions.indentSize, + PADDING_SIZE, + needClear, + linkPositionCache + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/cell/drawDataBar.ts b/packages/office-viewer/src/excel/render/cell/drawDataBar.ts new file mode 100644 index 000000000..6e9c81815 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawDataBar.ts @@ -0,0 +1,61 @@ +import {DataBarDisplay} from '../../types/DataBarDisplay'; +import {Canvas} from '../Canvas'; +import {drawCellDataBarX14} from './drawDataBarX14'; + +export function drawCellDataBar( + canvas: Canvas, + dataBarDisplay: DataBarDisplay, + x: number, + y: number, + width: number, + height: number +) { + if (dataBarDisplay.biDirectional) { + return drawCellDataBarX14(canvas, dataBarDisplay, x, y, width, height); + } + const fillColor = dataBarDisplay.color; + if (fillColor !== 'none') { + const displayWidth = width * dataBarDisplay.percent; + // 从有到左需要换一下方向 + if (dataBarDisplay.direction === 'rightToLeft') { + x = x + width - displayWidth; + } + + if (dataBarDisplay.gradient) { + if (dataBarDisplay.direction === 'rightToLeft') { + canvas.drawRectLinearGradientWithPadding( + x, + y, + displayWidth, + height, + dataBarDisplay.colorGradient, + fillColor, + 1 + ); + } else { + canvas.drawRectLinearGradientWithPadding( + x, + y, + displayWidth, + height, + fillColor, + dataBarDisplay.colorGradient, + 1 + ); + } + } else { + canvas.drawRectWithPadding(x, y, displayWidth, height, fillColor, 1); + } + + if (dataBarDisplay.border && dataBarDisplay.borderColor) { + canvas.drawStrokeRectPadding( + x, + y, + displayWidth, + height, + dataBarDisplay.borderColor, + 1 + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/cell/drawDataBarX14.ts b/packages/office-viewer/src/excel/render/cell/drawDataBarX14.ts new file mode 100644 index 000000000..2caea8474 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawDataBarX14.ts @@ -0,0 +1,92 @@ +import {DataBarDisplay} from '../../types/DataBarDisplay'; +import {Canvas} from '../Canvas'; + +/** + * Excel 2010 中的双向数据条,这里已经过滤了数据里没有负数的情况,所以一定是两边显示 + * 不支持 rightToLeft,因为看起来很奇怪,估计不会有人用 + */ +export function drawCellDataBarX14( + canvas: Canvas, + dataBarDisplay: DataBarDisplay, + x: number, + y: number, + width: number, + height: number +) { + const fillColor = dataBarDisplay.color; + if (fillColor !== 'none') { + const xCenter = x + width / 2; + // 绘制中间的坐标轴竖线 + const axisColor = dataBarDisplay.axisColor; + canvas.setLineDash( + { + x1: xCenter, + y1: y, + x2: xCenter, + y2: y + height + }, + [1, 1], + axisColor + ); + + const displayWidth = Math.abs((width * dataBarDisplay.percent) / 2); + if (displayWidth === 0) { + return; + } + + if (dataBarDisplay.percent < 0) { + // 绘制负数部分 + if (dataBarDisplay.gradient) { + let startColor = dataBarDisplay.negativeFillColorGradient; + let endColor = dataBarDisplay.negativeFillColor; + canvas.drawRectLinearGradientWithPadding( + xCenter - displayWidth, + y, + displayWidth, + height, + startColor, + endColor, + 1 + ); + } + // 绘制边框 + if (dataBarDisplay.border && dataBarDisplay.negativeBorderColor) { + canvas.drawStrokeRectPadding( + xCenter - displayWidth, + y, + displayWidth, + height, + dataBarDisplay.negativeBorderColor, + 1 + ); + } + } else { + // 绘制正数部分 + if (dataBarDisplay.gradient) { + let startColor = dataBarDisplay.color; + let endColor = dataBarDisplay.colorGradient; + canvas.drawRectLinearGradientWithPadding( + xCenter, + y, + displayWidth, + height, + startColor, + endColor, + 1 + ); + } + + // 绘制边框 + if (dataBarDisplay.border && dataBarDisplay.borderColor) { + canvas.drawStrokeRectPadding( + xCenter, + y, + displayWidth, + height, + dataBarDisplay.borderColor, + 1 + ); + } + } + } +} diff --git a/packages/office-viewer/src/excel/render/cell/drawIconSet.ts b/packages/office-viewer/src/excel/render/cell/drawIconSet.ts new file mode 100644 index 000000000..53cd73a12 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawIconSet.ts @@ -0,0 +1,21 @@ +import {IconNames, presetIcons} from '../../io/excel/preset/presetIcons'; + +import {Canvas} from '../Canvas'; + +export function drawIconSet( + canvas: Canvas, + icon: IconNames, + x: number, + y: number, + width: number, + height: number +) { + const iconURL = presetIcons[icon]; + if (!iconURL) { + console.warn('未知的图标', icon); + return; + } + + // 避免挡住网格线 + canvas.drawImageWithCache(iconURL, x + 1, y + 1, height - 2, height - 2); +} diff --git a/packages/office-viewer/src/excel/render/cell/drawMultiLineText.ts b/packages/office-viewer/src/excel/render/cell/drawMultiLineText.ts new file mode 100644 index 000000000..d87369ee2 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawMultiLineText.ts @@ -0,0 +1,121 @@ +import { + ST_HorizontalAlignment, + ST_VerticalAlignment +} from '../../../openxml/ExcelTypes'; +import {isValidURL} from '../../../util/isValidURL'; +import {Sheet} from '../../sheet/Sheet'; +import {FontStyle} from '../../types/FontStyle'; +import {IDataProvider} from '../../types/IDataProvider'; +import type {ExcelRender} from '../ExcelRender'; +import {Rect} from '../Rect'; +import {LinkPosition} from './LinkPosition'; + +import {WrapLine} from './autoWrapText'; +import {genFontStr, genFontStrFromRPr} from './genFontStr'; + +const debugFontBoundingBox = false; + +export function drawMultiLineText( + excelRender: ExcelRender, + sheet: Sheet, + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + fontStyle: FontStyle, + lines: WrapLine[], + x: number, + y: number, + width: number, + height: number, + padding: number, + horizontal: ST_HorizontalAlignment, + vertical: ST_VerticalAlignment, + text: string, + row: number, + linkPositionCache: LinkPosition[] = [] +) { + // 这样才能让不同字体大小的文字垂直对齐 + ctx.textBaseline = 'alphabetic'; + + const defaultFontHeight = dataProvider.getDefaultFontSize().height; + + const latterSpace = defaultFontHeight * 0.1; + + const textPositions: Rect[] = []; + + const totalLineHeight = lines.reduce((acc, line) => { + return acc + (line.maxHeight || defaultFontHeight); + }, 0); + // 起始 Y 坐标,默认按垂直居中显示 + let currentY = y + (height - totalLineHeight) / 2; + if (vertical === 'bottom') { + currentY = y + height - totalLineHeight; + } else if (vertical === 'top') { + currentY = y; + } + // 计算文本高度 + let textHeight = 0; + // 行数 + let lineNumber = 0; + for (const line of lines) { + lineNumber++; + const tokens = line.tokens; + // 默认按左对齐 + let currentX = x; + let totalLineWidth = tokens.reduce((acc, token) => { + return acc + (token.w || 0); + }, 0); + + // 加上字母间距 + totalLineWidth += latterSpace * (tokens.length - 1); + + if (horizontal === 'center') { + currentX = x + (width - totalLineWidth) / 2; + } else if (horizontal === 'right') { + currentX = x + width - totalLineWidth; + } + for (const token of tokens) { + const font = genFontStr(fontStyle); + ctx.font = font; + ctx.fillStyle = fontStyle.color; + if (token.rPr && Object.keys(token.rPr).length > 0) { + const font = genFontStrFromRPr(token.rPr, fontStyle); + ctx.font = font; + if (token.rPr.color) { + ctx.fillStyle = dataProvider.getColor(token.rPr.color); + } + } + const fontHeight = line.maxHeight || defaultFontHeight; + if (debugFontBoundingBox) { + ctx.strokeStyle = '#ff0000'; + ctx.strokeRect(currentX, currentY, token.w || 0, fontHeight); + } + ctx.fillText(token.t, currentX, currentY + fontHeight); + textPositions.push({ + x: currentX, + y: currentY, + width: token.w || 0, + height: fontHeight + }); + // 这里其实不大可能为零 + currentX = currentX + (token.w || 0) + latterSpace; + } + const lineHeight = line.maxHeight || defaultFontHeight; + textHeight += lineHeight; + currentY = currentY + lineHeight; + } + + // 当文本高度大于单元格高度时,需要重新渲染,目前这个计算还不知道是否合理 + // 阀值,这个主要是为了避免计算差异导致无限重新渲染 + const threadHold = 4; + if (Math.floor(totalLineHeight - threadHold) > height + padding * 2) { + sheet.setRowHeight(row, totalLineHeight + padding * 2); + excelRender.setNeedReDraw(); + } + + if (isValidURL(text)) { + linkPositionCache.push({ + url: text, + pos: textPositions + }); + } +} diff --git a/packages/office-viewer/src/excel/render/cell/drawSingleLineRichText.ts b/packages/office-viewer/src/excel/render/cell/drawSingleLineRichText.ts new file mode 100644 index 000000000..d54a40923 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawSingleLineRichText.ts @@ -0,0 +1,83 @@ +import { + ST_HorizontalAlignment, + ST_VerticalAlignment +} from '../../../openxml/ExcelTypes'; +import {IDataProvider} from '../../types/IDataProvider'; +import {IRElt} from '../../types/IRElt'; +import {WrapLine} from './autoWrapText'; +import {measureTextWithCache} from './measureTextWithCache'; +import {genFontStr, genFontStrFromRPr} from './genFontStr'; +import {drawMultiLineText} from './drawMultiLineText'; +import {FontStyle} from '../../types/FontStyle'; +import {Sheet} from '../../sheet/Sheet'; +import {ExcelRender} from '../ExcelRender'; + +/** + * 绘制单行富文本,这里复用了多行富文本的逻辑,所以这里只进行 token 拆分 + */ +export function drawSingleLineRichText( + excelRender: ExcelRender, + sheet: Sheet, + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + fontStyle: FontStyle, + richTexts: IRElt[], + x: number, + y: number, + width: number, + height: number, + horizontal: ST_HorizontalAlignment, + vertical: ST_VerticalAlignment, + row: number +) { + const defaultFont = genFontStr(fontStyle); + + const line: WrapLine = { + tokens: [], + maxHeight: 0 + }; + const lines: WrapLine[] = [line]; + + const defaultFontHeight = dataProvider.getDefaultFontSize().height; + let maxHeight = defaultFontHeight; + let text = ''; + for (const richText of richTexts) { + let font = defaultFont; + if (richText.rPr && Object.keys(richText.rPr).length > 0) { + font = genFontStrFromRPr(richText.rPr, fontStyle); + } + const textSize = measureTextWithCache(ctx, font, richText.t); + const textWidth = textSize.width; + // 字体高度 + const textFontHeight = textSize.height; + if (textFontHeight > maxHeight) { + maxHeight = textFontHeight; + } + text += richText.t; + line.tokens.push({ + type: 'w', + t: richText.t, + rPr: richText.rPr, + w: textWidth + }); + } + line.maxHeight = maxHeight; + const padding = 0; + drawMultiLineText( + excelRender, + sheet, + ctx, + dataProvider, + fontStyle, + lines, + x, + y, + width, + height, + padding, + horizontal, + vertical, + text, + row + ); +} diff --git a/packages/office-viewer/src/excel/render/cell/drawSingleLineText.ts b/packages/office-viewer/src/excel/render/cell/drawSingleLineText.ts new file mode 100644 index 000000000..bdc641a3a --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawSingleLineText.ts @@ -0,0 +1,100 @@ +import { + ST_HorizontalAlignment, + ST_VerticalAlignment +} from '../../../openxml/ExcelTypes'; +import {isValidURL} from '../../../util/isValidURL'; +import {FontStyle} from '../../types/FontStyle'; +import {LinkPosition} from './LinkPosition'; +import {measureTextWithCache} from './measureTextWithCache'; +import {genFontStr} from './genFontStr'; + +const debugFontBoundingBox = false; + +/** + * 绘制单行无样式文本 + * @param fontStyle + * @param text + * @param color + * @param x + * @param y + * @param width + * @param height + * @param intent 缩进 + * @param horizontal + * @param vertical + */ +export function drawSingleLineText( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + fontStyle: FontStyle, + text: string, + color: string, + x: number, + y: number, + width: number, + height: number, + intent: number, + horizontal: ST_HorizontalAlignment, + vertical: ST_VerticalAlignment, + linkPositionCache: LinkPosition[] = [] +) { + const font = genFontStr(fontStyle); + ctx.font = font; + ctx.fillStyle = color; + ctx.textBaseline = 'middle'; + let textWidth = 0; + let drawX = x + intent; + let textHeight = 0; + if (horizontal === 'right') { + const size = measureTextWithCache(ctx, font, text); + textWidth = size.width; + textHeight = size.height; + drawX = x + width - textWidth; + } + if (horizontal === 'center') { + const size = measureTextWithCache(ctx, font, text); + textWidth = size.width; + textHeight = size.height; + drawX = x + (width - textWidth) / 2; + } + // 默认按左对齐和垂直居中,这时计算很简单,直接居中绘制 + let drawY = y + height / 2; + + if (vertical === 'bottom') { + drawY = y + height; + ctx.textBaseline = 'bottom'; + } + if (vertical === 'top') { + drawY = y; + ctx.textBaseline = 'top'; + } + + ctx.fillText(text, drawX, drawY); + + if (debugFontBoundingBox) { + ctx.strokeStyle = '#ff0000'; + ctx.strokeRect(drawX, drawY, textWidth, textHeight); + } + + if (isValidURL(text)) { + const size = measureTextWithCache(ctx, font, text); + // 真实渲染位置 + let realY = drawY - size.height / 2; + if (vertical === 'bottom') { + realY = drawY - size.height; + } + if (vertical === 'top') { + realY = drawY; + } + linkPositionCache.push({ + url: text, + pos: [ + { + x: drawX, + y: realY, + width: size.width, + height: size.height + } + ] + }); + } +} diff --git a/packages/office-viewer/src/excel/render/cell/drawTextInCell.ts b/packages/office-viewer/src/excel/render/cell/drawTextInCell.ts new file mode 100644 index 000000000..2bcda554a --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/drawTextInCell.ts @@ -0,0 +1,192 @@ +import { + ST_HorizontalAlignment, + ST_VerticalAlignment +} from '../../../openxml/ExcelTypes'; +import {isValidURL} from '../../../util/isValidURL'; +import {Sheet} from '../../sheet/Sheet'; +import {CellInfo} from '../../types/CellInfo'; +import {IDataProvider} from '../../types/IDataProvider'; +import {IRElt} from '../../types/IRElt'; +import {ExcelRender} from '../ExcelRender'; +import {LinkPosition} from './LinkPosition'; +import {WrapLine, autoWrapText} from './autoWrapText'; +import {measureTextWithCache} from './measureTextWithCache'; +import {drawMultiLineText} from './drawMultiLineText'; +import {drawSingleLineRichText} from './drawSingleLineRichText'; +import {drawSingleLineText} from './drawSingleLineText'; +import {genFontStr} from './genFontStr'; + +const NUMBER_RE = /^-?[\d\.]+$/; + +/** + * 绘制单元格里的文字 + * @param cellInfo + * @param x + * @param y + * @param width 单元格宽度 + * @param height 单元格高度 + * @param padding 内边距 + */ +export function drawTextInCell( + excelRender: ExcelRender, + sheet: Sheet, + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + dataProvider: IDataProvider, + cellInfo: CellInfo, + x: number, + y: number, + width: number, + height: number, + indentSize: number, + padding: number, + linkPositionCache: LinkPosition[] = [] +) { + if ( + cellInfo.cellData && + typeof cellInfo.cellData === 'object' && + cellInfo.cellData.type === 'blank' + ) { + return; + } + + let wrapText = false; + let horizontal: ST_HorizontalAlignment = 'left'; + + // 数字默认右对齐 + if (typeof cellInfo.cellData === 'string') { + if (NUMBER_RE.test(cellInfo.cellData)) { + horizontal = 'right'; + } + } + + // 默认值其实是 bottom + let vertical: ST_VerticalAlignment = 'bottom'; + + const alignment = cellInfo.alignment; + + // 缩进 + let indent = 0; + + let displayWidth = width - padding * 2; + + const fontStyle = dataProvider.getFontStyle(cellInfo.font); + + if (alignment) { + if (alignment.wrapText) { + wrapText = true; + } + if (alignment.horizontal) { + horizontal = alignment.horizontal; + } + if (alignment.vertical) { + vertical = alignment.vertical; + } + if (alignment.indent) { + indent = alignment.indent; + } + if (alignment.textRotation) { + // 按文档里说最大值只有 180,目前是基于 wrapText 和限制 width 实现的 + if (alignment.textRotation === 255) { + wrapText = true; + const defaultFont = genFontStr(fontStyle); + const defaultFontSize = measureTextWithCache(ctx, defaultFont, '1'); + // 这个保证会拆分 + displayWidth = defaultFontSize.width; + } + } + } + + // 限制一下,后面得可配 + if (indent > 5) { + indent = 5; + } + + // fill 或 wrap 都可能需要截断 + const needClip = cellInfo.needClip || horizontal === 'fill' || wrapText; + + if (needClip) { + ctx.save(); + ctx.rect(x, y, width, height); + ctx.clip(); + } + + // 有多行文本的时候 Excel 会自动设置 wrapText 为 true + if (wrapText) { + let lines: WrapLine[] = []; + if (cellInfo.text) { + lines = autoWrapText(ctx, cellInfo.text, displayWidth, fontStyle); + } else if ( + typeof cellInfo.cellData === 'object' && + 'richText' in cellInfo.cellData + ) { + lines = autoWrapText( + ctx, + cellInfo.cellData.richText as IRElt[], + displayWidth, + fontStyle + ); + } else { + console.warn('unknown cell data', cellInfo); + } + + drawMultiLineText( + excelRender, + sheet, + ctx, + dataProvider, + fontStyle, + lines, + x + padding, + y + padding, + displayWidth, + height - padding * 2, + padding, + horizontal, + vertical, + cellInfo.text, + cellInfo.row, + linkPositionCache + ); + } else { + // 为了提升性能这个单独实现,因为是最常见的情况 + if (cellInfo.text) { + drawSingleLineText( + ctx, + fontStyle, + cellInfo.text, + fontStyle.color, + x + padding, + y + padding, + displayWidth, + height - padding * 2, + indent * indentSize, + horizontal, + vertical, + linkPositionCache + ); + } else if ( + typeof cellInfo.cellData === 'object' && + 'richText' in cellInfo.cellData + ) { + drawSingleLineRichText( + excelRender, + sheet, + ctx, + dataProvider, + fontStyle, + cellInfo.cellData.richText as IRElt[], + x + padding, + y + padding, + displayWidth, + height - padding * 2, + horizontal, + vertical, + cellInfo.row + ); + } + } + + if (needClip) { + ctx.restore(); + } +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/drawFrozen.ts b/packages/office-viewer/src/excel/render/cell/frozen/drawFrozen.ts new file mode 100644 index 000000000..ba3b5506f --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/drawFrozen.ts @@ -0,0 +1,95 @@ +import {ExcelRenderOptions} from '../../../sheet/ExcelRenderOptions'; +import {Sheet} from '../../../sheet/Sheet'; +import {SheetCanvas} from '../../SheetCanvas'; +import {IDataProvider} from '../../../types/IDataProvider'; +import {drawTopFrozen} from './drawTopFrozen'; +import {drawLeftFrozen} from './drawLeftFrozen'; +import {drawTopLeftFrozen} from './drawTopLeftFrozen'; +import {LinkPosition} from '../LinkPosition'; +import {ExcelRender} from '../../ExcelRender'; +import {ViewRange} from '../../../sheet/ViewRange'; + +export type FrozenViewRange = { + topViewRange: ViewRange | null; + leftViewRange: ViewRange | null; + topLeftViewRange: ViewRange | null; +}; + +/** + * 绘制冻结的行和列 + * @return 绘制区域的信息 + */ +export function drawFrozen( + excelRender: ExcelRender, + currentSheet: Sheet, + dataProvider: IDataProvider, + excelRenderOptions: ExcelRenderOptions, + mainCanvas: SheetCanvas, + height: number, + width: number, + linkPositionCache: LinkPosition[] +): FrozenViewRange { + let xSplit = 0; + let ySplit = 0; + let topViewRange: ViewRange | null = null; + let leftViewRange: ViewRange | null = null; + let topLeftViewRange: ViewRange | null = null; + + const currentSheetView = currentSheet.getCurrentSheetView(); + // 目前先只支持 top-left 这两种方式 + if (currentSheetView?.pane) { + const pane = currentSheetView?.pane; + if (pane.xSplit) { + xSplit = pane.xSplit; + } + if (pane.ySplit) { + ySplit = pane.ySplit; + } + } + + if (xSplit > 0 && ySplit > 0) { + const rangeResult = drawTopLeftFrozen( + excelRender, + xSplit, + ySplit, + currentSheet, + dataProvider, + excelRenderOptions, + mainCanvas, + height, + width, + linkPositionCache + ); + topViewRange = rangeResult.topViewRange; + leftViewRange = rangeResult.leftViewRange; + topLeftViewRange = rangeResult.topLeftViewRange; + } else if (ySplit > 0) { + topViewRange = drawTopFrozen( + excelRender, + ySplit, + currentSheet, + dataProvider, + excelRenderOptions, + mainCanvas, + width, + linkPositionCache + ); + } else if (xSplit > 0) { + leftViewRange = drawLeftFrozen( + excelRender, + xSplit, + currentSheet, + dataProvider, + excelRenderOptions, + mainCanvas, + height, + linkPositionCache + ); + } + + return { + topViewRange, + leftViewRange, + topLeftViewRange + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/drawLeftFrozen.ts b/packages/office-viewer/src/excel/render/cell/frozen/drawLeftFrozen.ts new file mode 100644 index 000000000..d34c10c3e --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/drawLeftFrozen.ts @@ -0,0 +1,79 @@ +import {ExcelRenderOptions} from '../../../sheet/ExcelRenderOptions'; +import {Sheet} from '../../../sheet/Sheet'; +import {SheetCanvas} from '../../SheetCanvas'; +import {drawGridLines} from '../../grid/drawGridLines'; +import {drawCells} from '../drawCells'; +import {drawRowColHeaders} from '../../header/drawRowColHeaders'; +import {IDataProvider} from '../../../types/IDataProvider'; +import {LinkPosition} from '../LinkPosition'; +import {ExcelRender} from '../../ExcelRender'; + +/** + * 绘制只有左边冻结的情况 + */ +export function drawLeftFrozen( + excelRender: ExcelRender, + xSplit: number, + currentSheet: Sheet, + dataProvider: IDataProvider, + excelRenderOptions: ExcelRenderOptions, + mainCanvas: SheetCanvas, + height: number, + linkPositionCache: LinkPosition[] +) { + const frozenViewRange = currentSheet.getFrozenLeftViewPointRange( + xSplit, + height + ); + + // 获取可视区域内的信息 + const displayData = currentSheet.getViewPointData(frozenViewRange); + + mainCanvas.drawRect( + 0, + 0, + frozenViewRange.width, + frozenViewRange.height, + excelRenderOptions.cellBackgroundColor + ); + + drawCells( + excelRender, + currentSheet, + excelRenderOptions, + mainCanvas, + displayData, + linkPositionCache + ); + + drawGridLines( + currentSheet, + frozenViewRange, + mainCanvas, + frozenViewRange.height, + frozenViewRange.width, + excelRenderOptions + ); + + drawRowColHeaders( + currentSheet, + frozenViewRange, + mainCanvas, + excelRenderOptions, + dataProvider.getDefaultFontSize(), + dataProvider.getDefaultFontStyle() + ); + + // 绘制冻结分割线 + mainCanvas.drawLine( + { + x1: frozenViewRange.width, + y1: 0, + x2: frozenViewRange.width, + y2: frozenViewRange.height + }, + excelRenderOptions.frozenLineColor + ); + + return frozenViewRange; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/drawTopFrozen.ts b/packages/office-viewer/src/excel/render/cell/frozen/drawTopFrozen.ts new file mode 100644 index 000000000..2bf3c7bdc --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/drawTopFrozen.ts @@ -0,0 +1,79 @@ +import {ExcelRenderOptions} from '../../../sheet/ExcelRenderOptions'; +import {Sheet} from '../../../sheet/Sheet'; +import {SheetCanvas} from '../../SheetCanvas'; +import {drawGridLines} from '../../grid/drawGridLines'; +import {drawCells} from '../drawCells'; +import {drawRowColHeaders} from '../../header/drawRowColHeaders'; +import {IDataProvider} from '../../../types/IDataProvider'; +import {LinkPosition} from '../LinkPosition'; +import {ExcelRender} from '../../ExcelRender'; + +/** + * 绘制只有上边冻结的情况 + */ +export function drawTopFrozen( + excelRender: ExcelRender, + ySplit: number, + currentSheet: Sheet, + dataProvider: IDataProvider, + excelRenderOptions: ExcelRenderOptions, + mainCanvas: SheetCanvas, + width: number, + linkPositionCache: LinkPosition[] +) { + const frozenViewRange = currentSheet.getFrozenTopViewPointRange( + ySplit, + width + ); + + // 获取可视区域内的信息 + const displayData = currentSheet.getViewPointData(frozenViewRange); + + mainCanvas.drawRect( + 0, + 0, + frozenViewRange.width, + frozenViewRange.height, + excelRenderOptions.cellBackgroundColor + ); + + drawCells( + excelRender, + currentSheet, + excelRenderOptions, + mainCanvas, + displayData, + linkPositionCache + ); + + drawGridLines( + currentSheet, + frozenViewRange, + mainCanvas, + frozenViewRange.height, + frozenViewRange.width, + excelRenderOptions + ); + + drawRowColHeaders( + currentSheet, + frozenViewRange, + mainCanvas, + excelRenderOptions, + dataProvider.getDefaultFontSize(), + dataProvider.getDefaultFontStyle() + ); + + // 绘制冻结分割线 + mainCanvas.drawLine( + { + x1: 0, + y1: frozenViewRange.height, + x2: frozenViewRange.width, + y2: frozenViewRange.height + }, + excelRenderOptions.frozenLineColor + ); + + return frozenViewRange; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/drawTopLeftFrozen.ts b/packages/office-viewer/src/excel/render/cell/frozen/drawTopLeftFrozen.ts new file mode 100644 index 000000000..03a6a191b --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/drawTopLeftFrozen.ts @@ -0,0 +1,122 @@ +import {ExcelRenderOptions} from '../../../sheet/ExcelRenderOptions'; +import {Sheet} from '../../../sheet/Sheet'; +import {SheetCanvas} from '../../SheetCanvas'; +import {drawGridLines} from '../../grid/drawGridLines'; +import {drawCells} from '../drawCells'; +import {drawRowColHeaders} from '../../header/drawRowColHeaders'; +import {IDataProvider} from '../../../types/IDataProvider'; +import {drawTopFrozen} from './drawTopFrozen'; +import {drawLeftFrozen} from './drawLeftFrozen'; +import {LinkPosition} from '../LinkPosition'; +import {ExcelRender} from '../../ExcelRender'; + +/** + * 绘制同时有左边和上边冻结的情况,需要绘制 3 个独立区域 + */ +export function drawTopLeftFrozen( + excelRender: ExcelRender, + xSplit: number, + ySplit: number, + currentSheet: Sheet, + dataProvider: IDataProvider, + excelRenderOptions: ExcelRenderOptions, + mainCanvas: SheetCanvas, + height: number, + width: number, + linkPositionCache: LinkPosition[] +) { + // 先单独绘制左边和上边的区域 + const topViewRange = drawTopFrozen( + excelRender, + ySplit, + currentSheet, + dataProvider, + excelRenderOptions, + mainCanvas, + width, + linkPositionCache + ); + const leftViewRange = drawLeftFrozen( + excelRender, + xSplit, + currentSheet, + dataProvider, + excelRenderOptions, + mainCanvas, + height, + linkPositionCache + ); + // 绘制中间的区域 + const topLeftViewRange = currentSheet.getFrozenTopLeftViewPointRange( + xSplit, + ySplit + ); + + // 获取可视区域内的信息 + const displayData = currentSheet.getViewPointData(topLeftViewRange); + + // 清空区域 + mainCanvas.drawRect( + 0, + 0, + topLeftViewRange.width, + topLeftViewRange.height, + excelRenderOptions.cellBackgroundColor + ); + + // 绘制单元格 + drawCells( + excelRender, + currentSheet, + excelRenderOptions, + mainCanvas, + displayData, + linkPositionCache + ); + + // 绘制网格线 + drawGridLines( + currentSheet, + topLeftViewRange, + mainCanvas, + topLeftViewRange.height, + topLeftViewRange.width, + excelRenderOptions + ); + + // 绘制表头 + drawRowColHeaders( + currentSheet, + topLeftViewRange, + mainCanvas, + excelRenderOptions, + dataProvider.getDefaultFontSize(), + dataProvider.getDefaultFontStyle() + ); + + // 绘制上边和左边分割线 + mainCanvas.drawLine( + { + x1: 0, + y1: topViewRange.height, + x2: topLeftViewRange.width, + y2: topViewRange.height + }, + excelRenderOptions.frozenLineColor + ); + mainCanvas.drawLine( + { + x1: leftViewRange.width, + y1: 0, + x2: leftViewRange.width, + y2: topLeftViewRange.height + }, + excelRenderOptions.frozenLineColor + ); + + return { + topViewRange, + leftViewRange, + topLeftViewRange + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/getFrozenLeftViewPointRange.ts b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenLeftViewPointRange.ts new file mode 100644 index 000000000..fb5dd2470 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenLeftViewPointRange.ts @@ -0,0 +1,49 @@ +import {ViewRange} from '../../../sheet/ViewRange'; +import {IndexInfo, getRange} from '../../../sheet/getViewRange'; +import {getFrozenRange} from './getFrozenRange'; + +/** + * 获取左边冻结的范围 + * @param xSplit + * @param height + * @param scrollTop + * @param getRowHeight + * @param getColWidth + * @param rowPositionCache + * @param rowHiddenRange + * @returns + */ + +export function getFrozenLeftViewPointRange( + xSplit: number, + height: number, + scrollTop: number, + leftShift: number, + topShift: number, + getRowHeight: (index: number) => number, + getColWidth: (index: number) => number, + rowPositionCache: IndexInfo[] = [] +): ViewRange { + const { + indexes: rows, + startOffset: startRowOffset, + sizes: rowSizes + } = getRange(scrollTop, topShift, height, getRowHeight, [], rowPositionCache); + const { + indexes: cols, + startOffset: startColOffset, + sizes: colSizes, + length: width + } = getFrozenRange(xSplit, leftShift, getColWidth); + return { + region: 'left-frozen', + rows, + rowSizes, + height, + startRowOffset, + cols, + colSizes, + width, + startColOffset + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/getFrozenRange.ts b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenRange.ts new file mode 100644 index 000000000..bb16ff3ac --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenRange.ts @@ -0,0 +1,31 @@ +import {Size} from '../../../sheet/ViewRange'; +import {RangeInfo} from '../../../sheet/getViewRange'; + +/** + * 获取冻结区域的数据范围 + */ + +export function getFrozenRange( + split: number, + shift: number, + getSize: (index: number) => number +): RangeInfo { + const indexes: number[] = []; + let startOffset = 0; + let sizes: Size[] = []; + for (let i = 0; i < split; i++) { + indexes.push(i); + const size = getSize(i); + sizes.push({ + size: size, + offset: startOffset + shift + }); + startOffset += size; + } + return { + indexes, + sizes, + startOffset: 0, + length: startOffset + shift + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.ts b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.ts new file mode 100644 index 000000000..cf3350386 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.ts @@ -0,0 +1,41 @@ +import {ViewRange} from '../../../sheet/ViewRange'; +import {getFrozenRange} from './getFrozenRange'; + +/** + * 获取左上角冻结区域的访问 + */ + +export function getFrozenTopLeftViewPointRange( + xSplit: number, + ySplit: number, + leftShift: number, + topShift: number, + getRowHeight: (index: number) => number, + getColWidth: (index: number) => number +): ViewRange { + const { + indexes: rows, + startOffset: startRowOffset, + sizes: rowSizes, + length: height + } = getFrozenRange(ySplit, topShift, getRowHeight); + + const { + indexes: cols, + startOffset: startColOffset, + sizes: colSizes, + length: width + } = getFrozenRange(xSplit, leftShift, getColWidth); + + return { + region: 'top-left-frozen', + rows, + rowSizes, + height, + startRowOffset, + cols, + colSizes, + width, + startColOffset + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/frozen/getFrozenTopViewPointRange.ts b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenTopViewPointRange.ts new file mode 100644 index 000000000..9eacfcff5 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/frozen/getFrozenTopViewPointRange.ts @@ -0,0 +1,60 @@ +import {ViewRange} from '../../../sheet/ViewRange'; +import {HiddenRange, IndexInfo, getRange} from '../../../sheet/getViewRange'; + +import {getFrozenRange} from './getFrozenRange'; + +/** + * 获取顶部冻结的范围 + * @param ySplit + * @param width + * @param scrollLeft + * @param getRowHeight + * @param getColWidth + * @param colPositionCache + * @param colHiddenRange + * @returns + */ + +export function getFrozenTopViewPointRange( + ySplit: number, + width: number, + scrollLeft: number, + leftShift: number, + topShift: number, + getRowHeight: (index: number) => number, + getColWidth: (index: number) => number, + colPositionCache: IndexInfo[] = [], + colHiddenRange: HiddenRange[] = [] +): ViewRange { + const { + indexes: cols, + startOffset: startColOffset, + sizes: colSizes + } = getRange( + scrollLeft, + leftShift, + width, + getColWidth, + colHiddenRange, + colPositionCache + ); + + const { + indexes: rows, + startOffset: startRowOffset, + sizes: rowSizes, + length: height + } = getFrozenRange(ySplit, topShift, getRowHeight); + + return { + region: 'top-frozen', + rows, + rowSizes, + height, + startRowOffset, + cols, + colSizes, + width, + startColOffset + }; +} diff --git a/packages/office-viewer/src/excel/render/cell/genFontStr.ts b/packages/office-viewer/src/excel/render/cell/genFontStr.ts new file mode 100644 index 000000000..7a6cc1a5f --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/genFontStr.ts @@ -0,0 +1,71 @@ +import {FontStyle} from '../../types/FontStyle'; +import {IRPrElt} from '../../types/IRPrElt'; +import {checkFont} from './checkFont'; + +/** + * 生成字体字符串 + * @param fontStyle + */ +export function genFontStr(fontStyle: FontStyle): string { + let font = ''; + let family = fontStyle.family; + + checkFont(family); + + if (fontStyle.b) { + font += 'bold '; + } + if (fontStyle.i) { + font += 'italic '; + } + + // TODO: underline 等需要自己绘制 + + // 字体字体大小需要放在后面? + if (fontStyle.size) { + font += `${fontStyle.size * 1.333}px `; + } + + font += family; + return font; +} + +/** + * rPr 转换为字体样式 + */ +export function rPrToFontStyle(rPr: IRPrElt) { + let fontStyle: Partial = {}; + if (rPr.b) { + fontStyle.b = true; + } + if (rPr.i) { + fontStyle.i = true; + } + if (rPr.sz) { + fontStyle.size = rPr.sz; + } + if (rPr.rFont) { + fontStyle.family = rPr.rFont; + } + return fontStyle; +} + +/** + * 合并 rPr 和默认字体 + */ +export function mergeRPrWithDefaultFont(rPr: IRPrElt, defaultFont: FontStyle) { + const fontStyle = rPrToFontStyle(rPr); + return { + ...defaultFont, + ...fontStyle + }; +} + +/** + * 基于 rPr 生成字体字符串 + * @param defaultFont 默认字体样式 + */ +export function genFontStrFromRPr(rPr: IRPrElt, defaultFont: FontStyle) { + // 其实不知道是不是要合并默认字体 + return genFontStr(mergeRPrWithDefaultFont(rPr, defaultFont)); +} diff --git a/packages/office-viewer/src/excel/render/cell/getBackgroundColor.ts b/packages/office-viewer/src/excel/render/cell/getBackgroundColor.ts new file mode 100644 index 000000000..635cac642 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/getBackgroundColor.ts @@ -0,0 +1,55 @@ +import {CT_Fill} from '../../../openxml/ExcelTypes'; +import {IDataProvider} from '../../types/IDataProvider'; + +export function getBackgroundColor( + dataProvider: IDataProvider, + fill?: CT_Fill +) { + if (fill) { + const patternFill = fill.patternFill; + if (patternFill) { + const patternType = patternFill.patternType; + + // TODO: 很多不支持,比如 darkHorizontal,实现成本有点高 + switch (patternType) { + case 'solid': + const fgColor = patternFill.fgColor; + if (fgColor) { + return dataProvider.getColor(fgColor); + } + break; + + // 这些颜色主要是 copilot 生成的,没验证过 + case 'mediumGray': + return '#808080'; + + case 'darkGray': + return '#A9A9A9'; + + case 'lightGray': + return '#D3D3D3'; + + case 'gray125': + return '#E0E0E0'; + + case 'gray0625': + return '#F2F2F2'; + + case 'none': + return 'none'; + + default: + break; + } + + if (patternFill.bgColor) { + return dataProvider.getColor(patternFill.bgColor); + } + } + // TODO: 还未支持 + const gradientFill = fill.gradientFill; + if (gradientFill) { + } + } + return 'none'; +} diff --git a/packages/office-viewer/src/excel/render/cell/isPointerOnLink.ts b/packages/office-viewer/src/excel/render/cell/isPointerOnLink.ts new file mode 100644 index 000000000..6f68fb722 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/isPointerOnLink.ts @@ -0,0 +1,21 @@ +import {pointInRect} from '../Rect'; +import {LinkPosition} from './LinkPosition'; + +/** + * 判断当前指针是否在链接上 + */ +export function isPointerOnLink( + x: number, + y: number, + linkPositionCache: LinkPosition[] +) { + for (const linkPosition of linkPositionCache) { + for (const pos of linkPosition.pos) { + if (pointInRect(x, y, pos)) { + return linkPosition.url; + } + } + } + + return false; +} diff --git a/packages/office-viewer/src/excel/render/cell/measureTextWithCache.ts b/packages/office-viewer/src/excel/render/cell/measureTextWithCache.ts new file mode 100644 index 000000000..f946398d5 --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/measureTextWithCache.ts @@ -0,0 +1,56 @@ +/** + * 缓存文本大小,避免重复计算 + */ +const textSizeCache: Map = new Map(); + +export interface TextSize { + /** + * 文本宽度,目前主要用这个 + */ + width: number; + /** + * 实际宽度,这个在斜体的时候比 width 长,文本为数字的时候又比 width 短 + */ + boundingWidth: number; + /** + * 文本高度 + */ + height: number; + /** + * 字体高度 + */ + fontHeight: number; +} +/** + * 测量字体大小,这个会计算最终真实大小及字体大小,带缓存,需要自己 save state + */ + +export function measureTextWithCache( + ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, + font: string, + text: string +): TextSize { + const key = `${font}---${text}`; + if (textSizeCache.has(key)) { + return textSizeCache.get(key)!; + } + ctx.font = font; + const measureSize = ctx.measureText(text); + const size = { + width: measureSize.width, + boundingWidth: + Math.abs(measureSize.actualBoundingBoxRight) + + Math.abs(measureSize.actualBoundingBoxLeft), + height: + measureSize.actualBoundingBoxAscent + + measureSize.actualBoundingBoxDescent, + fontHeight: + measureSize.fontBoundingBoxAscent + measureSize.fontBoundingBoxDescent + }; + textSizeCache.set(key, size); + return size; +} + +export function inValidTextSizeCache() { + textSizeCache.clear(); +} diff --git a/packages/office-viewer/src/excel/render/cell/tokenizer.ts b/packages/office-viewer/src/excel/render/cell/tokenizer.ts new file mode 100644 index 000000000..fc4120e8b --- /dev/null +++ b/packages/office-viewer/src/excel/render/cell/tokenizer.ts @@ -0,0 +1,99 @@ +import {stringToArray} from '../../../util/stringToArray'; +import {IRPrElt} from '../../types/IRPrElt'; + +export interface Token { + /** + * 类型,w 代表单词或汉字,h 代表连字符,s 代表空格,br 代表换行 + */ + type: 'w' | 'h' | 's' | 'br'; + /** + * 文本样式 + */ + rPr?: IRPrElt; + /** + * 文本 + */ + t: string; + + /** + * 字符宽度,这个宽度需要在后面确定 + */ + w?: number; +} + +// 需要合并的字符,也就是当成一个 token,主要是英文单词和数字,后面几个是拉丁语,虽然不知道是不是对的 +// 可能还有其它语言的情况,知道了再加 +const wordReg = /['a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]/; +// 连字符,如果遇到可以折行 +const hyphenReg = /[\u002D\u2010\u2010\u2014]/; +const spaceReg = /\s/; +const lineBreakReg = /\n/; + +/** + * 将文本拆分为 token,主要是保证英文单词不被截断 + * @param text + */ +export function tokenizer(text: string) { + if (!text) { + return []; + } + // 这里不能用 split,避免表情符号被分开 + const chars = stringToArray(text.replace(/\r\n?/g, '\n')); + const tokens: Token[] = []; + let currentWord = ''; + function saveWord() { + if (currentWord) { + tokens.push({ + type: 'w', + t: currentWord + }); + currentWord = ''; + } + } + for (const char of chars) { + if (wordReg.test(char)) { + currentWord += char; + // 换行要放前面,因为后面的 space 会包含换行 + } else if (lineBreakReg.test(char)) { + if (currentWord) { + saveWord(); + } + tokens.push({ + type: 'br', + t: char + }); + } else if (spaceReg.test(char)) { + if (currentWord) { + saveWord(); + } + tokens.push({ + type: 's', + t: char + }); + } else if (hyphenReg.test(char)) { + if (currentWord) { + saveWord(); + } + tokens.push({ + type: 'h', + t: char + }); + } else { + if (currentWord) { + saveWord(); + } + tokens.push({ + type: 'w', + t: char + }); + } + } + if (currentWord) { + tokens.push({ + type: 'w', + t: currentWord + }); + } + + return tokens; +} diff --git a/packages/office-viewer/src/excel/render/dnd/DragState.ts b/packages/office-viewer/src/excel/render/dnd/DragState.ts new file mode 100644 index 000000000..c5be93910 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/DragState.ts @@ -0,0 +1,26 @@ +import type {Workbook} from '../../Workbook'; +import {Region} from '../../sheet/ViewRange'; +import {SheetSelection} from '../selection/SheetSelection'; +import {HitTestResult} from '../selection/hitTest'; + +export interface DragState { + workbook?: Workbook; + container?: HTMLElement; + isDragging: boolean; + // 拖拽开始的位置,使用相对于 Page 的位置 + dragStart: { + pageX: number; + pageY: number; + offsetX: number; + offsetY: number; + }; + // 行和列,主要是用于在 header 拖拽 + row: number; + col: number; + // 临时行高和列宽,用于拖拽时的临时结果 + tmpRowHeight: number; + tmpColWidth: number; + dragType: HitTestResult['type']; + region: Region; + selection?: SheetSelection; +} diff --git a/packages/office-viewer/src/excel/render/dnd/getMouseRelativePosition.ts b/packages/office-viewer/src/excel/render/dnd/getMouseRelativePosition.ts new file mode 100644 index 000000000..1859ee304 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/getMouseRelativePosition.ts @@ -0,0 +1,12 @@ +/** + * 获取鼠标移动时相对于容器的位置 + */ +export function getMouseRelativePosition( + container: HTMLElement, + event: MouseEvent +) { + const dataContainerOffset = container.getBoundingClientRect(); + const offsetX = event.clientX - dataContainerOffset.x; + const offsetY = event.clientY - dataContainerOffset.y; + return {offsetX, offsetY}; +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleDragCell.ts b/packages/office-viewer/src/excel/render/dnd/handleDragCell.ts new file mode 100644 index 000000000..0f3cc0a3b --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleDragCell.ts @@ -0,0 +1,90 @@ +import {objectEqual} from '../../../util/objectEqual'; +import {mergeRange} from '../../io/excel/util/Range'; +import {RangeRef} from '../../types/RangeRef'; +import {cellToMergeCell} from '../cell/cellToMergeCell'; +import {dragState} from './handleMousedown'; + +/** + * 判断某个单元格是否在合并单元格内,如果在就扩展选区 + */ +function mergeWithNewCell( + range: RangeRef, + mergeCells: RangeRef[], + row: number, + col: number +) { + const mergeCell = cellToMergeCell(row, col, mergeCells); + return mergeRange(range, mergeCell); +} + +/** + * 判断边缘是否接触到了合并单元格,如果接触到了就扩展选区 + */ +function mergeWithAllBorder(range: RangeRef, mergeCells: RangeRef[]): RangeRef { + let newRange = {...range}; + // 上边 + for (let i = newRange.startCol; i <= newRange.endCol; i++) { + newRange = mergeWithNewCell(newRange, mergeCells, newRange.startRow, i); + } + // 下边 + for (let i = newRange.startCol; i <= newRange.endCol; i++) { + newRange = mergeWithNewCell(newRange, mergeCells, newRange.endRow, i); + } + // 左边 + for (let i = newRange.startRow; i <= newRange.endRow; i++) { + newRange = mergeWithNewCell(newRange, mergeCells, i, newRange.startCol); + } + // 右边 + for (let i = newRange.startRow; i <= newRange.endRow; i++) { + newRange = mergeWithNewCell(newRange, mergeCells, i, newRange.endCol); + } + + // 如果选区变化就需要遍历再执行一次,因为扩展选区后可能又触碰到了另一个合并单元格 + if (!objectEqual(newRange, range)) { + return mergeWithAllBorder(newRange, mergeCells); + } + return newRange; +} + +/** + * 处理拖拽单元格扩展选区 + */ +export function handleDragCell(offsetX: number, offsetY: number) { + // 没有 selection 的情况不大可能,但避免出错 + if (!dragState.selection) { + console.warn('没有 selection'); + return; + } + + if (dragState.selection.cellRanges.length === 0) { + console.warn('没有 cellRanges'); + return; + } + + // 后续要支持多选得改这里 + const firstCellRange = dragState.selection.cellRanges[0]; + + // 如果超出当前单元格,需要做 hitTest,判断是否在其他单元格内 + const hitTestResult = dragState.workbook + ?.getActiveSheet() + .hitTest(offsetX, offsetY); + + // 目前只支持在相同类型的单元格内拖拽 + if (hitTestResult && hitTestResult.type === dragState.dragType) { + const mergeCells = + dragState.workbook?.getActiveSheet().getMergeCells() || []; + + // 如果在选区范围内 + let newRange = mergeRange(dragState.selection.activeCell, hitTestResult); + + if (mergeCells.length) { + // 选区扩展过程中可能某个边触碰到另一个合并单元格了,需要遍历四个边来判断 + newRange = mergeWithAllBorder(newRange, mergeCells); + } + + if (!objectEqual(newRange, firstCellRange)) { + Object.assign(firstCellRange, newRange); + dragState.workbook?.uiEvent.emit('CHANGE_SELECTION', dragState.selection); + } + } +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleDragColGrid.ts b/packages/office-viewer/src/excel/render/dnd/handleDragColGrid.ts new file mode 100644 index 000000000..b9286d9e3 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleDragColGrid.ts @@ -0,0 +1,27 @@ +import {getCellColPosition} from '../selection/getCellPosition'; +import {dragState} from './handleMousedown'; + +/** + * 处理拖拽网格线,调整列宽 + */ +export function handleDragColGrid(mouseEvent: MouseEvent) { + const {pageX} = mouseEvent; + const shiftX = pageX - dragState.dragStart.pageX; + const workbook = dragState.workbook!; + const sheet = workbook.getActiveSheet(); + const colPosition = getCellColPosition( + sheet, + dragState.region, + dragState.col + ); + if (colPosition) { + // 拖拽的网格线是在右边 + const startX = colPosition.x + colPosition.width; + // 不可以拖动超过当前列的位置,这样就变成负值了 + let lineX = Math.max(colPosition.x, startX + shiftX); + + dragState.tmpColWidth = Math.max(0, lineX - colPosition.x); + + workbook.uiEvent.emit('DRAG_COL_GRID_LINE', lineX); + } +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleDragColHeader.ts b/packages/office-viewer/src/excel/render/dnd/handleDragColHeader.ts new file mode 100644 index 000000000..39e6f1cf8 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleDragColHeader.ts @@ -0,0 +1,57 @@ +import {MAX_ROW} from '../Consts'; +import {dragState} from './handleMousedown'; +/** + * 处理拖拽列表头扩展选区 + */ +export function handleDragColHeader(offsetX: number, offsetY: number) { + if (!dragState.selection) { + console.warn('没有 selection'); + return; + } + + // 做 hitTest,判断是否拖到了其它列表头 + const hitTestResult = dragState.workbook + ?.getActiveSheet() + .hitTest(offsetX, offsetY); + + const col = dragState.selection.activeCell.startCol; + + // 后续要支持多选得改这里 + const firstCellRange = dragState.selection.cellRanges[0]; + + if (hitTestResult) { + // 还不支持跨区域拖拽 + if (hitTestResult.region !== dragState.region) { + console.warn('不支持跨区域拖拽'); + return; + } + // 说明移动到别的列了 + if (hitTestResult.startCol !== col) { + const startCol = Math.min(col, hitTestResult.startCol); + const endCol = Math.max(col, hitTestResult.startCol); + if ( + startCol === firstCellRange.startCol && + endCol === firstCellRange.endCol + ) { + return; + } + firstCellRange.startCol = startCol; + firstCellRange.endCol = endCol; + firstCellRange.startRow = 0; + firstCellRange.endRow = MAX_ROW; + dragState.workbook?.uiEvent.emit('CHANGE_SELECTION', dragState.selection); + } else { + // 如果在当前列移动,需要判断和现有选区是否有变化 + if (firstCellRange.startCol !== firstCellRange.endCol) { + firstCellRange.startCol = col; + firstCellRange.endCol = col; + firstCellRange.startRow = 0; + firstCellRange.endRow = MAX_ROW; + dragState.workbook?.uiEvent.emit( + 'CHANGE_SELECTION', + dragState.selection + ); + } + } + } +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleDragRowGrid.ts b/packages/office-viewer/src/excel/render/dnd/handleDragRowGrid.ts new file mode 100644 index 000000000..6667ba245 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleDragRowGrid.ts @@ -0,0 +1,27 @@ +import {getCellRowPosition} from '../selection/getCellPosition'; +import {dragState} from './handleMousedown'; + +/** + * 处理拖拽网格线,调整行高 + */ +export function handleDragRowGrid(mouseEvent: MouseEvent) { + const {pageY} = mouseEvent; + const shiftY = pageY - dragState.dragStart.pageY; + const workbook = dragState.workbook!; + const sheet = workbook.getActiveSheet(); + const rowPosition = getCellRowPosition( + sheet, + dragState.region, + dragState.row + ); + if (rowPosition) { + // 拖拽的网格线是在底部 + const startY = rowPosition.y + rowPosition.height; + // 不可以拖动超过当前行的位置,这样就变成负值了 + let lineY = Math.max(rowPosition.y, startY + shiftY); + + dragState.tmpRowHeight = Math.max(0, lineY - rowPosition.y); + + workbook.uiEvent.emit('DRAG_ROW_GRID_LINE', lineY); + } +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleDragRowHeader.ts b/packages/office-viewer/src/excel/render/dnd/handleDragRowHeader.ts new file mode 100644 index 000000000..453ebe43c --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleDragRowHeader.ts @@ -0,0 +1,57 @@ +import {MAX_COL} from '../Consts'; +import {dragState} from './handleMousedown'; +/** + * 处理拖拽行表头扩展选区 + */ + +export function handleDragRowHeader(offsetX: number, offsetY: number) { + // 没有 selection 的情况不大可能,但避免出错 + if (!dragState.selection) { + console.warn('没有 selection'); + return; + } + // 做 hitTest,判断是否拖到了其它行表头 + const hitTestResult = dragState.workbook + ?.getActiveSheet() + .hitTest(offsetX, offsetY); + + const row = dragState.selection.activeCell.startRow; + + // 后续要支持多选得改这里 + const firstCellRange = dragState.selection.cellRanges[0]; + + if (hitTestResult) { + // 还不支持跨区域拖拽 + if (hitTestResult.region !== dragState.region) { + console.warn('不支持跨区域拖拽'); + return; + } + // 说明移动到别的行了 + if (hitTestResult.startRow !== row) { + const startRow = Math.min(row, hitTestResult.startRow); + const endRow = Math.max(row, hitTestResult.startRow); + if ( + startRow === firstCellRange.startRow && + endRow === firstCellRange.endRow + ) { + return; + } + firstCellRange.startRow = startRow; + firstCellRange.endRow = endRow; + firstCellRange.startCol = 0; + firstCellRange.endCol = MAX_COL; + dragState.workbook?.uiEvent.emit('CHANGE_SELECTION', dragState.selection); + } else { + // 如果在当前行移动,需要判断和现有选区是否有变化 + if (firstCellRange.startRow !== firstCellRange.endRow) { + firstCellRange.endRow = firstCellRange.startRow; + firstCellRange.startCol = 0; + firstCellRange.endCol = MAX_COL; + dragState.workbook?.uiEvent.emit( + 'CHANGE_SELECTION', + dragState.selection + ); + } + } + } +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleMousedown.ts b/packages/office-viewer/src/excel/render/dnd/handleMousedown.ts new file mode 100644 index 000000000..4b28a1c34 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleMousedown.ts @@ -0,0 +1,92 @@ +/** + * 处理拖拽事件,包括单元格和表头部分 + */ + +import {Workbook} from '../../Workbook'; +import {SheetSelection} from '../selection/SheetSelection'; +import {HitTestResult} from '../selection/hitTest'; +import {DragState} from './DragState'; +import {handleMousemove} from './handleMousemove'; +import {handleMouseup} from './handleMouseup'; +import {mousedownColHeader} from './mousedownColHeader'; +import {mousedownCorner} from './mousedownCorner'; +import {mousedownRowHeader} from './mousedownRowHeader'; +import {mousedownCell} from './mousedownCell'; + +const DRAG_STATE_DEFAULT: DragState = { + isDragging: false, + dragStart: { + pageX: 0, + pageY: 0, + offsetX: 0, + offsetY: 0 + }, + row: 0, + col: 0, + tmpRowHeight: 0, + tmpColWidth: 0, + region: 'normal', + dragType: 'cell' +}; + +export const dragState: DragState = JSON.parse( + JSON.stringify(DRAG_STATE_DEFAULT) +); + +export function resetDragState() { + Object.assign(dragState, DRAG_STATE_DEFAULT); +} + +/** + * 鼠标按下事件 + */ +export function handleMousedown( + workbook: Workbook, + hitTestResult: HitTestResult, + container: HTMLElement, + mouseEvent: MouseEvent +) { + // 只处理左键 + if (mouseEvent.button !== 0) { + return; + } + let newSelection: SheetSelection | null = null; + if (hitTestResult.type === 'cell') { + newSelection = mousedownCell(workbook, hitTestResult); + } + if (hitTestResult.type === 'row-header') { + newSelection = mousedownRowHeader(workbook, hitTestResult); + } + if (hitTestResult.type === 'col-header') { + newSelection = mousedownColHeader(workbook, hitTestResult); + } + if (hitTestResult.type === 'corner') { + newSelection = mousedownCorner(workbook); + } + + const zoomLevel = workbook.getActiveSheet().getZoomLevel(); + + dragState.workbook = workbook; + dragState.container = container; + dragState.region = hitTestResult.region; + dragState.dragStart = { + pageX: mouseEvent.pageX, + pageY: mouseEvent.pageY, + offsetX: mouseEvent.offsetX / zoomLevel, + offsetY: mouseEvent.offsetY / zoomLevel + }; + dragState.row = hitTestResult.startRow; + dragState.col = hitTestResult.startCol; + + dragState.dragType = hitTestResult.type; + if (newSelection) { + dragState.selection = newSelection; + workbook.uiEvent.emit('CHANGE_SELECTION', newSelection); + } + + document.addEventListener('mousemove', handleMousemove, true); + document.addEventListener('touchmove', handleMousemove, true); + + document.addEventListener('mouseup', handleMouseup); + document.addEventListener('touchend', handleMouseup); +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleMousemove.ts b/packages/office-viewer/src/excel/render/dnd/handleMousemove.ts new file mode 100644 index 000000000..3780db5b7 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleMousemove.ts @@ -0,0 +1,47 @@ +import {getMouseRelativePosition} from './getMouseRelativePosition'; +import {handleDragCell} from './handleDragCell'; +import {handleDragColGrid} from './handleDragColGrid'; +import {handleDragColHeader} from './handleDragColHeader'; +import {handleDragRowGrid} from './handleDragRowGrid'; +import {handleDragRowHeader} from './handleDragRowHeader'; +import {dragState} from './handleMousedown'; + +/** + * 鼠标拖拽过程中 + */ +export function handleMousemove(mouseEvent: MouseEvent) { + dragState.isDragging = true; + + let {offsetX, offsetY} = getMouseRelativePosition( + dragState.container!, + mouseEvent + ); + const zoomLevel = dragState.workbook!.getActiveSheet().getZoomLevel(); + offsetX = offsetX / zoomLevel; + offsetY = offsetY / zoomLevel; + + offsetX = Math.round(offsetX); + offsetY = Math.round(offsetY); + + const dragType = dragState.dragType; + + if (dragType === 'cell') { + handleDragCell(offsetX, offsetY); + } + + if (dragType === 'row-grid') { + handleDragRowGrid(mouseEvent); + } + + if (dragType === 'col-grid') { + handleDragColGrid(mouseEvent); + } + + if (dragType === 'row-header') { + handleDragRowHeader(offsetX, offsetY); + } + + if (dragType === 'col-header') { + handleDragColHeader(offsetX, offsetY); + } +} diff --git a/packages/office-viewer/src/excel/render/dnd/handleMouseup.ts b/packages/office-viewer/src/excel/render/dnd/handleMouseup.ts new file mode 100644 index 000000000..e259402fc --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/handleMouseup.ts @@ -0,0 +1,24 @@ +import {removeEventListener} from './removeEventListener'; +import {dragState, resetDragState} from './handleMousedown'; + +export function handleMouseup() { + dragState.isDragging = false; + removeEventListener(); + + if (dragState.dragType === 'col-grid') { + dragState.workbook?.uiEvent.emit( + 'DRAG_COL_GRID_LINE_END', + dragState.col, + dragState.tmpColWidth + ); + } + if (dragState.dragType === 'row-grid') { + dragState.workbook?.uiEvent.emit( + 'DRAG_ROW_GRID_LINE_END', + dragState.row, + dragState.tmpRowHeight + ); + } + + resetDragState(); +} diff --git a/packages/office-viewer/src/excel/render/dnd/mousedownCell.ts b/packages/office-viewer/src/excel/render/dnd/mousedownCell.ts new file mode 100644 index 000000000..a161987c3 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/mousedownCell.ts @@ -0,0 +1,39 @@ +import type {Workbook} from '../../Workbook'; +import {RangeRef} from '../../types/RangeRef'; +import {SheetSelection} from '../selection/SheetSelection'; +import {HitTestResult} from '../selection/hitTest'; + +/** + * 根据点击的单元格生成选区 + * @param workbook + * @param hitTestResult + * @returns 新的选区 + */ +export function mousedownCell( + workbook: Workbook, + hitTestResult: HitTestResult +) { + const activeCell: RangeRef = { + startRow: hitTestResult.startRow, + startCol: hitTestResult.startCol, + endRow: hitTestResult.endRow, + endCol: hitTestResult.endCol + }; + + const newSelection: SheetSelection = { + // 当前用户名为空 + user: '', + region: hitTestResult.region, + selectType: hitTestResult.type, + activeCell, + sheetIndex: workbook.getActiveSheet().getIndex(), + // 初始 cellRanges 为当前单元格 + cellRanges: [ + { + ...activeCell + } + ] + }; + + return newSelection; +} diff --git a/packages/office-viewer/src/excel/render/dnd/mousedownColHeader.ts b/packages/office-viewer/src/excel/render/dnd/mousedownColHeader.ts new file mode 100644 index 000000000..b835f7565 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/mousedownColHeader.ts @@ -0,0 +1,36 @@ +import {Workbook} from '../../Workbook'; +import {RangeRef} from '../../types/RangeRef'; +import {MAX_ROW} from '../Consts'; +import {HitTestResult} from '../selection/hitTest'; + +/** + * 点击到列表头 + * @param workbook + * @param hitTestResult + * @returns + */ +export function mousedownColHeader( + workbook: Workbook, + hitTestResult: HitTestResult +) { + const activeCell: RangeRef = { + startRow: 0, + startCol: hitTestResult.startCol, + endRow: 0, + endCol: hitTestResult.endCol + }; + + return { + user: '', + region: hitTestResult.region, + selectType: hitTestResult.type, + activeCell, + sheetIndex: workbook.getActiveSheet().getIndex(), + cellRanges: [ + { + ...activeCell, + endRow: MAX_ROW + } + ] + }; +} diff --git a/packages/office-viewer/src/excel/render/dnd/mousedownCorner.ts b/packages/office-viewer/src/excel/render/dnd/mousedownCorner.ts new file mode 100644 index 000000000..030f04768 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/mousedownCorner.ts @@ -0,0 +1,12 @@ +import {Workbook} from '../../Workbook'; +import {selectAll} from './selectAll'; + +/** + * 点击到全选 + * @param workbook + * @param hitTestResult + * @returns + */ +export function mousedownCorner(workbook: Workbook) { + return selectAll(workbook.getActiveSheet().getIndex()); +} diff --git a/packages/office-viewer/src/excel/render/dnd/mousedownRowHeader.ts b/packages/office-viewer/src/excel/render/dnd/mousedownRowHeader.ts new file mode 100644 index 000000000..f4cee5394 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/mousedownRowHeader.ts @@ -0,0 +1,36 @@ +import {Workbook} from '../../Workbook'; +import {RangeRef} from '../../types/RangeRef'; +import {MAX_COL} from '../Consts'; +import {HitTestResult} from '../selection/hitTest'; + +/** + * 点击到行表头 + * @param workbook + * @param hitTestResult + * @returns + */ +export function mousedownRowHeader( + workbook: Workbook, + hitTestResult: HitTestResult +) { + const activeCell: RangeRef = { + startRow: hitTestResult.startRow, + startCol: 0, + endRow: hitTestResult.endRow, + endCol: 0 + }; + + return { + user: '', + region: hitTestResult.region, + selectType: hitTestResult.type, + activeCell, + sheetIndex: workbook.getActiveSheet().getIndex(), + cellRanges: [ + { + ...activeCell, + endCol: MAX_COL + } + ] + }; +} diff --git a/packages/office-viewer/src/excel/render/dnd/removeEventListener.ts b/packages/office-viewer/src/excel/render/dnd/removeEventListener.ts new file mode 100644 index 000000000..ab98df55d --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/removeEventListener.ts @@ -0,0 +1,12 @@ +import {handleMousemove} from './handleMousemove'; +import {handleMouseup} from './handleMouseup'; + +/** + * 移除事件监听 + */ +export function removeEventListener() { + document.removeEventListener('mousemove', handleMousemove, true); + // document.removeEventListener('touchmove', handleMousemove, true); + document.removeEventListener('mouseup', handleMouseup); + // document.removeEventListener('touchend', handleMouseup); +} diff --git a/packages/office-viewer/src/excel/render/dnd/selectAll.ts b/packages/office-viewer/src/excel/render/dnd/selectAll.ts new file mode 100644 index 000000000..1b95ec398 --- /dev/null +++ b/packages/office-viewer/src/excel/render/dnd/selectAll.ts @@ -0,0 +1,29 @@ +import {MAX_COL, MAX_ROW} from '../Consts'; +import {SheetSelection} from '../selection/SheetSelection'; + +/** + * 全选范围 + */ +export function selectAll(sheetIndex: number): SheetSelection { + const activeCell = { + startRow: 0, + startCol: 0, + endRow: 0, + endCol: 0 + }; + + return { + user: '', + region: 'normal', + selectType: 'corner', + activeCell, + sheetIndex, + cellRanges: [ + { + ...activeCell, + endRow: MAX_ROW, + endCol: MAX_COL + } + ] + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/BaseDrawingRender.ts b/packages/office-viewer/src/excel/render/drawing/BaseDrawingRender.ts new file mode 100644 index 000000000..9226cfc41 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/BaseDrawingRender.ts @@ -0,0 +1,38 @@ +import {Rect} from '../Rect'; + +/** + * Drawing 渲染基类 + */ +export class BaseDrawingRender { + drawingContainer: HTMLElement; + + constructor( + container: HTMLElement, + displayRect: Rect, + gid: string, + className: string + ) { + const picContainer = document.createElement('div'); + picContainer.className = className; + picContainer.dataset.gid = gid; + this.drawingContainer = picContainer; + this.updatePosition(displayRect); + container.appendChild(picContainer); + } + + hide() { + this.drawingContainer.style.display = 'none'; + } + + show() { + this.drawingContainer.style.display = 'block'; + } + + updatePosition(displayRect: Rect) { + const {x, y, width, height} = displayRect; + this.drawingContainer.style.left = `${x}px`; + this.drawingContainer.style.top = `${y}px`; + this.drawingContainer.style.width = `${width}px`; + this.drawingContainer.style.height = `${height}px`; + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/EChartsRender.ts b/packages/office-viewer/src/excel/render/drawing/EChartsRender.ts new file mode 100644 index 000000000..f9685653a --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/EChartsRender.ts @@ -0,0 +1,17 @@ +import type echarts from 'echarts'; +import {BaseDrawingRender} from './BaseDrawingRender'; +import {Rect} from '../Rect'; + +export class EChartsRender extends BaseDrawingRender { + constructor(container: HTMLElement, displayRect: Rect, gid: string) { + super(container, displayRect, gid, 'excel-chart'); + } + + render(option: echarts.EChartOption) { + import('echarts').then(echarts => { + // @ts-ignore 奇怪为啥不对 + const chart = echarts.init(this.drawingContainer); + chart.setOption(option); + }); + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/PicRender.ts b/packages/office-viewer/src/excel/render/drawing/PicRender.ts new file mode 100644 index 000000000..a93698e37 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/PicRender.ts @@ -0,0 +1,66 @@ +import src from '../../..'; +import {emuToPx} from '../../../util/emuToPx'; +import {IPicture} from '../../types/IDrawing'; +import {Rect} from '../Rect'; +import {BaseDrawingRender} from './BaseDrawingRender'; + +export class PicRender extends BaseDrawingRender { + constructor( + container: HTMLElement, + displayRect: Rect, + gid: string, + pic: IPicture + ) { + super(container, displayRect, gid, 'excel-pic'); + + if (!pic.imgURL) { + console.warn('imgURL do not exist'); + return; + } + + const srcRect = pic.blipFill?.srcRect; + + const img = new Image(); + img.src = pic.imgURL; + + if (srcRect) { + // 根据 srcRect 的百分比来设置图片的位置及大小 + const containerWidth = displayRect.width; + const containerHeight = displayRect.height; + let leftPercent = 0; + if (srcRect.l) { + leftPercent = parseInt(srcRect.l, 10) / 100000; + } + + let topPercent = 0; + if (srcRect.t) { + topPercent = parseInt(srcRect.t, 10) / 100000; + } + + let bottomPercent = 0; + if (srcRect.b) { + bottomPercent = parseInt(srcRect.b, 10) / 100000; + } + + let rightPercent = 0; + if (srcRect.r) { + rightPercent = parseInt(srcRect.r, 10) / 100000; + } + + const width = containerWidth * (1 + leftPercent + rightPercent); + const height = containerHeight * (1 + topPercent + bottomPercent); + const top = -containerHeight * topPercent; + const left = -containerWidth * leftPercent; + + img.style.width = `${width}px`; + img.style.height = `${height}px`; + img.style.top = `${top}px`; + img.style.left = `${left}px`; + img.style.position = 'absolute'; + } else { + img.style.height = '100%'; + img.style.width = '100%'; + } + this.drawingContainer.appendChild(img); + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/ResizeBox.ts b/packages/office-viewer/src/excel/render/drawing/ResizeBox.ts new file mode 100644 index 000000000..b6a5065a4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/ResizeBox.ts @@ -0,0 +1,145 @@ +import {H} from '../../../util/H'; + +/** + * 用于缩放 drawing 的边框,目前没实现编辑功能所以还不能用,只是展示 + */ +export class ResizeBox { + /** + * 边框元素 + */ + box: HTMLElement; + + /** + * 左上角的操作节点 + */ + topLeft: HTMLElement; + + /** + * 顶部的操作节点 + */ + top: HTMLElement; + + /** + * 右上角的操作节点 + */ + topRight: HTMLElement; + + /** + * 左侧的操作节点 + */ + left: HTMLElement; + + /** + * 右侧的操作节点 + */ + right: HTMLElement; + + /** + * 左下角的操作节点 + */ + bottomLeft: HTMLElement; + + /** + * 底部的操作节点 + */ + bottom: HTMLElement; + + /** + * 右下角的操作节点 + */ + bottomRight: HTMLElement; + + /** + * 控制节点的大小,需要和 CSS 里保持一致 + */ + controllerSize = 14; + + constructor(container: HTMLElement) { + this.box = H('div', { + className: 'ov-excel-resize-box', + parent: container + }); + + this.topLeft = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.top = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.topRight = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.left = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.right = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.bottomLeft = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.bottom = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + this.bottomRight = H('div', { + className: 'ov-excel-resize-box-control', + parent: this.box + }); + + // 默认隐藏,点击的时候才开启 + this.hide(); + } + + /** + * 更新位置信息 + */ + updatePosition(x: number, y: number, width: number, height: number) { + this.box.style.display = 'block'; + this.box.style.left = `${x}px`; + this.box.style.top = `${y}px`; + this.box.style.width = `${width}px`; + this.box.style.height = `${height}px`; + + this.topLeft.style.left = '-7px'; + this.topLeft.style.top = '-7px'; + + this.top.style.left = `${width / 2 - this.controllerSize / 2}px`; + this.top.style.top = '-7px'; + + this.topRight.style.right = '-7px'; + this.topRight.style.top = '-7px'; + + this.left.style.left = '-7px'; + this.left.style.top = `${height / 2 - this.controllerSize / 2}px`; + + this.right.style.right = '-7px'; + this.right.style.top = `${height / 2 - this.controllerSize / 2}px`; + + this.bottomLeft.style.left = '-7px'; + this.bottomLeft.style.bottom = '-7px'; + + this.bottom.style.left = `${width / 2 - this.controllerSize / 2}px`; + this.bottom.style.bottom = '-7px'; + + this.bottomRight.style.right = '-7px'; + this.bottomRight.style.bottom = '-7px'; + } + + hide() { + this.box.style.display = 'none'; + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/buildLabel.ts b/packages/office-viewer/src/excel/render/drawing/chart/buildLabel.ts new file mode 100644 index 000000000..d78e1cca2 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/buildLabel.ts @@ -0,0 +1,11 @@ +import {CT_DLbls} from '../../../../openxml/ChartTypes'; + +export function buildLabel(dLbls?: CT_DLbls) { + let label = {} as echarts.EChartOption.SeriesLine['label']; + + if (dLbls) { + // todo: 目前解析漏掉了 EG_DLblShared + } + + return label; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/calcPercentStacked.ts b/packages/office-viewer/src/excel/render/drawing/chart/calcPercentStacked.ts new file mode 100644 index 000000000..ee755868c --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/calcPercentStacked.ts @@ -0,0 +1,22 @@ +type Series = { + data: number[]; +}; + +export function calcPercentStacked(series: Series[]) { + const totalData: number[] = []; + for (const ser of series) { + for (let i = 0; i < ser.data.length; i++) { + const value = ser.data[i] || 0; + totalData[i] = (totalData[i] || 0) + +value; + } + } + // 计算百分比 + for (const ser of series) { + for (let i = 0; i < ser.data.length; i++) { + const value = ser.data[i] || 0; + // 避免为零 + const totalValue = totalData[i] || 1; + ser.data[i] = (+value / totalValue) * 100; + } + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/convertAxis.ts b/packages/office-viewer/src/excel/render/drawing/chart/convertAxis.ts new file mode 100644 index 000000000..b370a1d72 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/convertAxis.ts @@ -0,0 +1,75 @@ +/** + * 构建坐标轴 + */ + +import {CT_CatAx, CT_ValAx} from '../../../../openxml/ChartTypes'; + +/** + * 将 Excel chart 的坐标轴转换为 Echarts 的坐标轴 + */ +export function convertAxis( + categories: string[], + catAx?: CT_CatAx, + valAx?: CT_ValAx +) { + let xAxis = {}; + + let yAxis = {}; + + if (catAx) { + let axis = { + type: 'category' + } as echarts.EChartOption.XAxis | echarts.EChartOption.YAxis; + + if (catAx.axPos?.val === 'b') { + xAxis = axis; + } + + if (catAx.axPos?.val === 't') { + xAxis = axis; + axis.position = 'top'; + } + + if (catAx.axPos?.val === 'l') { + yAxis = axis; + } + + if (catAx.axPos?.val === 'r') { + yAxis = axis; + axis.position = 'right'; + } + } + + if (valAx) { + let axis = { + type: 'value' + } as { + type: 'value'; + // 因为可能是两种坐标,没法指定 + position?: any; + }; + + if (valAx.axPos?.val === 'b') { + xAxis = axis; + } + + if (valAx.axPos?.val === 't') { + xAxis = axis; + axis.position = 'top'; + } + + if (valAx.axPos?.val === 'l') { + yAxis = axis; + } + + if (valAx.axPos?.val === 'r') { + yAxis = axis; + axis.position = 'right'; + } + } + + return { + xAxis, + yAxis + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/convertLegend.ts b/packages/office-viewer/src/excel/render/drawing/chart/convertLegend.ts new file mode 100644 index 000000000..ee06aa1a7 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/convertLegend.ts @@ -0,0 +1,39 @@ +import {CT_Legend} from '../../../../openxml/ChartTypes'; + +/** + * 将 Excel chart 的图例转换为 Echarts 的图例 + */ +export function convertLegend(categories: string[], chartLegend?: CT_Legend) { + let legend = { + data: categories + } as echarts.EChartOption.Legend; + + if (chartLegend) { + const legendPos = chartLegend.legendPos?.val; + if (legendPos === 'b') { + legend.orient = 'horizontal'; + legend.bottom = 0; + } + if (legendPos === 'r') { + legend.orient = 'vertical'; + legend.right = 0; + legend.top = 'center'; + } + if (legendPos === 't') { + legend.orient = 'horizontal'; + legend.top = 0; + } + if (legendPos === 'l') { + legend.orient = 'vertical'; + legend.left = 0; + legend.top = 'center'; + } + if (legendPos === 'tr') { + legend.orient = 'horizontal'; + legend.top = 0; + legend.right = 0; + } + } + + return legend; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/convertTitle.ts b/packages/office-viewer/src/excel/render/drawing/chart/convertTitle.ts new file mode 100644 index 000000000..d06570bdf --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/convertTitle.ts @@ -0,0 +1,39 @@ +import {CT_Title} from '../../../../openxml/ChartTypes'; + +export function convertTitle(chartTitle?: CT_Title) { + const title = { + top: 0, + right: 'center', + text: '' + } as { + top?: string | number; + right?: string | number; + bottom?: string | number; + left?: string | number; + text: string; + }; + + if (chartTitle) { + // 这里竟然是富文本,所以先只提取 t + for (const p of chartTitle.tx?.rich?.p || []) { + for (const r of p.r || []) { + title.text += r.t || ''; + } + } + + if (chartTitle.layout) { + // 没试过 + const manualLayout = chartTitle.layout.manualLayout; + if (manualLayout) { + if (manualLayout.x) { + title.left = manualLayout.x.val; + } + if (manualLayout.y) { + title.top = manualLayout.y.val; + } + } + } + } + + return title; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/fromAreaChart.ts b/packages/office-viewer/src/excel/render/drawing/chart/fromAreaChart.ts new file mode 100644 index 000000000..c82fbc83c --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/fromAreaChart.ts @@ -0,0 +1,40 @@ +import {CT_AreaChart} from '../../../../openxml/ChartTypes'; +import {Workbook} from '../../../Workbook'; +import {calcPercentStacked} from './calcPercentStacked'; +import {getStack} from './getStack'; +import {getData} from './getData'; +import {buildLabel} from './buildLabel'; + +export function fromAreaChart(workbook: Workbook, areaChart: CT_AreaChart) { + const categories: string[] = []; + const series = []; + const ser = areaChart.ser || []; + let isPercentStacked = false; + for (const areaSeries of ser) { + const seriesData = getData(workbook, areaSeries.val); + let name = areaSeries.tx?.strRef?.strCache?.pt?.[0]?.v || ''; + if (name) { + categories.push(name); + } + const label = buildLabel(areaSeries.dLbls); + let stack = getStack(areaChart.grouping); + isPercentStacked = stack.isPercentStacked; + series.push({ + name, + type: 'line', + stack: stack.stack, + data: seriesData, + label, + areaStyle: {} + }); + } + + if (isPercentStacked) { + calcPercentStacked(series); + } + + return { + categories, + series + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/fromBarChart.ts b/packages/office-viewer/src/excel/render/drawing/chart/fromBarChart.ts new file mode 100644 index 000000000..2152cca24 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/fromBarChart.ts @@ -0,0 +1,33 @@ +import {CT_BarChart} from '../../../../openxml/ChartTypes'; +import {Workbook} from '../../../Workbook'; +import {getStack} from './getStack'; +import {calcPercentStacked} from './calcPercentStacked'; +import {getData} from './getData'; + +export function fromBarChart(workbook: Workbook, barChart: CT_BarChart) { + const categories: string[] = []; + const series = []; + const barSer = barChart.ser || []; + let isPercentStacked = false; + for (const barSeries of barSer) { + const seriesData = getData(workbook, barSeries.val); + let name = barSeries.tx?.strRef?.strCache?.pt?.[0]?.v || ''; + if (name) { + categories.push(name); + } + let stack = getStack(barChart.grouping); + isPercentStacked = stack.isPercentStacked; + series.push({ + name, + type: 'bar', + stack: stack.stack, + data: seriesData + }); + } + + if (isPercentStacked) { + calcPercentStacked(series); + } + + return {categories, series}; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/fromDoughnutChart.ts b/packages/office-viewer/src/excel/render/drawing/chart/fromDoughnutChart.ts new file mode 100644 index 000000000..a916d9289 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/fromDoughnutChart.ts @@ -0,0 +1,40 @@ +import {CT_DoughnutChart} from '../../../../openxml/ChartTypes'; +import {Workbook} from '../../../Workbook'; +import {getData} from './getData'; +import {buildLabel} from './buildLabel'; + +export function fromDoughnutChart( + workbook: Workbook, + doughnutChart: CT_DoughnutChart +) { + const categories: string[] = []; + const series = []; + const chartSer = doughnutChart.ser || []; + + for (const ser of chartSer) { + const seriesData = getData(workbook, ser.val); + let name = ser.tx?.strRef?.strCache?.pt?.[0]?.v || ''; + if (name) { + categories.push(name); + } + const label = buildLabel(ser.dLbls); + series.push({ + name, + data: seriesData, + type: 'pie', + radius: ['40%', '70%'], + emphasis: { + label: { + show: true, + fontSize: 40, + fontWeight: 'bold' + } + } + }); + } + + return { + categories, + series + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/fromLineChart.ts b/packages/office-viewer/src/excel/render/drawing/chart/fromLineChart.ts new file mode 100644 index 000000000..a94d1b2a7 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/fromLineChart.ts @@ -0,0 +1,39 @@ +import {CT_AreaChart, CT_LineChart} from '../../../../openxml/ChartTypes'; +import {Workbook} from '../../../Workbook'; +import {calcPercentStacked} from './calcPercentStacked'; +import {getStack} from './getStack'; +import {getData} from './getData'; +import {buildLabel} from './buildLabel'; + +export function fromLineChart(workbook: Workbook, lineChart: CT_LineChart) { + const categories: string[] = []; + const series = []; + const ser = lineChart.ser || []; + let isPercentStacked = false; + for (const lineSeries of ser) { + const seriesData = getData(workbook, lineSeries.val); + let name = lineSeries.tx?.strRef?.strCache?.pt?.[0]?.v || ''; + if (name) { + categories.push(name); + } + const label = buildLabel(lineSeries.dLbls); + let stack = getStack(lineChart.grouping); + isPercentStacked = stack.isPercentStacked; + series.push({ + name, + type: 'line', + stack: stack.stack, + data: seriesData, + label + }); + } + + if (isPercentStacked) { + calcPercentStacked(series); + } + + return { + categories, + series + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/fromPieChart.ts b/packages/office-viewer/src/excel/render/drawing/chart/fromPieChart.ts new file mode 100644 index 000000000..7aba2f751 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/fromPieChart.ts @@ -0,0 +1,29 @@ +import {CT_PieChart} from '../../../../openxml/ChartTypes'; +import {Workbook} from '../../../Workbook'; +import {getData} from './getData'; +import {buildLabel} from './buildLabel'; + +export function fromPieChart(workbook: Workbook, pieChart: CT_PieChart) { + const categories: string[] = []; + const series = []; + const chartSer = pieChart.ser || []; + + for (const ser of chartSer) { + const seriesData = getData(workbook, ser.val); + let name = ser.tx?.strRef?.strCache?.pt?.[0]?.v || ''; + if (name) { + categories.push(name); + } + const label = buildLabel(ser.dLbls); + series.push({ + name, + data: seriesData, + type: 'pie' + }); + } + + return { + categories, + series + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/getData.ts b/packages/office-viewer/src/excel/render/drawing/chart/getData.ts new file mode 100644 index 000000000..c52f0c9f8 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/getData.ts @@ -0,0 +1,16 @@ +import {CT_NumDataSource} from '../../../../openxml/ChartTypes'; +import {Workbook} from '../../../Workbook'; + +/** + * 获取数据,目前只从 cache 里获取,后续改成动态获取 + */ +export function getData(workbook: Workbook, val?: CT_NumDataSource) { + const ref = val?.numRef?.f; + if (!ref) { + return []; + } + const seriesData = (val?.numRef?.numCache?.pt || []).map(pt => { + return parseFloat(pt.v!); + }); + return seriesData; +} diff --git a/packages/office-viewer/src/excel/render/drawing/chart/getStack.ts b/packages/office-viewer/src/excel/render/drawing/chart/getStack.ts new file mode 100644 index 000000000..8db2efb50 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/chart/getStack.ts @@ -0,0 +1,17 @@ +import {CT_BarGrouping} from '../../../../openxml/ChartTypes'; + +export function getStack(grouping?: CT_BarGrouping) { + let stack; + let isPercentStacked = false; + if (grouping) { + if (grouping.val === 'stacked') { + stack = 'x'; + } + if (grouping.val === 'percentStacked') { + // 这个在 Echarts 里需要自己计算百分比 + stack = 'x'; + isPercentStacked = true; + } + } + return {stack, isPercentStacked}; +} diff --git a/packages/office-viewer/src/excel/render/drawing/convertToEChartOptions.ts b/packages/office-viewer/src/excel/render/drawing/convertToEChartOptions.ts new file mode 100644 index 000000000..5c8e988e3 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/convertToEChartOptions.ts @@ -0,0 +1,93 @@ +import type echarts from 'echarts'; +import {Workbook} from '../../Workbook'; +import {IChartSpace} from '../../types/IChartSpace'; +import {fromBarChart} from './chart/fromBarChart'; +import {fromAreaChart} from './chart/fromAreaChart'; +import {convertAxis} from './chart/convertAxis'; +import {convertLegend} from './chart/convertLegend'; +import {convertTitle} from './chart/convertTitle'; +import {fromDoughnutChart} from './chart/fromDoughnutChart'; +import {fromLineChart} from './chart/fromLineChart'; +import {fromPieChart} from './chart/fromPieChart'; + +/** + * 将 chartSpace 配置转成 EChartOptions + * P3365 + */ +export function convertToEChartOptions( + workbook: Workbook, + chartSpace: IChartSpace +): echarts.EChartOption | null { + const chart = chartSpace.chart; + console.log('chart', chart); + if (!chart) { + return null; + } + + const title = convertTitle(chart.title); + + const grid = { + backgroundColor: 'white', + show: true + }; + + const echartsOptions = { + title, + grid + }; + + const plotArea = chart.plotArea; + + if (!plotArea) { + return null; + } + + let categories: string[] = []; + let series: echarts.EChartOption.Series[] = []; + + if (plotArea.lineChart) { + const result = fromLineChart(workbook, plotArea.lineChart); + categories = result.categories; + series = series.concat(result.series); + } + + if (plotArea.barChart) { + const result = fromBarChart(workbook, plotArea.barChart); + categories = result.categories; + series = series.concat(result.series); + } + + if (plotArea.areaChart) { + const result = fromAreaChart(workbook, plotArea.areaChart); + categories = result.categories; + series = series.concat(result.series); + } + + if (plotArea.pieChart) { + const result = fromPieChart(workbook, plotArea.pieChart); + categories = result.categories; + series = series.concat(result.series); + } + + if (plotArea.doughnutChart) { + const result = fromDoughnutChart(workbook, plotArea.doughnutChart); + categories = result.categories; + series = series.concat(result.series); + } + + const {xAxis, yAxis} = convertAxis( + categories, + plotArea.catAx, + plotArea.valAx + ); + + const legend = convertLegend(categories, chart.legend); + + return { + ...echartsOptions, + legend, + xAxis, + yAxis, + series + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/drawChart.ts b/packages/office-viewer/src/excel/render/drawing/drawChart.ts new file mode 100644 index 000000000..9a8dc75d3 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/drawChart.ts @@ -0,0 +1,60 @@ +import {Sheet} from '../../sheet/Sheet'; +import {IChartSpace} from '../../types/IChartSpace'; +import {Rect, rectIntersect} from '../Rect'; +import {EChartsRender} from './EChartsRender'; +import {convertToEChartOptions} from './convertToEChartOptions'; + +const EChartsMap: Record = {}; + +export function drawChart( + currentSheet: Sheet, + displayRect: Rect, + rowHeaderWidth: number, + colHeaderHeight: number, + chartRect: Rect, + chartSpace: IChartSpace +) { + const workbook = currentSheet.getWorkbook(); + // Excel 渲染在数据容器内,可以被表头遮挡 + const dataContainer = workbook.getDataContainer(); + const gid = chartSpace.gid; + + // 因为前面算的是相对位置,所以这里也得转成相对位置 + const relativeDisplayRect = { + x: 0, + y: 0, + width: displayRect.width, + height: displayRect.height + }; + + const renderRect = { + x: chartRect.x - rowHeaderWidth, + y: chartRect.y - colHeaderHeight, + width: chartRect.width, + height: chartRect.height + }; + + if (rectIntersect(renderRect, relativeDisplayRect)) { + let echartsRender; + + // 目前 sheet 切换的时候会清空 + const chartElement = dataContainer.querySelector(`[data-gid="${gid}"]`); + + if (EChartsMap[gid] && chartElement) { + echartsRender = EChartsMap[gid]; + echartsRender.updatePosition(renderRect); + echartsRender.show(); + } else { + echartsRender = new EChartsRender(dataContainer, renderRect, gid); + EChartsMap[gid] = echartsRender; + const echartsOption = convertToEChartOptions(workbook, chartSpace); + if (echartsOption) { + echartsRender.render(echartsOption); + } + } + } else { + if (EChartsMap[gid]) { + EChartsMap[gid].hide(); + } + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/drawDrawing.ts b/packages/office-viewer/src/excel/render/drawing/drawDrawing.ts new file mode 100644 index 000000000..be057367e --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/drawDrawing.ts @@ -0,0 +1,179 @@ +import {emuToPx} from '../../../util/emuToPx'; +import {Sheet} from '../../sheet/Sheet'; +import {SheetCanvas} from '../SheetCanvas'; +import {rectIntersect} from '../Rect'; +import {drawPic} from './drawPic'; +import {drawShape} from './drawShape'; +import {drawChart} from './drawChart'; +import { + getRectFromOneAnchorPoint, + getRectFromTwoAnchorPoint +} from './getRectFromAnchorPoint'; +import {getAbsoluteAnchorPosition} from './getAbsoluteAnchorPosition'; +import {ExcelRender} from '../ExcelRender'; +import {ViewRange} from '../../sheet/ViewRange'; + +/** + * 绘制 sheet 里的图片及文本框 + */ +export function drawDrawing( + excelRender: ExcelRender, + currentSheet: Sheet, + viewRange: ViewRange, + canvas: SheetCanvas +) { + const drawing = currentSheet.getDrawing(); + if (!drawing) { + return; + } + + const displayRect = currentSheet.getDisplayRect(); + + const {rowHeaderWidth, colHeaderHeight} = currentSheet.getRowColSize(); + + for (const twoCellAnchor of drawing.twoCellAnchors) { + if (!twoCellAnchor.from || !twoCellAnchor.to) { + console.warn('from or to do not exist'); + continue; + } + const drawingRect = getRectFromTwoAnchorPoint( + currentSheet, + twoCellAnchor.from?.[0], + twoCellAnchor.to?.[0], + viewRange + ); + + if (twoCellAnchor.pic) { + drawPic( + currentSheet, + canvas, + displayRect, + drawingRect, + rowHeaderWidth, + colHeaderHeight, + twoCellAnchor.pic + ); + } + if (twoCellAnchor.shape) { + drawShape( + excelRender, + currentSheet, + canvas, + displayRect, + drawingRect, + rowHeaderWidth, + colHeaderHeight, + twoCellAnchor.shape + ); + } + if (twoCellAnchor.chartSpace) { + drawChart( + currentSheet, + displayRect, + rowHeaderWidth, + colHeaderHeight, + drawingRect, + twoCellAnchor.chartSpace + ); + } + } + + for (const absoluteAnchor of drawing.absoluteAnchors) { + const size = getAbsoluteAnchorPosition(absoluteAnchor); + + const x = size.x + rowHeaderWidth - displayRect.x; + const y = size.y + colHeaderHeight - displayRect.y; + + const drawingRect = { + x, + y, + width: size.width, + height: size.height + }; + + // 目前没测试过在 absoluteAnchor 里的效果,都不知道怎么在 excel 里操作 + if (absoluteAnchor.pic) { + drawPic( + currentSheet, + canvas, + displayRect, + drawingRect, + rowHeaderWidth, + colHeaderHeight, + absoluteAnchor.pic + ); + } + + if (absoluteAnchor.shape) { + drawShape( + excelRender, + currentSheet, + canvas, + displayRect, + drawingRect, + rowHeaderWidth, + colHeaderHeight, + absoluteAnchor.shape + ); + } + + if (absoluteAnchor.chartSpace) { + drawChart( + currentSheet, + displayRect, + rowHeaderWidth, + colHeaderHeight, + drawingRect, + absoluteAnchor.chartSpace + ); + } + } + + for (const oneCellAnchor of drawing.oneCellAnchors) { + if (!oneCellAnchor.from) { + console.warn('from do not exist'); + continue; + } + const drawingRect = getRectFromOneAnchorPoint( + currentSheet, + oneCellAnchor.from?.[0], + viewRange + ); + + if (oneCellAnchor.pic) { + drawPic( + currentSheet, + canvas, + displayRect, + drawingRect, + rowHeaderWidth, + colHeaderHeight, + oneCellAnchor.pic + ); + } + + if (oneCellAnchor.shape) { + drawShape( + excelRender, + currentSheet, + canvas, + displayRect, + drawingRect, + rowHeaderWidth, + colHeaderHeight, + oneCellAnchor.shape + ); + } + + if (oneCellAnchor.chartSpace) { + drawChart( + currentSheet, + displayRect, + rowHeaderWidth, + colHeaderHeight, + drawingRect, + oneCellAnchor.chartSpace + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/drawPic.ts b/packages/office-viewer/src/excel/render/drawing/drawPic.ts new file mode 100644 index 000000000..a35819fcb --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/drawPic.ts @@ -0,0 +1,84 @@ +import {Sheet} from '../../sheet/Sheet'; +import {IPicture} from '../../types/IDrawing'; +import {Rect, rectIntersect} from '../Rect'; +import {SheetCanvas} from '../SheetCanvas'; +import {PicRender} from './PicRender'; + +const PicRenderMap: Record = {}; + +export function drawPic( + currentSheet: Sheet, + canvas: SheetCanvas, + displayRect: Rect, + drawingRect: Rect, + rowHeaderWidth: number, + colHeaderHeight: number, + pic: IPicture +) { + if (!pic) { + console.warn('pic do not exist'); + return; + } + const imgURL = pic.imgURL; + if (!imgURL) { + console.warn('imgURL do not exist'); + return; + } + + // 目前只用 drawing 的坐标,这个 xfrm 还不知道是什么 + // const xfrm = pic.spPr?.xfrm; + // if (!xfrm) { + // console.warn('xfrm do not exist'); + // return; + // } + + // const ext = xfrm.ext; + // const off = xfrm.off; + + // if (!ext || !off) { + // console.warn('ext or off do not exist'); + // return; + // } + + // const x = emuToPx(parseFloat(off.x! as string)); + // const y = emuToPx(parseFloat(off.y! as string)); + // const width = emuToPx(ext.cx!); + // const height = emuToPx(ext.cy!); + + const workbook = currentSheet.getWorkbook(); + // Excel 渲染在数据容器内,可以被表头遮挡 + const dataContainer = workbook.getDataContainer(); + + const renderRect = { + x: drawingRect.x - rowHeaderWidth, + y: drawingRect.y - colHeaderHeight, + width: drawingRect.width, + height: drawingRect.height + }; + + // 因为前面算的是相对位置,所以这里也得转成相对位置 + const relativeDisplayRect = { + x: 0, + y: 0, + width: displayRect.width, + height: displayRect.height + }; + + // 如果图片在显示区域内才绘制 + if (rectIntersect(renderRect, relativeDisplayRect)) { + const gid = pic.gid; + // 目前 sheet 切换的时候会清空 + const gidElement = dataContainer.querySelector(`[data-gid="${gid}"]`); + if (PicRenderMap[gid] && gidElement) { + PicRenderMap[gid].updatePosition(renderRect); + PicRenderMap[gid].show(); + } else { + const picRender = new PicRender(dataContainer, renderRect, gid, pic); + PicRenderMap[gid] = picRender; + } + } else { + if (PicRenderMap[pic.gid]) { + PicRenderMap[pic.gid].hide(); + } + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/drawShape.ts b/packages/office-viewer/src/excel/render/drawing/drawShape.ts new file mode 100644 index 000000000..9f096cc7b --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/drawShape.ts @@ -0,0 +1,188 @@ +import {CT_CellAlignment} from '../../../openxml/ExcelTypes'; +import {ShapeGuide} from '../../../openxml/drawing/Shape'; +import {ShapePr} from '../../../openxml/drawing/ShapeProperties'; +import {presetShape} from '../../../openxml/drawing/presetShape'; +import {shapeToSVG} from '../../../openxml/drawing/svg/shapeToSVG'; +import {emuToPx} from '../../../util/emuToPx'; +import {Sheet} from '../../sheet/Sheet'; +import {CellInfo} from '../../types/CellInfo'; +import {IShape, IShapeProperties} from '../../types/IDrawing'; +import {IRElt} from '../../types/IRElt'; +import {ExcelRender} from '../ExcelRender'; + +import {Rect, rectIntersect} from '../Rect'; +import {SheetCanvas} from '../SheetCanvas'; +import {drawTextInCell} from '../cell/drawTextInCell'; + +function convertIShapePropertiesToShapePr(shapePr: IShapeProperties): ShapePr { + let outline = shapePr.outline; + let fillColor = shapePr.fillColor; + let noFill: boolean | undefined = undefined; + if (shapePr.noFill) { + noFill = true; + } + return { + outline, + fillColor, + noFill + }; +} + +function convertTextBody(): IRElt[] { + const r: IRElt[] = []; + + return r; +} + +/** + * 绘制 sheet 里的形状及文本框 + */ +export async function drawShape( + excelRender: ExcelRender, + currentSheet: Sheet, + canvas: SheetCanvas, + displayRect: Rect, + drawingRect: Rect, + rowHeaderWidth: number, + colHeaderHeight: number, + sp: IShape +) { + // const xfrm = sp.spPr?.xfrm; + // if (!xfrm) { + // console.warn('xfrm do not exist'); + // return; + // } + + // const ext = xfrm.ext; + // const off = xfrm.off; + + // if (!ext || !off) { + // console.warn('ext or off do not exist'); + // return; + // } + + // const x = emuToPx(parseFloat(off.x! as string)); + // const y = emuToPx(parseFloat(off.y! as string)); + // const width = emuToPx(ext.cx!); + // const height = emuToPx(ext.cy!); + + // 因为前面算的是相对位置,所以这里也得转成相对位置 + const relativeDisplayRect = { + x: 0, + y: 0, + width: displayRect.width, + height: displayRect.height + }; + + const renderRect = { + x: drawingRect.x - rowHeaderWidth, + y: drawingRect.y - colHeaderHeight, + width: drawingRect.width, + height: drawingRect.height + }; + + // 如果在显示区域内才绘制 + if (rectIntersect(renderRect, relativeDisplayRect)) { + const workbook = currentSheet.getWorkbook(); + const dataProvider = workbook.getDataProvider(); + // 先绘制形状 + const spPr = sp.spPr!; + const prstGeom = spPr.prstGeom; + + // 形状定义 + if (prstGeom && prstGeom.prst) { + const prst = prstGeom.prst; + const shape = presetShape[prst]; + + if (shape) { + const avLst: ShapeGuide[] = []; + // 将自动解析的 avLst 转成之前手动解析的 ShapeGuide + for (const gd of prstGeom.avLst?.gd || []) { + avLst.push({ + n: gd.name!, + f: gd.fmla! + }); + } + // 将自动解析的 avLst 转成之前手动解析的 ShapeGuide + for (const gd of prstGeom.avLst?.gd || []) { + avLst.push({ + n: gd.name!, + f: gd.fmla! + }); + } + const svg = shapeToSVG( + shape, + avLst, + convertIShapePropertiesToShapePr(spPr), + drawingRect.width, + drawingRect.height, + { + lineColor: sp.styleColor?.lnRefColor, + fillColor: sp.styleColor?.fillRefColor, + fontColor: sp.styleColor?.fontRefColor + } + ); + const svgContent = new XMLSerializer().serializeToString(svg); + + const svgURL = 'data:image/svg+xml;base64,' + btoa(svgContent); + + await canvas.drawImageWithCache( + svgURL, + drawingRect.x - displayRect.x, + drawingRect.y - displayRect.y, + drawingRect.width, + drawingRect.height + ); + } + } + + const richText = sp.richText; + + if (richText) { + let alignment: CT_CellAlignment = {}; + const anchor = sp.txBody?.bodyPr?.anchor; + if (anchor) { + switch (anchor) { + case 't': + alignment.vertical = 'top'; + break; + + case 'ctr': + alignment.vertical = 'center'; + break; + + case 'b': + alignment.vertical = 'bottom'; + break; + + default: + break; + } + } + + // 构建一个 CellInfo + const cellInfo: CellInfo = { + row: 0, + col: 0, + font: {}, + text: '', + value: '', + alignment, + cellData: richText + }; + drawTextInCell( + excelRender, + currentSheet, + canvas.getContext(), + dataProvider, + cellInfo, + drawingRect.x - displayRect.x, + drawingRect.y - displayRect.y, + drawingRect.width, + drawingRect.height, + 0, + 0 + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/drawing/findPositionInViewRange.ts b/packages/office-viewer/src/excel/render/drawing/findPositionInViewRange.ts new file mode 100644 index 000000000..af03e42a5 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/findPositionInViewRange.ts @@ -0,0 +1,37 @@ +import {Sheet} from '../../sheet/Sheet'; +import {ViewRange} from '../../sheet/ViewRange'; +import {Rect} from '../Rect'; + +/** + * 在 viewRange 中找到 row 和 col 的位置 + */ + +export function findPositionInViewRange( + currentSheet: Sheet, + row: number, + col: number, + viewRange: ViewRange +): Rect { + const rowIndex = viewRange.rows.indexOf(row); + const colIndex = viewRange.cols.indexOf(col); + let rowSize; + let colSize; + if (rowIndex !== -1 && colIndex !== -1) { + rowSize = viewRange.rowSizes[rowIndex]; + colSize = viewRange.colSizes[colIndex]; + return { + x: colSize.offset, + y: rowSize.offset, + width: colSize.size, + height: rowSize.size + }; + } + + const cellPosition = currentSheet.getCellPosition(row, col); + return { + x: cellPosition.x, + y: cellPosition.y, + width: cellPosition.width, + height: cellPosition.height + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/getAbsoluteAnchorPosition.ts b/packages/office-viewer/src/excel/render/drawing/getAbsoluteAnchorPosition.ts new file mode 100644 index 000000000..05f8e58fd --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/getAbsoluteAnchorPosition.ts @@ -0,0 +1,32 @@ +import {CT_AbsoluteAnchor} from '../../../openxml/ExcelTypes'; +import {emuToPx} from '../../../util/emuToPx'; + +/** + * 获取绝对锚点的位置信息 + * @param absoluteAnchor + */ +export function getAbsoluteAnchorPosition(absoluteAnchor: CT_AbsoluteAnchor) { + const pos = absoluteAnchor.pos?.[0]; + if (pos) { + const x = parseFloat(pos.x! as string); + const y = parseFloat(pos.y! as string); + const ext = absoluteAnchor.ext?.[0]; + if (ext && !isNaN(x) && !isNaN(y)) { + const width = emuToPx(ext.cx!); + const height = emuToPx(ext.cy!); + return { + x, + y, + width, + height + }; + } + } + + return { + x: 0, + y: 0, + width: 0, + height: 0 + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/getOneCellAnchorPosition.ts b/packages/office-viewer/src/excel/render/drawing/getOneCellAnchorPosition.ts new file mode 100644 index 000000000..ddbcf7524 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/getOneCellAnchorPosition.ts @@ -0,0 +1,36 @@ +import {CT_OneCellAnchor} from '../../../openxml/ExcelTypes'; +import {emuToPx} from '../../../util/emuToPx'; +import {Sheet} from '../../sheet/Sheet'; + +export function getOneCellAnchorPosition( + oneCellAnchor: CT_OneCellAnchor, + sheet: Sheet +) { + let x = 0; + let y = 0; + let width = 0; + let height = 0; + + const from = oneCellAnchor.from?.[0]; + if (from) { + const cellRow = from.row?.[0] || 0; + const cellRowOffset = emuToPx(from.rowOff?.[0]); + const cellCol = from.col?.[0] || 0; + const cellColOffset = emuToPx(from.colOff?.[0]); + + const cellPosition = sheet.getCellPosition(cellRow, cellCol); + return { + x: cellPosition.x, + y: cellPosition.y, + width: cellColOffset, + height: cellRowOffset + }; + } + + return { + x, + y, + width, + height + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/getPositionByMaker.ts b/packages/office-viewer/src/excel/render/drawing/getPositionByMaker.ts new file mode 100644 index 000000000..150f2458d --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/getPositionByMaker.ts @@ -0,0 +1,23 @@ +import {CT_Marker} from '../../../openxml/ExcelTypes'; +import {emuToPx} from '../../../util/emuToPx'; +import {Sheet} from '../../sheet/Sheet'; + +/** + * 基于 maker 计算位置信息 + */ +export function getPositionByMaker(maker: CT_Marker, sheet: Sheet) { + const row = maker.row?.[0] || 0; + const rowOff = emuToPx(maker.rowOff?.[0]); + + const col = maker.col?.[0] || 0; + const colOff = emuToPx(maker.colOff?.[0]); + + const cellPosition = sheet.getCellPosition(row, col); + + return { + x: cellPosition.x, + y: cellPosition.y, + width: colOff, + height: rowOff + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/getRectFromAnchorPoint.ts b/packages/office-viewer/src/excel/render/drawing/getRectFromAnchorPoint.ts new file mode 100644 index 000000000..ae0530fa8 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/getRectFromAnchorPoint.ts @@ -0,0 +1,75 @@ +import {CT_Marker} from '../../../openxml/ExcelTypes'; +import {Sheet} from '../../sheet/Sheet'; +import {emuToPx} from '../../../util/emuToPx'; +import {findPositionInViewRange} from './findPositionInViewRange'; +import {ViewRange} from '../../sheet/ViewRange'; + +export function getRectFromOneAnchorPoint( + currentSheet: Sheet, + cell: CT_Marker, + viewRange: ViewRange +) { + const cellRow = cell.row?.[0] || 0; + const cellRowOffset = emuToPx(cell.rowOff?.[0]); + + const cellCol = cell.col?.[0] || 0; + const cellColOffset = emuToPx(cell.colOff?.[0]); + + const cellPosition = findPositionInViewRange( + currentSheet, + cellRow, + cellCol, + viewRange + ); + + return { + x: cellPosition.x, + y: cellPosition.y, + width: cellColOffset, + height: cellRowOffset + }; +} + +/** + * 基于 Anchor Point 计算位置信息 + */ + +export function getRectFromTwoAnchorPoint( + currentSheet: Sheet, + from: CT_Marker, + to: CT_Marker, + viewRange: ViewRange +) { + const fromRow = from.row?.[0] || 0; + const fromRowOffset = emuToPx(from.rowOff?.[0]); + + const fromCol = from.col?.[0] || 0; + const fromColOffset = emuToPx(from.colOff?.[0]); + + const toRow = to.row?.[0] || 0; + const toRowOffset = emuToPx(to.rowOff?.[0]); + const toCol = to.col?.[0] || 0; + const toColOffset = emuToPx(to.colOff?.[0]); + + const fromPosition = findPositionInViewRange( + currentSheet, + fromRow, + fromCol, + viewRange + ); + const toPosition = findPositionInViewRange( + currentSheet, + toRow, + toCol, + viewRange + ); + + const x = fromPosition.x + fromColOffset; + const y = fromPosition.y + fromRowOffset; + return { + x, + y, + width: toPosition.x + toColOffset - x, + height: toPosition.y + toRowOffset - y + }; +} diff --git a/packages/office-viewer/src/excel/render/drawing/getTwoCellAnchorPosition.ts b/packages/office-viewer/src/excel/render/drawing/getTwoCellAnchorPosition.ts new file mode 100644 index 000000000..c3e236cf2 --- /dev/null +++ b/packages/office-viewer/src/excel/render/drawing/getTwoCellAnchorPosition.ts @@ -0,0 +1,48 @@ +import {CT_TwoCellAnchor} from '../../../openxml/ExcelTypes'; +import {emuToPx} from '../../../util/emuToPx'; +import {Sheet} from '../../sheet/Sheet'; + +export function getTwoCellAnchorPosition( + twoCellAnchor: CT_TwoCellAnchor, + sheet: Sheet +) { + const from = twoCellAnchor.from?.[0]; + const to = twoCellAnchor.to?.[0]; + + if (!from || !to) { + return { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + + const fromRow = from.row?.[0] || 0; + const fromRowOffset = emuToPx(from.rowOff?.[0]); + + const fromCol = from.col?.[0] || 0; + const fromColOffset = emuToPx(from.colOff?.[0]); + + const fromPosition = sheet.getCellPosition(fromRow, fromCol); + + const toRow = to.row?.[0] || 0; + const toRowOffset = emuToPx(to.rowOff?.[0]); + const toCol = to.col?.[0] || 0; + const toColOffset = emuToPx(to.colOff?.[0]); + + const toPosition = sheet.getCellPosition(toRow, toCol); + + const x = fromPosition.x + fromColOffset; + const y = fromPosition.y + fromRowOffset; + + const width = toPosition.x + toColOffset - x; + const height = toPosition.y + toRowOffset - y; + + return { + x, + y, + width, + height + }; +} diff --git a/packages/office-viewer/src/excel/render/formulaBar/FormulaBar.ts b/packages/office-viewer/src/excel/render/formulaBar/FormulaBar.ts new file mode 100644 index 000000000..34015ca11 --- /dev/null +++ b/packages/office-viewer/src/excel/render/formulaBar/FormulaBar.ts @@ -0,0 +1,135 @@ +/** + * 公式栏 + */ + +import {H} from '../../../util/H'; +import {Workbook} from '../../Workbook'; +import {isSingleCell} from '../../io/excel/util/Range'; +import {numberToLetters} from '../../io/excel/util/numberToLetters'; +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; +import {CellData, updateValue} from '../../types/worksheet/CellData'; +import {Input} from '../ui/Input'; + +export class FormulaBar { + dom: HTMLElement; + + /** + * 左侧的单元格名称 + */ + nameBox?: HTMLElement; + + /** + * 右侧的输入框 + */ + textBox?: HTMLElement; + + workbook: Workbook; + + textInput: Input; + + cellData?: CellData; + + constructor( + dom: HTMLElement, + workbook: Workbook, + renderOptions: ExcelRenderOptions + ) { + this.dom = dom; + this.workbook = workbook; + + if (!renderOptions.showFormulaBar) { + return; + } + + this.initDom(); + workbook.uiEvent.on('SWITCH_SHEET', () => { + this.sync(); + }); + workbook.uiEvent.on('CHANGE_SELECTION', () => { + this.sync(); + }); + } + + initDom() { + const nameBox = H('div', { + className: 'ov-excel-formula-bar__name-box', + parent: this.dom + }); + this.nameBox = nameBox; + + const textBox = H('div', { + className: 'ov-excel-formula-bar__text-box', + parent: this.dom + }); + this.textBox = textBox; + + const textInput = new Input( + textBox, + '', + '', + value => { + this.changeCellValue(value); + }, + 'borderLess' + ); + this.textInput = textInput; + } + + getActiveCell() { + const currentSheet = this.workbook.getActiveSheet(); + const selection = currentSheet.getSelection(); + if (!selection) { + return null; + } + + return selection.activeCell; + } + + /** + * 同步 dom 节点 + */ + sync() { + const currentSheet = this.workbook.getActiveSheet(); + const activeCell = this.getActiveCell(); + if (!activeCell) { + return; + } + if (isSingleCell(activeCell) || currentSheet.isMergeCell(activeCell)) { + const cellInfo = this.workbook + .getActiveSheet() + .getCellInfo(activeCell.startRow, activeCell.startCol); + this.textInput.setValue(cellInfo.text); + this.cellData = currentSheet.getCellData( + activeCell.startRow, + activeCell.startCol + ); + } else { + this.textInput.setValue(''); + } + + this.nameBox!.innerText = `${numberToLetters(activeCell.startCol)}${ + activeCell.startRow + 1 + }`; + } + + changeCellValue(value: string) { + const currentSheet = this.workbook.getActiveSheet(); + const activeCell = this.getActiveCell(); + if (!activeCell) { + return; + } + if (isSingleCell(activeCell) || currentSheet.isMergeCell(activeCell)) { + currentSheet.updateCellValue( + activeCell.startRow, + activeCell.startCol, + updateValue(value, this.cellData) + ); + + this.workbook.uiEvent.emit( + 'UPDATE_RANGE', + currentSheet.getIndex(), + activeCell + ); + } + } +} diff --git a/packages/office-viewer/src/excel/render/grid/drawGridLines.ts b/packages/office-viewer/src/excel/render/grid/drawGridLines.ts new file mode 100644 index 000000000..107eb2b8d --- /dev/null +++ b/packages/office-viewer/src/excel/render/grid/drawGridLines.ts @@ -0,0 +1,62 @@ +import {GridLineOptions} from '../../sheet/ExcelRenderOptions'; +import {Sheet} from '../../sheet/Sheet'; +import {ViewRange} from '../../sheet/ViewRange'; +import {SheetCanvas, Line} from '../SheetCanvas'; + +/** + * 生成网格线 + */ +export function generateGridLines( + currentSheet: Sheet, + viewRange: ViewRange, + width: number, + height: number +) { + const {rows, rowSizes, cols, colSizes} = viewRange; + + const lines: Line[] = []; + + // 水平线 + for (let index = 0; index < rows.length; index++) { + let currentRowOffset = rowSizes[index].offset; + lines.push({ + x1: 0, + y1: currentRowOffset, + x2: width, + y2: currentRowOffset + }); + } + + // 垂直线 + for (let index = 0; index < cols.length; index++) { + let currentColOffset = colSizes[index].offset; + lines.push({ + x1: currentColOffset, + y1: 0, + x2: currentColOffset, + y2: height + }); + } + + return lines; +} + +/** + * 绘制网格线 + */ +export function drawGridLines( + currentSheet: Sheet, + viewRange: ViewRange, + canvas: SheetCanvas, + height: number, + width: number, + gridLineOptions: GridLineOptions +) { + if (!currentSheet.showGridLines()) { + return; + } + + const lines = generateGridLines(currentSheet, viewRange, width, height); + + canvas.drawLines(lines, gridLineOptions.gridLineColor); +} diff --git a/packages/office-viewer/src/excel/render/header/drawRowColHeaders.ts b/packages/office-viewer/src/excel/render/header/drawRowColHeaders.ts new file mode 100644 index 000000000..6d5144354 --- /dev/null +++ b/packages/office-viewer/src/excel/render/header/drawRowColHeaders.ts @@ -0,0 +1,198 @@ +import {numberToLetters} from '../../io/excel/util/numberToLetters'; +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; +import {Sheet} from '../../sheet/Sheet'; +import {ViewRange} from '../../sheet/ViewRange'; +import {FontSize} from '../../types/FontSize'; +import {FontStyle} from '../../types/FontStyle'; +import {SheetCanvas} from '../SheetCanvas'; +import {genFontStr} from '../cell/genFontStr'; + +/** + * 绘制行列的表头 + */ +export function drawRowColHeaders( + currentSheet: Sheet, + viewRange: ViewRange, + sheetCanvas: SheetCanvas, + renderOptions: ExcelRenderOptions, + defaultFontSize: FontSize, + defaultFontStyle: FontStyle +) { + const {rows, startRowOffset, height, width, cols, startColOffset} = viewRange; + + const {rowHeaderWidth, colHeaderHeight} = currentSheet.getRowColSize(); + + const { + gridLineColor, + rowColHeadersBackgroundColor: rowColHeadersBgColor, + hiddenRowColHeadersLineColor + } = renderOptions; + + let currentRowOffset = startRowOffset; + + // 竖向的背景 + sheetCanvas.drawRect(0, 0, rowHeaderWidth, height, rowColHeadersBgColor); + + const font = genFontStr(defaultFontStyle); + const color = renderOptions.rowColHeadersColor; + + let hasHiddenRow = false; + // 绘制竖向的线表头 + for (let i of rows) { + // 绘制竖向的文字 + const rowHeight = currentSheet.getRowHeight(i); + + // 为零就代表隐藏,标记一下 + if (rowHeight === 0) { + hasHiddenRow = true; + continue; + } + + // 横向的线 + const lineY = currentRowOffset + colHeaderHeight; + sheetCanvas.drawLine( + { + x1: 0, + y1: lineY, + x2: rowHeaderWidth, + y2: lineY + }, + gridLineColor + ); + + // 如果有隐藏内容的情况 + if (hasHiddenRow) { + // 重置一下 + hasHiddenRow = false; + sheetCanvas.drawLine( + { + x1: 0, + y1: lineY, + x2: rowHeaderWidth, + y2: lineY + }, + hiddenRowColHeadersLineColor, + 3 + ); + } else { + sheetCanvas.drawLine( + { + x1: 0, + y1: lineY, + x2: rowHeaderWidth, + y2: lineY + }, + gridLineColor + ); + } + + const textSize = String(i + 1).length; + const textWidth = textSize * defaultFontSize.width; + + sheetCanvas.drawText( + font, + color, + String(i + 1), + (rowHeaderWidth - textWidth) / 2, + currentRowOffset + + (rowHeight - defaultFontSize.height) / 2 + + colHeaderHeight, + 'top' + ); + + currentRowOffset += rowHeight; + } + + // 绘制最左侧的线,目前 office 365 是不绘制的 + // sheetCanvas.drawLine( + // { + // x1: 0, + // y1: 0, + // x2: 0, + // y2: currentRowOffset + colHeaderHeight + // }, + // gridLineColor + // ); + + // 横向的背景 + sheetCanvas.drawRect(0, 0, width, colHeaderHeight, rowColHeadersBgColor); + + let currentColOffset = startColOffset; + + // 横向字体的 Y 坐标,这个是固定的 + const colTextY = (colHeaderHeight - defaultFontSize.height) / 2; + + // 绘制横向的线表头 + // 上一个列的索引 + let lastColIndex = 0; + + for (let i of cols) { + const colWidth = currentSheet.getColWidth(i); + + // 竖向的线 + const lineX = currentColOffset + rowHeaderWidth; + + // 如果当前索引比上一个索引大 1 以上,就代表有隐藏的列 + const hasHiddenCol = i - lastColIndex > 1; + + if (hasHiddenCol) { + sheetCanvas.drawLine( + { + x1: lineX, + y1: 0, + x2: lineX, + y2: colHeaderHeight + }, + hiddenRowColHeadersLineColor, + 3 + ); + } else { + sheetCanvas.drawLine( + { + x1: lineX, + y1: 0, + x2: lineX, + y2: colHeaderHeight + }, + gridLineColor + ); + } + + // 绘制横向的文字 + const text = numberToLetters(i); + const textSize = text.length; + const textWidth = textSize * defaultFontSize.width; + + sheetCanvas.drawText( + font, + color, + text, + currentColOffset + (colWidth - textWidth) / 2 + rowHeaderWidth, + colTextY, + 'top' + ); + + currentColOffset += colWidth; + lastColIndex = i; + } + + // 绘制最上方的线,目前 office 365 是不绘制的 + // sheetCanvas.drawLine( + // { + // x1: 0, + // y1: 0, + // x2: currentColOffset + rowHeaderWidth, + // y2: 0 + // }, + // gridLineColor + // ); + + // 绘制左上角的背景,TODO: 这里还有别的设计,比如一个倒三角 + sheetCanvas.drawRect( + 0, + 0, + rowHeaderWidth, + colHeaderHeight, + rowColHeadersBgColor + ); +} diff --git a/packages/office-viewer/src/excel/render/keyboard/handleCopy.ts b/packages/office-viewer/src/excel/render/keyboard/handleCopy.ts new file mode 100644 index 000000000..e7566ab12 --- /dev/null +++ b/packages/office-viewer/src/excel/render/keyboard/handleCopy.ts @@ -0,0 +1,18 @@ +import {Workbook} from '../../Workbook'; +import {copySelection} from '../selection/copySelection'; + +/** + * 复制 + */ +export function handleCopy(e: KeyboardEvent, workbook: Workbook) { + if (e.metaKey || e.ctrlKey) { + // 全选 + if (e.key === 'a') { + console.log('SELECT ALL'); + } + // 复制 + if (e.key === 'c') { + copySelection(workbook); + } + } +} diff --git a/packages/office-viewer/src/excel/render/keyboard/handleKeydown.ts b/packages/office-viewer/src/excel/render/keyboard/handleKeydown.ts new file mode 100644 index 000000000..ae28e3403 --- /dev/null +++ b/packages/office-viewer/src/excel/render/keyboard/handleKeydown.ts @@ -0,0 +1,15 @@ +/** + * 处理键盘事件 + */ + +import {Workbook} from '../../Workbook'; + +import {handleCopy} from './handleCopy'; +import {handleSelectAll} from './handleSelectAll'; +import {handleSheetCanvasKeydown} from './handleSheetArrowKey'; + +export function handleKeydown(e: KeyboardEvent, workbook: Workbook) { + handleSelectAll(e, workbook); + handleCopy(e, workbook); + handleSheetCanvasKeydown(e, workbook); +} diff --git a/packages/office-viewer/src/excel/render/keyboard/handlePaste.ts b/packages/office-viewer/src/excel/render/keyboard/handlePaste.ts new file mode 100644 index 000000000..04ae0a986 --- /dev/null +++ b/packages/office-viewer/src/excel/render/keyboard/handlePaste.ts @@ -0,0 +1,18 @@ +import {Workbook} from '../../Workbook'; + +/** + * 粘贴时触发 + */ +export function handlePaste(e: ClipboardEvent, workbook: Workbook) { + const html = e.clipboardData?.getData('text/html'); + if (!html) { + return; + } + + const element = document.createElement('div'); + element.innerHTML = html; + + const trs = element.querySelectorAll('table tr'); + + // TODO: 将表格转成数据 +} diff --git a/packages/office-viewer/src/excel/render/keyboard/handleSelectAll.ts b/packages/office-viewer/src/excel/render/keyboard/handleSelectAll.ts new file mode 100644 index 000000000..0f6ba60e9 --- /dev/null +++ b/packages/office-viewer/src/excel/render/keyboard/handleSelectAll.ts @@ -0,0 +1,16 @@ +import {Workbook} from '../../Workbook'; +import {selectAll} from '../dnd/selectAll'; + +/** + * 复制 + */ +export function handleSelectAll(e: KeyboardEvent, workbook: Workbook) { + if (e.metaKey || e.ctrlKey) { + // 全选 + if (e.key === 'a') { + const sheetIndex = workbook.getActiveSheet().getIndex(); + workbook.uiEvent.emit('CHANGE_SELECTION', selectAll(sheetIndex)); + e.preventDefault(); + } + } +} diff --git a/packages/office-viewer/src/excel/render/keyboard/handleSheetArrowKey.ts b/packages/office-viewer/src/excel/render/keyboard/handleSheetArrowKey.ts new file mode 100644 index 000000000..c2a9885d4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/keyboard/handleSheetArrowKey.ts @@ -0,0 +1,46 @@ +import {Workbook} from '../../Workbook'; +import {MAX_COL, MAX_ROW} from '../Consts'; + +/** + * 在 sheet canvas 上的事件 + */ +export function handleSheetCanvasKeydown(e: KeyboardEvent, workbook: Workbook) { + const currentSheet = workbook.getActiveSheet(); + + const activeCell = currentSheet.selection?.activeCell; + + if (!activeCell) { + return; + } + + let changeActiveCell = false; + if (e.key === 'ArrowUp') { + activeCell.startRow = Math.max(0, activeCell.startRow - 1); + changeActiveCell = true; + } + + if (e.key === 'ArrowDown') { + activeCell.startRow = Math.min(MAX_ROW, activeCell.startRow + 1); + changeActiveCell = true; + } + + if (e.key === 'ArrowLeft') { + activeCell.startCol = Math.max(0, activeCell.startCol - 1); + changeActiveCell = true; + } + + if (e.key === 'ArrowRight') { + activeCell.startCol = Math.min(MAX_COL, activeCell.startCol + 1); + changeActiveCell = true; + } + + if (changeActiveCell) { + e.preventDefault(); + activeCell.endRow = activeCell.startRow; + activeCell.endCol = activeCell.startCol; + if (currentSheet.selection) { + currentSheet.selection.cellRanges = [activeCell]; + workbook.uiEvent.emit('CHANGE_SELECTION', currentSheet.selection); + } + } +} diff --git a/packages/office-viewer/src/excel/render/scroll/Scroll.ts b/packages/office-viewer/src/excel/render/scroll/Scroll.ts new file mode 100644 index 000000000..209eb01a8 --- /dev/null +++ b/packages/office-viewer/src/excel/render/scroll/Scroll.ts @@ -0,0 +1,7 @@ +/** + * 当前滚动条滚动的位置 + */ +export type Scroll = { + left: number; + top: number; +}; diff --git a/packages/office-viewer/src/excel/render/selection/Position.ts b/packages/office-viewer/src/excel/render/selection/Position.ts new file mode 100644 index 000000000..09eb378ca --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/Position.ts @@ -0,0 +1,9 @@ +/** + * 位置信息 + */ +export interface Position { + x: number; + y: number; + width: number; + height: number; +} diff --git a/packages/office-viewer/src/excel/render/selection/SheetSelection.ts b/packages/office-viewer/src/excel/render/selection/SheetSelection.ts new file mode 100644 index 000000000..e550ac1c4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/SheetSelection.ts @@ -0,0 +1,35 @@ +import {Region} from '../../sheet/ViewRange'; +import {RangeRef} from '../../types/RangeRef'; +import {HitTestResult} from './hitTest'; + +/** + * 选区定义,叫 SheetSelection 主要是为了避免和浏览器的 Selection 混淆 + */ +export type SheetSelection = { + selectType: HitTestResult['type']; + + /** + * 选区所在的 sheet 的区域信息 + */ + region: Region; + + /** + * 用户名 + */ + user: string; + + /** + * 当前选区所在的 sheet 索引 + */ + sheetIndex: number; + + /** + * 激活的单元格 + */ + activeCell: RangeRef; + + /** + * 选区,对应 sqref 属性 + */ + cellRanges: RangeRef[]; +}; diff --git a/packages/office-viewer/src/excel/render/selection/binarySearchSize.ts b/packages/office-viewer/src/excel/render/selection/binarySearchSize.ts new file mode 100644 index 000000000..8b197f0ab --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/binarySearchSize.ts @@ -0,0 +1,26 @@ +import {Size} from '../../sheet/ViewRange'; + +/** + * 二分查找到到 hitTest 的位置 + * @param sizes 位置信息 + * @param position 要查找的位置 + * @returns + */ +export function binarySearchSize(sizes: Size[], position: number) { + let found = -1; + let start = 0; + let end = sizes.length - 1; + while (start <= end) { + const mid = Math.floor((start + end) / 2); + const size = sizes[mid]; + if (size.offset <= position && size.offset + size.size > position) { + return mid; + } else if (size.offset < position) { + start = mid + 1; + } else { + end = mid - 1; + } + } + + return found; +} diff --git a/packages/office-viewer/src/excel/render/selection/buildHTML/buildBorder.ts b/packages/office-viewer/src/excel/render/selection/buildHTML/buildBorder.ts new file mode 100644 index 000000000..e1d60826a --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/buildHTML/buildBorder.ts @@ -0,0 +1,45 @@ +import {CT_BorderPr} from '../../../../openxml/ExcelTypes'; +import {IDataProvider} from '../../../types/IDataProvider'; +import {AUTO_COLOR} from '../../Consts'; + +/** + * 生成边框样式 + */ +export function buildBorder( + position: string, + border: CT_BorderPr, + dataProvider: IDataProvider +) { + let color = ''; + if (border.color) { + color = dataProvider.getColor(border.color, AUTO_COLOR); + } + let borderStyle = 'solid'; + + switch (border.style) { + case 'dashDot': + case 'dashDotDot': + case 'dashed': + case 'mediumDashed': + case 'mediumDashDot': + case 'mediumDashDotDot': + borderStyle = 'dashed'; + break; + + case 'dotted': + borderStyle = 'dotted'; + break; + + case 'double': + borderStyle = 'double'; + break; + + case 'none': + return ''; + } + + if (color && color !== 'none') { + return `${position}: 1px ${borderStyle} ${color}: `; + } + return ''; +} diff --git a/packages/office-viewer/src/excel/render/selection/buildHTML/cellInfoToStyle.ts b/packages/office-viewer/src/excel/render/selection/buildHTML/cellInfoToStyle.ts new file mode 100644 index 000000000..b799d7138 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/buildHTML/cellInfoToStyle.ts @@ -0,0 +1,80 @@ +import {Workbook} from '../../../Workbook'; +import {CellInfo} from '../../../types/CellInfo'; +import {getBackgroundColor} from '../../cell/getBackgroundColor'; +import {buildBorder} from './buildBorder'; + +/** + * 生成单元格样式 + */ +export function cellInfoToStyle(workbook: Workbook, cellInfo: CellInfo) { + let style = ''; + const dataProvider = workbook.getDataProvider(); + const fontStyle = dataProvider.getFontStyle(cellInfo.font); + if (fontStyle.b) { + style += 'font-weight: bold;'; + } + + if (fontStyle.i) { + style += 'font-style: italic;'; + } + + if (fontStyle.u === 'single') { + style += 'text-decoration: underline;'; + } + + if (fontStyle.strike) { + style += 'text-decoration: line-through;'; + } + + if (fontStyle.color) { + style += `color: ${fontStyle.color};`; + } + + if (fontStyle.size) { + style += `font-size: ${fontStyle.size}pt;`; + } + + if (fontStyle.family) { + style += `font-family: ${fontStyle.family};`; + } + + if (cellInfo.fill) { + const dataProvider = workbook.getDataProvider(); + const backgroundColor = getBackgroundColor(dataProvider, cellInfo.fill); + if (backgroundColor !== 'none') { + style += `background-color: ${backgroundColor};`; + } + } + + if (cellInfo.alignment) { + if (cellInfo.alignment.horizontal) { + style += `text-align: ${cellInfo.alignment.horizontal};`; + } + + if (cellInfo.alignment.vertical) { + style += `vertical-align: ${cellInfo.alignment.vertical};`; + } + } + + if (cellInfo.border) { + const dataProvider = workbook.getDataProvider(); + const border = cellInfo.border; + if (border.left) { + style += buildBorder('border-left', border.left, dataProvider); + } + + if (border.right) { + style += buildBorder('border-right', border.right, dataProvider); + } + + if (border.top) { + style += buildBorder('border-top', border.top, dataProvider); + } + + if (border.bottom) { + style += buildBorder('border-bottom', border.bottom, dataProvider); + } + } + + return style; +} diff --git a/packages/office-viewer/src/excel/render/selection/buildHTML/rangeToHTML.ts b/packages/office-viewer/src/excel/render/selection/buildHTML/rangeToHTML.ts new file mode 100644 index 000000000..1872606bb --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/buildHTML/rangeToHTML.ts @@ -0,0 +1,72 @@ +import {escapeHtml} from '../../../../util/escapeHTML'; +import {Workbook} from '../../../Workbook'; +import {RangeRef} from '../../../types/RangeRef'; +import {MAX_COL, MAX_ROW} from '../../Consts'; +import {cellToMergeCell} from '../../cell/cellToMergeCell'; +import {cellInfoToStyle} from './cellInfoToStyle'; + +/** + * 基于选区生成 HTML 表格 + * @param workbook + * @param range 选区定义 + */ +export function rangeToHTML(workbook: Workbook, range: RangeRef) { + const currentSheet = workbook.getActiveSheet(); + + let endRow = range.endRow; + if (endRow === MAX_ROW) { + endRow = currentSheet.getMaxRow(); + } + let endCol = range.endCol; + if (endCol === MAX_COL) { + endCol = currentSheet.getMaxCol(); + } + + const mergeCells = currentSheet.getMergeCells(); + + let tsv = []; + + let trs = ''; + for (let row = range.startRow; row <= endRow; row++) { + const rowHeight = currentSheet.getRowHeight(row); + trs += `\n`; + let tsvRow = []; + for (let col = range.startCol; col <= endCol; col++) { + const cellInfo = currentSheet.getCellInfo(row, col); + const mergeCell = cellToMergeCell(row, col, mergeCells); + const text = escapeHtml(cellInfo.text); + const style = cellInfoToStyle(workbook, cellInfo); + tsvRow.push(text); + // 如果有合并单元格则需要修改 col 跳过,同时只处理第一个出现的合并单元格 + if ( + mergeCell.startCol !== mergeCell.endCol && + row === mergeCell.startRow && + col === mergeCell.startCol + ) { + const rowSpan = mergeCell.endRow - mergeCell.startRow + 1; + const colSpan = mergeCell.endCol - mergeCell.startCol + 1; + col = mergeCell.endCol; + trs += ` ${text}\n`; + tsvRow.push(...Array(colSpan - 1).fill('')); + } else { + trs += ` ${text}\n`; + } + } + tsv.push(tsvRow.join('\t')); + trs += '\n'; + } + + // Excel 里粘贴出来也是这样的,似乎 Excel 自己也不支持粘贴时调整宽度,所以这个功能没效果 + let cols = ''; + for (let col = range.startCol; col <= endCol; col++) { + const colWidth = Math.floor(currentSheet.getColWidth(col)); + const widthPt = colWidth * 0.75; + cols += `\n`; + } + + // 参考从 Excel 粘贴来的内容 + const table = `\n${cols}${trs}
`; + + return {table, tsv}; +} diff --git a/packages/office-viewer/src/excel/render/selection/copySelection.ts b/packages/office-viewer/src/excel/render/selection/copySelection.ts new file mode 100644 index 000000000..df28e9019 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/copySelection.ts @@ -0,0 +1,30 @@ +import {Workbook} from '../../Workbook'; +import {rangeToHTML} from './buildHTML/rangeToHTML'; + +/** + * 复制选区,生成 HTML 表格数据 + * @param range 选区 + * @param mergeCells 合并单元格 + */ +export function copySelection(workbook: Workbook) { + const currentSheet = workbook.getActiveSheet(); + const selection = currentSheet.getSelection(); + if (!selection?.cellRanges) { + console.warn('没有 selection'); + return; + } + + if (selection.cellRanges.length === 0) { + return; + } + + const {tsv, table} = rangeToHTML(workbook, selection.cellRanges[0]); + + navigator.clipboard.write([ + new ClipboardItem({ + 'text/plain': new Blob([tsv.join('\n')], {type: 'text/plain'}), + 'text/html': new Blob([table], {type: 'text/html'}) + }) + ]); + workbook.uiEvent.emit('COPY_SELECTION'); +} diff --git a/packages/office-viewer/src/excel/render/selection/drawAllSelection.ts b/packages/office-viewer/src/excel/render/selection/drawAllSelection.ts new file mode 100644 index 000000000..f190d39f3 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/drawAllSelection.ts @@ -0,0 +1,31 @@ +import {Workbook} from '../../Workbook'; +import {Canvas} from '../Canvas'; +import {SheetSelection} from './SheetSelection'; +import {drawSelectionHeaderHighlight} from './drawSelectionHeaderHighlight'; + +/** + * 绘制全选的选区 + */ +export function drawAllSelection( + workbook: Workbook, + canvas: Canvas, + selection: SheetSelection +) { + const x = 0; + const y = 0; + const {width, height} = workbook.getViewpointSize(); + const renderOptions = workbook.renderOptions; + + // 绘制选中的单元格 + canvas.drawStrokeRect( + x, + y, + width, + height, + renderOptions.selectionBorderColor, + 2 + ); + + // 绘制选中区表头的高亮 + drawSelectionHeaderHighlight(workbook, canvas, x, y, width, height); +} diff --git a/packages/office-viewer/src/excel/render/selection/drawCellRanges.ts b/packages/office-viewer/src/excel/render/selection/drawCellRanges.ts new file mode 100644 index 000000000..23283b591 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/drawCellRanges.ts @@ -0,0 +1,35 @@ +import {Workbook} from '../../Workbook'; +import {Canvas} from '../Canvas'; +import {MAX_COL, MAX_ROW} from '../Consts'; +import {SheetSelection} from './SheetSelection'; +import {drawAllSelection} from './drawAllSelection'; +import {drawCellSelection} from './drawCellSelection'; +import {drawColSelection} from './drawColSelection'; +import {drawRowSelection} from './drawRowSelection'; + +/** + * 绘制选择区域 + * @param workbook + * @param canvas + * @param selection + */ +export function drawCellRanges( + workbook: Workbook, + canvas: Canvas, + selection: SheetSelection +) { + if (!selection) { + return; + } + for (const range of selection.cellRanges) { + if (range.endCol === MAX_COL && range.endRow === MAX_ROW) { + drawAllSelection(workbook, canvas, selection); + } else if (range.endCol === MAX_COL) { + drawRowSelection(workbook, canvas, selection, range); + } else if (range.endRow === MAX_ROW) { + drawColSelection(workbook, canvas, selection, range); + } else { + drawCellSelection(workbook, canvas, selection, range); + } + } +} diff --git a/packages/office-viewer/src/excel/render/selection/drawCellSelection.ts b/packages/office-viewer/src/excel/render/selection/drawCellSelection.ts new file mode 100644 index 000000000..d0a1986d1 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/drawCellSelection.ts @@ -0,0 +1,138 @@ +import {Workbook} from '../../Workbook'; +import {RangeRef} from '../../types/RangeRef'; +import {Canvas} from '../Canvas'; +import {SheetSelection} from './SheetSelection'; +import {drawSelectionHeaderHighlight} from './drawSelectionHeaderHighlight'; +import {getCellPosition, getCellPositionWithMerge} from './getCellPosition'; +import {getRangePosition} from './getRangePosition'; + +/** + * 绘制选中内容区域的高亮 + * @param workbook + * @param canvas + * @param selection + * @param range + * @returns + */ +export function drawCellSelection( + workbook: Workbook, + canvas: Canvas, + selection: SheetSelection, + range: RangeRef +) { + let {x, y, width, height} = getRangePosition( + workbook, + selection.region, + range + ); + + // 这种一般是超出显示区域 + if (width === 0 || height === 0) { + return; + } + const renderOptions = workbook.renderOptions; + + // 绘制选中的单元格 + canvas.drawStrokeRect( + x, + y, + width, + height, + renderOptions.selectionBorderColor, + 2 + ); + + const rightBottomStrokeSize = renderOptions.selectionSquareSize; + // 绘制选中单元格右下角的小方块 + canvas.drawStrokeRect( + x + width - rightBottomStrokeSize, + y + height - rightBottomStrokeSize, + rightBottomStrokeSize * 2, + rightBottomStrokeSize * 2, + '#FFFFFF', + 1 + ); + const rightBottomRectSize = rightBottomStrokeSize - 1; + + const padding = 1; + // 绘制内容部分的颜背景色 + canvas.drawAlphaRectPadding( + x, + y, + width, + height, + padding, + renderOptions.selectionBackgroundColor, + renderOptions.selectionBackgroundOpacity + ); + + // 清除一下选中区域的背景色,这里的加一减一主要是为了避免覆盖边框 + // 这里要判断 activeCell 所在位置来决定是加 padding 还是减 padding + const activeCell = selection.activeCell; + let paddingX = 0; + let paddingY = 0; + // 如果在左上角,x 和 y 都要加 padding + if ( + activeCell.startCol === range.startCol && + activeCell.startRow === range.startRow + ) { + paddingX = padding; + paddingY = padding; + } else if ( + activeCell.endCol === range.endCol && + activeCell.endRow === range.endRow + ) { + // 如果在右下角,x 和 y 都要加 padding + paddingX = padding; + paddingY = padding; + // 如果只有一列 + if (range.startCol === range.endCol) { + paddingX = padding; + } + // 如果只有一行 + if (range.startRow === range.endRow) { + paddingY = padding; + } + } else if ( + activeCell.startCol === range.startCol && + activeCell.endRow === range.endRow + ) { + // 如果在左下角,x 加 padding,y 减 padding + paddingX = padding; + paddingY = -padding; + } else if ( + // 如果在右上角,x 加 padding,y 加 padding + activeCell.endCol === range.endCol && + activeCell.startRow === range.startRow + ) { + paddingX = padding; + paddingY = padding; + } + + const activeCellPosition = getCellPositionWithMerge( + workbook.getActiveSheet(), + selection.region, + activeCell.startCol, + activeCell.startRow + ); + if (activeCellPosition) { + canvas.clearRect( + activeCellPosition.x + paddingX, + activeCellPosition.y + paddingY, + activeCellPosition.width - 2 * padding, + activeCellPosition.height - 2 * padding + ); + } + + // 绘制选中单元格右下角的小方块 + canvas.drawRect( + x + width - rightBottomRectSize, + y + height - rightBottomRectSize, + rightBottomRectSize * 2, + rightBottomRectSize * 2, + renderOptions.selectionBorderColor + ); + + // 绘制选中区表头的高亮 + drawSelectionHeaderHighlight(workbook, canvas, x, y, width, height); +} diff --git a/packages/office-viewer/src/excel/render/selection/drawColSelection.ts b/packages/office-viewer/src/excel/render/selection/drawColSelection.ts new file mode 100644 index 000000000..d2dfd64f4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/drawColSelection.ts @@ -0,0 +1,41 @@ +import {Workbook} from '../../Workbook'; +import {RangeRef} from '../../types/RangeRef'; +import {Canvas} from '../Canvas'; +import {SheetSelection} from './SheetSelection'; +import {drawSelectionHeaderHighlight} from './drawSelectionHeaderHighlight'; +import {getRangePosition} from './getRangePosition'; + +/** + * 绘制选择整列的选框 + * @param workbook + * @param canvas + * @param selection + * @param range + */ + +export function drawColSelection( + workbook: Workbook, + canvas: Canvas, + selection: SheetSelection, + range: RangeRef +) { + let {x, y, width, height} = getRangePosition( + workbook, + selection.region, + range + ); + const renderOptions = workbook.renderOptions; + + // 绘制选中的单元格 + canvas.drawStrokeRect( + x, + y, + width, + height, + renderOptions.selectionBorderColor, + 2 + ); + + // 绘制选中区表头的高亮 + drawSelectionHeaderHighlight(workbook, canvas, x, y, width, height); +} diff --git a/packages/office-viewer/src/excel/render/selection/drawRowSelection.ts b/packages/office-viewer/src/excel/render/selection/drawRowSelection.ts new file mode 100644 index 000000000..e19d820d4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/drawRowSelection.ts @@ -0,0 +1,43 @@ +/** + * 绘制选择整行的选框 + * @param workbook + * @param canvas + * @param selection + * @param range + */ + +import {Workbook} from '../../Workbook'; +import {RangeRef} from '../../types/RangeRef'; +import {Canvas} from '../Canvas'; +import {SheetSelection} from './SheetSelection'; +import {drawSelectionHeaderHighlight} from './drawSelectionHeaderHighlight'; +import {getRangePosition} from './getRangePosition'; + +export function drawRowSelection( + workbook: Workbook, + canvas: Canvas, + selection: SheetSelection, + range: RangeRef +) { + let {x, y, width, height} = getRangePosition( + workbook, + selection.region, + range + ); + + console.log('drawRowSelection', x, y, width, height, range); + const renderOptions = workbook.renderOptions; + + // 绘制选中的单元格 + canvas.drawStrokeRect( + x, + y, + width, + height, + renderOptions.selectionBorderColor, + 2 + ); + + // 绘制选中区表头的高亮 + drawSelectionHeaderHighlight(workbook, canvas, x, y, width, height); +} diff --git a/packages/office-viewer/src/excel/render/selection/drawSelectionHeaderHighlight.ts b/packages/office-viewer/src/excel/render/selection/drawSelectionHeaderHighlight.ts new file mode 100644 index 000000000..7828b0e20 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/drawSelectionHeaderHighlight.ts @@ -0,0 +1,39 @@ +import {Workbook} from '../../Workbook'; +import {Canvas} from '../Canvas'; + +/** + * 绘制选中区表头的高亮 + */ +export function drawSelectionHeaderHighlight( + workbook: Workbook, + canvas: Canvas, + x: number, + y: number, + width: number, + height: number +) { + const {rowHeaderWidth, colHeaderHeight} = workbook + .getActiveSheet() + .getRowColSize(); + const renderOptions = workbook.renderOptions; + if (rowHeaderWidth > 0 && colHeaderHeight > 0) { + // 绘制上方表头的高亮 + canvas.drawAlphaRect( + x, + 0, + width, + colHeaderHeight, + renderOptions.selectionBackgroundColor, + renderOptions.selectionBackgroundOpacity + ); + // 绘制左侧表头的高亮 + canvas.drawAlphaRect( + 0, + y, + rowHeaderWidth, + height, + renderOptions.selectionBackgroundColor, + renderOptions.selectionBackgroundOpacity + ); + } +} diff --git a/packages/office-viewer/src/excel/render/selection/findCell.ts b/packages/office-viewer/src/excel/render/selection/findCell.ts new file mode 100644 index 000000000..8f3815407 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/findCell.ts @@ -0,0 +1,37 @@ +import {Region, ViewRange} from '../../sheet/ViewRange'; +import {RangeRef} from '../../types/RangeRef'; +import {cellToMergeCell} from '../cell/cellToMergeCell'; +import {findInViewRange} from './findInViewRange'; +import {HitTestResult} from './hitTest'; + +/** + * 查找单元格 + */ +export function findCell( + region: Region, + offsetX: number, + offsetY: number, + gridLineHitRange: number, + viewRange: ViewRange, + mergeCells: RangeRef[] +): HitTestResult { + // 节点,也可能返回合并单元格 + const {row, col, x, y, width, height} = findInViewRange( + offsetX, + offsetY, + gridLineHitRange, + viewRange + ); + const mergeCell = cellToMergeCell(row, col, mergeCells); + return { + type: 'cell', + region, + ...mergeCell, + realCol: col, + realRow: row, + x, + y, + width, + height + }; +} diff --git a/packages/office-viewer/src/excel/render/selection/findInViewRange.ts b/packages/office-viewer/src/excel/render/selection/findInViewRange.ts new file mode 100644 index 000000000..0c2957568 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/findInViewRange.ts @@ -0,0 +1,18 @@ +import {ViewRange} from '../../sheet/ViewRange'; +import {findInViewRangeX} from './findInViewRangeX'; +import {findInViewRangeY} from './findInViewRangeY'; + +/** + * 在视图范围内查找 + */ +export function findInViewRange( + offsetX: number, + offsetY: number, + gridLineHitRange: number, + viewRange: ViewRange +) { + return { + ...findInViewRangeX(offsetX, viewRange, gridLineHitRange), + ...findInViewRangeY(offsetY, viewRange, gridLineHitRange) + }; +} diff --git a/packages/office-viewer/src/excel/render/selection/findInViewRangeX.ts b/packages/office-viewer/src/excel/render/selection/findInViewRangeX.ts new file mode 100644 index 000000000..78882954f --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/findInViewRangeX.ts @@ -0,0 +1,47 @@ +import {ViewRange} from '../../sheet/ViewRange'; +import {binarySearchSize} from './binarySearchSize'; +import {HitTestResult} from './hitTest'; + +/** + * 在视图范围水平方向内查找 + */ +export function findInViewRangeX( + offsetX: number, + viewRange: ViewRange, + gridLineHitRange: number, + // 是否在是 header 区域 + isHeader: boolean = false +) { + let x = 0; + let width = 0; + let colIndex = binarySearchSize(viewRange.colSizes, offsetX); + let col = -1; + // 点到线上还是点到单元格上 + let type: HitTestResult['type'] = 'cell'; + if (isHeader) { + type = 'col-header'; + } + + if (colIndex !== -1) { + x = viewRange.colSizes[colIndex].offset; + width = viewRange.colSizes[colIndex].size; + col = viewRange.cols[colIndex]; + if (isHeader) { + // 点到了顶部单元格 + if (x + width - offsetX < gridLineHitRange) { + type = 'col-grid'; + } + // 点到了左边的线 + if (offsetX - x < gridLineHitRange) { + type = 'col-grid'; + if (colIndex > 0) { + x = viewRange.colSizes[colIndex - 1].offset; + width = viewRange.colSizes[colIndex - 1].size; + col = viewRange.cols[colIndex - 1]; + } + } + } + } + + return {col, x, width, type}; +} diff --git a/packages/office-viewer/src/excel/render/selection/findInViewRangeY.ts b/packages/office-viewer/src/excel/render/selection/findInViewRangeY.ts new file mode 100644 index 000000000..dfed9e6fe --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/findInViewRangeY.ts @@ -0,0 +1,46 @@ +import {ViewRange} from '../../sheet/ViewRange'; +import {binarySearchSize} from './binarySearchSize'; +import {HitTestResult} from './hitTest'; + +/** + * 在视图范围垂直方向内查找 + */ +export function findInViewRangeY( + offsetY: number, + viewRange: ViewRange, + gridLineHitRange: number, + // 是否在是 header 区域 + isHeader: boolean = false +) { + let y = 0; + let height = 0; + let rowIndex = binarySearchSize(viewRange.rowSizes, offsetY); + // 点到线上还是点到单元格上 + let type: HitTestResult['type'] = 'cell'; + if (isHeader) { + type = 'row-header'; + } + + let row = -1; + if (rowIndex !== -1) { + y = viewRange.rowSizes[rowIndex].offset; + height = viewRange.rowSizes[rowIndex].size; + row = viewRange.rows[rowIndex]; + if (isHeader) { + if (y + height - offsetY < gridLineHitRange) { + type = 'row-grid'; + } + // 点到了上边的线 + if (offsetY - y < gridLineHitRange) { + type = 'row-grid'; + if (rowIndex > 0) { + y = viewRange.rowSizes[rowIndex - 1].offset; + height = viewRange.rowSizes[rowIndex - 1].size; + row = viewRange.rows[rowIndex - 1]; + } + } + } + } + + return {row, y, height, type}; +} diff --git a/packages/office-viewer/src/excel/render/selection/getCellPosition.ts b/packages/office-viewer/src/excel/render/selection/getCellPosition.ts new file mode 100644 index 000000000..e7ce3cdf2 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/getCellPosition.ts @@ -0,0 +1,178 @@ +/** + * 获取单元格的位置信息 + */ + +import {binarySearch} from '../../../util/binarySearch'; + +import {Position} from './Position'; +import {Sheet} from '../../sheet/Sheet'; +import {Region, ViewRange} from '../../sheet/ViewRange'; + +/** + * 在 viewRange 内查找到 col 的位置 + */ +function findColInViewRange(col: number, viewRange: ViewRange | null) { + if (!viewRange) { + return null; + } + + let colIndex = binarySearch(viewRange.cols, col); + + if (colIndex !== -1) { + return { + x: viewRange.colSizes[colIndex].offset, + width: viewRange.colSizes[colIndex].size + }; + } + + return null; +} + +/** + * 在 viewRange 内查找到 row 的位置 + */ +function findRowInViewRange(row: number, viewRange: ViewRange | null) { + if (!viewRange) { + return null; + } + let rowIndex = binarySearch(viewRange.rows, row); + + if (rowIndex !== -1) { + return { + y: viewRange.rowSizes[rowIndex].offset, + height: viewRange.rowSizes[rowIndex].size + }; + } + + return null; +} + +/** + * 获取单元格的行位置 + */ +export function getCellRowPosition(sheet: Sheet, region: Region, row: number) { + const viewRange = sheet.getViewRange(); + const frozenViewRange = sheet.getFrozenViewRange(); + if (region === 'normal' && viewRange) { + return findRowInViewRange(row, viewRange); + } + + if (region === 'top-left-frozen' && frozenViewRange) { + return findRowInViewRange(row, frozenViewRange.topLeftViewRange); + } + + if (region === 'left-frozen' && frozenViewRange) { + return findRowInViewRange(row, frozenViewRange.leftViewRange); + } + + if (region === 'top-frozen' && frozenViewRange) { + return findRowInViewRange(row, frozenViewRange.topViewRange); + } + + return null; +} + +/** + * 获取单元格的列位置 + */ +export function getCellColPosition(sheet: Sheet, region: Region, col: number) { + const viewRange = sheet.getViewRange(); + const frozenViewRange = sheet.getFrozenViewRange(); + + if (region === 'normal' && viewRange) { + return findColInViewRange(col, viewRange); + } + if (region === 'top-left-frozen' && frozenViewRange) { + return findColInViewRange(col, frozenViewRange.topLeftViewRange); + } + + if (region === 'left-frozen' && frozenViewRange) { + return findColInViewRange(col, frozenViewRange.leftViewRange); + } + + if (region === 'top-frozen' && frozenViewRange) { + return findColInViewRange(col, frozenViewRange.topViewRange); + } + + return null; +} + +/** + * 获取某个单元格的位置信息 + * @param sheet 工作表 + * @param region 区域 + * @param col 行 + * @param row 列 + * @returns + */ +export function getCellPosition( + sheet: Sheet, + region: Region, + col: number, + row: number +): Position | null { + const colPosition = getCellColPosition(sheet, region, col); + const rowPosition = getCellRowPosition(sheet, region, row); + + if (colPosition && rowPosition) { + return { + x: colPosition.x, + y: rowPosition.y, + width: colPosition.width, + height: rowPosition.height + }; + } + + return null; +} + +/** + * 获取某个单元格的位置信息,但考虑了合并单元格的情况 + * @param workbook 工作簿 + * @param region 区域 + * @param col 行 + * @param row 列 + * @returns + */ +export function getCellPositionWithMerge( + sheet: Sheet, + region: Region, + col: number, + row: number +) { + const colPosition = getCellColPosition(sheet, region, col); + const rowPosition = getCellRowPosition(sheet, region, row); + + const mergeCells = sheet.getMergeCells(); + + if (colPosition && rowPosition) { + for (const mergeCell of mergeCells) { + const {startRow, endRow, startCol, endCol} = mergeCell; + if ( + row >= startRow && + row <= endRow && + col >= startCol && + col <= endCol + ) { + for (let i = startRow; i <= endRow; i++) { + if (i !== row) { + rowPosition.height += sheet.getRowHeight(i); + } + } + for (let i = startCol; i <= endCol; i++) { + if (i !== col) { + colPosition.width += sheet.getColWidth(i); + } + } + } + } + return { + x: colPosition.x, + y: rowPosition.y, + width: colPosition.width, + height: rowPosition.height + }; + } + + return null; +} diff --git a/packages/office-viewer/src/excel/render/selection/getRangePosition.ts b/packages/office-viewer/src/excel/render/selection/getRangePosition.ts new file mode 100644 index 000000000..6a48bdace --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/getRangePosition.ts @@ -0,0 +1,97 @@ +import {Workbook} from '../../Workbook'; +import {Region} from '../../sheet/ViewRange'; + +import {RangeRef} from '../../types/RangeRef'; +import {MAX_COL, MAX_ROW} from '../Consts'; + +import {getCellRowPosition, getCellColPosition} from './getCellPosition'; + +/** + * 算出选中区域的位置信息 + */ +export function getRangePosition( + workbook: Workbook, + region: Region, + cellRange: RangeRef +) { + const activeSheet = workbook.getActiveSheet(); + // 获取开始位置,如果找不到就当成 0 + let startX = 0; + const startColPosition = getCellColPosition( + activeSheet, + region, + cellRange.startCol + ); + if (startColPosition) { + startX = startColPosition.x; + } + let startY = 0; + const startRowPosition = getCellRowPosition( + activeSheet, + region, + cellRange.startRow + ); + if (startRowPosition) { + startY = startRowPosition.y; + } + // TODO: 目前还有一种情况没测过,就是当选取大于显示范围的时候 + const {width, height} = workbook.getViewpointSize(); + // 如果找不到就当成最大值 + let endX = 0; + let endY = 0; + let endWidth = 0; + let endHeight = 0; + const endRowPosition = getCellRowPosition( + activeSheet, + region, + cellRange.endRow + ); + if (endRowPosition) { + endY = endRowPosition.y; + endHeight = endRowPosition.height; + } + + if (cellRange.endRow === MAX_ROW) { + endY = height; + // 随便有个值就行 + endHeight = 1; + } + + const endColPosition = getCellColPosition( + activeSheet, + region, + cellRange.endCol + ); + if (endColPosition) { + endX = endColPosition.x; + endWidth = endColPosition.width; + } + + if (cellRange.endCol === MAX_COL) { + endX = width; + // 随便有个值就行 + endWidth = 1; + } + + // 全都找不到意味着在显示范围外了 + if ( + !startColPosition && + !startRowPosition && + !endRowPosition && + !endColPosition + ) { + return { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + + return { + x: startX, + y: startY, + width: endX + endWidth - startX, + height: endY + endHeight - startY + }; +} diff --git a/packages/office-viewer/src/excel/render/selection/hitTest.ts b/packages/office-viewer/src/excel/render/selection/hitTest.ts new file mode 100644 index 000000000..2b656e8a5 --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/hitTest.ts @@ -0,0 +1,143 @@ +import {RangeRef} from '../../types/RangeRef'; +import {FrozenViewRange} from '../cell/frozen/drawFrozen'; +import {Position} from './Position'; +import {hitTestInRange} from './hitTestInRange'; +import {CellInfo} from '../../types/CellInfo'; +import { + IAbsoluteAnchor, + IOneCellAnchor, + ITwoCellAnchor +} from '../../types/IDrawing'; +import {Region, ViewRange} from '../../sheet/ViewRange'; + +export type HitTestCommon = Position & RangeRef; + +/** + * 点击到表头的最左上角 + */ +export type HitTestResult = HitTestCommon & { + /** + * 点击到的类型 + */ + type: + | 'drawing' // 图形,包括图片、图表、文本框 + | 'corner' // 最左上角的角落,全选所有数据 + | 'cell' // 单元格 + | 'row-header' // 左侧 header + | 'col-header' // 顶部 header + | 'row-grid' // 左侧 header 的网格线 + | 'col-grid'; // 顶部 header 的网格线 + /** + * 点击到的区域 + */ + region: Region; + + /** + * 点到图形 + */ + drawing?: IOneCellAnchor | ITwoCellAnchor | IAbsoluteAnchor; + + /** + * 点击到的单元格信息,这个不受合并单元格的影响 + */ + realRow?: number; + + /** + * 点击到的单元格信息,这个不受合并单元格的影响 + */ + realCol?: number; +}; + +/** + * 判断当前点击位置下是什么 + * @param offsetX 鼠标点击的 x 坐标 + * @param offsetY 鼠标点击的 y 坐标 + * @param rowHeaderWidth 表头行高 + * @param colHeaderHeight 表头列宽 + * @param viewRange 内容显示区的范围 + * @param frozenViewRange 冻结区域的范围 + */ +export function hitTest( + offsetX: number, + offsetY: number, + rowHeaderWidth: number, + colHeaderHeight: number, + gridLineHitRange: number, + viewRange: ViewRange | undefined, + frozenViewRange: FrozenViewRange | undefined, + mergeCells: RangeRef[] +): HitTestResult | null { + // 点击到表头左上角,这个行为是选中所有行和列 + if (offsetX < rowHeaderWidth && offsetY < colHeaderHeight) { + return { + type: 'corner', + region: 'normal', + startRow: 0, + startCol: 0, + endCol: 0, + endRow: 0, + x: 0, + y: 0, + width: rowHeaderWidth, + height: colHeaderHeight + }; + } + + if (frozenViewRange) { + const {topViewRange, leftViewRange, topLeftViewRange} = frozenViewRange; + + const hitTestTopLeft = hitTestInRange( + 'top-left-frozen', + topLeftViewRange, + offsetX, + offsetY, + rowHeaderWidth, + colHeaderHeight, + gridLineHitRange, + mergeCells + ); + if (hitTestTopLeft) { + return hitTestTopLeft; + } + + const hitTestLeft = hitTestInRange( + 'left-frozen', + leftViewRange, + offsetX, + offsetY, + rowHeaderWidth, + colHeaderHeight, + gridLineHitRange, + mergeCells + ); + + if (hitTestLeft) { + return hitTestLeft; + } + + const hitTestTop = hitTestInRange( + 'top-frozen', + topViewRange, + offsetX, + offsetY, + rowHeaderWidth, + colHeaderHeight, + gridLineHitRange, + mergeCells + ); + if (hitTestTop) { + return hitTestTop; + } + } + + return hitTestInRange( + 'normal', + viewRange, + offsetX, + offsetY, + rowHeaderWidth, + colHeaderHeight, + gridLineHitRange, + mergeCells + ); +} diff --git a/packages/office-viewer/src/excel/render/selection/hitTestInRange.ts b/packages/office-viewer/src/excel/render/selection/hitTestInRange.ts new file mode 100644 index 000000000..dee42a93a --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/hitTestInRange.ts @@ -0,0 +1,92 @@ +import {Region, ViewRange} from '../../sheet/ViewRange'; +import {RangeRef} from '../../types/RangeRef'; +import {MAX_COL, MAX_ROW} from '../Consts'; +import {findCell} from './findCell'; + +import {findInViewRangeX} from './findInViewRangeX'; +import {findInViewRangeY} from './findInViewRangeY'; +import {HitTestResult} from './hitTest'; + +/** + * 检查是否点中了左上角冻结区域 + */ +export function hitTestInRange( + region: Region, + range: ViewRange | undefined | null, + offsetX: number, + offsetY: number, + rowHeaderWidth: number, + colHeaderHeight: number, + gridLineHitRange: number, + mergeCells: RangeRef[] +): HitTestResult | null { + if (!range) { + return null; + } + + // 点击到顶部区域的表头 + if ( + offsetY < colHeaderHeight && + offsetX >= rowHeaderWidth && + offsetX < range.width + ) { + const {col, width, x, type} = findInViewRangeX( + offsetX, + range, + gridLineHitRange, + true + ); + return { + type, + region, + startRow: 0, + startCol: col, + endRow: MAX_ROW, + endCol: col, + x, + y: 0, + width, + height: colHeaderHeight + }; + } + + // 点击到左侧区域的表头 + if ( + offsetX < rowHeaderWidth && + offsetY >= colHeaderHeight && + offsetY < range.height + ) { + const {row, height, y, type} = findInViewRangeY( + offsetY, + range, + gridLineHitRange, + true + ); + return { + type, + region, + startRow: row, + startCol: 0, + endRow: row, + endCol: MAX_COL, + x: 0, + y, + width: rowHeaderWidth, + height + }; + } + + // 点击单元格 + if (offsetX < range.width && offsetY < range.height) { + return findCell( + region, + offsetX, + offsetY, + gridLineHitRange, + range, + mergeCells + ); + } + + return null; +} diff --git a/packages/office-viewer/src/excel/render/selection/updateCursor.ts b/packages/office-viewer/src/excel/render/selection/updateCursor.ts new file mode 100644 index 000000000..824c2fa5c --- /dev/null +++ b/packages/office-viewer/src/excel/render/selection/updateCursor.ts @@ -0,0 +1,29 @@ +const CURSOR_MAP = { + 'drawing': 'default', + 'cell': 'cell', + 'row-header': 'e-resize', + 'row-grid': 'row-resize', + 'col-header': 's-resize', + 'col-grid': 'col-resize', + 'corner': 'cell' +}; + +import {HitTestResult} from './hitTest'; + +/** + * 根据 hitTest 结果更新鼠标样式 + */ + +export function updateCursor( + container: HTMLElement, + hitTestResult: HitTestResult | null, + pointerOnLink: boolean | string +) { + if (hitTestResult && hitTestResult.type in CURSOR_MAP) { + container.style.cursor = CURSOR_MAP[hitTestResult.type]; + + if (pointerOnLink) { + container.style.cursor = 'pointer'; + } + } +} diff --git a/packages/office-viewer/src/excel/render/sheetTab/SheetList.ts b/packages/office-viewer/src/excel/render/sheetTab/SheetList.ts new file mode 100644 index 000000000..d9682c03d --- /dev/null +++ b/packages/office-viewer/src/excel/render/sheetTab/SheetList.ts @@ -0,0 +1,333 @@ +import {H} from '../../../util/H'; +import {Color} from '../../../util/color'; +import {onClickOutside} from '../../../util/onClickOutside'; +import {Workbook} from '../../Workbook'; +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; +import {Icons} from '../Icons'; + +const activeTabClass = 'ov-excel-sheet-tab-bar__list-tab--active'; + +const iconEnableClass = 'ov-excel-sheet-tab-bar__nav-icon--enabled'; + +const menuListActiveClass = 'ov-excel-sheet-tab-bar__menu-list-item--active'; + +/** + * Sheet 列表 + */ +export class SheetList { + sheetTabs: HTMLElement[] = []; + + sheetMenuItems: HTMLElement[] = []; + + workbook: Workbook; + + sheetMenu: HTMLElement; + + sheetListContainer: HTMLElement; + + sheetList: HTMLElement; + + // 水平滚动距离 + scrollLeft = 0; + + // sheet 内容总长度,由于宽度 list 宽度设置为 0 导致这里需要重新计算 + sheetListWidth = 0; + + leftNav: HTMLElement; + + rightNav: HTMLElement; + + constructor( + container: HTMLElement, + workbook: Workbook, + renderOptions: ExcelRenderOptions + ) { + this.workbook = workbook; + this.initDOM(container); + + workbook.uiEvent.on('SWITCH_SHEET', () => { + this.updateActiveTab(); + }); + + this.updateActiveTab(); + } + + initDOM(container: HTMLElement) { + this.renderNav(container); + this.renderSheetMenu(container); + const sheetListContainer = H('div', { + className: 'ov-excel-sheet-tab-bar__list-container', + parent: container + }); + + this.sheetListContainer = sheetListContainer; + + const sheetList = H('div', { + className: 'ov-excel-sheet-tab-bar__list', + parent: sheetListContainer + }); + this.sheetList = sheetList; + + sheetListContainer.addEventListener('wheel', e => { + this.handleWheel(e); + }); + + this.renderSheets(sheetList, true); + } + + renderSheetMenu(container: HTMLElement) { + const sheetMenu = H('div', { + className: 'ov-excel-sheet-tab-bar__menu', + parent: container + }); + this.sheetMenu = sheetMenu; + this.renderSheetMenuList(sheetMenu); + } + + renderSheetMenuList(sheetMenu: HTMLElement) { + this.sheetMenu.innerHTML = ''; + + const sheetMenuIcon = H('div', { + className: 'ov-excel-sheet-tab-bar__menu-icon', + parent: sheetMenu, + innerHTML: Icons.menu + }); + + const sheetMenuList = H('div', { + className: 'ov-excel-sheet-tab-bar__menu-list', + parent: sheetMenu + }); + + sheetMenu.onclick = () => { + sheetMenuList.style.display = 'block'; + }; + + this.workbook.sheets.forEach(sheet => { + if (sheet.isHidden()) { + return; + } + const sheetMenuItem = H('div', { + className: 'ov-excel-sheet-tab-bar__menu-list-item', + parent: sheetMenuList + }); + sheetMenuItem.textContent = sheet.getSheetName(); + sheetMenuItem.dataset.sheetIndex = sheet.getIndex().toString(); + sheetMenuItem.addEventListener('click', () => { + this.workbook.setActiveSheet(sheet.getSheetName()); + this.makeActiveSheetVisible(); + }); + if (sheet.getIndex() === this.workbook.getActiveSheet().getIndex()) { + sheetMenuItem.classList.add(menuListActiveClass); + } + this.sheetMenuItems.push(sheetMenuItem); + }); + + onClickOutside(sheetMenu, () => { + sheetMenuList.style.display = 'none'; + }); + } + + /** + * 改变 sheet 水平滚动的左右导航 + */ + renderNav(container: HTMLElement) { + const sheetNav = H('div', { + className: 'ov-excel-sheet-tab-bar__nav', + parent: container + }); + const holdTime = 100; + const moveDelta = 20; + + const leftNav = H('div', { + className: 'ov-excel-sheet-tab-bar__nav-icon', + parent: sheetNav, + innerHTML: Icons.left + }); + this.leftNav = leftNav; + + let leftNavTimer: ReturnType; + leftNav.addEventListener('mousedown', () => { + leftNavTimer = setInterval(() => { + this.updateScrollLeft(moveDelta); + }, holdTime); + }); + document.addEventListener('mouseup', () => { + clearInterval(leftNavTimer); + }); + + const rightNav = H('div', { + className: 'ov-excel-sheet-tab-bar__nav-icon', + parent: sheetNav, + innerHTML: Icons.right + }); + + this.rightNav = rightNav; + + let rightNavTimer: ReturnType; + rightNav.addEventListener('mousedown', () => { + rightNavTimer = setInterval(() => { + this.updateScrollLeft(-moveDelta); + }, holdTime); + }); + document.addEventListener('mouseup', () => { + clearInterval(rightNavTimer); + }); + } + + syncNavStatus() { + const containerWidth = this.sheetListContainer.clientWidth; + const sheetListWidth = this.sheetListWidth; + if (sheetListWidth < containerWidth) { + return; + } + + let {scrollLeft} = this; + if (scrollLeft < 0) { + this.leftNav.classList.add(iconEnableClass); + this.sheetListContainer.classList.add( + 'ov-excel-sheet-tab-bar__list-container--enable-left-nav' + ); + } else { + this.sheetListContainer.classList.remove( + 'ov-excel-sheet-tab-bar__list-container--enable-left-nav' + ); + this.leftNav.classList.remove(iconEnableClass); + } + + if (scrollLeft > containerWidth - sheetListWidth) { + this.sheetListContainer.classList.add( + 'ov-excel-sheet-tab-bar__list-container--enable-right-nav' + ); + this.rightNav.classList.add(iconEnableClass); + } else { + this.sheetListContainer.classList.remove( + 'ov-excel-sheet-tab-bar__list-container--enable-right-nav' + ); + this.rightNav.classList.remove(iconEnableClass); + } + } + + /** + * 支持在 sheet 上使用滚轮 + */ + handleWheel(e: WheelEvent) { + const {deltaY} = e; + this.updateScrollLeft(-deltaY); + } + + updateScrollLeft(delta: number) { + const containerWidth = this.sheetListContainer.clientWidth; + const sheetListWidth = this.sheetListWidth; + if (sheetListWidth < containerWidth) { + return; + } + + let {scrollLeft} = this; + scrollLeft += delta; + scrollLeft = Math.max( + Math.min(0, scrollLeft), + containerWidth - sheetListWidth + ); + + this.scrollLeft = scrollLeft; + // 目前是用 transform 来实现的,因为 list 的宽度设置为 0 了 + this.sheetList.style.transform = `translateX(${scrollLeft}px)`; + + this.syncNavStatus(); + } + + /** + * 初始化的时候保证激活的 sheet 可见 + * @param offsetX 当前 sheet 的偏移量 + */ + makeActiveSheetVisible() { + let offsetX = 0; + const currentIndex = this.workbook.getActiveSheet().getIndex().toString(); + for (const sheetTab of this.sheetTabs) { + const marginLeft = parseInt(getComputedStyle(sheetTab).marginLeft); + const marginRight = parseInt(getComputedStyle(sheetTab).marginRight); + offsetX += sheetTab.clientWidth + marginLeft + marginRight; + if (sheetTab.dataset.sheetIndex === currentIndex) { + break; + } + } + + // 需要延迟一下不然 containerWidth 不准确 + setTimeout(() => { + const containerWidth = this.sheetListContainer.clientWidth; + this.scrollLeft = Math.min(0, containerWidth - offsetX); + this.sheetList.style.transform = `translateX(${this.scrollLeft}px)`; + this.syncNavStatus(); + }, 100); + } + + /** + * 渲染 sheet 列表,如果 sheet 有变化可以重新调用这个方法 + * @param sheetList sheet 列表容器 + * @param firstRender 是否是第一次渲染,第一次渲染会调用 makeActiveSheetVisible + */ + renderSheets(sheetList: HTMLElement, firstRender = false) { + sheetList.innerHTML = ''; + this.sheetTabs = []; + + let sheetListWidth = 0; + this.workbook.sheets.forEach(sheet => { + if (sheet.isHidden()) { + return; + } + const sheetTab = H('div', { + className: 'ov-excel-sheet-tab-bar__list-tab', + parent: sheetList + }); + + const tabColor = sheet.getTabColor(); + if (tabColor !== 'none') { + const color = new Color(tabColor); + sheetTab.style.backgroundImage = `linear-gradient(${color.toRgba( + 0.1 + )}, ${color.toRgba(0.5)})`; + sheetTab.style.color = tabColor; + } + const name = sheet.getSheetName(); + sheetTab.textContent = name; + sheetTab.dataset.sheetIndex = sheet.getIndex().toString(); + sheetTab.addEventListener('click', () => { + this.workbook.setActiveSheet(name); + }); + this.sheetTabs.push(sheetTab); + const marginLeft = parseInt(getComputedStyle(sheetTab).marginLeft); + const marginRight = parseInt(getComputedStyle(sheetTab).marginRight); + sheetListWidth += sheetTab.clientWidth + marginLeft + marginRight; + + if (sheet.getIndex() === this.workbook.getActiveSheet().getIndex()) { + sheetTab.classList.add(activeTabClass); + if (firstRender) { + this.makeActiveSheetVisible(); + } + } + }); + this.sheetListWidth = sheetListWidth; + } + + updateActiveTab() { + const currentSheet = this.workbook!.getActiveSheet(); + const sheetIndex = currentSheet.getIndex(); + this.sheetTabs.forEach(tab => { + const index = parseInt(tab.dataset.sheetIndex!, 10); + if (index === sheetIndex) { + tab.classList.add(activeTabClass); + } else { + tab.classList.remove(activeTabClass); + } + }); + + this.sheetMenuItems.forEach(item => { + const index = parseInt(item.dataset.sheetIndex!, 10); + if (index === sheetIndex) { + item.classList.add(menuListActiveClass); + } else { + item.classList.remove(menuListActiveClass); + } + }); + } +} diff --git a/packages/office-viewer/src/excel/render/sheetTab/SheetTabBar.ts b/packages/office-viewer/src/excel/render/sheetTab/SheetTabBar.ts new file mode 100644 index 000000000..774d43c71 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sheetTab/SheetTabBar.ts @@ -0,0 +1,28 @@ +/** + * 底部 sheet 页签及其它状态栏 + */ + +import {H} from '../../../util/H'; +import {Workbook} from '../../Workbook'; +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; +import {SheetList} from './SheetList'; +import {StatusBar} from './StatusBar'; +import {ZoomLevel} from './ZoomLevel'; + +export class SheetTabBar { + constructor( + container: HTMLElement, + workbook: Workbook, + renderOptions: ExcelRenderOptions + ) { + if (!renderOptions.showSheetTabBar) { + return; + } + + const sheetList = new SheetList(container, workbook, renderOptions); + + const statusBar = new StatusBar(container, workbook, renderOptions); + + const zoomLevel = new ZoomLevel(container, workbook, renderOptions); + } +} diff --git a/packages/office-viewer/src/excel/render/sheetTab/StatusBar.ts b/packages/office-viewer/src/excel/render/sheetTab/StatusBar.ts new file mode 100644 index 000000000..25bbbc2fc --- /dev/null +++ b/packages/office-viewer/src/excel/render/sheetTab/StatusBar.ts @@ -0,0 +1,90 @@ +import {H} from '../../../util/H'; +import {stripNumber} from '../../../util/stripNumber'; +import {Workbook} from '../../Workbook'; +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; + +/** + * 状态栏,主要是显示平均值、求和等 + */ +export class StatusBar { + status: HTMLElement; + workbook: Workbook; + constructor( + container: HTMLElement, + workbook: Workbook, + renderOptions: ExcelRenderOptions + ) { + this.workbook = workbook; + const status = H('div', { + className: 'ov-excel-sheet-tab-bar__status', + parent: container + }); + this.status = status; + + workbook.uiEvent.on('CHANGE_SELECTION', () => { + this.syncStatus(); + }); + } + + /** + * 选区变化的时候更新底部状态栏 + */ + syncStatus() { + const workbook = this.workbook; + const status = this.status; + + const currentSheet = workbook.getActiveSheet(); + const selection = currentSheet.getSelection(); + if (!selection) { + status.textContent = ''; + return; + } + + const rangesData = currentSheet.getCellValueByRanges( + selection.cellRanges, + false + ); + + const count = rangesData.length; + + let sum = 0; + + let numberCount = 0; + + for (const data of rangesData) { + if (data) { + if (data.isDate) { + continue; + } + const numberVal = parseFloat((data.value || data.text).trim()); + if (isNaN(numberVal)) { + continue; + } + sum += numberVal; + numberCount++; + } + } + + sum = stripNumber(sum, 10); + + const average = numberCount ? stripNumber(sum / numberCount, 10) : 0; + + status.innerHTML = ''; + const averageTextElement = H('span', { + class: 'ov-excel-sheet-tab-bar__status-text', + parent: status, + innerText: `${workbook.translator('average')}: ${average}` + }); + const countTextElement = H('span', { + class: 'ov-excel-sheet-tab-bar__status-text', + parent: status, + innerText: `${workbook.translator('count')}: ${count}` + }); + + const sumTextElement = H('span', { + class: 'ov-excel-sheet-tab-bar__status-text', + parent: status, + innerText: `${workbook.translator('sum')}: ${sum}` + }); + } +} diff --git a/packages/office-viewer/src/excel/render/sheetTab/ZoomLevel.ts b/packages/office-viewer/src/excel/render/sheetTab/ZoomLevel.ts new file mode 100644 index 000000000..3f0efa236 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sheetTab/ZoomLevel.ts @@ -0,0 +1,48 @@ +import {H} from '../../../util/H'; +import {stripNumber} from '../../../util/stripNumber'; +import {Workbook} from '../../Workbook'; +import {ExcelRenderOptions} from '../../sheet/ExcelRenderOptions'; + +export class ZoomLevel { + constructor( + container: HTMLElement, + workbook: Workbook, + renderOptions: ExcelRenderOptions + ) { + this.renderZoomLevel(container, workbook); + } + + renderZoomLevel(container: HTMLElement, workbook: Workbook) { + const currentSheet = workbook.getActiveSheet(); + + const zoom = currentSheet.getZoomLevel(); + const zoomLevel = H('div', { + className: 'ov-excel-sheet-tab-bar__zoom-level', + parent: container + }); + const zoomOut = H('div', { + className: 'ov-excel-sheet-tab-bar__zoom-out', + parent: zoomLevel + }); + zoomOut.textContent = '-'; + zoomOut.addEventListener('click', () => { + currentSheet.setZoomLevel(Math.max(0.25, zoom - 0.25)); + }); + + const zoomValue = H('div', { + className: 'ov-excel-sheet-tab-bar__zoom-value', + parent: zoomLevel + }); + + zoomValue.textContent = `${zoom * 100}%`; + + const zoomIn = H('div', { + className: 'ov-excel-sheet-tab-bar__zoom-in', + parent: zoomLevel + }); + zoomIn.textContent = '+'; + zoomIn.addEventListener('click', () => { + currentSheet.setZoomLevel(zoom + 0.25); + }); + } +} diff --git a/packages/office-viewer/src/excel/render/sparkline/Numbers.ts b/packages/office-viewer/src/excel/render/sparkline/Numbers.ts new file mode 100644 index 000000000..340c9cb62 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/Numbers.ts @@ -0,0 +1 @@ +export type Numbers = (number | undefined)[]; diff --git a/packages/office-viewer/src/excel/render/sparkline/applyColor.ts b/packages/office-viewer/src/excel/render/sparkline/applyColor.ts new file mode 100644 index 000000000..31f1a9eb0 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/applyColor.ts @@ -0,0 +1,42 @@ +import {CT_Color} from '../../../openxml/ExcelTypes'; +import {stripNumber} from '../../../util/stripNumber'; +import {X14SparklineGroup} from '../../types/X14Sparkline/X14SparklineGroup'; +import {Numbers} from './Numbers'; + +/** + * 应用样式 + */ +export function applyColor( + ctx: OffscreenCanvasRenderingContext2D, + data: Numbers, + index: number, + value: number, + min: number, + max: number, + sparklineOptions: X14SparklineGroup, + defaultColor: string, + getColor: (color?: CT_Color) => string +): boolean { + value = stripNumber(value); + min = stripNumber(min); + max = stripNumber(max); + if (sparklineOptions.first && index === 0) { + ctx.fillStyle = getColor(sparklineOptions['x14:colorFirst']!); + return true; + } else if (sparklineOptions.last && index === data.length - 1) { + ctx.fillStyle = getColor(sparklineOptions['x14:colorLast']!); + return true; + } else if (sparklineOptions.high && value === max) { + ctx.fillStyle = getColor(sparklineOptions['x14:colorHigh']!); + return true; + } else if (sparklineOptions.low && value === min) { + ctx.fillStyle = getColor(sparklineOptions['x14:colorLow']!); + return true; + } else if (sparklineOptions.negative && value < 0) { + ctx.fillStyle = getColor(sparklineOptions['x14:colorNegative']!); + return true; + } else { + ctx.fillStyle = defaultColor; + } + return false; +} diff --git a/packages/office-viewer/src/excel/render/sparkline/drawSparkline.ts b/packages/office-viewer/src/excel/render/sparkline/drawSparkline.ts new file mode 100644 index 000000000..7158982b8 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/drawSparkline.ts @@ -0,0 +1,95 @@ +/** + * 绘制 sparkline + */ + +import { + parseRange, + rangeIntersect, + viewRangeToRangeRef +} from '../../io/excel/util/Range'; +import {Sheet} from '../../sheet/Sheet'; + +import {SheetCanvas} from '../SheetCanvas'; +import {renderSparkline} from './renderSparkline'; +import {getRangePosition} from '../selection/getRangePosition'; +import {ViewRange} from '../../sheet/ViewRange'; + +export function drawSparkline( + currentSheet: Sheet, + viewRange: ViewRange, + canvas: SheetCanvas +) { + const workbook = currentSheet.getWorkbook(); + + const viewRangeRef = viewRangeToRangeRef(viewRange); + + const sparklineGroups = currentSheet.getSparklineGroups(); + + for (const sparklineGroup of sparklineGroups) { + for (const sparkline of sparklineGroup['x14:sparklines']?.[ + 'x14:sparkline' + ] || []) { + const f = sparkline['xm:f']; + const sqref = sparkline['xm:sqref']; + if (!f || !sqref) { + console.warn('sparkline 缺少必要的 xm:f 和 xm:sqref 字段', sparkline); + continue; + } + + const sqrefCellRange = parseRange(sqref); + + if (rangeIntersect(viewRangeRef, sqrefCellRange)) { + if (f.includes('!')) { + const cellDisplayData = getRangePosition( + workbook, + viewRange.region, + sqrefCellRange + ); + + if (!cellDisplayData) { + console.warn('找不到对应的单元格', sqref); + continue; + } + + const [sheetName, rangeStr] = f.split('!'); + // 获取范围内的数据 + const dataRange = parseRange(rangeStr); + const targetSheet = workbook.getSheetByName(sheetName); + if (targetSheet) { + const displayHidden = sparklineGroup.displayHidden; + const dataInRange = targetSheet.getCellValueByRange( + dataRange, + displayHidden + ); + const data = dataInRange.map(val => val.value); + const cacheKey = `${sheetName}!${JSON.stringify(sparkline)}`; + const padding = 3; + canvas.customDrawWithCache( + cacheKey, + cellDisplayData.x + padding, + cellDisplayData.y + padding, + cellDisplayData.width - 2 * padding, + cellDisplayData.height - 2 * padding, + ctx => { + renderSparkline( + ctx, + cellDisplayData.width - 2 * padding, + cellDisplayData.height - 2 * padding, + data, + sparklineGroup, + color => { + return currentSheet.dataProvider.getColor(color); + } + ); + } + ); + } else { + console.warn('找不到目标 sheet', sheetName); + } + } else { + console.warn('未知 sparkline 引用格式', f); + } + } + } + } +} diff --git a/packages/office-viewer/src/excel/render/sparkline/renderColumn.ts b/packages/office-viewer/src/excel/render/sparkline/renderColumn.ts new file mode 100644 index 000000000..1ba45d17c --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/renderColumn.ts @@ -0,0 +1,68 @@ +import {CT_Color} from '../../../openxml/ExcelTypes'; +import {X14SparklineGroup} from '../../types/X14Sparkline/X14SparklineGroup'; +import {Numbers} from './Numbers'; +import {applyColor} from './applyColor'; + +/** + * 绘制柱状图 + */ +export function renderColumn( + ctx: OffscreenCanvasRenderingContext2D, + width: number, + height: number, + min: number, + max: number, + data: Numbers, + sparklineOptions: X14SparklineGroup, + getColor: (color?: CT_Color) => string +) { + const color = getColor(sparklineOptions['x14:colorSeries']!); + // 柱状图之间的间隔 + const gap = 2; + + const diff = max - min; + + // 只有一个点就只绘制中间 + ctx.fillStyle = color; + if (data.length === 1) { + const firstData = data[0]; + if (firstData !== undefined) { + const columnWidth = 6; + ctx.fillRect( + width / 2 - 1, + height - ((firstData - min) / diff) * height, + columnWidth, + ((firstData - min) / diff) * height + ); + } + + return; + } + + const columnWidth = (width - gap * (data.length - 1)) / data.length; + const minColumnHeight = 1; + + for (const [index, value] of data.entries()) { + if (value === undefined) { + continue; + } + applyColor( + ctx, + data, + index, + value, + min, + max, + sparklineOptions, + color, + getColor + ); + const x = index * (columnWidth + gap); + const columnHeight = Math.max( + minColumnHeight, + ((value - min) / diff) * height + ); + const y = height - columnHeight; + ctx.fillRect(x, y, columnWidth, columnHeight); + } +} diff --git a/packages/office-viewer/src/excel/render/sparkline/renderLine.ts b/packages/office-viewer/src/excel/render/sparkline/renderLine.ts new file mode 100644 index 000000000..ffd061a91 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/renderLine.ts @@ -0,0 +1,112 @@ +import {CT_Color} from '../../../openxml/ExcelTypes'; +import {X14SparklineGroup} from '../../types/X14Sparkline/X14SparklineGroup'; +import {Numbers} from './Numbers'; +import {applyColor} from './applyColor'; + +/** + * 绘制折线图 + */ +export function renderLine( + ctx: OffscreenCanvasRenderingContext2D, + width: number, + height: number, + min: number, + max: number, + data: Numbers, + sparklineOptions: X14SparklineGroup, + getColor: (color?: CT_Color) => string +) { + const padding = 2; + // 为了避免线跑出去,需要在两边加上一些空白 + height -= padding * 2; + width -= padding * 2; + + const color = getColor(sparklineOptions['x14:colorSeries']!); + + // 只有一个点没法画 + if (data.length < 1) { + console.warn('sparkline 只有一个数据', data); + return; + } + + const step = width / (data.length - 1); + + // 绘制坐标轴 + if (sparklineOptions.displayXAxis) { + ctx.beginPath(); + ctx.strokeStyle = color; + ctx.lineWidth = sparklineOptions.lineWeight || 1.2; + ctx.moveTo(0 + padding, height / 2 + padding); + ctx.lineTo(width, height / 2); + ctx.stroke(); + } + + // 画线 + ctx.beginPath(); + ctx.strokeStyle = color; + ctx.lineWidth = sparklineOptions.lineWeight || 1.2; + const points: {x: number; y: number; index: number; value: number}[] = []; + // 上一个是空值,则需要 moveTo + let lastIsUndefined = false; + for (const [index, value] of data.entries()) { + if (value === undefined) { + lastIsUndefined = true; + continue; + } + + const x = index * step + padding; + const y = height - ((value - min) / (max - min)) * height + padding; + if (index === 0 && lastIsUndefined) { + ctx.moveTo(x, y); + lastIsUndefined = false; + } else { + ctx.lineTo(x, y); + } + points.push({x, y, index, value}); + } + ctx.stroke(); + + // 画点 + if (sparklineOptions.markers) { + for (const point of points) { + ctx.beginPath(); + applyColor( + ctx, + data, + point.index, + point.value, + min, + max, + sparklineOptions, + color, + getColor + ); + ctx.arc(point.x, point.y, 2, 0, Math.PI * 2); + ctx.fillStyle = color; + ctx.fill(); + } + } else { + // 画特定的点 + for (const point of points) { + const showRender = applyColor( + ctx, + data, + point.index, + point.value, + min, + max, + sparklineOptions, + color, + getColor + ); + + if (!showRender) { + continue; + } + + ctx.beginPath(); + ctx.arc(point.x, point.y, 2, 0, Math.PI * 2); + ctx.fill(); + } + } +} diff --git a/packages/office-viewer/src/excel/render/sparkline/renderSparkline.ts b/packages/office-viewer/src/excel/render/sparkline/renderSparkline.ts new file mode 100644 index 000000000..e3462c327 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/renderSparkline.ts @@ -0,0 +1,99 @@ +/** + * 绘制 sparkline,这里的坐标都是从 0 开始 + */ + +import {CT_Color} from '../../../openxml/ExcelTypes'; +import {X14SparklineGroup} from '../../types/X14Sparkline/X14SparklineGroup'; +import {Numbers} from './Numbers'; +import {renderLine} from './renderLine'; +import {renderColumn} from './renderColumn'; +import {renderStacked} from './renderStacked'; +import {gt, lt} from '../../../util/number'; + +/** + * 绘制 Sparkline + */ +export function renderSparkline( + ctx: OffscreenCanvasRenderingContext2D, + width: number, + height: number, + data: string[], + sparklineOptions: X14SparklineGroup, + getColor: (color?: CT_Color) => string +) { + const type = sparklineOptions.type || 'line'; + let minVal: number | undefined; + let maxVal: number | undefined; + + const numbers: Numbers = data.map(d => { + if (d === '') { + return undefined; + } + + const num = parseFloat(d); + if (minVal === undefined) { + minVal = num; + } + if (maxVal === undefined) { + maxVal = num; + } + if (lt(num, minVal)) { + minVal = num; + } + if (gt(num, maxVal)) { + maxVal = num; + } + + return num; + }); + + if (numbers.length === 0 || minVal === undefined || maxVal === undefined) { + console.warn('sparkline 数据不完整', numbers); + return; + } + + if (sparklineOptions.manualMin !== undefined) { + minVal = sparklineOptions.manualMin; + } + + if (sparklineOptions.manualMax !== undefined) { + maxVal = sparklineOptions.manualMax; + } + + if (type === 'line') { + renderLine( + ctx, + width, + height, + minVal, + maxVal, + numbers, + sparklineOptions, + getColor + ); + } else if (type === 'column') { + renderColumn( + ctx, + width, + height, + minVal, + maxVal, + numbers, + sparklineOptions, + getColor + ); + } else if (type === 'stacked') { + renderStacked( + ctx, + width, + height, + minVal, + maxVal, + numbers, + sparklineOptions, + getColor + ); + } else { + console.warn('不支持的 sparkline 类型', type); + } +} diff --git a/packages/office-viewer/src/excel/render/sparkline/renderStacked.ts b/packages/office-viewer/src/excel/render/sparkline/renderStacked.ts new file mode 100644 index 000000000..935568a88 --- /dev/null +++ b/packages/office-viewer/src/excel/render/sparkline/renderStacked.ts @@ -0,0 +1,78 @@ +import {CT_Color} from '../../../openxml/ExcelTypes'; +import {X14SparklineGroup} from '../../types/X14Sparkline/X14SparklineGroup'; +import {Numbers} from './Numbers'; +import {applyColor} from './applyColor'; +import {gt} from '../../../util/number'; + +/** + * render win/loss sparkline + */ +export function renderStacked( + ctx: OffscreenCanvasRenderingContext2D, + width: number, + height: number, + min: number, + max: number, + data: Numbers, + sparklineOptions: X14SparklineGroup, + getColor: (color?: CT_Color) => string +) { + const color = getColor(sparklineOptions['x14:colorSeries']!); + const colorNegative = getColor(sparklineOptions['x14:colorNegative']!); + // 柱状图之间的间隔 + const gap = 2; + + const columnHeight = height / 2; + + // 只有一个点就只绘制中间 + + if (data.length === 1) { + const firstData = data[0]; + if (firstData !== undefined) { + const columnWidth = 6; + + if (gt(firstData, 0)) { + ctx.fillStyle = color; + ctx.fillRect(width / 2, 0, columnWidth, columnHeight); + } else { + ctx.fillStyle = colorNegative; + ctx.fillRect( + width / 2, + height - columnHeight, + columnWidth, + columnHeight + ); + } + } + + return; + } + + const columnWidth = (width - gap * (data.length - 1)) / data.length; + for (const [index, value] of data.entries()) { + if (value === undefined) { + continue; + } + applyColor( + ctx, + data, + index, + value, + min, + max, + sparklineOptions, + color, + getColor + ); + const x = index * (columnWidth + gap); + let y; + if (gt(value, 0)) { + ctx.fillStyle = color; + y = 0; + } else { + ctx.fillStyle = colorNegative; + y = height - columnHeight; + } + ctx.fillRect(x, y, columnWidth, columnHeight); + } +} diff --git a/packages/office-viewer/src/excel/render/ui/Button.ts b/packages/office-viewer/src/excel/render/ui/Button.ts new file mode 100644 index 000000000..a01754e73 --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/Button.ts @@ -0,0 +1,19 @@ +/** + * 简单的按钮组件 + */ +export class Button { + button: HTMLButtonElement; + + constructor( + container: HTMLElement, + style: 'primary' | 'normal', + text: string, + onClick: () => void + ) { + this.button = document.createElement('button'); + this.button.innerText = text; + container.appendChild(this.button); + this.button.className = `excel-button excel-button-${style}`; + this.button.onclick = onClick; + } +} diff --git a/packages/office-viewer/src/excel/render/ui/CheckBox.ts b/packages/office-viewer/src/excel/render/ui/CheckBox.ts new file mode 100644 index 000000000..d0afc25db --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/CheckBox.ts @@ -0,0 +1,73 @@ +import {H} from '../../../util/H'; + +export type CheckBoxOption = { + value: string; + text: string; + checked: boolean; +}; + +export class CheckBox { + checkboxContainer: HTMLDivElement; + + checkbox: HTMLInputElement; + + option: CheckBoxOption; + + constructor( + container: HTMLElement, + option: CheckBoxOption, + onChange: (checked: boolean, option: CheckBoxOption) => void + ) { + this.option = option; + const checkboxContainer = H('div', { + className: 'excel-checkbox-container', + parent: container + }) as HTMLDivElement; + + const label = H('label', { + parent: checkboxContainer + }); + + this.checkboxContainer = checkboxContainer; + + const checkbox = H('input', { + type: 'checkbox', + parent: label + }) as HTMLInputElement; + + this.checkbox = checkbox; + + checkbox.checked = option.checked; + + checkbox.onchange = () => { + option.checked = checkbox.checked; + onChange(checkbox.checked, option); + }; + + const checkBoxText = H('span', { + innerText: option.text, + parent: label + }); + } + + getText() { + return this.option.text; + } + + setChecked(checked: boolean) { + this.option.checked = checked; + this.checkbox.checked = checked; + } + + isChecked() { + return this.checkbox.checked; + } + + show() { + this.checkboxContainer.style.display = 'block'; + } + + hide() { + this.checkboxContainer.style.display = 'none'; + } +} diff --git a/packages/office-viewer/src/excel/render/ui/CheckBoxList.ts b/packages/office-viewer/src/excel/render/ui/CheckBoxList.ts new file mode 100644 index 000000000..9ea6e510c --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/CheckBoxList.ts @@ -0,0 +1,111 @@ +import {H} from '../../../util/H'; +import {CheckBox, CheckBoxOption} from './CheckBox'; +import {Input} from './Input'; + +/** + * 多选框列表,目前用在自动筛选的条件选择 + */ +export class CheckBoxList { + options: CheckBoxOption[]; + + listContainer: HTMLDivElement; + + checkBoxes: CheckBox[] = []; + + checkAllBox: CheckBox; + + searchInput: Input; + + constructor( + container: HTMLElement, + selectAllText: string, + searchPlaceholder: string = '', + options: CheckBoxOption[], + onCheck: ( + checked: boolean, + option: CheckBoxOption, + options: CheckBoxOption[] + ) => void + ) { + this.options = options; + + const wrapper = H('div', { + className: 'excel-checkbox-list-wrapper', + parent: container + }); + + const searchInput = new Input( + wrapper, + searchPlaceholder, + '', + (text: string) => { + this.handleSearch(text); + } + ); + + this.searchInput = searchInput; + + const listContainer = H('div', { + className: 'excel-checkbox-list', + parent: wrapper + }) as HTMLDivElement; + + this.listContainer = listContainer; + + const checkAllOption = { + value: '__all__', + text: selectAllText, + checked: true + }; + + const checkAll = new CheckBox(listContainer, checkAllOption, checked => { + this.checkBoxes.forEach(checkbox => { + checkbox.setChecked(checked); + }); + onCheck(checked, checkAllOption, options); + }); + + this.checkAllBox = checkAll; + + for (const option of options) { + const checkbox = new CheckBox( + listContainer, + option, + (checked, option) => { + onCheck(checked, option, options); + this.syncCheckAll(); + } + ); + + this.checkBoxes.push(checkbox); + } + + this.syncCheckAll(); + } + + handleSearch(text: string) { + if (text) { + // 做一下过滤 + for (const checkbox of this.checkBoxes) { + if (checkbox.getText().toLowerCase().indexOf(text.toLowerCase()) > -1) { + checkbox.show(); + } else { + checkbox.hide(); + } + } + } else { + for (const checkbox of this.checkBoxes) { + checkbox.show(); + } + } + } + + syncCheckAll() { + const allChecked = this.checkBoxes.every(checkbox => checkbox.isChecked()); + this.checkAllBox.setChecked(allChecked); + } + + getOptions() { + return this.options; + } +} diff --git a/packages/office-viewer/src/excel/render/ui/Divider.ts b/packages/office-viewer/src/excel/render/ui/Divider.ts new file mode 100644 index 000000000..b2f65dfe4 --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/Divider.ts @@ -0,0 +1,10 @@ +import {H} from '../../../util/H'; + +export class Divider { + constructor(container: HTMLElement) { + const divider = H('div', { + className: 'excel-divider', + parent: container + }); + } +} diff --git a/packages/office-viewer/src/excel/render/ui/Input.ts b/packages/office-viewer/src/excel/render/ui/Input.ts new file mode 100644 index 000000000..d0950171f --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/Input.ts @@ -0,0 +1,58 @@ +/** + * 简单的 input 组件 封装 + */ + +let inputId = 0; + +export class Input { + input: HTMLInputElement; + + constructor( + container: HTMLElement, + placeholder: string, + value: string, + onChange: (value: string) => void, + style: 'normal' | 'borderLess' = 'normal', + options: string[] = [] + ) { + this.input = document.createElement('input'); + this.input.value = value; + this.input.placeholder = placeholder; + container.appendChild(this.input); + this.input.className = 'excel-input'; + if (style === 'borderLess') { + this.input.classList.add('excel-input-border-less'); + } + this.input.oninput = () => { + onChange(this.input.value); + }; + + if (options.length) { + const datalist = document.createElement('datalist'); + datalist.id = `${inputId++}-list`; + container.appendChild(datalist); + options.forEach(option => { + const optionElement = document.createElement('option'); + optionElement.value = option; + datalist.appendChild(optionElement); + }); + this.input.setAttribute('list', datalist.id); + } + } + + getElement() { + return this.input; + } + + getValue() { + return this.input.value; + } + + setValue(text: string) { + this.input.value = text; + } + + force() { + this.input.focus(); + } +} diff --git a/packages/office-viewer/src/excel/render/ui/Radio.ts b/packages/office-viewer/src/excel/render/ui/Radio.ts new file mode 100644 index 000000000..277df8cb6 --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/Radio.ts @@ -0,0 +1,47 @@ +let radioId = 0; +/** + * radio 的简单封装 + */ +export class Radio { + element: HTMLDivElement; + + constructor( + container: HTMLElement, + options: Array<{ + value: ValueType; + text: string; + }>, + defaultValue: ValueType, + onChange?: (value: string) => void + ) { + const radioWrapper = document.createElement('div'); + container.appendChild(radioWrapper); + radioWrapper.className = 'excel-radio-wrapper'; + for (const option of options) { + const id = `${radioId++}-${option.value}`; + const radio = document.createElement('input'); + radio.type = 'radio'; + radio.value = option.value as string; + radio.checked = option.value === defaultValue; + radio.name = 'excel-radio'; + radio.id = id; + radio.onchange = () => { + onChange?.(radio.value); + }; + radioWrapper.appendChild(radio); + const label = document.createElement('label'); + label.innerText = option.text; + label.htmlFor = id; + radioWrapper.appendChild(label); + } + + this.element = radioWrapper; + } + + getValue() { + const radio = this.element.querySelector( + 'input:checked' + ) as HTMLInputElement; + return radio?.value as ValueType; + } +} diff --git a/packages/office-viewer/src/excel/render/ui/Select.ts b/packages/office-viewer/src/excel/render/ui/Select.ts new file mode 100644 index 000000000..bccabe639 --- /dev/null +++ b/packages/office-viewer/src/excel/render/ui/Select.ts @@ -0,0 +1,45 @@ +export type SelectOption = { + value: string; + text: string; +}; + +export class Select { + element: HTMLSelectElement; + + constructor( + container: HTMLElement, + options: Array<{ + value: ValueType; + text: string; + }>, + defaultValue: ValueType, + onChange: (value: string) => void + ) { + const element = document.createElement('select'); + container.appendChild(element); + this.element = element; + element.className = 'excel-select'; + + options.forEach(option => { + const optionElement = document.createElement('option'); + optionElement.value = option.value as string; + optionElement.textContent = option.text; + if (option.value === defaultValue) { + optionElement.selected = true; + } + element.appendChild(optionElement); + }); + + element.addEventListener('change', () => { + onChange(element.value); + }); + } + + setValue(value: string) { + this.element.value = value; + } + + getValue() { + return this.element.value as ValueType; + } +} diff --git a/packages/office-viewer/src/excel/render/widget/Widget.ts b/packages/office-viewer/src/excel/render/widget/Widget.ts new file mode 100644 index 000000000..64d47bef3 --- /dev/null +++ b/packages/office-viewer/src/excel/render/widget/Widget.ts @@ -0,0 +1,68 @@ +/** + * canvas 渲染中的小部件 + */ + +import type {Canvas} from '../Canvas'; + +export abstract class Widget { + x: number; + y: number; + width: number; + height: number; + ratio: number; + canvas: Canvas; + + constructor( + x: number, + y: number, + width: number, + height: number, + canvas: Canvas + ) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + this.ratio = canvas.getRealRatio(); + this.canvas = canvas; + } + + getClientBounding() { + return { + x: this.x, + y: this.y, + width: this.width, + height: this.height + }; + } + + updateScale() { + this.ratio = this.canvas.getRealRatio(); + } + + updateX(x: number) { + this.x = x; + } + + updateY(y: number) { + this.y = y; + } + + /** + * 判断某个坐标点是否在这个小部件内 + */ + isPointInWidget(x: number, y: number) { + return ( + x >= this.x && + x <= this.x + this.width && + y >= this.y && + y <= this.y + this.height + ); + } + + onMouseover() {} + + onMouseout() {} + + abstract draw(): Promise; +} diff --git a/packages/office-viewer/src/excel/sheet/BuiltInNumFmt.ts b/packages/office-viewer/src/excel/sheet/BuiltInNumFmt.ts new file mode 100644 index 000000000..6cf295c0c --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/BuiltInNumFmt.ts @@ -0,0 +1,40 @@ +/** + * 内置 numfmt,来自 ssf.js,做了修改,主要是将 yy 都改成了 yyyy,不然太容易混淆了 + */ +const BuiltInNumFmt: string[] = []; + +BuiltInNumFmt[0] = 'General'; +BuiltInNumFmt[1] = '0'; +BuiltInNumFmt[2] = '0.00'; +BuiltInNumFmt[3] = '#,##0'; +BuiltInNumFmt[4] = '#,##0.00'; +BuiltInNumFmt[9] = '0%'; +BuiltInNumFmt[10] = '0.00%'; +BuiltInNumFmt[11] = '0.00E+00'; +BuiltInNumFmt[12] = '# ?/?'; +BuiltInNumFmt[13] = '# ??/??'; +// 将原本的 yy 改成 yyyy 了,并换了顺序 +BuiltInNumFmt[14] = 'yyyy/m/d'; +// 将原本的 yy 改成 yyyy 了,并换了顺序 +BuiltInNumFmt[15] = 'yyyy-mmm-d'; +BuiltInNumFmt[16] = 'mmm-d'; +// 将原本的 yy 改成 yyyy 了,并换了顺序 +BuiltInNumFmt[17] = 'yyyy-mmm'; +BuiltInNumFmt[18] = 'h:mm AM/PM'; +BuiltInNumFmt[19] = 'h:mm:ss AM/PM'; +BuiltInNumFmt[20] = 'h:mm'; +BuiltInNumFmt[21] = 'h:mm:ss'; +// 将原本的 yy 改成 yyyy 了,并换了顺序 +BuiltInNumFmt[22] = 'yyyy/m/d h:mm'; +BuiltInNumFmt[37] = '#,##0 ;(#,##0)'; +BuiltInNumFmt[38] = '#,##0 ;[Red](#,##0)'; +BuiltInNumFmt[39] = '#,##0.00;(#,##0.00)'; +BuiltInNumFmt[40] = '#,##0.00;[Red](#,##0.00)'; +BuiltInNumFmt[45] = 'mm:ss'; +BuiltInNumFmt[46] = '[h]:mm:ss'; +BuiltInNumFmt[47] = 'mmss.0'; +BuiltInNumFmt[48] = '##0.0E+0'; +BuiltInNumFmt[49] = '@'; +BuiltInNumFmt[56] = '"上午/下午 "hh"時"mm"分"ss"秒 "'; + +export default BuiltInNumFmt; diff --git a/packages/office-viewer/src/excel/sheet/ColWidth.ts b/packages/office-viewer/src/excel/sheet/ColWidth.ts new file mode 100644 index 000000000..9013f47ae --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/ColWidth.ts @@ -0,0 +1,31 @@ +/** + * col 宽度相关的工具函数 + */ + +/** + * 用于根据字符数获取列宽 + * @returns 返回宽度像素 + */ +export function baseColWidth2px(colWidth: number, fontWidth: number) { + // 文档(P.1685)里的说法是 + // defaultColWidth = baseColumnWidth + {margin padding (2 pixels on each side, totalling 4 pixels)} + {gridline (1pixel)} + // 所以这里加 5 + return colWidth * fontWidth + 5; +} + +/** + * 根据列宽获取 px,这个减去 0.83203125 是 Excel 默认加的 + * 这个计算方法可能不太准,还得进一步调研 + * @param colWidth + * @returns 返回宽度像素 + */ +export function colWidth2px(colWidth: number, fontWidth: number) { + return baseColWidth2px(colWidth - 0.83203125, fontWidth); +} + +/** + * 根据像素反算列宽 + */ +export function px2colWidth(px: number, fontWidth: number) { + return (px - 5) / fontWidth + 0.83203125; +} diff --git a/packages/office-viewer/src/excel/sheet/ExcelRenderOptions.ts b/packages/office-viewer/src/excel/sheet/ExcelRenderOptions.ts new file mode 100644 index 000000000..39c051c7a --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/ExcelRenderOptions.ts @@ -0,0 +1,193 @@ +import {RenderOptions} from '../../RenderOptions'; +import {HitTestResult} from '../render/selection/hitTest'; + +export interface RowColHeadersOptions { + /** + * 是否显示表头,这个会覆盖默认设置 + */ + showRowColHeaders: boolean; + + /** + * 字体颜色 + */ + rowColHeadersColor: string; + + /** + * 表头背景色 + */ + rowColHeadersBackgroundColor: string; + + /** + * 表头线颜色 + */ + rowColHeadersLineColor: string; + + /** + * 有隐藏内容时的字体颜色 + */ + hiddenRowColHeadersColor: string; + + /** + * 有隐藏内容时的线颜色 + */ + hiddenRowColHeadersLineColor: string; + + /** + * 有隐藏内容时的线大小 + */ + hiddenRowColHeadersLineSize: number; +} + +export interface GridLineOptions { + /** + * 是否显示网格线 + */ + showGridLines?: boolean; + + /** + * 网格线宽度 + */ + gridLineWidth?: number; + + /** + * 网格线颜色 + */ + gridLineColor: string; + + /** + * 拖动网格线时的颜色 + */ + dragGridLineColor: string; + + /** + * 冻结线宽度 + */ + frozenLineWidth?: number; + + /** + * 冻结线颜色 + */ + frozenLineColor: string; + + /** + * 点击到线上的范围,当鼠标靠近这个距离内时,会认为点击到了线上 + */ + gridLineHitRange: number; +} + +export interface SelectionOptions { + /** + * 选中的边框颜色 + */ + selectionBorderColor: string; + + /** + * 选中区域右下角的方块大小 + */ + selectionSquareSize: number; + + /** + * 选中区域的背景色 + */ + selectionBackgroundColor: string; + + /** + * 选中区域的背景色透明度 + */ + selectionBackgroundOpacity: number; +} + +export interface Debug { + /** + * 鼠标移动时的回调,主要用于调试 + */ + mousePositionTracker?: ( + x: number, + y: number, + hitTestResult: HitTestResult | null + ) => void; +} + +export interface ExcelRenderOptions + extends RenderOptions, + RowColHeadersOptions, + GridLineOptions, + SelectionOptions, + Debug { + /** + * 是否使用 web worker 避免解析时卡顿,默认不开启 + */ + useWorker?: boolean; + + /** + * 是否加载时强制计算所有公式,这个在 workbook 的 calcPr 中也能配置 + */ + fullCalcOnLoad?: boolean; + + /** + * 渲染宽度 + */ + width?: number; + + /** + * 渲染高度 + */ + height?: number; + + /** + * 语言,使用 http://www.rfc-editor.org/rfc/bcp/bcp47.txt,主要用于 numfmt + */ + locale: string; + + /** + * 缩放比例 + */ + scale?: number; + + /** + * 单个缩进大小 + */ + indentSize: number; + + /** + * 背景色 + */ + backgroundColor: string; + + /** + * 单元格默认背景色 + */ + cellBackgroundColor: string; + + /** + * 是否显示公式栏 + */ + showFormulaBar: boolean; + + /** + * 是否显示 sheet 标签 + */ + showSheetTabBar: boolean; + + /** + * 嵌入模式,在这个模式下滚动条滚到底部会出发继续滚动事件,滚动页面本身 + */ + embed: boolean; + + /** + * 是否可编辑 + */ + editable: boolean; + + /** + * 打印可以覆盖其它配置 + */ + printOptions?: ExcelRenderOptions; + + printWaitTime?: number; + + /** + * 字体 url,用于加载字体 + */ + fontURL: Record; +} diff --git a/packages/office-viewer/src/excel/sheet/RangeCache.ts b/packages/office-viewer/src/excel/sheet/RangeCache.ts new file mode 100644 index 000000000..7cd5fea3b --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/RangeCache.ts @@ -0,0 +1,69 @@ +/** + * 范围缓存,方便数据变化的时候自动清空 + */ + +import {rangeIntersect} from '../io/excel/util/Range'; +import {RangeRef} from '../types/RangeRef'; + +/** + * 范围的缓存 key + */ +export function rangeCacheKey(range: RangeRef) { + return `${range.startRow}-${range.startCol}-${range.endRow}-${range.endCol}`; +} + +export function rangeCacheKeyToRange(key: string) { + const [startRow, startCol, endRow, endCol] = key.split('-'); + return { + startRow: parseInt(startRow, 10), + startCol: parseInt(startCol, 10), + endRow: parseInt(endRow, 10), + endCol: parseInt(endCol, 10) + }; +} + +export class RangeCache { + /** + * 缓存 + */ + private cache: Map> = new Map(); + + /** + * 设置缓存 + */ + public set(ranges: RangeRef[], key: string, value: any) { + const cacheKey = ranges.map(rangeCacheKey).join(' '); + if (!this.cache.has(cacheKey)) { + this.cache.set(cacheKey, new Map()); + } + this.cache.get(cacheKey)!.set(key, value); + } + + /** + * 获取缓存 + */ + public get(ranges: RangeRef[], key: string) { + const cacheKey = ranges.map(rangeCacheKey).join(' '); + if (this.cache.has(cacheKey)) { + return this.cache.get(cacheKey)!.get(key); + } + return null; + } + + /** + * 清理相关缓存,会判断是否相交 + */ + public clear(ranges: RangeRef[]) { + for (const range of ranges) { + for (const rangeKeys of this.cache.keys()) { + const cacheRanges = rangeKeys.split(' ').map(rangeCacheKeyToRange); + for (const cacheRange of cacheRanges) { + if (rangeIntersect(range, cacheRange)) { + this.cache.delete(rangeKeys); + break; + } + } + } + } + } +} diff --git a/packages/office-viewer/src/excel/sheet/RowFilter.ts b/packages/office-viewer/src/excel/sheet/RowFilter.ts new file mode 100644 index 000000000..004384b0a --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/RowFilter.ts @@ -0,0 +1,3 @@ +/** + * 行过滤配置 + */ diff --git a/packages/office-viewer/src/excel/sheet/Sheet.ts b/packages/office-viewer/src/excel/sheet/Sheet.ts new file mode 100644 index 000000000..1fbba497a --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/Sheet.ts @@ -0,0 +1,848 @@ +/** + * sheet 的相关操作及临时状态 + */ + +import type {ExcelRenderOptions} from '../sheet/ExcelRenderOptions'; +import {CT_AutoFilter, CT_SheetView} from '../../openxml/ExcelTypes'; + +import type {Workbook} from '../Workbook'; + +import {IDataProvider} from '../types/IDataProvider'; +import {FontSize} from '../types/FontSize'; +import {CellInfo} from '../types/CellInfo'; + +import {ISheet} from '../types/ISheet'; +import {RangeRef} from '../types/RangeRef'; +import {CellData} from '../types/worksheet/CellData'; +import {IndexInfo, getViewRange} from './getViewRange'; +import {ViewRange} from './ViewRange'; +import {PADDING_SIZE} from '../render/Consts'; +import {calcCellDisplaySize, getViewPointData} from './getViewPointData'; +import {getFrozenLeftViewPointRange} from '../render/cell/frozen/getFrozenLeftViewPointRange'; +import {getFrozenTopLeftViewPointRange} from '../render/cell/frozen/getFrozenTopLeftViewPointRange'; +import {getFrozenTopViewPointRange} from '../render/cell/frozen/getFrozenTopViewPointRange'; +import {FrozenViewRange} from '../render/cell/frozen/drawFrozen'; +import {HitTestResult, hitTest} from '../render/selection/hitTest'; +import {SheetSelection} from '../render/selection/SheetSelection'; +import {isMergeCell} from '../io/excel/util/Range'; +import {Rect, pointInRect} from '../render/Rect'; +import {applyConditionalFormat} from './applyConditionalFormat'; +import {RangeCache} from './RangeCache'; +import {CellValue} from '../types/CellValue'; +import {applyTablePartsStyle} from './applyTablePartsStyle'; +import {getCellAbsolutePosition} from './getCellAbsolutePosition'; +import {getAbsoluteAnchorPosition} from '../render/drawing/getAbsoluteAnchorPosition'; +import {getOneCellAnchorPosition} from '../render/drawing/getOneCellAnchorPosition'; +import {getTwoCellAnchorPosition} from '../render/drawing/getTwoCellAnchorPosition'; +import {AutoFilterIconUI} from '../render/autoFilter/AutoFilterIconUI'; +import {EnKeys} from '../lang/en_US'; +import {applyAutoFilter} from '../data/applyAutoFilter'; + +export type DisplayData = { + x: number; + y: number; + width: number; + height: number; + row: number; + col: number; + value: CellData; + /** + * 是否需要清空 + */ + needClear: boolean; +}; + +export class Sheet { + /** + * 数据提供者 + */ + dataProvider: IDataProvider; + + /** + * 当前的 sheet 的索引,根据这个来获取数据 + */ + private sheetIndex: number; + + workbook: Workbook; + + rangeCache = new RangeCache(); + + /** + * 水平滚动条位置 + */ + private scrollLeft = 0; + + /** + * 垂直滚动条位置 + */ + private scrollTop = 0; + + /** + * 行高,这里只记录自定义的行高 + */ + customRowHeight: number[] = []; + + /** + * 列宽,这里只记录自定义的列宽 + */ + customColumnWidth: number[] = []; + + /** + * 渲染配置项 + */ + renderOptions: ExcelRenderOptions; + + /** + * 表头的宽度,这个会随着滚动而变化,这里设置个初始值 + */ + rowHeaderWidth: number = 29.34765625; + + /** + * 表头的高度,这个是固定的,如果不显示 + */ + colHeaderHeight: number = 25; + + /** + * 缩放比例 + */ + private zoomLevel: number = 1; + + /** + * 选区 + */ + selection?: SheetSelection; + + sheetData: ISheet; + + private currentSheetView: CT_SheetView; + + /** + * 内容及冻结区的访问,主要用于判断当前鼠标下是哪个单元格 + */ + private dataViewRange?: ViewRange; + private frozenViewRange?: FrozenViewRange; + + /** + * 默认字体大小,用于一些计算 + */ + defaultFontSize: FontSize; + + /** + * 最新的 AutoFilterIcon 图标实例,主要用于关闭 + */ + private lastAutoFilterIcon?: AutoFilterIconUI; + + constructor( + sheetIndex: number, + dataProvider: IDataProvider, + sheetData: ISheet, + workbook: Workbook, + renderOptions: ExcelRenderOptions + ) { + this.sheetIndex = sheetIndex; + this.dataProvider = dataProvider; + this.sheetData = sheetData; + this.workbook = workbook; + this.renderOptions = renderOptions; + + // 设置默认展示方式 + if (sheetData.worksheet?.sheetViews?.length) { + this.currentSheetView = sheetData.worksheet.sheetViews[0]; + } else { + // 如果没有就加个默认设置避免报错 + this.currentSheetView = { + showGridLines: true, + showRowColHeaders: true + }; + } + + if (!this.showRowColHeaders()) { + this.colHeaderHeight = 0; + this.rowHeaderWidth = 0; + } + + this.defaultFontSize = dataProvider.getDefaultFontSize(); + // 初始按两个字符宽度来计算 + this.rowHeaderWidth = 2 * this.defaultFontSize.width + 4 * PADDING_SIZE; + + workbook.uiEvent.on( + 'CHANGE_SELECTION', + this.handleChangeSelection.bind(this) + ); + } + + handleChangeSelection(selection: SheetSelection) { + if (selection.sheetIndex === this.sheetIndex) { + this.selection = selection; + } + if (this.lastAutoFilterIcon) { + this.lastAutoFilterIcon.hideMenu(); + } + } + + getSheetName() { + return this.dataProvider.getSheetByIndex(this.sheetIndex)!.name; + } + + /** + * 获取当前 sheet 的视图设置 + */ + getCurrentSheetView() { + return this.currentSheetView; + } + + getScrollLeft() { + return this.scrollLeft; + } + + setScrollLeft(scrollLeft: number) { + if (Math.round(scrollLeft) !== Math.round(this.scrollLeft)) { + this.scrollLeft = scrollLeft; + if (this.scrollLeft < 0) { + this.scrollLeft = 0; + } + } + } + + updateViewRange(viewRange: ViewRange) { + this.dataViewRange = viewRange; + } + + updateFrozenViewRange(viewRange: FrozenViewRange) { + this.frozenViewRange = viewRange; + } + + getViewRange() { + return this.dataViewRange; + } + + getFrozenViewRange() { + return this.frozenViewRange; + } + + /** + * 增量修改水平滚动条 + */ + deltaScrollLeft(delta: number) { + this.scrollLeft += delta; + if (this.scrollLeft < 0) { + this.scrollLeft = 0; + } + } + + getScrollTop() { + return this.scrollTop; + } + + setScrollTop(scrollTop: number) { + if (Math.round(scrollTop) !== Math.round(this.scrollTop)) { + this.scrollTop = scrollTop; + if (this.scrollTop < 0) { + this.scrollTop = 0; + } + } + } + + /** + * 增量修改垂直滚动条 + */ + deltaScrollTop(delta: number) { + this.scrollTop += delta; + if (this.scrollTop < 0) { + this.scrollTop = 0; + } + } + + /** + * 判断当前坐标下是什么 + * @param offsetX + * @param offsetY + * @returns + */ + hitTest(offsetX: number, offsetY: number): HitTestResult | null { + const {rowHeaderWidth, colHeaderHeight} = this.getRowColSize(); + const gridLineHitRange = this.renderOptions.gridLineHitRange; + const hitTestDrawingResult = this.hitTestDrawing(offsetX, offsetY); + if (hitTestDrawingResult) { + return hitTestDrawingResult; + } + + const hitTestResult = hitTest( + offsetX, + offsetY, + rowHeaderWidth, + colHeaderHeight, + gridLineHitRange, + this.dataViewRange, + this.frozenViewRange, + this.getMergeCells() + ); + + return hitTestResult; + } + + /** + * 判断是否点到图形上 + */ + hitTestDrawing(offsetX: number, offsetY: number): HitTestResult | null { + const drawing = this.getDrawing(); + const fakeCell = { + startRow: 0, + startCol: 0, + endRow: 0, + endCol: 0 + }; + if (drawing) { + for (const absoluteAnchor of drawing.absoluteAnchors) { + const position = this.absolutePositionToRelativePosition( + getAbsoluteAnchorPosition(absoluteAnchor) + ); + if (pointInRect(offsetX, offsetY, position)) { + return { + type: 'drawing', + drawing: absoluteAnchor, + region: 'normal', + ...fakeCell, + ...position + }; + } + } + + for (const oneCellAnchor of drawing.oneCellAnchors) { + const position = getOneCellAnchorPosition(oneCellAnchor, this); + if (pointInRect(offsetX, offsetY, position)) { + return { + type: 'drawing', + drawing: oneCellAnchor, + region: 'normal', + ...fakeCell, + ...position + }; + } + } + + for (const twoCellAnchor of drawing.twoCellAnchors) { + const position = getTwoCellAnchorPosition(twoCellAnchor, this); + if (pointInRect(offsetX, offsetY, position)) { + return { + type: 'drawing', + drawing: twoCellAnchor, + region: 'normal', + ...fakeCell, + ...position + }; + } + } + } + + return null; + } + + /** + * 将绝对地址转成在视图内的相对地址 + */ + absolutePositionToRelativePosition(absolutePos: Rect) { + return { + x: absolutePos.x - this.scrollLeft + this.rowHeaderWidth, + y: absolutePos.y - this.scrollTop + this.colHeaderHeight, + width: absolutePos.width, + height: absolutePos.height + }; + } + + /** + * 是否显示网格线,如果没有设置就使用 sheet 里的设置 + */ + showGridLines() { + if (typeof this.renderOptions.showGridLines === 'undefined') { + return this.currentSheetView.showGridLines; + } else { + return this.renderOptions.showGridLines; + } + } + + showRowColHeaders() { + return ( + this.renderOptions.showRowColHeaders && + this.currentSheetView.showRowColHeaders + ); + } + + /** + * 滚动时需要动态更新当前表的表头宽度 + */ + updateRowHeaderWidth(viewRange: ViewRange) { + // 这里的是 padding 的 4 倍 + const lastIndex = viewRange.rows[viewRange.rows.length - 1]; + this.rowHeaderWidth = + String(lastIndex).length * this.defaultFontSize.width + 4 * PADDING_SIZE; + + this.workbook.updateDataContainerSize( + this.rowHeaderWidth, + this.colHeaderHeight + ); + } + + /** + * 获取表头的大小 + */ + getRowColSize() { + if (this.showRowColHeaders()) { + return { + rowHeaderWidth: this.rowHeaderWidth, + colHeaderHeight: this.colHeaderHeight + }; + } else { + return { + rowHeaderWidth: 0, + colHeaderHeight: 0 + }; + } + } + + /** + * 获取范围内的数据 + */ + getCellValueByRange( + range: RangeRef, + includeHidden: boolean = false + ): CellValue[] { + return this.dataProvider.getCellValueByRange( + this.sheetIndex, + range, + includeHidden + ); + } + + /** + * 获取多个范围内的数据 + */ + getCellValueByRanges( + ranges: RangeRef[], + includeHidden: boolean = false + ): CellValue[] { + const result: CellValue[] = []; + for (const range of ranges) { + result.push(...this.getCellValueByRange(range, includeHidden)); + } + return result; + } + + /** + * 返回可视区域的数据及位置信息 + */ + getViewPointData(viewRange: ViewRange): DisplayData[] { + return getViewPointData( + (row: number) => { + return this.dataProvider.getSheetRowData(this.sheetIndex, row); + }, + () => { + return this.dataProvider.getMergeCells(this.sheetIndex); + }, + this.getRowHeight.bind(this), + this.getColWidth.bind(this), + viewRange + ); + } + + getSheetRowData(row: number) { + return this.dataProvider.getSheetRowData(this.sheetIndex, row); + } + + getRowHeight(row: number): number { + return this.dataProvider.getRowHeight(this.sheetIndex, row); + } + + getColWidth(col: number): number { + return this.dataProvider.getColWidth(this.sheetIndex, col); + } + + getTotalWidth(): number { + return Math.max( + this.getMaxDrawingHeightAndWidth().width, + this.dataProvider.getTotalWidth(this.sheetIndex) + ); + } + + getTotalHeight(): number { + return Math.max( + this.getMaxDrawingHeightAndWidth().height, + this.dataProvider.getTotalHeight(this.sheetIndex) + ); + } + + /** + * 获取某个单元格的实际位置信息 + * 如果这个单元格属于某个合并单元格,这里将返回合并单元格的位置信息 + * + * @param x 单元格的 x 坐标 + * @param y 单元格的 y 坐标 + */ + getCellDisplaySize(row: number, col: number, x: number, y: number) { + let rowHeight = this.getRowHeight(row); + let colWidth = this.getColWidth(col); + const mergeCells = this.getMergeCells(); + for (const mergeCell of mergeCells) { + const {startRow, endRow, startCol, endCol} = mergeCell; + if ( + row >= startRow && + row <= endRow && + col >= startCol && + col <= endCol + ) { + // 如果是合并单元格,需要计算出总高度和宽度 + let totalHeight = 0; + for (let i = startRow; i <= endRow; i++) { + totalHeight += this.getRowHeight(i); + } + rowHeight = totalHeight; + let totalWidth = 0; + for (let i = startCol; i <= endCol; i++) { + totalWidth += this.getColWidth(i); + } + colWidth = totalWidth; + + // 根据当前单元格 row 的 x 和 y 反选 startRow 和 startCol 的 x 和 y + for (let i = startRow; i < row; i++) { + y -= this.getRowHeight(i); + } + for (let i = startCol; i < col; i++) { + x -= this.getColWidth(i); + } + } + } + + return { + x, + y, + height: rowHeight, + width: colWidth + }; + } + + /** + * 获取最大行数 + */ + getMaxRow() { + return this.dataProvider.getMaxRow(this.sheetIndex); + } + + /** + * 获取最大列数 + */ + getMaxCol() { + return this.dataProvider.getMaxCol(this.sheetIndex); + } + + private rowPositionCache: IndexInfo[] = []; + private colPositionCache: IndexInfo[] = []; + + /** + * 获取可视范围内的数据范围,这个包括没有数据的部分,这个函数的性能很关键 + * @returns 从 0 开始的行和列 + */ + getViewPointRange(width: number, height: number): ViewRange { + return getViewRange( + this.scrollLeft, + this.scrollTop, + this.rowHeaderWidth, + this.colHeaderHeight, + height, + width, + (index: number) => this.dataProvider.getRowHeight(this.sheetIndex, index), + this.rowPositionCache, + (index: number) => this.dataProvider.getColWidth(this.sheetIndex, index), + this.colPositionCache, + this.dataProvider.getColHiddenRange(this.sheetIndex) + ); + } + + getFrozenTopLeftViewPointRange(xSplit: number, ySplit: number) { + return getFrozenTopLeftViewPointRange( + xSplit, + ySplit, + this.rowHeaderWidth, + this.colHeaderHeight, + (index: number) => this.dataProvider.getRowHeight(this.sheetIndex, index), + (index: number) => this.dataProvider.getColWidth(this.sheetIndex, index) + ); + } + + getFrozenTopViewPointRange(ySplit: number, width: number) { + return getFrozenTopViewPointRange( + ySplit, + width, + this.scrollLeft, + this.rowHeaderWidth, + this.colHeaderHeight, + (index: number) => this.dataProvider.getRowHeight(this.sheetIndex, index), + (index: number) => this.dataProvider.getColWidth(this.sheetIndex, index), + this.colPositionCache, + this.dataProvider.getColHiddenRange(this.sheetIndex) + ); + } + + getFrozenLeftViewPointRange(xSplit: number, height: number) { + return getFrozenLeftViewPointRange( + xSplit, + height, + this.scrollTop, + this.rowHeaderWidth, + this.colHeaderHeight, + (index: number) => this.dataProvider.getRowHeight(this.sheetIndex, index), + (index: number) => this.dataProvider.getColWidth(this.sheetIndex, index), + this.rowPositionCache + ); + } + + /** + * 获取单元格样式及数据 + */ + getCellInfo(row: number, col: number): CellInfo { + const cellInfo = this.dataProvider.getCellInfo(this.sheetIndex, row, col); + applyConditionalFormat(this, cellInfo, row, col); + applyTablePartsStyle(this, cellInfo); + return cellInfo; + } + + getCellData(row: number, col: number): CellData | undefined { + return this.dataProvider.getCellData(this.sheetIndex, row, col); + } + + getCellValue(row: number, col: number) { + return this.dataProvider.getCellValue(this.sheetIndex, row, col); + } + + /** + * 获取某个单元格在渲染时的位置信息,这个方法可以获取到没在渲染区域内的单元格位置 + */ + getCellPosition(row: number, col: number) { + const cellAbsolutePosition = getCellAbsolutePosition( + row, + col, + (index: number) => this.dataProvider.getRowHeight(this.sheetIndex, index), + this.rowPositionCache, + (index: number) => this.dataProvider.getColWidth(this.sheetIndex, index), + this.colPositionCache + ); + + return { + x: cellAbsolutePosition.x - this.scrollLeft + this.rowHeaderWidth, + y: cellAbsolutePosition.y - this.scrollTop + this.colHeaderHeight, + width: cellAbsolutePosition.width, + height: cellAbsolutePosition.height + }; + } + + getMergeCells() { + return this.dataProvider.getMergeCells(this.sheetIndex); + } + + getSelection() { + return this.selection; + } + + // 用于缓存最大的 drawing 的高度和宽度 + maxDrawingHeightAndWidthCache: {height: number; width: number} | null = null; + /** + * 获取最大 drawing 的高度和宽度,这个主要是为了滚动条计算 + */ + getMaxDrawingHeightAndWidth() { + if (this.maxDrawingHeightAndWidthCache) { + return this.maxDrawingHeightAndWidthCache; + } + const drawing = this.getDrawing(); + if (drawing) { + let maxWidth = 0; + let maxHeight = 0; + + for (const absoluteAnchor of drawing.absoluteAnchors) { + const size = getAbsoluteAnchorPosition(absoluteAnchor); + maxWidth = Math.max(maxWidth, size.x + size.width); + maxHeight = Math.max(maxHeight, size.y + size.height); + } + + for (const oneCellAnchor of drawing.oneCellAnchors) { + const size = getOneCellAnchorPosition(oneCellAnchor, this); + maxWidth = Math.max(maxWidth, size.x + size.width); + maxHeight = Math.max(maxHeight, size.y + size.height); + } + + for (const twoCellAnchor of drawing.twoCellAnchors) { + const size = getTwoCellAnchorPosition(twoCellAnchor, this); + maxWidth = Math.max(maxWidth, size.x + size.width); + maxHeight = Math.max(maxHeight, size.y + size.height); + } + + this.maxDrawingHeightAndWidthCache = { + height: maxHeight, + width: maxWidth + }; + + return { + height: maxHeight, + width: maxWidth + }; + } + + return { + height: 0, + width: 0 + }; + } + + /** + * 判断是否是某个合并单元格 + */ + isMergeCell(mergeCell: RangeRef) { + return isMergeCell(mergeCell, this.getMergeCells()); + } + + getDrawing() { + return this.dataProvider.getDrawing(this.sheetIndex); + } + + /** + * 获取当前 sheet 的显示区域 + */ + getDisplayRect(): Rect { + const {width, height} = this.workbook.getViewpointSize(); + return { + x: this.scrollLeft, + y: this.scrollTop, + width: width, + height: height + }; + } + + /** + * 获取数据区域的显示区域 + */ + getDataDisplayRect(): Rect { + const {width, height} = this.workbook.getViewpointSize(); + return { + x: this.scrollLeft + this.rowHeaderWidth, + y: this.scrollTop + this.colHeaderHeight, + width: width - this.rowHeaderWidth, + height: height - this.colHeaderHeight + }; + } + + getZoomLevel() { + return this.zoomLevel; + } + + setZoomLevel(zoomLevel: number) { + this.zoomLevel = zoomLevel; + this.workbook.uiEvent.emit('CHANGE_ZOOM_LEVEL', zoomLevel); + } + + getIndex() { + return this.sheetIndex; + } + + getConditionalFormatting() { + return this.dataProvider.getConditionalFormatting(this.sheetIndex); + } + + getRangeCache() { + return this.rangeCache; + } + + getWorkbook() { + return this.workbook; + } + + getExtLst() { + return this.sheetData.worksheet?.extLst; + } + + getSparklineGroups() { + for (const ext of this.getExtLst()?.ext || []) { + if (ext['x14:sparklineGroups']) { + return ext['x14:sparklineGroups']['x14:sparklineGroup'] || []; + } + } + return []; + } + + isHidden() { + return this.sheetData.state === 'hidden'; + } + + getTableParts() { + return this.sheetData.worksheet?.tableParts || []; + } + + isRowHidden(row: number) { + return this.dataProvider.isRowHidden(this.sheetIndex, row); + } + + isColHidden(col: number) { + return this.dataProvider.isColHidden(this.sheetIndex, col); + } + + getAutoFilter() { + return this.sheetData.worksheet?.autoFilter; + } + + getTables() { + return this.sheetData.worksheet?.tableParts || []; + } + + getLastAutoFilterIcon() { + return this.lastAutoFilterIcon; + } + + setLastAutoFilterIcon(autoFilterIcon: AutoFilterIconUI) { + this.lastAutoFilterIcon = autoFilterIcon; + } + + translate(key: EnKeys) { + return this.workbook.translator(key); + } + + /** + * 同步 AutoFilter,当 AutoFilter 有变化的时候调用 + */ + syncAutoFilter() {} + + /** + * 应用单个 AutoFilter + */ + applyAutoFilter(autoFilter: CT_AutoFilter, headerRowCount: number = 1) { + return applyAutoFilter( + this.sheetIndex, + this.workbook.getWorkbookData(), + this.sheetData, + this.dataProvider, + autoFilter, + headerRowCount + ); + } + + getSheetPr() { + return this.sheetData.worksheet?.sheetPr; + } + + getTabColor() { + return this.dataProvider.getColor(this.getSheetPr()?.tabColor); + } + + updateCellValue(row: number, col: number, data: CellData) { + this.dataProvider.updateCellData(this.sheetIndex, row, col, data); + } + + /** + * 修改行高 + * @param row + * @param height 行高,使用 px + */ + setRowHeight(row: number, height: number) { + this.dataProvider.setRowHeight(this.sheetIndex, row, height); + } + + setColWidth(col: number, width: number) { + this.dataProvider.setColWidth(this.sheetIndex, col, width); + } +} diff --git a/packages/office-viewer/src/excel/sheet/SheetBounding.ts b/packages/office-viewer/src/excel/sheet/SheetBounding.ts new file mode 100644 index 000000000..9b28d008c --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/SheetBounding.ts @@ -0,0 +1,27 @@ +/** + * 工作表的高宽,拆分一下避免 Workbook 代码太多 + */ + +import type {Sheet} from './Sheet'; + +export class SheetBounding { + sheet: Sheet; + constructor(sheet: Sheet) { + this.sheet = sheet; + } + + /** + * 当前数据所需的渲染空间,这个在初始时设置 + */ + contentBoundingRect: { + width: number; + height: number; + }; + + /** + * 获取数据所需的空间 + */ + getContentBoundingRect() { + return this.contentBoundingRect; + } +} diff --git a/packages/office-viewer/src/excel/sheet/ViewRange.ts b/packages/office-viewer/src/excel/sheet/ViewRange.ts new file mode 100644 index 000000000..f7d152a64 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/ViewRange.ts @@ -0,0 +1,65 @@ +/** + * 尺寸信息 + */ + +export type Size = { + size: number; + offset: number; +}; + +/** + * 区域 + */ +export type Region = + | 'normal' + | 'left-frozen' + | 'top-frozen' + | 'top-left-frozen'; + +/** + * 可视范围内的行列 + */ + +export type ViewRange = { + /** + * 所在区域 + */ + region: Region; + /** + * 行索引列表 + */ + rows: number[]; + /** + * 起始行的偏移量 + */ + startRowOffset: number; + + /** + * 行的位置相关信息 + */ + rowSizes: Size[]; + + /** + * 最大高度 + */ + height: number; + + /** + * 列索引的列表 + */ + cols: number[]; + /** + * 起始列偏移量 + */ + startColOffset: number; + + /** + * 列的位置信息 + */ + colSizes: Size[]; + + /** + * 最大宽度 + */ + width: number; +}; diff --git a/packages/office-viewer/src/excel/sheet/__test__/applyDxf.test.ts b/packages/office-viewer/src/excel/sheet/__test__/applyDxf.test.ts new file mode 100644 index 000000000..9d2524e1e --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/__test__/applyDxf.test.ts @@ -0,0 +1,39 @@ +import {CT_Dxf} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {applyDxf} from '../applyDxf'; + +test('applyF', () => { + const cellInfo = { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4, + tint: 0.5999938962981048 + }, + bgColor: { + theme: 4, + tint: 0.5999938962981048 + } + } + } + } as Partial; + + const dxf = { + fill: { + patternFill: { + patternType: 'solid', + fgColor: { + theme: 4 + }, + bgColor: { + theme: 4 + } + } + } + } as CT_Dxf; + + applyDxf(cellInfo, dxf); + + expect(cellInfo).toEqual(dxf); +}); diff --git a/packages/office-viewer/src/excel/sheet/__test__/colWidth.test.ts b/packages/office-viewer/src/excel/sheet/__test__/colWidth.test.ts new file mode 100644 index 000000000..dbc0af08e --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/__test__/colWidth.test.ts @@ -0,0 +1,10 @@ +import {colWidth2px, px2colWidth} from '../ColWidth'; + +test('colWidth2px', () => { + const width = 8.83203125; + const px = colWidth2px(width, 12); + + const colWidth = px2colWidth(px, 12); + + expect(colWidth).toBeCloseTo(width, 5); +}); diff --git a/packages/office-viewer/src/excel/sheet/__test__/getViewRange.test.ts b/packages/office-viewer/src/excel/sheet/__test__/getViewRange.test.ts new file mode 100644 index 000000000..09253d22a --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/__test__/getViewRange.test.ts @@ -0,0 +1,91 @@ +// import {getRange, getRange, getRangeInLength} from '../getViewRange'; + +import {findStartInCache, getRange} from '../getViewRange'; + +const cacheExample = [ + {offset: 0, size: 5}, + {offset: 20, size: 0}, + {offset: 20, size: 10}, + {offset: 30, size: 10}, + {offset: 60, size: 10}, + {offset: 80, size: 5}, + {offset: 100, size: 10} +]; + +test('searchIndex', () => { + expect(findStartInCache(cacheExample, 1)).toBe(0); + expect(findStartInCache(cacheExample, 20)).toBe(1); + expect(findStartInCache(cacheExample, 30)).toBe(2); + expect(findStartInCache(cacheExample, 35)).toBe(3); + expect(findStartInCache(cacheExample, 80)).toBe(5); + expect(findStartInCache(cacheExample, 90)).toBe(6); + expect(findStartInCache(cacheExample, 110)).toBe(6); +}); + +const sizeFunc = () => 20; + +test('simple.1', () => { + // 正好显示 3 个 + const range = getRange(0, 0, 60, sizeFunc); + + expect(range.indexes).toEqual([0, 1, 2]); + expect(range.sizes).toEqual([ + {size: 20, offset: 0}, + {size: 20, offset: 20}, + {size: 20, offset: 40} + ]); +}); + +test('simple.2', () => { + // 有 offset 但小于默认长度,显示 4 个 + const range = getRange(15, 0, 60, sizeFunc); + + expect(range.indexes).toEqual([0, 1, 2, 3]); + expect(range.sizes).toEqual([ + { + size: 20, + offset: -15 + }, + { + size: 20, + offset: 5 + }, + { + size: 20, + offset: 25 + }, + { + size: 20, + offset: 45 + } + ]); +}); + +test('simple.3', () => { + // 有 offset 但小于默认长度,显示 4 个 + const range = getRange(15, 0, 60, sizeFunc); + + expect(range).toEqual({ + indexes: [0, 1, 2, 3], + sizes: [ + { + size: 20, + offset: -15 + }, + { + size: 20, + offset: 5 + }, + { + size: 20, + offset: 25 + }, + { + size: 20, + offset: 45 + } + ], + length: 60, + startOffset: -15 + }); +}); diff --git a/packages/office-viewer/src/excel/sheet/applyConditionalFormat.ts b/packages/office-viewer/src/excel/sheet/applyConditionalFormat.ts new file mode 100644 index 000000000..3639a6b4d --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/applyConditionalFormat.ts @@ -0,0 +1,107 @@ +/** + * 计算条件格式 + */ + +import {CT_CfRule} from '../../openxml/ExcelTypes'; +import {isCellInRange, parseRange} from '../io/excel/util/Range'; +import {CellInfo} from '../types/CellInfo'; +import {RangeRef} from '../types/RangeRef'; +import {Sheet} from './Sheet'; +import {aboveAverage} from './cfRule/aboveAverage'; +import {cellIs} from './cfRule/cellIs'; +import {colorScale} from './cfRule/colorScale'; +import {dataBar} from './cfRule/dataBar'; +import {duplicateValues} from './cfRule/duplicateValues'; +import {iconSet} from './cfRule/iconSet'; +import {timePeriod} from './cfRule/timePeriod'; +import {top10} from './cfRule/top10'; +import {uniqueValues} from './cfRule/uniqueValues'; +import {containsText} from './cfRule/containsText'; +import {containsBlanks} from './cfRule/containsBlanks'; +import {containsErrors} from './cfRule/containsErrors'; +import {notContainsText} from './cfRule/notContainsText'; + +function evalRule( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + rule: CT_CfRule +): boolean { + const type = rule.type; + + switch (type) { + case 'cellIs': + return cellIs(sheet, cellInfo, rule); + + case 'uniqueValues': + return uniqueValues(sheet, cellInfo, ranges, rule); + + case 'duplicateValues': + return duplicateValues(sheet, cellInfo, ranges, rule); + + case 'aboveAverage': + return aboveAverage(sheet, cellInfo, ranges, rule); + + case 'top10': + return top10(sheet, cellInfo, ranges, rule); + + case 'colorScale': + return colorScale(sheet, cellInfo, ranges, rule); + + case 'dataBar': + return dataBar(sheet, cellInfo, ranges, rule); + + case 'iconSet': + return iconSet(sheet, cellInfo, ranges, rule); + + case 'timePeriod': + return timePeriod(sheet, cellInfo, ranges, rule); + + case 'containsText': + return containsText(sheet, cellInfo, rule); + + case 'notContainsText': + return notContainsText(sheet, cellInfo, rule); + + case 'containsBlanks': + return containsBlanks(sheet, cellInfo, rule); + + case 'containsErrors': + return containsErrors(sheet, cellInfo, rule); + + default: + console.warn('未知的条件格式类型', type); + } + return false; +} + +export function applyConditionalFormat( + sheet: Sheet, + cellInfo: CellInfo, + row: number, + col: number +) { + const conditionalFormatting = sheet.getConditionalFormatting(); + for (const formatting of conditionalFormatting) { + const sqref = formatting.sqref; + if (!sqref) { + continue; + } + const ranges = sqref.split(' ').map(parseRange); + for (const range of ranges) { + if (isCellInRange(range, row, col)) { + const cfRules = formatting.cfRule || []; + for (const rule of cfRules) { + try { + const evalResult = evalRule(sheet, cellInfo, ranges, rule); + if (rule.stopIfTrue && evalResult) { + break; + } + } catch (error) { + console.warn('条件格式处理失败', error); + } + } + } + } + } +} diff --git a/packages/office-viewer/src/excel/sheet/applyDxf.ts b/packages/office-viewer/src/excel/sheet/applyDxf.ts new file mode 100644 index 000000000..c915924f4 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/applyDxf.ts @@ -0,0 +1,28 @@ +import {CT_Dxf} from '../../openxml/ExcelTypes'; +import {CellInfo} from '../types/CellInfo'; + +/** + * 应用单元格样式,xdf 是指 Differential formatting,所以只应用部分样式 + */ +export function applyDxf(cellInfo: Partial, dxf?: CT_Dxf | null) { + if (dxf) { + if (dxf.font) { + cellInfo.font = { + ...cellInfo.font, + ...dxf.font + }; + } + if (dxf.fill) { + cellInfo.fill = { + ...cellInfo.fill, + ...dxf.fill + }; + } + if (dxf.border) { + cellInfo.border = { + ...cellInfo.border, + ...dxf.border + }; + } + } +} diff --git a/packages/office-viewer/src/excel/sheet/applyTablePartsStyle.ts b/packages/office-viewer/src/excel/sheet/applyTablePartsStyle.ts new file mode 100644 index 000000000..b741a95aa --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/applyTablePartsStyle.ts @@ -0,0 +1,23 @@ +import {isCellInRange, parseRange} from '../io/excel/util/Range'; +import {CellInfo} from '../types/CellInfo'; +import {Sheet} from './Sheet'; +import {applyTableStyle} from './table/applyTableStyle'; + +/** + * 对单元格应用表格样式 + */ +export function applyTablePartsStyle(sheet: Sheet, cellInfo: CellInfo) { + const row = cellInfo.row; + const col = cellInfo.col; + for (const tablePart of sheet.getTableParts()) { + if (!tablePart.ref) { + console.warn('表格缺少 ref 字段', tablePart); + continue; + } + const ref = parseRange(tablePart.ref); + + if (isCellInRange(ref, row, col)) { + applyTableStyle(cellInfo, tablePart, ref, sheet, row, col); + } + } +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/__test__/aboveAverage.test.ts b/packages/office-viewer/src/excel/sheet/cfRule/__test__/aboveAverage.test.ts new file mode 100644 index 000000000..f1cb65709 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/__test__/aboveAverage.test.ts @@ -0,0 +1,16 @@ +import {getAverageValue} from '../aboveAverage'; + +test('getAverageValue - empty array', () => { + const values: number[] = []; + expect(getAverageValue(values)).toBeNull(); +}); + +test('getAverageValue - single value', () => { + const values: number[] = [5]; + expect(getAverageValue(values)).toEqual(5); +}); + +test('getAverageValue - multiple values', () => { + const values: number[] = [1, 2, 3, 4, 5]; + expect(getAverageValue(values)).toEqual(3); +}); diff --git a/packages/office-viewer/src/excel/sheet/cfRule/__test__/cellIs.test.ts b/packages/office-viewer/src/excel/sheet/cfRule/__test__/cellIs.test.ts new file mode 100644 index 000000000..1aa8fe05b --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/__test__/cellIs.test.ts @@ -0,0 +1,37 @@ +import {notBetween} from '../cellIs'; + +test('notBetween - text is not between the given values', () => { + const text = '5'; + const formula = ['1', '10']; + expect(notBetween(text, formula)).toBe(false); +}); + +test('notBetween - text is equal to the first value', () => { + const text = '1'; + const formula = ['1', '10']; + expect(notBetween(text, formula)).toBe(false); +}); + +test('notBetween - text is equal to the second value', () => { + const text = '10'; + const formula = ['1', '10']; + expect(notBetween(text, formula)).toBe(false); +}); + +test('notBetween - text is larger the given values', () => { + const text = '11'; + const formula = ['1', '10']; + expect(notBetween(text, formula)).toBe(true); +}); + +test('notBetween - text is smaller the given values', () => { + const text = '0'; + const formula = ['1', '10']; + expect(notBetween(text, formula)).toBe(true); +}); + +test('notBetween - text is not a number', () => { + const text = 'abc'; + const formula = ['1', '10']; + expect(notBetween(text, formula)).toBe(false); +}); diff --git a/packages/office-viewer/src/excel/sheet/cfRule/__test__/top10.test.ts b/packages/office-viewer/src/excel/sheet/cfRule/__test__/top10.test.ts new file mode 100644 index 000000000..8277f5d73 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/__test__/top10.test.ts @@ -0,0 +1,58 @@ +import {getRankValue} from '../top10'; + +const values = [1, 2, 3, 4, 5, 6, 7, 8]; + +test('top.1', () => { + const cfRule = { + rank: 1 + }; + expect(getRankValue(values, cfRule)).toEqual(8); +}); + +test('top.2', () => { + const cfRule = { + rank: 2 + }; + expect(getRankValue(values, cfRule)).toEqual(7); +}); + +test('bottom.1', () => { + const cfRule = { + rank: 1, + bottom: true + }; + expect(getRankValue(values, cfRule)).toEqual(1); +}); + +test('bottom.2', () => { + const cfRule = { + rank: 2, + bottom: true + }; + expect(getRankValue(values, cfRule)).toEqual(2); +}); + +test('top-percent.1', () => { + const cfRule = { + rank: 1, + percent: true + }; + expect(getRankValue(values, cfRule)).toEqual(8); +}); + +test('top-percent.20', () => { + const cfRule = { + rank: 20, + percent: true + }; + expect(getRankValue(values, cfRule)).toEqual(7); +}); + +test('bottom-percent.1', () => { + const cfRule = { + rank: 1, + bottom: true, + percent: true + }; + expect(getRankValue(values, cfRule)).toEqual(1); +}); diff --git a/packages/office-viewer/src/excel/sheet/cfRule/aboveAverage.ts b/packages/office-viewer/src/excel/sheet/cfRule/aboveAverage.ts new file mode 100644 index 000000000..4187eb897 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/aboveAverage.ts @@ -0,0 +1,78 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {gt, gte, lte} from '../../../util/number'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; + +export function getAverageValue(values: number[]) { + if (values.length === 0) { + return null; + } + const sum = values.reduce((prev, curr) => prev + curr, 0); + return sum / values.length; +} + +/** + * 对大于或小于平均值的应用样式 + */ +export function aboveAverage( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + if (cellInfo.value === '') { + return false; + } + const rangeCache = sheet.getRangeCache(); + let rangeAverage = rangeCache.get(ranges, 'average'); + + if (!rangeAverage) { + const rangeValues = sheet.getCellValueByRanges(ranges); + if (rangeValues.length === 0) { + return false; + } + const values: number[] = []; + rangeValues.map(value => { + if (value.text === '') { + return; + } + values.push(parseFloat(value.value)); + }); + + rangeAverage = getAverageValue(values); + if (rangeAverage === null) { + return false; + } + rangeCache.set(ranges, 'average', rangeAverage); + } + const value = parseFloat(cellInfo.value); + + if (cfRule.aboveAverage === false) { + if (cfRule.equalAverage === true) { + if (lte(value, rangeAverage)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + } else { + if (lte(value, rangeAverage)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + } + } else { + if (cfRule.equalAverage === true) { + if (gte(value, rangeAverage)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + } else { + if (gt(value, rangeAverage)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + } + } + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/applyCfRuleDxf.ts b/packages/office-viewer/src/excel/sheet/cfRule/applyCfRuleDxf.ts new file mode 100644 index 000000000..331917be0 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/applyCfRuleDxf.ts @@ -0,0 +1,19 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {Sheet} from '../Sheet'; +import {applyDxf} from '../applyDxf'; + +/** + * 应用单元格样式,xdf 是指 Differential formatting,所以只应用部分样式 + */ +export function applyCfRuleDxf( + cfRule: CT_CfRule, + sheet: Sheet, + cellInfo: CellInfo +) { + const dxfId = cfRule.dxfId || 0; + const dataProvider = sheet.workbook.getDataProvider(); + + const dxf = dataProvider.getDxf(dxfId); + applyDxf(cellInfo, dxf); +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/cellIs.ts b/packages/office-viewer/src/excel/sheet/cfRule/cellIs.ts new file mode 100644 index 000000000..82c09196d --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/cellIs.ts @@ -0,0 +1,188 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {gt, gte, lt, lte} from '../../../util/number'; +import {CellInfo} from '../../types/CellInfo'; +import {Sheet} from '../Sheet'; + +import {applyCfRuleDxf} from './applyCfRuleDxf'; + +export function equal(text: string, formula: string[]) { + const firstFormula = formula[0]; + return text === firstFormula; +} + +export function notEqual(text: string, formula: string[]) { + const firstFormula = formula[0]; + return text !== firstFormula; +} + +export function greaterThan(text: string, formula: string[]) { + const firstFormula = formula[0]; + try { + const textValue = parseFloat(text); + const formulaValue = parseFloat(firstFormula); + return gt(textValue, formulaValue); + } catch (error) { + console.warn('error', error); + } + + return false; +} + +export function greaterThanOrEqual(text: string, formula: string[]) { + const firstFormula = formula[0]; + try { + const textValue = parseFloat(text); + const formulaValue = parseFloat(firstFormula); + return gte(textValue, formulaValue); + } catch (error) { + console.warn('error', error); + } + return false; +} + +export function lessThan(text: string, formula: string[]) { + const firstFormula = formula[0]; + try { + const textValue = parseFloat(text); + const formulaValue = parseFloat(firstFormula); + return lt(textValue, formulaValue); + } catch (error) { + console.warn('error', error); + } + return false; +} + +export function lessThanOrEqual(text: string, formula: string[]) { + const firstFormula = formula[0]; + try { + const textValue = parseFloat(text); + const formulaValue = parseFloat(firstFormula); + return lte(textValue, formulaValue); + } catch (error) { + console.warn('error', error); + } + return false; +} + +export function between(text: string, formula: string[]) { + try { + const textValue = parseFloat(text); + const firstValue = parseFloat(formula[0]); + const secondValue = parseFloat(formula[1]); + return gte(textValue, firstValue) && lte(textValue, secondValue); + } catch (error) { + console.warn('error', error); + } + return false; +} + +export function notBetween(text: string, formula: string[]) { + try { + const textValue = parseFloat(text); + const firstValue = parseFloat(formula[0]); + const secondValue = parseFloat(formula[1]); + return lt(textValue, firstValue) || gt(textValue, secondValue); + } catch (error) { + console.warn('error', error); + } + return false; +} + +export function containsText(text: string, formula: string[]) { + const firstFormula = formula[0]; + return text.includes(firstFormula); +} + +export function notContains(text: string, formula: string[]) { + const firstFormula = formula[0]; + return !text.includes(firstFormula); +} + +export function beginsWith(text: string, formula: string[]) { + const firstFormula = formula[0]; + return text.startsWith(firstFormula); +} + +export function endsWith(text: string, formula: string[]) { + const firstFormula = formula[0]; + return text.endsWith(firstFormula); +} + +function evalOperator(operator: string, text: string, formula: string[]) { + switch (operator) { + case 'equal': + return equal(text, formula); + + case 'notEqual': + return notEqual(text, formula); + + case 'greaterThan': + return greaterThan(text, formula); + + case 'greaterThanOrEqual': + return greaterThanOrEqual(text, formula); + + case 'lessThan': + return lessThan(text, formula); + + case 'lessThanOrEqual': + return lessThanOrEqual(text, formula); + + case 'between': + return between(text, formula); + + case 'notBetween': + return notBetween(text, formula); + + case 'containsText': + return containsText(text, formula); + + case 'notContains': + return notContains(text, formula); + + case 'beginsWith': + return beginsWith(text, formula); + + case 'endsWith': + return endsWith(text, formula); + + default: + console.warn('未知的 operator', operator); + } + return false; +} + +/** + * 类似 + * + 50 + + */ + +export function cellIs( + sheet: Sheet, + cellInfo: CellInfo, + cfRule: CT_CfRule +): boolean { + const formula = cfRule.formula || []; + if (!formula.length) { + return false; + } + + let value = cellInfo.value; + + const operator = cfRule.operator; + + if (value === '' || !operator) { + return false; + } + + let match = evalOperator(operator, value, formula); + + if (match) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/colorScale.ts b/packages/office-viewer/src/excel/sheet/cfRule/colorScale.ts new file mode 100644 index 000000000..9689428cc --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/colorScale.ts @@ -0,0 +1,174 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {Color, interpolateColor} from '../../../util/color'; +import {getMinMax} from './getMinMax'; + +/** + * 缓存里的内容 + */ +type ScaleCacheValue = { + min: number; + + max: number; + + /** + * 颜色范围定义 + */ + colors: { + percent: number; + color: Color; + }[]; +}; + +/** + * 色阶 + */ +export function colorScale( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + const rangeCache = sheet.getRangeCache(); + const ruleKey = JSON.stringify(cfRule); + let rangeColorScale = rangeCache.get(ranges, ruleKey) as + | ScaleCacheValue + | undefined; + const colorScale = cfRule.colorScale; + + if (!colorScale) { + return false; + } + + if (!rangeColorScale) { + const dataProvider = sheet.workbook.getDataProvider(); + const cfvo = colorScale.cfvo; + const color = colorScale.color; + + if (!cfvo || !color) { + console.warn('色阶规则不完整'); + return false; + } + + if (cfvo.length !== color.length) { + console.warn('色阶规则不匹配'); + return false; + } + + const rangeValues = sheet.getCellValueByRanges(ranges); + + const {min, max} = getMinMax(rangeValues); + + if (min === undefined || max === undefined) { + return false; + } + + const colors: ScaleCacheValue['colors'] = []; + + for (const [i, cfvoItem] of cfvo.entries()) { + const type = cfvoItem.type; + switch (type) { + case 'min': { + const colorValue = dataProvider.getColor(color[i]); + if (colorValue !== 'none') { + colors.push({ + percent: 0, + color: new Color(colorValue) + }); + } + break; + } + + case 'max': { + const colorValue = dataProvider.getColor(color[i]); + if (colorValue !== 'none') { + colors.push({ + percent: 1, + color: new Color(colorValue) + }); + } + break; + } + + case 'percentile': { + const val = parseInt(cfvoItem.val || '50', 10); + const percent = val / 100; + const colorValue = dataProvider.getColor(color[i]); + if (colorValue !== 'none') { + colors.push({ + percent, + color: new Color(colorValue) + }); + } + break; + } + + default: + console.warn('未知的 cfvo type', type); + break; + } + } + + if (colors.length < 2) { + console.warn('色彩数量不足'); + } + + // 排序一下避免 xml 里乱序 + colors.sort((a, b) => a.percent - b.percent); + + rangeColorScale = { + min: min, + max: max, + colors + }; + + rangeCache.set(ranges, ruleKey, rangeColorScale); + } + + const value = parseFloat(cellInfo.value); + + // 当前值所在的百分比 + const percent = + (value - rangeColorScale.min) / (rangeColorScale.max - rangeColorScale.min); + // 查找所属色阶 + let endColor; + let endPercent = 1; + let startPercent = 0; + let startColor = rangeColorScale.colors[0].color; + + for (const color of rangeColorScale.colors) { + if (percent >= startPercent && percent < color.percent) { + endColor = color.color; + endPercent = color.percent; + break; + } + startColor = color.color; + startPercent = color.percent; + } + + if (endColor === undefined) { + endColor = rangeColorScale.colors[rangeColorScale.colors.length - 1].color; + } + + let percentRange = endPercent - startPercent; + // 避免除 0 + if (percentRange === 0) { + percentRange = 1; + } + + const backgroundColor = interpolateColor( + startColor, + endColor, + (percent - startPercent) / percentRange + ); + + cellInfo.fill = { + patternFill: { + bgColor: {rgb: 'FF' + backgroundColor} + } + }; + + return true; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/containsBlanks.ts b/packages/office-viewer/src/excel/sheet/cfRule/containsBlanks.ts new file mode 100644 index 000000000..acbba705b --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/containsBlanks.ts @@ -0,0 +1,19 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; +/** + * 空内容 + */ +export function containsBlanks( + sheet: Sheet, + cellInfo: CellInfo, + cfRule: CT_CfRule +): boolean { + if (cellInfo.value.trim() === '') { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/containsErrors.ts b/packages/office-viewer/src/excel/sheet/cfRule/containsErrors.ts new file mode 100644 index 000000000..c754f9b4c --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/containsErrors.ts @@ -0,0 +1,22 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; +/** + * 包含错误 + */ +export function containsErrors( + sheet: Sheet, + cellInfo: CellInfo, + cfRule: CT_CfRule +): boolean { + if ( + typeof cellInfo.cellData === 'object' && + cellInfo.cellData.type === 'error' + ) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/containsText.ts b/packages/office-viewer/src/excel/sheet/cfRule/containsText.ts new file mode 100644 index 000000000..0e80490fc --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/containsText.ts @@ -0,0 +1,23 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; +/** + * 包含文本 + */ +export function containsText( + sheet: Sheet, + cellInfo: CellInfo, + cfRule: CT_CfRule +): boolean { + if (!cfRule.text) { + return false; + } + + if (cellInfo.value.includes(cfRule.text)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/dataBar.ts b/packages/office-viewer/src/excel/sheet/cfRule/dataBar.ts new file mode 100644 index 000000000..5cbd29ceb --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/dataBar.ts @@ -0,0 +1,240 @@ +import {CT_CfRule, CT_DataBar} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {getMinMax} from './getMinMax'; +import {Color} from '../../../util/color'; +import {CT_ExtensionList} from '../../types/CT_ExtensionList'; +import {DataBarDisplay} from '../../types/DataBarDisplay'; +import {gt, lt} from '../../../util/number'; + +/** + * 查找对应的扩展 + */ +function findExt(extLst: CT_ExtensionList[], sheetExtLst?: CT_ExtensionList) { + if (!sheetExtLst) { + return null; + } + for (const exts of extLst || []) { + for (const ext of exts.ext || []) { + const x14Id = ext['x14:id']; + if (x14Id) { + for (const sheetExt of sheetExtLst.ext || []) { + const x14CFs = + sheetExt['x14:conditionalFormattings']?.[ + 'x14:conditionalFormatting' + ]; + for (const x14CFItem of x14CFs || []) { + const x14CfRules = x14CFItem['x14:cfRule']; + for (const x14CfRule of x14CfRules || []) { + if (x14CfRule.id === x14Id) { + return x14CfRule['x14:dataBar']; + } + } + } + } + } + } + } + return null; +} + +function getGradientColor(c: string) { + const color = new Color(c); + // 根据 Excel 里的展现判断的 + color.changeHsl(0.93, 'l', 'set'); + return color.toHex(); +} + +/** + * 构建展现配置 + */ +function buildDataBarDisplay( + min: number, + max: number, + worksheet: Sheet, + cfRule: CT_CfRule +) { + const dataBarDisplay: DataBarDisplay = { + showValue: true, + gradient: true, + border: false, + percent: 0, + color: '', + colorGradient: '', + borderColor: '', + negativeFillColor: '', + negativeFillColorGradient: '', + negativeBorderColor: '', + axisColor: '', + direction: 'leftToRight', + biDirectional: false + }; + + const dataBar = cfRule.dataBar as CT_DataBar; + const dataProvider = worksheet.workbook.getDataProvider(); + + if (dataBar.color) { + dataBarDisplay.color = dataProvider.getColor(dataBar.color); + if (dataBarDisplay.color !== 'none') { + dataBarDisplay.colorGradient = getGradientColor(dataBarDisplay.color); + } + } + + if (dataBar.showValue === false) { + dataBarDisplay.showValue = false; + } + + // Excel 2010 之后的版本才有的扩展 + if (cfRule.extLst) { + const x14DataBar = findExt(cfRule.extLst, worksheet.getExtLst()); + if (!x14DataBar) { + console.warn('cx14DataBar not found', cfRule.extLst); + return dataBarDisplay; + } + + if (x14DataBar.gradient === false) { + dataBarDisplay.gradient = false; + } + + if (lt(min, 0) && gt(max, 0)) { + dataBarDisplay.biDirectional = true; + } + + if (x14DataBar.direction) { + dataBarDisplay.direction = x14DataBar.direction; + } + + if (x14DataBar.border === true) { + dataBarDisplay.border = true; + } + + if (x14DataBar['x14:borderColor']) { + dataBarDisplay.borderColor = dataProvider.getColor( + x14DataBar['x14:borderColor'] + ); + } + + if (x14DataBar['x14:negativeFillColor']) { + dataBarDisplay.negativeFillColor = dataProvider.getColor( + x14DataBar['x14:negativeFillColor'] + ); + + if (dataBarDisplay.negativeFillColor !== 'none') { + dataBarDisplay.negativeFillColorGradient = getGradientColor( + dataBarDisplay.negativeFillColor + ); + } + } + + if (x14DataBar.negativeBarColorSameAsPositive === true) { + dataBarDisplay.negativeFillColor = dataBarDisplay.color; + dataBarDisplay.negativeFillColorGradient = dataBarDisplay.colorGradient; + } + + if (x14DataBar.negativeBarBorderColorSameAsPositive === false) { + if (x14DataBar['x14:negativeBorderColor']) { + dataBarDisplay.negativeBorderColor = dataProvider.getColor( + x14DataBar['x14:negativeBorderColor'] + ); + } + } else { + dataBarDisplay.negativeBorderColor = dataBarDisplay.borderColor; + } + + if (x14DataBar['x14:axisColor']) { + dataBarDisplay.axisColor = dataProvider.getColor( + x14DataBar['x14:axisColor'] + ); + } + } + + return dataBarDisplay; +} + +/** + * 缓存里的内容 + */ +type ScaleCacheValue = { + min: number; + + max: number; + + /** + * dataBar 展现配置 + */ + dataBarDisplay: DataBarDisplay; +}; + +/** + * dataBar + */ +export function dataBar( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + if (!cfRule.dataBar) { + return false; + } + + if (cfRule.dataBar.cfvo?.length !== 2) { + console.warn('dataBar cfvo length !== 2', cfRule.dataBar.cfvo); + return false; + } + + const rangeCache = sheet.getRangeCache(); + const ruleKey = JSON.stringify(cfRule); + let dataBarCache = rangeCache.get(ranges, ruleKey) as ScaleCacheValue; + if (!dataBarCache) { + const rangeValues = sheet.getCellValueByRanges(ranges); + let {min, max} = getMinMax(rangeValues); + let cfvo1 = cfRule.dataBar.cfvo?.[0]; + let cfvo2 = cfRule.dataBar.cfvo?.[1]; + if (cfvo1.type === 'num') { + min = parseFloat(cfvo1.val || '0'); + } + if (cfvo2.type === 'num') { + max = parseFloat(cfvo2.val || '1'); + } + // todo,还得支持 percent percentile formula + if (min === undefined || max === undefined) { + return false; + } + // 避免除数为 0 + if (min === max) { + return false; + } + const dataBarDisplay = buildDataBarDisplay(min, max, sheet, cfRule); + + dataBarCache = { + min, + max, + dataBarDisplay + }; + rangeCache.set(ranges, ruleKey, dataBarCache); + } + + const value = parseFloat(cellInfo.value); + const dataBarDisplay = dataBarCache.dataBarDisplay; + if (dataBarDisplay.biDirectional) { + if (lt(value, 0)) { + const percent = value / dataBarCache.min; + dataBarDisplay.percent = -percent; + } else if (gt(value, 0)) { + const percent = value / dataBarCache.max; + dataBarDisplay.percent = percent; + } else { + dataBarDisplay.percent = 0; + } + } else { + const percent = + (value - dataBarCache.min) / (dataBarCache.max - dataBarCache.min); + + dataBarDisplay.percent = percent; + } + + cellInfo.dataBarDisplay = dataBarDisplay; + return true; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/duplicateValues.ts b/packages/office-viewer/src/excel/sheet/cfRule/duplicateValues.ts new file mode 100644 index 000000000..31d4da25c --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/duplicateValues.ts @@ -0,0 +1,41 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; + +/** + * 对重复值应用样式 + */ +export function duplicateValues( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + const rangeCache = sheet.getRangeCache(); + let rangeDuplicateValues = rangeCache.get(ranges, 'duplicateValues'); + if (!rangeDuplicateValues) { + rangeDuplicateValues = new Set(); + const allValues = new Set(); + const rangeValues = sheet.getCellValueByRanges(ranges); + for (const value of rangeValues) { + if (value.text === '') { + continue; + } + if (allValues.has(value.text)) { + rangeDuplicateValues.add(value.text); + } else { + allValues.add(value.text); + } + } + rangeCache.set(ranges, 'duplicateValues', rangeDuplicateValues); + } + + if (rangeDuplicateValues.has(cellInfo.value)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/getMinMax.ts b/packages/office-viewer/src/excel/sheet/cfRule/getMinMax.ts new file mode 100644 index 000000000..9277d1ab0 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/getMinMax.ts @@ -0,0 +1,26 @@ +import {CellValue} from '../../types/CellValue'; +import {gt, lt} from '../../../util/number'; + +export function getMinMax(rangeValues: CellValue[]) { + let min; + let max; + + for (const value of rangeValues) { + const val = value.value; + if (val === '' || val === undefined) { + continue; + } + const num = parseFloat(val); + if (min === undefined || lt(num, min)) { + min = num; + } + if (max === undefined || gt(num, max)) { + max = num; + } + } + + return { + min, + max + }; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/iconSet.ts b/packages/office-viewer/src/excel/sheet/cfRule/iconSet.ts new file mode 100644 index 000000000..807bea69e --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/iconSet.ts @@ -0,0 +1,130 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {presetIconSet} from '../../io/excel/preset/presetIconSet'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {getMinMax} from './getMinMax'; +import {IconNames} from '../../io/excel/preset/presetIcons'; +import {getPercent} from '../../../util/number'; + +/** + * 缓存里的内容 + */ +type RangeIconSetCache = { + min: number; + + max: number; + + /** + * 颜色范围定义 + */ + icons: { + percent: number; + icon: IconNames; + }[]; +}; + +/** + * 应用图标样式 + */ + +export function iconSet( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + const rangeCache = sheet.getRangeCache(); + const ruleKey = JSON.stringify(cfRule); + let rangeIconSet = rangeCache.get(ranges, 'ruleKey'); + if (!rangeIconSet) { + const iconSet = cfRule.iconSet; + if (!iconSet) { + return false; + } + const iconSetName = iconSet.iconSet || '3TrafficLights1'; + + const cfvo = iconSet.cfvo; + + if (!cfvo) { + console.warn('图标集规则不完整'); + return false; + } + + const rangeValues = sheet.getCellValueByRanges(ranges); + + const icons: RangeIconSetCache['icons'] = []; + + let presetIcon = presetIconSet[iconSetName]; + + if (!presetIcon) { + console.warn('未知的图标集', iconSetName); + return false; + } + + if (iconSet.reverse === true) { + presetIcon = presetIcon.slice().reverse(); + } + + for (const [i, cfvoItem] of cfvo.entries()) { + const type = cfvoItem.type; + switch (type) { + // 目前还不知道这两个啥区别 + case 'percentile': + case 'percent': { + const val = parseInt(cfvoItem.val || '50', 10); + const percent = val / 100; + const icon = presetIcon[i]; + if (typeof icon === 'undefined') { + console.warn('未知的图标', iconSetName); + return false; + } + icons.push({ + percent, + icon + }); + break; + } + + default: + console.warn('未知的 cfvo type', type); + break; + } + const {min, max} = getMinMax(rangeValues); + + if (min === undefined || max === undefined) { + return false; + } + + if (icons.length === 0) { + console.warn('图标集为空'); + return false; + } + + rangeIconSet = { + min, + max, + icons + }; + } + } + + const value = parseFloat(cellInfo.value); + + // 当前值所在的百分比 + const percent = getPercent(value, rangeIconSet.min, rangeIconSet.max); + + // 查找所属 icon + let startIcon = rangeIconSet.icons[0].icon; + for (const icon of rangeIconSet.icons) { + if (percent <= icon.percent) { + break; + } + startIcon = icon.icon; + } + + // 应用图标 + cellInfo.icon = startIcon; + + return true; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/notContainsText.ts b/packages/office-viewer/src/excel/sheet/cfRule/notContainsText.ts new file mode 100644 index 000000000..dc66ca89d --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/notContainsText.ts @@ -0,0 +1,23 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; +/** + * 不包含文本 + */ +export function notContainsText( + sheet: Sheet, + cellInfo: CellInfo, + cfRule: CT_CfRule +): boolean { + if (!cfRule.text) { + return false; + } + + if (!cellInfo.value.includes(cfRule.text)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/timePeriod.ts b/packages/office-viewer/src/excel/sheet/cfRule/timePeriod.ts new file mode 100644 index 000000000..061bc5534 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/timePeriod.ts @@ -0,0 +1,166 @@ +import {CT_CfRule, ST_TimePeriod} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; +import {fromExcelDate} from '../../io/excel/util/fromExcelDate'; + +function isToday(date: Date) { + const now = new Date(); + return ( + date.getFullYear() === now.getFullYear() && + date.getMonth() === now.getMonth() && + date.getDate() === now.getDate() + ); +} + +function isYesterday(date: Date) { + const now = new Date(); + const yesterday = new Date(now); + yesterday.setDate(now.getDate() - 1); + return ( + date.getFullYear() === yesterday.getFullYear() && + date.getMonth() === yesterday.getMonth() && + date.getDate() === yesterday.getDate() + ); +} + +function isTomorrow(date: Date) { + const now = new Date(); + const tomorrow = new Date(now); + tomorrow.setDate(now.getDate() + 1); + return ( + date.getFullYear() === tomorrow.getFullYear() && + date.getMonth() === tomorrow.getMonth() && + date.getDate() === tomorrow.getDate() + ); +} + +function isThisMonth(date: Date) { + const now = new Date(); + return ( + date.getFullYear() === now.getFullYear() && + date.getMonth() === now.getMonth() + ); +} + +function isLastMonth(date: Date) { + const now = new Date(); + const lastMonth = new Date(now); + lastMonth.setMonth(now.getMonth() - 1); + return ( + date.getFullYear() === lastMonth.getFullYear() && + date.getMonth() === lastMonth.getMonth() + ); +} + +function isNextMonth(date: Date) { + const now = new Date(); + const nextMonth = new Date(now); + nextMonth.setMonth(now.getMonth() + 1); + return ( + date.getFullYear() === nextMonth.getFullYear() && + date.getMonth() === nextMonth.getMonth() + ); +} + +function isThisWeek(date: Date) { + const now = new Date(); + const day = now.getDay(); + const start = new Date(now); + start.setDate(now.getDate() - day); + start.setHours(0, 0, 0, 0); + const end = new Date(start); + end.setDate(start.getDate() + 7); + return date >= start && date < end; +} + +function isLastWeek(date: Date) { + const now = new Date(); + const day = now.getDay(); + const start = new Date(now); + start.setDate(now.getDate() - day - 7); + start.setHours(0, 0, 0, 0); + const end = new Date(start); + end.setDate(start.getDate() + 7); + return date >= start && date < end; +} + +function isNextWeek(date: Date) { + const now = new Date(); + const day = now.getDay(); + const start = new Date(now); + start.setDate(now.getDate() - day + 7); + start.setHours(0, 0, 0, 0); + const end = new Date(start); + end.setDate(start.getDate() + 7); + return date >= start && date < end; +} + +function isLast7Days(date: Date) { + const now = new Date(); + const start = new Date(now); + start.setDate(now.getDate() - 7); + start.setHours(0, 0, 0, 0); + return date >= start && date < now; +} + +export function checkDate(date: Date, timePeriod: ST_TimePeriod) { + switch (timePeriod) { + case 'today': + return isToday(date); + case 'yesterday': + return isYesterday(date); + case 'tomorrow': + return isTomorrow(date); + case 'last7Days': + return isLast7Days(date); + case 'thisMonth': + return isThisMonth(date); + case 'lastMonth': + return isLastMonth(date); + case 'nextMonth': + return isNextMonth(date); + case 'thisWeek': + return isThisWeek(date); + case 'lastWeek': + return isLastWeek(date); + case 'nextWeek': + return isNextWeek(date); + default: + return false; + } +} + +/** + * 时间相关的判断,这里不依赖公式 + */ + +export function timePeriod( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + const timePeriod = cfRule.timePeriod; + if (!timePeriod) { + return false; + } + + const dateValue = cellInfo.value; + + if (dateValue === undefined) { + return false; + } + + // 这是天,要先转成秒 + + const date = fromExcelDate(dateValue, sheet.workbook.is1904()); + + if (checkDate(date, timePeriod)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/top10.ts b/packages/office-viewer/src/excel/sheet/cfRule/top10.ts new file mode 100644 index 000000000..cb76863fc --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/top10.ts @@ -0,0 +1,90 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {gt, gte, lt, lte} from '../../../util/number'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; + +export function getRankValue( + values: number[], + cfRule: CT_CfRule +): number | null { + if (values.length === 0) { + return null; + } + + // 用大小堆会更快但预计数据量不大就直接排序了 + values.sort((a, b) => { + if (lt(a, b)) { + return -1; + } + if (gt(a, b)) { + return 1; + } + return 0; + }); + + let top10Number = cfRule.rank || 10; + if (cfRule.percent) { + top10Number = Math.ceil(values.length * (top10Number / 100)); + } + + top10Number = Math.max(Math.min(top10Number, values.length), 1); + + // 默认是从小到大排序的 + if (cfRule.bottom) { + return values[top10Number - 1]; + } else { + return values[values.length - top10Number]; + } +} + +/** + * 处理 top 值的规则 + */ + +export function top10( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + const rangeCache = sheet.getRangeCache(); + const ruleKey = JSON.stringify(cfRule); + let rankValue = rangeCache.get(ranges, ruleKey); + if (!rankValue) { + const rangeValues = sheet.getCellValueByRanges(ranges); + if (rangeValues.length === 0) { + return false; + } + const values: number[] = []; + rangeValues.map(value => { + if (value.text === '') { + return; + } + values.push(parseFloat(value.value)); + }); + rankValue = getRankValue(values, cfRule); + + if (rankValue === null) { + return false; + } + rangeCache.set(ranges, ruleKey, rankValue); + } + + const value = parseFloat(cellInfo.value); + + if (cfRule.bottom) { + if (lte(value, rankValue)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + } else { + if (gte(value, rankValue)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + } + + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/cfRule/uniqueValues.ts b/packages/office-viewer/src/excel/sheet/cfRule/uniqueValues.ts new file mode 100644 index 000000000..d40925e6a --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/cfRule/uniqueValues.ts @@ -0,0 +1,42 @@ +import {CT_CfRule} from '../../../openxml/ExcelTypes'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {applyCfRuleDxf} from './applyCfRuleDxf'; + +/** + * 对不重复值应用样式 + */ + +export function uniqueValues( + sheet: Sheet, + cellInfo: CellInfo, + ranges: RangeRef[], + cfRule: CT_CfRule +): boolean { + const rangeCache = sheet.getRangeCache(); + let rangeUniqueValues = rangeCache.get(ranges, 'uniqueValues'); + if (!rangeUniqueValues) { + rangeUniqueValues = new Set(); + const allValues = new Set(); + const rangeValues = sheet.getCellValueByRanges(ranges); + for (const value of rangeValues) { + if (value.text === '') { + continue; + } + if (allValues.has(value.text)) { + rangeUniqueValues.delete(value.text); + } else { + allValues.add(value.text); + rangeUniqueValues.add(value.text); + } + } + rangeCache.set(ranges, 'uniqueValues', rangeUniqueValues); + } + + if (rangeUniqueValues.has(cellInfo.value)) { + applyCfRuleDxf(cfRule, sheet, cellInfo); + return true; + } + return false; +} diff --git a/packages/office-viewer/src/excel/sheet/getCellAbsolutePosition.ts b/packages/office-viewer/src/excel/sheet/getCellAbsolutePosition.ts new file mode 100644 index 000000000..004d62ce1 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/getCellAbsolutePosition.ts @@ -0,0 +1,50 @@ +import {IndexInfo} from './getViewRange'; + +function findSizeInCache( + index: number, + positionCache: IndexInfo[], + getSize: (index: number) => number +) { + if (positionCache[index] !== undefined) { + return positionCache[index]; + } else { + const lastIndex = Math.max(0, positionCache.length - 1); + for (let i = lastIndex; i <= index; i++) { + const size = getSize(i); + if (i !== 0) { + positionCache[i] = { + offset: positionCache[i - 1].offset + positionCache[i - 1].size, + size + }; + } else { + positionCache[i] = { + offset: 0, + size + }; + } + } + return positionCache[index]; + } +} + +/** + * 获取单元格的绝对位置 + */ +export function getCellAbsolutePosition( + row: number, + col: number, + getRowHeight: (index: number) => number, + rowPositionCache: IndexInfo[] = [], + getColWidth: (index: number) => number, + colPositionCache: IndexInfo[] = [] +) { + const rowPosition = findSizeInCache(row, rowPositionCache, getRowHeight); + const colPosition = findSizeInCache(col, colPositionCache, getColWidth); + + return { + x: colPosition.offset, + y: rowPosition.offset, + width: colPosition.size, + height: rowPosition.size + }; +} diff --git a/packages/office-viewer/src/excel/sheet/getViewPointData.ts b/packages/office-viewer/src/excel/sheet/getViewPointData.ts new file mode 100644 index 000000000..d9466379c --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/getViewPointData.ts @@ -0,0 +1,182 @@ +import {RangeRef} from '../types/RangeRef'; +import {CellData, hasValue} from '../types/worksheet/CellData'; +import {DisplayData} from './Sheet'; +import {ViewRange} from './ViewRange'; + +/** + * 计算单元格的高宽,主要是得考虑合并单元格的情况 + * @param row + * @param col + * @param rowHeight + * @param colWidth + * @param mergeCells + * @returns + */ +export function calcCellDisplaySize( + row: number, + col: number, + rowHeight: number, + colWidth: number, + getRowHeight: (row: number) => number, + getColWidth: (row: number) => number, + mergeCells: RangeRef[] +) { + let displayWidth = colWidth; + let displayHeight = rowHeight; + let isMergeCell = false; + let matchMergeCell: RangeRef | undefined = undefined; + // 用于标识是哪个合并单元格 + let mergeCellId = ''; + for (const mergeCell of mergeCells) { + const {startRow, endRow, startCol, endCol} = mergeCell; + mergeCellId = `${startRow}-${endRow}-${startCol}-${endCol}`; + if (row >= startRow && row <= endRow && col >= startCol && col <= endCol) { + isMergeCell = true; + matchMergeCell = mergeCell; + // 补上合并单元格的高宽 + if (startRow !== endRow) { + for (let i = row + 1; i <= endRow; i++) { + displayHeight += getRowHeight(i); + } + } + if (startCol !== endCol) { + for (let i = col + 1; i <= endCol; i++) { + displayWidth += getColWidth(i); + } + } + } + } + + return { + isMergeCell, + mergeCell: matchMergeCell, + mergeCellId, + displayHeight, + displayWidth + }; +} + +/** + * 返回可视区域的数据及位置信息,拆分函数方便但要测试 + */ + +export function getViewPointData( + getSheetRowData: (row: number) => CellData[], + getMergeCells: () => RangeRef[], + getRowHeight: (index: number) => number, + getColWidth: (index: number) => number, + viewRange: ViewRange +): DisplayData[] { + const {rows, rowSizes, cols, colSizes} = viewRange; + + const displayData: DisplayData[] = []; + + const mergeCells = getMergeCells(); + + // 已经渲染的合并单元格 + const renderedMergeCell = new Set(); + + let rIndex = 0; + for (let rowIndex of rows) { + const rowHeight = rowSizes[rIndex].size; + const rowData = getSheetRowData(rowIndex); + + let cIndex = 0; + for (let colIndex of cols) { + const colWidth = colSizes[cIndex].size; + + if (rowData[colIndex] !== undefined) { + const value = rowData[colIndex]; + let displayWidth = colWidth; + let displayHeight = rowHeight; + let needClear = false; + // 是否忽略渲染,这种情况主要是发生在合并单元格的时候 + let ignore = false; + if (mergeCells.length) { + const displaySize = calcCellDisplaySize( + rowIndex, + colIndex, + rowHeight, + colWidth, + getRowHeight, + getColWidth, + mergeCells + ); + if (displaySize.isMergeCell) { + displayWidth = displaySize.displayWidth; + displayHeight = displaySize.displayHeight; + if (hasValue(value)) { + needClear = true; + renderedMergeCell.add(displaySize.mergeCellId); + } else { + // 没有值的情况下,不需要渲染 + ignore = true; + + // 还有另一个情况是在合并单元格下,第一个单元格不再显示,这时需要手动将第一个单元格信息补上 + // 目前这个逻辑是比较复杂,但目前这样做性能最好 + if ( + !renderedMergeCell.has(displaySize.mergeCellId) && + displaySize.mergeCell + ) { + // 反算第一个单元格的位置 + let x = colSizes[cIndex].offset; + let y = rowSizes[rIndex].offset; + const {startCol, startRow} = displaySize.mergeCell; + + // 当前单元格相对于第一个单元格在 x 方向的偏移 + let xOffset = 0; + for (let i = startCol; i < colIndex; i++) { + xOffset += getColWidth(i); + } + + x -= xOffset; + + // 当前单元格相对于第一个单元格在 y 方向的偏移 + let yOffset = 0; + for (let i = startRow; i < rowIndex; i++) { + yOffset += getRowHeight(i); + } + + y == yOffset; + + const value = getSheetRowData(startRow)[startCol]; + + displayData.push({ + x, + y, + width: displayWidth + xOffset, + height: displayHeight + yOffset, + row: startRow, + col: startCol, + value, + needClear: true + }); + // 避免再次添加 + renderedMergeCell.add(displaySize.mergeCellId); + } + } + } + } + + if (!ignore) { + displayData.push({ + x: colSizes[cIndex].offset, + y: rowSizes[rIndex].offset, + width: displayWidth, + height: displayHeight, + row: rowIndex, + col: colIndex, + value, + needClear + }); + } + } + + cIndex++; + } + + rIndex++; + } + + return displayData; +} diff --git a/packages/office-viewer/src/excel/sheet/getViewRange.ts b/packages/office-viewer/src/excel/sheet/getViewRange.ts new file mode 100644 index 000000000..da9998791 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/getViewRange.ts @@ -0,0 +1,259 @@ +import {Size, ViewRange} from './ViewRange'; + +export interface RangeInfo { + /** + * 索引列表 + */ + indexes: number[]; + + /** + * 起始偏移量 + */ + startOffset: number; + + /** + * 每个索引的尺寸信息 + */ + sizes: Size[]; + + /** + * 最大长度 + */ + length: number; +} + +/** + * 索引位置缓存信息 + */ +export interface IndexInfo { + offset: number; + size: number; +} + +/** + * 影藏列范围 + */ +export interface HiddenRange { + min: number; + max: number; +} + +/** + * 使用二分查找第一个大于等于目标值的索引,也就是在某个偏移量下能看到的第一个单元格 + * @param rangeCache + * @param target + * @returns + */ +export function findStartInCache(rangeCache: IndexInfo[], target: number) { + let start = 0, + end = rangeCache.length - 1; + let found = -1; + + while (start < end) { + let mid = Math.floor((start + end) / 2); + + const indexInfo = rangeCache[mid]; + // 找不到说明 bug 了 + if (!indexInfo) { + console.error('findStartInCache indexInfo is undefined'); + break; + } + + const indexRange = indexInfo.offset + indexInfo.size; + if (indexRange === target) { + found = mid; + break; + } else if (indexRange < target) { + start = mid + 1; + } else { + end = mid; + } + } + if (found !== -1) { + return found; + } else { + return start; + } +} + +/** + * 获取范围内的索引列表 + * @param offset 滚动条偏移 + * @param shift 表头导致的偏移 + * @param totalLength 总长度 + * @param getHeight 获取长度的方法 + * @param hiddenRange 隐藏的范围 + * @param rangeCache 位置信息缓存 + * @returns + */ +export function getRange( + offset: number, + shift: number, + totalLength: number, + getHeight: (index: number) => number, + hiddenRange: HiddenRange[] = [], + rangeCache: IndexInfo[] = [] +): RangeInfo { + // 从零开始遍历直到找到 + let foundStart = false; + let foundEnd = false; + let index = 0; + let startOffset = 0; + let currentOffset = 0; + // 这些都不能为 undefined,避免后面计算死循环 + offset = offset || 0; + totalLength = totalLength || 0; + const indexes: number[] = []; + const sizes: Size[] = []; + const MAX_LOOP = 10000; + let loop = 0; + if (rangeCache.length) { + const lastRangeCache = rangeCache[rangeCache.length - 1]; + if (lastRangeCache.offset < offset) { + index = rangeCache.length; + currentOffset = lastRangeCache.offset; + } else { + const foundIndex = findStartInCache(rangeCache, offset); + // 这时肯定有找到,为 -1 基本上是 bug + if (foundIndex !== -1) { + index = foundIndex; + currentOffset = rangeCache[index].offset; + } + } + } + + while (!(foundStart && foundEnd)) { + // 如果有隐藏列就直接跳到下一个不隐藏的列,避免很大隐藏列导致性能卡顿 + for (const range of hiddenRange) { + if (index >= range.min && index <= range.max) { + index = range.max + 1; + // 将索引信息加入到缓存中,只处理一次 + if (range.max > rangeCache.length - 1) { + for (let i = range.min; i <= range.max; i++) { + rangeCache[i] = { + offset: currentOffset, + size: 0 + }; + } + } + continue; + } + } + + const cellLength = getHeight(index) || 0; + rangeCache[index] = { + offset: currentOffset, + size: cellLength + }; + + // 第一次大于 offset 就找到了开始位置 + if (currentOffset + cellLength >= offset && !foundStart) { + startOffset = currentOffset - offset; + foundStart = true; + indexes.push(index); + sizes.push({ + size: cellLength, + offset: currentOffset - offset + shift + }); + currentOffset += cellLength; + index = index + 1; + continue; + } + + // 第一次大于结束位置就找到了结束位置 + if (currentOffset + cellLength >= offset + totalLength && !foundEnd) { + foundEnd = true; + indexes.push(index); + sizes.push({ + size: cellLength, + offset: currentOffset - offset + shift + }); + } + + // 中间节点 + if (foundStart && !foundEnd) { + indexes.push(index); + sizes.push({ + size: cellLength, + offset: currentOffset - offset + shift + }); + } + + currentOffset += cellLength; + + // 避免是死循环 + if (loop++ > MAX_LOOP) { + console.error('getRange loop too many times'); + break; + } + index = index + 1; + } + + return { + indexes, + sizes, + startOffset, + length: totalLength + shift + }; +} + +/** + * 获取视口范围的单元格区域,拆分单独函数是为了方便单元测试,这部分逻辑不需要依赖 UI 展现 + * + * @param scrollLeft 水平滚动条 + * @param scrollTop 垂直滚动条 + * @param leftShift 左偏移量,主要是表头导致的偏移量 + * @param topShift 上偏移量,主要是表头导致的偏移量 + * @param height 窗口高度 + * @param width 窗口宽度 + * @param defaultRowHeight 行默认高度 + * @param defaultColWidth 列默认宽度 + * @param customRowHeight 自定义行高 + * @param customColWidth 自定义列宽 + * + * @returns 从 0 开始的行和列,以及初始的坐标 + */ +export function getViewRange( + scrollLeft: number, + scrollTop: number, + leftShift: number, + topShift: number, + height: number, + width: number, + getRowHeight: (index: number) => number, + rowPositionCache: IndexInfo[] = [], + getColWidth: (index: number) => number, + colPositionCache: IndexInfo[] = [], + colHiddenRange: HiddenRange[] = [] +): ViewRange { + const { + indexes: rows, + startOffset: startRowOffset, + sizes: rowSizes + } = getRange(scrollTop, topShift, height, getRowHeight, [], rowPositionCache); + + const { + indexes: cols, + startOffset: startColOffset, + sizes: colSizes + } = getRange( + scrollLeft, + leftShift, + width, + getColWidth, + colHiddenRange, + colPositionCache + ); + + return { + region: 'normal', + rows, + rowSizes, + height, + startRowOffset, + cols, + colSizes, + width, + startColOffset + }; +} diff --git a/packages/office-viewer/src/excel/sheet/table/__test__/calcTableRelativePosition.test.ts b/packages/office-viewer/src/excel/sheet/table/__test__/calcTableRelativePosition.test.ts new file mode 100644 index 000000000..d8bbb6c89 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/table/__test__/calcTableRelativePosition.test.ts @@ -0,0 +1,169 @@ +import {RangeRef} from '../../../types/RangeRef'; +import {calcTableRelativePosition} from '../calcTableRelativePosition'; + +// 一个 9 行列的表格,有 1 个表头、一个汇总行 +// 第 3 行和第 3 列是隐藏的 + +const range: RangeRef = { + startRow: 0, + startCol: 0, + endRow: 9, + endCol: 9 +}; + +const isRowHidden = (rowIndex: number) => rowIndex === 2; + +const isColHidden = (colIndex: number) => colIndex === 2; + +const headerRowCount = 1; + +const totalsRowCount = 1; + +const totalsRowShown = true; + +test('header', () => { + // 有 header 的时候第一行是 header + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 0, + 0, + headerRowCount, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + rowType: 'header', + colType: 'odd', + rowPosition: 'header', + colPosition: 'first' + }); +}); + +test('without header', () => { + // 如果没有 header 的时候第一行是第一行 + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 0, + 0, + 0, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + rowType: 'odd', + colType: 'odd', + rowPosition: 'first', + colPosition: 'first' + }); +}); + +test('firstRow', () => { + // 有 header 的时候第二个数据是 first + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 1, + 0, + headerRowCount, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + colPosition: 'first', + colType: 'odd', + rowPosition: 'first', + rowType: 'odd' + }); +}); + +test('row two', () => { + // 有 header 的时候第 4 个数据是偶数,也就是相对位置第 2 个 + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 3, + 0, + headerRowCount, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + colPosition: 'first', + colType: 'odd', + rowPosition: 'middle', + rowType: 'even' + }); +}); + +test('odd', () => { + // 有 header 的时候第 3 个数据是第 0 个 + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 2, + 0, + headerRowCount, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + rowType: 'odd', + rowPosition: 'first', + colType: 'odd', + colPosition: 'first' + }); +}); + +test('event', () => { + // 因为第 3 行是隐藏的,所以第 6 行变成第 4 行,因为要减去 header 和 totals + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 5, + 0, + headerRowCount, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + colPosition: 'first', + colType: 'odd', + rowType: 'even', + rowPosition: 'middle' + }); +}); + +test('last row', () => { + // 因为第 3 行隐藏的,所以第 9 行是最后一行 + expect( + calcTableRelativePosition( + range, + isRowHidden, + isColHidden, + 8, + 0, + headerRowCount, + totalsRowCount, + totalsRowShown + ) + ).toEqual({ + colPosition: 'first', + colType: 'odd', + rowPosition: 'last', + rowType: 'odd' + }); +}); diff --git a/packages/office-viewer/src/excel/sheet/table/applyTableStyle.ts b/packages/office-viewer/src/excel/sheet/table/applyTableStyle.ts new file mode 100644 index 000000000..c9a57eab4 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/table/applyTableStyle.ts @@ -0,0 +1,128 @@ +import {CT_Dxf, CT_Table} from '../../../openxml/ExcelTypes'; +import {presetTableStyles} from '../../io/excel/preset/presetTableStyles'; +import {CellInfo} from '../../types/CellInfo'; +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; +import {applyDxf} from '../applyDxf'; +import {buildTableStyle} from './buildTableStyle'; +import {calcTableRelativePosition} from './calcTableRelativePosition'; + +export function applyTableStyle( + cellInfo: CellInfo, + tablePart: CT_Table, + ref: RangeRef, + sheet: Sheet, + row: number, + col: number +) { + const headerRowCount = tablePart.headerRowCount ?? 1; + let totalsRowShown = tablePart.totalsRowShown || true; + let totalsRowCount = tablePart.totalsRowCount || 0; + // 这是来自 MS-OI29500 P291 的说明,如果 totalsRowCount 为 0,那么 totalsRowShown 必须为 true + if (totalsRowCount > 0) { + totalsRowShown = true; + } + const tableStyleInfo = tablePart.tableStyleInfo; + if (!tableStyleInfo) { + console.warn('表格缺少 tableStyleInfo 字段', tablePart); + return; + } + const name = tableStyleInfo.name; + // 表格名称 + if (!name) { + console.warn('表格缺少 name 字段', tablePart); + return; + } + + const tableStyle = presetTableStyles[name]; + + if (!tableStyle) { + console.warn('未知的表格样式', name); + return; + } + + const tablePosition = calcTableRelativePosition( + ref, + r => sheet.isRowHidden(r), + c => sheet.isColHidden(c), + row, + col, + headerRowCount, + totalsRowCount, + totalsRowShown + ); + + const showFirstColumn = tableStyleInfo.showFirstColumn || false; + const showLastColumn = tableStyleInfo.showLastColumn || false; + const showRowStripes = tableStyleInfo.showRowStripes || false; + const showColumnStripes = tableStyleInfo.showColumnStripes || false; + + const dxfs = tableStyle.dxfs.dxf || []; + + const tableStyles = buildTableStyle(tableStyle); + + if (tableStyles.wholeTable !== undefined) { + applyDxf(cellInfo, dxfs[tableStyles.wholeTable]); + } + + if ( + showRowStripes && + tablePosition.rowType === 'odd' && + tableStyles.firstRowStripe !== undefined + ) { + applyDxf(cellInfo, dxfs[tableStyles.firstRowStripe]); + } + + if ( + showColumnStripes && + tablePosition.colType === 'odd' && + tableStyles.firstColumnStripe !== undefined + ) { + applyDxf(cellInfo, dxfs[tableStyles.firstColumnStripe]); + } + + if ( + tablePosition.rowType === 'header' && + tableStyles.headerRow !== undefined + ) { + applyDxf(cellInfo, dxfs[tableStyles.headerRow]); + } + + if (tablePosition.rowType === 'total' && tableStyles.totalRow !== undefined) { + applyDxf(cellInfo, dxfs[tableStyles.totalRow]); + } + + if ( + showFirstColumn && + tablePosition.colPosition === 'first' && + tableStyles.firstColumn !== undefined + ) { + applyDxf(cellInfo, dxfs[tableStyles.firstColumn]); + } + + if ( + showLastColumn && + tablePosition.colPosition === 'last' && + tableStyles.lastColumn !== undefined + ) { + applyDxf(cellInfo, dxfs[tableStyles.lastColumn]); + } + + // 表格内部添加默认白色分隔线,目前不知道这样做是否正确 + if (!cellInfo.border) { + cellInfo.border = { + bottom: { + color: { + rgb: 'FFFFFFFF' + }, + style: 'thin' + }, + right: { + color: { + rgb: 'FFFFFFFF' + }, + style: 'thin' + } + }; + } +} diff --git a/packages/office-viewer/src/excel/sheet/table/buildTableStyle.ts b/packages/office-viewer/src/excel/sheet/table/buildTableStyle.ts new file mode 100644 index 000000000..494525bd4 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/table/buildTableStyle.ts @@ -0,0 +1,64 @@ +import {TableStyleDef} from '../../types/TableStyleDef'; + +/** + * 构建演示表,这个主要原因是样式应用有顺序要求,所以先构建为对象格式 + */ +export function buildTableStyle(tableStyle: TableStyleDef) { + let wholeTable: undefined | number; + let headerRow: undefined | number; + let firstRowStripe: undefined | number; + let firstColumnStripe: undefined | number; + let totalRow: undefined | number; + let firstColumn: undefined | number; + let lastColumn: undefined | number; + + for (const tableStyleElement of tableStyle.tableStyles.tableStyle?.[0] + ?.tableStyleElement || []) { + const type = tableStyleElement.type; + let dxfId = tableStyleElement.dxfId ?? 1; + // 文档里说是从 0 开始,但其实是从 1 开始 + dxfId = dxfId - 1; + switch (type) { + case 'wholeTable': + wholeTable = dxfId; + break; + + case 'headerRow': + headerRow = dxfId; + break; + + case 'firstRowStripe': + firstRowStripe = dxfId; + break; + + case 'firstColumnStripe': + firstColumnStripe = dxfId; + break; + + case 'totalRow': + totalRow = dxfId; + break; + + case 'firstColumn': + firstColumn = dxfId; + break; + + case 'lastColumn': + lastColumn = dxfId; + break; + + default: + break; + } + } + + return { + wholeTable, + headerRow, + firstRowStripe, + firstColumnStripe, + totalRow, + firstColumn, + lastColumn + }; +} diff --git a/packages/office-viewer/src/excel/sheet/table/calcTableRelativePosition.ts b/packages/office-viewer/src/excel/sheet/table/calcTableRelativePosition.ts new file mode 100644 index 000000000..9fd056b35 --- /dev/null +++ b/packages/office-viewer/src/excel/sheet/table/calcTableRelativePosition.ts @@ -0,0 +1,134 @@ +import {RangeRef} from '../../types/RangeRef'; +import {Sheet} from '../Sheet'; + +export type RelationPosition = { + // 行类型 + rowType: 'header' | 'odd' | 'even' | 'total'; + colType: 'odd' | 'even'; + rowPosition: 'header' | 'first' | 'last' | 'middle' | 'total'; + colPosition: 'first' | 'last' | 'middle'; +}; + +/** + * 计算出这个位置相对于表格区域的位置,这个可以缓存的,但先不优化 + */ + +export function calcTableRelativePosition( + tableRange: RangeRef, + isRowHidden: (rowIndex: number) => boolean, + isColHidden: (colIndex: number) => boolean, + row: number, + col: number, + headerRowCount: number, + totalsRowCount: number, + totalsRowShown: boolean +): RelationPosition { + let rowType: RelationPosition['rowType'] | undefined = undefined; + let colType: RelationPosition['colType'] | undefined = undefined; + let rowPosition: RelationPosition['rowPosition'] = 'middle'; + let colPosition: RelationPosition['colPosition'] = 'middle'; + + // 总行数 + let rowCount = 0; + // 当前行在表格中的相对位置,这个是包含表头的 + let relativeRow = 0; + + for ( + let rowIndex = tableRange.startRow; + rowIndex <= tableRange.endRow; + rowIndex++ + ) { + if (!isRowHidden(rowIndex)) { + rowCount++; + } + if (rowIndex === row) { + relativeRow = rowCount - 1; + } + } + // 当前行在表格中的相对位置,这个是去掉表头的 + let relativeRowWithoutHeader = relativeRow; + if (headerRowCount > 0) { + relativeRowWithoutHeader = relativeRowWithoutHeader - headerRowCount; + } + + if (relativeRowWithoutHeader % 2 === 0) { + rowType = 'odd'; + } else { + rowType = 'even'; + } + + if (relativeRowWithoutHeader === 0) { + rowPosition = 'first'; + } + + if (headerRowCount && relativeRow < headerRowCount) { + rowPosition = 'header'; + rowType = 'header'; + } + + if ( + relativeRowWithoutHeader === + rowCount - headerRowCount - totalsRowCount - 1 + ) { + rowPosition = 'last'; + } + + if (totalsRowShown) { + if ( + relativeRowWithoutHeader >= + rowCount - headerRowCount - totalsRowCount + ) { + rowType = 'total'; + rowPosition = 'total'; + } + } + + // 总列数 + let colCount = 0; + // 当前列在表格中的相对位置 + let relativeCol = 0; + + for ( + let colIndex = tableRange.startCol; + colIndex <= tableRange.endCol; + colIndex++ + ) { + if (!isColHidden(colIndex)) { + colCount++; + } + if (colIndex === col) { + relativeCol = colCount - 1; + } + } + + if (relativeCol % 2 === 0) { + colType = 'odd'; + } else { + colType = 'even'; + } + + if (relativeCol === 0) { + colPosition = 'first'; + } + + if (relativeCol === colCount - 1) { + colPosition = 'last'; + } + + if (rowType === undefined) { + console.warn('calcRelativeType error', row, col, tableRange); + rowType = 'odd'; + } + + if (colType === undefined) { + console.warn('calcRelativeType error', row, col, tableRange); + colType = 'odd'; + } + + return { + rowType, + colType, + rowPosition, + colPosition + }; +} diff --git a/packages/office-viewer/src/excel/types/CT_Color.ts b/packages/office-viewer/src/excel/types/CT_Color.ts new file mode 100644 index 000000000..226451e63 --- /dev/null +++ b/packages/office-viewer/src/excel/types/CT_Color.ts @@ -0,0 +1,28 @@ +import {Attributes} from '../../openxml/Attributes'; + +export interface CT_Color { + auto?: boolean; + indexed?: number; + rgb?: string; + theme?: number; + tint?: number; +} + +export const CT_Color_Attributes: Attributes = { + auto: { + type: 'boolean' + }, + indexed: { + type: 'int' + }, + rgb: { + type: 'string' + }, + theme: { + type: 'int' + }, + tint: { + type: 'double', + defaultValue: '0.0' + } +}; diff --git a/packages/office-viewer/src/excel/types/CT_ExtensionList.ts b/packages/office-viewer/src/excel/types/CT_ExtensionList.ts new file mode 100644 index 000000000..515b72457 --- /dev/null +++ b/packages/office-viewer/src/excel/types/CT_ExtensionList.ts @@ -0,0 +1,14 @@ +import {Attributes} from '../../openxml/Attributes'; +import {Ext, Ext_Attributes} from './Ext'; + +export type CT_ExtensionList = { + ext?: Ext[]; +}; + +export const CT_ExtensionList_Attributes: Attributes = { + ext: { + type: 'child', + childAttributes: Ext_Attributes, + childIsArray: true + } +}; diff --git a/packages/office-viewer/src/excel/types/CT_Theme.ts b/packages/office-viewer/src/excel/types/CT_Theme.ts new file mode 100644 index 000000000..60d5dbc90 --- /dev/null +++ b/packages/office-viewer/src/excel/types/CT_Theme.ts @@ -0,0 +1,27 @@ +/** + * 补充了 clrSchemes 方便查找 + */ + +import { + CT_BaseStyles, + CT_Color, + CT_ColorSchemeList, + CT_CustomColorList, + CT_ObjectStyleDefaults, + CT_OfficeArtExtensionList, + CT_OfficeStyleSheet +} from '../../openxml/DMLTypes'; + +export interface CT_Theme extends CT_OfficeStyleSheet { + themeElements?: CT_MyBaseStyles; + objectDefaults?: CT_ObjectStyleDefaults; + extraClrSchemeLst?: CT_ColorSchemeList; + custClrLst?: CT_CustomColorList; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export interface CT_MyBaseStyles extends CT_BaseStyles { + // 数组格式方便按索引查 + clrSchemes?: CT_Color[]; +} diff --git a/packages/office-viewer/src/excel/types/CellInfo.ts b/packages/office-viewer/src/excel/types/CellInfo.ts new file mode 100644 index 000000000..50e4af86b --- /dev/null +++ b/packages/office-viewer/src/excel/types/CellInfo.ts @@ -0,0 +1,75 @@ +import { + CT_Border, + CT_CellAlignment, + CT_Fill, + CT_Font +} from '../../openxml/ExcelTypes'; +import {CellData} from './worksheet/CellData'; +import {DataBarDisplay} from './DataBarDisplay'; +import {IconNames} from '../io/excel/preset/presetIcons'; + +/** + * 单元格信息,主要是用于展现 + */ + +export interface CellInfo { + /** + * 行号 + */ + row: number; + + /** + * 列号 + */ + col: number; + + /** + * 字体 + */ + font: CT_Font; + + /** + * 背景色 + */ + fill?: CT_Fill; + + /** + * 边框 + */ + border?: CT_Border; + + /** + * 最终展现的文本 + */ + text: string; + + /** + * 文本对齐方式 + */ + alignment?: CT_CellAlignment; + + /** + * dataBar 展现配置 + */ + dataBarDisplay?: DataBarDisplay; + + /** + * 图标,用于 iconSet + */ + icon?: IconNames; + + /** + * 原始值,可能是空字符串 + */ + value: string; + + /** + * 原始数据 + */ + cellData: CellData; + + /** + * 是否需要裁剪,这个用来支持自动裁剪,参考 autoClip.ts + */ + needClip?: boolean; +} diff --git a/packages/office-viewer/src/excel/types/CellValue.ts b/packages/office-viewer/src/excel/types/CellValue.ts new file mode 100644 index 000000000..93508bdc9 --- /dev/null +++ b/packages/office-viewer/src/excel/types/CellValue.ts @@ -0,0 +1,17 @@ +/** + * 单元格的值 + */ +export type CellValue = { + row: number; + col: number; + /** + * 单元格最终展现的文本 + */ + text: string; + + value: string; + + color?: string; + + isDate?: boolean; +}; diff --git a/packages/office-viewer/src/excel/types/DataBarDisplay.ts b/packages/office-viewer/src/excel/types/DataBarDisplay.ts new file mode 100644 index 000000000..33b85eeb5 --- /dev/null +++ b/packages/office-viewer/src/excel/types/DataBarDisplay.ts @@ -0,0 +1,72 @@ +/** + * data bar 的展现定义,用于渲染时的绘制 + */ + +import {X14DataBar} from './X14CF/X14DataBar'; + +export type DataBarDisplay = { + /** + * 是否显示数值 + */ + showValue: boolean; + + /** + * 百分比,可能是负数 + */ + percent: number; + + /** + * 展现的颜色 + */ + color: string; + + /** + * 是否有边框 + */ + border: boolean; + + /** + * 是否渐变 + */ + gradient: boolean; + + /** + * 渐变颜色 + */ + colorGradient: string; + + /** + * 边框颜色 + */ + borderColor: string; + + /** + * 负数的填充颜色 + */ + negativeFillColor: string; + + /** + * 负数的填充渐变颜色 + */ + negativeFillColorGradient: string; + + /** + * 负数的边框颜色 + */ + negativeBorderColor: string; + + /** + * 坐标轴颜色 + */ + axisColor: string; + + /** + * 方向 + */ + direction: X14DataBar['direction']; + + /** + * 是否双向显示,左边是负数,右边是正数 + */ + biDirectional: boolean; +}; diff --git a/packages/office-viewer/src/excel/types/ExcelFile.ts b/packages/office-viewer/src/excel/types/ExcelFile.ts new file mode 100644 index 000000000..7888d0b32 --- /dev/null +++ b/packages/office-viewer/src/excel/types/ExcelFile.ts @@ -0,0 +1,15 @@ +/** + * Excel 文件定义主入口,包括所有相关文件 + */ + +import {ContentTypes} from '../../openxml/ContentType'; +import {IWorkbook} from './IWorkbook'; + +export interface ExcelFile { + /** + * [Content_Types].xml,暂时不详细解析 + */ + contentTypes: ContentTypes; + + workbook: IWorkbook; +} diff --git a/packages/office-viewer/src/excel/types/Ext.ts b/packages/office-viewer/src/excel/types/Ext.ts new file mode 100644 index 000000000..63fec352a --- /dev/null +++ b/packages/office-viewer/src/excel/types/Ext.ts @@ -0,0 +1,37 @@ +import {Attributes} from '../../openxml/Attributes'; +import { + X14ConditionalFormattings, + X14ConditionalFormattings_Attributes +} from './X14CF/X14ConditionalFormattings'; + +import { + X14SparklineGroups, + X14SparklineGroups_Attributes +} from './X14Sparkline/X14SparklineGroups'; + +export type Ext = { + 'uri'?: string; + 'x14:id'?: string; + 'x14:conditionalFormattings'?: X14ConditionalFormattings; + 'x14:sparklineGroups'?: X14SparklineGroups; +}; + +export const Ext_Attributes: Attributes = { + 'uri': { + type: 'string' + }, + + 'x14:id': { + type: 'child-string' + }, + + 'x14:conditionalFormattings': { + type: 'child', + childAttributes: X14ConditionalFormattings_Attributes + }, + + 'x14:sparklineGroups': { + type: 'child', + childAttributes: X14SparklineGroups_Attributes + } +}; diff --git a/packages/office-viewer/src/excel/types/FontSize.ts b/packages/office-viewer/src/excel/types/FontSize.ts new file mode 100644 index 000000000..f835de2ab --- /dev/null +++ b/packages/office-viewer/src/excel/types/FontSize.ts @@ -0,0 +1,8 @@ +/** + * 字体大小 + */ + +export interface FontSize { + width: number; + height: number; +} diff --git a/packages/office-viewer/src/excel/types/FontStyle.ts b/packages/office-viewer/src/excel/types/FontStyle.ts new file mode 100644 index 000000000..be927b66d --- /dev/null +++ b/packages/office-viewer/src/excel/types/FontStyle.ts @@ -0,0 +1,18 @@ +import {ST_UnderlineValues} from '../../openxml/ExcelTypes'; + +/** + * 解析后的各种字体信息,为了方便渲染做了简化,而且保证值是有效的,内部通常用这个而不是 CT_Font + */ + +export interface FontStyle { + family: string; + size: number; + color: string; + b: boolean; + i: boolean; + strike: boolean; + outline: boolean; + shadow: boolean; + u: ST_UnderlineValues; + condense: boolean; +} diff --git a/packages/office-viewer/src/excel/types/IChartSpace.ts b/packages/office-viewer/src/excel/types/IChartSpace.ts new file mode 100644 index 000000000..7423b857d --- /dev/null +++ b/packages/office-viewer/src/excel/types/IChartSpace.ts @@ -0,0 +1,8 @@ +import {CT_ChartSpace} from '../../openxml/ChartTypes'; + +export type IChartSpace = CT_ChartSpace & { + /** + * 图表全局 id,这个是为了渲染的时候标识是哪个图表 + */ + gid: string; +}; diff --git a/packages/office-viewer/src/excel/types/IDataProvider.ts b/packages/office-viewer/src/excel/types/IDataProvider.ts new file mode 100644 index 000000000..884e25e7d --- /dev/null +++ b/packages/office-viewer/src/excel/types/IDataProvider.ts @@ -0,0 +1,212 @@ +import { + CT_Color, + CT_ConditionalFormatting, + CT_Dxf, + CT_Font +} from '../../openxml/ExcelTypes'; +import {Rect} from '../render/Rect'; +import {HiddenRange} from '../sheet/getViewRange'; +import {CellInfo} from './CellInfo'; +import {CellValue} from './CellValue'; +import {FontSize} from './FontSize'; +import {FontStyle} from './FontStyle'; +import {IDrawing} from './IDrawing'; +import {ISheet} from './ISheet'; +import {RangeRef} from './RangeRef'; +import {CellData} from './worksheet/CellData'; + +/** + * 数据获取方法,所有数据获取都通过这个方法调用 + */ +export interface IDataProvider { + /** + * 获取指定行的数据 + * @param sheetIndex 表索引,从 0 开始 + * @param row,行索引,从 0 开始 + */ + getSheetRowData(sheetIndex: number, row: number): CellData[]; + + /** + * 获取指定单元格的数据 + * @param sheetIndex + * @param row + * @param col + */ + getCellData( + sheetIndex: number, + row: number, + col: number + ): CellData | undefined; + + /** + * 更新单元格信息 + * @param sheetIndex + * @param row + * @param col + * @param data + */ + updateCellData( + sheetIndex: number, + row: number, + col: number, + data: CellData + ): void; + + /** + * 获取指定行的行高,理论上这里应该用异步 + * @param sheetIndex + * @param row + */ + getRowHeight(sheetIndex: number, row: number): number; + + /** + * 获取指定列宽,这个一开始就能确定 + * @param sheetIndex + * @param col + */ + getColWidth(sheetIndex: number, col: number): number; + + /** + * 获取隐藏的列范围 + */ + getColHiddenRange(sheetIndex: number): HiddenRange[]; + + /** + * 获取最大行数 + */ + getMaxRow(sheetIndex: number): number; + + /** + * 当前行是否隐藏 + */ + isRowHidden(sheetIndex: number, row: number): boolean; + + /** + * 当前列是否隐藏 + */ + isColHidden(sheetIndex: number, col: number): boolean; + + /** + * 获取表的中数据高度,这个可能会返回预估值 + * @param sheetIndex 表索引 + */ + getTotalHeight(sheetIndex: number): number; + + /** + * 获取最大列数 + */ + getMaxCol(sheetIndex: number): number; + + /** + * 获取表的中数据宽度,这个可能会返回预估值 + * @param sheetIndex 表索引 + */ + getTotalWidth(sheetIndex: number): number; + + /** + * 获取所有表 + */ + getSheets(): ISheet[]; + + /** + * 根据索引获取表 + * @param sheetIndex + */ + getSheetByIndex(sheetIndex: number): ISheet | undefined; + + /** + * 根据名称获取表 + * @param sheetName + */ + getSheetByName(sheetName: string): ISheet | undefined; + + /** + * 获取单元格的样式及数据 + */ + getCellInfo(sheetIndex: number, row: number, col: number): CellInfo; + + /** + * 获取单元格的数据,这里仅返回数据,不包含样式 + */ + getCellValue(sheetIndex: number, row: number, col: number): CellValue; + + /** + * 获取范围内的数据 + * @param includeHidden 是否包含隐藏的单元格 + */ + getCellValueByRange( + sheetIndex: number, + range: RangeRef, + includeHidden: boolean + ): CellValue[]; + + /** + * 查找文本 + */ + searchText(sheetIndex: number, text: string): CellValue[]; + + /** + * 获取最终颜色 + */ + getColor(color?: CT_Color, defaultColor?: string): string | 'none'; + + /** + * 获取默认字体大小 + */ + getDefaultFontSize(): FontSize; + + /** + * 获取默认字体 + */ + getDefaultFontStyle(): FontStyle; + + /** + * 获取合并单元格的配置 + */ + getMergeCells(sheetIndex: number): RangeRef[]; + + /** + * 获取图片 + */ + getDrawing(sheetIndex: number): IDrawing | null; + + /** + * 获取条件格式 + */ + getConditionalFormatting(sheetIndex: number): CT_ConditionalFormatting[]; + + /** + * 获取 dxf 样式定义 + */ + getDxf(index: number): CT_Dxf | null; + + /** + * TODO: 这个接口不应该暴露出来,CSV 不需要这个 + */ + getFontStyle(font?: CT_Font): FontStyle; + + /** + * 是否是 1904 日期系统 + * https://support.microsoft.com/en-us/office/date-systems-in-excel-e7fe7167-48a9-4b96-bb53-5612a800b487 + */ + is1904(): boolean; + + /** + * 设置行排序 + */ + sortColumn( + sheetIndex: number, + range: RangeRef, + sortOrder: 'asc' | 'desc' + ): void; + + /** + * 修改行高 + */ + setRowHeight(sheetIndex: number, row: number, height: number): void; + + /** + * 修改列宽 + */ + setColWidth(sheetIndex: number, col: number, width: number): void; +} diff --git a/packages/office-viewer/src/excel/types/IDrawing.ts b/packages/office-viewer/src/excel/types/IDrawing.ts new file mode 100644 index 000000000..ad7adda2d --- /dev/null +++ b/packages/office-viewer/src/excel/types/IDrawing.ts @@ -0,0 +1,69 @@ +import { + CT_AbsoluteAnchor, + CT_AnchorClientData, + CT_OneCellAnchor, + CT_Picture, + CT_Shape, + CT_ShapeProperties, + CT_TwoCellAnchor +} from '../../openxml/ExcelTypes'; +import {OutLine} from '../../openxml/drawing/ShapeProperties'; +import {IChartSpace} from './IChartSpace'; +import {RichText} from './RichText'; + +export type IPicture = CT_Picture & { + /** + * 扩充的属性 + */ + imgURL?: string; + + /** + * 图片全局 id + */ + gid: string; +}; + +export type StyleColor = { + lnRefColor?: string; + fillRefColor?: string; + effectRefColor?: string; + fontRefColor?: string; +}; + +export type IShapeProperties = CT_ShapeProperties & { + /** + * 扩充一些 word 里用到的属性 + */ + outline?: OutLine; + fillColor?: string; +}; + +export type IShape = CT_Shape & { + spPr?: IShapeProperties; + /** + * 扩充一些 word 里用到的属性 + */ + styleColor?: StyleColor; + /** + * 解析出来的富文本属性 + */ + richText?: RichText; +}; + +export type IAnchorCommon = { + pic?: IPicture; + shape?: IShape; + chartSpace?: IChartSpace; +}; + +export type ITwoCellAnchor = CT_TwoCellAnchor & IAnchorCommon; + +export type IAbsoluteAnchor = CT_AbsoluteAnchor & IAnchorCommon; + +export type IOneCellAnchor = CT_OneCellAnchor & IAnchorCommon; + +export type IDrawing = { + oneCellAnchors: IOneCellAnchor[]; + twoCellAnchors: ITwoCellAnchor[]; + absoluteAnchors: IAbsoluteAnchor[]; +}; diff --git a/packages/office-viewer/src/excel/types/IRElt.ts b/packages/office-viewer/src/excel/types/IRElt.ts new file mode 100644 index 000000000..52b3909cb --- /dev/null +++ b/packages/office-viewer/src/excel/types/IRElt.ts @@ -0,0 +1,13 @@ +/** + * 对应 CT_RElt + */ + +import {IRPrElt} from './IRPrElt'; + +/** + * CT_RElt + */ +export interface IRElt { + rPr?: IRPrElt; + t: string; +} diff --git a/packages/office-viewer/src/excel/types/IRPrElt.ts b/packages/office-viewer/src/excel/types/IRPrElt.ts new file mode 100644 index 000000000..20046f4b2 --- /dev/null +++ b/packages/office-viewer/src/excel/types/IRPrElt.ts @@ -0,0 +1,33 @@ +import { + CT_Color, + ST_FontScheme, + ST_VerticalAlignRun +} from '../../openxml/ExcelTypes'; + +/** + * 对应 CT_RPrElt,很多属性在文档里没有,怀疑是不用了 + */ +export interface IRPrElt { + /** + * This element is a string representing the name of the font assigned to display this run. + */ + rFont?: string; + charset?: number; + family?: number; + b?: boolean; + i?: boolean; + /** + * +This element draws a strikethrough line through the horizontal middle of the text. + */ + strike?: boolean; + outline?: boolean; + shadow?: boolean; + condense?: boolean; + extend?: boolean; + color?: CT_Color; + sz?: number; + u?: boolean; + vertAlign?: ST_VerticalAlignRun; + scheme?: ST_FontScheme; +} diff --git a/packages/office-viewer/src/excel/types/IRelationship.ts b/packages/office-viewer/src/excel/types/IRelationship.ts new file mode 100644 index 000000000..7a8c2c8d7 --- /dev/null +++ b/packages/office-viewer/src/excel/types/IRelationship.ts @@ -0,0 +1,11 @@ +/** + * Relationship 的定义 + */ + +export interface IRelationship { + id: string; + type: string; + target: string; + targetMode?: string; + targetOrigin?: string; +} diff --git a/packages/office-viewer/src/excel/types/ISheet.ts b/packages/office-viewer/src/excel/types/ISheet.ts new file mode 100644 index 000000000..6ae06d675 --- /dev/null +++ b/packages/office-viewer/src/excel/types/ISheet.ts @@ -0,0 +1,29 @@ +import {ST_SheetState} from '../../openxml/ExcelTypes'; +import {Attributes} from '../../openxml/Attributes'; +import {IWorksheet} from './IWorksheet'; + +/** + * 类似 CT_Sheet,不同的是合入了 sheet1.xml 里的定义 + */ +export interface ISheet { + 'name': string; + 'sheetId': string; + 'state'?: ST_SheetState; + 'r:id': string; + 'worksheet'?: IWorksheet; +} + +export const ISheet_Attributes: Attributes = { + 'name': { + type: 'string' + }, + 'sheetId': { + type: 'string' + }, + 'state': { + type: 'string' + }, + 'r:id': { + type: 'string' + } +}; diff --git a/packages/office-viewer/src/excel/types/IWorkbook.ts b/packages/office-viewer/src/excel/types/IWorkbook.ts new file mode 100644 index 000000000..7f016f448 --- /dev/null +++ b/packages/office-viewer/src/excel/types/IWorkbook.ts @@ -0,0 +1,57 @@ +/** + * 数据表总入口 + */ + +import {IRelationship} from './IRelationship'; +import {ISheet} from './ISheet'; + +import { + CT_BookView, + CT_CalcPr, + CT_DefinedName, + CT_Stylesheet, + CT_WorkbookPr +} from '../../openxml/ExcelTypes'; +import {CT_Theme} from './CT_Theme'; + +export interface IWorkbook { + /** + * sheet 列表 + */ + sheets: ISheet[]; + + /** + * calc配置,只有部分配置 + */ + calcPr?: CT_CalcPr; + + /** + * Defined Names + */ + definedNames?: CT_DefinedName[]; + + /** + * workbookPr + */ + workbookPr?: CT_WorkbookPr; + + /** + * workbookView + */ + workbookView?: CT_BookView; + + /** + * workbookRelationships + */ + workbookRelationships?: IRelationship[]; + + /** + * styles.xml + */ + styleSheet?: CT_Stylesheet; + + /** + * theme.xml + */ + theme: CT_Theme; +} diff --git a/packages/office-viewer/src/excel/types/IWorksheet.ts b/packages/office-viewer/src/excel/types/IWorksheet.ts new file mode 100644 index 000000000..5027b62ef --- /dev/null +++ b/packages/office-viewer/src/excel/types/IWorksheet.ts @@ -0,0 +1,60 @@ +import { + CT_AutoFilter, + CT_Col, + CT_ConditionalFormatting, + CT_Row, + CT_SheetFormatPr, + CT_SheetPr, + CT_SheetView, + CT_Table +} from '../../openxml/ExcelTypes'; +import {CT_ExtensionList} from './CT_ExtensionList'; +import {IDrawing} from './IDrawing'; +import {RangeRef} from './RangeRef'; + +import {CellData} from './worksheet/CellData'; + +/** + * 对应 Worksheet + */ +export interface IWorksheet { + sheetPr?: CT_SheetPr; + + dimension?: { + ref: string; + }; + + sheetViews?: CT_SheetView[]; + + sheetFormatPr?: CT_SheetFormatPr; + + cols: CT_Col[]; + + /** + * 行属性,因为数据存在二维数据里,所以需要另一个地方来存行属性,这里的索引是行号,以 0 开始 + */ + rows: CT_Row[]; + + /** + * 数据存储,这里和 xml 里不一样,这里是用二维数组,而且值是解析后的值 + */ + cellData: CellData[][]; + + mergeCells: RangeRef[]; + + /** + * 条件格式化 + */ + conditionalFormatting: CT_ConditionalFormatting[]; + + /** + * 图片 + */ + drawing?: IDrawing; + + extLst?: CT_ExtensionList; + + tableParts?: CT_Table[]; + + autoFilter?: CT_AutoFilter; +} diff --git a/packages/office-viewer/src/excel/types/RangeRef.ts b/packages/office-viewer/src/excel/types/RangeRef.ts new file mode 100644 index 000000000..2042b7bcd --- /dev/null +++ b/packages/office-viewer/src/excel/types/RangeRef.ts @@ -0,0 +1,25 @@ +/** + * 范围引用 + */ + +export interface RangeRef { + /** + * 开始行,从 0 开始 + */ + startRow: number; + + /** + * 开始列,从 0 开始 + */ + startCol: number; + + /** + * 结束的行 + */ + endRow: number; + + /** + * 结束的列 + */ + endCol: number; +} diff --git a/packages/office-viewer/src/excel/types/RichText.ts b/packages/office-viewer/src/excel/types/RichText.ts new file mode 100644 index 000000000..9765c987d --- /dev/null +++ b/packages/office-viewer/src/excel/types/RichText.ts @@ -0,0 +1,8 @@ +import {IRElt} from './IRElt'; + +export interface RichText { + type: 'rich'; + richText: IRElt[]; + t?: number; + s?: number; +} diff --git a/packages/office-viewer/src/excel/types/StringItem.ts b/packages/office-viewer/src/excel/types/StringItem.ts new file mode 100644 index 000000000..b84a910e1 --- /dev/null +++ b/packages/office-viewer/src/excel/types/StringItem.ts @@ -0,0 +1,6 @@ +import {RichText} from './RichText'; + +/** + * String Item,如果是纯文本直接用字符串,这样是为了节省内存,但导致了后面代码都得判断类型 + */ +export type StringItem = string | RichText; diff --git a/packages/office-viewer/src/excel/types/TableStyleDef.ts b/packages/office-viewer/src/excel/types/TableStyleDef.ts new file mode 100644 index 000000000..9ad0e49b1 --- /dev/null +++ b/packages/office-viewer/src/excel/types/TableStyleDef.ts @@ -0,0 +1,10 @@ +/** + * 表格样式定义,包括内置和自定义的 + */ + +import {CT_Dxfs, CT_TableStyles} from '../../openxml/ExcelTypes'; + +export type TableStyleDef = { + dxfs: CT_Dxfs; + tableStyles: CT_TableStyles; +}; diff --git a/packages/office-viewer/src/excel/types/X14CF/CT_Cfvo.ts b/packages/office-viewer/src/excel/types/X14CF/CT_Cfvo.ts new file mode 100644 index 000000000..8e85708d8 --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/CT_Cfvo.ts @@ -0,0 +1,21 @@ +import {Attributes} from '../../../openxml/Attributes'; +import {ST_CfvoType} from './ST_CfvoType'; + +export interface CT_Cfvo { + type?: ST_CfvoType; + val?: string; + gte?: boolean; +} + +export const CT_Cfvo_Attributes: Attributes = { + type: { + type: 'string' + }, + val: { + type: 'string' + }, + gte: { + type: 'boolean', + defaultValue: 'true' + } +}; diff --git a/packages/office-viewer/src/excel/types/X14CF/ST_CfvoType.ts b/packages/office-viewer/src/excel/types/X14CF/ST_CfvoType.ts new file mode 100644 index 000000000..a729185a1 --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/ST_CfvoType.ts @@ -0,0 +1,7 @@ +export type ST_CfvoType = + | 'num' + | 'percent' + | 'max' + | 'min' + | 'formula' + | 'percentile'; diff --git a/packages/office-viewer/src/excel/types/X14CF/X14CfRule.ts b/packages/office-viewer/src/excel/types/X14CF/X14CfRule.ts new file mode 100644 index 000000000..042a5304f --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/X14CfRule.ts @@ -0,0 +1,32 @@ +import {X} from 'zrender'; +import {Attributes} from '../../../openxml/Attributes'; +import {X14DataBar, X14DataBar_Attributes} from './X14DataBar'; +import {X14IconSet, X14IconSet_Attributes} from './X14IconSet'; + +export type X14CfRule = { + 'type'?: string; + 'id'?: string; + + 'x14:dataBar'?: X14DataBar; + + 'x14:iconSet'?: X14IconSet; +}; + +export const X14CfRule_Attributes: Attributes = { + 'type': { + type: 'string' + }, + 'id': { + type: 'string' + }, + + 'x14:dataBar': { + type: 'child', + childAttributes: X14DataBar_Attributes + }, + + 'x14:iconSet': { + type: 'child', + childAttributes: X14IconSet_Attributes + } +}; diff --git a/packages/office-viewer/src/excel/types/X14CF/X14ConditionalFormatting.ts b/packages/office-viewer/src/excel/types/X14CF/X14ConditionalFormatting.ts new file mode 100644 index 000000000..fe693a8e2 --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/X14ConditionalFormatting.ts @@ -0,0 +1,14 @@ +import {Attributes} from '../../../openxml/Attributes'; +import {X14CfRule, X14CfRule_Attributes} from './X14CfRule'; + +export type X14ConditionalFormatting = { + 'x14:cfRule'?: X14CfRule[]; +}; + +export const X14ConditionalFormatting_Attributes: Attributes = { + 'x14:cfRule': { + type: 'child', + childAttributes: X14CfRule_Attributes, + childIsArray: true + } +}; diff --git a/packages/office-viewer/src/excel/types/X14CF/X14ConditionalFormattings.ts b/packages/office-viewer/src/excel/types/X14CF/X14ConditionalFormattings.ts new file mode 100644 index 000000000..70c8f06bb --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/X14ConditionalFormattings.ts @@ -0,0 +1,17 @@ +import {Attributes} from '../../../openxml/Attributes'; +import { + X14ConditionalFormatting, + X14ConditionalFormatting_Attributes +} from './X14ConditionalFormatting'; + +export type X14ConditionalFormattings = { + 'x14:conditionalFormatting'?: X14ConditionalFormatting[]; +}; + +export const X14ConditionalFormattings_Attributes: Attributes = { + 'x14:conditionalFormatting': { + type: 'child', + childAttributes: X14ConditionalFormatting_Attributes, + childIsArray: true + } +}; diff --git a/packages/office-viewer/src/excel/types/X14CF/X14DataBar.ts b/packages/office-viewer/src/excel/types/X14CF/X14DataBar.ts new file mode 100644 index 000000000..84931f4ee --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/X14DataBar.ts @@ -0,0 +1,68 @@ +import {Attributes} from '../../../openxml/Attributes'; +import {CT_Color, CT_Color_Attributes} from '../CT_Color'; +import {CT_Cfvo, CT_Cfvo_Attributes} from './CT_Cfvo'; + +export type X14DataBar = { + 'minLength'?: number; + 'maxLength'?: number; + 'border'?: boolean; + 'gradient'?: boolean; + 'direction'?: 'leftToRight' | 'rightToLeft'; + 'negativeBarBorderColorSameAsPositive'?: boolean; + 'negativeBarColorSameAsPositive'?: boolean; + 'x14:cfvo'?: CT_Cfvo[]; + 'x14:borderColor'?: CT_Color; + 'x14:negativeFillColor'?: CT_Color; + 'x14:negativeBorderColor'?: CT_Color; + 'x14:axisColor'?: CT_Color; +}; + +export const X14DataBar_Attributes: Attributes = { + 'minLength': { + type: 'int', + defaultValue: '10' + }, + 'maxLength': { + type: 'int', + defaultValue: '90' + }, + 'border': { + type: 'boolean', + defaultValue: 'false' + }, + 'gradient': { + type: 'boolean', + defaultValue: 'true' + }, + 'direction': { + type: 'string' + }, + 'negativeBarColorSameAsPositive': { + type: 'boolean' + }, + 'negativeBarBorderColorSameAsPositive': { + type: 'boolean', + defaultValue: 'false' + }, + 'x14:cfvo': { + type: 'child', + childAttributes: CT_Cfvo_Attributes, + childIsArray: true + }, + 'x14:borderColor': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:negativeFillColor': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:negativeBorderColor': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:axisColor': { + type: 'child', + childAttributes: CT_Color_Attributes + } +}; diff --git a/packages/office-viewer/src/excel/types/X14CF/X14IconSet.ts b/packages/office-viewer/src/excel/types/X14CF/X14IconSet.ts new file mode 100644 index 000000000..e56afb6b1 --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14CF/X14IconSet.ts @@ -0,0 +1,53 @@ +import {Attributes} from '../../../openxml/Attributes'; +import {CT_Cfvo, CT_Cfvo_Attributes} from './CT_Cfvo'; + +export type ST_IconSetType = + | '3Arrows' + | '3ArrowsGray' + | '3Flags' + | '3TrafficLights1' + | '3TrafficLights2' + | '3Signs' + | '3Symbols' + | '3Symbols2' + | '4Arrows' + | '4ArrowsGray' + | '4RedToBlack' + | '4Rating' + | '4TrafficLights' + | '5Arrows' + | '5ArrowsGray' + | '5Rating' + | '5Quarters'; + +export interface X14IconSet { + cfvo?: CT_Cfvo[]; + iconSet?: ST_IconSetType; + showValue?: boolean; + percent?: boolean; + reverse?: boolean; +} + +export const X14IconSet_Attributes: Attributes = { + cfvo: { + type: 'child', + childAttributes: CT_Cfvo_Attributes, + childIsArray: true + }, + iconSet: { + type: 'string', + defaultValue: '3TrafficLights1' + }, + showValue: { + type: 'boolean', + defaultValue: 'true' + }, + percent: { + type: 'boolean', + defaultValue: 'true' + }, + reverse: { + type: 'boolean', + defaultValue: 'false' + } +}; diff --git a/packages/office-viewer/src/excel/types/X14Sparkline/X14Sparkline.ts b/packages/office-viewer/src/excel/types/X14Sparkline/X14Sparkline.ts new file mode 100644 index 000000000..f515249d9 --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14Sparkline/X14Sparkline.ts @@ -0,0 +1,15 @@ +import {Attributes} from '../../../openxml/Attributes'; + +export type X14Sparkline = { + 'xm:f': string; + 'xm:sqref': string; +}; + +export const X14Sparkline_Attributes: Attributes = { + 'xm:f': { + type: 'child-string' + }, + 'xm:sqref': { + type: 'child-string' + } +}; diff --git a/packages/office-viewer/src/excel/types/X14Sparkline/X14SparklineGroup.ts b/packages/office-viewer/src/excel/types/X14Sparkline/X14SparklineGroup.ts new file mode 100644 index 000000000..2ce634bae --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14Sparkline/X14SparklineGroup.ts @@ -0,0 +1,139 @@ +/** + * 目前先简单实现,后面再改成自动解析 + */ + +import {Attributes} from '../../../openxml/Attributes'; +import {CT_Color, CT_Color_Attributes} from '../CT_Color'; +import {X14Sparkline, X14Sparkline_Attributes} from './X14Sparkline'; +import {X14Sparklines, X14Sparklines_Attributes} from './x14:sparklines'; + +export type ST_SparklineAxisMinMax = 'individual' | 'groupMax' | 'group'; + +export type X14SparklineGroup = { + 'displayEmptyCellsAs'?: 'gap' | 'zero' | 'span'; + 'type'?: 'line' | 'column' | 'stacked'; + 'markers'?: boolean; + 'manualMax'?: number; + 'manualMin'?: number; + 'lineWeight'?: number; + 'high'?: boolean; + 'low'?: boolean; + 'first'?: boolean; + 'last'?: boolean; + 'negative'?: boolean; + 'displayXAxis'?: boolean; + 'displayHidden'?: boolean; + 'minAxisType'?: ST_SparklineAxisMinMax; + 'maxAxisType'?: ST_SparklineAxisMinMax; + 'rightToLeft'?: boolean; + 'x14:colorSeries'?: CT_Color; + 'x14:colorNegative'?: CT_Color; + 'x14:colorAxis'?: CT_Color; + 'x14:colorMarkers'?: CT_Color; + 'x14:colorFirst'?: CT_Color; + 'x14:colorLast'?: CT_Color; + 'x14:colorHigh'?: CT_Color; + 'x14:colorLow'?: CT_Color; + 'x14:sparklines'?: X14Sparklines; +}; + +export const X14SparklineGroup_Attributes: Attributes = { + 'displayEmptyCellsAs': { + type: 'string', + defaultValue: 'gap' + }, + 'type': { + type: 'string', + defaultValue: 'line' + }, + 'markers': { + type: 'boolean', + defaultValue: false + }, + 'manualMax': { + type: 'double' + }, + 'manualMin': { + type: 'double' + }, + 'lineWeight': { + type: 'double', + defaultValue: 0.75 + }, + 'high': { + type: 'boolean', + defaultValue: false + }, + 'low': { + type: 'boolean', + defaultValue: false + }, + 'first': { + type: 'boolean', + defaultValue: false + }, + 'last': { + type: 'boolean', + defaultValue: false + }, + 'negative': { + type: 'boolean', + defaultValue: false + }, + 'displayXAxis': { + type: 'boolean', + defaultValue: false + }, + 'displayHidden': { + type: 'boolean', + defaultValue: false + }, + 'minAxisType': { + type: 'string', + defaultValue: 'group' + }, + 'maxAxisType': { + type: 'string', + defaultValue: 'group' + }, + 'rightToLeft': { + type: 'boolean', + defaultValue: false + }, + 'x14:colorSeries': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorNegative': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorAxis': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorMarkers': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorFirst': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorLast': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorHigh': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:colorLow': { + type: 'child', + childAttributes: CT_Color_Attributes + }, + 'x14:sparklines': { + type: 'child', + childAttributes: X14Sparklines_Attributes + } +}; diff --git a/packages/office-viewer/src/excel/types/X14Sparkline/X14SparklineGroups.ts b/packages/office-viewer/src/excel/types/X14Sparkline/X14SparklineGroups.ts new file mode 100644 index 000000000..fc2e5ca5a --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14Sparkline/X14SparklineGroups.ts @@ -0,0 +1,17 @@ +import {Attributes} from '../../../openxml/Attributes'; +import { + X14SparklineGroup, + X14SparklineGroup_Attributes +} from './X14SparklineGroup'; + +export type X14SparklineGroups = { + 'x14:sparklineGroup': X14SparklineGroup[]; +}; + +export const X14SparklineGroups_Attributes: Attributes = { + 'x14:sparklineGroup': { + type: 'child', + childAttributes: X14SparklineGroup_Attributes, + childIsArray: true + } +}; diff --git a/packages/office-viewer/src/excel/types/X14Sparkline/x14:sparklines.ts b/packages/office-viewer/src/excel/types/X14Sparkline/x14:sparklines.ts new file mode 100644 index 000000000..e50f86539 --- /dev/null +++ b/packages/office-viewer/src/excel/types/X14Sparkline/x14:sparklines.ts @@ -0,0 +1,14 @@ +import {Attributes} from '../../../openxml/Attributes'; +import {X14Sparkline, X14Sparkline_Attributes} from './X14Sparkline'; + +export type X14Sparklines = { + 'x14:sparkline'?: X14Sparkline[]; +}; + +export const X14Sparklines_Attributes: Attributes = { + 'x14:sparkline': { + type: 'child', + childAttributes: X14Sparkline_Attributes, + childIsArray: true + } +}; diff --git a/packages/office-viewer/src/excel/types/worksheet/CellData.ts b/packages/office-viewer/src/excel/types/worksheet/CellData.ts new file mode 100644 index 000000000..19b90d386 --- /dev/null +++ b/packages/office-viewer/src/excel/types/worksheet/CellData.ts @@ -0,0 +1,103 @@ +import {StringItem} from '../StringItem'; + +/** + * 错误的数据 + */ +export type ErrorData = { + type: 'error'; + value: string; + s?: number; +}; + +/** + * 公式数据 + */ +export type FormulaData = { + type: 'formula'; + formula: string; + value: string; + s?: number; +}; + +/** + * 可能是老的数据格式 + */ +export type DateData = { + type: 'date'; + value: string; + s?: number; +}; + +/** + * 带样式的数据 + */ +export type StyleData = { + type: 'style'; + s?: number; + /** + * 值 + */ + value: string; +}; + +/** + * 空数据,这种主要都是有个单元格,但是没有值 + */ +export type BlankData = { + type: 'blank'; + s?: number; +}; + +/** + * 单元格里存的值 + */ +export type CellData = + | StringItem + | ErrorData + | FormulaData + | StyleData + | DateData + | BlankData; + +export function hasValue(cellData: CellData): boolean { + if (typeof cellData === 'string') { + return true; + } + // 其实就是除了 blank 之外的 + if ( + typeof cellData === 'object' && + (cellData.type === 'date' || + cellData.type === 'error' || + cellData.type === 'rich' || + cellData.type === 'style' || + cellData.type === 'formula') + ) { + return true; + } + return false; +} + +/** + * 更新数据,目前还不支持富文本 + * @param value + * @param cellData + * @returns + */ +export function updateValue(value: string = '', cellData?: CellData): CellData { + if (!cellData) { + return value || ''; + } + + if (typeof cellData === 'string') { + return value; + } + + if ('value' in cellData) { + return { + ...cellData, + value + }; + } + + return cellData; +} diff --git a/packages/office-viewer/src/excel/types/worksheet/ICell.ts b/packages/office-viewer/src/excel/types/worksheet/ICell.ts new file mode 100644 index 000000000..196197c02 --- /dev/null +++ b/packages/office-viewer/src/excel/types/worksheet/ICell.ts @@ -0,0 +1,60 @@ +import {ST_CellType} from '../../../openxml/ExcelTypes'; +import {Attributes} from '../../../openxml/Attributes'; + +/** + * 这个内容较多所以自己解析 + */ +export interface ICell { + /** + * An A1 style reference to the location of this cell + */ + r?: string; + /** + * The index of this cell's style. Style records are stored in the Styles Part. + */ + s?: number; + /** + * cell's data type. + * b: Boolean + * d: Date + * e: Error + * inlineStr: Inline String + * n: Number + * s: Shared String + * str: String + */ + t?: ST_CellType; + /** + * The zero-based index of the cell metadata record associated with this cell. Metadata information is found in the Metadata Part. + */ + cm?: number; + /** + * The zero-based index of the value metadata record associated with this cell's value. Metadata records are stored in the Metadata Part + */ + vm?: number; + /** + * A Boolean value indicating if the spreadsheet application should show phonetic information + */ + ph?: boolean; +} + +export const CT_Cell_Attributes: Attributes = { + r: { + type: 'string' + }, + s: { + type: 'int' + }, + t: { + type: 'string' + }, + cm: { + type: 'int' + }, + vm: { + type: 'int' + }, + ph: { + type: 'boolean' + } +}; diff --git a/packages/office-viewer/src/index.ts b/packages/office-viewer/src/index.ts index 46f4fe3fd..65ccff506 100644 --- a/packages/office-viewer/src/index.ts +++ b/packages/office-viewer/src/index.ts @@ -1,4 +1,6 @@ import Word from './Word'; +import Excel from './Excel'; +import {createOfficeViewer} from './createOfficeViewer'; -export {Word}; +export {Word, Excel, createOfficeViewer}; export default {Word}; diff --git a/packages/office-viewer/src/openxml/Attributes.ts b/packages/office-viewer/src/openxml/Attributes.ts new file mode 100644 index 000000000..6cd8e96bd --- /dev/null +++ b/packages/office-viewer/src/openxml/Attributes.ts @@ -0,0 +1,47 @@ +/** + * 属性类型 + */ +export type AttributeType = + | 'string' + | 'int' + | 'double' + | 'boolean' + | 'child' + // 子节点,只取内容 + | 'child-string' + | 'child-int' + | 'any'; + +export const ANY_KEY = '__any__'; + +/** + * 单个属性定义 + */ +export interface Attribute { + type: AttributeType; + /** + * 是否必填 + */ + required?: boolean; + /** + * 默认值 + */ + defaultValue?: string | number | boolean; + + /** + * 解析子节点作为作为属性 + */ + childAttributes?: Attributes; + + /** + * 子节点是否是数组 + */ + childIsArray?: boolean; +} + +/** + * 属性通用解析定义,这个主要是为了自动化解析属性 + */ +export type Attributes = { + [key: string]: Attribute; +}; diff --git a/packages/office-viewer/src/openxml/ChartTypes.ts b/packages/office-viewer/src/openxml/ChartTypes.ts new file mode 100644 index 000000000..fa3a0705e --- /dev/null +++ b/packages/office-viewer/src/openxml/ChartTypes.ts @@ -0,0 +1,11698 @@ +import {Attributes} from './Attributes'; + +import { + CT_ExtensionList, + CT_ExtensionList_Attributes +} from './../excel/types/CT_ExtensionList'; + +export type ST_Lang = string; + +export type ST_HexColorRGB = string; + +export type ST_Panose = string; + +export type ST_CalendarType = + | 'gregorian' + | 'gregorianUs' + | 'gregorianMeFrench' + | 'gregorianArabic' + | 'hijri' + | 'hebrew' + | 'taiwan' + | 'japan' + | 'thai' + | 'korea' + | 'saka' + | 'gregorianXlitEnglish' + | 'gregorianXlitFrench' + | 'none'; + +export type ST_Guid = string; + +export type ST_OnOff = boolean; + +export type ST_String = string; + +export type ST_XmlName = string; + +export type ST_UnsignedDecimalNumber = number; + +export type ST_TwipsMeasure = + | ST_UnsignedDecimalNumber + | ST_PositiveUniversalMeasure; + +export type ST_VerticalAlignRun = 'baseline' | 'superscript' | 'subscript'; + +export type ST_Xstring = string; + +export type ST_XAlign = 'left' | 'center' | 'right' | 'inside' | 'outside'; + +export type ST_YAlign = + | 'inline' + | 'top' + | 'center' + | 'bottom' + | 'inside' + | 'outside'; + +export type ST_ConformanceClass = 'strict' | 'transitional'; + +export type ST_UniversalMeasure = string; + +export type ST_PositiveUniversalMeasure = ST_UniversalMeasure; + +export type ST_Percentage = string; + +export type ST_FixedPercentage = string; + +export type ST_PositivePercentage = string; + +export type ST_PositiveFixedPercentage = string; + +export interface CT_OfficeArtExtension { + __any__?: any; + uri?: string; +} + +export const CT_OfficeArtExtension_Attributes: Attributes = { + __any__: { + type: 'any' + }, + uri: { + type: 'string' + } +}; + +export interface CT_OfficeArtExtensionList { + ext?: CT_OfficeArtExtension[]; +} + +export const CT_OfficeArtExtensionList_Attributes: Attributes = { + ext: { + type: 'child', + childAttributes: CT_OfficeArtExtension_Attributes, + childIsArray: true + } +}; + +export interface CT_AudioFile { + extLst?: CT_OfficeArtExtensionList; + contentType?: string; +} + +export const CT_AudioFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + contentType: { + type: 'string' + } +}; + +export interface CT_VideoFile { + extLst?: CT_OfficeArtExtensionList; + contentType?: string; +} + +export const CT_VideoFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + contentType: { + type: 'string' + } +}; + +export interface CT_QuickTimeFile { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_QuickTimeFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_AudioCDTime { + track?: number; + time?: number; +} + +export const CT_AudioCDTime_Attributes: Attributes = { + track: { + type: 'int' + }, + time: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_AudioCD { + st?: CT_AudioCDTime; + end?: CT_AudioCDTime; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_AudioCD_Attributes: Attributes = { + st: { + type: 'child', + childAttributes: CT_AudioCDTime_Attributes + }, + end: { + type: 'child', + childAttributes: CT_AudioCDTime_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_StyleMatrixColumnIndex = number; + +export type ST_FontCollectionIndex = 'major' | 'minor' | 'none'; + +export type ST_ColorSchemeIndex = + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink'; + +export interface CT_PositiveFixedPercentage { + val?: ST_PositiveFixedPercentage; +} + +export const CT_PositiveFixedPercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_ComplementTransform {} + +export const CT_ComplementTransform_Attributes: Attributes = {}; + +export interface CT_InverseTransform {} + +export const CT_InverseTransform_Attributes: Attributes = {}; + +export interface CT_GrayscaleTransform {} + +export const CT_GrayscaleTransform_Attributes: Attributes = {}; + +export interface CT_FixedPercentage { + val?: ST_FixedPercentage; +} + +export const CT_FixedPercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_PositivePercentage { + val?: ST_PositivePercentage; +} + +export const CT_PositivePercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_PositiveFixedAngle = ST_Angle; + +export interface CT_PositiveFixedAngle { + val?: number; +} + +export const CT_PositiveFixedAngle_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export type ST_Angle = number; + +export interface CT_Angle { + val?: number; +} + +export const CT_Angle_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_Percentage { + val?: string; +} + +export const CT_Percentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_GammaTransform {} + +export const CT_GammaTransform_Attributes: Attributes = {}; + +export interface CT_InverseGammaTransform {} + +export const CT_InverseGammaTransform_Attributes: Attributes = {}; + +export interface CT_ScRgbColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + r?: string; + g?: string; + b?: string; +} + +export const CT_ScRgbColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + r: { + type: 'string' + }, + g: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export interface CT_SRgbColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: string; +} + +export const CT_SRgbColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export interface CT_HslColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: number; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: string; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: string; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; +} + +export const CT_HslColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'int' + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'string' + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'string' + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + } +}; + +export type ST_SystemColorVal = + | 'scrollBar' + | 'background' + | 'activeCaption' + | 'inactiveCaption' + | 'menu' + | 'window' + | 'windowFrame' + | 'menuText' + | 'windowText' + | 'captionText' + | 'activeBorder' + | 'inactiveBorder' + | 'appWorkspace' + | 'highlight' + | 'highlightText' + | 'btnFace' + | 'btnShadow' + | 'grayText' + | 'btnText' + | 'inactiveCaptionText' + | 'btnHighlight' + | '3dDkShadow' + | '3dLight' + | 'infoText' + | 'infoBk' + | 'hotLight' + | 'gradientActiveCaption' + | 'gradientInactiveCaption' + | 'menuHighlight' + | 'menuBar'; + +export interface CT_SystemColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_SystemColorVal; + lastClr?: string; +} + +export const CT_SystemColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + }, + lastClr: { + type: 'string' + } +}; + +export type ST_SchemeColorVal = + | 'bg1' + | 'tx1' + | 'bg2' + | 'tx2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink' + | 'phClr' + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2'; + +export interface CT_SchemeColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_SchemeColorVal; +} + +export const CT_SchemeColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export type ST_PresetColorVal = + | 'aliceBlue' + | 'antiqueWhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedAlmond' + | 'blue' + | 'blueViolet' + | 'brown' + | 'burlyWood' + | 'cadetBlue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerBlue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkBlue' + | 'darkCyan' + | 'darkGoldenrod' + | 'darkGray' + | 'darkGrey' + | 'darkGreen' + | 'darkKhaki' + | 'darkMagenta' + | 'darkOliveGreen' + | 'darkOrange' + | 'darkOrchid' + | 'darkRed' + | 'darkSalmon' + | 'darkSeaGreen' + | 'darkSlateBlue' + | 'darkSlateGray' + | 'darkSlateGrey' + | 'darkTurquoise' + | 'darkViolet' + | 'dkBlue' + | 'dkCyan' + | 'dkGoldenrod' + | 'dkGray' + | 'dkGrey' + | 'dkGreen' + | 'dkKhaki' + | 'dkMagenta' + | 'dkOliveGreen' + | 'dkOrange' + | 'dkOrchid' + | 'dkRed' + | 'dkSalmon' + | 'dkSeaGreen' + | 'dkSlateBlue' + | 'dkSlateGray' + | 'dkSlateGrey' + | 'dkTurquoise' + | 'dkViolet' + | 'deepPink' + | 'deepSkyBlue' + | 'dimGray' + | 'dimGrey' + | 'dodgerBlue' + | 'firebrick' + | 'floralWhite' + | 'forestGreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostWhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'grey' + | 'green' + | 'greenYellow' + | 'honeydew' + | 'hotPink' + | 'indianRed' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderBlush' + | 'lawnGreen' + | 'lemonChiffon' + | 'lightBlue' + | 'lightCoral' + | 'lightCyan' + | 'lightGoldenrodYellow' + | 'lightGray' + | 'lightGrey' + | 'lightGreen' + | 'lightPink' + | 'lightSalmon' + | 'lightSeaGreen' + | 'lightSkyBlue' + | 'lightSlateGray' + | 'lightSlateGrey' + | 'lightSteelBlue' + | 'lightYellow' + | 'ltBlue' + | 'ltCoral' + | 'ltCyan' + | 'ltGoldenrodYellow' + | 'ltGray' + | 'ltGrey' + | 'ltGreen' + | 'ltPink' + | 'ltSalmon' + | 'ltSeaGreen' + | 'ltSkyBlue' + | 'ltSlateGray' + | 'ltSlateGrey' + | 'ltSteelBlue' + | 'ltYellow' + | 'lime' + | 'limeGreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'medAquamarine' + | 'medBlue' + | 'medOrchid' + | 'medPurple' + | 'medSeaGreen' + | 'medSlateBlue' + | 'medSpringGreen' + | 'medTurquoise' + | 'medVioletRed' + | 'mediumAquamarine' + | 'mediumBlue' + | 'mediumOrchid' + | 'mediumPurple' + | 'mediumSeaGreen' + | 'mediumSlateBlue' + | 'mediumSpringGreen' + | 'mediumTurquoise' + | 'mediumVioletRed' + | 'midnightBlue' + | 'mintCream' + | 'mistyRose' + | 'moccasin' + | 'navajoWhite' + | 'navy' + | 'oldLace' + | 'olive' + | 'oliveDrab' + | 'orange' + | 'orangeRed' + | 'orchid' + | 'paleGoldenrod' + | 'paleGreen' + | 'paleTurquoise' + | 'paleVioletRed' + | 'papayaWhip' + | 'peachPuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderBlue' + | 'purple' + | 'red' + | 'rosyBrown' + | 'royalBlue' + | 'saddleBrown' + | 'salmon' + | 'sandyBrown' + | 'seaGreen' + | 'seaShell' + | 'sienna' + | 'silver' + | 'skyBlue' + | 'slateBlue' + | 'slateGray' + | 'slateGrey' + | 'snow' + | 'springGreen' + | 'steelBlue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whiteSmoke' + | 'yellow' + | 'yellowGreen'; + +export interface CT_PresetColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_PresetColorVal; +} + +export const CT_PresetColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export interface CT_Color { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_Color_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_ColorScheme { + dk1?: CT_Color; + lt1?: CT_Color; + dk2?: CT_Color; + lt2?: CT_Color; + accent1?: CT_Color; + accent2?: CT_Color; + accent3?: CT_Color; + accent4?: CT_Color; + accent5?: CT_Color; + accent6?: CT_Color; + hlink?: CT_Color; + folHlink?: CT_Color; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_ColorScheme_Attributes: Attributes = { + dk1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + lt1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + dk2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + lt2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent3: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent4: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent5: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent6: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + hlink: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + folHlink: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_CustomColor { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + name?: string; +} + +export const CT_CustomColor_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + name: { + type: 'string' + } +}; + +export type ST_TextTypeface = string; + +export interface CT_SupplementalFont { + script?: string; + typeface?: string; +} + +export const CT_SupplementalFont_Attributes: Attributes = { + script: { + type: 'string' + }, + typeface: { + type: 'string' + } +}; + +export interface CT_CustomColorList { + custClr?: CT_CustomColor[]; +} + +export const CT_CustomColorList_Attributes: Attributes = { + custClr: { + type: 'child', + childAttributes: CT_CustomColor_Attributes, + childIsArray: true + } +}; + +export type ST_PitchFamily = number; + +export interface CT_TextFont { + typeface?: string; + panose?: string; + pitchFamily?: number; + charset?: number; +} + +export const CT_TextFont_Attributes: Attributes = { + typeface: { + type: 'string' + }, + panose: { + type: 'string' + }, + pitchFamily: { + type: 'int', + defaultValue: '0' + }, + charset: { + type: 'int', + defaultValue: '1' + } +}; + +export interface CT_FontCollection { + latin?: CT_TextFont; + ea?: CT_TextFont; + cs?: CT_TextFont; + font?: CT_SupplementalFont[]; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_FontCollection_Attributes: Attributes = { + latin: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + ea: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + cs: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + font: { + type: 'child', + childAttributes: CT_SupplementalFont_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type CT_EffectStyleItem = any; +export const CT_EffectStyleItem_Attributes: Attributes = {}; + +export type CT_EffectList = any; +export const CT_EffectList_Attributes: Attributes = {}; + +export type ST_PositiveCoordinate = number; + +export interface CT_BlurEffect { + rad?: number; + grow?: boolean; +} + +export const CT_BlurEffect_Attributes: Attributes = { + rad: { + type: 'int', + defaultValue: '0' + }, + grow: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type CT_FillOverlayEffect = any; +export const CT_FillOverlayEffect_Attributes: Attributes = {}; + +export interface CT_NoFillProperties {} + +export const CT_NoFillProperties_Attributes: Attributes = {}; + +export interface CT_SolidColorFillProperties { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_SolidColorFillProperties_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_GradientStop { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + pos?: ST_PositiveFixedPercentage; +} + +export const CT_GradientStop_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + pos: { + type: 'string' + } +}; + +export interface CT_GradientStopList { + gs?: CT_GradientStop[]; +} + +export const CT_GradientStopList_Attributes: Attributes = { + gs: { + type: 'child', + childAttributes: CT_GradientStop_Attributes, + childIsArray: true + } +}; + +export interface CT_LinearShadeProperties { + ang?: number; + scaled?: boolean; +} + +export const CT_LinearShadeProperties_Attributes: Attributes = { + ang: { + type: 'int' + }, + scaled: { + type: 'boolean' + } +}; + +export interface CT_RelativeRect { + l?: string; + t?: string; + r?: string; + b?: string; +} + +export const CT_RelativeRect_Attributes: Attributes = { + l: { + type: 'string', + defaultValue: '0%' + }, + t: { + type: 'string', + defaultValue: '0%' + }, + r: { + type: 'string', + defaultValue: '0%' + }, + b: { + type: 'string', + defaultValue: '0%' + } +}; + +export type ST_PathShadeType = 'shape' | 'circle' | 'rect'; + +export interface CT_PathShadeProperties { + fillToRect?: CT_RelativeRect; + path?: ST_PathShadeType; +} + +export const CT_PathShadeProperties_Attributes: Attributes = { + fillToRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + path: { + type: 'string' + } +}; + +export type ST_TileFlipMode = 'none' | 'x' | 'y' | 'xy'; + +export interface CT_GradientFillProperties { + gsLst?: CT_GradientStopList; + lin?: CT_LinearShadeProperties; + path?: CT_PathShadeProperties; + tileRect?: CT_RelativeRect; + flip?: ST_TileFlipMode; + rotWithShape?: boolean; +} + +export const CT_GradientFillProperties_Attributes: Attributes = { + gsLst: { + type: 'child', + childAttributes: CT_GradientStopList_Attributes + }, + lin: { + type: 'child', + childAttributes: CT_LinearShadeProperties_Attributes + }, + path: { + type: 'child', + childAttributes: CT_PathShadeProperties_Attributes + }, + tileRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + flip: { + type: 'string', + defaultValue: 'none' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export type CT_BlipFillProperties = any; +export const CT_BlipFillProperties_Attributes: Attributes = {}; + +export interface CT_AlphaBiLevelEffect { + thresh?: ST_PositiveFixedPercentage; +} + +export const CT_AlphaBiLevelEffect_Attributes: Attributes = { + thresh: { + type: 'string' + } +}; + +export interface CT_AlphaCeilingEffect {} + +export const CT_AlphaCeilingEffect_Attributes: Attributes = {}; + +export interface CT_AlphaFloorEffect {} + +export const CT_AlphaFloorEffect_Attributes: Attributes = {}; + +export interface CT_AlphaInverseEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_AlphaInverseEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export type ST_EffectContainerType = 'sib' | 'tree'; + +export interface CT_EffectContainer { + type?: ST_EffectContainerType; + name?: string; +} + +export const CT_EffectContainer_Attributes: Attributes = { + type: { + type: 'string', + defaultValue: 'sib' + }, + name: { + type: 'string' + } +}; + +export interface CT_AlphaModulateEffect { + cont?: CT_EffectContainer; +} + +export const CT_AlphaModulateEffect_Attributes: Attributes = { + cont: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_AlphaModulateFixedEffect { + amt?: ST_PositivePercentage; +} + +export const CT_AlphaModulateFixedEffect_Attributes: Attributes = { + amt: { + type: 'string', + defaultValue: '100%' + } +}; + +export interface CT_AlphaReplaceEffect { + a?: ST_PositiveFixedPercentage; +} + +export const CT_AlphaReplaceEffect_Attributes: Attributes = { + a: { + type: 'string' + } +}; + +export interface CT_BiLevelEffect { + thresh?: ST_PositiveFixedPercentage; +} + +export const CT_BiLevelEffect_Attributes: Attributes = { + thresh: { + type: 'string' + } +}; + +export interface CT_ColorChangeEffect { + clrFrom?: CT_Color; + clrTo?: CT_Color; + useA?: boolean; +} + +export const CT_ColorChangeEffect_Attributes: Attributes = { + clrFrom: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + clrTo: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + useA: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_ColorReplaceEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_ColorReplaceEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_DuotoneEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_DuotoneEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_GrayscaleEffect {} + +export const CT_GrayscaleEffect_Attributes: Attributes = {}; + +export interface CT_HSLEffect { + hue?: number; + sat?: ST_FixedPercentage; + lum?: ST_FixedPercentage; +} + +export const CT_HSLEffect_Attributes: Attributes = { + hue: { + type: 'int', + defaultValue: '0' + }, + sat: { + type: 'string', + defaultValue: '0%' + }, + lum: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_LuminanceEffect { + bright?: ST_FixedPercentage; + contrast?: ST_FixedPercentage; +} + +export const CT_LuminanceEffect_Attributes: Attributes = { + bright: { + type: 'string', + defaultValue: '0%' + }, + contrast: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_TintEffect { + hue?: number; + amt?: ST_FixedPercentage; +} + +export const CT_TintEffect_Attributes: Attributes = { + hue: { + type: 'int', + defaultValue: '0' + }, + amt: { + type: 'string', + defaultValue: '0%' + } +}; + +export type ST_BlipCompression = + | 'email' + | 'screen' + | 'print' + | 'hqprint' + | 'none'; + +export interface CT_Blip { + alphaBiLevel?: CT_AlphaBiLevelEffect; + alphaCeiling?: CT_AlphaCeilingEffect; + alphaFloor?: CT_AlphaFloorEffect; + alphaInv?: CT_AlphaInverseEffect; + alphaMod?: CT_AlphaModulateEffect; + alphaModFix?: CT_AlphaModulateFixedEffect; + alphaRepl?: CT_AlphaReplaceEffect; + biLevel?: CT_BiLevelEffect; + blur?: CT_BlurEffect; + clrChange?: CT_ColorChangeEffect; + clrRepl?: CT_ColorReplaceEffect; + duotone?: CT_DuotoneEffect; + fillOverlay?: CT_FillOverlayEffect; + grayscl?: CT_GrayscaleEffect; + hsl?: CT_HSLEffect; + lum?: CT_LuminanceEffect; + tint?: CT_TintEffect; + extLst?: CT_OfficeArtExtensionList; + cstate?: ST_BlipCompression; +} + +export const CT_Blip_Attributes: Attributes = { + alphaBiLevel: { + type: 'child', + childAttributes: CT_AlphaBiLevelEffect_Attributes + }, + alphaCeiling: { + type: 'child', + childAttributes: CT_AlphaCeilingEffect_Attributes + }, + alphaFloor: { + type: 'child', + childAttributes: CT_AlphaFloorEffect_Attributes + }, + alphaInv: { + type: 'child', + childAttributes: CT_AlphaInverseEffect_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_AlphaModulateEffect_Attributes + }, + alphaModFix: { + type: 'child', + childAttributes: CT_AlphaModulateFixedEffect_Attributes + }, + alphaRepl: { + type: 'child', + childAttributes: CT_AlphaReplaceEffect_Attributes + }, + biLevel: { + type: 'child', + childAttributes: CT_BiLevelEffect_Attributes + }, + blur: { + type: 'child', + childAttributes: CT_BlurEffect_Attributes + }, + clrChange: { + type: 'child', + childAttributes: CT_ColorChangeEffect_Attributes + }, + clrRepl: { + type: 'child', + childAttributes: CT_ColorReplaceEffect_Attributes + }, + duotone: { + type: 'child', + childAttributes: CT_DuotoneEffect_Attributes + }, + fillOverlay: { + type: 'child', + childAttributes: CT_FillOverlayEffect_Attributes + }, + grayscl: { + type: 'child', + childAttributes: CT_GrayscaleEffect_Attributes + }, + hsl: { + type: 'child', + childAttributes: CT_HSLEffect_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_LuminanceEffect_Attributes + }, + tint: { + type: 'child', + childAttributes: CT_TintEffect_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + cstate: { + type: 'string', + defaultValue: 'none' + } +}; + +export type ST_Coordinate = ST_CoordinateUnqualified | ST_UniversalMeasure; + +export type ST_RectAlignment = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'ctr' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_TileInfoProperties { + tx?: ST_Coordinate; + ty?: ST_Coordinate; + sx?: string; + sy?: string; + flip?: ST_TileFlipMode; + algn?: ST_RectAlignment; +} + +export const CT_TileInfoProperties_Attributes: Attributes = { + tx: { + type: 'string' + }, + ty: { + type: 'string' + }, + sx: { + type: 'string' + }, + sy: { + type: 'string' + }, + flip: { + type: 'string', + defaultValue: 'none' + }, + algn: { + type: 'string' + } +}; + +export interface CT_StretchInfoProperties { + fillRect?: CT_RelativeRect; +} + +export const CT_StretchInfoProperties_Attributes: Attributes = { + fillRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + } +}; + +export type ST_PresetPatternVal = + | 'pct5' + | 'pct10' + | 'pct20' + | 'pct25' + | 'pct30' + | 'pct40' + | 'pct50' + | 'pct60' + | 'pct70' + | 'pct75' + | 'pct80' + | 'pct90' + | 'horz' + | 'vert' + | 'ltHorz' + | 'ltVert' + | 'dkHorz' + | 'dkVert' + | 'narHorz' + | 'narVert' + | 'dashHorz' + | 'dashVert' + | 'cross' + | 'dnDiag' + | 'upDiag' + | 'ltDnDiag' + | 'ltUpDiag' + | 'dkDnDiag' + | 'dkUpDiag' + | 'wdDnDiag' + | 'wdUpDiag' + | 'dashDnDiag' + | 'dashUpDiag' + | 'diagCross' + | 'smCheck' + | 'lgCheck' + | 'smGrid' + | 'lgGrid' + | 'dotGrid' + | 'smConfetti' + | 'lgConfetti' + | 'horzBrick' + | 'diagBrick' + | 'solidDmnd' + | 'openDmnd' + | 'dotDmnd' + | 'plaid' + | 'sphere' + | 'weave' + | 'divot' + | 'shingle' + | 'wave' + | 'trellis' + | 'zigZag'; + +export interface CT_PatternFillProperties { + fgClr?: CT_Color; + bgClr?: CT_Color; + prst?: ST_PresetPatternVal; +} + +export const CT_PatternFillProperties_Attributes: Attributes = { + fgClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + bgClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_GroupFillProperties {} + +export const CT_GroupFillProperties_Attributes: Attributes = {}; + +export type ST_BlendMode = 'over' | 'mult' | 'screen' | 'darken' | 'lighten'; + +export interface CT_GlowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + rad?: number; +} + +export const CT_GlowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + rad: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_InnerShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + blurRad?: number; + dist?: number; + dir?: number; +} + +export const CT_InnerShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + blurRad: { + type: 'int', + defaultValue: '0' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_FixedAngle = ST_Angle; + +export interface CT_OuterShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + blurRad?: number; + dist?: number; + dir?: number; + sx?: string; + sy?: string; + kx?: number; + ky?: number; + algn?: ST_RectAlignment; + rotWithShape?: boolean; +} + +export const CT_OuterShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + blurRad: { + type: 'int', + defaultValue: '0' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + }, + sx: { + type: 'string', + defaultValue: '100%' + }, + sy: { + type: 'string', + defaultValue: '100%' + }, + kx: { + type: 'int', + defaultValue: '0' + }, + ky: { + type: 'int', + defaultValue: '0' + }, + algn: { + type: 'string', + defaultValue: 'b' + }, + rotWithShape: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_PresetShadowVal = + | 'shdw1' + | 'shdw2' + | 'shdw3' + | 'shdw4' + | 'shdw5' + | 'shdw6' + | 'shdw7' + | 'shdw8' + | 'shdw9' + | 'shdw10' + | 'shdw11' + | 'shdw12' + | 'shdw13' + | 'shdw14' + | 'shdw15' + | 'shdw16' + | 'shdw17' + | 'shdw18' + | 'shdw19' + | 'shdw20'; + +export interface CT_PresetShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + prst?: ST_PresetShadowVal; + dist?: number; + dir?: number; +} + +export const CT_PresetShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + prst: { + type: 'string' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_ReflectionEffect { + blurRad?: number; + stA?: ST_PositiveFixedPercentage; + stPos?: ST_PositiveFixedPercentage; + endA?: ST_PositiveFixedPercentage; + endPos?: ST_PositiveFixedPercentage; + dist?: number; + dir?: number; + fadeDir?: number; + sx?: string; + sy?: string; + kx?: number; + ky?: number; + algn?: ST_RectAlignment; + rotWithShape?: boolean; +} + +export const CT_ReflectionEffect_Attributes: Attributes = { + blurRad: { + type: 'int', + defaultValue: '0' + }, + stA: { + type: 'string', + defaultValue: '100%' + }, + stPos: { + type: 'string', + defaultValue: '0%' + }, + endA: { + type: 'string', + defaultValue: '0%' + }, + endPos: { + type: 'string', + defaultValue: '100%' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + }, + fadeDir: { + type: 'int', + defaultValue: '5400000' + }, + sx: { + type: 'string', + defaultValue: '100%' + }, + sy: { + type: 'string', + defaultValue: '100%' + }, + kx: { + type: 'int', + defaultValue: '0' + }, + ky: { + type: 'int', + defaultValue: '0' + }, + algn: { + type: 'string', + defaultValue: 'b' + }, + rotWithShape: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_SoftEdgesEffect { + rad?: number; +} + +export const CT_SoftEdgesEffect_Attributes: Attributes = { + rad: { + type: 'int' + } +}; + +export interface CT_SphereCoords { + lat?: number; + lon?: number; + rev?: number; +} + +export const CT_SphereCoords_Attributes: Attributes = { + lat: { + type: 'int' + }, + lon: { + type: 'int' + }, + rev: { + type: 'int' + } +}; + +export type ST_PresetCameraType = + | 'legacyObliqueTopLeft' + | 'legacyObliqueTop' + | 'legacyObliqueTopRight' + | 'legacyObliqueLeft' + | 'legacyObliqueFront' + | 'legacyObliqueRight' + | 'legacyObliqueBottomLeft' + | 'legacyObliqueBottom' + | 'legacyObliqueBottomRight' + | 'legacyPerspectiveTopLeft' + | 'legacyPerspectiveTop' + | 'legacyPerspectiveTopRight' + | 'legacyPerspectiveLeft' + | 'legacyPerspectiveFront' + | 'legacyPerspectiveRight' + | 'legacyPerspectiveBottomLeft' + | 'legacyPerspectiveBottom' + | 'legacyPerspectiveBottomRight' + | 'orthographicFront' + | 'isometricTopUp' + | 'isometricTopDown' + | 'isometricBottomUp' + | 'isometricBottomDown' + | 'isometricLeftUp' + | 'isometricLeftDown' + | 'isometricRightUp' + | 'isometricRightDown' + | 'isometricOffAxis1Left' + | 'isometricOffAxis1Right' + | 'isometricOffAxis1Top' + | 'isometricOffAxis2Left' + | 'isometricOffAxis2Right' + | 'isometricOffAxis2Top' + | 'isometricOffAxis3Left' + | 'isometricOffAxis3Right' + | 'isometricOffAxis3Bottom' + | 'isometricOffAxis4Left' + | 'isometricOffAxis4Right' + | 'isometricOffAxis4Bottom' + | 'obliqueTopLeft' + | 'obliqueTop' + | 'obliqueTopRight' + | 'obliqueLeft' + | 'obliqueRight' + | 'obliqueBottomLeft' + | 'obliqueBottom' + | 'obliqueBottomRight' + | 'perspectiveFront' + | 'perspectiveLeft' + | 'perspectiveRight' + | 'perspectiveAbove' + | 'perspectiveBelow' + | 'perspectiveAboveLeftFacing' + | 'perspectiveAboveRightFacing' + | 'perspectiveContrastingLeftFacing' + | 'perspectiveContrastingRightFacing' + | 'perspectiveHeroicLeftFacing' + | 'perspectiveHeroicRightFacing' + | 'perspectiveHeroicExtremeLeftFacing' + | 'perspectiveHeroicExtremeRightFacing' + | 'perspectiveRelaxed' + | 'perspectiveRelaxedModerately'; + +export type ST_FOVAngle = ST_Angle; + +export interface CT_Camera { + rot?: CT_SphereCoords; + prst?: ST_PresetCameraType; + fov?: number; + zoom?: ST_PositivePercentage; +} + +export const CT_Camera_Attributes: Attributes = { + rot: { + type: 'child', + childAttributes: CT_SphereCoords_Attributes + }, + prst: { + type: 'string' + }, + fov: { + type: 'int' + }, + zoom: { + type: 'string', + defaultValue: '100%' + } +}; + +export type ST_LightRigType = + | 'legacyFlat1' + | 'legacyFlat2' + | 'legacyFlat3' + | 'legacyFlat4' + | 'legacyNormal1' + | 'legacyNormal2' + | 'legacyNormal3' + | 'legacyNormal4' + | 'legacyHarsh1' + | 'legacyHarsh2' + | 'legacyHarsh3' + | 'legacyHarsh4' + | 'threePt' + | 'balanced' + | 'soft' + | 'harsh' + | 'flood' + | 'contrasting' + | 'morning' + | 'sunrise' + | 'sunset' + | 'chilly' + | 'freezing' + | 'flat' + | 'twoPt' + | 'glow' + | 'brightRoom'; + +export type ST_LightRigDirection = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_LightRig { + rot?: CT_SphereCoords; + rig?: ST_LightRigType; + dir?: ST_LightRigDirection; +} + +export const CT_LightRig_Attributes: Attributes = { + rot: { + type: 'child', + childAttributes: CT_SphereCoords_Attributes + }, + rig: { + type: 'string' + }, + dir: { + type: 'string' + } +}; + +export interface CT_Point3D { + x?: ST_Coordinate; + y?: ST_Coordinate; + z?: ST_Coordinate; +} + +export const CT_Point3D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + }, + z: { + type: 'string' + } +}; + +export interface CT_Vector3D { + dx?: ST_Coordinate; + dy?: ST_Coordinate; + dz?: ST_Coordinate; +} + +export const CT_Vector3D_Attributes: Attributes = { + dx: { + type: 'string' + }, + dy: { + type: 'string' + }, + dz: { + type: 'string' + } +}; + +export interface CT_Backdrop { + anchor?: CT_Point3D; + norm?: CT_Vector3D; + up?: CT_Vector3D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_Backdrop_Attributes: Attributes = { + anchor: { + type: 'child', + childAttributes: CT_Point3D_Attributes + }, + norm: { + type: 'child', + childAttributes: CT_Vector3D_Attributes + }, + up: { + type: 'child', + childAttributes: CT_Vector3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_Scene3D { + camera?: CT_Camera; + lightRig?: CT_LightRig; + backdrop?: CT_Backdrop; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_Scene3D_Attributes: Attributes = { + camera: { + type: 'child', + childAttributes: CT_Camera_Attributes + }, + lightRig: { + type: 'child', + childAttributes: CT_LightRig_Attributes + }, + backdrop: { + type: 'child', + childAttributes: CT_Backdrop_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_BevelPresetType = + | 'relaxedInset' + | 'circle' + | 'slope' + | 'cross' + | 'angle' + | 'softRound' + | 'convex' + | 'coolSlant' + | 'divot' + | 'riblet' + | 'hardEdge' + | 'artDeco'; + +export interface CT_Bevel { + w?: number; + h?: number; + prst?: ST_BevelPresetType; +} + +export const CT_Bevel_Attributes: Attributes = { + w: { + type: 'int', + defaultValue: '76200' + }, + h: { + type: 'int', + defaultValue: '76200' + }, + prst: { + type: 'string', + defaultValue: 'circle' + } +}; + +export type ST_PresetMaterialType = + | 'legacyMatte' + | 'legacyPlastic' + | 'legacyMetal' + | 'legacyWireframe' + | 'matte' + | 'plastic' + | 'metal' + | 'warmMatte' + | 'translucentPowder' + | 'powder' + | 'dkEdge' + | 'softEdge' + | 'clear' + | 'flat' + | 'softmetal'; + +export interface CT_Shape3D { + bevelT?: CT_Bevel; + bevelB?: CT_Bevel; + extrusionClr?: CT_Color; + contourClr?: CT_Color; + extLst?: CT_OfficeArtExtensionList; + z?: ST_Coordinate; + extrusionH?: number; + contourW?: number; + prstMaterial?: ST_PresetMaterialType; +} + +export const CT_Shape3D_Attributes: Attributes = { + bevelT: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + bevelB: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + extrusionClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + contourClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + z: { + type: 'string', + defaultValue: '0' + }, + extrusionH: { + type: 'int', + defaultValue: '0' + }, + contourW: { + type: 'int', + defaultValue: '0' + }, + prstMaterial: { + type: 'string', + defaultValue: 'warmMatte' + } +}; + +export interface CT_FontScheme { + majorFont?: CT_FontCollection; + minorFont?: CT_FontCollection; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_FontScheme_Attributes: Attributes = { + majorFont: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + minorFont: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_FillStyleList { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillStyleList_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export type ST_PresetLineDashVal = + | 'solid' + | 'dot' + | 'dash' + | 'lgDash' + | 'dashDot' + | 'lgDashDot' + | 'lgDashDotDot' + | 'sysDash' + | 'sysDot' + | 'sysDashDot' + | 'sysDashDotDot'; + +export interface CT_PresetLineDashProperties { + val?: ST_PresetLineDashVal; +} + +export const CT_PresetLineDashProperties_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_DashStop { + d?: ST_PositivePercentage; + sp?: ST_PositivePercentage; +} + +export const CT_DashStop_Attributes: Attributes = { + d: { + type: 'string' + }, + sp: { + type: 'string' + } +}; + +export interface CT_DashStopList { + ds?: CT_DashStop[]; +} + +export const CT_DashStopList_Attributes: Attributes = { + ds: { + type: 'child', + childAttributes: CT_DashStop_Attributes, + childIsArray: true + } +}; + +export interface CT_LineJoinRound {} + +export const CT_LineJoinRound_Attributes: Attributes = {}; + +export interface CT_LineJoinBevel {} + +export const CT_LineJoinBevel_Attributes: Attributes = {}; + +export interface CT_LineJoinMiterProperties { + lim?: ST_PositivePercentage; +} + +export const CT_LineJoinMiterProperties_Attributes: Attributes = { + lim: { + type: 'string' + } +}; + +export type ST_LineEndType = + | 'none' + | 'triangle' + | 'stealth' + | 'diamond' + | 'oval' + | 'arrow'; + +export type ST_LineEndWidth = 'sm' | 'med' | 'lg'; + +export type ST_LineEndLength = 'sm' | 'med' | 'lg'; + +export interface CT_LineEndProperties { + type?: ST_LineEndType; + w?: ST_LineEndWidth; + len?: ST_LineEndLength; +} + +export const CT_LineEndProperties_Attributes: Attributes = { + type: { + type: 'string', + defaultValue: 'none' + }, + w: { + type: 'string' + }, + len: { + type: 'string' + } +}; + +export type ST_LineWidth = ST_Coordinate32Unqualified; + +export type ST_LineCap = 'rnd' | 'sq' | 'flat'; + +export type ST_CompoundLine = 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri'; + +export type ST_PenAlignment = 'ctr' | 'in'; + +export interface CT_LineProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + pattFill?: CT_PatternFillProperties; + prstDash?: CT_PresetLineDashProperties; + custDash?: CT_DashStopList; + round?: CT_LineJoinRound; + bevel?: CT_LineJoinBevel; + miter?: CT_LineJoinMiterProperties; + headEnd?: CT_LineEndProperties; + tailEnd?: CT_LineEndProperties; + extLst?: CT_OfficeArtExtensionList; + w?: number; + cap?: ST_LineCap; + cmpd?: ST_CompoundLine; + algn?: ST_PenAlignment; +} + +export const CT_LineProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + prstDash: { + type: 'child', + childAttributes: CT_PresetLineDashProperties_Attributes + }, + custDash: { + type: 'child', + childAttributes: CT_DashStopList_Attributes + }, + round: { + type: 'child', + childAttributes: CT_LineJoinRound_Attributes + }, + bevel: { + type: 'child', + childAttributes: CT_LineJoinBevel_Attributes + }, + miter: { + type: 'child', + childAttributes: CT_LineJoinMiterProperties_Attributes + }, + headEnd: { + type: 'child', + childAttributes: CT_LineEndProperties_Attributes + }, + tailEnd: { + type: 'child', + childAttributes: CT_LineEndProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + w: { + type: 'int' + }, + cap: { + type: 'string' + }, + cmpd: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_LineStyleList { + ln?: CT_LineProperties[]; +} + +export const CT_LineStyleList_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes, + childIsArray: true + } +}; + +export interface CT_EffectStyleList { + effectStyle?: CT_EffectStyleItem[]; +} + +export const CT_EffectStyleList_Attributes: Attributes = { + effectStyle: { + type: 'child', + childAttributes: CT_EffectStyleItem_Attributes, + childIsArray: true + } +}; + +export interface CT_BackgroundFillStyleList { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_BackgroundFillStyleList_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_StyleMatrix { + fillStyleLst?: CT_FillStyleList; + lnStyleLst?: CT_LineStyleList; + effectStyleLst?: CT_EffectStyleList; + bgFillStyleLst?: CT_BackgroundFillStyleList; + name?: string; +} + +export const CT_StyleMatrix_Attributes: Attributes = { + fillStyleLst: { + type: 'child', + childAttributes: CT_FillStyleList_Attributes + }, + lnStyleLst: { + type: 'child', + childAttributes: CT_LineStyleList_Attributes + }, + effectStyleLst: { + type: 'child', + childAttributes: CT_EffectStyleList_Attributes + }, + bgFillStyleLst: { + type: 'child', + childAttributes: CT_BackgroundFillStyleList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_BaseStyles { + clrScheme?: CT_ColorScheme; + fontScheme?: CT_FontScheme; + fmtScheme?: CT_StyleMatrix; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_BaseStyles_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + fontScheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + }, + fmtScheme: { + type: 'child', + childAttributes: CT_StyleMatrix_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_CoordinateUnqualified = number; + +export type ST_Coordinate32 = ST_Coordinate32Unqualified | ST_UniversalMeasure; + +export type ST_Coordinate32Unqualified = number; + +export type ST_PositiveCoordinate32 = ST_Coordinate32Unqualified; + +export interface CT_Ratio { + n?: number; + d?: number; +} + +export const CT_Ratio_Attributes: Attributes = { + n: { + type: 'int' + }, + d: { + type: 'int' + } +}; + +export interface CT_Point2D { + x?: ST_Coordinate; + y?: ST_Coordinate; +} + +export const CT_Point2D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + } +}; + +export interface CT_PositiveSize2D { + cx?: number; + cy?: number; +} + +export const CT_PositiveSize2D_Attributes: Attributes = { + cx: { + type: 'int' + }, + cy: { + type: 'int' + } +}; + +export interface CT_Scale2D { + sx?: CT_Ratio; + sy?: CT_Ratio; +} + +export const CT_Scale2D_Attributes: Attributes = { + sx: { + type: 'child', + childAttributes: CT_Ratio_Attributes + }, + sy: { + type: 'child', + childAttributes: CT_Ratio_Attributes + } +}; + +export interface CT_Transform2D { + off?: CT_Point2D; + ext?: CT_PositiveSize2D; + rot?: number; + flipH?: boolean; + flipV?: boolean; +} + +export const CT_Transform2D_Attributes: Attributes = { + off: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + rot: { + type: 'int', + defaultValue: '0' + }, + flipH: { + type: 'boolean', + defaultValue: 'false' + }, + flipV: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupTransform2D { + off?: CT_Point2D; + ext?: CT_PositiveSize2D; + chOff?: CT_Point2D; + chExt?: CT_PositiveSize2D; + rot?: number; + flipH?: boolean; + flipV?: boolean; +} + +export const CT_GroupTransform2D_Attributes: Attributes = { + off: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + chOff: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + chExt: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + rot: { + type: 'int', + defaultValue: '0' + }, + flipH: { + type: 'boolean', + defaultValue: 'false' + }, + flipV: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ColorMRU { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_ColorMRU_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export type ST_BlackWhiteMode = + | 'clr' + | 'auto' + | 'gray' + | 'ltGray' + | 'invGray' + | 'grayWhite' + | 'blackGray' + | 'blackWhite' + | 'black' + | 'white' + | 'hidden'; + +export interface CT_EmbeddedWAVAudioFile { + name?: string; +} + +export const CT_EmbeddedWAVAudioFile_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export interface CT_Hyperlink { + 'snd'?: CT_EmbeddedWAVAudioFile; + 'extLst'?: CT_OfficeArtExtensionList; + 'r:id'?: string; + 'invalidUrl'?: string; + 'action'?: string; + 'tgtFrame'?: string; + 'tooltip'?: string; + 'history'?: boolean; + 'highlightClick'?: boolean; + 'endSnd'?: boolean; +} + +export const CT_Hyperlink_Attributes: Attributes = { + 'snd': { + type: 'child', + childAttributes: CT_EmbeddedWAVAudioFile_Attributes + }, + 'extLst': { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + 'r:id': { + type: 'string' + }, + 'invalidUrl': { + type: 'string' + }, + 'action': { + type: 'string' + }, + 'tgtFrame': { + type: 'string' + }, + 'tooltip': { + type: 'string' + }, + 'history': { + type: 'boolean', + defaultValue: 'true' + }, + 'highlightClick': { + type: 'boolean', + defaultValue: 'false' + }, + 'endSnd': { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_DrawingElementId = number; + +export interface CT_ConnectorLocking { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ConnectorLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_ShapeLocking { + extLst?: CT_OfficeArtExtensionList; + noTextEdit?: boolean; +} + +export const CT_ShapeLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noTextEdit: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PictureLocking { + extLst?: CT_OfficeArtExtensionList; + noCrop?: boolean; +} + +export const CT_PictureLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noCrop: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupLocking { + extLst?: CT_OfficeArtExtensionList; + noGrp?: boolean; + noUngrp?: boolean; + noSelect?: boolean; + noRot?: boolean; + noChangeAspect?: boolean; + noMove?: boolean; + noResize?: boolean; +} + +export const CT_GroupLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noGrp: { + type: 'boolean', + defaultValue: 'false' + }, + noUngrp: { + type: 'boolean', + defaultValue: 'false' + }, + noSelect: { + type: 'boolean', + defaultValue: 'false' + }, + noRot: { + type: 'boolean', + defaultValue: 'false' + }, + noChangeAspect: { + type: 'boolean', + defaultValue: 'false' + }, + noMove: { + type: 'boolean', + defaultValue: 'false' + }, + noResize: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GraphicalObjectFrameLocking { + extLst?: CT_OfficeArtExtensionList; + noGrp?: boolean; + noDrilldown?: boolean; + noSelect?: boolean; + noChangeAspect?: boolean; + noMove?: boolean; + noResize?: boolean; +} + +export const CT_GraphicalObjectFrameLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noGrp: { + type: 'boolean', + defaultValue: 'false' + }, + noDrilldown: { + type: 'boolean', + defaultValue: 'false' + }, + noSelect: { + type: 'boolean', + defaultValue: 'false' + }, + noChangeAspect: { + type: 'boolean', + defaultValue: 'false' + }, + noMove: { + type: 'boolean', + defaultValue: 'false' + }, + noResize: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ContentPartLocking { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ContentPartLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualDrawingProps { + hlinkClick?: CT_Hyperlink; + hlinkHover?: CT_Hyperlink; + extLst?: CT_OfficeArtExtensionList; + id?: number; + name?: string; + descr?: string; + hidden?: boolean; + title?: string; +} + +export const CT_NonVisualDrawingProps_Attributes: Attributes = { + hlinkClick: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + hlinkHover: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + id: { + type: 'int' + }, + name: { + type: 'string' + }, + descr: { + type: 'string' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + }, + title: { + type: 'string' + } +}; + +export interface CT_NonVisualDrawingShapeProps { + spLocks?: CT_ShapeLocking; + extLst?: CT_OfficeArtExtensionList; + txBox?: boolean; +} + +export const CT_NonVisualDrawingShapeProps_Attributes: Attributes = { + spLocks: { + type: 'child', + childAttributes: CT_ShapeLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + txBox: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Connection { + id?: number; + idx?: number; +} + +export const CT_Connection_Attributes: Attributes = { + id: { + type: 'int' + }, + idx: { + type: 'int' + } +}; + +export interface CT_NonVisualConnectorProperties { + cxnSpLocks?: CT_ConnectorLocking; + stCxn?: CT_Connection; + endCxn?: CT_Connection; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualConnectorProperties_Attributes: Attributes = { + cxnSpLocks: { + type: 'child', + childAttributes: CT_ConnectorLocking_Attributes + }, + stCxn: { + type: 'child', + childAttributes: CT_Connection_Attributes + }, + endCxn: { + type: 'child', + childAttributes: CT_Connection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualPictureProperties { + picLocks?: CT_PictureLocking; + extLst?: CT_OfficeArtExtensionList; + preferRelativeResize?: boolean; +} + +export const CT_NonVisualPictureProperties_Attributes: Attributes = { + picLocks: { + type: 'child', + childAttributes: CT_PictureLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + preferRelativeResize: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_NonVisualGroupDrawingShapeProps { + grpSpLocks?: CT_GroupLocking; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualGroupDrawingShapeProps_Attributes: Attributes = { + grpSpLocks: { + type: 'child', + childAttributes: CT_GroupLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualGraphicFrameProperties { + graphicFrameLocks?: CT_GraphicalObjectFrameLocking; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualGraphicFrameProperties_Attributes: Attributes = { + graphicFrameLocks: { + type: 'child', + childAttributes: CT_GraphicalObjectFrameLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualContentPartProperties { + cpLocks?: CT_ContentPartLocking; + extLst?: CT_OfficeArtExtensionList; + isComment?: boolean; +} + +export const CT_NonVisualContentPartProperties_Attributes: Attributes = { + cpLocks: { + type: 'child', + childAttributes: CT_ContentPartLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + isComment: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_GraphicalObjectData { + __any__?: any; + uri?: string; +} + +export const CT_GraphicalObjectData_Attributes: Attributes = { + __any__: { + type: 'any' + }, + uri: { + type: 'string' + } +}; + +export interface CT_GraphicalObject { + graphicData?: CT_GraphicalObjectData[]; +} + +export const CT_GraphicalObject_Attributes: Attributes = { + graphicData: { + type: 'child', + childAttributes: CT_GraphicalObjectData_Attributes, + childIsArray: true + } +}; + +export type ST_ChartBuildStep = + | 'category' + | 'ptInCategory' + | 'series' + | 'ptInSeries' + | 'allPts' + | 'gridLegend'; + +export type ST_DgmBuildStep = 'sp' | 'bg'; + +export interface CT_AnimationDgmElement { + id?: string; + bldStep?: ST_DgmBuildStep; +} + +export const CT_AnimationDgmElement_Attributes: Attributes = { + id: { + type: 'string', + defaultValue: '{00000000-0000-0000-0000-000000000000}' + }, + bldStep: { + type: 'string', + defaultValue: 'sp' + } +}; + +export interface CT_AnimationChartElement { + seriesIdx?: number; + categoryIdx?: number; + bldStep?: ST_ChartBuildStep; +} + +export const CT_AnimationChartElement_Attributes: Attributes = { + seriesIdx: { + type: 'int', + defaultValue: '-1' + }, + categoryIdx: { + type: 'int', + defaultValue: '-1' + }, + bldStep: { + type: 'string' + } +}; + +export interface CT_AnimationElementChoice { + dgm?: CT_AnimationDgmElement[]; + chart?: CT_AnimationChartElement[]; +} + +export const CT_AnimationElementChoice_Attributes: Attributes = { + dgm: { + type: 'child', + childAttributes: CT_AnimationDgmElement_Attributes, + childIsArray: true + }, + chart: { + type: 'child', + childAttributes: CT_AnimationChartElement_Attributes, + childIsArray: true + } +}; + +export type ST_AnimationBuildType = 'allAtOnce'; + +export type ST_AnimationDgmOnlyBuildType = 'one' | 'lvlOne' | 'lvlAtOnce'; + +export type ST_AnimationDgmBuildType = + | ST_AnimationBuildType + | ST_AnimationDgmOnlyBuildType; + +export interface CT_AnimationDgmBuildProperties { + bld?: ST_AnimationDgmBuildType; + rev?: boolean; +} + +export const CT_AnimationDgmBuildProperties_Attributes: Attributes = { + bld: { + type: 'string', + defaultValue: 'allAtOnce' + }, + rev: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_AnimationChartOnlyBuildType = + | 'series' + | 'category' + | 'seriesEl' + | 'categoryEl'; + +export type ST_AnimationChartBuildType = + | ST_AnimationBuildType + | ST_AnimationChartOnlyBuildType; + +export interface CT_AnimationChartBuildProperties { + bld?: ST_AnimationChartBuildType; + animBg?: boolean; +} + +export const CT_AnimationChartBuildProperties_Attributes: Attributes = { + bld: { + type: 'string', + defaultValue: 'allAtOnce' + }, + animBg: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_AnimationGraphicalObjectBuildProperties { + bldDgm?: CT_AnimationDgmBuildProperties[]; + bldChart?: CT_AnimationChartBuildProperties[]; +} + +export const CT_AnimationGraphicalObjectBuildProperties_Attributes: Attributes = + { + bldDgm: { + type: 'child', + childAttributes: CT_AnimationDgmBuildProperties_Attributes, + childIsArray: true + }, + bldChart: { + type: 'child', + childAttributes: CT_AnimationChartBuildProperties_Attributes, + childIsArray: true + } + }; + +export interface CT_BackgroundFormatting { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_BackgroundFormatting_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_WholeE2oFormatting { + ln?: CT_LineProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_WholeE2oFormatting_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_GvmlUseShapeRectangle {} + +export const CT_GvmlUseShapeRectangle_Attributes: Attributes = {}; + +export type ST_GeomGuideName = string; + +export type ST_GeomGuideFormula = string; + +export interface CT_GeomGuide { + name?: string; + fmla?: string; +} + +export const CT_GeomGuide_Attributes: Attributes = { + name: { + type: 'string' + }, + fmla: { + type: 'string' + } +}; + +export interface CT_GeomGuideList { + gd?: CT_GeomGuide[]; +} + +export const CT_GeomGuideList_Attributes: Attributes = { + gd: { + type: 'child', + childAttributes: CT_GeomGuide_Attributes, + childIsArray: true + } +}; + +export type ST_TextShapeType = + | 'textNoShape' + | 'textPlain' + | 'textStop' + | 'textTriangle' + | 'textTriangleInverted' + | 'textChevron' + | 'textChevronInverted' + | 'textRingInside' + | 'textRingOutside' + | 'textArchUp' + | 'textArchDown' + | 'textCircle' + | 'textButton' + | 'textArchUpPour' + | 'textArchDownPour' + | 'textCirclePour' + | 'textButtonPour' + | 'textCurveUp' + | 'textCurveDown' + | 'textCanUp' + | 'textCanDown' + | 'textWave1' + | 'textWave2' + | 'textDoubleWave1' + | 'textWave4' + | 'textInflate' + | 'textDeflate' + | 'textInflateBottom' + | 'textDeflateBottom' + | 'textInflateTop' + | 'textDeflateTop' + | 'textDeflateInflate' + | 'textDeflateInflateDeflate' + | 'textFadeRight' + | 'textFadeLeft' + | 'textFadeUp' + | 'textFadeDown' + | 'textSlantUp' + | 'textSlantDown' + | 'textCascadeUp' + | 'textCascadeDown'; + +export interface CT_PresetTextShape { + avLst?: CT_GeomGuideList; + prst?: ST_TextShapeType; +} + +export const CT_PresetTextShape_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_TextNoAutofit {} + +export const CT_TextNoAutofit_Attributes: Attributes = {}; + +export type ST_TextFontScalePercentOrPercentString = string; + +export type ST_TextSpacingPercentOrPercentString = string; + +export interface CT_TextNormalAutofit { + fontScale?: string; + lnSpcReduction?: string; +} + +export const CT_TextNormalAutofit_Attributes: Attributes = { + fontScale: { + type: 'string', + defaultValue: '100%' + }, + lnSpcReduction: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_TextShapeAutofit {} + +export const CT_TextShapeAutofit_Attributes: Attributes = {}; + +export interface CT_FlatText { + z?: ST_Coordinate; +} + +export const CT_FlatText_Attributes: Attributes = { + z: { + type: 'string', + defaultValue: '0' + } +}; + +export type ST_TextVertOverflowType = 'overflow' | 'ellipsis' | 'clip'; + +export type ST_TextHorzOverflowType = 'overflow' | 'clip'; + +export type ST_TextVerticalType = + | 'horz' + | 'vert' + | 'vert270' + | 'wordArtVert' + | 'eaVert' + | 'mongolianVert' + | 'wordArtVertRtl'; + +export type ST_TextWrappingType = 'none' | 'square'; + +export type ST_TextColumnCount = number; + +export type ST_TextAnchoringType = 't' | 'ctr' | 'b' | 'just' | 'dist'; + +export interface CT_TextBodyProperties { + prstTxWarp?: CT_PresetTextShape; + noAutofit?: CT_TextNoAutofit[]; + normAutofit?: CT_TextNormalAutofit[]; + spAutoFit?: CT_TextShapeAutofit[]; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; + flatTx?: CT_FlatText; + extLst?: CT_OfficeArtExtensionList; + rot?: number; + spcFirstLastPara?: boolean; + vertOverflow?: ST_TextVertOverflowType; + horzOverflow?: ST_TextHorzOverflowType; + vert?: ST_TextVerticalType; + wrap?: ST_TextWrappingType; + lIns?: ST_Coordinate32; + tIns?: ST_Coordinate32; + rIns?: ST_Coordinate32; + bIns?: ST_Coordinate32; + numCol?: number; + spcCol?: number; + rtlCol?: boolean; + fromWordArt?: boolean; + anchor?: ST_TextAnchoringType; + anchorCtr?: boolean; + forceAA?: boolean; + upright?: boolean; + compatLnSpc?: boolean; +} + +export const CT_TextBodyProperties_Attributes: Attributes = { + prstTxWarp: { + type: 'child', + childAttributes: CT_PresetTextShape_Attributes + }, + noAutofit: { + type: 'child', + childAttributes: CT_TextNoAutofit_Attributes, + childIsArray: true + }, + normAutofit: { + type: 'child', + childAttributes: CT_TextNormalAutofit_Attributes, + childIsArray: true + }, + spAutoFit: { + type: 'child', + childAttributes: CT_TextShapeAutofit_Attributes, + childIsArray: true + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + }, + flatTx: { + type: 'child', + childAttributes: CT_FlatText_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rot: { + type: 'int' + }, + spcFirstLastPara: { + type: 'boolean' + }, + vertOverflow: { + type: 'string' + }, + horzOverflow: { + type: 'string' + }, + vert: { + type: 'string' + }, + wrap: { + type: 'string' + }, + lIns: { + type: 'string' + }, + tIns: { + type: 'string' + }, + rIns: { + type: 'string' + }, + bIns: { + type: 'string' + }, + numCol: { + type: 'int' + }, + spcCol: { + type: 'int' + }, + rtlCol: { + type: 'boolean' + }, + fromWordArt: { + type: 'boolean' + }, + anchor: { + type: 'string' + }, + anchorCtr: { + type: 'boolean' + }, + forceAA: { + type: 'boolean' + }, + upright: { + type: 'boolean', + defaultValue: 'false' + }, + compatLnSpc: { + type: 'boolean' + } +}; + +export interface CT_TextSpacingPercent { + val?: string; +} + +export const CT_TextSpacingPercent_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextSpacingPoint = number; + +export interface CT_TextSpacingPoint { + val?: number; +} + +export const CT_TextSpacingPoint_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_TextSpacing { + spcPct?: CT_TextSpacingPercent[]; + spcPts?: CT_TextSpacingPoint[]; +} + +export const CT_TextSpacing_Attributes: Attributes = { + spcPct: { + type: 'child', + childAttributes: CT_TextSpacingPercent_Attributes, + childIsArray: true + }, + spcPts: { + type: 'child', + childAttributes: CT_TextSpacingPoint_Attributes, + childIsArray: true + } +}; + +export interface CT_TextBulletColorFollowText {} + +export const CT_TextBulletColorFollowText_Attributes: Attributes = {}; + +export interface CT_TextBulletSizeFollowText {} + +export const CT_TextBulletSizeFollowText_Attributes: Attributes = {}; + +export type ST_TextBulletSizePercent = string; + +export interface CT_TextBulletSizePercent { + val?: string; +} + +export const CT_TextBulletSizePercent_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextFontSize = number; + +export interface CT_TextBulletSizePoint { + val?: number; +} + +export const CT_TextBulletSizePoint_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_TextBulletTypefaceFollowText {} + +export const CT_TextBulletTypefaceFollowText_Attributes: Attributes = {}; + +export interface CT_TextNoBullet {} + +export const CT_TextNoBullet_Attributes: Attributes = {}; + +export type ST_TextAutonumberScheme = + | 'alphaLcParenBoth' + | 'alphaUcParenBoth' + | 'alphaLcParenR' + | 'alphaUcParenR' + | 'alphaLcPeriod' + | 'alphaUcPeriod' + | 'arabicParenBoth' + | 'arabicParenR' + | 'arabicPeriod' + | 'arabicPlain' + | 'romanLcParenBoth' + | 'romanUcParenBoth' + | 'romanLcParenR' + | 'romanUcParenR' + | 'romanLcPeriod' + | 'romanUcPeriod' + | 'circleNumDbPlain' + | 'circleNumWdBlackPlain' + | 'circleNumWdWhitePlain' + | 'arabicDbPeriod' + | 'arabicDbPlain' + | 'ea1ChsPeriod' + | 'ea1ChsPlain' + | 'ea1ChtPeriod' + | 'ea1ChtPlain' + | 'ea1JpnChsDbPeriod' + | 'ea1JpnKorPlain' + | 'ea1JpnKorPeriod' + | 'arabic1Minus' + | 'arabic2Minus' + | 'hebrew2Minus' + | 'thaiAlphaPeriod' + | 'thaiAlphaParenR' + | 'thaiAlphaParenBoth' + | 'thaiNumPeriod' + | 'thaiNumParenR' + | 'thaiNumParenBoth' + | 'hindiAlphaPeriod' + | 'hindiNumPeriod' + | 'hindiNumParenR' + | 'hindiAlpha1Period'; + +export type ST_TextBulletStartAtNum = number; + +export interface CT_TextAutonumberBullet { + type?: ST_TextAutonumberScheme; + startAt?: number; +} + +export const CT_TextAutonumberBullet_Attributes: Attributes = { + type: { + type: 'string' + }, + startAt: { + type: 'int', + defaultValue: '1' + } +}; + +export interface CT_TextCharBullet { + char?: string; +} + +export const CT_TextCharBullet_Attributes: Attributes = { + char: { + type: 'string' + } +}; + +export interface CT_TextBlipBullet { + blip?: CT_Blip; +} + +export const CT_TextBlipBullet_Attributes: Attributes = { + blip: { + type: 'child', + childAttributes: CT_Blip_Attributes + } +}; + +export type ST_TextTabAlignType = 'l' | 'ctr' | 'r' | 'dec'; + +export interface CT_TextTabStop { + pos?: ST_Coordinate32; + algn?: ST_TextTabAlignType; +} + +export const CT_TextTabStop_Attributes: Attributes = { + pos: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_TextTabStopList { + tab?: CT_TextTabStop[]; +} + +export const CT_TextTabStopList_Attributes: Attributes = { + tab: { + type: 'child', + childAttributes: CT_TextTabStop_Attributes, + childIsArray: true + } +}; + +export interface CT_TextUnderlineLineFollowText {} + +export const CT_TextUnderlineLineFollowText_Attributes: Attributes = {}; + +export interface CT_TextUnderlineFillFollowText {} + +export const CT_TextUnderlineFillFollowText_Attributes: Attributes = {}; + +export interface CT_TextUnderlineFillGroupWrapper {} + +export const CT_TextUnderlineFillGroupWrapper_Attributes: Attributes = {}; + +export interface CT_Boolean { + val?: boolean; +} + +export const CT_Boolean_Attributes: Attributes = { + val: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_TextUnderlineType = + | 'none' + | 'words' + | 'sng' + | 'dbl' + | 'heavy' + | 'dotted' + | 'dottedHeavy' + | 'dash' + | 'dashHeavy' + | 'dashLong' + | 'dashLongHeavy' + | 'dotDash' + | 'dotDashHeavy' + | 'dotDotDash' + | 'dotDotDashHeavy' + | 'wavy' + | 'wavyHeavy' + | 'wavyDbl'; + +export type ST_TextStrikeType = 'noStrike' | 'sngStrike' | 'dblStrike'; + +export type ST_TextNonNegativePoint = number; + +export type ST_TextCapsType = 'none' | 'small' | 'all'; + +export type ST_TextPoint = ST_TextPointUnqualified | ST_UniversalMeasure; + +export interface CT_TextCharacterProperties { + ln?: CT_LineProperties; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + highlight?: CT_Color; + uLnTx?: CT_TextUnderlineLineFollowText[]; + uLn?: CT_LineProperties; + uFillTx?: CT_TextUnderlineFillFollowText[]; + uFill?: CT_TextUnderlineFillGroupWrapper[]; + latin?: CT_TextFont; + ea?: CT_TextFont; + cs?: CT_TextFont; + sym?: CT_TextFont; + hlinkClick?: CT_Hyperlink; + hlinkMouseOver?: CT_Hyperlink; + rtl?: CT_Boolean[]; + extLst?: CT_OfficeArtExtensionList; + kumimoji?: boolean; + lang?: string; + altLang?: string; + sz?: number; + b?: boolean; + i?: boolean; + u?: ST_TextUnderlineType; + strike?: ST_TextStrikeType; + kern?: number; + cap?: ST_TextCapsType; + spc?: ST_TextPoint; + normalizeH?: boolean; + baseline?: string; + noProof?: boolean; + dirty?: boolean; + err?: boolean; + smtClean?: boolean; + smtId?: number; + bmk?: string; +} + +export const CT_TextCharacterProperties_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + highlight: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + uLnTx: { + type: 'child', + childAttributes: CT_TextUnderlineLineFollowText_Attributes, + childIsArray: true + }, + uLn: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + uFillTx: { + type: 'child', + childAttributes: CT_TextUnderlineFillFollowText_Attributes, + childIsArray: true + }, + uFill: { + type: 'child', + childAttributes: CT_TextUnderlineFillGroupWrapper_Attributes, + childIsArray: true + }, + latin: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + ea: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + cs: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + sym: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + hlinkClick: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + hlinkMouseOver: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + rtl: { + type: 'child', + childAttributes: CT_Boolean_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + kumimoji: { + type: 'boolean' + }, + lang: { + type: 'string' + }, + altLang: { + type: 'string' + }, + sz: { + type: 'int' + }, + b: { + type: 'boolean' + }, + i: { + type: 'boolean' + }, + u: { + type: 'string' + }, + strike: { + type: 'string' + }, + kern: { + type: 'int' + }, + cap: { + type: 'string', + defaultValue: 'none' + }, + spc: { + type: 'string' + }, + normalizeH: { + type: 'boolean' + }, + baseline: { + type: 'string' + }, + noProof: { + type: 'boolean' + }, + dirty: { + type: 'boolean', + defaultValue: 'true' + }, + err: { + type: 'boolean', + defaultValue: 'false' + }, + smtClean: { + type: 'boolean', + defaultValue: 'true' + }, + smtId: { + type: 'int', + defaultValue: '0' + }, + bmk: { + type: 'string' + } +}; + +export type ST_TextMargin = ST_Coordinate32Unqualified; + +export type ST_TextIndentLevelType = number; + +export type ST_TextIndent = ST_Coordinate32Unqualified; + +export type ST_TextAlignType = + | 'l' + | 'ctr' + | 'r' + | 'just' + | 'justLow' + | 'dist' + | 'thaiDist'; + +export type ST_TextFontAlignType = 'auto' | 't' | 'ctr' | 'base' | 'b'; + +export interface CT_TextParagraphProperties { + lnSpc?: CT_TextSpacing; + spcBef?: CT_TextSpacing; + spcAft?: CT_TextSpacing; + buClrTx?: CT_TextBulletColorFollowText; + buClr?: CT_Color; + buSzTx?: CT_TextBulletSizeFollowText[]; + buSzPct?: CT_TextBulletSizePercent[]; + buSzPts?: CT_TextBulletSizePoint[]; + buFontTx?: CT_TextBulletTypefaceFollowText[]; + buFont?: CT_TextFont[]; + buNone?: CT_TextNoBullet[]; + buAutoNum?: CT_TextAutonumberBullet[]; + buChar?: CT_TextCharBullet[]; + buBlip?: CT_TextBlipBullet[]; + tabLst?: CT_TextTabStopList; + defRPr?: CT_TextCharacterProperties; + extLst?: CT_OfficeArtExtensionList; + marL?: number; + marR?: number; + lvl?: number; + indent?: number; + algn?: ST_TextAlignType; + defTabSz?: ST_Coordinate32; + rtl?: boolean; + eaLnBrk?: boolean; + fontAlgn?: ST_TextFontAlignType; + latinLnBrk?: boolean; + hangingPunct?: boolean; +} + +export const CT_TextParagraphProperties_Attributes: Attributes = { + lnSpc: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + spcBef: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + spcAft: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + buClrTx: { + type: 'child', + childAttributes: CT_TextBulletColorFollowText_Attributes + }, + buClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + buSzTx: { + type: 'child', + childAttributes: CT_TextBulletSizeFollowText_Attributes, + childIsArray: true + }, + buSzPct: { + type: 'child', + childAttributes: CT_TextBulletSizePercent_Attributes, + childIsArray: true + }, + buSzPts: { + type: 'child', + childAttributes: CT_TextBulletSizePoint_Attributes, + childIsArray: true + }, + buFontTx: { + type: 'child', + childAttributes: CT_TextBulletTypefaceFollowText_Attributes, + childIsArray: true + }, + buFont: { + type: 'child', + childAttributes: CT_TextFont_Attributes, + childIsArray: true + }, + buNone: { + type: 'child', + childAttributes: CT_TextNoBullet_Attributes, + childIsArray: true + }, + buAutoNum: { + type: 'child', + childAttributes: CT_TextAutonumberBullet_Attributes, + childIsArray: true + }, + buChar: { + type: 'child', + childAttributes: CT_TextCharBullet_Attributes, + childIsArray: true + }, + buBlip: { + type: 'child', + childAttributes: CT_TextBlipBullet_Attributes, + childIsArray: true + }, + tabLst: { + type: 'child', + childAttributes: CT_TextTabStopList_Attributes + }, + defRPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + marL: { + type: 'int' + }, + marR: { + type: 'int' + }, + lvl: { + type: 'int' + }, + indent: { + type: 'int' + }, + algn: { + type: 'string' + }, + defTabSz: { + type: 'string' + }, + rtl: { + type: 'boolean' + }, + eaLnBrk: { + type: 'boolean' + }, + fontAlgn: { + type: 'string' + }, + latinLnBrk: { + type: 'boolean' + }, + hangingPunct: { + type: 'boolean' + } +}; + +export interface CT_TextListStyle { + defPPr?: CT_TextParagraphProperties; + lvl1pPr?: CT_TextParagraphProperties; + lvl2pPr?: CT_TextParagraphProperties; + lvl3pPr?: CT_TextParagraphProperties; + lvl4pPr?: CT_TextParagraphProperties; + lvl5pPr?: CT_TextParagraphProperties; + lvl6pPr?: CT_TextParagraphProperties; + lvl7pPr?: CT_TextParagraphProperties; + lvl8pPr?: CT_TextParagraphProperties; + lvl9pPr?: CT_TextParagraphProperties; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_TextListStyle_Attributes: Attributes = { + defPPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl1pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl2pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl3pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl4pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl5pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl6pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl7pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl8pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl9pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_RegularTextRun { + rPr?: CT_TextCharacterProperties; + t?: string; +} + +export const CT_RegularTextRun_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + t: { + type: 'child-string' + } +}; + +export interface CT_TextLineBreak { + rPr?: CT_TextCharacterProperties; +} + +export const CT_TextLineBreak_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + } +}; + +export interface CT_TextField { + rPr?: CT_TextCharacterProperties; + pPr?: CT_TextParagraphProperties; + t?: string; + id?: string; + type?: string; +} + +export const CT_TextField_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + t: { + type: 'child-string' + }, + id: { + type: 'string' + }, + type: { + type: 'string' + } +}; + +export interface CT_TextParagraph { + pPr?: CT_TextParagraphProperties; + r?: CT_RegularTextRun[]; + br?: CT_TextLineBreak[]; + fld?: CT_TextField[]; + endParaRPr?: CT_TextCharacterProperties; +} + +export const CT_TextParagraph_Attributes: Attributes = { + pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + r: { + type: 'child', + childAttributes: CT_RegularTextRun_Attributes, + childIsArray: true + }, + br: { + type: 'child', + childAttributes: CT_TextLineBreak_Attributes, + childIsArray: true + }, + fld: { + type: 'child', + childAttributes: CT_TextField_Attributes, + childIsArray: true + }, + endParaRPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + } +}; + +export interface CT_TextBody { + bodyPr?: CT_TextBodyProperties; + lstStyle?: CT_TextListStyle; + p?: CT_TextParagraph[]; +} + +export const CT_TextBody_Attributes: Attributes = { + bodyPr: { + type: 'child', + childAttributes: CT_TextBodyProperties_Attributes + }, + lstStyle: { + type: 'child', + childAttributes: CT_TextListStyle_Attributes + }, + p: { + type: 'child', + childAttributes: CT_TextParagraph_Attributes, + childIsArray: true + } +}; + +export interface CT_GvmlTextShape { + txBody?: CT_TextBody; + useSpRect?: CT_GvmlUseShapeRectangle; + xfrm?: CT_Transform2D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlTextShape_Attributes: Attributes = { + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + useSpRect: { + type: 'child', + childAttributes: CT_GvmlUseShapeRectangle_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvSpPr?: CT_NonVisualDrawingShapeProps; +} + +export const CT_GvmlShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvSpPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingShapeProps_Attributes + } +}; + +export type ST_AdjCoordinate = ST_Coordinate | ST_GeomGuideName; + +export interface CT_AdjPoint2D { + x?: ST_AdjCoordinate; + y?: ST_AdjCoordinate; +} + +export const CT_AdjPoint2D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + } +}; + +export interface CT_XYAdjustHandle { + pos?: CT_AdjPoint2D; + gdRefX?: string; + minX?: ST_AdjCoordinate; + maxX?: ST_AdjCoordinate; + gdRefY?: string; + minY?: ST_AdjCoordinate; + maxY?: ST_AdjCoordinate; +} + +export const CT_XYAdjustHandle_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + gdRefX: { + type: 'string' + }, + minX: { + type: 'string' + }, + maxX: { + type: 'string' + }, + gdRefY: { + type: 'string' + }, + minY: { + type: 'string' + }, + maxY: { + type: 'string' + } +}; + +export type ST_AdjAngle = ST_Angle | ST_GeomGuideName; + +export interface CT_PolarAdjustHandle { + pos?: CT_AdjPoint2D; + gdRefR?: string; + minR?: ST_AdjCoordinate; + maxR?: ST_AdjCoordinate; + gdRefAng?: string; + minAng?: ST_AdjAngle; + maxAng?: ST_AdjAngle; +} + +export const CT_PolarAdjustHandle_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + gdRefR: { + type: 'string' + }, + minR: { + type: 'string' + }, + maxR: { + type: 'string' + }, + gdRefAng: { + type: 'string' + }, + minAng: { + type: 'string' + }, + maxAng: { + type: 'string' + } +}; + +export interface CT_AdjustHandleList { + ahXY?: CT_XYAdjustHandle; + ahPolar?: CT_PolarAdjustHandle; +} + +export const CT_AdjustHandleList_Attributes: Attributes = { + ahXY: { + type: 'child', + childAttributes: CT_XYAdjustHandle_Attributes + }, + ahPolar: { + type: 'child', + childAttributes: CT_PolarAdjustHandle_Attributes + } +}; + +export interface CT_ConnectionSite { + pos?: CT_AdjPoint2D; + ang?: ST_AdjAngle; +} + +export const CT_ConnectionSite_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + ang: { + type: 'string' + } +}; + +export interface CT_ConnectionSiteList { + cxn?: CT_ConnectionSite[]; +} + +export const CT_ConnectionSiteList_Attributes: Attributes = { + cxn: { + type: 'child', + childAttributes: CT_ConnectionSite_Attributes, + childIsArray: true + } +}; + +export interface CT_GeomRect { + l?: ST_AdjCoordinate; + t?: ST_AdjCoordinate; + r?: ST_AdjCoordinate; + b?: ST_AdjCoordinate; +} + +export const CT_GeomRect_Attributes: Attributes = { + l: { + type: 'string' + }, + t: { + type: 'string' + }, + r: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export interface CT_Path2DClose {} + +export const CT_Path2DClose_Attributes: Attributes = {}; + +export interface CT_Path2DMoveTo { + pt?: CT_AdjPoint2D; +} + +export const CT_Path2DMoveTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + } +}; + +export interface CT_Path2DLineTo { + pt?: CT_AdjPoint2D; +} + +export const CT_Path2DLineTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + } +}; + +export interface CT_Path2DArcTo { + wR?: ST_AdjCoordinate; + hR?: ST_AdjCoordinate; + stAng?: ST_AdjAngle; + swAng?: ST_AdjAngle; +} + +export const CT_Path2DArcTo_Attributes: Attributes = { + wR: { + type: 'string' + }, + hR: { + type: 'string' + }, + stAng: { + type: 'string' + }, + swAng: { + type: 'string' + } +}; + +export interface CT_Path2DQuadBezierTo { + pt?: CT_AdjPoint2D[]; +} + +export const CT_Path2DQuadBezierTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes, + childIsArray: true + } +}; + +export interface CT_Path2DCubicBezierTo { + pt?: CT_AdjPoint2D[]; +} + +export const CT_Path2DCubicBezierTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes, + childIsArray: true + } +}; + +export type ST_PathFillMode = + | 'none' + | 'norm' + | 'lighten' + | 'lightenLess' + | 'darken' + | 'darkenLess'; + +export interface CT_Path2D { + close?: CT_Path2DClose; + moveTo?: CT_Path2DMoveTo; + lnTo?: CT_Path2DLineTo; + arcTo?: CT_Path2DArcTo; + quadBezTo?: CT_Path2DQuadBezierTo; + cubicBezTo?: CT_Path2DCubicBezierTo; + w?: number; + h?: number; + fill?: ST_PathFillMode; + stroke?: boolean; + extrusionOk?: boolean; +} + +export const CT_Path2D_Attributes: Attributes = { + close: { + type: 'child', + childAttributes: CT_Path2DClose_Attributes + }, + moveTo: { + type: 'child', + childAttributes: CT_Path2DMoveTo_Attributes + }, + lnTo: { + type: 'child', + childAttributes: CT_Path2DLineTo_Attributes + }, + arcTo: { + type: 'child', + childAttributes: CT_Path2DArcTo_Attributes + }, + quadBezTo: { + type: 'child', + childAttributes: CT_Path2DQuadBezierTo_Attributes + }, + cubicBezTo: { + type: 'child', + childAttributes: CT_Path2DCubicBezierTo_Attributes + }, + w: { + type: 'int', + defaultValue: '0' + }, + h: { + type: 'int', + defaultValue: '0' + }, + fill: { + type: 'string', + defaultValue: 'norm' + }, + stroke: { + type: 'boolean', + defaultValue: 'true' + }, + extrusionOk: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_Path2DList { + path?: CT_Path2D[]; +} + +export const CT_Path2DList_Attributes: Attributes = { + path: { + type: 'child', + childAttributes: CT_Path2D_Attributes, + childIsArray: true + } +}; + +export interface CT_CustomGeometry2D { + avLst?: CT_GeomGuideList; + gdLst?: CT_GeomGuideList; + ahLst?: CT_AdjustHandleList; + cxnLst?: CT_ConnectionSiteList; + rect?: CT_GeomRect; + pathLst?: CT_Path2DList; +} + +export const CT_CustomGeometry2D_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + gdLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + ahLst: { + type: 'child', + childAttributes: CT_AdjustHandleList_Attributes + }, + cxnLst: { + type: 'child', + childAttributes: CT_ConnectionSiteList_Attributes + }, + rect: { + type: 'child', + childAttributes: CT_GeomRect_Attributes + }, + pathLst: { + type: 'child', + childAttributes: CT_Path2DList_Attributes + } +}; + +export type ST_ShapeType = + | 'line' + | 'lineInv' + | 'triangle' + | 'rtTriangle' + | 'rect' + | 'diamond' + | 'parallelogram' + | 'trapezoid' + | 'nonIsoscelesTrapezoid' + | 'pentagon' + | 'hexagon' + | 'heptagon' + | 'octagon' + | 'decagon' + | 'dodecagon' + | 'star4' + | 'star5' + | 'star6' + | 'star7' + | 'star8' + | 'star10' + | 'star12' + | 'star16' + | 'star24' + | 'star32' + | 'roundRect' + | 'round1Rect' + | 'round2SameRect' + | 'round2DiagRect' + | 'snipRoundRect' + | 'snip1Rect' + | 'snip2SameRect' + | 'snip2DiagRect' + | 'plaque' + | 'ellipse' + | 'teardrop' + | 'homePlate' + | 'chevron' + | 'pieWedge' + | 'pie' + | 'blockArc' + | 'donut' + | 'noSmoking' + | 'rightArrow' + | 'leftArrow' + | 'upArrow' + | 'downArrow' + | 'stripedRightArrow' + | 'notchedRightArrow' + | 'bentUpArrow' + | 'leftRightArrow' + | 'upDownArrow' + | 'leftUpArrow' + | 'leftRightUpArrow' + | 'quadArrow' + | 'leftArrowCallout' + | 'rightArrowCallout' + | 'upArrowCallout' + | 'downArrowCallout' + | 'leftRightArrowCallout' + | 'upDownArrowCallout' + | 'quadArrowCallout' + | 'bentArrow' + | 'uturnArrow' + | 'circularArrow' + | 'leftCircularArrow' + | 'leftRightCircularArrow' + | 'curvedRightArrow' + | 'curvedLeftArrow' + | 'curvedUpArrow' + | 'curvedDownArrow' + | 'swooshArrow' + | 'cube' + | 'can' + | 'lightningBolt' + | 'heart' + | 'sun' + | 'moon' + | 'smileyFace' + | 'irregularSeal1' + | 'irregularSeal2' + | 'foldedCorner' + | 'bevel' + | 'frame' + | 'halfFrame' + | 'corner' + | 'diagStripe' + | 'chord' + | 'arc' + | 'leftBracket' + | 'rightBracket' + | 'leftBrace' + | 'rightBrace' + | 'bracketPair' + | 'bracePair' + | 'straightConnector1' + | 'bentConnector2' + | 'bentConnector3' + | 'bentConnector4' + | 'bentConnector5' + | 'curvedConnector2' + | 'curvedConnector3' + | 'curvedConnector4' + | 'curvedConnector5' + | 'callout1' + | 'callout2' + | 'callout3' + | 'accentCallout1' + | 'accentCallout2' + | 'accentCallout3' + | 'borderCallout1' + | 'borderCallout2' + | 'borderCallout3' + | 'accentBorderCallout1' + | 'accentBorderCallout2' + | 'accentBorderCallout3' + | 'wedgeRectCallout' + | 'wedgeRoundRectCallout' + | 'wedgeEllipseCallout' + | 'cloudCallout' + | 'cloud' + | 'ribbon' + | 'ribbon2' + | 'ellipseRibbon' + | 'ellipseRibbon2' + | 'leftRightRibbon' + | 'verticalScroll' + | 'horizontalScroll' + | 'wave' + | 'doubleWave' + | 'plus' + | 'flowChartProcess' + | 'flowChartDecision' + | 'flowChartInputOutput' + | 'flowChartPredefinedProcess' + | 'flowChartInternalStorage' + | 'flowChartDocument' + | 'flowChartMultidocument' + | 'flowChartTerminator' + | 'flowChartPreparation' + | 'flowChartManualInput' + | 'flowChartManualOperation' + | 'flowChartConnector' + | 'flowChartPunchedCard' + | 'flowChartPunchedTape' + | 'flowChartSummingJunction' + | 'flowChartOr' + | 'flowChartCollate' + | 'flowChartSort' + | 'flowChartExtract' + | 'flowChartMerge' + | 'flowChartOfflineStorage' + | 'flowChartOnlineStorage' + | 'flowChartMagneticTape' + | 'flowChartMagneticDisk' + | 'flowChartMagneticDrum' + | 'flowChartDisplay' + | 'flowChartDelay' + | 'flowChartAlternateProcess' + | 'flowChartOffpageConnector' + | 'actionButtonBlank' + | 'actionButtonHome' + | 'actionButtonHelp' + | 'actionButtonInformation' + | 'actionButtonForwardNext' + | 'actionButtonBackPrevious' + | 'actionButtonEnd' + | 'actionButtonBeginning' + | 'actionButtonReturn' + | 'actionButtonDocument' + | 'actionButtonSound' + | 'actionButtonMovie' + | 'gear6' + | 'gear9' + | 'funnel' + | 'mathPlus' + | 'mathMinus' + | 'mathMultiply' + | 'mathDivide' + | 'mathEqual' + | 'mathNotEqual' + | 'cornerTabs' + | 'squareTabs' + | 'plaqueTabs' + | 'chartX' + | 'chartStar' + | 'chartPlus'; + +export interface CT_PresetGeometry2D { + avLst?: CT_GeomGuideList; + prst?: ST_ShapeType; +} + +export const CT_PresetGeometry2D_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_ShapeProperties { + xfrm?: CT_Transform2D; + custGeom?: CT_CustomGeometry2D; + prstGeom?: CT_PresetGeometry2D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + ln?: CT_LineProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; + extLst?: CT_OfficeArtExtensionList; + bwMode?: ST_BlackWhiteMode; +} + +export const CT_ShapeProperties_Attributes: Attributes = { + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + custGeom: { + type: 'child', + childAttributes: CT_CustomGeometry2D_Attributes + }, + prstGeom: { + type: 'child', + childAttributes: CT_PresetGeometry2D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bwMode: { + type: 'string' + } +}; + +export interface CT_StyleMatrixReference { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + idx?: number; +} + +export const CT_StyleMatrixReference_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + idx: { + type: 'int' + } +}; + +export interface CT_FontReference { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + idx?: ST_FontCollectionIndex; +} + +export const CT_FontReference_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + idx: { + type: 'string' + } +}; + +export interface CT_ShapeStyle { + lnRef?: CT_StyleMatrixReference; + fillRef?: CT_StyleMatrixReference; + effectRef?: CT_StyleMatrixReference; + fontRef?: CT_FontReference; +} + +export const CT_ShapeStyle_Attributes: Attributes = { + lnRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + effectRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + fontRef: { + type: 'child', + childAttributes: CT_FontReference_Attributes + } +}; + +export interface CT_GvmlShape { + nvSpPr?: CT_GvmlShapeNonVisual; + spPr?: CT_ShapeProperties; + txSp?: CT_GvmlTextShape; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlShape_Attributes: Attributes = { + nvSpPr: { + type: 'child', + childAttributes: CT_GvmlShapeNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txSp: { + type: 'child', + childAttributes: CT_GvmlTextShape_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlConnectorNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvCxnSpPr?: CT_NonVisualConnectorProperties; +} + +export const CT_GvmlConnectorNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvCxnSpPr: { + type: 'child', + childAttributes: CT_NonVisualConnectorProperties_Attributes + } +}; + +export interface CT_GvmlConnector { + nvCxnSpPr?: CT_GvmlConnectorNonVisual; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlConnector_Attributes: Attributes = { + nvCxnSpPr: { + type: 'child', + childAttributes: CT_GvmlConnectorNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlPictureNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvPicPr?: CT_NonVisualPictureProperties; +} + +export const CT_GvmlPictureNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvPicPr: { + type: 'child', + childAttributes: CT_NonVisualPictureProperties_Attributes + } +}; + +export interface CT_GvmlPicture { + nvPicPr?: CT_GvmlPictureNonVisual; + blipFill?: CT_BlipFillProperties; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlPicture_Attributes: Attributes = { + nvPicPr: { + type: 'child', + childAttributes: CT_GvmlPictureNonVisual_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlGraphicFrameNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGraphicFramePr?: CT_NonVisualGraphicFrameProperties; +} + +export const CT_GvmlGraphicFrameNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGraphicFramePr: { + type: 'child', + childAttributes: CT_NonVisualGraphicFrameProperties_Attributes + } +}; + +export interface CT_GvmlGraphicalObjectFrame { + nvGraphicFramePr?: CT_GvmlGraphicFrameNonVisual; + xfrm?: CT_Transform2D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlGraphicalObjectFrame_Attributes: Attributes = { + nvGraphicFramePr: { + type: 'child', + childAttributes: CT_GvmlGraphicFrameNonVisual_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlGroupShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGrpSpPr?: CT_NonVisualGroupDrawingShapeProps; +} + +export const CT_GvmlGroupShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGrpSpPr: { + type: 'child', + childAttributes: CT_NonVisualGroupDrawingShapeProps_Attributes + } +}; + +export type CT_GvmlGroupShape = any; +export const CT_GvmlGroupShape_Attributes: Attributes = {}; + +export interface CT_GroupShapeProperties { + xfrm?: CT_GroupTransform2D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + extLst?: CT_OfficeArtExtensionList; + bwMode?: ST_BlackWhiteMode; +} + +export const CT_GroupShapeProperties_Attributes: Attributes = { + xfrm: { + type: 'child', + childAttributes: CT_GroupTransform2D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bwMode: { + type: 'string' + } +}; + +export interface CT_AlphaOutsetEffect { + rad?: ST_Coordinate; +} + +export const CT_AlphaOutsetEffect_Attributes: Attributes = { + rad: { + type: 'string', + defaultValue: '0' + } +}; + +export interface CT_RelativeOffsetEffect { + tx?: string; + ty?: string; +} + +export const CT_RelativeOffsetEffect_Attributes: Attributes = { + tx: { + type: 'string', + defaultValue: '0%' + }, + ty: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_TransformEffect { + sx?: string; + sy?: string; + kx?: number; + ky?: number; + tx?: ST_Coordinate; + ty?: ST_Coordinate; +} + +export const CT_TransformEffect_Attributes: Attributes = { + sx: { + type: 'string', + defaultValue: '100%' + }, + sy: { + type: 'string', + defaultValue: '100%' + }, + kx: { + type: 'int', + defaultValue: '0' + }, + ky: { + type: 'int', + defaultValue: '0' + }, + tx: { + type: 'string', + defaultValue: '0' + }, + ty: { + type: 'string', + defaultValue: '0' + } +}; + +export interface CT_FillProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_FillEffect { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillEffect_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_EffectReference { + ref?: string; +} + +export const CT_EffectReference_Attributes: Attributes = { + ref: { + type: 'string' + } +}; + +export interface CT_BlendEffect { + cont?: CT_EffectContainer; + blend?: ST_BlendMode; +} + +export const CT_BlendEffect_Attributes: Attributes = { + cont: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + blend: { + type: 'string' + } +}; + +export interface CT_EffectProperties { + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_EffectProperties_Attributes: Attributes = { + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export type ST_ShapeID = string; + +export interface CT_DefaultShapeDefinition { + spPr?: CT_ShapeProperties; + bodyPr?: CT_TextBodyProperties; + lstStyle?: CT_TextListStyle; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_DefaultShapeDefinition_Attributes: Attributes = { + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + bodyPr: { + type: 'child', + childAttributes: CT_TextBodyProperties_Attributes + }, + lstStyle: { + type: 'child', + childAttributes: CT_TextListStyle_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_ObjectStyleDefaults { + spDef?: CT_DefaultShapeDefinition; + lnDef?: CT_DefaultShapeDefinition; + txDef?: CT_DefaultShapeDefinition; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ObjectStyleDefaults_Attributes: Attributes = { + spDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + lnDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + txDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_EmptyElement {} + +export const CT_EmptyElement_Attributes: Attributes = {}; + +export interface CT_ColorMapping { + extLst?: CT_OfficeArtExtensionList; + bg1?: ST_ColorSchemeIndex; + tx1?: ST_ColorSchemeIndex; + bg2?: ST_ColorSchemeIndex; + tx2?: ST_ColorSchemeIndex; + accent1?: ST_ColorSchemeIndex; + accent2?: ST_ColorSchemeIndex; + accent3?: ST_ColorSchemeIndex; + accent4?: ST_ColorSchemeIndex; + accent5?: ST_ColorSchemeIndex; + accent6?: ST_ColorSchemeIndex; + hlink?: ST_ColorSchemeIndex; + folHlink?: ST_ColorSchemeIndex; +} + +export const CT_ColorMapping_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bg1: { + type: 'string' + }, + tx1: { + type: 'string' + }, + bg2: { + type: 'string' + }, + tx2: { + type: 'string' + }, + accent1: { + type: 'string' + }, + accent2: { + type: 'string' + }, + accent3: { + type: 'string' + }, + accent4: { + type: 'string' + }, + accent5: { + type: 'string' + }, + accent6: { + type: 'string' + }, + hlink: { + type: 'string' + }, + folHlink: { + type: 'string' + } +}; + +export interface CT_ColorMappingOverride { + masterClrMapping?: CT_EmptyElement[]; + overrideClrMapping?: CT_ColorMapping[]; +} + +export const CT_ColorMappingOverride_Attributes: Attributes = { + masterClrMapping: { + type: 'child', + childAttributes: CT_EmptyElement_Attributes, + childIsArray: true + }, + overrideClrMapping: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes, + childIsArray: true + } +}; + +export interface CT_ColorSchemeAndMapping { + clrScheme?: CT_ColorScheme; + clrMap?: CT_ColorMapping; +} + +export const CT_ColorSchemeAndMapping_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + clrMap: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + } +}; + +export interface CT_ColorSchemeList { + extraClrScheme?: CT_ColorSchemeAndMapping[]; +} + +export const CT_ColorSchemeList_Attributes: Attributes = { + extraClrScheme: { + type: 'child', + childAttributes: CT_ColorSchemeAndMapping_Attributes, + childIsArray: true + } +}; + +export interface CT_OfficeStyleSheet { + themeElements?: CT_BaseStyles; + objectDefaults?: CT_ObjectStyleDefaults; + extraClrSchemeLst?: CT_ColorSchemeList; + custClrLst?: CT_CustomColorList; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_OfficeStyleSheet_Attributes: Attributes = { + themeElements: { + type: 'child', + childAttributes: CT_BaseStyles_Attributes + }, + objectDefaults: { + type: 'child', + childAttributes: CT_ObjectStyleDefaults_Attributes + }, + extraClrSchemeLst: { + type: 'child', + childAttributes: CT_ColorSchemeList_Attributes + }, + custClrLst: { + type: 'child', + childAttributes: CT_CustomColorList_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_BaseStylesOverride { + clrScheme?: CT_ColorScheme; + fontScheme?: CT_FontScheme; + fmtScheme?: CT_StyleMatrix; +} + +export const CT_BaseStylesOverride_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + fontScheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + }, + fmtScheme: { + type: 'child', + childAttributes: CT_StyleMatrix_Attributes + } +}; + +export interface CT_ClipboardStyleSheet { + themeElements?: CT_BaseStyles; + clrMap?: CT_ColorMapping; +} + +export const CT_ClipboardStyleSheet_Attributes: Attributes = { + themeElements: { + type: 'child', + childAttributes: CT_BaseStyles_Attributes + }, + clrMap: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + } +}; + +export interface CT_Cell3D { + bevel?: CT_Bevel; + lightRig?: CT_LightRig; + extLst?: CT_OfficeArtExtensionList; + prstMaterial?: ST_PresetMaterialType; +} + +export const CT_Cell3D_Attributes: Attributes = { + bevel: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + lightRig: { + type: 'child', + childAttributes: CT_LightRig_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + prstMaterial: { + type: 'string', + defaultValue: 'plastic' + } +}; + +export interface CT_Headers { + header?: string[]; +} + +export const CT_Headers_Attributes: Attributes = { + header: { + type: 'child-string', + childIsArray: true + } +}; + +export interface CT_TableCellProperties { + lnL?: CT_LineProperties; + lnR?: CT_LineProperties; + lnT?: CT_LineProperties; + lnB?: CT_LineProperties; + lnTlToBr?: CT_LineProperties; + lnBlToTr?: CT_LineProperties; + cell3D?: CT_Cell3D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + headers?: CT_Headers[]; + extLst?: CT_OfficeArtExtensionList; + marL?: ST_Coordinate32; + marR?: ST_Coordinate32; + marT?: ST_Coordinate32; + marB?: ST_Coordinate32; + vert?: ST_TextVerticalType; + anchor?: ST_TextAnchoringType; + anchorCtr?: boolean; + horzOverflow?: ST_TextHorzOverflowType; +} + +export const CT_TableCellProperties_Attributes: Attributes = { + lnL: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnR: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnT: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnB: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnTlToBr: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnBlToTr: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + cell3D: { + type: 'child', + childAttributes: CT_Cell3D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + headers: { + type: 'child', + childAttributes: CT_Headers_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + marL: { + type: 'string', + defaultValue: '91440' + }, + marR: { + type: 'string', + defaultValue: '91440' + }, + marT: { + type: 'string', + defaultValue: '45720' + }, + marB: { + type: 'string', + defaultValue: '45720' + }, + vert: { + type: 'string', + defaultValue: 'horz' + }, + anchor: { + type: 'string', + defaultValue: 't' + }, + anchorCtr: { + type: 'boolean', + defaultValue: 'false' + }, + horzOverflow: { + type: 'string', + defaultValue: 'clip' + } +}; + +export interface CT_TableCol { + extLst?: CT_OfficeArtExtensionList; + w?: ST_Coordinate; +} + +export const CT_TableCol_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + w: { + type: 'string' + } +}; + +export interface CT_TableGrid { + gridCol?: CT_TableCol[]; +} + +export const CT_TableGrid_Attributes: Attributes = { + gridCol: { + type: 'child', + childAttributes: CT_TableCol_Attributes, + childIsArray: true + } +}; + +export interface CT_TableCell { + txBody?: CT_TextBody; + tcPr?: CT_TableCellProperties; + extLst?: CT_OfficeArtExtensionList; + rowSpan?: number; + gridSpan?: number; + hMerge?: boolean; + vMerge?: boolean; + id?: string; +} + +export const CT_TableCell_Attributes: Attributes = { + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + tcPr: { + type: 'child', + childAttributes: CT_TableCellProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rowSpan: { + type: 'int', + defaultValue: '1' + }, + gridSpan: { + type: 'int', + defaultValue: '1' + }, + hMerge: { + type: 'boolean', + defaultValue: 'false' + }, + vMerge: { + type: 'boolean', + defaultValue: 'false' + }, + id: { + type: 'string' + } +}; + +export interface CT_TableRow { + tc?: CT_TableCell[]; + extLst?: CT_OfficeArtExtensionList; + h?: ST_Coordinate; +} + +export const CT_TableRow_Attributes: Attributes = { + tc: { + type: 'child', + childAttributes: CT_TableCell_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + h: { + type: 'string' + } +}; + +export interface CT_TableBackgroundStyle { + fill?: CT_FillProperties; + fillRef?: CT_StyleMatrixReference; + effect?: CT_EffectProperties; + effectRef?: CT_StyleMatrixReference; +} + +export const CT_TableBackgroundStyle_Attributes: Attributes = { + fill: { + type: 'child', + childAttributes: CT_FillProperties_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + effect: { + type: 'child', + childAttributes: CT_EffectProperties_Attributes + }, + effectRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + } +}; + +export type ST_OnOffStyleType = 'on' | 'off' | 'def'; + +export interface CT_TableStyleTextStyle { + font?: CT_FontCollection; + fontRef?: CT_FontReference; + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + extLst?: CT_OfficeArtExtensionList; + b?: ST_OnOffStyleType; + i?: ST_OnOffStyleType; +} + +export const CT_TableStyleTextStyle_Attributes: Attributes = { + font: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + fontRef: { + type: 'child', + childAttributes: CT_FontReference_Attributes + }, + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + b: { + type: 'string', + defaultValue: 'def' + }, + i: { + type: 'string', + defaultValue: 'def' + } +}; + +export interface CT_ThemeableLineStyle { + ln?: CT_LineProperties; + lnRef?: CT_StyleMatrixReference; +} + +export const CT_ThemeableLineStyle_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + } +}; + +export interface CT_TableCellBorderStyle { + left?: CT_ThemeableLineStyle; + right?: CT_ThemeableLineStyle; + top?: CT_ThemeableLineStyle; + bottom?: CT_ThemeableLineStyle; + insideH?: CT_ThemeableLineStyle; + insideV?: CT_ThemeableLineStyle; + tl2br?: CT_ThemeableLineStyle; + tr2bl?: CT_ThemeableLineStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_TableCellBorderStyle_Attributes: Attributes = { + left: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + right: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + top: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + bottom: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + insideH: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + insideV: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + tl2br: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + tr2bl: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_TableStyleCellStyle { + tcBdr?: CT_TableCellBorderStyle; + fill?: CT_FillProperties; + fillRef?: CT_StyleMatrixReference; + cell3D?: CT_Cell3D; +} + +export const CT_TableStyleCellStyle_Attributes: Attributes = { + tcBdr: { + type: 'child', + childAttributes: CT_TableCellBorderStyle_Attributes + }, + fill: { + type: 'child', + childAttributes: CT_FillProperties_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + cell3D: { + type: 'child', + childAttributes: CT_Cell3D_Attributes + } +}; + +export interface CT_TablePartStyle { + tcTxStyle?: CT_TableStyleTextStyle; + tcStyle?: CT_TableStyleCellStyle; +} + +export const CT_TablePartStyle_Attributes: Attributes = { + tcTxStyle: { + type: 'child', + childAttributes: CT_TableStyleTextStyle_Attributes + }, + tcStyle: { + type: 'child', + childAttributes: CT_TableStyleCellStyle_Attributes + } +}; + +export interface CT_TableStyle { + tblBg?: CT_TableBackgroundStyle; + wholeTbl?: CT_TablePartStyle; + band1H?: CT_TablePartStyle; + band2H?: CT_TablePartStyle; + band1V?: CT_TablePartStyle; + band2V?: CT_TablePartStyle; + lastCol?: CT_TablePartStyle; + firstCol?: CT_TablePartStyle; + lastRow?: CT_TablePartStyle; + seCell?: CT_TablePartStyle; + swCell?: CT_TablePartStyle; + firstRow?: CT_TablePartStyle; + neCell?: CT_TablePartStyle; + nwCell?: CT_TablePartStyle; + extLst?: CT_OfficeArtExtensionList; + styleId?: string; + styleName?: string; +} + +export const CT_TableStyle_Attributes: Attributes = { + tblBg: { + type: 'child', + childAttributes: CT_TableBackgroundStyle_Attributes + }, + wholeTbl: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band1H: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band2H: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band1V: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band2V: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + lastCol: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + firstCol: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + lastRow: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + seCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + swCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + firstRow: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + neCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + nwCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + styleId: { + type: 'string' + }, + styleName: { + type: 'string' + } +}; + +export interface CT_TableProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + tableStyle?: CT_TableStyle[]; + tableStyleId?: string[]; + extLst?: CT_OfficeArtExtensionList; + rtl?: boolean; + firstRow?: boolean; + firstCol?: boolean; + lastRow?: boolean; + lastCol?: boolean; + bandRow?: boolean; + bandCol?: boolean; +} + +export const CT_TableProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + tableStyle: { + type: 'child', + childAttributes: CT_TableStyle_Attributes, + childIsArray: true + }, + tableStyleId: { + type: 'string', + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rtl: { + type: 'boolean', + defaultValue: 'false' + }, + firstRow: { + type: 'boolean', + defaultValue: 'false' + }, + firstCol: { + type: 'boolean', + defaultValue: 'false' + }, + lastRow: { + type: 'boolean', + defaultValue: 'false' + }, + lastCol: { + type: 'boolean', + defaultValue: 'false' + }, + bandRow: { + type: 'boolean', + defaultValue: 'false' + }, + bandCol: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Table { + tblPr?: CT_TableProperties; + tblGrid?: CT_TableGrid; + tr?: CT_TableRow[]; +} + +export const CT_Table_Attributes: Attributes = { + tblPr: { + type: 'child', + childAttributes: CT_TableProperties_Attributes + }, + tblGrid: { + type: 'child', + childAttributes: CT_TableGrid_Attributes + }, + tr: { + type: 'child', + childAttributes: CT_TableRow_Attributes, + childIsArray: true + } +}; + +export interface CT_TableStyleList { + tblStyle?: CT_TableStyle[]; + def?: string; +} + +export const CT_TableStyleList_Attributes: Attributes = { + tblStyle: { + type: 'child', + childAttributes: CT_TableStyle_Attributes, + childIsArray: true + }, + def: { + type: 'string' + } +}; + +export type ST_TextBulletSize = string; + +export type ST_TextPointUnqualified = number; + +export type ST_MarkerCoordinate = number; + +export interface CT_ShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvSpPr?: CT_NonVisualDrawingShapeProps; +} + +export const CT_ShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvSpPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingShapeProps_Attributes + } +}; + +export interface CT_ConnectorNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvCxnSpPr?: CT_NonVisualConnectorProperties; +} + +export const CT_ConnectorNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvCxnSpPr: { + type: 'child', + childAttributes: CT_NonVisualConnectorProperties_Attributes + } +}; + +export interface CT_Connector { + nvCxnSpPr?: CT_ConnectorNonVisual; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + macro?: string; + fPublished?: boolean; +} + +export const CT_Connector_Attributes: Attributes = { + nvCxnSpPr: { + type: 'child', + childAttributes: CT_ConnectorNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + macro: { + type: 'string' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PictureNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvPicPr?: CT_NonVisualPictureProperties; +} + +export const CT_PictureNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvPicPr: { + type: 'child', + childAttributes: CT_NonVisualPictureProperties_Attributes + } +}; + +export interface CT_Picture { + nvPicPr?: CT_PictureNonVisual; + blipFill?: CT_BlipFillProperties; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + macro?: string; + fPublished?: boolean; +} + +export const CT_Picture_Attributes: Attributes = { + nvPicPr: { + type: 'child', + childAttributes: CT_PictureNonVisual_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + macro: { + type: 'string' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GraphicFrameNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGraphicFramePr?: CT_NonVisualGraphicFrameProperties; +} + +export const CT_GraphicFrameNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGraphicFramePr: { + type: 'child', + childAttributes: CT_NonVisualGraphicFrameProperties_Attributes + } +}; + +export interface CT_GraphicFrame { + nvGraphicFramePr?: CT_GraphicFrameNonVisual; + xfrm?: CT_Transform2D; + macro?: string; + fPublished?: boolean; +} + +export const CT_GraphicFrame_Attributes: Attributes = { + nvGraphicFramePr: { + type: 'child', + childAttributes: CT_GraphicFrameNonVisual_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + macro: { + type: 'string' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGrpSpPr?: CT_NonVisualGroupDrawingShapeProps; +} + +export const CT_GroupShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGrpSpPr: { + type: 'child', + childAttributes: CT_NonVisualGroupDrawingShapeProps_Attributes + } +}; + +export type CT_GroupShape = any; +export const CT_GroupShape_Attributes: Attributes = {}; + +export type ST_Shape = + | 'cone' + | 'coneToMax' + | 'box' + | 'cylinder' + | 'pyramid' + | 'pyramidToMax'; + +export interface CT_Shape { + val?: ST_Shape; +} + +export const CT_Shape_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'box' + } +}; + +export type ST_MarkerStyle = + | 'circle' + | 'dash' + | 'diamond' + | 'dot' + | 'none' + | 'picture' + | 'plus' + | 'square' + | 'star' + | 'triangle' + | 'x' + | 'auto'; + +export interface CT_MarkerStyle { + val?: ST_MarkerStyle; +} + +export const CT_MarkerStyle_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_MarkerSize = number; + +export interface CT_MarkerSize { + val?: number; +} + +export const CT_MarkerSize_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '5' + } +}; + +export interface CT_Marker { + symbol?: CT_MarkerStyle; + size?: CT_MarkerSize; + spPr?: CT_ShapeProperties; + extLst?: CT_ExtensionList; +} + +export const CT_Marker_Attributes: Attributes = { + symbol: { + type: 'child', + childAttributes: CT_MarkerStyle_Attributes + }, + size: { + type: 'child', + childAttributes: CT_MarkerSize_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_RelSizeAnchor { + from?: CT_Marker[]; + to?: CT_Marker[]; + sp?: CT_Shape[]; + grpSp?: CT_GroupShape[]; + graphicFrame?: CT_GraphicFrame[]; + cxnSp?: CT_Connector[]; + pic?: CT_Picture[]; +} + +export const CT_RelSizeAnchor_Attributes: Attributes = { + from: { + type: 'child', + childAttributes: CT_Marker_Attributes, + childIsArray: true + }, + to: { + type: 'child', + childAttributes: CT_Marker_Attributes, + childIsArray: true + }, + sp: { + type: 'child', + childAttributes: CT_Shape_Attributes, + childIsArray: true + }, + grpSp: { + type: 'child', + childAttributes: CT_GroupShape_Attributes, + childIsArray: true + }, + graphicFrame: { + type: 'child', + childAttributes: CT_GraphicFrame_Attributes, + childIsArray: true + }, + cxnSp: { + type: 'child', + childAttributes: CT_Connector_Attributes, + childIsArray: true + }, + pic: { + type: 'child', + childAttributes: CT_Picture_Attributes, + childIsArray: true + } +}; + +export interface CT_AbsSizeAnchor { + from?: CT_Marker[]; + ext?: CT_PositiveSize2D[]; + sp?: CT_Shape[]; + grpSp?: CT_GroupShape[]; + graphicFrame?: CT_GraphicFrame[]; + cxnSp?: CT_Connector[]; + pic?: CT_Picture[]; +} + +export const CT_AbsSizeAnchor_Attributes: Attributes = { + from: { + type: 'child', + childAttributes: CT_Marker_Attributes, + childIsArray: true + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes, + childIsArray: true + }, + sp: { + type: 'child', + childAttributes: CT_Shape_Attributes, + childIsArray: true + }, + grpSp: { + type: 'child', + childAttributes: CT_GroupShape_Attributes, + childIsArray: true + }, + graphicFrame: { + type: 'child', + childAttributes: CT_GraphicFrame_Attributes, + childIsArray: true + }, + cxnSp: { + type: 'child', + childAttributes: CT_Connector_Attributes, + childIsArray: true + }, + pic: { + type: 'child', + childAttributes: CT_Picture_Attributes, + childIsArray: true + } +}; + +export interface CT_Drawing { + relSizeAnchor?: CT_RelSizeAnchor[]; + absSizeAnchor?: CT_AbsSizeAnchor[]; +} + +export const CT_Drawing_Attributes: Attributes = { + relSizeAnchor: { + type: 'child', + childAttributes: CT_RelSizeAnchor_Attributes, + childIsArray: true + }, + absSizeAnchor: { + type: 'child', + childAttributes: CT_AbsSizeAnchor_Attributes, + childIsArray: true + } +}; + +export interface CT_Double { + val?: number; +} + +export const CT_Double_Attributes: Attributes = { + val: { + type: 'double' + } +}; + +export interface CT_UnsignedInt { + val?: number; +} + +export const CT_UnsignedInt_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_RelId { + 'r:id'?: string; +} + +export const CT_RelId_Attributes: Attributes = { + 'r:id': { + type: 'string' + } +}; + +export interface CT_NumVal { + v?: string; + idx?: number; + formatCode?: string; +} + +export const CT_NumVal_Attributes: Attributes = { + v: { + type: 'child-string' + }, + idx: { + type: 'int' + }, + formatCode: { + type: 'string' + } +}; + +export interface CT_NumData { + formatCode?: string; + ptCount?: CT_UnsignedInt; + pt?: CT_NumVal[]; + extLst?: CT_ExtensionList; +} + +export const CT_NumData_Attributes: Attributes = { + formatCode: { + type: 'child-string' + }, + ptCount: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + pt: { + type: 'child', + childAttributes: CT_NumVal_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_NumRef { + f?: string; + numCache?: CT_NumData; + extLst?: CT_ExtensionList; +} + +export const CT_NumRef_Attributes: Attributes = { + f: { + type: 'child-string' + }, + numCache: { + type: 'child', + childAttributes: CT_NumData_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_NumDataSource { + numRef?: CT_NumRef; + numLit?: CT_NumData; +} + +export const CT_NumDataSource_Attributes: Attributes = { + numRef: { + type: 'child', + childAttributes: CT_NumRef_Attributes + }, + numLit: { + type: 'child', + childAttributes: CT_NumData_Attributes + } +}; + +export interface CT_StrVal { + v?: string; + idx?: number; +} + +export const CT_StrVal_Attributes: Attributes = { + v: { + type: 'child-string' + }, + idx: { + type: 'int' + } +}; + +export interface CT_StrData { + ptCount?: CT_UnsignedInt; + pt?: CT_StrVal[]; + extLst?: CT_ExtensionList; +} + +export const CT_StrData_Attributes: Attributes = { + ptCount: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + pt: { + type: 'child', + childAttributes: CT_StrVal_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_StrRef { + f?: string; + strCache?: CT_StrData; + extLst?: CT_ExtensionList; +} + +export const CT_StrRef_Attributes: Attributes = { + f: { + type: 'child-string' + }, + strCache: { + type: 'child', + childAttributes: CT_StrData_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Tx { + strRef?: CT_StrRef; + rich?: CT_TextBody; +} + +export const CT_Tx_Attributes: Attributes = { + strRef: { + type: 'child', + childAttributes: CT_StrRef_Attributes + }, + rich: { + type: 'child', + childAttributes: CT_TextBody_Attributes + } +}; + +export interface CT_TextLanguageID { + val?: string; +} + +export const CT_TextLanguageID_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_Lvl { + pt?: CT_StrVal[]; +} + +export const CT_Lvl_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_StrVal_Attributes, + childIsArray: true + } +}; + +export interface CT_MultiLvlStrData { + ptCount?: CT_UnsignedInt; + lvl?: CT_Lvl[]; + extLst?: CT_ExtensionList; +} + +export const CT_MultiLvlStrData_Attributes: Attributes = { + ptCount: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + lvl: { + type: 'child', + childAttributes: CT_Lvl_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_MultiLvlStrRef { + f?: string; + multiLvlStrCache?: CT_MultiLvlStrData; + extLst?: CT_ExtensionList; +} + +export const CT_MultiLvlStrRef_Attributes: Attributes = { + f: { + type: 'child-string' + }, + multiLvlStrCache: { + type: 'child', + childAttributes: CT_MultiLvlStrData_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_AxDataSource { + multiLvlStrRef?: CT_MultiLvlStrRef; + numRef?: CT_NumRef; + numLit?: CT_NumData; + strRef?: CT_StrRef; + strLit?: CT_StrData; +} + +export const CT_AxDataSource_Attributes: Attributes = { + multiLvlStrRef: { + type: 'child', + childAttributes: CT_MultiLvlStrRef_Attributes + }, + numRef: { + type: 'child', + childAttributes: CT_NumRef_Attributes + }, + numLit: { + type: 'child', + childAttributes: CT_NumData_Attributes + }, + strRef: { + type: 'child', + childAttributes: CT_StrRef_Attributes + }, + strLit: { + type: 'child', + childAttributes: CT_StrData_Attributes + } +}; + +export interface CT_SerTx { + strRef?: CT_StrRef; + v?: string; +} + +export const CT_SerTx_Attributes: Attributes = { + strRef: { + type: 'child', + childAttributes: CT_StrRef_Attributes + }, + v: { + type: 'child-string' + } +}; + +export type ST_LayoutTarget = 'inner' | 'outer'; + +export interface CT_LayoutTarget { + val?: ST_LayoutTarget; +} + +export const CT_LayoutTarget_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'outer' + } +}; + +export type ST_LayoutMode = 'edge' | 'factor'; + +export interface CT_LayoutMode { + val?: ST_LayoutMode; +} + +export const CT_LayoutMode_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'factor' + } +}; + +export interface CT_ManualLayout { + layoutTarget?: CT_LayoutTarget; + xMode?: CT_LayoutMode; + yMode?: CT_LayoutMode; + wMode?: CT_LayoutMode; + hMode?: CT_LayoutMode; + x?: CT_Double; + y?: CT_Double; + w?: CT_Double; + h?: CT_Double; + extLst?: CT_ExtensionList; +} + +export const CT_ManualLayout_Attributes: Attributes = { + layoutTarget: { + type: 'child', + childAttributes: CT_LayoutTarget_Attributes + }, + xMode: { + type: 'child', + childAttributes: CT_LayoutMode_Attributes + }, + yMode: { + type: 'child', + childAttributes: CT_LayoutMode_Attributes + }, + wMode: { + type: 'child', + childAttributes: CT_LayoutMode_Attributes + }, + hMode: { + type: 'child', + childAttributes: CT_LayoutMode_Attributes + }, + x: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + y: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + w: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + h: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Layout { + manualLayout?: CT_ManualLayout; + extLst?: CT_ExtensionList; +} + +export const CT_Layout_Attributes: Attributes = { + manualLayout: { + type: 'child', + childAttributes: CT_ManualLayout_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Title { + tx?: CT_Tx; + layout?: CT_Layout; + overlay?: CT_Boolean; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + extLst?: CT_ExtensionList; +} + +export const CT_Title_Attributes: Attributes = { + tx: { + type: 'child', + childAttributes: CT_Tx_Attributes + }, + layout: { + type: 'child', + childAttributes: CT_Layout_Attributes + }, + overlay: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_RotX = number; + +export interface CT_RotX { + val?: number; +} + +export const CT_RotX_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_HPercent = string; + +export type ST_HPercentWithSymbol = string; + +export interface CT_HPercent { + val?: string; +} + +export const CT_HPercent_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '100%' + } +}; + +export type ST_RotY = number; + +export interface CT_RotY { + val?: number; +} + +export const CT_RotY_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_DepthPercent = string; + +export type ST_DepthPercentWithSymbol = string; + +export interface CT_DepthPercent { + val?: string; +} + +export const CT_DepthPercent_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '100%' + } +}; + +export type ST_Perspective = number; + +export interface CT_Perspective { + val?: number; +} + +export const CT_Perspective_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '30' + } +}; + +export interface CT_View3D { + rotX?: CT_RotX; + hPercent?: CT_HPercent; + rotY?: CT_RotY; + depthPercent?: CT_DepthPercent; + rAngAx?: CT_Boolean; + perspective?: CT_Perspective; + extLst?: CT_ExtensionList; +} + +export const CT_View3D_Attributes: Attributes = { + rotX: { + type: 'child', + childAttributes: CT_RotX_Attributes + }, + hPercent: { + type: 'child', + childAttributes: CT_HPercent_Attributes + }, + rotY: { + type: 'child', + childAttributes: CT_RotY_Attributes + }, + depthPercent: { + type: 'child', + childAttributes: CT_DepthPercent_Attributes + }, + rAngAx: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + perspective: { + type: 'child', + childAttributes: CT_Perspective_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_Thickness = string; + +export interface CT_Thickness { + val?: string; +} + +export const CT_Thickness_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_PictureFormat = 'stretch' | 'stack' | 'stackScale'; + +export interface CT_PictureFormat { + val?: ST_PictureFormat; +} + +export const CT_PictureFormat_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_PictureStackUnit = number; + +export interface CT_PictureStackUnit { + val?: number; +} + +export const CT_PictureStackUnit_Attributes: Attributes = { + val: { + type: 'double' + } +}; + +export interface CT_PictureOptions { + applyToFront?: CT_Boolean; + applyToSides?: CT_Boolean; + applyToEnd?: CT_Boolean; + pictureFormat?: CT_PictureFormat; + pictureStackUnit?: CT_PictureStackUnit; +} + +export const CT_PictureOptions_Attributes: Attributes = { + applyToFront: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + applyToSides: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + applyToEnd: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + pictureFormat: { + type: 'child', + childAttributes: CT_PictureFormat_Attributes + }, + pictureStackUnit: { + type: 'child', + childAttributes: CT_PictureStackUnit_Attributes + } +}; + +export interface CT_Surface { + thickness?: CT_Thickness; + spPr?: CT_ShapeProperties; + pictureOptions?: CT_PictureOptions; + extLst?: CT_ExtensionList; +} + +export const CT_Surface_Attributes: Attributes = { + thickness: { + type: 'child', + childAttributes: CT_Thickness_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + pictureOptions: { + type: 'child', + childAttributes: CT_PictureOptions_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_ThicknessPercent = string; + +export interface CT_DTable { + showHorzBorder?: CT_Boolean; + showVertBorder?: CT_Boolean; + showOutline?: CT_Boolean; + showKeys?: CT_Boolean; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + extLst?: CT_ExtensionList; +} + +export const CT_DTable_Attributes: Attributes = { + showHorzBorder: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + showVertBorder: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + showOutline: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + showKeys: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_GapAmount = string; + +export type ST_GapAmountPercent = string; + +export interface CT_GapAmount { + val?: string; +} + +export const CT_GapAmount_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '150%' + } +}; + +export type ST_Overlap = string; + +export type ST_OverlapPercent = string; + +export interface CT_Overlap { + val?: string; +} + +export const CT_Overlap_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '0%' + } +}; + +export type ST_BubbleScale = string; + +export type ST_BubbleScalePercent = string; + +export interface CT_BubbleScale { + val?: string; +} + +export const CT_BubbleScale_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '100%' + } +}; + +export type ST_SizeRepresents = 'area' | 'w'; + +export interface CT_SizeRepresents { + val?: ST_SizeRepresents; +} + +export const CT_SizeRepresents_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'area' + } +}; + +export type ST_FirstSliceAng = number; + +export interface CT_FirstSliceAng { + val?: number; +} + +export const CT_FirstSliceAng_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_HoleSize = string; + +export type ST_HoleSizePercent = string; + +export interface CT_HoleSize { + val?: string; +} + +export const CT_HoleSize_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '10%' + } +}; + +export type ST_SplitType = 'auto' | 'cust' | 'percent' | 'pos' | 'val'; + +export interface CT_SplitType { + val?: ST_SplitType; +} + +export const CT_SplitType_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'auto' + } +}; + +export interface CT_CustSplit { + secondPiePt?: CT_UnsignedInt[]; +} + +export const CT_CustSplit_Attributes: Attributes = { + secondPiePt: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + } +}; + +export type ST_SecondPieSize = string; + +export type ST_SecondPieSizePercent = string; + +export interface CT_SecondPieSize { + val?: string; +} + +export const CT_SecondPieSize_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '75%' + } +}; + +export interface CT_NumFmt { + formatCode?: string; + sourceLinked?: boolean; +} + +export const CT_NumFmt_Attributes: Attributes = { + formatCode: { + type: 'string' + }, + sourceLinked: { + type: 'boolean' + } +}; + +export type ST_LblAlgn = 'ctr' | 'l' | 'r'; + +export interface CT_LblAlgn { + val?: ST_LblAlgn; +} + +export const CT_LblAlgn_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_DLblPos = + | 'bestFit' + | 'b' + | 'ctr' + | 'inBase' + | 'inEnd' + | 'l' + | 'outEnd' + | 'r' + | 't'; + +export interface CT_DLblPos { + val?: ST_DLblPos; +} + +export const CT_DLblPos_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_DLbl { + idx?: CT_UnsignedInt; + delete?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_DLbl_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_DLbls { + dLbl?: CT_DLbl[]; + delete?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_DLbls_Attributes: Attributes = { + dLbl: { + type: 'child', + childAttributes: CT_DLbl_Attributes, + childIsArray: true + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_DPt { + idx?: CT_UnsignedInt; + invertIfNegative?: CT_Boolean; + marker?: CT_Marker; + bubble3D?: CT_Boolean; + explosion?: CT_UnsignedInt; + spPr?: CT_ShapeProperties; + pictureOptions?: CT_PictureOptions; + extLst?: CT_ExtensionList; +} + +export const CT_DPt_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + invertIfNegative: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + marker: { + type: 'child', + childAttributes: CT_Marker_Attributes + }, + bubble3D: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + explosion: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + pictureOptions: { + type: 'child', + childAttributes: CT_PictureOptions_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_TrendlineType = + | 'exp' + | 'linear' + | 'log' + | 'movingAvg' + | 'poly' + | 'power'; + +export interface CT_TrendlineType { + val?: ST_TrendlineType; +} + +export const CT_TrendlineType_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'linear' + } +}; + +export type ST_Order = number; + +export interface CT_Order { + val?: number; +} + +export const CT_Order_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '2' + } +}; + +export type ST_Period = number; + +export interface CT_Period { + val?: number; +} + +export const CT_Period_Attributes: Attributes = { + val: { + type: 'int', + defaultValue: '2' + } +}; + +export interface CT_TrendlineLbl { + layout?: CT_Layout; + tx?: CT_Tx; + numFmt?: CT_NumFmt; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + extLst?: CT_ExtensionList; +} + +export const CT_TrendlineLbl_Attributes: Attributes = { + layout: { + type: 'child', + childAttributes: CT_Layout_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_Tx_Attributes + }, + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Trendline { + name?: string; + spPr?: CT_ShapeProperties; + trendlineType?: CT_TrendlineType; + order?: CT_Order; + period?: CT_Period; + forward?: CT_Double; + backward?: CT_Double; + intercept?: CT_Double; + dispRSqr?: CT_Boolean; + dispEq?: CT_Boolean; + trendlineLbl?: CT_TrendlineLbl; + extLst?: CT_ExtensionList; +} + +export const CT_Trendline_Attributes: Attributes = { + name: { + type: 'child-string' + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + trendlineType: { + type: 'child', + childAttributes: CT_TrendlineType_Attributes + }, + order: { + type: 'child', + childAttributes: CT_Order_Attributes + }, + period: { + type: 'child', + childAttributes: CT_Period_Attributes + }, + forward: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + backward: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + intercept: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + dispRSqr: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + dispEq: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + trendlineLbl: { + type: 'child', + childAttributes: CT_TrendlineLbl_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_ErrDir = 'x' | 'y'; + +export interface CT_ErrDir { + val?: ST_ErrDir; +} + +export const CT_ErrDir_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_ErrBarType = 'both' | 'minus' | 'plus'; + +export interface CT_ErrBarType { + val?: ST_ErrBarType; +} + +export const CT_ErrBarType_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'both' + } +}; + +export type ST_ErrValType = + | 'cust' + | 'fixedVal' + | 'percentage' + | 'stdDev' + | 'stdErr'; + +export interface CT_ErrValType { + val?: ST_ErrValType; +} + +export const CT_ErrValType_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'fixedVal' + } +}; + +export interface CT_ErrBars { + errDir?: CT_ErrDir; + errBarType?: CT_ErrBarType; + errValType?: CT_ErrValType; + noEndCap?: CT_Boolean; + plus?: CT_NumDataSource; + minus?: CT_NumDataSource; + val?: CT_Double; + spPr?: CT_ShapeProperties; + extLst?: CT_ExtensionList; +} + +export const CT_ErrBars_Attributes: Attributes = { + errDir: { + type: 'child', + childAttributes: CT_ErrDir_Attributes + }, + errBarType: { + type: 'child', + childAttributes: CT_ErrBarType_Attributes + }, + errValType: { + type: 'child', + childAttributes: CT_ErrValType_Attributes + }, + noEndCap: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + plus: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + minus: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_UpDownBar { + spPr?: CT_ShapeProperties; +} + +export const CT_UpDownBar_Attributes: Attributes = { + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + } +}; + +export interface CT_UpDownBars { + gapWidth?: CT_GapAmount; + upBars?: CT_UpDownBar; + downBars?: CT_UpDownBar; + extLst?: CT_ExtensionList; +} + +export const CT_UpDownBars_Attributes: Attributes = { + gapWidth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + upBars: { + type: 'child', + childAttributes: CT_UpDownBar_Attributes + }, + downBars: { + type: 'child', + childAttributes: CT_UpDownBar_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_LineSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + marker?: CT_Marker; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + trendline?: CT_Trendline[]; + errBars?: CT_ErrBars; + cat?: CT_AxDataSource; + val?: CT_NumDataSource; + smooth?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_LineSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + marker: { + type: 'child', + childAttributes: CT_Marker_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + trendline: { + type: 'child', + childAttributes: CT_Trendline_Attributes, + childIsArray: true + }, + errBars: { + type: 'child', + childAttributes: CT_ErrBars_Attributes + }, + cat: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + smooth: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_ScatterSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + marker?: CT_Marker; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + trendline?: CT_Trendline[]; + errBars?: CT_ErrBars[]; + xVal?: CT_AxDataSource; + yVal?: CT_NumDataSource; + smooth?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_ScatterSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + marker: { + type: 'child', + childAttributes: CT_Marker_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + trendline: { + type: 'child', + childAttributes: CT_Trendline_Attributes, + childIsArray: true + }, + errBars: { + type: 'child', + childAttributes: CT_ErrBars_Attributes, + childIsArray: true + }, + xVal: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + yVal: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + smooth: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_RadarSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + marker?: CT_Marker; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + cat?: CT_AxDataSource; + val?: CT_NumDataSource; + extLst?: CT_ExtensionList; +} + +export const CT_RadarSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + marker: { + type: 'child', + childAttributes: CT_Marker_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + cat: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_BarSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + invertIfNegative?: CT_Boolean; + pictureOptions?: CT_PictureOptions; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + trendline?: CT_Trendline[]; + errBars?: CT_ErrBars; + cat?: CT_AxDataSource; + val?: CT_NumDataSource; + shape?: CT_Shape; + extLst?: CT_ExtensionList; +} + +export const CT_BarSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + invertIfNegative: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + pictureOptions: { + type: 'child', + childAttributes: CT_PictureOptions_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + trendline: { + type: 'child', + childAttributes: CT_Trendline_Attributes, + childIsArray: true + }, + errBars: { + type: 'child', + childAttributes: CT_ErrBars_Attributes + }, + cat: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + shape: { + type: 'child', + childAttributes: CT_Shape_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_AreaSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + pictureOptions?: CT_PictureOptions; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + trendline?: CT_Trendline[]; + errBars?: CT_ErrBars[]; + cat?: CT_AxDataSource; + val?: CT_NumDataSource; + extLst?: CT_ExtensionList; +} + +export const CT_AreaSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + pictureOptions: { + type: 'child', + childAttributes: CT_PictureOptions_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + trendline: { + type: 'child', + childAttributes: CT_Trendline_Attributes, + childIsArray: true + }, + errBars: { + type: 'child', + childAttributes: CT_ErrBars_Attributes, + childIsArray: true + }, + cat: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_PieSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + explosion?: CT_UnsignedInt; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + cat?: CT_AxDataSource; + val?: CT_NumDataSource; + extLst?: CT_ExtensionList; +} + +export const CT_PieSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + explosion: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + cat: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_BubbleSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + invertIfNegative?: CT_Boolean; + dPt?: CT_DPt[]; + dLbls?: CT_DLbls; + trendline?: CT_Trendline[]; + errBars?: CT_ErrBars[]; + xVal?: CT_AxDataSource; + yVal?: CT_NumDataSource; + bubbleSize?: CT_NumDataSource; + bubble3D?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_BubbleSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + invertIfNegative: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + dPt: { + type: 'child', + childAttributes: CT_DPt_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + trendline: { + type: 'child', + childAttributes: CT_Trendline_Attributes, + childIsArray: true + }, + errBars: { + type: 'child', + childAttributes: CT_ErrBars_Attributes, + childIsArray: true + }, + xVal: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + yVal: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + bubbleSize: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + bubble3D: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_SurfaceSer { + idx?: CT_UnsignedInt; + order?: CT_UnsignedInt; + tx?: CT_SerTx; + spPr?: CT_ShapeProperties; + cat?: CT_AxDataSource; + val?: CT_NumDataSource; + extLst?: CT_ExtensionList; +} + +export const CT_SurfaceSer_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + order: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_SerTx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + cat: { + type: 'child', + childAttributes: CT_AxDataSource_Attributes + }, + val: { + type: 'child', + childAttributes: CT_NumDataSource_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_Grouping = 'percentStacked' | 'standard' | 'stacked'; + +export interface CT_Grouping { + val?: ST_Grouping; +} + +export const CT_Grouping_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'standard' + } +}; + +export interface CT_ChartLines { + spPr?: CT_ShapeProperties; +} + +export const CT_ChartLines_Attributes: Attributes = { + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + } +}; + +export interface CT_LineChart { + grouping?: CT_Grouping; + varyColors?: CT_Boolean; + ser?: CT_LineSer[]; + dLbls?: CT_DLbls; + dropLines?: CT_ChartLines; + hiLowLines?: CT_ChartLines; + upDownBars?: CT_UpDownBars; + marker?: CT_Boolean; + smooth?: CT_Boolean; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_LineChart_Attributes: Attributes = { + grouping: { + type: 'child', + childAttributes: CT_Grouping_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_LineSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + dropLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + hiLowLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + upDownBars: { + type: 'child', + childAttributes: CT_UpDownBars_Attributes + }, + marker: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + smooth: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Line3DChart { + grouping?: CT_Grouping; + varyColors?: CT_Boolean; + ser?: CT_LineSer[]; + dLbls?: CT_DLbls; + dropLines?: CT_ChartLines; + gapDepth?: CT_GapAmount; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_Line3DChart_Attributes: Attributes = { + grouping: { + type: 'child', + childAttributes: CT_Grouping_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_LineSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + dropLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + gapDepth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_StockChart { + ser?: CT_LineSer[]; + dLbls?: CT_DLbls; + dropLines?: CT_ChartLines; + hiLowLines?: CT_ChartLines; + upDownBars?: CT_UpDownBars; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_StockChart_Attributes: Attributes = { + ser: { + type: 'child', + childAttributes: CT_LineSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + dropLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + hiLowLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + upDownBars: { + type: 'child', + childAttributes: CT_UpDownBars_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_ScatterStyle = + | 'none' + | 'line' + | 'lineMarker' + | 'marker' + | 'smooth' + | 'smoothMarker'; + +export interface CT_ScatterStyle { + val?: ST_ScatterStyle; +} + +export const CT_ScatterStyle_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'marker' + } +}; + +export interface CT_ScatterChart { + scatterStyle?: CT_ScatterStyle; + varyColors?: CT_Boolean; + ser?: CT_ScatterSer[]; + dLbls?: CT_DLbls; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_ScatterChart_Attributes: Attributes = { + scatterStyle: { + type: 'child', + childAttributes: CT_ScatterStyle_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_ScatterSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_RadarStyle = 'standard' | 'marker' | 'filled'; + +export interface CT_RadarStyle { + val?: ST_RadarStyle; +} + +export const CT_RadarStyle_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'standard' + } +}; + +export interface CT_RadarChart { + radarStyle?: CT_RadarStyle; + varyColors?: CT_Boolean; + ser?: CT_RadarSer[]; + dLbls?: CT_DLbls; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_RadarChart_Attributes: Attributes = { + radarStyle: { + type: 'child', + childAttributes: CT_RadarStyle_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_RadarSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_BarGrouping = + | 'percentStacked' + | 'clustered' + | 'standard' + | 'stacked'; + +export interface CT_BarGrouping { + val?: ST_BarGrouping; +} + +export const CT_BarGrouping_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'clustered' + } +}; + +export type ST_BarDir = 'bar' | 'col'; + +export interface CT_BarDir { + val?: ST_BarDir; +} + +export const CT_BarDir_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'col' + } +}; + +export interface CT_BarChart { + barDir?: CT_BarDir; + grouping?: CT_BarGrouping; + varyColors?: CT_Boolean; + ser?: CT_BarSer[]; + dLbls?: CT_DLbls; + gapWidth?: CT_GapAmount; + overlap?: CT_Overlap; + serLines?: CT_ChartLines[]; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_BarChart_Attributes: Attributes = { + barDir: { + type: 'child', + childAttributes: CT_BarDir_Attributes + }, + grouping: { + type: 'child', + childAttributes: CT_BarGrouping_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_BarSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + gapWidth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + overlap: { + type: 'child', + childAttributes: CT_Overlap_Attributes + }, + serLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes, + childIsArray: true + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Bar3DChart { + barDir?: CT_BarDir; + grouping?: CT_BarGrouping; + varyColors?: CT_Boolean; + ser?: CT_BarSer[]; + dLbls?: CT_DLbls; + gapWidth?: CT_GapAmount; + gapDepth?: CT_GapAmount; + shape?: CT_Shape; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_Bar3DChart_Attributes: Attributes = { + barDir: { + type: 'child', + childAttributes: CT_BarDir_Attributes + }, + grouping: { + type: 'child', + childAttributes: CT_BarGrouping_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_BarSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + gapWidth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + gapDepth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + shape: { + type: 'child', + childAttributes: CT_Shape_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_AreaChart { + grouping?: CT_Grouping; + varyColors?: CT_Boolean; + ser?: CT_AreaSer[]; + dLbls?: CT_DLbls; + dropLines?: CT_ChartLines; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_AreaChart_Attributes: Attributes = { + grouping: { + type: 'child', + childAttributes: CT_Grouping_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_AreaSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + dropLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Area3DChart { + grouping?: CT_Grouping; + varyColors?: CT_Boolean; + ser?: CT_AreaSer[]; + dLbls?: CT_DLbls; + dropLines?: CT_ChartLines; + gapDepth?: CT_GapAmount; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_Area3DChart_Attributes: Attributes = { + grouping: { + type: 'child', + childAttributes: CT_Grouping_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_AreaSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + dropLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + gapDepth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_PieChart { + varyColors?: CT_Boolean; + ser?: CT_PieSer[]; + dLbls?: CT_DLbls; + firstSliceAng?: CT_FirstSliceAng; + extLst?: CT_ExtensionList; +} + +export const CT_PieChart_Attributes: Attributes = { + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_PieSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + firstSliceAng: { + type: 'child', + childAttributes: CT_FirstSliceAng_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Pie3DChart { + varyColors?: CT_Boolean; + ser?: CT_PieSer[]; + dLbls?: CT_DLbls; + extLst?: CT_ExtensionList; +} + +export const CT_Pie3DChart_Attributes: Attributes = { + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_PieSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_DoughnutChart { + varyColors?: CT_Boolean; + ser?: CT_PieSer[]; + dLbls?: CT_DLbls; + firstSliceAng?: CT_FirstSliceAng; + holeSize?: CT_HoleSize; + extLst?: CT_ExtensionList; +} + +export const CT_DoughnutChart_Attributes: Attributes = { + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_PieSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + firstSliceAng: { + type: 'child', + childAttributes: CT_FirstSliceAng_Attributes + }, + holeSize: { + type: 'child', + childAttributes: CT_HoleSize_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_OfPieType = 'pie' | 'bar'; + +export interface CT_OfPieType { + val?: ST_OfPieType; +} + +export const CT_OfPieType_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'pie' + } +}; + +export interface CT_OfPieChart { + ofPieType?: CT_OfPieType; + varyColors?: CT_Boolean; + ser?: CT_PieSer[]; + dLbls?: CT_DLbls; + gapWidth?: CT_GapAmount; + splitType?: CT_SplitType; + splitPos?: CT_Double; + custSplit?: CT_CustSplit; + secondPieSize?: CT_SecondPieSize; + serLines?: CT_ChartLines[]; + extLst?: CT_ExtensionList; +} + +export const CT_OfPieChart_Attributes: Attributes = { + ofPieType: { + type: 'child', + childAttributes: CT_OfPieType_Attributes + }, + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_PieSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + gapWidth: { + type: 'child', + childAttributes: CT_GapAmount_Attributes + }, + splitType: { + type: 'child', + childAttributes: CT_SplitType_Attributes + }, + splitPos: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + custSplit: { + type: 'child', + childAttributes: CT_CustSplit_Attributes + }, + secondPieSize: { + type: 'child', + childAttributes: CT_SecondPieSize_Attributes + }, + serLines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_BubbleChart { + varyColors?: CT_Boolean; + ser?: CT_BubbleSer[]; + dLbls?: CT_DLbls; + bubble3D?: CT_Boolean; + bubbleScale?: CT_BubbleScale; + showNegBubbles?: CT_Boolean; + sizeRepresents?: CT_SizeRepresents; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_BubbleChart_Attributes: Attributes = { + varyColors: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_BubbleSer_Attributes, + childIsArray: true + }, + dLbls: { + type: 'child', + childAttributes: CT_DLbls_Attributes + }, + bubble3D: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + bubbleScale: { + type: 'child', + childAttributes: CT_BubbleScale_Attributes + }, + showNegBubbles: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + sizeRepresents: { + type: 'child', + childAttributes: CT_SizeRepresents_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_BandFmt { + idx?: CT_UnsignedInt; + spPr?: CT_ShapeProperties; +} + +export const CT_BandFmt_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + } +}; + +export interface CT_BandFmts { + bandFmt?: CT_BandFmt[]; +} + +export const CT_BandFmts_Attributes: Attributes = { + bandFmt: { + type: 'child', + childAttributes: CT_BandFmt_Attributes, + childIsArray: true + } +}; + +export interface CT_SurfaceChart { + wireframe?: CT_Boolean; + ser?: CT_SurfaceSer[]; + bandFmts?: CT_BandFmts; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_SurfaceChart_Attributes: Attributes = { + wireframe: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_SurfaceSer_Attributes, + childIsArray: true + }, + bandFmts: { + type: 'child', + childAttributes: CT_BandFmts_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Surface3DChart { + wireframe?: CT_Boolean; + ser?: CT_SurfaceSer[]; + bandFmts?: CT_BandFmts; + axId?: CT_UnsignedInt[]; + extLst?: CT_ExtensionList; +} + +export const CT_Surface3DChart_Attributes: Attributes = { + wireframe: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + ser: { + type: 'child', + childAttributes: CT_SurfaceSer_Attributes, + childIsArray: true + }, + bandFmts: { + type: 'child', + childAttributes: CT_BandFmts_Attributes + }, + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_AxPos = 'b' | 'l' | 'r' | 't'; + +export interface CT_AxPos { + val?: ST_AxPos; +} + +export const CT_AxPos_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_Crosses = 'autoZero' | 'max' | 'min'; + +export interface CT_Crosses { + val?: ST_Crosses; +} + +export const CT_Crosses_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_CrossBetween = 'between' | 'midCat'; + +export interface CT_CrossBetween { + val?: ST_CrossBetween; +} + +export const CT_CrossBetween_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TickMark = 'cross' | 'in' | 'none' | 'out'; + +export interface CT_TickMark { + val?: ST_TickMark; +} + +export const CT_TickMark_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'cross' + } +}; + +export type ST_TickLblPos = 'high' | 'low' | 'nextTo' | 'none'; + +export interface CT_TickLblPos { + val?: ST_TickLblPos; +} + +export const CT_TickLblPos_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'nextTo' + } +}; + +export type ST_Skip = number; + +export interface CT_Skip { + val?: number; +} + +export const CT_Skip_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export type ST_TimeUnit = 'days' | 'months' | 'years'; + +export interface CT_TimeUnit { + val?: ST_TimeUnit; +} + +export const CT_TimeUnit_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'days' + } +}; + +export type ST_AxisUnit = number; + +export interface CT_AxisUnit { + val?: number; +} + +export const CT_AxisUnit_Attributes: Attributes = { + val: { + type: 'double' + } +}; + +export type ST_BuiltInUnit = + | 'hundreds' + | 'thousands' + | 'tenThousands' + | 'hundredThousands' + | 'millions' + | 'tenMillions' + | 'hundredMillions' + | 'billions' + | 'trillions'; + +export interface CT_BuiltInUnit { + val?: ST_BuiltInUnit; +} + +export const CT_BuiltInUnit_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'thousands' + } +}; + +export interface CT_DispUnitsLbl { + layout?: CT_Layout; + tx?: CT_Tx; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; +} + +export const CT_DispUnitsLbl_Attributes: Attributes = { + layout: { + type: 'child', + childAttributes: CT_Layout_Attributes + }, + tx: { + type: 'child', + childAttributes: CT_Tx_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + } +}; + +export interface CT_DispUnits { + custUnit?: CT_Double; + builtInUnit?: CT_BuiltInUnit; + dispUnitsLbl?: CT_DispUnitsLbl; + extLst?: CT_ExtensionList; +} + +export const CT_DispUnits_Attributes: Attributes = { + custUnit: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + builtInUnit: { + type: 'child', + childAttributes: CT_BuiltInUnit_Attributes + }, + dispUnitsLbl: { + type: 'child', + childAttributes: CT_DispUnitsLbl_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_Orientation = 'maxMin' | 'minMax'; + +export interface CT_Orientation { + val?: ST_Orientation; +} + +export const CT_Orientation_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'minMax' + } +}; + +export type ST_LogBase = number; + +export interface CT_LogBase { + val?: number; +} + +export const CT_LogBase_Attributes: Attributes = { + val: { + type: 'double' + } +}; + +export interface CT_Scaling { + logBase?: CT_LogBase; + orientation?: CT_Orientation; + max?: CT_Double; + min?: CT_Double; + extLst?: CT_ExtensionList; +} + +export const CT_Scaling_Attributes: Attributes = { + logBase: { + type: 'child', + childAttributes: CT_LogBase_Attributes + }, + orientation: { + type: 'child', + childAttributes: CT_Orientation_Attributes + }, + max: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + min: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_LblOffset = string; + +export type ST_LblOffsetPercent = string; + +export interface CT_LblOffset { + val?: string; +} + +export const CT_LblOffset_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: '100%' + } +}; + +export interface CT_CatAx { + axId?: CT_UnsignedInt; + scaling?: CT_Scaling; + delete?: CT_Boolean; + axPos?: CT_AxPos; + majorGridlines?: CT_ChartLines; + minorGridlines?: CT_ChartLines; + title?: CT_Title; + numFmt?: CT_NumFmt; + majorTickMark?: CT_TickMark; + minorTickMark?: CT_TickMark; + tickLblPos?: CT_TickLblPos; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + crossAx?: CT_UnsignedInt; + crosses?: CT_Crosses; + crossesAt?: CT_Double; + auto?: CT_Boolean; + lblAlgn?: CT_LblAlgn; + lblOffset?: CT_LblOffset; + tickLblSkip?: CT_Skip; + tickMarkSkip?: CT_Skip; + noMultiLvlLbl?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_CatAx_Attributes: Attributes = { + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + scaling: { + type: 'child', + childAttributes: CT_Scaling_Attributes + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + axPos: { + type: 'child', + childAttributes: CT_AxPos_Attributes + }, + majorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + minorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + title: { + type: 'child', + childAttributes: CT_Title_Attributes + }, + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes + }, + majorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + minorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + tickLblPos: { + type: 'child', + childAttributes: CT_TickLblPos_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + crossAx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + crosses: { + type: 'child', + childAttributes: CT_Crosses_Attributes + }, + crossesAt: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + auto: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + lblAlgn: { + type: 'child', + childAttributes: CT_LblAlgn_Attributes + }, + lblOffset: { + type: 'child', + childAttributes: CT_LblOffset_Attributes + }, + tickLblSkip: { + type: 'child', + childAttributes: CT_Skip_Attributes + }, + tickMarkSkip: { + type: 'child', + childAttributes: CT_Skip_Attributes + }, + noMultiLvlLbl: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_DateAx { + axId?: CT_UnsignedInt; + scaling?: CT_Scaling; + delete?: CT_Boolean; + axPos?: CT_AxPos; + majorGridlines?: CT_ChartLines; + minorGridlines?: CT_ChartLines; + title?: CT_Title; + numFmt?: CT_NumFmt; + majorTickMark?: CT_TickMark; + minorTickMark?: CT_TickMark; + tickLblPos?: CT_TickLblPos; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + crossAx?: CT_UnsignedInt; + crosses?: CT_Crosses; + crossesAt?: CT_Double; + auto?: CT_Boolean; + lblOffset?: CT_LblOffset; + baseTimeUnit?: CT_TimeUnit; + majorUnit?: CT_AxisUnit; + majorTimeUnit?: CT_TimeUnit; + minorUnit?: CT_AxisUnit; + minorTimeUnit?: CT_TimeUnit; + extLst?: CT_ExtensionList; +} + +export const CT_DateAx_Attributes: Attributes = { + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + scaling: { + type: 'child', + childAttributes: CT_Scaling_Attributes + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + axPos: { + type: 'child', + childAttributes: CT_AxPos_Attributes + }, + majorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + minorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + title: { + type: 'child', + childAttributes: CT_Title_Attributes + }, + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes + }, + majorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + minorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + tickLblPos: { + type: 'child', + childAttributes: CT_TickLblPos_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + crossAx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + crosses: { + type: 'child', + childAttributes: CT_Crosses_Attributes + }, + crossesAt: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + auto: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + lblOffset: { + type: 'child', + childAttributes: CT_LblOffset_Attributes + }, + baseTimeUnit: { + type: 'child', + childAttributes: CT_TimeUnit_Attributes + }, + majorUnit: { + type: 'child', + childAttributes: CT_AxisUnit_Attributes + }, + majorTimeUnit: { + type: 'child', + childAttributes: CT_TimeUnit_Attributes + }, + minorUnit: { + type: 'child', + childAttributes: CT_AxisUnit_Attributes + }, + minorTimeUnit: { + type: 'child', + childAttributes: CT_TimeUnit_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_SerAx { + axId?: CT_UnsignedInt; + scaling?: CT_Scaling; + delete?: CT_Boolean; + axPos?: CT_AxPos; + majorGridlines?: CT_ChartLines; + minorGridlines?: CT_ChartLines; + title?: CT_Title; + numFmt?: CT_NumFmt; + majorTickMark?: CT_TickMark; + minorTickMark?: CT_TickMark; + tickLblPos?: CT_TickLblPos; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + crossAx?: CT_UnsignedInt; + crosses?: CT_Crosses; + crossesAt?: CT_Double; + tickLblSkip?: CT_Skip; + tickMarkSkip?: CT_Skip; + extLst?: CT_ExtensionList; +} + +export const CT_SerAx_Attributes: Attributes = { + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + scaling: { + type: 'child', + childAttributes: CT_Scaling_Attributes + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + axPos: { + type: 'child', + childAttributes: CT_AxPos_Attributes + }, + majorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + minorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + title: { + type: 'child', + childAttributes: CT_Title_Attributes + }, + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes + }, + majorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + minorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + tickLblPos: { + type: 'child', + childAttributes: CT_TickLblPos_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + crossAx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + crosses: { + type: 'child', + childAttributes: CT_Crosses_Attributes + }, + crossesAt: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + tickLblSkip: { + type: 'child', + childAttributes: CT_Skip_Attributes + }, + tickMarkSkip: { + type: 'child', + childAttributes: CT_Skip_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_ValAx { + axId?: CT_UnsignedInt; + scaling?: CT_Scaling; + delete?: CT_Boolean; + axPos?: CT_AxPos; + majorGridlines?: CT_ChartLines; + minorGridlines?: CT_ChartLines; + title?: CT_Title; + numFmt?: CT_NumFmt; + majorTickMark?: CT_TickMark; + minorTickMark?: CT_TickMark; + tickLblPos?: CT_TickLblPos; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + crossAx?: CT_UnsignedInt; + crosses?: CT_Crosses; + crossesAt?: CT_Double; + crossBetween?: CT_CrossBetween; + majorUnit?: CT_AxisUnit; + minorUnit?: CT_AxisUnit; + dispUnits?: CT_DispUnits; + extLst?: CT_ExtensionList; +} + +export const CT_ValAx_Attributes: Attributes = { + axId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + scaling: { + type: 'child', + childAttributes: CT_Scaling_Attributes + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + axPos: { + type: 'child', + childAttributes: CT_AxPos_Attributes + }, + majorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + minorGridlines: { + type: 'child', + childAttributes: CT_ChartLines_Attributes + }, + title: { + type: 'child', + childAttributes: CT_Title_Attributes + }, + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes + }, + majorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + minorTickMark: { + type: 'child', + childAttributes: CT_TickMark_Attributes + }, + tickLblPos: { + type: 'child', + childAttributes: CT_TickLblPos_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + crossAx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + crosses: { + type: 'child', + childAttributes: CT_Crosses_Attributes + }, + crossesAt: { + type: 'child', + childAttributes: CT_Double_Attributes + }, + crossBetween: { + type: 'child', + childAttributes: CT_CrossBetween_Attributes + }, + majorUnit: { + type: 'child', + childAttributes: CT_AxisUnit_Attributes + }, + minorUnit: { + type: 'child', + childAttributes: CT_AxisUnit_Attributes + }, + dispUnits: { + type: 'child', + childAttributes: CT_DispUnits_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_PlotArea { + layout?: CT_Layout; + areaChart?: CT_AreaChart; + area3DChart?: CT_Area3DChart; + lineChart?: CT_LineChart; + line3DChart?: CT_Line3DChart; + stockChart?: CT_StockChart; + radarChart?: CT_RadarChart; + scatterChart?: CT_ScatterChart; + pieChart?: CT_PieChart; + pie3DChart?: CT_Pie3DChart; + doughnutChart?: CT_DoughnutChart; + barChart?: CT_BarChart; + bar3DChart?: CT_Bar3DChart; + ofPieChart?: CT_OfPieChart; + surfaceChart?: CT_SurfaceChart; + surface3DChart?: CT_Surface3DChart; + bubbleChart?: CT_BubbleChart; + valAx?: CT_ValAx; + catAx?: CT_CatAx; + dateAx?: CT_DateAx; + serAx?: CT_SerAx; + dTable?: CT_DTable; + spPr?: CT_ShapeProperties; + extLst?: CT_ExtensionList; +} + +export const CT_PlotArea_Attributes: Attributes = { + layout: { + type: 'child', + childAttributes: CT_Layout_Attributes + }, + areaChart: { + type: 'child', + childAttributes: CT_AreaChart_Attributes + }, + area3DChart: { + type: 'child', + childAttributes: CT_Area3DChart_Attributes + }, + lineChart: { + type: 'child', + childAttributes: CT_LineChart_Attributes + }, + line3DChart: { + type: 'child', + childAttributes: CT_Line3DChart_Attributes + }, + stockChart: { + type: 'child', + childAttributes: CT_StockChart_Attributes + }, + radarChart: { + type: 'child', + childAttributes: CT_RadarChart_Attributes + }, + scatterChart: { + type: 'child', + childAttributes: CT_ScatterChart_Attributes + }, + pieChart: { + type: 'child', + childAttributes: CT_PieChart_Attributes + }, + pie3DChart: { + type: 'child', + childAttributes: CT_Pie3DChart_Attributes + }, + doughnutChart: { + type: 'child', + childAttributes: CT_DoughnutChart_Attributes + }, + barChart: { + type: 'child', + childAttributes: CT_BarChart_Attributes + }, + bar3DChart: { + type: 'child', + childAttributes: CT_Bar3DChart_Attributes + }, + ofPieChart: { + type: 'child', + childAttributes: CT_OfPieChart_Attributes + }, + surfaceChart: { + type: 'child', + childAttributes: CT_SurfaceChart_Attributes + }, + surface3DChart: { + type: 'child', + childAttributes: CT_Surface3DChart_Attributes + }, + bubbleChart: { + type: 'child', + childAttributes: CT_BubbleChart_Attributes + }, + valAx: { + type: 'child', + childAttributes: CT_ValAx_Attributes + }, + catAx: { + type: 'child', + childAttributes: CT_CatAx_Attributes + }, + dateAx: { + type: 'child', + childAttributes: CT_DateAx_Attributes + }, + serAx: { + type: 'child', + childAttributes: CT_SerAx_Attributes + }, + dTable: { + type: 'child', + childAttributes: CT_DTable_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_PivotFmt { + idx?: CT_UnsignedInt; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + marker?: CT_Marker; + dLbl?: CT_DLbl; + extLst?: CT_ExtensionList; +} + +export const CT_PivotFmt_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + marker: { + type: 'child', + childAttributes: CT_Marker_Attributes + }, + dLbl: { + type: 'child', + childAttributes: CT_DLbl_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_PivotFmts { + pivotFmt?: CT_PivotFmt[]; +} + +export const CT_PivotFmts_Attributes: Attributes = { + pivotFmt: { + type: 'child', + childAttributes: CT_PivotFmt_Attributes, + childIsArray: true + } +}; + +export type ST_LegendPos = 'b' | 'tr' | 'l' | 'r' | 't'; + +export interface CT_LegendPos { + val?: ST_LegendPos; +} + +export const CT_LegendPos_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'r' + } +}; + +export interface CT_LegendEntry { + idx?: CT_UnsignedInt; + delete?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_LegendEntry_Attributes: Attributes = { + idx: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + delete: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_Legend { + legendPos?: CT_LegendPos; + legendEntry?: CT_LegendEntry[]; + layout?: CT_Layout; + overlay?: CT_Boolean; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + extLst?: CT_ExtensionList; +} + +export const CT_Legend_Attributes: Attributes = { + legendPos: { + type: 'child', + childAttributes: CT_LegendPos_Attributes + }, + legendEntry: { + type: 'child', + childAttributes: CT_LegendEntry_Attributes, + childIsArray: true + }, + layout: { + type: 'child', + childAttributes: CT_Layout_Attributes + }, + overlay: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_DispBlanksAs = 'span' | 'gap' | 'zero'; + +export interface CT_DispBlanksAs { + val?: ST_DispBlanksAs; +} + +export const CT_DispBlanksAs_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'zero' + } +}; + +export interface CT_Chart { + title?: CT_Title; + autoTitleDeleted?: CT_Boolean; + pivotFmts?: CT_PivotFmts; + view3D?: CT_View3D; + floor?: CT_Surface; + sideWall?: CT_Surface; + backWall?: CT_Surface; + plotArea?: CT_PlotArea; + legend?: CT_Legend; + plotVisOnly?: CT_Boolean; + dispBlanksAs?: CT_DispBlanksAs; + showDLblsOverMax?: CT_Boolean; + extLst?: CT_ExtensionList; +} + +export const CT_Chart_Attributes: Attributes = { + title: { + type: 'child', + childAttributes: CT_Title_Attributes + }, + autoTitleDeleted: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + pivotFmts: { + type: 'child', + childAttributes: CT_PivotFmts_Attributes + }, + view3D: { + type: 'child', + childAttributes: CT_View3D_Attributes + }, + floor: { + type: 'child', + childAttributes: CT_Surface_Attributes + }, + sideWall: { + type: 'child', + childAttributes: CT_Surface_Attributes + }, + backWall: { + type: 'child', + childAttributes: CT_Surface_Attributes + }, + plotArea: { + type: 'child', + childAttributes: CT_PlotArea_Attributes + }, + legend: { + type: 'child', + childAttributes: CT_Legend_Attributes + }, + plotVisOnly: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + dispBlanksAs: { + type: 'child', + childAttributes: CT_DispBlanksAs_Attributes + }, + showDLblsOverMax: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_Style = number; + +export interface CT_Style { + val?: number; +} + +export const CT_Style_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_PivotSource { + name?: string; + fmtId?: CT_UnsignedInt; + extLst?: CT_ExtensionList[]; +} + +export const CT_PivotSource_Attributes: Attributes = { + name: { + type: 'child-string' + }, + fmtId: { + type: 'child', + childAttributes: CT_UnsignedInt_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_Protection { + chartObject?: CT_Boolean; + data?: CT_Boolean; + formatting?: CT_Boolean; + selection?: CT_Boolean; + userInterface?: CT_Boolean; +} + +export const CT_Protection_Attributes: Attributes = { + chartObject: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + data: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + formatting: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + selection: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + userInterface: { + type: 'child', + childAttributes: CT_Boolean_Attributes + } +}; + +export interface CT_HeaderFooter { + oddHeader?: string; + oddFooter?: string; + evenHeader?: string; + evenFooter?: string; + firstHeader?: string; + firstFooter?: string; + alignWithMargins?: boolean; + differentOddEven?: boolean; + differentFirst?: boolean; +} + +export const CT_HeaderFooter_Attributes: Attributes = { + oddHeader: { + type: 'child-string' + }, + oddFooter: { + type: 'child-string' + }, + evenHeader: { + type: 'child-string' + }, + evenFooter: { + type: 'child-string' + }, + firstHeader: { + type: 'child-string' + }, + firstFooter: { + type: 'child-string' + }, + alignWithMargins: { + type: 'boolean', + defaultValue: 'true' + }, + differentOddEven: { + type: 'boolean', + defaultValue: 'false' + }, + differentFirst: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PageMargins { + l?: number; + r?: number; + t?: number; + b?: number; + header?: number; + footer?: number; +} + +export const CT_PageMargins_Attributes: Attributes = { + l: { + type: 'double' + }, + r: { + type: 'double' + }, + t: { + type: 'double' + }, + b: { + type: 'double' + }, + header: { + type: 'double' + }, + footer: { + type: 'double' + } +}; + +export type ST_PageSetupOrientation = 'default' | 'portrait' | 'landscape'; + +export interface CT_ExternalData { + 'autoUpdate'?: CT_Boolean; + 'r:id'?: string; +} + +export const CT_ExternalData_Attributes: Attributes = { + 'autoUpdate': { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_PageSetup { + paperSize?: number; + paperHeight?: string; + paperWidth?: string; + firstPageNumber?: number; + orientation?: ST_PageSetupOrientation; + blackAndWhite?: boolean; + draft?: boolean; + useFirstPageNumber?: boolean; + horizontalDpi?: number; + verticalDpi?: number; + copies?: number; +} + +export const CT_PageSetup_Attributes: Attributes = { + paperSize: { + type: 'int', + defaultValue: '1' + }, + paperHeight: { + type: 'string' + }, + paperWidth: { + type: 'string' + }, + firstPageNumber: { + type: 'int', + defaultValue: '1' + }, + orientation: { + type: 'string', + defaultValue: 'default' + }, + blackAndWhite: { + type: 'boolean', + defaultValue: 'false' + }, + draft: { + type: 'boolean', + defaultValue: 'false' + }, + useFirstPageNumber: { + type: 'boolean', + defaultValue: 'false' + }, + horizontalDpi: { + type: 'int', + defaultValue: '600' + }, + verticalDpi: { + type: 'int', + defaultValue: '600' + }, + copies: { + type: 'int', + defaultValue: '1' + } +}; + +export interface CT_PrintSettings { + headerFooter?: CT_HeaderFooter; + pageMargins?: CT_PageMargins; + pageSetup?: CT_PageSetup; +} + +export const CT_PrintSettings_Attributes: Attributes = { + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes + }, + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes + }, + pageSetup: { + type: 'child', + childAttributes: CT_PageSetup_Attributes + } +}; + +export interface CT_ChartSpace { + date1904?: CT_Boolean; + lang?: CT_TextLanguageID; + roundedCorners?: CT_Boolean; + style?: CT_Style; + clrMapOvr?: CT_ColorMapping; + pivotSource?: CT_PivotSource; + protection?: CT_Protection; + chart?: CT_Chart; + spPr?: CT_ShapeProperties; + txPr?: CT_TextBody; + externalData?: CT_ExternalData; + printSettings?: CT_PrintSettings; + userShapes?: CT_RelId; + extLst?: CT_ExtensionList; +} + +export const CT_ChartSpace_Attributes: Attributes = { + date1904: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + lang: { + type: 'child', + childAttributes: CT_TextLanguageID_Attributes + }, + roundedCorners: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + style: { + type: 'child', + childAttributes: CT_Style_Attributes + }, + clrMapOvr: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + }, + pivotSource: { + type: 'child', + childAttributes: CT_PivotSource_Attributes + }, + protection: { + type: 'child', + childAttributes: CT_Protection_Attributes + }, + chart: { + type: 'child', + childAttributes: CT_Chart_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txPr: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + externalData: { + type: 'child', + childAttributes: CT_ExternalData_Attributes + }, + printSettings: { + type: 'child', + childAttributes: CT_PrintSettings_Attributes + }, + userShapes: { + type: 'child', + childAttributes: CT_RelId_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; diff --git a/packages/office-viewer/src/openxml/ContentType.ts b/packages/office-viewer/src/openxml/ContentType.ts index 8874e31dc..b11f99444 100644 --- a/packages/office-viewer/src/openxml/ContentType.ts +++ b/packages/office-viewer/src/openxml/ContentType.ts @@ -3,15 +3,21 @@ interface Override { contentType: string; } +interface Default { + extension: string; + contentType: string; +} + export interface ContentTypes { overrides: Override[]; + defaults: Default[]; } /** * 解析 [Content_Types].xml */ export function parseContentType(doc: Document) { - const types: ContentTypes = {overrides: []}; + const types: ContentTypes = {overrides: [], defaults: []}; const overrides = [].slice.call(doc.getElementsByTagName('Override')); for (const item of overrides) { types.overrides.push({ diff --git a/packages/office-viewer/src/openxml/DMLTypes.ts b/packages/office-viewer/src/openxml/DMLTypes.ts new file mode 100644 index 000000000..9d6de2562 --- /dev/null +++ b/packages/office-viewer/src/openxml/DMLTypes.ts @@ -0,0 +1,7272 @@ +import {Attributes} from './Attributes'; + +export type ST_Lang = string; + +export type ST_HexColorRGB = string; + +export type ST_Panose = string; + +export type ST_CalendarType = + | 'gregorian' + | 'gregorianUs' + | 'gregorianMeFrench' + | 'gregorianArabic' + | 'hijri' + | 'hebrew' + | 'taiwan' + | 'japan' + | 'thai' + | 'korea' + | 'saka' + | 'gregorianXlitEnglish' + | 'gregorianXlitFrench' + | 'none'; + +export type ST_Guid = string; + +export type ST_OnOff = boolean; + +export type ST_String = string; + +export type ST_XmlName = string; + +export type ST_UnsignedDecimalNumber = number; + +export type ST_TwipsMeasure = + | ST_UnsignedDecimalNumber + | ST_PositiveUniversalMeasure; + +export type ST_VerticalAlignRun = 'baseline' | 'superscript' | 'subscript'; + +export type ST_Xstring = string; + +export type ST_XAlign = 'left' | 'center' | 'right' | 'inside' | 'outside'; + +export type ST_YAlign = + | 'inline' + | 'top' + | 'center' + | 'bottom' + | 'inside' + | 'outside'; + +export type ST_ConformanceClass = 'strict' | 'transitional'; + +export type ST_UniversalMeasure = string; + +export type ST_PositiveUniversalMeasure = ST_UniversalMeasure; + +export type ST_Percentage = string; + +export type ST_FixedPercentage = string; + +export type ST_PositivePercentage = string; + +export type ST_PositiveFixedPercentage = string; + +export interface CT_OfficeArtExtension { + uri?: string; +} + +export const CT_OfficeArtExtension_Attributes: Attributes = { + uri: { + type: 'string' + } +}; + +export interface CT_OfficeArtExtensionList { + ext?: CT_OfficeArtExtension[]; +} + +export const CT_OfficeArtExtensionList_Attributes: Attributes = { + ext: { + type: 'child', + childAttributes: CT_OfficeArtExtension_Attributes, + childIsArray: true + } +}; + +export interface CT_AudioFile { + extLst?: CT_OfficeArtExtensionList; + contentType?: string; +} + +export const CT_AudioFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + contentType: { + type: 'string' + } +}; + +export interface CT_VideoFile { + extLst?: CT_OfficeArtExtensionList; + contentType?: string; +} + +export const CT_VideoFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + contentType: { + type: 'string' + } +}; + +export interface CT_QuickTimeFile { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_QuickTimeFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_AudioCDTime { + track?: number; + time?: number; +} + +export const CT_AudioCDTime_Attributes: Attributes = { + track: { + type: 'int' + }, + time: { + type: 'int' + } +}; + +export interface CT_AudioCD { + st?: CT_AudioCDTime; + end?: CT_AudioCDTime; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_AudioCD_Attributes: Attributes = { + st: { + type: 'child', + childAttributes: CT_AudioCDTime_Attributes + }, + end: { + type: 'child', + childAttributes: CT_AudioCDTime_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_StyleMatrixColumnIndex = number; + +export type ST_FontCollectionIndex = 'major' | 'minor' | 'none'; + +export type ST_ColorSchemeIndex = + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink'; + +export interface CT_PositiveFixedPercentage { + val?: ST_PositiveFixedPercentage; +} + +export const CT_PositiveFixedPercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_ComplementTransform {} + +export const CT_ComplementTransform_Attributes: Attributes = {}; + +export interface CT_InverseTransform {} + +export const CT_InverseTransform_Attributes: Attributes = {}; + +export interface CT_GrayscaleTransform {} + +export const CT_GrayscaleTransform_Attributes: Attributes = {}; + +export interface CT_FixedPercentage { + val?: ST_FixedPercentage; +} + +export const CT_FixedPercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_PositivePercentage { + val?: ST_PositivePercentage; +} + +export const CT_PositivePercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_PositiveFixedAngle = ST_Angle; + +export interface CT_PositiveFixedAngle { + val?: number; +} + +export const CT_PositiveFixedAngle_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export type ST_Angle = number; + +export interface CT_Angle { + val?: number; +} + +export const CT_Angle_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_Percentage { + val?: string; +} + +export const CT_Percentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_GammaTransform {} + +export const CT_GammaTransform_Attributes: Attributes = {}; + +export interface CT_InverseGammaTransform {} + +export const CT_InverseGammaTransform_Attributes: Attributes = {}; + +export interface CT_ScRgbColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + r?: string; + g?: string; + b?: string; +} + +export const CT_ScRgbColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + r: { + type: 'string' + }, + g: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export interface CT_SRgbColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: string; +} + +export const CT_SRgbColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export interface CT_HslColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: number; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: string; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: string; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; +} + +export const CT_HslColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'int' + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'string' + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'string' + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + } +}; + +export type ST_SystemColorVal = + | 'scrollBar' + | 'background' + | 'activeCaption' + | 'inactiveCaption' + | 'menu' + | 'window' + | 'windowFrame' + | 'menuText' + | 'windowText' + | 'captionText' + | 'activeBorder' + | 'inactiveBorder' + | 'appWorkspace' + | 'highlight' + | 'highlightText' + | 'btnFace' + | 'btnShadow' + | 'grayText' + | 'btnText' + | 'inactiveCaptionText' + | 'btnHighlight' + | '3dDkShadow' + | '3dLight' + | 'infoText' + | 'infoBk' + | 'hotLight' + | 'gradientActiveCaption' + | 'gradientInactiveCaption' + | 'menuHighlight' + | 'menuBar'; + +export interface CT_SystemColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_SystemColorVal; + lastClr?: string; +} + +export const CT_SystemColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + }, + lastClr: { + type: 'string' + } +}; + +export type ST_SchemeColorVal = + | 'bg1' + | 'tx1' + | 'bg2' + | 'tx2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink' + | 'phClr' + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2'; + +export interface CT_SchemeColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_SchemeColorVal; +} + +export const CT_SchemeColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export type ST_PresetColorVal = + | 'aliceBlue' + | 'antiqueWhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedAlmond' + | 'blue' + | 'blueViolet' + | 'brown' + | 'burlyWood' + | 'cadetBlue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerBlue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkBlue' + | 'darkCyan' + | 'darkGoldenrod' + | 'darkGray' + | 'darkGrey' + | 'darkGreen' + | 'darkKhaki' + | 'darkMagenta' + | 'darkOliveGreen' + | 'darkOrange' + | 'darkOrchid' + | 'darkRed' + | 'darkSalmon' + | 'darkSeaGreen' + | 'darkSlateBlue' + | 'darkSlateGray' + | 'darkSlateGrey' + | 'darkTurquoise' + | 'darkViolet' + | 'dkBlue' + | 'dkCyan' + | 'dkGoldenrod' + | 'dkGray' + | 'dkGrey' + | 'dkGreen' + | 'dkKhaki' + | 'dkMagenta' + | 'dkOliveGreen' + | 'dkOrange' + | 'dkOrchid' + | 'dkRed' + | 'dkSalmon' + | 'dkSeaGreen' + | 'dkSlateBlue' + | 'dkSlateGray' + | 'dkSlateGrey' + | 'dkTurquoise' + | 'dkViolet' + | 'deepPink' + | 'deepSkyBlue' + | 'dimGray' + | 'dimGrey' + | 'dodgerBlue' + | 'firebrick' + | 'floralWhite' + | 'forestGreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostWhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'grey' + | 'green' + | 'greenYellow' + | 'honeydew' + | 'hotPink' + | 'indianRed' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderBlush' + | 'lawnGreen' + | 'lemonChiffon' + | 'lightBlue' + | 'lightCoral' + | 'lightCyan' + | 'lightGoldenrodYellow' + | 'lightGray' + | 'lightGrey' + | 'lightGreen' + | 'lightPink' + | 'lightSalmon' + | 'lightSeaGreen' + | 'lightSkyBlue' + | 'lightSlateGray' + | 'lightSlateGrey' + | 'lightSteelBlue' + | 'lightYellow' + | 'ltBlue' + | 'ltCoral' + | 'ltCyan' + | 'ltGoldenrodYellow' + | 'ltGray' + | 'ltGrey' + | 'ltGreen' + | 'ltPink' + | 'ltSalmon' + | 'ltSeaGreen' + | 'ltSkyBlue' + | 'ltSlateGray' + | 'ltSlateGrey' + | 'ltSteelBlue' + | 'ltYellow' + | 'lime' + | 'limeGreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'medAquamarine' + | 'medBlue' + | 'medOrchid' + | 'medPurple' + | 'medSeaGreen' + | 'medSlateBlue' + | 'medSpringGreen' + | 'medTurquoise' + | 'medVioletRed' + | 'mediumAquamarine' + | 'mediumBlue' + | 'mediumOrchid' + | 'mediumPurple' + | 'mediumSeaGreen' + | 'mediumSlateBlue' + | 'mediumSpringGreen' + | 'mediumTurquoise' + | 'mediumVioletRed' + | 'midnightBlue' + | 'mintCream' + | 'mistyRose' + | 'moccasin' + | 'navajoWhite' + | 'navy' + | 'oldLace' + | 'olive' + | 'oliveDrab' + | 'orange' + | 'orangeRed' + | 'orchid' + | 'paleGoldenrod' + | 'paleGreen' + | 'paleTurquoise' + | 'paleVioletRed' + | 'papayaWhip' + | 'peachPuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderBlue' + | 'purple' + | 'red' + | 'rosyBrown' + | 'royalBlue' + | 'saddleBrown' + | 'salmon' + | 'sandyBrown' + | 'seaGreen' + | 'seaShell' + | 'sienna' + | 'silver' + | 'skyBlue' + | 'slateBlue' + | 'slateGray' + | 'slateGrey' + | 'snow' + | 'springGreen' + | 'steelBlue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whiteSmoke' + | 'yellow' + | 'yellowGreen'; + +export interface CT_PresetColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_PresetColorVal; +} + +export const CT_PresetColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export interface CT_Color { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_Color_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_ColorScheme { + dk1?: CT_Color; + lt1?: CT_Color; + dk2?: CT_Color; + lt2?: CT_Color; + accent1?: CT_Color; + accent2?: CT_Color; + accent3?: CT_Color; + accent4?: CT_Color; + accent5?: CT_Color; + accent6?: CT_Color; + hlink?: CT_Color; + folHlink?: CT_Color; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_ColorScheme_Attributes: Attributes = { + dk1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + lt1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + dk2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + lt2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent3: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent4: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent5: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent6: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + hlink: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + folHlink: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_CustomColor { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + name?: string; +} + +export const CT_CustomColor_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + name: { + type: 'string' + } +}; + +export type ST_TextTypeface = string; + +export interface CT_SupplementalFont { + script?: string; + typeface?: string; +} + +export const CT_SupplementalFont_Attributes: Attributes = { + script: { + type: 'string' + }, + typeface: { + type: 'string' + } +}; + +export interface CT_CustomColorList { + custClr?: CT_CustomColor[]; +} + +export const CT_CustomColorList_Attributes: Attributes = { + custClr: { + type: 'child', + childAttributes: CT_CustomColor_Attributes, + childIsArray: true + } +}; + +export type ST_PitchFamily = number; + +export interface CT_TextFont { + typeface?: string; + panose?: string; + pitchFamily?: number; + charset?: number; +} + +export const CT_TextFont_Attributes: Attributes = { + typeface: { + type: 'string' + }, + panose: { + type: 'string' + }, + pitchFamily: { + type: 'int' + }, + charset: { + type: 'int' + } +}; + +export interface CT_FontCollection { + latin?: CT_TextFont; + ea?: CT_TextFont; + cs?: CT_TextFont; + font?: CT_SupplementalFont[]; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_FontCollection_Attributes: Attributes = { + latin: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + ea: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + cs: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + font: { + type: 'child', + childAttributes: CT_SupplementalFont_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_PositiveCoordinate = number; + +export interface CT_BlurEffect { + rad?: number; + grow?: boolean; +} + +export const CT_BlurEffect_Attributes: Attributes = { + rad: { + type: 'int' + }, + grow: { + type: 'boolean' + } +}; + +export interface CT_NoFillProperties {} + +export const CT_NoFillProperties_Attributes: Attributes = {}; + +export interface CT_SolidColorFillProperties { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_SolidColorFillProperties_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_GradientStop { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + pos?: ST_PositiveFixedPercentage; +} + +export const CT_GradientStop_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + pos: { + type: 'string' + } +}; + +export interface CT_GradientStopList { + gs?: CT_GradientStop[]; +} + +export const CT_GradientStopList_Attributes: Attributes = { + gs: { + type: 'child', + childAttributes: CT_GradientStop_Attributes, + childIsArray: true + } +}; + +export interface CT_LinearShadeProperties { + ang?: number; + scaled?: boolean; +} + +export const CT_LinearShadeProperties_Attributes: Attributes = { + ang: { + type: 'int' + }, + scaled: { + type: 'boolean' + } +}; + +export interface CT_RelativeRect { + l?: string; + t?: string; + r?: string; + b?: string; +} + +export const CT_RelativeRect_Attributes: Attributes = { + l: { + type: 'string' + }, + t: { + type: 'string' + }, + r: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export type ST_PathShadeType = 'shape' | 'circle' | 'rect'; + +export interface CT_PathShadeProperties { + fillToRect?: CT_RelativeRect; + path?: ST_PathShadeType; +} + +export const CT_PathShadeProperties_Attributes: Attributes = { + fillToRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + path: { + type: 'string' + } +}; + +export type ST_TileFlipMode = 'none' | 'x' | 'y' | 'xy'; + +export interface CT_GradientFillProperties { + gsLst?: CT_GradientStopList; + lin?: CT_LinearShadeProperties; + path?: CT_PathShadeProperties; + tileRect?: CT_RelativeRect; + flip?: ST_TileFlipMode; + rotWithShape?: boolean; +} + +export const CT_GradientFillProperties_Attributes: Attributes = { + gsLst: { + type: 'child', + childAttributes: CT_GradientStopList_Attributes + }, + lin: { + type: 'child', + childAttributes: CT_LinearShadeProperties_Attributes + }, + path: { + type: 'child', + childAttributes: CT_PathShadeProperties_Attributes + }, + tileRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + flip: { + type: 'string' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export type ST_BlipCompression = + | 'email' + | 'screen' + | 'print' + | 'hqprint' + | 'none'; + +export interface CT_Blip { + extLst?: CT_OfficeArtExtensionList; + cstate?: ST_BlipCompression; +} + +export const CT_Blip_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + cstate: { + type: 'string' + } +}; + +export type ST_Coordinate = ST_CoordinateUnqualified | ST_UniversalMeasure; + +export type ST_RectAlignment = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'ctr' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_TileInfoProperties { + tx?: ST_Coordinate; + ty?: ST_Coordinate; + sx?: string; + sy?: string; + flip?: ST_TileFlipMode; + algn?: ST_RectAlignment; +} + +export const CT_TileInfoProperties_Attributes: Attributes = { + tx: { + type: 'string' + }, + ty: { + type: 'string' + }, + sx: { + type: 'string' + }, + sy: { + type: 'string' + }, + flip: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_StretchInfoProperties { + fillRect?: CT_RelativeRect; +} + +export const CT_StretchInfoProperties_Attributes: Attributes = { + fillRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + } +}; + +export interface CT_BlipFillProperties { + blip?: CT_Blip; + srcRect?: CT_RelativeRect; + tile?: CT_TileInfoProperties; + stretch?: CT_StretchInfoProperties; + dpi?: number; + rotWithShape?: boolean; +} + +export const CT_BlipFillProperties_Attributes: Attributes = { + blip: { + type: 'child', + childAttributes: CT_Blip_Attributes + }, + srcRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + tile: { + type: 'child', + childAttributes: CT_TileInfoProperties_Attributes + }, + stretch: { + type: 'child', + childAttributes: CT_StretchInfoProperties_Attributes + }, + dpi: { + type: 'int' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export type ST_PresetPatternVal = + | 'pct5' + | 'pct10' + | 'pct20' + | 'pct25' + | 'pct30' + | 'pct40' + | 'pct50' + | 'pct60' + | 'pct70' + | 'pct75' + | 'pct80' + | 'pct90' + | 'horz' + | 'vert' + | 'ltHorz' + | 'ltVert' + | 'dkHorz' + | 'dkVert' + | 'narHorz' + | 'narVert' + | 'dashHorz' + | 'dashVert' + | 'cross' + | 'dnDiag' + | 'upDiag' + | 'ltDnDiag' + | 'ltUpDiag' + | 'dkDnDiag' + | 'dkUpDiag' + | 'wdDnDiag' + | 'wdUpDiag' + | 'dashDnDiag' + | 'dashUpDiag' + | 'diagCross' + | 'smCheck' + | 'lgCheck' + | 'smGrid' + | 'lgGrid' + | 'dotGrid' + | 'smConfetti' + | 'lgConfetti' + | 'horzBrick' + | 'diagBrick' + | 'solidDmnd' + | 'openDmnd' + | 'dotDmnd' + | 'plaid' + | 'sphere' + | 'weave' + | 'divot' + | 'shingle' + | 'wave' + | 'trellis' + | 'zigZag'; + +export interface CT_PatternFillProperties { + fgClr?: CT_Color; + bgClr?: CT_Color; + prst?: ST_PresetPatternVal; +} + +export const CT_PatternFillProperties_Attributes: Attributes = { + fgClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + bgClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_GroupFillProperties {} + +export const CT_GroupFillProperties_Attributes: Attributes = {}; + +export type ST_BlendMode = 'over' | 'mult' | 'screen' | 'darken' | 'lighten'; + +export interface CT_FillOverlayEffect { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + blend?: ST_BlendMode; +} + +export const CT_FillOverlayEffect_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + blend: { + type: 'string' + } +}; + +export interface CT_GlowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + rad?: number; +} + +export const CT_GlowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + rad: { + type: 'int' + } +}; + +export interface CT_InnerShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + blurRad?: number; + dist?: number; + dir?: number; +} + +export const CT_InnerShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + blurRad: { + type: 'int' + }, + dist: { + type: 'int' + }, + dir: { + type: 'int' + } +}; + +export type ST_FixedAngle = ST_Angle; + +export interface CT_OuterShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + blurRad?: number; + dist?: number; + dir?: number; + sx?: string; + sy?: string; + kx?: number; + ky?: number; + algn?: ST_RectAlignment; + rotWithShape?: boolean; +} + +export const CT_OuterShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + blurRad: { + type: 'int' + }, + dist: { + type: 'int' + }, + dir: { + type: 'int' + }, + sx: { + type: 'string' + }, + sy: { + type: 'string' + }, + kx: { + type: 'int' + }, + ky: { + type: 'int' + }, + algn: { + type: 'string' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export type ST_PresetShadowVal = + | 'shdw1' + | 'shdw2' + | 'shdw3' + | 'shdw4' + | 'shdw5' + | 'shdw6' + | 'shdw7' + | 'shdw8' + | 'shdw9' + | 'shdw10' + | 'shdw11' + | 'shdw12' + | 'shdw13' + | 'shdw14' + | 'shdw15' + | 'shdw16' + | 'shdw17' + | 'shdw18' + | 'shdw19' + | 'shdw20'; + +export interface CT_PresetShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + prst?: ST_PresetShadowVal; + dist?: number; + dir?: number; +} + +export const CT_PresetShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + prst: { + type: 'string' + }, + dist: { + type: 'int' + }, + dir: { + type: 'int' + } +}; + +export interface CT_ReflectionEffect { + blurRad?: number; + stA?: ST_PositiveFixedPercentage; + stPos?: ST_PositiveFixedPercentage; + endA?: ST_PositiveFixedPercentage; + endPos?: ST_PositiveFixedPercentage; + dist?: number; + dir?: number; + fadeDir?: number; + sx?: string; + sy?: string; + kx?: number; + ky?: number; + algn?: ST_RectAlignment; + rotWithShape?: boolean; +} + +export const CT_ReflectionEffect_Attributes: Attributes = { + blurRad: { + type: 'int' + }, + stA: { + type: 'string' + }, + stPos: { + type: 'string' + }, + endA: { + type: 'string' + }, + endPos: { + type: 'string' + }, + dist: { + type: 'int' + }, + dir: { + type: 'int' + }, + fadeDir: { + type: 'int' + }, + sx: { + type: 'string' + }, + sy: { + type: 'string' + }, + kx: { + type: 'int' + }, + ky: { + type: 'int' + }, + algn: { + type: 'string' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export interface CT_SoftEdgesEffect { + rad?: number; +} + +export const CT_SoftEdgesEffect_Attributes: Attributes = { + rad: { + type: 'int' + } +}; + +export interface CT_EffectList { + blur?: CT_BlurEffect; + fillOverlay?: CT_FillOverlayEffect; + glow?: CT_GlowEffect; + innerShdw?: CT_InnerShadowEffect; + outerShdw?: CT_OuterShadowEffect; + prstShdw?: CT_PresetShadowEffect; + reflection?: CT_ReflectionEffect; + softEdge?: CT_SoftEdgesEffect; +} + +export const CT_EffectList_Attributes: Attributes = { + blur: { + type: 'child', + childAttributes: CT_BlurEffect_Attributes + }, + fillOverlay: { + type: 'child', + childAttributes: CT_FillOverlayEffect_Attributes + }, + glow: { + type: 'child', + childAttributes: CT_GlowEffect_Attributes + }, + innerShdw: { + type: 'child', + childAttributes: CT_InnerShadowEffect_Attributes + }, + outerShdw: { + type: 'child', + childAttributes: CT_OuterShadowEffect_Attributes + }, + prstShdw: { + type: 'child', + childAttributes: CT_PresetShadowEffect_Attributes + }, + reflection: { + type: 'child', + childAttributes: CT_ReflectionEffect_Attributes + }, + softEdge: { + type: 'child', + childAttributes: CT_SoftEdgesEffect_Attributes + } +}; + +export type ST_EffectContainerType = 'sib' | 'tree'; + +export interface CT_EffectContainer { + type?: ST_EffectContainerType; + name?: string; +} + +export const CT_EffectContainer_Attributes: Attributes = { + type: { + type: 'string' + }, + name: { + type: 'string' + } +}; + +export interface CT_SphereCoords { + lat?: number; + lon?: number; + rev?: number; +} + +export const CT_SphereCoords_Attributes: Attributes = { + lat: { + type: 'int' + }, + lon: { + type: 'int' + }, + rev: { + type: 'int' + } +}; + +export type ST_PresetCameraType = + | 'legacyObliqueTopLeft' + | 'legacyObliqueTop' + | 'legacyObliqueTopRight' + | 'legacyObliqueLeft' + | 'legacyObliqueFront' + | 'legacyObliqueRight' + | 'legacyObliqueBottomLeft' + | 'legacyObliqueBottom' + | 'legacyObliqueBottomRight' + | 'legacyPerspectiveTopLeft' + | 'legacyPerspectiveTop' + | 'legacyPerspectiveTopRight' + | 'legacyPerspectiveLeft' + | 'legacyPerspectiveFront' + | 'legacyPerspectiveRight' + | 'legacyPerspectiveBottomLeft' + | 'legacyPerspectiveBottom' + | 'legacyPerspectiveBottomRight' + | 'orthographicFront' + | 'isometricTopUp' + | 'isometricTopDown' + | 'isometricBottomUp' + | 'isometricBottomDown' + | 'isometricLeftUp' + | 'isometricLeftDown' + | 'isometricRightUp' + | 'isometricRightDown' + | 'isometricOffAxis1Left' + | 'isometricOffAxis1Right' + | 'isometricOffAxis1Top' + | 'isometricOffAxis2Left' + | 'isometricOffAxis2Right' + | 'isometricOffAxis2Top' + | 'isometricOffAxis3Left' + | 'isometricOffAxis3Right' + | 'isometricOffAxis3Bottom' + | 'isometricOffAxis4Left' + | 'isometricOffAxis4Right' + | 'isometricOffAxis4Bottom' + | 'obliqueTopLeft' + | 'obliqueTop' + | 'obliqueTopRight' + | 'obliqueLeft' + | 'obliqueRight' + | 'obliqueBottomLeft' + | 'obliqueBottom' + | 'obliqueBottomRight' + | 'perspectiveFront' + | 'perspectiveLeft' + | 'perspectiveRight' + | 'perspectiveAbove' + | 'perspectiveBelow' + | 'perspectiveAboveLeftFacing' + | 'perspectiveAboveRightFacing' + | 'perspectiveContrastingLeftFacing' + | 'perspectiveContrastingRightFacing' + | 'perspectiveHeroicLeftFacing' + | 'perspectiveHeroicRightFacing' + | 'perspectiveHeroicExtremeLeftFacing' + | 'perspectiveHeroicExtremeRightFacing' + | 'perspectiveRelaxed' + | 'perspectiveRelaxedModerately'; + +export type ST_FOVAngle = ST_Angle; + +export interface CT_Camera { + rot?: CT_SphereCoords; + prst?: ST_PresetCameraType; + fov?: number; + zoom?: ST_PositivePercentage; +} + +export const CT_Camera_Attributes: Attributes = { + rot: { + type: 'child', + childAttributes: CT_SphereCoords_Attributes + }, + prst: { + type: 'string' + }, + fov: { + type: 'int' + }, + zoom: { + type: 'string' + } +}; + +export type ST_LightRigType = + | 'legacyFlat1' + | 'legacyFlat2' + | 'legacyFlat3' + | 'legacyFlat4' + | 'legacyNormal1' + | 'legacyNormal2' + | 'legacyNormal3' + | 'legacyNormal4' + | 'legacyHarsh1' + | 'legacyHarsh2' + | 'legacyHarsh3' + | 'legacyHarsh4' + | 'threePt' + | 'balanced' + | 'soft' + | 'harsh' + | 'flood' + | 'contrasting' + | 'morning' + | 'sunrise' + | 'sunset' + | 'chilly' + | 'freezing' + | 'flat' + | 'twoPt' + | 'glow' + | 'brightRoom'; + +export type ST_LightRigDirection = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_LightRig { + rot?: CT_SphereCoords; + rig?: ST_LightRigType; + dir?: ST_LightRigDirection; +} + +export const CT_LightRig_Attributes: Attributes = { + rot: { + type: 'child', + childAttributes: CT_SphereCoords_Attributes + }, + rig: { + type: 'string' + }, + dir: { + type: 'string' + } +}; + +export interface CT_Point3D { + x?: ST_Coordinate; + y?: ST_Coordinate; + z?: ST_Coordinate; +} + +export const CT_Point3D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + }, + z: { + type: 'string' + } +}; + +export interface CT_Vector3D { + dx?: ST_Coordinate; + dy?: ST_Coordinate; + dz?: ST_Coordinate; +} + +export const CT_Vector3D_Attributes: Attributes = { + dx: { + type: 'string' + }, + dy: { + type: 'string' + }, + dz: { + type: 'string' + } +}; + +export interface CT_Backdrop { + anchor?: CT_Point3D; + norm?: CT_Vector3D; + up?: CT_Vector3D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_Backdrop_Attributes: Attributes = { + anchor: { + type: 'child', + childAttributes: CT_Point3D_Attributes + }, + norm: { + type: 'child', + childAttributes: CT_Vector3D_Attributes + }, + up: { + type: 'child', + childAttributes: CT_Vector3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_Scene3D { + camera?: CT_Camera; + lightRig?: CT_LightRig; + backdrop?: CT_Backdrop; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_Scene3D_Attributes: Attributes = { + camera: { + type: 'child', + childAttributes: CT_Camera_Attributes + }, + lightRig: { + type: 'child', + childAttributes: CT_LightRig_Attributes + }, + backdrop: { + type: 'child', + childAttributes: CT_Backdrop_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_BevelPresetType = + | 'relaxedInset' + | 'circle' + | 'slope' + | 'cross' + | 'angle' + | 'softRound' + | 'convex' + | 'coolSlant' + | 'divot' + | 'riblet' + | 'hardEdge' + | 'artDeco'; + +export interface CT_Bevel { + w?: number; + h?: number; + prst?: ST_BevelPresetType; +} + +export const CT_Bevel_Attributes: Attributes = { + w: { + type: 'int' + }, + h: { + type: 'int' + }, + prst: { + type: 'string' + } +}; + +export type ST_PresetMaterialType = + | 'legacyMatte' + | 'legacyPlastic' + | 'legacyMetal' + | 'legacyWireframe' + | 'matte' + | 'plastic' + | 'metal' + | 'warmMatte' + | 'translucentPowder' + | 'powder' + | 'dkEdge' + | 'softEdge' + | 'clear' + | 'flat' + | 'softmetal'; + +export interface CT_Shape3D { + bevelT?: CT_Bevel; + bevelB?: CT_Bevel; + extrusionClr?: CT_Color; + contourClr?: CT_Color; + extLst?: CT_OfficeArtExtensionList; + z?: ST_Coordinate; + extrusionH?: number; + contourW?: number; + prstMaterial?: ST_PresetMaterialType; +} + +export const CT_Shape3D_Attributes: Attributes = { + bevelT: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + bevelB: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + extrusionClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + contourClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + z: { + type: 'string' + }, + extrusionH: { + type: 'int' + }, + contourW: { + type: 'int' + }, + prstMaterial: { + type: 'string' + } +}; + +export interface CT_EffectStyleItem { + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; +} + +export const CT_EffectStyleItem_Attributes: Attributes = { + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + } +}; + +export interface CT_FontScheme { + majorFont?: CT_FontCollection; + minorFont?: CT_FontCollection; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_FontScheme_Attributes: Attributes = { + majorFont: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + minorFont: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_FillStyleList { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillStyleList_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export type ST_PresetLineDashVal = + | 'solid' + | 'dot' + | 'dash' + | 'lgDash' + | 'dashDot' + | 'lgDashDot' + | 'lgDashDotDot' + | 'sysDash' + | 'sysDot' + | 'sysDashDot' + | 'sysDashDotDot'; + +export interface CT_PresetLineDashProperties { + val?: ST_PresetLineDashVal; +} + +export const CT_PresetLineDashProperties_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_DashStop { + d?: ST_PositivePercentage; + sp?: ST_PositivePercentage; +} + +export const CT_DashStop_Attributes: Attributes = { + d: { + type: 'string' + }, + sp: { + type: 'string' + } +}; + +export interface CT_DashStopList { + ds?: CT_DashStop[]; +} + +export const CT_DashStopList_Attributes: Attributes = { + ds: { + type: 'child', + childAttributes: CT_DashStop_Attributes, + childIsArray: true + } +}; + +export interface CT_LineJoinRound {} + +export const CT_LineJoinRound_Attributes: Attributes = {}; + +export interface CT_LineJoinBevel {} + +export const CT_LineJoinBevel_Attributes: Attributes = {}; + +export interface CT_LineJoinMiterProperties { + lim?: ST_PositivePercentage; +} + +export const CT_LineJoinMiterProperties_Attributes: Attributes = { + lim: { + type: 'string' + } +}; + +export type ST_LineEndType = + | 'none' + | 'triangle' + | 'stealth' + | 'diamond' + | 'oval' + | 'arrow'; + +export type ST_LineEndWidth = 'sm' | 'med' | 'lg'; + +export type ST_LineEndLength = 'sm' | 'med' | 'lg'; + +export interface CT_LineEndProperties { + type?: ST_LineEndType; + w?: ST_LineEndWidth; + len?: ST_LineEndLength; +} + +export const CT_LineEndProperties_Attributes: Attributes = { + type: { + type: 'string' + }, + w: { + type: 'string' + }, + len: { + type: 'string' + } +}; + +export type ST_LineWidth = ST_Coordinate32Unqualified; + +export type ST_LineCap = 'rnd' | 'sq' | 'flat'; + +export type ST_CompoundLine = 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri'; + +export type ST_PenAlignment = 'ctr' | 'in'; + +export interface CT_LineProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + pattFill?: CT_PatternFillProperties; + prstDash?: CT_PresetLineDashProperties; + custDash?: CT_DashStopList; + round?: CT_LineJoinRound; + bevel?: CT_LineJoinBevel; + miter?: CT_LineJoinMiterProperties; + headEnd?: CT_LineEndProperties; + tailEnd?: CT_LineEndProperties; + extLst?: CT_OfficeArtExtensionList; + w?: number; + cap?: ST_LineCap; + cmpd?: ST_CompoundLine; + algn?: ST_PenAlignment; +} + +export const CT_LineProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + prstDash: { + type: 'child', + childAttributes: CT_PresetLineDashProperties_Attributes + }, + custDash: { + type: 'child', + childAttributes: CT_DashStopList_Attributes + }, + round: { + type: 'child', + childAttributes: CT_LineJoinRound_Attributes + }, + bevel: { + type: 'child', + childAttributes: CT_LineJoinBevel_Attributes + }, + miter: { + type: 'child', + childAttributes: CT_LineJoinMiterProperties_Attributes + }, + headEnd: { + type: 'child', + childAttributes: CT_LineEndProperties_Attributes + }, + tailEnd: { + type: 'child', + childAttributes: CT_LineEndProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + w: { + type: 'int' + }, + cap: { + type: 'string' + }, + cmpd: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_LineStyleList { + ln?: CT_LineProperties[]; +} + +export const CT_LineStyleList_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes, + childIsArray: true + } +}; + +export interface CT_EffectStyleList { + effectStyle?: CT_EffectStyleItem[]; +} + +export const CT_EffectStyleList_Attributes: Attributes = { + effectStyle: { + type: 'child', + childAttributes: CT_EffectStyleItem_Attributes, + childIsArray: true + } +}; + +export interface CT_BackgroundFillStyleList { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_BackgroundFillStyleList_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_StyleMatrix { + fillStyleLst?: CT_FillStyleList; + lnStyleLst?: CT_LineStyleList; + effectStyleLst?: CT_EffectStyleList; + bgFillStyleLst?: CT_BackgroundFillStyleList; + name?: string; +} + +export const CT_StyleMatrix_Attributes: Attributes = { + fillStyleLst: { + type: 'child', + childAttributes: CT_FillStyleList_Attributes + }, + lnStyleLst: { + type: 'child', + childAttributes: CT_LineStyleList_Attributes + }, + effectStyleLst: { + type: 'child', + childAttributes: CT_EffectStyleList_Attributes + }, + bgFillStyleLst: { + type: 'child', + childAttributes: CT_BackgroundFillStyleList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_BaseStyles { + clrScheme?: CT_ColorScheme; + fontScheme?: CT_FontScheme; + fmtScheme?: CT_StyleMatrix; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_BaseStyles_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + fontScheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + }, + fmtScheme: { + type: 'child', + childAttributes: CT_StyleMatrix_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_CoordinateUnqualified = number; + +export type ST_Coordinate32 = ST_Coordinate32Unqualified | ST_UniversalMeasure; + +export type ST_Coordinate32Unqualified = number; + +export type ST_PositiveCoordinate32 = ST_Coordinate32Unqualified; + +export interface CT_Ratio { + n?: number; + d?: number; +} + +export const CT_Ratio_Attributes: Attributes = { + n: { + type: 'int' + }, + d: { + type: 'int' + } +}; + +export interface CT_Point2D { + x?: ST_Coordinate; + y?: ST_Coordinate; +} + +export const CT_Point2D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + } +}; + +export interface CT_PositiveSize2D { + cx?: number; + cy?: number; +} + +export const CT_PositiveSize2D_Attributes: Attributes = { + cx: { + type: 'int' + }, + cy: { + type: 'int' + } +}; + +export interface CT_Scale2D { + sx?: CT_Ratio; + sy?: CT_Ratio; +} + +export const CT_Scale2D_Attributes: Attributes = { + sx: { + type: 'child', + childAttributes: CT_Ratio_Attributes + }, + sy: { + type: 'child', + childAttributes: CT_Ratio_Attributes + } +}; + +export interface CT_Transform2D { + off?: CT_Point2D; + ext?: CT_PositiveSize2D; + rot?: number; + flipH?: boolean; + flipV?: boolean; +} + +export const CT_Transform2D_Attributes: Attributes = { + off: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + rot: { + type: 'int' + }, + flipH: { + type: 'boolean' + }, + flipV: { + type: 'boolean' + } +}; + +export interface CT_GroupTransform2D { + off?: CT_Point2D; + ext?: CT_PositiveSize2D; + chOff?: CT_Point2D; + chExt?: CT_PositiveSize2D; + rot?: number; + flipH?: boolean; + flipV?: boolean; +} + +export const CT_GroupTransform2D_Attributes: Attributes = { + off: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + chOff: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + chExt: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + rot: { + type: 'int' + }, + flipH: { + type: 'boolean' + }, + flipV: { + type: 'boolean' + } +}; + +export interface CT_ColorMRU { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_ColorMRU_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export type ST_BlackWhiteMode = + | 'clr' + | 'auto' + | 'gray' + | 'ltGray' + | 'invGray' + | 'grayWhite' + | 'blackGray' + | 'blackWhite' + | 'black' + | 'white' + | 'hidden'; + +export interface CT_EmbeddedWAVAudioFile { + name?: string; +} + +export const CT_EmbeddedWAVAudioFile_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export interface CT_Hyperlink { + snd?: CT_EmbeddedWAVAudioFile; + extLst?: CT_OfficeArtExtensionList; + r_id?: string; + invalidUrl?: string; + action?: string; + tgtFrame?: string; + tooltip?: string; + history?: boolean; + highlightClick?: boolean; + endSnd?: boolean; +} + +export const CT_Hyperlink_Attributes: Attributes = { + snd: { + type: 'child', + childAttributes: CT_EmbeddedWAVAudioFile_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + r_id: { + type: 'string' + }, + invalidUrl: { + type: 'string' + }, + action: { + type: 'string' + }, + tgtFrame: { + type: 'string' + }, + tooltip: { + type: 'string' + }, + history: { + type: 'boolean' + }, + highlightClick: { + type: 'boolean' + }, + endSnd: { + type: 'boolean' + } +}; + +export type ST_DrawingElementId = number; + +export interface CT_ConnectorLocking { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ConnectorLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_ShapeLocking { + extLst?: CT_OfficeArtExtensionList; + noTextEdit?: boolean; +} + +export const CT_ShapeLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noTextEdit: { + type: 'boolean' + } +}; + +export interface CT_PictureLocking { + extLst?: CT_OfficeArtExtensionList; + noCrop?: boolean; +} + +export const CT_PictureLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noCrop: { + type: 'boolean' + } +}; + +export interface CT_GroupLocking { + extLst?: CT_OfficeArtExtensionList; + noGrp?: boolean; + noUngrp?: boolean; + noSelect?: boolean; + noRot?: boolean; + noChangeAspect?: boolean; + noMove?: boolean; + noResize?: boolean; +} + +export const CT_GroupLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noGrp: { + type: 'boolean' + }, + noUngrp: { + type: 'boolean' + }, + noSelect: { + type: 'boolean' + }, + noRot: { + type: 'boolean' + }, + noChangeAspect: { + type: 'boolean' + }, + noMove: { + type: 'boolean' + }, + noResize: { + type: 'boolean' + } +}; + +export interface CT_GraphicalObjectFrameLocking { + extLst?: CT_OfficeArtExtensionList; + noGrp?: boolean; + noDrilldown?: boolean; + noSelect?: boolean; + noChangeAspect?: boolean; + noMove?: boolean; + noResize?: boolean; +} + +export const CT_GraphicalObjectFrameLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noGrp: { + type: 'boolean' + }, + noDrilldown: { + type: 'boolean' + }, + noSelect: { + type: 'boolean' + }, + noChangeAspect: { + type: 'boolean' + }, + noMove: { + type: 'boolean' + }, + noResize: { + type: 'boolean' + } +}; + +export interface CT_ContentPartLocking { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ContentPartLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualDrawingProps { + hlinkClick?: CT_Hyperlink; + hlinkHover?: CT_Hyperlink; + extLst?: CT_OfficeArtExtensionList; + id?: number; + name?: string; + descr?: string; + hidden?: boolean; + title?: string; +} + +export const CT_NonVisualDrawingProps_Attributes: Attributes = { + hlinkClick: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + hlinkHover: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + id: { + type: 'int' + }, + name: { + type: 'string' + }, + descr: { + type: 'string' + }, + hidden: { + type: 'boolean' + }, + title: { + type: 'string' + } +}; + +export interface CT_NonVisualDrawingShapeProps { + spLocks?: CT_ShapeLocking; + extLst?: CT_OfficeArtExtensionList; + txBox?: boolean; +} + +export const CT_NonVisualDrawingShapeProps_Attributes: Attributes = { + spLocks: { + type: 'child', + childAttributes: CT_ShapeLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + txBox: { + type: 'boolean' + } +}; + +export interface CT_Connection { + id?: number; + idx?: number; +} + +export const CT_Connection_Attributes: Attributes = { + id: { + type: 'int' + }, + idx: { + type: 'int' + } +}; + +export interface CT_NonVisualConnectorProperties { + cxnSpLocks?: CT_ConnectorLocking; + stCxn?: CT_Connection; + endCxn?: CT_Connection; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualConnectorProperties_Attributes: Attributes = { + cxnSpLocks: { + type: 'child', + childAttributes: CT_ConnectorLocking_Attributes + }, + stCxn: { + type: 'child', + childAttributes: CT_Connection_Attributes + }, + endCxn: { + type: 'child', + childAttributes: CT_Connection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualPictureProperties { + picLocks?: CT_PictureLocking; + extLst?: CT_OfficeArtExtensionList; + preferRelativeResize?: boolean; +} + +export const CT_NonVisualPictureProperties_Attributes: Attributes = { + picLocks: { + type: 'child', + childAttributes: CT_PictureLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + preferRelativeResize: { + type: 'boolean' + } +}; + +export interface CT_NonVisualGroupDrawingShapeProps { + grpSpLocks?: CT_GroupLocking; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualGroupDrawingShapeProps_Attributes: Attributes = { + grpSpLocks: { + type: 'child', + childAttributes: CT_GroupLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualGraphicFrameProperties { + graphicFrameLocks?: CT_GraphicalObjectFrameLocking; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualGraphicFrameProperties_Attributes: Attributes = { + graphicFrameLocks: { + type: 'child', + childAttributes: CT_GraphicalObjectFrameLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualContentPartProperties { + cpLocks?: CT_ContentPartLocking; + extLst?: CT_OfficeArtExtensionList; + isComment?: boolean; +} + +export const CT_NonVisualContentPartProperties_Attributes: Attributes = { + cpLocks: { + type: 'child', + childAttributes: CT_ContentPartLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + isComment: { + type: 'boolean' + } +}; + +export interface CT_GraphicalObjectData { + uri?: string; +} + +export const CT_GraphicalObjectData_Attributes: Attributes = { + uri: { + type: 'string' + } +}; + +export interface CT_GraphicalObject { + graphicData?: CT_GraphicalObjectData[]; +} + +export const CT_GraphicalObject_Attributes: Attributes = { + graphicData: { + type: 'child', + childAttributes: CT_GraphicalObjectData_Attributes, + childIsArray: true + } +}; + +export type ST_ChartBuildStep = + | 'category' + | 'ptInCategory' + | 'series' + | 'ptInSeries' + | 'allPts' + | 'gridLegend'; + +export type ST_DgmBuildStep = 'sp' | 'bg'; + +export interface CT_AnimationDgmElement { + id?: string; + bldStep?: ST_DgmBuildStep; +} + +export const CT_AnimationDgmElement_Attributes: Attributes = { + id: { + type: 'string' + }, + bldStep: { + type: 'string' + } +}; + +export interface CT_AnimationChartElement { + seriesIdx?: number; + categoryIdx?: number; + bldStep?: ST_ChartBuildStep; +} + +export const CT_AnimationChartElement_Attributes: Attributes = { + seriesIdx: { + type: 'int' + }, + categoryIdx: { + type: 'int' + }, + bldStep: { + type: 'string' + } +}; + +export interface CT_AnimationElementChoice { + dgm?: CT_AnimationDgmElement[]; + chart?: CT_AnimationChartElement[]; +} + +export const CT_AnimationElementChoice_Attributes: Attributes = { + dgm: { + type: 'child', + childAttributes: CT_AnimationDgmElement_Attributes, + childIsArray: true + }, + chart: { + type: 'child', + childAttributes: CT_AnimationChartElement_Attributes, + childIsArray: true + } +}; + +export type ST_AnimationBuildType = 'allAtOnce'; + +export type ST_AnimationDgmOnlyBuildType = 'one' | 'lvlOne' | 'lvlAtOnce'; + +export type ST_AnimationDgmBuildType = + | ST_AnimationBuildType + | ST_AnimationDgmOnlyBuildType; + +export interface CT_AnimationDgmBuildProperties { + bld?: ST_AnimationDgmBuildType; + rev?: boolean; +} + +export const CT_AnimationDgmBuildProperties_Attributes: Attributes = { + bld: { + type: 'string' + }, + rev: { + type: 'boolean' + } +}; + +export type ST_AnimationChartOnlyBuildType = + | 'series' + | 'category' + | 'seriesEl' + | 'categoryEl'; + +export type ST_AnimationChartBuildType = + | ST_AnimationBuildType + | ST_AnimationChartOnlyBuildType; + +export interface CT_AnimationChartBuildProperties { + bld?: ST_AnimationChartBuildType; + animBg?: boolean; +} + +export const CT_AnimationChartBuildProperties_Attributes: Attributes = { + bld: { + type: 'string' + }, + animBg: { + type: 'boolean' + } +}; + +export interface CT_AnimationGraphicalObjectBuildProperties { + bldDgm?: CT_AnimationDgmBuildProperties[]; + bldChart?: CT_AnimationChartBuildProperties[]; +} + +export const CT_AnimationGraphicalObjectBuildProperties_Attributes: Attributes = + { + bldDgm: { + type: 'child', + childAttributes: CT_AnimationDgmBuildProperties_Attributes, + childIsArray: true + }, + bldChart: { + type: 'child', + childAttributes: CT_AnimationChartBuildProperties_Attributes, + childIsArray: true + } + }; + +export interface CT_BackgroundFormatting { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_BackgroundFormatting_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_WholeE2oFormatting { + ln?: CT_LineProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_WholeE2oFormatting_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_GvmlUseShapeRectangle {} + +export const CT_GvmlUseShapeRectangle_Attributes: Attributes = {}; + +export type ST_GeomGuideName = string; + +export type ST_GeomGuideFormula = string; + +export interface CT_GeomGuide { + name?: string; + fmla?: string; +} + +export const CT_GeomGuide_Attributes: Attributes = { + name: { + type: 'string' + }, + fmla: { + type: 'string' + } +}; + +export interface CT_GeomGuideList { + gd?: CT_GeomGuide[]; +} + +export const CT_GeomGuideList_Attributes: Attributes = { + gd: { + type: 'child', + childAttributes: CT_GeomGuide_Attributes, + childIsArray: true + } +}; + +export type ST_TextShapeType = + | 'textNoShape' + | 'textPlain' + | 'textStop' + | 'textTriangle' + | 'textTriangleInverted' + | 'textChevron' + | 'textChevronInverted' + | 'textRingInside' + | 'textRingOutside' + | 'textArchUp' + | 'textArchDown' + | 'textCircle' + | 'textButton' + | 'textArchUpPour' + | 'textArchDownPour' + | 'textCirclePour' + | 'textButtonPour' + | 'textCurveUp' + | 'textCurveDown' + | 'textCanUp' + | 'textCanDown' + | 'textWave1' + | 'textWave2' + | 'textDoubleWave1' + | 'textWave4' + | 'textInflate' + | 'textDeflate' + | 'textInflateBottom' + | 'textDeflateBottom' + | 'textInflateTop' + | 'textDeflateTop' + | 'textDeflateInflate' + | 'textDeflateInflateDeflate' + | 'textFadeRight' + | 'textFadeLeft' + | 'textFadeUp' + | 'textFadeDown' + | 'textSlantUp' + | 'textSlantDown' + | 'textCascadeUp' + | 'textCascadeDown'; + +export interface CT_PresetTextShape { + avLst?: CT_GeomGuideList; + prst?: ST_TextShapeType; +} + +export const CT_PresetTextShape_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_TextNoAutofit {} + +export const CT_TextNoAutofit_Attributes: Attributes = {}; + +export type ST_TextFontScalePercentOrPercentString = string; + +export type ST_TextSpacingPercentOrPercentString = string; + +export interface CT_TextNormalAutofit { + fontScale?: string; + lnSpcReduction?: string; +} + +export const CT_TextNormalAutofit_Attributes: Attributes = { + fontScale: { + type: 'string' + }, + lnSpcReduction: { + type: 'string' + } +}; + +export interface CT_TextShapeAutofit {} + +export const CT_TextShapeAutofit_Attributes: Attributes = {}; + +export interface CT_FlatText { + z?: ST_Coordinate; +} + +export const CT_FlatText_Attributes: Attributes = { + z: { + type: 'string' + } +}; + +export type ST_TextVertOverflowType = 'overflow' | 'ellipsis' | 'clip'; + +export type ST_TextHorzOverflowType = 'overflow' | 'clip'; + +export type ST_TextVerticalType = + | 'horz' + | 'vert' + | 'vert270' + | 'wordArtVert' + | 'eaVert' + | 'mongolianVert' + | 'wordArtVertRtl'; + +export type ST_TextWrappingType = 'none' | 'square'; + +export type ST_TextColumnCount = number; + +export type ST_TextAnchoringType = 't' | 'ctr' | 'b' | 'just' | 'dist'; + +export interface CT_TextBodyProperties { + prstTxWarp?: CT_PresetTextShape; + noAutofit?: CT_TextNoAutofit[]; + normAutofit?: CT_TextNormalAutofit[]; + spAutoFit?: CT_TextShapeAutofit[]; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; + flatTx?: CT_FlatText; + extLst?: CT_OfficeArtExtensionList; + rot?: number; + spcFirstLastPara?: boolean; + vertOverflow?: ST_TextVertOverflowType; + horzOverflow?: ST_TextHorzOverflowType; + vert?: ST_TextVerticalType; + wrap?: ST_TextWrappingType; + lIns?: ST_Coordinate32; + tIns?: ST_Coordinate32; + rIns?: ST_Coordinate32; + bIns?: ST_Coordinate32; + numCol?: number; + spcCol?: number; + rtlCol?: boolean; + fromWordArt?: boolean; + anchor?: ST_TextAnchoringType; + anchorCtr?: boolean; + forceAA?: boolean; + upright?: boolean; + compatLnSpc?: boolean; +} + +export const CT_TextBodyProperties_Attributes: Attributes = { + prstTxWarp: { + type: 'child', + childAttributes: CT_PresetTextShape_Attributes + }, + noAutofit: { + type: 'child', + childAttributes: CT_TextNoAutofit_Attributes, + childIsArray: true + }, + normAutofit: { + type: 'child', + childAttributes: CT_TextNormalAutofit_Attributes, + childIsArray: true + }, + spAutoFit: { + type: 'child', + childAttributes: CT_TextShapeAutofit_Attributes, + childIsArray: true + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + }, + flatTx: { + type: 'child', + childAttributes: CT_FlatText_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rot: { + type: 'int' + }, + spcFirstLastPara: { + type: 'boolean' + }, + vertOverflow: { + type: 'string' + }, + horzOverflow: { + type: 'string' + }, + vert: { + type: 'string' + }, + wrap: { + type: 'string' + }, + lIns: { + type: 'string' + }, + tIns: { + type: 'string' + }, + rIns: { + type: 'string' + }, + bIns: { + type: 'string' + }, + numCol: { + type: 'int' + }, + spcCol: { + type: 'int' + }, + rtlCol: { + type: 'boolean' + }, + fromWordArt: { + type: 'boolean' + }, + anchor: { + type: 'string' + }, + anchorCtr: { + type: 'boolean' + }, + forceAA: { + type: 'boolean' + }, + upright: { + type: 'boolean' + }, + compatLnSpc: { + type: 'boolean' + } +}; + +export interface CT_TextSpacingPercent { + val?: string; +} + +export const CT_TextSpacingPercent_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextSpacingPoint = number; + +export interface CT_TextSpacingPoint { + val?: number; +} + +export const CT_TextSpacingPoint_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_TextSpacing { + spcPct?: CT_TextSpacingPercent[]; + spcPts?: CT_TextSpacingPoint[]; +} + +export const CT_TextSpacing_Attributes: Attributes = { + spcPct: { + type: 'child', + childAttributes: CT_TextSpacingPercent_Attributes, + childIsArray: true + }, + spcPts: { + type: 'child', + childAttributes: CT_TextSpacingPoint_Attributes, + childIsArray: true + } +}; + +export interface CT_TextBulletColorFollowText {} + +export const CT_TextBulletColorFollowText_Attributes: Attributes = {}; + +export interface CT_TextBulletSizeFollowText {} + +export const CT_TextBulletSizeFollowText_Attributes: Attributes = {}; + +export type ST_TextBulletSizePercent = string; + +export interface CT_TextBulletSizePercent { + val?: string; +} + +export const CT_TextBulletSizePercent_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextFontSize = number; + +export interface CT_TextBulletSizePoint { + val?: number; +} + +export const CT_TextBulletSizePoint_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_TextBulletTypefaceFollowText {} + +export const CT_TextBulletTypefaceFollowText_Attributes: Attributes = {}; + +export interface CT_TextNoBullet {} + +export const CT_TextNoBullet_Attributes: Attributes = {}; + +export type ST_TextAutonumberScheme = + | 'alphaLcParenBoth' + | 'alphaUcParenBoth' + | 'alphaLcParenR' + | 'alphaUcParenR' + | 'alphaLcPeriod' + | 'alphaUcPeriod' + | 'arabicParenBoth' + | 'arabicParenR' + | 'arabicPeriod' + | 'arabicPlain' + | 'romanLcParenBoth' + | 'romanUcParenBoth' + | 'romanLcParenR' + | 'romanUcParenR' + | 'romanLcPeriod' + | 'romanUcPeriod' + | 'circleNumDbPlain' + | 'circleNumWdBlackPlain' + | 'circleNumWdWhitePlain' + | 'arabicDbPeriod' + | 'arabicDbPlain' + | 'ea1ChsPeriod' + | 'ea1ChsPlain' + | 'ea1ChtPeriod' + | 'ea1ChtPlain' + | 'ea1JpnChsDbPeriod' + | 'ea1JpnKorPlain' + | 'ea1JpnKorPeriod' + | 'arabic1Minus' + | 'arabic2Minus' + | 'hebrew2Minus' + | 'thaiAlphaPeriod' + | 'thaiAlphaParenR' + | 'thaiAlphaParenBoth' + | 'thaiNumPeriod' + | 'thaiNumParenR' + | 'thaiNumParenBoth' + | 'hindiAlphaPeriod' + | 'hindiNumPeriod' + | 'hindiNumParenR' + | 'hindiAlpha1Period'; + +export type ST_TextBulletStartAtNum = number; + +export interface CT_TextAutonumberBullet { + type?: ST_TextAutonumberScheme; + startAt?: number; +} + +export const CT_TextAutonumberBullet_Attributes: Attributes = { + type: { + type: 'string' + }, + startAt: { + type: 'int' + } +}; + +export interface CT_TextCharBullet { + char?: string; +} + +export const CT_TextCharBullet_Attributes: Attributes = { + char: { + type: 'string' + } +}; + +export interface CT_TextBlipBullet { + blip?: CT_Blip; +} + +export const CT_TextBlipBullet_Attributes: Attributes = { + blip: { + type: 'child', + childAttributes: CT_Blip_Attributes + } +}; + +export type ST_TextTabAlignType = 'l' | 'ctr' | 'r' | 'dec'; + +export interface CT_TextTabStop { + pos?: ST_Coordinate32; + algn?: ST_TextTabAlignType; +} + +export const CT_TextTabStop_Attributes: Attributes = { + pos: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_TextTabStopList { + tab?: CT_TextTabStop[]; +} + +export const CT_TextTabStopList_Attributes: Attributes = { + tab: { + type: 'child', + childAttributes: CT_TextTabStop_Attributes, + childIsArray: true + } +}; + +export interface CT_TextUnderlineLineFollowText {} + +export const CT_TextUnderlineLineFollowText_Attributes: Attributes = {}; + +export interface CT_TextUnderlineFillFollowText {} + +export const CT_TextUnderlineFillFollowText_Attributes: Attributes = {}; + +export interface CT_TextUnderlineFillGroupWrapper {} + +export const CT_TextUnderlineFillGroupWrapper_Attributes: Attributes = {}; + +export interface CT_Boolean { + val?: ST_OnOff; +} + +export const CT_Boolean_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextUnderlineType = + | 'none' + | 'words' + | 'sng' + | 'dbl' + | 'heavy' + | 'dotted' + | 'dottedHeavy' + | 'dash' + | 'dashHeavy' + | 'dashLong' + | 'dashLongHeavy' + | 'dotDash' + | 'dotDashHeavy' + | 'dotDotDash' + | 'dotDotDashHeavy' + | 'wavy' + | 'wavyHeavy' + | 'wavyDbl'; + +export type ST_TextStrikeType = 'noStrike' | 'sngStrike' | 'dblStrike'; + +export type ST_TextNonNegativePoint = number; + +export type ST_TextCapsType = 'none' | 'small' | 'all'; + +export type ST_TextPoint = ST_TextPointUnqualified | ST_UniversalMeasure; + +export interface CT_TextCharacterProperties { + ln?: CT_LineProperties; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + highlight?: CT_Color; + uLnTx?: CT_TextUnderlineLineFollowText[]; + uLn?: CT_LineProperties; + uFillTx?: CT_TextUnderlineFillFollowText[]; + uFill?: CT_TextUnderlineFillGroupWrapper[]; + latin?: CT_TextFont; + ea?: CT_TextFont; + cs?: CT_TextFont; + sym?: CT_TextFont; + hlinkClick?: CT_Hyperlink; + hlinkMouseOver?: CT_Hyperlink; + rtl?: CT_Boolean[]; + extLst?: CT_OfficeArtExtensionList; + kumimoji?: boolean; + lang?: string; + altLang?: string; + sz?: number; + b?: boolean; + i?: boolean; + u?: ST_TextUnderlineType; + strike?: ST_TextStrikeType; + kern?: number; + cap?: ST_TextCapsType; + spc?: ST_TextPoint; + normalizeH?: boolean; + baseline?: string; + noProof?: boolean; + dirty?: boolean; + err?: boolean; + smtClean?: boolean; + smtId?: number; + bmk?: string; +} + +export const CT_TextCharacterProperties_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + highlight: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + uLnTx: { + type: 'child', + childAttributes: CT_TextUnderlineLineFollowText_Attributes, + childIsArray: true + }, + uLn: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + uFillTx: { + type: 'child', + childAttributes: CT_TextUnderlineFillFollowText_Attributes, + childIsArray: true + }, + uFill: { + type: 'child', + childAttributes: CT_TextUnderlineFillGroupWrapper_Attributes, + childIsArray: true + }, + latin: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + ea: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + cs: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + sym: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + hlinkClick: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + hlinkMouseOver: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + rtl: { + type: 'child', + childAttributes: CT_Boolean_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + kumimoji: { + type: 'boolean' + }, + lang: { + type: 'string' + }, + altLang: { + type: 'string' + }, + sz: { + type: 'int' + }, + b: { + type: 'boolean' + }, + i: { + type: 'boolean' + }, + u: { + type: 'string' + }, + strike: { + type: 'string' + }, + kern: { + type: 'int' + }, + cap: { + type: 'string' + }, + spc: { + type: 'string' + }, + normalizeH: { + type: 'boolean' + }, + baseline: { + type: 'string' + }, + noProof: { + type: 'boolean' + }, + dirty: { + type: 'boolean' + }, + err: { + type: 'boolean' + }, + smtClean: { + type: 'boolean' + }, + smtId: { + type: 'int' + }, + bmk: { + type: 'string' + } +}; + +export type ST_TextMargin = ST_Coordinate32Unqualified; + +export type ST_TextIndentLevelType = number; + +export type ST_TextIndent = ST_Coordinate32Unqualified; + +export type ST_TextAlignType = + | 'l' + | 'ctr' + | 'r' + | 'just' + | 'justLow' + | 'dist' + | 'thaiDist'; + +export type ST_TextFontAlignType = 'auto' | 't' | 'ctr' | 'base' | 'b'; + +export interface CT_TextParagraphProperties { + lnSpc?: CT_TextSpacing; + spcBef?: CT_TextSpacing; + spcAft?: CT_TextSpacing; + buClrTx?: CT_TextBulletColorFollowText; + buClr?: CT_Color; + buSzTx?: CT_TextBulletSizeFollowText[]; + buSzPct?: CT_TextBulletSizePercent[]; + buSzPts?: CT_TextBulletSizePoint[]; + buFontTx?: CT_TextBulletTypefaceFollowText[]; + buFont?: CT_TextFont[]; + buNone?: CT_TextNoBullet[]; + buAutoNum?: CT_TextAutonumberBullet[]; + buChar?: CT_TextCharBullet[]; + buBlip?: CT_TextBlipBullet[]; + tabLst?: CT_TextTabStopList; + defRPr?: CT_TextCharacterProperties; + extLst?: CT_OfficeArtExtensionList; + marL?: number; + marR?: number; + lvl?: number; + indent?: number; + algn?: ST_TextAlignType; + defTabSz?: ST_Coordinate32; + rtl?: boolean; + eaLnBrk?: boolean; + fontAlgn?: ST_TextFontAlignType; + latinLnBrk?: boolean; + hangingPunct?: boolean; +} + +export const CT_TextParagraphProperties_Attributes: Attributes = { + lnSpc: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + spcBef: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + spcAft: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + buClrTx: { + type: 'child', + childAttributes: CT_TextBulletColorFollowText_Attributes + }, + buClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + buSzTx: { + type: 'child', + childAttributes: CT_TextBulletSizeFollowText_Attributes, + childIsArray: true + }, + buSzPct: { + type: 'child', + childAttributes: CT_TextBulletSizePercent_Attributes, + childIsArray: true + }, + buSzPts: { + type: 'child', + childAttributes: CT_TextBulletSizePoint_Attributes, + childIsArray: true + }, + buFontTx: { + type: 'child', + childAttributes: CT_TextBulletTypefaceFollowText_Attributes, + childIsArray: true + }, + buFont: { + type: 'child', + childAttributes: CT_TextFont_Attributes, + childIsArray: true + }, + buNone: { + type: 'child', + childAttributes: CT_TextNoBullet_Attributes, + childIsArray: true + }, + buAutoNum: { + type: 'child', + childAttributes: CT_TextAutonumberBullet_Attributes, + childIsArray: true + }, + buChar: { + type: 'child', + childAttributes: CT_TextCharBullet_Attributes, + childIsArray: true + }, + buBlip: { + type: 'child', + childAttributes: CT_TextBlipBullet_Attributes, + childIsArray: true + }, + tabLst: { + type: 'child', + childAttributes: CT_TextTabStopList_Attributes + }, + defRPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + marL: { + type: 'int' + }, + marR: { + type: 'int' + }, + lvl: { + type: 'int' + }, + indent: { + type: 'int' + }, + algn: { + type: 'string' + }, + defTabSz: { + type: 'string' + }, + rtl: { + type: 'boolean' + }, + eaLnBrk: { + type: 'boolean' + }, + fontAlgn: { + type: 'string' + }, + latinLnBrk: { + type: 'boolean' + }, + hangingPunct: { + type: 'boolean' + } +}; + +export interface CT_TextListStyle { + defPPr?: CT_TextParagraphProperties; + lvl1pPr?: CT_TextParagraphProperties; + lvl2pPr?: CT_TextParagraphProperties; + lvl3pPr?: CT_TextParagraphProperties; + lvl4pPr?: CT_TextParagraphProperties; + lvl5pPr?: CT_TextParagraphProperties; + lvl6pPr?: CT_TextParagraphProperties; + lvl7pPr?: CT_TextParagraphProperties; + lvl8pPr?: CT_TextParagraphProperties; + lvl9pPr?: CT_TextParagraphProperties; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_TextListStyle_Attributes: Attributes = { + defPPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl1pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl2pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl3pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl4pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl5pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl6pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl7pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl8pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl9pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_RegularTextRun { + rPr?: CT_TextCharacterProperties; + t?: string; +} + +export const CT_RegularTextRun_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + t: { + type: 'string' + } +}; + +export interface CT_TextLineBreak { + rPr?: CT_TextCharacterProperties; +} + +export const CT_TextLineBreak_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + } +}; + +export interface CT_TextField { + rPr?: CT_TextCharacterProperties; + pPr?: CT_TextParagraphProperties; + t?: string; + id?: string; + type?: string; +} + +export const CT_TextField_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + t: { + type: 'string' + }, + id: { + type: 'string' + }, + type: { + type: 'string' + } +}; + +export interface CT_TextParagraph { + pPr?: CT_TextParagraphProperties; + r?: CT_RegularTextRun[]; + br?: CT_TextLineBreak[]; + fld?: CT_TextField[]; + endParaRPr?: CT_TextCharacterProperties; +} + +export const CT_TextParagraph_Attributes: Attributes = { + pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + r: { + type: 'child', + childAttributes: CT_RegularTextRun_Attributes, + childIsArray: true + }, + br: { + type: 'child', + childAttributes: CT_TextLineBreak_Attributes, + childIsArray: true + }, + fld: { + type: 'child', + childAttributes: CT_TextField_Attributes, + childIsArray: true + }, + endParaRPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + } +}; + +export interface CT_TextBody { + bodyPr?: CT_TextBodyProperties; + lstStyle?: CT_TextListStyle; + p?: CT_TextParagraph[]; +} + +export const CT_TextBody_Attributes: Attributes = { + bodyPr: { + type: 'child', + childAttributes: CT_TextBodyProperties_Attributes + }, + lstStyle: { + type: 'child', + childAttributes: CT_TextListStyle_Attributes + }, + p: { + type: 'child', + childAttributes: CT_TextParagraph_Attributes, + childIsArray: true + } +}; + +export interface CT_GvmlTextShape { + txBody?: CT_TextBody; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlTextShape_Attributes: Attributes = { + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvSpPr?: CT_NonVisualDrawingShapeProps; +} + +export const CT_GvmlShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvSpPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingShapeProps_Attributes + } +}; + +export type ST_AdjCoordinate = ST_Coordinate | ST_GeomGuideName; + +export interface CT_AdjPoint2D { + x?: ST_AdjCoordinate; + y?: ST_AdjCoordinate; +} + +export const CT_AdjPoint2D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + } +}; + +export interface CT_XYAdjustHandle { + pos?: CT_AdjPoint2D; + gdRefX?: string; + minX?: ST_AdjCoordinate; + maxX?: ST_AdjCoordinate; + gdRefY?: string; + minY?: ST_AdjCoordinate; + maxY?: ST_AdjCoordinate; +} + +export const CT_XYAdjustHandle_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + gdRefX: { + type: 'string' + }, + minX: { + type: 'string' + }, + maxX: { + type: 'string' + }, + gdRefY: { + type: 'string' + }, + minY: { + type: 'string' + }, + maxY: { + type: 'string' + } +}; + +export type ST_AdjAngle = ST_Angle | ST_GeomGuideName; + +export interface CT_PolarAdjustHandle { + pos?: CT_AdjPoint2D; + gdRefR?: string; + minR?: ST_AdjCoordinate; + maxR?: ST_AdjCoordinate; + gdRefAng?: string; + minAng?: ST_AdjAngle; + maxAng?: ST_AdjAngle; +} + +export const CT_PolarAdjustHandle_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + gdRefR: { + type: 'string' + }, + minR: { + type: 'string' + }, + maxR: { + type: 'string' + }, + gdRefAng: { + type: 'string' + }, + minAng: { + type: 'string' + }, + maxAng: { + type: 'string' + } +}; + +export interface CT_AdjustHandleList { + ahXY?: CT_XYAdjustHandle; + ahPolar?: CT_PolarAdjustHandle; +} + +export const CT_AdjustHandleList_Attributes: Attributes = { + ahXY: { + type: 'child', + childAttributes: CT_XYAdjustHandle_Attributes + }, + ahPolar: { + type: 'child', + childAttributes: CT_PolarAdjustHandle_Attributes + } +}; + +export interface CT_ConnectionSite { + pos?: CT_AdjPoint2D; + ang?: ST_AdjAngle; +} + +export const CT_ConnectionSite_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + ang: { + type: 'string' + } +}; + +export interface CT_ConnectionSiteList { + cxn?: CT_ConnectionSite[]; +} + +export const CT_ConnectionSiteList_Attributes: Attributes = { + cxn: { + type: 'child', + childAttributes: CT_ConnectionSite_Attributes, + childIsArray: true + } +}; + +export interface CT_GeomRect { + l?: ST_AdjCoordinate; + t?: ST_AdjCoordinate; + r?: ST_AdjCoordinate; + b?: ST_AdjCoordinate; +} + +export const CT_GeomRect_Attributes: Attributes = { + l: { + type: 'string' + }, + t: { + type: 'string' + }, + r: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export interface CT_Path2DClose {} + +export const CT_Path2DClose_Attributes: Attributes = {}; + +export interface CT_Path2DMoveTo { + pt?: CT_AdjPoint2D; +} + +export const CT_Path2DMoveTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + } +}; + +export interface CT_Path2DLineTo { + pt?: CT_AdjPoint2D; +} + +export const CT_Path2DLineTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + } +}; + +export interface CT_Path2DArcTo { + wR?: ST_AdjCoordinate; + hR?: ST_AdjCoordinate; + stAng?: ST_AdjAngle; + swAng?: ST_AdjAngle; +} + +export const CT_Path2DArcTo_Attributes: Attributes = { + wR: { + type: 'string' + }, + hR: { + type: 'string' + }, + stAng: { + type: 'string' + }, + swAng: { + type: 'string' + } +}; + +export interface CT_Path2DQuadBezierTo { + pt?: CT_AdjPoint2D[]; +} + +export const CT_Path2DQuadBezierTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes, + childIsArray: true + } +}; + +export interface CT_Path2DCubicBezierTo { + pt?: CT_AdjPoint2D[]; +} + +export const CT_Path2DCubicBezierTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes, + childIsArray: true + } +}; + +export type ST_PathFillMode = + | 'none' + | 'norm' + | 'lighten' + | 'lightenLess' + | 'darken' + | 'darkenLess'; + +export interface CT_Path2D { + close?: CT_Path2DClose; + moveTo?: CT_Path2DMoveTo; + lnTo?: CT_Path2DLineTo; + arcTo?: CT_Path2DArcTo; + quadBezTo?: CT_Path2DQuadBezierTo; + cubicBezTo?: CT_Path2DCubicBezierTo; + w?: number; + h?: number; + fill?: ST_PathFillMode; + stroke?: boolean; + extrusionOk?: boolean; +} + +export const CT_Path2D_Attributes: Attributes = { + close: { + type: 'child', + childAttributes: CT_Path2DClose_Attributes + }, + moveTo: { + type: 'child', + childAttributes: CT_Path2DMoveTo_Attributes + }, + lnTo: { + type: 'child', + childAttributes: CT_Path2DLineTo_Attributes + }, + arcTo: { + type: 'child', + childAttributes: CT_Path2DArcTo_Attributes + }, + quadBezTo: { + type: 'child', + childAttributes: CT_Path2DQuadBezierTo_Attributes + }, + cubicBezTo: { + type: 'child', + childAttributes: CT_Path2DCubicBezierTo_Attributes + }, + w: { + type: 'int' + }, + h: { + type: 'int' + }, + fill: { + type: 'string' + }, + stroke: { + type: 'boolean' + }, + extrusionOk: { + type: 'boolean' + } +}; + +export interface CT_Path2DList { + path?: CT_Path2D[]; +} + +export const CT_Path2DList_Attributes: Attributes = { + path: { + type: 'child', + childAttributes: CT_Path2D_Attributes, + childIsArray: true + } +}; + +export interface CT_CustomGeometry2D { + avLst?: CT_GeomGuideList; + gdLst?: CT_GeomGuideList; + ahLst?: CT_AdjustHandleList; + cxnLst?: CT_ConnectionSiteList; + rect?: CT_GeomRect; + pathLst?: CT_Path2DList; +} + +export const CT_CustomGeometry2D_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + gdLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + ahLst: { + type: 'child', + childAttributes: CT_AdjustHandleList_Attributes + }, + cxnLst: { + type: 'child', + childAttributes: CT_ConnectionSiteList_Attributes + }, + rect: { + type: 'child', + childAttributes: CT_GeomRect_Attributes + }, + pathLst: { + type: 'child', + childAttributes: CT_Path2DList_Attributes + } +}; + +export type ST_ShapeType = + | 'line' + | 'lineInv' + | 'triangle' + | 'rtTriangle' + | 'rect' + | 'diamond' + | 'parallelogram' + | 'trapezoid' + | 'nonIsoscelesTrapezoid' + | 'pentagon' + | 'hexagon' + | 'heptagon' + | 'octagon' + | 'decagon' + | 'dodecagon' + | 'star4' + | 'star5' + | 'star6' + | 'star7' + | 'star8' + | 'star10' + | 'star12' + | 'star16' + | 'star24' + | 'star32' + | 'roundRect' + | 'round1Rect' + | 'round2SameRect' + | 'round2DiagRect' + | 'snipRoundRect' + | 'snip1Rect' + | 'snip2SameRect' + | 'snip2DiagRect' + | 'plaque' + | 'ellipse' + | 'teardrop' + | 'homePlate' + | 'chevron' + | 'pieWedge' + | 'pie' + | 'blockArc' + | 'donut' + | 'noSmoking' + | 'rightArrow' + | 'leftArrow' + | 'upArrow' + | 'downArrow' + | 'stripedRightArrow' + | 'notchedRightArrow' + | 'bentUpArrow' + | 'leftRightArrow' + | 'upDownArrow' + | 'leftUpArrow' + | 'leftRightUpArrow' + | 'quadArrow' + | 'leftArrowCallout' + | 'rightArrowCallout' + | 'upArrowCallout' + | 'downArrowCallout' + | 'leftRightArrowCallout' + | 'upDownArrowCallout' + | 'quadArrowCallout' + | 'bentArrow' + | 'uturnArrow' + | 'circularArrow' + | 'leftCircularArrow' + | 'leftRightCircularArrow' + | 'curvedRightArrow' + | 'curvedLeftArrow' + | 'curvedUpArrow' + | 'curvedDownArrow' + | 'swooshArrow' + | 'cube' + | 'can' + | 'lightningBolt' + | 'heart' + | 'sun' + | 'moon' + | 'smileyFace' + | 'irregularSeal1' + | 'irregularSeal2' + | 'foldedCorner' + | 'bevel' + | 'frame' + | 'halfFrame' + | 'corner' + | 'diagStripe' + | 'chord' + | 'arc' + | 'leftBracket' + | 'rightBracket' + | 'leftBrace' + | 'rightBrace' + | 'bracketPair' + | 'bracePair' + | 'straightConnector1' + | 'bentConnector2' + | 'bentConnector3' + | 'bentConnector4' + | 'bentConnector5' + | 'curvedConnector2' + | 'curvedConnector3' + | 'curvedConnector4' + | 'curvedConnector5' + | 'callout1' + | 'callout2' + | 'callout3' + | 'accentCallout1' + | 'accentCallout2' + | 'accentCallout3' + | 'borderCallout1' + | 'borderCallout2' + | 'borderCallout3' + | 'accentBorderCallout1' + | 'accentBorderCallout2' + | 'accentBorderCallout3' + | 'wedgeRectCallout' + | 'wedgeRoundRectCallout' + | 'wedgeEllipseCallout' + | 'cloudCallout' + | 'cloud' + | 'ribbon' + | 'ribbon2' + | 'ellipseRibbon' + | 'ellipseRibbon2' + | 'leftRightRibbon' + | 'verticalScroll' + | 'horizontalScroll' + | 'wave' + | 'doubleWave' + | 'plus' + | 'flowChartProcess' + | 'flowChartDecision' + | 'flowChartInputOutput' + | 'flowChartPredefinedProcess' + | 'flowChartInternalStorage' + | 'flowChartDocument' + | 'flowChartMultidocument' + | 'flowChartTerminator' + | 'flowChartPreparation' + | 'flowChartManualInput' + | 'flowChartManualOperation' + | 'flowChartConnector' + | 'flowChartPunchedCard' + | 'flowChartPunchedTape' + | 'flowChartSummingJunction' + | 'flowChartOr' + | 'flowChartCollate' + | 'flowChartSort' + | 'flowChartExtract' + | 'flowChartMerge' + | 'flowChartOfflineStorage' + | 'flowChartOnlineStorage' + | 'flowChartMagneticTape' + | 'flowChartMagneticDisk' + | 'flowChartMagneticDrum' + | 'flowChartDisplay' + | 'flowChartDelay' + | 'flowChartAlternateProcess' + | 'flowChartOffpageConnector' + | 'actionButtonBlank' + | 'actionButtonHome' + | 'actionButtonHelp' + | 'actionButtonInformation' + | 'actionButtonForwardNext' + | 'actionButtonBackPrevious' + | 'actionButtonEnd' + | 'actionButtonBeginning' + | 'actionButtonReturn' + | 'actionButtonDocument' + | 'actionButtonSound' + | 'actionButtonMovie' + | 'gear6' + | 'gear9' + | 'funnel' + | 'mathPlus' + | 'mathMinus' + | 'mathMultiply' + | 'mathDivide' + | 'mathEqual' + | 'mathNotEqual' + | 'cornerTabs' + | 'squareTabs' + | 'plaqueTabs' + | 'chartX' + | 'chartStar' + | 'chartPlus'; + +export interface CT_PresetGeometry2D { + avLst?: CT_GeomGuideList; + prst?: ST_ShapeType; +} + +export const CT_PresetGeometry2D_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_ShapeProperties { + xfrm?: CT_Transform2D; + custGeom?: CT_CustomGeometry2D; + prstGeom?: CT_PresetGeometry2D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + ln?: CT_LineProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; + extLst?: CT_OfficeArtExtensionList; + bwMode?: ST_BlackWhiteMode; +} + +export const CT_ShapeProperties_Attributes: Attributes = { + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + custGeom: { + type: 'child', + childAttributes: CT_CustomGeometry2D_Attributes + }, + prstGeom: { + type: 'child', + childAttributes: CT_PresetGeometry2D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bwMode: { + type: 'string' + } +}; + +export interface CT_StyleMatrixReference { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + idx?: number; +} + +export const CT_StyleMatrixReference_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + idx: { + type: 'int' + } +}; + +export interface CT_FontReference { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + idx?: ST_FontCollectionIndex; +} + +export const CT_FontReference_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + idx: { + type: 'string' + } +}; + +export interface CT_ShapeStyle { + lnRef?: CT_StyleMatrixReference; + fillRef?: CT_StyleMatrixReference; + effectRef?: CT_StyleMatrixReference; + fontRef?: CT_FontReference; +} + +export const CT_ShapeStyle_Attributes: Attributes = { + lnRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + effectRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + fontRef: { + type: 'child', + childAttributes: CT_FontReference_Attributes + } +}; + +export interface CT_GvmlShape { + nvSpPr?: CT_GvmlShapeNonVisual; + spPr?: CT_ShapeProperties; + txSp?: CT_GvmlTextShape; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlShape_Attributes: Attributes = { + nvSpPr: { + type: 'child', + childAttributes: CT_GvmlShapeNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txSp: { + type: 'child', + childAttributes: CT_GvmlTextShape_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlConnectorNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvCxnSpPr?: CT_NonVisualConnectorProperties; +} + +export const CT_GvmlConnectorNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvCxnSpPr: { + type: 'child', + childAttributes: CT_NonVisualConnectorProperties_Attributes + } +}; + +export interface CT_GvmlConnector { + nvCxnSpPr?: CT_GvmlConnectorNonVisual; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlConnector_Attributes: Attributes = { + nvCxnSpPr: { + type: 'child', + childAttributes: CT_GvmlConnectorNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlPictureNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvPicPr?: CT_NonVisualPictureProperties; +} + +export const CT_GvmlPictureNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvPicPr: { + type: 'child', + childAttributes: CT_NonVisualPictureProperties_Attributes + } +}; + +export interface CT_GvmlPicture { + nvPicPr?: CT_GvmlPictureNonVisual; + blipFill?: CT_BlipFillProperties; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlPicture_Attributes: Attributes = { + nvPicPr: { + type: 'child', + childAttributes: CT_GvmlPictureNonVisual_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlGraphicFrameNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGraphicFramePr?: CT_NonVisualGraphicFrameProperties; +} + +export const CT_GvmlGraphicFrameNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGraphicFramePr: { + type: 'child', + childAttributes: CT_NonVisualGraphicFrameProperties_Attributes + } +}; + +export interface CT_GvmlGraphicalObjectFrame { + nvGraphicFramePr?: CT_GvmlGraphicFrameNonVisual; + xfrm?: CT_Transform2D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlGraphicalObjectFrame_Attributes: Attributes = { + nvGraphicFramePr: { + type: 'child', + childAttributes: CT_GvmlGraphicFrameNonVisual_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlGroupShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGrpSpPr?: CT_NonVisualGroupDrawingShapeProps; +} + +export const CT_GvmlGroupShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGrpSpPr: { + type: 'child', + childAttributes: CT_NonVisualGroupDrawingShapeProps_Attributes + } +}; + +export interface CT_GroupShapeProperties { + xfrm?: CT_GroupTransform2D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + extLst?: CT_OfficeArtExtensionList; + bwMode?: ST_BlackWhiteMode; +} + +export const CT_GroupShapeProperties_Attributes: Attributes = { + xfrm: { + type: 'child', + childAttributes: CT_GroupTransform2D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bwMode: { + type: 'string' + } +}; + +export interface CT_GvmlGroupShape { + nvGrpSpPr?: CT_GvmlGroupShapeNonVisual; + grpSpPr?: CT_GroupShapeProperties; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlGroupShape_Attributes: Attributes = { + nvGrpSpPr: { + type: 'child', + childAttributes: CT_GvmlGroupShapeNonVisual_Attributes + }, + grpSpPr: { + type: 'child', + childAttributes: CT_GroupShapeProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_AlphaBiLevelEffect { + thresh?: ST_PositiveFixedPercentage; +} + +export const CT_AlphaBiLevelEffect_Attributes: Attributes = { + thresh: { + type: 'string' + } +}; + +export interface CT_AlphaCeilingEffect {} + +export const CT_AlphaCeilingEffect_Attributes: Attributes = {}; + +export interface CT_AlphaFloorEffect {} + +export const CT_AlphaFloorEffect_Attributes: Attributes = {}; + +export interface CT_AlphaInverseEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_AlphaInverseEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_AlphaModulateFixedEffect { + amt?: ST_PositivePercentage; +} + +export const CT_AlphaModulateFixedEffect_Attributes: Attributes = { + amt: { + type: 'string' + } +}; + +export interface CT_AlphaOutsetEffect { + rad?: ST_Coordinate; +} + +export const CT_AlphaOutsetEffect_Attributes: Attributes = { + rad: { + type: 'string' + } +}; + +export interface CT_AlphaReplaceEffect { + a?: ST_PositiveFixedPercentage; +} + +export const CT_AlphaReplaceEffect_Attributes: Attributes = { + a: { + type: 'string' + } +}; + +export interface CT_BiLevelEffect { + thresh?: ST_PositiveFixedPercentage; +} + +export const CT_BiLevelEffect_Attributes: Attributes = { + thresh: { + type: 'string' + } +}; + +export interface CT_ColorChangeEffect { + clrFrom?: CT_Color; + clrTo?: CT_Color; + useA?: boolean; +} + +export const CT_ColorChangeEffect_Attributes: Attributes = { + clrFrom: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + clrTo: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + useA: { + type: 'boolean' + } +}; + +export interface CT_ColorReplaceEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_ColorReplaceEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_DuotoneEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_DuotoneEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_GrayscaleEffect {} + +export const CT_GrayscaleEffect_Attributes: Attributes = {}; + +export interface CT_HSLEffect { + hue?: number; + sat?: ST_FixedPercentage; + lum?: ST_FixedPercentage; +} + +export const CT_HSLEffect_Attributes: Attributes = { + hue: { + type: 'int' + }, + sat: { + type: 'string' + }, + lum: { + type: 'string' + } +}; + +export interface CT_LuminanceEffect { + bright?: ST_FixedPercentage; + contrast?: ST_FixedPercentage; +} + +export const CT_LuminanceEffect_Attributes: Attributes = { + bright: { + type: 'string' + }, + contrast: { + type: 'string' + } +}; + +export interface CT_RelativeOffsetEffect { + tx?: string; + ty?: string; +} + +export const CT_RelativeOffsetEffect_Attributes: Attributes = { + tx: { + type: 'string' + }, + ty: { + type: 'string' + } +}; + +export interface CT_TintEffect { + hue?: number; + amt?: ST_FixedPercentage; +} + +export const CT_TintEffect_Attributes: Attributes = { + hue: { + type: 'int' + }, + amt: { + type: 'string' + } +}; + +export interface CT_TransformEffect { + sx?: string; + sy?: string; + kx?: number; + ky?: number; + tx?: ST_Coordinate; + ty?: ST_Coordinate; +} + +export const CT_TransformEffect_Attributes: Attributes = { + sx: { + type: 'string' + }, + sy: { + type: 'string' + }, + kx: { + type: 'int' + }, + ky: { + type: 'int' + }, + tx: { + type: 'string' + }, + ty: { + type: 'string' + } +}; + +export interface CT_FillProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_FillEffect { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillEffect_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_EffectReference { + ref?: string; +} + +export const CT_EffectReference_Attributes: Attributes = { + ref: { + type: 'string' + } +}; + +export interface CT_AlphaModulateEffect { + cont?: CT_EffectContainer; +} + +export const CT_AlphaModulateEffect_Attributes: Attributes = { + cont: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_BlendEffect { + cont?: CT_EffectContainer; + blend?: ST_BlendMode; +} + +export const CT_BlendEffect_Attributes: Attributes = { + cont: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + blend: { + type: 'string' + } +}; + +export interface CT_EffectProperties { + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_EffectProperties_Attributes: Attributes = { + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export type ST_ShapeID = string; + +export interface CT_DefaultShapeDefinition { + spPr?: CT_ShapeProperties; + bodyPr?: CT_TextBodyProperties; + lstStyle?: CT_TextListStyle; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_DefaultShapeDefinition_Attributes: Attributes = { + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + bodyPr: { + type: 'child', + childAttributes: CT_TextBodyProperties_Attributes + }, + lstStyle: { + type: 'child', + childAttributes: CT_TextListStyle_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_ObjectStyleDefaults { + spDef?: CT_DefaultShapeDefinition; + lnDef?: CT_DefaultShapeDefinition; + txDef?: CT_DefaultShapeDefinition; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ObjectStyleDefaults_Attributes: Attributes = { + spDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + lnDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + txDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_EmptyElement {} + +export const CT_EmptyElement_Attributes: Attributes = {}; + +export interface CT_ColorMapping { + extLst?: CT_OfficeArtExtensionList; + bg1?: ST_ColorSchemeIndex; + tx1?: ST_ColorSchemeIndex; + bg2?: ST_ColorSchemeIndex; + tx2?: ST_ColorSchemeIndex; + accent1?: ST_ColorSchemeIndex; + accent2?: ST_ColorSchemeIndex; + accent3?: ST_ColorSchemeIndex; + accent4?: ST_ColorSchemeIndex; + accent5?: ST_ColorSchemeIndex; + accent6?: ST_ColorSchemeIndex; + hlink?: ST_ColorSchemeIndex; + folHlink?: ST_ColorSchemeIndex; +} + +export const CT_ColorMapping_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bg1: { + type: 'string' + }, + tx1: { + type: 'string' + }, + bg2: { + type: 'string' + }, + tx2: { + type: 'string' + }, + accent1: { + type: 'string' + }, + accent2: { + type: 'string' + }, + accent3: { + type: 'string' + }, + accent4: { + type: 'string' + }, + accent5: { + type: 'string' + }, + accent6: { + type: 'string' + }, + hlink: { + type: 'string' + }, + folHlink: { + type: 'string' + } +}; + +export interface CT_ColorMappingOverride {} + +export const CT_ColorMappingOverride_Attributes: Attributes = {}; + +export interface CT_ColorSchemeAndMapping { + clrScheme?: CT_ColorScheme; + clrMap?: CT_ColorMapping; +} + +export const CT_ColorSchemeAndMapping_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + clrMap: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + } +}; + +export interface CT_ColorSchemeList { + extraClrScheme?: CT_ColorSchemeAndMapping[]; +} + +export const CT_ColorSchemeList_Attributes: Attributes = { + extraClrScheme: { + type: 'child', + childAttributes: CT_ColorSchemeAndMapping_Attributes, + childIsArray: true + } +}; + +export interface CT_OfficeStyleSheet { + themeElements?: CT_BaseStyles; + objectDefaults?: CT_ObjectStyleDefaults; + extraClrSchemeLst?: CT_ColorSchemeList; + custClrLst?: CT_CustomColorList; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_OfficeStyleSheet_Attributes: Attributes = { + themeElements: { + type: 'child', + childAttributes: CT_BaseStyles_Attributes + }, + objectDefaults: { + type: 'child', + childAttributes: CT_ObjectStyleDefaults_Attributes + }, + extraClrSchemeLst: { + type: 'child', + childAttributes: CT_ColorSchemeList_Attributes + }, + custClrLst: { + type: 'child', + childAttributes: CT_CustomColorList_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_BaseStylesOverride { + clrScheme?: CT_ColorScheme; + fontScheme?: CT_FontScheme; + fmtScheme?: CT_StyleMatrix; +} + +export const CT_BaseStylesOverride_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + fontScheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + }, + fmtScheme: { + type: 'child', + childAttributes: CT_StyleMatrix_Attributes + } +}; + +export interface CT_ClipboardStyleSheet { + themeElements?: CT_BaseStyles; + clrMap?: CT_ColorMapping; +} + +export const CT_ClipboardStyleSheet_Attributes: Attributes = { + themeElements: { + type: 'child', + childAttributes: CT_BaseStyles_Attributes + }, + clrMap: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + } +}; + +export interface CT_Cell3D { + bevel?: CT_Bevel; + lightRig?: CT_LightRig; + extLst?: CT_OfficeArtExtensionList; + prstMaterial?: ST_PresetMaterialType; +} + +export const CT_Cell3D_Attributes: Attributes = { + bevel: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + lightRig: { + type: 'child', + childAttributes: CT_LightRig_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + prstMaterial: { + type: 'string' + } +}; + +export interface CT_Headers { + header?: string[][]; +} + +export const CT_Headers_Attributes: Attributes = { + header: { + type: 'string', + childIsArray: true + } +}; + +export interface CT_TableCellProperties { + lnL?: CT_LineProperties; + lnR?: CT_LineProperties; + lnT?: CT_LineProperties; + lnB?: CT_LineProperties; + lnTlToBr?: CT_LineProperties; + lnBlToTr?: CT_LineProperties; + cell3D?: CT_Cell3D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + headers?: CT_Headers[]; + extLst?: CT_OfficeArtExtensionList; + marL?: ST_Coordinate32; + marR?: ST_Coordinate32; + marT?: ST_Coordinate32; + marB?: ST_Coordinate32; + vert?: ST_TextVerticalType; + anchor?: ST_TextAnchoringType; + anchorCtr?: boolean; + horzOverflow?: ST_TextHorzOverflowType; +} + +export const CT_TableCellProperties_Attributes: Attributes = { + lnL: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnR: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnT: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnB: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnTlToBr: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnBlToTr: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + cell3D: { + type: 'child', + childAttributes: CT_Cell3D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + headers: { + type: 'child', + childAttributes: CT_Headers_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + marL: { + type: 'string' + }, + marR: { + type: 'string' + }, + marT: { + type: 'string' + }, + marB: { + type: 'string' + }, + vert: { + type: 'string' + }, + anchor: { + type: 'string' + }, + anchorCtr: { + type: 'boolean' + }, + horzOverflow: { + type: 'string' + } +}; + +export interface CT_TableCol { + extLst?: CT_OfficeArtExtensionList; + w?: ST_Coordinate; +} + +export const CT_TableCol_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + w: { + type: 'string' + } +}; + +export interface CT_TableGrid { + gridCol?: CT_TableCol[]; +} + +export const CT_TableGrid_Attributes: Attributes = { + gridCol: { + type: 'child', + childAttributes: CT_TableCol_Attributes, + childIsArray: true + } +}; + +export interface CT_TableCell { + txBody?: CT_TextBody; + tcPr?: CT_TableCellProperties; + extLst?: CT_OfficeArtExtensionList; + rowSpan?: number; + gridSpan?: number; + hMerge?: boolean; + vMerge?: boolean; + id?: string; +} + +export const CT_TableCell_Attributes: Attributes = { + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + tcPr: { + type: 'child', + childAttributes: CT_TableCellProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rowSpan: { + type: 'int' + }, + gridSpan: { + type: 'int' + }, + hMerge: { + type: 'boolean' + }, + vMerge: { + type: 'boolean' + }, + id: { + type: 'string' + } +}; + +export interface CT_TableRow { + tc?: CT_TableCell[]; + extLst?: CT_OfficeArtExtensionList; + h?: ST_Coordinate; +} + +export const CT_TableRow_Attributes: Attributes = { + tc: { + type: 'child', + childAttributes: CT_TableCell_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + h: { + type: 'string' + } +}; + +export interface CT_TableProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + extLst?: CT_OfficeArtExtensionList; + rtl?: boolean; + firstRow?: boolean; + firstCol?: boolean; + lastRow?: boolean; + lastCol?: boolean; + bandRow?: boolean; + bandCol?: boolean; +} + +export const CT_TableProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rtl: { + type: 'boolean' + }, + firstRow: { + type: 'boolean' + }, + firstCol: { + type: 'boolean' + }, + lastRow: { + type: 'boolean' + }, + lastCol: { + type: 'boolean' + }, + bandRow: { + type: 'boolean' + }, + bandCol: { + type: 'boolean' + } +}; + +export interface CT_Table { + tblPr?: CT_TableProperties; + tblGrid?: CT_TableGrid; + tr?: CT_TableRow[]; +} + +export const CT_Table_Attributes: Attributes = { + tblPr: { + type: 'child', + childAttributes: CT_TableProperties_Attributes + }, + tblGrid: { + type: 'child', + childAttributes: CT_TableGrid_Attributes + }, + tr: { + type: 'child', + childAttributes: CT_TableRow_Attributes, + childIsArray: true + } +}; + +export interface CT_ThemeableLineStyle { + ln?: CT_LineProperties; + lnRef?: CT_StyleMatrixReference; +} + +export const CT_ThemeableLineStyle_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + } +}; + +export type ST_OnOffStyleType = 'on' | 'off' | 'def'; + +export interface CT_TableStyleTextStyle { + font?: CT_FontCollection; + fontRef?: CT_FontReference; + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + extLst?: CT_OfficeArtExtensionList; + b?: ST_OnOffStyleType; + i?: ST_OnOffStyleType; +} + +export const CT_TableStyleTextStyle_Attributes: Attributes = { + font: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + fontRef: { + type: 'child', + childAttributes: CT_FontReference_Attributes + }, + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + b: { + type: 'string' + }, + i: { + type: 'string' + } +}; + +export interface CT_TableCellBorderStyle { + left?: CT_ThemeableLineStyle; + right?: CT_ThemeableLineStyle; + top?: CT_ThemeableLineStyle; + bottom?: CT_ThemeableLineStyle; + insideH?: CT_ThemeableLineStyle; + insideV?: CT_ThemeableLineStyle; + tl2br?: CT_ThemeableLineStyle; + tr2bl?: CT_ThemeableLineStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_TableCellBorderStyle_Attributes: Attributes = { + left: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + right: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + top: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + bottom: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + insideH: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + insideV: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + tl2br: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + tr2bl: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_TableBackgroundStyle { + fill?: CT_FillProperties; + fillRef?: CT_StyleMatrixReference; + effect?: CT_EffectProperties; + effectRef?: CT_StyleMatrixReference; +} + +export const CT_TableBackgroundStyle_Attributes: Attributes = { + fill: { + type: 'child', + childAttributes: CT_FillProperties_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + effect: { + type: 'child', + childAttributes: CT_EffectProperties_Attributes + }, + effectRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + } +}; + +export interface CT_TableStyleCellStyle { + tcBdr?: CT_TableCellBorderStyle; + fill?: CT_FillProperties; + fillRef?: CT_StyleMatrixReference; + cell3D?: CT_Cell3D; +} + +export const CT_TableStyleCellStyle_Attributes: Attributes = { + tcBdr: { + type: 'child', + childAttributes: CT_TableCellBorderStyle_Attributes + }, + fill: { + type: 'child', + childAttributes: CT_FillProperties_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + cell3D: { + type: 'child', + childAttributes: CT_Cell3D_Attributes + } +}; + +export interface CT_TablePartStyle { + tcTxStyle?: CT_TableStyleTextStyle; + tcStyle?: CT_TableStyleCellStyle; +} + +export const CT_TablePartStyle_Attributes: Attributes = { + tcTxStyle: { + type: 'child', + childAttributes: CT_TableStyleTextStyle_Attributes + }, + tcStyle: { + type: 'child', + childAttributes: CT_TableStyleCellStyle_Attributes + } +}; + +export interface CT_TableStyle { + tblBg?: CT_TableBackgroundStyle; + wholeTbl?: CT_TablePartStyle; + band1H?: CT_TablePartStyle; + band2H?: CT_TablePartStyle; + band1V?: CT_TablePartStyle; + band2V?: CT_TablePartStyle; + lastCol?: CT_TablePartStyle; + firstCol?: CT_TablePartStyle; + lastRow?: CT_TablePartStyle; + seCell?: CT_TablePartStyle; + swCell?: CT_TablePartStyle; + firstRow?: CT_TablePartStyle; + neCell?: CT_TablePartStyle; + nwCell?: CT_TablePartStyle; + extLst?: CT_OfficeArtExtensionList; + styleId?: string; + styleName?: string; +} + +export const CT_TableStyle_Attributes: Attributes = { + tblBg: { + type: 'child', + childAttributes: CT_TableBackgroundStyle_Attributes + }, + wholeTbl: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band1H: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band2H: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band1V: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + band2V: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + lastCol: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + firstCol: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + lastRow: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + seCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + swCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + firstRow: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + neCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + nwCell: { + type: 'child', + childAttributes: CT_TablePartStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + styleId: { + type: 'string' + }, + styleName: { + type: 'string' + } +}; + +export interface CT_TableStyleList { + tblStyle?: CT_TableStyle[]; + def?: string; +} + +export const CT_TableStyleList_Attributes: Attributes = { + tblStyle: { + type: 'child', + childAttributes: CT_TableStyle_Attributes, + childIsArray: true + }, + def: { + type: 'string' + } +}; + +export type ST_TextBulletSize = string; + +export type ST_TextPointUnqualified = number; diff --git a/packages/office-viewer/src/openxml/ExcelTypes.ts b/packages/office-viewer/src/openxml/ExcelTypes.ts new file mode 100644 index 000000000..4abfa35e7 --- /dev/null +++ b/packages/office-viewer/src/openxml/ExcelTypes.ts @@ -0,0 +1,20323 @@ +import {Attributes} from './Attributes'; + +import { + CT_ExtensionList, + CT_ExtensionList_Attributes +} from './../excel/types/CT_ExtensionList'; + +export type ST_Lang = string; + +export type ST_HexColorRGB = string; + +export type ST_Panose = string; + +export type ST_CalendarType = + | 'gregorian' + | 'gregorianUs' + | 'gregorianMeFrench' + | 'gregorianArabic' + | 'hijri' + | 'hebrew' + | 'taiwan' + | 'japan' + | 'thai' + | 'korea' + | 'saka' + | 'gregorianXlitEnglish' + | 'gregorianXlitFrench' + | 'none'; + +export type ST_Guid = string; + +export type ST_OnOff = boolean; + +export type ST_String = string; + +export type ST_XmlName = string; + +export type ST_UnsignedDecimalNumber = number; + +export type ST_TwipsMeasure = + | ST_UnsignedDecimalNumber + | ST_PositiveUniversalMeasure; + +export type ST_VerticalAlignRun = 'baseline' | 'superscript' | 'subscript'; + +export type ST_Xstring = string; + +export type ST_XAlign = 'left' | 'center' | 'right' | 'inside' | 'outside'; + +export type ST_YAlign = + | 'inline' + | 'top' + | 'center' + | 'bottom' + | 'inside' + | 'outside'; + +export type ST_ConformanceClass = 'strict' | 'transitional'; + +export type ST_UniversalMeasure = string; + +export type ST_PositiveUniversalMeasure = ST_UniversalMeasure; + +export type ST_Percentage = string; + +export type ST_FixedPercentage = string; + +export type ST_PositivePercentage = string; + +export type ST_PositiveFixedPercentage = string; + +export interface CT_OfficeArtExtension { + __any__?: any; + uri?: string; +} + +export const CT_OfficeArtExtension_Attributes: Attributes = { + __any__: { + type: 'any' + }, + uri: { + type: 'string' + } +}; + +export interface CT_OfficeArtExtensionList { + ext?: CT_OfficeArtExtension[]; +} + +export const CT_OfficeArtExtensionList_Attributes: Attributes = { + ext: { + type: 'child', + childAttributes: CT_OfficeArtExtension_Attributes, + childIsArray: true + } +}; + +export interface CT_AudioFile { + extLst?: CT_OfficeArtExtensionList; + contentType?: string; +} + +export const CT_AudioFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + contentType: { + type: 'string' + } +}; + +export interface CT_VideoFile { + extLst?: CT_OfficeArtExtensionList; + contentType?: string; +} + +export const CT_VideoFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + contentType: { + type: 'string' + } +}; + +export interface CT_QuickTimeFile { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_QuickTimeFile_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_AudioCDTime { + track?: number; + time?: number; +} + +export const CT_AudioCDTime_Attributes: Attributes = { + track: { + type: 'int' + }, + time: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_AudioCD { + st?: CT_AudioCDTime; + end?: CT_AudioCDTime; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_AudioCD_Attributes: Attributes = { + st: { + type: 'child', + childAttributes: CT_AudioCDTime_Attributes + }, + end: { + type: 'child', + childAttributes: CT_AudioCDTime_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_StyleMatrixColumnIndex = number; + +export type ST_FontCollectionIndex = 'major' | 'minor' | 'none'; + +export type ST_ColorSchemeIndex = + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink'; + +export interface CT_Color { + auto?: boolean; + indexed?: number; + rgb?: string; + theme?: number; + tint?: number; +} + +export const CT_Color_Attributes: Attributes = { + auto: { + type: 'boolean' + }, + indexed: { + type: 'int' + }, + rgb: { + type: 'string' + }, + theme: { + type: 'int' + }, + tint: { + type: 'double', + defaultValue: '0.0' + } +}; + +export interface CT_ColorScheme { + dk1?: CT_Color; + lt1?: CT_Color; + dk2?: CT_Color; + lt2?: CT_Color; + accent1?: CT_Color; + accent2?: CT_Color; + accent3?: CT_Color; + accent4?: CT_Color; + accent5?: CT_Color; + accent6?: CT_Color; + hlink?: CT_Color; + folHlink?: CT_Color; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_ColorScheme_Attributes: Attributes = { + dk1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + lt1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + dk2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + lt2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent1: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent2: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent3: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent4: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent5: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + accent6: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + hlink: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + folHlink: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_PositiveFixedPercentage { + val?: ST_PositiveFixedPercentage; +} + +export const CT_PositiveFixedPercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_ComplementTransform {} + +export const CT_ComplementTransform_Attributes: Attributes = {}; + +export interface CT_InverseTransform {} + +export const CT_InverseTransform_Attributes: Attributes = {}; + +export interface CT_GrayscaleTransform {} + +export const CT_GrayscaleTransform_Attributes: Attributes = {}; + +export interface CT_FixedPercentage { + val?: ST_FixedPercentage; +} + +export const CT_FixedPercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_PositivePercentage { + val?: ST_PositivePercentage; +} + +export const CT_PositivePercentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_PositiveFixedAngle = ST_Angle; + +export interface CT_PositiveFixedAngle { + val?: number; +} + +export const CT_PositiveFixedAngle_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export type ST_Angle = number; + +export interface CT_Angle { + val?: number; +} + +export const CT_Angle_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_Percentage { + val?: string; +} + +export const CT_Percentage_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_GammaTransform {} + +export const CT_GammaTransform_Attributes: Attributes = {}; + +export interface CT_InverseGammaTransform {} + +export const CT_InverseGammaTransform_Attributes: Attributes = {}; + +export interface CT_ScRgbColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + r?: string; + g?: string; + b?: string; +} + +export const CT_ScRgbColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + r: { + type: 'string' + }, + g: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export interface CT_SRgbColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: string; +} + +export const CT_SRgbColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export interface CT_HslColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: number; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: string; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: string; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; +} + +export const CT_HslColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'int' + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'string' + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'string' + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + } +}; + +export type ST_SystemColorVal = + | 'scrollBar' + | 'background' + | 'activeCaption' + | 'inactiveCaption' + | 'menu' + | 'window' + | 'windowFrame' + | 'menuText' + | 'windowText' + | 'captionText' + | 'activeBorder' + | 'inactiveBorder' + | 'appWorkspace' + | 'highlight' + | 'highlightText' + | 'btnFace' + | 'btnShadow' + | 'grayText' + | 'btnText' + | 'inactiveCaptionText' + | 'btnHighlight' + | '3dDkShadow' + | '3dLight' + | 'infoText' + | 'infoBk' + | 'hotLight' + | 'gradientActiveCaption' + | 'gradientInactiveCaption' + | 'menuHighlight' + | 'menuBar'; + +export interface CT_SystemColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_SystemColorVal; + lastClr?: string; +} + +export const CT_SystemColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + }, + lastClr: { + type: 'string' + } +}; + +export type ST_SchemeColorVal = + | 'bg1' + | 'tx1' + | 'bg2' + | 'tx2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink' + | 'phClr' + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2'; + +export interface CT_SchemeColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_SchemeColorVal; +} + +export const CT_SchemeColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export type ST_PresetColorVal = + | 'aliceBlue' + | 'antiqueWhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedAlmond' + | 'blue' + | 'blueViolet' + | 'brown' + | 'burlyWood' + | 'cadetBlue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerBlue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkBlue' + | 'darkCyan' + | 'darkGoldenrod' + | 'darkGray' + | 'darkGrey' + | 'darkGreen' + | 'darkKhaki' + | 'darkMagenta' + | 'darkOliveGreen' + | 'darkOrange' + | 'darkOrchid' + | 'darkRed' + | 'darkSalmon' + | 'darkSeaGreen' + | 'darkSlateBlue' + | 'darkSlateGray' + | 'darkSlateGrey' + | 'darkTurquoise' + | 'darkViolet' + | 'dkBlue' + | 'dkCyan' + | 'dkGoldenrod' + | 'dkGray' + | 'dkGrey' + | 'dkGreen' + | 'dkKhaki' + | 'dkMagenta' + | 'dkOliveGreen' + | 'dkOrange' + | 'dkOrchid' + | 'dkRed' + | 'dkSalmon' + | 'dkSeaGreen' + | 'dkSlateBlue' + | 'dkSlateGray' + | 'dkSlateGrey' + | 'dkTurquoise' + | 'dkViolet' + | 'deepPink' + | 'deepSkyBlue' + | 'dimGray' + | 'dimGrey' + | 'dodgerBlue' + | 'firebrick' + | 'floralWhite' + | 'forestGreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostWhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'grey' + | 'green' + | 'greenYellow' + | 'honeydew' + | 'hotPink' + | 'indianRed' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderBlush' + | 'lawnGreen' + | 'lemonChiffon' + | 'lightBlue' + | 'lightCoral' + | 'lightCyan' + | 'lightGoldenrodYellow' + | 'lightGray' + | 'lightGrey' + | 'lightGreen' + | 'lightPink' + | 'lightSalmon' + | 'lightSeaGreen' + | 'lightSkyBlue' + | 'lightSlateGray' + | 'lightSlateGrey' + | 'lightSteelBlue' + | 'lightYellow' + | 'ltBlue' + | 'ltCoral' + | 'ltCyan' + | 'ltGoldenrodYellow' + | 'ltGray' + | 'ltGrey' + | 'ltGreen' + | 'ltPink' + | 'ltSalmon' + | 'ltSeaGreen' + | 'ltSkyBlue' + | 'ltSlateGray' + | 'ltSlateGrey' + | 'ltSteelBlue' + | 'ltYellow' + | 'lime' + | 'limeGreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'medAquamarine' + | 'medBlue' + | 'medOrchid' + | 'medPurple' + | 'medSeaGreen' + | 'medSlateBlue' + | 'medSpringGreen' + | 'medTurquoise' + | 'medVioletRed' + | 'mediumAquamarine' + | 'mediumBlue' + | 'mediumOrchid' + | 'mediumPurple' + | 'mediumSeaGreen' + | 'mediumSlateBlue' + | 'mediumSpringGreen' + | 'mediumTurquoise' + | 'mediumVioletRed' + | 'midnightBlue' + | 'mintCream' + | 'mistyRose' + | 'moccasin' + | 'navajoWhite' + | 'navy' + | 'oldLace' + | 'olive' + | 'oliveDrab' + | 'orange' + | 'orangeRed' + | 'orchid' + | 'paleGoldenrod' + | 'paleGreen' + | 'paleTurquoise' + | 'paleVioletRed' + | 'papayaWhip' + | 'peachPuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderBlue' + | 'purple' + | 'red' + | 'rosyBrown' + | 'royalBlue' + | 'saddleBrown' + | 'salmon' + | 'sandyBrown' + | 'seaGreen' + | 'seaShell' + | 'sienna' + | 'silver' + | 'skyBlue' + | 'slateBlue' + | 'slateGray' + | 'slateGrey' + | 'snow' + | 'springGreen' + | 'steelBlue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whiteSmoke' + | 'yellow' + | 'yellowGreen'; + +export interface CT_PresetColor { + tint?: CT_PositiveFixedPercentage; + shade?: CT_PositiveFixedPercentage; + comp?: CT_ComplementTransform; + inv?: CT_InverseTransform; + gray?: CT_GrayscaleTransform; + alpha?: CT_PositiveFixedPercentage; + alphaOff?: CT_FixedPercentage; + alphaMod?: CT_PositivePercentage; + hue?: CT_PositiveFixedAngle; + hueOff?: CT_Angle; + hueMod?: CT_PositivePercentage; + sat?: CT_Percentage; + satOff?: CT_Percentage; + satMod?: CT_Percentage; + lum?: CT_Percentage; + lumOff?: CT_Percentage; + lumMod?: CT_Percentage; + red?: CT_Percentage; + redOff?: CT_Percentage; + redMod?: CT_Percentage; + green?: CT_Percentage; + greenOff?: CT_Percentage; + greenMod?: CT_Percentage; + blue?: CT_Percentage; + blueOff?: CT_Percentage; + blueMod?: CT_Percentage; + gamma?: CT_GammaTransform; + invGamma?: CT_InverseGammaTransform; + val?: ST_PresetColorVal; +} + +export const CT_PresetColor_Attributes: Attributes = { + tint: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + shade: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + comp: { + type: 'child', + childAttributes: CT_ComplementTransform_Attributes + }, + inv: { + type: 'child', + childAttributes: CT_InverseTransform_Attributes + }, + gray: { + type: 'child', + childAttributes: CT_GrayscaleTransform_Attributes + }, + alpha: { + type: 'child', + childAttributes: CT_PositiveFixedPercentage_Attributes + }, + alphaOff: { + type: 'child', + childAttributes: CT_FixedPercentage_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + hue: { + type: 'child', + childAttributes: CT_PositiveFixedAngle_Attributes + }, + hueOff: { + type: 'child', + childAttributes: CT_Angle_Attributes + }, + hueMod: { + type: 'child', + childAttributes: CT_PositivePercentage_Attributes + }, + sat: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + satMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + lumMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + red: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + redMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + green: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + greenMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blue: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueOff: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + blueMod: { + type: 'child', + childAttributes: CT_Percentage_Attributes + }, + gamma: { + type: 'child', + childAttributes: CT_GammaTransform_Attributes + }, + invGamma: { + type: 'child', + childAttributes: CT_InverseGammaTransform_Attributes + }, + val: { + type: 'string' + } +}; + +export interface CT_CustomColor { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + name?: string; +} + +export const CT_CustomColor_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + name: { + type: 'string' + } +}; + +export type ST_TextTypeface = string; + +export interface CT_SupplementalFont { + script?: string; + typeface?: string; +} + +export const CT_SupplementalFont_Attributes: Attributes = { + script: { + type: 'string' + }, + typeface: { + type: 'string' + } +}; + +export interface CT_CustomColorList { + custClr?: CT_CustomColor[]; +} + +export const CT_CustomColorList_Attributes: Attributes = { + custClr: { + type: 'child', + childAttributes: CT_CustomColor_Attributes, + childIsArray: true + } +}; + +export type ST_PitchFamily = number; + +export interface CT_TextFont { + typeface?: string; + panose?: string; + pitchFamily?: number; + charset?: number; +} + +export const CT_TextFont_Attributes: Attributes = { + typeface: { + type: 'string' + }, + panose: { + type: 'string' + }, + pitchFamily: { + type: 'int', + defaultValue: '0' + }, + charset: { + type: 'int', + defaultValue: '1' + } +}; + +export interface CT_FontCollection { + latin?: CT_TextFont; + ea?: CT_TextFont; + cs?: CT_TextFont; + font?: CT_SupplementalFont[]; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_FontCollection_Attributes: Attributes = { + latin: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + ea: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + cs: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + font: { + type: 'child', + childAttributes: CT_SupplementalFont_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type CT_EffectStyleItem = any; +export const CT_EffectStyleItem_Attributes: Attributes = {}; + +export type CT_EffectList = any; +export const CT_EffectList_Attributes: Attributes = {}; + +export type ST_PositiveCoordinate = number; + +export interface CT_BlurEffect { + rad?: number; + grow?: boolean; +} + +export const CT_BlurEffect_Attributes: Attributes = { + rad: { + type: 'int', + defaultValue: '0' + }, + grow: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type CT_FillOverlayEffect = any; +export const CT_FillOverlayEffect_Attributes: Attributes = {}; + +export interface CT_NoFillProperties {} + +export const CT_NoFillProperties_Attributes: Attributes = {}; + +export interface CT_SolidColorFillProperties { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_SolidColorFillProperties_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_GradientStop { + color?: CT_Color; + position?: number; +} + +export const CT_GradientStop_Attributes: Attributes = { + color: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + position: { + type: 'double' + } +}; + +export interface CT_GradientStopList { + gs?: CT_GradientStop[]; +} + +export const CT_GradientStopList_Attributes: Attributes = { + gs: { + type: 'child', + childAttributes: CT_GradientStop_Attributes, + childIsArray: true + } +}; + +export interface CT_LinearShadeProperties { + ang?: number; + scaled?: boolean; +} + +export const CT_LinearShadeProperties_Attributes: Attributes = { + ang: { + type: 'int' + }, + scaled: { + type: 'boolean' + } +}; + +export interface CT_RelativeRect { + l?: string; + t?: string; + r?: string; + b?: string; +} + +export const CT_RelativeRect_Attributes: Attributes = { + l: { + type: 'string', + defaultValue: '0%' + }, + t: { + type: 'string', + defaultValue: '0%' + }, + r: { + type: 'string', + defaultValue: '0%' + }, + b: { + type: 'string', + defaultValue: '0%' + } +}; + +export type ST_PathShadeType = 'shape' | 'circle' | 'rect'; + +export interface CT_PathShadeProperties { + fillToRect?: CT_RelativeRect; + path?: ST_PathShadeType; +} + +export const CT_PathShadeProperties_Attributes: Attributes = { + fillToRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + path: { + type: 'string' + } +}; + +export type ST_TileFlipMode = 'none' | 'x' | 'y' | 'xy'; + +export interface CT_GradientFillProperties { + gsLst?: CT_GradientStopList; + lin?: CT_LinearShadeProperties; + path?: CT_PathShadeProperties; + tileRect?: CT_RelativeRect; + flip?: ST_TileFlipMode; + rotWithShape?: boolean; +} + +export const CT_GradientFillProperties_Attributes: Attributes = { + gsLst: { + type: 'child', + childAttributes: CT_GradientStopList_Attributes + }, + lin: { + type: 'child', + childAttributes: CT_LinearShadeProperties_Attributes + }, + path: { + type: 'child', + childAttributes: CT_PathShadeProperties_Attributes + }, + tileRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + flip: { + type: 'string', + defaultValue: 'none' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export interface CT_AlphaBiLevelEffect { + thresh?: ST_PositiveFixedPercentage; +} + +export const CT_AlphaBiLevelEffect_Attributes: Attributes = { + thresh: { + type: 'string' + } +}; + +export interface CT_AlphaCeilingEffect {} + +export const CT_AlphaCeilingEffect_Attributes: Attributes = {}; + +export interface CT_AlphaFloorEffect {} + +export const CT_AlphaFloorEffect_Attributes: Attributes = {}; + +export interface CT_AlphaInverseEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_AlphaInverseEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export type ST_EffectContainerType = 'sib' | 'tree'; + +export interface CT_EffectContainer { + type?: ST_EffectContainerType; + name?: string; +} + +export const CT_EffectContainer_Attributes: Attributes = { + type: { + type: 'string', + defaultValue: 'sib' + }, + name: { + type: 'string' + } +}; + +export interface CT_AlphaModulateEffect { + cont?: CT_EffectContainer; +} + +export const CT_AlphaModulateEffect_Attributes: Attributes = { + cont: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_AlphaModulateFixedEffect { + amt?: ST_PositivePercentage; +} + +export const CT_AlphaModulateFixedEffect_Attributes: Attributes = { + amt: { + type: 'string', + defaultValue: '100%' + } +}; + +export interface CT_AlphaReplaceEffect { + a?: ST_PositiveFixedPercentage; +} + +export const CT_AlphaReplaceEffect_Attributes: Attributes = { + a: { + type: 'string' + } +}; + +export interface CT_BiLevelEffect { + thresh?: ST_PositiveFixedPercentage; +} + +export const CT_BiLevelEffect_Attributes: Attributes = { + thresh: { + type: 'string' + } +}; + +export interface CT_ColorChangeEffect { + clrFrom?: CT_Color; + clrTo?: CT_Color; + useA?: boolean; +} + +export const CT_ColorChangeEffect_Attributes: Attributes = { + clrFrom: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + clrTo: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + useA: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_ColorReplaceEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_ColorReplaceEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_DuotoneEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_DuotoneEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export interface CT_GrayscaleEffect {} + +export const CT_GrayscaleEffect_Attributes: Attributes = {}; + +export interface CT_HSLEffect { + hue?: number; + sat?: ST_FixedPercentage; + lum?: ST_FixedPercentage; +} + +export const CT_HSLEffect_Attributes: Attributes = { + hue: { + type: 'int', + defaultValue: '0' + }, + sat: { + type: 'string', + defaultValue: '0%' + }, + lum: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_LuminanceEffect { + bright?: ST_FixedPercentage; + contrast?: ST_FixedPercentage; +} + +export const CT_LuminanceEffect_Attributes: Attributes = { + bright: { + type: 'string', + defaultValue: '0%' + }, + contrast: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_TintEffect { + hue?: number; + amt?: ST_FixedPercentage; +} + +export const CT_TintEffect_Attributes: Attributes = { + hue: { + type: 'int', + defaultValue: '0' + }, + amt: { + type: 'string', + defaultValue: '0%' + } +}; + +export type ST_BlipCompression = + | 'email' + | 'screen' + | 'print' + | 'hqprint' + | 'none'; + +export interface CT_Blip { + alphaBiLevel?: CT_AlphaBiLevelEffect; + alphaCeiling?: CT_AlphaCeilingEffect; + alphaFloor?: CT_AlphaFloorEffect; + alphaInv?: CT_AlphaInverseEffect; + alphaMod?: CT_AlphaModulateEffect; + alphaModFix?: CT_AlphaModulateFixedEffect; + alphaRepl?: CT_AlphaReplaceEffect; + biLevel?: CT_BiLevelEffect; + blur?: CT_BlurEffect; + clrChange?: CT_ColorChangeEffect; + clrRepl?: CT_ColorReplaceEffect; + duotone?: CT_DuotoneEffect; + fillOverlay?: CT_FillOverlayEffect; + grayscl?: CT_GrayscaleEffect; + hsl?: CT_HSLEffect; + lum?: CT_LuminanceEffect; + tint?: CT_TintEffect; + extLst?: CT_OfficeArtExtensionList; + cstate?: ST_BlipCompression; +} + +export const CT_Blip_Attributes: Attributes = { + alphaBiLevel: { + type: 'child', + childAttributes: CT_AlphaBiLevelEffect_Attributes + }, + alphaCeiling: { + type: 'child', + childAttributes: CT_AlphaCeilingEffect_Attributes + }, + alphaFloor: { + type: 'child', + childAttributes: CT_AlphaFloorEffect_Attributes + }, + alphaInv: { + type: 'child', + childAttributes: CT_AlphaInverseEffect_Attributes + }, + alphaMod: { + type: 'child', + childAttributes: CT_AlphaModulateEffect_Attributes + }, + alphaModFix: { + type: 'child', + childAttributes: CT_AlphaModulateFixedEffect_Attributes + }, + alphaRepl: { + type: 'child', + childAttributes: CT_AlphaReplaceEffect_Attributes + }, + biLevel: { + type: 'child', + childAttributes: CT_BiLevelEffect_Attributes + }, + blur: { + type: 'child', + childAttributes: CT_BlurEffect_Attributes + }, + clrChange: { + type: 'child', + childAttributes: CT_ColorChangeEffect_Attributes + }, + clrRepl: { + type: 'child', + childAttributes: CT_ColorReplaceEffect_Attributes + }, + duotone: { + type: 'child', + childAttributes: CT_DuotoneEffect_Attributes + }, + fillOverlay: { + type: 'child', + childAttributes: CT_FillOverlayEffect_Attributes + }, + grayscl: { + type: 'child', + childAttributes: CT_GrayscaleEffect_Attributes + }, + hsl: { + type: 'child', + childAttributes: CT_HSLEffect_Attributes + }, + lum: { + type: 'child', + childAttributes: CT_LuminanceEffect_Attributes + }, + tint: { + type: 'child', + childAttributes: CT_TintEffect_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + cstate: { + type: 'string', + defaultValue: 'none' + } +}; + +export type ST_Coordinate = ST_CoordinateUnqualified | ST_UniversalMeasure; + +export type ST_RectAlignment = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'ctr' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_TileInfoProperties { + tx?: ST_Coordinate; + ty?: ST_Coordinate; + sx?: string; + sy?: string; + flip?: ST_TileFlipMode; + algn?: ST_RectAlignment; +} + +export const CT_TileInfoProperties_Attributes: Attributes = { + tx: { + type: 'string' + }, + ty: { + type: 'string' + }, + sx: { + type: 'string' + }, + sy: { + type: 'string' + }, + flip: { + type: 'string', + defaultValue: 'none' + }, + algn: { + type: 'string' + } +}; + +export interface CT_StretchInfoProperties { + fillRect?: CT_RelativeRect; +} + +export const CT_StretchInfoProperties_Attributes: Attributes = { + fillRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + } +}; + +export interface CT_BlipFillProperties { + blip?: CT_Blip; + srcRect?: CT_RelativeRect; + tile?: CT_TileInfoProperties; + stretch?: CT_StretchInfoProperties; + dpi?: number; + rotWithShape?: boolean; +} + +export const CT_BlipFillProperties_Attributes: Attributes = { + blip: { + type: 'child', + childAttributes: CT_Blip_Attributes + }, + srcRect: { + type: 'child', + childAttributes: CT_RelativeRect_Attributes + }, + tile: { + type: 'child', + childAttributes: CT_TileInfoProperties_Attributes + }, + stretch: { + type: 'child', + childAttributes: CT_StretchInfoProperties_Attributes + }, + dpi: { + type: 'int' + }, + rotWithShape: { + type: 'boolean' + } +}; + +export type ST_PresetPatternVal = + | 'pct5' + | 'pct10' + | 'pct20' + | 'pct25' + | 'pct30' + | 'pct40' + | 'pct50' + | 'pct60' + | 'pct70' + | 'pct75' + | 'pct80' + | 'pct90' + | 'horz' + | 'vert' + | 'ltHorz' + | 'ltVert' + | 'dkHorz' + | 'dkVert' + | 'narHorz' + | 'narVert' + | 'dashHorz' + | 'dashVert' + | 'cross' + | 'dnDiag' + | 'upDiag' + | 'ltDnDiag' + | 'ltUpDiag' + | 'dkDnDiag' + | 'dkUpDiag' + | 'wdDnDiag' + | 'wdUpDiag' + | 'dashDnDiag' + | 'dashUpDiag' + | 'diagCross' + | 'smCheck' + | 'lgCheck' + | 'smGrid' + | 'lgGrid' + | 'dotGrid' + | 'smConfetti' + | 'lgConfetti' + | 'horzBrick' + | 'diagBrick' + | 'solidDmnd' + | 'openDmnd' + | 'dotDmnd' + | 'plaid' + | 'sphere' + | 'weave' + | 'divot' + | 'shingle' + | 'wave' + | 'trellis' + | 'zigZag'; + +export interface CT_PatternFillProperties { + fgClr?: CT_Color; + bgClr?: CT_Color; + prst?: ST_PresetPatternVal; +} + +export const CT_PatternFillProperties_Attributes: Attributes = { + fgClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + bgClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_GroupFillProperties {} + +export const CT_GroupFillProperties_Attributes: Attributes = {}; + +export type ST_BlendMode = 'over' | 'mult' | 'screen' | 'darken' | 'lighten'; + +export interface CT_GlowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + rad?: number; +} + +export const CT_GlowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + rad: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_InnerShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + blurRad?: number; + dist?: number; + dir?: number; +} + +export const CT_InnerShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + blurRad: { + type: 'int', + defaultValue: '0' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_FixedAngle = ST_Angle; + +export interface CT_OuterShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + blurRad?: number; + dist?: number; + dir?: number; + sx?: string; + sy?: string; + kx?: number; + ky?: number; + algn?: ST_RectAlignment; + rotWithShape?: boolean; +} + +export const CT_OuterShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + blurRad: { + type: 'int', + defaultValue: '0' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + }, + sx: { + type: 'string', + defaultValue: '100%' + }, + sy: { + type: 'string', + defaultValue: '100%' + }, + kx: { + type: 'int', + defaultValue: '0' + }, + ky: { + type: 'int', + defaultValue: '0' + }, + algn: { + type: 'string', + defaultValue: 'b' + }, + rotWithShape: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_PresetShadowVal = + | 'shdw1' + | 'shdw2' + | 'shdw3' + | 'shdw4' + | 'shdw5' + | 'shdw6' + | 'shdw7' + | 'shdw8' + | 'shdw9' + | 'shdw10' + | 'shdw11' + | 'shdw12' + | 'shdw13' + | 'shdw14' + | 'shdw15' + | 'shdw16' + | 'shdw17' + | 'shdw18' + | 'shdw19' + | 'shdw20'; + +export interface CT_PresetShadowEffect { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + prst?: ST_PresetShadowVal; + dist?: number; + dir?: number; +} + +export const CT_PresetShadowEffect_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + prst: { + type: 'string' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_ReflectionEffect { + blurRad?: number; + stA?: ST_PositiveFixedPercentage; + stPos?: ST_PositiveFixedPercentage; + endA?: ST_PositiveFixedPercentage; + endPos?: ST_PositiveFixedPercentage; + dist?: number; + dir?: number; + fadeDir?: number; + sx?: string; + sy?: string; + kx?: number; + ky?: number; + algn?: ST_RectAlignment; + rotWithShape?: boolean; +} + +export const CT_ReflectionEffect_Attributes: Attributes = { + blurRad: { + type: 'int', + defaultValue: '0' + }, + stA: { + type: 'string', + defaultValue: '100%' + }, + stPos: { + type: 'string', + defaultValue: '0%' + }, + endA: { + type: 'string', + defaultValue: '0%' + }, + endPos: { + type: 'string', + defaultValue: '100%' + }, + dist: { + type: 'int', + defaultValue: '0' + }, + dir: { + type: 'int', + defaultValue: '0' + }, + fadeDir: { + type: 'int', + defaultValue: '5400000' + }, + sx: { + type: 'string', + defaultValue: '100%' + }, + sy: { + type: 'string', + defaultValue: '100%' + }, + kx: { + type: 'int', + defaultValue: '0' + }, + ky: { + type: 'int', + defaultValue: '0' + }, + algn: { + type: 'string', + defaultValue: 'b' + }, + rotWithShape: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_SoftEdgesEffect { + rad?: number; +} + +export const CT_SoftEdgesEffect_Attributes: Attributes = { + rad: { + type: 'int' + } +}; + +export interface CT_SphereCoords { + lat?: number; + lon?: number; + rev?: number; +} + +export const CT_SphereCoords_Attributes: Attributes = { + lat: { + type: 'int' + }, + lon: { + type: 'int' + }, + rev: { + type: 'int' + } +}; + +export type ST_PresetCameraType = + | 'legacyObliqueTopLeft' + | 'legacyObliqueTop' + | 'legacyObliqueTopRight' + | 'legacyObliqueLeft' + | 'legacyObliqueFront' + | 'legacyObliqueRight' + | 'legacyObliqueBottomLeft' + | 'legacyObliqueBottom' + | 'legacyObliqueBottomRight' + | 'legacyPerspectiveTopLeft' + | 'legacyPerspectiveTop' + | 'legacyPerspectiveTopRight' + | 'legacyPerspectiveLeft' + | 'legacyPerspectiveFront' + | 'legacyPerspectiveRight' + | 'legacyPerspectiveBottomLeft' + | 'legacyPerspectiveBottom' + | 'legacyPerspectiveBottomRight' + | 'orthographicFront' + | 'isometricTopUp' + | 'isometricTopDown' + | 'isometricBottomUp' + | 'isometricBottomDown' + | 'isometricLeftUp' + | 'isometricLeftDown' + | 'isometricRightUp' + | 'isometricRightDown' + | 'isometricOffAxis1Left' + | 'isometricOffAxis1Right' + | 'isometricOffAxis1Top' + | 'isometricOffAxis2Left' + | 'isometricOffAxis2Right' + | 'isometricOffAxis2Top' + | 'isometricOffAxis3Left' + | 'isometricOffAxis3Right' + | 'isometricOffAxis3Bottom' + | 'isometricOffAxis4Left' + | 'isometricOffAxis4Right' + | 'isometricOffAxis4Bottom' + | 'obliqueTopLeft' + | 'obliqueTop' + | 'obliqueTopRight' + | 'obliqueLeft' + | 'obliqueRight' + | 'obliqueBottomLeft' + | 'obliqueBottom' + | 'obliqueBottomRight' + | 'perspectiveFront' + | 'perspectiveLeft' + | 'perspectiveRight' + | 'perspectiveAbove' + | 'perspectiveBelow' + | 'perspectiveAboveLeftFacing' + | 'perspectiveAboveRightFacing' + | 'perspectiveContrastingLeftFacing' + | 'perspectiveContrastingRightFacing' + | 'perspectiveHeroicLeftFacing' + | 'perspectiveHeroicRightFacing' + | 'perspectiveHeroicExtremeLeftFacing' + | 'perspectiveHeroicExtremeRightFacing' + | 'perspectiveRelaxed' + | 'perspectiveRelaxedModerately'; + +export type ST_FOVAngle = ST_Angle; + +export interface CT_Camera { + rot?: CT_SphereCoords; + prst?: ST_PresetCameraType; + fov?: number; + zoom?: ST_PositivePercentage; +} + +export const CT_Camera_Attributes: Attributes = { + rot: { + type: 'child', + childAttributes: CT_SphereCoords_Attributes + }, + prst: { + type: 'string' + }, + fov: { + type: 'int' + }, + zoom: { + type: 'string', + defaultValue: '100%' + } +}; + +export type ST_LightRigType = + | 'legacyFlat1' + | 'legacyFlat2' + | 'legacyFlat3' + | 'legacyFlat4' + | 'legacyNormal1' + | 'legacyNormal2' + | 'legacyNormal3' + | 'legacyNormal4' + | 'legacyHarsh1' + | 'legacyHarsh2' + | 'legacyHarsh3' + | 'legacyHarsh4' + | 'threePt' + | 'balanced' + | 'soft' + | 'harsh' + | 'flood' + | 'contrasting' + | 'morning' + | 'sunrise' + | 'sunset' + | 'chilly' + | 'freezing' + | 'flat' + | 'twoPt' + | 'glow' + | 'brightRoom'; + +export type ST_LightRigDirection = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_LightRig { + rot?: CT_SphereCoords; + rig?: ST_LightRigType; + dir?: ST_LightRigDirection; +} + +export const CT_LightRig_Attributes: Attributes = { + rot: { + type: 'child', + childAttributes: CT_SphereCoords_Attributes + }, + rig: { + type: 'string' + }, + dir: { + type: 'string' + } +}; + +export interface CT_Point3D { + x?: ST_Coordinate; + y?: ST_Coordinate; + z?: ST_Coordinate; +} + +export const CT_Point3D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + }, + z: { + type: 'string' + } +}; + +export interface CT_Vector3D { + dx?: ST_Coordinate; + dy?: ST_Coordinate; + dz?: ST_Coordinate; +} + +export const CT_Vector3D_Attributes: Attributes = { + dx: { + type: 'string' + }, + dy: { + type: 'string' + }, + dz: { + type: 'string' + } +}; + +export interface CT_Backdrop { + anchor?: CT_Point3D; + norm?: CT_Vector3D; + up?: CT_Vector3D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_Backdrop_Attributes: Attributes = { + anchor: { + type: 'child', + childAttributes: CT_Point3D_Attributes + }, + norm: { + type: 'child', + childAttributes: CT_Vector3D_Attributes + }, + up: { + type: 'child', + childAttributes: CT_Vector3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_Scene3D { + camera?: CT_Camera; + lightRig?: CT_LightRig; + backdrop?: CT_Backdrop; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_Scene3D_Attributes: Attributes = { + camera: { + type: 'child', + childAttributes: CT_Camera_Attributes + }, + lightRig: { + type: 'child', + childAttributes: CT_LightRig_Attributes + }, + backdrop: { + type: 'child', + childAttributes: CT_Backdrop_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_BevelPresetType = + | 'relaxedInset' + | 'circle' + | 'slope' + | 'cross' + | 'angle' + | 'softRound' + | 'convex' + | 'coolSlant' + | 'divot' + | 'riblet' + | 'hardEdge' + | 'artDeco'; + +export interface CT_Bevel { + w?: number; + h?: number; + prst?: ST_BevelPresetType; +} + +export const CT_Bevel_Attributes: Attributes = { + w: { + type: 'int', + defaultValue: '76200' + }, + h: { + type: 'int', + defaultValue: '76200' + }, + prst: { + type: 'string', + defaultValue: 'circle' + } +}; + +export type ST_PresetMaterialType = + | 'legacyMatte' + | 'legacyPlastic' + | 'legacyMetal' + | 'legacyWireframe' + | 'matte' + | 'plastic' + | 'metal' + | 'warmMatte' + | 'translucentPowder' + | 'powder' + | 'dkEdge' + | 'softEdge' + | 'clear' + | 'flat' + | 'softmetal'; + +export interface CT_Shape3D { + bevelT?: CT_Bevel; + bevelB?: CT_Bevel; + extrusionClr?: CT_Color; + contourClr?: CT_Color; + extLst?: CT_OfficeArtExtensionList; + z?: ST_Coordinate; + extrusionH?: number; + contourW?: number; + prstMaterial?: ST_PresetMaterialType; +} + +export const CT_Shape3D_Attributes: Attributes = { + bevelT: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + bevelB: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + extrusionClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + contourClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + z: { + type: 'string', + defaultValue: '0' + }, + extrusionH: { + type: 'int', + defaultValue: '0' + }, + contourW: { + type: 'int', + defaultValue: '0' + }, + prstMaterial: { + type: 'string', + defaultValue: 'warmMatte' + } +}; + +export interface CT_FillStyleList { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillStyleList_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export type ST_PresetLineDashVal = + | 'solid' + | 'dot' + | 'dash' + | 'lgDash' + | 'dashDot' + | 'lgDashDot' + | 'lgDashDotDot' + | 'sysDash' + | 'sysDot' + | 'sysDashDot' + | 'sysDashDotDot'; + +export interface CT_PresetLineDashProperties { + val?: ST_PresetLineDashVal; +} + +export const CT_PresetLineDashProperties_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_DashStop { + d?: ST_PositivePercentage; + sp?: ST_PositivePercentage; +} + +export const CT_DashStop_Attributes: Attributes = { + d: { + type: 'string' + }, + sp: { + type: 'string' + } +}; + +export interface CT_DashStopList { + ds?: CT_DashStop[]; +} + +export const CT_DashStopList_Attributes: Attributes = { + ds: { + type: 'child', + childAttributes: CT_DashStop_Attributes, + childIsArray: true + } +}; + +export interface CT_LineJoinRound {} + +export const CT_LineJoinRound_Attributes: Attributes = {}; + +export interface CT_LineJoinBevel {} + +export const CT_LineJoinBevel_Attributes: Attributes = {}; + +export interface CT_LineJoinMiterProperties { + lim?: ST_PositivePercentage; +} + +export const CT_LineJoinMiterProperties_Attributes: Attributes = { + lim: { + type: 'string' + } +}; + +export type ST_LineEndType = + | 'none' + | 'triangle' + | 'stealth' + | 'diamond' + | 'oval' + | 'arrow'; + +export type ST_LineEndWidth = 'sm' | 'med' | 'lg'; + +export type ST_LineEndLength = 'sm' | 'med' | 'lg'; + +export interface CT_LineEndProperties { + type?: ST_LineEndType; + w?: ST_LineEndWidth; + len?: ST_LineEndLength; +} + +export const CT_LineEndProperties_Attributes: Attributes = { + type: { + type: 'string', + defaultValue: 'none' + }, + w: { + type: 'string' + }, + len: { + type: 'string' + } +}; + +export type ST_LineWidth = ST_Coordinate32Unqualified; + +export type ST_LineCap = 'rnd' | 'sq' | 'flat'; + +export type ST_CompoundLine = 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri'; + +export type ST_PenAlignment = 'ctr' | 'in'; + +export interface CT_LineProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + pattFill?: CT_PatternFillProperties; + prstDash?: CT_PresetLineDashProperties; + custDash?: CT_DashStopList; + round?: CT_LineJoinRound; + bevel?: CT_LineJoinBevel; + miter?: CT_LineJoinMiterProperties; + headEnd?: CT_LineEndProperties; + tailEnd?: CT_LineEndProperties; + extLst?: CT_OfficeArtExtensionList; + w?: number; + cap?: ST_LineCap; + cmpd?: ST_CompoundLine; + algn?: ST_PenAlignment; +} + +export const CT_LineProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + prstDash: { + type: 'child', + childAttributes: CT_PresetLineDashProperties_Attributes + }, + custDash: { + type: 'child', + childAttributes: CT_DashStopList_Attributes + }, + round: { + type: 'child', + childAttributes: CT_LineJoinRound_Attributes + }, + bevel: { + type: 'child', + childAttributes: CT_LineJoinBevel_Attributes + }, + miter: { + type: 'child', + childAttributes: CT_LineJoinMiterProperties_Attributes + }, + headEnd: { + type: 'child', + childAttributes: CT_LineEndProperties_Attributes + }, + tailEnd: { + type: 'child', + childAttributes: CT_LineEndProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + w: { + type: 'int' + }, + cap: { + type: 'string' + }, + cmpd: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_LineStyleList { + ln?: CT_LineProperties[]; +} + +export const CT_LineStyleList_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes, + childIsArray: true + } +}; + +export interface CT_EffectStyleList { + effectStyle?: CT_EffectStyleItem[]; +} + +export const CT_EffectStyleList_Attributes: Attributes = { + effectStyle: { + type: 'child', + childAttributes: CT_EffectStyleItem_Attributes, + childIsArray: true + } +}; + +export interface CT_BackgroundFillStyleList { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_BackgroundFillStyleList_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_StyleMatrix { + fillStyleLst?: CT_FillStyleList; + lnStyleLst?: CT_LineStyleList; + effectStyleLst?: CT_EffectStyleList; + bgFillStyleLst?: CT_BackgroundFillStyleList; + name?: string; +} + +export const CT_StyleMatrix_Attributes: Attributes = { + fillStyleLst: { + type: 'child', + childAttributes: CT_FillStyleList_Attributes + }, + lnStyleLst: { + type: 'child', + childAttributes: CT_LineStyleList_Attributes + }, + effectStyleLst: { + type: 'child', + childAttributes: CT_EffectStyleList_Attributes + }, + bgFillStyleLst: { + type: 'child', + childAttributes: CT_BackgroundFillStyleList_Attributes + }, + name: { + type: 'string' + } +}; + +export type ST_FontScheme = 'none' | 'major' | 'minor'; + +export interface CT_FontScheme { + val?: ST_FontScheme; +} + +export const CT_FontScheme_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_BaseStyles { + clrScheme?: CT_ColorScheme; + fontScheme?: CT_FontScheme; + fmtScheme?: CT_StyleMatrix; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_BaseStyles_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + fontScheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + }, + fmtScheme: { + type: 'child', + childAttributes: CT_StyleMatrix_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_CoordinateUnqualified = number; + +export type ST_Coordinate32 = ST_Coordinate32Unqualified | ST_UniversalMeasure; + +export type ST_Coordinate32Unqualified = number; + +export type ST_PositiveCoordinate32 = ST_Coordinate32Unqualified; + +export interface CT_Ratio { + n?: number; + d?: number; +} + +export const CT_Ratio_Attributes: Attributes = { + n: { + type: 'int' + }, + d: { + type: 'int' + } +}; + +export interface CT_Point2D { + x?: ST_Coordinate; + y?: ST_Coordinate; +} + +export const CT_Point2D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + } +}; + +export interface CT_PositiveSize2D { + cx?: number; + cy?: number; +} + +export const CT_PositiveSize2D_Attributes: Attributes = { + cx: { + type: 'int' + }, + cy: { + type: 'int' + } +}; + +export interface CT_Scale2D { + sx?: CT_Ratio; + sy?: CT_Ratio; +} + +export const CT_Scale2D_Attributes: Attributes = { + sx: { + type: 'child', + childAttributes: CT_Ratio_Attributes + }, + sy: { + type: 'child', + childAttributes: CT_Ratio_Attributes + } +}; + +export interface CT_Transform2D { + off?: CT_Point2D; + ext?: CT_PositiveSize2D; + rot?: number; + flipH?: boolean; + flipV?: boolean; +} + +export const CT_Transform2D_Attributes: Attributes = { + off: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + rot: { + type: 'int', + defaultValue: '0' + }, + flipH: { + type: 'boolean', + defaultValue: 'false' + }, + flipV: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupTransform2D { + off?: CT_Point2D; + ext?: CT_PositiveSize2D; + chOff?: CT_Point2D; + chExt?: CT_PositiveSize2D; + rot?: number; + flipH?: boolean; + flipV?: boolean; +} + +export const CT_GroupTransform2D_Attributes: Attributes = { + off: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + chOff: { + type: 'child', + childAttributes: CT_Point2D_Attributes + }, + chExt: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes + }, + rot: { + type: 'int', + defaultValue: '0' + }, + flipH: { + type: 'boolean', + defaultValue: 'false' + }, + flipV: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ColorMRU { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; +} + +export const CT_ColorMRU_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + } +}; + +export type ST_BlackWhiteMode = + | 'clr' + | 'auto' + | 'gray' + | 'ltGray' + | 'invGray' + | 'grayWhite' + | 'blackGray' + | 'blackWhite' + | 'black' + | 'white' + | 'hidden'; + +export interface CT_EmbeddedWAVAudioFile { + name?: string; +} + +export const CT_EmbeddedWAVAudioFile_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export type ST_DrawingElementId = number; + +export interface CT_ConnectorLocking { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ConnectorLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_ShapeLocking { + extLst?: CT_OfficeArtExtensionList; + noTextEdit?: boolean; +} + +export const CT_ShapeLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noTextEdit: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PictureLocking { + extLst?: CT_OfficeArtExtensionList; + noCrop?: boolean; +} + +export const CT_PictureLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noCrop: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupLocking { + extLst?: CT_OfficeArtExtensionList; + noGrp?: boolean; + noUngrp?: boolean; + noSelect?: boolean; + noRot?: boolean; + noChangeAspect?: boolean; + noMove?: boolean; + noResize?: boolean; +} + +export const CT_GroupLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noGrp: { + type: 'boolean', + defaultValue: 'false' + }, + noUngrp: { + type: 'boolean', + defaultValue: 'false' + }, + noSelect: { + type: 'boolean', + defaultValue: 'false' + }, + noRot: { + type: 'boolean', + defaultValue: 'false' + }, + noChangeAspect: { + type: 'boolean', + defaultValue: 'false' + }, + noMove: { + type: 'boolean', + defaultValue: 'false' + }, + noResize: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GraphicalObjectFrameLocking { + extLst?: CT_OfficeArtExtensionList; + noGrp?: boolean; + noDrilldown?: boolean; + noSelect?: boolean; + noChangeAspect?: boolean; + noMove?: boolean; + noResize?: boolean; +} + +export const CT_GraphicalObjectFrameLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + noGrp: { + type: 'boolean', + defaultValue: 'false' + }, + noDrilldown: { + type: 'boolean', + defaultValue: 'false' + }, + noSelect: { + type: 'boolean', + defaultValue: 'false' + }, + noChangeAspect: { + type: 'boolean', + defaultValue: 'false' + }, + noMove: { + type: 'boolean', + defaultValue: 'false' + }, + noResize: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ContentPartLocking { + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ContentPartLocking_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export type ST_Ref = string; + +export interface CT_Hyperlink { + 'ref'?: string; + 'r:id'?: string; + 'location'?: string; + 'tooltip'?: string; + 'display'?: string; +} + +export const CT_Hyperlink_Attributes: Attributes = { + 'ref': { + type: 'string' + }, + 'r:id': { + type: 'string' + }, + 'location': { + type: 'string' + }, + 'tooltip': { + type: 'string' + }, + 'display': { + type: 'string' + } +}; + +export interface CT_NonVisualDrawingProps { + hlinkClick?: CT_Hyperlink; + hlinkHover?: CT_Hyperlink; + extLst?: CT_OfficeArtExtensionList; + id?: number; + name?: string; + descr?: string; + hidden?: boolean; + title?: string; +} + +export const CT_NonVisualDrawingProps_Attributes: Attributes = { + hlinkClick: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + hlinkHover: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + id: { + type: 'int' + }, + name: { + type: 'string' + }, + descr: { + type: 'string' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + }, + title: { + type: 'string' + } +}; + +export interface CT_NonVisualDrawingShapeProps { + spLocks?: CT_ShapeLocking; + extLst?: CT_OfficeArtExtensionList; + txBox?: boolean; +} + +export const CT_NonVisualDrawingShapeProps_Attributes: Attributes = { + spLocks: { + type: 'child', + childAttributes: CT_ShapeLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + txBox: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_DbPr { + connection?: string; + command?: string; + serverCommand?: string; + commandType?: number; +} + +export const CT_DbPr_Attributes: Attributes = { + connection: { + type: 'string' + }, + command: { + type: 'string' + }, + serverCommand: { + type: 'string' + }, + commandType: { + type: 'int', + defaultValue: '2' + } +}; + +export interface CT_OlapPr { + local?: boolean; + localConnection?: string; + localRefresh?: boolean; + sendLocale?: boolean; + rowDrillCount?: number; + serverFill?: boolean; + serverNumberFormat?: boolean; + serverFont?: boolean; + serverFontColor?: boolean; +} + +export const CT_OlapPr_Attributes: Attributes = { + local: { + type: 'boolean', + defaultValue: 'false' + }, + localConnection: { + type: 'string' + }, + localRefresh: { + type: 'boolean', + defaultValue: 'true' + }, + sendLocale: { + type: 'boolean', + defaultValue: 'false' + }, + rowDrillCount: { + type: 'int' + }, + serverFill: { + type: 'boolean', + defaultValue: 'true' + }, + serverNumberFormat: { + type: 'boolean', + defaultValue: 'true' + }, + serverFont: { + type: 'boolean', + defaultValue: 'true' + }, + serverFontColor: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_TableMissing {} + +export const CT_TableMissing_Attributes: Attributes = {}; + +export interface CT_XStringElement { + v?: string; +} + +export const CT_XStringElement_Attributes: Attributes = { + v: { + type: 'string' + } +}; + +export interface CT_Index { + v?: number; +} + +export const CT_Index_Attributes: Attributes = { + v: { + type: 'int' + } +}; + +export interface CT_Tables { + m?: CT_TableMissing[]; + s?: CT_XStringElement[]; + x?: CT_Index[]; + count?: number; +} + +export const CT_Tables_Attributes: Attributes = { + m: { + type: 'child', + childAttributes: CT_TableMissing_Attributes, + childIsArray: true + }, + s: { + type: 'child', + childAttributes: CT_XStringElement_Attributes, + childIsArray: true + }, + x: { + type: 'child', + childAttributes: CT_Index_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_HtmlFmt = 'none' | 'rtf' | 'all'; + +export interface CT_WebPr { + tables?: CT_Tables; + xml?: boolean; + sourceData?: boolean; + parsePre?: boolean; + consecutive?: boolean; + firstRow?: boolean; + xl97?: boolean; + textDates?: boolean; + xl2000?: boolean; + url?: string; + post?: string; + htmlTables?: boolean; + htmlFormat?: ST_HtmlFmt; + editPage?: string; +} + +export const CT_WebPr_Attributes: Attributes = { + tables: { + type: 'child', + childAttributes: CT_Tables_Attributes + }, + xml: { + type: 'boolean', + defaultValue: 'false' + }, + sourceData: { + type: 'boolean', + defaultValue: 'false' + }, + parsePre: { + type: 'boolean', + defaultValue: 'false' + }, + consecutive: { + type: 'boolean', + defaultValue: 'false' + }, + firstRow: { + type: 'boolean', + defaultValue: 'false' + }, + xl97: { + type: 'boolean', + defaultValue: 'false' + }, + textDates: { + type: 'boolean', + defaultValue: 'false' + }, + xl2000: { + type: 'boolean', + defaultValue: 'false' + }, + url: { + type: 'string' + }, + post: { + type: 'string' + }, + htmlTables: { + type: 'boolean', + defaultValue: 'false' + }, + htmlFormat: { + type: 'string', + defaultValue: 'none' + }, + editPage: { + type: 'string' + } +}; + +export type ST_ExternalConnectionType = + | 'general' + | 'text' + | 'MDY' + | 'DMY' + | 'YMD' + | 'MYD' + | 'DYM' + | 'YDM' + | 'skip' + | 'EMD'; + +export interface CT_TextField { + type?: ST_ExternalConnectionType; + position?: number; +} + +export const CT_TextField_Attributes: Attributes = { + type: { + type: 'string', + defaultValue: 'general' + }, + position: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_TextFields { + textField?: CT_TextField[]; + count?: number; +} + +export const CT_TextFields_Attributes: Attributes = { + textField: { + type: 'child', + childAttributes: CT_TextField_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '1' + } +}; + +export type ST_FileType = 'mac' | 'win' | 'dos' | 'lin' | 'other'; + +export type ST_Qualifier = 'doubleQuote' | 'singleQuote' | 'none'; + +export interface CT_TextPr { + textFields?: CT_TextFields; + prompt?: boolean; + fileType?: ST_FileType; + characterSet?: string; + firstRow?: number; + sourceFile?: string; + delimited?: boolean; + decimal?: string; + thousands?: string; + tab?: boolean; + space?: boolean; + comma?: boolean; + semicolon?: boolean; + consecutive?: boolean; + qualifier?: ST_Qualifier; + delimiter?: string; +} + +export const CT_TextPr_Attributes: Attributes = { + textFields: { + type: 'child', + childAttributes: CT_TextFields_Attributes + }, + prompt: { + type: 'boolean', + defaultValue: 'true' + }, + fileType: { + type: 'string', + defaultValue: 'win' + }, + characterSet: { + type: 'string' + }, + firstRow: { + type: 'int', + defaultValue: '1' + }, + sourceFile: { + type: 'string' + }, + delimited: { + type: 'boolean', + defaultValue: 'true' + }, + decimal: { + type: 'string', + defaultValue: '.' + }, + thousands: { + type: 'string', + defaultValue: ',' + }, + tab: { + type: 'boolean', + defaultValue: 'true' + }, + space: { + type: 'boolean', + defaultValue: 'false' + }, + comma: { + type: 'boolean', + defaultValue: 'false' + }, + semicolon: { + type: 'boolean', + defaultValue: 'false' + }, + consecutive: { + type: 'boolean', + defaultValue: 'false' + }, + qualifier: { + type: 'string', + defaultValue: 'doubleQuote' + }, + delimiter: { + type: 'string' + } +}; + +export type ST_ParameterType = 'prompt' | 'value' | 'cell'; + +export interface CT_Parameter { + name?: string; + sqlType?: number; + parameterType?: ST_ParameterType; + refreshOnChange?: boolean; + prompt?: string; + boolean?: boolean; + double?: number; + integer?: number; + string?: string; + cell?: string; +} + +export const CT_Parameter_Attributes: Attributes = { + name: { + type: 'string' + }, + sqlType: { + type: 'int', + defaultValue: '0' + }, + parameterType: { + type: 'string', + defaultValue: 'prompt' + }, + refreshOnChange: { + type: 'boolean', + defaultValue: 'false' + }, + prompt: { + type: 'string' + }, + boolean: { + type: 'boolean' + }, + double: { + type: 'double' + }, + integer: { + type: 'int' + }, + string: { + type: 'string' + }, + cell: { + type: 'string' + } +}; + +export interface CT_Parameters { + parameter?: CT_Parameter[]; + count?: number; +} + +export const CT_Parameters_Attributes: Attributes = { + parameter: { + type: 'child', + childAttributes: CT_Parameter_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_CredMethod = 'integrated' | 'none' | 'stored' | 'prompt'; + +export interface CT_Connection { + dbPr?: CT_DbPr; + olapPr?: CT_OlapPr; + webPr?: CT_WebPr; + textPr?: CT_TextPr; + parameters?: CT_Parameters; + extLst?: CT_ExtensionList; + id?: number; + sourceFile?: string; + odcFile?: string; + keepAlive?: boolean; + interval?: number; + name?: string; + description?: string; + type?: number; + reconnectionMethod?: number; + refreshedVersion?: number; + minRefreshableVersion?: number; + savePassword?: boolean; + new?: boolean; + deleted?: boolean; + onlyUseConnectionFile?: boolean; + background?: boolean; + refreshOnLoad?: boolean; + saveData?: boolean; + credentials?: ST_CredMethod; + singleSignOnId?: string; +} + +export const CT_Connection_Attributes: Attributes = { + dbPr: { + type: 'child', + childAttributes: CT_DbPr_Attributes + }, + olapPr: { + type: 'child', + childAttributes: CT_OlapPr_Attributes + }, + webPr: { + type: 'child', + childAttributes: CT_WebPr_Attributes + }, + textPr: { + type: 'child', + childAttributes: CT_TextPr_Attributes + }, + parameters: { + type: 'child', + childAttributes: CT_Parameters_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + id: { + type: 'int' + }, + sourceFile: { + type: 'string' + }, + odcFile: { + type: 'string' + }, + keepAlive: { + type: 'boolean', + defaultValue: 'false' + }, + interval: { + type: 'int', + defaultValue: '0' + }, + name: { + type: 'string' + }, + description: { + type: 'string' + }, + type: { + type: 'int' + }, + reconnectionMethod: { + type: 'int', + defaultValue: '1' + }, + refreshedVersion: { + type: 'int' + }, + minRefreshableVersion: { + type: 'int', + defaultValue: '0' + }, + savePassword: { + type: 'boolean', + defaultValue: 'false' + }, + new: { + type: 'boolean', + defaultValue: 'false' + }, + deleted: { + type: 'boolean', + defaultValue: 'false' + }, + onlyUseConnectionFile: { + type: 'boolean', + defaultValue: 'false' + }, + background: { + type: 'boolean', + defaultValue: 'false' + }, + refreshOnLoad: { + type: 'boolean', + defaultValue: 'false' + }, + saveData: { + type: 'boolean', + defaultValue: 'false' + }, + credentials: { + type: 'string', + defaultValue: 'integrated' + }, + singleSignOnId: { + type: 'string' + } +}; + +export interface CT_NonVisualConnectorProperties { + cxnSpLocks?: CT_ConnectorLocking; + stCxn?: CT_Connection; + endCxn?: CT_Connection; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualConnectorProperties_Attributes: Attributes = { + cxnSpLocks: { + type: 'child', + childAttributes: CT_ConnectorLocking_Attributes + }, + stCxn: { + type: 'child', + childAttributes: CT_Connection_Attributes + }, + endCxn: { + type: 'child', + childAttributes: CT_Connection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualPictureProperties { + picLocks?: CT_PictureLocking; + extLst?: CT_OfficeArtExtensionList; + preferRelativeResize?: boolean; +} + +export const CT_NonVisualPictureProperties_Attributes: Attributes = { + picLocks: { + type: 'child', + childAttributes: CT_PictureLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + preferRelativeResize: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_NonVisualGroupDrawingShapeProps { + grpSpLocks?: CT_GroupLocking; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualGroupDrawingShapeProps_Attributes: Attributes = { + grpSpLocks: { + type: 'child', + childAttributes: CT_GroupLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualGraphicFrameProperties { + graphicFrameLocks?: CT_GraphicalObjectFrameLocking; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_NonVisualGraphicFrameProperties_Attributes: Attributes = { + graphicFrameLocks: { + type: 'child', + childAttributes: CT_GraphicalObjectFrameLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_NonVisualContentPartProperties { + cpLocks?: CT_ContentPartLocking; + extLst?: CT_OfficeArtExtensionList; + isComment?: boolean; +} + +export const CT_NonVisualContentPartProperties_Attributes: Attributes = { + cpLocks: { + type: 'child', + childAttributes: CT_ContentPartLocking_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + isComment: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_GraphicalObjectData { + __any__?: any; + uri?: string; +} + +export const CT_GraphicalObjectData_Attributes: Attributes = { + __any__: { + type: 'any' + }, + uri: { + type: 'string' + } +}; + +export interface CT_GraphicalObject { + graphicData?: CT_GraphicalObjectData[]; +} + +export const CT_GraphicalObject_Attributes: Attributes = { + graphicData: { + type: 'child', + childAttributes: CT_GraphicalObjectData_Attributes, + childIsArray: true + } +}; + +export type ST_ChartBuildStep = + | 'category' + | 'ptInCategory' + | 'series' + | 'ptInSeries' + | 'allPts' + | 'gridLegend'; + +export type ST_DgmBuildStep = 'sp' | 'bg'; + +export interface CT_AnimationDgmElement { + id?: string; + bldStep?: ST_DgmBuildStep; +} + +export const CT_AnimationDgmElement_Attributes: Attributes = { + id: { + type: 'string', + defaultValue: '{00000000-0000-0000-0000-000000000000}' + }, + bldStep: { + type: 'string', + defaultValue: 'sp' + } +}; + +export interface CT_AnimationChartElement { + seriesIdx?: number; + categoryIdx?: number; + bldStep?: ST_ChartBuildStep; +} + +export const CT_AnimationChartElement_Attributes: Attributes = { + seriesIdx: { + type: 'int', + defaultValue: '-1' + }, + categoryIdx: { + type: 'int', + defaultValue: '-1' + }, + bldStep: { + type: 'string' + } +}; + +export interface CT_AnimationElementChoice { + dgm?: CT_AnimationDgmElement[]; + chart?: CT_AnimationChartElement[]; +} + +export const CT_AnimationElementChoice_Attributes: Attributes = { + dgm: { + type: 'child', + childAttributes: CT_AnimationDgmElement_Attributes, + childIsArray: true + }, + chart: { + type: 'child', + childAttributes: CT_AnimationChartElement_Attributes, + childIsArray: true + } +}; + +export type ST_AnimationBuildType = 'allAtOnce'; + +export type ST_AnimationDgmOnlyBuildType = 'one' | 'lvlOne' | 'lvlAtOnce'; + +export type ST_AnimationDgmBuildType = + | ST_AnimationBuildType + | ST_AnimationDgmOnlyBuildType; + +export interface CT_AnimationDgmBuildProperties { + bld?: ST_AnimationDgmBuildType; + rev?: boolean; +} + +export const CT_AnimationDgmBuildProperties_Attributes: Attributes = { + bld: { + type: 'string', + defaultValue: 'allAtOnce' + }, + rev: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_AnimationChartOnlyBuildType = + | 'series' + | 'category' + | 'seriesEl' + | 'categoryEl'; + +export type ST_AnimationChartBuildType = + | ST_AnimationBuildType + | ST_AnimationChartOnlyBuildType; + +export interface CT_AnimationChartBuildProperties { + bld?: ST_AnimationChartBuildType; + animBg?: boolean; +} + +export const CT_AnimationChartBuildProperties_Attributes: Attributes = { + bld: { + type: 'string', + defaultValue: 'allAtOnce' + }, + animBg: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_AnimationGraphicalObjectBuildProperties { + bldDgm?: CT_AnimationDgmBuildProperties[]; + bldChart?: CT_AnimationChartBuildProperties[]; +} + +export const CT_AnimationGraphicalObjectBuildProperties_Attributes: Attributes = + { + bldDgm: { + type: 'child', + childAttributes: CT_AnimationDgmBuildProperties_Attributes, + childIsArray: true + }, + bldChart: { + type: 'child', + childAttributes: CT_AnimationChartBuildProperties_Attributes, + childIsArray: true + } + }; + +export interface CT_BackgroundFormatting { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_BackgroundFormatting_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_WholeE2oFormatting { + ln?: CT_LineProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_WholeE2oFormatting_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export interface CT_GvmlUseShapeRectangle {} + +export const CT_GvmlUseShapeRectangle_Attributes: Attributes = {}; + +export type ST_GeomGuideName = string; + +export type ST_GeomGuideFormula = string; + +export interface CT_GeomGuide { + name?: string; + fmla?: string; +} + +export const CT_GeomGuide_Attributes: Attributes = { + name: { + type: 'string' + }, + fmla: { + type: 'string' + } +}; + +export interface CT_GeomGuideList { + gd?: CT_GeomGuide[]; +} + +export const CT_GeomGuideList_Attributes: Attributes = { + gd: { + type: 'child', + childAttributes: CT_GeomGuide_Attributes, + childIsArray: true + } +}; + +export type ST_TextShapeType = + | 'textNoShape' + | 'textPlain' + | 'textStop' + | 'textTriangle' + | 'textTriangleInverted' + | 'textChevron' + | 'textChevronInverted' + | 'textRingInside' + | 'textRingOutside' + | 'textArchUp' + | 'textArchDown' + | 'textCircle' + | 'textButton' + | 'textArchUpPour' + | 'textArchDownPour' + | 'textCirclePour' + | 'textButtonPour' + | 'textCurveUp' + | 'textCurveDown' + | 'textCanUp' + | 'textCanDown' + | 'textWave1' + | 'textWave2' + | 'textDoubleWave1' + | 'textWave4' + | 'textInflate' + | 'textDeflate' + | 'textInflateBottom' + | 'textDeflateBottom' + | 'textInflateTop' + | 'textDeflateTop' + | 'textDeflateInflate' + | 'textDeflateInflateDeflate' + | 'textFadeRight' + | 'textFadeLeft' + | 'textFadeUp' + | 'textFadeDown' + | 'textSlantUp' + | 'textSlantDown' + | 'textCascadeUp' + | 'textCascadeDown'; + +export interface CT_PresetTextShape { + avLst?: CT_GeomGuideList; + prst?: ST_TextShapeType; +} + +export const CT_PresetTextShape_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_TextNoAutofit {} + +export const CT_TextNoAutofit_Attributes: Attributes = {}; + +export type ST_TextFontScalePercentOrPercentString = string; + +export type ST_TextSpacingPercentOrPercentString = string; + +export interface CT_TextNormalAutofit { + fontScale?: string; + lnSpcReduction?: string; +} + +export const CT_TextNormalAutofit_Attributes: Attributes = { + fontScale: { + type: 'string', + defaultValue: '100%' + }, + lnSpcReduction: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_TextShapeAutofit {} + +export const CT_TextShapeAutofit_Attributes: Attributes = {}; + +export interface CT_FlatText { + z?: ST_Coordinate; +} + +export const CT_FlatText_Attributes: Attributes = { + z: { + type: 'string', + defaultValue: '0' + } +}; + +export type ST_TextVertOverflowType = 'overflow' | 'ellipsis' | 'clip'; + +export type ST_TextHorzOverflowType = 'overflow' | 'clip'; + +export type ST_TextVerticalType = + | 'horz' + | 'vert' + | 'vert270' + | 'wordArtVert' + | 'eaVert' + | 'mongolianVert' + | 'wordArtVertRtl'; + +export type ST_TextWrappingType = 'none' | 'square'; + +export type ST_TextColumnCount = number; + +export type ST_TextAnchoringType = 't' | 'ctr' | 'b' | 'just' | 'dist'; + +export interface CT_TextBodyProperties { + prstTxWarp?: CT_PresetTextShape; + noAutofit?: CT_TextNoAutofit[]; + normAutofit?: CT_TextNormalAutofit[]; + spAutoFit?: CT_TextShapeAutofit[]; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; + flatTx?: CT_FlatText; + extLst?: CT_OfficeArtExtensionList; + rot?: number; + spcFirstLastPara?: boolean; + vertOverflow?: ST_TextVertOverflowType; + horzOverflow?: ST_TextHorzOverflowType; + vert?: ST_TextVerticalType; + wrap?: ST_TextWrappingType; + lIns?: ST_Coordinate32; + tIns?: ST_Coordinate32; + rIns?: ST_Coordinate32; + bIns?: ST_Coordinate32; + numCol?: number; + spcCol?: number; + rtlCol?: boolean; + fromWordArt?: boolean; + anchor?: ST_TextAnchoringType; + anchorCtr?: boolean; + forceAA?: boolean; + upright?: boolean; + compatLnSpc?: boolean; +} + +export const CT_TextBodyProperties_Attributes: Attributes = { + prstTxWarp: { + type: 'child', + childAttributes: CT_PresetTextShape_Attributes + }, + noAutofit: { + type: 'child', + childAttributes: CT_TextNoAutofit_Attributes, + childIsArray: true + }, + normAutofit: { + type: 'child', + childAttributes: CT_TextNormalAutofit_Attributes, + childIsArray: true + }, + spAutoFit: { + type: 'child', + childAttributes: CT_TextShapeAutofit_Attributes, + childIsArray: true + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + }, + flatTx: { + type: 'child', + childAttributes: CT_FlatText_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rot: { + type: 'int' + }, + spcFirstLastPara: { + type: 'boolean' + }, + vertOverflow: { + type: 'string' + }, + horzOverflow: { + type: 'string' + }, + vert: { + type: 'string' + }, + wrap: { + type: 'string' + }, + lIns: { + type: 'string' + }, + tIns: { + type: 'string' + }, + rIns: { + type: 'string' + }, + bIns: { + type: 'string' + }, + numCol: { + type: 'int' + }, + spcCol: { + type: 'int' + }, + rtlCol: { + type: 'boolean' + }, + fromWordArt: { + type: 'boolean' + }, + anchor: { + type: 'string' + }, + anchorCtr: { + type: 'boolean' + }, + forceAA: { + type: 'boolean' + }, + upright: { + type: 'boolean', + defaultValue: 'false' + }, + compatLnSpc: { + type: 'boolean' + } +}; + +export interface CT_TextSpacingPercent { + val?: string; +} + +export const CT_TextSpacingPercent_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextSpacingPoint = number; + +export interface CT_TextSpacingPoint { + val?: number; +} + +export const CT_TextSpacingPoint_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_TextSpacing { + spcPct?: CT_TextSpacingPercent[]; + spcPts?: CT_TextSpacingPoint[]; +} + +export const CT_TextSpacing_Attributes: Attributes = { + spcPct: { + type: 'child', + childAttributes: CT_TextSpacingPercent_Attributes, + childIsArray: true + }, + spcPts: { + type: 'child', + childAttributes: CT_TextSpacingPoint_Attributes, + childIsArray: true + } +}; + +export interface CT_TextBulletColorFollowText {} + +export const CT_TextBulletColorFollowText_Attributes: Attributes = {}; + +export interface CT_TextBulletSizeFollowText {} + +export const CT_TextBulletSizeFollowText_Attributes: Attributes = {}; + +export type ST_TextBulletSizePercent = string; + +export interface CT_TextBulletSizePercent { + val?: string; +} + +export const CT_TextBulletSizePercent_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_TextFontSize = number; + +export interface CT_TextBulletSizePoint { + val?: number; +} + +export const CT_TextBulletSizePoint_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_TextBulletTypefaceFollowText {} + +export const CT_TextBulletTypefaceFollowText_Attributes: Attributes = {}; + +export interface CT_TextNoBullet {} + +export const CT_TextNoBullet_Attributes: Attributes = {}; + +export type ST_TextAutonumberScheme = + | 'alphaLcParenBoth' + | 'alphaUcParenBoth' + | 'alphaLcParenR' + | 'alphaUcParenR' + | 'alphaLcPeriod' + | 'alphaUcPeriod' + | 'arabicParenBoth' + | 'arabicParenR' + | 'arabicPeriod' + | 'arabicPlain' + | 'romanLcParenBoth' + | 'romanUcParenBoth' + | 'romanLcParenR' + | 'romanUcParenR' + | 'romanLcPeriod' + | 'romanUcPeriod' + | 'circleNumDbPlain' + | 'circleNumWdBlackPlain' + | 'circleNumWdWhitePlain' + | 'arabicDbPeriod' + | 'arabicDbPlain' + | 'ea1ChsPeriod' + | 'ea1ChsPlain' + | 'ea1ChtPeriod' + | 'ea1ChtPlain' + | 'ea1JpnChsDbPeriod' + | 'ea1JpnKorPlain' + | 'ea1JpnKorPeriod' + | 'arabic1Minus' + | 'arabic2Minus' + | 'hebrew2Minus' + | 'thaiAlphaPeriod' + | 'thaiAlphaParenR' + | 'thaiAlphaParenBoth' + | 'thaiNumPeriod' + | 'thaiNumParenR' + | 'thaiNumParenBoth' + | 'hindiAlphaPeriod' + | 'hindiNumPeriod' + | 'hindiNumParenR' + | 'hindiAlpha1Period'; + +export type ST_TextBulletStartAtNum = number; + +export interface CT_TextAutonumberBullet { + type?: ST_TextAutonumberScheme; + startAt?: number; +} + +export const CT_TextAutonumberBullet_Attributes: Attributes = { + type: { + type: 'string' + }, + startAt: { + type: 'int', + defaultValue: '1' + } +}; + +export interface CT_TextCharBullet { + char?: string; +} + +export const CT_TextCharBullet_Attributes: Attributes = { + char: { + type: 'string' + } +}; + +export interface CT_TextBlipBullet { + blip?: CT_Blip; +} + +export const CT_TextBlipBullet_Attributes: Attributes = { + blip: { + type: 'child', + childAttributes: CT_Blip_Attributes + } +}; + +export type ST_TextTabAlignType = 'l' | 'ctr' | 'r' | 'dec'; + +export interface CT_TextTabStop { + pos?: ST_Coordinate32; + algn?: ST_TextTabAlignType; +} + +export const CT_TextTabStop_Attributes: Attributes = { + pos: { + type: 'string' + }, + algn: { + type: 'string' + } +}; + +export interface CT_TextTabStopList { + tab?: CT_TextTabStop[]; +} + +export const CT_TextTabStopList_Attributes: Attributes = { + tab: { + type: 'child', + childAttributes: CT_TextTabStop_Attributes, + childIsArray: true + } +}; + +export interface CT_TextUnderlineLineFollowText {} + +export const CT_TextUnderlineLineFollowText_Attributes: Attributes = {}; + +export interface CT_TextUnderlineFillFollowText {} + +export const CT_TextUnderlineFillFollowText_Attributes: Attributes = {}; + +export interface CT_TextUnderlineFillGroupWrapper {} + +export const CT_TextUnderlineFillGroupWrapper_Attributes: Attributes = {}; + +export interface CT_X { + v?: number; +} + +export const CT_X_Attributes: Attributes = { + v: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_Boolean { + x?: CT_X[]; + v?: boolean; + u?: boolean; + f?: boolean; + c?: string; + cp?: number; +} + +export const CT_Boolean_Attributes: Attributes = { + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + v: { + type: 'boolean' + }, + u: { + type: 'boolean' + }, + f: { + type: 'boolean' + }, + c: { + type: 'string' + }, + cp: { + type: 'int' + } +}; + +export type ST_TextUnderlineType = + | 'none' + | 'words' + | 'sng' + | 'dbl' + | 'heavy' + | 'dotted' + | 'dottedHeavy' + | 'dash' + | 'dashHeavy' + | 'dashLong' + | 'dashLongHeavy' + | 'dotDash' + | 'dotDashHeavy' + | 'dotDotDash' + | 'dotDotDashHeavy' + | 'wavy' + | 'wavyHeavy' + | 'wavyDbl'; + +export type ST_TextStrikeType = 'noStrike' | 'sngStrike' | 'dblStrike'; + +export type ST_TextNonNegativePoint = number; + +export type ST_TextCapsType = 'none' | 'small' | 'all'; + +export type ST_TextPoint = ST_TextPointUnqualified | ST_UniversalMeasure; + +export interface CT_TextCharacterProperties { + ln?: CT_LineProperties; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + highlight?: CT_Color; + uLnTx?: CT_TextUnderlineLineFollowText[]; + uLn?: CT_LineProperties; + uFillTx?: CT_TextUnderlineFillFollowText[]; + uFill?: CT_TextUnderlineFillGroupWrapper[]; + latin?: CT_TextFont; + ea?: CT_TextFont; + cs?: CT_TextFont; + sym?: CT_TextFont; + hlinkClick?: CT_Hyperlink; + hlinkMouseOver?: CT_Hyperlink; + rtl?: CT_Boolean[]; + extLst?: CT_OfficeArtExtensionList; + kumimoji?: boolean; + lang?: string; + altLang?: string; + sz?: number; + b?: boolean; + i?: boolean; + u?: ST_TextUnderlineType; + strike?: ST_TextStrikeType; + kern?: number; + cap?: ST_TextCapsType; + spc?: ST_TextPoint; + normalizeH?: boolean; + baseline?: string; + noProof?: boolean; + dirty?: boolean; + err?: boolean; + smtClean?: boolean; + smtId?: number; + bmk?: string; +} + +export const CT_TextCharacterProperties_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + highlight: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + uLnTx: { + type: 'child', + childAttributes: CT_TextUnderlineLineFollowText_Attributes, + childIsArray: true + }, + uLn: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + uFillTx: { + type: 'child', + childAttributes: CT_TextUnderlineFillFollowText_Attributes, + childIsArray: true + }, + uFill: { + type: 'child', + childAttributes: CT_TextUnderlineFillGroupWrapper_Attributes, + childIsArray: true + }, + latin: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + ea: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + cs: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + sym: { + type: 'child', + childAttributes: CT_TextFont_Attributes + }, + hlinkClick: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + hlinkMouseOver: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes + }, + rtl: { + type: 'child', + childAttributes: CT_Boolean_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + kumimoji: { + type: 'boolean' + }, + lang: { + type: 'string' + }, + altLang: { + type: 'string' + }, + sz: { + type: 'int' + }, + b: { + type: 'boolean' + }, + i: { + type: 'boolean' + }, + u: { + type: 'string' + }, + strike: { + type: 'string' + }, + kern: { + type: 'int' + }, + cap: { + type: 'string', + defaultValue: 'none' + }, + spc: { + type: 'string' + }, + normalizeH: { + type: 'boolean' + }, + baseline: { + type: 'string' + }, + noProof: { + type: 'boolean' + }, + dirty: { + type: 'boolean', + defaultValue: 'true' + }, + err: { + type: 'boolean', + defaultValue: 'false' + }, + smtClean: { + type: 'boolean', + defaultValue: 'true' + }, + smtId: { + type: 'int', + defaultValue: '0' + }, + bmk: { + type: 'string' + } +}; + +export type ST_TextMargin = ST_Coordinate32Unqualified; + +export type ST_TextIndentLevelType = number; + +export type ST_TextIndent = ST_Coordinate32Unqualified; + +export type ST_TextAlignType = + | 'l' + | 'ctr' + | 'r' + | 'just' + | 'justLow' + | 'dist' + | 'thaiDist'; + +export type ST_TextFontAlignType = 'auto' | 't' | 'ctr' | 'base' | 'b'; + +export interface CT_TextParagraphProperties { + lnSpc?: CT_TextSpacing; + spcBef?: CT_TextSpacing; + spcAft?: CT_TextSpacing; + buClrTx?: CT_TextBulletColorFollowText; + buClr?: CT_Color; + buSzTx?: CT_TextBulletSizeFollowText[]; + buSzPct?: CT_TextBulletSizePercent[]; + buSzPts?: CT_TextBulletSizePoint[]; + buFontTx?: CT_TextBulletTypefaceFollowText[]; + buFont?: CT_TextFont[]; + buNone?: CT_TextNoBullet[]; + buAutoNum?: CT_TextAutonumberBullet[]; + buChar?: CT_TextCharBullet[]; + buBlip?: CT_TextBlipBullet[]; + tabLst?: CT_TextTabStopList; + defRPr?: CT_TextCharacterProperties; + extLst?: CT_OfficeArtExtensionList; + marL?: number; + marR?: number; + lvl?: number; + indent?: number; + algn?: ST_TextAlignType; + defTabSz?: ST_Coordinate32; + rtl?: boolean; + eaLnBrk?: boolean; + fontAlgn?: ST_TextFontAlignType; + latinLnBrk?: boolean; + hangingPunct?: boolean; +} + +export const CT_TextParagraphProperties_Attributes: Attributes = { + lnSpc: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + spcBef: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + spcAft: { + type: 'child', + childAttributes: CT_TextSpacing_Attributes + }, + buClrTx: { + type: 'child', + childAttributes: CT_TextBulletColorFollowText_Attributes + }, + buClr: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + buSzTx: { + type: 'child', + childAttributes: CT_TextBulletSizeFollowText_Attributes, + childIsArray: true + }, + buSzPct: { + type: 'child', + childAttributes: CT_TextBulletSizePercent_Attributes, + childIsArray: true + }, + buSzPts: { + type: 'child', + childAttributes: CT_TextBulletSizePoint_Attributes, + childIsArray: true + }, + buFontTx: { + type: 'child', + childAttributes: CT_TextBulletTypefaceFollowText_Attributes, + childIsArray: true + }, + buFont: { + type: 'child', + childAttributes: CT_TextFont_Attributes, + childIsArray: true + }, + buNone: { + type: 'child', + childAttributes: CT_TextNoBullet_Attributes, + childIsArray: true + }, + buAutoNum: { + type: 'child', + childAttributes: CT_TextAutonumberBullet_Attributes, + childIsArray: true + }, + buChar: { + type: 'child', + childAttributes: CT_TextCharBullet_Attributes, + childIsArray: true + }, + buBlip: { + type: 'child', + childAttributes: CT_TextBlipBullet_Attributes, + childIsArray: true + }, + tabLst: { + type: 'child', + childAttributes: CT_TextTabStopList_Attributes + }, + defRPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + marL: { + type: 'int' + }, + marR: { + type: 'int' + }, + lvl: { + type: 'int' + }, + indent: { + type: 'int' + }, + algn: { + type: 'string' + }, + defTabSz: { + type: 'string' + }, + rtl: { + type: 'boolean' + }, + eaLnBrk: { + type: 'boolean' + }, + fontAlgn: { + type: 'string' + }, + latinLnBrk: { + type: 'boolean' + }, + hangingPunct: { + type: 'boolean' + } +}; + +export interface CT_TextListStyle { + defPPr?: CT_TextParagraphProperties; + lvl1pPr?: CT_TextParagraphProperties; + lvl2pPr?: CT_TextParagraphProperties; + lvl3pPr?: CT_TextParagraphProperties; + lvl4pPr?: CT_TextParagraphProperties; + lvl5pPr?: CT_TextParagraphProperties; + lvl6pPr?: CT_TextParagraphProperties; + lvl7pPr?: CT_TextParagraphProperties; + lvl8pPr?: CT_TextParagraphProperties; + lvl9pPr?: CT_TextParagraphProperties; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_TextListStyle_Attributes: Attributes = { + defPPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl1pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl2pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl3pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl4pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl5pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl6pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl7pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl8pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + lvl9pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_RegularTextRun { + rPr?: CT_TextCharacterProperties; + t?: string; +} + +export const CT_RegularTextRun_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + }, + t: { + type: 'child-string' + } +}; + +export interface CT_TextLineBreak { + rPr?: CT_TextCharacterProperties; +} + +export const CT_TextLineBreak_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + } +}; + +export interface CT_TextParagraph { + pPr?: CT_TextParagraphProperties; + r?: CT_RegularTextRun[]; + br?: CT_TextLineBreak[]; + fld?: CT_TextField[]; + endParaRPr?: CT_TextCharacterProperties; +} + +export const CT_TextParagraph_Attributes: Attributes = { + pPr: { + type: 'child', + childAttributes: CT_TextParagraphProperties_Attributes + }, + r: { + type: 'child', + childAttributes: CT_RegularTextRun_Attributes, + childIsArray: true + }, + br: { + type: 'child', + childAttributes: CT_TextLineBreak_Attributes, + childIsArray: true + }, + fld: { + type: 'child', + childAttributes: CT_TextField_Attributes, + childIsArray: true + }, + endParaRPr: { + type: 'child', + childAttributes: CT_TextCharacterProperties_Attributes + } +}; + +export interface CT_TextBody { + bodyPr?: CT_TextBodyProperties; + lstStyle?: CT_TextListStyle; + p?: CT_TextParagraph[]; +} + +export const CT_TextBody_Attributes: Attributes = { + bodyPr: { + type: 'child', + childAttributes: CT_TextBodyProperties_Attributes + }, + lstStyle: { + type: 'child', + childAttributes: CT_TextListStyle_Attributes + }, + p: { + type: 'child', + childAttributes: CT_TextParagraph_Attributes, + childIsArray: true + } +}; + +export interface CT_GvmlTextShape { + txBody?: CT_TextBody; + useSpRect?: CT_GvmlUseShapeRectangle; + xfrm?: CT_Transform2D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlTextShape_Attributes: Attributes = { + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + useSpRect: { + type: 'child', + childAttributes: CT_GvmlUseShapeRectangle_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvSpPr?: CT_NonVisualDrawingShapeProps; +} + +export const CT_GvmlShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvSpPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingShapeProps_Attributes + } +}; + +export type ST_AdjCoordinate = ST_Coordinate | ST_GeomGuideName; + +export interface CT_AdjPoint2D { + x?: ST_AdjCoordinate; + y?: ST_AdjCoordinate; +} + +export const CT_AdjPoint2D_Attributes: Attributes = { + x: { + type: 'string' + }, + y: { + type: 'string' + } +}; + +export interface CT_XYAdjustHandle { + pos?: CT_AdjPoint2D; + gdRefX?: string; + minX?: ST_AdjCoordinate; + maxX?: ST_AdjCoordinate; + gdRefY?: string; + minY?: ST_AdjCoordinate; + maxY?: ST_AdjCoordinate; +} + +export const CT_XYAdjustHandle_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + gdRefX: { + type: 'string' + }, + minX: { + type: 'string' + }, + maxX: { + type: 'string' + }, + gdRefY: { + type: 'string' + }, + minY: { + type: 'string' + }, + maxY: { + type: 'string' + } +}; + +export type ST_AdjAngle = ST_Angle | ST_GeomGuideName; + +export interface CT_PolarAdjustHandle { + pos?: CT_AdjPoint2D; + gdRefR?: string; + minR?: ST_AdjCoordinate; + maxR?: ST_AdjCoordinate; + gdRefAng?: string; + minAng?: ST_AdjAngle; + maxAng?: ST_AdjAngle; +} + +export const CT_PolarAdjustHandle_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + gdRefR: { + type: 'string' + }, + minR: { + type: 'string' + }, + maxR: { + type: 'string' + }, + gdRefAng: { + type: 'string' + }, + minAng: { + type: 'string' + }, + maxAng: { + type: 'string' + } +}; + +export interface CT_AdjustHandleList { + ahXY?: CT_XYAdjustHandle; + ahPolar?: CT_PolarAdjustHandle; +} + +export const CT_AdjustHandleList_Attributes: Attributes = { + ahXY: { + type: 'child', + childAttributes: CT_XYAdjustHandle_Attributes + }, + ahPolar: { + type: 'child', + childAttributes: CT_PolarAdjustHandle_Attributes + } +}; + +export interface CT_ConnectionSite { + pos?: CT_AdjPoint2D; + ang?: ST_AdjAngle; +} + +export const CT_ConnectionSite_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + }, + ang: { + type: 'string' + } +}; + +export interface CT_ConnectionSiteList { + cxn?: CT_ConnectionSite[]; +} + +export const CT_ConnectionSiteList_Attributes: Attributes = { + cxn: { + type: 'child', + childAttributes: CT_ConnectionSite_Attributes, + childIsArray: true + } +}; + +export interface CT_GeomRect { + l?: ST_AdjCoordinate; + t?: ST_AdjCoordinate; + r?: ST_AdjCoordinate; + b?: ST_AdjCoordinate; +} + +export const CT_GeomRect_Attributes: Attributes = { + l: { + type: 'string' + }, + t: { + type: 'string' + }, + r: { + type: 'string' + }, + b: { + type: 'string' + } +}; + +export interface CT_Path2DClose {} + +export const CT_Path2DClose_Attributes: Attributes = {}; + +export interface CT_Path2DMoveTo { + pt?: CT_AdjPoint2D; +} + +export const CT_Path2DMoveTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + } +}; + +export interface CT_Path2DLineTo { + pt?: CT_AdjPoint2D; +} + +export const CT_Path2DLineTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes + } +}; + +export interface CT_Path2DArcTo { + wR?: ST_AdjCoordinate; + hR?: ST_AdjCoordinate; + stAng?: ST_AdjAngle; + swAng?: ST_AdjAngle; +} + +export const CT_Path2DArcTo_Attributes: Attributes = { + wR: { + type: 'string' + }, + hR: { + type: 'string' + }, + stAng: { + type: 'string' + }, + swAng: { + type: 'string' + } +}; + +export interface CT_Path2DQuadBezierTo { + pt?: CT_AdjPoint2D[]; +} + +export const CT_Path2DQuadBezierTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes, + childIsArray: true + } +}; + +export interface CT_Path2DCubicBezierTo { + pt?: CT_AdjPoint2D[]; +} + +export const CT_Path2DCubicBezierTo_Attributes: Attributes = { + pt: { + type: 'child', + childAttributes: CT_AdjPoint2D_Attributes, + childIsArray: true + } +}; + +export type ST_PathFillMode = + | 'none' + | 'norm' + | 'lighten' + | 'lightenLess' + | 'darken' + | 'darkenLess'; + +export interface CT_Path2D { + close?: CT_Path2DClose; + moveTo?: CT_Path2DMoveTo; + lnTo?: CT_Path2DLineTo; + arcTo?: CT_Path2DArcTo; + quadBezTo?: CT_Path2DQuadBezierTo; + cubicBezTo?: CT_Path2DCubicBezierTo; + w?: number; + h?: number; + fill?: ST_PathFillMode; + stroke?: boolean; + extrusionOk?: boolean; +} + +export const CT_Path2D_Attributes: Attributes = { + close: { + type: 'child', + childAttributes: CT_Path2DClose_Attributes + }, + moveTo: { + type: 'child', + childAttributes: CT_Path2DMoveTo_Attributes + }, + lnTo: { + type: 'child', + childAttributes: CT_Path2DLineTo_Attributes + }, + arcTo: { + type: 'child', + childAttributes: CT_Path2DArcTo_Attributes + }, + quadBezTo: { + type: 'child', + childAttributes: CT_Path2DQuadBezierTo_Attributes + }, + cubicBezTo: { + type: 'child', + childAttributes: CT_Path2DCubicBezierTo_Attributes + }, + w: { + type: 'int', + defaultValue: '0' + }, + h: { + type: 'int', + defaultValue: '0' + }, + fill: { + type: 'string', + defaultValue: 'norm' + }, + stroke: { + type: 'boolean', + defaultValue: 'true' + }, + extrusionOk: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_Path2DList { + path?: CT_Path2D[]; +} + +export const CT_Path2DList_Attributes: Attributes = { + path: { + type: 'child', + childAttributes: CT_Path2D_Attributes, + childIsArray: true + } +}; + +export interface CT_CustomGeometry2D { + avLst?: CT_GeomGuideList; + gdLst?: CT_GeomGuideList; + ahLst?: CT_AdjustHandleList; + cxnLst?: CT_ConnectionSiteList; + rect?: CT_GeomRect; + pathLst?: CT_Path2DList; +} + +export const CT_CustomGeometry2D_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + gdLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + ahLst: { + type: 'child', + childAttributes: CT_AdjustHandleList_Attributes + }, + cxnLst: { + type: 'child', + childAttributes: CT_ConnectionSiteList_Attributes + }, + rect: { + type: 'child', + childAttributes: CT_GeomRect_Attributes + }, + pathLst: { + type: 'child', + childAttributes: CT_Path2DList_Attributes + } +}; + +export type ST_ShapeType = + | 'line' + | 'lineInv' + | 'triangle' + | 'rtTriangle' + | 'rect' + | 'diamond' + | 'parallelogram' + | 'trapezoid' + | 'nonIsoscelesTrapezoid' + | 'pentagon' + | 'hexagon' + | 'heptagon' + | 'octagon' + | 'decagon' + | 'dodecagon' + | 'star4' + | 'star5' + | 'star6' + | 'star7' + | 'star8' + | 'star10' + | 'star12' + | 'star16' + | 'star24' + | 'star32' + | 'roundRect' + | 'round1Rect' + | 'round2SameRect' + | 'round2DiagRect' + | 'snipRoundRect' + | 'snip1Rect' + | 'snip2SameRect' + | 'snip2DiagRect' + | 'plaque' + | 'ellipse' + | 'teardrop' + | 'homePlate' + | 'chevron' + | 'pieWedge' + | 'pie' + | 'blockArc' + | 'donut' + | 'noSmoking' + | 'rightArrow' + | 'leftArrow' + | 'upArrow' + | 'downArrow' + | 'stripedRightArrow' + | 'notchedRightArrow' + | 'bentUpArrow' + | 'leftRightArrow' + | 'upDownArrow' + | 'leftUpArrow' + | 'leftRightUpArrow' + | 'quadArrow' + | 'leftArrowCallout' + | 'rightArrowCallout' + | 'upArrowCallout' + | 'downArrowCallout' + | 'leftRightArrowCallout' + | 'upDownArrowCallout' + | 'quadArrowCallout' + | 'bentArrow' + | 'uturnArrow' + | 'circularArrow' + | 'leftCircularArrow' + | 'leftRightCircularArrow' + | 'curvedRightArrow' + | 'curvedLeftArrow' + | 'curvedUpArrow' + | 'curvedDownArrow' + | 'swooshArrow' + | 'cube' + | 'can' + | 'lightningBolt' + | 'heart' + | 'sun' + | 'moon' + | 'smileyFace' + | 'irregularSeal1' + | 'irregularSeal2' + | 'foldedCorner' + | 'bevel' + | 'frame' + | 'halfFrame' + | 'corner' + | 'diagStripe' + | 'chord' + | 'arc' + | 'leftBracket' + | 'rightBracket' + | 'leftBrace' + | 'rightBrace' + | 'bracketPair' + | 'bracePair' + | 'straightConnector1' + | 'bentConnector2' + | 'bentConnector3' + | 'bentConnector4' + | 'bentConnector5' + | 'curvedConnector2' + | 'curvedConnector3' + | 'curvedConnector4' + | 'curvedConnector5' + | 'callout1' + | 'callout2' + | 'callout3' + | 'accentCallout1' + | 'accentCallout2' + | 'accentCallout3' + | 'borderCallout1' + | 'borderCallout2' + | 'borderCallout3' + | 'accentBorderCallout1' + | 'accentBorderCallout2' + | 'accentBorderCallout3' + | 'wedgeRectCallout' + | 'wedgeRoundRectCallout' + | 'wedgeEllipseCallout' + | 'cloudCallout' + | 'cloud' + | 'ribbon' + | 'ribbon2' + | 'ellipseRibbon' + | 'ellipseRibbon2' + | 'leftRightRibbon' + | 'verticalScroll' + | 'horizontalScroll' + | 'wave' + | 'doubleWave' + | 'plus' + | 'flowChartProcess' + | 'flowChartDecision' + | 'flowChartInputOutput' + | 'flowChartPredefinedProcess' + | 'flowChartInternalStorage' + | 'flowChartDocument' + | 'flowChartMultidocument' + | 'flowChartTerminator' + | 'flowChartPreparation' + | 'flowChartManualInput' + | 'flowChartManualOperation' + | 'flowChartConnector' + | 'flowChartPunchedCard' + | 'flowChartPunchedTape' + | 'flowChartSummingJunction' + | 'flowChartOr' + | 'flowChartCollate' + | 'flowChartSort' + | 'flowChartExtract' + | 'flowChartMerge' + | 'flowChartOfflineStorage' + | 'flowChartOnlineStorage' + | 'flowChartMagneticTape' + | 'flowChartMagneticDisk' + | 'flowChartMagneticDrum' + | 'flowChartDisplay' + | 'flowChartDelay' + | 'flowChartAlternateProcess' + | 'flowChartOffpageConnector' + | 'actionButtonBlank' + | 'actionButtonHome' + | 'actionButtonHelp' + | 'actionButtonInformation' + | 'actionButtonForwardNext' + | 'actionButtonBackPrevious' + | 'actionButtonEnd' + | 'actionButtonBeginning' + | 'actionButtonReturn' + | 'actionButtonDocument' + | 'actionButtonSound' + | 'actionButtonMovie' + | 'gear6' + | 'gear9' + | 'funnel' + | 'mathPlus' + | 'mathMinus' + | 'mathMultiply' + | 'mathDivide' + | 'mathEqual' + | 'mathNotEqual' + | 'cornerTabs' + | 'squareTabs' + | 'plaqueTabs' + | 'chartX' + | 'chartStar' + | 'chartPlus'; + +export interface CT_PresetGeometry2D { + avLst?: CT_GeomGuideList; + prst?: ST_ShapeType; +} + +export const CT_PresetGeometry2D_Attributes: Attributes = { + avLst: { + type: 'child', + childAttributes: CT_GeomGuideList_Attributes + }, + prst: { + type: 'string' + } +}; + +export interface CT_ShapeProperties { + xfrm?: CT_Transform2D; + custGeom?: CT_CustomGeometry2D; + prstGeom?: CT_PresetGeometry2D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + ln?: CT_LineProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + sp3d?: CT_Shape3D; + extLst?: CT_OfficeArtExtensionList; + bwMode?: ST_BlackWhiteMode; +} + +export const CT_ShapeProperties_Attributes: Attributes = { + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + custGeom: { + type: 'child', + childAttributes: CT_CustomGeometry2D_Attributes + }, + prstGeom: { + type: 'child', + childAttributes: CT_PresetGeometry2D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + sp3d: { + type: 'child', + childAttributes: CT_Shape3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bwMode: { + type: 'string' + } +}; + +export interface CT_StyleMatrixReference { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + idx?: number; +} + +export const CT_StyleMatrixReference_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + idx: { + type: 'int' + } +}; + +export interface CT_FontReference { + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + idx?: ST_FontCollectionIndex; +} + +export const CT_FontReference_Attributes: Attributes = { + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + idx: { + type: 'string' + } +}; + +export interface CT_ShapeStyle { + lnRef?: CT_StyleMatrixReference; + fillRef?: CT_StyleMatrixReference; + effectRef?: CT_StyleMatrixReference; + fontRef?: CT_FontReference; +} + +export const CT_ShapeStyle_Attributes: Attributes = { + lnRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + effectRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + fontRef: { + type: 'child', + childAttributes: CT_FontReference_Attributes + } +}; + +export interface CT_GvmlShape { + nvSpPr?: CT_GvmlShapeNonVisual; + spPr?: CT_ShapeProperties; + txSp?: CT_GvmlTextShape; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlShape_Attributes: Attributes = { + nvSpPr: { + type: 'child', + childAttributes: CT_GvmlShapeNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + txSp: { + type: 'child', + childAttributes: CT_GvmlTextShape_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlConnectorNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvCxnSpPr?: CT_NonVisualConnectorProperties; +} + +export const CT_GvmlConnectorNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvCxnSpPr: { + type: 'child', + childAttributes: CT_NonVisualConnectorProperties_Attributes + } +}; + +export interface CT_GvmlConnector { + nvCxnSpPr?: CT_GvmlConnectorNonVisual; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlConnector_Attributes: Attributes = { + nvCxnSpPr: { + type: 'child', + childAttributes: CT_GvmlConnectorNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlPictureNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvPicPr?: CT_NonVisualPictureProperties; +} + +export const CT_GvmlPictureNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvPicPr: { + type: 'child', + childAttributes: CT_NonVisualPictureProperties_Attributes + } +}; + +export interface CT_GvmlPicture { + nvPicPr?: CT_GvmlPictureNonVisual; + blipFill?: CT_BlipFillProperties; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlPicture_Attributes: Attributes = { + nvPicPr: { + type: 'child', + childAttributes: CT_GvmlPictureNonVisual_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlGraphicFrameNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGraphicFramePr?: CT_NonVisualGraphicFrameProperties; +} + +export const CT_GvmlGraphicFrameNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGraphicFramePr: { + type: 'child', + childAttributes: CT_NonVisualGraphicFrameProperties_Attributes + } +}; + +export interface CT_GvmlGraphicalObjectFrame { + nvGraphicFramePr?: CT_GvmlGraphicFrameNonVisual; + xfrm?: CT_Transform2D; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_GvmlGraphicalObjectFrame_Attributes: Attributes = { + nvGraphicFramePr: { + type: 'child', + childAttributes: CT_GvmlGraphicFrameNonVisual_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_GvmlGroupShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGrpSpPr?: CT_NonVisualGroupDrawingShapeProps; +} + +export const CT_GvmlGroupShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGrpSpPr: { + type: 'child', + childAttributes: CT_NonVisualGroupDrawingShapeProps_Attributes + } +}; + +export type CT_GvmlGroupShape = any; +export const CT_GvmlGroupShape_Attributes: Attributes = {}; + +export interface CT_GroupShapeProperties { + xfrm?: CT_GroupTransform2D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + scene3d?: CT_Scene3D; + extLst?: CT_OfficeArtExtensionList; + bwMode?: ST_BlackWhiteMode; +} + +export const CT_GroupShapeProperties_Attributes: Attributes = { + xfrm: { + type: 'child', + childAttributes: CT_GroupTransform2D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + scene3d: { + type: 'child', + childAttributes: CT_Scene3D_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bwMode: { + type: 'string' + } +}; + +export interface CT_AlphaOutsetEffect { + rad?: ST_Coordinate; +} + +export const CT_AlphaOutsetEffect_Attributes: Attributes = { + rad: { + type: 'string', + defaultValue: '0' + } +}; + +export interface CT_RelativeOffsetEffect { + tx?: string; + ty?: string; +} + +export const CT_RelativeOffsetEffect_Attributes: Attributes = { + tx: { + type: 'string', + defaultValue: '0%' + }, + ty: { + type: 'string', + defaultValue: '0%' + } +}; + +export interface CT_TransformEffect { + sx?: string; + sy?: string; + kx?: number; + ky?: number; + tx?: ST_Coordinate; + ty?: ST_Coordinate; +} + +export const CT_TransformEffect_Attributes: Attributes = { + sx: { + type: 'string', + defaultValue: '100%' + }, + sy: { + type: 'string', + defaultValue: '100%' + }, + kx: { + type: 'int', + defaultValue: '0' + }, + ky: { + type: 'int', + defaultValue: '0' + }, + tx: { + type: 'string', + defaultValue: '0' + }, + ty: { + type: 'string', + defaultValue: '0' + } +}; + +export interface CT_FillProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_FillEffect { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; +} + +export const CT_FillEffect_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + } +}; + +export interface CT_EffectReference { + ref?: string; +} + +export const CT_EffectReference_Attributes: Attributes = { + ref: { + type: 'string' + } +}; + +export interface CT_BlendEffect { + cont?: CT_EffectContainer; + blend?: ST_BlendMode; +} + +export const CT_BlendEffect_Attributes: Attributes = { + cont: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + blend: { + type: 'string' + } +}; + +export interface CT_EffectProperties { + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; +} + +export const CT_EffectProperties_Attributes: Attributes = { + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + } +}; + +export type ST_ShapeID = string; + +export interface CT_DefaultShapeDefinition { + spPr?: CT_ShapeProperties; + bodyPr?: CT_TextBodyProperties; + lstStyle?: CT_TextListStyle; + style?: CT_ShapeStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_DefaultShapeDefinition_Attributes: Attributes = { + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + bodyPr: { + type: 'child', + childAttributes: CT_TextBodyProperties_Attributes + }, + lstStyle: { + type: 'child', + childAttributes: CT_TextListStyle_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_ObjectStyleDefaults { + spDef?: CT_DefaultShapeDefinition; + lnDef?: CT_DefaultShapeDefinition; + txDef?: CT_DefaultShapeDefinition; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_ObjectStyleDefaults_Attributes: Attributes = { + spDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + lnDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + txDef: { + type: 'child', + childAttributes: CT_DefaultShapeDefinition_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_EmptyElement {} + +export const CT_EmptyElement_Attributes: Attributes = {}; + +export interface CT_ColorMapping { + extLst?: CT_OfficeArtExtensionList; + bg1?: ST_ColorSchemeIndex; + tx1?: ST_ColorSchemeIndex; + bg2?: ST_ColorSchemeIndex; + tx2?: ST_ColorSchemeIndex; + accent1?: ST_ColorSchemeIndex; + accent2?: ST_ColorSchemeIndex; + accent3?: ST_ColorSchemeIndex; + accent4?: ST_ColorSchemeIndex; + accent5?: ST_ColorSchemeIndex; + accent6?: ST_ColorSchemeIndex; + hlink?: ST_ColorSchemeIndex; + folHlink?: ST_ColorSchemeIndex; +} + +export const CT_ColorMapping_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + bg1: { + type: 'string' + }, + tx1: { + type: 'string' + }, + bg2: { + type: 'string' + }, + tx2: { + type: 'string' + }, + accent1: { + type: 'string' + }, + accent2: { + type: 'string' + }, + accent3: { + type: 'string' + }, + accent4: { + type: 'string' + }, + accent5: { + type: 'string' + }, + accent6: { + type: 'string' + }, + hlink: { + type: 'string' + }, + folHlink: { + type: 'string' + } +}; + +export interface CT_ColorMappingOverride { + masterClrMapping?: CT_EmptyElement[]; + overrideClrMapping?: CT_ColorMapping[]; +} + +export const CT_ColorMappingOverride_Attributes: Attributes = { + masterClrMapping: { + type: 'child', + childAttributes: CT_EmptyElement_Attributes, + childIsArray: true + }, + overrideClrMapping: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes, + childIsArray: true + } +}; + +export interface CT_ColorSchemeAndMapping { + clrScheme?: CT_ColorScheme; + clrMap?: CT_ColorMapping; +} + +export const CT_ColorSchemeAndMapping_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + clrMap: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + } +}; + +export interface CT_ColorSchemeList { + extraClrScheme?: CT_ColorSchemeAndMapping[]; +} + +export const CT_ColorSchemeList_Attributes: Attributes = { + extraClrScheme: { + type: 'child', + childAttributes: CT_ColorSchemeAndMapping_Attributes, + childIsArray: true + } +}; + +export interface CT_OfficeStyleSheet { + themeElements?: CT_BaseStyles; + objectDefaults?: CT_ObjectStyleDefaults; + extraClrSchemeLst?: CT_ColorSchemeList; + custClrLst?: CT_CustomColorList; + extLst?: CT_OfficeArtExtensionList; + name?: string; +} + +export const CT_OfficeStyleSheet_Attributes: Attributes = { + themeElements: { + type: 'child', + childAttributes: CT_BaseStyles_Attributes + }, + objectDefaults: { + type: 'child', + childAttributes: CT_ObjectStyleDefaults_Attributes + }, + extraClrSchemeLst: { + type: 'child', + childAttributes: CT_ColorSchemeList_Attributes + }, + custClrLst: { + type: 'child', + childAttributes: CT_CustomColorList_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + name: { + type: 'string' + } +}; + +export interface CT_BaseStylesOverride { + clrScheme?: CT_ColorScheme; + fontScheme?: CT_FontScheme; + fmtScheme?: CT_StyleMatrix; +} + +export const CT_BaseStylesOverride_Attributes: Attributes = { + clrScheme: { + type: 'child', + childAttributes: CT_ColorScheme_Attributes + }, + fontScheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + }, + fmtScheme: { + type: 'child', + childAttributes: CT_StyleMatrix_Attributes + } +}; + +export interface CT_ClipboardStyleSheet { + themeElements?: CT_BaseStyles; + clrMap?: CT_ColorMapping; +} + +export const CT_ClipboardStyleSheet_Attributes: Attributes = { + themeElements: { + type: 'child', + childAttributes: CT_BaseStyles_Attributes + }, + clrMap: { + type: 'child', + childAttributes: CT_ColorMapping_Attributes + } +}; + +export interface CT_Cell3D { + bevel?: CT_Bevel; + lightRig?: CT_LightRig; + extLst?: CT_OfficeArtExtensionList; + prstMaterial?: ST_PresetMaterialType; +} + +export const CT_Cell3D_Attributes: Attributes = { + bevel: { + type: 'child', + childAttributes: CT_Bevel_Attributes + }, + lightRig: { + type: 'child', + childAttributes: CT_LightRig_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + prstMaterial: { + type: 'string', + defaultValue: 'plastic' + } +}; + +export interface CT_Headers { + header?: string[]; +} + +export const CT_Headers_Attributes: Attributes = { + header: { + type: 'child-string', + childIsArray: true + } +}; + +export interface CT_TableCellProperties { + lnL?: CT_LineProperties; + lnR?: CT_LineProperties; + lnT?: CT_LineProperties; + lnB?: CT_LineProperties; + lnTlToBr?: CT_LineProperties; + lnBlToTr?: CT_LineProperties; + cell3D?: CT_Cell3D; + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + headers?: CT_Headers[]; + extLst?: CT_OfficeArtExtensionList; + marL?: ST_Coordinate32; + marR?: ST_Coordinate32; + marT?: ST_Coordinate32; + marB?: ST_Coordinate32; + vert?: ST_TextVerticalType; + anchor?: ST_TextAnchoringType; + anchorCtr?: boolean; + horzOverflow?: ST_TextHorzOverflowType; +} + +export const CT_TableCellProperties_Attributes: Attributes = { + lnL: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnR: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnT: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnB: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnTlToBr: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnBlToTr: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + cell3D: { + type: 'child', + childAttributes: CT_Cell3D_Attributes + }, + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + headers: { + type: 'child', + childAttributes: CT_Headers_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + marL: { + type: 'string', + defaultValue: '91440' + }, + marR: { + type: 'string', + defaultValue: '91440' + }, + marT: { + type: 'string', + defaultValue: '45720' + }, + marB: { + type: 'string', + defaultValue: '45720' + }, + vert: { + type: 'string', + defaultValue: 'horz' + }, + anchor: { + type: 'string', + defaultValue: 't' + }, + anchorCtr: { + type: 'boolean', + defaultValue: 'false' + }, + horzOverflow: { + type: 'string', + defaultValue: 'clip' + } +}; + +export interface CT_TableCol { + extLst?: CT_OfficeArtExtensionList; + w?: ST_Coordinate; +} + +export const CT_TableCol_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + w: { + type: 'string' + } +}; + +export interface CT_TableGrid { + gridCol?: CT_TableCol[]; +} + +export const CT_TableGrid_Attributes: Attributes = { + gridCol: { + type: 'child', + childAttributes: CT_TableCol_Attributes, + childIsArray: true + } +}; + +export interface CT_TableCell { + txBody?: CT_TextBody; + tcPr?: CT_TableCellProperties; + extLst?: CT_OfficeArtExtensionList; + rowSpan?: number; + gridSpan?: number; + hMerge?: boolean; + vMerge?: boolean; + id?: string; +} + +export const CT_TableCell_Attributes: Attributes = { + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + tcPr: { + type: 'child', + childAttributes: CT_TableCellProperties_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rowSpan: { + type: 'int', + defaultValue: '1' + }, + gridSpan: { + type: 'int', + defaultValue: '1' + }, + hMerge: { + type: 'boolean', + defaultValue: 'false' + }, + vMerge: { + type: 'boolean', + defaultValue: 'false' + }, + id: { + type: 'string' + } +}; + +export interface CT_TableRow { + tc?: CT_TableCell[]; + extLst?: CT_OfficeArtExtensionList; + h?: ST_Coordinate; +} + +export const CT_TableRow_Attributes: Attributes = { + tc: { + type: 'child', + childAttributes: CT_TableCell_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + h: { + type: 'string' + } +}; + +export type ST_TableStyleType = + | 'wholeTable' + | 'headerRow' + | 'totalRow' + | 'firstColumn' + | 'lastColumn' + | 'firstRowStripe' + | 'secondRowStripe' + | 'firstColumnStripe' + | 'secondColumnStripe' + | 'firstHeaderCell' + | 'lastHeaderCell' + | 'firstTotalCell' + | 'lastTotalCell' + | 'firstSubtotalColumn' + | 'secondSubtotalColumn' + | 'thirdSubtotalColumn' + | 'firstSubtotalRow' + | 'secondSubtotalRow' + | 'thirdSubtotalRow' + | 'blankRow' + | 'firstColumnSubheading' + | 'secondColumnSubheading' + | 'thirdColumnSubheading' + | 'firstRowSubheading' + | 'secondRowSubheading' + | 'thirdRowSubheading' + | 'pageFieldLabels' + | 'pageFieldValues'; + +export type ST_DxfId = number; + +export interface CT_TableStyleElement { + type?: ST_TableStyleType; + size?: number; + dxfId?: number; +} + +export const CT_TableStyleElement_Attributes: Attributes = { + type: { + type: 'string' + }, + size: { + type: 'int', + defaultValue: '1' + }, + dxfId: { + type: 'int' + } +}; + +export interface CT_TableStyle { + tableStyleElement?: CT_TableStyleElement[]; + name?: string; + pivot?: boolean; + table?: boolean; + count?: number; +} + +export const CT_TableStyle_Attributes: Attributes = { + tableStyleElement: { + type: 'child', + childAttributes: CT_TableStyleElement_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + pivot: { + type: 'boolean', + defaultValue: 'true' + }, + table: { + type: 'boolean', + defaultValue: 'true' + }, + count: { + type: 'int' + } +}; + +export interface CT_TableProperties { + noFill?: CT_NoFillProperties; + solidFill?: CT_SolidColorFillProperties; + gradFill?: CT_GradientFillProperties; + blipFill?: CT_BlipFillProperties; + pattFill?: CT_PatternFillProperties; + grpFill?: CT_GroupFillProperties; + effectLst?: CT_EffectList; + effectDag?: CT_EffectContainer; + tableStyle?: CT_TableStyle[]; + tableStyleId?: string[]; + extLst?: CT_OfficeArtExtensionList; + rtl?: boolean; + firstRow?: boolean; + firstCol?: boolean; + lastRow?: boolean; + lastCol?: boolean; + bandRow?: boolean; + bandCol?: boolean; +} + +export const CT_TableProperties_Attributes: Attributes = { + noFill: { + type: 'child', + childAttributes: CT_NoFillProperties_Attributes + }, + solidFill: { + type: 'child', + childAttributes: CT_SolidColorFillProperties_Attributes + }, + gradFill: { + type: 'child', + childAttributes: CT_GradientFillProperties_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + pattFill: { + type: 'child', + childAttributes: CT_PatternFillProperties_Attributes + }, + grpFill: { + type: 'child', + childAttributes: CT_GroupFillProperties_Attributes + }, + effectLst: { + type: 'child', + childAttributes: CT_EffectList_Attributes + }, + effectDag: { + type: 'child', + childAttributes: CT_EffectContainer_Attributes + }, + tableStyle: { + type: 'child', + childAttributes: CT_TableStyle_Attributes, + childIsArray: true + }, + tableStyleId: { + type: 'string', + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + rtl: { + type: 'boolean', + defaultValue: 'false' + }, + firstRow: { + type: 'boolean', + defaultValue: 'false' + }, + firstCol: { + type: 'boolean', + defaultValue: 'false' + }, + lastRow: { + type: 'boolean', + defaultValue: 'false' + }, + lastCol: { + type: 'boolean', + defaultValue: 'false' + }, + bandRow: { + type: 'boolean', + defaultValue: 'false' + }, + bandCol: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ThemeableLineStyle { + ln?: CT_LineProperties; + lnRef?: CT_StyleMatrixReference; +} + +export const CT_ThemeableLineStyle_Attributes: Attributes = { + ln: { + type: 'child', + childAttributes: CT_LineProperties_Attributes + }, + lnRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + } +}; + +export type ST_OnOffStyleType = 'on' | 'off' | 'def'; + +export interface CT_TableStyleTextStyle { + font?: CT_FontCollection; + fontRef?: CT_FontReference; + scrgbClr?: CT_ScRgbColor; + srgbClr?: CT_SRgbColor; + hslClr?: CT_HslColor; + sysClr?: CT_SystemColor; + schemeClr?: CT_SchemeColor; + prstClr?: CT_PresetColor; + extLst?: CT_OfficeArtExtensionList; + b?: ST_OnOffStyleType; + i?: ST_OnOffStyleType; +} + +export const CT_TableStyleTextStyle_Attributes: Attributes = { + font: { + type: 'child', + childAttributes: CT_FontCollection_Attributes + }, + fontRef: { + type: 'child', + childAttributes: CT_FontReference_Attributes + }, + scrgbClr: { + type: 'child', + childAttributes: CT_ScRgbColor_Attributes + }, + srgbClr: { + type: 'child', + childAttributes: CT_SRgbColor_Attributes + }, + hslClr: { + type: 'child', + childAttributes: CT_HslColor_Attributes + }, + sysClr: { + type: 'child', + childAttributes: CT_SystemColor_Attributes + }, + schemeClr: { + type: 'child', + childAttributes: CT_SchemeColor_Attributes + }, + prstClr: { + type: 'child', + childAttributes: CT_PresetColor_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + }, + b: { + type: 'string', + defaultValue: 'def' + }, + i: { + type: 'string', + defaultValue: 'def' + } +}; + +export interface CT_TableCellBorderStyle { + left?: CT_ThemeableLineStyle; + right?: CT_ThemeableLineStyle; + top?: CT_ThemeableLineStyle; + bottom?: CT_ThemeableLineStyle; + insideH?: CT_ThemeableLineStyle; + insideV?: CT_ThemeableLineStyle; + tl2br?: CT_ThemeableLineStyle; + tr2bl?: CT_ThemeableLineStyle; + extLst?: CT_OfficeArtExtensionList; +} + +export const CT_TableCellBorderStyle_Attributes: Attributes = { + left: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + right: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + top: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + bottom: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + insideH: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + insideV: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + tl2br: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + tr2bl: { + type: 'child', + childAttributes: CT_ThemeableLineStyle_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_OfficeArtExtensionList_Attributes + } +}; + +export interface CT_TableBackgroundStyle { + fill?: CT_FillProperties; + fillRef?: CT_StyleMatrixReference; + effect?: CT_EffectProperties; + effectRef?: CT_StyleMatrixReference; +} + +export const CT_TableBackgroundStyle_Attributes: Attributes = { + fill: { + type: 'child', + childAttributes: CT_FillProperties_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + effect: { + type: 'child', + childAttributes: CT_EffectProperties_Attributes + }, + effectRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + } +}; + +export interface CT_TableStyleCellStyle { + tcBdr?: CT_TableCellBorderStyle; + fill?: CT_FillProperties; + fillRef?: CT_StyleMatrixReference; + cell3D?: CT_Cell3D; +} + +export const CT_TableStyleCellStyle_Attributes: Attributes = { + tcBdr: { + type: 'child', + childAttributes: CT_TableCellBorderStyle_Attributes + }, + fill: { + type: 'child', + childAttributes: CT_FillProperties_Attributes + }, + fillRef: { + type: 'child', + childAttributes: CT_StyleMatrixReference_Attributes + }, + cell3D: { + type: 'child', + childAttributes: CT_Cell3D_Attributes + } +}; + +export interface CT_TablePartStyle { + tcTxStyle?: CT_TableStyleTextStyle; + tcStyle?: CT_TableStyleCellStyle; +} + +export const CT_TablePartStyle_Attributes: Attributes = { + tcTxStyle: { + type: 'child', + childAttributes: CT_TableStyleTextStyle_Attributes + }, + tcStyle: { + type: 'child', + childAttributes: CT_TableStyleCellStyle_Attributes + } +}; + +export interface CT_TableStyleList { + tblStyle?: CT_TableStyle[]; + def?: string; +} + +export const CT_TableStyleList_Attributes: Attributes = { + tblStyle: { + type: 'child', + childAttributes: CT_TableStyle_Attributes, + childIsArray: true + }, + def: { + type: 'string' + } +}; + +export type ST_TextBulletSize = string; + +export type ST_TextPointUnqualified = number; + +export interface CT_AnchorClientData { + fLocksWithSheet?: boolean; + fPrintsWithSheet?: boolean; +} + +export const CT_AnchorClientData_Attributes: Attributes = { + fLocksWithSheet: { + type: 'boolean', + defaultValue: 'true' + }, + fPrintsWithSheet: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_ShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvSpPr?: CT_NonVisualDrawingShapeProps; +} + +export const CT_ShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvSpPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingShapeProps_Attributes + } +}; + +export interface CT_Shape { + nvSpPr?: CT_ShapeNonVisual; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + txBody?: CT_TextBody; + macro?: string; + textlink?: string; + fLocksText?: boolean; + fPublished?: boolean; +} + +export const CT_Shape_Attributes: Attributes = { + nvSpPr: { + type: 'child', + childAttributes: CT_ShapeNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + txBody: { + type: 'child', + childAttributes: CT_TextBody_Attributes + }, + macro: { + type: 'string' + }, + textlink: { + type: 'string' + }, + fLocksText: { + type: 'boolean', + defaultValue: 'true' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ConnectorNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvCxnSpPr?: CT_NonVisualConnectorProperties; +} + +export const CT_ConnectorNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvCxnSpPr: { + type: 'child', + childAttributes: CT_NonVisualConnectorProperties_Attributes + } +}; + +export interface CT_Connector { + nvCxnSpPr?: CT_ConnectorNonVisual; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + macro?: string; + fPublished?: boolean; +} + +export const CT_Connector_Attributes: Attributes = { + nvCxnSpPr: { + type: 'child', + childAttributes: CT_ConnectorNonVisual_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + macro: { + type: 'string' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PictureNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvPicPr?: CT_NonVisualPictureProperties; +} + +export const CT_PictureNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvPicPr: { + type: 'child', + childAttributes: CT_NonVisualPictureProperties_Attributes + } +}; + +export interface CT_Picture { + nvPicPr?: CT_PictureNonVisual; + blipFill?: CT_BlipFillProperties; + spPr?: CT_ShapeProperties; + style?: CT_ShapeStyle; + macro?: string; + fPublished?: boolean; +} + +export const CT_Picture_Attributes: Attributes = { + nvPicPr: { + type: 'child', + childAttributes: CT_PictureNonVisual_Attributes + }, + blipFill: { + type: 'child', + childAttributes: CT_BlipFillProperties_Attributes + }, + spPr: { + type: 'child', + childAttributes: CT_ShapeProperties_Attributes + }, + style: { + type: 'child', + childAttributes: CT_ShapeStyle_Attributes + }, + macro: { + type: 'string' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GraphicalObjectFrameNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGraphicFramePr?: CT_NonVisualGraphicFrameProperties; +} + +export const CT_GraphicalObjectFrameNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGraphicFramePr: { + type: 'child', + childAttributes: CT_NonVisualGraphicFrameProperties_Attributes + } +}; + +export interface CT_GraphicalObjectFrame { + nvGraphicFramePr?: CT_GraphicalObjectFrameNonVisual; + xfrm?: CT_Transform2D; + macro?: string; + fPublished?: boolean; +} + +export const CT_GraphicalObjectFrame_Attributes: Attributes = { + nvGraphicFramePr: { + type: 'child', + childAttributes: CT_GraphicalObjectFrameNonVisual_Attributes + }, + xfrm: { + type: 'child', + childAttributes: CT_Transform2D_Attributes + }, + macro: { + type: 'string' + }, + fPublished: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupShapeNonVisual { + cNvPr?: CT_NonVisualDrawingProps; + cNvGrpSpPr?: CT_NonVisualGroupDrawingShapeProps; +} + +export const CT_GroupShapeNonVisual_Attributes: Attributes = { + cNvPr: { + type: 'child', + childAttributes: CT_NonVisualDrawingProps_Attributes + }, + cNvGrpSpPr: { + type: 'child', + childAttributes: CT_NonVisualGroupDrawingShapeProps_Attributes + } +}; + +export type CT_GroupShape = any; +export const CT_GroupShape_Attributes: Attributes = {}; + +export interface CT_Rel { + 'r:id'?: string; +} + +export const CT_Rel_Attributes: Attributes = { + 'r:id': { + type: 'string' + } +}; + +export type ST_ColID = number; + +export type ST_RowID = number; + +export interface CT_Marker { + col?: number[]; + colOff?: string[]; + row?: number[]; + rowOff?: string[]; +} + +export const CT_Marker_Attributes: Attributes = { + col: { + type: 'child-int', + childIsArray: true + }, + colOff: { + type: 'child-string', + childIsArray: true + }, + row: { + type: 'child-int', + childIsArray: true + }, + rowOff: { + type: 'child-string', + childIsArray: true + } +}; + +export type ST_EditAs = 'twoCell' | 'oneCell' | 'absolute'; + +export interface CT_TwoCellAnchor { + from?: CT_Marker[]; + to?: CT_Marker[]; + sp?: CT_Shape[]; + grpSp?: CT_GroupShape[]; + graphicFrame?: CT_GraphicalObjectFrame[]; + cxnSp?: CT_Connector[]; + pic?: CT_Picture[]; + contentPart?: CT_Rel[]; + clientData?: CT_AnchorClientData; + editAs?: ST_EditAs; +} + +export const CT_TwoCellAnchor_Attributes: Attributes = { + from: { + type: 'child', + childAttributes: CT_Marker_Attributes, + childIsArray: true + }, + to: { + type: 'child', + childAttributes: CT_Marker_Attributes, + childIsArray: true + }, + sp: { + type: 'child', + childAttributes: CT_Shape_Attributes, + childIsArray: true + }, + grpSp: { + type: 'child', + childAttributes: CT_GroupShape_Attributes, + childIsArray: true + }, + graphicFrame: { + type: 'child', + childAttributes: CT_GraphicalObjectFrame_Attributes, + childIsArray: true + }, + cxnSp: { + type: 'child', + childAttributes: CT_Connector_Attributes, + childIsArray: true + }, + pic: { + type: 'child', + childAttributes: CT_Picture_Attributes, + childIsArray: true + }, + contentPart: { + type: 'child', + childAttributes: CT_Rel_Attributes, + childIsArray: true + }, + clientData: { + type: 'child', + childAttributes: CT_AnchorClientData_Attributes + }, + editAs: { + type: 'string', + defaultValue: 'twoCell' + } +}; + +export interface CT_OneCellAnchor { + from?: CT_Marker[]; + ext?: CT_PositiveSize2D[]; + sp?: CT_Shape[]; + grpSp?: CT_GroupShape[]; + graphicFrame?: CT_GraphicalObjectFrame[]; + cxnSp?: CT_Connector[]; + pic?: CT_Picture[]; + contentPart?: CT_Rel[]; + clientData?: CT_AnchorClientData; +} + +export const CT_OneCellAnchor_Attributes: Attributes = { + from: { + type: 'child', + childAttributes: CT_Marker_Attributes, + childIsArray: true + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes, + childIsArray: true + }, + sp: { + type: 'child', + childAttributes: CT_Shape_Attributes, + childIsArray: true + }, + grpSp: { + type: 'child', + childAttributes: CT_GroupShape_Attributes, + childIsArray: true + }, + graphicFrame: { + type: 'child', + childAttributes: CT_GraphicalObjectFrame_Attributes, + childIsArray: true + }, + cxnSp: { + type: 'child', + childAttributes: CT_Connector_Attributes, + childIsArray: true + }, + pic: { + type: 'child', + childAttributes: CT_Picture_Attributes, + childIsArray: true + }, + contentPart: { + type: 'child', + childAttributes: CT_Rel_Attributes, + childIsArray: true + }, + clientData: { + type: 'child', + childAttributes: CT_AnchorClientData_Attributes + } +}; + +export interface CT_AbsoluteAnchor { + pos?: CT_Point2D[]; + ext?: CT_PositiveSize2D[]; + sp?: CT_Shape[]; + grpSp?: CT_GroupShape[]; + graphicFrame?: CT_GraphicalObjectFrame[]; + cxnSp?: CT_Connector[]; + pic?: CT_Picture[]; + contentPart?: CT_Rel[]; + clientData?: CT_AnchorClientData; +} + +export const CT_AbsoluteAnchor_Attributes: Attributes = { + pos: { + type: 'child', + childAttributes: CT_Point2D_Attributes, + childIsArray: true + }, + ext: { + type: 'child', + childAttributes: CT_PositiveSize2D_Attributes, + childIsArray: true + }, + sp: { + type: 'child', + childAttributes: CT_Shape_Attributes, + childIsArray: true + }, + grpSp: { + type: 'child', + childAttributes: CT_GroupShape_Attributes, + childIsArray: true + }, + graphicFrame: { + type: 'child', + childAttributes: CT_GraphicalObjectFrame_Attributes, + childIsArray: true + }, + cxnSp: { + type: 'child', + childAttributes: CT_Connector_Attributes, + childIsArray: true + }, + pic: { + type: 'child', + childAttributes: CT_Picture_Attributes, + childIsArray: true + }, + contentPart: { + type: 'child', + childAttributes: CT_Rel_Attributes, + childIsArray: true + }, + clientData: { + type: 'child', + childAttributes: CT_AnchorClientData_Attributes + } +}; + +export interface CT_Filter { + val?: string; +} + +export const CT_Filter_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export type ST_DateTimeGrouping = + | 'year' + | 'month' + | 'day' + | 'hour' + | 'minute' + | 'second'; + +export interface CT_DateGroupItem { + year?: number; + month?: number; + day?: number; + hour?: number; + minute?: number; + second?: number; + dateTimeGrouping?: ST_DateTimeGrouping; +} + +export const CT_DateGroupItem_Attributes: Attributes = { + year: { + type: 'int' + }, + month: { + type: 'int' + }, + day: { + type: 'int' + }, + hour: { + type: 'int' + }, + minute: { + type: 'int' + }, + second: { + type: 'int' + }, + dateTimeGrouping: { + type: 'string' + } +}; + +export interface CT_Filters { + filter?: CT_Filter[]; + dateGroupItem?: CT_DateGroupItem[]; + blank?: boolean; + calendarType?: ST_CalendarType; +} + +export const CT_Filters_Attributes: Attributes = { + filter: { + type: 'child', + childAttributes: CT_Filter_Attributes, + childIsArray: true + }, + dateGroupItem: { + type: 'child', + childAttributes: CT_DateGroupItem_Attributes, + childIsArray: true + }, + blank: { + type: 'boolean', + defaultValue: 'false' + }, + calendarType: { + type: 'string', + defaultValue: 'none' + } +}; + +export interface CT_Top10 { + top?: boolean; + percent?: boolean; + val?: number; + filterVal?: number; +} + +export const CT_Top10_Attributes: Attributes = { + top: { + type: 'boolean', + defaultValue: 'true' + }, + percent: { + type: 'boolean', + defaultValue: 'false' + }, + val: { + type: 'double' + }, + filterVal: { + type: 'double' + } +}; + +export type ST_FilterOperator = + | 'equal' + | 'lessThan' + | 'lessThanOrEqual' + | 'notEqual' + | 'greaterThanOrEqual' + | 'greaterThan'; + +export interface CT_CustomFilter { + operator?: ST_FilterOperator; + val?: string; +} + +export const CT_CustomFilter_Attributes: Attributes = { + operator: { + type: 'string', + defaultValue: 'equal' + }, + val: { + type: 'string' + } +}; + +export interface CT_CustomFilters { + customFilter?: CT_CustomFilter[]; + and?: boolean; +} + +export const CT_CustomFilters_Attributes: Attributes = { + customFilter: { + type: 'child', + childAttributes: CT_CustomFilter_Attributes, + childIsArray: true + }, + and: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_DynamicFilterType = + | 'null' + | 'aboveAverage' + | 'belowAverage' + | 'tomorrow' + | 'today' + | 'yesterday' + | 'nextWeek' + | 'thisWeek' + | 'lastWeek' + | 'nextMonth' + | 'thisMonth' + | 'lastMonth' + | 'nextQuarter' + | 'thisQuarter' + | 'lastQuarter' + | 'nextYear' + | 'thisYear' + | 'lastYear' + | 'yearToDate' + | 'Q1' + | 'Q2' + | 'Q3' + | 'Q4' + | 'M1' + | 'M2' + | 'M3' + | 'M4' + | 'M5' + | 'M6' + | 'M7' + | 'M8' + | 'M9' + | 'M10' + | 'M11' + | 'M12'; + +export interface CT_DynamicFilter { + type?: ST_DynamicFilterType; + val?: number; + valIso?: string; + maxValIso?: string; +} + +export const CT_DynamicFilter_Attributes: Attributes = { + type: { + type: 'string' + }, + val: { + type: 'double' + }, + valIso: { + type: 'string' + }, + maxValIso: { + type: 'string' + } +}; + +export interface CT_ColorFilter { + dxfId?: number; + cellColor?: boolean; +} + +export const CT_ColorFilter_Attributes: Attributes = { + dxfId: { + type: 'int' + }, + cellColor: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_IconSetType = + | '3Arrows' + | '3ArrowsGray' + | '3Flags' + | '3TrafficLights1' + | '3TrafficLights2' + | '3Signs' + | '3Symbols' + | '3Symbols2' + | '4Arrows' + | '4ArrowsGray' + | '4RedToBlack' + | '4Rating' + | '4TrafficLights' + | '5Arrows' + | '5ArrowsGray' + | '5Rating' + | '5Quarters'; + +export interface CT_IconFilter { + iconSet?: ST_IconSetType; + iconId?: number; +} + +export const CT_IconFilter_Attributes: Attributes = { + iconSet: { + type: 'string' + }, + iconId: { + type: 'int' + } +}; + +export interface CT_FilterColumn { + filters?: CT_Filters; + top10?: CT_Top10; + customFilters?: CT_CustomFilters; + dynamicFilter?: CT_DynamicFilter; + colorFilter?: CT_ColorFilter; + iconFilter?: CT_IconFilter; + extLst?: CT_ExtensionList; + colId?: number; + hiddenButton?: boolean; + showButton?: boolean; +} + +export const CT_FilterColumn_Attributes: Attributes = { + filters: { + type: 'child', + childAttributes: CT_Filters_Attributes + }, + top10: { + type: 'child', + childAttributes: CT_Top10_Attributes + }, + customFilters: { + type: 'child', + childAttributes: CT_CustomFilters_Attributes + }, + dynamicFilter: { + type: 'child', + childAttributes: CT_DynamicFilter_Attributes + }, + colorFilter: { + type: 'child', + childAttributes: CT_ColorFilter_Attributes + }, + iconFilter: { + type: 'child', + childAttributes: CT_IconFilter_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + colId: { + type: 'int' + }, + hiddenButton: { + type: 'boolean', + defaultValue: 'false' + }, + showButton: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_SortBy = 'value' | 'cellColor' | 'fontColor' | 'icon'; + +export interface CT_SortCondition { + descending?: boolean; + sortBy?: ST_SortBy; + ref?: string; + customList?: string; + dxfId?: number; + iconSet?: ST_IconSetType; + iconId?: number; +} + +export const CT_SortCondition_Attributes: Attributes = { + descending: { + type: 'boolean', + defaultValue: 'false' + }, + sortBy: { + type: 'string', + defaultValue: 'value' + }, + ref: { + type: 'string' + }, + customList: { + type: 'string' + }, + dxfId: { + type: 'int' + }, + iconSet: { + type: 'string', + defaultValue: '3Arrows' + }, + iconId: { + type: 'int' + } +}; + +export type ST_SortMethod = 'stroke' | 'pinYin' | 'none'; + +export interface CT_SortState { + sortCondition?: CT_SortCondition[]; + extLst?: CT_ExtensionList; + columnSort?: boolean; + caseSensitive?: boolean; + sortMethod?: ST_SortMethod; + ref?: string; +} + +export const CT_SortState_Attributes: Attributes = { + sortCondition: { + type: 'child', + childAttributes: CT_SortCondition_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + columnSort: { + type: 'boolean', + defaultValue: 'false' + }, + caseSensitive: { + type: 'boolean', + defaultValue: 'false' + }, + sortMethod: { + type: 'string', + defaultValue: 'none' + }, + ref: { + type: 'string' + } +}; + +export interface CT_AutoFilter { + filterColumn?: CT_FilterColumn[]; + sortState?: CT_SortState; + extLst?: CT_ExtensionList; + ref?: string; +} + +export const CT_AutoFilter_Attributes: Attributes = { + filterColumn: { + type: 'child', + childAttributes: CT_FilterColumn_Attributes, + childIsArray: true + }, + sortState: { + type: 'child', + childAttributes: CT_SortState_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + ref: { + type: 'string' + } +}; + +export type ST_CellRef = string; + +export type ST_RefA = string; + +export type ST_Sqref = ST_Ref[]; + +export type ST_Formula = string; + +export type ST_UnsignedIntHex = string; + +export interface CT_ObjectAnchor { + moveWithCells?: boolean; + sizeWithCells?: boolean; +} + +export const CT_ObjectAnchor_Attributes: Attributes = { + moveWithCells: { + type: 'boolean', + defaultValue: 'false' + }, + sizeWithCells: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CalcCell { + r?: string; + i?: number; + s?: boolean; + l?: boolean; + t?: boolean; + a?: boolean; +} + +export const CT_CalcCell_Attributes: Attributes = { + r: { + type: 'string' + }, + i: { + type: 'int', + defaultValue: '0' + }, + s: { + type: 'boolean', + defaultValue: 'false' + }, + l: { + type: 'boolean', + defaultValue: 'false' + }, + t: { + type: 'boolean', + defaultValue: 'false' + }, + a: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CalcChain { + c?: CT_CalcCell[]; + extLst?: CT_ExtensionList[]; +} + +export const CT_CalcChain_Attributes: Attributes = { + c: { + type: 'child', + childAttributes: CT_CalcCell_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_Authors { + author?: string[]; +} + +export const CT_Authors_Attributes: Attributes = { + author: { + type: 'child-string', + childIsArray: true + } +}; + +export interface CT_FontName { + val?: string; +} + +export const CT_FontName_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_IntProperty { + val?: number; +} + +export const CT_IntProperty_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_BooleanProperty { + val?: boolean; +} + +export const CT_BooleanProperty_Attributes: Attributes = { + val: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_FontSize { + val?: number; +} + +export const CT_FontSize_Attributes: Attributes = { + val: { + type: 'double' + } +}; + +export type ST_UnderlineValues = + | 'single' + | 'double' + | 'singleAccounting' + | 'doubleAccounting' + | 'none'; + +export interface CT_UnderlineProperty { + val?: ST_UnderlineValues; +} + +export const CT_UnderlineProperty_Attributes: Attributes = { + val: { + type: 'string', + defaultValue: 'single' + } +}; + +export interface CT_VerticalAlignFontProperty { + val?: ST_VerticalAlignRun; +} + +export const CT_VerticalAlignFontProperty_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_RPrElt { + rFont?: CT_FontName; + charset?: CT_IntProperty; + family?: CT_IntProperty; + b?: CT_BooleanProperty; + i?: CT_BooleanProperty; + strike?: CT_BooleanProperty; + outline?: CT_BooleanProperty; + shadow?: CT_BooleanProperty; + condense?: CT_BooleanProperty; + extend?: CT_BooleanProperty; + color?: CT_Color; + sz?: CT_FontSize; + u?: CT_UnderlineProperty; + vertAlign?: CT_VerticalAlignFontProperty; + scheme?: CT_FontScheme; +} + +export const CT_RPrElt_Attributes: Attributes = { + rFont: { + type: 'child', + childAttributes: CT_FontName_Attributes + }, + charset: { + type: 'child', + childAttributes: CT_IntProperty_Attributes + }, + family: { + type: 'child', + childAttributes: CT_IntProperty_Attributes + }, + b: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + i: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + strike: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + outline: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + shadow: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + condense: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + extend: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + color: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + sz: { + type: 'child', + childAttributes: CT_FontSize_Attributes + }, + u: { + type: 'child', + childAttributes: CT_UnderlineProperty_Attributes + }, + vertAlign: { + type: 'child', + childAttributes: CT_VerticalAlignFontProperty_Attributes + }, + scheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + } +}; + +export interface CT_RElt { + rPr?: CT_RPrElt; + t?: string; +} + +export const CT_RElt_Attributes: Attributes = { + rPr: { + type: 'child', + childAttributes: CT_RPrElt_Attributes + }, + t: { + type: 'child-string' + } +}; + +export interface CT_PhoneticRun { + t?: string; + sb?: number; + eb?: number; +} + +export const CT_PhoneticRun_Attributes: Attributes = { + t: { + type: 'child-string' + }, + sb: { + type: 'int' + }, + eb: { + type: 'int' + } +}; + +export type ST_FontId = number; + +export type ST_PhoneticType = + | 'halfwidthKatakana' + | 'fullwidthKatakana' + | 'Hiragana' + | 'noConversion'; + +export type ST_PhoneticAlignment = + | 'noControl' + | 'left' + | 'center' + | 'distributed'; + +export interface CT_PhoneticPr { + fontId?: number; + type?: ST_PhoneticType; + alignment?: ST_PhoneticAlignment; +} + +export const CT_PhoneticPr_Attributes: Attributes = { + fontId: { + type: 'int' + }, + type: { + type: 'string', + defaultValue: 'fullwidthKatakana' + }, + alignment: { + type: 'string', + defaultValue: 'left' + } +}; + +export interface CT_Rst { + t?: string; + r?: CT_RElt[]; + rPh?: CT_PhoneticRun[]; + phoneticPr?: CT_PhoneticPr; +} + +export const CT_Rst_Attributes: Attributes = { + t: { + type: 'child-string' + }, + r: { + type: 'child', + childAttributes: CT_RElt_Attributes, + childIsArray: true + }, + rPh: { + type: 'child', + childAttributes: CT_PhoneticRun_Attributes, + childIsArray: true + }, + phoneticPr: { + type: 'child', + childAttributes: CT_PhoneticPr_Attributes + } +}; + +export type ST_TextHAlign = + | 'left' + | 'center' + | 'right' + | 'justify' + | 'distributed'; + +export type ST_TextVAlign = + | 'top' + | 'center' + | 'bottom' + | 'justify' + | 'distributed'; + +export interface CT_CommentPr { + anchor?: CT_ObjectAnchor; + locked?: boolean; + defaultSize?: boolean; + print?: boolean; + disabled?: boolean; + autoFill?: boolean; + autoLine?: boolean; + altText?: string; + textHAlign?: ST_TextHAlign; + textVAlign?: ST_TextVAlign; + lockText?: boolean; + justLastX?: boolean; + autoScale?: boolean; +} + +export const CT_CommentPr_Attributes: Attributes = { + anchor: { + type: 'child', + childAttributes: CT_ObjectAnchor_Attributes + }, + locked: { + type: 'boolean', + defaultValue: 'true' + }, + defaultSize: { + type: 'boolean', + defaultValue: 'true' + }, + print: { + type: 'boolean', + defaultValue: 'true' + }, + disabled: { + type: 'boolean', + defaultValue: 'false' + }, + autoFill: { + type: 'boolean', + defaultValue: 'true' + }, + autoLine: { + type: 'boolean', + defaultValue: 'true' + }, + altText: { + type: 'string' + }, + textHAlign: { + type: 'string', + defaultValue: 'left' + }, + textVAlign: { + type: 'string', + defaultValue: 'top' + }, + lockText: { + type: 'boolean', + defaultValue: 'true' + }, + justLastX: { + type: 'boolean', + defaultValue: 'false' + }, + autoScale: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Comment { + text?: CT_Rst; + commentPr?: CT_CommentPr; + ref?: string; + authorId?: number; + guid?: string; + shapeId?: number; +} + +export const CT_Comment_Attributes: Attributes = { + text: { + type: 'child', + childAttributes: CT_Rst_Attributes + }, + commentPr: { + type: 'child', + childAttributes: CT_CommentPr_Attributes + }, + ref: { + type: 'string' + }, + authorId: { + type: 'int' + }, + guid: { + type: 'string' + }, + shapeId: { + type: 'int' + } +}; + +export interface CT_CommentList { + comment?: CT_Comment[]; +} + +export const CT_CommentList_Attributes: Attributes = { + comment: { + type: 'child', + childAttributes: CT_Comment_Attributes, + childIsArray: true + } +}; + +export interface CT_Comments { + authors?: CT_Authors; + commentList?: CT_CommentList; + extLst?: CT_ExtensionList[]; +} + +export const CT_Comments_Attributes: Attributes = { + authors: { + type: 'child', + childAttributes: CT_Authors_Attributes + }, + commentList: { + type: 'child', + childAttributes: CT_CommentList_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_Schema { + __any__?: any; + ID?: string; + SchemaRef?: string; + Namespace?: string; + SchemaLanguage?: string; +} + +export const CT_Schema_Attributes: Attributes = { + __any__: { + type: 'any' + }, + ID: { + type: 'string' + }, + SchemaRef: { + type: 'string' + }, + Namespace: { + type: 'string' + }, + SchemaLanguage: { + type: 'string' + } +}; + +export interface CT_DataBinding { + __any__?: any; + DataBindingName?: string; + FileBinding?: boolean; + ConnectionID?: number; + FileBindingName?: string; + DataBindingLoadMode?: number; +} + +export const CT_DataBinding_Attributes: Attributes = { + __any__: { + type: 'any' + }, + DataBindingName: { + type: 'string' + }, + FileBinding: { + type: 'boolean' + }, + ConnectionID: { + type: 'int' + }, + FileBindingName: { + type: 'string' + }, + DataBindingLoadMode: { + type: 'int' + } +}; + +export interface CT_Map { + DataBinding?: CT_DataBinding; + ID?: number; + Name?: string; + RootElement?: string; + SchemaID?: string; + ShowImportExportValidationErrors?: boolean; + AutoFit?: boolean; + Append?: boolean; + PreserveSortAFLayout?: boolean; + PreserveFormat?: boolean; +} + +export const CT_Map_Attributes: Attributes = { + DataBinding: { + type: 'child', + childAttributes: CT_DataBinding_Attributes + }, + ID: { + type: 'int' + }, + Name: { + type: 'string' + }, + RootElement: { + type: 'string' + }, + SchemaID: { + type: 'string' + }, + ShowImportExportValidationErrors: { + type: 'boolean' + }, + AutoFit: { + type: 'boolean' + }, + Append: { + type: 'boolean' + }, + PreserveSortAFLayout: { + type: 'boolean' + }, + PreserveFormat: { + type: 'boolean' + } +}; + +export interface CT_MapInfo { + Schema?: CT_Schema[]; + Map?: CT_Map[]; + SelectionNamespaces?: string; +} + +export const CT_MapInfo_Attributes: Attributes = { + Schema: { + type: 'child', + childAttributes: CT_Schema_Attributes, + childIsArray: true + }, + Map: { + type: 'child', + childAttributes: CT_Map_Attributes, + childIsArray: true + }, + SelectionNamespaces: { + type: 'string' + } +}; + +export interface CT_Connections { + connection?: CT_Connection[]; +} + +export const CT_Connections_Attributes: Attributes = { + connection: { + type: 'child', + childAttributes: CT_Connection_Attributes, + childIsArray: true + } +}; + +export interface CT_WorksheetSource { + 'ref'?: string; + 'name'?: string; + 'sheet'?: string; + 'r:id'?: string; +} + +export const CT_WorksheetSource_Attributes: Attributes = { + 'ref': { + type: 'string' + }, + 'name': { + type: 'string' + }, + 'sheet': { + type: 'string' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_PageItem { + name?: string; +} + +export const CT_PageItem_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export interface CT_PCDSCPage { + pageItem?: CT_PageItem[]; + count?: number; +} + +export const CT_PCDSCPage_Attributes: Attributes = { + pageItem: { + type: 'child', + childAttributes: CT_PageItem_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Pages { + page?: CT_PCDSCPage[]; + count?: number; +} + +export const CT_Pages_Attributes: Attributes = { + page: { + type: 'child', + childAttributes: CT_PCDSCPage_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_RangeSet { + 'i1'?: number; + 'i2'?: number; + 'i3'?: number; + 'i4'?: number; + 'ref'?: string; + 'name'?: string; + 'sheet'?: string; + 'r:id'?: string; +} + +export const CT_RangeSet_Attributes: Attributes = { + 'i1': { + type: 'int' + }, + 'i2': { + type: 'int' + }, + 'i3': { + type: 'int' + }, + 'i4': { + type: 'int' + }, + 'ref': { + type: 'string' + }, + 'name': { + type: 'string' + }, + 'sheet': { + type: 'string' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_RangeSets { + rangeSet?: CT_RangeSet[]; + count?: number; +} + +export const CT_RangeSets_Attributes: Attributes = { + rangeSet: { + type: 'child', + childAttributes: CT_RangeSet_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Consolidation { + pages?: CT_Pages; + rangeSets?: CT_RangeSets; + autoPage?: boolean; +} + +export const CT_Consolidation_Attributes: Attributes = { + pages: { + type: 'child', + childAttributes: CT_Pages_Attributes + }, + rangeSets: { + type: 'child', + childAttributes: CT_RangeSets_Attributes + }, + autoPage: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_SourceType = + | 'worksheet' + | 'external' + | 'consolidation' + | 'scenario'; + +export interface CT_CacheSource { + worksheetSource?: CT_WorksheetSource; + consolidation?: CT_Consolidation; + extLst?: CT_ExtensionList[]; + type?: ST_SourceType; + connectionId?: number; +} + +export const CT_CacheSource_Attributes: Attributes = { + worksheetSource: { + type: 'child', + childAttributes: CT_WorksheetSource_Attributes + }, + consolidation: { + type: 'child', + childAttributes: CT_Consolidation_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + type: { + type: 'string' + }, + connectionId: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_Tuple { + fld?: number; + hier?: number; + item?: number; +} + +export const CT_Tuple_Attributes: Attributes = { + fld: { + type: 'int' + }, + hier: { + type: 'int' + }, + item: { + type: 'int' + } +}; + +export interface CT_Tuples { + tpl?: CT_Tuple[]; + c?: number; +} + +export const CT_Tuples_Attributes: Attributes = { + tpl: { + type: 'child', + childAttributes: CT_Tuple_Attributes, + childIsArray: true + }, + c: { + type: 'int' + } +}; + +export interface CT_Missing { + tpls?: CT_Tuples[]; + x?: CT_X[]; + u?: boolean; + f?: boolean; + c?: string; + cp?: number; + in?: number; + bc?: string; + fc?: string; + i?: boolean; + un?: boolean; + st?: boolean; + b?: boolean; +} + +export const CT_Missing_Attributes: Attributes = { + tpls: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + u: { + type: 'boolean' + }, + f: { + type: 'boolean' + }, + c: { + type: 'string' + }, + cp: { + type: 'int' + }, + in: { + type: 'int' + }, + bc: { + type: 'string' + }, + fc: { + type: 'string' + }, + i: { + type: 'boolean', + defaultValue: 'false' + }, + un: { + type: 'boolean', + defaultValue: 'false' + }, + st: { + type: 'boolean', + defaultValue: 'false' + }, + b: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Number { + tpls?: CT_Tuples[]; + x?: CT_X[]; + v?: number; + u?: boolean; + f?: boolean; + c?: string; + cp?: number; + in?: number; + bc?: string; + fc?: string; + i?: boolean; + un?: boolean; + st?: boolean; + b?: boolean; +} + +export const CT_Number_Attributes: Attributes = { + tpls: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + v: { + type: 'double' + }, + u: { + type: 'boolean' + }, + f: { + type: 'boolean' + }, + c: { + type: 'string' + }, + cp: { + type: 'int' + }, + in: { + type: 'int' + }, + bc: { + type: 'string' + }, + fc: { + type: 'string' + }, + i: { + type: 'boolean', + defaultValue: 'false' + }, + un: { + type: 'boolean', + defaultValue: 'false' + }, + st: { + type: 'boolean', + defaultValue: 'false' + }, + b: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Error { + tpls?: CT_Tuples[]; + x?: CT_X[]; + v?: string; + u?: boolean; + f?: boolean; + c?: string; + cp?: number; + in?: number; + bc?: string; + fc?: string; + i?: boolean; + un?: boolean; + st?: boolean; + b?: boolean; +} + +export const CT_Error_Attributes: Attributes = { + tpls: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + v: { + type: 'string' + }, + u: { + type: 'boolean' + }, + f: { + type: 'boolean' + }, + c: { + type: 'string' + }, + cp: { + type: 'int' + }, + in: { + type: 'int' + }, + bc: { + type: 'string' + }, + fc: { + type: 'string' + }, + i: { + type: 'boolean', + defaultValue: 'false' + }, + un: { + type: 'boolean', + defaultValue: 'false' + }, + st: { + type: 'boolean', + defaultValue: 'false' + }, + b: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_String { + tpls?: CT_Tuples[]; + x?: CT_X[]; + v?: string; + u?: boolean; + f?: boolean; + c?: string; + cp?: number; + in?: number; + bc?: string; + fc?: string; + i?: boolean; + un?: boolean; + st?: boolean; + b?: boolean; +} + +export const CT_String_Attributes: Attributes = { + tpls: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + v: { + type: 'string' + }, + u: { + type: 'boolean' + }, + f: { + type: 'boolean' + }, + c: { + type: 'string' + }, + cp: { + type: 'int' + }, + in: { + type: 'int' + }, + bc: { + type: 'string' + }, + fc: { + type: 'string' + }, + i: { + type: 'boolean', + defaultValue: 'false' + }, + un: { + type: 'boolean', + defaultValue: 'false' + }, + st: { + type: 'boolean', + defaultValue: 'false' + }, + b: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_DateTime { + x?: CT_X[]; + v?: string; + u?: boolean; + f?: boolean; + c?: string; + cp?: number; +} + +export const CT_DateTime_Attributes: Attributes = { + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + v: { + type: 'string' + }, + u: { + type: 'boolean' + }, + f: { + type: 'boolean' + }, + c: { + type: 'string' + }, + cp: { + type: 'int' + } +}; + +export interface CT_SharedItems { + m?: CT_Missing; + n?: CT_Number; + b?: CT_Boolean; + e?: CT_Error; + s?: CT_String; + d?: CT_DateTime; + containsSemiMixedTypes?: boolean; + containsNonDate?: boolean; + containsDate?: boolean; + containsString?: boolean; + containsBlank?: boolean; + containsMixedTypes?: boolean; + containsNumber?: boolean; + containsInteger?: boolean; + minValue?: number; + maxValue?: number; + minDate?: string; + maxDate?: string; + count?: number; + longText?: boolean; +} + +export const CT_SharedItems_Attributes: Attributes = { + m: { + type: 'child', + childAttributes: CT_Missing_Attributes + }, + n: { + type: 'child', + childAttributes: CT_Number_Attributes + }, + b: { + type: 'child', + childAttributes: CT_Boolean_Attributes + }, + e: { + type: 'child', + childAttributes: CT_Error_Attributes + }, + s: { + type: 'child', + childAttributes: CT_String_Attributes + }, + d: { + type: 'child', + childAttributes: CT_DateTime_Attributes + }, + containsSemiMixedTypes: { + type: 'boolean', + defaultValue: 'true' + }, + containsNonDate: { + type: 'boolean', + defaultValue: 'true' + }, + containsDate: { + type: 'boolean', + defaultValue: 'false' + }, + containsString: { + type: 'boolean', + defaultValue: 'true' + }, + containsBlank: { + type: 'boolean', + defaultValue: 'false' + }, + containsMixedTypes: { + type: 'boolean', + defaultValue: 'false' + }, + containsNumber: { + type: 'boolean', + defaultValue: 'false' + }, + containsInteger: { + type: 'boolean', + defaultValue: 'false' + }, + minValue: { + type: 'double' + }, + maxValue: { + type: 'double' + }, + minDate: { + type: 'string' + }, + maxDate: { + type: 'string' + }, + count: { + type: 'int' + }, + longText: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_GroupBy = + | 'range' + | 'seconds' + | 'minutes' + | 'hours' + | 'days' + | 'months' + | 'quarters' + | 'years'; + +export interface CT_RangePr { + autoStart?: boolean; + autoEnd?: boolean; + groupBy?: ST_GroupBy; + startNum?: number; + endNum?: number; + startDate?: string; + endDate?: string; + groupInterval?: number; +} + +export const CT_RangePr_Attributes: Attributes = { + autoStart: { + type: 'boolean', + defaultValue: 'true' + }, + autoEnd: { + type: 'boolean', + defaultValue: 'true' + }, + groupBy: { + type: 'string', + defaultValue: 'range' + }, + startNum: { + type: 'double' + }, + endNum: { + type: 'double' + }, + startDate: { + type: 'string' + }, + endDate: { + type: 'string' + }, + groupInterval: { + type: 'double', + defaultValue: '1' + } +}; + +export interface CT_DiscretePr { + x?: CT_Index[]; + count?: number; +} + +export const CT_DiscretePr_Attributes: Attributes = { + x: { + type: 'child', + childAttributes: CT_Index_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_GroupItems { + m?: CT_Missing[]; + n?: CT_Number[]; + b?: CT_Boolean[]; + e?: CT_Error[]; + s?: CT_String[]; + d?: CT_DateTime[]; + count?: number; +} + +export const CT_GroupItems_Attributes: Attributes = { + m: { + type: 'child', + childAttributes: CT_Missing_Attributes, + childIsArray: true + }, + n: { + type: 'child', + childAttributes: CT_Number_Attributes, + childIsArray: true + }, + b: { + type: 'child', + childAttributes: CT_Boolean_Attributes, + childIsArray: true + }, + e: { + type: 'child', + childAttributes: CT_Error_Attributes, + childIsArray: true + }, + s: { + type: 'child', + childAttributes: CT_String_Attributes, + childIsArray: true + }, + d: { + type: 'child', + childAttributes: CT_DateTime_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_FieldGroup { + rangePr?: CT_RangePr[]; + discretePr?: CT_DiscretePr[]; + groupItems?: CT_GroupItems[]; + par?: number; + base?: number; +} + +export const CT_FieldGroup_Attributes: Attributes = { + rangePr: { + type: 'child', + childAttributes: CT_RangePr_Attributes, + childIsArray: true + }, + discretePr: { + type: 'child', + childAttributes: CT_DiscretePr_Attributes, + childIsArray: true + }, + groupItems: { + type: 'child', + childAttributes: CT_GroupItems_Attributes, + childIsArray: true + }, + par: { + type: 'int' + }, + base: { + type: 'int' + } +}; + +export type ST_NumFmtId = number; + +export interface CT_CacheField { + sharedItems?: CT_SharedItems; + fieldGroup?: CT_FieldGroup[]; + mpMap?: CT_X[]; + extLst?: CT_ExtensionList[]; + name?: string; + caption?: string; + propertyName?: string; + serverField?: boolean; + uniqueList?: boolean; + numFmtId?: number; + formula?: string; + sqlType?: number; + hierarchy?: number; + level?: number; + databaseField?: boolean; + mappingCount?: number; + memberPropertyField?: boolean; +} + +export const CT_CacheField_Attributes: Attributes = { + sharedItems: { + type: 'child', + childAttributes: CT_SharedItems_Attributes + }, + fieldGroup: { + type: 'child', + childAttributes: CT_FieldGroup_Attributes, + childIsArray: true + }, + mpMap: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + caption: { + type: 'string' + }, + propertyName: { + type: 'string' + }, + serverField: { + type: 'boolean', + defaultValue: 'false' + }, + uniqueList: { + type: 'boolean', + defaultValue: 'true' + }, + numFmtId: { + type: 'int' + }, + formula: { + type: 'string' + }, + sqlType: { + type: 'int', + defaultValue: '0' + }, + hierarchy: { + type: 'int', + defaultValue: '0' + }, + level: { + type: 'int', + defaultValue: '0' + }, + databaseField: { + type: 'boolean', + defaultValue: 'true' + }, + mappingCount: { + type: 'int' + }, + memberPropertyField: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CacheFields { + cacheField?: CT_CacheField[]; + count?: number; +} + +export const CT_CacheFields_Attributes: Attributes = { + cacheField: { + type: 'child', + childAttributes: CT_CacheField_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_FieldUsage { + x?: number; +} + +export const CT_FieldUsage_Attributes: Attributes = { + x: { + type: 'int' + } +}; + +export interface CT_FieldsUsage { + fieldUsage?: CT_FieldUsage[]; + count?: number; +} + +export const CT_FieldsUsage_Attributes: Attributes = { + fieldUsage: { + type: 'child', + childAttributes: CT_FieldUsage_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_GroupMember { + uniqueName?: string; + group?: boolean; +} + +export const CT_GroupMember_Attributes: Attributes = { + uniqueName: { + type: 'string' + }, + group: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupMembers { + groupMember?: CT_GroupMember[]; + count?: number; +} + +export const CT_GroupMembers_Attributes: Attributes = { + groupMember: { + type: 'child', + childAttributes: CT_GroupMember_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_LevelGroup { + groupMembers?: CT_GroupMembers[]; + name?: string; + uniqueName?: string; + caption?: string; + uniqueParent?: string; + id?: number; +} + +export const CT_LevelGroup_Attributes: Attributes = { + groupMembers: { + type: 'child', + childAttributes: CT_GroupMembers_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + uniqueName: { + type: 'string' + }, + caption: { + type: 'string' + }, + uniqueParent: { + type: 'string' + }, + id: { + type: 'int' + } +}; + +export interface CT_Groups { + group?: CT_LevelGroup[]; + count?: number; +} + +export const CT_Groups_Attributes: Attributes = { + group: { + type: 'child', + childAttributes: CT_LevelGroup_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_GroupLevel { + groups?: CT_Groups[]; + extLst?: CT_ExtensionList[]; + uniqueName?: string; + caption?: string; + user?: boolean; + customRollUp?: boolean; +} + +export const CT_GroupLevel_Attributes: Attributes = { + groups: { + type: 'child', + childAttributes: CT_Groups_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + uniqueName: { + type: 'string' + }, + caption: { + type: 'string' + }, + user: { + type: 'boolean', + defaultValue: 'false' + }, + customRollUp: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_GroupLevels { + groupLevel?: CT_GroupLevel[]; + count?: number; +} + +export const CT_GroupLevels_Attributes: Attributes = { + groupLevel: { + type: 'child', + childAttributes: CT_GroupLevel_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_CacheHierarchy { + fieldsUsage?: CT_FieldsUsage[]; + groupLevels?: CT_GroupLevels[]; + extLst?: CT_ExtensionList[]; + uniqueName?: string; + caption?: string; + measure?: boolean; + set?: boolean; + parentSet?: number; + iconSet?: number; + attribute?: boolean; + time?: boolean; + keyAttribute?: boolean; + defaultMemberUniqueName?: string; + allUniqueName?: string; + allCaption?: string; + dimensionUniqueName?: string; + displayFolder?: string; + measureGroup?: string; + measures?: boolean; + count?: number; + oneField?: boolean; + memberValueDatatype?: number; + unbalanced?: boolean; + unbalancedGroup?: boolean; + hidden?: boolean; +} + +export const CT_CacheHierarchy_Attributes: Attributes = { + fieldsUsage: { + type: 'child', + childAttributes: CT_FieldsUsage_Attributes, + childIsArray: true + }, + groupLevels: { + type: 'child', + childAttributes: CT_GroupLevels_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + uniqueName: { + type: 'string' + }, + caption: { + type: 'string' + }, + measure: { + type: 'boolean', + defaultValue: 'false' + }, + set: { + type: 'boolean', + defaultValue: 'false' + }, + parentSet: { + type: 'int' + }, + iconSet: { + type: 'int', + defaultValue: '0' + }, + attribute: { + type: 'boolean', + defaultValue: 'false' + }, + time: { + type: 'boolean', + defaultValue: 'false' + }, + keyAttribute: { + type: 'boolean', + defaultValue: 'false' + }, + defaultMemberUniqueName: { + type: 'string' + }, + allUniqueName: { + type: 'string' + }, + allCaption: { + type: 'string' + }, + dimensionUniqueName: { + type: 'string' + }, + displayFolder: { + type: 'string' + }, + measureGroup: { + type: 'string' + }, + measures: { + type: 'boolean', + defaultValue: 'false' + }, + count: { + type: 'int' + }, + oneField: { + type: 'boolean', + defaultValue: 'false' + }, + memberValueDatatype: { + type: 'int' + }, + unbalanced: { + type: 'boolean' + }, + unbalancedGroup: { + type: 'boolean' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CacheHierarchies { + cacheHierarchy?: CT_CacheHierarchy[]; + count?: number; +} + +export const CT_CacheHierarchies_Attributes: Attributes = { + cacheHierarchy: { + type: 'child', + childAttributes: CT_CacheHierarchy_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PCDKPI { + uniqueName?: string; + caption?: string; + displayFolder?: string; + measureGroup?: string; + parent?: string; + value?: string; + goal?: string; + status?: string; + trend?: string; + weight?: string; + time?: string; +} + +export const CT_PCDKPI_Attributes: Attributes = { + uniqueName: { + type: 'string' + }, + caption: { + type: 'string' + }, + displayFolder: { + type: 'string' + }, + measureGroup: { + type: 'string' + }, + parent: { + type: 'string' + }, + value: { + type: 'string' + }, + goal: { + type: 'string' + }, + status: { + type: 'string' + }, + trend: { + type: 'string' + }, + weight: { + type: 'string' + }, + time: { + type: 'string' + } +}; + +export interface CT_PCDKPIs { + kpi?: CT_PCDKPI[]; + count?: number; +} + +export const CT_PCDKPIs_Attributes: Attributes = { + kpi: { + type: 'child', + childAttributes: CT_PCDKPI_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PivotAreaReference { + x?: CT_Index[]; + extLst?: CT_ExtensionList[]; + field?: number; + count?: number; + selected?: boolean; + byPosition?: boolean; + relative?: boolean; + defaultSubtotal?: boolean; + sumSubtotal?: boolean; + countASubtotal?: boolean; + avgSubtotal?: boolean; + maxSubtotal?: boolean; + minSubtotal?: boolean; + productSubtotal?: boolean; + countSubtotal?: boolean; + stdDevSubtotal?: boolean; + stdDevPSubtotal?: boolean; + varSubtotal?: boolean; + varPSubtotal?: boolean; +} + +export const CT_PivotAreaReference_Attributes: Attributes = { + x: { + type: 'child', + childAttributes: CT_Index_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + field: { + type: 'int' + }, + count: { + type: 'int' + }, + selected: { + type: 'boolean', + defaultValue: 'true' + }, + byPosition: { + type: 'boolean', + defaultValue: 'false' + }, + relative: { + type: 'boolean', + defaultValue: 'false' + }, + defaultSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + sumSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + countASubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + avgSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + maxSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + minSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + productSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + countSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + stdDevSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + stdDevPSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + varSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + varPSubtotal: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PivotAreaReferences { + reference?: CT_PivotAreaReference[]; + count?: number; +} + +export const CT_PivotAreaReferences_Attributes: Attributes = { + reference: { + type: 'child', + childAttributes: CT_PivotAreaReference_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_PivotAreaType = + | 'none' + | 'normal' + | 'data' + | 'all' + | 'origin' + | 'button' + | 'topEnd'; + +export type ST_Axis = 'axisRow' | 'axisCol' | 'axisPage' | 'axisValues'; + +export interface CT_PivotArea { + references?: CT_PivotAreaReferences[]; + extLst?: CT_ExtensionList[]; + field?: number; + type?: ST_PivotAreaType; + dataOnly?: boolean; + labelOnly?: boolean; + grandRow?: boolean; + grandCol?: boolean; + cacheIndex?: boolean; + outline?: boolean; + offset?: string; + collapsedLevelsAreSubtotals?: boolean; + axis?: ST_Axis; + fieldPosition?: number; +} + +export const CT_PivotArea_Attributes: Attributes = { + references: { + type: 'child', + childAttributes: CT_PivotAreaReferences_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + field: { + type: 'int' + }, + type: { + type: 'string', + defaultValue: 'normal' + }, + dataOnly: { + type: 'boolean', + defaultValue: 'true' + }, + labelOnly: { + type: 'boolean', + defaultValue: 'false' + }, + grandRow: { + type: 'boolean', + defaultValue: 'false' + }, + grandCol: { + type: 'boolean', + defaultValue: 'false' + }, + cacheIndex: { + type: 'boolean', + defaultValue: 'false' + }, + outline: { + type: 'boolean', + defaultValue: 'true' + }, + offset: { + type: 'string' + }, + collapsedLevelsAreSubtotals: { + type: 'boolean', + defaultValue: 'false' + }, + axis: { + type: 'string' + }, + fieldPosition: { + type: 'int' + } +}; + +export interface CT_CalculatedItem { + pivotArea?: CT_PivotArea[]; + extLst?: CT_ExtensionList[]; + field?: number; + formula?: string; +} + +export const CT_CalculatedItem_Attributes: Attributes = { + pivotArea: { + type: 'child', + childAttributes: CT_PivotArea_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + field: { + type: 'int' + }, + formula: { + type: 'string' + } +}; + +export interface CT_CalculatedItems { + calculatedItem?: CT_CalculatedItem[]; + count?: number; +} + +export const CT_CalculatedItems_Attributes: Attributes = { + calculatedItem: { + type: 'child', + childAttributes: CT_CalculatedItem_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_CalculatedMember { + extLst?: CT_ExtensionList[]; + name?: string; + mdx?: string; + memberName?: string; + hierarchy?: string; + parent?: string; + solveOrder?: number; + set?: boolean; +} + +export const CT_CalculatedMember_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + mdx: { + type: 'string' + }, + memberName: { + type: 'string' + }, + hierarchy: { + type: 'string' + }, + parent: { + type: 'string' + }, + solveOrder: { + type: 'int', + defaultValue: '0' + }, + set: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CalculatedMembers { + calculatedMember?: CT_CalculatedMember[]; + count?: number; +} + +export const CT_CalculatedMembers_Attributes: Attributes = { + calculatedMember: { + type: 'child', + childAttributes: CT_CalculatedMember_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PivotDimension { + measure?: boolean; + name?: string; + uniqueName?: string; + caption?: string; +} + +export const CT_PivotDimension_Attributes: Attributes = { + measure: { + type: 'boolean', + defaultValue: 'false' + }, + name: { + type: 'string' + }, + uniqueName: { + type: 'string' + }, + caption: { + type: 'string' + } +}; + +export interface CT_Dimensions { + dimension?: CT_PivotDimension[]; + count?: number; +} + +export const CT_Dimensions_Attributes: Attributes = { + dimension: { + type: 'child', + childAttributes: CT_PivotDimension_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_MeasureGroup { + name?: string; + caption?: string; +} + +export const CT_MeasureGroup_Attributes: Attributes = { + name: { + type: 'string' + }, + caption: { + type: 'string' + } +}; + +export interface CT_MeasureGroups { + measureGroup?: CT_MeasureGroup[]; + count?: number; +} + +export const CT_MeasureGroups_Attributes: Attributes = { + measureGroup: { + type: 'child', + childAttributes: CT_MeasureGroup_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_MeasureDimensionMap { + measureGroup?: number; + dimension?: number; +} + +export const CT_MeasureDimensionMap_Attributes: Attributes = { + measureGroup: { + type: 'int' + }, + dimension: { + type: 'int' + } +}; + +export interface CT_MeasureDimensionMaps { + map?: CT_MeasureDimensionMap[]; + count?: number; +} + +export const CT_MeasureDimensionMaps_Attributes: Attributes = { + map: { + type: 'child', + childAttributes: CT_MeasureDimensionMap_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PivotCacheDefinition { + 'cacheSource'?: CT_CacheSource; + 'cacheFields'?: CT_CacheFields; + 'cacheHierarchies'?: CT_CacheHierarchies[]; + 'kpis'?: CT_PCDKPIs[]; + 'tupleCache'?: boolean; + 'calculatedItems'?: CT_CalculatedItems[]; + 'calculatedMembers'?: CT_CalculatedMembers[]; + 'dimensions'?: CT_Dimensions[]; + 'measureGroups'?: CT_MeasureGroups[]; + 'maps'?: CT_MeasureDimensionMaps[]; + 'extLst'?: CT_ExtensionList[]; + 'r:id'?: string; + 'invalid'?: boolean; + 'saveData'?: boolean; + 'refreshOnLoad'?: boolean; + 'optimizeMemory'?: boolean; + 'enableRefresh'?: boolean; + 'refreshedBy'?: string; + 'refreshedDateIso'?: string; + 'backgroundQuery'?: boolean; + 'missingItemsLimit'?: number; + 'createdVersion'?: number; + 'refreshedVersion'?: number; + 'minRefreshableVersion'?: number; + 'recordCount'?: number; + 'upgradeOnRefresh'?: boolean; + 'supportSubquery'?: boolean; + 'supportAdvancedDrill'?: boolean; +} + +export const CT_PivotCacheDefinition_Attributes: Attributes = { + 'cacheSource': { + type: 'child', + childAttributes: CT_CacheSource_Attributes + }, + 'cacheFields': { + type: 'child', + childAttributes: CT_CacheFields_Attributes + }, + 'cacheHierarchies': { + type: 'child', + childAttributes: CT_CacheHierarchies_Attributes, + childIsArray: true + }, + 'kpis': { + type: 'child', + childAttributes: CT_PCDKPIs_Attributes, + childIsArray: true + }, + 'tupleCache': { + type: 'boolean', + defaultValue: 'false' + }, + 'calculatedItems': { + type: 'child', + childAttributes: CT_CalculatedItems_Attributes, + childIsArray: true + }, + 'calculatedMembers': { + type: 'child', + childAttributes: CT_CalculatedMembers_Attributes, + childIsArray: true + }, + 'dimensions': { + type: 'child', + childAttributes: CT_Dimensions_Attributes, + childIsArray: true + }, + 'measureGroups': { + type: 'child', + childAttributes: CT_MeasureGroups_Attributes, + childIsArray: true + }, + 'maps': { + type: 'child', + childAttributes: CT_MeasureDimensionMaps_Attributes, + childIsArray: true + }, + 'extLst': { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + 'r:id': { + type: 'string' + }, + 'invalid': { + type: 'boolean', + defaultValue: 'false' + }, + 'saveData': { + type: 'boolean', + defaultValue: 'true' + }, + 'refreshOnLoad': { + type: 'boolean', + defaultValue: 'false' + }, + 'optimizeMemory': { + type: 'boolean', + defaultValue: 'false' + }, + 'enableRefresh': { + type: 'boolean', + defaultValue: 'true' + }, + 'refreshedBy': { + type: 'string' + }, + 'refreshedDateIso': { + type: 'string' + }, + 'backgroundQuery': { + type: 'boolean', + defaultValue: 'false' + }, + 'missingItemsLimit': { + type: 'int' + }, + 'createdVersion': { + type: 'int', + defaultValue: '0' + }, + 'refreshedVersion': { + type: 'int', + defaultValue: '0' + }, + 'minRefreshableVersion': { + type: 'int', + defaultValue: '0' + }, + 'recordCount': { + type: 'int' + }, + 'upgradeOnRefresh': { + type: 'boolean', + defaultValue: 'false' + }, + 'supportSubquery': { + type: 'boolean', + defaultValue: 'false' + }, + 'supportAdvancedDrill': { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Record { + m?: CT_Missing[]; + n?: CT_Number[]; + b?: CT_Boolean[]; + e?: CT_Error[]; + s?: CT_String[]; + d?: CT_DateTime[]; + x?: CT_Index[]; +} + +export const CT_Record_Attributes: Attributes = { + m: { + type: 'child', + childAttributes: CT_Missing_Attributes, + childIsArray: true + }, + n: { + type: 'child', + childAttributes: CT_Number_Attributes, + childIsArray: true + }, + b: { + type: 'child', + childAttributes: CT_Boolean_Attributes, + childIsArray: true + }, + e: { + type: 'child', + childAttributes: CT_Error_Attributes, + childIsArray: true + }, + s: { + type: 'child', + childAttributes: CT_String_Attributes, + childIsArray: true + }, + d: { + type: 'child', + childAttributes: CT_DateTime_Attributes, + childIsArray: true + }, + x: { + type: 'child', + childAttributes: CT_Index_Attributes, + childIsArray: true + } +}; + +export interface CT_PivotCacheRecords { + r?: CT_Record[]; + extLst?: CT_ExtensionList[]; + count?: number; +} + +export const CT_PivotCacheRecords_Attributes: Attributes = { + r: { + type: 'child', + childAttributes: CT_Record_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PCDSDTCEntries { + m?: CT_Missing[]; + n?: CT_Number[]; + e?: CT_Error[]; + s?: CT_String[]; + count?: number; +} + +export const CT_PCDSDTCEntries_Attributes: Attributes = { + m: { + type: 'child', + childAttributes: CT_Missing_Attributes, + childIsArray: true + }, + n: { + type: 'child', + childAttributes: CT_Number_Attributes, + childIsArray: true + }, + e: { + type: 'child', + childAttributes: CT_Error_Attributes, + childIsArray: true + }, + s: { + type: 'child', + childAttributes: CT_String_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_SortType = + | 'none' + | 'ascending' + | 'descending' + | 'ascendingAlpha' + | 'descendingAlpha' + | 'ascendingNatural' + | 'descendingNatural'; + +export interface CT_Set { + tpls?: CT_Tuples[]; + sortByTuple?: CT_Tuples[]; + count?: number; + maxRank?: number; + setDefinition?: string; + sortType?: ST_SortType; + queryFailed?: boolean; +} + +export const CT_Set_Attributes: Attributes = { + tpls: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + sortByTuple: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + count: { + type: 'int' + }, + maxRank: { + type: 'int' + }, + setDefinition: { + type: 'string' + }, + sortType: { + type: 'string', + defaultValue: 'none' + }, + queryFailed: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Sets { + set?: CT_Set[]; + count?: number; +} + +export const CT_Sets_Attributes: Attributes = { + set: { + type: 'child', + childAttributes: CT_Set_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Query { + tpls?: CT_Tuples[]; + mdx?: string; +} + +export const CT_Query_Attributes: Attributes = { + tpls: { + type: 'child', + childAttributes: CT_Tuples_Attributes, + childIsArray: true + }, + mdx: { + type: 'string' + } +}; + +export interface CT_QueryCache { + query?: CT_Query[]; + count?: number; +} + +export const CT_QueryCache_Attributes: Attributes = { + query: { + type: 'child', + childAttributes: CT_Query_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_ServerFormat { + culture?: string; + format?: string; +} + +export const CT_ServerFormat_Attributes: Attributes = { + culture: { + type: 'string' + }, + format: { + type: 'string' + } +}; + +export interface CT_ServerFormats { + serverFormat?: CT_ServerFormat[]; + count?: number; +} + +export const CT_ServerFormats_Attributes: Attributes = { + serverFormat: { + type: 'child', + childAttributes: CT_ServerFormat_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_TupleCache { + entries?: CT_PCDSDTCEntries[]; + sets?: CT_Sets[]; + queryCache?: CT_QueryCache[]; + serverFormats?: CT_ServerFormats; + extLst?: CT_ExtensionList[]; +} + +export const CT_TupleCache_Attributes: Attributes = { + entries: { + type: 'child', + childAttributes: CT_PCDSDTCEntries_Attributes, + childIsArray: true + }, + sets: { + type: 'child', + childAttributes: CT_Sets_Attributes, + childIsArray: true + }, + queryCache: { + type: 'child', + childAttributes: CT_QueryCache_Attributes, + childIsArray: true + }, + serverFormats: { + type: 'child', + childAttributes: CT_ServerFormats_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_Location { + ref?: string; + firstHeaderRow?: number; + firstDataRow?: number; + firstDataCol?: number; + rowPageCount?: number; + colPageCount?: number; +} + +export const CT_Location_Attributes: Attributes = { + ref: { + type: 'string' + }, + firstHeaderRow: { + type: 'int' + }, + firstDataRow: { + type: 'int' + }, + firstDataCol: { + type: 'int' + }, + rowPageCount: { + type: 'int', + defaultValue: '0' + }, + colPageCount: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_ItemType = + | 'data' + | 'default' + | 'sum' + | 'countA' + | 'avg' + | 'max' + | 'min' + | 'product' + | 'count' + | 'stdDev' + | 'stdDevP' + | 'var' + | 'varP' + | 'grand' + | 'blank'; + +export interface CT_Item { + n?: string; + t?: ST_ItemType; + h?: boolean; + s?: boolean; + sd?: boolean; + f?: boolean; + m?: boolean; + c?: boolean; + x?: number; + d?: boolean; + e?: boolean; +} + +export const CT_Item_Attributes: Attributes = { + n: { + type: 'string' + }, + t: { + type: 'string', + defaultValue: 'data' + }, + h: { + type: 'boolean', + defaultValue: 'false' + }, + s: { + type: 'boolean', + defaultValue: 'false' + }, + sd: { + type: 'boolean', + defaultValue: 'true' + }, + f: { + type: 'boolean', + defaultValue: 'false' + }, + m: { + type: 'boolean', + defaultValue: 'false' + }, + c: { + type: 'boolean', + defaultValue: 'false' + }, + x: { + type: 'int' + }, + d: { + type: 'boolean', + defaultValue: 'false' + }, + e: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_Items { + item?: CT_Item[]; + count?: number; +} + +export const CT_Items_Attributes: Attributes = { + item: { + type: 'child', + childAttributes: CT_Item_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_AutoSortScope { + pivotArea?: CT_PivotArea[]; +} + +export const CT_AutoSortScope_Attributes: Attributes = { + pivotArea: { + type: 'child', + childAttributes: CT_PivotArea_Attributes, + childIsArray: true + } +}; + +export type ST_FieldSortType = 'manual' | 'ascending' | 'descending'; + +export interface CT_PivotField { + items?: CT_Items[]; + autoSortScope?: CT_AutoSortScope[]; + extLst?: CT_ExtensionList[]; + name?: string; + axis?: ST_Axis; + dataField?: boolean; + subtotalCaption?: string; + showDropDowns?: boolean; + hiddenLevel?: boolean; + uniqueMemberProperty?: string; + compact?: boolean; + allDrilled?: boolean; + numFmtId?: number; + outline?: boolean; + subtotalTop?: boolean; + dragToRow?: boolean; + dragToCol?: boolean; + multipleItemSelectionAllowed?: boolean; + dragToPage?: boolean; + dragToData?: boolean; + dragOff?: boolean; + showAll?: boolean; + insertBlankRow?: boolean; + serverField?: boolean; + insertPageBreak?: boolean; + autoShow?: boolean; + topAutoShow?: boolean; + hideNewItems?: boolean; + measureFilter?: boolean; + includeNewItemsInFilter?: boolean; + itemPageCount?: number; + sortType?: ST_FieldSortType; + dataSourceSort?: boolean; + nonAutoSortDefault?: boolean; + rankBy?: number; + defaultSubtotal?: boolean; + sumSubtotal?: boolean; + countASubtotal?: boolean; + avgSubtotal?: boolean; + maxSubtotal?: boolean; + minSubtotal?: boolean; + productSubtotal?: boolean; + countSubtotal?: boolean; + stdDevSubtotal?: boolean; + stdDevPSubtotal?: boolean; + varSubtotal?: boolean; + varPSubtotal?: boolean; + showPropCell?: boolean; + showPropTip?: boolean; + showPropAsCaption?: boolean; + defaultAttributeDrillState?: boolean; +} + +export const CT_PivotField_Attributes: Attributes = { + items: { + type: 'child', + childAttributes: CT_Items_Attributes, + childIsArray: true + }, + autoSortScope: { + type: 'child', + childAttributes: CT_AutoSortScope_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + axis: { + type: 'string' + }, + dataField: { + type: 'boolean', + defaultValue: 'false' + }, + subtotalCaption: { + type: 'string' + }, + showDropDowns: { + type: 'boolean', + defaultValue: 'true' + }, + hiddenLevel: { + type: 'boolean', + defaultValue: 'false' + }, + uniqueMemberProperty: { + type: 'string' + }, + compact: { + type: 'boolean', + defaultValue: 'true' + }, + allDrilled: { + type: 'boolean', + defaultValue: 'false' + }, + numFmtId: { + type: 'int' + }, + outline: { + type: 'boolean', + defaultValue: 'true' + }, + subtotalTop: { + type: 'boolean', + defaultValue: 'true' + }, + dragToRow: { + type: 'boolean', + defaultValue: 'true' + }, + dragToCol: { + type: 'boolean', + defaultValue: 'true' + }, + multipleItemSelectionAllowed: { + type: 'boolean', + defaultValue: 'false' + }, + dragToPage: { + type: 'boolean', + defaultValue: 'true' + }, + dragToData: { + type: 'boolean', + defaultValue: 'true' + }, + dragOff: { + type: 'boolean', + defaultValue: 'true' + }, + showAll: { + type: 'boolean', + defaultValue: 'true' + }, + insertBlankRow: { + type: 'boolean', + defaultValue: 'false' + }, + serverField: { + type: 'boolean', + defaultValue: 'false' + }, + insertPageBreak: { + type: 'boolean', + defaultValue: 'false' + }, + autoShow: { + type: 'boolean', + defaultValue: 'false' + }, + topAutoShow: { + type: 'boolean', + defaultValue: 'true' + }, + hideNewItems: { + type: 'boolean', + defaultValue: 'false' + }, + measureFilter: { + type: 'boolean', + defaultValue: 'false' + }, + includeNewItemsInFilter: { + type: 'boolean', + defaultValue: 'false' + }, + itemPageCount: { + type: 'int', + defaultValue: '10' + }, + sortType: { + type: 'string', + defaultValue: 'manual' + }, + dataSourceSort: { + type: 'boolean' + }, + nonAutoSortDefault: { + type: 'boolean', + defaultValue: 'false' + }, + rankBy: { + type: 'int' + }, + defaultSubtotal: { + type: 'boolean', + defaultValue: 'true' + }, + sumSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + countASubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + avgSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + maxSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + minSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + productSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + countSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + stdDevSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + stdDevPSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + varSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + varPSubtotal: { + type: 'boolean', + defaultValue: 'false' + }, + showPropCell: { + type: 'boolean', + defaultValue: 'false' + }, + showPropTip: { + type: 'boolean', + defaultValue: 'false' + }, + showPropAsCaption: { + type: 'boolean', + defaultValue: 'false' + }, + defaultAttributeDrillState: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PivotFields { + pivotField?: CT_PivotField[]; + count?: number; +} + +export const CT_PivotFields_Attributes: Attributes = { + pivotField: { + type: 'child', + childAttributes: CT_PivotField_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Field { + x?: number; +} + +export const CT_Field_Attributes: Attributes = { + x: { + type: 'int' + } +}; + +export interface CT_RowFields { + field?: CT_Field[]; + count?: number; +} + +export const CT_RowFields_Attributes: Attributes = { + field: { + type: 'child', + childAttributes: CT_Field_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_I { + x?: CT_X[]; + t?: ST_ItemType; + r?: number; + i?: number; +} + +export const CT_I_Attributes: Attributes = { + x: { + type: 'child', + childAttributes: CT_X_Attributes, + childIsArray: true + }, + t: { + type: 'string', + defaultValue: 'data' + }, + r: { + type: 'int', + defaultValue: '0' + }, + i: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_rowItems { + i?: CT_I[]; + count?: number; +} + +export const CT_rowItems_Attributes: Attributes = { + i: { + type: 'child', + childAttributes: CT_I_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_ColFields { + field?: CT_Field[]; + count?: number; +} + +export const CT_ColFields_Attributes: Attributes = { + field: { + type: 'child', + childAttributes: CT_Field_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_colItems { + i?: CT_I[]; + count?: number; +} + +export const CT_colItems_Attributes: Attributes = { + i: { + type: 'child', + childAttributes: CT_I_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PageField { + extLst?: CT_ExtensionList[]; + fld?: number; + item?: number; + hier?: number; + name?: string; + cap?: string; +} + +export const CT_PageField_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + fld: { + type: 'int' + }, + item: { + type: 'int' + }, + hier: { + type: 'int' + }, + name: { + type: 'string' + }, + cap: { + type: 'string' + } +}; + +export interface CT_PageFields { + pageField?: CT_PageField[]; + count?: number; +} + +export const CT_PageFields_Attributes: Attributes = { + pageField: { + type: 'child', + childAttributes: CT_PageField_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_DataConsolidateFunction = + | 'average' + | 'count' + | 'countNums' + | 'max' + | 'min' + | 'product' + | 'stdDev' + | 'stdDevp' + | 'sum' + | 'var' + | 'varp'; + +export type ST_ShowDataAs = + | 'normal' + | 'difference' + | 'percent' + | 'percentDiff' + | 'runTotal' + | 'percentOfRow' + | 'percentOfCol' + | 'percentOfTotal' + | 'index'; + +export interface CT_DataField { + extLst?: CT_ExtensionList[]; + name?: string; + fld?: number; + subtotal?: ST_DataConsolidateFunction; + showDataAs?: ST_ShowDataAs; + baseField?: number; + baseItem?: number; + numFmtId?: number; +} + +export const CT_DataField_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + fld: { + type: 'int' + }, + subtotal: { + type: 'string', + defaultValue: 'sum' + }, + showDataAs: { + type: 'string', + defaultValue: 'normal' + }, + baseField: { + type: 'int', + defaultValue: '-1' + }, + baseItem: { + type: 'int', + defaultValue: '1048832' + }, + numFmtId: { + type: 'int' + } +}; + +export interface CT_DataFields { + dataField?: CT_DataField[]; + count?: number; +} + +export const CT_DataFields_Attributes: Attributes = { + dataField: { + type: 'child', + childAttributes: CT_DataField_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_FormatAction = 'blank' | 'formatting' | 'drill' | 'formula'; + +export interface CT_Format { + pivotArea?: CT_PivotArea[]; + extLst?: CT_ExtensionList[]; + action?: ST_FormatAction; + dxfId?: number; +} + +export const CT_Format_Attributes: Attributes = { + pivotArea: { + type: 'child', + childAttributes: CT_PivotArea_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + action: { + type: 'string', + defaultValue: 'formatting' + }, + dxfId: { + type: 'int' + } +}; + +export interface CT_Formats { + format?: CT_Format[]; + count?: number; +} + +export const CT_Formats_Attributes: Attributes = { + format: { + type: 'child', + childAttributes: CT_Format_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_PivotAreas { + pivotArea?: CT_PivotArea[]; + count?: number; +} + +export const CT_PivotAreas_Attributes: Attributes = { + pivotArea: { + type: 'child', + childAttributes: CT_PivotArea_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_Scope = 'selection' | 'data' | 'field'; + +export type ST_Type = 'none' | 'all' | 'row' | 'column'; + +export interface CT_ConditionalFormat { + pivotAreas?: CT_PivotAreas[]; + extLst?: CT_ExtensionList[]; + scope?: ST_Scope; + type?: ST_Type; + priority?: number; +} + +export const CT_ConditionalFormat_Attributes: Attributes = { + pivotAreas: { + type: 'child', + childAttributes: CT_PivotAreas_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + scope: { + type: 'string', + defaultValue: 'selection' + }, + type: { + type: 'string', + defaultValue: 'none' + }, + priority: { + type: 'int' + } +}; + +export interface CT_ConditionalFormats { + conditionalFormat?: CT_ConditionalFormat[]; + count?: number; +} + +export const CT_ConditionalFormats_Attributes: Attributes = { + conditionalFormat: { + type: 'child', + childAttributes: CT_ConditionalFormat_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_ChartFormat { + pivotArea?: CT_PivotArea[]; + chart?: number; + format?: number; + series?: boolean; +} + +export const CT_ChartFormat_Attributes: Attributes = { + pivotArea: { + type: 'child', + childAttributes: CT_PivotArea_Attributes, + childIsArray: true + }, + chart: { + type: 'int' + }, + format: { + type: 'int' + }, + series: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ChartFormats { + chartFormat?: CT_ChartFormat[]; + count?: number; +} + +export const CT_ChartFormats_Attributes: Attributes = { + chartFormat: { + type: 'child', + childAttributes: CT_ChartFormat_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_MemberProperty { + name?: string; + showCell?: boolean; + showTip?: boolean; + showAsCaption?: boolean; + nameLen?: number; + pPos?: number; + pLen?: number; + level?: number; + field?: number; +} + +export const CT_MemberProperty_Attributes: Attributes = { + name: { + type: 'string' + }, + showCell: { + type: 'boolean', + defaultValue: 'false' + }, + showTip: { + type: 'boolean', + defaultValue: 'false' + }, + showAsCaption: { + type: 'boolean', + defaultValue: 'false' + }, + nameLen: { + type: 'int' + }, + pPos: { + type: 'int' + }, + pLen: { + type: 'int' + }, + level: { + type: 'int' + }, + field: { + type: 'int' + } +}; + +export interface CT_MemberProperties { + mp?: CT_MemberProperty[]; + count?: number; +} + +export const CT_MemberProperties_Attributes: Attributes = { + mp: { + type: 'child', + childAttributes: CT_MemberProperty_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Member { + name?: string; +} + +export const CT_Member_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export interface CT_Members { + member?: CT_Member[]; + count?: number; + level?: number; +} + +export const CT_Members_Attributes: Attributes = { + member: { + type: 'child', + childAttributes: CT_Member_Attributes, + childIsArray: true + }, + count: { + type: 'int' + }, + level: { + type: 'int' + } +}; + +export interface CT_PivotHierarchy { + mps?: CT_MemberProperties[]; + members?: CT_Members[]; + extLst?: CT_ExtensionList[]; + outline?: boolean; + multipleItemSelectionAllowed?: boolean; + subtotalTop?: boolean; + showInFieldList?: boolean; + dragToRow?: boolean; + dragToCol?: boolean; + dragToPage?: boolean; + dragToData?: boolean; + dragOff?: boolean; + includeNewItemsInFilter?: boolean; + caption?: string; +} + +export const CT_PivotHierarchy_Attributes: Attributes = { + mps: { + type: 'child', + childAttributes: CT_MemberProperties_Attributes, + childIsArray: true + }, + members: { + type: 'child', + childAttributes: CT_Members_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + outline: { + type: 'boolean', + defaultValue: 'false' + }, + multipleItemSelectionAllowed: { + type: 'boolean', + defaultValue: 'false' + }, + subtotalTop: { + type: 'boolean', + defaultValue: 'false' + }, + showInFieldList: { + type: 'boolean', + defaultValue: 'true' + }, + dragToRow: { + type: 'boolean', + defaultValue: 'true' + }, + dragToCol: { + type: 'boolean', + defaultValue: 'true' + }, + dragToPage: { + type: 'boolean', + defaultValue: 'true' + }, + dragToData: { + type: 'boolean', + defaultValue: 'false' + }, + dragOff: { + type: 'boolean', + defaultValue: 'true' + }, + includeNewItemsInFilter: { + type: 'boolean', + defaultValue: 'false' + }, + caption: { + type: 'string' + } +}; + +export interface CT_PivotHierarchies { + pivotHierarchy?: CT_PivotHierarchy[]; + count?: number; +} + +export const CT_PivotHierarchies_Attributes: Attributes = { + pivotHierarchy: { + type: 'child', + childAttributes: CT_PivotHierarchy_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_PivotTableStyle { + name?: string; + showRowHeaders?: boolean; + showColHeaders?: boolean; + showRowStripes?: boolean; + showColStripes?: boolean; + showLastColumn?: boolean; +} + +export const CT_PivotTableStyle_Attributes: Attributes = { + name: { + type: 'string' + }, + showRowHeaders: { + type: 'boolean' + }, + showColHeaders: { + type: 'boolean' + }, + showRowStripes: { + type: 'boolean' + }, + showColStripes: { + type: 'boolean' + }, + showLastColumn: { + type: 'boolean' + } +}; + +export type ST_PivotFilterType = + | 'unknown' + | 'count' + | 'percent' + | 'sum' + | 'captionEqual' + | 'captionNotEqual' + | 'captionBeginsWith' + | 'captionNotBeginsWith' + | 'captionEndsWith' + | 'captionNotEndsWith' + | 'captionContains' + | 'captionNotContains' + | 'captionGreaterThan' + | 'captionGreaterThanOrEqual' + | 'captionLessThan' + | 'captionLessThanOrEqual' + | 'captionBetween' + | 'captionNotBetween' + | 'valueEqual' + | 'valueNotEqual' + | 'valueGreaterThan' + | 'valueGreaterThanOrEqual' + | 'valueLessThan' + | 'valueLessThanOrEqual' + | 'valueBetween' + | 'valueNotBetween' + | 'dateEqual' + | 'dateNotEqual' + | 'dateOlderThan' + | 'dateOlderThanOrEqual' + | 'dateNewerThan' + | 'dateNewerThanOrEqual' + | 'dateBetween' + | 'dateNotBetween' + | 'tomorrow' + | 'today' + | 'yesterday' + | 'nextWeek' + | 'thisWeek' + | 'lastWeek' + | 'nextMonth' + | 'thisMonth' + | 'lastMonth' + | 'nextQuarter' + | 'thisQuarter' + | 'lastQuarter' + | 'nextYear' + | 'thisYear' + | 'lastYear' + | 'yearToDate' + | 'Q1' + | 'Q2' + | 'Q3' + | 'Q4' + | 'M1' + | 'M2' + | 'M3' + | 'M4' + | 'M5' + | 'M6' + | 'M7' + | 'M8' + | 'M9' + | 'M10' + | 'M11' + | 'M12'; + +export interface CT_PivotFilter { + autoFilter?: CT_AutoFilter; + extLst?: CT_ExtensionList[]; + fld?: number; + mpFld?: number; + type?: ST_PivotFilterType; + evalOrder?: number; + id?: number; + iMeasureHier?: number; + iMeasureFld?: number; + name?: string; + description?: string; + stringValue1?: string; + stringValue2?: string; +} + +export const CT_PivotFilter_Attributes: Attributes = { + autoFilter: { + type: 'child', + childAttributes: CT_AutoFilter_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + fld: { + type: 'int' + }, + mpFld: { + type: 'int' + }, + type: { + type: 'string' + }, + evalOrder: { + type: 'int', + defaultValue: '0' + }, + id: { + type: 'int' + }, + iMeasureHier: { + type: 'int' + }, + iMeasureFld: { + type: 'int' + }, + name: { + type: 'string' + }, + description: { + type: 'string' + }, + stringValue1: { + type: 'string' + }, + stringValue2: { + type: 'string' + } +}; + +export interface CT_PivotFilters { + filter?: CT_PivotFilter[]; + count?: number; +} + +export const CT_PivotFilters_Attributes: Attributes = { + filter: { + type: 'child', + childAttributes: CT_PivotFilter_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_HierarchyUsage { + hierarchyUsage?: number; +} + +export const CT_HierarchyUsage_Attributes: Attributes = { + hierarchyUsage: { + type: 'int' + } +}; + +export interface CT_RowHierarchiesUsage { + rowHierarchyUsage?: CT_HierarchyUsage[]; + count?: number; +} + +export const CT_RowHierarchiesUsage_Attributes: Attributes = { + rowHierarchyUsage: { + type: 'child', + childAttributes: CT_HierarchyUsage_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_ColHierarchiesUsage { + colHierarchyUsage?: CT_HierarchyUsage[]; + count?: number; +} + +export const CT_ColHierarchiesUsage_Attributes: Attributes = { + colHierarchyUsage: { + type: 'child', + childAttributes: CT_HierarchyUsage_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_pivotTableDefinition { + location?: CT_Location[]; + pivotFields?: CT_PivotFields[]; + rowFields?: CT_RowFields[]; + rowItems?: CT_rowItems[]; + colFields?: CT_ColFields[]; + colItems?: CT_colItems[]; + pageFields?: CT_PageFields[]; + dataFields?: CT_DataFields[]; + formats?: CT_Formats[]; + conditionalFormats?: CT_ConditionalFormats[]; + chartFormats?: CT_ChartFormats[]; + pivotHierarchies?: CT_PivotHierarchies[]; + pivotTableStyleInfo?: CT_PivotTableStyle; + filters?: CT_PivotFilters; + rowHierarchiesUsage?: CT_RowHierarchiesUsage; + colHierarchiesUsage?: CT_ColHierarchiesUsage; + extLst?: CT_ExtensionList[]; + name?: string; + cacheId?: number; + dataOnRows?: boolean; + dataPosition?: number; + dataCaption?: string; + grandTotalCaption?: string; + errorCaption?: string; + showError?: boolean; + missingCaption?: string; + showMissing?: boolean; + pageStyle?: string; + pivotTableStyle?: string; + vacatedStyle?: string; + tag?: string; + updatedVersion?: number; + minRefreshableVersion?: number; + asteriskTotals?: boolean; + showItems?: boolean; + editData?: boolean; + disableFieldList?: boolean; + showCalcMbrs?: boolean; + visualTotals?: boolean; + showMultipleLabel?: boolean; + showDataDropDown?: boolean; + showDrill?: boolean; + printDrill?: boolean; + showMemberPropertyTips?: boolean; + showDataTips?: boolean; + enableWizard?: boolean; + enableDrill?: boolean; + enableFieldProperties?: boolean; + preserveFormatting?: boolean; + useAutoFormatting?: boolean; + pageWrap?: number; + pageOverThenDown?: boolean; + subtotalHiddenItems?: boolean; + rowGrandTotals?: boolean; + colGrandTotals?: boolean; + fieldPrintTitles?: boolean; + itemPrintTitles?: boolean; + mergeItem?: boolean; + showDropZones?: boolean; + createdVersion?: number; + indent?: number; + showEmptyRow?: boolean; + showEmptyCol?: boolean; + showHeaders?: boolean; + compact?: boolean; + outline?: boolean; + outlineData?: boolean; + compactData?: boolean; + published?: boolean; + gridDropZones?: boolean; + immersive?: boolean; + multipleFieldFilters?: boolean; + chartFormat?: number; + rowHeaderCaption?: string; + colHeaderCaption?: string; + fieldListSortAscending?: boolean; + mdxSubqueries?: boolean; + customListSort?: boolean; +} + +export const CT_pivotTableDefinition_Attributes: Attributes = { + location: { + type: 'child', + childAttributes: CT_Location_Attributes, + childIsArray: true + }, + pivotFields: { + type: 'child', + childAttributes: CT_PivotFields_Attributes, + childIsArray: true + }, + rowFields: { + type: 'child', + childAttributes: CT_RowFields_Attributes, + childIsArray: true + }, + rowItems: { + type: 'child', + childAttributes: CT_rowItems_Attributes, + childIsArray: true + }, + colFields: { + type: 'child', + childAttributes: CT_ColFields_Attributes, + childIsArray: true + }, + colItems: { + type: 'child', + childAttributes: CT_colItems_Attributes, + childIsArray: true + }, + pageFields: { + type: 'child', + childAttributes: CT_PageFields_Attributes, + childIsArray: true + }, + dataFields: { + type: 'child', + childAttributes: CT_DataFields_Attributes, + childIsArray: true + }, + formats: { + type: 'child', + childAttributes: CT_Formats_Attributes, + childIsArray: true + }, + conditionalFormats: { + type: 'child', + childAttributes: CT_ConditionalFormats_Attributes, + childIsArray: true + }, + chartFormats: { + type: 'child', + childAttributes: CT_ChartFormats_Attributes, + childIsArray: true + }, + pivotHierarchies: { + type: 'child', + childAttributes: CT_PivotHierarchies_Attributes, + childIsArray: true + }, + pivotTableStyleInfo: { + type: 'child', + childAttributes: CT_PivotTableStyle_Attributes + }, + filters: { + type: 'child', + childAttributes: CT_PivotFilters_Attributes + }, + rowHierarchiesUsage: { + type: 'child', + childAttributes: CT_RowHierarchiesUsage_Attributes + }, + colHierarchiesUsage: { + type: 'child', + childAttributes: CT_ColHierarchiesUsage_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + cacheId: { + type: 'int' + }, + dataOnRows: { + type: 'boolean', + defaultValue: 'false' + }, + dataPosition: { + type: 'int' + }, + dataCaption: { + type: 'string' + }, + grandTotalCaption: { + type: 'string' + }, + errorCaption: { + type: 'string' + }, + showError: { + type: 'boolean', + defaultValue: 'false' + }, + missingCaption: { + type: 'string' + }, + showMissing: { + type: 'boolean', + defaultValue: 'true' + }, + pageStyle: { + type: 'string' + }, + pivotTableStyle: { + type: 'string' + }, + vacatedStyle: { + type: 'string' + }, + tag: { + type: 'string' + }, + updatedVersion: { + type: 'int', + defaultValue: '0' + }, + minRefreshableVersion: { + type: 'int', + defaultValue: '0' + }, + asteriskTotals: { + type: 'boolean', + defaultValue: 'false' + }, + showItems: { + type: 'boolean', + defaultValue: 'true' + }, + editData: { + type: 'boolean', + defaultValue: 'false' + }, + disableFieldList: { + type: 'boolean', + defaultValue: 'false' + }, + showCalcMbrs: { + type: 'boolean', + defaultValue: 'true' + }, + visualTotals: { + type: 'boolean', + defaultValue: 'true' + }, + showMultipleLabel: { + type: 'boolean', + defaultValue: 'true' + }, + showDataDropDown: { + type: 'boolean', + defaultValue: 'true' + }, + showDrill: { + type: 'boolean', + defaultValue: 'true' + }, + printDrill: { + type: 'boolean', + defaultValue: 'false' + }, + showMemberPropertyTips: { + type: 'boolean', + defaultValue: 'true' + }, + showDataTips: { + type: 'boolean', + defaultValue: 'true' + }, + enableWizard: { + type: 'boolean', + defaultValue: 'true' + }, + enableDrill: { + type: 'boolean', + defaultValue: 'true' + }, + enableFieldProperties: { + type: 'boolean', + defaultValue: 'true' + }, + preserveFormatting: { + type: 'boolean', + defaultValue: 'true' + }, + useAutoFormatting: { + type: 'boolean', + defaultValue: 'false' + }, + pageWrap: { + type: 'int', + defaultValue: '0' + }, + pageOverThenDown: { + type: 'boolean', + defaultValue: 'false' + }, + subtotalHiddenItems: { + type: 'boolean', + defaultValue: 'false' + }, + rowGrandTotals: { + type: 'boolean', + defaultValue: 'true' + }, + colGrandTotals: { + type: 'boolean', + defaultValue: 'true' + }, + fieldPrintTitles: { + type: 'boolean', + defaultValue: 'false' + }, + itemPrintTitles: { + type: 'boolean', + defaultValue: 'false' + }, + mergeItem: { + type: 'boolean', + defaultValue: 'false' + }, + showDropZones: { + type: 'boolean', + defaultValue: 'true' + }, + createdVersion: { + type: 'int', + defaultValue: '0' + }, + indent: { + type: 'int', + defaultValue: '1' + }, + showEmptyRow: { + type: 'boolean', + defaultValue: 'false' + }, + showEmptyCol: { + type: 'boolean', + defaultValue: 'false' + }, + showHeaders: { + type: 'boolean', + defaultValue: 'true' + }, + compact: { + type: 'boolean', + defaultValue: 'true' + }, + outline: { + type: 'boolean', + defaultValue: 'false' + }, + outlineData: { + type: 'boolean', + defaultValue: 'false' + }, + compactData: { + type: 'boolean', + defaultValue: 'true' + }, + published: { + type: 'boolean', + defaultValue: 'false' + }, + gridDropZones: { + type: 'boolean', + defaultValue: 'false' + }, + immersive: { + type: 'boolean', + defaultValue: 'true' + }, + multipleFieldFilters: { + type: 'boolean', + defaultValue: 'true' + }, + chartFormat: { + type: 'int', + defaultValue: '0' + }, + rowHeaderCaption: { + type: 'string' + }, + colHeaderCaption: { + type: 'string' + }, + fieldListSortAscending: { + type: 'boolean', + defaultValue: 'false' + }, + mdxSubqueries: { + type: 'boolean', + defaultValue: 'false' + }, + customListSort: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_QueryTableField { + extLst?: CT_ExtensionList; + id?: number; + name?: string; + dataBound?: boolean; + rowNumbers?: boolean; + fillFormulas?: boolean; + clipped?: boolean; + tableColumnId?: number; +} + +export const CT_QueryTableField_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + id: { + type: 'int' + }, + name: { + type: 'string' + }, + dataBound: { + type: 'boolean', + defaultValue: 'true' + }, + rowNumbers: { + type: 'boolean', + defaultValue: 'false' + }, + fillFormulas: { + type: 'boolean', + defaultValue: 'false' + }, + clipped: { + type: 'boolean', + defaultValue: 'false' + }, + tableColumnId: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_QueryTableFields { + queryTableField?: CT_QueryTableField[]; + count?: number; +} + +export const CT_QueryTableFields_Attributes: Attributes = { + queryTableField: { + type: 'child', + childAttributes: CT_QueryTableField_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_DeletedField { + name?: string; +} + +export const CT_DeletedField_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export interface CT_QueryTableDeletedFields { + deletedField?: CT_DeletedField[]; + count?: number; +} + +export const CT_QueryTableDeletedFields_Attributes: Attributes = { + deletedField: { + type: 'child', + childAttributes: CT_DeletedField_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_QueryTableRefresh { + queryTableFields?: CT_QueryTableFields; + queryTableDeletedFields?: CT_QueryTableDeletedFields; + sortState?: CT_SortState; + extLst?: CT_ExtensionList; + preserveSortFilterLayout?: boolean; + fieldIdWrapped?: boolean; + headersInLastRefresh?: boolean; + minimumVersion?: number; + nextId?: number; + unboundColumnsLeft?: number; + unboundColumnsRight?: number; +} + +export const CT_QueryTableRefresh_Attributes: Attributes = { + queryTableFields: { + type: 'child', + childAttributes: CT_QueryTableFields_Attributes + }, + queryTableDeletedFields: { + type: 'child', + childAttributes: CT_QueryTableDeletedFields_Attributes + }, + sortState: { + type: 'child', + childAttributes: CT_SortState_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + preserveSortFilterLayout: { + type: 'boolean', + defaultValue: 'true' + }, + fieldIdWrapped: { + type: 'boolean', + defaultValue: 'false' + }, + headersInLastRefresh: { + type: 'boolean', + defaultValue: 'true' + }, + minimumVersion: { + type: 'int', + defaultValue: '0' + }, + nextId: { + type: 'int', + defaultValue: '1' + }, + unboundColumnsLeft: { + type: 'int', + defaultValue: '0' + }, + unboundColumnsRight: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_GrowShrinkType = + | 'insertDelete' + | 'insertClear' + | 'overwriteClear'; + +export interface CT_QueryTable { + queryTableRefresh?: CT_QueryTableRefresh; + extLst?: CT_ExtensionList; + name?: string; + headers?: boolean; + rowNumbers?: boolean; + disableRefresh?: boolean; + backgroundRefresh?: boolean; + firstBackgroundRefresh?: boolean; + refreshOnLoad?: boolean; + growShrinkType?: ST_GrowShrinkType; + fillFormulas?: boolean; + removeDataOnSave?: boolean; + disableEdit?: boolean; + preserveFormatting?: boolean; + adjustColumnWidth?: boolean; + intermediate?: boolean; + connectionId?: number; +} + +export const CT_QueryTable_Attributes: Attributes = { + queryTableRefresh: { + type: 'child', + childAttributes: CT_QueryTableRefresh_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + name: { + type: 'string' + }, + headers: { + type: 'boolean', + defaultValue: 'true' + }, + rowNumbers: { + type: 'boolean', + defaultValue: 'false' + }, + disableRefresh: { + type: 'boolean', + defaultValue: 'false' + }, + backgroundRefresh: { + type: 'boolean', + defaultValue: 'true' + }, + firstBackgroundRefresh: { + type: 'boolean', + defaultValue: 'false' + }, + refreshOnLoad: { + type: 'boolean', + defaultValue: 'false' + }, + growShrinkType: { + type: 'string', + defaultValue: 'insertDelete' + }, + fillFormulas: { + type: 'boolean', + defaultValue: 'false' + }, + removeDataOnSave: { + type: 'boolean', + defaultValue: 'false' + }, + disableEdit: { + type: 'boolean', + defaultValue: 'false' + }, + preserveFormatting: { + type: 'boolean', + defaultValue: 'true' + }, + adjustColumnWidth: { + type: 'boolean', + defaultValue: 'true' + }, + intermediate: { + type: 'boolean', + defaultValue: 'false' + }, + connectionId: { + type: 'int' + } +}; + +export interface CT_Sst { + si?: CT_Rst[]; + extLst?: CT_ExtensionList[]; + count?: number; + uniqueCount?: number; +} + +export const CT_Sst_Attributes: Attributes = { + si: { + type: 'child', + childAttributes: CT_Rst_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + count: { + type: 'int' + }, + uniqueCount: { + type: 'int' + } +}; + +export interface CT_SheetId { + val?: number; +} + +export const CT_SheetId_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_SheetIdMap { + sheetId?: CT_SheetId[]; + count?: number; +} + +export const CT_SheetIdMap_Attributes: Attributes = { + sheetId: { + type: 'child', + childAttributes: CT_SheetId_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Reviewed { + rId?: number; +} + +export const CT_Reviewed_Attributes: Attributes = { + rId: { + type: 'int' + } +}; + +export interface CT_ReviewedRevisions { + reviewed?: CT_Reviewed[]; + count?: number; +} + +export const CT_ReviewedRevisions_Attributes: Attributes = { + reviewed: { + type: 'child', + childAttributes: CT_Reviewed_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_RevisionHeader { + 'sheetIdMap'?: CT_SheetIdMap; + 'reviewedList'?: CT_ReviewedRevisions; + 'extLst'?: CT_ExtensionList[]; + 'guid'?: string; + 'dateTime'?: string; + 'maxSheetId'?: number; + 'userName'?: string; + 'r:id'?: string; + 'minRId'?: number; + 'maxRId'?: number; +} + +export const CT_RevisionHeader_Attributes: Attributes = { + 'sheetIdMap': { + type: 'child', + childAttributes: CT_SheetIdMap_Attributes + }, + 'reviewedList': { + type: 'child', + childAttributes: CT_ReviewedRevisions_Attributes + }, + 'extLst': { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + 'guid': { + type: 'string' + }, + 'dateTime': { + type: 'string' + }, + 'maxSheetId': { + type: 'int' + }, + 'userName': { + type: 'string' + }, + 'r:id': { + type: 'string' + }, + 'minRId': { + type: 'int' + }, + 'maxRId': { + type: 'int' + } +}; + +export interface CT_RevisionHeaders { + header?: CT_RevisionHeader[]; + guid?: string; + lastGuid?: string; + shared?: boolean; + diskRevisions?: boolean; + history?: boolean; + trackRevisions?: boolean; + exclusive?: boolean; + revisionId?: number; + version?: number; + keepChangeHistory?: boolean; + protected?: boolean; + preserveHistory?: number; +} + +export const CT_RevisionHeaders_Attributes: Attributes = { + header: { + type: 'child', + childAttributes: CT_RevisionHeader_Attributes, + childIsArray: true + }, + guid: { + type: 'string' + }, + lastGuid: { + type: 'string' + }, + shared: { + type: 'boolean', + defaultValue: 'true' + }, + diskRevisions: { + type: 'boolean', + defaultValue: 'false' + }, + history: { + type: 'boolean', + defaultValue: 'true' + }, + trackRevisions: { + type: 'boolean', + defaultValue: 'true' + }, + exclusive: { + type: 'boolean', + defaultValue: 'false' + }, + revisionId: { + type: 'int', + defaultValue: '0' + }, + version: { + type: 'int', + defaultValue: '1' + }, + keepChangeHistory: { + type: 'boolean', + defaultValue: 'true' + }, + protected: { + type: 'boolean', + defaultValue: 'false' + }, + preserveHistory: { + type: 'int', + defaultValue: '30' + } +}; + +export type ST_FormulaExpression = + | 'ref' + | 'refError' + | 'area' + | 'areaError' + | 'computedArea'; + +export interface CT_UndoInfo { + index?: number; + exp?: ST_FormulaExpression; + ref3D?: boolean; + array?: boolean; + v?: boolean; + nf?: boolean; + cs?: boolean; + dr?: string; + dn?: string; + r?: string; + sId?: number; +} + +export const CT_UndoInfo_Attributes: Attributes = { + index: { + type: 'int' + }, + exp: { + type: 'string' + }, + ref3D: { + type: 'boolean', + defaultValue: 'false' + }, + array: { + type: 'boolean', + defaultValue: 'false' + }, + v: { + type: 'boolean', + defaultValue: 'false' + }, + nf: { + type: 'boolean', + defaultValue: 'false' + }, + cs: { + type: 'boolean', + defaultValue: 'false' + }, + dr: { + type: 'string' + }, + dn: { + type: 'string' + }, + r: { + type: 'string' + }, + sId: { + type: 'int' + } +}; + +export interface CT_CellFormula {} + +export const CT_CellFormula_Attributes: Attributes = {}; + +export type ST_CellType = 'b' | 'd' | 'n' | 'e' | 's' | 'str' | 'inlineStr'; + +export interface CT_Cell { + f?: CT_CellFormula; + v?: string; + is?: CT_Rst; + extLst?: CT_ExtensionList[]; + r?: string; + s?: number; + t?: ST_CellType; + cm?: number; + vm?: number; + ph?: boolean; +} + +export const CT_Cell_Attributes: Attributes = { + f: { + type: 'child', + childAttributes: CT_CellFormula_Attributes + }, + v: { + type: 'child-string' + }, + is: { + type: 'child', + childAttributes: CT_Rst_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + r: { + type: 'string' + }, + s: { + type: 'int', + defaultValue: '0' + }, + t: { + type: 'string', + defaultValue: 'n' + }, + cm: { + type: 'int', + defaultValue: '0' + }, + vm: { + type: 'int', + defaultValue: '0' + }, + ph: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_FontFamily = number; + +export interface CT_FontFamily { + val?: number; +} + +export const CT_FontFamily_Attributes: Attributes = { + val: { + type: 'int' + } +}; + +export interface CT_Font { + name?: CT_FontName; + charset?: CT_IntProperty; + family?: CT_FontFamily; + b?: CT_BooleanProperty; + i?: CT_BooleanProperty; + strike?: CT_BooleanProperty; + outline?: CT_BooleanProperty; + shadow?: CT_BooleanProperty; + condense?: CT_BooleanProperty; + extend?: CT_BooleanProperty; + color?: CT_Color; + sz?: CT_FontSize; + u?: CT_UnderlineProperty; + vertAlign?: CT_VerticalAlignFontProperty; + scheme?: CT_FontScheme; +} + +export const CT_Font_Attributes: Attributes = { + name: { + type: 'child', + childAttributes: CT_FontName_Attributes + }, + charset: { + type: 'child', + childAttributes: CT_IntProperty_Attributes + }, + family: { + type: 'child', + childAttributes: CT_FontFamily_Attributes + }, + b: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + i: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + strike: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + outline: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + shadow: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + condense: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + extend: { + type: 'child', + childAttributes: CT_BooleanProperty_Attributes + }, + color: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + sz: { + type: 'child', + childAttributes: CT_FontSize_Attributes + }, + u: { + type: 'child', + childAttributes: CT_UnderlineProperty_Attributes + }, + vertAlign: { + type: 'child', + childAttributes: CT_VerticalAlignFontProperty_Attributes + }, + scheme: { + type: 'child', + childAttributes: CT_FontScheme_Attributes + } +}; + +export interface CT_NumFmt { + numFmtId?: number; + formatCode?: string; +} + +export const CT_NumFmt_Attributes: Attributes = { + numFmtId: { + type: 'int' + }, + formatCode: { + type: 'string' + } +}; + +export type ST_PatternType = + | 'none' + | 'solid' + | 'mediumGray' + | 'darkGray' + | 'lightGray' + | 'darkHorizontal' + | 'darkVertical' + | 'darkDown' + | 'darkUp' + | 'darkGrid' + | 'darkTrellis' + | 'lightHorizontal' + | 'lightVertical' + | 'lightDown' + | 'lightUp' + | 'lightGrid' + | 'lightTrellis' + | 'gray125' + | 'gray0625'; + +export interface CT_PatternFill { + fgColor?: CT_Color; + bgColor?: CT_Color; + patternType?: ST_PatternType; +} + +export const CT_PatternFill_Attributes: Attributes = { + fgColor: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + bgColor: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + patternType: { + type: 'string' + } +}; + +export type ST_GradientType = 'linear' | 'path'; + +export interface CT_GradientFill { + stop?: CT_GradientStop[]; + type?: ST_GradientType; + degree?: number; + left?: number; + right?: number; + top?: number; + bottom?: number; +} + +export const CT_GradientFill_Attributes: Attributes = { + stop: { + type: 'child', + childAttributes: CT_GradientStop_Attributes, + childIsArray: true + }, + type: { + type: 'string', + defaultValue: 'linear' + }, + degree: { + type: 'double', + defaultValue: '0' + }, + left: { + type: 'double', + defaultValue: '0' + }, + right: { + type: 'double', + defaultValue: '0' + }, + top: { + type: 'double', + defaultValue: '0' + }, + bottom: { + type: 'double', + defaultValue: '0' + } +}; + +export interface CT_Fill { + patternFill?: CT_PatternFill; + gradientFill?: CT_GradientFill; +} + +export const CT_Fill_Attributes: Attributes = { + patternFill: { + type: 'child', + childAttributes: CT_PatternFill_Attributes + }, + gradientFill: { + type: 'child', + childAttributes: CT_GradientFill_Attributes + } +}; + +export type ST_HorizontalAlignment = + | 'general' + | 'left' + | 'center' + | 'right' + | 'fill' + | 'justify' + | 'centerContinuous' + | 'distributed'; + +export type ST_VerticalAlignment = + | 'top' + | 'center' + | 'bottom' + | 'justify' + | 'distributed'; + +export interface CT_CellAlignment { + horizontal?: ST_HorizontalAlignment; + vertical?: ST_VerticalAlignment; + textRotation?: number; + wrapText?: boolean; + indent?: number; + relativeIndent?: number; + justifyLastLine?: boolean; + shrinkToFit?: boolean; + readingOrder?: number; +} + +export const CT_CellAlignment_Attributes: Attributes = { + horizontal: { + type: 'string' + }, + vertical: { + type: 'string', + defaultValue: 'bottom' + }, + textRotation: { + type: 'int' + }, + wrapText: { + type: 'boolean' + }, + indent: { + type: 'int' + }, + relativeIndent: { + type: 'int' + }, + justifyLastLine: { + type: 'boolean' + }, + shrinkToFit: { + type: 'boolean' + }, + readingOrder: { + type: 'int' + } +}; + +export type ST_BorderStyle = + | 'none' + | 'thin' + | 'medium' + | 'dashed' + | 'dotted' + | 'thick' + | 'double' + | 'hair' + | 'mediumDashed' + | 'dashDot' + | 'mediumDashDot' + | 'dashDotDot' + | 'mediumDashDotDot' + | 'slantDashDot'; + +export interface CT_BorderPr { + color?: CT_Color; + style?: ST_BorderStyle; +} + +export const CT_BorderPr_Attributes: Attributes = { + color: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + style: { + type: 'string', + defaultValue: 'none' + } +}; + +export interface CT_Border { + start?: CT_BorderPr; + end?: CT_BorderPr; + left?: CT_BorderPr; + right?: CT_BorderPr; + top?: CT_BorderPr; + bottom?: CT_BorderPr; + diagonal?: CT_BorderPr; + vertical?: CT_BorderPr; + horizontal?: CT_BorderPr; + diagonalUp?: boolean; + diagonalDown?: boolean; + outline?: boolean; +} + +export const CT_Border_Attributes: Attributes = { + start: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + end: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + left: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + right: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + top: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + bottom: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + diagonal: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + vertical: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + horizontal: { + type: 'child', + childAttributes: CT_BorderPr_Attributes + }, + diagonalUp: { + type: 'boolean' + }, + diagonalDown: { + type: 'boolean' + }, + outline: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_CellProtection { + locked?: boolean; + hidden?: boolean; +} + +export const CT_CellProtection_Attributes: Attributes = { + locked: { + type: 'boolean' + }, + hidden: { + type: 'boolean' + } +}; + +export interface CT_Dxf { + font?: CT_Font; + numFmt?: CT_NumFmt; + fill?: CT_Fill; + alignment?: CT_CellAlignment; + border?: CT_Border; + protection?: CT_CellProtection; + extLst?: CT_ExtensionList; +} + +export const CT_Dxf_Attributes: Attributes = { + font: { + type: 'child', + childAttributes: CT_Font_Attributes + }, + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes + }, + fill: { + type: 'child', + childAttributes: CT_Fill_Attributes + }, + alignment: { + type: 'child', + childAttributes: CT_CellAlignment_Attributes + }, + border: { + type: 'child', + childAttributes: CT_Border_Attributes + }, + protection: { + type: 'child', + childAttributes: CT_CellProtection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_RevisionCellChange { + oc?: CT_Cell; + nc?: CT_Cell; + odxf?: boolean; + ndxf?: CT_Dxf; + extLst?: CT_ExtensionList[]; + sId?: number; + xfDxf?: boolean; + s?: boolean; + dxf?: boolean; + numFmtId?: number; + quotePrefix?: boolean; + oldQuotePrefix?: boolean; + ph?: boolean; + oldPh?: boolean; + endOfListFormulaUpdate?: boolean; +} + +export const CT_RevisionCellChange_Attributes: Attributes = { + oc: { + type: 'child', + childAttributes: CT_Cell_Attributes + }, + nc: { + type: 'child', + childAttributes: CT_Cell_Attributes + }, + odxf: { + type: 'boolean', + defaultValue: 'false' + }, + ndxf: { + type: 'child', + childAttributes: CT_Dxf_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + sId: { + type: 'int' + }, + xfDxf: { + type: 'boolean', + defaultValue: 'false' + }, + s: { + type: 'boolean', + defaultValue: 'false' + }, + dxf: { + type: 'boolean', + defaultValue: 'false' + }, + numFmtId: { + type: 'int' + }, + quotePrefix: { + type: 'boolean', + defaultValue: 'false' + }, + oldQuotePrefix: { + type: 'boolean', + defaultValue: 'false' + }, + ph: { + type: 'boolean', + defaultValue: 'false' + }, + oldPh: { + type: 'boolean', + defaultValue: 'false' + }, + endOfListFormulaUpdate: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_RevisionFormatting { + dxf?: CT_Dxf; + extLst?: CT_ExtensionList[]; + sheetId?: number; + xfDxf?: boolean; + s?: boolean; + sqref?: string; + start?: number; + length?: number; +} + +export const CT_RevisionFormatting_Attributes: Attributes = { + dxf: { + type: 'child', + childAttributes: CT_Dxf_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + sheetId: { + type: 'int' + }, + xfDxf: { + type: 'boolean', + defaultValue: 'false' + }, + s: { + type: 'boolean', + defaultValue: 'false' + }, + sqref: { + type: 'string' + }, + start: { + type: 'int' + }, + length: { + type: 'int' + } +}; + +export type ST_rwColActionType = + | 'insertRow' + | 'deleteRow' + | 'insertCol' + | 'deleteCol'; + +export interface CT_RevisionRowColumn { + undo?: CT_UndoInfo[]; + rcc?: CT_RevisionCellChange[]; + rfmt?: CT_RevisionFormatting[]; + sId?: number; + eol?: boolean; + ref?: string; + action?: ST_rwColActionType; + edge?: boolean; +} + +export const CT_RevisionRowColumn_Attributes: Attributes = { + undo: { + type: 'child', + childAttributes: CT_UndoInfo_Attributes, + childIsArray: true + }, + rcc: { + type: 'child', + childAttributes: CT_RevisionCellChange_Attributes, + childIsArray: true + }, + rfmt: { + type: 'child', + childAttributes: CT_RevisionFormatting_Attributes, + childIsArray: true + }, + sId: { + type: 'int' + }, + eol: { + type: 'boolean', + defaultValue: 'false' + }, + ref: { + type: 'string' + }, + action: { + type: 'string' + }, + edge: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_RevisionMove { + undo?: CT_UndoInfo[]; + rcc?: CT_RevisionCellChange[]; + rfmt?: CT_RevisionFormatting[]; + sheetId?: number; + source?: string; + destination?: string; + sourceSheetId?: number; +} + +export const CT_RevisionMove_Attributes: Attributes = { + undo: { + type: 'child', + childAttributes: CT_UndoInfo_Attributes, + childIsArray: true + }, + rcc: { + type: 'child', + childAttributes: CT_RevisionCellChange_Attributes, + childIsArray: true + }, + rfmt: { + type: 'child', + childAttributes: CT_RevisionFormatting_Attributes, + childIsArray: true + }, + sheetId: { + type: 'int' + }, + source: { + type: 'string' + }, + destination: { + type: 'string' + }, + sourceSheetId: { + type: 'int', + defaultValue: '0' + } +}; + +export type ST_RevisionAction = 'add' | 'delete'; + +export interface CT_RevisionCustomView { + guid?: string; + action?: ST_RevisionAction; +} + +export const CT_RevisionCustomView_Attributes: Attributes = { + guid: { + type: 'string' + }, + action: { + type: 'string' + } +}; + +export interface CT_RevisionSheetRename { + extLst?: CT_ExtensionList[]; + sheetId?: number; + oldName?: string; + newName?: string; +} + +export const CT_RevisionSheetRename_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + sheetId: { + type: 'int' + }, + oldName: { + type: 'string' + }, + newName: { + type: 'string' + } +}; + +export interface CT_RevisionInsertSheet { + sheetId?: number; + name?: string; + sheetPosition?: number; +} + +export const CT_RevisionInsertSheet_Attributes: Attributes = { + sheetId: { + type: 'int' + }, + name: { + type: 'string' + }, + sheetPosition: { + type: 'int' + } +}; + +export interface CT_RevisionAutoFormatting { + sheetId?: number; + ref?: string; +} + +export const CT_RevisionAutoFormatting_Attributes: Attributes = { + sheetId: { + type: 'int' + }, + ref: { + type: 'string' + } +}; + +export interface CT_RevisionDefinedName { + formula?: string; + oldFormula?: string; + extLst?: CT_ExtensionList[]; + localSheetId?: number; + customView?: boolean; + name?: string; + function?: boolean; + oldFunction?: boolean; + functionGroupId?: number; + oldFunctionGroupId?: number; + shortcutKey?: number; + oldShortcutKey?: number; + hidden?: boolean; + oldHidden?: boolean; + customMenu?: string; + oldCustomMenu?: string; + description?: string; + oldDescription?: string; + help?: string; + oldHelp?: string; + statusBar?: string; + oldStatusBar?: string; + comment?: string; + oldComment?: string; +} + +export const CT_RevisionDefinedName_Attributes: Attributes = { + formula: { + type: 'child-string' + }, + oldFormula: { + type: 'child-string' + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + localSheetId: { + type: 'int' + }, + customView: { + type: 'boolean', + defaultValue: 'false' + }, + name: { + type: 'string' + }, + function: { + type: 'boolean', + defaultValue: 'false' + }, + oldFunction: { + type: 'boolean', + defaultValue: 'false' + }, + functionGroupId: { + type: 'int' + }, + oldFunctionGroupId: { + type: 'int' + }, + shortcutKey: { + type: 'int' + }, + oldShortcutKey: { + type: 'int' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + }, + oldHidden: { + type: 'boolean', + defaultValue: 'false' + }, + customMenu: { + type: 'string' + }, + oldCustomMenu: { + type: 'string' + }, + description: { + type: 'string' + }, + oldDescription: { + type: 'string' + }, + help: { + type: 'string' + }, + oldHelp: { + type: 'string' + }, + statusBar: { + type: 'string' + }, + oldStatusBar: { + type: 'string' + }, + comment: { + type: 'string' + }, + oldComment: { + type: 'string' + } +}; + +export interface CT_RevisionComment { + sheetId?: number; + cell?: string; + guid?: string; + action?: ST_RevisionAction; + alwaysShow?: boolean; + old?: boolean; + hiddenRow?: boolean; + hiddenColumn?: boolean; + author?: string; + oldLength?: number; + newLength?: number; +} + +export const CT_RevisionComment_Attributes: Attributes = { + sheetId: { + type: 'int' + }, + cell: { + type: 'string' + }, + guid: { + type: 'string' + }, + action: { + type: 'string', + defaultValue: 'add' + }, + alwaysShow: { + type: 'boolean', + defaultValue: 'false' + }, + old: { + type: 'boolean', + defaultValue: 'false' + }, + hiddenRow: { + type: 'boolean', + defaultValue: 'false' + }, + hiddenColumn: { + type: 'boolean', + defaultValue: 'false' + }, + author: { + type: 'string' + }, + oldLength: { + type: 'int', + defaultValue: '0' + }, + newLength: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_RevisionQueryTableField { + sheetId?: number; + ref?: string; + fieldId?: number; +} + +export const CT_RevisionQueryTableField_Attributes: Attributes = { + sheetId: { + type: 'int' + }, + ref: { + type: 'string' + }, + fieldId: { + type: 'int' + } +}; + +export interface CT_RevisionConflict { + sheetId?: number; +} + +export const CT_RevisionConflict_Attributes: Attributes = { + sheetId: { + type: 'int' + } +}; + +export interface CT_Revisions { + rrc?: CT_RevisionRowColumn[]; + rm?: CT_RevisionMove[]; + rcv?: CT_RevisionCustomView[]; + rsnm?: CT_RevisionSheetRename[]; + ris?: CT_RevisionInsertSheet[]; + rcc?: CT_RevisionCellChange[]; + rfmt?: CT_RevisionFormatting[]; + raf?: CT_RevisionAutoFormatting[]; + rdn?: CT_RevisionDefinedName[]; + rcmt?: CT_RevisionComment[]; + rqt?: CT_RevisionQueryTableField[]; + rcft?: CT_RevisionConflict[]; +} + +export const CT_Revisions_Attributes: Attributes = { + rrc: { + type: 'child', + childAttributes: CT_RevisionRowColumn_Attributes, + childIsArray: true + }, + rm: { + type: 'child', + childAttributes: CT_RevisionMove_Attributes, + childIsArray: true + }, + rcv: { + type: 'child', + childAttributes: CT_RevisionCustomView_Attributes, + childIsArray: true + }, + rsnm: { + type: 'child', + childAttributes: CT_RevisionSheetRename_Attributes, + childIsArray: true + }, + ris: { + type: 'child', + childAttributes: CT_RevisionInsertSheet_Attributes, + childIsArray: true + }, + rcc: { + type: 'child', + childAttributes: CT_RevisionCellChange_Attributes, + childIsArray: true + }, + rfmt: { + type: 'child', + childAttributes: CT_RevisionFormatting_Attributes, + childIsArray: true + }, + raf: { + type: 'child', + childAttributes: CT_RevisionAutoFormatting_Attributes, + childIsArray: true + }, + rdn: { + type: 'child', + childAttributes: CT_RevisionDefinedName_Attributes, + childIsArray: true + }, + rcmt: { + type: 'child', + childAttributes: CT_RevisionComment_Attributes, + childIsArray: true + }, + rqt: { + type: 'child', + childAttributes: CT_RevisionQueryTableField_Attributes, + childIsArray: true + }, + rcft: { + type: 'child', + childAttributes: CT_RevisionConflict_Attributes, + childIsArray: true + } +}; + +export interface CT_SharedUser { + extLst?: CT_ExtensionList[]; + guid?: string; + name?: string; + id?: number; + dateTime?: string; +} + +export const CT_SharedUser_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + guid: { + type: 'string' + }, + name: { + type: 'string' + }, + id: { + type: 'int' + }, + dateTime: { + type: 'string' + } +}; + +export interface CT_Users { + userInfo?: CT_SharedUser[]; + count?: number; +} + +export const CT_Users_Attributes: Attributes = { + userInfo: { + type: 'child', + childAttributes: CT_SharedUser_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_OutlinePr { + applyStyles?: boolean; + summaryBelow?: boolean; + summaryRight?: boolean; + showOutlineSymbols?: boolean; +} + +export const CT_OutlinePr_Attributes: Attributes = { + applyStyles: { + type: 'boolean', + defaultValue: 'false' + }, + summaryBelow: { + type: 'boolean', + defaultValue: 'true' + }, + summaryRight: { + type: 'boolean', + defaultValue: 'true' + }, + showOutlineSymbols: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_PageSetUpPr { + autoPageBreaks?: boolean; + fitToPage?: boolean; +} + +export const CT_PageSetUpPr_Attributes: Attributes = { + autoPageBreaks: { + type: 'boolean', + defaultValue: 'true' + }, + fitToPage: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_SheetPr { + tabColor?: CT_Color; + outlinePr?: CT_OutlinePr; + pageSetUpPr?: CT_PageSetUpPr; + syncHorizontal?: boolean; + syncVertical?: boolean; + syncRef?: string; + transitionEvaluation?: boolean; + transitionEntry?: boolean; + published?: boolean; + codeName?: string; + filterMode?: boolean; + enableFormatConditionsCalculation?: boolean; +} + +export const CT_SheetPr_Attributes: Attributes = { + tabColor: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + outlinePr: { + type: 'child', + childAttributes: CT_OutlinePr_Attributes + }, + pageSetUpPr: { + type: 'child', + childAttributes: CT_PageSetUpPr_Attributes + }, + syncHorizontal: { + type: 'boolean', + defaultValue: 'false' + }, + syncVertical: { + type: 'boolean', + defaultValue: 'false' + }, + syncRef: { + type: 'string' + }, + transitionEvaluation: { + type: 'boolean', + defaultValue: 'false' + }, + transitionEntry: { + type: 'boolean', + defaultValue: 'false' + }, + published: { + type: 'boolean', + defaultValue: 'true' + }, + codeName: { + type: 'string' + }, + filterMode: { + type: 'boolean', + defaultValue: 'false' + }, + enableFormatConditionsCalculation: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_SheetDimension { + ref?: string; +} + +export const CT_SheetDimension_Attributes: Attributes = { + ref: { + type: 'string' + } +}; + +export type ST_Pane = 'bottomRight' | 'topRight' | 'bottomLeft' | 'topLeft'; + +export type ST_PaneState = 'split' | 'frozen' | 'frozenSplit'; + +export interface CT_Pane { + xSplit?: number; + ySplit?: number; + topLeftCell?: string; + activePane?: ST_Pane; + state?: ST_PaneState; +} + +export const CT_Pane_Attributes: Attributes = { + xSplit: { + type: 'double', + defaultValue: '0' + }, + ySplit: { + type: 'double', + defaultValue: '0' + }, + topLeftCell: { + type: 'string' + }, + activePane: { + type: 'string', + defaultValue: 'topLeft' + }, + state: { + type: 'string', + defaultValue: 'split' + } +}; + +export interface CT_Selection { + pane?: ST_Pane; + activeCell?: string; + activeCellId?: number; + sqref?: string; +} + +export const CT_Selection_Attributes: Attributes = { + pane: { + type: 'string', + defaultValue: 'topLeft' + }, + activeCell: { + type: 'string' + }, + activeCellId: { + type: 'int', + defaultValue: '0' + }, + sqref: { + type: 'string', + defaultValue: 'A1' + } +}; + +export interface CT_PivotSelection { + 'pivotArea'?: CT_PivotArea[]; + 'pane'?: ST_Pane; + 'showHeader'?: boolean; + 'label'?: boolean; + 'data'?: boolean; + 'extendable'?: boolean; + 'count'?: number; + 'axis'?: ST_Axis; + 'dimension'?: number; + 'start'?: number; + 'min'?: number; + 'max'?: number; + 'activeRow'?: number; + 'activeCol'?: number; + 'previousRow'?: number; + 'previousCol'?: number; + 'click'?: number; + 'r:id'?: string; +} + +export const CT_PivotSelection_Attributes: Attributes = { + 'pivotArea': { + type: 'child', + childAttributes: CT_PivotArea_Attributes, + childIsArray: true + }, + 'pane': { + type: 'string', + defaultValue: 'topLeft' + }, + 'showHeader': { + type: 'boolean', + defaultValue: 'false' + }, + 'label': { + type: 'boolean', + defaultValue: 'false' + }, + 'data': { + type: 'boolean', + defaultValue: 'false' + }, + 'extendable': { + type: 'boolean', + defaultValue: 'false' + }, + 'count': { + type: 'int', + defaultValue: '0' + }, + 'axis': { + type: 'string' + }, + 'dimension': { + type: 'int', + defaultValue: '0' + }, + 'start': { + type: 'int', + defaultValue: '0' + }, + 'min': { + type: 'int', + defaultValue: '0' + }, + 'max': { + type: 'int', + defaultValue: '0' + }, + 'activeRow': { + type: 'int', + defaultValue: '0' + }, + 'activeCol': { + type: 'int', + defaultValue: '0' + }, + 'previousRow': { + type: 'int', + defaultValue: '0' + }, + 'previousCol': { + type: 'int', + defaultValue: '0' + }, + 'click': { + type: 'int', + defaultValue: '0' + }, + 'r:id': { + type: 'string' + } +}; + +export type ST_SheetViewType = 'normal' | 'pageBreakPreview' | 'pageLayout'; + +export interface CT_SheetView { + pane?: CT_Pane; + selection?: CT_Selection[]; + pivotSelection?: CT_PivotSelection[]; + extLst?: CT_ExtensionList; + windowProtection?: boolean; + showFormulas?: boolean; + showGridLines?: boolean; + showRowColHeaders?: boolean; + showZeros?: boolean; + rightToLeft?: boolean; + tabSelected?: boolean; + showRuler?: boolean; + showOutlineSymbols?: boolean; + defaultGridColor?: boolean; + showWhiteSpace?: boolean; + view?: ST_SheetViewType; + topLeftCell?: string; + colorId?: number; + zoomScale?: number; + zoomScaleNormal?: number; + zoomScaleSheetLayoutView?: number; + zoomScalePageLayoutView?: number; + workbookViewId?: number; +} + +export const CT_SheetView_Attributes: Attributes = { + pane: { + type: 'child', + childAttributes: CT_Pane_Attributes + }, + selection: { + type: 'child', + childAttributes: CT_Selection_Attributes, + childIsArray: true + }, + pivotSelection: { + type: 'child', + childAttributes: CT_PivotSelection_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + windowProtection: { + type: 'boolean', + defaultValue: 'false' + }, + showFormulas: { + type: 'boolean', + defaultValue: 'false' + }, + showGridLines: { + type: 'boolean', + defaultValue: 'true' + }, + showRowColHeaders: { + type: 'boolean', + defaultValue: 'true' + }, + showZeros: { + type: 'boolean', + defaultValue: 'true' + }, + rightToLeft: { + type: 'boolean', + defaultValue: 'false' + }, + tabSelected: { + type: 'boolean', + defaultValue: 'false' + }, + showRuler: { + type: 'boolean', + defaultValue: 'true' + }, + showOutlineSymbols: { + type: 'boolean', + defaultValue: 'true' + }, + defaultGridColor: { + type: 'boolean', + defaultValue: 'true' + }, + showWhiteSpace: { + type: 'boolean', + defaultValue: 'true' + }, + view: { + type: 'string', + defaultValue: 'normal' + }, + topLeftCell: { + type: 'string' + }, + colorId: { + type: 'int', + defaultValue: '64' + }, + zoomScale: { + type: 'int', + defaultValue: '100' + }, + zoomScaleNormal: { + type: 'int', + defaultValue: '0' + }, + zoomScaleSheetLayoutView: { + type: 'int', + defaultValue: '0' + }, + zoomScalePageLayoutView: { + type: 'int', + defaultValue: '0' + }, + workbookViewId: { + type: 'int' + } +}; + +export interface CT_SheetViews { + sheetView?: CT_SheetView[]; + extLst?: CT_ExtensionList; +} + +export const CT_SheetViews_Attributes: Attributes = { + sheetView: { + type: 'child', + childAttributes: CT_SheetView_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_SheetFormatPr { + baseColWidth?: number; + defaultColWidth?: number; + defaultRowHeight?: number; + customHeight?: boolean; + zeroHeight?: boolean; + thickTop?: boolean; + thickBottom?: boolean; + outlineLevelRow?: number; + outlineLevelCol?: number; +} + +export const CT_SheetFormatPr_Attributes: Attributes = { + baseColWidth: { + type: 'int', + defaultValue: '8' + }, + defaultColWidth: { + type: 'double' + }, + defaultRowHeight: { + type: 'double' + }, + customHeight: { + type: 'boolean', + defaultValue: 'false' + }, + zeroHeight: { + type: 'boolean', + defaultValue: 'false' + }, + thickTop: { + type: 'boolean', + defaultValue: 'false' + }, + thickBottom: { + type: 'boolean', + defaultValue: 'false' + }, + outlineLevelRow: { + type: 'int', + defaultValue: '0' + }, + outlineLevelCol: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_Col { + min?: number; + max?: number; + width?: number; + style?: number; + hidden?: boolean; + bestFit?: boolean; + customWidth?: boolean; + phonetic?: boolean; + outlineLevel?: number; + collapsed?: boolean; +} + +export const CT_Col_Attributes: Attributes = { + min: { + type: 'int' + }, + max: { + type: 'int' + }, + width: { + type: 'double' + }, + style: { + type: 'int', + defaultValue: '0' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + }, + bestFit: { + type: 'boolean', + defaultValue: 'false' + }, + customWidth: { + type: 'boolean', + defaultValue: 'false' + }, + phonetic: { + type: 'boolean', + defaultValue: 'false' + }, + outlineLevel: { + type: 'int', + defaultValue: '0' + }, + collapsed: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Cols { + col?: CT_Col[]; +} + +export const CT_Cols_Attributes: Attributes = { + col: { + type: 'child', + childAttributes: CT_Col_Attributes, + childIsArray: true + } +}; + +export type ST_CellSpans = ST_CellSpan[]; + +export interface CT_Row { + c?: CT_Cell[]; + extLst?: CT_ExtensionList[]; + r?: number; + spans?: string[]; + s?: number; + customFormat?: boolean; + ht?: number; + hidden?: boolean; + customHeight?: boolean; + outlineLevel?: number; + collapsed?: boolean; + thickTop?: boolean; + thickBot?: boolean; + ph?: boolean; +} + +export const CT_Row_Attributes: Attributes = { + c: { + type: 'child', + childAttributes: CT_Cell_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + r: { + type: 'int' + }, + spans: { + type: 'string', + childIsArray: true + }, + s: { + type: 'int', + defaultValue: '0' + }, + customFormat: { + type: 'boolean', + defaultValue: 'false' + }, + ht: { + type: 'double' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + }, + customHeight: { + type: 'boolean', + defaultValue: 'false' + }, + outlineLevel: { + type: 'int', + defaultValue: '0' + }, + collapsed: { + type: 'boolean', + defaultValue: 'false' + }, + thickTop: { + type: 'boolean', + defaultValue: 'false' + }, + thickBot: { + type: 'boolean', + defaultValue: 'false' + }, + ph: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_SheetData { + row?: CT_Row[]; +} + +export const CT_SheetData_Attributes: Attributes = { + row: { + type: 'child', + childAttributes: CT_Row_Attributes, + childIsArray: true + } +}; + +export interface CT_SheetProtection { + algorithmName?: string; + hashValue?: string; + saltValue?: string; + spinCount?: number; + sheet?: boolean; + objects?: boolean; + scenarios?: boolean; + formatCells?: boolean; + formatColumns?: boolean; + formatRows?: boolean; + insertColumns?: boolean; + insertRows?: boolean; + insertHyperlinks?: boolean; + deleteColumns?: boolean; + deleteRows?: boolean; + selectLockedCells?: boolean; + sort?: boolean; + autoFilter?: boolean; + pivotTables?: boolean; + selectUnlockedCells?: boolean; +} + +export const CT_SheetProtection_Attributes: Attributes = { + algorithmName: { + type: 'string' + }, + hashValue: { + type: 'string' + }, + saltValue: { + type: 'string' + }, + spinCount: { + type: 'int' + }, + sheet: { + type: 'boolean', + defaultValue: 'false' + }, + objects: { + type: 'boolean', + defaultValue: 'false' + }, + scenarios: { + type: 'boolean', + defaultValue: 'false' + }, + formatCells: { + type: 'boolean', + defaultValue: 'true' + }, + formatColumns: { + type: 'boolean', + defaultValue: 'true' + }, + formatRows: { + type: 'boolean', + defaultValue: 'true' + }, + insertColumns: { + type: 'boolean', + defaultValue: 'true' + }, + insertRows: { + type: 'boolean', + defaultValue: 'true' + }, + insertHyperlinks: { + type: 'boolean', + defaultValue: 'true' + }, + deleteColumns: { + type: 'boolean', + defaultValue: 'true' + }, + deleteRows: { + type: 'boolean', + defaultValue: 'true' + }, + selectLockedCells: { + type: 'boolean', + defaultValue: 'false' + }, + sort: { + type: 'boolean', + defaultValue: 'true' + }, + autoFilter: { + type: 'boolean', + defaultValue: 'true' + }, + pivotTables: { + type: 'boolean', + defaultValue: 'true' + }, + selectUnlockedCells: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_DataRef { + 'ref'?: string; + 'name'?: string; + 'sheet'?: string; + 'r:id'?: string; +} + +export const CT_DataRef_Attributes: Attributes = { + 'ref': { + type: 'string' + }, + 'name': { + type: 'string' + }, + 'sheet': { + type: 'string' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_DataRefs { + dataRef?: CT_DataRef[]; + count?: number; +} + +export const CT_DataRefs_Attributes: Attributes = { + dataRef: { + type: 'child', + childAttributes: CT_DataRef_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_DataConsolidate { + dataRefs?: CT_DataRefs; + function?: ST_DataConsolidateFunction; + startLabels?: boolean; + topLabels?: boolean; + link?: boolean; +} + +export const CT_DataConsolidate_Attributes: Attributes = { + dataRefs: { + type: 'child', + childAttributes: CT_DataRefs_Attributes + }, + function: { + type: 'string', + defaultValue: 'sum' + }, + startLabels: { + type: 'boolean', + defaultValue: 'false' + }, + topLabels: { + type: 'boolean', + defaultValue: 'false' + }, + link: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_Break { + id?: number; + min?: number; + max?: number; + man?: boolean; + pt?: boolean; +} + +export const CT_Break_Attributes: Attributes = { + id: { + type: 'int', + defaultValue: '0' + }, + min: { + type: 'int', + defaultValue: '0' + }, + max: { + type: 'int', + defaultValue: '0' + }, + man: { + type: 'boolean', + defaultValue: 'false' + }, + pt: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_PageBreak { + brk?: CT_Break[]; + count?: number; + manualBreakCount?: number; +} + +export const CT_PageBreak_Attributes: Attributes = { + brk: { + type: 'child', + childAttributes: CT_Break_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + }, + manualBreakCount: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_PageMargins { + left?: number; + right?: number; + top?: number; + bottom?: number; + header?: number; + footer?: number; +} + +export const CT_PageMargins_Attributes: Attributes = { + left: { + type: 'double' + }, + right: { + type: 'double' + }, + top: { + type: 'double' + }, + bottom: { + type: 'double' + }, + header: { + type: 'double' + }, + footer: { + type: 'double' + } +}; + +export interface CT_PrintOptions { + horizontalCentered?: boolean; + verticalCentered?: boolean; + headings?: boolean; + gridLines?: boolean; + gridLinesSet?: boolean; +} + +export const CT_PrintOptions_Attributes: Attributes = { + horizontalCentered: { + type: 'boolean', + defaultValue: 'false' + }, + verticalCentered: { + type: 'boolean', + defaultValue: 'false' + }, + headings: { + type: 'boolean', + defaultValue: 'false' + }, + gridLines: { + type: 'boolean', + defaultValue: 'false' + }, + gridLinesSet: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_PageOrder = 'downThenOver' | 'overThenDown'; + +export type ST_Orientation = 'default' | 'portrait' | 'landscape'; + +export type ST_CellComments = 'none' | 'asDisplayed' | 'atEnd'; + +export type ST_PrintError = 'displayed' | 'blank' | 'dash' | 'NA'; + +export interface CT_PageSetup { + 'paperSize'?: number; + 'paperHeight'?: string; + 'paperWidth'?: string; + 'scale'?: number; + 'firstPageNumber'?: number; + 'fitToWidth'?: number; + 'fitToHeight'?: number; + 'pageOrder'?: ST_PageOrder; + 'orientation'?: ST_Orientation; + 'usePrinterDefaults'?: boolean; + 'blackAndWhite'?: boolean; + 'draft'?: boolean; + 'cellComments'?: ST_CellComments; + 'useFirstPageNumber'?: boolean; + 'errors'?: ST_PrintError; + 'horizontalDpi'?: number; + 'verticalDpi'?: number; + 'copies'?: number; + 'r:id'?: string; +} + +export const CT_PageSetup_Attributes: Attributes = { + 'paperSize': { + type: 'int', + defaultValue: '1' + }, + 'paperHeight': { + type: 'string' + }, + 'paperWidth': { + type: 'string' + }, + 'scale': { + type: 'int', + defaultValue: '100' + }, + 'firstPageNumber': { + type: 'int', + defaultValue: '1' + }, + 'fitToWidth': { + type: 'int', + defaultValue: '1' + }, + 'fitToHeight': { + type: 'int', + defaultValue: '1' + }, + 'pageOrder': { + type: 'string', + defaultValue: 'downThenOver' + }, + 'orientation': { + type: 'string', + defaultValue: 'default' + }, + 'usePrinterDefaults': { + type: 'boolean', + defaultValue: 'true' + }, + 'blackAndWhite': { + type: 'boolean', + defaultValue: 'false' + }, + 'draft': { + type: 'boolean', + defaultValue: 'false' + }, + 'cellComments': { + type: 'string', + defaultValue: 'none' + }, + 'useFirstPageNumber': { + type: 'boolean', + defaultValue: 'false' + }, + 'errors': { + type: 'string', + defaultValue: 'displayed' + }, + 'horizontalDpi': { + type: 'int', + defaultValue: '600' + }, + 'verticalDpi': { + type: 'int', + defaultValue: '600' + }, + 'copies': { + type: 'int', + defaultValue: '1' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_HeaderFooter { + oddHeader?: string; + oddFooter?: string; + evenHeader?: string; + evenFooter?: string; + firstHeader?: string; + firstFooter?: string; + differentOddEven?: boolean; + differentFirst?: boolean; + scaleWithDoc?: boolean; + alignWithMargins?: boolean; +} + +export const CT_HeaderFooter_Attributes: Attributes = { + oddHeader: { + type: 'child-string' + }, + oddFooter: { + type: 'child-string' + }, + evenHeader: { + type: 'child-string' + }, + evenFooter: { + type: 'child-string' + }, + firstHeader: { + type: 'child-string' + }, + firstFooter: { + type: 'child-string' + }, + differentOddEven: { + type: 'boolean', + defaultValue: 'false' + }, + differentFirst: { + type: 'boolean', + defaultValue: 'false' + }, + scaleWithDoc: { + type: 'boolean', + defaultValue: 'true' + }, + alignWithMargins: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export type ST_SheetState = 'visible' | 'hidden' | 'veryHidden'; + +export interface CT_CustomSheetView { + pane?: CT_Pane; + selection?: CT_Selection; + rowBreaks?: CT_PageBreak; + colBreaks?: CT_PageBreak; + pageMargins?: CT_PageMargins; + printOptions?: CT_PrintOptions; + pageSetup?: CT_PageSetup; + headerFooter?: CT_HeaderFooter; + autoFilter?: CT_AutoFilter; + extLst?: CT_ExtensionList[]; + guid?: string; + scale?: number; + colorId?: number; + showPageBreaks?: boolean; + showFormulas?: boolean; + showGridLines?: boolean; + showRowCol?: boolean; + outlineSymbols?: boolean; + zeroValues?: boolean; + fitToPage?: boolean; + printArea?: boolean; + filter?: boolean; + showAutoFilter?: boolean; + hiddenRows?: boolean; + hiddenColumns?: boolean; + state?: ST_SheetState; + filterUnique?: boolean; + view?: ST_SheetViewType; + showRuler?: boolean; + topLeftCell?: string; +} + +export const CT_CustomSheetView_Attributes: Attributes = { + pane: { + type: 'child', + childAttributes: CT_Pane_Attributes + }, + selection: { + type: 'child', + childAttributes: CT_Selection_Attributes + }, + rowBreaks: { + type: 'child', + childAttributes: CT_PageBreak_Attributes + }, + colBreaks: { + type: 'child', + childAttributes: CT_PageBreak_Attributes + }, + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes + }, + printOptions: { + type: 'child', + childAttributes: CT_PrintOptions_Attributes + }, + pageSetup: { + type: 'child', + childAttributes: CT_PageSetup_Attributes + }, + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes + }, + autoFilter: { + type: 'child', + childAttributes: CT_AutoFilter_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + guid: { + type: 'string' + }, + scale: { + type: 'int', + defaultValue: '100' + }, + colorId: { + type: 'int', + defaultValue: '64' + }, + showPageBreaks: { + type: 'boolean', + defaultValue: 'false' + }, + showFormulas: { + type: 'boolean', + defaultValue: 'false' + }, + showGridLines: { + type: 'boolean', + defaultValue: 'true' + }, + showRowCol: { + type: 'boolean', + defaultValue: 'true' + }, + outlineSymbols: { + type: 'boolean', + defaultValue: 'true' + }, + zeroValues: { + type: 'boolean', + defaultValue: 'true' + }, + fitToPage: { + type: 'boolean', + defaultValue: 'false' + }, + printArea: { + type: 'boolean', + defaultValue: 'false' + }, + filter: { + type: 'boolean', + defaultValue: 'false' + }, + showAutoFilter: { + type: 'boolean', + defaultValue: 'false' + }, + hiddenRows: { + type: 'boolean', + defaultValue: 'false' + }, + hiddenColumns: { + type: 'boolean', + defaultValue: 'false' + }, + state: { + type: 'string', + defaultValue: 'visible' + }, + filterUnique: { + type: 'boolean', + defaultValue: 'false' + }, + view: { + type: 'string', + defaultValue: 'normal' + }, + showRuler: { + type: 'boolean', + defaultValue: 'true' + }, + topLeftCell: { + type: 'string' + } +}; + +export interface CT_CustomSheetViews { + customSheetView?: CT_CustomSheetView[]; +} + +export const CT_CustomSheetViews_Attributes: Attributes = { + customSheetView: { + type: 'child', + childAttributes: CT_CustomSheetView_Attributes, + childIsArray: true + } +}; + +export type ST_CfvoType = + | 'num' + | 'percent' + | 'max' + | 'min' + | 'formula' + | 'percentile'; + +export interface CT_Cfvo { + extLst?: CT_ExtensionList; + type?: ST_CfvoType; + val?: string; + gte?: boolean; +} + +export const CT_Cfvo_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + type: { + type: 'string' + }, + val: { + type: 'string' + }, + gte: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_ColorScale { + cfvo?: CT_Cfvo[]; + color?: CT_Color[]; +} + +export const CT_ColorScale_Attributes: Attributes = { + cfvo: { + type: 'child', + childAttributes: CT_Cfvo_Attributes, + childIsArray: true + }, + color: { + type: 'child', + childAttributes: CT_Color_Attributes, + childIsArray: true + } +}; + +export interface CT_DataBar { + cfvo?: CT_Cfvo[]; + color?: CT_Color; + minLength?: number; + maxLength?: number; + showValue?: boolean; +} + +export const CT_DataBar_Attributes: Attributes = { + cfvo: { + type: 'child', + childAttributes: CT_Cfvo_Attributes, + childIsArray: true + }, + color: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + minLength: { + type: 'int', + defaultValue: '10' + }, + maxLength: { + type: 'int', + defaultValue: '90' + }, + showValue: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_IconSet { + cfvo?: CT_Cfvo[]; + iconSet?: ST_IconSetType; + showValue?: boolean; + percent?: boolean; + reverse?: boolean; +} + +export const CT_IconSet_Attributes: Attributes = { + cfvo: { + type: 'child', + childAttributes: CT_Cfvo_Attributes, + childIsArray: true + }, + iconSet: { + type: 'string', + defaultValue: '3TrafficLights1' + }, + showValue: { + type: 'boolean', + defaultValue: 'true' + }, + percent: { + type: 'boolean', + defaultValue: 'true' + }, + reverse: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_CfType = + | 'expression' + | 'cellIs' + | 'colorScale' + | 'dataBar' + | 'iconSet' + | 'top10' + | 'uniqueValues' + | 'duplicateValues' + | 'containsText' + | 'notContainsText' + | 'beginsWith' + | 'endsWith' + | 'containsBlanks' + | 'notContainsBlanks' + | 'containsErrors' + | 'notContainsErrors' + | 'timePeriod' + | 'aboveAverage'; + +export type ST_ConditionalFormattingOperator = + | 'lessThan' + | 'lessThanOrEqual' + | 'equal' + | 'notEqual' + | 'greaterThanOrEqual' + | 'greaterThan' + | 'between' + | 'notBetween' + | 'containsText' + | 'notContains' + | 'beginsWith' + | 'endsWith'; + +export type ST_TimePeriod = + | 'today' + | 'yesterday' + | 'tomorrow' + | 'last7Days' + | 'thisMonth' + | 'lastMonth' + | 'nextMonth' + | 'thisWeek' + | 'lastWeek' + | 'nextWeek'; + +export interface CT_CfRule { + formula?: string[]; + colorScale?: CT_ColorScale; + dataBar?: CT_DataBar; + iconSet?: CT_IconSet; + extLst?: CT_ExtensionList[]; + type?: ST_CfType; + dxfId?: number; + priority?: number; + stopIfTrue?: boolean; + aboveAverage?: boolean; + percent?: boolean; + bottom?: boolean; + operator?: ST_ConditionalFormattingOperator; + text?: string; + timePeriod?: ST_TimePeriod; + rank?: number; + stdDev?: number; + equalAverage?: boolean; +} + +export const CT_CfRule_Attributes: Attributes = { + formula: { + type: 'child-string', + childIsArray: true + }, + colorScale: { + type: 'child', + childAttributes: CT_ColorScale_Attributes + }, + dataBar: { + type: 'child', + childAttributes: CT_DataBar_Attributes + }, + iconSet: { + type: 'child', + childAttributes: CT_IconSet_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + type: { + type: 'string' + }, + dxfId: { + type: 'int' + }, + priority: { + type: 'int' + }, + stopIfTrue: { + type: 'boolean', + defaultValue: 'false' + }, + aboveAverage: { + type: 'boolean', + defaultValue: 'true' + }, + percent: { + type: 'boolean', + defaultValue: 'false' + }, + bottom: { + type: 'boolean', + defaultValue: 'false' + }, + operator: { + type: 'string' + }, + text: { + type: 'string' + }, + timePeriod: { + type: 'string' + }, + rank: { + type: 'int' + }, + stdDev: { + type: 'int' + }, + equalAverage: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ConditionalFormatting { + cfRule?: CT_CfRule[]; + extLst?: CT_ExtensionList[]; + pivot?: boolean; + sqref?: string; +} + +export const CT_ConditionalFormatting_Attributes: Attributes = { + cfRule: { + type: 'child', + childAttributes: CT_CfRule_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + pivot: { + type: 'boolean', + defaultValue: 'false' + }, + sqref: { + type: 'string' + } +}; + +export interface CT_CustomProperty { + 'name'?: string; + 'r:id'?: string; +} + +export const CT_CustomProperty_Attributes: Attributes = { + 'name': { + type: 'string' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_CustomProperties { + customPr?: CT_CustomProperty[]; +} + +export const CT_CustomProperties_Attributes: Attributes = { + customPr: { + type: 'child', + childAttributes: CT_CustomProperty_Attributes, + childIsArray: true + } +}; + +export interface CT_Drawing { + 'r:id'?: string; +} + +export const CT_Drawing_Attributes: Attributes = { + 'r:id': { + type: 'string' + } +}; + +export interface CT_DrawingHF { + 'r:id'?: string; + 'lho'?: number; + 'lhe'?: number; + 'lhf'?: number; + 'cho'?: number; + 'che'?: number; + 'chf'?: number; + 'rho'?: number; + 'rhe'?: number; + 'rhf'?: number; + 'lfo'?: number; + 'lfe'?: number; + 'lff'?: number; + 'cfo'?: number; + 'cfe'?: number; + 'cff'?: number; + 'rfo'?: number; + 'rfe'?: number; + 'rff'?: number; +} + +export const CT_DrawingHF_Attributes: Attributes = { + 'r:id': { + type: 'string' + }, + 'lho': { + type: 'int' + }, + 'lhe': { + type: 'int' + }, + 'lhf': { + type: 'int' + }, + 'cho': { + type: 'int' + }, + 'che': { + type: 'int' + }, + 'chf': { + type: 'int' + }, + 'rho': { + type: 'int' + }, + 'rhe': { + type: 'int' + }, + 'rhf': { + type: 'int' + }, + 'lfo': { + type: 'int' + }, + 'lfe': { + type: 'int' + }, + 'lff': { + type: 'int' + }, + 'cfo': { + type: 'int' + }, + 'cfe': { + type: 'int' + }, + 'cff': { + type: 'int' + }, + 'rfo': { + type: 'int' + }, + 'rfe': { + type: 'int' + }, + 'rff': { + type: 'int' + } +}; + +export interface CT_SheetBackgroundPicture { + 'r:id'?: string; +} + +export const CT_SheetBackgroundPicture_Attributes: Attributes = { + 'r:id': { + type: 'string' + } +}; + +export interface CT_ObjectPr { + 'anchor'?: CT_ObjectAnchor; + 'locked'?: boolean; + 'defaultSize'?: boolean; + 'print'?: boolean; + 'disabled'?: boolean; + 'uiObject'?: boolean; + 'autoFill'?: boolean; + 'autoLine'?: boolean; + 'autoPict'?: boolean; + 'macro'?: string; + 'altText'?: string; + 'dde'?: boolean; + 'r:id'?: string; +} + +export const CT_ObjectPr_Attributes: Attributes = { + 'anchor': { + type: 'child', + childAttributes: CT_ObjectAnchor_Attributes + }, + 'locked': { + type: 'boolean', + defaultValue: 'true' + }, + 'defaultSize': { + type: 'boolean', + defaultValue: 'true' + }, + 'print': { + type: 'boolean', + defaultValue: 'true' + }, + 'disabled': { + type: 'boolean', + defaultValue: 'false' + }, + 'uiObject': { + type: 'boolean', + defaultValue: 'false' + }, + 'autoFill': { + type: 'boolean', + defaultValue: 'true' + }, + 'autoLine': { + type: 'boolean', + defaultValue: 'true' + }, + 'autoPict': { + type: 'boolean', + defaultValue: 'true' + }, + 'macro': { + type: 'string' + }, + 'altText': { + type: 'string' + }, + 'dde': { + type: 'boolean', + defaultValue: 'false' + }, + 'r:id': { + type: 'string' + } +}; + +export type ST_DvAspect = 'DVASPECT_CONTENT' | 'DVASPECT_ICON'; + +export type ST_OleUpdate = 'OLEUPDATE_ALWAYS' | 'OLEUPDATE_ONCALL'; + +export interface CT_OleObject { + 'objectPr'?: CT_ObjectPr; + 'progId'?: string; + 'dvAspect'?: ST_DvAspect; + 'link'?: string; + 'oleUpdate'?: ST_OleUpdate; + 'autoLoad'?: boolean; + 'shapeId'?: number; + 'r:id'?: string; +} + +export const CT_OleObject_Attributes: Attributes = { + 'objectPr': { + type: 'child', + childAttributes: CT_ObjectPr_Attributes + }, + 'progId': { + type: 'string' + }, + 'dvAspect': { + type: 'string', + defaultValue: 'DVASPECT_CONTENT' + }, + 'link': { + type: 'string' + }, + 'oleUpdate': { + type: 'string' + }, + 'autoLoad': { + type: 'boolean', + defaultValue: 'false' + }, + 'shapeId': { + type: 'int' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_OleObjects { + oleObject?: CT_OleObject[]; +} + +export const CT_OleObjects_Attributes: Attributes = { + oleObject: { + type: 'child', + childAttributes: CT_OleObject_Attributes, + childIsArray: true + } +}; + +export interface CT_Macrosheet { + sheetPr?: CT_SheetPr; + dimension?: CT_SheetDimension; + sheetViews?: CT_SheetViews; + sheetFormatPr?: CT_SheetFormatPr; + cols?: CT_Cols[]; + sheetData?: CT_SheetData; + sheetProtection?: CT_SheetProtection; + autoFilter?: CT_AutoFilter; + sortState?: CT_SortState; + dataConsolidate?: CT_DataConsolidate; + customSheetViews?: CT_CustomSheetViews; + phoneticPr?: CT_PhoneticPr; + conditionalFormatting?: CT_ConditionalFormatting[]; + printOptions?: CT_PrintOptions; + pageMargins?: CT_PageMargins; + pageSetup?: CT_PageSetup; + headerFooter?: CT_HeaderFooter; + rowBreaks?: CT_PageBreak; + colBreaks?: CT_PageBreak; + customProperties?: CT_CustomProperties; + drawing?: CT_Drawing; + drawingHF?: CT_DrawingHF; + picture?: CT_SheetBackgroundPicture; + oleObjects?: CT_OleObjects; + extLst?: CT_ExtensionList[]; +} + +export const CT_Macrosheet_Attributes: Attributes = { + sheetPr: { + type: 'child', + childAttributes: CT_SheetPr_Attributes + }, + dimension: { + type: 'child', + childAttributes: CT_SheetDimension_Attributes + }, + sheetViews: { + type: 'child', + childAttributes: CT_SheetViews_Attributes + }, + sheetFormatPr: { + type: 'child', + childAttributes: CT_SheetFormatPr_Attributes + }, + cols: { + type: 'child', + childAttributes: CT_Cols_Attributes, + childIsArray: true + }, + sheetData: { + type: 'child', + childAttributes: CT_SheetData_Attributes + }, + sheetProtection: { + type: 'child', + childAttributes: CT_SheetProtection_Attributes + }, + autoFilter: { + type: 'child', + childAttributes: CT_AutoFilter_Attributes + }, + sortState: { + type: 'child', + childAttributes: CT_SortState_Attributes + }, + dataConsolidate: { + type: 'child', + childAttributes: CT_DataConsolidate_Attributes + }, + customSheetViews: { + type: 'child', + childAttributes: CT_CustomSheetViews_Attributes + }, + phoneticPr: { + type: 'child', + childAttributes: CT_PhoneticPr_Attributes + }, + conditionalFormatting: { + type: 'child', + childAttributes: CT_ConditionalFormatting_Attributes, + childIsArray: true + }, + printOptions: { + type: 'child', + childAttributes: CT_PrintOptions_Attributes + }, + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes + }, + pageSetup: { + type: 'child', + childAttributes: CT_PageSetup_Attributes + }, + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes + }, + rowBreaks: { + type: 'child', + childAttributes: CT_PageBreak_Attributes + }, + colBreaks: { + type: 'child', + childAttributes: CT_PageBreak_Attributes + }, + customProperties: { + type: 'child', + childAttributes: CT_CustomProperties_Attributes + }, + drawing: { + type: 'child', + childAttributes: CT_Drawing_Attributes + }, + drawingHF: { + type: 'child', + childAttributes: CT_DrawingHF_Attributes + }, + picture: { + type: 'child', + childAttributes: CT_SheetBackgroundPicture_Attributes + }, + oleObjects: { + type: 'child', + childAttributes: CT_OleObjects_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_ControlPr { + 'anchor'?: CT_ObjectAnchor; + 'locked'?: boolean; + 'defaultSize'?: boolean; + 'print'?: boolean; + 'disabled'?: boolean; + 'recalcAlways'?: boolean; + 'uiObject'?: boolean; + 'autoFill'?: boolean; + 'autoLine'?: boolean; + 'autoPict'?: boolean; + 'macro'?: string; + 'altText'?: string; + 'linkedCell'?: string; + 'listFillRange'?: string; + 'cf'?: string; + 'r:id'?: string; +} + +export const CT_ControlPr_Attributes: Attributes = { + 'anchor': { + type: 'child', + childAttributes: CT_ObjectAnchor_Attributes + }, + 'locked': { + type: 'boolean', + defaultValue: 'true' + }, + 'defaultSize': { + type: 'boolean', + defaultValue: 'true' + }, + 'print': { + type: 'boolean', + defaultValue: 'true' + }, + 'disabled': { + type: 'boolean', + defaultValue: 'false' + }, + 'recalcAlways': { + type: 'boolean', + defaultValue: 'false' + }, + 'uiObject': { + type: 'boolean', + defaultValue: 'false' + }, + 'autoFill': { + type: 'boolean', + defaultValue: 'true' + }, + 'autoLine': { + type: 'boolean', + defaultValue: 'true' + }, + 'autoPict': { + type: 'boolean', + defaultValue: 'true' + }, + 'macro': { + type: 'string' + }, + 'altText': { + type: 'string' + }, + 'linkedCell': { + type: 'string' + }, + 'listFillRange': { + type: 'string' + }, + 'cf': { + type: 'string', + defaultValue: 'pict' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_Control { + 'controlPr'?: CT_ControlPr; + 'shapeId'?: number; + 'r:id'?: string; + 'name'?: string; +} + +export const CT_Control_Attributes: Attributes = { + 'controlPr': { + type: 'child', + childAttributes: CT_ControlPr_Attributes + }, + 'shapeId': { + type: 'int' + }, + 'r:id': { + type: 'string' + }, + 'name': { + type: 'string' + } +}; + +export interface CT_Controls { + control?: CT_Control[]; +} + +export const CT_Controls_Attributes: Attributes = { + control: { + type: 'child', + childAttributes: CT_Control_Attributes, + childIsArray: true + } +}; + +export interface CT_Dialogsheet { + sheetPr?: CT_SheetPr[]; + sheetViews?: CT_SheetViews[]; + sheetFormatPr?: CT_SheetFormatPr[]; + sheetProtection?: CT_SheetProtection; + customSheetViews?: CT_CustomSheetViews[]; + printOptions?: CT_PrintOptions[]; + pageMargins?: CT_PageMargins[]; + pageSetup?: CT_PageSetup[]; + headerFooter?: CT_HeaderFooter[]; + drawing?: CT_Drawing[]; + drawingHF?: CT_DrawingHF; + oleObjects?: CT_OleObjects; + controls?: CT_Controls; + extLst?: CT_ExtensionList[]; +} + +export const CT_Dialogsheet_Attributes: Attributes = { + sheetPr: { + type: 'child', + childAttributes: CT_SheetPr_Attributes, + childIsArray: true + }, + sheetViews: { + type: 'child', + childAttributes: CT_SheetViews_Attributes, + childIsArray: true + }, + sheetFormatPr: { + type: 'child', + childAttributes: CT_SheetFormatPr_Attributes, + childIsArray: true + }, + sheetProtection: { + type: 'child', + childAttributes: CT_SheetProtection_Attributes + }, + customSheetViews: { + type: 'child', + childAttributes: CT_CustomSheetViews_Attributes, + childIsArray: true + }, + printOptions: { + type: 'child', + childAttributes: CT_PrintOptions_Attributes, + childIsArray: true + }, + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes, + childIsArray: true + }, + pageSetup: { + type: 'child', + childAttributes: CT_PageSetup_Attributes, + childIsArray: true + }, + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes, + childIsArray: true + }, + drawing: { + type: 'child', + childAttributes: CT_Drawing_Attributes, + childIsArray: true + }, + drawingHF: { + type: 'child', + childAttributes: CT_DrawingHF_Attributes + }, + oleObjects: { + type: 'child', + childAttributes: CT_OleObjects_Attributes + }, + controls: { + type: 'child', + childAttributes: CT_Controls_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_SheetCalcPr { + fullCalcOnLoad?: boolean; +} + +export const CT_SheetCalcPr_Attributes: Attributes = { + fullCalcOnLoad: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ProtectedRange { + securityDescriptor?: string[]; + sqref?: string; + name?: string; + algorithmName?: string; + hashValue?: string; + saltValue?: string; + spinCount?: number; +} + +export const CT_ProtectedRange_Attributes: Attributes = { + securityDescriptor: { + type: 'child-string', + childIsArray: true + }, + sqref: { + type: 'string' + }, + name: { + type: 'string' + }, + algorithmName: { + type: 'string' + }, + hashValue: { + type: 'string' + }, + saltValue: { + type: 'string' + }, + spinCount: { + type: 'int' + } +}; + +export interface CT_ProtectedRanges { + protectedRange?: CT_ProtectedRange[]; +} + +export const CT_ProtectedRanges_Attributes: Attributes = { + protectedRange: { + type: 'child', + childAttributes: CT_ProtectedRange_Attributes, + childIsArray: true + } +}; + +export interface CT_InputCells { + r?: string; + deleted?: boolean; + undone?: boolean; + val?: string; + numFmtId?: number; +} + +export const CT_InputCells_Attributes: Attributes = { + r: { + type: 'string' + }, + deleted: { + type: 'boolean', + defaultValue: 'false' + }, + undone: { + type: 'boolean', + defaultValue: 'false' + }, + val: { + type: 'string' + }, + numFmtId: { + type: 'int' + } +}; + +export interface CT_Scenario { + inputCells?: CT_InputCells[]; + name?: string; + locked?: boolean; + hidden?: boolean; + count?: number; + user?: string; + comment?: string; +} + +export const CT_Scenario_Attributes: Attributes = { + inputCells: { + type: 'child', + childAttributes: CT_InputCells_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + locked: { + type: 'boolean', + defaultValue: 'false' + }, + hidden: { + type: 'boolean', + defaultValue: 'false' + }, + count: { + type: 'int' + }, + user: { + type: 'string' + }, + comment: { + type: 'string' + } +}; + +export interface CT_Scenarios { + scenario?: CT_Scenario[]; + current?: number; + show?: number; + sqref?: string; +} + +export const CT_Scenarios_Attributes: Attributes = { + scenario: { + type: 'child', + childAttributes: CT_Scenario_Attributes, + childIsArray: true + }, + current: { + type: 'int' + }, + show: { + type: 'int' + }, + sqref: { + type: 'string' + } +}; + +export interface CT_MergeCell { + ref?: string; +} + +export const CT_MergeCell_Attributes: Attributes = { + ref: { + type: 'string' + } +}; + +export interface CT_MergeCells { + mergeCell?: CT_MergeCell[]; + count?: number; +} + +export const CT_MergeCells_Attributes: Attributes = { + mergeCell: { + type: 'child', + childAttributes: CT_MergeCell_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_DataValidationType = + | 'none' + | 'whole' + | 'decimal' + | 'list' + | 'date' + | 'time' + | 'textLength' + | 'custom'; + +export type ST_DataValidationErrorStyle = 'stop' | 'warning' | 'information'; + +export type ST_DataValidationImeMode = + | 'noControl' + | 'off' + | 'on' + | 'disabled' + | 'hiragana' + | 'fullKatakana' + | 'halfKatakana' + | 'fullAlpha' + | 'halfAlpha' + | 'fullHangul' + | 'halfHangul'; + +export type ST_DataValidationOperator = + | 'between' + | 'notBetween' + | 'equal' + | 'notEqual' + | 'lessThan' + | 'lessThanOrEqual' + | 'greaterThan' + | 'greaterThanOrEqual'; + +export interface CT_DataValidation { + formula1?: string; + formula2?: string; + type?: ST_DataValidationType; + errorStyle?: ST_DataValidationErrorStyle; + imeMode?: ST_DataValidationImeMode; + operator?: ST_DataValidationOperator; + allowBlank?: boolean; + showDropDown?: boolean; + showInputMessage?: boolean; + showErrorMessage?: boolean; + errorTitle?: string; + error?: string; + promptTitle?: string; + prompt?: string; + sqref?: string; +} + +export const CT_DataValidation_Attributes: Attributes = { + formula1: { + type: 'child-string' + }, + formula2: { + type: 'child-string' + }, + type: { + type: 'string', + defaultValue: 'none' + }, + errorStyle: { + type: 'string', + defaultValue: 'stop' + }, + imeMode: { + type: 'string', + defaultValue: 'noControl' + }, + operator: { + type: 'string', + defaultValue: 'between' + }, + allowBlank: { + type: 'boolean', + defaultValue: 'false' + }, + showDropDown: { + type: 'boolean', + defaultValue: 'false' + }, + showInputMessage: { + type: 'boolean', + defaultValue: 'false' + }, + showErrorMessage: { + type: 'boolean', + defaultValue: 'false' + }, + errorTitle: { + type: 'string' + }, + error: { + type: 'string' + }, + promptTitle: { + type: 'string' + }, + prompt: { + type: 'string' + }, + sqref: { + type: 'string' + } +}; + +export interface CT_DataValidations { + dataValidation?: CT_DataValidation[]; + disablePrompts?: boolean; + xWindow?: number; + yWindow?: number; + count?: number; +} + +export const CT_DataValidations_Attributes: Attributes = { + dataValidation: { + type: 'child', + childAttributes: CT_DataValidation_Attributes, + childIsArray: true + }, + disablePrompts: { + type: 'boolean', + defaultValue: 'false' + }, + xWindow: { + type: 'int' + }, + yWindow: { + type: 'int' + }, + count: { + type: 'int' + } +}; + +export interface CT_Hyperlinks { + hyperlink?: CT_Hyperlink[]; +} + +export const CT_Hyperlinks_Attributes: Attributes = { + hyperlink: { + type: 'child', + childAttributes: CT_Hyperlink_Attributes, + childIsArray: true + } +}; + +export interface CT_CellWatch { + r?: string; +} + +export const CT_CellWatch_Attributes: Attributes = { + r: { + type: 'string' + } +}; + +export interface CT_CellWatches { + cellWatch?: CT_CellWatch[]; +} + +export const CT_CellWatches_Attributes: Attributes = { + cellWatch: { + type: 'child', + childAttributes: CT_CellWatch_Attributes, + childIsArray: true + } +}; + +export interface CT_IgnoredError { + sqref?: string; + evalError?: boolean; + twoDigitTextYear?: boolean; + numberStoredAsText?: boolean; + formula?: boolean; + formulaRange?: boolean; + unlockedFormula?: boolean; + emptyCellReference?: boolean; + listDataValidation?: boolean; + calculatedColumn?: boolean; +} + +export const CT_IgnoredError_Attributes: Attributes = { + sqref: { + type: 'string' + }, + evalError: { + type: 'boolean', + defaultValue: 'false' + }, + twoDigitTextYear: { + type: 'boolean', + defaultValue: 'false' + }, + numberStoredAsText: { + type: 'boolean', + defaultValue: 'false' + }, + formula: { + type: 'boolean', + defaultValue: 'false' + }, + formulaRange: { + type: 'boolean', + defaultValue: 'false' + }, + unlockedFormula: { + type: 'boolean', + defaultValue: 'false' + }, + emptyCellReference: { + type: 'boolean', + defaultValue: 'false' + }, + listDataValidation: { + type: 'boolean', + defaultValue: 'false' + }, + calculatedColumn: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_IgnoredErrors { + ignoredError?: CT_IgnoredError[]; + extLst?: CT_ExtensionList; +} + +export const CT_IgnoredErrors_Attributes: Attributes = { + ignoredError: { + type: 'child', + childAttributes: CT_IgnoredError_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_CellSmartTagPr { + key?: string; + val?: string; +} + +export const CT_CellSmartTagPr_Attributes: Attributes = { + key: { + type: 'string' + }, + val: { + type: 'string' + } +}; + +export interface CT_CellSmartTag { + cellSmartTagPr?: CT_CellSmartTagPr[]; + type?: number; + deleted?: boolean; + xmlBased?: boolean; +} + +export const CT_CellSmartTag_Attributes: Attributes = { + cellSmartTagPr: { + type: 'child', + childAttributes: CT_CellSmartTagPr_Attributes, + childIsArray: true + }, + type: { + type: 'int' + }, + deleted: { + type: 'boolean', + defaultValue: 'false' + }, + xmlBased: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CellSmartTags { + cellSmartTag?: CT_CellSmartTag[]; + r?: string; +} + +export const CT_CellSmartTags_Attributes: Attributes = { + cellSmartTag: { + type: 'child', + childAttributes: CT_CellSmartTag_Attributes, + childIsArray: true + }, + r: { + type: 'string' + } +}; + +export interface CT_SmartTags { + cellSmartTags?: CT_CellSmartTags[]; +} + +export const CT_SmartTags_Attributes: Attributes = { + cellSmartTags: { + type: 'child', + childAttributes: CT_CellSmartTags_Attributes, + childIsArray: true + } +}; + +export type ST_WebSourceType = + | 'sheet' + | 'printArea' + | 'autoFilter' + | 'range' + | 'chart' + | 'pivotTable' + | 'query' + | 'label'; + +export interface CT_WebPublishItem { + id?: number; + divId?: string; + sourceType?: ST_WebSourceType; + sourceRef?: string; + sourceObject?: string; + destinationFile?: string; + title?: string; + autoRepublish?: boolean; +} + +export const CT_WebPublishItem_Attributes: Attributes = { + id: { + type: 'int' + }, + divId: { + type: 'string' + }, + sourceType: { + type: 'string' + }, + sourceRef: { + type: 'string' + }, + sourceObject: { + type: 'string' + }, + destinationFile: { + type: 'string' + }, + title: { + type: 'string' + }, + autoRepublish: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_WebPublishItems { + webPublishItem?: CT_WebPublishItem[]; + count?: number; +} + +export const CT_WebPublishItems_Attributes: Attributes = { + webPublishItem: { + type: 'child', + childAttributes: CT_WebPublishItem_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_TablePart { + 'r:id'?: string; +} + +export const CT_TablePart_Attributes: Attributes = { + 'r:id': { + type: 'string' + } +}; + +export interface CT_TableParts { + tablePart?: CT_TablePart[]; + count?: number; +} + +export const CT_TableParts_Attributes: Attributes = { + tablePart: { + type: 'child', + childAttributes: CT_TablePart_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Worksheet { + sheetPr?: CT_SheetPr; + dimension?: CT_SheetDimension; + sheetViews?: CT_SheetViews; + sheetFormatPr?: CT_SheetFormatPr; + cols?: CT_Cols[]; + sheetData?: CT_SheetData; + sheetCalcPr?: CT_SheetCalcPr; + sheetProtection?: CT_SheetProtection; + protectedRanges?: CT_ProtectedRanges; + scenarios?: CT_Scenarios; + autoFilter?: CT_AutoFilter; + sortState?: CT_SortState; + dataConsolidate?: CT_DataConsolidate; + customSheetViews?: CT_CustomSheetViews; + mergeCells?: CT_MergeCells; + phoneticPr?: CT_PhoneticPr; + conditionalFormatting?: CT_ConditionalFormatting[]; + dataValidations?: CT_DataValidations; + hyperlinks?: CT_Hyperlinks; + printOptions?: CT_PrintOptions; + pageMargins?: CT_PageMargins; + pageSetup?: CT_PageSetup; + headerFooter?: CT_HeaderFooter; + rowBreaks?: CT_PageBreak; + colBreaks?: CT_PageBreak; + customProperties?: CT_CustomProperties; + cellWatches?: CT_CellWatches; + ignoredErrors?: CT_IgnoredErrors; + smartTags?: CT_SmartTags; + drawing?: CT_Drawing; + drawingHF?: CT_DrawingHF; + picture?: CT_SheetBackgroundPicture; + oleObjects?: CT_OleObjects; + controls?: CT_Controls; + webPublishItems?: CT_WebPublishItems; + tableParts?: CT_TableParts; + extLst?: CT_ExtensionList; +} + +export const CT_Worksheet_Attributes: Attributes = { + sheetPr: { + type: 'child', + childAttributes: CT_SheetPr_Attributes + }, + dimension: { + type: 'child', + childAttributes: CT_SheetDimension_Attributes + }, + sheetViews: { + type: 'child', + childAttributes: CT_SheetViews_Attributes + }, + sheetFormatPr: { + type: 'child', + childAttributes: CT_SheetFormatPr_Attributes + }, + cols: { + type: 'child', + childAttributes: CT_Cols_Attributes, + childIsArray: true + }, + sheetData: { + type: 'child', + childAttributes: CT_SheetData_Attributes + }, + sheetCalcPr: { + type: 'child', + childAttributes: CT_SheetCalcPr_Attributes + }, + sheetProtection: { + type: 'child', + childAttributes: CT_SheetProtection_Attributes + }, + protectedRanges: { + type: 'child', + childAttributes: CT_ProtectedRanges_Attributes + }, + scenarios: { + type: 'child', + childAttributes: CT_Scenarios_Attributes + }, + autoFilter: { + type: 'child', + childAttributes: CT_AutoFilter_Attributes + }, + sortState: { + type: 'child', + childAttributes: CT_SortState_Attributes + }, + dataConsolidate: { + type: 'child', + childAttributes: CT_DataConsolidate_Attributes + }, + customSheetViews: { + type: 'child', + childAttributes: CT_CustomSheetViews_Attributes + }, + mergeCells: { + type: 'child', + childAttributes: CT_MergeCells_Attributes + }, + phoneticPr: { + type: 'child', + childAttributes: CT_PhoneticPr_Attributes + }, + conditionalFormatting: { + type: 'child', + childAttributes: CT_ConditionalFormatting_Attributes, + childIsArray: true + }, + dataValidations: { + type: 'child', + childAttributes: CT_DataValidations_Attributes + }, + hyperlinks: { + type: 'child', + childAttributes: CT_Hyperlinks_Attributes + }, + printOptions: { + type: 'child', + childAttributes: CT_PrintOptions_Attributes + }, + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes + }, + pageSetup: { + type: 'child', + childAttributes: CT_PageSetup_Attributes + }, + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes + }, + rowBreaks: { + type: 'child', + childAttributes: CT_PageBreak_Attributes + }, + colBreaks: { + type: 'child', + childAttributes: CT_PageBreak_Attributes + }, + customProperties: { + type: 'child', + childAttributes: CT_CustomProperties_Attributes + }, + cellWatches: { + type: 'child', + childAttributes: CT_CellWatches_Attributes + }, + ignoredErrors: { + type: 'child', + childAttributes: CT_IgnoredErrors_Attributes + }, + smartTags: { + type: 'child', + childAttributes: CT_SmartTags_Attributes + }, + drawing: { + type: 'child', + childAttributes: CT_Drawing_Attributes + }, + drawingHF: { + type: 'child', + childAttributes: CT_DrawingHF_Attributes + }, + picture: { + type: 'child', + childAttributes: CT_SheetBackgroundPicture_Attributes + }, + oleObjects: { + type: 'child', + childAttributes: CT_OleObjects_Attributes + }, + controls: { + type: 'child', + childAttributes: CT_Controls_Attributes + }, + webPublishItems: { + type: 'child', + childAttributes: CT_WebPublishItems_Attributes + }, + tableParts: { + type: 'child', + childAttributes: CT_TableParts_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_CellSpan = string; + +export type ST_CellFormulaType = 'normal' | 'array' | 'dataTable' | 'shared'; + +export interface CT_ChartsheetPr { + tabColor?: CT_Color; + published?: boolean; + codeName?: string; +} + +export const CT_ChartsheetPr_Attributes: Attributes = { + tabColor: { + type: 'child', + childAttributes: CT_Color_Attributes + }, + published: { + type: 'boolean', + defaultValue: 'true' + }, + codeName: { + type: 'string' + } +}; + +export interface CT_ChartsheetView { + extLst?: CT_ExtensionList; + tabSelected?: boolean; + zoomScale?: number; + workbookViewId?: number; + zoomToFit?: boolean; +} + +export const CT_ChartsheetView_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + tabSelected: { + type: 'boolean', + defaultValue: 'false' + }, + zoomScale: { + type: 'int', + defaultValue: '100' + }, + workbookViewId: { + type: 'int' + }, + zoomToFit: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ChartsheetViews { + sheetView?: CT_ChartsheetView[]; + extLst?: CT_ExtensionList; +} + +export const CT_ChartsheetViews_Attributes: Attributes = { + sheetView: { + type: 'child', + childAttributes: CT_ChartsheetView_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_ChartsheetProtection { + algorithmName?: string; + hashValue?: string; + saltValue?: string; + spinCount?: number; + content?: boolean; + objects?: boolean; +} + +export const CT_ChartsheetProtection_Attributes: Attributes = { + algorithmName: { + type: 'string' + }, + hashValue: { + type: 'string' + }, + saltValue: { + type: 'string' + }, + spinCount: { + type: 'int' + }, + content: { + type: 'boolean', + defaultValue: 'false' + }, + objects: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CsPageSetup { + 'paperSize'?: number; + 'paperHeight'?: string; + 'paperWidth'?: string; + 'firstPageNumber'?: number; + 'orientation'?: ST_Orientation; + 'usePrinterDefaults'?: boolean; + 'blackAndWhite'?: boolean; + 'draft'?: boolean; + 'useFirstPageNumber'?: boolean; + 'horizontalDpi'?: number; + 'verticalDpi'?: number; + 'copies'?: number; + 'r:id'?: string; +} + +export const CT_CsPageSetup_Attributes: Attributes = { + 'paperSize': { + type: 'int', + defaultValue: '1' + }, + 'paperHeight': { + type: 'string' + }, + 'paperWidth': { + type: 'string' + }, + 'firstPageNumber': { + type: 'int', + defaultValue: '1' + }, + 'orientation': { + type: 'string', + defaultValue: 'default' + }, + 'usePrinterDefaults': { + type: 'boolean', + defaultValue: 'true' + }, + 'blackAndWhite': { + type: 'boolean', + defaultValue: 'false' + }, + 'draft': { + type: 'boolean', + defaultValue: 'false' + }, + 'useFirstPageNumber': { + type: 'boolean', + defaultValue: 'false' + }, + 'horizontalDpi': { + type: 'int', + defaultValue: '600' + }, + 'verticalDpi': { + type: 'int', + defaultValue: '600' + }, + 'copies': { + type: 'int', + defaultValue: '1' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_CustomChartsheetView { + pageMargins?: CT_PageMargins; + pageSetup?: CT_CsPageSetup; + headerFooter?: CT_HeaderFooter; + guid?: string; + scale?: number; + state?: ST_SheetState; + zoomToFit?: boolean; +} + +export const CT_CustomChartsheetView_Attributes: Attributes = { + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes + }, + pageSetup: { + type: 'child', + childAttributes: CT_CsPageSetup_Attributes + }, + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes + }, + guid: { + type: 'string' + }, + scale: { + type: 'int', + defaultValue: '100' + }, + state: { + type: 'string', + defaultValue: 'visible' + }, + zoomToFit: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_CustomChartsheetViews { + customSheetView?: CT_CustomChartsheetView[]; +} + +export const CT_CustomChartsheetViews_Attributes: Attributes = { + customSheetView: { + type: 'child', + childAttributes: CT_CustomChartsheetView_Attributes, + childIsArray: true + } +}; + +export interface CT_Chartsheet { + sheetPr?: CT_ChartsheetPr; + sheetViews?: CT_ChartsheetViews; + sheetProtection?: CT_ChartsheetProtection; + customSheetViews?: CT_CustomChartsheetViews; + pageMargins?: CT_PageMargins[]; + pageSetup?: CT_CsPageSetup; + headerFooter?: CT_HeaderFooter[]; + drawing?: CT_Drawing; + drawingHF?: CT_DrawingHF; + picture?: CT_SheetBackgroundPicture; + webPublishItems?: CT_WebPublishItems; + extLst?: CT_ExtensionList; +} + +export const CT_Chartsheet_Attributes: Attributes = { + sheetPr: { + type: 'child', + childAttributes: CT_ChartsheetPr_Attributes + }, + sheetViews: { + type: 'child', + childAttributes: CT_ChartsheetViews_Attributes + }, + sheetProtection: { + type: 'child', + childAttributes: CT_ChartsheetProtection_Attributes + }, + customSheetViews: { + type: 'child', + childAttributes: CT_CustomChartsheetViews_Attributes + }, + pageMargins: { + type: 'child', + childAttributes: CT_PageMargins_Attributes, + childIsArray: true + }, + pageSetup: { + type: 'child', + childAttributes: CT_CsPageSetup_Attributes + }, + headerFooter: { + type: 'child', + childAttributes: CT_HeaderFooter_Attributes, + childIsArray: true + }, + drawing: { + type: 'child', + childAttributes: CT_Drawing_Attributes + }, + drawingHF: { + type: 'child', + childAttributes: CT_DrawingHF_Attributes + }, + picture: { + type: 'child', + childAttributes: CT_SheetBackgroundPicture_Attributes + }, + webPublishItems: { + type: 'child', + childAttributes: CT_WebPublishItems_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_MetadataType { + name?: string; + minSupportedVersion?: number; + ghostRow?: boolean; + ghostCol?: boolean; + edit?: boolean; + delete?: boolean; + copy?: boolean; + pasteAll?: boolean; + pasteFormulas?: boolean; + pasteValues?: boolean; + pasteFormats?: boolean; + pasteComments?: boolean; + pasteDataValidation?: boolean; + pasteBorders?: boolean; + pasteColWidths?: boolean; + pasteNumberFormats?: boolean; + merge?: boolean; + splitFirst?: boolean; + splitAll?: boolean; + rowColShift?: boolean; + clearAll?: boolean; + clearFormats?: boolean; + clearContents?: boolean; + clearComments?: boolean; + assign?: boolean; + coerce?: boolean; + adjust?: boolean; + cellMeta?: boolean; +} + +export const CT_MetadataType_Attributes: Attributes = { + name: { + type: 'string' + }, + minSupportedVersion: { + type: 'int' + }, + ghostRow: { + type: 'boolean', + defaultValue: 'false' + }, + ghostCol: { + type: 'boolean', + defaultValue: 'false' + }, + edit: { + type: 'boolean', + defaultValue: 'false' + }, + delete: { + type: 'boolean', + defaultValue: 'false' + }, + copy: { + type: 'boolean', + defaultValue: 'false' + }, + pasteAll: { + type: 'boolean', + defaultValue: 'false' + }, + pasteFormulas: { + type: 'boolean', + defaultValue: 'false' + }, + pasteValues: { + type: 'boolean', + defaultValue: 'false' + }, + pasteFormats: { + type: 'boolean', + defaultValue: 'false' + }, + pasteComments: { + type: 'boolean', + defaultValue: 'false' + }, + pasteDataValidation: { + type: 'boolean', + defaultValue: 'false' + }, + pasteBorders: { + type: 'boolean', + defaultValue: 'false' + }, + pasteColWidths: { + type: 'boolean', + defaultValue: 'false' + }, + pasteNumberFormats: { + type: 'boolean', + defaultValue: 'false' + }, + merge: { + type: 'boolean', + defaultValue: 'false' + }, + splitFirst: { + type: 'boolean', + defaultValue: 'false' + }, + splitAll: { + type: 'boolean', + defaultValue: 'false' + }, + rowColShift: { + type: 'boolean', + defaultValue: 'false' + }, + clearAll: { + type: 'boolean', + defaultValue: 'false' + }, + clearFormats: { + type: 'boolean', + defaultValue: 'false' + }, + clearContents: { + type: 'boolean', + defaultValue: 'false' + }, + clearComments: { + type: 'boolean', + defaultValue: 'false' + }, + assign: { + type: 'boolean', + defaultValue: 'false' + }, + coerce: { + type: 'boolean', + defaultValue: 'false' + }, + adjust: { + type: 'boolean', + defaultValue: 'false' + }, + cellMeta: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_MetadataTypes { + metadataType?: CT_MetadataType[]; + count?: number; +} + +export const CT_MetadataTypes_Attributes: Attributes = { + metadataType: { + type: 'child', + childAttributes: CT_MetadataType_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_MetadataStrings { + s?: CT_XStringElement[]; + count?: number; +} + +export const CT_MetadataStrings_Attributes: Attributes = { + s: { + type: 'child', + childAttributes: CT_XStringElement_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_MetadataStringIndex { + x?: number; + s?: boolean; +} + +export const CT_MetadataStringIndex_Attributes: Attributes = { + x: { + type: 'int' + }, + s: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_MdxTuple { + n?: CT_MetadataStringIndex[]; + c?: number; + ct?: string; + si?: number; + fi?: number; + bc?: string; + fc?: string; + i?: boolean; + u?: boolean; + st?: boolean; + b?: boolean; +} + +export const CT_MdxTuple_Attributes: Attributes = { + n: { + type: 'child', + childAttributes: CT_MetadataStringIndex_Attributes, + childIsArray: true + }, + c: { + type: 'int', + defaultValue: '0' + }, + ct: { + type: 'string' + }, + si: { + type: 'int' + }, + fi: { + type: 'int' + }, + bc: { + type: 'string' + }, + fc: { + type: 'string' + }, + i: { + type: 'boolean', + defaultValue: 'false' + }, + u: { + type: 'boolean', + defaultValue: 'false' + }, + st: { + type: 'boolean', + defaultValue: 'false' + }, + b: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export type ST_MdxSetOrder = 'u' | 'a' | 'd' | 'aa' | 'ad' | 'na' | 'nd'; + +export interface CT_MdxSet { + n?: CT_MetadataStringIndex[]; + ns?: number; + c?: number; + o?: ST_MdxSetOrder; +} + +export const CT_MdxSet_Attributes: Attributes = { + n: { + type: 'child', + childAttributes: CT_MetadataStringIndex_Attributes, + childIsArray: true + }, + ns: { + type: 'int' + }, + c: { + type: 'int', + defaultValue: '0' + }, + o: { + type: 'string', + defaultValue: 'u' + } +}; + +export interface CT_MdxMemeberProp { + n?: number; + np?: number; +} + +export const CT_MdxMemeberProp_Attributes: Attributes = { + n: { + type: 'int' + }, + np: { + type: 'int' + } +}; + +export type ST_MdxKPIProperty = 'v' | 'g' | 's' | 't' | 'w' | 'm'; + +export interface CT_MdxKPI { + n?: number; + np?: number; + p?: ST_MdxKPIProperty; +} + +export const CT_MdxKPI_Attributes: Attributes = { + n: { + type: 'int' + }, + np: { + type: 'int' + }, + p: { + type: 'string' + } +}; + +export type ST_MdxFunctionType = 'm' | 'v' | 's' | 'c' | 'r' | 'p' | 'k'; + +export interface CT_Mdx { + t?: CT_MdxTuple[]; + ms?: CT_MdxSet[]; + p?: CT_MdxMemeberProp[]; + k?: CT_MdxKPI[]; + n?: number; + f?: ST_MdxFunctionType; +} + +export const CT_Mdx_Attributes: Attributes = { + t: { + type: 'child', + childAttributes: CT_MdxTuple_Attributes, + childIsArray: true + }, + ms: { + type: 'child', + childAttributes: CT_MdxSet_Attributes, + childIsArray: true + }, + p: { + type: 'child', + childAttributes: CT_MdxMemeberProp_Attributes, + childIsArray: true + }, + k: { + type: 'child', + childAttributes: CT_MdxKPI_Attributes, + childIsArray: true + }, + n: { + type: 'int' + }, + f: { + type: 'string' + } +}; + +export interface CT_MdxMetadata { + mdx?: CT_Mdx[]; + count?: number; +} + +export const CT_MdxMetadata_Attributes: Attributes = { + mdx: { + type: 'child', + childAttributes: CT_Mdx_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_FutureMetadataBlock { + extLst?: CT_ExtensionList; +} + +export const CT_FutureMetadataBlock_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export interface CT_FutureMetadata { + bk?: CT_FutureMetadataBlock[]; + extLst?: CT_ExtensionList; + name?: string; + count?: number; +} + +export const CT_FutureMetadata_Attributes: Attributes = { + bk: { + type: 'child', + childAttributes: CT_FutureMetadataBlock_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + name: { + type: 'string' + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_MetadataRecord { + t?: number; + v?: number; +} + +export const CT_MetadataRecord_Attributes: Attributes = { + t: { + type: 'int' + }, + v: { + type: 'int' + } +}; + +export interface CT_MetadataBlock { + rc?: CT_MetadataRecord[]; +} + +export const CT_MetadataBlock_Attributes: Attributes = { + rc: { + type: 'child', + childAttributes: CT_MetadataRecord_Attributes, + childIsArray: true + } +}; + +export interface CT_MetadataBlocks { + bk?: CT_MetadataBlock[]; + count?: number; +} + +export const CT_MetadataBlocks_Attributes: Attributes = { + bk: { + type: 'child', + childAttributes: CT_MetadataBlock_Attributes, + childIsArray: true + }, + count: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_Metadata { + metadataTypes?: CT_MetadataTypes; + metadataStrings?: CT_MetadataStrings; + mdxMetadata?: CT_MdxMetadata; + futureMetadata?: CT_FutureMetadata[]; + cellMetadata?: CT_MetadataBlocks; + valueMetadata?: CT_MetadataBlocks; + extLst?: CT_ExtensionList; +} + +export const CT_Metadata_Attributes: Attributes = { + metadataTypes: { + type: 'child', + childAttributes: CT_MetadataTypes_Attributes + }, + metadataStrings: { + type: 'child', + childAttributes: CT_MetadataStrings_Attributes + }, + mdxMetadata: { + type: 'child', + childAttributes: CT_MdxMetadata_Attributes + }, + futureMetadata: { + type: 'child', + childAttributes: CT_FutureMetadata_Attributes, + childIsArray: true + }, + cellMetadata: { + type: 'child', + childAttributes: CT_MetadataBlocks_Attributes + }, + valueMetadata: { + type: 'child', + childAttributes: CT_MetadataBlocks_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_XmlDataType = string; + +export interface CT_XmlPr { + extLst?: CT_ExtensionList; + mapId?: number; + xpath?: string; + xmlDataType?: string; +} + +export const CT_XmlPr_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + mapId: { + type: 'int' + }, + xpath: { + type: 'string' + }, + xmlDataType: { + type: 'string' + } +}; + +export interface CT_XmlCellPr { + xmlPr?: CT_XmlPr; + extLst?: CT_ExtensionList; + id?: number; + uniqueName?: string; +} + +export const CT_XmlCellPr_Attributes: Attributes = { + xmlPr: { + type: 'child', + childAttributes: CT_XmlPr_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + id: { + type: 'int' + }, + uniqueName: { + type: 'string' + } +}; + +export interface CT_SingleXmlCell { + xmlCellPr?: CT_XmlCellPr; + extLst?: CT_ExtensionList; + id?: number; + r?: string; + connectionId?: number; +} + +export const CT_SingleXmlCell_Attributes: Attributes = { + xmlCellPr: { + type: 'child', + childAttributes: CT_XmlCellPr_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + id: { + type: 'int' + }, + r: { + type: 'string' + }, + connectionId: { + type: 'int' + } +}; + +export interface CT_SingleXmlCells { + singleXmlCell?: CT_SingleXmlCell[]; +} + +export const CT_SingleXmlCells_Attributes: Attributes = { + singleXmlCell: { + type: 'child', + childAttributes: CT_SingleXmlCell_Attributes, + childIsArray: true + } +}; + +export interface CT_NumFmts { + numFmt?: CT_NumFmt[]; + count?: number; +} + +export const CT_NumFmts_Attributes: Attributes = { + numFmt: { + type: 'child', + childAttributes: CT_NumFmt_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Fonts { + font?: CT_Font[]; + count?: number; +} + +export const CT_Fonts_Attributes: Attributes = { + font: { + type: 'child', + childAttributes: CT_Font_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Fills { + fill?: CT_Fill[]; + count?: number; +} + +export const CT_Fills_Attributes: Attributes = { + fill: { + type: 'child', + childAttributes: CT_Fill_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Borders { + border?: CT_Border[]; + count?: number; +} + +export const CT_Borders_Attributes: Attributes = { + border: { + type: 'child', + childAttributes: CT_Border_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export type ST_FillId = number; + +export type ST_BorderId = number; + +export type ST_CellStyleXfId = number; + +export interface CT_Xf { + alignment?: CT_CellAlignment; + protection?: CT_CellProtection; + extLst?: CT_ExtensionList; + numFmtId?: number; + fontId?: number; + fillId?: number; + borderId?: number; + xfId?: number; + quotePrefix?: boolean; + pivotButton?: boolean; + applyNumberFormat?: boolean; + applyFont?: boolean; + applyFill?: boolean; + applyBorder?: boolean; + applyAlignment?: boolean; + applyProtection?: boolean; +} + +export const CT_Xf_Attributes: Attributes = { + alignment: { + type: 'child', + childAttributes: CT_CellAlignment_Attributes + }, + protection: { + type: 'child', + childAttributes: CT_CellProtection_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + numFmtId: { + type: 'int' + }, + fontId: { + type: 'int' + }, + fillId: { + type: 'int' + }, + borderId: { + type: 'int' + }, + xfId: { + type: 'int' + }, + quotePrefix: { + type: 'boolean', + defaultValue: 'false' + }, + pivotButton: { + type: 'boolean', + defaultValue: 'false' + }, + applyNumberFormat: { + type: 'boolean' + }, + applyFont: { + type: 'boolean' + }, + applyFill: { + type: 'boolean' + }, + applyBorder: { + type: 'boolean' + }, + applyAlignment: { + type: 'boolean' + }, + applyProtection: { + type: 'boolean' + } +}; + +export interface CT_CellStyleXfs { + xf?: CT_Xf[]; + count?: number; +} + +export const CT_CellStyleXfs_Attributes: Attributes = { + xf: { + type: 'child', + childAttributes: CT_Xf_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_CellXfs { + xf?: CT_Xf[]; + count?: number; +} + +export const CT_CellXfs_Attributes: Attributes = { + xf: { + type: 'child', + childAttributes: CT_Xf_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_CellStyle { + extLst?: CT_ExtensionList; + name?: string; + xfId?: number; + builtinId?: number; + iLevel?: number; + hidden?: boolean; + customBuiltin?: boolean; +} + +export const CT_CellStyle_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + name: { + type: 'string' + }, + xfId: { + type: 'int' + }, + builtinId: { + type: 'int' + }, + iLevel: { + type: 'int' + }, + hidden: { + type: 'boolean' + }, + customBuiltin: { + type: 'boolean' + } +}; + +export interface CT_CellStyles { + cellStyle?: CT_CellStyle[]; + count?: number; +} + +export const CT_CellStyles_Attributes: Attributes = { + cellStyle: { + type: 'child', + childAttributes: CT_CellStyle_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Dxfs { + dxf?: CT_Dxf[]; + count?: number; +} + +export const CT_Dxfs_Attributes: Attributes = { + dxf: { + type: 'child', + childAttributes: CT_Dxf_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_TableStyles { + tableStyle?: CT_TableStyle[]; + count?: number; + defaultTableStyle?: string; + defaultPivotStyle?: string; +} + +export const CT_TableStyles_Attributes: Attributes = { + tableStyle: { + type: 'child', + childAttributes: CT_TableStyle_Attributes, + childIsArray: true + }, + count: { + type: 'int' + }, + defaultTableStyle: { + type: 'string' + }, + defaultPivotStyle: { + type: 'string' + } +}; + +export interface CT_RgbColor { + rgb?: string; +} + +export const CT_RgbColor_Attributes: Attributes = { + rgb: { + type: 'string' + } +}; + +export interface CT_IndexedColors { + rgbColor?: CT_RgbColor[]; +} + +export const CT_IndexedColors_Attributes: Attributes = { + rgbColor: { + type: 'child', + childAttributes: CT_RgbColor_Attributes, + childIsArray: true + } +}; + +export interface CT_MRUColors { + color?: CT_Color[]; +} + +export const CT_MRUColors_Attributes: Attributes = { + color: { + type: 'child', + childAttributes: CT_Color_Attributes, + childIsArray: true + } +}; + +export interface CT_Colors { + indexedColors?: CT_IndexedColors; + mruColors?: CT_MRUColors; +} + +export const CT_Colors_Attributes: Attributes = { + indexedColors: { + type: 'child', + childAttributes: CT_IndexedColors_Attributes + }, + mruColors: { + type: 'child', + childAttributes: CT_MRUColors_Attributes + } +}; + +export interface CT_Stylesheet { + numFmts?: CT_NumFmts; + fonts?: CT_Fonts; + fills?: CT_Fills; + borders?: CT_Borders; + cellStyleXfs?: CT_CellStyleXfs; + cellXfs?: CT_CellXfs; + cellStyles?: CT_CellStyles; + dxfs?: CT_Dxfs; + tableStyles?: CT_TableStyles; + colors?: CT_Colors; + extLst?: CT_ExtensionList; +} + +export const CT_Stylesheet_Attributes: Attributes = { + numFmts: { + type: 'child', + childAttributes: CT_NumFmts_Attributes + }, + fonts: { + type: 'child', + childAttributes: CT_Fonts_Attributes + }, + fills: { + type: 'child', + childAttributes: CT_Fills_Attributes + }, + borders: { + type: 'child', + childAttributes: CT_Borders_Attributes + }, + cellStyleXfs: { + type: 'child', + childAttributes: CT_CellStyleXfs_Attributes + }, + cellXfs: { + type: 'child', + childAttributes: CT_CellXfs_Attributes + }, + cellStyles: { + type: 'child', + childAttributes: CT_CellStyles_Attributes + }, + dxfs: { + type: 'child', + childAttributes: CT_Dxfs_Attributes + }, + tableStyles: { + type: 'child', + childAttributes: CT_TableStyles_Attributes + }, + colors: { + type: 'child', + childAttributes: CT_Colors_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + } +}; + +export type ST_TextRotation = undefined; + +export interface CT_ExternalSheetName { + val?: string; +} + +export const CT_ExternalSheetName_Attributes: Attributes = { + val: { + type: 'string' + } +}; + +export interface CT_ExternalSheetNames { + sheetName?: CT_ExternalSheetName[]; +} + +export const CT_ExternalSheetNames_Attributes: Attributes = { + sheetName: { + type: 'child', + childAttributes: CT_ExternalSheetName_Attributes, + childIsArray: true + } +}; + +export interface CT_ExternalDefinedName { + name?: string; + refersTo?: string; + sheetId?: number; +} + +export const CT_ExternalDefinedName_Attributes: Attributes = { + name: { + type: 'string' + }, + refersTo: { + type: 'string' + }, + sheetId: { + type: 'int' + } +}; + +export interface CT_ExternalDefinedNames { + definedName?: CT_ExternalDefinedName[]; +} + +export const CT_ExternalDefinedNames_Attributes: Attributes = { + definedName: { + type: 'child', + childAttributes: CT_ExternalDefinedName_Attributes, + childIsArray: true + } +}; + +export interface CT_ExternalCell { + v?: string; + r?: string; + t?: ST_CellType; + vm?: number; +} + +export const CT_ExternalCell_Attributes: Attributes = { + v: { + type: 'child-string' + }, + r: { + type: 'string' + }, + t: { + type: 'string', + defaultValue: 'n' + }, + vm: { + type: 'int', + defaultValue: '0' + } +}; + +export interface CT_ExternalRow { + cell?: CT_ExternalCell[]; + r?: number; +} + +export const CT_ExternalRow_Attributes: Attributes = { + cell: { + type: 'child', + childAttributes: CT_ExternalCell_Attributes, + childIsArray: true + }, + r: { + type: 'int' + } +}; + +export interface CT_ExternalSheetData { + row?: CT_ExternalRow[]; + sheetId?: number; + refreshError?: boolean; +} + +export const CT_ExternalSheetData_Attributes: Attributes = { + row: { + type: 'child', + childAttributes: CT_ExternalRow_Attributes, + childIsArray: true + }, + sheetId: { + type: 'int' + }, + refreshError: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_ExternalSheetDataSet { + sheetData?: CT_ExternalSheetData[]; +} + +export const CT_ExternalSheetDataSet_Attributes: Attributes = { + sheetData: { + type: 'child', + childAttributes: CT_ExternalSheetData_Attributes, + childIsArray: true + } +}; + +export interface CT_ExternalBook { + 'sheetNames'?: CT_ExternalSheetNames; + 'definedNames'?: CT_ExternalDefinedNames; + 'sheetDataSet'?: CT_ExternalSheetDataSet; + 'r:id'?: string; +} + +export const CT_ExternalBook_Attributes: Attributes = { + 'sheetNames': { + type: 'child', + childAttributes: CT_ExternalSheetNames_Attributes + }, + 'definedNames': { + type: 'child', + childAttributes: CT_ExternalDefinedNames_Attributes + }, + 'sheetDataSet': { + type: 'child', + childAttributes: CT_ExternalSheetDataSet_Attributes + }, + 'r:id': { + type: 'string' + } +}; + +export type ST_DdeValueType = 'nil' | 'b' | 'n' | 'e' | 'str'; + +export interface CT_DdeValue { + val?: string; + t?: ST_DdeValueType; +} + +export const CT_DdeValue_Attributes: Attributes = { + val: { + type: 'child-string' + }, + t: { + type: 'string', + defaultValue: 'n' + } +}; + +export interface CT_DdeValues { + value?: CT_DdeValue[]; + rows?: number; + cols?: number; +} + +export const CT_DdeValues_Attributes: Attributes = { + value: { + type: 'child', + childAttributes: CT_DdeValue_Attributes, + childIsArray: true + }, + rows: { + type: 'int', + defaultValue: '1' + }, + cols: { + type: 'int', + defaultValue: '1' + } +}; + +export interface CT_DdeItem { + values?: CT_DdeValues; + name?: string; + ole?: boolean; + advise?: boolean; + preferPic?: boolean; +} + +export const CT_DdeItem_Attributes: Attributes = { + values: { + type: 'child', + childAttributes: CT_DdeValues_Attributes + }, + name: { + type: 'string', + defaultValue: '0' + }, + ole: { + type: 'boolean', + defaultValue: 'false' + }, + advise: { + type: 'boolean', + defaultValue: 'false' + }, + preferPic: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_DdeItems { + ddeItem?: CT_DdeItem[]; +} + +export const CT_DdeItems_Attributes: Attributes = { + ddeItem: { + type: 'child', + childAttributes: CT_DdeItem_Attributes, + childIsArray: true + } +}; + +export interface CT_DdeLink { + ddeItems?: CT_DdeItems; + ddeService?: string; + ddeTopic?: string; +} + +export const CT_DdeLink_Attributes: Attributes = { + ddeItems: { + type: 'child', + childAttributes: CT_DdeItems_Attributes + }, + ddeService: { + type: 'string' + }, + ddeTopic: { + type: 'string' + } +}; + +export interface CT_OleItem { + name?: string; + icon?: boolean; + advise?: boolean; + preferPic?: boolean; +} + +export const CT_OleItem_Attributes: Attributes = { + name: { + type: 'string' + }, + icon: { + type: 'boolean', + defaultValue: 'false' + }, + advise: { + type: 'boolean', + defaultValue: 'false' + }, + preferPic: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_OleItems { + oleItem?: CT_OleItem[]; +} + +export const CT_OleItems_Attributes: Attributes = { + oleItem: { + type: 'child', + childAttributes: CT_OleItem_Attributes, + childIsArray: true + } +}; + +export interface CT_OleLink { + 'oleItems'?: CT_OleItems; + 'r:id'?: string; + 'progId'?: string; +} + +export const CT_OleLink_Attributes: Attributes = { + 'oleItems': { + type: 'child', + childAttributes: CT_OleItems_Attributes + }, + 'r:id': { + type: 'string' + }, + 'progId': { + type: 'string' + } +}; + +export interface CT_ExternalLink { + externalBook?: CT_ExternalBook; + ddeLink?: CT_DdeLink; + oleLink?: CT_OleLink; + extLst?: CT_ExtensionList[]; +} + +export const CT_ExternalLink_Attributes: Attributes = { + externalBook: { + type: 'child', + childAttributes: CT_ExternalBook_Attributes + }, + ddeLink: { + type: 'child', + childAttributes: CT_DdeLink_Attributes + }, + oleLink: { + type: 'child', + childAttributes: CT_OleLink_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_TableFormula {} + +export const CT_TableFormula_Attributes: Attributes = {}; + +export interface CT_XmlColumnPr { + extLst?: CT_ExtensionList; + mapId?: number; + xpath?: string; + denormalized?: boolean; + xmlDataType?: string; +} + +export const CT_XmlColumnPr_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + mapId: { + type: 'int' + }, + xpath: { + type: 'string' + }, + denormalized: { + type: 'boolean', + defaultValue: 'false' + }, + xmlDataType: { + type: 'string' + } +}; + +export type ST_TotalsRowFunction = + | 'none' + | 'sum' + | 'min' + | 'max' + | 'average' + | 'count' + | 'countNums' + | 'stdDev' + | 'var' + | 'custom'; + +export interface CT_TableColumn { + calculatedColumnFormula?: CT_TableFormula; + totalsRowFormula?: CT_TableFormula; + xmlColumnPr?: CT_XmlColumnPr; + extLst?: CT_ExtensionList; + id?: number; + uniqueName?: string; + name?: string; + totalsRowFunction?: ST_TotalsRowFunction; + totalsRowLabel?: string; + queryTableFieldId?: number; + headerRowDxfId?: number; + dataDxfId?: number; + totalsRowDxfId?: number; + headerRowCellStyle?: string; + dataCellStyle?: string; + totalsRowCellStyle?: string; +} + +export const CT_TableColumn_Attributes: Attributes = { + calculatedColumnFormula: { + type: 'child', + childAttributes: CT_TableFormula_Attributes + }, + totalsRowFormula: { + type: 'child', + childAttributes: CT_TableFormula_Attributes + }, + xmlColumnPr: { + type: 'child', + childAttributes: CT_XmlColumnPr_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + id: { + type: 'int' + }, + uniqueName: { + type: 'string' + }, + name: { + type: 'string' + }, + totalsRowFunction: { + type: 'string', + defaultValue: 'none' + }, + totalsRowLabel: { + type: 'string' + }, + queryTableFieldId: { + type: 'int' + }, + headerRowDxfId: { + type: 'int' + }, + dataDxfId: { + type: 'int' + }, + totalsRowDxfId: { + type: 'int' + }, + headerRowCellStyle: { + type: 'string' + }, + dataCellStyle: { + type: 'string' + }, + totalsRowCellStyle: { + type: 'string' + } +}; + +export interface CT_TableColumns { + tableColumn?: CT_TableColumn[]; + count?: number; +} + +export const CT_TableColumns_Attributes: Attributes = { + tableColumn: { + type: 'child', + childAttributes: CT_TableColumn_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_TableStyleInfo { + name?: string; + showFirstColumn?: boolean; + showLastColumn?: boolean; + showRowStripes?: boolean; + showColumnStripes?: boolean; +} + +export const CT_TableStyleInfo_Attributes: Attributes = { + name: { + type: 'string' + }, + showFirstColumn: { + type: 'boolean' + }, + showLastColumn: { + type: 'boolean' + }, + showRowStripes: { + type: 'boolean' + }, + showColumnStripes: { + type: 'boolean' + } +}; + +export type ST_TableType = 'worksheet' | 'xml' | 'queryTable'; + +export interface CT_Table { + autoFilter?: CT_AutoFilter; + sortState?: CT_SortState; + tableColumns?: CT_TableColumns; + tableStyleInfo?: CT_TableStyleInfo; + extLst?: CT_ExtensionList; + id?: number; + name?: string; + displayName?: string; + comment?: string; + ref?: string; + tableType?: ST_TableType; + headerRowCount?: number; + insertRow?: boolean; + insertRowShift?: boolean; + totalsRowCount?: number; + totalsRowShown?: boolean; + published?: boolean; + headerRowDxfId?: number; + dataDxfId?: number; + totalsRowDxfId?: number; + headerRowBorderDxfId?: number; + tableBorderDxfId?: number; + totalsRowBorderDxfId?: number; + headerRowCellStyle?: string; + dataCellStyle?: string; + totalsRowCellStyle?: string; + connectionId?: number; +} + +export const CT_Table_Attributes: Attributes = { + autoFilter: { + type: 'child', + childAttributes: CT_AutoFilter_Attributes + }, + sortState: { + type: 'child', + childAttributes: CT_SortState_Attributes + }, + tableColumns: { + type: 'child', + childAttributes: CT_TableColumns_Attributes + }, + tableStyleInfo: { + type: 'child', + childAttributes: CT_TableStyleInfo_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + id: { + type: 'int' + }, + name: { + type: 'string' + }, + displayName: { + type: 'string' + }, + comment: { + type: 'string' + }, + ref: { + type: 'string' + }, + tableType: { + type: 'string', + defaultValue: 'worksheet' + }, + headerRowCount: { + type: 'int', + defaultValue: '1' + }, + insertRow: { + type: 'boolean', + defaultValue: 'false' + }, + insertRowShift: { + type: 'boolean', + defaultValue: 'false' + }, + totalsRowCount: { + type: 'int', + defaultValue: '0' + }, + totalsRowShown: { + type: 'boolean', + defaultValue: 'true' + }, + published: { + type: 'boolean', + defaultValue: 'false' + }, + headerRowDxfId: { + type: 'int' + }, + dataDxfId: { + type: 'int' + }, + totalsRowDxfId: { + type: 'int' + }, + headerRowBorderDxfId: { + type: 'int' + }, + tableBorderDxfId: { + type: 'int' + }, + totalsRowBorderDxfId: { + type: 'int' + }, + headerRowCellStyle: { + type: 'string' + }, + dataCellStyle: { + type: 'string' + }, + totalsRowCellStyle: { + type: 'string' + }, + connectionId: { + type: 'int' + } +}; + +export interface CT_VolTopicRef { + r?: string; + s?: number; +} + +export const CT_VolTopicRef_Attributes: Attributes = { + r: { + type: 'string' + }, + s: { + type: 'int' + } +}; + +export type ST_VolValueType = 'b' | 'n' | 'e' | 's'; + +export interface CT_VolTopic { + v?: string; + stp?: string[]; + tr?: CT_VolTopicRef[]; + t?: ST_VolValueType; +} + +export const CT_VolTopic_Attributes: Attributes = { + v: { + type: 'child-string' + }, + stp: { + type: 'child-string', + childIsArray: true + }, + tr: { + type: 'child', + childAttributes: CT_VolTopicRef_Attributes, + childIsArray: true + }, + t: { + type: 'string', + defaultValue: 'n' + } +}; + +export interface CT_VolMain { + tp?: CT_VolTopic[]; + first?: string; +} + +export const CT_VolMain_Attributes: Attributes = { + tp: { + type: 'child', + childAttributes: CT_VolTopic_Attributes, + childIsArray: true + }, + first: { + type: 'string' + } +}; + +export type ST_VolDepType = 'realTimeData' | 'olapFunctions'; + +export interface CT_VolType { + main?: CT_VolMain[]; + type?: ST_VolDepType; +} + +export const CT_VolType_Attributes: Attributes = { + main: { + type: 'child', + childAttributes: CT_VolMain_Attributes, + childIsArray: true + }, + type: { + type: 'string' + } +}; + +export interface CT_VolTypes { + volType?: CT_VolType[]; + extLst?: CT_ExtensionList[]; +} + +export const CT_VolTypes_Attributes: Attributes = { + volType: { + type: 'child', + childAttributes: CT_VolType_Attributes, + childIsArray: true + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + } +}; + +export interface CT_FileVersion { + appName?: string; + lastEdited?: string; + lowestEdited?: string; + rupBuild?: string; + codeName?: string; +} + +export const CT_FileVersion_Attributes: Attributes = { + appName: { + type: 'string' + }, + lastEdited: { + type: 'string' + }, + lowestEdited: { + type: 'string' + }, + rupBuild: { + type: 'string' + }, + codeName: { + type: 'string' + } +}; + +export interface CT_FileSharing { + readOnlyRecommended?: boolean; + userName?: string; + algorithmName?: string; + hashValue?: string; + saltValue?: string; + spinCount?: number; +} + +export const CT_FileSharing_Attributes: Attributes = { + readOnlyRecommended: { + type: 'boolean', + defaultValue: 'false' + }, + userName: { + type: 'string' + }, + algorithmName: { + type: 'string' + }, + hashValue: { + type: 'string' + }, + saltValue: { + type: 'string' + }, + spinCount: { + type: 'int' + } +}; + +export type ST_Objects = 'all' | 'placeholders' | 'none'; + +export type ST_UpdateLinks = 'userSet' | 'never' | 'always'; + +export interface CT_WorkbookPr { + date1904?: boolean; + showObjects?: ST_Objects; + showBorderUnselectedTables?: boolean; + filterPrivacy?: boolean; + promptedSolutions?: boolean; + showInkAnnotation?: boolean; + backupFile?: boolean; + saveExternalLinkValues?: boolean; + updateLinks?: ST_UpdateLinks; + codeName?: string; + hidePivotFieldList?: boolean; + showPivotChartFilter?: boolean; + allowRefreshQuery?: boolean; + publishItems?: boolean; + checkCompatibility?: boolean; + autoCompressPictures?: boolean; + refreshAllConnections?: boolean; + defaultThemeVersion?: number; +} + +export const CT_WorkbookPr_Attributes: Attributes = { + date1904: { + type: 'boolean', + defaultValue: 'false' + }, + showObjects: { + type: 'string', + defaultValue: 'all' + }, + showBorderUnselectedTables: { + type: 'boolean', + defaultValue: 'true' + }, + filterPrivacy: { + type: 'boolean', + defaultValue: 'false' + }, + promptedSolutions: { + type: 'boolean', + defaultValue: 'false' + }, + showInkAnnotation: { + type: 'boolean', + defaultValue: 'true' + }, + backupFile: { + type: 'boolean', + defaultValue: 'false' + }, + saveExternalLinkValues: { + type: 'boolean', + defaultValue: 'true' + }, + updateLinks: { + type: 'string', + defaultValue: 'userSet' + }, + codeName: { + type: 'string' + }, + hidePivotFieldList: { + type: 'boolean', + defaultValue: 'false' + }, + showPivotChartFilter: { + type: 'boolean', + defaultValue: 'false' + }, + allowRefreshQuery: { + type: 'boolean', + defaultValue: 'false' + }, + publishItems: { + type: 'boolean', + defaultValue: 'false' + }, + checkCompatibility: { + type: 'boolean', + defaultValue: 'false' + }, + autoCompressPictures: { + type: 'boolean', + defaultValue: 'true' + }, + refreshAllConnections: { + type: 'boolean', + defaultValue: 'false' + }, + defaultThemeVersion: { + type: 'int' + } +}; + +export interface CT_WorkbookProtection { + lockStructure?: boolean; + lockWindows?: boolean; + lockRevision?: boolean; + revisionsAlgorithmName?: string; + revisionsHashValue?: string; + revisionsSaltValue?: string; + revisionsSpinCount?: number; + workbookAlgorithmName?: string; + workbookHashValue?: string; + workbookSaltValue?: string; + workbookSpinCount?: number; +} + +export const CT_WorkbookProtection_Attributes: Attributes = { + lockStructure: { + type: 'boolean', + defaultValue: 'false' + }, + lockWindows: { + type: 'boolean', + defaultValue: 'false' + }, + lockRevision: { + type: 'boolean', + defaultValue: 'false' + }, + revisionsAlgorithmName: { + type: 'string' + }, + revisionsHashValue: { + type: 'string' + }, + revisionsSaltValue: { + type: 'string' + }, + revisionsSpinCount: { + type: 'int' + }, + workbookAlgorithmName: { + type: 'string' + }, + workbookHashValue: { + type: 'string' + }, + workbookSaltValue: { + type: 'string' + }, + workbookSpinCount: { + type: 'int' + } +}; + +export type ST_Visibility = 'visible' | 'hidden' | 'veryHidden'; + +export interface CT_BookView { + extLst?: CT_ExtensionList; + visibility?: ST_Visibility; + minimized?: boolean; + showHorizontalScroll?: boolean; + showVerticalScroll?: boolean; + showSheetTabs?: boolean; + xWindow?: number; + yWindow?: number; + windowWidth?: number; + windowHeight?: number; + tabRatio?: number; + firstSheet?: number; + activeTab?: number; + autoFilterDateGrouping?: boolean; +} + +export const CT_BookView_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + visibility: { + type: 'string', + defaultValue: 'visible' + }, + minimized: { + type: 'boolean', + defaultValue: 'false' + }, + showHorizontalScroll: { + type: 'boolean', + defaultValue: 'true' + }, + showVerticalScroll: { + type: 'boolean', + defaultValue: 'true' + }, + showSheetTabs: { + type: 'boolean', + defaultValue: 'true' + }, + xWindow: { + type: 'int' + }, + yWindow: { + type: 'int' + }, + windowWidth: { + type: 'int' + }, + windowHeight: { + type: 'int' + }, + tabRatio: { + type: 'int', + defaultValue: '600' + }, + firstSheet: { + type: 'int', + defaultValue: '0' + }, + activeTab: { + type: 'int', + defaultValue: '0' + }, + autoFilterDateGrouping: { + type: 'boolean', + defaultValue: 'true' + } +}; + +export interface CT_BookViews { + workbookView?: CT_BookView[]; +} + +export const CT_BookViews_Attributes: Attributes = { + workbookView: { + type: 'child', + childAttributes: CT_BookView_Attributes, + childIsArray: true + } +}; + +export interface CT_Sheet { + 'name'?: string; + 'sheetId'?: number; + 'state'?: ST_SheetState; + 'r:id'?: string; +} + +export const CT_Sheet_Attributes: Attributes = { + 'name': { + type: 'string' + }, + 'sheetId': { + type: 'int' + }, + 'state': { + type: 'string', + defaultValue: 'visible' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_Sheets { + sheet?: CT_Sheet[]; +} + +export const CT_Sheets_Attributes: Attributes = { + sheet: { + type: 'child', + childAttributes: CT_Sheet_Attributes, + childIsArray: true + } +}; + +export interface CT_FunctionGroup { + name?: string; +} + +export const CT_FunctionGroup_Attributes: Attributes = { + name: { + type: 'string' + } +}; + +export interface CT_FunctionGroups { + functionGroup?: CT_FunctionGroup[]; + builtInGroupCount?: number; +} + +export const CT_FunctionGroups_Attributes: Attributes = { + functionGroup: { + type: 'child', + childAttributes: CT_FunctionGroup_Attributes, + childIsArray: true + }, + builtInGroupCount: { + type: 'int', + defaultValue: '16' + } +}; + +export interface CT_ExternalReference { + 'r:id'?: string; +} + +export const CT_ExternalReference_Attributes: Attributes = { + 'r:id': { + type: 'string' + } +}; + +export interface CT_ExternalReferences { + externalReference?: CT_ExternalReference[]; +} + +export const CT_ExternalReferences_Attributes: Attributes = { + externalReference: { + type: 'child', + childAttributes: CT_ExternalReference_Attributes, + childIsArray: true + } +}; + +export interface CT_DefinedName {} + +export const CT_DefinedName_Attributes: Attributes = {}; + +export interface CT_DefinedNames { + definedName?: CT_DefinedName[]; +} + +export const CT_DefinedNames_Attributes: Attributes = { + definedName: { + type: 'child', + childAttributes: CT_DefinedName_Attributes, + childIsArray: true + } +}; + +export type ST_CalcMode = 'manual' | 'auto' | 'autoNoTable'; + +export type ST_RefMode = 'A1' | 'R1C1'; + +export interface CT_CalcPr { + calcId?: number; + calcMode?: ST_CalcMode; + fullCalcOnLoad?: boolean; + refMode?: ST_RefMode; + iterate?: boolean; + iterateCount?: number; + iterateDelta?: number; + fullPrecision?: boolean; + calcCompleted?: boolean; + calcOnSave?: boolean; + concurrentCalc?: boolean; + concurrentManualCount?: number; + forceFullCalc?: boolean; +} + +export const CT_CalcPr_Attributes: Attributes = { + calcId: { + type: 'int' + }, + calcMode: { + type: 'string', + defaultValue: 'auto' + }, + fullCalcOnLoad: { + type: 'boolean', + defaultValue: 'false' + }, + refMode: { + type: 'string', + defaultValue: 'A1' + }, + iterate: { + type: 'boolean', + defaultValue: 'false' + }, + iterateCount: { + type: 'int', + defaultValue: '100' + }, + iterateDelta: { + type: 'double', + defaultValue: '0.001' + }, + fullPrecision: { + type: 'boolean', + defaultValue: 'true' + }, + calcCompleted: { + type: 'boolean', + defaultValue: 'true' + }, + calcOnSave: { + type: 'boolean', + defaultValue: 'true' + }, + concurrentCalc: { + type: 'boolean', + defaultValue: 'true' + }, + concurrentManualCount: { + type: 'int' + }, + forceFullCalc: { + type: 'boolean' + } +}; + +export interface CT_OleSize { + ref?: string; +} + +export const CT_OleSize_Attributes: Attributes = { + ref: { + type: 'string' + } +}; + +export type ST_Comments = 'commNone' | 'commIndicator' | 'commIndAndComment'; + +export interface CT_CustomWorkbookView { + extLst?: CT_ExtensionList[]; + name?: string; + guid?: string; + autoUpdate?: boolean; + mergeInterval?: number; + changesSavedWin?: boolean; + onlySync?: boolean; + personalView?: boolean; + includePrintSettings?: boolean; + includeHiddenRowCol?: boolean; + maximized?: boolean; + minimized?: boolean; + showHorizontalScroll?: boolean; + showVerticalScroll?: boolean; + showSheetTabs?: boolean; + xWindow?: number; + yWindow?: number; + windowWidth?: number; + windowHeight?: number; + tabRatio?: number; + activeSheetId?: number; + showFormulaBar?: boolean; + showStatusbar?: boolean; + showComments?: ST_Comments; + showObjects?: ST_Objects; +} + +export const CT_CustomWorkbookView_Attributes: Attributes = { + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes, + childIsArray: true + }, + name: { + type: 'string' + }, + guid: { + type: 'string' + }, + autoUpdate: { + type: 'boolean', + defaultValue: 'false' + }, + mergeInterval: { + type: 'int' + }, + changesSavedWin: { + type: 'boolean', + defaultValue: 'false' + }, + onlySync: { + type: 'boolean', + defaultValue: 'false' + }, + personalView: { + type: 'boolean', + defaultValue: 'false' + }, + includePrintSettings: { + type: 'boolean', + defaultValue: 'true' + }, + includeHiddenRowCol: { + type: 'boolean', + defaultValue: 'true' + }, + maximized: { + type: 'boolean', + defaultValue: 'false' + }, + minimized: { + type: 'boolean', + defaultValue: 'false' + }, + showHorizontalScroll: { + type: 'boolean', + defaultValue: 'true' + }, + showVerticalScroll: { + type: 'boolean', + defaultValue: 'true' + }, + showSheetTabs: { + type: 'boolean', + defaultValue: 'true' + }, + xWindow: { + type: 'int', + defaultValue: '0' + }, + yWindow: { + type: 'int', + defaultValue: '0' + }, + windowWidth: { + type: 'int' + }, + windowHeight: { + type: 'int' + }, + tabRatio: { + type: 'int', + defaultValue: '600' + }, + activeSheetId: { + type: 'int' + }, + showFormulaBar: { + type: 'boolean', + defaultValue: 'true' + }, + showStatusbar: { + type: 'boolean', + defaultValue: 'true' + }, + showComments: { + type: 'string', + defaultValue: 'commIndicator' + }, + showObjects: { + type: 'string', + defaultValue: 'all' + } +}; + +export interface CT_CustomWorkbookViews { + customWorkbookView?: CT_CustomWorkbookView[]; +} + +export const CT_CustomWorkbookViews_Attributes: Attributes = { + customWorkbookView: { + type: 'child', + childAttributes: CT_CustomWorkbookView_Attributes, + childIsArray: true + } +}; + +export interface CT_PivotCache { + 'cacheId'?: number; + 'r:id'?: string; +} + +export const CT_PivotCache_Attributes: Attributes = { + 'cacheId': { + type: 'int' + }, + 'r:id': { + type: 'string' + } +}; + +export interface CT_PivotCaches { + pivotCache?: CT_PivotCache[]; +} + +export const CT_PivotCaches_Attributes: Attributes = { + pivotCache: { + type: 'child', + childAttributes: CT_PivotCache_Attributes, + childIsArray: true + } +}; + +export type ST_SmartTagShow = 'all' | 'none' | 'noIndicator'; + +export interface CT_SmartTagPr { + embed?: boolean; + show?: ST_SmartTagShow; +} + +export const CT_SmartTagPr_Attributes: Attributes = { + embed: { + type: 'boolean', + defaultValue: 'false' + }, + show: { + type: 'string', + defaultValue: 'all' + } +}; + +export interface CT_SmartTagType { + namespaceUri?: string; + name?: string; + url?: string; +} + +export const CT_SmartTagType_Attributes: Attributes = { + namespaceUri: { + type: 'string' + }, + name: { + type: 'string' + }, + url: { + type: 'string' + } +}; + +export interface CT_SmartTagTypes { + smartTagType?: CT_SmartTagType[]; +} + +export const CT_SmartTagTypes_Attributes: Attributes = { + smartTagType: { + type: 'child', + childAttributes: CT_SmartTagType_Attributes, + childIsArray: true + } +}; + +export type ST_TargetScreenSize = + | '544x376' + | '640x480' + | '720x512' + | '800x600' + | '1024x768' + | '1152x882' + | '1152x900' + | '1280x1024' + | '1600x1200' + | '1800x1440' + | '1920x1200'; + +export interface CT_WebPublishing { + css?: boolean; + thicket?: boolean; + longFileNames?: boolean; + vml?: boolean; + allowPng?: boolean; + targetScreenSize?: ST_TargetScreenSize; + dpi?: number; + characterSet?: string; +} + +export const CT_WebPublishing_Attributes: Attributes = { + css: { + type: 'boolean', + defaultValue: 'true' + }, + thicket: { + type: 'boolean', + defaultValue: 'true' + }, + longFileNames: { + type: 'boolean', + defaultValue: 'true' + }, + vml: { + type: 'boolean', + defaultValue: 'false' + }, + allowPng: { + type: 'boolean', + defaultValue: 'false' + }, + targetScreenSize: { + type: 'string', + defaultValue: '800x600' + }, + dpi: { + type: 'int', + defaultValue: '96' + }, + characterSet: { + type: 'string' + } +}; + +export interface CT_FileRecoveryPr { + autoRecover?: boolean; + crashSave?: boolean; + dataExtractLoad?: boolean; + repairLoad?: boolean; +} + +export const CT_FileRecoveryPr_Attributes: Attributes = { + autoRecover: { + type: 'boolean', + defaultValue: 'true' + }, + crashSave: { + type: 'boolean', + defaultValue: 'false' + }, + dataExtractLoad: { + type: 'boolean', + defaultValue: 'false' + }, + repairLoad: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_WebPublishObject { + id?: number; + divId?: string; + sourceObject?: string; + destinationFile?: string; + title?: string; + autoRepublish?: boolean; +} + +export const CT_WebPublishObject_Attributes: Attributes = { + id: { + type: 'int' + }, + divId: { + type: 'string' + }, + sourceObject: { + type: 'string' + }, + destinationFile: { + type: 'string' + }, + title: { + type: 'string' + }, + autoRepublish: { + type: 'boolean', + defaultValue: 'false' + } +}; + +export interface CT_WebPublishObjects { + webPublishObject?: CT_WebPublishObject[]; + count?: number; +} + +export const CT_WebPublishObjects_Attributes: Attributes = { + webPublishObject: { + type: 'child', + childAttributes: CT_WebPublishObject_Attributes, + childIsArray: true + }, + count: { + type: 'int' + } +}; + +export interface CT_Workbook { + fileVersion?: CT_FileVersion; + fileSharing?: CT_FileSharing; + workbookPr?: CT_WorkbookPr; + workbookProtection?: CT_WorkbookProtection; + bookViews?: CT_BookViews; + sheets?: CT_Sheets; + functionGroups?: CT_FunctionGroups; + externalReferences?: CT_ExternalReferences; + definedNames?: CT_DefinedNames; + calcPr?: CT_CalcPr; + oleSize?: CT_OleSize; + customWorkbookViews?: CT_CustomWorkbookViews; + pivotCaches?: CT_PivotCaches; + smartTagPr?: CT_SmartTagPr; + smartTagTypes?: CT_SmartTagTypes; + webPublishing?: CT_WebPublishing; + fileRecoveryPr?: CT_FileRecoveryPr[]; + webPublishObjects?: CT_WebPublishObjects; + extLst?: CT_ExtensionList; + conformance?: ST_ConformanceClass; +} + +export const CT_Workbook_Attributes: Attributes = { + fileVersion: { + type: 'child', + childAttributes: CT_FileVersion_Attributes + }, + fileSharing: { + type: 'child', + childAttributes: CT_FileSharing_Attributes + }, + workbookPr: { + type: 'child', + childAttributes: CT_WorkbookPr_Attributes + }, + workbookProtection: { + type: 'child', + childAttributes: CT_WorkbookProtection_Attributes + }, + bookViews: { + type: 'child', + childAttributes: CT_BookViews_Attributes + }, + sheets: { + type: 'child', + childAttributes: CT_Sheets_Attributes + }, + functionGroups: { + type: 'child', + childAttributes: CT_FunctionGroups_Attributes + }, + externalReferences: { + type: 'child', + childAttributes: CT_ExternalReferences_Attributes + }, + definedNames: { + type: 'child', + childAttributes: CT_DefinedNames_Attributes + }, + calcPr: { + type: 'child', + childAttributes: CT_CalcPr_Attributes + }, + oleSize: { + type: 'child', + childAttributes: CT_OleSize_Attributes + }, + customWorkbookViews: { + type: 'child', + childAttributes: CT_CustomWorkbookViews_Attributes + }, + pivotCaches: { + type: 'child', + childAttributes: CT_PivotCaches_Attributes + }, + smartTagPr: { + type: 'child', + childAttributes: CT_SmartTagPr_Attributes + }, + smartTagTypes: { + type: 'child', + childAttributes: CT_SmartTagTypes_Attributes + }, + webPublishing: { + type: 'child', + childAttributes: CT_WebPublishing_Attributes + }, + fileRecoveryPr: { + type: 'child', + childAttributes: CT_FileRecoveryPr_Attributes, + childIsArray: true + }, + webPublishObjects: { + type: 'child', + childAttributes: CT_WebPublishObjects_Attributes + }, + extLst: { + type: 'child', + childAttributes: CT_ExtensionList_Attributes + }, + conformance: { + type: 'string' + } +}; diff --git a/packages/office-viewer/src/openxml/Style.ts b/packages/office-viewer/src/openxml/Style.ts index 2803ec738..99840b622 100644 --- a/packages/office-viewer/src/openxml/Style.ts +++ b/packages/office-viewer/src/openxml/Style.ts @@ -2,7 +2,7 @@ * 解析共享样式 Style */ -import {parseTcPr} from '../parse/parseTcPr'; +import {parseTcPr} from '../word/parse/parseTcPr'; import {getVal} from '../OpenXML'; import Word from '../Word'; import {ST_StyleType, ST_TblStyleOverrideType} from './Types'; @@ -11,8 +11,8 @@ import {Run, RunPr} from './word/Run'; import {TablePr} from './word/Table'; import {TcPr} from './word/table/Tc'; import {Tr, TrPr} from './word/table/Tr'; -import {parseTablePr} from '../parse/parseTablePr'; -import {parseTrPr} from '../parse/parseTrPr'; +import {parseTablePr} from '../word/parse/parseTablePr'; +import {parseTrPr} from '../word/parse/parseTrPr'; export interface CSSStyle { [key: string]: string | number; diff --git a/packages/office-viewer/src/openxml/Theme.ts b/packages/office-viewer/src/openxml/Theme.ts index 7ee612ea1..628e597c9 100644 --- a/packages/office-viewer/src/openxml/Theme.ts +++ b/packages/office-viewer/src/openxml/Theme.ts @@ -2,7 +2,7 @@ * 主要参考 14.2.7 Theme Part */ -import {convertAngle} from '../parse/parseSize'; +import {convertAngle} from '../word/parse/parseSize'; import {getAttrNumber, getAttrPercent, getVal} from '../OpenXML'; import {Color} from '../util/color'; diff --git a/packages/office-viewer/src/openxml/Types.ts b/packages/office-viewer/src/openxml/Types.ts index ff86af1e8..2225fd011 100644 --- a/packages/office-viewer/src/openxml/Types.ts +++ b/packages/office-viewer/src/openxml/Types.ts @@ -1,7 +1,11 @@ -/** generated by tools/xsd2ts.ts, do not edit */ +import {Attributes} from './Attributes'; + export type ST_Lang = string; + export type ST_HexColorRGB = string; + export type ST_Panose = string; + export type ST_CalendarType = | 'gregorian' | 'gregorianUs' @@ -17,19 +21,27 @@ export type ST_CalendarType = | 'gregorianXlitEnglish' | 'gregorianXlitFrench' | 'none'; + export type ST_Guid = string; + export type ST_OnOff = boolean; export type ST_String = string; + export type ST_XmlName = string; + export type ST_UnsignedDecimalNumber = number; + export type ST_TwipsMeasure = | ST_UnsignedDecimalNumber | ST_PositiveUniversalMeasure; export type ST_VerticalAlignRun = 'baseline' | 'superscript' | 'subscript'; + export type ST_Xstring = string; + export type ST_XAlign = 'left' | 'center' | 'right' | 'inside' | 'outside'; + export type ST_YAlign = | 'inline' | 'top' @@ -37,35 +49,2421 @@ export type ST_YAlign = | 'bottom' | 'inside' | 'outside'; + export type ST_ConformanceClass = 'strict' | 'transitional'; + export type ST_UniversalMeasure = string; + export type ST_PositiveUniversalMeasure = ST_UniversalMeasure; + export type ST_Percentage = string; -export type ST_FixedPercentage = ST_Percentage; -export type ST_PositivePercentage = ST_Percentage; -export type ST_PositiveFixedPercentage = ST_Percentage; -export type ST_LongHexNumber = string; -export type ST_ShortHexNumber = string; + +export type ST_FixedPercentage = string; + +export type ST_PositivePercentage = string; + +export type ST_PositiveFixedPercentage = string; + +export interface CT_OfficeArtExtensionList {} + +export interface CT_AudioFile { + extLst: CT_OfficeArtExtensionList; + contentType: string; +} + +export interface CT_VideoFile { + extLst: CT_OfficeArtExtensionList; + contentType: string; +} + +export interface CT_QuickTimeFile { + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_AudioCDTime { + track: number; + time: number; +} + +export interface CT_AudioCD { + st: CT_AudioCDTime; + end: CT_AudioCDTime; + extLst: CT_OfficeArtExtensionList; +} + +export type ST_StyleMatrixColumnIndex = number; + +export type ST_FontCollectionIndex = 'major' | 'minor' | 'none'; + +export type ST_ColorSchemeIndex = + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink'; + +export type ST_HexColor = ST_HexColorAuto | ST_HexColorRGB; + +export type ST_ThemeColor = + | 'dark1' + | 'light1' + | 'dark2' + | 'light2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hyperlink' + | 'followedHyperlink' + | 'none' + | 'background1' + | 'text1' + | 'background2' + | 'text2'; + export type ST_UcharHexNumber = string; -export type ST_DecimalNumberOrPercent = ST_Percentage; + +export interface CT_Color { + val: ST_HexColor; + themeColor: ST_ThemeColor; + themeTint: string; + themeShade: string; +} + +export interface CT_ColorScheme { + dk1: CT_Color; + lt1: CT_Color; + dk2: CT_Color; + lt2: CT_Color; + accent1: CT_Color; + accent2: CT_Color; + accent3: CT_Color; + accent4: CT_Color; + accent5: CT_Color; + accent6: CT_Color; + hlink: CT_Color; + folHlink: CT_Color; + extLst: CT_OfficeArtExtensionList; + name: string; +} + +export interface CT_CustomColor { + name: string; +} + +export type ST_TextTypeface = string; + +export interface CT_SupplementalFont { + script: string; + typeface: string; +} + +export interface CT_CustomColorList { + custClr: CT_CustomColor[]; +} + +export type ST_PitchFamily = number; + +export interface CT_TextFont { + typeface: string; + panose: string; + pitchFamily: number; + charset: number; +} + +export interface CT_FontCollection { + latin: CT_TextFont; + ea: CT_TextFont; + cs: CT_TextFont; + font: CT_SupplementalFont[]; + extLst: CT_OfficeArtExtensionList; +} + +export type ST_PositiveFixedAngle = ST_Angle; + +export interface CT_SphereCoords { + lat: number; + lon: number; + rev: number; +} + +export type ST_PresetCameraType = + | 'legacyObliqueTopLeft' + | 'legacyObliqueTop' + | 'legacyObliqueTopRight' + | 'legacyObliqueLeft' + | 'legacyObliqueFront' + | 'legacyObliqueRight' + | 'legacyObliqueBottomLeft' + | 'legacyObliqueBottom' + | 'legacyObliqueBottomRight' + | 'legacyPerspectiveTopLeft' + | 'legacyPerspectiveTop' + | 'legacyPerspectiveTopRight' + | 'legacyPerspectiveLeft' + | 'legacyPerspectiveFront' + | 'legacyPerspectiveRight' + | 'legacyPerspectiveBottomLeft' + | 'legacyPerspectiveBottom' + | 'legacyPerspectiveBottomRight' + | 'orthographicFront' + | 'isometricTopUp' + | 'isometricTopDown' + | 'isometricBottomUp' + | 'isometricBottomDown' + | 'isometricLeftUp' + | 'isometricLeftDown' + | 'isometricRightUp' + | 'isometricRightDown' + | 'isometricOffAxis1Left' + | 'isometricOffAxis1Right' + | 'isometricOffAxis1Top' + | 'isometricOffAxis2Left' + | 'isometricOffAxis2Right' + | 'isometricOffAxis2Top' + | 'isometricOffAxis3Left' + | 'isometricOffAxis3Right' + | 'isometricOffAxis3Bottom' + | 'isometricOffAxis4Left' + | 'isometricOffAxis4Right' + | 'isometricOffAxis4Bottom' + | 'obliqueTopLeft' + | 'obliqueTop' + | 'obliqueTopRight' + | 'obliqueLeft' + | 'obliqueRight' + | 'obliqueBottomLeft' + | 'obliqueBottom' + | 'obliqueBottomRight' + | 'perspectiveFront' + | 'perspectiveLeft' + | 'perspectiveRight' + | 'perspectiveAbove' + | 'perspectiveBelow' + | 'perspectiveAboveLeftFacing' + | 'perspectiveAboveRightFacing' + | 'perspectiveContrastingLeftFacing' + | 'perspectiveContrastingRightFacing' + | 'perspectiveHeroicLeftFacing' + | 'perspectiveHeroicRightFacing' + | 'perspectiveHeroicExtremeLeftFacing' + | 'perspectiveHeroicExtremeRightFacing' + | 'perspectiveRelaxed' + | 'perspectiveRelaxedModerately'; + +export type ST_FOVAngle = ST_Angle; + +export interface CT_Camera { + rot: CT_SphereCoords; + prst: ST_PresetCameraType; + fov: number; + zoom: ST_PositivePercentage; +} + +export type ST_LightRigType = + | 'legacyFlat1' + | 'legacyFlat2' + | 'legacyFlat3' + | 'legacyFlat4' + | 'legacyNormal1' + | 'legacyNormal2' + | 'legacyNormal3' + | 'legacyNormal4' + | 'legacyHarsh1' + | 'legacyHarsh2' + | 'legacyHarsh3' + | 'legacyHarsh4' + | 'threePt' + | 'balanced' + | 'soft' + | 'harsh' + | 'flood' + | 'contrasting' + | 'morning' + | 'sunrise' + | 'sunset' + | 'chilly' + | 'freezing' + | 'flat' + | 'twoPt' + | 'glow' + | 'brightRoom'; + +export type ST_LightRigDirection = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_LightRig { + rot: CT_SphereCoords; + rig: ST_LightRigType; + dir: ST_LightRigDirection; +} + +export type ST_Coordinate = ST_CoordinateUnqualified | ST_UniversalMeasure; + +export interface CT_Point3D { + x: ST_Coordinate; + y: ST_Coordinate; + z: ST_Coordinate; +} + +export interface CT_Vector3D { + dx: ST_Coordinate; + dy: ST_Coordinate; + dz: ST_Coordinate; +} + +export interface CT_Backdrop { + anchor: CT_Point3D; + norm: CT_Vector3D; + up: CT_Vector3D; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_Scene3D { + camera: CT_Camera; + lightRig: CT_LightRig; + backdrop: CT_Backdrop; + extLst: CT_OfficeArtExtensionList; +} + +export type ST_PositiveCoordinate = number; + +export type ST_BevelPresetType = + | 'relaxedInset' + | 'circle' + | 'slope' + | 'cross' + | 'angle' + | 'softRound' + | 'convex' + | 'coolSlant' + | 'divot' + | 'riblet' + | 'hardEdge' + | 'artDeco'; + +export interface CT_Bevel { + w: number; + h: number; + prst: ST_BevelPresetType; +} + +export type ST_PresetMaterialType = + | 'legacyMatte' + | 'legacyPlastic' + | 'legacyMetal' + | 'legacyWireframe' + | 'matte' + | 'plastic' + | 'metal' + | 'warmMatte' + | 'translucentPowder' + | 'powder' + | 'dkEdge' + | 'softEdge' + | 'clear' + | 'flat' + | 'softmetal'; + +export interface CT_Shape3D { + bevelT: CT_Bevel; + bevelB: CT_Bevel; + extrusionClr: CT_Color; + contourClr: CT_Color; + extLst: CT_OfficeArtExtensionList; + z: ST_Coordinate; + extrusionH: number; + contourW: number; + prstMaterial: ST_PresetMaterialType; +} + +export interface CT_EffectStyleItem { + scene3d: CT_Scene3D; + sp3d: CT_Shape3D; +} + +export interface CT_FontScheme { + majorFont: CT_FontCollection; + minorFont: CT_FontCollection; + extLst: CT_OfficeArtExtensionList; + name: string; +} + +export interface CT_FillStyleList {} + +export type ST_LineEndType = + | 'none' + | 'triangle' + | 'stealth' + | 'diamond' + | 'oval' + | 'arrow'; + +export type ST_LineEndWidth = 'sm' | 'med' | 'lg'; + +export type ST_LineEndLength = 'sm' | 'med' | 'lg'; + +export interface CT_LineEndProperties { + type: ST_LineEndType; + w: ST_LineEndWidth; + len: ST_LineEndLength; +} + +export type ST_LineWidth = ST_Coordinate32Unqualified; + +export type ST_LineCap = 'rnd' | 'sq' | 'flat'; + +export type ST_CompoundLine = 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri'; + +export type ST_PenAlignment = 'ctr' | 'in'; + +export interface CT_LineProperties { + headEnd: CT_LineEndProperties; + tailEnd: CT_LineEndProperties; + extLst: CT_OfficeArtExtensionList; + w: number; + cap: ST_LineCap; + cmpd: ST_CompoundLine; + algn: ST_PenAlignment; +} + +export interface CT_LineStyleList { + ln: CT_LineProperties[]; +} + +export interface CT_EffectStyleList { + effectStyle: CT_EffectStyleItem[]; +} + +export interface CT_BackgroundFillStyleList {} + +export interface CT_StyleMatrix { + fillStyleLst: CT_FillStyleList; + lnStyleLst: CT_LineStyleList; + effectStyleLst: CT_EffectStyleList; + bgFillStyleLst: CT_BackgroundFillStyleList; + name: string; +} + +export interface CT_BaseStyles { + clrScheme: CT_ColorScheme; + fontScheme: CT_FontScheme; + fmtScheme: CT_StyleMatrix; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_OfficeArtExtension { + uri: string; +} + +export type ST_CoordinateUnqualified = number; + +export type ST_Coordinate32 = ST_Coordinate32Unqualified | ST_UniversalMeasure; + +export type ST_Coordinate32Unqualified = number; + +export type ST_PositiveCoordinate32 = ST_Coordinate32Unqualified; + +export type ST_Angle = number; + +export interface CT_Angle { + val: number; +} + +export type ST_FixedAngle = ST_Angle; + +export interface CT_PositiveFixedAngle { + val: number; +} + +export interface CT_Percentage { + val: string; +} + +export interface CT_PositivePercentage { + val: ST_PositivePercentage; +} + +export interface CT_FixedPercentage { + val: ST_FixedPercentage; +} + +export interface CT_PositiveFixedPercentage { + val: ST_PositiveFixedPercentage; +} + +export interface CT_Ratio { + n: number; + d: number; +} + +export interface CT_Point2D { + x: ST_Coordinate; + y: ST_Coordinate; +} + +export interface CT_PositiveSize2D { + cx: number; + cy: number; +} + +export interface CT_ComplementTransform {} + +export interface CT_InverseTransform {} + +export interface CT_GrayscaleTransform {} + +export interface CT_GammaTransform {} + +export interface CT_InverseGammaTransform {} + +export interface CT_ScRgbColor { + r: string; + g: string; + b: string; +} + +export interface CT_SRgbColor { + val: string; +} + +export interface CT_HslColor { + hue: number; + sat: string; + lum: string; +} + +export type ST_SystemColorVal = + | 'scrollBar' + | 'background' + | 'activeCaption' + | 'inactiveCaption' + | 'menu' + | 'window' + | 'windowFrame' + | 'menuText' + | 'windowText' + | 'captionText' + | 'activeBorder' + | 'inactiveBorder' + | 'appWorkspace' + | 'highlight' + | 'highlightText' + | 'btnFace' + | 'btnShadow' + | 'grayText' + | 'btnText' + | 'inactiveCaptionText' + | 'btnHighlight' + | '3dDkShadow' + | '3dLight' + | 'infoText' + | 'infoBk' + | 'hotLight' + | 'gradientActiveCaption' + | 'gradientInactiveCaption' + | 'menuHighlight' + | 'menuBar'; + +export interface CT_SystemColor { + val: ST_SystemColorVal; + lastClr: string; +} + +export type ST_SchemeColorVal = + | 'bg1' + | 'tx1' + | 'bg2' + | 'tx2' + | 'accent1' + | 'accent2' + | 'accent3' + | 'accent4' + | 'accent5' + | 'accent6' + | 'hlink' + | 'folHlink' + | 'phClr' + | 'dk1' + | 'lt1' + | 'dk2' + | 'lt2'; + +export interface CT_SchemeColor { + val: ST_SchemeColorVal; +} + +export type ST_PresetColorVal = + | 'aliceBlue' + | 'antiqueWhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedAlmond' + | 'blue' + | 'blueViolet' + | 'brown' + | 'burlyWood' + | 'cadetBlue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerBlue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkBlue' + | 'darkCyan' + | 'darkGoldenrod' + | 'darkGray' + | 'darkGrey' + | 'darkGreen' + | 'darkKhaki' + | 'darkMagenta' + | 'darkOliveGreen' + | 'darkOrange' + | 'darkOrchid' + | 'darkRed' + | 'darkSalmon' + | 'darkSeaGreen' + | 'darkSlateBlue' + | 'darkSlateGray' + | 'darkSlateGrey' + | 'darkTurquoise' + | 'darkViolet' + | 'dkBlue' + | 'dkCyan' + | 'dkGoldenrod' + | 'dkGray' + | 'dkGrey' + | 'dkGreen' + | 'dkKhaki' + | 'dkMagenta' + | 'dkOliveGreen' + | 'dkOrange' + | 'dkOrchid' + | 'dkRed' + | 'dkSalmon' + | 'dkSeaGreen' + | 'dkSlateBlue' + | 'dkSlateGray' + | 'dkSlateGrey' + | 'dkTurquoise' + | 'dkViolet' + | 'deepPink' + | 'deepSkyBlue' + | 'dimGray' + | 'dimGrey' + | 'dodgerBlue' + | 'firebrick' + | 'floralWhite' + | 'forestGreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostWhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'grey' + | 'green' + | 'greenYellow' + | 'honeydew' + | 'hotPink' + | 'indianRed' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderBlush' + | 'lawnGreen' + | 'lemonChiffon' + | 'lightBlue' + | 'lightCoral' + | 'lightCyan' + | 'lightGoldenrodYellow' + | 'lightGray' + | 'lightGrey' + | 'lightGreen' + | 'lightPink' + | 'lightSalmon' + | 'lightSeaGreen' + | 'lightSkyBlue' + | 'lightSlateGray' + | 'lightSlateGrey' + | 'lightSteelBlue' + | 'lightYellow' + | 'ltBlue' + | 'ltCoral' + | 'ltCyan' + | 'ltGoldenrodYellow' + | 'ltGray' + | 'ltGrey' + | 'ltGreen' + | 'ltPink' + | 'ltSalmon' + | 'ltSeaGreen' + | 'ltSkyBlue' + | 'ltSlateGray' + | 'ltSlateGrey' + | 'ltSteelBlue' + | 'ltYellow' + | 'lime' + | 'limeGreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'medAquamarine' + | 'medBlue' + | 'medOrchid' + | 'medPurple' + | 'medSeaGreen' + | 'medSlateBlue' + | 'medSpringGreen' + | 'medTurquoise' + | 'medVioletRed' + | 'mediumAquamarine' + | 'mediumBlue' + | 'mediumOrchid' + | 'mediumPurple' + | 'mediumSeaGreen' + | 'mediumSlateBlue' + | 'mediumSpringGreen' + | 'mediumTurquoise' + | 'mediumVioletRed' + | 'midnightBlue' + | 'mintCream' + | 'mistyRose' + | 'moccasin' + | 'navajoWhite' + | 'navy' + | 'oldLace' + | 'olive' + | 'oliveDrab' + | 'orange' + | 'orangeRed' + | 'orchid' + | 'paleGoldenrod' + | 'paleGreen' + | 'paleTurquoise' + | 'paleVioletRed' + | 'papayaWhip' + | 'peachPuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderBlue' + | 'purple' + | 'red' + | 'rosyBrown' + | 'royalBlue' + | 'saddleBrown' + | 'salmon' + | 'sandyBrown' + | 'seaGreen' + | 'seaShell' + | 'sienna' + | 'silver' + | 'skyBlue' + | 'slateBlue' + | 'slateGray' + | 'slateGrey' + | 'snow' + | 'springGreen' + | 'steelBlue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whiteSmoke' + | 'yellow' + | 'yellowGreen'; + +export interface CT_PresetColor { + val: ST_PresetColorVal; +} + +export interface CT_Scale2D { + sx: CT_Ratio; + sy: CT_Ratio; +} + +export interface CT_Transform2D { + off: CT_Point2D; + ext: CT_PositiveSize2D; + rot: number; + flipH: boolean; + flipV: boolean; +} + +export interface CT_GroupTransform2D { + off: CT_Point2D; + ext: CT_PositiveSize2D; + chOff: CT_Point2D; + chExt: CT_PositiveSize2D; + rot: number; + flipH: boolean; + flipV: boolean; +} + +export interface CT_RelativeRect { + l: string; + t: string; + r: string; + b: string; +} + +export type ST_RectAlignment = + | 'tl' + | 't' + | 'tr' + | 'l' + | 'ctr' + | 'r' + | 'bl' + | 'b' + | 'br'; + +export interface CT_ColorMRU {} + +export type ST_BlackWhiteMode = + | 'clr' + | 'auto' + | 'gray' + | 'ltGray' + | 'invGray' + | 'grayWhite' + | 'blackGray' + | 'blackWhite' + | 'black' + | 'white' + | 'hidden'; + +export interface CT_EmbeddedWAVAudioFile { + name: string; +} + +export interface CT_Hyperlink { + snd: CT_EmbeddedWAVAudioFile; + extLst: CT_OfficeArtExtensionList; + r_id: string; + invalidUrl: string; + action: string; + tgtFrame: string; + tooltip: string; + history: boolean; + highlightClick: boolean; + endSnd: boolean; +} + +export type ST_DrawingElementId = number; + +export interface CT_ConnectorLocking { + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_ShapeLocking { + extLst: CT_OfficeArtExtensionList; + noTextEdit: boolean; +} + +export interface CT_PictureLocking { + extLst: CT_OfficeArtExtensionList; + noCrop: boolean; +} + +export interface CT_GroupLocking { + extLst: CT_OfficeArtExtensionList; + noGrp: boolean; + noUngrp: boolean; + noSelect: boolean; + noRot: boolean; + noChangeAspect: boolean; + noMove: boolean; + noResize: boolean; +} + +export interface CT_GraphicalObjectFrameLocking { + extLst: CT_OfficeArtExtensionList; + noGrp: boolean; + noDrilldown: boolean; + noSelect: boolean; + noChangeAspect: boolean; + noMove: boolean; + noResize: boolean; +} + +export interface CT_ContentPartLocking { + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_NonVisualDrawingProps { + hlinkClick: CT_Hyperlink; + hlinkHover: CT_Hyperlink; + extLst: CT_OfficeArtExtensionList; + id: number; + name: string; + descr: string; + hidden: boolean; + title: string; +} + +export interface CT_NonVisualDrawingShapeProps { + spLocks: CT_ShapeLocking; + extLst: CT_OfficeArtExtensionList; + txBox: boolean; +} + +export interface CT_Connection { + id: number; + idx: number; +} + +export interface CT_NonVisualConnectorProperties { + cxnSpLocks: CT_ConnectorLocking; + stCxn: CT_Connection; + endCxn: CT_Connection; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_NonVisualPictureProperties { + picLocks: CT_PictureLocking; + extLst: CT_OfficeArtExtensionList; + preferRelativeResize: boolean; +} + +export interface CT_NonVisualGroupDrawingShapeProps { + grpSpLocks: CT_GroupLocking; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_NonVisualGraphicFrameProperties { + graphicFrameLocks: CT_GraphicalObjectFrameLocking; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_NonVisualContentPartProperties { + cpLocks: CT_ContentPartLocking; + extLst: CT_OfficeArtExtensionList; + isComment: boolean; +} + +export interface CT_GraphicalObjectData { + uri: string; +} + +export interface CT_GraphicalObject { + graphicData: CT_GraphicalObjectData[]; +} + +export type ST_ChartBuildStep = + | 'category' + | 'ptInCategory' + | 'series' + | 'ptInSeries' + | 'allPts' + | 'gridLegend'; + +export type ST_DgmBuildStep = 'sp' | 'bg'; + +export interface CT_AnimationDgmElement { + id: string; + bldStep: ST_DgmBuildStep; +} + +export interface CT_AnimationChartElement { + seriesIdx: number; + categoryIdx: number; + bldStep: ST_ChartBuildStep; +} + +export interface CT_AnimationElementChoice { + dgm: CT_AnimationDgmElement[]; + chart: CT_AnimationChartElement[]; +} + +export type ST_AnimationBuildType = 'allAtOnce'; + +export type ST_AnimationDgmOnlyBuildType = 'one' | 'lvlOne' | 'lvlAtOnce'; + +export type ST_AnimationDgmBuildType = + | ST_AnimationBuildType + | ST_AnimationDgmOnlyBuildType; + +export interface CT_AnimationDgmBuildProperties { + bld: ST_AnimationDgmBuildType; + rev: boolean; +} + +export type ST_AnimationChartOnlyBuildType = + | 'series' + | 'category' + | 'seriesEl' + | 'categoryEl'; + +export type ST_AnimationChartBuildType = + | ST_AnimationBuildType + | ST_AnimationChartOnlyBuildType; + +export interface CT_AnimationChartBuildProperties { + bld: ST_AnimationChartBuildType; + animBg: boolean; +} + +export interface CT_AnimationGraphicalObjectBuildProperties { + bldDgm: CT_AnimationDgmBuildProperties[]; + bldChart: CT_AnimationChartBuildProperties[]; +} + +export interface CT_BackgroundFormatting {} + +export interface CT_WholeE2oFormatting { + ln: CT_LineProperties; +} + +export interface CT_GvmlUseShapeRectangle {} + +export type ST_GeomGuideName = string; + +export type ST_GeomGuideFormula = string; + +export interface CT_GeomGuide { + name: string; + fmla: string; +} + +export interface CT_GeomGuideList { + gd: CT_GeomGuide[]; +} + +export type ST_TextShapeType = + | 'textNoShape' + | 'textPlain' + | 'textStop' + | 'textTriangle' + | 'textTriangleInverted' + | 'textChevron' + | 'textChevronInverted' + | 'textRingInside' + | 'textRingOutside' + | 'textArchUp' + | 'textArchDown' + | 'textCircle' + | 'textButton' + | 'textArchUpPour' + | 'textArchDownPour' + | 'textCirclePour' + | 'textButtonPour' + | 'textCurveUp' + | 'textCurveDown' + | 'textCanUp' + | 'textCanDown' + | 'textWave1' + | 'textWave2' + | 'textDoubleWave1' + | 'textWave4' + | 'textInflate' + | 'textDeflate' + | 'textInflateBottom' + | 'textDeflateBottom' + | 'textInflateTop' + | 'textDeflateTop' + | 'textDeflateInflate' + | 'textDeflateInflateDeflate' + | 'textFadeRight' + | 'textFadeLeft' + | 'textFadeUp' + | 'textFadeDown' + | 'textSlantUp' + | 'textSlantDown' + | 'textCascadeUp' + | 'textCascadeDown'; + +export interface CT_PresetTextShape { + avLst: CT_GeomGuideList; + prst: ST_TextShapeType; +} + +export type ST_TextVertOverflowType = 'overflow' | 'ellipsis' | 'clip'; + +export type ST_TextHorzOverflowType = 'overflow' | 'clip'; + +export type ST_TextVerticalType = + | 'horz' + | 'vert' + | 'vert270' + | 'wordArtVert' + | 'eaVert' + | 'mongolianVert' + | 'wordArtVertRtl'; + +export type ST_TextWrappingType = 'none' | 'square'; + +export type ST_TextColumnCount = number; + +export type ST_TextAnchoringType = 't' | 'ctr' | 'b' | 'just' | 'dist'; + +export interface CT_TextBodyProperties { + prstTxWarp: CT_PresetTextShape; + scene3d: CT_Scene3D; + extLst: CT_OfficeArtExtensionList; + rot: number; + spcFirstLastPara: boolean; + vertOverflow: ST_TextVertOverflowType; + horzOverflow: ST_TextHorzOverflowType; + vert: ST_TextVerticalType; + wrap: ST_TextWrappingType; + lIns: ST_Coordinate32; + tIns: ST_Coordinate32; + rIns: ST_Coordinate32; + bIns: ST_Coordinate32; + numCol: number; + spcCol: number; + rtlCol: boolean; + fromWordArt: boolean; + anchor: ST_TextAnchoringType; + anchorCtr: boolean; + forceAA: boolean; + upright: boolean; + compatLnSpc: boolean; +} + +export type ST_TextSpacingPercentOrPercentString = string; + +export interface CT_TextSpacingPercent { + val: string; +} + +export type ST_TextSpacingPoint = number; + +export interface CT_TextSpacingPoint { + val: number; +} + +export interface CT_TextSpacing { + spcPct: CT_TextSpacingPercent[]; + spcPts: CT_TextSpacingPoint[]; +} + +export type ST_TextTabAlignType = 'l' | 'ctr' | 'r' | 'dec'; + +export interface CT_TextTabStop { + pos: ST_Coordinate32; + algn: ST_TextTabAlignType; +} + +export interface CT_TextTabStopList { + tab: CT_TextTabStop[]; +} + +export interface CT_Boolean { + val: ST_OnOff; +} + +export type ST_TextFontSize = number; + +export type ST_TextUnderlineType = + | 'none' + | 'words' + | 'sng' + | 'dbl' + | 'heavy' + | 'dotted' + | 'dottedHeavy' + | 'dash' + | 'dashHeavy' + | 'dashLong' + | 'dashLongHeavy' + | 'dotDash' + | 'dotDashHeavy' + | 'dotDotDash' + | 'dotDotDashHeavy' + | 'wavy' + | 'wavyHeavy' + | 'wavyDbl'; + +export type ST_TextStrikeType = 'noStrike' | 'sngStrike' | 'dblStrike'; + +export type ST_TextNonNegativePoint = number; + +export type ST_TextCapsType = 'none' | 'small' | 'all'; + +export type ST_TextPoint = ST_TextPointUnqualified | ST_UniversalMeasure; + +export interface CT_TextCharacterProperties { + ln: CT_LineProperties; + highlight: CT_Color; + latin: CT_TextFont; + ea: CT_TextFont; + cs: CT_TextFont; + sym: CT_TextFont; + hlinkClick: CT_Hyperlink; + hlinkMouseOver: CT_Hyperlink; + rtl: CT_Boolean[]; + extLst: CT_OfficeArtExtensionList; + kumimoji: boolean; + lang: string; + altLang: string; + sz: number; + b: boolean; + i: boolean; + u: ST_TextUnderlineType; + strike: ST_TextStrikeType; + kern: number; + cap: ST_TextCapsType; + spc: ST_TextPoint; + normalizeH: boolean; + baseline: string; + noProof: boolean; + dirty: boolean; + err: boolean; + smtClean: boolean; + smtId: number; + bmk: string; +} + +export type ST_TextMargin = ST_Coordinate32Unqualified; + +export type ST_TextIndentLevelType = number; + +export type ST_TextIndent = ST_Coordinate32Unqualified; + +export type ST_TextAlignType = + | 'l' + | 'ctr' + | 'r' + | 'just' + | 'justLow' + | 'dist' + | 'thaiDist'; + +export type ST_TextFontAlignType = 'auto' | 't' | 'ctr' | 'base' | 'b'; + +export interface CT_TextParagraphProperties { + lnSpc: CT_TextSpacing; + spcBef: CT_TextSpacing; + spcAft: CT_TextSpacing; + tabLst: CT_TextTabStopList; + defRPr: CT_TextCharacterProperties; + extLst: CT_OfficeArtExtensionList; + marL: number; + marR: number; + lvl: number; + indent: number; + algn: ST_TextAlignType; + defTabSz: ST_Coordinate32; + rtl: boolean; + eaLnBrk: boolean; + fontAlgn: ST_TextFontAlignType; + latinLnBrk: boolean; + hangingPunct: boolean; +} + +export interface CT_TextListStyle { + defPPr: CT_TextParagraphProperties; + lvl1pPr: CT_TextParagraphProperties; + lvl2pPr: CT_TextParagraphProperties; + lvl3pPr: CT_TextParagraphProperties; + lvl4pPr: CT_TextParagraphProperties; + lvl5pPr: CT_TextParagraphProperties; + lvl6pPr: CT_TextParagraphProperties; + lvl7pPr: CT_TextParagraphProperties; + lvl8pPr: CT_TextParagraphProperties; + lvl9pPr: CT_TextParagraphProperties; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_TextParagraph { + pPr: CT_TextParagraphProperties; + endParaRPr: CT_TextCharacterProperties; +} + +export interface CT_TextBody { + bodyPr: CT_TextBodyProperties; + lstStyle: CT_TextListStyle; + p: CT_TextParagraph[]; +} + +export interface CT_GvmlTextShape { + txBody: CT_TextBody; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_GvmlShapeNonVisual { + cNvPr: CT_NonVisualDrawingProps; + cNvSpPr: CT_NonVisualDrawingShapeProps; +} + +export interface CT_ShapeProperties { + xfrm: CT_Transform2D; + ln: CT_LineProperties; + scene3d: CT_Scene3D; + sp3d: CT_Shape3D; + extLst: CT_OfficeArtExtensionList; + bwMode: ST_BlackWhiteMode; +} + +export interface CT_StyleMatrixReference { + idx: number; +} + +export interface CT_FontReference { + idx: ST_FontCollectionIndex; +} + +export interface CT_ShapeStyle { + lnRef: CT_StyleMatrixReference; + fillRef: CT_StyleMatrixReference; + effectRef: CT_StyleMatrixReference; + fontRef: CT_FontReference; +} + +export interface CT_GvmlShape { + nvSpPr: CT_GvmlShapeNonVisual; + spPr: CT_ShapeProperties; + txSp: CT_GvmlTextShape; + style: CT_ShapeStyle; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_GvmlConnectorNonVisual { + cNvPr: CT_NonVisualDrawingProps; + cNvCxnSpPr: CT_NonVisualConnectorProperties; +} + +export interface CT_GvmlConnector { + nvCxnSpPr: CT_GvmlConnectorNonVisual; + spPr: CT_ShapeProperties; + style: CT_ShapeStyle; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_GvmlPictureNonVisual { + cNvPr: CT_NonVisualDrawingProps; + cNvPicPr: CT_NonVisualPictureProperties; +} + +export type ST_BlipCompression = + | 'email' + | 'screen' + | 'print' + | 'hqprint' + | 'none'; + +export interface CT_Blip { + extLst: CT_OfficeArtExtensionList; + cstate: ST_BlipCompression; +} + +export interface CT_BlipFillProperties { + blip: CT_Blip; + srcRect: CT_RelativeRect; + dpi: number; + rotWithShape: boolean; +} + +export interface CT_GvmlPicture { + nvPicPr: CT_GvmlPictureNonVisual; + blipFill: CT_BlipFillProperties; + spPr: CT_ShapeProperties; + style: CT_ShapeStyle; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_GvmlGraphicFrameNonVisual { + cNvPr: CT_NonVisualDrawingProps; + cNvGraphicFramePr: CT_NonVisualGraphicFrameProperties; +} + +export interface CT_GvmlGraphicalObjectFrame { + nvGraphicFramePr: CT_GvmlGraphicFrameNonVisual; + xfrm: CT_Transform2D; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_GvmlGroupShapeNonVisual { + cNvPr: CT_NonVisualDrawingProps; + cNvGrpSpPr: CT_NonVisualGroupDrawingShapeProps; +} + +export interface CT_GroupShapeProperties { + xfrm: CT_GroupTransform2D; + scene3d: CT_Scene3D; + extLst: CT_OfficeArtExtensionList; + bwMode: ST_BlackWhiteMode; +} + +export interface CT_GvmlGroupShape { + nvGrpSpPr: CT_GvmlGroupShapeNonVisual; + grpSpPr: CT_GroupShapeProperties; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_FlatText { + z: ST_Coordinate; +} + +export interface CT_AlphaBiLevelEffect { + thresh: ST_PositiveFixedPercentage; +} + +export interface CT_AlphaCeilingEffect {} + +export interface CT_AlphaFloorEffect {} + +export interface CT_AlphaInverseEffect {} + +export interface CT_AlphaModulateFixedEffect { + amt: ST_PositivePercentage; +} + +export interface CT_AlphaOutsetEffect { + rad: ST_Coordinate; +} + +export interface CT_AlphaReplaceEffect { + a: ST_PositiveFixedPercentage; +} + +export interface CT_BiLevelEffect { + thresh: ST_PositiveFixedPercentage; +} + +export interface CT_BlurEffect { + rad: number; + grow: boolean; +} + +export interface CT_ColorChangeEffect { + clrFrom: CT_Color; + clrTo: CT_Color; + useA: boolean; +} + +export interface CT_ColorReplaceEffect {} + +export interface CT_DuotoneEffect {} + +export interface CT_GlowEffect { + rad: number; +} + +export interface CT_GrayscaleEffect {} + +export interface CT_HSLEffect { + hue: number; + sat: ST_FixedPercentage; + lum: ST_FixedPercentage; +} + +export interface CT_InnerShadowEffect { + blurRad: number; + dist: number; + dir: number; +} + +export interface CT_LuminanceEffect { + bright: ST_FixedPercentage; + contrast: ST_FixedPercentage; +} + +export interface CT_OuterShadowEffect { + blurRad: number; + dist: number; + dir: number; + sx: string; + sy: string; + kx: number; + ky: number; + algn: ST_RectAlignment; + rotWithShape: boolean; +} + +export type ST_PresetShadowVal = + | 'shdw1' + | 'shdw2' + | 'shdw3' + | 'shdw4' + | 'shdw5' + | 'shdw6' + | 'shdw7' + | 'shdw8' + | 'shdw9' + | 'shdw10' + | 'shdw11' + | 'shdw12' + | 'shdw13' + | 'shdw14' + | 'shdw15' + | 'shdw16' + | 'shdw17' + | 'shdw18' + | 'shdw19' + | 'shdw20'; + +export interface CT_PresetShadowEffect { + prst: ST_PresetShadowVal; + dist: number; + dir: number; +} + +export interface CT_ReflectionEffect { + blurRad: number; + stA: ST_PositiveFixedPercentage; + stPos: ST_PositiveFixedPercentage; + endA: ST_PositiveFixedPercentage; + endPos: ST_PositiveFixedPercentage; + dist: number; + dir: number; + fadeDir: number; + sx: string; + sy: string; + kx: number; + ky: number; + algn: ST_RectAlignment; + rotWithShape: boolean; +} + +export interface CT_RelativeOffsetEffect { + tx: string; + ty: string; +} + +export interface CT_SoftEdgesEffect { + rad: number; +} + +export interface CT_TintEffect { + hue: number; + amt: ST_FixedPercentage; +} + +export interface CT_TransformEffect { + sx: string; + sy: string; + kx: number; + ky: number; + tx: ST_Coordinate; + ty: ST_Coordinate; +} + +export interface CT_NoFillProperties {} + +export interface CT_SolidColorFillProperties {} + +export interface CT_LinearShadeProperties { + ang: number; + scaled: boolean; +} + +export type ST_PathShadeType = 'shape' | 'circle' | 'rect'; + +export interface CT_PathShadeProperties { + fillToRect: CT_RelativeRect; + path: ST_PathShadeType; +} + +export type ST_TileFlipMode = 'none' | 'x' | 'y' | 'xy'; + +export interface CT_GradientStop { + pos: ST_PositiveFixedPercentage; +} + +export interface CT_GradientStopList { + gs: CT_GradientStop[]; +} + +export interface CT_GradientFillProperties { + gsLst: CT_GradientStopList; + tileRect: CT_RelativeRect; + flip: ST_TileFlipMode; + rotWithShape: boolean; +} + +export interface CT_TileInfoProperties { + tx: ST_Coordinate; + ty: ST_Coordinate; + sx: string; + sy: string; + flip: ST_TileFlipMode; + algn: ST_RectAlignment; +} + +export interface CT_StretchInfoProperties { + fillRect: CT_RelativeRect; +} + +export type ST_PresetPatternVal = + | 'pct5' + | 'pct10' + | 'pct20' + | 'pct25' + | 'pct30' + | 'pct40' + | 'pct50' + | 'pct60' + | 'pct70' + | 'pct75' + | 'pct80' + | 'pct90' + | 'horz' + | 'vert' + | 'ltHorz' + | 'ltVert' + | 'dkHorz' + | 'dkVert' + | 'narHorz' + | 'narVert' + | 'dashHorz' + | 'dashVert' + | 'cross' + | 'dnDiag' + | 'upDiag' + | 'ltDnDiag' + | 'ltUpDiag' + | 'dkDnDiag' + | 'dkUpDiag' + | 'wdDnDiag' + | 'wdUpDiag' + | 'dashDnDiag' + | 'dashUpDiag' + | 'diagCross' + | 'smCheck' + | 'lgCheck' + | 'smGrid' + | 'lgGrid' + | 'dotGrid' + | 'smConfetti' + | 'lgConfetti' + | 'horzBrick' + | 'diagBrick' + | 'solidDmnd' + | 'openDmnd' + | 'dotDmnd' + | 'plaid' + | 'sphere' + | 'weave' + | 'divot' + | 'shingle' + | 'wave' + | 'trellis' + | 'zigZag'; + +export interface CT_PatternFillProperties { + fgClr: CT_Color; + bgClr: CT_Color; + prst: ST_PresetPatternVal; +} + +export interface CT_GroupFillProperties {} + +export interface CT_FillProperties {} + +export interface CT_FillEffect {} + +export type ST_BlendMode = 'over' | 'mult' | 'screen' | 'darken' | 'lighten'; + +export interface CT_FillOverlayEffect { + blend: ST_BlendMode; +} + +export interface CT_EffectReference { + ref: string; +} + +export type ST_EffectContainerType = 'sib' | 'tree'; + +export interface CT_EffectContainer { + type: ST_EffectContainerType; + name: string; +} + +export interface CT_AlphaModulateEffect { + cont: CT_EffectContainer; +} + +export interface CT_BlendEffect { + cont: CT_EffectContainer; + blend: ST_BlendMode; +} + +export interface CT_EffectList { + blur: CT_BlurEffect; + fillOverlay: CT_FillOverlayEffect; + glow: CT_GlowEffect; + innerShdw: CT_InnerShadowEffect; + outerShdw: CT_OuterShadowEffect; + prstShdw: CT_PresetShadowEffect; + reflection: CT_ReflectionEffect; + softEdge: CT_SoftEdgesEffect; +} + +export interface CT_EffectProperties {} + +export type ST_ShapeType = + | 'line' + | 'lineInv' + | 'triangle' + | 'rtTriangle' + | 'rect' + | 'diamond' + | 'parallelogram' + | 'trapezoid' + | 'nonIsoscelesTrapezoid' + | 'pentagon' + | 'hexagon' + | 'heptagon' + | 'octagon' + | 'decagon' + | 'dodecagon' + | 'star4' + | 'star5' + | 'star6' + | 'star7' + | 'star8' + | 'star10' + | 'star12' + | 'star16' + | 'star24' + | 'star32' + | 'roundRect' + | 'round1Rect' + | 'round2SameRect' + | 'round2DiagRect' + | 'snipRoundRect' + | 'snip1Rect' + | 'snip2SameRect' + | 'snip2DiagRect' + | 'plaque' + | 'ellipse' + | 'teardrop' + | 'homePlate' + | 'chevron' + | 'pieWedge' + | 'pie' + | 'blockArc' + | 'donut' + | 'noSmoking' + | 'rightArrow' + | 'leftArrow' + | 'upArrow' + | 'downArrow' + | 'stripedRightArrow' + | 'notchedRightArrow' + | 'bentUpArrow' + | 'leftRightArrow' + | 'upDownArrow' + | 'leftUpArrow' + | 'leftRightUpArrow' + | 'quadArrow' + | 'leftArrowCallout' + | 'rightArrowCallout' + | 'upArrowCallout' + | 'downArrowCallout' + | 'leftRightArrowCallout' + | 'upDownArrowCallout' + | 'quadArrowCallout' + | 'bentArrow' + | 'uturnArrow' + | 'circularArrow' + | 'leftCircularArrow' + | 'leftRightCircularArrow' + | 'curvedRightArrow' + | 'curvedLeftArrow' + | 'curvedUpArrow' + | 'curvedDownArrow' + | 'swooshArrow' + | 'cube' + | 'can' + | 'lightningBolt' + | 'heart' + | 'sun' + | 'moon' + | 'smileyFace' + | 'irregularSeal1' + | 'irregularSeal2' + | 'foldedCorner' + | 'bevel' + | 'frame' + | 'halfFrame' + | 'corner' + | 'diagStripe' + | 'chord' + | 'arc' + | 'leftBracket' + | 'rightBracket' + | 'leftBrace' + | 'rightBrace' + | 'bracketPair' + | 'bracePair' + | 'straightConnector1' + | 'bentConnector2' + | 'bentConnector3' + | 'bentConnector4' + | 'bentConnector5' + | 'curvedConnector2' + | 'curvedConnector3' + | 'curvedConnector4' + | 'curvedConnector5' + | 'callout1' + | 'callout2' + | 'callout3' + | 'accentCallout1' + | 'accentCallout2' + | 'accentCallout3' + | 'borderCallout1' + | 'borderCallout2' + | 'borderCallout3' + | 'accentBorderCallout1' + | 'accentBorderCallout2' + | 'accentBorderCallout3' + | 'wedgeRectCallout' + | 'wedgeRoundRectCallout' + | 'wedgeEllipseCallout' + | 'cloudCallout' + | 'cloud' + | 'ribbon' + | 'ribbon2' + | 'ellipseRibbon' + | 'ellipseRibbon2' + | 'leftRightRibbon' + | 'verticalScroll' + | 'horizontalScroll' + | 'wave' + | 'doubleWave' + | 'plus' + | 'flowChartProcess' + | 'flowChartDecision' + | 'flowChartInputOutput' + | 'flowChartPredefinedProcess' + | 'flowChartInternalStorage' + | 'flowChartDocument' + | 'flowChartMultidocument' + | 'flowChartTerminator' + | 'flowChartPreparation' + | 'flowChartManualInput' + | 'flowChartManualOperation' + | 'flowChartConnector' + | 'flowChartPunchedCard' + | 'flowChartPunchedTape' + | 'flowChartSummingJunction' + | 'flowChartOr' + | 'flowChartCollate' + | 'flowChartSort' + | 'flowChartExtract' + | 'flowChartMerge' + | 'flowChartOfflineStorage' + | 'flowChartOnlineStorage' + | 'flowChartMagneticTape' + | 'flowChartMagneticDisk' + | 'flowChartMagneticDrum' + | 'flowChartDisplay' + | 'flowChartDelay' + | 'flowChartAlternateProcess' + | 'flowChartOffpageConnector' + | 'actionButtonBlank' + | 'actionButtonHome' + | 'actionButtonHelp' + | 'actionButtonInformation' + | 'actionButtonForwardNext' + | 'actionButtonBackPrevious' + | 'actionButtonEnd' + | 'actionButtonBeginning' + | 'actionButtonReturn' + | 'actionButtonDocument' + | 'actionButtonSound' + | 'actionButtonMovie' + | 'gear6' + | 'gear9' + | 'funnel' + | 'mathPlus' + | 'mathMinus' + | 'mathMultiply' + | 'mathDivide' + | 'mathEqual' + | 'mathNotEqual' + | 'cornerTabs' + | 'squareTabs' + | 'plaqueTabs' + | 'chartX' + | 'chartStar' + | 'chartPlus'; + +export type ST_AdjCoordinate = ST_Coordinate | ST_GeomGuideName; + +export type ST_AdjAngle = ST_Angle | ST_GeomGuideName; + +export interface CT_AdjPoint2D { + x: ST_AdjCoordinate; + y: ST_AdjCoordinate; +} + +export interface CT_GeomRect { + l: ST_AdjCoordinate; + t: ST_AdjCoordinate; + r: ST_AdjCoordinate; + b: ST_AdjCoordinate; +} + +export interface CT_XYAdjustHandle { + pos: CT_AdjPoint2D; + gdRefX: string; + minX: ST_AdjCoordinate; + maxX: ST_AdjCoordinate; + gdRefY: string; + minY: ST_AdjCoordinate; + maxY: ST_AdjCoordinate; +} + +export interface CT_PolarAdjustHandle { + pos: CT_AdjPoint2D; + gdRefR: string; + minR: ST_AdjCoordinate; + maxR: ST_AdjCoordinate; + gdRefAng: string; + minAng: ST_AdjAngle; + maxAng: ST_AdjAngle; +} + +export interface CT_ConnectionSite { + pos: CT_AdjPoint2D; + ang: ST_AdjAngle; +} + +export interface CT_AdjustHandleList { + ahXY: CT_XYAdjustHandle; + ahPolar: CT_PolarAdjustHandle; +} + +export interface CT_ConnectionSiteList { + cxn: CT_ConnectionSite[]; +} + +export interface CT_Path2DMoveTo { + pt: CT_AdjPoint2D; +} + +export interface CT_Path2DLineTo { + pt: CT_AdjPoint2D; +} + +export interface CT_Path2DArcTo { + wR: ST_AdjCoordinate; + hR: ST_AdjCoordinate; + stAng: ST_AdjAngle; + swAng: ST_AdjAngle; +} + +export interface CT_Path2DQuadBezierTo { + pt: CT_AdjPoint2D[]; +} + +export interface CT_Path2DCubicBezierTo { + pt: CT_AdjPoint2D[]; +} + +export interface CT_Path2DClose {} + +export type ST_PathFillMode = + | 'none' + | 'norm' + | 'lighten' + | 'lightenLess' + | 'darken' + | 'darkenLess'; + +export interface CT_Path2D { + close: CT_Path2DClose; + moveTo: CT_Path2DMoveTo; + lnTo: CT_Path2DLineTo; + arcTo: CT_Path2DArcTo; + quadBezTo: CT_Path2DQuadBezierTo; + cubicBezTo: CT_Path2DCubicBezierTo; + w: number; + h: number; + fill: ST_PathFillMode; + stroke: boolean; + extrusionOk: boolean; +} + +export interface CT_Path2DList { + path: CT_Path2D[]; +} + +export interface CT_PresetGeometry2D { + avLst: CT_GeomGuideList; + prst: ST_ShapeType; +} + +export interface CT_CustomGeometry2D { + avLst: CT_GeomGuideList; + gdLst: CT_GeomGuideList; + ahLst: CT_AdjustHandleList; + cxnLst: CT_ConnectionSiteList; + rect: CT_GeomRect; + pathLst: CT_Path2DList; +} + +export interface CT_LineJoinBevel {} + +export interface CT_LineJoinRound {} + +export interface CT_LineJoinMiterProperties { + lim: ST_PositivePercentage; +} + +export type ST_PresetLineDashVal = + | 'solid' + | 'dot' + | 'dash' + | 'lgDash' + | 'dashDot' + | 'lgDashDot' + | 'lgDashDotDot' + | 'sysDash' + | 'sysDot' + | 'sysDashDot' + | 'sysDashDotDot'; + +export interface CT_PresetLineDashProperties { + val: ST_PresetLineDashVal; +} + +export interface CT_DashStop { + d: ST_PositivePercentage; + sp: ST_PositivePercentage; +} + +export interface CT_DashStopList { + ds: CT_DashStop[]; +} + +export type ST_ShapeID = string; + +export interface CT_DefaultShapeDefinition { + spPr: CT_ShapeProperties; + bodyPr: CT_TextBodyProperties; + lstStyle: CT_TextListStyle; + style: CT_ShapeStyle; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_ObjectStyleDefaults { + spDef: CT_DefaultShapeDefinition; + lnDef: CT_DefaultShapeDefinition; + txDef: CT_DefaultShapeDefinition; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_EmptyElement {} + +export interface CT_ColorMapping { + extLst: CT_OfficeArtExtensionList; + bg1: ST_ColorSchemeIndex; + tx1: ST_ColorSchemeIndex; + bg2: ST_ColorSchemeIndex; + tx2: ST_ColorSchemeIndex; + accent1: ST_ColorSchemeIndex; + accent2: ST_ColorSchemeIndex; + accent3: ST_ColorSchemeIndex; + accent4: ST_ColorSchemeIndex; + accent5: ST_ColorSchemeIndex; + accent6: ST_ColorSchemeIndex; + hlink: ST_ColorSchemeIndex; + folHlink: ST_ColorSchemeIndex; +} + +export interface CT_ColorMappingOverride {} + +export interface CT_ColorSchemeAndMapping { + clrScheme: CT_ColorScheme; + clrMap: CT_ColorMapping; +} + +export interface CT_ColorSchemeList { + extraClrScheme: CT_ColorSchemeAndMapping[]; +} + +export interface CT_OfficeStyleSheet { + themeElements: CT_BaseStyles; + objectDefaults: CT_ObjectStyleDefaults; + extraClrSchemeLst: CT_ColorSchemeList; + custClrLst: CT_CustomColorList; + extLst: CT_OfficeArtExtensionList; + name: string; +} + +export interface CT_BaseStylesOverride { + clrScheme: CT_ColorScheme; + fontScheme: CT_FontScheme; + fmtScheme: CT_StyleMatrix; +} + +export interface CT_ClipboardStyleSheet { + themeElements: CT_BaseStyles; + clrMap: CT_ColorMapping; +} + +export interface CT_Cell3D { + bevel: CT_Bevel; + lightRig: CT_LightRig; + extLst: CT_OfficeArtExtensionList; + prstMaterial: ST_PresetMaterialType; +} + +export interface CT_String { + val: string; +} + +export interface CT_Headers { + header: CT_String[]; +} + +export interface CT_TableCellProperties { + lnL: CT_LineProperties; + lnR: CT_LineProperties; + lnT: CT_LineProperties; + lnB: CT_LineProperties; + lnTlToBr: CT_LineProperties; + lnBlToTr: CT_LineProperties; + cell3D: CT_Cell3D; + headers: CT_Headers[]; + extLst: CT_OfficeArtExtensionList; + marL: ST_Coordinate32; + marR: ST_Coordinate32; + marT: ST_Coordinate32; + marB: ST_Coordinate32; + vert: ST_TextVerticalType; + anchor: ST_TextAnchoringType; + anchorCtr: boolean; + horzOverflow: ST_TextHorzOverflowType; +} + +export interface CT_TableCol { + extLst: CT_OfficeArtExtensionList; + w: ST_Coordinate; +} + +export interface CT_TableGrid { + gridCol: CT_TableCol[]; +} + +export interface CT_TableCell { + txBody: CT_TextBody; + tcPr: CT_TableCellProperties; + extLst: CT_OfficeArtExtensionList; + rowSpan: number; + gridSpan: number; + hMerge: boolean; + vMerge: boolean; + id: string; +} + +export interface CT_TableRow { + tc: CT_TableCell[]; + extLst: CT_OfficeArtExtensionList; + h: ST_Coordinate; +} + +export interface CT_TableProperties { + extLst: CT_OfficeArtExtensionList; + rtl: boolean; + firstRow: boolean; + firstCol: boolean; + lastRow: boolean; + lastCol: boolean; + bandRow: boolean; + bandCol: boolean; +} + +export interface CT_Table { + tblPr: CT_TableProperties; + tblGrid: CT_TableGrid; + tr: CT_TableRow[]; +} + +export interface CT_ThemeableLineStyle { + ln: CT_LineProperties; + lnRef: CT_StyleMatrixReference; +} + +export type ST_OnOffStyleType = 'on' | 'off' | 'def'; + +export interface CT_TableStyleTextStyle { + extLst: CT_OfficeArtExtensionList; + b: ST_OnOffStyleType; + i: ST_OnOffStyleType; +} + +export interface CT_TableCellBorderStyle { + left: CT_ThemeableLineStyle; + right: CT_ThemeableLineStyle; + top: CT_ThemeableLineStyle; + bottom: CT_ThemeableLineStyle; + insideH: CT_ThemeableLineStyle; + insideV: CT_ThemeableLineStyle; + tl2br: CT_ThemeableLineStyle; + tr2bl: CT_ThemeableLineStyle; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_TableBackgroundStyle {} + +export interface CT_TableStyleCellStyle { + tcBdr: CT_TableCellBorderStyle; + cell3D: CT_Cell3D; +} + +export interface CT_TablePartStyle { + tcTxStyle: CT_TableStyleTextStyle; + tcStyle: CT_TableStyleCellStyle; +} + +export interface CT_TableStyle { + tblBg: CT_TableBackgroundStyle; + wholeTbl: CT_TablePartStyle; + band1H: CT_TablePartStyle; + band2H: CT_TablePartStyle; + band1V: CT_TablePartStyle; + band2V: CT_TablePartStyle; + lastCol: CT_TablePartStyle; + firstCol: CT_TablePartStyle; + lastRow: CT_TablePartStyle; + seCell: CT_TablePartStyle; + swCell: CT_TablePartStyle; + firstRow: CT_TablePartStyle; + neCell: CT_TablePartStyle; + nwCell: CT_TablePartStyle; + extLst: CT_OfficeArtExtensionList; + styleId: string; + styleName: string; +} + +export interface CT_TableStyleList { + tblStyle: CT_TableStyle[]; + def: string; +} + +export type ST_TextFontScalePercentOrPercentString = string; + +export interface CT_TextNormalAutofit { + fontScale: string; + lnSpcReduction: string; +} + +export interface CT_TextShapeAutofit {} + +export interface CT_TextNoAutofit {} + +export type ST_TextBulletStartAtNum = number; + +export type ST_TextAutonumberScheme = + | 'alphaLcParenBoth' + | 'alphaUcParenBoth' + | 'alphaLcParenR' + | 'alphaUcParenR' + | 'alphaLcPeriod' + | 'alphaUcPeriod' + | 'arabicParenBoth' + | 'arabicParenR' + | 'arabicPeriod' + | 'arabicPlain' + | 'romanLcParenBoth' + | 'romanUcParenBoth' + | 'romanLcParenR' + | 'romanUcParenR' + | 'romanLcPeriod' + | 'romanUcPeriod' + | 'circleNumDbPlain' + | 'circleNumWdBlackPlain' + | 'circleNumWdWhitePlain' + | 'arabicDbPeriod' + | 'arabicDbPlain' + | 'ea1ChsPeriod' + | 'ea1ChsPlain' + | 'ea1ChtPeriod' + | 'ea1ChtPlain' + | 'ea1JpnChsDbPeriod' + | 'ea1JpnKorPlain' + | 'ea1JpnKorPeriod' + | 'arabic1Minus' + | 'arabic2Minus' + | 'hebrew2Minus' + | 'thaiAlphaPeriod' + | 'thaiAlphaParenR' + | 'thaiAlphaParenBoth' + | 'thaiNumPeriod' + | 'thaiNumParenR' + | 'thaiNumParenBoth' + | 'hindiAlphaPeriod' + | 'hindiNumPeriod' + | 'hindiNumParenR' + | 'hindiAlpha1Period'; + +export interface CT_TextBulletColorFollowText {} + +export type ST_TextBulletSize = string; + +export type ST_TextBulletSizePercent = string; + +export interface CT_TextBulletSizeFollowText {} + +export interface CT_TextBulletSizePercent { + val: string; +} + +export interface CT_TextBulletSizePoint { + val: number; +} + +export interface CT_TextBulletTypefaceFollowText {} + +export interface CT_TextAutonumberBullet { + type: ST_TextAutonumberScheme; + startAt: number; +} + +export interface CT_TextCharBullet { + char: string; +} + +export interface CT_TextBlipBullet { + blip: CT_Blip; +} + +export interface CT_TextNoBullet {} + +export type ST_TextPointUnqualified = number; + +export interface CT_TextUnderlineLineFollowText {} + +export interface CT_TextUnderlineFillFollowText {} + +export interface CT_TextUnderlineFillGroupWrapper {} + +export interface CT_TextLineBreak { + rPr: CT_TextCharacterProperties; +} + +export interface CT_TextField { + rPr: CT_TextCharacterProperties; + pPr: CT_TextParagraphProperties; + t: string; + id: string; + type: string; +} + +export interface CT_RegularTextRun { + rPr: CT_TextCharacterProperties; + t: string; +} + +export interface CT_Empty {} + +export interface CT_OnOff { + val: ST_OnOff; +} + +export type ST_LongHexNumber = string; + +export interface CT_LongHexNumber { + val: string; +} + +export type ST_ShortHexNumber = string; + +export interface CT_Charset { + characterSet: string; +} + +export type ST_DecimalNumberOrPercent = string; export type ST_DecimalNumber = number; + +export interface CT_DecimalNumber { + val: number; +} + +export interface CT_UnsignedDecimalNumber { + val: number; +} + +export interface CT_DecimalNumberOrPrecent { + val: string; +} + +export interface CT_TwipsMeasure { + val: ST_TwipsMeasure; +} + export type ST_SignedTwipsMeasure = number | ST_UniversalMeasure; +export interface CT_SignedTwipsMeasure { + val: ST_SignedTwipsMeasure; +} + export type ST_PixelsMeasure = ST_UnsignedDecimalNumber; + +export interface CT_PixelsMeasure { + val: number; +} + export type ST_HpsMeasure = | ST_UnsignedDecimalNumber | ST_PositiveUniversalMeasure; +export interface CT_HpsMeasure { + val: ST_HpsMeasure; +} + export type ST_SignedHpsMeasure = number | ST_UniversalMeasure; +export interface CT_SignedHpsMeasure { + val: ST_SignedHpsMeasure; +} + export type ST_DateTime = string; + export type ST_MacroName = string; + +export interface CT_MacroName { + val: string; +} + export type ST_EighthPointMeasure = ST_UnsignedDecimalNumber; + export type ST_PointMeasure = ST_UnsignedDecimalNumber; -export type ST_TextScale = ST_TextScalePercent; + +export type ST_TextScale = string; export type ST_TextScalePercent = string; + +export interface CT_TextScale { + val: string; +} + export type ST_HighlightColor = | 'black' | 'blue' @@ -84,8 +2482,20 @@ export type ST_HighlightColor = | 'darkGray' | 'lightGray' | 'none'; + +export interface CT_Highlight { + val: ST_HighlightColor; +} + export type ST_HexColorAuto = 'auto'; -export type ST_HexColor = ST_HexColorAuto | ST_HexColorRGB; + +export interface CT_Lang { + val: string; +} + +export interface CT_Guid { + val: string; +} export type ST_Underline = | 'single' @@ -106,6 +2516,15 @@ export type ST_Underline = | 'wavyHeavy' | 'wavyDouble' | 'none'; + +export interface CT_Underline { + val: ST_Underline; + color: ST_HexColor; + themeColor: ST_ThemeColor; + themeTint: string; + themeShade: string; +} + export type ST_TextEffect = | 'blinkBackground' | 'lights' @@ -114,6 +2533,11 @@ export type ST_TextEffect = | 'shimmer' | 'sparkle' | 'none'; + +export interface CT_TextEffect { + val: ST_TextEffect; +} + export type ST_Border = | 'nil' | 'none' @@ -308,6 +2732,19 @@ export type ST_Border = | 'zigZag' | 'zigZagStitch' | 'custom'; + +export interface CT_Border { + val: ST_Border; + color: ST_HexColor; + themeColor: ST_ThemeColor; + themeTint: string; + themeShade: string; + sz: number; + space: number; + shadow: ST_OnOff; + frame: ST_OnOff; +} + export type ST_Shd = | 'nil' | 'clear' @@ -347,14 +2784,57 @@ export type ST_Shd = | 'pct87' | 'pct90' | 'pct95'; + +export interface CT_Shd { + val: ST_Shd; + color: ST_HexColor; + themeColor: ST_ThemeColor; + themeTint: string; + themeShade: string; + fill: ST_HexColor; + themeFill: ST_ThemeColor; + themeFillTint: string; + themeFillShade: string; +} + +export interface CT_VerticalAlignRun { + val: ST_VerticalAlignRun; +} + +export interface CT_FitText { + val: ST_TwipsMeasure; + id: number; +} + export type ST_Em = 'none' | 'dot' | 'comma' | 'circle' | 'underDot'; + +export interface CT_Em { + val: ST_Em; +} + +export interface CT_Language { + val: string; + eastAsia: string; + bidi: string; +} + export type ST_CombineBrackets = | 'none' | 'round' | 'square' | 'angle' | 'curly'; + +export interface CT_EastAsianLayout { + id: number; + combine: ST_OnOff; + combineBrackets: ST_CombineBrackets; + vert: ST_OnOff; + vertCompress: ST_OnOff; +} + export type ST_HeightRule = 'auto' | 'exact' | 'atLeast'; + export type ST_Wrap = | 'auto' | 'notBeside' @@ -362,9 +2842,31 @@ export type ST_Wrap = | 'tight' | 'through' | 'none'; + export type ST_VAnchor = 'text' | 'margin' | 'page'; + export type ST_HAnchor = 'text' | 'margin' | 'page'; + export type ST_DropCap = 'none' | 'drop' | 'margin'; + +export interface CT_FramePr { + dropCap: ST_DropCap; + lines: number; + w: ST_TwipsMeasure; + h: ST_TwipsMeasure; + vSpace: ST_TwipsMeasure; + hSpace: ST_TwipsMeasure; + wrap: ST_Wrap; + hAnchor: ST_HAnchor; + vAnchor: ST_VAnchor; + x: ST_SignedTwipsMeasure; + xAlign: ST_XAlign; + y: ST_SignedTwipsMeasure; + yAlign: ST_YAlign; + hRule: ST_HeightRule; + anchorLock: ST_OnOff; +} + export type ST_TabJc = | 'clear' | 'start' @@ -373,6 +2875,7 @@ export type ST_TabJc = | 'decimal' | 'bar' | 'num'; + export type ST_TabTlc = | 'none' | 'dot' @@ -380,7 +2883,37 @@ export type ST_TabTlc = | 'underscore' | 'heavy' | 'middleDot'; + +export interface CT_TabStop { + val: ST_TabJc; + leader: ST_TabTlc; + pos: ST_SignedTwipsMeasure; +} + export type ST_LineSpacingRule = 'auto' | 'exact' | 'atLeast'; + +export interface CT_Spacing { + before: ST_TwipsMeasure; + beforeLines: number; + beforeAutospacing: ST_OnOff; + after: ST_TwipsMeasure; + afterLines: number; + afterAutospacing: ST_OnOff; + line: ST_SignedTwipsMeasure; + lineRule: ST_LineSpacingRule; +} + +export interface CT_Ind { + start: ST_SignedTwipsMeasure; + startChars: number; + end: ST_SignedTwipsMeasure; + endChars: number; + hanging: ST_TwipsMeasure; + hangingChars: number; + firstLine: ST_TwipsMeasure; + firstLineChars: number; +} + export type ST_Jc = | 'start' | 'center' @@ -392,7 +2925,17 @@ export type ST_Jc = | 'highKashida' | 'lowKashida' | 'thaiDistribute'; + export type ST_JcTable = 'center' | 'end' | 'start'; + +export interface CT_Jc { + val: ST_Jc; +} + +export interface CT_JcTable { + val: ST_JcTable; +} + export type ST_View = | 'none' | 'print' @@ -400,15 +2943,53 @@ export type ST_View = | 'masterPages' | 'normal' | 'web'; + +export interface CT_View { + val: ST_View; +} + export type ST_Zoom = 'none' | 'fullPage' | 'bestFit' | 'textFit'; + +export interface CT_Zoom { + val: ST_Zoom; + percent: string; +} + +export interface CT_WritingStyle { + lang: string; + vendorID: string; + dllVersion: string; + nlCheck: ST_OnOff; + checkStyle: ST_OnOff; + appName: string; +} + export type ST_Proof = 'clean' | 'dirty'; + +export interface CT_Proof { + spelling: ST_Proof; + grammar: ST_Proof; +} + export type ST_DocType = string; + +export interface CT_DocType { + val: string; +} + export type ST_DocProtect = | 'none' | 'readOnly' | 'comments' | 'trackedChanges' | 'forms'; + +export interface CT_DocProtect { + edit: ST_DocProtect; + formatting: ST_OnOff; + enforcement: ST_OnOff; +} + export type ST_MailMergeDocType = | 'catalog' | 'envelopes' @@ -416,31 +2997,244 @@ export type ST_MailMergeDocType = | 'formLetters' | 'email' | 'fax'; + +export interface CT_MailMergeDocType { + val: ST_MailMergeDocType; +} + export type ST_MailMergeDataType = string; + +export interface CT_MailMergeDataType { + val: string; +} + export type ST_MailMergeDest = 'newDocument' | 'printer' | 'email' | 'fax'; + +export interface CT_MailMergeDest { + val: ST_MailMergeDest; +} + export type ST_MailMergeOdsoFMDFieldType = 'null' | 'dbColumn'; + +export interface CT_MailMergeOdsoFMDFieldType { + val: ST_MailMergeOdsoFMDFieldType; +} + +export interface CT_TrackChangesView { + markup: ST_OnOff; + comments: ST_OnOff; + insDel: ST_OnOff; + formatting: ST_OnOff; + inkAnnotations: ST_OnOff; +} + +export interface CT_Kinsoku { + lang: string; + val: string; +} + export type ST_TextDirection = 'tb' | 'rl' | 'lr' | 'tbV' | 'rlV' | 'lrV'; + +export interface CT_TextDirection { + val: ST_TextDirection; +} + export type ST_TextAlignment = | 'top' | 'center' | 'baseline' | 'bottom' | 'auto'; + +export interface CT_TextAlignment { + val: ST_TextAlignment; +} + export type ST_DisplacedByCustomXml = 'next' | 'prev'; + export type ST_AnnotationVMerge = 'cont' | 'rest'; + +export interface CT_Markup { + id: number; +} + +export interface CT_TrackChange {} + +export interface CT_CellMergeTrackChange {} + +export interface CT_TrackChangeRange {} + +export interface CT_MarkupRange {} + +export interface CT_BookmarkRange {} + +export interface CT_Bookmark {} + +export interface CT_MoveBookmark {} + +export interface CT_Comment {} + +export interface CT_TblPrExChange {} + +export interface CT_TcPrChange {} + +export interface CT_TrPrChange {} + +export interface CT_TblGridChange {} + +export interface CT_TblPrChange {} + +export interface CT_SectPrChange {} + +export interface CT_PPrChange {} + +export interface CT_RPrChange {} + +export interface CT_ParaRPrChange {} + +export interface CT_RunTrackChange {} + +export interface CT_NumPr { + ilvl: CT_DecimalNumber[]; + numId: CT_DecimalNumber[]; + ins: CT_TrackChange[]; +} + +export interface CT_PBdr { + top: CT_Border[]; + left: CT_Border[]; + bottom: CT_Border[]; + right: CT_Border[]; + between: CT_Border[]; + bar: CT_Border[]; +} + +export interface CT_Tabs { + tab: CT_TabStop[]; +} + export type ST_TextboxTightWrap = | 'none' | 'allLines' | 'firstAndLastLine' | 'firstLineOnly' | 'lastLineOnly'; + +export interface CT_TextboxTightWrap { + val: ST_TextboxTightWrap; +} + +export interface CT_PPr {} + +export interface CT_Cnf { + firstRow: ST_OnOff; + lastRow: ST_OnOff; + firstColumn: ST_OnOff; + lastColumn: ST_OnOff; + oddVBand: ST_OnOff; + evenVBand: ST_OnOff; + oddHBand: ST_OnOff; + evenHBand: ST_OnOff; + firstRowFirstColumn: ST_OnOff; + firstRowLastColumn: ST_OnOff; + lastRowFirstColumn: ST_OnOff; + lastRowLastColumn: ST_OnOff; +} + +export interface CT_PPrBase { + pStyle: CT_String[]; + keepNext: CT_OnOff[]; + keepLines: CT_OnOff[]; + pageBreakBefore: CT_OnOff[]; + framePr: CT_FramePr[]; + widowControl: CT_OnOff[]; + numPr: CT_NumPr[]; + suppressLineNumbers: CT_OnOff[]; + pBdr: CT_PBdr[]; + shd: CT_Shd[]; + tabs: CT_Tabs[]; + suppressAutoHyphens: CT_OnOff[]; + kinsoku: CT_OnOff[]; + wordWrap: CT_OnOff[]; + overflowPunct: CT_OnOff[]; + topLinePunct: CT_OnOff[]; + autoSpaceDE: CT_OnOff[]; + autoSpaceDN: CT_OnOff[]; + bidi: CT_OnOff[]; + adjustRightInd: CT_OnOff[]; + snapToGrid: CT_OnOff[]; + spacing: CT_Spacing[]; + ind: CT_Ind[]; + contextualSpacing: CT_OnOff[]; + mirrorIndents: CT_OnOff[]; + suppressOverlap: CT_OnOff[]; + jc: CT_Jc[]; + textDirection: CT_TextDirection[]; + textAlignment: CT_TextAlignment[]; + textboxTightWrap: CT_TextboxTightWrap[]; + outlineLvl: CT_DecimalNumber[]; + divId: CT_DecimalNumber[]; + cnfStyle: CT_Cnf; +} + +export interface CT_PPrGeneral {} + +export interface CT_Control { + name: string; + shapeid: string; + r_id: string; +} + +export interface CT_Drawing {} + +export interface CT_Background { + drawing: CT_Drawing[]; + color: ST_HexColor; + themeColor: ST_ThemeColor; + themeTint: string; + themeShade: string; +} + +export interface CT_Rel { + r_id: string; +} + +export interface CT_Object { + drawing: CT_Drawing[]; + dxaOrig: ST_TwipsMeasure; + dyaOrig: ST_TwipsMeasure; +} + export type ST_ObjectDrawAspect = 'content' | 'icon'; + +export interface CT_ObjectEmbed { + drawAspect: ST_ObjectDrawAspect; + r_id: string; + progId: string; + shapeId: string; + fieldCodes: string; +} + +export interface CT_ObjectLink {} + export type ST_ObjectUpdateMode = 'always' | 'onCall'; + +export interface CT_SimpleField { + instr: string; + fldLock: ST_OnOff; + dirty: ST_OnOff; +} + export type ST_FldCharType = 'begin' | 'separate' | 'end'; + export type ST_InfoTextType = 'text' | 'autoText'; + export type ST_FFHelpTextVal = string; + export type ST_FFStatusTextVal = string; + export type ST_FFName = string; + export type ST_FFTextType = | 'regular' | 'number' @@ -448,12 +3242,78 @@ export type ST_FFTextType = | 'currentTime' | 'currentDate' | 'calculated'; + +export interface CT_FFTextType { + val: ST_FFTextType; +} + +export interface CT_FFName { + val: string; +} + +export interface CT_FFHelpText { + type: ST_InfoTextType; + val: string; +} + +export interface CT_FFStatusText { + type: ST_InfoTextType; + val: string; +} + +export interface CT_FFData { + name: CT_FFName[]; + label: CT_DecimalNumber[]; + tabIndex: CT_UnsignedDecimalNumber[]; + enabled: CT_OnOff[]; + calcOnExit: CT_OnOff[]; + entryMacro: CT_MacroName; + exitMacro: CT_MacroName; + helpText: CT_FFHelpText; + statusText: CT_FFStatusText; +} + +export interface CT_FldChar { + ffData: CT_FFData; + fldCharType: ST_FldCharType; + fldLock: ST_OnOff; + dirty: ST_OnOff; +} + +export interface CT_FFCheckBox { + default: CT_OnOff[]; + checked: CT_OnOff[]; +} + +export interface CT_FFDDList { + result: CT_DecimalNumber[]; + default: CT_DecimalNumber[]; + listEntry: CT_String[]; +} + +export interface CT_FFTextInput { + type: CT_FFTextType[]; + default: CT_String[]; + maxLength: CT_DecimalNumber[]; + format: CT_String[]; +} + export type ST_SectionMark = | 'nextPage' | 'nextColumn' | 'continuous' | 'evenPage' | 'oddPage'; + +export interface CT_SectType { + val: ST_SectionMark; +} + +export interface CT_PaperSource { + first: number; + other: number; +} + export type ST_NumberFormat = | 'decimal' | 'upperRoman' @@ -518,31 +3378,148 @@ export type ST_NumberFormat = | 'bahtText' | 'dollarText' | 'custom'; + export type ST_PageOrientation = 'portrait' | 'landscape'; + +export interface CT_PageSz { + w: ST_TwipsMeasure; + h: ST_TwipsMeasure; + orient: ST_PageOrientation; + code: number; +} + +export interface CT_PageMar { + top: ST_SignedTwipsMeasure; + right: ST_TwipsMeasure; + bottom: ST_SignedTwipsMeasure; + left: ST_TwipsMeasure; + header: ST_TwipsMeasure; + footer: ST_TwipsMeasure; + gutter: ST_TwipsMeasure; +} + export type ST_PageBorderZOrder = 'front' | 'back'; + export type ST_PageBorderDisplay = 'allPages' | 'firstPage' | 'notFirstPage'; + export type ST_PageBorderOffset = 'page' | 'text'; + +export interface CT_TopPageBorder {} + +export interface CT_PageBorder {} + +export interface CT_BottomPageBorder {} + +export interface CT_PageBorders { + top: CT_TopPageBorder[]; + left: CT_PageBorder[]; + bottom: CT_BottomPageBorder[]; + right: CT_PageBorder[]; + zOrder: ST_PageBorderZOrder; + display: ST_PageBorderDisplay; + offsetFrom: ST_PageBorderOffset; +} + export type ST_ChapterSep = 'hyphen' | 'period' | 'colon' | 'emDash' | 'enDash'; + export type ST_LineNumberRestart = 'newPage' | 'newSection' | 'continuous'; + +export interface CT_LineNumber { + countBy: number; + start: number; + distance: ST_TwipsMeasure; + restart: ST_LineNumberRestart; +} + +export interface CT_PageNumber { + fmt: ST_NumberFormat; + start: number; + chapStyle: number; + chapSep: ST_ChapterSep; +} + +export interface CT_Column { + w: ST_TwipsMeasure; + space: ST_TwipsMeasure; +} + +export interface CT_Columns { + col: CT_Column[]; + equalWidth: ST_OnOff; + space: ST_TwipsMeasure; + num: number; + sep: ST_OnOff; +} + export type ST_VerticalJc = 'top' | 'center' | 'both' | 'bottom'; + +export interface CT_VerticalJc { + val: ST_VerticalJc; +} + export type ST_DocGrid = 'default' | 'lines' | 'linesAndChars' | 'snapToChars'; + +export interface CT_DocGrid { + type: ST_DocGrid; + linePitch: number; + charSpace: number; +} + export type ST_HdrFtr = 'even' | 'default' | 'first'; + export type ST_FtnEdn = | 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice'; + +export interface CT_HdrFtrRef {} + +export interface CT_HdrFtr {} + +export interface CT_SectPrBase {} + +export interface CT_SectPr { + sectPrChange: CT_SectPrChange[]; +} + export type ST_BrType = 'page' | 'column' | 'textWrapping'; + export type ST_BrClear = 'none' | 'left' | 'right' | 'all'; + +export interface CT_Br { + type: ST_BrType; + clear: ST_BrClear; +} + export type ST_PTabAlignment = 'left' | 'center' | 'right'; + export type ST_PTabRelativeTo = 'margin' | 'indent'; + export type ST_PTabLeader = | 'none' | 'dot' | 'hyphen' | 'underscore' | 'middleDot'; + +export interface CT_PTab { + alignment: ST_PTabAlignment; + relativeTo: ST_PTabRelativeTo; + leader: ST_PTabLeader; +} + +export interface CT_Sym { + font: string; + char: string; +} + export type ST_ProofErr = 'spellStart' | 'spellEnd' | 'gramStart' | 'gramEnd'; + +export interface CT_ProofErr { + type: ST_ProofErr; +} + export type ST_EdGrp = | 'none' | 'everyone' @@ -551,7 +3528,24 @@ export type ST_EdGrp = | 'editors' | 'owners' | 'current'; + +export interface CT_Perm { + id: string; + displacedByCustomXml: ST_DisplacedByCustomXml; +} + +export interface CT_PermStart {} + +export interface CT_Text {} + +export interface CT_R { + rsidRPr: string; + rsidDel: string; + rsidR: string; +} + export type ST_Hint = 'default' | 'eastAsia'; + export type ST_Theme = | 'majorEastAsia' | 'majorBidi' @@ -561,6 +3555,42 @@ export type ST_Theme = | 'minorBidi' | 'minorAscii' | 'minorHAnsi'; + +export interface CT_Fonts { + hint: ST_Hint; + ascii: string; + hAnsi: string; + eastAsia: string; + cs: string; + asciiTheme: ST_Theme; + hAnsiTheme: ST_Theme; + eastAsiaTheme: ST_Theme; + cstheme: ST_Theme; +} + +export interface CT_RPr {} + +export interface CT_MathCtrlIns {} + +export interface CT_MathCtrlDel {} + +export interface CT_RPrOriginal {} + +export interface CT_ParaRPrOriginal {} + +export interface CT_ParaRPr { + rPrChange: CT_ParaRPrChange[]; +} + +export interface CT_AltChunkPr { + matchSrc: CT_OnOff; +} + +export interface CT_AltChunk { + altChunkPr: CT_AltChunkPr; + r_id: string; +} + export type ST_RubyAlign = | 'center' | 'distributeLetter' @@ -568,24 +3598,471 @@ export type ST_RubyAlign = | 'left' | 'right' | 'rightVertical'; + +export interface CT_RubyAlign { + val: ST_RubyAlign; +} + +export interface CT_RubyPr { + rubyAlign: CT_RubyAlign[]; + hps: CT_HpsMeasure[]; + hpsRaise: CT_HpsMeasure[]; + hpsBaseText: CT_HpsMeasure[]; + lid: CT_Lang[]; + dirty: CT_OnOff[]; +} + +export interface CT_RubyContent {} + +export interface CT_Ruby { + rubyPr: CT_RubyPr[]; + rt: CT_RubyContent[]; + rubyBase: CT_RubyContent[]; +} + export type ST_Lock = | 'sdtLocked' | 'contentLocked' | 'unlocked' | 'sdtContentLocked'; + +export interface CT_Lock { + val: ST_Lock; +} + +export interface CT_SdtListItem { + displayText: string; + value: string; +} + export type ST_SdtDateMappingType = 'text' | 'date' | 'dateTime'; + +export interface CT_SdtDateMappingType { + val: ST_SdtDateMappingType; +} + +export interface CT_CalendarType { + val: ST_CalendarType; +} + +export interface CT_SdtDate { + dateFormat: CT_String[]; + lid: CT_Lang[]; + storeMappedDataAs: CT_SdtDateMappingType[]; + calendar: CT_CalendarType[]; + fullDate: string; +} + +export interface CT_SdtComboBox { + listItem: CT_SdtListItem[]; + lastValue: string; +} + +export interface CT_SdtDocPart { + docPartGallery: CT_String[]; + docPartCategory: CT_String[]; + docPartUnique: CT_OnOff[]; +} + +export interface CT_SdtDropDownList { + listItem: CT_SdtListItem[]; + lastValue: string; +} + +export interface CT_Placeholder { + docPart: CT_String[]; +} + +export interface CT_SdtText { + multiLine: ST_OnOff; +} + +export interface CT_DataBinding { + prefixMappings: string; + xpath: string; + storeItemID: string; +} + +export interface CT_SdtPr { + rPr: CT_RPr[]; + alias: CT_String[]; + tag: CT_String[]; + id: CT_DecimalNumber[]; + lock: CT_Lock[]; + placeholder: CT_Placeholder[]; + temporary: CT_OnOff[]; + showingPlcHdr: CT_OnOff[]; + dataBinding: CT_DataBinding[]; + label: CT_DecimalNumber[]; + tabIndex: CT_UnsignedDecimalNumber[]; +} + +export interface CT_SdtEndPr { + rPr: CT_RPr[]; +} + export type ST_Direction = 'ltr' | 'rtl'; + +export interface CT_DirContentRun { + val: ST_Direction; +} + +export interface CT_BdoContentRun { + val: ST_Direction; +} + +export interface CT_SdtContentRun {} + +export interface CT_SdtContentBlock {} + +export interface CT_SdtContentRow {} + +export interface CT_SdtContentCell {} + +export interface CT_SdtBlock { + sdtPr: CT_SdtPr; + sdtEndPr: CT_SdtEndPr; + sdtContent: CT_SdtContentBlock; +} + +export interface CT_SdtRun { + sdtPr: CT_SdtPr; + sdtEndPr: CT_SdtEndPr; + sdtContent: CT_SdtContentRun; +} + +export interface CT_SdtCell { + sdtPr: CT_SdtPr; + sdtEndPr: CT_SdtEndPr; + sdtContent: CT_SdtContentCell; +} + +export interface CT_SdtRow { + sdtPr: CT_SdtPr; + sdtEndPr: CT_SdtEndPr; + sdtContent: CT_SdtContentRow; +} + +export interface CT_Attr { + uri: string; + name: string; + val: string; +} + +export interface CT_CustomXmlPr { + placeholder: CT_String[]; + attr: CT_Attr[]; +} + +export interface CT_CustomXmlRun { + customXmlPr: CT_CustomXmlPr; + uri: string; + element: string; +} + +export interface CT_SmartTagPr { + attr: CT_Attr[]; +} + +export interface CT_SmartTagRun { + smartTagPr: CT_SmartTagPr; + uri: string; + element: string; +} + +export interface CT_CustomXmlBlock { + customXmlPr: CT_CustomXmlPr; + uri: string; + element: string; +} + +export interface CT_CustomXmlRow { + customXmlPr: CT_CustomXmlPr; + uri: string; + element: string; +} + +export interface CT_CustomXmlCell { + customXmlPr: CT_CustomXmlPr; + uri: string; + element: string; +} + +export interface CT_P { + pPr: CT_PPr[]; + rsidRPr: string; + rsidR: string; + rsidDel: string; + rsidP: string; + rsidRDefault: string; +} + export type ST_TblWidth = 'nil' | 'pct' | 'dxa' | 'auto'; + +export interface CT_Height { + val: ST_TwipsMeasure; + hRule: ST_HeightRule; +} + export type ST_MeasurementOrPercent = | ST_DecimalNumberOrPercent | ST_UniversalMeasure; +export interface CT_TblWidth { + w: ST_MeasurementOrPercent; + type: ST_TblWidth; +} + +export interface CT_TblGridCol { + w: ST_TwipsMeasure; +} + +export interface CT_TblGridBase { + gridCol: CT_TblGridCol[]; +} + +export interface CT_TblGrid {} + +export interface CT_TcBorders { + top: CT_Border[]; + start: CT_Border[]; + bottom: CT_Border[]; + end: CT_Border[]; + insideH: CT_Border[]; + insideV: CT_Border[]; + tl2br: CT_Border[]; + tr2bl: CT_Border[]; +} + +export interface CT_TcMar { + top: CT_TblWidth; + start: CT_TblWidth; + bottom: CT_TblWidth; + end: CT_TblWidth; +} + export type ST_Merge = 'continue' | 'restart'; + +export interface CT_VMerge { + val: ST_Merge; +} + +export interface CT_TcPrBase { + cnfStyle: CT_Cnf; + tcW: CT_TblWidth; + gridSpan: CT_DecimalNumber[]; + vMerge: CT_VMerge[]; + tcBorders: CT_TcBorders; + shd: CT_Shd[]; + noWrap: CT_OnOff[]; + tcMar: CT_TcMar; + textDirection: CT_TextDirection; + tcFitText: CT_OnOff; + vAlign: CT_VerticalJc[]; + hideMark: CT_OnOff[]; + headers: CT_Headers[]; +} + +export interface CT_TcPr {} + +export interface CT_TcPrInner {} + +export interface CT_Tc { + tcPr: CT_TcPr; + id: string; +} + +export interface CT_TrPrBase { + cnfStyle: CT_Cnf; + divId: CT_DecimalNumber[]; + gridBefore: CT_DecimalNumber[]; + gridAfter: CT_DecimalNumber[]; + wBefore: CT_TblWidth; + wAfter: CT_TblWidth; + cantSplit: CT_OnOff[]; + trHeight: CT_Height[]; + tblHeader: CT_OnOff[]; + tblCellSpacing: CT_TblWidth; + jc: CT_JcTable; + hidden: CT_OnOff[]; +} + +export interface CT_TrPr {} + +export interface CT_TblPrEx {} + +export interface CT_Row { + tblPrEx: CT_TblPrEx; + trPr: CT_TrPr; + rsidRPr: string; + rsidR: string; + rsidDel: string; + rsidTr: string; +} + export type ST_TblLayoutType = 'fixed' | 'autofit'; + +export interface CT_TblLayoutType { + type: ST_TblLayoutType; +} + export type ST_TblOverlap = 'never' | 'overlap'; + +export interface CT_TblOverlap { + val: ST_TblOverlap; +} + +export interface CT_TblPPr { + leftFromText: ST_TwipsMeasure; + rightFromText: ST_TwipsMeasure; + topFromText: ST_TwipsMeasure; + bottomFromText: ST_TwipsMeasure; + vertAnchor: ST_VAnchor; + horzAnchor: ST_HAnchor; + tblpXSpec: ST_XAlign; + tblpX: ST_SignedTwipsMeasure; + tblpYSpec: ST_YAlign; + tblpY: ST_SignedTwipsMeasure; +} + +export interface CT_TblCellMar { + top: CT_TblWidth; + start: CT_TblWidth; + bottom: CT_TblWidth; + end: CT_TblWidth; +} + +export interface CT_TblBorders { + top: CT_Border[]; + start: CT_Border[]; + bottom: CT_Border[]; + end: CT_Border[]; + insideH: CT_Border[]; + insideV: CT_Border[]; +} + +export interface CT_TblLook { + firstRow: ST_OnOff; + lastRow: ST_OnOff; + firstColumn: ST_OnOff; + lastColumn: ST_OnOff; + noHBand: ST_OnOff; + noVBand: ST_OnOff; +} + +export interface CT_TblPrBase { + tblStyle: CT_String[]; + tblpPr: CT_TblPPr; + tblOverlap: CT_TblOverlap; + bidiVisual: CT_OnOff; + tblStyleRowBandSize: CT_DecimalNumber; + tblStyleColBandSize: CT_DecimalNumber; + tblW: CT_TblWidth; + jc: CT_JcTable; + tblCellSpacing: CT_TblWidth; + tblInd: CT_TblWidth; + tblBorders: CT_TblBorders; + shd: CT_Shd; + tblLayout: CT_TblLayoutType; + tblCellMar: CT_TblCellMar; + tblLook: CT_TblLook; + tblCaption: CT_String; + tblDescription: CT_String; +} + +export interface CT_TblPr {} + +export interface CT_TblPrExBase { + tblW: CT_TblWidth; + jc: CT_JcTable; + tblCellSpacing: CT_TblWidth; + tblInd: CT_TblWidth; + tblBorders: CT_TblBorders; + shd: CT_Shd; + tblLayout: CT_TblLayoutType; + tblCellMar: CT_TblCellMar; + tblLook: CT_TblLook; +} + +export interface CT_Tbl { + tblPr: CT_TblPr[]; + tblGrid: CT_TblGrid[]; +} + export type ST_FtnPos = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd'; + +export interface CT_FtnPos { + val: ST_FtnPos; +} + export type ST_EdnPos = 'sectEnd' | 'docEnd'; + +export interface CT_EdnPos { + val: ST_EdnPos; +} + +export interface CT_NumFmt { + val: ST_NumberFormat; + format: string; +} + export type ST_RestartNumber = 'continuous' | 'eachSect' | 'eachPage'; + +export interface CT_NumRestart { + val: ST_RestartNumber; +} + +export interface CT_FtnEdnRef { + customMarkFollows: ST_OnOff; + id: number; +} + +export interface CT_FtnEdnSepRef { + id: number; +} + +export interface CT_FtnEdn { + type: ST_FtnEdn; + id: number; +} + +export interface CT_FtnProps { + pos: CT_FtnPos[]; + numFmt: CT_NumFmt[]; +} + +export interface CT_EdnProps { + pos: CT_EdnPos[]; + numFmt: CT_NumFmt[]; +} + +export interface CT_FtnDocProps {} + +export interface CT_EdnDocProps {} + +export interface CT_Base64Binary { + val: string; +} + +export interface CT_RecipientData { + active: CT_OnOff[]; + column: CT_DecimalNumber[]; + uniqueTag: CT_Base64Binary[]; +} + +export interface CT_Recipients { + recipientData: CT_RecipientData[]; +} + +export interface CT_OdsoFieldMapData { + type: CT_MailMergeOdsoFMDFieldType[]; + name: CT_String[]; + mappedName: CT_String[]; + column: CT_DecimalNumber[]; + lid: CT_Lang[]; + dynamicAddress: CT_OnOff[]; +} + export type ST_MailMergeSourceType = | 'database' | 'addressBook' @@ -596,11 +4073,116 @@ export type ST_MailMergeSourceType = | 'native' | 'legacy' | 'master'; -export type ST_TargetScreenSz = string; + +export interface CT_MailMergeSourceType { + val: ST_MailMergeSourceType; +} + +export interface CT_Odso { + udl: CT_String[]; + table: CT_String[]; + src: CT_Rel[]; + colDelim: CT_DecimalNumber[]; + type: CT_MailMergeSourceType[]; + fHdr: CT_OnOff[]; + fieldMapData: CT_OdsoFieldMapData[]; + recipientData: CT_Rel[]; +} + +export interface CT_MailMerge { + mainDocumentType: CT_MailMergeDocType[]; + linkToQuery: CT_OnOff[]; + dataType: CT_MailMergeDataType[]; + connectString: CT_String[]; + query: CT_String[]; + dataSource: CT_Rel[]; + headerSource: CT_Rel[]; + doNotSuppressBlankLines: CT_OnOff[]; + destination: CT_MailMergeDest[]; + addressFieldName: CT_String[]; + mailSubject: CT_String[]; + mailAsAttachment: CT_OnOff[]; + viewMergedData: CT_OnOff[]; + activeRecord: CT_DecimalNumber[]; + checkErrors: CT_DecimalNumber[]; + odso: CT_Odso[]; +} + +export type ST_TargetScreenSz = + | '544x376' + | '640x480' + | '720x512' + | '800x600' + | '1024x768' + | '1152x882' + | '1152x900' + | '1280x1024' + | '1600x1200' + | '1800x1440' + | '1920x1200'; + +export interface CT_TargetScreenSz { + val: ST_TargetScreenSz; +} + +export interface CT_CompatSetting { + name: string; + uri: string; + val: string; +} + +export interface CT_Compat { + spaceForUL: CT_OnOff[]; + balanceSingleByteDoubleByteWidth: CT_OnOff[]; + doNotLeaveBackslashAlone: CT_OnOff[]; + ulTrailSpace: CT_OnOff[]; + doNotExpandShiftReturn: CT_OnOff[]; + adjustLineHeightInTable: CT_OnOff[]; + applyBreakingRules: CT_OnOff[]; + compatSetting: CT_CompatSetting[]; +} + +export interface CT_DocVar { + name: string; + val: string; +} + +export interface CT_DocVars { + docVar: CT_DocVar[]; +} + +export interface CT_DocRsids { + rsidRoot: CT_LongHexNumber; + rsid: CT_LongHexNumber[]; +} + export type ST_CharacterSpacing = | 'doNotCompress' | 'compressPunctuation' | 'compressPunctuationAndJapaneseKana'; + +export interface CT_CharacterSpacing { + val: ST_CharacterSpacing; +} + +export interface CT_SaveThroughXslt { + r_id: string; + solutionID: string; +} + +export interface CT_RPrDefault { + rPr: CT_RPr[]; +} + +export interface CT_PPrDefault { + pPr: CT_PPrGeneral[]; +} + +export interface CT_DocDefaults { + rPrDefault: CT_RPrDefault[]; + pPrDefault: CT_PPrDefault[]; +} + export type ST_WmlColorSchemeIndex = | 'dark1' | 'light1' @@ -614,6 +4196,51 @@ export type ST_WmlColorSchemeIndex = | 'accent6' | 'hyperlink' | 'followedHyperlink'; + +export interface CT_ColorSchemeMapping { + bg1: ST_WmlColorSchemeIndex; + t1: ST_WmlColorSchemeIndex; + bg2: ST_WmlColorSchemeIndex; + t2: ST_WmlColorSchemeIndex; + accent1: ST_WmlColorSchemeIndex; + accent2: ST_WmlColorSchemeIndex; + accent3: ST_WmlColorSchemeIndex; + accent4: ST_WmlColorSchemeIndex; + accent5: ST_WmlColorSchemeIndex; + accent6: ST_WmlColorSchemeIndex; + hyperlink: ST_WmlColorSchemeIndex; + followedHyperlink: ST_WmlColorSchemeIndex; +} + +export interface CT_ReadingModeInkLockDown { + actualPg: ST_OnOff; + w: number; + h: number; + fontSz: string; +} + +export interface CT_WriteProtection { + recommended: ST_OnOff; +} + +export interface CT_StylePaneFilter { + allStyles: ST_OnOff; + customStyles: ST_OnOff; + latentStyles: ST_OnOff; + stylesInUse: ST_OnOff; + headingStyles: ST_OnOff; + numberingStyles: ST_OnOff; + tableStyles: ST_OnOff; + directFormattingOnRuns: ST_OnOff; + directFormattingOnParagraphs: ST_OnOff; + directFormattingOnNumbering: ST_OnOff; + directFormattingOnTables: ST_OnOff; + clearFormatting: ST_OnOff; + top3HeadingStyles: ST_OnOff; + visibleStyles: ST_OnOff; + alternateStyleNames: ST_OnOff; +} + export type ST_StyleSort = | 'name' | 'priority' @@ -621,13 +4248,268 @@ export type ST_StyleSort = | 'font' | 'basedOn' | 'type'; -export type ST_FrameScrollbar = 'on' | 'off' | 'auto'; + +export interface CT_StyleSort { + val: ST_StyleSort; +} + +export type ST_CaptionPos = 'above' | 'below' | 'left' | 'right'; + +export interface CT_Caption { + name: string; + pos: ST_CaptionPos; + chapNum: ST_OnOff; + heading: number; + noLabel: ST_OnOff; + numFmt: ST_NumberFormat; + sep: ST_ChapterSep; +} + +export interface CT_AutoCaption { + name: string; + caption: string; +} + +export interface CT_AutoCaptions { + autoCaption: CT_AutoCaption[]; +} + +export interface CT_Captions { + caption: CT_Caption[]; + autoCaptions: CT_AutoCaptions; +} + +export interface CT_SmartTagType { + namespaceuri: string; + name: string; + url: string; +} + +export interface CT_Settings { + writeProtection: CT_WriteProtection[]; + view: CT_View[]; + zoom: CT_Zoom[]; + removePersonalInformation: CT_OnOff[]; + removeDateAndTime: CT_OnOff[]; + doNotDisplayPageBoundaries: CT_OnOff[]; + displayBackgroundShape: CT_OnOff[]; + printPostScriptOverText: CT_OnOff[]; + printFractionalCharacterWidth: CT_OnOff[]; + printFormsData: CT_OnOff[]; + embedTrueTypeFonts: CT_OnOff[]; + embedSystemFonts: CT_OnOff[]; + saveSubsetFonts: CT_OnOff[]; + saveFormsData: CT_OnOff[]; + mirrorMargins: CT_OnOff[]; + alignBordersAndEdges: CT_OnOff[]; + bordersDoNotSurroundHeader: CT_OnOff[]; + bordersDoNotSurroundFooter: CT_OnOff[]; + gutterAtTop: CT_OnOff[]; + hideSpellingErrors: CT_OnOff[]; + hideGrammaticalErrors: CT_OnOff[]; + activeWritingStyle: CT_WritingStyle[]; + proofState: CT_Proof[]; + formsDesign: CT_OnOff[]; + attachedTemplate: CT_Rel[]; + linkStyles: CT_OnOff[]; + stylePaneFormatFilter: CT_StylePaneFilter[]; + stylePaneSortMethod: CT_StyleSort[]; + documentType: CT_DocType[]; + mailMerge: CT_MailMerge[]; + revisionView: CT_TrackChangesView[]; + trackRevisions: CT_OnOff[]; + doNotTrackMoves: CT_OnOff[]; + doNotTrackFormatting: CT_OnOff[]; + documentProtection: CT_DocProtect[]; + autoFormatOverride: CT_OnOff[]; + styleLockTheme: CT_OnOff[]; + styleLockQFSet: CT_OnOff[]; + defaultTabStop: CT_TwipsMeasure[]; + autoHyphenation: CT_OnOff[]; + consecutiveHyphenLimit: CT_DecimalNumber[]; + hyphenationZone: CT_TwipsMeasure[]; + doNotHyphenateCaps: CT_OnOff[]; + showEnvelope: CT_OnOff[]; + summaryLength: CT_DecimalNumberOrPrecent[]; + clickAndTypeStyle: CT_String[]; + defaultTableStyle: CT_String[]; + evenAndOddHeaders: CT_OnOff[]; + bookFoldRevPrinting: CT_OnOff[]; + bookFoldPrinting: CT_OnOff[]; + bookFoldPrintingSheets: CT_DecimalNumber[]; + drawingGridHorizontalSpacing: CT_TwipsMeasure[]; + drawingGridVerticalSpacing: CT_TwipsMeasure[]; + displayHorizontalDrawingGridEvery: CT_DecimalNumber[]; + displayVerticalDrawingGridEvery: CT_DecimalNumber[]; + doNotUseMarginsForDrawingGridOrigin: CT_OnOff[]; + drawingGridHorizontalOrigin: CT_TwipsMeasure[]; + drawingGridVerticalOrigin: CT_TwipsMeasure[]; + doNotShadeFormData: CT_OnOff[]; + noPunctuationKerning: CT_OnOff[]; + characterSpacingControl: CT_CharacterSpacing[]; + printTwoOnOne: CT_OnOff[]; + strictFirstAndLastChars: CT_OnOff[]; + noLineBreaksAfter: CT_Kinsoku[]; + noLineBreaksBefore: CT_Kinsoku[]; + savePreviewPicture: CT_OnOff[]; + doNotValidateAgainstSchema: CT_OnOff[]; + saveInvalidXml: CT_OnOff[]; + ignoreMixedContent: CT_OnOff[]; + alwaysShowPlaceholderText: CT_OnOff[]; + doNotDemarcateInvalidXml: CT_OnOff[]; + saveXmlDataOnly: CT_OnOff[]; + useXSLTWhenSaving: CT_OnOff[]; + saveThroughXslt: CT_SaveThroughXslt[]; + showXMLTags: CT_OnOff[]; + alwaysMergeEmptyNamespace: CT_OnOff[]; + updateFields: CT_OnOff[]; + footnotePr: CT_FtnDocProps[]; + endnotePr: CT_EdnDocProps[]; + compat: CT_Compat[]; + docVars: CT_DocVars[]; + rsids: CT_DocRsids[]; + attachedSchema: CT_String[]; + themeFontLang: CT_Language; + clrSchemeMapping: CT_ColorSchemeMapping[]; + doNotIncludeSubdocsInStats: CT_OnOff[]; + doNotAutoCompressPictures: CT_OnOff[]; + forceUpgrade: CT_Empty; + captions: CT_Captions; + readModeInkLockDown: CT_ReadingModeInkLockDown[]; + smartTagType: CT_SmartTagType[]; + doNotEmbedSmartTags: CT_OnOff[]; + decimalSymbol: CT_String; + listSeparator: CT_String; +} + +export interface CT_FramesetSplitbar { + w: CT_TwipsMeasure[]; + color: CT_Color[]; + noBorder: CT_OnOff[]; + flatBorders: CT_OnOff[]; +} + export type ST_FrameLayout = 'rows' | 'cols' | 'none'; + +export interface CT_FrameLayout { + val: ST_FrameLayout; +} + +export interface CT_Frameset { + sz: CT_String[]; + framesetSplitbar: CT_FramesetSplitbar[]; + frameLayout: CT_FrameLayout[]; + title: CT_String[]; +} + +export interface CT_OptimizeForBrowser {} + +export interface CT_WebSettings { + frameset: CT_Frameset[]; + divs: CT_Divs[]; + encoding: CT_String[]; + optimizeForBrowser: CT_OptimizeForBrowser[]; + allowPNG: CT_OnOff[]; + doNotRelyOnCSS: CT_OnOff[]; + doNotSaveAsSingleFile: CT_OnOff[]; + doNotOrganizeInFolder: CT_OnOff[]; + doNotUseLongFileNames: CT_OnOff[]; + pixelsPerInch: CT_DecimalNumber[]; + targetScreenSz: CT_TargetScreenSz[]; + saveSmartTagsAsXml: CT_OnOff[]; +} + +export type ST_FrameScrollbar = 'on' | 'off' | 'auto'; + +export interface CT_FrameScrollbar { + val: ST_FrameScrollbar; +} + +export interface CT_Frame { + sz: CT_String[]; + name: CT_String[]; + title: CT_String[]; + longDesc: CT_Rel[]; + sourceFileName: CT_Rel[]; + marW: CT_PixelsMeasure[]; + marH: CT_PixelsMeasure[]; + scrollbar: CT_FrameScrollbar[]; + noResizeAllowed: CT_OnOff[]; + linkedToFile: CT_OnOff[]; +} + +export interface CT_NumPicBullet { + drawing: CT_Drawing[]; + numPicBulletId: number; +} + export type ST_LevelSuffix = 'tab' | 'space' | 'nothing'; + +export interface CT_LevelSuffix { + val: ST_LevelSuffix; +} + +export interface CT_LevelText { + val: string; + null: ST_OnOff; +} + +export interface CT_Lvl { + start: CT_DecimalNumber[]; + numFmt: CT_NumFmt[]; + lvlRestart: CT_DecimalNumber[]; + pStyle: CT_String[]; + isLgl: CT_OnOff[]; + suff: CT_LevelSuffix[]; + lvlText: CT_LevelText[]; + lvlPicBulletId: CT_DecimalNumber[]; + lvlJc: CT_Jc[]; + pPr: CT_PPrGeneral[]; + rPr: CT_RPr[]; + ilvl: number; + tplc: string; + tentative: ST_OnOff; +} + export type ST_MultiLevelType = | 'singleLevel' | 'multilevel' | 'hybridMultilevel'; + +export interface CT_MultiLevelType { + val: ST_MultiLevelType; +} + +export interface CT_AbstractNum { + nsid: CT_LongHexNumber[]; + multiLevelType: CT_MultiLevelType[]; + tmpl: CT_LongHexNumber[]; + name: CT_String[]; + styleLink: CT_String[]; + numStyleLink: CT_String[]; + lvl: CT_Lvl[]; + abstractNumId: number; +} + +export interface CT_NumLvl { + startOverride: CT_DecimalNumber[]; + lvl: CT_Lvl; + ilvl: number; +} + +export interface CT_Num { + abstractNumId: CT_DecimalNumber[]; + lvlOverride: CT_NumLvl[]; + numId: number; +} + +export interface CT_Numbering { + numPicBullet: CT_NumPicBullet[]; + abstractNum: CT_AbstractNum[]; + num: CT_Num[]; + numIdMacAtCleanup: CT_DecimalNumber[]; +} + export type ST_TblStyleOverrideType = | 'wholeTable' | 'firstRow' @@ -642,7 +4524,76 @@ export type ST_TblStyleOverrideType = | 'nwCell' | 'seCell' | 'swCell'; + +export interface CT_TblStylePr { + pPr: CT_PPrGeneral[]; + rPr: CT_RPr[]; + tblPr: CT_TblPrBase[]; + trPr: CT_TrPr; + tcPr: CT_TcPr; + type: ST_TblStyleOverrideType; +} + export type ST_StyleType = 'paragraph' | 'character' | 'table' | 'numbering'; + +export interface CT_Style { + name: CT_String; + aliases: CT_String[]; + basedOn: CT_String[]; + next: CT_String[]; + link: CT_String[]; + autoRedefine: CT_OnOff[]; + hidden: CT_OnOff[]; + uiPriority: CT_DecimalNumber[]; + semiHidden: CT_OnOff[]; + unhideWhenUsed: CT_OnOff[]; + qFormat: CT_OnOff[]; + locked: CT_OnOff[]; + personal: CT_OnOff[]; + personalCompose: CT_OnOff[]; + personalReply: CT_OnOff[]; + rsid: CT_LongHexNumber[]; + pPr: CT_PPrGeneral; + rPr: CT_RPr; + tblPr: CT_TblPrBase; + trPr: CT_TrPr; + tcPr: CT_TcPr; + tblStylePr: CT_TblStylePr[]; + type: ST_StyleType; + styleId: string; + default: ST_OnOff; + customStyle: ST_OnOff; +} + +export interface CT_LsdException { + name: string; + locked: ST_OnOff; + uiPriority: number; + semiHidden: ST_OnOff; + unhideWhenUsed: ST_OnOff; + qFormat: ST_OnOff; +} + +export interface CT_LatentStyles { + lsdException: CT_LsdException[]; + defLockedState: ST_OnOff; + defUIPriority: number; + defSemiHidden: ST_OnOff; + defUnhideWhenUsed: ST_OnOff; + defQFormat: ST_OnOff; + count: number; +} + +export interface CT_Styles { + docDefaults: CT_DocDefaults[]; + latentStyles: CT_LatentStyles; + style: CT_Style[]; +} + +export interface CT_Panose { + val: string; +} + export type ST_FontFamily = | 'decorative' | 'modern' @@ -650,26 +4601,96 @@ export type ST_FontFamily = | 'script' | 'swiss' | 'auto'; + +export interface CT_FontFamily { + val: ST_FontFamily; +} + export type ST_Pitch = 'fixed' | 'variable' | 'default'; -export type ST_ThemeColor = - | 'dark1' - | 'light1' - | 'dark2' - | 'light2' - | 'accent1' - | 'accent2' - | 'accent3' - | 'accent4' - | 'accent5' - | 'accent6' - | 'hyperlink' - | 'followedHyperlink' - | 'none' - | 'background1' - | 'text1' - | 'background2' - | 'text2'; + +export interface CT_Pitch { + val: ST_Pitch; +} + +export interface CT_FontSig { + usb0: string; + usb1: string; + usb2: string; + usb3: string; + csb0: string; + csb1: string; +} + +export interface CT_FontRel {} + +export interface CT_Font { + altName: CT_String; + panose1: CT_Panose; + charset: CT_Charset; + family: CT_FontFamily; + notTrueType: CT_OnOff; + pitch: CT_Pitch; + sig: CT_FontSig; + embedRegular: CT_FontRel; + embedBold: CT_FontRel; + embedItalic: CT_FontRel; + embedBoldItalic: CT_FontRel; + name: string; +} + +export interface CT_FontsList { + font: CT_Font[]; +} + +export interface CT_DivBdr { + top: CT_Border[]; + left: CT_Border[]; + bottom: CT_Border[]; + right: CT_Border[]; +} + +export interface CT_Div { + blockQuote: CT_OnOff[]; + bodyDiv: CT_OnOff[]; + marLeft: CT_SignedTwipsMeasure[]; + marRight: CT_SignedTwipsMeasure[]; + marTop: CT_SignedTwipsMeasure[]; + marBottom: CT_SignedTwipsMeasure[]; + divBdr: CT_DivBdr[]; + divsChild: CT_Divs[]; + id: number; +} + +export interface CT_Divs { + div: CT_Div[]; +} + +export interface CT_Body { + sectPr: CT_SectPr; +} + +export interface CT_Comments { + comment: CT_Comment[]; +} + +export interface CT_Footnotes { + footnote: CT_FtnEdn[]; +} + +export interface CT_Endnotes { + endnote: CT_FtnEdn[]; +} + export type ST_DocPartBehavior = 'content' | 'p' | 'pg'; + +export interface CT_DocPartBehavior { + val: ST_DocPartBehavior; +} + +export interface CT_DocPartBehaviors { + behavior: CT_DocPartBehavior[]; +} + export type ST_DocPartType = | 'none' | 'normal' @@ -678,6 +4699,16 @@ export type ST_DocPartType = | 'speller' | 'formFld' | 'bbPlcHdr'; + +export interface CT_DocPartType { + val: ST_DocPartType; +} + +export interface CT_DocPartTypes { + type: CT_DocPartType[]; + all: ST_OnOff; +} + export type ST_DocPartGallery = | 'placeholder' | 'any' @@ -717,914 +4748,103 @@ export type ST_DocPartGallery = | 'custom3' | 'custom4' | 'custom5'; -export type ST_CaptionPos = 'above' | 'below' | 'left' | 'right'; -export type ST_StyleMatrixColumnIndex = number; -export type ST_FontCollectionIndex = 'major' | 'minor' | 'none'; -export type ST_ColorSchemeIndex = - | 'dk1' - | 'lt1' - | 'dk2' - | 'lt2' - | 'accent1' - | 'accent2' - | 'accent3' - | 'accent4' - | 'accent5' - | 'accent6' - | 'hlink' - | 'folHlink'; -export type ST_Coordinate = ST_CoordinateUnqualified | ST_UniversalMeasure; -export type ST_CoordinateUnqualified = number; -export type ST_Coordinate32 = ST_Coordinate32Unqualified | ST_UniversalMeasure; +export interface CT_DocPartGallery { + val: ST_DocPartGallery; +} -export type ST_Coordinate32Unqualified = number; -export type ST_PositiveCoordinate = number; -export type ST_PositiveCoordinate32 = ST_Coordinate32Unqualified; -export type ST_Angle = number; -export type ST_FixedAngle = ST_Angle; -export type ST_PositiveFixedAngle = ST_Angle; -export type ST_SystemColorVal = - | 'scrollBar' - | 'background' - | 'activeCaption' - | 'inactiveCaption' - | 'menu' - | 'window' - | 'windowFrame' - | 'menuText' - | 'windowText' - | 'captionText' - | 'activeBorder' - | 'inactiveBorder' - | 'appWorkspace' - | 'highlight' - | 'highlightText' - | 'btnFace' - | 'btnShadow' - | 'grayText' - | 'btnText' - | 'inactiveCaptionText' - | 'btnHighlight' - | '3dDkShadow' - | '3dLight' - | 'infoText' - | 'infoBk' - | 'hotLight' - | 'gradientActiveCaption' - | 'gradientInactiveCaption' - | 'menuHighlight' - | 'menuBar'; -export type ST_SchemeColorVal = - | 'bg1' - | 'tx1' - | 'bg2' - | 'tx2' - | 'accent1' - | 'accent2' - | 'accent3' - | 'accent4' - | 'accent5' - | 'accent6' - | 'hlink' - | 'folHlink' - | 'phClr' - | 'dk1' - | 'lt1' - | 'dk2' - | 'lt2'; -export type ST_PresetColorVal = - | 'aliceBlue' - | 'antiqueWhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedAlmond' - | 'blue' - | 'blueViolet' - | 'brown' - | 'burlyWood' - | 'cadetBlue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerBlue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkBlue' - | 'darkCyan' - | 'darkGoldenrod' - | 'darkGray' - | 'darkGrey' - | 'darkGreen' - | 'darkKhaki' - | 'darkMagenta' - | 'darkOliveGreen' - | 'darkOrange' - | 'darkOrchid' - | 'darkRed' - | 'darkSalmon' - | 'darkSeaGreen' - | 'darkSlateBlue' - | 'darkSlateGray' - | 'darkSlateGrey' - | 'darkTurquoise' - | 'darkViolet' - | 'dkBlue' - | 'dkCyan' - | 'dkGoldenrod' - | 'dkGray' - | 'dkGrey' - | 'dkGreen' - | 'dkKhaki' - | 'dkMagenta' - | 'dkOliveGreen' - | 'dkOrange' - | 'dkOrchid' - | 'dkRed' - | 'dkSalmon' - | 'dkSeaGreen' - | 'dkSlateBlue' - | 'dkSlateGray' - | 'dkSlateGrey' - | 'dkTurquoise' - | 'dkViolet' - | 'deepPink' - | 'deepSkyBlue' - | 'dimGray' - | 'dimGrey' - | 'dodgerBlue' - | 'firebrick' - | 'floralWhite' - | 'forestGreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostWhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'grey' - | 'green' - | 'greenYellow' - | 'honeydew' - | 'hotPink' - | 'indianRed' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderBlush' - | 'lawnGreen' - | 'lemonChiffon' - | 'lightBlue' - | 'lightCoral' - | 'lightCyan' - | 'lightGoldenrodYellow' - | 'lightGray' - | 'lightGrey' - | 'lightGreen' - | 'lightPink' - | 'lightSalmon' - | 'lightSeaGreen' - | 'lightSkyBlue' - | 'lightSlateGray' - | 'lightSlateGrey' - | 'lightSteelBlue' - | 'lightYellow' - | 'ltBlue' - | 'ltCoral' - | 'ltCyan' - | 'ltGoldenrodYellow' - | 'ltGray' - | 'ltGrey' - | 'ltGreen' - | 'ltPink' - | 'ltSalmon' - | 'ltSeaGreen' - | 'ltSkyBlue' - | 'ltSlateGray' - | 'ltSlateGrey' - | 'ltSteelBlue' - | 'ltYellow' - | 'lime' - | 'limeGreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'medAquamarine' - | 'medBlue' - | 'medOrchid' - | 'medPurple' - | 'medSeaGreen' - | 'medSlateBlue' - | 'medSpringGreen' - | 'medTurquoise' - | 'medVioletRed' - | 'mediumAquamarine' - | 'mediumBlue' - | 'mediumOrchid' - | 'mediumPurple' - | 'mediumSeaGreen' - | 'mediumSlateBlue' - | 'mediumSpringGreen' - | 'mediumTurquoise' - | 'mediumVioletRed' - | 'midnightBlue' - | 'mintCream' - | 'mistyRose' - | 'moccasin' - | 'navajoWhite' - | 'navy' - | 'oldLace' - | 'olive' - | 'oliveDrab' - | 'orange' - | 'orangeRed' - | 'orchid' - | 'paleGoldenrod' - | 'paleGreen' - | 'paleTurquoise' - | 'paleVioletRed' - | 'papayaWhip' - | 'peachPuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderBlue' - | 'purple' - | 'red' - | 'rosyBrown' - | 'royalBlue' - | 'saddleBrown' - | 'salmon' - | 'sandyBrown' - | 'seaGreen' - | 'seaShell' - | 'sienna' - | 'silver' - | 'skyBlue' - | 'slateBlue' - | 'slateGray' - | 'slateGrey' - | 'snow' - | 'springGreen' - | 'steelBlue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whiteSmoke' - | 'yellow' - | 'yellowGreen'; -export type ST_RectAlignment = - | 'tl' - | 't' - | 'tr' - | 'l' - | 'ctr' - | 'r' - | 'bl' - | 'b' - | 'br'; -export type ST_BlackWhiteMode = - | 'clr' - | 'auto' - | 'gray' - | 'ltGray' - | 'invGray' - | 'grayWhite' - | 'blackGray' - | 'blackWhite' - | 'black' - | 'white' - | 'hidden'; -export type ST_DrawingElementId = number; -export type ST_ChartBuildStep = - | 'category' - | 'ptInCategory' - | 'series' - | 'ptInSeries' - | 'allPts' - | 'gridLegend'; -export type ST_DgmBuildStep = 'sp' | 'bg'; -export type ST_AnimationBuildType = 'allAtOnce'; -export type ST_AnimationDgmOnlyBuildType = 'one' | 'lvlOne' | 'lvlAtOnce'; -export type ST_AnimationDgmBuildType = - | ST_AnimationBuildType - | ST_AnimationDgmOnlyBuildType; +export interface CT_DocPartCategory { + name: CT_String; + gallery: CT_DocPartGallery; +} -export type ST_AnimationChartOnlyBuildType = - | 'series' - | 'category' - | 'seriesEl' - | 'categoryEl'; -export type ST_AnimationChartBuildType = - | ST_AnimationBuildType - | ST_AnimationChartOnlyBuildType; +export interface CT_DocPartName { + val: string; + decorated: ST_OnOff; +} -export type ST_PresetCameraType = - | 'legacyObliqueTopLeft' - | 'legacyObliqueTop' - | 'legacyObliqueTopRight' - | 'legacyObliqueLeft' - | 'legacyObliqueFront' - | 'legacyObliqueRight' - | 'legacyObliqueBottomLeft' - | 'legacyObliqueBottom' - | 'legacyObliqueBottomRight' - | 'legacyPerspectiveTopLeft' - | 'legacyPerspectiveTop' - | 'legacyPerspectiveTopRight' - | 'legacyPerspectiveLeft' - | 'legacyPerspectiveFront' - | 'legacyPerspectiveRight' - | 'legacyPerspectiveBottomLeft' - | 'legacyPerspectiveBottom' - | 'legacyPerspectiveBottomRight' - | 'orthographicFront' - | 'isometricTopUp' - | 'isometricTopDown' - | 'isometricBottomUp' - | 'isometricBottomDown' - | 'isometricLeftUp' - | 'isometricLeftDown' - | 'isometricRightUp' - | 'isometricRightDown' - | 'isometricOffAxis1Left' - | 'isometricOffAxis1Right' - | 'isometricOffAxis1Top' - | 'isometricOffAxis2Left' - | 'isometricOffAxis2Right' - | 'isometricOffAxis2Top' - | 'isometricOffAxis3Left' - | 'isometricOffAxis3Right' - | 'isometricOffAxis3Bottom' - | 'isometricOffAxis4Left' - | 'isometricOffAxis4Right' - | 'isometricOffAxis4Bottom' - | 'obliqueTopLeft' - | 'obliqueTop' - | 'obliqueTopRight' - | 'obliqueLeft' - | 'obliqueRight' - | 'obliqueBottomLeft' - | 'obliqueBottom' - | 'obliqueBottomRight' - | 'perspectiveFront' - | 'perspectiveLeft' - | 'perspectiveRight' - | 'perspectiveAbove' - | 'perspectiveBelow' - | 'perspectiveAboveLeftFacing' - | 'perspectiveAboveRightFacing' - | 'perspectiveContrastingLeftFacing' - | 'perspectiveContrastingRightFacing' - | 'perspectiveHeroicLeftFacing' - | 'perspectiveHeroicRightFacing' - | 'perspectiveHeroicExtremeLeftFacing' - | 'perspectiveHeroicExtremeRightFacing' - | 'perspectiveRelaxed' - | 'perspectiveRelaxedModerately'; -export type ST_FOVAngle = ST_Angle; -export type ST_LightRigDirection = - | 'tl' - | 't' - | 'tr' - | 'l' - | 'r' - | 'bl' - | 'b' - | 'br'; -export type ST_LightRigType = - | 'legacyFlat1' - | 'legacyFlat2' - | 'legacyFlat3' - | 'legacyFlat4' - | 'legacyNormal1' - | 'legacyNormal2' - | 'legacyNormal3' - | 'legacyNormal4' - | 'legacyHarsh1' - | 'legacyHarsh2' - | 'legacyHarsh3' - | 'legacyHarsh4' - | 'threePt' - | 'balanced' - | 'soft' - | 'harsh' - | 'flood' - | 'contrasting' - | 'morning' - | 'sunrise' - | 'sunset' - | 'chilly' - | 'freezing' - | 'flat' - | 'twoPt' - | 'glow' - | 'brightRoom'; -export type ST_BevelPresetType = - | 'relaxedInset' - | 'circle' - | 'slope' - | 'cross' - | 'angle' - | 'softRound' - | 'convex' - | 'coolSlant' - | 'divot' - | 'riblet' - | 'hardEdge' - | 'artDeco'; -export type ST_PresetMaterialType = - | 'legacyMatte' - | 'legacyPlastic' - | 'legacyMetal' - | 'legacyWireframe' - | 'matte' - | 'plastic' - | 'metal' - | 'warmMatte' - | 'translucentPowder' - | 'powder' - | 'dkEdge' - | 'softEdge' - | 'clear' - | 'flat' - | 'softmetal'; -export type ST_PresetShadowVal = - | 'shdw1' - | 'shdw2' - | 'shdw3' - | 'shdw4' - | 'shdw5' - | 'shdw6' - | 'shdw7' - | 'shdw8' - | 'shdw9' - | 'shdw10' - | 'shdw11' - | 'shdw12' - | 'shdw13' - | 'shdw14' - | 'shdw15' - | 'shdw16' - | 'shdw17' - | 'shdw18' - | 'shdw19' - | 'shdw20'; -export type ST_PathShadeType = 'shape' | 'circle' | 'rect'; -export type ST_TileFlipMode = 'none' | 'x' | 'y' | 'xy'; -export type ST_BlipCompression = - | 'email' - | 'screen' - | 'print' - | 'hqprint' - | 'none'; -export type ST_PresetPatternVal = - | 'pct5' - | 'pct10' - | 'pct20' - | 'pct25' - | 'pct30' - | 'pct40' - | 'pct50' - | 'pct60' - | 'pct70' - | 'pct75' - | 'pct80' - | 'pct90' - | 'horz' - | 'vert' - | 'ltHorz' - | 'ltVert' - | 'dkHorz' - | 'dkVert' - | 'narHorz' - | 'narVert' - | 'dashHorz' - | 'dashVert' - | 'cross' - | 'dnDiag' - | 'upDiag' - | 'ltDnDiag' - | 'ltUpDiag' - | 'dkDnDiag' - | 'dkUpDiag' - | 'wdDnDiag' - | 'wdUpDiag' - | 'dashDnDiag' - | 'dashUpDiag' - | 'diagCross' - | 'smCheck' - | 'lgCheck' - | 'smGrid' - | 'lgGrid' - | 'dotGrid' - | 'smConfetti' - | 'lgConfetti' - | 'horzBrick' - | 'diagBrick' - | 'solidDmnd' - | 'openDmnd' - | 'dotDmnd' - | 'plaid' - | 'sphere' - | 'weave' - | 'divot' - | 'shingle' - | 'wave' - | 'trellis' - | 'zigZag'; -export type ST_BlendMode = 'over' | 'mult' | 'screen' | 'darken' | 'lighten'; -export type ST_EffectContainerType = 'sib' | 'tree'; -export type ST_ShapeType = - | 'line' - | 'lineInv' - | 'triangle' - | 'rtTriangle' - | 'rect' - | 'diamond' - | 'parallelogram' - | 'trapezoid' - | 'nonIsoscelesTrapezoid' - | 'pentagon' - | 'hexagon' - | 'heptagon' - | 'octagon' - | 'decagon' - | 'dodecagon' - | 'star4' - | 'star5' - | 'star6' - | 'star7' - | 'star8' - | 'star10' - | 'star12' - | 'star16' - | 'star24' - | 'star32' - | 'roundRect' - | 'round1Rect' - | 'round2SameRect' - | 'round2DiagRect' - | 'snipRoundRect' - | 'snip1Rect' - | 'snip2SameRect' - | 'snip2DiagRect' - | 'plaque' - | 'ellipse' - | 'teardrop' - | 'homePlate' - | 'chevron' - | 'pieWedge' - | 'pie' - | 'blockArc' - | 'donut' - | 'noSmoking' - | 'rightArrow' - | 'leftArrow' - | 'upArrow' - | 'downArrow' - | 'stripedRightArrow' - | 'notchedRightArrow' - | 'bentUpArrow' - | 'leftRightArrow' - | 'upDownArrow' - | 'leftUpArrow' - | 'leftRightUpArrow' - | 'quadArrow' - | 'leftArrowCallout' - | 'rightArrowCallout' - | 'upArrowCallout' - | 'downArrowCallout' - | 'leftRightArrowCallout' - | 'upDownArrowCallout' - | 'quadArrowCallout' - | 'bentArrow' - | 'uturnArrow' - | 'circularArrow' - | 'leftCircularArrow' - | 'leftRightCircularArrow' - | 'curvedRightArrow' - | 'curvedLeftArrow' - | 'curvedUpArrow' - | 'curvedDownArrow' - | 'swooshArrow' - | 'cube' - | 'can' - | 'lightningBolt' - | 'heart' - | 'sun' - | 'moon' - | 'smileyFace' - | 'irregularSeal1' - | 'irregularSeal2' - | 'foldedCorner' - | 'bevel' - | 'frame' - | 'halfFrame' - | 'corner' - | 'diagStripe' - | 'chord' - | 'arc' - | 'leftBracket' - | 'rightBracket' - | 'leftBrace' - | 'rightBrace' - | 'bracketPair' - | 'bracePair' - | 'straightConnector1' - | 'bentConnector2' - | 'bentConnector3' - | 'bentConnector4' - | 'bentConnector5' - | 'curvedConnector2' - | 'curvedConnector3' - | 'curvedConnector4' - | 'curvedConnector5' - | 'callout1' - | 'callout2' - | 'callout3' - | 'accentCallout1' - | 'accentCallout2' - | 'accentCallout3' - | 'borderCallout1' - | 'borderCallout2' - | 'borderCallout3' - | 'accentBorderCallout1' - | 'accentBorderCallout2' - | 'accentBorderCallout3' - | 'wedgeRectCallout' - | 'wedgeRoundRectCallout' - | 'wedgeEllipseCallout' - | 'cloudCallout' - | 'cloud' - | 'ribbon' - | 'ribbon2' - | 'ellipseRibbon' - | 'ellipseRibbon2' - | 'leftRightRibbon' - | 'verticalScroll' - | 'horizontalScroll' - | 'wave' - | 'doubleWave' - | 'plus' - | 'flowChartProcess' - | 'flowChartDecision' - | 'flowChartInputOutput' - | 'flowChartPredefinedProcess' - | 'flowChartInternalStorage' - | 'flowChartDocument' - | 'flowChartMultidocument' - | 'flowChartTerminator' - | 'flowChartPreparation' - | 'flowChartManualInput' - | 'flowChartManualOperation' - | 'flowChartConnector' - | 'flowChartPunchedCard' - | 'flowChartPunchedTape' - | 'flowChartSummingJunction' - | 'flowChartOr' - | 'flowChartCollate' - | 'flowChartSort' - | 'flowChartExtract' - | 'flowChartMerge' - | 'flowChartOfflineStorage' - | 'flowChartOnlineStorage' - | 'flowChartMagneticTape' - | 'flowChartMagneticDisk' - | 'flowChartMagneticDrum' - | 'flowChartDisplay' - | 'flowChartDelay' - | 'flowChartAlternateProcess' - | 'flowChartOffpageConnector' - | 'actionButtonBlank' - | 'actionButtonHome' - | 'actionButtonHelp' - | 'actionButtonInformation' - | 'actionButtonForwardNext' - | 'actionButtonBackPrevious' - | 'actionButtonEnd' - | 'actionButtonBeginning' - | 'actionButtonReturn' - | 'actionButtonDocument' - | 'actionButtonSound' - | 'actionButtonMovie' - | 'gear6' - | 'gear9' - | 'funnel' - | 'mathPlus' - | 'mathMinus' - | 'mathMultiply' - | 'mathDivide' - | 'mathEqual' - | 'mathNotEqual' - | 'cornerTabs' - | 'squareTabs' - | 'plaqueTabs' - | 'chartX' - | 'chartStar' - | 'chartPlus'; -export type ST_TextShapeType = - | 'textNoShape' - | 'textPlain' - | 'textStop' - | 'textTriangle' - | 'textTriangleInverted' - | 'textChevron' - | 'textChevronInverted' - | 'textRingInside' - | 'textRingOutside' - | 'textArchUp' - | 'textArchDown' - | 'textCircle' - | 'textButton' - | 'textArchUpPour' - | 'textArchDownPour' - | 'textCirclePour' - | 'textButtonPour' - | 'textCurveUp' - | 'textCurveDown' - | 'textCanUp' - | 'textCanDown' - | 'textWave1' - | 'textWave2' - | 'textDoubleWave1' - | 'textWave4' - | 'textInflate' - | 'textDeflate' - | 'textInflateBottom' - | 'textDeflateBottom' - | 'textInflateTop' - | 'textDeflateTop' - | 'textDeflateInflate' - | 'textDeflateInflateDeflate' - | 'textFadeRight' - | 'textFadeLeft' - | 'textFadeUp' - | 'textFadeDown' - | 'textSlantUp' - | 'textSlantDown' - | 'textCascadeUp' - | 'textCascadeDown'; -export type ST_GeomGuideName = string; -export type ST_GeomGuideFormula = string; -export type ST_AdjCoordinate = ST_Coordinate | ST_GeomGuideName; +export interface CT_DocPartPr {} -export type ST_AdjAngle = ST_Angle | ST_GeomGuideName; +export interface CT_DocPart { + docPartPr: CT_DocPartPr[]; + docPartBody: CT_Body[]; +} -export type ST_PathFillMode = - | 'none' - | 'norm' - | 'lighten' - | 'lightenLess' - | 'darken' - | 'darkenLess'; -export type ST_LineEndType = - | 'none' - | 'triangle' - | 'stealth' - | 'diamond' - | 'oval' - | 'arrow'; -export type ST_LineEndWidth = 'sm' | 'med' | 'lg'; -export type ST_LineEndLength = 'sm' | 'med' | 'lg'; -export type ST_PresetLineDashVal = - | 'solid' - | 'dot' - | 'dash' - | 'lgDash' - | 'dashDot' - | 'lgDashDot' - | 'lgDashDotDot' - | 'sysDash' - | 'sysDot' - | 'sysDashDot' - | 'sysDashDotDot'; -export type ST_LineCap = 'rnd' | 'sq' | 'flat'; -export type ST_LineWidth = ST_Coordinate32Unqualified; -export type ST_PenAlignment = 'ctr' | 'in'; -export type ST_CompoundLine = 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri'; -export type ST_ShapeID = string; -export type ST_OnOffStyleType = 'on' | 'off' | 'def'; -export type ST_TextAnchoringType = 't' | 'ctr' | 'b' | 'just' | 'dist'; -export type ST_TextVertOverflowType = 'overflow' | 'ellipsis' | 'clip'; -export type ST_TextHorzOverflowType = 'overflow' | 'clip'; -export type ST_TextVerticalType = - | 'horz' - | 'vert' - | 'vert270' - | 'wordArtVert' - | 'eaVert' - | 'mongolianVert' - | 'wordArtVertRtl'; -export type ST_TextWrappingType = 'none' | 'square'; -export type ST_TextColumnCount = number; -export type ST_TextFontScalePercentOrPercentString = ST_Percentage; +export interface CT_DocParts { + docPart: CT_DocPart[]; +} -export type ST_TextBulletStartAtNum = number; -export type ST_TextAutonumberScheme = - | 'alphaLcParenBoth' - | 'alphaUcParenBoth' - | 'alphaLcParenR' - | 'alphaUcParenR' - | 'alphaLcPeriod' - | 'alphaUcPeriod' - | 'arabicParenBoth' - | 'arabicParenR' - | 'arabicPeriod' - | 'arabicPlain' - | 'romanLcParenBoth' - | 'romanUcParenBoth' - | 'romanLcParenR' - | 'romanUcParenR' - | 'romanLcPeriod' - | 'romanUcPeriod' - | 'circleNumDbPlain' - | 'circleNumWdBlackPlain' - | 'circleNumWdWhitePlain' - | 'arabicDbPeriod' - | 'arabicDbPlain' - | 'ea1ChsPeriod' - | 'ea1ChsPlain' - | 'ea1ChtPeriod' - | 'ea1ChtPlain' - | 'ea1JpnChsDbPeriod' - | 'ea1JpnKorPlain' - | 'ea1JpnKorPeriod' - | 'arabic1Minus' - | 'arabic2Minus' - | 'hebrew2Minus' - | 'thaiAlphaPeriod' - | 'thaiAlphaParenR' - | 'thaiAlphaParenBoth' - | 'thaiNumPeriod' - | 'thaiNumParenR' - | 'thaiNumParenBoth' - | 'hindiAlphaPeriod' - | 'hindiNumPeriod' - | 'hindiNumParenR' - | 'hindiAlpha1Period'; -export type ST_TextBulletSize = ST_TextBulletSizePercent; +export interface CT_DocumentBase { + background: CT_Background[]; +} -export type ST_TextBulletSizePercent = string; -export type ST_TextPoint = ST_TextPointUnqualified | ST_UniversalMeasure; +export interface CT_Document {} -export type ST_TextPointUnqualified = number; -export type ST_TextNonNegativePoint = number; -export type ST_TextFontSize = number; -export type ST_TextTypeface = string; -export type ST_PitchFamily = number; -export type ST_TextUnderlineType = - | 'none' - | 'words' - | 'sng' - | 'dbl' - | 'heavy' - | 'dotted' - | 'dottedHeavy' - | 'dash' - | 'dashHeavy' - | 'dashLong' - | 'dashLongHeavy' - | 'dotDash' - | 'dotDashHeavy' - | 'dotDotDash' - | 'dotDotDashHeavy' - | 'wavy' - | 'wavyHeavy' - | 'wavyDbl'; -export type ST_TextStrikeType = 'noStrike' | 'sngStrike' | 'dblStrike'; -export type ST_TextCapsType = 'none' | 'small' | 'all'; -export type ST_TextSpacingPoint = number; -export type ST_TextSpacingPercentOrPercentString = ST_Percentage; +export interface CT_GlossaryDocument {} + +export interface CT_EffectExtent { + l: ST_Coordinate; + t: ST_Coordinate; + r: ST_Coordinate; + b: ST_Coordinate; +} -export type ST_TextMargin = ST_Coordinate32Unqualified; -export type ST_TextIndent = ST_Coordinate32Unqualified; -export type ST_TextTabAlignType = 'l' | 'ctr' | 'r' | 'dec'; -export type ST_TextAlignType = - | 'l' - | 'ctr' - | 'r' - | 'just' - | 'justLow' - | 'dist' - | 'thaiDist'; -export type ST_TextFontAlignType = 'auto' | 't' | 'ctr' | 'base' | 'b'; -export type ST_TextIndentLevelType = number; export type ST_WrapDistance = number; + +export interface CT_Inline { + extent: CT_PositiveSize2D[]; + effectExtent: CT_EffectExtent[]; + docPr: CT_NonVisualDrawingProps; + cNvGraphicFramePr: CT_NonVisualGraphicFrameProperties; + distT: number; + distB: number; + distL: number; + distR: number; +} + export type ST_WrapText = 'bothSides' | 'left' | 'right' | 'largest'; + +export interface CT_WrapPath { + start: CT_Point2D; + lineTo: CT_Point2D[]; + edited: boolean; +} + +export interface CT_WrapNone {} + +export interface CT_WrapSquare { + effectExtent: CT_EffectExtent[]; + wrapText: ST_WrapText; + distT: number; + distB: number; + distL: number; + distR: number; +} + +export interface CT_WrapTight { + wrapPolygon: CT_WrapPath; + wrapText: ST_WrapText; + distL: number; + distR: number; +} + +export interface CT_WrapThrough { + wrapPolygon: CT_WrapPath; + wrapText: ST_WrapText; + distL: number; + distR: number; +} + +export interface CT_WrapTopBottom { + effectExtent: CT_EffectExtent[]; + distT: number; + distB: number; +} + export type ST_PositionOffset = number; + export type ST_AlignH = 'left' | 'right' | 'center' | 'inside' | 'outside'; + export type ST_RelFromH = | 'margin' | 'page' @@ -1634,7 +4854,13 @@ export type ST_RelFromH = | 'rightMargin' | 'insideMargin' | 'outsideMargin'; + +export interface CT_PosH { + relativeFrom: ST_RelFromH; +} + export type ST_AlignV = 'top' | 'bottom' | 'center' | 'inside' | 'outside'; + export type ST_RelFromV = | 'margin' | 'page' @@ -1644,3 +4870,83 @@ export type ST_RelFromV = | 'bottomMargin' | 'insideMargin' | 'outsideMargin'; + +export interface CT_PosV { + relativeFrom: ST_RelFromV; +} + +export interface CT_Anchor { + simplePos: boolean; + positionH: CT_PosH[]; + positionV: CT_PosV[]; + extent: CT_PositiveSize2D[]; + effectExtent: CT_EffectExtent[]; + docPr: CT_NonVisualDrawingProps; + cNvGraphicFramePr: CT_NonVisualGraphicFrameProperties; + distT: number; + distB: number; + distL: number; + distR: number; + relativeHeight: number; + behindDoc: boolean; + locked: boolean; + layoutInCell: boolean; + hidden: boolean; + allowOverlap: boolean; +} + +export interface CT_TxbxContent {} + +export interface CT_TextboxInfo { + txbxContent: CT_TxbxContent; + extLst: CT_OfficeArtExtensionList; + id: number; +} + +export interface CT_LinkedTextboxInformation { + extLst: CT_OfficeArtExtensionList; + id: number; + seq: number; +} + +export interface CT_WordprocessingShape { + cNvPr: CT_NonVisualDrawingProps; + spPr: CT_ShapeProperties; + style: CT_ShapeStyle; + extLst: CT_OfficeArtExtensionList; + bodyPr: CT_TextBodyProperties; + normalEastAsianFlow: boolean; +} + +export interface CT_GraphicFrame { + cNvPr: CT_NonVisualDrawingProps; + cNvFrPr: CT_NonVisualGraphicFrameProperties; + xfrm: CT_Transform2D; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_WordprocessingContentPartNonVisual { + cNvPr: CT_NonVisualDrawingProps; + cNvContentPartPr: CT_NonVisualContentPartProperties; +} + +export interface CT_WordprocessingContentPart { + nvContentPartPr: CT_WordprocessingContentPartNonVisual; + xfrm: CT_Transform2D; + extLst: CT_OfficeArtExtensionList; + bwMode: ST_BlackWhiteMode; + r_id: string; +} + +export interface CT_WordprocessingGroup { + cNvPr: CT_NonVisualDrawingProps; + cNvGrpSpPr: CT_NonVisualGroupDrawingShapeProps; + grpSpPr: CT_GroupShapeProperties; + extLst: CT_OfficeArtExtensionList; +} + +export interface CT_WordprocessingCanvas { + bg: CT_BackgroundFormatting; + whole: CT_WholeE2oFormatting; + extLst: CT_OfficeArtExtensionList; +} diff --git a/packages/office-viewer/src/parse/colorNameMap.ts b/packages/office-viewer/src/openxml/colorNameMap.ts similarity index 98% rename from packages/office-viewer/src/parse/colorNameMap.ts rename to packages/office-viewer/src/openxml/colorNameMap.ts index 59401846c..9d5b57584 100644 --- a/packages/office-viewer/src/parse/colorNameMap.ts +++ b/packages/office-viewer/src/openxml/colorNameMap.ts @@ -1,4 +1,4 @@ -import {ST_PresetColorVal} from './../openxml/Types'; +import {ST_PresetColorVal} from './Types'; /** * 内置颜色 * 参考了 pptxjs 里的例子,并补充了 ST_PresetColorVal 里缺失的定义 diff --git a/packages/office-viewer/src/openxml/drawing/Blip.ts b/packages/office-viewer/src/openxml/drawing/Blip.ts index faadc352c..c448e972b 100644 --- a/packages/office-viewer/src/openxml/drawing/Blip.ts +++ b/packages/office-viewer/src/openxml/drawing/Blip.ts @@ -1,4 +1,4 @@ -import {Relationship} from '../../parse/parseRelationship'; +import {Relationship} from '../../word/parse/parseRelationship'; import Word from '../../Word'; export class Blip { diff --git a/packages/office-viewer/src/openxml/drawing/CustomGeom.ts b/packages/office-viewer/src/openxml/drawing/CustomGeom.ts index 7b9ce90e6..0685c4a90 100644 --- a/packages/office-viewer/src/openxml/drawing/CustomGeom.ts +++ b/packages/office-viewer/src/openxml/drawing/CustomGeom.ts @@ -3,7 +3,7 @@ */ import Word from '../../Word'; -import {parseShape} from '../../parse/parseShape'; +import {parseShape} from '../../word/parse/parseShape'; import {Shape} from './Shape'; export class CustomGeom { diff --git a/packages/office-viewer/src/openxml/drawing/Drawing.ts b/packages/office-viewer/src/openxml/drawing/Drawing.ts index 8e512efa2..fb8e510f1 100644 --- a/packages/office-viewer/src/openxml/drawing/Drawing.ts +++ b/packages/office-viewer/src/openxml/drawing/Drawing.ts @@ -2,13 +2,13 @@ * 目前图片和 textbox 都会依赖这个 */ -import {LengthUsage, convertLength} from '../../parse/parseSize'; +import {LengthUsage, convertLength} from '../../word/parse/parseSize'; import {CSSStyle} from './../Style'; import {getAttrBoolean, getAttrNumber, getValBoolean} from '../../OpenXML'; import Word from '../../Word'; import {Pic} from './Pic'; -import {parseSize} from '../../parse/parseSize'; +import {parseSize} from '../../word/parse/parseSize'; import {ST_RelFromH, ST_RelFromV} from '../Types'; import {WPS} from '../word/wps/WPS'; import {Diagram} from './diagram/Diagram'; diff --git a/packages/office-viewer/src/openxml/drawing/Geom.ts b/packages/office-viewer/src/openxml/drawing/Geom.ts index 8524c32ea..5effb987a 100644 --- a/packages/office-viewer/src/openxml/drawing/Geom.ts +++ b/packages/office-viewer/src/openxml/drawing/Geom.ts @@ -3,7 +3,7 @@ */ import {ST_ShapeType} from '../Types'; import Word from '../../Word'; -import {parseShapeGuide} from '../../parse/parseShape'; +import {parseShapeGuide} from '../../word/parse/parseShape'; import {ShapeGuide} from './Shape'; export class Geom { diff --git a/packages/office-viewer/src/openxml/drawing/ShapeProperties.ts b/packages/office-viewer/src/openxml/drawing/ShapeProperties.ts index 01846711c..b8f8c6811 100644 --- a/packages/office-viewer/src/openxml/drawing/ShapeProperties.ts +++ b/packages/office-viewer/src/openxml/drawing/ShapeProperties.ts @@ -5,9 +5,9 @@ import {ST_PresetLineDashVal, ST_ShapeType} from '../Types'; import Word from '../../Word'; import {Transform} from './Transform'; -import {parseSize, LengthUsage} from '../../parse/parseSize'; +import {parseSize, LengthUsage} from '../../word/parse/parseSize'; import {Geom} from './Geom'; -import {parseChildColor} from '../../parse/parseChildColor'; +import {parseChildColor} from '../../word/parse/parseChildColor'; import {CustomGeom} from './CustomGeom'; function prstDashToCSSBorderType(prstDash: ST_PresetLineDashVal) { @@ -39,7 +39,10 @@ export type OutLine = { radius?: string; }; -function parseOutline(word: Word, element: Element) { +export function parseOutline( + getThemeColor: (c: string) => string, + element: Element +) { const borderWidth = parseSize(element, 'w', LengthUsage.Emu); const outline: OutLine = { width: borderWidth @@ -51,8 +54,7 @@ function parseOutline(word: Word, element: Element) { const tagName = child.tagName; switch (tagName) { case 'a:solidFill': - outline.color = parseChildColor(word, child); - + outline.color = parseChildColor(getThemeColor, child); break; case 'a:noFill': @@ -117,7 +119,7 @@ export class ShapePr { case 'a:ln': // http://officeopenxml.com/drwSp-outline.php - shapePr.outline = parseOutline(word, child); + shapePr.outline = parseOutline(c => word.getThemeColor(c), child); break; case 'a:noFill': @@ -125,7 +127,10 @@ export class ShapePr { break; case 'a:solidFill': - shapePr.fillColor = parseChildColor(word, child); + shapePr.fillColor = parseChildColor( + c => word.getThemeColor(c), + child + ); break; default: diff --git a/packages/office-viewer/src/openxml/drawing/Transform.ts b/packages/office-viewer/src/openxml/drawing/Transform.ts index a6d76f4b9..b99ddff1b 100644 --- a/packages/office-viewer/src/openxml/drawing/Transform.ts +++ b/packages/office-viewer/src/openxml/drawing/Transform.ts @@ -2,7 +2,7 @@ * http://webapp.docx4java.org/OnlineDemo/ecma376/DrawingML/xfrm_2.html */ -import {convertAngle, LengthUsage, parseSize} from '../../parse/parseSize'; +import {convertAngle, LengthUsage, parseSize} from '../../word/parse/parseSize'; import Word from '../../Word'; export interface Off { diff --git a/packages/office-viewer/src/openxml/drawing/svg/shapeToSVG.ts b/packages/office-viewer/src/openxml/drawing/svg/shapeToSVG.ts index f3e938c91..d687a6ed0 100644 --- a/packages/office-viewer/src/openxml/drawing/svg/shapeToSVG.ts +++ b/packages/office-viewer/src/openxml/drawing/svg/shapeToSVG.ts @@ -7,16 +7,33 @@ import {Color} from '../../../util/color'; import {createSVGElement} from '../../../util/dom'; import {WPSStyle} from '../../word/wps/WPSStyle'; +import {CustomGeom} from '../CustomGeom'; +import {Geom} from '../Geom'; import {Shape, ShapeGuide} from '../Shape'; -import {ShapePr} from '../ShapeProperties'; +import {OutLine, ShapePr} from '../ShapeProperties'; +import {Transform} from '../Transform'; import {evalFmla} from './formulas'; import {Point, Var, generateDefines} from './generateDefines'; import {presetVal} from './presetVal'; +/** + * 通用 shape 属性,用于统一 Word 和 Excel + */ +type CommonShapePr = { + // 边框样式 + outline?: OutLine; + + // 填充颜色 + fillColor?: string; + + // 不填充 + noFill?: boolean; +}; + export function shapeToSVG( shape: Shape, avLst: ShapeGuide[], - shapePr: ShapePr, + shapePr: CommonShapePr, width: number, height: number, wpsStyle?: WPSStyle diff --git a/packages/office-viewer/src/openxml/word/Body.ts b/packages/office-viewer/src/openxml/word/Body.ts index e270f2a47..375b63e96 100644 --- a/packages/office-viewer/src/openxml/word/Body.ts +++ b/packages/office-viewer/src/openxml/word/Body.ts @@ -1,5 +1,5 @@ -import {mergeSdt} from '../../parse/mergeSdt'; -import {parseTable} from '../../parse/parseTable'; +import {mergeSdt} from '../../word/parse/mergeSdt'; +import {parseTable} from '../../word/parse/parseTable'; import Word from '../../Word'; import {Paragraph} from './Paragraph'; import {Section, SectionChild, SectionPr} from './Section'; diff --git a/packages/office-viewer/src/openxml/word/Header.ts b/packages/office-viewer/src/openxml/word/Header.ts index a35c75663..b5feb6fb7 100644 --- a/packages/office-viewer/src/openxml/word/Header.ts +++ b/packages/office-viewer/src/openxml/word/Header.ts @@ -2,8 +2,8 @@ * header 的定义,footer 也是用这个,因为结构是一样的 */ -import {mergeSdt} from '../../parse/mergeSdt'; -import {parseTable} from '../../parse/parseTable'; +import {mergeSdt} from '../../word/parse/mergeSdt'; +import {parseTable} from '../../word/parse/parseTable'; import Word from '../../Word'; import {Paragraph} from './Paragraph'; import {Table} from './Table'; diff --git a/packages/office-viewer/src/openxml/word/Hyperlink.ts b/packages/office-viewer/src/openxml/word/Hyperlink.ts index 266ee8103..674424e22 100644 --- a/packages/office-viewer/src/openxml/word/Hyperlink.ts +++ b/packages/office-viewer/src/openxml/word/Hyperlink.ts @@ -2,7 +2,7 @@ * http://webapp.docx4java.org/OnlineDemo/ecma376/WordML/hyperlink_2.html */ -import {Relationship} from '../../parse/parseRelationship'; +import {Relationship} from '../../word/parse/parseRelationship'; import Word from '../../Word'; import {Run} from './Run'; diff --git a/packages/office-viewer/src/openxml/word/Note.ts b/packages/office-viewer/src/openxml/word/Note.ts index fa834b4e4..35927fcfc 100644 --- a/packages/office-viewer/src/openxml/word/Note.ts +++ b/packages/office-viewer/src/openxml/word/Note.ts @@ -2,7 +2,7 @@ * footnote 和 endnote 的结构几乎是一样的,所以统一叫 Note 了 */ -import {parseTable} from '../../parse/parseTable'; +import {parseTable} from '../../word/parse/parseTable'; import Word from '../../Word'; import {Paragraph} from './Paragraph'; import {Table} from './Table'; diff --git a/packages/office-viewer/src/openxml/word/Paragraph.ts b/packages/office-viewer/src/openxml/word/Paragraph.ts index ebd96ec80..5797d6af7 100644 --- a/packages/office-viewer/src/openxml/word/Paragraph.ts +++ b/packages/office-viewer/src/openxml/word/Paragraph.ts @@ -3,7 +3,7 @@ */ import {getVal} from '../../OpenXML'; -import {parsePr} from '../../parse/parsePr'; +import {parsePr} from '../../word/parse/parsePr'; import Word from '../../Word'; import {BookmarkStart} from './Bookmark'; import {Hyperlink} from './Hyperlink'; @@ -13,7 +13,7 @@ import {Run, RunPr} from './Run'; import {Tab} from './Tab'; import {FldSimple} from './FldSimple'; import {OMath} from '../math/OMath'; -import {mergeSdt} from '../../parse/mergeSdt'; +import {mergeSdt} from '../../word/parse/mergeSdt'; /** * 这里简化了很多,如果能用 CSS 表示就直接用 CSS 表示 diff --git a/packages/office-viewer/src/openxml/word/Run.ts b/packages/office-viewer/src/openxml/word/Run.ts index d93477ec4..6b07897a8 100644 --- a/packages/office-viewer/src/openxml/word/Run.ts +++ b/packages/office-viewer/src/openxml/word/Run.ts @@ -1,5 +1,5 @@ import {getVal} from '../../OpenXML'; -import {parsePr} from '../../parse/parsePr'; +import {parsePr} from '../../word/parse/parsePr'; import Word from '../../Word'; import {ST_FldCharType, ST_VerticalAlignRun} from '../Types'; import {Break} from './Break'; diff --git a/packages/office-viewer/src/openxml/word/Section.ts b/packages/office-viewer/src/openxml/word/Section.ts index 50c222043..dfacc3d8f 100644 --- a/packages/office-viewer/src/openxml/word/Section.ts +++ b/packages/office-viewer/src/openxml/word/Section.ts @@ -5,7 +5,7 @@ */ import Word from '../../Word'; -import {parseSize} from '../../parse/parseSize'; +import {parseSize} from '../../word/parse/parseSize'; import {ST_PageOrientation} from '../Types'; import {Hyperlink} from './Hyperlink'; import {Paragraph} from './Paragraph'; diff --git a/packages/office-viewer/src/openxml/word/Tab.ts b/packages/office-viewer/src/openxml/word/Tab.ts index 53a6dbeaf..d0a946595 100644 --- a/packages/office-viewer/src/openxml/word/Tab.ts +++ b/packages/office-viewer/src/openxml/word/Tab.ts @@ -1,5 +1,5 @@ import {getVal} from '../../OpenXML'; -import {parseSize} from '../../parse/parseSize'; +import {parseSize} from '../../word/parse/parseSize'; import Word from '../../Word'; import {ST_TabJc, ST_TabTlc} from '../Types'; diff --git a/packages/office-viewer/src/openxml/word/Table.ts b/packages/office-viewer/src/openxml/word/Table.ts index a90c6392f..50a02130c 100644 --- a/packages/office-viewer/src/openxml/word/Table.ts +++ b/packages/office-viewer/src/openxml/word/Table.ts @@ -2,15 +2,15 @@ * http://officeopenxml.com/WPtable.php */ -import {parseSize} from '../../parse/parseSize'; +import {parseSize} from '../../word/parse/parseSize'; import Word from '../../Word'; import {CSSStyle} from '../Style'; import {Properties} from './properties/Properties'; import type {Tr} from './table/Tr'; -import {parseTablePr} from '../../parse/parseTablePr'; +import {parseTablePr} from '../../word/parse/parseTablePr'; import {Tc} from './table/Tc'; -import {parseTr} from '../../parse/parseTr'; +import {parseTr} from '../../word/parse/parseTr'; export type TblLookKey = | 'firstRow' diff --git a/packages/office-viewer/src/openxml/word/WDocument.ts b/packages/office-viewer/src/openxml/word/WDocument.ts index 16a5b1391..3dd5826ff 100644 --- a/packages/office-viewer/src/openxml/word/WDocument.ts +++ b/packages/office-viewer/src/openxml/word/WDocument.ts @@ -5,7 +5,7 @@ */ import {Color} from '../../util/color'; -import {parseColorAttr} from '../../parse/parseColor'; +import {parseColorAttr} from '../../word/parse/parseColor'; import Word from '../../Word'; import {DocumentBackground} from './Background'; import {Body} from './Body'; diff --git a/packages/office-viewer/src/openxml/word/wps/WPS.ts b/packages/office-viewer/src/openxml/word/wps/WPS.ts index 421aa1d9e..8b52bc2bb 100644 --- a/packages/office-viewer/src/openxml/word/wps/WPS.ts +++ b/packages/office-viewer/src/openxml/word/wps/WPS.ts @@ -7,13 +7,13 @@ import {ShapePr} from '../../drawing/ShapeProperties'; import Word from '../../../Word'; import {Table} from '../Table'; -import {parseTable} from '../../../parse/parseTable'; +import {parseTable} from '../../../word/parse/parseTable'; import {CSSStyle} from '../../../openxml/Style'; import { ST_TextAnchoringType, ST_TextVerticalType } from '../../../openxml/Types'; -import {convertAngle} from '../../../parse/parseSize'; +import {convertAngle} from '../../../word/parse/parseSize'; import {WPSStyle} from './WPSStyle'; export type TxbxContentChild = Paragraph | Table; diff --git a/packages/office-viewer/src/openxml/word/wps/WPSStyle.ts b/packages/office-viewer/src/openxml/word/wps/WPSStyle.ts index c65495151..15a837b2a 100644 --- a/packages/office-viewer/src/openxml/word/wps/WPSStyle.ts +++ b/packages/office-viewer/src/openxml/word/wps/WPSStyle.ts @@ -3,7 +3,7 @@ */ import Word from '../../../Word'; -import {parseChildColor} from '../../../parse/parseChildColor'; +import {parseChildColor} from '../../../word/parse/parseChildColor'; export class WPSStyle { lineColor?: string; @@ -19,15 +19,24 @@ export class WPSStyle { const tagName = child.tagName; switch (tagName) { case 'a:fillRef': - wpsStyle.fillColor = parseChildColor(word, child); + wpsStyle.fillColor = parseChildColor( + c => word.getThemeColor(c), + child + ); break; case 'a:lnRef': - wpsStyle.lineColor = parseChildColor(word, child); + wpsStyle.lineColor = parseChildColor( + c => word.getThemeColor(c), + child + ); break; case 'a:fontRef': - wpsStyle.fontColor = parseChildColor(word, child); + wpsStyle.fontColor = parseChildColor( + c => word.getThemeColor(c), + child + ); break; } } diff --git a/packages/office-viewer/src/package/PackageParser.ts b/packages/office-viewer/src/package/PackageParser.ts index f9a75fd10..7a959cb01 100644 --- a/packages/office-viewer/src/package/PackageParser.ts +++ b/packages/office-viewer/src/package/PackageParser.ts @@ -20,6 +20,11 @@ export interface PackageParser { type: 'string' | 'blob' | 'uint8array' ): string | Blob | Uint8Array | null; + /** + * 读取文本内容 + */ + getString(filePath: string): string; + /** * 写入文件,主要用于图片 */ diff --git a/packages/office-viewer/src/package/XMLPackageParser.ts b/packages/office-viewer/src/package/XMLPackageParser.ts index b16a32e7a..d2eaf1df9 100644 --- a/packages/office-viewer/src/package/XMLPackageParser.ts +++ b/packages/office-viewer/src/package/XMLPackageParser.ts @@ -101,6 +101,13 @@ export default class XMLPackageParser implements PackageParser { return null; } + /** + * 读取文本内容 + */ + getString(filePath: string): string { + return this.getFileByType(filePath, 'string') as string; + } + saveFile(filePath: string, content: Uint8Array | string): void { this.files[filePath] = content; } diff --git a/packages/office-viewer/src/package/ZipPackageParser.ts b/packages/office-viewer/src/package/ZipPackageParser.ts index b148b6946..e02886483 100644 --- a/packages/office-viewer/src/package/ZipPackageParser.ts +++ b/packages/office-viewer/src/package/ZipPackageParser.ts @@ -13,7 +13,10 @@ export default class ZipPackageParser implements PackageParser { * 加载 zip 文件 */ load(docxFile: ArrayBuffer) { - this.zip = unzipSync(new Uint8Array(docxFile)); + // 避免重复解析 + if (!this.zip) { + this.zip = unzipSync(new Uint8Array(docxFile)); + } } /** @@ -37,9 +40,22 @@ export default class ZipPackageParser implements PackageParser { /** * 根据类型读取文件 */ - getFileByType(filePath: string, type: 'string' | 'blob' | 'uint8array') { + getFileByType( + filePath: string, + type: 'string' | 'blob' | 'uint8array' = 'string' + ) { filePath = filePath.startsWith('/') ? filePath.slice(1) : filePath; - const file = this.zip[filePath]; + let file = this.zip[filePath]; + if (!file) { + // 使用大小写不敏感的方式查找 + for (const key in this.zip) { + if (key.toLowerCase() === filePath.toLowerCase()) { + file = this.zip[key]; + break; + } + } + } + if (file) { if (type === 'string') { return strFromU8(file); @@ -49,10 +65,18 @@ export default class ZipPackageParser implements PackageParser { return file; } } + console.warn('getFileByType', filePath, 'not found'); return null; } + /** + * 读取文本内容 + */ + getString(filePath: string): string { + return this.getFileByType(filePath, 'string') as string; + } + /** * xml 下没这功能 */ @@ -68,7 +92,18 @@ export default class ZipPackageParser implements PackageParser { */ fileExists(filePath: string) { filePath = filePath.startsWith('/') ? filePath.slice(1) : filePath; - return filePath in this.zip; + if (filePath in this.zip) { + return true; + } + + // 支持大小写不敏感 + for (const key in this.zip) { + if (key.toLowerCase() === filePath.toLowerCase()) { + return true; + } + } + + return false; } /** diff --git a/packages/office-viewer/src/render/renderMath.ts b/packages/office-viewer/src/render/renderMath.ts deleted file mode 100644 index 0c28bce3e..000000000 --- a/packages/office-viewer/src/render/renderMath.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {convertOOXML} from '../openxml/math/convertOOML'; -import {OMath} from '../openxml/math/OMath'; -import Word from '../Word'; - -export function renderOMath(word: Word, math: OMath) { - return convertOOXML(math.element); -} diff --git a/packages/office-viewer/src/util/EventEmitter.ts b/packages/office-viewer/src/util/EventEmitter.ts new file mode 100644 index 000000000..98d4c7364 --- /dev/null +++ b/packages/office-viewer/src/util/EventEmitter.ts @@ -0,0 +1,176 @@ +/** + * 基于 tsee 删减了不需要的功能 + */ + +export type Listener = (...args: any[]) => Promise | void; +export type DefaultEventMap = {[event in string | symbol]: Listener}; + +export interface IEventEmitter< + EventMap extends DefaultEventMap = DefaultEventMap +> { + emit( + event: EventKey, + ...args: Parameters + ): boolean; + + on( + event: EventKey, + listener: EventMap[EventKey] + ): this; + once( + event: EventKey, + listener: EventMap[EventKey] + ): this; + addListener( + event: EventKey, + listener: EventMap[EventKey] + ): this; + removeListener( + event: EventKey, + listener: EventMap[EventKey] + ): this; + prependListener( + event: EventKey, + listener: EventMap[EventKey] + ): this; + prependOnceListener( + event: EventKey, + listener: EventMap[EventKey] + ): this; + off( + event: EventKey, + listener: EventMap[EventKey] + ): this; + removeAllListeners( + event?: EventKey + ): this; +} + +/** cast type of any event emitter to typed event emitter */ +export function asTypedEventEmitter< + EventMap extends DefaultEventMap, + X extends NodeJS.EventEmitter +>(x: X): IEventEmitter { + return x as any; +} + +/** Implemented event emitter */ +export class EventEmitter + implements IEventEmitter +{ + private debug = false; + constructor() { + if (window && (window as any).OFFICE_VIEWER_DEBUG === true) { + this.debug = true; + } + } + + events: { + [eventName in keyof EventMap]?: Function[]; + } = {}; + + emit = ( + event: EventKey, + ...args: Parameters + ) => { + if (this.events[event]) { + const len = this.events[event]!.length; + const events = Array.from(this.events[event]!); + if (this.debug) { + console.log(`EventEmitter: emit event ${String(event)}`, ...args); + } + for (const e of events) { + e(...args); + } + return !!len; + } + return false; + }; + + on = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + this.addListener(event, listener); + return this; + }; + + once = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + const onceListener = ((...args: any) => { + listener(...args); + this.removeListener(event, onceListener); + }) as any; + this.addListener(event, onceListener); + return this; + }; + + addListener = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + if (!(event in this.events)) { + this.events[event] = [listener]; + } else { + this.events[event]!.push(listener); + } + + return this; + }; + + removeListener = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + if (event in this.events) { + const i = this.events[event]!.indexOf(listener); + if (i !== -1) { + this.events[event]!.splice(i, 1); + } + } + return this; + }; + + prependListener = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + if (!(event in this.events)) { + this.events[event] = [listener]; + } else { + this.events[event]!.unshift(listener); + } + return this; + }; + + prependOnceListener = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + const onceListener = ((...args: any) => { + listener(...args); + this.removeListener(event, onceListener); + }) as any; + this.prependListener(event, onceListener); + return this; + }; + + off = ( + event: EventKey, + listener: EventMap[EventKey] + ): this => { + return this.removeListener(event, listener); + }; + + removeAllListeners = ( + event?: EventKey + ): this => { + if (event) { + delete this.events[event]; + } + + return this; + }; +} diff --git a/packages/office-viewer/src/util/H.ts b/packages/office-viewer/src/util/H.ts new file mode 100644 index 000000000..95833f476 --- /dev/null +++ b/packages/office-viewer/src/util/H.ts @@ -0,0 +1,53 @@ +/** + * 创建 DOM 的小工具 + * @param tagName 标签名 + * @param attrs 属性 + * @returns 创建的 dom + */ + +import {isObject} from './isObject'; + +function isNode(el: any) { + return el && el.nodeName && el.nodeType; +} + +export function H( + tagName: string, + attrs: Record, + ...children: any[] +) { + const element = document.createElement(tagName); + for (const key in attrs) { + if (Object.prototype.hasOwnProperty.call(attrs, key)) { + const value = attrs[key]; + if (key === 'className') { + element.setAttribute('class', value); + } else if (key === 'style') { + if (isObject(value)) { + for (const styleName in value) { + const styleValue = value[styleName]; + element.style.setProperty(styleName, styleValue); + } + } + } else if (key === 'innerText') { + element.innerText = value; + } else if (key === 'innerHTML') { + element.innerHTML = value; + } else if (key === 'parent') { + value.appendChild(element); + } else if (key.startsWith('on') && typeof value === 'function') { + element.addEventListener(key.slice(2), value); + } else { + element.setAttribute(key, value); + } + } + } + + for (const child of children) { + if (isNode(child)) { + element.appendChild(child); + } + } + + return element; +} diff --git a/packages/office-viewer/src/util/LRUCache.ts b/packages/office-viewer/src/util/LRUCache.ts new file mode 100644 index 000000000..bb25a3357 --- /dev/null +++ b/packages/office-viewer/src/util/LRUCache.ts @@ -0,0 +1,54 @@ +/** + * from https://github.com/microsoft/vscode/blob/e587755905208e47725c5196539c4ca898255fe6/src/vs/base/common/map.ts + */ + +import {LinkedMap, Touch} from './LinkedMap'; + +export class LRUCache extends LinkedMap { + private _limit: number; + private _ratio: number; + + constructor(limit: number, ratio: number = 1) { + super(); + this._limit = limit; + this._ratio = Math.min(Math.max(0, ratio), 1); + } + + get limit(): number { + return this._limit; + } + + set limit(limit: number) { + this._limit = limit; + this.checkTrim(); + } + + get ratio(): number { + return this._ratio; + } + + set ratio(ratio: number) { + this._ratio = Math.min(Math.max(0, ratio), 1); + this.checkTrim(); + } + + override get(key: K, touch: Touch = Touch.AsNew): V | undefined { + return super.get(key, touch); + } + + peek(key: K): V | undefined { + return super.get(key, Touch.None); + } + + override set(key: K, value: V): this { + super.set(key, value, Touch.AsNew); + this.checkTrim(); + return this; + } + + private checkTrim() { + if (this.size > this._limit) { + this.trimOld(Math.round(this._limit * this._ratio)); + } + } +} diff --git a/packages/office-viewer/src/util/LinkedMap.ts b/packages/office-viewer/src/util/LinkedMap.ts new file mode 100644 index 000000000..db5611246 --- /dev/null +++ b/packages/office-viewer/src/util/LinkedMap.ts @@ -0,0 +1,394 @@ +/** + * from https://github.com/microsoft/vscode/blob/e587755905208e47725c5196539c4ca898255fe6/src/vs/base/common/map.ts + */ + +interface Item { + previous: Item | undefined; + next: Item | undefined; + key: K; + value: V; +} + +export const enum Touch { + None = 0, + AsOld = 1, + AsNew = 2 +} + +export class LinkedMap implements Map { + readonly [Symbol.toStringTag] = 'LinkedMap'; + + private _map: Map>; + private _head: Item | undefined; + private _tail: Item | undefined; + private _size: number; + + private _state: number; + + constructor() { + this._map = new Map>(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state = 0; + } + + clear(): void { + this._map.clear(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state++; + } + + isEmpty(): boolean { + return !this._head && !this._tail; + } + + get size(): number { + return this._size; + } + + get first(): V | undefined { + return this._head?.value; + } + + get last(): V | undefined { + return this._tail?.value; + } + + has(key: K): boolean { + return this._map.has(key); + } + + get(key: K, touch: Touch = Touch.None): V | undefined { + const item = this._map.get(key); + if (!item) { + return undefined; + } + if (touch !== Touch.None) { + this.touch(item, touch); + } + return item.value; + } + + set(key: K, value: V, touch: Touch = Touch.None): this { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== Touch.None) { + this.touch(item, touch); + } + } else { + item = {key, value, next: undefined, previous: undefined}; + switch (touch) { + case Touch.None: + this.addItemLast(item); + break; + case Touch.AsOld: + this.addItemFirst(item); + break; + case Touch.AsNew: + this.addItemLast(item); + break; + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + return this; + } + + delete(key: K): boolean { + return !!this.remove(key); + } + + remove(key: K): V | undefined { + const item = this._map.get(key); + if (!item) { + return undefined; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + + shift(): V | undefined { + if (!this._head && !this._tail) { + return undefined; + } + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + + forEach( + callbackfn: (value: V, key: K, map: LinkedMap) => void, + thisArg?: any + ): void { + const state = this._state; + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + current = current.next; + } + } + + keys(): IterableIterator { + const map = this; + const state = this._state; + let current = this._head; + const iterator: IterableIterator = { + [Symbol.iterator]() { + return iterator; + }, + next(): IteratorResult { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = {value: current.key, done: false}; + current = current.next; + return result; + } else { + return {value: undefined, done: true}; + } + } + }; + return iterator; + } + + values(): IterableIterator { + const map = this; + const state = this._state; + let current = this._head; + const iterator: IterableIterator = { + [Symbol.iterator]() { + return iterator; + }, + next(): IteratorResult { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = {value: current.value, done: false}; + current = current.next; + return result; + } else { + return {value: undefined, done: true}; + } + } + }; + return iterator; + } + + entries(): IterableIterator<[K, V]> { + const map = this; + const state = this._state; + let current = this._head; + const iterator: IterableIterator<[K, V]> = { + [Symbol.iterator]() { + return iterator; + }, + next(): IteratorResult<[K, V]> { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result: IteratorResult<[K, V]> = { + value: [current.key, current.value], + done: false + }; + current = current.next; + return result; + } else { + return {value: undefined, done: true}; + } + } + }; + return iterator; + } + + [Symbol.iterator](): IterableIterator<[K, V]> { + return this.entries(); + } + + protected trimOld(newSize: number) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._head; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.next; + currentSize--; + } + this._head = current; + this._size = currentSize; + if (current) { + current.previous = undefined; + } + this._state++; + } + + private addItemFirst(item: Item): void { + // First time Insert + if (!this._head && !this._tail) { + this._tail = item; + } else if (!this._head) { + throw new Error('Invalid list'); + } else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + this._state++; + } + + private addItemLast(item: Item): void { + // First time Insert + if (!this._head && !this._tail) { + this._head = item; + } else if (!this._tail) { + throw new Error('Invalid list'); + } else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + this._state++; + } + + private removeItem(item: Item): void { + if (item === this._head && item === this._tail) { + this._head = undefined; + this._tail = undefined; + } else if (item === this._head) { + // This can only happen if size === 1 which is handled + // by the case above. + if (!item.next) { + throw new Error('Invalid list'); + } + item.next.previous = undefined; + this._head = item.next; + } else if (item === this._tail) { + // This can only happen if size === 1 which is handled + // by the case above. + if (!item.previous) { + throw new Error('Invalid list'); + } + item.previous.next = undefined; + this._tail = item.previous; + } else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error('Invalid list'); + } + next.previous = previous; + previous.next = next; + } + item.next = undefined; + item.previous = undefined; + this._state++; + } + + private touch(item: Item, touch: Touch): void { + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + if (touch !== Touch.AsOld && touch !== Touch.AsNew) { + return; + } + + if (touch === Touch.AsOld) { + if (item === this._head) { + return; + } + + const next = item.next; + const previous = item.previous; + + // Unlink the item + if (item === this._tail) { + // previous must be defined since item was not head but is tail + // So there are more than on item in the map + previous!.next = undefined; + this._tail = previous; + } else { + // Both next and previous are not undefined since item was neither head nor tail. + next!.previous = previous; + previous!.next = next; + } + + // Insert the node at head + item.previous = undefined; + item.next = this._head; + this._head.previous = item; + this._head = item; + this._state++; + } else if (touch === Touch.AsNew) { + if (item === this._tail) { + return; + } + + const next = item.next; + const previous = item.previous; + + // Unlink the item. + if (item === this._head) { + // next must be defined since item was not tail but is head + // So there are more than on item in the map + next!.previous = undefined; + this._head = next; + } else { + // Both next and previous are not undefined since item was neither head nor tail. + next!.previous = previous; + previous!.next = next; + } + item.next = undefined; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + this._state++; + } + } + + toJSON(): [K, V][] { + const data: [K, V][] = []; + + this.forEach((value, key) => { + data.push([key, value]); + }); + + return data; + } + + fromJSON(data: [K, V][]): void { + this.clear(); + + for (const [key, value] of data) { + this.set(key, value); + } + } +} diff --git a/packages/office-viewer/__tests__/util/autoSpace.test.ts b/packages/office-viewer/src/util/__tests__/autoSpace.test.ts similarity index 80% rename from packages/office-viewer/__tests__/util/autoSpace.test.ts rename to packages/office-viewer/src/util/__tests__/autoSpace.test.ts index 1b9918afa..82efc94bf 100644 --- a/packages/office-viewer/__tests__/util/autoSpace.test.ts +++ b/packages/office-viewer/src/util/__tests__/autoSpace.test.ts @@ -1,4 +1,4 @@ -import {cjkspace} from '../../src/util/autoSpace'; +import {cjkspace} from '../autoSpace'; test('autoSpace', async () => { expect(cjkspace('a中'.split(''))).toBe('a 中'); diff --git a/packages/office-viewer/__tests__/util/color.test.ts b/packages/office-viewer/src/util/__tests__/color.test.ts similarity index 87% rename from packages/office-viewer/__tests__/util/color.test.ts rename to packages/office-viewer/src/util/__tests__/color.test.ts index c00575e16..98b3a849c 100644 --- a/packages/office-viewer/__tests__/util/color.test.ts +++ b/packages/office-viewer/src/util/__tests__/color.test.ts @@ -1,4 +1,4 @@ -import {Color} from '../../src/util/color'; +import {Color} from '../color'; test('lumMod', () => { const color = new Color('#00FF00'); diff --git a/packages/office-viewer/__tests__/util/replaceVar.test.ts b/packages/office-viewer/src/util/__tests__/replaceVar.test.ts similarity index 80% rename from packages/office-viewer/__tests__/util/replaceVar.test.ts rename to packages/office-viewer/src/util/__tests__/replaceVar.test.ts index 907a2c197..c0e04e41d 100644 --- a/packages/office-viewer/__tests__/util/replaceVar.test.ts +++ b/packages/office-viewer/src/util/__tests__/replaceVar.test.ts @@ -1,10 +1,10 @@ import fs from 'fs'; import path from 'path'; -import Word from '../../src/Word'; -import {replaceVar} from '../../src/util/replaceVar'; -import {buildXML} from '../../src/util/xml'; -import {mergeRun} from '../../src/util/mergeRun'; +import Word from '../../Word'; +import {replaceVar} from '../replaceVar'; +import {buildXML} from '../xml'; +import {mergeRun} from '../mergeRun'; import xmlFormat from 'xml-formatter'; export function createWord(fileName: string, data: any) { @@ -39,7 +39,7 @@ test('table-list', async () => { ] }; - const word = createWord('./var/table-list.docx', data); + const word = createWord('../../../__tests__/util/var/table-list.docx', data); const documentData = word.getXML('word/document.xml'); mergeRun(word, documentData); @@ -51,7 +51,7 @@ test('table-list', async () => { ); const expectResult = fs.readFileSync( - path.join(__dirname, './var/table-list.xml'), + path.join(__dirname, '../../../__tests__/util/var/table-list.xml'), 'utf-8' ); @@ -64,7 +64,7 @@ test('var-space', async () => { date: '2020-01-01' }; - const word = createWord('./var/space.docx', data); + const word = createWord('../../../__tests__/util/var/space.docx', data); document.body.innerHTML = `
diff --git a/packages/office-viewer/src/util/__tests__/xml.test.ts b/packages/office-viewer/src/util/__tests__/xml.test.ts new file mode 100644 index 000000000..5261800db --- /dev/null +++ b/packages/office-viewer/src/util/__tests__/xml.test.ts @@ -0,0 +1,296 @@ +import {xml2json} from '../xml'; + +test('rel', async () => { + const rel = await xml2json( + ` + + + + +` + ); + expect(rel).toEqual({ + tag: 'Relationships', + attrs: { + xmlns: 'http://schemas.openxmlformats.org/package/2006/relationships' + }, + children: [ + { + tag: 'Relationship', + attrs: { + Id: 'rId3', + Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', + Target: 'docProps/app.xml' + }, + children: [] + }, + { + tag: 'Relationship', + attrs: { + Id: 'rId2', + Type: 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties', + Target: 'docProps/core.xml' + }, + children: [] + }, + { + tag: 'Relationship', + attrs: { + Id: 'rId1', + Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument', + Target: 'xl/workbook.xml' + }, + children: [] + } + ], + text: '\n' + }); +}); + +test('sharedStrings', async () => { + const sharedStrings = await xml2json( + ` + + + a + + + + + b + + + + + + + + + + c + + + + + + + + + + d + + + + ` + ); + expect(sharedStrings).toEqual({ + tag: 'sst', + attrs: { + xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main', + count: '2', + uniqueCount: '2' + }, + children: [ + { + tag: 'si', + attrs: {}, + children: [ + { + tag: 't', + attrs: {}, + children: [], + text: 'a' + }, + { + tag: 'phoneticPr', + attrs: { + fontId: '1', + type: 'noConversion' + }, + children: [] + } + ], + text: '\n ' + }, + { + tag: 'si', + attrs: {}, + children: [ + { + tag: 'r', + attrs: {}, + children: [ + { + tag: 't', + attrs: {}, + children: [], + text: 'b' + } + ], + text: '\n ' + }, + { + tag: 'r', + attrs: {}, + children: [ + { + tag: 'rPr', + attrs: {}, + children: [ + { + tag: 'sz', + attrs: { + val: '12' + }, + children: [] + }, + { + tag: 'color', + attrs: { + rgb: 'FFFF0000' + }, + children: [] + }, + { + tag: 'rFont', + attrs: { + val: '等线' + }, + children: [] + }, + { + tag: 'family', + attrs: { + val: '3' + }, + children: [] + }, + { + tag: 'charset', + attrs: { + val: '134' + }, + children: [] + } + ], + text: '\n ' + }, + { + tag: 't', + attrs: {}, + children: [], + text: 'c' + } + ], + text: '\n ' + }, + { + tag: 'r', + attrs: {}, + children: [ + { + tag: 'rPr', + attrs: {}, + children: [ + { + tag: 'sz', + attrs: { + val: '14' + }, + children: [] + }, + { + tag: 'color', + attrs: { + theme: '1' + }, + children: [] + }, + { + tag: 'rFont', + attrs: { + val: '等线' + }, + children: [] + }, + { + tag: 'family', + attrs: { + val: '3' + }, + children: [] + }, + { + tag: 'charset', + attrs: { + val: '134' + }, + children: [] + } + ], + text: '\n ' + }, + { + tag: 't', + attrs: {}, + children: [], + text: 'd' + } + ], + text: '\n ' + }, + { + tag: 'phoneticPr', + attrs: { + fontId: '1', + type: 'noConversion' + }, + children: [] + } + ], + text: '\n ' + } + ], + text: '\n ' + }); +}); + +test('namespace', async () => { + const namespace = await xml2json( + ` + + + + + ` + ); + expect(namespace).toEqual({ + tag: 'workbook', + attrs: { + 'xmlns': 'http://schemas.openxmlformats.org/spreadsheetml/2006/main', + 'xmlns:r': + 'http:// schemas.openxmlformats.org /officeDocument/2006/relationships' + }, + children: [ + { + tag: 'sheets', + attrs: {}, + children: [ + { + tag: 'w14:sheet', + attrs: { + 'name': 'Sheet1', + 'sheetId': '1', + 'r:id': 'rId1' + }, + children: [] + } + ], + text: '\n ' + } + ], + text: '\n ' + }); +}); diff --git a/packages/office-viewer/src/util/arrayBufferToString.ts b/packages/office-viewer/src/util/arrayBufferToString.ts new file mode 100644 index 000000000..8bc6e9130 --- /dev/null +++ b/packages/office-viewer/src/util/arrayBufferToString.ts @@ -0,0 +1,7 @@ +export function arrayBufferToString( + buffer: ArrayBuffer, + charset: string = 'utf-8' +) { + const dec = new TextDecoder(charset); + return dec.decode(buffer); +} diff --git a/packages/office-viewer/src/util/base64ToArrayBuffer.ts b/packages/office-viewer/src/util/base64ToArrayBuffer.ts new file mode 100644 index 000000000..1674f40b5 --- /dev/null +++ b/packages/office-viewer/src/util/base64ToArrayBuffer.ts @@ -0,0 +1,8 @@ +export function base64ToArrayBuffer(base64: string) { + var binaryString = atob(base64); + var bytes = new Uint8Array(binaryString.length); + for (var i = 0; i < binaryString.length; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + return bytes.buffer; +} diff --git a/packages/office-viewer/src/util/binarySearch.ts b/packages/office-viewer/src/util/binarySearch.ts new file mode 100644 index 000000000..366a74ffd --- /dev/null +++ b/packages/office-viewer/src/util/binarySearch.ts @@ -0,0 +1,24 @@ +/** + * 二分查找,目前只支持数字数组 + * @returns 找到就返回索引,找不到就返回 -1 + */ + +export function binarySearch(nums: number[], target: number): number { + let left: number = 0; + let right: number = nums.length - 1; + + while (left <= right) { + const mid: number = Math.floor((left + right) / 2); + + if (nums[mid] === target) { + return mid; + } + if (target < nums[mid]) { + right = mid - 1; + } else { + left = mid + 1; + } + } + + return -1; +} diff --git a/packages/office-viewer/src/util/color.ts b/packages/office-viewer/src/util/color.ts index 7da190c0a..2294b74a0 100644 --- a/packages/office-viewer/src/util/color.ts +++ b/packages/office-viewer/src/util/color.ts @@ -245,3 +245,118 @@ export class Color { return `rgba(${this.r}, ${this.g}, ${this.b}, ${alpha})`; } } + +// 下面是来自 xlsx 的代码,先放着有没用 + +function hex2RGB(h: string) { + var o = h.slice(h[0] === '#' ? 1 : 0).slice(0, 6); + return [ + parseInt(o.slice(0, 2), 16), + parseInt(o.slice(2, 4), 16), + parseInt(o.slice(4, 6), 16) + ]; +} +function rgb2Hex(rgb: number[]) { + for (var i = 0, o = 1; i != 3; ++i) + o = o * 256 + (rgb[i] > 255 ? 255 : rgb[i] < 0 ? 0 : rgb[i]); + return o.toString(16).toUpperCase().slice(1); +} + +function rgb2HSL(rgb: number[]) { + var R = rgb[0] / 255, + G = rgb[1] / 255, + B = rgb[2] / 255; + var M = Math.max(R, G, B), + m = Math.min(R, G, B), + C = M - m; + if (C === 0) return [0, 0, R]; + + var H6 = 0, + S = 0, + L2 = M + m; + S = C / (L2 > 1 ? 2 - L2 : L2); + switch (M) { + case R: + H6 = ((G - B) / C + 6) % 6; + break; + case G: + H6 = (B - R) / C + 2; + break; + case B: + H6 = (R - G) / C + 4; + break; + } + return [H6 / 6, S, L2 / 2]; +} + +function hsl2RGB(hsl: number[]) { + var H = hsl[0], + S = hsl[1], + L = hsl[2]; + var C = S * 2 * (L < 0.5 ? L : 1 - L), + m = L - C / 2; + var rgb = [m, m, m], + h6 = 6 * H; + + var X; + if (S !== 0) + switch (h6 | 0) { + case 0: + case 6: + X = C * h6; + rgb[0] += C; + rgb[1] += X; + break; + case 1: + X = C * (2 - h6); + rgb[0] += X; + rgb[1] += C; + break; + case 2: + X = C * (h6 - 2); + rgb[1] += C; + rgb[2] += X; + break; + case 3: + X = C * (4 - h6); + rgb[1] += X; + rgb[2] += C; + break; + case 4: + X = C * (h6 - 4); + rgb[2] += C; + rgb[0] += X; + break; + case 5: + X = C * (6 - h6); + rgb[2] += X; + rgb[0] += C; + break; + } + for (var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i] * 255); + return rgb; +} + +/* 18.8.3 bgColor tint algorithm */ +export const rgbTint = function (hex: string, tint: number) { + if (tint === 0) { + return hex; + } + const hsl = rgb2HSL(hex2RGB(hex)); + if (tint < 0) { + hsl[2] = hsl[2] * (1 + tint); + } else { + hsl[2] = 1 - (1 - hsl[2]) * (1 - tint); + } + return rgb2Hex(hsl2RGB(hsl)); +}; + +/** + * 计算两个颜色之间的渐变色 + */ +export function interpolateColor(start: Color, end: Color, percent: number) { + const r = Math.min(255, start.r + (end.r - start.r) * percent); + const g = Math.min(255, start.g + (end.g - start.g) * percent); + const b = Math.min(255, start.b + (end.b - start.b) * percent); + return `${rgbToHex(r, g, b)}`; +} diff --git a/packages/office-viewer/src/util/createObject.ts b/packages/office-viewer/src/util/createObject.ts index a7a6d0a31..9aae5b19b 100644 --- a/packages/office-viewer/src/util/createObject.ts +++ b/packages/office-viewer/src/util/createObject.ts @@ -2,6 +2,8 @@ * 拷贝自 amis 里的方法,避免依赖 */ +import {isObject} from './isObject'; + export function createObject( superProps?: {[propName: string]: any}, props?: {[propName: string]: any}, @@ -45,15 +47,3 @@ export function cloneObject(target: any, persistOwnProps: boolean = true) { Object.keys(target).forEach(key => (obj[key] = target[key])); return obj; } - -export function isObject(obj: any) { - const typename = typeof obj; - return ( - obj && - typename !== 'string' && - typename !== 'number' && - typename !== 'boolean' && - typename !== 'function' && - !Array.isArray(obj) - ); -} diff --git a/packages/office-viewer/src/util/debounce.ts b/packages/office-viewer/src/util/debounce.ts new file mode 100644 index 000000000..3b8c6f3f3 --- /dev/null +++ b/packages/office-viewer/src/util/debounce.ts @@ -0,0 +1,7 @@ +export const debounce = (fn: Function, ms = 300) => { + let timeoutId: ReturnType; + return function (this: any, ...args: any[]) { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => fn.apply(this, args), ms); + }; +}; diff --git a/packages/office-viewer/src/util/emuToPx.ts b/packages/office-viewer/src/util/emuToPx.ts new file mode 100644 index 000000000..8873f0506 --- /dev/null +++ b/packages/office-viewer/src/util/emuToPx.ts @@ -0,0 +1,12 @@ +/** + * 将 emu 转换为 px + */ +export function emuToPx(emu?: number | string) { + if (emu === undefined) { + return 0; + } + if (typeof emu === 'string') { + emu = parseFloat(emu); + } + return emu / 9525; +} diff --git a/packages/office-viewer/src/util/escapeHTML.ts b/packages/office-viewer/src/util/escapeHTML.ts new file mode 100644 index 000000000..17d52108f --- /dev/null +++ b/packages/office-viewer/src/util/escapeHTML.ts @@ -0,0 +1,11 @@ +/** + * HTML 转义 + */ +export function escapeHtml(html: string) { + return html + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} diff --git a/packages/office-viewer/src/util/fileType.ts b/packages/office-viewer/src/util/fileType.ts index 1c8f00906..3fa83b4dc 100644 --- a/packages/office-viewer/src/util/fileType.ts +++ b/packages/office-viewer/src/util/fileType.ts @@ -42,6 +42,12 @@ function checkString( return check(buffer, stringToBytes(string), options); } +export function fileTypeFromArrayBuffer( + arrayBuffer: ArrayBuffer +): FileType | null { + return fileTypeFromBuffer(new Uint8Array(arrayBuffer.slice(0, 20))); +} + export function fileTypeFromBuffer(buffer: Uint8Array): FileType | null { if (check(buffer, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) { return {ext: 'png', mime: 'image/png'}; @@ -71,5 +77,20 @@ export function fileTypeFromBuffer(buffer: Uint8Array): FileType | null { return {ext: 'pdf', mime: 'application/pdf'}; } + if (check(buffer, [0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1])) { + // Detected Microsoft Compound File Binary File (MS-CFB) Format. + return { + ext: 'cfb', + mime: 'application/x-cfb' + }; + } + + if (check(buffer, [0x50, 0x4b, 0x3, 0x4])) { + return { + ext: 'zip', + mime: 'application/zip' + }; + } + return null; } diff --git a/packages/office-viewer/src/util/getChineseDay.ts b/packages/office-viewer/src/util/getChineseDay.ts new file mode 100644 index 000000000..e52e82e5e --- /dev/null +++ b/packages/office-viewer/src/util/getChineseDay.ts @@ -0,0 +1,9 @@ +/** + * 获取中文星期几 + */ + +export function getChineseDay(date: Date) { + const day = date.getDay(); + const days = ['日', '一', '二', '三', '四', '五', '六']; + return `星期${days[day]}`; +} diff --git a/packages/office-viewer/src/util/isFontAvailable.ts b/packages/office-viewer/src/util/isFontAvailable.ts new file mode 100644 index 000000000..80262aba2 --- /dev/null +++ b/packages/office-viewer/src/util/isFontAvailable.ts @@ -0,0 +1,45 @@ +/** + * 检查字体是否可用,来自 https://www.samclarke.com/javascript-is-font-available/ + * 这个检查只检查宽度,并不完全准确 + */ + +const testString = Array(15).join('abcdefghijklmnopqrstuvwxyz0123456789中'); + +export const isFontAvailable = (function () { + // 测试环境 + if (!document) { + return () => true; + } + const body = document.body; + + const container = document.createElement('span'); + container.innerHTML = testString; + container.style.cssText = [ + 'position:absolute', + 'width:auto', + 'font-size:128px', + 'left:-99999px' + ].join(' !important;'); + + const getWidth = function (fontFamily: string) { + container.style.fontFamily = fontFamily; + + body.appendChild(container); + const width = container.clientWidth; + body.removeChild(container); + + return width; + }; + + const monoWidth = getWidth('monospace'); + const serifWidth = getWidth('serif'); + const sansWidth = getWidth('sans-serif'); + + return (font: string) => { + return ( + monoWidth !== getWidth(font + ',monospace') || + sansWidth !== getWidth(font + ',sans-serif') || + serifWidth !== getWidth(font + ',serif') + ); + }; +})(); diff --git a/packages/office-viewer/src/util/isNumeric.ts b/packages/office-viewer/src/util/isNumeric.ts new file mode 100644 index 000000000..253f7c5b1 --- /dev/null +++ b/packages/office-viewer/src/util/isNumeric.ts @@ -0,0 +1,6 @@ +/** + * 判断字符串是否为数字 + */ +export function isNumeric(str: string) { + return !isNaN(parseFloat(str)); +} diff --git a/packages/office-viewer/src/util/isObject.ts b/packages/office-viewer/src/util/isObject.ts new file mode 100644 index 000000000..30dd9d009 --- /dev/null +++ b/packages/office-viewer/src/util/isObject.ts @@ -0,0 +1,9 @@ +/** + * 判断是否是简单对象 + * @param obj + * @returns + */ + +export function isObject(obj: any) { + return typeof obj === 'object' && !Array.isArray(obj) && obj !== null; +} diff --git a/packages/office-viewer/src/util/isValidURL.ts b/packages/office-viewer/src/util/isValidURL.ts new file mode 100644 index 000000000..c2f391a5a --- /dev/null +++ b/packages/office-viewer/src/util/isValidURL.ts @@ -0,0 +1,18 @@ +/** + * 判断是否是 URL + */ +export function isValidURL(str: string) { + if (!str) { + return false; + } + + let url; + + try { + url = new URL(str); + } catch (_) { + return false; + } + + return url.protocol === 'http:' || url.protocol === 'https:'; +} diff --git a/packages/office-viewer/src/util/isVisible.ts b/packages/office-viewer/src/util/isVisible.ts new file mode 100644 index 000000000..cbc661364 --- /dev/null +++ b/packages/office-viewer/src/util/isVisible.ts @@ -0,0 +1,9 @@ +/** + * 判断元素是否可见 + */ +export function isVisible(elem: HTMLElement) { + return ( + !!elem && + !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length) + ); +} diff --git a/packages/office-viewer/src/util/joinPath.ts b/packages/office-viewer/src/util/joinPath.ts new file mode 100644 index 000000000..9efcb5c89 --- /dev/null +++ b/packages/office-viewer/src/util/joinPath.ts @@ -0,0 +1,23 @@ +/** + * 合并多个路径,来自 + * https://stackoverflow.com/questions/29855098/is-there-a-built-in-javascript-function-similar-to-os-path-join + * 目前都是当成目录,所以如果是文件需要加上 .. + */ + +export function joinPath(...input: string[]) { + let paths = input + .filter(path => !!path) // Remove undefined | null | empty + .join('/') //Join to string + .replaceAll('\\', '/') // Replace from \ to / + .split('/') + .filter(path => !!path && path !== '.') // Remove empty in case a//b///c or ./a ./b + .reduce((items: string[], item) => { + item === '..' ? items.pop() : items.push(item); + return items; + }, []); + if (input[0] && input[0].startsWith('/')) { + paths.unshift(''); + } + + return paths.join('/') || (paths.length ? '/' : '.'); +} diff --git a/packages/office-viewer/src/util/mergeRun.ts b/packages/office-viewer/src/util/mergeRun.ts index 08b87ac4e..7d9dc6164 100644 --- a/packages/office-viewer/src/util/mergeRun.ts +++ b/packages/office-viewer/src/util/mergeRun.ts @@ -2,7 +2,7 @@ * 合并 p 下相同的文本,主要是为了方便替换变量 */ -import {parsePr} from '../parse/parsePr'; +import {parsePr} from '../word/parse/parsePr'; import Word from '../Word'; /** diff --git a/packages/office-viewer/src/util/number.ts b/packages/office-viewer/src/util/number.ts new file mode 100644 index 000000000..307164e97 --- /dev/null +++ b/packages/office-viewer/src/util/number.ts @@ -0,0 +1,27 @@ +/** + * 一些数值比较的工具函数 + */ + +export function eq(x: number, y: number) { + return Math.abs(x - y) < Number.EPSILON; +} + +export function lt(x: number, y: number) { + return x - y < Number.EPSILON && Math.abs(x - y) > Number.EPSILON; +} + +export function lte(x: number, y: number) { + return x - y < Number.EPSILON; +} + +export function gt(x: number, y: number) { + return y - x < Number.EPSILON && Math.abs(x - y) > Number.EPSILON; +} + +export function gte(x: number, y: number) { + return y - x < Number.EPSILON; +} + +export function getPercent(value: number, min: number, max: number) { + return ((value - min) / (max - min)) * 100; +} diff --git a/packages/office-viewer/src/util/objectEqual.ts b/packages/office-viewer/src/util/objectEqual.ts new file mode 100644 index 000000000..00eb16c1b --- /dev/null +++ b/packages/office-viewer/src/util/objectEqual.ts @@ -0,0 +1,16 @@ +/** + * 判断两个对象是否相等 + */ + +export function objectEqual( + obj1: Record, + obj2: Record +) { + for (const key in obj1) { + if (obj1[key] !== obj2[key]) { + return false; + } + } + + return true; +} diff --git a/packages/office-viewer/src/util/onClickOutside.ts b/packages/office-viewer/src/util/onClickOutside.ts new file mode 100644 index 000000000..baf646426 --- /dev/null +++ b/packages/office-viewer/src/util/onClickOutside.ts @@ -0,0 +1,15 @@ +/** + * 点击元素外部时触发回调 + */ +export function onClickOutside( + element: HTMLElement, + onClickOutside: () => void +) { + const outsideClickListener = (event: MouseEvent) => { + if (event.target instanceof Node && !element.contains(event.target)) { + onClickOutside(); + } + }; + + document.addEventListener('mousedown', outsideClickListener); +} diff --git a/packages/office-viewer/src/util/ptToPx.ts b/packages/office-viewer/src/util/ptToPx.ts new file mode 100644 index 000000000..10ecc759c --- /dev/null +++ b/packages/office-viewer/src/util/ptToPx.ts @@ -0,0 +1,10 @@ +/** + * pt 转 px + */ + +const DPI = 96; +const ptToPx = DPI / 72; + +export function pt2px(pt: number) { + return pt * ptToPx; +} diff --git a/packages/office-viewer/src/util/px2pt.ts b/packages/office-viewer/src/util/px2pt.ts new file mode 100644 index 000000000..1f9dc9bc3 --- /dev/null +++ b/packages/office-viewer/src/util/px2pt.ts @@ -0,0 +1,3 @@ +export function px2pt(px: number) { + return px / 1.3333333333333333; +} diff --git a/packages/office-viewer/src/util/saxes.ts b/packages/office-viewer/src/util/saxes.ts new file mode 100644 index 000000000..e8da29e42 --- /dev/null +++ b/packages/office-viewer/src/util/saxes.ts @@ -0,0 +1,2692 @@ +/** + * 来自 https://github.com/lddubeau/saxes,修了些类型报错,后续优化性能 + */ + +import * as ed5 from './xmlchars/xml/1.0/ed5'; +import * as ed2 from './xmlchars/xml/1.1/ed2'; +import * as NSed3 from './xmlchars/xmlns/1.0/ed3'; + +import isS = ed5.isS; +import isChar10 = ed5.isChar; +import isNameStartChar = ed5.isNameStartChar; +import isNameChar = ed5.isNameChar; +import S_LIST = ed5.S_LIST; +import NAME_RE = ed5.NAME_RE; + +import isChar11 = ed2.isChar; + +import isNCNameStartChar = NSed3.isNCNameStartChar; +import isNCNameChar = NSed3.isNCNameChar; +import NC_NAME_RE = NSed3.NC_NAME_RE; + +const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'; +const XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'; + +const rootNS: Record = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment + __proto__: null as any, + xml: XML_NAMESPACE, + xmlns: XMLNS_NAMESPACE +}; + +const XML_ENTITIES: Record = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment + __proto__: null as any, + amp: '&', + gt: '>', + lt: '<', + quot: '"', + apos: "'" +}; + +// EOC: end-of-chunk +const EOC = -1; +const NL_LIKE = -2; + +const S_BEGIN = 0; // Initial state. +const S_BEGIN_WHITESPACE = 1; // leading whitespace +const S_DOCTYPE = 2; // + +const TAB = 9; +const NL = 0xa; +const CR = 0xd; +const SPACE = 0x20; +const BANG = 0x21; +const DQUOTE = 0x22; +const AMP = 0x26; +const SQUOTE = 0x27; +const MINUS = 0x2d; +const FORWARD_SLASH = 0x2f; +const SEMICOLON = 0x3b; +const LESS = 0x3c; +const EQUAL = 0x3d; +const GREATER = 0x3e; +const QUESTION = 0x3f; +const OPEN_BRACKET = 0x5b; +const CLOSE_BRACKET = 0x5d; +const NEL = 0x85; +const LS = 0x2028; // Line Separator + +const isQuote = (c: number): boolean => c === DQUOTE || c === SQUOTE; + +const QUOTES = [DQUOTE, SQUOTE]; + +const DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER]; +const DTD_TERMINATOR = [...QUOTES, LESS, CLOSE_BRACKET]; +const XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST]; +const ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS]; + +function nsPairCheck( + parser: SaxesParser, + prefix: string, + uri: string +): void { + switch (prefix) { + case 'xml': + if (uri !== XML_NAMESPACE) { + parser.fail(`xml prefix must be bound to ${XML_NAMESPACE}.`); + } + break; + case 'xmlns': + if (uri !== XMLNS_NAMESPACE) { + parser.fail(`xmlns prefix must be bound to ${XMLNS_NAMESPACE}.`); + } + break; + default: + } + + switch (uri) { + case XMLNS_NAMESPACE: + parser.fail( + prefix === '' + ? `the default namespace may not be set to ${uri}.` + : `may not assign a prefix (even "xmlns") to the URI \ +${XMLNS_NAMESPACE}.` + ); + break; + case XML_NAMESPACE: + switch (prefix) { + case 'xml': + // Assinging the XML namespace to "xml" is fine. + break; + case '': + parser.fail(`the default namespace may not be set to ${uri}.`); + break; + default: + parser.fail('may not assign the xml namespace to another prefix.'); + } + break; + default: + } +} + +function nsMappingCheck( + parser: SaxesParser, + mapping: Record +): void { + for (const local of Object.keys(mapping)) { + nsPairCheck(parser, local, mapping[local]); + } +} + +const isNCName = (name: string): boolean => NC_NAME_RE.test(name); + +const isName = (name: string): boolean => NAME_RE.test(name); + +const FORBIDDEN_START = 0; +const FORBIDDEN_BRACKET = 1; +const FORBIDDEN_BRACKET_BRACKET = 2; + +/** + * The list of supported events. + */ +export const EVENTS = [ + 'xmldecl', + 'text', + 'processinginstruction', + 'doctype', + 'comment', + 'opentagstart', + 'attribute', + 'opentag', + 'closetag', + 'cdata', + 'error', + 'end', + 'ready' +] as const; + +const EVENT_NAME_TO_HANDLER_NAME: Record = { + xmldecl: 'xmldeclHandler', + text: 'textHandler', + processinginstruction: 'piHandler', + doctype: 'doctypeHandler', + comment: 'commentHandler', + opentagstart: 'openTagStartHandler', + attribute: 'attributeHandler', + opentag: 'openTagHandler', + closetag: 'closeTagHandler', + cdata: 'cdataHandler', + error: 'errorHandler', + end: 'endHandler', + ready: 'readyHandler' +}; + +/** + * Event handler for the + * + * @param text The text data encountered by the parser. + * + */ +export type XMLDeclHandler = (decl: XMLDecl) => void; + +/** + * Event handler for text data. + * + * @param text The text data encountered by the parser. + * + */ +export type TextHandler = (text: string) => void; + +/** + * Event handler for processing instructions. + * + * @param data The target and body of the processing instruction. + */ +export type PIHandler = (data: {target: string; body: string}) => void; + +/** + * Event handler for doctype. + * + * @param doctype The doctype contents. + */ +export type DoctypeHandler = (doctype: string) => void; + +/** + * Event handler for comments. + * + * @param comment The comment contents. + */ +export type CommentHandler = (comment: string) => void; + +/** + * Event handler for the start of an open tag. This is called as soon as we + * have a tag name. + * + * @param tag The tag. + */ +export type OpenTagStartHandler = ( + tag: StartTagForOptions +) => void; + +export type AttributeEventForOptions = O extends { + xmlns: true; +} + ? SaxesAttributeNSIncomplete + : O extends {xmlns?: false | undefined} + ? SaxesAttributePlain + : SaxesAttribute; + +/** + * Event handler for attributes. + */ +export type AttributeHandler = ( + attribute: AttributeEventForOptions +) => void; + +/** + * Event handler for an open tag. This is called when the open tag is + * complete. (We've encountered the ">" that ends the open tag.) + * + * @param tag The tag. + */ +export type OpenTagHandler = ( + tag: TagForOptions +) => void; + +/** + * Event handler for a close tag. Note that for self-closing tags, this is + * called right after ``opentag``. + * + * @param tag The tag. + */ +export type CloseTagHandler = ( + tag: TagForOptions +) => void; + +/** + * Event handler for a CDATA section. This is called when ending the + * CDATA section. + * + * @param cdata The contents of the CDATA section. + */ +export type CDataHandler = (cdata: string) => void; + +/** + * Event handler for the stream end. This is called when the stream has been + * closed with ``close`` or by passing ``null`` to ``write``. + */ +export type EndHandler = () => void; + +/** + * Event handler indicating parser readiness . This is called when the parser + * is ready to parse a new document. + */ +export type ReadyHandler = () => void; + +/** + * Event handler indicating an error. + * + * @param err The error that occurred. + */ +export type ErrorHandler = (err: Error) => void; + +export type EventName = (typeof EVENTS)[number]; +export type EventNameToHandler = { + xmldecl: XMLDeclHandler; + text: TextHandler; + processinginstruction: PIHandler; + doctype: DoctypeHandler; + comment: CommentHandler; + opentagstart: OpenTagStartHandler; + attribute: AttributeHandler; + opentag: OpenTagHandler; + closetag: CloseTagHandler; + cdata: CDataHandler; + error: ErrorHandler; + end: EndHandler; + ready: ReadyHandler; +}[N]; + +/** + * This interface defines the structure of attributes when the parser is + * processing namespaces (created with ``xmlns: true``). + */ +export interface SaxesAttributeNS { + /** + * The attribute's name. This is the combination of prefix and local name. + * For instance ``a:b="c"`` would have ``a:b`` for name. + */ + name: string; + + /** + * The attribute's prefix. For instance ``a:b="c"`` would have ``"a"`` for + * ``prefix``. + */ + prefix: string; + + /** + * The attribute's local name. For instance ``a:b="c"`` would have ``"b"`` for + * ``local``. + */ + local: string; + + /** The namespace URI of this attribute. */ + uri: string; + + /** The attribute's value. */ + value: string; +} + +/** + * This is an attribute, as recorded by a parser which parses namespaces but + * prior to the URI being resolvable. This is what is passed to the attribute + * event handler. + */ +export type SaxesAttributeNSIncomplete = Exclude; + +/** + * This interface defines the structure of attributes when the parser is + * NOT processing namespaces (created with ``xmlns: false``). + */ +export interface SaxesAttributePlain { + /** + * The attribute's name. + */ + name: string; + + /** The attribute's value. */ + value: string; +} + +/** + * A saxes attribute, with or without namespace information. + */ +export type SaxesAttribute = SaxesAttributeNS | SaxesAttributePlain; + +/** + * This are the fields that MAY be present on a complete tag. + */ +export interface SaxesTag { + /** + * The tag's name. This is the combination of prefix and global name. For + * instance ```` would have ``"a:b"`` for ``name``. + */ + name: string; + + /** + * A map of attribute name to attributes. If namespaces are tracked, the + * values in the map are attribute objects. Otherwise, they are strings. + */ + attributes: Record | Record; + + /** + * The namespace bindings in effect. + */ + ns?: Record; + + /** + * The tag's prefix. For instance ```` would have ``"a"`` for + * ``prefix``. Undefined if we do not track namespaces. + */ + prefix?: string; + + /** + * The tag's local name. For instance ```` would + * have ``"b"`` for ``local``. Undefined if we do not track namespaces. + */ + local?: string; + + /** + * The namespace URI of this tag. Undefined if we do not track namespaces. + */ + uri?: string; + + /** Whether the tag is self-closing (e.g. ````). */ + isSelfClosing: boolean; +} + +/** + * This type defines the fields that are present on a tag object when + * ``onopentagstart`` is called. This interface is namespace-agnostic. + */ +export type SaxesStartTag = Pick; + +/** + * This type defines the fields that are present on a tag object when + * ``onopentagstart`` is called on a parser that does not processes namespaces. + */ +export type SaxesStartTagPlain = Pick; + +/** + * This type defines the fields that are present on a tag object when + * ``onopentagstart`` is called on a parser that does process namespaces. + */ +export type SaxesStartTagNS = Required; + +/** + * This are the fields that are present on a complete tag produced by a parser + * that does process namespaces. + */ +export type SaxesTagNS = Required & { + attributes: Record; +}; + +/** + * This are the fields that are present on a complete tag produced by a parser + * that does not process namespaces. + */ +export type SaxesTagPlain = Pick< + SaxesTag, + 'name' | 'attributes' | 'isSelfClosing' +> & { + attributes: Record; +}; + +// This is an internal type used for holding tags while they are being built. +type SaxesTagIncomplete = Omit & + Partial>; + +/** + * An XML declaration. + */ +export interface XMLDecl { + /** The version specified by the XML declaration. */ + version?: string; + + /** The encoding specified by the XML declaration. */ + encoding?: string; + + /** The value of the standalone parameter */ + standalone?: string; +} + +/** + * A callback for resolving name prefixes. + * + * @param prefix The prefix to check. + * + * @returns The URI corresponding to the prefix, if any. + */ +export type ResolvePrefix = (prefix: string) => string | undefined; + +export interface CommonOptions { + /** Whether to accept XML fragments. Unset means ``false``. */ + fragment?: boolean; + + /** Whether to track positions. Unset means ``true``. */ + position?: boolean; + + /** + * A file name to use for error reporting. "File name" is a loose concept. You + * could use a URL to some resource, or any descriptive name you like. + */ + fileName?: string; +} + +export interface NSOptions { + /** Whether to track namespaces. Unset means ``false``. */ + xmlns?: boolean; + + /** + * A plain object whose key, value pairs define namespaces known before + * parsing the XML file. It is not legal to pass bindings for the namespaces + * ``"xml"`` or ``"xmlns"``. + */ + additionalNamespaces?: Record; + + /** + * A function that will be used if the parser cannot resolve a namespace + * prefix on its own. + */ + resolvePrefix?: ResolvePrefix; +} + +export interface NSOptionsWithoutNamespaces extends NSOptions { + xmlns?: false; + // It makes no sense to set these if namespaces are not used. + additionalNamespaces?: undefined; + resolvePrefix?: undefined; +} + +export interface NSOptionsWithNamespaces extends NSOptions { + xmlns: true; + // The other options are still optional. +} + +export interface XMLVersionOptions { + /** + * The default XML version to use. If unspecified, and there is no XML + * encoding declaration, the default version is "1.0". + */ + defaultXMLVersion?: '1.0' | '1.1'; + + /** + * A flag indicating whether to force the XML version used for parsing to the + * value of ``defaultXMLVersion``. When this flag is ``true``, + * ``defaultXMLVersion`` must be specified. If unspecified, the default value + * of this flag is ``false``. + */ + forceXMLVersion?: boolean; +} + +export interface NoForcedXMLVersion extends XMLVersionOptions { + forceXMLVersion?: false; + // defaultXMLVersion stays the same. +} + +export interface ForcedXMLVersion extends XMLVersionOptions { + forceXMLVersion: true; + // defaultXMLVersion becomes mandatory. + defaultXMLVersion: Exclude; +} + +/** + * The entire set of options supported by saxes. + */ +export type SaxesOptions = CommonOptions & NSOptions & XMLVersionOptions; + +export type TagForOptions = O extends {xmlns: true} + ? SaxesTagNS + : O extends {xmlns?: false | undefined} + ? SaxesTagPlain + : SaxesTag; + +export type StartTagForOptions = O extends {xmlns: true} + ? SaxesStartTagNS + : O extends {xmlns?: false | undefined} + ? SaxesStartTagPlain + : SaxesStartTag; + +// eslint-disable-next-line @typescript-eslint/ban-types +export class SaxesParser { + private readonly fragmentOpt: boolean; + private readonly xmlnsOpt: boolean; + private readonly trackPosition: boolean; + private readonly fileName?: string; + private readonly nameStartCheck: (c: number) => boolean; + private readonly nameCheck: (c: number) => boolean; + private readonly isName: (name: string) => boolean; + private readonly ns!: Record; + + private openWakaBang!: string; + private text!: string; + private name!: string; + private piTarget!: string; + private entity!: string; + private q!: null | number; + private tags!: SaxesTagIncomplete[]; + private tag!: SaxesTagIncomplete | null; + private topNS!: Record | null; + private chunk!: string; + private chunkPosition!: number; + private i!: number; + + // + // We use prevI to allow "ungetting" the previously read code point. Note + // however, that it is not safe to unget everything and anything. In + // particular ungetting EOL characters will screw positioning up. + // + // Practically, you must not unget a code which has any side effect beyond + // updating ``this.i`` and ``this.prevI``. Only EOL codes have such side + // effects. + // + private prevI!: number; + private carriedFromPrevious?: string; + private forbiddenState!: number; + private attribList!: (SaxesAttributeNSIncomplete | SaxesAttributePlain)[]; + private state!: number; + private reportedTextBeforeRoot!: boolean; + private reportedTextAfterRoot!: boolean; + private closedRoot!: boolean; + private sawRoot!: boolean; + private xmlDeclPossible!: boolean; + private xmlDeclExpects!: string[]; + private entityReturnState?: number; + private processAttribs!: (this: this) => void; + private positionAtNewLine!: number; + private doctype!: boolean; + private getCode!: () => number; + private isChar!: (c: number) => boolean; + private pushAttrib!: (name: string, value: string) => void; + private _closed!: boolean; + private currentXMLVersion!: string; + private readonly stateTable: ((this: SaxesParser) => void)[]; + private xmldeclHandler?: XMLDeclHandler; + private textHandler?: TextHandler; + private piHandler?: PIHandler; + private doctypeHandler?: DoctypeHandler; + private commentHandler?: CommentHandler; + private openTagStartHandler?: OpenTagStartHandler; + private openTagHandler?: OpenTagHandler; + private closeTagHandler?: CloseTagHandler; + private cdataHandler?: CDataHandler; + private errorHandler?: ErrorHandler; + private endHandler?: EndHandler; + private readyHandler?: ReadyHandler; + private attributeHandler?: AttributeHandler; + + /** + * Indicates whether or not the parser is closed. If ``true``, wait for + * the ``ready`` event to write again. + */ + get closed(): boolean { + return this._closed; + } + + readonly opt: SaxesOptions; + + /** + * The XML declaration for this document. + */ + xmlDecl!: XMLDecl; + + /** + * The line number of the next character to be read by the parser. This field + * is one-based. (The first line is numbered 1.) + */ + line!: number; + + /** + * The column number of the next character to be read by the parser. * + * This field is zero-based. (The first column is 0.) + * + * This field counts columns by *Unicode character*. Note that this *can* + * be different from the index of the character in a JavaScript string due + * to how JavaScript handles astral plane characters. + * + * See [[columnIndex]] for a number that corresponds to the JavaScript index. + */ + column!: number; + + /** + * A map of entity name to expansion. + */ + ENTITIES!: Record; + + /** + * @param opt The parser options. + */ + constructor(opt?: O) { + this.opt = opt ?? {}; + this.fragmentOpt = !!(this.opt.fragment as boolean); + const xmlnsOpt = (this.xmlnsOpt = !!(this.opt.xmlns as boolean)); + this.trackPosition = this.opt.position !== false; + this.fileName = this.opt.fileName; + + if (xmlnsOpt) { + // This is the function we use to perform name checks on PIs and entities. + // When namespaces are used, colons are not allowed in PI target names or + // entity names. So the check depends on whether namespaces are used. See: + // + // https://www.w3.org/XML/xml-names-19990114-errata.html + // NE08 + // + this.nameStartCheck = isNCNameStartChar; + this.nameCheck = isNCNameChar; + this.isName = isNCName; + // eslint-disable-next-line @typescript-eslint/unbound-method + this.processAttribs = this.processAttribsNS; + // eslint-disable-next-line @typescript-eslint/unbound-method + this.pushAttrib = this.pushAttribNS; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment + this.ns = {__proto__: null as any, ...rootNS}; + const additional = this.opt.additionalNamespaces; + if (additional != null) { + nsMappingCheck(this, additional); + Object.assign(this.ns, additional); + } + } else { + this.nameStartCheck = isNameStartChar; + this.nameCheck = isNameChar; + this.isName = isName; + // eslint-disable-next-line @typescript-eslint/unbound-method + this.processAttribs = this.processAttribsPlain; + // eslint-disable-next-line @typescript-eslint/unbound-method + this.pushAttrib = this.pushAttribPlain; + } + + // + // The order of the members in this table needs to correspond to the state + // numbers given to the states that correspond to the methods being recorded + // here. + // + this.stateTable = [ + /* eslint-disable @typescript-eslint/unbound-method */ + this.sBegin, + this.sBeginWhitespace, + this.sDoctype, + this.sDoctypeQuote, + this.sDTD, + this.sDTDQuoted, + this.sDTDOpenWaka, + this.sDTDOpenWakaBang, + this.sDTDComment, + this.sDTDCommentEnding, + this.sDTDCommentEnded, + this.sDTDPI, + this.sDTDPIEnding, + this.sText, + this.sEntity, + this.sOpenWaka, + this.sOpenWakaBang, + this.sComment, + this.sCommentEnding, + this.sCommentEnded, + this.sCData, + this.sCDataEnding, + this.sCDataEnding2, + this.sPIFirstChar, + this.sPIRest, + this.sPIBody, + this.sPIEnding, + this.sXMLDeclNameStart, + this.sXMLDeclName, + this.sXMLDeclEq, + this.sXMLDeclValueStart, + this.sXMLDeclValue, + this.sXMLDeclSeparator, + this.sXMLDeclEnding, + this.sOpenTag, + this.sOpenTagSlash, + this.sAttrib, + this.sAttribName, + this.sAttribNameSawWhite, + this.sAttribValue, + this.sAttribValueQuoted, + this.sAttribValueClosed, + this.sAttribValueUnquoted, + this.sCloseTag, + this.sCloseTagSawWhite + /* eslint-enable @typescript-eslint/unbound-method */ + ]; + + this._init(); + } + + _init(): void { + this.openWakaBang = ''; + this.text = ''; + this.name = ''; + this.piTarget = ''; + this.entity = ''; + + this.q = null; + this.tags = []; + this.tag = null; + this.topNS = null; + this.chunk = ''; + this.chunkPosition = 0; + this.i = 0; + this.prevI = 0; + this.carriedFromPrevious = undefined; + this.forbiddenState = FORBIDDEN_START; + this.attribList = []; + + // The logic is organized so as to minimize the need to check + // this.opt.fragment while parsing. + + const {fragmentOpt} = this; + this.state = fragmentOpt ? S_TEXT : S_BEGIN; + // We want these to be all true if we are dealing with a fragment. + this.reportedTextBeforeRoot = + this.reportedTextAfterRoot = + this.closedRoot = + this.sawRoot = + fragmentOpt; + // An XML declaration is intially possible only when parsing whole + // documents. + this.xmlDeclPossible = !fragmentOpt; + + this.xmlDeclExpects = ['version']; + this.entityReturnState = undefined; + + let {defaultXMLVersion} = this.opt; + if (defaultXMLVersion === undefined) { + if (this.opt.forceXMLVersion === true) { + throw new Error('forceXMLVersion set but defaultXMLVersion is not set'); + } + defaultXMLVersion = '1.0'; + } + this.setXMLVersion(defaultXMLVersion); + + this.positionAtNewLine = 0; + + this.doctype = false; + this._closed = false; + + this.xmlDecl = { + version: undefined, + encoding: undefined, + standalone: undefined + }; + + this.line = 1; + this.column = 0; + + this.ENTITIES = Object.create(XML_ENTITIES) as Record; + + this.readyHandler?.(); + } + + /** + * The stream position the parser is currently looking at. This field is + * zero-based. + * + * This field is not based on counting Unicode characters but is to be + * interpreted as a plain index into a JavaScript string. + */ + get position(): number { + return this.chunkPosition + this.i; + } + + /** + * The column number of the next character to be read by the parser. * + * This field is zero-based. (The first column in a line is 0.) + * + * This field reports the index at which the next character would be in the + * line if the line were represented as a JavaScript string. Note that this + * *can* be different to a count based on the number of *Unicode characters* + * due to how JavaScript handles astral plane characters. + * + * See [[column]] for a number that corresponds to a count of Unicode + * characters. + */ + get columnIndex(): number { + return this.position - this.positionAtNewLine; + } + + /** + * Set an event listener on an event. The parser supports one handler per + * event type. If you try to set an event handler over an existing handler, + * the old handler is silently overwritten. + * + * @param name The event to listen to. + * + * @param handler The handler to set. + */ + on(name: N, handler: EventNameToHandler): void { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + (this as any)[EVENT_NAME_TO_HANDLER_NAME[name]] = handler; + } + + /** + * Unset an event handler. + * + * @parma name The event to stop listening to. + */ + off(name: EventName): void { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + (this as any)[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined; + } + + /** + * Make an error object. The error object will have a message that contains + * the ``fileName`` option passed at the creation of the parser. If position + * tracking was turned on, it will also have line and column number + * information. + * + * @param message The message describing the error to report. + * + * @returns An error object with a properly formatted message. + */ + makeError(message: string): Error { + let msg = this.fileName ?? ''; + if (this.trackPosition) { + if (msg.length > 0) { + msg += ':'; + } + msg += `${this.line}:${this.column}`; + } + if (msg.length > 0) { + msg += ': '; + } + return new Error(msg + message); + } + + /** + * Report a parsing error. This method is made public so that client code may + * check for issues that are outside the scope of this project and can report + * errors. + * + * @param message The error to report. + * + * @returns this + */ + fail(message: string): this { + const err = this.makeError(message); + const handler = this.errorHandler; + if (handler === undefined) { + throw err; + } else { + handler(err); + } + return this; + } + + /** + * Write a XML data to the parser. + * + * @param chunk The XML data to write. + * + * @returns this + */ + // We do need object for the type here. Yes, it often causes problems + // but not in this case. + write(chunk: string | object | null): this { + if (this.closed) { + return this.fail('cannot write after close; assign an onready handler.'); + } + + let end = false; + if (chunk === null) { + // We cannot return immediately because carriedFromPrevious may need + // processing. + end = true; + chunk = ''; + } else if (typeof chunk === 'object') { + chunk = chunk.toString(); + } + + // We checked if performing a pre-decomposition of the string into an array + // of single complete characters (``Array.from(chunk)``) would be faster + // than the current repeated calls to ``charCodeAt``. As of August 2018, it + // isn't. (There may be Node-specific code that would perform faster than + // ``Array.from`` but don't want to be dependent on Node.) + + if (this.carriedFromPrevious !== undefined) { + // The previous chunk had char we must carry over. + chunk = `${this.carriedFromPrevious}${chunk}`; + this.carriedFromPrevious = undefined; + } + + let limit = chunk.length; + const lastCode = chunk.charCodeAt(limit - 1); + if ( + !end && + // A trailing CR or surrogate must be carried over to the next + // chunk. + (lastCode === CR || (lastCode >= 0xd800 && lastCode <= 0xdbff)) + ) { + // The chunk ends with a character that must be carried over. We cannot + // know how to handle it until we get the next chunk or the end of the + // stream. So save it for later. + this.carriedFromPrevious = chunk[limit - 1]; + limit--; + chunk = chunk.slice(0, limit); + } + + const {stateTable} = this; + this.chunk = chunk; + this.i = 0; + while (this.i < limit) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument + stateTable[this.state].call(this as any); + } + this.chunkPosition += limit; + + return end ? this.end() : this; + } + + /** + * Close the current stream. Perform final well-formedness checks and reset + * the parser tstate. + * + * @returns this + */ + close(): this { + return this.write(null); + } + + /** + * Get a single code point out of the current chunk. This updates the current + * position if we do position tracking. + * + * This is the algorithm to use for XML 1.0. + * + * @returns The character read. + */ + private getCode10(): number { + const {chunk, i} = this; + this.prevI = i; + // Yes, we do this instead of doing this.i++. Doing it this way, we do not + // read this.i again, which is a bit faster. + this.i = i + 1; + + if (i >= chunk.length) { + return EOC; + } + + // Using charCodeAt and handling the surrogates ourselves is faster + // than using codePointAt. + const code = chunk.charCodeAt(i); + + this.column++; + if (code < 0xd800) { + if (code >= SPACE || code === TAB) { + return code; + } + + switch (code) { + case NL: + this.line++; + this.column = 0; + this.positionAtNewLine = this.position; + return NL; + case CR: + // We may get NaN if we read past the end of the chunk, which is fine. + if (chunk.charCodeAt(i + 1) === NL) { + // A \r\n sequence is converted to \n so we have to skip over the + // next character. We already know it has a size of 1 so ++ is fine + // here. + this.i = i + 2; + } + // Otherwise, a \r is just converted to \n, so we don't have to skip + // ahead. + + // In either case, \r becomes \n. + this.line++; + this.column = 0; + this.positionAtNewLine = this.position; + return NL_LIKE; + default: + // If we get here, then code < SPACE and it is not NL CR or TAB. + this.fail('disallowed character.'); + return code; + } + } + + if (code > 0xdbff) { + // This is a specialized version of isChar10 that takes into account + // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not + // test cases that don't need testing. + if (!(code >= 0xe000 && code <= 0xfffd)) { + this.fail('disallowed character.'); + } + + return code; + } + + const final = + 0x10000 + (code - 0xd800) * 0x400 + (chunk.charCodeAt(i + 1) - 0xdc00); + this.i = i + 2; + + // This is a specialized version of isChar10 that takes into account that in + // this context necessarily final >= 0x10000. + if (final > 0x10ffff) { + this.fail('disallowed character.'); + } + + return final; + } + + /** + * Get a single code point out of the current chunk. This updates the current + * position if we do position tracking. + * + * This is the algorithm to use for XML 1.1. + * + * @returns {number} The character read. + */ + private getCode11(): number { + const {chunk, i} = this; + this.prevI = i; + // Yes, we do this instead of doing this.i++. Doing it this way, we do not + // read this.i again, which is a bit faster. + this.i = i + 1; + + if (i >= chunk.length) { + return EOC; + } + + // Using charCodeAt and handling the surrogates ourselves is faster + // than using codePointAt. + const code = chunk.charCodeAt(i); + + this.column++; + if (code < 0xd800) { + if ( + (code > 0x1f && code < 0x7f) || + (code > 0x9f && code !== LS) || + code === TAB + ) { + return code; + } + + switch (code) { + case NL: // 0xA + this.line++; + this.column = 0; + this.positionAtNewLine = this.position; + return NL; + case CR: { + // 0xD + // We may get NaN if we read past the end of the chunk, which is + // fine. + const next = chunk.charCodeAt(i + 1); + if (next === NL || next === NEL) { + // A CR NL or CR NEL sequence is converted to NL so we have to skip + // over the next character. We already know it has a size of 1. + this.i = i + 2; + } + // Otherwise, a CR is just converted to NL, no skip. + } + /* yes, fall through */ + case NEL: // 0x85 + case LS: // Ox2028 + this.line++; + this.column = 0; + this.positionAtNewLine = this.position; + return NL_LIKE; + default: + this.fail('disallowed character.'); + return code; + } + } + + if (code > 0xdbff) { + // This is a specialized version of isCharAndNotRestricted that takes into + // account that in this context code > 0xDBFF and code <= 0xFFFF. So it + // does not test cases that don't need testing. + if (!(code >= 0xe000 && code <= 0xfffd)) { + this.fail('disallowed character.'); + } + + return code; + } + + const final = + 0x10000 + (code - 0xd800) * 0x400 + (chunk.charCodeAt(i + 1) - 0xdc00); + this.i = i + 2; + + // This is a specialized version of isCharAndNotRestricted that takes into + // account that in this context necessarily final >= 0x10000. + if (final > 0x10ffff) { + this.fail('disallowed character.'); + } + + return final; + } + + /** + * Like ``getCode`` but with the return value normalized so that ``NL`` is + * returned for ``NL_LIKE``. + */ + private getCodeNorm(): number { + const c = this.getCode(); + return c === NL_LIKE ? NL : c; + } + + private unget(): void { + this.i = this.prevI; + this.column--; + } + + /** + * Capture characters into a buffer until encountering one of a set of + * characters. + * + * @param chars An array of codepoints. Encountering a character in the array + * ends the capture. (``chars`` may safely contain ``NL``.) + * + * @return The character code that made the capture end, or ``EOC`` if we hit + * the end of the chunk. The return value cannot be NL_LIKE: NL is returned + * instead. + */ + private captureTo(chars: number[]): number { + let {i: start} = this; + const {chunk} = this; + // eslint-disable-next-line no-constant-condition + while (true) { + const c = this.getCode(); + const isNLLike = c === NL_LIKE; + const final = isNLLike ? NL : c; + if (final === EOC || chars.includes(final)) { + this.text += chunk.slice(start, this.prevI); + return final; + } + + if (isNLLike) { + this.text += `${chunk.slice(start, this.prevI)}\n`; + start = this.i; + } + } + } + + /** + * Capture characters into a buffer until encountering a character. + * + * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT + * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior. + * + * @return ``true`` if we ran into the character. Otherwise, we ran into the + * end of the current chunk. + */ + private captureToChar(char: number): boolean { + let {i: start} = this; + const {chunk} = this; + // eslint-disable-next-line no-constant-condition + while (true) { + let c = this.getCode(); + switch (c) { + case NL_LIKE: + this.text += `${chunk.slice(start, this.prevI)}\n`; + start = this.i; + c = NL; + break; + case EOC: + this.text += chunk.slice(start); + return false; + default: + } + + if (c === char) { + this.text += chunk.slice(start, this.prevI); + return true; + } + } + } + + /** + * Capture characters that satisfy ``isNameChar`` into the ``name`` field of + * this parser. + * + * @return The character code that made the test fail, or ``EOC`` if we hit + * the end of the chunk. The return value cannot be NL_LIKE: NL is returned + * instead. + */ + private captureNameChars(): number { + const {chunk, i: start} = this; + // eslint-disable-next-line no-constant-condition + while (true) { + const c = this.getCode(); + if (c === EOC) { + this.name += chunk.slice(start); + return EOC; + } + + // NL is not a name char so we don't have to test specifically for it. + if (!isNameChar(c)) { + this.name += chunk.slice(start, this.prevI); + return c === NL_LIKE ? NL : c; + } + } + } + + /** + * Skip white spaces. + * + * @return The character that ended the skip, or ``EOC`` if we hit + * the end of the chunk. The return value cannot be NL_LIKE: NL is returned + * instead. + */ + private skipSpaces(): number { + // eslint-disable-next-line no-constant-condition + while (true) { + const c = this.getCodeNorm(); + if (c === EOC || !isS(c)) { + return c; + } + } + } + + private setXMLVersion(version: string): void { + this.currentXMLVersion = version; + /* eslint-disable @typescript-eslint/unbound-method */ + if (version === '1.0') { + this.isChar = isChar10; + this.getCode = this.getCode10; + } else { + this.isChar = isChar11; + this.getCode = this.getCode11; + } + /* eslint-enable @typescript-eslint/unbound-method */ + } + + // STATE ENGINE METHODS + + // This needs to be a state separate from S_BEGIN_WHITESPACE because we want + // to be sure never to come back to this state later. + private sBegin(): void { + // We are essentially peeking at the first character of the chunk. Since + // S_BEGIN can be in effect only when we start working on the first chunk, + // the index at which we must look is necessarily 0. Note also that the + // following test does not depend on decoding surrogates. + + // If the initial character is 0xFEFF, ignore it. + if (this.chunk.charCodeAt(0) === 0xfeff) { + this.i++; + this.column++; + } + + this.state = S_BEGIN_WHITESPACE; + } + + private sBeginWhitespace(): void { + // We need to know whether we've encountered spaces or not because as soon + // as we run into a space, an XML declaration is no longer possible. Rather + // than slow down skipSpaces even in places where we don't care whether it + // skipped anything or not, we check whether prevI is equal to the value of + // i from before we skip spaces. + const iBefore = this.i; + const c = this.skipSpaces(); + if (this.prevI !== iBefore) { + this.xmlDeclPossible = false; + } + + switch (c) { + case LESS: + this.state = S_OPEN_WAKA; + // We could naively call closeText but in this state, it is not normal + // to have text be filled with any data. + if (this.text.length !== 0) { + throw new Error('no-empty text at start'); + } + break; + case EOC: + break; + default: + this.unget(); + this.state = S_TEXT; + this.xmlDeclPossible = false; + } + } + + private sDoctype(): void { + const c = this.captureTo(DOCTYPE_TERMINATOR); + switch (c) { + case GREATER: { + this.doctypeHandler?.(this.text); + this.text = ''; + this.state = S_TEXT; + this.doctype = true; // just remember that we saw it. + break; + } + case EOC: + break; + default: + this.text += String.fromCodePoint(c); + if (c === OPEN_BRACKET) { + this.state = S_DTD; + } else if (isQuote(c)) { + this.state = S_DOCTYPE_QUOTE; + this.q = c; + } + } + } + + private sDoctypeQuote(): void { + const q = this.q!; + if (this.captureToChar(q)) { + this.text += String.fromCodePoint(q); + this.q = null; + this.state = S_DOCTYPE; + } + } + + private sDTD(): void { + const c = this.captureTo(DTD_TERMINATOR); + if (c === EOC) { + return; + } + + this.text += String.fromCodePoint(c); + if (c === CLOSE_BRACKET) { + this.state = S_DOCTYPE; + } else if (c === LESS) { + this.state = S_DTD_OPEN_WAKA; + } else if (isQuote(c)) { + this.state = S_DTD_QUOTED; + this.q = c; + } + } + + private sDTDQuoted(): void { + const q = this.q!; + if (this.captureToChar(q)) { + this.text += String.fromCodePoint(q); + this.state = S_DTD; + this.q = null; + } + } + + private sDTDOpenWaka(): void { + const c = this.getCodeNorm(); + this.text += String.fromCodePoint(c); + switch (c) { + case BANG: + this.state = S_DTD_OPEN_WAKA_BANG; + this.openWakaBang = ''; + break; + case QUESTION: + this.state = S_DTD_PI; + break; + default: + this.state = S_DTD; + } + } + + private sDTDOpenWakaBang(): void { + const char = String.fromCodePoint(this.getCodeNorm()); + const owb = (this.openWakaBang += char); + this.text += char; + if (owb !== '-') { + this.state = owb === '--' ? S_DTD_COMMENT : S_DTD; + this.openWakaBang = ''; + } + } + + private sDTDComment(): void { + if (this.captureToChar(MINUS)) { + this.text += '-'; + this.state = S_DTD_COMMENT_ENDING; + } + } + + private sDTDCommentEnding(): void { + const c = this.getCodeNorm(); + this.text += String.fromCodePoint(c); + this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT; + } + + private sDTDCommentEnded(): void { + const c = this.getCodeNorm(); + this.text += String.fromCodePoint(c); + if (c === GREATER) { + this.state = S_DTD; + } else { + this.fail('malformed comment.'); + // will be recorded as + // a comment of " blah -- bloo " + this.state = S_DTD_COMMENT; + } + } + + private sDTDPI(): void { + if (this.captureToChar(QUESTION)) { + this.text += '?'; + this.state = S_DTD_PI_ENDING; + } + } + + private sDTDPIEnding(): void { + const c = this.getCodeNorm(); + this.text += String.fromCodePoint(c); + if (c === GREATER) { + this.state = S_DTD; + } + } + + private sText(): void { + // + // We did try a version of saxes where the S_TEXT state was split in two + // states: one for text inside the root element, and one for text + // outside. This was avoiding having to test this.tags.length to decide + // what implementation to actually use. + // + // Peformance testing on gigabyte-size files did not show any advantage to + // using the two states solution instead of the current one. Conversely, it + // made the code a bit more complicated elsewhere. For instance, a comment + // can appear before the root element so when a comment ended it was + // necessary to determine whether to return to the S_TEXT state or to the + // new text-outside-root state. + // + if (this.tags.length !== 0) { + this.handleTextInRoot(); + } else { + this.handleTextOutsideRoot(); + } + } + + private sEntity(): void { + // This is essentially a specialized version of captureToChar(SEMICOLON...) + let {i: start} = this; + const {chunk} = this; + // eslint-disable-next-line no-labels, no-restricted-syntax + // eslint-disable-next-line no-constant-condition + loop: while (true) { + switch (this.getCode()) { + case NL_LIKE: + this.entity += `${chunk.slice(start, this.prevI)}\n`; + start = this.i; + break; + case SEMICOLON: { + const {entityReturnState} = this; + const entity = this.entity + chunk.slice(start, this.prevI); + this.state = entityReturnState!; + let parsed: string; + if (entity === '') { + this.fail('empty entity name.'); + parsed = '&;'; + } else { + parsed = this.parseEntity(entity); + this.entity = ''; + } + + if (entityReturnState !== S_TEXT || this.textHandler !== undefined) { + this.text += parsed; + } + // eslint-disable-next-line no-labels + break loop; + } + case EOC: + this.entity += chunk.slice(start); + // eslint-disable-next-line no-labels + break loop; + default: + } + } + } + + private sOpenWaka(): void { + // Reminder: a state handler is called with at least one character + // available in the current chunk. So the first call to get code inside of + // a state handler cannot return ``EOC``. That's why we don't test + // for it. + const c = this.getCode(); + // either a /, ?, !, or text is coming next. + if (isNameStartChar(c)) { + this.state = S_OPEN_TAG; + this.unget(); + this.xmlDeclPossible = false; + } else { + switch (c) { + case FORWARD_SLASH: + this.state = S_CLOSE_TAG; + this.xmlDeclPossible = false; + break; + case BANG: + this.state = S_OPEN_WAKA_BANG; + this.openWakaBang = ''; + this.xmlDeclPossible = false; + break; + case QUESTION: + this.state = S_PI_FIRST_CHAR; + break; + default: + this.fail('disallowed character in tag name'); + this.state = S_TEXT; + this.xmlDeclPossible = false; + } + } + } + + private sOpenWakaBang(): void { + this.openWakaBang += String.fromCodePoint(this.getCodeNorm()); + switch (this.openWakaBang) { + case '[CDATA[': + if (!this.sawRoot && !this.reportedTextBeforeRoot) { + this.fail('text data outside of root node.'); + this.reportedTextBeforeRoot = true; + } + + if (this.closedRoot && !this.reportedTextAfterRoot) { + this.fail('text data outside of root node.'); + this.reportedTextAfterRoot = true; + } + this.state = S_CDATA; + this.openWakaBang = ''; + break; + case '--': + this.state = S_COMMENT; + this.openWakaBang = ''; + break; + case 'DOCTYPE': + this.state = S_DOCTYPE; + if (this.doctype || this.sawRoot) { + this.fail('inappropriately located doctype declaration.'); + } + this.openWakaBang = ''; + break; + default: + // 7 happens to be the maximum length of the string that can possibly + // match one of the cases above. + if (this.openWakaBang.length >= 7) { + this.fail('incorrect syntax.'); + } + } + } + + private sComment(): void { + if (this.captureToChar(MINUS)) { + this.state = S_COMMENT_ENDING; + } + } + + private sCommentEnding(): void { + const c = this.getCodeNorm(); + if (c === MINUS) { + this.state = S_COMMENT_ENDED; + this.commentHandler?.(this.text); + this.text = ''; + } else { + this.text += `-${String.fromCodePoint(c)}`; + this.state = S_COMMENT; + } + } + + private sCommentEnded(): void { + const c = this.getCodeNorm(); + if (c !== GREATER) { + this.fail('malformed comment.'); + // will be recorded as + // a comment of " blah -- bloo " + this.text += `--${String.fromCodePoint(c)}`; + this.state = S_COMMENT; + } else { + this.state = S_TEXT; + } + } + + private sCData(): void { + if (this.captureToChar(CLOSE_BRACKET)) { + this.state = S_CDATA_ENDING; + } + } + + private sCDataEnding(): void { + const c = this.getCodeNorm(); + if (c === CLOSE_BRACKET) { + this.state = S_CDATA_ENDING_2; + } else { + this.text += `]${String.fromCodePoint(c)}`; + this.state = S_CDATA; + } + } + + private sCDataEnding2(): void { + const c = this.getCodeNorm(); + switch (c) { + case GREATER: { + this.cdataHandler?.(this.text); + this.text = ''; + this.state = S_TEXT; + break; + } + case CLOSE_BRACKET: + this.text += ']'; + break; + default: + this.text += `]]${String.fromCodePoint(c)}`; + this.state = S_CDATA; + } + } + + // We need this separate state to check the first character fo the pi target + // with this.nameStartCheck which allows less characters than this.nameCheck. + private sPIFirstChar(): void { + const c = this.getCodeNorm(); + // This is first because in the case where the file is well-formed this is + // the branch taken. We optimize for well-formedness. + if (this.nameStartCheck(c)) { + this.piTarget += String.fromCodePoint(c); + this.state = S_PI_REST; + } else if (c === QUESTION || isS(c)) { + this.fail('processing instruction without a target.'); + this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY; + } else { + this.fail('disallowed character in processing instruction name.'); + this.piTarget += String.fromCodePoint(c); + this.state = S_PI_REST; + } + } + + private sPIRest(): void { + // Capture characters into a piTarget while ``this.nameCheck`` run on the + // character read returns true. + const {chunk, i: start} = this; + // eslint-disable-next-line no-constant-condition + while (true) { + const c = this.getCodeNorm(); + if (c === EOC) { + this.piTarget += chunk.slice(start); + return; + } + + // NL cannot satisfy this.nameCheck so we don't have to test specifically + // for it. + if (!this.nameCheck(c)) { + this.piTarget += chunk.slice(start, this.prevI); + const isQuestion = c === QUESTION; + if (isQuestion || isS(c)) { + if (this.piTarget === 'xml') { + if (!this.xmlDeclPossible) { + this.fail( + 'an XML declaration must be at the start of the document.' + ); + } + + this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START; + } else { + this.state = isQuestion ? S_PI_ENDING : S_PI_BODY; + } + } else { + this.fail('disallowed character in processing instruction name.'); + this.piTarget += String.fromCodePoint(c); + } + break; + } + } + } + + private sPIBody(): void { + if (this.text.length === 0) { + const c = this.getCodeNorm(); + if (c === QUESTION) { + this.state = S_PI_ENDING; + } else if (!isS(c)) { + this.text = String.fromCodePoint(c); + } + } + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + else if (this.captureToChar(QUESTION)) { + this.state = S_PI_ENDING; + } + } + + private sPIEnding(): void { + const c = this.getCodeNorm(); + if (c === GREATER) { + const {piTarget} = this; + if (piTarget.toLowerCase() === 'xml') { + this.fail( + 'the XML declaration must appear at the start of the document.' + ); + } + this.piHandler?.({ + target: piTarget, + body: this.text + }); + this.piTarget = this.text = ''; + this.state = S_TEXT; + } else if (c === QUESTION) { + // We ran into ?? as part of a processing instruction. We initially took + // the first ? as a sign that the PI was ending, but it is not. So we have + // to add it to the body but we take the new ? as a sign that the PI is + // ending. + this.text += '?'; + } else { + this.text += `?${String.fromCodePoint(c)}`; + this.state = S_PI_BODY; + } + this.xmlDeclPossible = false; + } + + private sXMLDeclNameStart(): void { + const c = this.skipSpaces(); + + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + if (c === QUESTION) { + // It is valid to go to S_XML_DECL_ENDING from this state. + this.state = S_XML_DECL_ENDING; + return; + } + + if (c !== EOC) { + this.state = S_XML_DECL_NAME; + this.name = String.fromCodePoint(c); + } + } + + private sXMLDeclName(): void { + const c = this.captureTo(XML_DECL_NAME_TERMINATOR); + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + if (c === QUESTION) { + this.state = S_XML_DECL_ENDING; + this.name += this.text; + this.text = ''; + this.fail('XML declaration is incomplete.'); + return; + } + + if (!(isS(c) || c === EQUAL)) { + return; + } + + this.name += this.text; + this.text = ''; + if (!this.xmlDeclExpects.includes(this.name)) { + switch (this.name.length) { + case 0: + this.fail('did not expect any more name/value pairs.'); + break; + case 1: + this.fail(`expected the name ${this.xmlDeclExpects[0]}.`); + break; + default: + this.fail(`expected one of ${this.xmlDeclExpects.join(', ')}`); + } + } + + this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ; + } + + private sXMLDeclEq(): void { + const c = this.getCodeNorm(); + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + if (c === QUESTION) { + this.state = S_XML_DECL_ENDING; + this.fail('XML declaration is incomplete.'); + return; + } + + if (isS(c)) { + return; + } + + if (c !== EQUAL) { + this.fail('value required.'); + } + + this.state = S_XML_DECL_VALUE_START; + } + + private sXMLDeclValueStart(): void { + const c = this.getCodeNorm(); + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + if (c === QUESTION) { + this.state = S_XML_DECL_ENDING; + this.fail('XML declaration is incomplete.'); + return; + } + + if (isS(c)) { + return; + } + + if (!isQuote(c)) { + this.fail('value must be quoted.'); + this.q = SPACE; + } else { + this.q = c; + } + + this.state = S_XML_DECL_VALUE; + } + + private sXMLDeclValue(): void { + const c = this.captureTo([this.q!, QUESTION]); + + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + if (c === QUESTION) { + this.state = S_XML_DECL_ENDING; + this.text = ''; + this.fail('XML declaration is incomplete.'); + return; + } + + if (c === EOC) { + return; + } + + const value = this.text; + this.text = ''; + switch (this.name) { + case 'version': { + this.xmlDeclExpects = ['encoding', 'standalone']; + const version = value; + this.xmlDecl.version = version; + // This is the test specified by XML 1.0 but it is fine for XML 1.1. + if (!/^1\.[0-9]+$/.test(version)) { + this.fail('version number must match /^1\\.[0-9]+$/.'); + } + // When forceXMLVersion is set, the XML declaration is ignored. + else if (!(this.opt.forceXMLVersion as boolean)) { + this.setXMLVersion(version); + } + break; + } + case 'encoding': + if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) { + this.fail( + 'encoding value must match \ +/^[A-Za-z0-9][A-Za-z0-9._-]*$/.' + ); + } + this.xmlDeclExpects = ['standalone']; + this.xmlDecl.encoding = value; + break; + case 'standalone': + if (value !== 'yes' && value !== 'no') { + this.fail('standalone value must match "yes" or "no".'); + } + this.xmlDeclExpects = []; + this.xmlDecl.standalone = value; + break; + default: + // We don't need to raise an error here since we've already raised one + // when checking what name was expected. + } + this.name = ''; + this.state = S_XML_DECL_SEPARATOR; + } + + private sXMLDeclSeparator(): void { + const c = this.getCodeNorm(); + + // The question mark character is not valid inside any of the XML + // declaration name/value pairs. + if (c === QUESTION) { + // It is valid to go to S_XML_DECL_ENDING from this state. + this.state = S_XML_DECL_ENDING; + return; + } + + if (!isS(c)) { + this.fail('whitespace required.'); + this.unget(); + } + + this.state = S_XML_DECL_NAME_START; + } + + private sXMLDeclEnding(): void { + const c = this.getCodeNorm(); + if (c === GREATER) { + if (this.piTarget !== 'xml') { + this.fail('processing instructions are not allowed before root.'); + } else if ( + this.name !== 'version' && + this.xmlDeclExpects.includes('version') + ) { + this.fail('XML declaration must contain a version.'); + } + this.xmldeclHandler?.(this.xmlDecl); + this.name = ''; + this.piTarget = this.text = ''; + this.state = S_TEXT; + } else { + // We got here because the previous character was a ?, but the question + // mark character is not valid inside any of the XML declaration + // name/value pairs. + this.fail('The character ? is disallowed anywhere in XML declarations.'); + } + this.xmlDeclPossible = false; + } + + private sOpenTag(): void { + const c = this.captureNameChars(); + if (c === EOC) { + return; + } + + const tag: SaxesTagIncomplete = (this.tag = { + name: this.name, + attributes: Object.create(null) as Record + }); + this.name = ''; + + if (this.xmlnsOpt) { + this.topNS = tag.ns = Object.create(null) as Record; + } + + this.openTagStartHandler?.(tag as StartTagForOptions); + this.sawRoot = true; + if (!this.fragmentOpt && this.closedRoot) { + this.fail('documents may contain only one root.'); + } + + switch (c) { + case GREATER: + this.openTag(); + break; + case FORWARD_SLASH: + this.state = S_OPEN_TAG_SLASH; + break; + default: + if (!isS(c)) { + this.fail('disallowed character in tag name.'); + } + this.state = S_ATTRIB; + } + } + + private sOpenTagSlash(): void { + if (this.getCode() === GREATER) { + this.openSelfClosingTag(); + } else { + this.fail('forward-slash in opening tag not followed by >.'); + this.state = S_ATTRIB; + } + } + + private sAttrib(): void { + const c = this.skipSpaces(); + if (c === EOC) { + return; + } + if (isNameStartChar(c)) { + this.unget(); + this.state = S_ATTRIB_NAME; + } else if (c === GREATER) { + this.openTag(); + } else if (c === FORWARD_SLASH) { + this.state = S_OPEN_TAG_SLASH; + } else { + this.fail('disallowed character in attribute name.'); + } + } + + private sAttribName(): void { + const c = this.captureNameChars(); + if (c === EQUAL) { + this.state = S_ATTRIB_VALUE; + } else if (isS(c)) { + this.state = S_ATTRIB_NAME_SAW_WHITE; + } else if (c === GREATER) { + this.fail('attribute without value.'); + this.pushAttrib(this.name, this.name); + this.name = this.text = ''; + this.openTag(); + } else if (c !== EOC) { + this.fail('disallowed character in attribute name.'); + } + } + + private sAttribNameSawWhite(): void { + const c = this.skipSpaces(); + switch (c) { + case EOC: + return; + case EQUAL: + this.state = S_ATTRIB_VALUE; + break; + default: + this.fail('attribute without value.'); + // Should we do this??? + // this.tag.attributes[this.name] = ""; + this.text = ''; + this.name = ''; + if (c === GREATER) { + this.openTag(); + } else if (isNameStartChar(c)) { + this.unget(); + this.state = S_ATTRIB_NAME; + } else { + this.fail('disallowed character in attribute name.'); + this.state = S_ATTRIB; + } + } + } + + private sAttribValue(): void { + const c = this.getCodeNorm(); + if (isQuote(c)) { + this.q = c; + this.state = S_ATTRIB_VALUE_QUOTED; + } else if (!isS(c)) { + this.fail('unquoted attribute value.'); + this.state = S_ATTRIB_VALUE_UNQUOTED; + this.unget(); + } + } + + private sAttribValueQuoted(): void { + // We deliberately do not use captureTo here. The specialized code we use + // here is faster than using captureTo. + const {q, chunk} = this; + let {i: start} = this; + // eslint-disable-next-line no-constant-condition + while (true) { + switch (this.getCode()) { + case q: + this.pushAttrib( + this.name, + this.text + chunk.slice(start, this.prevI) + ); + this.name = this.text = ''; + this.q = null; + this.state = S_ATTRIB_VALUE_CLOSED; + return; + case AMP: + this.text += chunk.slice(start, this.prevI); + this.state = S_ENTITY; + this.entityReturnState = S_ATTRIB_VALUE_QUOTED; + return; + case NL: + case NL_LIKE: + case TAB: + this.text += `${chunk.slice(start, this.prevI)} `; + start = this.i; + break; + case LESS: + this.text += chunk.slice(start, this.prevI); + this.fail('disallowed character.'); + return; + case EOC: + this.text += chunk.slice(start); + return; + default: + } + } + } + + private sAttribValueClosed(): void { + const c = this.getCodeNorm(); + if (isS(c)) { + this.state = S_ATTRIB; + } else if (c === GREATER) { + this.openTag(); + } else if (c === FORWARD_SLASH) { + this.state = S_OPEN_TAG_SLASH; + } else if (isNameStartChar(c)) { + this.fail('no whitespace between attributes.'); + this.unget(); + this.state = S_ATTRIB_NAME; + } else { + this.fail('disallowed character in attribute name.'); + } + } + + private sAttribValueUnquoted(): void { + // We don't do anything regarding EOL or space handling for unquoted + // attributes. We already have failed by the time we get here, and the + // contract that saxes upholds states that upon failure, it is not safe to + // rely on the data passed to event handlers (other than + // ``onerror``). Passing "bad" data is not a problem. + const c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR); + switch (c) { + case AMP: + this.state = S_ENTITY; + this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED; + break; + case LESS: + this.fail('disallowed character.'); + break; + case EOC: + break; + default: + if (this.text.includes(']]>')) { + this.fail('the string "]]>" is disallowed in char data.'); + } + this.pushAttrib(this.name, this.text); + this.name = this.text = ''; + if (c === GREATER) { + this.openTag(); + } else { + this.state = S_ATTRIB; + } + } + } + + private sCloseTag(): void { + const c = this.captureNameChars(); + if (c === GREATER) { + this.closeTag(); + } else if (isS(c)) { + this.state = S_CLOSE_TAG_SAW_WHITE; + } else if (c !== EOC) { + this.fail('disallowed character in closing tag.'); + } + } + + private sCloseTagSawWhite(): void { + switch (this.skipSpaces()) { + case GREATER: + this.closeTag(); + break; + case EOC: + break; + default: + this.fail('disallowed character in closing tag.'); + } + } + + // END OF STATE ENGINE METHODS + + private handleTextInRoot(): void { + // This is essentially a specialized version of captureTo which is optimized + // for performing the ]]> check. A previous version of this code, checked + // ``this.text`` for the presence of ]]>. It simplified the code but was + // very costly when character data contained a lot of entities to be parsed. + // + // Since we are using a specialized loop, we also keep track of the presence + // of ]]> in text data. The sequence ]]> is forbidden to appear as-is. + // + let {i: start, forbiddenState} = this; + const {chunk, textHandler: handler} = this; + // eslint-disable-next-line no-labels, no-restricted-syntax + // eslint-disable-next-line no-constant-condition + scanLoop: while (true) { + switch (this.getCode()) { + case LESS: { + this.state = S_OPEN_WAKA; + if (handler !== undefined) { + const {text} = this; + const slice = chunk.slice(start, this.prevI); + if (text.length !== 0) { + handler(text + slice); + this.text = ''; + } else if (slice.length !== 0) { + handler(slice); + } + } + forbiddenState = FORBIDDEN_START; + // eslint-disable-next-line no-labels + break scanLoop; + } + case AMP: + this.state = S_ENTITY; + this.entityReturnState = S_TEXT; + if (handler !== undefined) { + this.text += chunk.slice(start, this.prevI); + } + forbiddenState = FORBIDDEN_START; + // eslint-disable-next-line no-labels + break scanLoop; + case CLOSE_BRACKET: + switch (forbiddenState) { + case FORBIDDEN_START: + forbiddenState = FORBIDDEN_BRACKET; + break; + case FORBIDDEN_BRACKET: + forbiddenState = FORBIDDEN_BRACKET_BRACKET; + break; + case FORBIDDEN_BRACKET_BRACKET: + break; + default: + throw new Error('impossible state'); + } + break; + case GREATER: + if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) { + this.fail('the string "]]>" is disallowed in char data.'); + } + forbiddenState = FORBIDDEN_START; + break; + case NL_LIKE: + if (handler !== undefined) { + this.text += `${chunk.slice(start, this.prevI)}\n`; + } + start = this.i; + forbiddenState = FORBIDDEN_START; + break; + case EOC: + if (handler !== undefined) { + this.text += chunk.slice(start); + } + // eslint-disable-next-line no-labels + break scanLoop; + default: + forbiddenState = FORBIDDEN_START; + } + } + this.forbiddenState = forbiddenState; + } + + private handleTextOutsideRoot(): void { + // This is essentially a specialized version of captureTo which is optimized + // for a specialized task. We keep track of the presence of non-space + // characters in the text since these are errors when appearing outside the + // document root element. + let {i: start} = this; + const {chunk, textHandler: handler} = this; + let nonSpace = false; + // eslint-disable-next-line no-labels, no-restricted-syntax + // eslint-disable-next-line no-constant-condition + outRootLoop: while (true) { + const code = this.getCode(); + switch (code) { + case LESS: { + this.state = S_OPEN_WAKA; + if (handler !== undefined) { + const {text} = this; + const slice = chunk.slice(start, this.prevI); + if (text.length !== 0) { + handler(text + slice); + this.text = ''; + } else if (slice.length !== 0) { + handler(slice); + } + } + // eslint-disable-next-line no-labels + break outRootLoop; + } + case AMP: + this.state = S_ENTITY; + this.entityReturnState = S_TEXT; + if (handler !== undefined) { + this.text += chunk.slice(start, this.prevI); + } + nonSpace = true; + // eslint-disable-next-line no-labels + break outRootLoop; + case NL_LIKE: + if (handler !== undefined) { + this.text += `${chunk.slice(start, this.prevI)}\n`; + } + start = this.i; + break; + case EOC: + if (handler !== undefined) { + this.text += chunk.slice(start); + } + // eslint-disable-next-line no-labels + break outRootLoop; + default: + if (!isS(code)) { + nonSpace = true; + } + } + } + + if (!nonSpace) { + return; + } + + // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags + // to avoid reporting errors for every single character that is out of + // place. + if (!this.sawRoot && !this.reportedTextBeforeRoot) { + this.fail('text data outside of root node.'); + this.reportedTextBeforeRoot = true; + } + + if (this.closedRoot && !this.reportedTextAfterRoot) { + this.fail('text data outside of root node.'); + this.reportedTextAfterRoot = true; + } + } + + private pushAttribNS(name: string, value: string): void { + const {prefix, local} = this.qname(name); + const attr = {name, prefix, local, value}; + this.attribList.push(attr); + this.attributeHandler?.(attr as AttributeEventForOptions); + if (prefix === 'xmlns') { + const trimmed = value.trim(); + if (this.currentXMLVersion === '1.0' && trimmed === '') { + this.fail('invalid attempt to undefine prefix in XML 1.0'); + } + this.topNS![local] = trimmed; + nsPairCheck(this, local, trimmed); + } else if (name === 'xmlns') { + const trimmed = value.trim(); + this.topNS![''] = trimmed; + nsPairCheck(this, '', trimmed); + } + } + + private pushAttribPlain(name: string, value: string): void { + const attr = {name, value}; + this.attribList.push(attr); + this.attributeHandler?.(attr as AttributeEventForOptions); + } + + /** + * End parsing. This performs final well-formedness checks and resets the + * parser to a clean state. + * + * @returns this + */ + private end(): this { + if (!this.sawRoot) { + this.fail('document must contain a root element.'); + } + const {tags} = this; + while (tags.length > 0) { + const tag = tags.pop()!; + this.fail(`unclosed tag: ${tag.name}`); + } + if (this.state !== S_BEGIN && this.state !== S_TEXT) { + this.fail('unexpected end.'); + } + const {text} = this; + if (text.length !== 0) { + this.textHandler?.(text); + this.text = ''; + } + this._closed = true; + this.endHandler?.(); + this._init(); + return this; + } + + /** + * Resolve a namespace prefix. + * + * @param prefix The prefix to resolve. + * + * @returns The namespace URI or ``undefined`` if the prefix is not defined. + */ + resolve(prefix: string): string | undefined { + let uri = this.topNS![prefix]; + if (uri !== undefined) { + return uri; + } + + const {tags} = this; + for (let index = tags.length - 1; index >= 0; index--) { + uri = tags[index]!.ns![prefix]; + if (uri !== undefined) { + return uri; + } + } + + uri = this.ns[prefix]; + if (uri !== undefined) { + return uri; + } + + return this.opt.resolvePrefix?.(prefix); + } + + /** + * Parse a qname into its prefix and local name parts. + * + * @param name The name to parse + * + * @returns + */ + private qname(name: string): {prefix: string; local: string} { + // This is faster than using name.split(":"). + const colon = name.indexOf(':'); + if (colon === -1) { + return {prefix: '', local: name}; + } + + const local = name.slice(colon + 1); + const prefix = name.slice(0, colon); + if (prefix === '' || local === '' || local.includes(':')) { + this.fail(`malformed name: ${name}.`); + } + + return {prefix, local}; + } + + private processAttribsNS(): void { + const {attribList} = this; + const tag = this.tag!; + + { + // add namespace info to tag + const {prefix, local} = this.qname(tag.name); + tag.prefix = prefix; + tag.local = local; + const uri = (tag.uri = this.resolve(prefix) ?? ''); + + if (prefix !== '') { + if (prefix === 'xmlns') { + this.fail('tags may not have "xmlns" as prefix.'); + } + + if (uri === '') { + this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`); + tag.uri = prefix; + } + } + } + + if (attribList.length === 0) { + return; + } + + const {attributes} = tag; + const seen = new Set(); + // Note: do not apply default ns to attributes: + // http://www.w3.org/TR/REC-xml-names/#defaulting + for (const attr of attribList as SaxesAttributeNSIncomplete[]) { + const {name, prefix, local} = attr; + let uri; + let eqname; + if (prefix === '') { + uri = name === 'xmlns' ? XMLNS_NAMESPACE : ''; + eqname = name; + } else { + uri = this.resolve(prefix); + // if there's any attributes with an undefined namespace, + // then fail on them now. + if (uri === undefined) { + this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`); + uri = prefix; + } + eqname = `{${uri}}${local}`; + } + + if (seen.has(eqname)) { + this.fail(`duplicate attribute: ${eqname}.`); + } + seen.add(eqname); + + attr.uri = uri; + attributes[name] = attr; + } + + this.attribList = []; + } + + private processAttribsPlain(): void { + const {attribList} = this; + // eslint-disable-next-line prefer-destructuring + const attributes = this.tag!.attributes; + for (const {name, value} of attribList) { + if (attributes[name] !== undefined) { + this.fail(`duplicate attribute: ${name}.`); + } + attributes[name] = value; + } + + this.attribList = []; + } + + /** + * Handle a complete open tag. This parser code calls this once it has seen + * the whole tag. This method checks for well-formeness and then emits + * ``onopentag``. + */ + private openTag(): void { + this.processAttribs(); + + const {tags} = this; + const tag = this.tag as SaxesTag; + tag.isSelfClosing = false; + + // There cannot be any pending text here due to the onopentagstart that was + // necessarily emitted before we get here. So we do not check text. + this.openTagHandler?.(tag as TagForOptions); + tags.push(tag); + this.state = S_TEXT; + this.name = ''; + } + + /** + * Handle a complete self-closing tag. This parser code calls this once it has + * seen the whole tag. This method checks for well-formeness and then emits + * ``onopentag`` and ``onclosetag``. + */ + private openSelfClosingTag(): void { + this.processAttribs(); + + const {tags} = this; + const tag = this.tag as SaxesTag; + tag.isSelfClosing = true; + + // There cannot be any pending text here due to the onopentagstart that was + // necessarily emitted before we get here. So we do not check text. + this.openTagHandler?.(tag as TagForOptions); + this.closeTagHandler?.(tag as TagForOptions); + const top = (this.tag = tags[tags.length - 1] ?? null); + if (top === null) { + this.closedRoot = true; + } + this.state = S_TEXT; + this.name = ''; + } + + /** + * Handle a complete close tag. This parser code calls this once it has seen + * the whole tag. This method checks for well-formeness and then emits + * ``onclosetag``. + */ + private closeTag(): void { + const {tags, name} = this; + + // Our state after this will be S_TEXT, no matter what, and we can clear + // tagName now. + this.state = S_TEXT; + this.name = ''; + + if (name === '') { + this.fail('weird empty close tag.'); + this.text += ''; + return; + } + + const handler = this.closeTagHandler; + let l = tags.length; + while (l-- > 0) { + const tag = (this.tag = tags.pop() as SaxesTag); + this.topNS = tag.ns!; + handler?.(tag as TagForOptions); + if (tag.name === name) { + break; + } + this.fail('unexpected close tag.'); + } + + if (l === 0) { + this.closedRoot = true; + } else if (l < 0) { + this.fail(`unmatched closing tag: ${name}.`); + this.text += ``; + } + } + + /** + * Resolves an entity. Makes any necessary well-formedness checks. + * + * @param entity The entity to resolve. + * + * @returns The parsed entity. + */ + private parseEntity(entity: string): string { + // startsWith would be significantly slower for this test. + if (entity[0] !== '#') { + const defined = this.ENTITIES[entity]; + if (defined !== undefined) { + return defined; + } + + this.fail( + this.isName(entity) + ? 'undefined entity.' + : 'disallowed character in entity name.' + ); + return `&${entity};`; + } + + let num = NaN; + if (entity[1] === 'x' && /^#x[0-9a-f]+$/i.test(entity)) { + num = parseInt(entity.slice(2), 16); + } else if (/^#[0-9]+$/.test(entity)) { + num = parseInt(entity.slice(1), 10); + } + + // The character reference is required to match the CHAR production. + if (!this.isChar(num)) { + this.fail('malformed character entity.'); + return `&${entity};`; + } + + return String.fromCodePoint(num); + } +} diff --git a/packages/office-viewer/src/util/stringToArray.ts b/packages/office-viewer/src/util/stringToArray.ts new file mode 100644 index 000000000..4b51d8c97 --- /dev/null +++ b/packages/office-viewer/src/util/stringToArray.ts @@ -0,0 +1,97 @@ +/** + * 从 lodash 里拷贝的代码,我也不知道为啥那么复杂,可能是为了解决特殊 unicode 字符 + */ + +/** Used to compose unicode character classes. */ +const rsAstralRange = '\\ud800-\\udfff'; +const rsComboMarksRange = '\\u0300-\\u036f'; +const reComboHalfMarksRange = '\\ufe20-\\ufe2f'; +const rsComboSymbolsRange = '\\u20d0-\\u20ff'; +const rsComboMarksExtendedRange = '\\u1ab0-\\u1aff'; +const rsComboMarksSupplementRange = '\\u1dc0-\\u1dff'; +const rsComboRange = + rsComboMarksRange + + reComboHalfMarksRange + + rsComboSymbolsRange + + rsComboMarksExtendedRange + + rsComboMarksSupplementRange; +const rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +const rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +const reHasUnicode = RegExp( + `[${rsZWJ + rsAstralRange + rsComboRange + rsVarRange}]` +); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string: string) { + return reHasUnicode.test(string); +} + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string: string) { + return string.split(''); +} + +/** Used to compose unicode capture groups. */ +const rsAstral = `[${rsAstralRange}]`; +const rsCombo = `[${rsComboRange}]`; +const rsFitz = '\\ud83c[\\udffb-\\udfff]'; +const rsModifier = `(?:${rsCombo}|${rsFitz})`; +const rsNonAstral = `[^${rsAstralRange}]`; +const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; + +/** Used to compose unicode regexes. */ +const reOptMod = `${rsModifier}?`; +const rsOptVar = `[${rsVarRange}]?`; +const rsOptJoin = `(?:${rsZWJ}(?:${[rsNonAstral, rsRegional, rsSurrPair].join( + '|' +)})${rsOptVar + reOptMod})*`; +const rsSeq = rsOptVar + reOptMod + rsOptJoin; +const rsNonAstralCombo = `${rsNonAstral}${rsCombo}?`; +const rsSymbol = `(?:${[ + rsNonAstralCombo, + rsCombo, + rsRegional, + rsSurrPair, + rsAstral +].join('|')})`; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +const reUnicode = RegExp(`${rsFitz}(?=${rsFitz})|${rsSymbol + rsSeq}`, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string: string) { + return string.match(reUnicode) || []; +} + +/** + * Converts `string` to an array. + * + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +export function stringToArray(string: string) { + return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); +} diff --git a/packages/office-viewer/src/util/stripNumber.ts b/packages/office-viewer/src/util/stripNumber.ts new file mode 100644 index 000000000..d88f45c95 --- /dev/null +++ b/packages/office-viewer/src/util/stripNumber.ts @@ -0,0 +1,11 @@ +/** + * 清楚数字的小数点后多余的0 + */ + +export function stripNumber(number: number, precision = 16) { + if (typeof number === 'number' && !Number.isInteger(number)) { + return parseFloat(number.toPrecision(precision)); + } else { + return number; + } +} diff --git a/packages/office-viewer/src/util/throttle.ts b/packages/office-viewer/src/util/throttle.ts new file mode 100644 index 000000000..c724b715f --- /dev/null +++ b/packages/office-viewer/src/util/throttle.ts @@ -0,0 +1,30 @@ +/** + * https://github.com/bameyrick/throttle-typescript + */ + +export type ThrottledFunction any> = ( + ...args: Parameters +) => ReturnType; + +export function throttle any>( + func: T, + limit: number +): ThrottledFunction { + let inThrottle: boolean; + let lastResult: ReturnType; + + return function (this: any): ReturnType { + const args = arguments; + const context = this; + + if (!inThrottle) { + inThrottle = true; + + setTimeout(() => (inThrottle = false), limit); + + lastResult = func.apply(context, args); + } + + return lastResult; + }; +} diff --git a/packages/office-viewer/src/util/xml.ts b/packages/office-viewer/src/util/xml.ts index 35d8da4ae..21432de50 100644 --- a/packages/office-viewer/src/util/xml.ts +++ b/packages/office-viewer/src/util/xml.ts @@ -1,3 +1,5 @@ +import {SaxesParser, SaxesTagPlain} from './saxes'; + /** * 解析 xml */ @@ -12,3 +14,124 @@ export function buildXML(doc: Node): string { const serializer = new XMLSerializer(); return serializer.serializeToString(doc); } + +/** + * xml 节点定义,这里字段名用缩写是为了减少 json 体积 + */ +export interface XMLNode { + /** + * tag 标签名 + */ + tag: string; + /** + * attributes 属性 + */ + attrs: Record; + /** + * children 子节点 + */ + children: XMLNode[]; + /** + * text 文本内容 + */ + text?: string; + /** + * isSelfClosing 是否是闭合 + */ + s?: boolean; +} + +/** + * 将 xml 转换为 json 数据,主要用于 Word,不用 DOMParser 的好处是可以在浏览器和 node 环境下使用 + */ + +export async function xml2json(xml: string): Promise { + const parser = new SaxesParser(); + const stack: XMLNode[] = []; + + return new Promise((resolve, reject) => { + parser.on('error', function (e: any) { + console.error(e); + }); + parser.on('text', function (t: string) { + const peak = stack[stack.length - 1]; + if (peak) { + peak.text = t; + } + }); + parser.on('opentag', function (node: SaxesTagPlain) { + stack.push({ + tag: node.name, + attrs: node.attributes, + children: [] + }); + }); + parser.on('closetag', function () { + if (stack.length > 1) { + const currentNode = stack[stack.length - 1]; + const parentNode = stack[stack.length - 2]; + parentNode.children.push(currentNode); + } + + if (stack.length !== 1) { + stack.pop(); + } + }); + + parser.on('end', function () { + if (stack.length !== 1) { + reject('xml2json error'); + } + resolve(stack[0]); + }); + + parser.write(xml).close(); + }); +} + +/** + * 根据标签名获取节点 + * @param node 节点 + * @param tagName 标签名 + * @param deep 是否深度查找 + * @returns + */ +export function getNodeByTagName( + node: XMLNode, + tagName: string, + deep = false +): XMLNode | null { + const children = node.children || []; + for (const child of children) { + if (child.tag === tagName) { + return child; + } + if (deep) { + const result = getNodeByTagName(child, tagName, deep); + if (result) { + return result; + } + } + } + return null; +} + +/** + * 根据标签名获取节点列表 + * @param node 节点 + * @param tagName 标签名 + * @returns + */ +export function getNodesByTagName(node: XMLNode, tagName: string): XMLNode[] { + const result: XMLNode[] = []; + for (const child of node.children) { + if (child.tag === tagName) { + result.push(child); + } + if (child.children) { + result.push(...getNodesByTagName(child, tagName)); + } + } + + return result; +} diff --git a/packages/office-viewer/src/util/xmlchars/xml/1.0/ed4.ts b/packages/office-viewer/src/util/xmlchars/xml/1.0/ed4.ts new file mode 100755 index 000000000..982a85525 --- /dev/null +++ b/packages/office-viewer/src/util/xmlchars/xml/1.0/ed4.ts @@ -0,0 +1,67 @@ +/** + * Character classes and associated utilities for the 4th edition of XML 1.0. + * + * These are deprecated in the 5th edition but some of the standards related to + * XML 1.0 (e.g. XML Schema 1.0) refer to these. So they are still generally + * useful. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +// +// Fragments. +// + +export const CHAR = '\t\n\r\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}'; + +export const S = ' \t\r\n'; + +// tslint:disable-next-line:missing-jsdoc max-line-length +export const BASE_CHAR = + 'A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3'; + +export const IDEOGRAPHIC = '\u4E00-\u9FA5\u3007\u3021-\u3029'; + +// tslint:disable-next-line:missing-jsdoc max-line-length +export const COMBINING_CHAR = + '\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A'; + +// tslint:disable-next-line:missing-jsdoc max-line-length +export const DIGIT = + '0-9\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29'; + +// tslint:disable-next-line:missing-jsdoc max-line-length +export const EXTENDER = + '\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE'; + +export const LETTER = BASE_CHAR + IDEOGRAPHIC; + +export const NAME_CHAR = `-${LETTER}${DIGIT}._:${COMBINING_CHAR}${EXTENDER}`; + +// +// Regular expressions. +// + +export const CHAR_RE = new RegExp(`^[${CHAR}]$`, 'u'); + +export const S_RE = new RegExp(`^[${S}]+$`, 'u'); + +export const BASE_CHAR_RE = new RegExp(`^[${BASE_CHAR}]$`, 'u'); + +export const IDEOGRAPHIC_RE = new RegExp(`^[${IDEOGRAPHIC}]$`, 'u'); + +export const COMBINING_CHAR_RE = new RegExp(`^[${COMBINING_CHAR}]$`, 'u'); + +export const DIGIT_RE = new RegExp(`^[${DIGIT}]$`, 'u'); + +export const EXTENDER_RE = new RegExp(`^[${EXTENDER}]$`, 'u'); + +export const LETTER_RE = new RegExp(`^[${LETTER}]$`, 'u'); + +export const NAME_CHAR_RE = new RegExp(`^[${NAME_CHAR}]$`, 'u'); + +export const NAME_RE = new RegExp(`^[${LETTER}_:][${NAME_CHAR}]*$`, 'u'); + +export const NMTOKEN_RE = new RegExp(`^[${NAME_CHAR}]+$`, 'u'); diff --git a/packages/office-viewer/src/util/xmlchars/xml/1.0/ed5.ts b/packages/office-viewer/src/util/xmlchars/xml/1.0/ed5.ts new file mode 100755 index 000000000..46c52696f --- /dev/null +++ b/packages/office-viewer/src/util/xmlchars/xml/1.0/ed5.ts @@ -0,0 +1,125 @@ +/** + * Character classes and associated utilities for the 5th edition of XML 1.0. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +// +// Fragments. +// +export const CHAR = '\t\n\r\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}'; + +export const S = ' \t\r\n'; + +// tslint:disable-next-line:max-line-length +export const NAME_START_CHAR = + ':A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}'; + +export const NAME_CHAR = `-${NAME_START_CHAR}.0-9\u00B7\u0300-\u036F\u203F-\u2040`; + +// +// Regular expressions. +// + +export const CHAR_RE = new RegExp(`^[${CHAR}]$`, 'u'); + +export const S_RE = new RegExp(`^[${S}]+$`, 'u'); + +export const NAME_START_CHAR_RE = new RegExp(`^[${NAME_START_CHAR}]$`, 'u'); + +export const NAME_CHAR_RE = new RegExp(`^[${NAME_CHAR}]$`, 'u'); + +export const NAME_RE = new RegExp(`^[${NAME_START_CHAR}][${NAME_CHAR}]*$`, 'u'); + +export const NMTOKEN_RE = new RegExp(`^[${NAME_CHAR}]+$`, 'u'); + +const TAB = 9; +const NL = 0xa; +const CR = 0xd; +const SPACE = 0x20; + +// +// Lists. +// + +/** All characters in the ``S`` production. */ +export const S_LIST = [SPACE, NL, CR, TAB]; + +/** + * Determines whether a codepoint matches the ``CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``CHAR``. + */ +export function isChar(c: number): boolean { + return ( + (c >= SPACE && c <= 0xd7ff) || + c === NL || + c === CR || + c === TAB || + (c >= 0xe000 && c <= 0xfffd) || + (c >= 0x10000 && c <= 0x10ffff) + ); +} + +/** + * Determines whether a codepoint matches the ``S`` (space) production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``S``. + */ +export function isS(c: number): boolean { + return c === SPACE || c === NL || c === CR || c === TAB; +} + +/** + * Determines whether a codepoint matches the ``NAME_START_CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``. + */ +export function isNameStartChar(c: number): boolean { + return ( + (c >= 0x41 && c <= 0x5a) || + (c >= 0x61 && c <= 0x7a) || + c === 0x3a || + c === 0x5f || + c === 0x200c || + c === 0x200d || + (c >= 0xc0 && c <= 0xd6) || + (c >= 0xd8 && c <= 0xf6) || + (c >= 0x00f8 && c <= 0x02ff) || + (c >= 0x0370 && c <= 0x037d) || + (c >= 0x037f && c <= 0x1fff) || + (c >= 0x2070 && c <= 0x218f) || + (c >= 0x2c00 && c <= 0x2fef) || + (c >= 0x3001 && c <= 0xd7ff) || + (c >= 0xf900 && c <= 0xfdcf) || + (c >= 0xfdf0 && c <= 0xfffd) || + (c >= 0x10000 && c <= 0xeffff) + ); +} + +/** + * Determines whether a codepoint matches the ``NAME_CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``NAME_CHAR``. + */ +export function isNameChar(c: number): boolean { + return ( + isNameStartChar(c) || + (c >= 0x30 && c <= 0x39) || + c === 0x2d || + c === 0x2e || + c === 0xb7 || + (c >= 0x0300 && c <= 0x036f) || + (c >= 0x203f && c <= 0x2040) + ); +} diff --git a/packages/office-viewer/src/util/xmlchars/xml/1.1/ed2.ts b/packages/office-viewer/src/util/xmlchars/xml/1.1/ed2.ts new file mode 100755 index 000000000..7697c946f --- /dev/null +++ b/packages/office-viewer/src/util/xmlchars/xml/1.1/ed2.ts @@ -0,0 +1,170 @@ +/** + * Character classes and associated utilities for the 2nd edition of XML 1.1. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +// +// Fragments. +// +export const CHAR = '\u0001-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}'; + +export const RESTRICTED_CHAR = + '\u0001-\u0008\u000B\u000C\u000E-\u001F\u007F-\u0084\u0086-\u009F'; + +export const S = ' \t\r\n'; + +// tslint:disable-next-line:max-line-length +export const NAME_START_CHAR = + ':A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}'; + +export const NAME_CHAR = `-${NAME_START_CHAR}.0-9\u00B7\u0300-\u036F\u203F-\u2040`; + +// +// Regular expressions. +// + +export const CHAR_RE = new RegExp(`^[${CHAR}]$`, 'u'); + +export const RESTRICTED_CHAR_RE = new RegExp(`^[${RESTRICTED_CHAR}]$`, 'u'); + +export const S_RE = new RegExp(`^[${S}]+$`, 'u'); + +export const NAME_START_CHAR_RE = new RegExp(`^[${NAME_START_CHAR}]$`, 'u'); + +export const NAME_CHAR_RE = new RegExp(`^[${NAME_CHAR}]$`, 'u'); + +export const NAME_RE = new RegExp(`^[${NAME_START_CHAR}][${NAME_CHAR}]*$`, 'u'); + +export const NMTOKEN_RE = new RegExp(`^[${NAME_CHAR}]+$`, 'u'); + +const TAB = 9; +const NL = 0xa; +const CR = 0xd; +const SPACE = 0x20; + +// +// Lists. +// + +/** All characters in the ``S`` production. */ +export const S_LIST = [SPACE, NL, CR, TAB]; + +/** + * Determines whether a codepoint matches the ``CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``CHAR``. + */ +export function isChar(c: number): boolean { + return ( + (c >= 0x0001 && c <= 0xd7ff) || + (c >= 0xe000 && c <= 0xfffd) || + (c >= 0x10000 && c <= 0x10ffff) + ); +} + +/** + * Determines whether a codepoint matches the ``RESTRICTED_CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``RESTRICTED_CHAR``. + */ +export function isRestrictedChar(c: number): boolean { + return ( + (c >= 0x1 && c <= 0x8) || + c === 0xb || + c === 0xc || + (c >= 0xe && c <= 0x1f) || + (c >= 0x7f && c <= 0x84) || + (c >= 0x86 && c <= 0x9f) + ); +} + +/** + * Determines whether a codepoint matches the ``CHAR`` production and does not + * match the ``RESTRICTED_CHAR`` production. ``isCharAndNotRestricted(x)`` is + * equivalent to ``isChar(x) && !isRestrictedChar(x)``. This function is faster + * than running the two-call equivalent. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``CHAR`` and does not match + * ``RESTRICTED_CHAR``. + */ +export function isCharAndNotRestricted(c: number): boolean { + return ( + c === 0x9 || + c === 0xa || + c === 0xd || + (c > 0x1f && c < 0x7f) || + c === 0x85 || + (c > 0x9f && c <= 0xd7ff) || + (c >= 0xe000 && c <= 0xfffd) || + (c >= 0x10000 && c <= 0x10ffff) + ); +} + +/** + * Determines whether a codepoint matches the ``S`` (space) production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``S``. + */ +export function isS(c: number): boolean { + return c === SPACE || c === NL || c === CR || c === TAB; +} + +/** + * Determines whether a codepoint matches the ``NAME_START_CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``. + */ +// tslint:disable-next-line:cyclomatic-complexity +export function isNameStartChar(c: number): boolean { + return ( + (c >= 0x41 && c <= 0x5a) || + (c >= 0x61 && c <= 0x7a) || + c === 0x3a || + c === 0x5f || + c === 0x200c || + c === 0x200d || + (c >= 0xc0 && c <= 0xd6) || + (c >= 0xd8 && c <= 0xf6) || + (c >= 0x00f8 && c <= 0x02ff) || + (c >= 0x0370 && c <= 0x037d) || + (c >= 0x037f && c <= 0x1fff) || + (c >= 0x2070 && c <= 0x218f) || + (c >= 0x2c00 && c <= 0x2fef) || + (c >= 0x3001 && c <= 0xd7ff) || + (c >= 0xf900 && c <= 0xfdcf) || + (c >= 0xfdf0 && c <= 0xfffd) || + (c >= 0x10000 && c <= 0xeffff) + ); +} + +/** + * Determines whether a codepoint matches the ``NAME_CHAR`` production. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches ``NAME_CHAR``. + */ +export function isNameChar(c: number): boolean { + return ( + isNameStartChar(c) || + (c >= 0x30 && c <= 0x39) || + c === 0x2d || + c === 0x2e || + c === 0xb7 || + (c >= 0x0300 && c <= 0x036f) || + (c >= 0x203f && c <= 0x2040) + ); +} diff --git a/packages/office-viewer/src/util/xmlchars/xmlns/1.0/ed3.ts b/packages/office-viewer/src/util/xmlchars/xmlns/1.0/ed3.ts new file mode 100755 index 000000000..147525d6d --- /dev/null +++ b/packages/office-viewer/src/util/xmlchars/xmlns/1.0/ed3.ts @@ -0,0 +1,80 @@ +/** + * Character class utilities for XML NS 1.0 edition 3. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +// +// Fragments. +// + +// tslint:disable-next-line:max-line-length +export const NC_NAME_START_CHAR = + 'A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}'; + +export const NC_NAME_CHAR = `-${NC_NAME_START_CHAR}.0-9\u00B7\u0300-\u036F\u203F-\u2040`; + +// +// Regular expressions. +// + +export const NC_NAME_START_CHAR_RE = new RegExp( + `^[${NC_NAME_START_CHAR}]$`, + 'u' +); + +export const NC_NAME_CHAR_RE = new RegExp(`^[${NC_NAME_CHAR}]$`, 'u'); + +export const NC_NAME_RE = new RegExp( + `^[${NC_NAME_START_CHAR}][${NC_NAME_CHAR}]*$`, + 'u' +); + +/** + * Determines whether a codepoint matches [[NC_NAME_START_CHAR]]. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches. + */ +// tslint:disable-next-line:cyclomatic-complexity +export function isNCNameStartChar(c: number): boolean { + return ( + (c >= 0x41 && c <= 0x5a) || + c === 0x5f || + (c >= 0x61 && c <= 0x7a) || + (c >= 0xc0 && c <= 0xd6) || + (c >= 0xd8 && c <= 0xf6) || + (c >= 0x00f8 && c <= 0x02ff) || + (c >= 0x0370 && c <= 0x037d) || + (c >= 0x037f && c <= 0x1fff) || + (c >= 0x200c && c <= 0x200d) || + (c >= 0x2070 && c <= 0x218f) || + (c >= 0x2c00 && c <= 0x2fef) || + (c >= 0x3001 && c <= 0xd7ff) || + (c >= 0xf900 && c <= 0xfdcf) || + (c >= 0xfdf0 && c <= 0xfffd) || + (c >= 0x10000 && c <= 0xeffff) + ); +} + +/** + * Determines whether a codepoint matches [[NC_NAME_CHAR]]. + * + * @param c The code point. + * + * @returns ``true`` if the codepoint matches. + */ +export function isNCNameChar(c: number): boolean { + return ( + isNCNameStartChar(c) || + c === 0x2d || + c === 0x2e || + (c >= 0x30 && c <= 0x39) || + c === 0x00b7 || + (c >= 0x0300 && c <= 0x036f) || + (c >= 0x203f && c <= 0x2040) + ); +} diff --git a/packages/office-viewer/src/parse/Footnotes.ts b/packages/office-viewer/src/word/parse/Footnotes.ts similarity index 84% rename from packages/office-viewer/src/parse/Footnotes.ts rename to packages/office-viewer/src/word/parse/Footnotes.ts index dd5766bd4..cb0db5362 100644 --- a/packages/office-viewer/src/parse/Footnotes.ts +++ b/packages/office-viewer/src/word/parse/Footnotes.ts @@ -1,5 +1,5 @@ -import Word from '../Word'; -import {Note} from '../openxml/word/Note'; +import Word from '../../Word'; +import {Note} from '../../openxml/word/Note'; export function parseFootnotes( word: Word, diff --git a/packages/office-viewer/src/parse/jcToTextAlign.ts b/packages/office-viewer/src/word/parse/jcToTextAlign.ts similarity index 100% rename from packages/office-viewer/src/parse/jcToTextAlign.ts rename to packages/office-viewer/src/word/parse/jcToTextAlign.ts diff --git a/packages/office-viewer/src/parse/mergeSdt.ts b/packages/office-viewer/src/word/parse/mergeSdt.ts similarity index 100% rename from packages/office-viewer/src/parse/mergeSdt.ts rename to packages/office-viewer/src/word/parse/mergeSdt.ts diff --git a/packages/office-viewer/src/parse/modifyColor.ts b/packages/office-viewer/src/word/parse/modifyColor.ts similarity index 96% rename from packages/office-viewer/src/parse/modifyColor.ts rename to packages/office-viewer/src/word/parse/modifyColor.ts index 2f19c79e5..2805b7a77 100644 --- a/packages/office-viewer/src/parse/modifyColor.ts +++ b/packages/office-viewer/src/word/parse/modifyColor.ts @@ -1,5 +1,5 @@ -import {getAttrPercent, getVal} from '../OpenXML'; -import {Color} from '../util/color'; +import {getAttrPercent, getVal} from '../../OpenXML'; +import {Color} from '../../util/color'; import {convertAngle} from './parseSize'; // 处理颜色变化 diff --git a/packages/office-viewer/src/parse/parseBorder.ts b/packages/office-viewer/src/word/parse/parseBorder.ts similarity index 92% rename from packages/office-viewer/src/parse/parseBorder.ts rename to packages/office-viewer/src/word/parse/parseBorder.ts index d7253e346..216054432 100644 --- a/packages/office-viewer/src/parse/parseBorder.ts +++ b/packages/office-viewer/src/word/parse/parseBorder.ts @@ -1,12 +1,12 @@ /** * 解析边框转成 css 样式 http://officeopenxml.com/WPborders.php */ -import {CSSStyle} from '../openxml/Style'; -import {getVal} from '../OpenXML'; +import {CSSStyle} from '../../openxml/Style'; +import {getVal} from '../../OpenXML'; import {parseColorAttr} from './parseColor'; import {LengthUsage, parseSize} from './parseSize'; -import Word from '../Word'; -import {ST_Border} from '../openxml/Types'; +import Word from '../../Word'; +import {ST_Border} from '../../openxml/Types'; // 默认边框颜色 const DEFAULT_BORDER_COLOR = 'black'; diff --git a/packages/office-viewer/src/parse/parseCellMargin.ts b/packages/office-viewer/src/word/parse/parseCellMargin.ts similarity index 93% rename from packages/office-viewer/src/parse/parseCellMargin.ts rename to packages/office-viewer/src/word/parse/parseCellMargin.ts index 5aa6de632..745a4e8ac 100644 --- a/packages/office-viewer/src/parse/parseCellMargin.ts +++ b/packages/office-viewer/src/word/parse/parseCellMargin.ts @@ -1,4 +1,4 @@ -import {CSSStyle} from '../openxml/Style'; +import {CSSStyle} from '../../openxml/Style'; import {parseSize} from './parseSize'; // http://officeopenxml.com/WPtableCellProperties-Margins.php diff --git a/packages/office-viewer/src/parse/parseChildColor.ts b/packages/office-viewer/src/word/parse/parseChildColor.ts similarity index 85% rename from packages/office-viewer/src/parse/parseChildColor.ts rename to packages/office-viewer/src/word/parse/parseChildColor.ts index 8e8294aa9..165855316 100644 --- a/packages/office-viewer/src/parse/parseChildColor.ts +++ b/packages/office-viewer/src/word/parse/parseChildColor.ts @@ -1,13 +1,16 @@ -import {getAttrPercent, getVal} from '../OpenXML'; -import {Color} from '../util/color'; -import Word from '../Word'; -import {PresetColorMap} from './colorNameMap'; +import {getAttrPercent, getVal} from '../../OpenXML'; +import {Color} from '../../util/color'; +import Word from '../../Word'; +import {PresetColorMap} from '../../openxml/colorNameMap'; import {modifyColor} from './modifyColor'; /** * 解析子节点颜色,这里其实还有 lumMod 和 lumOff */ -export function parseChildColor(word: Word, element: Element): string { +export function parseChildColor( + getThemeColor: (c: string) => string, + element: Element +): string { const colorChild = element.firstElementChild; if (colorChild) { const colorType = colorChild.tagName; @@ -53,7 +56,7 @@ export function parseChildColor(word: Word, element: Element): string { case 'w14:schemeClr': const schemeClr = getVal(colorChild); if (schemeClr) { - return modifyColor(colorChild, word.getThemeColor(schemeClr)); + return modifyColor(colorChild, getThemeColor(schemeClr)); } else { console.warn('parseOutline: Unknown schemeClr ', colorChild); } diff --git a/packages/office-viewer/src/parse/parseColor.ts b/packages/office-viewer/src/word/parse/parseColor.ts similarity index 93% rename from packages/office-viewer/src/parse/parseColor.ts rename to packages/office-viewer/src/word/parse/parseColor.ts index d80f155e6..7ba45bb51 100644 --- a/packages/office-viewer/src/parse/parseColor.ts +++ b/packages/office-viewer/src/word/parse/parseColor.ts @@ -2,11 +2,11 @@ * 解析颜色,转成 css 的颜色 */ -import {Color} from '../util/color'; -import {getAttrPercent, getVal} from '../OpenXML'; -import {ST_Shd} from '../openxml/Types'; -import Word from '../Word'; -import {PresetColorMap} from './colorNameMap'; +import {Color} from '../../util/color'; +import {getAttrPercent, getVal} from '../../OpenXML'; +import {ST_Shd} from '../../openxml/Types'; +import Word from '../../Word'; +import {PresetColorMap} from '../../openxml/colorNameMap'; /** * css 里可以识别的颜色 diff --git a/packages/office-viewer/src/parse/parseEndnotes.ts b/packages/office-viewer/src/word/parse/parseEndnotes.ts similarity index 83% rename from packages/office-viewer/src/parse/parseEndnotes.ts rename to packages/office-viewer/src/word/parse/parseEndnotes.ts index e7f61e677..7c7d204e7 100644 --- a/packages/office-viewer/src/parse/parseEndnotes.ts +++ b/packages/office-viewer/src/word/parse/parseEndnotes.ts @@ -1,5 +1,5 @@ -import Word from '../Word'; -import {Note} from '../openxml/word/Note'; +import Word from '../../Word'; +import {Note} from '../../openxml/word/Note'; export function parseEndnotes(word: Word, doc: Document): Record { const endnotes: Record = {}; diff --git a/packages/office-viewer/src/parse/parseFont.ts b/packages/office-viewer/src/word/parse/parseFont.ts similarity index 93% rename from packages/office-viewer/src/parse/parseFont.ts rename to packages/office-viewer/src/word/parse/parseFont.ts index 9d9c87627..c6b517116 100644 --- a/packages/office-viewer/src/parse/parseFont.ts +++ b/packages/office-viewer/src/word/parse/parseFont.ts @@ -3,8 +3,8 @@ * http://webapp.docx4java.org/OnlineDemo/ecma376/WordML/rFonts.html */ -import {CSSStyle} from '../openxml/Style'; -import Word from '../Word'; +import {CSSStyle} from '../../openxml/Style'; +import Word from '../../Word'; function themeFont(font: string) { return `var(--docx-theme-font-${font})`; diff --git a/packages/office-viewer/src/parse/parseInd.ts b/packages/office-viewer/src/word/parse/parseInd.ts similarity index 94% rename from packages/office-viewer/src/parse/parseInd.ts rename to packages/office-viewer/src/word/parse/parseInd.ts index b7438cf39..c8869d002 100644 --- a/packages/office-viewer/src/parse/parseInd.ts +++ b/packages/office-viewer/src/word/parse/parseInd.ts @@ -2,7 +2,7 @@ * 解析缩进 http://officeopenxml.com/WPindentation.php */ -import {CSSStyle} from '../openxml/Style'; +import {CSSStyle} from '../../openxml/Style'; import {parseSize} from './parseSize'; diff --git a/packages/office-viewer/src/parse/parseInsideBorders.ts b/packages/office-viewer/src/word/parse/parseInsideBorders.ts similarity index 94% rename from packages/office-viewer/src/parse/parseInsideBorders.ts rename to packages/office-viewer/src/word/parse/parseInsideBorders.ts index fbc0f6a73..2f1db738e 100644 --- a/packages/office-viewer/src/parse/parseInsideBorders.ts +++ b/packages/office-viewer/src/word/parse/parseInsideBorders.ts @@ -1,4 +1,4 @@ -import Word from '../Word'; +import Word from '../../Word'; import {parseBorder} from './parseBorder'; /** diff --git a/packages/office-viewer/src/parse/parsePr.ts b/packages/office-viewer/src/word/parse/parsePr.ts similarity index 96% rename from packages/office-viewer/src/parse/parsePr.ts rename to packages/office-viewer/src/word/parse/parsePr.ts index 161c938a8..356737406 100644 --- a/packages/office-viewer/src/parse/parsePr.ts +++ b/packages/office-viewer/src/word/parse/parsePr.ts @@ -3,9 +3,9 @@ */ import {convertAngle, LengthUsage} from './parseSize'; -import {CSSStyle} from '../openxml/Style'; -import Word from '../Word'; -import {getVal, getValBoolean, getValNumber} from '../OpenXML'; +import {CSSStyle} from '../../openxml/Style'; +import Word from '../../Word'; +import {getVal, getValBoolean, getValNumber} from '../../OpenXML'; import {parseBorder, parseBorders} from './parseBorder'; import {parseColor, parseColorAttr, parseShdColor} from './parseColor'; import {parseChildColor} from './parseChildColor'; @@ -13,11 +13,11 @@ import {parseInd} from './parseInd'; import {parseSize} from './parseSize'; import {parseSpacing} from './parseSpacing'; import {parseFont} from './parseFont'; -import {ST_Em, ST_HighlightColor, ST_TextAlignment} from '../openxml/Types'; +import {ST_Em, ST_HighlightColor, ST_TextAlignment} from '../../openxml/Types'; import {parseTrHeight} from './parseTrHeight'; import {jcToTextAlign} from './jcToTextAlign'; import {parseTextDirection} from './parseTextDirection'; -import {Color} from '../util/color'; +import {Color} from '../../util/color'; /** * 解析 underline 并附上样式 @@ -454,7 +454,7 @@ export function parsePr(word: Word, element: Element, type: 'r' | 'p' = 'p') { parseSize(child, 'w14:blurRad', LengthUsage.Emu) || '4px'; // 其它结果算出来不像就先忽略了 let color = 'rgba(0, 0, 0, 0.6)'; - const childColor = parseChildColor(word, child); + const childColor = parseChildColor(c => word.getThemeColor(c), child); if (childColor) { color = childColor; } @@ -470,7 +470,9 @@ export function parsePr(word: Word, element: Element, type: 'r' | 'p' = 'p') { let outlineColor = 'white'; const fillColor = child.getElementsByTagName('w14:solidFill'); if (fillColor.length > 0) { - outlineColor = parseChildColor(word, fillColor.item(0)!) || 'white'; + outlineColor = + parseChildColor(c => word.getThemeColor(c), fillColor.item(0)!) || + 'white'; } style['-webkit-text-stroke-color'] = outlineColor; diff --git a/packages/office-viewer/src/parse/parseRelationship.ts b/packages/office-viewer/src/word/parse/parseRelationship.ts similarity index 100% rename from packages/office-viewer/src/parse/parseRelationship.ts rename to packages/office-viewer/src/word/parse/parseRelationship.ts diff --git a/packages/office-viewer/src/parse/parseSdt.ts b/packages/office-viewer/src/word/parse/parseSdt.ts similarity index 100% rename from packages/office-viewer/src/parse/parseSdt.ts rename to packages/office-viewer/src/word/parse/parseSdt.ts diff --git a/packages/office-viewer/src/parse/parseShape.ts b/packages/office-viewer/src/word/parse/parseShape.ts similarity index 95% rename from packages/office-viewer/src/parse/parseShape.ts rename to packages/office-viewer/src/word/parse/parseShape.ts index 6b7b5bd65..80c614f12 100644 --- a/packages/office-viewer/src/parse/parseShape.ts +++ b/packages/office-viewer/src/word/parse/parseShape.ts @@ -2,8 +2,8 @@ * 解析 shape */ -import {getAttrBoolean} from '../OpenXML'; -import {ST_PathFillMode} from '../openxml/Types'; +import {getAttrBoolean} from '../../OpenXML'; +import {ST_PathFillMode} from '../../openxml/Types'; import { LnTo, QuadBezTo, @@ -13,8 +13,8 @@ import { Path, IPath, PathPoint -} from '../openxml/drawing/Path'; -import {Rect, Shape, ShapeGuide} from '../openxml/drawing/Shape'; +} from '../../openxml/drawing/Path'; +import {Rect, Shape, ShapeGuide} from '../../openxml/drawing/Shape'; export function parsePts(element: Element) { const pts: PathPoint[] = []; diff --git a/packages/office-viewer/src/parse/parseSize.ts b/packages/office-viewer/src/word/parse/parseSize.ts similarity index 100% rename from packages/office-viewer/src/parse/parseSize.ts rename to packages/office-viewer/src/word/parse/parseSize.ts diff --git a/packages/office-viewer/src/parse/parseSpacing.ts b/packages/office-viewer/src/word/parse/parseSpacing.ts similarity index 94% rename from packages/office-viewer/src/parse/parseSpacing.ts rename to packages/office-viewer/src/word/parse/parseSpacing.ts index 2121f68d8..e77908eba 100644 --- a/packages/office-viewer/src/parse/parseSpacing.ts +++ b/packages/office-viewer/src/word/parse/parseSpacing.ts @@ -1,5 +1,5 @@ -import {CSSStyle} from '../openxml/Style'; -import Word from '../Word'; +import {CSSStyle} from '../../openxml/Style'; +import Word from '../../Word'; import {parseSize} from './parseSize'; /** diff --git a/packages/office-viewer/src/parse/parseTable.ts b/packages/office-viewer/src/word/parse/parseTable.ts similarity index 89% rename from packages/office-viewer/src/parse/parseTable.ts rename to packages/office-viewer/src/word/parse/parseTable.ts index 287ef038d..eacc2ce54 100644 --- a/packages/office-viewer/src/parse/parseTable.ts +++ b/packages/office-viewer/src/word/parse/parseTable.ts @@ -1,8 +1,8 @@ -import {Tc} from '../openxml/word/table/Tc'; -import {GridCol, Table} from '../openxml/word/Table'; +import {Tc} from '../../openxml/word/table/Tc'; +import {GridCol, Table} from '../../openxml/word/Table'; import {parseTr} from './parseTr'; import {parseTablePr} from './parseTablePr'; -import Word from '../Word'; +import Word from '../../Word'; import {parseSize} from './parseSize'; import {mergeSdt} from './mergeSdt'; diff --git a/packages/office-viewer/src/parse/parseTablePr.ts b/packages/office-viewer/src/word/parse/parseTablePr.ts similarity index 96% rename from packages/office-viewer/src/parse/parseTablePr.ts rename to packages/office-viewer/src/word/parse/parseTablePr.ts index 444abac6c..72f0296e4 100644 --- a/packages/office-viewer/src/parse/parseTablePr.ts +++ b/packages/office-viewer/src/word/parse/parseTablePr.ts @@ -1,10 +1,10 @@ -import {ST_TblLayoutType} from './../openxml/Types'; +import {ST_TblLayoutType} from '../../openxml/Types'; -import {getAttrBoolean, getVal, getValHex, getValNumber} from '../OpenXML'; -import {CSSStyle} from '../openxml/Style'; -import {TablePr, TblLookKey} from '../openxml/word/Table'; +import {getAttrBoolean, getVal, getValHex, getValNumber} from '../../OpenXML'; +import {CSSStyle} from '../../openxml/Style'; +import {TablePr, TblLookKey} from '../../openxml/word/Table'; -import Word from '../Word'; +import Word from '../../Word'; import {parseBorders} from './parseBorder'; import {parseInsideBorders} from './parseInsideBorders'; import {parseTblWidth} from './parseTblWidth'; diff --git a/packages/office-viewer/src/parse/parseTblWidth.ts b/packages/office-viewer/src/word/parse/parseTblWidth.ts similarity index 91% rename from packages/office-viewer/src/parse/parseTblWidth.ts rename to packages/office-viewer/src/word/parse/parseTblWidth.ts index 217c09408..b8cab68f6 100644 --- a/packages/office-viewer/src/parse/parseTblWidth.ts +++ b/packages/office-viewer/src/word/parse/parseTblWidth.ts @@ -1,4 +1,4 @@ -import {ST_TblWidth} from './../openxml/Types'; +import {ST_TblWidth} from '../../openxml/Types'; import {parseSize, LengthUsage} from './parseSize'; /** diff --git a/packages/office-viewer/src/parse/parseTc.ts b/packages/office-viewer/src/word/parse/parseTc.ts similarity index 91% rename from packages/office-viewer/src/parse/parseTc.ts rename to packages/office-viewer/src/word/parse/parseTc.ts index 119a9a110..f0c9bb9fe 100644 --- a/packages/office-viewer/src/parse/parseTc.ts +++ b/packages/office-viewer/src/word/parse/parseTc.ts @@ -2,11 +2,11 @@ * 拆分出来主要是为了避免循环引用 */ -import {Tc} from '../openxml/word/table/Tc'; -import Word from '../Word'; +import {Tc} from '../../openxml/word/table/Tc'; +import Word from '../../Word'; import {parseTcPr} from './parseTcPr'; -import {Paragraph} from '../openxml/word/Paragraph'; +import {Paragraph} from '../../openxml/word/Paragraph'; import {parseTable} from './parseTable'; export function parseTc( diff --git a/packages/office-viewer/src/parse/parseTcPr.ts b/packages/office-viewer/src/word/parse/parseTcPr.ts similarity index 90% rename from packages/office-viewer/src/parse/parseTcPr.ts rename to packages/office-viewer/src/word/parse/parseTcPr.ts index 69471acf3..f5b4a4914 100644 --- a/packages/office-viewer/src/parse/parseTcPr.ts +++ b/packages/office-viewer/src/word/parse/parseTcPr.ts @@ -1,10 +1,10 @@ -import {CSSStyle} from '../openxml/Style'; -import {TcPr} from '../openxml/word/table/Tc'; -import Word from '../Word'; +import {CSSStyle} from '../../openxml/Style'; +import {TcPr} from '../../openxml/word/table/Tc'; +import Word from '../../Word'; import {parseCellMargin} from './parseCellMargin'; import {parseShdColor} from './parseColor'; -import {getVal, getValBoolean, getValNumber} from '../OpenXML'; -import {ST_Merge, ST_TblWidth, ST_VerticalJc} from '../openxml/Types'; +import {getVal, getValBoolean, getValNumber} from '../../OpenXML'; +import {ST_Merge, ST_TblWidth, ST_VerticalJc} from '../../openxml/Types'; import {parseSize, LengthUsage} from './parseSize'; import {parseBorders} from './parseBorder'; import {parseTextDirection} from './parseTextDirection'; diff --git a/packages/office-viewer/src/parse/parseTextDirection.ts b/packages/office-viewer/src/word/parse/parseTextDirection.ts similarity index 83% rename from packages/office-viewer/src/parse/parseTextDirection.ts rename to packages/office-viewer/src/word/parse/parseTextDirection.ts index 190245ede..46b2f232c 100644 --- a/packages/office-viewer/src/parse/parseTextDirection.ts +++ b/packages/office-viewer/src/word/parse/parseTextDirection.ts @@ -1,5 +1,5 @@ -import {CSSStyle} from '../openxml/Style'; -import {ST_TextDirection} from '../openxml/Types'; +import {CSSStyle} from '../../openxml/Style'; +import {ST_TextDirection} from '../../openxml/Types'; export function parseTextDirection(element: Element, style: CSSStyle) { const val = element.getAttribute('w:val') as string; diff --git a/packages/office-viewer/src/parse/parseTr.ts b/packages/office-viewer/src/word/parse/parseTr.ts similarity index 89% rename from packages/office-viewer/src/parse/parseTr.ts rename to packages/office-viewer/src/word/parse/parseTr.ts index 2ac624fc3..dbf488e15 100644 --- a/packages/office-viewer/src/parse/parseTr.ts +++ b/packages/office-viewer/src/word/parse/parseTr.ts @@ -1,8 +1,8 @@ -import Word from '../Word'; -import {Tr} from '../openxml/word/table/Tr'; +import Word from '../../Word'; +import {Tr} from '../../openxml/word/table/Tr'; import {parseTc} from './parseTc'; import {parseTablePr} from './parseTablePr'; -import {Tc} from '../openxml/word/table/Tc'; +import {Tc} from '../../openxml/word/table/Tc'; import {parseTrPr} from './parseTrPr'; import {mergeSdt} from './mergeSdt'; diff --git a/packages/office-viewer/src/parse/parseTrHeight.ts b/packages/office-viewer/src/word/parse/parseTrHeight.ts similarity index 91% rename from packages/office-viewer/src/parse/parseTrHeight.ts rename to packages/office-viewer/src/word/parse/parseTrHeight.ts index cff63fd02..b3345e80d 100644 --- a/packages/office-viewer/src/parse/parseTrHeight.ts +++ b/packages/office-viewer/src/word/parse/parseTrHeight.ts @@ -1,4 +1,4 @@ -import {CSSStyle} from '../openxml/Style'; +import {CSSStyle} from '../../openxml/Style'; import {parseSize} from './parseSize'; // http://webapp.docx4java.org/OnlineDemo/ecma376/WordML/trHeight.html diff --git a/packages/office-viewer/src/parse/parseTrPr.ts b/packages/office-viewer/src/word/parse/parseTrPr.ts similarity index 88% rename from packages/office-viewer/src/parse/parseTrPr.ts rename to packages/office-viewer/src/word/parse/parseTrPr.ts index 7dd15284b..f3bc8dc24 100644 --- a/packages/office-viewer/src/parse/parseTrPr.ts +++ b/packages/office-viewer/src/word/parse/parseTrPr.ts @@ -1,7 +1,7 @@ -import {getVal, getValBoolean} from '../OpenXML'; -import {CSSStyle} from '../openxml/Style'; -import {TrPr} from '../openxml/word/table/Tr'; -import Word from '../Word'; +import {getVal, getValBoolean} from '../../OpenXML'; +import {CSSStyle} from '../../openxml/Style'; +import {TrPr} from '../../openxml/word/table/Tr'; +import Word from '../../Word'; import {jcToTextAlign} from './jcToTextAlign'; import {parseTablePr} from './parseTablePr'; import {parseTblCellSpacing} from './parseTcPr'; diff --git a/packages/office-viewer/src/render/fixAbsolutePosition.ts b/packages/office-viewer/src/word/render/fixAbsolutePosition.ts similarity index 92% rename from packages/office-viewer/src/render/fixAbsolutePosition.ts rename to packages/office-viewer/src/word/render/fixAbsolutePosition.ts index 8bc7db166..7b8cf25b5 100644 --- a/packages/office-viewer/src/render/fixAbsolutePosition.ts +++ b/packages/office-viewer/src/word/render/fixAbsolutePosition.ts @@ -1,6 +1,6 @@ -import {CSSStyle} from '../openxml/Style'; -import Word from '../Word'; -import parseSides from '../util/parseSides'; +import {CSSStyle} from '../../openxml/Style'; +import Word from '../../Word'; +import parseSides from '../../util/parseSides'; /** * 修复绝对定位的位置,主要是加上 padding,因为 html 中的定位是不考虑 padding 的 diff --git a/packages/office-viewer/src/render/renderBody.ts b/packages/office-viewer/src/word/render/renderBody.ts similarity index 94% rename from packages/office-viewer/src/render/renderBody.ts rename to packages/office-viewer/src/word/render/renderBody.ts index 7ca63a931..518fcbbb9 100644 --- a/packages/office-viewer/src/render/renderBody.ts +++ b/packages/office-viewer/src/word/render/renderBody.ts @@ -2,16 +2,16 @@ * 渲染 body 节点 */ -import {createElement, appendChild, removeChild} from '../util/dom'; -import Word, {WordRenderOptions} from '../Word'; -import {Body} from '../openxml/word/Body'; -import {Paragraph} from '../openxml/word/Paragraph'; -import {Table} from '../openxml/word/Table'; +import {createElement, appendChild, removeChild} from '../../util/dom'; +import Word, {WordRenderOptions} from '../../Word'; +import {Body} from '../../openxml/word/Body'; +import {Paragraph} from '../../openxml/word/Paragraph'; +import {Table} from '../../openxml/word/Table'; import renderParagraph from './renderParagraph'; import {renderSection} from './renderSection'; import renderTable from './renderTable'; -import {Section} from '../openxml/word/Section'; -import {WDocument} from '../openxml/word/WDocument'; +import {Section} from '../../openxml/word/Section'; +import {WDocument} from '../../openxml/word/WDocument'; /** * 判断是否需要创建一个新 section,包括强制分页和超出了 section 的高宽或宽度 diff --git a/packages/office-viewer/src/render/renderBookmark.ts b/packages/office-viewer/src/word/render/renderBookmark.ts similarity index 69% rename from packages/office-viewer/src/render/renderBookmark.ts rename to packages/office-viewer/src/word/render/renderBookmark.ts index b9deb3cdd..f7f5230d6 100644 --- a/packages/office-viewer/src/render/renderBookmark.ts +++ b/packages/office-viewer/src/word/render/renderBookmark.ts @@ -1,6 +1,6 @@ -import {BookmarkStart} from '../openxml/word/Bookmark'; -import {createElement} from '../util/dom'; -import Word from '../Word'; +import {BookmarkStart} from '../../openxml/word/Bookmark'; +import {createElement} from '../../util/dom'; +import Word from '../../Word'; /** * 渲染书签 diff --git a/packages/office-viewer/src/render/renderBr.ts b/packages/office-viewer/src/word/render/renderBr.ts similarity index 76% rename from packages/office-viewer/src/render/renderBr.ts rename to packages/office-viewer/src/word/render/renderBr.ts index 07a3a8958..5a1110218 100644 --- a/packages/office-viewer/src/render/renderBr.ts +++ b/packages/office-viewer/src/word/render/renderBr.ts @@ -1,6 +1,6 @@ -import Word from '../Word'; -import {Break} from '../openxml/word/Break'; -import {createElement} from '../util/dom'; +import Word from '../../Word'; +import {Break} from '../../openxml/word/Break'; +import {createElement} from '../../util/dom'; /** * 解析 br http://officeopenxml.com/WPtextSpecialContent-break.php diff --git a/packages/office-viewer/src/render/renderCustGeom.ts b/packages/office-viewer/src/word/render/renderCustGeom.ts similarity index 50% rename from packages/office-viewer/src/render/renderCustGeom.ts rename to packages/office-viewer/src/word/render/renderCustGeom.ts index 59cd0e556..daa4eef0b 100644 --- a/packages/office-viewer/src/render/renderCustGeom.ts +++ b/packages/office-viewer/src/word/render/renderCustGeom.ts @@ -1,7 +1,7 @@ -import {ShapePr} from '../openxml/drawing/ShapeProperties'; -import {shapeToSVG} from '../openxml/drawing/svg/shapeToSVG'; -import {WPSStyle} from '../openxml/word/wps/WPSStyle'; -import {CustomGeom} from '../openxml/drawing/CustomGeom'; +import {ShapePr} from '../../openxml/drawing/ShapeProperties'; +import {shapeToSVG} from '../../openxml/drawing/svg/shapeToSVG'; +import {WPSStyle} from '../../openxml/word/wps/WPSStyle'; +import {CustomGeom} from '../../openxml/drawing/CustomGeom'; export function renderCustGeom( geom: CustomGeom, diff --git a/packages/office-viewer/src/render/renderDocument.ts b/packages/office-viewer/src/word/render/renderDocument.ts similarity index 73% rename from packages/office-viewer/src/render/renderDocument.ts rename to packages/office-viewer/src/word/render/renderDocument.ts index 816d829ef..120d31853 100644 --- a/packages/office-viewer/src/render/renderDocument.ts +++ b/packages/office-viewer/src/word/render/renderDocument.ts @@ -1,8 +1,8 @@ -import {createElement} from '../util/dom'; -import Word, {WordRenderOptions} from '../Word'; +import {createElement} from '../../util/dom'; +import Word, {WordRenderOptions} from '../../Word'; import renderBody from './renderBody'; -import {WDocument} from '../openxml/word/WDocument'; +import {WDocument} from '../../openxml/word/WDocument'; /** * 渲染 document 主要入口 diff --git a/packages/office-viewer/src/render/renderDrawing.ts b/packages/office-viewer/src/word/render/renderDrawing.ts similarity index 94% rename from packages/office-viewer/src/render/renderDrawing.ts rename to packages/office-viewer/src/word/render/renderDrawing.ts index 07b3a516e..1a27cbcd4 100644 --- a/packages/office-viewer/src/render/renderDrawing.ts +++ b/packages/office-viewer/src/word/render/renderDrawing.ts @@ -1,16 +1,16 @@ -import {Paragraph} from './../openxml/word/Paragraph'; -import Word from '../Word'; -import {Drawing} from '../openxml/drawing/Drawing'; -import {Pic} from '../openxml/drawing/Pic'; -import {appendChild, applyStyle} from '../util/dom'; +import {Paragraph} from '../../openxml/word/Paragraph'; +import Word from '../../Word'; +import {Drawing} from '../../openxml/drawing/Drawing'; +import {Pic} from '../../openxml/drawing/Pic'; +import {appendChild, applyStyle} from '../../util/dom'; import renderParagraph from './renderParagraph'; import renderTable from './renderTable'; -import {Table} from '../openxml/word/Table'; +import {Table} from '../../openxml/word/Table'; import {renderGeom} from './renderGeom'; import {renderCustGeom} from './renderCustGeom'; -import {WPS} from '../openxml/word/wps/WPS'; -import {WPG} from '../openxml/word/wps/WPG'; -import {Transform} from '../openxml/drawing/Transform'; +import {WPS} from '../../openxml/word/wps/WPS'; +import {WPG} from '../../openxml/word/wps/WPG'; +import {Transform} from '../../openxml/drawing/Transform'; /** * 渲染图片 diff --git a/packages/office-viewer/src/render/renderFont.ts b/packages/office-viewer/src/word/render/renderFont.ts similarity index 86% rename from packages/office-viewer/src/render/renderFont.ts rename to packages/office-viewer/src/word/render/renderFont.ts index 27695d5e3..5c6c662c8 100644 --- a/packages/office-viewer/src/render/renderFont.ts +++ b/packages/office-viewer/src/word/render/renderFont.ts @@ -2,8 +2,8 @@ * 渲染自定义字体样式 */ -import {createElement} from '../util/dom'; -import {FontTable} from '../openxml/word/FontTable'; +import {createElement} from '../../util/dom'; +import {FontTable} from '../../openxml/word/FontTable'; export function renderFont(fontTable?: FontTable) { if (!fontTable) { diff --git a/packages/office-viewer/src/render/renderGeom.ts b/packages/office-viewer/src/word/render/renderGeom.ts similarity index 55% rename from packages/office-viewer/src/render/renderGeom.ts rename to packages/office-viewer/src/word/render/renderGeom.ts index 4633e20f6..0eb9190ab 100644 --- a/packages/office-viewer/src/render/renderGeom.ts +++ b/packages/office-viewer/src/word/render/renderGeom.ts @@ -1,8 +1,8 @@ -import {presetShape} from '../openxml/drawing/presetShape'; -import {Geom} from '../openxml/drawing/Geom'; -import {ShapePr} from '../openxml/drawing/ShapeProperties'; -import {shapeToSVG} from '../openxml/drawing/svg/shapeToSVG'; -import {WPSStyle} from '../openxml/word/wps/WPSStyle'; +import {presetShape} from '../../openxml/drawing/presetShape'; +import {Geom} from '../../openxml/drawing/Geom'; +import {ShapePr} from '../../openxml/drawing/ShapeProperties'; +import {shapeToSVG} from '../../openxml/drawing/svg/shapeToSVG'; +import {WPSStyle} from '../../openxml/word/wps/WPSStyle'; export function renderGeom( geom: Geom, diff --git a/packages/office-viewer/src/render/renderHeader.ts b/packages/office-viewer/src/word/render/renderHeader.ts similarity index 71% rename from packages/office-viewer/src/render/renderHeader.ts rename to packages/office-viewer/src/word/render/renderHeader.ts index 09de11a7f..2d1c1ab32 100644 --- a/packages/office-viewer/src/render/renderHeader.ts +++ b/packages/office-viewer/src/word/render/renderHeader.ts @@ -2,13 +2,13 @@ * 渲染 header 内容 */ -import Word from '../Word'; -import {Header} from '../openxml/word/Header'; -import {Paragraph} from '../openxml/word/Paragraph'; +import Word from '../../Word'; +import {Header} from '../../openxml/word/Header'; +import {Paragraph} from '../../openxml/word/Paragraph'; import renderParagraph from './renderParagraph'; -import {appendChild, createElement} from '../util/dom'; +import {appendChild, createElement} from '../../util/dom'; import renderTable from './renderTable'; -import {Table} from '../openxml/word/Table'; +import {Table} from '../../openxml/word/Table'; export function renderHeader(word: Word, header: Header) { const headerEl = createElement('div'); diff --git a/packages/office-viewer/src/render/renderHyperLink.ts b/packages/office-viewer/src/word/render/renderHyperLink.ts similarity index 74% rename from packages/office-viewer/src/render/renderHyperLink.ts rename to packages/office-viewer/src/word/render/renderHyperLink.ts index 569422870..d6fe329bf 100644 --- a/packages/office-viewer/src/render/renderHyperLink.ts +++ b/packages/office-viewer/src/word/render/renderHyperLink.ts @@ -1,9 +1,9 @@ -import {Hyperlink} from './../openxml/word/Hyperlink'; -import {appendChild, createElement} from '../util/dom'; -import Word from '../Word'; -import {Run} from '../openxml/word/Run'; +import {Hyperlink} from '../../openxml/word/Hyperlink'; +import {appendChild, createElement} from '../../util/dom'; +import Word from '../../Word'; +import {Run} from '../../openxml/word/Run'; import renderRun from './renderRun'; -import type {Paragraph} from '../openxml/word/Paragraph'; +import type {Paragraph} from '../../openxml/word/Paragraph'; /** * 渲染链接 diff --git a/packages/office-viewer/src/render/renderInlineText.ts b/packages/office-viewer/src/word/render/renderInlineText.ts similarity index 69% rename from packages/office-viewer/src/render/renderInlineText.ts rename to packages/office-viewer/src/word/render/renderInlineText.ts index dd889831a..4c73d5764 100644 --- a/packages/office-viewer/src/render/renderInlineText.ts +++ b/packages/office-viewer/src/word/render/renderInlineText.ts @@ -1,13 +1,13 @@ -import {appendChild} from '../util/dom'; -import Word from '../Word'; +import {appendChild} from '../../util/dom'; +import Word from '../../Word'; -import {Run} from '../openxml/word/Run'; -import {BookmarkStart} from '../openxml/word/Bookmark'; -import {Hyperlink} from '../openxml/word/Hyperlink'; +import {Run} from '../../openxml/word/Run'; +import {BookmarkStart} from '../../openxml/word/Bookmark'; +import {Hyperlink} from '../../openxml/word/Hyperlink'; import renderRun from './renderRun'; import {renderHyperLink} from './renderHyperLink'; import {renderBookmarkStart} from './renderBookmark'; -import {InlineText} from '../openxml/word/InlineText'; +import {InlineText} from '../../openxml/word/InlineText'; /** * 渲染 smart tag diff --git a/packages/office-viewer/src/render/renderInstrText.ts b/packages/office-viewer/src/word/render/renderInstrText.ts similarity index 86% rename from packages/office-viewer/src/render/renderInstrText.ts rename to packages/office-viewer/src/word/render/renderInstrText.ts index db6329ea5..ed42836f7 100644 --- a/packages/office-viewer/src/render/renderInstrText.ts +++ b/packages/office-viewer/src/word/render/renderInstrText.ts @@ -1,6 +1,6 @@ -import {InstrText} from '../openxml/word/InstrText'; -import Word from '../Word'; -import {createElement} from '../util/dom'; +import {InstrText} from '../../openxml/word/InstrText'; +import Word from '../../Word'; +import {createElement} from '../../util/dom'; import renderInlineText from './renderInlineText'; /** diff --git a/packages/office-viewer/src/word/render/renderMath.ts b/packages/office-viewer/src/word/render/renderMath.ts new file mode 100644 index 000000000..3bdb3babf --- /dev/null +++ b/packages/office-viewer/src/word/render/renderMath.ts @@ -0,0 +1,7 @@ +import {convertOOXML} from '../../openxml/math/convertOOML'; +import {OMath} from '../../openxml/math/OMath'; +import Word from '../../Word'; + +export function renderOMath(word: Word, math: OMath) { + return convertOOXML(math.element); +} diff --git a/packages/office-viewer/src/render/renderNoBreakHyphen.ts b/packages/office-viewer/src/word/render/renderNoBreakHyphen.ts similarity index 75% rename from packages/office-viewer/src/render/renderNoBreakHyphen.ts rename to packages/office-viewer/src/word/render/renderNoBreakHyphen.ts index 18263bed8..18b4b72ee 100644 --- a/packages/office-viewer/src/render/renderNoBreakHyphen.ts +++ b/packages/office-viewer/src/word/render/renderNoBreakHyphen.ts @@ -1,4 +1,4 @@ -import {createElement} from '../util/dom'; +import {createElement} from '../../util/dom'; export function renderNoBreakHyphen() { const softHyphen = createElement('span'); diff --git a/packages/office-viewer/src/render/renderNotes.ts b/packages/office-viewer/src/word/render/renderNotes.ts similarity index 85% rename from packages/office-viewer/src/render/renderNotes.ts rename to packages/office-viewer/src/word/render/renderNotes.ts index 47f0071b0..64ed80357 100644 --- a/packages/office-viewer/src/render/renderNotes.ts +++ b/packages/office-viewer/src/word/render/renderNotes.ts @@ -2,11 +2,11 @@ * 渲染 footnotes 和 endnotes,这个需要最后执行 */ -import {Note, NoteChild} from '../openxml/word/Note'; -import {Paragraph} from '../openxml/word/Paragraph'; -import {Table} from '../openxml/word/Table'; -import {appendChild, appendComment, createElement} from '../util/dom'; -import Word from '../Word'; +import {Note, NoteChild} from '../../openxml/word/Note'; +import {Paragraph} from '../../openxml/word/Paragraph'; +import {Table} from '../../openxml/word/Table'; +import {appendChild, appendComment, createElement} from '../../util/dom'; +import Word from '../../Word'; import renderParagraph from './renderParagraph'; import renderTable from './renderTable'; diff --git a/packages/office-viewer/src/render/renderNumbering.ts b/packages/office-viewer/src/word/render/renderNumbering.ts similarity index 95% rename from packages/office-viewer/src/render/renderNumbering.ts rename to packages/office-viewer/src/word/render/renderNumbering.ts index c985abff4..32b9cfd7d 100644 --- a/packages/office-viewer/src/render/renderNumbering.ts +++ b/packages/office-viewer/src/word/render/renderNumbering.ts @@ -1,7 +1,7 @@ -import {NumberPr} from '../openxml/word/numbering/NumberProperties'; -import {createElement} from '../util/dom'; -import Word from '../Word'; -import {ST_NumberFormat} from '../openxml/Types'; +import {NumberPr} from '../../openxml/word/numbering/NumberProperties'; +import {createElement} from '../../util/dom'; +import Word from '../../Word'; +import {ST_NumberFormat} from '../../openxml/Types'; import {setElementStyle} from './setElementStyle'; /** diff --git a/packages/office-viewer/src/render/renderParagraph.ts b/packages/office-viewer/src/word/render/renderParagraph.ts similarity index 86% rename from packages/office-viewer/src/render/renderParagraph.ts rename to packages/office-viewer/src/word/render/renderParagraph.ts index 43f6fb16d..196a8d400 100644 --- a/packages/office-viewer/src/render/renderParagraph.ts +++ b/packages/office-viewer/src/word/render/renderParagraph.ts @@ -1,19 +1,19 @@ -import {createElement, appendChild, applyStyle} from '../util/dom'; -import Word from '../Word'; +import {createElement, appendChild, applyStyle} from '../../util/dom'; +import Word from '../../Word'; -import {Paragraph, ParagraphPr} from '../openxml/word/Paragraph'; -import {Run} from '../openxml/word/Run'; -import {BookmarkStart} from './../openxml/word/Bookmark'; -import {Hyperlink} from '../openxml/word/Hyperlink'; +import {Paragraph, ParagraphPr} from '../../openxml/word/Paragraph'; +import {Run} from '../../openxml/word/Run'; +import {BookmarkStart} from '../../openxml/word/Bookmark'; +import {Hyperlink} from '../../openxml/word/Hyperlink'; import renderRun from './renderRun'; import {renderHyperLink} from './renderHyperLink'; import {renderBookmarkStart} from './renderBookmark'; import {renderNumbering} from './renderNumbering'; import {setElementStyle} from './setElementStyle'; import {renderTab} from './renderTab'; -import {OMath} from '../openxml/math/OMath'; +import {OMath} from '../../openxml/math/OMath'; import {renderOMath} from './renderMath'; -import {Tab} from '../openxml/word/Tab'; +import {Tab} from '../../openxml/word/Tab'; /** * 渲染段落 diff --git a/packages/office-viewer/src/render/renderPict.ts b/packages/office-viewer/src/word/render/renderPict.ts similarity index 79% rename from packages/office-viewer/src/render/renderPict.ts rename to packages/office-viewer/src/word/render/renderPict.ts index ea5106a19..afd875dfa 100644 --- a/packages/office-viewer/src/render/renderPict.ts +++ b/packages/office-viewer/src/word/render/renderPict.ts @@ -1,5 +1,5 @@ -import {Pict} from '../openxml/word/Pict'; -import Word from '../Word'; +import {Pict} from '../../openxml/word/Pict'; +import Word from '../../Word'; /** * 老的 vml 格式,目前只支持图片 diff --git a/packages/office-viewer/src/render/renderRuby.ts b/packages/office-viewer/src/word/render/renderRuby.ts similarity index 87% rename from packages/office-viewer/src/render/renderRuby.ts rename to packages/office-viewer/src/word/render/renderRuby.ts index 307e9b2d0..f4516dc46 100644 --- a/packages/office-viewer/src/render/renderRuby.ts +++ b/packages/office-viewer/src/word/render/renderRuby.ts @@ -2,9 +2,9 @@ * 渲染 ruby 标签 */ -import {Ruby} from '../openxml/word/Ruby'; -import {createElement} from '../util/dom'; -import Word from '../Word'; +import {Ruby} from '../../openxml/word/Ruby'; +import {createElement} from '../../util/dom'; +import Word from '../../Word'; import renderRun from './renderRun'; export function renderRuby(word: Word, ruby: Ruby) { diff --git a/packages/office-viewer/src/render/renderRun.ts b/packages/office-viewer/src/word/render/renderRun.ts similarity index 83% rename from packages/office-viewer/src/render/renderRun.ts rename to packages/office-viewer/src/word/render/renderRun.ts index ab4802c8f..81b6f4891 100644 --- a/packages/office-viewer/src/render/renderRun.ts +++ b/packages/office-viewer/src/word/render/renderRun.ts @@ -3,30 +3,30 @@ */ import {renderBr} from './renderBr'; -import {appendChild, createElement, applyStyle} from '../util/dom'; -import Word from '../Word'; -import {Run, Text} from '../openxml/word/Run'; -import {Break} from '../openxml/word/Break'; -import {Drawing} from '../openxml/drawing/Drawing'; +import {appendChild, createElement, applyStyle} from '../../util/dom'; +import Word from '../../Word'; +import {Run, Text} from '../../openxml/word/Run'; +import {Break} from '../../openxml/word/Break'; +import {Drawing} from '../../openxml/drawing/Drawing'; import {renderDrawing} from './renderDrawing'; import {setElementStyle} from './setElementStyle'; -import {Tab} from '../openxml/word/Tab'; +import {Tab} from '../../openxml/word/Tab'; import {renderTab} from './renderTab'; import {renderPict} from './renderPict'; -import {Pict} from '../openxml/word/Pict'; -import {Ruby} from '../openxml/word/Ruby'; +import {Pict} from '../../openxml/word/Pict'; +import {Ruby} from '../../openxml/word/Ruby'; import {renderRuby} from './renderRuby'; -import {InstrText} from '../openxml/word/InstrText'; +import {InstrText} from '../../openxml/word/InstrText'; import {renderInstrText} from './renderInstrText'; -import {Sym} from '../openxml/word/Sym'; +import {Sym} from '../../openxml/word/Sym'; import {renderSym} from './renderSym'; -import {cjkspace} from '../util/autoSpace'; -import type {Paragraph} from '../openxml/word/Paragraph'; +import {cjkspace} from '../../util/autoSpace'; +import type {Paragraph} from '../../openxml/word/Paragraph'; import {renderSoftHyphen} from './renderSoftHyphen'; -import {SoftHyphen} from '../openxml/word/SoftHyphen'; -import {NoBreakHyphen} from '../openxml/word/NoBreakHyphen'; +import {SoftHyphen} from '../../openxml/word/SoftHyphen'; +import {NoBreakHyphen} from '../../openxml/word/NoBreakHyphen'; import {renderNoBreakHyphen} from './renderNoBreakHyphen'; -import {Separator} from '../openxml/word/Separator'; +import {Separator} from '../../openxml/word/Separator'; import {renderSeparator} from './renderSeparator'; const VARIABLE_CLASS_NAME = 'variable'; diff --git a/packages/office-viewer/src/render/renderSection.ts b/packages/office-viewer/src/word/render/renderSection.ts similarity index 94% rename from packages/office-viewer/src/render/renderSection.ts rename to packages/office-viewer/src/word/render/renderSection.ts index 02f08016d..ab4bd1476 100644 --- a/packages/office-viewer/src/render/renderSection.ts +++ b/packages/office-viewer/src/word/render/renderSection.ts @@ -1,7 +1,7 @@ -import {WDocument} from '../openxml/word/WDocument'; -import {Section} from '../openxml/word/Section'; -import {createElement} from '../util/dom'; -import Word, {WordRenderOptions} from '../Word'; +import {WDocument} from '../../openxml/word/WDocument'; +import {Section} from '../../openxml/word/Section'; +import {createElement} from '../../util/dom'; +import Word, {WordRenderOptions} from '../../Word'; import {fixAbsolutePosition} from './fixAbsolutePosition'; import {renderHeader} from './renderHeader'; diff --git a/packages/office-viewer/src/render/renderSeparator.ts b/packages/office-viewer/src/word/render/renderSeparator.ts similarity index 73% rename from packages/office-viewer/src/render/renderSeparator.ts rename to packages/office-viewer/src/word/render/renderSeparator.ts index bbc4e5724..12263063f 100644 --- a/packages/office-viewer/src/render/renderSeparator.ts +++ b/packages/office-viewer/src/word/render/renderSeparator.ts @@ -1,4 +1,4 @@ -import {createElement} from '../util/dom'; +import {createElement} from '../../util/dom'; export function renderSeparator() { const sep = createElement('hr'); diff --git a/packages/office-viewer/src/render/renderSoftHyphen.ts b/packages/office-viewer/src/word/render/renderSoftHyphen.ts similarity index 75% rename from packages/office-viewer/src/render/renderSoftHyphen.ts rename to packages/office-viewer/src/word/render/renderSoftHyphen.ts index 7e4fefa9a..ef451a3c4 100644 --- a/packages/office-viewer/src/render/renderSoftHyphen.ts +++ b/packages/office-viewer/src/word/render/renderSoftHyphen.ts @@ -1,4 +1,4 @@ -import {createElement} from '../util/dom'; +import {createElement} from '../../util/dom'; export function renderSoftHyphen() { const softHyphen = createElement('span'); diff --git a/packages/office-viewer/src/render/renderStyle.ts b/packages/office-viewer/src/word/render/renderStyle.ts similarity index 97% rename from packages/office-viewer/src/render/renderStyle.ts rename to packages/office-viewer/src/word/render/renderStyle.ts index 5dec808a1..5dbd4cd41 100644 --- a/packages/office-viewer/src/render/renderStyle.ts +++ b/packages/office-viewer/src/word/render/renderStyle.ts @@ -2,10 +2,10 @@ * 渲染内置样式及自定义样式 */ -import {TblStylePrStyle} from '../openxml/Style'; -import {ST_TblStyleOverrideType} from '../openxml/Types'; -import {createElement, styleToText} from '../util/dom'; -import Word from '../Word'; +import {TblStylePrStyle} from '../../openxml/Style'; +import {ST_TblStyleOverrideType} from '../../openxml/Types'; +import {createElement, styleToText} from '../../util/dom'; +import Word from '../../Word'; /** * 文档基础默认样式 diff --git a/packages/office-viewer/src/render/renderSym.ts b/packages/office-viewer/src/word/render/renderSym.ts similarity index 59% rename from packages/office-viewer/src/render/renderSym.ts rename to packages/office-viewer/src/word/render/renderSym.ts index 5e4ef9aca..a69585394 100644 --- a/packages/office-viewer/src/render/renderSym.ts +++ b/packages/office-viewer/src/word/render/renderSym.ts @@ -1,6 +1,6 @@ -import {Sym} from '../openxml/word/Sym'; -import {createElement} from '../util/dom'; -import Word from '../Word'; +import {Sym} from '../../openxml/word/Sym'; +import {createElement} from '../../util/dom'; +import Word from '../../Word'; export function renderSym(word: Word, sym: Sym) { const span = createElement('span'); diff --git a/packages/office-viewer/src/render/renderTab.ts b/packages/office-viewer/src/word/render/renderTab.ts similarity index 78% rename from packages/office-viewer/src/render/renderTab.ts rename to packages/office-viewer/src/word/render/renderTab.ts index c9ea14609..c24f8dfc0 100644 --- a/packages/office-viewer/src/render/renderTab.ts +++ b/packages/office-viewer/src/word/render/renderTab.ts @@ -1,7 +1,7 @@ -import {ST_TabTlc} from '../openxml/Types'; -import {Tab} from '../openxml/word/Tab'; -import {createElement} from '../util/dom'; -import Word from '../Word'; +import {ST_TabTlc} from '../../openxml/Types'; +import {Tab} from '../../openxml/word/Tab'; +import {createElement} from '../../util/dom'; +import Word from '../../Word'; /** * 渲染 tab diff --git a/packages/office-viewer/src/render/renderTable.ts b/packages/office-viewer/src/word/render/renderTable.ts similarity index 94% rename from packages/office-viewer/src/render/renderTable.ts rename to packages/office-viewer/src/word/render/renderTable.ts index e68ef19fe..4f50a49e6 100644 --- a/packages/office-viewer/src/render/renderTable.ts +++ b/packages/office-viewer/src/word/render/renderTable.ts @@ -1,8 +1,8 @@ -import {ST_TblStyleOverrideType} from '../openxml/Types'; -import {Paragraph} from '../openxml/word/Paragraph'; -import {TblLookKey, Table} from '../openxml/word/Table'; -import {addClassName, appendChild, applyStyle} from '../util/dom'; -import Word from '../Word'; +import {ST_TblStyleOverrideType} from '../../openxml/Types'; +import {Paragraph} from '../../openxml/word/Paragraph'; +import {TblLookKey, Table} from '../../openxml/word/Table'; +import {addClassName, appendChild, applyStyle} from '../../util/dom'; +import Word from '../../Word'; import renderParagraph from './renderParagraph'; import {generateTableStyle} from './renderStyle'; import {setElementStyle} from './setElementStyle'; diff --git a/packages/office-viewer/src/render/setElementStyle.ts b/packages/office-viewer/src/word/render/setElementStyle.ts similarity index 81% rename from packages/office-viewer/src/render/setElementStyle.ts rename to packages/office-viewer/src/word/render/setElementStyle.ts index 002dac2d0..61374cfb4 100644 --- a/packages/office-viewer/src/render/setElementStyle.ts +++ b/packages/office-viewer/src/word/render/setElementStyle.ts @@ -1,6 +1,6 @@ -import {Properties} from '../openxml/word/properties/Properties'; -import {addClassName, addClassNames, applyStyle} from '../util/dom'; -import Word from '../Word'; +import {Properties} from '../../openxml/word/properties/Properties'; +import {addClassName, addClassNames, applyStyle} from '../../util/dom'; +import Word from '../../Word'; /** * 设置元素样式,因为好几个地方用所以统一一下 diff --git a/packages/office-viewer/src/render/zindex.ts b/packages/office-viewer/src/word/render/zindex.ts similarity index 100% rename from packages/office-viewer/src/render/zindex.ts rename to packages/office-viewer/src/word/render/zindex.ts diff --git a/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/PivotTableFormats.xlsx b/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/PivotTableFormats.xlsx new file mode 100755 index 000000000..e2bfd6a32 Binary files /dev/null and b/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/PivotTableFormats.xlsx differ diff --git a/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/presetCellStyles.xml b/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/presetCellStyles.xml new file mode 100755 index 000000000..b140aca64 --- /dev/null +++ b/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/presetCellStyles.xml @@ -0,0 +1,3549 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> + <fonts count="2"> + <font> + <sz val="11"/> + <color theme="1"/> + <name val="Calibri"/> + <family val="2"/> + <scheme val="minor"/> + </font> + <font> + <b/> + <sz val="18"/> + <color theme="3"/> + <name val="Cambria"/> + <family val="2"/> + <scheme val="major"/> + </font> + </fonts> + <fills count="2"> + <fill> + <patternFill patternType="none"/> + </fill> + <fill> + <patternFill patternType="gray125"/> + </fill> + </fills> + <borders count="1"> + <border> + <left/> + <right/> + <top/> + <bottom/> + <diagonal/> + </border> + </borders> + <cellStyleXfs count="2"> + <xf numFmtId="0" fontId="0" fillId="0" borderId="0"/> + <xf numFmtId="0" fontId="1" fillId="0" borderId="0" applyFill="0" applyBorder="0" applyAlignment="0" applyProtection="0"/> + </cellStyleXfs> + <cellXfs count="2"> + <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/> + <xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="1"/> + </cellXfs> + <cellStyles count="2"> + <cellStyle name="Normal" xfId="0" builtinId="0"/> + <cellStyle name="Title" xfId="1"/> + </cellStyles> + <dxfs count="0"/> + <tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/> + </styleSheet> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/presetTableStyles.xml b/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/presetTableStyles.xml new file mode 100755 index 000000000..89dac2837 --- /dev/null +++ b/packages/office-viewer/tools/OfficeOpenXML-SpreadsheetMLStyles/presetTableStyles.xml @@ -0,0 +1,18070 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/office-viewer/tools/OfficeOpenXML-XMLSchema-Strict/sml.xsd b/packages/office-viewer/tools/OfficeOpenXML-XMLSchema-Strict/sml.xsd index 4346d37b9..da7d3bad0 100755 --- a/packages/office-viewer/tools/OfficeOpenXML-XMLSchema-Strict/sml.xsd +++ b/packages/office-viewer/tools/OfficeOpenXML-XMLSchema-Strict/sml.xsd @@ -3425,6 +3425,9 @@ + + + diff --git a/packages/office-viewer/tools/__test__/xsd2Types.test.ts b/packages/office-viewer/tools/__test__/xsd2Types.test.ts new file mode 100644 index 000000000..233ddf89a --- /dev/null +++ b/packages/office-viewer/tools/__test__/xsd2Types.test.ts @@ -0,0 +1,640 @@ +import {Type, simplifyUnionOne, generateCodes, xsd2Types} from '../xsd2Types'; + +test('fill', async () => { + const xml = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`; + + const types = await xsd2Types(xml); + + expect(types).toEqual([ + { + name: 'CT_Stylesheet', + type: 'CT_Stylesheet', + attributes: { + fills: { + name: 'fills', + isArray: false, + defaultValue: undefined, + type: 'CT_Fills' + } + } + }, + { + name: 'CT_Fills', + type: 'CT_Fills', + attributes: { + fill: { + name: 'fill', + isArray: true, + defaultValue: undefined, + type: 'CT_Fill' + }, + count: { + name: 'count', + defaultValue: undefined, + type: 'int' + } + } + }, + { + name: 'CT_Fill', + type: 'CT_Fill', + attributes: { + patternFill: { + name: 'patternFill', + isArray: false, + defaultValue: undefined, + type: 'CT_PatternFill' + }, + gradientFill: { + name: 'gradientFill', + isArray: false, + defaultValue: undefined, + type: 'CT_GradientFill' + } + } + }, + { + name: 'CT_GradientFill', + type: 'CT_GradientFill', + attributes: { + stop: { + name: 'stop', + isArray: true, + defaultValue: undefined, + type: 'CT_GradientStop' + }, + type: { + name: 'type', + defaultValue: 'linear', + type: 'ST_GradientType' + }, + degree: { + name: 'degree', + defaultValue: '0', + type: 'double' + }, + left: { + name: 'left', + defaultValue: '0', + type: 'double' + }, + right: { + name: 'right', + defaultValue: '0', + type: 'double' + }, + top: { + name: 'top', + defaultValue: '0', + type: 'double' + }, + bottom: { + name: 'bottom', + defaultValue: '0', + type: 'double' + } + } + }, + { + name: 'CT_GradientStop', + type: 'CT_GradientStop', + attributes: { + color: { + name: 'color', + isArray: false, + defaultValue: undefined, + type: 'CT_Color' + }, + position: { + name: 'position', + defaultValue: undefined, + type: 'double' + } + } + }, + { + name: 'ST_GradientType', + type: 'enum', + enum: ['linear', 'path'] + }, + { + name: 'CT_PatternFill', + type: 'CT_PatternFill', + attributes: { + fgColor: { + name: 'fgColor', + isArray: false, + defaultValue: undefined, + type: 'CT_Color' + }, + bgColor: { + name: 'bgColor', + isArray: false, + defaultValue: undefined, + type: 'CT_Color' + }, + patternType: { + name: 'patternType', + defaultValue: undefined, + type: 'ST_PatternType' + } + } + }, + { + name: 'ST_PatternType', + type: 'enum', + enum: [ + 'none', + 'solid', + 'mediumGray', + 'darkGray', + 'lightGray', + 'darkHorizontal', + 'darkVertical', + 'darkDown', + 'darkUp', + 'darkGrid', + 'darkTrellis', + 'lightHorizontal', + 'lightVertical', + 'lightDown', + 'lightUp', + 'lightGrid', + 'lightTrellis', + 'gray125', + 'gray0625' + ] + }, + { + name: 'CT_Color', + type: 'CT_Color', + attributes: { + auto: { + name: 'auto', + defaultValue: undefined, + type: 'boolean' + }, + indexed: { + name: 'indexed', + defaultValue: undefined, + type: 'int' + }, + rgb: { + name: 'rgb', + defaultValue: undefined, + type: 'string' + }, + theme: { + name: 'theme', + defaultValue: undefined, + type: 'int' + }, + tint: { + name: 'tint', + defaultValue: '0.0', + type: 'double' + } + } + } + ]); +}); + +test('list', async () => { + const xml = ` + + + + + + + + + + +`; + + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'ST_CellSpan', + type: 'string' + }, + { + name: 'ST_CellSpans', + type: 'ST_CellSpan', + isArray: true + }, + { + name: 'CT_Row', + type: 'CT_Row', + attributes: { + spans: { + name: 'spans', + type: 'ST_CellSpans' + } + } + } + ]); +}); + +test('simplifyType', async () => { + const xml = ` + + + + + + + + + + + + +`; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'ST_TextScale', + type: 'union', + union: ['ST_TextScalePercent'] + }, + { + name: 'ST_TextScalePercent', + type: 'string' + }, + { + name: 'CT_TextScale', + type: 'CT_TextScale', + attributes: { + val: { + name: 'val', + type: 'ST_TextScale' + } + } + } + ]); + + const code = generateCodes(types); + console.log(code); +}); + +test('ST_DecimalNumber', async () => { + const xml = ` + + + + + + + +`; + const types = await xsd2Types(xml); + + const code = generateCodes(types); + console.log(code); +}); + +test('typeprefix', async () => { + const xml = ` + + + + + + +`; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'CT_WordprocessingCanvas', + type: 'CT_WordprocessingCanvas', + attributes: { + extLst: { + name: 'extLst', + isArray: false, + defaultValue: undefined, + type: 'CT_OfficeArtExtensionList' + } + } + } + ]); +}); + +test('mergeUnion', async () => { + const xml = ` + + + + + + + + + +`; + const types = await xsd2Types(xml); + simplifyUnionOne(types); + expect(types).toEqual([ + { + name: 'ST_TextBulletSize', + type: 'string' + }, + { + name: 'ST_TextBulletSizePercent', + type: 'string' + } + ]); +}); + +test('cfRule', async () => { + const xml = ` + + + + + + +`; + const types = await xsd2Types(xml); + simplifyUnionOne(types); + expect(types).toEqual([ + { + name: 'CT_CfRule', + type: 'CT_CfRule', + attributes: { + formula: { + name: 'formula', + isArray: true, + defaultValue: undefined, + type: 'child-string' + } + } + } + ]); +}); + +test('groupref', async () => { + const xml = ` + + + + + + + + + + + + + + + + + `; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'CT_Color', + type: 'CT_Color', + attributes: { + scrgbClr: { + name: 'scrgbClr', + isArray: false, + defaultValue: undefined, + type: 'CT_ScRgbColor' + } + } + }, + { + name: 'CT_ScRgbColor', + type: 'CT_ScRgbColor', + attributes: { + r: { + name: 'r', + defaultValue: undefined, + type: 'string' + }, + g: { + name: 'g', + defaultValue: undefined, + type: 'string' + }, + b: { + name: 'b', + defaultValue: undefined, + type: 'string' + } + } + } + ]); +}); + +test('any', async () => { + const xml = ` + + + + + + + +`; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'CT_Extension', + type: 'CT_Extension', + attributes: { + __any__: { + name: '__any__', + type: 'any' + }, + uri: { + name: 'uri', + defaultValue: undefined, + type: 'string' + } + } + } + ]); +}); + +test('rid', async () => { + const xml = ` + + + + +`; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'CT_Rel', + type: 'CT_Rel', + attributes: { + 'r:id': { + name: 'r:id', + type: 'string' + } + } + } + ]); +}); + +test('ignore', async () => { + const xml = ` + + + + + + + + + + + + + + + + + +`; + const types = await xsd2Types(xml); + const code = generateCodes(types); + console.log(code); +}); + +test('child-string-sequence', async () => { + const xml = ` + + + + + + + `; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'CT_NumVal', + type: 'CT_NumVal', + attributes: { + v: { + name: 'v', + isArray: false, + defaultValue: undefined, + type: 'child-string' + } + } + } + ]); +}); + +test('child-string-element', async () => { + const xml = ` + + + + + + + `; + const types = await xsd2Types(xml); + expect(types).toEqual([ + { + name: 'CT_NumRef', + type: 'CT_NumRef', + attributes: { + f: { + name: 'f', + isArray: false, + defaultValue: undefined, + type: 'child-string' + } + } + } + ]); +}); diff --git a/packages/office-viewer/tools/converDrawingML.ts b/packages/office-viewer/tools/convertDrawingML.ts similarity index 95% rename from packages/office-viewer/tools/converDrawingML.ts rename to packages/office-viewer/tools/convertDrawingML.ts index 010204952..19b16f502 100644 --- a/packages/office-viewer/tools/converDrawingML.ts +++ b/packages/office-viewer/tools/convertDrawingML.ts @@ -5,7 +5,7 @@ import {readFileSync, writeFileSync} from 'fs'; import {parseXML} from '../src/util/xml'; import {Shape} from '../src/openxml/drawing/Shape'; -import {parseShape} from '../src/parse/parseShape'; +import {parseShape} from '../src/word/parse/parseShape'; import jsdom from 'jsdom'; import prettier from 'prettier'; diff --git a/packages/office-viewer/tools/convertFileToBase64.ts b/packages/office-viewer/tools/convertFileToBase64.ts new file mode 100644 index 000000000..524058b31 --- /dev/null +++ b/packages/office-viewer/tools/convertFileToBase64.ts @@ -0,0 +1,33 @@ +/** + * 将文件转成 base64 字符串 + */ +import {readFileSync, writeFileSync} from 'fs'; + +import prettier from 'prettier'; + +import process from 'node:process'; +import path from 'node:path'; + +const file = process.argv[2]; + +const tsFile = process.argv[3]; + +const content = readFileSync(file); + +const varName = path.basename(tsFile.replace(/\.ts$/, '')); + +const base64Content = content.toString('base64'); + +const outputFile = ` +/** generated by convertFileToBase64.ts, do not edit */ + +export const ${varName} = '${base64Content}'; +`; + +prettier.resolveConfig('../../../.prettierrc').then(options => { + const formatted = prettier.format(outputFile, { + ...options, + parser: 'typescript' + }); + writeFileSync(tsFile, formatted); +}); diff --git a/packages/office-viewer/tools/convertPresetCellStyles.ts b/packages/office-viewer/tools/convertPresetCellStyles.ts new file mode 100644 index 000000000..4109565de --- /dev/null +++ b/packages/office-viewer/tools/convertPresetCellStyles.ts @@ -0,0 +1,57 @@ +/** + * 转换 presetCellStyles 为对象,但好像这个功能在浏览模式不需要 + */ + +import {readFileSync, writeFileSync} from 'fs'; +import prettier from 'prettier'; +import {xml2json} from '../src/util/xml'; +import {autoParse} from '../src/common/autoParse'; +import { + CT_Stylesheet, + CT_Stylesheet_Attributes +} from '../src/openxml/ExcelTypes'; + +async function convert() { + const presetFileNode = await xml2json( + readFileSync( + './OfficeOpenXML-SpreadsheetMLStyles/presetCellStyles.xml', + 'utf-8' + ) + ); + const presetCellStyles: Record = {}; + for (const tableStyle of presetFileNode.children) { + const styleId = tableStyle.attrs['builtinId']; + const styleDef = autoParse( + tableStyle.children[0], + CT_Stylesheet_Attributes + ); + + if (styleDef) { + delete styleDef['xmlns']; + presetCellStyles[styleId] = styleDef; + } + } + + let outputFile: string[] = [ + '/** generated by tools/convertPresetCellStyles.ts, do not edit */', + `import {CT_Stylesheet} from '../../../../openxml/ExcelTypes';` + ]; + outputFile.push( + 'export const presetCellStyles: Record = ' + + JSON.stringify(presetCellStyles, null, 2) + + ';' + ); + + prettier.resolveConfig('../../../.prettierrc').then(options => { + const formatted = prettier.format(outputFile.join('\n'), { + ...options, + parser: 'typescript' + }); + writeFileSync( + '../src/excel/io/excel/preset/presetCellStyles.ts', + formatted + ); + }); +} + +convert(); diff --git a/packages/office-viewer/tools/convertPresetTableStyles.ts b/packages/office-viewer/tools/convertPresetTableStyles.ts new file mode 100644 index 000000000..9d2a24620 --- /dev/null +++ b/packages/office-viewer/tools/convertPresetTableStyles.ts @@ -0,0 +1,50 @@ +/** + * 转换 presetTableStyles 为对象方便处理 + */ + +import {readFileSync, writeFileSync} from 'fs'; +import prettier from 'prettier'; +import {xml2json} from '../src/util/xml'; +import {TableStyleDef} from '../src/excel/types/TableStyleDef'; +import {parseTableStyleDef} from '../src/excel/io/excel/parseTableStyleDef'; + +async function convert() { + const presetFileNode = await xml2json( + readFileSync( + './OfficeOpenXML-SpreadsheetMLStyles/presetTableStyles.xml', + 'utf-8' + ) + ); + const presetTableStyles: Record = {}; + for (const tableStyle of presetFileNode.children) { + const styleName = tableStyle.tag; + const styleDef = parseTableStyleDef(tableStyle); + + if (styleDef) { + presetTableStyles[styleName] = styleDef; + } + } + + let outputFile: string[] = [ + '/** generated by tools/convertPresetTableStyle.ts, do not edit */', + `import {TableStyleDef} from '../../../types/TableStyleDef';` + ]; + outputFile.push( + 'export const presetTableStyles: Record = ' + + JSON.stringify(presetTableStyles, null, 2) + + ';' + ); + + prettier.resolveConfig('../../../.prettierrc').then(options => { + const formatted = prettier.format(outputFile.join('\n'), { + ...options, + parser: 'typescript' + }); + writeFileSync( + '../src/excel/io/excel/preset/presetTableStyles.ts', + formatted + ); + }); +} + +convert(); diff --git a/packages/office-viewer/tools/createLargeCSV.ts b/packages/office-viewer/tools/createLargeCSV.ts new file mode 100644 index 000000000..4de7e1788 --- /dev/null +++ b/packages/office-viewer/tools/createLargeCSV.ts @@ -0,0 +1,23 @@ +/** + * 创建个大的csv文件 + */ + +import process from 'node:process'; + +const columns = 10; +const rows = 1000000; + +// 写入 csv header +const header: string[] = []; +for (let i = 0; i < columns; i++) { + header.push(`col${i}`); +} +process.stdout.write(header.join(',') + '\n'); + +for (let i = 0; i < rows; i++) { + const row: string[] = []; + for (let j = 0; j < columns; j++) { + row.push(`r${i} c${j}`); + } + process.stdout.write(row.join(',') + '\n'); +} diff --git a/packages/office-viewer/tools/excelParseTest.ts b/packages/office-viewer/tools/excelParseTest.ts new file mode 100644 index 000000000..97b379d4c --- /dev/null +++ b/packages/office-viewer/tools/excelParseTest.ts @@ -0,0 +1,39 @@ +/** + * 测试 Excel 解析是否正常 + */ +import jsdom from 'jsdom'; +const {JSDOM} = jsdom; +const {DOMParser, document, Blob, URL} = new JSDOM(``).window; +global.DOMParser = DOMParser; +global.document = document; +global.Blob = Blob; +global.URL = URL; + +import {readdir} from 'node:fs/promises'; +import {resolve} from 'path'; +import {readFileSync} from 'fs'; +import {createOfficeViewer} from '../src'; + +async function* getFiles(dir: string): AsyncGenerator { + const dirs = await readdir(dir, {withFileTypes: true}); + for (const dirent of dirs) { + const res = resolve(dir, dirent.name); + if (dirent.isDirectory()) { + yield* getFiles(res); + } else { + yield res; + } + } +} + +const dir = process.argv[2]; + +(async () => { + for await (const file of getFiles(dir)) { + if (file.endsWith('.xlsx') && !file.includes('~$')) { + console.log(file); + const data = readFileSync(file); + const excel = await createOfficeViewer(data, {}, file); + } + } +})(); diff --git a/packages/office-viewer/tools/ext/spreadsheetml-2009-9-main.xsd b/packages/office-viewer/tools/ext/spreadsheetml-2009-9-main.xsd new file mode 100644 index 000000000..c422c2cd0 --- /dev/null +++ b/packages/office-viewer/tools/ext/spreadsheetml-2009-9-main.xsd @@ -0,0 +1,879 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/office-viewer/tools/genExampleFileList.ts b/packages/office-viewer/tools/genExampleFileList.ts new file mode 100644 index 000000000..0e954c8ec --- /dev/null +++ b/packages/office-viewer/tools/genExampleFileList.ts @@ -0,0 +1,42 @@ +/** + * 生成示例文件列表 + */ + +import {readdir} from 'node:fs/promises'; +import {writeFileSync} from 'fs'; +import prettier from 'prettier'; + +async function genFiles(path: string) { + const fileLists: Record = {}; + const dirs = (await readdir(path)).filter( + item => !/(^|\/)\.[^\/\.]/g.test(item) + ); + for (const dir of dirs) { + fileLists[dir] = (await readdir(path + '/' + dir)).filter( + item => + (item.endsWith('.xlsx') || + item.endsWith('.csv') || + item.endsWith('.tsv')) && + !item.startsWith('~') + ); + } + return fileLists; +} + +function writeFile(fileName: string, content: string) { + prettier.resolveConfig('../../../.prettierrc').then(options => { + const formatted = prettier.format(content, { + ...options, + parser: 'typescript' + }); + writeFileSync(fileName, formatted); + }); +} + +(async () => { + const excelFiles = genFiles('__tests__/xlsx/'); + writeFile( + 'examples/excelFileList.ts', + `export default ${JSON.stringify(await excelFiles, null, 2)};` + ); +})(); diff --git a/packages/office-viewer/tools/genIcons.ts b/packages/office-viewer/tools/genIcons.ts new file mode 100644 index 000000000..eaafdb216 --- /dev/null +++ b/packages/office-viewer/tools/genIcons.ts @@ -0,0 +1,31 @@ +/** + * 生成图标定义,不想依赖任何打包工具,所以自己生成 + */ +import {readFileSync, writeFileSync, readdirSync} from 'fs'; + +import prettier from 'prettier'; + +const iconFiles = readdirSync('design/icons').filter(item => + item.endsWith('.svg') +); + +const iconContents: Record = {}; + +for (const icon of iconFiles) { + const content = readFileSync(`design/icons/${icon}`, 'utf-8'); + iconContents[icon.replace(/\.svg$/, '')] = content; +} + +const outputFile = ` +/** generated by genIcons.ts, do not edit */ + +export const Icons = ${JSON.stringify(iconContents, null, 2)}; +`; + +prettier.resolveConfig('../../../.prettierrc').then(options => { + const formatted = prettier.format(outputFile, { + ...options, + parser: 'typescript' + }); + writeFileSync('src/excel/render/Icons.ts', formatted); +}); diff --git a/packages/office-viewer/tools/genPresetIcons.ts b/packages/office-viewer/tools/genPresetIcons.ts new file mode 100644 index 000000000..3c321be25 --- /dev/null +++ b/packages/office-viewer/tools/genPresetIcons.ts @@ -0,0 +1,79 @@ +/** + * 生成图标定义,不想依赖任何打包工具,所以自己生成 + */ +import {readFileSync, writeFileSync} from 'fs'; +import prettier from 'prettier'; + +const icons = [ + 'down', + 'side', + 'up', + 'downGray', + 'sideGray', + 'upGray', + 'flagRed', + 'flagYellow', + 'flagGreen', + 'diamondRed', + 'triangleYellow', + 'circleGreen', + 'crossRed', + 'exclamationYellow', + 'checkGreen', + 'crossSymbolRed', + 'exclamationSymbolYellow', + 'checkSymbolGreen', + 'circleRed', + 'circleYellow', + 'trafficLightRed', + 'trafficLightYellow', + 'trafficLightGreen', + 'downIncline', + 'upIncline', + 'downInclineGray', + 'upInclineGray', + 'oneFilledBars', + 'twoFilledBars', + 'threeFilledBars', + 'fourFilledBars', + 'circleBlack', + 'circleGray', + 'circleLightRed', + 'circleWhite', + 'circleThreeWhiteQuarters', + 'circleTwoWhiteQuarters', + 'circleOneWhiteQuarter', + 'zeroFilledBars' +]; + +const iconContents: Record = {}; + +for (const icon of icons) { + const content = readFileSync( + `../src/excel/io/excel/preset/icons/${icon}.svg`, + 'utf-8' + ); + iconContents[icon] = + 'data:image/svg+xml;base64,' + + Buffer.from(content, 'utf8').toString('base64'); +} + +const outputFile = ` +/** generated by genPresetIcons.ts, do not edit */ + +export type IconNames = ${icons.map(icon => `'${icon}'`).join(' | ')}; + +export const presetIcons: Record = ${JSON.stringify( + iconContents, + null, + 2 +)}; +`; + +prettier.resolveConfig('../../../.prettierrc').then(options => { + const formatted = prettier.format(outputFile, { + ...options, + parser: 'typescript' + }); + writeFileSync('../src/excel/io/excel/preset/presetIcons.ts', formatted); +}); diff --git a/packages/office-viewer/tools/xsd2Types.ts b/packages/office-viewer/tools/xsd2Types.ts new file mode 100644 index 000000000..fa0e5db78 --- /dev/null +++ b/packages/office-viewer/tools/xsd2Types.ts @@ -0,0 +1,619 @@ +import * as fs from 'fs'; +import {XMLNode, xml2json} from '../src/util/xml'; + +interface SimpleType { + name: string; + type: 'string' | 'int' | 'double' | 'boolean' | 'enum' | 'union' | string; + isArray?: boolean; + required?: boolean; + enum?: string[]; + union?: string[]; + defaultValue?: string; +} + +interface ComplexType { + name: string; + type: string; + defaultValue?: string; + isArray?: boolean; + required?: boolean; + attributes: Record; +} + +export async function parse(filePath: string, types: Type[] = []) { + return xsd2Types(fs.readFileSync(filePath, 'utf-8'), types); +} + +export type Type = SimpleType | ComplexType; + +function toJavaScriptType(type: string) { + if ( + type === 'xsd:string' || + type === 'xsd:token' || + type === 'xsd:hexBinary' || + type === 'xsd:dateTime' || + type === 'xsd:NCName' || + type === 'xsd:base64Binary' || + type === 'ST_UnsignedIntHex' || + type === 'ST_Sqref' || + type === 'ST_Percentage' || + type === 'ST_Formula' || + type === 's:ST_Xstring' || + type === 'a:ST_Coordinate' + ) { + return 'string'; + } else if ( + type === 'xsd:integer' || + type === 'xsd:int' || + type === 'xsd:unsignedInt' || + type === 'xsd:unsignedLong' || + type === 'xsd:unsignedShort' || + type === 'xsd:long' || + type === 'xsd:byte' || + type === 'xsd:unsignedByte' || + type === 'ST_ColID' || + type === 'ST_RowID' || + type === 'ST_TextRotation' + ) { + return 'int'; + } else if (type === 'xsd:double') { + return 'double'; + } else if (type === 'xsd:boolean') { + return 'boolean'; + } + return type.replace(/\w:/g, ''); +} + +function parseElement( + sequenceChild: XMLNode, + attributes: Record +) { + const type = sequenceChild.attrs.type; + const name = sequenceChild.attrs.name; + const maxOccurs = parseInt(sequenceChild.attrs.maxOccurs, 10); + let isArray = true; + if (maxOccurs === 1) { + isArray = false; + } + const defaultValue = sequenceChild.attrs.default; + if (name) { + let javaScriptType = toJavaScriptType(type); + // 这里都是 element,所以一定是 child-string + if (javaScriptType === 'string') { + javaScriptType = 'child-string'; + } + if (javaScriptType === 'int') { + javaScriptType = 'child-int'; + } + + attributes[name] = { + name, + isArray, + defaultValue, + type: javaScriptType + }; + } else { + const ref = sequenceChild.attrs.ref; + if (ref === 'r:id') { + attributes['r:id'] = { + name: 'r:id', + type: 'string' + }; + } else { + console.error(`error require name`, ref); + } + } +} + +function parseTypeChild( + child: XMLNode, + attributes: Record, + groupMap: Map +) { + for (let typeChild of child.children) { + // 这里可能是深层嵌套关系,需要递归处理,但 + if (typeChild.tag === 'xsd:sequence' || typeChild.tag === 'xsd:choice') { + for (let sequenceChild of typeChild.children) { + if ( + sequenceChild.tag === 'xsd:element' || + sequenceChild.tag === 'xsd:group' + ) { + if (sequenceChild.tag === 'xsd:group') { + const ref = sequenceChild.attrs.ref; + if (ref) { + const group = groupMap.get(ref); + if (group) { + parseTypeChild(group, attributes, groupMap); + } else { + console.error(`找不到 group: ${ref}`); + } + } else { + console.error(`require ref`, sequenceChild); + } + } + parseElement(sequenceChild, attributes); + } else if (sequenceChild.tag === 'xsd:any') { + attributes['__any__'] = { + name: '__any__', + type: 'any' + }; + } else if (sequenceChild.tag === 'xsd:choice') { + for (const choiceChild of sequenceChild.children) { + if (choiceChild.tag === 'xsd:element') { + parseElement(choiceChild, attributes); + } + } + } + } + } else if (typeChild.tag === 'xsd:attribute') { + const type = typeChild.attrs.type; + let name = typeChild.attrs.name; + const defaultValue = typeChild.attrs.default; + if (name) { + attributes[name] = { + name, + defaultValue, + type: toJavaScriptType(type) + }; + } else { + const ref = typeChild.attrs.ref; + if (ref === 'r:id') { + attributes['r:id'] = { + name: 'r:id', + type: 'string' + }; + } else { + console.error(`require name`, ref, typeChild); + } + } + } + } +} + +/** + * 解析 xsd 生成 TypeScript 类型定义 + * @param xmlString + */ +export async function xsd2Types(xmlString: string, types: Type[] = []) { + const xml = await xml2json(xmlString); + const groupMap = collectGroup(xml); + for (const child of xml.children) { + if (child.tag === 'xsd:complexType') { + const type = child.attrs.name; + const attributes: Record = {}; + parseTypeChild(child, attributes, groupMap); + const hasType = types.findIndex(item => item.name === type); + // 有重复定义就以后面的为主,删掉这个 + if (hasType !== -1) { + console.log(`有重复定义: ${type}`); + types.splice(hasType, 1); + } + + types.push({name: type, type, attributes}); + } else if (child.tag === 'xsd:simpleType') { + const name = child.attrs.name; + const simpleTypeChild = child.children[0]; + if (simpleTypeChild.tag === 'xsd:restriction') { + const base = simpleTypeChild.attrs.base; + if (base) { + const type = toJavaScriptType(base); + if (type === 'string') { + const enumValues: string[] = []; + for (const enumChild of simpleTypeChild.children) { + if (enumChild.tag === 'xsd:enumeration') { + enumValues.push(enumChild.attrs.value); + } + } + if (enumValues.length === 0) { + types.push({ + name, + type + }); + } else { + types.push({ + name, + type: 'enum', + enum: enumValues + }); + } + } else { + types.push({ + name, + type + }); + } + } + } else if (simpleTypeChild.tag === 'xsd:union') { + const memberTypes = simpleTypeChild.attrs.memberTypes + ?.replace(/s:/g, '') + .split(' ') + .map((item: string) => { + return toJavaScriptType(item); + }); + types.push({ + name, + type: 'union', + union: memberTypes + }); + } else if (simpleTypeChild.tag === 'xsd:list') { + const itemType = simpleTypeChild.attrs.itemType; + types.push({ + name, + type: toJavaScriptType(itemType), + isArray: true + }); + } + } + } + return types; +} + +/** + * 搜集 group 列表 + */ +function collectGroup(xmlNode: XMLNode) { + const groupMap = new Map(); + for (const child of xmlNode.children) { + if (child.tag === 'xsd:group') { + const name = child.attrs.name; + groupMap.set(name, child); + } + } + return groupMap; +} + +/** + * 生成简化类型,比如有些最终是字符串或字符串数组,就直接用 string | string[] 表示 + * 只支持一层数组,层次多会有问题,但好像没这种场景 + */ +function simplifyType( + type: Type, + typeMap: Record +): { + type: string; + isArray?: boolean; +} | null { + const typeName = type.type; + + if ( + typeName === 'string' || + typeName === 'number' || + typeName === 'int' || + typeName === 'double' + ) { + if (type.isArray) { + return { + type: typeName, + isArray: true + }; + } else { + return { + type: typeName + }; + } + } + + if (typeName.startsWith('ST')) { + if (typeName in typeMap) { + const parentType = simplifyType(typeMap[typeName], typeMap); + if (parentType) { + if (type.isArray) { + return { + ...parentType, + isArray: true + }; + } else { + return parentType; + } + } + } + } + + return null; +} + +// 这些类型不需要生成,由外部提供定义 +const IGNORE_TYPES = new Set([ + 'CT_ExtensionList', + 'EG_ExtensionList', + 'CT_Extension' +]); + +// 目前这些定义有死循环,导致用不了 +const ANY_TYPES = new Set([ + 'CT_Div', + 'CT_Divs', + 'CT_EffectStyleItem', + 'CT_EffectList', + 'CT_FillOverlayEffect', + 'CT_GvmlGroupShape', + 'CT_GroupShape' +]); + +function generateAnyType(typeName: string) { + const result: string[] = []; + result.push(`export type ${typeName} = any;`); + result.push(`export const ${typeName}_Attributes: Attributes = {};`); + + return result.join('\n'); +} + +/** + * 生成某个类型的代码 + * @param type 类型定义 + * @param typeIsGenerated 已经生成过的类型 + * @param typeMap 类型映射,用于查找依赖的类型 + * @param generateAttributes 是否生成用于解析的属性定义 + */ +function generateType( + type: Type, + typeIsGenerated: Record, + typeMap: Record, + generateAttributes = true +) { + if (type.name in typeIsGenerated || IGNORE_TYPES.has(type.name)) { + return ''; + } + + if (ANY_TYPES.has(type.name)) { + typeIsGenerated[type.name] = true; + return generateAnyType(type.name); + } + + typeIsGenerated[type.name] = true; + // 说明是复杂类型 + if ('attributes' in type) { + const attributes = type.attributes; + const result: string[] = []; + + result.push(`export interface ${type.name} {`); + for (let key in attributes) { + const attribute = attributes[key] as Type; + let outputType = attribute.type; + + let simpleType = simplifyType(attribute, typeMap); + if (simpleType) { + let javascriptType = simpleType.type; + if (javascriptType === 'int' || javascriptType === 'double') { + javascriptType = 'number'; + } + if (simpleType.isArray) { + outputType = `${javascriptType}[]`; + } else { + outputType = javascriptType; + } + } + if (outputType === 'int' || outputType === 'double') { + outputType = 'number'; + } + if (outputType === 'child-string') { + outputType = 'string'; + } + if (outputType === 'child-int') { + outputType = 'number'; + } + let optional = '?'; + if (attribute.required) { + optional = ''; + } + if (key.includes(':')) { + key = `'${key}'`; + } + // simpleType 已经处理过数组了 + if (attribute.isArray && !simpleType) { + result.push(` ${key}${optional}: ${outputType}[];`); + } else { + result.push(` ${key}${optional}: ${outputType};`); + } + } + result.push('};'); + + // 生成用于解析的属性定义 + + if (generateAttributes) { + result.push(`\nexport const ${type.type}_Attributes: Attributes = {`); + for (let key in attributes) { + const attribute = attributes[key] as Type; + let outputType = attribute.type; + // 这两个定义循环了,所以目前无法支持 + if (outputType === 'CT_Divs' || outputType === 'CT_Div') { + continue; + } + if (key.includes(':')) { + key = `'${key}'`; + } + let simpleType = simplifyType(attribute, typeMap); + if (simpleType) { + if (simpleType.isArray) { + result.push(` ${key}: {`); + result.push(` type: '${simpleType.type}',`); + result.push(` childIsArray: true`); + result.push(' },'); + } else { + result.push(` ${key}: {`); + result.push(` type: '${simpleType.type}',`); + if (attribute.defaultValue) { + result.push(` defaultValue: '${attribute.defaultValue}'`); + } + result.push(' },'); + } + } else { + let childAttributes = ''; + if (outputType.startsWith('CT_')) { + childAttributes = `\n childAttributes: ${outputType}_Attributes,`; + } + if (childAttributes !== '') { + outputType = `child`; + } + // 这种情况一般是 union + if (outputType.startsWith('ST_')) { + outputType = 'string'; + } + if (attribute.isArray) { + result.push(` ${key}: {`); + result.push(` type: '${outputType}',${childAttributes}`); + result.push(` childIsArray: true`); + result.push(' },'); + } else { + result.push(` ${key}: {`); + result.push(` type: '${outputType}',${childAttributes}`); + if (attribute.defaultValue) { + result.push(`defaultValue: '${attribute.defaultValue}'`); + } + result.push(' },'); + } + } + } + result.push('};'); + } + + return result.join('\n'); + } else { + if (type.type === 'enum') { + return `export type ${type.name} = ${type.enum + ?.map(item => `'${item}'`) + .join(' | ')};`; + } else if (type.type === 'union') { + return `export type ${type.name} = ${type.union + ?.map(item => { + if (item === 'int' || item === 'double') { + return 'number'; + } + return item; + }) + .join(' | ')};`; + } else { + let outputType = type.type; + if (type.type === 'int' || type.type === 'double') { + outputType = 'number'; + } + if (type.isArray) { + return `export type ${type.name} = ${outputType}[];`; + } else { + return `export type ${type.name} = ${outputType};`; + } + } + } +} + +function generateCode( + type: Type, + typeIsGenerated: Record, + typeMap: Record, + generateAttributes = true +) { + const result: string[] = []; + + // 先生成依赖的类型 + if ('attributes' in type) { + for (const key in type.attributes) { + const attribute = type.attributes[key]; + const typeName = attribute.type; + // 这个定义循环了 + if (ANY_TYPES.has(type.name) && !(type.name in typeIsGenerated)) { + typeIsGenerated[type.name] = true; + result.push(generateAnyType(type.name)); + } + if ( + (typeName.startsWith('CT_') || typeName.startsWith('ST_')) && + !typeIsGenerated[typeName] + ) { + if (!typeMap[typeName]) { + console.error(`找不到类型定义:${typeName}`); + } + // 递归生成 + result.push( + ...generateCode( + typeMap[typeName], + typeIsGenerated, + typeMap, + generateAttributes + ) + ); + } + } + } + result.push(generateType(type, typeIsGenerated, typeMap, generateAttributes)); + + return result; +} + +/** + * 将 union 为一的情况换成最初的值,简化生成的类型 + * @param types + */ +export function simplifyUnionOne(types: Type[]) { + const typeNameMap: Record = {}; + for (const type of types) { + typeNameMap[type.name] = type; + } + + let oneUnionTypes = findOneUnionType(types); + while (oneUnionTypes.length > 0) { + for (const singleUnionType of oneUnionTypes) { + const unionType = typeNameMap[singleUnionType.unionTypeName]; + // 将这个类型设置为 union 的类型 + const originName = singleUnionType.type.name; + if (!unionType) { + // 找不到类型定义说明是基础类型 + singleUnionType.type.type = singleUnionType.unionTypeName; + } else { + singleUnionType.type.type = unionType.type; + } + if ('union' in singleUnionType.type) { + delete singleUnionType.type.union; + } + } + oneUnionTypes = findOneUnionType(types); + console.log(oneUnionTypes); + } +} + +type SingleUnionType = { + type: Type; + unionTypeName: string; +}; + +function findOneUnionType(types: Type[]) { + const result: SingleUnionType[] = []; + for (const type of types) { + if ('union' in type && type.type === 'union') { + const union = type.union || []; + if (union.length === 1) { + const unionParentType = union[0]; + // 如果不是自己,就需要替换 + if (unionParentType !== type.name) { + result.push({ + type, + unionTypeName: unionParentType + }); + } + } + } + } + return result; +} + +export function generateCodes(types: Type[], generateAttributes = true) { + // 如果已经生成过就跳过 + const typeIsGenerated: Record = {}; + + // 类型映射,这个主要是生成的时候先生成依赖的类型 + const typeMap: Record = {}; + for (const type of types) { + typeMap[type.name] = type; + } + + const result: string[] = [ + "import {Attributes} from './Attributes';\n", + "import {CT_ExtensionList, CT_ExtensionList_Attributes} from './../excel/types/CT_ExtensionList';\n\n" + ]; + + for (const type of types) { + result.push( + ...generateCode(type, typeIsGenerated, typeMap, generateAttributes) + ); + } + + return result.join('\n\n'); +} diff --git a/packages/office-viewer/tools/xsd2chart.ts b/packages/office-viewer/tools/xsd2chart.ts new file mode 100644 index 000000000..73c8f866b --- /dev/null +++ b/packages/office-viewer/tools/xsd2chart.ts @@ -0,0 +1,30 @@ +/** + * 自动生成类型定义及解析所需数据 + */ +import * as fs from 'fs'; + +import {Type, simplifyUnionOne, generateCodes, parse} from './xsd2Types'; + +async function main() { + const types: Type[] = []; + await parse( + './OfficeOpenXML-XMLSchema-Strict/shared-commonSimpleTypes.xsd', + types + ); + + // word 的类型和 excel 的类型有冲突,所以只能先支持 excel + // 另外就是 CT_FontScheme 有冲突 + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-main.xsd', types); + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-chartDrawing.xsd', types); + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-chartDrawing.xsd', types); + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-chart.xsd', types); + + simplifyUnionOne(types); + fs.writeFileSync('../src/openxml/ChartTypes.ts', generateCodes(types)); +} + +try { + main(); +} catch (error) { + console.error(error); +} diff --git a/packages/office-viewer/tools/xsd2dml.ts b/packages/office-viewer/tools/xsd2dml.ts new file mode 100644 index 000000000..b9c20d6a7 --- /dev/null +++ b/packages/office-viewer/tools/xsd2dml.ts @@ -0,0 +1,26 @@ +/** + * 自动生成类型定义及解析所需数据 + */ +import * as fs from 'fs'; + +import {Type, simplifyUnionOne, generateCodes, parse} from './xsd2Types'; + +async function main() { + const types: Type[] = []; + await parse( + './OfficeOpenXML-XMLSchema-Strict/shared-commonSimpleTypes.xsd', + types + ); + + // 进包含 dml 的类型 + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-main.xsd', types); + + simplifyUnionOne(types); + fs.writeFileSync('../src/openxml/DMLTypes.ts', generateCodes(types)); +} + +try { + main(); +} catch (error) { + console.error(error); +} diff --git a/packages/office-viewer/tools/xsd2excel.ts b/packages/office-viewer/tools/xsd2excel.ts new file mode 100644 index 000000000..2b5b54cbf --- /dev/null +++ b/packages/office-viewer/tools/xsd2excel.ts @@ -0,0 +1,32 @@ +/** + * 自动生成类型定义及解析所需数据 + */ +import * as fs from 'fs'; + +import {Type, simplifyUnionOne, generateCodes, parse} from './xsd2Types'; + +async function main() { + const types: Type[] = []; + await parse( + './OfficeOpenXML-XMLSchema-Strict/shared-commonSimpleTypes.xsd', + types + ); + + // word 的类型和 excel 的类型有冲突,所以只能先支持 excel + // 另外就是 CT_FontScheme 有冲突 + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-main.xsd', types); + await parse( + './OfficeOpenXML-XMLSchema-Strict/dml-spreadsheetDrawing.xsd', + types + ); + await parse('./OfficeOpenXML-XMLSchema-Strict/sml.xsd', types); + + simplifyUnionOne(types); + fs.writeFileSync('../src/openxml/ExcelTypes.ts', generateCodes(types)); +} + +try { + main(); +} catch (error) { + console.error(error); +} diff --git a/packages/office-viewer/tools/xsd2excelExt.ts b/packages/office-viewer/tools/xsd2excelExt.ts new file mode 100644 index 000000000..ac1f2d359 --- /dev/null +++ b/packages/office-viewer/tools/xsd2excelExt.ts @@ -0,0 +1,19 @@ +/** + * 自动生成类型定义及解析所需数据 + */ +import * as fs from 'fs'; + +import {Type, simplifyUnionOne, generateCodes, parse} from './xsd2Types'; + +async function main() { + // 问题比较多所有先不支持 + const types: Type[] = []; + await parse('./ext/spreadsheetml-2009-9-main.xsd', types); + fs.writeFileSync('../src/openxml/ExcelExtTypes.ts', generateCodes(types)); +} + +try { + main(); +} catch (error) { + console.error(error); +} diff --git a/packages/office-viewer/tools/xsd2ts.ts b/packages/office-viewer/tools/xsd2ts.ts deleted file mode 100644 index 0dde8aa6e..000000000 --- a/packages/office-viewer/tools/xsd2ts.ts +++ /dev/null @@ -1,326 +0,0 @@ -/** - * 基于 xsd 文件生成 typescript 定义,简化开发 - */ -import * as fs from 'fs'; - -import {XMLParser} from 'fast-xml-parser'; - -const parser = new XMLParser({ - ignoreAttributes: false, - allowBooleanAttributes: true, - trimValues: false, - alwaysCreateTextNode: true -}); - -function parseXML(xml: string) { - return parser.parse(xml); -} - -let outputFile: string[] = ['/** generated by tools/xsd2ts.ts, do not edit */']; - -// 所有定义过的类型 -const definedTypes: Record = {}; - -// 所有使用的类型 -const allusedTypes: Record = {}; - -outputFile.push( - ...convertSchema( - './OfficeOpenXML-XMLSchema-Strict/shared-commonSimpleTypes.xsd' - ) -); -outputFile.push(...convertSchema('./OfficeOpenXML-XMLSchema-Strict/wml.xsd')); -outputFile.push( - ...convertSchema('./OfficeOpenXML-XMLSchema-Strict/dml-main.xsd') -); - -outputFile.push( - ...convertSchema( - './OfficeOpenXML-XMLSchema-Strict/dml-wordprocessingDrawing.xsd' - ) -); - -function generateField(attributes: any[]) { - const result: string[] = []; - - if (!Array.isArray(attributes)) { - attributes = [attributes]; - } - for (const attribute of attributes) { - const attributeName = attribute['@_name']; - if (attributeName) { - let attributeType = attribute['@_type'] - .replace(/s:/g, '') - .replace(/a:/g, ''); - allusedTypes[attributeType] = true; - if (attributeType.startsWith('xsd:')) { - attributeType = toJavaScriptType(attributeType); - } - const use = attribute['@_use']; - if (use === 'required') { - result.push(` ${attributeName}: ${attributeType};`); - } else { - result.push(` ${attributeName}?: ${attributeType};`); - } - } - - let ref = attribute['@_ref']; - if (ref) { - ref = ref - .replace(/r:/g, 'r') - .replace(/m:/g, '') - .replace(/sl:/g, '') - .replace(/a:/g, ''); - const use = attribute['@_use']; - if (ref.indexOf(':') !== -1) { - continue; - } - if (use === 'required') { - result.push(` ${ref}: string;`); - } else { - result.push(` ${ref}?: string;`); - } - } - } - return result; -} - -function toJavaScriptType(type: string) { - if ( - type === 'xsd:string' || - type === 'xsd:token' || - type === 'xsd:hexBinary' || - type === 'xsd:dateTime' || - type === 'xsd:NCName' || - type === 'xsd:base64Binary' - ) { - return 'string'; - } else if ( - type === 'xsd:integer' || - type === 'xsd:int' || - type === 'xsd:unsignedInt' || - type === 'xsd:unsignedLong' || - type === 'xsd:unsignedShort' || - type === 'xsd:long' || - type === 'xsd:byte' || - type === 'xsd:unsignedByte' - ) { - return 'number'; - } else if (type === 'xsd:boolean') { - return 'boolean'; - } - throw new Error("can't replace type: " + type); -} - -// 解析 schema 输出 ts 定义 -function convertSchema(fileName: string) { - const wml = fs.readFileSync(fileName, 'utf8'); - - const schema = parseXML(wml)['xsd:schema']; - - const result: string[] = []; - - for (const key in schema) { - if (key.startsWith('@_')) { - continue; - } - const value = schema[key]; - - if (Array.isArray(value)) { - // 需要执行两边,第一遍是检查基础类型的基础类型 - for (const item of value) { - const name = item['@_name']; - // 目前仅处理简单类型 - if (name && !name.startsWith('ST_')) { - continue; - } - definedTypes[name] = true; - if (key === 'xsd:complexType') { - definedTypes[name] = true; - let attributesAndElements = item['xsd:attribute']; - if (attributesAndElements && !Array.isArray(attributesAndElements)) { - attributesAndElements = [attributesAndElements]; - } - - if (item['xsd:sequence']?.['xsd:element']) { - const elements = item['xsd:sequence']?.['xsd:element']; - if (elements) { - if (!attributesAndElements) { - attributesAndElements = []; - } - attributesAndElements = attributesAndElements.concat(elements); - } - } - if (!attributesAndElements) { - const complexContent = item['xsd:complexContent']; - if (complexContent) { - const extension = complexContent['xsd:extension']; - if (extension) { - const extensionAttributes = extension['xsd:attribute']; - const base = extension['@_base'].replace(/s:/g, ''); - if (extensionAttributes) { - result.push(`export type ${name} = ${base} & {`); - result.push(...generateField(extensionAttributes)); - result.push('}\n'); - } else { - const sequence = extension['xsd:sequence']; - if (sequence) { - let group = sequence['xsd:group']; - let groupStr = ''; - if (group) { - if (!Array.isArray(group)) { - group = [group]; - } - for (const g of group) { - const ref = g['@_ref'].replace(/s:/g, ''); - groupStr += ref + ' & '; - } - } - - if (attributesAndElements) { - result.push( - `export type ${name} = ${base} & ${groupStr} {` - ); - result.push(...generateField(attributesAndElements)); - result.push('}\n'); - } else { - if (groupStr) { - result.push( - `export type ${name} = ${base} & ${groupStr.slice( - 0, - -3 - )};` - ); - } else { - if (name !== base) { - result.push(`export type ${name} = ${base};`); - } - } - } - } else { - if (name !== base) { - result.push(`export type ${name} = ${base};`); - } - } - } - } else { - result.push(`export type ${name} = any;\n`); - } - } else { - result.push(`export type ${name} = any;\n`); - } - } else { - result.push(`export type ${name} = {`); - result.push(...generateField(attributesAndElements)); - result.push('}\n'); - } - } else if (key === 'xsd:simpleType') { - // 简单类型有几种, - const restriction = item['xsd:restriction']; - if (restriction) { - const base = restriction['@_base']; - - if (base.startsWith('xsd:')) { - allusedTypes[base] = true; - const javascriptType = toJavaScriptType(base); - if (javascriptType === 'string') { - let enumeration = restriction['xsd:enumeration']; - if (enumeration) { - if (!Array.isArray(enumeration)) { - enumeration = [enumeration]; - } - // 如果是数字开头大概不会是 enum - if (enumeration[0]['@_value'].match(/^[0-9]/)) { - result.push(`export type ${name} = string;`); - } else { - const enumNames = []; - for (const enumItem of enumeration) { - const enumName = enumItem['@_value']; - enumNames.push(enumName); - } - // 这里用 union 代替 enum,可以减少生成体积 - result.push( - `export type ${name} = '${enumNames.join("' | '")}'` - ); - } - } else { - result.push(`export type ${name} = string;`); - } - } else { - result.push(`export type ${name} = ${javascriptType};`); - } - } else if (base.startsWith('s:') || base.startsWith('ST_')) { - const baseType = base.replace('s:', ''); - allusedTypes[baseType] = true; - if (name !== baseType) { - result.push(`export type ${name} = ${baseType};`); - } - } else { - throw new Error('Unknown base type: ' + base); - } - } - - const union = item['xsd:union']; - if (union) { - const memberTypes = union['@_memberTypes']; - if (memberTypes) { - definedTypes[name] = true; - const members = memberTypes - .replace(/s:/g, '') - .split(' ') - .map((item: string) => { - if (item.startsWith('xsd:')) { - return toJavaScriptType(item); - } else { - return item; - } - }); - for (const member of members) { - allusedTypes[member] = true; - } - const membersStr = members.join(' | '); - if (name !== membersStr) { - result.push(`export type ${name} = ${membersStr};\n`); - } - } - } - } else if (key === 'xsd:group') { - const choice = item['xsd:choice']; - if (choice) { - let elements = choice['xsd:element']; - if (elements) { - if (!Array.isArray(elements)) { - elements = [elements]; - } - result.push(`export type ${name} = {`); - for (const element of elements) { - const elementName = element['@_name']; - const elementType = element['@_type']; - if (elementType) { - allusedTypes[elementType] = true; - result.push(` ${elementName}?: ${elementType};`); - } else { - console.warn("can't find type: " + name); - } - } - result.push('}\n'); - } - } - } - } - } - } - - return result; -} - -for (const key in allusedTypes) { - if (key.startsWith('xsd:')) { - continue; - } - if (!definedTypes[key]) { - console.log('Not defined: ' + key); - } -} - -fs.writeFileSync('../src/openxml/Types.ts', outputFile.join('\n')); diff --git a/packages/office-viewer/tools/xsd2word.ts b/packages/office-viewer/tools/xsd2word.ts new file mode 100644 index 000000000..bfbb7a8cd --- /dev/null +++ b/packages/office-viewer/tools/xsd2word.ts @@ -0,0 +1,31 @@ +/** + * 自动生成类型定义及解析所需数据 + */ +import * as fs from 'fs'; +import {Type, generateCodes, parse, simplifyUnionOne} from './xsd2Types'; + +async function main() { + const types: Type[] = []; + await parse( + './OfficeOpenXML-XMLSchema-Strict/shared-commonSimpleTypes.xsd', + types + ); + + // word 的类型和 excel 的类型有冲突 + await parse('./OfficeOpenXML-XMLSchema-Strict/dml-main.xsd', types); + await parse('./OfficeOpenXML-XMLSchema-Strict/wml.xsd', types); + types.push( + ...(await parse( + './OfficeOpenXML-XMLSchema-Strict/dml-wordprocessingDrawing.xsd' + )) + ); + + simplifyUnionOne(types); + fs.writeFileSync('../src/openxml/Types.ts', generateCodes(types, false)); +} + +try { + main(); +} catch (error) { + console.error(error); +} diff --git a/packages/office-viewer/tsconfig.json b/packages/office-viewer/tsconfig.json index e55e7f300..52b215754 100644 --- a/packages/office-viewer/tsconfig.json +++ b/packages/office-viewer/tsconfig.json @@ -5,6 +5,8 @@ "outDir": "./dist", "baseUrl": "./", "allowSyntheticDefaultImports": true, + "strictPropertyInitialization": false, + "strictNullChecks": true, "typeRoots": [ "../../types", "./node_modules/@types",