pull/120/head v2.2.5
sentsin 7 years ago
parent 2ee10f2ea5
commit e8aaa43122

1
.gitignore vendored

@ -27,5 +27,6 @@ dir.txt
release/
build/
rc/
coverage/

@ -1,5 +1,6 @@
# 更新日志
* [2.2.5](http://www.layui.com/doc/base/changelog.html#2-2-5)
* [2.2.45](http://www.layui.com/doc/base/changelog.html#2-2-45)
* [2.2.4](http://www.layui.com/doc/base/changelog.html#2-2-4)
* [2.2.3](http://www.layui.com/doc/base/changelog.html#2-2-3)

@ -1,7 +1,7 @@
{
"name": "layui",
"main": "src/layui.js",
"version": "2.2.45",
"version": "2.2.5",
"homepage": "https://github.com/sentsin/layui",
"authors": [
"sentsin <xu@sentsin.com>"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Binary file not shown.

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"&#xe619;":"&#xe603;")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"&#xe61a;":"&#xe602;")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon ">&#xe63e;</i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"&#x4E0A;&#x4E00;&#x9875;",a.next="next"in a?a.next:"&#x4E0B;&#x4E00;&#x9875;";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="&#x9996;&#x9875;">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">&#x2026;</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">&#x2026;</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="&#x5C3E;&#x9875;" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),skip:function(){return['<span class="layui-laypage-skip">&#x5230;&#x7B2C;','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','&#x9875;<button type="button" class="layui-laypage-btn">&#x786e;&#x5b9a;</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")},error:function(e,r){var c="Laytpl Error";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["&#xe623;","&#xe625;"],checkbox:["&#xe626;","&#xe627;"],radio:["&#xe62b;","&#xe62a;"],branch:["&#xe622;","&#xe624;"],leaf:"&#xe621;"};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('<ul class="'+(n.spread?"layui-show":"")+'"></ul>'),s=o(["<li "+(n.spread?'data-spread="'+n.spread+'"':"")+">",function(){return l?'<i class="layui-icon layui-tree-spread">'+(n.spread?t.arrow[1]:t.arrow[0])+"</i>":""}(),function(){return r.check?'<i class="layui-icon layui-tree-check">'+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"</i>":""}(),function(){return'<a href="'+(n.href||"javascript:;")+'" '+(r.target&&n.href?'target="'+r.target+'"':"")+">"+('<i class="layui-icon layui-tree-'+(l?"branch":"leaf")+'">'+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"</i>")+("<cite>"+(n.name||"未命名")+"</cite></a>")}(),"</li>"].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('<div class="layui-box '+t+'"></div>'));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v2.2.45 MIT License By http://www.layui.com */
;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"&#xe606;":e.bar1,e.bar2=e.bar2===!0?"&#xe607;":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,"&#xe604;"],g=t(['<ul class="'+a+'">',e.bar1?'<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>":"",e.bar2?'<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+r+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o<t;o++)i+="0";return e<Math.pow(10,t)?i+(0|e):e},toDateString:function(e,t){var i=this,o=new Date(parseInt(e)||new Date),a=[i.digit(o.getFullYear(),4),i.digit(o.getMonth()+1),i.digit(o.getDate())],r=[i.digit(o.getHours()),i.digit(o.getMinutes()),i.digit(o.getSeconds())];return t=t||"yyyy-MM-dd HH:mm:ss",t.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,r[0]).replace(/mm/g,r[1]).replace(/ss/g,r[2])}};e("util",i)});
/** layui-v2.2.5 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"&#xe606;":e.bar1,e.bar2=e.bar2===!0?"&#xe607;":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,"&#xe604;"],g=t(['<ul class="'+a+'">',e.bar1?'<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>":"",e.bar2?'<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+r+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o<t;o++)i+="0";return e<Math.pow(10,t)?i+(0|e):e},toDateString:function(e,t){var i=this,o=new Date(e||new Date),a=[i.digit(o.getFullYear(),4),i.digit(o.getMonth()+1),i.digit(o.getDate())],r=[i.digit(o.getHours()),i.digit(o.getMinutes()),i.digit(o.getSeconds())];return t=t||"yyyy-MM-dd HH:mm:ss",t.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,r[0]).replace(/mm/g,r[1]).replace(/ss/g,r[2])}};e("util",i)});

6
dist/layui.all.js vendored

File diff suppressed because one or more lines are too long

4
dist/layui.js vendored

File diff suppressed because one or more lines are too long

@ -111,7 +111,7 @@ body{padding: 10px;}
<div class="layui-inline">
<label class="layui-form-label">select分组</label>
<div class="layui-input-block">
<select name="quiz">
<select name="quiz" lay-filter="quiz">
<option value="">请选择问题</option>
<optgroup label="城市记忆">
<option value="你工作的第一个城市">你工作的第一个城市</option>
@ -128,7 +128,7 @@ body{padding: 10px;}
<div class="layui-form-item">
<label class="layui-form-label">选择框</label>
<div class="layui-input-block">
<select name="interest" lay-filter="aihao">
<select name="interest" lay-filter="interest">
<option value=""></option>
<option value="0">写作</option>
<option value="1" selected>阅读</option>
@ -142,7 +142,7 @@ body{padding: 10px;}
<div class="layui-form-item">
<label class="layui-form-label">搜索选择框</label>
<div class="layui-input-inline">
<select name="interest" lay-filter="aihao" lay-search lay-write>
<select name="interest-search" lay-filter="interest-search" lay-search lay-write>
<option value=""></option>
<option value="0">写作</option>
<option value="1">阅读</option>
@ -236,13 +236,19 @@ layui.use('form', function(){
//事件监听
form.on('select', function(data){
console.log(this);
})
console.log('select: ', this, data);
});
form.on('select(aihao)', function(data){
console.log(data);
form.on('select(quiz)', function(data){
console.log('select.quiz', this, data);
});
form.on('select(interest)', function(data){
console.log('select.interest: ', this, data);
});
form.on('checkbox', function(data){
console.log(this.checked, data.elem.checked);
});

@ -19,6 +19,9 @@ body{padding: 20px;}
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<div class="layui-hide-xs layui-show-sm-inline layui-show-md-block">
移动:隐藏
<br>平板inline

@ -218,7 +218,7 @@ gulp.task('laydate', function(){
//打包 LayIM 版本
gulp.task('layim', function(){
var dir = './release/zip/layui.layim-v'+ inds.layim;
var dir = './release/zip/layim-v'+ inds.layim;
gulp.src('./release/doc-layim/**/*')
.pipe(gulp.dest(dir))

@ -1,9 +1,9 @@
{
"name": "layui-src",
"realname": "layui",
"version": "2.2.45",
"version": "2.2.5",
"independents": {
"layim": "3.7.5"
"layim": "3.7.6"
},
"description": "Classic modular front-end component library",
"main": "layui.js",

@ -61,6 +61,291 @@ a cite{font-style: normal; *cursor:pointer;}
-moz-osx-font-smoothing: grayscale;
}
/* 临时 */
.layui-icon-duihua:before { content: "\e611"; }
.layui-icon-shezhi:before { content: "\e614"; }
.layui-icon-yinshenim:before { content: "\e60f"; }
.layui-icon-search:before { content: "\e615"; }
.layui-icon-fenxiang1:before { content: "\e641"; }
.layui-icon-shezhi1:before { content: "\e620"; }
.layui-icon-yinqing:before { content: "\e628"; }
.layui-icon-yuejuancuohao:before { content: "\1006"; }
.layui-icon-cuo:before { content: "\1007"; }
.layui-icon-baobiao:before { content: "\e629"; }
.layui-icon-star:before { content: "\e600"; }
.layui-icon-yuandian:before { content: "\e617"; }
.layui-icon-chat:before { content: "\e606"; }
.layui-icon-logo:before { content: "\e609"; }
.layui-icon-list:before { content: "\e60a"; }
.layui-icon-tubiao:before { content: "\e62c"; }
.layui-icon-right:before { content: "\1005"; }
.layui-icon-huanfu2:before { content: "\e61b"; }
.layui-icon-On-line:before { content: "\e610"; }
.layui-icon-biaoge:before { content: "\e62d"; }
.layui-icon-youyou:before { content: "\e602"; }
.layui-icon-zuozuo:before { content: "\e603"; }
.layui-icon-cart-simple:before { content: "\e698"; }
.layui-icon-cry:before { content: "\e69c"; }
.layui-icon-smile:before { content: "\e6af"; }
.layui-icon-survey:before { content: "\e6b2"; }
.layui-icon-tree:before { content: "\e62e"; }
.layui-icon-iconfont17:before { content: "\e62f"; }
.layui-icon-tianjia:before { content: "\e61f"; }
.layui-icon-xiazai:before { content: "\e601"; }
.layui-icon-xuanzemoban48:before { content: "\e630"; }
.layui-icon-gongju:before { content: "\e631"; }
.layui-icon-face-surprised:before { content: "\e664"; }
.layui-icon-bianji:before { content: "\e642"; }
.layui-icon-speaker:before { content: "\e645"; }
.layui-icon-xiangxia:before { content: "\e61a"; }
.layui-icon-wenjian:before { content: "\e621"; }
.layui-icon-layouts:before { content: "\e632"; }
.layui-icon-duigou:before { content: "\e618"; }
.layui-icon-tianjia1:before { content: "\e608"; }
.layui-icon-yaoyaozhibofanye:before { content: "\e633"; }
.layui-icon-read:before { content: "\e705"; }
.layui-icon-404:before { content: "\e61c"; }
.layui-icon-lunbozutu:before { content: "\e634"; }
.layui-icon-help:before { content: "\e607"; }
.layui-icon-daima1:before { content: "\e635"; }
.layui-icon-jinshui:before { content: "\e636"; }
.layui-icon-find-fill:before { content: "\e670"; }
.layui-icon-about:before { content: "\e60b"; }
.layui-icon-location:before { content: "\e715"; }
.layui-icon-xiangshang:before { content: "\e619"; }
.layui-icon-pause:before { content: "\e651"; }
.layui-icon-riqi:before { content: "\e637"; }
.layui-icon-uploadfile:before { content: "\e61d"; }
.layui-icon-delete:before { content: "\e640"; }
.layui-icon-play:before { content: "\e652"; }
.layui-icon-top:before { content: "\e604"; }
.layui-icon-haoyouqingqiu:before { content: "\e612"; }
.layui-icon-weibiaoti1:before { content: "\e605"; }
.layui-icon-chuangkou:before { content: "\e638"; }
.layui-icon-comiisbiaoqing:before { content: "\e60c"; }
.layui-icon-zhengque:before { content: "\e616"; }
.layui-icon-dollar:before { content: "\e659"; }
.layui-icon-iconfontwodehaoyou:before { content: "\e613"; }
.layui-icon-wenjianxiazai:before { content: "\e61e"; }
.layui-icon-tupian:before { content: "\e60d"; }
.layui-icon-lianjie:before { content: "\e64c"; }
.layui-icon-diamond:before { content: "\e735"; }
.layui-icon-jilu:before { content: "\e60e"; }
.layui-icon-liucheng:before { content: "\e622"; }
.layui-icon-fontstrikethrough:before { content: "\e64f"; }
.layui-icon-unlink:before { content: "\e64d"; }
.layui-icon-bianjiwenzi:before { content: "\e639"; }
.layui-icon-sanjiao:before { content: "\e623"; }
.layui-icon-danxuankuanghouxuan:before { content: "\e63f"; }
.layui-icon-danxuankuangxuanzhong:before { content: "\e643"; }
.layui-icon-juzhongduiqi:before { content: "\e647"; }
.layui-icon-youduiqi:before { content: "\e648"; }
.layui-icon-zuoduiqi:before { content: "\e649"; }
.layui-icon-gongsisvgtubiaozongji22:before { content: "\e626"; }
.layui-icon-gongsisvgtubiaozongji23:before { content: "\e627"; }
.layui-icon-refresh-2:before { content: "\1002"; }
.layui-icon-loading-1:before { content: "\e63e"; }
.layui-icon-return:before { content: "\e65c"; }
.layui-icon-jiacu:before { content: "\e62b"; }
.layui-icon-uploading:before { content: "\e67c"; }
.layui-icon-liaotianduihuaimgoutong:before { content: "\e63a"; }
.layui-icon-video:before { content: "\e6ed"; }
.layui-icon-headset:before { content: "\e6fc"; }
.layui-icon-wenjianjiafan:before { content: "\e624"; }
.layui-icon-shouji:before { content: "\e63b"; }
.layui-icon-tianjia2:before { content: "\e654"; }
.layui-icon-wenjianjia:before { content: "\e7a0"; }
.layui-icon-biaoqing:before { content: "\e650"; }
.layui-icon-html:before { content: "\e64b"; }
.layui-icon-biaodan:before { content: "\e63c"; }
.layui-icon-cart:before { content: "\e657"; }
.layui-icon-camera-fill:before { content: "\e65d"; }
.layui-icon-25:before { content: "\e62a"; }
.layui-icon-emwdaima:before { content: "\e64e"; }
.layui-icon-fire:before { content: "\e756"; }
.layui-icon-set:before { content: "\e716"; }
.layui-icon-zitixiahuaxian:before { content: "\e646"; }
.layui-icon-sanjiao1:before { content: "\e625"; }
.layui-icon-tips:before { content: "\e702"; }
.layui-icon-tupian-copy-copy:before { content: "\e64a"; }
.layui-icon-more-vertical:before { content: "\e671"; }
.layui-icon-zhuti2:before { content: "\e66c"; }
.layui-icon-loading:before { content: "\e63d"; }
.layui-icon-xieti:before { content: "\e644"; }
.layui-icon-refresh-1:before { content: "\e666"; }
.layui-icon-rmb:before { content: "\e65e"; }
.layui-icon-home:before { content: "\e68e"; }
.layui-icon-user:before { content: "\e770"; }
.layui-icon-notice:before { content: "\e667"; }
.layui-icon-voice:before { content: "\e688"; }
.layui-icon-download:before { content: "\e681"; }
.layui-icon-snowflake:before { content: "\e6b1"; }
.layui-icon-yemian1:before { content: "\e655"; }
.layui-icon-template:before { content: "\e663"; }
.layui-icon-auz:before { content: "\e672"; }
.layui-icon-console:before { content: "\e665"; }
.layui-icon-app:before { content: "\e653"; }
.layui-icon-xiayiye:before { content: "\e65a"; }
.layui-icon-website:before { content: "\e7ae"; }
.layui-icon-xiayiye1:before { content: "\e65b"; }
.layui-icon-component:before { content: "\e857"; }
.layui-icon-more:before { content: "\e65f"; }
.layui-icon-shrink-right:before { content: "\e668"; }
.layui-icon-spread-left:before { content: "\e66b"; }
.layui-icon-camera:before { content: "\e660"; }
.layui-icon-note:before { content: "\e66e"; }
.layui-icon-refresh:before { content: "\e669"; }
.layui-icon-nv:before { content: "\e661"; }
.layui-icon-nan:before { content: "\e662"; }
.layui-icon-senior:before { content: "\e674"; }
.layui-icon-theme:before { content: "\e66a"; }
.layui-icon-tread:before { content: "\e6c5"; }
.layui-icon-praise:before { content: "\e6c6"; }
.layui-icon-star-fill:before { content: "\e658"; }
.layui-icon-template-1:before { content: "\e656"; }
.layui-icon-loading-2:before { content: "\e66d"; }
/* 基本布局 */
.layui-main{position: relative; width: 1140px; margin: 0 auto;}
@ -119,14 +404,16 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-col-xs-offset11{margin-left: 91.66666667%;}
.layui-col-xs-offset12{margin-left: 100%;}
/* 超小屏幕(手机) */@media screen and (max-width: 768px) {
/* 超小屏幕(手机) */
@media screen and (max-width: 768px) {
.layui-hide-xs{display: none!important;}
.layui-show-xs-block{display: block!important;}
.layui-show-xs-inline{display: inline!important;}
.layui-show-xs-inline-block{display: inline-block!important;}
}
/* 小型屏幕(平板) */@media screen and (min-width: 768px) {
/* 小型屏幕(平板) */
@media screen and (min-width: 768px) {
.layui-container{width: 750px;}
.layui-hide-sm{display: none!important;}
.layui-show-sm-block{display: block!important;}
@ -160,7 +447,8 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-col-sm-offset11{margin-left: 91.66666667%;}
.layui-col-sm-offset12{margin-left: 100%;}
}
/* 中型屏幕(桌面) */@media screen and (min-width: 992px) {
/* 中型屏幕(桌面) */
@media screen and (min-width: 992px) {
.layui-container{width: 970px;}
.layui-hide-md{display: none!important;}
.layui-show-md-block{display: block!important;}
@ -194,7 +482,8 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-col-md-offset11{margin-left: 91.66666667%;}
.layui-col-md-offset12{margin-left: 100%;}
}
/* 大型屏幕(桌面) */@media screen and (min-width: 1200px) {
/* 大型屏幕(桌面) */
@media screen and (min-width: 1200px) {
.layui-container{width: 1170px;}
.layui-hide-lg{display: none!important;}
.layui-show-lg-block{display: block!important;}
@ -271,16 +560,16 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-progress-bar{position: absolute; left: 0; top: 0; width: 0; max-width: 100%; height: 6px; border-radius: 20px; text-align: right; background-color: #5FB878; transition: all .3s; -webkit-transition: all .3s;}
.layui-progress-big,
.layui-progress-big .layui-progress-bar{height: 18px; line-height: 18px;}
.layui-progress-text{position: relative; top: -18px; line-height: 18px; font-size: 12px; color: #666}
.layui-progress-text{position: relative; top: -20px; line-height: 18px; font-size: 12px; color: #666}
.layui-progress-big .layui-progress-text{position: static; padding: 0 10px; color: #fff;}
/* 卡片面板 */
.layui-card{margin-bottom: 15px; border-radius: 2px; background-color: #fff; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);}
.layui-card:last-child{margin-bottom: 0;}
.layui-card-header{position: relative; height: 42px; line-height: 42px; padding: 0 15px; border-bottom: 1px solid #f6f6f6; color: #333; border-radius: 2px 2px 0 0; font-size: 14px;}
.layui-card-body{position: relative; padding: 10px 15px; line-height: 24px;}
.layui-card-body .layui-table{margin: 5px 0;}
.layui-card .layui-tab{margin: 0;}
/*
*/
/* 折叠面板 */
.layui-collapse{border-width: 1px; border-style: solid; border-radius: 2px;}
@ -291,6 +580,29 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-colla-content{display: none; padding: 10px 15px; line-height: 22px; color: #666;}
.layui-colla-icon{position: absolute; left: 15px; top: 0; font-size: 14px;}
/* 卡片面板 */
.layui-card{margin-bottom: 15px; border-radius: 2px; background-color: #fff; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);}
.layui-card:last-child{margin-bottom: 0;}
.layui-card-header{position: relative; height: 42px; line-height: 42px; padding: 0 15px; border-bottom: 1px solid #f6f6f6; color: #333; border-radius: 2px 2px 0 0; font-size: 14px;}
.layui-card-body{position: relative; padding: 10px 15px; line-height: 24px;}
.layui-card-body .layui-table{margin: 5px 0;}
.layui-card .layui-tab{margin: 0;}
/* 常规面板 */
.layui-panel{}
/* 窗口面板 */
.layui-panel-window{position: relative; padding: 15px; border-radius: 0; border-top: 5px solid #E6E6E6; background-color: #fff;}
/*
*/
/* 背景颜色 */
.layui-bg-red{background-color: #FF5722 !important; color: #fff!important;} /*赤*/
.layui-bg-orange{background-color: #FFB800!important; color: #fff!important;} /*橙*/
@ -300,12 +612,6 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-bg-black{background-color: #393D49!important; color: #fff!important;} /*黑*/
.layui-bg-gray{background-color: #eee!important; color: #666!important;} /*灰*/
/*
*/
/* 边框 */
.layui-quote-nm,
.layui-elem-field,
@ -341,11 +647,24 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
.layui-text em,
.layui-word-aux{color: #999 !important; padding: 0 5px !important;}
/* 按钮 */
/*
*/
.layui-btn{display: inline-block; vertical-align: middle; height: 38px; line-height: 38px; padding: 0 18px; background-color: #009688; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
.layui-btn:hover{opacity: 0.8; filter:alpha(opacity=80); color: #fff;}
.layui-btn:active{opacity: 1; filter:alpha(opacity=100);}
.layui-btn+.layui-btn{margin-left: 10px;}
/* 按钮容器 */
.layui-btn-container{font-size: 0;}
.layui-btn-container .layui-btn{margin-right: 10px; margin-bottom: 10px;}
.layui-btn-container .layui-btn+.layui-btn{margin-left: 0;}
.layui-table .layui-btn-container .layui-btn{margin-bottom: 9px;}
/* 圆角 */.layui-btn-radius{border-radius: 100px;}
.layui-btn .layui-icon{margin-right: 3px; font-size: 18px; vertical-align: bottom; vertical-align: middle\0;}
@ -370,6 +689,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
.layui-btn-group .layui-btn:last-child{border-radius: 0 2px 2px 0;}
.layui-btn-group .layui-btn+.layui-btn{margin-left: 0;}
.layui-btn-group+.layui-btn-group{margin-left: 10px;}
/* 流体 */.layui-btn-fluid{width: 100%;}
/** 表单 **/
.layui-input, .layui-textarea, .layui-select{height: 38px; line-height: 1.3; line-height: 38px\9; border-width: 1px; border-style: solid; background-color: #fff; border-radius: 2px;}
@ -388,7 +708,8 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
.layui-form-item{margin-bottom: 15px; clear: both; *zoom: 1;}
.layui-form-item:after{content:'\20'; clear: both; *zoom: 1; display: block; height:0;}
.layui-form-label{position: relative; float: left; display: block; padding: 9px 15px; width: 80px; font-weight:normal;line-height: 20px; text-align: right;}
.layui-form-label{position: relative; float: left; display: block; padding: 9px 15px; width: 80px; font-weight: 400; line-height: 20px; text-align: right;}
.layui-form-label-col{display: block; float: none; padding: 9px 0; line-height: 20px; text-align: left;}
.layui-form-item .layui-inline{margin-bottom: 5px; margin-right: 10px;}
.layui-input-block, .layui-input-inline{position: relative;}
.layui-input-block{margin-left: 110px; min-height: 36px;}
@ -396,7 +717,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
.layui-form-item .layui-input-inline{float: left; width: 190px; margin-right: 10px;}
.layui-form-text .layui-input-inline{width: auto;}
/* 分割块 */.layui-form-mid{position: relative; float: left; display: block; padding: 8px 0 !important; line-height: 20px; margin-right: 10px;}
/* 分割块 */.layui-form-mid{position: relative; float: left; display: block; padding: 9px 0 !important; line-height: 20px; margin-right: 10px;}
/* 警告域 */.layui-form-danger:focus
,.layui-form-danger+.layui-form-select .layui-input{border-color: #FF5722 !important;}
@ -457,12 +778,12 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
.layui-checkbox-disbaled:hover i{color: #fff !important;}
/* 单选框 */
*[lay-radio]{display: none;}
.layui-form-radio{display: inline-block; vertical-align: middle; line-height: 28px; margin: 6px 10px 0 0; padding-right: 10px; cursor: pointer; font-size: 0;}
.layui-form-radio *{display: inline-block; vertical-align: middle;}
.layui-form-radio i{margin-right: 8px; font-size: 22px; color: #c2c2c2;}
.layui-form-radio span{font-size: 14px;}
.layui-form-radioed i,.layui-form-radio i:hover{color: #5FB878;}
.layui-radio-disbaled i{color: #e2e2e2 !important;}
.layui-form-radio *{display: inline-block; vertical-align: middle; font-size: 14px;}
.layui-form-radio>i{margin-right: 8px; font-size: 22px; color: #c2c2c2;}
.layui-form-radioed>i,.layui-form-radio>i:hover{color: #5FB878;}
.layui-radio-disbaled>i{color: #e2e2e2 !important;}
/* 表单方框风格 */.layui-form-pane .layui-form-label{width: 110px; padding: 8px 15px; height: 38px; line-height: 20px; border-width: 1px; border-style: solid; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box;}
.layui-form-pane .layui-input-inline{margin-left: -1px;}

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Binary file not shown.

@ -62,7 +62,7 @@ layui.define('jquery', function(exports){
,tabElem = $('.layui-tab[lay-filter='+ filter +']')
,titElem = tabElem.children(TITLE)
,liElem = titElem.find('>li[lay-id="'+ layid +'"]');
call.tabClick(null, null, liElem);
call.tabClick.call(liElem[0], null, null, liElem);
return this;
};
@ -193,7 +193,7 @@ layui.define('jquery', function(exports){
}
}
//点击选中
//点击选中导航菜单
,clickThis: function(){
var othis = $(this), parents = othis.parents(NAV_ELEM)
,filter = parents.attr('lay-filter')

@ -376,14 +376,21 @@ layui.define('layer', function(exports){
var othis = $(this), hasRender = othis.next('.' + CLASS), disabled = this.disabled;
if(typeof othis.attr('lay-ignore') === 'string') return othis.show();
hasRender[0] && hasRender.remove(); //如果已经渲染则Rerender
//替代元素
var reElem = $(['<div class="layui-unselect '+ CLASS + (radio.checked ? (' '+CLASS+'ed') : '') + (disabled ? ' layui-radio-disbaled '+DISABLED : '') +'">'
,'<i class="layui-anim layui-icon">'+ ICON[radio.checked ? 0 : 1] +'</i>'
,'<span>'+ (radio.title||'未命名') +'</span>'
,'<div>'+ function(){
var title = radio.title || '';
if(typeof othis.next().attr('lay-radio') === 'string'){
title = othis.next().html();
othis.next().remove();
}
return title
}() +'</div>'
,'</div>'].join(''));
hasRender[0] && hasRender.remove(); //如果已经渲染则Rerender
othis.after(reElem);
events.call(this, reElem);
});

@ -1,6 +1,6 @@
/**
@Namelayer v3.1.1 Web弹层组件
@Namelayer v3.1.2 Web弹层组件
@Author贤心
@Sitehttp://layer.layui.com
@LicenseMIT
@ -982,8 +982,8 @@ layer.prompt = function(options, yes){
style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"';
delete options.area;
}
var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'>' + (options.value||'') +'</textarea>' : function(){
return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input" value="'+ (options.value||'') +'">';
var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'></textarea>' : function(){
return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input">';
}();
var success = options.success;
@ -997,7 +997,7 @@ layer.prompt = function(options, yes){
,maxWidth: win.width()
,success: function(layero){
prompt = layero.find('.layui-layer-input');
prompt.focus();
prompt.val(options.value || '').focus();
typeof success === 'function' && success(layero);
}
,resize: false

@ -192,6 +192,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
limit: 10 //每页显示的数量
,loading: true //请求数据时是否显示loading
,cellMinWidth: 60 //所有单元格默认最小宽度
,text: {
none: '无数据'
}
};
//表格渲染
@ -417,10 +420,11 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
,success: function(res){
if(res[response.statusName] != response.statusCode){
that.renderForm();
return that.layMain.html('<div class="'+ NONE +'">'+ (res[response.msgName] || '返回的数据状态异常') +'</div>');
that.layMain.html('<div class="'+ NONE +'">'+ (res[response.msgName] || '返回的数据状态异常') +'</div>');
} else {
that.renderData(res, curr, res[response.countName]), sort();
options.time = (new Date().getTime() - that.startTime) + ' ms'; //耗时(接口请求+视图渲染)
}
that.renderData(res, curr, res[response.countName]), sort();
options.time = (new Date().getTime() - that.startTime) + ' ms'; //耗时(接口请求+视图渲染)
loadIndex && layer.close(loadIndex);
typeof options.done === 'function' && options.done(res, curr, res[response.countName]);
}
@ -548,8 +552,11 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
if(item3.toolbar){
return laytpl($(item3.toolbar).html()||'').render(tplData);
}
return item3.templet ? laytpl($(item3.templet).html() || String(content)).render(tplData) : content;
return item3.templet ? function(){
return typeof item3.templet === 'function'
? item3.templet(tplData)
: laytpl($(item3.templet).html() || String(content)).render(tplData)
}() : content;
}()
,'</div></td>'].join('');
@ -583,6 +590,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
that.key = options.id || options.index;
table.cache[that.key] = data; //记录数据
//显示隐藏分页栏
that.layPage[data.length === 0 && curr == 1 ? 'addClass' : 'removeClass'](HIDE);
//排序
if(sort){
return render();
@ -593,7 +603,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
that.layFixed.remove();
that.layMain.find('tbody').html('');
that.layMain.find('.'+ NONE).remove();
return that.layMain.append('<div class="'+ NONE +'">无数据</div>');
return that.layMain.append('<div class="'+ NONE +'">'+ options.text.none +'</div>');
}
render();

@ -143,7 +143,7 @@ layui.define('jquery', function(exports){
//转化为日期格式字符
,toDateString: function(time, format){
var that = this
,date = new Date(parseInt(time) || new Date())
,date = new Date(time || new Date())
,ymd = [
that.digit(date.getFullYear(), 4)
,that.digit(date.getMonth() + 1)

@ -19,7 +19,7 @@
}
,Layui = function(){
this.v = '2.2.45'; //版本号
this.v = '2.2.5'; //版本号
}
//获取layui所在目录
@ -73,27 +73,33 @@
Layui.prototype.cache = config;
//定义模块
Layui.prototype.define = function(deps, callback){
Layui.prototype.define = function(deps, factory){
var that = this
,type = typeof deps === 'function'
,mods = function(){
typeof callback === 'function' && callback(function(app, exports){
,callback = function(){
var setApp = function(app, exports){
layui[app] = exports;
config.status[app] = true;
};
typeof factory === 'function' && factory(function(app, exports){
setApp(app, exports);
config.callback[app] = function(){
factory(setApp);
}
});
return this;
};
type && (
callback = deps,
factory = deps,
deps = []
);
if(layui['layui.all'] || (!layui['layui.all'] && layui['layui.mobile'])){
return mods.call(that);
return callback.call(that);
}
that.use(deps, mods);
that.use(deps, callback);
return that;
};
@ -243,6 +249,18 @@
return that;
};
//存储模块的回调
config.callback = {};
//重新执行模块的工厂函数
Layui.prototype.factory = function(modName){
if(layui[modName]){
return typeof config.callback[modName] === 'function'
? config.callback[modName]
: null;
}
};
//css内部加载器
Layui.prototype.addcss = function(firename, fn, cssname){
@ -312,7 +330,8 @@
};
if(!/^#\//.test(hash)) return data; //禁止非路由规范
hash = hash.replace(/^#\//, '').replace(/([^#])(#.*$)/, '$1').split('/') || [];
data.href = hash = hash.replace(/^#\//, '');
hash = hash.replace(/([^#])(#.*$)/, '$1').split('/') || [];
//提取Hash结构
that.each(hash, function(index, item){
@ -321,19 +340,20 @@
data.search[item[0]] = item[1];
}() : data.path.push(item);
});
return data;
};
//本地存储
Layui.prototype.data = function(table, settings){
//本地持久性存储
Layui.prototype.data = function(table, settings, storage){
table = table || 'layui';
storage = storage || localStorage;
if(!win.JSON || !win.JSON.parse) return;
//如果settings为null则删除表
if(settings === null){
return delete localStorage[table];
return delete storage[table];
}
settings = typeof settings === 'object'
@ -341,17 +361,22 @@
: {key: settings};
try{
var data = JSON.parse(localStorage[table]);
var data = JSON.parse(storage[table]);
} catch(e){
var data = {};
}
if('value' in settings) data[settings.key] = settings.value;
if(settings.remove) delete data[settings.key];
localStorage[table] = JSON.stringify(data);
storage[table] = JSON.stringify(data);
return settings.key ? data[settings.key] : data;
};
//本地会话性存储
Layui.prototype.sessionData = function(table, settings){
return this.data(table, settings, sessionStorage);
}
//设备信息
Layui.prototype.device = function(key){
@ -459,45 +484,60 @@
};
//阻止事件冒泡
Layui.prototype.stope = function(e){
e = e || win.event;
e.stopPropagation
? e.stopPropagation()
: e.cancelBubble = true;
Layui.prototype.stope = function(thisEvent){
thisEvent = thisEvent || win.event;
try { thisEvent.stopPropagation() } catch(e){
thisEvent.cancelBubble = true;
}
};
//自定义模块事件
Layui.prototype.onevent = function(modName, events, callback){
if(typeof modName !== 'string'
|| typeof callback !== 'function') return this;
config.event[modName + '.' + events] = [callback];
//不再对多次事件监听做支持
/*
config.event[modName + '.' + events]
? config.event[modName + '.' + events].push(callback)
: config.event[modName + '.' + events] = [callback];
*/
return this;
return Layui.event(modName, events, null, callback);
};
//执行自定义模块事件
Layui.prototype.event = function(modName, events, params){
Layui.prototype.event = Layui.event = function(modName, events, params, fn){
var that = this
,result = null
,filter = events.match(/\(.*\)$/)||[] //提取事件过滤器
,set = (events = modName + '.'+ events).replace(filter, '') //获取事件本体名
,filter = events.match(/\((.*)\)$/)||[] //提取事件过滤器字符结构select(xxx)
,eventName = (modName + '.'+ events).replace(filter[0], '') //获取事件名称form.select
,filterName = filter[1] || '' //获取过滤器名称,xxx
,callback = function(_, item){
var res = item && item.call(that, params);
res === false && result === null && (result = false);
};
layui.each(config.event[set], callback);
filter[0] && layui.each(config.event[events], callback); //执行过滤器中的事件
//添加事件
if(fn){
config.event[eventName] = config.event[eventName] || {};
//这里不再对多次事件监听做支持,避免更多麻烦
//config.event[eventName][filterName] ? config.event[eventName][filterName].push(fn) :
config.event[eventName][filterName] = [fn];
return this;
}
//执行事件回调
layui.each(config.event[eventName], function(key, item){
//执行当前模块的全部事件
if(filterName === '{*}'){
layui.each(item, callback);
return;
}
//执行指定事件
key === '' && layui.each(item, callback);
key === filterName && layui.each(item, callback);
});
return result;
};
win.layui = new Layui();
}(window);

Loading…
Cancel
Save