Skip to content

Commit

Permalink
Merge pull request #989 from XiaoMi/develop
Browse files Browse the repository at this point in the history
同步 dev 至 master
  • Loading branch information
solarjoker authored Mar 30, 2020
2 parents 6babc8d + 4e7c3ef commit 7e76256
Show file tree
Hide file tree
Showing 81 changed files with 2,414 additions and 391 deletions.
35 changes: 35 additions & 0 deletions .github/workflow/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: deploy

on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10
- name: NPM Install and Test
run: |
npm install
npm run test
npm run compile
npm run build:gh-pages
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
22 changes: 22 additions & 0 deletions .github/workflow/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: NPM Install and Test
run: |
npm install
npm run test
30 changes: 27 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
# 更新日志

## 2.12.0

- 新增 `<Watermark />` 水印组件 [#121](https://github.com/XiaoMi/hiui/issues/121)
- 修复 `<Tree />` 多选模式下在禁用状态复选框样式异常的问题 [#1014](https://github.com/XiaoMi/hiui/issues/1014)
- 修复 `<Select />` DataSource 配置 headers 参数无效的问题 [#1011](https://github.com/XiaoMi/hiui/issues/1011)

## 2.11.1

- 修复打包印度节假日数据问题

## 2.11.0

- 新增 `<DatePicker />` altCalendarPreset 预设历法信息(支持中国农历和印度节假日),altCalendar 自定义日期显示,dateMarkRender 自定义日期右上角显示标志,dateMarkPreset 预设右上角显示标志「班」和「休」 [#902](https://github.com/XiaoMi/hiui/issues/902)[#992](https://github.com/XiaoMi/hiui/issues/992)
- 修复 `<Menu />` 高亮、展开对应菜单项不正确的问题 [#993](https://github.com/XiaoMi/hiui/issues/993)
- 优化若干视觉还原问题:[#990](https://github.com/XiaoMi/hiui/issues/990) [#991](https://github.com/XiaoMi/hiui/issues/991) [#998](https://github.com/XiaoMi/hiui/issues/998) [#1000](https://github.com/XiaoMi/hiui/issues/1000) [#954](https://github.com/XiaoMi/hiui/issues/954) [#1001](https://github.com/XiaoMi/hiui/issues/1001) [#1002](https://github.com/XiaoMi/hiui/issues/1002) [#1003](https://github.com/XiaoMi/hiui/issues/1003) [#1004](https://github.com/XiaoMi/hiui/issues/1004) [#1005](https://github.com/XiaoMi/hiui/issues/1005)

## 2.10.0

- 新增 `<Upload />` onDownload 点击上传成功文件的回调 [#613](https://github.com/XiaoMi/hiui/issues/613)
- 优化 `<Select />` 可搜索模式下自动获取输入框焦点 [#925](https://github.com/XiaoMi/hiui/issues/925)
- 优化 `<Carousel />` 轮播定位交互,并新增 showPages 是否显示页码指示器 [#925](https://github.com/XiaoMi/hiui/issues/925)
- 修复 `<Select />` 异步模式下有默认值不能正常使用的问题 [#962](https://github.com/XiaoMi/hiui/issues/962)
- 优化若干视觉还原问题:[#952](https://github.com/XiaoMi/hiui/issues/952) [#958](https://github.com/XiaoMi/hiui/issues/958) [#971](https://github.com/XiaoMi/hiui/issues/971) [#973](https://github.com/XiaoMi/hiui/issues/973) [#975](https://github.com/XiaoMi/hiui/issues/975) [#976](https://github.com/XiaoMi/hiui/issues/976) [#977](https://github.com/XiaoMi/hiui/issues/977) [#983](https://github.com/XiaoMi/hiui/issues/983)[#987](https://github.com/XiaoMi/hiui/issues/987)

## 2.9.0

- 新增 `<Progress />` active 属性展示加载动效 [#941](https://github.com/XiaoMi/hiui/issues/941)
- 新增 `<Upload />` 拖拽用法支持多选上传 [#942](https://github.com/XiaoMi/hiui/issues/942)
- 新增 `<DatePicker />` disabledDate 属性自定义日期禁选 [#943](https://github.com/XiaoMi/hiui/issues/943)
- 新增 `<DatePicker />` disabledDate 属性自定义日期禁选 [#943](https://github.com/XiaoMi/hiui/issues/943)
- 优化 `<Collapse />` 视觉效果 [#937](https://github.com/XiaoMi/hiui/issues/937)
- 修复 `<Dropdown />` 点击外部区域不能正常隐藏菜单的问题 [#947](https://github.com/XiaoMi/hiui/issues/947)
- 修复`<Upload />`同时上传多个文件的展示问题 [#948](https://github.com/XiaoMi/hiui/issues/948)
Expand All @@ -17,8 +41,8 @@
- 新增 `<Table />` withCredentials 属性 [#922](https://github.com/XiaoMi/hiui/issues/922)
- 修复 `<Transfer />` 单选模式下 targetLimit 无效的问题 [#919](https://github.com/XiaoMi/hiui/issues/919)
- 修复 `<Select />` 多选出现双滚动条的样式问题 [#920](https://github.com/XiaoMi/hiui/issues/920)
- 修复 `<Button />` 链接用法样式问题 [#923](https://github.com/XiaoMi/hiui/issues/923)
- 修复 `<Dropdown />` 按钮样式 icon 边距问题 [#927](https://github.com/XiaoMi/hiui/issues/927)
- 修复 `<Button />` 链接用法样式问题 [#923](https://github.com/XiaoMi/hiui/issues/923)
- 修复 `<Dropdown />` 按钮样式 icon 边距问题 [#927](https://github.com/XiaoMi/hiui/issues/927)
- 修复主题配色适配组件不完全的问题 [#733](https://github.com/XiaoMi/hiui/issues/733)

## 2.7.0
Expand Down
13 changes: 10 additions & 3 deletions components/alert/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.hi-alert {
position: relative;
padding: 9px 12px;
padding: 9px 11px;
background: #ebf2fd;
border: 1px solid #b3cdfb;
border-radius: 2px;
Expand Down Expand Up @@ -89,8 +89,15 @@
.hi-alert.theme__#{$key} {
&.info {
color: $value;
background-color: rgba(map-get(get-palette(get-color($palette-primary, $key)), '50'), 0.1);
border: 1px solid map-get(get-palette(get-color($palette-primary, $key)), '20');
background-color:
rgba(
map-get(get-palette(get-color($palette-primary, $key)), '50'),
0.1
);
border:
1px
solid
map-get(get-palette(get-color($palette-primary, $key)), '20');
}
}
}
3 changes: 2 additions & 1 deletion components/badge/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
transform: translateX(50%);
height: 16px;
padding: 0 4px;
min-width: 8px;
border: 2px solid #fff;
border-radius: 10px;
line-height: 16px;
Expand All @@ -29,7 +30,7 @@
position: absolute;
width: 8px;
height: 8px;
top: -7px;
top: -5px;
right: -5px;
background: #f44141;
border: 1px solid #fff;
Expand Down
2 changes: 1 addition & 1 deletion components/breadcrumb/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

&__separator {
margin: 0 10px;
margin: 0 8px;
color: #ccc;
}

Expand Down
3 changes: 2 additions & 1 deletion components/card/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
height: 24px;
line-height: 24px;
display: flex;
padding-bottom: 12px;
padding-bottom: 4px;
justify-content: space-between;

&--onlyextra {
Expand All @@ -38,6 +38,7 @@

&__title {
font-size: 16px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand Down
14 changes: 11 additions & 3 deletions components/carousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ class Carousel extends Component {

render () {
const { rootWidth, active, showArrow } = this.state
const { showDots, showArrows } = this.props
const { showDots, showArrows, showPages } = this.props
const children = React.Children.toArray(this.props.children)
const len = children.length || 0
const arrowCls = classNames(
'hi-carousel__arrows',
showArrow && 'hi-carousel__arrows--show'
Expand Down Expand Up @@ -129,6 +130,11 @@ class Carousel extends Component {
}
</ul>
}
{
showPages && <div className='hi-carousel__pages'>
<span>{active} / {len}</span>
</div>
}
</div>
}
}
Expand All @@ -140,7 +146,8 @@ Carousel.propTypes = {
afterChange: PropTypes.func,
showDots: PropTypes.bool,
showArrows: PropTypes.bool,
defaultActive: PropTypes.number
defaultActive: PropTypes.number,
showPages: PropTypes.bool
}
Carousel.defaultProps = {
duration: 0,
Expand All @@ -149,7 +156,8 @@ Carousel.defaultProps = {
afterChange: () => {},
showDots: true,
showArrows: true,
defaultActive: 0
defaultActive: 0,
showPages: false
}

export default Carousel
23 changes: 22 additions & 1 deletion components/carousel/style/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.hi-carousel {
width: 100%;
color: rgba(153, 153, 153, 1);
color: #fff;
overflow: hidden;
position: relative;

Expand All @@ -16,6 +16,8 @@
padding: 0;
left: 50%;
transform: translateX(-50%);
max-width: 50%;
display: flex;
}

&__dot {
Expand Down Expand Up @@ -67,8 +69,27 @@
margin-left: 24px;
cursor: pointer;

&:hover {
background: rgba(0, 0, 0, 0.45);
}

&:last-child {
margin-right: 24px;
}
}

&__pages {
width: 46px;
height: 22px;
border-radius: 16px;
position: absolute;
bottom: 24px;
right: 24px;
background: rgba(0, 0, 0, 0.5);
line-height: 22px;
font-size: 14px;
text-align: center;
user-select: none;
opacity: 0.5;
}
}
2 changes: 1 addition & 1 deletion components/cascader/style/cascader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $cascader: 'hi-cascader' !default;
display: flex;
align-items: center;
padding: 5px 12px;
border: 1px solid #d9d9d9;
border: 1px solid #d8d8d8;
}

&__input-keyword {
Expand Down
20 changes: 14 additions & 6 deletions components/checkbox/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ $prefixCls: '.hi-checkbox' !default;

&__input {
&--indeterminate {
background: $color;
border-color: $color;

&::after {
background: $color;
background: #fff;
}
}

Expand Down Expand Up @@ -61,13 +64,18 @@ $prefixCls: '.hi-checkbox' !default;

&--indeterminate {
&::after {
transform: rotate(90deg) scaleY(1);
pointer-events: none;
box-sizing: content-box;
content: '';
top: 3px;
left: 3px;
right: 3px;
bottom: 3px;
border: none;
border-bottom: 2px solid #fff;
height: 8px;
left: 6px;
position: absolute;
display: block;
top: 2px;
width: 2px;
transform-origin: center;
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/collapse/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
font-size: 14px;

.collapse-item {
border-bottom: 1px solid #d9d9d9;
border-bottom: 1px solid #d8d8d8;

&__head {
display: flex;
Expand Down
14 changes: 9 additions & 5 deletions components/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ export const LocaleContext = React.createContext('zh-CN')
* 临时解决 notice组件获取不到theme的问题
*/
let noticeTheme = ''
export default (WrappedComponent) => {
export default WrappedComponent => {
class WrapperComponent extends Component {
static displayName = WrappedComponent.name
render () {
const { theme, locale, innerRef, ...restProps } = this.props
let ConsumerComponent = (
<ThemeContext.Consumer>
{(contextTheme) => {
{contextTheme => {
noticeTheme = noticeTheme || contextTheme
return (
<LocaleContext.Consumer>
{(contextLocale) => (
{contextLocale => (
<WrappedComponent
theme={WrappedComponent.IS_HIUI_NOTICE ? noticeTheme : contextTheme}
theme={
WrappedComponent.IS_HIUI_NOTICE
? noticeTheme
: contextTheme
}
locale={contextLocale}
localeDatas={locales[contextLocale]}
ref={innerRef}
Expand Down Expand Up @@ -53,7 +57,7 @@ function wrapProvider (value, context) {
}
if (!context) {
let component = value
wrapProvider.Providers.reverse().map((obj) => {
wrapProvider.Providers.reverse().map(obj => {
component = (
<obj.context.Provider value={obj.value}>
{component}
Expand Down
4 changes: 2 additions & 2 deletions components/counter/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $counter: 'hi-counter' !default;
width: $m-width-ceil;
height: $m-width-ceil;
line-height: $m-width-ceil;
border: 1px solid $border-color-normal;
border: 1px solid $gray-light;
border-radius: 2px;
font-weight: bold;
color: $active-color;
Expand Down Expand Up @@ -64,7 +64,7 @@ $counter: 'hi-counter' !default;
flex: 1 1 auto;
width: 2 * $m-width-ceil;
padding: 0 6px;
border: 1px solid $border-color-normal;
border: 1px solid $gray-light;
color: $normal-color;
outline: none;
box-sizing: border-box;
Expand Down
Loading

0 comments on commit 7e76256

Please sign in to comment.