diff --git a/CHANGELOG.md b/CHANGELOG.md index 4adf39ef5..f393719da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # 更新日志 +## 2.11.0 + +- 新增 `` altCalendarPreset 预设历法信息(支持中国农历和印度节假日),altCalendar 自定义日期显示,dateMarkRender 自定义日期右上角显示标志,dateMarkPreset 预设右上角显示标志「班」和「休」 [#902](https://github.com/XiaoMi/hiui/issues/902)[#992](https://github.com/XiaoMi/hiui/issues/992) +- 修复 `` 高亮、展开对应菜单项不正确的问题 [#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 - 新增 `` onDownload 点击上传成功文件的回调 [#613](https://github.com/XiaoMi/hiui/issues/613) diff --git a/components/alert/style/index.scss b/components/alert/style/index.scss index 4022cef0b..2aa75598c 100755 --- a/components/alert/style/index.scss +++ b/components/alert/style/index.scss @@ -2,7 +2,7 @@ .hi-alert { position: relative; - padding: 9px 12px; + padding: 9px 11px; background: #ebf2fd; border: 1px solid #b3cdfb; border-radius: 2px; @@ -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'); } } } diff --git a/components/badge/style/index.scss b/components/badge/style/index.scss index 977e08ef9..a19facc4f 100755 --- a/components/badge/style/index.scss +++ b/components/badge/style/index.scss @@ -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; @@ -29,7 +30,7 @@ position: absolute; width: 8px; height: 8px; - top: -7px; + top: -5px; right: -5px; background: #f44141; border: 1px solid #fff; diff --git a/components/carousel/style/index.scss b/components/carousel/style/index.scss index 34d58f669..b8653ad91 100644 --- a/components/carousel/style/index.scss +++ b/components/carousel/style/index.scss @@ -1,6 +1,6 @@ .hi-carousel { width: 100%; - color: rgba(153, 153, 153, 1); + color: #fff; overflow: hidden; position: relative; @@ -69,6 +69,10 @@ margin-left: 24px; cursor: pointer; + &:hover { + background: rgba(0, 0, 0, 0.45); + } + &:last-child { margin-right: 24px; } diff --git a/components/cascader/style/cascader.scss b/components/cascader/style/cascader.scss index 26695e6e2..8dcb72950 100644 --- a/components/cascader/style/cascader.scss +++ b/components/cascader/style/cascader.scss @@ -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 { diff --git a/components/collapse/style/index.scss b/components/collapse/style/index.scss index 7dbc163c1..0b052f9f3 100755 --- a/components/collapse/style/index.scss +++ b/components/collapse/style/index.scss @@ -6,7 +6,7 @@ font-size: 14px; .collapse-item { - border-bottom: 1px solid #d9d9d9; + border-bottom: 1px solid #d8d8d8; &__head { display: flex; diff --git a/components/counter/style/index.scss b/components/counter/style/index.scss index 9885177f0..6cf331eaf 100644 --- a/components/counter/style/index.scss +++ b/components/counter/style/index.scss @@ -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; @@ -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; diff --git a/components/date-picker/Calender.js b/components/date-picker/Calender.js index 6623239e8..77c06d61c 100644 --- a/components/date-picker/Calender.js +++ b/components/date-picker/Calender.js @@ -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) } } @@ -338,7 +338,7 @@ class Calender extends Component { }} > { - fullTimeInfo.hightlight + fullTimeInfo.highlight ? {fullTimeInfo.text} diff --git a/components/date-picker/DatePicker.js b/components/date-picker/DatePicker.js index bbbcac441..cc18e8248 100644 --- a/components/date-picker/DatePicker.js +++ b/components/date-picker/DatePicker.js @@ -46,7 +46,7 @@ class DatePicker extends BasePicker { Object.assign(oneYear, { [item.date.replace(/-/g, '/')]: { ...item, - hightlight: true + highlight: true } }) }) diff --git a/components/dropdown/DropdownMenu.jsx b/components/dropdown/DropdownMenu.jsx index 79f9396f5..c8b14947f 100644 --- a/components/dropdown/DropdownMenu.jsx +++ b/components/dropdown/DropdownMenu.jsx @@ -30,7 +30,7 @@ class DropdownMenu extends React.Component { placement={placement} width={width} onMouseEnter={onMouseEnter} - leftGap={1} + leftGap={0} onMouseLeave={onMouseLeave} >
    diff --git a/components/menu/SubMenu.js b/components/menu/SubMenu.js index cd0b643e7..cc74c236a 100644 --- a/components/menu/SubMenu.js +++ b/components/menu/SubMenu.js @@ -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 }) } diff --git a/components/modal/index.js b/components/modal/index.js index 309d55922..e3f65195f 100755 --- a/components/modal/index.js +++ b/components/modal/index.js @@ -87,7 +87,7 @@ class Modal extends Component { return footers || footer } else { return [ - , - ]} > 一些消息 一些消息 diff --git a/docs/zh-CN/components/alert.mdx b/docs/zh-CN/components/alert.mdx index 72f84f0a2..cc1bd8e56 100755 --- a/docs/zh-CN/components/alert.mdx +++ b/docs/zh-CN/components/alert.mdx @@ -1,4 +1,4 @@ -# Alert 警告 +# Alert 警告提示 作用于页面的内容区域的提示,非触发类信息 @@ -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 | diff --git a/docs/zh-CN/components/changelog.mdx b/docs/zh-CN/components/changelog.mdx index 4adf39ef5..f393719da 100644 --- a/docs/zh-CN/components/changelog.mdx +++ b/docs/zh-CN/components/changelog.mdx @@ -1,5 +1,11 @@ # 更新日志 +## 2.11.0 + +- 新增 `` altCalendarPreset 预设历法信息(支持中国农历和印度节假日),altCalendar 自定义日期显示,dateMarkRender 自定义日期右上角显示标志,dateMarkPreset 预设右上角显示标志「班」和「休」 [#902](https://github.com/XiaoMi/hiui/issues/902)[#992](https://github.com/XiaoMi/hiui/issues/992) +- 修复 `` 高亮、展开对应菜单项不正确的问题 [#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 - 新增 `` onDownload 点击上传成功文件的回调 [#613](https://github.com/XiaoMi/hiui/issues/613) diff --git a/docs/zh-CN/components/date-picker.mdx b/docs/zh-CN/components/date-picker.mdx index 8c443bd6e..6089c13a9 100755 --- a/docs/zh-CN/components/date-picker.mdx +++ b/docs/zh-CN/components/date-picker.mdx @@ -46,34 +46,34 @@ import DemoCalendar from '../../demo/date-picker/section-calendar.jsx' ## Props -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -| ----------- | --------------------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -| type | 选择器类型 | string | date 普通日期
    daterange 日期范围
    year 年份
    month 月份
    week 周
    weekrange 周范围
    timeperiod 时间段(1.5 新增) | date | -| value | 默认显示的日期 | Date \| string \| number\| DateRange \| undefined \| null | - | null | -| minDate | 最小日期 | Date | null | null | -| maxDate | 最大日期 | Date | null | null | -| disabled | 是否禁用输入框 | boolean | true \| false | false | -| disabledDate | 不可选择的日期 | (currentDate: Date) => boolean | true \| false | false | -| clearable | 是否可以清空 | boolean | true \| false | true | -| showTime | 是否在日期选择器中显示时间选择器 | boolean | true \| false | false | -| shortcuts | 快捷面板 | string[] | 近一周, 近一月, 近三月, 近一年 | null | -| weekOffset | 周起始
    默认周日做为第一列 | number | 0 \| 1 | 0 | -| placeholder | 自定义占位符
    数组用于范围日期 | string \| string[] | - | - | -| onChange | 值变化时的回调函数 | (date: Date \| DateRange, dateStr: string \| DateRange ) => void | - | - | -| altCalendar | 日期中历法信息 | CalendarItem | - | 农历 & 假日 | -| altCalendarPreset | 暂预置历法信息
    <阴历\|印度> | string | 'zh-CN' \| 'id-ID' | 'zh-CN' | -| dateMarkRender | 日期的右上角标记 | (currentDate: Date, today: Date) => React.ReactNode | - | 休 \| 班 | -| dateMarkPreset | 暂预置中国大陆节假日 | string | 'zh-CN' | 'zh-CN' | - +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ----------------- | ---------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | +| type | 选择器类型 | string | date 普通日期
    daterange 日期范围
    year 年份
    month 月份
    week 周
    weekrange 周范围
    timeperiod 时间段(1.5 新增) | date | +| value | 默认显示的日期 | Date \| string \| number\| DateRange \| undefined \| null | - | null | +| minDate | 最小日期 | Date | null | null | +| maxDate | 最大日期 | Date | null | null | +| disabled | 是否禁用输入框 | boolean | true \| false | false | +| disabledDate | 不可选择的日期 | (currentDate: Date) => boolean | true \| false | false | +| clearable | 是否可以清空 | boolean | true \| false | true | +| showTime | 是否在日期选择器中显示时间选择器 | boolean | true \| false | false | +| shortcuts | 快捷面板 | string[] | 近一周, 近一月, 近三月, 近一年 | null | +| weekOffset | 周起始,默认周日做为第一列 | number | 0 \| 1 | 0 | +| placeholder | 自定义占位符(数组用于范围日期) | string \| string[] | - | - | +| onChange | 值变化时的回调函数 | (date: Date \| DateRange, dateStr: string \| DateRange ) => void | - | - | +| altCalendar | 自定义日期中历法展示信息 | CalendarItem | - | 农历 & 假日 | +| altCalendarPreset | 预置历法信息(支持中国农历和印度节假日) | string | 'zh-CN' \| 'id-ID' | 'zh-CN' | +| dateMarkRender | 自定义日期的右上角标记 | (currentDate: Date, today: Date) => React.ReactNode | - | - | +| dateMarkPreset | 预置日期的右上角标记(休 \| 班) | string | 'zh-CN' | 'zh-CN' | ## Type + ### CalendarItem -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -| -------- | ------- | ------- | ------ | ------ | -| date | 日期 | Date \| string | - | - | -| text | 描述信息 | string | - | - | -| hightlight | 高亮显示 | boolean | true \| false | false | +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| --------- | -------- | -------------- | ------------- | ------ | +| date | 日期 | Date \| string | - | - | +| text | 描述信息 | string | - | - | +| highlight | 高亮显示 | boolean | true \| false | false | ### DateRange diff --git a/package.json b/package.json index c2413920e..1d756984c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hi-ui/hiui", - "version": "2.10.0", + "version": "2.11.0", "description": "HIUI for React", "scripts": { "test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'", diff --git a/site/locales/zh-CN.js b/site/locales/zh-CN.js index 93aa5eb95..c8a7b8cf2 100755 --- a/site/locales/zh-CN.js +++ b/site/locales/zh-CN.js @@ -26,7 +26,7 @@ module.exports = { modal: 'Modal 模态对话框', confirm: 'confirm 方法组件', form: 'Form 表单', - alert: 'Alert 警告框', + alert: 'Alert 警告提示', message: 'Message 消息', panel: 'Panel 面板', collapse: 'Collapse 折叠面板',