filesbox/web/dist/20739.3819a43e.async.js
2024-07-26 14:10:54 +08:00

2 lines
6.4 KiB
JavaScript

(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[20739],{20739:function(y,B,z){y=z.nmd(y),ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace"],function(g,v,T){"use strict";var m=g("../lib/event"),M=g("../lib/useragent"),E=g("../lib/net"),w=g("../ace");T.exports=v=w;var k=function(e,c,t){var n=e.style[t];return n||(window.getComputedStyle?n=window.getComputedStyle(e,"").getPropertyValue(t):n=e.currentStyle[t]),(!n||n=="auto"||n=="intrinsic")&&(n=c.style[t]),n};function S(e,c){for(var t in c)e.style[t]=c[t]}function P(e,c){if(e.type!="textarea")throw new Error("Textarea required!");var t=e.parentNode,n=document.createElement("div"),s=function(){var r="position:relative;";["margin-top","margin-left","margin-right","margin-bottom"].forEach(function(i){r+=i+":"+k(e,n,i)+";"});var p=k(e,n,"width")||e.clientWidth+"px",a=k(e,n,"height")||e.clientHeight+"px";r+="height:"+a+";width:"+p+";",r+="display:inline-block;",n.setAttribute("style",r)};for(m.addListener(window,"resize",s),s(),t.insertBefore(n,e.nextSibling);t!==document;){if(t.tagName.toUpperCase()==="FORM"){var u=t.onsubmit;t.onsubmit=function(r){e.value=c(),u&&u.call(this,r)};break}t=t.parentNode}return n}v.transformTextarea=function(e,c){var t=e.autofocus||document.activeElement==e,n,s=P(e,function(){return n.getValue()});e.style.display="none",s.style.background="white";var u=document.createElement("div");S(u,{top:"0px",left:"0px",right:"0px",bottom:"0px",border:"1px solid gray",position:"absolute"}),s.appendChild(u);var r=document.createElement("div");S(r,{position:"absolute",right:"0px",bottom:"0px",cursor:"nw-resize",border:"solid 9px",borderColor:"lightblue gray gray #ceade6",zIndex:101});var p=document.createElement("div"),a={top:"0px",left:"20%",right:"0px",bottom:"0px",position:"absolute",padding:"5px",zIndex:100,color:"white",display:"none",overflow:"auto",fontSize:"14px",boxShadow:"-5px 2px 3px gray"};M.isOldIE?a.backgroundColor="#333":a.backgroundColor="rgba(0, 0, 0, 0.6)",S(p,a),s.appendChild(p),c=c||v.defaultOptions;var i=w.edit(u);n=i.getSession(),n.setValue(e.value||e.innerHTML),t&&i.focus(),s.appendChild(r),L(i,u,p,w,c),I(p,r,i);var x="";return m.addListener(r,"mousemove",function(d){var o=this.getBoundingClientRect(),b=d.clientX-o.left,h=d.clientY-o.top;b+h<(o.width+o.height)/2?(this.style.cursor="pointer",x="toggle"):(x="resize",this.style.cursor="nw-resize")}),m.addListener(r,"mousedown",function(d){if(d.preventDefault(),x=="toggle"){i.setDisplaySettings();return}s.style.zIndex=1e5;var o=s.getBoundingClientRect(),b=o.width+o.left-d.clientX,h=o.height+o.top-d.clientY;m.capture(r,function(l){s.style.width=l.clientX-o.left+b+"px",s.style.height=l.clientY-o.top+h+"px",i.resize()},function(){})}),i};function H(e,c,t){E.loadScript(e,function(){g([c],t)})}function L(e,c,t,n,s){var u=e.getSession(),r=e.renderer;function p(a){return a==="true"||a==!0}return e.setDisplaySettings=function(a){a==null&&(a=t.style.display=="none"),a?(t.style.display="block",t.hideButton.focus(),e.on("focus",function i(){e.removeListener("focus",i),t.style.display="none"})):e.focus()},e.$setOption=e.setOption,e.$getOption=e.getOption,e.setOption=function(a,i){switch(a){case"mode":e.$setOption("mode","ace/mode/"+i);break;case"theme":e.$setOption("theme","ace/theme/"+i);break;case"keybindings":switch(i){case"vim":e.setKeyboardHandler("ace/keyboard/vim");break;case"emacs":e.setKeyboardHandler("ace/keyboard/emacs");break;default:e.setKeyboardHandler(null)}break;case"wrap":case"fontSize":e.$setOption(a,i);break;default:e.$setOption(a,p(i))}},e.getOption=function(a){switch(a){case"mode":return e.$getOption("mode").substr("ace/mode/".length);case"theme":return e.$getOption("theme").substr("ace/theme/".length);case"keybindings":var i=e.getKeyboardHandler();switch(i&&i.$id){case"ace/keyboard/vim":return"vim";case"ace/keyboard/emacs":return"emacs";default:return"ace"}break;default:return e.$getOption(a)}},e.setOptions(s),e}function I(e,c,t){var n=null,s={mode:"Mode:",wrap:"Soft Wrap:",theme:"Theme:",fontSize:"Font Size:",showGutter:"Display Gutter:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},u={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",gob:"Green on Black",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},showGutter:n,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},wrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:n,useSoftTabs:n,showInvisibles:n},r=[];r.push("<table><tr><th>Setting</th><th>Value</th></tr>");function p(l,f,C,_){if(!C){l.push("<input type='checkbox' title='",f,"' ",_+""=="true"?"checked='true'":"","'></input>");return}l.push("<select title='"+f+"'>");for(var O in C)l.push("<option value='"+O+"' "),_==O&&l.push(" selected "),l.push(">",C[O],"</option>");l.push("</select>")}for(var a in v.defaultOptions)r.push("<tr><td>",s[a],"</td>"),r.push("<td>"),p(r,a,u[a],t.getOption(a)),r.push("</td></tr>");r.push("</table>"),e.innerHTML=r.join("");for(var i=function(l){var f=l.currentTarget;t.setOption(f.title,f.value)},x=function(l){var f=l.currentTarget;t.setOption(f.title,f.checked)},d=e.getElementsByTagName("select"),o=0;o<d.length;o++)d[o].onchange=i;for(var b=e.getElementsByTagName("input"),o=0;o<b.length;o++)b[o].onclick=x;var h=document.createElement("input");h.type="button",h.value="Hide",m.addListener(h,"click",function(){t.setDisplaySettings(!1)}),e.appendChild(h),e.hideButton=h}v.defaultOptions={mode:"javascript",theme:"textmate",wrap:"off",fontSize:"12px",showGutter:"false",keybindings:"ace",showPrintMargin:"false",useSoftTabs:"true",showInvisibles:"false"}}),function(){ace.require(["ace/ext/textarea"],function(g){y&&(y.exports=g)})}()}}]);