This commit is contained in:
sentsin 2017-11-15 11:57:51 +08:00
parent d12b73f3e3
commit 3a6735e32b
45 changed files with 660 additions and 516 deletions

View File

@ -1,5 +1,7 @@
# 更新日志
* [2.2.0](http://www.layui.com/doc/base/changelog.html#2-2-0)
* [2.1.7](http://www.layui.com/doc/base/changelog.html#2-1-7)
* [2.1.6](http://www.layui.com/doc/base/changelog.html#2-1-6)
* [2.1.5](http://www.layui.com/doc/base/changelog.html#2-1-5)
* [2.1.4](http://www.layui.com/doc/base/changelog.html#2-1-4)

View File

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

4
dist/css/layui.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

View File

@ -339,6 +339,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="sanjiao1" unicode="&#58917;" d="M773.128299 88.652342M889.696178 575.195553 158.862147 575.195553 524.357446 209.647043 889.696178 575.195553Z" horiz-adv-x="1024" />
<glyph glyph-name="tips" unicode="&#59138;" d="M967.280184 578.537671c-24.915459 58.887178-60.544935 111.76755-105.96745 157.161413-45.393863 45.393863-98.273211 81.051991-157.160389 105.96745-60.988026 25.803689-125.735679 38.853913-192.494129 38.853913-66.729797 0-131.504056-13.0799-192.494129-38.853913-58.887178-24.916483-111.766526-60.544935-157.160389-105.96745-45.393863-45.393863-81.051991-98.274234-105.96745-157.161413-25.803689-60.988026-38.884612-125.734656-38.884612-192.464453s13.0799-131.50508 38.884612-192.464453c24.915459-58.887178 60.544935-111.737874 105.96745-157.161413 45.393863-45.393863 98.273211-81.051991 157.160389-105.96745 60.988026-25.803689 125.735679-38.853913 192.494129-38.853913 66.729797 0 131.504056 13.0799 192.494129 38.853913 58.887178 24.916483 111.766526 60.544935 157.160389 105.96745 45.393863 45.393863 81.051991 98.274234 105.96745 157.161413 25.803689 60.988026 38.853913 125.734656 38.853913 192.464453S993.084896 517.549645 967.280184 578.537671zM511.687892-55.138552000000004c-243.302305 0-441.241446 197.909465-441.241446 441.21177S268.385587 827.284989 511.687892 827.284989c243.273652-0.029676 441.210747-197.938118 441.210747-441.21177S754.990197-55.138552000000004 511.687892-55.138552000000004zM511.657192 573.565427m-45.511543 0a44.475 44.475 0 1 1 91.023086 0 44.475 44.475 0 1 1-91.023086 0ZM542.729885 184.14011300000004c0-17.162892-13.906731-31.071669-31.070646-31.071669l0 0c-17.163915 0-31.070646 13.907755-31.070646 31.071669L480.588593 426.998303c0 17.162892 13.906731 31.071669 31.070646 31.071669l0 0c17.163915 0 31.070646-13.907755 31.070646-31.071669L542.729885 184.14011300000004z" horiz-adv-x="1024" />
<glyph glyph-name="tupian-copy-copy" unicode="&#58954;" d="M765.376 615.424c0 0 103.040 1.024 103.040-100.992 0 0 9.536-98.752-103.040-100.928 0 0-100.864-2.176-99.84 100.928 0 0.064-1.088 91.456 99.84 100.992zM968.32 770.56c0 0 54.208-4.224 54.208-52.032v-712.832c0 0-3.2-51.008-54.208-52.096v816.96zM1.472 5.632c0 0 2.176-52.096 52.096-52.096h914.752v150.848h-99.712l-203.072 206.144-153.024-153.984-208.192 257.024-205.056-307.072-45.632-1.024-1.152 612.992h-51.008v-712.832zM968.32 770.56h-914.752c0 0-52.096 1.088-52.096-52.032h966.848v52.032z" horiz-adv-x="1024" />
@ -405,6 +408,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="xiangji" unicode="&#58976;" d="M884.3 648.6H704.2L679.5 698l-0.2 0.4c-1.9 3.6-3.6 6.9-5.1 9.9-12 23.4-21.5 41.9-54.1 41.9H416.7c-32.9 0-43.7-21.3-55.1-43.8-1.3-2.6-2.7-5.3-4.2-8.1l-24.8-49.7H152.4c-34 0-61.7-27.7-61.7-61.7v-488c0-34 27.7-61.7 61.7-61.7h731.9c34 0 61.7 27.7 61.7 61.7v488c0 34-27.7 61.7-61.7 61.7zM904 98.9c0-10.8-8.8-19.7-19.7-19.7H152.4c-10.8 0-19.7 8.8-19.7 19.7v488c0 10.8 8.8 19.7 19.7 19.7h206.1l36.2 72.5c1.5 2.9 2.9 5.7 4.3 8.3 10.6 20.8 11.1 20.8 17.7 20.8H620c4.6 0 5.8-0.6 5.8-0.6 2-1.2 7.2-11.2 10.9-18.5 1.6-3.1 3.3-6.5 5.3-10.1l36.2-72.4h206.1c10.8 0 19.7-8.8 19.7-19.7v-488zM525.5 565.5c-123.5 0-223.6-100.1-223.6-223.6S402 118.2 525.5 118.2s223.7 100.1 223.7 223.7c0 123.5-100.2 223.6-223.7 223.6z m0-402.5c-98.8 0-178.9 80.1-178.9 178.9 0 98.8 80.1 178.9 178.9 178.9 98.8 0 178.9-80.1 178.9-178.9 0-98.8-80.1-178.9-178.9-178.9z m246 402.5v-44.7H861v44.7h-89.5z" horiz-adv-x="1024" />
<glyph glyph-name="note" unicode="&#58990;" d="M987.2 384.36L512.43 859.13a84.75 84.75 0 0 1-65 24.71L111.55 864.09a84.83 84.83 0 0 1-79.65-79.65L12.15 448.57a84.57 84.57 0 0 1 24.69-65l474.8-474.8a84.91 84.91 0 0 1 119.93 0L987.2 264.41999999999996a84.9 84.9 0 0 1 0 119.94z m-39.28-80.66L592.29-51.91999999999996a29.31 29.31 0 0 0-41.37 0L76.1 422.9a29.22 29.22 0 0 0-8.49 22.38l19.74 335.88a29.29 29.29 0 0 0 27.48 27.48l335.9 19.75a29.32 29.32 0 0 0 22.38-8.52l474.8-474.8a29.31 29.31 0 0 0 0.01-41.37zM236.86 659.14c-50.92-50.95-50.92-133.8 0-184.72a130.61 130.61 0 1 1 184.71 184.72c-50.89 50.86-133.77 50.86-184.71 0zM382.29 513.7c-28.38-28.38-77.78-28.38-106.15 0a75.08 75.08 0 1 0 106.15 0z" horiz-adv-x="1024" />
<glyph glyph-name="refresh" unicode="&#58985;" d="M928 810.666667c-18.133333 0-32-13.866667-32-32v-164.266667C816 747.733333 669.866667 832 512 832 264.533333 832 64 631.4666669999999 64 384s200.533333-448 448-448c230.4 0 422.4 172.8 445.866667 402.133333 2.133333 17.066667-10.666667 33.066667-28.8 35.2-17.066667 2.133333-33.066667-10.666667-35.2-28.8C873.6 148.26666699999998 709.333333 0 512 0c-212.266667 0-384 171.733333-384 384s171.733333 384 384 384c137.6 0 264.533333-74.666667 332.8-192H693.333333c-18.133333 0-32-13.866667-32-32s13.866667-32 32-32h266.666667V778.666667c0 18.133333-14.933333 32-32 32z" horiz-adv-x="1024" />
@ -429,9 +435,6 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="shoucang" unicode="&#58968;" d="M752-43.2c-9.6 0-20.8 3.2-30.4 8l-208 104-209.6-104c-20.8-11.2-48-9.6-67.2 4.8-19.2 14.4-30.4 40-25.6 64l43.2 224L89.6 411.2C72 428.8 65.6 456 72 478.4c8 24 27.2 41.6 52.8 44.8l228.8 41.6 102.4 208c11.2 22.4 33.6 36.8 57.6 36.8s48-14.4 57.6-36.8l102.4-208 228.8-40c24-3.2 44.8-20.8 51.2-44.8 8-24 1.6-49.6-16-67.2L772.8 257.6l41.6-224c4.8-25.6-6.4-49.6-25.6-64-9.6-8-22.4-12.8-36.8-12.8z" horiz-adv-x="1024" />
<glyph glyph-name="shuaxin2" unicode="&#58987;" d="M854 560.7l-0.3-0.2c-5.6 9.3-15.9 15.6-27.6 15.6-17.8 0-32.2-14.4-32.2-32.1 0-5.3 1.3-10.3 3.6-14.7h-0.1c22-43.4 34.4-92.5 34.4-144.5C831.8 208.2 688.6 65 512 65S192.2 208.1 192.2 384.8c0 152.4 106.5 279.2 249.1 311.2l-33.6-43.7c-10.8-14-8.1-34.2 5.9-45 14-10.8 34.2-8.1 45 5.9l75.3 97.8c6.5 5.9 10.6 14.4 10.6 23.8 0 11.3-5.9 21.2-14.7 27L429.3 838.9c-13.8 10.6-33.8 8-44.4-5.7l-0.6-0.8c-10.6-13.8-8-33.7 5.8-44.3l38.4-29.5C257 720.1 128.9 566.9 128.9 383.8c0-212.1 172-384.1 384.1-384.1s384.1 172 384.1 384.1c0 63.8-15.5 124-43.1 176.9zM708.9 637.9a32.2 32.1 0 1 1 64.4 0 32.2 32.1 0 1 1-64.4 0Z" horiz-adv-x="1024" />
<glyph glyph-name="moban1" unicode="&#58966;" d="M512 384zM43.52 601.6l409.6-176.64c58.88-30.72 110.08 0 110.08 0l414.72 174.08 2.56 2.56c10.24 5.12 15.36 15.36 15.36 28.16 0 15.36-10.24 28.16-23.04 30.72L563.2 837.12c-56.32 23.04-97.28 0-97.28 0L46.08 660.48c-12.8-5.12-20.48-17.92-20.48-30.72s7.68-23.04 17.92-28.16z m0 0M512 222.72c-2.56 0-7.68 0-10.24 2.56l-486.4 215.04c-12.8 5.12-17.92 20.48-12.8 33.28 5.12 12.8 20.48 17.92 33.28 12.8L512 276.48 988.16 486.4c12.8 5.12 28.16 0 33.28-12.8 5.12-12.8 0-28.16-12.8-33.28l-486.4-215.04c-2.56-2.56-7.68-2.56-10.24-2.56zM512 71.68c-2.56 0-7.68 0-10.24 2.56l-486.4 215.04c-12.8 5.12-17.92 20.48-12.8 33.28 5.12 10.24 20.48 17.92 33.28 10.24L512 125.44 988.16 332.8c12.8 5.12 28.16 0 33.28-12.8 5.12-12.8 0-28.16-12.8-33.28l-486.4-215.04H512zM512-79.36c-2.56 0-7.68 0-10.24 2.56l-486.4 215.04c-12.8 5.12-17.92 20.48-12.8 33.28 5.12 12.8 20.48 17.92 33.28 12.8L512-25.6l476.16 209.92c12.8 5.12 28.16 0 33.28-12.8 5.12-12.8 0-28.16-12.8-33.28l-486.4-215.04c-2.56-2.56-7.68-2.56-10.24-2.56z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 222 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

Binary file not shown.

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

View File

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

6
dist/layui.all.js vendored

File diff suppressed because one or more lines are too long

4
dist/layui.js vendored

File diff suppressed because one or more lines are too long

View File

@ -28,19 +28,19 @@ body{padding: 10px;}
<div class="layui-form-item">
<label class="layui-form-label">手机</label>
<div class="layui-input-block">
<input type="tel" name="phone" lay-verify="number" autocomplete="off" class="layui-input">
<input type="tel" name="phone" lay-verify="required|number" lay-verType="tips" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮箱</label>
<div class="layui-input-block">
<input type="email" name="email" lay-verify="email" autocomplete="off" class="layui-input">
<input type="email" name="email" lay-verify="email" lay-verType="alert" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="password" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input">
<input type="password" name="password" lay-verify="required|pass" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">请务必填写用户名</div>
</div>
@ -100,7 +100,7 @@ body{padding: 10px;}
<div class="layui-form-item">
<label class="layui-form-label">搜索选择框</label>
<div class="layui-input-inline">
<select name="interest" lay-filter="aihao" lay-search>
<select name="interest" lay-filter="aihao" lay-search lay-write>
<option value=""></option>
<option value="0">写作</option>
<option value="1">阅读</option>

View File

@ -15,66 +15,38 @@ body{padding: 20px;}
</head>
<body>
<table id="test2" lay-filter="test2"></table>
<div class="layui-btn-group">
<button class="layui-btn" data-type="getCheckData">获取选中行数据</button>
<button class="layui-btn" data-type="getCheckLength">获取选中数目</button>
<button class="layui-btn" data-type="isAll">验证是否全选</button>
</div>
<table class="layui-table" lay-data="{width:900, height:'full-100', url:'json/table/demo1.json', page:true, id:'test'}" lay-filter="test">
<thead>
<tr>
<th lay-data="{checkbox:true, fixed: true}"></th>
<th lay-data="{field:'id', width:80, fixed: true, sort: true}">ID</th>
<th lay-data="{field:'username', width:120, sort: true, edit: 'text', templet: '#usernameTpl'}">用户名</th>
<th lay-data="{field:'email', width:150}">邮箱</th>
<th lay-data="{field:'sex', width:80}">性别</th>
<th lay-data="{field:'city', width:100}">城市</th>
<th lay-data="{field:'sign', width:150}">签名</th>
<th lay-data="{field:'experience', width:80, sort: true, edit: 'text'}">积分</th>
<th lay-data="{field:'ip', width:120}">IP</th>
<th lay-data="{field:'logins', width:100}">登入次数</th>
<th lay-data="{field:'joinTime', width:120}">加入时间</th>
<th lay-data="{fixed: 'right', toolbar: '#barDemo', width:150, align:'center'}">操作</th>
</tr>
</thead>
</table>
<table id="test" lay-filter="test"></table>
<div class="layui-hide" id="barDemo">
<a class="layui-btn layui-btn-mini" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-mini" lay-event="del">删除</a>
</div>
<table id="demo"></table>
<table class="layui-table" lay-data="{height:350, url:'json/table/demo1.json', page: true}">
<thead>
<tr>
<th lay-data="{field:'id', width:80, fixed:true, unresize: true, sort: true}">ID</th>
<th lay-data="{checkbox:true}"></th>
<th lay-data="{field:'username', width:120, templet: '#usernameTpl'}">用户名</th>
<th lay-data="{field:'email', width:150}">邮箱</th>
<th lay-data="{field:'sex', width:80, sort: true}">性别</th>
<th lay-data="{field:'city', width:100}">城市</th>
<th lay-data="{field:'sign', width:150}">签名</th>
<th lay-data="{field:'experience', width:80, sort: true}">积分</th>
<th lay-data="{field:'ip', width:120}">IP</th>
<th lay-data="{field:'logins', width:100, sort: true}">登入次数</th>
<th lay-data="{field:'joinTime', width:120}">加入时间</th>
<th lay-data="{fixed: 'right', toolbar: '#barDemo', width:150}">操作</th>
</tr>
</thead>
</table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script type="text/html" id="usernameTpl">
<a href="" class="layui-table-link">{{d.username || ''}}</a>
</script>
<script type="text/html" id="switchTpl">
<input type="checkbox" name="yyy" lay-skin="switch" lay-text="女|男">
</script>
<script type="text/html" id="checkboxTpl">
<input type="checkbox" name="" title="锁定" checked>
</script>
<script type="text/html" id="LAY_table_tpl_email">
<span {{# if(!d.activate){ }}style="color:#999"{{# } }}>{{ d.email }}</span>
</script>
<table class="layui-table" lay-data="{width:800, height:235, url:'json/table/demo2.json', page: true, limit: 6}">
<table class="layui-table" lay-data="{width:800, height: 300, url:'json/table/demo2.json', page: true, limit: 6}">
<thead>
<tr>
<th lay-data="{checkbox:true, fixed:'left'}" rowspan="2"></th>
@ -91,10 +63,10 @@ body{padding: 20px;}
</thead>
</table>
<table class="layui-table" lay-data="{height:315, url:'json/table/demo2.json', page: true, limit: 6}">
<table class="layui-table" lay-data="{url:'json/table/demo2.json', page: true, limit: 6}">
<thead>
<tr>
<th lay-data="{field:'username', width:80}" rowspan="3">联系人</th>
<th lay-data="{field:'username'}" rowspan="3">联系人</th>
<th lay-data="{field:'amount', width:120}" rowspan="3">金额</th>
<th lay-data="{align:'center'}" colspan="5">地址1</th>
<th lay-data="{align:'center'}" colspan="2">地址2</th>
@ -110,11 +82,13 @@ body{padding: 20px;}
</tr>
<tr>
<th lay-data="{field:'address', width:120}">小区</th>
<th lay-data="{field:'house', width:120}">单元</th>
<th lay-data="{field:'house', width:150}">单元</th>
</tr>
</thead>
</table>
<table id="demo"></table>
<div class="layui-btn-group">
<button class="layui-btn" data-type="parseTable">转化为数据表格</button>
@ -190,15 +164,116 @@ body{padding: 20px;}
</tbody>
</table>
<script type="text/html" id="toolbarDemo">
<i class="layui-icon">&#xe654;</i>
<i class="layui-icon">&#xe640;</i>
</script>
<script src="../src/layui.js" charset="utf-8"></script>
<script>
layui.use('table', function(){
var table = layui.table;
//方法级渲染
window.demoTable = table.render({
//渲染
table.render({
elem: '#test'
,height: 350
,url: 'json/table/demo1.json'
,page: {}
,toolbar: '#toolbarDemo'
,cols: [[
{checkbox:true, fixed: 'left'}
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true}
,{field:'username', title:'用户名', width:120, edit: 'text', templet: '#usernameTpl'}
,{field:'email', title:'邮箱', width:150}
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
,{field:'city', title:'城市', width:100}
,{field:'sign', title:'签名'}
,{field:'experience', title:'积分', width:80, sort: true}
,{field:'ip', title:'IP', width:120}
,{field:'logins', title:'登入次数', width:100, sort: true}
,{field:'joinTime', title:'加入时间', width:120}
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
,
]]
});
table.render({
elem: '#test2'
,url: 'json/table/demo1.json'
,page: {}
//,height: 300
,cols: [[
{type:'numbers'}
,{type: 'checkbox'}
,{field:'id', title:'ID', width:100, unresize: true, sort: true}
,{field:'username', title:'用户名', templet: '#usernameTpl'}
,{field:'email', title:'邮箱'}
,{field:'sex', title:'性别', width:85, templet: '#switchTpl'}
,{field:'lock', title:'是否锁定', width:110, templet: '#checkboxTpl'}
,{field:'city', title:'城市', width: 100}
//,{field:'sign', title:'签名', width:150}
//,{field:'experience', title:'积分', width:80, sort: true}
//,{field:'ip', title:'IP', width:120}
//,{field:'logins', title:'登入次数', width:100, sort: true}
//,{field:'joinTime', title:'加入时间', width:120}
//,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
,
]]
});
//监听表格复选框选择
table.on('checkbox(test)', function(obj){
console.log(obj)
});
//监听单元格编辑
table.on('edit(test)', function(obj){
var value = obj.value //得到修改后的值
,data = obj.data //得到所在行所有键值
,field = obj.field; //得到字段
});
//监听工具条
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('真的删除行么', function(index){
obj.del();
layer.close(index);
});
} else if(obj.event === 'edit'){
layer.prompt({
formType: 2
,value: data.username
}, function(value, index){
obj.update({
username: value
});
layer.close(index);
});
}
});
//监听排序
table.on('sort(test)', function(obj){
console.log(this, obj.field, obj.type)
return;
table.reload('test', {
initSort: obj
,where: { //重新请求服务端
key: obj.field //排序字段
,order: obj.type //排序方式
}
//,height: 300
});
});
//直接赋值数据
table.render({
elem: '#demo'
//,url: 'json/table/demo1.json'
,data: [{
"id": "10001"
,"username": "杜甫"
@ -312,57 +387,6 @@ layui.use('table', function(){
,limits: [3,5,10]
,limit: 3 //每页默认显示的数量
//,loading: false //请求数据时是否显示loading
//,id: 'test' //ID
});
//监听表格复选框选择
table.on('checkbox(test)', function(obj){
console.log(obj)
});
//监听单元格编辑
table.on('edit(test)', function(obj){
var value = obj.value //得到修改后的值
,data = obj.data //得到所在行所有键值
,field = obj.field; //得到字段
});
//监听工具条
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('真的删除行么', function(index){
obj.del();
layer.close(index);
});
} else if(obj.event === 'edit'){
layer.prompt({
formType: 2
,value: data.username
}, function(value, index){
obj.update({
username: value
});
layer.close(index);
});
}
});
//监听排序
table.on('sort(test)', function(obj){
console.log(this, obj.field, obj.type)
return;
table.reload('test', {
initSort: obj
,where: { //重新请求服务端
key: obj.field //排序字段
,order: obj.type //排序方式
}
//,height: 300
});
});

View File

@ -1,7 +1,7 @@
{
"name": "layui-src",
"realname": "layui",
"version": "2.1.7",
"version": "2.2.0",
"independents": {
"layim": "3.7.3"
},

View File

@ -21,7 +21,7 @@ pre{white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; w
/** 初始化全局标签 **/
body{line-height: 24px; font: 14px Helvetica Neue,Helvetica,PingFang SC,\5FAE\8F6F\96C5\9ED1,Tahoma,Arial,sans-serif;}
hr{height: 1px; margin: 10px 0; border: 0; background-color: #e2e2e2; clear: both;}
hr{height: 1px; margin: 10px 0; border: 0; clear: both;}
a{color: #333; text-decoration:none; }
a:hover{color: #777;}
a cite{font-style: normal; *cursor:pointer;}
@ -32,7 +32,11 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-clear{clear: both; *zoom: 1;}
.layui-clear:after{content:'\20'; clear:both; *zoom:1; display:block; height:0;}
.layui-inline{position: relative; display: inline-block; *display:inline; *zoom:1; vertical-align: middle;}
/* 三角形 */.layui-edge{position: absolute; width: 0; height: 0; border-style: dashed; border-color: transparent; overflow: hidden;}
/* 三角形 */.layui-edge{position: relative; display: inline-block; vertical-align: middle; width: 0; height: 0; border-width: 6px; border-style: dashed; border-color: transparent; overflow: hidden;}
.layui-edge-top{top: -4px; border-bottom-color: #999; border-bottom-style: solid;}
.layui-edge-right{border-left-color: #999; border-left-style: solid;}
.layui-edge-bottom{top: 2px; border-top-color: #999; border-top-style: solid;}
.layui-edge-left{border-right-color: #999; border-right-style: solid;}
/* 单行溢出省略 */.layui-elip{text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
/* 屏蔽选中 */.layui-unselect,.layui-icon, .layui-disabled{-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
/* 禁用 */.layui-disabled,.layui-disabled:hover{color: #d2d2d2 !important; cursor: not-allowed !important;}
@ -57,143 +61,6 @@ a cite{font-style: normal; *cursor:pointer;}
-moz-osx-font-smoothing: grayscale;
}
.layui-icon-duihua:before{content:"\e611"}
.layui-icon-shezhi:before{content:"\e614"}
.layui-icon-yinshenim:before{content:"\e60f"}
.layui-icon-search:before{content:"\e615"}
.layui-icon-fenxiang1:before{content:"\e641"}
.layui-icon-shezhi1:before{content:"\e620"}
.layui-icon-yinqing:before{content:"\e628"}
.layui-icon-yuejuancuohao:before{content:"\1006"}
.layui-icon-cuo:before{content:"\1007"}
.layui-icon-baobiao:before{content:"\e629"}
.layui-icon-star:before{content:"\e600"}
.layui-icon-yuandian:before{content:"\e617"}
.layui-icon-kefu:before{content:"\e606"}
.layui-icon-logo:before{content:"\e609"}
.layui-icon-list:before{content:"\e60a"}
.layui-icon-tubiao:before{content:"\e62c"}
.layui-icon-right:before{content:"\1005"}
.layui-icon-huanfu2:before{content:"\e61b"}
.layui-icon-On-line:before{content:"\e610"}
.layui-icon-biaoge:before{content:"\e62d"}
.layui-icon-youyou:before{content:"\e602"}
.layui-icon-zuozuo:before{content:"\e603"}
.layui-icon-cart:before{content:"\e698"}
.layui-icon-cry:before{content:"\e69c"}
.layui-icon-smile:before{content:"\e6af"}
.layui-icon-survey:before{content:"\e6b2"}
.layui-icon-icon5:before{content:"\e62e"}
.layui-icon-iconfont17:before{content:"\e62f"}
.layui-icon-tianjia:before{content:"\e61f"}
.layui-icon-xiazai:before{content:"\e601"}
.layui-icon-xuanzemoban48:before{content:"\e630"}
.layui-icon-gongju:before{content:"\e631"}
.layui-icon-tishilian:before{content:"\e664"}
.layui-icon-bianji:before{content:"\e642"}
.layui-icon-xiaoxi:before{content:"\e645"}
.layui-icon-xiangxia:before{content:"\e61a"}
.layui-icon-wenjian:before{content:"\e621"}
.layui-icon-layouts:before{content:"\e632"}
.layui-icon-duigou:before{content:"\e618"}
.layui-icon-tianjia1:before{content:"\e608"}
.layui-icon-yaoyaozhibofanye:before{content:"\e633"}
.layui-icon-office:before{content:"\e705"}
.layui-icon-404:before{content:"\e61c"}
.layui-icon-lunbozutu:before{content:"\e634"}
.layui-icon-help:before{content:"\e607"}
.layui-icon-daima1:before{content:"\e635"}
.layui-icon-jinshui:before{content:"\e636"}
.layui-icon-faxian:before{content:"\e670"}
.layui-icon-guanyu:before{content:"\e60b"}
.layui-icon-map:before{content:"\e715"}
.layui-icon-xiangshang:before{content:"\e619"}
.layui-icon-bofang:before{content:"\e651"}
.layui-icon-riqi:before{content:"\e637"}
.layui-icon-uploadfile:before{content:"\e61d"}
.layui-icon-delete:before{content:"\e640"}
.layui-icon-bofangzanting02:before{content:"\e652"}
.layui-icon-top:before{content:"\e604"}
.layui-icon-haoyouqingqiu:before{content:"\e612"}
.layui-icon-weibiaoti1:before{content:"\e605"}
.layui-icon-chuangkou:before{content:"\e638"}
.layui-icon-comiisbiaoqing:before{content:"\e60c"}
.layui-icon-zhengque:before{content:"\e616"}
.layui-icon-money:before{content:"\e659"}
.layui-icon-iconfontwodehaoyou:before{content:"\e613"}
.layui-icon-wenjianxiazai:before{content:"\e61e"}
.layui-icon-tupian:before{content:"\e60d"}
.layui-icon-lianjie:before{content:"\e64c"}
.layui-icon-creditlevel:before{content:"\e735"}
.layui-icon-jilu:before{content:"\e60e"}
.layui-icon-liucheng:before{content:"\e622"}
.layui-icon-fontstrikethrough:before{content:"\e64f"}
.layui-icon-unlink:before{content:"\e64d"}
.layui-icon-bianjiwenzi:before{content:"\e639"}
.layui-icon-sanjiao:before{content:"\e623"}
.layui-icon-danxuankuanghouxuan:before{content:"\e63f"}
.layui-icon-danxuankuangxuanzhong:before{content:"\e643"}
.layui-icon-juzhongduiqi:before{content:"\e647"}
.layui-icon-youduiqi:before{content:"\e648"}
.layui-icon-zuoduiqi:before{content:"\e649"}
.layui-icon-gongsisvgtubiaozongji22:before{content:"\e626"}
.layui-icon-gongsisvgtubiaozongji23:before{content:"\e627"}
.layui-icon-shuaxin:before{content:"\1002"}
.layui-icon-loading2:before{content:"\e63e"}
.layui-icon-flow:before{content:"\e65c"}
.layui-icon-jiacu:before{content:"\e62b"}
.layui-icon-uploading:before{content:"\e67c"}
.layui-icon-liaotianduihuaimgoutong:before{content:"\e63a"}
.layui-icon-shipin1:before{content:"\e6ed"}
.layui-icon-yinpin:before{content:"\e6fc"}
.layui-icon-wenjianjiafan:before{content:"\e624"}
.layui-icon-shouji:before{content:"\e63b"}
.layui-icon-tianjia2:before{content:"\e654"}
.layui-icon-wenjianjia:before{content:"\e7a0"}
.layui-icon-biaoqing:before{content:"\e650"}
.layui-icon-html:before{content:"\e64b"}
.layui-icon-biaodan:before{content:"\e63c"}
.layui-icon-goumai:before{content:"\e657"}
.layui-icon-xiangjicopy2x:before{content:"\e65d"}
.layui-icon-25:before{content:"\e62a"}
.layui-icon-emwdaima:before{content:"\e64e"}
.layui-icon-hot:before{content:"\e756"}
.layui-icon-shezhi11:before{content:"\e716"}
.layui-icon-zitixiahuaxian:before{content:"\e646"}
.layui-icon-sanjiao1:before{content:"\e625"}
.layui-icon-tupian-copy-copy:before{content:"\e64a"}
.layui-icon-caidan:before{content:"\e671"}
.layui-icon-zhuti2:before{content:"\e66c"}
.layui-icon-loading1:before{content:"\e63d"}
.layui-icon-xieti:before{content:"\e644"}
.layui-icon-shuaxin-copy:before{content:"\e666"}
.layui-icon-jine:before{content:"\e65e"}
.layui-icon-zhuye:before{content:"\e68e"}
.layui-icon-yonghu:before{content:"\e770"}
.layui-icon-xiaoxi2:before{content:"\e667"}
.layui-icon-yuyin:before{content:"\e688"}
.layui-icon-download:before{content:"\e681"}
.layui-icon-yemian1:before{content:"\e655"}
.layui-icon-moban:before{content:"\e663"}
.layui-icon-yibiaopan:before{content:"\e665"}
.layui-icon-pindao:before{content:"\e653"}
.layui-icon-xiayiye:before{content:"\e65a"}
.layui-icon-huaban:before{content:"\e7ae"}
.layui-icon-xiayiye1:before{content:"\e65b"}
.layui-icon-yingyong:before{content:"\e857"}
.layui-icon-more:before{content:"\e65f"}
.layui-icon-xiangji:before{content:"\e660"}
.layui-icon-refresh:before{content:"\e669"}
.layui-icon-nv:before{content:"\e661"}
.layui-icon-nan:before{content:"\e662"}
.layui-icon-gaoji:before{content:"\e674"}
.layui-icon-fengge:before{content:"\e66a"}
.layui-icon-cai:before{content:"\e6c5"}
.layui-icon-zan:before{content:"\e6c6"}
.layui-icon-shoucang:before{content:"\e658"}
.layui-icon-shuaxin2:before{content:"\e66b"}
.layui-icon-moban1:before{content:"\e656"}
.layui-icon-shuaxin3:before{content:"\e66d"}
/* 基本布局 */
.layui-main{position: relative; width: 1140px; margin: 0 auto;}
@ -214,9 +81,6 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-layout-left{position: absolute !important; left: 200px; top: 0;}
.layui-layout-right{position: absolute !important; right: 0; top: 0;}
/* 响应式类 */
/* 栅格布局 */
.layui-container{position: relative; margin: 0 auto; padding: 0 15px; box-sizing: border-box;}
.layui-fluid{position: relative; margin: 0 auto; padding: 0 15px;}
@ -395,16 +259,16 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-btn, .layui-input, .layui-textarea, .layui-upload-button, .layui-select{outline: none; -webkit-appearance: none; transition: all .3s; -webkit-transition: all .3s; box-sizing: border-box;}
/* 引用 */.layui-elem-quote{margin-bottom: 10px; padding: 15px; line-height: 22px; border-left: 5px solid #009688; border-radius: 0 2px 2px 0; background-color: #f2f2f2;}
.layui-quote-nm{border-color: #e2e2e2; border-style: solid; border-width: 1px; border-left-width: 5px; background: none;}
/* 字段集合 */.layui-elem-field{margin-bottom: 10px; padding: 0; border: 1px solid #e2e2e2;}
.layui-quote-nm{border-style: solid; border-width: 1px; border-left-width: 5px; background: none;}
/* 字段集合 */.layui-elem-field{margin-bottom: 10px; padding: 0; border-width: 1px; border-style: solid;}
.layui-elem-field legend{margin-left: 20px; padding: 0 10px; font-size: 20px; font-weight: 300;}
.layui-field-title{margin: 10px 0 20px; border: none; border-top: 1px solid #e2e2e2;}
.layui-field-title{margin: 10px 0 20px; border-width: 0; border-top-width: 1px;}
.layui-field-box{padding: 10px 15px;}
.layui-field-title .layui-field-box{padding: 10px 0;}
/* 进度条 */
.layui-progress{position: relative; height: 6px; border-radius: 20px; background-color: #e2e2e2;}
.layui-progress-bar{position: absolute; width: 0; max-width: 100%; height: 6px; border-radius: 20px; text-align: right; background-color: #5FB878; transition: all .3s; -webkit-transition: all .3s;}
.layui-progress-bar{position: absolute; left: 0; top: 0; width: 0; max-width: 100%; height: 6px; border-radius: 20px; text-align: right; background-color: #5FB878; transition: all .3s; -webkit-transition: all .3s;}
.layui-progress-big,
.layui-progress-big .layui-progress-bar{height: 18px; line-height: 18px;}
.layui-progress-text{position: relative; top: -18px; line-height: 18px; font-size: 12px; color: #666}
@ -412,19 +276,21 @@ a cite{font-style: normal; *cursor:pointer;}
/* 卡片面板 */
.layui-card{margin-bottom: 15px; border-radius: 2px; background-color: #fff; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);}
.layui-card-header{position: relative; height: 42px; line-height: 42px; padding: 0 15px; border-bottom: 1px dotted #E9E9E9; color: #333; border-radius: 2px 2px 0 0; font-size: 14px;}
.layui-card-body{padding: 10px 15px; line-height: 24px;}
.layui-card:last-child{margin-bottom: 0;}
.layui-card-header{position: relative; height: 42px; line-height: 42px; padding: 0 15px; border-bottom: 1px solid #f6f6f6; color: #333; border-radius: 2px 2px 0 0; font-size: 14px;}
.layui-card-body{position: relative; padding: 10px 15px; line-height: 24px;}
.layui-card-body .layui-table{margin: 5px 0;}
.layui-card .layui-tab{margin: 0;}
/* 折叠面板 */
.layui-collapse{border: 1px solid #e2e2e2; border-radius: 2px;}
.layui-colla-item{border-top: 1px solid #e2e2e2}
.layui-collapse{border-width: 1px; border-style: solid; border-radius: 2px;}
.layui-colla-item,
.layui-colla-content{border-top-width: 1px; border-top-style: solid;}
.layui-colla-item:first-child{border-top: none;}
.layui-colla-title{position: relative; height: 42px; line-height: 42px; padding: 0 15px 0 35px; color: #333; background-color: #f2f2f2; cursor: pointer;}
.layui-colla-content{display: none; padding: 10px 15px; line-height: 22px; border-top: 1px solid #e2e2e2; color: #666;}
.layui-colla-content{display: none; padding: 10px 15px; line-height: 22px; color: #666;}
.layui-colla-icon{position: absolute; left: 15px; top: 0; font-size: 14px;}
/* 背景颜色 */
.layui-bg-red{background-color: #FF5722 !important; color: #fff!important;} /*赤*/
.layui-bg-orange{background-color: #FFB800!important; color: #fff!important;} /*橙*/
@ -434,6 +300,31 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-bg-black{background-color: #393D49!important; color: #fff!important;} /*黑*/
.layui-bg-gray{background-color: #eee!important; color: #666!important;} /*灰*/
/*
默认主题
*/
/* 边框 */
.layui-quote-nm,
.layui-elem-field,
.layui-collapse,
.layui-colla-item,
.layui-colla-content,
.layui-badge-rim,
.layui-tab-title,
.layui-tab-title .layui-this:after,
.layui-tab-bar,
.layui-tab-card,
.layui-input, .layui-textarea, .layui-select,
.layui-form-pane .layui-form-label,
.layui-form-pane .layui-form-item[pane],
.layui-layedit, .layui-layedit-tool{border-color: #e6e6e6}
/* 背景边框 */
hr, .layui-timeline-item:before{background-color: #e6e6e6;}
/* 文本区域 */
.layui-text{line-height: 22px; font-size: 14px; color: #666;}
@ -465,11 +356,11 @@ a cite{font-style: normal; *cursor:pointer;}
/* 警告 */.layui-btn-danger{background-color: #FF5722;}
/* 禁用 */.layui-btn-disabled,.layui-btn-disabled:hover,.layui-btn-disabled:active{border: 1px solid #e6e6e6; background-color: #FBFBFB; color: #C9C9C9; cursor: not-allowed; opacity: 1;}
/* 大型 */.layui-btn-big{height: 44px; line-height: 44px; padding: 0 25px; font-size: 16px;}
/* 小型 */.layui-btn-small{height: 30px; line-height: 30px; padding: 0 10px; font-size: 12px;}
.layui-btn-small i{font-size: 16px !important;}
/* 迷你 */.layui-btn-mini{height: 22px; line-height: 22px; padding: 0 5px; font-size: 12px;}
.layui-btn-mini i{font-size: 14px !important;}
/* 大型 */.layui-btn-lg{height: 44px; line-height: 44px; padding: 0 25px; font-size: 16px;}
/* 小型 */.layui-btn-sm{height: 30px; line-height: 30px; padding: 0 10px; font-size: 12px;}
.layui-btn-sm i{font-size: 16px !important;}
/* 超小 */.layui-btn-xs{height: 22px; line-height: 22px; padding: 0 5px; font-size: 12px;}
.layui-btn-xs i{font-size: 14px !important;}
/* 按钮组 */.layui-btn-group{display: inline-block; vertical-align: middle; font-size: 0;}
.layui-btn-group .layui-btn{margin-left: 0!important; margin-right: 0!important; border-left: 1px solid rgba(255,255,255,.5); border-radius: 0;}
.layui-btn-group .layui-btn-primary{border-left: none;}
@ -481,7 +372,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-btn-group+.layui-btn-group{margin-left: 10px;}
/** 表单 **/
.layui-input, .layui-textarea, .layui-select{height: 38px; line-height: 1.3; line-height: 38px\9; border: 1px solid #e6e6e6; background-color: #fff; border-radius: 2px;}
.layui-input, .layui-textarea, .layui-select{height: 38px; line-height: 1.3; line-height: 38px\9; border-width: 1px; border-style: solid; background-color: #fff; border-radius: 2px;}
.layui-input::-webkit-input-placeholder,
.layui-textarea::-webkit-input-placeholder,
.layui-select::-webkit-input-placeholder{line-height: 1.3;}
@ -506,7 +397,7 @@ a cite{font-style: normal; *cursor:pointer;}
/* 分割块 */.layui-form-mid{position: relative; float: left; display: block; padding: 8px 0 !important; line-height: 20px; margin-right: 10px;}
/* 警告域 */.layui-form-danger:focus
,.layui-form-danger+.layui-form-select .layui-input{border: 1px solid #FF5722 !important;}
,.layui-form-danger+.layui-form-select .layui-input{border-color: #FF5722 !important;}
/* 下拉选择 */.layui-form-select{position: relative;}
@ -549,7 +440,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form-checkbox[lay-skin="primary"] i{position: relative; top: 0; width: 16px; height: 16px; line-height: 16px; border: 1px solid #d2d2d2; font-size: 12px; border-radius: 2px; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;}
.layui-form-checkbox[lay-skin="primary"]:hover i{border-color: #5FB878; color: #fff;}
.layui-form-checked[lay-skin="primary"] i{border-color: #5FB878; background-color: #5FB878; color: #fff;}
.layui-checkbox-disbaled[lay-skin="primary"] span{background: none!important;}
.layui-checkbox-disbaled[lay-skin="primary"] span{background: none!important; color: #c2c2c2;}
.layui-checkbox-disbaled[lay-skin="primary"]:hover i{border-color: #d2d2d2;}
.layui-form-item .layui-form-checkbox[lay-skin="primary"]{margin-top: 10px;}
@ -572,18 +463,18 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form-radioed i,.layui-form-radio i:hover{color: #5FB878;}
.layui-radio-disbaled i{color: #e2e2e2 !important;}
/* 表单方框风格 */.layui-form-pane .layui-form-label{width: 110px; padding: 8px 15px; height: 38px; line-height: 20px; border: 1px solid #e6e6e6; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box;}
/* 表单方框风格 */.layui-form-pane .layui-form-label{width: 110px; padding: 8px 15px; height: 38px; line-height: 20px; border-width: 1px; border-style: solid; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box;}
.layui-form-pane .layui-input-inline{margin-left: -1px;}
.layui-form-pane .layui-input-block{margin-left: 110px; left: -1px;}
.layui-form-pane .layui-input{border-radius: 0 2px 2px 0;}
.layui-form-pane .layui-form-text .layui-form-label{float: none; width: 100%; border-right: 1px solid #e6e6e6; border-radius: 2px; box-sizing: border-box; text-align: left;}
.layui-form-pane .layui-form-text .layui-form-label{float: none; width: 100%; border-radius: 2px; box-sizing: border-box; text-align: left;}
.layui-form-pane .layui-form-text .layui-input-inline{display: block; margin: 0; top: -1px; clear: both;}
.layui-form-pane .layui-form-text .layui-input-block{margin: 0; left: 0; top: -1px;}
.layui-form-pane .layui-form-text .layui-textarea{min-height: 100px; border-radius: 0 0 2px 2px;}
.layui-form-pane .layui-form-checkbox{margin: 4px 0 4px 10px;}
.layui-form-pane .layui-form-switch,
.layui-form-pane .layui-form-radio{margin-top: 6px; margin-left: 10px; }
.layui-form-pane .layui-form-item[pane]{position: relative; border: 1px solid #e6e6e6;}
.layui-form-pane .layui-form-item[pane]{position: relative; border-width: 1px; border-style: solid;}
.layui-form-pane .layui-form-item[pane] .layui-form-label{position: absolute; left: 0; top: 0; height: 100%; border-width: 0px; border-right-width: 1px;}
.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left: 110px;}
@ -598,8 +489,8 @@ a cite{font-style: normal; *cursor:pointer;}
}
/** 富文本编辑器 **/
.layui-layedit{border: 1px solid #d2d2d2; border-radius: 2px;}
.layui-layedit-tool{padding: 3px 5px; border-bottom: 1px solid #e2e2e2; font-size: 0;}
.layui-layedit{border-width: 1px; border-style: solid; border-radius: 2px;}
.layui-layedit-tool{padding: 3px 5px; border-bottom-width: 1px; border-bottom-style: solid; font-size: 0;}
.layedit-tool-fixed{position: fixed; top: 0; border-top: 1px solid #e2e2e2;}
.layui-layedit-tool .layedit-tool-mid,
.layui-layedit-tool .layui-icon{display: inline-block; vertical-align: middle; text-align: center; font-size: 14px;}
@ -656,7 +547,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-laypage .layui-laypage-limits{vertical-align: top;}
.layui-laypage select{height: 22px; padding: 3px; border-radius: 2px; cursor: pointer;}
.layui-laypage .layui-laypage-skip{height: 30px; line-height: 30px; color: #999;}
.layui-laypage input, .layui-laypage button{height: 30px; line-height: 30px; border:1px solid #e2e2e2; border-radius: 2px; vertical-align: top; background-color: #fff; box-sizing: border-box;}
.layui-laypage input, .layui-laypage button{height: 30px; line-height: 30px; border-radius: 2px; vertical-align: top; background-color: #fff; box-sizing: border-box;}
.layui-laypage input{display: inline-block; width: 40px; margin: 0 10px; padding: 0 3px; text-align: center;}
.layui-laypage input:focus,
.layui-laypage select:focus{border-color: #009688!important;}
@ -671,15 +562,15 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-flow-more a i{font-size: 30px; color: #737383;}
/** 表格 **/
.layui-table{width: 100%; margin: 10px 0; background-color: #fff;}
.layui-table{width: 100%; margin: 10px 0; background-color: #fff; color: #666;}
.layui-table tr{transition: all .3s; -webkit-transition: all .3s;}
.layui-table th{text-align: left; font-weight: 400;}
.layui-table thead tr,
.layui-table-header,
.layui-table-fixed-l tr,
.layui-table-tool,
.layui-table-patch,
.layui-table-mend{background-color: #f2f2f2;}
.layui-table th{text-align: left; font-weight: 400;}
.layui-table-mend{background-color: #f8f8f8;}
.layui-table th,
.layui-table td,
@ -687,12 +578,15 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-table[lay-skin="row"],
.layui-table-view,
.layui-table-header,
.layui-table-tool{border: 1px solid #e2e2e2}
.layui-table-tool,
.layui-table-page,
.layui-table-fixed-r,
.layui-table-tips-main{border-width: 1px; border-style: solid; border-color: #eee;}
.layui-table th, .layui-table td{position: relative; padding: 9px 15px; min-height: 20px; line-height: 20px; font-size: 14px;}
.layui-table[lay-even] tr:nth-child(even){background-color: #f8f8f8;}
.layui-table tbody tr:hover,
.layui-table-hover{background-color: #f2f2f2!important;}
.layui-table-hover{background-color: #f8f8f8!important;}
.layui-table-click{background-color: #FFEEE8!important;}
.layui-table[lay-skin="line"] th, .layui-table[lay-skin="line"] td{border-width: 0; border-bottom-width: 1px;}
@ -710,7 +604,9 @@ a cite{font-style: normal; *cursor:pointer;}
/* 数据表格 */
.layui-table[lay-data]{display: none;}
.layui-table-view{position: relative; margin: 10px 0; overflow: hidden;}
.layui-table-view,
.layui-table-box{position: relative; overflow: hidden;}
.layui-table-view{margin: 10px 0;}
.layui-table-view .layui-table{position: relative; width: auto; margin: 0;}
.layui-table-view .layui-table[lay-skin="line"]{border-width: 0; border-right-width: 1px;}
.layui-table-view .layui-table[lay-skin="row"]{border-width: 0; border-bottom-width: 1px;}
@ -721,49 +617,62 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-table-header{border-width: 0; border-bottom-width: 1px; overflow: hidden;}
.layui-table-header .layui-table{margin-bottom: -1px;}
.layui-table-sort{width: 20px; height: 20px; margin-left: 5px; cursor: pointer!important;}
.layui-table-sort .layui-edge{left: 5px; border-width: 5px;}
.layui-table-sort .layui-edge{position: absolute; left: 5px; border-width: 5px;}
.layui-table-sort .layui-table-sort-asc{top: 4px; border-top: none; border-bottom-style: solid; border-bottom-color: #b2b2b2;}
.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color: #666;}
.layui-table-sort .layui-table-sort-desc{bottom: 4px; border-bottom: none; border-top-style: solid; border-top-color: #b2b2b2;}
.layui-table-sort .layui-table-sort-desc:hover{border-top-color: #666;}
.layui-table-sort[lay-sort="asc"] .layui-table-sort-asc{border-bottom-color: #000;}
.layui-table-sort[lay-sort="desc"] .layui-table-sort-desc{border-top-color: #000;}
.layui-table-cell{height: 28px; line-height: 28px; padding: 0 15px; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box;}
.layui-table-cell .layui-form-checkbox{top: -1px;}
.layui-table-cell{height: 28px; line-height: 28px; padding: 0 15px; position: relative; overflow: hidden; /*text-overflow: ellipsis;*/ white-space: nowrap; box-sizing: border-box;}
.layui-table-cell .layui-form-checkbox[lay-skin="primary"]{top: -1px; vertical-align: middle;}
.layui-table-cell .layui-table-link{color: #01AAED;}
.laytable-cell-space{width: 15px; padding: 0; text-align: center;}
.laytable-cell-checkbox,
.laytable-cell-space,
.laytable-cell-numbers{padding: 0; text-align: center;}
.layui-table-body{position: relative; overflow: auto; margin-right: -1px; margin-bottom: -1px;}
.layui-table-body .layui-none{line-height: 40px; text-align: center; color: #999;}
.layui-table-fixed{position: absolute; left: 0; top: 0;}
.layui-table-fixed .layui-table-body{overflow: hidden;}
.layui-table-fixed-r{left: auto; right: -1px; border-left: 1px solid #e2e2e2; box-shadow: -1px 0 8px rgba(0,0,0,.1);}
.layui-table-fixed-l{box-shadow: 0 -1px 8px rgba(0,0,0,.06);}
.layui-table-fixed-r{left: auto; right: -1px; border-width: 0; border-left-width: 1px; box-shadow: -1px 0 8px rgba(0,0,0,.06);}
.layui-table-fixed-r .layui-table-header{position: relative; overflow: visible;}
.layui-table-mend{position: absolute; right: -49px; top: 0; height: 100%; width: 50px;}
.layui-table-tool{position: relative; width: 100%; padding: 7px 10px 0 0; border-width: 0; border-top-width: 1px; height: 41px; margin-bottom: -1px; font-size: 12px; white-space: nowrap;}
.layui-table-tool:hover{overflow-x: auto;}
.layui-table-page{height: 26px;}
.layui-table-tool .layui-laypage{margin: 0;}
.layui-table-tool .layui-laypage span,
.layui-table-tool .layui-laypage a{height: 26px; line-height: 26px; border: none; background: none; padding: 0 12px}
.layui-table-tool .layui-laypage .layui-laypage-count,
.layui-table-tool .layui-laypage .layui-laypage-limits,
.layui-table-tool .layui-laypage .layui-laypage-skip{margin-left: 0; padding: 0;}
.layui-table-tool .layui-laypage .layui-laypage-total{padding: 0 10px;}
.layui-table-tool .layui-laypage .layui-laypage-spr{padding: 0;}
.layui-table-tool .layui-laypage input,
.layui-table-tool .layui-laypage button{height: 26px; line-height: 26px; }
.layui-table-tool .layui-laypage input{width: 40px;}
.layui-table-tool .layui-laypage button{padding: 0 10px;}
.layui-table-tool{position: relative; width: 100%; height: 50px; line-height: 30px; padding: 10px 15px; border-width: 0; border-bottom-width: 1px;}
.layui-table-page{position: relative; width: 100%; padding: 7px 10px 0 0; border-width: 0; border-top-width: 1px; height: 41px; margin-bottom: -1px; font-size: 12px; white-space: nowrap;}
.layui-table-page:hover{overflow-x: auto;}
.layui-table-page>div{height: 26px;}
.layui-table-page .layui-laypage{margin: 0;}
.layui-table-page .layui-laypage a,
.layui-table-page .layui-laypage span{height: 26px; line-height: 26px; border: none; background: none;}
.layui-table-page .layui-laypage a,
.layui-table-page .layui-laypage span.layui-laypage-curr{padding: 0 12px;}
.layui-table-page .layui-laypage span{margin-left: 0; padding: 0;}
.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left: 0; top: 0; padding: 0;}
.layui-table-page .layui-laypage input,
.layui-table-page .layui-laypage button{height: 26px; line-height: 26px; }
.layui-table-page .layui-laypage input{width: 40px;}
.layui-table-page .layui-laypage button{padding: 0 10px;}
.layui-table-view select[lay-ignore]{display: inline-block;}
.layui-table-tool select{height: 18px;}
.layui-table-page select{height: 18px;}
.layui-table-patch .layui-table-cell{padding: 0; width: 30px;}
.layui-table-edit{position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0 15px 1px; border: none;}
.layui-table-edit:focus{background-color: #F0F9F2;}
.layui-table-edit{position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0 14px 1px; border-radius: 0; box-shadow: 1px 1px 20px rgba(0,0,0,.15)}
.layui-table-edit:focus{border-color: #5FB878!important;}
select.layui-table-edit{padding: 0 0 0 10px; border-color: #C9C9C9;}
.layui-table-view .layui-form-switch,
.layui-table-view .layui-form-checkbox,
.layui-table-view .layui-form-radio{top: 0; margin: 0; box-sizing: content-box;}
.layui-table-view .layui-form-checkbox{height: 26px; line-height: 26px; vertical-align: top;}
body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-shadow: 0 1px 6px rgba(0,0,0,.1);}
.layui-table-tips-main{margin: -44px 0 0 -1px; max-height: 150px; padding: 8px 15px; font-size: 14px; overflow-y: scroll; background-color: #fff; color: #333; border: 1px solid #e2e2e2}
.layui-table-tips-main{margin: -44px 0 0 -1px; max-height: 150px; padding: 8px 15px; font-size: 14px; overflow-y: scroll; background-color: #fff; color: #333;}
.layui-table-tips-c{position: absolute; right: -3px; top: -12px; width: 18px; height: 18px; padding: 3px; text-align: center; font-weight: 700; border-radius: 100%; font-size: 14px; cursor: pointer; background-color: #666;}
.layui-table-tips-c:hover{background-color: #999;}
@ -781,12 +690,11 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-upload-wrap .layui-upload-file{display: block!important; position: absolute; left: 0; top: 0; z-index: 10; font-size: 100px; width: 100%; height: 100%; opacity: .01; filter: Alpha(opacity=1); cursor: pointer;}
/** 代码修饰器 **/
.layui-code{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}
/** 树组件 **/
/** 树组件(重写中) **/
.layui-tree{line-height: 26px;}
.layui-tree li{text-overflow: ellipsis; overflow:hidden; white-space: nowrap;}
.layui-tree li a,
@ -867,23 +775,23 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
/** 面包屑 **/
.layui-breadcrumb{visibility: hidden; font-size: 0;}
.layui-breadcrumb a{padding-right: 8px; line-height: 22px; font-size: 14px; color: #333 !important;}
.layui-breadcrumb a:hover{color: #01AAED !important;}
.layui-breadcrumb a span,
.layui-breadcrumb a cite{ color: #666; cursor: text; font-style: normal;}
.layui-breadcrumb a span{padding-left: 8px; font-family: Sim sun;}
.layui-breadcrumb>*{font-size: 14px;}
.layui-breadcrumb a{color: #999 !important;}
.layui-breadcrumb a:hover{color: #5FB878 !important;}
.layui-breadcrumb a cite{color: #666; font-style: normal;}
.layui-breadcrumb span[lay-separator]{margin: 0 10px; color: #999;}
/** Tab选项卡 **/
.layui-tab{margin: 10px 0; text-align: left !important;}
.layui-tab[overflow]>.layui-tab-title{overflow: hidden;}
.layui-tab-title{position: relative; left: 0; height: 40px; white-space: nowrap; font-size: 0; border-bottom: 1px solid #e2e2e2; transition: all .2s; -webkit-transition: all .2s;}
.layui-tab-title{position: relative; left: 0; height: 40px; white-space: nowrap; font-size: 0; border-bottom-width: 1px; border-bottom-style: solid; transition: all .2s; -webkit-transition: all .2s;}
.layui-tab-title li{display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; font-size: 14px; transition: all .2s; -webkit-transition: all .2s;}
.layui-tab-title li{position: relative; line-height: 40px; min-width: 65px; padding: 0 15px; text-align: center; cursor: pointer;}
.layui-tab-title li a{display: block;}
.layui-tab-title .layui-this{color: #000;}
.layui-tab-title .layui-this:after{position: absolute; left:0; top: 0; content: ''; width:100%; height: 41px; border: 1px solid #e2e2e2; border-bottom-color: #fff; border-radius: 2px 2px 0 0; box-sizing: border-box; pointer-events: none;}
.layui-tab-bar{position: absolute; right: 0; top: 0; z-index: 10; width: 30px; height: 39px; line-height: 39px; border: 1px solid #e2e2e2; border-radius: 2px; text-align: center; background-color: #fff; cursor: pointer;}
.layui-tab-title .layui-this:after{position: absolute; left:0; top: 0; content: ''; width:100%; height: 41px; border-width: 1px; border-style: solid; border-bottom-color: #fff; border-radius: 2px 2px 0 0; box-sizing: border-box; pointer-events: none;}
.layui-tab-bar{position: absolute; right: 0; top: 0; z-index: 10; width: 30px; height: 39px; line-height: 39px; border-width: 1px; border-style: solid; border-radius: 2px; text-align: center; background-color: #fff; cursor: pointer;}
.layui-tab-bar .layui-icon{position: relative; display: inline-block; top: 3px; transition: all .3s; -webkit-transition: all .3s;}
.layui-tab-item{display: none;}
.layui-tab-more{padding-right: 30px; height: auto !important; white-space: normal !important;}
@ -901,7 +809,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
,.layui-tab-brief > .layui-tab-more li.layui-this:after{border: none; border-radius: 0; border-bottom: 2px solid #5FB878;}
.layui-tab-brief[overflow] > .layui-tab-title .layui-this:after{top: -1px;}
/* Tab卡片风格 */.layui-tab-card{border: 1px solid #e2e2e2; border-radius: 2px; box-shadow: 0 2px 5px 0 rgba(0,0,0,.1);}
/* Tab卡片风格 */.layui-tab-card{border-width: 1px; border-style: solid; border-radius: 2px; box-shadow: 0 2px 5px 0 rgba(0,0,0,.1);}
.layui-tab-card > .layui-tab-title{ background-color: #f2f2f2;}
.layui-tab-card > .layui-tab-title li{margin-right: -1px; margin-left: -1px;}
.layui-tab-card > .layui-tab-title .layui-this{background-color: #fff; }
@ -915,7 +823,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-timeline-item{position: relative; padding-bottom: 20px;}
.layui-timeline-axis{position: absolute; left: -5px; top: 0; z-index: 10; width: 20px; height: 20px; line-height: 20px; background-color: #fff; color: #5FB878; border-radius: 50%; text-align: center; cursor: pointer;}
.layui-timeline-axis:hover{color: #FF5722;}
.layui-timeline-item:before{content: ''; position: absolute; left: 5px; top: 0; z-index: 0; width: 1px; height: 100%; background-color: #e2e2e2;}
.layui-timeline-item:before{content: ''; position: absolute; left: 5px; top: 0; z-index: 0; width: 1px; height: 100%;}
.layui-timeline-item:last-child:before{display: none;}
.layui-timeline-item:first-child:before{display: block;}
.layui-timeline-content{padding-left: 25px;;}
@ -924,10 +832,10 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
/* 小徽章 */
.layui-badge,
.layui-badge-dot,
.layui-badge-rim{position:relative; display: inline-block; font-size: 12px; background-color: #FF5722; color: #fff;}
.layui-badge{min-width: 8px; height: 18px; line-height: 18px; padding: 0 5px; text-align: center; border-radius: 2px;}
.layui-badge-dot{width: 8px; height: 8px; border-radius: 50%;}
.layui-badge-rim{height: 18px; line-height: 18px; padding: 0 5px; border: 1px solid #e2e2e2; border-radius: 3px; background-color: #fff; color: #666;}
.layui-badge-rim{position:relative; display: inline-block; padding: 0 6px; font-size: 12px; text-align: center; background-color: #FF5722; color: #fff; border-radius: 2px;}
.layui-badge{height: 18px; line-height: 18px;}
.layui-badge-dot{width: 8px; height: 8px; padding: 0; border-radius: 50%;}
.layui-badge-rim{height: 18px; line-height: 18px; border-width: 1px; border-style: solid; background-color: #fff; color: #666;}
.layui-btn .layui-badge,
.layui-btn .layui-badge-dot{margin-left: 5px;}
@ -937,10 +845,10 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-tab-title .layui-badge-dot{left: 5px; top: -2px;}
/* carousel 轮播 */
.layui-carousel{position: relative; left: 0; top: 0; background-color: #f2f2f2;}
.layui-carousel{position: relative; left: 0; top: 0; background-color: #f8f8f8;}
.layui-carousel>*[carousel-item]{position: relative; width: 100%; height: 100%; overflow: hidden;}
.layui-carousel>*[carousel-item]:before{position: absolute; content: '\e63d'; left: 50%; top: 50%; width: 100px; line-height: 20px; margin: -10px 0 0 -50px; text-align: center; color: #999; font-family:"layui-icon" !important; font-size: 20px; font-style:normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}
.layui-carousel>*[carousel-item] > *{display: none; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #f2f2f2; transition-duration: .3s; -webkit-transition-duration: .3s;}
.layui-carousel>*[carousel-item]:before{position: absolute; content: '\e63d'; left: 50%; top: 50%; width: 100px; line-height: 20px; margin: -10px 0 0 -50px; text-align: center; color: #c2c2c2; font-family:"layui-icon" !important; font-size: 30px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}
.layui-carousel>*[carousel-item] > *{display: none; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #f8f8f8; transition-duration: .3s; -webkit-transition-duration: .3s;}
.layui-carousel-updown > *{-webkit-transition: .3s ease-in-out up; transition: .3s ease-in-out up;}
.layui-carousel-arrow{display: none\0; opacity: 0; position: absolute; left: 10px; top: 50%; margin-top: -18px; width: 36px; height: 36px; line-height: 36px; text-align: center; font-size: 20px; border: none 0; border-radius: 50%; background-color: rgba(0,0,0,.2); color: #fff; -webkit-transition-duration: .3s; transition-duration: .3s; cursor: pointer;}
.layui-carousel-arrow[lay-type="add"]{left: auto!important; right: 10px;}
@ -1045,17 +953,6 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
}
.layui-anim-upbit{-webkit-animation-name: layui-upbit; animation-name: layui-upbit;}
@-webkit-keyframes layui-movey{ /* 垂直位移 */
0% {-webkit-transform: translate3d(0, 50px, 0);}
50% {-webkit-transform: translate3d(0, -50px, 0);}
100% {-webkit-transform: translate3d(0, 50px, 0);}
}
@keyframes layui-movey{
0% {transform: translate3d(0, 50px, 0);}
50% {transform: translate3d(0, -50px, 0);}
100% {transform: translate3d(0, 50px, 0);}
}
.layui-anim-movey{-webkit-animation-name: layui-movey; animation-name: layui-movey;}
@-webkit-keyframes layui-scale { /* 放大 */
0% {opacity: 0.3; -webkit-transform: scale(.5);}

View File

@ -114,7 +114,7 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
.layui-laydate-content .laydate-day-prev,
.layui-laydate-content .laydate-day-next{color: #d2d2d2;}
.laydate-selected.laydate-day-prev,
.laydate-selected.laydate-day-next{color: #fff !important;}
.laydate-selected.laydate-day-next{background-color: #f8f8f8 !important;}
.layui-laydate-footer{border-top: 1px solid #e2e2e2;}
.layui-laydate-hint{color: #FF5722;}
.laydate-day-mark::after{background-color: #5FB878;}

Binary file not shown.

View File

@ -339,6 +339,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="sanjiao1" unicode="&#58917;" d="M773.128299 88.652342M889.696178 575.195553 158.862147 575.195553 524.357446 209.647043 889.696178 575.195553Z" horiz-adv-x="1024" />
<glyph glyph-name="tips" unicode="&#59138;" d="M967.280184 578.537671c-24.915459 58.887178-60.544935 111.76755-105.96745 157.161413-45.393863 45.393863-98.273211 81.051991-157.160389 105.96745-60.988026 25.803689-125.735679 38.853913-192.494129 38.853913-66.729797 0-131.504056-13.0799-192.494129-38.853913-58.887178-24.916483-111.766526-60.544935-157.160389-105.96745-45.393863-45.393863-81.051991-98.274234-105.96745-157.161413-25.803689-60.988026-38.884612-125.734656-38.884612-192.464453s13.0799-131.50508 38.884612-192.464453c24.915459-58.887178 60.544935-111.737874 105.96745-157.161413 45.393863-45.393863 98.273211-81.051991 157.160389-105.96745 60.988026-25.803689 125.735679-38.853913 192.494129-38.853913 66.729797 0 131.504056 13.0799 192.494129 38.853913 58.887178 24.916483 111.766526 60.544935 157.160389 105.96745 45.393863 45.393863 81.051991 98.274234 105.96745 157.161413 25.803689 60.988026 38.853913 125.734656 38.853913 192.464453S993.084896 517.549645 967.280184 578.537671zM511.687892-55.138552000000004c-243.302305 0-441.241446 197.909465-441.241446 441.21177S268.385587 827.284989 511.687892 827.284989c243.273652-0.029676 441.210747-197.938118 441.210747-441.21177S754.990197-55.138552000000004 511.687892-55.138552000000004zM511.657192 573.565427m-45.511543 0a44.475 44.475 0 1 1 91.023086 0 44.475 44.475 0 1 1-91.023086 0ZM542.729885 184.14011300000004c0-17.162892-13.906731-31.071669-31.070646-31.071669l0 0c-17.163915 0-31.070646 13.907755-31.070646 31.071669L480.588593 426.998303c0 17.162892 13.906731 31.071669 31.070646 31.071669l0 0c17.163915 0 31.070646-13.907755 31.070646-31.071669L542.729885 184.14011300000004z" horiz-adv-x="1024" />
<glyph glyph-name="tupian-copy-copy" unicode="&#58954;" d="M765.376 615.424c0 0 103.040 1.024 103.040-100.992 0 0 9.536-98.752-103.040-100.928 0 0-100.864-2.176-99.84 100.928 0 0.064-1.088 91.456 99.84 100.992zM968.32 770.56c0 0 54.208-4.224 54.208-52.032v-712.832c0 0-3.2-51.008-54.208-52.096v816.96zM1.472 5.632c0 0 2.176-52.096 52.096-52.096h914.752v150.848h-99.712l-203.072 206.144-153.024-153.984-208.192 257.024-205.056-307.072-45.632-1.024-1.152 612.992h-51.008v-712.832zM968.32 770.56h-914.752c0 0-52.096 1.088-52.096-52.032h966.848v52.032z" horiz-adv-x="1024" />
@ -405,6 +408,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="xiangji" unicode="&#58976;" d="M884.3 648.6H704.2L679.5 698l-0.2 0.4c-1.9 3.6-3.6 6.9-5.1 9.9-12 23.4-21.5 41.9-54.1 41.9H416.7c-32.9 0-43.7-21.3-55.1-43.8-1.3-2.6-2.7-5.3-4.2-8.1l-24.8-49.7H152.4c-34 0-61.7-27.7-61.7-61.7v-488c0-34 27.7-61.7 61.7-61.7h731.9c34 0 61.7 27.7 61.7 61.7v488c0 34-27.7 61.7-61.7 61.7zM904 98.9c0-10.8-8.8-19.7-19.7-19.7H152.4c-10.8 0-19.7 8.8-19.7 19.7v488c0 10.8 8.8 19.7 19.7 19.7h206.1l36.2 72.5c1.5 2.9 2.9 5.7 4.3 8.3 10.6 20.8 11.1 20.8 17.7 20.8H620c4.6 0 5.8-0.6 5.8-0.6 2-1.2 7.2-11.2 10.9-18.5 1.6-3.1 3.3-6.5 5.3-10.1l36.2-72.4h206.1c10.8 0 19.7-8.8 19.7-19.7v-488zM525.5 565.5c-123.5 0-223.6-100.1-223.6-223.6S402 118.2 525.5 118.2s223.7 100.1 223.7 223.7c0 123.5-100.2 223.6-223.7 223.6z m0-402.5c-98.8 0-178.9 80.1-178.9 178.9 0 98.8 80.1 178.9 178.9 178.9 98.8 0 178.9-80.1 178.9-178.9 0-98.8-80.1-178.9-178.9-178.9z m246 402.5v-44.7H861v44.7h-89.5z" horiz-adv-x="1024" />
<glyph glyph-name="note" unicode="&#58990;" d="M987.2 384.36L512.43 859.13a84.75 84.75 0 0 1-65 24.71L111.55 864.09a84.83 84.83 0 0 1-79.65-79.65L12.15 448.57a84.57 84.57 0 0 1 24.69-65l474.8-474.8a84.91 84.91 0 0 1 119.93 0L987.2 264.41999999999996a84.9 84.9 0 0 1 0 119.94z m-39.28-80.66L592.29-51.91999999999996a29.31 29.31 0 0 0-41.37 0L76.1 422.9a29.22 29.22 0 0 0-8.49 22.38l19.74 335.88a29.29 29.29 0 0 0 27.48 27.48l335.9 19.75a29.32 29.32 0 0 0 22.38-8.52l474.8-474.8a29.31 29.31 0 0 0 0.01-41.37zM236.86 659.14c-50.92-50.95-50.92-133.8 0-184.72a130.61 130.61 0 1 1 184.71 184.72c-50.89 50.86-133.77 50.86-184.71 0zM382.29 513.7c-28.38-28.38-77.78-28.38-106.15 0a75.08 75.08 0 1 0 106.15 0z" horiz-adv-x="1024" />
<glyph glyph-name="refresh" unicode="&#58985;" d="M928 810.666667c-18.133333 0-32-13.866667-32-32v-164.266667C816 747.733333 669.866667 832 512 832 264.533333 832 64 631.4666669999999 64 384s200.533333-448 448-448c230.4 0 422.4 172.8 445.866667 402.133333 2.133333 17.066667-10.666667 33.066667-28.8 35.2-17.066667 2.133333-33.066667-10.666667-35.2-28.8C873.6 148.26666699999998 709.333333 0 512 0c-212.266667 0-384 171.733333-384 384s171.733333 384 384 384c137.6 0 264.533333-74.666667 332.8-192H693.333333c-18.133333 0-32-13.866667-32-32s13.866667-32 32-32h266.666667V778.666667c0 18.133333-14.933333 32-32 32z" horiz-adv-x="1024" />
@ -429,9 +435,6 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="shoucang" unicode="&#58968;" d="M752-43.2c-9.6 0-20.8 3.2-30.4 8l-208 104-209.6-104c-20.8-11.2-48-9.6-67.2 4.8-19.2 14.4-30.4 40-25.6 64l43.2 224L89.6 411.2C72 428.8 65.6 456 72 478.4c8 24 27.2 41.6 52.8 44.8l228.8 41.6 102.4 208c11.2 22.4 33.6 36.8 57.6 36.8s48-14.4 57.6-36.8l102.4-208 228.8-40c24-3.2 44.8-20.8 51.2-44.8 8-24 1.6-49.6-16-67.2L772.8 257.6l41.6-224c4.8-25.6-6.4-49.6-25.6-64-9.6-8-22.4-12.8-36.8-12.8z" horiz-adv-x="1024" />
<glyph glyph-name="shuaxin2" unicode="&#58987;" d="M854 560.7l-0.3-0.2c-5.6 9.3-15.9 15.6-27.6 15.6-17.8 0-32.2-14.4-32.2-32.1 0-5.3 1.3-10.3 3.6-14.7h-0.1c22-43.4 34.4-92.5 34.4-144.5C831.8 208.2 688.6 65 512 65S192.2 208.1 192.2 384.8c0 152.4 106.5 279.2 249.1 311.2l-33.6-43.7c-10.8-14-8.1-34.2 5.9-45 14-10.8 34.2-8.1 45 5.9l75.3 97.8c6.5 5.9 10.6 14.4 10.6 23.8 0 11.3-5.9 21.2-14.7 27L429.3 838.9c-13.8 10.6-33.8 8-44.4-5.7l-0.6-0.8c-10.6-13.8-8-33.7 5.8-44.3l38.4-29.5C257 720.1 128.9 566.9 128.9 383.8c0-212.1 172-384.1 384.1-384.1s384.1 172 384.1 384.1c0 63.8-15.5 124-43.1 176.9zM708.9 637.9a32.2 32.1 0 1 1 64.4 0 32.2 32.1 0 1 1-64.4 0Z" horiz-adv-x="1024" />
<glyph glyph-name="moban1" unicode="&#58966;" d="M512 384zM43.52 601.6l409.6-176.64c58.88-30.72 110.08 0 110.08 0l414.72 174.08 2.56 2.56c10.24 5.12 15.36 15.36 15.36 28.16 0 15.36-10.24 28.16-23.04 30.72L563.2 837.12c-56.32 23.04-97.28 0-97.28 0L46.08 660.48c-12.8-5.12-20.48-17.92-20.48-30.72s7.68-23.04 17.92-28.16z m0 0M512 222.72c-2.56 0-7.68 0-10.24 2.56l-486.4 215.04c-12.8 5.12-17.92 20.48-12.8 33.28 5.12 12.8 20.48 17.92 33.28 12.8L512 276.48 988.16 486.4c12.8 5.12 28.16 0 33.28-12.8 5.12-12.8 0-28.16-12.8-33.28l-486.4-215.04c-2.56-2.56-7.68-2.56-10.24-2.56zM512 71.68c-2.56 0-7.68 0-10.24 2.56l-486.4 215.04c-12.8 5.12-17.92 20.48-12.8 33.28 5.12 10.24 20.48 17.92 33.28 10.24L512 125.44 988.16 332.8c12.8 5.12 28.16 0 33.28-12.8 5.12-12.8 0-28.16-12.8-33.28l-486.4-215.04H512zM512-79.36c-2.56 0-7.68 0-10.24 2.56l-486.4 215.04c-12.8 5.12-17.92 20.48-12.8 33.28 5.12 12.8 20.48 17.92 33.28 12.8L512-25.6l476.16 209.92c12.8 5.12 28.16 0 33.28-12.8 5.12-12.8 0-28.16-12.8-33.28l-486.4-215.04c-2.56-2.56-7.68-2.56-10.24-2.56z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Binary file not shown.

View File

@ -90,8 +90,8 @@ layui.define('jquery', function(exports){
that.elemItem.eq(options.index).addClass(THIS);
//指示器等动作
that.indicator();
if(that.elemItem.length <= 1) return;
that.indicator();
that.arrow();
that.autoplay();
that.events();

View File

@ -359,12 +359,13 @@ layui.define('jquery', function(exports){
$(ELEM + elemFilter).each(function(){
var othis = $(this)
,separator = othis.attr('lay-separator') || '>'
,ATTE_SPR = 'lay-separator'
,separator = othis.attr(ATTE_SPR) || '/'
,aNode = othis.find('a');
if(aNode.find('.layui-box')[0]) return;
if(aNode.next('span['+ ATTE_SPR +']')[0]) return;
aNode.each(function(index){
if(index === aNode.length - 1) return;
$(this).append('<span class="layui-box">'+ separator +'</span>');
$(this).after('<span '+ ATTE_SPR +'>'+ separator +'</span>');
});
othis.css('visibility', 'visible');
});

View File

@ -195,15 +195,14 @@ layui.define('layer', function(exports){
dl.find('.'+NONE).remove();
}
};
if(isSearch){
input.on('keyup', search).on('blur', function(e){
thatInput = input;
initValue = dl.find('.'+THIS).html();
initValue = dl.find('.' + THIS).html();
setTimeout(function(){
notOption(input.val(), function(none){
if(none && !initValue){
input.val('');
}
initValue || input.val(''); //none && !initValue
}, 'blur');
}, 200);
});
@ -410,23 +409,37 @@ layui.define('layer', function(exports){
//开始校验
layui.each(verifyElem, function(_, item){
var othis = $(this), ver = othis.attr('lay-verify').split('|');
var tips = '', value = othis.val();
var othis = $(this)
,vers = othis.attr('lay-verify').split('|')
,verType = othis.attr('lay-verType') //提示方式
,value = othis.val();
othis.removeClass(DANGER);
layui.each(ver, function(_, thisVer){
var isFn = typeof verify[thisVer] === 'function';
if(verify[thisVer] && (isFn ? tips = verify[thisVer](value, item) : !verify[thisVer][0].test(value)) ){
layer.msg(tips || verify[thisVer][1], {
icon: 5
,shift: 6
});
//非移动设备自动定位焦点
if(!device.android && !device.ios){
item.focus();
layui.each(vers, function(_, thisVer){
var isTrue //是否命中校验
,errorText = '' //错误提示文本
,isFn = typeof verify[thisVer] === 'function';
//匹配验证规则
if(verify[thisVer]){
var isTrue = isFn ? errorText = verify[thisVer](value, item) : !verify[thisVer][0].test(value);
errorText = errorText || verify[thisVer][1];
//如果是必填项或者非空命中校验,则阻止提交,弹出提示
if((isTrue && thisVer === 'required') || (isTrue && value)){
//提示层风格
if(verType === 'tips'){
layer.tips(errorText, othis, {tips: 1});
} else if(verType === 'alert') {
layer.alert(errorText, {title: '提示', shadeClose: true});
} else {
layer.msg(errorText, {icon: 5, shift: 6});
}
if(!device.android && !device.ios) item.focus(); //非移动设备自动定位焦点
othis.addClass(DANGER);
return stop = true;
}
}
});
if(stop) return stop;
});

View File

@ -1,6 +1,6 @@
/**
@Name : layDate 5.0.8 日期时间控件
@Name : layDate 5.0.85 日期时间控件
@Author: 贤心
@Sitehttp://www.layui.com/laydate/
@LicenseMIT
@ -55,7 +55,7 @@
}
,laydate = {
v: '5.0.8'
v: '5.0.85'
,config: {} //全局配置项
,index: (window.laydate && window.laydate.v) ? 100000 : 0
,path: ready.getPath

View File

@ -58,10 +58,12 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
//字符常量
,MOD_NAME = 'table', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled', NONE = 'layui-none'
,ELEM_VIEW = 'layui-table-view', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOOL = '.layui-table-tool', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover'
,ELEM_VIEW = 'layui-table-view', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOOL = '.layui-table-tool', ELEM_PAGE = '.layui-table-page', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover'
//thead区域模板
,TPL_HEADER = function(options){
var rowCols = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';
options = options || {};
return ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" '
,'{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
@ -80,26 +82,27 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
}
return '';
}()
,'{{# if(item2.checkbox){ }}'
,'<th data-field="{{ item2.field||i2 }}" data-type="checkbox" {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} unresize="true"><div class="layui-table-cell laytable-cell-checkbox"><input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" {{# if(item2[d.data.checkName]){ }}checked{{# }; }}></div></th>'
,'{{# } else if(item2.space){ }}'
,'<th data-field="{{ item2.field||i2 }}" {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} unresize="true"><div class="layui-table-cell laytable-cell-space"></div></th>'
,'{{# } else { }}'
,'<th data-field="{{ item2.field||i2 }}" {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} {{# if(item2.unresize){ }}unresize="true"{{# } }}>'
,'<th data-field="{{ item2.field||i2 }}" '+ rowCols +' {{# if(item2.unresize){ }}unresize="true"{{# } }}>'
,'<div class="layui-table-cell laytable-cell-'
,'{{# if(item2.colspan > 1){ }}'
,'<div class="layui-table-cell laytable-cell-group" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>'
,'<span>{{item2.title||""}}</span>'
,'</div>'
,'group'
,'{{# } else { }}'
,'{{d.index}}-{{item2.field || i2}}'
,'{{# if(item2.type !== "normal"){ }}'
,' laytable-cell-{{ item2.type }}'
,'{{# } }}'
,'{{# } }}'
,'" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>'
,'{{# if(item2.type === "checkbox"){ }}' //复选框
,'<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" {{# if(item2[d.data.checkName]){ }}checked{{# }; }}>'
,'{{# } else { }}'
,'<div class="layui-table-cell laytable-cell-{{d.index}}-{{item2.field||i2}}" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>'
,'<span>{{item2.title||""}}</span>'
,'{{# if(item2.sort){ }}'
,'{{# if(!(item2.colspan > 1) && item2.sort){ }}'
,'<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc"></i><i class="layui-edge layui-table-sort-desc"></i></span>'
,'{{# } }}'
,'</div>'
,'{{# } }}'
,'</div>'
,'</th>'
,'{{# }; }}'
,(options.fixed ? '{{# }; }}' : '')
,'{{# }); }}'
,'</tr>'
@ -116,6 +119,12 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
//主模板
,TPL_MAIN = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" lay-filter="LAY-table-{{d.index}}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">'
,'{{# if(d.data.toolbar){ }}'
,'<div class="layui-table-tool"></div>'
,'{{# } }}'
,'<div class="layui-table-box">'
,'{{# var left, right; }}'
,'<div class="layui-table-header">'
,TPL_HEADER()
@ -146,17 +155,22 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
,'</div>'
,'</div>'
,'{{# }; }}'
,'</div>'
,'{{# if(d.data.page){ }}'
,'<div class="layui-table-tool">'
,'<div class="layui-inline layui-table-page" id="layui-table-page{{d.index}}"></div>'
,'<div class="layui-table-page">'
,'<div id="layui-table-page{{d.index}}"></div>'
,'</div>'
,'{{# } }}'
,'<style>'
,'{{# layui.each(d.data.cols, function(i1, item1){'
,'layui.each(item1, function(i2, item2){ }}'
,'.laytable-cell-{{d.index}}-{{item2.field||i2}}{ width:{{item2.width||50}}px }'
,'.laytable-cell-{{d.index}}-{{item2.field||i2}}{ '
,'{{# if(item2.width){ }}'
,'width: {{item2.width}}px;'
,'{{# } }}'
,' }'
,'{{# });'
,'}); }}'
,'</style>'
@ -175,19 +189,18 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
//默认配置
Class.prototype.config = {
limit: 30 //每页显示的数量
limit: 10 //每页显示的数量
,loading: true //请求数据时是否显示loading
};
//表格渲染
Class.prototype.render = function(sets){
var that = this, options;
if(sets) that.config = sets;
Class.prototype.render = function(){
var that = this,
options = that.config;
options.elem = $(options.elem);
options.where = options.where || {};
options.id = options.id || options.elem.attr('id');
//请求参数的自定义格式
options.request = $.extend({
@ -204,18 +217,18 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
,countName: 'count'
}, options.response);
if(typeof options.page === 'object') delete options.page.jump;
if(!options.elem[0]) return that;
that.setArea(); //动态分配列宽高
//开始插入替代元素
var othis = options.elem
,hasRender = othis.next('.' + ELEM_VIEW);
,hasRender = othis.next('.' + ELEM_VIEW)
if(options.height && /^full-\d+$/.test(options.height)){ //full-差距值
that.fullHeightGap = options.height.split('-')[1];
options.height = _WIN.height() - that.fullHeightGap;
}
//替代元素
var reElem = that.elem = $(laytpl(TPL_MAIN).render({
//主容器
,reElem = that.elem = $(laytpl(TPL_MAIN).render({
VIEW_CLASS: ELEM_VIEW
,data: options
,index: that.index //索引
@ -235,11 +248,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
that.layFixLeft = reElem.find(ELEM_FIXL);
that.layFixRight = reElem.find(ELEM_FIXR);
that.layTool = reElem.find(ELEM_TOOL);
that.layPage = reElem.find(ELEM_PAGE);
//设置body区域高度
if(options.height){
that.fullSize();
}
that.layTool.html(
laytpl($(options.toolbar).html()||'').render(options)
);
if(options.height) that.fullSize(); //设置body区域高度
//如果多级表头,则填补表头高度
if(options.cols.length > 1){
@ -247,10 +262,110 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
th.height(that.layHeader.height() - 1 - parseFloat(th.css('padding-top')) - parseFloat(th.css('padding-bottom')));
}
//请求数据
that.pullData(1);
that.events();
};
//根据列类型,定制化参数
Class.prototype.initOpts = function(item){
var that = this,
options = that.config
,initWidth = {
checkbox: 48
,space: 15
,numbers: 40
};
//让 type 参数兼容旧版本
if(item.checkbox) item.type = "checkbox";
if(item.space) item.type = "space";
if(!item.type) item.type = "normal";
if(item.type !== "normal"){
item.unresize = true;
item.width = item.width || initWidth[item.type];
}
};
//动态分配列宽高
Class.prototype.setArea = function(){
var that = this,
options = that.config
,colNums = 0 //列个数
,autoColNums = 0 //自动列宽的列个数
,autoWidth = 0 //自动列分配的宽度
,countWidth = 0 //所有列总宽度和
,cntrWidth = options.width || function(){ //获取容器宽度
//如果父元素宽度为0一般为隐藏元素则继续查找上层元素直到找到真实宽度为止
var getWidth = function(parent){
var width, isNone;
parent = parent || options.elem.parent()
width = parent.width();
isNone = parent.css('display') === 'none';
if(parent[0] && (!width || isNone)) return getWidth(parent.parent());
return width;
};
return getWidth();
}();
//统计列个数
that.eachCols(function(){
colNums++;
});
//减去边框差
cntrWidth = cntrWidth - function(){
return (options.skin === 'line' || options.skin === 'nob') ? 2 : colNums + 1;
}();
//遍历所有列
layui.each(options.cols, function(i1, item1){
layui.each(item1, function(i2, item2){
var width;
if(!item2){
item1.splice(i2, 1);
return;
}
that.initOpts(item2);
width = item2.width || 0;
if(item2.colspan > 1) return;
if(/\d+%$/.test(width)){
item2.width = width = Math.floor((parseFloat(width) / 100) * cntrWidth);
} else if(!width){ //列宽未填写
item2.width = width = 0;
autoColNums++;
}
countWidth = countWidth + width;
});
});
//如果未填充满,则将剩余宽度平分。否则,给未设定宽度的列赋值一个默认宽
autoWidth = cntrWidth > countWidth
? (cntrWidth - countWidth) / autoColNums
: 200;
layui.each(options.cols, function(i1, item1){
layui.each(item1, function(i2, item2){
if(item2.colspan > 1) return;
if(item2.width === 0){
item2.width = Math.floor(autoWidth);
}
});
});
//高度铺满full-差距值
if(options.height && /^full-\d+$/.test(options.height)){
that.fullHeightGap = options.height.split('-')[1];
options.height = _WIN.height() - that.fullHeightGap;
}
};
//表格重载
Class.prototype.reload = function(options){
var that = this;
@ -360,45 +475,62 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
return that.sort(that.sortKey.field, that.sortKey.sort, true);
}
layui.each(data, function(i1, item1){
var tds = [], tds_fixed = [], tds_fixed_r = [];
var tds = [], tds_fixed = [], tds_fixed_r = []
,numbers = i1 + options.limit*(curr - 1) + 1; //序号
if(item1.length === 0) return;
if(!sort){
item1[table.config.indexName] = i1;
}
that.eachCols(function(i3, item3){
var content = item1[item3.field||i3];
var field = item3.field || i3, content = item1[field]
,cell = that.getColElem(that.layHeader, field);
if(content === undefined || content === null) content = '';
if(item3.colspan > 1) return;
var td = ['<td data-field="'+ (item3.field||i3) +'"'+ function(){
//td内容
var td = ['<td data-field="'+ field +'" '+ function(){
var attr = [];
if(item3.edit) attr.push(' data-edit="true"'); //是否允许单元格编辑
if(item3.align) attr.push(' align="'+ item3.align +'"'); //对齐方式
if(item3.templet) attr.push(' data-content="'+ content +'"'); //自定义模板
if(item3.toolbar) attr.push(' data-off="true"'); //自定义模板
if(item3.event) attr.push(' lay-event="'+ item3.event +'"'); //自定义事件
if(item3.style) attr.push(' style="'+ item3.style +'"'); //自定义样式
return attr.join('');
if(item3.edit) attr.push('data-edit="'+ item3.edit +'"'); //是否允许单元格编辑
if(item3.align) attr.push('align="'+ item3.align +'"'); //对齐方式
if(item3.templet) attr.push('data-content="'+ content +'"'); //自定义模板
if(item3.toolbar) attr.push('data-off="true"'); //自定义模板
if(item3.event) attr.push('lay-event="'+ item3.event +'"'); //自定义事件
if(item3.style) attr.push('style="'+ item3.style +'"'); //自定义样式
if(cell.data('autowidth')) attr.push('data-autowidth="true"'); //自适应宽度
return attr.join(' ');
}() +'>'
,'<div class="layui-table-cell laytable-cell-'+ function(){
if(item3.checkbox) return 'checkbox';
if(item3.space) return 'space'; //间距
return options.index + '-' + (item3.field||i3);
,'<div class="layui-table-cell laytable-cell-'+ function(){ //返回对应的CSS类标识
var str = (options.index + '-' + field);
return item3.type === 'normal' ? str
: (str + ' laytable-cell-' + item3.type);
}() +'">' + function(){
if(item3.checkbox){
var tplData = $.extend(true, {
LAY_INDEX: numbers
}, item1);
//渲染复选框列视图
if(item3.type === 'checkbox'){
return '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" '+ function(){
var checkName = table.config.checkName;
if(item3[checkName]){
item1[checkName] = item3[checkName];
tplData[checkName] = item3[checkName];
return item3[checkName] ? 'checked' : '';
}
return item1[checkName] ? 'checked' : '';
return tplData[checkName] ? 'checked' : '';
}() +'>';
} else if(item3.type === 'numbers'){ //渲染序号
return numbers;
}
//解析工具列模板
if(item3.toolbar){
return laytpl($(item3.toolbar).html()||'').render(item1);
return laytpl($(item3.toolbar).html()||'').render(tplData);
}
return item3.templet ? laytpl($(item3.templet).html() || String(content)).render(item1) : content;
return item3.templet ? laytpl($(item3.templet).html() || String(content)).render(tplData) : content;
}()
,'</div></td>'].join('');
@ -409,6 +541,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
trs.push('<tr data-index="'+ i1 +'">'+ tds.join('') + '</tr>');
trs_fixed.push('<tr data-index="'+ i1 +'">'+ tds_fixed.join('') + '</tr>');
trs_fixed_r.push('<tr data-index="'+ i1 +'">'+ tds_fixed_r.join('') + '</tr>');
});
that.layBody.scrollTop(0);
@ -448,7 +582,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
if(options.page){
that.page = curr;
that.count = count;
laypage.render({
laypage.render($.extend({
elem: 'layui-table-page' + options.index
,count: count
,groups: 3
@ -465,14 +599,20 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
that.pullData(obj.curr, that.loading());
}
}
});
that.layTool.find('.layui-table-count span').html(count)
}, options.page));
}
};
//找到对应的列元素
Class.prototype.getColElem = function(parent, field){
var that = this
,options = that.config;
return parent.eq(0).find('.laytable-cell-'+ (options.index + '-' + field) + ':eq(0)');
};
//渲染表单
Class.prototype.renderForm = function(type){
form.render((type || 'checkbox'), 'LAY-table-'+ this.index);
form.render(type, 'LAY-table-'+ this.index);
}
//数据排序
@ -587,13 +727,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
if(table.checkStatus(that.key).isAll){
if(!checkAllElem[0].checked){
checkAllElem.prop('checked', true);
that.renderForm();
that.renderForm('checkbox');
}
syncColsCheck(true);
} else {
if(checkAllElem[0].checked){
checkAllElem.prop('checked', false);
that.renderForm();
that.renderForm('checkbox');
}
syncColsCheck(false);
}
@ -612,7 +752,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
});
};
//尺寸始终铺满
//铺满表格主体高度
Class.prototype.fullSize = function(){
var that = this
,options = that.config
@ -626,11 +766,31 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
//tbody区域高度
bodyHeight = parseFloat(height) - parseFloat(that.layHeader.height()) - 1;
if(options.toolbar){
bodyHeight = bodyHeight - that.layTool.outerHeight();
}
if(options.page){
bodyHeight = bodyHeight - parseFloat(that.layTool.outerHeight() + 1);
bodyHeight = bodyHeight - that.layPage.outerHeight() - 1;
}
that.layMain.css('height', bodyHeight);
};
//获取滚动条宽度
Class.prototype.getScrollWidth = function(elem){
var width = 0;
if(elem){
width = elem.offsetWidth - elem.clientWidth;
} else {
elem = document.createElement('div');
elem.style.width = '100px';
elem.style.height = '100px';
elem.style.overflowY = 'scroll';
document.body.appendChild(elem);
width = elem.offsetWidth - elem.clientWidth;
document.body.removeChild(elem);
}
return width;
};
//滚动条补丁
@ -638,7 +798,18 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
var that = this
,layMainTable = that.layMain.children('table')
,scollWidth = that.layMain.width() - that.layMain.prop('clientWidth') //纵向滚动条宽度
,scollHeight = that.layMain.height() - that.layMain.prop('clientHeight'); //横向滚动条高度
,scollHeight = that.layMain.height() - that.layMain.prop('clientHeight') //横向滚动条高度
,getScrollWidth = that.getScrollWidth(that.layMain[0]); //获取主容器滚动条宽度,如果有的话
if(getScrollWidth && !that.scrollPatchWStatus){
var th = that.layHeader.eq(0).find('thead th:last-child')
,field = th.data('field');
that.getCssRule(field, function(item){
var width = item.style.width || th.outerWidth();
item.style.width = (parseFloat(width) - getScrollWidth) + 'px';
that.scrollPatchWStatus = true;
});
}
if(scollWidth && scollHeight){
if(!that.elem.find('.layui-table-patch')[0]){
@ -690,6 +861,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
if(dict.resizeStart) return;
_BODY.css('cursor', '');
}).on('mousedown', function(e){
var othis = $(this);
if(dict.allowResize){
var field = $(this).data('field');
e.preventDefault();
@ -697,8 +869,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
dict.offset = [e.clientX, e.clientY]; //记录初始坐标
that.getCssRule(field, function(item){
var width = item.style.width || othis.outerWidth();
dict.rule = item;
dict.ruleWidth = parseFloat(item.style.width);
dict.ruleWidth = parseFloat(width);
});
}
});
@ -768,7 +941,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
that.setCheckData(i, checked);
});
that.syncCheckAll();
that.renderForm();
that.renderForm('checkbox');
} else {
that.setCheckData(index, checked);
that.syncCheckAll();
@ -828,19 +1001,28 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
that.layBody.on('click', 'td', function(){
var othis = $(this)
,field = othis.data('field')
,editType = othis.data('edit')
,elemCell = othis.children(ELEM_CELL);
layer.close(that.tipsIndex);
if(othis.data('off')) return;
//显示编辑框
if(othis.data('edit')){
var input = $('<input class="'+ ELEM_EDIT +'">');
//显示编辑表单
if(editType){
if(editType === 'select') { //选择框
//var select = $('<select class="'+ ELEM_EDIT +'" lay-ignore><option></option></select>');
//othis.find('.'+ELEM_EDIT)[0] || othis.append(select);
} else { //输入框
var input = $('<input class="layui-input '+ ELEM_EDIT +'">');
input[0].value = othis.data('content') || elemCell.text();
othis.find('.'+ELEM_EDIT)[0] || othis.append(input);
return input.focus();
input.focus();
}
return;
}
//如果出现省略,则可查看更多
if(elemCell.children().length > 0) return;
if(Math.round(elemCell.prop('scrollWidth')) > Math.round(elemCell.outerWidth())){
that.tipsIndex = layer.tips([
'<div class="layui-table-tips-main" style="margin-top: -'+ (elemCell.height() + 16) +'px;'+ function(){

View File

@ -95,21 +95,22 @@ layui.define('jquery', function(exports){
//某个时间在当前时间的多久前
,timeAgo: function(time, onlyDate){
var arr = [[], []]
var that = this
,arr = [[], []]
,stamp = new Date().getTime() - new Date(time).getTime();
//返回具体日期
if(stamp > 1000*60*60*24*8){
stamp = new Date(time);
arr[0][0] = stamp.getFullYear();
arr[0][1] = stamp.getMonth() + 1;
arr[0][2] = stamp.getDate();
arr[0][0] = that.digit(stamp.getFullYear(), 4);
arr[0][1] = that.digit(stamp.getMonth() + 1);
arr[0][2] = that.digit(stamp.getDate());
//是否输出时间
if(!onlyDate){
arr[1][0] = stamp.getHours();
arr[1][1] = stamp.getMinutes();
arr[1][2] = stamp.getSeconds();
arr[1][0] = that.digit(stamp.getHours());
arr[1][1] = that.digit(stamp.getMinutes());
arr[1][2] = that.digit(stamp.getSeconds());
}
return arr[0].join('-') + ' ' + arr[1].join(':');
}
@ -127,6 +128,17 @@ layui.define('jquery', function(exports){
return '刚刚';
}
}
//数字前置补零
,digit: function(num, length, end){
var str = '';
num = String(num);
length = length || 2;
for(var i = num.length; i < length; i++){
str += '0';
}
return num < Math.pow(10, length) ? str + (num|0) : num;
}
};
exports('util', util);

View File

@ -19,7 +19,7 @@
}
,Layui = function(){
this.v = '2.1.7'; //版本号
this.v = '2.2.0'; //版本号
}
//获取layui所在目录
@ -146,10 +146,17 @@
//首次加载模块
if(!config.modules[item]){
var node = doc.createElement('script')
,url = (
modules[item] ? (dir + 'lay/') : (config.base || '')
//如果是内置模块,则按照 dir 参数拼接模块路径
//如果是扩展模块,则判断模块路径值是否为 {!} 开头,
// 如果路径值是 {/} 开头,则模块路径即为后面紧跟的字符。
// 否则,则按照 base 参数拼接模块路径
,url = ( modules[item] ? (dir + 'lay/')
: (/^\{\/\}/.test(that.modules[item]) ? '' : (config.base || ''))
) + (that.modules[item] || item) + '.js';
url = url.replace(/^\{\/\}/, '');
node.async = true;
node.charset = 'utf-8';
node.src = url + function(){
@ -329,7 +336,7 @@
var data = {};
}
if(settings.value) data[settings.key] = settings.value;
if('value' in settings) data[settings.key] = settings.value;
if(settings.remove) delete data[settings.key];
localStorage[table] = JSON.stringify(data);