发布新版
This commit is contained in:
parent
1ff124de94
commit
27e2295cbc
41
CHANGELOG.md
41
CHANGELOG.md
@ -1,22 +1,23 @@
|
||||
|
||||
# 更新日志
|
||||
* [2.4.x](http://www.layui.com/doc/base/changelog.html#2-4-x)
|
||||
* [2.3.0](http://www.layui.com/doc/base/changelog.html#2-3-0)
|
||||
* [2.2.6](http://www.layui.com/doc/base/changelog.html#2-2-6)
|
||||
* [2.2.5](http://www.layui.com/doc/base/changelog.html#2-2-5)
|
||||
* [2.2.4](http://www.layui.com/doc/base/changelog.html#2-2-45)
|
||||
* [2.2.3](http://www.layui.com/doc/base/changelog.html#2-2-3)
|
||||
* [2.2.2](http://www.layui.com/doc/base/changelog.html#2-2-2)
|
||||
* [2.2.1](http://www.layui.com/doc/base/changelog.html#2-2-1)
|
||||
* [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)
|
||||
* [2.1.3](http://www.layui.com/doc/base/changelog.html#2-1-3)
|
||||
* [2.1.2](http://www.layui.com/doc/base/changelog.html#2-1-2)
|
||||
* [2.1.1](http://www.layui.com/doc/base/changelog.html#2-1-1)
|
||||
* [2.1.0](http://www.layui.com/doc/base/changelog.html#2-1-0)
|
||||
* [2.0.2](http://www.layui.com/doc/base/changelog.html#2-0-2)
|
||||
* [2.0.1](http://www.layui.com/doc/base/changelog.html#2-0-1)
|
||||
* [2.0.0](http://www.layui.com/doc/base/changelog.html#2-0-0)
|
||||
* [2.5.x](https://www.layui.com/doc/base/changelog.html#2-5-x)
|
||||
* [2.4.x](https://www.layui.com/doc/base/changelog.html#2-4-x)
|
||||
* [2.3.0](https://www.layui.com/doc/base/changelog.html#2-3-0)
|
||||
* [2.2.6](https://www.layui.com/doc/base/changelog.html#2-2-6)
|
||||
* [2.2.5](https://www.layui.com/doc/base/changelog.html#2-2-5)
|
||||
* [2.2.4](https://www.layui.com/doc/base/changelog.html#2-2-45)
|
||||
* [2.2.3](https://www.layui.com/doc/base/changelog.html#2-2-3)
|
||||
* [2.2.2](https://www.layui.com/doc/base/changelog.html#2-2-2)
|
||||
* [2.2.1](https://www.layui.com/doc/base/changelog.html#2-2-1)
|
||||
* [2.2.0](https://www.layui.com/doc/base/changelog.html#2-2-0)
|
||||
* [2.1.7](https://www.layui.com/doc/base/changelog.html#2-1-7)
|
||||
* [2.1.6](https://www.layui.com/doc/base/changelog.html#2-1-6)
|
||||
* [2.1.5](https://www.layui.com/doc/base/changelog.html#2-1-5)
|
||||
* [2.1.4](https://www.layui.com/doc/base/changelog.html#2-1-4)
|
||||
* [2.1.3](https://www.layui.com/doc/base/changelog.html#2-1-3)
|
||||
* [2.1.2](https://www.layui.com/doc/base/changelog.html#2-1-2)
|
||||
* [2.1.1](https://www.layui.com/doc/base/changelog.html#2-1-1)
|
||||
* [2.1.0](https://www.layui.com/doc/base/changelog.html#2-1-0)
|
||||
* [2.0.2](https://www.layui.com/doc/base/changelog.html#2-0-2)
|
||||
* [2.0.1](https://www.layui.com/doc/base/changelog.html#2-0-1)
|
||||
* [2.0.0](https://www.layui.com/doc/base/changelog.html#2-0-0)
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "layui",
|
||||
"main": "src/layui.js",
|
||||
"version": "2.4.5",
|
||||
"version": "2.5.0",
|
||||
"homepage": "https://github.com/sentsin/layui",
|
||||
"authors": [
|
||||
"sentsin <xu@sentsin.com>"
|
||||
|
4
dist/css/layui.css
vendored
4
dist/css/layui.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/layui.mobile.css
vendored
2
dist/css/layui.mobile.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/modules/code.css
vendored
2
dist/css/modules/code.css
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
2
dist/css/modules/laydate/default/laydate.css
vendored
2
dist/css/modules/laydate/default/laydate.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/modules/layer/default/layer.css
vendored
2
dist/css/modules/layer/default/layer.css
vendored
File diff suppressed because one or more lines are too long
BIN
dist/font/iconfont.eot
vendored
BIN
dist/font/iconfont.eot
vendored
Binary file not shown.
9
dist/font/iconfont.svg
vendored
9
dist/font/iconfont.svg
vendored
@ -344,6 +344,9 @@ Created by iconfont
|
||||
<glyph glyph-name="rmb" unicode="" d="M511.998465 896C229.23338 896 0.004605 666.769178 0.004605 384.001023c0-282.773272 229.227752-512.001023 511.99386-512.001023 282.769178 0 511.994883 229.227752 511.994883 512.001023C1023.994372 666.769178 794.767644 896 511.998465 896zM511.998465-91.59690499999999c-262.660188 0-475.589742 212.930577-475.589742 475.597929 0 262.663258 212.929554 475.594859 475.589742 475.594859 262.663258 0 475.590765-212.9316 475.590765-475.594859C987.590254 121.33469500000001 774.662747-91.59690499999999 511.998465-91.59690499999999zM738.742652 301.137781L544.432155 301.137781l0 69.780273 194.310497 0c17.835204 0 32.249495 14.43885 32.249495 32.220842 0 17.784038-14.414291 32.19526-32.249495 32.19526L589.7462 435.334155l149.620669 209.579249c8.916067 15.397688 3.63069 35.099403-11.82021 43.988864-15.398712 8.891508-35.097356 3.629667-44.017516-11.793604L512.187777 437.098335 340.84334 677.108664c-8.864902 15.423271-28.617781 20.685111-44.016493 11.793604-15.395642-8.889461-20.685111-28.590152-11.82021-43.988864l149.622716-209.579249L285.628808 435.334155c-17.781992 0-32.245402-14.411221-32.245402-32.19526 0-17.781992 14.46341-32.220842 32.245402-32.220842l194.310497 0 0-69.780273L285.628808 301.137781c-17.781992 0-32.245402-14.413268-32.245402-32.19526s14.46341-32.220842 32.245402-32.220842l194.310497 0 0-132.435265c0-17.780969 14.46341-32.19526 32.248472-32.19526 17.835204 0 32.245402 14.414291 32.245402 32.19526L544.433178 236.72065499999997l194.310497 0c17.835204 0 32.249495 14.43885 32.249495 32.220842S756.577856 301.137781 738.742652 301.137781" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="addition" unicode="" d="M544 768L480 768 480 416 128 416 128 352 480 352 480 0 544 0 544 352 895.936 352 895.936 416 544 416Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="home" unicode="" d="M824.084343-40.42033900000001H232.898863c-74.604138 0-85.85232 28.334325-85.852321 49.997718l-0.584307 5.314029V447.645552h48.806589v-402.916582c0-25.547863 13.548574-36.343743 37.629015-36.343743h568.020898c25.928532 0 27.978215 6.220678 27.978215 37.84391V447.585177l48.806589 0.118704c0.022513-14.346753 0-382.76666 0-433.098999 0-38.130436-12.726859-54.765301-51.858088-54.765301l-1.76111-0.25992zM1012.470921 493.103884C849.773422 615.120868 687.101505 737.137853 524.404006 859.153814c-6.207375 4.659113-18.433838 4.659113-24.641213 0C337.077573 737.137853 174.393377 615.120868 11.696902 493.103884c-24.856108-18.635429-0.572028-61.044308 24.642236-42.13361A15995638.709915 15995638.709915 0 0 1 512.025071 807.737794c0.988514-0.715291 1.644453-1.144056 2.823302-2.037403 18.040888-13.524015 36.057217-27.036773 54.073546-40.560788 58.291614-43.718711 116.583229-87.437421 174.874843-131.143852 81.33647-61.008492 162.696476-122.015961 244.033969-183.024454 25.212218-18.911722 49.496298 23.497157 24.64019 42.132587z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
@ -452,6 +455,9 @@ Created by iconfont
|
||||
<glyph glyph-name="vercode" unicode="" d="M513.807059-128C351.171765-128 58.428235 126.19294100000002 54.211765 376.16941199999997V662.287059a93.364706 93.364706 0 0 0 81.317647 88.545882 570.428235 570.428235 0 0 1 163.237647 40.357647A393.336471 393.336471 0 0 1 446.945882 872.508235a101.797647 101.797647 0 0 0 120.470589 5.421177A629.458824 629.458824 0 0 1 716.8 792.395294a1255.303529 1255.303529 0 0 1 169.863529-38.550588 98.785882 98.785882 0 0 0 79.510589-90.955294 2911.171765 2911.171765 0 0 0-3.011765-291.538824C924.611765 49.09176500000001 672.828235-128 513.807059-128z m0 963.764706a39.152941 39.152941 0 0 1-24.696471-7.830588A438.512941 438.512941 0 0 0 319.247059 734.569412a608.376471 608.376471 0 0 0-180.705883-43.369412 33.731765 33.731765 0 0 1-24.094117-30.117647v-283.708235C118.663529 155.10588199999995 389.722353-67.76470600000005 513.807059-67.76470600000005s354.183529 148.178824 391.529412 444.536471c9.035294 175.887059 0 281.901176 0 283.105882a38.550588 38.550588 0 0 1-29.515295 33.731765 1287.830588 1287.830588 0 0 0-180.705882 41.562353A676.442353 676.442353 0 0 0 536.094118 829.741176a37.345882 37.345882 0 0 1-24.094118 6.02353zM784.865882 479.171765L487.905882 198.47529399999996a40.357647 40.357647 0 0 0-49.392941-4.818823l-7.830588 6.625882-161.430588 171.068235a40.357647 40.357647 0 1 0 60.235294 55.416471l133.722353-141.552941 267.444706 252.988235a40.357647 40.357647 0 1 0 55.41647-60.235294" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="service" unicode="" d="M895.44035 502.006246A31.340412 31.340412 0 0 1 895.44035 512.2398499999999 383.76015 383.76015 0 0 1 127.92005 512.2398499999999a31.340412 31.340412 0 0 1 0-10.233604 167.575265 167.575265 0 0 1-127.92005-159.900062V320.359775a168.854466 168.854466 0 0 1 140.712055-163.098064A351.140537 351.140537 0 0 1 401.029357-63.400375000000054h5.756402a95.940037 95.940037 0 1 1 0 63.960025 287.180512 287.180512 0 0 0-195.717677 156.062461h35.817614A40.294816 40.294816 0 0 1 287.820112 192.43972499999995V468.747033a40.294816 40.294816 0 0 1-40.934416 39.015615H191.880075A30.061212 30.061212 0 0 1 191.880075 512.2398499999999a319.800125 319.800125 0 0 0 639.60025 0 30.061212 30.061212 0 0 1 0-3.837601h-55.005622a40.294816 40.294816 0 0 1-40.934416-39.015616V192.43972499999995a40.294816 40.294816 0 0 1 40.934416-39.015615h72.274829A170.773267 170.773267 0 0 1 1023.3604 320.359775v21.746409a167.575265 167.575265 0 0 1-127.92005 159.900062zM496.329794 0.5596500000000333a31.980012 31.980012 0 1 0-31.980013-31.980012 31.980012 31.980012 0 0 0 31.980013 31.980012zM223.860087 220.582136h-49.249219A106.813242 106.813242 0 0 0 63.960025 320.359775v21.746409a106.813242 106.813242 0 0 0 110.650843 102.33604h49.249219zM959.400375 320.359775a106.813242 106.813242 0 0 0-110.650843-102.33604h-49.24922V444.442224h49.24922A106.813242 106.813242 0 0 0 959.400375 342.106184zM650.473454 750.171143l-23.665209 8.314803a31.980012 31.980012 0 0 1-19.827608-63.960025l18.548407-7.035602a31.980012 31.980012 0 1 1 24.94441 58.843223zM305.089319 674.698314A31.980012 31.980012 0 0 1 358.17614 640.1599 202.113679 202.113679 0 0 0 511.6802 716.91193a31.980012 31.980012 0 0 1 0 63.960025 263.515303 263.515303 0 0 1-206.590881-106.173641z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="cellphone" unicode="" d="M785.066667 896H238.933333a102.4 102.4 0 0 1-102.4-102.4v-819.2a102.4 102.4 0 0 1 102.4-102.4h546.133334a102.4 102.4 0 0 1 102.4 102.4V793.6a102.4 102.4 0 0 1-102.4 102.4zM238.933333 827.733333h546.133334a34.133333 34.133333 0 0 0 34.133333-34.133333v-648.533333H204.8V793.6a34.133333 34.133333 0 0 0 34.133333 34.133333z m546.133334-887.466666H238.933333a34.133333 34.133333 0 0 0-34.133333 34.133333v102.4h614.4v-102.4a34.133333 34.133333 0 0 0-34.133333-34.133333zM512 8.53333299999997m-34.133333 0a34.133333 34.133333 0 1 1 68.266666 0 34.133333 34.133333 0 1 1-68.266666 0ZM426.666667 725.333333h170.666666a17.066667 17.066667 0 0 1 0 34.133334h-170.666666a17.066667 17.066667 0 0 1 0-34.133334z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
@ -467,6 +473,9 @@ Created by iconfont
|
||||
<glyph glyph-name="slider" unicode="" d="M228.7 683.9v-66.7H112v66.7h116.7z m333.2-266.6v-66.7H112v66.7h449.9zM295.4 150.60000000000002V84H112v66.7h183.4v-0.1z m116.6 600c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H278.8c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.3-9.9 23.5V717.1c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.3 9.9 23.5 9.9h133.3v0.1h-0.1z m66.7-533.3c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H345.3c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.5-9.9 23.5V183.89999999999998c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.3 9.9 23.5 9.9h133.4v0.1zM912 683.9v-66.7H462.1v66.7H912z m0-533.3V84H528.6v66.7h383.3v-0.1h0.1zM745.2 483.9c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H612c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.3-9.9 23.5V450.6c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.5 9.9 23.5 9.9l133.2-0.1zM912 417.3v-66.7H795.3v66.7H912z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="subtraction" unicode="" d="M785 348H239c-19.8 0-36 16.2-36 36s16.2 36 36 36h546c19.8 0 36-16.2 36-36s-16.2-36-36-36z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
|
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 276 KiB |
BIN
dist/font/iconfont.ttf
vendored
BIN
dist/font/iconfont.ttf
vendored
Binary file not shown.
BIN
dist/font/iconfont.woff
vendored
BIN
dist/font/iconfont.woff
vendored
Binary file not shown.
BIN
dist/font/iconfont.woff2
vendored
Normal file
BIN
dist/font/iconfont.woff2
vendored
Normal file
Binary file not shown.
4
dist/lay/modules/carousel.js
vendored
4
dist/lay/modules/carousel.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
|
2
dist/lay/modules/code.js
vendored
2
dist/lay/modules/code.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
|
2
dist/lay/modules/colorpicker.js
vendored
2
dist/lay/modules/colorpicker.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/element.js
vendored
2
dist/lay/modules/element.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/flow.js
vendored
2
dist/lay/modules/flow.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});
|
4
dist/lay/modules/form.js
vendored
4
dist/lay/modules/form.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/jquery.js
vendored
2
dist/lay/modules/jquery.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/laydate.js
vendored
2
dist/lay/modules/laydate.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/layedit.js
vendored
2
dist/lay/modules/layedit.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/layer.js
vendored
2
dist/lay/modules/layer.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/laypage.js
vendored
2
dist/lay/modules/laypage.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">…</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">…</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),refresh:['<a href="javascript:;" data-page="'+a.curr+'" class="layui-laypage-refresh">','<i class="layui-icon layui-icon-refresh"></i>',"</a>"].join(""),skip:function(){return['<span class="layui-laypage-skip">到第','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','页<button type="button" class="layui-laypage-btn">确定</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
|
2
dist/lay/modules/laytpl.js
vendored
2
dist/lay/modules/laytpl.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});
|
4
dist/lay/modules/mobile.js
vendored
4
dist/lay/modules/mobile.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/rate.js
vendored
2
dist/lay/modules/rate.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='<ul class="layui-rate" '+(i.readonly?"readonly":"")+">",u=1;u<=i.length;u++){var r='<li class="layui-inline"><i class="layui-icon '+(u>Math.floor(i.value)?o:s)+'" '+l+"></i></li>";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'<li><i class="layui-icon layui-icon-rate-half" '+l+"></i></li>":n+=r}n+="</ul>"+(i.text?'<span class="layui-inline">'+i.value+"星":"")+"</span>";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});
|
2
dist/lay/modules/slider.js
vendored
2
dist/lay/modules/slider.js
vendored
File diff suppressed because one or more lines are too long
4
dist/lay/modules/table.js
vendored
4
dist/lay/modules/table.js
vendored
File diff suppressed because one or more lines are too long
2
dist/lay/modules/transfer.js
vendored
Normal file
2
dist/lay/modules/transfer.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
dist/lay/modules/tree.js
vendored
4
dist/lay/modules/tree.js
vendored
File diff suppressed because one or more lines are too long
4
dist/lay/modules/upload.js
vendored
4
dist/lay/modules/upload.js
vendored
File diff suppressed because one or more lines are too long
4
dist/lay/modules/util.js
vendored
4
dist/lay/modules/util.js
vendored
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,a,n="layui-fixbar",r="layui-fixbar-top",o=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['<ul class="'+n+'">',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 '+r+'" lay-type="top" style="'+t.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+r),u=function(){var e=o.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+n)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),a=i.attr("lay-type");"top"===a&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,a)}),o.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var a=this,n="function"==typeof e,r=new Date(t).getTime(),o=new Date(!e||n?(new Date).getTime():e).getTime(),l=r-o,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];n&&(i=e);var g=setTimeout(function(){a.countdown(t,o+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,a=[[],[]],n=(new Date).getTime()-new Date(t).getTime();return n>6912e5?(n=new Date(t),a[0][0]=i.digit(n.getFullYear(),4),a[0][1]=i.digit(n.getMonth()+1),a[0][2]=i.digit(n.getDate()),e||(a[1][0]=i.digit(n.getHours()),a[1][1]=i.digit(n.getMinutes()),a[1][2]=i.digit(n.getSeconds())),a[0].join("-")+" "+a[1].join(":")):n>=864e5?(n/1e3/60/60/24|0)+"天前":n>=36e5?(n/1e3/60/60|0)+"小时前":n>=12e4?(n/1e3/60|0)+"分钟前":n<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var a=t.length;a<e;a++)i+="0";return t<Math.pow(10,e)?i+(0|t):t},toDateString:function(t,e){var i=this,a=new Date(t||new Date),n=[i.digit(a.getFullYear(),4),i.digit(a.getMonth()+1),i.digit(a.getDate())],r=[i.digit(a.getHours()),i.digit(a.getMinutes()),i.digit(a.getSeconds())];return e=e||"yyyy-MM-dd HH:mm:ss",e.replace(/yyyy/g,n[0]).replace(/MM/g,n[1]).replace(/dd/g,n[2]).replace(/HH/g,r[0]).replace(/mm/g,r[1]).replace(/ss/g,r[2])},escape:function(t){return String(t||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}};!function(t,e,i){"$:nomunge";function a(){n=e[l](function(){r.each(function(){var e=t(this),i=e.width(),a=e.height(),n=t.data(this,g);(i!==n.w||a!==n.h)&&e.trigger(c,[n.w=i,n.h=a])}),a()},o[s])}var n,r=t([]),o=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";o[s]=250,o[u]=!0,t.event.special[c]={setup:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===r.length&&a()},teardown:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.not(e),e.removeData(g),r.length||clearTimeout(n)},add:function(e){function a(e,a,r){var o=t(this),l=t.data(this,g)||{};l.w=a!==i?a:o.width(),l.h=r!==i?r:o.height(),n.apply(this,arguments)}if(!o[u]&&this[l])return!1;var n;return t.isFunction(e)?(n=e,a):(n=e.handler,void(e.handler=a))}}}(e,window),t("util",i)});
|
||||
/** layui-v2.5.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['<ul class="'+a+'">',t.bar1?'<li class="layui-icon" lay-type="bar1" style="'+t.bgcolor+'">'+c[0]+"</li>":"",t.bar2?'<li class="layui-icon" lay-type="bar2" style="'+t.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+o+'" lay-type="top" style="'+t.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+o),u=function(){var e=r.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+a)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),n=i.attr("lay-type");"top"===n&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var n=this,a="function"==typeof e,o=new Date(t).getTime(),r=new Date(!e||a?(new Date).getTime():e).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=e);var g=setTimeout(function(){n.countdown(t,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(t).getTime();return a>6912e5?(a=new Date(t),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),e||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var n=t.length;n<e;n++)i+="0";return t<Math.pow(10,e)?i+(0|t):t},toDateString:function(t,e){var i=this,n=new Date(t||new Date),a=[i.digit(n.getFullYear(),4),i.digit(n.getMonth()+1),i.digit(n.getDate())],o=[i.digit(n.getHours()),i.digit(n.getMinutes()),i.digit(n.getSeconds())];return e=e||"yyyy-MM-dd HH:mm:ss",e.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,o[0]).replace(/mm/g,o[1]).replace(/ss/g,o[2])},escape:function(t){return String(t||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(t,n,a){n=i.event[t]=e.extend(!0,i.event[t],n)||{},e("body").on(a||"click","*["+t+"]",function(){var i=e(this),a=i.attr(t);n[a]&&n[a].call(this,i)})}};!function(t,e,i){"$:nomunge";function n(){a=e[l](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,g);(i!==a.w||n!==a.h)&&e.trigger(c,[a.w=i,a.h=n])}),n()},r[s])}var a,o=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";r[s]=250,r[u]=!0,t.event.special[c]={setup:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.not(e),e.removeData(g),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var r=t(this),l=t.data(this,g)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[u]&&this[l])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(e,window),t("util",i)});
|
6
dist/layui.all.js
vendored
6
dist/layui.all.js
vendored
File diff suppressed because one or more lines are too long
4
dist/layui.js
vendored
4
dist/layui.js
vendored
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>合并版使用 - layui</title>
|
||||
<title>完整库使用 - layui</title>
|
||||
|
||||
<link rel="stylesheet" href="../build/css/layui.css">
|
||||
|
||||
@ -35,6 +35,14 @@ body{padding: 10px;}
|
||||
});
|
||||
|
||||
|
||||
//测试加载非内置模块
|
||||
layui.config({
|
||||
base: 'extends/'
|
||||
}).extend({
|
||||
mod1: 'mod1'
|
||||
,mod2: 'mod2'
|
||||
}).use('mod1');
|
||||
|
||||
//触发事件
|
||||
var active = {
|
||||
test: function(){
|
||||
|
@ -75,6 +75,7 @@ layui.use('carousel', function(){
|
||||
,index: 2
|
||||
//,full: true
|
||||
,arrow: 'always'
|
||||
//,interval: 5000
|
||||
//,autoplay: false
|
||||
//,indicator: 'outside'
|
||||
//,trigger: 'hover'
|
||||
|
10
examples/extends/mod1.js
Normal file
10
examples/extends/mod1.js
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
layui.define(['mod2', 'layer'], function(exports){
|
||||
var $ = layui.jquery;
|
||||
|
||||
console.log(layui.mod2, layui.layer, layui.form)
|
||||
|
||||
exports('mod1', {
|
||||
name: 'mod1'
|
||||
})
|
||||
});
|
8
examples/extends/mod2.js
Normal file
8
examples/extends/mod2.js
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
layui.define(['jquery', 'form'], function(exports){
|
||||
console.log(layui.$)
|
||||
|
||||
exports('mod2', {
|
||||
name: 'mod2'
|
||||
})
|
||||
});
|
@ -22,7 +22,7 @@ body{padding: 10px;}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">输入框</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" lay-verify="required|title" required placeholder="请输入标题" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="title" lay-verify="required|title" lay-reqText="标题不能为空" required placeholder="请输入标题" autocomplete="off" class="layui-input" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@ -37,6 +37,12 @@ body{padding: 10px;}
|
||||
<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-block">
|
||||
<input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">密码</label>
|
||||
<div class="layui-input-inline">
|
||||
@ -187,9 +193,12 @@ body{padding: 10px;}
|
||||
|
||||
<script>
|
||||
|
||||
layui.use('form', function(){
|
||||
var form = layui.form;
|
||||
|
||||
layui.use(['form', 'layedit', 'laydate'], function(){
|
||||
var form = layui.form
|
||||
,layer = layui.layer
|
||||
,layedit = layui.layedit
|
||||
,laydate = layui.laydate;
|
||||
|
||||
//自定义验证规则
|
||||
form.verify({
|
||||
title: function(value){
|
||||
@ -204,6 +213,11 @@ layui.use('form', function(){
|
||||
]
|
||||
});
|
||||
|
||||
//日期
|
||||
laydate.render({
|
||||
elem: '#date'
|
||||
});
|
||||
|
||||
//初始赋值
|
||||
form.val('first', {
|
||||
'title': '测试'
|
||||
|
@ -20,6 +20,7 @@ body{padding: 20px; /*overflow-y: scroll;*/}
|
||||
<button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="getCheckLength">获取选中数目</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="isAll">验证是否全选</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="reload">无抖重载</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@ -31,13 +32,21 @@ body{padding: 20px; /*overflow-y: scroll;*/}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="usernameTpl">
|
||||
<a href="" class="layui-table-link">{{d.username || ''}}</a>
|
||||
<a href="" class="layui-table-link">{{d.username || ''}}1</a>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="switchTpl">
|
||||
<input type="checkbox" name="yyy" lay-skin="switch" lay-text="女|男">
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="cityTpl">
|
||||
<select lay-ignore>
|
||||
<option value="浙江杭州">浙江杭州</option>
|
||||
<option value="江西南昌">江西南昌</option>
|
||||
<option value="湖北武汉">湖北武汉</option>
|
||||
</select>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="checkboxTpl">
|
||||
<input type="checkbox" name="" title="锁定" checked>
|
||||
</script>
|
||||
@ -193,12 +202,12 @@ layui.use('table', function(){
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
|
||||
,{field:'username', title:'用户名', hide: true, width:120, edit: 'text', templet: '#usernameTpl'}
|
||||
,{field:'username', title:'用户名', width:120, edit: 'text', templet: '#usernameTpl'}
|
||||
,{field:'email', title:'邮箱', hide: true, width:150, edit: 'text', templet: function(x){
|
||||
return '<em>'+ x.email +'</em>'
|
||||
}}
|
||||
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
|
||||
,{field:'city', title:'城市', width:100}
|
||||
,{field:'city', title:'城市', width:120, templet: '#cityTpl1'}
|
||||
,{field:'sign', title:'签名'}
|
||||
,{field:'experience', title:'积分', width:80, sort: true, totalRow: true}
|
||||
,{field:'ip', title:'IP', width:120}
|
||||
@ -246,6 +255,12 @@ layui.use('table', function(){
|
||||
case 'isAll':
|
||||
layer.msg(checkStatus.isAll ? '全选': '未全选')
|
||||
break;
|
||||
case 'reload':
|
||||
table.reload('test', {
|
||||
page: {curr: 5}
|
||||
//,height: 300
|
||||
}, 'data');
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
|
80
examples/transfer.html
Normal file
80
examples/transfer.html
Normal file
@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>穿梭框</title>
|
||||
|
||||
<link rel="stylesheet" href="../src/css/layui.css">
|
||||
<style>
|
||||
body{padding-left: 200px; padding-top: 30px;}
|
||||
#text1,#text2{padding-top: 80px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<button id="btn" class="layui-btn">获取右侧值</button>
|
||||
|
||||
<div id="text1"></div>
|
||||
|
||||
<div id="text2"></div>
|
||||
|
||||
<div id="text3"></div>
|
||||
|
||||
|
||||
<script src="../src/layui.js"></script>
|
||||
<script>
|
||||
layui.use('transfer', function(){
|
||||
var transfer = layui.transfer
|
||||
,$ = layui.$;
|
||||
|
||||
var ins1 = transfer.render({
|
||||
elem: '#text1'
|
||||
,parseData: function(res){
|
||||
return {
|
||||
"value": res.status
|
||||
,"title": res.label
|
||||
,"disabled": res.check
|
||||
}
|
||||
}
|
||||
,data: [{"status": "1", "label": "瓦罐汤", "check": false}
|
||||
,{"status": "2", "label": "油酥饼", "check": false}
|
||||
,{"status": "3", "label": "炸酱面", "check": false}
|
||||
,{"status": "4", "label": "串串香", "check": true}
|
||||
,{"status": "5", "label": "豆腐脑", "check": false}
|
||||
,{"status": "6", "label": "驴打滚", "check": false}]
|
||||
,value: ["1", "5"]
|
||||
,showSearch: true
|
||||
});
|
||||
|
||||
$("#btn").on('click', function(){
|
||||
alert(JSON.stringify(ins1.getValue()))
|
||||
});
|
||||
|
||||
var ins2 = transfer.render({
|
||||
elem: '#text2'
|
||||
,onchange: function(obj){
|
||||
console.log(obj)
|
||||
}
|
||||
,data: [{"value": "1", "title": "瓦罐汤", "disabled": false}
|
||||
,{"value": "2", "title": "油酥饼", "disabled": false}
|
||||
,{"value": "3", "title": "炸酱面", "disabled": false}
|
||||
,{"value": "4", "title": "串串香", "disabled": true}
|
||||
,{"value": "5", "title": "豆腐脑", "disabled": false}
|
||||
,{"value": "6", "title": "驴打滚", "disabled": false}
|
||||
,{"value": "7", "title": "北京烤鸭", "disabled": false}
|
||||
,{"value": "8", "title": "烤冷面", "disabled": false}
|
||||
,{"value": "9", "title": "毛血旺", "disabled": true}
|
||||
,{"value": "10", "title": "肉夹馍", "disabled": false}
|
||||
,{"value": "11", "title": "臊子面", "disabled": false}
|
||||
,{"value": "12", "title": "凉皮", "disabled": false}
|
||||
,{"value": "13", "title": "羊肉泡馍", "disabled": false}
|
||||
,{"value": "14", "title": "冰糖葫芦", "disabled": true}
|
||||
,{"value": "15", "title": "狼牙土豆", "disabled": false}]
|
||||
,value: ["1", "3", "5", "7", "9", "11"]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,147 +1,218 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>树模块 - layui</title>
|
||||
<meta charset="utf-8">
|
||||
<title>树组件 - layui</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
|
||||
<link rel="stylesheet" href="../src/css/layui.css">
|
||||
|
||||
<style>
|
||||
body{padding: 50px 100px;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../src/css/layui.css" media="all">
|
||||
|
||||
<style>
|
||||
body{padding: 150px;}
|
||||
#test1,#test2{margin-bottom: 100px; width: 400px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ul id="demo"></ul>
|
||||
<div id="test1"></div>
|
||||
<div id="test2"></div>
|
||||
|
||||
<ul id="demo1" style="margin-top: 50px;"></ul>
|
||||
|
||||
<script src="../src/layui.js"></script>
|
||||
<script src="../dist/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['tree', 'layer'], function(){
|
||||
var tree = layui.tree
|
||||
,$ = layui.$
|
||||
,layer = layui.layer
|
||||
,index = 100;
|
||||
|
||||
//数据源
|
||||
var data1 = [{
|
||||
label: '一级1'
|
||||
,id: 1
|
||||
,children: [{
|
||||
label: '二级1-1'
|
||||
,id: 3
|
||||
,href: 'https://www.layui.com/doc/'
|
||||
,children: [{
|
||||
label: '三级1-1-3'
|
||||
,id: 23
|
||||
,children: [{
|
||||
label: '四级1-1-3-1'
|
||||
,id: 24
|
||||
,children: [{
|
||||
label: '五级1-1-3-1-1'
|
||||
,id: 30
|
||||
},{
|
||||
label: '五级1-1-3-1-2'
|
||||
,id: 31
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
label: '三级1-1-1'
|
||||
,id: 7
|
||||
,children: [{
|
||||
label: '四级1-1-1-1'
|
||||
,id: 15
|
||||
,href: 'https://www.layui.com/doc/base/infrastructure.html'
|
||||
}]
|
||||
},{
|
||||
label: '三级1-1-2'
|
||||
,id: 8
|
||||
,children: [{
|
||||
label: '四级1-1-2-1'
|
||||
,id: 32
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
label: '二级1-2'
|
||||
,id: 4
|
||||
,children: [{
|
||||
label: '三级1-2-1'
|
||||
,id: 9
|
||||
,disabled: true
|
||||
},{
|
||||
label: '三级1-2-2'
|
||||
,id: 10
|
||||
}]
|
||||
},{
|
||||
label: '二级1-3'
|
||||
,id: 20
|
||||
,children: [{
|
||||
label: '三级1-3-1'
|
||||
,id: 21
|
||||
},{
|
||||
label: '三级1-3-2'
|
||||
,id: 22
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
label: '一级2'
|
||||
,id: 2
|
||||
,children: [{
|
||||
label: '二级2-1'
|
||||
,id: 5
|
||||
,children: [{
|
||||
label: '三级2-1-1'
|
||||
,id: 11
|
||||
},{
|
||||
label: '三级2-1-2'
|
||||
,id: 12
|
||||
}]
|
||||
},{
|
||||
label: '二级2-2'
|
||||
,id: 6
|
||||
,children: [{
|
||||
label: '三级2-2-1'
|
||||
,id: 13
|
||||
},{
|
||||
label: '三级2-2-2'
|
||||
,id: 14
|
||||
,disabled: true
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
label: '一级3'
|
||||
,id: 16
|
||||
,children: [{
|
||||
label: '二级3-1'
|
||||
,id: 17
|
||||
,fixed: true
|
||||
,children: [{
|
||||
label: '三级3-1-1'
|
||||
,id: 18
|
||||
},{
|
||||
label: '三级3-1-2'
|
||||
,id: 19
|
||||
}]
|
||||
},{
|
||||
label: '二级3-2'
|
||||
,id: 27
|
||||
,children: [{
|
||||
label: '三级3-2-1'
|
||||
,id: 28
|
||||
},{
|
||||
label: '三级3-2-2'
|
||||
,id: 29
|
||||
}]
|
||||
}]
|
||||
}];
|
||||
|
||||
layui.use('tree', function(){
|
||||
var tree = layui.tree({
|
||||
elem: '#demo' //指定元素
|
||||
//,check: 'checkbox' //勾选风格
|
||||
,skin: 'as' //设定皮肤
|
||||
//,target: '_blank' //是否新选项卡打开(比如节点返回href才有效)
|
||||
,drag: true
|
||||
,click: function(item){ //点击节点回调
|
||||
console.log(item)
|
||||
}
|
||||
,nodes: [ //节点
|
||||
{
|
||||
name: '常用文件夹'
|
||||
,id: 1
|
||||
,alias: 'changyong'
|
||||
,children: [
|
||||
{
|
||||
name: '所有未读'
|
||||
,id: 11
|
||||
//,href: 'http://www.layui.com/'
|
||||
,alias: 'weidu'
|
||||
}, {
|
||||
name: '置顶邮件'
|
||||
,id: 12
|
||||
}, {
|
||||
name: '标签邮件'
|
||||
,id: 13
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: '我的邮箱'
|
||||
,id: 2
|
||||
,spread: true
|
||||
,children: [
|
||||
{
|
||||
name: 'QQ邮箱'
|
||||
,id: 21
|
||||
,spread: true
|
||||
,children: [
|
||||
{
|
||||
name: '收件箱'
|
||||
,id: 211
|
||||
,children: [
|
||||
{
|
||||
name: '所有未读'
|
||||
,id: 2111
|
||||
}, {
|
||||
name: '置顶邮件'
|
||||
,id: 2112
|
||||
}, {
|
||||
name: '标签邮件'
|
||||
,id: 2113
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: '已发出的邮件'
|
||||
,id: 212
|
||||
}, {
|
||||
name: '垃圾邮件'
|
||||
,id: 213
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: '阿里云邮'
|
||||
,id: 22
|
||||
,children: [
|
||||
{
|
||||
name: '收件箱'
|
||||
,id: 221
|
||||
}, {
|
||||
name: '已发出的邮件'
|
||||
,id: 222
|
||||
}, {
|
||||
name: '垃圾邮件'
|
||||
,id: 223
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
var tree1 = tree.render({
|
||||
elem: '#test1'
|
||||
,data: data1
|
||||
,click: function(obj){
|
||||
layer.msg(JSON.stringify(obj.data))
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//生成一个模拟树
|
||||
var createTree = function(node, start){
|
||||
node = node || function(){
|
||||
var arr = [];
|
||||
for(var i = 1; i < 10; i++){
|
||||
arr.push({
|
||||
name: i.toString().replace(/(\d)/, '$1$1$1$1$1$1$1$1$1')
|
||||
});
|
||||
,oncheck: function(obj){
|
||||
console.log(obj);
|
||||
}
|
||||
return arr;
|
||||
}();
|
||||
start = start || 1;
|
||||
layui.each(node, function(index, item){
|
||||
if(start < 10 && index < 9){
|
||||
var child = [
|
||||
{
|
||||
name: (1 + index + start).toString().replace(/(\d)/, '$1$1$1$1$1$1$1$1$1')
|
||||
}
|
||||
];
|
||||
node[index].children = child;
|
||||
createTree(child, index + start + 1);
|
||||
,onsearch:function(obj){
|
||||
console.log(obj);
|
||||
}
|
||||
,operate: function(obj){
|
||||
var type = obj.type;
|
||||
if(type == 'add'){
|
||||
//ajax操作,返回key值
|
||||
return index++;
|
||||
}else if(type == 'edit'){
|
||||
console.log(obj.elem.find('.layui-tree-txt').html());
|
||||
}else if(type == 'del'){
|
||||
console.log(obj);
|
||||
};
|
||||
}
|
||||
,dragend: function(state, obj, target){
|
||||
console.log(state, obj, target);
|
||||
}
|
||||
,showCheckbox: true //是否显示复选框
|
||||
,key: 'id' //自定义唯一标识的字段名
|
||||
,checked: [6, 7, 9] //选中节点(依赖于 showCheckbox 以及 key 参数)
|
||||
,spread: [2, 4, 5] //展开节点(依赖于 key 参数)
|
||||
,accordion: 0 //是否开启手风琴模式
|
||||
,expandClick: true //选择在点击节点(true)/箭头图标(false)的时候展开节点
|
||||
,isJump: 0 //点击文案跳转地址
|
||||
,renderContent: true //增删改
|
||||
,showSearch: true //是否打开节点过滤
|
||||
,draggable: true //是否开启节点拖拽
|
||||
});
|
||||
|
||||
console.log(tree1.getCheck()); //返回当前勾选节点
|
||||
tree1.setCheck([2, 3]); //设置节点勾选
|
||||
|
||||
|
||||
|
||||
|
||||
tree.render({
|
||||
elem: '#test2'
|
||||
,data: data1
|
||||
//,expandClick: false
|
||||
,showLine: false //关闭连接线
|
||||
,click: function(obj, state){
|
||||
console.log(obj[0]);
|
||||
}
|
||||
,oncheck: function(obj, checked, child){
|
||||
if(checked){
|
||||
console.log(obj[0]);
|
||||
}
|
||||
}
|
||||
,onsearch: function(data, num){
|
||||
console.log(num);
|
||||
}
|
||||
,dragstart: function(obj, parent){
|
||||
console.log(obj, parent);
|
||||
}
|
||||
,dragend: function(state, obj, target){
|
||||
console.log(state, obj, target);
|
||||
}
|
||||
});
|
||||
return node;
|
||||
};
|
||||
|
||||
layui.tree({
|
||||
elem: '#demo1' //指定元素
|
||||
,nodes: createTree()
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<pre class="layui-code">
|
||||
# layui.tree-v2 备忘
|
||||
* check参数 - checkbox、radio的支持
|
||||
* 拖拽的支持
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -101,7 +101,7 @@ layui.use('upload', function(){
|
||||
}
|
||||
}
|
||||
,choose: function(){
|
||||
console.log(1)
|
||||
|
||||
}
|
||||
,before: function(obj){
|
||||
//预读本地文件示例,不支持ie8
|
||||
@ -110,6 +110,7 @@ layui.use('upload', function(){
|
||||
});
|
||||
}
|
||||
,done: function(res){
|
||||
|
||||
//如果上传失败
|
||||
if(res.code > 0){
|
||||
return layer.msg('上传失败');
|
||||
@ -117,6 +118,8 @@ layui.use('upload', function(){
|
||||
//上传成功
|
||||
}
|
||||
,error: function(){
|
||||
this.item.html('重选上传');
|
||||
|
||||
//演示失败状态,并实现重传
|
||||
var demoText = $('#demoText');
|
||||
demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
|
||||
@ -126,6 +129,13 @@ layui.use('upload', function(){
|
||||
}
|
||||
});
|
||||
|
||||
//重置上述 upload 实例
|
||||
uploadInst.reload({
|
||||
name:'avatar'
|
||||
,acceptMime: 'image/*'
|
||||
//,size: 2
|
||||
});
|
||||
|
||||
upload.render({
|
||||
elem: '#test2'
|
||||
,url: ''
|
||||
|
@ -13,6 +13,12 @@ body{padding: 50px;}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<button class="layui-btn" lay-active="e1">事件1</button>
|
||||
<button class="layui-btn" lay-active="e2">事件2</button>
|
||||
<button class="layui-btn" lay-active="e3">事件3</button>
|
||||
|
||||
<hr>
|
||||
|
||||
<div id="test"></div>
|
||||
|
||||
<hr>
|
||||
@ -51,6 +57,20 @@ layui.use('util', function(){
|
||||
//某个时间在当前时间的多久前
|
||||
var str = util.timeAgo(new Date(2017,7,15,2,58,0));
|
||||
$('#test1').html('示例写于:'+ str);
|
||||
|
||||
//处理属性 为 lay-active 的所有元素事件
|
||||
util.event('lay-active', {
|
||||
e1: function(){
|
||||
alert('事件1')
|
||||
}
|
||||
,e2: function(){
|
||||
alert('事件2')
|
||||
}
|
||||
,e3: function(){
|
||||
alert('事件3')
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
@ -30,7 +30,7 @@ var argv = require('minimist')(process.argv.slice(2), {
|
||||
]
|
||||
|
||||
//模块
|
||||
,mods = 'laytpl,laypage,laydate,jquery,layer,element,upload,slider,colorpicker,form,tree,table,carousel,rate,util,flow,layedit,code'
|
||||
,mods = 'laytpl,laypage,laydate,jquery,layer,element,upload,slider,colorpicker,form,tree,transfer,table,carousel,rate,util,flow,layedit,code'
|
||||
|
||||
//发行版本目录
|
||||
,releaseDir = './release/zip/layui-v' + pkg.version
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "layui-src",
|
||||
"realname": "layui",
|
||||
"version": "2.4.5",
|
||||
"version": "2.5.0",
|
||||
"independents": {
|
||||
"layim": "3.8.0"
|
||||
"layim": "3.9.0"
|
||||
},
|
||||
"description": "Classic modular front-end component library",
|
||||
"main": "layui.js",
|
||||
|
@ -45,12 +45,14 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-hide{display: none !important;}
|
||||
|
||||
/** 图标字体 **/
|
||||
@font-face {font-family: 'layui-icon';
|
||||
src: url('../font/iconfont.eot?v=240');
|
||||
src: url('../font/iconfont.eot?v=240#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.svg?v=240#iconfont') format('svg'),
|
||||
url('../font/iconfont.woff?v=240') format('woff'),
|
||||
url('../font/iconfont.ttf?v=240') format('truetype');
|
||||
@font-face {
|
||||
font-family: 'layui-icon';
|
||||
src: url('../font/iconfont.eot?v=250');
|
||||
src: url('../font/iconfont.eot?v=250#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.woff2?v=250') format('woff2'),
|
||||
url('../font/iconfont.woff?v=250') format('woff'),
|
||||
url('../font/iconfont.ttf?v=250') format('truetype'),
|
||||
url('../font/iconfont.svg?v=250#layui-icon') format('svg');
|
||||
}
|
||||
|
||||
.layui-icon{
|
||||
@ -209,8 +211,12 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-icon-screen-restore:before{content:"\e758";}
|
||||
.layui-icon-cols:before{content:"\e610";}
|
||||
.layui-icon-export:before{content:"\e67d";}
|
||||
.layui-icon-print:before {content:"\e66d";}
|
||||
.layui-icon-slider:before {content: "\e714";}
|
||||
.layui-icon-print:before{content:"\e66d";}
|
||||
.layui-icon-slider:before{content: "\e714";}
|
||||
|
||||
.layui-icon-addition:before{content: "\e624";}
|
||||
.layui-icon-subtraction:before{content: "\e67e";}
|
||||
.layui-icon-service:before{content: "\e626";}
|
||||
|
||||
/* 基本布局 */
|
||||
.layui-main{position: relative; width: 1140px; margin: 0 auto;}
|
||||
@ -223,7 +229,7 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
/* 后台框架大布局 */.layui-layout-body{overflow: hidden;}
|
||||
.layui-layout-admin .layui-header{background-color: #23262E;}
|
||||
.layui-layout-admin .layui-side{top: 60px; width: 200px; overflow-x: hidden;}
|
||||
.layui-layout-admin .layui-body{top: 60px; bottom: 44px;}
|
||||
.layui-layout-admin .layui-body{position: fixed; top: 60px; bottom: 44px;}
|
||||
.layui-layout-admin .layui-main{width: auto; margin: 0 15px;}
|
||||
.layui-layout-admin .layui-footer{position: fixed; left: 200px; right: 0; bottom: 0; height: 44px; line-height: 44px; padding: 0 15px; background-color: #eee;}
|
||||
.layui-layout-admin .layui-logo{position: absolute; left: 0; top: 0; width: 200px; height: 100%; line-height: 60px; text-align: center; color: #009688; font-size: 16px;}
|
||||
@ -813,6 +819,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-table-view .layui-table td{padding: 5px 0; border-top: none; border-left: none;}
|
||||
.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor: pointer;}
|
||||
.layui-table-view .layui-table td{cursor: default;}
|
||||
.layui-table-view .layui-table td[data-edit="text"]{cursor: text;}
|
||||
.layui-table-view .layui-form-checkbox[lay-skin="primary"] i{width: 18px; height: 18px;}
|
||||
.layui-table-view .layui-form-radio{line-height: 0; padding: 0;}
|
||||
.layui-table-view .layui-form-radio>i{margin: 0; font-size: 20px;}
|
||||
@ -922,22 +929,6 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-upload-wrap{position: relative; display: inline-block; vertical-align: middle;}
|
||||
.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-tree{line-height: 26px;}
|
||||
.layui-tree li{text-overflow: ellipsis; overflow:hidden; white-space: nowrap;}
|
||||
.layui-tree li a,
|
||||
.layui-tree li .layui-tree-spread{display: inline-block; vertical-align: top; height: 26px; *display: inline; *zoom:1; cursor: pointer;}
|
||||
.layui-tree li a{font-size: 0;}
|
||||
.layui-tree li a i{font-size: 16px;}
|
||||
.layui-tree li a cite{padding: 0 6px; font-size: 14px; font-style: normal;}
|
||||
.layui-tree li i{padding-left: 6px; color: #333; -moz-user-select: none;}
|
||||
.layui-tree li .layui-tree-check{font-size: 13px;}
|
||||
.layui-tree li .layui-tree-check:hover{color: #009E94;}
|
||||
.layui-tree li ul{display: none; margin-left: 20px;}
|
||||
.layui-tree li .layui-tree-enter{line-height: 24px; border: 1px dotted #000;}
|
||||
.layui-tree-drag{display: none; position: absolute; left: -666px; top: -666px; background-color: #f2f2f2; padding: 5px 10px; border: 1px dotted #000; white-space: nowrap}
|
||||
.layui-tree-drag i{padding-right: 5px;}
|
||||
|
||||
/** 导航菜单 **/
|
||||
.layui-nav{position: relative; padding: 0 20px; background-color: #393D49; color: #fff; border-radius: 2px; font-size: 0; box-sizing: border-box;}
|
||||
.layui-nav *{font-size: 14px;}
|
||||
@ -1225,6 +1216,63 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-slider > span{margin-left: 8px;}
|
||||
}
|
||||
|
||||
/** 穿梭框 By star1029 **/
|
||||
.layui-transfer{display: inline-block; position: relative; width: 480px; height: 360px; background-color: #FFF; text-align: left;}
|
||||
.layui-transfer-left,.layui-transfer-right{display: inline-block; vertical-align: middle; position: relative; width: 200px; height: 340px; border: 1px solid #DDD;}
|
||||
.layui-transfer-topTitle{padding-left: 12px; height: 36px; border-bottom: 1px solid #DDD; line-height: 36px;}
|
||||
.layui-transfer-btn{display: inline-block; vertical-align: middle; width: 70px; height: 90px; text-align: center;}
|
||||
.layui-transfer-btn .layui-btn{margin-left: 0; padding: 0 10px; height: 30px; line-height: 30px; background-color: #5FB878; border-color: #5FB878;}
|
||||
.layui-transfer-btn .layui-btn i{margin-left: 4px; font-size: 14px; color: #FFF;}
|
||||
.layui-transfer-btn .layui-btn.layui-btn-disabled{background-color: #FBFBFB; border-color: #DDD;}
|
||||
.layui-transfer-btn .layui-btn.layui-btn-disabled i{color: #CCC;}
|
||||
.layui-transfer-btnRight{margin-bottom: 30px;}
|
||||
.layui-transfer-search{position: relative; height: 36px; line-height: 36px; border-bottom: 1px solid #DDD; text-align: center;}
|
||||
.layui-transfer-search .layui-input{display: inline-block; width: 88%; padding-left: 30px; height: 28px; line-height: 28px;}
|
||||
.layui-transfer-searchI{position: absolute; left: 20px;}
|
||||
.layui-transfer-data{height: 303px; overflow: auto;}
|
||||
.layui-transfer-data.short{height: 266px;}
|
||||
.layui-transfer-data li{position: relative; padding-left: 12px; height: 30px; line-height: 30px;}
|
||||
.layui-transfer-data .layui-form-checkbox[lay-skin="primary"]{width: 100%;}
|
||||
.layui-transfer-data li:hover{background-color: #EEE;}
|
||||
.layui-transfer-data::-webkit-scrollbar{width: 5px; background-color: #EEE;}
|
||||
.layui-transfer-data::-webkit-scrollbar-thumb{background-color: #DDD;}
|
||||
|
||||
/** 树组件 By star1029 **/
|
||||
.layui-tree{line-height: 22px;}
|
||||
.layui-tree-set{width: 100%; position: relative;}
|
||||
.layui-tree-pack{display: none; padding-left: 20px; position: relative;}
|
||||
.layui-tree-line .layui-tree-pack{padding-left: 27px;}
|
||||
.layui-tree-line .layui-tree-set .layui-tree-set:after{content: ''; position: absolute; top: 14px; left: -9px; width: 17px; height: 0; border-top: 1px dotted #c0c4cc;}
|
||||
.layui-tree-entry{position: relative; padding: 3px 0; height: 20px;}
|
||||
.layui-tree-entry:hover{background-color: #eee;}
|
||||
.layui-tree-line .layui-tree-entry:hover{background-color: rgba(0,0,0,0);}
|
||||
.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color: #999; text-decoration: underline; transition: 0.3s;}
|
||||
.layui-tree-main{cursor: pointer;}
|
||||
.layui-tree-line .layui-tree-set:before{content: ''; position: absolute; top: 0; left: -9px; width: 0; height: 100%; border-left: 1px dotted #c0c4cc;}
|
||||
.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height: 13px;}
|
||||
.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height: 0;}
|
||||
.layui-tree-iconClick{display: inline-block; vertical-align: middle; position: relative; height: 20px; line-height: 20px; margin: 0 10px; color: #c0c4cc;}
|
||||
.layui-tree-icon{height: 14px; line-height: 14px; width: 14px; text-align: center; border: 1px solid #c0c4cc;}
|
||||
.layui-tree-iconClick .layui-icon{font-size: 18px;}
|
||||
.layui-tree-icon .layui-icon{font-size: 12px; color: #666;}
|
||||
.layui-tree-iconArrow{padding: 0 5px;}
|
||||
.layui-tree-iconArrow:after{content: ''; position: absolute; left: 4px; top: 3px; z-index: 100; width: 0; height: 0; border-width: 5px; border-style: solid; border-color: transparent transparent transparent #c0c4cc; transition: 0.5s;}
|
||||
.layui-tree-iconArrow.hide:after{border-color: transparent;}
|
||||
.layui-tree-spread>.layui-tree-entry>.layui-tree-iconClick>.layui-tree-iconArrow:after{transform: rotate(90deg) translate(3px, 4px);}
|
||||
.layui-tree-txt{display: inline-block; vertical-align: middle; color: #555;}
|
||||
.layui-tree-search{margin-bottom: 15px; color: #666;}
|
||||
.layui-tree-btnGroup{display: none; position: absolute; top: 0; right: 0;}
|
||||
.layui-tree-btnGroup .layui-btn{padding: 0 7px; border: none; background-color: rgba(0,0,0,0);}
|
||||
.layui-tree-btnGroup .layui-btn:first-child{border: none;}
|
||||
.layui-tree-entry:hover .layui-tree-btnGroup{display: block;}
|
||||
.layui-tree-editInput{position: absolute; left: 30px; z-index: 99; height: 20px; line-height: 20px; border: none; background-color: rgba(0,0,0,0);}
|
||||
.layui-form .layui-tree-editInput{left: 58px;}
|
||||
.layui-tree-line .layui-tree-editInput{left: 38px;}
|
||||
.layui-tree-line.layui-form .layui-tree-editInput{left: 66px;}
|
||||
.layui-tree-emptyText{text-align: center; color: #999;}
|
||||
|
||||
|
||||
|
||||
|
||||
/** 动画 **/
|
||||
.layui-anim{-webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
|
Binary file not shown.
@ -344,6 +344,9 @@ Created by iconfont
|
||||
<glyph glyph-name="rmb" unicode="" d="M511.998465 896C229.23338 896 0.004605 666.769178 0.004605 384.001023c0-282.773272 229.227752-512.001023 511.99386-512.001023 282.769178 0 511.994883 229.227752 511.994883 512.001023C1023.994372 666.769178 794.767644 896 511.998465 896zM511.998465-91.59690499999999c-262.660188 0-475.589742 212.930577-475.589742 475.597929 0 262.663258 212.929554 475.594859 475.589742 475.594859 262.663258 0 475.590765-212.9316 475.590765-475.594859C987.590254 121.33469500000001 774.662747-91.59690499999999 511.998465-91.59690499999999zM738.742652 301.137781L544.432155 301.137781l0 69.780273 194.310497 0c17.835204 0 32.249495 14.43885 32.249495 32.220842 0 17.784038-14.414291 32.19526-32.249495 32.19526L589.7462 435.334155l149.620669 209.579249c8.916067 15.397688 3.63069 35.099403-11.82021 43.988864-15.398712 8.891508-35.097356 3.629667-44.017516-11.793604L512.187777 437.098335 340.84334 677.108664c-8.864902 15.423271-28.617781 20.685111-44.016493 11.793604-15.395642-8.889461-20.685111-28.590152-11.82021-43.988864l149.622716-209.579249L285.628808 435.334155c-17.781992 0-32.245402-14.411221-32.245402-32.19526 0-17.781992 14.46341-32.220842 32.245402-32.220842l194.310497 0 0-69.780273L285.628808 301.137781c-17.781992 0-32.245402-14.413268-32.245402-32.19526s14.46341-32.220842 32.245402-32.220842l194.310497 0 0-132.435265c0-17.780969 14.46341-32.19526 32.248472-32.19526 17.835204 0 32.245402 14.414291 32.245402 32.19526L544.433178 236.72065499999997l194.310497 0c17.835204 0 32.249495 14.43885 32.249495 32.220842S756.577856 301.137781 738.742652 301.137781" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="addition" unicode="" d="M544 768L480 768 480 416 128 416 128 352 480 352 480 0 544 0 544 352 895.936 352 895.936 416 544 416Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="home" unicode="" d="M824.084343-40.42033900000001H232.898863c-74.604138 0-85.85232 28.334325-85.852321 49.997718l-0.584307 5.314029V447.645552h48.806589v-402.916582c0-25.547863 13.548574-36.343743 37.629015-36.343743h568.020898c25.928532 0 27.978215 6.220678 27.978215 37.84391V447.585177l48.806589 0.118704c0.022513-14.346753 0-382.76666 0-433.098999 0-38.130436-12.726859-54.765301-51.858088-54.765301l-1.76111-0.25992zM1012.470921 493.103884C849.773422 615.120868 687.101505 737.137853 524.404006 859.153814c-6.207375 4.659113-18.433838 4.659113-24.641213 0C337.077573 737.137853 174.393377 615.120868 11.696902 493.103884c-24.856108-18.635429-0.572028-61.044308 24.642236-42.13361A15995638.709915 15995638.709915 0 0 1 512.025071 807.737794c0.988514-0.715291 1.644453-1.144056 2.823302-2.037403 18.040888-13.524015 36.057217-27.036773 54.073546-40.560788 58.291614-43.718711 116.583229-87.437421 174.874843-131.143852 81.33647-61.008492 162.696476-122.015961 244.033969-183.024454 25.212218-18.911722 49.496298 23.497157 24.64019 42.132587z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
@ -452,6 +455,9 @@ Created by iconfont
|
||||
<glyph glyph-name="vercode" unicode="" d="M513.807059-128C351.171765-128 58.428235 126.19294100000002 54.211765 376.16941199999997V662.287059a93.364706 93.364706 0 0 0 81.317647 88.545882 570.428235 570.428235 0 0 1 163.237647 40.357647A393.336471 393.336471 0 0 1 446.945882 872.508235a101.797647 101.797647 0 0 0 120.470589 5.421177A629.458824 629.458824 0 0 1 716.8 792.395294a1255.303529 1255.303529 0 0 1 169.863529-38.550588 98.785882 98.785882 0 0 0 79.510589-90.955294 2911.171765 2911.171765 0 0 0-3.011765-291.538824C924.611765 49.09176500000001 672.828235-128 513.807059-128z m0 963.764706a39.152941 39.152941 0 0 1-24.696471-7.830588A438.512941 438.512941 0 0 0 319.247059 734.569412a608.376471 608.376471 0 0 0-180.705883-43.369412 33.731765 33.731765 0 0 1-24.094117-30.117647v-283.708235C118.663529 155.10588199999995 389.722353-67.76470600000005 513.807059-67.76470600000005s354.183529 148.178824 391.529412 444.536471c9.035294 175.887059 0 281.901176 0 283.105882a38.550588 38.550588 0 0 1-29.515295 33.731765 1287.830588 1287.830588 0 0 0-180.705882 41.562353A676.442353 676.442353 0 0 0 536.094118 829.741176a37.345882 37.345882 0 0 1-24.094118 6.02353zM784.865882 479.171765L487.905882 198.47529399999996a40.357647 40.357647 0 0 0-49.392941-4.818823l-7.830588 6.625882-161.430588 171.068235a40.357647 40.357647 0 1 0 60.235294 55.416471l133.722353-141.552941 267.444706 252.988235a40.357647 40.357647 0 1 0 55.41647-60.235294" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="service" unicode="" d="M895.44035 502.006246A31.340412 31.340412 0 0 1 895.44035 512.2398499999999 383.76015 383.76015 0 0 1 127.92005 512.2398499999999a31.340412 31.340412 0 0 1 0-10.233604 167.575265 167.575265 0 0 1-127.92005-159.900062V320.359775a168.854466 168.854466 0 0 1 140.712055-163.098064A351.140537 351.140537 0 0 1 401.029357-63.400375000000054h5.756402a95.940037 95.940037 0 1 1 0 63.960025 287.180512 287.180512 0 0 0-195.717677 156.062461h35.817614A40.294816 40.294816 0 0 1 287.820112 192.43972499999995V468.747033a40.294816 40.294816 0 0 1-40.934416 39.015615H191.880075A30.061212 30.061212 0 0 1 191.880075 512.2398499999999a319.800125 319.800125 0 0 0 639.60025 0 30.061212 30.061212 0 0 1 0-3.837601h-55.005622a40.294816 40.294816 0 0 1-40.934416-39.015616V192.43972499999995a40.294816 40.294816 0 0 1 40.934416-39.015615h72.274829A170.773267 170.773267 0 0 1 1023.3604 320.359775v21.746409a167.575265 167.575265 0 0 1-127.92005 159.900062zM496.329794 0.5596500000000333a31.980012 31.980012 0 1 0-31.980013-31.980012 31.980012 31.980012 0 0 0 31.980013 31.980012zM223.860087 220.582136h-49.249219A106.813242 106.813242 0 0 0 63.960025 320.359775v21.746409a106.813242 106.813242 0 0 0 110.650843 102.33604h49.249219zM959.400375 320.359775a106.813242 106.813242 0 0 0-110.650843-102.33604h-49.24922V444.442224h49.24922A106.813242 106.813242 0 0 0 959.400375 342.106184zM650.473454 750.171143l-23.665209 8.314803a31.980012 31.980012 0 0 1-19.827608-63.960025l18.548407-7.035602a31.980012 31.980012 0 1 1 24.94441 58.843223zM305.089319 674.698314A31.980012 31.980012 0 0 1 358.17614 640.1599 202.113679 202.113679 0 0 0 511.6802 716.91193a31.980012 31.980012 0 0 1 0 63.960025 263.515303 263.515303 0 0 1-206.590881-106.173641z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="cellphone" unicode="" d="M785.066667 896H238.933333a102.4 102.4 0 0 1-102.4-102.4v-819.2a102.4 102.4 0 0 1 102.4-102.4h546.133334a102.4 102.4 0 0 1 102.4 102.4V793.6a102.4 102.4 0 0 1-102.4 102.4zM238.933333 827.733333h546.133334a34.133333 34.133333 0 0 0 34.133333-34.133333v-648.533333H204.8V793.6a34.133333 34.133333 0 0 0 34.133333 34.133333z m546.133334-887.466666H238.933333a34.133333 34.133333 0 0 0-34.133333 34.133333v102.4h614.4v-102.4a34.133333 34.133333 0 0 0-34.133333-34.133333zM512 8.53333299999997m-34.133333 0a34.133333 34.133333 0 1 1 68.266666 0 34.133333 34.133333 0 1 1-68.266666 0ZM426.666667 725.333333h170.666666a17.066667 17.066667 0 0 1 0 34.133334h-170.666666a17.066667 17.066667 0 0 1 0-34.133334z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
@ -467,6 +473,9 @@ Created by iconfont
|
||||
<glyph glyph-name="slider" unicode="" d="M228.7 683.9v-66.7H112v66.7h116.7z m333.2-266.6v-66.7H112v66.7h449.9zM295.4 150.60000000000002V84H112v66.7h183.4v-0.1z m116.6 600c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H278.8c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.3-9.9 23.5V717.1c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.3 9.9 23.5 9.9h133.3v0.1h-0.1z m66.7-533.3c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H345.3c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.5-9.9 23.5V183.89999999999998c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.3 9.9 23.5 9.9h133.4v0.1zM912 683.9v-66.7H462.1v66.7H912z m0-533.3V84H528.6v66.7h383.3v-0.1h0.1zM745.2 483.9c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H612c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.3-9.9 23.5V450.6c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.5 9.9 23.5 9.9l133.2-0.1zM912 417.3v-66.7H795.3v66.7H912z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="subtraction" unicode="" d="M785 348H239c-19.8 0-36 16.2-36 36s16.2 36 36 36h546c19.8 0 36-16.2 36-36s-16.2-36-36-36z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
|
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 276 KiB |
Binary file not shown.
Binary file not shown.
BIN
src/font/iconfont.woff2
Normal file
BIN
src/font/iconfont.woff2
Normal file
Binary file not shown.
@ -163,6 +163,7 @@ layui.define('jquery', function(exports){
|
||||
,options = that.config;
|
||||
|
||||
if(!options.autoplay) return;
|
||||
clearInterval(that.timer);
|
||||
|
||||
that.timer = setInterval(function(){
|
||||
that.slide();
|
||||
|
@ -89,7 +89,7 @@ layui.define('layer', function(exports){
|
||||
itemElem[0].checked = value;
|
||||
} else if(type === 'radio') { //如果为单选框
|
||||
itemElem.each(function(){
|
||||
if(this.value === value ){
|
||||
if(this.value == value ){
|
||||
this.checked = true
|
||||
}
|
||||
});
|
||||
@ -605,6 +605,10 @@ layui.define('layer', function(exports){
|
||||
var isTrue = isFn ? errorText = verify[thisVer](value, item) : !verify[thisVer][0].test(value);
|
||||
errorText = errorText || verify[thisVer][1];
|
||||
|
||||
if(thisVer === 'required'){
|
||||
errorText = othis.attr('lay-reqText') || errorText;
|
||||
}
|
||||
|
||||
//如果是必填项或者非空命中校验,则阻止提交,弹出提示
|
||||
if(isTrue){
|
||||
//提示层风格
|
||||
@ -622,7 +626,14 @@ layui.define('layer', function(exports){
|
||||
} else {
|
||||
layer.msg(errorText, {icon: 5, shift: 6});
|
||||
}
|
||||
if(!device.android && !device.ios) item.focus(); //非移动设备自动定位焦点
|
||||
|
||||
//非移动设备自动定位焦点
|
||||
if(!device.android && !device.ios){
|
||||
setTimeout(function(){
|
||||
item.focus();
|
||||
}, 7);
|
||||
}
|
||||
|
||||
othis.addClass(DANGER);
|
||||
return stop = true;
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
}
|
||||
|
||||
return {
|
||||
reload: function(options){
|
||||
that.reload.call(that, options);
|
||||
reload: function(options, type){
|
||||
that.reload.call(that, options, type);
|
||||
}
|
||||
,setColsWidth: function(){
|
||||
that.setColsWidth.call(that);
|
||||
@ -72,6 +72,17 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
return config || null;
|
||||
}
|
||||
|
||||
//解析自定义模板数据
|
||||
,parseTempData = function(item3, content, tplData, text){
|
||||
var str = item3.templet ? function(){
|
||||
return typeof item3.templet === 'function'
|
||||
? item3.templet(tplData)
|
||||
: laytpl($(item3.templet).html() || String(content) || '').render(tplData)
|
||||
}() : content;
|
||||
str = str || '';
|
||||
return text ? $('<div>'+ str +'</div>').text() : str;
|
||||
}
|
||||
|
||||
//字符常量
|
||||
,MOD_NAME = 'table', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled', NONE = 'layui-none'
|
||||
|
||||
@ -627,11 +638,20 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
};
|
||||
|
||||
//表格完整重载
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this;
|
||||
if(that.config.data && that.config.data.constructor === Array) delete that.config.data;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
that.render();
|
||||
Class.prototype.reload = function(options, type){
|
||||
var that = this
|
||||
,optString = typeof options === 'string'
|
||||
,opts, typs;
|
||||
|
||||
opts = optString ? type : options;
|
||||
typs = optString ? options : type
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
if(opts.data && opts.data.constructor === Array) delete that.config.data;
|
||||
that.config = $.extend(true, {}, that.config, opts);
|
||||
|
||||
typs === 'data' ? that.pullData(that.config.page.curr) : that.render();
|
||||
};
|
||||
|
||||
//页码
|
||||
@ -701,7 +721,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
res[response.dataName] = options.data.concat().splice(startLimit, options.limit);
|
||||
res[response.countName] = options.data.length;
|
||||
|
||||
that.renderData(res, curr, options.data.length), sort();
|
||||
that.renderData(res, curr, (options.page && options.page.count) ? options.page : options.data.length), sort();
|
||||
that.setColsWidth();
|
||||
typeof options.done === 'function' && options.done(res, curr, res[response.countName]);
|
||||
}
|
||||
@ -713,7 +733,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
table.eachCols(null, callback, that.config.cols);
|
||||
return that;
|
||||
};
|
||||
|
||||
|
||||
//数据渲染
|
||||
Class.prototype.renderData = function(res, curr, count, sort){
|
||||
var that = this
|
||||
@ -728,7 +748,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
var thisCheckedRowIndex;
|
||||
if(!sort && that.sortKey){
|
||||
return that.sort(that.sortKey.field, that.sortKey.sort, true);
|
||||
}
|
||||
}
|
||||
layui.each(data, function(i1, item1){
|
||||
var tds = [], tds_fixed = [], tds_fixed_r = []
|
||||
,numbers = i1 + options.limit*(curr - 1) + 1; //序号
|
||||
@ -800,11 +820,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
if(item3.toolbar){
|
||||
return laytpl($(item3.toolbar).html()||'').render(tplData);
|
||||
}
|
||||
return item3.templet ? function(){
|
||||
return typeof item3.templet === 'function'
|
||||
? item3.templet(tplData)
|
||||
: laytpl($(item3.templet).html() || String(content)).render(tplData)
|
||||
}() : content;
|
||||
return parseTempData(item3, content, tplData);
|
||||
}()
|
||||
,'</div></td>'].join('');
|
||||
|
||||
@ -1045,7 +1061,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
if(hide){
|
||||
that.layInit && that.layInit.remove();
|
||||
delete that.layInit;
|
||||
that.layBox.find(ELEM_INIT).remove()
|
||||
that.layBox.find(ELEM_INIT).remove();
|
||||
} else {
|
||||
that.layInit = $(['<div class="layui-table-init">'
|
||||
,'<i class="layui-icon layui-icon-loading layui-icon"></i>'
|
||||
@ -1317,12 +1333,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
,'a{color: #666; text-decoration:none;}'
|
||||
,'*.layui-hide{display: none}'
|
||||
,'</style>'].join('')
|
||||
,html = $(that.layHeader.html());
|
||||
,html = $(that.layHeader.html()); //输出表头
|
||||
|
||||
html.append(that.layMain.find('table').html());
|
||||
html.append(that.layMain.find('table').html()); //输出表体
|
||||
html.append(that.layTotal.find('table').html()) //输出合计行
|
||||
|
||||
html.find('th.layui-table-patch').remove();
|
||||
html.find('.layui-table-col-special').remove();
|
||||
html.find('th.layui-table-patch').remove(); //移除补丁
|
||||
html.find('.layui-table-col-special').remove(); //移除特殊列
|
||||
|
||||
printWin.document.write(style + html.prop('outerHTML'));
|
||||
printWin.document.close();
|
||||
@ -1550,6 +1567,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
}).on('blur', '.'+ELEM_EDIT, function(){
|
||||
var templet
|
||||
,othis = $(this)
|
||||
,thisElem = this
|
||||
,field = othis.parent().data('field')
|
||||
,index = othis.parents('tr').eq(0).data('index')
|
||||
,data = table.cache[that.key][index];
|
||||
@ -1562,10 +1580,10 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
return templet ? function(){
|
||||
return typeof templet === 'function'
|
||||
? templet(data)
|
||||
: laytpl($(templet).html() || this.value).render(data)
|
||||
: laytpl($(templet).html() || thisElem.value).render(data)
|
||||
}() : value;
|
||||
}(this.value));
|
||||
othis.parent().data('content', this.value);
|
||||
}(thisElem.value));
|
||||
othis.parent().data('content', thisElem.value);
|
||||
othis.remove();
|
||||
});
|
||||
|
||||
@ -1851,13 +1869,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
i1 == 0 && dataTitle.push(item || '');
|
||||
});
|
||||
layui.each(table.clearCacheKey(item1), function(i2, item2){
|
||||
vals.push(item2);
|
||||
vals.push('"'+ (item2 || '') +'"');
|
||||
});
|
||||
} else {
|
||||
table.eachCols(id, function(i3, item3){
|
||||
if(item3.field && item3.type == 'normal' && !item3.hide){
|
||||
i1 == 0 && dataTitle.push(item3.title || '');
|
||||
vals.push(item1[item3.field]);
|
||||
vals.push('"'+ parseTempData(item3, item1[item3.field], item1, 'text') + '"');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1890,14 +1908,14 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
};
|
||||
|
||||
//表格重载
|
||||
table.reload = function(id, options){
|
||||
options = options || {};
|
||||
|
||||
table.reload = function(id, options, type){
|
||||
var config = getThisTableConfig(id); //获取当前实例配置项
|
||||
if(!config) return;
|
||||
|
||||
if(options.data && options.data.constructor === Array) delete config.data;
|
||||
return table.render($.extend(true, {}, config, options));
|
||||
var that = thisTable.that[id];
|
||||
that.reload(options, type);
|
||||
|
||||
return thisTable.call(that);
|
||||
};
|
||||
|
||||
//核心入口
|
||||
|
424
src/lay/modules/transfer.js
Normal file
424
src/lay/modules/transfer.js
Normal file
@ -0,0 +1,424 @@
|
||||
/**
|
||||
|
||||
@Name:layui.transfer 穿梭框
|
||||
@Author:star1029
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
layui.define('form', function(exports){
|
||||
"use strict";
|
||||
var form = layui.form
|
||||
,$ = layui.$
|
||||
|
||||
//外部接口
|
||||
,transfer = {
|
||||
config: {}
|
||||
,index: layui.transfer ? (layui.transfer.index + 10000) : 0
|
||||
|
||||
//设置全局项
|
||||
,set: function(options){
|
||||
var that = this;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
}
|
||||
|
||||
//操作当前实例
|
||||
,thisTran = function(){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
|
||||
return {
|
||||
getValue: function(){
|
||||
return that.getValue();
|
||||
}
|
||||
,config: options
|
||||
}
|
||||
}
|
||||
|
||||
//字符常量
|
||||
,MOD_NAME = 'transfer', ELEM_VIEW = 'layui-transfer', TRAN_LEFT = 'layui-transfer-left', TRAN_RIGHT = 'layui-transfer-right', TRAN_LEFT_LIST = 'layui-transfer-dataLeft'
|
||||
,TRAN_RIGHT_LIST = 'layui-transfer-dataRight' ,TRAN_BTN_LEFT = 'layui-transfer-btnLeft', TRAN_BTN_RIGHT = 'layui-transfer-btnRight', TRAN_BTN_DIS = 'layui-btn-disabled'
|
||||
|
||||
//构造器
|
||||
,Class = function(options){
|
||||
var that = this;
|
||||
that.index = ++transfer.index;
|
||||
that.config = $.extend({}, that.config, transfer.config, options);
|
||||
that.render();
|
||||
};
|
||||
|
||||
//默认配置
|
||||
Class.prototype.config = {
|
||||
title: ['列表一', '列表二']
|
||||
,data: [] //数据源
|
||||
,value: [] //选中的数据
|
||||
,showSearch: false //是否开启搜索
|
||||
,id: '' //唯一 ID 标识
|
||||
};
|
||||
|
||||
//穿梭框渲染
|
||||
Class.prototype.render = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,listLeft = '' ,listRight = '' , arr = [];
|
||||
|
||||
//格式转化
|
||||
if(typeof options.parseData == 'function'){
|
||||
layui.each(options.data, function(index, item){
|
||||
options.data[index] = options.parseData(item) || item;
|
||||
});
|
||||
};
|
||||
|
||||
//循环列表
|
||||
var num = 0 ,li = '',total1 = 0, total2 = 0;
|
||||
layui.each(options.data, function(index1, item1){
|
||||
num = 0;
|
||||
layui.each(options.value, function(index2, item2){
|
||||
if(item1.value == item2){
|
||||
num = 1;
|
||||
return true;
|
||||
};
|
||||
});
|
||||
li = '<li data-title="'+ item1.title +'"><input lay-skin="primary" type="checkbox" data-index="'+ index1 +'" name="'+ (num == 0 ? 'layTranLeftCheck' : 'layTranRightCheck') +'" title="'+ item1.title +'" value="'+ item1.value +'" class="layui-input" '+ (item1.disabled ? 'disabled' : '') +'></li>';
|
||||
if(num == 0){
|
||||
listLeft += li;
|
||||
total1 += item1.disabled ? 0 : 1;
|
||||
}else{
|
||||
listRight += li;
|
||||
total2 += item1.disabled ? 0 : 1;
|
||||
arr.push(index1);
|
||||
}
|
||||
});
|
||||
|
||||
var temp = ['<div class="layui-transfer layui-form" id="transfer-'+ options.id +'" lay-filter="LAY-Transfer-'+ that.index +'">'
|
||||
,'<div class="layui-transfer-left" data-total="'+ total1 +'">'
|
||||
,'<div class="layui-transfer-topTitle"><input lay-skin="primary" name="layTranLeftCheck" lay-filter="layTranLeftCheckAll" type="checkbox" class="layui-input" title="'+ options.title[0] +'"></div>'
|
||||
,function(){
|
||||
if(options.showSearch){
|
||||
return '<div class="layui-transfer-search"><input class="layui-input" placeholder="关键字搜索"><i class="layui-icon layui-icon-search layui-transfer-searchI"></i></div><ul class="layui-transfer-data layui-transfer-dataLeft short">';
|
||||
}else{
|
||||
return '<ul class="layui-transfer-data layui-transfer-dataLeft">';
|
||||
};
|
||||
return '';
|
||||
}()
|
||||
,listLeft + '</ul>'
|
||||
,'</div>'
|
||||
,'<div class="layui-transfer-btn">'
|
||||
,'<button class="layui-btn layui-btn-primary layui-transfer-btnRight layui-btn-disabled"><i class="layui-icon layui-icon-next"></i></button>'
|
||||
,'<button class="layui-btn layui-btn-primary layui-transfer-btnLeft layui-btn-disabled"><i class="layui-icon layui-icon-prev"></i></button></div>'
|
||||
,'<div class="layui-transfer-right" data-arr="'+ arr +'" data-total="'+ total2 +'">'
|
||||
,'<div class="layui-transfer-topTitle"><input lay-skin="primary" name="layTranRightCheck" lay-filter="layTranRightCheckAll" type="checkbox" class="layui-input" title="'+ options.title[1] +'"></div>'
|
||||
,function(){
|
||||
if(options.showSearch){
|
||||
return '<div class="layui-transfer-search"><input class="layui-input" placeholder="关键字搜索"><i class="layui-icon layui-icon-search layui-transfer-searchI"></i></div><ul class="layui-transfer-data layui-transfer-dataRight short">';
|
||||
}else{
|
||||
return '<ul class="layui-transfer-data layui-transfer-dataRight">';
|
||||
};
|
||||
return '';
|
||||
}()
|
||||
,listRight + '</ul>'
|
||||
,'</div>'
|
||||
,'</div>'].join('');
|
||||
|
||||
//开始插入替代元素
|
||||
var othis = $(options.elem)
|
||||
,hasRender = othis.next('.' + ELEM_VIEW);
|
||||
|
||||
//生成替代元素
|
||||
hasRender[0] && hasRender.remove(); //如果已经渲染,则Rerender
|
||||
|
||||
that.elemTemp = $(temp);
|
||||
|
||||
othis.html(that.elemTemp);
|
||||
that.event();
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
};
|
||||
|
||||
Class.prototype.event = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,elem = that.elemTemp
|
||||
,listLeft = '', listRight = ''
|
||||
,checkTopLeft = elem.find('.'+ TRAN_LEFT).find('.layui-transfer-topTitle').find('input[name="layTranLeftCheck"]')
|
||||
,checkTopRight = elem.find('.'+ TRAN_RIGHT).find('.layui-transfer-topTitle').find('input[name="layTranRightCheck"]')
|
||||
,totalLeft = elem.find('.' + TRAN_LEFT).data('total')
|
||||
,totalRight = elem.find('.' + TRAN_RIGHT).data('total');
|
||||
|
||||
//左选项
|
||||
elem.on('click', 'input[name="layTranLeftCheck"]+', function(){
|
||||
var checkbox = $(this).prev()
|
||||
,checked = checkbox[0].checked
|
||||
,childs = elem.find('.'+ TRAN_LEFT_LIST).find('input[name="layTranLeftCheck"]')
|
||||
,isAll = checkbox.attr('lay-filter') == 'layTranLeftCheckAll';
|
||||
|
||||
if(checkbox[0].disabled) return;
|
||||
//如果是全选/全不选
|
||||
if(isAll){
|
||||
listLeft = '';
|
||||
//如果数据为零,不进行其他操作
|
||||
if(totalLeft == 0){
|
||||
checkbox[0].checked = false;
|
||||
}else{
|
||||
//同步子选项
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled){
|
||||
item.checked = checked;
|
||||
if(checked){
|
||||
listLeft += ($(childs[i]).data("index")) + ',';
|
||||
$(childs[i]).parent("li").addClass("selected");
|
||||
}else{
|
||||
$(childs[i]).parent("li").removeClass("selected");
|
||||
}
|
||||
};
|
||||
});
|
||||
//同步按钮状态
|
||||
if(checked){
|
||||
elem.find('.' + TRAN_BTN_RIGHT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
elem.find('.' + TRAN_BTN_RIGHT).addClass(TRAN_BTN_DIS);
|
||||
};
|
||||
}
|
||||
}else{
|
||||
var num = 1;
|
||||
//单个勾选
|
||||
if(checked){
|
||||
//判断是否全选
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled && !item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果全选,勾选全选按钮
|
||||
if(num == 1){
|
||||
checkTopLeft[0].checked = checked;
|
||||
};
|
||||
//加入列表
|
||||
listLeft += checkbox.data("index") + ',';
|
||||
checkbox.parent("li").addClass("selected");
|
||||
elem.find('.' + TRAN_BTN_RIGHT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
//如果全选状态,更改全选按钮
|
||||
if(checkTopLeft[0].checked){
|
||||
checkTopLeft[0].checked = false;
|
||||
};
|
||||
//移除
|
||||
checkbox.parent("li").removeClass("selected");
|
||||
listLeft = listLeft.replace(checkbox.data('index'),'');
|
||||
childs.each(function(i, item){
|
||||
if(item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果勾选项,更改按钮状态
|
||||
if(num == 1){
|
||||
elem.find('.' + TRAN_BTN_RIGHT).addClass(TRAN_BTN_DIS);
|
||||
};
|
||||
}
|
||||
};
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
});
|
||||
|
||||
//右选项
|
||||
elem.on('click', 'input[name="layTranRightCheck"]+', function(){
|
||||
var checkbox = $(this).prev()
|
||||
,checked = checkbox[0].checked
|
||||
,childs = elem.find('.'+ TRAN_RIGHT_LIST).find('input[name="layTranRightCheck"]')
|
||||
,isAll = checkbox.attr('lay-filter') === 'layTranRightCheckAll';
|
||||
|
||||
if(checkbox[0].disabled) return;
|
||||
//如果是全选/全不选
|
||||
if(isAll){
|
||||
listRight = '';
|
||||
//如果数据为零,不进行其他操作
|
||||
if(totalRight == 0){
|
||||
checkbox[0].checked = false;
|
||||
}else{
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled){
|
||||
item.checked = checked;
|
||||
if(checked){
|
||||
listRight += ($(childs[i]).data("index")) + ',';
|
||||
$(childs[i]).parent("li").addClass("selected");
|
||||
}else{
|
||||
$(childs[i]).parent("li").removeClass("selected");
|
||||
}
|
||||
}
|
||||
});
|
||||
if(checked){
|
||||
elem.find('.' + TRAN_BTN_LEFT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
elem.find('.' + TRAN_BTN_LEFT).addClass(TRAN_BTN_DIS);
|
||||
}
|
||||
};
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
}else{
|
||||
var num = 1;
|
||||
//单个勾选
|
||||
if(checked){
|
||||
//判断是否全选
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled && !item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果全选,勾选全选按钮
|
||||
if(num == 1){
|
||||
checkTopRight[0].checked = checked;
|
||||
};
|
||||
//加入列表
|
||||
listRight += checkbox.data("index") + ',';
|
||||
checkbox.parent("li").addClass("selected");
|
||||
elem.find('.' + TRAN_BTN_LEFT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
//如果全选状态,更改全选按钮
|
||||
if(checkTopRight[0].checked){
|
||||
checkTopRight[0].checked = false;
|
||||
};
|
||||
//移除
|
||||
checkbox.parent("li").removeClass("selected");
|
||||
listRight = listRight.replace(checkbox.data('index'),'');
|
||||
childs.each(function(i, item){
|
||||
if(item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果勾选项,更改按钮状态
|
||||
if(num == 1){
|
||||
elem.find('.' + TRAN_BTN_LEFT).addClass(TRAN_BTN_DIS);
|
||||
};
|
||||
}
|
||||
};
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
});
|
||||
|
||||
//查找
|
||||
function searchVal(tran){
|
||||
var input = elem.find(tran).find('.layui-transfer-search')
|
||||
,val = input.children('input').val()
|
||||
,warp = input.next();
|
||||
|
||||
warp.children("li").each(function(){
|
||||
if($(this).data("title").indexOf(val) == -1){
|
||||
$(this).hide();
|
||||
}else{
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//添加到右边
|
||||
elem.on('click', '.'+TRAN_BTN_RIGHT, function(){
|
||||
var preList = '';
|
||||
//未选中则不操作
|
||||
if($(this).hasClass(TRAN_BTN_DIS)){
|
||||
return ;
|
||||
};
|
||||
//选项移除
|
||||
elem.find("."+ TRAN_LEFT_LIST).find("li").each(function(){
|
||||
if($(this).hasClass("selected")){
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
//选项插入
|
||||
var arr = elem.find('.' + TRAN_RIGHT).data('arr')
|
||||
,add = 0;
|
||||
layui.each(listLeft.split(','), function(index, num){
|
||||
if(!num) return;
|
||||
var data = options.data[num];
|
||||
preList += '<li data-title="'+ data.title +'"><input lay-skin="primary" type="checkbox" data-index="'+ num +'" name="layTranRightCheck" title="'+ data.title +'" value="'+ data.value +'" class="layui-input" '+ (data.disabled ? 'disabled' : '') +'></li>'
|
||||
arr += ',' + num;
|
||||
add++;
|
||||
});
|
||||
elem.find("."+ TRAN_RIGHT_LIST).append(preList);
|
||||
searchVal('.'+TRAN_RIGHT);
|
||||
//更新状态
|
||||
checkTopLeft[0].checked = false;
|
||||
checkTopRight[0].checked = false;
|
||||
$(this).addClass(TRAN_BTN_DIS);
|
||||
listLeft = '';
|
||||
//更改缓存数据
|
||||
totalRight = totalRight + add;
|
||||
totalLeft = totalLeft - add;
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalRight);
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalLeft);
|
||||
elem.find('.' + TRAN_RIGHT).data('arr', arr);
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
options.onchange && options.onchange(that.getValue());
|
||||
});
|
||||
|
||||
//添加到左边
|
||||
elem.on('click', '.'+TRAN_BTN_LEFT, function(){
|
||||
var preList = '';
|
||||
if($(this).hasClass(TRAN_BTN_DIS)){
|
||||
return ;
|
||||
};
|
||||
//选项移除
|
||||
elem.find("."+ TRAN_RIGHT_LIST).find("li").each(function(){
|
||||
if($(this).hasClass("selected")){
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
//选项插入
|
||||
var arr = elem.find('.' + TRAN_RIGHT).data('arr')
|
||||
,add = 0;
|
||||
layui.each(listRight.split(','), function(index, num){
|
||||
if(!num) return;
|
||||
var data = options.data[num];
|
||||
preList += '<li data-title="'+ data.title +'"><input lay-skin="primary" type="checkbox" data-index="'+ num +'" name="layTranLeftCheck" title="'+ data.title +'" value="'+ data.value +'" class="layui-input" '+ (data.disabled ? 'disabled' : '') +'></li>'
|
||||
arr = arr.replace(num, '').replace(/(,)+/g,',');
|
||||
add++;
|
||||
});
|
||||
elem.find("."+ TRAN_LEFT_LIST).append(preList);
|
||||
searchVal('.'+TRAN_LEFT);
|
||||
//更新状态
|
||||
checkTopLeft[0].checked = false;
|
||||
checkTopRight[0].checked = false;
|
||||
$(this).addClass(TRAN_BTN_DIS);
|
||||
listRight = '';
|
||||
//更改缓存数据
|
||||
totalRight = totalRight - add;
|
||||
totalLeft = totalLeft + add;
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalRight);
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalLeft);
|
||||
elem.find('.' + TRAN_RIGHT).data('arr', arr);
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
options.onchange && options.onchange(that.getValue());
|
||||
});
|
||||
|
||||
//搜索
|
||||
elem.find('.layui-transfer-search').on('keyup', 'input', function(){
|
||||
var outer = $(this).parent("div").parent("div");
|
||||
searchVal(outer);
|
||||
});
|
||||
};
|
||||
|
||||
//得到选中值
|
||||
Class.prototype.getValue = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,arr = that.elemTemp.find('.' + TRAN_RIGHT).data('arr')
|
||||
,data = [];
|
||||
|
||||
function sortNum(a,b){ return a - b };
|
||||
layui.each(arr.split(',').sort(sortNum), function(index, num){
|
||||
if(!num) return;
|
||||
data.push(options.data[num]);
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
//核心入口
|
||||
transfer.render = function(options){
|
||||
var inst = new Class(options);
|
||||
return thisTran.call(inst);
|
||||
};
|
||||
|
||||
exports(MOD_NAME, transfer);
|
||||
})
|
File diff suppressed because it is too large
Load Diff
@ -38,6 +38,9 @@ layui.define('layer' , function(exports){
|
||||
upload: function(files){
|
||||
that.upload.call(that, files);
|
||||
}
|
||||
,reload: function(options){
|
||||
that.reload.call(that, options);
|
||||
}
|
||||
,config: that.config
|
||||
}
|
||||
}
|
||||
@ -63,6 +66,7 @@ layui.define('layer' , function(exports){
|
||||
,bindAction: '' //手动上传触发的元素
|
||||
,url: '' //上传地址
|
||||
,field: 'file' //文件字段名
|
||||
,acceptMime: '' //筛选出的文件类型,默认为所有文件
|
||||
,method: 'post' //请求上传的 http 类型
|
||||
,data: {} //请求上传的额外参数
|
||||
,drag: true //是否允许拖拽上传
|
||||
@ -403,6 +407,20 @@ layui.define('layer' , function(exports){
|
||||
send();
|
||||
};
|
||||
|
||||
//重置方法
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this
|
||||
,options = that.config = $.extend({}, that.config, upload.config, options)
|
||||
,next = options.elem.next();
|
||||
|
||||
//更新文件域相关属性
|
||||
next.attr({
|
||||
name: options.name
|
||||
,accept: options.acceptMime
|
||||
,multiple: options.multiple
|
||||
});
|
||||
};
|
||||
|
||||
//事件处理
|
||||
Class.prototype.events = function(){
|
||||
var that = this
|
||||
|
@ -171,6 +171,16 @@ layui.define('jquery', function(exports){
|
||||
.replace(/</g, '<').replace(/>/g, '>')
|
||||
.replace(/'/g, ''').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
//批量事件
|
||||
,event: function(attr, obj, eventType){
|
||||
obj = util.event[attr] = $.extend(true, util.event[attr], obj) || {};
|
||||
$('body').on(eventType || 'click', '*['+ attr +']', function(){
|
||||
var othis = $(this)
|
||||
,key = othis.attr(attr);
|
||||
obj[key] && obj[key].call(this, othis);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//监听 DOM 尺寸变化,该创意来自:http://benalman.com/projects/jquery-resize-plugin/
|
||||
|
@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
,Layui = function(){
|
||||
this.v = '2.4.5'; //版本号
|
||||
this.v = '2.5.0'; //版本号
|
||||
}
|
||||
|
||||
//获取layui所在目录
|
||||
@ -56,6 +56,7 @@
|
||||
,layedit: 'modules/layedit' //富文本编辑器
|
||||
,form: 'modules/form' //表单集
|
||||
,upload: 'modules/upload' //上传
|
||||
,transfer: 'modules/transfer' //上传
|
||||
,tree: 'modules/tree' //树结构
|
||||
,table: 'modules/table' //表格
|
||||
,element: 'modules/element' //常用元素操作
|
||||
@ -98,7 +99,7 @@
|
||||
deps = []
|
||||
);
|
||||
|
||||
if(layui['layui.all'] || (!layui['layui.all'] && layui['layui.mobile'])){
|
||||
if((!layui['layui.all'] && layui['layui.mobile'])){
|
||||
return callback.call(that);
|
||||
}
|
||||
|
||||
@ -154,7 +155,7 @@
|
||||
: ( typeof callback === 'function' && callback.apply(layui, exports) );
|
||||
}
|
||||
|
||||
//如果使用了 layui.all.js
|
||||
//如果引入了完整库(layui.all.js),内置的模块则不必再加载
|
||||
if(apps.length === 0
|
||||
|| (layui['layui.all'] && modules[item])
|
||||
|| (!layui['layui.all'] && layui['layui.mobile'] && modules[item])
|
||||
|
Loading…
Reference in New Issue
Block a user