From dcf600e1f0bfd593dfa85686a89fa605661429c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B1=AA?= <1844749591@qq.com> Date: Fri, 24 Jan 2025 15:13:02 +0800 Subject: [PATCH 1/3] feat: improve a11y when table header is empty --- src/PickerPanel/DatePanel/index.tsx | 8 +++++++- tests/__snapshots__/panel.spec.tsx.snap | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/PickerPanel/DatePanel/index.tsx b/src/PickerPanel/DatePanel/index.tsx index 4a6f387c3..dce40ff47 100644 --- a/src/PickerPanel/DatePanel/index.tsx +++ b/src/PickerPanel/DatePanel/index.tsx @@ -98,7 +98,13 @@ export default function DatePanel(props: DatePane : []); if (prefixColumn) { - headerCells.push(); + headerCells.push( + + + Week + + , + ); } for (let i = 0; i < WEEK_DAY_COUNT; i += 1) { headerCells.push({weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT]}); diff --git a/tests/__snapshots__/panel.spec.tsx.snap b/tests/__snapshots__/panel.spec.tsx.snap index 4f1a4fbd6..d83ce5bbf 100644 --- a/tests/__snapshots__/panel.spec.tsx.snap +++ b/tests/__snapshots__/panel.spec.tsx.snap @@ -3395,9 +3395,13 @@ exports[`Picker.Panel append cell with cellRender in week 1`] = ` > - + + + Week + + Su @@ -6954,9 +6958,13 @@ exports[`Picker.Panel override cell with cellRender in week 1`] = ` > - + + + Week + + Su From 76da25a73887d7d07293256d949e533b5a00dce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B1=AA?= <1844749591@qq.com> Date: Thu, 6 Feb 2025 23:46:13 +0800 Subject: [PATCH 2/3] feat: Add 'week' localization support across multiple locales --- src/PickerPanel/DatePanel/index.tsx | 6 +- src/PickerPanel/MonthPanel/index.tsx | 2 +- src/PickerPanel/PanelHeader.tsx | 8 +- src/PickerPanel/QuarterPanel/index.tsx | 2 +- src/PickerPanel/YearPanel/index.tsx | 2 +- src/interface.tsx | 1 + src/locale/am_ET.ts | 1 + src/locale/ar_EG.ts | 1 + src/locale/az_AZ.ts | 1 + src/locale/bg_BG.ts | 1 + src/locale/bn_BD.ts | 1 + src/locale/by_BY.ts | 1 + src/locale/ca_ES.ts | 1 + src/locale/cs_CZ.ts | 1 + src/locale/da_DK.ts | 1 + src/locale/de_DE.ts | 1 + src/locale/el_GR.ts | 1 + src/locale/en_GB.ts | 1 + src/locale/en_US.ts | 1 + src/locale/es_ES.ts | 1 + src/locale/es_MX.ts | 1 + src/locale/et_EE.ts | 1 + src/locale/eu_ES.ts | 1 + src/locale/fa_IR.ts | 1 + src/locale/fi_FI.ts | 1 + src/locale/fr_BE.ts | 1 + src/locale/fr_CA.ts | 1 + src/locale/fr_FR.ts | 1 + src/locale/ga_IE.ts | 1 + src/locale/gl_ES.ts | 1 + src/locale/he_IL.ts | 1 + src/locale/hi_IN.ts | 1 + src/locale/hr_HR.ts | 1 + src/locale/hu_HU.ts | 1 + src/locale/id_ID.ts | 1 + src/locale/is_IS.ts | 1 + src/locale/it_IT.ts | 1 + src/locale/ja_JP.ts | 1 + src/locale/ka_GE.ts | 1 + src/locale/kk_KZ.ts | 1 + src/locale/km_KH.ts | 1 + src/locale/kmr_IQ.ts | 1 + src/locale/kn_IN.ts | 1 + src/locale/ko_KR.ts | 1 + src/locale/lt_LT.ts | 1 + src/locale/lv_LV.ts | 1 + src/locale/mk_MK.ts | 1 + src/locale/ml_IN.ts | 1 + src/locale/mn_MN.ts | 1 + src/locale/ms_MY.ts | 1 + src/locale/my_MM.ts | 1 + src/locale/nb_NO.ts | 1 + src/locale/ne_NP.ts | 1 + src/locale/nl_BE.ts | 1 + src/locale/nl_NL.ts | 1 + src/locale/pl_PL.ts | 1 + src/locale/pt_BR.ts | 1 + src/locale/pt_PT.ts | 1 + src/locale/ro_RO.ts | 1 + src/locale/ru_RU.ts | 1 + src/locale/si_LK.ts | 1 + src/locale/sk_SK.ts | 1 + src/locale/sl_SI.ts | 1 + src/locale/sr_Cyrl_RS.ts | 1 + src/locale/sr_RS.ts | 1 + src/locale/sv_SE.ts | 1 + src/locale/ta_IN.ts | 1 + src/locale/th_TH.ts | 1 + src/locale/tk_TK.ts | 1 + src/locale/tr_TR.ts | 1 + src/locale/ug_CN.ts | 1 + src/locale/uk_UA.ts | 1 + src/locale/ur_PK.ts | 1 + src/locale/uz_UZ.ts | 1 + src/locale/vi_VN.ts | 1 + src/locale/zh_CN.ts | 1 + src/locale/zh_TW.ts | 1 + tests/__snapshots__/panel.spec.tsx.snap | 116 ++++++++++++------------ tests/__snapshots__/range.spec.tsx.snap | 36 ++++---- 79 files changed, 158 insertions(+), 86 deletions(-) diff --git a/src/PickerPanel/DatePanel/index.tsx b/src/PickerPanel/DatePanel/index.tsx index dce40ff47..e4bbe6595 100644 --- a/src/PickerPanel/DatePanel/index.tsx +++ b/src/PickerPanel/DatePanel/index.tsx @@ -101,7 +101,7 @@ export default function DatePanel(props: DatePane headerCells.push( - Week + {locale.week} , ); @@ -142,7 +142,7 @@ export default function DatePanel(props: DatePane const yearNode: React.ReactNode = (