@canvas-components/react-list-table 0.3.53 → 0.3.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -252,6 +252,29 @@ const printPresets: ReactListTablePrintPreset[] = [
252
252
 
253
253
  右键直接打印(包括选择模板打印)会先显示“每次打印页数”设置,默认每批 50 页。可通过 `directPrintPagesPerBatch={20}` 修改默认值,用户仍可在开始前调整。每批只生成并加载指定数量的实际打印页(包括自动续页),关闭浏览器打印窗口后释放该批 iframe;点击“继续下一批”才生成后续批次,也可以取消剩余任务。浏览器无法区分打印窗口中的“打印”和“取消”,因此批次之间不会自动继续。
254
254
 
255
+ ### 应用级打印设计集成
256
+
257
+ 在应用根部注册一次打印设计集成,该范围内的所有 `ReactListTable` 共用组件和工具入口;每张表仍使用自己的打印数据、预设和 `storageKey`。未放置 Provider 时不显示打印设计入口。
258
+
259
+ ```tsx
260
+ import {
261
+ ReactListTablePrintProvider,
262
+ defineReactListTablePrintIntegration,
263
+ } from "@canvas-components/react-list-table";
264
+ import { builtinListTablePrintIntegration } from "@canvas-components/print-design-plugin/list-table-print";
265
+ import "@canvas-components/print-design-plugin/style.css";
266
+
267
+ const integration = defineReactListTablePrintIntegration(
268
+ builtinListTablePrintIntegration,
269
+ );
270
+
271
+ <ReactListTablePrintProvider integration={integration}>
272
+ <App />
273
+ </ReactListTablePrintProvider>;
274
+ ```
275
+
276
+ 接入自定义组件时,以 `builtinListTablePrintIntegration` 为基础替换原生注册表和 React 创建器,再调用 `defineReactListTablePrintIntegration` 校验;右键设计器和直接打印会使用这一份集成。集成项还必须提供 `Host`、菜单和模板能力,可复用官方宿主实现,也可自行实现。向 Provider 传入 `null` 可停用该范围内的打印设计入口,表格实例自定义的 `onPrint` 仍可使用。
277
+
255
278
  ```tsx
256
279
  import { useMemo, useRef } from "react";
257
280
  import {