@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/dist/C_AudioPlayer2.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={initialIndex:0,showPlaylist:!0,showCover:!0,autoplay:!1,mode:`list`,theme:`default`},
|
|
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={initialIndex:0,showPlaylist:!0,showCover:!0,autoplay:!1,mode:`list`,theme:`default`};function a(e,t){return!Number.isFinite(e)||t<=0?0:Math.min(Math.max(Math.trunc(e),0),t-1)}const o={list:{icon:`mdi:repeat`,label:`List Loop`},loop:{icon:`mdi:repeat-once`,label:`Single Loop`},single:{icon:`mdi:numeric-1-box`,label:`Play Once`},shuffle:{icon:`mdi:shuffle-variant`,label:`Shuffle`}};function s(e){if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}const c={class:`c-audio-player__now-playing`},l={key:0,class:`c-audio-player__cover`},u=[`src`,`alt`],d={class:`c-audio-player__info`},f={class:`c-audio-player__title`},p={key:0,class:`c-audio-player__artist`},ee={key:0,class:`c-audio-player__progress`},m=[`tabindex`,`aria-valuemax`,`aria-valuenow`],h={class:`c-audio-player__time`},g={class:`c-audio-player__controls`},_=[`title`],v=[`disabled`,`title`],y={key:1,class:`c-audio-player__volume`},b=[`aria-label`],x={key:2,class:`c-audio-player__playlist`},S={class:`c-audio-player__playlist-header`},C=[`onClick`],w={class:`c-audio-player__track-index`},T={class:`c-audio-player__track-info`},E={class:`c-audio-player__track-title`},D={key:0,class:`c-audio-player__track-artist`},te={key:0,class:`c-audio-player__track-duration`},O=(0,n.defineComponent)({__name:`index`,props:{tracks:{},initialIndex:{default:i.initialIndex},showPlaylist:{type:Boolean,default:i.showPlaylist},showCover:{type:Boolean,default:!0},autoplay:{type:Boolean,default:i.autoplay},mode:{default:i.mode},theme:{default:i.theme}},emits:[`play`,`pause`,`ended`,`modeChange`,`error`],setup(t,{emit:i}){let O=t,k=i,A=null,j=0,M=e=>Number.isInteger(e)&&!!O.tracks[e],N=(e,t)=>e===j&&t===A,P=(0,n.ref)(a(O.initialIndex??0,O.tracks.length)),F=(0,n.ref)(!1),I=(0,n.ref)(0),L=(0,n.ref)(0),R=(0,n.ref)(70),z=(0,n.ref)(70),B=(0,n.ref)(O.showPlaylist),V=(0,n.ref)(O.mode??`list`),H=(0,n.computed)(()=>O.tracks[P.value]),U=(0,n.computed)(()=>L.value<=0?0:Math.min(100,I.value/L.value*100)),ne=(0,n.computed)(()=>R.value===0?`mdi:volume-off`:R.value<40?`mdi:volume-low`:R.value<70?`mdi:volume-medium`:`mdi:volume-high`),W=(0,n.computed)(()=>o[V.value]?.icon??`mdi:repeat`),G=(0,n.computed)(()=>o[V.value]?.label??`循环`);function K(){j+=1,A&&(A.pause(),A.removeEventListener(`timeupdate`,q),A.removeEventListener(`loadedmetadata`,J),A.removeEventListener(`ended`,Y)),A=null,F.value=!1,I.value=0;let e=H.value;L.value=e?.duration??0,!(!e||typeof Audio>`u`)&&(A=new Audio(e.src),A.volume=R.value/100,A.addEventListener(`timeupdate`,q),A.addEventListener(`loadedmetadata`,J),A.addEventListener(`ended`,Y))}function q(){A&&(I.value=Number.isFinite(A.currentTime)?A.currentTime:0)}function J(){A&&(L.value=Number.isFinite(A.duration)?A.duration:0)}function Y(){switch(k(`ended`,P.value),V.value){case`loop`:A&&(A.currentTime=0),X(P.value,!1);break;case`single`:F.value=!1;break;case`shuffle`:O.tracks.length&&Q(Math.floor(Math.random()*O.tracks.length));break;default:if(!O.tracks.length){F.value=!1;break}Q(P.value<O.tracks.length-1?P.value+1:0)}}async function X(e,t){if(!M(e))return;(t||!A||P.value!==e)&&(P.value=e,K());let n=A;if(!n)return;let r=++j;try{if(await n.play(),!N(r,n))return;F.value=!0,k(`play`,e)}catch(e){if(!N(r,n))return;F.value=!1,k(`error`,e)}}function Z(){if(H.value){if(!F.value){X(P.value,!1);return}j+=1,A?.pause(),F.value=!1,k(`pause`)}}function Q(e){return X(e,!0)}function re(){O.tracks.length&&Q(P.value<=0?O.tracks.length-1:P.value-1)}function ie(){O.tracks.length&&Q(P.value>=O.tracks.length-1?0:P.value+1)}function ae(e){if(!A||!L.value)return;let t=e.currentTarget.getBoundingClientRect();if(t.width<=0)return;let n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));A.currentTime=n*L.value,I.value=A.currentTime}function oe(e){if(!A||L.value<=0)return;let t=e.key===`ArrowRight`?5:e.key===`ArrowLeft`?-5:0,n=e.key===`Home`?0:e.key===`End`?L.value:I.value+t;!t&&e.key!==`Home`&&e.key!==`End`||(e.preventDefault(),A.currentTime=Math.max(0,Math.min(L.value,n)),I.value=A.currentTime)}function se(e){R.value=e,A&&(A.volume=e/100)}function ce(){R.value>0?(z.value=R.value,R.value=0):R.value=z.value||70,A&&(A.volume=R.value/100)}let $=[`list`,`loop`,`single`,`shuffle`];function le(){V.value=$[($.indexOf(V.value)+1)%$.length],k(`modeChange`,V.value)}return(0,n.watch)(()=>O.tracks,()=>{let e=F.value;P.value=a(O.initialIndex??0,O.tracks.length),K(),e&&X(P.value,!1)}),(0,n.watch)(()=>O.initialIndex,e=>{let t=a(e??0,O.tracks.length);if(t!==P.value){let e=F.value;P.value=t,K(),e&&X(t,!1)}}),(0,n.watch)(()=>O.mode,e=>{V.value=e}),(0,n.watch)(()=>O.showPlaylist,e=>{B.value=e}),(0,n.onMounted)(()=>{O.autoplay&&H.value&&X(P.value,!1)}),(0,n.onBeforeUnmount)(()=>{j+=1,A&&=(A.pause(),A.removeEventListener(`timeupdate`,q),A.removeEventListener(`loadedmetadata`,J),A.removeEventListener(`ended`,Y),null)}),(i,a)=>{let o=r.NSlider;return(0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`c-audio-player`,{"is-minimal":t.theme===`minimal`}])},[(0,n.createCommentVNode)(` ================ Now Playing ================ `),(0,n.createElementVNode)(`div`,c,[t.showCover?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,l,[H.value?.cover?((0,n.openBlock)(),(0,n.createElementBlock)(`img`,{key:0,src:H.value.cover,alt:H.value.title},null,8,u)):((0,n.openBlock)(),(0,n.createBlock)(e.t,{key:1,name:`mdi:music-note`,class:`c-audio-player__cover-placeholder`}))])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`div`,d,[(0,n.createElementVNode)(`div`,f,(0,n.toDisplayString)(H.value?.title??`未选择曲目`),1),H.value?.artist?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,p,(0,n.toDisplayString)(H.value.artist),1)):(0,n.createCommentVNode)(`v-if`,!0)])]),(0,n.createCommentVNode)(` ================ Progress ================ `),t.theme===`minimal`?(0,n.createCommentVNode)(`v-if`,!0):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,ee,[(0,n.createElementVNode)(`div`,{class:`c-audio-player__progress-bar`,role:`slider`,tabindex:H.value?0:-1,"aria-label":`播放进度`,"aria-valuemin":0,"aria-valuemax":Math.floor(L.value),"aria-valuenow":Math.floor(I.value),onClick:ae,onKeydown:oe},[(0,n.createElementVNode)(`div`,{class:`c-audio-player__progress-fill`,style:(0,n.normalizeStyle)({width:`${U.value}%`})},null,4)],40,m),(0,n.createElementVNode)(`div`,h,[(0,n.createElementVNode)(`span`,null,(0,n.toDisplayString)((0,n.unref)(s)(I.value)),1),(0,n.createElementVNode)(`span`,null,(0,n.toDisplayString)((0,n.unref)(s)(L.value)),1)])])),(0,n.createCommentVNode)(` ================ Controls ================ `),(0,n.createElementVNode)(`div`,g,[(0,n.createElementVNode)(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-mode`,title:G.value,onClick:le},[(0,n.createVNode)(e.t,{name:W.value},null,8,[`name`])],8,_),(0,n.createElementVNode)(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-skip`,title:`上一曲`,onClick:re},[(0,n.createVNode)(e.t,{name:`mdi:skip-previous`})]),(0,n.createElementVNode)(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-play`,disabled:!H.value,title:F.value?`暂停`:`播放`,onClick:Z},[(0,n.createVNode)(e.t,{name:F.value?`mdi:pause`:`mdi:play`},null,8,[`name`])],8,v),(0,n.createElementVNode)(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-skip`,title:`下一曲`,onClick:ie},[(0,n.createVNode)(e.t,{name:`mdi:skip-next`})]),(0,n.createElementVNode)(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-mode`,title:`播放列表`,onClick:a[0]||=e=>B.value=!B.value},[(0,n.createVNode)(e.t,{name:`mdi:playlist-music`})])]),(0,n.createCommentVNode)(` ================ Volume ================ `),t.theme===`minimal`?(0,n.createCommentVNode)(`v-if`,!0):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,y,[(0,n.createElementVNode)(`button`,{type:`button`,class:`c-audio-player__volume-icon`,"aria-label":R.value===0?`取消静音`:`静音`,onClick:ce},[(0,n.createVNode)(e.t,{name:ne.value},null,8,[`name`])],8,b),(0,n.createVNode)(o,{value:R.value,"onUpdate:value":[a[1]||=e=>R.value=e,se],min:0,max:100,step:1,class:`c-audio-player__volume-slider`},null,8,[`value`])])),(0,n.createCommentVNode)(` ================ Playlist ================ `),t.showPlaylist&&B.value&&t.theme!==`minimal`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,x,[(0,n.createElementVNode)(`div`,S,[a[2]||=(0,n.createElementVNode)(`span`,null,`播放列表`,-1),(0,n.createElementVNode)(`span`,null,(0,n.toDisplayString)(t.tracks.length)+` 首`,1)]),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t.tracks,(t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)(`button`,{key:t.id,type:`button`,class:(0,n.normalizeClass)([`c-audio-player__track`,{"is-active":r===P.value}]),onClick:e=>Q(r)},[(0,n.createElementVNode)(`span`,w,[r===P.value&&F.value?((0,n.openBlock)(),(0,n.createBlock)(e.t,{key:0,name:`mdi:volume-high`})):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createTextVNode)((0,n.toDisplayString)(r+1),1)],64))]),(0,n.createElementVNode)(`div`,T,[(0,n.createElementVNode)(`div`,E,(0,n.toDisplayString)(t.title),1),t.artist?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,D,(0,n.toDisplayString)(t.artist),1)):(0,n.createCommentVNode)(`v-if`,!0)]),t.duration?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,te,(0,n.toDisplayString)((0,n.unref)(s)(t.duration)),1)):(0,n.createCommentVNode)(`v-if`,!0)],10,C))),128))])):(0,n.createCommentVNode)(`v-if`,!0)],2)}}});var k=t.t(O,[[`__scopeId`,`data-v-46f841a0`]]);Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return k}});
|
package/dist/C_AudioPlayer2.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,createElementVNode as s,createTextVNode as c,createVNode as l,defineComponent as u,normalizeClass as d,normalizeStyle as f,onBeforeUnmount as p,
|
|
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,createElementVNode as s,createTextVNode as c,createVNode as l,defineComponent as u,normalizeClass as d,normalizeStyle as f,onBeforeUnmount as p,onMounted as m,openBlock as h,ref as g,renderList as _,resolveComponent as v,toDisplayString as y,unref as b,watch as x}from"vue";import{NSlider as S}from"naive-ui";const C={initialIndex:0,showPlaylist:!0,showCover:!0,autoplay:!1,mode:`list`,theme:`default`};function w(e,t){return!Number.isFinite(e)||t<=0?0:Math.min(Math.max(Math.trunc(e),0),t-1)}const T={list:{icon:`mdi:repeat`,label:`List Loop`},loop:{icon:`mdi:repeat-once`,label:`Single Loop`},single:{icon:`mdi:numeric-1-box`,label:`Play Once`},shuffle:{icon:`mdi:shuffle-variant`,label:`Shuffle`}};function E(e){if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}const ee={class:`c-audio-player__now-playing`},te={key:0,class:`c-audio-player__cover`},ne=[`src`,`alt`],re={class:`c-audio-player__info`},ie={class:`c-audio-player__title`},ae={key:0,class:`c-audio-player__artist`},oe={key:0,class:`c-audio-player__progress`},se=[`tabindex`,`aria-valuemax`,`aria-valuenow`],ce={class:`c-audio-player__time`},le={class:`c-audio-player__controls`},ue=[`title`],de=[`disabled`,`title`],fe={key:1,class:`c-audio-player__volume`},pe=[`aria-label`],me={key:2,class:`c-audio-player__playlist`},he={class:`c-audio-player__playlist-header`},D=[`onClick`],O={class:`c-audio-player__track-index`},k={class:`c-audio-player__track-info`},A={class:`c-audio-player__track-title`},j={key:0,class:`c-audio-player__track-artist`},M={key:0,class:`c-audio-player__track-duration`};var N=t(u({__name:`index`,props:{tracks:{},initialIndex:{default:C.initialIndex},showPlaylist:{type:Boolean,default:C.showPlaylist},showCover:{type:Boolean,default:!0},autoplay:{type:Boolean,default:C.autoplay},mode:{default:C.mode},theme:{default:C.theme}},emits:[`play`,`pause`,`ended`,`modeChange`,`error`],setup(t,{emit:u}){let v=t,C=u,N=null,P=0,F=e=>Number.isInteger(e)&&!!v.tracks[e],I=(e,t)=>e===P&&t===N,L=g(w(v.initialIndex??0,v.tracks.length)),R=g(!1),z=g(0),B=g(0),V=g(70),H=g(70),U=g(v.showPlaylist),W=g(v.mode??`list`),G=r(()=>v.tracks[L.value]),ge=r(()=>B.value<=0?0:Math.min(100,z.value/B.value*100)),_e=r(()=>V.value===0?`mdi:volume-off`:V.value<40?`mdi:volume-low`:V.value<70?`mdi:volume-medium`:`mdi:volume-high`),ve=r(()=>T[W.value]?.icon??`mdi:repeat`),ye=r(()=>T[W.value]?.label??`循环`);function K(){P+=1,N&&(N.pause(),N.removeEventListener(`timeupdate`,q),N.removeEventListener(`loadedmetadata`,J),N.removeEventListener(`ended`,Y)),N=null,R.value=!1,z.value=0;let e=G.value;B.value=e?.duration??0,!(!e||typeof Audio>`u`)&&(N=new Audio(e.src),N.volume=V.value/100,N.addEventListener(`timeupdate`,q),N.addEventListener(`loadedmetadata`,J),N.addEventListener(`ended`,Y))}function q(){N&&(z.value=Number.isFinite(N.currentTime)?N.currentTime:0)}function J(){N&&(B.value=Number.isFinite(N.duration)?N.duration:0)}function Y(){switch(C(`ended`,L.value),W.value){case`loop`:N&&(N.currentTime=0),X(L.value,!1);break;case`single`:R.value=!1;break;case`shuffle`:v.tracks.length&&Z(Math.floor(Math.random()*v.tracks.length));break;default:if(!v.tracks.length){R.value=!1;break}Z(L.value<v.tracks.length-1?L.value+1:0)}}async function X(e,t){if(!F(e))return;(t||!N||L.value!==e)&&(L.value=e,K());let n=N;if(!n)return;let r=++P;try{if(await n.play(),!I(r,n))return;R.value=!0,C(`play`,e)}catch(e){if(!I(r,n))return;R.value=!1,C(`error`,e)}}function be(){if(G.value){if(!R.value){X(L.value,!1);return}P+=1,N?.pause(),R.value=!1,C(`pause`)}}function Z(e){return X(e,!0)}function xe(){v.tracks.length&&Z(L.value<=0?v.tracks.length-1:L.value-1)}function Se(){v.tracks.length&&Z(L.value>=v.tracks.length-1?0:L.value+1)}function Ce(e){if(!N||!B.value)return;let t=e.currentTarget.getBoundingClientRect();if(t.width<=0)return;let n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));N.currentTime=n*B.value,z.value=N.currentTime}function we(e){if(!N||B.value<=0)return;let t=e.key===`ArrowRight`?5:e.key===`ArrowLeft`?-5:0,n=e.key===`Home`?0:e.key===`End`?B.value:z.value+t;!t&&e.key!==`Home`&&e.key!==`End`||(e.preventDefault(),N.currentTime=Math.max(0,Math.min(B.value,n)),z.value=N.currentTime)}function Q(e){V.value=e,N&&(N.volume=e/100)}function Te(){V.value>0?(H.value=V.value,V.value=0):V.value=H.value||70,N&&(N.volume=V.value/100)}let $=[`list`,`loop`,`single`,`shuffle`];function Ee(){W.value=$[($.indexOf(W.value)+1)%$.length],C(`modeChange`,W.value)}return x(()=>v.tracks,()=>{let e=R.value;L.value=w(v.initialIndex??0,v.tracks.length),K(),e&&X(L.value,!1)}),x(()=>v.initialIndex,e=>{let t=w(e??0,v.tracks.length);if(t!==L.value){let e=R.value;L.value=t,K(),e&&X(t,!1)}}),x(()=>v.mode,e=>{W.value=e}),x(()=>v.showPlaylist,e=>{U.value=e}),m(()=>{v.autoplay&&G.value&&X(L.value,!1)}),p(()=>{P+=1,N&&=(N.pause(),N.removeEventListener(`timeupdate`,q),N.removeEventListener(`loadedmetadata`,J),N.removeEventListener(`ended`,Y),null)}),(r,u)=>{let p=S;return h(),o(`div`,{class:d([`c-audio-player`,{"is-minimal":t.theme===`minimal`}])},[a(` ================ Now Playing ================ `),s(`div`,ee,[t.showCover?(h(),o(`div`,te,[G.value?.cover?(h(),o(`img`,{key:0,src:G.value.cover,alt:G.value.title},null,8,ne)):(h(),i(e,{key:1,name:`mdi:music-note`,class:`c-audio-player__cover-placeholder`}))])):a(`v-if`,!0),s(`div`,re,[s(`div`,ie,y(G.value?.title??`未选择曲目`),1),G.value?.artist?(h(),o(`div`,ae,y(G.value.artist),1)):a(`v-if`,!0)])]),a(` ================ Progress ================ `),t.theme===`minimal`?a(`v-if`,!0):(h(),o(`div`,oe,[s(`div`,{class:`c-audio-player__progress-bar`,role:`slider`,tabindex:G.value?0:-1,"aria-label":`播放进度`,"aria-valuemin":0,"aria-valuemax":Math.floor(B.value),"aria-valuenow":Math.floor(z.value),onClick:Ce,onKeydown:we},[s(`div`,{class:`c-audio-player__progress-fill`,style:f({width:`${ge.value}%`})},null,4)],40,se),s(`div`,ce,[s(`span`,null,y(b(E)(z.value)),1),s(`span`,null,y(b(E)(B.value)),1)])])),a(` ================ Controls ================ `),s(`div`,le,[s(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-mode`,title:ye.value,onClick:Ee},[l(e,{name:ve.value},null,8,[`name`])],8,ue),s(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-skip`,title:`上一曲`,onClick:xe},[l(e,{name:`mdi:skip-previous`})]),s(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-play`,disabled:!G.value,title:R.value?`暂停`:`播放`,onClick:be},[l(e,{name:R.value?`mdi:pause`:`mdi:play`},null,8,[`name`])],8,de),s(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-skip`,title:`下一曲`,onClick:Se},[l(e,{name:`mdi:skip-next`})]),s(`button`,{type:`button`,class:`c-audio-player__ctrl-btn is-mode`,title:`播放列表`,onClick:u[0]||=e=>U.value=!U.value},[l(e,{name:`mdi:playlist-music`})])]),a(` ================ Volume ================ `),t.theme===`minimal`?a(`v-if`,!0):(h(),o(`div`,fe,[s(`button`,{type:`button`,class:`c-audio-player__volume-icon`,"aria-label":V.value===0?`取消静音`:`静音`,onClick:Te},[l(e,{name:_e.value},null,8,[`name`])],8,pe),l(p,{value:V.value,"onUpdate:value":[u[1]||=e=>V.value=e,Q],min:0,max:100,step:1,class:`c-audio-player__volume-slider`},null,8,[`value`])])),a(` ================ Playlist ================ `),t.showPlaylist&&U.value&&t.theme!==`minimal`?(h(),o(`div`,me,[s(`div`,he,[u[2]||=s(`span`,null,`播放列表`,-1),s(`span`,null,y(t.tracks.length)+` 首`,1)]),(h(!0),o(n,null,_(t.tracks,(t,r)=>(h(),o(`button`,{key:t.id,type:`button`,class:d([`c-audio-player__track`,{"is-active":r===L.value}]),onClick:e=>Z(r)},[s(`span`,O,[r===L.value&&R.value?(h(),i(e,{key:0,name:`mdi:volume-high`})):(h(),o(n,{key:1},[c(y(r+1),1)],64))]),s(`div`,k,[s(`div`,A,y(t.title),1),t.artist?(h(),o(`div`,j,y(t.artist),1)):a(`v-if`,!0)]),t.duration?(h(),o(`span`,M,y(b(E)(t.duration)),1)):a(`v-if`,!0)],10,D))),128))])):a(`v-if`,!0)],2)}}}),[[`__scopeId`,`data-v-46f841a0`]]);export{E as i,C as n,T as r,N as t};
|
package/dist/C_AvatarGroup.css
CHANGED
|
@@ -1,61 +1,68 @@
|
|
|
1
1
|
/* unplugin-vue-components disabled *//**
|
|
2
2
|
* C_AvatarGroup — 头像组组件样式
|
|
3
3
|
*/
|
|
4
|
-
.c-avatar-group[data-v-
|
|
4
|
+
.c-avatar-group[data-v-b2031360] {
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
}
|
|
8
|
-
.c-avatar-group.is-rtl[data-v-
|
|
8
|
+
.c-avatar-group.is-rtl[data-v-b2031360] {
|
|
9
9
|
flex-direction: row-reverse;
|
|
10
10
|
}
|
|
11
|
-
.c-avatar-group[data-v-
|
|
11
|
+
.c-avatar-group[data-v-b2031360] {
|
|
12
12
|
/* ======================== 单个头像 ======================== */
|
|
13
13
|
}
|
|
14
|
-
.c-avatar-group__item[data-v-
|
|
14
|
+
.c-avatar-group__item[data-v-b2031360] {
|
|
15
15
|
position: relative;
|
|
16
16
|
flex-shrink: 0;
|
|
17
17
|
border: 2px solid var(--card-color);
|
|
18
|
+
padding: 0;
|
|
19
|
+
color: inherit;
|
|
20
|
+
font: inherit;
|
|
18
21
|
background: var(--card-color);
|
|
19
22
|
transition: transform 0.2s, z-index 0.2s, box-shadow 0.2s;
|
|
20
23
|
cursor: default;
|
|
21
24
|
z-index: 1;
|
|
22
25
|
}
|
|
23
|
-
.c-avatar-group__item
|
|
26
|
+
.c-avatar-group__item[data-v-b2031360]:focus-visible {
|
|
27
|
+
outline: 2px solid var(--primary-color, #2080f0);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
}
|
|
30
|
+
.c-avatar-group__item.is-circle[data-v-b2031360] {
|
|
24
31
|
border-radius: 50%;
|
|
25
32
|
}
|
|
26
|
-
.c-avatar-group__item.is-square[data-v-
|
|
33
|
+
.c-avatar-group__item.is-square[data-v-b2031360] {
|
|
27
34
|
border-radius: 6px;
|
|
28
35
|
}
|
|
29
|
-
.c-avatar-group__item.is-clickable[data-v-
|
|
36
|
+
.c-avatar-group__item.is-clickable[data-v-b2031360] {
|
|
30
37
|
cursor: pointer;
|
|
31
38
|
}
|
|
32
|
-
.c-avatar-group__item.is-clickable[data-v-
|
|
39
|
+
.c-avatar-group__item.is-clickable[data-v-b2031360]:hover {
|
|
33
40
|
transform: translateY(-3px) scale(1.08);
|
|
34
41
|
z-index: 10;
|
|
35
42
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
36
43
|
}
|
|
37
|
-
.c-avatar-group__item[data-v-
|
|
44
|
+
.c-avatar-group__item[data-v-b2031360]:hover {
|
|
38
45
|
z-index: 10;
|
|
39
46
|
}
|
|
40
|
-
.c-avatar-group[data-v-
|
|
47
|
+
.c-avatar-group[data-v-b2031360] {
|
|
41
48
|
/* ---- 头像图片 ---- */
|
|
42
49
|
}
|
|
43
|
-
.c-avatar-group__img[data-v-
|
|
50
|
+
.c-avatar-group__img[data-v-b2031360] {
|
|
44
51
|
display: block;
|
|
45
52
|
width: 100%;
|
|
46
53
|
height: 100%;
|
|
47
54
|
object-fit: cover;
|
|
48
55
|
}
|
|
49
|
-
.is-circle .c-avatar-group__img[data-v-
|
|
56
|
+
.is-circle .c-avatar-group__img[data-v-b2031360] {
|
|
50
57
|
border-radius: 50%;
|
|
51
58
|
}
|
|
52
|
-
.is-square .c-avatar-group__img[data-v-
|
|
59
|
+
.is-square .c-avatar-group__img[data-v-b2031360] {
|
|
53
60
|
border-radius: 4px;
|
|
54
61
|
}
|
|
55
|
-
.c-avatar-group[data-v-
|
|
62
|
+
.c-avatar-group[data-v-b2031360] {
|
|
56
63
|
/* ---- 首字母 fallback ---- */
|
|
57
64
|
}
|
|
58
|
-
.c-avatar-group__initials[data-v-
|
|
65
|
+
.c-avatar-group__initials[data-v-b2031360] {
|
|
59
66
|
display: flex;
|
|
60
67
|
align-items: center;
|
|
61
68
|
justify-content: center;
|
|
@@ -65,27 +72,29 @@
|
|
|
65
72
|
font-weight: 600;
|
|
66
73
|
user-select: none;
|
|
67
74
|
}
|
|
68
|
-
.is-circle .c-avatar-group__initials[data-v-
|
|
75
|
+
.is-circle .c-avatar-group__initials[data-v-b2031360] {
|
|
69
76
|
border-radius: 50%;
|
|
70
77
|
}
|
|
71
|
-
.is-square .c-avatar-group__initials[data-v-
|
|
78
|
+
.is-square .c-avatar-group__initials[data-v-b2031360] {
|
|
72
79
|
border-radius: 4px;
|
|
73
80
|
}
|
|
74
|
-
.c-avatar-group[data-v-
|
|
81
|
+
.c-avatar-group[data-v-b2031360] {
|
|
75
82
|
/* ---- 状态指示点 ---- */
|
|
76
83
|
}
|
|
77
|
-
.c-avatar-group__status[data-v-
|
|
84
|
+
.c-avatar-group__status[data-v-b2031360] {
|
|
78
85
|
position: absolute;
|
|
79
86
|
bottom: 0;
|
|
80
87
|
right: 0;
|
|
81
88
|
border-radius: 50%;
|
|
82
89
|
border: 2px solid var(--card-color);
|
|
90
|
+
padding: 0;
|
|
91
|
+
font: inherit;
|
|
83
92
|
z-index: 2;
|
|
84
93
|
}
|
|
85
|
-
.c-avatar-group[data-v-
|
|
94
|
+
.c-avatar-group[data-v-b2031360] {
|
|
86
95
|
/* ======================== 溢出 +N ======================== */
|
|
87
96
|
}
|
|
88
|
-
.c-avatar-group__overflow[data-v-
|
|
97
|
+
.c-avatar-group__overflow[data-v-b2031360] {
|
|
89
98
|
position: relative;
|
|
90
99
|
flex-shrink: 0;
|
|
91
100
|
display: flex;
|
|
@@ -96,18 +105,24 @@
|
|
|
96
105
|
color: var(--primary-color);
|
|
97
106
|
font-weight: 700;
|
|
98
107
|
z-index: 0;
|
|
108
|
+
}
|
|
109
|
+
.c-avatar-group__overflow[data-v-b2031360]:focus-visible {
|
|
110
|
+
outline: 2px solid var(--primary-color, #2080f0);
|
|
111
|
+
outline-offset: 2px;
|
|
112
|
+
}
|
|
113
|
+
.c-avatar-group__overflow[data-v-b2031360] {
|
|
99
114
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
100
115
|
}
|
|
101
|
-
.c-avatar-group__overflow.is-circle[data-v-
|
|
116
|
+
.c-avatar-group__overflow.is-circle[data-v-b2031360] {
|
|
102
117
|
border-radius: 50%;
|
|
103
118
|
}
|
|
104
|
-
.c-avatar-group__overflow.is-square[data-v-
|
|
119
|
+
.c-avatar-group__overflow.is-square[data-v-b2031360] {
|
|
105
120
|
border-radius: 6px;
|
|
106
121
|
}
|
|
107
|
-
.c-avatar-group__overflow.is-clickable[data-v-
|
|
122
|
+
.c-avatar-group__overflow.is-clickable[data-v-b2031360] {
|
|
108
123
|
cursor: pointer;
|
|
109
124
|
}
|
|
110
|
-
.c-avatar-group__overflow.is-clickable[data-v-
|
|
125
|
+
.c-avatar-group__overflow.is-clickable[data-v-b2031360]:hover {
|
|
111
126
|
transform: translateY(-3px) scale(1.08);
|
|
112
127
|
z-index: 10;
|
|
113
128
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
package/dist/C_AvatarGroup2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`);let t=require(`vue`),n=require(`naive-ui`);const r={max:5,size:40,overlap:-10,shape:`circle`,showStatus:!0,showTooltip:!0,clickable:!1,overflowClickable:!0,direction:`ltr`},i={online:`#18a058`,offline:`#909399`,busy:`#e53e3e`,away:`#f0a020`};function a(e){if(!
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`);let t=require(`vue`),n=require(`naive-ui`);const r={max:5,size:40,overlap:-10,shape:`circle`,showStatus:!0,showTooltip:!0,clickable:!1,overflowClickable:!0,direction:`ltr`},i={online:`#18a058`,offline:`#909399`,busy:`#e53e3e`,away:`#f0a020`};function a(e){let t=e.trim();if(!t)return`?`;let n=t.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():/[\u4E00-\u9FFF]/.test(t)?t.slice(-1):t.slice(0,2).toUpperCase()}function o(e){let t=[`#6366f1`,`#8b5cf6`,`#a855f7`,`#d946ef`,`#ec4899`,`#f43f5e`,`#ef4444`,`#f97316`,`#eab308`,`#84cc16`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#0ea5e9`,`#3b82f6`,`#6d28d9`],n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+(n*31|0);return t[Math.abs(n)%t.length]}const s=[`src`,`alt`],c={style:{"max-width":`200px`}},l=(0,t.defineComponent)({__name:`index`,props:{items:{},max:{default:r.max},size:{default:r.size},overlap:{default:r.overlap},shape:{default:r.shape},showStatus:{type:Boolean,default:r.showStatus},showTooltip:{type:Boolean,default:r.showTooltip},clickable:{type:Boolean,default:r.clickable},overflowClickable:{type:Boolean,default:r.overflowClickable},direction:{default:r.direction}},emits:[`itemClick`,`overflowClick`],setup(e,{emit:l}){let u=e,d=l,f=(0,t.computed)(()=>({...r,...u})),p=(0,t.computed)(()=>{let e=Math.max(0,Math.floor(f.value.max));return u.items.length>e?u.items.slice(0,e):u.items}),m=(0,t.computed)(()=>{let e=Math.max(0,Math.floor(f.value.max));return u.items.length>e?u.items.slice(e):[]}),h=(0,t.computed)(()=>m.value.length),g=(0,t.computed)(()=>`${Math.round(f.value.size*.38)}px`);function _(e){let t=f.value.size,n=f.value.overlap;return{width:`${t}px`,height:`${t}px`,marginLeft:e===0?`0`:`${n}px`}}let v=(0,t.computed)(()=>{let e=f.value.size,t=f.value.overlap;return{width:`${e}px`,height:`${e}px`,marginLeft:`${t}px`,fontSize:`${Math.round(e*.32)}px`}});function y(e){let t=Math.max(8,Math.round(f.value.size*.24));return{width:`${t}px`,height:`${t}px`,backgroundColor:i[e]??i.offline}}return(e,r)=>{let i=n.NTooltip;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`c-avatar-group`,{"is-rtl":f.value.direction===`rtl`}])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(p.value,(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(i,{key:e.id,disabled:!f.value.showTooltip,placement:`top`},{trigger:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f.value.clickable?`button`:`div`),{type:f.value.clickable?`button`:void 0,"aria-label":f.value.clickable?e.name:void 0,class:(0,t.normalizeClass)([`c-avatar-group__item`,[`is-${f.value.shape}`,{"is-clickable":f.value.clickable}]]),style:(0,t.normalizeStyle)(_(n)),onClick:t=>f.value.clickable&&d(`itemClick`,e)},{default:(0,t.withCtx)(()=>[e.src?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.src,alt:e.name,class:`c-avatar-group__img`},null,8,s)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`c-avatar-group__initials`,style:(0,t.normalizeStyle)({background:(0,t.unref)(o)(e.name),fontSize:g.value})},(0,t.toDisplayString)((0,t.unref)(a)(e.name)),5)),f.value.showStatus&&e.status?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:`c-avatar-group__status`,style:(0,t.normalizeStyle)(y(e.status))},null,4)):(0,t.createCommentVNode)(`v-if`,!0)]),_:2},1032,[`type`,`aria-label`,`class`,`style`,`onClick`]))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.tooltip??e.name),1)]),_:2},1032,[`disabled`]))),128)),(0,t.createCommentVNode)(` 溢出 +N `),h.value>0?((0,t.openBlock)(),(0,t.createBlock)(i,{key:0,placement:`top`},{trigger:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f.value.overflowClickable?`button`:`div`),{type:f.value.overflowClickable?`button`:void 0,"aria-label":f.value.overflowClickable?`显示另外 ${h.value} 个头像`:void 0,class:(0,t.normalizeClass)([`c-avatar-group__overflow`,[`is-${f.value.shape}`,{"is-clickable":f.value.overflowClickable}]]),style:(0,t.normalizeStyle)(v.value),onClick:r[0]||=e=>f.value.overflowClickable&&d(`overflowClick`,m.value)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` +`+(0,t.toDisplayString)(h.value),1)]),_:1},8,[`type`,`aria-label`,`class`,`style`]))]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,c,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(m.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,style:{"line-height":`1.6`}},(0,t.toDisplayString)(e.name),1))),128))])]),_:1})):(0,t.createCommentVNode)(`v-if`,!0)],2)}}});var u=e.t(l,[[`__scopeId`,`data-v-b2031360`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
package/dist/C_AvatarGroup2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./export-helper.js";import{Fragment as t,computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,defineComponent as c,normalizeClass as l,normalizeStyle as u,openBlock as d,renderList as f,resolveComponent as p,
|
|
1
|
+
import{t as e}from"./export-helper.js";import{Fragment as t,computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,defineComponent as c,normalizeClass as l,normalizeStyle as u,openBlock as d,renderList as f,resolveComponent as p,resolveDynamicComponent as m,toDisplayString as h,unref as g,withCtx as _}from"vue";import{NTooltip as v}from"naive-ui";const y={max:5,size:40,overlap:-10,shape:`circle`,showStatus:!0,showTooltip:!0,clickable:!1,overflowClickable:!0,direction:`ltr`},b={online:`#18a058`,offline:`#909399`,busy:`#e53e3e`,away:`#f0a020`};function x(e){let t=e.trim();if(!t)return`?`;let n=t.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():/[\u4E00-\u9FFF]/.test(t)?t.slice(-1):t.slice(0,2).toUpperCase()}function S(e){let t=[`#6366f1`,`#8b5cf6`,`#a855f7`,`#d946ef`,`#ec4899`,`#f43f5e`,`#ef4444`,`#f97316`,`#eab308`,`#84cc16`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#0ea5e9`,`#3b82f6`,`#6d28d9`],n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+(n*31|0);return t[Math.abs(n)%t.length]}const C=[`src`,`alt`],w={style:{"max-width":`200px`}};var T=e(c({__name:`index`,props:{items:{},max:{default:y.max},size:{default:y.size},overlap:{default:y.overlap},shape:{default:y.shape},showStatus:{type:Boolean,default:y.showStatus},showTooltip:{type:Boolean,default:y.showTooltip},clickable:{type:Boolean,default:y.clickable},overflowClickable:{type:Boolean,default:y.overflowClickable},direction:{default:y.direction}},emits:[`itemClick`,`overflowClick`],setup(e,{emit:c}){let p=e,T=c,E=n(()=>({...y,...p})),D=n(()=>{let e=Math.max(0,Math.floor(E.value.max));return p.items.length>e?p.items.slice(0,e):p.items}),O=n(()=>{let e=Math.max(0,Math.floor(E.value.max));return p.items.length>e?p.items.slice(e):[]}),k=n(()=>O.value.length),A=n(()=>`${Math.round(E.value.size*.38)}px`);function j(e){let t=E.value.size,n=E.value.overlap;return{width:`${t}px`,height:`${t}px`,marginLeft:e===0?`0`:`${n}px`}}let M=n(()=>{let e=E.value.size,t=E.value.overlap;return{width:`${e}px`,height:`${e}px`,marginLeft:`${t}px`,fontSize:`${Math.round(e*.32)}px`}});function N(e){let t=Math.max(8,Math.round(E.value.size*.24));return{width:`${t}px`,height:`${t}px`,backgroundColor:b[e]??b.offline}}return(e,n)=>{let c=v;return d(),a(`div`,{class:l([`c-avatar-group`,{"is-rtl":E.value.direction===`rtl`}])},[(d(!0),a(t,null,f(D.value,(e,t)=>(d(),r(c,{key:e.id,disabled:!E.value.showTooltip,placement:`top`},{trigger:_(()=>[(d(),r(m(E.value.clickable?`button`:`div`),{type:E.value.clickable?`button`:void 0,"aria-label":E.value.clickable?e.name:void 0,class:l([`c-avatar-group__item`,[`is-${E.value.shape}`,{"is-clickable":E.value.clickable}]]),style:u(j(t)),onClick:t=>E.value.clickable&&T(`itemClick`,e)},{default:_(()=>[e.src?(d(),a(`img`,{key:0,src:e.src,alt:e.name,class:`c-avatar-group__img`},null,8,C)):(d(),a(`div`,{key:1,class:`c-avatar-group__initials`,style:u({background:g(S)(e.name),fontSize:A.value})},h(g(x)(e.name)),5)),E.value.showStatus&&e.status?(d(),a(`span`,{key:2,class:`c-avatar-group__status`,style:u(N(e.status))},null,4)):i(`v-if`,!0)]),_:2},1032,[`type`,`aria-label`,`class`,`style`,`onClick`]))]),default:_(()=>[s(` `+h(e.tooltip??e.name),1)]),_:2},1032,[`disabled`]))),128)),i(` 溢出 +N `),k.value>0?(d(),r(c,{key:0,placement:`top`},{trigger:_(()=>[(d(),r(m(E.value.overflowClickable?`button`:`div`),{type:E.value.overflowClickable?`button`:void 0,"aria-label":E.value.overflowClickable?`显示另外 ${k.value} 个头像`:void 0,class:l([`c-avatar-group__overflow`,[`is-${E.value.shape}`,{"is-clickable":E.value.overflowClickable}]]),style:u(M.value),onClick:n[0]||=e=>E.value.overflowClickable&&T(`overflowClick`,O.value)},{default:_(()=>[s(` +`+h(k.value),1)]),_:1},8,[`type`,`aria-label`,`class`,`style`]))]),default:_(()=>[o(`div`,w,[(d(!0),a(t,null,f(O.value,e=>(d(),a(`div`,{key:e.id,style:{"line-height":`1.6`}},h(e.name),1))),128))])]),_:1})):i(`v-if`,!0)],2)}}}),[[`__scopeId`,`data-v-b2031360`]]);export{S as a,x as i,y as n,b as r,T as t};
|
package/dist/C_Barcode.css
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* unplugin-vue-components disabled */.c-barcode[data-v-
|
|
1
|
+
/* unplugin-vue-components disabled */.c-barcode[data-v-b15d80e8] {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
5
5
|
gap: 8px;
|
|
6
6
|
max-width: 100%;
|
|
7
7
|
}
|
|
8
|
-
.c-barcode .barcode-wrapper[data-v-
|
|
8
|
+
.c-barcode .barcode-wrapper[data-v-b15d80e8] {
|
|
9
9
|
display: inline-block;
|
|
10
10
|
padding: 8px;
|
|
11
11
|
background: #ffffff;
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
max-width: 100%;
|
|
16
16
|
}
|
|
17
|
-
.c-barcode .barcode-wrapper.with-border[data-v-
|
|
17
|
+
.c-barcode .barcode-wrapper.with-border[data-v-b15d80e8] {
|
|
18
18
|
border: 1px dashed #e0e0e0;
|
|
19
19
|
}
|
|
20
|
-
.c-barcode .barcode-wrapper[data-v-
|
|
20
|
+
.c-barcode .barcode-wrapper[data-v-b15d80e8]:hover {
|
|
21
21
|
border-color: var(--c-primary, #409eff);
|
|
22
22
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
23
23
|
}
|
|
24
|
-
.c-barcode .barcode-wrapper[data-v-
|
|
24
|
+
.c-barcode .barcode-wrapper[data-v-b15d80e8] svg {
|
|
25
25
|
max-width: 100%;
|
|
26
26
|
height: auto;
|
|
27
27
|
display: block;
|
|
28
28
|
overflow: visible;
|
|
29
29
|
}
|
|
30
|
-
.c-barcode .barcode-label[data-v-
|
|
30
|
+
.c-barcode .barcode-label[data-v-b15d80e8] {
|
|
31
31
|
font-size: 14px;
|
|
32
32
|
color: #666;
|
|
33
33
|
text-align: center;
|
package/dist/C_Barcode2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`@chenfengyuan/vue-barcode`);r=e.t(r);const i={class:`c-barcode`},a={key:0,class:`barcode-label`},o=(0,n.defineComponent)({name:`C_Barcode`,__name:`index`,props:{value:{},format:{default:`CODE128`},width:{default:2},height:{default:80},showText:{type:Boolean,default:!0},fontSize:{default:20},textPosition:{default:`bottom`},lineColor:{default:`#000000`},background:{default:`#FFFFFF`},showBorder:{type:Boolean,default:!0},label:{default:``},showLabel:{type:Boolean,default:!1}},emits:[`error`],setup(e,{emit:t}){let o=e,s=t,c=(0,n.computed)(()=>({value:o.value,format:o.format,width:o.width,height:o.height,displayValue:o.showText,fontSize:o.fontSize,textPosition:o.textPosition,lineColor:o.lineColor,background:o.background})),l=e=>{
|
|
1
|
+
const e=require(`./chunk.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`@chenfengyuan/vue-barcode`);r=e.t(r);const i={class:`c-barcode`},a={key:0,class:`barcode-label`},o=(0,n.defineComponent)({name:`C_Barcode`,__name:`index`,props:{value:{},format:{default:`CODE128`},width:{default:2},height:{default:80},showText:{type:Boolean,default:!0},fontSize:{default:20},textPosition:{default:`bottom`},lineColor:{default:`#000000`},background:{default:`#FFFFFF`},showBorder:{type:Boolean,default:!0},label:{default:``},showLabel:{type:Boolean,default:!1}},emits:[`error`],setup(e,{emit:t}){let o=e,s=t,c=(0,n.computed)(()=>({value:o.value,format:o.format,width:o.width,height:o.height,displayValue:o.showText,fontSize:o.fontSize,textPosition:o.textPosition,lineColor:o.lineColor,background:o.background})),l=e=>{s(`error`,e)};return(t,o)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,i,[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`barcode-wrapper`,{"with-border":e.showBorder}])},[(0,n.createVNode)((0,n.unref)(r.default),(0,n.mergeProps)(c.value,{onError:l}),null,16)],2),e.showLabel&&e.label?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,a,(0,n.toDisplayString)(e.label),1)):(0,n.createCommentVNode)(`v-if`,!0)]))}});var s=t.t(o,[[`__scopeId`,`data-v-b15d80e8`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
package/dist/C_Barcode2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./export-helper.js";import{computed as t,createCommentVNode as n,createElementBlock as r,createElementVNode as i,createVNode as a,defineComponent as o,mergeProps as s,normalizeClass as c,openBlock as l,toDisplayString as u,unref as d}from"vue";import f from"@chenfengyuan/vue-barcode";const p={class:`c-barcode`},m={key:0,class:`barcode-label`};var h=e(o({name:`C_Barcode`,__name:`index`,props:{value:{},format:{default:`CODE128`},width:{default:2},height:{default:80},showText:{type:Boolean,default:!0},fontSize:{default:20},textPosition:{default:`bottom`},lineColor:{default:`#000000`},background:{default:`#FFFFFF`},showBorder:{type:Boolean,default:!0},label:{default:``},showLabel:{type:Boolean,default:!1}},emits:[`error`],setup(e,{emit:o}){let h=e,g=o,_=t(()=>({value:h.value,format:h.format,width:h.width,height:h.height,displayValue:h.showText,fontSize:h.fontSize,textPosition:h.textPosition,lineColor:h.lineColor,background:h.background})),v=e=>{
|
|
1
|
+
import{t as e}from"./export-helper.js";import{computed as t,createCommentVNode as n,createElementBlock as r,createElementVNode as i,createVNode as a,defineComponent as o,mergeProps as s,normalizeClass as c,openBlock as l,toDisplayString as u,unref as d}from"vue";import f from"@chenfengyuan/vue-barcode";const p={class:`c-barcode`},m={key:0,class:`barcode-label`};var h=e(o({name:`C_Barcode`,__name:`index`,props:{value:{},format:{default:`CODE128`},width:{default:2},height:{default:80},showText:{type:Boolean,default:!0},fontSize:{default:20},textPosition:{default:`bottom`},lineColor:{default:`#000000`},background:{default:`#FFFFFF`},showBorder:{type:Boolean,default:!0},label:{default:``},showLabel:{type:Boolean,default:!1}},emits:[`error`],setup(e,{emit:o}){let h=e,g=o,_=t(()=>({value:h.value,format:h.format,width:h.width,height:h.height,displayValue:h.showText,fontSize:h.fontSize,textPosition:h.textPosition,lineColor:h.lineColor,background:h.background})),v=e=>{g(`error`,e)};return(t,o)=>(l(),r(`div`,p,[i(`div`,{class:c([`barcode-wrapper`,{"with-border":e.showBorder}])},[a(d(f),s(_.value,{onError:v}),null,16)],2),e.showLabel&&e.label?(l(),r(`div`,m,u(e.label),1)):n(`v-if`,!0)]))}}),[[`__scopeId`,`data-v-b15d80e8`]]);export{h as t};
|
package/dist/C_Breadcrumb.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
|
}
|
package/dist/C_Breadcrumb2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`);let t=require(`vue`),n=require(`naive-ui`),r=require(`vue-router`);const i={class:`c-breadcrumb__trigger`},a=[`onClick`],o=(0,t.defineComponent)({name:`C_Breadcrumb`,__name:`index`,props:{items:{},showIcon:{type:Boolean,default:!0},iconSize:{default:16},labelFormatter:{}},emits:[`select`],setup(o,{emit:s}){let c=o,l=s,u=(0,r.useRoute)(),d=e=>c.labelFormatter?c.labelFormatter(e):e,f=(0,t.computed)(()=>u.matched.filter(e=>e.meta?.title).map(e=>({key:e.path,label:d(e.meta.title||``),icon:e.meta.icon,children:e.children?.length?e.children.map(e=>({key:e.path,label:d(e.meta?.title||``),...e.children?.length&&{children:e.children.map(e=>({key:e.path,label:d(e.meta?.title||``)}))}})):[]}))),p=(0,t.computed)(()=>c.items??f.value),m=e=>{l(`select`,e)};return(r,s)=>{let c=n.NDropdown,l=n.NBreadcrumbItem,u=n.NBreadcrumb;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`c-breadcrumb flex-1 min-w-0`,style:(0,t.normalizeStyle)({"--c-breadcrumb-icon-size":`${o.iconSize}px`,"--c-breadcrumb-gap":`${Math.max(Math.round(o.iconSize/4),2)}px`})},[(0,t.createVNode)(u,null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(p.value,(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(l,{key:r},{default:(0,t.withCtx)(()=>[n.children?.length?((0,t.openBlock)(),(0,t.createBlock)(c,{key:0,options:n.children,onSelect:m},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,i,[o.showIcon?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.t),{key:0,name:n.icon,size:o.iconSize},null,8,[`name`,`size`])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.label),1)])]),_:2},1032,[`options`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`c-breadcrumb__link`,onClick:e=>m(n.key)},[o.showIcon?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.t),{key:0,name:n.icon,size:o.iconSize},null,8,[`name`,`size`])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.label),1)],8,a))]),_:2},1024))),128))]),_:1})],4)}}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`);let t=require(`vue`),n=require(`naive-ui`),r=require(`vue-router`);const i={class:`c-breadcrumb__trigger`},a=[`onClick`],o=(0,t.defineComponent)({name:`C_Breadcrumb`,__name:`index`,props:{items:{},showIcon:{type:Boolean,default:!0},iconSize:{default:16},labelFormatter:{}},emits:[`select`],setup(o,{emit:s}){let c=o,l=s,u=(0,r.useRoute)(),d=e=>c.labelFormatter?c.labelFormatter(e):e,f=(0,t.computed)(()=>u.matched.filter(e=>e.meta?.title).map(e=>({key:e.path,label:d(e.meta.title||``),icon:e.meta.icon,children:e.children?.length?e.children.map(e=>({key:e.path,label:d(e.meta?.title||``),...e.children?.length&&{children:e.children.map(e=>({key:e.path,label:d(e.meta?.title||``)}))}})):[]}))),p=(0,t.computed)(()=>c.items??f.value),m=e=>{l(`select`,e)};return(r,s)=>{let c=n.NDropdown,l=n.NBreadcrumbItem,u=n.NBreadcrumb;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`c-breadcrumb flex-1 min-w-0`,style:(0,t.normalizeStyle)({"--c-breadcrumb-icon-size":`${o.iconSize}px`,"--c-breadcrumb-gap":`${Math.max(Math.round(o.iconSize/4),2)}px`})},[(0,t.createVNode)(u,null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(p.value,(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(l,{key:r},{default:(0,t.withCtx)(()=>[n.children?.length?((0,t.openBlock)(),(0,t.createBlock)(c,{key:0,options:n.children,onSelect:m},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,i,[o.showIcon&&n.icon?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.t),{key:0,name:n.icon,size:o.iconSize},null,8,[`name`,`size`])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.label),1)])]),_:2},1032,[`options`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`c-breadcrumb__link`,onClick:e=>m(n.key)},[o.showIcon&&n.icon?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.t),{key:0,name:n.icon,size:o.iconSize},null,8,[`name`,`size`])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.label),1)],8,a))]),_:2},1024))),128))]),_:1})],4)}}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
package/dist/C_Breadcrumb2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{Fragment as t,computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,defineComponent as l,normalizeStyle as u,openBlock as d,renderList as f,resolveComponent as p,toDisplayString as m,unref as h,withCtx as g}from"vue";import{NBreadcrumb as _,NBreadcrumbItem as v,NDropdown as y}from"naive-ui";import{useRoute as b}from"vue-router";const x={class:`c-breadcrumb__trigger`},S=[`onClick`],C=l({name:`C_Breadcrumb`,__name:`index`,props:{items:{},showIcon:{type:Boolean,default:!0},iconSize:{default:16},labelFormatter:{}},emits:[`select`],setup(l,{emit:p}){let C=l,w=p,T=b(),E=e=>C.labelFormatter?C.labelFormatter(e):e,D=n(()=>T.matched.filter(e=>e.meta?.title).map(e=>({key:e.path,label:E(e.meta.title||``),icon:e.meta.icon,children:e.children?.length?e.children.map(e=>({key:e.path,label:E(e.meta?.title||``),...e.children?.length&&{children:e.children.map(e=>({key:e.path,label:E(e.meta?.title||``)}))}})):[]}))),O=n(()=>C.items??D.value),k=e=>{w(`select`,e)};return(n,p)=>{let b=y,C=v,w=_;return d(),a(`div`,{class:`c-breadcrumb flex-1 min-w-0`,style:u({"--c-breadcrumb-icon-size":`${l.iconSize}px`,"--c-breadcrumb-gap":`${Math.max(Math.round(l.iconSize/4),2)}px`})},[c(w,null,{default:g(()=>[(d(!0),a(t,null,f(O.value,(t,n)=>(d(),r(C,{key:n},{default:g(()=>[t.children?.length?(d(),r(b,{key:0,options:t.children,onSelect:k},{default:g(()=>[o(`div`,x,[l.showIcon?(d(),r(h(e),{key:0,name:t.icon,size:l.iconSize},null,8,[`name`,`size`])):i(`v-if`,!0),s(` `+m(t.label),1)])]),_:2},1032,[`options`])):(d(),a(`span`,{key:1,class:`c-breadcrumb__link`,onClick:e=>k(t.key)},[l.showIcon?(d(),r(h(e),{key:0,name:t.icon,size:l.iconSize},null,8,[`name`,`size`])):i(`v-if`,!0),s(` `+m(t.label),1)],8,S))]),_:2},1024))),128))]),_:1})],4)}}});export{C as t};
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{Fragment as t,computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,defineComponent as l,normalizeStyle as u,openBlock as d,renderList as f,resolveComponent as p,toDisplayString as m,unref as h,withCtx as g}from"vue";import{NBreadcrumb as _,NBreadcrumbItem as v,NDropdown as y}from"naive-ui";import{useRoute as b}from"vue-router";const x={class:`c-breadcrumb__trigger`},S=[`onClick`],C=l({name:`C_Breadcrumb`,__name:`index`,props:{items:{},showIcon:{type:Boolean,default:!0},iconSize:{default:16},labelFormatter:{}},emits:[`select`],setup(l,{emit:p}){let C=l,w=p,T=b(),E=e=>C.labelFormatter?C.labelFormatter(e):e,D=n(()=>T.matched.filter(e=>e.meta?.title).map(e=>({key:e.path,label:E(e.meta.title||``),icon:e.meta.icon,children:e.children?.length?e.children.map(e=>({key:e.path,label:E(e.meta?.title||``),...e.children?.length&&{children:e.children.map(e=>({key:e.path,label:E(e.meta?.title||``)}))}})):[]}))),O=n(()=>C.items??D.value),k=e=>{w(`select`,e)};return(n,p)=>{let b=y,C=v,w=_;return d(),a(`div`,{class:`c-breadcrumb flex-1 min-w-0`,style:u({"--c-breadcrumb-icon-size":`${l.iconSize}px`,"--c-breadcrumb-gap":`${Math.max(Math.round(l.iconSize/4),2)}px`})},[c(w,null,{default:g(()=>[(d(!0),a(t,null,f(O.value,(t,n)=>(d(),r(C,{key:n},{default:g(()=>[t.children?.length?(d(),r(b,{key:0,options:t.children,onSelect:k},{default:g(()=>[o(`div`,x,[l.showIcon&&t.icon?(d(),r(h(e),{key:0,name:t.icon,size:l.iconSize},null,8,[`name`,`size`])):i(`v-if`,!0),s(` `+m(t.label),1)])]),_:2},1032,[`options`])):(d(),a(`span`,{key:1,class:`c-breadcrumb__link`,onClick:e=>k(t.key)},[l.showIcon&&t.icon?(d(),r(h(e),{key:0,name:t.icon,size:l.iconSize},null,8,[`name`,`size`])):i(`v-if`,!0),s(` `+m(t.label),1)],8,S))]),_:2},1024))),128))]),_:1})],4)}}});export{C as t};
|