@nice2dev/ui 1.1.9 → 1.2.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 +150 -0
- package/README.md +27 -34
- package/dist/NiceButton-5tWvfXKl.cjs +1 -0
- package/dist/NiceButton-DHSgQT1_.js +112 -0
- package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
- package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
- package/dist/NiceCodeEditor-BfkH1bsZ.cjs +260 -0
- package/dist/NiceCodeEditor-CduGYggj.js +1179 -0
- package/dist/NiceColorPicker-CdUnhM-A.cjs +1 -0
- package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
- package/dist/NiceColorPicker-DK30kJgy.js +486 -0
- package/dist/NiceColorPicker-DpXwnDwL.js +598 -0
- package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
- package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
- package/dist/NiceConfirmDialog-B7aNRL2K.cjs +1 -0
- package/dist/NiceConfirmDialog-BdhWenrO.js +81 -0
- package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
- package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
- package/dist/NiceDataGrid-CVYEo_nv.cjs +10 -0
- package/dist/NiceDataGrid-D-rm4lu8.js +2217 -0
- package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
- package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
- package/dist/NiceDocumentViewer-BgcgLWJ3.cjs +180 -0
- package/dist/NiceDocumentViewer-sukmGhRx.js +672 -0
- package/dist/NiceForm-BCEXovJR.cjs +1 -0
- package/dist/NiceForm-D7oyWHXg.js +4820 -0
- package/dist/NiceForm-DUhxXArr.js +4817 -0
- package/dist/NiceForm-DVc0Xoly.js +4819 -0
- package/dist/NiceForm-qD_RKPYz.cjs +1 -0
- package/dist/NiceForm-uCeVmTrD.cjs +1 -0
- package/dist/NiceGantt-4UBd4uJ8.cjs +1 -0
- package/dist/NiceGantt-B_1lwEsp.js +328 -0
- package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
- package/dist/NiceHtmlEditor-Bce9Vwe1.cjs +10 -0
- package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
- package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
- package/dist/NiceHtmlEditor-CGRgcu2h.js +848 -0
- package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
- package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
- package/dist/NiceLoginForm-BTuQ0eKk.cjs +1 -0
- package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
- package/dist/NiceLoginForm-o1A-TBcp.js +736 -0
- package/dist/NiceLoginForm.css +1 -0
- package/dist/NiceMention-CA7CL5BI.js +11263 -0
- package/dist/NiceMention-CHcKRl-L.cjs +430 -0
- package/dist/NiceMention-DJD0BLcp.js +11269 -0
- package/dist/NiceMention-DcaUEMSg.cjs +430 -0
- package/dist/NiceMention-Dds9GQzk.cjs +430 -0
- package/dist/NiceMention-DlLXWddO.js +11268 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-C4p8a82e.cjs +1 -0
- package/dist/NiceModal-Dr1e3nQZ.cjs +1 -0
- package/dist/NiceModal-TNlkaL_i.js +85 -0
- package/dist/NiceModal-sihGCfDy.js +95 -0
- package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
- package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-Du7G3-RG.js +7053 -0
- package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
- package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-js1p7LIY.cjs +1 -0
- package/dist/NicePagination-8XsBbMNx.js +165 -0
- package/dist/NicePagination-CkOoXf0f.js +165 -0
- package/dist/NicePagination-D44waj9o.cjs +1 -0
- package/dist/NicePagination-D7lek1G7.cjs +1 -0
- package/dist/NicePagination-DdxH8KMG.js +179 -0
- package/dist/NicePagination-OjTEfZJE.cjs +1 -0
- package/dist/NicePivotGrid-B2YHP3Z6.js +1183 -0
- package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
- package/dist/NicePivotGrid-BtVUWiud.cjs +152 -0
- package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
- package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
- package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
- package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
- package/dist/NiceSavedQueryPanel-C0A-eoYN.js +5142 -0
- package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
- package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
- package/dist/NiceSavedQueryPanel-ZrilZRtf.cjs +586 -0
- package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
- package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
- package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
- package/dist/NiceScheduler-KSzaUQxC.js +1693 -0
- package/dist/NiceScheduler-O3AwmdGG.cjs +5 -0
- package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
- package/dist/NiceSelect-BCbWtu1v.js +433 -0
- package/dist/NiceSelect-BqtiQbfD.cjs +1 -0
- package/dist/NiceSelect-DZB1Rs9x.js +435 -0
- package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
- package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
- package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
- package/dist/NiceWindow-BEov3s9F.js +2094 -0
- package/dist/NiceWindow-BU1Ce7gS.js +1623 -0
- package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
- package/dist/NiceWindow-jjdE6vGy.cjs +1 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-C047IMVn.cjs +768 -0
- package/dist/charts-C44vJber.cjs +768 -0
- package/dist/charts-CCXSb3xk.js +4752 -0
- package/dist/charts-CqETcUhH.js +4752 -0
- package/dist/charts-DouiiHOT.cjs +768 -0
- package/dist/charts-XVlDwU0y.js +4732 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +8 -8
- package/dist/core-BL-KmGYC.js +795 -0
- package/dist/core-BxiH7vkV.cjs +1 -0
- package/dist/core-Chg-oYCr.cjs +1 -0
- package/dist/core-CxBnKAhs.cjs +1 -0
- package/dist/core-DMV6_SEE.js +795 -0
- package/dist/core-D_LRh59n.js +795 -0
- package/dist/data-branching-Km4lc8P_.cjs +1 -0
- package/dist/data-branching-YQtJJEtn.js +6273 -0
- package/dist/data-branching-oEH04O3i.js +6273 -0
- package/dist/data-branching-wmsbLNfa.cjs +1 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +2 -53
- package/dist/data.mjs +3 -3
- package/dist/devops-Bt6EsfPa.cjs +17 -0
- package/dist/devops-CnZQ1rU5.js +8312 -0
- package/dist/devops-D5yIDM3e.js +8312 -0
- package/dist/devops-rVpB0ZAX.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +8 -26
- package/dist/editors.mjs +55 -54
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +290 -290
- package/dist/index.css +1 -1
- package/dist/index.d.ts +239 -234
- package/dist/index.mjs +20262 -19440
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +29 -29
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +69 -69
- package/dist/no-code-4GtIBr6f.js +7503 -0
- package/dist/no-code-6WyYb3hL.cjs +331 -0
- package/dist/no-code-BH5oVFC6.js +8186 -0
- package/dist/no-code-Bdwh1vyS.cjs +332 -0
- package/dist/no-code-CnHG5_Vn.js +8186 -0
- package/dist/no-code-DMKlg1Zl.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.css +1 -1
- package/dist/no-code.d.ts +25 -18
- package/dist/no-code.mjs +3 -3
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +24 -24
- package/dist/overlays.mjs +24 -490
- package/dist/pickerCommons-0vyK1Knv.js +547 -0
- package/dist/pickerCommons-31hyz1gs.js +1122 -0
- package/dist/pickerCommons-BFbItm8o.cjs +1 -0
- package/dist/pickerCommons-BHirHJyn.js +548 -0
- package/dist/pickerCommons-BifIkPdk.cjs +1 -0
- package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +10 -7
- package/package.json +5 -7
- package/css/legacy-bg-text-aliases.css +0 -87
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("@nice2dev/ui-core"),n=require("react");function ve(t,r){const i=t.split(".").pop()?.toLowerCase().split("?")[0]??"";return i==="pdf"?"pdf":["jpg","jpeg","png","gif","bmp","webp","svg","ico","tiff","tif"].includes(i)?"image":["mp4","webm","ogg","mov","avi","mkv"].includes(i)?"video":["mp3","wav","flac","aac","m4a","ogg"].includes(i)?"audio":["doc","docx","xls","xlsx","ppt","pptx","odt","ods","odp"].includes(i)?"office":i==="html"||i==="htm"?"html":["txt","log","md","json","xml","csv","yaml","yml"].includes(i)?"text":"unknown"}function ge(t){if(t===0)return"0 B";const r=1024,i=["B","KB","MB","GB"],o=Math.floor(Math.log(t)/Math.log(r));return parseFloat((t/Math.pow(r,o)).toFixed(1))+" "+i[o]}function we(t){const r=Math.floor(t/3600),i=Math.floor(t%3600/60),o=Math.floor(t%60);return r>0?`${r}:${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${i}:${o.toString().padStart(2,"0")}`}function xe({src:t,page:r,zoom:i,rotation:o,onPageChange:m,onLoad:s,onError:p,workerUrl:u}){const h=n.useRef(null),y=n.useRef(null),[g,B]=n.useState(0),[R,T]=n.useState(!1);return n.useEffect(()=>{let x=!1;return(async()=>{try{let l;if(l=window.pdfjsLib,!l)try{l=await new Function("m","return import(m)")("pdfjs-dist")}catch{throw new Error('PDF.js library not found. Please install pdfjs-dist or include it via CDN: <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"><\/script>')}u?l.GlobalWorkerOptions.workerSrc=u:l.version&&(l.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${l.version}/pdf.worker.min.js`);const w=await l.getDocument(t).promise;if(x)return;y.current=w,B(w.numPages),s({name:t.split("/").pop()??"document.pdf",type:"pdf",mimeType:"application/pdf",pageCount:w.numPages})}catch(l){x||p(l instanceof Error?l:new Error("Failed to load PDF"))}})(),()=>{x=!0}},[t,u,s,p]),n.useEffect(()=>{const x=y.current,k=h.current;if(!x||!k||g===0)return;let l=!1;return(async()=>{if(!R){T(!0);try{const w=Math.max(1,Math.min(r,g)),N=await x.getPage(w);if(l)return;const P=N.getViewport({scale:i,rotation:o}),E=k.getContext("2d");if(!E)return;k.height=P.height,k.width=P.width,await N.render({canvasContext:E,viewport:P}).promise}catch(w){console.error("Error rendering PDF page:",w)}finally{l||T(!1)}}})(),()=>{l=!0}},[r,i,o,g,R]),e.jsx("div",{className:"nice-document-viewer__pdf",children:e.jsx("canvas",{ref:h,className:"nice-document-viewer__pdf-canvas"})})}function be({src:t,zoom:r,rotation:i,onLoad:o,onError:m}){const[s,p]=n.useState(!1),u=n.useCallback(y=>{const g=y.currentTarget;p(!0),o({name:t.split("/").pop()??"image",type:"image",width:g.naturalWidth,height:g.naturalHeight})},[t,o]),h=n.useCallback(()=>{m(new Error("Failed to load image"))},[m]);return e.jsx("div",{className:"nice-document-viewer__image",children:e.jsx("img",{src:t,alt:"Document",onLoad:u,onError:h,style:{transform:`scale(${r}) rotate(${i}deg)`,opacity:s?1:0},draggable:!1})})}function _e({src:t,type:r,onLoad:i,onError:o}){const m=n.useRef(null),s=n.useCallback(()=>{const u=m.current;if(!u)return;const h={name:t.split("/").pop()??(r==="video"?"video":"audio"),type:r,duration:u.duration};r==="video"&&"videoWidth"in u&&(h.width=u.videoWidth,h.height=u.videoHeight),i(h)},[t,r,i]),p=n.useCallback(()=>{o(new Error(`Failed to load ${r}`))},[r,o]);return r==="video"?e.jsx("div",{className:"nice-document-viewer__video",children:e.jsx("video",{ref:m,src:t,controls:!0,onLoadedMetadata:s,onError:p})}):e.jsx("div",{className:"nice-document-viewer__audio",children:e.jsx("audio",{ref:m,src:t,controls:!0,onLoadedMetadata:s,onError:p})})}function je({src:t,viewerUrl:r,onLoad:i}){const[o,m]=n.useState(!1),p=`${r??"https://view.officeapps.live.com/op/embed.aspx?src="}${encodeURIComponent(t)}`,u=n.useCallback(()=>{m(!0),i({name:t.split("/").pop()??"document",type:"office"})},[t,i]);return e.jsx("div",{className:"nice-document-viewer__office",children:e.jsx("iframe",{src:p,onLoad:u,title:"Office Document",style:{opacity:o?1:0}})})}function ye({src:t,onLoad:r,onError:i}){const[o,m]=n.useState(null);return n.useEffect(()=>{fetch(t).then(s=>{if(!s.ok)throw new Error("Failed to fetch text");return s.text()}).then(s=>{m(s),r({name:t.split("/").pop()??"text",type:"text",size:s.length})}).catch(s=>{i(s instanceof Error?s:new Error("Failed to load text"))})},[t,r,i]),o===null?e.jsx("div",{className:"nice-document-viewer__loading",children:"Loading..."}):e.jsx("div",{className:"nice-document-viewer__text",children:e.jsx("pre",{children:o})})}function ke({src:t,onLoad:r}){const i=n.useCallback(()=>{r({name:t.split("/").pop()??"page.html",type:"html"})},[t,r]);return e.jsx("div",{className:"nice-document-viewer__html",children:e.jsx("iframe",{src:t,onLoad:i,title:"HTML Document",sandbox:"allow-same-origin allow-scripts"})})}const Ce=n.forwardRef(function(r,i){const{src:o,type:m,name:s,height:p=600,width:u="100%",zoom:h=1,minZoom:y=.25,maxZoom:g=4,page:B=1,showToolbar:R=!0,showPageNav:T=!0,showZoomControls:x=!0,showFullscreen:k=!0,showDownload:l=!0,showPrint:H=!0,showRotate:w=!0,enableKeyboard:N=!0,onLoad:P,onError:E,onPageChange:G,onZoomChange:A,pdfWorkerUrl:ne,officeViewerUrl:te,loading:oe,errorContent:O,className:ie,"data-testid":re}=r,U=n.useRef(null),[c,ae]=n.useState(null),[b,ce]=n.useState(B),[C,se]=n.useState(h),[Y,de]=n.useState(0),[Z,J]=n.useState(!1),[$,le]=n.useState(null),[ue,Q]=n.useState(!0),_=n.useMemo(()=>m??ve(o),[o,m]),z=n.useCallback(a=>{ae(a),Q(!1),P?.(a)},[P]),K=n.useCallback(a=>{le(a),Q(!1),E?.(a)},[E]),f=n.useCallback(a=>{const d=c?.pageCount??1,X=Math.max(1,Math.min(a,d));ce(X),G?.(X)},[c?.pageCount,G]),S=n.useCallback(()=>f(b+1),[b,f]),D=n.useCallback(()=>f(b-1),[b,f]),j=n.useCallback(a=>{const d=Math.max(y,Math.min(a,g));se(d),A?.(d)},[y,g,A]),I=n.useCallback(()=>j(C*1.25),[C,j]),L=n.useCallback(()=>j(C/1.25),[C,j]),M=n.useCallback(()=>j(1),[j]),V=n.useCallback(a=>{de(d=>(d+a)%360)},[]),W=n.useCallback(()=>{const a=document.createElement("a");a.href=o,a.download=s??c?.name??"document",document.body.appendChild(a),a.click(),document.body.removeChild(a)},[o,s,c?.name]),q=n.useCallback(()=>{const a=window.open(o,"_blank");a&&(a.onload=()=>a.print())},[o]),F=n.useCallback(()=>{U.current&&(Z?(document.exitFullscreen?.(),J(!1)):(U.current.requestFullscreen?.(),J(!0)))},[Z]);n.useEffect(()=>{if(!N)return;const a=d=>{switch(d.key){case"ArrowRight":case"PageDown":S();break;case"ArrowLeft":case"PageUp":D();break;case"Home":f(1);break;case"End":f(c?.pageCount??1);break;case"+":case"=":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),I());break;case"-":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),L());break;case"0":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),M());break;case"f":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),F());break}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[N,S,D,f,c?.pageCount,I,L,M,F]),n.useImperativeHandle(i,()=>({goToPage:f,nextPage:S,prevPage:D,setZoom:j,zoomIn:I,zoomOut:L,resetZoom:M,rotate:V,download:W,print:q,toggleFullscreen:F,getInfo:()=>c}),[f,S,D,j,I,L,M,V,W,q,F,c]);const me=()=>{if($)return(typeof O=="function"?O($):O)??e.jsx("div",{className:"nice-document-viewer__error",children:e.jsxs("span",{children:[e.jsx(v.NiceIcon,{name:"warning",size:14})," ",$.message]})});switch(_){case"pdf":return e.jsx(xe,{src:o,page:b,zoom:C,rotation:Y,onPageChange:f,onLoad:z,onError:K,workerUrl:ne});case"image":return e.jsx(be,{src:o,zoom:C,rotation:Y,onLoad:z,onError:K});case"video":case"audio":return e.jsx(_e,{src:o,type:_,onLoad:z,onError:K});case"office":return e.jsx(je,{src:o,viewerUrl:te,onLoad:z});case"text":return e.jsx(ye,{src:o,onLoad:z,onError:K});case"html":return e.jsx(ke,{src:o,onLoad:z});default:return e.jsxs("div",{className:"nice-document-viewer__unknown",children:[e.jsxs("span",{children:[e.jsx(v.NiceIcon,{name:"file",size:14})," Unknown document type"]}),e.jsx("button",{type:"button",onClick:W,children:"Download"})]})}},pe=T&&_==="pdf"&&(c?.pageCount??0)>1,fe=x&&(_==="pdf"||_==="image"),he=w&&(_==="pdf"||_==="image");return e.jsxs("div",{ref:U,className:`nice-document-viewer ${Z?"nice-document-viewer--fullscreen":""} ${ie??""}`,style:{height:p,width:u},"data-testid":re,"data-type":_,children:[R&&e.jsxs("div",{className:"nice-document-viewer__toolbar",children:[e.jsx("div",{className:"nice-document-viewer__toolbar-left",children:pe&&e.jsxs("div",{className:"nice-document-viewer__pagination",children:[e.jsx("button",{type:"button",onClick:D,disabled:b<=1,"aria-label":"Previous page",children:e.jsx(v.NiceIcon,{name:"chevron-left",size:16})}),e.jsxs("span",{children:[e.jsx("input",{type:"number",value:b,onChange:a=>f(parseInt(a.target.value,10)),min:1,max:c?.pageCount??1}),"/ ",c?.pageCount??1]}),e.jsx("button",{type:"button",onClick:S,disabled:b>=(c?.pageCount??1),"aria-label":"Next page",children:e.jsx(v.NiceIcon,{name:"chevron-right",size:16})})]})}),e.jsxs("div",{className:"nice-document-viewer__toolbar-center",children:[fe&&e.jsxs("div",{className:"nice-document-viewer__zoom",children:[e.jsx("button",{type:"button",onClick:L,"aria-label":"Zoom out",children:"−"}),e.jsxs("span",{children:[Math.round(C*100),"%"]}),e.jsx("button",{type:"button",onClick:I,"aria-label":"Zoom in",children:"+"}),e.jsx("button",{type:"button",onClick:M,"aria-label":"Reset zoom",children:e.jsx(v.NiceIcon,{name:"refresh",size:16})})]}),he&&e.jsxs("div",{className:"nice-document-viewer__rotation",children:[e.jsx("button",{type:"button",onClick:()=>V(270),"aria-label":"Rotate left",children:e.jsx(v.NiceIcon,{name:"refresh",size:16})}),e.jsx("button",{type:"button",onClick:()=>V(90),"aria-label":"Rotate right",children:e.jsx(v.NiceIcon,{name:"refresh",size:16})})]})]}),e.jsxs("div",{className:"nice-document-viewer__toolbar-right",children:[l&&e.jsx("button",{type:"button",onClick:W,"aria-label":"Download",children:e.jsx(v.NiceIcon,{name:"download",size:16})}),H&&e.jsx("button",{type:"button",onClick:q,"aria-label":"Print",children:e.jsx(v.NiceIcon,{name:"printer",size:16})}),k&&e.jsx("button",{type:"button",onClick:F,"aria-label":"Fullscreen",children:e.jsx(v.NiceIcon,{name:Z?"collapse":"expand",size:16})})]})]}),e.jsxs("div",{className:"nice-document-viewer__content",children:[ue&&!$&&(oe??e.jsx("div",{className:"nice-document-viewer__loading",children:"Loading..."})),me()]}),c&&e.jsxs("div",{className:"nice-document-viewer__info",children:[e.jsx("span",{className:"nice-document-viewer__name",children:s??c.name}),c.size&&e.jsx("span",{className:"nice-document-viewer__size",children:ge(c.size)}),c.width&&c.height&&e.jsxs("span",{className:"nice-document-viewer__dimensions",children:[c.width," × ",c.height]}),c.duration&&e.jsx("span",{className:"nice-document-viewer__duration",children:we(c.duration)})]})]})}),ee="nice-document-viewer-styles";if(typeof document<"u"&&!document.getElementById(ee)){const t=document.createElement("style");t.id=ee,t.textContent=`
|
|
2
|
+
.nice-document-viewer {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
6
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.nice-document-viewer--fullscreen {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
z-index: 9999;
|
|
18
|
+
border: none;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.nice-document-viewer__toolbar {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
padding: var(--nice-space-2, 8px) var(--nice-space-3, 12px);
|
|
27
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
28
|
+
border-bottom: 1px solid var(--nice-border-color, #e5e7eb);
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.nice-document-viewer__toolbar-left,
|
|
33
|
+
.nice-document-viewer__toolbar-center,
|
|
34
|
+
.nice-document-viewer__toolbar-right {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: var(--nice-space-2, 8px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.nice-document-viewer__toolbar button {
|
|
41
|
+
padding: var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px);
|
|
42
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
43
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
44
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.nice-document-viewer__toolbar button:hover:not(:disabled) {
|
|
50
|
+
background: var(--nice-hover-bg, color-mix(in srgb, var(--nice-text-primary, #000) 4%, transparent));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.nice-document-viewer__toolbar button:disabled {
|
|
54
|
+
opacity: 0.4;
|
|
55
|
+
cursor: not-allowed;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.nice-document-viewer__pagination,
|
|
59
|
+
.nice-document-viewer__zoom,
|
|
60
|
+
.nice-document-viewer__rotation {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--nice-space-1-5, 6px);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.nice-document-viewer__pagination input {
|
|
67
|
+
width: 50px;
|
|
68
|
+
padding: var(--nice-space-1, 4px);
|
|
69
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
70
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.nice-document-viewer__zoom span {
|
|
75
|
+
min-width: 50px;
|
|
76
|
+
text-align: center;
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.nice-document-viewer__content {
|
|
81
|
+
flex: 1;
|
|
82
|
+
overflow: auto;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
position: relative;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.nice-document-viewer__loading,
|
|
90
|
+
.nice-document-viewer__error,
|
|
91
|
+
.nice-document-viewer__unknown {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
gap: var(--nice-space-3, 12px);
|
|
97
|
+
padding: var(--nice-space-10, 40px);
|
|
98
|
+
color: var(--nice-text-secondary, #475569);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.nice-document-viewer__error span {
|
|
102
|
+
color: var(--nice-error, #d32f2f);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.nice-document-viewer__pdf,
|
|
106
|
+
.nice-document-viewer__image {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
min-height: 100%;
|
|
111
|
+
min-width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nice-document-viewer__pdf-canvas {
|
|
115
|
+
max-width: 100%;
|
|
116
|
+
height: auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.nice-document-viewer__image img {
|
|
120
|
+
max-width: 100%;
|
|
121
|
+
max-height: 100%;
|
|
122
|
+
object-fit: contain;
|
|
123
|
+
transition: transform 0.2s;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.nice-document-viewer__video,
|
|
127
|
+
.nice-document-viewer__audio {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.nice-document-viewer__video video,
|
|
136
|
+
.nice-document-viewer__audio audio {
|
|
137
|
+
max-width: 100%;
|
|
138
|
+
max-height: 100%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.nice-document-viewer__office iframe,
|
|
142
|
+
.nice-document-viewer__html iframe {
|
|
143
|
+
width: 100%;
|
|
144
|
+
height: 100%;
|
|
145
|
+
border: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.nice-document-viewer__text {
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
overflow: auto;
|
|
152
|
+
padding: var(--nice-space-4, 16px);
|
|
153
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.nice-document-viewer__text pre {
|
|
157
|
+
margin: 0;
|
|
158
|
+
font-family: 'Fira Code', monospace;
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
white-space: pre-wrap;
|
|
161
|
+
word-wrap: break-word;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.nice-document-viewer__info {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: var(--nice-space-4, 16px);
|
|
168
|
+
padding: var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);
|
|
169
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
170
|
+
border-top: 1px solid var(--nice-border-color, #e5e7eb);
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
color: var(--nice-text-secondary, #475569);
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.nice-document-viewer__name {
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
color: var(--nice-text-primary, #0f172a);
|
|
179
|
+
}
|
|
180
|
+
`,document.head.appendChild(t)}exports.NiceDocumentViewer=Ce;
|