t20-cfb-table
v0.4.8
Published
CFB budget table middleware (Univer wrapper)
Readme
t20-cfb-table
预算表格中间层 npm 包。业务仅通过 UniverInput / UniverOutput 与生命周期 API 集成。
安装
npm install t20-cfb-tableUniver 0.21.1 由本包 dependencies 自动安装;业务仓库不要再声明 @univerjs/*。
Qiankun 子应用仅需在 public-path.js 设置 __webpack_public_path__(与预算工程相同),无需额外的 RxJS / 定时器运行时补丁。
Legacy Webpack 4 工程建议在业务侧安装 cjk-regex、regexp-util、unicode-regex(供 preset alias 解析;亦会随本包传递部分依赖)。
Webpack 4 集成(Vue CLI 4 等 legacy 项目)
与预算工程 getUniverWebpackAliases 对齐,在 vue.config.js 中:
const {
transpileDependencies: cfbTableTranspile,
applyWebpack4Integration
} = require('t20-cfb-table/integration/webpack4')
module.exports = {
transpileDependencies: [
// …业务自有项
...cfbTableTranspile
],
chainWebpack: (config) => {
applyWebpack4Integration(config, __dirname)
// …业务自有 chainWebpack
}
}样式
import 't20-cfb-table/dist/style.css'最小用法
import { UniverTable, type UniverInput } from 't20-cfb-table'
import 't20-cfb-table/dist/style.css'
const table = await UniverTable.create(container, univerInput)
table.update(univerInput)
const output = table.getOutput() // 稀疏 cells
table.destroy()Vue 2 示例见 T20-UI 演示页 #/cfbTable(src/views/CfbTable/CfbTable.vue)。
公开契约
- UniverInput:
structure、cells、formulas、editability、behavior - UniverOutput:
cells(仅有值的格) - 公式:Excel A1 式(如
=C5+C6) - 行标题列
columnId:__rowHeader__(ROW_HEADER_COLUMN_ID) - 各字段 JSDoc 见
src/types/input.ts、output.ts、api.ts
目录结构
见 STRUCTURE.md。
开发
cd packages/cfb-table
npm run typecheck
npm test
npm run build