mirror of
https://github.com/layui/layui.git
synced 2026-02-09 02:09:18 +08:00
release: v3.0.0-alpha.2
This commit is contained in:
6
dist/components/dropdown.js
vendored
6
dist/components/dropdown.js
vendored
@@ -171,8 +171,10 @@ Class.prototype.init = function (rerender, type) {
|
||||
// 初始即显示或者面板弹出之后执行了刷新数据
|
||||
if (options.show || type === 'reloadData' && that.mainElem && options.target.find(that.mainElem.get(0)).length) that.render(type);
|
||||
|
||||
// 事件
|
||||
that.events();
|
||||
// 若面板已经打开,则无需再绑定目标元素事件,避免 render 重复执行
|
||||
if (!elem.data(MOD_INDEX_OPENED)) {
|
||||
that.events(); // 事件
|
||||
}
|
||||
};
|
||||
|
||||
// 渲染
|
||||
|
||||
2
dist/components/flow.js
vendored
2
dist/components/flow.js
vendored
@@ -161,7 +161,7 @@ $.extend(component, {
|
||||
item.attr('src', src).removeAttr('lay-src');
|
||||
|
||||
/* 当前图片加载就绪后,检测下一个图片是否在当前屏 */
|
||||
next[0] && render(next);
|
||||
next[0] && fn(next);
|
||||
index++;
|
||||
}, function () {
|
||||
item.removeAttr('lay-src');
|
||||
|
||||
28
dist/components/table.js
vendored
28
dist/components/table.js
vendored
@@ -931,8 +931,25 @@ Class.prototype.setColsWidth = function (opt) {
|
||||
};
|
||||
|
||||
// 重置表格尺寸/结构
|
||||
Class.prototype.resize = function () {
|
||||
var RESIZE_THRESHOLD = 2;
|
||||
Class.prototype.resize = function (entry) {
|
||||
var that = this;
|
||||
|
||||
// 仅由 resizeObserver 触发时生效
|
||||
if (entry) {
|
||||
// 当表格被隐藏时,不触发 resize
|
||||
if (entry.contentRect.height === 0 && entry.contentRect.width === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 忽略微小的尺寸变化
|
||||
var shouldIgnore = entry.target._lay_lastSize && Math.abs(entry.target._lay_lastSize.height - entry.contentRect.height) < RESIZE_THRESHOLD && Math.abs(entry.target._lay_lastSize.width - entry.contentRect.width) < RESIZE_THRESHOLD;
|
||||
if (shouldIgnore) return;
|
||||
entry.target._lay_lastSize = {
|
||||
height: entry.contentRect.height,
|
||||
width: entry.contentRect.width
|
||||
};
|
||||
}
|
||||
var tableElemIsConnected = that.layMain && ('isConnected' in that.layMain[0] ? that.layMain[0].isConnected : $.contains(document.body, that.layMain[0]));
|
||||
if (!tableElemIsConnected) return;
|
||||
that.fullSize(); // 让表格铺满
|
||||
@@ -2151,13 +2168,18 @@ Class.prototype.events = function () {
|
||||
thisTable.docEvent = true;
|
||||
|
||||
// 排序
|
||||
th.on('click', function () {
|
||||
th.on('click', function (e) {
|
||||
var othis = $(this);
|
||||
var elemSort = othis.find(ELEM_SORT);
|
||||
var nowType = elemSort.attr('lay-sort');
|
||||
var type;
|
||||
|
||||
// 排序不触发的条件
|
||||
// 表头工具元素不触发排序
|
||||
if ($(e.target).closest('[lay-event]')[0]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 其他条件不触发排序
|
||||
if (!elemSort[0] || othis.data('resizing') === 1) {
|
||||
return othis.removeData('resizing');
|
||||
}
|
||||
|
||||
22
dist/core/layui.js
vendored
22
dist/core/layui.js
vendored
@@ -29,7 +29,7 @@ var cache = {
|
||||
|
||||
// constructor
|
||||
var Class = function () {
|
||||
this.v = '3.0.0-alpha.1'; // 版本号
|
||||
this.v = '3.0.0-alpha.2'; // 版本号
|
||||
};
|
||||
|
||||
// 识别预先可能定义的指定全局对象
|
||||
@@ -202,13 +202,13 @@ Class.prototype.config = function (options) {
|
||||
Class.prototype.define = function (deps, callback) {
|
||||
var that = this;
|
||||
var useCallback = function () {
|
||||
var setModule = function (mod, exports) {
|
||||
layui[mod] = exports; // 将模块接口赋值在 layui 对象中
|
||||
var setModule = function (mod, exports$1) {
|
||||
layui[mod] = exports$1; // 将模块接口赋值在 layui 对象中
|
||||
cache.status[mod] = true; // 标记模块注册完成
|
||||
};
|
||||
// 执行模块的回调
|
||||
typeof callback === 'function' && callback(function (mod, exports) {
|
||||
setModule(mod, exports);
|
||||
typeof callback === 'function' && callback(function (mod, exports$1) {
|
||||
setModule(mod, exports$1);
|
||||
// 记录模块回调,以便需要时再执行
|
||||
cache.callback[mod] = function () {
|
||||
callback(setModule);
|
||||
@@ -231,7 +231,7 @@ Class.prototype.define = function (deps, callback) {
|
||||
* @param {(string|string[])} mods - 模块列表
|
||||
* @param {Function} callback - 回调
|
||||
*/
|
||||
Class.prototype.use = function (mods, callback, exports, from) {
|
||||
Class.prototype.use = function (mods, callback, exports$1, from) {
|
||||
var that = this;
|
||||
var dir = config.dir = config.dir ? config.dir : getPath;
|
||||
|
||||
@@ -267,7 +267,7 @@ Class.prototype.use = function (mods, callback, exports, from) {
|
||||
}
|
||||
|
||||
// 将模块的接口作为回调的参数传递
|
||||
exports = exports || [];
|
||||
exports$1 = exports$1 || [];
|
||||
|
||||
// 加载当前队列的第一个模块
|
||||
var item = mods[0];
|
||||
@@ -277,15 +277,15 @@ Class.prototype.use = function (mods, callback, exports, from) {
|
||||
|
||||
// 回调触发
|
||||
var onCallback = function () {
|
||||
exports.push(layui[item]);
|
||||
mods.length > 1 ? that.use(mods.slice(1), callback, exports, from) : typeof callback === 'function' && function () {
|
||||
exports$1.push(layui[item]);
|
||||
mods.length > 1 ? that.use(mods.slice(1), callback, exports$1, from) : typeof callback === 'function' && function () {
|
||||
// 保证文档加载完毕再执行回调
|
||||
if (layui.jquery && typeof layui.jquery === 'function' && from !== 'define') {
|
||||
return layui.jquery(function () {
|
||||
callback.apply(layui, exports);
|
||||
callback.apply(layui, exports$1);
|
||||
});
|
||||
}
|
||||
callback.apply(layui, exports);
|
||||
callback.apply(layui, exports$1);
|
||||
}();
|
||||
};
|
||||
|
||||
|
||||
2
dist/css/layui.css
vendored
2
dist/css/layui.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/layui.css.map
vendored
2
dist/css/layui.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/layui.esm.js
vendored
2
dist/layui.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/layui.esm.js.map
vendored
2
dist/layui.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/layui.js
vendored
2
dist/layui.js
vendored
File diff suppressed because one or more lines are too long
2
dist/layui.js.map
vendored
2
dist/layui.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -16,6 +16,7 @@ toc: true
|
||||
v3.0.0-alpha
|
||||
</h2>
|
||||
|
||||
- https://github.com/layui/layui/releases/tag/v3.0.0-alpha.2
|
||||
- https://github.com/layui/layui/releases/tag/v3.0.0-alpha.1
|
||||
- https://github.com/layui/layui/releases/tag/v3.0.0-alpha.0
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "layui",
|
||||
"description": "Classic Web UI Component Library",
|
||||
"version": "3.0.0-alpha.1",
|
||||
"version": "3.0.0-alpha.2",
|
||||
"type": "module",
|
||||
"keywords": [
|
||||
"layui",
|
||||
|
||||
2
tests/visual/assets/dist/css/layui.css.map
vendored
2
tests/visual/assets/dist/css/layui.css.map
vendored
File diff suppressed because one or more lines are too long
22
tests/visual/assets/dist/layui.esm.js
vendored
22
tests/visual/assets/dist/layui.esm.js
vendored
@@ -29,7 +29,7 @@ var cache$1 = {
|
||||
|
||||
// constructor
|
||||
var Class$g = function () {
|
||||
this.v = '3.0.0-alpha.1'; // 版本号
|
||||
this.v = '3.0.0-alpha.2'; // 版本号
|
||||
};
|
||||
|
||||
// 识别预先可能定义的指定全局对象
|
||||
@@ -202,13 +202,13 @@ Class$g.prototype.config = function (options) {
|
||||
Class$g.prototype.define = function (deps, callback) {
|
||||
var that = this;
|
||||
var useCallback = function () {
|
||||
var setModule = function (mod, exports) {
|
||||
layui[mod] = exports; // 将模块接口赋值在 layui 对象中
|
||||
var setModule = function (mod, exports$1) {
|
||||
layui[mod] = exports$1; // 将模块接口赋值在 layui 对象中
|
||||
cache$1.status[mod] = true; // 标记模块注册完成
|
||||
};
|
||||
// 执行模块的回调
|
||||
typeof callback === 'function' && callback(function (mod, exports) {
|
||||
setModule(mod, exports);
|
||||
typeof callback === 'function' && callback(function (mod, exports$1) {
|
||||
setModule(mod, exports$1);
|
||||
// 记录模块回调,以便需要时再执行
|
||||
cache$1.callback[mod] = function () {
|
||||
callback(setModule);
|
||||
@@ -231,7 +231,7 @@ Class$g.prototype.define = function (deps, callback) {
|
||||
* @param {(string|string[])} mods - 模块列表
|
||||
* @param {Function} callback - 回调
|
||||
*/
|
||||
Class$g.prototype.use = function (mods, callback, exports, from) {
|
||||
Class$g.prototype.use = function (mods, callback, exports$1, from) {
|
||||
var that = this;
|
||||
var dir = config$3.dir = config$3.dir ? config$3.dir : getPath;
|
||||
|
||||
@@ -267,7 +267,7 @@ Class$g.prototype.use = function (mods, callback, exports, from) {
|
||||
}
|
||||
|
||||
// 将模块的接口作为回调的参数传递
|
||||
exports = exports || [];
|
||||
exports$1 = exports$1 || [];
|
||||
|
||||
// 加载当前队列的第一个模块
|
||||
var item = mods[0];
|
||||
@@ -277,15 +277,15 @@ Class$g.prototype.use = function (mods, callback, exports, from) {
|
||||
|
||||
// 回调触发
|
||||
var onCallback = function () {
|
||||
exports.push(layui[item]);
|
||||
mods.length > 1 ? that.use(mods.slice(1), callback, exports, from) : typeof callback === 'function' && function () {
|
||||
exports$1.push(layui[item]);
|
||||
mods.length > 1 ? that.use(mods.slice(1), callback, exports$1, from) : typeof callback === 'function' && function () {
|
||||
// 保证文档加载完毕再执行回调
|
||||
if (layui.jquery && typeof layui.jquery === 'function' && from !== 'define') {
|
||||
return layui.jquery(function () {
|
||||
callback.apply(layui, exports);
|
||||
callback.apply(layui, exports$1);
|
||||
});
|
||||
}
|
||||
callback.apply(layui, exports);
|
||||
callback.apply(layui, exports$1);
|
||||
}();
|
||||
};
|
||||
|
||||
|
||||
2
tests/visual/assets/dist/layui.esm.js.map
vendored
2
tests/visual/assets/dist/layui.esm.js.map
vendored
File diff suppressed because one or more lines are too long
22
tests/visual/assets/dist/layui.js
vendored
22
tests/visual/assets/dist/layui.js
vendored
@@ -32,7 +32,7 @@ var layui = (function () {
|
||||
|
||||
// constructor
|
||||
var Class$g = function () {
|
||||
this.v = '3.0.0-alpha.1'; // 版本号
|
||||
this.v = '3.0.0-alpha.2'; // 版本号
|
||||
};
|
||||
|
||||
// 识别预先可能定义的指定全局对象
|
||||
@@ -205,13 +205,13 @@ var layui = (function () {
|
||||
Class$g.prototype.define = function (deps, callback) {
|
||||
var that = this;
|
||||
var useCallback = function () {
|
||||
var setModule = function (mod, exports) {
|
||||
layui[mod] = exports; // 将模块接口赋值在 layui 对象中
|
||||
var setModule = function (mod, exports$1) {
|
||||
layui[mod] = exports$1; // 将模块接口赋值在 layui 对象中
|
||||
cache$1.status[mod] = true; // 标记模块注册完成
|
||||
};
|
||||
// 执行模块的回调
|
||||
typeof callback === 'function' && callback(function (mod, exports) {
|
||||
setModule(mod, exports);
|
||||
typeof callback === 'function' && callback(function (mod, exports$1) {
|
||||
setModule(mod, exports$1);
|
||||
// 记录模块回调,以便需要时再执行
|
||||
cache$1.callback[mod] = function () {
|
||||
callback(setModule);
|
||||
@@ -234,7 +234,7 @@ var layui = (function () {
|
||||
* @param {(string|string[])} mods - 模块列表
|
||||
* @param {Function} callback - 回调
|
||||
*/
|
||||
Class$g.prototype.use = function (mods, callback, exports, from) {
|
||||
Class$g.prototype.use = function (mods, callback, exports$1, from) {
|
||||
var that = this;
|
||||
var dir = config$3.dir = config$3.dir ? config$3.dir : getPath;
|
||||
|
||||
@@ -270,7 +270,7 @@ var layui = (function () {
|
||||
}
|
||||
|
||||
// 将模块的接口作为回调的参数传递
|
||||
exports = exports || [];
|
||||
exports$1 = exports$1 || [];
|
||||
|
||||
// 加载当前队列的第一个模块
|
||||
var item = mods[0];
|
||||
@@ -280,15 +280,15 @@ var layui = (function () {
|
||||
|
||||
// 回调触发
|
||||
var onCallback = function () {
|
||||
exports.push(layui[item]);
|
||||
mods.length > 1 ? that.use(mods.slice(1), callback, exports, from) : typeof callback === 'function' && function () {
|
||||
exports$1.push(layui[item]);
|
||||
mods.length > 1 ? that.use(mods.slice(1), callback, exports$1, from) : typeof callback === 'function' && function () {
|
||||
// 保证文档加载完毕再执行回调
|
||||
if (layui.jquery && typeof layui.jquery === 'function' && from !== 'define') {
|
||||
return layui.jquery(function () {
|
||||
callback.apply(layui, exports);
|
||||
callback.apply(layui, exports$1);
|
||||
});
|
||||
}
|
||||
callback.apply(layui, exports);
|
||||
callback.apply(layui, exports$1);
|
||||
}();
|
||||
};
|
||||
|
||||
|
||||
2
tests/visual/assets/dist/layui.js.map
vendored
2
tests/visual/assets/dist/layui.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user