@react-aria/datepicker
Advanced tools
Comparing version 3.0.0-nightly.3040 to 3.0.0-nightly.3047
1498
dist/main.js
@@ -1,936 +0,772 @@ | ||
var { | ||
useSpinButton | ||
} = require("@react-aria/spinbutton"); | ||
var $RqPov$reactariafocus = require("@react-aria/focus"); | ||
var $RqPov$reactariautils = require("@react-aria/utils"); | ||
var $RqPov$reactarialabel = require("@react-aria/label"); | ||
var $RqPov$reactariai18n = require("@react-aria/i18n"); | ||
var $RqPov$reactariainteractions = require("@react-aria/interactions"); | ||
var $RqPov$internationalizednumber = require("@internationalized/number"); | ||
var $RqPov$react = require("react"); | ||
var $RqPov$reactariaspinbutton = require("@react-aria/spinbutton"); | ||
var $RqPov$internationalizedmessage = require("@internationalized/message"); | ||
var { | ||
MessageDictionary | ||
} = require("@internationalized/message"); | ||
function $parcel$exportWildcard(dest, source) { | ||
Object.keys(source).forEach(function(key) { | ||
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) { | ||
return; | ||
} | ||
var _react2 = require("react"); | ||
Object.defineProperty(dest, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return source[key]; | ||
} | ||
}); | ||
}); | ||
var _react = $parcel$interopDefault(_react2); | ||
return dest; | ||
} | ||
function $parcel$interopDefault(a) { | ||
return a && a.__esModule ? a.default : a; | ||
} | ||
function $parcel$export(e, n, v, s) { | ||
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); | ||
} | ||
var $cb7d2152263d2ab6$exports = {}; | ||
var { | ||
useMemo, | ||
useRef | ||
} = _react2; | ||
$parcel$export($cb7d2152263d2ab6$exports, "useDatePicker", () => $cb7d2152263d2ab6$export$42df105a73306d51); | ||
var { | ||
NumberParser | ||
} = require("@internationalized/number"); | ||
var $5766533e00be07f5$exports = {}; | ||
var $7e1d533dafdd7a3c$exports = {}; | ||
$7e1d533dafdd7a3c$exports = JSON.parse("{\"calendar\":\"التقويم\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} إلى {end, date, long}\",\"date\":\"التاريخ\",\"dateRange\":\"نطاق التاريخ\",\"day\":\"يوم\",\"dayPeriod\":\"ص/م\",\"endDate\":\"تاريخ الانتهاء\",\"era\":\"العصر\",\"hour\":\"الساعات\",\"minute\":\"الدقائق\",\"month\":\"الشهر\",\"second\":\"الثواني\",\"startDate\":\"تاريخ البدء\",\"year\":\"السنة\",\"weekday\":\"اليوم\",\"timeZoneName\":\"التوقيت\"}"); | ||
var { | ||
useLocale, | ||
useMessageFormatter, | ||
useDateFormatter, | ||
useFilter | ||
} = require("@react-aria/i18n"); | ||
var { | ||
useField | ||
} = require("@react-aria/label"); | ||
var $b645e4c88eddb7bc$exports = {}; | ||
$b645e4c88eddb7bc$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Времеви интервал\",\"day\":\"ден\",\"dayPeriod\":\"пр.об./сл.об.\",\"endDate\":\"Крайна дата\",\"era\":\"ера\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месец\",\"second\":\"секунда\",\"startDate\":\"Начална дата\",\"year\":\"година\",\"weekday\":\"ден от седмицата\",\"timeZoneName\":\"часова зона\"}"); | ||
var { | ||
usePress, | ||
useFocusWithin | ||
} = require("@react-aria/interactions"); | ||
var { | ||
mergeProps, | ||
useDescription, | ||
useId, | ||
getScrollParent, | ||
isIOS, | ||
isMac, | ||
scrollIntoView, | ||
useEvent, | ||
useLabels | ||
} = require("@react-aria/utils"); | ||
var $c74d7d9a3a492e14$exports = {}; | ||
$c74d7d9a3a492e14$exports = JSON.parse("{\"calendar\":\"Kalendář\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} až {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Rozsah dat\",\"day\":\"den\",\"dayPeriod\":\"část dne\",\"endDate\":\"Konečné datum\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minuta\",\"month\":\"měsíc\",\"second\":\"sekunda\",\"startDate\":\"Počáteční datum\",\"year\":\"rok\",\"weekday\":\"den v týdnu\",\"timeZoneName\":\"časové pásmo\"}"); | ||
var { | ||
createFocusManager, | ||
useFocusManager | ||
} = require("@react-aria/focus"); | ||
var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault")); | ||
var $2fdf441aacd54e7a$exports = {}; | ||
$2fdf441aacd54e7a$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datointerval\",\"day\":\"dag\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Slutdato\",\"era\":\"æra\",\"hour\":\"time\",\"minute\":\"minut\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ugedag\",\"timeZoneName\":\"tidszone\"}"); | ||
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends")); | ||
function $parcel$interopDefault(a) { | ||
return a && a.__esModule ? a.default : a; | ||
} | ||
var $cc895f32c87cd395$exports = {}; | ||
$cc895f32c87cd395$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} bis {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumsbereich\",\"day\":\"Tag\",\"dayPeriod\":\"Tageshälfte\",\"endDate\":\"Enddatum\",\"era\":\"Epoche\",\"hour\":\"Stunde\",\"minute\":\"Minute\",\"month\":\"Monat\",\"second\":\"Sekunde\",\"startDate\":\"Anfangsdatum\",\"year\":\"Jahr\",\"weekday\":\"Wochentag\",\"timeZoneName\":\"Zeitzone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ar-AE.json | ||
var $be926026280e076dd0b048671d4b$exports = {}; | ||
$be926026280e076dd0b048671d4b$exports = JSON.parse("{\"calendar\":\"التقويم\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} إلى {end, date, long}\",\"date\":\"التاريخ\",\"dateRange\":\"نطاق التاريخ\",\"day\":\"يوم\",\"dayPeriod\":\"ص/م\",\"endDate\":\"تاريخ الانتهاء\",\"era\":\"العصر\",\"hour\":\"الساعات\",\"minute\":\"الدقائق\",\"month\":\"الشهر\",\"second\":\"الثواني\",\"startDate\":\"تاريخ البدء\",\"year\":\"السنة\",\"weekday\":\"اليوم\",\"timeZoneName\":\"التوقيت\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/bg-BG.json | ||
var $bab398828901e91cda5ace996e16743$exports = {}; | ||
$bab398828901e91cda5ace996e16743$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Времеви интервал\",\"day\":\"ден\",\"dayPeriod\":\"пр.об./сл.об.\",\"endDate\":\"Крайна дата\",\"era\":\"ера\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месец\",\"second\":\"секунда\",\"startDate\":\"Начална дата\",\"year\":\"година\",\"weekday\":\"ден от седмицата\",\"timeZoneName\":\"часова зона\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/cs-CZ.json | ||
var $a1b39c1203bddacb07ac8af1bf09f93d$exports = {}; | ||
$a1b39c1203bddacb07ac8af1bf09f93d$exports = JSON.parse("{\"calendar\":\"Kalendář\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} až {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Rozsah dat\",\"day\":\"den\",\"dayPeriod\":\"část dne\",\"endDate\":\"Konečné datum\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minuta\",\"month\":\"měsíc\",\"second\":\"sekunda\",\"startDate\":\"Počáteční datum\",\"year\":\"rok\",\"weekday\":\"den v týdnu\",\"timeZoneName\":\"časové pásmo\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/da-DK.json | ||
var $de6d54fc6253e3aab217ab66cc92632$exports = {}; | ||
$de6d54fc6253e3aab217ab66cc92632$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datointerval\",\"day\":\"dag\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Slutdato\",\"era\":\"æra\",\"hour\":\"time\",\"minute\":\"minut\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ugedag\",\"timeZoneName\":\"tidszone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/de-DE.json | ||
var $c62d85e73a4bc4d2d79c4e5438a0a3$exports = {}; | ||
$c62d85e73a4bc4d2d79c4e5438a0a3$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} bis {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumsbereich\",\"day\":\"Tag\",\"dayPeriod\":\"Tageshälfte\",\"endDate\":\"Enddatum\",\"era\":\"Epoche\",\"hour\":\"Stunde\",\"minute\":\"Minute\",\"month\":\"Monat\",\"second\":\"Sekunde\",\"startDate\":\"Anfangsdatum\",\"year\":\"Jahr\",\"weekday\":\"Wochentag\",\"timeZoneName\":\"Zeitzone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/el-GR.json | ||
var $e7f2c17a4d052730760575ff7cf57df6$exports = {}; | ||
$e7f2c17a4d052730760575ff7cf57df6$exports = JSON.parse("{\"calendar\":\"Ημερολόγιο\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ως {end, date, long}\",\"date\":\"Ημερομηνία\",\"dateRange\":\"Εύρος ημερομηνιών\",\"day\":\"ημέρα\",\"dayPeriod\":\"π.μ./μ.μ.\",\"endDate\":\"Ημερομηνία λήξης\",\"era\":\"περίοδος\",\"hour\":\"ώρα\",\"minute\":\"λεπτό\",\"month\":\"μήνας\",\"second\":\"δευτερόλεπτο\",\"startDate\":\"Ημερομηνία έναρξης\",\"year\":\"έτος\",\"weekday\":\"καθημερινή\",\"timeZoneName\":\"ζώνη ώρας\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/en-US.json | ||
var $adfdcb0b7f4822eaafecdabf45f751$exports = {}; | ||
$adfdcb0b7f4822eaafecdabf45f751$exports = JSON.parse("{\"era\":\"era\",\"year\":\"year\",\"month\":\"month\",\"day\":\"day\",\"hour\":\"hour\",\"minute\":\"minute\",\"second\":\"second\",\"dayPeriod\":\"AM/PM\",\"calendar\":\"Calendar\",\"date\":\"Date\",\"dateRange\":\"Date Range\",\"startDate\":\"Start Date\",\"endDate\":\"End Date\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} to {end, date, long}\",\"weekday\":\"day of the week\",\"timeZoneName\":\"time zone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/es-ES.json | ||
var $f9c516e0c25716b7d567ed2$exports = {}; | ||
$f9c516e0c25716b7d567ed2$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Fecha\",\"dateRange\":\"Intervalo de fecha\",\"day\":\"día\",\"dayPeriod\":\"a. m./p. m.\",\"endDate\":\"Fecha final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mes\",\"second\":\"segundo\",\"startDate\":\"Fecha de inicio\",\"year\":\"año\",\"weekday\":\"día de la semana\",\"timeZoneName\":\"zona horaria\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/et-EE.json | ||
var $ba7274e4009469f7b66a9c93516dc421$exports = {}; | ||
$ba7274e4009469f7b66a9c93516dc421$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} kuni {end, date, long}\",\"date\":\"Kuupäev\",\"dateRange\":\"Kuupäevavahemik\",\"day\":\"päev\",\"dayPeriod\":\"enne/pärast lõunat\",\"endDate\":\"Lõppkuupäev\",\"era\":\"ajastu\",\"hour\":\"tund\",\"minute\":\"minut\",\"month\":\"kuu\",\"second\":\"sekund\",\"startDate\":\"Alguskuupäev\",\"year\":\"aasta\",\"weekday\":\"nädalapäev\",\"timeZoneName\":\"ajavöönd\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/fi-FI.json | ||
var $c64b2869d31111b8a6212d3569c46edc$exports = {}; | ||
$c64b2869d31111b8a6212d3569c46edc$exports = JSON.parse("{\"calendar\":\"Kalenteri\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}–{end, date, long}\",\"date\":\"Päivämäärä\",\"dateRange\":\"Päivämääräalue\",\"day\":\"päivä\",\"dayPeriod\":\"vuorokaudenaika\",\"endDate\":\"Päättymispäivä\",\"era\":\"aikakausi\",\"hour\":\"tunti\",\"minute\":\"minuutti\",\"month\":\"kuukausi\",\"second\":\"sekunti\",\"startDate\":\"Alkamispäivä\",\"year\":\"vuosi\",\"weekday\":\"viikonpäivä\",\"timeZoneName\":\"aikavyöhyke\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/fr-FR.json | ||
var $ba1e9adecce613badde3f8b2a91b9$exports = {}; | ||
$ba1e9adecce613badde3f8b2a91b9$exports = JSON.parse("{\"calendar\":\"Calendrier\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} au {end, date, long}\",\"date\":\"Date\",\"dateRange\":\"Plage de dates\",\"day\":\"jour\",\"dayPeriod\":\"cadran\",\"endDate\":\"Date de fin\",\"era\":\"ère\",\"hour\":\"heure\",\"minute\":\"minute\",\"month\":\"mois\",\"second\":\"seconde\",\"startDate\":\"Date de début\",\"year\":\"année\",\"weekday\":\"jour de la semaine\",\"timeZoneName\":\"fuseau horaire\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/he-IL.json | ||
var $da5d80bcf16af82fe7b14fc1e9d9$exports = {}; | ||
$da5d80bcf16af82fe7b14fc1e9d9$exports = JSON.parse("{\"calendar\":\"לוח שנה\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"מ-{start, date, long} ועד {end, date, long}\",\"date\":\"תאריך\",\"dateRange\":\"טווח תאריכים\",\"day\":\"יום\",\"dayPeriod\":\"לפנה״צ/אחה״צ\",\"endDate\":\"תאריך סיום\",\"era\":\"תקופה\",\"hour\":\"שעה\",\"minute\":\"דקה\",\"month\":\"חודש\",\"second\":\"שנייה\",\"startDate\":\"תאריך התחלה\",\"year\":\"שנה\",\"weekday\":\"יום בשבוע\",\"timeZoneName\":\"אזור זמן\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/hr-HR.json | ||
var $c179e9a34711caa46568a537c351781$exports = {}; | ||
$c179e9a34711caa46568a537c351781$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Raspon datuma\",\"day\":\"dan\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Datum završetka\",\"era\":\"era\",\"hour\":\"sat\",\"minute\":\"minuta\",\"month\":\"mjesec\",\"second\":\"sekunda\",\"startDate\":\"Datum početka\",\"year\":\"godina\",\"weekday\":\"dan u tjednu\",\"timeZoneName\":\"vremenska zona\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/hu-HU.json | ||
var $a40a6dd4cfb1bd1de71f82470d8716$exports = {}; | ||
$a40a6dd4cfb1bd1de71f82470d8716$exports = JSON.parse("{\"calendar\":\"Naptár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Dátumtartomány\",\"day\":\"nap\",\"dayPeriod\":\"napszak\",\"endDate\":\"Befejező dátum\",\"era\":\"éra\",\"hour\":\"óra\",\"minute\":\"perc\",\"month\":\"hónap\",\"second\":\"másodperc\",\"startDate\":\"Kezdő dátum\",\"year\":\"év\",\"weekday\":\"hét napja\",\"timeZoneName\":\"időzóna\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/it-IT.json | ||
var $b9be9a4b72f2aadd1d314520c1acfc$exports = {}; | ||
$b9be9a4b72f2aadd1d314520c1acfc$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Da {start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervallo date\",\"day\":\"giorno\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data finale\",\"era\":\"era\",\"hour\":\"ora\",\"minute\":\"minuto\",\"month\":\"mese\",\"second\":\"secondo\",\"startDate\":\"Data iniziale\",\"year\":\"anno\",\"weekday\":\"giorno della settimana\",\"timeZoneName\":\"fuso orario\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ja-JP.json | ||
var $b41d870af1ac3496d01f8698fb5c954$exports = {}; | ||
$b41d870af1ac3496d01f8698fb5c954$exports = JSON.parse("{\"calendar\":\"カレンダー\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"日付\",\"dateRange\":\"日付範囲\",\"day\":\"日\",\"dayPeriod\":\"午前/午後\",\"endDate\":\"終了日\",\"era\":\"時代\",\"hour\":\"時\",\"minute\":\"分\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日\",\"year\":\"年\",\"weekday\":\"曜日\",\"timeZoneName\":\"タイムゾーン\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ko-KR.json | ||
var $fe0c574bf48312400dd82a37538c16ef$exports = {}; | ||
$fe0c574bf48312400dd82a37538c16ef$exports = JSON.parse("{\"calendar\":\"달력\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"날짜\",\"dateRange\":\"날짜 범위\",\"day\":\"일\",\"dayPeriod\":\"오전/오후\",\"endDate\":\"종료 날짜\",\"era\":\"연호\",\"hour\":\"시\",\"minute\":\"분\",\"month\":\"월\",\"second\":\"초\",\"startDate\":\"시작 날짜\",\"year\":\"년\",\"weekday\":\"요일\",\"timeZoneName\":\"시간대\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/lt-LT.json | ||
var $b0ad35113dfe9f264970b85837$exports = {}; | ||
$b0ad35113dfe9f264970b85837$exports = JSON.parse("{\"calendar\":\"Kalendorius\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Nuo {start, date, long} iki {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Datų intervalas\",\"day\":\"diena\",\"dayPeriod\":\"iki pietų / po pietų\",\"endDate\":\"Pabaigos data\",\"era\":\"era\",\"hour\":\"valanda\",\"minute\":\"minutė\",\"month\":\"mėnuo\",\"second\":\"sekundė\",\"startDate\":\"Pradžios data\",\"year\":\"metai\",\"weekday\":\"savaitės diena\",\"timeZoneName\":\"laiko juosta\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/lv-LV.json | ||
var $c670847f13ef745cf51c4d927173b$exports = {}; | ||
$c670847f13ef745cf51c4d927173b$exports = JSON.parse("{\"calendar\":\"Kalendārs\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} līdz {end, date, long}\",\"date\":\"Datums\",\"dateRange\":\"Datumu diapazons\",\"day\":\"diena\",\"dayPeriod\":\"priekšpusdienā/pēcpusdienā\",\"endDate\":\"Beigu datums\",\"era\":\"ēra\",\"hour\":\"stundas\",\"minute\":\"minūtes\",\"month\":\"mēnesis\",\"second\":\"sekundes\",\"startDate\":\"Sākuma datums\",\"year\":\"gads\",\"weekday\":\"nedēļas diena\",\"timeZoneName\":\"laika josla\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/nb-NO.json | ||
var $d59ad4442794aa8d7415835505965b2$exports = {}; | ||
$d59ad4442794aa8d7415835505965b2$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datoområde\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Sluttdato\",\"era\":\"tidsalder\",\"hour\":\"time\",\"minute\":\"minutt\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ukedag\",\"timeZoneName\":\"tidssone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/nl-NL.json | ||
var $ea0bd7fd22f4939550fa7411df8295f2$exports = {}; | ||
$ea0bd7fd22f4939550fa7411df8295f2$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} t/m {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumbereik\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Einddatum\",\"era\":\"tijdperk\",\"hour\":\"uur\",\"minute\":\"minuut\",\"month\":\"maand\",\"second\":\"seconde\",\"startDate\":\"Startdatum\",\"year\":\"jaar\",\"weekday\":\"dag van de week\",\"timeZoneName\":\"tijdzone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/pl-PL.json | ||
var $c08613207efc8ea834b1fadda995620b$exports = {}; | ||
$c08613207efc8ea834b1fadda995620b$exports = JSON.parse("{\"calendar\":\"Kalendarz\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Zakres dat\",\"day\":\"dzień\",\"dayPeriod\":\"rano / po południu / wieczorem\",\"endDate\":\"Data końcowa\",\"era\":\"era\",\"hour\":\"godzina\",\"minute\":\"minuta\",\"month\":\"miesiąc\",\"second\":\"sekunda\",\"startDate\":\"Data początkowa\",\"year\":\"rok\",\"weekday\":\"dzień tygodnia\",\"timeZoneName\":\"strefa czasowa\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/pt-BR.json | ||
var $c53c2ff9b6580a8da286c11a97f27c0c$exports = {}; | ||
$c53c2ff9b6580a8da286c11a97f27c0c$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data inicial\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/pt-PT.json | ||
var $d9eb517021c8b3bace06723f935$exports = {}; | ||
$d9eb517021c8b3bace06723f935$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"am/pm\",\"endDate\":\"Data de Término\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data de Início\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ro-RO.json | ||
var $b374a5303a356023e59a4df3c152bebf$exports = {}; | ||
$b374a5303a356023e59a4df3c152bebf$exports = JSON.parse("{\"calendar\":\"Calendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Dată\",\"dateRange\":\"Raza datei\",\"day\":\"zi\",\"dayPeriod\":\"a.m/p.m.\",\"endDate\":\"Dată final\",\"era\":\"eră\",\"hour\":\"oră\",\"minute\":\"minut\",\"month\":\"lună\",\"second\":\"secundă\",\"startDate\":\"Dată început\",\"year\":\"an\",\"weekday\":\"ziua din săptămână\",\"timeZoneName\":\"fus orar\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ru-RU.json | ||
var $e72056058c9fa1ea634cd2d7f7700$exports = {}; | ||
$e72056058c9fa1ea634cd2d7f7700$exports = JSON.parse("{\"calendar\":\"Календарь\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Диапазон дат\",\"day\":\"день\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Дата окончания\",\"era\":\"эра\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месяц\",\"second\":\"секунда\",\"startDate\":\"Дата начала\",\"year\":\"год\",\"weekday\":\"день недели\",\"timeZoneName\":\"часовой пояс\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sk-SK.json | ||
var $ab8e21cbc487e19c15c39cc2df98aed6$exports = {}; | ||
$ab8e21cbc487e19c15c39cc2df98aed6$exports = JSON.parse("{\"calendar\":\"Kalendár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Rozsah dátumov\",\"day\":\"deň\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Dátum ukončenia\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minúta\",\"month\":\"mesiac\",\"second\":\"sekunda\",\"startDate\":\"Dátum začatia\",\"year\":\"rok\",\"weekday\":\"deň týždňa\",\"timeZoneName\":\"časové pásmo\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sl-SI.json | ||
var $a155de298a83a5c6e328091b4347a$exports = {}; | ||
$a155de298a83a5c6e328091b4347a$exports = JSON.parse("{\"calendar\":\"Koledar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumski obseg\",\"day\":\"dan\",\"dayPeriod\":\"dop/pop\",\"endDate\":\"Datum konca\",\"era\":\"doba\",\"hour\":\"ura\",\"minute\":\"minuta\",\"month\":\"mesec\",\"second\":\"sekunda\",\"startDate\":\"Datum začetka\",\"year\":\"leto\",\"weekday\":\"dan v tednu\",\"timeZoneName\":\"časovni pas\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sr-SP.json | ||
var $f93e8a2d2993e66b87975762a481$exports = {}; | ||
$f93e8a2d2993e66b87975762a481$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Opseg datuma\",\"day\":\"дан\",\"dayPeriod\":\"пре подне/по подне\",\"endDate\":\"Datum završetka\",\"era\":\"ера\",\"hour\":\"сат\",\"minute\":\"минут\",\"month\":\"месец\",\"second\":\"секунд\",\"startDate\":\"Datum početka\",\"year\":\"година\",\"weekday\":\"дан у недељи\",\"timeZoneName\":\"временска зона\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sv-SE.json | ||
var $d90bf5621eeb550e11f07fd645ee9375$exports = {}; | ||
$d90bf5621eeb550e11f07fd645ee9375$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} till {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumintervall\",\"day\":\"dag\",\"dayPeriod\":\"fm/em\",\"endDate\":\"Slutdatum\",\"era\":\"era\",\"hour\":\"timme\",\"minute\":\"minut\",\"month\":\"månad\",\"second\":\"sekund\",\"startDate\":\"Startdatum\",\"year\":\"år\",\"weekday\":\"veckodag\",\"timeZoneName\":\"tidszon\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/tr-TR.json | ||
var $aa582d9ff36fb511de0ccb22bd9e2bb$exports = {}; | ||
$aa582d9ff36fb511de0ccb22bd9e2bb$exports = JSON.parse("{\"calendar\":\"Takvim\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Tarih\",\"dateRange\":\"Tarih Aralığı\",\"day\":\"gün\",\"dayPeriod\":\"ÖÖ/ÖS\",\"endDate\":\"Bitiş Tarihi\",\"era\":\"çağ\",\"hour\":\"saat\",\"minute\":\"dakika\",\"month\":\"ay\",\"second\":\"saniye\",\"startDate\":\"Başlangıç Tarihi\",\"year\":\"yıl\",\"weekday\":\"haftanın günü\",\"timeZoneName\":\"saat dilimi\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/uk-UA.json | ||
var $a1ed5505308b04ac9cd1c488538019c3$exports = {}; | ||
$a1ed5505308b04ac9cd1c488538019c3$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Від {start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Діапазон дат\",\"day\":\"день\",\"dayPeriod\":\"дп/пп\",\"endDate\":\"Дата завершення\",\"era\":\"ера\",\"hour\":\"година\",\"minute\":\"хвилина\",\"month\":\"місяць\",\"second\":\"секунда\",\"startDate\":\"Дата початку\",\"year\":\"рік\",\"weekday\":\"день тижня\",\"timeZoneName\":\"часовий пояс\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/zh-CN.json | ||
var $c6b9bcbebc7c1f385b7e70bbd744b53$exports = {}; | ||
$c6b9bcbebc7c1f385b7e70bbd744b53$exports = JSON.parse("{\"calendar\":\"日历\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} 至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期范围\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"结束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"开始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/zh-TW.json | ||
var $ae51b3cde9961c4855b77ac499ea$exports = {}; | ||
$ae51b3cde9961c4855b77ac499ea$exports = JSON.parse("{\"calendar\":\"日曆\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期範圍\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"結束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
function $e62c7e96a53f216814557ded9a8cf$export$useDatePickerGroup(state, ref) { | ||
// Open the popover on alt + arrow down | ||
let onKeyDown = e => { | ||
if (e.altKey && e.key === 'ArrowDown' && 'setOpen' in state) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
state.setOpen(true); | ||
} | ||
}; // Focus the first placeholder segment from the end on mouse down/touch up in the field. | ||
var $5f40c68998a77c84$exports = {}; | ||
$5f40c68998a77c84$exports = JSON.parse("{\"calendar\":\"Ημερολόγιο\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ως {end, date, long}\",\"date\":\"Ημερομηνία\",\"dateRange\":\"Εύρος ημερομηνιών\",\"day\":\"ημέρα\",\"dayPeriod\":\"π.μ./μ.μ.\",\"endDate\":\"Ημερομηνία λήξης\",\"era\":\"περίοδος\",\"hour\":\"ώρα\",\"minute\":\"λεπτό\",\"month\":\"μήνας\",\"second\":\"δευτερόλεπτο\",\"startDate\":\"Ημερομηνία έναρξης\",\"year\":\"έτος\",\"weekday\":\"καθημερινή\",\"timeZoneName\":\"ζώνη ώρας\"}"); | ||
let focusLast = () => { | ||
let elements = ref.current.querySelectorAll('[tabindex="0"]'); | ||
let index = elements.length - 1; | ||
var $8ce6e70e61f75190$exports = {}; | ||
$8ce6e70e61f75190$exports = JSON.parse("{\"era\":\"era\",\"year\":\"year\",\"month\":\"month\",\"day\":\"day\",\"hour\":\"hour\",\"minute\":\"minute\",\"second\":\"second\",\"dayPeriod\":\"AM/PM\",\"calendar\":\"Calendar\",\"date\":\"Date\",\"dateRange\":\"Date Range\",\"startDate\":\"Start Date\",\"endDate\":\"End Date\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} to {end, date, long}\",\"weekday\":\"day of the week\",\"timeZoneName\":\"time zone\"}"); | ||
while (index >= 0 && elements[index].getAttribute('aria-placeholder')) { | ||
index--; | ||
} | ||
index = Math.min(index + 1, elements.length - 1); | ||
let element = elements[index]; | ||
var $435f97ce46f2f3b7$exports = {}; | ||
$435f97ce46f2f3b7$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Fecha\",\"dateRange\":\"Intervalo de fecha\",\"day\":\"día\",\"dayPeriod\":\"a. m./p. m.\",\"endDate\":\"Fecha final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mes\",\"second\":\"segundo\",\"startDate\":\"Fecha de inicio\",\"year\":\"año\",\"weekday\":\"día de la semana\",\"timeZoneName\":\"zona horaria\"}"); | ||
if (element) { | ||
element.focus(); | ||
} | ||
}; | ||
let { | ||
pressProps | ||
} = usePress({ | ||
onPressStart(e) { | ||
if (e.pointerType === 'mouse') { | ||
focusLast(); | ||
} | ||
}, | ||
var $6c72b2fc022593ee$exports = {}; | ||
$6c72b2fc022593ee$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} kuni {end, date, long}\",\"date\":\"Kuupäev\",\"dateRange\":\"Kuupäevavahemik\",\"day\":\"päev\",\"dayPeriod\":\"enne/pärast lõunat\",\"endDate\":\"Lõppkuupäev\",\"era\":\"ajastu\",\"hour\":\"tund\",\"minute\":\"minut\",\"month\":\"kuu\",\"second\":\"sekund\",\"startDate\":\"Alguskuupäev\",\"year\":\"aasta\",\"weekday\":\"nädalapäev\",\"timeZoneName\":\"ajavöönd\"}"); | ||
onPress(e) { | ||
if (e.pointerType !== 'mouse') { | ||
focusLast(); | ||
} | ||
} | ||
}); | ||
return mergeProps(pressProps, { | ||
onKeyDown | ||
}); | ||
} | ||
var $2c0058ef1406d1e1$exports = {}; | ||
$2c0058ef1406d1e1$exports = JSON.parse("{\"calendar\":\"Kalenteri\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}–{end, date, long}\",\"date\":\"Päivämäärä\",\"dateRange\":\"Päivämääräalue\",\"day\":\"päivä\",\"dayPeriod\":\"vuorokaudenaika\",\"endDate\":\"Päättymispäivä\",\"era\":\"aikakausi\",\"hour\":\"tunti\",\"minute\":\"minuutti\",\"month\":\"kuukausi\",\"second\":\"sekunti\",\"startDate\":\"Alkamispäivä\",\"year\":\"vuosi\",\"weekday\":\"viikonpäivä\",\"timeZoneName\":\"aikavyöhyke\"}"); | ||
// @ts-ignore | ||
const $faa51d1fd0ed7732821d1b830a6e9ae2$var$intlMessages = { | ||
"ar-AE": _babelRuntimeHelpersInteropRequireDefault($be926026280e076dd0b048671d4b$exports).default, | ||
"bg-BG": _babelRuntimeHelpersInteropRequireDefault($bab398828901e91cda5ace996e16743$exports).default, | ||
"cs-CZ": _babelRuntimeHelpersInteropRequireDefault($a1b39c1203bddacb07ac8af1bf09f93d$exports).default, | ||
"da-DK": _babelRuntimeHelpersInteropRequireDefault($de6d54fc6253e3aab217ab66cc92632$exports).default, | ||
"de-DE": _babelRuntimeHelpersInteropRequireDefault($c62d85e73a4bc4d2d79c4e5438a0a3$exports).default, | ||
"el-GR": _babelRuntimeHelpersInteropRequireDefault($e7f2c17a4d052730760575ff7cf57df6$exports).default, | ||
"en-US": _babelRuntimeHelpersInteropRequireDefault($adfdcb0b7f4822eaafecdabf45f751$exports).default, | ||
"es-ES": _babelRuntimeHelpersInteropRequireDefault($f9c516e0c25716b7d567ed2$exports).default, | ||
"et-EE": _babelRuntimeHelpersInteropRequireDefault($ba7274e4009469f7b66a9c93516dc421$exports).default, | ||
"fi-FI": _babelRuntimeHelpersInteropRequireDefault($c64b2869d31111b8a6212d3569c46edc$exports).default, | ||
"fr-FR": _babelRuntimeHelpersInteropRequireDefault($ba1e9adecce613badde3f8b2a91b9$exports).default, | ||
"he-IL": _babelRuntimeHelpersInteropRequireDefault($da5d80bcf16af82fe7b14fc1e9d9$exports).default, | ||
"hr-HR": _babelRuntimeHelpersInteropRequireDefault($c179e9a34711caa46568a537c351781$exports).default, | ||
"hu-HU": _babelRuntimeHelpersInteropRequireDefault($a40a6dd4cfb1bd1de71f82470d8716$exports).default, | ||
"it-IT": _babelRuntimeHelpersInteropRequireDefault($b9be9a4b72f2aadd1d314520c1acfc$exports).default, | ||
"ja-JP": _babelRuntimeHelpersInteropRequireDefault($b41d870af1ac3496d01f8698fb5c954$exports).default, | ||
"ko-KR": _babelRuntimeHelpersInteropRequireDefault($fe0c574bf48312400dd82a37538c16ef$exports).default, | ||
"lt-LT": _babelRuntimeHelpersInteropRequireDefault($b0ad35113dfe9f264970b85837$exports).default, | ||
"lv-LV": _babelRuntimeHelpersInteropRequireDefault($c670847f13ef745cf51c4d927173b$exports).default, | ||
"nb-NO": _babelRuntimeHelpersInteropRequireDefault($d59ad4442794aa8d7415835505965b2$exports).default, | ||
"nl-NL": _babelRuntimeHelpersInteropRequireDefault($ea0bd7fd22f4939550fa7411df8295f2$exports).default, | ||
"pl-PL": _babelRuntimeHelpersInteropRequireDefault($c08613207efc8ea834b1fadda995620b$exports).default, | ||
"pt-BR": _babelRuntimeHelpersInteropRequireDefault($c53c2ff9b6580a8da286c11a97f27c0c$exports).default, | ||
"pt-PT": _babelRuntimeHelpersInteropRequireDefault($d9eb517021c8b3bace06723f935$exports).default, | ||
"ro-RO": _babelRuntimeHelpersInteropRequireDefault($b374a5303a356023e59a4df3c152bebf$exports).default, | ||
"ru-RU": _babelRuntimeHelpersInteropRequireDefault($e72056058c9fa1ea634cd2d7f7700$exports).default, | ||
"sk-SK": _babelRuntimeHelpersInteropRequireDefault($ab8e21cbc487e19c15c39cc2df98aed6$exports).default, | ||
"sl-SI": _babelRuntimeHelpersInteropRequireDefault($a155de298a83a5c6e328091b4347a$exports).default, | ||
"sr-SP": _babelRuntimeHelpersInteropRequireDefault($f93e8a2d2993e66b87975762a481$exports).default, | ||
"sv-SE": _babelRuntimeHelpersInteropRequireDefault($d90bf5621eeb550e11f07fd645ee9375$exports).default, | ||
"tr-TR": _babelRuntimeHelpersInteropRequireDefault($aa582d9ff36fb511de0ccb22bd9e2bb$exports).default, | ||
"uk-UA": _babelRuntimeHelpersInteropRequireDefault($a1ed5505308b04ac9cd1c488538019c3$exports).default, | ||
"zh-CN": _babelRuntimeHelpersInteropRequireDefault($c6b9bcbebc7c1f385b7e70bbd744b53$exports).default, | ||
"zh-TW": _babelRuntimeHelpersInteropRequireDefault($ae51b3cde9961c4855b77ac499ea$exports).default | ||
}; | ||
function useDatePicker(props, state, ref) { | ||
let buttonId = useId(); | ||
let dialogId = useId(); | ||
let formatMessage = useMessageFormatter($faa51d1fd0ed7732821d1b830a6e9ae2$var$intlMessages); | ||
let { | ||
labelProps, | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps | ||
} = useField(_babelRuntimeHelpersExtends({}, props, { | ||
labelElementType: 'span' | ||
})); | ||
let groupProps = $e62c7e96a53f216814557ded9a8cf$export$useDatePickerGroup(state, ref); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { | ||
locale | ||
} = useLocale(); | ||
let descProps = useDescription(state.formatValue(locale, { | ||
month: 'long' | ||
})); | ||
let ariaDescribedBy = [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: mergeProps(groupProps, descProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-labelledby': labelledBy, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: _babelRuntimeHelpersExtends({}, labelProps, { | ||
onClick: () => { | ||
let focusManager = createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}), | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps, | ||
buttonProps: _babelRuntimeHelpersExtends({}, descProps, { | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': labelledBy + " " + buttonId, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': labelledBy + " " + buttonId | ||
} | ||
}; | ||
} | ||
var $351fc2d9da05f66d$exports = {}; | ||
$351fc2d9da05f66d$exports = JSON.parse("{\"calendar\":\"Calendrier\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} au {end, date, long}\",\"date\":\"Date\",\"dateRange\":\"Plage de dates\",\"day\":\"jour\",\"dayPeriod\":\"cadran\",\"endDate\":\"Date de fin\",\"era\":\"ère\",\"hour\":\"heure\",\"minute\":\"minute\",\"month\":\"mois\",\"second\":\"seconde\",\"startDate\":\"Date de début\",\"year\":\"année\",\"weekday\":\"jour de la semaine\",\"timeZoneName\":\"fuseau horaire\"}"); | ||
exports.useDatePicker = useDatePicker; | ||
const labelIds = new WeakMap(); | ||
exports.labelIds = labelIds; | ||
function useDateField(props, state, ref) { | ||
let { | ||
labelProps, | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps | ||
} = useField(_babelRuntimeHelpersExtends({}, props, { | ||
labelElementType: 'span' | ||
})); | ||
let groupProps = $e62c7e96a53f216814557ded9a8cf$export$useDatePickerGroup(state, ref); | ||
let { | ||
focusWithinProps | ||
} = useFocusWithin({ | ||
onBlurWithin() { | ||
state.confirmPlaceholder(); | ||
} | ||
var $1c3921a882c95ab5$exports = {}; | ||
$1c3921a882c95ab5$exports = JSON.parse("{\"calendar\":\"לוח שנה\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"מ-{start, date, long} ועד {end, date, long}\",\"date\":\"תאריך\",\"dateRange\":\"טווח תאריכים\",\"day\":\"יום\",\"dayPeriod\":\"לפנה״צ/אחה״צ\",\"endDate\":\"תאריך סיום\",\"era\":\"תקופה\",\"hour\":\"שעה\",\"minute\":\"דקה\",\"month\":\"חודש\",\"second\":\"שנייה\",\"startDate\":\"תאריך התחלה\",\"year\":\"שנה\",\"weekday\":\"יום בשבוע\",\"timeZoneName\":\"אזור זמן\"}"); | ||
}); | ||
let formatter = useDateFormatter(state.getFormatOptions({ | ||
month: 'long' | ||
})); | ||
let descProps = useDescription(state.value ? formatter.format(state.dateValue) : null); | ||
let segmentLabelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let describedBy = [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined; | ||
labelIds.set(state, { | ||
ariaLabelledBy: segmentLabelledBy, | ||
ariaDescribedBy: describedBy | ||
}); | ||
return { | ||
labelProps: _babelRuntimeHelpersExtends({}, labelProps, { | ||
onClick: () => { | ||
let focusManager = createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}), | ||
fieldProps: mergeProps(fieldProps, descProps, groupProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || undefined, | ||
'aria-describedby': describedBy | ||
}), | ||
descriptionProps, | ||
errorMessageProps | ||
}; | ||
} | ||
exports.useDateField = useDateField; | ||
var $c20d0e8e557c2a17$exports = {}; | ||
$c20d0e8e557c2a17$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Raspon datuma\",\"day\":\"dan\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Datum završetka\",\"era\":\"era\",\"hour\":\"sat\",\"minute\":\"minuta\",\"month\":\"mjesec\",\"second\":\"sekunda\",\"startDate\":\"Datum početka\",\"year\":\"godina\",\"weekday\":\"dan u tjednu\",\"timeZoneName\":\"vremenska zona\"}"); | ||
/* | ||
* Copyright 2020 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
// @ts-ignore | ||
const $c1a8bb7b70528f3f1285786fdf18b77$var$intlMessages = { | ||
"ar-AE": _babelRuntimeHelpersInteropRequireDefault($be926026280e076dd0b048671d4b$exports).default, | ||
"bg-BG": _babelRuntimeHelpersInteropRequireDefault($bab398828901e91cda5ace996e16743$exports).default, | ||
"cs-CZ": _babelRuntimeHelpersInteropRequireDefault($a1b39c1203bddacb07ac8af1bf09f93d$exports).default, | ||
"da-DK": _babelRuntimeHelpersInteropRequireDefault($de6d54fc6253e3aab217ab66cc92632$exports).default, | ||
"de-DE": _babelRuntimeHelpersInteropRequireDefault($c62d85e73a4bc4d2d79c4e5438a0a3$exports).default, | ||
"el-GR": _babelRuntimeHelpersInteropRequireDefault($e7f2c17a4d052730760575ff7cf57df6$exports).default, | ||
"en-US": _babelRuntimeHelpersInteropRequireDefault($adfdcb0b7f4822eaafecdabf45f751$exports).default, | ||
"es-ES": _babelRuntimeHelpersInteropRequireDefault($f9c516e0c25716b7d567ed2$exports).default, | ||
"et-EE": _babelRuntimeHelpersInteropRequireDefault($ba7274e4009469f7b66a9c93516dc421$exports).default, | ||
"fi-FI": _babelRuntimeHelpersInteropRequireDefault($c64b2869d31111b8a6212d3569c46edc$exports).default, | ||
"fr-FR": _babelRuntimeHelpersInteropRequireDefault($ba1e9adecce613badde3f8b2a91b9$exports).default, | ||
"he-IL": _babelRuntimeHelpersInteropRequireDefault($da5d80bcf16af82fe7b14fc1e9d9$exports).default, | ||
"hr-HR": _babelRuntimeHelpersInteropRequireDefault($c179e9a34711caa46568a537c351781$exports).default, | ||
"hu-HU": _babelRuntimeHelpersInteropRequireDefault($a40a6dd4cfb1bd1de71f82470d8716$exports).default, | ||
"it-IT": _babelRuntimeHelpersInteropRequireDefault($b9be9a4b72f2aadd1d314520c1acfc$exports).default, | ||
"ja-JP": _babelRuntimeHelpersInteropRequireDefault($b41d870af1ac3496d01f8698fb5c954$exports).default, | ||
"ko-KR": _babelRuntimeHelpersInteropRequireDefault($fe0c574bf48312400dd82a37538c16ef$exports).default, | ||
"lt-LT": _babelRuntimeHelpersInteropRequireDefault($b0ad35113dfe9f264970b85837$exports).default, | ||
"lv-LV": _babelRuntimeHelpersInteropRequireDefault($c670847f13ef745cf51c4d927173b$exports).default, | ||
"nb-NO": _babelRuntimeHelpersInteropRequireDefault($d59ad4442794aa8d7415835505965b2$exports).default, | ||
"nl-NL": _babelRuntimeHelpersInteropRequireDefault($ea0bd7fd22f4939550fa7411df8295f2$exports).default, | ||
"pl-PL": _babelRuntimeHelpersInteropRequireDefault($c08613207efc8ea834b1fadda995620b$exports).default, | ||
"pt-BR": _babelRuntimeHelpersInteropRequireDefault($c53c2ff9b6580a8da286c11a97f27c0c$exports).default, | ||
"pt-PT": _babelRuntimeHelpersInteropRequireDefault($d9eb517021c8b3bace06723f935$exports).default, | ||
"ro-RO": _babelRuntimeHelpersInteropRequireDefault($b374a5303a356023e59a4df3c152bebf$exports).default, | ||
"ru-RU": _babelRuntimeHelpersInteropRequireDefault($e72056058c9fa1ea634cd2d7f7700$exports).default, | ||
"sk-SK": _babelRuntimeHelpersInteropRequireDefault($ab8e21cbc487e19c15c39cc2df98aed6$exports).default, | ||
"sl-SI": _babelRuntimeHelpersInteropRequireDefault($a155de298a83a5c6e328091b4347a$exports).default, | ||
"sr-SP": _babelRuntimeHelpersInteropRequireDefault($f93e8a2d2993e66b87975762a481$exports).default, | ||
"sv-SE": _babelRuntimeHelpersInteropRequireDefault($d90bf5621eeb550e11f07fd645ee9375$exports).default, | ||
"tr-TR": _babelRuntimeHelpersInteropRequireDefault($aa582d9ff36fb511de0ccb22bd9e2bb$exports).default, | ||
"uk-UA": _babelRuntimeHelpersInteropRequireDefault($a1ed5505308b04ac9cd1c488538019c3$exports).default, | ||
"zh-CN": _babelRuntimeHelpersInteropRequireDefault($c6b9bcbebc7c1f385b7e70bbd744b53$exports).default, | ||
"zh-TW": _babelRuntimeHelpersInteropRequireDefault($ae51b3cde9961c4855b77ac499ea$exports).default | ||
}; | ||
function useDisplayNames() { | ||
let { | ||
locale | ||
} = useLocale(); | ||
return useMemo(() => { | ||
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField | ||
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2 | ||
try { | ||
// @ts-ignore | ||
return new Intl.DisplayNames(locale, { | ||
type: 'dateTimeField' | ||
}); | ||
} catch (err) { | ||
return new $c1a8bb7b70528f3f1285786fdf18b77$var$DisplayNamesPolyfill(locale); | ||
} | ||
}, [locale]); | ||
} | ||
var $2cc5b3664294ea6e$exports = {}; | ||
$2cc5b3664294ea6e$exports = JSON.parse("{\"calendar\":\"Naptár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Dátumtartomány\",\"day\":\"nap\",\"dayPeriod\":\"napszak\",\"endDate\":\"Befejező dátum\",\"era\":\"éra\",\"hour\":\"óra\",\"minute\":\"perc\",\"month\":\"hónap\",\"second\":\"másodperc\",\"startDate\":\"Kezdő dátum\",\"year\":\"év\",\"weekday\":\"hét napja\",\"timeZoneName\":\"időzóna\"}"); | ||
exports.useDisplayNames = useDisplayNames; | ||
class $c1a8bb7b70528f3f1285786fdf18b77$var$DisplayNamesPolyfill { | ||
constructor(locale) { | ||
this.locale = void 0; | ||
this.dictionary = void 0; | ||
this.locale = locale; | ||
this.dictionary = new MessageDictionary($c1a8bb7b70528f3f1285786fdf18b77$var$intlMessages); | ||
} | ||
var $beafd07706552b1a$exports = {}; | ||
$beafd07706552b1a$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Da {start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervallo date\",\"day\":\"giorno\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data finale\",\"era\":\"era\",\"hour\":\"ora\",\"minute\":\"minuto\",\"month\":\"mese\",\"second\":\"secondo\",\"startDate\":\"Data iniziale\",\"year\":\"anno\",\"weekday\":\"giorno della settimana\",\"timeZoneName\":\"fuso orario\"}"); | ||
of(field) { | ||
return this.dictionary.getStringForLocale(field, this.locale); | ||
} | ||
} | ||
var $b65cee7817fd570b$exports = {}; | ||
$b65cee7817fd570b$exports = JSON.parse("{\"calendar\":\"カレンダー\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"日付\",\"dateRange\":\"日付範囲\",\"day\":\"日\",\"dayPeriod\":\"午前/午後\",\"endDate\":\"終了日\",\"era\":\"時代\",\"hour\":\"時\",\"minute\":\"分\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日\",\"year\":\"年\",\"weekday\":\"曜日\",\"timeZoneName\":\"タイムゾーン\"}"); | ||
function useDateSegment(props, segment, state, ref) { | ||
let enteredKeys = useRef(''); | ||
let { | ||
locale, | ||
direction | ||
} = useLocale(); | ||
let displayNames = useDisplayNames(); | ||
let focusManager = useFocusManager(); | ||
let textValue = segment.text; | ||
let options = useMemo(() => state.dateFormatter.resolvedOptions(), [state.dateFormatter]); | ||
let monthDateFormatter = useDateFormatter({ | ||
month: 'long', | ||
timeZone: options.timeZone | ||
}); | ||
let hourDateFormatter = useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: options.hour12, | ||
timeZone: options.timeZone | ||
}); | ||
if (segment.type === 'month') { | ||
let monthTextValue = monthDateFormatter.format(state.dateValue); | ||
textValue = monthTextValue !== textValue ? textValue + " \u2013 " + monthTextValue : monthTextValue; | ||
} else if (segment.type === 'hour' || segment.type === 'dayPeriod') { | ||
textValue = hourDateFormatter.format(state.dateValue); | ||
} | ||
var $db6eff1d2cc9305e$exports = {}; | ||
$db6eff1d2cc9305e$exports = JSON.parse("{\"calendar\":\"달력\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"날짜\",\"dateRange\":\"날짜 범위\",\"day\":\"일\",\"dayPeriod\":\"오전/오후\",\"endDate\":\"종료 날짜\",\"era\":\"연호\",\"hour\":\"시\",\"minute\":\"분\",\"month\":\"월\",\"second\":\"초\",\"startDate\":\"시작 날짜\",\"year\":\"년\",\"weekday\":\"요일\",\"timeZoneName\":\"시간대\"}"); | ||
let { | ||
spinButtonProps | ||
} = useSpinButton({ | ||
value: segment.value, | ||
textValue, | ||
minValue: segment.minValue, | ||
maxValue: segment.maxValue, | ||
isDisabled: props.isDisabled, | ||
isReadOnly: props.isReadOnly || !segment.isEditable, | ||
isRequired: props.isRequired, | ||
onIncrement: () => { | ||
enteredKeys.current = ''; | ||
state.increment(segment.type); | ||
}, | ||
onDecrement: () => { | ||
enteredKeys.current = ''; | ||
state.decrement(segment.type); | ||
}, | ||
onIncrementPage: () => { | ||
enteredKeys.current = ''; | ||
state.incrementPage(segment.type); | ||
}, | ||
onDecrementPage: () => { | ||
enteredKeys.current = ''; | ||
state.decrementPage(segment.type); | ||
}, | ||
onIncrementToMax: () => { | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.maxValue); | ||
}, | ||
onDecrementToMin: () => { | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.minValue); | ||
} | ||
}); | ||
let parser = useMemo(() => new NumberParser(locale, { | ||
maximumFractionDigits: 0 | ||
}), [locale]); | ||
let backspace = () => { | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly && !segment.isPlaceholder) { | ||
let newValue = segment.text.slice(0, -1); | ||
let parsed = parser.parse(newValue); | ||
var $39c9eeb53669dbc8$exports = {}; | ||
$39c9eeb53669dbc8$exports = JSON.parse("{\"calendar\":\"Kalendorius\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Nuo {start, date, long} iki {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Datų intervalas\",\"day\":\"diena\",\"dayPeriod\":\"iki pietų / po pietų\",\"endDate\":\"Pabaigos data\",\"era\":\"era\",\"hour\":\"valanda\",\"minute\":\"minutė\",\"month\":\"mėnuo\",\"second\":\"sekundė\",\"startDate\":\"Pradžios data\",\"year\":\"metai\",\"weekday\":\"savaitės diena\",\"timeZoneName\":\"laiko juosta\"}"); | ||
if (newValue.length === 0 || parsed === 0) { | ||
state.clearSegment(segment.type); | ||
} else { | ||
state.setSegment(segment.type, parsed); | ||
} | ||
enteredKeys.current = newValue; | ||
} else if (segment.type === 'dayPeriod') { | ||
state.clearSegment(segment.type); | ||
} | ||
}; | ||
var $c28282c169c4dba9$exports = {}; | ||
$c28282c169c4dba9$exports = JSON.parse("{\"calendar\":\"Kalendārs\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} līdz {end, date, long}\",\"date\":\"Datums\",\"dateRange\":\"Datumu diapazons\",\"day\":\"diena\",\"dayPeriod\":\"priekšpusdienā/pēcpusdienā\",\"endDate\":\"Beigu datums\",\"era\":\"ēra\",\"hour\":\"stundas\",\"minute\":\"minūtes\",\"month\":\"mēnesis\",\"second\":\"sekundes\",\"startDate\":\"Sākuma datums\",\"year\":\"gads\",\"weekday\":\"nedēļas diena\",\"timeZoneName\":\"laika josla\"}"); | ||
let onKeyDown = e => { | ||
// Firefox does not fire selectstart for Ctrl/Cmd + A | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 | ||
if (e.key === 'a' && (isMac() ? e.metaKey : e.ctrlKey)) { | ||
e.preventDefault(); | ||
} | ||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) { | ||
return; | ||
} | ||
var $779bf05b7c5c6985$exports = {}; | ||
$779bf05b7c5c6985$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datoområde\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Sluttdato\",\"era\":\"tidsalder\",\"hour\":\"time\",\"minute\":\"minutt\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ukedag\",\"timeZoneName\":\"tidssone\"}"); | ||
switch (e.key) { | ||
case 'ArrowLeft': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (direction === 'rtl') { | ||
focusManager.focusNext(); | ||
} else { | ||
focusManager.focusPrevious(); | ||
} | ||
var $665a9e26595f0b7a$exports = {}; | ||
$665a9e26595f0b7a$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} t/m {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumbereik\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Einddatum\",\"era\":\"tijdperk\",\"hour\":\"uur\",\"minute\":\"minuut\",\"month\":\"maand\",\"second\":\"seconde\",\"startDate\":\"Startdatum\",\"year\":\"jaar\",\"weekday\":\"dag van de week\",\"timeZoneName\":\"tijdzone\"}"); | ||
break; | ||
case 'ArrowRight': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var $b75ff73faae35a35$exports = {}; | ||
$b75ff73faae35a35$exports = JSON.parse("{\"calendar\":\"Kalendarz\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Zakres dat\",\"day\":\"dzień\",\"dayPeriod\":\"rano / po południu / wieczorem\",\"endDate\":\"Data końcowa\",\"era\":\"era\",\"hour\":\"godzina\",\"minute\":\"minuta\",\"month\":\"miesiąc\",\"second\":\"sekunda\",\"startDate\":\"Data początkowa\",\"year\":\"rok\",\"weekday\":\"dzień tygodnia\",\"timeZoneName\":\"strefa czasowa\"}"); | ||
if (direction === 'rtl') { | ||
focusManager.focusPrevious(); | ||
} else { | ||
focusManager.focusNext(); | ||
} | ||
break; | ||
var $d012e405a4afd3e7$exports = {}; | ||
$d012e405a4afd3e7$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data inicial\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
case 'Enter': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (segment.isPlaceholder && !props.isReadOnly) { | ||
state.confirmPlaceholder(segment.type); | ||
} | ||
var $defe0662285d1701$exports = {}; | ||
$defe0662285d1701$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"am/pm\",\"endDate\":\"Data de Término\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data de Início\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
focusManager.focusNext(); | ||
break; | ||
case 'Tab': | ||
break; | ||
var $f9acea7b67f5fdff$exports = {}; | ||
$f9acea7b67f5fdff$exports = JSON.parse("{\"calendar\":\"Calendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Dată\",\"dateRange\":\"Raza datei\",\"day\":\"zi\",\"dayPeriod\":\"a.m/p.m.\",\"endDate\":\"Dată final\",\"era\":\"eră\",\"hour\":\"oră\",\"minute\":\"minut\",\"month\":\"lună\",\"second\":\"secundă\",\"startDate\":\"Dată început\",\"year\":\"an\",\"weekday\":\"ziua din săptămână\",\"timeZoneName\":\"fus orar\"}"); | ||
case 'Backspace': | ||
case 'Delete': | ||
{ | ||
// Safari on iOS does not fire beforeinput for the backspace key because the cursor is at the start. | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
backspace(); | ||
break; | ||
} | ||
} | ||
}; // Safari dayPeriod option doesn't work... | ||
var $44d161a4fd9a4479$exports = {}; | ||
$44d161a4fd9a4479$exports = JSON.parse("{\"calendar\":\"Календарь\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Диапазон дат\",\"day\":\"день\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Дата окончания\",\"era\":\"эра\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месяц\",\"second\":\"секунда\",\"startDate\":\"Дата начала\",\"year\":\"год\",\"weekday\":\"день недели\",\"timeZoneName\":\"часовой пояс\"}"); | ||
let { | ||
startsWith | ||
} = useFilter({ | ||
sensitivity: 'base' | ||
}); | ||
let amPmFormatter = useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: true | ||
}); | ||
let am = useMemo(() => { | ||
let date = new Date(); | ||
date.setHours(0); | ||
return amPmFormatter.formatToParts(date).find(part => part.type === 'dayPeriod').value; | ||
}, [amPmFormatter]); | ||
let pm = useMemo(() => { | ||
let date = new Date(); | ||
date.setHours(12); | ||
return amPmFormatter.formatToParts(date).find(part => part.type === 'dayPeriod').value; | ||
}, [amPmFormatter]); | ||
let onInput = key => { | ||
if (props.isDisabled || props.isReadOnly) { | ||
return; | ||
} | ||
var $f88e5125acb59f4e$exports = {}; | ||
$f88e5125acb59f4e$exports = JSON.parse("{\"calendar\":\"Kalendár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Rozsah dátumov\",\"day\":\"deň\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Dátum ukončenia\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minúta\",\"month\":\"mesiac\",\"second\":\"sekunda\",\"startDate\":\"Dátum začatia\",\"year\":\"rok\",\"weekday\":\"deň týždňa\",\"timeZoneName\":\"časové pásmo\"}"); | ||
let newValue = enteredKeys.current + key; | ||
switch (segment.type) { | ||
case 'dayPeriod': | ||
if (startsWith(am, key)) { | ||
state.setSegment('dayPeriod', 0); | ||
} else if (startsWith(pm, key)) { | ||
state.setSegment('dayPeriod', 12); | ||
} else { | ||
break; | ||
} | ||
var $3f60f00afb879ab9$exports = {}; | ||
$3f60f00afb879ab9$exports = JSON.parse("{\"calendar\":\"Koledar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumski obseg\",\"day\":\"dan\",\"dayPeriod\":\"dop/pop\",\"endDate\":\"Datum konca\",\"era\":\"doba\",\"hour\":\"ura\",\"minute\":\"minuta\",\"month\":\"mesec\",\"second\":\"sekunda\",\"startDate\":\"Datum začetka\",\"year\":\"leto\",\"weekday\":\"dan v tednu\",\"timeZoneName\":\"časovni pas\"}"); | ||
focusManager.focusNext(); | ||
break; | ||
case 'day': | ||
case 'hour': | ||
case 'minute': | ||
case 'second': | ||
case 'month': | ||
case 'year': | ||
{ | ||
if (!parser.isValidPartialNumber(newValue)) { | ||
return; | ||
} | ||
var $2c429c74b95fbbb3$exports = {}; | ||
$2c429c74b95fbbb3$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Opseg datuma\",\"day\":\"дан\",\"dayPeriod\":\"пре подне/по подне\",\"endDate\":\"Datum završetka\",\"era\":\"ера\",\"hour\":\"сат\",\"minute\":\"минут\",\"month\":\"месец\",\"second\":\"секунд\",\"startDate\":\"Datum početka\",\"year\":\"година\",\"weekday\":\"дан у недељи\",\"timeZoneName\":\"временска зона\"}"); | ||
let numberValue = parser.parse(newValue); | ||
let segmentValue = numberValue; | ||
let allowsZero = segment.minValue === 0; | ||
if (segment.type === 'hour' && state.dateFormatter.resolvedOptions().hour12) { | ||
switch (state.dateFormatter.resolvedOptions().hourCycle) { | ||
case 'h11': | ||
if (numberValue > 11) { | ||
segmentValue = parser.parse(key); | ||
} | ||
var $c3ae416e0c8ea35d$exports = {}; | ||
$c3ae416e0c8ea35d$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} till {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumintervall\",\"day\":\"dag\",\"dayPeriod\":\"fm/em\",\"endDate\":\"Slutdatum\",\"era\":\"era\",\"hour\":\"timme\",\"minute\":\"minut\",\"month\":\"månad\",\"second\":\"sekund\",\"startDate\":\"Startdatum\",\"year\":\"år\",\"weekday\":\"veckodag\",\"timeZoneName\":\"tidszon\"}"); | ||
break; | ||
case 'h12': | ||
allowsZero = false; | ||
var $6548dada79dc88ed$exports = {}; | ||
$6548dada79dc88ed$exports = JSON.parse("{\"calendar\":\"Takvim\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Tarih\",\"dateRange\":\"Tarih Aralığı\",\"day\":\"gün\",\"dayPeriod\":\"ÖÖ/ÖS\",\"endDate\":\"Bitiş Tarihi\",\"era\":\"çağ\",\"hour\":\"saat\",\"minute\":\"dakika\",\"month\":\"ay\",\"second\":\"saniye\",\"startDate\":\"Başlangıç Tarihi\",\"year\":\"yıl\",\"weekday\":\"haftanın günü\",\"timeZoneName\":\"saat dilimi\"}"); | ||
if (numberValue > 12) { | ||
segmentValue = parser.parse(key); | ||
} | ||
break; | ||
} | ||
var $75ff58c24ecc2405$exports = {}; | ||
$75ff58c24ecc2405$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Від {start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Діапазон дат\",\"day\":\"день\",\"dayPeriod\":\"дп/пп\",\"endDate\":\"Дата завершення\",\"era\":\"ера\",\"hour\":\"година\",\"minute\":\"хвилина\",\"month\":\"місяць\",\"second\":\"секунда\",\"startDate\":\"Дата початку\",\"year\":\"рік\",\"weekday\":\"день тижня\",\"timeZoneName\":\"часовий пояс\"}"); | ||
if (segment.value >= 12 && numberValue > 1) { | ||
numberValue += 12; | ||
} | ||
} else if (numberValue > segment.maxValue) { | ||
segmentValue = parser.parse(key); | ||
} | ||
if (isNaN(numberValue)) { | ||
return; | ||
} | ||
var $b300ea50d0bc8474$exports = {}; | ||
$b300ea50d0bc8474$exports = JSON.parse("{\"calendar\":\"日历\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} 至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期范围\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"结束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"开始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
let shouldSetValue = segmentValue !== 0 || allowsZero; | ||
if (shouldSetValue) { | ||
state.setSegment(segment.type, segmentValue); | ||
} | ||
var $a018547010e33d31$exports = {}; | ||
$a018547010e33d31$exports = JSON.parse("{\"calendar\":\"日曆\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期範圍\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"結束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
if (Number(numberValue + '0') > segment.maxValue || newValue.length >= String(segment.maxValue).length) { | ||
enteredKeys.current = ''; | ||
if (shouldSetValue) { | ||
focusManager.focusNext(); | ||
} | ||
} else { | ||
enteredKeys.current = newValue; | ||
} | ||
$5766533e00be07f5$exports = { | ||
"ar-AE": $7e1d533dafdd7a3c$exports, | ||
"bg-BG": $b645e4c88eddb7bc$exports, | ||
"cs-CZ": $c74d7d9a3a492e14$exports, | ||
"da-DK": $2fdf441aacd54e7a$exports, | ||
"de-DE": $cc895f32c87cd395$exports, | ||
"el-GR": $5f40c68998a77c84$exports, | ||
"en-US": $8ce6e70e61f75190$exports, | ||
"es-ES": $435f97ce46f2f3b7$exports, | ||
"et-EE": $6c72b2fc022593ee$exports, | ||
"fi-FI": $2c0058ef1406d1e1$exports, | ||
"fr-FR": $351fc2d9da05f66d$exports, | ||
"he-IL": $1c3921a882c95ab5$exports, | ||
"hr-HR": $c20d0e8e557c2a17$exports, | ||
"hu-HU": $2cc5b3664294ea6e$exports, | ||
"it-IT": $beafd07706552b1a$exports, | ||
"ja-JP": $b65cee7817fd570b$exports, | ||
"ko-KR": $db6eff1d2cc9305e$exports, | ||
"lt-LT": $39c9eeb53669dbc8$exports, | ||
"lv-LV": $c28282c169c4dba9$exports, | ||
"nb-NO": $779bf05b7c5c6985$exports, | ||
"nl-NL": $665a9e26595f0b7a$exports, | ||
"pl-PL": $b75ff73faae35a35$exports, | ||
"pt-BR": $d012e405a4afd3e7$exports, | ||
"pt-PT": $defe0662285d1701$exports, | ||
"ro-RO": $f9acea7b67f5fdff$exports, | ||
"ru-RU": $44d161a4fd9a4479$exports, | ||
"sk-SK": $f88e5125acb59f4e$exports, | ||
"sl-SI": $3f60f00afb879ab9$exports, | ||
"sr-SP": $2c429c74b95fbbb3$exports, | ||
"sv-SE": $c3ae416e0c8ea35d$exports, | ||
"tr-TR": $6548dada79dc88ed$exports, | ||
"uk-UA": $75ff58c24ecc2405$exports, | ||
"zh-CN": $b300ea50d0bc8474$exports, | ||
"zh-TW": $a018547010e33d31$exports | ||
}; | ||
break; | ||
function $56725a1cb2afa258$export$4a931266a3838b86(state, ref) { | ||
// Open the popover on alt + arrow down | ||
let onKeyDown = (e)=>{ | ||
if (e.altKey && e.key === 'ArrowDown' && 'setOpen' in state) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
state.setOpen(true); | ||
} | ||
} | ||
}; | ||
}; | ||
// Focus the first placeholder segment from the end on mouse down/touch up in the field. | ||
let focusLast = ()=>{ | ||
let elements = ref.current.querySelectorAll('[tabindex="0"]'); | ||
let index = elements.length - 1; | ||
while(index >= 0 && elements[index].getAttribute('aria-placeholder'))index--; | ||
index = Math.min(index + 1, elements.length - 1); | ||
let element = elements[index]; | ||
if (element) element.focus(); | ||
}; | ||
let { pressProps: pressProps } = $RqPov$reactariainteractions.usePress({ | ||
onPressStart (e) { | ||
if (e.pointerType === 'mouse') focusLast(); | ||
}, | ||
onPress (e) { | ||
if (e.pointerType !== 'mouse') focusLast(); | ||
} | ||
}); | ||
return $RqPov$reactariautils.mergeProps(pressProps, { | ||
onKeyDown: onKeyDown | ||
}); | ||
} | ||
let onFocus = () => { | ||
enteredKeys.current = ''; | ||
scrollIntoView(getScrollParent(ref.current), ref.current); // Safari requires that a selection is set or it won't fire input events. | ||
// Since usePress disables text selection, this won't happen by default. | ||
ref.current.style.webkitUserSelect = 'text'; | ||
let selection = window.getSelection(); | ||
selection.collapse(ref.current); | ||
ref.current.style.webkitUserSelect = ''; | ||
}; | ||
let compositionRef = useRef(''); // @ts-ignore - TODO: possibly old TS version? doesn't fail in my editor... | ||
useEvent(ref, 'beforeinput', e => { | ||
e.preventDefault(); | ||
function $cb7d2152263d2ab6$export$42df105a73306d51(props, state, ref) { | ||
let buttonId = $RqPov$reactariautils.useId(); | ||
let dialogId = $RqPov$reactariautils.useId(); | ||
let formatMessage = $RqPov$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($5766533e00be07f5$exports))); | ||
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $RqPov$reactarialabel.useField({ | ||
...props, | ||
labelElementType: 'span' | ||
}); | ||
let groupProps = $56725a1cb2afa258$export$4a931266a3838b86(state, ref); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { locale: locale } = $RqPov$reactariai18n.useLocale(); | ||
let descProps = $RqPov$reactariautils.useDescription(state.formatValue(locale, { | ||
month: 'long' | ||
})); | ||
let ariaDescribedBy = [ | ||
descProps['aria-describedby'], | ||
fieldProps['aria-describedby'] | ||
].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: $RqPov$reactariautils.mergeProps(groupProps, descProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-labelledby': labelledBy, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: { | ||
...labelProps, | ||
onClick: ()=>{ | ||
let focusManager = $RqPov$reactariafocus.createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}, | ||
fieldProps: fieldProps, | ||
descriptionProps: descriptionProps, | ||
errorMessageProps: errorMessageProps, | ||
buttonProps: { | ||
...descProps, | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': `${labelledBy} ${buttonId}`, | ||
'aria-describedby': ariaDescribedBy | ||
}, | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': `${labelledBy} ${buttonId}` | ||
} | ||
}; | ||
} | ||
switch (e.inputType) { | ||
case 'deleteContentBackward': | ||
case 'deleteContentForward': | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly) { | ||
backspace(); | ||
var $93e3e69cab166b00$exports = {}; | ||
$parcel$export($93e3e69cab166b00$exports, "useDateSegment", () => $93e3e69cab166b00$export$1315d136e6f7581); | ||
var $0a17b9b24fd61cc6$exports = {}; | ||
$parcel$export($0a17b9b24fd61cc6$exports, "labelIds", () => $0a17b9b24fd61cc6$export$beb2340c1222c6d); | ||
$parcel$export($0a17b9b24fd61cc6$exports, "useDateField", () => $0a17b9b24fd61cc6$export$5591b0b878c1a989); | ||
const $0a17b9b24fd61cc6$export$beb2340c1222c6d = new WeakMap(); | ||
function $0a17b9b24fd61cc6$export$5591b0b878c1a989(props, state, ref) { | ||
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $RqPov$reactarialabel.useField({ | ||
...props, | ||
labelElementType: 'span' | ||
}); | ||
let groupProps = $56725a1cb2afa258$export$4a931266a3838b86(state, ref); | ||
let { focusWithinProps: focusWithinProps } = $RqPov$reactariainteractions.useFocusWithin({ | ||
onBlurWithin () { | ||
state.confirmPlaceholder(); | ||
} | ||
}); | ||
let formatter = $RqPov$reactariai18n.useDateFormatter(state.getFormatOptions({ | ||
month: 'long' | ||
})); | ||
let descProps = $RqPov$reactariautils.useDescription(state.value ? formatter.format(state.dateValue) : null); | ||
let segmentLabelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let describedBy = [ | ||
descProps['aria-describedby'], | ||
fieldProps['aria-describedby'] | ||
].filter(Boolean).join(' ') || undefined; | ||
$0a17b9b24fd61cc6$export$beb2340c1222c6d.set(state, { | ||
ariaLabelledBy: segmentLabelledBy, | ||
ariaDescribedBy: describedBy | ||
}); | ||
return { | ||
labelProps: { | ||
...labelProps, | ||
onClick: ()=>{ | ||
let focusManager = $RqPov$reactariafocus.createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}, | ||
fieldProps: $RqPov$reactariautils.mergeProps(fieldProps, descProps, groupProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || undefined, | ||
'aria-describedby': describedBy | ||
}), | ||
descriptionProps: descriptionProps, | ||
errorMessageProps: errorMessageProps | ||
}; | ||
} | ||
break; | ||
case 'insertCompositionText': | ||
// insertCompositionText cannot be canceled. | ||
// Record the current state of the element so we can restore it in the `input` event below. | ||
compositionRef.current = ref.current.textContent; // Safari gets stuck in a composition state unless we also assign to the value here. | ||
// eslint-disable-next-line no-self-assign | ||
ref.current.textContent = ref.current.textContent; | ||
break; | ||
default: | ||
if (e.data != null) { | ||
onInput(e.data); | ||
var $2b06c75983817eb5$exports = {}; | ||
$parcel$export($2b06c75983817eb5$exports, "useDisplayNames", () => $2b06c75983817eb5$export$d42c60378c8168f8); | ||
function $2b06c75983817eb5$export$d42c60378c8168f8() { | ||
let { locale: locale } = $RqPov$reactariai18n.useLocale(); | ||
return $RqPov$react.useMemo(()=>{ | ||
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField | ||
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2 | ||
try { | ||
// @ts-ignore | ||
return new Intl.DisplayNames(locale, { | ||
type: 'dateTimeField' | ||
}); | ||
} catch (err) { | ||
return new $2b06c75983817eb5$var$DisplayNamesPolyfill(locale); | ||
} | ||
break; | ||
}, [ | ||
locale | ||
]); | ||
} | ||
class $2b06c75983817eb5$var$DisplayNamesPolyfill { | ||
constructor(locale){ | ||
this.locale = locale; | ||
this.dictionary = new $RqPov$internationalizedmessage.MessageDictionary((/*@__PURE__*/$parcel$interopDefault($5766533e00be07f5$exports))); | ||
} | ||
}); | ||
useEvent(ref, 'input', e => { | ||
let { | ||
inputType, | ||
data | ||
} = e; | ||
of(field) { | ||
return this.dictionary.getStringForLocale(field, this.locale); | ||
} | ||
} | ||
switch (inputType) { | ||
case 'insertCompositionText': | ||
// Reset the DOM to how it was in the beforeinput event. | ||
ref.current.textContent = compositionRef.current; // Android sometimes fires key presses of letters as composition events. Need to handle am/pm keys here too. | ||
// Can also happen e.g. with Pinyin keyboard on iOS. | ||
if (startsWith(am, data) || startsWith(pm, data)) { | ||
onInput(data); | ||
function $93e3e69cab166b00$export$1315d136e6f7581(props, segment, state, ref) { | ||
let enteredKeys = $RqPov$react.useRef(''); | ||
let { locale: locale , direction: direction } = $RqPov$reactariai18n.useLocale(); | ||
let displayNames = $2b06c75983817eb5$export$d42c60378c8168f8(); | ||
let focusManager = $RqPov$reactariafocus.useFocusManager(); | ||
let textValue = segment.text; | ||
let options = $RqPov$react.useMemo(()=>state.dateFormatter.resolvedOptions() | ||
, [ | ||
state.dateFormatter | ||
]); | ||
let monthDateFormatter = $RqPov$reactariai18n.useDateFormatter({ | ||
month: 'long', | ||
timeZone: options.timeZone | ||
}); | ||
let hourDateFormatter = $RqPov$reactariai18n.useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: options.hour12, | ||
timeZone: options.timeZone | ||
}); | ||
if (segment.type === 'month') { | ||
let monthTextValue = monthDateFormatter.format(state.dateValue); | ||
textValue = monthTextValue !== textValue ? `${textValue} – ${monthTextValue}` : monthTextValue; | ||
} else if (segment.type === 'hour' || segment.type === 'dayPeriod') textValue = hourDateFormatter.format(state.dateValue); | ||
let { spinButtonProps: spinButtonProps } = $RqPov$reactariaspinbutton.useSpinButton({ | ||
value: segment.value, | ||
textValue: textValue, | ||
minValue: segment.minValue, | ||
maxValue: segment.maxValue, | ||
isDisabled: props.isDisabled, | ||
isReadOnly: props.isReadOnly || !segment.isEditable, | ||
isRequired: props.isRequired, | ||
onIncrement: ()=>{ | ||
enteredKeys.current = ''; | ||
state.increment(segment.type); | ||
}, | ||
onDecrement: ()=>{ | ||
enteredKeys.current = ''; | ||
state.decrement(segment.type); | ||
}, | ||
onIncrementPage: ()=>{ | ||
enteredKeys.current = ''; | ||
state.incrementPage(segment.type); | ||
}, | ||
onDecrementPage: ()=>{ | ||
enteredKeys.current = ''; | ||
state.decrementPage(segment.type); | ||
}, | ||
onIncrementToMax: ()=>{ | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.maxValue); | ||
}, | ||
onDecrementToMin: ()=>{ | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.minValue); | ||
} | ||
}); | ||
let parser = $RqPov$react.useMemo(()=>new $RqPov$internationalizednumber.NumberParser(locale, { | ||
maximumFractionDigits: 0 | ||
}) | ||
, [ | ||
locale | ||
]); | ||
let backspace = ()=>{ | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly && !segment.isPlaceholder) { | ||
let newValue = segment.text.slice(0, -1); | ||
let parsed = parser.parse(newValue); | ||
if (newValue.length === 0 || parsed === 0) state.clearSegment(segment.type); | ||
else state.setSegment(segment.type, parsed); | ||
enteredKeys.current = newValue; | ||
} else if (segment.type === 'dayPeriod') state.clearSegment(segment.type); | ||
}; | ||
let onKeyDown = (e)=>{ | ||
// Firefox does not fire selectstart for Ctrl/Cmd + A | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 | ||
if (e.key === 'a' && ($RqPov$reactariautils.isMac() ? e.metaKey : e.ctrlKey)) e.preventDefault(); | ||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return; | ||
switch(e.key){ | ||
case 'ArrowLeft': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (direction === 'rtl') focusManager.focusNext(); | ||
else focusManager.focusPrevious(); | ||
break; | ||
case 'ArrowRight': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (direction === 'rtl') focusManager.focusPrevious(); | ||
else focusManager.focusNext(); | ||
break; | ||
case 'Enter': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (segment.isPlaceholder && !props.isReadOnly) state.confirmPlaceholder(segment.type); | ||
focusManager.focusNext(); | ||
break; | ||
case 'Tab': | ||
break; | ||
case 'Backspace': | ||
case 'Delete': | ||
// Safari on iOS does not fire beforeinput for the backspace key because the cursor is at the start. | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
backspace(); | ||
break; | ||
} | ||
}; | ||
// Safari dayPeriod option doesn't work... | ||
let { startsWith: startsWith } = $RqPov$reactariai18n.useFilter({ | ||
sensitivity: 'base' | ||
}); | ||
let amPmFormatter = $RqPov$reactariai18n.useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: true | ||
}); | ||
let am = $RqPov$react.useMemo(()=>{ | ||
let date = new Date(); | ||
date.setHours(0); | ||
return amPmFormatter.formatToParts(date).find((part)=>part.type === 'dayPeriod' | ||
).value; | ||
}, [ | ||
amPmFormatter | ||
]); | ||
let pm = $RqPov$react.useMemo(()=>{ | ||
let date = new Date(); | ||
date.setHours(12); | ||
return amPmFormatter.formatToParts(date).find((part)=>part.type === 'dayPeriod' | ||
).value; | ||
}, [ | ||
amPmFormatter | ||
]); | ||
let onInput = (key)=>{ | ||
if (props.isDisabled || props.isReadOnly) return; | ||
let newValue = enteredKeys.current + key; | ||
switch(segment.type){ | ||
case 'dayPeriod': | ||
if (startsWith(am, key)) state.setSegment('dayPeriod', 0); | ||
else if (startsWith(pm, key)) state.setSegment('dayPeriod', 12); | ||
else break; | ||
focusManager.focusNext(); | ||
break; | ||
case 'day': | ||
case 'hour': | ||
case 'minute': | ||
case 'second': | ||
case 'month': | ||
case 'year': | ||
{ | ||
if (!parser.isValidPartialNumber(newValue)) return; | ||
let numberValue = parser.parse(newValue); | ||
let segmentValue = numberValue; | ||
let allowsZero = segment.minValue === 0; | ||
if (segment.type === 'hour' && state.dateFormatter.resolvedOptions().hour12) { | ||
switch(state.dateFormatter.resolvedOptions().hourCycle){ | ||
case 'h11': | ||
if (numberValue > 11) segmentValue = parser.parse(key); | ||
break; | ||
case 'h12': | ||
allowsZero = false; | ||
if (numberValue > 12) segmentValue = parser.parse(key); | ||
break; | ||
} | ||
if (segment.value >= 12 && numberValue > 1) numberValue += 12; | ||
} else if (numberValue > segment.maxValue) segmentValue = parser.parse(key); | ||
if (isNaN(numberValue)) return; | ||
let shouldSetValue = segmentValue !== 0 || allowsZero; | ||
if (shouldSetValue) state.setSegment(segment.type, segmentValue); | ||
if (Number(numberValue + '0') > segment.maxValue || newValue.length >= String(segment.maxValue).length) { | ||
enteredKeys.current = ''; | ||
if (shouldSetValue) focusManager.focusNext(); | ||
} else enteredKeys.current = newValue; | ||
break; | ||
} | ||
} | ||
}; | ||
let onFocus = ()=>{ | ||
enteredKeys.current = ''; | ||
$RqPov$reactariautils.scrollIntoView($RqPov$reactariautils.getScrollParent(ref.current), ref.current); | ||
// Safari requires that a selection is set or it won't fire input events. | ||
// Since usePress disables text selection, this won't happen by default. | ||
ref.current.style.webkitUserSelect = 'text'; | ||
let selection = window.getSelection(); | ||
selection.collapse(ref.current); | ||
ref.current.style.webkitUserSelect = ''; | ||
}; | ||
let compositionRef = $RqPov$react.useRef(''); | ||
// @ts-ignore - TODO: possibly old TS version? doesn't fail in my editor... | ||
$RqPov$reactariautils.useEvent(ref, 'beforeinput', (e)=>{ | ||
e.preventDefault(); | ||
switch(e.inputType){ | ||
case 'deleteContentBackward': | ||
case 'deleteContentForward': | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly) backspace(); | ||
break; | ||
case 'insertCompositionText': | ||
// insertCompositionText cannot be canceled. | ||
// Record the current state of the element so we can restore it in the `input` event below. | ||
compositionRef.current = ref.current.textContent; | ||
// Safari gets stuck in a composition state unless we also assign to the value here. | ||
// eslint-disable-next-line no-self-assign | ||
ref.current.textContent = ref.current.textContent; | ||
break; | ||
default: | ||
if (e.data != null) onInput(e.data); | ||
break; | ||
} | ||
}); | ||
$RqPov$reactariautils.useEvent(ref, 'input', (e)=>{ | ||
let { inputType: inputType , data: data } = e; | ||
switch(inputType){ | ||
case 'insertCompositionText': | ||
// Reset the DOM to how it was in the beforeinput event. | ||
ref.current.textContent = compositionRef.current; | ||
// Android sometimes fires key presses of letters as composition events. Need to handle am/pm keys here too. | ||
// Can also happen e.g. with Pinyin keyboard on iOS. | ||
if (startsWith(am, data) || startsWith(pm, data)) onInput(data); | ||
break; | ||
} | ||
}); | ||
// Focus on mouse down/touch up to match native textfield behavior. | ||
// usePress handles canceling text selection. | ||
let { pressProps: pressProps } = $RqPov$reactariainteractions.usePress({ | ||
preventFocusOnPress: true, | ||
onPressStart: (e)=>{ | ||
if (e.pointerType === 'mouse') e.target.focus(); | ||
}, | ||
onPress (e) { | ||
if (e.pointerType !== 'mouse') e.target.focus(); | ||
} | ||
}); | ||
// For Android: prevent selection on long press. | ||
$RqPov$reactariautils.useEvent(ref, 'selectstart', (e)=>{ | ||
e.preventDefault(); | ||
}); | ||
// spinbuttons cannot be focused with VoiceOver on iOS. | ||
let touchPropOverrides = $RqPov$reactariautils.isIOS() || segment.type === 'timeZoneName' ? { | ||
role: 'textbox', | ||
'aria-valuemax': null, | ||
'aria-valuemin': null, | ||
'aria-valuetext': null, | ||
'aria-valuenow': null | ||
} : { | ||
}; | ||
let { ariaLabelledBy: ariaLabelledBy , ariaDescribedBy: ariaDescribedBy } = $0a17b9b24fd61cc6$export$beb2340c1222c6d.get(state); | ||
// Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being | ||
// read every time the user navigates to a new segment. | ||
let firstSegment = $RqPov$react.useMemo(()=>state.segments.find((s)=>s.isEditable | ||
) | ||
, [ | ||
state.segments | ||
]); | ||
if (segment !== firstSegment && state.validationState !== 'invalid') ariaDescribedBy = undefined; | ||
let id = $RqPov$reactariautils.useId(props.id); | ||
let isEditable = !props.isDisabled && !props.isReadOnly && segment.isEditable; | ||
return { | ||
segmentProps: $RqPov$reactariautils.mergeProps(spinButtonProps, pressProps, { | ||
id: id, | ||
...touchPropOverrides, | ||
'aria-controls': props['aria-controls'], | ||
// 'aria-haspopup': props['aria-haspopup'], // deprecated in ARIA 1.2 | ||
'aria-invalid': state.validationState === 'invalid' ? 'true' : undefined, | ||
'aria-label': segment.type !== 'literal' ? displayNames.of(segment.type) : undefined, | ||
'aria-labelledby': `${ariaLabelledBy} ${id}`, | ||
'aria-describedby': ariaDescribedBy, | ||
'aria-placeholder': segment.isPlaceholder ? segment.text : undefined, | ||
'aria-readonly': props.isReadOnly || !segment.isEditable ? 'true' : undefined, | ||
contentEditable: isEditable, | ||
suppressContentEditableWarning: isEditable, | ||
spellCheck: isEditable ? 'false' : undefined, | ||
autoCapitalize: isEditable ? 'off' : undefined, | ||
autoCorrect: isEditable ? 'off' : undefined, | ||
// Capitalization was changed in React 17... | ||
[parseInt(($parcel$interopDefault($RqPov$react)).version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined, | ||
inputMode: props.isDisabled || segment.type === 'dayPeriod' || !isEditable ? undefined : 'numeric', | ||
tabIndex: props.isDisabled ? undefined : 0, | ||
onKeyDown: onKeyDown, | ||
onFocus: onFocus | ||
}) | ||
}; | ||
} | ||
break; | ||
} | ||
}); // Focus on mouse down/touch up to match native textfield behavior. | ||
// usePress handles canceling text selection. | ||
let { | ||
pressProps | ||
} = usePress({ | ||
preventFocusOnPress: true, | ||
onPressStart: e => { | ||
if (e.pointerType === 'mouse') { | ||
e.target.focus(); | ||
} | ||
}, | ||
onPress(e) { | ||
if (e.pointerType !== 'mouse') { | ||
e.target.focus(); | ||
} | ||
} | ||
var $53ea40b9383d8ad0$exports = {}; | ||
}); // For Android: prevent selection on long press. | ||
$parcel$export($53ea40b9383d8ad0$exports, "useDateRangePicker", () => $53ea40b9383d8ad0$export$12fd5f0e9f4bb192); | ||
useEvent(ref, 'selectstart', e => { | ||
e.preventDefault(); | ||
}); // spinbuttons cannot be focused with VoiceOver on iOS. | ||
let touchPropOverrides = isIOS() || segment.type === 'timeZoneName' ? { | ||
role: 'textbox', | ||
'aria-valuemax': null, | ||
'aria-valuemin': null, | ||
'aria-valuetext': null, | ||
'aria-valuenow': null | ||
} : {}; | ||
let { | ||
ariaLabelledBy, | ||
ariaDescribedBy | ||
} = labelIds.get(state); // Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being | ||
// read every time the user navigates to a new segment. | ||
let firstSegment = useMemo(() => state.segments.find(s => s.isEditable), [state.segments]); | ||
if (segment !== firstSegment && state.validationState !== 'invalid') { | ||
ariaDescribedBy = undefined; | ||
} | ||
let id = useId(props.id); | ||
let isEditable = !props.isDisabled && !props.isReadOnly && segment.isEditable; | ||
return { | ||
segmentProps: mergeProps(spinButtonProps, pressProps, _babelRuntimeHelpersExtends({ | ||
id | ||
}, touchPropOverrides, { | ||
'aria-controls': props['aria-controls'], | ||
// 'aria-haspopup': props['aria-haspopup'], // deprecated in ARIA 1.2 | ||
'aria-invalid': state.validationState === 'invalid' ? 'true' : undefined, | ||
'aria-label': segment.type !== 'literal' ? displayNames.of(segment.type) : undefined, | ||
'aria-labelledby': ariaLabelledBy + " " + id, | ||
'aria-describedby': ariaDescribedBy, | ||
'aria-placeholder': segment.isPlaceholder ? segment.text : undefined, | ||
'aria-readonly': props.isReadOnly || !segment.isEditable ? 'true' : undefined, | ||
contentEditable: isEditable, | ||
suppressContentEditableWarning: isEditable, | ||
spellCheck: isEditable ? 'false' : undefined, | ||
autoCapitalize: isEditable ? 'off' : undefined, | ||
autoCorrect: isEditable ? 'off' : undefined, | ||
// Capitalization was changed in React 17... | ||
[parseInt(_react.version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined, | ||
inputMode: props.isDisabled || segment.type === 'dayPeriod' || !isEditable ? undefined : 'numeric', | ||
tabIndex: props.isDisabled ? undefined : 0, | ||
onKeyDown, | ||
onFocus | ||
})) | ||
}; | ||
function $53ea40b9383d8ad0$export$12fd5f0e9f4bb192(props, state, ref) { | ||
let formatMessage = $RqPov$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($5766533e00be07f5$exports))); | ||
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $RqPov$reactarialabel.useField({ | ||
...props, | ||
labelElementType: 'span' | ||
}); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { locale: locale } = $RqPov$reactariai18n.useLocale(); | ||
let description = state.formatValue(locale, { | ||
month: 'long' | ||
}); | ||
let descProps = $RqPov$reactariautils.useDescription(description); | ||
let startFieldProps = $RqPov$reactariautils.useLabels({ | ||
'aria-label': formatMessage('startDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let endFieldProps = $RqPov$reactariautils.useLabels({ | ||
'aria-label': formatMessage('endDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let buttonId = $RqPov$reactariautils.useId(); | ||
let dialogId = $RqPov$reactariautils.useId(); | ||
let groupProps = $56725a1cb2afa258$export$4a931266a3838b86(state, ref); | ||
let { focusWithinProps: focusWithinProps } = $RqPov$reactariainteractions.useFocusWithin({ | ||
onBlurWithin () { | ||
state.confirmPlaceholder(); | ||
} | ||
}); | ||
let ariaDescribedBy = [ | ||
descProps['aria-describedby'], | ||
fieldProps['aria-describedby'] | ||
].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: $RqPov$reactariautils.mergeProps(groupProps, fieldProps, descProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: { | ||
...labelProps, | ||
onClick: ()=>{ | ||
let focusManager = $RqPov$reactariafocus.createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}, | ||
buttonProps: { | ||
...descProps, | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': `${labelledBy} ${buttonId}`, | ||
'aria-describedby': ariaDescribedBy | ||
}, | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': `${labelledBy} ${buttonId}` | ||
}, | ||
startFieldProps: { | ||
...startFieldProps, | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}, | ||
endFieldProps: { | ||
...endFieldProps, | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}, | ||
descriptionProps: descriptionProps, | ||
errorMessageProps: errorMessageProps | ||
}; | ||
} | ||
exports.useDateSegment = useDateSegment; | ||
// @ts-ignore | ||
const $ddcda6963a16ac7df68e63c656b9bc76$var$intlMessages = { | ||
"ar-AE": _babelRuntimeHelpersInteropRequireDefault($be926026280e076dd0b048671d4b$exports).default, | ||
"bg-BG": _babelRuntimeHelpersInteropRequireDefault($bab398828901e91cda5ace996e16743$exports).default, | ||
"cs-CZ": _babelRuntimeHelpersInteropRequireDefault($a1b39c1203bddacb07ac8af1bf09f93d$exports).default, | ||
"da-DK": _babelRuntimeHelpersInteropRequireDefault($de6d54fc6253e3aab217ab66cc92632$exports).default, | ||
"de-DE": _babelRuntimeHelpersInteropRequireDefault($c62d85e73a4bc4d2d79c4e5438a0a3$exports).default, | ||
"el-GR": _babelRuntimeHelpersInteropRequireDefault($e7f2c17a4d052730760575ff7cf57df6$exports).default, | ||
"en-US": _babelRuntimeHelpersInteropRequireDefault($adfdcb0b7f4822eaafecdabf45f751$exports).default, | ||
"es-ES": _babelRuntimeHelpersInteropRequireDefault($f9c516e0c25716b7d567ed2$exports).default, | ||
"et-EE": _babelRuntimeHelpersInteropRequireDefault($ba7274e4009469f7b66a9c93516dc421$exports).default, | ||
"fi-FI": _babelRuntimeHelpersInteropRequireDefault($c64b2869d31111b8a6212d3569c46edc$exports).default, | ||
"fr-FR": _babelRuntimeHelpersInteropRequireDefault($ba1e9adecce613badde3f8b2a91b9$exports).default, | ||
"he-IL": _babelRuntimeHelpersInteropRequireDefault($da5d80bcf16af82fe7b14fc1e9d9$exports).default, | ||
"hr-HR": _babelRuntimeHelpersInteropRequireDefault($c179e9a34711caa46568a537c351781$exports).default, | ||
"hu-HU": _babelRuntimeHelpersInteropRequireDefault($a40a6dd4cfb1bd1de71f82470d8716$exports).default, | ||
"it-IT": _babelRuntimeHelpersInteropRequireDefault($b9be9a4b72f2aadd1d314520c1acfc$exports).default, | ||
"ja-JP": _babelRuntimeHelpersInteropRequireDefault($b41d870af1ac3496d01f8698fb5c954$exports).default, | ||
"ko-KR": _babelRuntimeHelpersInteropRequireDefault($fe0c574bf48312400dd82a37538c16ef$exports).default, | ||
"lt-LT": _babelRuntimeHelpersInteropRequireDefault($b0ad35113dfe9f264970b85837$exports).default, | ||
"lv-LV": _babelRuntimeHelpersInteropRequireDefault($c670847f13ef745cf51c4d927173b$exports).default, | ||
"nb-NO": _babelRuntimeHelpersInteropRequireDefault($d59ad4442794aa8d7415835505965b2$exports).default, | ||
"nl-NL": _babelRuntimeHelpersInteropRequireDefault($ea0bd7fd22f4939550fa7411df8295f2$exports).default, | ||
"pl-PL": _babelRuntimeHelpersInteropRequireDefault($c08613207efc8ea834b1fadda995620b$exports).default, | ||
"pt-BR": _babelRuntimeHelpersInteropRequireDefault($c53c2ff9b6580a8da286c11a97f27c0c$exports).default, | ||
"pt-PT": _babelRuntimeHelpersInteropRequireDefault($d9eb517021c8b3bace06723f935$exports).default, | ||
"ro-RO": _babelRuntimeHelpersInteropRequireDefault($b374a5303a356023e59a4df3c152bebf$exports).default, | ||
"ru-RU": _babelRuntimeHelpersInteropRequireDefault($e72056058c9fa1ea634cd2d7f7700$exports).default, | ||
"sk-SK": _babelRuntimeHelpersInteropRequireDefault($ab8e21cbc487e19c15c39cc2df98aed6$exports).default, | ||
"sl-SI": _babelRuntimeHelpersInteropRequireDefault($a155de298a83a5c6e328091b4347a$exports).default, | ||
"sr-SP": _babelRuntimeHelpersInteropRequireDefault($f93e8a2d2993e66b87975762a481$exports).default, | ||
"sv-SE": _babelRuntimeHelpersInteropRequireDefault($d90bf5621eeb550e11f07fd645ee9375$exports).default, | ||
"tr-TR": _babelRuntimeHelpersInteropRequireDefault($aa582d9ff36fb511de0ccb22bd9e2bb$exports).default, | ||
"uk-UA": _babelRuntimeHelpersInteropRequireDefault($a1ed5505308b04ac9cd1c488538019c3$exports).default, | ||
"zh-CN": _babelRuntimeHelpersInteropRequireDefault($c6b9bcbebc7c1f385b7e70bbd744b53$exports).default, | ||
"zh-TW": _babelRuntimeHelpersInteropRequireDefault($ae51b3cde9961c4855b77ac499ea$exports).default | ||
}; | ||
function useDateRangePicker(props, state, ref) { | ||
let formatMessage = useMessageFormatter($ddcda6963a16ac7df68e63c656b9bc76$var$intlMessages); | ||
let { | ||
labelProps, | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps | ||
} = useField(_babelRuntimeHelpersExtends({}, props, { | ||
labelElementType: 'span' | ||
})); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { | ||
locale | ||
} = useLocale(); | ||
let description = state.formatValue(locale, { | ||
month: 'long' | ||
}); | ||
let descProps = useDescription(description); | ||
let startFieldProps = useLabels({ | ||
'aria-label': formatMessage('startDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let endFieldProps = useLabels({ | ||
'aria-label': formatMessage('endDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let buttonId = useId(); | ||
let dialogId = useId(); | ||
let groupProps = $e62c7e96a53f216814557ded9a8cf$export$useDatePickerGroup(state, ref); | ||
let { | ||
focusWithinProps | ||
} = useFocusWithin({ | ||
onBlurWithin() { | ||
state.confirmPlaceholder(); | ||
} | ||
}); | ||
let ariaDescribedBy = [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: mergeProps(groupProps, fieldProps, descProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: _babelRuntimeHelpersExtends({}, labelProps, { | ||
onClick: () => { | ||
let focusManager = createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}), | ||
buttonProps: _babelRuntimeHelpersExtends({}, descProps, { | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': labelledBy + " " + buttonId, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': labelledBy + " " + buttonId | ||
}, | ||
startFieldProps: _babelRuntimeHelpersExtends({}, startFieldProps, { | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}), | ||
endFieldProps: _babelRuntimeHelpersExtends({}, endFieldProps, { | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}), | ||
descriptionProps, | ||
errorMessageProps | ||
}; | ||
} | ||
$parcel$exportWildcard(module.exports, $cb7d2152263d2ab6$exports); | ||
$parcel$exportWildcard(module.exports, $93e3e69cab166b00$exports); | ||
$parcel$exportWildcard(module.exports, $0a17b9b24fd61cc6$exports); | ||
$parcel$exportWildcard(module.exports, $53ea40b9383d8ad0$exports); | ||
$parcel$exportWildcard(module.exports, $2b06c75983817eb5$exports); | ||
exports.useDateRangePicker = useDateRangePicker; | ||
//# sourceMappingURL=main.js.map |
1456
dist/module.js
@@ -1,870 +0,752 @@ | ||
import { useSpinButton } from "@react-aria/spinbutton"; | ||
import { MessageDictionary } from "@internationalized/message"; | ||
import _react, { useMemo, useRef } from "react"; | ||
import { NumberParser } from "@internationalized/number"; | ||
import { useLocale, useMessageFormatter, useDateFormatter, useFilter } from "@react-aria/i18n"; | ||
import { useField } from "@react-aria/label"; | ||
import { usePress, useFocusWithin } from "@react-aria/interactions"; | ||
import { mergeProps, useDescription, useId, getScrollParent, isIOS, isMac, scrollIntoView, useEvent, useLabels } from "@react-aria/utils"; | ||
import { createFocusManager, useFocusManager } from "@react-aria/focus"; | ||
import _babelRuntimeHelpersEsmInteropRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault"; | ||
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends"; | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ar-AE.json | ||
var $b935bd0cd08a5bbbb1abd3806a771dc4$exports = {}; | ||
$b935bd0cd08a5bbbb1abd3806a771dc4$exports = JSON.parse("{\"calendar\":\"التقويم\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} إلى {end, date, long}\",\"date\":\"التاريخ\",\"dateRange\":\"نطاق التاريخ\",\"day\":\"يوم\",\"dayPeriod\":\"ص/م\",\"endDate\":\"تاريخ الانتهاء\",\"era\":\"العصر\",\"hour\":\"الساعات\",\"minute\":\"الدقائق\",\"month\":\"الشهر\",\"second\":\"الثواني\",\"startDate\":\"تاريخ البدء\",\"year\":\"السنة\",\"weekday\":\"اليوم\",\"timeZoneName\":\"التوقيت\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/bg-BG.json | ||
var $fd4c1baa70755ee27b55d9d185ef9a9$exports = {}; | ||
$fd4c1baa70755ee27b55d9d185ef9a9$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Времеви интервал\",\"day\":\"ден\",\"dayPeriod\":\"пр.об./сл.об.\",\"endDate\":\"Крайна дата\",\"era\":\"ера\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месец\",\"second\":\"секунда\",\"startDate\":\"Начална дата\",\"year\":\"година\",\"weekday\":\"ден от седмицата\",\"timeZoneName\":\"часова зона\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/cs-CZ.json | ||
var $ec5372c287a16045d039aa0470ed9fb2$exports = {}; | ||
$ec5372c287a16045d039aa0470ed9fb2$exports = JSON.parse("{\"calendar\":\"Kalendář\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} až {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Rozsah dat\",\"day\":\"den\",\"dayPeriod\":\"část dne\",\"endDate\":\"Konečné datum\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minuta\",\"month\":\"měsíc\",\"second\":\"sekunda\",\"startDate\":\"Počáteční datum\",\"year\":\"rok\",\"weekday\":\"den v týdnu\",\"timeZoneName\":\"časové pásmo\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/da-DK.json | ||
var $f6d6f24ad9d284dd48723518690d0e39$exports = {}; | ||
$f6d6f24ad9d284dd48723518690d0e39$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datointerval\",\"day\":\"dag\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Slutdato\",\"era\":\"æra\",\"hour\":\"time\",\"minute\":\"minut\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ugedag\",\"timeZoneName\":\"tidszone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/de-DE.json | ||
var $cc3534ef504f0b7371d8c5aa254d877f$exports = {}; | ||
$cc3534ef504f0b7371d8c5aa254d877f$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} bis {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumsbereich\",\"day\":\"Tag\",\"dayPeriod\":\"Tageshälfte\",\"endDate\":\"Enddatum\",\"era\":\"Epoche\",\"hour\":\"Stunde\",\"minute\":\"Minute\",\"month\":\"Monat\",\"second\":\"Sekunde\",\"startDate\":\"Anfangsdatum\",\"year\":\"Jahr\",\"weekday\":\"Wochentag\",\"timeZoneName\":\"Zeitzone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/el-GR.json | ||
var $ebc142984d7760b9cffe23548bb$exports = {}; | ||
$ebc142984d7760b9cffe23548bb$exports = JSON.parse("{\"calendar\":\"Ημερολόγιο\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ως {end, date, long}\",\"date\":\"Ημερομηνία\",\"dateRange\":\"Εύρος ημερομηνιών\",\"day\":\"ημέρα\",\"dayPeriod\":\"π.μ./μ.μ.\",\"endDate\":\"Ημερομηνία λήξης\",\"era\":\"περίοδος\",\"hour\":\"ώρα\",\"minute\":\"λεπτό\",\"month\":\"μήνας\",\"second\":\"δευτερόλεπτο\",\"startDate\":\"Ημερομηνία έναρξης\",\"year\":\"έτος\",\"weekday\":\"καθημερινή\",\"timeZoneName\":\"ζώνη ώρας\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/en-US.json | ||
var $f9cbab65725c7cb01e69dde93bd9a$exports = {}; | ||
$f9cbab65725c7cb01e69dde93bd9a$exports = JSON.parse("{\"era\":\"era\",\"year\":\"year\",\"month\":\"month\",\"day\":\"day\",\"hour\":\"hour\",\"minute\":\"minute\",\"second\":\"second\",\"dayPeriod\":\"AM/PM\",\"calendar\":\"Calendar\",\"date\":\"Date\",\"dateRange\":\"Date Range\",\"startDate\":\"Start Date\",\"endDate\":\"End Date\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} to {end, date, long}\",\"weekday\":\"day of the week\",\"timeZoneName\":\"time zone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/es-ES.json | ||
var $b069706710aa3fdbaa20a1b3449d63$exports = {}; | ||
$b069706710aa3fdbaa20a1b3449d63$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Fecha\",\"dateRange\":\"Intervalo de fecha\",\"day\":\"día\",\"dayPeriod\":\"a. m./p. m.\",\"endDate\":\"Fecha final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mes\",\"second\":\"segundo\",\"startDate\":\"Fecha de inicio\",\"year\":\"año\",\"weekday\":\"día de la semana\",\"timeZoneName\":\"zona horaria\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/et-EE.json | ||
var $dc294c753448ff9c1809bca75ab74d1$exports = {}; | ||
$dc294c753448ff9c1809bca75ab74d1$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} kuni {end, date, long}\",\"date\":\"Kuupäev\",\"dateRange\":\"Kuupäevavahemik\",\"day\":\"päev\",\"dayPeriod\":\"enne/pärast lõunat\",\"endDate\":\"Lõppkuupäev\",\"era\":\"ajastu\",\"hour\":\"tund\",\"minute\":\"minut\",\"month\":\"kuu\",\"second\":\"sekund\",\"startDate\":\"Alguskuupäev\",\"year\":\"aasta\",\"weekday\":\"nädalapäev\",\"timeZoneName\":\"ajavöönd\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/fi-FI.json | ||
var $d3f5f76480327eda035ed93c2$exports = {}; | ||
$d3f5f76480327eda035ed93c2$exports = JSON.parse("{\"calendar\":\"Kalenteri\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}–{end, date, long}\",\"date\":\"Päivämäärä\",\"dateRange\":\"Päivämääräalue\",\"day\":\"päivä\",\"dayPeriod\":\"vuorokaudenaika\",\"endDate\":\"Päättymispäivä\",\"era\":\"aikakausi\",\"hour\":\"tunti\",\"minute\":\"minuutti\",\"month\":\"kuukausi\",\"second\":\"sekunti\",\"startDate\":\"Alkamispäivä\",\"year\":\"vuosi\",\"weekday\":\"viikonpäivä\",\"timeZoneName\":\"aikavyöhyke\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/fr-FR.json | ||
var $b627132da032b4209b5582508dfe332$exports = {}; | ||
$b627132da032b4209b5582508dfe332$exports = JSON.parse("{\"calendar\":\"Calendrier\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} au {end, date, long}\",\"date\":\"Date\",\"dateRange\":\"Plage de dates\",\"day\":\"jour\",\"dayPeriod\":\"cadran\",\"endDate\":\"Date de fin\",\"era\":\"ère\",\"hour\":\"heure\",\"minute\":\"minute\",\"month\":\"mois\",\"second\":\"seconde\",\"startDate\":\"Date de début\",\"year\":\"année\",\"weekday\":\"jour de la semaine\",\"timeZoneName\":\"fuseau horaire\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/he-IL.json | ||
var $c3959c7b2e7e08ef514631ba3c2fdb$exports = {}; | ||
$c3959c7b2e7e08ef514631ba3c2fdb$exports = JSON.parse("{\"calendar\":\"לוח שנה\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"מ-{start, date, long} ועד {end, date, long}\",\"date\":\"תאריך\",\"dateRange\":\"טווח תאריכים\",\"day\":\"יום\",\"dayPeriod\":\"לפנה״צ/אחה״צ\",\"endDate\":\"תאריך סיום\",\"era\":\"תקופה\",\"hour\":\"שעה\",\"minute\":\"דקה\",\"month\":\"חודש\",\"second\":\"שנייה\",\"startDate\":\"תאריך התחלה\",\"year\":\"שנה\",\"weekday\":\"יום בשבוע\",\"timeZoneName\":\"אזור זמן\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/hr-HR.json | ||
var $ca3a95147a2664e1a3c49130ccfb87$exports = {}; | ||
$ca3a95147a2664e1a3c49130ccfb87$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Raspon datuma\",\"day\":\"dan\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Datum završetka\",\"era\":\"era\",\"hour\":\"sat\",\"minute\":\"minuta\",\"month\":\"mjesec\",\"second\":\"sekunda\",\"startDate\":\"Datum početka\",\"year\":\"godina\",\"weekday\":\"dan u tjednu\",\"timeZoneName\":\"vremenska zona\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/hu-HU.json | ||
var $fa6b6e78fd909c4deb0805c4ff5df60$exports = {}; | ||
$fa6b6e78fd909c4deb0805c4ff5df60$exports = JSON.parse("{\"calendar\":\"Naptár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Dátumtartomány\",\"day\":\"nap\",\"dayPeriod\":\"napszak\",\"endDate\":\"Befejező dátum\",\"era\":\"éra\",\"hour\":\"óra\",\"minute\":\"perc\",\"month\":\"hónap\",\"second\":\"másodperc\",\"startDate\":\"Kezdő dátum\",\"year\":\"év\",\"weekday\":\"hét napja\",\"timeZoneName\":\"időzóna\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/it-IT.json | ||
var $bb4837487a35e965bc77709590fda45$exports = {}; | ||
$bb4837487a35e965bc77709590fda45$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Da {start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervallo date\",\"day\":\"giorno\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data finale\",\"era\":\"era\",\"hour\":\"ora\",\"minute\":\"minuto\",\"month\":\"mese\",\"second\":\"secondo\",\"startDate\":\"Data iniziale\",\"year\":\"anno\",\"weekday\":\"giorno della settimana\",\"timeZoneName\":\"fuso orario\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ja-JP.json | ||
var $f021a923ac58a1406a8f3f0bfd5f718$exports = {}; | ||
$f021a923ac58a1406a8f3f0bfd5f718$exports = JSON.parse("{\"calendar\":\"カレンダー\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"日付\",\"dateRange\":\"日付範囲\",\"day\":\"日\",\"dayPeriod\":\"午前/午後\",\"endDate\":\"終了日\",\"era\":\"時代\",\"hour\":\"時\",\"minute\":\"分\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日\",\"year\":\"年\",\"weekday\":\"曜日\",\"timeZoneName\":\"タイムゾーン\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ko-KR.json | ||
var $e1a2895f7736c57623c5df88ed61$exports = {}; | ||
$e1a2895f7736c57623c5df88ed61$exports = JSON.parse("{\"calendar\":\"달력\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"날짜\",\"dateRange\":\"날짜 범위\",\"day\":\"일\",\"dayPeriod\":\"오전/오후\",\"endDate\":\"종료 날짜\",\"era\":\"연호\",\"hour\":\"시\",\"minute\":\"분\",\"month\":\"월\",\"second\":\"초\",\"startDate\":\"시작 날짜\",\"year\":\"년\",\"weekday\":\"요일\",\"timeZoneName\":\"시간대\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/lt-LT.json | ||
var $ee477dd4ee39b2586e7d93e4241$exports = {}; | ||
$ee477dd4ee39b2586e7d93e4241$exports = JSON.parse("{\"calendar\":\"Kalendorius\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Nuo {start, date, long} iki {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Datų intervalas\",\"day\":\"diena\",\"dayPeriod\":\"iki pietų / po pietų\",\"endDate\":\"Pabaigos data\",\"era\":\"era\",\"hour\":\"valanda\",\"minute\":\"minutė\",\"month\":\"mėnuo\",\"second\":\"sekundė\",\"startDate\":\"Pradžios data\",\"year\":\"metai\",\"weekday\":\"savaitės diena\",\"timeZoneName\":\"laiko juosta\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/lv-LV.json | ||
var $c216567e87e3bd12ecb2f27ce189a5b$exports = {}; | ||
$c216567e87e3bd12ecb2f27ce189a5b$exports = JSON.parse("{\"calendar\":\"Kalendārs\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} līdz {end, date, long}\",\"date\":\"Datums\",\"dateRange\":\"Datumu diapazons\",\"day\":\"diena\",\"dayPeriod\":\"priekšpusdienā/pēcpusdienā\",\"endDate\":\"Beigu datums\",\"era\":\"ēra\",\"hour\":\"stundas\",\"minute\":\"minūtes\",\"month\":\"mēnesis\",\"second\":\"sekundes\",\"startDate\":\"Sākuma datums\",\"year\":\"gads\",\"weekday\":\"nedēļas diena\",\"timeZoneName\":\"laika josla\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/nb-NO.json | ||
var $d57cd730bb11b14bdcd692e702bb0e60$exports = {}; | ||
$d57cd730bb11b14bdcd692e702bb0e60$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datoområde\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Sluttdato\",\"era\":\"tidsalder\",\"hour\":\"time\",\"minute\":\"minutt\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ukedag\",\"timeZoneName\":\"tidssone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/nl-NL.json | ||
var $bd8f8fc2a02532c55851f18c8de3$exports = {}; | ||
$bd8f8fc2a02532c55851f18c8de3$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} t/m {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumbereik\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Einddatum\",\"era\":\"tijdperk\",\"hour\":\"uur\",\"minute\":\"minuut\",\"month\":\"maand\",\"second\":\"seconde\",\"startDate\":\"Startdatum\",\"year\":\"jaar\",\"weekday\":\"dag van de week\",\"timeZoneName\":\"tijdzone\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/pl-PL.json | ||
var $d8e1a561b4b79d4ead55e4ee5ea09970$exports = {}; | ||
$d8e1a561b4b79d4ead55e4ee5ea09970$exports = JSON.parse("{\"calendar\":\"Kalendarz\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Zakres dat\",\"day\":\"dzień\",\"dayPeriod\":\"rano / po południu / wieczorem\",\"endDate\":\"Data końcowa\",\"era\":\"era\",\"hour\":\"godzina\",\"minute\":\"minuta\",\"month\":\"miesiąc\",\"second\":\"sekunda\",\"startDate\":\"Data początkowa\",\"year\":\"rok\",\"weekday\":\"dzień tygodnia\",\"timeZoneName\":\"strefa czasowa\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/pt-BR.json | ||
var $d479a80df73293910fe373596d18f$exports = {}; | ||
$d479a80df73293910fe373596d18f$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data inicial\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/pt-PT.json | ||
var $d91b847a2bf9b6fb7cc187d839c725f$exports = {}; | ||
$d91b847a2bf9b6fb7cc187d839c725f$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"am/pm\",\"endDate\":\"Data de Término\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data de Início\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ro-RO.json | ||
var $f25e8d5f5e9099b97d639d4f299ba$exports = {}; | ||
$f25e8d5f5e9099b97d639d4f299ba$exports = JSON.parse("{\"calendar\":\"Calendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Dată\",\"dateRange\":\"Raza datei\",\"day\":\"zi\",\"dayPeriod\":\"a.m/p.m.\",\"endDate\":\"Dată final\",\"era\":\"eră\",\"hour\":\"oră\",\"minute\":\"minut\",\"month\":\"lună\",\"second\":\"secundă\",\"startDate\":\"Dată început\",\"year\":\"an\",\"weekday\":\"ziua din săptămână\",\"timeZoneName\":\"fus orar\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/ru-RU.json | ||
var $da94598d7d1c854d87360883488$exports = {}; | ||
$da94598d7d1c854d87360883488$exports = JSON.parse("{\"calendar\":\"Календарь\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Диапазон дат\",\"day\":\"день\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Дата окончания\",\"era\":\"эра\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месяц\",\"second\":\"секунда\",\"startDate\":\"Дата начала\",\"year\":\"год\",\"weekday\":\"день недели\",\"timeZoneName\":\"часовой пояс\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sk-SK.json | ||
var $d1513dad87da1caa61156c979822ded2$exports = {}; | ||
$d1513dad87da1caa61156c979822ded2$exports = JSON.parse("{\"calendar\":\"Kalendár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Rozsah dátumov\",\"day\":\"deň\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Dátum ukončenia\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minúta\",\"month\":\"mesiac\",\"second\":\"sekunda\",\"startDate\":\"Dátum začatia\",\"year\":\"rok\",\"weekday\":\"deň týždňa\",\"timeZoneName\":\"časové pásmo\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sl-SI.json | ||
var $e16512e37a1c3ef90ecfc72d16793c1$exports = {}; | ||
$e16512e37a1c3ef90ecfc72d16793c1$exports = JSON.parse("{\"calendar\":\"Koledar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumski obseg\",\"day\":\"dan\",\"dayPeriod\":\"dop/pop\",\"endDate\":\"Datum konca\",\"era\":\"doba\",\"hour\":\"ura\",\"minute\":\"minuta\",\"month\":\"mesec\",\"second\":\"sekunda\",\"startDate\":\"Datum začetka\",\"year\":\"leto\",\"weekday\":\"dan v tednu\",\"timeZoneName\":\"časovni pas\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sr-SP.json | ||
var $f0f0ea292848c1c22e92d1c71347950$exports = {}; | ||
$f0f0ea292848c1c22e92d1c71347950$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Opseg datuma\",\"day\":\"дан\",\"dayPeriod\":\"пре подне/по подне\",\"endDate\":\"Datum završetka\",\"era\":\"ера\",\"hour\":\"сат\",\"minute\":\"минут\",\"month\":\"месец\",\"second\":\"секунд\",\"startDate\":\"Datum početka\",\"year\":\"година\",\"weekday\":\"дан у недељи\",\"timeZoneName\":\"временска зона\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/sv-SE.json | ||
var $ddeb3363257d0b1fab7fb0169309987$exports = {}; | ||
$ddeb3363257d0b1fab7fb0169309987$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} till {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumintervall\",\"day\":\"dag\",\"dayPeriod\":\"fm/em\",\"endDate\":\"Slutdatum\",\"era\":\"era\",\"hour\":\"timme\",\"minute\":\"minut\",\"month\":\"månad\",\"second\":\"sekund\",\"startDate\":\"Startdatum\",\"year\":\"år\",\"weekday\":\"veckodag\",\"timeZoneName\":\"tidszon\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/tr-TR.json | ||
var $e41e18d940cc1fd6ce3b548eaf26f$exports = {}; | ||
$e41e18d940cc1fd6ce3b548eaf26f$exports = JSON.parse("{\"calendar\":\"Takvim\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Tarih\",\"dateRange\":\"Tarih Aralığı\",\"day\":\"gün\",\"dayPeriod\":\"ÖÖ/ÖS\",\"endDate\":\"Bitiş Tarihi\",\"era\":\"çağ\",\"hour\":\"saat\",\"minute\":\"dakika\",\"month\":\"ay\",\"second\":\"saniye\",\"startDate\":\"Başlangıç Tarihi\",\"year\":\"yıl\",\"weekday\":\"haftanın günü\",\"timeZoneName\":\"saat dilimi\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/uk-UA.json | ||
var $c7fbfea59f1f84c3fbdb550bd45e1a8d$exports = {}; | ||
$c7fbfea59f1f84c3fbdb550bd45e1a8d$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Від {start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Діапазон дат\",\"day\":\"день\",\"dayPeriod\":\"дп/пп\",\"endDate\":\"Дата завершення\",\"era\":\"ера\",\"hour\":\"година\",\"minute\":\"хвилина\",\"month\":\"місяць\",\"second\":\"секунда\",\"startDate\":\"Дата початку\",\"year\":\"рік\",\"weekday\":\"день тижня\",\"timeZoneName\":\"часовий пояс\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/zh-CN.json | ||
var $c5ee38283255212ee41b3baf5b8304d$exports = {}; | ||
$c5ee38283255212ee41b3baf5b8304d$exports = JSON.parse("{\"calendar\":\"日历\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} 至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期范围\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"结束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"开始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/datepicker/intl/zh-TW.json | ||
var $e4f38d4b06a7a74952e9f6dec2e6e20$exports = {}; | ||
$e4f38d4b06a7a74952e9f6dec2e6e20$exports = JSON.parse("{\"calendar\":\"日曆\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期範圍\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"結束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
import {createFocusManager as $9lWL5$createFocusManager, useFocusManager as $9lWL5$useFocusManager} from "@react-aria/focus"; | ||
import {useId as $9lWL5$useId, useDescription as $9lWL5$useDescription, mergeProps as $9lWL5$mergeProps, isMac as $9lWL5$isMac, scrollIntoView as $9lWL5$scrollIntoView, getScrollParent as $9lWL5$getScrollParent, useEvent as $9lWL5$useEvent, isIOS as $9lWL5$isIOS, useLabels as $9lWL5$useLabels} from "@react-aria/utils"; | ||
import {useField as $9lWL5$useField} from "@react-aria/label"; | ||
import {useMessageFormatter as $9lWL5$useMessageFormatter, useLocale as $9lWL5$useLocale, useDateFormatter as $9lWL5$useDateFormatter, useFilter as $9lWL5$useFilter} from "@react-aria/i18n"; | ||
import {usePress as $9lWL5$usePress, useFocusWithin as $9lWL5$useFocusWithin} from "@react-aria/interactions"; | ||
import {NumberParser as $9lWL5$NumberParser} from "@internationalized/number"; | ||
import $9lWL5$react, {useRef as $9lWL5$useRef, useMemo as $9lWL5$useMemo} from "react"; | ||
import {useSpinButton as $9lWL5$useSpinButton} from "@react-aria/spinbutton"; | ||
import {MessageDictionary as $9lWL5$MessageDictionary} from "@internationalized/message"; | ||
function $bf15f790f1b0bea8ba7f44d4056d095d$export$useDatePickerGroup(state, ref) { | ||
// Open the popover on alt + arrow down | ||
let onKeyDown = e => { | ||
if (e.altKey && e.key === 'ArrowDown' && 'setOpen' in state) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
state.setOpen(true); | ||
} | ||
}; // Focus the first placeholder segment from the end on mouse down/touch up in the field. | ||
function $parcel$interopDefault(a) { | ||
return a && a.__esModule ? a.default : a; | ||
} | ||
function $parcel$export(e, n, v, s) { | ||
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); | ||
} | ||
var $dd56a33159a0ea2f$exports = {}; | ||
$parcel$export($dd56a33159a0ea2f$exports, "useDatePicker", () => $dd56a33159a0ea2f$export$42df105a73306d51); | ||
let focusLast = () => { | ||
let elements = ref.current.querySelectorAll('[tabindex="0"]'); | ||
let index = elements.length - 1; | ||
var $c88f0745d72552c8$exports = {}; | ||
var $b66741465864725b$exports = {}; | ||
$b66741465864725b$exports = JSON.parse("{\"calendar\":\"التقويم\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} إلى {end, date, long}\",\"date\":\"التاريخ\",\"dateRange\":\"نطاق التاريخ\",\"day\":\"يوم\",\"dayPeriod\":\"ص/م\",\"endDate\":\"تاريخ الانتهاء\",\"era\":\"العصر\",\"hour\":\"الساعات\",\"minute\":\"الدقائق\",\"month\":\"الشهر\",\"second\":\"الثواني\",\"startDate\":\"تاريخ البدء\",\"year\":\"السنة\",\"weekday\":\"اليوم\",\"timeZoneName\":\"التوقيت\"}"); | ||
while (index >= 0 && elements[index].getAttribute('aria-placeholder')) { | ||
index--; | ||
} | ||
index = Math.min(index + 1, elements.length - 1); | ||
let element = elements[index]; | ||
var $fd62b6ab6cc4afd3$exports = {}; | ||
$fd62b6ab6cc4afd3$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Времеви интервал\",\"day\":\"ден\",\"dayPeriod\":\"пр.об./сл.об.\",\"endDate\":\"Крайна дата\",\"era\":\"ера\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месец\",\"second\":\"секунда\",\"startDate\":\"Начална дата\",\"year\":\"година\",\"weekday\":\"ден от седмицата\",\"timeZoneName\":\"часова зона\"}"); | ||
if (element) { | ||
element.focus(); | ||
} | ||
}; | ||
let { | ||
pressProps | ||
} = usePress({ | ||
onPressStart(e) { | ||
if (e.pointerType === 'mouse') { | ||
focusLast(); | ||
} | ||
}, | ||
var $96034e6af4ca60e8$exports = {}; | ||
$96034e6af4ca60e8$exports = JSON.parse("{\"calendar\":\"Kalendář\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} až {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Rozsah dat\",\"day\":\"den\",\"dayPeriod\":\"část dne\",\"endDate\":\"Konečné datum\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minuta\",\"month\":\"měsíc\",\"second\":\"sekunda\",\"startDate\":\"Počáteční datum\",\"year\":\"rok\",\"weekday\":\"den v týdnu\",\"timeZoneName\":\"časové pásmo\"}"); | ||
onPress(e) { | ||
if (e.pointerType !== 'mouse') { | ||
focusLast(); | ||
} | ||
} | ||
}); | ||
return mergeProps(pressProps, { | ||
onKeyDown | ||
}); | ||
} | ||
var $b6865a17e8fa424c$exports = {}; | ||
$b6865a17e8fa424c$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datointerval\",\"day\":\"dag\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Slutdato\",\"era\":\"æra\",\"hour\":\"time\",\"minute\":\"minut\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ugedag\",\"timeZoneName\":\"tidszone\"}"); | ||
// @ts-ignore | ||
const $c154dc72a1c6e7eac4dc4005915dd53b$var$intlMessages = { | ||
"ar-AE": _babelRuntimeHelpersEsmInteropRequireDefault($b935bd0cd08a5bbbb1abd3806a771dc4$exports).default, | ||
"bg-BG": _babelRuntimeHelpersEsmInteropRequireDefault($fd4c1baa70755ee27b55d9d185ef9a9$exports).default, | ||
"cs-CZ": _babelRuntimeHelpersEsmInteropRequireDefault($ec5372c287a16045d039aa0470ed9fb2$exports).default, | ||
"da-DK": _babelRuntimeHelpersEsmInteropRequireDefault($f6d6f24ad9d284dd48723518690d0e39$exports).default, | ||
"de-DE": _babelRuntimeHelpersEsmInteropRequireDefault($cc3534ef504f0b7371d8c5aa254d877f$exports).default, | ||
"el-GR": _babelRuntimeHelpersEsmInteropRequireDefault($ebc142984d7760b9cffe23548bb$exports).default, | ||
"en-US": _babelRuntimeHelpersEsmInteropRequireDefault($f9cbab65725c7cb01e69dde93bd9a$exports).default, | ||
"es-ES": _babelRuntimeHelpersEsmInteropRequireDefault($b069706710aa3fdbaa20a1b3449d63$exports).default, | ||
"et-EE": _babelRuntimeHelpersEsmInteropRequireDefault($dc294c753448ff9c1809bca75ab74d1$exports).default, | ||
"fi-FI": _babelRuntimeHelpersEsmInteropRequireDefault($d3f5f76480327eda035ed93c2$exports).default, | ||
"fr-FR": _babelRuntimeHelpersEsmInteropRequireDefault($b627132da032b4209b5582508dfe332$exports).default, | ||
"he-IL": _babelRuntimeHelpersEsmInteropRequireDefault($c3959c7b2e7e08ef514631ba3c2fdb$exports).default, | ||
"hr-HR": _babelRuntimeHelpersEsmInteropRequireDefault($ca3a95147a2664e1a3c49130ccfb87$exports).default, | ||
"hu-HU": _babelRuntimeHelpersEsmInteropRequireDefault($fa6b6e78fd909c4deb0805c4ff5df60$exports).default, | ||
"it-IT": _babelRuntimeHelpersEsmInteropRequireDefault($bb4837487a35e965bc77709590fda45$exports).default, | ||
"ja-JP": _babelRuntimeHelpersEsmInteropRequireDefault($f021a923ac58a1406a8f3f0bfd5f718$exports).default, | ||
"ko-KR": _babelRuntimeHelpersEsmInteropRequireDefault($e1a2895f7736c57623c5df88ed61$exports).default, | ||
"lt-LT": _babelRuntimeHelpersEsmInteropRequireDefault($ee477dd4ee39b2586e7d93e4241$exports).default, | ||
"lv-LV": _babelRuntimeHelpersEsmInteropRequireDefault($c216567e87e3bd12ecb2f27ce189a5b$exports).default, | ||
"nb-NO": _babelRuntimeHelpersEsmInteropRequireDefault($d57cd730bb11b14bdcd692e702bb0e60$exports).default, | ||
"nl-NL": _babelRuntimeHelpersEsmInteropRequireDefault($bd8f8fc2a02532c55851f18c8de3$exports).default, | ||
"pl-PL": _babelRuntimeHelpersEsmInteropRequireDefault($d8e1a561b4b79d4ead55e4ee5ea09970$exports).default, | ||
"pt-BR": _babelRuntimeHelpersEsmInteropRequireDefault($d479a80df73293910fe373596d18f$exports).default, | ||
"pt-PT": _babelRuntimeHelpersEsmInteropRequireDefault($d91b847a2bf9b6fb7cc187d839c725f$exports).default, | ||
"ro-RO": _babelRuntimeHelpersEsmInteropRequireDefault($f25e8d5f5e9099b97d639d4f299ba$exports).default, | ||
"ru-RU": _babelRuntimeHelpersEsmInteropRequireDefault($da94598d7d1c854d87360883488$exports).default, | ||
"sk-SK": _babelRuntimeHelpersEsmInteropRequireDefault($d1513dad87da1caa61156c979822ded2$exports).default, | ||
"sl-SI": _babelRuntimeHelpersEsmInteropRequireDefault($e16512e37a1c3ef90ecfc72d16793c1$exports).default, | ||
"sr-SP": _babelRuntimeHelpersEsmInteropRequireDefault($f0f0ea292848c1c22e92d1c71347950$exports).default, | ||
"sv-SE": _babelRuntimeHelpersEsmInteropRequireDefault($ddeb3363257d0b1fab7fb0169309987$exports).default, | ||
"tr-TR": _babelRuntimeHelpersEsmInteropRequireDefault($e41e18d940cc1fd6ce3b548eaf26f$exports).default, | ||
"uk-UA": _babelRuntimeHelpersEsmInteropRequireDefault($c7fbfea59f1f84c3fbdb550bd45e1a8d$exports).default, | ||
"zh-CN": _babelRuntimeHelpersEsmInteropRequireDefault($c5ee38283255212ee41b3baf5b8304d$exports).default, | ||
"zh-TW": _babelRuntimeHelpersEsmInteropRequireDefault($e4f38d4b06a7a74952e9f6dec2e6e20$exports).default | ||
}; | ||
export function useDatePicker(props, state, ref) { | ||
let buttonId = useId(); | ||
let dialogId = useId(); | ||
let formatMessage = useMessageFormatter($c154dc72a1c6e7eac4dc4005915dd53b$var$intlMessages); | ||
let { | ||
labelProps, | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps | ||
} = useField(_babelRuntimeHelpersEsmExtends({}, props, { | ||
labelElementType: 'span' | ||
})); | ||
let groupProps = $bf15f790f1b0bea8ba7f44d4056d095d$export$useDatePickerGroup(state, ref); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { | ||
locale | ||
} = useLocale(); | ||
let descProps = useDescription(state.formatValue(locale, { | ||
month: 'long' | ||
})); | ||
let ariaDescribedBy = [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: mergeProps(groupProps, descProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-labelledby': labelledBy, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: _babelRuntimeHelpersEsmExtends({}, labelProps, { | ||
onClick: () => { | ||
let focusManager = createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}), | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps, | ||
buttonProps: _babelRuntimeHelpersEsmExtends({}, descProps, { | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': labelledBy + " " + buttonId, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': labelledBy + " " + buttonId | ||
} | ||
}; | ||
} | ||
export const labelIds = new WeakMap(); | ||
export function useDateField(props, state, ref) { | ||
let { | ||
labelProps, | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps | ||
} = useField(_babelRuntimeHelpersEsmExtends({}, props, { | ||
labelElementType: 'span' | ||
})); | ||
let groupProps = $bf15f790f1b0bea8ba7f44d4056d095d$export$useDatePickerGroup(state, ref); | ||
let { | ||
focusWithinProps | ||
} = useFocusWithin({ | ||
onBlurWithin() { | ||
state.confirmPlaceholder(); | ||
} | ||
}); | ||
let formatter = useDateFormatter(state.getFormatOptions({ | ||
month: 'long' | ||
})); | ||
let descProps = useDescription(state.value ? formatter.format(state.dateValue) : null); | ||
let segmentLabelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let describedBy = [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined; | ||
labelIds.set(state, { | ||
ariaLabelledBy: segmentLabelledBy, | ||
ariaDescribedBy: describedBy | ||
}); | ||
return { | ||
labelProps: _babelRuntimeHelpersEsmExtends({}, labelProps, { | ||
onClick: () => { | ||
let focusManager = createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}), | ||
fieldProps: mergeProps(fieldProps, descProps, groupProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || undefined, | ||
'aria-describedby': describedBy | ||
}), | ||
descriptionProps, | ||
errorMessageProps | ||
}; | ||
} | ||
var $94b56b225df1a6bd$exports = {}; | ||
$94b56b225df1a6bd$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} bis {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumsbereich\",\"day\":\"Tag\",\"dayPeriod\":\"Tageshälfte\",\"endDate\":\"Enddatum\",\"era\":\"Epoche\",\"hour\":\"Stunde\",\"minute\":\"Minute\",\"month\":\"Monat\",\"second\":\"Sekunde\",\"startDate\":\"Anfangsdatum\",\"year\":\"Jahr\",\"weekday\":\"Wochentag\",\"timeZoneName\":\"Zeitzone\"}"); | ||
/* | ||
* Copyright 2020 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
// @ts-ignore | ||
const $cde4cc2ec84ee652472d8c9e7126e8ce$var$intlMessages = { | ||
"ar-AE": _babelRuntimeHelpersEsmInteropRequireDefault($b935bd0cd08a5bbbb1abd3806a771dc4$exports).default, | ||
"bg-BG": _babelRuntimeHelpersEsmInteropRequireDefault($fd4c1baa70755ee27b55d9d185ef9a9$exports).default, | ||
"cs-CZ": _babelRuntimeHelpersEsmInteropRequireDefault($ec5372c287a16045d039aa0470ed9fb2$exports).default, | ||
"da-DK": _babelRuntimeHelpersEsmInteropRequireDefault($f6d6f24ad9d284dd48723518690d0e39$exports).default, | ||
"de-DE": _babelRuntimeHelpersEsmInteropRequireDefault($cc3534ef504f0b7371d8c5aa254d877f$exports).default, | ||
"el-GR": _babelRuntimeHelpersEsmInteropRequireDefault($ebc142984d7760b9cffe23548bb$exports).default, | ||
"en-US": _babelRuntimeHelpersEsmInteropRequireDefault($f9cbab65725c7cb01e69dde93bd9a$exports).default, | ||
"es-ES": _babelRuntimeHelpersEsmInteropRequireDefault($b069706710aa3fdbaa20a1b3449d63$exports).default, | ||
"et-EE": _babelRuntimeHelpersEsmInteropRequireDefault($dc294c753448ff9c1809bca75ab74d1$exports).default, | ||
"fi-FI": _babelRuntimeHelpersEsmInteropRequireDefault($d3f5f76480327eda035ed93c2$exports).default, | ||
"fr-FR": _babelRuntimeHelpersEsmInteropRequireDefault($b627132da032b4209b5582508dfe332$exports).default, | ||
"he-IL": _babelRuntimeHelpersEsmInteropRequireDefault($c3959c7b2e7e08ef514631ba3c2fdb$exports).default, | ||
"hr-HR": _babelRuntimeHelpersEsmInteropRequireDefault($ca3a95147a2664e1a3c49130ccfb87$exports).default, | ||
"hu-HU": _babelRuntimeHelpersEsmInteropRequireDefault($fa6b6e78fd909c4deb0805c4ff5df60$exports).default, | ||
"it-IT": _babelRuntimeHelpersEsmInteropRequireDefault($bb4837487a35e965bc77709590fda45$exports).default, | ||
"ja-JP": _babelRuntimeHelpersEsmInteropRequireDefault($f021a923ac58a1406a8f3f0bfd5f718$exports).default, | ||
"ko-KR": _babelRuntimeHelpersEsmInteropRequireDefault($e1a2895f7736c57623c5df88ed61$exports).default, | ||
"lt-LT": _babelRuntimeHelpersEsmInteropRequireDefault($ee477dd4ee39b2586e7d93e4241$exports).default, | ||
"lv-LV": _babelRuntimeHelpersEsmInteropRequireDefault($c216567e87e3bd12ecb2f27ce189a5b$exports).default, | ||
"nb-NO": _babelRuntimeHelpersEsmInteropRequireDefault($d57cd730bb11b14bdcd692e702bb0e60$exports).default, | ||
"nl-NL": _babelRuntimeHelpersEsmInteropRequireDefault($bd8f8fc2a02532c55851f18c8de3$exports).default, | ||
"pl-PL": _babelRuntimeHelpersEsmInteropRequireDefault($d8e1a561b4b79d4ead55e4ee5ea09970$exports).default, | ||
"pt-BR": _babelRuntimeHelpersEsmInteropRequireDefault($d479a80df73293910fe373596d18f$exports).default, | ||
"pt-PT": _babelRuntimeHelpersEsmInteropRequireDefault($d91b847a2bf9b6fb7cc187d839c725f$exports).default, | ||
"ro-RO": _babelRuntimeHelpersEsmInteropRequireDefault($f25e8d5f5e9099b97d639d4f299ba$exports).default, | ||
"ru-RU": _babelRuntimeHelpersEsmInteropRequireDefault($da94598d7d1c854d87360883488$exports).default, | ||
"sk-SK": _babelRuntimeHelpersEsmInteropRequireDefault($d1513dad87da1caa61156c979822ded2$exports).default, | ||
"sl-SI": _babelRuntimeHelpersEsmInteropRequireDefault($e16512e37a1c3ef90ecfc72d16793c1$exports).default, | ||
"sr-SP": _babelRuntimeHelpersEsmInteropRequireDefault($f0f0ea292848c1c22e92d1c71347950$exports).default, | ||
"sv-SE": _babelRuntimeHelpersEsmInteropRequireDefault($ddeb3363257d0b1fab7fb0169309987$exports).default, | ||
"tr-TR": _babelRuntimeHelpersEsmInteropRequireDefault($e41e18d940cc1fd6ce3b548eaf26f$exports).default, | ||
"uk-UA": _babelRuntimeHelpersEsmInteropRequireDefault($c7fbfea59f1f84c3fbdb550bd45e1a8d$exports).default, | ||
"zh-CN": _babelRuntimeHelpersEsmInteropRequireDefault($c5ee38283255212ee41b3baf5b8304d$exports).default, | ||
"zh-TW": _babelRuntimeHelpersEsmInteropRequireDefault($e4f38d4b06a7a74952e9f6dec2e6e20$exports).default | ||
}; | ||
export function useDisplayNames() { | ||
let { | ||
locale | ||
} = useLocale(); | ||
return useMemo(() => { | ||
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField | ||
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2 | ||
try { | ||
// @ts-ignore | ||
return new Intl.DisplayNames(locale, { | ||
type: 'dateTimeField' | ||
}); | ||
} catch (err) { | ||
return new $cde4cc2ec84ee652472d8c9e7126e8ce$var$DisplayNamesPolyfill(locale); | ||
} | ||
}, [locale]); | ||
} | ||
class $cde4cc2ec84ee652472d8c9e7126e8ce$var$DisplayNamesPolyfill { | ||
constructor(locale) { | ||
this.locale = void 0; | ||
this.dictionary = void 0; | ||
this.locale = locale; | ||
this.dictionary = new MessageDictionary($cde4cc2ec84ee652472d8c9e7126e8ce$var$intlMessages); | ||
} | ||
var $e75dc58cf55c6539$exports = {}; | ||
$e75dc58cf55c6539$exports = JSON.parse("{\"calendar\":\"Ημερολόγιο\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ως {end, date, long}\",\"date\":\"Ημερομηνία\",\"dateRange\":\"Εύρος ημερομηνιών\",\"day\":\"ημέρα\",\"dayPeriod\":\"π.μ./μ.μ.\",\"endDate\":\"Ημερομηνία λήξης\",\"era\":\"περίοδος\",\"hour\":\"ώρα\",\"minute\":\"λεπτό\",\"month\":\"μήνας\",\"second\":\"δευτερόλεπτο\",\"startDate\":\"Ημερομηνία έναρξης\",\"year\":\"έτος\",\"weekday\":\"καθημερινή\",\"timeZoneName\":\"ζώνη ώρας\"}"); | ||
of(field) { | ||
return this.dictionary.getStringForLocale(field, this.locale); | ||
} | ||
} | ||
var $dcb39f4e423b97cb$exports = {}; | ||
$dcb39f4e423b97cb$exports = JSON.parse("{\"era\":\"era\",\"year\":\"year\",\"month\":\"month\",\"day\":\"day\",\"hour\":\"hour\",\"minute\":\"minute\",\"second\":\"second\",\"dayPeriod\":\"AM/PM\",\"calendar\":\"Calendar\",\"date\":\"Date\",\"dateRange\":\"Date Range\",\"startDate\":\"Start Date\",\"endDate\":\"End Date\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} to {end, date, long}\",\"weekday\":\"day of the week\",\"timeZoneName\":\"time zone\"}"); | ||
export function useDateSegment(props, segment, state, ref) { | ||
let enteredKeys = useRef(''); | ||
let { | ||
locale, | ||
direction | ||
} = useLocale(); | ||
let displayNames = useDisplayNames(); | ||
let focusManager = useFocusManager(); | ||
let textValue = segment.text; | ||
let options = useMemo(() => state.dateFormatter.resolvedOptions(), [state.dateFormatter]); | ||
let monthDateFormatter = useDateFormatter({ | ||
month: 'long', | ||
timeZone: options.timeZone | ||
}); | ||
let hourDateFormatter = useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: options.hour12, | ||
timeZone: options.timeZone | ||
}); | ||
if (segment.type === 'month') { | ||
let monthTextValue = monthDateFormatter.format(state.dateValue); | ||
textValue = monthTextValue !== textValue ? textValue + " \u2013 " + monthTextValue : monthTextValue; | ||
} else if (segment.type === 'hour' || segment.type === 'dayPeriod') { | ||
textValue = hourDateFormatter.format(state.dateValue); | ||
} | ||
var $63920c019496dec9$exports = {}; | ||
$63920c019496dec9$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Fecha\",\"dateRange\":\"Intervalo de fecha\",\"day\":\"día\",\"dayPeriod\":\"a. m./p. m.\",\"endDate\":\"Fecha final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mes\",\"second\":\"segundo\",\"startDate\":\"Fecha de inicio\",\"year\":\"año\",\"weekday\":\"día de la semana\",\"timeZoneName\":\"zona horaria\"}"); | ||
let { | ||
spinButtonProps | ||
} = useSpinButton({ | ||
value: segment.value, | ||
textValue, | ||
minValue: segment.minValue, | ||
maxValue: segment.maxValue, | ||
isDisabled: props.isDisabled, | ||
isReadOnly: props.isReadOnly || !segment.isEditable, | ||
isRequired: props.isRequired, | ||
onIncrement: () => { | ||
enteredKeys.current = ''; | ||
state.increment(segment.type); | ||
}, | ||
onDecrement: () => { | ||
enteredKeys.current = ''; | ||
state.decrement(segment.type); | ||
}, | ||
onIncrementPage: () => { | ||
enteredKeys.current = ''; | ||
state.incrementPage(segment.type); | ||
}, | ||
onDecrementPage: () => { | ||
enteredKeys.current = ''; | ||
state.decrementPage(segment.type); | ||
}, | ||
onIncrementToMax: () => { | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.maxValue); | ||
}, | ||
onDecrementToMin: () => { | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.minValue); | ||
} | ||
}); | ||
let parser = useMemo(() => new NumberParser(locale, { | ||
maximumFractionDigits: 0 | ||
}), [locale]); | ||
let backspace = () => { | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly && !segment.isPlaceholder) { | ||
let newValue = segment.text.slice(0, -1); | ||
let parsed = parser.parse(newValue); | ||
var $b1946d77d2948489$exports = {}; | ||
$b1946d77d2948489$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} kuni {end, date, long}\",\"date\":\"Kuupäev\",\"dateRange\":\"Kuupäevavahemik\",\"day\":\"päev\",\"dayPeriod\":\"enne/pärast lõunat\",\"endDate\":\"Lõppkuupäev\",\"era\":\"ajastu\",\"hour\":\"tund\",\"minute\":\"minut\",\"month\":\"kuu\",\"second\":\"sekund\",\"startDate\":\"Alguskuupäev\",\"year\":\"aasta\",\"weekday\":\"nädalapäev\",\"timeZoneName\":\"ajavöönd\"}"); | ||
if (newValue.length === 0 || parsed === 0) { | ||
state.clearSegment(segment.type); | ||
} else { | ||
state.setSegment(segment.type, parsed); | ||
} | ||
enteredKeys.current = newValue; | ||
} else if (segment.type === 'dayPeriod') { | ||
state.clearSegment(segment.type); | ||
} | ||
}; | ||
var $c7baa1d2ecd7d699$exports = {}; | ||
$c7baa1d2ecd7d699$exports = JSON.parse("{\"calendar\":\"Kalenteri\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}–{end, date, long}\",\"date\":\"Päivämäärä\",\"dateRange\":\"Päivämääräalue\",\"day\":\"päivä\",\"dayPeriod\":\"vuorokaudenaika\",\"endDate\":\"Päättymispäivä\",\"era\":\"aikakausi\",\"hour\":\"tunti\",\"minute\":\"minuutti\",\"month\":\"kuukausi\",\"second\":\"sekunti\",\"startDate\":\"Alkamispäivä\",\"year\":\"vuosi\",\"weekday\":\"viikonpäivä\",\"timeZoneName\":\"aikavyöhyke\"}"); | ||
let onKeyDown = e => { | ||
// Firefox does not fire selectstart for Ctrl/Cmd + A | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 | ||
if (e.key === 'a' && (isMac() ? e.metaKey : e.ctrlKey)) { | ||
e.preventDefault(); | ||
} | ||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) { | ||
return; | ||
} | ||
var $cbdcbb52562a89fc$exports = {}; | ||
$cbdcbb52562a89fc$exports = JSON.parse("{\"calendar\":\"Calendrier\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} au {end, date, long}\",\"date\":\"Date\",\"dateRange\":\"Plage de dates\",\"day\":\"jour\",\"dayPeriod\":\"cadran\",\"endDate\":\"Date de fin\",\"era\":\"ère\",\"hour\":\"heure\",\"minute\":\"minute\",\"month\":\"mois\",\"second\":\"seconde\",\"startDate\":\"Date de début\",\"year\":\"année\",\"weekday\":\"jour de la semaine\",\"timeZoneName\":\"fuseau horaire\"}"); | ||
switch (e.key) { | ||
case 'ArrowLeft': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (direction === 'rtl') { | ||
focusManager.focusNext(); | ||
} else { | ||
focusManager.focusPrevious(); | ||
} | ||
var $248a7a89e556c57a$exports = {}; | ||
$248a7a89e556c57a$exports = JSON.parse("{\"calendar\":\"לוח שנה\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"מ-{start, date, long} ועד {end, date, long}\",\"date\":\"תאריך\",\"dateRange\":\"טווח תאריכים\",\"day\":\"יום\",\"dayPeriod\":\"לפנה״צ/אחה״צ\",\"endDate\":\"תאריך סיום\",\"era\":\"תקופה\",\"hour\":\"שעה\",\"minute\":\"דקה\",\"month\":\"חודש\",\"second\":\"שנייה\",\"startDate\":\"תאריך התחלה\",\"year\":\"שנה\",\"weekday\":\"יום בשבוע\",\"timeZoneName\":\"אזור זמן\"}"); | ||
break; | ||
case 'ArrowRight': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var $8ce353224be16851$exports = {}; | ||
$8ce353224be16851$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Raspon datuma\",\"day\":\"dan\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Datum završetka\",\"era\":\"era\",\"hour\":\"sat\",\"minute\":\"minuta\",\"month\":\"mjesec\",\"second\":\"sekunda\",\"startDate\":\"Datum početka\",\"year\":\"godina\",\"weekday\":\"dan u tjednu\",\"timeZoneName\":\"vremenska zona\"}"); | ||
if (direction === 'rtl') { | ||
focusManager.focusPrevious(); | ||
} else { | ||
focusManager.focusNext(); | ||
} | ||
break; | ||
var $eace1a72409bb6f2$exports = {}; | ||
$eace1a72409bb6f2$exports = JSON.parse("{\"calendar\":\"Naptár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Dátumtartomány\",\"day\":\"nap\",\"dayPeriod\":\"napszak\",\"endDate\":\"Befejező dátum\",\"era\":\"éra\",\"hour\":\"óra\",\"minute\":\"perc\",\"month\":\"hónap\",\"second\":\"másodperc\",\"startDate\":\"Kezdő dátum\",\"year\":\"év\",\"weekday\":\"hét napja\",\"timeZoneName\":\"időzóna\"}"); | ||
case 'Enter': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (segment.isPlaceholder && !props.isReadOnly) { | ||
state.confirmPlaceholder(segment.type); | ||
} | ||
var $2d94c3d691299197$exports = {}; | ||
$2d94c3d691299197$exports = JSON.parse("{\"calendar\":\"Calendario\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Da {start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervallo date\",\"day\":\"giorno\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data finale\",\"era\":\"era\",\"hour\":\"ora\",\"minute\":\"minuto\",\"month\":\"mese\",\"second\":\"secondo\",\"startDate\":\"Data iniziale\",\"year\":\"anno\",\"weekday\":\"giorno della settimana\",\"timeZoneName\":\"fuso orario\"}"); | ||
focusManager.focusNext(); | ||
break; | ||
case 'Tab': | ||
break; | ||
var $fcf81d751ab58cec$exports = {}; | ||
$fcf81d751ab58cec$exports = JSON.parse("{\"calendar\":\"カレンダー\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"日付\",\"dateRange\":\"日付範囲\",\"day\":\"日\",\"dayPeriod\":\"午前/午後\",\"endDate\":\"終了日\",\"era\":\"時代\",\"hour\":\"時\",\"minute\":\"分\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日\",\"year\":\"年\",\"weekday\":\"曜日\",\"timeZoneName\":\"タイムゾーン\"}"); | ||
case 'Backspace': | ||
case 'Delete': | ||
{ | ||
// Safari on iOS does not fire beforeinput for the backspace key because the cursor is at the start. | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
backspace(); | ||
break; | ||
} | ||
} | ||
}; // Safari dayPeriod option doesn't work... | ||
var $c7f35236b044430d$exports = {}; | ||
$c7f35236b044430d$exports = JSON.parse("{\"calendar\":\"달력\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} ~ {end, date, long}\",\"date\":\"날짜\",\"dateRange\":\"날짜 범위\",\"day\":\"일\",\"dayPeriod\":\"오전/오후\",\"endDate\":\"종료 날짜\",\"era\":\"연호\",\"hour\":\"시\",\"minute\":\"분\",\"month\":\"월\",\"second\":\"초\",\"startDate\":\"시작 날짜\",\"year\":\"년\",\"weekday\":\"요일\",\"timeZoneName\":\"시간대\"}"); | ||
let { | ||
startsWith | ||
} = useFilter({ | ||
sensitivity: 'base' | ||
}); | ||
let amPmFormatter = useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: true | ||
}); | ||
let am = useMemo(() => { | ||
let date = new Date(); | ||
date.setHours(0); | ||
return amPmFormatter.formatToParts(date).find(part => part.type === 'dayPeriod').value; | ||
}, [amPmFormatter]); | ||
let pm = useMemo(() => { | ||
let date = new Date(); | ||
date.setHours(12); | ||
return amPmFormatter.formatToParts(date).find(part => part.type === 'dayPeriod').value; | ||
}, [amPmFormatter]); | ||
let onInput = key => { | ||
if (props.isDisabled || props.isReadOnly) { | ||
return; | ||
} | ||
var $9be2320f60783e73$exports = {}; | ||
$9be2320f60783e73$exports = JSON.parse("{\"calendar\":\"Kalendorius\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Nuo {start, date, long} iki {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Datų intervalas\",\"day\":\"diena\",\"dayPeriod\":\"iki pietų / po pietų\",\"endDate\":\"Pabaigos data\",\"era\":\"era\",\"hour\":\"valanda\",\"minute\":\"minutė\",\"month\":\"mėnuo\",\"second\":\"sekundė\",\"startDate\":\"Pradžios data\",\"year\":\"metai\",\"weekday\":\"savaitės diena\",\"timeZoneName\":\"laiko juosta\"}"); | ||
let newValue = enteredKeys.current + key; | ||
switch (segment.type) { | ||
case 'dayPeriod': | ||
if (startsWith(am, key)) { | ||
state.setSegment('dayPeriod', 0); | ||
} else if (startsWith(pm, key)) { | ||
state.setSegment('dayPeriod', 12); | ||
} else { | ||
break; | ||
} | ||
var $8295bce7c0abeeaf$exports = {}; | ||
$8295bce7c0abeeaf$exports = JSON.parse("{\"calendar\":\"Kalendārs\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} līdz {end, date, long}\",\"date\":\"Datums\",\"dateRange\":\"Datumu diapazons\",\"day\":\"diena\",\"dayPeriod\":\"priekšpusdienā/pēcpusdienā\",\"endDate\":\"Beigu datums\",\"era\":\"ēra\",\"hour\":\"stundas\",\"minute\":\"minūtes\",\"month\":\"mēnesis\",\"second\":\"sekundes\",\"startDate\":\"Sākuma datums\",\"year\":\"gads\",\"weekday\":\"nedēļas diena\",\"timeZoneName\":\"laika josla\"}"); | ||
focusManager.focusNext(); | ||
break; | ||
case 'day': | ||
case 'hour': | ||
case 'minute': | ||
case 'second': | ||
case 'month': | ||
case 'year': | ||
{ | ||
if (!parser.isValidPartialNumber(newValue)) { | ||
return; | ||
} | ||
var $1a235269701fa747$exports = {}; | ||
$1a235269701fa747$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} til {end, date, long}\",\"date\":\"Dato\",\"dateRange\":\"Datoområde\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Sluttdato\",\"era\":\"tidsalder\",\"hour\":\"time\",\"minute\":\"minutt\",\"month\":\"måned\",\"second\":\"sekund\",\"startDate\":\"Startdato\",\"year\":\"år\",\"weekday\":\"ukedag\",\"timeZoneName\":\"tidssone\"}"); | ||
let numberValue = parser.parse(newValue); | ||
let segmentValue = numberValue; | ||
let allowsZero = segment.minValue === 0; | ||
if (segment.type === 'hour' && state.dateFormatter.resolvedOptions().hour12) { | ||
switch (state.dateFormatter.resolvedOptions().hourCycle) { | ||
case 'h11': | ||
if (numberValue > 11) { | ||
segmentValue = parser.parse(key); | ||
} | ||
var $b89e13305e4051cc$exports = {}; | ||
$b89e13305e4051cc$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} t/m {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumbereik\",\"day\":\"dag\",\"dayPeriod\":\"a.m./p.m.\",\"endDate\":\"Einddatum\",\"era\":\"tijdperk\",\"hour\":\"uur\",\"minute\":\"minuut\",\"month\":\"maand\",\"second\":\"seconde\",\"startDate\":\"Startdatum\",\"year\":\"jaar\",\"weekday\":\"dag van de week\",\"timeZoneName\":\"tijdzone\"}"); | ||
break; | ||
case 'h12': | ||
allowsZero = false; | ||
var $edf7ddc399f5a7b3$exports = {}; | ||
$edf7ddc399f5a7b3$exports = JSON.parse("{\"calendar\":\"Kalendarz\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Zakres dat\",\"day\":\"dzień\",\"dayPeriod\":\"rano / po południu / wieczorem\",\"endDate\":\"Data końcowa\",\"era\":\"era\",\"hour\":\"godzina\",\"minute\":\"minuta\",\"month\":\"miesiąc\",\"second\":\"sekunda\",\"startDate\":\"Data początkowa\",\"year\":\"rok\",\"weekday\":\"dzień tygodnia\",\"timeZoneName\":\"strefa czasowa\"}"); | ||
if (numberValue > 12) { | ||
segmentValue = parser.parse(key); | ||
} | ||
break; | ||
} | ||
var $ef0a3cd4e0b723b0$exports = {}; | ||
$ef0a3cd4e0b723b0$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Data final\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data inicial\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
if (segment.value >= 12 && numberValue > 1) { | ||
numberValue += 12; | ||
} | ||
} else if (numberValue > segment.maxValue) { | ||
segmentValue = parser.parse(key); | ||
} | ||
if (isNaN(numberValue)) { | ||
return; | ||
} | ||
var $a41117d6e9bdf8e7$exports = {}; | ||
$a41117d6e9bdf8e7$exports = JSON.parse("{\"calendar\":\"Calendário\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} a {end, date, long}\",\"date\":\"Data\",\"dateRange\":\"Intervalo de datas\",\"day\":\"dia\",\"dayPeriod\":\"am/pm\",\"endDate\":\"Data de Término\",\"era\":\"era\",\"hour\":\"hora\",\"minute\":\"minuto\",\"month\":\"mês\",\"second\":\"segundo\",\"startDate\":\"Data de Início\",\"year\":\"ano\",\"weekday\":\"dia da semana\",\"timeZoneName\":\"fuso horário\"}"); | ||
let shouldSetValue = segmentValue !== 0 || allowsZero; | ||
if (shouldSetValue) { | ||
state.setSegment(segment.type, segmentValue); | ||
} | ||
var $a1167e857bce6b12$exports = {}; | ||
$a1167e857bce6b12$exports = JSON.parse("{\"calendar\":\"Calendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Dată\",\"dateRange\":\"Raza datei\",\"day\":\"zi\",\"dayPeriod\":\"a.m/p.m.\",\"endDate\":\"Dată final\",\"era\":\"eră\",\"hour\":\"oră\",\"minute\":\"minut\",\"month\":\"lună\",\"second\":\"secundă\",\"startDate\":\"Dată început\",\"year\":\"an\",\"weekday\":\"ziua din săptămână\",\"timeZoneName\":\"fus orar\"}"); | ||
if (Number(numberValue + '0') > segment.maxValue || newValue.length >= String(segment.maxValue).length) { | ||
enteredKeys.current = ''; | ||
if (shouldSetValue) { | ||
focusManager.focusNext(); | ||
} | ||
} else { | ||
enteredKeys.current = newValue; | ||
} | ||
var $249d91dc236cd3fa$exports = {}; | ||
$249d91dc236cd3fa$exports = JSON.parse("{\"calendar\":\"Календарь\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} – {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Диапазон дат\",\"day\":\"день\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Дата окончания\",\"era\":\"эра\",\"hour\":\"час\",\"minute\":\"минута\",\"month\":\"месяц\",\"second\":\"секунда\",\"startDate\":\"Дата начала\",\"year\":\"год\",\"weekday\":\"день недели\",\"timeZoneName\":\"часовой пояс\"}"); | ||
break; | ||
} | ||
} | ||
}; | ||
let onFocus = () => { | ||
enteredKeys.current = ''; | ||
scrollIntoView(getScrollParent(ref.current), ref.current); // Safari requires that a selection is set or it won't fire input events. | ||
// Since usePress disables text selection, this won't happen by default. | ||
var $7d527844ccab55f9$exports = {}; | ||
$7d527844ccab55f9$exports = JSON.parse("{\"calendar\":\"Kalendár\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Dátum\",\"dateRange\":\"Rozsah dátumov\",\"day\":\"deň\",\"dayPeriod\":\"AM/PM\",\"endDate\":\"Dátum ukončenia\",\"era\":\"letopočet\",\"hour\":\"hodina\",\"minute\":\"minúta\",\"month\":\"mesiac\",\"second\":\"sekunda\",\"startDate\":\"Dátum začatia\",\"year\":\"rok\",\"weekday\":\"deň týždňa\",\"timeZoneName\":\"časové pásmo\"}"); | ||
ref.current.style.webkitUserSelect = 'text'; | ||
let selection = window.getSelection(); | ||
selection.collapse(ref.current); | ||
ref.current.style.webkitUserSelect = ''; | ||
}; | ||
let compositionRef = useRef(''); // @ts-ignore - TODO: possibly old TS version? doesn't fail in my editor... | ||
var $a95d4a5acb39e35b$exports = {}; | ||
$a95d4a5acb39e35b$exports = JSON.parse("{\"calendar\":\"Koledar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumski obseg\",\"day\":\"dan\",\"dayPeriod\":\"dop/pop\",\"endDate\":\"Datum konca\",\"era\":\"doba\",\"hour\":\"ura\",\"minute\":\"minuta\",\"month\":\"mesec\",\"second\":\"sekunda\",\"startDate\":\"Datum začetka\",\"year\":\"leto\",\"weekday\":\"dan v tednu\",\"timeZoneName\":\"časovni pas\"}"); | ||
useEvent(ref, 'beforeinput', e => { | ||
e.preventDefault(); | ||
switch (e.inputType) { | ||
case 'deleteContentBackward': | ||
case 'deleteContentForward': | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly) { | ||
backspace(); | ||
var $82576688b1e1ef0a$exports = {}; | ||
$82576688b1e1ef0a$exports = JSON.parse("{\"calendar\":\"Kalendar\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} do {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Opseg datuma\",\"day\":\"дан\",\"dayPeriod\":\"пре подне/по подне\",\"endDate\":\"Datum završetka\",\"era\":\"ера\",\"hour\":\"сат\",\"minute\":\"минут\",\"month\":\"месец\",\"second\":\"секунд\",\"startDate\":\"Datum početka\",\"year\":\"година\",\"weekday\":\"дан у недељи\",\"timeZoneName\":\"временска зона\"}"); | ||
var $aa605c86f39879f8$exports = {}; | ||
$aa605c86f39879f8$exports = JSON.parse("{\"calendar\":\"Kalender\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} till {end, date, long}\",\"date\":\"Datum\",\"dateRange\":\"Datumintervall\",\"day\":\"dag\",\"dayPeriod\":\"fm/em\",\"endDate\":\"Slutdatum\",\"era\":\"era\",\"hour\":\"timme\",\"minute\":\"minut\",\"month\":\"månad\",\"second\":\"sekund\",\"startDate\":\"Startdatum\",\"year\":\"år\",\"weekday\":\"veckodag\",\"timeZoneName\":\"tidszon\"}"); | ||
var $72af5f52c93eeaaf$exports = {}; | ||
$72af5f52c93eeaaf$exports = JSON.parse("{\"calendar\":\"Takvim\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} - {end, date, long}\",\"date\":\"Tarih\",\"dateRange\":\"Tarih Aralığı\",\"day\":\"gün\",\"dayPeriod\":\"ÖÖ/ÖS\",\"endDate\":\"Bitiş Tarihi\",\"era\":\"çağ\",\"hour\":\"saat\",\"minute\":\"dakika\",\"month\":\"ay\",\"second\":\"saniye\",\"startDate\":\"Başlangıç Tarihi\",\"year\":\"yıl\",\"weekday\":\"haftanın günü\",\"timeZoneName\":\"saat dilimi\"}"); | ||
var $f6b0be5e98e820ca$exports = {}; | ||
$f6b0be5e98e820ca$exports = JSON.parse("{\"calendar\":\"Календар\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"Від {start, date, long} до {end, date, long}\",\"date\":\"Дата\",\"dateRange\":\"Діапазон дат\",\"day\":\"день\",\"dayPeriod\":\"дп/пп\",\"endDate\":\"Дата завершення\",\"era\":\"ера\",\"hour\":\"година\",\"minute\":\"хвилина\",\"month\":\"місяць\",\"second\":\"секунда\",\"startDate\":\"Дата початку\",\"year\":\"рік\",\"weekday\":\"день тижня\",\"timeZoneName\":\"часовий пояс\"}"); | ||
var $cabb9f4bff9b2ed5$exports = {}; | ||
$cabb9f4bff9b2ed5$exports = JSON.parse("{\"calendar\":\"日历\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long} 至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期范围\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"结束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"开始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
var $c5e6c845e5ea5381$exports = {}; | ||
$c5e6c845e5ea5381$exports = JSON.parse("{\"calendar\":\"日曆\",\"currentDate\":\"{date, date, full}\",\"currentDateRange\":\"{start, date, long}至 {end, date, long}\",\"date\":\"日期\",\"dateRange\":\"日期範圍\",\"day\":\"日\",\"dayPeriod\":\"上午/下午\",\"endDate\":\"結束日期\",\"era\":\"纪元\",\"hour\":\"小时\",\"minute\":\"分钟\",\"month\":\"月\",\"second\":\"秒\",\"startDate\":\"開始日期\",\"year\":\"年\",\"weekday\":\"工作日\",\"timeZoneName\":\"时区\"}"); | ||
$c88f0745d72552c8$exports = { | ||
"ar-AE": $b66741465864725b$exports, | ||
"bg-BG": $fd62b6ab6cc4afd3$exports, | ||
"cs-CZ": $96034e6af4ca60e8$exports, | ||
"da-DK": $b6865a17e8fa424c$exports, | ||
"de-DE": $94b56b225df1a6bd$exports, | ||
"el-GR": $e75dc58cf55c6539$exports, | ||
"en-US": $dcb39f4e423b97cb$exports, | ||
"es-ES": $63920c019496dec9$exports, | ||
"et-EE": $b1946d77d2948489$exports, | ||
"fi-FI": $c7baa1d2ecd7d699$exports, | ||
"fr-FR": $cbdcbb52562a89fc$exports, | ||
"he-IL": $248a7a89e556c57a$exports, | ||
"hr-HR": $8ce353224be16851$exports, | ||
"hu-HU": $eace1a72409bb6f2$exports, | ||
"it-IT": $2d94c3d691299197$exports, | ||
"ja-JP": $fcf81d751ab58cec$exports, | ||
"ko-KR": $c7f35236b044430d$exports, | ||
"lt-LT": $9be2320f60783e73$exports, | ||
"lv-LV": $8295bce7c0abeeaf$exports, | ||
"nb-NO": $1a235269701fa747$exports, | ||
"nl-NL": $b89e13305e4051cc$exports, | ||
"pl-PL": $edf7ddc399f5a7b3$exports, | ||
"pt-BR": $ef0a3cd4e0b723b0$exports, | ||
"pt-PT": $a41117d6e9bdf8e7$exports, | ||
"ro-RO": $a1167e857bce6b12$exports, | ||
"ru-RU": $249d91dc236cd3fa$exports, | ||
"sk-SK": $7d527844ccab55f9$exports, | ||
"sl-SI": $a95d4a5acb39e35b$exports, | ||
"sr-SP": $82576688b1e1ef0a$exports, | ||
"sv-SE": $aa605c86f39879f8$exports, | ||
"tr-TR": $72af5f52c93eeaaf$exports, | ||
"uk-UA": $f6b0be5e98e820ca$exports, | ||
"zh-CN": $cabb9f4bff9b2ed5$exports, | ||
"zh-TW": $c5e6c845e5ea5381$exports | ||
}; | ||
function $2bf1c991883828b3$export$4a931266a3838b86(state, ref) { | ||
// Open the popover on alt + arrow down | ||
let onKeyDown = (e)=>{ | ||
if (e.altKey && e.key === 'ArrowDown' && 'setOpen' in state) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
state.setOpen(true); | ||
} | ||
}; | ||
// Focus the first placeholder segment from the end on mouse down/touch up in the field. | ||
let focusLast = ()=>{ | ||
let elements = ref.current.querySelectorAll('[tabindex="0"]'); | ||
let index = elements.length - 1; | ||
while(index >= 0 && elements[index].getAttribute('aria-placeholder'))index--; | ||
index = Math.min(index + 1, elements.length - 1); | ||
let element = elements[index]; | ||
if (element) element.focus(); | ||
}; | ||
let { pressProps: pressProps } = $9lWL5$usePress({ | ||
onPressStart (e) { | ||
if (e.pointerType === 'mouse') focusLast(); | ||
}, | ||
onPress (e) { | ||
if (e.pointerType !== 'mouse') focusLast(); | ||
} | ||
}); | ||
return $9lWL5$mergeProps(pressProps, { | ||
onKeyDown: onKeyDown | ||
}); | ||
} | ||
break; | ||
case 'insertCompositionText': | ||
// insertCompositionText cannot be canceled. | ||
// Record the current state of the element so we can restore it in the `input` event below. | ||
compositionRef.current = ref.current.textContent; // Safari gets stuck in a composition state unless we also assign to the value here. | ||
// eslint-disable-next-line no-self-assign | ||
ref.current.textContent = ref.current.textContent; | ||
break; | ||
default: | ||
if (e.data != null) { | ||
onInput(e.data); | ||
function $dd56a33159a0ea2f$export$42df105a73306d51(props, state, ref) { | ||
let buttonId = $9lWL5$useId(); | ||
let dialogId = $9lWL5$useId(); | ||
let formatMessage = $9lWL5$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($c88f0745d72552c8$exports))); | ||
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $9lWL5$useField({ | ||
...props, | ||
labelElementType: 'span' | ||
}); | ||
let groupProps = $2bf1c991883828b3$export$4a931266a3838b86(state, ref); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { locale: locale } = $9lWL5$useLocale(); | ||
let descProps = $9lWL5$useDescription(state.formatValue(locale, { | ||
month: 'long' | ||
})); | ||
let ariaDescribedBy = [ | ||
descProps['aria-describedby'], | ||
fieldProps['aria-describedby'] | ||
].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: $9lWL5$mergeProps(groupProps, descProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-labelledby': labelledBy, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: { | ||
...labelProps, | ||
onClick: ()=>{ | ||
let focusManager = $9lWL5$createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}, | ||
fieldProps: fieldProps, | ||
descriptionProps: descriptionProps, | ||
errorMessageProps: errorMessageProps, | ||
buttonProps: { | ||
...descProps, | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': `${labelledBy} ${buttonId}`, | ||
'aria-describedby': ariaDescribedBy | ||
}, | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': `${labelledBy} ${buttonId}` | ||
} | ||
}; | ||
} | ||
break; | ||
} | ||
}); | ||
useEvent(ref, 'input', e => { | ||
let { | ||
inputType, | ||
data | ||
} = e; | ||
switch (inputType) { | ||
case 'insertCompositionText': | ||
// Reset the DOM to how it was in the beforeinput event. | ||
ref.current.textContent = compositionRef.current; // Android sometimes fires key presses of letters as composition events. Need to handle am/pm keys here too. | ||
// Can also happen e.g. with Pinyin keyboard on iOS. | ||
var $8913372aff0980af$exports = {}; | ||
if (startsWith(am, data) || startsWith(pm, data)) { | ||
onInput(data); | ||
$parcel$export($8913372aff0980af$exports, "useDateSegment", () => $8913372aff0980af$export$1315d136e6f7581); | ||
var $423e84bb76847e49$exports = {}; | ||
$parcel$export($423e84bb76847e49$exports, "labelIds", () => $423e84bb76847e49$export$beb2340c1222c6d); | ||
$parcel$export($423e84bb76847e49$exports, "useDateField", () => $423e84bb76847e49$export$5591b0b878c1a989); | ||
const $423e84bb76847e49$export$beb2340c1222c6d = new WeakMap(); | ||
function $423e84bb76847e49$export$5591b0b878c1a989(props, state, ref) { | ||
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $9lWL5$useField({ | ||
...props, | ||
labelElementType: 'span' | ||
}); | ||
let groupProps = $2bf1c991883828b3$export$4a931266a3838b86(state, ref); | ||
let { focusWithinProps: focusWithinProps } = $9lWL5$useFocusWithin({ | ||
onBlurWithin () { | ||
state.confirmPlaceholder(); | ||
} | ||
}); | ||
let formatter = $9lWL5$useDateFormatter(state.getFormatOptions({ | ||
month: 'long' | ||
})); | ||
let descProps = $9lWL5$useDescription(state.value ? formatter.format(state.dateValue) : null); | ||
let segmentLabelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let describedBy = [ | ||
descProps['aria-describedby'], | ||
fieldProps['aria-describedby'] | ||
].filter(Boolean).join(' ') || undefined; | ||
$423e84bb76847e49$export$beb2340c1222c6d.set(state, { | ||
ariaLabelledBy: segmentLabelledBy, | ||
ariaDescribedBy: describedBy | ||
}); | ||
return { | ||
labelProps: { | ||
...labelProps, | ||
onClick: ()=>{ | ||
let focusManager = $9lWL5$createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}, | ||
fieldProps: $9lWL5$mergeProps(fieldProps, descProps, groupProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || undefined, | ||
'aria-describedby': describedBy | ||
}), | ||
descriptionProps: descriptionProps, | ||
errorMessageProps: errorMessageProps | ||
}; | ||
} | ||
break; | ||
} | ||
}); // Focus on mouse down/touch up to match native textfield behavior. | ||
// usePress handles canceling text selection. | ||
let { | ||
pressProps | ||
} = usePress({ | ||
preventFocusOnPress: true, | ||
onPressStart: e => { | ||
if (e.pointerType === 'mouse') { | ||
e.target.focus(); | ||
} | ||
}, | ||
onPress(e) { | ||
if (e.pointerType !== 'mouse') { | ||
e.target.focus(); | ||
} | ||
} | ||
}); // For Android: prevent selection on long press. | ||
useEvent(ref, 'selectstart', e => { | ||
e.preventDefault(); | ||
}); // spinbuttons cannot be focused with VoiceOver on iOS. | ||
var $c3b2c5822bfa6f61$exports = {}; | ||
let touchPropOverrides = isIOS() || segment.type === 'timeZoneName' ? { | ||
role: 'textbox', | ||
'aria-valuemax': null, | ||
'aria-valuemin': null, | ||
'aria-valuetext': null, | ||
'aria-valuenow': null | ||
} : {}; | ||
let { | ||
ariaLabelledBy, | ||
ariaDescribedBy | ||
} = labelIds.get(state); // Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being | ||
// read every time the user navigates to a new segment. | ||
$parcel$export($c3b2c5822bfa6f61$exports, "useDisplayNames", () => $c3b2c5822bfa6f61$export$d42c60378c8168f8); | ||
let firstSegment = useMemo(() => state.segments.find(s => s.isEditable), [state.segments]); | ||
if (segment !== firstSegment && state.validationState !== 'invalid') { | ||
ariaDescribedBy = undefined; | ||
} | ||
let id = useId(props.id); | ||
let isEditable = !props.isDisabled && !props.isReadOnly && segment.isEditable; | ||
return { | ||
segmentProps: mergeProps(spinButtonProps, pressProps, _babelRuntimeHelpersEsmExtends({ | ||
id | ||
}, touchPropOverrides, { | ||
'aria-controls': props['aria-controls'], | ||
// 'aria-haspopup': props['aria-haspopup'], // deprecated in ARIA 1.2 | ||
'aria-invalid': state.validationState === 'invalid' ? 'true' : undefined, | ||
'aria-label': segment.type !== 'literal' ? displayNames.of(segment.type) : undefined, | ||
'aria-labelledby': ariaLabelledBy + " " + id, | ||
'aria-describedby': ariaDescribedBy, | ||
'aria-placeholder': segment.isPlaceholder ? segment.text : undefined, | ||
'aria-readonly': props.isReadOnly || !segment.isEditable ? 'true' : undefined, | ||
contentEditable: isEditable, | ||
suppressContentEditableWarning: isEditable, | ||
spellCheck: isEditable ? 'false' : undefined, | ||
autoCapitalize: isEditable ? 'off' : undefined, | ||
autoCorrect: isEditable ? 'off' : undefined, | ||
// Capitalization was changed in React 17... | ||
[parseInt(_react.version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined, | ||
inputMode: props.isDisabled || segment.type === 'dayPeriod' || !isEditable ? undefined : 'numeric', | ||
tabIndex: props.isDisabled ? undefined : 0, | ||
onKeyDown, | ||
onFocus | ||
})) | ||
}; | ||
function $c3b2c5822bfa6f61$export$d42c60378c8168f8() { | ||
let { locale: locale } = $9lWL5$useLocale(); | ||
return $9lWL5$useMemo(()=>{ | ||
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField | ||
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2 | ||
try { | ||
// @ts-ignore | ||
return new Intl.DisplayNames(locale, { | ||
type: 'dateTimeField' | ||
}); | ||
} catch (err) { | ||
return new $c3b2c5822bfa6f61$var$DisplayNamesPolyfill(locale); | ||
} | ||
}, [ | ||
locale | ||
]); | ||
} | ||
// @ts-ignore | ||
const $eb0a25d35efaafa331308f687b4f492$var$intlMessages = { | ||
"ar-AE": _babelRuntimeHelpersEsmInteropRequireDefault($b935bd0cd08a5bbbb1abd3806a771dc4$exports).default, | ||
"bg-BG": _babelRuntimeHelpersEsmInteropRequireDefault($fd4c1baa70755ee27b55d9d185ef9a9$exports).default, | ||
"cs-CZ": _babelRuntimeHelpersEsmInteropRequireDefault($ec5372c287a16045d039aa0470ed9fb2$exports).default, | ||
"da-DK": _babelRuntimeHelpersEsmInteropRequireDefault($f6d6f24ad9d284dd48723518690d0e39$exports).default, | ||
"de-DE": _babelRuntimeHelpersEsmInteropRequireDefault($cc3534ef504f0b7371d8c5aa254d877f$exports).default, | ||
"el-GR": _babelRuntimeHelpersEsmInteropRequireDefault($ebc142984d7760b9cffe23548bb$exports).default, | ||
"en-US": _babelRuntimeHelpersEsmInteropRequireDefault($f9cbab65725c7cb01e69dde93bd9a$exports).default, | ||
"es-ES": _babelRuntimeHelpersEsmInteropRequireDefault($b069706710aa3fdbaa20a1b3449d63$exports).default, | ||
"et-EE": _babelRuntimeHelpersEsmInteropRequireDefault($dc294c753448ff9c1809bca75ab74d1$exports).default, | ||
"fi-FI": _babelRuntimeHelpersEsmInteropRequireDefault($d3f5f76480327eda035ed93c2$exports).default, | ||
"fr-FR": _babelRuntimeHelpersEsmInteropRequireDefault($b627132da032b4209b5582508dfe332$exports).default, | ||
"he-IL": _babelRuntimeHelpersEsmInteropRequireDefault($c3959c7b2e7e08ef514631ba3c2fdb$exports).default, | ||
"hr-HR": _babelRuntimeHelpersEsmInteropRequireDefault($ca3a95147a2664e1a3c49130ccfb87$exports).default, | ||
"hu-HU": _babelRuntimeHelpersEsmInteropRequireDefault($fa6b6e78fd909c4deb0805c4ff5df60$exports).default, | ||
"it-IT": _babelRuntimeHelpersEsmInteropRequireDefault($bb4837487a35e965bc77709590fda45$exports).default, | ||
"ja-JP": _babelRuntimeHelpersEsmInteropRequireDefault($f021a923ac58a1406a8f3f0bfd5f718$exports).default, | ||
"ko-KR": _babelRuntimeHelpersEsmInteropRequireDefault($e1a2895f7736c57623c5df88ed61$exports).default, | ||
"lt-LT": _babelRuntimeHelpersEsmInteropRequireDefault($ee477dd4ee39b2586e7d93e4241$exports).default, | ||
"lv-LV": _babelRuntimeHelpersEsmInteropRequireDefault($c216567e87e3bd12ecb2f27ce189a5b$exports).default, | ||
"nb-NO": _babelRuntimeHelpersEsmInteropRequireDefault($d57cd730bb11b14bdcd692e702bb0e60$exports).default, | ||
"nl-NL": _babelRuntimeHelpersEsmInteropRequireDefault($bd8f8fc2a02532c55851f18c8de3$exports).default, | ||
"pl-PL": _babelRuntimeHelpersEsmInteropRequireDefault($d8e1a561b4b79d4ead55e4ee5ea09970$exports).default, | ||
"pt-BR": _babelRuntimeHelpersEsmInteropRequireDefault($d479a80df73293910fe373596d18f$exports).default, | ||
"pt-PT": _babelRuntimeHelpersEsmInteropRequireDefault($d91b847a2bf9b6fb7cc187d839c725f$exports).default, | ||
"ro-RO": _babelRuntimeHelpersEsmInteropRequireDefault($f25e8d5f5e9099b97d639d4f299ba$exports).default, | ||
"ru-RU": _babelRuntimeHelpersEsmInteropRequireDefault($da94598d7d1c854d87360883488$exports).default, | ||
"sk-SK": _babelRuntimeHelpersEsmInteropRequireDefault($d1513dad87da1caa61156c979822ded2$exports).default, | ||
"sl-SI": _babelRuntimeHelpersEsmInteropRequireDefault($e16512e37a1c3ef90ecfc72d16793c1$exports).default, | ||
"sr-SP": _babelRuntimeHelpersEsmInteropRequireDefault($f0f0ea292848c1c22e92d1c71347950$exports).default, | ||
"sv-SE": _babelRuntimeHelpersEsmInteropRequireDefault($ddeb3363257d0b1fab7fb0169309987$exports).default, | ||
"tr-TR": _babelRuntimeHelpersEsmInteropRequireDefault($e41e18d940cc1fd6ce3b548eaf26f$exports).default, | ||
"uk-UA": _babelRuntimeHelpersEsmInteropRequireDefault($c7fbfea59f1f84c3fbdb550bd45e1a8d$exports).default, | ||
"zh-CN": _babelRuntimeHelpersEsmInteropRequireDefault($c5ee38283255212ee41b3baf5b8304d$exports).default, | ||
"zh-TW": _babelRuntimeHelpersEsmInteropRequireDefault($e4f38d4b06a7a74952e9f6dec2e6e20$exports).default | ||
}; | ||
export function useDateRangePicker(props, state, ref) { | ||
let formatMessage = useMessageFormatter($eb0a25d35efaafa331308f687b4f492$var$intlMessages); | ||
let { | ||
labelProps, | ||
fieldProps, | ||
descriptionProps, | ||
errorMessageProps | ||
} = useField(_babelRuntimeHelpersEsmExtends({}, props, { | ||
labelElementType: 'span' | ||
})); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { | ||
locale | ||
} = useLocale(); | ||
let description = state.formatValue(locale, { | ||
month: 'long' | ||
}); | ||
let descProps = useDescription(description); | ||
let startFieldProps = useLabels({ | ||
'aria-label': formatMessage('startDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let endFieldProps = useLabels({ | ||
'aria-label': formatMessage('endDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let buttonId = useId(); | ||
let dialogId = useId(); | ||
let groupProps = $bf15f790f1b0bea8ba7f44d4056d095d$export$useDatePickerGroup(state, ref); | ||
let { | ||
focusWithinProps | ||
} = useFocusWithin({ | ||
onBlurWithin() { | ||
state.confirmPlaceholder(); | ||
class $c3b2c5822bfa6f61$var$DisplayNamesPolyfill { | ||
constructor(locale){ | ||
this.locale = locale; | ||
this.dictionary = new $9lWL5$MessageDictionary((/*@__PURE__*/$parcel$interopDefault($c88f0745d72552c8$exports))); | ||
} | ||
of(field) { | ||
return this.dictionary.getStringForLocale(field, this.locale); | ||
} | ||
} | ||
}); | ||
let ariaDescribedBy = [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: mergeProps(groupProps, fieldProps, descProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: _babelRuntimeHelpersEsmExtends({}, labelProps, { | ||
onClick: () => { | ||
let focusManager = createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}), | ||
buttonProps: _babelRuntimeHelpersEsmExtends({}, descProps, { | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': labelledBy + " " + buttonId, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': labelledBy + " " + buttonId | ||
}, | ||
startFieldProps: _babelRuntimeHelpersEsmExtends({}, startFieldProps, { | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}), | ||
endFieldProps: _babelRuntimeHelpersEsmExtends({}, endFieldProps, { | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}), | ||
descriptionProps, | ||
errorMessageProps | ||
}; | ||
function $8913372aff0980af$export$1315d136e6f7581(props, segment, state, ref) { | ||
let enteredKeys = $9lWL5$useRef(''); | ||
let { locale: locale , direction: direction } = $9lWL5$useLocale(); | ||
let displayNames = $c3b2c5822bfa6f61$export$d42c60378c8168f8(); | ||
let focusManager = $9lWL5$useFocusManager(); | ||
let textValue = segment.text; | ||
let options = $9lWL5$useMemo(()=>state.dateFormatter.resolvedOptions() | ||
, [ | ||
state.dateFormatter | ||
]); | ||
let monthDateFormatter = $9lWL5$useDateFormatter({ | ||
month: 'long', | ||
timeZone: options.timeZone | ||
}); | ||
let hourDateFormatter = $9lWL5$useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: options.hour12, | ||
timeZone: options.timeZone | ||
}); | ||
if (segment.type === 'month') { | ||
let monthTextValue = monthDateFormatter.format(state.dateValue); | ||
textValue = monthTextValue !== textValue ? `${textValue} – ${monthTextValue}` : monthTextValue; | ||
} else if (segment.type === 'hour' || segment.type === 'dayPeriod') textValue = hourDateFormatter.format(state.dateValue); | ||
let { spinButtonProps: spinButtonProps } = $9lWL5$useSpinButton({ | ||
value: segment.value, | ||
textValue: textValue, | ||
minValue: segment.minValue, | ||
maxValue: segment.maxValue, | ||
isDisabled: props.isDisabled, | ||
isReadOnly: props.isReadOnly || !segment.isEditable, | ||
isRequired: props.isRequired, | ||
onIncrement: ()=>{ | ||
enteredKeys.current = ''; | ||
state.increment(segment.type); | ||
}, | ||
onDecrement: ()=>{ | ||
enteredKeys.current = ''; | ||
state.decrement(segment.type); | ||
}, | ||
onIncrementPage: ()=>{ | ||
enteredKeys.current = ''; | ||
state.incrementPage(segment.type); | ||
}, | ||
onDecrementPage: ()=>{ | ||
enteredKeys.current = ''; | ||
state.decrementPage(segment.type); | ||
}, | ||
onIncrementToMax: ()=>{ | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.maxValue); | ||
}, | ||
onDecrementToMin: ()=>{ | ||
enteredKeys.current = ''; | ||
state.setSegment(segment.type, segment.minValue); | ||
} | ||
}); | ||
let parser = $9lWL5$useMemo(()=>new $9lWL5$NumberParser(locale, { | ||
maximumFractionDigits: 0 | ||
}) | ||
, [ | ||
locale | ||
]); | ||
let backspace = ()=>{ | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly && !segment.isPlaceholder) { | ||
let newValue = segment.text.slice(0, -1); | ||
let parsed = parser.parse(newValue); | ||
if (newValue.length === 0 || parsed === 0) state.clearSegment(segment.type); | ||
else state.setSegment(segment.type, parsed); | ||
enteredKeys.current = newValue; | ||
} else if (segment.type === 'dayPeriod') state.clearSegment(segment.type); | ||
}; | ||
let onKeyDown = (e)=>{ | ||
// Firefox does not fire selectstart for Ctrl/Cmd + A | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 | ||
if (e.key === 'a' && ($9lWL5$isMac() ? e.metaKey : e.ctrlKey)) e.preventDefault(); | ||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return; | ||
switch(e.key){ | ||
case 'ArrowLeft': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (direction === 'rtl') focusManager.focusNext(); | ||
else focusManager.focusPrevious(); | ||
break; | ||
case 'ArrowRight': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (direction === 'rtl') focusManager.focusPrevious(); | ||
else focusManager.focusNext(); | ||
break; | ||
case 'Enter': | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (segment.isPlaceholder && !props.isReadOnly) state.confirmPlaceholder(segment.type); | ||
focusManager.focusNext(); | ||
break; | ||
case 'Tab': | ||
break; | ||
case 'Backspace': | ||
case 'Delete': | ||
// Safari on iOS does not fire beforeinput for the backspace key because the cursor is at the start. | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
backspace(); | ||
break; | ||
} | ||
}; | ||
// Safari dayPeriod option doesn't work... | ||
let { startsWith: startsWith } = $9lWL5$useFilter({ | ||
sensitivity: 'base' | ||
}); | ||
let amPmFormatter = $9lWL5$useDateFormatter({ | ||
hour: 'numeric', | ||
hour12: true | ||
}); | ||
let am = $9lWL5$useMemo(()=>{ | ||
let date = new Date(); | ||
date.setHours(0); | ||
return amPmFormatter.formatToParts(date).find((part)=>part.type === 'dayPeriod' | ||
).value; | ||
}, [ | ||
amPmFormatter | ||
]); | ||
let pm = $9lWL5$useMemo(()=>{ | ||
let date = new Date(); | ||
date.setHours(12); | ||
return amPmFormatter.formatToParts(date).find((part)=>part.type === 'dayPeriod' | ||
).value; | ||
}, [ | ||
amPmFormatter | ||
]); | ||
let onInput = (key)=>{ | ||
if (props.isDisabled || props.isReadOnly) return; | ||
let newValue = enteredKeys.current + key; | ||
switch(segment.type){ | ||
case 'dayPeriod': | ||
if (startsWith(am, key)) state.setSegment('dayPeriod', 0); | ||
else if (startsWith(pm, key)) state.setSegment('dayPeriod', 12); | ||
else break; | ||
focusManager.focusNext(); | ||
break; | ||
case 'day': | ||
case 'hour': | ||
case 'minute': | ||
case 'second': | ||
case 'month': | ||
case 'year': | ||
{ | ||
if (!parser.isValidPartialNumber(newValue)) return; | ||
let numberValue = parser.parse(newValue); | ||
let segmentValue = numberValue; | ||
let allowsZero = segment.minValue === 0; | ||
if (segment.type === 'hour' && state.dateFormatter.resolvedOptions().hour12) { | ||
switch(state.dateFormatter.resolvedOptions().hourCycle){ | ||
case 'h11': | ||
if (numberValue > 11) segmentValue = parser.parse(key); | ||
break; | ||
case 'h12': | ||
allowsZero = false; | ||
if (numberValue > 12) segmentValue = parser.parse(key); | ||
break; | ||
} | ||
if (segment.value >= 12 && numberValue > 1) numberValue += 12; | ||
} else if (numberValue > segment.maxValue) segmentValue = parser.parse(key); | ||
if (isNaN(numberValue)) return; | ||
let shouldSetValue = segmentValue !== 0 || allowsZero; | ||
if (shouldSetValue) state.setSegment(segment.type, segmentValue); | ||
if (Number(numberValue + '0') > segment.maxValue || newValue.length >= String(segment.maxValue).length) { | ||
enteredKeys.current = ''; | ||
if (shouldSetValue) focusManager.focusNext(); | ||
} else enteredKeys.current = newValue; | ||
break; | ||
} | ||
} | ||
}; | ||
let onFocus = ()=>{ | ||
enteredKeys.current = ''; | ||
$9lWL5$scrollIntoView($9lWL5$getScrollParent(ref.current), ref.current); | ||
// Safari requires that a selection is set or it won't fire input events. | ||
// Since usePress disables text selection, this won't happen by default. | ||
ref.current.style.webkitUserSelect = 'text'; | ||
let selection = window.getSelection(); | ||
selection.collapse(ref.current); | ||
ref.current.style.webkitUserSelect = ''; | ||
}; | ||
let compositionRef = $9lWL5$useRef(''); | ||
// @ts-ignore - TODO: possibly old TS version? doesn't fail in my editor... | ||
$9lWL5$useEvent(ref, 'beforeinput', (e)=>{ | ||
e.preventDefault(); | ||
switch(e.inputType){ | ||
case 'deleteContentBackward': | ||
case 'deleteContentForward': | ||
if (parser.isValidPartialNumber(segment.text) && !props.isReadOnly) backspace(); | ||
break; | ||
case 'insertCompositionText': | ||
// insertCompositionText cannot be canceled. | ||
// Record the current state of the element so we can restore it in the `input` event below. | ||
compositionRef.current = ref.current.textContent; | ||
// Safari gets stuck in a composition state unless we also assign to the value here. | ||
// eslint-disable-next-line no-self-assign | ||
ref.current.textContent = ref.current.textContent; | ||
break; | ||
default: | ||
if (e.data != null) onInput(e.data); | ||
break; | ||
} | ||
}); | ||
$9lWL5$useEvent(ref, 'input', (e)=>{ | ||
let { inputType: inputType , data: data } = e; | ||
switch(inputType){ | ||
case 'insertCompositionText': | ||
// Reset the DOM to how it was in the beforeinput event. | ||
ref.current.textContent = compositionRef.current; | ||
// Android sometimes fires key presses of letters as composition events. Need to handle am/pm keys here too. | ||
// Can also happen e.g. with Pinyin keyboard on iOS. | ||
if (startsWith(am, data) || startsWith(pm, data)) onInput(data); | ||
break; | ||
} | ||
}); | ||
// Focus on mouse down/touch up to match native textfield behavior. | ||
// usePress handles canceling text selection. | ||
let { pressProps: pressProps } = $9lWL5$usePress({ | ||
preventFocusOnPress: true, | ||
onPressStart: (e)=>{ | ||
if (e.pointerType === 'mouse') e.target.focus(); | ||
}, | ||
onPress (e) { | ||
if (e.pointerType !== 'mouse') e.target.focus(); | ||
} | ||
}); | ||
// For Android: prevent selection on long press. | ||
$9lWL5$useEvent(ref, 'selectstart', (e)=>{ | ||
e.preventDefault(); | ||
}); | ||
// spinbuttons cannot be focused with VoiceOver on iOS. | ||
let touchPropOverrides = $9lWL5$isIOS() || segment.type === 'timeZoneName' ? { | ||
role: 'textbox', | ||
'aria-valuemax': null, | ||
'aria-valuemin': null, | ||
'aria-valuetext': null, | ||
'aria-valuenow': null | ||
} : { | ||
}; | ||
let { ariaLabelledBy: ariaLabelledBy , ariaDescribedBy: ariaDescribedBy } = $423e84bb76847e49$export$beb2340c1222c6d.get(state); | ||
// Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being | ||
// read every time the user navigates to a new segment. | ||
let firstSegment = $9lWL5$useMemo(()=>state.segments.find((s)=>s.isEditable | ||
) | ||
, [ | ||
state.segments | ||
]); | ||
if (segment !== firstSegment && state.validationState !== 'invalid') ariaDescribedBy = undefined; | ||
let id = $9lWL5$useId(props.id); | ||
let isEditable = !props.isDisabled && !props.isReadOnly && segment.isEditable; | ||
return { | ||
segmentProps: $9lWL5$mergeProps(spinButtonProps, pressProps, { | ||
id: id, | ||
...touchPropOverrides, | ||
'aria-controls': props['aria-controls'], | ||
// 'aria-haspopup': props['aria-haspopup'], // deprecated in ARIA 1.2 | ||
'aria-invalid': state.validationState === 'invalid' ? 'true' : undefined, | ||
'aria-label': segment.type !== 'literal' ? displayNames.of(segment.type) : undefined, | ||
'aria-labelledby': `${ariaLabelledBy} ${id}`, | ||
'aria-describedby': ariaDescribedBy, | ||
'aria-placeholder': segment.isPlaceholder ? segment.text : undefined, | ||
'aria-readonly': props.isReadOnly || !segment.isEditable ? 'true' : undefined, | ||
contentEditable: isEditable, | ||
suppressContentEditableWarning: isEditable, | ||
spellCheck: isEditable ? 'false' : undefined, | ||
autoCapitalize: isEditable ? 'off' : undefined, | ||
autoCorrect: isEditable ? 'off' : undefined, | ||
// Capitalization was changed in React 17... | ||
[parseInt($9lWL5$react.version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined, | ||
inputMode: props.isDisabled || segment.type === 'dayPeriod' || !isEditable ? undefined : 'numeric', | ||
tabIndex: props.isDisabled ? undefined : 0, | ||
onKeyDown: onKeyDown, | ||
onFocus: onFocus | ||
}) | ||
}; | ||
} | ||
var $fd2ce5f0d182d3e9$exports = {}; | ||
$parcel$export($fd2ce5f0d182d3e9$exports, "useDateRangePicker", () => $fd2ce5f0d182d3e9$export$12fd5f0e9f4bb192); | ||
function $fd2ce5f0d182d3e9$export$12fd5f0e9f4bb192(props, state, ref) { | ||
let formatMessage = $9lWL5$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($c88f0745d72552c8$exports))); | ||
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $9lWL5$useField({ | ||
...props, | ||
labelElementType: 'span' | ||
}); | ||
let labelledBy = fieldProps['aria-labelledby'] || fieldProps.id; | ||
let { locale: locale } = $9lWL5$useLocale(); | ||
let description = state.formatValue(locale, { | ||
month: 'long' | ||
}); | ||
let descProps = $9lWL5$useDescription(description); | ||
let startFieldProps = $9lWL5$useLabels({ | ||
'aria-label': formatMessage('startDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let endFieldProps = $9lWL5$useLabels({ | ||
'aria-label': formatMessage('endDate'), | ||
'aria-labelledby': labelledBy | ||
}); | ||
let buttonId = $9lWL5$useId(); | ||
let dialogId = $9lWL5$useId(); | ||
let groupProps = $2bf1c991883828b3$export$4a931266a3838b86(state, ref); | ||
let { focusWithinProps: focusWithinProps } = $9lWL5$useFocusWithin({ | ||
onBlurWithin () { | ||
state.confirmPlaceholder(); | ||
} | ||
}); | ||
let ariaDescribedBy = [ | ||
descProps['aria-describedby'], | ||
fieldProps['aria-describedby'] | ||
].filter(Boolean).join(' ') || undefined; | ||
return { | ||
groupProps: $9lWL5$mergeProps(groupProps, fieldProps, descProps, focusWithinProps, { | ||
role: 'group', | ||
'aria-disabled': props.isDisabled || null, | ||
'aria-describedby': ariaDescribedBy | ||
}), | ||
labelProps: { | ||
...labelProps, | ||
onClick: ()=>{ | ||
let focusManager = $9lWL5$createFocusManager(ref); | ||
focusManager.focusFirst(); | ||
} | ||
}, | ||
buttonProps: { | ||
...descProps, | ||
id: buttonId, | ||
excludeFromTabOrder: true, | ||
'aria-haspopup': 'dialog', | ||
'aria-label': formatMessage('calendar'), | ||
'aria-labelledby': `${labelledBy} ${buttonId}`, | ||
'aria-describedby': ariaDescribedBy | ||
}, | ||
dialogProps: { | ||
id: dialogId, | ||
'aria-labelledby': `${labelledBy} ${buttonId}` | ||
}, | ||
startFieldProps: { | ||
...startFieldProps, | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}, | ||
endFieldProps: { | ||
...endFieldProps, | ||
'aria-describedby': fieldProps['aria-describedby'] | ||
}, | ||
descriptionProps: descriptionProps, | ||
errorMessageProps: errorMessageProps | ||
}; | ||
} | ||
export {$dd56a33159a0ea2f$export$42df105a73306d51 as useDatePicker, $8913372aff0980af$export$1315d136e6f7581 as useDateSegment, $423e84bb76847e49$export$beb2340c1222c6d as labelIds, $423e84bb76847e49$export$5591b0b878c1a989 as useDateField, $fd2ce5f0d182d3e9$export$12fd5f0e9f4bb192 as useDateRangePicker, $c3b2c5822bfa6f61$export$d42c60378c8168f8 as useDisplayNames}; | ||
//# sourceMappingURL=module.js.map |
{ | ||
"name": "@react-aria/datepicker", | ||
"version": "3.0.0-nightly.3040+e2b459ab9", | ||
"version": "3.0.0-nightly.3047+87960ad25", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,15 +21,15 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@internationalized/message": "3.0.4-nightly.3040+e2b459ab9", | ||
"@internationalized/number": "3.0.4-nightly.3040+e2b459ab9", | ||
"@react-aria/focus": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-aria/i18n": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-aria/interactions": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-aria/label": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-aria/spinbutton": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-aria/utils": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-stately/datepicker": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-types/button": "3.4.2-nightly.3040+e2b459ab9", | ||
"@react-types/datepicker": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-types/dialog": "3.3.2-nightly.3040+e2b459ab9", | ||
"@react-types/shared": "3.0.0-nightly.1349+e2b459ab9" | ||
"@internationalized/message": "3.0.4-nightly.3047+87960ad25", | ||
"@internationalized/number": "3.0.4-nightly.3047+87960ad25", | ||
"@react-aria/focus": "3.0.0-nightly.1356+87960ad25", | ||
"@react-aria/i18n": "3.0.0-nightly.1356+87960ad25", | ||
"@react-aria/interactions": "3.0.0-nightly.1356+87960ad25", | ||
"@react-aria/label": "3.0.0-nightly.1356+87960ad25", | ||
"@react-aria/spinbutton": "3.0.0-nightly.1356+87960ad25", | ||
"@react-aria/utils": "3.0.0-nightly.1356+87960ad25", | ||
"@react-stately/datepicker": "3.0.0-nightly.1356+87960ad25", | ||
"@react-types/button": "3.4.2-nightly.3047+87960ad25", | ||
"@react-types/datepicker": "3.0.0-nightly.1356+87960ad25", | ||
"@react-types/dialog": "3.3.2-nightly.3047+87960ad25", | ||
"@react-types/shared": "3.0.0-nightly.1356+87960ad25" | ||
}, | ||
@@ -43,3 +43,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "e2b459ab996abd06b0913942e9801b88493ed940" | ||
"gitHead": "87960ad25c26bc4cd6af506bb5e7e0f06621556c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
278009
2113