@robot-admin/naive-ui-components 0.14.2 → 0.15.0

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 (255) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +130 -721
  3. package/README_EN.md +137 -658
  4. package/dist/C_ActionBar.css +57 -58
  5. package/dist/C_ActionBar2.cjs +1 -1
  6. package/dist/C_ActionBar2.js +1 -1
  7. package/dist/C_AntV.css +215 -222
  8. package/dist/C_AntV2.cjs +2 -2
  9. package/dist/C_AntV2.js +2 -2
  10. package/dist/C_AudioPlayer.css +11 -12
  11. package/dist/C_AvatarGroup.css +5 -6
  12. package/dist/C_Barcode.css +1 -1
  13. package/dist/C_Breadcrumb.css +15 -17
  14. package/dist/C_Breadcrumb2.cjs +1 -1
  15. package/dist/C_Breadcrumb2.js +1 -1
  16. package/dist/C_Captcha.css +45 -47
  17. package/dist/C_Captcha2.cjs +1 -1
  18. package/dist/C_Captcha2.js +1 -1
  19. package/dist/C_Cascade.css +2 -2
  20. package/dist/C_Chat.css +8 -8
  21. package/dist/C_City.css +6 -7
  22. package/dist/C_Code.css +14 -15
  23. package/dist/C_CollapsePanel.css +12 -13
  24. package/dist/C_ContextMenu.css +31 -31
  25. package/dist/C_Cron.css +272 -275
  26. package/dist/C_Date.css +1 -1
  27. package/dist/C_Draggable.css +10 -11
  28. package/dist/C_Editor.css +2 -2
  29. package/dist/C_FilePreview.css +193 -193
  30. package/dist/C_Form.base.css +607 -601
  31. package/dist/C_Form.cjs +1 -1
  32. package/dist/C_Form.css +609 -603
  33. package/dist/C_Form.d.cts +2 -2
  34. package/dist/C_Form.d.ts +2 -2
  35. package/dist/C_Form.js +1 -1
  36. package/dist/C_FormModal.cjs +1 -1
  37. package/dist/C_FormModal.css +14 -20
  38. package/dist/C_FormModal.js +1 -1
  39. package/dist/C_FormModal2.cjs +1 -1
  40. package/dist/C_FormModal2.js +1 -1
  41. package/dist/C_FormSearch.css +53 -55
  42. package/dist/C_FormSearch2.cjs +1 -1
  43. package/dist/C_FormSearch2.js +1 -1
  44. package/dist/C_FormulaEditor.css +314 -315
  45. package/dist/C_FullCalendar.css +14 -16
  46. package/dist/C_FullCalendar2.cjs +1 -1
  47. package/dist/C_FullCalendar2.js +1 -1
  48. package/dist/C_GlobalSearch.css +2 -2
  49. package/dist/C_Guide.css +14 -15
  50. package/dist/C_Icon.css +7 -8
  51. package/dist/C_ImageCropper.css +69 -69
  52. package/dist/C_Language.css +8 -8
  53. package/dist/C_Loading.css +20 -22
  54. package/dist/C_Loading2.cjs +1 -1
  55. package/dist/C_Loading2.js +1 -1
  56. package/dist/C_Login.css +130 -135
  57. package/dist/C_Login2.cjs +1 -1
  58. package/dist/C_Login2.js +1 -1
  59. package/dist/C_Map.css +22 -23
  60. package/dist/C_Markdown.css +2 -2
  61. package/dist/C_Menu.css +2 -5
  62. package/dist/C_Menu2.cjs +1 -1
  63. package/dist/C_Menu2.js +1 -1
  64. package/dist/C_NotificationCenter.css +300 -301
  65. package/dist/C_OrgChart.css +3 -3
  66. package/dist/C_PageLoading.css +35 -39
  67. package/dist/C_QRCode.css +5 -6
  68. package/dist/C_Signature.css +5 -6
  69. package/dist/C_Skeleton.css +6 -7
  70. package/dist/C_SplitPane.css +2 -2
  71. package/dist/C_Steps.css +2 -2
  72. package/dist/C_Table.base.css +1097 -870
  73. package/dist/C_Table.cjs +1 -1
  74. package/dist/C_Table.css +1101 -874
  75. package/dist/C_Table.d.cts +1 -1
  76. package/dist/C_Table.d.ts +1 -1
  77. package/dist/C_Table.js +1 -1
  78. package/dist/C_Tabs.css +2 -2
  79. package/dist/C_TagsView.css +72 -76
  80. package/dist/C_TagsView2.cjs +1 -1
  81. package/dist/C_TagsView2.js +1 -1
  82. package/dist/C_Theme.css +7 -8
  83. package/dist/C_Time.css +1 -1
  84. package/dist/C_Timeline.css +8 -8
  85. package/dist/C_Transfer.css +10 -11
  86. package/dist/C_Tree.css +16 -17
  87. package/dist/C_Upload.css +147 -148
  88. package/dist/C_VideoPlayer.css +280 -281
  89. package/dist/C_VtableGantt.css +2 -2
  90. package/dist/C_WaterFall.css +17 -18
  91. package/dist/C_WorkFlow.css +453 -457
  92. package/dist/C_WorkFlow2.cjs +1 -1
  93. package/dist/C_WorkFlow2.js +1 -1
  94. package/dist/Card.cjs +1 -0
  95. package/dist/Card.js +1 -0
  96. package/dist/Custom.cjs +1 -0
  97. package/dist/Custom.js +1 -0
  98. package/dist/Dynamic.cjs +1 -0
  99. package/dist/Dynamic.js +1 -0
  100. package/dist/Steps.cjs +1 -0
  101. package/dist/Steps.js +1 -0
  102. package/dist/Tabs.cjs +1 -0
  103. package/dist/Tabs.js +1 -0
  104. package/dist/cascader.cjs +1 -0
  105. package/dist/cascader.js +1 -0
  106. package/dist/color-picker.cjs +1 -0
  107. package/dist/color-picker.js +1 -0
  108. package/dist/constants.d.cts +1 -1
  109. package/dist/constants.d.ts +1 -1
  110. package/dist/constants3.d.cts +5 -5
  111. package/dist/constants3.d.ts +5 -5
  112. package/dist/constants4.d.cts +4 -4
  113. package/dist/constants4.d.ts +4 -4
  114. package/dist/constants5.d.cts +2 -2
  115. package/dist/constants5.d.ts +2 -2
  116. package/dist/context.cjs +1 -0
  117. package/dist/context.js +1 -0
  118. package/dist/contracts.d.cts +24 -0
  119. package/dist/contracts.d.ts +24 -0
  120. package/dist/createPageLoading.cjs +1 -1
  121. package/dist/createPageLoading.js +1 -1
  122. package/dist/data.cjs +1 -1
  123. package/dist/data.d.cts +9 -9
  124. package/dist/data.d.ts +9 -9
  125. package/dist/data.js +1 -1
  126. package/dist/date-picker.cjs +1 -0
  127. package/dist/date-picker.js +1 -0
  128. package/dist/feedback.cjs +1 -0
  129. package/dist/feedback.js +1 -0
  130. package/dist/helpers.cjs +1 -1
  131. package/dist/helpers.js +1 -1
  132. package/dist/index.cjs +1 -1
  133. package/dist/index.d.cts +6 -4
  134. package/dist/index.d.ts +6 -4
  135. package/dist/index.js +1 -1
  136. package/dist/index.vue.d.cts +4 -4
  137. package/dist/index.vue.d.ts +4 -4
  138. package/dist/index10.vue.d.cts +3 -3
  139. package/dist/index11.vue.d.ts +2 -2
  140. package/dist/index12.vue.d.cts +2 -2
  141. package/dist/index12.vue.d.ts +1 -1
  142. package/dist/index13.vue.d.cts +1 -1
  143. package/dist/index13.vue.d.ts +3 -3
  144. package/dist/index14.vue.d.cts +3 -3
  145. package/dist/index14.vue.d.ts +7 -7
  146. package/dist/index15.vue.d.cts +7 -7
  147. package/dist/index16.vue.d.ts +1 -1
  148. package/dist/index17.vue.d.cts +1 -1
  149. package/dist/index17.vue.d.ts +1 -1
  150. package/dist/index18.vue.d.cts +1 -1
  151. package/dist/index18.vue.d.ts +1 -1
  152. package/dist/index19.vue.d.cts +1 -1
  153. package/dist/index19.vue.d.ts +2 -9
  154. package/dist/index2.vue.d.cts +2 -2
  155. package/dist/index2.vue.d.ts +2 -2
  156. package/dist/index20.vue.d.cts +1 -1
  157. package/dist/index20.vue.d.ts +1 -1
  158. package/dist/index21.vue.d.cts +1 -1
  159. package/dist/index21.vue.d.ts +1 -1
  160. package/dist/index22.vue.d.cts +2 -2
  161. package/dist/index22.vue.d.ts +2 -2
  162. package/dist/index23.vue.d.cts +1 -1
  163. package/dist/index23.vue.d.ts +1 -1
  164. package/dist/index25.vue.d.cts +4 -4
  165. package/dist/index25.vue.d.ts +4 -4
  166. package/dist/index26.vue.d.cts +1 -1
  167. package/dist/index26.vue.d.ts +1 -1
  168. package/dist/index27.vue.d.cts +4 -4
  169. package/dist/index27.vue.d.ts +4 -4
  170. package/dist/index28.vue.d.cts +1 -1
  171. package/dist/index28.vue.d.ts +1 -1
  172. package/dist/index3.vue.d.cts +4 -4
  173. package/dist/index3.vue.d.ts +4 -4
  174. package/dist/index4.vue.d.cts +2 -9
  175. package/dist/index6.vue.d.ts +3 -3
  176. package/dist/index7.vue.d.cts +3 -3
  177. package/dist/index8.vue.d.ts +2 -2
  178. package/dist/index9.vue.d.cts +2 -2
  179. package/dist/index9.vue.d.ts +3 -3
  180. package/dist/mapUtils.d.cts +2 -2
  181. package/dist/mapUtils.d.ts +2 -2
  182. package/dist/presets.d.cts +8 -2
  183. package/dist/presets.d.ts +8 -2
  184. package/dist/rate.cjs +1 -0
  185. package/dist/rate.js +1 -0
  186. package/dist/slider.cjs +1 -0
  187. package/dist/slider.js +1 -0
  188. package/dist/style.css +10898 -10915
  189. package/dist/time-picker.cjs +1 -0
  190. package/dist/time-picker.js +1 -0
  191. package/dist/upload.cjs +1 -0
  192. package/dist/upload.js +1 -0
  193. package/dist/useActionTask.cjs +1 -0
  194. package/dist/useActionTask.js +1 -0
  195. package/dist/useCalendarEvents.d.cts +1 -1
  196. package/dist/useCalendarEvents.d.ts +1 -1
  197. package/dist/useCollapsePanel.d.cts +4 -4
  198. package/dist/useCollapsePanel.d.ts +4 -4
  199. package/dist/useComponentLocale.cjs +1 -0
  200. package/dist/useComponentLocale.js +1 -0
  201. package/dist/useCropperCore.d.cts +6 -6
  202. package/dist/useCropperCore.d.ts +6 -6
  203. package/dist/useDraggableLayout.d.cts +1 -1
  204. package/dist/useDraggableLayout.d.ts +1 -1
  205. package/dist/useDynamicFormState.cjs +1 -0
  206. package/dist/useDynamicFormState.d.cts +64 -40
  207. package/dist/useDynamicFormState.d.ts +64 -40
  208. package/dist/useDynamicFormState.js +1 -0
  209. package/dist/useEdgeInteraction.d.cts +3 -3
  210. package/dist/useEdgeInteraction.d.ts +3 -3
  211. package/dist/useGlobalSearch.d.cts +1 -1
  212. package/dist/useGlobalSearch.d.ts +1 -1
  213. package/dist/useQRCode.d.cts +2 -2
  214. package/dist/useQRCode.d.ts +2 -2
  215. package/dist/useSearchState.d.cts +15 -725
  216. package/dist/useSearchState.d.ts +15 -834
  217. package/dist/useSignatureHistory.d.cts +4 -4
  218. package/dist/useSignatureHistory.d.ts +4 -4
  219. package/dist/useSplitResize.d.cts +3 -3
  220. package/dist/useSplitResize.d.ts +3 -3
  221. package/dist/useTableQuery.cjs +3 -3
  222. package/dist/useTableQuery.d.cts +73 -34
  223. package/dist/useTableQuery.d.ts +73 -34
  224. package/dist/useTableQuery.js +3 -3
  225. package/dist/useTimeSelection.d.cts +1 -1
  226. package/dist/useTimeSelection.d.ts +1 -1
  227. package/dist/useTreeOperations.d.cts +5 -5
  228. package/dist/useTreeOperations.d.ts +5 -5
  229. package/dist/useWorkflowValidation.d.cts +3 -3
  230. package/dist/useWorkflowValidation.d.ts +3 -3
  231. package/dist/verification.d.cts +4 -4
  232. package/dist/verification.d.ts +4 -4
  233. package/docs/architecture.en.md +83 -0
  234. package/docs/architecture.md +83 -0
  235. package/docs/assets/README.md +47 -0
  236. package/docs/assets/naive-ui-components-banner.png +0 -0
  237. package/docs/assets/naive-ui-components-banner.svg +69 -0
  238. package/docs/assets/naive-ui-components-logo.png +0 -0
  239. package/docs/assets/naive-ui-components-logo.svg +22 -0
  240. package/docs/components.en.md +118 -0
  241. package/docs/components.md +118 -0
  242. package/docs/engineering.en.md +132 -0
  243. package/docs/engineering.md +133 -0
  244. package/docs/guides/usage.en.md +638 -0
  245. package/docs/guides/usage.md +699 -0
  246. package/docs/performance-0.15.0.md +20 -0
  247. package/docs/security-scan-2026-10-06.md +11 -0
  248. package/docs/security-scan-2026-10-18.md +16 -0
  249. package/package.json +35 -12
  250. package/dist/C_Form2.cjs +0 -1
  251. package/dist/C_Form2.js +0 -1
  252. package/dist/config.cjs +0 -1
  253. package/dist/config.d.cts +0 -33
  254. package/dist/config.d.ts +0 -33
  255. package/dist/config.js +0 -1
@@ -0,0 +1,83 @@
1
+ [← Project README](../README_EN.md) · [中文](./architecture.md)
2
+
3
+ # Architecture and isolation
4
+
5
+ This library remains the independently maintained Naive UI adapter. A future Element Plus package will serve other applications with its own installation and releases. Adapters can share business protocols and proven logic, while keeping UI components, types and styles independent.
6
+
7
+ ## Current boundaries
8
+
9
+ | Layer | Responsibility | Constraint |
10
+ | ------------------------------------ | ------------------------------------------------------------ | ---------------------------------------------------------------- |
11
+ | `src/core/` | Feedback/locale protocols, dictionaries and pure translation | No Vue, UI library, browser environment or ambient runtime state |
12
+ | `src/context.ts`, `src/composables/` | Vue injection keys and locale context | No Naive message/dialog implementation |
13
+ | `src/adapters/naive/` | Naive Message/Dialog integration | UI-specific feedback stays here |
14
+ | `src/components/` | Existing `C_*` components, Naive types and views | Preserve existing APIs; these are not a generic UI core |
15
+ | `src/config.ts` | Compatibility exports | Preserve established import paths |
16
+
17
+ The core is currently an internal boundary, not a separately published package. A real Element Plus pilot will determine what becomes shared. The new adapter must not depend on this whole Naive package. Naive `FormInst`, native field behavior and `DataTableBaseColumn` remain adapter-specific.
18
+
19
+ ## Dependencies and published entries
20
+
21
+ - Component subpaths load their own component graph and support page/route-level loading.
22
+ - Full installation registers the public `C_*` names, avoiding collisions between inferred `index.vue` names or a host application's `index` component.
23
+ - The root entry aggregates all components, including navigation, and preserves full installation. Runtime root imports require the optional `vue-router` peer, even for a non-routing named export. Applications without a router should use component subpaths.
24
+ - `sortablejs` is needed only for the corresponding drag features. Selective JS loading does not mean ordinary runtime dependencies are selectively installed.
25
+ - ESM resolves `.d.ts`; CJS resolves `.d.cts`. Each declaration condition matches its JavaScript format.
26
+ - All public reachable declarations are checked for `naive-ui/es/*` and `naive-ui/lib/*` internal imports, in both formats.
27
+
28
+ The consumer contract check unpacks a real tarball into a temporary directory and attaches the repository's resolved dependencies. It covers Node16/NodeNext ESM/CJS types and subpath runtime imports without optional peers. It does not reinstall online, so it does not replace minimum/latest dependency matrices or application acceptance.
29
+
30
+ ## Highlight instances
31
+
32
+ ```ts
33
+ import {
34
+ createHighlight,
35
+ setupHighlight,
36
+ } from '@robot-admin/naive-ui-components'
37
+
38
+ const standalone = createHighlight({ autoDetect: true })
39
+ const application = setupHighlight(app, { autoDetect: false })
40
+ ```
41
+
42
+ Every `createHighlight()` and `setupHighlight()` owns its hljs instance, registered languages and loading state. In component setup, `useHighlight()` prefers the application's injected API; outside that context it creates an independent API. Retain an API explicitly when multiple calls should share it.
43
+
44
+ `window.hljs` is untouched by default. Legacy consumers can explicitly use `setupHighlight(app, { exposeToWindow: true })`; unmount restores the previous property according to ownership and preserves subsequent host updates. The `highlightManager` injection key remains compatible.
45
+
46
+ ## Form renderer registries
47
+
48
+ ```ts
49
+ import { createApp, h } from 'vue'
50
+ import { NInput } from 'naive-ui'
51
+ import Components, {
52
+ createFormRendererRegistry,
53
+ } from '@robot-admin/naive-ui-components'
54
+ import App from './App.vue'
55
+
56
+ const renderers = createFormRendererRegistry({
57
+ input: props => h(NInput, { ...props, clearable: true }),
58
+ })
59
+
60
+ createApp(App).use(Components, { formRenderers: renderers }).mount('#app')
61
+ ```
62
+
63
+ The full plugin creates a registry per application by default. Sharing is explicit by passing the same registry. With local component imports, use `app.provide(FORM_RENDERER_REGISTRY_KEY, registry)`; both the factory and key are also exported from the `C_Form` subpath.
64
+
65
+ Precedence is: component `renderers` → independent registry → built-in renderer. Independent registries do not fall back to the legacy global registry. Registration returns an identity-bound disposer; a stale disposer cannot remove a newer registration, and runtime additions/removals update components.
66
+
67
+ `registerRenderer()` / `unregisterRenderer()` remain explicit legacy global APIs for consumers without an independent registry. Existing full-plugin applications should migrate custom renderers to `formRenderers` or register on that same registry, rather than expecting global updates to affect installed applications.
68
+
69
+ ## Element Plus roadmap
70
+
71
+ 1. Stabilize current Naive entrypoints, styles, consumers and isolation contracts.
72
+ 2. Introduce an independent Element Plus package with a real business pilot for forms, search, tables, form dialogs and actions.
73
+ 3. Reuse `form-validate` RuleSpec, `request-core/vue` Headless CRUD and `theme/core` / `theme/tokens` where applicable.
74
+ 4. Extract neutral field, column, validation and state protocols from the pilot. UI props, events, instances and rendering stay in their adapters.
75
+ 5. Keep each package's UI peers, builds, releases and CSS entries independent. Installing one for an application must not require the other UI library.
76
+
77
+ Running both UI libraries in one application is outside this iteration. That would additionally require registration names, style namespaces, overlay targets and theme ownership checks. Element Plus documents coordinated [ConfigProvider/SCSS namespaces](https://element-plus.org/en-US/guide/namespace.html) and [scoped theme variables](https://element-plus.org/en-US/guide/theming.html).
78
+
79
+ ## Acceptance
80
+
81
+ Verify behavior through published consumers, public types, multiple applications, dynamic registration, unmount and host-state restoration. Source-level dependency guards complement runtime verification.
82
+
83
+ `bun run verify` is the local quality gate. `bun run check:audit` remains a separate check and CI gate. Record actual advisory results; do not hide them by disabling checks or forcing unverified major versions.
@@ -0,0 +1,83 @@
1
+ [← 项目首页](../README.md) · [English](./architecture.en.md)
2
+
3
+ # 架构与隔离边界
4
+
5
+ 本组件库继续作为 Naive UI 的独立适配包维护。未来 Element Plus 面向其他项目独立安装、独立发布;两套呈现层共享业务协议和经过实际验证的逻辑,不相互依赖组件、类型或样式。
6
+
7
+ ## 本轮收敛范围
8
+
9
+ | 层级 | 当前职责 | 边界 |
10
+ | ------------------------------------ | ------------------------------------ | --------------------------------------- |
11
+ | `src/core/` | 反馈/语言协议、默认语言和纯翻译函数 | 无 Vue、UI 库、浏览器环境与全局运行状态 |
12
+ | `src/context.ts`、`src/composables/` | Vue 注入键与语言上下文绑定 | 不承担 Naive 消息、弹窗实现 |
13
+ | `src/adapters/naive/` | Naive Message / Dialog 适配 | Naive 消息/弹窗反馈留在适配层 |
14
+ | `src/components/` | 现有 `C_*` 组件、Naive 类型与呈现 | 保留稳定 API,不假装为通用 UI 内核 |
15
+ | `src/config.ts` | 原有配置导入的兼容入口 | 对已有消费者保留导出路径 |
16
+
17
+ 目前 `core` 是仓库内部边界,尚未发布独立公共 core 包。未来通过 Element Plus 的真实场景提取共享包,不让新适配器依赖整个 Naive 包。现有表单的 `FormInst`、原生字段与表格的 `DataTableBaseColumn` 继续属于 Naive 层。
18
+
19
+ ## 依赖与发布入口
20
+
21
+ - 组件子路径消费目标组件及其依赖,适合独立页面和路由加载。
22
+ - 全量插件使用公开的 `C_*` 名称注册组件,不以 SFC 的编译推断名注册,避免多个 `index.vue` 互相覆盖或覆盖宿主的 `index` 组件。
23
+ - 根入口聚合全部组件并保留全量安装语义,包含导航组件;运行时导入根入口需要安装可选 peer `vue-router`,即使只使用根入口中的非路由组件。无需路由的项目优先使用组件子路径。
24
+ - `sortablejs` 只在启用对应拖拽功能时需要。可选 peer 与 JS 按需加载不意味着普通运行依赖也按需安装。
25
+ - ESM 使用 `.d.ts`,CJS 使用 `.d.cts`;条件类型入口与相应 JavaScript 格式对应。
26
+ - 公共可达声明同时检查 ESM / CJS,不能引用 `naive-ui/es/*` 或 `naive-ui/lib/*` 内部路径。
27
+
28
+ 新增消费者契约验证使用真实 tarball,在临时目录解包并接入仓库已解析的依赖;覆盖 Node16 / NodeNext 的 ESM / CJS 类型与缺失可选 peer 的子路径运行行为。它不联网重新安装依赖,因此不能代替最低/最新依赖版本矩阵或真实应用验收。
29
+
30
+ ## 高亮实例
31
+
32
+ ```ts
33
+ import {
34
+ createHighlight,
35
+ setupHighlight,
36
+ } from '@robot-admin/naive-ui-components'
37
+
38
+ const standalone = createHighlight({ autoDetect: true })
39
+ const application = setupHighlight(app, { autoDetect: false })
40
+ ```
41
+
42
+ `createHighlight()`、每次 `setupHighlight()` 均独立持有 hljs、语言注册和加载状态。组件 `setup` 中的 `useHighlight()` 优先读取当前应用注入;独立上下文调用则创建自己的 API。需要跨调用复用时,保留并传递同一个 API,不能依赖模块单例。
43
+
44
+ 默认不会写入 `window.hljs`。确实依赖旧窗口 API 的应用可显式使用 `setupHighlight(app, { exposeToWindow: true })`;卸载时按所有权恢复原属性,宿主后续覆盖的值不会被回收。现有 `highlightManager` 注入键及组件消费方式保留。
45
+
46
+ ## 表单渲染器
47
+
48
+ ```ts
49
+ import { createApp, h } from 'vue'
50
+ import { NInput } from 'naive-ui'
51
+ import Components, {
52
+ createFormRendererRegistry,
53
+ } from '@robot-admin/naive-ui-components'
54
+ import App from './App.vue'
55
+
56
+ const renderers = createFormRendererRegistry({
57
+ input: props => h(NInput, { ...props, clearable: true }),
58
+ })
59
+
60
+ createApp(App).use(Components, { formRenderers: renderers }).mount('#app')
61
+ ```
62
+
63
+ 全量插件默认为每个应用创建独立 registry;显式传入同一 registry 才共享。局部注册组件的应用可以使用 `app.provide(FORM_RENDERER_REGISTRY_KEY, registry)`,工厂和键也从 `C_Form` 子路径导出。
64
+
65
+ 优先级为:组件实例的 `renderers` → 独立 registry → 内置 renderer。独立 registry 不回退到 legacy 全局注册表。`register()` 返回身份绑定的注销函数;覆盖后调用旧注销函数不会删除新注册,运行时增删也会更新组件。
66
+
67
+ `registerRenderer()` / `unregisterRenderer()` 仍作为显式 legacy 全局 API 保留,只用于没有独立 registry 的旧消费路径。已有全量插件项目应将自定义渲染器改为传入 `formRenderers`,或在同一个 registry 上注册;不再依赖全局注册影响已安装的其他应用。
68
+
69
+ ## Element Plus 演进顺序
70
+
71
+ 1. 保持 Naive 入口、样式和既有业务消费稳定,先收敛当前发布与状态隔离问题。
72
+ 2. 新建独立 Element Plus 适配包,从表单、查询、表格、表单弹窗和操作栏选择真实业务试点。
73
+ 3. 优先复用现有 `form-validate` 的 RuleSpec、`request-core/vue` 的 Headless CRUD,以及 `theme/core` / `theme/tokens`;不复制同一套数据状态机。
74
+ 4. 由试点提取中立字段、列、校验和状态协议;具体 UI props、事件映射、实例与渲染器分别留在各适配包。
75
+ 5. 两个包各自声明 UI peer、构建、发布和样式入口。独立应用安装其中一个时,不要求另一个 UI 库。
76
+
77
+ 本轮不要求同一应用同时运行两套 UI。未来如果新增该需求,需要另验组件注册名、样式命名空间、弹层挂载与主题所有权;Element Plus 的[命名空间](https://element-plus.org/en-US/guide/namespace.html)需要 ConfigProvider 与 SCSS 配置一致,其[主题文档](https://element-plus.org/en-US/guide/theming.html)也建议按局部类作用域覆盖变量。
78
+
79
+ ## 验收原则
80
+
81
+ 测试验证实际行为:发布消费者、稳定公共类型、双应用配置、动态注册/注销、卸载与宿主状态恢复。源码结构守卫只负责依赖方向,不能代替实际运行测试。
82
+
83
+ `bun run verify` 覆盖本地完整质量门禁;`bun run check:audit` 保留独立执行与 CI 门禁。审计告警需按真实结果处理,不通过关闭门禁或未验证的主版本覆盖隐藏风险。
@@ -0,0 +1,47 @@
1
+ # 品牌资源 / Brand assets
2
+
3
+ 沿用 Robot 家族的几何 R、机器人双眼和天线,以绿色区分 Naive UI 组件库;右下角模块表示组件独立导入。标识用于本项目文档,不代表 Naive UI 官方品牌。
4
+
5
+ | 文件 | 用途 |
6
+ | ------------------------------------------------------------------ | -------------------------------- |
7
+ | [naive-ui-components-logo.svg](./naive-ui-components-logo.svg) | 128 × 128,透明背景,可缩放 Logo |
8
+ | [naive-ui-components-logo.png](./naive-ui-components-logo.png) | 512 × 512,透明背景,通用预览 |
9
+ | [naive-ui-components-banner.svg](./naive-ui-components-banner.svg) | 1280 × 420,可编辑封面源文件 |
10
+ | [naive-ui-components-banner.png](./naive-ui-components-banner.png) | 2560 × 840,README 高清封面 |
11
+
12
+ 主色为 `#249D70` / `#0C5E47`,强调色为 `#A7F3CB`,封面底色为 `#0B1C19`。封面右侧是表单、表格与流程的示意插画。
13
+
14
+ SVG 自包含,无外部字体、脚本、图片或网络请求。中英文 README 共用英文封面;项目定位与操作说明在各自正文中提供。
15
+
16
+ 修改 SVG 后,在具备 Playwright 和 Chromium 的环境中执行以下导出示例。`playwright` 是文档导出工具,组件库运行时无需安装。
17
+
18
+ ```js
19
+ import { chromium } from 'playwright'
20
+ import { resolve } from 'node:path'
21
+ import { pathToFileURL } from 'node:url'
22
+
23
+ const browser = await chromium.launch()
24
+ try {
25
+ for (const [name, width, height, scale] of [
26
+ ['banner', 1280, 420, 2],
27
+ ['logo', 128, 128, 4],
28
+ ]) {
29
+ const page = await browser.newPage({
30
+ viewport: { width, height },
31
+ deviceScaleFactor: scale,
32
+ })
33
+ const base = resolve(`docs/assets/naive-ui-components-${name}`)
34
+ await page.goto(pathToFileURL(`${base}.svg`).href)
35
+ await page
36
+ .locator('svg')
37
+ .first()
38
+ .screenshot({
39
+ path: `${base}.png`,
40
+ omitBackground: true,
41
+ })
42
+ await page.close()
43
+ }
44
+ } finally {
45
+ await browser.close()
46
+ }
47
+ ```
@@ -0,0 +1,69 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1280" height="420" viewBox="0 0 1280 420" role="img" aria-labelledby="title description">
2
+ <title id="title">Robot Naive UI Components</title>
3
+ <desc id="description">55 Vue 3 business components. Typed configuration, independent component entries and scoped styles, in the Robot ecosystem.</desc>
4
+ <defs>
5
+ <linearGradient id="background" x1="0" y1="0" x2="1280" y2="420" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#0B1C19"/><stop offset="1" stop-color="#102B24"/>
7
+ </linearGradient>
8
+ <linearGradient id="tile" x1="8" y1="4" x2="120" y2="128" gradientUnits="userSpaceOnUse">
9
+ <stop stop-color="#249D70"/><stop offset="1" stop-color="#0C5E47"/>
10
+ </linearGradient>
11
+ <linearGradient id="shine" x1="20" y1="0" x2="110" y2="120" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#FFF" stop-opacity=".16"/><stop offset="1" stop-color="#FFF" stop-opacity="0"/>
13
+ </linearGradient>
14
+ <pattern id="grid" width="32" height="32" patternUnits="userSpaceOnUse">
15
+ <path d="M32 0H0V32" fill="none" stroke="#A7F3CB" stroke-opacity=".035"/>
16
+ </pattern>
17
+ <radialGradient id="glow">
18
+ <stop stop-color="#49CF91" stop-opacity=".13"/><stop offset="1" stop-color="#49CF91" stop-opacity="0"/>
19
+ </radialGradient>
20
+ <clipPath id="bounds"><rect width="1280" height="420" rx="24"/></clipPath>
21
+ </defs>
22
+ <g clip-path="url(#bounds)">
23
+ <rect width="1280" height="420" fill="url(#background)"/>
24
+ <rect width="1280" height="420" fill="url(#grid)"/>
25
+ <ellipse cx="1080" cy="150" rx="340" ry="270" fill="url(#glow)"/>
26
+ <path d="M64 326H1216" stroke="#94B5A5" stroke-opacity=".18"/>
27
+ <!-- Robot family R mark; the detached tile represents independent components. -->
28
+ <svg x="60" y="112" width="130" height="130" viewBox="0 0 128 128">
29
+ <rect x="2" y="2" width="124" height="124" rx="30" fill="url(#tile)"/>
30
+ <rect x="2.5" y="2.5" width="123" height="123" rx="29.5" fill="url(#shine)" stroke="#FFF" stroke-opacity=".2"/>
31
+ <path d="M35 99V35H69C86 35 96 44 96 60C96 72 90 80 81 83L99 99H78L61 85H51V99H35ZM51 51V69H68C75 69 79 66 79 60C79 54 75 51 68 51H51Z" fill="#F2FFF7"/>
32
+ <path d="M66 34V28" stroke="#F2FFF7" stroke-width="4" stroke-linecap="round"/>
33
+ <circle cx="66" cy="23" r="4" fill="#A7F3CB"/>
34
+ <rect x="55" y="56" width="5" height="7" rx="2.5" fill="#64D8A0"/>
35
+ <rect x="67" y="56" width="5" height="7" rx="2.5" fill="#64D8A0"/>
36
+ <rect x="103" y="99" width="21" height="21" rx="6" fill="#B5F5D3" stroke="#0C5E47" stroke-width="3"/>
37
+ </svg>
38
+ <g font-family="-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif">
39
+ <text x="64" y="62" fill="#8BAE9E" font-size="12" font-weight="600" letter-spacing="2.4">ROBOT ECOSYSTEM / COMPONENT LIBRARY</text>
40
+ <text x="224" y="155" fill="#F2FFF7" font-size="52" font-weight="750" letter-spacing="-1.8">Naive UI Components</text>
41
+ <text x="227" y="196" fill="#B4CFC1" font-size="18">Business interfaces, composed with confidence.</text>
42
+ <text x="227" y="234" fill="#72DDA6" font-size="15" font-family="SFMono-Regular,Consolas,monospace">@robot-admin/naive-ui-components</text>
43
+ <text x="227" y="278" fill="#809F90" font-size="13">Forms · Tables · Editors · Workflow · Media</text>
44
+ <g font-size="12" font-weight="600" letter-spacing="1.4">
45
+ <text x="64" y="369" fill="#A7F3CB">55 COMPONENTS</text>
46
+ <text x="318" y="369" fill="#AFC9BC">VUE 3 + TYPESCRIPT</text>
47
+ <text x="633" y="369" fill="#AFC9BC">PER-COMPONENT IMPORTS</text>
48
+ <text x="1018" y="369" fill="#AFC9BC">OPEN SOURCE / MIT</text>
49
+ </g>
50
+ </g>
51
+ <!-- A composition of a form, a table and a flow; an illustration, not an application screenshot. -->
52
+ <g transform="translate(936 88)" stroke="#5C9D7F" stroke-width="1.3">
53
+ <path d="M70 84H96V50H140M96 50V156H154" fill="none" stroke="#72DDA6" stroke-opacity=".5"/>
54
+ <rect x="0" y="0" width="120" height="144" rx="12" fill="#112E25"/>
55
+ <path d="M0 29H120" stroke-opacity=".5"/>
56
+ <g fill="#83B79D" stroke="none"><circle cx="14" cy="15" r="2"/><circle cx="22" cy="15" r="2"/><circle cx="30" cy="15" r="2"/></g>
57
+ <g fill="#153C2F" stroke="#416B56"><rect x="16" y="45" width="88" height="20" rx="4"/><rect x="16" y="77" width="88" height="20" rx="4"/></g>
58
+ <rect x="60" y="111" width="44" height="17" rx="4" fill="#64D8A0" stroke="none"/>
59
+ <path d="M23 55H62M23 87H77" stroke="#81AA94" stroke-linecap="round"/>
60
+ <rect x="146" y="-13" width="122" height="101" rx="12" fill="#183C2E"/>
61
+ <path d="M146 14H268M146 39H268M146 63H268M183 14V88M224 14V88" stroke-opacity=".45"/>
62
+ <rect x="159" y="-1" width="44" height="4" rx="2" fill="#8ACBA8" stroke="none"/>
63
+ <g fill="#73DFA7" stroke="none"><rect x="157" y="23" width="14" height="5" rx="2"/><rect x="193" y="48" width="20" height="5" rx="2"/><rect x="235" y="72" width="20" height="5" rx="2"/></g>
64
+ <rect x="145" y="123" width="114" height="96" rx="12" fill="#112E25"/>
65
+ <path d="M202 149V184M175 184H229" fill="none" stroke="#72DDA6" stroke-opacity=".7"/>
66
+ <g fill="#285B42" stroke="#72DDA6"><rect x="187" y="139" width="30" height="19" rx="4"/><rect x="162" y="178" width="27" height="19" rx="4"/><rect x="216" y="178" width="27" height="19" rx="4"/></g>
67
+ </g>
68
+ </g>
69
+ </svg>
@@ -0,0 +1,22 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128" role="img" aria-labelledby="title description">
2
+ <title id="title">Robot Naive UI Components logo</title>
3
+ <desc id="description">The Robot R monogram with two robot eyes, an antenna and a modular mint-green tile.</desc>
4
+ <defs>
5
+ <linearGradient id="tile" x1="8" y1="4" x2="120" y2="128" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#249D70"/>
7
+ <stop offset="1" stop-color="#0C5E47"/>
8
+ </linearGradient>
9
+ <linearGradient id="shine" x1="20" y1="0" x2="110" y2="120" gradientUnits="userSpaceOnUse">
10
+ <stop stop-color="#FFF" stop-opacity=".16"/>
11
+ <stop offset="1" stop-color="#FFF" stop-opacity="0"/>
12
+ </linearGradient>
13
+ </defs>
14
+ <rect x="2" y="2" width="124" height="124" rx="30" fill="url(#tile)"/>
15
+ <rect x="2.5" y="2.5" width="123" height="123" rx="29.5" fill="url(#shine)" stroke="#FFF" stroke-opacity=".2"/>
16
+ <path d="M35 99V35H69C86 35 96 44 96 60C96 72 90 80 81 83L99 99H78L61 85H51V99H35ZM51 51V69H68C75 69 79 66 79 60C79 54 75 51 68 51H51Z" fill="#F2FFF7"/>
17
+ <path d="M66 34V28" stroke="#F2FFF7" stroke-width="4" stroke-linecap="round"/>
18
+ <circle cx="66" cy="23" r="4" fill="#A7F3CB"/>
19
+ <rect x="55" y="56" width="5" height="7" rx="2.5" fill="#64D8A0"/>
20
+ <rect x="67" y="56" width="5" height="7" rx="2.5" fill="#64D8A0"/>
21
+ <rect x="103" y="99" width="21" height="21" rx="6" fill="#B5F5D3" stroke="#0C5E47" stroke-width="3"/>
22
+ </svg>
@@ -0,0 +1,118 @@
1
+ [← English README](../README_EN.md) · [中文](./components.md)
2
+
3
+ # Component catalog
4
+
5
+ > 💡 All components provide **interactive live demos**. Visit the [Component Docs](https://www.tzagileteam.com/robot/components/preface) to try them out in real-time (rendered via iframe from Robot Admin production).
6
+
7
+ ## Basic Components
8
+
9
+ | Component | Description | External Deps |
10
+ | ---------------- | ------------------------- | ----------------------------- |
11
+ | `C_Icon` | Iconify icon wrapper | `@iconify/vue` |
12
+ | `C_Loading` | Theme-aware SVG loading | - |
13
+ | `C_PageLoading` | Theme-aware page loading | - |
14
+ | `C_Code` | Code highlighting | `highlight.js` |
15
+ | `C_Barcode` | Barcode generator | `@chenfengyuan/vue-barcode` |
16
+ | `C_Captcha` | Puzzle / ALTCHA captcha | `vue3-puzzle-vcode`, `altcha` |
17
+ | `C_Cascade` | Cascade panel selector | - |
18
+ | `C_Guide` | User guide / tour | `driver.js` |
19
+ | `C_Progress` | Enhanced progress bar | - |
20
+ | `C_Steps` | Step bar | - |
21
+ | `C_ActionBar` | Action button bar | - |
22
+ | `C_Theme` | Theme switcher | - |
23
+ | `C_Language` | Language switcher | - |
24
+ | `C_Date` | Enhanced date picker | - |
25
+ | `C_City` | Province / city selector | - |
26
+ | `C_Breadcrumb` | Breadcrumb navigation | - |
27
+ | `C_Menu` | Navigation menu | - |
28
+ | `C_Tabs` | Data-driven scenario tabs | - |
29
+ | `C_TagsView` | Tab-based navigation | - |
30
+ | `C_GlobalSearch` | Global search panel | - |
31
+ | `C_AvatarGroup` | Avatar group display | - |
32
+ | `C_OrgChart` | Organization chart | - |
33
+ | `C_Skeleton` | Skeleton placeholder | - |
34
+
35
+ ## Content & Editor Components
36
+
37
+ | Component | Description | External Deps |
38
+ | ----------------- | ---------------------------- | ------------------------- |
39
+ | `C_Editor` | Rich text editor | `@wangeditor-next/editor` |
40
+ | `C_Markdown` | Markdown editor/preview | `md-editor-v3` |
41
+ | `C_FormulaEditor` | Formula editor (safe parser) | Built in |
42
+ | `C_Signature` | Electronic signature | - |
43
+ | `C_QRCode` | QR code generator | `qrcode` |
44
+ | `C_ImageCropper` | Image cropper | `vue-cropper` |
45
+
46
+ ## Data Display Components
47
+
48
+ | Component | Description | External Deps |
49
+ | ---------------- | -------------------------------------------- | -------------------------- |
50
+ | `C_Table` | Advanced data table (CRUD/inline edit/print) | `print-js`, `html2canvas` |
51
+ | `C_Map` | Map component (OSM/AMap) | `leaflet` |
52
+ | `C_VtableGantt` | Gantt chart | `@visactor/vtable-gantt` |
53
+ | `C_AntV` | Graph editor (ER/BPMN/UML) | `@antv/x6`, `html2canvas` |
54
+ | `C_WaterFall` | Waterfall layout | - |
55
+ | `C_FullCalendar` | Calendar events | `@fullcalendar/*` |
56
+ | `C_VideoPlayer` | Video player (HLS/subtitles/bookmarks) | `xgplayer`, `xgplayer-hls` |
57
+ | `C_AudioPlayer` | Audio player (waveform/progress/playlist) | - |
58
+ | `C_FilePreview` | File preview (PDF/Word/Excel) | `xlsx`, `mammoth` |
59
+ | `C_Timeline` | Timeline (vertical/horizontal/collapsible) | - |
60
+
61
+ Image/calendar behavior notes: `C_ImageCropper` flips the actual source and resets the current crop position; load/export failures emit `error: Error`. `C_Signature` readonly mode blocks user interaction but keeps exposed methods available for loading saved data. Its SVG export embeds the rendered raster canvas. `C_QRCode` uses the same raster-in-SVG approach when a logo is present so preview and export match. `C_FullCalendar` creates same-day events in local calendar time. `C_WaterFall` relayouts from actual image aspect ratios; give each item a stable unique `id`.
62
+
63
+ ## Form & Layout Components
64
+
65
+ | Component | Description | External Deps |
66
+ | ----------------- | ------------------------------------------------- | -------------------- |
67
+ | `C_Form` | Dynamic form engine (Grid/Tabs/Steps/Card layout) | - |
68
+ | `C_FormModal` | Data-driven create/edit form modal | - |
69
+ | `C_FormSearch` | Search form | - |
70
+ | `C_CollapsePanel` | Collapse panel | - |
71
+ | `C_SplitPane` | Split pane | - |
72
+ | `C_Draggable` | Drag & drop sorting | `vue-draggable-plus` |
73
+ | `C_Tree` | Advanced tree control | - |
74
+ | `C_Time` | Enhanced time picker | - |
75
+ | `C_Cron` | Cron expression editor | - |
76
+ | `C_Transfer` | Transfer / shuttle box | - |
77
+
78
+ ## Interactive & Business Components
79
+
80
+ | Component | Description | External Deps |
81
+ | --------------- | --------------------------------------------- | ------------- |
82
+ | `C_Chat` | Chat (contacts / message bubbles / input box) | - |
83
+ | `C_ContextMenu` | Context menu (nested / shortcuts / danger) | - |
84
+ | `C_Login` | Login panel (5 modes / captcha / remember me) | - |
85
+
86
+ ## Workflow & Notification Components
87
+
88
+ | Component | Description | External Deps |
89
+ | ---------------------- | ---------------------------------------- | ---------------- |
90
+ | `C_WorkFlow` | Workflow editor (approval/CC/conditions) | `@vue-flow/core` |
91
+ | `C_NotificationCenter` | Notification center (WebSocket/polling) | - |
92
+ | `C_Upload` | Large file upload (chunked/resumable) | `spark-md5` |
93
+
94
+ ## Dependency Notes
95
+
96
+ `C_FilePreview` accepts HTTPS URLs and same-origin HTTP URLs for local development. Script/data URLs, credential-bearing URLs, and cross-origin plain HTTP are rejected. `autoPreview` opens a supplied file automatically, and changing the source refreshes an open preview. Repeated previews release the previous PDF object URL and ignore stale loading results. Excel values `0` and `false` remain intact.
97
+
98
+ `C_AntV` keeps the public BPMN model as `{ nodes, flows }`. It converts that model to X6 cells internally and restores node positions, types, properties, and flow conditions in `data-change` and `getData()`. BPMN and UML load built-in samples only when `data` is absent; an explicit empty model produces an empty canvas.
99
+
100
+ `C_VtableGantt` merges presets and `options` without dropping untouched nested settings, replaces arrays as a whole, and ignores prototype-related keys. Its fullscreen button reflects the actual fullscreen state of that Gantt container.
101
+
102
+ `C_AudioPlayer` enters the playing state and emits `play` only after the browser accepts `play()`. A rejected autoplay emits `error`, and an empty playlist cannot emit a false play event. Mute, playlist tracks, and seeking are keyboard operable.
103
+
104
+ `C_CollapsePanel` and `C_TagsView` validate persisted data before restoring it, so corrupt or outdated JSON cannot break initialization. Persisted tags restore only in-app paths, and special characters in a path are no longer interpolated into CSS selectors.
105
+
106
+ `C_Table` column settings restore only valid keys, visibility, widths, and fixed directions; corrupt `persistKey` storage falls back to the supplied columns. Settings operate on local column copies rather than mutating caller-owned objects. `C_Upload` copies its initial file list before managing it, applies the same `accept` filter to picker, drop, and paste input, labels image actions for keyboard users, and shows per-file progress during concurrent hashing. Cancelling a chunked upload during resume lookup, an active request, or merging cannot start later requests or emit stale completion; a custom request's `abort()` releases the pending chunk even if it never calls back.
107
+
108
+ `C_WorkFlow` loads the supplied `modelValue` on first render and returns isolated snapshots from `getCurrentWorkflowData()`, `save`, `change`, and `node-click`, so callers cannot accidentally mutate its internal nodes. Editing conditions cannot change canvas data before Save, and incomplete conditions are not silently dropped. `readonly` blocks dragging, connecting, configuring, adding/removing, and saving while leaving preview, validation, and fit-to-view available. Node and condition IDs remain unique when created in the same tick.
109
+
110
+ Type verification covers TypeScript source, Vue SFC templates, and consumer examples built against the package. `C_Table` summary rendering expects an object keyed by column (`{ columnKey: { value, colSpan? } }`). `C_FormSearch` preserves existing numeric timestamp ranges and also supports formatted string ranges, binding each to the matching Naive UI value API.
111
+
112
+ Runtime component dependencies are declared by this package and resolved automatically. Every consumer needs:
113
+
114
+ ```bash
115
+ bun add vue naive-ui
116
+ ```
117
+
118
+ Install optional peers per feature: `vue-router` for `C_Breadcrumb`/`C_TagsView`, and `sortablejs` for C_Table row/column dragging. Subpath imports do not require unrelated optional peers. The formula editor uses a bounded built-in parser and does not execute dynamic JavaScript.
@@ -0,0 +1,118 @@
1
+ [← 项目首页](../README.md) · [English](./components.en.md)
2
+
3
+ # 组件目录
4
+
5
+ > 💡 所有组件均提供 **在线交互演示**,访问 [组件文档](https://www.tzagileteam.com/robot/components/preface) 可直接在页面中体验真实效果(通过 iframe 嵌入 Robot Admin 生产环境)。
6
+
7
+ ## 基础组件
8
+
9
+ | 组件 | 说明 | 外部依赖 |
10
+ | ---------------- | ----------------------- | ----------------------------- |
11
+ | `C_Icon` | Iconify 图标封装 | `@iconify/vue` |
12
+ | `C_Loading` | 主题化 SVG 加载态 | - |
13
+ | `C_PageLoading` | 主题化页面切换加载 | - |
14
+ | `C_Code` | 代码高亮显示 | `highlight.js` |
15
+ | `C_Barcode` | 条形码生成器 | `@chenfengyuan/vue-barcode` |
16
+ | `C_Captcha` | 拼图/ALTCHA 人机验证 | `vue3-puzzle-vcode`、`altcha` |
17
+ | `C_Cascade` | 级联面板选择器 | - |
18
+ | `C_Guide` | 新手引导 | `driver.js` |
19
+ | `C_Progress` | 增强进度条 | - |
20
+ | `C_Steps` | 步骤条 | - |
21
+ | `C_ActionBar` | 操作按钮栏 | - |
22
+ | `C_Theme` | 主题切换器 | - |
23
+ | `C_Language` | 语言切换器 | - |
24
+ | `C_Date` | 日期选择器增强 | - |
25
+ | `C_City` | 省市区三级联动 | - |
26
+ | `C_Breadcrumb` | 面包屑导航 | - |
27
+ | `C_Menu` | 导航菜单 | - |
28
+ | `C_Tabs` | 数据驱动标签页/场景切换 | - |
29
+ | `C_TagsView` | 标签页导航 | - |
30
+ | `C_GlobalSearch` | 全局搜索面板 | - |
31
+ | `C_AvatarGroup` | 头像组合展示 | - |
32
+ | `C_OrgChart` | 组织架构图 | - |
33
+ | `C_Skeleton` | 骨架屏占位组件 | - |
34
+
35
+ ## 内容 & 编辑组件
36
+
37
+ | 组件 | 说明 | 外部依赖 |
38
+ | ----------------- | ---------------------------- | ------------------------- |
39
+ | `C_Editor` | 富文本编辑器 | `@wangeditor-next/editor` |
40
+ | `C_Markdown` | Markdown 编辑器/预览 | `md-editor-v3` |
41
+ | `C_FormulaEditor` | 公式编辑器(安全表达式引擎) | 内置 |
42
+ | `C_Signature` | 电子签名 | - |
43
+ | `C_QRCode` | 二维码生成器 | `qrcode` |
44
+ | `C_ImageCropper` | 图片裁剪器 | `vue-cropper` |
45
+
46
+ ## 数据展示组件
47
+
48
+ | 组件 | 说明 | 外部依赖 |
49
+ | ---------------- | ----------------------------------------- | -------------------------- |
50
+ | `C_Table` | 高级数据表格(CRUD/行列编辑/动态行/打印) | `print-js`、`html2canvas` |
51
+ | `C_Map` | 地图组件(OSM/高德) | `leaflet` |
52
+ | `C_VtableGantt` | 甘特图 | `@visactor/vtable-gantt` |
53
+ | `C_AntV` | 图编辑器(ER/BPMN/UML) | `@antv/x6`、`html2canvas` |
54
+ | `C_WaterFall` | 瀑布流布局 | - |
55
+ | `C_FullCalendar` | 日历事件 | `@fullcalendar/*` |
56
+ | `C_VideoPlayer` | 视频播放器(HLS/字幕/书签/章节) | `xgplayer`、`xgplayer-hls` |
57
+ | `C_AudioPlayer` | 音频播放器(波形/进度/播放列表) | - |
58
+ | `C_FilePreview` | 文件预览(PDF/Word/Excel) | `xlsx`、`mammoth` |
59
+ | `C_Timeline` | 时间线(垂直/水平/可折叠) | - |
60
+
61
+ 图片/日历类组件的使用边界:`C_ImageCropper` 翻转会更新实际图片源并重置当前裁剪位置,加载和导出失败通过 `error: Error` 报告;`C_Signature` 的 `readonly` 只禁止用户交互,暴露方法仍可用于加载历史数据,其 SVG 导出是保留画布效果的栅格嵌入 SVG;`C_QRCode` 带 Logo 的 SVG 同样采用栅格嵌入,以保持预览与导出一致。`C_FullCalendar` 使用本地日历日期创建当日事件;`C_WaterFall` 会根据图片实际宽高比自动重排,建议以稳定唯一的 `id` 标识每项。
62
+
63
+ ## 表单 & 布局组件
64
+
65
+ | 组件 | 说明 | 外部依赖 |
66
+ | ----------------- | ------------------------------------------------- | -------------------- |
67
+ | `C_Form` | 动态表单引擎(Grid/Tabs/Steps/Card/Dynamic 布局) | - |
68
+ | `C_FormModal` | 数据驱动的新增/编辑表单弹窗 | - |
69
+ | `C_FormSearch` | 搜索表单 | - |
70
+ | `C_CollapsePanel` | 折叠面板 | - |
71
+ | `C_SplitPane` | 分割面板 | - |
72
+ | `C_Draggable` | 拖拽排序 | `vue-draggable-plus` |
73
+ | `C_Tree` | 高级树形控件 | - |
74
+ | `C_Time` | 时间选择器增强 | - |
75
+ | `C_Cron` | Cron 表达式编辑器 | - |
76
+ | `C_Transfer` | 穿梭框(搜索/全选/批量操作) | - |
77
+
78
+ ## 交互 & 业务组件
79
+
80
+ | 组件 | 说明 | 外部依赖 |
81
+ | --------------- | -------------------------------------- | -------- |
82
+ | `C_Chat` | 聊天组件(联系人/消息气泡/输入框) | - |
83
+ | `C_ContextMenu` | 右键菜单(嵌套子菜单/快捷键/危险操作) | - |
84
+ | `C_Login` | 登录组件(5种模式/验证码/记住用户名) | - |
85
+
86
+ ## 流程 & 通知组件
87
+
88
+ | 组件 | 说明 | 外部依赖 |
89
+ | ---------------------- | ------------------------------------ | ---------------- |
90
+ | `C_WorkFlow` | 工作流编辑器(审批/抄送/条件节点) | `@vue-flow/core` |
91
+ | `C_NotificationCenter` | 通知中心(WebSocket/轮询) | - |
92
+ | `C_Upload` | 大文件上传(分片/断点续传/哈希校验) | `spark-md5` |
93
+
94
+ ## 依赖说明
95
+
96
+ `C_FilePreview` 的 URL 入口仅接受 HTTPS 或当前站点同源 HTTP(便于本地开发);不接受脚本、数据 URL、带凭据 URL 或跨站明文 HTTP。`autoPreview` 会在有文件源时自动打开预览,已打开时切换文件源会刷新内容。重复预览会释放旧 PDF 对象 URL,并忽略过期加载结果。Excel 单元格的 `0` 与 `false` 会原样保留。
97
+
98
+ `C_AntV` 的 BPMN 对外数据保持 `{ nodes, flows }` 领域结构;组件内部转换为 X6 单元格,并在 `data-change` / `getData()` 中还原节点位置、类型、属性和连线条件。BPMN/UML 仅在未提供 `data` 时加载内置示例;显式传入空数据会显示空画布。
99
+
100
+ `C_VtableGantt` 合并预设与 `options` 时会保留未覆盖的嵌套配置、以新数组整体替换旧数组,并忽略原型相关键;全屏按钮状态仅反映该甘特图容器的实际全屏状态。
101
+
102
+ `C_AudioPlayer` 只在浏览器确认 `play()` 成功后进入播放状态并触发 `play`;自动播放被拒绝时会触发 `error`,空播放列表不会产生虚假的播放事件。静音、曲目和进度条均可用键盘操作。
103
+
104
+ `C_CollapsePanel` 与 `C_TagsView` 会校验本地持久化数据结构;损坏或旧格式数据会安全回退,不会阻断组件初始化。持久化标签仅恢复站内路径,特殊字符路径的定位不会拼接 CSS 选择器。
105
+
106
+ `C_Table` 列设置只恢复有效的列键、可见性、列宽和固定方向;损坏的 `persistKey` 存储会回退到传入列。列设置在本地副本上操作,不会修改调用方的列对象。`C_Upload` 的默认文件列表同样会复制后再管理,文件选择、拖拽和粘贴共用 `accept` 过滤,图片操作可通过键盘识别和访问;并发计算哈希时,各文件显示自己的进度。分片上传在查询断点、请求或合并阶段取消后,不会继续派发请求或发出过期的完成事件。自定义上传请求的 `abort()` 即使不回调,也会释放分片等待任务。
107
+
108
+ `C_WorkFlow` 会在首次渲染时加载传入的 `modelValue`,并在 `getCurrentWorkflowData()` / `save` / `change` / `node-click` 中输出隔离的数据快照,避免调用方意外修改内部节点。条件编辑弹窗在保存前不会修改画布数据,未填完整的条件不会被静默丢弃。`readonly` 禁止节点拖拽、连线、配置、增删与保存,但仍允许预览、验证和适应视图;节点与条件 ID 在同一时刻连续创建时保持唯一。
109
+
110
+ 类型验证同时覆盖 TypeScript 源码、Vue 单文件组件模板和发布后的使用侧示例。`C_Table` 合计行的 `summary.render` 应返回按列键组织的对象(`{ columnKey: { value, colSpan? } }`);`C_FormSearch` 的日期范围兼容原有数字时间戳数组,也支持格式化字符串数组,两种值会分别绑定 Naive UI 对应的值接口。
111
+
112
+ 组件运行依赖已由本包声明,安装组件库时会自动解析。所有场景都需要:
113
+
114
+ ```bash
115
+ bun add vue naive-ui
116
+ ```
117
+
118
+ 按功能安装可选 peer:使用 `C_Breadcrumb`/`C_TagsView` 时安装 `vue-router`;启用 C_Table 行/列拖拽时安装 `sortablejs`。子路径导入不会要求无关的可选 peer。公式编辑器使用组件库内置的受限表达式解析器,不执行动态 JavaScript。