first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/.pydio
vendored
Normal file
1
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/.pydio
vendored
Normal file
@@ -0,0 +1 @@
|
||||
2475aa6a-0262-4b64-b302-795509e01b99
|
||||
1
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.js
vendored
Normal file
1
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString")),_colors=require("../helpers/colors");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}(0,_baseComponent.default)({externalClasses:["wux-input-class"],properties:{prefixCls:{type:String,value:"wux-selectable"},type:{type:String,value:"checkbox"},value:{type:String,value:""},defaultChecked:{type:Boolean,value:!1},checked:{type:Boolean,value:!1,observer:function(e){this.data.controlled&&this.updated(e)}},disabled:{type:Boolean,value:!1},color:{type:String,value:"balanced",observer:function(e){this.setData({inputColor:(0,_colors.isPresetColor)(e)})}},controlled:{type:Boolean,value:!1},wrapStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}}},data:{inputChecked:!1,inputColor:"",extStyle:""},computed:{classes:["prefixCls, inputChecked, disabled",function(e,t,a){var r;return{wrap:(0,_classNames2.default)(e,(_defineProperty(r={},"".concat(e,"--checked"),t),_defineProperty(r,"".concat(e,"--disabled"),a),r)),input:"".concat(e,"__input"),icon:"".concat(e,"__icon")}}]},methods:{updated:function(e){this.data.inputChecked!==e&&this.setData({inputChecked:e})},onChange:function(){var e=this.data,t=e.value,a=e.inputChecked,r=e.disabled,o=e.controlled,n={checked:!a,value:t};r||(o||this.updated(!a),this.triggerEvent("change",n))}},attached:function(){var e=this.data,t=e.defaultChecked,a=e.checked,r=e.controlled?a:t,o=(0,_colors.isPresetColor)(this.data.color);this.setData({inputChecked:r,inputColor:o})}});
|
||||
3
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.json
vendored
Normal file
3
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
15
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.wxml
vendored
Normal file
15
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.wxml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<label class="wux-class {{ classes.wrap }}" bindtap="onChange" style="{{ extStyle }}">
|
||||
<block wx:if="{{ type === 'checkbox' }}">
|
||||
<checkbox value="{{ value }}" checked="{{ inputChecked }}" color="{{ inputColor }}" disabled="{{ disabled }}" class="wux-input-class {{ classes.input }}" />
|
||||
<icon class="{{ classes.icon }}" type="{{ inputChecked ? 'success' : 'circle' }}" size="23" color="{{ !disabled ? inputColor : '#666' }}" />
|
||||
</block>
|
||||
<block wx:elif="{{ type === 'radio' }}">
|
||||
<radio value="{{ value }}" checked="{{ inputChecked }}" color="{{ inputColor }}" disabled="{{ disabled }}" class="wux-input-class {{ classes.input }}" />
|
||||
<icon class="{{ classes.icon }}" type="success_no_circle" size="16" color="{{ !disabled ? inputColor : '#666' }}" hidden="{{ !inputChecked }}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
<slot name="icon-on" wx:if="{{ inputChecked }}"></slot>
|
||||
<slot name="icon-off" wx:else></slot>
|
||||
</block>
|
||||
<slot></slot>
|
||||
</label>
|
||||
1
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.wxss
vendored
Normal file
1
衣莎项目/源码/YiShaXiYi/extend/wux/dist/selectable/index.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.wux-selectable{position:relative;display:inline-block}.wux-selectable__input{position:absolute;top:0;left:0;opacity:0;width:100%;height:100%;z-index:2;border:0 none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wux-selectable__icon{display:inline-block;font-size:0;vertical-align:middle;position:relative;top:0;left:0;margin-left:10rpx;margin-right:10rpx}
|
||||
Reference in New Issue
Block a user