Skip to content

Commit 6866872

Browse files
committed
Merge branch 'feat_v3.x' of github.com:jdf2e/nutui-react into feat_v3.x
2 parents dea9a48 + 11c956e commit 6866872

16 files changed

Lines changed: 1345 additions & 1987 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pnpm-lock.*.yaml
4848
.idea
4949
.vscode
5050
.omx
51+
.omc
5152
*.suo
5253
*.ntvs*
5354
*.njsproj

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"clone:jdharmony": "node ./scripts/harmony/clone-jdharmony.js",
5656
"dev": "vite --open --force",
5757
"dev:jmapp": "VITE_APP_PROJECT_ID=jmapp vite --open --force",
58+
"dev:daojia": "VITE_APP_PROJECT_ID=daojia vite --open --force",
5859
"dev:rtl": "VITE_RTL=rtl vite --open --force",
5960
"dev:jrkf": "VITE_APP_PROJECT_ID=jrkf vite --open --force",
6061
"dev:taro:rn:dark": "THEME=dark pnpm dev:taro:rn",

src/hooks/taro/use-custom-event.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import isEqual from 'react-fast-compare'
33
import { eventCenter, getCurrentInstance } from '@tarojs/taro'
44
import { useForceUpdate } from '@/hooks/use-force-update'
55

6+
// export const customEvents = new Events()
67
export const customEvents = eventCenter
78

89
export function useCustomEventsPath(selector?: string) {

src/locales/base.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export interface BaseLang {
99
edit: string
1010
reset: string
1111
close: string
12+
back: string
13+
clear: string
14+
image: {
15+
errorTip: string
16+
}
1217
video: {
1318
errorTip: string
1419
clickRetry: string
@@ -40,6 +45,8 @@ export interface BaseLang {
4045
today: string
4146
loadPreviousMonth: string
4247
noEarlierMonth: string
48+
// eslint-disable-next-line @typescript-eslint/ban-types
49+
dayAriaLabel?: Function
4350
}
4451
shortpassword: {
4552
title: string

src/locales/en-US.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const enUS: BaseLang = {
1111
edit: 'Edit',
1212
reset: 'Reset',
1313
close: 'Close',
14+
back: 'Back',
15+
clear: 'Clear',
16+
image: {
17+
errorTip: 'Image failed to load',
18+
},
1419
video: {
1520
errorTip: 'Error Tip',
1621
clickRetry: 'Click Retry',
@@ -40,6 +45,24 @@ const enUS: BaseLang = {
4045
today: 'Today',
4146
loadPreviousMonth: 'Load Previous Month',
4247
noEarlierMonth: 'No Earlier Month',
48+
dayAriaLabel: (
49+
year: number,
50+
month: number,
51+
day: number,
52+
today: boolean,
53+
isActive: boolean,
54+
isDisable: boolean
55+
) => {
56+
const dateStr = `${year}-${month}-${day}`
57+
let label = today ? `Today, ${dateStr}` : dateStr
58+
if (isActive) {
59+
label = `Selected ${label}`
60+
}
61+
if (isDisable) {
62+
label = `${label} disabled`
63+
}
64+
return label
65+
},
4366
},
4467
shortpassword: {
4568
title: 'Please input a password',

src/locales/id-ID.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const idID: BaseLang = {
1111
edit: 'Sunting',
1212
reset: 'Mengatur Ulang',
1313
close: 'Tutup',
14+
back: 'Kembali',
15+
clear: 'Bersihkan',
16+
image: {
17+
errorTip: 'Gambar gagal dimuat',
18+
},
1419
video: {
1520
errorTip: 'Terjadi Kesalahan',
1621
clickRetry: 'Coba Lagi',
@@ -40,6 +45,24 @@ const idID: BaseLang = {
4045
today: 'Hari ini',
4146
loadPreviousMonth: 'Muat Bulan Sebelumnya',
4247
noEarlierMonth: 'Tidak Ada Bulan Sebelumnya',
48+
dayAriaLabel: (
49+
year: number,
50+
month: number,
51+
day: number,
52+
today: boolean,
53+
isActive: boolean,
54+
isDisable: boolean
55+
) => {
56+
const dateStr = `${year}-${month}-${day}`
57+
let label = today ? `Hari ini, ${dateStr}` : dateStr
58+
if (isActive) {
59+
label = `Dipilih ${label}`
60+
}
61+
if (isDisable) {
62+
label = `${label} dinonaktifkan`
63+
}
64+
return label
65+
},
4366
},
4467
shortpassword: {
4568
title: 'SIlakan masukan kata sandi',

src/locales/ja-JP.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ const jaJP: BaseLang = {
1010
select: '選択してください',
1111
edit: '編集',
1212
reset: 'リセット',
13+
close: '閉じる',
14+
back: '戻る',
15+
clear: 'クリア',
16+
image: {
17+
errorTip: '画像の読み込みに失敗しました',
18+
},
1319
video: {
1420
errorTip: '動画の読み込みに失敗しました',
1521
clickRetry: 'クリックして再試行',
@@ -41,6 +47,26 @@ const jaJP: BaseLang = {
4147
today: '今日',
4248
loadPreviousMonth: '前の月を読み込む',
4349
noEarlierMonth: 'これより前の月はありません',
50+
dayAriaLabel: (
51+
year: number,
52+
month: number,
53+
day: number,
54+
today: boolean,
55+
isActive: boolean,
56+
isDisable: boolean
57+
) => {
58+
if (isActive) {
59+
return today
60+
? `今日${month}${day}日を選択しました`
61+
: `${month}${day}日を選択しました`
62+
}
63+
if (isDisable) {
64+
return today
65+
? `今日${month}${day}日は無効です`
66+
: `${month}${day}日は無効です`
67+
}
68+
return today ? `今日${month}${day}日` : `${month}${day}日`
69+
},
4470
},
4571
shortpassword: {
4672
title: 'パスワードを入力してください',
@@ -142,7 +168,6 @@ const jaJP: BaseLang = {
142168
errorCanvasTips: '現在の環境はCanvasをサポートしていません',
143169
},
144170
mask: 'マスク',
145-
close: '閉じる',
146171
quickenter: {
147172
title: 'クイックアクセス',
148173
},

src/locales/tr-TR.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const trTR: BaseLang = {
1111
edit: 'düzenlemek',
1212
reset: 'sıfırlama',
1313
close: 'Kapat',
14+
back: 'Geri',
15+
clear: 'Temizle',
16+
image: {
17+
errorTip: 'Resim yüklenemedi',
18+
},
1419
video: {
1520
errorTip: 'Video yüklenemedi',
1621
clickRetry: 'Yeniden Tıklayın',
@@ -48,6 +53,24 @@ const trTR: BaseLang = {
4853
today: 'Bugün',
4954
loadPreviousMonth: 'Önceki ayı yükle',
5055
noEarlierMonth: 'Önceki ay yok',
56+
dayAriaLabel: (
57+
year: number,
58+
month: number,
59+
day: number,
60+
today: boolean,
61+
isActive: boolean,
62+
isDisable: boolean
63+
) => {
64+
const dateStr = `${year}-${month}-${day}`
65+
let label = today ? `Bugün, ${dateStr}` : dateStr
66+
if (isActive) {
67+
label = `Seçili ${label}`
68+
}
69+
if (isDisable) {
70+
label = `${label} devre dışı`
71+
}
72+
return label
73+
},
5174
},
5275
shortpassword: {
5376
title: 'Lütfen şifrenizi girin',

src/locales/vi-VN.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const viVN: BaseLang = {
1111
edit: 'Chỉnh sửa',
1212
reset: 'Đặt lại',
1313
close: 'Đóng',
14+
back: 'Quay lại',
15+
clear: 'Xóa',
16+
image: {
17+
errorTip: 'Tải ảnh không thành công',
18+
},
1419
video: {
1520
errorTip: 'Tải video không thành công',
1621
clickRetry: 'Nhấn để thử lại',
@@ -41,6 +46,24 @@ const viVN: BaseLang = {
4146
today: 'Hôm nay',
4247
loadPreviousMonth: 'Tải dữ liệu của tháng trước',
4348
noEarlierMonth: 'Không có tháng nào sớm hơn',
49+
dayAriaLabel: (
50+
year: number,
51+
month: number,
52+
day: number,
53+
today: boolean,
54+
isActive: boolean,
55+
isDisable: boolean
56+
) => {
57+
const dateStr = `${year}-${month}-${day}`
58+
let label = today ? `Hôm nay, ${dateStr}` : dateStr
59+
if (isActive) {
60+
label = `Đã chọn ${label}`
61+
}
62+
if (isDisable) {
63+
label = `${label} bị vô hiệu`
64+
}
65+
return label
66+
},
4467
},
4568
shortpassword: {
4669
title: 'Vui lòng nhập mật khẩu',

src/locales/zh-CN.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const zhCN: BaseLang = {
1111
edit: '编辑',
1212
reset: '重置',
1313
close: '关闭',
14+
back: '返回',
15+
clear: '清除',
16+
image: {
17+
errorTip: '图片加载失败',
18+
},
1419
video: {
1520
errorTip: '视频加载失败',
1621
clickRetry: '点击重试',
@@ -42,6 +47,26 @@ const zhCN: BaseLang = {
4247
today: '今天',
4348
loadPreviousMonth: '加载上一个月',
4449
noEarlierMonth: '没有更早月份',
50+
dayAriaLabel: (
51+
year: number,
52+
month: number,
53+
day: number,
54+
today: boolean,
55+
isActive: boolean,
56+
isDisable: boolean
57+
) => {
58+
if (isActive) {
59+
return today
60+
? `已选定今日${month}${day}号`
61+
: `已选定${month}${day}号`
62+
}
63+
if (isDisable) {
64+
return today
65+
? `${month}${day}号今日按钮变暗`
66+
: `${month}${day}号按钮变暗`
67+
}
68+
return today ? `${month}${day}号今日` : `${month}${day}号`
69+
},
4570
},
4671
shortpassword: {
4772
title: '请输入密码',

0 commit comments

Comments
 (0)