iking-web-ui-pro 0.2.4 → 0.2.6

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.
Files changed (80) hide show
  1. package/dist/IKDetailPreviewFiles/ik.index.es.js +586 -571
  2. package/dist/IKDetailPreviewFiles/ik.index.umd.js +1 -1
  3. package/dist/IKDetailPreviewFiles/style.css +1 -1
  4. package/dist/IKExpandCollapse/ik.index.es.js +123 -120
  5. package/dist/IKExpandCollapse/ik.index.umd.js +1 -1
  6. package/dist/IKExpandCollapse/style.css +1 -1
  7. package/dist/IKPreviewFile/ik.index.es.js +491 -476
  8. package/dist/IKPreviewFile/ik.index.umd.js +1 -1
  9. package/dist/IKPreviewFile/style.css +1 -1
  10. package/dist/IKVerticalStepBar/ik.index.es.js +142 -139
  11. package/dist/IKVerticalStepBar/ik.index.umd.js +3 -3
  12. package/dist/IKVerticalStepBar/style.css +1 -1
  13. package/dist/IkApprovalProcessDetail/ik.index.es.js +756 -741
  14. package/dist/IkApprovalProcessDetail/ik.index.umd.js +1 -1
  15. package/dist/IkApprovalProcessDetail/style.css +1 -1
  16. package/dist/IkBaseDialog/ik.index.es.js +125 -122
  17. package/dist/IkBaseDialog/ik.index.umd.js +1 -1
  18. package/dist/IkBaseDialog/style.css +1 -1
  19. package/dist/IkBtnSetting/ik.index.es.js +252 -249
  20. package/dist/IkBtnSetting/ik.index.umd.js +1 -1
  21. package/dist/IkBtnSetting/style.css +1 -1
  22. package/dist/IkCollapseCard/ik.index.es.js +129 -126
  23. package/dist/IkCollapseCard/ik.index.umd.js +1 -1
  24. package/dist/IkCollapseCard/style.css +1 -1
  25. package/dist/IkDescription/ik.index.es.js +530 -515
  26. package/dist/IkDescription/ik.index.umd.js +1 -1
  27. package/dist/IkDescription/style.css +1 -1
  28. package/dist/IkIconPicker/ik.index.es.js +196 -193
  29. package/dist/IkIconPicker/ik.index.umd.js +1 -1
  30. package/dist/IkIconPicker/style.css +1 -1
  31. package/dist/IkMonacoEditor/ik.index.es.js +397 -394
  32. package/dist/IkMonacoEditor/ik.index.umd.js +3 -3
  33. package/dist/IkMonacoEditor/style.css +1 -1
  34. package/dist/IkPageFull/ik.index.es.js +1122 -1119
  35. package/dist/IkPageFull/ik.index.umd.js +2 -2
  36. package/dist/IkPageFull/style.css +1 -1
  37. package/dist/IkPreviewFileDialog/ik.index.es.js +314 -308
  38. package/dist/IkPreviewFileDialog/ik.index.umd.js +1 -1
  39. package/dist/IkPreviewFileDialog/style.css +1 -1
  40. package/dist/IkSchedule/ik.index.es.js +968 -965
  41. package/dist/IkSchedule/ik.index.umd.js +1 -1
  42. package/dist/IkSchedule/style.css +1 -1
  43. package/dist/IkSideText/ik.index.es.js +148 -145
  44. package/dist/IkSideText/ik.index.umd.js +1 -1
  45. package/dist/IkSideText/style.css +1 -1
  46. package/dist/IkSvgIcon/ik.index.es.js +106 -103
  47. package/dist/IkSvgIcon/ik.index.umd.js +1 -1
  48. package/dist/IkSvgIcon/style.css +1 -1
  49. package/dist/IkUploadFile/ik.index.es.js +963 -944
  50. package/dist/IkUploadFile/ik.index.umd.js +1 -1
  51. package/dist/IkUploadFile/style.css +1 -1
  52. package/dist/IkUploadImage/ik.index.es.js +265 -253
  53. package/dist/IkUploadImage/ik.index.umd.js +1 -1
  54. package/dist/IkUploadImage/style.css +1 -1
  55. package/dist/Provider/ik.index.es.js +1611 -0
  56. package/dist/Provider/ik.index.umd.js +17 -0
  57. package/dist/index.es.js +38689 -37072
  58. package/dist/index.umd.js +95 -79
  59. package/dist/src/components/IKDetailPreviewFiles/index.d.ts +1 -1
  60. package/dist/src/components/IKDetailPreviewFiles/src/IKDetailPreviewFiles.vue.d.ts +1 -1
  61. package/dist/src/components/IKPreviewFile/index.d.ts +3 -3
  62. package/dist/src/components/IKPreviewFile/src/IkPreviewFile.vue.d.ts +1 -1
  63. package/dist/src/components/IkApprovalProcess/index.d.ts +1 -1
  64. package/dist/src/components/IkApprovalProcess/src/IKApprovalProcess.vue.d.ts +1 -1
  65. package/dist/src/components/IkDescription/index.d.ts +3 -3
  66. package/dist/src/components/IkDescription/src/IkDescription.vue.d.ts +1 -1
  67. package/dist/src/components/IkPreviewFileDialog/index.d.ts +1 -1
  68. package/dist/src/components/IkPreviewFileDialog/src/IkPreviewFileDialog.vue.d.ts +1 -1
  69. package/dist/src/components/IkTinymce/index.d.ts +1 -1
  70. package/dist/src/components/IkTinymce/src/index.vue.d.ts +1 -1
  71. package/dist/src/components/IkUploadFile/index.d.ts +3 -3
  72. package/dist/src/components/IkUploadFile/src/index.vue.d.ts +1 -1
  73. package/dist/src/components/IkUploadImage/index.d.ts +3 -3
  74. package/dist/src/components/IkUploadImage/src/index.vue.d.ts +1 -1
  75. package/dist/src/components/Provider/ProviderConfig.vue.d.ts +66 -0
  76. package/dist/src/components/Provider/index.d.ts +139 -0
  77. package/dist/src/components/index.d.ts +1 -0
  78. package/dist/src/utils/use-provider.d.ts +8 -0
  79. package/dist/style.css +1 -1
  80. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("iking-utils-pro")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.index={},f.vue,f["iking-utils-pro"]))})(this,function(f,e,C){"use strict";const w=(o,t)=>{if(o.install=i=>{for(const r of[o,...Object.values(t??{})])i.component(r.name,r)},t)for(const[i,r]of Object.entries(t))o[i]=r;return o},S=(o,t)=>t?t.startsWith("http")?t:`${o||location.origin}${t}`:"",k=(o,t)=>{const i=o.__vccOpts||o;for(const[r,n]of t)i[r]=n;return i},D=(o,t)=>{var s,a,d,u;const i=(s=o==null?void 0:o.response)!=null&&s.data?B((d=(a=o==null?void 0:o.response)==null?void 0:a.data)==null?void 0:d.suffix):((u=o.raw)==null?void 0:u.type)||B(o[t.suffix]),r=i==null?void 0:i.toLowerCase(),n={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let l in n)if(typeof r=="string"&&(r.includes(l)||r===l))return n[l];return"unknown"},q={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},B=o=>{const t=o==null?void 0:o.toLocaleLowerCase(),i=t!=null&&t.startsWith(".")?t:`.${t}`;return i&&q[i]||"unknow"},V=o=>{let t="",i=["doc","docx"],r=["xls","xlsx"],n=["ppt","pptx"],s=["pdf"];return i.includes(o)&&(t="word"),r.includes(o)&&(t="cell"),n.includes(o)&&(t="slide"),s.includes(o)&&(t="text-pdf"),t},F={key:0,class:"ik-svg-icon ik-icon inline-block inline-flex justify-center box-content line-height-[0]"},O={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},$=["xlink:href"],T=["src"],A={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},M=["xlink:href"],P=["src"],j=e.defineComponent({name:"IkSvgIcon",__name:"index",props:{name:{},flip:{},rotate:{},color:{},colorLight:{},opacity:{default:.5},size:{default:""},width:{},bg:{type:Boolean,default:!1},showBg:{type:Boolean,default:!1},padding:{default:"6px"},primary:{type:Boolean},warning:{type:Boolean},success:{type:Boolean},error:{type:Boolean},notip:{type:Boolean,default:!1},title:{},type:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tableIconType:{default:"icon"}},setup(o){const t=o,i=e.computed(()=>{var n,s,a;return/^http?:\/\//.test(t.name)?"img":/i-[^:]+:[^:]+/.test(t.name)?"unocss":(n=t.name)!=null&&n.startsWith("iksig")?"iksig":(s=t.name)!=null&&s.includes(":")?"iconify":(a=t.name)!=null&&a.startsWith("iksvg")?"svg":"i"}),r=e.computed(()=>{const n=[];if(t.flip)switch(t.flip){case"horizontal":n.push("rotateY(180deg)");break;case"vertical":n.push("rotateX(180deg)");break;case"both":n.push("rotateX(180deg)"),n.push("rotateY(180deg)");break}t.rotate&&n.push(`rotate(${t.rotate%360}deg)`);const s={...t.color&&{color:t.color},...t.size&&{fontSize:typeof t.size=="number"?`${t.size}px`:t.size},...n.length&&{transform:n.join(" ")},padding:t.showBg||t.bg?t.padding:0,...t.color&&i.value!=="iksig"?{"--ik-color-icon-dark":t.color,"--ik-color-icon-light":t.colorLight||C.ikColor.setOpacity(t.color,t.opacity)}:{}};return t.width&&(s.width=s.height=typeof t.width=="number"?`${t.width}px`:t.width),s});return(n,s)=>{const a=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-button");return n.tableIconType==="icon"?(e.openBlock(),e.createElementBlock("span",F,[n.notip||!n.title?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[n.name]:i.value==="unocss","show-bg":n.showBg||n.bg,default:n.size==="default",small:n.size==="small",big:n.size==="big",warning:n.warning||t.type==="warning",primary:n.primary||t.type==="primary",success:n.success||t.type==="success",error:n.error||t.type==="error",active:n.active,disabled:n.disabled}]),style:e.normalizeStyle(r.value)},[e.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),i.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${n.name}`),style:e.normalizeStyle(r.value)},null,6)):i.value==="svg"?(e.openBlock(),e.createElementBlock("svg",O,[e.createElementVNode("use",{"xlink:href":`#${n.name}`},null,8,$)])):i.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:n.name,class:"h-[1em] w-[1em]"},null,8,T)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(n.name),style:e.normalizeStyle(r.value)},null,6))],6)):(e.openBlock(),e.createBlock(a,{key:1,content:n.title,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[n.name]:i.value==="unocss","show-bg":n.showBg||n.bg,default:n.size==="default",small:n.size==="small",big:n.size==="big",warning:n.warning||t.type==="warning",primary:n.primary||t.type==="primary",success:n.success||t.type==="success",error:n.error||t.type==="error",active:n.active}]),style:e.normalizeStyle(r.value)},[i.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${n.name}`),style:e.normalizeStyle(r.value)},null,6)):i.value==="svg"?(e.openBlock(),e.createElementBlock("svg",A,[e.createElementVNode("use",{"xlink:href":`#${n.name}`},null,8,M)])):i.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:n.name,class:"h-[1em] w-[1em]"},null,8,P)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(n.name),style:e.normalizeStyle(r.value)},null,6))],6)]),_:1},8,["content"]))])):(e.openBlock(),e.createBlock(d,{key:1,type:["warning","error"].includes(n.type)?"danger":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.title),1)]),_:1},8,["type"]))}}}),oe="",v=w(k(j,[["__scopeId","data-v-7d95dbf5"]])),N={key:0,class:"exit-main-page-maximize"},L=e.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(o){return(t,i)=>(e.openBlock(),e.createElementBlock("div",null,[o.showBg&&o.fullscreen?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(e.unref(v),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})])):(e.openBlock(),e.createBlock(e.unref(v),{key:1,error:"",name:"iksvg_guanbidanchuang",title:"关闭",size:20}))]))}}),se="",U=k(L,[["__scopeId","data-v-79f49df8"]]),H={class:"base-header"},W=e.defineComponent({__name:"IkBaseDialog",props:e.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,i=e.useModel(o,"modelValue"),r=e.ref(t.fullscreen),n=()=>{r.value=!r.value},s=e.defineComponent({setup(){return()=>e.h(U,{showBg:t.showCloseBg,fullscreen:t.fullscreen})}});return(a,d)=>{const u=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(u,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=l=>i.value=l)},a.$attrs,{"close-icon":e.unref(s),class:`ik-base-dialog ${a.noHeader?"no-header":""} ${a.noFooter?"no-footer":""}`,fullscreen:r.value,"modal-class":"baseDialog"}),e.createSlots({icon:e.withCtx(()=>[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),header:e.withCtx(()=>[e.createElementVNode("div",H,[e.renderSlot(a.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),a.$attrs.showClose?(e.openBlock(),e.createBlock(e.unref(v),{key:0,onClick:n,name:r.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:r.value?"退出全屏":"全屏"},null,8,["name","title"])):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:2},[a.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),re="",K=w(W);function X(o,t,i,r){function n(s){return s instanceof i?s:new i(function(a){a(s)})}return new(i||(i=Promise))(function(s,a){function d(c){try{l(r.next(c))}catch(m){a(m)}}function u(c){try{l(r.throw(c))}catch(m){a(m)}}function l(c){c.done?s(c.value):n(c.value).then(d,u)}l((r=r.apply(o,t||[])).next())})}function Y(o,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function d(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1],s=l;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(l);break}s[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(o,i)}catch(c){l=[6,c],n=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var G=function(o,t){return X(void 0,void 0,void 0,function(){return Y(this,function(i){return[2,new Promise(function(r,n){try{if(window.DocsAPI)return r(null);var s=document.getElementById(t);if(s)var a=setInterval(function(){var u=s.getAttribute("loading");if(!u){if(clearInterval(a),window.DocsAPI)return r(null);var l=R(t,o,r,n);s.remove(),document.body.appendChild(l)}},500);else{var d=R(t,o,r,n);document.body.appendChild(d)}}catch(u){console.error(u)}})]})})},R=function(o,t,i,r){var n=document.createElement("script");return n.id=o,n.type="text/javascript",n.src=t,n.async=!0,n.onload=function(){n.removeAttribute("loading"),i(null)},n.onerror=function(s){n.removeAttribute("loading"),r(s)},n.setAttribute("loading",""),n},_=e.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var o=this,t=this.documentServerUrl;t.endsWith("/")||(t+="/");var i="".concat(t,"web-apps/apps/api/documents/api.js");G(i,"onlyoffice-api-script").then(function(){return o.onLoad()}).catch(function(){o.onError(-2)})},unmounted:function(){var o,t=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[t]&&(window.DocEditor.instances[t].destroyEditor(),window.DocEditor.instances[t]=void 0)},watch:{config:{handler:function(o,t){this.onChangeProps()},deep:!0},document_fileType:function(o,t){this.onChangeProps()},document_title:function(o,t){this.onChangeProps()},documentType:function(o,t){this.onChangeProps()},editorConfig_lang:function(o,t){this.onChangeProps()},height:function(o,t){this.onChangeProps()},type:function(o,t){this.onChangeProps()},width:function(o,t){this.onChangeProps()}},methods:{onLoad:function(){var o,t;try{var i=this.id||"";if(window.DocsAPI||this.onError(-3),!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[i]){console.log("Skip loading. Instance already exists",i);return}!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances||(window.DocEditor={instances:{}});var r=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),n=window.DocsAPI.DocEditor(i,r);window.DocEditor.instances[i]=n}catch(s){console.error(s),this.onError(-1)}},onError:function(o){var t;switch(o){case-2:t="Error load DocsAPI from "+this.documentServerUrl;break;case-3:t="DocsAPI is not defined";break;default:t="Unknown error loading component",o=-1}typeof this.onLoadComponentError>"u"?console.error(t):this.onLoadComponentError(o,t)},onAppReady:function(){var o=this.id||"";this.events_onAppReady(window.DocEditor.instances[o])},onChangeProps:function(){var o,t=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[t]&&(window.DocEditor.instances[t].destroyEditor(),window.DocEditor.instances[t]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const J=["id"];function Q(o,t,i,r,n,s){return e.openBlock(),e.createElementBlock("div",{id:o.id},null,8,J)}_.render=Q,_.__file="src/components/DocumentEditor.vue";const Z=e.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(o){const t=o,i=e.ref({width:"100%",height:"100%",...t.configOptions||{},...t.configOptions}),r=()=>{console.info("文档加载完成",t.configOptions)};return(n,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({height:t.officeHeight})},[e.createVNode(e.unref(_),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":o.documentServerUrl,config:i.value,events_onDocumentReady:r},null,8,["id","document-server-url","config"])],4))}}),le="",ee=w(k(Z,[["__scopeId","data-v-98d51ef9"]])),te=e.defineComponent({__name:"IkPreviewFileDialog",props:e.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:["update:show"],setup(o){const t=o,i=e.useModel(o,"show"),r=e.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...t.field})),n=e.ref(null),s=e.ref(null),a=e.reactive({image:!1,office:!1,video:!1}),d=l=>{var c,m,g,h,y,E,x;try{const p=((c=l==null?void 0:l.response)==null?void 0:c.data)||l,I=p[r.value.url]||(p==null?void 0:p.id)||p.attachmentId,b=(m=p[r.value.suffix]||p.attachmentSuffix)==null?void 0:m.toLowerCase(),ne=p[r.value.name]||(p==null?void 0:p.attachmentName)||(p==null?void 0:p.originName);if(s.value={...l,name:l[r.value.name],url:S(t.loadUrl,I)},l&&D(l,r.value)==="image"){a.image=!0;return}else if((((g=t.onlyOfficeConfig)==null?void 0:g.accept)||t.onlyOfficeAccept).includes(b)){a.office=!0,n.value={...t.onlyOfficeConfig,editorConfig:{...((h=t.onlyOfficeConfig)==null?void 0:h.editorConfig)||{},customization:{...((E=(y=t.onlyOfficeConfig)==null?void 0:y.editorConfig)==null?void 0:E.customization)||{},review:{reviewDisplay:"final"}}},document:{key:C.buildUUID(),title:ne,url:S(t.loadUrl,I),fileType:b,...((x=t.onlyOfficeConfig)==null?void 0:x.document)||{}},documentType:V(b)};return}}catch(p){console.info("预览错误: ",p)}};e.watch([i,t.file],([l,c])=>{l&&e.nextTick(()=>{d(t.file)})});const u=()=>{i.value=!1,a.office=!1,a.image=!1,a.video=!1};return(l,c)=>{var g,h;const m=e.resolveComponent("el-image-viewer");return i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(g=s.value)!=null&&g.url&&a.image?(e.openBlock(),e.createBlock(m,{key:0,onClose:c[0]||(c[0]=y=>{s.value=null,a.image=!1}),ref:"previewImgRef","url-list":[(h=s.value)==null?void 0:h.url]},null,8,["url-list"])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" 文档类 "),e.createVNode(e.unref(K),{modelValue:a.office,"onUpdate:modelValue":c[1]||(c[1]=y=>a.office=y),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:u,"modal-class":"ik-only-preview-dialog"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee),{"config-options":n.value,"document-server-url":o.onlyOfficeConfig.serverUrl||o.onlyofficeServer},null,8,["config-options","document-server-url"])]),_:1},8,["modelValue"])],64)):e.createCommentVNode("v-if",!0)}}}),ce="",z=w(te);f.IkPreviewFileDialog=z,f.default=z,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("iking-utils-pro")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.index={},f.vue,f["iking-utils-pro"]))})(this,function(f,e,b){"use strict";const v=(o,n)=>{if(o.install=i=>{for(const t of[o,...Object.values(n??{})])i.component(t.name,t)},n)for(const[i,t]of Object.entries(n))o[i]=t;return o},C=(o,n)=>n?n.startsWith("http")?n:`${o||location.origin}${n}`:"",w=(o,n)=>{const i=o.__vccOpts||o;for(const[t,r]of n)i[t]=r;return i},D=(o,n)=>{var l,s,c,u;const i=(l=o==null?void 0:o.response)!=null&&l.data?S((c=(s=o==null?void 0:o.response)==null?void 0:s.data)==null?void 0:c.suffix):((u=o.raw)==null?void 0:u.type)||S(o[n.suffix]),t=i==null?void 0:i.toLowerCase(),r={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let a in r)if(typeof t=="string"&&(t.includes(a)||t===a))return r[a];return"unknown"},q={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},S=o=>{const n=o==null?void 0:o.toLocaleLowerCase(),i=n!=null&&n.startsWith(".")?n:`.${n}`;return i&&q[i]||"unknow"},V=o=>{let n="",i=["doc","docx"],t=["xls","xlsx"],r=["ppt","pptx"],l=["pdf"];return i.includes(o)&&(n="word"),t.includes(o)&&(n="cell"),r.includes(o)&&(n="slide"),l.includes(o)&&(n="text-pdf"),n},F={key:0,class:"ik-svg-icon ik-icon inline-block inline-flex justify-center box-content line-height-[0]"},O={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},$=["xlink:href"],T=["src"],A={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},M=["xlink:href"],j=["src"],P=e.defineComponent({name:"IkSvgIcon",__name:"index",props:{name:{},flip:{},rotate:{},color:{},colorLight:{},opacity:{default:.5},size:{default:""},width:{},bg:{type:Boolean,default:!1},showBg:{type:Boolean,default:!1},padding:{default:"6px"},primary:{type:Boolean},warning:{type:Boolean},success:{type:Boolean},error:{type:Boolean},notip:{type:Boolean,default:!1},title:{},type:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tableIconType:{default:"icon"}},setup(o){const n=o,i=e.inject("iconConfig"),t=e.computed(()=>({...(i==null?void 0:i.value)||{},...n})),r=e.computed(()=>{const{name:s}=t.value;return/^http?:\/\//.test(s)?"img":/i-[^:]+:[^:]+/.test(s)?"unocss":s!=null&&s.startsWith("iksig")?"iksig":s!=null&&s.includes(":")?"iconify":s!=null&&s.startsWith("iksvg")?"svg":"i"}),l=e.computed(()=>{const s=[];if(t.value.flip)switch(t.value.flip){case"horizontal":s.push("rotateY(180deg)");break;case"vertical":s.push("rotateX(180deg)");break;case"both":s.push("rotateX(180deg)"),s.push("rotateY(180deg)");break}t.value.rotate&&s.push(`rotate(${t.value.rotate%360}deg)`);const c={...t.value.color&&{color:t.value.color},...t.value.size&&{fontSize:typeof t.value.size=="number"?`${t.value.size}px`:t.value.size},...s.length&&{transform:s.join(" ")},padding:t.value.showBg||t.value.bg?t.value.padding:0,...t.value.color&&r.value!=="iksig"?{"--ik-color-icon-dark":t.value.color,"--ik-color-icon-light":t.value.colorLight||b.ikColor.setOpacity(t.value.color,t.value.opacity)}:{}};return t.value.width&&(c.width=c.height=typeof t.value.width=="number"?`${t.value.width}px`:t.value.width),c});return(s,c)=>{const u=e.resolveComponent("el-tooltip"),a=e.resolveComponent("el-button");return t.value.tableIconType==="icon"?(e.openBlock(),e.createElementBlock("span",F,[t.value.notip||!t.value.title?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[s.name]:r.value==="unocss","show-bg":t.value.showBg||t.value.bg,default:t.value.size==="default",small:t.value.size==="small",big:t.value.size==="big",warning:t.value.warning||t.value.type==="warning",primary:t.value.primary||t.value.type==="primary",success:s.success||t.value.type==="success",error:t.value.error||t.value.type==="error",active:t.value.active,disabled:t.value.disabled}]),style:e.normalizeStyle(l.value)},[e.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),r.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${t.value.name}`),style:e.normalizeStyle(l.value)},null,6)):r.value==="svg"?(e.openBlock(),e.createElementBlock("svg",O,[e.createElementVNode("use",{"xlink:href":`#${t.value.name}`},null,8,$)])):r.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.name,class:"h-[1em] w-[1em]"},null,8,T)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(t.value.name),style:e.normalizeStyle(l.value)},null,6))],6)):(e.openBlock(),e.createBlock(u,{key:1,content:t.value.title,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[s.name]:r.value==="unocss","show-bg":t.value.showBg||t.value.bg,default:t.value.size==="default",small:t.value.size==="small",big:t.value.size==="big",warning:t.value.warning||t.value.type==="warning",primary:s.primary||t.value.type==="primary",success:s.success||t.value.type==="success",error:t.value.error||t.value.type==="error",active:t.value.active}]),style:e.normalizeStyle(l.value)},[r.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${t.value.name}`),style:e.normalizeStyle(l.value)},null,6)):r.value==="svg"?(e.openBlock(),e.createElementBlock("svg",A,[e.createElementVNode("use",{"xlink:href":`#${t.value.name}`},null,8,M)])):r.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.name,class:"h-[1em] w-[1em]"},null,8,j)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(t.value.name),style:e.normalizeStyle(l.value)},null,6))],6)]),_:1},8,["content"]))])):(e.openBlock(),e.createBlock(a,{key:1,type:["warning","error"].includes(t.value.type)?"danger":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value.title),1)]),_:1},8,["type"]))}}}),oe="",_=v(w(P,[["__scopeId","data-v-1be337e4"]])),N={key:0,class:"exit-main-page-maximize"},L=e.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(o){return(n,i)=>(e.openBlock(),e.createElementBlock("div",null,[o.showBg&&o.fullscreen?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(e.unref(_),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})])):(e.openBlock(),e.createBlock(e.unref(_),{key:1,error:"",name:"iksvg_guanbidanchuang",title:"关闭",size:20}))]))}}),le="",U=w(L,[["__scopeId","data-v-79f49df8"]]),H={class:"base-header"},W=e.defineComponent({__name:"IkBaseDialog",props:e.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const n=o,i=e.useModel(o,"modelValue"),t=e.ref(n.fullscreen),r=()=>{t.value=!t.value},l=e.defineComponent({setup(){return()=>e.h(U,{showBg:n.showCloseBg,fullscreen:n.fullscreen})}});return(s,c)=>{const u=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(u,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=a=>i.value=a)},s.$attrs,{"close-icon":e.unref(l),class:`ik-base-dialog ${s.noHeader?"no-header":""} ${s.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),e.createSlots({icon:e.withCtx(()=>[e.renderSlot(s.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(s.title),1)])]),header:e.withCtx(()=>[e.createElementVNode("div",H,[e.renderSlot(s.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(s.title),1)])]),s.$attrs.showClose?(e.openBlock(),e.createBlock(e.unref(_),{key:0,onClick:r,name:t.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:t.value?"退出全屏":"全屏"},null,8,["name","title"])):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:2},[s.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),se="",K=v(W);function X(o,n,i,t){function r(l){return l instanceof i?l:new i(function(s){s(l)})}return new(i||(i=Promise))(function(l,s){function c(d){try{a(t.next(d))}catch(m){s(m)}}function u(d){try{a(t.throw(d))}catch(m){s(m)}}function a(d){d.done?l(d.value):r(d.value).then(c,u)}a((t=t.apply(o,n||[])).next())})}function Y(o,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},t,r,l,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(d){return u([a,d])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(t=1,r&&(l=a[0]&2?r.return:a[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,a[1])).done)return l;switch(r=0,l&&(a=[a[0]&2,l.value]),a[0]){case 0:case 1:l=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!l||a[1]>l[0]&&a[1]<l[3])){i.label=a[1];break}if(a[0]===6&&i.label<l[1]){i.label=l[1],l=a;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(a);break}l[2]&&i.ops.pop(),i.trys.pop();continue}a=n.call(o,i)}catch(d){a=[6,d],r=0}finally{t=l=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var G=function(o,n){return X(void 0,void 0,void 0,function(){return Y(this,function(i){return[2,new Promise(function(t,r){try{if(window.DocsAPI)return t(null);var l=document.getElementById(n);if(l)var s=setInterval(function(){var u=l.getAttribute("loading");if(!u){if(clearInterval(s),window.DocsAPI)return t(null);var a=B(n,o,t,r);l.remove(),document.body.appendChild(a)}},500);else{var c=B(n,o,t,r);document.body.appendChild(c)}}catch(u){console.error(u)}})]})})},B=function(o,n,i,t){var r=document.createElement("script");return r.id=o,r.type="text/javascript",r.src=n,r.async=!0,r.onload=function(){r.removeAttribute("loading"),i(null)},r.onerror=function(l){r.removeAttribute("loading"),t(l)},r.setAttribute("loading",""),r},k=e.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var o=this,n=this.documentServerUrl;n.endsWith("/")||(n+="/");var i="".concat(n,"web-apps/apps/api/documents/api.js");G(i,"onlyoffice-api-script").then(function(){return o.onLoad()}).catch(function(){o.onError(-2)})},unmounted:function(){var o,n=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[n]&&(window.DocEditor.instances[n].destroyEditor(),window.DocEditor.instances[n]=void 0)},watch:{config:{handler:function(o,n){this.onChangeProps()},deep:!0},document_fileType:function(o,n){this.onChangeProps()},document_title:function(o,n){this.onChangeProps()},documentType:function(o,n){this.onChangeProps()},editorConfig_lang:function(o,n){this.onChangeProps()},height:function(o,n){this.onChangeProps()},type:function(o,n){this.onChangeProps()},width:function(o,n){this.onChangeProps()}},methods:{onLoad:function(){var o,n;try{var i=this.id||"";if(window.DocsAPI||this.onError(-3),!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[i]){console.log("Skip loading. Instance already exists",i);return}!((n=window==null?void 0:window.DocEditor)===null||n===void 0)&&n.instances||(window.DocEditor={instances:{}});var t=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),r=window.DocsAPI.DocEditor(i,t);window.DocEditor.instances[i]=r}catch(l){console.error(l),this.onError(-1)}},onError:function(o){var n;switch(o){case-2:n="Error load DocsAPI from "+this.documentServerUrl;break;case-3:n="DocsAPI is not defined";break;default:n="Unknown error loading component",o=-1}typeof this.onLoadComponentError>"u"?console.error(n):this.onLoadComponentError(o,n)},onAppReady:function(){var o=this.id||"";this.events_onAppReady(window.DocEditor.instances[o])},onChangeProps:function(){var o,n=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[n]&&(window.DocEditor.instances[n].destroyEditor(),window.DocEditor.instances[n]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const J=["id"];function Q(o,n,i,t,r,l){return e.openBlock(),e.createElementBlock("div",{id:o.id},null,8,J)}k.render=Q,k.__file="src/components/DocumentEditor.vue";const Z=e.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(o){const n=o,i=e.ref({width:"100%",height:"100%",...n.configOptions||{},...n.configOptions}),t=()=>{console.info("文档加载完成",n.configOptions)};return(r,l)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({height:n.officeHeight})},[e.createVNode(e.unref(k),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":o.documentServerUrl,config:i.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),ae="",ee=v(w(Z,[["__scopeId","data-v-98d51ef9"]])),te=e.defineComponent({__name:"IkPreviewFileDialog",props:e.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:["update:show"],setup(o){const n=o,i=e.useModel(o,"show"),t=e.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...n.field})),r=e.ref(null),l=e.ref(null),s=e.reactive({image:!1,office:!1,video:!1}),c=a=>{var d,m,h,y,g,z,E;try{const p=((d=a==null?void 0:a.response)==null?void 0:d.data)||a,I=p[t.value.url]||(p==null?void 0:p.id)||p.attachmentId,x=(m=p[t.value.suffix]||p.attachmentSuffix)==null?void 0:m.toLowerCase(),ne=p[t.value.name]||(p==null?void 0:p.attachmentName)||(p==null?void 0:p.originName);if(l.value={...a,name:a[t.value.name],url:C(n.loadUrl,I)},a&&D(a,t.value)==="image"){s.image=!0;return}else if((((h=n.onlyOfficeConfig)==null?void 0:h.accept)||n.onlyOfficeAccept).includes(x)){s.office=!0,r.value={...n.onlyOfficeConfig,editorConfig:{...((y=n.onlyOfficeConfig)==null?void 0:y.editorConfig)||{},customization:{...((z=(g=n.onlyOfficeConfig)==null?void 0:g.editorConfig)==null?void 0:z.customization)||{},review:{reviewDisplay:"final"}}},document:{key:b.buildUUID(),title:ne,url:C(n.loadUrl,I),fileType:x,...((E=n.onlyOfficeConfig)==null?void 0:E.document)||{}},documentType:V(x)};return}}catch(p){console.info("预览错误: ",p)}};e.watch([i,n.file],([a,d])=>{a&&e.nextTick(()=>{c(n.file)})});const u=()=>{i.value=!1,s.office=!1,s.image=!1,s.video=!1};return(a,d)=>{var h,y;const m=e.resolveComponent("el-image-viewer");return i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(h=l.value)!=null&&h.url&&s.image?(e.openBlock(),e.createBlock(m,{key:0,onClose:d[0]||(d[0]=g=>{l.value=null,s.image=!1}),ref:"previewImgRef","url-list":[(y=l.value)==null?void 0:y.url]},null,8,["url-list"])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" 文档类 "),e.createVNode(e.unref(K),{modelValue:s.office,"onUpdate:modelValue":d[1]||(d[1]=g=>s.office=g),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:u,"modal-class":"ik-only-preview-dialog"},{default:e.withCtx(()=>{var g;return[e.createVNode(e.unref(ee),{"config-options":r.value,"document-server-url":((g=o.onlyOfficeConfig)==null?void 0:g.serverUrl)||o.onlyofficeServer},null,8,["config-options","document-server-url"])]}),_:1},8,["modelValue"])],64)):e.createCommentVNode("v-if",!0)}}}),ce="",R=v(te);f.IkPreviewFileDialog=R,f.default=R,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1 +1 @@
1
- .row-title[data-v-7d95dbf5]{display:flex}.exit-main-page-maximize[data-v-79f49df8]{position:fixed;top:-40px;right:-40px;z-index:1000;width:80px;height:80px;cursor:pointer;background-color:var(--ik-color-bg-icon);border-radius:50%}.exit-main-page-maximize span[data-v-79f49df8]{position:absolute;top:47px;right:47px}.ik-svg-icon.ik-icon[data-v-79f49df8]{--ik-color-icon-dark: var(--ik-color-bgicon-dark);--ik-color-icon-light: var(--ik-color-bgicon-light)}.el-dialog.ik-base-dialog.no-header .el-dialog__header{height:0}.el-dialog.ik-base-dialog.no-header .el-dialog__header .base-header{overflow:hidden;display:none}.el-dialog.ik-base-dialog.no-header .el-dialog__header:after{display:none}.el-dialog.ik-base-dialog.no-footer .el-dialog__footer{height:0;overflow:hidden}.ik-only-preview-dialog .el-dialog.is-fullscreen{padding:0}.ik-only-preview-dialog .el-dialog.is-fullscreen .el-dialog__body{max-height:100vh!important;padding:0}
1
+ .row-title[data-v-1be337e4]{display:flex}.exit-main-page-maximize[data-v-79f49df8]{position:fixed;top:-40px;right:-40px;z-index:1000;width:80px;height:80px;cursor:pointer;background-color:var(--ik-color-bg-icon);border-radius:50%}.exit-main-page-maximize span[data-v-79f49df8]{position:absolute;top:47px;right:47px}.ik-svg-icon.ik-icon[data-v-79f49df8]{--ik-color-icon-dark: var(--ik-color-bgicon-dark);--ik-color-icon-light: var(--ik-color-bgicon-light)}.el-dialog.ik-base-dialog.no-header .el-dialog__header{height:0}.el-dialog.ik-base-dialog.no-header .el-dialog__header .base-header{overflow:hidden;display:none}.el-dialog.ik-base-dialog.no-header .el-dialog__header:after{display:none}.el-dialog.ik-base-dialog.no-footer .el-dialog__footer{height:0;overflow:hidden}.ik-only-preview-dialog .el-dialog.is-fullscreen{padding:0}.ik-only-preview-dialog .el-dialog.is-fullscreen .el-dialog__body{max-height:100vh!important;padding:0}