Component: Locale-aware Number Input
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, internationalization
Hướng nghiên cứu
Start by reading CONTRIBUTING.md and the component conventions, then inspect src/registry/components/ and its index.ts, src/registry/registry.ts, and tests in test/. Implement and verify locale parsing and formatting for en-US, de-DE, fr-FR, and hi-IN, including caret behavior, min/max, and empty input; done means the component, exports, registry entry, tests, and documentation page are in place.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Component: Locale-aware Number Input
A number input that lets people type and read numbers the way their locale writes them: 1.234,56 in German, 1,234.56 in English, 1 234,56 in French. It still gives your code a plain JavaScript number.
Requirements
- TypeScript-first with exported props interface
- Derives the decimal and grouping separators from
Intl.NumberFormat(locale).formatToParts(), not from a hardcoded table - Accepts input with the locale's separators, parses it to a
number(ornullwhen empty), and reformats on blur - Keeps the caret in a sensible place while typing; doesn't reformat mid-typing in a way that jumps the cursor
- Supports
min,max,stepandmaximumFractionDigits - Follows the component conventions:
value/defaultValue/onValueChange(number), forwarded ref,...rest inputMode="decimal"so mobile keyboards show the right keys- Works with React Hook Form and other form libraries (controlled and uncontrolled)
Expected API
<NumberInput
locale="de-DE"
defaultValue={1234.56}
maximumFractionDigits={2}
onValueChange={(value) => setAmount(value)} // 1234.56
/>
Deliverables
- Component source in
src/registry/components/ - Export in
src/registry/components/index.tsand entry insrc/registry/registry.ts - Tests in
test/covering parsing and formatting foren-US,de-DE,fr-FR(narrow no-break space grouping) andhi-IN(lakh grouping), plus min/max and empty input - Documentation page in
content/docs/components/inputs/
Related: #5 (Currency Input) could build on this once it lands.
See CONTRIBUTING.md and the Contributor Rulebook.
- Ngôn ngữ chính
- TypeScript
- Star
- 39
- Fork
- 16
- Merge trung bình
- 18 giờ 14 phút
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của babelize/babelize-elements
-
accessibility help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
babelize/babelize-elements#94 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: Relative TimeĐang mởcomponent date-time good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
babelize/babelize-elements#92 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: Timezone PickerĐang mởcomponent date-time good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
babelize/babelize-elements#91 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component good first issue language-switcher
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
babelize/babelize-elements#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component enhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
babelize/babelize-elements#47 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của babelize/babelize-elements
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
formbricks/formbricks#9918 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Chat: Resize question overlayĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
thecodacus/pithagoras#364 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
openclimatefix/quartz-frontend#823 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
area:agent-manager community needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`contacts.create` posts to `/audiences/undefined/contacts` when `audienceId` is undefinedCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
resend/resend-node#1176 ·
Maintainer thường phản hồi trong vòng 1 ngày