update
This commit is contained in:
		
							parent
							
								
									efb8652661
								
							
						
					
					
						commit
						5904e5b134
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -30,3 +30,4 @@ build/
 | 
			
		||||
rc/
 | 
			
		||||
 | 
			
		||||
coverage/
 | 
			
		||||
package-lock.json
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "layui",
 | 
			
		||||
  "main": "dist/layui.js",
 | 
			
		||||
  "version": "2.5.4",
 | 
			
		||||
  "version": "2.5.5",
 | 
			
		||||
  "homepage": "https://github.com/sentsin/layui",
 | 
			
		||||
  "authors": [
 | 
			
		||||
    "sentsin <xu@sentsin.com>"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/css/layui.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/css/layui.css
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/css/layui.mobile.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/css/layui.mobile.css
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/css/modules/code.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/css/modules/code.css
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.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}
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/css/modules/laydate/default/laydate.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/css/modules/laydate/default/laydate.css
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/css/modules/layer/default/layer.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/css/modules/layer/default/layer.css
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/carousel.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/carousel.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.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&&(clearInterval(e.timer),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?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</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)});
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/lay/modules/code.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/code.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.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,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),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");
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/lay/modules/colorpicker.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/colorpicker.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/element.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/element.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/flow.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/flow.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.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 "></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)});
 | 
			
		||||
							
								
								
									
										4
									
								
								dist/lay/modules/form.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/lay/modules/form.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/jquery.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/jquery.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/laydate.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/laydate.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/layedit.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/layedit.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/layer.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/layer.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/laypage.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/laypage.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.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:"上一页",a.next="next"in a?a.next:"下一页";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="首页">'+(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">…</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">…</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页"  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>"}(),refresh:['<a href="javascript:;" data-page="'+a.curr+'" class="layui-laypage-refresh">','<i class="layui-icon layui-icon-refresh"></i>',"</a>"].join(""),skip:function(){return['<span class="layui-laypage-skip">到第','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','页<button type="button" class="layui-laypage-btn">确定</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)});
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/lay/modules/laytpl.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/laytpl.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.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,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},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)});
 | 
			
		||||
							
								
								
									
										4
									
								
								dist/lay/modules/mobile.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/lay/modules/mobile.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/rate.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/rate.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.5 MIT License By https://www.layui.com */
 | 
			
		||||
 ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='<ul class="layui-rate" '+(i.readonly?"readonly":"")+">",u=1;u<=i.length;u++){var r='<li class="layui-inline"><i class="layui-icon '+(u>Math.floor(i.value)?o:s)+'" '+l+"></i></li>";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'<li><i class="layui-icon layui-icon-rate-half" '+l+"></i></li>":n+=r}n+="</ul>"+(i.text?'<span class="layui-inline">'+i.value+"星":"")+"</span>";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/lay/modules/slider.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/slider.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								dist/lay/modules/table.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/lay/modules/table.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								dist/lay/modules/transfer.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/lay/modules/transfer.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								dist/lay/modules/tree.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/lay/modules/tree.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								dist/lay/modules/upload.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/lay/modules/upload.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/lay/modules/util.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/lay/modules/util.js
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
 | 
			
		||||
/** layui-v2.5.5 MIT License By https://www.layui.com */
 | 
			
		||||
 ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['<ul class="'+a+'">',t.bar1?'<li class="layui-icon" lay-type="bar1" style="'+t.bgcolor+'">'+c[0]+"</li>":"",t.bar2?'<li class="layui-icon" lay-type="bar2" style="'+t.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+o+'" lay-type="top" style="'+t.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+o),u=function(){var e=r.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+a)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),n=i.attr("lay-type");"top"===n&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var n=this,a="function"==typeof e,o=new Date(t).getTime(),r=new Date(!e||a?(new Date).getTime():e).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=e);var g=setTimeout(function(){n.countdown(t,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(t).getTime();return a>6912e5?(a=new Date(t),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),e||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[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(t,e){var i="";t=String(t),e=e||2;for(var n=t.length;n<e;n++)i+="0";return t<Math.pow(10,e)?i+(0|t):t},toDateString:function(t,e){var i=this,n=new Date(t||new Date),a=[i.digit(n.getFullYear(),4),i.digit(n.getMonth()+1),i.digit(n.getDate())],o=[i.digit(n.getHours()),i.digit(n.getMinutes()),i.digit(n.getSeconds())];return e=e||"yyyy-MM-dd HH:mm:ss",e.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,o[0]).replace(/mm/g,o[1]).replace(/ss/g,o[2])},escape:function(t){return String(t||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(t,n,a){n=i.event[t]=e.extend(!0,i.event[t],n)||{},e("body").on(a||"click","*["+t+"]",function(){var i=e(this),a=i.attr(t);n[a]&&n[a].call(this,i)})}};!function(t,e,i){"$:nomunge";function n(){a=e[l](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,g);(i!==a.w||n!==a.h)&&e.trigger(c,[a.w=i,a.h=n])}),n()},r[s])}var a,o=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";r[s]=250,r[u]=!0,t.event.special[c]={setup:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.not(e),e.removeData(g),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var r=t(this),l=t.data(this,g)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[u]&&this[l])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(e,window),t("util",i)});
 | 
			
		||||
							
								
								
									
										6
									
								
								dist/layui.all.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								dist/layui.all.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								dist/layui.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/layui.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -219,7 +219,7 @@ layui.use(['form', 'layedit', 'laydate'], function(){
 | 
			
		||||
  });
 | 
			
		||||
  
 | 
			
		||||
  //初始赋值
 | 
			
		||||
  form.val('first', {
 | 
			
		||||
  var thisValue = form.val('first', {
 | 
			
		||||
    'title': '测试'
 | 
			
		||||
    ,'phone': 11111111111
 | 
			
		||||
    ,'email': 'xu@sentsin.com'
 | 
			
		||||
@ -232,6 +232,7 @@ layui.use(['form', 'layedit', 'laydate'], function(){
 | 
			
		||||
    ,'desc': 'form 是我们非常看重的一块'
 | 
			
		||||
    ,xxxxxxxxx: 123
 | 
			
		||||
  });
 | 
			
		||||
  console.log(thisValue);
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
  //事件监听
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@ body{padding:100px 0;}
 | 
			
		||||
layui.use('slider', function(){
 | 
			
		||||
  var slider = layui.slider;
 | 
			
		||||
  
 | 
			
		||||
  slider.render({
 | 
			
		||||
  var sliderInst = slider.render({
 | 
			
		||||
    elem: '#slideTest1'
 | 
			
		||||
    //,type: 'vertical'
 | 
			
		||||
    //,min: -20 //最小值
 | 
			
		||||
@ -45,6 +45,8 @@ layui.use('slider', function(){
 | 
			
		||||
    //,disabled: true //禁用滑块
 | 
			
		||||
    //,theme: '#c00' //主题色
 | 
			
		||||
  });
 | 
			
		||||
  
 | 
			
		||||
  sliderInst.setValue(48)
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
@ -32,7 +32,7 @@ body{padding: 20px; /*overflow-y: scroll;*/}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script type="text/html" id="usernameTpl">
 | 
			
		||||
  <a href="" class="layui-table-link">{{d.username || ''}}1</a>
 | 
			
		||||
  <a href="" class="layui-table-link">{{d.username || ''}}</a>
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script type="text/html" id="switchTpl">
 | 
			
		||||
@ -200,18 +200,22 @@ layui.use('table', function(){
 | 
			
		||||
    ,totalRow: true
 | 
			
		||||
    ,limit: 30
 | 
			
		||||
    ,toolbar: '#toolbarDemo'
 | 
			
		||||
    //,defaultToolbar: ['filter']
 | 
			
		||||
    ,defaultToolbar: ['filter', 'exports', 'print', {
 | 
			
		||||
      title: '帮助'
 | 
			
		||||
      ,layEvent: 'LAYTABLE_TIPS'
 | 
			
		||||
      ,icon: 'layui-icon-tips'
 | 
			
		||||
    }]
 | 
			
		||||
    ,cols: [[
 | 
			
		||||
      {type: 'checkbox', fixed: 'left'}
 | 
			
		||||
      ,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
 | 
			
		||||
      ,{field:'username', title:'用户名', width:120, edit: 'text', templet: '#usernameTpl'}
 | 
			
		||||
      ,{field:'email', title:'邮箱', hide: 0, width:150, edit: 'text', templet: function(x){
 | 
			
		||||
        return '<em>123</em>'
 | 
			
		||||
      ,{field:'email', title:'邮箱', hide: 0, width:150, edit: 'text', templet: function(d){
 | 
			
		||||
        return '<em>'+ d.email +'</em>'
 | 
			
		||||
      }}
 | 
			
		||||
      ,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
 | 
			
		||||
      ,{field:'city', title:'城市', width:120, templet: '#cityTpl1'}
 | 
			
		||||
      ,{field:'sign', title:'签名'}
 | 
			
		||||
      ,{field:'experience', title:'积分', width:80, sort: true, totalRow: true}
 | 
			
		||||
      ,{field:'experience', title:'积分', width:80, sort: true, totalRow: true, templet: '<div>{{ d.experience }} 分</div>'}
 | 
			
		||||
      ,{field:'ip', title:'IP', width:120}
 | 
			
		||||
      ,{field:'logins', title:'登入次数', width:100, sort: true, totalRow: true}
 | 
			
		||||
      ,{field:'joinTime', title:'加入时间', width:120}
 | 
			
		||||
@ -257,6 +261,9 @@ layui.use('table', function(){
 | 
			
		||||
      case 'isAll':
 | 
			
		||||
        layer.msg(checkStatus.isAll ? '全选': '未全选')
 | 
			
		||||
      break;
 | 
			
		||||
      case 'LAYTABLE_TIPS':
 | 
			
		||||
        layer.alert('Table for layui-v'+ layui.v);
 | 
			
		||||
      break;
 | 
			
		||||
      case 'reload':
 | 
			
		||||
        table.reload('test', {
 | 
			
		||||
          page: {curr: 5}
 | 
			
		||||
 | 
			
		||||
@ -75,6 +75,7 @@
 | 
			
		||||
          ,children: [{
 | 
			
		||||
            title: '四级1-1-1-1'
 | 
			
		||||
            ,id: 15
 | 
			
		||||
            //,checked: true
 | 
			
		||||
            ,href: 'https://www.layui.com/doc/base/infrastructure.html'
 | 
			
		||||
          }]
 | 
			
		||||
        },{
 | 
			
		||||
@ -164,6 +165,25 @@
 | 
			
		||||
      }]
 | 
			
		||||
    }];
 | 
			
		||||
    
 | 
			
		||||
    //数据源
 | 
			
		||||
    var data2 = [{
 | 
			
		||||
      title: '控制台'
 | 
			
		||||
      ,id: '1000'
 | 
			
		||||
      ,spread: true
 | 
			
		||||
      ,checked: true
 | 
			
		||||
      ,children: [{
 | 
			
		||||
        title: '概览'
 | 
			
		||||
        ,id: '1001'
 | 
			
		||||
        ,spread: true
 | 
			
		||||
        ,checked: true
 | 
			
		||||
      },{
 | 
			
		||||
        title: '域名'
 | 
			
		||||
        ,id: '1002'
 | 
			
		||||
        ,spread: true
 | 
			
		||||
        ,checked: true
 | 
			
		||||
      }]
 | 
			
		||||
    }]
 | 
			
		||||
 | 
			
		||||
    tree.render({
 | 
			
		||||
      elem: '#test1'
 | 
			
		||||
      ,data: data1
 | 
			
		||||
@ -173,7 +193,7 @@
 | 
			
		||||
        console.log(obj);
 | 
			
		||||
      }
 | 
			
		||||
      ,oncheck: function(obj){
 | 
			
		||||
        console.log(obj);
 | 
			
		||||
        //console.log(obj);
 | 
			
		||||
      }
 | 
			
		||||
      ,operate: function(obj){
 | 
			
		||||
        var type = obj.type;
 | 
			
		||||
@ -202,7 +222,7 @@
 | 
			
		||||
        console.log(checkedData);
 | 
			
		||||
      }
 | 
			
		||||
      ,setChecked: function(){
 | 
			
		||||
        tree.setChecked('demoId1', [12, 16]);
 | 
			
		||||
        tree.setChecked('demoId1', [1000, 1001, 1002]);
 | 
			
		||||
      }
 | 
			
		||||
      ,reload: function(){
 | 
			
		||||
        tree.reload('demoId1', {
 | 
			
		||||
@ -211,7 +231,6 @@
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    tree.render({
 | 
			
		||||
      elem: '#test2'
 | 
			
		||||
      ,data: data1
 | 
			
		||||
 | 
			
		||||
@ -24,6 +24,11 @@ hr{margin: 30px 0;}
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="layui-progress layui-progress-big" lay-showPercent="yes"  lay-filter="demo">
 | 
			
		||||
  <div class="layui-progress-bar" lay-percent=""></div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<hr>
 | 
			
		||||
 | 
			
		||||
<div class="layui-upload">
 | 
			
		||||
@ -82,14 +87,15 @@ hr{margin: 30px 0;}
 | 
			
		||||
 | 
			
		||||
<script src="../src/layui.js"></script>
 | 
			
		||||
<script>
 | 
			
		||||
layui.use('upload', function(){
 | 
			
		||||
layui.use(['upload', 'element'], function(){
 | 
			
		||||
  var $ = layui.jquery
 | 
			
		||||
  ,upload = layui.upload;
 | 
			
		||||
  ,upload = layui.upload
 | 
			
		||||
  ,element = layui.element;
 | 
			
		||||
 | 
			
		||||
  var uploadInst = upload.render({
 | 
			
		||||
    elem: '#test1'
 | 
			
		||||
    ,url: 'http://httpbin.org/image'
 | 
			
		||||
    ,size: 2000 //限制文件大小,单位 KB
 | 
			
		||||
    //,size: 2000 //限制文件大小,单位 KB
 | 
			
		||||
    //,accept: 'file'
 | 
			
		||||
    ,method: 'get'
 | 
			
		||||
    ,fileAccept: 'image/*'
 | 
			
		||||
@ -126,6 +132,12 @@ layui.use('upload', function(){
 | 
			
		||||
      demoText.find('.demo-reload').on('click', function(){
 | 
			
		||||
        uploadInst.upload();
 | 
			
		||||
      });
 | 
			
		||||
      
 | 
			
		||||
      element.progress('demo', '0%');
 | 
			
		||||
    }
 | 
			
		||||
    ,progress: function(n){
 | 
			
		||||
      console.log(n + '%'); //获取进度百分比
 | 
			
		||||
      element.progress('demo', n + '%'); //可配合 layui 进度条元素使用
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  
 | 
			
		||||
@ -134,7 +146,7 @@ layui.use('upload', function(){
 | 
			
		||||
    name:'avatar'
 | 
			
		||||
    ,accept: 'images' //只允许上传图片
 | 
			
		||||
    ,acceptMime: 'image/*' //只筛选图片
 | 
			
		||||
    ,size: 2
 | 
			
		||||
    //,size: 2
 | 
			
		||||
  });
 | 
			
		||||
  
 | 
			
		||||
  upload.render({
 | 
			
		||||
 | 
			
		||||
@ -92,7 +92,7 @@ var argv = require('minimist')(process.argv.slice(2), {
 | 
			
		||||
  ,mobile: function(ver){
 | 
			
		||||
    ver = ver === 'open';
 | 
			
		||||
 | 
			
		||||
    var mods = 'layer-mobile,zepto,upload-mobile', src = [
 | 
			
		||||
    var mods = 'layer-mobile,zepto', src = [
 | 
			
		||||
      './src/lay/all-mobile.js'
 | 
			
		||||
      ,'./src/lay/modules/laytpl.js'
 | 
			
		||||
      ,'./src/**/mobile/{'+ mods +'}.js'
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "layui-src",
 | 
			
		||||
  "realname": "layui",
 | 
			
		||||
  "version": "2.5.4",
 | 
			
		||||
  "version": "2.5.5",
 | 
			
		||||
  "independents": {
 | 
			
		||||
    "layim": "3.9.0"
 | 
			
		||||
    "layim": "3.9.1"
 | 
			
		||||
  },
 | 
			
		||||
  "description": "Classic modular front-end component library",
 | 
			
		||||
  "main": "dist/layui.js",
 | 
			
		||||
 | 
			
		||||
@ -70,14 +70,18 @@ layui.define('layer', function(exports){
 | 
			
		||||
    return layui.onevent.call(this, MOD_NAME, events, callback);
 | 
			
		||||
  };
 | 
			
		||||
  
 | 
			
		||||
  //初始赋值
 | 
			
		||||
  //赋值/取值
 | 
			
		||||
  Form.prototype.val = function(filter, object){
 | 
			
		||||
    var that = this
 | 
			
		||||
    ,formElem = $(ELEM + '[lay-filter="' + filter +'"]');
 | 
			
		||||
    
 | 
			
		||||
    //遍历
 | 
			
		||||
    formElem.each(function(index, item){
 | 
			
		||||
      var itemFrom = $(this);
 | 
			
		||||
      var itemForm = $(this);
 | 
			
		||||
      
 | 
			
		||||
      //赋值
 | 
			
		||||
      layui.each(object, function(key, value){
 | 
			
		||||
        var itemElem = itemFrom.find('[name="'+ key +'"]')
 | 
			
		||||
        var itemElem = itemForm.find('[name="'+ key +'"]')
 | 
			
		||||
        ,type;
 | 
			
		||||
        
 | 
			
		||||
        //如果对应的表单不存在,则不执行
 | 
			
		||||
@ -98,7 +102,38 @@ layui.define('layer', function(exports){
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    form.render(null, filter);
 | 
			
		||||
    
 | 
			
		||||
    //返回值
 | 
			
		||||
    return that.getValue(filter);
 | 
			
		||||
  };
 | 
			
		||||
  
 | 
			
		||||
  //取值
 | 
			
		||||
  Form.prototype.getValue = function(filter, itemForm){
 | 
			
		||||
    itemForm = itemForm || $(ELEM + '[lay-filter="' + filter +'"]').eq(0);
 | 
			
		||||
        
 | 
			
		||||
    var nameIndex = {} //数组 name 索引
 | 
			
		||||
    ,field = {}
 | 
			
		||||
    ,fieldElem = itemForm.find('input,select,textarea') //获取所有表单域
 | 
			
		||||
    
 | 
			
		||||
    layui.each(fieldElem, function(_, item){
 | 
			
		||||
      item.name = (item.name || '').replace(/^\s*|\s*&/, '');
 | 
			
		||||
      
 | 
			
		||||
      if(!item.name) return;
 | 
			
		||||
      
 | 
			
		||||
      //用于支持数组 name
 | 
			
		||||
      if(/^.*\[\]$/.test(item.name)){
 | 
			
		||||
        var key = item.name.match(/^(.*)\[\]$/g)[0];
 | 
			
		||||
        nameIndex[key] = nameIndex[key] | 0;
 | 
			
		||||
        item.name = item.name.replace(/^(.*)\[\]$/, '$1['+ (nameIndex[key]++) +']');
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      if(/^checkbox|radio$/.test(item.type) && !item.checked) return;      
 | 
			
		||||
      field[item.name] = item.value;
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    return field;
 | 
			
		||||
  };
 | 
			
		||||
  
 | 
			
		||||
  //表单控件渲染
 | 
			
		||||
@ -578,12 +613,14 @@ layui.define('layer', function(exports){
 | 
			
		||||
  
 | 
			
		||||
  //表单提交校验
 | 
			
		||||
  var submit = function(){
 | 
			
		||||
    var button = $(this), verify = form.config.verify, stop = null
 | 
			
		||||
    ,DANGER = 'layui-form-danger', field = {} ,elem = button.parents(ELEM)
 | 
			
		||||
    
 | 
			
		||||
    var stop = null //验证不通过状态
 | 
			
		||||
    ,verify = form.config.verify //验证规则
 | 
			
		||||
    ,DANGER = 'layui-form-danger' //警示样式
 | 
			
		||||
    ,field = {}  //字段集合
 | 
			
		||||
    ,button = $(this) //当前触发的按钮
 | 
			
		||||
    ,elem = button.parents(ELEM) //当前所在表单域
 | 
			
		||||
    ,verifyElem = elem.find('*[lay-verify]') //获取需要校验的元素
 | 
			
		||||
    ,formElem = button.parents('form')[0] //获取当前所在的form元素,如果存在的话
 | 
			
		||||
    ,fieldElem = elem.find('input,select,textarea') //获取所有表单域
 | 
			
		||||
    ,formElem = button.parents('form')[0] //获取当前所在的 form 元素,如果存在的话
 | 
			
		||||
    ,filter = button.attr('lay-filter'); //获取过滤器
 | 
			
		||||
   
 | 
			
		||||
    
 | 
			
		||||
@ -594,7 +631,9 @@ layui.define('layer', function(exports){
 | 
			
		||||
      ,verType = othis.attr('lay-verType') //提示方式
 | 
			
		||||
      ,value = othis.val();
 | 
			
		||||
      
 | 
			
		||||
      othis.removeClass(DANGER);
 | 
			
		||||
      othis.removeClass(DANGER); //移除警示样式
 | 
			
		||||
      
 | 
			
		||||
      //遍历元素绑定的验证规则
 | 
			
		||||
      layui.each(vers, function(_, thisVer){
 | 
			
		||||
        var isTrue //是否命中校验
 | 
			
		||||
        ,errorText = '' //错误提示文本
 | 
			
		||||
@ -644,24 +683,10 @@ layui.define('layer', function(exports){
 | 
			
		||||
    
 | 
			
		||||
    if(stop) return false;
 | 
			
		||||
    
 | 
			
		||||
    var nameIndex = {}; //数组 name 索引
 | 
			
		||||
    layui.each(fieldElem, function(_, item){
 | 
			
		||||
      item.name = (item.name || '').replace(/^\s*|\s*&/, '');
 | 
			
		||||
    //获取当前表单值
 | 
			
		||||
    field = form.getValue(null, elem);
 | 
			
		||||
 
 | 
			
		||||
      if(!item.name) return;
 | 
			
		||||
      
 | 
			
		||||
      //用于支持数组 name
 | 
			
		||||
      if(/^.*\[\]$/.test(item.name)){
 | 
			
		||||
        var key = item.name.match(/^(.*)\[\]$/g)[0];
 | 
			
		||||
        nameIndex[key] = nameIndex[key] | 0;
 | 
			
		||||
        item.name = item.name.replace(/^(.*)\[\]$/, '$1['+ (nameIndex[key]++) +']');
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      if(/^checkbox|radio$/.test(item.type) && !item.checked) return;      
 | 
			
		||||
      field[item.name] = item.value;
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
    //获取字段
 | 
			
		||||
    //返回字段
 | 
			
		||||
    return layui.event.call(this, MOD_NAME, 'submit('+ filter +')', {
 | 
			
		||||
      elem: this
 | 
			
		||||
      ,form: formElem
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  //解析自定义模板数据
 | 
			
		||||
  ,parseTempData = function(item3, content, tplData, text){
 | 
			
		||||
  ,parseTempData = function(item3, content, tplData, text){ //表头数据、原始内容、表体数据、是否只返回文本
 | 
			
		||||
    var str = item3.templet ? function(){
 | 
			
		||||
      return typeof item3.templet === 'function' 
 | 
			
		||||
        ? item3.templet(tplData)
 | 
			
		||||
@ -459,7 +459,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
    
 | 
			
		||||
    if(typeof options.defaultToolbar === 'object'){
 | 
			
		||||
      layui.each(options.defaultToolbar, function(i, item){
 | 
			
		||||
        var thisItem = layout[item];
 | 
			
		||||
        var thisItem = typeof item === 'string' ? layout[item] : item;
 | 
			
		||||
        if(thisItem){
 | 
			
		||||
          iconElem.push('<div class="layui-inline" title="'+ thisItem.title +'" lay-event="'+ thisItem.layEvent +'">'
 | 
			
		||||
            +'<i class="layui-icon '+ thisItem.icon +'"></i>'
 | 
			
		||||
@ -771,6 +771,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
        ,numbers = i1 + options.limit*(curr - 1) + 1; //序号
 | 
			
		||||
        
 | 
			
		||||
        if(item1.length === 0) return;
 | 
			
		||||
        
 | 
			
		||||
        if(!sort){
 | 
			
		||||
          item1[table.config.indexName] = i1;
 | 
			
		||||
        }
 | 
			
		||||
@ -942,12 +943,24 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    that.dataTotal = {};
 | 
			
		||||
    
 | 
			
		||||
    var tds = [];
 | 
			
		||||
    that.eachCols(function(i3, item3){
 | 
			
		||||
      var field = item3.field || i3;
 | 
			
		||||
      
 | 
			
		||||
      //td内容
 | 
			
		||||
      var td = ['<td data-field="'+ field +'" data-key="'+ options.index + '-'+ item3.key +'" '+ function(){
 | 
			
		||||
      var content = function(){
 | 
			
		||||
        var text = item3.totalRowText || ''
 | 
			
		||||
        ,thisTotalNum = parseFloat(totalNums[field]).toFixed(2)
 | 
			
		||||
        ,tplData = {};
 | 
			
		||||
        
 | 
			
		||||
        tplData[field] = thisTotalNum;
 | 
			
		||||
        thisTotalNum = parseTempData(item3, thisTotalNum, tplData);
 | 
			
		||||
        
 | 
			
		||||
        return item3.totalRow ? (thisTotalNum || text) : text;
 | 
			
		||||
      }()
 | 
			
		||||
      ,td = ['<td data-field="'+ field +'" data-key="'+ options.index + '-'+ item3.key +'" '+ function(){
 | 
			
		||||
        var attr = [];
 | 
			
		||||
        if(item3.align) attr.push('align="'+ item3.align +'"'); //对齐方式
 | 
			
		||||
        if(item3.style) attr.push('style="'+ item3.style +'"'); //自定义样式
 | 
			
		||||
@ -963,12 +976,10 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
          var str = (options.index + '-' + item3.key);
 | 
			
		||||
          return item3.type === 'normal' ? str 
 | 
			
		||||
          : (str + ' laytable-cell-' + item3.type);
 | 
			
		||||
        }() +'">' + function(){
 | 
			
		||||
          var text = item3.totalRowText || '';
 | 
			
		||||
          return item3.totalRow ? (parseFloat(totalNums[field]).toFixed(2) || text) : text;
 | 
			
		||||
        }()
 | 
			
		||||
        }() +'">' + content
 | 
			
		||||
      ,'</div></td>'].join('');
 | 
			
		||||
      
 | 
			
		||||
      item3.field && (that.dataTotal[field] = content);
 | 
			
		||||
      tds.push(td);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
@ -1332,7 +1343,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
              ,done: function(panel, list){
 | 
			
		||||
                list.on('click', function(){
 | 
			
		||||
                  var type = $(this).data('type')
 | 
			
		||||
                  table.exportFile(options.id, null, type);
 | 
			
		||||
                  table.exportFile.call(that, options.id, null, type);
 | 
			
		||||
                });
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
@ -1480,13 +1491,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
                  templet = item2.templet;
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
              td.children(ELEM_CELL).html(function(){
 | 
			
		||||
                return templet ? function(){
 | 
			
		||||
                  return typeof templet === 'function' 
 | 
			
		||||
                    ? templet(data)
 | 
			
		||||
                  : laytpl($(templet).html() || value).render(data)
 | 
			
		||||
                }() : value;
 | 
			
		||||
              }());
 | 
			
		||||
              td.children(ELEM_CELL).html(parseTempData({
 | 
			
		||||
                templet: templet
 | 
			
		||||
              }, value, data));
 | 
			
		||||
              td.data('content', value);
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
@ -1597,11 +1604,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      othis.siblings(ELEM_CELL).html(function(value){
 | 
			
		||||
        return templet ? function(){
 | 
			
		||||
          return typeof templet === 'function' 
 | 
			
		||||
            ? templet(data)
 | 
			
		||||
          : laytpl($(templet).html() || thisElem.value).render(data)
 | 
			
		||||
        }() : value;
 | 
			
		||||
        return parseTempData({
 | 
			
		||||
          templet: templet
 | 
			
		||||
        }, value, data);
 | 
			
		||||
      }(thisElem.value));
 | 
			
		||||
      othis.parent().data('content', thisElem.value);
 | 
			
		||||
      othis.remove();
 | 
			
		||||
@ -1706,6 +1711,14 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
      layer.close(that.tipsIndex);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    //自适应
 | 
			
		||||
    _WIN.on('resize', function(){
 | 
			
		||||
      that.resize();
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
  
 | 
			
		||||
  //一次性事件
 | 
			
		||||
  ;(function(){
 | 
			
		||||
    //全局点击
 | 
			
		||||
    _DOC.on('click', function(){
 | 
			
		||||
      _DOC.trigger('table.remove.tool.panel');
 | 
			
		||||
@ -1715,12 +1728,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
    _DOC.on('table.remove.tool.panel', function(){
 | 
			
		||||
      $('.layui-table-tool-panel').remove();
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    //自适应
 | 
			
		||||
    _WIN.on('resize', function(){
 | 
			
		||||
      that.resize();
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
  })();
 | 
			
		||||
  
 | 
			
		||||
  //初始化
 | 
			
		||||
  table.init = function(filter, settings){
 | 
			
		||||
@ -1870,6 +1878,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
  
 | 
			
		||||
  //表格导出
 | 
			
		||||
  table.exportFile = function(id, data, type){
 | 
			
		||||
    var that = this;
 | 
			
		||||
    
 | 
			
		||||
    data = data || table.clearCacheKey(table.cache[id]);
 | 
			
		||||
    type = type || 'csv';
 | 
			
		||||
    
 | 
			
		||||
@ -1883,10 +1893,12 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
    if(device.ie) return hint.error('IE_NOT_SUPPORT_EXPORTS');
 | 
			
		||||
    
 | 
			
		||||
    alink.href = 'data:'+ textType +';charset=utf-8,\ufeff'+ encodeURIComponent(function(){
 | 
			
		||||
      var dataTitle = [], dataMain = [];
 | 
			
		||||
      var dataTitle = [], dataMain = [], dataTotal = [];
 | 
			
		||||
      
 | 
			
		||||
      //表头和表体
 | 
			
		||||
      layui.each(data, function(i1, item1){
 | 
			
		||||
        var vals = [];
 | 
			
		||||
        if(typeof id === 'object'){ //ID直接为表头数据
 | 
			
		||||
        if(typeof id === 'object'){ //如果 id 参数直接为表头数据
 | 
			
		||||
          layui.each(id, function(i, item){
 | 
			
		||||
            i1 == 0 && dataTitle.push(item || '');
 | 
			
		||||
          });
 | 
			
		||||
@ -1896,15 +1908,23 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
 | 
			
		||||
        } else {
 | 
			
		||||
          table.eachCols(id, function(i3, item3){
 | 
			
		||||
            if(item3.field && item3.type == 'normal' && !item3.hide){
 | 
			
		||||
              var content = item1[item3.field];
 | 
			
		||||
              if(content === undefined || content === null) content = '';
 | 
			
		||||
              
 | 
			
		||||
              i1 == 0 && dataTitle.push(item3.title || '');
 | 
			
		||||
              vals.push('"'+ parseTempData(item3, item1[item3.field], item1, 'text') + '"');
 | 
			
		||||
              vals.push('"'+ parseTempData(item3, content, item1, 'text') + '"');
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
        dataMain.push(vals.join(','))
 | 
			
		||||
        dataMain.push(vals.join(','));
 | 
			
		||||
      });
 | 
			
		||||
      
 | 
			
		||||
      return dataTitle.join(',') + '\r\n' + dataMain.join('\r\n');
 | 
			
		||||
      //表合计
 | 
			
		||||
      layui.each(that.dataTotal, function(key, value){
 | 
			
		||||
        dataTotal.push(value);
 | 
			
		||||
      });
 | 
			
		||||
      
 | 
			
		||||
      return dataTitle.join(',') + '\r\n' + dataMain.join('\r\n') + '\r\n' + dataTotal.join(',');
 | 
			
		||||
    }());
 | 
			
		||||
    
 | 
			
		||||
    alink.download = (config.title || 'table_'+ (config.index || '')) + '.' + type; 
 | 
			
		||||
 | 
			
		||||
@ -314,6 +314,9 @@ layui.define(['laytpl', 'form'], function(exports){
 | 
			
		||||
    var that = this
 | 
			
		||||
    ,options = that.config
 | 
			
		||||
    ,selectedData = [];
 | 
			
		||||
    
 | 
			
		||||
    that.setValue();
 | 
			
		||||
    
 | 
			
		||||
    layui.each(value || options.value, function(index, item){
 | 
			
		||||
      layui.each(options.data, function(index2, item2){
 | 
			
		||||
        delete item2.selected;
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,7 @@ layui.define('form', function(exports){
 | 
			
		||||
  
 | 
			
		||||
  var $ = layui.$
 | 
			
		||||
  ,form = layui.form
 | 
			
		||||
  ,layer = layui.layer
 | 
			
		||||
  
 | 
			
		||||
  //模块名
 | 
			
		||||
  ,MOD_NAME = 'tree'
 | 
			
		||||
@ -89,8 +90,6 @@ layui.define('form', function(exports){
 | 
			
		||||
    ,onlyIconControl: false  //是否仅允许节点左侧图标控制展开收缩
 | 
			
		||||
    ,isJump: false  //是否允许点击节点时弹出新窗口跳转
 | 
			
		||||
    ,edit: false  //是否开启节点的操作图标
 | 
			
		||||
    //,showSearch: false  //是否打开节点过滤
 | 
			
		||||
    //,drag: false  //是否开启节点拖拽
 | 
			
		||||
    
 | 
			
		||||
    ,text: {
 | 
			
		||||
      defaultNodeName: '未命名' //节点默认名称
 | 
			
		||||
@ -115,21 +114,17 @@ layui.define('form', function(exports){
 | 
			
		||||
    var that = this
 | 
			
		||||
    ,options = that.config;
 | 
			
		||||
    
 | 
			
		||||
    that.checkids = [];
 | 
			
		||||
 | 
			
		||||
    var temp = $('<div class="layui-tree'+ (options.showCheckbox ? " layui-form" : "") + (options.showLine ? " layui-tree-line" : "") +'" lay-filter="LAY-tree-'+ that.index +'"></div>');
 | 
			
		||||
    that.tree(temp);
 | 
			
		||||
 | 
			
		||||
    var othis = options.elem = $(options.elem);
 | 
			
		||||
    if(!othis[0]) return;
 | 
			
		||||
 | 
			
		||||
    if(options.showSearch){
 | 
			
		||||
      temp.prepend('<input type="text" class="layui-input layui-tree-search" placeholder="请输入关键字进行过滤">');
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    //索引
 | 
			
		||||
    that.key = options.id || that.index;
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    //插入组件结构
 | 
			
		||||
    that.elem = temp;
 | 
			
		||||
    that.elemNone = $('<div class="layui-tree-emptyText">'+ options.text.none +'</div>');
 | 
			
		||||
@ -139,9 +134,6 @@ layui.define('form', function(exports){
 | 
			
		||||
      return that.elem.append(that.elemNone);
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    //拖拽事件
 | 
			
		||||
    options.drag && that.drag();
 | 
			
		||||
    
 | 
			
		||||
    //复选框渲染
 | 
			
		||||
    if(options.showCheckbox){
 | 
			
		||||
      that.renderForm('checkbox');
 | 
			
		||||
@ -184,7 +176,7 @@ layui.define('form', function(exports){
 | 
			
		||||
      var hasChild = item.children && item.children.length > 0
 | 
			
		||||
      ,packDiv = $('<div class="layui-tree-pack" '+ (item.spread ? 'style="display: block;"' : '') +'"></div>')
 | 
			
		||||
      ,entryDiv = $(['<div data-id="'+ item.id +'" class="layui-tree-set'+ (item.spread ? " layui-tree-spread" : "") + (item.checked ? " layui-tree-checkedFirst" : "") +'">'
 | 
			
		||||
        ,'<div '+ (options.drag && !item.fixed ? 'draggable="true"' : '') +' class="layui-tree-entry">'
 | 
			
		||||
        ,'<div class="layui-tree-entry">'
 | 
			
		||||
          ,'<div class="layui-tree-main">'
 | 
			
		||||
            //箭头
 | 
			
		||||
            ,function(){
 | 
			
		||||
@ -201,7 +193,7 @@ layui.define('form', function(exports){
 | 
			
		||||
            
 | 
			
		||||
            //复选框
 | 
			
		||||
            ,function(){
 | 
			
		||||
              return options.showCheckbox ? '<input type="checkbox" name="layuiTreeCheck" lay-skin="primary" '+ (item.disabled ? "disabled" : "") +'  value="'+ item.id +'">' : '';
 | 
			
		||||
              return options.showCheckbox ? '<input type="checkbox" name="'+ (item.field || ('layuiTreeCheck_'+ item.id)) +'" same="layuiTreeCheck" lay-skin="primary" '+ (item.disabled ? "disabled" : "") +' value="'+ item.id +'">' : '';
 | 
			
		||||
            }()
 | 
			
		||||
            
 | 
			
		||||
            //节点
 | 
			
		||||
@ -260,6 +252,7 @@ layui.define('form', function(exports){
 | 
			
		||||
      
 | 
			
		||||
      //选择框
 | 
			
		||||
      if(options.showCheckbox){
 | 
			
		||||
        item.checked && that.checkids.push(item.id);
 | 
			
		||||
        that.checkClick(entryDiv, item);
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
@ -338,16 +331,18 @@ layui.define('form', function(exports){
 | 
			
		||||
    ,options = that.config
 | 
			
		||||
    ,checked = elemCheckbox.prop('checked');
 | 
			
		||||
    
 | 
			
		||||
    if(elemCheckbox.prop('disabled')) return;
 | 
			
		||||
 | 
			
		||||
    //同步子节点选中状态
 | 
			
		||||
    if(typeof item.children === 'object' || elem.find('.'+ELEM_PACK)[0]){
 | 
			
		||||
      var childs = elem.find('.'+ ELEM_PACK).find('input[name="layuiTreeCheck"]');
 | 
			
		||||
      var childs = elem.find('.'+ ELEM_PACK).find('input[same="layuiTreeCheck"]');
 | 
			
		||||
      childs.each(function(){
 | 
			
		||||
        if(this.disabled) return; //不可点击则跳过
 | 
			
		||||
        this.checked = checked;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    //同步父选中状态
 | 
			
		||||
    //同步父节点选中状态
 | 
			
		||||
    var setParentsChecked = function(thisNodeElem){
 | 
			
		||||
      //若无父节点,则终止递归
 | 
			
		||||
      if(!thisNodeElem.parents('.'+ ELEM_SET)[0]) return;
 | 
			
		||||
@ -355,14 +350,13 @@ layui.define('form', function(exports){
 | 
			
		||||
      var state
 | 
			
		||||
      ,parentPack = thisNodeElem.parent('.'+ ELEM_PACK)
 | 
			
		||||
      ,parentNodeElem = parentPack.parent()
 | 
			
		||||
      ,parentCheckbox =  parentPack.prev().find('input[name="layuiTreeCheck"]');
 | 
			
		||||
      
 | 
			
		||||
      ,parentCheckbox =  parentPack.prev().find('input[same="layuiTreeCheck"]');
 | 
			
		||||
 | 
			
		||||
      //如果子节点有任意一条选中,则父节点为选中状态
 | 
			
		||||
      if(checked){
 | 
			
		||||
        parentCheckbox.prop('checked', checked);
 | 
			
		||||
      } else { //如果当前节点取消选中,则根据计算“兄弟和子孙”节点选中状态,来同步父节点选中状态
 | 
			
		||||
        parentPack.find('input[name="layuiTreeCheck"]').each(function(){
 | 
			
		||||
        parentPack.find('input[same="layuiTreeCheck"]').each(function(){
 | 
			
		||||
          if(this.checked){
 | 
			
		||||
            state = true;
 | 
			
		||||
          }
 | 
			
		||||
@ -388,7 +382,10 @@ layui.define('form', function(exports){
 | 
			
		||||
    ,entry = elem.children('.'+ ELEM_ENTRY)
 | 
			
		||||
    ,elemMain = entry.children('.'+ ELEM_MAIN);
 | 
			
		||||
    
 | 
			
		||||
    elemMain.on('click', 'input[name="layuiTreeCheck"]+', function(e){
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    //点击复选框
 | 
			
		||||
    elemMain.on('click', 'input[same="layuiTreeCheck"]+', function(e){
 | 
			
		||||
      layui.stope(e); //阻止点击节点事件
 | 
			
		||||
 | 
			
		||||
      var elemCheckbox = $(this).prev()
 | 
			
		||||
@ -497,9 +494,9 @@ layui.define('form', function(exports){
 | 
			
		||||
        };
 | 
			
		||||
        if(!options.showCheckbox) return;
 | 
			
		||||
        //若开启复选框,同步新增节点状态
 | 
			
		||||
        if(elemMain.find('input[name="layuiTreeCheck"]')[0].checked){
 | 
			
		||||
        if(elemMain.find('input[same="layuiTreeCheck"]')[0].checked){
 | 
			
		||||
          var packLast = elem.children('.'+ELEM_PACK).children('.'+ELEM_SET).last();
 | 
			
		||||
          packLast.find('input[name="layuiTreeCheck"]')[0].checked = true;
 | 
			
		||||
          packLast.find('input[same="layuiTreeCheck"]')[0].checked = true;
 | 
			
		||||
        };
 | 
			
		||||
        that.renderForm('checkbox');
 | 
			
		||||
      
 | 
			
		||||
@ -537,10 +534,13 @@ layui.define('form', function(exports){
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
      //删除
 | 
			
		||||
      }else{
 | 
			
		||||
      } else {
 | 
			
		||||
        layer.confirm('确认删除该节点 "<span style="color: #999;">'+ (item.title || '') +'</span>" 吗?', function(index){
 | 
			
		||||
          options.operate && options.operate(returnObj); //节点删除的回调
 | 
			
		||||
          returnObj.status = 'remove'; //标注节点删除
 | 
			
		||||
          
 | 
			
		||||
          layer.close(index);
 | 
			
		||||
          
 | 
			
		||||
          //若删除最后一个,显示空数据提示
 | 
			
		||||
          if(!elem.prev('.'+ELEM_SET)[0] && !elem.next('.'+ELEM_SET)[0] && !elem.parent('.'+ELEM_PACK)[0]){
 | 
			
		||||
            elem.remove();
 | 
			
		||||
@ -557,13 +557,13 @@ layui.define('form', function(exports){
 | 
			
		||||
                if(!elem.parents('.'+ELEM_SET)[0]) return;
 | 
			
		||||
                var siblingTree = elem.siblings('.'+ELEM_SET).children('.'+ELEM_ENTRY)
 | 
			
		||||
                ,parentTree = elem.parent('.'+ELEM_PACK).prev()
 | 
			
		||||
              ,checkState = parentTree.find('input[name="layuiTreeCheck"]')[0]
 | 
			
		||||
                ,checkState = parentTree.find('input[same="layuiTreeCheck"]')[0]
 | 
			
		||||
                ,state = 1, num = 0;
 | 
			
		||||
                //若父节点未勾选
 | 
			
		||||
                if(checkState.checked == false){
 | 
			
		||||
                  //遍历兄弟节点
 | 
			
		||||
                  siblingTree.each(function(i, item1){
 | 
			
		||||
                  var input = $(item1).find('input[name="layuiTreeCheck"]')[0]
 | 
			
		||||
                    var input = $(item1).find('input[same="layuiTreeCheck"]')[0]
 | 
			
		||||
                    if(input.checked == false && !input.disabled){
 | 
			
		||||
                      state = 0;
 | 
			
		||||
                    };
 | 
			
		||||
@ -647,317 +647,9 @@ layui.define('form', function(exports){
 | 
			
		||||
          };
 | 
			
		||||
 | 
			
		||||
          elem.remove();
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
      };
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  //拖拽
 | 
			
		||||
  Class.prototype.drag = function(){
 | 
			
		||||
    var that = this
 | 
			
		||||
    ,options = that.config;
 | 
			
		||||
 | 
			
		||||
    that.elem.on('dragstart', '.'+ELEM_ENTRY, function(){
 | 
			
		||||
      var parent = $(this).parent('.'+ELEM_SET)
 | 
			
		||||
      ,pares = parent.parents('.'+ELEM_SET)[0] ? parent.parents('.'+ELEM_SET).eq(0) : '未找到父节点';
 | 
			
		||||
      
 | 
			
		||||
      //开始拖拽触发的回调
 | 
			
		||||
      options.dragstart && options.dragstart(parent, pares);
 | 
			
		||||
        });
 | 
			
		||||
        
 | 
			
		||||
    that.elem.on('dragend', '.'+ELEM_ENTRY, function(e){
 | 
			
		||||
      var e = e || event
 | 
			
		||||
      ,disY = e.clientY
 | 
			
		||||
      ,olds = $(this)
 | 
			
		||||
      ,setParent = olds.parent('.'+ELEM_SET)
 | 
			
		||||
      ,setHeight = setParent.height()
 | 
			
		||||
      ,setTop = setParent.offset().top
 | 
			
		||||
      ,elemSet = that.elem.find('.'+ELEM_SET)
 | 
			
		||||
      ,elemHeight = that.elem.height()
 | 
			
		||||
      ,elemTop = that.elem.offset().top
 | 
			
		||||
      ,maxTop = elemHeight + elemTop - 13;
 | 
			
		||||
      //原父节点
 | 
			
		||||
      var isTree = setParent.parents('.'+ELEM_SET)[0]
 | 
			
		||||
      ,nextOld = setParent.next()[0];
 | 
			
		||||
      if(isTree){
 | 
			
		||||
        var parentPack = setParent.parent('.'+ELEM_PACK)
 | 
			
		||||
        ,parentSet = setParent.parents('.'+ELEM_SET).eq(0)
 | 
			
		||||
        ,warpPack = parentSet.parent('.'+ELEM_PACK)
 | 
			
		||||
        ,parentTop = parentSet.offset().top
 | 
			
		||||
        ,siblingOld = setParent.siblings()
 | 
			
		||||
        ,num = parentSet.children('.'+ELEM_PACK).children('.'+ELEM_SET).length;
 | 
			
		||||
      };
 | 
			
		||||
      //原节点操作
 | 
			
		||||
      var setDel = function(parentSet){
 | 
			
		||||
        //若为最后一个节点操作
 | 
			
		||||
        if(!isTree && !nextOld){
 | 
			
		||||
          that.elem.children('.'+ELEM_SET).last().children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
        };
 | 
			
		||||
        //若为最外层节点,不做下列操作
 | 
			
		||||
        if(!isTree){
 | 
			
		||||
          setParent.removeClass('layui-tree-setHide');
 | 
			
		||||
          return;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        //若为唯一子节点
 | 
			
		||||
        if(num == 1){
 | 
			
		||||
          if(options.showLine){
 | 
			
		||||
            parentSet.find('.'+ICON_CLICK).removeClass('layui-tree-icon');
 | 
			
		||||
            parentSet.find('.'+ICON_CLICK).children('.layui-icon').removeClass(ICON_SUB).addClass('layui-icon-file');
 | 
			
		||||
            warpPack.addClass(ELEM_EXTEND);
 | 
			
		||||
            warpPack.children('.'+ELEM_SET).children('.'+ELEM_PACK).each(function(){
 | 
			
		||||
              $(this).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
            });
 | 
			
		||||
          }else{
 | 
			
		||||
            parentSet.find('.layui-tree-iconArrow').addClass(HIDE);
 | 
			
		||||
          };
 | 
			
		||||
          parentSet.children('.'+ELEM_PACK).remove();
 | 
			
		||||
          parentSet.removeClass(ELEM_SPREAD);
 | 
			
		||||
        }else{
 | 
			
		||||
          //若开启连接线
 | 
			
		||||
          if(options.showLine){
 | 
			
		||||
            //遍历兄弟节点,判断兄弟节点是否有子节点
 | 
			
		||||
            var number = 1;
 | 
			
		||||
            layui.each(siblingOld, function(index, i){
 | 
			
		||||
              if(!$(i).children('.'+ELEM_PACK)[0]){
 | 
			
		||||
                number = 0;
 | 
			
		||||
              };
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            //若兄弟节点都有子节点
 | 
			
		||||
            if(number == 1){
 | 
			
		||||
              //若节点本身无子节点
 | 
			
		||||
              if(!setParent.children('.'+ELEM_PACK)[0]){
 | 
			
		||||
                //父级去除延伸线,因为此时子节点里没有空节点
 | 
			
		||||
                parentPack.removeClass(ELEM_EXTEND);
 | 
			
		||||
                siblingOld.children('.'+ELEM_PACK).addClass(ELEM_SHOW);
 | 
			
		||||
                siblingOld.children('.'+ELEM_PACK).children('.'+ELEM_SET).removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
              };
 | 
			
		||||
              //若为最后一个节点
 | 
			
		||||
              parentPack.children('.'+ELEM_SET).last().children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
              //若为最外层最后一个节点,去除前一个结点的连接线
 | 
			
		||||
              if(!nextOld && !parentSet.parents('.'+ELEM_SET)[0] && !parentSet.next()[0]){
 | 
			
		||||
                parentPack.children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
              };
 | 
			
		||||
            }else{
 | 
			
		||||
              //若为最后一个节点且有延伸线
 | 
			
		||||
              if(!nextOld && setParent.hasClass(ELEM_LINE_SHORT)){
 | 
			
		||||
                parentPack.children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
          //若开启复选框
 | 
			
		||||
          if(options.showCheckbox){
 | 
			
		||||
            //若开启复选框,进行下步操作
 | 
			
		||||
            var elemRemove = function(elem){
 | 
			
		||||
              //若无父结点,则不执行
 | 
			
		||||
              if(elem){
 | 
			
		||||
                if(!elem.parents('.'+ELEM_SET)[0]) return;
 | 
			
		||||
              }else{
 | 
			
		||||
                if(!parentSet[0]) return;
 | 
			
		||||
              };
 | 
			
		||||
              var siblingTree = elem ? elem.siblings().children('.'+ELEM_ENTRY) : siblingOld.children('.'+ELEM_ENTRY)
 | 
			
		||||
              ,parentTree = elem ? elem.parent('.'+ELEM_PACK).prev() : parentPack.prev()
 | 
			
		||||
              ,checkState = parentTree.find('input[name="layuiTreeCheck"]')[0]
 | 
			
		||||
              ,state = 1, ndig = 0;
 | 
			
		||||
              //若父节点未勾选
 | 
			
		||||
              if(checkState.checked == false){
 | 
			
		||||
                //遍历兄弟节点
 | 
			
		||||
                siblingTree.each(function(i, item1){
 | 
			
		||||
                  var input = $(item1).find('input[name="layuiTreeCheck"]')[0];
 | 
			
		||||
                  if(input.checked == false && !input.disabled){ state = 0 };
 | 
			
		||||
                  //判断是否全为不可勾选框
 | 
			
		||||
                  if(!input.disabled){ ndig = 1 };
 | 
			
		||||
                });
 | 
			
		||||
                //若有可勾选选择框并且已勾选
 | 
			
		||||
                if(state == 1 && ndig == 1){
 | 
			
		||||
                  //勾选父节点
 | 
			
		||||
                  checkState.checked = true;
 | 
			
		||||
                  that.renderForm('checkbox');
 | 
			
		||||
                  //向上遍历祖先节点
 | 
			
		||||
                  elemRemove(parentTree.parent('.'+ELEM_SET) || parentSet);
 | 
			
		||||
                };
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
            elemRemove();
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      //查找
 | 
			
		||||
      elemSet.each(function(){
 | 
			
		||||
        //筛选可插入位置
 | 
			
		||||
        if($(this).height() != 0){
 | 
			
		||||
          //若在本身位置
 | 
			
		||||
          if((disY > setTop && disY < setTop + setHeight)){
 | 
			
		||||
            options.dragend && options.dragend('drag error');
 | 
			
		||||
            return;
 | 
			
		||||
          };
 | 
			
		||||
          //若仅有一个子元素
 | 
			
		||||
          if(num == 1 && disY > parentTop && disY < setTop + setHeight){
 | 
			
		||||
            options.dragend && options.dragend('drag error');
 | 
			
		||||
            return;
 | 
			
		||||
          };
 | 
			
		||||
          var thisTop = $(this).offset().top;
 | 
			
		||||
 | 
			
		||||
          //若位于元素上
 | 
			
		||||
          if((disY > thisTop) && (disY < thisTop + 15)){
 | 
			
		||||
            //若元素无子节点
 | 
			
		||||
            if(!$(this).children('.'+ELEM_PACK)[0]){
 | 
			
		||||
              if(options.showLine){
 | 
			
		||||
                $(this).find('.'+ICON_CLICK).eq(0).addClass('layui-tree-icon');
 | 
			
		||||
                $(this).find('.'+ICON_CLICK).eq(0).children('.layui-icon').addClass(ICON_ADD).removeClass('layui-icon-file');
 | 
			
		||||
              }else{
 | 
			
		||||
                $(this).find(".layui-tree-iconArrow").removeClass(HIDE);
 | 
			
		||||
              };
 | 
			
		||||
              $(this).append('<div class="layui-tree-pack"></div>');
 | 
			
		||||
            };
 | 
			
		||||
            //插入元素
 | 
			
		||||
            $(this).children('.'+ELEM_PACK).append(setParent);
 | 
			
		||||
            setDel(parentSet);
 | 
			
		||||
            //若开启连接线,更改线状态
 | 
			
		||||
            if(options.showLine){
 | 
			
		||||
              var children = $(this).children('.'+ELEM_PACK).children('.'+ELEM_SET);
 | 
			
		||||
              setParent.children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
              if(children.length == 1){
 | 
			
		||||
                //遍历兄弟节点,判断兄弟节点是否有子节点
 | 
			
		||||
                var siblings = $(this).siblings('.'+ELEM_SET), ss = 1
 | 
			
		||||
                ,parentPack = $(this).parent('.'+ELEM_PACK);
 | 
			
		||||
                layui.each(siblings, function(index, i){
 | 
			
		||||
                  if(!$(i).children('.'+ELEM_PACK)[0]){
 | 
			
		||||
                    ss = 0;
 | 
			
		||||
                  };
 | 
			
		||||
                });
 | 
			
		||||
                //若兄弟节点都有子节点
 | 
			
		||||
                if(ss == 1){
 | 
			
		||||
                  //兄弟节点添加连接线
 | 
			
		||||
                  siblings.children('.'+ELEM_PACK).addClass(ELEM_SHOW);
 | 
			
		||||
                  siblings.children('.'+ELEM_PACK).children('.'+ELEM_SET).removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                  $(this).children('.'+ELEM_PACK).addClass(ELEM_SHOW);
 | 
			
		||||
                  //父级移除延伸线
 | 
			
		||||
                  parentPack.removeClass(ELEM_EXTEND);
 | 
			
		||||
                  //同层节点最后一个去除连接线
 | 
			
		||||
                  parentPack.children('.'+ELEM_SET).last().children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT).removeClass('layui-tree-setHide');
 | 
			
		||||
                }else{
 | 
			
		||||
                  $(this).children('.'+ELEM_PACK).children('.'+ELEM_SET).addClass(ELEM_LINE_SHORT).removeClass('layui-tree-setHide');
 | 
			
		||||
                };
 | 
			
		||||
              }else{
 | 
			
		||||
                //若原子节点含有延伸线
 | 
			
		||||
                if(setParent.prev('.'+ELEM_SET).hasClass(ELEM_LINE_SHORT)){
 | 
			
		||||
                  setParent.prev('.'+ELEM_SET).removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                  setParent.addClass(ELEM_LINE_SHORT);
 | 
			
		||||
                }else{
 | 
			
		||||
                //清除之前状态
 | 
			
		||||
                  setParent.removeClass('layui-tree-setLineShort layui-tree-setHide');
 | 
			
		||||
                  //若添加节点无子节点
 | 
			
		||||
                  if(!setParent.children('.'+ELEM_PACK)[0]){
 | 
			
		||||
                    //兄弟节点子节点添加延伸线
 | 
			
		||||
                    setParent.siblings('.'+ELEM_SET).find('.'+ELEM_PACK).each(function(){
 | 
			
		||||
                      $(this).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
                    });
 | 
			
		||||
                  }else{
 | 
			
		||||
                    setParent.prev('.'+ELEM_SET).children('.'+ELEM_PACK).children('.'+ELEM_SET).last().removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                  };
 | 
			
		||||
                };
 | 
			
		||||
                //若无下兄弟节点
 | 
			
		||||
                if(!$(this).next()[0]){
 | 
			
		||||
                  setParent.addClass(ELEM_LINE_SHORT);
 | 
			
		||||
                };
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
            //若开启复选框,同步新增节点状态
 | 
			
		||||
            if(options.showCheckbox){
 | 
			
		||||
              if($(this).children('.'+ELEM_ENTRY).find('input[name="layuiTreeCheck"]')[0].checked){
 | 
			
		||||
                var packLast = setParent.children('.'+ELEM_ENTRY);
 | 
			
		||||
                packLast.find('input[name="layuiTreeCheck"]+').click();
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
            options.dragend && options.dragend('drag success', setParent, $(this));
 | 
			
		||||
            return false;
 | 
			
		||||
 | 
			
		||||
          //若位于元素上方
 | 
			
		||||
          }else if(disY < thisTop){
 | 
			
		||||
            $(this).before(setParent);
 | 
			
		||||
            setDel(parentSet);
 | 
			
		||||
            //若开启连接线,更改线状态
 | 
			
		||||
            if(options.showLine){
 | 
			
		||||
              var packCont = setParent.children('.'+ELEM_PACK)
 | 
			
		||||
              ,setFirst = $(this).parents('.'+ELEM_SET).eq(0)
 | 
			
		||||
              ,setPackLast = setFirst.children('.'+ELEM_PACK).children('.'+ELEM_SET).last();
 | 
			
		||||
              if(packCont[0]){
 | 
			
		||||
                setParent.removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                packCont.children('.'+ELEM_SET).last().removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                //遍历兄弟节点,判断兄弟节点是否有子节点
 | 
			
		||||
                var siblings = setParent.siblings('.'+ELEM_SET), ss = 1;
 | 
			
		||||
                layui.each(siblings, function(index, i){
 | 
			
		||||
                  if(!$(i).children('.'+ELEM_PACK)[0]){
 | 
			
		||||
                    ss = 0;
 | 
			
		||||
                  };
 | 
			
		||||
                });
 | 
			
		||||
                //若兄弟节点都有子节点
 | 
			
		||||
                if(ss == 1){
 | 
			
		||||
                  if(setFirst[0]){
 | 
			
		||||
                    //兄弟节点添加连接线
 | 
			
		||||
                    siblings.children('.'+ELEM_PACK).addClass(ELEM_SHOW);
 | 
			
		||||
                    siblings.children('.'+ELEM_PACK).children('.'+ELEM_SET).removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                    //同层节点最后一个添加延伸线
 | 
			
		||||
                    setPackLast.children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT).removeClass(ELEM_SHOW);
 | 
			
		||||
                  };
 | 
			
		||||
                }else{
 | 
			
		||||
                  setParent.children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                //若是最外层,要始终保持相连的状态
 | 
			
		||||
                if(!setFirst.parent('.'+ELEM_PACK)[0] && setFirst.next()[0]){
 | 
			
		||||
                  setPackLast.removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                };
 | 
			
		||||
              }else{
 | 
			
		||||
                if(!setFirst.hasClass(ELEM_EXTEND)){
 | 
			
		||||
                  setFirst.addClass(ELEM_EXTEND);
 | 
			
		||||
                };
 | 
			
		||||
                //子节点添加延伸线
 | 
			
		||||
                setFirst.find('.'+ELEM_PACK).each(function(){
 | 
			
		||||
                  $(this).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
                });
 | 
			
		||||
                //若是最外层,要始终保持相连的状态
 | 
			
		||||
                // if(!setFirst.parent('.'+ELEM_PACK)[0] && setFirst.next()[0]){
 | 
			
		||||
                //   //setFirst.children('.'+ELEM_PACK).children('.'+ELEM_SET).last().removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
                // };
 | 
			
		||||
              };
 | 
			
		||||
              //若移到最外层
 | 
			
		||||
              if(!setFirst[0]){
 | 
			
		||||
                //隐藏前置连接线
 | 
			
		||||
                setParent.addClass('layui-tree-setHide');
 | 
			
		||||
                setParent.children('.'+ELEM_PACK).children('.'+ELEM_SET).last().removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
            //开启复选框且有父节点,同步新增节点状态
 | 
			
		||||
            if(setFirst[0] && options.showCheckbox){
 | 
			
		||||
              if(setFirst.children('.'+ELEM_ENTRY).find('input[name="layuiTreeCheck"]')[0].checked){
 | 
			
		||||
                var packLast = setParent.children('.'+ELEM_ENTRY);
 | 
			
		||||
                packLast.find('input[name="layuiTreeCheck"]+').click();
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
            options.dragend && options.dragend('拖拽成功,插入目标节点上方', setParent, $(this));
 | 
			
		||||
            return false;
 | 
			
		||||
 | 
			
		||||
          //若位于最下方
 | 
			
		||||
          }else if(disY > maxTop){
 | 
			
		||||
            that.elem.children('.'+ELEM_SET).last().children('.'+ELEM_PACK).addClass(ELEM_SHOW);
 | 
			
		||||
            that.elem.append(setParent);
 | 
			
		||||
            setDel(parentSet);
 | 
			
		||||
            //最外层保持连接
 | 
			
		||||
            setParent.prev().children('.'+ELEM_PACK).children('.'+ELEM_SET).last().removeClass(ELEM_LINE_SHORT);
 | 
			
		||||
            //隐藏前置连接线
 | 
			
		||||
            setParent.addClass('layui-tree-setHide');
 | 
			
		||||
            //最后一个子节点加延伸
 | 
			
		||||
            setParent.children('.'+ELEM_PACK).children('.'+ELEM_SET).last().addClass(ELEM_LINE_SHORT);
 | 
			
		||||
            options.dragend && options.dragend('拖拽成功,插入最外层节点', setParent, that.elem);
 | 
			
		||||
            return false;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -968,9 +660,7 @@ layui.define('form', function(exports){
 | 
			
		||||
    ,checkWarp = that.elem.find('.layui-tree-checkedFirst');
 | 
			
		||||
    
 | 
			
		||||
    //初始选中
 | 
			
		||||
    layui.each(checkWarp, function(i, item){
 | 
			
		||||
      $(item).children('.'+ELEM_ENTRY).find('input[name="layuiTreeCheck"]+').trigger('click');
 | 
			
		||||
    });
 | 
			
		||||
    that.setChecked(that.checkids);
 | 
			
		||||
    
 | 
			
		||||
    //搜索
 | 
			
		||||
    that.elem.find('.layui-tree-search').on('keyup', function(){
 | 
			
		||||
@ -1069,7 +759,7 @@ layui.define('form', function(exports){
 | 
			
		||||
    //初始选中
 | 
			
		||||
    that.elem.find('.'+ELEM_SET).each(function(i, item){
 | 
			
		||||
      var thisId = $(this).data('id')
 | 
			
		||||
      ,input = $(item).children('.'+ELEM_ENTRY).find('input[name="layuiTreeCheck"]')
 | 
			
		||||
      ,input = $(item).children('.'+ELEM_ENTRY).find('input[same="layuiTreeCheck"]')
 | 
			
		||||
      ,reInput = input.next();
 | 
			
		||||
      
 | 
			
		||||
      //若返回数字
 | 
			
		||||
@ -1080,13 +770,15 @@ layui.define('form', function(exports){
 | 
			
		||||
          };
 | 
			
		||||
          return false;
 | 
			
		||||
        };
 | 
			
		||||
      }else{
 | 
			
		||||
      } 
 | 
			
		||||
      //若返回数组
 | 
			
		||||
        if($.inArray(thisId, checkedId) != -1){
 | 
			
		||||
          if(!input[0].checked){
 | 
			
		||||
      else if(typeof checkedId === 'object'){
 | 
			
		||||
        layui.each(checkedId, function(index, value){
 | 
			
		||||
          if(value == thisId && !input[0].checked){
 | 
			
		||||
            reInput.click();
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
            return true;
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      };
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -213,18 +213,32 @@ layui.define('layer' , function(exports){
 | 
			
		||||
          ,processData: false
 | 
			
		||||
          ,dataType: 'json'
 | 
			
		||||
          ,headers: options.headers || {}
 | 
			
		||||
          //成功回调
 | 
			
		||||
          ,success: function(res){
 | 
			
		||||
            successful++;
 | 
			
		||||
            done(index, res);
 | 
			
		||||
            allDone();
 | 
			
		||||
          }
 | 
			
		||||
          //异常回调
 | 
			
		||||
          ,error: function(){
 | 
			
		||||
            aborted++;
 | 
			
		||||
            that.msg('请求上传接口出现异常');
 | 
			
		||||
            error(index);
 | 
			
		||||
            allDone();
 | 
			
		||||
          }
 | 
			
		||||
          ,xhr: function(){
 | 
			
		||||
            var xhr = new XMLHttpRequest();
 | 
			
		||||
            //监听上传进度
 | 
			
		||||
            xhr.upload.addEventListener("progress", function (e) {
 | 
			
		||||
              if(e.lengthComputable) {
 | 
			
		||||
                var percent = Math.floor((e.loaded/e.total)* 100); //百分比
 | 
			
		||||
                typeof options.progress === 'function' && options.progress(percent, e);
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
            return xhr;
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
        
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
 @Title: Layui
 | 
			
		||||
 @Description:经典模块化前端框架
 | 
			
		||||
 @Title: layui
 | 
			
		||||
 @Description:经典模块化前端 UI 框架
 | 
			
		||||
 @Site: www.layui.com
 | 
			
		||||
 @Author: 贤心
 | 
			
		||||
 @License:MIT
 | 
			
		||||
@ -19,7 +19,7 @@
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ,Layui = function(){
 | 
			
		||||
    this.v = '2.5.4'; //版本号
 | 
			
		||||
    this.v = '2.5.5'; //版本号
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //获取layui所在目录
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user