diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index d19eed5cc6..e97346d4c9 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,17 @@ timeline: true --- +## 0.3.10 + +`2018-09-21` + +- 🌟 `List`: List add `empty`. +- 🌟 `Table`: Table add `empty`. +- 🌟 `Icon`: Added new icons. +- 💄 `Select`: Adjust the style. +- 💄 `Cascader`: Adjust the style. +- 💄 `Table`: Fixed a bug where the editable cell example could not edit the cell. + ## 0.3.9 `2018-09-07` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index c08df61f27..52c3c19a91 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,17 @@ timeline: true --- +## 0.3.10 + +`2018-09-14` + +- 🌟 `List`: List添加`empty`属性。 +- 🌟 `Table`: Table添加`empty`属性。 +- 🌟 `Icon`: 增加新的图标。 +- 💄 `Select`: 修复Select使用方向键选择时样式缺失的bug。 +- 💄 `Cascader`: 级联选择器 修复样式问题。 +- 💄 `Table`: 修复可编辑单元格示例无法编辑单元格的bug。 + ## 0.3.9 `2018-09-07` diff --git a/components/cascader/style/index.less b/components/cascader/style/index.less index 3007524762..becd4d13d4 100644 --- a/components/cascader/style/index.less +++ b/components/cascader/style/index.less @@ -56,10 +56,14 @@ width: 100%; } + .ant-input-has-label .ant-input-content { + padding-top: 0; + } + &-clear { display: none; position: absolute; - right: @control-padding-horizontal; + right: 0; z-index: 2; background: @component-background; top: 50%; @@ -76,7 +80,7 @@ position: absolute; z-index: 1; top: 50%; - right: @control-padding-horizontal; + right: 0; margin-top: -8px; width: 20px; height: 20px; @@ -94,7 +98,7 @@ &-picker-small &-picker-clear, &-picker-small &-picker-arrow { - right: @control-padding-horizontal-sm; + right: 0; } &-menus { diff --git a/components/icon/icons.tsx b/components/icon/icons.tsx index 0b437d2cf7..ee8a053a16 100644 --- a/components/icon/icons.tsx +++ b/components/icon/icons.tsx @@ -1,6 +1,7 @@ const icons = { default: [ - 'classname', 'state_over', 'task_schedule', 'unallocated_question', 'unfinished_question', 'all_reports', 'burnout_map', + 'devops_chart', 'agile_chart', 'test_chart', 'bar_chart', 'unlock', 'classname', + 'state_over', 'task_schedule', 'unallocated_question', 'unfinished_question', 'all_reports', 'burnout_map', 'iterative_workbench', 'outstanding_tasks', 'report_overview', 'test_execute', 'test_planning', 'git', 'project_list', 'domain_list', 'IP_out', 'message_notification', 'all_read', 'inmail_template', 'mail_set', 'export_EOT', 'export_html', diff --git a/components/list/__tests__/__snapshots__/demo.test.js.snap b/components/list/__tests__/__snapshots__/demo.test.js.snap index ba9b3aa69a..f961fc7c46 100644 --- a/components/list/__tests__/__snapshots__/demo.test.js.snap +++ b/components/list/__tests__/__snapshots__/demo.test.js.snap @@ -395,40 +395,29 @@ exports[`renders ./components/list/demo/loadmore.md correctly 1`] = ` >
-
- - - -
+ +
-
-
-
{ renderItem, header, footer, + empty, loading, ...rest, } = this.props; @@ -181,7 +183,7 @@ export default class List extends React.Component { childrenContent = grid ? ( {childrenList} ) : childrenList; - } else if (!children && !isLoading) { + } else if (!children && !isLoading && !empty) { childrenContent = ( { {this.renderEmpty} ); + } else { + childrenContent = empty; } const content = ( diff --git a/components/list/index.zh-CN.md b/components/list/index.zh-CN.md index 44a8ab78c9..e3d1b83424 100644 --- a/components/list/index.zh-CN.md +++ b/components/list/index.zh-CN.md @@ -20,6 +20,7 @@ cols: 1 | --- | --- | --- | --- | | bordered | 是否展示边框 | boolean | false | | footer | 列表底部 | string\|ReactNode | - | +| empty | 当数据源为空时显示的内容 | string\|ReactNode | - | | grid | 列表栅格配置 | object | - | | header | 列表头部 | string\|ReactNode | - | | itemLayout | 设置 `List.Item` 布局, 设置成 `vertical` 则竖直样式显示, 默认横排 | string | - | diff --git a/components/select/style/index.less b/components/select/style/index.less index 1cb2ff8d43..cd236725bf 100644 --- a/components/select/style/index.less +++ b/components/select/style/index.less @@ -658,6 +658,10 @@ background-color: @item-focus-bg; } + &-active { + background-color: @item-focus-bg; + } + &-divider { height: 1px; margin: 1px 0; diff --git a/components/style/core/iconfont.less b/components/style/core/iconfont.less index ade4efbcdb..8e9e4d93e3 100644 --- a/components/style/core/iconfont.less +++ b/components/style/core/iconfont.less @@ -24,6 +24,24 @@ } } +// 9.19 + +.@{iconfont-css-prefix}-devops_chart:before { + content: "\e9b3"; +} +.@{iconfont-css-prefix}-agile_chart:before { + content: "\e9b5"; +} +.@{iconfont-css-prefix}-test_chart:before { + content: "\e9b6"; +} +.@{iconfont-css-prefix}-bar_chart:before { + content: "\e9b7"; +} +.@{iconfont-css-prefix}-unlock:before { + content: "\e9b8"; +} + // 9.7 .@{iconfont-css-prefix}-classname:before { diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 3447bd9170..e720cdd5ef 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -62,6 +62,7 @@ export default class Table extends React.Component, TableState< static propTypes = { dataSource: PropTypes.array, + empty: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), columns: PropTypes.array, prefixCls: PropTypes.string, useFixedHeader: PropTypes.bool, @@ -83,6 +84,7 @@ export default class Table extends React.Component, TableState< static defaultProps = { dataSource: [], + empty: null, prefixCls: 'ant-table', useFixedHeader: false, rowSelection: null, @@ -1008,7 +1010,7 @@ export default class Table extends React.Component, TableState< renderTable = (contextLocale: TableLocale, loading: SpinProps): React.ReactNode => { const locale = { ...contextLocale, ...this.props.locale }; - const { filterBarMultiple, prefixCls, filterBarPlaceholder, showHeader, filterBar, dataSource, filters, ...restProps } = this.props; + const { filterBarMultiple, prefixCls, filterBarPlaceholder, showHeader, filterBar, dataSource, filters, empty, ...restProps } = this.props; const data = this.getCurrentPageData(); const expandIconAsCell = this.props.expandedRowRender && this.props.expandIconAsCell !== false; @@ -1046,7 +1048,7 @@ export default class Table extends React.Component, TableState< className={classString} expandIconColumnIndex={expandIconColumnIndex} expandIconAsCell={expandIconAsCell} - emptyText={!loading.spinning && locale.emptyText} + emptyText={!loading.spinning && (empty || locale.emptyText)} /> ); if (filterBar) { diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 948f3a72e0..0f9c8775c8 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -4007,7 +4007,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = ` > Edward King 0
@@ -4054,7 +4054,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = ` > Edward King 1
diff --git a/components/table/demo/edit-cell.md b/components/table/demo/edit-cell.md index d43e6c0d19..0ceecd077d 100644 --- a/components/table/demo/edit-cell.md +++ b/components/table/demo/edit-cell.md @@ -59,7 +59,7 @@ class EditableCell extends React.Component {
{value || ' '} diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index 08b82a7c82..51a383d197 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -62,6 +62,7 @@ const columns = [{ | expandedRowRender | Expanded container render for each row | Function(record):ReactNode | - | | expandRowByClick | Whether to expand row by clicking anywhere in the whole row | boolean | `false` | | footer | Table footer renderer | Function(currentPageData) | | +| empty | Display while dataSource has't data | ReactNode | - | | indentSize | Indent size in pixels of tree data | number | 15 | | loading | Loading status of table | boolean\|[object](https://ant.design/components/spin-cn/#API) ([more](https://github.com/ant-design/ant-design/issues/4544#issuecomment-271533135)) | `false` | | locale | i18n text including filter, sort, empty text, etc | object | filterConfirm: 'Ok'
filterReset: 'Reset'
emptyText: 'No Data'
[Default](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) | diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index dc932d4d04..669a3ded59 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -63,6 +63,7 @@ const columns = [{ | expandedRowRender | 额外的展开行 | Function(record):ReactNode | - | | expandRowByClick | 通过点击行来展开子行 | boolean | `false` | | footer | 表格尾部 | Function(currentPageData) | | +| empty | 当数据源为空时显示的内容 | ReactNode | - | | indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | number | 15 | | loading | 页面是否加载中 | boolean\|[object](https://ant.design/components/spin-cn/#API) ([更多](https://github.com/ant-design/ant-design/issues/4544#issuecomment-271533135)) | false | | locale | 默认文案设置,目前包括排序、过滤、空数据文案 | object | filterConfirm: '确定'
filterReset: '重置'
emptyText: '暂无数据'
[默认值](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) | diff --git a/components/table/interface.tsx b/components/table/interface.tsx index 55ccb858e3..7035ec76e6 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -11,6 +11,7 @@ export type ColumnFilterItem = { text: string; value: string, children?: ColumnF export interface ColumnProps { title?: React.ReactNode; filterTitle?: React.ReactNode; + empty?: React.ReactNode; key?: React.Key; dataIndex?: string; render?: (text: any, record: T, index: number) => React.ReactNode; @@ -112,6 +113,7 @@ export interface TableProps { showHeader?: boolean; footer?: (currentPageData: Object[]) => React.ReactNode; title?: (currentPageData: Object[]) => React.ReactNode; + empty?: (currentPageData: Object[]) => React.ReactNode; scroll?: { x?: boolean | number | string, y?: boolean | number | string }; childrenColumnName?: string; bodyStyle?: React.CSSProperties; diff --git a/package.json b/package.json index 9a540fe295..7409808f45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "choerodon-ui", - "version": "0.3.9", + "version": "0.3.10", "title": "Choerodon UI", "description": "An enterprise-class UI design language and React-based implementation", "homepage": "",