canvas-table-integration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecanvas-table-integration
canvas-table 集成
Use this skill only for consumer-side integration of . It does not support Ant Design Table, Arco Table, TDesign Table, native HTML tables, or any other table implementation as the product table.
@qfei-design/canvas-tableThis skill uses two base tracks and one optional enhancement:
- Track A base: non-Make local/virtual tables, public APIs, row-head actions, optional selection/drag/summary, and lightweight canvas interactions.
- Track C base: Make schema-driven columns, the shared host field-display registry at or the host equivalent, pure value normalization, field renderers, and overflow-only tooltips.
apps/ui/src/lib/make-field-types.ts - Track B enhancement: cell editing layered on the selected base track through , controlled commits, popup ownership, host field editors, and rollback.
customEdit
Choose Track C as the base for every Make schema table; choose Track A only when columns are not Make schema-driven. Add Track B only when editing is explicitly requested or already established. Track B never replaces the selected display base.
Hard Track B rule: every CanvasTable cell edit / 单元格编辑 implementation must follow Track B plus . Non-popup editors keep only the CanvasTable active edit border; inner controls must fill the cell and remain borderless. Missing immediate popup opening, post-scroll positioning, normalized values, or unchanged-value save skipping is a readiness blocker.
references/make-cell-edit-defaults.md本技能仅用于的消费端集成。不支持将Ant Design Table、Arco Table、TDesign Table、原生HTML表格或其他任何表格实现用作产品级表格。
@qfei-design/canvas-table本技能包含两条基础轨道和一项可选增强:
- Track A 基础:非Make的本地/虚拟表格、公共API、行头操作、可选的选择/拖拽/汇总功能,以及轻量级canvas交互。
- Track C 基础:Make schema驱动的列、位于或宿主等效路径的共享宿主字段展示注册表、纯值归一化、字段渲染器以及仅溢出时显示的tooltip。
apps/ui/src/lib/make-field-types.ts - Track B 增强:通过叠加在所选基础轨道上的单元格编辑功能,包含受控提交、弹窗归属、宿主字段编辑器和回滚能力。
customEdit
所有Make schema表格都选择Track C作为基础;仅当列不是由Make schema驱动时才选择Track A。仅当明确要求编辑功能或已存在编辑能力时才添加Track B。Track B永远不会替代所选的展示基础轨道。
Track B 硬性规则:所有CanvasTable单元格编辑的实现都必须遵循Track B以及的要求。非弹窗式编辑器仅保留CanvasTable的激活编辑边框;内部控件必须填满单元格且无边框。若缺少即时弹窗打开、滚动后定位、值归一化或未修改值跳过保存等能力,即为上线阻塞项。
references/make-cell-edit-defaults.mdQuick start
快速开始
- Confirm this is a consumer-side table integration, not table-library maintenance.
- Check package installation and read the package AI docs in the required order below. Integrations that combine business row colors with selection or hover require the published contract.
@qfei-design/canvas-table@^1.3.1 - Choose base Track A or Track C. Add Track B as an editing enhancement when required; for editable Make schema tables use Track C plus Track B.
- For Make schema tables, load and normalize schema fields before initializing the table; build plus renderers from the normalized field types, schema
IColumn[], and the shared field type registry.field.properties - Read only the base-track references and, when editing is in scope, the Track B references from the topic map.
- Start from the package recipe/example when available, then adapt with the smallest project-local diff.
- Enable table row defaults unless the user explicitly opts out: sequence numbers plus a hover-revealed open-detail action through
showSN.bodyRowHeadSuffixOptions - For every writable Make record list, enable multiple selection and route the default edit/delete/batch-edit action workflow to . Only an explicitly read-only list opts out.
make-app-actions - CanvasTable 1.3.1 publishes the business-row-color contract: explicit /
setRowColorscolors remain visible above selection and hover, androwStyleOptionsrestores the underlying row style or built-in background. ResolveclearRowColorsbefore using that path; do not repair an older package's rendering order with host CSS or private imports.^1.3.1 - For Make schema tables, apply the platform field-renderer defaults. Text-bearing overflow must show ellipsis, and tooltip is enabled by default only for ellipsized overflow or hidden content; do not require the user to ask for it.
+N - When the object/entity/schema key changes, reset table interaction state and scroll position. Do not carry the previous object's horizontal or vertical scroll into the next object.
- Keep table initialization independent of row count: create the table after container size plus schema/columns are ready, then apply the latest rows with in local mode. In virtual mode, select the page-only or identity-aware callback from the installed public docs and preserve its page/request contract. Empty rows remain valid and must still render headers and the empty state.
setData(latestRows) - For large-data, fast-scroll, or scrollbar-drag virtual loading, follow ; installed-contract selection, request identity, bounded scheduling, stale-request cancellation, pending-page release, atomic total/page writes, and cache limits are delivery requirements for that path.
references/virtual-table-patterns.md - If Track B is in scope, verify the mandatory cell-edit standard before finishing; a non-standard cell editor is not a shippable partial result.
- Add only the capabilities the user explicitly needs now. Pagination, sorting, grouping, and cell editing remain opt-in; Make record-list selection actions are the default through .
make-app-actions - When table-header sorting is requested, use this Skill only for the documented header menu/suffix mechanics and route sorting behavior, , Preset, and records timing to
openWithField.make-app-sort - When Make record-list grouping is requested, use this Skill only for public API mechanics and route grouping behavior, Preset,
GroupTableComponent,record-groups, and leaf-page timing togroupFilter.make-app-group - Before finishing, read the relevant pitfalls reference and verify one concrete table path.
- 确认这是消费端表格集成,而非表格库维护工作。
- 检查包安装情况,并按照以下要求的顺序阅读包的AI文档。结合业务行颜色与选择或悬停效果的集成需要使用已发布的版本契约。
@qfei-design/canvas-table@^1.3.1 - 选择基础轨道Track A或Track C。需要时添加Track B作为编辑增强;可编辑的Make schema表格使用Track C加Track B。
- 对于Make schema表格,在初始化表格前加载并归一化schema字段;根据归一化后的字段类型、schema 以及共享字段类型注册表构建
field.properties和渲染器。IColumn[] - 仅阅读基础轨道的参考文档;如果涉及编辑功能,再阅读主题映射中的Track B参考文档。
- 优先使用包提供的配方/示例作为起点,然后以最小的项目本地差异进行适配。
- 除非用户明确禁用,否则启用表格行默认配置:序号,以及通过
showSN实现的悬停显示查看详情操作。bodyRowHeadSuffixOptions - 对于所有可写的Make记录列表,启用多选功能,并将默认的编辑/删除/批量编辑操作工作流路由至。仅明确标记为只读的列表才禁用此功能。
make-app-actions - CanvasTable 1.3.1发布了业务行颜色契约:显式设置的/
setRowColors颜色在选中和悬停状态下仍然可见,rowStyleOptions会恢复底层行样式或内置背景。使用该功能前请确保依赖版本为clearRowColors;不要通过宿主CSS或私有导入来修复旧版本包的渲染顺序问题。^1.3.1 - 对于Make schema表格,应用平台字段渲染器默认配置。文本溢出时必须显示省略号,且tooltip默认仅在溢出省略或隐藏内容时启用;无需用户额外提出要求。
+N - 当对象/实体/schema键发生变化时,重置表格交互状态和滚动位置。不要将上一个对象的水平或垂直滚动状态带到下一个对象。
- 表格初始化应与行数无关:在容器尺寸和schema/列都准备就绪后创建表格,然后在本地模式下通过应用最新行数据。在虚拟模式下,从已安装的公共文档中选择仅分页或带身份感知的回调,并遵守其分页/请求契约。空行是有效的表格状态,必须仍然渲染表头和空状态。
setData(latestRows) - 对于大数据、快速滚动或滚动条拖拽的虚拟加载场景,请遵循;该路径的交付要求包括:符合安装契约的选择功能、请求身份、受限调度、过期请求取消、待处理页面释放、原子化总数/页码写入以及缓存限制。
references/virtual-table-patterns.md - 如果涉及Track B,完成前请验证强制性的单元格编辑标准;不符合标准的单元格编辑器不是可交付的半成品结果。
- 仅添加用户当前明确需要的能力。分页、排序、分组和单元格编辑都是按需启用的;Make记录列表的选择操作默认通过实现。
make-app-actions - 当需要表头排序时,本技能仅处理已文档化的表头菜单/后缀机制,并将排序行为、、Preset和记录时序路由至
openWithField。make-app-sort - 当需要Make记录列表分组时,本技能仅处理的公共API机制,并将分组行为、Preset、
GroupTableComponent、record-groups和叶子页时序路由至groupFilter。make-app-group - 完成前,请阅读相关的陷阱参考文档,并验证一条具体的表格路径。
Do not use this skill for
本技能不适用场景
- publishing
@qfei-design/canvas-table - editing the table library itself
- generating or keeping another product table implementation instead of
@qfei-design/canvas-table - maintaining ,
package.ai.json, examples, or docs inside the table library reporecipes.json - configuring private npm registries
- treating grouped-table architecture as the default answer
- forcing a new UI component library into a project that already has an editor/component system
- designing or generating Make DSL YAML; use for schema modeling
makedsl - designing Service routes, server disconnect handling, or downstream cancellation adapters; use
make-app-service
- 发布
@qfei-design/canvas-table - 编辑表格库本身
- 生成或保留其他产品级表格实现而非使用
@qfei-design/canvas-table - 维护表格库仓库中的、
package.ai.json、示例或文档recipes.json - 配置私有npm注册表
- 将分组表格架构作为默认方案
- 在已有编辑器/组件系统的项目中强制引入新的UI组件库
- 设计或生成Make DSL YAML;schema建模请使用
makedsl - 设计服务路由、服务端断开处理或下游取消适配器;请使用
make-app-service
Pre-flight check
预检查
Before editing code:
- Confirm is installed in the current project.
@qfei-design/canvas-table - If there is no , stop and tell the user the current directory is not an npm package.
package.json - If the package is missing, detect the package manager from the lockfile and install it before continuing:
- :
pnpm-lock.yaml- Make App: for a new App or explicit runtime migration, verify the baseline
make-app-runtime, Node.js"packageManager": "pnpm@10.20.0", and Corepack22.20.0, then run0.34.0. For an existing Make App, preserve its declared runtime and use Corepack to resolve that declared pnpm version; do not migrate the runtime merely to add CanvasTable.corepack pnpm add @qfei-design/canvas-table - non-Make pnpm project: run and preserve the project's existing package-manager workflow; do not introduce Corepack solely for this integration.
pnpm add @qfei-design/canvas-table
- Make App: for a new App or explicit runtime migration, verify the
- ->
yarn.lockyarn add @qfei-design/canvas-table - ->
package-lock.jsonnpm install @qfei-design/canvas-table
- If no lockfile exists:
- Make App: a new App or explicit runtime migration must first establish the baseline, then run
make-app-runtime. For an existing Make App with no lockfile, stop and hand the package-manager, workspace and CI/install workflow reconciliation tocorepack pnpm add @qfei-design/canvas-table; do not assume pnpm, generate a lockfile, or migrate the runtime merely to add CanvasTable.make-app-runtime - non-Make project: default to .
npm install @qfei-design/canvas-table
- Make App: a new App or explicit runtime migration must first establish the
- If install fails, stop and report the command and error.
Use consistently. If an existing codebase uses a different package name, stop and ask before changing the consumer app dependency.
@qfei-design/canvas-tableIf an existing Make record list uses another table component, the expected integration target is still . Do not preserve a UI-library table as the main record table unless the user explicitly says this page is out of scope for canvas-table.
@qfei-design/canvas-table编辑代码前:
- 确认当前项目已安装。
@qfei-design/canvas-table - 如果没有,停止并告知用户当前目录不是npm包。
package.json - 如果缺少该包,从锁文件检测包管理器并安装后再继续:
- :
pnpm-lock.yaml- Make App:对于新应用或明确的运行时迁移,先验证基线:
make-app-runtime、Node.js"packageManager": "pnpm@10.20.0"和Corepack22.20.0,然后运行0.34.0。对于现有Make App,保留其声明的运行时,使用Corepack解析声明的pnpm版本;不要仅仅为了添加CanvasTable而迁移运行时。corepack pnpm add @qfei-design/canvas-table - 非Make pnpm项目:运行,保留项目现有的包管理器工作流;不要仅仅为了本次集成就引入Corepack。
pnpm add @qfei-design/canvas-table
- Make App:对于新应用或明确的运行时迁移,先验证
- ->
yarn.lockyarn add @qfei-design/canvas-table - ->
package-lock.jsonnpm install @qfei-design/canvas-table
- 如果没有锁文件:
- Make App:新应用或明确的运行时迁移必须先建立基线,然后运行
make-app-runtime。对于没有锁文件的现有Make App,停止并将包管理器、工作区和CI/安装工作流的协调工作交给corepack pnpm add @qfei-design/canvas-table处理;不要仅仅为了添加CanvasTable就假设使用pnpm、生成锁文件或迁移运行时。make-app-runtime - 非Make项目:默认使用。
npm install @qfei-design/canvas-table
- Make App:新应用或明确的运行时迁移必须先建立
- 如果安装失败,停止并报告命令和错误信息。
请始终一致使用。如果现有代码库使用不同的包名,在修改消费端应用依赖前请先停止并询问用户。
@qfei-design/canvas-table如果现有Make记录列表使用其他表格组件,预期的集成目标仍然是。除非用户明确说明该页面不在canvas-table的适用范围内,否则不要保留UI库表格作为主要的记录表格。
@qfei-design/canvas-tableRequired read procedure
必读流程
- Locate the installed package root, or the source package root whose name is
package.json.@qfei-design/canvas-table - Read first.
<package-root>/package.ai.json - Parse , resolve each entry relative to the package root, and verify every declared file exists.
package.ai.json.readOrder - Read the remaining entries in the declared order, skipping the already-read entry.
package.ai.json
package.ai.json.readOrderdocs/examples/- 找到已安装的包根目录,或名称为
package.json的源码包根目录。@qfei-design/canvas-table - 首先阅读。
<package-root>/package.ai.json - 解析,将每个条目相对于包根目录解析,并验证每个声明的文件都存在。
package.ai.json.readOrder - 按照声明的顺序阅读剩余条目,跳过已读过的条目。
package.ai.json
package.ai.json.readOrderdocs/examples/Topic reference map
主题参考映射
| Task / topic | Read |
|---|---|
| Public props, methods, events, setup, cleanup | |
| Row-head sequence number or open-detail action | |
| Make record-list default selection and edit/delete/batch-edit actions | Use |
| Virtual loading, paginated backend integration, large-data fast scrolling, or scrollbar dragging | |
Schema/meta to | |
| Custom clickable cell shapes | |
| Track A pitfalls | |
| Cell-edit contract | |
| Host-side edit architecture | |
| Edit lifecycle, positioning, close/commit/rollback | |
| Platform Make editable-cell defaults | |
| Field editor mapping | |
| Host component choice | |
| Attachment editor integration | |
| Track B pitfalls | |
| Make field display | |
| Proven downstream usage and unvalidated areas | |
| Track workflows, capability checklists, output templates | |
| Table-header asc/desc behavior, shared sort panel, Preset and records sort | Use |
| Make record grouping, Preset group, record-groups, groupFilter, grouped leaf pagination | Use |
Service route cancellation, server disconnect handling, downstream | Use |
| 任务/主题 | 参考文档 |
|---|---|
| 公共属性、方法、事件、初始化、清理 | |
| 行头序号或查看详情操作 | |
| Make记录列表默认选择与编辑/删除/批量编辑操作 | 使用 |
| 虚拟加载、分页后端集成、大数据快速滚动或滚动条拖拽 | |
Schema/元数据转 | |
| 自定义可点击单元格形状 | |
| Track A 常见陷阱 | |
| 单元格编辑契约 | |
| 宿主端编辑架构 | |
| 编辑生命周期、定位、关闭/提交/回滚 | |
| 平台Make可编辑单元格默认配置 | |
| 字段编辑器映射 | |
| 宿主组件选择 | |
| 附件编辑器集成 | |
| Track B 常见陷阱 | |
| Make字段展示 | |
| 已验证的下游用法和未验证领域 | |
| 轨道工作流、能力检查清单、输出模板 | |
| 表头升序/降序行为、共享排序面板、Preset和记录排序 | 使用 |
Make记录分组、Preset分组、 | 使用 |
服务路由取消、服务端断开处理、下游 | 使用 |
For base Track A
基础轨道 Track A
Read as needed:
references/core-props-methods-events.md- when adding an icon or action to the body row head / sequence-number area
references/row-head-action-patterns.md - when using paginated virtual loading, especially for large data, fast scrolling, or scrollbar dragging
references/virtual-table-patterns.md - when shaping columns
references/column-patterns.md - when adding custom clickable cell content
references/shape-render-patterns.md - before finalizing changes
references/common-pitfalls.md
按需阅读:
references/core-props-methods-events.md- 当在表体行头/序号区域添加图标或操作时,阅读
references/row-head-action-patterns.md - 使用分页虚拟加载时(尤其是大数据、快速滚动或滚动条拖拽场景),阅读
references/virtual-table-patterns.md - 构建列时,阅读
references/column-patterns.md - 添加自定义可点击单元格内容时,阅读
references/shape-render-patterns.md - 最终确定更改前,阅读
references/common-pitfalls.md
For base Track C
基础轨道 Track C
Read:
references/make-field-display-patterns.md- when adding canvas shapes
references/shape-render-patterns.md - when deriving
references/column-patterns.mdfrom field schemasIColumn[] - before finalizing changes
references/common-pitfalls.md
阅读:
references/make-field-display-patterns.md- 添加canvas形状时,阅读
references/shape-render-patterns.md - 从字段schema推导时,阅读
IColumn[]references/column-patterns.md - 最终确定更改前,阅读
references/common-pitfalls.md
Add Track B for cell editing
添加 Track B 实现单元格编辑
Read in this order:
- the selected base-track references; Make schema editable tables must preserve the Track C display baseline
- package-level cell-edit docs declared by
package.ai.json.readOrder references/edit-contract.mdreferences/edit-host-architecture.mdreferences/edit-interaction-lifecycle.mdreferences/make-cell-edit-defaults.mdreferences/field-editor-patterns.mdreferences/editor-component-selection.md- when attachment fields are in scope
references/attachment-editor-patterns.md - before finalizing changes
references/edit-common-pitfalls.md
If any required package file is missing, stop and tell the user exactly which file is missing.
按以下顺序阅读:
- 所选基础轨道的参考文档;Make schema可编辑表格必须保留Track C的展示基线
- 中声明的包级单元格编辑文档
package.ai.json.readOrder references/edit-contract.mdreferences/edit-host-architecture.mdreferences/edit-interaction-lifecycle.mdreferences/make-cell-edit-defaults.mdreferences/field-editor-patterns.mdreferences/editor-component-selection.md- 涉及附件字段时,阅读
references/attachment-editor-patterns.md - 最终确定更改前,阅读
references/edit-common-pitfalls.md
如果任何必需的包文件缺失,请停止并明确告知用户缺失的文件。
Track composition
轨道组合规则
- Track A and Track C are mutually exclusive display bases.
- Track B is an enhancement layer, not a replacement base.
- A non-Make editable table uses Track A plus Track B.
- A Make schema editable table uses Track C plus Track B so display normalization and renderer behavior remain intact while editing is added.
- Detailed workflows, capability checklists, and field groupings live in and
references/track-workflows.md.references/make-field-display-patterns.md
- Track A和Track C是互斥的展示基础轨道。
- Track B是增强层,而非替代基础轨道。
- 非Make可编辑表格使用Track A加Track B。
- Make schema可编辑表格使用Track C加Track B,这样在添加编辑功能的同时,展示归一化和渲染器行为保持不变。
- 详细工作流、能力检查清单和字段分组请参见和
references/track-workflows.md。references/make-field-display-patterns.md
Safety rules and defaults
安全规则与默认配置
Treat these as safety rules:
- browser / client-only; never instantiate during SSR
- use a real DOM container with explicit width and height
- use only documented public APIs
- never import from or
srcdist - use for product tables; do not substitute UI-library tables
@qfei-design/canvas-table - use as the namespace key for
table.tableIdglobalEventBus.onWithNamespace(...) - destroy the table instance on unmount / cleanup
- reset scroll and transient table state when switching object/entity/schema routes. Reusing the same React component for is fine only if the table is keyed by that identity or the integration explicitly resets the canvas-table instance/state on identity change
/objects/:objectKey - never pass raw meta directly into the table runtime
- convert meta into before creating the table
IColumn[] - for Make schema tables, do not create the table with generic placeholder columns or row-key-inferred columns while waiting for schema
- do not use ,
records.length, or business totals as the gate for creating the table. Empty rows are a valid table state: keep headers visible and show the built-in empty state afterrows.lengthsetData([]) - when rows can arrive before the CanvasTable instance is ready, store the latest rows and call immediately after instance creation; do not let early data updates disappear because
setData(latestRows)wastableRef.currentnull - never render numeric parser failures as ,
NaN, or exception text; normalize them to an empty display value before canvas renderingInfinity - never accept formatted currency or percent text as the normal backend contract. Values such as strings containing ,
¥,¥, or thousands separators are dependency defects; render%or surface the data-contract issue instead of silently treating them as API-ready values- - for Make schema tables, preserve normalized on generated columns/edit configs so renderers and editors can use
field.properties,Number.precision,Date.format,DateRange.begin/end,Currency.symbol/decimalPlaces/useGrouping,Percent.decimalPlaces, and multi identityFile.maxCountmaxCount - number, currency, and percent cell editors must preserve raw plain-decimal input text and enforce ,
Number.precision, orCurrency.decimalPlacesbefore parsing and commit. Decimal overflow keeps the editor active, showsPercent.decimalPlacesthrough a tooltip or external validation surface, and must not call the save API; silent rounding is forbidden unless the host project explicitly documents it最多保留 N 位小数 - numeric cell editors must keep the last committed digits intact during invalid IME composition and must not commit the cell when Enter is used to choose an unfinished IME candidate. Follow the numeric editor behavior and verification guidance in
references/field-editor-patterns.md - do not put or
aria-hiddenon the visual canvas-table host, or on any ancestor that can contain the package-created focusable canvasinert - if a screen-reader fallback table is needed, keep it as a separate visually-hidden structure and give the visual host its own non-hidden accessible label
- pagination is opt-in: do not add visible pagination controls, page-size selectors, page state, page query params, total-count handling, paginated fetch logic, , or
virtualOptionswiring unless the user explicitly asks for pagination, virtual loading, or paginated backend integrationdata:load - when installed docs expose a virtual-page request context, claim it synchronously and pass the same request to the network signal plus /
setDataorsetVirtualPageData; use the legacy page-only path only when that is the installed public contractmarkPageLoadFailed - virtual loading failures and cancellations must release the package pending-page marker through the installed package's documented public API; large-data or fast-scroll paths must also use a bounded host scheduler instead of firing every transient viewport page immediately
- sorting is opt-in: when requested, expose header asc/desc only through the host's documented CanvasTable header menu/suffix API, then call the shared controller. Do not sort records locally, keep separate header sort state, or call records directly from a header action
make-app-sort - grouping is opt-in: for Make record lists, use for the package panel, Preset, Service,
make-app-group, and records timing. This Skill may instantiategroupFilterand wireGroupTableComponent/group:load, but must not define grouping semantics itselfgroup:data:load - Make record actions are default: this Skill wires public selection snapshots, , supported Shift/select-all behavior, and row colors;
clearSelectionowns action state, permissions, precheck, batch modal, and mutation timing. Under the CanvasTable 1.3.1 contract,make-app-actionsdoes not support Shift range selection; do not emulate it in the hostGroupTableComponent - Treat CanvasTable 1.3.1 semantic row-color precedence and cleanup as the minimum record-action contract: business row colors must remain visible above selection and hover, and command colors must be removed with documented .
clearRowColors(rowKeys)is not a cleanup fallback. RequiresetRowColors(rowKeys, undefined)instead of overriding canvas internals in the host@qfei-design/canvas-table@^1.3.1 - For ordinary Make record lists, one Shift range-selection gesture may select at most 200 records. Enforce the limit only through the installed public selection contract; if that capability is absent, report a blocker instead of implementing host keyboard anchors, range expansion, or private selection state
CanvasTableComponent
请将以下内容视为安全规则:
- 仅支持浏览器/客户端;永远不要在SSR期间实例化
- 使用具有显式宽高的真实DOM容器
- 仅使用已文档化的公共API
- 永远不要从或
src导入dist - 产品级表格使用;不要替换为UI库表格
@qfei-design/canvas-table - 使用作为
table.tableId的命名空间键globalEventBus.onWithNamespace(...) - 卸载/清理时销毁表格实例
- 切换对象/实体/schema路由时,重置滚动和临时表格状态。仅当表格以该身份为键,或集成在身份变化时显式重置canvas-table实例/状态的情况下,才可以为复用同一个React组件
/objects/:objectKey - 永远不要将原始元数据直接传入表格运行时
- 创建表格前将元数据转换为
IColumn[] - 对于Make schema表格,不要在等待schema时使用通用占位符列或由行键推断的列创建表格
- 不要使用、
records.length或业务总数作为创建表格的判断条件。空行是有效的表格状态:保持表头可见,并在rows.length后显示内置空状态setData([]) - 当行数据可能在CanvasTable实例准备好之前到达时,存储最新行数据,并在实例创建后立即调用;不要因为
setData(latestRows)为tableRef.current而导致早期数据更新丢失null - 永远不要将数字解析失败的结果渲染为、
NaN或异常文本;在canvas渲染前将其归一化为空展示值Infinity - 永远不要将格式化的货币或百分比文本作为正常的后端契约。包含、
¥、¥或千位分隔符的字符串等值属于依赖缺陷;请渲染%或暴露数据契约问题,而不是静默将其视为可用的API值- - 对于Make schema表格,在生成的列/编辑配置中保留归一化的,以便渲染器和编辑器可以使用
field.properties、Number.precision、Date.format、DateRange.begin/end、Currency.symbol/decimalPlaces/useGrouping、Percent.decimalPlaces以及多身份File.maxCountmaxCount - 数字、货币和百分比单元格编辑器必须保留原始纯十进制输入文本,并在解析和提交前强制执行、
Number.precision或Currency.decimalPlaces限制。小数溢出时保持编辑器激活状态,通过tooltip或外部验证表面显示Percent.decimalPlaces,且不得调用保存API;除非宿主项目明确文档化,否则禁止静默四舍五入最多保留 N 位小数 - 数字单元格编辑器在IME组合无效时必须保留最后一次提交的数字不变,且不得在用户使用Enter选择未完成的IME候选词时提交单元格。请遵循中的数字编辑器行为和验证指南
references/field-editor-patterns.md - 不要在可视化canvas-table宿主元素上,或任何可能包含包创建的可聚焦canvas的祖先元素上设置或
aria-hiddeninert - 如果需要屏幕阅读器备用表格,请将其作为单独的视觉隐藏结构,并为可视化宿主提供自身的非隐藏可访问标签
- 分页是按需启用的:不要添加可见的分页控件、页大小选择器、页面状态、页面查询参数、总数处理、分页获取逻辑、或
virtualOptions绑定,除非用户明确要求分页、虚拟加载或分页后端集成data:load - 当已安装的文档暴露虚拟页面请求上下文时,同步获取该上下文,并将相同的请求传递给网络信号以及/
setData或setVirtualPageData;仅当已安装的公共契约是旧的仅分页路径时才使用该路径markPageLoadFailed - 虚拟加载失败和取消必须通过已安装包的文档化公共API释放包的待处理页面标记;大数据或快速滚动路径还必须使用受限的宿主调度器,而不是立即触发每个瞬时视口页面请求
- 排序是按需启用的:需要时,仅通过宿主文档化的CanvasTable表头菜单/后缀API暴露表头升序/降序,然后调用共享的控制器。不要本地排序记录、维护单独的表头排序状态,或从表头操作直接调用记录接口
make-app-sort - 分组是按需启用的:对于Make记录列表,使用处理包面板、Preset、服务、
make-app-group和记录时序。本技能可以实例化groupFilter并绑定GroupTableComponent/group:load,但不得自行定义分组语义group:data:load - Make记录操作是默认启用的:本技能绑定公共选择快照、、支持的Shift/全选行为以及行颜色;
clearSelection负责操作状态、权限、预检查、批量弹窗和变更时序。根据CanvasTable 1.3.1契约,make-app-actions不支持Shift范围选择;不要在宿主中模拟该功能GroupTableComponent - 将CanvasTable 1.3.1的语义行颜色优先级和清理视为最低记录操作契约:业务行颜色必须在选中和悬停状态下仍然可见,且命令颜色必须通过文档化的移除。
clearRowColors(rowKeys)不能作为清理备用方案。请要求使用setRowColors(rowKeys, undefined),而不是在宿主中覆盖canvas内部实现@qfei-design/canvas-table@^1.3.1 - 对于普通的Make 记录列表,一次Shift范围选择手势最多可选择200条记录。仅通过已安装的公共选择契约强制执行该限制;如果不具备该能力,请报告阻塞项,而不是实现宿主键盘锚点、范围扩展或私有选择状态
CanvasTableComponent
Detailed workflows and maintenance references
详细工作流与维护参考
- For track workflows, capability checklists, avoid lists, deferred topics, and final response templates, read .
references/track-workflows.md - Before using a capability that is not obviously covered by the current project or package docs, read to distinguish validated downstream patterns from less-proven package capabilities.
references/validated-usage-notes.md
- 有关轨道工作流、能力检查清单、禁止列表、延迟主题和最终响应模板,请阅读。
references/track-workflows.md - 在使用当前项目或包文档未明确涵盖的能力前,请阅读,以区分已验证的下游模式和未经验证的包能力。
references/validated-usage-notes.md