Browse Source

发布 v2.9.0-rc.2

pull/1440/head v2.9.0-rc.2
贤心 1 year ago committed by GitHub
parent
commit
3d9a88f7a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .gitee/ISSUE_TEMPLATE/bug.yml
  2. 2
      dist/layui.js
  3. 2
      dist/layui.js.map
  4. 6
      docs/index.md
  5. 6
      docs/util/index.md
  6. 27
      docs/versions.md
  7. 10
      examples/table-test.html
  8. 2
      package.json
  9. 2
      src/layui.js
  10. 4
      src/modules/layer.js
  11. 13
      src/modules/table.js

3
.gitee/ISSUE_TEMPLATE/bug.yml

@ -16,7 +16,8 @@ body:
- type: input
attributes:
label: 版本号
placeholder: 请提供您所使用的 Layui 版本号
placeholder: 请提供您当前使用的 Layui 版本号
description: 若不清楚,可打开 `layui.js`,头部注释有对应的版本号
validations:
required: true
- type: input

2
dist/layui.js vendored

File diff suppressed because one or more lines are too long

2
dist/layui.js.map vendored

File diff suppressed because one or more lines are too long

6
docs/index.md

@ -2,7 +2,7 @@
title: 开始使用
toc: true
---
<h1 id="introduce" lay-toc="{title: '简介'}">开始使用</h1>
> Layui 是一套免费的开源 Web UI 组件库,采用自身轻量级模块化规范,遵循原生态的 HTML/CSS/JavaScript 开发模式,极易上手,拿来即用。其风格简约轻盈,而内在雅致丰盈,甚至包括文档在内的每一处细节都经过精心雕琢,非常适合网页界面的快速构建。Layui 区别于一众主流的前端框架,却并非逆道而行,而是信奉返璞归真之道。确切地说,它更多是面向于追求简单的务实主义者,即无需涉足各类构建工具,只需面向浏览器本身,便可将页面所需呈现的元素与交互信手拈来。
@ -64,7 +64,7 @@ npm i layui
<div class="layui-btn-container">
<a class="layui-btn layui-btn-primary layui-border-black" href="https://unpkg.com/browse/layui/dist/" target="_blank" rel="nofollow">UNPKG</a>
<a class="layui-btn layui-btn-primary" style="border-color: #E64E3D; color: #E64E3D;" href="https://cdnjs.com/libraries/layui" target="_blank" rel="nofollow">CDNJS</a>
<a class="layui-btn layui-btn-primary" style="border-color: #E64E3D; color: #E64E3D;" href="https://cdnjs.com/libraries/layui" target="_blank" rel="nofollow">CDNJS</a>
</div>
@ -101,7 +101,7 @@ npm i layui
// Welcome
layer.msg('Hello World', {icon: 6});
});
</script>
</script>
</body>
</html>
</textarea>

6
docs/util/index.md

@ -28,7 +28,7 @@ toc: true
| [util.escape(str)](#escape) | 转义 HTML 字符 |
| [util.unescape(str)](#escape) | 还原 HTML 字符 |
| [util.openWin(options)](#openWin) <sup>2.8+</sup> | 打开浏览器新标签页 |
| [util.on(attr, obj, eventType)](#on) | 批量事件处理 |
| [util.on(attr, events, options)](#on) | 批量事件处理 |
<h3 id="countdown" class="ws-anchor ws-bold">倒计时</h3>
@ -250,8 +250,8 @@ layui.use('util', function(){
layer.tips(othis.html(), this);
}, 3000) // 3s 内不重复执行
}, {
trigger: 'mouseenter' // 鼠标移入时触发事件
});
trigger: 'mouseenter' // 鼠标移入时触发事件);
})
});
</script>
</textarea>

27
docs/versions.md

@ -10,28 +10,31 @@ toc: true
<h2 id="2.9.x" lay-toc="{title: '2.9.x'}"></h2>
<h2 id="2.9.0" class="ws-anchor">
2.9.0-rc.1
2.9.0-rc.2
<span class="layui-badge-rim">预览版</span>
<span class="layui-badge-rim">2023-11-22</span>
<span class="layui-badge-rim">2023-11-28</span>
</h2>
`2.9.x``2.8.18` 向下兼容,可覆盖升级。
- #### table
- 修复 `complete` 属性导致 `$.ajaxSetup()``complete` 失效的问题 [#1423](https://github.com/layui/layui/pull/1423) [@Sight-wcg](https://github.com/Sight-wcg)
- 修复 单元格展开再收缩后,当列通过拖拽改变过宽度,列存在概率性错位的问题 [28347fc](https://github.com/layui/layui/commit/28347fcf8f97912d6c90d81931f9ed5527dc3627)
- 修复 合计行单元格展开异常的问题 [#I8FH3K](https://gitee.com/layui/layui/issues/I8FH3K)
- 优化 `height` 属性高度铺满语法中不支持浮点型数值的问题 [#I8DSPH](https://gitee.com/layui/layui/issues/I8DSPH)
- 优化 关闭单元格多行展开状态后,悬停状态样式未移除的问题 [#1425](https://github.com/layui/layui/pull/1425) [@Sight-wcg](https://github.com/Sight-wcg)
- 优化 在末行展开单元格后,出现的固定列水平未对其的问题 [#85add62](https://github.com/layui/layui/commit/85add6230c73c72d1a03de2564cab12c98db57f6)
- 修复 `complete` 属性导致 `$.ajaxSetup()``complete` 失效的问题 #1423
- 修复 单元格展开再收缩后,当列通过拖拽改变过宽度,列存在概率性错位的问题 [28347fc]
- 修复 合计行单元格展开异常的问题 #gitee-I8FH3K
- 优化 `height` 属性高度铺满语法中不支持浮点型数值的问题 #gitee-I8DSPH
- 优化 关闭单元格多行展开状态后,悬停状态样式未移除的问题 #1425 @Sight-wcg
- 优化 在末行展开单元格后,出现的固定列水平未对其的问题 [85add62]
- 优化 当数据值为 `0,undefined,null` 且开启列模板,编辑单元格会带入模板字符的问题 [1d408f0]
- #### util
- 优化 `util.on()` 方法,提升参数的灵活性和代码的可读性 [d74abb4](https://github.com/layui/layui/commit/d74abb453cb45ea5d2eb69f0ed7250caf0ab0088) / [92c8580](https://github.com/layui/layui/commit/92c85805c2558bf384292d7adf783d8453cd895a)
- 优化 `util.on()` 方法,提升参数的灵活性和代码的可读性 [d74abb4]
- #### layer
- 优化 `layer.closeLast()` 方法,给第二个参数增加回调 [ab4ded2]
- #### colorpicker
- 优化 colorpicker 内部输入框取值,移除字符串两侧的空白字符 [#1427](https://github.com/layui/layui/pull/1427)
- 优化 colorpicker 内部输入框取值,移除字符串两侧的空白字符 #1427 @Sight-wcg
- #### 其他
- 优化 `lay.clipboard.writeText()` 逻辑,以适配无写入权限时的场景 [#1421](https://github.com/layui/layui/pull/1421) [@Sight-wcg](https://github.com/Sight-wcg)
- 优化 `lay.clipboard.writeText()` 逻辑,以适配无写入权限时的场景 #1421 @Sight-wcg
### 下载: [layui-v2.9.0-beta.1.zip](https://gitee.com/layui/layui/attach_files/1589824/download)
### 下载: [layui-v2.9.0-rc.2.zip](https://gitee.com/layui/layui/attach_files/1595924/download)
---

10
examples/table-test.html

@ -49,7 +49,7 @@
</script>
<script type="text/html" id="usernameTpl">
<a href="" class="layui-table-link">{{d.username || ''}}</a>
<a href="" class="layui-table-link">{{= d.username }}</a>
</script>
<script type="text/html" id="switchTpl">
@ -75,7 +75,9 @@
</div>
</script>
<table id="test"></table>
<div id="parent" style="height: 520px;">
<table id="test"></table>
</div>
<script src="../src/layui.js"></script>
<script>
@ -121,7 +123,7 @@ layui.use(['table', 'dropdown'], function(){
// 渲染
window.ins1 = table.render({
elem: '#test',
height: 520,
height: '#parent-0',
// width: 600,
title: '用户数据表',
url: 'json/table/demo1.json',
@ -166,7 +168,7 @@ layui.use(['table', 'dropdown'], function(){
}, templet: '#usernameTpl'},
{field:'xxx', title:'测试', edit: 'text'},
{field:'email', minWidth: 160, maxWidth: 320, title:'邮箱 <i class="layui-icon layui-icon-email" lay-event="email"></i>', fieldTitle: '邮箱', hide: 0, edit: 'text', style: 'background-color: #fafafa; color: red;', templet: function(d){
return '<em>'+ layui.util.escape(d.email) +'</em>'
return '<em>'+ layui.util.escape(d.email) +'</em>'
}},
{field:'sex', title:'性别', width:80, edit: 'text', sort: true, escape: false},
{field:'city', title:'城市', width:120, templet: '#cityTpl', exportTemplet: function(d, obj){

2
package.json

@ -1,6 +1,6 @@
{
"name": "layui",
"version": "2.9.0-rc.1",
"version": "2.9.0-rc.2",
"description": "Classic modular Front-End UI library",
"keywords": [
"layui",

2
src/layui.js vendored

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

4
src/modules/layer.js

@ -1288,9 +1288,9 @@ layer.closeAll = function(type, callback){
};
// 根据弹层类型关闭最近打开的层
layer.closeLast = function(type){
layer.closeLast = function(type, callback){
type = type || 'page';
layer.close($('.layui-layer-'+ type +':last').attr("times"));
layer.close($('.layui-layer-'+ type +':last').attr("times"), callback);
};

13
src/modules/table.js

@ -353,13 +353,13 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
// 高度铺满:full-差距值
if(options.height && /^full-.+$/.test(options.height)){
that.fullHeightGap = parseFloat(options.height.split('-')[1]) || 0;
options.height = _WIN.height() - that.fullHeightGap;
that.fullHeightGap = options.height.split('-')[1];
options.height = _WIN.height() - (parseFloat(that.fullHeightGap) || 0);
} else if (options.height && /^#\w+\S*-.+$/.test(options.height)) {
var parentDiv = options.height.split("-");
that.parentHeightGap = parseFloat(parentDiv.pop()) || 0;
that.parentHeightGap = parentDiv.pop();
that.parentDiv = parentDiv.join("-");
options.height = $(that.parentDiv).height() - that.parentHeightGap;
options.height = $(that.parentDiv).height() - (parseFloat(that.parentHeightGap) || 0);
}
// 开始插入替代元素
@ -2379,8 +2379,9 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
}
return inputElem;
}());
input[0].value = othis.data('content') || data[field] || elemCell.text();
input[0].value = function(val) {
return (val === undefined || val === null) ? '' : val;
}(othis.data('content') || data[field]);
othis.find('.'+ELEM_EDIT)[0] || othis.append(input);
input.focus();
e && layui.stope(e);

Loading…
Cancel
Save