@robot-admin/naive-ui-components 0.12.1 → 0.13.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.
- package/CHANGELOG.md +14 -0
- package/README.md +27 -1
- package/README_EN.md +26 -0
- package/dist/C_ActionBar.css +60 -60
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV.css +49 -49
- package/dist/C_AntV2.cjs +3 -3
- package/dist/C_AntV2.js +3 -3
- package/dist/C_AudioPlayer.css +81 -66
- package/dist/C_AudioPlayer2.cjs +1 -1
- package/dist/C_AudioPlayer2.js +1 -1
- package/dist/C_AvatarGroup.css +40 -25
- package/dist/C_AvatarGroup2.cjs +1 -1
- package/dist/C_AvatarGroup2.js +1 -1
- package/dist/C_Barcode.css +6 -6
- package/dist/C_Barcode2.cjs +1 -1
- package/dist/C_Barcode2.js +1 -1
- package/dist/C_Breadcrumb.css +14 -14
- package/dist/C_Breadcrumb2.cjs +1 -1
- package/dist/C_Breadcrumb2.js +1 -1
- package/dist/C_Captcha.css +50 -50
- package/dist/C_Captcha2.cjs +1 -1
- package/dist/C_Captcha2.js +1 -1
- package/dist/C_Cascade.css +2 -2
- package/dist/C_Cascade2.cjs +1 -1
- package/dist/C_Cascade2.js +1 -1
- package/dist/C_Chat.css +96 -78
- package/dist/C_Chat2.cjs +1 -1
- package/dist/C_Chat2.js +1 -1
- package/dist/C_City.css +52 -28
- package/dist/C_City2.cjs +1 -1
- package/dist/C_City2.js +1 -1
- package/dist/C_Code.css +48 -42
- package/dist/C_Code2.cjs +1 -1
- package/dist/C_Code2.js +1 -1
- package/dist/C_CollapsePanel.css +14 -14
- package/dist/C_CollapsePanel2.cjs +1 -1
- package/dist/C_CollapsePanel2.js +1 -1
- package/dist/C_ContextMenu.css +14 -14
- package/dist/C_ContextMenu2.cjs +1 -1
- package/dist/C_ContextMenu2.js +1 -1
- package/dist/C_Cron.css +94 -55
- package/dist/C_Cron2.cjs +1 -1
- package/dist/C_Cron2.js +1 -1
- package/dist/C_Date2.cjs +1 -1
- package/dist/C_Date2.js +1 -1
- package/dist/C_Draggable.css +48 -48
- package/dist/C_Draggable2.cjs +1 -1
- package/dist/C_Draggable2.js +1 -1
- package/dist/C_Editor.css +13 -14
- package/dist/C_Editor2.cjs +1 -1
- package/dist/C_Editor2.js +1 -1
- package/dist/C_FilePreview.css +18 -18
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_Form.base.css +36 -36
- package/dist/C_Form.css +49 -50
- package/dist/C_Form2.cjs +1 -1
- package/dist/C_Form2.js +1 -1
- package/dist/C_FormModal.css +8 -8
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +45 -45
- package/dist/C_FormSearch2.cjs +1 -1
- package/dist/C_FormSearch2.js +1 -1
- package/dist/C_FormulaEditor.css +94 -55
- package/dist/C_FormulaEditor2.cjs +2 -2
- package/dist/C_FormulaEditor2.js +2 -2
- package/dist/C_FullCalendar.css +8 -1
- package/dist/C_FullCalendar2.cjs +1 -1
- package/dist/C_FullCalendar2.js +1 -1
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Guide.css +14 -14
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Icon.css +14 -14
- package/dist/C_Icon2.cjs +1 -1
- package/dist/C_Icon2.js +1 -1
- package/dist/C_ImageCropper.css +22 -22
- package/dist/C_ImageCropper2.cjs +1 -1
- package/dist/C_ImageCropper2.js +1 -1
- package/dist/C_Language.css +14 -14
- package/dist/C_Language2.cjs +1 -1
- package/dist/C_Language2.js +1 -1
- package/dist/C_Login.css +134 -134
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Map.css +3 -3
- package/dist/C_Map2.cjs +1 -1
- package/dist/C_Map2.js +1 -1
- package/dist/C_Markdown.css +35 -35
- package/dist/C_Markdown2.cjs +1 -1
- package/dist/C_Markdown2.js +1 -1
- package/dist/C_Menu2.cjs +1 -1
- package/dist/C_Menu2.js +1 -1
- package/dist/C_NotificationCenter.css +30 -30
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_OrgChart.css +4 -0
- package/dist/C_OrgChart2.cjs +1 -1
- package/dist/C_OrgChart2.js +1 -1
- package/dist/C_Progress2.cjs +1 -1
- package/dist/C_Progress2.js +1 -1
- package/dist/C_QRCode.css +8 -8
- package/dist/C_QRCode2.cjs +1 -1
- package/dist/C_QRCode2.js +1 -1
- package/dist/C_Signature.css +14 -14
- package/dist/C_Signature2.cjs +1 -1
- package/dist/C_Signature2.js +1 -1
- package/dist/C_Skeleton2.cjs +1 -1
- package/dist/C_Skeleton2.js +1 -1
- package/dist/C_SplitPane.css +39 -39
- package/dist/C_SplitPane2.cjs +1 -1
- package/dist/C_SplitPane2.js +1 -1
- package/dist/C_Steps.css +48 -38
- package/dist/C_Steps2.cjs +1 -1
- package/dist/C_Steps2.js +1 -1
- package/dist/C_Table.base.css +160 -160
- package/dist/C_Table.css +173 -174
- package/dist/C_TagsView.css +52 -52
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Theme.css +14 -14
- package/dist/C_Theme2.cjs +1 -1
- package/dist/C_Theme2.js +1 -1
- package/dist/C_Time.css +4 -4
- package/dist/C_Time2.cjs +1 -1
- package/dist/C_Time2.js +1 -1
- package/dist/C_Timeline.css +76 -58
- package/dist/C_Timeline2.cjs +1 -1
- package/dist/C_Timeline2.js +1 -1
- package/dist/C_Transfer.css +51 -51
- package/dist/C_Transfer2.cjs +1 -1
- package/dist/C_Transfer2.js +1 -1
- package/dist/C_Tree.css +35 -32
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/C_Upload.css +53 -50
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_VideoPlayer.css +17 -13
- package/dist/C_VideoPlayer2.cjs +2 -2
- package/dist/C_VideoPlayer2.js +2 -2
- package/dist/C_VtableGantt.css +19 -19
- package/dist/C_VtableGantt2.cjs +1 -1
- package/dist/C_VtableGantt2.js +1 -1
- package/dist/C_WaterFall.css +19 -15
- package/dist/C_WaterFall2.cjs +1 -1
- package/dist/C_WaterFall2.js +1 -1
- package/dist/C_WorkFlow.css +123 -123
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/constants.d.cts +4 -4
- package/dist/constants.d.ts +4 -4
- package/dist/constants2.d.cts +4 -4
- package/dist/constants2.d.ts +4 -4
- package/dist/constants3.d.cts +9 -5
- package/dist/constants3.d.ts +9 -5
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/data.d.cts +15 -15
- package/dist/data.d.ts +15 -15
- package/dist/data2.cjs +1 -1
- package/dist/data2.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +2 -0
- package/dist/index.vue.d.ts +2 -0
- package/dist/index10.vue.d.cts +1 -1
- package/dist/index10.vue.d.ts +3 -3
- package/dist/index11.vue.d.cts +3 -3
- package/dist/index11.vue.d.ts +3 -3
- package/dist/index12.vue.d.cts +3 -3
- package/dist/index13.vue.d.ts +2 -2
- package/dist/index14.vue.d.cts +2 -2
- package/dist/index14.vue.d.ts +14 -47
- package/dist/index15.vue.d.cts +14 -47
- package/dist/index15.vue.d.ts +2 -2
- package/dist/index16.vue.d.cts +2 -2
- package/dist/index17.vue.d.ts +5 -5
- package/dist/index18.vue.d.cts +5 -5
- package/dist/index18.vue.d.ts +2 -2
- package/dist/index19.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +2 -2
- package/dist/index20.vue.d.ts +2 -2
- package/dist/index21.vue.d.cts +2 -2
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index22.vue.d.ts +2 -2
- package/dist/index24.vue.d.cts +3 -3
- package/dist/index24.vue.d.ts +3 -3
- package/dist/index25.vue.d.cts +1 -1
- package/dist/index25.vue.d.ts +1 -1
- package/dist/index26.vue.d.cts +4 -4
- package/dist/index26.vue.d.ts +4 -4
- package/dist/index27.vue.d.cts +3 -3
- package/dist/index27.vue.d.ts +3 -3
- package/dist/index3.vue.d.cts +4 -4
- package/dist/index3.vue.d.ts +4 -4
- package/dist/index4.vue.d.cts +2 -2
- package/dist/index5.vue.d.ts +2 -2
- package/dist/index6.vue.d.cts +2 -2
- package/dist/index7.vue.d.ts +2 -2
- package/dist/index8.vue.d.cts +2 -2
- package/dist/index9.vue.d.ts +1 -1
- package/dist/mapUtils.d.cts +3 -3
- package/dist/mapUtils.d.ts +3 -3
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/style.css +1573 -1365
- package/dist/useCalendarEvents.d.cts +23 -18
- package/dist/useCalendarEvents.d.ts +23 -18
- package/dist/useCollapsePanel.d.cts +7 -6
- package/dist/useCollapsePanel.d.ts +7 -6
- package/dist/useCropperCore.d.cts +34 -19
- package/dist/useCropperCore.d.ts +34 -19
- package/dist/useDraggableLayout.d.cts +4 -4
- package/dist/useDraggableLayout.d.ts +4 -4
- package/dist/useDynamicFormState.d.cts +7 -2
- package/dist/useDynamicFormState.d.ts +7 -2
- package/dist/useEdgeInteraction.d.cts +19 -19
- package/dist/useEdgeInteraction.d.ts +19 -19
- package/dist/useFullscreen.d.cts +6 -6
- package/dist/useFullscreen.d.ts +6 -6
- package/dist/useInfiniteScroll.d.cts +4 -4
- package/dist/useInfiniteScroll.d.ts +4 -4
- package/dist/useQRCode.d.cts +5 -4
- package/dist/useQRCode.d.ts +5 -4
- package/dist/useSearchState.d.cts +9 -9
- package/dist/useSearchState.d.ts +9 -9
- package/dist/useSignatureHistory.d.cts +18 -10
- package/dist/useSignatureHistory.d.ts +18 -10
- package/dist/useSplitResize.d.cts +3 -3
- package/dist/useSplitResize.d.ts +3 -3
- package/dist/useTableQuery.cjs +3 -3
- package/dist/useTableQuery.d.cts +3 -6
- package/dist/useTableQuery.d.ts +3 -6
- package/dist/useTableQuery.js +3 -3
- package/dist/useTimeSelection.d.cts +8 -5
- package/dist/useTimeSelection.d.ts +8 -5
- package/dist/useTreeOperations.d.cts +8 -8
- package/dist/useTreeOperations.d.ts +8 -8
- package/dist/useWorkflowValidation.d.cts +10 -8
- package/dist/useWorkflowValidation.d.ts +10 -8
- package/dist/verification.d.cts +3 -3
- package/dist/verification.d.ts +3 -3
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @robot-admin/naive-ui-components
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fc872e4: Release C_GlobalSearch's keyboard shortcut listener on unmount.
|
|
8
|
+
|
|
9
|
+
Keep CRUD delete feedback consistent with structured `{ data, error }` results and make tree `defaultExpandAll` work with controlled row expansion. Restore C_Table summaries in Naive UI's keyed-row format, validate persisted column settings, and avoid mutating caller-owned columns. Expose submit state and action in C_Form step slots, and harden C_FilePreview URL, auto-preview, loading, object-URL, and spreadsheet value handling. Tighten C_Icon's public types, isolate C_Editor focus styling to the component, make C_Chat preview, file, and retry actions keyboard accessible, and keep C_AudioPlayer state honest when playback fails or its playlist changes. Repair C_AntV BPMN domain-data round-trips and honor initial external BPMN/UML data. Make C_VtableGantt option merging prototype-safe and synchronize fullscreen state with the actual DOM lifecycle. Validate persisted C_CollapsePanel/C_TagsView state and avoid path interpolation in tag selectors. Isolate C_Upload's initial file list, consistently filter accepted picker/drop/paste files, label image actions, show per-file hashing progress, and make chunk cancellation effective throughout resume lookup, requests, and merging. Load initial C_WorkFlow models, isolate emitted snapshots and condition edits, honor readonly boundaries, prevent ID collisions, and clean up deferred view actions. Support timestamp and formatted string date ranges in C_FormSearch, hide decorative C_ActionBar icons from accessible names, and include Vue source templates in the verification gate.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fc872e4: Harden smaller interaction components: keep login's remembered username current and reject malformed SMS recipients, load city data only when opened and scope letter navigation to each instance, make code actions keyboard-accessible and report modal close events, bound skeleton render counts, and synchronize menu expansion when route options arrive. Improve markdown, organization chart, timeline, tree, transfer, date/time, cascade, context menu, split pane, progress, avatar and step state and accessibility behavior.
|
|
14
|
+
- fc872e4: Make image crop exports use one canvas snapshot, report failures, honor disabled state, and apply flips to the actual image. Make signature readonly mode effective, preserve imported/background images across redraws, and replace placeholder SVG output with a raster-backed SVG. Fix calendar local-date saving and reactive editable mode. Prevent stale QR renders, keep logo-bearing SVG exports consistent with previews, and relayout waterfall images by aspect ratio while suppressing duplicate infinite-load requests.
|
|
15
|
+
- fc872e4: Keep C_NotificationCenter server read state authoritative, avoid duplicate popover toggles, forward WebSocket events, and validate action links before navigation. Prevent C_VideoPlayer from creating a player after unmount, remove duplicate shortcut/cleanup paths, and make mini-player controls keyboard accessible. Reject malformed C_Cron expressions without rewriting them, preview second-level schedules across the full search horizon, and honor disabled controls. Fix C_FormulaEditor logical operator evaluation, read-only input behavior, and keyboard accessibility.
|
|
16
|
+
|
|
3
17
|
## 0.12.1
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -167,6 +167,8 @@ import '@robot-admin/naive-ui-components/C_Table/base.css'
|
|
|
167
167
|
</template>
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
+
自定义操作栏应调用 `action` 插槽的 `submit()`,不要用 `validate()` 代替提交。步骤布局的 `step-actions` 插槽同时提供 `isLastStep`、`submit()` 和 `submitting`,可在最后一步直接放置提交按钮。异步保存放在 `config.onSubmit` 中并等待完成;`@submit` 是保存成功后的通知事件,不承诺等待监听器返回的 Promise。
|
|
171
|
+
|
|
170
172
|
新增/编辑场景推荐用 `C_FormModal` 直接消费 Headless CRUD 的结构化 `editor`。字段、校验和布局继续由 `C_Form` 配置驱动,页面不再重复编写 Modal、按钮、loading 和草稿状态;默认采用紧凑小尺寸表单和右下角带图标操作按钮,宽度、表单尺寸与动作文案仍可覆盖:
|
|
171
173
|
|
|
172
174
|
```vue
|
|
@@ -250,6 +252,10 @@ import '@robot-admin/naive-ui-components/C_Table/base.css'
|
|
|
250
252
|
</template>
|
|
251
253
|
```
|
|
252
254
|
|
|
255
|
+
将 Headless CRUD 绑定到 `:crud` 时,表格会识别操作结果中的 `{ error }`:失败不会触发删除成功事件,也不会重复展示 CRUD 控制器已经展示的反馈。自定义 `actions.delete` 可返回 Promise,或返回 `{ data, error }` 结构。
|
|
256
|
+
|
|
257
|
+
树形数据可直接使用 `<C_Table :data="rows" :columns="columns" :config="{ tree: { defaultExpandAll: true }, pagination: false }" />`;`children` 是默认子节点字段,也可通过 `tree.childrenKey` 指定。默认展开会初始化所有父节点,并在异步追加新父节点时展开新节点,不会重新展开用户手动收起的旧节点。
|
|
258
|
+
|
|
253
259
|
`C_Tabs` 是面向页面场景切换的统一数据驱动标签页,名称与全局 `C_*` 体系保持一致。默认使用紧凑
|
|
254
260
|
`small` 尺寸、延迟呈现面板并支持受控/非受控状态;只做筛选或视图切换时启用 `tabsOnly`,组件
|
|
255
261
|
不会执行面板内容,避免隐藏内容产生渲染开销或副作用。常规场景只维护数组,复杂内容可以按需使用 `render`、`pane` 或
|
|
@@ -394,6 +400,8 @@ const config = defineTableConfig({
|
|
|
394
400
|
|
|
395
401
|
开启 `require-server-verification` 后,成功响应必须包含服务端 token。该 token 应短期、一次性使用,并绑定当前会话或业务请求。`C_Login` 可通过 `captchaProvider`、`captchaChallengeUrl`、`captchaVerifier`、`requireCaptchaServerVerification` 和 `captchaVerificationTimeout` 透传同一安全策略,并在 `submit` 数据中通过 `captchaType` 与 `captchaVerifiedBy` 标识验证类型和来源。更多边界说明见 [SECURITY.md](./SECURITY.md)。
|
|
396
402
|
|
|
403
|
+
`C_Login` 的“记住我”只保存用户名,不保存密码。短信验证码仅对格式正确的手机号触发事件;组件会立即开始本地倒计时,发送结果和服务端限流仍由宿主处理。`C_City` 在首次打开时才加载城市索引,字母跳转只作用于当前实例;默认触发器、字母和城市项均可用键盘操作。
|
|
404
|
+
|
|
397
405
|
### 📋 组件清单(53 个)
|
|
398
406
|
|
|
399
407
|
> 💡 所有组件均提供 **在线交互演示**,访问 [组件文档](https://www.tzagileteam.com/robot/components/preface) 可直接在页面中体验真实效果(通过 iframe 嵌入 Robot Admin 生产环境)。
|
|
@@ -450,6 +458,8 @@ const config = defineTableConfig({
|
|
|
450
458
|
| `C_FilePreview` | 文件预览(PDF/Word/Excel) | `xlsx`、`mammoth` |
|
|
451
459
|
| `C_Timeline` | 时间线(垂直/水平/可折叠) | - |
|
|
452
460
|
|
|
461
|
+
图片/日历类组件的使用边界:`C_ImageCropper` 翻转会更新实际图片源并重置当前裁剪位置,加载和导出失败通过 `error: Error` 报告;`C_Signature` 的 `readonly` 只禁止用户交互,暴露方法仍可用于加载历史数据,其 SVG 导出是保留画布效果的栅格嵌入 SVG;`C_QRCode` 带 Logo 的 SVG 同样采用栅格嵌入,以保持预览与导出一致。`C_FullCalendar` 使用本地日历日期创建当日事件;`C_WaterFall` 会根据图片实际宽高比自动重排,建议以稳定唯一的 `id` 标识每项。
|
|
462
|
+
|
|
453
463
|
#### 表单 & 布局组件
|
|
454
464
|
|
|
455
465
|
| 组件 | 说明 | 外部依赖 |
|
|
@@ -471,7 +481,7 @@ const config = defineTableConfig({
|
|
|
471
481
|
| --------------- | -------------------------------------- | -------- |
|
|
472
482
|
| `C_Chat` | 聊天组件(联系人/消息气泡/输入框) | - |
|
|
473
483
|
| `C_ContextMenu` | 右键菜单(嵌套子菜单/快捷键/危险操作) | - |
|
|
474
|
-
| `C_Login` | 登录组件(5
|
|
484
|
+
| `C_Login` | 登录组件(5种模式/验证码/记住用户名) | - |
|
|
475
485
|
|
|
476
486
|
#### 流程 & 通知组件
|
|
477
487
|
|
|
@@ -483,6 +493,22 @@ const config = defineTableConfig({
|
|
|
483
493
|
|
|
484
494
|
### 🔌 依赖说明
|
|
485
495
|
|
|
496
|
+
`C_FilePreview` 的 URL 入口仅接受 HTTPS 或当前站点同源 HTTP(便于本地开发);不接受脚本、数据 URL、带凭据 URL 或跨站明文 HTTP。`autoPreview` 会在有文件源时自动打开预览,已打开时切换文件源会刷新内容。重复预览会释放旧 PDF 对象 URL,并忽略过期加载结果。Excel 单元格的 `0` 与 `false` 会原样保留。
|
|
497
|
+
|
|
498
|
+
`C_AntV` 的 BPMN 对外数据保持 `{ nodes, flows }` 领域结构;组件内部转换为 X6 单元格,并在 `data-change` / `getData()` 中还原节点位置、类型、属性和连线条件。BPMN/UML 仅在未提供 `data` 时加载内置示例;显式传入空数据会显示空画布。
|
|
499
|
+
|
|
500
|
+
`C_VtableGantt` 合并预设与 `options` 时会保留未覆盖的嵌套配置、以新数组整体替换旧数组,并忽略原型相关键;全屏按钮状态仅反映该甘特图容器的实际全屏状态。
|
|
501
|
+
|
|
502
|
+
`C_AudioPlayer` 只在浏览器确认 `play()` 成功后进入播放状态并触发 `play`;自动播放被拒绝时会触发 `error`,空播放列表不会产生虚假的播放事件。静音、曲目和进度条均可用键盘操作。
|
|
503
|
+
|
|
504
|
+
`C_CollapsePanel` 与 `C_TagsView` 会校验本地持久化数据结构;损坏或旧格式数据会安全回退,不会阻断组件初始化。持久化标签仅恢复站内路径,特殊字符路径的定位不会拼接 CSS 选择器。
|
|
505
|
+
|
|
506
|
+
`C_Table` 列设置只恢复有效的列键、可见性、列宽和固定方向;损坏的 `persistKey` 存储会回退到传入列。列设置在本地副本上操作,不会修改调用方的列对象。`C_Upload` 的默认文件列表同样会复制后再管理,文件选择、拖拽和粘贴共用 `accept` 过滤,图片操作可通过键盘识别和访问;并发计算哈希时,各文件显示自己的进度。分片上传在查询断点、请求或合并阶段取消后,不会继续派发请求或发出过期的完成事件。自定义上传请求的 `abort()` 即使不回调,也会释放分片等待任务。
|
|
507
|
+
|
|
508
|
+
`C_WorkFlow` 会在首次渲染时加载传入的 `modelValue`,并在 `getCurrentWorkflowData()` / `save` / `change` / `node-click` 中输出隔离的数据快照,避免调用方意外修改内部节点。条件编辑弹窗在保存前不会修改画布数据,未填完整的条件不会被静默丢弃。`readonly` 禁止节点拖拽、连线、配置、增删与保存,但仍允许预览、验证和适应视图;节点与条件 ID 在同一时刻连续创建时保持唯一。
|
|
509
|
+
|
|
510
|
+
类型验证同时覆盖 TypeScript 源码、Vue 单文件组件模板和发布后的使用侧示例。`C_Table` 合计行的 `summary.render` 应返回按列键组织的对象(`{ columnKey: { value, colSpan? } }`);`C_FormSearch` 的日期范围兼容原有数字时间戳数组,也支持格式化字符串数组,两种值会分别绑定 Naive UI 对应的值接口。
|
|
511
|
+
|
|
486
512
|
组件运行依赖已由本包声明,安装组件库时会自动解析。所有场景都需要:
|
|
487
513
|
|
|
488
514
|
```bash
|
package/README_EN.md
CHANGED
|
@@ -135,6 +135,8 @@ const { model, formRef, bindings } = useCForm({
|
|
|
135
135
|
})
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
Custom action bars should call the `action` slot's `submit()` rather than treating `validate()` as submission. The step-layout `step-actions` slot also provides `isLastStep`, `submit()`, and `submitting`. Put asynchronous persistence in `config.onSubmit`; the `@submit` event is a post-success notification and does not await an event listener's promise.
|
|
139
|
+
|
|
138
140
|
For create/edit flows, `C_FormModal` consumes a structural headless `editor` directly. Fields, validation, and layout remain data-driven by `C_Form`, while pages no longer own duplicate modal, draft, or loading state:
|
|
139
141
|
|
|
140
142
|
```vue
|
|
@@ -191,6 +193,10 @@ const { bindings } = useTableQuery<UserRow, { keyword: string }>({
|
|
|
191
193
|
})
|
|
192
194
|
```
|
|
193
195
|
|
|
196
|
+
When binding a headless CRUD controller through `:crud`, the table recognizes `{ error }` action results: failed deletes do not emit a successful-deletion event, and feedback already shown by the controller is not duplicated. Custom `actions.delete` callbacks may return a promise or a `{ data, error }` result.
|
|
197
|
+
|
|
198
|
+
Tree data can use `<C_Table :data="rows" :columns="columns" :config="{ tree: { defaultExpandAll: true }, pagination: false }" />` directly. `children` is the default child key and can be changed with `tree.childrenKey`. Default expansion includes parent rows added later without reopening rows the user collapsed.
|
|
199
|
+
|
|
194
200
|
`C_Tabs` is the data-driven page-scenario switcher for the global `C_*` system. It defaults to the compact
|
|
195
201
|
`small` size, lazy pane display, and supports controlled or uncontrolled state. Set `tabsOnly` for filters or
|
|
196
202
|
view switching; pane content is not executed, avoiding hidden render work and side effects. Most pages only maintain an item array; complex
|
|
@@ -335,6 +341,8 @@ For a permanently free, network-independent option, explicitly select the open-s
|
|
|
335
341
|
|
|
336
342
|
With `require-server-verification`, a successful response must include a server token. Server tokens should be short-lived, single-use, and bound to the current session or operation. `C_Login` forwards the same policy through `captchaProvider`, `captchaChallengeUrl`, `captchaVerifier`, `requireCaptchaServerVerification`, and `captchaVerificationTimeout`; its `submit` payload identifies the result through `captchaType` and `captchaVerifiedBy`. See [SECURITY.md](./SECURITY.md) for trust-boundary details.
|
|
337
343
|
|
|
344
|
+
`C_Login` remembers only the username, never the password. SMS events require a valid phone number; the local countdown starts immediately, while delivery results and server-side rate limits remain the host's responsibility. `C_City` loads its city index on first open and scopes letter navigation to its own instance; the default trigger, letters, and city items are keyboard-operable.
|
|
345
|
+
|
|
338
346
|
### 📋 Component List (53 Components)
|
|
339
347
|
|
|
340
348
|
> 💡 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).
|
|
@@ -391,6 +399,8 @@ With `require-server-verification`, a successful response must include a server
|
|
|
391
399
|
| `C_FilePreview` | File preview (PDF/Word/Excel) | `xlsx`, `mammoth` |
|
|
392
400
|
| `C_Timeline` | Timeline (vertical/horizontal/collapsible) | - |
|
|
393
401
|
|
|
402
|
+
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`.
|
|
403
|
+
|
|
394
404
|
#### Form & Layout Components
|
|
395
405
|
|
|
396
406
|
| Component | Description | External Deps |
|
|
@@ -424,6 +434,22 @@ With `require-server-verification`, a successful response must include a server
|
|
|
424
434
|
|
|
425
435
|
### 🔌 Dependency Notes
|
|
426
436
|
|
|
437
|
+
`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.
|
|
438
|
+
|
|
439
|
+
`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.
|
|
440
|
+
|
|
441
|
+
`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.
|
|
442
|
+
|
|
443
|
+
`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.
|
|
444
|
+
|
|
445
|
+
`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.
|
|
446
|
+
|
|
447
|
+
`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.
|
|
448
|
+
|
|
449
|
+
`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.
|
|
450
|
+
|
|
451
|
+
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.
|
|
452
|
+
|
|
427
453
|
Runtime component dependencies are declared by this package and resolved automatically. Every consumer needs:
|
|
428
454
|
|
|
429
455
|
```bash
|
package/dist/C_ActionBar.css
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
/* unplugin-vue-components disabled */.c-icon[data-v-
|
|
1
|
+
/* unplugin-vue-components disabled */.c-icon[data-v-711aedcd] {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
user-select: none;
|
|
6
6
|
transition: all 0.2s ease-in-out;
|
|
7
7
|
}
|
|
8
|
-
.c-icon--clickable[data-v-
|
|
8
|
+
.c-icon--clickable[data-v-711aedcd] {
|
|
9
9
|
cursor: pointer;
|
|
10
10
|
}
|
|
11
|
-
.c-icon--clickable[data-v-
|
|
11
|
+
.c-icon--clickable[data-v-711aedcd]:hover {
|
|
12
12
|
opacity: 0.8;
|
|
13
13
|
transform: scale(1.05);
|
|
14
14
|
}
|
|
15
|
-
.c-icon--clickable[data-v-
|
|
15
|
+
.c-icon--clickable[data-v-711aedcd]:active {
|
|
16
16
|
transform: scale(0.95);
|
|
17
17
|
}
|
|
18
|
-
.c-icon--clickable[data-v-
|
|
18
|
+
.c-icon--clickable[data-v-711aedcd]:focus-visible {
|
|
19
19
|
outline: 2px solid currentColor;
|
|
20
20
|
outline-offset: 2px;
|
|
21
21
|
border-radius: 4px;
|
|
22
22
|
}
|
|
23
|
-
.c-icon--loading[data-v-
|
|
23
|
+
.c-icon--loading[data-v-711aedcd] {
|
|
24
24
|
opacity: 0.6;
|
|
25
25
|
cursor: wait;
|
|
26
26
|
}
|
|
27
|
-
.c-icon--error[data-v-
|
|
27
|
+
.c-icon--error[data-v-711aedcd] {
|
|
28
28
|
opacity: 0.5;
|
|
29
29
|
}
|
|
30
|
-
.c-icon__loading[data-v-
|
|
30
|
+
.c-icon__loading[data-v-711aedcd] {
|
|
31
31
|
position: relative;
|
|
32
32
|
}
|
|
33
|
-
.c-icon__spinner[data-v-
|
|
33
|
+
.c-icon__spinner[data-v-711aedcd] {
|
|
34
34
|
width: 100%;
|
|
35
35
|
height: 100%;
|
|
36
36
|
border: 2px solid currentColor;
|
|
37
37
|
border-radius: 50%;
|
|
38
38
|
border-top-color: transparent;
|
|
39
|
-
animation: spin-
|
|
39
|
+
animation: spin-711aedcd 1s linear infinite;
|
|
40
40
|
}
|
|
41
|
-
.c-icon__error[data-v-
|
|
41
|
+
.c-icon__error[data-v-711aedcd] {
|
|
42
42
|
font-size: 0.8em;
|
|
43
43
|
opacity: 0.5;
|
|
44
44
|
}
|
|
45
|
-
.c-icon__rotatable[data-v-
|
|
45
|
+
.c-icon__rotatable[data-v-711aedcd] {
|
|
46
46
|
transition: transform 0.3s ease-in-out;
|
|
47
47
|
}
|
|
48
|
-
.c-icon__flippable[data-v-
|
|
48
|
+
.c-icon__flippable[data-v-711aedcd] {
|
|
49
49
|
transition: transform 0.3s ease-in-out;
|
|
50
50
|
}
|
|
51
|
-
@keyframes spin-
|
|
51
|
+
@keyframes spin-711aedcd {
|
|
52
52
|
0% {
|
|
53
53
|
transform: rotate(0deg);
|
|
54
54
|
}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
/* unplugin-vue-components disabled *//* 通用操作按钮组件样式 */
|
|
61
61
|
/* ================= 主容器 ================= */
|
|
62
|
-
.c-action-bar[data-v-
|
|
62
|
+
.c-action-bar[data-v-3f0311cc] {
|
|
63
63
|
display: flex;
|
|
64
64
|
align-items: center;
|
|
65
65
|
justify-content: space-between;
|
|
@@ -70,26 +70,26 @@
|
|
|
70
70
|
border: 1px solid var(--c-border);
|
|
71
71
|
transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
|
|
72
72
|
}
|
|
73
|
-
.c-action-bar.is-align-left[data-v-
|
|
73
|
+
.c-action-bar.is-align-left[data-v-3f0311cc] {
|
|
74
74
|
justify-content: flex-start;
|
|
75
75
|
}
|
|
76
|
-
.c-action-bar.is-align-center[data-v-
|
|
76
|
+
.c-action-bar.is-align-center[data-v-3f0311cc] {
|
|
77
77
|
justify-content: center;
|
|
78
78
|
}
|
|
79
|
-
.c-action-bar.is-align-right[data-v-
|
|
79
|
+
.c-action-bar.is-align-right[data-v-3f0311cc] {
|
|
80
80
|
justify-content: flex-end;
|
|
81
81
|
}
|
|
82
|
-
.c-action-bar.is-align-space-between[data-v-
|
|
82
|
+
.c-action-bar.is-align-space-between[data-v-3f0311cc] {
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
}
|
|
85
|
-
.c-action-bar.is-align-space-around[data-v-
|
|
85
|
+
.c-action-bar.is-align-space-around[data-v-3f0311cc] {
|
|
86
86
|
justify-content: space-around;
|
|
87
87
|
}
|
|
88
|
-
.c-action-bar.is-compact[data-v-
|
|
88
|
+
.c-action-bar.is-compact[data-v-3f0311cc] {
|
|
89
89
|
padding: 8px;
|
|
90
90
|
margin-bottom: 8px;
|
|
91
91
|
}
|
|
92
|
-
.c-action-bar.is-inline[data-v-
|
|
92
|
+
.c-action-bar.is-inline[data-v-3f0311cc] {
|
|
93
93
|
padding: 0;
|
|
94
94
|
margin-bottom: 0;
|
|
95
95
|
background: transparent;
|
|
@@ -97,97 +97,97 @@
|
|
|
97
97
|
border-radius: 0;
|
|
98
98
|
box-shadow: none;
|
|
99
99
|
}
|
|
100
|
-
.c-action-bar.is-wrap[data-v-
|
|
100
|
+
.c-action-bar.is-wrap[data-v-3f0311cc] {
|
|
101
101
|
flex-wrap: wrap;
|
|
102
102
|
gap: 8px;
|
|
103
103
|
}
|
|
104
104
|
@media (max-width: 768px) {
|
|
105
|
-
.c-action-bar[data-v-
|
|
105
|
+
.c-action-bar[data-v-3f0311cc] {
|
|
106
106
|
flex-direction: column;
|
|
107
107
|
gap: 12px;
|
|
108
108
|
}
|
|
109
|
-
.c-action-bar .actions-group[data-v-
|
|
109
|
+
.c-action-bar .actions-group[data-v-3f0311cc] {
|
|
110
110
|
width: 100%;
|
|
111
111
|
justify-content: center;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/* ================= 按钮组 ================= */
|
|
116
|
-
.actions-group[data-v-
|
|
116
|
+
.actions-group[data-v-3f0311cc] {
|
|
117
117
|
display: flex;
|
|
118
118
|
align-items: center;
|
|
119
119
|
gap: 12px;
|
|
120
120
|
flex-wrap: nowrap;
|
|
121
121
|
}
|
|
122
|
-
.actions-group.actions-left[data-v-
|
|
122
|
+
.actions-group.actions-left[data-v-3f0311cc] {
|
|
123
123
|
justify-content: flex-start;
|
|
124
124
|
}
|
|
125
|
-
.actions-group.actions-right[data-v-
|
|
125
|
+
.actions-group.actions-right[data-v-3f0311cc] {
|
|
126
126
|
justify-content: flex-end;
|
|
127
127
|
}
|
|
128
|
-
.c-action-bar.has-only-left.is-align-center .actions-group.actions-left[data-v-
|
|
128
|
+
.c-action-bar.has-only-left.is-align-center .actions-group.actions-left[data-v-3f0311cc], .c-action-bar.has-only-right.is-align-center .actions-group.actions-right[data-v-3f0311cc] {
|
|
129
129
|
width: 100%;
|
|
130
130
|
justify-content: center;
|
|
131
131
|
}
|
|
132
|
-
.c-action-bar.has-only-left.is-align-space-between .actions-group.actions-left[data-v-
|
|
132
|
+
.c-action-bar.has-only-left.is-align-space-between .actions-group.actions-left[data-v-3f0311cc], .c-action-bar.has-only-right.is-align-space-between .actions-group.actions-right[data-v-3f0311cc] {
|
|
133
133
|
width: 100%;
|
|
134
134
|
justify-content: space-between;
|
|
135
135
|
}
|
|
136
|
-
.c-action-bar.has-only-left.is-align-space-around .actions-group.actions-left[data-v-
|
|
136
|
+
.c-action-bar.has-only-left.is-align-space-around .actions-group.actions-left[data-v-3f0311cc], .c-action-bar.has-only-right.is-align-space-around .actions-group.actions-right[data-v-3f0311cc] {
|
|
137
137
|
width: 100%;
|
|
138
138
|
justify-content: space-around;
|
|
139
139
|
}
|
|
140
|
-
.c-action-bar.has-only-left.is-align-right .actions-group.actions-left[data-v-
|
|
140
|
+
.c-action-bar.has-only-left.is-align-right .actions-group.actions-left[data-v-3f0311cc] {
|
|
141
141
|
width: 100%;
|
|
142
142
|
justify-content: flex-end;
|
|
143
143
|
}
|
|
144
|
-
.c-action-bar.has-only-right.is-align-left .actions-group.actions-right[data-v-
|
|
144
|
+
.c-action-bar.has-only-right.is-align-left .actions-group.actions-right[data-v-3f0311cc] {
|
|
145
145
|
width: 100%;
|
|
146
146
|
justify-content: flex-start;
|
|
147
147
|
}
|
|
148
|
-
.actions-group[data-v-
|
|
148
|
+
.actions-group[data-v-3f0311cc] .n-button {
|
|
149
149
|
transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
|
|
150
150
|
font-weight: 500;
|
|
151
151
|
}
|
|
152
|
-
.actions-group[data-v-
|
|
152
|
+
.actions-group[data-v-3f0311cc] .n-button .n-icon {
|
|
153
153
|
transition: transform 0.3s ease;
|
|
154
154
|
}
|
|
155
|
-
.actions-group[data-v-
|
|
155
|
+
.actions-group[data-v-3f0311cc] .n-button:hover:not(:disabled) {
|
|
156
156
|
transform: translateY(-1px);
|
|
157
157
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
158
158
|
}
|
|
159
|
-
.actions-group[data-v-
|
|
159
|
+
.actions-group[data-v-3f0311cc] .n-button:hover:not(:disabled) .n-icon {
|
|
160
160
|
transform: scale(1.1);
|
|
161
161
|
}
|
|
162
|
-
.actions-group[data-v-
|
|
162
|
+
.actions-group[data-v-3f0311cc] .n-button:active:not(:disabled) {
|
|
163
163
|
transform: translateY(0);
|
|
164
164
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
165
165
|
}
|
|
166
|
-
.actions-group[data-v-
|
|
166
|
+
.actions-group[data-v-3f0311cc] .n-button:disabled {
|
|
167
167
|
cursor: not-allowed;
|
|
168
168
|
opacity: 0.5;
|
|
169
169
|
}
|
|
170
|
-
.actions-group[data-v-
|
|
170
|
+
.actions-group[data-v-3f0311cc] .n-button.n-button--loading {
|
|
171
171
|
pointer-events: none;
|
|
172
172
|
}
|
|
173
|
-
.actions-group[data-v-
|
|
173
|
+
.actions-group[data-v-3f0311cc] .n-button--primary-type:hover:not(:disabled) {
|
|
174
174
|
box-shadow: 0 4px 12px rgba(24, 160, 88, 0.3);
|
|
175
175
|
}
|
|
176
|
-
.actions-group[data-v-
|
|
176
|
+
.actions-group[data-v-3f0311cc] .n-button--info-type:hover:not(:disabled) {
|
|
177
177
|
box-shadow: 0 4px 12px rgba(42, 148, 125, 0.3);
|
|
178
178
|
}
|
|
179
|
-
.actions-group[data-v-
|
|
179
|
+
.actions-group[data-v-3f0311cc] .n-button--success-type:hover:not(:disabled) {
|
|
180
180
|
box-shadow: 0 4px 12px rgba(99, 226, 183, 0.3);
|
|
181
181
|
}
|
|
182
|
-
.actions-group[data-v-
|
|
182
|
+
.actions-group[data-v-3f0311cc] .n-button--warning-type:hover:not(:disabled) {
|
|
183
183
|
box-shadow: 0 4px 12px rgba(240, 138, 0, 0.3);
|
|
184
184
|
}
|
|
185
|
-
.actions-group[data-v-
|
|
185
|
+
.actions-group[data-v-3f0311cc] .n-button--error-type:hover:not(:disabled) {
|
|
186
186
|
box-shadow: 0 4px 12px rgba(208, 48, 80, 0.3);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
/* ================= 中间插槽区域 ================= */
|
|
190
|
-
.actions-center[data-v-
|
|
190
|
+
.actions-center[data-v-3f0311cc] {
|
|
191
191
|
display: flex;
|
|
192
192
|
align-items: center;
|
|
193
193
|
justify-content: center;
|
|
@@ -197,32 +197,32 @@
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
/* ================= 分隔线 ================= */
|
|
200
|
-
.action-divider[data-v-
|
|
200
|
+
.action-divider[data-v-3f0311cc] {
|
|
201
201
|
margin: 0 8px !important;
|
|
202
202
|
height: 20px;
|
|
203
203
|
opacity: 0.3;
|
|
204
204
|
transition: opacity 0.3s ease;
|
|
205
205
|
}
|
|
206
|
-
.action-divider[data-v-
|
|
206
|
+
.action-divider[data-v-3f0311cc]:hover {
|
|
207
207
|
opacity: 0.6;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
/* ================= 下拉菜单优化 ================= */
|
|
211
|
-
[data-v-
|
|
211
|
+
[data-v-3f0311cc] .n-dropdown-option {
|
|
212
212
|
transition: all 0.2s ease;
|
|
213
213
|
}
|
|
214
|
-
[data-v-
|
|
214
|
+
[data-v-3f0311cc] .n-dropdown-option:hover {
|
|
215
215
|
transform: translateX(4px);
|
|
216
216
|
}
|
|
217
|
-
[data-v-
|
|
217
|
+
[data-v-3f0311cc] .n-dropdown-option .n-icon {
|
|
218
218
|
transition: transform 0.2s ease;
|
|
219
219
|
}
|
|
220
|
-
[data-v-
|
|
220
|
+
[data-v-3f0311cc] .n-dropdown-option:hover .n-icon {
|
|
221
221
|
transform: scale(1.15);
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
/* ================= 加载动画 ================= */
|
|
225
|
-
@keyframes button-loading-
|
|
225
|
+
@keyframes button-loading-3f0311cc {
|
|
226
226
|
0% {
|
|
227
227
|
opacity: 0.6;
|
|
228
228
|
}
|
|
@@ -233,12 +233,12 @@
|
|
|
233
233
|
opacity: 0.6;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
[data-v-
|
|
237
|
-
animation: button-loading-
|
|
236
|
+
[data-v-3f0311cc] .n-button--loading {
|
|
237
|
+
animation: button-loading-3f0311cc 1.5s ease-in-out infinite;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/* ================= Tooltip 样式 ================= */
|
|
241
|
-
[data-v-
|
|
241
|
+
[data-v-3f0311cc] .n-tooltip .n-tooltip__content {
|
|
242
242
|
font-size: 12px;
|
|
243
243
|
padding: 6px 10px;
|
|
244
244
|
border-radius: 4px;
|
|
@@ -247,16 +247,16 @@
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
/* ================= 暗黑模式适配 ================= */
|
|
250
|
-
html.dark .c-action-bar[data-v-
|
|
250
|
+
html.dark .c-action-bar[data-v-3f0311cc] {
|
|
251
251
|
border-color: rgba(255, 255, 255, 0.09);
|
|
252
252
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
253
253
|
}
|
|
254
|
-
html.dark .actions-group[data-v-
|
|
254
|
+
html.dark .actions-group[data-v-3f0311cc] .n-button:hover:not(:disabled) {
|
|
255
255
|
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
|
|
256
256
|
}
|
|
257
|
-
html.dark .action-divider[data-v-
|
|
257
|
+
html.dark .action-divider[data-v-3f0311cc] {
|
|
258
258
|
opacity: 0.15;
|
|
259
259
|
}
|
|
260
|
-
html.dark .action-divider[data-v-
|
|
260
|
+
html.dark .action-divider[data-v-3f0311cc]:hover {
|
|
261
261
|
opacity: 0.4;
|
|
262
262
|
}
|
package/dist/C_ActionBar2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);const i=`mdi:gesture-tap-button`,a={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},o={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},s=e=>{let t=e.key?o[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||i}},c=e=>typeof e==`function`?e():(0,n.unref)(e),l=e=>e,u={key:1,class:`actions-center`},d=(0,n.defineComponent)({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`],setup(t,{emit:i}){let o=t,l=i,d=(0,n.computed)(()=>({...a,...o.config})),f=(0,n.computed)(()=>{if(o.leftActions&&o.leftActions.length>0)return o.leftActions.filter(e=>m(e));if(o.actions.length>0){let e=o.rightActions&&o.rightActions.length>0,t=o.actions.some(e=>e.group===`right`);return!e&&!t?o.actions.filter(e=>m(e)):o.actions.filter(e=>e.group!==`right`&&m(e))}return[]}),p=(0,n.computed)(()=>o.rightActions&&o.rightActions.length>0?o.rightActions.filter(e=>m(e)):o.actions.filter(e=>e.group===`right`&&m(e))),m=e=>e.show===void 0?!0:c(e.show)??!0,h=(0,n.
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);const i=`mdi:gesture-tap-button`,a={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},o={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},s=e=>{let t=e.key?o[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||i}},c=e=>typeof e==`function`?e():(0,n.unref)(e),l=e=>e,u={key:1,class:`actions-center`},d=(0,n.defineComponent)({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`],setup(t,{emit:i}){let o=t,l=i,d=(0,n.computed)(()=>({...a,...o.config})),f=(0,n.computed)(()=>{if(o.leftActions&&o.leftActions.length>0)return o.leftActions.filter(e=>m(e));if(o.actions.length>0){let e=o.rightActions&&o.rightActions.length>0,t=o.actions.some(e=>e.group===`right`);return!e&&!t?o.actions.filter(e=>m(e)):o.actions.filter(e=>e.group!==`right`&&m(e))}return[]}),p=(0,n.computed)(()=>o.rightActions&&o.rightActions.length>0?o.rightActions.filter(e=>m(e)):o.actions.filter(e=>e.group===`right`&&m(e))),m=e=>e.show===void 0?!0:c(e.show)??!0,h=(0,n.shallowReactive)(new Set),g=e=>c(e.disabled)||h.has(e),_=e=>c(e.loading)||h.has(e),v=async e=>{if(!(e.dropdown&&e.dropdown.length>0)&&!(g(e)||_(e))&&(l(`action-click`,e),e.onClick)){e.autoLoading!==!1&&h.add(e);try{await e.onClick()}finally{h.delete(e)}}},y=async(e,t)=>{l(`dropdown-click`,e,t),e.onClick&&await e.onClick()},b=(0,n.defineComponent)({name:`ActionButton`,props:{action:{type:Object,required:!0}},emits:[`click`,`dropdown-select`],setup(t,{emit:i}){let a=(0,n.computed)(()=>t.action),o=(0,n.computed)(()=>s(a.value)),l=(0,n.computed)(()=>o.value.size||d.value.size),u=(0,n.computed)(()=>({tiny:14,small:15,medium:16,large:18})[l.value]),f=(0,n.computed)(()=>o.value.dropdown?o.value.dropdown.filter(e=>e.show===void 0?!0:c(e.show)).map(t=>{let{icon:r}=t;return{key:t.key,label:t.label,icon:r?()=>(0,n.h)(e.t,{name:r,size:14,"aria-hidden":!0}):void 0,disabled:c(t.disabled)}}):[]),p=e=>{let t=o.value.dropdown?.find(t=>t.key===e);t&&i(`dropdown-select`,t)},m=t=>{let{icon:i}=o.value,s=(0,n.h)(r.NButton,{type:o.value.type||`default`,size:l.value,loading:_(a.value),disabled:g(a.value),...t,...o.value.buttonProps},{default:()=>o.value.label,icon:i?()=>(0,n.h)(e.t,{name:i,size:u.value,"aria-hidden":!0}):void 0});return o.value.directives&&o.value.directives.length>0?(0,n.withDirectives)(s,o.value.directives):s},h=()=>{let e=m({onClick:()=>i(`click`)});return o.value.tooltip?(0,n.h)(r.NTooltip,{placement:`top`},{trigger:()=>e,default:()=>o.value.tooltip}):e},v=()=>{let e=m();return(0,n.h)(r.NDropdown,{options:f.value,onSelect:p},{default:()=>e})};return()=>o.value.dropdown&&o.value.dropdown.length>0?v():h()}});return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`c-action-bar`,{"is-compact":d.value.compact,"is-inline":d.value.inline,"is-wrap":d.value.wrap,[`is-align-${d.value.align}`]:!0,"has-only-left":f.value.length>0&&p.value.length===0&&!e.$slots.center,"has-only-right":p.value.length>0&&f.value.length===0&&!e.$slots.center}])},[f.value.length>0?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:`actions-group actions-left`,style:(0,n.normalizeStyle)({gap:`${d.value.gap}px`})},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(f.value,(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:e.key||`left-${t}`},[(0,n.createVNode)((0,n.unref)(b),{action:e,onClick:t=>v(e),onDropdownSelect:t=>y(t,e)},null,8,[`action`,`onClick`,`onDropdownSelect`]),d.value.showDivider&&t<f.value.length-1&&d.value.dividerType===`vertical`?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NDivider),{key:0,vertical:``,class:`action-divider`})):(0,n.createCommentVNode)(`v-if`,!0)],64))),128))],4)):(0,n.createCommentVNode)(`v-if`,!0),e.$slots.center?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,[(0,n.renderSlot)(e.$slots,`center`,{},void 0,!0)])):(0,n.createCommentVNode)(`v-if`,!0),p.value.length>0?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:2,class:`actions-group actions-right`,style:(0,n.normalizeStyle)({gap:`${d.value.gap}px`})},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(p.value,(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:e.key||`right-${t}`},[(0,n.createVNode)((0,n.unref)(b),{action:e,onClick:t=>v(e),onDropdownSelect:t=>y(t,e)},null,8,[`action`,`onClick`,`onDropdownSelect`]),d.value.showDivider&&t<p.value.length-1&&d.value.dividerType===`vertical`?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NDivider),{key:0,vertical:``,class:`action-divider`})):(0,n.createCommentVNode)(`v-if`,!0)],64))),128))],4)):(0,n.createCommentVNode)(`v-if`,!0)],2))}});var f=t.t(d,[[`__scopeId`,`data-v-3f0311cc`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
package/dist/C_ActionBar2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createVNode as s,defineComponent as c,h as l,normalizeClass as u,normalizeStyle as d,openBlock as f,
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createVNode as s,defineComponent as c,h as l,normalizeClass as u,normalizeStyle as d,openBlock as f,renderList as p,renderSlot as m,shallowReactive as h,unref as g,withDirectives as _}from"vue";import{NButton as v,NDivider as y,NDropdown as b,NTooltip as x}from"naive-ui";const S=`mdi:gesture-tap-button`,C={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},w={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},T=e=>{let t=e.key?w[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||S}},E=e=>typeof e==`function`?e():g(e),D=e=>e,O={key:1,class:`actions-center`};var k=t(c({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`],setup(t,{emit:S}){let w=t,D=S,k=r(()=>({...C,...w.config})),A=r(()=>{if(w.leftActions&&w.leftActions.length>0)return w.leftActions.filter(e=>M(e));if(w.actions.length>0){let e=w.rightActions&&w.rightActions.length>0,t=w.actions.some(e=>e.group===`right`);return!e&&!t?w.actions.filter(e=>M(e)):w.actions.filter(e=>e.group!==`right`&&M(e))}return[]}),j=r(()=>w.rightActions&&w.rightActions.length>0?w.rightActions.filter(e=>M(e)):w.actions.filter(e=>e.group===`right`&&M(e))),M=e=>e.show===void 0?!0:E(e.show)??!0,N=h(new Set),P=e=>E(e.disabled)||N.has(e),F=e=>E(e.loading)||N.has(e),I=async e=>{if(!(e.dropdown&&e.dropdown.length>0)&&!(P(e)||F(e))&&(D(`action-click`,e),e.onClick)){e.autoLoading!==!1&&N.add(e);try{await e.onClick()}finally{N.delete(e)}}},L=async(e,t)=>{D(`dropdown-click`,e,t),e.onClick&&await e.onClick()},R=c({name:`ActionButton`,props:{action:{type:Object,required:!0}},emits:[`click`,`dropdown-select`],setup(t,{emit:n}){let i=r(()=>t.action),a=r(()=>T(i.value)),o=r(()=>a.value.size||k.value.size),s=r(()=>({tiny:14,small:15,medium:16,large:18})[o.value]),c=r(()=>a.value.dropdown?a.value.dropdown.filter(e=>e.show===void 0?!0:E(e.show)).map(t=>{let{icon:n}=t;return{key:t.key,label:t.label,icon:n?()=>l(e,{name:n,size:14,"aria-hidden":!0}):void 0,disabled:E(t.disabled)}}):[]),u=e=>{let t=a.value.dropdown?.find(t=>t.key===e);t&&n(`dropdown-select`,t)},d=t=>{let{icon:n}=a.value,r=l(v,{type:a.value.type||`default`,size:o.value,loading:F(i.value),disabled:P(i.value),...t,...a.value.buttonProps},{default:()=>a.value.label,icon:n?()=>l(e,{name:n,size:s.value,"aria-hidden":!0}):void 0});return a.value.directives&&a.value.directives.length>0?_(r,a.value.directives):r},f=()=>{let e=d({onClick:()=>n(`click`)});return a.value.tooltip?l(x,{placement:`top`},{trigger:()=>e,default:()=>a.value.tooltip}):e},p=()=>{let e=d();return l(b,{options:c.value,onSelect:u},{default:()=>e})};return()=>a.value.dropdown&&a.value.dropdown.length>0?p():f()}});return(e,t)=>(f(),o(`div`,{class:u([`c-action-bar`,{"is-compact":k.value.compact,"is-inline":k.value.inline,"is-wrap":k.value.wrap,[`is-align-${k.value.align}`]:!0,"has-only-left":A.value.length>0&&j.value.length===0&&!e.$slots.center,"has-only-right":j.value.length>0&&A.value.length===0&&!e.$slots.center}])},[A.value.length>0?(f(),o(`div`,{key:0,class:`actions-group actions-left`,style:d({gap:`${k.value.gap}px`})},[(f(!0),o(n,null,p(A.value,(e,t)=>(f(),o(n,{key:e.key||`left-${t}`},[s(g(R),{action:e,onClick:t=>I(e),onDropdownSelect:t=>L(t,e)},null,8,[`action`,`onClick`,`onDropdownSelect`]),k.value.showDivider&&t<A.value.length-1&&k.value.dividerType===`vertical`?(f(),i(g(y),{key:0,vertical:``,class:`action-divider`})):a(`v-if`,!0)],64))),128))],4)):a(`v-if`,!0),e.$slots.center?(f(),o(`div`,O,[m(e.$slots,`center`,{},void 0,!0)])):a(`v-if`,!0),j.value.length>0?(f(),o(`div`,{key:2,class:`actions-group actions-right`,style:d({gap:`${k.value.gap}px`})},[(f(!0),o(n,null,p(j.value,(e,t)=>(f(),o(n,{key:e.key||`right-${t}`},[s(g(R),{action:e,onClick:t=>I(e),onDropdownSelect:t=>L(t,e)},null,8,[`action`,`onClick`,`onDropdownSelect`]),k.value.showDivider&&t<j.value.length-1&&k.value.dividerType===`vertical`?(f(),i(g(y),{key:0,vertical:``,class:`action-divider`})):a(`v-if`,!0)],64))),128))],4)):a(`v-if`,!0)],2))}}),[[`__scopeId`,`data-v-3f0311cc`]]);export{D as a,S as i,C as n,T as o,w as r,k as t};
|