All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.webjars.js.chunk-589faee0.5b861f49.js Maven / Gradle / Ivy

/*! For license information please see chunk-589faee0.5b861f49.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-589faee0"],{"3c60":function(e,t,n){"use strict";n.r(t);var o=(n("4160"),n("a15b"),n("b680"),n("d3b7"),n("ac1f"),n("25f0"),n("5319"),n("159b"),n("b1c7")),r=n("b311"),i=n.n(r),s={props:{api:{type:Object,required:!0},swaggerInstance:{type:Object,required:!0},debugSend:{type:Boolean,default:!1},responseHeaders:{type:Array},responseRawText:{type:String,default:""},responseCurlText:{type:String,default:""},responseStatus:{type:Object},responseContent:{type:Object},responseFieldDescriptionChecked:{type:Boolean,default:!0}},components:{EditorDebugShow:function(){return Promise.all([n.e("chunk-3b888a65"),n.e("chunk-0fd67716"),n.e("chunk-3ec4aaa8"),n.e("chunk-735c675c")]).then(n.bind(null,"b3ee"))}},data:function(){return{pagination:!1,i18n:null,base64Image:!1,debugResponse:!0,responseHeaderColumn:[]}},watch:{language:function(e,t){this.initI18n()}},computed:{language:function(){return this.$store.state.globals.language},responseSizeText:function(){var e="0 B",t=this.responseStatus;if(null!=t&&null!=t){var n=t.size,o=(n/1024).toFixed(2),r=(n/1024/1024).toFixed(2);e=o>1?o+" KB":r>1?r+" MB":n+" B"}return e}},created:function(){this.initI18n(),this.copyRawText(),this.copyCurlText()},methods:{getCurrentI18nInstance:function(){return this.$i18n.messages[this.language]},base64Init:function(){var e=o.a.getValue(this.responseContent,"base64","",!0);o.a.strNotBlank(e)&&(this.base64Image=!0)},initI18n:function(){this.i18n=this.getCurrentI18nInstance(),this.responseHeaderColumn=this.i18n.table.debugResponseHeaderColumns},copyRawText:function(){var e=this,t="btnDebugCopyRaw"+this.api.id,n=new i.a("#"+t,{text:function(){return e.responseRawText}}),o=this.i18n.message.copy.raw.success,r=this.i18n.message.copy.raw.fail;n.on("success",(function(t){e.$message.info(o)})),n.on("error",(function(t){e.$message.info(r)}))},copyCurlText:function(){var e=this,t="btnDebugCopyCurl"+this.api.id,n=new i.a("#"+t,{text:function(){return e.responseCurlText}}),o=this.i18n.message.copy.curl.success,r=this.i18n.message.copy.curl.fail;n.on("success",(function(t){e.$message.info(o)})),n.on("error",(function(t){e.$message.info(r)}))},resetResponseContent:function(){if(null!=this.responseContent&&"json"==this.responseContent.mode){var e=this.responseContent.text;this.responseContent.text=o.a.json5stringify(o.a.json5parse(e))}},showFieldDesChange:function(e){var t=e.target.checked;this.$emit("debugShowFieldDescriptionChange",t),this.toggleFieldDescription(t)},debugEditorChange:function(e){this.$emit("debugEditorChange",e)},toggleFieldDescription:function(e){var t="responseEditorContent"+this.api.id,n=document.getElementById(t).getElementsByClassName("knife4j-debug-editor-field-description");o.a.arrNotEmpty(n)?n.forEach((function(t){t.style.display=e?"block":"none"})):this.showEditorFieldAnyWay()},showEditorFieldDescription:function(e){var t=this;o.a.checkUndefined(e)&&parseInt(e)<=200&&setTimeout((function(){t.showEditorFieldWait()}),100)},showEditorFieldWait:function(){this.debugSend&&this.responseFieldDescriptionChecked&&"json"==this.responseContent.mode&&this.showEditorFieldAnyWay()},showEditorFieldAnyWay:function(){var e=this.swaggerInstance,t=this.api.getHttpSuccessCodeObject(),n="responseEditorContent"+this.api.id,r=document.getElementById(n),i=[],s=r.getElementsByClassName("ace_text-layer"),a=0,c=r.querySelector(".ace_print-margin");if(o.a.checkUndefined(c)&&o.a.checkUndefined(c.style)&&(a=c.style.left),s.length>0)for(var u=s[0].getElementsByClassName("ace_line"),l=0;l0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=r()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=r()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}(),c=n(1),u=n.n(c),l=n(2),d=n.n(l),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===p(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=d()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return y("action",e)}},{key:"defaultTarget",value:function(e){var t=y("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return y("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}]),t}(u.a);function y(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}t.default=h}]).default}}]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy