@ibiz-template/vue3-components 0.5.7-alpha.0 → 0.5.7-alpha.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.
@@ -1 +0,0 @@
1
- System.register(["vue","@wangeditor/editor-for-vue","qx-util","ramda","@ibiz-template/vue3-util","@ibiz-template/core","element-plus"],(function(e){"use strict";var l,a,t,o,n,s,r,i,u,c,d,v,m,f,h,b,g,p,C;return{setters:[function(e){l=e.defineComponent,a=e.ref,t=e.shallowRef,o=e.watch,n=e.onBeforeUnmount,s=e.onMounted,r=e.createVNode,i=e.resolveComponent,u=e.createTextVNode,c=e.nextTick},function(e){d=e.Toolbar,v=e.Editor},function(e){m=e.getCookie},function(e){f=e.isNil},function(e){h=e.getHtmlProps,b=e.getEditorEmits,g=e.useNamespace},function(e){p=e.CoreConst},function(e){C=e.ElMessageBox}],execute:function(){e("default",l({name:"IBizHtml",props:h(),emits:b(),setup(e,{emit:l}){const i=g("html"),h=e.controller,b=a(),y=a({});let E=null,F=0;const k=a(),B=t(),S=a(""),x=a({Authorization:"Bearer ".concat(m(p.TOKEN))}),H=a(""),O=a(""),w=a(!0),T=a(!1),U=a(!1),N=a(!1),P=a(!1),V=h.model;V.editorParams&&(V.editorParams.enableEdit&&(T.value=!0,U.value=!0,w.value=h.toBoolean(V.editorParams.enableEdit)&&!e.readonly&&!e.disabled),V.editorParams.enableFullScreen&&(N.value=h.toBoolean(V.editorParams.enableFullScreen))),o((()=>e.data),(e=>{if(e){const l=h.calcBaseUrl(e);H.value=l.uploadUrl,O.value=l.downloadUrl}}),{immediate:!0,deep:!0});const R=(e,l)=>{if(l)return!0},z=e=>e,L={excludeKeys:["group-video"]},I={placeholder:h.placeHolder,readOnly:T.value?U.value:e.readonly,MENU_CONF:{uploadImage:{server:H.value,fieldName:"file",maxFileSize:10485760,maxNumberOfFiles:10,allowedFileTypes:[],headers:x.value,withCredentials:!0,onBeforeUpload:e=>e,onProgress(e){console.log("progress",e)},onSuccess(e,l){console.log("".concat(e.name," 上传成功"),l)},onFailed(e,l){console.log("".concat(e.name," 上传失败"),l)},onError(e,l,a){console.log("".concat(e.name," 上传出错"),l,a)},async customInsert(e,l){l(O.value.replace("%fileId%",e.id),e.filename,"")}},insertLink:{checkLink:R,parseLinkUrl:z},editLink:{checkLink:R,parseLinkUrl:z}}};n((()=>{const e=B.value;null!=e&&e.destroy()}));const A=e=>{B.value=e,e.setHtml(S.value)},M=a=>{const t=a.getHtml(),o="<p><br></p>"===t?"":t;o===e.value||""===o&&f(e.value)||!T.value&&a.isFocused()&&l("change",o)},D=e=>{},K=e=>{l("focus")},q=e=>{l("blur")},_=(e,l)=>{alert("【自定义提示】".concat(l," - ").concat(e))},j=(e,l,a)=>{a(!0)},G=()=>{const e=B.value;null!=e&&e.disable()},J=()=>{const e=B.value;null!=e&&e.enable()};s((()=>{o((()=>e.value),((l,a)=>{l===a||"string"!=typeof e.value&&null!=l||(S.value=null==l?"":l)}),{immediate:!0}),o((()=>e.disabled),((e,l)=>{e!==l&&(!0===e?G():J())}),{immediate:!0})}));const Q=()=>{U.value=!U.value,U.value?G():(J(),B.value.focus(),(()=>{var l,a;if(e.value){const t=e.value.indexOf("</p>");if(t>=0){const e=null==(l=B.value.selection.anchor)?void 0:l.offset,o=null==(a=B.value.selection.anchor)?void 0:a.path;0===e&&o.length>0&&0===o[0]&&B.value.move(t-3)}}})())},W=()=>{P.value=!P.value,c((()=>{U.value?G():(J(),B.value.focus())}))};return s((()=>{(()=>{if(b.value&&k.value){const e=b.value.offsetHeight;E=new ResizeObserver((l=>{const a=l[0].contentRect.height;if(a!==F){const t={height:"".concat(e-l[0].contentRect.height,"px")};y.value=i.cssVarBlock(t),F=a}})),E.observe(k.value.selector)}})()})),{ns:i,editorRef:B,mode:"default",valueHtml:S,toolbarConfig:L,editorConfig:I,handleCreated:A,handleChange:M,handleDestroyed:D,handleFocus:K,handleBlur:q,customAlert:_,customPaste:j,insertText:e=>{const l=B.value;null!=l&&l.insertText(e)},printHtml:()=>{const e=B.value;null!=e&&console.log(e.getHtml())},disable:G,enable:J,renderHeaserToolbar:()=>T.value||N.value?r("div",{class:i.b("custom-toolbar")},[T.value&&w.value&&U.value?r("i",{class:"fa fa-edit","aria-hidden":"true",onClick:()=>Q()},null):null,N.value?P.value?r("i",{class:"fa fa-compress","aria-hidden":"true",onClick:()=>W()},null):r("i",{class:"fa fa-expand","aria-hidden":"true",onClick:()=>W()},null):null]):null,renderEditorContent:()=>r("div",{class:i.b("content"),ref:"htmlContent",style:y.value},[r(d,{ref:"toolbarRef",editor:B.value,"default-config":L,mode:"default",class:i.b("toolbar")},null),r(v,{class:i.b("editor"),modelValue:S.value,"onUpdate:modelValue":e=>S.value=e,"default-config":I,mode:"default",onOnCreated:A,onOnChange:M,onOnDestroyed:D,onOnFocus:K,onOnBlur:q,oncustomAlert:_,oncustomPaste:j},null)]),renderFooter:()=>T.value?r("div",{class:[i.b("footer"),{[i.b("footer-dialog")]:P.value}]},[r("div",{class:i.be("footer","cancel"),onClick:()=>{e.value!==S.value?C({title:"确认取消",type:"warning",customClass:i.b("message"),message:r("div",{class:i.be("message","message-content")},[r("p",null,[u("确定要取消编辑吗?")]),r("p",{class:i.bem("message","message-content","message-tip")},[u("取消编辑将无法保存修改的内容,且不能找回。")])]),showCancelButton:!0,cancelButtonClass:i.be("message","message-cancel"),confirmButtonClass:i.be("message","message-comfire")}).then((()=>{S.value=e.value||"",Q()})).catch((()=>{B.value.focus()})):Q()}},[u("取消")]),r("div",{class:i.be("footer","save"),onClick:()=>(U.value=!0,B.value.disable(),l("change",S.value),void(P.value&&(P.value=!1)))},[u("保存")])]):null,htmlContent:b,hasEnableEdit:T,cssVars:y,toolbarRef:k,isFullScreen:P,readonlyState:U}},render(){return this.isFullScreen?r(i("el-dialog"),{modelValue:this.isFullScreen,"onUpdate:modelValue":e=>this.isFullScreen=e,width:"80%",top:"10vh",class:this.ns.b("dialog-full-screen")},{default:()=>[r("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState}]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])]}):r("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState}]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])}}))}}}));