From 909bde6c07172b56cec80b1e7d92716f321007ee Mon Sep 17 00:00:00 2001 From: Chris Frisina Date: Wed, 11 Mar 2020 03:39:18 -0400 Subject: [PATCH 01/15] documentation about browser keyboards and restrictions (#21174) This helps teach users that a commonly requested feature can be included with proper documentation of how to utilize the numeric keyboard or numeric restrictions on the input --- components/input-number/index.en-US.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/input-number/index.en-US.md b/components/input-number/index.en-US.md index f0e94c7063..c1ccbb600a 100644 --- a/components/input-number/index.en-US.md +++ b/components/input-number/index.en-US.md @@ -25,6 +25,7 @@ When a numeric value needs to be provided. | decimalSeparator | decimal separator | string | | | size | height of input box | `large` \| `middle` \| `small` | | | step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 | +| type | HTML inputs can have a type of `number`, and this can be added to aid [mobile] broswer keyboards to show the number keybaord, as well as limit inputs to numbers only [0-9 and e], but will not guaruntee client and server side validation. | string - ie 'number' | | | value | current value | number | | | onChange | The callback triggered when the value is changed. | function(value: number \| string) | | | onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | @@ -35,3 +36,12 @@ When a numeric value needs to be provided. | ------- | ------------ | | blur() | remove focus | | focus() | get focus | + + +## Notes +Per issues [21158][1], [17344][2], [9421][3], and [documentation about inputs][4], it appears this community does not support native inclusion of the `type="number"` in the `` attributes, so please feel free to include it as needed, and be aware that it is heavily suggested that server side validation be utilized, as client side validation can be edited by power users. + +[1]: https://github.com/ant-design/ant-design/issues/21158 +[2]: https://github.com/ant-design/ant-design/issues/17344 +[3]: https://github.com/ant-design/ant-design/issues/9421 +[4]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#Using_number_inputs From 284697dda9815b13f5dfc93e603b92440606ac91 Mon Sep 17 00:00:00 2001 From: Fawen Date: Wed, 11 Mar 2020 18:26:11 +0800 Subject: [PATCH 02/15] docs: fix ColorPicker cover by page-nav (#22115) --- site/theme/static/common.less | 1 - 1 file changed, 1 deletion(-) diff --git a/site/theme/static/common.less b/site/theme/static/common.less index 1ceebb9731..62803f6cc9 100644 --- a/site/theme/static/common.less +++ b/site/theme/static/common.less @@ -20,7 +20,6 @@ a { position: relative; min-height: 500px; padding: 0 170px 32px 64px; - overflow: hidden; background: @component-background; .ant-row-rtl & { From e989683eefb7df51d6233532474ab88121d209f8 Mon Sep 17 00:00:00 2001 From: Paul Julien Date: Wed, 11 Mar 2020 11:37:48 +0100 Subject: [PATCH 03/15] fix: fr_FR locale (#22122) --- components/date-picker/locale/fr_FR.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/date-picker/locale/fr_FR.tsx b/components/date-picker/locale/fr_FR.tsx index 229cf66ae8..e08707457b 100644 --- a/components/date-picker/locale/fr_FR.tsx +++ b/components/date-picker/locale/fr_FR.tsx @@ -5,7 +5,13 @@ import TimePickerLocale from '../../time-picker/locale/fr_FR'; const locale = { lang: { placeholder: 'Sélectionner une date', + yearPlaceholder: 'Sélectionner une année', + monthPlaceholder: 'Séléctionner un mois', + weekPlaceholder: 'Séléctionne une semaine', rangePlaceholder: ['Date de début', 'Date de fin'], + rangeYearPlaceholder: ['Année de début', 'Année de fin'], + rangeMonthPlaceholder: ['Mois de début', 'Mois de fin'], + rangeWeekPlaceholder: ['Semaine de début', 'Semaine de fin'], ...CalendarLocale, }, timePickerLocale: { From 889a9ba9fdc38628231ada55e0713e7221173f35 Mon Sep 17 00:00:00 2001 From: Wendell Date: Wed, 11 Mar 2020 21:10:40 +0800 Subject: [PATCH 04/15] fix: fix tooltip trigger type (#22043) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fix tooltip trigger type * fix: use extends over duck type * update rc-tooltip deps * fix rate ts define Co-authored-by: 二货机器人 --- components/rate/index.tsx | 2 +- components/tooltip/index.en-US.md | 2 +- components/tooltip/index.tsx | 22 +++------------------- components/tooltip/index.zh-CN.md | 2 +- package.json | 2 +- 5 files changed, 7 insertions(+), 23 deletions(-) diff --git a/components/rate/index.tsx b/components/rate/index.tsx index 6c892465be..2c272a31c7 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -38,7 +38,7 @@ export default class Rate extends React.Component { this.rcRate = node; }; - characterRender = (node: React.ReactNode, { index }: RateNodeProps) => { + characterRender = (node: React.ReactElement, { index }: RateNodeProps) => { const { tooltips } = this.props; if (!tooltips) return node; diff --git a/components/tooltip/index.en-US.md b/components/tooltip/index.en-US.md index 64b96a31a1..e381950b2c 100644 --- a/components/tooltip/index.en-US.md +++ b/components/tooltip/index.en-US.md @@ -32,7 +32,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover. | overlayClassName | Class name of the tooltip card | string | - | | overlayStyle | Style of the tooltip card | object | - | | placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` | -| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` \| `contextMenu` | `hover` | +| trigger | Tooltip trigger mode. Could be multiple by passing an array | `hover` \| `focus` \| `click` \| `contextMenu` \| `Array` | `hover` | | visible | Whether the floating tooltip card is visible or not | boolean | `false` | | onVisibleChange | Callback executed when visibility of the tooltip card is changed | (visible) => void | - | | align | this value will be merged into placement's config, please refer to the settings [rc-tooltip](https://github.com/react-component/tooltip) | Object | - | diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 8800ec643a..975b4fe3b5 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import RcTooltip from 'rc-tooltip'; +import { TooltipProps as RcTooltipProps } from 'rc-tooltip/lib/Tooltip'; import classNames from 'classnames'; -import { AlignType, ActionType, BuildInPlacements } from 'rc-trigger/lib/interface'; +import { BuildInPlacements } from 'rc-trigger/lib/interface'; import getPlacements, { AdjustOverflow, PlacementsConfig } from './placements'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; @@ -33,32 +34,15 @@ export interface TooltipAlignConfig { useCssTransform?: boolean; } -export interface AbstractTooltipProps { - prefixCls?: string; - overlayClassName?: string; +export interface AbstractTooltipProps extends Partial { style?: React.CSSProperties; className?: string; - overlayStyle?: React.CSSProperties; placement?: TooltipPlacement; builtinPlacements?: BuildInPlacements; - defaultVisible?: boolean; - visible?: boolean; - onVisibleChange?: (visible: boolean) => void; - mouseEnterDelay?: number; - mouseLeaveDelay?: number; - transitionName?: string; - trigger?: ActionType; openClassName?: string; arrowPointAtCenter?: boolean; autoAdjustOverflow?: boolean | AdjustOverflow; - // getTooltipContainer had been rename to getPopupContainer - getTooltipContainer?: (triggerNode: HTMLElement) => HTMLElement; getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; - children?: React.ReactNode; - // align is a more higher api - align?: AlignType; - /** Internal. Hide tooltip when hidden. This will be renamed in future. */ - destroyTooltipOnHide?: boolean; } export type RenderFunction = () => React.ReactNode; diff --git a/components/tooltip/index.zh-CN.md b/components/tooltip/index.zh-CN.md index 9bf0fc739b..a7681cbcba 100644 --- a/components/tooltip/index.zh-CN.md +++ b/components/tooltip/index.zh-CN.md @@ -34,7 +34,7 @@ title: Tooltip | overlayClassName | 卡片类名 | string | 无 | | overlayStyle | 卡片样式 | object | 无 | | placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | -| trigger | 触发行为,可选 `hover/focus/click/contextMenu` | string | hover | +| trigger | 触发行为,可选 `hover/focus/click/contextMenu`,可使用数组设置多个触发行为 | string \| string[] | hover | | visible | 用于手动控制浮层显隐 | boolean | false | | onVisibleChange | 显示隐藏的回调 | (visible) => void | 无 | | align | 该值将合并到 placement 的配置中,设置参考 [rc-tooltip](https://github.com/react-component/tooltip) | Object | 无 | diff --git a/package.json b/package.json index 281a4971f6..a79fa9c618 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "rc-switch": "~1.9.0", "rc-table": "~7.3.0", "rc-tabs": "~10.0.0", - "rc-tooltip": "~4.0.0", + "rc-tooltip": "~4.0.2", "rc-tree": "~3.0.0", "rc-tree-select": "~3.0.0", "rc-trigger": "~4.0.0", From 84dc47426989d649ef10e6a56e7478d63053c489 Mon Sep 17 00:00:00 2001 From: zombiej Date: Wed, 11 Mar 2020 21:28:08 +0800 Subject: [PATCH 05/15] docs: fix site build --- components/input-number/index.en-US.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/components/input-number/index.en-US.md b/components/input-number/index.en-US.md index c1ccbb600a..09a3a02aa4 100644 --- a/components/input-number/index.en-US.md +++ b/components/input-number/index.en-US.md @@ -25,7 +25,7 @@ When a numeric value needs to be provided. | decimalSeparator | decimal separator | string | | | size | height of input box | `large` \| `middle` \| `small` | | | step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 | -| type | HTML inputs can have a type of `number`, and this can be added to aid [mobile] broswer keyboards to show the number keybaord, as well as limit inputs to numbers only [0-9 and e], but will not guaruntee client and server side validation. | string - ie 'number' | | +| type | HTML inputs can have a type of `number`, and this can be added to aid [mobile] broswer keyboards to show the number keybaord, as well as limit inputs to numbers only [0-9 and e], but will not guaruntee client and server side validation. | string - ie 'number' | | | value | current value | number | | | onChange | The callback triggered when the value is changed. | function(value: number \| string) | | | onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | @@ -37,11 +37,6 @@ When a numeric value needs to be provided. | blur() | remove focus | | focus() | get focus | - ## Notes -Per issues [21158][1], [17344][2], [9421][3], and [documentation about inputs][4], it appears this community does not support native inclusion of the `type="number"` in the `` attributes, so please feel free to include it as needed, and be aware that it is heavily suggested that server side validation be utilized, as client side validation can be edited by power users. -[1]: https://github.com/ant-design/ant-design/issues/21158 -[2]: https://github.com/ant-design/ant-design/issues/17344 -[3]: https://github.com/ant-design/ant-design/issues/9421 -[4]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#Using_number_inputs +Per issues [#21158](https://github.com/ant-design/ant-design/issues/21158), [#17344](https://github.com/ant-design/ant-design/issues/17344), [#9421](https://github.com/ant-design/ant-design/issues/9421), and [documentation about inputs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#Using_number_inputs), it appears this community does not support native inclusion of the `type="number"` in the `` attributes, so please feel free to include it as needed, and be aware that it is heavily suggested that server side validation be utilized, as client side validation can be edited by power users. From 7ec2b771d48580bac09df376eda2a3cd8127d9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 11 Mar 2020 22:08:07 +0800 Subject: [PATCH 06/15] fix: Table expandable with fixed column style (#22131) --- components/table/style/index.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/table/style/index.less b/components/table/style/index.less index e2790c97d5..9fc4cb974f 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -58,10 +58,17 @@ // Fixed first or last should special process &.@{table-prefix-cls}-cell-fix-left-last, &.@{table-prefix-cls}-cell-fix-right-first { + display: flex; overflow: visible; + > .@{table-prefix-cls}-row-indent, + > .@{table-prefix-cls}-row-expand-icon { + flex: none; + } + .@{table-prefix-cls}-cell-content { display: block; + flex: auto; overflow: hidden; text-overflow: ellipsis; } From f44f6f38cffb18780b7d493dfcca65c538ac54b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 11 Mar 2020 23:58:32 +0800 Subject: [PATCH 07/15] fix: Table dropdown prefix cls (#22133) * fix: Table dropdownPrefixCls * update snapshot * update snapshot --- .../__tests__/__snapshots__/components.test.js.snap | 10 +++++----- components/table/Table.tsx | 3 ++- components/table/hooks/useFilter/index.tsx | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index b3106dce12..41688ac055 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -11764,11 +11764,11 @@ exports[`ConfigProvider components Table configProvider 1`] = ` class="config-table-filter-dropdown" >