diff --git a/.github/workflows/pr-check-merge.yml b/.github/workflows/pr-check-merge.yml index 9798928806..01c6c15db1 100644 --- a/.github/workflows/pr-check-merge.yml +++ b/.github/workflows/pr-check-merge.yml @@ -7,7 +7,7 @@ on: jobs: comment: runs-on: ubuntu-latest - if: (github.event.pull_request.head.ref == 'feature' && github.event.pull_request.base.ref == 'master') || (github.event.pull_request.base.ref == 'feature' && github.event.pull_request.head.ref == 'master') + if: github.event.pull_request.head.ref == 'feature' || github.event.pull_request.head.ref == 'master' steps: - uses: actions-cool/issues-helper@v2.2.1 with: diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index 1f986cee46..9372d71c72 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -15054,9 +15054,12 @@ exports[`ConfigProvider components Menu configProvider 1`] = ` role="menuitem" style="padding-left:24px" tabindex="-1" - title="bamboo" > - bamboo + + bamboo + @@ -15083,7 +15086,11 @@ exports[`ConfigProvider components Menu configProvider 1`] = ` style="padding-left:48px" tabindex="-1" > - Light + + Light + @@ -15110,9 +15117,12 @@ exports[`ConfigProvider components Menu configProvider componentSize large 1`] = role="menuitem" style="padding-left:24px" tabindex="-1" - title="bamboo" > - bamboo + + bamboo + @@ -15139,7 +15149,11 @@ exports[`ConfigProvider components Menu configProvider componentSize large 1`] = style="padding-left:48px" tabindex="-1" > - Light + + Light + @@ -15166,9 +15180,12 @@ exports[`ConfigProvider components Menu configProvider componentSize middle 1`] role="menuitem" style="padding-left:24px" tabindex="-1" - title="bamboo" > - bamboo + + bamboo + @@ -15195,7 +15212,11 @@ exports[`ConfigProvider components Menu configProvider componentSize middle 1`] style="padding-left:48px" tabindex="-1" > - Light + + Light + @@ -15222,9 +15243,12 @@ exports[`ConfigProvider components Menu configProvider virtual and dropdownMatch role="menuitem" style="padding-left:24px" tabindex="-1" - title="bamboo" > - bamboo + + bamboo + @@ -15251,7 +15275,11 @@ exports[`ConfigProvider components Menu configProvider virtual and dropdownMatch style="padding-left:48px" tabindex="-1" > - Light + + Light + @@ -15278,9 +15306,12 @@ exports[`ConfigProvider components Menu normal 1`] = ` role="menuitem" style="padding-left:24px" tabindex="-1" - title="bamboo" > - bamboo + + bamboo + @@ -15307,7 +15338,11 @@ exports[`ConfigProvider components Menu normal 1`] = ` style="padding-left:48px" tabindex="-1" > - Light + + Light + @@ -15334,9 +15369,12 @@ exports[`ConfigProvider components Menu prefixCls 1`] = ` role="menuitem" style="padding-left:24px" tabindex="-1" - title="bamboo" > - bamboo + + bamboo + @@ -15365,7 +15403,11 @@ exports[`ConfigProvider components Menu prefixCls 1`] = ` style="padding-left:48px" tabindex="-1" > - Light + + Light + @@ -22866,23 +22908,27 @@ exports[`ConfigProvider components Table configProvider 1`] = ` role="menuitem" tabindex="-1" > - + + Joe - - - Joe
  • - nav 2 + + nav 2 +
  • - nav 3 + + nav 3 +
  • - nav 2 + + nav 2 +
  • - nav 3 + + nav 3 +
  • - nav 2 + + nav 2 +
  • - nav 3 + + nav 3 +
  • - option2 + + option2 +
  • - option3 + + option3 +
  • - option4 + + option4 +
  • @@ -1699,7 +1802,11 @@ exports[`renders ./components/layout/demo/top-side-2.md correctly 1`] = ` style="opacity:1;order:0" tabindex="-1" > - nav 1 + + nav 1 +
  • - nav 2 + + nav 2 +
  • - nav 3 + + nav 3 +
  • - option2 + + option2 +
  • - option3 + + option3 +
  • - option4 + + option4 +
  • diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 1a0ce30b8f..5cd080f8a7 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -21,15 +21,16 @@ export default class MenuItem extends React.Component { renderItemChildren(inlineCollapsed: boolean) { const { prefixCls, firstLevel } = this.context; const { icon, children } = this.props; + + const wrapNode = {children}; // inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span // ref: https://github.com/ant-design/ant-design/pull/23456 if (!icon || (isValidElement(children) && children.type === 'span')) { if (children && inlineCollapsed && firstLevel && typeof children === 'string') { return
    {children.charAt(0)}
    ; } - return children; } - return {children}; + return wrapNode; } renderItem = ({ siderCollapsed }: SiderContextProps) => { diff --git a/components/menu/SubMenu.tsx b/components/menu/SubMenu.tsx index 83fee858aa..acb9a750e0 100644 --- a/components/menu/SubMenu.tsx +++ b/components/menu/SubMenu.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { SubMenu as RcSubMenu } from 'rc-menu'; -import { useFullPath } from 'rc-menu/lib/context/PathContext'; +import { SubMenu as RcSubMenu, useFullPath } from 'rc-menu'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; import MenuContext from './MenuContext'; @@ -40,7 +39,7 @@ function SubMenu(props: SubMenuProps) { inlineCollapsed && !parentPath.length && title && typeof title === 'string' ? (
    {title.charAt(0)}
    ) : ( - title + {title} ); } else { // inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span diff --git a/components/menu/__tests__/__snapshots__/demo.test.js.snap b/components/menu/__tests__/__snapshots__/demo.test.js.snap index ffbd2886d1..b18beedb17 100644 --- a/components/menu/__tests__/__snapshots__/demo.test.js.snap +++ b/components/menu/__tests__/__snapshots__/demo.test.js.snap @@ -116,19 +116,23 @@ exports[`renders ./components/menu/demo/horizontal.md correctly 1`] = ` style="opacity:1;order:3" tabindex="-1" > - - Navigation Four - Link - + + Navigation Four - Link + +
  • - Option 2 + + Option 2 +
  • @@ -247,7 +276,11 @@ exports[`renders ./components/menu/demo/inline.md correctly 1`] = ` style="padding-left:48px" tabindex="-1" > - Option 3 + + Option 3 +
  • - Option 4 + + Option 4 +
  • @@ -524,7 +561,11 @@ exports[`renders ./components/menu/demo/inline-collapsed.md correctly 1`] = ` style="padding-left:48px" tabindex="-1" > - Option 5 + + Option 5 +
  • - Option 6 + + Option 6 +
  • - Option 7 + + Option 7 +
  • - Option 8 + + Option 8 +
  • @@ -655,7 +708,11 @@ exports[`renders ./components/menu/demo/sider-current.md correctly 1`] = ` style="padding-left:48px" tabindex="-1" > - Option 1 + + Option 1 +
  • - Option 2 + + Option 2 +
  • - Option 3 + + Option 3 +
  • - Option 4 + + Option 4 +
  • @@ -881,7 +950,11 @@ Array [ style="opacity:1;order:2" tabindex="-1" > - Option 11 + + Option 11 +
  • - Option 12 + + Option 12 +
  • - Option 4 + + Option 4 +
  • - Option 2 + + Option 2 +
  • - Option 3 + + Option 3 +
  • - Option 4 + + Option 4 +
  • diff --git a/components/menu/__tests__/__snapshots__/index.test.js.snap b/components/menu/__tests__/__snapshots__/index.test.js.snap index 5d1c72f45c..67c6753d6c 100644 --- a/components/menu/__tests__/__snapshots__/index.test.js.snap +++ b/components/menu/__tests__/__snapshots__/index.test.js.snap @@ -63,8 +63,12 @@ exports[`Menu Menu.Item with icon children auto wrap span 1`] = ` /> - - Navigation One + + + Navigation One +
  • @@ -186,6 +194,9 @@ exports[`Menu rtl render component should be rendered correctly in RTL direction role="menuitem" tabindex="-1" > + diff --git a/components/menu/index.tsx b/components/menu/index.tsx index caea96bfe0..3d96016925 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import RcMenu, { Divider, ItemGroup, MenuProps as RcMenuProps } from 'rc-menu'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; +import { EllipsisOutlined } from '@ant-design/icons'; import SubMenu, { SubMenuProps } from './SubMenu'; import Item, { MenuItemProps } from './MenuItem'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; @@ -89,6 +90,7 @@ class InternalMenu extends React.Component { > } {...passedProps} inlineCollapsed={inlineCollapsed} className={menuClassName} diff --git a/components/menu/style/dark.less b/components/menu/style/dark.less index 1ad2abf991..ed8a853f1e 100644 --- a/components/menu/style/dark.less +++ b/components/menu/style/dark.less @@ -87,8 +87,7 @@ > span > a { color: @menu-dark-highlight-color; } - > .@{menu-prefix-cls}-submenu-title, - > .@{menu-prefix-cls}-submenu-title:hover { + > .@{menu-prefix-cls}-submenu-title { > .@{menu-prefix-cls}-submenu-arrow { opacity: 1; &::after, diff --git a/components/menu/style/index.less b/components/menu/style/index.less index 0b799a0df1..0815c92915 100644 --- a/components/menu/style/index.less +++ b/components/menu/style/index.less @@ -211,8 +211,6 @@ + span { margin-left: @menu-icon-margin-right; opacity: 1; - // transition: opacity @animation-duration-slow @ease-in-out, - // width @animation-duration-slow @ease-in-out, color @animation-duration-slow; transition: opacity @animation-duration-slow @ease-in-out, margin @animation-duration-slow, color @animation-duration-slow; } @@ -365,19 +363,19 @@ &:not(.@{menu-prefix-cls}-dark) { > .@{menu-prefix-cls}-item, > .@{menu-prefix-cls}-submenu { - margin: @menu-item-padding; margin-top: -1px; margin-bottom: 0; padding: @menu-item-padding; - padding-right: 0; - padding-left: 0; &:hover, &-active, &-open, &-selected { color: @menu-highlight-color; - border-bottom: 2px solid @menu-highlight-color; + + &::after { + border-bottom: 2px solid @menu-highlight-color; + } } } } @@ -388,7 +386,16 @@ top: 1px; display: inline-block; vertical-align: bottom; - border-bottom: 2px solid transparent; + + &::after { + position: absolute; + right: @menu-item-padding-horizontal; + bottom: 0; + left: @menu-item-padding-horizontal; + border-bottom: 2px solid transparent; + transition: border-color @animation-duration-slow @ease-in-out; + content: ''; + } } > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title { @@ -625,8 +632,12 @@ &-submenu-disabled { color: @disabled-color !important; background: none; - border-color: transparent !important; cursor: not-allowed; + + &::after { + border-color: transparent !important; + } + a { color: @disabled-color !important; pointer-events: none; diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index 7912167be1..d045f0153e 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -1583,7 +1583,7 @@ exports[`renders ./components/select/demo/responsive.md correctly 1`] = `
  • - + + Girl - - - Girl
  • - Title + + Title + @@ -806,24 +817,28 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] = role="menuitem" tabindex="-1" > - + + Boy - - - Boy
  • - + + Girl - - - Girl
  • - Title + + Title + diff --git a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap index 3c3f77061c..cd374e319e 100644 --- a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap @@ -1062,7 +1062,11 @@ exports[`Table.rowSelection should support getPopupContainer 1`] = ` role="menuitem" tabindex="-1" > - Select all data + + Select all data +
  • @@ -1402,7 +1414,11 @@ exports[`Table.rowSelection should support getPopupContainer from ConfigProvider role="menuitem" tabindex="-1" > - Select all data + + Select all data + diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index f850459e32..691070f852 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -17091,23 +17091,19 @@ Array [ class="ant-spin-container" >
    - - - + @@ -17125,6 +17121,20 @@ Array [ +
    +
    +
    + + + + @@ -17160,7 +17170,7 @@ Array [ class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" style="position:sticky;left:0" > - Bamboo + Light + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - Light + Bamboo - Bamboo + Little + + Little + + Everything that has a beginning, has an end. +
    + Bamboo + + Everything that has a beginning, has an end. +
    + Little + + Everything that has a beginning, has an end. +
    + Light + + Everything that has a beginning, has an end. +
    + Bamboo + + Everything that has a beginning, has an end. +
    + Little + + Everything that has a beginning, has an end. +
    + Light + + Everything that has a beginning, has an end. +
    + Bamboo + + Everything that has a beginning, has an end. +
    + Little + + Everything that has a beginning, has an end. +
    + Light + + Everything that has a beginning, has an end. +
    + Bamboo + + Everything that has a beginning, has an end. +
    + Little + + Everything that has a beginning, has an end. +
    + Light + + Everything that has a beginning, has an end. +
    + Bamboo + + Everything that has a beginning, has an end. +
    +
    +
    + + diff --git a/components/table/demo/summary.md b/components/table/demo/summary.md index 140ce470b0..f36723db08 100644 --- a/components/table/demo/summary.md +++ b/components/table/demo/summary.md @@ -7,11 +7,11 @@ title: ## zh-CN -通过 `summary` 设置总结栏。使用 `Table.Summary.Cell` 同步 Column 的固定状态。 +通过 `summary` 设置总结栏。使用 `Table.Summary.Cell` 同步 Column 的固定状态。你可以通过配置 `Table.Summary` 的 `fixed` 属性使其固定(`4.16.0` 支持)。 ## en-US -Set summary content by `summary` prop. Sync column fixed status with `Table.Summary.Cell`. +Set summary content by `summary` prop. Sync column fixed status with `Table.Summary.Cell`. You can fixed it by set `Table.Summary` `fixed` prop(since `4.16.0`). ```jsx import { Table, Typography } from 'antd'; @@ -74,10 +74,10 @@ const fixedColumns = [ ]; const fixedData = []; -for (let i = 0; i < 6; i += 1) { +for (let i = 0; i < 20; i += 1) { fixedData.push({ key: i, - name: i % 2 ? 'Light' : 'Bamboo', + name: ['Light', 'Bamboo', 'Little'][i % 3], description: 'Everything that has a beginning, has an end.', }); } @@ -126,13 +126,15 @@ ReactDOM.render( columns={fixedColumns} dataSource={fixedData} pagination={false} - scroll={{ x: 2000 }} + scroll={{ x: 2000, y: 500 }} bordered summary={() => ( - - Summary - This is a summary content - + + + Summary + This is a summary content + + )} /> , diff --git a/components/table/style/bordered.less b/components/table/style/bordered.less index 6647cdbf43..814560304a 100644 --- a/components/table/style/bordered.less +++ b/components/table/style/bordered.less @@ -18,7 +18,8 @@ > .@{table-prefix-cls}-content, > .@{table-prefix-cls}-header, - > .@{table-prefix-cls}-body { + > .@{table-prefix-cls}-body, + > .@{table-prefix-cls}-summary { > table { // ============================= Cell ============================= > thead > tr > th, diff --git a/components/tag/index.zh-CN.md b/components/tag/index.zh-CN.md index ab641fdcd6..7611a029f8 100644 --- a/components/tag/index.zh-CN.md +++ b/components/tag/index.zh-CN.md @@ -24,7 +24,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/cH1BOLfxC/Tag.svg | color | 标签色 | string | - | | | icon | 设置图标 | ReactNode | - | | | visible | 是否显示标签 | boolean | true | | -| onClose | 关闭时的回调(可通过 `e.preventdefault()` 来阻止默认行为) | (e) => void | - | | +| onClose | 关闭时的回调(可通过 `e.preventDefault()` 来阻止默认行为) | (e) => void | - | | ### Tag.CheckableTag diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index f2896e59ba..2eb116f1c9 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -517,7 +517,7 @@ class Base extends React.Component { this.expandStr = expand; return ( - + .ant-menu-item, & > .ant-menu-submenu { - min-width: 40px; + min-width: (40px + 12px * 2); height: @header-height; - margin-right: 12px; - margin-left: 12px; - line-height: @header-height - @menu-item-border - 2px; - border-top: @menu-item-border solid transparent; + padding-right: 12px; + padding-left: 12px; + line-height: @header-height; - &:hover { - border-top: @menu-item-border solid @primary-color; - border-bottom: @menu-item-border solid transparent; + &::after { + top: 0; + right: 12px; + bottom: auto; + left: 12px; + border-width: @menu-item-border; } } @@ -30,14 +32,7 @@ margin: 0; } - & > .ant-menu-submenu-open { - border-top: @menu-item-border solid @primary-color; - border-bottom: @menu-item-border solid transparent; - } - & > .ant-menu-item-selected { - border-top: @menu-item-border solid @primary-color; - border-bottom: @menu-item-border solid transparent; a { color: @primary-color; } diff --git a/site/theme/template/Layout/Header/Navigation.tsx b/site/theme/template/Layout/Header/Navigation.tsx index e7e5e0a5e0..61eb2a5352 100644 --- a/site/theme/template/Layout/Header/Navigation.tsx +++ b/site/theme/template/Layout/Header/Navigation.tsx @@ -81,6 +81,7 @@ export default ({ mode={menuMode} selectedKeys={[activeMenuItem]} id="nav" + disabledOverflow >