From 18daf6c13feb51c9046859e45faf8c6123cb779f Mon Sep 17 00:00:00 2001 From: Sun Xingfan Date: Fri, 30 Nov 2018 11:07:52 +0800 Subject: [PATCH 1/7] fix: button props --- components/_util/deprecatedPropsCheck.js | 17 +++++++++++++++++ components/button/Button.js | 9 +++++++++ components/button/style/index.scss | 3 ++- package.json | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 components/_util/deprecatedPropsCheck.js diff --git a/components/_util/deprecatedPropsCheck.js b/components/_util/deprecatedPropsCheck.js new file mode 100644 index 000000000..df95d31c4 --- /dev/null +++ b/components/_util/deprecatedPropsCheck.js @@ -0,0 +1,17 @@ +function deprecatedWarning (componentName, propName, propValue) { + console.warn( + `Deprecated Warning: Invalid prop \`${propName}\` of value \`${propValue}\` supplied to \`${componentName}\`.` + ) +} + +export default function deprecatedPropsCheck (deprecatedProps, props, componentName) { + for (const propName in deprecatedProps) { + if (deprecatedProps.hasOwnProperty(propName)) { + if (deprecatedProps[propName].includes(props[propName])) { + deprecatedWarning(componentName, propName, props[propName]) + } + } + } +} + +export { deprecatedWarning } diff --git a/components/button/Button.js b/components/button/Button.js index d963a7de2..41008496d 100644 --- a/components/button/Button.js +++ b/components/button/Button.js @@ -2,6 +2,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' import Provider from '../context' +import deprecatedPropsCheck from '../_util/deprecatedPropsCheck' class Button extends Component { static propTypes = { @@ -16,6 +17,11 @@ class Button extends Component { target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']) } + deprecatedProps = { + type: ['info'], + appearance: ['line'] + } + static defaultProps = { prefixCls: 'hi-btn', type: 'default', @@ -59,6 +65,9 @@ class Button extends Component { ) const disabledBool = !!disabled + + deprecatedPropsCheck(this.deprecatedProps, this.props, 'Button') + return ( href ? Date: Fri, 30 Nov 2018 11:18:38 +0800 Subject: [PATCH 2/7] fix: checkbox style --- components/checkbox/style/index.scss | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/checkbox/style/index.scss b/components/checkbox/style/index.scss index 79ea1e11c..5a929eaf2 100644 --- a/components/checkbox/style/index.scss +++ b/components/checkbox/style/index.scss @@ -1,13 +1,11 @@ -.label-checkbox { - span { - font-size: 12px; - padding: 0 5px; - } -} +@import '@hi-ui/core-css'; .hi-checkbox { + display: inline-block; cursor: pointer; + @include component-reset(); + &:hover { .hi-checkbox-input { border: 1px solid #4284f5; From 49b32666892989dcc0f25b8e7641b67ae40e9139 Mon Sep 17 00:00:00 2001 From: Sun Xingfan Date: Fri, 30 Nov 2018 11:20:48 +0800 Subject: [PATCH 3/7] docs: update CHANGELOG --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 000f2ffb7..fd84762d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ > 1. 修订号:当你做了向下兼容的问题修正。 > 先行版本号及版本编译信息可以加到“主版本号.次版本号.修订号”的后面,作为延伸。 +## 1.1.1 +- 修改:修复