mini-antui
Advanced tools
Comparing version 0.3.7 to 0.3.8
@@ -0,1 +1,29 @@ | ||
## 0.3.8 | ||
`2018-09-26` | ||
- **Bug Fix** | ||
- 修复`filter`组件单选时需要反选取消选择的问题 | ||
- **Feature** | ||
- 新增`picker-item`组件 | ||
- **Enhancement** | ||
- `tabs`新增`activeCls`属性,用来表示激活tabbar的自定义class([#87](https://github.com/ant-mini-program/mini-antui/issues/87)) | ||
- `input-item`新增`clear`、`onClear`属性,组件内支持清除输入功能([#84](https://github.com/ant-mini-program/mini-antui/issues/84)) | ||
- `list-item` onClick回调新增target参数,用来支持自定义dataset([#85](https://github.com/ant-mini-program/mini-antui/issues/85)) | ||
## 0.3.7 | ||
`2018-09-25` | ||
- **Bug Fix** | ||
- 修复了`input-item`组件在失去焦点等事件中无dataset的问题([#66](https://github.com/ant-mini-program/mini-antui/issues/66)) | ||
- 修复`popup`组件mask定位为absolut导致的页面滚动时mask跟着滚动的bug | ||
- **Enhancement** | ||
- `popup`新增disableScroll属性以适应不同业务场景 | ||
- 完善`swipe-action`的示例代码 | ||
- 文档更新,添加体验二维码 | ||
## 0.3.6 | ||
@@ -2,0 +30,0 @@ |
@@ -20,3 +20,2 @@ import lifecycle from '../mixins/lifecycle'; | ||
var _data = this.data, | ||
confirmStyle = _data.confirmStyle, | ||
results = _data.results, | ||
@@ -27,11 +26,9 @@ items = _data.items; | ||
id = _props.id, | ||
value = _props.value, | ||
onChange = _props.onChange; | ||
value = _props.value; | ||
if (selected) { | ||
confirmStyle = true; | ||
results.push({ id: id, value: value }); | ||
items.push(this); | ||
this.setData({ | ||
confirmStyle: confirmStyle | ||
confirmStyle: true | ||
}); | ||
@@ -48,4 +45,4 @@ } | ||
onChange = _props2.onChange; | ||
var confirmStyle = this.data.confirmStyle; | ||
var _data2 = this.data, | ||
confirmStyle = _data2.confirmStyle, | ||
results = _data2.results, | ||
@@ -55,2 +52,20 @@ items = _data2.items, | ||
if (commonProps.max === 1) { | ||
if (confirmStyle === '') { | ||
items.forEach(function (element) { | ||
element.setData({ | ||
confirmStyle: '' | ||
}); | ||
}); | ||
results.splice(0, results.length); | ||
confirmStyle = true; | ||
results.push({ id: id, value: value }); | ||
items.push(this); | ||
onChange(results); | ||
} | ||
this.setData({ | ||
confirmStyle: confirmStyle | ||
}); | ||
return; | ||
} | ||
if (confirmStyle === '' && results.length < commonProps.max) { | ||
@@ -60,5 +75,2 @@ confirmStyle = true; | ||
items.push(this); | ||
if (commonProps.max === 1) { | ||
onChange(results); | ||
} | ||
} else { | ||
@@ -69,2 +81,5 @@ confirmStyle = ''; | ||
results.splice(index, 1); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
@@ -71,0 +86,0 @@ }); |
@@ -6,4 +6,3 @@ import lifecycle from './mixins/lifecycle'; | ||
data: { | ||
maxHeight: 0, | ||
singleSelect: true | ||
maxHeight: 0 | ||
}, | ||
@@ -16,14 +15,6 @@ props: { | ||
didMount: function didMount() { | ||
var _data = this.data, | ||
commonProps = _data.commonProps, | ||
singleSelect = _data.singleSelect; | ||
var commonProps = this.data.commonProps; | ||
var max = this.props.max; | ||
commonProps.max = max; | ||
if (commonProps.max === 1) { | ||
singleSelect = false; | ||
this.setData({ | ||
singleSelect: singleSelect | ||
}); | ||
} | ||
}, | ||
@@ -33,5 +24,5 @@ | ||
resetFn: function resetFn() { | ||
var _data2 = this.data, | ||
items = _data2.items, | ||
results = _data2.results; | ||
var _data = this.data, | ||
items = _data.items, | ||
results = _data.results; | ||
@@ -38,0 +29,0 @@ items.forEach(function (element) { |
@@ -19,6 +19,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
focus: false, | ||
clear: false, // 是否带清除功能 | ||
onInput: function onInput() {}, | ||
onConfirm: function onConfirm() {}, | ||
onFocus: function onFocus() {}, | ||
onBlur: function onBlur() {} | ||
onBlur: function onBlur() {}, | ||
onClear: function onClear() {} | ||
}, | ||
@@ -56,4 +58,8 @@ didMount: function didMount() { | ||
this.props.onInput(event); | ||
}, | ||
onClear: function onClear(e) { | ||
var event = this.fmtEvent(e); | ||
this.props.onClear(event); | ||
} | ||
} | ||
}); |
@@ -9,2 +9,11 @@ Component({ | ||
}, | ||
didMount: function didMount() { | ||
this.dataset = {}; | ||
for (var key in this.props) { | ||
if (/data-/gi.test(key)) { | ||
this.dataset[key.replace(/data-/gi, '')] = this.props[key]; | ||
} | ||
} | ||
}, | ||
methods: { | ||
@@ -18,3 +27,4 @@ onItemTap: function onItemTap(ev) { | ||
onClick({ | ||
index: ev.target.dataset.index | ||
index: ev.target.dataset.index, | ||
target: { dataset: this.dataset } | ||
}); | ||
@@ -21,0 +31,0 @@ } |
@@ -7,2 +7,3 @@ var _my$getSystemInfoSync = my.getSystemInfoSync(), | ||
className: '', | ||
activeCls: '', | ||
tabBarUnderlineColor: '#108ee9', // 选中选项卡下划线颜色 | ||
@@ -9,0 +10,0 @@ tabBarActiveTextColor: '#108ee9', // 选中选项卡字体颜色 |
{ | ||
"name": "mini-antui", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "小程序版AntUI", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
114327
120
1539