Skip to content

Commit

Permalink
fix(*): fix DatePicker,Switch,Upload to a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
nianxiongdi committed May 15, 2019
1 parent 3924361 commit 99ef836
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/date-picker/date-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export default class DatePicker extends Component {
popupTriggerType: 'click',
popupAlign: 'tl tl',
locale: nextLocale.DatePicker,
defaultVisible: false,
onChange: func.noop,
onVisibleChange: func.noop,
onOk: func.noop,
Expand Down
1 change: 1 addition & 0 deletions src/date-picker/range-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default class RangePicker extends Component {
disabledDate: () => false,
footerRender: () => null,
hasClear: true,
defaultVisible: false,
popupTriggerType: 'click',
popupAlign: 'tl tl',
locale: nextLocale.DatePicker,
Expand Down
5 changes: 5 additions & 0 deletions src/locale/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,17 @@ export default {
card: {
cancel: 'Cancel',
addPhoto: 'Add Picture',
download: 'Download',
delete: 'Delete',
},
drag: {
text: 'Click or Drag the file to this area to upload',
hint:
'Support docx, xls, PDF, rar, zip, PNG, JPG and other files upload',
},
upload: {
delete: 'Delete',
},
},
Search: {
buttonText: 'Search',
Expand Down
5 changes: 5 additions & 0 deletions src/locale/ja-jp.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,16 @@ export default {
card: {
cancel: 'キャンセル',
addPhoto: '画像アップロード',
download: 'ダウンロード',
delete: '削除',
},
drag: {
text: '枠にドラッグしてアップロード',
hint: 'docx, xls, PDF, rar, zip, PNG, JPG 等がサポートしています',
},
upload: {
delete: '削除',
},
},
Search: {
buttonText: 'サーチ',
Expand Down
5 changes: 5 additions & 0 deletions src/locale/zh-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,16 @@ export default {
card: {
cancel: '取消',
addPhoto: '上传图片',
download: '下载',
delete: '删除',
},
drag: {
text: '点击或者拖动文件到虚线框内上传',
hint: '支持 docx, xls, PDF, rar, zip, PNG, JPG 等类型的文件',
},
upload: {
delete: '删除',
},
},
Search: {
buttonText: '搜索',
Expand Down
5 changes: 5 additions & 0 deletions src/locale/zh-tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,16 @@ export default {
card: {
cancel: '取消',
addPhoto: '上傳圖片',
download: '下載',
delete: '刪除',
},
drag: {
text: '點擊或者拖動文件到虛線框內上傳',
hint: '支持 docx, xls, PDF, rar, zip, PNG, JPG 等類型的文件',
},
upload: {
delete: '刪除',
},
},
Search: {
buttonText: '檢索',
Expand Down
1 change: 1 addition & 0 deletions src/switch/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Switch extends React.Component {
prefix: 'next-',
disabled: false,
size: 'medium',
defaultChecked: false,
onChange: () => {},
};

Expand Down
5 changes: 4 additions & 1 deletion src/upload/list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class List extends Component {
return `${fileSize}${suffix}`;
}
getTextList(file) {
const { extraRender, progressProps, rtl } = this.props;
const { locale, extraRender, progressProps, rtl } = this.props;

const { prefixCls, downloadURL, size, itemCls } = this.getInfo(file);
const onClick = () =>
Expand Down Expand Up @@ -224,6 +224,7 @@ class List extends Component {
type="close"
size="large"
role="button"
aria-label={locale.upload.delete}
tabIndex="0"
onClick={onClick}
onKeyDown={onKeyDown}
Expand Down Expand Up @@ -407,6 +408,7 @@ class List extends Component {
>
<Icon
type={downloadURL ? 'download' : ''}
aria-label={locale.card.download}
className={`${prefixCls}-tool-download-icon`}
/>
</a>
Expand All @@ -415,6 +417,7 @@ class List extends Component {
<span className={`${prefixCls}-tool-close`}>
<Icon
type="ashbin"
aria-label={locale.card.delete}
tabIndex="0"
role="button"
onClick={onClose}
Expand Down

0 comments on commit 99ef836

Please sign in to comment.