1.0.4 pro

This commit is contained in:
sentsin 2016-11-18 15:03:44 +08:00
parent bb6f99343f
commit 660083897d
8 changed files with 21 additions and 14 deletions

View File

@ -1,7 +1,7 @@
# v1.0.4 2016-11-18
* Tab选项卡新增用于添加Tab选项的接口element.tabAdd(filter, index);
* Tab选项卡新增用于添加Tab选项的接口element.tabAdd(filter, options);
* Tab选项卡新增用于外部删除Tab选项的接口element.tabDelete(filter, index);
* Tab选项卡新增用于动态切换的接口element.tabChange(filter, index);
* 表单组select、checkbox、radio等新增 disabled 属性的禁用支持

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/** layui-v1.0.4 LGPL license By www.layui.com */
;layui.define(function(a){"use strict";function t(a){new p(a)}var e=document,r="getElementById",n="getElementsByTagName",s=0,p=function(a){var t=this,e=t.config=a||{};e.item=s++,t.render(!0)};p.on=function(a,t,e){return a.attachEvent?a.attachEvent("on"+t,function(){e.call(a,window.even)}):a.addEventListener(t,e,!1),p},p.prototype.type=function(){var a=this.config;if("object"==typeof a.cont)return void 0===a.cont.length?2:3},p.prototype.view=function(){var a=this,t=a.config,e=[],r={};if(t.pages=0|t.pages,t.curr=0|t.curr||1,t.groups="groups"in t?0|t.groups:5,t.first="first"in t?t.first:"&#x9996;&#x9875;",t.last="last"in t?t.last:"&#x672B;&#x9875;",t.prev="prev"in t?t.prev:"&#x4E0A;&#x4E00;&#x9875;",t.next="next"in t?t.next:"&#x4E0B;&#x4E00;&#x9875;",t.pages<=1)return"";for(t.groups>t.pages&&(t.groups=t.pages),r.index=Math.ceil((t.curr+(t.groups>1&&t.groups!==t.pages?1:0))/(0===t.groups?1:t.groups)),t.curr>1&&t.prev&&e.push('<a href="javascript:;" class="layui-laypage-prev" data-page="'+(t.curr-1)+'">'+t.prev+"</a>"),r.index>1&&t.first&&0!==t.groups&&e.push('<a href="javascript:;" class="laypage_first" data-page="1" title="&#x9996;&#x9875;">'+t.first+"</a><span>&#x2026;</span>"),r.poor=Math.floor((t.groups-1)/2),r.start=r.index>1?t.curr-r.poor:1,r.end=r.index>1?function(){var a=t.curr+(t.groups-r.poor-1);return a>t.pages?t.pages:a}():t.groups,r.end-r.start<t.groups-1&&(r.start=r.end-t.groups+1);r.start<=r.end;r.start++)r.start===t.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(t.skin)?'style="background-color:'+t.skin+";":"")+'"></em><em>'+r.start+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r.start+'">'+r.start+"</a>");return t.pages>t.groups&&r.end<t.pages&&t.last&&0!==t.groups&&e.push('<span>&#x2026;</span><a href="javascript:;" class="layui-laypage-last" title="&#x5C3E;&#x9875;" data-page="'+t.pages+'">'+t.last+"</a>"),r.flow=!t.prev&&0===t.groups,(t.curr!==t.pages&&t.next||r.flow)&&e.push(function(){return r.flow&&t.curr===t.pages?'<span class="layui-laypage-nomore" title="&#x5DF2;&#x6CA1;&#x6709;&#x66F4;&#x591A;">'+t.next+"</span>":'<a href="javascript:;" class="layui-laypage-next" data-page="'+(t.curr+1)+'">'+t.next+"</a>"}()),'<div class="layui-box layui-laypage layui-laypage-'+(t.skin?function(a){return/^#/.test(a)?"molv":a}(t.skin):"default")+'" id="layui-laypage-'+a.config.item+'">'+e.join("")+function(){return t.skip?'<span class="layui-laypage-total">&#x5230;&#x7B2C; <input type="number" min="1" onkeyup="this.value=this.value.replace(/\\D/, \'\');" value="'+t.curr+'" class="layui-laypage-skip"> &#x9875; <button type="button" class="layui-laypage-btn">&#x786e;&#x5b9a;</button></span>':""}()+"</div>"},p.prototype.jump=function(a){if(a){for(var t=this,e=t.config,r=a.children,s=a[n]("button")[0],i=a[n]("input")[0],u=0,o=r.length;u<o;u++)"a"===r[u].nodeName.toLowerCase()&&p.on(r[u],"click",function(){var a=0|this.getAttribute("data-page");e.curr=a,t.render()});s&&p.on(s,"click",function(){var a=0|i.value.replace(/\s|\D/g,"");a&&a<=e.pages&&(e.curr=a,t.render())})}},p.prototype.render=function(a){var t=this,n=t.config,s=t.type(),p=t.view();2===s?n.cont.innerHTML=p:3===s?n.cont.html(p):e[r](n.cont).innerHTML=p,n.jump&&n.jump(n,a),t.jump(e[r]("layui-laypage-"+n.item)),n.hash&&!a&&(location.hash="!"+n.hash+"="+n.curr)},a("laypage",t)});
;layui.define(function(a){"use strict";function t(a){new p(a)}var e=document,r="getElementById",n="getElementsByTagName",s=0,p=function(a){var t=this,e=t.config=a||{};e.item=s++,t.render(!0)};p.on=function(a,t,e){return a.attachEvent?a.attachEvent("on"+t,function(){e.call(a,window.even)}):a.addEventListener(t,e,!1),p},p.prototype.type=function(){var a=this.config;if("object"==typeof a.cont)return void 0===a.cont.length?2:3},p.prototype.view=function(){var a=this,t=a.config,e=[],r={};if(t.pages=0|t.pages,t.curr=0|t.curr||1,t.groups="groups"in t?0|t.groups:5,t.first="first"in t?t.first:"&#x9996;&#x9875;",t.last="last"in t?t.last:"&#x672B;&#x9875;",t.prev="prev"in t?t.prev:"&#x4E0A;&#x4E00;&#x9875;",t.next="next"in t?t.next:"&#x4E0B;&#x4E00;&#x9875;",t.pages<=1)return"";for(t.groups>t.pages&&(t.groups=t.pages),r.index=Math.ceil((t.curr+(t.groups>1&&t.groups!==t.pages?1:0))/(0===t.groups?1:t.groups)),t.curr>1&&t.prev&&e.push('<a href="javascript:;" class="layui-laypage-prev" data-page="'+(t.curr-1)+'">'+t.prev+"</a>"),r.index>1&&t.first&&0!==t.groups&&e.push('<a href="javascript:;" class="laypage_first" data-page="1" title="&#x9996;&#x9875;">'+t.first+"</a><span>&#x2026;</span>"),r.poor=Math.floor((t.groups-1)/2),r.start=r.index>1?t.curr-r.poor:1,r.end=r.index>1?function(){var a=t.curr+(t.groups-r.poor-1);return a>t.pages?t.pages:a}():t.groups,r.end-r.start<t.groups-1&&(r.start=r.end-t.groups+1);r.start<=r.end;r.start++)r.start===t.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(t.skin)?'style="background-color:'+t.skin+';"':"")+"></em><em>"+r.start+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r.start+'">'+r.start+"</a>");return t.pages>t.groups&&r.end<t.pages&&t.last&&0!==t.groups&&e.push('<span>&#x2026;</span><a href="javascript:;" class="layui-laypage-last" title="&#x5C3E;&#x9875;" data-page="'+t.pages+'">'+t.last+"</a>"),r.flow=!t.prev&&0===t.groups,(t.curr!==t.pages&&t.next||r.flow)&&e.push(function(){return r.flow&&t.curr===t.pages?'<span class="layui-laypage-nomore" title="&#x5DF2;&#x6CA1;&#x6709;&#x66F4;&#x591A;">'+t.next+"</span>":'<a href="javascript:;" class="layui-laypage-next" data-page="'+(t.curr+1)+'">'+t.next+"</a>"}()),'<div class="layui-box layui-laypage layui-laypage-'+(t.skin?function(a){return/^#/.test(a)?"molv":a}(t.skin):"default")+'" id="layui-laypage-'+a.config.item+'">'+e.join("")+function(){return t.skip?'<span class="layui-laypage-total">&#x5230;&#x7B2C; <input type="number" min="1" onkeyup="this.value=this.value.replace(/\\D/, \'\');" value="'+t.curr+'" class="layui-laypage-skip"> &#x9875; <button type="button" class="layui-laypage-btn">&#x786e;&#x5b9a;</button></span>':""}()+"</div>"},p.prototype.jump=function(a){if(a){for(var t=this,e=t.config,r=a.children,s=a[n]("button")[0],i=a[n]("input")[0],u=0,o=r.length;u<o;u++)"a"===r[u].nodeName.toLowerCase()&&p.on(r[u],"click",function(){var a=0|this.getAttribute("data-page");e.curr=a,t.render()});s&&p.on(s,"click",function(){var a=0|i.value.replace(/\s|\D/g,"");a&&a<=e.pages&&(e.curr=a,t.render())})}},p.prototype.render=function(a){var t=this,n=t.config,s=t.type(),p=t.view();2===s?n.cont.innerHTML=p:3===s?n.cont.html(p):e[r](n.cont).innerHTML=p,n.jump&&n.jump(n,a),t.jump(e[r]("layui-laypage-"+n.item)),n.hash&&!a&&(location.hash="!"+n.hash+"="+n.curr)},a("laypage",t)});

View File

@ -270,13 +270,13 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-flow-more a i{font-size: 30px; color: #737383;}
/** 分页 **/
.layui-laypage{display: inline-block; *display: block; *zoom: 1; vertical-align: middle; margin: 10px 0; background-color: #fff; font-size: 0;}
.layui-laypage{display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; margin: 10px 0; font-size: 0;}
.layui-laypage>*:first-child,
.layui-laypage>*:first-child em{border-radius: 2px 0 0 2px;}
.layui-laypage>*:last-child,
.layui-laypage>*:last-child em{border-radius: 0 2px 2px 0;}
.layui-laypage span,
.layui-laypage a{display: inline-block; *display: block; *zoom: 1; vertical-align: middle; padding: 0 15px; border: 1px solid #e2e2e2; height: 28px; line-height: 28px; margin: 0 -1px 5px 0; color: #333; font-size: 12px;}
.layui-laypage a{display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; padding: 0 15px; border: 1px solid #e2e2e2; height: 28px; line-height: 28px; margin: 0 -1px 5px 0; background-color: #fff; color: #333; font-size: 12px;}
.layui-laypage em{font-style: normal;}
.layui-laypage span{color:#999; font-weight: 700;}
.layui-laypage a{ text-decoration: none;}
@ -287,8 +287,8 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-laypage-prev em,
.layui-laypage-next em{font-family: Sim sun; font-size: 16px;}
.layui-laypage .layui-laypage-total{border: none;font-weight: 400;}
.layui-laypage input, .layui-laypage button{height: 30px; line-height: 30px; border:1px solid #e2e2e2; border-radius: 2px; vertical-align: middle; background-color: #fff; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
.layui-laypage .layui-laypage-total{height: 30px; line-height: 30px; margin-left: 1px; border: none;font-weight: 400;}
.layui-laypage input, .layui-laypage button{height: 30px; line-height: 30px; border:1px solid #e2e2e2; border-radius: 2px; vertical-align: top; background-color: #fff; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
.layui-laypage input{width: 50px; margin: 0 5px; text-align: center;}
.layui-laypage button{margin-left: 5px; padding:0 15px; cursor: pointer;}
@ -316,7 +316,7 @@ a cite{font-style: normal; *cursor:pointer;}
/** 导航菜单 **/
.layui-nav{position: relative; padding: 0 20px; background-color: #393D49; color: #c2c2c2; border-radius: 2px; font-size: 0; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
.layui-nav *{font-size: 14px;}
.layui-nav .layui-nav-item{position: relative; display: inline-block; vertical-align: middle; line-height: 60px;}
.layui-nav .layui-nav-item{position: relative; display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; line-height: 60px;}
.layui-nav .layui-nav-item a{display: block; padding: 0 20px; color: #c2c2c2; transition: all .3s; -webkit-transition: all .3s;}
.layui-nav-bar,
.layui-nav .layui-this:after{position: absolute; left: 0; top: 0; width: 0; height: 5px; background-color: #5FB878; transition: all .2s; -webkit-transition: all .2s;}
@ -366,7 +366,7 @@ a cite{font-style: normal; *cursor:pointer;}
/** Tab选项卡 **/
.layui-tab{margin: 10px 0; overflow: hidden; text-align: left !important;}
.layui-tab-title{position: relative; left: 0; height: 40px; white-space: nowrap; font-size: 0; border-bottom: 1px solid #e2e2e2; transition: all .2s; -webkit-transition: all .2s;}
.layui-tab-title li{display: inline-block; *display: block; *zoom: 1; vertical-align: middle; font-size: 14px; transition: all .3s; -webkit-transition: all .3s;}
.layui-tab-title li{display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; font-size: 14px; transition: all .3s; -webkit-transition: all .3s;}
.layui-tab-title li{position: relative; line-height: 40px; min-width: 65px; padding: 0 10px; text-align: center; cursor: pointer;}
.layui-tab-title .layui-this{color: #000;}

View File

@ -81,7 +81,7 @@ layui.define(function(exports){
}
for(; dict.start <= dict.end; dict.start++){
if(dict.start === conf.curr){
view.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+ (/^#/.test(conf.skin) ? 'style="background-color:'+ conf.skin +';' : '') +'"></em><em>'+ dict.start +'</em></span>');
view.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+ (/^#/.test(conf.skin) ? 'style="background-color:'+ conf.skin +';"' : '') +'></em><em>'+ dict.start +'</em></span>');
} else {
view.push('<a href="javascript:;" data-page="'+ dict.start +'">'+ dict.start +'</a>');
}

View File

@ -34,7 +34,14 @@ body{padding: 10px;}
<ul class="layui-nav">
<li class="layui-nav-item"><a href="">最新活动</a></li>
<li class="layui-nav-item layui-this"><a href="">产品</a></li>
<li class="layui-nav-item layui-this">
<a href="">产品</a>
<dl class="layui-nav-child">
<dd><a href="">选项1</a></dd>
<dd><a href="">选项2</a></dd>
<dd><a href="">选项3</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href="">大数据</a></li>
<li class="layui-nav-item">
<a href="javascript:;">解决方案</a>
@ -44,7 +51,7 @@ body{padding: 10px;}
<dd><a href="">电商平台</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href="">社区</a></li>
</ul>
<br><br>