refactor: refactor code structure and improve demo page (#4389)

* feat: captcha example

* fix: fix lint errors

* chore: event handling and methods

* chore: add accessibility features ARIA labels and roles

* refactor: refactor code structure and improve captcha demo page

* feat: add captcha internationalization

* chore: 适配时间戳国际化展示

---------

Co-authored-by: vince <vince292007@gmail.com>
This commit is contained in:
Squall2017
2024-09-14 09:53:06 +08:00
committed by GitHub
parent 10b90eae5d
commit 5ba3a9dec2
10 changed files with 460 additions and 158 deletions

View File

@@ -0,0 +1,7 @@
export const parseValue = (value: number | string) => {
if (typeof value === 'number') {
return value;
}
const parsed = Number.parseFloat(value);
return Number.isNaN(parsed) ? 0 : parsed;
};