Merge pull request #1030 from layui/main

同步 2.x
This commit is contained in:
贤心 2022-06-07 01:12:49 +08:00 committed by GitHub
commit 8e5a4141a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 202 additions and 120 deletions

View File

@ -70,6 +70,6 @@ layui.use(['layer', 'form'], function(){
> 大概是因为 layui 让开发者变得更懒,所以贡献者才如此之少。
## 相关
> layui 官网已于2021年10月13日下线。
> layui 官网已于2021年10月13日下线。
目前包括版本更新、文档等在内的所有日常维护,都以 Github 或 Gitee 项目主页为准。

2
dist/css/layui.css vendored

File diff suppressed because one or more lines are too long

2
dist/layui.js vendored

File diff suppressed because one or more lines are too long

View File

@ -131,8 +131,17 @@ body{padding:20px;}
<br><br>
<blockquote class="layui-elem-quote"> Layui 正是你苦苦寻找的前端UI框架</blockquote>
<blockquote class="layui-elem-quote layui-quote-nm"> Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架</blockquote>
<blockquote class="layui-elem-quote layui-text">
<p>Layui - 原生态模块化前端 UI 组件库</p>
<p>Layui - 原生态模块化前端 UI 组件库</p>
</blockquote>
<blockquote class="layui-elem-quote layui-quote-nm">
Layui - 原生态模块化前端 UI 组件库
Layui - 原生态模块化前端 UI 组件库
Layui - 原生态模块化前端 UI 组件库
Layui - 原生态模块化前端 UI 组件库
Layui - 原生态模块化前端 UI 组件库
</blockquote>
<fieldset class="layui-elem-field">
<legend>字段集区块 - 默认风格</legend>

View File

@ -9,7 +9,7 @@
"id": "10001"
,"username": "杜甫"
,"email": "test1@email.com"
,"sex": "男"
,"sex": "<strong></strong>"
,"city": "浙江杭州"
,"sign": "鼠标移动到此处,可以通过点击单元格右侧的下拉图标,查看到被隐藏的全部内容。"
,"experience": 7

View File

@ -114,7 +114,7 @@ body{padding: 50px 100px;}
<div class="layui-inline">
<input type="text" class="layui-input" id="test6">
</div>
<textarea></textarea>
<button class="layui-btn" id="test9">外部事件触发</button>
<div class="layui-inline">
<input type="text" class="layui-input" id="test8">

View File

@ -41,6 +41,7 @@
{{# if(d.email.trim()){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{{# } }}
<input type="checkbox" name="demoTableSwitch" lay-skin="switch" {{ d.demoTableSwitch }}>
</script>
<script type="text/html" id="usernameTpl">
@ -111,11 +112,12 @@ layui.use(['table', 'dropdown'], function(){
,layEvent: 'LAYTABLE_TIPS'
,icon: 'layui-icon-tips'
}]
//,escape: false
,cols: !1 ? [[ //仅用于测试
{type: 'checkbox', fixed: 'left'}
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
,{field:'username', title:'用户名', width:120, edit: 'text'}
,{field:'email', title:'邮箱', hide: 0, width:150, edit: 'text'}
,{field:'email', title:'邮箱 <i class="layui-icon layui-icon-email"></i>', hide: 0, width:150, edit: 'text'}
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
,{field:'city', title:'城市', width:120}
,{field:'sign', title:'签名'}
@ -125,7 +127,7 @@ layui.use(['table', 'dropdown'], function(){
{type: 'checkbox', fixed: 'left'}
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
,{field:'username', title:'用户名', width:120, edit: 'text', templet: '#usernameTpl'}
,{field:'email', title:'邮箱', hide: 0, width:150, edit: 'text', templet: function(d){
,{field:'email', title:'邮箱 <i class="layui-icon layui-icon-email"></i>', hide: 0, width:150, edit: 'text', templet: function(d){
return '<em>'+ layui.util.escape(d.email) +'</em>'
}}
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
@ -139,7 +141,7 @@ layui.use(['table', 'dropdown'], function(){
,{field:'ip', title:'IP', width: 120}
,{field:'logins', title:'登入次数', width: 100, sort: true, totalRow: '{{ parseInt(d.TOTAL_NUMS) }} 次'}
,{field:'joinTime', title:'加入时间', width: 120}
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width: 180}
]]
,initSort1: {
@ -231,7 +233,7 @@ layui.use(['table', 'dropdown'], function(){
case 'getData':
var getData = table.getData(obj.config.id);
console.log(getData);
layer.alert(JSON.stringify(getData));
layer.alert(layui.util.escape(JSON.stringify(getData)));
break;
case 'isAll':
layer.msg(checkStatus.isAll ? '全选': '未全选')

50
examples/text.md.html Normal file
View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>text for markdown - layui</title>
<link rel="stylesheet" href="../src/css/layui.css">
</head>
<body>
<div class="layui-container layui-row">
<div class="layui-col-md4 layui-text">
<h1>标题1</h1>
<h2>标题2</h2>
<h3>标题3</h3>
<h4>标题4</h4>
<h5>标题5</h5>
<h6>标题6</h6>
<p>段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1 <sup class="footnote-ref"><a href="#ref-1">[1]</a></sup></p>
<p>段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2</p>
<p>段落3段落3段落3段落3段落3段落3段落3段落3段落3段落3段落3段落3 <a href="">链接</a></p>
<ul>
<li>无序1</li>
<li>无序2</li>
<li>无序3</li>
</ul>
<ol>
<li>有序1</li>
<li>有序2</li>
<li>有序3</li>
</ol>
<br>
<blockquote>
<p>引用</p>
<blockquote>内嵌引用<blockquote>内嵌引用</blockquote></blockquote>
</blockquote>
<br>
<pre>
var cp = function(){
return gulp.src('./dist/**/*')
.pipe(gulp.dest(dest));
};</pre>
<p id="ref-1">REF-1</p>
</div>
</div>
</body>
</html>

View File

@ -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="../src/css/layui.css">
@ -89,7 +89,7 @@ hr{margin: 30px 0;}
绑定原始文件域:<input type="file" name="file" id="test9">
<script src="../src/layui.js"></script>
<script src="../src/layui.js" src1="https://cdn.staticfile.org/layui/2.6.8/layui.js"></script>
<script>
layui.use(['upload', 'element'], function(){
var $ = layui.jquery
@ -123,16 +123,16 @@ layui.use(['upload', 'element'], function(){
layer.msg('不允许上传')
return false;
}
,done: function(res){
,done: function(res, index){
//如果上传失败
if(res.code > 0){
return layer.msg('上传失败');
}
//上传成功
console.log(res);
console.log(res, index);
}
,error: function(){
,error: function(index, upload){
this.item.html('重选上传');
//演示失败状态,并实现重传
@ -145,7 +145,7 @@ layui.use(['upload', 'element'], function(){
element.progress('demo', '0%');
}
,progress: function(n, elem, res, index){
console.log(n + '%', elem, res); //获取进度百分比
console.log(n + '%', elem, res, index); //获取进度百分比
element.progress('demo', n + '%'); //可配合 layui 进度条元素使用
}
});
@ -158,19 +158,25 @@ layui.use(['upload', 'element'], function(){
//,size: 2
});
// 演示多图片上传
upload.render({
elem: '#test2'
,url: 'https://httpbin.org/post'
,multiple: true
,number: 3
,accept: 'images'
,number: 3 //同时上传的数量
,size: 1024
,before: function(obj){
//预读本地文件示例不支持ie8
obj.preview(function(index, file, result){
$('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img">')
});
//this.files = obj.pushFile();
}
,done: function(res){
,done: function(res, index){
//上传完毕
//console.log(this.files)
}
,allDone: function(obj){
console.log(obj)
@ -181,7 +187,7 @@ layui.use(['upload', 'element'], function(){
var demoListView = $('#demoList');
var uploadListIns = upload.render({
elem: '#testList'
,url: 'http://httpbin.org/post'
,url: 'https://httpbin.org/post'
,accept: 'file'
,multiple: true
,number: 3
@ -189,9 +195,8 @@ layui.use(['upload', 'element'], function(){
,bindAction: '#testListAction'
,choose: function(obj){
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
//读取本地文件
obj.preview(function(index, file, result){
obj.preview(function(index, file, result){
var tr = $(['<tr id="upload-'+ index +'">'
,'<td>'+ file.name +'</td>'
,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
@ -300,11 +305,11 @@ layui.use(['upload', 'element'], function(){
,auto: false
//,multiple: true
,bindAction: '#test7'
,choose1: function(obj){
,choose: function(obj){
var that = this;
obj.preview(function(index, file){
console.log(file.name);
obj.resetFile(index, file, '123.jpg');
//obj.resetFile(index, file, '123.jpg');
});
}
,before: function(){
@ -317,7 +322,7 @@ layui.use(['upload', 'element'], function(){
upload.render({
elem: '#test8'
,url: 'http://httpbin.org/post'
,url: 'https://httpbin.org/post'
,done: function(res){
console.log(res);
}

View File

@ -1,5 +1,5 @@
/**
* Layui Build
* Building Layui
*/
var pkg = require('./package.json');
@ -15,7 +15,7 @@ var del = require('del');
var minimist = require('minimist');
var yargs = require('yargs');
//基础配置
// 基础配置
var config = {
//注释
comment: [
@ -26,25 +26,25 @@ var config = {
,modules: 'lay,laytpl,laypage,laydate,jquery,layer,util,dropdown,slider,colorpicker,element,upload,form,table,tree,transfer,carousel,rate,flow,layedit,code'
};
//获取参数
// 获取参数
var argv = require('minimist')(process.argv.slice(2), {
default: {
version: pkg.version
}
});
//前置目录
// 前置目录
var dir = {
rls: './release/zip/layui-v' + pkg.version
};
//输出目录
// 输出目录
var dest = ({
dist: './dist'
,rls: dir.rls + '/layui'
}[argv.dest || 'dist'] || argv.dest) + (argv.vs ? '/'+ pkg.version : '');
//js
// js
var js = function(){
var src = [
'./src/**/{layui,layui.all,'+ config.modules +'}.js'
@ -58,7 +58,7 @@ var js = function(){
.pipe(gulp.dest(dest));
};
//css
// css
var css = function(){
var src = [
'./src/css/**/*.css'
@ -71,20 +71,20 @@ var css = function(){
.pipe(gulp.dest(dest +'/css'));
};
//files
// files
var files = function(){
var src = ['./src/**/*.{eot,svg,ttf,woff,woff2,html,json,png,jpg,gif}'];
return gulp.src(src)
.pipe(gulp.dest(dest));
};
//mv
var mv = function(){
// cp
var cp = function(){
return gulp.src('./dist/**/*')
.pipe(gulp.dest(dest));
};
//release
// release
var rls = function(){
return gulp.src('./release/doc/**/*')
.pipe(replace(/[^'"]+(\/layui\.css)/, 'layui/css$1')) //替换 css 引入路径中的本地 path
@ -92,7 +92,7 @@ var rls = function(){
.pipe(gulp.dest(dir.rls));
};
//clean
// clean
var clean = function(cb) {
return del([dest], {
force: true
@ -102,15 +102,15 @@ var cleanRLS = function(cb) {
return del([dir.rls]);
};
//Define all task
// Define all task
exports.js = js;
exports.css = css;
exports.files = files;
exports.default = gulp.series(clean, gulp.parallel(js, css, files)); //default task
exports.mv = gulp.series(clean, mv);
exports.cp = gulp.series(clean, cp);
exports.rls = gulp.series(cleanRLS, rls); //release task
//layer task
// layer task
exports.layer = function(){ // gulp layer
var dest = './release/layer';
@ -122,29 +122,29 @@ exports.layer = function(){ // gulp layer
};
//laydate task
// laydate task
exports.laydate = function(){ // gulp laydate
var dest = './release/laydate/' //发行目录
var dest = './release/laydate/' // 发行目录
,comment = [ //注释
'\n/*! \n * <%= title %> \n * <%= license %> Licensed \n */ \n\n'
,{title: 'layDate 日期与时间组件(单独版)', license: 'MIT'}
];
//css
// css
gulp.src('./src/css/modules/laydate.css')
.pipe(gulp.dest(dest + 'src/'));
//js
// js
return gulp.src(['./src/layui.js', './src/modules/{lay,laydate}.js'])
.pipe(replace('win.layui =', 'var layui =')) //将 layui 替换为局部变量
.pipe(replace('})(window); //gulp build: layui-footer', '')) //替换 layui.js 的落脚
.pipe(replace('(function(window){ //gulp build: lay-header', '')) //替换 lay.js 的头部
.pipe(replace('win.layui =', 'var layui =')) // 将 layui 替换为局部变量
.pipe(replace('})(window); //gulp build: layui-footer', '')) // 替换 layui.js 的落脚
.pipe(replace('(function(window){ //gulp build: lay-header', '')) // 替换 lay.js 的头部
.pipe(concat('laydate.js', {newLine: ''}))
.pipe(header.apply(null, comment)) //追加头部
.pipe(gulp.dest(dest + 'src'));
};
//help
// helper
exports.help = function(){
var usage = '\nUsage: gulp [options] tasks'
,parser = yargs.usage(usage, {
@ -163,8 +163,8 @@ exports.help = function(){
'Tasks:'
,' default 默认任务'
,' rls 发行任务'
,' mv 将 dist 目录复制并拷贝一份到参数 --dest 指向的目录'
].join('\n'), '\n\nExamples:\n gulp mv --dest ./v --vs', '\n');
,' cp 将 dist 目录复制一份到参数 --dest 指向的目录'
].join('\n'), '\n\nExamples:\n gulp cp --dest ./v --vs', '\n');
return gulp.src('./');
};

View File

@ -1,7 +1,7 @@
{
"name": "layui",
"realname": "layui",
"version": "2.6.11",
"version": "2.6.12",
"description": "Classic modular Front-End UI library",
"main": "dist/layui.js",
"license": "MIT",

View File

@ -473,7 +473,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-progress-bar{position: absolute; left: 0; top: 0; width: 0; max-width: 100%; height: 6px; border-radius: 20px; text-align: right; background-color: #5FB878; transition: all .3s; -webkit-transition: all .3s;}
.layui-progress-big,
.layui-progress-big .layui-progress-bar{height: 18px; line-height: 18px;}
.layui-progress-text{position: relative; top: -20px; line-height: 18px; font-size: 12px; color: #666}
.layui-progress-text{position: relative; top: -20px; line-height: 18px; font-size: 12px; color: #5F5F5F}
.layui-progress-big .layui-progress-text{position: static; padding: 0 10px; color: #fff;}
@ -490,7 +490,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-colla-content{border-top-width: 1px; border-top-style: solid;}
.layui-colla-item:first-child{border-top: none;}
.layui-colla-title{position: relative; height: 42px; line-height: 42px; padding: 0 15px 0 35px; color: #333; background-color: #FAFAFA; cursor: pointer; font-size: 14px; overflow: hidden;}
.layui-colla-content{display: none; padding: 10px 15px; line-height: 1.6; color: #666;}
.layui-colla-content{display: none; padding: 10px 15px; line-height: 1.6; color: #5F5F5F;}
.layui-colla-icon{position: absolute; left: 15px; top: 0; font-size: 14px;}
/* 卡片面板 */
@ -504,7 +504,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-card .layui-tab{margin: 0;}
/* 常规面板 */
.layui-panel{position: relative; border-width: 1px; border-style: solid; border-radius: 2px; box-shadow: 1px 1px 4px rgb(0 0 0 / 8%); background-color: #fff; color: #666;}
.layui-panel{position: relative; border-width: 1px; border-style: solid; border-radius: 2px; box-shadow: 1px 1px 4px rgb(0 0 0 / 8%); background-color: #fff; color: #5F5F5F;}
/* 窗口面板 */
.layui-panel-window{position: relative; padding: 15px; border-radius: 0; border-top: 5px solid #eee; background-color: #fff;}
@ -526,8 +526,8 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-bg-green{background-color: #009688!important; color: #fff!important;} /*绿*/
.layui-bg-cyan{background-color: #2F4056!important; color: #fff!important;} /*青*/
.layui-bg-blue{background-color: #1E9FFF!important; color: #fff!important;} /*蓝*/
.layui-bg-black{background-color: #393D49!important; color: #fff!important;} /**/
.layui-bg-gray{background-color: #FAFAFA!important; color: #666!important;} /*灰*/
.layui-bg-black{background-color: #393D49!important; color: #fff!important;} /**/
.layui-bg-gray{background-color: #FAFAFA!important; color: #5F5F5F!important;} /*浅*/
/* 边框 */
.layui-border,
@ -548,7 +548,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form-pane .layui-form-item[pane],
.layui-layedit, .layui-layedit-tool{border-color: #eee;}
.layui-border{border-width: 1px; border-style: solid; color: #666!important;}
.layui-border{border-width: 1px; border-style: solid; color: #5F5F5F!important;}
.layui-border-red{border-width: 1px; border-style: solid; border-color: #FF5722!important; color: #FF5722!important;}
.layui-border-orange{border-width: 1px; border-style: solid; border-color: #FFB800!important; color: #FFB800!important;}
.layui-border-green{border-width: 1px; border-style: solid; border-color: #009688!important; color: #009688!important;}
@ -560,21 +560,32 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-timeline-item:before{background-color: #eee;}
/* 文本区域 */
.layui-text{line-height: 1.6; font-size: 14px; color: #666;}
.layui-text{line-height: 1.6; font-size: 14px; color: #5F5F5F;}
.layui-text h1,
.layui-text h2,
.layui-text h3{font-weight: 500; color: #333;}
.layui-text h1{font-size: 30px;}
.layui-text h3,
.layui-text h4,
.layui-text h5,
.layui-text h6{font-weight: 500; color: #333;}
.layui-text h1{font-size: 32px;}
.layui-text h2{font-size: 24px;}
.layui-text h3{font-size: 18px;}
.layui-text h4{font-size: 16px;}
.layui-text h5{font-size: 14px;}
.layui-text h6{font-size: 13px;}
.layui-text a:not(.layui-btn){color: #01AAED;}
.layui-text a:not(.layui-btn):hover{text-decoration: underline;}
.layui-text ul{padding: 5px 0 5px 15px;}
.layui-text ul,
.layui-text ol{padding: 5px 0 5px 15px;}
.layui-text ul li{margin-top: 5px; list-style-type: disc;}
.layui-text ol li{margin-top: 5px; list-style-type: decimal;}
.layui-text em,
.layui-word-aux{color: #999 !important; padding-left: 5px !important; padding-right: 5px !important;}
.layui-text p{margin: 10px 0;}
.layui-text p:first-child{margin-top: 0;}
.layui-text p:last-child{margin-bottom: 0;}
.layui-text blockquote:not(.layui-elem-quote){padding: 5px 15px; border-left: 5px solid #eee;}
.layui-text pre:not(.layui-code){padding: 15px; font-family: Lucida Console,Consolas,Courier New; background-color: #FAFAFA;}
/* 字体大小及颜色 */
.layui-font-12{font-size: 12px !important;;}
@ -614,7 +625,7 @@ a cite{font-style: normal; *cursor:pointer;}
/* 圆角 */.layui-btn-radius{border-radius: 100px;}
.layui-btn .layui-icon{padding: 0 2px; vertical-align: middle\0; vertical-align: bottom;}
/* 原始 */.layui-btn-primary{border-color: #d2d2d2; background: none; color: #666;}
/* 原始 */.layui-btn-primary{border-color: #d2d2d2; background: none; color: #5F5F5F;}
.layui-btn-primary:hover{border-color: #009688; color: #333;}
/* 百搭 */.layui-btn-normal{background-color: #1E9FFF;}
/* 暖色 */.layui-btn-warm{background-color: #FFB800;}
@ -705,7 +716,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form-item .layui-form-checkbox{margin-top: 4px;}
/* 复选框-原始风格 */.layui-form-checkbox[lay-skin="primary"]{height: auto!important; line-height: normal!important; min-width: 18px; min-height: 18px; border: none!important; margin-right: 0; padding-left: 28px; padding-right: 0; background: none;}
.layui-form-checkbox[lay-skin="primary"] span{padding-left: 0; padding-right: 15px; line-height: 18px; background: none; color: #666;}
.layui-form-checkbox[lay-skin="primary"] span{padding-left: 0; padding-right: 15px; line-height: 18px; background: none; color: #5F5F5F;}
.layui-form-checkbox[lay-skin="primary"] i{right: auto; left: 0; width: 16px; height: 16px; line-height: 16px; border: 1px solid #d2d2d2; font-size: 12px; border-radius: 2px; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;}
.layui-form-checkbox[lay-skin="primary"]:hover i{border-color: #5FB878; color: #fff;}
.layui-form-checked[lay-skin="primary"] i{border-color: #5FB878 !important; background-color: #5FB878; color: #fff;}
@ -839,7 +850,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-flow-more a i{font-size: 30px; color: #737383;}
/** 表格 **/
.layui-table{width: 100%; margin: 10px 0; background-color: #fff; color: #666;}
.layui-table{width: 100%; margin: 10px 0; background-color: #fff; color: #5F5F5F;}
.layui-table tr{transition: all .3s; -webkit-transition: all .3s;}
.layui-table th{text-align: left; font-weight: 400;}
@ -923,9 +934,9 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-table-sort{width: 10px; height: 20px; margin-left: 5px; cursor: pointer!important;}
.layui-table-sort .layui-edge{position: absolute; left: 5px; border-width: 5px;}
.layui-table-sort .layui-table-sort-asc{top: 3px; border-top: none; border-bottom-style: solid; border-bottom-color: #b2b2b2;}
.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color: #666;}
.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color: #5F5F5F;}
.layui-table-sort .layui-table-sort-desc{bottom: 5px; border-bottom: none; border-top-style: solid; border-top-color: #b2b2b2;}
.layui-table-sort .layui-table-sort-desc:hover{border-top-color: #666;}
.layui-table-sort .layui-table-sort-desc:hover{border-top-color: #5F5F5F;}
.layui-table-sort[lay-sort="asc"] .layui-table-sort-asc{border-bottom-color: #000;}
.layui-table-sort[lay-sort="desc"] .layui-table-sort-desc{border-top-color: #000;}
@ -988,8 +999,8 @@ select.layui-table-edit{padding: 0 0 0 10px; border-color: #d2d2d2;}
.layui-table-grid-down:hover{background-color: #fbfbfb;}
body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-shadow: 0 1px 6px rgba(0,0,0,.12);}
.layui-table-tips-main{margin: -44px 0 0 -1px; max-height: 150px; padding: 8px 15px; font-size: 14px; overflow-y: scroll; background-color: #fff; color: #666;}
.layui-table-tips-c{position: absolute; right: -3px; top: -13px; width: 20px; height: 20px; padding: 3px; cursor: pointer; background-color: #666; border-radius: 50%; color: #fff;}
.layui-table-tips-main{margin: -44px 0 0 -1px; max-height: 150px; padding: 8px 15px; font-size: 14px; overflow-y: scroll; background-color: #fff; color: #5F5F5F;}
.layui-table-tips-c{position: absolute; right: -3px; top: -13px; width: 20px; height: 20px; padding: 3px; cursor: pointer; background-color: #5F5F5F; border-radius: 50%; color: #fff;}
.layui-table-tips-c:hover{background-color: #777;}
.layui-table-tips-c:before{position: relative; right: -2px;}
@ -1062,7 +1073,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
/* 下拉菜单 */
.layui-dropdown{position: absolute; left: -999999px; top: -999999px; z-index: 66666666; margin: 5px 0; min-width: 100px;}
.layui-dropdown{position: absolute; left: -999999px; top: -999999px; z-index: 77777777; margin: 5px 0; min-width: 100px;}
.layui-dropdown:before{content:""; position: absolute; width: 100%; height: 6px; left: 0; top: -6px;}
@ -1088,7 +1099,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-nav-child{display: none; position: absolute; left: 0; top: 65px; min-width: 100%; line-height: 36px; padding: 5px 0; box-shadow: 0 2px 4px rgba(0,0,0,.12); border: 1px solid #eee; background-color: #fff; z-index: 100; border-radius: 2px; white-space: nowrap;}
.layui-nav .layui-nav-child a{color: #666; color: rgba(0,0,0,.8);}
.layui-nav .layui-nav-child a{color: #5F5F5F; color: rgba(0,0,0,.8);}
.layui-nav .layui-nav-child a:hover{background-color: #F6F6F6; color: rgba(0,0,0,.8);}
.layui-nav-child dd{margin: 1px 0; position: relative;}
.layui-nav-child dd.layui-this{background-color: #F6F6F6; color: #000;}
@ -1132,7 +1143,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-breadcrumb>*{font-size: 14px;}
.layui-breadcrumb a{color: #999 !important;}
.layui-breadcrumb a:hover{color: #5FB878 !important;}
.layui-breadcrumb a cite{color: #666; font-style: normal;}
.layui-breadcrumb a cite{color: #5F5F5F; font-style: normal;}
.layui-breadcrumb span[lay-separator]{margin: 0 10px; color: #999;}
/** Tab 选项卡 **/
@ -1190,7 +1201,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-badge-rim{position:relative; display: inline-block; padding: 0 6px; font-size: 12px; text-align: center; background-color: #FF5722; color: #fff; border-radius: 2px;}
.layui-badge{height: 18px; line-height: 18px;}
.layui-badge-dot{width: 8px; height: 8px; padding: 0; border-radius: 50%;}
.layui-badge-rim{height: 18px; line-height: 18px; border-width: 1px; border-style: solid; background-color: #fff; color: #666;}
.layui-badge-rim{height: 18px; line-height: 18px; border-width: 1px; border-style: solid; background-color: #fff; color: #5F5F5F;}
.layui-btn .layui-badge,
.layui-btn .layui-badge-dot{margin-left: 5px;}
@ -1267,7 +1278,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
/** 表情面板 **/
body .layui-util-face{border: none; background: none;}
body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; color:#666; box-shadow:none}
body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; color:#5F5F5F; box-shadow:none}
.layui-util-face .layui-layer-TipsG{display:none;}
.layui-util-face ul{position:relative; width:372px; padding:10px; border:1px solid #D9D9D9; background-color:#fff; box-shadow: 0 0 20px rgba(0,0,0,.2);}
.layui-util-face ul li{cursor: pointer; float: left; border: 1px solid #e8e8e8; height: 22px; width: 26px; overflow: hidden; margin: -1px 0 0 -1px; padding: 4px 2px; text-align: center;}
@ -1285,7 +1296,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
.layui-transfer-header{height: 38px; line-height: 38px; padding: 0 10px; border-bottom-width: 1px;}
.layui-transfer-search{position:relative; padding: 10px; border-bottom-width: 1px;}
.layui-transfer-search .layui-input{height: 32px; padding-left: 30px; font-size: 12px;}
.layui-transfer-search .layui-icon-search{position: absolute; left: 20px; top: 50%; margin-top: -8px; color: #666;}
.layui-transfer-search .layui-icon-search{position: absolute; left: 20px; top: 50%; margin-top: -8px; color: #5F5F5F;}
.layui-transfer-active{margin: 0 15px; display: inline-block; vertical-align: middle;}
.layui-transfer-active .layui-btn{display: block; margin: 0; padding: 0 15px; background-color: #5FB878; border-color: #5FB878; color: #fff;}
.layui-transfer-active .layui-btn-disabled{background-color: #FBFBFB; border-color: #eee; color: #d2d2d2;}
@ -1317,7 +1328,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
.layui-colorpicker-trigger-i{display: inline-block; color: #FFF; font-size: 12px;}
.layui-colorpicker-trigger-i.layui-icon-close{color: #999;}
.layui-colorpicker-main{position: absolute; left: -999999px; top: -999999px; z-index: 66666666; width: 280px; margin: 5px 0; padding: 7px; background: #FFF; border: 1px solid #d2d2d2; border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.12);}
.layui-colorpicker-main{position: absolute; left: -999999px; top: -999999px; z-index: 77777777; width: 280px; margin: 5px 0; padding: 7px; background: #FFF; border: 1px solid #d2d2d2; border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.12);}
.layui-colorpicker-main-wrapper{height: 180px; position: relative;}
.layui-colorpicker-basis{width: 260px; height: 100%; position: relative;}
.layui-colorpicker-basis-white{width: 100%; height: 100%; position: absolute; top: 0; left: 0; background: linear-gradient(90deg, #FFF, hsla(0,0%,100%,0));}
@ -1337,7 +1348,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
.layui-colorpicker-main-input{text-align: right; padding-top: 7px;}
.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin: 0 0 0 10px;}
.layui-colorpicker-main-input div.layui-inline{float: left; margin-right: 10px; font-size: 14px;}
.layui-colorpicker-main-input input.layui-input{width: 150px; height: 30px; color: #666;}
.layui-colorpicker-main-input input.layui-input{width: 150px; height: 30px; color: #5F5F5F;}
/** 滑块 **/
.layui-slider{height: 4px; background: #eee; border-radius: 3px; position: relative; cursor: pointer;}
@ -1349,7 +1360,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
.layui-slider-wrap-btn:hover,
.layui-slider-wrap-btn.layui-slider-hover{transform: scale(1.2);}
.layui-slider-wrap-btn.layui-disabled:hover{transform: scale(1) !important;}
.layui-slider-tips{position: absolute; top: -42px; z-index: 66666666; white-space:nowrap; display: none; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: #FFF; background: #000; border-radius: 3px; height: 25px; line-height: 25px; padding: 0 10px;}
.layui-slider-tips{position: absolute; top: -42px; z-index: 77777777; white-space:nowrap; display: none; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: #FFF; background: #000; border-radius: 3px; height: 25px; line-height: 25px; padding: 0 10px;}
.layui-slider-tips:after{content: ""; position: absolute; bottom: -12px; left: 50%; margin-left: -6px; width: 0; height: 0; border-width: 6px; border-style: solid; border-color: #000 transparent transparent transparent;}
.layui-slider-input{width: 70px; height: 32px; border: 1px solid #eee; border-radius: 3px; font-size: 16px; line-height: 32px; position: absolute; right: 0; top: -14px;}
.layui-slider-input-btn{position: absolute; top: 0; right: 0; width: 20px; height: 100%; border-left: 1px solid #eee;}
@ -1389,12 +1400,12 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
.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: 12px; line-height: 12px; width: 12px; 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-icon .layui-icon{font-size: 12px; color: #5F5F5F;}
.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-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-search{margin-bottom: 15px; color: #5F5F5F;}
.layui-tree-btnGroup{visibility: hidden; display: inline-block; vertical-align: middle; position: relative;}
.layui-tree-btnGroup .layui-icon{display: inline-block; vertical-align: middle; padding: 0 2px; cursor: pointer;}
.layui-tree-btnGroup .layui-icon:hover{color: #999; transition: 0.3s;}

View File

@ -15,7 +15,7 @@
}
,Layui = function(){
this.v = '2.6.11'; // layui 版本号
this.v = '2.6.12'; // layui 版本号
}
//识别预先可能定义的指定全局对象

View File

@ -517,6 +517,7 @@
elem.remove();
//delete options.dateTime;
//delete that.endDate;
delete laydate.thisId;
});
}
return that;
@ -1628,6 +1629,8 @@
var that = thisModule.getThis(laydate.thisId);
if(!that) return;
// 回车触发确认
if(that.config.position === 'static') return;
if(e.keyCode === 13){
if(lay('#'+ that.elemID)[0] && that.elemID === Class.thisElemDate){
e.preventDefault();

View File

@ -1,6 +1,6 @@
/**
* layui.table
* 数据表格组件
* 表格组件
*/
layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
@ -101,11 +101,11 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
//thead区域模板
,TPL_HEADER = function(options){
var rowCols = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';
var rowCols = '{{#if(item2.colspan){}} colspan="{{=item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{=item2.rowspan}}"{{#}}}';
options = options || {};
return ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" '
,'{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
,'{{# if(d.data.skin){ }}lay-skin="{{=d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{=d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
,'<thead>'
,'{{# layui.each(d.data.cols, function(i1, item1){ }}'
,'<tr>'
@ -122,21 +122,21 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
return '';
}()
,'{{# var isSort = !(item2.colGroup) && item2.sort; }}'
,'<th data-field="{{ item2.field||i2 }}" data-key="{{d.index}}-{{i1}}-{{i2}}" {{# if( item2.parentKey){ }}data-parentkey="{{ item2.parentKey }}"{{# } }} {{# if(item2.minWidth){ }}data-minwidth="{{item2.minWidth}}"{{# } }} '+ rowCols +' {{# if(item2.unresize || item2.colGroup){ }}data-unresize="true"{{# } }} class="{{# if(item2.hide){ }}layui-hide{{# } }}{{# if(isSort){ }} layui-unselect{{# } }}{{# if(!item2.field){ }} layui-table-col-special{{# } }}">'
,'<th data-field="{{= item2.field||i2 }}" data-key="{{=d.index}}-{{=i1}}-{{=i2}}" {{# if( item2.parentKey){ }}data-parentkey="{{= item2.parentKey }}"{{# } }} {{# if(item2.minWidth){ }}data-minwidth="{{=item2.minWidth}}"{{# } }} '+ rowCols +' {{# if(item2.unresize || item2.colGroup){ }}data-unresize="true"{{# } }} class="{{# if(item2.hide){ }}layui-hide{{# } }}{{# if(isSort){ }} layui-unselect{{# } }}{{# if(!item2.field){ }} layui-table-col-special{{# } }}">'
,'<div class="layui-table-cell laytable-cell-'
,'{{# if(item2.colGroup){ }}'
,'group'
,'{{# } else { }}'
,'{{d.index}}-{{i1}}-{{i2}}'
,'{{=d.index}}-{{=i1}}-{{=i2}}'
,'{{# if(item2.type !== "normal"){ }}'
,' laytable-cell-{{ item2.type }}'
,' laytable-cell-{{= item2.type }}'
,'{{# } }}'
,'{{# } }}'
,'" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>'
,'" {{#if(item2.align){}}align="{{=item2.align}}"{{#}}}>'
,'{{# if(item2.type === "checkbox"){ }}' //复选框
,'<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" {{# if(item2[d.data.checkName]){ }}checked{{# }; }}>'
,'{{# } else { }}'
,'<span>{{item2.title||""}}</span>'
,'<span>{{-item2.title||""}}</span>'
,'{{# if(isSort){ }}'
,'<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc" title="升序"></i><i class="layui-edge layui-table-sort-desc" title="降序"></i></span>'
,'{{# } }}'
@ -151,14 +151,14 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
,'</table>'].join('');
}
//tbody区域模板
// tbody 区域模板
,TPL_BODY = ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" '
,'{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
,'{{# if(d.data.skin){ }}lay-skin="{{=d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{=d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
,'<tbody></tbody>'
,'</table>'].join('')
//主模板
,TPL_MAIN = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}{{# if(d.data.className){ }} {{ d.data.className }}{{# } }}" lay-filter="LAY-table-{{d.index}}" lay-id="{{ d.data.id }}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">'
,TPL_MAIN = ['<div class="layui-form layui-border-box {{=d.VIEW_CLASS}}{{# if(d.data.className){ }} {{= d.data.className }}{{# } }}" lay-filter="LAY-table-{{=d.index}}" lay-id="{{= d.data.id }}" style="{{# if(d.data.width){ }}width:{{=d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{=d.data.height}}px;{{# } }}">'
,'{{# if(d.data.toolbar){ }}'
,'<div class="layui-table-tool">'
@ -209,7 +209,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
,'{{# if(d.data.totalRow){ }}'
,'<div class="layui-table-total">'
,'<table cellspacing="0" cellpadding="0" border="0" class="layui-table" '
,'{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
,'{{# if(d.data.skin){ }}lay-skin="{{=d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{=d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>'
,'<tbody><tr><td><div class="layui-table-cell" style="visibility: hidden;">Total</div></td></tr></tbody>'
, '</table>'
,'</div>'
@ -217,16 +217,16 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
,'{{# if(d.data.page){ }}'
,'<div class="layui-table-page">'
,'<div id="layui-table-page{{d.index}}"></div>'
,'<div id="layui-table-page{{=d.index}}"></div>'
,'</div>'
,'{{# } }}'
,'<style>'
,'{{# layui.each(d.data.cols, function(i1, item1){'
,'layui.each(item1, function(i2, item2){ }}'
,'.laytable-cell-{{d.index}}-{{i1}}-{{i2}}{ '
,'.laytable-cell-{{=d.index}}-{{=i1}}-{{=i2}}{ '
,'{{# if(item2.width){ }}'
,'width: {{item2.width}}px;'
,'width: {{=item2.width}}px;'
,'{{# } }}'
,' }'
,'{{# });'
@ -1348,7 +1348,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
var lis = [];
that.eachCols(function(i, item){
if(item.field && item.type == 'normal'){
lis.push('<li><input type="checkbox" name="'+ item.field +'" data-key="'+ item.key +'" data-parentkey="'+ (item.parentKey||'') +'" lay-skin="primary" '+ (item.hide ? '' : 'checked') +' title="'+ (item.title || item.field) +'" lay-filter="LAY_TABLE_TOOL_COLS"></li>');
lis.push('<li><input type="checkbox" name="'+ item.field +'" data-key="'+ item.key +'" data-parentkey="'+ (item.parentKey||'') +'" lay-skin="primary" '+ (item.hide ? '' : 'checked') +' title="'+ util.escape(item.title || item.field) +'" lay-filter="LAY_TABLE_TOOL_COLS"></li>');
}
});
return lis.join('');
@ -1393,8 +1393,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
openPanel({
list: function(){
return [
'<li data-type="csv">导出到 Csv 文件</li>'
,'<li data-type="xls">导出 Excel 文件</li>'
'<li data-type="csv">导出 csv 格式文件</li>'
,'<li data-type="xls">导出 xls 格式文件</li>'
].join('')
}()
,done: function(panel, list){
@ -1555,6 +1555,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
,tplData: data
}));
td.data('content', value);
item3.templet && that.renderForm();
} else if(item3.templet || item3.toolbar){ //更新所有其他列的模板
var thisTd = tr.children('td[data-field="'+ (item3.field || i) +'"]')
,content = data[item3.field];
@ -1564,6 +1565,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
,tplData: data
}));
thisTd.data('content', content);
that.renderForm();
}
});
});

View File

@ -1,6 +1,6 @@
/**
* upload
* 文件上传组件
* 上传组件
*/
layui.define('layer' , function(exports){
@ -180,14 +180,14 @@ layui.define('layer' , function(exports){
//高级浏览器处理方式,支持跨域
,ajaxSend = function(){
var successful = 0, aborted = 0
var successful = 0, failed = 0
,items = files || that.files || that.chooseFiles || elemFile.files
,allDone = function(){ //多文件全部上传完毕的回调
if(options.multiple && successful + aborted === that.fileLength){
if(options.multiple && successful + failed === that.fileLength){
typeof options.allDone === 'function' && options.allDone({
total: that.fileLength
,successful: successful
,aborted: aborted
,failed: failed
});
}
};
@ -219,7 +219,7 @@ layui.define('layer' , function(exports){
}
//异常回调
,error: function(e){
aborted++;
failed++;
that.msg('Request URL is abnormal: '+ (e.statusText || 'error'));
error(index);
allDone();
@ -243,7 +243,7 @@ layui.define('layer' , function(exports){
});
}
//低版本IE处理方式不支持跨域
//低版本 IE 处理方式,不支持跨域
,iframeSend = function(){
var iframe = $('#'+ ELEM_IFRAME);
@ -338,14 +338,6 @@ layui.define('layer' , function(exports){
//提交上传
,send = function(){
//选择文件的回调
if(type === 'choose' || options.auto){
options.choose && options.choose(args);
if(type === 'choose'){
return;
}
}
//上传前的回调 - 如果回调函数明确返回false则停止上传(#pulls55)
if(options.before && (options.before(args) === false)) return;
@ -409,6 +401,14 @@ layui.define('layer' , function(exports){
that.msg('选择的'+ typeName +'中包含不支持的格式');
return elemFile.value = '';
}
//选择文件的回调
if(type === 'choose' || options.auto){
options.choose && options.choose(args);
if(type === 'choose'){
return;
}
}
//检验文件数量
that.fileLength = function(){
@ -421,7 +421,10 @@ layui.define('layer' , function(exports){
}();
if(options.number && that.fileLength > options.number){
return that.msg('同时最多只能选择 '+ options.number + ' 个文件');
return that.msg(
'同时最多只能上传: '+ options.number + ' 个文件'
+'<br>您当前已经选择了: '+ that.fileLength +' 个文件'
);
}
//检验文件大小
@ -438,6 +441,7 @@ layui.define('layer' , function(exports){
});
if(limitSize) return that.msg('文件大小不能超过 '+ limitSize);
}
send();
};
@ -521,12 +525,8 @@ layui.define('layer' , function(exports){
othis.removeAttr('lay-over');
setChooseFile(files);
if(options.auto){
that.upload(files);
} else {
setChooseText(files);
}
options.auto ? that.upload() : setChooseText(files); //是否自动触发上传
});
}

View File

@ -189,7 +189,7 @@ layui.define('jquery', function(exports){
return html.replace(/\&amp;/g, '&')
.replace(/\&lt;/g, '<').replace(/\&gt;/g, '>')
.replace(/\&#39;/, '\'').replace(/\&quot;/, '"');
.replace(/\&#39;/g, '\'').replace(/\&quot;/g, '"');
}
//让指定的元素保持在可视区域