From e26eb5f89272452bc3132d05a99176f9be1ab412 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Sun, 10 May 2020 22:11:09 +0800 Subject: [PATCH 01/19] docs: optimize site of rtl (#23995) --- components/avatar/demo/basic.md | 4 ++++ components/avatar/demo/type.md | 4 ++++ components/date-picker/index.en-US.md | 3 +++ components/date-picker/index.zh-CN.md | 3 +++ components/dropdown/demo/placement.md | 5 +++++ components/icon/demo/basic.md | 4 ++++ components/icon/demo/custom.md | 4 ++++ components/input-number/demo/size.md | 4 ++++ components/select/demo/size.md | 4 ++++ components/time-picker/index.en-US.md | 5 ++++- components/time-picker/index.zh-CN.md | 5 ++++- site/theme/static/icons.less | 5 +++++ 12 files changed, 48 insertions(+), 2 deletions(-) diff --git a/components/avatar/demo/basic.md b/components/avatar/demo/basic.md index 5b5b26cbc6..2b0d5c0576 100644 --- a/components/avatar/demo/basic.md +++ b/components/avatar/demo/basic.md @@ -41,4 +41,8 @@ ReactDOM.render( margin-top: 16px; margin-right: 16px; } +.ant-row-rtl #components-avatar-demo-basic .ant-avatar { + margin-right: 0; + margin-left: 16px; +} diff --git a/components/avatar/demo/type.md b/components/avatar/demo/type.md index 181e1e260e..7df106b094 100644 --- a/components/avatar/demo/type.md +++ b/components/avatar/demo/type.md @@ -35,4 +35,8 @@ ReactDOM.render( margin-top: 16px; margin-right: 16px; } +.ant-row-rtl #components-avatar-demo-type .ant-avatar { + margin-right: 0; + margin-left: 16px; +} diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md index 2bd43ec435..e3db07a027 100644 --- a/components/date-picker/index.en-US.md +++ b/components/date-picker/index.en-US.md @@ -162,6 +162,9 @@ Added in `4.1.0`. .code-box-demo .ant-picker { margin: 0 8px 12px 0; } +.ant-row-rtl .code-box-demo .ant-picker { + margin: 0 0 12px 8px; +} ## FAQ diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md index bf3c0552e4..36ae04d70f 100644 --- a/components/date-picker/index.zh-CN.md +++ b/components/date-picker/index.zh-CN.md @@ -164,6 +164,9 @@ import 'moment/locale/zh-cn'; .code-box-demo .ant-picker { margin: 0 8px 12px 0; } +.ant-row-rtl .code-box-demo .ant-picker { + margin: 0 0 12px 8px; +} ## FAQ diff --git a/components/dropdown/demo/placement.md b/components/dropdown/demo/placement.md index e3ff10a5f0..fa6f5270ec 100644 --- a/components/dropdown/demo/placement.md +++ b/components/dropdown/demo/placement.md @@ -67,4 +67,9 @@ ReactDOM.render( margin-right: 8px; margin-bottom: 8px; } +.ant-row-rtl #components-dropdown-demo-placement .ant-btn { + margin-right: 0; + margin-bottom: 8px; + margin-left: 8px; +} ``` diff --git a/components/icon/demo/basic.md b/components/icon/demo/basic.md index 5fc77895d4..af2f66304d 100644 --- a/components/icon/demo/basic.md +++ b/components/icon/demo/basic.md @@ -40,4 +40,8 @@ ReactDOM.render( margin-right: 6px; font-size: 24px; } +.ant-row-rtl .icons-list > .anticon { + margin-right: 0; + margin-left: 6px; +} diff --git a/components/icon/demo/custom.md b/components/icon/demo/custom.md index aaeac57a5f..054ee07763 100644 --- a/components/icon/demo/custom.md +++ b/components/icon/demo/custom.md @@ -84,4 +84,8 @@ ReactDOM.render( .custom-icons-list > .anticon { margin-right: 6px; } +.ant-row-rtl .custom-icons-list > .anticon { + margin-right: 0; + margin-left: 6px; +} ``` diff --git a/components/input-number/demo/size.md b/components/input-number/demo/size.md index d5f2a4cf67..301ce9290f 100644 --- a/components/input-number/demo/size.md +++ b/components/input-number/demo/size.md @@ -34,4 +34,8 @@ ReactDOM.render( .code-box-demo .ant-input-number { margin-right: 10px; } +.ant-row-rtl .code-box-demo .ant-input-number { + margin-right: 0; + margin-left: 10px; +} ``` diff --git a/components/select/demo/size.md b/components/select/demo/size.md index 99b1514ea1..798c0187bf 100644 --- a/components/select/demo/size.md +++ b/components/select/demo/size.md @@ -85,6 +85,10 @@ ReactDOM.render(, mountNode); margin: 0 8px 10px 0; } +.ant-row-rtl .code-box-demo .ant-select { + margin: 0 0 10px 8px; +} + #components-select-demo-search-box .code-box-demo .ant-select { margin: 0; } diff --git a/components/time-picker/index.en-US.md b/components/time-picker/index.en-US.md index 41019e348d..fe38cc5995 100644 --- a/components/time-picker/index.en-US.md +++ b/components/time-picker/index.en-US.md @@ -68,7 +68,10 @@ Same props from [RangePicker](/components/date-picker/#RangePicker) of DatePicke | -------- | ------------------------ | ------- | ------- | ------- | | order | Order start and end time | boolean | true | 4.1.0 | - + ## FAQ diff --git a/components/time-picker/index.zh-CN.md b/components/time-picker/index.zh-CN.md index c7ceb9b9a0..dffe7d67b6 100644 --- a/components/time-picker/index.zh-CN.md +++ b/components/time-picker/index.zh-CN.md @@ -68,7 +68,10 @@ import moment from 'moment'; | ----- | -------------------- | ------- | ------ | ----- | | order | 始末时间是否自动排序 | boolean | true | 4.1.0 | - + ## FAQ diff --git a/site/theme/static/icons.less b/site/theme/static/icons.less index f09762d68e..f5d647c703 100644 --- a/site/theme/static/icons.less +++ b/site/theme/static/icons.less @@ -1,6 +1,7 @@ ul.anticons-list { margin: 10px 0; overflow: hidden; + direction: ltr; list-style: none; li { position: relative; @@ -17,6 +18,10 @@ ul.anticons-list { border-radius: 4px; cursor: pointer; transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out; + .rtl & { + margin: 3px 0; + padding: 10px 0 0; + } .anticon { margin: 12px 0 8px; font-size: 36px; From e188537c00bd5caf9ceb942cd494b3d8563c5e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Sun, 10 May 2020 23:53:29 +0800 Subject: [PATCH 02/19] refactor: Dropdown.Button icon prop (#24020) ref #24017 --- .../__snapshots__/components.test.js.snap | 10 ++--- .../__tests__/__snapshots__/demo.test.js.snap | 44 ++++++++++--------- .../dropdown-button.test.js.snap | 4 +- components/dropdown/demo/dropdown-button.md | 2 +- components/dropdown/dropdown-button.tsx | 2 +- components/dropdown/style/index.less | 8 ++-- 6 files changed, 38 insertions(+), 32 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index 87994fb460..f95b3741ec 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -11088,7 +11088,7 @@ exports[`ConfigProvider components Dropdown configProvider 1`] = ` diff --git a/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap b/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap index 0b40271d9c..fc5ef40c13 100644 --- a/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap +++ b/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap @@ -15,7 +15,7 @@ exports[`DropdownButton rtl render component should be rendered correctly in RTL type="button" /> ; + const rightButton = @@ -162,7 +162,7 @@ export default class Modal extends React.Component { > {okText || locale.okText} - + ); }; diff --git a/components/style/themes/compact.less b/components/style/themes/compact.less index bcb0aae596..482efbad31 100644 --- a/components/style/themes/compact.less +++ b/components/style/themes/compact.less @@ -59,7 +59,7 @@ @menu-item-height: 32px; @menu-item-vertical-margin: 0px; @menu-item-boundary-margin: 0px; -@menu-item-icon-margin-right: 8px; +@menu-icon-margin-right: 8px; // Checkbox @checkbox-size: 14px; diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 33f8e3a84d..0c6f53bd51 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -515,15 +515,15 @@ @menu-item-active-bg: @primary-1; @menu-item-active-border-width: 3px; @menu-item-group-title-color: @text-color-secondary; -@menu-icon-size: @font-size-base; -@menu-icon-size-lg: @font-size-lg; - @menu-item-vertical-margin: 4px; @menu-item-font-size: @font-size-base; @menu-item-boundary-margin: 8px; @menu-item-padding: 0 20px; @menu-horizontal-line-height: 46px; -@menu-item-icon-margin-right: 10px; +@menu-icon-margin-right: 10px; +@menu-icon-size: @menu-item-font-size; +@menu-icon-size-lg: @font-size-lg; +@menu-item-group-title-font-size: @menu-item-font-size; // dark theme @menu-dark-color: @text-color-secondary-dark; From 4dccbd8eabc703cb7cee34b6726455da622d8b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Mon, 11 May 2020 20:08:46 +0800 Subject: [PATCH 07/19] style: add @modal-close-color (#24053) * :new: Add @modal-close-color close #24050 * update snapshot * fix var name --- .../__snapshots__/components.test.js.snap | 170 +- components/drawer/style/drawer.less | 2 +- .../__snapshots__/index.test.js.snap | 1768 ++++++++--------- .../__snapshots__/Modal.test.js.snap | 68 +- components/modal/style/modal.less | 2 +- components/style/themes/default.less | 1 + 6 files changed, 947 insertions(+), 1064 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index f95b3741ec..b39289c50a 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -13444,24 +13444,22 @@ exports[`ConfigProvider components Modal configProvider 1`] = `
Date: Mon, 11 May 2020 21:04:18 +0800 Subject: [PATCH 08/19] fix: `generate-version` not found (#24059) close #24057 --- package.json | 10 ++++++---- .../{generateColorLess.js => generate-color-less.js} | 0 2 files changed, 6 insertions(+), 4 deletions(-) rename scripts/{generateColorLess.js => generate-color-less.js} (100%) diff --git a/package.json b/package.json index ffa6de80e6..6aa198c42c 100644 --- a/package.json +++ b/package.json @@ -50,9 +50,12 @@ "build": "npm run compile && npm run dist", "bundlesize": "bundlesize", "check-commit": "node ./scripts/check-commit", + "prestart": "npm run version", "precompile": "npm run version", "pretest": "npm run version", "predist": "npm run version", + "presite": "npm run version", + "color-less": "node ./scripts/generate-color-less", "compile": "antd-tools run compile", "changelog": "node ./scripts/print-changelog", "predeploy": "antd-tools run clean && npm run site && cp netlify.toml CNAME _site && cp -r .circleci/ .github/ _site && npm run site:test", @@ -74,13 +77,12 @@ "prettier": "prettier -c --write '**/*'", "pretty-quick": "pretty-quick", "pub": "antd-tools run pub", - "postinstall": "npm run version", "prepublishOnly": "antd-tools run guard", - "site": "cross-env NODE_ICU_DATA=node_modules/full-icu concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\" \"node ./scripts/generateColorLess.js\"", + "site": "cross-env NODE_ICU_DATA=node_modules/full-icu concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\" \"npm run color-less\"", "sort": "npx sort-package-json", "sort-api": "antd-tools run sort-api-table", - "start": "rimraf _site && mkdir _site && cross-env NODE_ENV=development concurrently \"node ./scripts/generateColorLess.js\" \"bisheng start -c ./site/bisheng.config.js\"", - "start:preact": "node ./scripts/generateColorLess.js && cross-env NODE_ENV=development REACT_ENV=preact bisheng start -c ./site/bisheng.config.js", + "start": "antd-tools run clean && cross-env NODE_ENV=development concurrently \"npm run color-less\" \"bisheng start -c ./site/bisheng.config.js\"", + "start:preact": "antd-tools run clean && cross-env NODE_ENV=development REACT_ENV=preact concurrently \"npm run color-less\" \"bisheng start -c ./site/bisheng.config.js\"", "test": "jest --config .jest.js --no-cache", "test:update": "jest --config .jest.js --no-cache --update-snapshot", "test-all": "./scripts/test-all.sh", diff --git a/scripts/generateColorLess.js b/scripts/generate-color-less.js similarity index 100% rename from scripts/generateColorLess.js rename to scripts/generate-color-less.js From 705a6d63a18326087c8bb6962e41ddf98460bf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=A1=E9=91=AB-King?= Date: Mon, 11 May 2020 21:56:17 +0800 Subject: [PATCH 09/19] release: 4.2.2 changelog (#24060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: changelog * chore: version 4.2.2 * docs: changelog * Update CHANGELOG.zh-CN.md Co-authored-by: 偏右 Co-authored-by: 偏右 --- CHANGELOG.en-US.md | 8 ++++++++ CHANGELOG.zh-CN.md | 8 ++++++++ package.json | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index cd3ea66add..9feb5facbd 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,14 @@ timeline: true --- +## 4.2.2 + +`2020-05-11` + +- 🐞 Fix `npm run version` install error. [#24059](https://github.com/ant-design/ant-design/pull/24059) +- 🐞 Fix Menu `@menu-item-font-size` not working. [#24052](https://github.com/ant-design/ant-design/pull/24052) +- 💄 Add `@modal-close-color` less variable. [#24053](https://github.com/ant-design/ant-design/pull/24053) + ## 4.2.1 `2020-05-11` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index bd47660cc7..bcfe08ef36 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,14 @@ timeline: true --- +## 4.2.2 + +`2020-05-11` + +- 🐞 修复安装 antd `npm run version` 报错的问题。[#24059](https://github.com/ant-design/ant-design/pull/24059) +- 🐞 修复 Menu `@menu-item-font-size` 变量失效的问题。[#24052](https://github.com/ant-design/ant-design/pull/24052) +- 💄 新增 `@modal-close-color` less 变量。[#24053](https://github.com/ant-design/ant-design/pull/24053) + ## 4.2.1 `2020-05-11` diff --git a/package.json b/package.json index 6aa198c42c..8928f1f33e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "4.2.1", + "version": "4.2.2", "description": "An enterprise-class UI design language and React components implementation", "keywords": [ "ant", From 40a987e059693d616c03311e83a3511429637b90 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: Mon, 11 May 2020 23:38:54 +0800 Subject: [PATCH 10/19] chore: Fix pub script (#24063) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8928f1f33e..e2aa5e0932 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "pre-publish": "npm run check-commit && npm run test-all", "prettier": "prettier -c --write '**/*'", "pretty-quick": "pretty-quick", - "pub": "antd-tools run pub", + "pub": "npm run version && antd-tools run pub", "prepublishOnly": "antd-tools run guard", "site": "cross-env NODE_ICU_DATA=node_modules/full-icu concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\" \"npm run color-less\"", "sort": "npx sort-package-json", From 9a6ad0edb902e605e33cb50df88d2d8a27944299 Mon Sep 17 00:00:00 2001 From: Kermit Xuan Date: Tue, 12 May 2020 10:34:24 +0800 Subject: [PATCH 11/19] fix(#23019): display defaultValue when no matched options (#24058) --- components/cascader/__tests__/index.test.js | 209 ++++---------------- components/cascader/index.tsx | 8 +- 2 files changed, 38 insertions(+), 179 deletions(-) diff --git a/components/cascader/__tests__/index.test.js b/components/cascader/__tests__/index.test.js index 8e4aab695e..80c562720f 100644 --- a/components/cascader/__tests__/index.test.js +++ b/components/cascader/__tests__/index.test.js @@ -53,14 +53,7 @@ describe('Cascader', () => { it('popup correctly when panel is hidden', () => { const wrapper = mount(); - expect( - render( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ), - ).toMatchSnapshot(); + expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot(); }); it('popup correctly when panel is open', () => { @@ -69,14 +62,7 @@ describe('Cascader', () => { , ); wrapper.find('input').simulate('click'); - expect( - render( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ), - ).toMatchSnapshot(); + expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot(); expect(onPopupVisibleChange).toHaveBeenCalledWith(true); }); @@ -91,97 +77,44 @@ describe('Cascader', () => { it('popup correctly with defaultValue', () => { const wrapper = mount(); wrapper.find('input').simulate('click'); - expect( - render( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ), - ).toMatchSnapshot(); + expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot(); }); it('should support popupVisible', () => { const wrapper = mount(); - expect( - wrapper - .find('Trigger') - .instance() - .getComponent().props.visible, - ).toBe(false); + expect(wrapper.find('Trigger').instance().getComponent().props.visible).toBe(false); wrapper.setProps({ popupVisible: true }); - expect( - wrapper - .find('Trigger') - .instance() - .getComponent().props.visible, - ).toBe(true); + expect(wrapper.find('Trigger').instance().getComponent().props.visible).toBe(true); }); it('can be selected', () => { const onChange = jest.fn(); const wrapper = mount(); wrapper.find('input').simulate('click'); - let popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + let popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); popupWrapper .find('.ant-cascader-menu') .at(0) .find('.ant-cascader-menu-item') .at(0) .simulate('click'); - expect( - render( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ), - ).toMatchSnapshot(); - popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot(); + popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); popupWrapper .find('.ant-cascader-menu') .at(1) .find('.ant-cascader-menu-item') .at(0) .simulate('click'); - expect( - render( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ), - ).toMatchSnapshot(); - popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot(); + popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); popupWrapper .find('.ant-cascader-menu') .at(2) .find('.ant-cascader-menu-item') .at(0) .simulate('click'); - expect( - render( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ), - ).toMatchSnapshot(); + expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot(); expect(onChange).toHaveBeenCalledWith(['zhejiang', 'hangzhou', 'xihu'], expect.anything()); }); @@ -199,12 +132,7 @@ describe('Cascader', () => { wrapper.find('input').simulate('click'); wrapper.find('input').simulate('change', { target: { value: 'z' } }); expect(wrapper.state('inputValue')).toBe('z'); - const popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); expect(popupWrapper).toMatchSnapshot(); }); @@ -245,12 +173,7 @@ describe('Cascader', () => { wrapper.find('input').simulate('click'); wrapper.find('input').simulate('change', { target: { value: 'z' } }); expect(wrapper.state('inputValue')).toBe('z'); - const popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); expect(popupWrapper.render()).toMatchSnapshot(); }); @@ -259,22 +182,14 @@ describe('Cascader', () => { wrapper.find('input').simulate('click'); wrapper.find('input').simulate('change', { target: { value: '__notfoundkeyword__' } }); expect(wrapper.state('inputValue')).toBe('__notfoundkeyword__'); - const popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); expect(popupWrapper).toMatchSnapshot(); }); it('should support to clear selection', () => { const wrapper = mount(); expect(wrapper.find('.ant-cascader-picker-label').text()).toBe('Zhejiang / Hangzhou'); - wrapper - .find('.ant-cascader-picker-clear') - .at(0) - .simulate('click'); + wrapper.find('.ant-cascader-picker-clear').at(0).simulate('click'); expect(wrapper.find('.ant-cascader-picker-label').text()).toBe(''); }); @@ -288,10 +203,7 @@ describe('Cascader', () => { onPopupVisibleChange={onPopupVisibleChange} />, ); - wrapper - .find('.ant-cascader-picker-clear') - .at(0) - .simulate('click'); + wrapper.find('.ant-cascader-picker-clear').at(0).simulate('click'); expect(onPopupVisibleChange).toHaveBeenCalledWith(false); }); @@ -302,10 +214,7 @@ describe('Cascader', () => { wrapper.find('input').simulate('click'); wrapper.find('input').simulate('change', { target: { value: 'xxx' } }); expect(wrapper.state('inputValue')).toBe('xxx'); - wrapper - .find('.ant-cascader-picker-clear') - .at(0) - .simulate('click'); + wrapper.find('.ant-cascader-picker-clear').at(0).simulate('click'); expect(wrapper.state('inputValue')).toBe(''); }); @@ -393,24 +302,14 @@ describe('Cascader', () => { />, ); wrapper.instance().handleChange(['zhejiang', 'hangzhou', 'xihu'], customerOptions); - expect( - wrapper - .find('.ant-cascader-picker-label') - .text() - .split('/').length, - ).toBe(3); + expect(wrapper.find('.ant-cascader-picker-label').text().split('/').length).toBe(3); }); it('should show not found content when options.length is 0', () => { const customerOptions = []; const wrapper = mount(); wrapper.find('input').simulate('click'); - const popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); expect(popupWrapper).toMatchSnapshot(); }); @@ -484,12 +383,7 @@ describe('Cascader', () => { fieldNames={{ label: 'name', value: 'code', children: 'items' }} />, ); - const popupWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); expect(popupWrapper.render()).toMatchSnapshot(); }); @@ -510,18 +404,9 @@ describe('Cascader', () => { , ); - wrapper - .find('Cascader') - .find('input') - .simulate('click'); + wrapper.find('Cascader').find('input').simulate('click'); expect( - render( - wrapper - .find('Cascader') - .find('Trigger') - .instance() - .getComponent(), - ), + render(wrapper.find('Cascader').find('Trigger').instance().getComponent()), ).toMatchSnapshot(); }); @@ -572,17 +457,8 @@ describe('Cascader', () => { , ); - wrapper - .find('Cascader') - .find('input') - .simulate('click'); - let popupWrapper = mount( - wrapper - .find('Cascader') - .find('Trigger') - .instance() - .getComponent(), - ); + wrapper.find('Cascader').find('input').simulate('click'); + let popupWrapper = mount(wrapper.find('Cascader').find('Trigger').instance().getComponent()); popupWrapper .find('.ant-cascader-menu') .at(0) @@ -590,21 +466,9 @@ describe('Cascader', () => { .at(0) .simulate('click'); expect( - render( - wrapper - .find('Cascader') - .find('Trigger') - .instance() - .getComponent(), - ), + render(wrapper.find('Cascader').find('Trigger').instance().getComponent()), ).toMatchSnapshot(); - popupWrapper = mount( - wrapper - .find('Cascader') - .find('Trigger') - .instance() - .getComponent(), - ); + popupWrapper = mount(wrapper.find('Cascader').find('Trigger').instance().getComponent()); popupWrapper .find('.ant-cascader-menu') .at(1) @@ -612,21 +476,9 @@ describe('Cascader', () => { .at(0) .simulate('click'); expect( - render( - wrapper - .find('Cascader') - .find('Trigger') - .instance() - .getComponent(), - ), + render(wrapper.find('Cascader').find('Trigger').instance().getComponent()), ).toMatchSnapshot(); - popupWrapper = mount( - wrapper - .find('Cascader') - .find('Trigger') - .instance() - .getComponent(), - ); + popupWrapper = mount(wrapper.find('Cascader').find('Trigger').instance().getComponent()); popupWrapper .find('.ant-cascader-menu') .at(2) @@ -635,4 +487,9 @@ describe('Cascader', () => { .simulate('click'); expect(onChange).toHaveBeenCalledWith(['zhejiang', 'hangzhou', 'xihu'], expect.anything()); }); + + it('defaultValue works correctly when no match options', () => { + const wrapper = mount(); + expect(wrapper.find('.ant-cascader-picker-label').text()).toBe('options1 / options2'); + }); }); diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 8fe32ef987..36cf59d478 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -283,7 +283,7 @@ class Cascader extends React.Component { (o: CascaderOptionType, level: number) => o[names.value] === unwrappedValue[level], { childrenKeyName: names.children }, ); - const label = selectedOptions.map(o => o[names.label]); + const label = selectedOptions.length ? selectedOptions.map(o => o[names.label]) : value; return displayRender(label, selectedOptions); } @@ -522,8 +522,10 @@ class Cascader extends React.Component { const names: FilledFieldNamesType = getFilledFieldNames(this.props); if (options && options.length > 0) { if (state.inputValue) { - const filteredOptions = this.generateFilteredOptions(prefixCls, renderEmpty); - options = isEqual(filteredOptions, this.cachedOptions) ? this.cachedOptions : filteredOptions; + const filteredOptions = this.generateFilteredOptions(prefixCls, renderEmpty); + options = isEqual(filteredOptions, this.cachedOptions) + ? this.cachedOptions + : filteredOptions; } } else { options = [ From ce36d3e2fe1bb0444c57def7d1512a74d4f262a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Tue, 12 May 2020 11:00:47 +0800 Subject: [PATCH 12/19] :up: upgrade react-slick to 0.26.1 (#24067) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2aa5e0932..268aef0569 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "dependencies": { "@ant-design/css-animation": "^1.7.2", "@ant-design/icons": "^4.1.0", - "@ant-design/react-slick": "~0.25.5", + "@ant-design/react-slick": "~0.26.1", "array-tree-filter": "^2.1.0", "classnames": "~2.2.6", "copy-to-clipboard": "^3.2.0", From fdcbfc909d63766155bd351ee4733c15b6045b22 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 12 May 2020 14:57:05 +0800 Subject: [PATCH 13/19] :white_check_mark: fix snapshot close #24070 --- .../__tests__/__snapshots__/demo.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 10 + .../__snapshots__/index.test.js.snap | 4 + .../__tests__/__snapshots__/demo.test.js.snap | 1 + .../__snapshots__/components.test.js.snap | 35 +++ .../__tests__/__snapshots__/demo.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 9 + .../__tests__/__snapshots__/demo.test.js.snap | 11 + .../__snapshots__/pagination.test.js.snap | 3 + .../__snapshots__/index.test.js.snap | 208 ++++++++++++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 10 + .../__tests__/__snapshots__/demo.test.js.snap | 25 +++ .../__snapshots__/index.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 4 + .../__tests__/__snapshots__/demo.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 6 + .../__snapshots__/index.test.js.snap | 3 + 17 files changed, 343 insertions(+) diff --git a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap index e22b332f31..ef8e3a3ce5 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap @@ -256,6 +256,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -341,6 +342,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -534,6 +536,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -675,6 +678,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -817,6 +821,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/calendar/__tests__/__snapshots__/demo.test.js.snap b/components/calendar/__tests__/__snapshots__/demo.test.js.snap index 590c7d3158..a2d2415930 100644 --- a/components/calendar/__tests__/__snapshots__/demo.test.js.snap +++ b/components/calendar/__tests__/__snapshots__/demo.test.js.snap @@ -27,6 +27,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -84,6 +85,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -968,6 +970,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1025,6 +1028,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1971,6 +1975,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] = readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2033,6 +2038,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] = readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2874,6 +2880,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2931,6 +2938,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -4223,6 +4231,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -4280,6 +4289,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/calendar/__tests__/__snapshots__/index.test.js.snap b/components/calendar/__tests__/__snapshots__/index.test.js.snap index 98a0e1071d..9d18c79f65 100644 --- a/components/calendar/__tests__/__snapshots__/index.test.js.snap +++ b/components/calendar/__tests__/__snapshots__/index.test.js.snap @@ -28,6 +28,7 @@ exports[`Calendar Calendar should support locale 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -86,6 +87,7 @@ exports[`Calendar Calendar should support locale 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -967,6 +969,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1024,6 +1027,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/collapse/__tests__/__snapshots__/demo.test.js.snap b/components/collapse/__tests__/__snapshots__/demo.test.js.snap index b5d3cbfe11..3a4f935c22 100644 --- a/components/collapse/__tests__/__snapshots__/demo.test.js.snap +++ b/components/collapse/__tests__/__snapshots__/demo.test.js.snap @@ -677,6 +677,7 @@ exports[`renders ./components/collapse/demo/extra.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index b39289c50a..ed80761ebb 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -1788,6 +1788,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1845,6 +1846,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2723,6 +2725,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -3067,6 +3070,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize large 1 readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -3124,6 +3128,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize large 1 readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -4002,6 +4007,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize large 1 readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -4346,6 +4352,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize middle readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -4403,6 +4410,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize middle readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -5281,6 +5289,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize middle readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -5625,6 +5634,7 @@ exports[`ConfigProvider components Calendar normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -5682,6 +5692,7 @@ exports[`ConfigProvider components Calendar normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -6560,6 +6571,7 @@ exports[`ConfigProvider components Calendar normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -6904,6 +6916,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -6961,6 +6974,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -7839,6 +7853,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14060,6 +14075,7 @@ exports[`ConfigProvider components Pagination configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14206,6 +14222,7 @@ exports[`ConfigProvider components Pagination configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14357,6 +14374,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize large readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14503,6 +14521,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize large readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14654,6 +14673,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14800,6 +14820,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -14951,6 +14972,7 @@ exports[`ConfigProvider components Pagination normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -15097,6 +15119,7 @@ exports[`ConfigProvider components Pagination normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -15248,6 +15271,7 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -15394,6 +15418,7 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -17952,6 +17977,7 @@ exports[`ConfigProvider components Select configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -18071,6 +18097,7 @@ exports[`ConfigProvider components Select configProvider componentSize large 1`] readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -18190,6 +18217,7 @@ exports[`ConfigProvider components Select configProvider componentSize middle 1` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -18309,6 +18337,7 @@ exports[`ConfigProvider components Select normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -18428,6 +18457,7 @@ exports[`ConfigProvider components Select prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -30497,6 +30527,7 @@ exports[`ConfigProvider components TreeSelect configProvider 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -30609,6 +30640,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize large readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -30721,6 +30753,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize middl readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -30833,6 +30866,7 @@ exports[`ConfigProvider components TreeSelect normal 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -30945,6 +30979,7 @@ exports[`ConfigProvider components TreeSelect prefixCls 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/empty/__tests__/__snapshots__/demo.test.js.snap b/components/empty/__tests__/__snapshots__/demo.test.js.snap index e183cf1556..4bd2fdf231 100644 --- a/components/empty/__tests__/__snapshots__/demo.test.js.snap +++ b/components/empty/__tests__/__snapshots__/demo.test.js.snap @@ -120,6 +120,7 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -179,6 +180,7 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index a14e8e87b7..c422927cbd 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -554,6 +554,7 @@ exports[`renders ./components/form/demo/control-hooks.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -720,6 +721,7 @@ exports[`renders ./components/form/demo/control-ref.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -860,6 +862,7 @@ exports[`renders ./components/form/demo/customized-form-controls.md correctly 1` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2480,6 +2483,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2882,6 +2886,7 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2963,6 +2968,7 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -3906,6 +3912,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -3992,6 +3999,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 0b6d6ec709..c5d4bb567a 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -61,6 +61,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -127,6 +128,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -529,6 +531,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -587,6 +590,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1122,6 +1126,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1236,6 +1241,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1523,6 +1529,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1580,6 +1587,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1642,6 +1650,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1727,6 +1736,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1819,6 +1829,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/list/__tests__/__snapshots__/pagination.test.js.snap b/components/list/__tests__/__snapshots__/pagination.test.js.snap index c35de07f34..243e57dd7e 100644 --- a/components/list/__tests__/__snapshots__/pagination.test.js.snap +++ b/components/list/__tests__/__snapshots__/pagination.test.js.snap @@ -218,6 +218,7 @@ exports[`List.pagination should change page size work 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -360,6 +361,7 @@ exports[`List.pagination should change page size work 2`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -630,6 +632,7 @@ exports[`List.pagination should default work 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index 8a0c97819b..692c4eaad6 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -2003,6 +2003,7 @@ exports[`Locale Provider should display the text as ar 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -2064,6 +2065,7 @@ exports[`Locale Provider should display the text as ar 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -5689,6 +5691,7 @@ exports[`Locale Provider should display the text as ar 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -5747,6 +5750,7 @@ exports[`Locale Provider should display the text as ar 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -6982,6 +6986,7 @@ exports[`Locale Provider should display the text as az 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -7043,6 +7048,7 @@ exports[`Locale Provider should display the text as az 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -10668,6 +10674,7 @@ exports[`Locale Provider should display the text as az 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -10726,6 +10733,7 @@ exports[`Locale Provider should display the text as az 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -11961,6 +11969,7 @@ exports[`Locale Provider should display the text as bg 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -12022,6 +12031,7 @@ exports[`Locale Provider should display the text as bg 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -15647,6 +15657,7 @@ exports[`Locale Provider should display the text as bg 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -15705,6 +15716,7 @@ exports[`Locale Provider should display the text as bg 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -16940,6 +16952,7 @@ exports[`Locale Provider should display the text as ca 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -17001,6 +17014,7 @@ exports[`Locale Provider should display the text as ca 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -20626,6 +20640,7 @@ exports[`Locale Provider should display the text as ca 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -20684,6 +20699,7 @@ exports[`Locale Provider should display the text as ca 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -21919,6 +21935,7 @@ exports[`Locale Provider should display the text as cs 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -21980,6 +21997,7 @@ exports[`Locale Provider should display the text as cs 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -25605,6 +25623,7 @@ exports[`Locale Provider should display the text as cs 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -25663,6 +25682,7 @@ exports[`Locale Provider should display the text as cs 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -26898,6 +26918,7 @@ exports[`Locale Provider should display the text as da 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -26959,6 +26980,7 @@ exports[`Locale Provider should display the text as da 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -30584,6 +30606,7 @@ exports[`Locale Provider should display the text as da 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -30642,6 +30665,7 @@ exports[`Locale Provider should display the text as da 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -31877,6 +31901,7 @@ exports[`Locale Provider should display the text as de 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -31938,6 +31963,7 @@ exports[`Locale Provider should display the text as de 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -35563,6 +35589,7 @@ exports[`Locale Provider should display the text as de 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -35621,6 +35648,7 @@ exports[`Locale Provider should display the text as de 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -36856,6 +36884,7 @@ exports[`Locale Provider should display the text as el 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -36917,6 +36946,7 @@ exports[`Locale Provider should display the text as el 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -40542,6 +40572,7 @@ exports[`Locale Provider should display the text as el 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -40600,6 +40631,7 @@ exports[`Locale Provider should display the text as el 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -41835,6 +41867,7 @@ exports[`Locale Provider should display the text as en 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -41896,6 +41929,7 @@ exports[`Locale Provider should display the text as en 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -45521,6 +45555,7 @@ exports[`Locale Provider should display the text as en 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -45579,6 +45614,7 @@ exports[`Locale Provider should display the text as en 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -46814,6 +46850,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -46875,6 +46912,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -50500,6 +50538,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -50558,6 +50597,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -51793,6 +51833,7 @@ exports[`Locale Provider should display the text as es 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -51854,6 +51895,7 @@ exports[`Locale Provider should display the text as es 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -55479,6 +55521,7 @@ exports[`Locale Provider should display the text as es 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -55537,6 +55580,7 @@ exports[`Locale Provider should display the text as es 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -56772,6 +56816,7 @@ exports[`Locale Provider should display the text as et 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -56833,6 +56878,7 @@ exports[`Locale Provider should display the text as et 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -60458,6 +60504,7 @@ exports[`Locale Provider should display the text as et 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -60516,6 +60563,7 @@ exports[`Locale Provider should display the text as et 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -61751,6 +61799,7 @@ exports[`Locale Provider should display the text as fa 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -61812,6 +61861,7 @@ exports[`Locale Provider should display the text as fa 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -65437,6 +65487,7 @@ exports[`Locale Provider should display the text as fa 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -65495,6 +65546,7 @@ exports[`Locale Provider should display the text as fa 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -66730,6 +66782,7 @@ exports[`Locale Provider should display the text as fi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -66791,6 +66844,7 @@ exports[`Locale Provider should display the text as fi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -70416,6 +70470,7 @@ exports[`Locale Provider should display the text as fi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -70474,6 +70529,7 @@ exports[`Locale Provider should display the text as fi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -71709,6 +71765,7 @@ exports[`Locale Provider should display the text as fr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -71770,6 +71827,7 @@ exports[`Locale Provider should display the text as fr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -75395,6 +75453,7 @@ exports[`Locale Provider should display the text as fr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -75453,6 +75512,7 @@ exports[`Locale Provider should display the text as fr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -76688,6 +76748,7 @@ exports[`Locale Provider should display the text as fr 2`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -76749,6 +76810,7 @@ exports[`Locale Provider should display the text as fr 2`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -80374,6 +80436,7 @@ exports[`Locale Provider should display the text as fr 2`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -80432,6 +80495,7 @@ exports[`Locale Provider should display the text as fr 2`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -81667,6 +81731,7 @@ exports[`Locale Provider should display the text as he 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -81728,6 +81793,7 @@ exports[`Locale Provider should display the text as he 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -85353,6 +85419,7 @@ exports[`Locale Provider should display the text as he 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -85411,6 +85478,7 @@ exports[`Locale Provider should display the text as he 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -86646,6 +86714,7 @@ exports[`Locale Provider should display the text as hi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -86707,6 +86776,7 @@ exports[`Locale Provider should display the text as hi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -90332,6 +90402,7 @@ exports[`Locale Provider should display the text as hi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -90390,6 +90461,7 @@ exports[`Locale Provider should display the text as hi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -91625,6 +91697,7 @@ exports[`Locale Provider should display the text as hr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -91686,6 +91759,7 @@ exports[`Locale Provider should display the text as hr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -95311,6 +95385,7 @@ exports[`Locale Provider should display the text as hr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -95369,6 +95444,7 @@ exports[`Locale Provider should display the text as hr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -96604,6 +96680,7 @@ exports[`Locale Provider should display the text as hu 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -96665,6 +96742,7 @@ exports[`Locale Provider should display the text as hu 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -100290,6 +100368,7 @@ exports[`Locale Provider should display the text as hu 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -100348,6 +100427,7 @@ exports[`Locale Provider should display the text as hu 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -101583,6 +101663,7 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -101644,6 +101725,7 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -105269,6 +105351,7 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -105327,6 +105410,7 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -106562,6 +106646,7 @@ exports[`Locale Provider should display the text as id 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -106623,6 +106708,7 @@ exports[`Locale Provider should display the text as id 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -110248,6 +110334,7 @@ exports[`Locale Provider should display the text as id 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -110306,6 +110393,7 @@ exports[`Locale Provider should display the text as id 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -111541,6 +111629,7 @@ exports[`Locale Provider should display the text as is 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -111602,6 +111691,7 @@ exports[`Locale Provider should display the text as is 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -115227,6 +115317,7 @@ exports[`Locale Provider should display the text as is 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -115285,6 +115376,7 @@ exports[`Locale Provider should display the text as is 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -116520,6 +116612,7 @@ exports[`Locale Provider should display the text as it 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -116581,6 +116674,7 @@ exports[`Locale Provider should display the text as it 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -120206,6 +120300,7 @@ exports[`Locale Provider should display the text as it 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -120264,6 +120359,7 @@ exports[`Locale Provider should display the text as it 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -121499,6 +121595,7 @@ exports[`Locale Provider should display the text as ja 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -121560,6 +121657,7 @@ exports[`Locale Provider should display the text as ja 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -125185,6 +125283,7 @@ exports[`Locale Provider should display the text as ja 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -125243,6 +125342,7 @@ exports[`Locale Provider should display the text as ja 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -126478,6 +126578,7 @@ exports[`Locale Provider should display the text as kn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -126539,6 +126640,7 @@ exports[`Locale Provider should display the text as kn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -130164,6 +130266,7 @@ exports[`Locale Provider should display the text as kn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -130222,6 +130325,7 @@ exports[`Locale Provider should display the text as kn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -131457,6 +131561,7 @@ exports[`Locale Provider should display the text as ko 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -131518,6 +131623,7 @@ exports[`Locale Provider should display the text as ko 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -135143,6 +135249,7 @@ exports[`Locale Provider should display the text as ko 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -135201,6 +135308,7 @@ exports[`Locale Provider should display the text as ko 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -136436,6 +136544,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -136497,6 +136606,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -140122,6 +140232,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -140180,6 +140291,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -141415,6 +141527,7 @@ exports[`Locale Provider should display the text as lv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -141476,6 +141589,7 @@ exports[`Locale Provider should display the text as lv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -145101,6 +145215,7 @@ exports[`Locale Provider should display the text as lv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -145159,6 +145274,7 @@ exports[`Locale Provider should display the text as lv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -146394,6 +146510,7 @@ exports[`Locale Provider should display the text as mk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -146455,6 +146572,7 @@ exports[`Locale Provider should display the text as mk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -150080,6 +150198,7 @@ exports[`Locale Provider should display the text as mk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -150138,6 +150257,7 @@ exports[`Locale Provider should display the text as mk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -151373,6 +151493,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -151434,6 +151555,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -155059,6 +155181,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -155117,6 +155240,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -156352,6 +156476,7 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -156413,6 +156538,7 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -160038,6 +160164,7 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -160096,6 +160223,7 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -161331,6 +161459,7 @@ exports[`Locale Provider should display the text as nb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -161392,6 +161521,7 @@ exports[`Locale Provider should display the text as nb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -165017,6 +165147,7 @@ exports[`Locale Provider should display the text as nb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -165075,6 +165206,7 @@ exports[`Locale Provider should display the text as nb 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -166310,6 +166442,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -166371,6 +166504,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -169996,6 +170130,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -170054,6 +170189,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -171289,6 +171425,7 @@ exports[`Locale Provider should display the text as nl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -171350,6 +171487,7 @@ exports[`Locale Provider should display the text as nl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -174975,6 +175113,7 @@ exports[`Locale Provider should display the text as nl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -175033,6 +175172,7 @@ exports[`Locale Provider should display the text as nl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -176268,6 +176408,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -176329,6 +176470,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -179954,6 +180096,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -180012,6 +180155,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -181247,6 +181391,7 @@ exports[`Locale Provider should display the text as pl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -181308,6 +181453,7 @@ exports[`Locale Provider should display the text as pl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -184933,6 +185079,7 @@ exports[`Locale Provider should display the text as pl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -184991,6 +185138,7 @@ exports[`Locale Provider should display the text as pl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -186226,6 +186374,7 @@ exports[`Locale Provider should display the text as pt 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -186287,6 +186436,7 @@ exports[`Locale Provider should display the text as pt 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -189912,6 +190062,7 @@ exports[`Locale Provider should display the text as pt 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -189970,6 +190121,7 @@ exports[`Locale Provider should display the text as pt 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -191205,6 +191357,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -191266,6 +191419,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -194891,6 +195045,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -194949,6 +195104,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -196184,6 +196340,7 @@ exports[`Locale Provider should display the text as ro 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -196245,6 +196402,7 @@ exports[`Locale Provider should display the text as ro 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -199870,6 +200028,7 @@ exports[`Locale Provider should display the text as ro 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -199928,6 +200087,7 @@ exports[`Locale Provider should display the text as ro 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -201163,6 +201323,7 @@ exports[`Locale Provider should display the text as ru 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -201224,6 +201385,7 @@ exports[`Locale Provider should display the text as ru 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -204849,6 +205011,7 @@ exports[`Locale Provider should display the text as ru 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -204907,6 +205070,7 @@ exports[`Locale Provider should display the text as ru 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -206142,6 +206306,7 @@ exports[`Locale Provider should display the text as sk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -206203,6 +206368,7 @@ exports[`Locale Provider should display the text as sk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -209828,6 +209994,7 @@ exports[`Locale Provider should display the text as sk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -209886,6 +210053,7 @@ exports[`Locale Provider should display the text as sk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -211121,6 +211289,7 @@ exports[`Locale Provider should display the text as sl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -211182,6 +211351,7 @@ exports[`Locale Provider should display the text as sl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -214807,6 +214977,7 @@ exports[`Locale Provider should display the text as sl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -214865,6 +215036,7 @@ exports[`Locale Provider should display the text as sl 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -216100,6 +216272,7 @@ exports[`Locale Provider should display the text as sr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -216161,6 +216334,7 @@ exports[`Locale Provider should display the text as sr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -219786,6 +219960,7 @@ exports[`Locale Provider should display the text as sr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -219844,6 +220019,7 @@ exports[`Locale Provider should display the text as sr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -221079,6 +221255,7 @@ exports[`Locale Provider should display the text as sv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -221140,6 +221317,7 @@ exports[`Locale Provider should display the text as sv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -224765,6 +224943,7 @@ exports[`Locale Provider should display the text as sv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -224823,6 +225002,7 @@ exports[`Locale Provider should display the text as sv 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -226058,6 +226238,7 @@ exports[`Locale Provider should display the text as ta 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -226119,6 +226300,7 @@ exports[`Locale Provider should display the text as ta 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -229744,6 +229926,7 @@ exports[`Locale Provider should display the text as ta 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -229802,6 +229985,7 @@ exports[`Locale Provider should display the text as ta 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -231037,6 +231221,7 @@ exports[`Locale Provider should display the text as th 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -231098,6 +231283,7 @@ exports[`Locale Provider should display the text as th 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -234723,6 +234909,7 @@ exports[`Locale Provider should display the text as th 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -234781,6 +234968,7 @@ exports[`Locale Provider should display the text as th 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -236016,6 +236204,7 @@ exports[`Locale Provider should display the text as tr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -236077,6 +236266,7 @@ exports[`Locale Provider should display the text as tr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -239702,6 +239892,7 @@ exports[`Locale Provider should display the text as tr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -239760,6 +239951,7 @@ exports[`Locale Provider should display the text as tr 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -240995,6 +241187,7 @@ exports[`Locale Provider should display the text as uk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -241056,6 +241249,7 @@ exports[`Locale Provider should display the text as uk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -244681,6 +244875,7 @@ exports[`Locale Provider should display the text as uk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -244739,6 +244934,7 @@ exports[`Locale Provider should display the text as uk 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -245974,6 +246170,7 @@ exports[`Locale Provider should display the text as vi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -246035,6 +246232,7 @@ exports[`Locale Provider should display the text as vi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -249660,6 +249858,7 @@ exports[`Locale Provider should display the text as vi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -249718,6 +249917,7 @@ exports[`Locale Provider should display the text as vi 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -250953,6 +251153,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -251014,6 +251215,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -254639,6 +254841,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -254697,6 +254900,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -255932,6 +256136,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -255993,6 +256198,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -259618,6 +259824,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -259676,6 +259883,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> diff --git a/components/pagination/__tests__/__snapshots__/demo.test.js.snap b/components/pagination/__tests__/__snapshots__/demo.test.js.snap index 280756355a..3b0550645c 100644 --- a/components/pagination/__tests__/__snapshots__/demo.test.js.snap +++ b/components/pagination/__tests__/__snapshots__/demo.test.js.snap @@ -189,6 +189,7 @@ exports[`renders ./components/pagination/demo/all.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -539,6 +540,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -763,6 +765,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1062,6 +1065,7 @@ exports[`renders ./components/pagination/demo/itemRender.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1287,6 +1291,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1520,6 +1525,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1820,6 +1826,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2219,6 +2226,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2486,6 +2494,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2665,6 +2674,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index b4cdd73827..dc50b4fea7 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -60,6 +60,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -120,6 +121,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -178,6 +180,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -236,6 +239,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -382,6 +386,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -493,6 +499,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -556,6 +563,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -614,6 +622,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -676,6 +685,7 @@ exports[`renders ./components/select/demo/custom-dropdown-menu.md correctly 1`] readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -796,6 +806,7 @@ exports[`renders ./components/select/demo/custom-tag-render.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -935,6 +947,7 @@ exports[`renders ./components/select/demo/debug.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1159,6 +1174,7 @@ exports[`renders ./components/select/demo/multiple.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1292,6 +1309,7 @@ exports[`renders ./components/select/demo/option-label-prop.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1388,6 +1407,7 @@ exports[`renders ./components/select/demo/search-box.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1423,6 +1443,7 @@ exports[`renders ./components/select/demo/select-users.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1660,6 +1682,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1861,6 +1885,7 @@ Array [ readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/select/__tests__/__snapshots__/index.test.js.snap b/components/select/__tests__/__snapshots__/index.test.js.snap index 4dade6482a..9760bab680 100644 --- a/components/select/__tests__/__snapshots__/index.test.js.snap +++ b/components/select/__tests__/__snapshots__/index.test.js.snap @@ -23,6 +23,7 @@ exports[`Select Select Custom Icons should support customized icons 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -81,6 +82,7 @@ exports[`Select rtl render component should be rendered correctly in RTL directi readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index e609b0afef..703f593e3c 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -4322,6 +4322,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -6573,6 +6574,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -7809,6 +7811,7 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -8780,6 +8783,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/tabs/__tests__/__snapshots__/demo.test.js.snap b/components/tabs/__tests__/__snapshots__/demo.test.js.snap index 35079c3f76..60004ecd3f 100644 --- a/components/tabs/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tabs/__tests__/__snapshots__/demo.test.js.snap @@ -1729,6 +1729,7 @@ exports[`renders ./components/tabs/demo/nest.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1785,6 +1786,7 @@ exports[`renders ./components/tabs/demo/nest.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1841,6 +1843,7 @@ exports[`renders ./components/tabs/demo/nest.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -1897,6 +1900,7 @@ exports[`renders ./components/tabs/demo/nest.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -2558,6 +2562,7 @@ exports[`renders ./components/tabs/demo/position.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/tree-select/__tests__/__snapshots__/demo.test.js.snap b/components/tree-select/__tests__/__snapshots__/demo.test.js.snap index 6b5b53f7c4..d2c8e793b4 100644 --- a/components/tree-select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tree-select/__tests__/__snapshots__/demo.test.js.snap @@ -22,6 +22,7 @@ exports[`renders ./components/tree-select/demo/async.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -83,6 +84,7 @@ exports[`renders ./components/tree-select/demo/basic.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -181,6 +183,7 @@ exports[`renders ./components/tree-select/demo/checkable.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> @@ -319,6 +324,7 @@ exports[`renders ./components/tree-select/demo/treeData.md correctly 1`] = ` readonly="" role="combobox" style="opacity:0" + unselectable="on" value="" /> diff --git a/components/tree-select/__tests__/__snapshots__/index.test.js.snap b/components/tree-select/__tests__/__snapshots__/index.test.js.snap index c9679b47fd..18166269a4 100644 --- a/components/tree-select/__tests__/__snapshots__/index.test.js.snap +++ b/components/tree-select/__tests__/__snapshots__/index.test.js.snap @@ -23,6 +23,7 @@ exports[`TreeSelect TreeSelect Custom Icons should \`treeIcon\` work 1`] = ` readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> @@ -181,6 +182,7 @@ exports[`TreeSelect TreeSelect Custom Icons should support customized icons 1`] readonly="" role="combobox" style="opacity: 0;" + unselectable="on" value="" /> From 49f5ed7764404118ae6336861f40296bbba047f9 Mon Sep 17 00:00:00 2001 From: wx1322 <289758716@qq.com> Date: Tue, 12 May 2020 15:00:24 +0800 Subject: [PATCH 14/19] feat: Adds zh_TW localisations for Form (#24065) * Update zh_TW.tsx * Remove spaces * Update zh_TW.tsx * Update snapshot * replace indexOf() with || --- .../locale-provider/__tests__/index.test.js | 2 +- components/locale/zh_TW.tsx | 85 +++++++++++++++++-- 2 files changed, 79 insertions(+), 8 deletions(-) diff --git a/components/locale-provider/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index e038c6e29e..a604f764cc 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -220,7 +220,7 @@ describe('Locale Provider', () => { '.ant-btn:not(.ant-btn-primary) span', )[0].innerHTML; let okButtonText = currentConfirmNode.querySelectorAll('.ant-btn-primary span')[0].innerHTML; - if (locale.locale === 'zh-cn') { + if (locale.locale.indexOf('zh-') === 0) { cancelButtonText = cancelButtonText.replace(' ', ''); okButtonText = okButtonText.replace(' ', ''); } diff --git a/components/locale/zh_TW.tsx b/components/locale/zh_TW.tsx index 2c756cb0fb..fd677b69a7 100644 --- a/components/locale/zh_TW.tsx +++ b/components/locale/zh_TW.tsx @@ -1,30 +1,43 @@ +/* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/zh_TW'; import DatePicker from '../date-picker/locale/zh_TW'; import TimePicker from '../time-picker/locale/zh_TW'; import Calendar from '../calendar/locale/zh_TW'; import { Locale } from '../locale-provider'; +const typeTemplate = '${label}不是一個有效的${type}'; + const localeValues: Locale = { locale: 'zh-tw', Pagination, DatePicker, TimePicker, Calendar, + global: { + placeholder: '請選擇', + }, Table: { filterTitle: '篩選器', - filterConfirm: '確 定', - filterReset: '重 置', + filterConfirm: '確定', + filterReset: '重置', selectAll: '全部選取', selectInvert: '反向選取', + selectionAll: '全選所有', + sortTitle: '排序', + expand: '展開行', + collapse: '關閉行', + triggerDesc: '點擊降序', + triggerAsc: '點擊升序', + cancelSort: '取消排序', }, Modal: { - okText: '確 定', - cancelText: '取 消', - justOkText: 'OK', + okText: '確定', + cancelText: '取消', + justOkText: '知道了', }, Popconfirm: { - okText: '確 定', - cancelText: '取 消', + okText: '確定', + cancelText: '取消', }, Transfer: { searchPlaceholder: '搜尋資料', @@ -41,9 +54,67 @@ const localeValues: Locale = { Empty: { description: '無此資料', }, + Icon: { + icon: '圖標', + }, + Text: { + edit: '編輯', + copy: '複製', + copied: '複製成功', + expand: '展開', + }, PageHeader: { back: '返回', }, + Form: { + defaultValidateMessages: { + default: '字段驗證錯誤${label}', + required: '請輸入${label}', + enum: '${label}必須是其中一個[${enum}]', + whitespace: '${label}不能為空字符', + date: { + format: '${label}日期格式無效', + parse: '${label}不能轉換為日期', + invalid: '${label}是一個無效日期', + }, + types: { + string: typeTemplate, + method: typeTemplate, + array: typeTemplate, + object: typeTemplate, + number: typeTemplate, + date: typeTemplate, + boolean: typeTemplate, + integer: typeTemplate, + float: typeTemplate, + regexp: typeTemplate, + email: typeTemplate, + url: typeTemplate, + hex: typeTemplate, + }, + string: { + len: '${label}須為${len}個字符', + min: '${label}最少${min}個字符', + max: '${label}最多${max}個字符', + range: '${label}須在${min}-${max}字符之間', + }, + number: { + len: '${label}必須等於${len}', + min: '${label}最小值為${min}', + max: '${label}最大值為${max}', + range: '${label}須在${min}-${max}之間', + }, + array: { + len: '須為${len}個${label}', + min: '最少${min}個${label}', + max: '最多${max}個${label}', + range: '${label}數量須在${min}-${max}之間', + }, + pattern: { + mismatch: '${label}與模式不匹配${pattern}', + }, + }, + }, }; export default localeValues; From 82d709676a1f3d768112c6ac2f50950caaa97935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Tue, 12 May 2020 17:39:59 +0800 Subject: [PATCH 15/19] fix: Drawer height bug (#24082) * :bug: Fix Drawer height bug close #24074 * :white_check_mark: fix snapshot --- components/drawer/index.tsx | 35 ++++++++++++++++++++--------- components/drawer/style/drawer.less | 17 +++----------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 4357a58124..a4fd42226e 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -136,12 +136,27 @@ class Drawer extends React.Component { - const { zIndex, placement, style } = this.props; + const { zIndex, placement, mask, style } = this.props; const { push } = this.state; + // 当无 mask 时,将 width 应用到外层容器上 + // 解决 https://github.com/ant-design/ant-design/issues/12401 的问题 + const offsetStyle = mask ? {} : this.getOffsetStyle(); return { zIndex, transform: push ? this.getPushTransform(placement) : undefined, + ...offsetStyle, ...style, }; }; @@ -234,18 +249,14 @@ class Drawer extends React.Component { - const { prefixCls, placement, className, width, height, mask, direction, ...rest } = this.props; - const haveMask = mask ? '' : 'no-mask'; + const { prefixCls, placement, className, mask, direction, visible, ...rest } = this.props; this.parentDrawer = value; - const offsetStyle: any = {}; - if (placement === 'left' || placement === 'right') { - offsetStyle.width = width; - } else { - offsetStyle.height = height; - } - const drawerClassName = classNames(className, haveMask, { + const drawerClassName = classNames(className, { + 'no-mask': !mask, [`${prefixCls}-rtl`]: direction === 'rtl', }); + const offsetStyle = mask ? this.getOffsetStyle() : {}; + return ( Date: Tue, 12 May 2020 17:58:45 +0800 Subject: [PATCH 16/19] style: optimize typography expand style in rtl (#24084) --- components/typography/style/rtl.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/typography/style/rtl.less b/components/typography/style/rtl.less index bec1c01858..fcc0fb9084 100644 --- a/components/typography/style/rtl.less +++ b/components/typography/style/rtl.less @@ -18,6 +18,12 @@ } } + &-expand { + .@{typography-prefix-cls}-rtl & { + float: left; + } + } + // Text input area &-edit-content { div& { From c19685e0ea1be170025e91b33d1371cd39fa7dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Tue, 12 May 2020 22:29:10 +0800 Subject: [PATCH 17/19] fix: Child of Button should be interactive (#24095) close #24090 --- components/button/style/index.less | 7 ------- 1 file changed, 7 deletions(-) diff --git a/components/button/style/index.less b/components/button/style/index.less index 353a85c821..8de7ecaaf2 100644 --- a/components/button/style/index.less +++ b/components/button/style/index.less @@ -22,13 +22,6 @@ line-height: @line-height-base; .btn; .btn-default; - // Make sure that the target of Button's click event always be `button` - // Ref: https://github.com/ant-design/ant-design/issues/7034 - > i, - > span { - display: inline-block; - pointer-events: none; - } &-primary { .btn-primary; From 731505813a3b51f4a454575e58647f5e8d8e074d Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Wed, 13 May 2020 11:09:28 +0800 Subject: [PATCH 18/19] style: fix menu border in rtl (#24101) --- components/menu/style/rtl.less | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/menu/style/rtl.less b/components/menu/style/rtl.less index 71e6ab4273..a2b6391d2c 100644 --- a/components/menu/style/rtl.less +++ b/components/menu/style/rtl.less @@ -22,12 +22,11 @@ } } - &-dark { - .@{menu-prefix-cls}-inline, - .@{menu-prefix-cls}-vertical { - .@{menu-prefix-cls}-rtl& { - border-left: none; - } + + &-dark&-inline, + &-dark&-vertical { + .@{menu-prefix-cls}-rtl& { + border-left: none; } } @@ -152,6 +151,7 @@ } &-sub&-inline { + border: 0; & .@{menu-prefix-cls}-item-group-title { .@{menu-prefix-cls}-rtl& { padding-right: 32px; From 08c63d1e23444194efadd2a8a5e8d15ce90dfb30 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, 13 May 2020 11:23:58 +0800 Subject: [PATCH 19/19] docs: Update faq of mutable data (#24106) * docs: Update faq * Update faq.en-US.md --- docs/react/faq.en-US.md | 4 ++++ docs/react/faq.zh-CN.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md index 0a10c6ca93..23965b58da 100644 --- a/docs/react/faq.en-US.md +++ b/docs/react/faq.en-US.md @@ -60,6 +60,10 @@ Please refer to [Replace Moment.js](/docs/react/replace-moment). The `defaultXxxx` (like `defaultValue`) of `Input`/`Select`(etc...) only works on the first render. It is a specification of React. Please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components). +### Why modify props in mutable way not trigger component update? + +antd use shallow compare of props to optimize performance. You should always pass new object when state update. Please ref [React's document](https://reactjs.org/docs/thinking-in-react.html) + ### I set the `value` of `Input`/`Select`(etc.), and then it cannot be changed by user's action. Try `defaultValue` or `onChange` to change `value`, and please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components). diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md index de99427c2c..5addfc142f 100644 --- a/docs/react/faq.zh-CN.md +++ b/docs/react/faq.zh-CN.md @@ -60,6 +60,10 @@ import { Menu, Breadcrumb, Icon } from 'antd'; `Input`/`Select` 等的 `defaultXxxx`(例如 `defaultValue`)只有在第一次渲染的时候有效,这是 React 的规范,请阅读 [React 的文档](https://reactjs.org/docs/forms.html#controlled-components)。 +### 为什么修改组件传入的对象或数组属性组件不会更新? + +antd 内部会对 props 进行浅比较实现性能优化。当状态变更,你总是应该传递一个新的对象。具体请参考[React 的文档](https://reactjs.org/docs/thinking-in-react.html) + ### 当我设置了 `Input`/`Select` 等的 `value` 时它就无法修改了。 尝试使用 `defaultValue` 或 `onChange` 来改变 `value`,请参考 [React 的文档](https://reactjs.org/docs/forms.html#controlled-components)。