Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/modules/table.js
pull/1224/head
sunxiaobin89 2023-03-13 09:05:11 +08:00
commit d7cc60281e
7 changed files with 46 additions and 38 deletions

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

@ -1,6 +1,6 @@
{
"name": "layui",
"version": "2.8.0-rc.12",
"version": "2.8.0-rc.13",
"description": "Classic modular Front-End UI library",
"main": "dist/layui.js",
"license": "MIT",

View File

@ -29,6 +29,7 @@ a cite{font-style: normal; *cursor:pointer;}
/* 消除第三方ui可能造成的冲突 */.layui-box, .layui-box *{box-sizing: content-box;}
.layui-clear{clear: both; *zoom: 1;}
.layui-clear:after{content:'\20'; clear:both; *zoom:1; display:block; height:0;}
.layui-clear-space{word-spacing: -5px;}
.layui-inline{position: relative; display: inline-block; *display:inline; *zoom:1; vertical-align: middle;}
/* 三角形 */.layui-edge{position: relative; display: inline-block; vertical-align: middle; width: 0; height: 0; border-width: 6px; border-style: dashed; border-color: transparent; overflow: hidden;}
.layui-edge-top{top: -4px; border-bottom-color: #999; border-bottom-style: solid;}
@ -47,12 +48,12 @@ a cite{font-style: normal; *cursor:pointer;}
/** 图标字体 **/
@font-face {
font-family: 'layui-icon';
src: url('../font/iconfont.eot?v=256');
src: url('../font/iconfont.eot?v=256#iefix') format('embedded-opentype'),
url('../font/iconfont.woff2?v=256') format('woff2'),
url('../font/iconfont.woff?v=256') format('woff'),
url('../font/iconfont.ttf?v=256') format('truetype'),
url('../font/iconfont.svg?v=256#layui-icon') format('svg');
src: url('../font/iconfont.eot?v=280');
src: url('../font/iconfont.eot?v=280#iefix') format('embedded-opentype'),
url('../font/iconfont.woff2?v=280') format('woff2'),
url('../font/iconfont.woff?v=280') format('woff'),
url('../font/iconfont.ttf?v=280') format('truetype'),
url('../font/iconfont.svg?v=280#layui-icon') format('svg');
}
.layui-icon{
@ -1016,7 +1017,6 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-table-tool-panel li .layui-form-checkbox[lay-skin="primary"] span{padding: 0;}
.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left: auto; right: -1px;}
.layui-table-col-special{word-spacing: -5px;}
.layui-table-col-set{position: absolute; right: 0; top: 0; width: 20px; height: 100%; border-width: 0; border-left-width: 1px; background-color: #fff;}
.layui-table-sort{width: 10px; height: 20px; margin-left: 5px; cursor: pointer!important;}
@ -1344,9 +1344,9 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
.layui-carousel[lay-indicator="outside"] .layui-carousel-ind ul{background-color: rgba(0,0,0,.5);}
.layui-carousel[lay-indicator="none"] .layui-carousel-ind{display: none;}
.layui-carousel-ind ul{display: inline-block; padding: 5px; background-color: rgba(0,0,0,.2); border-radius: 10px; -webkit-transition-duration: .3s; transition-duration: .3s;}
.layui-carousel-ind li{display: inline-block; width: 10px; height: 10px; margin: 0 3px; font-size: 14px; background-color: #eee; background-color: rgba(255,255,255,.5); border-radius: 50%; cursor: pointer; -webkit-transition-duration: .3s; transition-duration: .3s;}
.layui-carousel-ind li:hover{background-color: rgba(255,255,255,.7);}
.layui-carousel-ind li.layui-this{background-color: #fff;}
.layui-carousel-ind ul li{display: inline-block; width: 10px; height: 10px; margin: 0 3px; font-size: 14px; background-color: #eee; background-color: rgba(255,255,255,.5); border-radius: 50%; cursor: pointer; -webkit-transition-duration: .3s; transition-duration: .3s;}
.layui-carousel-ind ul li:hover{background-color: rgba(255,255,255,.7);}
.layui-carousel-ind ul li.layui-this{background-color: #fff;}
.layui-carousel>*[carousel-item]>.layui-this,
.layui-carousel>*[carousel-item]>.layui-carousel-prev,
.layui-carousel>*[carousel-item]>.layui-carousel-next{display: block}

View File

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

View File

@ -153,9 +153,9 @@ layui.define('jquery', function(exports){
,tabDelete: function(e, othis){
var li = othis || $(this).parent();
var index = li.index();
var parents = li.parents('.layui-tab').eq(0);
var item = parents.children('.layui-tab-content>.layui-tab-item');
var filter = parents.attr('lay-filter');
var tabElem = li.closest('.layui-tab');
var item = tabElem.children('.layui-tab-content').children('.layui-tab-item');
var filter = tabElem.attr('lay-filter');
if(li.hasClass(THIS)){
if (li.next()[0] && li.next().is('li')){
@ -174,7 +174,7 @@ layui.define('jquery', function(exports){
}, 50);
layui.event.call(this, MOD_NAME, 'tabDelete('+ filter +')', {
elem: parents,
elem: tabElem,
index: index
});
}

View File

@ -991,7 +991,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
var startLimit = curr*options.limit - options.limit;
var newData = options.data.concat();
res[response.dataName] = options.page
res[response.dataName] = options.page
? newData.splice(startLimit, options.limit)
: newData;
res[response.countName] = options.data.length;
@ -1352,7 +1352,6 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
// td 容器
var td = ['<td data-field="'+ field +'" data-key="'+ item3.key +'" '+ function(){
var attr = [];
if(item3.align) attr.push('align="'+ item3.align +'"'); // 对齐方式
if(item3.minWidth) attr.push('data-minwidth="'+ item3.minWidth +'"'); // 单元格最小宽度
if(item3.maxWidth) attr.push('data-maxwidth="'+ item3.maxWidth +'"'); // 单元格最小宽度
return attr.join(' ');
@ -1368,6 +1367,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
: (key + ' laytable-cell-' + item3.type);
}() +'"'+ function(){
var attr = [];
if(item3.align) attr.push('align="'+ item3.align +'"'); // 对齐方式
if(item3.style) attr.push('style="'+ item3.style +'"'); // 自定义单元格样式
return attr.join(' ');
}() +'>' + function(){
@ -1691,19 +1691,19 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
//滚动条补丁
Class.prototype.scrollPatch = function(){
var that = this
,layMainTable = that.layMain.children('table')
,scollWidth = that.layMain.width() - that.layMain.prop('clientWidth') //纵向滚动条宽度
,scollHeight = that.layMain.height() - that.layMain.prop('clientHeight') //横向滚动条高度
,getScrollWidth = that.getScrollWidth(that.layMain[0]) //获取主容器滚动条宽度,如果有的话
,outWidth = layMainTable.outerWidth() - that.layMain.width() //表格内容器的超出宽度
var that = this;
var layMainTable = that.layMain.children('table');
var scollWidth = that.layMain.width() - that.layMain.prop('clientWidth'); // 纵向滚动条宽度
var scollHeight = that.layMain.height() - that.layMain.prop('clientHeight'); // 横向滚动条高度
var getScrollWidth = that.getScrollWidth(that.layMain[0]); // 获取主容器滚动条宽度,如果有的话
var outWidth = layMainTable.outerWidth() - that.layMain.width(); // 表格内容器的超出宽度
//添加补丁
,addPatch = function(elem){
// 添加补丁
var addPatch = function(elem){
if(scollWidth && scollHeight){
elem = elem.eq(0);
if(!elem.find('.layui-table-patch')[0]){
var patchElem = $('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); //补丁元素
var patchElem = $('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); // 补丁元素
patchElem.find('div').css({
width: scollWidth
});
@ -1712,20 +1712,28 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
} else {
elem.find('.layui-table-patch').remove();
}
}
};
addPatch(that.layHeader);
addPatch(that.layTotal);
//固定列区域高度
var mainHeight = that.layMain.height()
,fixHeight = mainHeight - scollHeight;
that.layFixed.find(ELEM_BODY).css('height', layMainTable.height() >= fixHeight ? fixHeight : 'auto');
// 固定列区域高度
var mainHeight = that.layMain.height();
var fixHeight = mainHeight - scollHeight;
//表格宽度小于容器宽度时或者数据异常(包括无数据),隐藏固定列
that.layFixRight[table.cache[that.key].length && outWidth > 0 ? 'removeClass' : 'addClass'](HIDE);
that.layFixed.find(ELEM_BODY).css(
'height',
layMainTable.height() >= fixHeight ? fixHeight : 'auto'
);
// 表格宽度小于容器宽度时,隐藏固定列
that.layFixRight[
table.cache[that.key].length && outWidth > 0
? 'removeClass'
: 'addClass'
](HIDE);
//操作栏
// 操作栏
that.layFixRight.css('right', scollWidth - 1);
};
@ -1953,6 +1961,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
var key = th.data('key');
var col = thatTable.col(key);
var filter = thatTable.config.elem.attr('lay-filter');
// 重置过度信息
dict = {};
@ -2086,7 +2095,6 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
// 设置行选中状态
,setRowChecked: function(opts){
that.setRowChecked($.extend({
type: 'radio',
index: index
}, opts));
}