@robot-admin/naive-ui-components 0.41.2 → 0.42.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 +9 -0
- package/README.md +3 -1
- package/README_EN.md +11 -9
- package/dist/ActionOverflow.cjs +1 -1
- package/dist/ActionOverflow.js +1 -1
- package/dist/C_ActionBar.cjs +1 -1
- package/dist/C_ActionBar.css +54 -54
- package/dist/C_ActionBar.js +1 -1
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_ApprovalViewer.css +15 -15
- package/dist/C_ApprovalViewer2.cjs +1 -1
- package/dist/C_ApprovalViewer2.js +1 -1
- package/dist/C_ContextMenu.css +3 -3
- package/dist/C_ContextMenu2.cjs +1 -1
- package/dist/C_ContextMenu2.js +1 -1
- package/dist/C_DataPicker.css +22 -22
- package/dist/C_DataPicker2.cjs +1 -1
- package/dist/C_DataPicker2.js +1 -1
- package/dist/C_Density2.cjs +1 -1
- package/dist/C_Density2.js +1 -1
- package/dist/C_Draggable.css +66 -53
- package/dist/C_Draggable2.cjs +1 -1
- package/dist/C_Draggable2.js +1 -1
- package/dist/C_Form.base.css +1 -1
- package/dist/C_Form.css +1 -1
- package/dist/C_FormModal.css +55 -55
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +1 -1
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Language.css +2 -2
- package/dist/C_Language2.cjs +1 -1
- package/dist/C_Language2.js +1 -1
- package/dist/C_Login.css +85 -85
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Markdown.css +37 -37
- package/dist/C_Markdown2.cjs +1 -1
- package/dist/C_Markdown2.js +1 -1
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_Progress2.cjs +1 -1
- package/dist/C_Progress2.js +1 -1
- package/dist/C_ResourceSchedule2.cjs +1 -1
- package/dist/C_ResourceSchedule2.js +1 -1
- package/dist/C_Select.css +1 -1
- package/dist/C_Select2.cjs +1 -1
- package/dist/C_Select2.js +1 -1
- package/dist/C_Signature.css +15 -15
- package/dist/C_Signature2.cjs +1 -1
- package/dist/C_Signature2.js +1 -1
- package/dist/C_SplitPane2.cjs +1 -1
- package/dist/C_SplitPane2.js +1 -1
- package/dist/C_Table.base.css +55 -55
- package/dist/C_Table.css +54 -54
- package/dist/C_Transfer.css +25 -25
- package/dist/C_Transfer2.cjs +1 -1
- package/dist/C_Transfer2.js +1 -1
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_UserPicker.css +1 -1
- package/dist/OptionStatus.cjs +1 -1
- package/dist/OptionStatus.js +1 -1
- package/dist/actionIcon.cjs +1 -1
- package/dist/actionIcon.js +1 -1
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants3.d.cts +4 -4
- package/dist/constants3.d.ts +4 -4
- package/dist/constants4.d.cts +6 -5
- package/dist/constants4.d.ts +6 -5
- package/dist/data2.d.cts +8 -8
- package/dist/data2.d.ts +8 -8
- package/dist/editors.d.cts +5 -5
- package/dist/editors.d.ts +5 -5
- package/dist/index.d.cts +1 -0
- package/dist/index10.vue.d.cts +2 -2
- package/dist/index11.vue.d.ts +2 -2
- package/dist/index12.vue.d.cts +2 -2
- package/dist/index12.vue.d.ts +2 -2
- package/dist/index13.vue.d.cts +2 -2
- package/dist/index13.vue.d.ts +3 -3
- package/dist/index14.vue.d.cts +3 -3
- package/dist/index14.vue.d.ts +3 -3
- package/dist/index15.vue.d.cts +3 -3
- package/dist/index17.vue.d.ts +4 -4
- package/dist/index18.vue.d.cts +4 -4
- package/dist/index19.vue.d.ts +2 -2
- 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 +3 -3
- package/dist/index21.vue.d.cts +3 -3
- package/dist/index21.vue.d.ts +5 -5
- package/dist/index22.vue.d.cts +5 -5
- package/dist/index24.vue.d.ts +2 -2
- package/dist/index25.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +4 -4
- package/dist/index28.vue.d.cts +4 -4
- package/dist/index29.vue.d.cts +2 -2
- package/dist/index29.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +2 -2
- package/dist/index3.vue.d.ts +2 -2
- package/dist/index31.vue.d.cts +1 -1
- package/dist/index31.vue.d.ts +1 -1
- package/dist/index35.vue.d.cts +2 -2
- package/dist/index35.vue.d.ts +2 -2
- package/dist/index38.vue.d.cts +2 -2
- package/dist/index38.vue.d.ts +2 -2
- package/dist/index41.vue.d.cts +1 -1
- package/dist/index41.vue.d.ts +1 -1
- package/dist/index42.vue.d.cts +1 -1
- package/dist/index42.vue.d.ts +1 -1
- package/dist/index43.vue.d.cts +2 -2
- package/dist/index43.vue.d.ts +2 -2
- package/dist/index5.vue.d.cts +1 -1
- package/dist/index5.vue.d.ts +1 -1
- package/dist/index6.vue.d.cts +4 -4
- package/dist/index6.vue.d.ts +4 -4
- package/dist/index9.vue.d.ts +2 -2
- package/dist/mapUtils.d.cts +2 -2
- package/dist/mapUtils.d.ts +2 -2
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/source.cjs +1 -1
- package/dist/source.js +1 -1
- package/dist/style.css +327 -314
- package/dist/types.d.cts +4 -0
- package/dist/types.d.ts +4 -0
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +3 -3
- package/dist/useCollapsePanel.d.ts +3 -3
- package/dist/useCropperCore.d.cts +4 -4
- package/dist/useCropperCore.d.ts +4 -4
- package/dist/useFormulaEvaluator.cjs +1 -1
- package/dist/useFormulaEvaluator.js +1 -1
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +1 -0
- package/dist/useSignatureHistory.d.ts +1 -0
- package/dist/useSplitResize.d.cts +2 -2
- package/dist/useSplitResize.d.ts +2 -2
- package/dist/useWorkflowValidation.d.cts +32 -32
- package/dist/useWorkflowValidation.d.ts +32 -32
- package/dist/verification.d.cts +7 -7
- package/dist/verification.d.ts +7 -7
- package/docs/guides/resource-schedule.md +1 -0
- package/docs/guides/usage.en.md +15 -4
- package/docs/guides/usage.md +13 -4
- package/package.json +1 -1
package/docs/guides/usage.en.md
CHANGED
|
@@ -533,22 +533,27 @@ The `reset(params)` event carries the reset snapshot after the synchronous v-mod
|
|
|
533
533
|
|
|
534
534
|
### Action configuration and asynchronous work
|
|
535
535
|
|
|
536
|
-
Stable semantic keys
|
|
536
|
+
Stable semantic keys provide the default labels and icons. The component manages loading and execution locks for callbacks that return promises.
|
|
537
537
|
|
|
538
538
|
```ts
|
|
539
539
|
const actions = defineActions([
|
|
540
540
|
{ key: 'save', onClick: () => saveCurrentUser() },
|
|
541
541
|
{ key: 'refresh', disabled: () => loading.value, onClick: reload },
|
|
542
|
+
{ key: 'publish', label: 'Publish', cooldownMs: 500, onClick: publishUsers },
|
|
542
543
|
{
|
|
543
544
|
key: 'more',
|
|
544
|
-
dropdown: [
|
|
545
|
+
dropdown: [
|
|
546
|
+
{ key: 'delete', label: 'Delete selection', onClick: deleteUsers },
|
|
547
|
+
],
|
|
545
548
|
},
|
|
546
549
|
])
|
|
547
550
|
```
|
|
548
551
|
|
|
549
|
-
|
|
552
|
+
Actions and dropdown items whose `key` exactly matches `save`, `submit`, `confirm`, `delete`, or `remove` have a 300 ms cooldown by default. The first activation runs immediately, and repeat activations during the window are discarded. Other actions support consecutive activations. Set `cooldownMs` on an action or dropdown item to a positive, finite number of milliseconds. A value of `0` or an invalid value skips starting the cooldown for that activation. A failed action can be retried immediately.
|
|
550
553
|
|
|
551
|
-
|
|
554
|
+
Duplicate keys in one ActionBar share a task lock and cooldown. A stable key preserves state when its action object is replaced or moved between groups. Unkeyed actions use their group and position, so give dynamic lists explicit keys. Sibling dropdown items have independent cooldowns and share their parent action's async lock. The automatic spinner reflects in-flight work. `autoLoading: false` hides the spinner and keeps the lock active.
|
|
555
|
+
|
|
556
|
+
`action-click` and `dropdown-click` notify observers of accepted activations. Put async commands in the action's `onClick` so the component can await them. Failures emit `action-error(error, action, item?)` and propagate to Vue's `errorHandler` or error-capture boundary. `buttonProps.disabled/loading` merge with action state. For regular buttons, `buttonProps.onClick` observes accepted native clicks. The dropdown trigger stays usable while an item cools down, subject to the usual disabled and loading guards. Table row actions reuse lightweight task locks.
|
|
552
557
|
|
|
553
558
|
## Recommended C_Map setup
|
|
554
559
|
|
|
@@ -639,6 +644,10 @@ With `require-server-verification`, a successful response must include a server
|
|
|
639
644
|
|
|
640
645
|
`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.
|
|
641
646
|
|
|
647
|
+
## Keyboard sorting in C_Draggable
|
|
648
|
+
|
|
649
|
+
In a sortable list with multiple items, press Tab to focus an item and use Alt+Up or Alt+Down to change its position. When the host accepts the `v-model` update, focus follows the item and the new position is announced. Keyboard moves use `update:modelValue` and `list-change`. Controls inside custom item slots keep their own keyboard behavior.
|
|
650
|
+
|
|
642
651
|
## Table loading
|
|
643
652
|
|
|
644
653
|
`C_Table` uses a data-orbit SVG indicator in the theme's primary color, with an orbit, data rows, and a subtle beam to indicate waiting. It retains existing data and respects reduced-motion preferences without page configuration. Built-in asynchronous expansion also uses `C_Loading`; custom expansion renderers retain control of their content. Override the `loading` slot for custom content. The standalone `C_Loading` accepts `size` (16–120, default 48), optional `label`, and optional `color`. Disable rotation when using it with native `NSpin`:
|
|
@@ -711,6 +720,8 @@ With `C_FullCalendar` and `v-model:events`, listen for `@event-dropped` or `@eve
|
|
|
711
720
|
|
|
712
721
|
Upload `concurrency` applies across normal and chunk upload requests. Cancellation stops subsequent hash reads; a Blob read already in progress is discarded on completion. Application-provided check/merge callbacks retain responsibility for their own network lifecycle.
|
|
713
722
|
|
|
723
|
+
Pausing and resuming a file or retrying its transfer reuses the file prepared by `beforeUpload` and the chunk size of its first transfer. When `uploadedChunksQuery` returns existing chunk indices, the server must ensure they use the same chunk size, including across separate upload instances.
|
|
724
|
+
|
|
714
725
|
Excel previews preserve raw values, cell types and workbook display formatting. Sheets expand on demand. Defaults are 32 MiB per file and 100000 cells per sheet. `previewLimits: { maxBytes, maxCells }` accepts finite safe positive integers. Remote Excel previews stop reading the response once the byte limit is exceeded. Over-budget previews ask users to download the original file. Memory used to decompress a workbook depends on its contents.
|
|
715
726
|
|
|
716
727
|
WaterFall fills a visible sentinel for at most five consecutive pages, then exposes a manual continuation. Custom `footer` slots receive `paused` and `loadMore`. Continue updating `loading` and `noMore` in the host. Draggable instances sort independently by default; cross-list transfers require an explicitly shared `group`.
|
package/docs/guides/usage.md
CHANGED
|
@@ -650,22 +650,25 @@ const filters: SearchFormItem[] = [
|
|
|
650
650
|
|
|
651
651
|
### 动作配置与异步执行
|
|
652
652
|
|
|
653
|
-
|
|
653
|
+
使用稳定的语义 key 继承文案和图标。返回 Promise 的回调由组件管理加载状态和执行锁。
|
|
654
654
|
|
|
655
655
|
```ts
|
|
656
656
|
const actions = defineActions([
|
|
657
657
|
{ key: 'save', onClick: () => saveCurrentUser() },
|
|
658
658
|
{ key: 'refresh', disabled: () => loading.value, onClick: reload },
|
|
659
|
+
{ key: 'publish', label: '发布', cooldownMs: 500, onClick: publishUsers },
|
|
659
660
|
{
|
|
660
661
|
key: 'more',
|
|
661
|
-
dropdown: [{ key: '
|
|
662
|
+
dropdown: [{ key: 'delete', label: '删除选中项', onClick: deleteUsers }],
|
|
662
663
|
},
|
|
663
664
|
])
|
|
664
665
|
```
|
|
665
666
|
|
|
666
|
-
|
|
667
|
+
普通动作和下拉子项的 `key` 精确匹配 `save`、`submit`、`confirm`、`delete` 或 `remove` 时,默认启用 300 ms 冷却。首次激活立即执行,窗口内的重复操作直接忽略。其他动作支持连续操作。可在动作或下拉子项上用 `cooldownMs` 指定正的有限毫秒值。设置 `0` 或无效值时,本次激活跳过冷却计时。失败后可立即重试。
|
|
667
668
|
|
|
668
|
-
|
|
669
|
+
同一 ActionBar 中的重复 key 共享执行锁和冷却,重建动作对象或切换左右分组会保留稳定 key 的状态。无 key 时按分组和位置识别,动态列表应显式提供 key。下拉子项独立冷却,并共享父动作的异步执行锁。加载指示只跟随执行中的任务,`autoLoading: false` 可隐藏自动加载指示,执行锁继续生效。
|
|
670
|
+
|
|
671
|
+
`action-click`/`dropdown-click` 通知已接受的激活,异步命令放在会等待 Promise 的动作 `onClick`。失败发出 `action-error(error, action, item?)`,原始错误继续交给 Vue `errorHandler`/错误捕获边界。`buttonProps.disabled/loading` 与动作状态合并。普通按钮的 `buttonProps.onClick` 观察已接受的原生点击。下拉触发按钮的打开和关闭继续遵循禁用和加载状态,子项冷却期间仍可操作触发按钮。表格行操作复用轻量执行锁。
|
|
669
672
|
|
|
670
673
|
## C_Map 推荐用法
|
|
671
674
|
|
|
@@ -771,6 +774,10 @@ const actions = defineActions([
|
|
|
771
774
|
</NSpin>
|
|
772
775
|
```
|
|
773
776
|
|
|
777
|
+
## C_Draggable 键盘排序
|
|
778
|
+
|
|
779
|
+
有多项且允许排序时,按 Tab 聚焦项目,再用 Alt + ↑ / ↓ 按列表顺序移动。组件在宿主接收 `v-model` 后把焦点移到新位置,并读出排序结果。键盘移动沿用 `update:modelValue` 和 `list-change`,自定义插槽中的输入框和按钮继续接收自己的按键。
|
|
780
|
+
|
|
774
781
|
## C_Login 扩展表单
|
|
775
782
|
|
|
776
783
|
`password-fields` 插槽位于密码输入框下方,提供 `username`、`loading`,可配置工作空间或其他业务字段。`username-change` 在初始预填、恢复记住的账号和输入变化时同步触发。宿主通过 `submitDisabled` 阻止扩展字段尚未就绪时的按钮与回车提交;`loading` 期间凭据输入禁用。公司查询、成员关系和权限始终由宿主认证服务处理,组件不保存业务上下文。
|
|
@@ -849,6 +856,8 @@ CRUD 控制器只需满足结构契约;`@robot-admin/request-core` 0.6.3 起
|
|
|
849
856
|
|
|
850
857
|
`C_Upload.concurrency` 统一限制普通上传与分片上传请求。取消、移除和卸载会停止后续哈希读取并释放排队任务;已经开始的单次 Blob 读取完成后不再处理结果。业务自行提供的校验、合并回调仍由业务负责其网络生命周期。
|
|
851
858
|
|
|
859
|
+
同一文件的恢复与传输重试复用 `beforeUpload` 处理后的文件和首次传输的分片尺寸。服务端通过 `uploadedChunksQuery` 返回已上传索引时,须保证这些索引使用同一分片尺寸,跨上传实例也遵循此约定。
|
|
860
|
+
|
|
852
861
|
在同一编辑弹窗切换记录时,调用上传实例的 `replaceFileList(record.attachments)`。它会废弃上一条记录尚未返回的文件选择结果和拖入目录,取消上传任务,再回填新记录的附件。`defaultFileList` 用于首次初始化。`clearAll()` 使用同样的取消路径。
|
|
853
862
|
|
|
854
863
|
普通单文件模式一次只接收一个符合 `accept` 的文件,点击、拖放和粘贴一致。需要接收整个目录时开启 `directory`;需要限制整个列表的数量时使用 `maxCount`。
|