filesbox/web/dist/js/layer/layer.js

2 lines
22 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
/*! layer-v3.5.1 Web 通用弹出层组件 MIT License */(function(v,A){"use strict";var c,p,L=v.layui&&layui.define,d={getPath:function(){var t=document.currentScript?document.currentScript.src:function(){for(var n,a=document.scripts,i=a.length-1,o=i;o>0;o--)if(a[o].readyState==="interactive"){n=a[o].src;break}return n||a[i].src}(),e=v.LAYUI_GLOBAL||{};return e.layer_dir||t.substring(0,t.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,e){var n=t.currentStyle?t.currentStyle:v.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](e)},link:function(t,e,n){if(r.path){var a=document.getElementsByTagName("head")[0],i=document.createElement("link");typeof e=="string"&&(n=e);var o=(n||t).replace(/\.|\//g,""),f="layuicss-"+o,s="creating",y=0;i.rel="stylesheet",i.href=r.path+t,i.id=f,document.getElementById(f)||a.appendChild(i),typeof e=="function"&&function m(b){var w=100,h=document.getElementById(f);return++y>1e4/w?v.console&&console.error(o+".css: Invalid"):void(parseInt(d.getStyle(h,"width"))===1989?(b===s&&h.removeAttribute("lay-status"),h.getAttribute("lay-status")===s?setTimeout(m,w):e()):(h.setAttribute("lay-status",s),setTimeout(function(){m(s)},w)))}()}}},r={v:"3.5.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(v.ActiveXObject||"ActiveXObject"in v)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:v.layer&&v.layer.v?1e5:0,path:d.getPath,config:function(t,e){return t=t||{},r.cache=d.config=c.extend({},d.config,t),r.path=d.config.path||r.path,typeof t.extend=="string"&&(t.extend=[t.extend]),d.config.path&&r.ready(),t.extend?(L?layui.addcss("modules/layer/"+t.extend):d.link("theme/"+t.extend),this):this},ready:function(t){var e="layer",n="",a=(L?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+n;return L?layui.addcss(a,t,e):d.link(a,t,e),this},alert:function(t,e,n){var a=typeof e=="function";return a&&(n=e),r.open(c.extend({content:t,yes:n},a?{}:e))},confirm:function(t,e,n,a){var i=typeof e=="function";return i&&(a=n,n=e),r.open(c.extend({content:t,btn:d.btn,yes:n,btn2:a},i?{}:e))},msg:function(t,e,n){var a=typeof e=="function",i=d.config.skin,o=(i?i+" "+i+"-msg":"")||"layui-layer-msg",f=l.anim.length-1;return a&&(n=e),r.open(c.extend({content:t,time:3e3,shade:!1,skin:o,title:!1,closeBtn:!1,btn:!1,resize:!1,end:n},a&&!d.config.skin?{skin:o+" layui-layer-hui",anim:f}:function(){return e=e||{},(e.icon===-1||e.icon===A&&!d.config.skin)&&(e.skin=o+" "+(e.skin||"layui-layer-hui")),e}()))},load:function(t,e){return r.open(c.extend({type:3,icon:t||0,resize:!1,shade:.01},e))},tips:function(t,e,n){return r.open(c.extend({type:4,content:[t,e],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:260},n))}},x=function(t){var e=this,n=function(){e.creat()};e.index=++r.index,e.config.maxWidth=c(p).width()-30,e.config=c.extend({},e.config,d.config,t),document.body?n():setTimeout(function(){n()},30)};x.pt=x.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],l.SHADE="layui-layer-shade",l.MOVE="layui-layer-move",x.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,minStack:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},x.pt.vessel=function(t,e){var n=this,a=n.index,i=n.config,o=i.zIndex+a,f=typeof i.title=="object",s=i.maxmin&&(i.type===1||i.type===2),y=i.title?'<div class="layui-layer-title" style="'+(f?i.title[1]:"")+'">'+(f?i.title[0]:i.title)+"</div>":"";return i.zIndex=o,e([i.shade?'<div class="'+l.SHADE+'" id="'+l.SHADE+a+'" times="'+a+'" style="'+("z-index:"+(o-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+d.type[i.type])+(i.type!=0&&i.type!=2||i.shade?"":" layui-layer-borde