diff --git a/.github/workflows/issue-open-check.yml b/.github/workflows/issue-open-check.yml index 443d8f675e..e87ed10f1b 100644 --- a/.github/workflows/issue-open-check.yml +++ b/.github/workflows/issue-open-check.yml @@ -69,8 +69,8 @@ jobs: issue-number: ${{ github.event.issue.number }} labels: 'IE | Firefox | Safari,Internet Explorer' - - name: check ie - if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.title, 'IE11') == true || contains(github.event.issue.title, 'IE 11') == true || contains(github.event.issue.title, 'Internet Explorer') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true + - name: check ie11- + if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true uses: actions-cool/issues-helper@v3 with: actions: 'create-comment, close-issue' diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 80d008f462..a5d810eedd 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,47 @@ timeline: true --- +## 4.19.0 + +`2022-03-08` + +- 💄 Optimize arrow style for some components. [#33710](https://github.com/ant-design/ant-design/pull/33710) + +![image](https://user-images.githubusercontent.com/27722486/157088587-ca49cc29-bf25-42d1-8c14-020b5501c62e.png) + +- Input + - 🛠 Refactor Input with rc-input. [#34206](https://github.com/ant-design/ant-design/pull/34206) + - Attention: The type and value of `ref` is modified because of refactoring from class component to function component. You can still get DOM node from `input`, and other methods such as `focus` and `blur` mentioned in document are also supported. + - 🆕 Support `clearIcon` prop for customizing clear icon. [#34325](https://github.com/ant-design/ant-design/pull/34325) +- Table + - 🆕 `filterSearch` now support passing function to customize search. [#34085](https://github.com/ant-design/ant-design/pull/34085) [@heiyu4585](https://github.com/heiyu4585) + - 🆕 `column.filterDropdown({ clearFilters })` support `clearFilters({ confirm: false, closeDropdown: false })`. [#34120](https://github.com/ant-design/ant-design/pull/34120) [@heiyu4585](https://github.com/heiyu4585) + - ⌨️ Table adds `aria-sort` attribute for screen readers. [#33603](https://github.com/ant-design/ant-design/pull/33603) [@dgreene1](https://github.com/dgreene1) + - 🐞 Fix Table filters select-all Checkbox not changed when select item. [#34295](https://github.com/ant-design/ant-design/pull/34295) +- 🆕 Data entry components add `status` prop to support custom status. + - Transfer [#34098](https://github.com/ant-design/ant-design/pull/34098) + - AutoComplete [#34096](https://github.com/ant-design/ant-design/pull/34096) + - TreeSelect [#34093](https://github.com/ant-design/ant-design/pull/34093) + - Cascader [#34086](https://github.com/ant-design/ant-design/pull/34086) + - Select [#34084](https://github.com/ant-design/ant-design/pull/34084) + - DatePicker and TimePicker [#34073](https://github.com/ant-design/ant-design/pull/34073) + - Mentions [#34071](https://github.com/ant-design/ant-design/pull/34071) + - InputNumber [#34042](https://github.com/ant-design/ant-design/pull/34042) + - Input [#33995](https://github.com/ant-design/ant-design/pull/33995) + +![image](https://user-images.githubusercontent.com/27722486/157089015-f96b0153-2cc4-4e04-94d6-e0e4b195d5d1.png) + +- 🆕 InputNumber supports `controls={{ upIcon, downIcon }}` to customize icon up and down. [#33914](https://github.com/ant-design/ant-design/pull/33914) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Notification `placement` support `top` / `bottom` [#33871](https://github.com/ant-design/ant-design/pull/33871) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Select, Cascades, DatePicker now support `placement` property. [#33641](https://github.com/ant-design/ant-design/pull/33541) [@ONLY-yours](https://github.com/ONLY-yours) +- 🆕 Dropdown support `arrow={{ pointAtCenter: true }}` to make arrow point at center. And `top` `bottom` placement are also supported. [#33658](https://github.com/ant-design/ant-design/pull/33658) +- 🆕 Skeleton.Input Adds `block` prop. [#33672](https://github.com/ant-design/ant-design/pull/33672) [@woochanleee](https://github.com/woochanleee) +- 🆕 Move TimePicker `disabledHours`, `disabledMinutes`, `disabledSeconds` into `disabledTime` to align with DatePicker. [#33503](https://github.com/ant-design/ant-design/pull/33503) +- 💄 Modify the color of some borders and the background color of the progress bar to be transparent to suit the colored background. [#33506](https://github.com/ant-design/ant-design/pull/33506) +- 💄 Space support custom children `key`. [#33607](https://github.com/ant-design/ant-design/pull/33607) [@qin20](https://github.com/qin20) +- 🐞 Fix `Typography.Title` didn't keep font size when become editable. [#34169](https://github.com/ant-design/ant-design/pull/34169) [@heiyu4585](https://github.com/heiyu4585) +- 🐞 Fix Form.Item throw warning `React does not recognize the requiredMark prop on a DOM element`. [#34323](https://github.com/ant-design/ant-design/pull/34323) + ## 4.18.9 `2022-02-28` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 3800169d39..4e7664b835 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,47 @@ timeline: true --- +## 4.19.0 + +`2022-03-08` + +- 💄 优化部分组件箭头样式。 [#33710](https://github.com/ant-design/ant-design/pull/33710) + +![image](https://user-images.githubusercontent.com/27722486/157088587-ca49cc29-bf25-42d1-8c14-020b5501c62e.png) + +- Input + - 🛠 引入 rc-input 重构 Input 组件为 function component。[#34206](https://github.com/ant-design/ant-design/pull/34206) + - 注意:由于从 class component 变为 function component,Input 组件的 `ref` 类型及内容已经更新,可以通过 `import { InputRef } from 'antd'` 引入。其中的 `input` 属性作为获取 DOM 的途径被保留,同时支持 `focus` 和 `blur` 等文档中支持的方法。 + - 🆕 新增 `clearIcon` 属性,支持自定义清除按钮。 [#34325](https://github.com/ant-design/ant-design/pull/34325) +- Table + - 🆕 `column.filterSearch` 属性现在支持返回一个函数用于自定义搜索条件。[#34085](https://github.com/ant-design/ant-design/pull/34085) [@heiyu4585](https://github.com/heiyu4585) + - 🆕 `column.filterDropdown({ clearFilters })` 支持参数 `clearFilters({ confirm: false, closeDropdown: false })` 控制筛选。[#34120](https://github.com/ant-design/ant-design/pull/34120) [@heiyu4585](https://github.com/heiyu4585) + - ⌨️ 增加 `aria-sort` 属性以优化屏幕阅读器的使用体验。 [#33603](https://github.com/ant-design/ant-design/pull/33603) [@dgreene1](https://github.com/dgreene1) + - 🐞 修复 Table 列筛选器中选择全部 Checkbox 状态问题。 [#34295](https://github.com/ant-design/ant-design/pull/34295) +- 🆕 表单组件新增 `status` 属性以支持自定义状态。 + - Transfer [#34098](https://github.com/ant-design/ant-design/pull/34098) + - AutoComplete [#34096](https://github.com/ant-design/ant-design/pull/34096) + - TreeSelect [#34093](https://github.com/ant-design/ant-design/pull/34093) + - Cascader [#34086](https://github.com/ant-design/ant-design/pull/34086) + - Select [#34084](https://github.com/ant-design/ant-design/pull/34084) + - DatePicker 和 TimePicker [#34073](https://github.com/ant-design/ant-design/pull/34073) + - Mentions [#34071](https://github.com/ant-design/ant-design/pull/34071) + - InputNumber [#34042](https://github.com/ant-design/ant-design/pull/34042) + - Input [#33995](https://github.com/ant-design/ant-design/pull/33995) + +![image](https://user-images.githubusercontent.com/27722486/157089015-f96b0153-2cc4-4e04-94d6-e0e4b195d5d1.png) + +- 🆕 InputNumber 组件支持 `controls={{ upIcon, downIcon }}` 用于自定义上下图标。[#33914](https://github.com/ant-design/ant-design/pull/33914) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Notification 组件弹窗位置新增支持 `top` / `bottom`。 [#33871](https://github.com/ant-design/ant-design/pull/33871) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Select、Cascader、DatePicker 等组件新增 `placement` 用于自定义弹层方向。 [#33641](https://github.com/ant-design/ant-design/pull/33541) [@ONLY-yours](https://github.com/ONLY-yours) +- 🆕 Dropdown 组件支持 `arrow={{ pointAtCenter: true }}` 用于指向元素正中间,并且新增 `top` `bottom` 两种 `placement` 位置。 [#33658](https://github.com/ant-design/ant-design/pull/33658) +- 🆕 Skeleton.Input 添加 `block` 属性。 [#33672](https://github.com/ant-design/ant-design/pull/33672) [@woochanleee](https://github.com/woochanleee) +- 🆕 合并 TimePicker `disabledHours`、`disabledMinutes`、`disabledSeconds` 至 `disabledTime` 以保持与 DatePicker 接口一致性。 [#33503](https://github.com/ant-design/ant-design/pull/33503) +- 💄 修改部分边框颜色和进度条的背景色为透明色以适应有色背景。 [#33506](https://github.com/ant-design/ant-design/pull/33506) +- 💄 Space 支持自定义 children 的 `key`。 [#33607](https://github.com/ant-design/ant-design/pull/33607) [@qin20](https://github.com/qin20) +- 🐞 修复 Typography.Title 进入编辑模式时大小不一致的问题。 [#34169](https://github.com/ant-design/ant-design/pull/34169) [@heiyu4585](https://github.com/heiyu4585) +- 🐞 修复 Form.Item 抛出 `React does not recognize the requiredMark prop on a DOM element` 的问题。 [#34323](https://github.com/ant-design/ant-design/pull/34323) + ## 4.18.9 `2022-02-28` diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index d879c2cab0..d8395ba358 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -261,6 +261,7 @@ function FormItem(props: FormItemProps): React.ReactElemen 'colon', 'extra', 'fieldKey', + 'requiredMark', 'getValueFromEvent', 'getValueProps', 'htmlFor', diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 909bbdcd48..f0265af2f6 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -113,7 +113,7 @@ export function triggerFocus( export interface InputProps extends Omit< RcInputProps, - 'wrapperClassName' | 'groupClassName' | 'inputClassName' | 'affixWrapperClassName' | 'clearIcon' + 'wrapperClassName' | 'groupClassName' | 'inputClassName' | 'affixWrapperClassName' > { size?: SizeType; status?: InputStatus; @@ -129,6 +129,7 @@ const Input = forwardRef((props, ref) => { onBlur, onFocus, suffix, + allowClear, ...rest } = props; const { getPrefixCls, direction, input } = React.useContext(ConfigContext); @@ -198,6 +199,14 @@ const Input = forwardRef((props, ref) => { const withPrefixSuffix = hasPrefixSuffix(props) || hasFeedback; + // Allow clear + let mergedAllowClear; + if (typeof allowClear === 'object' && allowClear?.clearIcon) { + mergedAllowClear = allowClear; + } else if (allowClear) { + mergedAllowClear = { clearIcon: }; + } + return ( ((props, ref) => { onBlur={handleBlur} onFocus={handleFocus} suffix={suffixNode} - clearIcon={} + allowClear={mergedAllowClear} inputClassName={classNames( !withPrefixSuffix && { [`${prefixCls}-sm`]: mergedSize === 'small', diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index 42f33c240d..b5e6c8c20b 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -373,4 +373,16 @@ describe('Input allowClear', () => { const wrapper = mount(); expect(wrapper).toBeTruthy(); }); + + it('should display boolean value as string', () => { + const wrapper = mount(); + expect(wrapper.find('input').first().getDOMNode().value).toBe('true'); + wrapper.setProps({ value: false }); + expect(wrapper.find('input').first().getDOMNode().value).toBe('false'); + }); + + it('should support custom clearIcon', () => { + const wrapper = mount(); + expect(wrapper.find('.ant-input-clear-icon').text()).toBe('clear'); + }); }); diff --git a/components/input/__tests__/textarea.test.js b/components/input/__tests__/textarea.test.js index 320d29f872..f2867a2702 100644 --- a/components/input/__tests__/textarea.test.js +++ b/components/input/__tests__/textarea.test.js @@ -509,4 +509,11 @@ describe('TextArea allowClear', () => { expect(document.activeElement).toBe(wrapper.find('textarea').at(0).getDOMNode()); wrapper.unmount(); }); + + it('should display boolean value as string', () => { + const wrapper = mount(