@robot-admin/naive-ui-components 0.40.3 → 0.40.5

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.
Files changed (208) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +101 -79
  3. package/README_EN.md +110 -67
  4. package/dist/BPMN.cjs +1 -1
  5. package/dist/BPMN.js +1 -1
  6. package/dist/C_ActionBar.css +58 -52
  7. package/dist/C_ActionBar2.cjs +1 -1
  8. package/dist/C_ActionBar2.js +1 -1
  9. package/dist/C_AntV.css +108 -108
  10. package/dist/C_AvatarGroup.css +29 -29
  11. package/dist/C_AvatarGroup2.cjs +1 -1
  12. package/dist/C_AvatarGroup2.js +1 -1
  13. package/dist/C_Barcode.css +6 -6
  14. package/dist/C_Barcode.d.cts +2 -2
  15. package/dist/C_Barcode.d.ts +2 -2
  16. package/dist/C_Barcode2.cjs +1 -1
  17. package/dist/C_Barcode2.js +1 -1
  18. package/dist/C_Captcha.css +42 -42
  19. package/dist/C_Captcha2.cjs +1 -1
  20. package/dist/C_Captcha2.js +1 -1
  21. package/dist/C_Cascade.css +4 -4
  22. package/dist/C_Cascade.d.cts +2 -2
  23. package/dist/C_Cascade.d.ts +2 -2
  24. package/dist/C_Cascade2.cjs +1 -1
  25. package/dist/C_Cascade2.js +1 -1
  26. package/dist/C_City.css +35 -35
  27. package/dist/C_City2.cjs +1 -1
  28. package/dist/C_City2.js +1 -1
  29. package/dist/C_Code.css +27 -27
  30. package/dist/C_Code.d.cts +2 -2
  31. package/dist/C_Code.d.ts +2 -2
  32. package/dist/C_Code2.cjs +1 -1
  33. package/dist/C_Code2.js +1 -1
  34. package/dist/C_CollapsePanel2.cjs +1 -1
  35. package/dist/C_CollapsePanel2.js +1 -1
  36. package/dist/C_ContextMenu.css +3 -3
  37. package/dist/C_ContextMenu2.cjs +1 -1
  38. package/dist/C_ContextMenu2.js +1 -1
  39. package/dist/C_Editor.css +13 -13
  40. package/dist/C_Editor.d.cts +2 -2
  41. package/dist/C_Editor.d.ts +2 -2
  42. package/dist/C_Editor2.cjs +1 -1
  43. package/dist/C_Editor2.js +1 -1
  44. package/dist/C_FilePreview.css +104 -104
  45. package/dist/C_FilePreview2.cjs +1 -1
  46. package/dist/C_FilePreview2.js +1 -1
  47. package/dist/C_FormModal.css +58 -52
  48. package/dist/C_GlobalSearch.css +139 -136
  49. package/dist/C_GlobalSearch2.cjs +1 -1
  50. package/dist/C_GlobalSearch2.js +1 -1
  51. package/dist/C_Guide.css +3 -3
  52. package/dist/C_Guide2.cjs +1 -1
  53. package/dist/C_Guide2.js +1 -1
  54. package/dist/C_Language.css +2 -2
  55. package/dist/C_Language2.cjs +1 -1
  56. package/dist/C_Language2.js +1 -1
  57. package/dist/C_Login.css +136 -121
  58. package/dist/C_Login2.cjs +1 -1
  59. package/dist/C_Login2.js +1 -1
  60. package/dist/C_Markdown.css +37 -37
  61. package/dist/C_Markdown.d.cts +2 -2
  62. package/dist/C_Markdown.d.ts +2 -2
  63. package/dist/C_Markdown2.cjs +1 -1
  64. package/dist/C_Markdown2.js +1 -1
  65. package/dist/C_NotificationCenter.css +51 -36
  66. package/dist/C_NotificationCenter2.cjs +1 -1
  67. package/dist/C_NotificationCenter2.js +1 -1
  68. package/dist/C_Progress.d.cts +2 -2
  69. package/dist/C_Progress.d.ts +2 -2
  70. package/dist/C_Progress2.cjs +1 -1
  71. package/dist/C_Progress2.js +1 -1
  72. package/dist/C_Signature.css +15 -15
  73. package/dist/C_Signature2.cjs +1 -1
  74. package/dist/C_Signature2.js +1 -1
  75. package/dist/C_Steps.css +39 -39
  76. package/dist/C_Steps.d.cts +2 -2
  77. package/dist/C_Steps.d.ts +2 -2
  78. package/dist/C_Steps2.cjs +1 -1
  79. package/dist/C_Steps2.js +1 -1
  80. package/dist/C_Table.base.css +58 -52
  81. package/dist/C_Table.css +58 -52
  82. package/dist/C_Table2.cjs +2 -2
  83. package/dist/C_Table2.js +2 -2
  84. package/dist/C_TagsView.css +60 -50
  85. package/dist/C_TagsView2.cjs +1 -1
  86. package/dist/C_TagsView2.js +1 -1
  87. package/dist/C_Timeline.css +53 -53
  88. package/dist/C_Timeline2.cjs +1 -1
  89. package/dist/C_Timeline2.js +1 -1
  90. package/dist/C_Upload2.cjs +1 -1
  91. package/dist/C_Upload2.js +1 -1
  92. package/dist/C_WaterFall.css +41 -41
  93. package/dist/C_WaterFall.d.cts +2 -2
  94. package/dist/C_WaterFall.d.ts +2 -2
  95. package/dist/C_WaterFall2.cjs +1 -1
  96. package/dist/C_WaterFall2.js +1 -1
  97. package/dist/C_WorkFlow.css +93 -92
  98. package/dist/C_WorkFlow2.cjs +1 -1
  99. package/dist/C_WorkFlow2.js +1 -1
  100. package/dist/ER.cjs +1 -1
  101. package/dist/ER.js +1 -1
  102. package/dist/UML.cjs +3 -3
  103. package/dist/UML.js +3 -3
  104. package/dist/component-config.d.ts +2 -0
  105. package/dist/constants.d.cts +1 -1
  106. package/dist/constants.d.ts +1 -1
  107. package/dist/constants3.d.cts +6 -6
  108. package/dist/constants3.d.ts +6 -6
  109. package/dist/constants4.d.cts +5 -5
  110. package/dist/constants4.d.ts +5 -5
  111. package/dist/context.d.cts +2 -0
  112. package/dist/data2.d.cts +7 -7
  113. package/dist/data2.d.ts +7 -7
  114. package/dist/editors.d.cts +8 -8
  115. package/dist/editors.d.ts +8 -8
  116. package/dist/graphEditSession.cjs +1 -0
  117. package/dist/graphEditSession.js +1 -0
  118. package/dist/index.d.cts +9 -10
  119. package/dist/index.d.ts +9 -9
  120. package/dist/index.vue.d.cts +3 -3
  121. package/dist/index.vue.d.ts +3 -3
  122. package/dist/index10.vue.d.cts +0 -1
  123. package/dist/index10.vue.d.ts +12 -9
  124. package/dist/index11.vue.d.cts +12 -9
  125. package/dist/index11.vue.d.ts +4 -4
  126. package/dist/index12.vue.d.cts +4 -4
  127. package/dist/index13.vue.d.ts +19 -16
  128. package/dist/index14.vue.d.cts +19 -16
  129. package/dist/index16.vue.d.ts +5 -10
  130. package/dist/index17.vue.d.cts +5 -10
  131. package/dist/index17.vue.d.ts +6 -6
  132. package/dist/index18.vue.d.cts +6 -6
  133. package/dist/index18.vue.d.ts +2 -7
  134. package/dist/index19.vue.d.cts +2 -7
  135. package/dist/index19.vue.d.ts +1 -1
  136. package/dist/index20.vue.d.cts +1 -1
  137. package/dist/index20.vue.d.ts +0 -1
  138. package/dist/index21.vue.d.cts +0 -1
  139. package/dist/index21.vue.d.ts +18 -16
  140. package/dist/index22.vue.d.cts +18 -16
  141. package/dist/index24.vue.d.cts +10 -7
  142. package/dist/index24.vue.d.ts +10 -7
  143. package/dist/index27.vue.d.cts +2 -2
  144. package/dist/index27.vue.d.ts +2 -2
  145. package/dist/index28.vue.d.cts +12 -19
  146. package/dist/index28.vue.d.ts +12 -19
  147. package/dist/index3.vue.d.cts +2 -2
  148. package/dist/index3.vue.d.ts +2 -2
  149. package/dist/index30.vue.d.cts +2 -9
  150. package/dist/index30.vue.d.ts +2 -9
  151. package/dist/index31.vue.d.cts +4 -4
  152. package/dist/index31.vue.d.ts +4 -4
  153. package/dist/index32.vue.d.cts +2 -2
  154. package/dist/index32.vue.d.ts +2 -2
  155. package/dist/index4.vue.d.cts +13 -10
  156. package/dist/index4.vue.d.ts +13 -10
  157. package/dist/index7.vue.d.ts +12 -12
  158. package/dist/index8.vue.d.cts +12 -12
  159. package/dist/index9.vue.d.ts +0 -1
  160. package/dist/mapUtils.d.cts +2 -2
  161. package/dist/mapUtils.d.ts +2 -2
  162. package/dist/presets.d.cts +1 -1
  163. package/dist/presets.d.ts +1 -1
  164. package/dist/serializeSearch.cjs +1 -1
  165. package/dist/serializeSearch.js +1 -1
  166. package/dist/style.css +1056 -1006
  167. package/dist/types.d.cts +1 -0
  168. package/dist/types.d.ts +1 -0
  169. package/dist/useCalendarEvents.d.cts +1 -1
  170. package/dist/useCalendarEvents.d.ts +1 -1
  171. package/dist/useCollapsePanel.d.cts +5 -5
  172. package/dist/useCollapsePanel.d.ts +5 -5
  173. package/dist/useCropperCore.d.cts +6 -6
  174. package/dist/useCropperCore.d.ts +6 -6
  175. package/dist/useEdgeInteraction.d.cts +1 -1
  176. package/dist/useEdgeInteraction.d.ts +1 -1
  177. package/dist/useFullscreen.d.cts +2 -2
  178. package/dist/useFullscreen.d.ts +2 -2
  179. package/dist/useGlobalSearch.d.cts +1 -5
  180. package/dist/useGlobalSearch.d.ts +1 -5
  181. package/dist/useInfiniteScroll.d.cts +42 -70
  182. package/dist/useInfiniteScroll.d.ts +42 -70
  183. package/dist/useQRCode.d.cts +5 -5
  184. package/dist/useQRCode.d.ts +5 -5
  185. package/dist/useScopedComponentLocale.cjs +1 -0
  186. package/dist/useScopedComponentLocale.js +1 -0
  187. package/dist/useSignatureHistory.d.cts +11 -6
  188. package/dist/useSignatureHistory.d.ts +11 -6
  189. package/dist/useSplitResize.d.cts +4 -4
  190. package/dist/useSplitResize.d.ts +4 -4
  191. package/dist/useTimeSelection.d.cts +3 -3
  192. package/dist/useTimeSelection.d.ts +3 -3
  193. package/dist/useWorkflowValidation.d.cts +89 -84
  194. package/dist/useWorkflowValidation.d.ts +89 -84
  195. package/dist/verification.d.cts +6 -6
  196. package/dist/verification.d.ts +6 -6
  197. package/docs/component-audit-closure-0.40.4.md +62 -0
  198. package/docs/engineering.en.md +6 -0
  199. package/docs/engineering.md +6 -0
  200. package/docs/guides/api-migration.md +17 -1
  201. package/docs/guides/search-workflows.md +2 -0
  202. package/docs/guides/transfer.md +2 -0
  203. package/docs/guides/usage.en.md +15 -1
  204. package/docs/guides/usage.md +24 -1
  205. package/docs/guides/workflow.md +5 -1
  206. package/package.json +1 -1
  207. package/dist/readonlyGraph.cjs +0 -1
  208. package/dist/readonlyGraph.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @robot-admin/naive-ui-components
2
2
 
3
+ ## 0.40.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 重整中英文 README 的能力地图、组件选择与配置接入示例,补齐公开 Props 和瀑布流业务字段推导;明确迁移、编译器与消费环境边界,清理过期的历史说明。文档示例经正式声明编译验证,组件运行时、样式和公开 API 保持 0.40.4 行为。
8
+
9
+ ## 0.40.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 修复图形编辑与验证码换源后的旧会话、表格公开子行选择和搜索历史范围隔离;文件预览正确处理 Word 多实例目录和 Excel 跨页合并区域,审批设计器补齐连线点击与预览确认一致性。
14
+ - 签名单点绘制及橡皮尺寸真正生效,保留旧笔画回放效果;进度动画保留小数终点,时间线复用静态内容净化结果并支持已有标签状态,上传分片进度改为增量统计。
15
+ - 补齐搜索面板焦点、标签/消息/登录入口和折叠面板键盘交互,修复动态功能开关;默认辅助文案沿用应用语言,显式文案及旧登录翻译接入保持兼容。
16
+ - 为简单组件导出单一来源 Props,瀑布流从业务数据推导布局、事件与插槽类型;清理重复私有类型并澄清已有配置语义。保持现有入口及 API 兼容,MachTable 和 Robot_Admin 不在本轮修改范围。
17
+
3
18
  ## 0.40.3
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  <p>
9
9
  <a href="https://www.npmjs.com/package/@robot-admin/naive-ui-components"><img src="https://img.shields.io/npm/v/@robot-admin/naive-ui-components?style=flat-square&amp;color=249D70&amp;labelColor=183C2E" alt="npm version"></a>
10
10
  <a href="./package.json"><img src="https://img.shields.io/badge/Vue-3.5+-249D70?style=flat-square&amp;logo=vue.js&amp;logoColor=white&amp;labelColor=183C2E" alt="Vue 3.5+"></a>
11
- <a href="./package.json"><img src="https://img.shields.io/badge/TypeScript-5.9-3178C6?style=flat-square&amp;logo=typescript&amp;logoColor=white&amp;labelColor=183C2E" alt="TypeScript 5.9"></a>
11
+ <a href="./docs/engineering.md#typescript-构建与消费"><img src="https://img.shields.io/badge/TypeScript-5.9.3-3178C6?style=flat-square&amp;logo=typescript&amp;logoColor=white&amp;labelColor=183C2E" alt="Build: TypeScript 5.9.3"></a>
12
12
  <a href="https://github.com/ChenyCHENYU/naive-ui-components/actions/workflows/ci.yml"><img src="https://github.com/ChenyCHENYU/naive-ui-components/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
13
13
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-64748B?style=flat-square&amp;labelColor=183C2E" alt="MIT License"></a>
14
14
  </p>
@@ -33,42 +33,18 @@
33
33
  | 按需消费 | 63 个独立组件入口、自动导入 Resolver、组件样式入口,以及表单/表格的基础样式层级 |
34
34
  | 独立接入 | 支持全量注册与局部导入;反馈、文案和全局配置可由宿主提供,表单弹窗可接入结构兼容的 Headless CRUD |
35
35
 
36
- 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.40.3**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
36
+ 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.40.5**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
37
37
 
38
- 0.40 新增 `edit: 'inline'` 常显连续录入,收敛动态表单显隐、流程缓存会话与分类查询组合。见[表格编辑指南](./docs/guides/table-editing.md)和[真实业务场景对照](./docs/wl-business-scenario-parity.md);已有项目可参考[兼容接入与独立演示](./docs/guides/component-contracts.md)。
39
-
40
- 0.34 完善树的动态图标、自定义节点状态与操作配置,以及组织架构图的数据映射、受控交互和连线。目录选择使用 `C_Tree`,卡片式汇报关系使用独立的 `C_OrgChart`。见[组织场景示例](./docs/guides/tree-org-examples.md)。
41
-
42
- 0.36 增加组织人员选择入口 `C_UserPicker`,共用分页、草稿和确认机制;完善审批节点端口、显式条件分支及统一选人配置。见[人员选择](./docs/guides/user-picker.md)与[工作流设计](./docs/guides/workflow.md)。
43
-
44
- 搜索条件、录入字段和操作按钮可以由响应式配置生成。筛选和编辑共享紧凑密度,支持校验、异步选项和业务弹窗。后端字典或权限由项目接入,表单和搜索消费普通选项,表格消费普通列配置。
45
-
46
- `C_Select` 支持独立单选、多选与自由标签。表单和搜索多选共用紧凑标签摘要,日期时间字段可直接读写接口字符串。见[多选与日期时间用法](./docs/guides/data-workflows.md#多选标签和日期时间)。
47
-
48
- 远程选项、自由文本建议和多列实体选择分别使用 `C_Select`、`C_AutoComplete`、`C_DataPicker`,共享请求契约;表单与搜索字段可直接配置 `source`。见[搜索与选择用法](./docs/guides/search-workflows.md#远程选项与自由文本建议)及[产销场景核对](./docs/search-selection-coverage.md)。
49
-
50
- 列表按场景组合 `C_FormSearch`、`C_ActionBar`、`C_FormModal` 和 `C_DataPicker`。同一套表单与搜索可搭配 `C_Table` 或 MachTable,各自使用原生表格配置和分页。见[组合用法](./docs/guides/data-workflows.md#搜索表单与弹窗组合)、[表单密度](./docs/guides/form-density.md)和[运行时性能](./docs/guides/runtime-performance.md)。
51
-
52
- 搜索区用 `columns: 3` 或 `columns: 4` 限定每行字段数,操作按钮保持靠右。表单内的实体选择用 `presentation="inline"` 在原处展开,复杂的进阶查询可通过选择器的 `#query` 插槽接入多个条件。见[搜索区用法](./docs/guides/search-workflows.md)和[数据选择器](./docs/guides/data-picker.md)。
53
-
54
- 设置 `searchOnReset: true`,让重置与搜索共用 `onSearch`。表单选择字段通过 `createDataPickerField` 接入,列表行操作使用 `config.actions.inline`。见[工作台组合](./docs/guides/data-workflows.md)。
38
+ 接入时直接使用组件 props、业务数据和公开类型;复杂表单、查询与弹窗再使用对应组合函数。已有项目见 [0.40.4 接入收敛说明](./docs/guides/api-migration.md#0404-接入收敛),可逐页简化配置,现有兼容入口继续保留。
55
39
 
56
40
  ## 能力地图
57
41
 
58
- `C_Table` 保留 Naive UI 原生空态,继承 Provider 的主题、语言与 `componentOptions.DataTable.renderEmpty`。使用 `#empty` 可替换单个表格的空态内容。
59
-
60
- `C_Table` 窄列编辑时操作组可自然换行,输入保持可见。功能列保持紧凑;普通自动业务列按表头与内容基准比例均衡分配余量,列多时保留基准横向滚动。显式宽度和已保存的列宽偏好继续生效。
61
-
62
- `C_Table` 默认显示序号和分页,数字与其他内容默认居中。通过 `:row-number="false"` 和 `:pagination="false"` 分别关闭自动序号与分页。后端返回列和行可直接绑定,详见[动态表格示例](./docs/guides/usage.md#后端返回列和行)。
63
-
64
- 勾选行默认显示左侧主题色标识,可通过 `--c-table-selected-marker-width: 0px` 关闭。异步导出使用发起时的列、格式化和文件配置,卸载后停止下载。`createComponentTheme({ primary: '#409eff' })` 默认让填充按钮和选中控件使用白色前景;需要其他配色时集中设置 `onSolid`,或在局部 Provider 覆盖,详见[主题标准](./docs/guides/theme.md)。
65
-
66
- 列中声明 `{ type: 'selection' }` 即启用多选,无需再写 `selection: true`。显式全局或单表 `selection: false` / `{ enabled: false }` 继续优先,动态列沿用同一规则。
67
-
68
42
  | 场景 | 代表组件 | 覆盖能力 |
69
43
  | ---------- | ---------------------------------------------------------------- | ------------------------------------------------------------------ |
70
44
  | 数据录入 | `C_Form` · `C_FormModal` · `C_FormSearch` | 动态字段、校验、异步提交、搜索与新增/编辑弹窗 |
71
45
  | 数据操作 | `C_Table` · `C_ActionBar` · `C_Tree` · `C_Transfer` | 分页、树形数据、常显录入、行/单元格编辑、跨页选择、导出与批量操作 |
46
+ | 搜索与选择 | `C_Select` · `C_AutoComplete` · `C_DataPicker` · `C_UserPicker` | 远程选项、文本建议、多列表格选择与组织选人 |
47
+ | 结构与卡片 | `C_OrgChart` · `C_WaterFall` | 汇报关系、响应式卡片布局、长列表窗口化与业务字段推导 |
72
48
  | 专业编辑 | `C_Editor` · `C_Markdown` · `C_Cron` · `C_FormulaEditor` | 富文本、Markdown、Cron 预览、公式编辑与本地试算 |
73
49
  | 流程与计划 | `C_AntV` · `C_WorkFlow` · `C_VtableGantt` · `C_FullCalendar` | ER/BPMN/UML、审批流程、甘特与日历 |
74
50
  | 文件与媒体 | `C_Upload` · `C_FilePreview` · `C_VideoPlayer` · `C_AudioPlayer` | 分片上传、PDF/Word/Excel 预览、音视频播放 |
@@ -78,6 +54,17 @@
78
54
 
79
55
  查看 [全部 63 个组件与依赖](./docs/components.md),或在 [Robot Admin](https://robotadmin.cn) 中体验组件场景。Cron 预览只计算时间,公式只进行本地试算;生产人机验证需接入服务端校验,详见[使用指南](./docs/guides/usage.md)。
80
56
 
57
+ ### 按任务选择组件
58
+
59
+ | 需要完成的任务 | 推荐入口与用法 |
60
+ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
+ | 筛选、编辑与批量操作 | 组合 `C_FormSearch`、`C_FormModal` 与 `C_ActionBar`,共享表单字段和紧凑密度;见[工作台组合](./docs/guides/data-workflows.md) |
62
+ | 选项、文本建议或实体选择 | `C_Select` 选值,`C_AutoComplete` 补全文本,`C_DataPicker` 展示多列实体;远程字段直接配置 `source`,见[搜索与选择](./docs/guides/search-workflows.md) |
63
+ | 目录、汇报关系或人员选择 | 分别使用 `C_Tree`、`C_OrgChart`、`C_UserPicker`;见[组织场景](./docs/guides/tree-org-examples.md)与[人员选择](./docs/guides/user-picker.md) |
64
+ | 表格展示与录入 | `C_Table` 默认带序号和分页;选择列即可启用多选,`config.edit` 切换编辑模式;见[编辑指南](./docs/guides/table-editing.md)与[列宽及密度](./docs/guides/table-density.md) |
65
+
66
+ 表单和搜索可搭配 `C_Table` 或其他表格,各自保留原生列与分页契约。流程、上传、地图等组件提供界面和接入点,真实审批执行、文件服务及平台权限仍由应用负责。
67
+
81
68
  ## 快速开始
82
69
 
83
70
  ### 安装
@@ -144,6 +131,70 @@ bun add vue@^3.5.3 naive-ui@^2.35.0
144
131
 
145
132
  表单内置提交、重置与校验流程。实际保存时,将异步请求放入 `config.onSubmit` 并等待完成;`@submit` 用于完成通知。表单布局、验证规则、弹窗与远程表格示例见[使用指南](./docs/guides/usage.md)。
146
133
 
134
+ ### 直接使用公开 Props
135
+
136
+ 简单组件直接写 props 即可;需要抽出配置时,用组件公开的类型检查字段,无需重复声明接口或增加配置工厂:
137
+
138
+ ```vue
139
+ <script setup lang="ts">
140
+ import {
141
+ C_Progress,
142
+ type ProgressProps,
143
+ } from '@robot-admin/naive-ui-components/C_Progress'
144
+ import '@robot-admin/naive-ui-components/C_Progress/style.css'
145
+
146
+ const progress = {
147
+ percentage: 62.5,
148
+ isAnimation: true,
149
+ } satisfies ProgressProps
150
+ </script>
151
+
152
+ <template>
153
+ <C_Progress v-bind="progress" />
154
+ </template>
155
+ ```
156
+
157
+ `BarcodeProps`、`CascadeProps`、`StepsProps`、`CodeProps`、`EditorProps` 和 `MarkdownProps` 同样可从对应组件子路径导入,字段与组件实际 props 共用声明。
158
+
159
+ ### 瀑布流自动推导业务字段
160
+
161
+ `items` 提供 `id`、`src`、`width`、`height`,其余业务字段自动传递到插槽和事件。无需转换成基础 `WaterFallItem[]`:
162
+
163
+ ```vue
164
+ <script setup lang="ts">
165
+ import { C_WaterFall } from '@robot-admin/naive-ui-components/C_WaterFall'
166
+ import '@robot-admin/naive-ui-components/C_WaterFall/style.css'
167
+
168
+ const products = [
169
+ {
170
+ id: 1,
171
+ src: '/images/product.jpg',
172
+ width: 640,
173
+ height: 480,
174
+ productCode: 'A-01',
175
+ price: 125.5,
176
+ },
177
+ ]
178
+ </script>
179
+
180
+ <template>
181
+ <C_WaterFall :items="products">
182
+ <template #item="{ item, width, height }">
183
+ <img
184
+ :src="item.src"
185
+ :alt="item.productCode"
186
+ :width="width"
187
+ :height="height"
188
+ loading="lazy"
189
+ />
190
+ <p>{{ item.productCode }} · {{ item.price.toFixed(2) }}</p>
191
+ </template>
192
+ </C_WaterFall>
193
+ </template>
194
+ ```
195
+
196
+ 图片路径替换为应用自己的资源。插槽和事件中的条目只读,嵌套 `ref` 保持 Vue 解包语义;编辑时更新应用持有的源数据。长列表、变高卡片与滚动容器配置见[瀑布流指南](./docs/guides/waterfall.md)。
197
+
147
198
  ### 表格偏好按账号隔离
148
199
 
149
200
  应用启动时注册一次。`session` 是项目已有的响应式身份状态,未登录或身份尚未就绪时为 `undefined`:
@@ -206,35 +257,37 @@ Resolver 默认解析到组件子路径;`importStyle` 默认是 `false`,需
206
257
 
207
258
  组件样式入口会加载组合组件及共享设计变量,无需额外导入。手动导入时可选 `C_Form/base.css`、`C_Table/base.css`;完整样式也提供 `full.css` 别名。重型编辑器、流程、地图和媒体组件建议随业务路由加载。完整策略与全量注册示例见[导入指南](./docs/guides/usage.md#导入方式)。
208
259
 
209
- 本轮最小消费构建中,基础表单与展示表格的首屏 JS gzip 分别下降 36.1% 和 34.6%;包含 Vue 与 Naive UI,测量范围及自动体积门禁见[消费体积记录](./docs/performance-0.15.0.md)。
260
+ 仓库按独立入口构建最小消费场景,校验首屏 JS gzip、重型依赖边界和首次打开增量;数据包含 Vue 与 Naive UI,不能相加作为整站体积,也不替代业务页面的交互测量。检查范围见[开发与构建](./docs/engineering.md#开发);[0.15.0 体积记录](./docs/performance-0.15.0.md)仅保留为历史对照。
210
261
 
211
262
  根入口聚合导航组件,运行时也需要 `vue-router`。不使用路由的项目请选择组件子路径,无需因此补装无关可选 peer。
212
263
 
213
264
  ## 文档导航
214
265
 
215
- | 文档 | 内容 |
216
- | -------------------------------------------------------- | ---------------------------------------------------------------- |
217
- | [架构与隔离](./docs/architecture.md) | 依赖边界、实例所有权与独立 Element Plus 演进路线 |
218
- | [组件目录](./docs/components.md) | 63 个组件、外部依赖与各组件的使用边界 |
219
- | [使用指南](./docs/guides/usage.md) | 导入、表单表格、Cron/公式、地图、引导、人机验证、登录与页面加载 |
220
- | [密度与多表工作台](./docs/guides/table-density.md) | 表单/搜索/表格统一密度、编辑模式、分屏与树能力 |
221
- | [主题与视觉标准](./docs/guides/theme.md) | 统一色彩、明暗主题、尺寸层级与局部覆盖,不增加 Provider |
222
- | [大列表与异步任务](./docs/guides/runtime-performance.md) | 自动窗口化、聊天滚动、搜索索引、字幕与图片任务 |
223
- | [瀑布流长列表](./docs/guides/waterfall.md) | 自动窗口化、嵌套滚动、变高卡片与键盘导航 |
224
- | [兼容 API 迁移](./docs/guides/api-migration.md) | 标准模型、应用渲染器与只读迁移检查 |
225
- | [真实场景覆盖](./docs/wl-ui-produce-coverage.md) | wl-ui-produce 对照、可组合能力与需要适配的边界 |
226
- | [稳定性复核](./docs/stability-boundaries-0.40.3.md) | 异步与语言边界、三浏览器回归、固定规模性能与实际覆盖范围 |
227
- | [开发与构建](./docs/engineering.md) | 工程结构、六阶段构建、组件扩展、校验与发布流程 |
228
- | [品牌资源](./docs/assets/README.md) | Robot 系列 Logo、可编辑 SVG 与高清 PNG 封面 |
229
- | [变更记录](./CHANGELOG.md) | 版本更新与兼容变化 |
230
- | [安全策略](./SECURITY.md) | 漏洞报告与维护约定 |
231
-
232
- 本轮依赖审计的两项上游告警见 [2026-10-18 扫描记录](./docs/security-scan-2026-10-18.md);[2026-10-06 记录](./docs/security-scan-2026-10-06.md)保留为历史档案。当前依赖状态以实际运行 `bun run check:audit` 的结果为准。
266
+ | 文档 | 内容 |
267
+ | --------------------------------------------------------------- | ---------------------------------------------------------------- |
268
+ | [架构与隔离](./docs/architecture.md) | 依赖边界、实例所有权与独立 Element Plus 演进路线 |
269
+ | [组件目录](./docs/components.md) | 63 个组件、外部依赖与各组件的使用边界 |
270
+ | [使用指南](./docs/guides/usage.md) | 导入、表单表格、Cron/公式、地图、引导、人机验证、登录与页面加载 |
271
+ | [密度与多表工作台](./docs/guides/table-density.md) | 表单/搜索/表格统一密度、编辑模式、分屏与树能力 |
272
+ | [主题与视觉标准](./docs/guides/theme.md) | 统一色彩、明暗主题、尺寸层级与局部覆盖,不增加 Provider |
273
+ | [大列表与异步任务](./docs/guides/runtime-performance.md) | 自动窗口化、聊天滚动、搜索索引、字幕与图片任务 |
274
+ | [瀑布流长列表](./docs/guides/waterfall.md) | 自动窗口化、嵌套滚动、变高卡片与键盘导航 |
275
+ | [兼容 API 迁移](./docs/guides/api-migration.md) | 0.40.4 接入收敛、标准模型、应用渲染器与只读迁移检查 |
276
+ | [真实场景覆盖](./docs/wl-ui-produce-coverage.md) | wl-ui-produce 对照、可组合能力与需要适配的边界 |
277
+ | [0.40.4 组件审计记录](./docs/component-audit-closure-0.40.4.md) | 该版本的逐组件修复、类型收敛、兼容边界与正式产物验证 |
278
+ | [开发与构建](./docs/engineering.md) | 工程结构、六阶段构建、组件扩展、校验与发布流程 |
279
+ | [品牌资源](./docs/assets/README.md) | Robot 系列 Logo、可编辑 SVG 与高清 PNG 封面 |
280
+ | [变更记录](./CHANGELOG.md) | 版本更新与兼容变化 |
281
+ | [安全策略](./SECURITY.md) | 漏洞报告与维护约定 |
282
+
283
+ 依赖安全以实际锁文件和当次审计为准:`bun run check:audit` 保留原始发现,并核验精确的本地缓解或不受影响证据;`check:audit:raw` 提供原始报告。仓库 overrides 与开发补丁不会自动传给使用侧,应用需审计自己的锁文件。历史扫描不代表当前结果,已打包运行时与消费依赖的边界见[安全策略](./SECURITY.md)。
233
284
 
234
285
  ## 本地开发
235
286
 
236
287
  维护本仓库需要 **Node.js ≥20.19.0**、固定的 **Bun 1.4.2**;CI 按 `.node-version` 与冻结锁文件安装,并校验实际依赖覆盖。消费者的 Bun 最低版本仍为 1.3.14。
237
288
 
289
+ 源码检查与构建使用锁定的 **TypeScript 5.9.3**。CI 另用 **TypeScript 5.8.3** 验证构建后声明的消费兼容性,不代表以 5.8 构建本仓库源码;详见[TypeScript 构建与消费](./docs/engineering.md#typescript-构建与消费)。
290
+
238
291
  ```bash
239
292
  git clone https://github.com/ChenyCHENYU/naive-ui-components.git
240
293
  cd naive-ui-components
@@ -263,34 +316,3 @@ bun run check:audit # 单独运行依赖安全审计,CI 在 verify 前执行
263
316
  ## 许可证
264
317
 
265
318
  [MIT License](./LICENSE) · Made by [CHENY](https://github.com/ChenyCHENYU)
266
-
267
- ## 内容列宽与状态颜色(0.24)
268
-
269
- `C_Table` 未声明 `width` 的业务列默认按表头和显示文字测宽,均匀抽样最多 100 条已加载数据,测量基准默认 80–360px;少列时实际显示宽度可按比例扩展。`minWidth/maxWidth` 可调整边界;显式列宽、原生百分比宽度、列设置后的宽度和 `display.columnWidth` 优先。`autoWidth: false` 恢复原统一默认 180px。横向虚拟化同样使用数值测宽,不依赖浏览器扫描所有行;长内容默认省略并提供 tooltip。
270
-
271
- ```ts
272
- const columns = [
273
- { type: 'index' },
274
- { key: 'customer', title: '客户', maxWidth: 280 },
275
- { key: 'status', title: '状态', status: true },
276
- {
277
- key: 'planStatus',
278
- title: '计划状态',
279
- status: {
280
- S1B: { label: '待复核', color: 'danger' },
281
- S1C: { label: '已完成', color: 'success' },
282
- special: { label: '特殊处理', color: '#8b5cf6' },
283
- },
284
- },
285
- ]
286
- ```
287
-
288
- 状态列复用 Naive UI 标签和主题。支持 `success/warning/danger/info/neutral`,也支持 Naive 的 `error/default/primary` 和 CSS 颜色。未知代码保持中性;`0/false` 是有效值,空值保留空态。显式 render 优先;formatter 文字会用于默认颜色判断和测宽。状态配置只改变展示,不会改写数据、排序、筛选或导出。
289
-
290
- 默认智能布局会在缓存的内容基准上分配可用宽度;空间充足时自动业务列按基准比例铺满,空间不足时不压缩表头。数值列宽控制业务列与横向滚动,`scrollX` 不再挑某一列单独撑大。拖动只改变目标列,保存后继续保留原来的单行省略、提示和默认下限。操作列默认固定右侧;缩列后空余画布由包内承接,右固定区持续贴住视口,其他业务列保持原宽。需要 Naive UI 原生铺满或强制最小滚动宽度时,显式传 `table-layout="fixed"` / `table-layout="auto"`;百分比等非数值列宽也沿用原生布局。
291
-
292
- 测宽不额外挂载或执行 render;图标、进度条和复杂自定义内容请显式指定 width。数据与列配置更新会触发新的有界测量,配置和缓存只属于当前组件实例。此版本将未声明宽度的业务列由自然布局改为有界内容宽度;既有显式布局及原生 table-layout 覆盖仍保留。
293
-
294
- 表头默认完整展示,不随单元格 ellipsis 配置省略。所有业务列的最小宽度计入完整标题及排序/筛选控件;初始布局、显式窄列宽、恢复列设置与拖拽缩列均受此下限保护。360px 仅限制数据内容测宽;标题更长时允许超过该值,并使用表格内部横向滚动。复杂自定义标题请配置 minWidth。 自动列内的原生链接、按钮随省略容器收缩,悬停可查看完整内容;明确配置 `ellipsis: false` 时保留多行呈现。
295
-
296
- 紧凑表单与搜索的纵向间距收紧至 4px,空反馈区 2px,校验按内容自然撑高。表单弹窗同步收紧并支持内部滚动;移除逐字段排队入场和布局尺寸动画。详情的左右同排展示见 Robot_Admin 产销模块。
package/README_EN.md CHANGED
@@ -8,7 +8,7 @@
8
8
  <p>
9
9
  <a href="https://www.npmjs.com/package/@robot-admin/naive-ui-components"><img src="https://img.shields.io/npm/v/@robot-admin/naive-ui-components?style=flat-square&amp;color=249D70&amp;labelColor=183C2E" alt="npm version"></a>
10
10
  <a href="./package.json"><img src="https://img.shields.io/badge/Vue-3.5+-249D70?style=flat-square&amp;logo=vue.js&amp;logoColor=white&amp;labelColor=183C2E" alt="Vue 3.5+"></a>
11
- <a href="./package.json"><img src="https://img.shields.io/badge/TypeScript-5.9-3178C6?style=flat-square&amp;logo=typescript&amp;logoColor=white&amp;labelColor=183C2E" alt="TypeScript 5.9"></a>
11
+ <a href="./docs/engineering.en.md#typescript-build-and-consumption"><img src="https://img.shields.io/badge/TypeScript-5.9.3-3178C6?style=flat-square&amp;logo=typescript&amp;logoColor=white&amp;labelColor=183C2E" alt="Build: TypeScript 5.9.3"></a>
12
12
  <a href="https://github.com/ChenyCHENYU/naive-ui-components/actions/workflows/ci.yml"><img src="https://github.com/ChenyCHENYU/naive-ui-components/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
13
13
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-64748B?style=flat-square&amp;labelColor=183C2E" alt="MIT License"></a>
14
14
  </p>
@@ -33,50 +33,39 @@
33
33
  | Selective loading | 63 component entries, an auto-import resolver, component CSS and base styles for forms and tables |
34
34
  | Application integration | Global registration or local imports; injectable feedback, locale and defaults; form dialogs compatible with structurally matching headless CRUD controllers |
35
35
 
36
- The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.40.3**. See the [changelog](./CHANGELOG.md) for release details.
36
+ The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.40.5**. See the [changelog](./CHANGELOG.md) for release details.
37
37
 
38
- 0.40 adds continuous input with `edit: 'inline'` and fixes dynamic form visibility, cached workflow sessions and combined category searches. See the [table editing guide](./docs/guides/table-editing.md), [business scenario comparison](./docs/wl-business-scenario-parity.md) and [compatibility guide](./docs/guides/component-contracts.md) (Chinese).
39
-
40
- 0.34 adds state-aware tree icons, richer node contexts and action states, plus organization-chart field mapping, controlled interaction and measured connectors. Use `C_Tree` for hierarchical selection and the independent `C_OrgChart` for reporting relationships. See the [organization examples](./docs/guides/tree-org-examples.md) (Chinese).
41
-
42
- 0.36 adds `C_UserPicker` for organization-based person selection, sharing pagination, drafts and confirmation. Workflow nodes gain real connection ports, explicit conditional targets and the same person-selection interface. See [person selection](./docs/guides/user-picker.md) and [workflow design](./docs/guides/workflow.md) (Chinese).
43
-
44
- Use `C_Select` for standalone selections and freeform tags. Multiple selections in forms and search share the compact tag summary. Date and time fields can bind directly to formatted API strings. See the [composition examples](./docs/guides/data-workflows.md#多选标签和日期时间) (Chinese).
45
-
46
- Remote options, free text suggestions and multi-column entity selection use `C_Select`, `C_AutoComplete` and `C_DataPicker` with a shared request contract. Form and search fields accept `source` directly. See [search workflows](./docs/guides/search-workflows.md#远程选项与自由文本建议) and [scenario coverage](./docs/search-selection-coverage.md) (Chinese).
47
-
48
- Search fields, form fields, and actions can be generated from reactive configuration. Compact density applies consistently across search and data entry, including validation, async options, and dialogs. The application owns dictionaries and permissions, supplying ordinary options and column definitions to components.
49
-
50
- Compose `C_FormSearch`, `C_ActionBar`, `C_FormModal`, and `C_DataPicker` around either `C_Table` or MachTable. Each grid uses its own column definitions and pagination. See [workspace composition](./docs/guides/data-workflows.md), [form density](./docs/guides/form-density.en.md), and [runtime performance](./docs/guides/runtime-performance.md).
51
-
52
- Set search `columns` to `3` or `4` for responsive field tracks with right-aligned actions. Use `presentation="inline"` for selection inside an edit form and the picker's `#query` slot for multiple filters. See [search workflows](./docs/guides/search-workflows.md) and [data picker](./docs/guides/data-picker.md).
53
-
54
- Set `searchOnReset: true` to run both search and reset through `onSearch`. Use `createDataPickerField` for form lookup fields and `config.actions.inline` for row actions. See [workspace composition](./docs/guides/data-workflows.md).
38
+ Start with component props, business data and public types. Use composables when coordinating forms, queries and dialogs. Existing projects can simplify one page at a time using the [0.40.4 adoption notes](./docs/guides/api-migration.md#0404-接入收敛) (Chinese); existing compatibility APIs remain available.
55
39
 
56
40
  ## Capability map
57
41
 
58
- `C_Table` retains the native Naive UI empty state, including provider theme, locale and `componentOptions.DataTable.renderEmpty`. Use `#empty` to replace the content of one table.
59
-
60
- In narrow `C_Table` cells, edit actions wrap so the input stays visible. Utility columns remain compact; automatic business columns share available space proportionally to their measured header/content bases, and preserve their bases with horizontal scrolling when they do not fit. Explicit widths and saved width preferences remain effective.
42
+ | Scenario | Representative components | Capabilities |
43
+ | --------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
44
+ | Data entry | `C_Form` · `C_FormModal` · `C_FormSearch` | Dynamic fields, validation, async submission, search and create/edit dialogs |
45
+ | Data operations | `C_Table` · `C_ActionBar` · `C_Tree` · `C_Transfer` | Pagination, trees, inline/row/cell editing, cross-page selection, exports and batch actions |
46
+ | Search and selection | `C_Select` · `C_AutoComplete` · `C_DataPicker` · `C_UserPicker` | Remote options, text suggestions, multi-column entity selection and organization-based people selection |
47
+ | Structures and cards | `C_OrgChart` · `C_WaterFall` | Reporting relationships, responsive cards, list windowing and inferred business fields |
48
+ | Editing | `C_Editor` · `C_Markdown` · `C_Cron` · `C_FormulaEditor` | Rich text, Markdown, Cron previews and local formula evaluation |
49
+ | Workflow and planning | `C_AntV` · `C_WorkFlow` · `C_VtableGantt` · `C_FullCalendar` | ER/BPMN/UML, approval flows, Gantt charts and calendars |
50
+ | Files and media | `C_Upload` · `C_FilePreview` · `C_VideoPlayer` · `C_AudioPlayer` | Chunked uploads, PDF/Word/Excel previews and audio/video playback |
51
+ | Images and maps | `C_Signature` · `C_ImageCropper` · `C_QRCode` · `C_Map` | Signatures, cropping, QR codes, OpenStreetMap and AMap |
52
+ | Workspace | `C_Menu` · `C_Tabs` · `C_TagsView` · `C_GlobalSearch` | Menus, view switching, tab navigation and global search |
53
+ | Common interactions | `C_Login` · `C_Captcha` · `C_Guide` · `C_PageLoading` | Login UI, human verification, onboarding and navigation feedback |
61
54
 
62
- `C_Table` shows row numbers and a pager by default and centers all cells, including numbers. Use `:row-number="false"` and `:pagination="false"` to disable the automatic index and pager respectively. Bind server-provided columns and rows directly as shown in the [usage guide](./docs/guides/usage.en.md).
55
+ Browse [all 63 components and dependencies](./docs/components.en.md), or explore scenarios in [Robot Admin](https://robotadmin.cn). Cron previews calculate times only; formulas run locally. Production human verification requires server validation. See the [usage guide](./docs/guides/usage.en.md).
63
56
 
64
- Checked rows show a leading theme-colored marker; set `--c-table-selected-marker-width: 0px` to hide it. Async exports retain the columns, formatting and file settings captured at startup, and stop downloading after unmount. `createComponentTheme({ primary: '#409eff' })` uses a white foreground for filled buttons and checked controls by default; set `onSolid` centrally or override it through a local Provider. See the [theme guide](./docs/guides/theme.md).
57
+ ### Choose by task
65
58
 
66
- A `{ type: 'selection' }` column enables selection without repeating `selection: true`. Explicit global or local `selection: false` / `{ enabled: false }` still takes precedence, including when columns change dynamically.
59
+ The focused guides below are in Chinese.
67
60
 
68
- | Scenario | Representative components | Capabilities |
69
- | --------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
70
- | Data entry | `C_Form` · `C_FormModal` · `C_FormSearch` | Dynamic fields, validation, async submission, search and create/edit dialogs |
71
- | Data operations | `C_Table` · `C_ActionBar` · `C_Tree` · `C_Transfer` | Pagination, trees, inline/row/cell editing, cross-page selection, exports and batch actions |
72
- | Editing | `C_Editor` · `C_Markdown` · `C_Cron` · `C_FormulaEditor` | Rich text, Markdown, Cron previews and local formula evaluation |
73
- | Workflow and planning | `C_AntV` · `C_WorkFlow` · `C_VtableGantt` · `C_FullCalendar` | ER/BPMN/UML, approval flows, Gantt charts and calendars |
74
- | Files and media | `C_Upload` · `C_FilePreview` · `C_VideoPlayer` · `C_AudioPlayer` | Chunked uploads, PDF/Word/Excel previews and audio/video playback |
75
- | Images and maps | `C_Signature` · `C_ImageCropper` · `C_QRCode` · `C_Map` | Signatures, cropping, QR codes, OpenStreetMap and AMap |
76
- | Workspace | `C_Menu` · `C_Tabs` · `C_TagsView` · `C_GlobalSearch` | Menus, view switching, tab navigation and global search |
77
- | Common interactions | `C_Login` · `C_Captcha` · `C_Guide` · `C_PageLoading` | Login UI, human verification, onboarding and navigation feedback |
61
+ | Task | Recommended entry and usage |
62
+ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
63
+ | Filter, edit and run batch actions | Compose `C_FormSearch`, `C_FormModal` and `C_ActionBar`, sharing field definitions and compact density; see [workspace composition](./docs/guides/data-workflows.md) |
64
+ | Select values, suggest text or choose entities | Use `C_Select`, `C_AutoComplete` or `C_DataPicker` respectively; remote fields accept `source` directly. See [search and selection](./docs/guides/search-workflows.md) |
65
+ | Browse a hierarchy, display reporting lines or choose people | Use `C_Tree`, `C_OrgChart` or `C_UserPicker`; see [organization examples](./docs/guides/tree-org-examples.md) and [person selection](./docs/guides/user-picker.md) |
66
+ | Display and edit tabular data | `C_Table` includes row numbers and pagination by default; a selection column enables selection, and `config.edit` selects the editing mode. See [table editing](./docs/guides/table-editing.md) and [widths and density](./docs/guides/table-density.md) |
78
67
 
79
- Browse [all 63 components and dependencies](./docs/components.en.md), or explore scenarios in [Robot Admin](https://robotadmin.cn). Cron previews calculate times only; formulas run locally. Production human verification requires server validation. See the [usage guide](./docs/guides/usage.en.md).
68
+ Forms and search can accompany `C_Table` or another grid, retaining each grid's native column and pagination contracts. Workflow, upload and map components provide UI and integration points; applications own approval execution, file services and platform authorization.
80
69
 
81
70
  ## Quick start
82
71
 
@@ -144,6 +133,70 @@ Place this example in `App.vue`. It uses a component subpath and its CSS entry,
144
133
 
145
134
  The form includes submission, reset and validation. For persistence, await your async request inside `config.onSubmit`; use `@submit` for completion notifications. See the [usage guide](./docs/guides/usage.en.md) for layouts, validation rules, dialogs and remote tables.
146
135
 
136
+ ### Use public Props directly
137
+
138
+ For simple components, bind props directly. When extracting configuration, use the component's public type to check fields without duplicating an interface or adding a configuration factory:
139
+
140
+ ```vue
141
+ <script setup lang="ts">
142
+ import {
143
+ C_Progress,
144
+ type ProgressProps,
145
+ } from '@robot-admin/naive-ui-components/C_Progress'
146
+ import '@robot-admin/naive-ui-components/C_Progress/style.css'
147
+
148
+ const progress = {
149
+ percentage: 62.5,
150
+ isAnimation: true,
151
+ } satisfies ProgressProps
152
+ </script>
153
+
154
+ <template>
155
+ <C_Progress v-bind="progress" />
156
+ </template>
157
+ ```
158
+
159
+ `BarcodeProps`, `CascadeProps`, `StepsProps`, `CodeProps`, `EditorProps` and `MarkdownProps` are also available from their component subpaths. They share declarations with the actual component props.
160
+
161
+ ### Infer waterfall business fields
162
+
163
+ Provide `id`, `src`, `width` and `height` in `items`. Additional business fields flow into slots and events automatically, without converting your data to a base `WaterFallItem[]`:
164
+
165
+ ```vue
166
+ <script setup lang="ts">
167
+ import { C_WaterFall } from '@robot-admin/naive-ui-components/C_WaterFall'
168
+ import '@robot-admin/naive-ui-components/C_WaterFall/style.css'
169
+
170
+ const products = [
171
+ {
172
+ id: 1,
173
+ src: '/images/product.jpg',
174
+ width: 640,
175
+ height: 480,
176
+ productCode: 'A-01',
177
+ price: 125.5,
178
+ },
179
+ ]
180
+ </script>
181
+
182
+ <template>
183
+ <C_WaterFall :items="products">
184
+ <template #item="{ item, width, height }">
185
+ <img
186
+ :src="item.src"
187
+ :alt="item.productCode"
188
+ :width="width"
189
+ :height="height"
190
+ loading="lazy"
191
+ />
192
+ <p>{{ item.productCode }} · {{ item.price.toFixed(2) }}</p>
193
+ </template>
194
+ </C_WaterFall>
195
+ </template>
196
+ ```
197
+
198
+ Replace the image path with an application asset. Slot and event records are read-only and preserve Vue's nested `ref` unwrapping; edit the source data owned by your application. See the [waterfall guide](./docs/guides/waterfall.md) (Chinese) for long lists, variable-height cards and scroll containers.
199
+
147
200
  ### Scope table preferences per account
148
201
 
149
202
  Register once when the app starts. `session` is your existing reactive identity state; keep it `undefined` until the identity is fully resolved:
@@ -206,35 +259,37 @@ The resolver uses component subpaths by default. `importStyle` defaults to `fals
206
259
 
207
260
  Each component CSS entry loads its composed styles and shared design tokens automatically. Manual imports can use `C_Form/base.css` and `C_Table/base.css`; full styles also have `full.css` aliases. Load heavy editors, flows, maps and media with their business routes. See [import strategies](./docs/guides/usage.en.md#import-strategies) for details and global registration examples.
208
261
 
209
- Minimal consumer builds reduced initial JS gzip by 36.1% for the base form and 34.6% for the display table, including Vue and Naive UI. See the [measurement and automated budgets](./docs/performance-0.15.0.md) (Chinese) for scope and limitations.
262
+ The repository builds minimal consumers per entry and checks initial JS gzip, heavy dependency boundaries and first-open increments. Measurements include Vue and Naive UI, cannot be summed into a whole-app estimate, and do not replace page-level interaction measurements. See [development and build](./docs/engineering.en.md#development) for coverage; the [0.15.0 size report](./docs/performance-0.15.0.md) (Chinese) is retained as historical context only.
210
263
 
211
264
  Root imports aggregate navigation components and require `vue-router` at runtime. Applications without it should use component subpaths; their unrelated optional peers are not required.
212
265
 
213
266
  ## Documentation
214
267
 
215
- | Document | Contents |
216
- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
217
- | [Architecture and isolation](./docs/architecture.en.md) | Dependency boundaries, instance ownership and the independent Element Plus roadmap |
218
- | [Component catalog](./docs/components.en.md) | All 63 components, dependencies and behavior boundaries |
219
- | [Usage guide](./docs/guides/usage.en.md) | Imports, forms/tables, Cron/formulas, maps, onboarding, captcha, login and page loading |
220
- | [Density and workbenches](./docs/guides/table-density.md) | Shared form/search/table density, edit modes, split panes and tree capabilities (Chinese) |
221
- | [Theme and visual standard](./docs/guides/theme.md) | Semantic colors, light/dark mode, control sizes and local overrides with the existing provider (Chinese) |
222
- | [Lists and async tasks](./docs/guides/runtime-performance.md) | Automatic list windows, chat scrolling, search indexes and media task ownership (Chinese) |
223
- | [Waterfall lists](./docs/guides/waterfall.md) | Automatic windows, nested scrolling, measured cards and keyboard navigation (Chinese) |
224
- | [Compatible API migration](./docs/guides/api-migration.md) | Standard models, application renderers and read-only migration checks (Chinese) |
225
- | [Production coverage review](./docs/wl-ui-produce-coverage.md) | wl-ui-produce capability mapping and adapter boundaries (Chinese) |
226
- | [Stability review](./docs/stability-boundaries-0.40.3.md) | Async and locale fixes, three-browser contracts, fixed-scale performance and measured boundaries (Chinese) |
227
- | [Development and build](./docs/engineering.en.md) | Source structure, six-stage build, adding components, checks and releases |
228
- | [Brand assets](./docs/assets/README.md) | Robot family logo, editable SVG sources and high-resolution PNGs |
229
- | [Changelog](./CHANGELOG.md) | Releases and compatibility changes |
230
- | [Security policy](./SECURITY.md) | Vulnerability reporting and maintenance policy |
231
-
232
- The [2026-10-18 scan record](./docs/security-scan-2026-10-18.md) documents two outstanding upstream advisories; the [2026-10-06 record](./docs/security-scan-2026-10-06.md) is a historical archive. Both are in Chinese. Run `bun run check:audit` to assess the current dependency state.
268
+ | Document | Contents |
269
+ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
270
+ | [Architecture and isolation](./docs/architecture.en.md) | Dependency boundaries, instance ownership and the independent Element Plus roadmap |
271
+ | [Component catalog](./docs/components.en.md) | All 63 components, dependencies and behavior boundaries |
272
+ | [Usage guide](./docs/guides/usage.en.md) | Imports, forms/tables, Cron/formulas, maps, onboarding, captcha, login and page loading |
273
+ | [Density and workbenches](./docs/guides/table-density.md) | Shared form/search/table density, edit modes, split panes and tree capabilities (Chinese) |
274
+ | [Theme and visual standard](./docs/guides/theme.md) | Semantic colors, light/dark mode, control sizes and local overrides with the existing provider (Chinese) |
275
+ | [Lists and async tasks](./docs/guides/runtime-performance.md) | Automatic list windows, chat scrolling, search indexes and media task ownership (Chinese) |
276
+ | [Waterfall lists](./docs/guides/waterfall.md) | Automatic windows, nested scrolling, measured cards and keyboard navigation (Chinese) |
277
+ | [Compatible API migration](./docs/guides/api-migration.md) | 0.40.4 adoption notes, standard models, application renderers and read-only migration checks (Chinese) |
278
+ | [Production coverage review](./docs/wl-ui-produce-coverage.md) | wl-ui-produce capability mapping and adapter boundaries (Chinese) |
279
+ | [0.40.4 component audit](./docs/component-audit-closure-0.40.4.md) | That release's fixes, type improvements, compatibility boundaries and packaged-consumer validation (Chinese) |
280
+ | [Development and build](./docs/engineering.en.md) | Source structure, six-stage build, adding components, checks and releases |
281
+ | [Brand assets](./docs/assets/README.md) | Robot family logo, editable SVG sources and high-resolution PNGs |
282
+ | [Changelog](./CHANGELOG.md) | Releases and compatibility changes |
283
+ | [Security policy](./SECURITY.md) | Vulnerability reporting and maintenance policy |
284
+
285
+ Dependency security depends on the actual lockfile and audit run. `bun run check:audit` retains raw findings and verifies evidence for narrowly scoped local mitigations or unaffected paths; `check:audit:raw` provides the original report. Repository overrides and development patches do not propagate to consumers, so applications must audit their own lockfiles. Historical scans are not current results. See the [security policy](./SECURITY.md) for bundled-runtime and consumer-dependency boundaries.
233
286
 
234
287
  ## Local development
235
288
 
236
289
  Maintaining this repository requires **Node.js ≥20.19.0** and the pinned **Bun 1.4.2**. CI uses `.node-version`, the frozen lockfile and checks actual dependency overrides. The minimum Bun version for consumers remains 1.3.14.
237
290
 
291
+ Source checks and builds use locked **TypeScript 5.9.3**. CI additionally verifies consumption of the built declarations with **TypeScript 5.8.3**; this does not claim support for building repository source with 5.8. See [TypeScript build and consumption](./docs/engineering.en.md#typescript-build-and-consumption).
292
+
238
293
  ```bash
239
294
  git clone https://github.com/ChenyCHENYU/naive-ui-components.git
240
295
  cd naive-ui-components
@@ -263,15 +318,3 @@ See [development and build](./docs/engineering.en.md) for individual checks and
263
318
  ## License
264
319
 
265
320
  [MIT License](./LICENSE) · Made by [CHENY](https://github.com/ChenyCHENYU)
266
-
267
- ## Content widths and status columns (0.24)
268
-
269
- Columns without `width` now measure their header and up to 100 evenly sampled loaded rows, using formatted values and status labels. Content measurement bases default to 80–360px; final automatic widths may grow proportionally to fill available space. Saving a manual width preserves the original ellipsis, tooltip and default minimum. Action columns default to the right edge; the internal canvas absorbs spare space after shrinking without resizing peer business columns. Native links and buttons inside an ellipsis cell also shrink with a trailing ellipsis. Use `minWidth/maxWidth` to adjust the bounds. Explicit widths (including native strings), saved column widths and `display.columnWidth` take precedence. `autoWidth: false` restores the 180px default. Long automatic cells use ellipsis and a tooltip; horizontal virtualization uses the same numeric widths.
270
-
271
- Use `{ key: 'status', status: true }` for themed status tags, or `status: { S1B: { label: 'Review', color: 'danger' }, S1C: 'success' }`. Semantic colors and CSS colors are supported. Unknown codes stay neutral, zero/false stay valid, and explicit render functions win. Display changes never rewrite data or export policy. Measurement does not invoke render functions; give graphical/custom columns explicit widths. Data and column updates remeasure a bounded sample; all caches remain component-local.
272
-
273
- Headers display their full text by default, independently of cell ellipsis. Initial layout, explicit or restored narrow widths, and interactive resizing share a minimum that includes the entire title and its sort/filter controls. The 360px measurement cap applies only to cell content; longer headers use internal horizontal scrolling. Custom header content should declare an appropriate minWidth.
274
-
275
- Compact forms and searches use a 4px row gap and a 2px empty feedback reserve; validation messages grow naturally. Compact form dialogs use tighter padding and internal scrolling. Per-field entrance and layout-size animations have been removed.
276
-
277
- The default adaptive layout distributes spare viewport space proportionally among automatic business columns; crowded tables keep their measured bases and scroll horizontally. Utility, explicit-width and manually resized columns retain their widths. Resolved numeric widths drive both the table and horizontal scroll range. Resizing changes only the target column, including after preferences are committed. Explicit native `table-layout` attributes or nonnumeric widths retain Naive UI layout semantics and its `scrollX` minimum.
package/dist/BPMN.cjs CHANGED
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./data2.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./C_Icon2.cjs`),i=require(`./useGraphExport.cjs`),a=require(`./useEdgeInteraction.cjs`),o=require(`./readonlyGraph.cjs`);let s=require(`vue`),c=require(`naive-ui`),l=require(`@antv/x6`);const u={"start-event":{name:`开始`,title:`开始事件`,iconClass:`circle start-event`},activity:{name:`任务`,title:`任务活动`,iconClass:`rect activity`},gateway:{name:`网关`,title:`排他网关`,iconClass:`diamond gateway`},"end-event":{name:`结束`,title:`结束事件`,iconClass:`circle end-event`}},d={event:`事件`,activity:`活动`,gateway:`网关`,"bpmn-edge":`连接线`},f=[`top`,`right`,`bottom`,`left`],p=(e,t=`rect`)=>e.reduce((e,n)=>{let r=t===`circle`,i=n===`top`?r?{refCx:.5,refCy:0}:{refX:.5,refY:0}:n===`right`?r?{refCx:1,refCy:.5}:{refX:1,refY:.5}:n===`bottom`?r?{refCx:.5,refCy:1}:{refX:.5,refY:1}:r?{refCx:0,refCy:.5}:{refX:0,refY:.5};return e[`port-${n}`]={ref:`body`,...i,r:4,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:2,magnet:!0,style:{cursor:`crosshair`,opacity:0,transition:`opacity 0.2s`}},e},{}),m={event:{inherit:`circle`,attrs:{body:{strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,magnet:!1,style:{cursor:`move`}},text:{fontSize:12,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,textAnchor:`middle`,textVerticalAnchor:`middle`,pointerEvents:`none`}}},activity:{inherit:`rect`,attrs:{body:{rx:6,ry:6,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,strokeWidth:1,magnet:!1,style:{cursor:`move`}},text:{fontSize:12,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,textAnchor:`middle`,textVerticalAnchor:`middle`,pointerEvents:`none`}}},gateway:{inherit:`polygon`,attrs:{body:{refPoints:`0,10 10,0 20,10 10,20`,strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,magnet:!1,style:{cursor:`move`}},text:{fontSize:20,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,textAnchor:`middle`,textVerticalAnchor:`middle`,pointerEvents:`none`}}}},h={inherit:`edge`,attrs:{line:{stroke:`var(--c-text-3, var(--c-theme-text-3, #a3a3a3))`,strokeWidth:2,targetMarker:{name:`block`,width:8,height:6,fill:`var(--c-text-3, var(--c-theme-text-3, #a3a3a3))`},cursor:`pointer`}}};function g(e=!1){let t={background:e?`#18181c`:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,gridPrimary:e?`rgba(255, 255, 255, 0.08)`:`#eee`,gridSecondary:e?`rgba(255, 255, 255, 0.04)`:`#ddd`};return{background:{color:t.background},grid:{visible:!0,type:`doubleMesh`,args:[{color:t.gridPrimary,thickness:1},{color:t.gridSecondary,thickness:1,factor:4}]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:`ctrl`,minScale:.5,maxScale:3},connecting:{router:`manhattan`,connector:{name:`rounded`,args:{radius:8}},allowBlank:!1,allowLoop:!1,allowNode:!1,snap:!0,allowEdge:!1},highlighting:{magnetAvailable:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}},magnetAdsorbed:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}}},selecting:{enabled:!0,rubberband:!0,showNodeSelectionBox:!0},resizing:!0,rotating:!1,snapline:!0,keyboard:!0,clipboard:!0}}g();const _={"start-event":{shape:`event`,width:50,height:50,label:`开始事件`,data:{type:`start`}},"end-event":{shape:`event`,width:50,height:50,label:`结束事件`,data:{type:`end`}},activity:{shape:`activity`,width:120,height:60,label:`新活动`,data:{description:``,assignee:``}},gateway:{shape:`gateway`,width:40,height:40,label:`+`,data:{type:`exclusive`}}},v=[{id:`start-1`,shape:`event`,x:100,y:200,width:50,height:50,label:`流程开始`,data:{type:`start`}},{id:`activity-1`,shape:`activity`,x:200,y:180,width:120,height:60,label:`用户申请`,data:{description:`用户提交申请表单`,assignee:`申请人`}},{id:`activity-2`,shape:`activity`,x:380,y:180,width:120,height:60,label:`初审`,data:{description:`部门进行初步审核`,assignee:`部门主管`}},{id:`gateway-1`,shape:`gateway`,x:550,y:200,width:40,height:40,label:`+`,data:{type:`exclusive`}},{id:`activity-3`,shape:`activity`,x:650,y:120,width:120,height:60,label:`终审`,data:{description:`高级主管最终审核`,assignee:`总监`}},{id:`activity-4`,shape:`activity`,x:650,y:260,width:120,height:60,label:`驳回处理`,data:{description:`处理驳回流程`,assignee:`专员`}},{id:`end-1`,shape:`event`,x:820,y:140,width:50,height:50,label:`审批通过`,data:{type:`end`}},{id:`end-2`,shape:`event`,x:820,y:280,width:50,height:50,label:`审批驳回`,data:{type:`end`}},{id:`edge-1`,shape:`bpmn-edge`,source:`start-1`,target:`activity-1`,x:0,y:0},{id:`edge-2`,shape:`bpmn-edge`,source:`activity-1`,target:`activity-2`,x:0,y:0},{id:`edge-3`,shape:`bpmn-edge`,source:`activity-2`,target:`gateway-1`,x:0,y:0},{id:`edge-4`,shape:`bpmn-edge`,source:`gateway-1`,target:`activity-3`,label:`通过`,x:0,y:0},{id:`edge-5`,shape:`bpmn-edge`,source:`gateway-1`,target:`activity-4`,label:`驳回`,x:0,y:0},{id:`edge-6`,shape:`bpmn-edge`,source:`activity-3`,target:`end-1`,x:0,y:0},{id:`edge-7`,shape:`bpmn-edge`,source:`activity-4`,target:`end-2`,x:0,y:0}],y={key:0,class:`property-panel`},b={class:`property-item`},x={class:`property-item`},S={key:0,class:`property-item`},C={key:1,class:`property-item`},w={class:`form-actions`},T=(0,s.defineComponent)({__name:`BPMNPropertyEditor`,props:(0,s.mergeModels)({show:{type:Boolean}},{editingElement:{},editingElementModifiers:{}}),emits:(0,s.mergeModels)([`update:show`,`save`,`delete`],[`update:editingElement`]),setup(e,{emit:t}){let n=(0,s.useModel)(e,`editingElement`),r=t,i=(0,s.computed)(()=>d[n.value?.shape]||n.value?.shape||``);return(t,a)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NDrawer),{show:e.show,width:`300`,title:`属性设置`,"onUpdate:show":a[6]||=e=>r(`update:show`,e)},{default:(0,s.withCtx)(()=>[n.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,y,[(0,s.createElementVNode)(`div`,b,[a[7]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`名称`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.label,"onUpdate:value":a[0]||=e=>n.value.label=e,placeholder:`请输入名称`,size:`small`},null,8,[`value`])]),(0,s.createElementVNode)(`div`,x,[a[8]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`类型`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:i.value,readonly:``,size:`small`},null,8,[`value`])]),n.value.shape===`activity`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,S,[a[9]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`描述`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.description,"onUpdate:value":a[1]||=e=>n.value.description=e,type:`textarea`,rows:3,placeholder:`请输入活动描述`,size:`small`},null,8,[`value`])])):(0,s.createCommentVNode)(`v-if`,!0),n.value.shape===`activity`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,C,[a[10]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`执行人`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.assignee,"onUpdate:value":a[2]||=e=>n.value.assignee=e,placeholder:`请输入执行人`,size:`small`},null,8,[`value`])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,w,[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[3]||=e=>r(`save`),type:`primary`,size:`small`},{default:(0,s.withCtx)(()=>[...a[11]||=[(0,s.createTextVNode)(` 保存 `,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[4]||=e=>r(`update:show`,!1),size:`small`},{default:(0,s.withCtx)(()=>[...a[12]||=[(0,s.createTextVNode)(` 取消 `,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[5]||=e=>r(`delete`),type:`error`,size:`small`},{default:(0,s.withCtx)(()=>[...a[13]||=[(0,s.createTextVNode)(` 删除 `,-1)]]),_:1})]),_:1})])])):(0,s.createCommentVNode)(`v-if`,!0)]),_:1},8,[`show`]))}});var E=n.t(T,[[`__scopeId`,`data-v-fc8f213e`]]);const D={key:0,class:`top-toolbar`},O={class:`toolbar-section`},k={class:`toolbar-group`},ee={class:`toolbar-group`},te={class:`toolbar-group`},A={class:`main-content`},j={key:0,class:`left-panel`},M={class:`element-grid`},N=[`onClick`,`title`],P={class:`graph-wrapper`},F=(0,s.defineComponent)({__name:`index`,props:{data:{},showToolbar:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},width:{default:`100%`},height:{default:`600px`},theme:{}},emits:[`ready`,`data-change`],setup(n,{expose:d,emit:y}){let b=n,x=y,S=(0,s.ref)(),C=t.n(()=>b.theme),w=t.t(()=>b.theme),{graph:T,initGraph:F,centerContent:I,zoomToFit:L,scheduleZoomToFit:R,themeOptions:z}=i.n(S,(0,s.computed)(()=>w.value===`dark`)),{exportOptions:B,handleExport:V}=i.t(T,`bpmn-diagram`),{bindInteractions:H}=a.t(T,{portPositions:f,onDataChange:()=>$(),isReadonly:()=>b.readonly}),U=(0,s.ref)(!1),W=(0,s.ref)(),G=e=>String(e.attr(`text/text`)||e.attr(`label/text`)||``),K=e=>{if(!e)return[];if(Array.isArray(e))return e;let t=[];return Object.values(e).forEach(e=>{Array.isArray(e)&&t.push(...e)}),t},q=()=>{let e=f.map(e=>({tagName:`circle`,selector:`port-${e}`})),t=[`event`,`activity`,`gateway`],n={event:`circle`,activity:`rect`,gateway:`polygon`};t.forEach(t=>{l.Graph.registerNode(t,{...m[t],markup:[{tagName:n[t],selector:`body`},{tagName:`text`,selector:`text`},...e],attrs:{...m[t].attrs,...p(f,n[t])}},!0)}),l.Graph.registerEdge(`bpmn-edge`,h,!0)},J=t=>{if(!T.value)return;let n=t.map(t=>{let{data:n,...r}=t,i=t.shape===`bpmn-edge`?T.value.createEdge(r):T.value.createNode(r);return n&&i.setData(e.t(n)),i});T.value.resetCells(n),n.length&&R(200,50)},Y=t=>{if(b.readonly||!T.value)return;let n=_[t];if(!n)return;let r=T.value.options.width/2,i=T.value.options.height/2,{data:a,...o}={id:`${t}-${Date.now()}`,x:r+Math.random()*100-50,y:i+Math.random()*100-50,...n},s=T.value.createNode(o);a&&s.setData(e.t(a)),T.value.addCell(s),$()},X=()=>{b.readonly||(T.value?.clearCells(),$())},Z=e=>{if(b.readonly)return;let t=e.getData()||{};W.value={id:e.id,shape:e.shape,label:G(e),description:t.description||``,assignee:t.assignee||``,x:0,y:0},U.value=!0},ne=()=>{if(b.readonly||!T.value||!W.value)return;let e=T.value.getCellById(W.value.id);e&&(e.setData({description:W.value.description,assignee:W.value.assignee}),e.attr(`text/text`,W.value.label||``),e.attr(`label/text`,W.value.label||``)),U.value=!1,$()},re=()=>{b.readonly||!T.value||!W.value||(T.value.getCellById(W.value.id)?.remove(),U.value=!1,$())},Q=()=>T.value?[...T.value.getNodes().map(t=>({id:t.id,shape:t.shape,x:t.getPosition().x,y:t.getPosition().y,width:t.getSize().width,height:t.getSize().height,label:G(t),data:e.t(t.getData()||{})})),...T.value.getEdges().map(t=>({id:t.id,shape:`bpmn-edge`,source:t.getSourceCellId()||``,target:t.getTargetCellId()||``,label:G(t),data:e.t(t.getData()||{}),x:0,y:0}))]:[],$=()=>{b.readonly||x(`data-change`,Q())};return(0,s.watch)(T,e=>{e instanceof l.Graph&&(o.t(e,()=>b.readonly),H(),e.on(`node:dblclick`,({node:e})=>Z(e)),e.on(`node:moved`,$),x(`ready`,e),J(b.data===void 0?v:K(b.data)))},{immediate:!0}),(0,s.watch)(()=>b.data,e=>{T.value&&J(e===void 0?v:K(e))},{deep:!0}),(0,s.watch)(()=>b.readonly,e=>{e&&(U.value=!1,W.value=void 0)},{flush:`sync`}),(0,s.onMounted)(async()=>{q();let e=g();await F({...e,...z.value,interacting:()=>!b.readonly,connecting:{...e.connecting,validateMagnet:()=>!b.readonly,validateEdge:()=>!b.readonly,createEdge:()=>T.value.createEdge({shape:`bpmn-edge`}),validateConnection:({sourceView:e,targetView:t,sourceMagnet:n,targetMagnet:r})=>!b.readonly&&e!==t&&!!n&&!!r&&n.getAttribute(`magnet`)===`true`&&r.getAttribute(`magnet`)===`true`}})}),d({getGraph:()=>T.value,getData:Q,loadData:J}),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:`bpmn-layout`,style:(0,s.normalizeStyle)((0,s.unref)(C))},[n.showToolbar?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,D,[(0,s.createElementVNode)(`div`,O,[(0,s.createElementVNode)(`div`,k,[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:X,disabled:n.readonly,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:delete-outline`,size:16})]),default:(0,s.withCtx)(()=>[t[3]||=(0,s.createTextVNode)(` 清空 `,-1)]),_:1},8,[`disabled`])]),(0,s.createElementVNode)(`div`,ee,[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:(0,s.unref)(I),size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:image-filter-center-focus`,size:16})]),default:(0,s.withCtx)(()=>[t[4]||=(0,s.createTextVNode)(` 居中 `,-1)]),_:1},8,[`onClick`]),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:(0,s.unref)(L),size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:fit-to-screen`,size:16})]),default:(0,s.withCtx)(()=>[t[5]||=(0,s.createTextVNode)(` 适应 `,-1)]),_:1},8,[`onClick`])]),(0,s.createElementVNode)(`div`,te,[(0,s.createVNode)((0,s.unref)(c.NDropdown),{options:(0,s.unref)(B),onSelect:t[0]||=e=>(0,s.unref)(V)(e,Q)},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:export`,size:16})]),default:(0,s.withCtx)(()=>[t[6]||=(0,s.createTextVNode)(` 导出 `,-1)]),_:1})]),_:1},8,[`options`])])])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,A,[n.showToolbar&&!n.readonly?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,j,[t[7]||=(0,s.createElementVNode)(`div`,{class:`panel-title`},`组件`,-1),(0,s.createElementVNode)(`div`,M,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(u),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:t,class:`element-item`,onClick:e=>Y(t),title:e.title},[(0,s.createElementVNode)(`div`,{class:(0,s.normalizeClass)([`element-icon`,e.iconClass])},null,2),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)(e.name),1)],8,N))),128))])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,P,[(0,s.createElementVNode)(`div`,{ref_key:`containerRef`,ref:S,class:`graph-container`},null,512)])]),(0,s.createVNode)(E,{style:(0,s.normalizeStyle)((0,s.unref)(C)),show:U.value,"editing-element":W.value,"onUpdate:editingElement":t[1]||=e=>W.value=e,"onUpdate:show":t[2]||=e=>U.value=e,onSave:ne,onDelete:re},null,8,[`style`,`show`,`editing-element`])],4))}});var I=n.t(F,[[`__scopeId`,`data-v-2bf53377`]]);exports.default=I;
1
+ require(`./chunk.cjs`);const e=require(`./data2.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./C_Icon2.cjs`),i=require(`./useGraphExport.cjs`),a=require(`./useEdgeInteraction.cjs`),o=require(`./graphEditSession.cjs`);let s=require(`vue`),c=require(`naive-ui`),l=require(`@antv/x6`);const u={"start-event":{name:`开始`,title:`开始事件`,iconClass:`circle start-event`},activity:{name:`任务`,title:`任务活动`,iconClass:`rect activity`},gateway:{name:`网关`,title:`排他网关`,iconClass:`diamond gateway`},"end-event":{name:`结束`,title:`结束事件`,iconClass:`circle end-event`}},d={event:`事件`,activity:`活动`,gateway:`网关`,"bpmn-edge":`连接线`},f=[`top`,`right`,`bottom`,`left`],p=(e,t=`rect`)=>e.reduce((e,n)=>{let r=t===`circle`,i=n===`top`?r?{refCx:.5,refCy:0}:{refX:.5,refY:0}:n===`right`?r?{refCx:1,refCy:.5}:{refX:1,refY:.5}:n===`bottom`?r?{refCx:.5,refCy:1}:{refX:.5,refY:1}:r?{refCx:0,refCy:.5}:{refX:0,refY:.5};return e[`port-${n}`]={ref:`body`,...i,r:4,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:2,magnet:!0,style:{cursor:`crosshair`,opacity:0,transition:`opacity 0.2s`}},e},{}),m={event:{inherit:`circle`,attrs:{body:{strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,magnet:!1,style:{cursor:`move`}},text:{fontSize:12,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,textAnchor:`middle`,textVerticalAnchor:`middle`,pointerEvents:`none`}}},activity:{inherit:`rect`,attrs:{body:{rx:6,ry:6,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,strokeWidth:1,magnet:!1,style:{cursor:`move`}},text:{fontSize:12,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,textAnchor:`middle`,textVerticalAnchor:`middle`,pointerEvents:`none`}}},gateway:{inherit:`polygon`,attrs:{body:{refPoints:`0,10 10,0 20,10 10,20`,strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,magnet:!1,style:{cursor:`move`}},text:{fontSize:20,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,textAnchor:`middle`,textVerticalAnchor:`middle`,pointerEvents:`none`}}}},ee={inherit:`edge`,attrs:{line:{stroke:`var(--c-text-3, var(--c-theme-text-3, #a3a3a3))`,strokeWidth:2,targetMarker:{name:`block`,width:8,height:6,fill:`var(--c-text-3, var(--c-theme-text-3, #a3a3a3))`},cursor:`pointer`}}};function h(e=!1){let t={background:e?`#18181c`:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,gridPrimary:e?`rgba(255, 255, 255, 0.08)`:`#eee`,gridSecondary:e?`rgba(255, 255, 255, 0.04)`:`#ddd`};return{background:{color:t.background},grid:{visible:!0,type:`doubleMesh`,args:[{color:t.gridPrimary,thickness:1},{color:t.gridSecondary,thickness:1,factor:4}]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:`ctrl`,minScale:.5,maxScale:3},connecting:{router:`manhattan`,connector:{name:`rounded`,args:{radius:8}},allowBlank:!1,allowLoop:!1,allowNode:!1,snap:!0,allowEdge:!1},highlighting:{magnetAvailable:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}},magnetAdsorbed:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}}},selecting:{enabled:!0,rubberband:!0,showNodeSelectionBox:!0},resizing:!0,rotating:!1,snapline:!0,keyboard:!0,clipboard:!0}}h();const g={"start-event":{shape:`event`,width:50,height:50,label:`开始事件`,data:{type:`start`}},"end-event":{shape:`event`,width:50,height:50,label:`结束事件`,data:{type:`end`}},activity:{shape:`activity`,width:120,height:60,label:`新活动`,data:{description:``,assignee:``}},gateway:{shape:`gateway`,width:40,height:40,label:`+`,data:{type:`exclusive`}}},_=[{id:`start-1`,shape:`event`,x:100,y:200,width:50,height:50,label:`流程开始`,data:{type:`start`}},{id:`activity-1`,shape:`activity`,x:200,y:180,width:120,height:60,label:`用户申请`,data:{description:`用户提交申请表单`,assignee:`申请人`}},{id:`activity-2`,shape:`activity`,x:380,y:180,width:120,height:60,label:`初审`,data:{description:`部门进行初步审核`,assignee:`部门主管`}},{id:`gateway-1`,shape:`gateway`,x:550,y:200,width:40,height:40,label:`+`,data:{type:`exclusive`}},{id:`activity-3`,shape:`activity`,x:650,y:120,width:120,height:60,label:`终审`,data:{description:`高级主管最终审核`,assignee:`总监`}},{id:`activity-4`,shape:`activity`,x:650,y:260,width:120,height:60,label:`驳回处理`,data:{description:`处理驳回流程`,assignee:`专员`}},{id:`end-1`,shape:`event`,x:820,y:140,width:50,height:50,label:`审批通过`,data:{type:`end`}},{id:`end-2`,shape:`event`,x:820,y:280,width:50,height:50,label:`审批驳回`,data:{type:`end`}},{id:`edge-1`,shape:`bpmn-edge`,source:`start-1`,target:`activity-1`,x:0,y:0},{id:`edge-2`,shape:`bpmn-edge`,source:`activity-1`,target:`activity-2`,x:0,y:0},{id:`edge-3`,shape:`bpmn-edge`,source:`activity-2`,target:`gateway-1`,x:0,y:0},{id:`edge-4`,shape:`bpmn-edge`,source:`gateway-1`,target:`activity-3`,label:`通过`,x:0,y:0},{id:`edge-5`,shape:`bpmn-edge`,source:`gateway-1`,target:`activity-4`,label:`驳回`,x:0,y:0},{id:`edge-6`,shape:`bpmn-edge`,source:`activity-3`,target:`end-1`,x:0,y:0},{id:`edge-7`,shape:`bpmn-edge`,source:`activity-4`,target:`end-2`,x:0,y:0}],v={key:0,class:`property-panel`},y={class:`property-item`},b={class:`property-item`},x={key:0,class:`property-item`},S={key:1,class:`property-item`},C={class:`form-actions`},w=(0,s.defineComponent)({__name:`BPMNPropertyEditor`,props:(0,s.mergeModels)({show:{type:Boolean}},{editingElement:{},editingElementModifiers:{}}),emits:(0,s.mergeModels)([`update:show`,`save`,`delete`],[`update:editingElement`]),setup(e,{emit:t}){let n=(0,s.useModel)(e,`editingElement`),r=t,i=(0,s.computed)(()=>d[n.value?.shape]||n.value?.shape||``);return(t,a)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NDrawer),{show:e.show,width:`300`,title:`属性设置`,"onUpdate:show":a[6]||=e=>r(`update:show`,e)},{default:(0,s.withCtx)(()=>[n.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,v,[(0,s.createElementVNode)(`div`,y,[a[7]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`名称`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.label,"onUpdate:value":a[0]||=e=>n.value.label=e,placeholder:`请输入名称`,size:`small`},null,8,[`value`])]),(0,s.createElementVNode)(`div`,b,[a[8]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`类型`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:i.value,readonly:``,size:`small`},null,8,[`value`])]),n.value.shape===`activity`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,x,[a[9]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`描述`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.description,"onUpdate:value":a[1]||=e=>n.value.description=e,type:`textarea`,rows:3,placeholder:`请输入活动描述`,size:`small`},null,8,[`value`])])):(0,s.createCommentVNode)(`v-if`,!0),n.value.shape===`activity`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,S,[a[10]||=(0,s.createElementVNode)(`div`,{class:`property-label`},`执行人`,-1),(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.assignee,"onUpdate:value":a[2]||=e=>n.value.assignee=e,placeholder:`请输入执行人`,size:`small`},null,8,[`value`])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,C,[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[3]||=e=>r(`save`),type:`primary`,size:`small`},{default:(0,s.withCtx)(()=>[...a[11]||=[(0,s.createTextVNode)(` 保存 `,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[4]||=e=>r(`update:show`,!1),size:`small`},{default:(0,s.withCtx)(()=>[...a[12]||=[(0,s.createTextVNode)(` 取消 `,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[5]||=e=>r(`delete`),type:`error`,size:`small`},{default:(0,s.withCtx)(()=>[...a[13]||=[(0,s.createTextVNode)(` 删除 `,-1)]]),_:1})]),_:1})])])):(0,s.createCommentVNode)(`v-if`,!0)]),_:1},8,[`show`]))}});var T=n.t(w,[[`__scopeId`,`data-v-fc8f213e`]]);const E={key:0,class:`top-toolbar`},D={class:`toolbar-section`},O={class:`toolbar-group`},k={class:`toolbar-group`},A={class:`toolbar-group`},j={class:`main-content`},te={key:0,class:`left-panel`},M={class:`element-grid`},N=[`onClick`,`title`],P={class:`graph-wrapper`},F=(0,s.defineComponent)({__name:`index`,props:{data:{},showToolbar:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},width:{default:`100%`},height:{default:`600px`},theme:{}},emits:[`ready`,`data-change`],setup(n,{expose:d,emit:v}){let y=n,b=v,x=(0,s.ref)(),S=t.n(()=>y.theme),C=t.t(()=>y.theme),{graph:w,initGraph:F,centerContent:I,zoomToFit:L,scheduleZoomToFit:R,themeOptions:z}=i.n(x,(0,s.computed)(()=>C.value===`dark`)),{exportOptions:B,handleExport:V}=i.t(w,`bpmn-diagram`),{bindInteractions:H}=a.t(w,{portPositions:f,onDataChange:()=>$(),isReadonly:()=>y.readonly}),U=(0,s.ref)(!1),W=(0,s.ref)(),G=o.t(e=>Q().find(t=>t.id===e),e=>q(y.data).find(t=>t.id===e),()=>{U.value=!1,W.value=void 0}),K=e=>String(e.attr(`text/text`)||e.attr(`label/text`)||``),q=e=>{if(!e)return[];if(Array.isArray(e))return e;let t=[];return Object.values(e).forEach(e=>{Array.isArray(e)&&t.push(...e)}),t},J=()=>{let e=f.map(e=>({tagName:`circle`,selector:`port-${e}`})),t=[`event`,`activity`,`gateway`],n={event:`circle`,activity:`rect`,gateway:`polygon`};t.forEach(t=>{l.Graph.registerNode(t,{...m[t],markup:[{tagName:n[t],selector:`body`},{tagName:`text`,selector:`text`},...e],attrs:{...m[t].attrs,...p(f,n[t])}},!0)}),l.Graph.registerEdge(`bpmn-edge`,ee,!0)},Y=t=>{if(!w.value)return;let n=t.map(t=>{let{data:n,...r}=t,i=t.shape===`bpmn-edge`?w.value.createEdge(r):w.value.createNode(r);return n&&i.setData(e.t(n)),i});w.value.resetCells(n),n.length&&R(200,50)},X=t=>{if(y.readonly||!w.value)return;let n=g[t];if(!n)return;let r=w.value.options.width/2,i=w.value.options.height/2,{data:a,...o}={id:`${t}-${Date.now()}`,x:r+Math.random()*100-50,y:i+Math.random()*100-50,...n},s=w.value.createNode(o);a&&s.setData(e.t(a)),w.value.addCell(s),$()},Z=()=>{y.readonly||(w.value?.clearCells(),$())},ne=e=>{if(y.readonly)return;G.begin(e.id);let t=e.getData()||{};W.value={id:e.id,shape:e.shape,label:K(e),description:t.description||``,assignee:t.assignee||``,x:0,y:0},U.value=!0},re=()=>{let e=W.value;if(y.readonly||!U.value||!w.value||!e||!G.consume(e.id))return;let t=w.value.getCellById(e.id);t.setData({description:e.description,assignee:e.assignee}),t.attr(`text/text`,e.label||``),t.attr(`label/text`,e.label||``),$()},ie=()=>{let e=W.value;y.readonly||!U.value||!w.value||!e||G.consume(e.id)&&(w.value.getCellById(e.id)?.remove(),$())},Q=()=>w.value?[...w.value.getNodes().map(t=>({id:t.id,shape:t.shape,x:t.getPosition().x,y:t.getPosition().y,width:t.getSize().width,height:t.getSize().height,label:K(t),data:e.t(t.getData()||{})})),...w.value.getEdges().map(t=>({id:t.id,shape:`bpmn-edge`,source:t.getSourceCellId()||``,target:t.getTargetCellId()||``,label:K(t),data:e.t(t.getData()||{}),x:0,y:0}))]:[],$=()=>{y.readonly||b(`data-change`,Q())};return(0,s.watch)(w,e=>{e instanceof l.Graph&&(o.n(e,()=>y.readonly),H(),e.on(`node:dblclick`,({node:e})=>ne(e)),e.on(`node:moved`,$),b(`ready`,e),Y(y.data===void 0?_:q(y.data)))},{immediate:!0}),(0,s.watch)(()=>y.data,e=>{w.value&&(Y(e===void 0?_:q(e)),G.validate())},{deep:!0}),(0,s.watch)(()=>y.readonly,e=>{e&&G.close()},{flush:`sync`}),(0,s.onMounted)(async()=>{J();let e=h();await F({...e,...z.value,interacting:()=>!y.readonly,connecting:{...e.connecting,validateMagnet:()=>!y.readonly,validateEdge:()=>!y.readonly,createEdge:()=>w.value.createEdge({shape:`bpmn-edge`}),validateConnection:({sourceView:e,targetView:t,sourceMagnet:n,targetMagnet:r})=>!y.readonly&&e!==t&&!!n&&!!r&&n.getAttribute(`magnet`)===`true`&&r.getAttribute(`magnet`)===`true`}})}),d({getGraph:()=>w.value,getData:Q,loadData:Y}),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:`bpmn-layout`,style:(0,s.normalizeStyle)((0,s.unref)(S))},[n.showToolbar?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,E,[(0,s.createElementVNode)(`div`,D,[(0,s.createElementVNode)(`div`,O,[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:Z,disabled:n.readonly,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:delete-outline`,size:16})]),default:(0,s.withCtx)(()=>[t[3]||=(0,s.createTextVNode)(` 清空 `,-1)]),_:1},8,[`disabled`])]),(0,s.createElementVNode)(`div`,k,[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:(0,s.unref)(I),size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:image-filter-center-focus`,size:16})]),default:(0,s.withCtx)(()=>[t[4]||=(0,s.createTextVNode)(` 居中 `,-1)]),_:1},8,[`onClick`]),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:(0,s.unref)(L),size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:fit-to-screen`,size:16})]),default:(0,s.withCtx)(()=>[t[5]||=(0,s.createTextVNode)(` 适应 `,-1)]),_:1},8,[`onClick`])]),(0,s.createElementVNode)(`div`,A,[(0,s.createVNode)((0,s.unref)(c.NDropdown),{options:(0,s.unref)(B),onSelect:t[0]||=e=>(0,s.unref)(V)(e,Q)},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:export`,size:16})]),default:(0,s.withCtx)(()=>[t[6]||=(0,s.createTextVNode)(` 导出 `,-1)]),_:1})]),_:1},8,[`options`])])])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,j,[n.showToolbar&&!n.readonly?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,te,[t[7]||=(0,s.createElementVNode)(`div`,{class:`panel-title`},`组件`,-1),(0,s.createElementVNode)(`div`,M,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(u),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:t,class:`element-item`,onClick:e=>X(t),title:e.title},[(0,s.createElementVNode)(`div`,{class:(0,s.normalizeClass)([`element-icon`,e.iconClass])},null,2),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)(e.name),1)],8,N))),128))])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,P,[(0,s.createElementVNode)(`div`,{ref_key:`containerRef`,ref:x,class:`graph-container`},null,512)])]),(0,s.createVNode)(T,{style:(0,s.normalizeStyle)((0,s.unref)(S)),show:U.value,"editing-element":W.value,"onUpdate:editingElement":t[1]||=e=>W.value=e,"onUpdate:show":t[2]||=e=>U.value=e,onSave:re,onDelete:ie},null,8,[`style`,`show`,`editing-element`])],4))}});var I=n.t(F,[[`__scopeId`,`data-v-52a4a646`]]);exports.default=I;