@robot-admin/naive-ui-components 0.37.1 → 0.38.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 +20 -0
- package/README.md +24 -3
- package/README_EN.md +23 -2
- package/dist/C_AntV.css +30 -30
- package/dist/C_AudioPlayer.css +4 -4
- package/dist/C_Captcha.css +31 -19
- package/dist/C_Captcha.d.ts +1 -1
- package/dist/C_DataPicker.d.ts +0 -1
- package/dist/C_Density2.cjs +1 -1
- package/dist/C_Density2.js +1 -1
- package/dist/C_FilePreview.css +1 -1
- package/dist/C_Form.base.css +61 -58
- package/dist/C_Form.css +61 -58
- package/dist/C_Form.d.cts +1 -1
- package/dist/C_Form.d.ts +2 -1
- package/dist/C_FormModal.d.ts +2 -1
- package/dist/C_FormSearch.d.ts +2 -2
- package/dist/C_GlobalSearch.css +12 -12
- package/dist/C_Guide.css +6 -6
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Login.css +139 -112
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_NotificationCenter.css +91 -91
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_Table.base.css +231 -212
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +170 -154
- package/dist/C_Table.d.cts +2 -1
- package/dist/C_Table.d.ts +2 -3
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +4 -4
- package/dist/C_Table2.js +4 -4
- package/dist/C_Timeline.css +2 -2
- package/dist/C_Tree.d.cts +1 -0
- package/dist/C_Tree.d.ts +0 -1
- package/dist/C_UserPicker.d.ts +0 -1
- package/dist/C_VideoPlayer.css +26 -26
- package/dist/C_VideoPlayer2.cjs +1 -1
- package/dist/C_VideoPlayer2.js +1 -1
- package/dist/C_VtableGantt.css +34 -32
- package/dist/C_WorkFlow.css +35 -35
- package/dist/C_WorkFlow.d.ts +0 -1
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.js +1 -1
- package/dist/UML.cjs +1 -1
- package/dist/UML.js +1 -1
- package/dist/component-config.d.ts +1723 -2
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.ts +4 -3
- package/dist/config.js +1 -1
- package/dist/constants3.d.cts +5 -5
- package/dist/constants3.d.ts +5 -5
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/context.cjs +1 -1
- package/dist/context.d.cts +1118 -3
- package/dist/context.js +1 -1
- package/dist/data2.d.cts +3 -3
- package/dist/data2.d.ts +3 -3
- package/dist/dateRange.d.ts +1 -1
- package/dist/editors.d.cts +9 -7
- package/dist/editors.d.ts +9 -7
- package/dist/graphics.cjs +1 -1
- package/dist/graphics.d.cts +0 -45
- package/dist/graphics.d.ts +0 -45
- package/dist/graphics.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.ts +5 -5
- package/dist/index11.vue.d.cts +5 -5
- package/dist/index11.vue.d.ts +4 -4
- package/dist/index12.vue.d.cts +4 -4
- package/dist/index13.vue.d.ts +2 -2
- package/dist/index14.vue.d.cts +2 -2
- package/dist/index15.vue.d.ts +1 -1
- package/dist/index16.vue.d.cts +1 -1
- package/dist/index16.vue.d.ts +3 -3
- package/dist/index17.vue.d.cts +3 -3
- package/dist/index17.vue.d.ts +6 -6
- package/dist/index18.vue.d.cts +6 -6
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index27.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +2 -2
- package/dist/index28.vue.d.cts +2 -2
- package/dist/index28.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +2 -2
- package/dist/index3.vue.d.ts +2 -2
- package/dist/index30.vue.d.cts +1 -1
- package/dist/index30.vue.d.ts +1 -1
- package/dist/index31.vue.d.cts +2 -2
- package/dist/index31.vue.d.ts +2 -2
- package/dist/index32.vue.d.cts +2 -2
- package/dist/index32.vue.d.ts +2 -2
- package/dist/index4.vue.d.cts +2 -2
- package/dist/index4.vue.d.ts +2 -2
- package/dist/index8.vue.d.ts +2 -2
- package/dist/index9.vue.d.cts +2 -2
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/style.css +612 -564
- package/dist/theme.cjs +1 -1
- package/dist/theme.d.cts +27 -8
- package/dist/theme.d.ts +27 -8
- package/dist/theme.js +1 -1
- package/dist/theme2.cjs +1 -1
- package/dist/theme2.js +1 -1
- package/dist/types3.d.ts +5 -1119
- package/dist/types4.d.cts +5 -1119
- package/dist/types6.d.ts +2 -1
- package/dist/types7.d.cts +2 -1
- package/dist/useCalendarEvents.d.cts +2 -2
- package/dist/useCalendarEvents.d.ts +2 -2
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useComponentTheme.cjs +1 -1
- package/dist/useComponentTheme.js +1 -1
- package/dist/useCropperCore.d.cts +8 -8
- package/dist/useCropperCore.d.ts +8 -8
- package/dist/useDynamicFormState.d.cts +1 -1
- package/dist/useDynamicFormState.d.ts +1 -1
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFormRenderer.d.cts +1 -1
- package/dist/useFormRenderer.d.ts +1 -1
- package/dist/useGlobalSearch.d.cts +1 -1
- package/dist/useGlobalSearch.d.ts +1 -1
- package/dist/useInfiniteScroll.d.cts +4 -4
- package/dist/useInfiniteScroll.d.ts +4 -4
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +3 -3
- package/dist/useSignatureHistory.d.ts +3 -3
- package/dist/useSplitResize.d.cts +3 -3
- package/dist/useSplitResize.d.ts +3 -3
- package/dist/verification.d.cts +7 -7
- package/dist/verification.d.ts +7 -7
- package/docs/guides/table-density.md +19 -2
- package/docs/guides/theme.md +44 -2
- package/package.json +2 -1
- package/dist/context.d.ts +0 -610
- package/dist/useTableGlobalConfig.cjs +0 -1
- package/dist/useTableGlobalConfig.js +0 -1
package/dist/C_Guide.css
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
* @Description: 引导入口键盘焦点样式,不依赖宿主样式
|
|
86
86
|
* Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
|
|
87
87
|
*/
|
|
88
|
-
.c-guide-trigger[data-v-
|
|
88
|
+
.c-guide-trigger[data-v-fc3951c3]:focus-visible {
|
|
89
89
|
outline: 2px solid var(--c-primary, var(--c-theme-primary, #2080f0));
|
|
90
90
|
outline-offset: 4px;
|
|
91
91
|
border-radius: 4px;
|
|
@@ -174,12 +174,12 @@
|
|
|
174
174
|
outline-offset: 2px;
|
|
175
175
|
}
|
|
176
176
|
.driver-popover.c-guide-popover .driver-popover-footer .driver-popover-next-btn {
|
|
177
|
-
color:
|
|
178
|
-
background: var(--c-guide-primary, var(--c-primary, var(--c-theme-primary,
|
|
177
|
+
color: var(--c-guide-text, var(--c-text-1, var(--c-theme-text-1)));
|
|
178
|
+
background: color-mix(in srgb, var(--c-guide-primary, var(--c-primary, var(--c-theme-primary))) 14%, var(--c-guide-bg, var(--c-bg-surface, var(--c-theme-bg-surface))));
|
|
179
179
|
border-color: var(--c-guide-primary, var(--c-primary, var(--c-theme-primary, #2080f0)));
|
|
180
180
|
}
|
|
181
181
|
.driver-popover.c-guide-popover .driver-popover-footer .driver-popover-next-btn:hover {
|
|
182
|
-
background: var(--c-guide-primary-hover,
|
|
182
|
+
background: color-mix(in srgb, var(--c-guide-primary-hover, var(--c-primary-hover, var(--c-theme-primary-hover))) 20%, var(--c-guide-bg, var(--c-bg-surface, var(--c-theme-bg-surface))));
|
|
183
183
|
}
|
|
184
184
|
.driver-popover.c-guide-popover .driver-popover-close-btn {
|
|
185
185
|
top: 14px;
|
|
@@ -203,5 +203,5 @@
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
/* layer: default */
|
|
206
|
-
.m62[data-v-
|
|
207
|
-
.hidden[data-v-
|
|
206
|
+
.m62[data-v-fc3951c3]{margin:15.5rem;}
|
|
207
|
+
.hidden[data-v-fc3951c3]{display:none;}
|
package/dist/C_Guide2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`);let r=require(`vue`),i=require(`naive-ui`);const a={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 o(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function s(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 o(t)&&n?.visibility!==`hidden`})}function c(e){let{illustration:t}=e.popover,n=t&&a[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 l=(0,r.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:a,emit:o}){let l=e.n(),u=t,d=o,f=(0,
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`);let r=require(`vue`),i=require(`naive-ui`);const a={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 o(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function s(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 o(t)&&n?.visibility!==`hidden`})}function c(e){let{illustration:t}=e.popover,n=t&&a[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 l=(0,r.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:a,emit:o}){let l=e.n(),u=t,d=o,f=(0,r.ref)(!1),p=(0,r.computed)(()=>`${u.persistence?.keyPrefix??`c_guide`}_completed`),m=null,h,g=0,_=()=>{if(!u.persistence?.enabled)return!1;try{return localStorage.getItem(p.value)===`true`}catch{return!1}},v=()=>{if(u.persistence?.enabled)try{localStorage.setItem(p.value,`true`)}catch{}},y=()=>{try{localStorage.removeItem(p.value)}catch{}},b=()=>{g++,f.value=!1;let e=h;h=void 0,e?.()},x=()=>{let e=u.theme??{};return{"--c-guide-bg":e.popoverBgColor??`var(--c-bg-surface, var(--c-theme-bg-surface))`,"--c-guide-text":e.popoverTextColor??`var(--c-text-1, var(--c-theme-text-1))`,"--c-guide-text-secondary":e.popoverTextColor??`var(--c-text-2, var(--c-theme-text-2))`,"--c-guide-text-muted":`var(--c-text-3, var(--c-theme-text-3))`,"--c-guide-primary":e.primaryColor??`var(--c-primary, var(--c-theme-primary))`,"--c-guide-primary-hover":e.primaryColor??`var(--c-primary-hover, var(--c-theme-primary-hover))`,"--c-guide-border":`var(--c-border, var(--c-theme-border))`,"--c-guide-radius":e.borderRadius??`14px`}},S=[],C=e=>{for(let t of S)e.wrapper.style.removeProperty(t);let t=x();for(let[e,n]of Object.entries(l.value))n!=null&&(t[e]=String(n));S=Object.keys(t);for(let[n,r]of Object.entries(t))e.wrapper.style.setProperty(n,r)},w=()=>u.theme?.overlayOpacity===void 0?{}:{overlayOpacity:u.theme.overlayOpacity},T=e=>f.value||!e&&_(),E=async(e=!1)=>{if(T(e))return;b();let t=g;f.value=!0;try{let{driver:e}=await import(`driver.js`);if(t!==g)return;let n=u.steps.filter(e=>!e.skipIf?.()&&(!u.skipMissingElements||!e.element||s(e.element)));if(!n.length)return;let r=`close`,i=0,a=!1,o=!1,l=e=>{e.nextButton.disabled=o,e.previousButton.disabled=o},f=()=>{a||(a=!0,m===b&&(m=null,h=void 0),r===`complete`?(v(),d(`complete`)):r!==`dispose`&&(r===`skip`&&d(`skip`,i),d(`close`,i)))},p=()=>{b.destroy(),f()},_=()=>{o||(b.isLastStep()?(r=`complete`,p()):b.moveNext())},y=w(),b=e({popoverClass:`c-guide-popover ${u.popoverClass}`.trim(),animate:u.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,showProgress:u.showProgress,progressText:`{{current}} / {{total}}`,allowClose:u.allowClose,allowKeyboardControl:u.keyboard,skipMissingElement:u.skipMissingElements,...y,doneBtnText:u.doneBtnText,nextBtnText:u.nextBtnText,prevBtnText:u.prevBtnText,steps:n.map(e=>({element:e.element?()=>s(e.element):void 0,popover:{...e.popover,description:c(e)},onHighlightStarted:(t,n,{state:r})=>{o=!0,i=r.activeIndex??i,e.onHighlightStarted?.(t,e),d(`step-change`,i,e)},onHighlighted:()=>{o=!1;let{popover:e}=b.getState();e&&l(e)},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(C(e),l(e),u.showSkipButton&&u.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=u.skipBtnText,t.addEventListener(`click`,()=>{r=`skip`,p()}),e.footer.prepend(t)}},onNextClick:_,onPrevClick:()=>{o||b.movePrevious()},onDestroyStarted:p,onDestroyed:f});m=b,h=()=>{r=`dispose`,p()},d(`start`),t===g&&b.drive()}catch(e){t===g&&(b(),d(`error`,e))}finally{t===g&&(f.value=!1)}};return(0,r.onBeforeUnmount)(b),(0,r.watch)(()=>u.steps,b),(0,r.watch)([l,()=>u.theme],()=>{let e=m?.getState().popover;e&&C(e)},{deep:!0}),a({startGuide:E,stopGuide:b,resetCompleted:y,isCompleted:_}),(e,t)=>u.showTrigger?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.NTooltip),{key:0,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(i.NButton),{class:`c-guide-trigger`,style:(0,r.normalizeStyle)((0,r.unref)(l)),text:``,loading:f.value,"aria-label":u.triggerTooltip,onClick:t[0]||=e=>E(!0)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(n.t,{name:u.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`style`,`loading`,`aria-label`])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,null,(0,r.toDisplayString)(u.triggerTooltip),1)]),_:1})):(0,r.createCommentVNode)(`v-if`,!0)}});var u=t.t(l,[[`__scopeId`,`data-v-fc3951c3`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
package/dist/C_Guide2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{computed as r,createBlock as i,createCommentVNode as a,createElementVNode as o,createVNode as s,defineComponent as c,normalizeStyle as l,onBeforeUnmount as u,openBlock as d,ref as f,toDisplayString as p,unref as m,watch as h,withCtx as g}from"vue";import{NButton as _,NTooltip as v
|
|
1
|
+
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{computed as r,createBlock as i,createCommentVNode as a,createElementVNode as o,createVNode as s,defineComponent as c,normalizeStyle as l,onBeforeUnmount as u,openBlock as d,ref as f,toDisplayString as p,unref as m,watch as h,withCtx as g}from"vue";import{NButton as _,NTooltip as v}from"naive-ui";const y={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 b(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function x(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 b(t)&&n?.visibility!==`hidden`})}function S(e){let{illustration:t}=e.popover,n=t&&y[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 C=t(c({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:c,emit:y}){let b=e(),C=t,w=y,T=f(!1),E=r(()=>`${C.persistence?.keyPrefix??`c_guide`}_completed`),D=null,O,k=0,A=()=>{if(!C.persistence?.enabled)return!1;try{return localStorage.getItem(E.value)===`true`}catch{return!1}},j=()=>{if(C.persistence?.enabled)try{localStorage.setItem(E.value,`true`)}catch{}},M=()=>{try{localStorage.removeItem(E.value)}catch{}},N=()=>{k++,T.value=!1;let e=O;O=void 0,e?.()},P=()=>{let e=C.theme??{};return{"--c-guide-bg":e.popoverBgColor??`var(--c-bg-surface, var(--c-theme-bg-surface))`,"--c-guide-text":e.popoverTextColor??`var(--c-text-1, var(--c-theme-text-1))`,"--c-guide-text-secondary":e.popoverTextColor??`var(--c-text-2, var(--c-theme-text-2))`,"--c-guide-text-muted":`var(--c-text-3, var(--c-theme-text-3))`,"--c-guide-primary":e.primaryColor??`var(--c-primary, var(--c-theme-primary))`,"--c-guide-primary-hover":e.primaryColor??`var(--c-primary-hover, var(--c-theme-primary-hover))`,"--c-guide-border":`var(--c-border, var(--c-theme-border))`,"--c-guide-radius":e.borderRadius??`14px`}},F=[],I=e=>{for(let t of F)e.wrapper.style.removeProperty(t);let t=P();for(let[e,n]of Object.entries(b.value))n!=null&&(t[e]=String(n));F=Object.keys(t);for(let[n,r]of Object.entries(t))e.wrapper.style.setProperty(n,r)},L=()=>C.theme?.overlayOpacity===void 0?{}:{overlayOpacity:C.theme.overlayOpacity},R=e=>T.value||!e&&A(),z=async(e=!1)=>{if(R(e))return;N();let t=k;T.value=!0;try{let{driver:e}=await import(`driver.js`);if(t!==k)return;let n=C.steps.filter(e=>!e.skipIf?.()&&(!C.skipMissingElements||!e.element||x(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,D===f&&(D=null,O=void 0),r===`complete`?(j(),w(`complete`)):r!==`dispose`&&(r===`skip`&&w(`skip`,i),w(`close`,i)))},l=()=>{f.destroy(),c()},u=()=>{o||(f.isLastStep()?(r=`complete`,l()):f.moveNext())},d=L(),f=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,...d,doneBtnText:C.doneBtnText,nextBtnText:C.nextBtnText,prevBtnText:C.prevBtnText,steps:n.map(e=>({element:e.element?()=>x(e.element):void 0,popover:{...e.popover,description:S(e)},onHighlightStarted:(t,n,{state:r})=>{o=!0,i=r.activeIndex??i,e.onHighlightStarted?.(t,e),w(`step-change`,i,e)},onHighlighted:()=>{o=!1;let{popover:e}=f.getState();e&&s(e)},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(I(e),s(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`,l()}),e.footer.prepend(t)}},onNextClick:u,onPrevClick:()=>{o||f.movePrevious()},onDestroyStarted:l,onDestroyed:c});D=f,O=()=>{r=`dispose`,l()},w(`start`),t===k&&f.drive()}catch(e){t===k&&(N(),w(`error`,e))}finally{t===k&&(T.value=!1)}};return u(N),h(()=>C.steps,N),h([b,()=>C.theme],()=>{let e=D?.getState().popover;e&&I(e)},{deep:!0}),c({startGuide:z,stopGuide:N,resetCompleted:M,isCompleted:A}),(e,t)=>C.showTrigger?(d(),i(m(v),{key:0,placement:`bottom`,trigger:`hover`},{trigger:g(()=>[s(m(_),{class:`c-guide-trigger`,style:l(m(b)),text:``,loading:T.value,"aria-label":C.triggerTooltip,onClick:t[0]||=e=>z(!0)},{default:g(()=>[s(n,{name:C.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`style`,`loading`,`aria-label`])]),default:g(()=>[o(`span`,null,p(C.triggerTooltip),1)]),_:1})):a(`v-if`,!0)}}),[[`__scopeId`,`data-v-fc3951c3`]]);export{C as t};
|