From 12af9a9dca95a33e484fb625105e171a96f36b8c Mon Sep 17 00:00:00 2001 From: zombiej Date: Thu, 10 Jan 2019 18:37:21 +0800 Subject: [PATCH] icon add aria-label support --- .../__tests__/__snapshots__/demo.test.js.snap | 23 + .../__tests__/__snapshots__/demo.test.js.snap | 8 + .../__tests__/__snapshots__/demo.test.js.snap | 12 + .../__tests__/__snapshots__/demo.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 22 + .../__snapshots__/index.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 8 + .../__snapshots__/index.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 10 + .../__tests__/__snapshots__/demo.test.js.snap | 17 + .../__snapshots__/index.test.js.snap | 17 + .../__tests__/__snapshots__/demo.test.js.snap | 16 + .../__tests__/__snapshots__/demo.test.js.snap | 4 + .../__snapshots__/components.test.js.snap | 150 ++++ .../__snapshots__/DatePicker.test.js.snap | 4 + .../__snapshots__/WeekPicker.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 42 + .../__snapshots__/Drawer.test.js.snap | 5 + .../__snapshots__/DrawerEvent.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 9 + .../dropdown-button.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 54 ++ .../__snapshots__/index.test.js.snap | 12 + components/icon/index.tsx | 17 +- .../__tests__/__snapshots__/demo.test.js.snap | 16 + .../__tests__/__snapshots__/demo.test.js.snap | 21 + .../__snapshots__/index.test.js.snap | 10 + .../__tests__/__snapshots__/demo.test.js.snap | 29 + .../__tests__/__snapshots__/demo.test.js.snap | 11 + .../__snapshots__/pagination.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 18 + .../__snapshots__/index.test.js.snap | 801 ++++++++++++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 25 + .../__snapshots__/Modal.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 29 + .../__snapshots__/index.test.js.snap | 4 +- .../__tests__/__snapshots__/demo.test.js.snap | 12 + .../__snapshots__/index.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 70 ++ .../__tests__/__snapshots__/demo.test.js.snap | 18 + .../__snapshots__/index.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 6 + .../__tests__/__snapshots__/demo.test.js.snap | 1 + .../__tests__/__snapshots__/demo.test.js.snap | 10 + components/style/core/iconfont.less | 4 + .../__tests__/__snapshots__/demo.test.js.snap | 3 + .../__snapshots__/Table.filter.test.js.snap | 2 + .../Table.pagination.test.js.snap | 2 + .../Table.rowSelection.test.js.snap | 2 + .../__snapshots__/Table.sorter.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 97 +++ .../__tests__/__snapshots__/demo.test.js.snap | 45 + .../__snapshots__/index.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 11 + .../__tests__/__snapshots__/demo.test.js.snap | 13 + .../__tests__/__snapshots__/demo.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 14 + .../__snapshots__/index.test.js.snap | 4 + .../__snapshots__/search.test.js.snap | 2 + .../__tests__/__snapshots__/demo.test.js.snap | 4 + .../__tests__/__snapshots__/demo.test.js.snap | 36 + .../__snapshots__/directory.test.js.snap | 72 ++ .../__tests__/__snapshots__/demo.test.js.snap | 23 + .../__snapshots__/uploadlist.test.js.snap | 32 + 68 files changed, 1914 insertions(+), 3 deletions(-) diff --git a/components/alert/__tests__/__snapshots__/demo.test.js.snap b/components/alert/__tests__/__snapshots__/demo.test.js.snap index b6302739cd..881745286e 100644 --- a/components/alert/__tests__/__snapshots__/demo.test.js.snap +++ b/components/alert/__tests__/__snapshots__/demo.test.js.snap @@ -7,6 +7,7 @@ exports[`renders ./components/alert/demo/banner.md correctly 1`] = ` data-show="true" > @@ -398,6 +399,7 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = ` type="button" > Hover me Hover me, Click menu item Hover me Hover me Cascading menu Click me Collapse @@ -1086,6 +1091,7 @@ exports[`renders ./components/form/demo/horizontal-login.md correctly 1`] = ` class="ant-input-prefix" > @@ -1353,6 +1359,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = ` class="ant-input-prefix" > @@ -1404,6 +1411,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = ` class="ant-input-prefix" > @@ -1620,6 +1628,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = ` Nickname  {null} 1`] = ` exports[`Icon should render to a ... 1`] = ` ... 1`] = ` exports[`Icon should support basic usage 1`] = `
= props => { viewBox, spin, + tabIndex, + onClick, + // children children, @@ -147,8 +151,19 @@ const Icon: IconComponent = props => { ); } + let iconTabIndex = tabIndex; + if (iconTabIndex === undefined && onClick) { + iconTabIndex = -1; + } + return ( - + {innerNode} ); diff --git a/components/input-number/__tests__/__snapshots__/demo.test.js.snap b/components/input-number/__tests__/__snapshots__/demo.test.js.snap index f84bbdeff0..cfc59fc8c1 100644 --- a/components/input-number/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input-number/__tests__/__snapshots__/demo.test.js.snap @@ -15,6 +15,7 @@ exports[`renders ./components/input-number/demo/basic.md correctly 1`] = ` unselectable="unselectable" > @@ -988,7 +1006,9 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = ` class="ant-input-suffix" > @@ -963,6 +964,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -989,6 +991,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1075,6 +1078,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1101,6 +1105,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1127,6 +1132,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1213,6 +1219,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1239,6 +1246,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1265,6 +1273,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
  • @@ -1326,6 +1335,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = ` class="ant-pagination-item-link" >
    code
  • "`; +exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"
    code
    "`; -exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
    code
    "`; +exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
    code
    "`; diff --git a/components/progress/__tests__/__snapshots__/demo.test.js.snap b/components/progress/__tests__/__snapshots__/demo.test.js.snap index fd3194cd8d..ae4e89c97a 100644 --- a/components/progress/__tests__/__snapshots__/demo.test.js.snap +++ b/components/progress/__tests__/__snapshots__/demo.test.js.snap @@ -78,6 +78,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = ` class="ant-progress-text" > @@ -199,6 +200,7 @@ exports[`renders ./components/slider/demo/icon-slider.md correctly 1`] = ` /> @@ -273,6 +275,7 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = ` unselectable="unselectable" > diff --git a/components/steps/__tests__/__snapshots__/demo.test.js.snap b/components/steps/__tests__/__snapshots__/demo.test.js.snap index 5f8975fd56..0d0d889c38 100644 --- a/components/steps/__tests__/__snapshots__/demo.test.js.snap +++ b/components/steps/__tests__/__snapshots__/demo.test.js.snap @@ -152,6 +152,7 @@ exports[`renders ./components/steps/demo/error.md correctly 1`] = ` class="ant-steps-icon" > More actions More actions More actions More actions More actions More actions More actions More actions More actions More actions Tab 1 Tab 1 Tag 2 Movies @@ -111,6 +112,7 @@ exports[`renders ./components/timeline/demo/alternate.md correctly 1`] = ` class="ant-timeline-item-head ant-timeline-item-head-custom ant-timeline-item-head-blue" > @@ -335,6 +337,7 @@ exports[`renders ./components/timeline/demo/custom.md correctly 1`] = ` class="ant-timeline-item-head ant-timeline-item-head-custom ant-timeline-item-head-red" > @@ -440,6 +443,7 @@ exports[`renders ./components/timeline/demo/pending.md correctly 1`] = ` class="ant-timeline-item-head ant-timeline-item-head-custom ant-timeline-item-head-blue" > diff --git a/components/transfer/__tests__/__snapshots__/demo.test.js.snap b/components/transfer/__tests__/__snapshots__/demo.test.js.snap index ef6b3b4dba..c1529387bb 100644 --- a/components/transfer/__tests__/__snapshots__/demo.test.js.snap +++ b/components/transfer/__tests__/__snapshots__/demo.test.js.snap @@ -54,6 +54,7 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = ` class="ant-transfer-list-search-action" >