For AI agents: the complete documentation index is available at https://a3s-lab.github.io/Office/docs/0.1.0/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/Office/docs/0.1.0/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/Office/docs/0.1.0/components/spreadsheet.md.

SpreadsheetEditor

SpreadsheetEditor 是受控工作簿组件,提供工作表、公式、图表、条件格式、数据透视表 与打印布局模型。

属性

属性类型必填默认值说明
contentSpreadsheetContent受控工作簿内容。
onChange(content: SpreadsheetContent) => void返回完整的新工作簿。
previewbooleanfalse只读工作簿。
saveStatusstring'Saved automatically'由宿主管理的保存状态。
fileActionsreadonly OfficeFileAction[][]保存、导出、历史记录与审批等操作。
kernelWasmUrlstring内置内核公式与工作簿计算内核地址。
onAgentRequest(request: EditorAgentRequest) => void | Promise<void>把当前单元格或区域发送给宿主 AI 流程。
theme'light' | 'dark' | 'system''system'配色模式。

内容结构

字段类型说明
type'spreadsheet'内容类型标识。
sheetsWorkSpreadsheetSheet[]工作表、单元格、公式、样式、图片、图表与数据透视表。
calculationWorkSpreadsheetCalculationSettings计算模式、迭代、精度与加载行为。
namedRangesWorkSpreadsheetNamedRange[]工作簿级与工作表级名称。
printAreas, printTitles表格打印字段打印区域与重复打印的行、列。
pageBreaks, pageSetups表格页面字段分页符、纸张、方向、缩放、边距、页眉与页脚。

工作簿 Extension 上下文目前还不是稳定公共 API。宿主流程应使用 fileActions, 结构化 AI 操作应使用 onAgentRequest;不要从包的内部路径导入命令运行时模块。