This commit is contained in:
sentsin
2017-09-13 16:06:55 +08:00
parent 6dfdf4b664
commit 5a9b861989
47 changed files with 230 additions and 122 deletions

View File

@@ -22,12 +22,11 @@ pre{white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; w
/** 图标字体 **/
@font-face {font-family: 'layui-icon';
src: url('../font/iconfont.eot?v=2');
src: url('../font/iconfont.eot?v=2#iefix') format('embedded-opentype'),
url('../font/iconfont.svg?v=2#iconfont') format('svg'),
url('../font/iconfont.woff?v=2') format('woff'),
url('../font/iconfont.ttf?v=2') format('truetype');
src: url('../font/iconfont.eot?v=213');
src: url('../font/iconfont.eot?v=213#iefix') format('embedded-opentype'),
url('../font/iconfont.svg?v=213#iconfont') format('svg'),
url('../font/iconfont.woff?v=213') format('woff'),
url('../font/iconfont.ttf?v=213') format('truetype');
}
.layui-icon{
@@ -256,7 +255,7 @@ a cite{font-style: normal; *cursor:pointer;}
/** 页面元素 **/
.layui-btn, .layui-input, .layui-textarea, .layui-upload-button, .layui-select{outline: none; -webkit-transition: border-color .3s cubic-bezier(.65,.05,.35,.5); transition: border-color .3s cubic-bezier(.65,.05,.35,.5); box-sizing: border-box;}
.layui-btn, .layui-input, .layui-textarea, .layui-upload-button, .layui-select{outline: none; transition: all .3s; -webkit-transition: all .3s; box-sizing: border-box;}
/* 引用 */.layui-elem-quote{margin-bottom: 10px; padding: 15px; line-height: 22px; border-left: 5px solid #009688; border-radius: 0 2px 2px 0; background-color: #f2f2f2;}
.layui-quote-nm{border-color: #e2e2e2; border-style: solid; border-width: 1px; border-left-width: 5px; background: none;}

View File

@@ -0,0 +1,16 @@
/** 图标字体 **/
@font-face {font-family: 'laydate-icon';
src: url('./font/iconfont.eot');
src: url('./font/iconfont.eot#iefix') format('embedded-opentype'),
url('./font/iconfont.svg#iconfont') format('svg'),
url('./font/iconfont.woff') format('woff'),
url('./font/iconfont.ttf') format('truetype');
}
.laydate-icon{
font-family:"laydate-icon" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@@ -12,7 +12,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
.layui-layer-shade, .layui-layer{position:fixed; _position:absolute; pointer-events: auto;}
.layui-layer-shade{top:0; left:0; width:100%; height:100%; _height:expression(document.body.offsetHeight+"px");}
.layui-layer{-webkit-overflow-scrolling: touch;}
.layui-layer{top:150px; left: 0; margin:0; padding:0; background-color:#fff; -webkit-background-clip: content; box-shadow: 1px 1px 50px rgba(0,0,0,.3);}
.layui-layer{top:150px; left: 0; margin:0; padding:0; background-color:#fff; -webkit-background-clip: content; border-radius: 2px; box-shadow: 1px 1px 50px rgba(0,0,0,.3);}
.layui-layer-close{position:absolute;}
.layui-layer-content{position:relative;}
.layui-layer-border{border: 1px solid #B2B2B2; border: 1px solid rgba(0,0,0,.1); box-shadow: 1px 1px 5px rgba(0,0,0,.2);}
@@ -26,7 +26,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
.layui-layer-resize{position: absolute; width: 15px; height: 15px; right: 0; bottom: 0; cursor: se-resize;}
/* 动画 */
.layui-layer{border-radius: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration:.3s; animation-duration:.3s;}
.layer-anim{-webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration:.3s; animation-duration:.3s;}
@-webkit-keyframes layer-bounceIn { /* 默认 */
0% {opacity: 0; -webkit-transform: scale(.5); transform: scale(.5)}
@@ -36,7 +36,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
0% {opacity: 0; -webkit-transform: scale(.5); -ms-transform: scale(.5); transform: scale(.5)}
100% {opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1)}
}
.layer-anim{-webkit-animation-name: layer-bounceIn;animation-name: layer-bounceIn}
.layer-anim-00{-webkit-animation-name: layer-bounceIn;animation-name: layer-bounceIn}
@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}
@@ -172,7 +172,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
30% {-webkit-transform: scale(1.05); -ms-transform: scale(1.05); transform: scale(1.05);}
0% {-webkit-transform: scale(1); -ms-transform: scale(1);transform: scale(1);}
}
.layer-anim-close{-webkit-animation-name: layer-bounceOut;animation-name: layer-bounceOut; -webkit-animation-duration:.2s; animation-duration:.2s;}
.layer-anim-close{-webkit-animation-name: layer-bounceOut; animation-name: layer-bounceOut; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration:.2s; animation-duration:.2s;}
@media screen and (max-width: 1100px) {
.layui-layer-iframe{overflow-y: auto; -webkit-overflow-scrolling: touch;}

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -35,10 +35,9 @@ layui.define('layer', function(exports){
/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/
,'链接格式不正确'
]
,number: [
/^\d+$/
,'只能填写数字'
]
,number: function(value){
if(!value || isNaN(value)) return '只能填写数字'
}
,date: [
/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/
,'日期格式不正确'

View File

@@ -1,6 +1,6 @@
/**
@Name : layDate 5.0.5 日期时间控件
@Name : layDate 5.0.6 日期时间控件
@Author: 贤心
@Sitehttp://www.layui.com/laydate/
@LicenseMIT
@@ -55,7 +55,7 @@
}
,laydate = {
v: '5.0.5'
v: '5.0.6'
,config: {} //全局配置项
,index: (window.laydate && window.laydate.v) ? 100000 : 0
,path: ready.getPath
@@ -92,7 +92,7 @@
//字符常量
,MOD_NAME = 'laydate', ELEM = '.layui-laydate', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'laydate-disabled', TIPS_OUT = '开始日期超出了结束日期<br>建议重新选择', LIMIT_YEAR = [100, 200000]
,ELEM_LIST = 'layui-laydate-list', ELEM_SELECTED = 'laydate-selected', ELEM_HINT = 'layui-laydate-hint', ELEM_PREV = 'laydate-day-prev', ELEM_NEXT = 'laydate-day-next', ELEM_FOOTER = 'layui-laydate-footer', ELEM_CONFIRM = '.laydate-btns-confirm', ELEM_TIME_TEXT = 'laydate-time-text', ELEM_TIME_BTN = '.laydate-btns-time'
,ELEM_STATIC = 'layui-laydate-static', ELEM_LIST = 'layui-laydate-list', ELEM_SELECTED = 'laydate-selected', ELEM_HINT = 'layui-laydate-hint', ELEM_PREV = 'laydate-day-prev', ELEM_NEXT = 'laydate-day-next', ELEM_FOOTER = 'layui-laydate-footer', ELEM_CONFIRM = '.laydate-btns-confirm', ELEM_TIME_TEXT = 'laydate-time-text', ELEM_TIME_BTN = '.laydate-btns-time'
//组件构造器
,Class = function(options){
@@ -456,21 +456,25 @@
that.EXP_SPLIT = '';
lay.each(that.format, function(i, item){
var EXP = new RegExp(dateType).test(item)
? '\\b\\d{1,'+ function(){
if(/yyyy/.test(item)) return 4;
if(/y/.test(item)) return 308;
return 2;
}() +'}\\b'
? '\\d{'+ function(){
if(new RegExp(dateType).test(that.format[i === 0 ? i + 1 : i - 1]||'')){
if(/^yyyy|y$/.test(item)) return 4;
return item.length;
}
if(/^yyyy$/.test(item)) return '1,4';
if(/^y$/.test(item)) return '1,308';
return '1,2';
}() +'}'
: '\\' + item;
that.EXP_IF = that.EXP_IF + EXP;
that.EXP_SPLIT = that.EXP_SPLIT + (that.EXP_SPLIT ? '|' : '') + '('+ EXP + ')';
that.EXP_SPLIT = that.EXP_SPLIT + '(' + EXP + ')';
});
that.EXP_IF = new RegExp('^'+ (
options.range ?
that.EXP_IF + '\\s\\'+ options.range + '\\s' + that.EXP_IF
: that.EXP_IF
) +'$');
that.EXP_SPLIT = new RegExp(that.EXP_SPLIT, 'g');
that.EXP_SPLIT = new RegExp('^'+ that.EXP_SPLIT +'$', '');
//如果不是input|textarea元素则默认采用click事件
if(!that.isInput(options.elem[0])){
@@ -557,7 +561,7 @@
,'class': [
'layui-laydate'
,options.range ? ' layui-laydate-range' : ''
,isStatic ? ' layui-laydate-static' : ''
,isStatic ? (' '+ ELEM_STATIC) : ''
,options.theme && options.theme !== 'default' && !/^#/.test(options.theme) ? (' laydate-theme-' + options.theme) : ''
].join('')
})
@@ -702,7 +706,7 @@
}
//移除上一个控件
that.remove();
that.remove(Class.thisElem);
//如果是静态定位则插入到指定的容器中否则插入到body
isStatic ? options.elem.append(elem) : (
@@ -721,11 +725,11 @@
};
//控件移除
Class.prototype.remove = function(){
Class.prototype.remove = function(prev){
var that = this
,options = that.config
,elem = lay('#'+ that.elemID);
if(elem[0] && options.position !== 'static'){
,elem = lay('#'+ (prev || that.elemID));
if(elem[0] && !elem.hasClass(ELEM_STATIC)){
that.checkDate(function(){
elem.remove();
});
@@ -844,7 +848,7 @@
//获得初始化日期值
,initDate = function(dateTime, value, index){
var startEnd = ['startTime', 'endTime'];
value = value.match(that.EXP_SPLIT);
value = (value.match(that.EXP_SPLIT) || []).slice(1);
index = index || 0;
if(options.range){
that[startEnd[index]] = that[startEnd[index]] || {};
@@ -1288,16 +1292,13 @@
}
lay(ol).find('.'+ THIS).removeClass(THIS);
lay(this).addClass(THIS);
//同步按钮可点状态
that.setBtnStatus(
null
,lay.extend({}, that.systemDate(), that.startTime)
,lay.extend({}, that.systemDate(), that.endTime)
);
setTimeStatus();
scroll();
(that.endDate || options.type === 'time') && that.done(null, 'change');
//同步按钮可点状态
that.setBtnStatus();
});
});
}
@@ -1325,7 +1326,7 @@
var that = this
,options = that.config
,isOut, elemBtn = lay(that.footer).find(ELEM_CONFIRM)
,isAlone = options.range && options.type !== 'date' && options.type !== 'datetime';
,isAlone = options.range && options.type !== 'date' && options.type !== 'time';
if(isAlone){
start = start || that.startDate;
end = end || that.endDate;

View File

@@ -25,7 +25,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
//获取节点的style属性值
getStyle: function(node, name){
var style = node.currentStyle ? node.currentStyle : win.getComputedStyle(node, null);
var style = node.currentStyle ? node.currentStyle : window.getComputedStyle(node, null);
return style[style.getPropertyValue ? 'getPropertyValue' : 'getAttribute'](name);
},
@@ -62,7 +62,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
//默认内置方法。
var layer = {
v: '3.0.3',
v: '3.1.0',
ie: function(){ //ie版本
var agent = navigator.userAgent.toLowerCase();
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
@@ -83,7 +83,7 @@ var layer = {
isLayui
? layui.addcss('modules/layer/' + options.extend)
: ready.link('skin/' + options.extend);
: ready.link('theme/' + options.extend);
return this;
},
@@ -183,7 +183,7 @@ Class.pt = Class.prototype;
//缓存常用字符
var doms = ['layui-layer', '.layui-layer-title', '.layui-layer-main', '.layui-layer-dialog', 'layui-layer-iframe', 'layui-layer-content', 'layui-layer-btn', 'layui-layer-close'];
doms.anim = ['layer-anim', 'layer-anim-01', 'layer-anim-02', 'layer-anim-03', 'layer-anim-04', 'layer-anim-05', 'layer-anim-06'];
doms.anim = ['layer-anim-00', 'layer-anim-01', 'layer-anim-02', 'layer-anim-03', 'layer-anim-04', 'layer-anim-05', 'layer-anim-06'];
//默认配置
Class.pt.config = {
@@ -219,7 +219,7 @@ Class.pt.vessel = function(conType, callback){
config.zIndex = zIndex;
callback([
//遮罩
config.shade ? ('<div class="layui-layer-shade" id="layui-layer-shade'+ times +'" times="'+ times +'" style="'+ ('z-index:'+ (zIndex-1) +'; background-color:'+ (config.shade[1]||'#000') +'; opacity:'+ (config.shade[0]||config.shade) +'; filter:alpha(opacity='+ (config.shade[0]*100||config.shade*100) +');') +'"></div>') : '',
config.shade ? ('<div class="layui-layer-shade" id="layui-layer-shade'+ times +'" times="'+ times +'" style="'+ ('z-index:'+ (zIndex-1) +'; ') +'"></div>') : '',
//主体
'<div class="'+ doms[0] + (' layui-layer-'+ready.type[config.type]) + (((config.type == 0 || config.type == 2) && !config.shade) ? ' layui-layer-border' : '') + ' ' + (config.skin||'') +'" id="'+ doms[0] + times +'" type="'+ ready.type[config.type] +'" times="'+ times +'" showtime="'+ config.time +'" conType="'+ (conType ? 'object' : 'string') +'" style="z-index: '+ zIndex +'; width:'+ config.area[0] + ';height:' + config.area[1] + (config.fixed ? '' : ';position:absolute;') +'">'
@@ -313,6 +313,12 @@ Class.pt.creat = function(){
that.layero = $('#'+ doms[0] + times);
config.scrollbar || doms.html.css('overflow', 'hidden').attr('layer-full', times);
}).auto(times);
//遮罩
$('#layui-layer-shade'+ that.index).css({
'background-color': config.shade[1] || '#000'
,'opacity': config.shade[0]||config.shade
});
config.type == 2 && layer.ie == 6 && that.layero.find('iframe').attr('src', content[0]);
@@ -333,7 +339,10 @@ Class.pt.creat = function(){
//为兼容jQuery3.0的css动画影响元素尺寸计算
if(doms.anim[config.anim]){
that.layero.addClass(doms.anim[config.anim]);
var animClass = 'layer-anim '+ doms.anim[config.anim];
that.layero.addClass(animClass).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
$(this).removeClass(animClass);
});
};
//记录关闭动画
@@ -911,7 +920,7 @@ layer.close = function(index){
};
if(layero.data('isOutAnim')){
layero.addClass(closeAnim);
layero.addClass('layer-anim '+ closeAnim);
}
$('#layui-layer-moves, #layui-layer-shade' + index).remove();

View File

@@ -600,7 +600,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
if(options.page){
bodyHeight = bodyHeight - parseFloat(that.layTool.outerHeight() + 1);
}
that.layBody.css('height', bodyHeight);
that.layMain.css('height', bodyHeight);
};
//滚动条补丁
@@ -609,6 +610,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
,layMainTable = that.layMain.children('table')
,scollWidth = that.layMain.width() - that.layMain.prop('clientWidth') //纵向滚动条宽度
,scollHeight = that.layMain.height() - that.layMain.prop('clientHeight'); //横向滚动条高度
if(scollWidth && scollHeight){
if(!that.elem.find('.layui-table-patch')[0]){
var patchElem = $('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); //补丁元素
@@ -620,9 +622,17 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
} else {
that.layHeader.eq(0).find('.layui-table-patch').remove();
}
that.layFixed.find(ELEM_BODY).css('height', that.layMain.height() - scollHeight); //固定列区域高度
that.layFixRight[layMainTable.width() > that.layMain.width() ? 'removeClass' : 'addClass'](HIDE); //表格宽度小于容器宽度时,隐藏固定列
that.layFixRight.css('right', scollWidth - 1); //操作栏
//固定列区域高度
var mainHeight = that.layMain.height()
,fixHeight = mainHeight - scollHeight;
that.layFixed.find(ELEM_BODY).css('height', layMainTable.height() > fixHeight ? fixHeight : 'auto');
//表格宽度小于容器宽度时,隐藏固定列
that.layFixRight[layMainTable.width() > that.layMain.width() ? 'removeClass' : 'addClass'](HIDE);
//操作栏
that.layFixRight.css('right', scollWidth - 1);
};
//事件处理
@@ -853,16 +863,17 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
fields = fields || {};
layui.each(fields, function(key, value){
if(key in data){
var templet;
var templet, td = tr.children('td[data-field="'+ key +'"]');
data[key] = value;
that.eachCols(function(i, item2){
if(item2.field == key && item2.templet){
templet = item2.templet;
}
});
tr.children('td[data-field="'+ key +'"]').children(ELEM_CELL).html(
td.children(ELEM_CELL).html(
templet ? laytpl($(templet).html() || value).render(data) : value
);
td.data('content', value);
}
});
}
@@ -930,15 +941,15 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
var row = $.extend({
title: th.text()
,colspan: th.attr('colspan') //列单元格
,rowspan: th.attr('rowspan') //行单元格
,colspan: th.attr('colspan') || null //列单元格
,rowspan: th.attr('rowspan') || null //行单元格
}, itemData);
cols.push(row)
row.field && cols.push(row)
options.cols[i].push(row);
});
});
//获取表体数据
othis.find('tbody>tr').each(function(i1){
var tr = $(this), row = {};

View File

@@ -19,7 +19,7 @@
}
,Layui = function(){
this.v = '2.1.2'; //版本号
this.v = '2.1.3'; //版本号
}
//获取layui所在目录