@robot-admin/naive-ui-components 0.31.1 → 0.31.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 +6 -0
- package/README.md +1 -1
- package/README_EN.md +1 -1
- package/dist/C_Date.css +5 -5
- package/dist/C_Date2.cjs +1 -1
- package/dist/C_Date2.js +1 -1
- package/dist/C_Form.base.css +1 -1
- package/dist/C_Form.css +1 -1
- package/dist/C_FormModal.css +1 -1
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +72 -72
- package/dist/C_Select.css +1 -1
- package/dist/C_Select2.cjs +1 -1
- package/dist/C_Select2.js +1 -1
- package/dist/C_Table.base.css +110 -110
- package/dist/C_Table.css +109 -109
- package/dist/C_Table2.cjs +1 -1
- package/dist/C_Table2.js +1 -1
- package/dist/C_Upload.css +28 -28
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/constants.d.cts +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants3.d.cts +4 -4
- package/dist/constants3.d.ts +4 -4
- package/dist/constants4.d.cts +7 -5
- package/dist/constants4.d.ts +7 -5
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/data2.d.cts +7 -7
- package/dist/data2.d.ts +7 -7
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.vue.d.cts +2 -2
- package/dist/index.vue.d.ts +2 -2
- package/dist/index10.vue.d.cts +4 -4
- package/dist/index10.vue.d.ts +4 -4
- package/dist/index11.vue.d.cts +4 -4
- package/dist/index12.vue.d.ts +3 -3
- package/dist/index13.vue.d.cts +3 -3
- package/dist/index14.vue.d.ts +2 -2
- package/dist/index15.vue.d.cts +2 -2
- package/dist/index15.vue.d.ts +2 -2
- package/dist/index16.vue.d.cts +2 -2
- package/dist/index16.vue.d.ts +6 -6
- package/dist/index17.vue.d.cts +6 -6
- package/dist/index17.vue.d.ts +3 -3
- package/dist/index18.vue.d.cts +3 -3
- package/dist/index18.vue.d.ts +1 -1
- package/dist/index19.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index2.vue.d.cts +1 -1
- package/dist/index2.vue.d.ts +1 -1
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +4 -4
- package/dist/index21.vue.d.cts +4 -4
- package/dist/index23.vue.d.cts +2 -2
- package/dist/index23.vue.d.ts +2 -2
- 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/index29.vue.d.cts +1 -1
- package/dist/index29.vue.d.ts +1 -1
- 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/index6.vue.d.ts +2 -2
- package/dist/index7.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 +2 -2
- package/dist/index9.vue.d.cts +2 -2
- package/dist/index9.vue.d.ts +4 -4
- package/dist/mapUtils.d.cts +3 -3
- package/dist/mapUtils.d.ts +3 -3
- package/dist/selectPresentation.cjs +1 -1
- package/dist/selectPresentation.js +1 -1
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/style.css +216 -216
- 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 +6 -6
- package/dist/useCropperCore.d.ts +6 -6
- package/dist/useDraggableLayout.d.cts +2 -2
- package/dist/useDraggableLayout.d.ts +2 -2
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFullscreen.d.cts +3 -3
- package/dist/useFullscreen.d.ts +3 -3
- 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 +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useTableQuery.d.cts +2 -2
- package/dist/useTableQuery.d.ts +2 -2
- package/dist/useTimeSelection.d.cts +3 -3
- package/dist/useTimeSelection.d.ts +3 -3
- package/dist/useWorkflowValidation.d.cts +2 -2
- package/dist/useWorkflowValidation.d.ts +2 -2
- package/dist/verification.d.cts +3 -3
- package/dist/verification.d.ts +3 -3
- package/docs/guides/data-workflows.md +3 -1
- package/docs/guides/usage.en.md +1 -1
- package/docs/guides/usage.md +4 -2
- package/package.json +1 -1
package/dist/C_Upload2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,TransitionGroup as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,normalizeClass as f,onBeforeUnmount as p,onMounted as m,openBlock as h,reactive as g,readonly as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,unref as S,watch as C,withCtx as w,withKeys as T,withModifiers as E}from"vue";import{NButton as D,NEllipsis as O,NProgress as k,NTag as A}from"naive-ui";import j from"spark-md5";const M=2*1024*1024,N={pending:`等待上传`,validating:`校验文件…`,hashing:`计算校验…`,uploading:`上传中…`,success:`上传成功`,error:`上传失败`,paused:`已暂停`,instant:`秒传成功`},P={pending:`default`,validating:`info`,hashing:`info`,uploading:`info`,success:`success`,error:`error`,paused:`warning`,instant:`success`},F={"image/":`mdi:file-image-outline`,"video/":`mdi:file-video-outline`,"audio/":`mdi:file-music-outline`,"application/pdf":`mdi:file-pdf-box`,"application/zip":`mdi:folder-zip-outline`,"application/x-rar":`mdi:folder-zip-outline`,"application/vnd.ms-excel":`mdi:file-excel-outline`,"application/vnd.openxmlformats-officedocument.spreadsheetml":`mdi:file-excel-outline`,"application/msword":`mdi:file-word-outline`,"application/vnd.openxmlformats-officedocument.wordprocessingml":`mdi:file-word-outline`,"text/":`mdi:file-document-outline`,default:`mdi:file-outline`};function I(e){for(let[t,n]of Object.entries(F))if(t!==`default`&&e.startsWith(t))return n;return F.default}function L(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n>0?1:0)} ${t[n]}`}function R(e){let t=[],n=new Set,r=0,i=!1,a=()=>{if(!i){i=!0;try{let n=Math.max(1,Math.trunc(e.value)||1);for(;r<n&&t.length;)t.shift()()}finally{i=!1}}};return C(e,a),Object.assign((e,i)=>{let o=!1,s=!1,c,l=(e=!0)=>o?!1:(o=!0,n.delete(d),s&&--r,e&&a(),!0),u=()=>{if(!o){s=!0,r+=1;try{c=e({...i,onProgress:e=>{o||i.onProgress?.(e)},onSuccess:e=>{l()&&i.onSuccess?.(e)},onError:e=>{l()&&i.onError?.(e)}})}catch(e){l()&&i.onError?.(e instanceof Error?e:Error(String(e)))}}},d=()=>{let e=t.indexOf(u);if(e>=0&&t.splice(e,1),l(!1))try{c?.abort()}catch{}finally{a()}};return n.add(d),t.push(u),a(),{abort:d}},{abortAll(){let e=i;i=!0,t.length=0;try{for(let e of n)e()}finally{i=e}}})}const z=e=>new Promise((t,n)=>{let r,i,a=()=>{e?.removeEventListener(`abort`,o),r!==void 0&&cancelAnimationFrame(r),i!==void 0&&clearTimeout(i)},o=()=>{a(),n(e?.reason??new DOMException(`Hash cancelled`,`AbortError`))},s=()=>{a(),t()};if(e?.addEventListener(`abort`,o,{once:!0}),e?.aborted){o();return}typeof requestAnimationFrame==`function`?r=requestAnimationFrame(s):i=setTimeout(s,0)});function B(e){let t=v(0),n=v(0),r=i(()=>t.value>0),a=Promise.resolve();async function o(e,t,n){let r=a,i;a=new Promise(e=>{i=e}),await r;try{return await s(e,t,n)}finally{i()}}async function s(r,i,a){a?.throwIfAborted(),t.value+=1,n.value=0,i?.(0);let o=new j.ArrayBuffer,s=Math.max(1,Math.trunc(Number(e.value)||1)),c=Math.max(1,Math.ceil(r.size/s));try{for(let e=0;e<c;e+=1){a?.throwIfAborted();let t=e*s,l=await r.slice(t,t+s).arrayBuffer();a?.throwIfAborted(),o.append(l),n.value=Math.round((e+1)/c*100),i?.(n.value),await z(a)}return a?.throwIfAborted(),o.end()}finally{t.value=Math.max(0,t.value-1)}}return{hashing:r,hashProgress:_(n),calculateHash:o}}function V(e){let t=new Map,n=new Map;function r(t){let n=Math.max(1,Math.trunc(Number(e.chunkSize.value)||1)),r=[],i=0,a=0;for(;a<t.size;){let e=Math.min(a+n,t.size);r.push({index:i,blob:t.slice(a,e),size:e-a,uploaded:!1}),a=e,i++}return r}async function i(t,n){if(e.uploadedChunksQuery?.value)try{let r=await e.uploadedChunksQuery.value(t);for(let e of r){let t=n[e];t&&(t.uploaded=!0)}}catch{}}function a(t){return new Promise((n,r)=>{let i=!1,a=()=>{i||(i=!0,n())},o=e=>{i||(i=!0,t.setError(),r(e instanceof Error?e:Error(String(e))))},s={action:e.action.value,headers:e.headers.value,data:{...e.data.value,hash:t.hash,chunkIndex:t.chunk.index,totalChunks:t.totalChunks,filename:t.file.name},file:t.chunk.blob,filename:t.file.name,hash:t.hash,chunkIndex:t.chunk.index,totalChunks:t.totalChunks,onProgress:()=>{},onSuccess:()=>{if(!i){if(t.isCancelled()){a();return}t.chunk.uploaded=!0,t.setUploadedBytes(t.chunk.size),t.onProgress({uploadedChunks:t.chunks.filter(e=>e.uploaded).length,totalChunks:t.totalChunks,uploadedBytes:t.chunks.filter(e=>e.uploaded).reduce((e,t)=>e+t.size,0),totalBytes:t.totalBytes}),a()}},onError:o};try{let n=e.customRequest?.value??H,r=e.scheduler?e.scheduler(n,s):n(s);t.abortControllers.push(()=>{try{r.abort()}catch{}finally{a()}})}catch(e){o(e)}})}async function o(o){let{uid:c,file:l,hash:u,onProgress:d,onSuccess:f,onError:p,isPaused:m}=o,h=Symbol(c);n.set(c,h);let g=()=>n.get(c)!==h,_=()=>{g()||n.delete(c)},v=r(l),y=v.length,b=l.size,x=0;if(await i(u,v),g()||m()){_();return}x=v.filter(e=>e.uploaded).reduce((e,t)=>e+t.size,0),d({uploadedChunks:v.filter(e=>e.uploaded).length,totalChunks:y,uploadedBytes:x,totalBytes:b});let S=v.filter(e=>!e.uploaded);if(S.length===0){try{g()||await s(u,l.name,y,f,p,g)}finally{_()}return}let C=[];t.set(c,C);let w=Math.max(1,Math.trunc(Number(e.concurrency.value)||1)),T=0,E=!1;async function D(){for(;T<S.length&&!E&&!m()&&!g();){let e=S[T++];await a({chunk:e,hash:u,file:l,totalChunks:y,chunks:v,totalBytes:b,abortControllers:C,onProgress:e=>{g()||d(e)},setUploadedBytes:e=>{x+=e},setError:()=>{E=!0},isCancelled:g})}}let O=Array.from({length:Math.min(w,S.length)},()=>D());try{let e=(await Promise.allSettled(O)).find(e=>e.status===`rejected`);e&&!g()?p(e.reason instanceof Error?e.reason:Error(String(e.reason))):!E&&!m()&&!g()&&await s(u,l.name,y,f,p,g)}finally{g()||t.delete(c),_()}}async function s(t,n,r,i,a,o){if(e.mergeChunks?.value)try{let a=await e.mergeChunks.value(t,n,r);o()||i(a)}catch(e){o()||a(e instanceof Error?e:Error(`分片合并失败`))}else o()||i({message:`分片上传完成(未配置合并函数)`})}function c(e){n.delete(e),t.get(e)?.forEach(e=>e()),t.delete(e)}function l(){n.clear(),t.forEach(e=>{e.forEach(e=>e())}),t.clear()}return{createChunks:r,uploadChunks:o,abortUpload:c,abortAll:l}}function H(e){let t=new XMLHttpRequest;t.open(`POST`,e.action),e.headers&&Object.entries(e.headers).forEach(([e,n])=>{t.setRequestHeader(e,n)}),t.upload.addEventListener(`progress`,t=>{t.lengthComputable&&e.onProgress?.(Math.round(t.loaded/t.total*100))}),t.addEventListener(`load`,()=>{if(t.status>=200&&t.status<300){let n;try{n=JSON.parse(t.responseText)}catch{n=t.responseText}e.onSuccess?.(n)}else e.onError?.(Error(`上传失败: HTTP ${t.status}`))}),t.addEventListener(`error`,()=>{e.onError?.(Error(`网络错误`))}),t.addEventListener(`abort`,()=>{e.onError?.(new DOMException(`上传已取消`,`AbortError`))});let n=new FormData;return n.append(`file`,e.file,e.filename),e.data&&Object.entries(e.data).forEach(([e,t])=>{n.append(e,String(t))}),t.send(n),{abort:()=>t.abort()}}function U(e){return e instanceof Error?e:Error(String(e))}function W(e){let t=[],n=v(0),r=new Map,i=()=>{n.value=r.size},a=()=>Math.max(1,Math.trunc(Number(e.concurrency.value)||1));function o(){for(;r.size<a()&&t.length>0;){let n=t.shift(),{file:a}=n;if(!a.raw||r.has(a.uid))continue;let s=!1,c=e=>{s||(s=!0,r.delete(a.uid),i(),e?.error?n.onError(a.uid,e.error):e&&`response`in e&&n.onSuccess(a.uid,e.response),o())},l={action:e.action.value,headers:e.headers.value,data:e.data.value,file:a.raw,filename:a.name,onProgress:e=>n.onProgress(a.uid,e),onSuccess:e=>c({response:e}),onError:e=>c({error:e})};r.set(a.uid,{abort:()=>void 0,settle:c}),i();try{let t=e.customRequest?.value??G,n=e.scheduler?e.scheduler(t,l):t(l),i=r.get(a.uid);i&&(i.abort=n.abort)}catch(e){c({error:U(e)})}}}function s(e,n,r,i){c(e.uid),t.push({file:e,onProgress:n,onSuccess:r,onError:i}),o()}function c(e){for(let n=t.length-1;n>=0;--n)t[n].file.uid===e&&t.splice(n,1);let n=r.get(e);if(n){n.settle();try{n.abort()}catch{}}}function l(){t.length=0;let e=[...r.values()];r.clear(),i(),e.forEach(e=>{e.settle();try{e.abort()}catch{}})}return C(e.concurrency,o),{activeCount:_(n),enqueue:s,abort:c,abortAll:l}}function G(e){let t=new XMLHttpRequest;t.open(`POST`,e.action),Object.entries(e.headers??{}).forEach(([e,n])=>{t.setRequestHeader(e,n)}),t.upload.addEventListener(`progress`,t=>{t.lengthComputable&&e.onProgress?.(Math.round(t.loaded/t.total*100))}),t.addEventListener(`load`,()=>{if(t.status>=200&&t.status<300){let n=t.responseText;try{n=JSON.parse(t.responseText)}catch{}e.onSuccess?.(n)}else e.onError?.(Error(`上传失败: HTTP ${t.status}`))}),t.addEventListener(`error`,()=>e.onError?.(Error(`网络错误`)));let n=new FormData;return n.append(`file`,e.file,e.filename),Object.entries(e.data??{}).forEach(([e,t])=>{n.append(e,String(t))}),t.send(n),{abort:()=>t.abort()}}function K(e){let t=i(()=>e.action??``),n=i(()=>e.headers??{}),r=i(()=>e.data??{}),a=i(()=>{let t=Math.trunc(Number(e.chunkSize));return Number.isFinite(t)&&t>0?t:M}),o=i(()=>{let t=Math.trunc(Number(e.concurrency));return Number.isFinite(t)&&t>0?t:3}),s=i(()=>e.customRequest),c=i(()=>e.instantCheck),l=i(()=>e.uploadedChunksQuery),u=i(()=>e.mergeChunks),d=v((e.defaultFileList??[]).map(e=>({...e}))),f=g(new Set),m=new Map,h=new Set,{hashing:_,hashProgress:y,calculateHash:b}=B(a),x=R(o),S=new Map,C=e=>{S.get(e)?.abort(),S.delete(e)},w=()=>{S.forEach(e=>e.abort()),S.clear()},T=V({scheduler:x,chunkSize:a,concurrency:o,action:t,headers:n,data:r,customRequest:s,uploadedChunksQuery:l,mergeChunks:u}),E=W({scheduler:x,concurrency:o,action:t,headers:n,data:r,customRequest:s}),D=i(()=>{let e=d.value;if(e.length===0)return 0;let t=e.reduce((e,t)=>e+t.percent,0);return Math.round(t/e.length)});function O(){return typeof crypto<`u`&&`randomUUID`in crypto?`upload-${crypto.randomUUID()}`:`upload-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function k(e){if(e.type.startsWith(`image/`)){let t=URL.createObjectURL(e);return h.add(t),t}}function A(t){let n=[];for(let r of t){if(Number.isFinite(e.maxCount)&&(e.maxCount??0)>0&&d.value.length+n.length>=Math.trunc(e.maxCount))break;let t={uid:O(),name:r.name,size:r.size,type:r.type,status:`pending`,percent:0,raw:r,thumbUrl:k(r)};n.push(t)}return d.value.push(...n),n}function j(e,t){let n=d.value.find(t=>t.uid===e);n&&Object.assign(n,t)}function N(e){C(e),m.delete(e),T.abortUpload(e),E.abort(e),f.delete(e);let t=d.value.findIndex(t=>t.uid===e);if(t!==-1){let e=d.value[t];d.value.splice(t,1),e.thumbUrl&&h.has(e.thumbUrl)&&!d.value.some(t=>t.thumbUrl===e.thumbUrl)&&L(e.thumbUrl)}}function P(e){let t=e.map(e=>({...e})),n=new Set(t.map(e=>e.thumbUrl));m.clear(),x.abortAll(),w(),T.abortAll(),E.abortAll(),f.clear(),h.forEach(e=>{n.has(e)||L(e)}),d.value=t}function F(){P([])}async function I(t){if((e.maxSize??0)>0&&t.size>e.maxSize)return null;if(e.beforeUpload){let n=await e.beforeUpload(t);if(n===!1)return null;if(n instanceof File)return(e.maxSize??0)>0&&n.size>e.maxSize?null:n}return t}function L(e){!e||!h.has(e)||(URL.revokeObjectURL(e),h.delete(e))}function z(e,t){return m.get(e)===t&&!f.has(e)&&d.value.some(t=>t.uid===e)}async function H(e,t){C(e.uid);let n=new AbortController;S.set(e.uid,n);try{return await b(e.raw,n=>{z(e.uid,t)&&j(e.uid,{percent:n})},n.signal)}finally{S.get(e.uid)===n&&S.delete(e.uid)}}async function U(n){if(!n.raw)return;let r=Symbol(n.uid);m.set(n.uid,r),j(n.uid,{status:`validating`,error:void 0});let i;try{i=await I(n.raw)}catch(e){z(n.uid,r)&&j(n.uid,{status:`error`,error:e instanceof Error?e.message:`文件校验失败`});return}if(z(n.uid,r)){if(!i){j(n.uid,{status:`error`,error:`文件校验未通过`});return}if(i!==n.raw&&(L(n.thumbUrl),Object.assign(n,{raw:i,name:i.name,size:i.size,type:i.type,hash:void 0,chunkProgress:void 0,thumbUrl:k(i)})),!s.value&&!t.value.trim()){j(n.uid,{status:`error`,error:`未配置上传地址`});return}if(c.value&&!n.hash){j(n.uid,{status:`hashing`});try{let e=await H(n,r);if(!z(n.uid,r))return;j(n.uid,{hash:e});let t=await c.value(e,n.raw.name);if(!z(n.uid,r))return;if(t.exists){j(n.uid,{status:`instant`,percent:100,url:t.url});return}}catch{if(!z(n.uid,r))return}}e.chunked&&n.raw.size>a.value?await G(n,r):K(n,r)}}async function G(e,t){let n=e.raw,{hash:r}=e;if(!r){j(e.uid,{status:`hashing`});try{if(r=await H(e,t),!z(e.uid,t))return;j(e.uid,{hash:r})}catch{z(e.uid,t)&&j(e.uid,{status:`error`,error:`Hash 计算失败`});return}}j(e.uid,{status:`uploading`,percent:0}),await T.uploadChunks({uid:e.uid,file:n,hash:r,onProgress:n=>{if(!z(e.uid,t))return;let r=Math.round(n.uploadedBytes/n.totalBytes*100);j(e.uid,{percent:r,chunkProgress:n})},onSuccess:n=>{z(e.uid,t)&&j(e.uid,{status:`success`,percent:100,response:n})},onError:n=>{z(e.uid,t)&&j(e.uid,{status:`error`,error:n.message})},isPaused:()=>f.has(e.uid)})}function K(e,t){j(e.uid,{status:`uploading`,percent:0}),E.enqueue(e,(e,n)=>{z(e,t)&&j(e,{percent:n})},(e,n)=>{z(e,t)&&j(e,{status:`success`,percent:100,response:n})},(e,n)=>{z(e,t)&&j(e,{status:`error`,error:n.message})})}function q(){d.value.filter(e=>e.status===`pending`).forEach(e=>void U(e))}function J(){x.abortAll(),d.value.forEach(e=>{(e.status===`uploading`||e.status===`hashing`||e.status===`validating`)&&(C(e.uid),f.add(e.uid),m.set(e.uid,Symbol(e.uid)),T.abortUpload(e.uid),E.abort(e.uid),j(e.uid,{status:`paused`}))})}function Y(){d.value.forEach(e=>{e.status===`paused`&&(f.delete(e.uid),j(e.uid,{status:`pending`}))}),q()}function X(e){let t=d.value.find(t=>t.uid===e);t&&t.status===`error`&&(j(e,{status:`pending`,percent:0,error:void 0}),U(t))}function Z(){return d.value.filter(e=>e.status===`success`||e.status===`instant`)}return p(()=>{x.abortAll(),w(),T.abortAll(),E.abortAll(),m.clear(),d.value.forEach(e=>{L(e.thumbUrl)})}),{fileList:d,replaceFileList:P,totalPercent:D,hashing:_,hashProgress:y,addFiles:A,removeFile:N,clearAll:F,startUpload:q,pauseAll:J,resumeAll:Y,retryFile:X,processFile:U,getSuccessList:Z}}function q(e,t,n,r,i){let a=v(!1),o=null,s=!1;function c(e){t.value&&(e.preventDefault(),a.value=!0)}function l(e){t.value&&(e.preventDefault(),a.value=!0)}function u(n){if(!t.value)return;n.preventDefault();let r=e.value;r&&!r.contains(n.relatedTarget)&&(a.value=!1)}async function d(e){if(!t.value)return;e.preventDefault(),a.value=!1;let n=e.dataTransfer?.items;if(!n)return;let o=await J(n,e.dataTransfer);if(s||!t.value)return;let c=X(o,r.value);c.length>0&&i(c)}function f(e){if(!n.value)return;let t=e.clipboardData?.items;if(!t)return;let a=[];for(let e=0;e<t.length;e++){let n=t[e];if(n.kind===`file`){let e=n.getAsFile();e&&a.push(e)}}let o=X(a,r.value);o.length>0&&(e.preventDefault(),i(o))}function h(){let t=e.value;!t||o===t||(o=t,t.addEventListener(`dragenter`,c),t.addEventListener(`dragover`,l),t.addEventListener(`dragleave`,u),t.addEventListener(`drop`,d),n.value&&t.addEventListener(`paste`,f))}function g(){let e=o;e&&(e.removeEventListener(`dragenter`,c),e.removeEventListener(`dragover`,l),e.removeEventListener(`dragleave`,u),e.removeEventListener(`drop`,d)),e?.removeEventListener(`paste`,f),o=null}return m(()=>{s=!1,h()}),p(()=>{s=!0,g()}),C([e,t,n],()=>{g(),h()}),{isDragOver:_(a)}}async function J(e,t){let n=[];for(let t=0;t<e.length;t++){let r=e[t].webkitGetAsEntry?.();r&&n.push(r)}if(n.length>0)return(await Promise.all(n.map(Y))).flat();let r=[],i=t?.files;if(i)for(let e=0;e<i.length;e++)r.push(i[e]);return r}async function Y(e){if(e.isFile)return new Promise(t=>{e.file(e=>t([e]),()=>t([]))});if(e.isDirectory){let t=e.createReader(),n=[];for(;;){let e=await new Promise(e=>{t.readEntries(t=>e(t),()=>e([]))});if(e.length===0)break;n.push(...e)}return(await Promise.all(n.map(Y))).flat()}return[]}function X(e,t){if(!t)return e;let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);return n.length===0?e:e.filter(e=>n.some(t=>{if(t.startsWith(`.`))return e.name.toLowerCase().endsWith(t);if(t.endsWith(`/*`)){let n=t.replace(`/*`,``);return e.type.toLowerCase().startsWith(`${n}/`)}return e.type.toLowerCase()===t}))}const Z=[`tabindex`,`aria-disabled`,`onKeydown`],ee=[`accept`,`multiple`,`webkitdirectory`,`disabled`],Q={class:`upload-area__default`},te={class:`upload-area__text`},ne={key:0},re={key:1},ie={key:0,class:`upload-area__tip`};var ae=t(d({__name:`UploadArea`,props:{accept:{default:``},multiple:{type:Boolean,default:!1},directory:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},pasteable:{type:Boolean,default:!1},tip:{default:``}},emits:[`files`],setup(t,{expose:r,emit:a}){let d=t,p=a,m=v(),g=v(),{isDragOver:_}=q(m,i(()=>d.draggable&&!d.disabled),i(()=>d.pasteable&&!d.disabled),i(()=>d.accept),e=>p(`files`,e));function y(){d.disabled||g.value?.click()}function C(e){let t=e.target,n=d.disabled?[]:X(Array.from(t.files??[]),d.accept);n.length>0&&p(`files`,n),t.value=``}return r({triggerSelect:y}),(r,i)=>(h(),s(`div`,{ref_key:`areaRef`,ref:m,class:f([`upload-area`,{"upload-area--drag-over":S(_),"upload-area--disabled":t.disabled}]),role:`button`,tabindex:t.disabled?-1:0,"aria-disabled":t.disabled,onClick:y,onKeydown:[T(E(y,[`prevent`]),[`enter`]),T(E(y,[`prevent`]),[`space`])]},[c(`input`,{ref_key:`inputRef`,ref:g,type:`file`,class:`upload-area__input`,accept:t.accept,multiple:t.multiple,webkitdirectory:t.directory||void 0,disabled:t.disabled,onClick:i[0]||=E(()=>{},[`stop`]),onChange:C},null,40,ee),b(r.$slots,`default`,{},()=>[c(`div`,Q,[u(e,{name:S(_)?`mdi:cloud-download-outline`:`mdi:cloud-upload-outline`,class:`upload-area__icon`},null,8,[`name`]),c(`div`,te,[S(_)?(h(),s(`span`,ne,`释放文件到此处`)):(h(),s(`span`,re,[i[4]||=l(` 点击或拖拽文件到此区域上传 `,-1),t.pasteable?(h(),s(n,{key:0},[i[1]||=l(` ,支持 `,-1),i[2]||=c(`kbd`,null,`Ctrl+V`,-1),i[3]||=l(` 粘贴 `,-1)],64)):o(`v-if`,!0)]))]),t.tip?(h(),s(`div`,ie,x(t.tip),1)):o(`v-if`,!0)])],!0)],42,Z))}}),[[`__scopeId`,`data-v-705892ab`]]);const oe={class:`file-list__thumb`},se=[`src`,`alt`],ce={class:`file-list__info`},le={class:`file-list__name`},ue={class:`file-list__meta`},de={class:`file-list__size`},fe={key:0,class:`file-list__instant`},pe={key:1,class:`file-list__chunk-info`},me={key:2,class:`file-list__error`},he={class:`file-list__actions`};var ge=t(d({__name:`FileList`,props:{fileList:{},showThumbnail:{type:Boolean},disabled:{type:Boolean}},emits:[`remove`,`retry`],setup(t,{emit:i}){let d=i;return(i,p)=>(h(),a(r,{name:`file-list`,tag:`div`,class:`file-list`},{default:w(()=>[(h(!0),s(n,null,y(t.fileList,n=>(h(),s(`div`,{key:n.uid,class:f([`file-list__item`,`file-list__item--${n.status}`])},[o(` 缩略图 / 图标 `),c(`div`,oe,[t.showThumbnail&&n.thumbUrl?(h(),s(`img`,{key:0,src:n.thumbUrl,alt:n.name,class:`file-list__thumb-img`},null,8,se)):(h(),a(e,{key:1,name:S(I)(n.type),class:`file-list__thumb-icon`},null,8,[`name`]))]),o(` 文件信息 `),c(`div`,ce,[c(`div`,le,[u(S(O),{"line-clamp":1},{default:w(()=>[l(x(n.name),1)]),_:2},1024)]),c(`div`,ue,[c(`span`,de,x(S(L)(n.size)),1),u(S(A),{type:S(P)[n.status]||`default`,size:`tiny`,bordered:!1},{default:w(()=>[l(x(S(N)[n.status]||n.status),1)]),_:2},1032,[`type`]),n.status===`instant`?(h(),s(`span`,fe,` ⚡ `)):o(`v-if`,!0)]),o(` 进度条 `),n.status===`uploading`||n.status===`hashing`?(h(),a(S(k),{key:0,percentage:n.percent,height:4,"border-radius":2,"show-indicator":!1,status:n.status===`hashing`?`info`:`success`},null,8,[`percentage`,`status`])):o(`v-if`,!0),o(` 分片进度描述 `),n.chunkProgress&&n.status===`uploading`?(h(),s(`div`,pe,` 分片 `+x(n.chunkProgress.uploadedChunks)+`/`+x(n.chunkProgress.totalChunks),1)):o(`v-if`,!0),o(` 错误信息 `),n.status===`error`&&n.error?(h(),s(`div`,me,x(n.error),1)):o(`v-if`,!0)]),o(` 操作按钮 `),c(`div`,he,[n.status===`error`?(h(),a(S(D),{key:0,text:``,type:`warning`,size:`tiny`,disabled:t.disabled,"aria-label":`重试上传`,onClick:e=>d(`retry`,n.uid)},{icon:w(()=>[u(e,{name:`mdi:refresh`})]),_:1},8,[`disabled`,`onClick`])):o(`v-if`,!0),u(S(D),{text:``,type:`error`,size:`tiny`,disabled:t.disabled,"aria-label":`移除文件`,onClick:e=>d(`remove`,n.uid)},{icon:w(()=>[u(e,{name:`mdi:close`})]),_:1},8,[`disabled`,`onClick`])])],2))),128))]),_:1}))}}),[[`__scopeId`,`data-v-c84ef261`]]);const _e={key:0,class:`image-preview`},ve=[`src`,`alt`],$={class:`image-preview__overlay`},ye={key:0,class:`image-preview__progress`},be={class:`image-preview__actions`},xe={class:`image-preview__name`};var Se=t(d({__name:`ImagePreview`,props:{fileList:{},disabled:{type:Boolean}},emits:[`remove`,`retry`],setup(t,{emit:r}){let d=t,p=r,m=i(()=>d.fileList.filter(e=>e.type?.startsWith(`image/`)));return(r,i)=>m.value.length>0?(h(),s(`div`,_e,[(h(!0),s(n,null,y(m.value,r=>(h(),s(`div`,{key:r.uid,class:f([`image-preview__item`,`image-preview__item--${r.status}`])},[r.thumbUrl?(h(),s(`img`,{key:0,src:r.thumbUrl,alt:r.name,class:`image-preview__img`},null,8,ve)):o(`v-if`,!0),o(` 遮罩层 `),c(`div`,$,[o(` 上传中进度 `),r.status===`uploading`||r.status===`hashing`?(h(),s(`div`,ye,[u(S(k),{type:`circle`,percentage:r.percent,"stroke-width":3,style:{width:`40px`}},null,8,[`percentage`])])):r.status===`success`||r.status===`instant`?(h(),s(n,{key:1},[o(` 状态图标 `),u(e,{name:`mdi:check-circle`,class:`image-preview__status-icon image-preview__status-icon--success`})],2112)):r.status===`error`?(h(),a(e,{key:2,name:`mdi:alert-circle`,class:`image-preview__status-icon image-preview__status-icon--error`})):o(`v-if`,!0),o(` 操作 `),c(`div`,be,[r.status===`error`?(h(),a(S(D),{key:0,circle:``,size:`tiny`,type:`warning`,disabled:t.disabled,"aria-label":`重试上传`,onClick:e=>p(`retry`,r.uid)},{icon:w(()=>[u(e,{name:`mdi:refresh`})]),_:1},8,[`disabled`,`onClick`])):o(`v-if`,!0),u(S(D),{circle:``,size:`tiny`,type:`error`,disabled:t.disabled,"aria-label":`移除文件`,onClick:e=>p(`remove`,r.uid)},{icon:w(()=>[u(e,{name:`mdi:close`})]),_:1},8,[`disabled`,`onClick`])])]),o(` 文件名 `),c(`div`,xe,[u(S(O),{"line-clamp":1},{default:w(()=>[l(x(r.name),1)]),_:2},1024)])],2))),128))])):o(`v-if`,!0)}}),[[`__scopeId`,`data-v-7c4d813a`]]);const Ce={class:`c-upload`},we={key:0,class:`c-upload__total-progress`},Te={class:`c-upload__total-label`};var Ee=t(d({__name:`index`,props:{action:{default:``},headers:{default:()=>({})},data:{default:()=>({})},multiple:{type:Boolean,default:!1},directory:{type:Boolean,default:!1},accept:{default:``},maxSize:{default:0},maxCount:{default:0},disabled:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},pasteable:{type:Boolean,default:!1},chunked:{type:Boolean,default:!1},chunkSize:{default:M},concurrency:{default:3},showFileList:{type:Boolean,default:!0},listType:{default:`text`},showThumbnail:{type:Boolean,default:!0},customRequest:{},instantCheck:{},uploadedChunksQuery:{},mergeChunks:{},beforeUpload:{},tip:{default:``},defaultFileList:{default:()=>[]}},emits:[`change`,`success`,`error`,`progress`,`remove`,`finish`,`exceed`],setup(e,{expose:t,emit:r}){let l=e,d=r,f=v(),{fileList:p,totalPercent:m,addFiles:g,removeFile:_,clearAll:y,replaceFileList:T,startUpload:E,pauseAll:D,resumeAll:O,retryFile:A,processFile:j,getSuccessList:M}=K(l),N=i(()=>p.value.some(e=>e.status===`uploading`||e.status===`hashing`||e.status===`validating`)),P=e=>({...e}),F=()=>p.value.map(P);function I(e){if(l.disabled)return;let t=Math.max(0,Math.trunc(Number(l.maxCount)||0));if(t>0&&p.value.length+e.length>t){d(`exceed`,e,F());let n=t-p.value.length;if(n<=0)return;e=e.slice(0,n)}let n=g(e);for(let e of n)z.set(e.uid,{status:e.status,percent:e.percent});n.forEach(e=>void j(e))}function L(e){if(l.disabled)return;let t=p.value.find(t=>t.uid===e);t&&(d(`remove`,P(t)),_(e))}function R(e){l.disabled||A(e)}let z=new Map(p.value.map(e=>[e.uid,{status:e.status,percent:e.percent}])),B=!1;return C(p,e=>{let t=new Set(e.map(e=>e.uid));z.forEach((e,n)=>{t.has(n)||z.delete(n)}),e.forEach(e=>{let t=z.get(e.uid);t&&t.percent!==e.percent&&d(`progress`,P(e),e.percent),t&&t.status!==e.status&&(e.status===`success`||e.status===`instant`)&&d(`success`,P(e),e.response),t&&t.status!==`error`&&e.status===`error`&&d(`error`,P(e),Error(e.error||`上传失败`)),z.set(e.uid,{status:e.status,percent:e.percent})}),e.length>0&&e.every(e=>e.status===`success`||e.status===`instant`||e.status===`error`)?(B||d(`finish`,F()),B=!0):B=!1,d(`change`,F())},{deep:!0}),t({selectFiles:()=>f.value?.triggerSelect(),startUpload:()=>{l.disabled||E()},pauseAll:D,resumeAll:()=>{l.disabled||O()},clearAll:y,replaceFileList:e=>{z.clear(),B=!0,T(e)},removeFile:L,retryFile:R,getFileList:F,getSuccessList:()=>M().map(P),get totalPercent(){return m.value}}),(e,t)=>(h(),s(`div`,Ce,[o(` 上传区域 `),u(ae,{ref_key:`uploadAreaRef`,ref:f,accept:l.accept,multiple:l.multiple,directory:l.directory,disabled:l.disabled,draggable:l.draggable,pasteable:l.pasteable,tip:l.tip,onFiles:I},{default:w(()=>[b(e.$slots,`area`,{},void 0,!0)]),_:3},8,[`accept`,`multiple`,`directory`,`disabled`,`draggable`,`pasteable`,`tip`]),o(` 总进度条 `),N.value?(h(),s(`div`,we,[c(`div`,Te,[t[0]||=c(`span`,null,`总进度`,-1),c(`span`,null,x(S(m))+`%`,1)]),u(S(k),{percentage:S(m),height:6,"border-radius":3,"show-indicator":!1,status:`success`},null,8,[`percentage`])])):o(`v-if`,!0),o(` 图片预览模式 `),l.listType===`image`?(h(),a(Se,{key:1,"file-list":S(p),disabled:l.disabled,onRemove:L,onRetry:R},null,8,[`file-list`,`disabled`])):l.showFileList&&S(p).length>0?(h(),s(n,{key:2},[o(` 文件列表模式 `),u(ge,{"file-list":S(p),"show-thumbnail":l.showThumbnail,disabled:l.disabled,onRemove:L,onRetry:R},null,8,[`file-list`,`show-thumbnail`,`disabled`])],2112)):o(`v-if`,!0)]))}}),[[`__scopeId`,`data-v-ae40e281`]]);export{V as a,I as c,W as i,q as n,B as o,K as r,L as s,Ee as t};
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,TransitionGroup as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,normalizeClass as f,onBeforeUnmount as p,onMounted as m,openBlock as h,reactive as g,readonly as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,unref as S,watch as C,withCtx as w,withKeys as T,withModifiers as E}from"vue";import{NButton as D,NEllipsis as O,NProgress as k,NTag as A}from"naive-ui";import j from"spark-md5";const M=2*1024*1024,N={pending:`等待上传`,validating:`校验文件…`,hashing:`计算校验…`,uploading:`上传中…`,success:`上传成功`,error:`上传失败`,paused:`已暂停`,instant:`秒传成功`},P={pending:`default`,validating:`info`,hashing:`info`,uploading:`info`,success:`success`,error:`error`,paused:`warning`,instant:`success`},F={"image/":`mdi:file-image-outline`,"video/":`mdi:file-video-outline`,"audio/":`mdi:file-music-outline`,"application/pdf":`mdi:file-pdf-box`,"application/zip":`mdi:folder-zip-outline`,"application/x-rar":`mdi:folder-zip-outline`,"application/vnd.ms-excel":`mdi:file-excel-outline`,"application/vnd.openxmlformats-officedocument.spreadsheetml":`mdi:file-excel-outline`,"application/msword":`mdi:file-word-outline`,"application/vnd.openxmlformats-officedocument.wordprocessingml":`mdi:file-word-outline`,"text/":`mdi:file-document-outline`,default:`mdi:file-outline`};function I(e){for(let[t,n]of Object.entries(F))if(t!==`default`&&e.startsWith(t))return n;return F.default}function L(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n>0?1:0)} ${t[n]}`}function R(e){let t=[],n=new Set,r=0,i=!1,a=()=>{if(!i){i=!0;try{let n=Math.max(1,Math.trunc(e.value)||1);for(;r<n&&t.length;)t.shift()()}finally{i=!1}}};return C(e,a),Object.assign((e,i)=>{let o=!1,s=!1,c,l=(e=!0)=>o?!1:(o=!0,n.delete(d),s&&--r,e&&a(),!0),u=()=>{if(!o){s=!0,r+=1;try{c=e({...i,onProgress:e=>{o||i.onProgress?.(e)},onSuccess:e=>{l()&&i.onSuccess?.(e)},onError:e=>{l()&&i.onError?.(e)}})}catch(e){l()&&i.onError?.(e instanceof Error?e:Error(String(e)))}}},d=()=>{let e=t.indexOf(u);if(e>=0&&t.splice(e,1),l(!1))try{c?.abort()}catch{}finally{a()}};return n.add(d),t.push(u),a(),{abort:d}},{abortAll(){let e=i;i=!0,t.length=0;try{for(let e of n)e()}finally{i=e}}})}const z=e=>new Promise((t,n)=>{let r,i,a=()=>{e?.removeEventListener(`abort`,o),r!==void 0&&cancelAnimationFrame(r),i!==void 0&&clearTimeout(i)},o=()=>{a(),n(e?.reason??new DOMException(`Hash cancelled`,`AbortError`))},s=()=>{a(),t()};if(e?.addEventListener(`abort`,o,{once:!0}),e?.aborted){o();return}typeof requestAnimationFrame==`function`?r=requestAnimationFrame(s):i=setTimeout(s,0)});function B(e){let t=v(0),n=v(0),r=i(()=>t.value>0),a=Promise.resolve();async function o(e,t,n){let r=a,i;a=new Promise(e=>{i=e}),await r;try{return await s(e,t,n)}finally{i()}}async function s(r,i,a){a?.throwIfAborted(),t.value+=1,n.value=0,i?.(0);let o=new j.ArrayBuffer,s=Math.max(1,Math.trunc(Number(e.value)||1)),c=Math.max(1,Math.ceil(r.size/s));try{for(let e=0;e<c;e+=1){a?.throwIfAborted();let t=e*s,l=await r.slice(t,t+s).arrayBuffer();a?.throwIfAborted(),o.append(l),n.value=Math.round((e+1)/c*100),i?.(n.value),await z(a)}return a?.throwIfAborted(),o.end()}finally{t.value=Math.max(0,t.value-1)}}return{hashing:r,hashProgress:_(n),calculateHash:o}}function V(e){let t=new Map,n=new Map;function r(t){let n=Math.max(1,Math.trunc(Number(e.chunkSize.value)||1)),r=[],i=0,a=0;for(;a<t.size;){let e=Math.min(a+n,t.size);r.push({index:i,blob:t.slice(a,e),size:e-a,uploaded:!1}),a=e,i++}return r}async function i(t,n){if(e.uploadedChunksQuery?.value)try{let r=await e.uploadedChunksQuery.value(t);for(let e of r){let t=n[e];t&&(t.uploaded=!0)}}catch{}}function a(t){return new Promise((n,r)=>{let i=!1,a=()=>{i||(i=!0,n())},o=e=>{i||(i=!0,t.setError(),r(e instanceof Error?e:Error(String(e))))},s={action:e.action.value,headers:e.headers.value,data:{...e.data.value,hash:t.hash,chunkIndex:t.chunk.index,totalChunks:t.totalChunks,filename:t.file.name},file:t.chunk.blob,filename:t.file.name,hash:t.hash,chunkIndex:t.chunk.index,totalChunks:t.totalChunks,onProgress:()=>{},onSuccess:()=>{if(!i){if(t.isCancelled()){a();return}t.chunk.uploaded=!0,t.setUploadedBytes(t.chunk.size),t.onProgress({uploadedChunks:t.chunks.filter(e=>e.uploaded).length,totalChunks:t.totalChunks,uploadedBytes:t.chunks.filter(e=>e.uploaded).reduce((e,t)=>e+t.size,0),totalBytes:t.totalBytes}),a()}},onError:o};try{let n=e.customRequest?.value??H,r=e.scheduler?e.scheduler(n,s):n(s);t.abortControllers.push(()=>{try{r.abort()}catch{}finally{a()}})}catch(e){o(e)}})}async function o(o){let{uid:c,file:l,hash:u,onProgress:d,onSuccess:f,onError:p,isPaused:m}=o,h=Symbol(c);n.set(c,h);let g=()=>n.get(c)!==h,_=()=>{g()||n.delete(c)},v=r(l),y=v.length,b=l.size,x=0;if(await i(u,v),g()||m()){_();return}x=v.filter(e=>e.uploaded).reduce((e,t)=>e+t.size,0),d({uploadedChunks:v.filter(e=>e.uploaded).length,totalChunks:y,uploadedBytes:x,totalBytes:b});let S=v.filter(e=>!e.uploaded);if(S.length===0){try{g()||await s(u,l.name,y,f,p,g)}finally{_()}return}let C=[];t.set(c,C);let w=Math.max(1,Math.trunc(Number(e.concurrency.value)||1)),T=0,E=!1;async function D(){for(;T<S.length&&!E&&!m()&&!g();){let e=S[T++];await a({chunk:e,hash:u,file:l,totalChunks:y,chunks:v,totalBytes:b,abortControllers:C,onProgress:e=>{g()||d(e)},setUploadedBytes:e=>{x+=e},setError:()=>{E=!0},isCancelled:g})}}let O=Array.from({length:Math.min(w,S.length)},()=>D());try{let e=(await Promise.allSettled(O)).find(e=>e.status===`rejected`);e&&!g()?p(e.reason instanceof Error?e.reason:Error(String(e.reason))):!E&&!m()&&!g()&&await s(u,l.name,y,f,p,g)}finally{g()||t.delete(c),_()}}async function s(t,n,r,i,a,o){if(e.mergeChunks?.value)try{let a=await e.mergeChunks.value(t,n,r);o()||i(a)}catch(e){o()||a(e instanceof Error?e:Error(`分片合并失败`))}else o()||i({message:`分片上传完成(未配置合并函数)`})}function c(e){n.delete(e),t.get(e)?.forEach(e=>e()),t.delete(e)}function l(){n.clear(),t.forEach(e=>{e.forEach(e=>e())}),t.clear()}return{createChunks:r,uploadChunks:o,abortUpload:c,abortAll:l}}function H(e){let t=new XMLHttpRequest;t.open(`POST`,e.action),e.headers&&Object.entries(e.headers).forEach(([e,n])=>{t.setRequestHeader(e,n)}),t.upload.addEventListener(`progress`,t=>{t.lengthComputable&&e.onProgress?.(Math.round(t.loaded/t.total*100))}),t.addEventListener(`load`,()=>{if(t.status>=200&&t.status<300){let n;try{n=JSON.parse(t.responseText)}catch{n=t.responseText}e.onSuccess?.(n)}else e.onError?.(Error(`上传失败: HTTP ${t.status}`))}),t.addEventListener(`error`,()=>{e.onError?.(Error(`网络错误`))}),t.addEventListener(`abort`,()=>{e.onError?.(new DOMException(`上传已取消`,`AbortError`))});let n=new FormData;return n.append(`file`,e.file,e.filename),e.data&&Object.entries(e.data).forEach(([e,t])=>{n.append(e,String(t))}),t.send(n),{abort:()=>t.abort()}}function U(e){return e instanceof Error?e:Error(String(e))}function W(e){let t=[],n=v(0),r=new Map,i=()=>{n.value=r.size},a=()=>Math.max(1,Math.trunc(Number(e.concurrency.value)||1));function o(){for(;r.size<a()&&t.length>0;){let n=t.shift(),{file:a}=n;if(!a.raw||r.has(a.uid))continue;let s=!1,c=e=>{s||(s=!0,r.delete(a.uid),i(),e?.error?n.onError(a.uid,e.error):e&&`response`in e&&n.onSuccess(a.uid,e.response),o())},l={action:e.action.value,headers:e.headers.value,data:e.data.value,file:a.raw,filename:a.name,onProgress:e=>n.onProgress(a.uid,e),onSuccess:e=>c({response:e}),onError:e=>c({error:e})};r.set(a.uid,{abort:()=>void 0,settle:c}),i();try{let t=e.customRequest?.value??G,n=e.scheduler?e.scheduler(t,l):t(l),i=r.get(a.uid);i&&(i.abort=n.abort)}catch(e){c({error:U(e)})}}}function s(e,n,r,i){c(e.uid),t.push({file:e,onProgress:n,onSuccess:r,onError:i}),o()}function c(e){for(let n=t.length-1;n>=0;--n)t[n].file.uid===e&&t.splice(n,1);let n=r.get(e);if(n){n.settle();try{n.abort()}catch{}}}function l(){t.length=0;let e=[...r.values()];r.clear(),i(),e.forEach(e=>{e.settle();try{e.abort()}catch{}})}return C(e.concurrency,o),{activeCount:_(n),enqueue:s,abort:c,abortAll:l}}function G(e){let t=new XMLHttpRequest;t.open(`POST`,e.action),Object.entries(e.headers??{}).forEach(([e,n])=>{t.setRequestHeader(e,n)}),t.upload.addEventListener(`progress`,t=>{t.lengthComputable&&e.onProgress?.(Math.round(t.loaded/t.total*100))}),t.addEventListener(`load`,()=>{if(t.status>=200&&t.status<300){let n=t.responseText;try{n=JSON.parse(t.responseText)}catch{}e.onSuccess?.(n)}else e.onError?.(Error(`上传失败: HTTP ${t.status}`))}),t.addEventListener(`error`,()=>e.onError?.(Error(`网络错误`)));let n=new FormData;return n.append(`file`,e.file,e.filename),Object.entries(e.data??{}).forEach(([e,t])=>{n.append(e,String(t))}),t.send(n),{abort:()=>t.abort()}}function K(e){let t=i(()=>e.action??``),n=i(()=>e.headers??{}),r=i(()=>e.data??{}),a=i(()=>{let t=Math.trunc(Number(e.chunkSize));return Number.isFinite(t)&&t>0?t:M}),o=i(()=>{let t=Math.trunc(Number(e.concurrency));return Number.isFinite(t)&&t>0?t:3}),s=i(()=>e.customRequest),c=i(()=>e.instantCheck),l=i(()=>e.uploadedChunksQuery),u=i(()=>e.mergeChunks),d=v((e.defaultFileList??[]).map(e=>({...e}))),f=g(new Set),m=new Map,h=new Set,{hashing:_,hashProgress:y,calculateHash:b}=B(a),x=R(o),S=new Map,C=e=>{S.get(e)?.abort(),S.delete(e)},w=()=>{S.forEach(e=>e.abort()),S.clear()},T=V({scheduler:x,chunkSize:a,concurrency:o,action:t,headers:n,data:r,customRequest:s,uploadedChunksQuery:l,mergeChunks:u}),E=W({scheduler:x,concurrency:o,action:t,headers:n,data:r,customRequest:s}),D=i(()=>{let e=d.value;if(e.length===0)return 0;let t=e.reduce((e,t)=>e+t.percent,0);return Math.round(t/e.length)});function O(){return typeof crypto<`u`&&`randomUUID`in crypto?`upload-${crypto.randomUUID()}`:`upload-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function k(e){if(e.type.startsWith(`image/`)){let t=URL.createObjectURL(e);return h.add(t),t}}function A(t){let n=[];for(let r of t){if(Number.isFinite(e.maxCount)&&(e.maxCount??0)>0&&d.value.length+n.length>=Math.trunc(e.maxCount))break;let t={uid:O(),name:r.name,size:r.size,type:r.type,status:`pending`,percent:0,raw:r,thumbUrl:k(r)};n.push(t)}return d.value.push(...n),n}function j(e,t){let n=d.value.find(t=>t.uid===e);n&&Object.assign(n,t)}function N(e){C(e),m.delete(e),T.abortUpload(e),E.abort(e),f.delete(e);let t=d.value.findIndex(t=>t.uid===e);if(t!==-1){let e=d.value[t];d.value.splice(t,1),e.thumbUrl&&h.has(e.thumbUrl)&&!d.value.some(t=>t.thumbUrl===e.thumbUrl)&&L(e.thumbUrl)}}function P(e){let t=e.map(e=>({...e})),n=new Set(t.map(e=>e.thumbUrl));m.clear(),x.abortAll(),w(),T.abortAll(),E.abortAll(),f.clear(),h.forEach(e=>{n.has(e)||L(e)}),d.value=t}function F(){P([])}async function I(t){if((e.maxSize??0)>0&&t.size>e.maxSize)return null;if(e.beforeUpload){let n=await e.beforeUpload(t);if(n===!1)return null;if(n instanceof File)return(e.maxSize??0)>0&&n.size>e.maxSize?null:n}return t}function L(e){!e||!h.has(e)||(URL.revokeObjectURL(e),h.delete(e))}function z(e,t){return m.get(e)===t&&!f.has(e)&&d.value.some(t=>t.uid===e)}async function H(e,t){C(e.uid);let n=new AbortController;S.set(e.uid,n);try{return await b(e.raw,n=>{z(e.uid,t)&&j(e.uid,{percent:n})},n.signal)}finally{S.get(e.uid)===n&&S.delete(e.uid)}}async function U(n){if(!n.raw)return;let r=Symbol(n.uid);m.set(n.uid,r),j(n.uid,{status:`validating`,error:void 0});let i;try{i=await I(n.raw)}catch(e){z(n.uid,r)&&j(n.uid,{status:`error`,error:e instanceof Error?e.message:`文件校验失败`});return}if(z(n.uid,r)){if(!i){j(n.uid,{status:`error`,error:`文件校验未通过`});return}if(i!==n.raw&&(L(n.thumbUrl),Object.assign(n,{raw:i,name:i.name,size:i.size,type:i.type,hash:void 0,chunkProgress:void 0,thumbUrl:k(i)})),!s.value&&!t.value.trim()){j(n.uid,{status:`error`,error:`未配置上传地址`});return}if(c.value&&!n.hash){j(n.uid,{status:`hashing`});try{let e=await H(n,r);if(!z(n.uid,r))return;j(n.uid,{hash:e});let t=await c.value(e,n.raw.name);if(!z(n.uid,r))return;if(t.exists){j(n.uid,{status:`instant`,percent:100,url:t.url});return}}catch{if(!z(n.uid,r))return}}e.chunked&&n.raw.size>a.value?await G(n,r):K(n,r)}}async function G(e,t){let n=e.raw,{hash:r}=e;if(!r){j(e.uid,{status:`hashing`});try{if(r=await H(e,t),!z(e.uid,t))return;j(e.uid,{hash:r})}catch{z(e.uid,t)&&j(e.uid,{status:`error`,error:`Hash 计算失败`});return}}j(e.uid,{status:`uploading`,percent:0}),await T.uploadChunks({uid:e.uid,file:n,hash:r,onProgress:n=>{if(!z(e.uid,t))return;let r=Math.round(n.uploadedBytes/n.totalBytes*100);j(e.uid,{percent:r,chunkProgress:n})},onSuccess:n=>{z(e.uid,t)&&j(e.uid,{status:`success`,percent:100,response:n})},onError:n=>{z(e.uid,t)&&j(e.uid,{status:`error`,error:n.message})},isPaused:()=>f.has(e.uid)})}function K(e,t){j(e.uid,{status:`uploading`,percent:0}),E.enqueue(e,(e,n)=>{z(e,t)&&j(e,{percent:n})},(e,n)=>{z(e,t)&&j(e,{status:`success`,percent:100,response:n})},(e,n)=>{z(e,t)&&j(e,{status:`error`,error:n.message})})}function q(){d.value.filter(e=>e.status===`pending`).forEach(e=>void U(e))}function J(){x.abortAll(),d.value.forEach(e=>{(e.status===`uploading`||e.status===`hashing`||e.status===`validating`)&&(C(e.uid),f.add(e.uid),m.set(e.uid,Symbol(e.uid)),T.abortUpload(e.uid),E.abort(e.uid),j(e.uid,{status:`paused`}))})}function Y(){d.value.forEach(e=>{e.status===`paused`&&(f.delete(e.uid),j(e.uid,{status:`pending`}))}),q()}function X(e){let t=d.value.find(t=>t.uid===e);t&&t.status===`error`&&(j(e,{status:`pending`,percent:0,error:void 0}),U(t))}function Z(){return d.value.filter(e=>e.status===`success`||e.status===`instant`)}return p(()=>{x.abortAll(),w(),T.abortAll(),E.abortAll(),m.clear(),d.value.forEach(e=>{L(e.thumbUrl)})}),{fileList:d,replaceFileList:P,totalPercent:D,hashing:_,hashProgress:y,addFiles:A,removeFile:N,clearAll:F,startUpload:q,pauseAll:J,resumeAll:Y,retryFile:X,processFile:U,getSuccessList:Z}}function q(e,t,n,r,i,a=v(!0)){let o=v(!1),s=null,c=0;function l(){c++,o.value=!1}function u(e){t.value&&(e.preventDefault(),o.value=!0)}function d(e){t.value&&(e.preventDefault(),o.value=!0)}function f(n){if(!t.value)return;n.preventDefault();let r=e.value;r&&!r.contains(n.relatedTarget)&&(o.value=!1)}async function h(e){if(!t.value)return;e.preventDefault(),o.value=!1;let n=e.dataTransfer;if(!n)return;let s=c,l=()=>s===c&&t.value,u=await J(n,a.value,l);if(!l())return;let d=X(u,r.value);d.length>0&&i(d)}function g(e){if(!n.value)return;let t=e.clipboardData?.items;if(!t)return;let a=[];for(let e=0;e<t.length;e++){let n=t[e];if(n.kind===`file`){let e=n.getAsFile();e&&a.push(e)}}let o=X(a,r.value);o.length>0&&(e.preventDefault(),i(o))}function y(){let t=e.value;!t||s===t||(s=t,t.addEventListener(`dragenter`,u),t.addEventListener(`dragover`,d),t.addEventListener(`dragleave`,f),t.addEventListener(`drop`,h),n.value&&t.addEventListener(`paste`,g))}function b(){let e=s;e&&(e.removeEventListener(`dragenter`,u),e.removeEventListener(`dragover`,d),e.removeEventListener(`dragleave`,f),e.removeEventListener(`drop`,h)),e?.removeEventListener(`paste`,g),s=null}return m(y),p(()=>{l(),b()}),C([e,t,a],l,{flush:`sync`}),C([e,n],()=>{b(),y()}),{isDragOver:_(o),invalidatePendingDrop:l}}async function J(e,t,n){let r=Array.from(e.items??[]),i=r.map(e=>e.webkitGetAsEntry?.());return i.some(Boolean)?(await Promise.all(r.map((e,r)=>{let a=i[r];if(a)return Y(a,t,n);let o=e.getAsFile?.();return o?[o]:[]}))).flat():Array.from(e.files??[])}async function Y(e,t,n){if(!n())return[];if(e.isFile)return new Promise(t=>{e.file(e=>t([e]),()=>t([]))});if(e.isDirectory&&t){let r=e.createReader(),i=[];for(;n();){let e=await new Promise(e=>{r.readEntries(t=>e(t),()=>e([]))});if(!n())return[];if(e.length===0)break;i.push(...e)}return(await Promise.all(i.map(e=>Y(e,t,n)))).flat()}return[]}function X(e,t){if(!t)return e;let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);return n.length===0?e:e.filter(e=>n.some(t=>{if(t.startsWith(`.`))return e.name.toLowerCase().endsWith(t);if(t.endsWith(`/*`)){let n=t.replace(`/*`,``);return e.type.toLowerCase().startsWith(`${n}/`)}return e.type.toLowerCase()===t}))}const Z=[`tabindex`,`aria-disabled`,`onKeydown`],ee=[`accept`,`multiple`,`webkitdirectory`,`disabled`],Q={class:`upload-area__default`},te={class:`upload-area__text`},ne={key:0},re={key:1},ie={key:0,class:`upload-area__tip`};var ae=t(d({__name:`UploadArea`,props:{accept:{default:``},multiple:{type:Boolean,default:!1},directory:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},pasteable:{type:Boolean,default:!1},tip:{default:``}},emits:[`files`],setup(t,{expose:r,emit:a}){let d=t,p=a,m=v(),g=v(),{isDragOver:_,invalidatePendingDrop:y}=q(m,i(()=>d.draggable&&!d.disabled),i(()=>d.pasteable&&!d.disabled),i(()=>d.accept),e=>p(`files`,e),i(()=>d.directory));function C(){d.disabled||g.value?.click()}function w(e){let t=e.target,n=d.disabled?[]:X(Array.from(t.files??[]),d.accept);n.length>0&&p(`files`,n),t.value=``}return r({triggerSelect:C,invalidatePendingDrop:y}),(r,i)=>(h(),s(`div`,{ref_key:`areaRef`,ref:m,class:f([`upload-area`,{"upload-area--drag-over":S(_),"upload-area--disabled":t.disabled}]),role:`button`,tabindex:t.disabled?-1:0,"aria-disabled":t.disabled,onClick:C,onKeydown:[T(E(C,[`prevent`]),[`enter`]),T(E(C,[`prevent`]),[`space`])]},[c(`input`,{ref_key:`inputRef`,ref:g,type:`file`,class:`upload-area__input`,accept:t.accept,multiple:t.multiple,webkitdirectory:t.directory||void 0,disabled:t.disabled,onClick:i[0]||=E(()=>{},[`stop`]),onChange:w},null,40,ee),b(r.$slots,`default`,{},()=>[c(`div`,Q,[u(e,{name:S(_)?`mdi:cloud-download-outline`:`mdi:cloud-upload-outline`,class:`upload-area__icon`},null,8,[`name`]),c(`div`,te,[S(_)?(h(),s(`span`,ne,`释放文件到此处`)):(h(),s(`span`,re,[i[4]||=l(` 点击或拖拽文件到此区域上传 `,-1),t.pasteable?(h(),s(n,{key:0},[i[1]||=l(` ,支持 `,-1),i[2]||=c(`kbd`,null,`Ctrl+V`,-1),i[3]||=l(` 粘贴 `,-1)],64)):o(`v-if`,!0)]))]),t.tip?(h(),s(`div`,ie,x(t.tip),1)):o(`v-if`,!0)])],!0)],42,Z))}}),[[`__scopeId`,`data-v-3db0c360`]]);const oe={class:`file-list__thumb`},se=[`src`,`alt`],ce={class:`file-list__info`},le={class:`file-list__name`},ue={class:`file-list__meta`},de={class:`file-list__size`},fe={key:0,class:`file-list__instant`},pe={key:1,class:`file-list__chunk-info`},me={key:2,class:`file-list__error`},he={class:`file-list__actions`};var ge=t(d({__name:`FileList`,props:{fileList:{},showThumbnail:{type:Boolean},disabled:{type:Boolean}},emits:[`remove`,`retry`],setup(t,{emit:i}){let d=i;return(i,p)=>(h(),a(r,{name:`file-list`,tag:`div`,class:`file-list`},{default:w(()=>[(h(!0),s(n,null,y(t.fileList,n=>(h(),s(`div`,{key:n.uid,class:f([`file-list__item`,`file-list__item--${n.status}`])},[o(` 缩略图 / 图标 `),c(`div`,oe,[t.showThumbnail&&n.thumbUrl?(h(),s(`img`,{key:0,src:n.thumbUrl,alt:n.name,class:`file-list__thumb-img`},null,8,se)):(h(),a(e,{key:1,name:S(I)(n.type),class:`file-list__thumb-icon`},null,8,[`name`]))]),o(` 文件信息 `),c(`div`,ce,[c(`div`,le,[u(S(O),{"line-clamp":1},{default:w(()=>[l(x(n.name),1)]),_:2},1024)]),c(`div`,ue,[c(`span`,de,x(S(L)(n.size)),1),u(S(A),{type:S(P)[n.status]||`default`,size:`tiny`,bordered:!1},{default:w(()=>[l(x(S(N)[n.status]||n.status),1)]),_:2},1032,[`type`]),n.status===`instant`?(h(),s(`span`,fe,` ⚡ `)):o(`v-if`,!0)]),o(` 进度条 `),n.status===`uploading`||n.status===`hashing`?(h(),a(S(k),{key:0,percentage:n.percent,height:4,"border-radius":2,"show-indicator":!1,status:n.status===`hashing`?`info`:`success`},null,8,[`percentage`,`status`])):o(`v-if`,!0),o(` 分片进度描述 `),n.chunkProgress&&n.status===`uploading`?(h(),s(`div`,pe,` 分片 `+x(n.chunkProgress.uploadedChunks)+`/`+x(n.chunkProgress.totalChunks),1)):o(`v-if`,!0),o(` 错误信息 `),n.status===`error`&&n.error?(h(),s(`div`,me,x(n.error),1)):o(`v-if`,!0)]),o(` 操作按钮 `),c(`div`,he,[n.status===`error`?(h(),a(S(D),{key:0,text:``,type:`warning`,size:`tiny`,disabled:t.disabled,"aria-label":`重试上传`,onClick:e=>d(`retry`,n.uid)},{icon:w(()=>[u(e,{name:`mdi:refresh`})]),_:1},8,[`disabled`,`onClick`])):o(`v-if`,!0),u(S(D),{text:``,type:`error`,size:`tiny`,disabled:t.disabled,"aria-label":`移除文件`,onClick:e=>d(`remove`,n.uid)},{icon:w(()=>[u(e,{name:`mdi:close`})]),_:1},8,[`disabled`,`onClick`])])],2))),128))]),_:1}))}}),[[`__scopeId`,`data-v-c84ef261`]]);const _e={key:0,class:`image-preview`},ve=[`src`,`alt`],ye={class:`image-preview__overlay`},$={key:0,class:`image-preview__progress`},be={class:`image-preview__actions`},xe={class:`image-preview__name`};var Se=t(d({__name:`ImagePreview`,props:{fileList:{},disabled:{type:Boolean}},emits:[`remove`,`retry`],setup(t,{emit:r}){let d=t,p=r,m=i(()=>d.fileList.filter(e=>e.type?.startsWith(`image/`)));return(r,i)=>m.value.length>0?(h(),s(`div`,_e,[(h(!0),s(n,null,y(m.value,r=>(h(),s(`div`,{key:r.uid,class:f([`image-preview__item`,`image-preview__item--${r.status}`])},[r.thumbUrl?(h(),s(`img`,{key:0,src:r.thumbUrl,alt:r.name,class:`image-preview__img`},null,8,ve)):o(`v-if`,!0),o(` 遮罩层 `),c(`div`,ye,[o(` 上传中进度 `),r.status===`uploading`||r.status===`hashing`?(h(),s(`div`,$,[u(S(k),{type:`circle`,percentage:r.percent,"stroke-width":3,style:{width:`40px`}},null,8,[`percentage`])])):r.status===`success`||r.status===`instant`?(h(),s(n,{key:1},[o(` 状态图标 `),u(e,{name:`mdi:check-circle`,class:`image-preview__status-icon image-preview__status-icon--success`})],2112)):r.status===`error`?(h(),a(e,{key:2,name:`mdi:alert-circle`,class:`image-preview__status-icon image-preview__status-icon--error`})):o(`v-if`,!0),o(` 操作 `),c(`div`,be,[r.status===`error`?(h(),a(S(D),{key:0,circle:``,size:`tiny`,type:`warning`,disabled:t.disabled,"aria-label":`重试上传`,onClick:e=>p(`retry`,r.uid)},{icon:w(()=>[u(e,{name:`mdi:refresh`})]),_:1},8,[`disabled`,`onClick`])):o(`v-if`,!0),u(S(D),{circle:``,size:`tiny`,type:`error`,disabled:t.disabled,"aria-label":`移除文件`,onClick:e=>p(`remove`,r.uid)},{icon:w(()=>[u(e,{name:`mdi:close`})]),_:1},8,[`disabled`,`onClick`])])]),o(` 文件名 `),c(`div`,xe,[u(S(O),{"line-clamp":1},{default:w(()=>[l(x(r.name),1)]),_:2},1024)])],2))),128))])):o(`v-if`,!0)}}),[[`__scopeId`,`data-v-7c4d813a`]]);const Ce={class:`c-upload`},we={key:0,class:`c-upload__total-progress`},Te={class:`c-upload__total-label`};var Ee=t(d({__name:`index`,props:{action:{default:``},headers:{default:()=>({})},data:{default:()=>({})},multiple:{type:Boolean,default:!1},directory:{type:Boolean,default:!1},accept:{default:``},maxSize:{default:0},maxCount:{default:0},disabled:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},pasteable:{type:Boolean,default:!1},chunked:{type:Boolean,default:!1},chunkSize:{default:M},concurrency:{default:3},showFileList:{type:Boolean,default:!0},listType:{default:`text`},showThumbnail:{type:Boolean,default:!0},customRequest:{},instantCheck:{},uploadedChunksQuery:{},mergeChunks:{},beforeUpload:{},tip:{default:``},defaultFileList:{default:()=>[]}},emits:[`change`,`success`,`error`,`progress`,`remove`,`finish`,`exceed`],setup(e,{expose:t,emit:r}){let l=e,d=r,f=v(),{fileList:p,totalPercent:m,addFiles:g,removeFile:_,replaceFileList:y,startUpload:T,pauseAll:E,resumeAll:D,retryFile:O,processFile:A,getSuccessList:j}=K(l),M=i(()=>p.value.some(e=>e.status===`uploading`||e.status===`hashing`||e.status===`validating`)),N=e=>({...e}),P=()=>p.value.map(N);function F(e){if(l.disabled)return;let t=l.multiple||l.directory?e:e.slice(0,1),n=Math.max(0,Math.trunc(Number(l.maxCount)||0)),r=n>0?n-p.value.length:t.length;if(t.length>r&&d(`exceed`,e,P()),r<=0)return;let i=g(t.length>r?t.slice(0,r):t);for(let e of i)R.set(e.uid,{status:e.status,percent:e.percent});i.forEach(e=>void A(e))}function I(e){if(l.disabled)return;let t=p.value.find(t=>t.uid===e);t&&(d(`remove`,N(t)),_(e))}function L(e){l.disabled||O(e)}let R=new Map(p.value.map(e=>[e.uid,{status:e.status,percent:e.percent}])),z=!1;C(p,e=>{let t=new Set(e.map(e=>e.uid));R.forEach((e,n)=>{t.has(n)||R.delete(n)}),e.forEach(e=>{let t=R.get(e.uid);t&&t.percent!==e.percent&&d(`progress`,N(e),e.percent),t&&t.status!==e.status&&(e.status===`success`||e.status===`instant`)&&d(`success`,N(e),e.response),t&&t.status!==`error`&&e.status===`error`&&d(`error`,N(e),Error(e.error||`上传失败`)),R.set(e.uid,{status:e.status,percent:e.percent})}),e.length>0&&e.every(e=>e.status===`success`||e.status===`instant`||e.status===`error`)?(z||d(`finish`,P()),z=!0):z=!1,d(`change`,P())},{deep:!0});function B(e){f.value?.invalidatePendingDrop(),R.clear(),z=!0,y(e)}return t({selectFiles:()=>f.value?.triggerSelect(),startUpload:()=>{l.disabled||T()},pauseAll:E,resumeAll:()=>{l.disabled||D()},clearAll:()=>B([]),replaceFileList:B,removeFile:I,retryFile:L,getFileList:P,getSuccessList:()=>j().map(N),get totalPercent(){return m.value}}),(e,t)=>(h(),s(`div`,Ce,[o(` 上传区域 `),u(ae,{ref_key:`uploadAreaRef`,ref:f,accept:l.accept,multiple:l.multiple,directory:l.directory,disabled:l.disabled,draggable:l.draggable,pasteable:l.pasteable,tip:l.tip,onFiles:F},{default:w(()=>[b(e.$slots,`area`,{},void 0,!0)]),_:3},8,[`accept`,`multiple`,`directory`,`disabled`,`draggable`,`pasteable`,`tip`]),o(` 总进度条 `),M.value?(h(),s(`div`,we,[c(`div`,Te,[t[0]||=c(`span`,null,`总进度`,-1),c(`span`,null,x(S(m))+`%`,1)]),u(S(k),{percentage:S(m),height:6,"border-radius":3,"show-indicator":!1,status:`success`},null,8,[`percentage`])])):o(`v-if`,!0),o(` 图片预览模式 `),l.listType===`image`?(h(),a(Se,{key:1,"file-list":S(p),disabled:l.disabled,onRemove:I,onRetry:L},null,8,[`file-list`,`disabled`])):l.showFileList&&S(p).length>0?(h(),s(n,{key:2},[o(` 文件列表模式 `),u(ge,{"file-list":S(p),"show-thumbnail":l.showThumbnail,disabled:l.disabled,onRemove:I,onRetry:L},null,8,[`file-list`,`show-thumbnail`,`disabled`])],2112)):o(`v-if`,!0)]))}}),[[`__scopeId`,`data-v-21e9fae3`]]);export{V as a,I as c,W as i,q as n,B as o,K as r,L as s,Ee as t};
|
package/dist/constants.d.cts
CHANGED
|
@@ -108,12 +108,12 @@ interface CronEmits {
|
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/C_Cron/index.vue.d.ts
|
|
110
110
|
declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
111
|
-
change: (value: string) => any;
|
|
112
111
|
"update:modelValue": (value: string) => any;
|
|
112
|
+
change: (value: string) => any;
|
|
113
113
|
"validation-change": (result: CronValidation) => any;
|
|
114
114
|
}, string, vue.PublicProps, Readonly<CronProps> & Readonly<{
|
|
115
|
-
onChange?: ((value: string) => any) | undefined;
|
|
116
115
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
116
|
+
onChange?: ((value: string) => any) | undefined;
|
|
117
117
|
"onValidation-change"?: ((result: CronValidation) => any) | undefined;
|
|
118
118
|
}>, {
|
|
119
119
|
disabled: boolean;
|
package/dist/constants.d.ts
CHANGED
|
@@ -108,12 +108,12 @@ interface CronEmits {
|
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/C_Cron/index.vue.d.ts
|
|
110
110
|
declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
111
|
-
change: (value: string) => any;
|
|
112
111
|
"update:modelValue": (value: string) => any;
|
|
112
|
+
change: (value: string) => any;
|
|
113
113
|
"validation-change": (result: CronValidation) => any;
|
|
114
114
|
}, string, vue.PublicProps, Readonly<CronProps> & Readonly<{
|
|
115
|
-
onChange?: ((value: string) => any) | undefined;
|
|
116
115
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
116
|
+
onChange?: ((value: string) => any) | undefined;
|
|
117
117
|
"onValidation-change"?: ((result: CronValidation) => any) | undefined;
|
|
118
118
|
}>, {
|
|
119
119
|
disabled: boolean;
|
package/dist/constants2.d.cts
CHANGED
|
@@ -125,12 +125,12 @@ interface FormulaEditorExpose {
|
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/components/C_FormulaEditor/index.vue.d.ts
|
|
127
127
|
declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEditorExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
128
|
-
change: (value: string) => any;
|
|
129
128
|
"update:modelValue": (value: string) => any;
|
|
129
|
+
change: (value: string) => any;
|
|
130
130
|
"validation-change": (result: FormulaValidation) => any;
|
|
131
131
|
}, string, vue.PublicProps, Readonly<FormulaEditorProps> & Readonly<{
|
|
132
|
-
onChange?: ((value: string) => any) | undefined;
|
|
133
132
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
133
|
+
onChange?: ((value: string) => any) | undefined;
|
|
134
134
|
"onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
|
|
135
135
|
}>, {
|
|
136
136
|
disabled: boolean;
|
package/dist/constants2.d.ts
CHANGED
|
@@ -125,12 +125,12 @@ interface FormulaEditorExpose {
|
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/components/C_FormulaEditor/index.vue.d.ts
|
|
127
127
|
declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEditorExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
128
|
-
change: (value: string) => any;
|
|
129
128
|
"update:modelValue": (value: string) => any;
|
|
129
|
+
change: (value: string) => any;
|
|
130
130
|
"validation-change": (result: FormulaValidation) => any;
|
|
131
131
|
}, string, vue.PublicProps, Readonly<FormulaEditorProps> & Readonly<{
|
|
132
|
-
onChange?: ((value: string) => any) | undefined;
|
|
133
132
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
133
|
+
onChange?: ((value: string) => any) | undefined;
|
|
134
134
|
"onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
|
|
135
135
|
}>, {
|
|
136
136
|
disabled: boolean;
|
package/dist/constants3.d.cts
CHANGED
|
@@ -231,8 +231,8 @@ interface NotificationCenterExpose {
|
|
|
231
231
|
type __VLS_Slots = NotificationCenterSlots;
|
|
232
232
|
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
233
233
|
delete: (ids: string[]) => any;
|
|
234
|
-
itemClick: (message: NotificationMessage) => any;
|
|
235
234
|
read: (ids: string[]) => any;
|
|
235
|
+
itemClick: (message: NotificationMessage) => any;
|
|
236
236
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
237
237
|
unreadChange: (count: number) => any;
|
|
238
238
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
@@ -241,8 +241,8 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
|
|
|
241
241
|
viewAll: () => any;
|
|
242
242
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
243
243
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
244
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
245
244
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
245
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
246
246
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
247
247
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
248
248
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
@@ -250,12 +250,12 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
|
|
|
250
250
|
onNavigate?: ((url: string) => any) | undefined;
|
|
251
251
|
onViewAll?: (() => any) | undefined;
|
|
252
252
|
}>, {
|
|
253
|
+
storageKey: string;
|
|
254
|
+
pageSize: number;
|
|
253
255
|
autoStart: boolean;
|
|
254
256
|
desktopNotification: boolean;
|
|
255
257
|
maxBadgeCount: number;
|
|
256
258
|
pollingInterval: number;
|
|
257
|
-
pageSize: number;
|
|
258
|
-
storageKey: string;
|
|
259
259
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
260
260
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
261
261
|
declare const _default: typeof __VLS_export;
|
package/dist/constants3.d.ts
CHANGED
|
@@ -231,8 +231,8 @@ interface NotificationCenterExpose {
|
|
|
231
231
|
type __VLS_Slots = NotificationCenterSlots;
|
|
232
232
|
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
233
233
|
delete: (ids: string[]) => any;
|
|
234
|
-
itemClick: (message: NotificationMessage) => any;
|
|
235
234
|
read: (ids: string[]) => any;
|
|
235
|
+
itemClick: (message: NotificationMessage) => any;
|
|
236
236
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
237
237
|
unreadChange: (count: number) => any;
|
|
238
238
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
@@ -241,8 +241,8 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
|
|
|
241
241
|
viewAll: () => any;
|
|
242
242
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
243
243
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
244
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
245
244
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
245
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
246
246
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
247
247
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
248
248
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
@@ -250,12 +250,12 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
|
|
|
250
250
|
onNavigate?: ((url: string) => any) | undefined;
|
|
251
251
|
onViewAll?: (() => any) | undefined;
|
|
252
252
|
}>, {
|
|
253
|
+
storageKey: string;
|
|
254
|
+
pageSize: number;
|
|
253
255
|
autoStart: boolean;
|
|
254
256
|
desktopNotification: boolean;
|
|
255
257
|
maxBadgeCount: number;
|
|
256
258
|
pollingInterval: number;
|
|
257
|
-
pageSize: number;
|
|
258
|
-
storageKey: string;
|
|
259
259
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
260
260
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
261
261
|
declare const _default: typeof __VLS_export;
|
package/dist/constants4.d.cts
CHANGED
|
@@ -198,25 +198,25 @@ type __VLS_Slots = {} & {
|
|
|
198
198
|
area?: (props: typeof __VLS_11) => any;
|
|
199
199
|
};
|
|
200
200
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
201
|
-
change: (fileList: UploadFileItem[]) => any;
|
|
202
201
|
error: (file: UploadFileItem, error: Error) => any;
|
|
202
|
+
change: (fileList: UploadFileItem[]) => any;
|
|
203
203
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
204
204
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
205
205
|
remove: (file: UploadFileItem) => any;
|
|
206
206
|
finish: (fileList: UploadFileItem[]) => any;
|
|
207
207
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
208
208
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
209
|
-
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
210
209
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
210
|
+
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
211
211
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
212
212
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
213
213
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
214
214
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
215
215
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
216
216
|
}>, {
|
|
217
|
-
data: Record<string, unknown>;
|
|
218
217
|
maxSize: number;
|
|
219
218
|
disabled: boolean;
|
|
219
|
+
data: Record<string, unknown>;
|
|
220
220
|
action: string;
|
|
221
221
|
headers: Record<string, string>;
|
|
222
222
|
multiple: boolean;
|
|
@@ -338,9 +338,11 @@ declare function useUploadCore(props: UploadProps): {
|
|
|
338
338
|
* @param pasteable 是否启用粘贴
|
|
339
339
|
* @param accept 文件类型限制
|
|
340
340
|
* @param onFiles 文件回调
|
|
341
|
+
* @param directory 是否遍历目录;独立 composable 保留原有默认行为
|
|
341
342
|
*/
|
|
342
|
-
declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled: Ref<boolean>, pasteable: Ref<boolean>, accept: Ref<string>, onFiles: (files: File[]) => void): {
|
|
343
|
-
|
|
343
|
+
declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled: Ref<boolean>, pasteable: Ref<boolean>, accept: Ref<string>, onFiles: (files: File[]) => void, directory?: Ref<boolean, boolean>): {
|
|
344
|
+
isDragOver: Readonly<Ref<boolean, boolean>>;
|
|
345
|
+
invalidatePendingDrop: () => void;
|
|
344
346
|
};
|
|
345
347
|
//#endregion
|
|
346
348
|
//#region src/components/C_Upload/composables/useFileHash.d.ts
|
package/dist/constants4.d.ts
CHANGED
|
@@ -198,25 +198,25 @@ type __VLS_Slots = {} & {
|
|
|
198
198
|
area?: (props: typeof __VLS_11) => any;
|
|
199
199
|
};
|
|
200
200
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
201
|
-
change: (fileList: UploadFileItem[]) => any;
|
|
202
201
|
error: (file: UploadFileItem, error: Error) => any;
|
|
202
|
+
change: (fileList: UploadFileItem[]) => any;
|
|
203
203
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
204
204
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
205
205
|
remove: (file: UploadFileItem) => any;
|
|
206
206
|
finish: (fileList: UploadFileItem[]) => any;
|
|
207
207
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
208
208
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
209
|
-
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
210
209
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
210
|
+
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
211
211
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
212
212
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
213
213
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
214
214
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
215
215
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
216
216
|
}>, {
|
|
217
|
-
data: Record<string, unknown>;
|
|
218
217
|
maxSize: number;
|
|
219
218
|
disabled: boolean;
|
|
219
|
+
data: Record<string, unknown>;
|
|
220
220
|
action: string;
|
|
221
221
|
headers: Record<string, string>;
|
|
222
222
|
multiple: boolean;
|
|
@@ -338,9 +338,11 @@ declare function useUploadCore(props: UploadProps): {
|
|
|
338
338
|
* @param pasteable 是否启用粘贴
|
|
339
339
|
* @param accept 文件类型限制
|
|
340
340
|
* @param onFiles 文件回调
|
|
341
|
+
* @param directory 是否遍历目录;独立 composable 保留原有默认行为
|
|
341
342
|
*/
|
|
342
|
-
declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled: Ref<boolean>, pasteable: Ref<boolean>, accept: Ref<string>, onFiles: (files: File[]) => void): {
|
|
343
|
-
|
|
343
|
+
declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled: Ref<boolean>, pasteable: Ref<boolean>, accept: Ref<string>, onFiles: (files: File[]) => void, directory?: Ref<boolean, boolean>): {
|
|
344
|
+
isDragOver: Readonly<Ref<boolean, boolean>>;
|
|
345
|
+
invalidatePendingDrop: () => void;
|
|
344
346
|
};
|
|
345
347
|
//#endregion
|
|
346
348
|
//#region src/components/C_Upload/composables/useFileHash.d.ts
|
package/dist/constants5.d.cts
CHANGED
|
@@ -262,8 +262,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
|
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/components/C_VideoPlayer/index.vue.d.ts
|
|
264
264
|
declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
265
|
-
error: (error: Error) => any;
|
|
266
265
|
ready: () => any;
|
|
266
|
+
error: (error: Error) => any;
|
|
267
267
|
ended: () => any;
|
|
268
268
|
stateChange: (state: PlayerState) => any;
|
|
269
269
|
qualityChange: (quality: QualityLevel) => any;
|
|
@@ -275,8 +275,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
|
|
|
275
275
|
quizAnswer: (quizId: string, answer: string | string[], isCorrect: boolean) => any;
|
|
276
276
|
timeUpdate: (currentTime: number, duration: number) => any;
|
|
277
277
|
}, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
|
|
278
|
-
onError?: ((error: Error) => any) | undefined;
|
|
279
278
|
onReady?: (() => any) | undefined;
|
|
279
|
+
onError?: ((error: Error) => any) | undefined;
|
|
280
280
|
onEnded?: (() => any) | undefined;
|
|
281
281
|
onStateChange?: ((state: PlayerState) => any) | undefined;
|
|
282
282
|
onQualityChange?: ((quality: QualityLevel) => any) | undefined;
|
package/dist/constants5.d.ts
CHANGED
|
@@ -262,8 +262,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
|
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/components/C_VideoPlayer/index.vue.d.ts
|
|
264
264
|
declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
265
|
-
error: (error: Error) => any;
|
|
266
265
|
ready: () => any;
|
|
266
|
+
error: (error: Error) => any;
|
|
267
267
|
ended: () => any;
|
|
268
268
|
stateChange: (state: PlayerState) => any;
|
|
269
269
|
qualityChange: (quality: QualityLevel) => any;
|
|
@@ -275,8 +275,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
|
|
|
275
275
|
quizAnswer: (quizId: string, answer: string | string[], isCorrect: boolean) => any;
|
|
276
276
|
timeUpdate: (currentTime: number, duration: number) => any;
|
|
277
277
|
}, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
|
|
278
|
-
onError?: ((error: Error) => any) | undefined;
|
|
279
278
|
onReady?: (() => any) | undefined;
|
|
279
|
+
onError?: ((error: Error) => any) | undefined;
|
|
280
280
|
onEnded?: (() => any) | undefined;
|
|
281
281
|
onStateChange?: ((state: PlayerState) => any) | undefined;
|
|
282
282
|
onQualityChange?: ((quality: QualityLevel) => any) | undefined;
|
package/dist/data2.d.cts
CHANGED
|
@@ -65,28 +65,28 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof _
|
|
|
65
65
|
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
+
"update:modelValue": (value: TabsValue) => any;
|
|
68
69
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
69
70
|
add: () => any;
|
|
70
|
-
"update:modelValue": (value: TabsValue) => any;
|
|
71
71
|
close: (value: TabsValue) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
+
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
73
74
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
74
75
|
onAdd?: (() => any) | undefined;
|
|
75
|
-
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
76
76
|
onClose?: ((value: TabsValue) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
type: TabsType;
|
|
79
|
-
animated: boolean;
|
|
80
78
|
size: TabsSize;
|
|
79
|
+
type: TabsType;
|
|
81
80
|
modelValue: TabsValue | null;
|
|
82
|
-
|
|
81
|
+
animated: boolean;
|
|
82
|
+
justifyContent: TabsJustifyContent;
|
|
83
83
|
defaultValue: TabsValue | null;
|
|
84
|
+
items: readonly TabsItem[];
|
|
84
85
|
placement: TabsPlacement;
|
|
85
|
-
displayDirective: TabsDisplayDirective;
|
|
86
|
-
justifyContent: TabsJustifyContent;
|
|
87
86
|
closable: boolean;
|
|
88
87
|
addable: boolean;
|
|
89
88
|
tabsOnly: boolean;
|
|
89
|
+
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/data2.d.ts
CHANGED
|
@@ -65,28 +65,28 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof _
|
|
|
65
65
|
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
+
"update:modelValue": (value: TabsValue) => any;
|
|
68
69
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
69
70
|
add: () => any;
|
|
70
|
-
"update:modelValue": (value: TabsValue) => any;
|
|
71
71
|
close: (value: TabsValue) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
+
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
73
74
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
74
75
|
onAdd?: (() => any) | undefined;
|
|
75
|
-
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
76
76
|
onClose?: ((value: TabsValue) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
type: TabsType;
|
|
79
|
-
animated: boolean;
|
|
80
78
|
size: TabsSize;
|
|
79
|
+
type: TabsType;
|
|
81
80
|
modelValue: TabsValue | null;
|
|
82
|
-
|
|
81
|
+
animated: boolean;
|
|
82
|
+
justifyContent: TabsJustifyContent;
|
|
83
83
|
defaultValue: TabsValue | null;
|
|
84
|
+
items: readonly TabsItem[];
|
|
84
85
|
placement: TabsPlacement;
|
|
85
|
-
displayDirective: TabsDisplayDirective;
|
|
86
|
-
justifyContent: TabsJustifyContent;
|
|
87
86
|
closable: boolean;
|
|
88
87
|
addable: boolean;
|
|
89
88
|
tabsOnly: boolean;
|
|
89
|
+
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|