@izonnet-web-solution/react-native-date-picker-kit 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/LICENSE +5 -0
- package/README.md +942 -2
- package/assets/screenshots/calendar-picker-blue.jpg +0 -0
- package/assets/screenshots/calendar-picker.jpg +0 -0
- package/assets/screenshots/datetime-picker-date.jpg +0 -0
- package/assets/screenshots/datetime-picker-time-blue.jpg +0 -0
- package/assets/screenshots/input-modal-picker.jpg +0 -0
- package/assets/screenshots/manual-entry-single.jpg +0 -0
- package/assets/screenshots/manual-entry-split.jpg +0 -0
- package/assets/screenshots/month-year-selector-modal.jpg +0 -0
- package/assets/screenshots/range-picker.jpg +0 -0
- package/assets/screenshots/time-12h-wheel.jpg +0 -0
- package/assets/screenshots/time-24h-military-blue.jpg +0 -0
- package/assets/screenshots/wheel-date-picker.jpg +0 -0
- package/lib/components/Calendar/Calendar.d.ts +35 -0
- package/lib/components/Calendar/Calendar.d.ts.map +1 -0
- package/lib/components/Calendar/Calendar.js +126 -0
- package/lib/components/Calendar/Calendar.js.map +1 -0
- package/lib/components/Calendar/CalendarGrid.d.ts +11 -0
- package/lib/components/Calendar/CalendarGrid.d.ts.map +1 -0
- package/lib/components/Calendar/CalendarGrid.js +22 -0
- package/lib/components/Calendar/CalendarGrid.js.map +1 -0
- package/lib/components/Calendar/CalendarHeader.d.ts +23 -0
- package/lib/components/Calendar/CalendarHeader.d.ts.map +1 -0
- package/lib/components/Calendar/CalendarHeader.js +62 -0
- package/lib/components/Calendar/CalendarHeader.js.map +1 -0
- package/lib/components/Calendar/DateCell.d.ts +11 -0
- package/lib/components/Calendar/DateCell.d.ts.map +1 -0
- package/lib/components/Calendar/DateCell.js +71 -0
- package/lib/components/Calendar/DateCell.js.map +1 -0
- package/lib/components/Calendar/MonthYearSelectorModal.d.ts +17 -0
- package/lib/components/Calendar/MonthYearSelectorModal.d.ts.map +1 -0
- package/lib/components/Calendar/MonthYearSelectorModal.js +253 -0
- package/lib/components/Calendar/MonthYearSelectorModal.js.map +1 -0
- package/lib/components/Calendar/WeekDays.d.ts +13 -0
- package/lib/components/Calendar/WeekDays.d.ts.map +1 -0
- package/lib/components/Calendar/WeekDays.js +34 -0
- package/lib/components/Calendar/WeekDays.js.map +1 -0
- package/lib/components/Calendar/index.d.ts +7 -0
- package/lib/components/Calendar/index.d.ts.map +1 -0
- package/lib/components/Calendar/index.js +23 -0
- package/lib/components/Calendar/index.js.map +1 -0
- package/lib/components/DatePicker.d.ts +4 -0
- package/lib/components/DatePicker.d.ts.map +1 -0
- package/lib/components/DatePicker.js +498 -0
- package/lib/components/DatePicker.js.map +1 -0
- package/lib/components/Input/CalendarPopup.d.ts +26 -0
- package/lib/components/Input/CalendarPopup.d.ts.map +1 -0
- package/lib/components/Input/CalendarPopup.js +60 -0
- package/lib/components/Input/CalendarPopup.js.map +1 -0
- package/lib/components/Input/DateInput.d.ts +29 -0
- package/lib/components/Input/DateInput.d.ts.map +1 -0
- package/lib/components/Input/DateInput.js +110 -0
- package/lib/components/Input/DateInput.js.map +1 -0
- package/lib/components/Input/index.d.ts +3 -0
- package/lib/components/Input/index.d.ts.map +1 -0
- package/lib/components/Input/index.js +19 -0
- package/lib/components/Input/index.js.map +1 -0
- package/lib/components/ManualDateInput/DateInputField.d.ts +19 -0
- package/lib/components/ManualDateInput/DateInputField.d.ts.map +1 -0
- package/lib/components/ManualDateInput/DateInputField.js +345 -0
- package/lib/components/ManualDateInput/DateInputField.js.map +1 -0
- package/lib/components/ManualDateInput/DateValidationMessage.d.ts +8 -0
- package/lib/components/ManualDateInput/DateValidationMessage.d.ts.map +1 -0
- package/lib/components/ManualDateInput/DateValidationMessage.js +45 -0
- package/lib/components/ManualDateInput/DateValidationMessage.js.map +1 -0
- package/lib/components/ManualDateInput/ManualDateInput.d.ts +19 -0
- package/lib/components/ManualDateInput/ManualDateInput.d.ts.map +1 -0
- package/lib/components/ManualDateInput/ManualDateInput.js +18 -0
- package/lib/components/ManualDateInput/ManualDateInput.js.map +1 -0
- package/lib/components/ManualDateInput/index.d.ts +4 -0
- package/lib/components/ManualDateInput/index.d.ts.map +1 -0
- package/lib/components/ManualDateInput/index.js +20 -0
- package/lib/components/ManualDateInput/index.js.map +1 -0
- package/lib/components/Range/RangeDateCell.d.ts +11 -0
- package/lib/components/Range/RangeDateCell.d.ts.map +1 -0
- package/lib/components/Range/RangeDateCell.js +107 -0
- package/lib/components/Range/RangeDateCell.js.map +1 -0
- package/lib/components/Range/RangePicker.d.ts +29 -0
- package/lib/components/Range/RangePicker.d.ts.map +1 -0
- package/lib/components/Range/RangePicker.js +261 -0
- package/lib/components/Range/RangePicker.js.map +1 -0
- package/lib/components/Range/index.d.ts +3 -0
- package/lib/components/Range/index.d.ts.map +1 -0
- package/lib/components/Range/index.js +19 -0
- package/lib/components/Range/index.js.map +1 -0
- package/lib/components/Time/ClockDial.d.ts +15 -0
- package/lib/components/Time/ClockDial.d.ts.map +1 -0
- package/lib/components/Time/ClockDial.js +347 -0
- package/lib/components/Time/ClockDial.js.map +1 -0
- package/lib/components/Time/DateTimePicker.d.ts +31 -0
- package/lib/components/Time/DateTimePicker.d.ts.map +1 -0
- package/lib/components/Time/DateTimePicker.js +197 -0
- package/lib/components/Time/DateTimePicker.js.map +1 -0
- package/lib/components/Time/TimePicker.d.ts +31 -0
- package/lib/components/Time/TimePicker.d.ts.map +1 -0
- package/lib/components/Time/TimePicker.js +550 -0
- package/lib/components/Time/TimePicker.js.map +1 -0
- package/lib/components/Time/WheelTimePicker.d.ts +27 -0
- package/lib/components/Time/WheelTimePicker.d.ts.map +1 -0
- package/lib/components/Time/WheelTimePicker.js +203 -0
- package/lib/components/Time/WheelTimePicker.js.map +1 -0
- package/lib/components/Time/index.d.ts +5 -0
- package/lib/components/Time/index.d.ts.map +1 -0
- package/lib/components/Time/index.js +21 -0
- package/lib/components/Time/index.js.map +1 -0
- package/lib/components/Wheel/WheelColumn.d.ts +17 -0
- package/lib/components/Wheel/WheelColumn.d.ts.map +1 -0
- package/lib/components/Wheel/WheelColumn.js +192 -0
- package/lib/components/Wheel/WheelColumn.js.map +1 -0
- package/lib/components/Wheel/WheelPicker.d.ts +26 -0
- package/lib/components/Wheel/WheelPicker.d.ts.map +1 -0
- package/lib/components/Wheel/WheelPicker.js +123 -0
- package/lib/components/Wheel/WheelPicker.js.map +1 -0
- package/lib/components/Wheel/index.d.ts +3 -0
- package/lib/components/Wheel/index.d.ts.map +1 -0
- package/lib/components/Wheel/index.js +19 -0
- package/lib/components/Wheel/index.js.map +1 -0
- package/lib/components/common/Button.d.ts +17 -0
- package/lib/components/common/Button.d.ts.map +1 -0
- package/lib/components/common/Button.js +77 -0
- package/lib/components/common/Button.js.map +1 -0
- package/lib/components/common/IconButton.d.ts +14 -0
- package/lib/components/common/IconButton.d.ts.map +1 -0
- package/lib/components/common/IconButton.js +150 -0
- package/lib/components/common/IconButton.js.map +1 -0
- package/lib/components/common/Modal.d.ts +13 -0
- package/lib/components/common/Modal.d.ts.map +1 -0
- package/lib/components/common/Modal.js +65 -0
- package/lib/components/common/Modal.js.map +1 -0
- package/lib/components/common/index.d.ts +4 -0
- package/lib/components/common/index.d.ts.map +1 -0
- package/lib/components/common/index.js +20 -0
- package/lib/components/common/index.js.map +1 -0
- package/lib/components/index.d.ts +9 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +25 -0
- package/lib/components/index.js.map +1 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +20 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useCalendar.d.ts +34 -0
- package/lib/hooks/useCalendar.d.ts.map +1 -0
- package/lib/hooks/useCalendar.js +93 -0
- package/lib/hooks/useCalendar.js.map +1 -0
- package/lib/hooks/useDatePicker.d.ts +28 -0
- package/lib/hooks/useDatePicker.d.ts.map +1 -0
- package/lib/hooks/useDatePicker.js +150 -0
- package/lib/hooks/useDatePicker.js.map +1 -0
- package/lib/hooks/useDateRange.d.ts +23 -0
- package/lib/hooks/useDateRange.d.ts.map +1 -0
- package/lib/hooks/useDateRange.js +82 -0
- package/lib/hooks/useDateRange.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +29 -0
- package/lib/index.js.map +1 -0
- package/lib/localization/en.d.ts +3 -0
- package/lib/localization/en.d.ts.map +1 -0
- package/lib/localization/en.js +80 -0
- package/lib/localization/en.js.map +1 -0
- package/lib/localization/gu.d.ts +3 -0
- package/lib/localization/gu.d.ts.map +1 -0
- package/lib/localization/gu.js +80 -0
- package/lib/localization/gu.js.map +1 -0
- package/lib/localization/hi.d.ts +3 -0
- package/lib/localization/hi.d.ts.map +1 -0
- package/lib/localization/hi.js +80 -0
- package/lib/localization/hi.js.map +1 -0
- package/lib/localization/index.d.ts +8 -0
- package/lib/localization/index.d.ts.map +1 -0
- package/lib/localization/index.js +32 -0
- package/lib/localization/index.js.map +1 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/dark.d.ts.map +1 -0
- package/lib/themes/dark.js +30 -0
- package/lib/themes/dark.js.map +1 -0
- package/lib/themes/index.d.ts +16 -0
- package/lib/themes/index.d.ts.map +1 -0
- package/lib/themes/index.js +56 -0
- package/lib/themes/index.js.map +1 -0
- package/lib/themes/light.d.ts +3 -0
- package/lib/themes/light.d.ts.map +1 -0
- package/lib/themes/light.js +30 -0
- package/lib/themes/light.js.map +1 -0
- package/lib/types/index.d.ts +344 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +3 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/calendarUtils.d.ts +27 -0
- package/lib/utils/calendarUtils.d.ts.map +1 -0
- package/lib/utils/calendarUtils.js +108 -0
- package/lib/utils/calendarUtils.js.map +1 -0
- package/lib/utils/dateFormatting.d.ts +29 -0
- package/lib/utils/dateFormatting.d.ts.map +1 -0
- package/lib/utils/dateFormatting.js +114 -0
- package/lib/utils/dateFormatting.js.map +1 -0
- package/lib/utils/dateParsing.d.ts +23 -0
- package/lib/utils/dateParsing.d.ts.map +1 -0
- package/lib/utils/dateParsing.js +289 -0
- package/lib/utils/dateParsing.js.map +1 -0
- package/lib/utils/dateUtils.d.ts +20 -0
- package/lib/utils/dateUtils.d.ts.map +1 -0
- package/lib/utils/dateUtils.js +115 -0
- package/lib/utils/dateUtils.js.map +1 -0
- package/lib/utils/dateValidation.d.ts +36 -0
- package/lib/utils/dateValidation.d.ts.map +1 -0
- package/lib/utils/dateValidation.js +196 -0
- package/lib/utils/dateValidation.js.map +1 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +23 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/timeUtils.d.ts +78 -0
- package/lib/utils/timeUtils.d.ts.map +1 -0
- package/lib/utils/timeUtils.js +335 -0
- package/lib/utils/timeUtils.js.map +1 -0
- package/package.json +92 -3
- package/src/components/Calendar/Calendar.tsx +314 -0
- package/src/components/Calendar/CalendarGrid.tsx +47 -0
- package/src/components/Calendar/CalendarHeader.tsx +176 -0
- package/src/components/Calendar/DateCell.tsx +118 -0
- package/src/components/Calendar/MonthYearSelectorModal.tsx +407 -0
- package/src/components/Calendar/WeekDays.tsx +49 -0
- package/src/components/Calendar/index.ts +6 -0
- package/src/components/DatePicker.tsx +834 -0
- package/src/components/Input/CalendarPopup.tsx +168 -0
- package/src/components/Input/DateInput.tsx +259 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/ManualDateInput/DateInputField.tsx +493 -0
- package/src/components/ManualDateInput/DateValidationMessage.tsx +65 -0
- package/src/components/ManualDateInput/ManualDateInput.tsx +66 -0
- package/src/components/ManualDateInput/index.ts +3 -0
- package/src/components/Range/RangeDateCell.tsx +174 -0
- package/src/components/Range/RangePicker.tsx +484 -0
- package/src/components/Range/index.ts +2 -0
- package/src/components/Time/ClockDial.tsx +450 -0
- package/src/components/Time/DateTimePicker.tsx +395 -0
- package/src/components/Time/TimePicker.tsx +899 -0
- package/src/components/Time/WheelTimePicker.tsx +356 -0
- package/src/components/Time/index.ts +4 -0
- package/src/components/Wheel/WheelColumn.tsx +300 -0
- package/src/components/Wheel/WheelPicker.tsx +265 -0
- package/src/components/Wheel/index.ts +2 -0
- package/src/components/common/Button.tsx +125 -0
- package/src/components/common/IconButton.tsx +237 -0
- package/src/components/common/Modal.tsx +137 -0
- package/src/components/common/index.ts +3 -0
- package/src/components/index.ts +8 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useCalendar.ts +153 -0
- package/src/hooks/useDatePicker.ts +216 -0
- package/src/hooks/useDateRange.ts +135 -0
- package/src/index.ts +17 -0
- package/src/localization/en.ts +78 -0
- package/src/localization/gu.ts +78 -0
- package/src/localization/hi.ts +78 -0
- package/src/localization/index.ts +31 -0
- package/src/themes/dark.ts +28 -0
- package/src/themes/index.ts +73 -0
- package/src/themes/light.ts +28 -0
- package/src/types/index.ts +452 -0
- package/src/utils/calendarUtils.ts +152 -0
- package/src/utils/dateFormatting.ts +125 -0
- package/src/utils/dateParsing.ts +335 -0
- package/src/utils/dateUtils.ts +117 -0
- package/src/utils/dateValidation.ts +276 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/timeUtils.ts +416 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { DatePickerLocale } from '../types';
|
|
2
|
+
|
|
3
|
+
export const enLocale: DatePickerLocale = {
|
|
4
|
+
code: 'en',
|
|
5
|
+
months: [
|
|
6
|
+
'January',
|
|
7
|
+
'February',
|
|
8
|
+
'March',
|
|
9
|
+
'April',
|
|
10
|
+
'May',
|
|
11
|
+
'June',
|
|
12
|
+
'July',
|
|
13
|
+
'August',
|
|
14
|
+
'September',
|
|
15
|
+
'October',
|
|
16
|
+
'November',
|
|
17
|
+
'December',
|
|
18
|
+
],
|
|
19
|
+
monthsShort: [
|
|
20
|
+
'Jan',
|
|
21
|
+
'Feb',
|
|
22
|
+
'Mar',
|
|
23
|
+
'Apr',
|
|
24
|
+
'May',
|
|
25
|
+
'Jun',
|
|
26
|
+
'Jul',
|
|
27
|
+
'Aug',
|
|
28
|
+
'Sep',
|
|
29
|
+
'Oct',
|
|
30
|
+
'Nov',
|
|
31
|
+
'Dec',
|
|
32
|
+
],
|
|
33
|
+
weekdays: [
|
|
34
|
+
'Sunday',
|
|
35
|
+
'Monday',
|
|
36
|
+
'Tuesday',
|
|
37
|
+
'Wednesday',
|
|
38
|
+
'Thursday',
|
|
39
|
+
'Friday',
|
|
40
|
+
'Saturday',
|
|
41
|
+
],
|
|
42
|
+
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
43
|
+
weekdaysMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
|
44
|
+
today: 'Today',
|
|
45
|
+
clear: 'Clear',
|
|
46
|
+
cancel: 'Cancel',
|
|
47
|
+
confirm: 'Confirm',
|
|
48
|
+
apply: 'Apply',
|
|
49
|
+
selectDate: 'Select Date',
|
|
50
|
+
startDate: 'Start Date',
|
|
51
|
+
endDate: 'End Date',
|
|
52
|
+
placeholder: 'Select a date',
|
|
53
|
+
dayLabel: 'Day',
|
|
54
|
+
monthLabel: 'Month',
|
|
55
|
+
yearLabel: 'Year',
|
|
56
|
+
switchManual: 'Enter date manually',
|
|
57
|
+
switchCalendar: 'Pick from calendar',
|
|
58
|
+
am: 'AM',
|
|
59
|
+
pm: 'PM',
|
|
60
|
+
hourLabel: 'Hour',
|
|
61
|
+
minuteLabel: 'Minute',
|
|
62
|
+
secondLabel: 'Second',
|
|
63
|
+
selectTime: 'Select Time',
|
|
64
|
+
timeLabel: 'Time',
|
|
65
|
+
errors: {
|
|
66
|
+
invalidDate: 'Invalid date. Please verify your input.',
|
|
67
|
+
outOfRange: 'Date is outside the allowed boundaries.',
|
|
68
|
+
minDate: 'Date cannot be earlier than {min}.',
|
|
69
|
+
maxDate: 'Date cannot be later than {max}.',
|
|
70
|
+
disabledDate: 'This date is not available for selection.',
|
|
71
|
+
disabledWeekday: 'This day of the week is disabled.',
|
|
72
|
+
startDateAfterEndDate: 'Start date cannot be after end date.',
|
|
73
|
+
maxRangeExceeded: 'Selected range exceeds maximum allowed limit of {days} days.',
|
|
74
|
+
invalidTime: 'Invalid time. Please verify hours and minutes.',
|
|
75
|
+
minTime: 'Time cannot be earlier than {min}.',
|
|
76
|
+
maxTime: 'Time cannot be later than {max}.',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { DatePickerLocale } from '../types';
|
|
2
|
+
|
|
3
|
+
export const guLocale: DatePickerLocale = {
|
|
4
|
+
code: 'gu',
|
|
5
|
+
months: [
|
|
6
|
+
'જાન્યુઆરી',
|
|
7
|
+
'ફેબ્રુઆરી',
|
|
8
|
+
'માર્ચ',
|
|
9
|
+
'એપ્રિલ',
|
|
10
|
+
'મે',
|
|
11
|
+
'જૂન',
|
|
12
|
+
'જુલાઈ',
|
|
13
|
+
'ઑગસ્ટ',
|
|
14
|
+
'સપ્ટેમ્બર',
|
|
15
|
+
'ઑક્ટોબર',
|
|
16
|
+
'નવેમ્બર',
|
|
17
|
+
'ડિસેમ્બર',
|
|
18
|
+
],
|
|
19
|
+
monthsShort: [
|
|
20
|
+
'જાન્યુ',
|
|
21
|
+
'ફેબ્રુ',
|
|
22
|
+
'માર્ચ',
|
|
23
|
+
'એપ્રિલ',
|
|
24
|
+
'મે',
|
|
25
|
+
'જૂન',
|
|
26
|
+
'જુલાઈ',
|
|
27
|
+
'ઑગ',
|
|
28
|
+
'સપ્ટે',
|
|
29
|
+
'ઑક્ટો',
|
|
30
|
+
'નવે',
|
|
31
|
+
'ડિસે',
|
|
32
|
+
],
|
|
33
|
+
weekdays: [
|
|
34
|
+
'રવિવાર',
|
|
35
|
+
'સોમવાર',
|
|
36
|
+
'મંગળવાર',
|
|
37
|
+
'બુધવાર',
|
|
38
|
+
'ગુરુવાર',
|
|
39
|
+
'શુક્રવાર',
|
|
40
|
+
'શનિવાર',
|
|
41
|
+
],
|
|
42
|
+
weekdaysShort: ['રવિ', 'સોમ', 'મંગળ', 'બુધ', 'ગુરુ', 'શુક્ર', 'શનિ'],
|
|
43
|
+
weekdaysMin: ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'],
|
|
44
|
+
today: 'આજે',
|
|
45
|
+
clear: 'સાફ કરો',
|
|
46
|
+
cancel: 'રદ કરો',
|
|
47
|
+
confirm: 'પુષ્ટિ કરો',
|
|
48
|
+
apply: 'લાગુ કરો',
|
|
49
|
+
selectDate: 'તારીખ પસંદ કરો',
|
|
50
|
+
startDate: 'શરૂઆતની તારીખ',
|
|
51
|
+
endDate: 'અંતિમ તારીખ',
|
|
52
|
+
placeholder: 'તારીખ પસંદ કરો',
|
|
53
|
+
dayLabel: 'દિવસ',
|
|
54
|
+
monthLabel: 'મહિનો',
|
|
55
|
+
yearLabel: 'વર્ષ',
|
|
56
|
+
switchManual: 'મેન્યુઅલી દાખલ કરો',
|
|
57
|
+
switchCalendar: 'કેલેન્ડરમાંથી પસંદ કરો',
|
|
58
|
+
am: 'AM',
|
|
59
|
+
pm: 'PM',
|
|
60
|
+
hourLabel: 'કલાક',
|
|
61
|
+
minuteLabel: 'મિનિટ',
|
|
62
|
+
secondLabel: 'સેકન્ડ',
|
|
63
|
+
selectTime: 'સમય પસંદ કરો',
|
|
64
|
+
timeLabel: 'સમય',
|
|
65
|
+
errors: {
|
|
66
|
+
invalidDate: 'અમાન્ય તારીખ. કૃપા કરીને સાચી વિગતો દાખલ કરો.',
|
|
67
|
+
outOfRange: 'તારીખ માન્ય મર્યાદા બહાર છે.',
|
|
68
|
+
minDate: 'તારીખ {min} કરતાં પહેલાંની ન હોઈ શકે.',
|
|
69
|
+
maxDate: 'તારીખ {max} પછીની ન હોઈ શકે.',
|
|
70
|
+
disabledDate: 'આ તારીખ ઉપલબ્ધ નથી.',
|
|
71
|
+
disabledWeekday: 'અઠવાડિયાનો આ દિવસ અક્ષમ છે.',
|
|
72
|
+
startDateAfterEndDate: 'શરૂઆતની તારીખ અંતિમ તારીખ પછીની ન હોઈ શકે.',
|
|
73
|
+
maxRangeExceeded: 'પસંદ કરેલ તારીખો મહત્તમ માન્ય દિવસો ({days}) કરતાં વધુ છે.',
|
|
74
|
+
invalidTime: 'અમાન્ય સમય. કૃપા કરીને કલાક અને મિનિટ તપાસો.',
|
|
75
|
+
minTime: 'સમય {min} કરતાં પહેલાંનો ન હોઈ શકે.',
|
|
76
|
+
maxTime: 'સમય {max} પછીનો ન હોઈ શકે.',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { DatePickerLocale } from '../types';
|
|
2
|
+
|
|
3
|
+
export const hiLocale: DatePickerLocale = {
|
|
4
|
+
code: 'hi',
|
|
5
|
+
months: [
|
|
6
|
+
'जनवरी',
|
|
7
|
+
'फ़रवरी',
|
|
8
|
+
'मार्च',
|
|
9
|
+
'अप्रैल',
|
|
10
|
+
'मई',
|
|
11
|
+
'जून',
|
|
12
|
+
'जुलाई',
|
|
13
|
+
'अगस्त',
|
|
14
|
+
'सितंबर',
|
|
15
|
+
'अक्टूबर',
|
|
16
|
+
'नवंबर',
|
|
17
|
+
'दिसंबर',
|
|
18
|
+
],
|
|
19
|
+
monthsShort: [
|
|
20
|
+
'जन',
|
|
21
|
+
'फ़र',
|
|
22
|
+
'मार्च',
|
|
23
|
+
'अप्रै',
|
|
24
|
+
'मई',
|
|
25
|
+
'जून',
|
|
26
|
+
'जुल',
|
|
27
|
+
'अग',
|
|
28
|
+
'सित',
|
|
29
|
+
'अक्तू',
|
|
30
|
+
'नव',
|
|
31
|
+
'दिस',
|
|
32
|
+
],
|
|
33
|
+
weekdays: [
|
|
34
|
+
'रविवार',
|
|
35
|
+
'सोमवार',
|
|
36
|
+
'मंगलवार',
|
|
37
|
+
'बुधवार',
|
|
38
|
+
'गुरुवार',
|
|
39
|
+
'शुक्रवार',
|
|
40
|
+
'शनिवार',
|
|
41
|
+
],
|
|
42
|
+
weekdaysShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
|
|
43
|
+
weekdaysMin: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
|
|
44
|
+
today: 'आज',
|
|
45
|
+
clear: 'साफ़ करें',
|
|
46
|
+
cancel: 'रद्द करें',
|
|
47
|
+
confirm: 'पुष्टि करें',
|
|
48
|
+
apply: 'लागू करें',
|
|
49
|
+
selectDate: 'तारीख चुनें',
|
|
50
|
+
startDate: 'प्रारंभ तिथि',
|
|
51
|
+
endDate: 'समाप्ति तिथि',
|
|
52
|
+
placeholder: 'तारीख का चयन करें',
|
|
53
|
+
dayLabel: 'दिन',
|
|
54
|
+
monthLabel: 'महीना',
|
|
55
|
+
yearLabel: 'वर्ष',
|
|
56
|
+
switchManual: 'मैन्युअल रूप से दर्ज करें',
|
|
57
|
+
switchCalendar: 'कैलेंडर से चुनें',
|
|
58
|
+
am: 'AM',
|
|
59
|
+
pm: 'PM',
|
|
60
|
+
hourLabel: 'घंटा',
|
|
61
|
+
minuteLabel: 'मिनट',
|
|
62
|
+
secondLabel: 'सेकंड',
|
|
63
|
+
selectTime: 'समय चुनें',
|
|
64
|
+
timeLabel: 'समय',
|
|
65
|
+
errors: {
|
|
66
|
+
invalidDate: 'अमान्य तारीख। कृपया सही मान दर्ज करें।',
|
|
67
|
+
outOfRange: 'तारीख अनुमत सीमा से बाहर है।',
|
|
68
|
+
minDate: 'तारीख {min} से पहले नहीं हो सकती।',
|
|
69
|
+
maxDate: 'तारीख {max} के बाद नहीं हो सकती।',
|
|
70
|
+
disabledDate: 'यह तारीख अनुपलब्ध है।',
|
|
71
|
+
disabledWeekday: 'सप्ताह का यह दिन अक्षम है।',
|
|
72
|
+
startDateAfterEndDate: 'प्रारंभ तिथि समाप्ति तिथि के बाद नहीं हो सकती।',
|
|
73
|
+
maxRangeExceeded: 'चयनित सीमा अधिकतम अनुमत दिनों ({days}) से अधिक है।',
|
|
74
|
+
invalidTime: 'अमान्य समय। कृपया घंटे और मिनट जांचें।',
|
|
75
|
+
minTime: 'समय {min} से पहले नहीं हो सकता।',
|
|
76
|
+
maxTime: 'समय {max} के बाद नहीं हो सकता।',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { enLocale } from './en';
|
|
2
|
+
import { hiLocale } from './hi';
|
|
3
|
+
import { guLocale } from './gu';
|
|
4
|
+
import type { DatePickerLocale, SupportedLocale } from '../types';
|
|
5
|
+
|
|
6
|
+
export const locales: Record<SupportedLocale, DatePickerLocale> = {
|
|
7
|
+
en: enLocale,
|
|
8
|
+
hi: hiLocale,
|
|
9
|
+
gu: guLocale,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const getLocale = (
|
|
13
|
+
locale?: SupportedLocale | DatePickerLocale
|
|
14
|
+
): DatePickerLocale => {
|
|
15
|
+
if (!locale) {
|
|
16
|
+
return enLocale;
|
|
17
|
+
}
|
|
18
|
+
if (typeof locale === 'string') {
|
|
19
|
+
return locales[locale as SupportedLocale] || enLocale;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
...enLocale,
|
|
23
|
+
...locale,
|
|
24
|
+
errors: {
|
|
25
|
+
...enLocale.errors,
|
|
26
|
+
...(locale.errors || {}),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { enLocale, hiLocale, guLocale };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DatePickerTheme } from '../types';
|
|
2
|
+
|
|
3
|
+
export const darkTheme: DatePickerTheme = {
|
|
4
|
+
backgroundColor: '#0F172A',
|
|
5
|
+
surfaceColor: '#1E293B',
|
|
6
|
+
cardColor: '#1E293B',
|
|
7
|
+
primaryColor: '#3B82F6',
|
|
8
|
+
primaryTextColor: '#FFFFFF',
|
|
9
|
+
textColor: '#F8FAFC',
|
|
10
|
+
secondaryTextColor: '#94A3B8',
|
|
11
|
+
disabledTextColor: '#475569',
|
|
12
|
+
borderColor: '#334155',
|
|
13
|
+
selectedDayBackgroundColor: '#3B82F6',
|
|
14
|
+
selectedDayTextColor: '#FFFFFF',
|
|
15
|
+
todayBorderColor: '#3B82F6',
|
|
16
|
+
todayTextColor: '#60A5FA',
|
|
17
|
+
rangeBetweenBackgroundColor: '#1E3A8A',
|
|
18
|
+
rangeBetweenTextColor: '#BFDBFE',
|
|
19
|
+
errorColor: '#F87171',
|
|
20
|
+
errorBackgroundColor: '#450A0A',
|
|
21
|
+
borderRadius: 12,
|
|
22
|
+
fontSize: {
|
|
23
|
+
small: 12,
|
|
24
|
+
medium: 14,
|
|
25
|
+
large: 16,
|
|
26
|
+
title: 18,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { lightTheme } from './light';
|
|
2
|
+
import { darkTheme } from './dark';
|
|
3
|
+
import type { DatePickerTheme } from '../types';
|
|
4
|
+
|
|
5
|
+
export const themes: Record<'light' | 'dark', DatePickerTheme> = {
|
|
6
|
+
light: lightTheme,
|
|
7
|
+
dark: darkTheme,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export interface ThemeOverrides {
|
|
11
|
+
accentColor?: string;
|
|
12
|
+
primaryColor?: string;
|
|
13
|
+
textColor?: string;
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
cardColor?: string;
|
|
16
|
+
modalBackgroundColor?: string;
|
|
17
|
+
borderRadius?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const resolveTheme = (
|
|
21
|
+
themeInput?: 'light' | 'dark' | Partial<DatePickerTheme>,
|
|
22
|
+
overrides?: ThemeOverrides
|
|
23
|
+
): DatePickerTheme => {
|
|
24
|
+
let baseTheme = lightTheme;
|
|
25
|
+
|
|
26
|
+
if (themeInput === 'dark') {
|
|
27
|
+
baseTheme = darkTheme;
|
|
28
|
+
} else if (themeInput === 'light') {
|
|
29
|
+
baseTheme = lightTheme;
|
|
30
|
+
} else if (themeInput && typeof themeInput === 'object') {
|
|
31
|
+
baseTheme = {
|
|
32
|
+
...lightTheme,
|
|
33
|
+
...themeInput,
|
|
34
|
+
fontSize: {
|
|
35
|
+
...lightTheme.fontSize,
|
|
36
|
+
...(themeInput.fontSize || {}),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const resolved: DatePickerTheme = { ...baseTheme };
|
|
42
|
+
|
|
43
|
+
const accent = overrides?.accentColor || overrides?.primaryColor;
|
|
44
|
+
if (accent) {
|
|
45
|
+
resolved.primaryColor = accent;
|
|
46
|
+
resolved.selectedDayBackgroundColor = accent;
|
|
47
|
+
resolved.todayBorderColor = accent;
|
|
48
|
+
resolved.todayTextColor = accent;
|
|
49
|
+
resolved.rangeBetweenBackgroundColor = `${accent}20`;
|
|
50
|
+
resolved.rangeBetweenTextColor = accent;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (overrides?.textColor) {
|
|
54
|
+
resolved.textColor = overrides.textColor;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (overrides?.backgroundColor) {
|
|
58
|
+
resolved.backgroundColor = overrides.backgroundColor;
|
|
59
|
+
resolved.cardColor = overrides.backgroundColor;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (overrides?.cardColor || overrides?.modalBackgroundColor) {
|
|
63
|
+
resolved.cardColor = (overrides.cardColor || overrides.modalBackgroundColor)!;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (overrides?.borderRadius !== undefined) {
|
|
67
|
+
resolved.borderRadius = overrides.borderRadius;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return resolved;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { lightTheme, darkTheme };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DatePickerTheme } from '../types';
|
|
2
|
+
|
|
3
|
+
export const lightTheme: DatePickerTheme = {
|
|
4
|
+
backgroundColor: '#FFFFFF',
|
|
5
|
+
surfaceColor: '#F8FAFC',
|
|
6
|
+
cardColor: '#FFFFFF',
|
|
7
|
+
primaryColor: '#2563EB',
|
|
8
|
+
primaryTextColor: '#FFFFFF',
|
|
9
|
+
textColor: '#0F172A',
|
|
10
|
+
secondaryTextColor: '#64748B',
|
|
11
|
+
disabledTextColor: '#CBD5E1',
|
|
12
|
+
borderColor: '#E2E8F0',
|
|
13
|
+
selectedDayBackgroundColor: '#2563EB',
|
|
14
|
+
selectedDayTextColor: '#FFFFFF',
|
|
15
|
+
todayBorderColor: '#2563EB',
|
|
16
|
+
todayTextColor: '#2563EB',
|
|
17
|
+
rangeBetweenBackgroundColor: '#EFF6FF',
|
|
18
|
+
rangeBetweenTextColor: '#1D4ED8',
|
|
19
|
+
errorColor: '#EF4444',
|
|
20
|
+
errorBackgroundColor: '#FEF2F2',
|
|
21
|
+
borderRadius: 12,
|
|
22
|
+
fontSize: {
|
|
23
|
+
small: 12,
|
|
24
|
+
medium: 14,
|
|
25
|
+
large: 16,
|
|
26
|
+
title: 18,
|
|
27
|
+
},
|
|
28
|
+
};
|