mirror of https://github.com/layui/layui
Merge branch 'layui:2.x' into 2.x
commit
8542c13460
|
@ -18,7 +18,20 @@ toc: true
|
|||
<input type="checkbox" name="AAA" title="默认">
|
||||
<input type="checkbox" name="BBB" lay-text="选中" checked>
|
||||
<input type="checkbox" name="CCC" title="禁用" disabled>
|
||||
<input type="checkbox" name="DDD" title="半选" id="ID-checkbox-ind">
|
||||
</div>
|
||||
|
||||
<!-- import layui -->
|
||||
<script>
|
||||
layui.use(function(){
|
||||
var form = layui.form;
|
||||
var $ = layui.$;
|
||||
|
||||
// 初始设置半选
|
||||
$('#ID-checkbox-ind').prop('indeterminate', true); // 半选属性只能动态设置
|
||||
form.render('checkbox');
|
||||
});
|
||||
</script>
|
||||
</textarea>
|
||||
</pre>
|
||||
|
||||
|
@ -41,7 +54,7 @@ toc: true
|
|||
<div class="layui-form">
|
||||
<input type="checkbox" name="AAA" title="默认" lay-skin="tag">
|
||||
<input type="checkbox" name="BBB" title="选中" lay-skin="tag" checked>
|
||||
<input type="checkbox" name="CCC" title="禁用" lay-skin="tag" disabled>
|
||||
<input type="checkbox" name="CCC" title="禁用" lay-skin="tag" disabled>
|
||||
</div>
|
||||
|
||||
<!-- import layui -->
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
<h3 id="demo-alert" lay-toc="{level: 3}">信息框</h3>
|
||||
|
||||
信息框即 `dialog` 类型层,对应默认的 `type: 0`,该类型的弹层同时只能存在一个。更多说明详见:[#type](#options)
|
||||
|
||||
<pre class="layui-code" lay-options="{preview: true, codeStyle: 'height: 535px;', layout: ['preview', 'code'], tools: ['full']}">
|
||||
<textarea>
|
||||
{{- d.include("/layer/examples/alert.md") }}
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
弹层类型。 可选值有:
|
||||
|
||||
- `0` dialog 信息框
|
||||
- `1` page 页面层
|
||||
- `2` iframe 内联框架层
|
||||
- `3` loading 加载层
|
||||
- `4` tips 贴士层
|
||||
- `0` dialog 信息框(默认),*同时只能存在一个层*
|
||||
- `1` page 页面层,*可同时存在多个层*
|
||||
- `2` iframe 内联框架层,*可同时存在多个层*
|
||||
- `3` loading 加载层,*同时只能存在一个层*
|
||||
- `4` tips 贴士层,*可配置同时存在多个层*
|
||||
|
||||
`layer` 弹层由以上 5 种类型构成。 不同的类型代表不同的弹出形态,`layer` 提供的所有的弹出方式均由此衍生。
|
||||
|
||||
|
|
|
@ -821,7 +821,7 @@ a cite{font-style: normal; *cursor:pointer;}
|
|||
.layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 30px; line-height: 30px; margin-right: 10px; padding-right: 30px; background-color: #fff; cursor: pointer; font-size: 0; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box;}
|
||||
.layui-form-checkbox:hover{}
|
||||
.layui-form-checkbox > *{display: inline-block; vertical-align: middle;}
|
||||
.layui-form-checkbox > div{padding: 0 11px; height: 100%; font-size: 14px; border-radius: 2px 0 0 2px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
.layui-form-checkbox > div{padding: 0 11px; font-size: 14px; border-radius: 2px 0 0 2px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
.layui-form-checkbox:hover > div{background-color: #c2c2c2;}
|
||||
.layui-form-checkbox > i{position: absolute; right: 0; top: 0; width: 30px; height: 100%; border: 1px solid #d2d2d2; border-left: none; border-radius: 0 2px 2px 0; color: #fff; color: rgba(255,255,255,0); font-size: 20px; text-align: center; box-sizing: border-box;}
|
||||
.layui-form-checkbox:hover > i{border-color: #c2c2c2; color: #c2c2c2;}
|
||||
|
@ -838,7 +838,7 @@ a cite{font-style: normal; *cursor:pointer;}
|
|||
/* 复选框-默认风格 */
|
||||
.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: 24px; padding-right: 0; background: none;}
|
||||
.layui-form-checkbox[lay-skin="primary"] > div{margin-top: -1px; 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: 18px; height: 18px; 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"] > i{right: auto; left: 0; width: 16px; height: 16px; line-height: 14px; 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: #16b777; color: #fff;}
|
||||
.layui-form-checked[lay-skin="primary"] > i{border-color: #16b777 !important; background-color: #16b777; color: #fff;}
|
||||
.layui-checkbox-disabled[lay-skin="primary"] > div{background: none!important;}
|
||||
|
@ -1014,7 +1014,7 @@ a cite{font-style: normal; *cursor:pointer;}
|
|||
.layui-table-view .layui-table td[data-edit]{cursor: text;}
|
||||
.layui-table-view .layui-table td[data-edit]:hover:after{position: absolute; left: 0; top: 0; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid #16B777; pointer-events: none; content: "";}
|
||||
|
||||
.layui-table-view .layui-form-checkbox[lay-skin="primary"] i{width: 18px; height: 18px;}
|
||||
.layui-table-view .layui-form-checkbox[lay-skin="primary"] i{width: 18px; height: 18px; line-height: 16px;}
|
||||
.layui-table-view .layui-form-radio{line-height: 0; padding: 0;}
|
||||
.layui-table-view .layui-form-radio>i{margin: 0; font-size: 20px;}
|
||||
.layui-table-init{position: absolute; left: 0; top: 0; width: 100%; height: 100%; text-align: center; z-index: 199;}
|
||||
|
|
|
@ -191,7 +191,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
|||
|
||||
/* 内置 skin */
|
||||
.layui-layer-lan .layui-layer-title{background:#4476A7; color:#fff; border: none;}
|
||||
.layui-layer-lan .layui-layer-btn{padding: 5px 10px 10px; text-align: right; border-top:1px solid #E9E7E7}
|
||||
.layui-layer-lan .layui-layer-btn{padding: 5px 10px 10px; border-top:1px solid #E9E7E7}
|
||||
.layui-layer-lan .layui-layer-btn a{background: #fff; border-color: #E9E7E7; color: #333;}
|
||||
.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5;}
|
||||
.layui-layer-molv .layui-layer-title{background: #009f95; color:#fff; border: none;}
|
||||
|
|
|
@ -186,8 +186,15 @@ layui.define(['lay', 'util', 'element', 'form'], function(exports){
|
|||
});
|
||||
|
||||
// copy
|
||||
if(options.copy && layui.type(options.tools) === 'array'){
|
||||
options.tools.unshift('copy');
|
||||
if(options.copy){
|
||||
if(layui.type(options.tools) === 'array'){
|
||||
// 若 copy 未存在于 tools 中,则追加到最前
|
||||
if(options.tools.indexOf('copy') === -1){
|
||||
options.tools.unshift('copy');
|
||||
}
|
||||
} else {
|
||||
options.tools = ['copy'];
|
||||
}
|
||||
}
|
||||
|
||||
// 工具栏事件
|
||||
|
@ -217,7 +224,7 @@ layui.define(['lay', 'util', 'element', 'form'], function(exports){
|
|||
|
||||
// 追加预览
|
||||
if(isIframePreview){
|
||||
elemPreviewView.html('<iframe></iframe>');
|
||||
elemPreviewView.html('<iframe allowtransparency="true" frameborder="0"></iframe>');
|
||||
}
|
||||
|
||||
// 执行预览
|
||||
|
|
|
@ -690,12 +690,12 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
|||
}()));
|
||||
var disabled = this.disabled;
|
||||
|
||||
if(!skins[skin]) skin = 'primary'; // 若非内置风格,则强制为默认风格
|
||||
// if(!skins[skin]) skin = 'primary'; // 若非内置风格,则强制为默认风格
|
||||
var RE_CLASS = CLASS[skin] || CLASS.checkbox;
|
||||
|
||||
// 替代元素
|
||||
var hasRender = othis.next('.' + RE_CLASS[0]);
|
||||
hasRender[0] && hasRender.remove(); // 如果已经渲染,则Rerender
|
||||
hasRender[0] && hasRender.remove(); // 若已经渲染,则 Rerender
|
||||
|
||||
// 若存在标题模板,则优先读取标题模板
|
||||
if(othis.next('[lay-checkbox]')[0]){
|
||||
|
|
Loading…
Reference in New Issue