feat: update vc-cascaser vc-checkbox vc-collapse

pull/398/head
tangjinzhou 2018-12-31 22:08:27 +08:00
parent 20c0cf4dc5
commit d805107543
5 changed files with 8 additions and 5 deletions

View File

@ -83,7 +83,7 @@ export default {
initialValue = defaultValue || [] initialValue = defaultValue || []
} }
// warning(!('filedNames' in props), // warning(!('filedNames' in props),
// '`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` intead.'); // '`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead.');
return { return {
sPopupVisible: popupVisible, sPopupVisible: popupVisible,
@ -242,6 +242,7 @@ export default {
return return
} }
if (e.keyCode === KeyCode.DOWN || e.keyCode === KeyCode.UP) { if (e.keyCode === KeyCode.DOWN || e.keyCode === KeyCode.UP) {
e.preventDefault()
let nextIndex = currentIndex let nextIndex = currentIndex
if (nextIndex !== -1) { if (nextIndex !== -1) {
if (e.keyCode === KeyCode.DOWN) { if (e.keyCode === KeyCode.DOWN) {
@ -256,8 +257,10 @@ export default {
} }
activeValue[currentLevel] = currentOptions[nextIndex][this.getFieldName('value')] activeValue[currentLevel] = currentOptions[nextIndex][this.getFieldName('value')]
} else if (e.keyCode === KeyCode.LEFT || e.keyCode === KeyCode.BACKSPACE) { } else if (e.keyCode === KeyCode.LEFT || e.keyCode === KeyCode.BACKSPACE) {
e.preventDefault()
activeValue.splice(activeValue.length - 1, 1) activeValue.splice(activeValue.length - 1, 1)
} else if (e.keyCode === KeyCode.RIGHT) { } else if (e.keyCode === KeyCode.RIGHT) {
e.preventDefault()
if (currentOptions[currentIndex] && if (currentOptions[currentIndex] &&
currentOptions[currentIndex][this.getFieldName('children')]) { currentOptions[currentIndex][this.getFieldName('children')]) {
activeValue.push(currentOptions[currentIndex][this.getFieldName('children')][0][this.getFieldName('value')]) activeValue.push(currentOptions[currentIndex][this.getFieldName('children')][0][this.getFieldName('value')])

View File

@ -1,3 +1,3 @@
// based on rc-cascader 0.16.0 // based on rc-cascader 0.16.2
import Cascader from './Cascader' import Cascader from './Cascader'
export default Cascader export default Cascader

View File

@ -1,2 +1,2 @@
// based on rc-checkbox 2.1.5 // based on rc-checkbox 2.1.6
export { default } from './src/' export { default } from './src/'

View File

@ -20,7 +20,7 @@ export default {
// onBlur: PropTypes.func, // onBlur: PropTypes.func,
// onChange: PropTypes.func, // onChange: PropTypes.func,
// onClick: PropTypes.func, // onClick: PropTypes.func,
tabIndex: PropTypes.string, tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
readOnly: PropTypes.bool, readOnly: PropTypes.bool,
autoFocus: PropTypes.bool, autoFocus: PropTypes.bool,
value: PropTypes.any, value: PropTypes.any,

View File

@ -1,4 +1,4 @@
// based on rc-collapse 1.10.0 // based on rc-collapse 1.10.2
import CollapsePanel from './src/Panel' import CollapsePanel from './src/Panel'
import Collapse from './src/Collapse' import Collapse from './src/Collapse'
import { collapseProps, panelProps } from './src/commonProps' import { collapseProps, panelProps } from './src/commonProps'