Browse Source

发布 v2.9.0-rc.3

pull/1440/head
贤心 12 months ago committed by GitHub
parent
commit
b47e652661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dist/layui.js
  2. 2
      dist/layui.js.map
  3. 2
      docs/class/index.md
  4. 6
      docs/fixbar/detail/demo.md
  5. 2
      docs/form/index.md
  6. 8
      docs/index.md
  7. 5
      docs/layer/index.md
  8. 4
      docs/layout/index.md
  9. 6
      docs/menu/examples/demo.md
  10. 6
      docs/nav/examples/side.md
  11. 4
      docs/table/examples/css.md
  12. 4
      docs/table/examples/demo.md
  13. 2
      docs/table/examples/init.md
  14. 14
      docs/table/examples/static.md
  15. 2
      docs/transfer/detail/demo.md
  16. 6
      docs/upload/detail/options.md
  17. 4
      docs/util/index.md
  18. 60
      docs/versions.md
  19. 2
      examples/table-test.html
  20. 2
      package.json
  21. 2
      src/layui.js
  22. 2
      src/modules/form.js
  23. 5
      src/modules/tree.js
  24. 4
      src/modules/util.js

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

2
docs/class/index.md

@ -137,7 +137,7 @@ toc: true
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body>
<div class="layui-text" style="padding: 16px;">

6
docs/fixbar/detail/demo.md

@ -8,14 +8,14 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body>
<div id="target-test" style="position: relative; padding: 16px;">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
layui.use(function(){
var util = layui.util;
@ -66,4 +66,4 @@ layui.use(function(){
</body>
</html>
</textarea>
</pre>
</pre>

2
docs/form/index.md

@ -142,7 +142,7 @@ form 还可以借助*栅格*实现更灵活的响应式布局。
layui.use(function(){
var form = layui.form;
// 当表单元素被插入插入时,需进行组件渲染才能显示
// 当表单元素被动态插入时,需主动进行组件渲染才能显示
form.render(); // 渲染全部表单
form.render('select'); // 仅渲染 select 元素
form.render(null, 'test'); // 仅渲染 lay-filter="test" 的容器内的全部表单

8
docs/index.md

@ -70,11 +70,11 @@ npm i layui
```
<!-- 引入 layui.css -->
<link href="//unpkg.com/layui@{{= d.layui.v }}/dist/css/layui.css" rel="stylesheet">
<link href="//unpkg.com/layui@{{= d.layui[2].v }}/dist/css/layui.css" rel="stylesheet">
```
```
<!-- 引入 layui.js -->
<script src="//unpkg.com/layui@{{= d.layui.v }}/dist/layui.js"></script>
<script src="//unpkg.com/layui@{{= d.layui[2].v }}/dist/layui.js"></script>
```
<h2 id="quickstart" lay-toc="{}">快速上手</h2>
@ -89,11 +89,11 @@ npm i layui
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Quick Start - Layui</title>
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body>
<!-- HTML Content -->
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
// Usage
layui.use(function(){

5
docs/layer/index.md

@ -34,7 +34,7 @@ toc: true
| 关闭 : | - |
| [layer.close(index, callback)](#close) | 关闭对应的层,核心方法。 |
| [layer.closeAll(type, callback)](#closeAll) | 关闭所有对应类型的层。 |
| [layer.closeLast(type)](#closeLast) <sup>2.8+</sup> | 关闭最近打开的对应类型的层。 |
| [layer.closeLast(type, callback)](#closeLast) <sup>2.8+</sup> | 关闭最近打开的对应类型的层。 |
| 其他 : | - |
| [layer.config(options)](#config) | 全局配置默认属性。 |
| [layer.ready(callback)](#ready) | 样式初始化就绪。 |
@ -385,9 +385,10 @@ layer.closeAll('tips'); // 关闭所有的 tips 层
<h2 id="closeLast" lay-pid="api" class="ws-anchor ws-bold">关闭最近一次打开的层 <sup>2.8+</sup></h2>
`layer.closeLast(type);`
`layer.closeLast(type, callback);`
- 参数 `type` : 弹层的类型。可选值:`dialog,page,iframe,loading,tips`
- 参数 `callback` : 关闭弹层后的回调函数
该方法用于关闭最近一次打开的对应类型的层。

4
docs/layout/index.md

@ -19,7 +19,7 @@ toc: true
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body>
<div class="layui-layout layui-layout-admin">
@ -111,7 +111,7 @@ toc: true
</div>
</div>
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
//JS
layui.use(['element', 'layer', 'util'], function(){

6
docs/menu/examples/demo.md

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body class="layui-bg-gray">
<div class="layui-panel" style="width: 260px; margin: 16px;">
@ -97,7 +97,7 @@
</ul>
</div>
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
layui.use(function(){
var dropdown = layui.dropdown;
@ -114,4 +114,4 @@ layui.use(function(){
});
</script>
</body>
</html>
</html>

6
docs/nav/examples/side.md

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body>
<ul class="layui-nav layui-nav-tree layui-nav-side">
@ -31,7 +31,7 @@
<li class="layui-nav-item"><a href="javascript:;">菜单3</a></li>
</ul>
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
layui.use(function(){
var element = layui.element;
@ -39,4 +39,4 @@ layui.use(function(){
});
</script>
</body>
</html>
</html>

4
docs/table/examples/css.md

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
<style>
/* 自定义样式 */
.layui-table-testcss .layui-table-header,
@ -40,7 +40,7 @@
</div>
!}}</script>
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
layui.use(['table'], function(){
var table = layui.table;

4
docs/table/examples/demo.md

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{= d.layui.cdn.css }}" rel="stylesheet">
<link href="{{= d.layui[2].cdn.css }}" rel="stylesheet">
</head>
<body>
<!--
@ -46,7 +46,7 @@
</div>
</script>
<script src="{{= d.layui.cdn.js }}"></script>
<script src="{{= d.layui[2].cdn.js }}"></script>
<script>
layui.use(['table', 'dropdown'], function(){
var table = layui.table;

2
docs/table/examples/init.md

@ -14,7 +14,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>

14
docs/table/examples/static.md

@ -17,7 +17,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>
@ -46,7 +46,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>
@ -75,7 +75,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>
@ -104,7 +104,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>
@ -133,7 +133,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>
@ -162,7 +162,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>
@ -191,7 +191,7 @@
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋远方来,不亦乐乎</td>
<td>有朋远方来,不亦乐乎</td>
</tr>
<tr>
<td>孟子</td>

2
docs/transfer/detail/demo.md

@ -136,7 +136,7 @@ layui.use(function(){
transfer.render({
elem: '#ID-transfer-demo-showSearch',
data: data,
title: ['文墨客', '获奖文人'],
title: ['文墨客', '获奖文人'],
showSearch: true
});
});

6
docs/upload/detail/options.md

@ -100,7 +100,11 @@ data: {
</td>
<td>string</td>
<td>-</td>
<td>
`json`
</td>
</tr>
<tr>
<td>

4
docs/util/index.md

@ -250,8 +250,8 @@ layui.use('util', function(){
layer.tips(othis.html(), this);
}, 3000) // 3s 内不重复执行
}, {
trigger: 'mouseenter' // 鼠标移入时触发事件);
})
trigger: 'mouseenter' // 鼠标移入时触发事件
});
});
</script>
</textarea>

60
docs/versions.md

@ -18,23 +18,69 @@ toc: true
`2.9.x``2.8.18` 向下兼容,可覆盖升级。
- #### table
- 修复 `complete` 属性导致 `$.ajaxSetup()``complete` 失效的问题 #1423
- 修复 `complete` 属性导致 `$.ajaxSetup()``complete` 失效的问题 #1423 @Sight-wcg
- 修复 单元格展开再收缩后,当列通过拖拽改变过宽度,列存在概率性错位的问题 [28347fc]
- 修复 合计行单元格展开异常的问题 #gitee-I8FH3K
- 优化 `height` 属性高度铺满语法中不支持浮点型数值的问题 #gitee-I8DSPH
- 修复 合计行单元格展开异常的问题 #Gitee-I8FH3K
- 优化 `height` 属性高度铺满语法中不支持浮点型数值的问题 #Gitee-I8DSPH
- 优化 关闭单元格多行展开状态后,悬停状态样式未移除的问题 #1425 @Sight-wcg
- 优化 在末行展开单元格后,出现的固定列水平未对其的问题 [85add62]
- 优化 当数据值为 `0,undefined,null` 且开启列模板,编辑单元格会带入模板字符的问题 [1d408f0]
- #### util
- 优化 `util.on()` 方法,提升参数的灵活性和代码的可读性 [d74abb4]
- 优化 `util.on()` 方法,提升参数的灵活性和代码的可读性 [d74abb4] [92c8580]
- #### layer
- 优化 `layer.closeLast()` 方法,给第二个参数增加回调 [ab4ded2]
- 优化 `layer.closeLast()` 方法,给第二个参数增加回调函数 [ab4ded2]
- #### tree
- 修复 `title` 有特殊字符时点击编辑的显示问题 #1432 @Sight-wcg
- #### colorpicker
- 优化 colorpicker 内部输入框取值,移除字符串两侧的空白字符 #1427 @Sight-wcg
- 优化 内部输入框取值,移除字符串两侧的空白字符 #1427 @Sight-wcg
- #### 其他
- 优化 `lay.clipboard.writeText()` 逻辑,以适配无写入权限时的场景 #1421 @Sight-wcg
### 下载: [layui-v2.9.0-rc.2.zip](https://gitee.com/layui/layui/attach_files/1595924/download)
### 下载: [layui-v2.9.0-rc.3.zip](https://gitee.com/layui/layui/attach_files/1597292/download)
<script>
(function(){
// 解析更新日志关联链接
var elem = document.querySelectorAll('#WS-text li');
elem.forEach(function (item) {
item.childNodes.forEach(function (node) {
if (node.nodeType === 3) {
var nodeValue = node.nodeValue;
var types = [
{
rule: /(#)Gitee-(\S+)/g,
href: 'https://gitee.com/layui/layui/issues/'
},
{
rule: /(#)(\d+)/g,
href: 'https://github.com/layui/layui/pull/'
},
{
rule: /\[()([\d\w]+)\]/g,
href: 'https://github.com/layui/layui/commit/'
},
{
rule: /(@)(\S+)/g,
href: 'https://github.com/'
}
];
var i = 0;
var sNode = document.createElement('span');
for (; i < types.length; i++) {
if (types[i].rule.test(nodeValue)) {
nodeValue = nodeValue.replace(types[i].rule, function(s, s1, s2) {
return '<a href="'+ types[i].href + s2 +'" target="_blank">'+ s1 + s2 +'</a>';
});
}
}
sNode.innerHTML = nodeValue;
node.parentNode.insertBefore(sNode, node);
node.parentNode.removeChild(node);
}
});
});
})();
</script>
---

2
examples/table-test.html

@ -168,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.2",
"version": "2.9.0-rc.3",
"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.2'; // Layui 版本号
this.v = '2.9.0-rc.3'; // Layui 版本号
};
// 识别预先可能定义的指定全局对象

2
src/modules/form.js

@ -468,7 +468,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
dl.scrollTop(posTop + dl.scrollTop() - dlHeight + ddHeight - 5);
}
// 若选择素在滚动条不可见顶部
// 若选择素在滚动条不可见顶部
if(posTop < 0){
dl.scrollTop(posTop + dl.scrollTop() - 5);
}

5
src/modules/tree.js

@ -2,12 +2,13 @@
* tree 树组件
*/
layui.define('form', function(exports){
layui.define(['form','util'], function(exports){
"use strict";
var $ = layui.$;
var form = layui.form;
var layer = layui.layer;
var util = layui.util;
// 模块名
var MOD_NAME = 'tree';
@ -547,7 +548,7 @@ layui.define('form', function(exports){
// 添加输入框,覆盖在文字上方
elemMain.append('<input type="text" class="layui-tree-editInput">');
// 获取焦点
elemMain.children('.layui-tree-editInput').val(text).focus();
elemMain.children('.layui-tree-editInput').val(util.unescape(text)).focus();
// 嵌入文字移除输入框
var getVal = function(input){
var textNew = input.val().trim();

4
src/modules/util.js

@ -386,9 +386,9 @@ layui.define('jquery', function(exports){
/**
* 批量事件
* @param {string} [attr="lay-on"] - 触发事件的元素属性名
* @param {Object.<string, Function} events - 事件集合
* @param {Object.<string, Function>} events - 事件集合
* @param {Object} [options] - 参数的更多选项
* @param {(string|HTMLElement|jQuery)} [options.elem="body"] - 触发事件的委托元素
* @param {(string|HTMLElement|JQuery)} [options.elem="body"] - 触发事件的委托元素
* @param {string} [options.trigger="click"] - 事件触发的方式
* @returns {Object} 返回当前 events 参数设置的事件集合
*/

Loading…
Cancel
Save