@robot-admin/naive-ui-components 0.13.0 → 0.13.2
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 +12 -0
- package/README.md +37 -0
- package/README_EN.md +37 -0
- package/dist/C_Guide.css +123 -0
- package/dist/C_Guide.d.cts +2 -2
- package/dist/C_Guide.d.ts +2 -2
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Login.css +76 -76
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.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 +3 -3
- package/dist/constants3.d.ts +3 -3
- package/dist/constants4.d.cts +4 -4
- package/dist/constants4.d.ts +4 -4
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/data.d.cts +8 -8
- package/dist/data.d.ts +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.vue.d.cts +8 -8
- package/dist/index.vue.d.ts +8 -8
- package/dist/index10.vue.d.cts +6 -6
- 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 +33 -7
- package/dist/index14.vue.d.cts +33 -7
- package/dist/index14.vue.d.ts +5 -5
- package/dist/index15.vue.d.cts +5 -5
- package/dist/index15.vue.d.ts +3 -3
- package/dist/index16.vue.d.cts +3 -3
- package/dist/index16.vue.d.ts +10 -1
- package/dist/index17.vue.d.cts +10 -1
- package/dist/index17.vue.d.ts +4 -4
- package/dist/index18.vue.d.cts +4 -4
- package/dist/index19.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index2.vue.d.cts +3 -3
- package/dist/index2.vue.d.ts +3 -3
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +1 -1
- package/dist/index21.vue.d.cts +2 -2
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index24.vue.d.cts +4 -4
- package/dist/index24.vue.d.ts +4 -4
- package/dist/index25.vue.d.cts +1 -1
- package/dist/index25.vue.d.ts +1 -1
- package/dist/index26.vue.d.cts +2 -2
- package/dist/index26.vue.d.ts +2 -2
- package/dist/index27.vue.d.cts +3 -3
- package/dist/index27.vue.d.ts +3 -3
- package/dist/index3.vue.d.cts +6 -6
- package/dist/index3.vue.d.ts +6 -6
- 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/index8.vue.d.ts +1 -1
- package/dist/index9.vue.d.cts +1 -1
- package/dist/index9.vue.d.ts +6 -6
- 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/style.css +201 -76
- 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 +3 -3
- package/dist/useCropperCore.d.ts +3 -3
- package/dist/useDraggableLayout.d.cts +4 -4
- package/dist/useDraggableLayout.d.ts +4 -4
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +3 -3
- package/dist/useEdgeInteraction.d.ts +3 -3
- package/dist/useQRCode.d.cts +6 -6
- package/dist/useQRCode.d.ts +6 -6
- package/dist/useSearchState.d.cts +8 -8
- package/dist/useSearchState.d.ts +8 -8
- package/dist/useSignatureHistory.d.cts +6 -6
- package/dist/useSignatureHistory.d.ts +6 -6
- package/dist/useSplitResize.d.cts +5 -5
- package/dist/useSplitResize.d.ts +5 -5
- package/dist/useTableQuery.d.cts +1 -1
- package/dist/useTableQuery.d.ts +1 -1
- package/dist/useTimeSelection.d.cts +4 -4
- package/dist/useTimeSelection.d.ts +4 -4
- package/dist/useTreeOperations.d.cts +5 -5
- package/dist/useTreeOperations.d.ts +5 -5
- package/dist/useWorkflowValidation.d.cts +7 -7
- package/dist/useWorkflowValidation.d.ts +7 -7
- package/dist/verification.d.cts +3 -3
- package/dist/verification.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @robot-admin/naive-ui-components
|
|
2
2
|
|
|
3
|
+
## 0.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- C_Login 增加通用密码表单扩展插槽、账号变化事件和提交禁用状态,支持宿主在登录前配置业务字段。
|
|
8
|
+
|
|
9
|
+
## 0.13.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 303f3b6: 完善 C_Guide:引擎在用户打开时加载,统一图文弹层随 Naive UI 主题变化,自动跳过缺失或不可见目标,支持动态目标和停止 API。增加可配置的“跳过引导”按钮及 skip 事件,补充概览、通知、全屏、语言、主题和布局等通用示意图。修复完成事件、完成持久化及步骤离开回调,补齐首帧前退出的清理,防止动画期间快速切换残留高亮,并取消卸载或配置变化后的待启动任务。跳过不记录为完成,用户可随时重新查看。通用组件不依赖宿主路由、菜单或业务 Store。
|
|
14
|
+
|
|
3
15
|
## 0.13.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -105,6 +105,37 @@ import '@robot-admin/naive-ui-components/C_Table/base.css'
|
|
|
105
105
|
// 完整模式也可显式使用 C_Form/full.css、C_Table/full.css
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
### C_Guide 配置引导
|
|
109
|
+
|
|
110
|
+
项目只需要提供目标和步骤,组件内置主题、可选 SVG 示意图及退出清理,不依赖项目的路由或 Store:
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<script setup lang="ts">
|
|
114
|
+
import {
|
|
115
|
+
C_Guide,
|
|
116
|
+
type GuideStep,
|
|
117
|
+
} from '@robot-admin/naive-ui-components/C_Guide'
|
|
118
|
+
import '@robot-admin/naive-ui-components/C_Guide/style.css'
|
|
119
|
+
|
|
120
|
+
const steps: GuideStep[] = [
|
|
121
|
+
{
|
|
122
|
+
element: '[data-guide="search"]',
|
|
123
|
+
popover: {
|
|
124
|
+
title: '搜索',
|
|
125
|
+
description: '快速查找功能。',
|
|
126
|
+
illustration: 'search',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
]
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<template>
|
|
133
|
+
<C_Guide :steps="steps" />
|
|
134
|
+
</template>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
在 `NConfigProvider` 内会自动跟随亮暗主题和主色。目标支持选择器、元素或解析函数;默认跳过不可见目标,不传目标可展示居中步骤。引擎在打开时加载。启用 `persistence` 后,只有完成引导才记住状态;点击入口仍可重看。每一步默认显示“跳过引导”,跳过会发出 `skip` 和 `close` 事件,不记录为完成;可用 `showSkipButton` 和 `skipBtnText` 控制入口与文案。通过 `GuideExpose` 可调用 `startGuide(force?)`、`stopGuide()`、`isCompleted()` 和 `resetCompleted()`,宿主可在路由切换时主动停止。
|
|
138
|
+
|
|
108
139
|
### C_Form / C_Table 推荐用法
|
|
109
140
|
|
|
110
141
|
推荐使用类型助手和绑定助手:业务模型只声明一次,字段路径、字段值、列 key、保存回调和实例方法即可保持同一套类型推导。字段支持 `profile.name`、`contacts.0.email` 这类嵌套路径。
|
|
@@ -630,6 +661,8 @@ bun run verify # 发布前完整验证
|
|
|
630
661
|
bun run release # 发布 Changesets 中待发布版本
|
|
631
662
|
```
|
|
632
663
|
|
|
664
|
+
本仓库的 GitHub 变更日志生成器要求在执行 `bun run version` 时提供 `GITHUB_TOKEN`,不要将令牌写入仓库。Windows 下如果 `bun run release` 在 npm 的 `prepublishOnly` 重复验证阶段停滞,可先单独确认 `bun run verify` 成功,再在 PowerShell 中用 `$env:npm_config_ignore_scripts='true'; bun run release` 发布;该设置仅跳过已手动完成的重复生命周期验证,不应省略前一步。
|
|
665
|
+
|
|
633
666
|
## 📄 许可证
|
|
634
667
|
|
|
635
668
|
MIT License
|
|
@@ -643,3 +676,7 @@ MIT License
|
|
|
643
676
|
- [Robot Admin 在线体验](https://www.robotadmin.cn)
|
|
644
677
|
- [GitHub](https://github.com/ChenyCHENYU/naive-ui-components)
|
|
645
678
|
- [NPM](https://www.npmjs.com/package/@robot-admin/naive-ui-components)
|
|
679
|
+
|
|
680
|
+
### C_Login 扩展表单
|
|
681
|
+
|
|
682
|
+
`password-fields` 插槽位于密码输入框下方,提供 `username`、`loading`,可配置工作空间或其他业务字段。`username-change` 在初始预填、恢复记住的账号和输入变化时同步触发。宿主通过 `submitDisabled` 阻止扩展字段尚未就绪时的按钮与回车提交;`loading` 期间凭据输入禁用。公司查询、成员关系和权限始终由宿主认证服务处理,组件不保存业务上下文。
|
package/README_EN.md
CHANGED
|
@@ -105,6 +105,37 @@ import '@robot-admin/naive-ui-components/C_Table/base.css'
|
|
|
105
105
|
// Full mode is also available as C_Form/full.css and C_Table/full.css.
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
### Configure C_Guide
|
|
109
|
+
|
|
110
|
+
Provide targets and steps; the component owns its theme, optional SVG illustrations, and cleanup without depending on a host router or store:
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<script setup lang="ts">
|
|
114
|
+
import {
|
|
115
|
+
C_Guide,
|
|
116
|
+
type GuideStep,
|
|
117
|
+
} from '@robot-admin/naive-ui-components/C_Guide'
|
|
118
|
+
import '@robot-admin/naive-ui-components/C_Guide/style.css'
|
|
119
|
+
|
|
120
|
+
const steps: GuideStep[] = [
|
|
121
|
+
{
|
|
122
|
+
element: '[data-guide="search"]',
|
|
123
|
+
popover: {
|
|
124
|
+
title: 'Search',
|
|
125
|
+
description: 'Find a feature.',
|
|
126
|
+
illustration: 'search',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
]
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<template>
|
|
133
|
+
<C_Guide :steps="steps" />
|
|
134
|
+
</template>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Inside `NConfigProvider`, the popover follows its light/dark theme and primary color. Targets accept selectors, elements, or resolver functions; invisible targets are skipped by default and omitting a target creates a centered step. The engine loads when opened. With `persistence` enabled, only completion is remembered; the trigger always allows replay. Every step shows a skip button by default. Skipping emits `skip` and `close` without recording completion; configure it with `showSkipButton` and `skipBtnText`. `GuideExpose` provides `startGuide(force?)`, `stopGuide()`, `isCompleted()`, and `resetCompleted()` for host lifecycle integration.
|
|
138
|
+
|
|
108
139
|
### Recommended C_Form / C_Table setup
|
|
109
140
|
|
|
110
141
|
Declare the business model once and keep nested field paths, values, column keys, callbacks, and exposed methods type-safe:
|
|
@@ -570,6 +601,8 @@ bun run verify # Run all pre-publish checks
|
|
|
570
601
|
bun run release # Publish pending Changesets releases
|
|
571
602
|
```
|
|
572
603
|
|
|
604
|
+
The GitHub changelog generator requires `GITHUB_TOKEN` for `bun run version`; never commit the token. On Windows, if `bun run release` stalls while npm repeats `prepublishOnly`, first confirm `bun run verify` succeeds, then publish from PowerShell with `$env:npm_config_ignore_scripts='true'; bun run release`. This skips only the repeated lifecycle check, not the prerequisite verification.
|
|
605
|
+
|
|
573
606
|
## 📄 License
|
|
574
607
|
|
|
575
608
|
MIT License
|
|
@@ -583,3 +616,7 @@ MIT License
|
|
|
583
616
|
- [Robot Admin Live Demo](https://www.robotadmin.cn)
|
|
584
617
|
- [GitHub](https://github.com/ChenyCHENYU/naive-ui-components)
|
|
585
618
|
- [NPM](https://www.npmjs.com/package/@robot-admin/naive-ui-components)
|
|
619
|
+
|
|
620
|
+
### C_Login form extension
|
|
621
|
+
|
|
622
|
+
The `password-fields` slot appears below the password field and exposes `username` and `loading`. The synchronous `username-change` event covers initial defaults, remembered usernames and input changes. Use `submitDisabled` to block clicks and Enter while application fields are incomplete. Credential inputs are disabled while `loading`. Workspace discovery and authorization remain in the host application.
|
package/dist/C_Guide.css
CHANGED
|
@@ -58,3 +58,126 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.driver-popover{all:unset;font-family:var(--driver-popover-font-family,"Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif);box-sizing:border-box;color:#2d2d2d;z-index:1000000000;background-color:#fff;border-radius:5px;min-width:250px;max-width:300px;margin:0;padding:15px;position:fixed;top:0;right:0;box-shadow:0 1px 10px #0006}.driver-popover-title{zoom:1;margin:0;font-size:19px;font-weight:700;line-height:1.5;display:block;position:relative}.driver-popover-close-btn{all:unset;cursor:pointer;color:#d2d2d2;z-index:1;text-align:center;width:32px;height:28px;font-size:18px;font-weight:500;transition:color .2s;position:absolute;top:0;right:0}.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{zoom:1;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.5}.driver-popover-footer{text-align:right;zoom:1;justify-content:space-between;align-items:center;margin-top:15px;display:flex}.driver-popover-progress-text{color:#727272;zoom:1;font-size:13px;font-weight:400}.driver-popover-footer-btn{all:unset;box-sizing:border-box;color:#2d2d2d;cursor:pointer;zoom:1;background-color:#fff;border:1px solid #ccc;border-radius:3px;outline:0;padding:3px 7px;font-size:12px;line-height:1.3;text-decoration:none;display:inline-block}.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}.driver-popover-footer-btn:hover,.driver-popover-footer-btn:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{flex-grow:1;justify-content:flex-end;display:flex}.driver-popover-navigation-btns button+button{margin-left:4px}.driver-popover-arrow{content:"";border:5px solid #fff;position:absolute}.driver-popover-arrow-side-over{display:none}.driver-popover-arrow-side-left{border-top-color:#0000;border-bottom-color:#0000;border-right-color:#0000;left:100%}.driver-popover-arrow-side-right{border-top-color:#0000;border-bottom-color:#0000;border-left-color:#0000;right:100%}.driver-popover-arrow-side-top{border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;top:100%}.driver-popover-arrow-side-bottom{border-top-color:#0000;border-left-color:#0000;border-right-color:#0000;bottom:100%}.driver-popover-arrow-side-center,.driver-popover-arrow-none{display:none}.driver-active .driver-overlay{pointer-events:none}.driver-active.driver-no-scroll{overflow:hidden}.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in var(--driver-animation-duration,.4s) ease-in-out}.driver-fade .driver-popover{animation:animate-fade-in var(--driver-animation-duration,.4s)}.driver-active-element-parent-no-scroll{overflow:hidden!important}.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}
|
|
61
|
+
|
|
62
|
+
/* unplugin-vue-components disabled *//*
|
|
63
|
+
* @Author: ChenYu ycyplus@gmail.com
|
|
64
|
+
* @Date: 2026-10-04
|
|
65
|
+
* @Description: 引导入口键盘焦点样式,不依赖宿主样式
|
|
66
|
+
* Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
|
|
67
|
+
*/
|
|
68
|
+
[data-v-1dcaf6fa] .n-button:focus-visible {
|
|
69
|
+
outline: 2px solid var(--c-primary, #2080f0);
|
|
70
|
+
outline-offset: 4px;
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
}
|
|
73
|
+
/* unplugin-vue-components disabled *//*
|
|
74
|
+
* @Author: ChenYu ycyplus@gmail.com
|
|
75
|
+
* @Date: 2026-10-04
|
|
76
|
+
* @FilePath: \naive-ui-components\src\components\C_Guide\popover.scss
|
|
77
|
+
* @Description: 组件库通用引导主题,弹层由 Driver.js 挂载到 body
|
|
78
|
+
* Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
|
|
79
|
+
*/
|
|
80
|
+
.driver-popover.c-guide-popover {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
width: 328px;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
max-width: calc(100vw - 24px);
|
|
85
|
+
padding: 20px;
|
|
86
|
+
color: var(--c-guide-text, var(--c-text-1, #262626));
|
|
87
|
+
background: var(--c-guide-bg, var(--c-bg-surface, #fff));
|
|
88
|
+
border: 1px solid var(--c-guide-border, var(--c-border, #e5e7eb));
|
|
89
|
+
border-radius: var(--c-guide-radius, 14px);
|
|
90
|
+
box-shadow: var(--c-shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.2));
|
|
91
|
+
font-family: inherit;
|
|
92
|
+
}
|
|
93
|
+
.driver-popover.c-guide-popover .driver-popover-title {
|
|
94
|
+
padding-right: 20px;
|
|
95
|
+
color: var(--c-guide-text, var(--c-text-1, #262626));
|
|
96
|
+
font-size: 18px;
|
|
97
|
+
font-weight: 650;
|
|
98
|
+
line-height: 1.5;
|
|
99
|
+
}
|
|
100
|
+
.driver-popover.c-guide-popover .driver-popover-description {
|
|
101
|
+
color: var(--c-guide-text-secondary, var(--c-text-2, #525252));
|
|
102
|
+
font-size: 13px;
|
|
103
|
+
line-height: 1.7;
|
|
104
|
+
}
|
|
105
|
+
.driver-popover.c-guide-popover .c-guide-figure {
|
|
106
|
+
padding: 4px 0;
|
|
107
|
+
color: var(--c-guide-primary, var(--c-primary, #2080f0));
|
|
108
|
+
background: color-mix(in srgb, var(--c-guide-primary, var(--c-primary, #2080f0)) 8%, var(--c-guide-bg, var(--c-bg-surface, #fff)));
|
|
109
|
+
border-radius: 9px;
|
|
110
|
+
}
|
|
111
|
+
.driver-popover.c-guide-popover .c-guide-figure svg {
|
|
112
|
+
display: block;
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 96px;
|
|
115
|
+
}
|
|
116
|
+
.driver-popover.c-guide-popover .c-guide-copy {
|
|
117
|
+
margin: 14px 0 0;
|
|
118
|
+
}
|
|
119
|
+
.driver-popover.c-guide-popover .driver-popover-footer {
|
|
120
|
+
margin-top: 18px;
|
|
121
|
+
padding: 0;
|
|
122
|
+
gap: 8px;
|
|
123
|
+
}
|
|
124
|
+
.driver-popover.c-guide-popover .driver-popover-footer .c-guide-skip-btn {
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
padding: 5px 0;
|
|
127
|
+
color: var(--c-guide-text-muted, #767676);
|
|
128
|
+
background: transparent;
|
|
129
|
+
border: none;
|
|
130
|
+
}
|
|
131
|
+
.driver-popover.c-guide-popover .driver-popover-footer .c-guide-skip-btn:hover {
|
|
132
|
+
color: var(--c-guide-primary, #2080f0);
|
|
133
|
+
background: transparent;
|
|
134
|
+
}
|
|
135
|
+
.driver-popover.c-guide-popover .driver-popover-footer button {
|
|
136
|
+
min-height: 32px;
|
|
137
|
+
padding: 5px 12px;
|
|
138
|
+
color: var(--c-guide-text, var(--c-text-1, #262626));
|
|
139
|
+
background: var(--c-guide-bg, var(--c-bg-surface, #fff));
|
|
140
|
+
border: 1px solid var(--c-guide-border, var(--c-border, #e5e7eb));
|
|
141
|
+
border-radius: 7px;
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
text-shadow: none;
|
|
144
|
+
}
|
|
145
|
+
.driver-popover.c-guide-popover .driver-popover-footer button:disabled {
|
|
146
|
+
opacity: 0.5;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
}
|
|
149
|
+
.driver-popover.c-guide-popover .driver-popover-footer button:hover {
|
|
150
|
+
background: color-mix(in srgb, var(--c-guide-primary, #2080f0) 8%, var(--c-guide-bg, #fff));
|
|
151
|
+
}
|
|
152
|
+
.driver-popover.c-guide-popover .driver-popover-footer button:focus-visible {
|
|
153
|
+
outline: 2px solid var(--c-guide-primary, var(--c-primary, #2080f0));
|
|
154
|
+
outline-offset: 2px;
|
|
155
|
+
}
|
|
156
|
+
.driver-popover.c-guide-popover .driver-popover-footer .driver-popover-next-btn {
|
|
157
|
+
color: #fff;
|
|
158
|
+
background: var(--c-guide-primary, var(--c-primary, #2080f0));
|
|
159
|
+
border-color: var(--c-guide-primary, var(--c-primary, #2080f0));
|
|
160
|
+
}
|
|
161
|
+
.driver-popover.c-guide-popover .driver-popover-footer .driver-popover-next-btn:hover {
|
|
162
|
+
background: var(--c-guide-primary-hover, #4098fc);
|
|
163
|
+
}
|
|
164
|
+
.driver-popover.c-guide-popover .driver-popover-close-btn {
|
|
165
|
+
top: 14px;
|
|
166
|
+
right: 12px;
|
|
167
|
+
color: var(--c-guide-text-muted, var(--c-text-3, #a3a3a3));
|
|
168
|
+
}
|
|
169
|
+
.driver-popover.c-guide-popover .driver-popover-close-btn:hover, .driver-popover.c-guide-popover .driver-popover-close-btn:focus {
|
|
170
|
+
color: var(--c-guide-text, var(--c-text-1, #262626));
|
|
171
|
+
}
|
|
172
|
+
.driver-popover.c-guide-popover .driver-popover-arrow-side-left {
|
|
173
|
+
border-left-color: var(--c-guide-bg, var(--c-bg-surface, #fff));
|
|
174
|
+
}
|
|
175
|
+
.driver-popover.c-guide-popover .driver-popover-arrow-side-right {
|
|
176
|
+
border-right-color: var(--c-guide-bg, var(--c-bg-surface, #fff));
|
|
177
|
+
}
|
|
178
|
+
.driver-popover.c-guide-popover .driver-popover-arrow-side-top {
|
|
179
|
+
border-top-color: var(--c-guide-bg, var(--c-bg-surface, #fff));
|
|
180
|
+
}
|
|
181
|
+
.driver-popover.c-guide-popover .driver-popover-arrow-side-bottom {
|
|
182
|
+
border-bottom-color: var(--c-guide-bg, var(--c-bg-surface, #fff));
|
|
183
|
+
}
|
package/dist/C_Guide.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as GuideTheme, i as
|
|
2
|
-
export { _default as C_Guide, type GuidePersistence, type GuideProps, type GuideStep, type GuideTheme };
|
|
1
|
+
import { a as GuideProps, c as GuideTheme, i as GuidePersistence, n as GuideExpose, o as GuideStep, r as GuideIllustration, s as GuideTarget, t as _default } from "./index14.vue.cjs";
|
|
2
|
+
export { _default as C_Guide, type GuideExpose, type GuideIllustration, type GuidePersistence, type GuideProps, type GuideStep, type GuideTarget, type GuideTheme };
|
package/dist/C_Guide.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as GuideTheme, i as
|
|
2
|
-
export { _default as C_Guide, type GuidePersistence, type GuideProps, type GuideStep, type GuideTheme };
|
|
1
|
+
import { a as GuideProps, c as GuideTheme, i as GuidePersistence, n as GuideExpose, o as GuideStep, r as GuideIllustration, s as GuideTarget, t as _default } from "./index13.vue.js";
|
|
2
|
+
export { _default as C_Guide, type GuideExpose, type GuideIllustration, type GuidePersistence, type GuideProps, type GuideStep, type GuideTarget, type GuideTheme };
|
package/dist/C_Guide2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`);let
|
|
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={navigation:`<rect x="34" y="12" width="56" height="72" rx="6" fill="currentColor" opacity=".12"/><path d="M46 30h30M46 48h30M46 66h20"/><rect x="108" y="12" width="118" height="72" rx="6" fill="currentColor" opacity=".07"/><path d="M122 32h64M122 48h90M122 64h74"/>`,search:`<rect x="28" y="26" width="204" height="44" rx="10" fill="currentColor" opacity=".09"/><circle cx="56" cy="46" r="8"/><path d="m62 52 6 6M86 44h104M86 55h70"/>`,tabs:`<rect x="28" y="24" width="204" height="56" rx="6" fill="currentColor" opacity=".07"/><rect x="40" y="16" width="58" height="26" rx="6" fill="currentColor" opacity=".2"/><path d="M50 29h25m10-3 6 6m0-6-6 6M112 29h38M166 29h38M44 56h100M44 67h144"/>`,account:`<circle cx="60" cy="48" r="22" fill="currentColor" opacity=".12"/><circle cx="60" cy="41" r="6"/><path d="M49 60c0-13 22-13 22 0M94 40h40m-8-6 8 6-8 6M94 58h40m-32-6-8 6 8 6"/><rect x="154" y="20" width="62" height="56" rx="6" fill="currentColor" opacity=".09"/><path d="M168 36h34M168 48h34M168 60h22"/>`,overview:`<rect x="28" y="14" width="204" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M42 30h76M42 42h52"/><rect x="42" y="54" width="48" height="16" rx="4"/><rect x="106" y="54" width="48" height="16" rx="4"/><rect x="170" y="54" width="48" height="16" rx="4"/>`,notification:`<circle cx="130" cy="48" r="36" fill="currentColor" opacity=".07"/><path d="M109 63h42l-6-10V40a15 15 0 0 0-30 0v13l-6 10ZM124 71h12"/><circle cx="150" cy="26" r="8" fill="currentColor" opacity=".3"/>`,fullscreen:`<rect x="50" y="14" width="160" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M66 40V28h20M174 28h20v12M66 56v12h20M174 68h20V56"/><rect x="106" y="34" width="48" height="28" rx="4"/>`,language:`<rect x="54" y="18" width="72" height="54" rx="8" fill="currentColor" opacity=".1"/><rect x="134" y="24" width="72" height="54" rx="8" fill="currentColor" opacity=".07"/><path d="M70 34h40M90 27v7M79 34c2 15 9 22 27 28M101 34c-3 15-13 24-28 29M151 64l16-27 16 27M158 53h18"/>`,theme:`<circle cx="78" cy="48" r="15" fill="currentColor" opacity=".12"/><path d="M78 24v-6M78 78v-6M54 48h-6M108 48h-6M61 31l-5-5M100 70l-5-5M61 65l-5 5M100 26l-5 5M168 22a26 26 0 1 0 28 42 26 26 0 0 1-28-42Z"/>`,settings:`<rect x="44" y="14" width="172" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M62 31h136M62 48h136M62 65h136"/><circle cx="94" cy="31" r="5" fill="currentColor"/><circle cx="168" cy="48" r="5" fill="currentColor"/><circle cx="124" cy="65" r="5" fill="currentColor"/>`};function a(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function o(e){if(!(!e||typeof document>`u`))return(typeof e==`string`?Array.from(document.querySelectorAll(e)):[typeof e==`function`?e():e]).find(e=>{if(!e?.isConnected)return!1;let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView?.getComputedStyle(e);return a(t)&&n?.visibility!==`hidden`})}function s(e){let{illustration:t}=e.popover,n=t&&i[t];return n?`<div class="c-guide-figure"><svg viewBox="0 0 260 96" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">${n}</svg></div><div class="c-guide-copy">${e.popover.description}</div>`:e.popover.description}const c=(0,n.defineComponent)({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},doneBtnText:{default:`完成`},nextBtnText:{default:`下一步`},prevBtnText:{default:`上一步`},showSkipButton:{type:Boolean,default:!0},skipBtnText:{default:`跳过引导`},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},skipMissingElements:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{default:`功能引导`},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`skip`,`step-change`,`error`],setup(t,{expose:i,emit:a}){let c=t,l=a,u=(0,r.useThemeVars)(),d=(0,n.ref)(!1),f=(0,n.computed)(()=>`${c.persistence?.keyPrefix??`c_guide`}_completed`),p=null,m,h=0,g=()=>{if(!c.persistence?.enabled)return!1;try{return localStorage.getItem(f.value)===`true`}catch{return!1}},_=()=>{if(c.persistence?.enabled)try{localStorage.setItem(f.value,`true`)}catch{}},v=()=>{try{localStorage.removeItem(f.value)}catch{}},y=()=>{h++,d.value=!1;let e=m;m=void 0,e?.()},b=e=>{let t=c.theme??{},n={"--c-guide-bg":t.popoverBgColor??u.value.popoverColor,"--c-guide-text":t.popoverTextColor??u.value.textColor1,"--c-guide-text-secondary":t.popoverTextColor??u.value.textColor2,"--c-guide-text-muted":u.value.textColor3,"--c-guide-primary":t.primaryColor??u.value.primaryColor,"--c-guide-primary-hover":t.primaryColor??u.value.primaryColorHover,"--c-guide-border":u.value.borderColor,"--c-guide-radius":t.borderRadius??`14px`};for(let[t,r]of Object.entries(n))e.wrapper.style.setProperty(t,r)},x=()=>c.theme?.overlayOpacity===void 0?{}:{overlayOpacity:c.theme.overlayOpacity},S=e=>d.value||!e&&g(),C=async(e=!1)=>{if(S(e))return;y();let t=h;d.value=!0;try{let{driver:e}=await import(`driver.js`);if(t!==h)return;let n=c.steps.filter(e=>!e.skipIf?.()&&(!c.skipMissingElements||!e.element||o(e.element)));if(!n.length)return;let r=`close`,i=0,a=!1,u=!1,d=e=>{e.nextButton.disabled=u,e.previousButton.disabled=u},f=()=>{a||(a=!0,p===S&&(p=null,m=void 0),r===`complete`?(_(),l(`complete`)):r!==`dispose`&&(r===`skip`&&l(`skip`,i),l(`close`,i)))},g=()=>{S.destroy(),f()},v=()=>{u||(S.isLastStep()?(r=`complete`,g()):S.moveNext())},y=x(),S=e({popoverClass:`c-guide-popover ${c.popoverClass}`.trim(),animate:c.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,showProgress:c.showProgress,progressText:`{{current}} / {{total}}`,allowClose:c.allowClose,allowKeyboardControl:c.keyboard,skipMissingElement:c.skipMissingElements,...y,doneBtnText:c.doneBtnText,nextBtnText:c.nextBtnText,prevBtnText:c.prevBtnText,steps:n.map(e=>({element:e.element?()=>o(e.element):void 0,popover:{...e.popover,description:s(e)},onHighlightStarted:(t,n,{state:r})=>{u=!0,i=r.activeIndex??i,e.onHighlightStarted?.(t,e),l(`step-change`,i,e)},onHighlighted:()=>{u=!1;let{popover:e}=S.getState();e&&d(e)},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(b(e),d(e),c.showSkipButton&&c.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=c.skipBtnText,t.addEventListener(`click`,()=>{r=`skip`,g()}),e.footer.prepend(t)}},onNextClick:v,onPrevClick:()=>{u||S.movePrevious()},onDestroyStarted:g,onDestroyed:f});p=S,m=()=>{r=`dispose`,g()},l(`start`),t===h&&S.drive()}catch(e){t===h&&(y(),l(`error`,e))}finally{t===h&&(d.value=!1)}};return(0,n.onBeforeUnmount)(y),(0,n.watch)(()=>c.steps,y),(0,n.watch)([u,()=>c.theme],()=>{let e=p?.getState().popover;e&&b(e)},{deep:!0}),i({startGuide:C,stopGuide:y,resetCompleted:v,isCompleted:g}),(t,i)=>c.showTrigger?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NTooltip),{key:0,placement:`bottom`,trigger:`hover`},{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{text:``,loading:d.value,"aria-label":c.triggerTooltip,onClick:i[0]||=e=>C(!0)},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:c.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`loading`,`aria-label`])]),default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`span`,null,(0,n.toDisplayString)(c.triggerTooltip),1)]),_:1})):(0,n.createCommentVNode)(`v-if`,!0)}});var l=t.t(c,[[`__scopeId`,`data-v-1dcaf6fa`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
package/dist/C_Guide2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{computed as
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{computed as n,createBlock as r,createCommentVNode as i,createElementVNode as a,createVNode as o,defineComponent as s,onBeforeUnmount as c,openBlock as l,ref as u,toDisplayString as d,unref as f,watch as p,withCtx as m}from"vue";import{NButton as h,NTooltip as g,useThemeVars as _}from"naive-ui";const v={navigation:`<rect x="34" y="12" width="56" height="72" rx="6" fill="currentColor" opacity=".12"/><path d="M46 30h30M46 48h30M46 66h20"/><rect x="108" y="12" width="118" height="72" rx="6" fill="currentColor" opacity=".07"/><path d="M122 32h64M122 48h90M122 64h74"/>`,search:`<rect x="28" y="26" width="204" height="44" rx="10" fill="currentColor" opacity=".09"/><circle cx="56" cy="46" r="8"/><path d="m62 52 6 6M86 44h104M86 55h70"/>`,tabs:`<rect x="28" y="24" width="204" height="56" rx="6" fill="currentColor" opacity=".07"/><rect x="40" y="16" width="58" height="26" rx="6" fill="currentColor" opacity=".2"/><path d="M50 29h25m10-3 6 6m0-6-6 6M112 29h38M166 29h38M44 56h100M44 67h144"/>`,account:`<circle cx="60" cy="48" r="22" fill="currentColor" opacity=".12"/><circle cx="60" cy="41" r="6"/><path d="M49 60c0-13 22-13 22 0M94 40h40m-8-6 8 6-8 6M94 58h40m-32-6-8 6 8 6"/><rect x="154" y="20" width="62" height="56" rx="6" fill="currentColor" opacity=".09"/><path d="M168 36h34M168 48h34M168 60h22"/>`,overview:`<rect x="28" y="14" width="204" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M42 30h76M42 42h52"/><rect x="42" y="54" width="48" height="16" rx="4"/><rect x="106" y="54" width="48" height="16" rx="4"/><rect x="170" y="54" width="48" height="16" rx="4"/>`,notification:`<circle cx="130" cy="48" r="36" fill="currentColor" opacity=".07"/><path d="M109 63h42l-6-10V40a15 15 0 0 0-30 0v13l-6 10ZM124 71h12"/><circle cx="150" cy="26" r="8" fill="currentColor" opacity=".3"/>`,fullscreen:`<rect x="50" y="14" width="160" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M66 40V28h20M174 28h20v12M66 56v12h20M174 68h20V56"/><rect x="106" y="34" width="48" height="28" rx="4"/>`,language:`<rect x="54" y="18" width="72" height="54" rx="8" fill="currentColor" opacity=".1"/><rect x="134" y="24" width="72" height="54" rx="8" fill="currentColor" opacity=".07"/><path d="M70 34h40M90 27v7M79 34c2 15 9 22 27 28M101 34c-3 15-13 24-28 29M151 64l16-27 16 27M158 53h18"/>`,theme:`<circle cx="78" cy="48" r="15" fill="currentColor" opacity=".12"/><path d="M78 24v-6M78 78v-6M54 48h-6M108 48h-6M61 31l-5-5M100 70l-5-5M61 65l-5 5M100 26l-5 5M168 22a26 26 0 1 0 28 42 26 26 0 0 1-28-42Z"/>`,settings:`<rect x="44" y="14" width="172" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M62 31h136M62 48h136M62 65h136"/><circle cx="94" cy="31" r="5" fill="currentColor"/><circle cx="168" cy="48" r="5" fill="currentColor"/><circle cx="124" cy="65" r="5" fill="currentColor"/>`};function y(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function b(e){if(!(!e||typeof document>`u`))return(typeof e==`string`?Array.from(document.querySelectorAll(e)):[typeof e==`function`?e():e]).find(e=>{if(!e?.isConnected)return!1;let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView?.getComputedStyle(e);return y(t)&&n?.visibility!==`hidden`})}function x(e){let{illustration:t}=e.popover,n=t&&v[t];return n?`<div class="c-guide-figure"><svg viewBox="0 0 260 96" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">${n}</svg></div><div class="c-guide-copy">${e.popover.description}</div>`:e.popover.description}var S=t(s({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},doneBtnText:{default:`完成`},nextBtnText:{default:`下一步`},prevBtnText:{default:`上一步`},showSkipButton:{type:Boolean,default:!0},skipBtnText:{default:`跳过引导`},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},skipMissingElements:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{default:`功能引导`},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`skip`,`step-change`,`error`],setup(t,{expose:s,emit:v}){let y=t,S=v,C=_(),w=u(!1),T=n(()=>`${y.persistence?.keyPrefix??`c_guide`}_completed`),E=null,D,O=0,k=()=>{if(!y.persistence?.enabled)return!1;try{return localStorage.getItem(T.value)===`true`}catch{return!1}},A=()=>{if(y.persistence?.enabled)try{localStorage.setItem(T.value,`true`)}catch{}},j=()=>{try{localStorage.removeItem(T.value)}catch{}},M=()=>{O++,w.value=!1;let e=D;D=void 0,e?.()},N=e=>{let t=y.theme??{},n={"--c-guide-bg":t.popoverBgColor??C.value.popoverColor,"--c-guide-text":t.popoverTextColor??C.value.textColor1,"--c-guide-text-secondary":t.popoverTextColor??C.value.textColor2,"--c-guide-text-muted":C.value.textColor3,"--c-guide-primary":t.primaryColor??C.value.primaryColor,"--c-guide-primary-hover":t.primaryColor??C.value.primaryColorHover,"--c-guide-border":C.value.borderColor,"--c-guide-radius":t.borderRadius??`14px`};for(let[t,r]of Object.entries(n))e.wrapper.style.setProperty(t,r)},P=()=>y.theme?.overlayOpacity===void 0?{}:{overlayOpacity:y.theme.overlayOpacity},F=e=>w.value||!e&&k(),I=async(e=!1)=>{if(F(e))return;M();let t=O;w.value=!0;try{let{driver:e}=await import(`driver.js`);if(t!==O)return;let n=y.steps.filter(e=>!e.skipIf?.()&&(!y.skipMissingElements||!e.element||b(e.element)));if(!n.length)return;let r=`close`,i=0,a=!1,o=!1,s=e=>{e.nextButton.disabled=o,e.previousButton.disabled=o},c=()=>{a||(a=!0,E===f&&(E=null,D=void 0),r===`complete`?(A(),S(`complete`)):r!==`dispose`&&(r===`skip`&&S(`skip`,i),S(`close`,i)))},l=()=>{f.destroy(),c()},u=()=>{o||(f.isLastStep()?(r=`complete`,l()):f.moveNext())},d=P(),f=e({popoverClass:`c-guide-popover ${y.popoverClass}`.trim(),animate:y.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,showProgress:y.showProgress,progressText:`{{current}} / {{total}}`,allowClose:y.allowClose,allowKeyboardControl:y.keyboard,skipMissingElement:y.skipMissingElements,...d,doneBtnText:y.doneBtnText,nextBtnText:y.nextBtnText,prevBtnText:y.prevBtnText,steps:n.map(e=>({element:e.element?()=>b(e.element):void 0,popover:{...e.popover,description:x(e)},onHighlightStarted:(t,n,{state:r})=>{o=!0,i=r.activeIndex??i,e.onHighlightStarted?.(t,e),S(`step-change`,i,e)},onHighlighted:()=>{o=!1;let{popover:e}=f.getState();e&&s(e)},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(N(e),s(e),y.showSkipButton&&y.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=y.skipBtnText,t.addEventListener(`click`,()=>{r=`skip`,l()}),e.footer.prepend(t)}},onNextClick:u,onPrevClick:()=>{o||f.movePrevious()},onDestroyStarted:l,onDestroyed:c});E=f,D=()=>{r=`dispose`,l()},S(`start`),t===O&&f.drive()}catch(e){t===O&&(M(),S(`error`,e))}finally{t===O&&(w.value=!1)}};return c(M),p(()=>y.steps,M),p([C,()=>y.theme],()=>{let e=E?.getState().popover;e&&N(e)},{deep:!0}),s({startGuide:I,stopGuide:M,resetCompleted:j,isCompleted:k}),(t,n)=>y.showTrigger?(l(),r(f(g),{key:0,placement:`bottom`,trigger:`hover`},{trigger:m(()=>[o(f(h),{text:``,loading:w.value,"aria-label":y.triggerTooltip,onClick:n[0]||=e=>I(!0)},{default:m(()=>[o(e,{name:y.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`loading`,`aria-label`])]),default:m(()=>[a(`span`,null,d(y.triggerTooltip),1)]),_:1})):i(`v-if`,!0)}}),[[`__scopeId`,`data-v-1dcaf6fa`]]);export{S as t};
|