5.0.6
parent
286a40b202
commit
60c03454bd
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12,7 +12,7 @@ var header = require('gulp-header');
|
||||||
var del = require('del');
|
var del = require('del');
|
||||||
|
|
||||||
//发行版本目录
|
//发行版本目录
|
||||||
var releaseDir = './release/layDate-v' + pkg.version;
|
var releaseDir = './release/zip/layDate-v' + pkg.version;
|
||||||
var release = releaseDir + '/laydate';
|
var release = releaseDir + '/laydate';
|
||||||
|
|
||||||
var task = {
|
var task = {
|
||||||
|
@ -42,7 +42,10 @@ gulp.task('clear', function(cb){ //清理
|
||||||
gulp.task('laydate', task.minjs); //压缩PC版本
|
gulp.task('laydate', task.minjs); //压缩PC版本
|
||||||
gulp.task('other', task.other); //移动一些配件
|
gulp.task('other', task.other); //移动一些配件
|
||||||
|
|
||||||
gulp.task('r', function(){
|
gulp.task('clearZip', function(cb){ //清理
|
||||||
|
return del(['./release/zip/*'], cb);
|
||||||
|
});
|
||||||
|
gulp.task('r', ['clearZip'], function(){
|
||||||
gulp.src('./release/doc/**/*')
|
gulp.src('./release/doc/**/*')
|
||||||
.pipe(gulp.dest(releaseDir))
|
.pipe(gulp.dest(releaseDir))
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "layui-laydate",
|
"name": "layui-laydate",
|
||||||
"version": "5.0.5",
|
"version": "5.0.6",
|
||||||
"alias": "laydate",
|
"alias": "laydate",
|
||||||
"description": "日期与时间组件",
|
"description": "日期与时间组件",
|
||||||
"main": "src/laydate.js",
|
"main": "src/laydate.js",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@Name : layDate 5.0.5 日期时间控件
|
@Name : layDate 5.0.6 日期时间控件
|
||||||
@Author: 贤心
|
@Author: 贤心
|
||||||
@Site:http://www.layui.com/laydate/
|
@Site:http://www.layui.com/laydate/
|
||||||
@License:MIT
|
@License:MIT
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
,laydate = {
|
,laydate = {
|
||||||
v: '5.0.5'
|
v: '5.0.6'
|
||||||
,config: {} //全局配置项
|
,config: {} //全局配置项
|
||||||
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
||||||
,path: ready.getPath
|
,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]
|
,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){
|
,Class = function(options){
|
||||||
|
@ -456,21 +456,25 @@
|
||||||
that.EXP_SPLIT = '';
|
that.EXP_SPLIT = '';
|
||||||
lay.each(that.format, function(i, item){
|
lay.each(that.format, function(i, item){
|
||||||
var EXP = new RegExp(dateType).test(item)
|
var EXP = new RegExp(dateType).test(item)
|
||||||
? '\\b\\d{1,'+ function(){
|
? '\\d{'+ function(){
|
||||||
if(/yyyy/.test(item)) return 4;
|
if(new RegExp(dateType).test(that.format[i === 0 ? i + 1 : i - 1]||'')){
|
||||||
if(/y/.test(item)) return 308;
|
if(/^yyyy|y$/.test(item)) return 4;
|
||||||
return 2;
|
return item.length;
|
||||||
}() +'}\\b'
|
}
|
||||||
|
if(/^yyyy$/.test(item)) return '1,4';
|
||||||
|
if(/^y$/.test(item)) return '1,308';
|
||||||
|
return '1,2';
|
||||||
|
}() +'}'
|
||||||
: '\\' + item;
|
: '\\' + item;
|
||||||
that.EXP_IF = that.EXP_IF + EXP;
|
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('^'+ (
|
that.EXP_IF = new RegExp('^'+ (
|
||||||
options.range ?
|
options.range ?
|
||||||
that.EXP_IF + '\\s\\'+ options.range + '\\s' + that.EXP_IF
|
that.EXP_IF + '\\s\\'+ options.range + '\\s' + that.EXP_IF
|
||||||
: 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事件
|
//如果不是input|textarea元素,则默认采用click事件
|
||||||
if(!that.isInput(options.elem[0])){
|
if(!that.isInput(options.elem[0])){
|
||||||
|
@ -557,7 +561,7 @@
|
||||||
,'class': [
|
,'class': [
|
||||||
'layui-laydate'
|
'layui-laydate'
|
||||||
,options.range ? ' layui-laydate-range' : ''
|
,options.range ? ' layui-laydate-range' : ''
|
||||||
,isStatic ? ' layui-laydate-static' : ''
|
,isStatic ? (' '+ ELEM_STATIC) : ''
|
||||||
,options.theme && options.theme !== 'default' && !/^#/.test(options.theme) ? (' laydate-theme-' + options.theme) : ''
|
,options.theme && options.theme !== 'default' && !/^#/.test(options.theme) ? (' laydate-theme-' + options.theme) : ''
|
||||||
].join('')
|
].join('')
|
||||||
})
|
})
|
||||||
|
@ -702,7 +706,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
//移除上一个控件
|
//移除上一个控件
|
||||||
that.remove();
|
that.remove(Class.thisElem);
|
||||||
|
|
||||||
//如果是静态定位,则插入到指定的容器中,否则,插入到body
|
//如果是静态定位,则插入到指定的容器中,否则,插入到body
|
||||||
isStatic ? options.elem.append(elem) : (
|
isStatic ? options.elem.append(elem) : (
|
||||||
|
@ -721,11 +725,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
//控件移除
|
//控件移除
|
||||||
Class.prototype.remove = function(){
|
Class.prototype.remove = function(prev){
|
||||||
var that = this
|
var that = this
|
||||||
,options = that.config
|
,options = that.config
|
||||||
,elem = lay('#'+ that.elemID);
|
,elem = lay('#'+ (prev || that.elemID));
|
||||||
if(elem[0] && options.position !== 'static'){
|
if(elem[0] && !elem.hasClass(ELEM_STATIC)){
|
||||||
that.checkDate(function(){
|
that.checkDate(function(){
|
||||||
elem.remove();
|
elem.remove();
|
||||||
});
|
});
|
||||||
|
@ -844,7 +848,7 @@
|
||||||
//获得初始化日期值
|
//获得初始化日期值
|
||||||
,initDate = function(dateTime, value, index){
|
,initDate = function(dateTime, value, index){
|
||||||
var startEnd = ['startTime', 'endTime'];
|
var startEnd = ['startTime', 'endTime'];
|
||||||
value = value.match(that.EXP_SPLIT);
|
value = (value.match(that.EXP_SPLIT) || []).slice(1);
|
||||||
index = index || 0;
|
index = index || 0;
|
||||||
if(options.range){
|
if(options.range){
|
||||||
that[startEnd[index]] = that[startEnd[index]] || {};
|
that[startEnd[index]] = that[startEnd[index]] || {};
|
||||||
|
@ -1289,15 +1293,12 @@
|
||||||
lay(ol).find('.'+ THIS).removeClass(THIS);
|
lay(ol).find('.'+ THIS).removeClass(THIS);
|
||||||
lay(this).addClass(THIS);
|
lay(this).addClass(THIS);
|
||||||
|
|
||||||
//同步按钮可点状态
|
|
||||||
that.setBtnStatus(
|
|
||||||
null
|
|
||||||
,lay.extend({}, that.systemDate(), that.startTime)
|
|
||||||
,lay.extend({}, that.systemDate(), that.endTime)
|
|
||||||
);
|
|
||||||
setTimeStatus();
|
setTimeStatus();
|
||||||
scroll();
|
scroll();
|
||||||
(that.endDate || options.type === 'time') && that.done(null, 'change');
|
(that.endDate || options.type === 'time') && that.done(null, 'change');
|
||||||
|
|
||||||
|
//同步按钮可点状态
|
||||||
|
that.setBtnStatus();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1325,7 +1326,7 @@
|
||||||
var that = this
|
var that = this
|
||||||
,options = that.config
|
,options = that.config
|
||||||
,isOut, elemBtn = lay(that.footer).find(ELEM_CONFIRM)
|
,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){
|
if(isAlone){
|
||||||
start = start || that.startDate;
|
start = start || that.startDate;
|
||||||
end = end || that.endDate;
|
end = end || that.endDate;
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
/**
|
|
||||||
|
|
||||||
@Name: laydata
|
|
||||||
@Author: 贤心
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
|
||||||
|
|
||||||
/* 初始化 */
|
|
||||||
.layui-laydate *{margin: 0; padding: 0;}
|
|
||||||
|
|
||||||
/** 图标字体 **/
|
/** 图标字体 **/
|
||||||
@font-face {font-family: 'laydate-icon';
|
@font-face {font-family: 'laydate-icon';
|
||||||
src: url('./font/iconfont.eot');
|
src: url('./font/iconfont.eot');
|
||||||
|
@ -28,6 +15,19 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
@Name: laydata
|
||||||
|
@Author: 贤心
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||||
|
|
||||||
|
/* 初始化 */
|
||||||
|
.layui-laydate *{margin: 0; padding: 0;}
|
||||||
|
|
||||||
/* 主体结构 */
|
/* 主体结构 */
|
||||||
.layui-laydate, .layui-laydate *{box-sizing: border-box;}
|
.layui-laydate, .layui-laydate *{box-sizing: border-box;}
|
||||||
.layui-laydate{position: absolute; z-index: 66666666; margin: 5px 0; border-radius: 2px; font-size: 14px; -webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
.layui-laydate{position: absolute; z-index: 66666666; margin: 5px 0; border-radius: 2px; font-size: 14px; -webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||||
|
|
Loading…
Reference in New Issue