Skip to content

Commit

Permalink
Merge pull request #994 from XiaoMi/hotfix/#993
Browse files Browse the repository at this point in the history
fix: #993
  • Loading branch information
solarjoker authored Mar 18, 2020
2 parents 96ec295 + 8051769 commit 05bff15
Show file tree
Hide file tree
Showing 27 changed files with 117 additions and 72 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 更新日志

## 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)
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
6 changes: 5 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 Down Expand Up @@ -69,6 +69,10 @@
margin-left: 24px;
cursor: pointer;

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

&:last-child {
margin-right: 24px;
}
Expand Down
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
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
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
8 changes: 4 additions & 4 deletions components/date-picker/Calender.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,19 @@ class Calender extends Component {
const LunarInfo = Lunar.toLunar(_year, _month, _value)
let lunarcellinfo = {
text: altCalendarPreset === 'zh-CN' ? LunarInfo[6] : null, // 默认预置信息
hightlight: false
highlight: false
}
if (altCalendar || dateMarkRender) {
lunarcellinfo = {
text: this.altCalendarText(datainfo, lunarcellinfo),
hightlight: altCalendarPresetData && altCalendarPresetData[datainfo] && altCalendarPresetData[datainfo].hightlight,
highlight: altCalendarPresetData && altCalendarPresetData[datainfo] && altCalendarPresetData[datainfo].highlight,
nodeMark: this.markRender(datainfo)
}
}
if ((dateMarkPresetData && dateMarkPresetData[datainfo]) || (altCalendarPresetData && altCalendarPresetData[datainfo])) {
lunarcellinfo = {
text: this.altCalendarText(datainfo, lunarcellinfo),
hightlight: altCalendarPresetData && altCalendarPresetData[datainfo] && altCalendarPresetData[datainfo].hightlight,
highlight: altCalendarPresetData && altCalendarPresetData[datainfo] && altCalendarPresetData[datainfo].highlight,
nodeMark: this.markRender(datainfo)
}
}
Expand Down Expand Up @@ -338,7 +338,7 @@ class Calender extends Component {
}}
>
{
fullTimeInfo.hightlight
fullTimeInfo.highlight
? <span value={td.value} className='hi-datepicker__text--showLunar hi-datepicker__text--showLunar--festival'>
{fullTimeInfo.text}
</span>
Expand Down
2 changes: 1 addition & 1 deletion components/date-picker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DatePicker extends BasePicker {
Object.assign(oneYear, {
[item.date.replace(/-/g, '/')]: {
...item,
hightlight: true
highlight: true
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/DropdownMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DropdownMenu extends React.Component {
placement={placement}
width={width}
onMouseEnter={onMouseEnter}
leftGap={1}
leftGap={0}
onMouseLeave={onMouseLeave}
>
<ul className={menuCls}>
Expand Down
8 changes: 6 additions & 2 deletions components/menu/SubMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ class SubMenu extends Component {
}

checkActive (activeIndex, index) {
return activeIndex.indexOf(index) === 0
const indexArr = index.split('-')
const activeIndexArr = activeIndex.split('-')
return activeIndexArr.slice(0, indexArr.length).join('-') === index
}

checkExpand (activeIndex, expandIndex, index) {
return expandIndex.some(item => {
return item.indexOf(index) === 0
const indexArr = index.split('-')
const expandIndexArr = item.split('-')
return expandIndexArr.slice(0, indexArr.length).join('-') === index
})
}

Expand Down
2 changes: 1 addition & 1 deletion components/modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Modal extends Component {
return footers || footer
} else {
return [
<Button type='default' key={0} onClick={this.handleClose.bind(this)}>
<Button type='line' key={0} onClick={this.handleClose.bind(this)}>
{cancelText}
</Button>,
<Button type='primary' key={1} onClick={this.handleConfirm.bind(this)}>
Expand Down
8 changes: 8 additions & 0 deletions components/pagination/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
&__span {
display: inline-block;
margin: 0 $spacer-1;

.hi-select__input {
border: 1px solid $gray-light;
}
}

&__jumper-input {
Expand All @@ -67,6 +71,10 @@
.hi-input {
width: 64px;

&__inner {
border: 1px solid $gray-light;
}

&__text {
text-align: center;
}
Expand Down
1 change: 1 addition & 0 deletions components/select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ class Select extends Component {
attachEle={this.selectInputContainer}
zIndex={1050}
topGap={5}
leftGap={0}
className="hi-select__popper"
placement="top-bottom-start"
>
Expand Down
2 changes: 1 addition & 1 deletion components/select/style/select-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
color: #333;
line-height: 1;
border-radius: 2px;
border: 1px solid #d9d9d9;
border: 1px solid #d8d8d8;
cursor: pointer;
outline: none;
user-select: none;
Expand Down
23 changes: 14 additions & 9 deletions components/tabs/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ $prefix: 'hi-tabs' !default;
}

.#{$prefix}__item {
height: 40px;
line-height: 40px;
height: 48px;
line-height: 46px;
padding: 0 16px;
box-sizing: border-box;

Expand Down Expand Up @@ -217,18 +217,22 @@ $prefix: 'hi-tabs' !default;
.#{$prefix}__item {
flex: none;
height: 36px;
line-height: 36px;
padding: 0 24px;
line-height: 34px;
padding: 0 23px;
box-sizing: border-box;
margin-right: 24px;
border: 1px solid #d8d8d8;
border-radius: 18px;

&:hover {
&:hover:not(.hi-tabs__item--active) {
color: #4284f5;
border: 1px solid #4284f5;
}

&--active {
color: #4284f5;
color: #fff;
background-color: #4284f5;
border: 1px solid #4284f5;
border-radius: 18px;
}
}
}
Expand Down Expand Up @@ -315,12 +319,13 @@ $prefix: 'hi-tabs' !default;

&--button {
.#{$prefix}__item {
&:hover {
&:hover:not(.hi-tabs__item--active) {
color: $value;
border: 1px solid $value;
}

&--active {
color: $value;
background-color: $value;
border: 1px solid $value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/tree/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $tree: 'hi-tree' !default;

/* =========== */
.hi-checkbox-legacy {
margin-left: 8px;
margin-left: 6px;
}

.hi-checkbox-legacy--part .hi-checkbox-legacy__input {
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/date-picker/section-calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Demo extends React.Component {
{
date:'2020/4/8',
text:'十周年',
hightlight: true
highlight: true
},
]}
dateMarkRender = {
Expand Down
10 changes: 6 additions & 4 deletions docs/demo/grid/section-block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ class Demo extends React.Component {
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8', color:'#fff'}}>col-6<br />25%</div>
</Col>
<Col span={6}>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8'}}>col-6<br />25%</div>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8', color:'#fff'}}>col-6<br />25%</div>
</Col>
<Col span={6}>
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8',color:'#fff'}}>col-6<br />25%</div>
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8', color:'#fff'}}>col-6<br />25%</div>
</Col>
<Col span={6}>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8'}}>col-6<br />25%</div>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', textAlign: 'center', opacity: '.8', color:'#fff'}}>col-6<br />25%</div>
</Col>
</Row>
)
}
}`
const DemoBlock = () => <DocViewer code={code} scope={{ Grid }} prefix={prefix} desc={desc} />
const DemoBlock = () => (
<DocViewer code={code} scope={{ Grid }} prefix={prefix} desc={desc} />
)
export default DemoBlock
6 changes: 4 additions & 2 deletions docs/demo/grid/section-nest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Demo extends React.Component {
return (
<Row gutter={true}>
<Col span={16} >
<div style={{textAlign:'center', background:'#ff6700',opacity: '0.8', padding:16 }}>
<div style={{textAlign:'center', background:'#ff6700',opacity: '0.8', padding:16, color:'#fff' }}>
col-16
<Row gutter={true}>
<Col span={12}>
Expand All @@ -32,5 +32,7 @@ class Demo extends React.Component {
)
}
}`
const DemoNest = () => <DocViewer code={code} scope={{ Grid }} prefix={prefix} desc={desc} />
const DemoNest = () => (
<DocViewer code={code} scope={{ Grid }} prefix={prefix} desc={desc} />
)
export default DemoNest
8 changes: 5 additions & 3 deletions docs/demo/grid/section-offset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Demo extends React.Component {
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', color: '#fff', opacity:'0.8', textAlign: 'center'}}>col-8</div>
</Col>
<Col span={6} offset={6}>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', opacity:'0.8', textAlign: 'center'}}>col-6-offset-6</div>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', color: '#fff', opacity:'0.8', textAlign: 'center'}}>col-6-offset-6</div>
</Col>
<Col span={4}>
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', color: '#fff', opacity:'0.8', textAlign: 'center'}}>col-4</div>
Expand All @@ -28,7 +28,7 @@ class Demo extends React.Component {
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', color: '#fff', opacity:'0.8', textAlign: 'center'}}>col-4</div>
</Col>
<Col span={6} offset={4}>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', opacity:'0.8', textAlign: 'center'}}>col-6-offset-4</div>
<div style={{backgroundColor: '#ff6700', width: '100%', padding: '16px 0', color: '#fff', opacity:'0.8', textAlign: 'center'}}>col-6-offset-4</div>
</Col>
<Col span={4}>
<div style={{backgroundColor: '#4284F5', width: '100%', padding: '16px 0', color: '#fff', opacity:'0.8', textAlign: 'center'}}>col-4</div>
Expand All @@ -41,5 +41,7 @@ class Demo extends React.Component {
)
}
}`
const DemoOffset = () => <DocViewer code={code} scope={{ Grid }} prefix={prefix} desc={desc} />
const DemoOffset = () => (
<DocViewer code={code} scope={{ Grid }} prefix={prefix} desc={desc} />
)
export default DemoOffset
3 changes: 0 additions & 3 deletions docs/demo/modal/section-size.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ class Demo extends React.Component {
size={this.state.size}
show={this.state.show}
onCancel={this.cancelEvent.bind(this)}
footers={[
<Button type="default" key={3} onClick={this.cancelEvent.bind(this)}>关闭</Button>
]}
>
<span>一些消息</span>
<span>一些消息</span>
Expand Down
8 changes: 4 additions & 4 deletions docs/zh-CN/components/alert.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Alert 警告
# Alert 警告提示

作用于页面的内容区域的提示,非触发类信息

Expand Down Expand Up @@ -38,9 +38,9 @@ import DemoAutoClose from '../../demo/alert/section-autoClose.jsx'

| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| --------- | ------------------------ | ----------------------- | ------------------------------------------- | ------ |
| type | 警告框类型 | string | 'info' \| 'success' \| 'error' \| 'warning' | 'info' |
| title | 警告框标题 | string | - | - |
| content | 警告框内容 | string | - | - |
| type | 警告提示类型 | string | 'info' \| 'success' \| 'error' \| 'warning' | 'info' |
| title | 警告提示标题 | string | - | - |
| content | 警告提示内容 | string | - | - |
| closeable | 是否可关闭 | boolean | true \| false | false |
| onClose | 关闭事件触发时的回调 | (e: MouseEvent) => void | - | - |
| duration | 自动关闭时间,单位为毫秒 | number \| null | - | null |
Loading

0 comments on commit 05bff15

Please sign in to comment.