@react-aria/datepicker 3.0.0-nightly.3180 → 3.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/dist/main.js +197 -143
- package/dist/main.js.map +1 -1
- package/dist/module.js +197 -130
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +8 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +19 -18
- package/src/index.ts +7 -1
- package/src/useDateField.ts +15 -8
- package/src/useDatePicker.ts +12 -8
- package/src/useDatePickerGroup.ts +34 -5
- package/src/useDateRangePicker.ts +15 -13
- package/src/useDateSegment.ts +83 -63
- package/src/useDisplayNames.ts +1 -0
package/dist/module.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {createFocusManager as $cIPI0$createFocusManager, getFocusableTreeWalker as $cIPI0$getFocusableTreeWalker} from "@react-aria/focus";
|
|
2
|
-
import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, mergeProps as $cIPI0$mergeProps, isMac as $cIPI0$isMac, scrollIntoView as $cIPI0$scrollIntoView, getScrollParent as $cIPI0$getScrollParent, useEvent as $cIPI0$useEvent, isIOS as $cIPI0$isIOS, useLabels as $cIPI0$useLabels} from "@react-aria/utils";
|
|
2
|
+
import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, filterDOMProps as $cIPI0$filterDOMProps, mergeProps as $cIPI0$mergeProps, isMac as $cIPI0$isMac, scrollIntoView as $cIPI0$scrollIntoView, getScrollParent as $cIPI0$getScrollParent, useEvent as $cIPI0$useEvent, useLayoutEffect as $cIPI0$useLayoutEffect, isIOS as $cIPI0$isIOS, useLabels as $cIPI0$useLabels} from "@react-aria/utils";
|
|
3
|
+
import $cIPI0$react, {useMemo as $cIPI0$useMemo, useRef as $cIPI0$useRef, useEffect as $cIPI0$useEffect} from "react";
|
|
3
4
|
import {useField as $cIPI0$useField} from "@react-aria/label";
|
|
4
5
|
import {useMessageFormatter as $cIPI0$useMessageFormatter, useLocale as $cIPI0$useLocale, useDateFormatter as $cIPI0$useDateFormatter, useFilter as $cIPI0$useFilter} from "@react-aria/i18n";
|
|
5
|
-
import $cIPI0$react, {useMemo as $cIPI0$useMemo, useRef as $cIPI0$useRef, useEffect as $cIPI0$useEffect} from "react";
|
|
6
6
|
import {useFocusWithin as $cIPI0$useFocusWithin, usePress as $cIPI0$usePress} from "@react-aria/interactions";
|
|
7
|
+
import {toCalendar as $cIPI0$toCalendar, CalendarDate as $cIPI0$CalendarDate} from "@internationalized/date";
|
|
7
8
|
import {NumberParser as $cIPI0$NumberParser} from "@internationalized/number";
|
|
8
9
|
import {useSpinButton as $cIPI0$useSpinButton} from "@react-aria/spinbutton";
|
|
9
10
|
import {MessageDictionary as $cIPI0$MessageDictionary} from "@internationalized/message";
|
|
@@ -11,145 +12,144 @@ import {MessageDictionary as $cIPI0$MessageDictionary} from "@internationalized/
|
|
|
11
12
|
function $parcel$interopDefault(a) {
|
|
12
13
|
return a && a.__esModule ? a.default : a;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
15
|
+
|
|
16
|
+
|
|
17
17
|
|
|
18
18
|
var $204383cf4f6b0d06$exports = {};
|
|
19
19
|
var $f23889fffbde9058$exports = {};
|
|
20
|
-
$f23889fffbde9058$exports = JSON.parse("{\"calendar\":\"التقويم\",\"
|
|
20
|
+
$f23889fffbde9058$exports = JSON.parse("{\"calendar\":\"التقويم\",\"day\":\"يوم\",\"dayPeriod\":\"ص/م\",\"endDate\":\"تاريخ الانتهاء\",\"era\":\"العصر\",\"hour\":\"الساعات\",\"minute\":\"الدقائق\",\"month\":\"الشهر\",\"second\":\"الثواني\",\"selectedDateDescription\":\"تاريخ محدد: {date}\",\"selectedRangeDescription\":\"المدى الزمني المحدد: {startDate} إلى {endDate}\",\"selectedTimeDescription\":\"الوقت المحدد: {time}\",\"startDate\":\"تاريخ البدء\",\"timeZoneName\":\"التوقيت\",\"weekday\":\"اليوم\",\"year\":\"السنة\"}");
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var $09d9badaa8903929$exports = {};
|
|
24
|
-
$09d9badaa8903929$exports = JSON.parse("{\"calendar\":\"Календар\",\"
|
|
24
|
+
$09d9badaa8903929$exports = JSON.parse("{\"calendar\":\"Календар\",\"day\":\"ден\",\"dayPeriod\":\"пр.об./сл.об.\",\"endDate\":\"Крайна дата\",\"era\":\"ера\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месец\",\"second\":\"секунда\",\"selectedDateDescription\":\"Избрана дата: {date}\",\"selectedRangeDescription\":\"Избран диапазон: {startDate} до {endDate}\",\"selectedTimeDescription\":\"Избрано време: {time}\",\"startDate\":\"Начална дата\",\"timeZoneName\":\"часова зона\",\"weekday\":\"ден от седмицата\",\"year\":\"година\"}");
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
var $151b77e0fd711730$exports = {};
|
|
28
|
-
$151b77e0fd711730$exports = JSON.parse("{\"calendar\":\"Kalendář\",\"
|
|
28
|
+
$151b77e0fd711730$exports = JSON.parse("{\"calendar\":\"Kalendář\",\"day\":\"den\",\"dayPeriod\":\"část dne\",\"endDate\":\"Konečné datum\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minuta\",\"month\":\"měsíc\",\"second\":\"sekunda\",\"selectedDateDescription\":\"Vybrané datum: {date}\",\"selectedRangeDescription\":\"Vybrané období: {startDate} až {endDate}\",\"selectedTimeDescription\":\"Vybraný čas: {time}\",\"startDate\":\"Počáteční datum\",\"timeZoneName\":\"časové pásmo\",\"weekday\":\"den v týdnu\",\"year\":\"rok\"}");
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var $61915aa8630b90a2$exports = {};
|
|
32
|
-
$61915aa8630b90a2$exports = JSON.parse("{\"calendar\":\"Kalender\",\"
|
|
32
|
+
$61915aa8630b90a2$exports = JSON.parse("{\"calendar\":\"Kalender\",\"day\":\"dag\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Slutdato\",\"era\":\"æra\",\"hour\":\"time\",\"minute\":\"minut\",\"month\":\"måned\",\"second\":\"sekund\",\"selectedDateDescription\":\"Valgt dato: {date}\",\"selectedRangeDescription\":\"Valgt interval: {startDate} til {endDate}\",\"selectedTimeDescription\":\"Valgt tidspunkt: {time}\",\"startDate\":\"Startdato\",\"timeZoneName\":\"tidszone\",\"weekday\":\"ugedag\",\"year\":\"år\"}");
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var $35cea00159787840$exports = {};
|
|
36
|
-
$35cea00159787840$exports = JSON.parse("{\"calendar\":\"Kalender\",\"
|
|
36
|
+
$35cea00159787840$exports = JSON.parse("{\"calendar\":\"Kalender\",\"day\":\"Tag\",\"dayPeriod\":\"Tageshälfte\",\"endDate\":\"Enddatum\",\"era\":\"Epoche\",\"hour\":\"Stunde\",\"minute\":\"Minute\",\"month\":\"Monat\",\"second\":\"Sekunde\",\"selectedDateDescription\":\"Ausgewähltes Datum: {date}\",\"selectedRangeDescription\":\"Ausgewählter Bereich: {startDate} bis {endDate}\",\"selectedTimeDescription\":\"Ausgewählte Zeit: {time}\",\"startDate\":\"Anfangsdatum\",\"timeZoneName\":\"Zeitzone\",\"weekday\":\"Wochentag\",\"year\":\"Jahr\"}");
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
var $518b4e82b9eacafd$exports = {};
|
|
40
|
-
$518b4e82b9eacafd$exports = JSON.parse("{\"calendar\":\"Ημερολόγιο\",\"
|
|
40
|
+
$518b4e82b9eacafd$exports = JSON.parse("{\"calendar\":\"Ημερολόγιο\",\"day\":\"ημέρα\",\"dayPeriod\":\"π.μ./μ.μ.\",\"endDate\":\"Ημερομηνία λήξης\",\"era\":\"περίοδος\",\"hour\":\"ώρα\",\"minute\":\"λεπτό\",\"month\":\"μήνας\",\"second\":\"δευτερόλεπτο\",\"selectedDateDescription\":\"Επιλεγμένη ημερομηνία: {date}\",\"selectedRangeDescription\":\"Επιλεγμένο εύρος: {startDate} έως {endDate}\",\"selectedTimeDescription\":\"Επιλεγμένη ώρα: {time}\",\"startDate\":\"Ημερομηνία έναρξης\",\"timeZoneName\":\"ζώνη ώρας\",\"weekday\":\"καθημερινή\",\"year\":\"έτος\"}");
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
var $1c2b297f7e2cf474$exports = {};
|
|
44
|
-
$1c2b297f7e2cf474$exports = JSON.parse("{\"era\":\"era\",\"year\":\"year\",\"month\":\"month\",\"day\":\"day\",\"hour\":\"hour\",\"minute\":\"minute\",\"second\":\"second\",\"dayPeriod\":\"AM/PM\",\"calendar\":\"Calendar\",\"
|
|
44
|
+
$1c2b297f7e2cf474$exports = JSON.parse("{\"era\":\"era\",\"year\":\"year\",\"month\":\"month\",\"day\":\"day\",\"hour\":\"hour\",\"minute\":\"minute\",\"second\":\"second\",\"dayPeriod\":\"AM/PM\",\"calendar\":\"Calendar\",\"startDate\":\"Start Date\",\"endDate\":\"End Date\",\"weekday\":\"day of the week\",\"timeZoneName\":\"time zone\",\"selectedDateDescription\":\"Selected Date: {date}\",\"selectedRangeDescription\":\"Selected Range: {startDate} to {endDate}\",\"selectedTimeDescription\":\"Selected Time: {time}\"}");
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
var $07f628a707cf9b18$exports = {};
|
|
48
|
-
$07f628a707cf9b18$exports = JSON.parse("{\"calendar\":\"Calendario\",\"
|
|
48
|
+
$07f628a707cf9b18$exports = JSON.parse("{\"calendar\":\"Calendario\",\"day\":\"día\",\"dayPeriod\":\"a. m./p. m.\",\"endDate\":\"Fecha final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mes\",\"second\":\"segundo\",\"selectedDateDescription\":\"Fecha seleccionada: {date}\",\"selectedRangeDescription\":\"Rango seleccionado: {startDate} a {endDate}\",\"selectedTimeDescription\":\"Hora seleccionada: {time}\",\"startDate\":\"Fecha de inicio\",\"timeZoneName\":\"zona horaria\",\"weekday\":\"día de la semana\",\"year\":\"año\"}");
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var $db553ffe17c7f4db$exports = {};
|
|
52
|
-
$db553ffe17c7f4db$exports = JSON.parse("{\"calendar\":\"Kalender\",\"
|
|
52
|
+
$db553ffe17c7f4db$exports = JSON.parse("{\"calendar\":\"Kalender\",\"day\":\"päev\",\"dayPeriod\":\"enne/pärast lõunat\",\"endDate\":\"Lõppkuupäev\",\"era\":\"ajastu\",\"hour\":\"tund\",\"minute\":\"minut\",\"month\":\"kuu\",\"second\":\"sekund\",\"selectedDateDescription\":\"Valitud kuupäev: {date}\",\"selectedRangeDescription\":\"Valitud vahemik: {startDate} kuni {endDate}\",\"selectedTimeDescription\":\"Valitud aeg: {time}\",\"startDate\":\"Alguskuupäev\",\"timeZoneName\":\"ajavöönd\",\"weekday\":\"nädalapäev\",\"year\":\"aasta\"}");
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
var $4afcfe00cd703f83$exports = {};
|
|
56
|
-
$4afcfe00cd703f83$exports = JSON.parse("{\"calendar\":\"Kalenteri\",\"
|
|
56
|
+
$4afcfe00cd703f83$exports = JSON.parse("{\"calendar\":\"Kalenteri\",\"day\":\"päivä\",\"dayPeriod\":\"vuorokaudenaika\",\"endDate\":\"Päättymispäivä\",\"era\":\"aikakausi\",\"hour\":\"tunti\",\"minute\":\"minuutti\",\"month\":\"kuukausi\",\"second\":\"sekunti\",\"selectedDateDescription\":\"Valittu päivämäärä: {date}\",\"selectedRangeDescription\":\"Valittu aikaväli: {startDate} – {endDate}\",\"selectedTimeDescription\":\"Valittu aika: {time}\",\"startDate\":\"Alkamispäivä\",\"timeZoneName\":\"aikavyöhyke\",\"weekday\":\"viikonpäivä\",\"year\":\"vuosi\"}");
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
var $1d2645d18d4c5be0$exports = {};
|
|
60
|
-
$1d2645d18d4c5be0$exports = JSON.parse("{\"calendar\":\"Calendrier\",\"
|
|
60
|
+
$1d2645d18d4c5be0$exports = JSON.parse("{\"calendar\":\"Calendrier\",\"day\":\"jour\",\"dayPeriod\":\"cadran\",\"endDate\":\"Date de fin\",\"era\":\"ère\",\"hour\":\"heure\",\"minute\":\"minute\",\"month\":\"mois\",\"second\":\"seconde\",\"selectedDateDescription\":\"Date sélectionnée : {date}\",\"selectedRangeDescription\":\"Plage sélectionnée : {startDate} au {endDate}\",\"selectedTimeDescription\":\"Heure choisie : {time}\",\"startDate\":\"Date de début\",\"timeZoneName\":\"fuseau horaire\",\"weekday\":\"jour de la semaine\",\"year\":\"année\"}");
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
var $64cb6a9be1f6fa48$exports = {};
|
|
64
|
-
$64cb6a9be1f6fa48$exports = JSON.parse("{\"calendar\":\"לוח שנה\",\"
|
|
64
|
+
$64cb6a9be1f6fa48$exports = JSON.parse("{\"calendar\":\"לוח שנה\",\"day\":\"יום\",\"dayPeriod\":\"לפנה״צ/אחה״צ\",\"endDate\":\"תאריך סיום\",\"era\":\"תקופה\",\"hour\":\"שעה\",\"minute\":\"דקה\",\"month\":\"חודש\",\"second\":\"שנייה\",\"selectedDateDescription\":\"תאריך נבחר: {date}\",\"selectedRangeDescription\":\"טווח נבחר: {startDate} עד {endDate}\",\"selectedTimeDescription\":\"זמן נבחר: {time}\",\"startDate\":\"תאריך התחלה\",\"timeZoneName\":\"אזור זמן\",\"weekday\":\"יום בשבוע\",\"year\":\"שנה\"}");
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
var $2a1ef2e8050be27a$exports = {};
|
|
68
|
-
$2a1ef2e8050be27a$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"
|
|
68
|
+
$2a1ef2e8050be27a$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"day\":\"dan\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Datum završetka\",\"era\":\"era\",\"hour\":\"sat\",\"minute\":\"minuta\",\"month\":\"mjesec\",\"second\":\"sekunda\",\"selectedDateDescription\":\"Odabrani datum: {date}\",\"selectedRangeDescription\":\"Odabrani raspon: {startDate} do {endDate}\",\"selectedTimeDescription\":\"Odabrano vrijeme: {time}\",\"startDate\":\"Datum početka\",\"timeZoneName\":\"vremenska zona\",\"weekday\":\"dan u tjednu\",\"year\":\"godina\"}");
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
var $ad429dca102acd0e$exports = {};
|
|
72
|
-
$ad429dca102acd0e$exports = JSON.parse("{\"calendar\":\"Naptár\",\"
|
|
72
|
+
$ad429dca102acd0e$exports = JSON.parse("{\"calendar\":\"Naptár\",\"day\":\"nap\",\"dayPeriod\":\"napszak\",\"endDate\":\"Befejező dátum\",\"era\":\"éra\",\"hour\":\"óra\",\"minute\":\"perc\",\"month\":\"hónap\",\"second\":\"másodperc\",\"selectedDateDescription\":\"Kijelölt dátum: {date}\",\"selectedRangeDescription\":\"Kijelölt tartomány: {startDate}–{endDate}\",\"selectedTimeDescription\":\"Kijelölt idő: {time}\",\"startDate\":\"Kezdő dátum\",\"timeZoneName\":\"időzóna\",\"weekday\":\"hét napja\",\"year\":\"év\"}");
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
var $6e68cb5d1cb97bd2$exports = {};
|
|
76
|
-
$6e68cb5d1cb97bd2$exports = JSON.parse("{\"calendar\":\"Calendario\",\"
|
|
76
|
+
$6e68cb5d1cb97bd2$exports = JSON.parse("{\"calendar\":\"Calendario\",\"day\":\"giorno\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data finale\",\"era\":\"era\",\"hour\":\"ora\",\"minute\":\"minuto\",\"month\":\"mese\",\"second\":\"secondo\",\"selectedDateDescription\":\"Data selezionata: {date}\",\"selectedRangeDescription\":\"Intervallo selezionato: da {startDate} a {endDate}\",\"selectedTimeDescription\":\"Ora selezionata: {time}\",\"startDate\":\"Data iniziale\",\"timeZoneName\":\"fuso orario\",\"weekday\":\"giorno della settimana\",\"year\":\"anno\"}");
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
var $a82ee9af063ee069$exports = {};
|
|
80
|
-
$a82ee9af063ee069$exports = JSON.parse("{\"calendar\":\"カレンダー\",\"
|
|
80
|
+
$a82ee9af063ee069$exports = JSON.parse("{\"calendar\":\"カレンダー\",\"day\":\"日\",\"dayPeriod\":\"午前/午後\",\"endDate\":\"終了日\",\"era\":\"時代\",\"hour\":\"時\",\"minute\":\"分\",\"month\":\"月\",\"second\":\"秒\",\"selectedDateDescription\":\"選択した日付 : {date}\",\"selectedRangeDescription\":\"選択範囲 : {startDate} から {endDate}\",\"selectedTimeDescription\":\"選択した時間 : {time}\",\"startDate\":\"開始日\",\"timeZoneName\":\"タイムゾーン\",\"weekday\":\"曜日\",\"year\":\"年\"}");
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
var $67e9091dbf37d4eb$exports = {};
|
|
84
|
-
$67e9091dbf37d4eb$exports = JSON.parse("{\"calendar\":\"달력\",\"
|
|
84
|
+
$67e9091dbf37d4eb$exports = JSON.parse("{\"calendar\":\"달력\",\"day\":\"일\",\"dayPeriod\":\"오전/오후\",\"endDate\":\"종료 날짜\",\"era\":\"연호\",\"hour\":\"시\",\"minute\":\"분\",\"month\":\"월\",\"second\":\"초\",\"selectedDateDescription\":\"선택 일자: {date}\",\"selectedRangeDescription\":\"선택 범위: {startDate} ~ {endDate}\",\"selectedTimeDescription\":\"선택 시간: {time}\",\"startDate\":\"시작 날짜\",\"timeZoneName\":\"시간대\",\"weekday\":\"요일\",\"year\":\"년\"}");
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
var $75834f9729f653d1$exports = {};
|
|
88
|
-
$75834f9729f653d1$exports = JSON.parse("{\"calendar\":\"Kalendorius\",\"
|
|
88
|
+
$75834f9729f653d1$exports = JSON.parse("{\"calendar\":\"Kalendorius\",\"day\":\"diena\",\"dayPeriod\":\"iki pietų / po pietų\",\"endDate\":\"Pabaigos data\",\"era\":\"era\",\"hour\":\"valanda\",\"minute\":\"minutė\",\"month\":\"mėnuo\",\"second\":\"sekundė\",\"selectedDateDescription\":\"Pasirinkta data: {date}\",\"selectedRangeDescription\":\"Pasirinktas intervalas: nuo {startDate} iki {endDate}\",\"selectedTimeDescription\":\"Pasirinktas laikas: {time}\",\"startDate\":\"Pradžios data\",\"timeZoneName\":\"laiko juosta\",\"weekday\":\"savaitės diena\",\"year\":\"metai\"}");
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
var $a2df2c2520b4a7f0$exports = {};
|
|
92
|
-
$a2df2c2520b4a7f0$exports = JSON.parse("{\"calendar\":\"Kalendārs\",\"
|
|
92
|
+
$a2df2c2520b4a7f0$exports = JSON.parse("{\"calendar\":\"Kalendārs\",\"day\":\"diena\",\"dayPeriod\":\"priekšpusdienā/pēcpusdienā\",\"endDate\":\"Beigu datums\",\"era\":\"ēra\",\"hour\":\"stundas\",\"minute\":\"minūtes\",\"month\":\"mēnesis\",\"second\":\"sekundes\",\"selectedDateDescription\":\"Atlasītais datums: {date}\",\"selectedRangeDescription\":\"Atlasītais diapazons: no {startDate} līdz {endDate}\",\"selectedTimeDescription\":\"Atlasītais laiks: {time}\",\"startDate\":\"Sākuma datums\",\"timeZoneName\":\"laika josla\",\"weekday\":\"nedēļas diena\",\"year\":\"gads\"}");
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
var $aedcd71db4933ed5$exports = {};
|
|
96
|
-
$aedcd71db4933ed5$exports = JSON.parse("{\"calendar\":\"Kalender\",\"
|
|
96
|
+
$aedcd71db4933ed5$exports = JSON.parse("{\"calendar\":\"Kalender\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Sluttdato\",\"era\":\"tidsalder\",\"hour\":\"time\",\"minute\":\"minutt\",\"month\":\"måned\",\"second\":\"sekund\",\"selectedDateDescription\":\"Valgt dato: {date}\",\"selectedRangeDescription\":\"Valgt område: {startDate} til {endDate}\",\"selectedTimeDescription\":\"Valgt tid: {time}\",\"startDate\":\"Startdato\",\"timeZoneName\":\"tidssone\",\"weekday\":\"ukedag\",\"year\":\"år\"}");
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
var $3b2df9e54353046c$exports = {};
|
|
100
|
-
$3b2df9e54353046c$exports = JSON.parse("{\"calendar\":\"Kalender\",\"
|
|
100
|
+
$3b2df9e54353046c$exports = JSON.parse("{\"calendar\":\"Kalender\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Einddatum\",\"era\":\"tijdperk\",\"hour\":\"uur\",\"minute\":\"minuut\",\"month\":\"maand\",\"second\":\"seconde\",\"selectedDateDescription\":\"Geselecteerde datum: {date}\",\"selectedRangeDescription\":\"Geselecteerd bereik: {startDate} tot {endDate}\",\"selectedTimeDescription\":\"Geselecteerde tijd: {time}\",\"startDate\":\"Startdatum\",\"timeZoneName\":\"tijdzone\",\"weekday\":\"dag van de week\",\"year\":\"jaar\"}");
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
var $c03fe977fcfafe93$exports = {};
|
|
104
|
-
$c03fe977fcfafe93$exports = JSON.parse("{\"calendar\":\"Kalendarz\",\"
|
|
104
|
+
$c03fe977fcfafe93$exports = JSON.parse("{\"calendar\":\"Kalendarz\",\"day\":\"dzień\",\"dayPeriod\":\"rano / po południu / wieczorem\",\"endDate\":\"Data końcowa\",\"era\":\"era\",\"hour\":\"godzina\",\"minute\":\"minuta\",\"month\":\"miesiąc\",\"second\":\"sekunda\",\"selectedDateDescription\":\"Wybrana data: {date}\",\"selectedRangeDescription\":\"Wybrany zakres: {startDate} do {endDate}\",\"selectedTimeDescription\":\"Wybrany czas: {time}\",\"startDate\":\"Data początkowa\",\"timeZoneName\":\"strefa czasowa\",\"weekday\":\"dzień tygodnia\",\"year\":\"rok\"}");
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
var $569f006fc292345f$exports = {};
|
|
108
|
-
$569f006fc292345f$exports = JSON.parse("{\"calendar\":\"Calendário\",\"
|
|
108
|
+
$569f006fc292345f$exports = JSON.parse("{\"calendar\":\"Calendário\",\"day\":\"dia\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"selectedDateDescription\":\"Data selecionada: {date}\",\"selectedRangeDescription\":\"Intervalo selecionado: {startDate} a {endDate}\",\"selectedTimeDescription\":\"Hora selecionada: {time}\",\"startDate\":\"Data inicial\",\"timeZoneName\":\"fuso horário\",\"weekday\":\"dia da semana\",\"year\":\"ano\"}");
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
var $7c2494e14452f2dd$exports = {};
|
|
112
|
-
$7c2494e14452f2dd$exports = JSON.parse("{\"calendar\":\"Calendário\",\"
|
|
112
|
+
$7c2494e14452f2dd$exports = JSON.parse("{\"calendar\":\"Calendário\",\"day\":\"dia\",\"dayPeriod\":\"am/pm\",\"endDate\":\"Data de Término\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"selectedDateDescription\":\"Data selecionada: {date}\",\"selectedRangeDescription\":\"Intervalo selecionado: {startDate} a {endDate}\",\"selectedTimeDescription\":\"Hora selecionada: {time}\",\"startDate\":\"Data de Início\",\"timeZoneName\":\"fuso horário\",\"weekday\":\"dia da semana\",\"year\":\"ano\"}");
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
var $eb82ef981b5592bf$exports = {};
|
|
116
|
-
$eb82ef981b5592bf$exports = JSON.parse("{\"calendar\":\"Calendar\",\"
|
|
116
|
+
$eb82ef981b5592bf$exports = JSON.parse("{\"calendar\":\"Calendar\",\"day\":\"zi\",\"dayPeriod\":\"a.m/p.m.\",\"endDate\":\"Dată final\",\"era\":\"eră\",\"hour\":\"oră\",\"minute\":\"minut\",\"month\":\"lună\",\"second\":\"secundă\",\"selectedDateDescription\":\"Dată selectată: {date}\",\"selectedRangeDescription\":\"Interval selectat: de la {startDate} până la {endDate}\",\"selectedTimeDescription\":\"Ora selectată: {time}\",\"startDate\":\"Dată început\",\"timeZoneName\":\"fus orar\",\"weekday\":\"ziua din săptămână\",\"year\":\"an\"}");
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
var $6efa0e119f396950$exports = {};
|
|
120
|
-
$6efa0e119f396950$exports = JSON.parse("{\"calendar\":\"Календарь\",\"
|
|
120
|
+
$6efa0e119f396950$exports = JSON.parse("{\"calendar\":\"Календарь\",\"day\":\"день\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Дата окончания\",\"era\":\"эра\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месяц\",\"second\":\"секунда\",\"selectedDateDescription\":\"Выбранная дата: {date}\",\"selectedRangeDescription\":\"Выбранный диапазон: с {startDate} по {endDate}\",\"selectedTimeDescription\":\"Выбранное время: {time}\",\"startDate\":\"Дата начала\",\"timeZoneName\":\"часовой пояс\",\"weekday\":\"день недели\",\"year\":\"год\"}");
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
var $7f5e57085d7f5049$exports = {};
|
|
124
|
-
$7f5e57085d7f5049$exports = JSON.parse("{\"calendar\":\"Kalendár\",\"
|
|
124
|
+
$7f5e57085d7f5049$exports = JSON.parse("{\"calendar\":\"Kalendár\",\"day\":\"deň\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Dátum ukončenia\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minúta\",\"month\":\"mesiac\",\"second\":\"sekunda\",\"selectedDateDescription\":\"Vybratý dátum: {date}\",\"selectedRangeDescription\":\"Vybratý rozsah: od {startDate} do {endDate}\",\"selectedTimeDescription\":\"Vybratý čas: {time}\",\"startDate\":\"Dátum začatia\",\"timeZoneName\":\"časové pásmo\",\"weekday\":\"deň týždňa\",\"year\":\"rok\"}");
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
var $578ee7c11dcdde7a$exports = {};
|
|
128
|
-
$578ee7c11dcdde7a$exports = JSON.parse("{\"calendar\":\"Koledar\",\"
|
|
128
|
+
$578ee7c11dcdde7a$exports = JSON.parse("{\"calendar\":\"Koledar\",\"day\":\"dan\",\"dayPeriod\":\"dop/pop\",\"endDate\":\"Datum konca\",\"era\":\"doba\",\"hour\":\"ura\",\"minute\":\"minuta\",\"month\":\"mesec\",\"second\":\"sekunda\",\"selectedDateDescription\":\"Izbrani datum: {date}\",\"selectedRangeDescription\":\"Izbrano območje: {startDate} do {endDate}\",\"selectedTimeDescription\":\"Izbrani čas: {time}\",\"startDate\":\"Datum začetka\",\"timeZoneName\":\"časovni pas\",\"weekday\":\"dan v tednu\",\"year\":\"leto\"}");
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
var $bbc3fd6cd0bc9d50$exports = {};
|
|
132
|
-
$bbc3fd6cd0bc9d50$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"
|
|
132
|
+
$bbc3fd6cd0bc9d50$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"day\":\"дан\",\"dayPeriod\":\"пре подне/по подне\",\"endDate\":\"Datum završetka\",\"era\":\"ера\",\"hour\":\"сат\",\"minute\":\"минут\",\"month\":\"месец\",\"second\":\"секунд\",\"selectedDateDescription\":\"Izabrani datum: {date}\",\"selectedRangeDescription\":\"Izabrani opseg: od {startDate} do {endDate}\",\"selectedTimeDescription\":\"Izabrano vreme: {time}\",\"startDate\":\"Datum početka\",\"timeZoneName\":\"временска зона\",\"weekday\":\"дан у недељи\",\"year\":\"година\"}");
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
var $0b04512118591d2a$exports = {};
|
|
136
|
-
$0b04512118591d2a$exports = JSON.parse("{\"calendar\":\"Kalender\",\"
|
|
136
|
+
$0b04512118591d2a$exports = JSON.parse("{\"calendar\":\"Kalender\",\"day\":\"dag\",\"dayPeriod\":\"fm/em\",\"endDate\":\"Slutdatum\",\"era\":\"era\",\"hour\":\"timme\",\"minute\":\"minut\",\"month\":\"månad\",\"second\":\"sekund\",\"selectedDateDescription\":\"Valt datum: {date}\",\"selectedRangeDescription\":\"Valt intervall: {startDate} till {endDate}\",\"selectedTimeDescription\":\"Vald tid: {time}\",\"startDate\":\"Startdatum\",\"timeZoneName\":\"tidszon\",\"weekday\":\"veckodag\",\"year\":\"år\"}");
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
var $3a49d121fe4c9e1d$exports = {};
|
|
140
|
-
$3a49d121fe4c9e1d$exports = JSON.parse("{\"calendar\":\"Takvim\",\"
|
|
140
|
+
$3a49d121fe4c9e1d$exports = JSON.parse("{\"calendar\":\"Takvim\",\"day\":\"gün\",\"dayPeriod\":\"ÖÖ/ÖS\",\"endDate\":\"Bitiş Tarihi\",\"era\":\"çağ\",\"hour\":\"saat\",\"minute\":\"dakika\",\"month\":\"ay\",\"second\":\"saniye\",\"selectedDateDescription\":\"Seçilen Tarih: {date}\",\"selectedRangeDescription\":\"Seçilen Aralık: {startDate} - {endDate}\",\"selectedTimeDescription\":\"Seçilen Zaman: {time}\",\"startDate\":\"Başlangıç Tarihi\",\"timeZoneName\":\"saat dilimi\",\"weekday\":\"haftanın günü\",\"year\":\"yıl\"}");
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
var $5ba21dbb8914919d$exports = {};
|
|
144
|
-
$5ba21dbb8914919d$exports = JSON.parse("{\"calendar\":\"Календар\",\"
|
|
144
|
+
$5ba21dbb8914919d$exports = JSON.parse("{\"calendar\":\"Календар\",\"day\":\"день\",\"dayPeriod\":\"дп/пп\",\"endDate\":\"Дата завершення\",\"era\":\"ера\",\"hour\":\"година\",\"minute\":\"хвилина\",\"month\":\"місяць\",\"second\":\"секунда\",\"selectedDateDescription\":\"Вибрана дата: {date}\",\"selectedRangeDescription\":\"Вибраний діапазон: {startDate} — {endDate}\",\"selectedTimeDescription\":\"Вибраний час: {time}\",\"startDate\":\"Дата початку\",\"timeZoneName\":\"часовий пояс\",\"weekday\":\"день тижня\",\"year\":\"рік\"}");
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
var $51078838e1b16cd7$exports = {};
|
|
148
|
-
$51078838e1b16cd7$exports = JSON.parse("{\"calendar\":\"日历\",\"
|
|
148
|
+
$51078838e1b16cd7$exports = JSON.parse("{\"calendar\":\"日历\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"结束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"selectedDateDescription\":\"选定的日期:{date}\",\"selectedRangeDescription\":\"选定的范围:{startDate} 至 {endDate}\",\"selectedTimeDescription\":\"选定的时间:{time}\",\"startDate\":\"开始日期\",\"timeZoneName\":\"时区\",\"weekday\":\"工作日\",\"year\":\"年\"}");
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
var $33fab8219207655a$exports = {};
|
|
152
|
-
$33fab8219207655a$exports = JSON.parse("{\"calendar\":\"日曆\",\"
|
|
152
|
+
$33fab8219207655a$exports = JSON.parse("{\"calendar\":\"日曆\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"結束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"selectedDateDescription\":\"選定的日期:{date}\",\"selectedRangeDescription\":\"選定的範圍:{startDate} 至 {endDate}\",\"selectedTimeDescription\":\"選定的時間:{time}\",\"startDate\":\"開始日期\",\"timeZoneName\":\"时区\",\"weekday\":\"工作日\",\"year\":\"年\"}");
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
$204383cf4f6b0d06$exports = {
|
|
@@ -197,7 +197,14 @@ $204383cf4f6b0d06$exports = {
|
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref1, disableArrowNavigation) {
|
|
203
|
+
let { direction: direction } = $cIPI0$useLocale();
|
|
204
|
+
let focusManager = $cIPI0$useMemo(()=>$cIPI0$createFocusManager(ref1)
|
|
205
|
+
, [
|
|
206
|
+
ref1
|
|
207
|
+
]);
|
|
201
208
|
// Open the popover on alt + arrow down
|
|
202
209
|
let onKeyDown = (e)=>{
|
|
203
210
|
if (e.altKey && (e.key === 'ArrowDown' || e.key === 'ArrowUp') && 'setOpen' in state) {
|
|
@@ -205,6 +212,21 @@ function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref1) {
|
|
|
205
212
|
e.stopPropagation();
|
|
206
213
|
state.setOpen(true);
|
|
207
214
|
}
|
|
215
|
+
if (disableArrowNavigation) return;
|
|
216
|
+
switch(e.key){
|
|
217
|
+
case 'ArrowLeft':
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
e.stopPropagation();
|
|
220
|
+
if (direction === 'rtl') focusManager.focusNext();
|
|
221
|
+
else focusManager.focusPrevious();
|
|
222
|
+
break;
|
|
223
|
+
case 'ArrowRight':
|
|
224
|
+
e.preventDefault();
|
|
225
|
+
e.stopPropagation();
|
|
226
|
+
if (direction === 'rtl') focusManager.focusPrevious();
|
|
227
|
+
else focusManager.focusNext();
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
208
230
|
};
|
|
209
231
|
// Focus the first placeholder segment from the end on mouse down/touch up in the field.
|
|
210
232
|
let focusLast = ()=>{
|
|
@@ -227,9 +249,9 @@ function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref1) {
|
|
|
227
249
|
}while (last)
|
|
228
250
|
}
|
|
229
251
|
// Now go backwards until we find an element that is not a placeholder.
|
|
230
|
-
while(target === null || target === void 0 ? void 0 : target.
|
|
252
|
+
while(target === null || target === void 0 ? void 0 : target.hasAttribute('data-placeholder')){
|
|
231
253
|
let prev = walker.previousNode();
|
|
232
|
-
if (prev && prev.
|
|
254
|
+
if (prev && prev.hasAttribute('data-placeholder')) target = prev;
|
|
233
255
|
else break;
|
|
234
256
|
}
|
|
235
257
|
if (target) target.focus();
|
|
@@ -250,6 +272,7 @@ function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref1) {
|
|
|
250
272
|
|
|
251
273
|
|
|
252
274
|
|
|
275
|
+
|
|
253
276
|
const $16f0b7bb276bc17e$export$653eddfc964b0f8a = new WeakMap();
|
|
254
277
|
const $16f0b7bb276bc17e$export$300019f83c56d282 = '__role_' + Date.now();
|
|
255
278
|
const $16f0b7bb276bc17e$export$7b3062cd49e80452 = '__focusManager_' + Date.now();
|
|
@@ -258,15 +281,20 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
258
281
|
...props,
|
|
259
282
|
labelElementType: 'span'
|
|
260
283
|
});
|
|
261
|
-
let groupProps = $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref);
|
|
262
284
|
let { focusWithinProps: focusWithinProps } = $cIPI0$useFocusWithin({
|
|
263
285
|
onBlurWithin () {
|
|
264
286
|
state.confirmPlaceholder();
|
|
265
287
|
}
|
|
266
288
|
});
|
|
267
|
-
let
|
|
268
|
-
|
|
269
|
-
|
|
289
|
+
let formatMessage = $cIPI0$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($204383cf4f6b0d06$exports)));
|
|
290
|
+
let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
|
|
291
|
+
let field = state.maxGranularity === 'hour' ? 'time' : 'date';
|
|
292
|
+
let description = state.value ? formatMessage(message, {
|
|
293
|
+
[field]: state.formatValue({
|
|
294
|
+
month: 'long'
|
|
295
|
+
})
|
|
296
|
+
}) : '';
|
|
297
|
+
let descProps = $cIPI0$useDescription(description);
|
|
270
298
|
// If within a date picker or date range picker, the date field will have role="presentation" and an aria-describedby
|
|
271
299
|
// will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.
|
|
272
300
|
let describedBy = props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation' ? fieldProps['aria-describedby'] : [
|
|
@@ -279,6 +307,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
279
307
|
propsFocusManager,
|
|
280
308
|
ref
|
|
281
309
|
]);
|
|
310
|
+
let groupProps = $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref, props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation');
|
|
282
311
|
// Pass labels and other information to segments.
|
|
283
312
|
$16f0b7bb276bc17e$export$653eddfc964b0f8a.set(state, {
|
|
284
313
|
ariaLabel: props['aria-label'],
|
|
@@ -309,6 +338,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
309
338
|
}, [
|
|
310
339
|
focusManager
|
|
311
340
|
]);
|
|
341
|
+
let domProps = $cIPI0$filterDOMProps(props);
|
|
312
342
|
return {
|
|
313
343
|
labelProps: {
|
|
314
344
|
...labelProps,
|
|
@@ -316,7 +346,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
316
346
|
focusManager.focusFirst();
|
|
317
347
|
}
|
|
318
348
|
},
|
|
319
|
-
fieldProps: $cIPI0$mergeProps(fieldDOMProps, groupProps, focusWithinProps),
|
|
349
|
+
fieldProps: $cIPI0$mergeProps(domProps, fieldDOMProps, groupProps, focusWithinProps),
|
|
320
350
|
descriptionProps: descriptionProps,
|
|
321
351
|
errorMessageProps: errorMessageProps
|
|
322
352
|
};
|
|
@@ -340,15 +370,24 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
340
370
|
let groupProps = $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref);
|
|
341
371
|
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id;
|
|
342
372
|
let { locale: locale } = $cIPI0$useLocale();
|
|
343
|
-
let
|
|
373
|
+
let date = state.formatValue(locale, {
|
|
344
374
|
month: 'long'
|
|
345
|
-
})
|
|
375
|
+
});
|
|
376
|
+
let description = date ? formatMessage('selectedDateDescription', {
|
|
377
|
+
date: date
|
|
378
|
+
}) : '';
|
|
379
|
+
let descProps = $cIPI0$useDescription(description);
|
|
346
380
|
let ariaDescribedBy = [
|
|
347
381
|
descProps['aria-describedby'],
|
|
348
382
|
fieldProps['aria-describedby']
|
|
349
383
|
].filter(Boolean).join(' ') || undefined;
|
|
384
|
+
let domProps = $cIPI0$filterDOMProps(props);
|
|
385
|
+
let focusManager = $cIPI0$useMemo(()=>$cIPI0$createFocusManager(ref)
|
|
386
|
+
, [
|
|
387
|
+
ref
|
|
388
|
+
]);
|
|
350
389
|
return {
|
|
351
|
-
groupProps: $cIPI0$mergeProps(groupProps, fieldProps, descProps, {
|
|
390
|
+
groupProps: $cIPI0$mergeProps(domProps, groupProps, fieldProps, descProps, {
|
|
352
391
|
role: 'group',
|
|
353
392
|
'aria-disabled': props.isDisabled || null,
|
|
354
393
|
'aria-labelledby': labelledBy,
|
|
@@ -357,7 +396,6 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
357
396
|
labelProps: {
|
|
358
397
|
...labelProps,
|
|
359
398
|
onClick: ()=>{
|
|
360
|
-
let focusManager = $cIPI0$createFocusManager(ref);
|
|
361
399
|
focusManager.focusFirst();
|
|
362
400
|
}
|
|
363
401
|
},
|
|
@@ -384,7 +422,6 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
384
422
|
buttonProps: {
|
|
385
423
|
...descProps,
|
|
386
424
|
id: buttonId,
|
|
387
|
-
excludeFromTabOrder: true,
|
|
388
425
|
'aria-haspopup': 'dialog',
|
|
389
426
|
'aria-label': formatMessage('calendar'),
|
|
390
427
|
'aria-labelledby': `${labelledBy} ${buttonId}`,
|
|
@@ -404,7 +441,9 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
404
441
|
isDisabled: props.isDisabled,
|
|
405
442
|
isReadOnly: props.isReadOnly,
|
|
406
443
|
isDateUnavailable: props.isDateUnavailable,
|
|
407
|
-
defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue
|
|
444
|
+
defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue,
|
|
445
|
+
validationState: state.validationState,
|
|
446
|
+
errorMessage: props.errorMessage
|
|
408
447
|
}
|
|
409
448
|
};
|
|
410
449
|
}
|
|
@@ -415,9 +454,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
415
454
|
|
|
416
455
|
|
|
417
456
|
|
|
418
|
-
var $3aeceb3a64eb8358$exports = {};
|
|
419
457
|
|
|
420
|
-
$parcel$export($3aeceb3a64eb8358$exports, "useDisplayNames", () => $3aeceb3a64eb8358$export$d42c60378c8168f8);
|
|
421
458
|
|
|
422
459
|
|
|
423
460
|
|
|
@@ -451,13 +488,12 @@ class $3aeceb3a64eb8358$var$DisplayNamesPolyfill {
|
|
|
451
488
|
|
|
452
489
|
|
|
453
490
|
|
|
454
|
-
|
|
455
491
|
function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
456
492
|
let enteredKeys = $cIPI0$useRef('');
|
|
457
|
-
let { locale: locale
|
|
493
|
+
let { locale: locale } = $cIPI0$useLocale();
|
|
458
494
|
let displayNames = $3aeceb3a64eb8358$export$d42c60378c8168f8();
|
|
459
495
|
let { ariaLabel: ariaLabel , ariaLabelledBy: ariaLabelledBy , ariaDescribedBy: ariaDescribedBy , focusManager: focusManager } = $16f0b7bb276bc17e$export$653eddfc964b0f8a.get(state);
|
|
460
|
-
let textValue = segment.text;
|
|
496
|
+
let textValue = segment.isPlaceholder ? '' : segment.text;
|
|
461
497
|
let options = $cIPI0$useMemo(()=>state.dateFormatter.resolvedOptions()
|
|
462
498
|
, [
|
|
463
499
|
state.dateFormatter
|
|
@@ -471,11 +507,14 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
471
507
|
hour12: options.hour12,
|
|
472
508
|
timeZone: options.timeZone
|
|
473
509
|
});
|
|
474
|
-
if (segment.type === 'month') {
|
|
510
|
+
if (segment.type === 'month' && !segment.isPlaceholder) {
|
|
475
511
|
let monthTextValue = monthDateFormatter.format(state.dateValue);
|
|
476
512
|
textValue = monthTextValue !== textValue ? `${textValue} – ${monthTextValue}` : monthTextValue;
|
|
477
|
-
} else if (segment.type === 'hour') textValue = hourDateFormatter.format(state.dateValue);
|
|
513
|
+
} else if (segment.type === 'hour' && !segment.isPlaceholder) textValue = hourDateFormatter.format(state.dateValue);
|
|
478
514
|
let { spinButtonProps: spinButtonProps } = $cIPI0$useSpinButton({
|
|
515
|
+
// The ARIA spec says aria-valuenow is optional if there's no value, but aXe seems to require it.
|
|
516
|
+
// This doesn't seem to have any negative effects with real AT since we also use aria-valuetext.
|
|
517
|
+
// https://github.com/dequelabs/axe-core/issues/3505
|
|
479
518
|
value: segment.value,
|
|
480
519
|
textValue: textValue,
|
|
481
520
|
minValue: segment.minValue,
|
|
@@ -529,36 +568,6 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
529
568
|
if (e.key === 'a' && ($cIPI0$isMac() ? e.metaKey : e.ctrlKey)) e.preventDefault();
|
|
530
569
|
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;
|
|
531
570
|
switch(e.key){
|
|
532
|
-
case 'ArrowLeft':
|
|
533
|
-
e.preventDefault();
|
|
534
|
-
e.stopPropagation();
|
|
535
|
-
if (direction === 'rtl') focusManager.focusNext({
|
|
536
|
-
tabbable: true
|
|
537
|
-
});
|
|
538
|
-
else focusManager.focusPrevious({
|
|
539
|
-
tabbable: true
|
|
540
|
-
});
|
|
541
|
-
break;
|
|
542
|
-
case 'ArrowRight':
|
|
543
|
-
e.preventDefault();
|
|
544
|
-
e.stopPropagation();
|
|
545
|
-
if (direction === 'rtl') focusManager.focusPrevious({
|
|
546
|
-
tabbable: true
|
|
547
|
-
});
|
|
548
|
-
else focusManager.focusNext({
|
|
549
|
-
tabbable: true
|
|
550
|
-
});
|
|
551
|
-
break;
|
|
552
|
-
case 'Enter':
|
|
553
|
-
e.preventDefault();
|
|
554
|
-
e.stopPropagation();
|
|
555
|
-
if (segment.isPlaceholder && !state.isReadOnly) state.confirmPlaceholder(segment.type);
|
|
556
|
-
focusManager.focusNext({
|
|
557
|
-
tabbable: true
|
|
558
|
-
});
|
|
559
|
-
break;
|
|
560
|
-
case 'Tab':
|
|
561
|
-
break;
|
|
562
571
|
case 'Backspace':
|
|
563
572
|
case 'Delete':
|
|
564
573
|
// Safari on iOS does not fire beforeinput for the backspace key because the cursor is at the start.
|
|
@@ -592,6 +601,42 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
592
601
|
}, [
|
|
593
602
|
amPmFormatter
|
|
594
603
|
]);
|
|
604
|
+
// Get a list of formatted era names so users can type the first character to choose one.
|
|
605
|
+
let eraFormatter = $cIPI0$useDateFormatter({
|
|
606
|
+
year: 'numeric',
|
|
607
|
+
era: 'narrow',
|
|
608
|
+
timeZone: 'UTC'
|
|
609
|
+
});
|
|
610
|
+
let eras1 = $cIPI0$useMemo(()=>{
|
|
611
|
+
if (segment.type !== 'era') return [];
|
|
612
|
+
let date = $cIPI0$toCalendar(new $cIPI0$CalendarDate(1, 1, 1), state.calendar);
|
|
613
|
+
let eras = state.calendar.getEras().map((era)=>{
|
|
614
|
+
let eraDate = date.set({
|
|
615
|
+
year: 1,
|
|
616
|
+
month: 1,
|
|
617
|
+
day: 1,
|
|
618
|
+
era: era
|
|
619
|
+
}).toDate('UTC');
|
|
620
|
+
let parts = eraFormatter.formatToParts(eraDate);
|
|
621
|
+
let formatted = parts.find((p)=>p.type === 'era'
|
|
622
|
+
).value;
|
|
623
|
+
return {
|
|
624
|
+
era: era,
|
|
625
|
+
formatted: formatted
|
|
626
|
+
};
|
|
627
|
+
});
|
|
628
|
+
// Remove the common prefix from formatted values. This is so that in calendars with eras like
|
|
629
|
+
// ERA0 and ERA1 (e.g. Ethiopic), users can press "0" and "1" to select an era. In other cases,
|
|
630
|
+
// the first letter is used.
|
|
631
|
+
let prefixLength = $32489daedd52963e$var$commonPrefixLength(eras.map((era)=>era.formatted
|
|
632
|
+
));
|
|
633
|
+
if (prefixLength) for (let era1 of eras)era1.formatted = era1.formatted.slice(prefixLength);
|
|
634
|
+
return eras;
|
|
635
|
+
}, [
|
|
636
|
+
eraFormatter,
|
|
637
|
+
state.calendar,
|
|
638
|
+
segment.type
|
|
639
|
+
]);
|
|
595
640
|
let onInput = (key)=>{
|
|
596
641
|
if (state.isDisabled || state.isReadOnly) return;
|
|
597
642
|
let newValue = enteredKeys.current + key;
|
|
@@ -600,10 +645,18 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
600
645
|
if (startsWith(am, key)) state.setSegment('dayPeriod', 0);
|
|
601
646
|
else if (startsWith(pm, key)) state.setSegment('dayPeriod', 12);
|
|
602
647
|
else break;
|
|
603
|
-
focusManager.focusNext(
|
|
604
|
-
tabbable: true
|
|
605
|
-
});
|
|
648
|
+
focusManager.focusNext();
|
|
606
649
|
break;
|
|
650
|
+
case 'era':
|
|
651
|
+
{
|
|
652
|
+
let matched = eras1.find((e)=>startsWith(e.formatted, key)
|
|
653
|
+
);
|
|
654
|
+
if (matched) {
|
|
655
|
+
state.setSegment('era', matched.era);
|
|
656
|
+
focusManager.focusNext();
|
|
657
|
+
}
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
607
660
|
case 'day':
|
|
608
661
|
case 'hour':
|
|
609
662
|
case 'minute':
|
|
@@ -632,9 +685,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
632
685
|
if (shouldSetValue) state.setSegment(segment.type, segmentValue);
|
|
633
686
|
if (Number(numberValue + '0') > segment.maxValue || newValue.length >= String(segment.maxValue).length) {
|
|
634
687
|
enteredKeys.current = '';
|
|
635
|
-
if (shouldSetValue) focusManager.focusNext(
|
|
636
|
-
tabbable: true
|
|
637
|
-
});
|
|
688
|
+
if (shouldSetValue) focusManager.focusNext();
|
|
638
689
|
} else enteredKeys.current = newValue;
|
|
639
690
|
break;
|
|
640
691
|
}
|
|
@@ -643,12 +694,9 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
643
694
|
let onFocus = ()=>{
|
|
644
695
|
enteredKeys.current = '';
|
|
645
696
|
$cIPI0$scrollIntoView($cIPI0$getScrollParent(ref.current), ref.current);
|
|
646
|
-
//
|
|
647
|
-
// Since usePress disables text selection, this won't happen by default.
|
|
648
|
-
ref.current.style.webkitUserSelect = 'text';
|
|
697
|
+
// Collapse selection to start or Chrome won't fire input events.
|
|
649
698
|
let selection = window.getSelection();
|
|
650
699
|
selection.collapse(ref.current);
|
|
651
|
-
ref.current.style.webkitUserSelect = '';
|
|
652
700
|
};
|
|
653
701
|
let compositionRef = $cIPI0$useRef('');
|
|
654
702
|
// @ts-ignore - TODO: possibly old TS version? doesn't fail in my editor...
|
|
@@ -684,21 +732,19 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
684
732
|
break;
|
|
685
733
|
}
|
|
686
734
|
});
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
e.preventDefault();
|
|
701
|
-
});
|
|
735
|
+
$cIPI0$useLayoutEffect(()=>{
|
|
736
|
+
let element = ref.current;
|
|
737
|
+
return ()=>{
|
|
738
|
+
// If the focused segment is removed, focus the previous one, or the next one if there was no previous one.
|
|
739
|
+
if (document.activeElement === element) {
|
|
740
|
+
let prev = focusManager.focusPrevious();
|
|
741
|
+
if (!prev) focusManager.focusNext();
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
}, [
|
|
745
|
+
ref,
|
|
746
|
+
focusManager
|
|
747
|
+
]);
|
|
702
748
|
// spinbuttons cannot be focused with VoiceOver on iOS.
|
|
703
749
|
let touchPropOverrides = $cIPI0$isIOS() || segment.type === 'timeZoneName' ? {
|
|
704
750
|
role: 'textbox',
|
|
@@ -733,13 +779,13 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
733
779
|
}
|
|
734
780
|
};
|
|
735
781
|
return {
|
|
736
|
-
segmentProps: $cIPI0$mergeProps(spinButtonProps,
|
|
782
|
+
segmentProps: $cIPI0$mergeProps(spinButtonProps, labelProps, {
|
|
737
783
|
id: id,
|
|
738
784
|
...touchPropOverrides,
|
|
739
785
|
'aria-invalid': state.validationState === 'invalid' ? 'true' : undefined,
|
|
740
786
|
'aria-describedby': ariaDescribedBy,
|
|
741
|
-
'aria-placeholder': segment.isPlaceholder ? segment.text : undefined,
|
|
742
787
|
'aria-readonly': state.isReadOnly || !segment.isEditable ? 'true' : undefined,
|
|
788
|
+
'data-placeholder': segment.isPlaceholder || undefined,
|
|
743
789
|
contentEditable: isEditable,
|
|
744
790
|
suppressContentEditableWarning: isEditable,
|
|
745
791
|
spellCheck: isEditable ? 'false' : undefined,
|
|
@@ -747,17 +793,33 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
747
793
|
autoCorrect: isEditable ? 'off' : undefined,
|
|
748
794
|
// Capitalization was changed in React 17...
|
|
749
795
|
[parseInt($cIPI0$react.version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined,
|
|
750
|
-
inputMode: state.isDisabled || segment.type === 'dayPeriod' || !isEditable ? undefined : 'numeric',
|
|
796
|
+
inputMode: state.isDisabled || segment.type === 'dayPeriod' || segment.type === 'era' || !isEditable ? undefined : 'numeric',
|
|
751
797
|
tabIndex: state.isDisabled ? undefined : 0,
|
|
752
798
|
onKeyDown: onKeyDown,
|
|
753
799
|
onFocus: onFocus,
|
|
754
800
|
style: {
|
|
755
801
|
caretColor: 'transparent'
|
|
802
|
+
},
|
|
803
|
+
// Prevent pointer events from reaching useDatePickerGroup, and allow native browser behavior to focus the segment.
|
|
804
|
+
onPointerDown (e) {
|
|
805
|
+
e.stopPropagation();
|
|
806
|
+
},
|
|
807
|
+
onMouseDown (e) {
|
|
808
|
+
e.stopPropagation();
|
|
756
809
|
}
|
|
757
810
|
})
|
|
758
811
|
};
|
|
759
812
|
}
|
|
760
|
-
|
|
813
|
+
function $32489daedd52963e$var$commonPrefixLength(strings) {
|
|
814
|
+
// Sort the strings, and compare the characters in the first and last to find the common prefix.
|
|
815
|
+
strings.sort();
|
|
816
|
+
let first = strings[0];
|
|
817
|
+
let last = strings[strings.length - 1];
|
|
818
|
+
for(let i = 0; i < first.length; i++){
|
|
819
|
+
if (first[i] !== last[i]) return i;
|
|
820
|
+
}
|
|
821
|
+
return 0;
|
|
822
|
+
}
|
|
761
823
|
|
|
762
824
|
|
|
763
825
|
|
|
@@ -778,9 +840,13 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
778
840
|
});
|
|
779
841
|
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id;
|
|
780
842
|
let { locale: locale } = $cIPI0$useLocale();
|
|
781
|
-
let
|
|
843
|
+
let range = state.formatValue(locale, {
|
|
782
844
|
month: 'long'
|
|
783
845
|
});
|
|
846
|
+
let description = range ? formatMessage('selectedRangeDescription', {
|
|
847
|
+
startDate: range.start,
|
|
848
|
+
endDate: range.end
|
|
849
|
+
}) : '';
|
|
784
850
|
let descProps = $cIPI0$useDescription(description);
|
|
785
851
|
let startFieldProps = {
|
|
786
852
|
'aria-label': formatMessage('startDate'),
|
|
@@ -793,18 +859,17 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
793
859
|
let buttonId = $cIPI0$useId();
|
|
794
860
|
let dialogId = $cIPI0$useId();
|
|
795
861
|
let groupProps = $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref);
|
|
796
|
-
let { focusWithinProps: focusWithinProps } = $cIPI0$useFocusWithin({
|
|
797
|
-
onBlurWithin () {
|
|
798
|
-
state.confirmPlaceholder();
|
|
799
|
-
}
|
|
800
|
-
});
|
|
801
862
|
let ariaDescribedBy = [
|
|
802
863
|
descProps['aria-describedby'],
|
|
803
864
|
fieldProps['aria-describedby']
|
|
804
865
|
].filter(Boolean).join(' ') || undefined;
|
|
805
|
-
let focusManager = $cIPI0$useMemo(()=>$cIPI0$createFocusManager(ref
|
|
866
|
+
let focusManager = $cIPI0$useMemo(()=>$cIPI0$createFocusManager(ref, {
|
|
867
|
+
// Exclude the button from the focus manager.
|
|
868
|
+
accept: (element)=>element.id !== buttonId
|
|
869
|
+
})
|
|
806
870
|
, [
|
|
807
|
-
ref
|
|
871
|
+
ref,
|
|
872
|
+
buttonId
|
|
808
873
|
]);
|
|
809
874
|
let commonFieldProps = {
|
|
810
875
|
[$16f0b7bb276bc17e$export$7b3062cd49e80452]: focusManager,
|
|
@@ -821,8 +886,9 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
821
886
|
isRequired: props.isRequired,
|
|
822
887
|
validationState: state.validationState
|
|
823
888
|
};
|
|
889
|
+
let domProps = $cIPI0$filterDOMProps(props);
|
|
824
890
|
return {
|
|
825
|
-
groupProps: $cIPI0$mergeProps(groupProps, fieldProps, descProps,
|
|
891
|
+
groupProps: $cIPI0$mergeProps(domProps, groupProps, fieldProps, descProps, {
|
|
826
892
|
role: 'group',
|
|
827
893
|
'aria-disabled': props.isDisabled || null,
|
|
828
894
|
'aria-describedby': ariaDescribedBy
|
|
@@ -836,7 +902,6 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
836
902
|
buttonProps: {
|
|
837
903
|
...descProps,
|
|
838
904
|
id: buttonId,
|
|
839
|
-
excludeFromTabOrder: true,
|
|
840
905
|
'aria-haspopup': 'dialog',
|
|
841
906
|
'aria-label': formatMessage('calendar'),
|
|
842
907
|
'aria-labelledby': `${labelledBy} ${buttonId}`,
|
|
@@ -873,7 +938,9 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
873
938
|
isReadOnly: props.isReadOnly,
|
|
874
939
|
isDateUnavailable: props.isDateUnavailable,
|
|
875
940
|
allowsNonContiguousRanges: props.allowsNonContiguousRanges,
|
|
876
|
-
defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue
|
|
941
|
+
defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue,
|
|
942
|
+
validationState: state.validationState,
|
|
943
|
+
errorMessage: props.errorMessage
|
|
877
944
|
}
|
|
878
945
|
};
|
|
879
946
|
}
|