@react-aria/calendar 3.5.13 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-AE.main.js.map +1 -1
- package/dist/ar-AE.module.js.map +1 -1
- package/dist/bg-BG.main.js.map +1 -1
- package/dist/bg-BG.module.js.map +1 -1
- package/dist/cs-CZ.main.js.map +1 -1
- package/dist/cs-CZ.module.js.map +1 -1
- package/dist/da-DK.main.js.map +1 -1
- package/dist/da-DK.module.js.map +1 -1
- package/dist/de-DE.main.js.map +1 -1
- package/dist/de-DE.module.js.map +1 -1
- package/dist/el-GR.main.js.map +1 -1
- package/dist/el-GR.module.js.map +1 -1
- package/dist/en-US.main.js.map +1 -1
- package/dist/en-US.module.js.map +1 -1
- package/dist/es-ES.main.js.map +1 -1
- package/dist/es-ES.module.js.map +1 -1
- package/dist/et-EE.main.js.map +1 -1
- package/dist/et-EE.module.js.map +1 -1
- package/dist/fi-FI.main.js.map +1 -1
- package/dist/fi-FI.module.js.map +1 -1
- package/dist/fr-FR.main.js.map +1 -1
- package/dist/fr-FR.module.js.map +1 -1
- package/dist/he-IL.main.js.map +1 -1
- package/dist/he-IL.module.js.map +1 -1
- package/dist/hr-HR.main.js.map +1 -1
- package/dist/hr-HR.module.js.map +1 -1
- package/dist/hu-HU.main.js.map +1 -1
- package/dist/hu-HU.module.js.map +1 -1
- package/dist/it-IT.main.js.map +1 -1
- package/dist/it-IT.module.js.map +1 -1
- package/dist/ja-JP.main.js.map +1 -1
- package/dist/ja-JP.module.js.map +1 -1
- package/dist/ko-KR.main.js.map +1 -1
- package/dist/ko-KR.module.js.map +1 -1
- package/dist/lt-LT.main.js.map +1 -1
- package/dist/lt-LT.module.js.map +1 -1
- package/dist/lv-LV.main.js.map +1 -1
- package/dist/lv-LV.module.js.map +1 -1
- package/dist/nb-NO.main.js.map +1 -1
- package/dist/nb-NO.module.js.map +1 -1
- package/dist/nl-NL.main.js.map +1 -1
- package/dist/nl-NL.module.js.map +1 -1
- package/dist/pl-PL.main.js.map +1 -1
- package/dist/pl-PL.module.js.map +1 -1
- package/dist/pt-BR.main.js.map +1 -1
- package/dist/pt-BR.module.js.map +1 -1
- package/dist/pt-PT.main.js.map +1 -1
- package/dist/pt-PT.module.js.map +1 -1
- package/dist/ro-RO.main.js.map +1 -1
- package/dist/ro-RO.module.js.map +1 -1
- package/dist/ru-RU.main.js.map +1 -1
- package/dist/ru-RU.module.js.map +1 -1
- package/dist/sk-SK.main.js.map +1 -1
- package/dist/sk-SK.module.js.map +1 -1
- package/dist/sl-SI.main.js.map +1 -1
- package/dist/sl-SI.module.js.map +1 -1
- package/dist/sr-SP.main.js.map +1 -1
- package/dist/sr-SP.module.js.map +1 -1
- package/dist/sv-SE.main.js.map +1 -1
- package/dist/sv-SE.module.js.map +1 -1
- package/dist/tr-TR.main.js.map +1 -1
- package/dist/tr-TR.module.js.map +1 -1
- package/dist/uk-UA.main.js.map +1 -1
- package/dist/uk-UA.module.js.map +1 -1
- package/dist/useCalendarCell.main.js +11 -11
- package/dist/useCalendarCell.main.js.map +1 -1
- package/dist/useCalendarCell.mjs +11 -11
- package/dist/useCalendarCell.module.js +11 -11
- package/dist/useCalendarCell.module.js.map +1 -1
- package/dist/useCalendarGrid.main.js +2 -2
- package/dist/useCalendarGrid.main.js.map +1 -1
- package/dist/useCalendarGrid.mjs +2 -2
- package/dist/useCalendarGrid.module.js +2 -2
- package/dist/useCalendarGrid.module.js.map +1 -1
- package/dist/utils.main.js +2 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +2 -1
- package/dist/utils.module.js +2 -1
- package/dist/utils.module.js.map +1 -1
- package/dist/zh-CN.main.js.map +1 -1
- package/dist/zh-CN.module.js.map +1 -1
- package/dist/zh-TW.main.js.map +1 -1
- package/dist/zh-TW.module.js.map +1 -1
- package/package.json +13 -13
- package/src/useCalendarCell.ts +13 -13
- package/src/useCalendarGrid.ts +3 -3
- package/src/utils.ts +5 -5
package/dist/pt-PT.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,GAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC;IACpD,8BAA8B,CAAC,uDAAuD,CAAC;IACvF,eAAe,CAAC,4BAAsB,CAAC;IACvC,eAAe,CAAC,2BAAwB,CAAC;IACzC,QAAQ,CAAC,UAAO,CAAC;IACjB,YAAY,CAAC,QAAQ,CAAC;IACtB,2BAA2B,CAAC,OAAS,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;IACrE,4BAA4B,CAAC,OAAS,CAAC,uBAAuB,EAAE,KAAK,SAAS,EAAE;IAChF,6BAA6B,CAAC,wDAAqD,CAAC;IACpF,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;IAC3C,qBAAqB,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,YAAY,CAAC;AACjE","sources":["packages/@react-aria/calendar/intl/pt-PT.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} a {endDate}\",\n \"dateSelected\": \"{date} selecionado\",\n \"finishRangeSelectionPrompt\": \"Clique para terminar de selecionar o intervalo de datas\",\n \"maximumDate\": \"Última data disponível\",\n \"minimumDate\": \"Primeira data disponível\",\n \"next\": \"Próximo\",\n \"previous\": \"Anterior\",\n \"selectedDateDescription\": \"Data selecionada: {date}\",\n \"selectedRangeDescription\": \"Intervalo selecionado: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Clique para começar a selecionar o intervalo de datas\",\n \"todayDate\": \"Hoje, {date}\",\n \"todayDateSelected\": \"Hoje, {date} selecionado\"\n}\n"],"names":[],"version":3,"file":"pt-PT.module.js.map"}
|
package/dist/ro-RO.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,SAAS,CAAC,kBAAS,EAAE,KAAK,OAAO,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,SAAS,CAAC,kBAAS,EAAE,KAAK,OAAO,EAAE;IAC1F,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,gBAAU,CAAC;IAClD,8BAA8B,CAAC,4EAAoD,CAAC;IACpF,eAAe,CAAC,mCAAuB,CAAC;IACxC,eAAe,CAAC,kCAAsB,CAAC;IACvC,QAAQ,CAAC,eAAS,CAAC;IACnB,YAAY,CAAC,UAAO,CAAC;IACrB,2BAA2B,CAAC,OAAS,CAAC,4BAAgB,EAAE,KAAK,IAAI,EAAE;IACnE,4BAA4B,CAAC,OAAS,CAAC,mBAAmB,EAAE,KAAK,SAAS,EAAE;IAC5E,6BAA6B,CAAC,6EAAkD,CAAC;IACjF,aAAa,CAAC,OAAS,CAAC,cAAQ,EAAE,KAAK,IAAI,EAAE;IAC7C,qBAAqB,CAAC,OAAS,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,gBAAU,CAAC;AAC9D","sources":["packages/@react-aria/calendar/intl/ro-RO.json"],"sourcesContent":["{\n \"dateRange\": \"De la {startDate} până la {endDate}\",\n \"dateSelected\": \"{date} selectată\",\n \"finishRangeSelectionPrompt\": \"Apăsaţi pentru a finaliza selecţia razei pentru dată\",\n \"maximumDate\": \"Ultima dată disponibilă\",\n \"minimumDate\": \"Prima dată disponibilă\",\n \"next\": \"Următorul\",\n \"previous\": \"Înainte\",\n \"selectedDateDescription\": \"Dată selectată: {date}\",\n \"selectedRangeDescription\": \"Interval selectat: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Apăsaţi pentru a începe selecţia razei pentru dată\",\n \"todayDate\": \"Astăzi, {date}\",\n \"todayDateSelected\": \"Azi, {date} selectată\"\n}\n"],"names":[],"version":3,"file":"ro-RO.main.js.map"}
|
package/dist/ro-RO.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,SAAS,CAAC,kBAAS,EAAE,KAAK,OAAO,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,SAAS,CAAC,kBAAS,EAAE,KAAK,OAAO,EAAE;IAC1F,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,gBAAU,CAAC;IAClD,8BAA8B,CAAC,4EAAoD,CAAC;IACpF,eAAe,CAAC,mCAAuB,CAAC;IACxC,eAAe,CAAC,kCAAsB,CAAC;IACvC,QAAQ,CAAC,eAAS,CAAC;IACnB,YAAY,CAAC,UAAO,CAAC;IACrB,2BAA2B,CAAC,OAAS,CAAC,4BAAgB,EAAE,KAAK,IAAI,EAAE;IACnE,4BAA4B,CAAC,OAAS,CAAC,mBAAmB,EAAE,KAAK,SAAS,EAAE;IAC5E,6BAA6B,CAAC,6EAAkD,CAAC;IACjF,aAAa,CAAC,OAAS,CAAC,cAAQ,EAAE,KAAK,IAAI,EAAE;IAC7C,qBAAqB,CAAC,OAAS,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,gBAAU,CAAC;AAC9D","sources":["packages/@react-aria/calendar/intl/ro-RO.json"],"sourcesContent":["{\n \"dateRange\": \"De la {startDate} până la {endDate}\",\n \"dateSelected\": \"{date} selectată\",\n \"finishRangeSelectionPrompt\": \"Apăsaţi pentru a finaliza selecţia razei pentru dată\",\n \"maximumDate\": \"Ultima dată disponibilă\",\n \"minimumDate\": \"Prima dată disponibilă\",\n \"next\": \"Următorul\",\n \"previous\": \"Înainte\",\n \"selectedDateDescription\": \"Dată selectată: {date}\",\n \"selectedRangeDescription\": \"Interval selectat: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Apăsaţi pentru a începe selecţia razei pentru dată\",\n \"todayDate\": \"Astăzi, {date}\",\n \"todayDateSelected\": \"Azi, {date} selectată\"\n}\n"],"names":[],"version":3,"file":"ro-RO.module.js.map"}
|
package/dist/ru-RU.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,QAAE,EAAE,KAAK,SAAS,CAAC,gBAAI,EAAE,KAAK,OAAO,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,QAAE,EAAE,KAAK,SAAS,CAAC,gBAAI,EAAE,KAAK,OAAO,EAAE;IACjF,gBAAgB,CAAC,OAAS,CAAC,kDAAQ,EAAE,KAAK,IAAI,EAAE;IAChD,8BAA8B,CAAC,uRAA6C,CAAC;IAC7E,eAAe,CAAC,4JAAwB,CAAC;IACzC,eAAe,CAAC,uIAAqB,CAAC;IACtC,QAAQ,CAAC,mCAAK,CAAC;IACf,YAAY,CAAC,mCAAK,CAAC;IACnB,2BAA2B,CAAC,OAAS,CAAC,8FAAgB,EAAE,KAAK,IAAI,EAAE;IACnE,4BAA4B,CAAC,OAAS,CAAC,0HAAoB,EAAE,KAAK,SAAS,EAAE;IAC7E,6BAA6B,CAAC,kQAA0C,CAAC;IACzE,aAAa,CAAC,OAAS,CAAC,mDAAS,EAAE,KAAK,IAAI,EAAE;IAC9C,qBAAqB,CAAC,OAAS,CAAC,qGAAiB,EAAE,KAAK,IAAI,EAAE;AAChE","sources":["packages/@react-aria/calendar/intl/ru-RU.json"],"sourcesContent":["{\n \"dateRange\": \"С {startDate} по {endDate}\",\n \"dateSelected\": \"Выбрано {date}\",\n \"finishRangeSelectionPrompt\": \"Щелкните, чтобы завершить выбор диапазона дат\",\n \"maximumDate\": \"Последняя доступная дата\",\n \"minimumDate\": \"Первая доступная дата\",\n \"next\": \"Далее\",\n \"previous\": \"Назад\",\n \"selectedDateDescription\": \"Выбранная дата: {date}\",\n \"selectedRangeDescription\": \"Выбранный диапазон: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Щелкните, чтобы начать выбор диапазона дат\",\n \"todayDate\": \"Сегодня, {date}\",\n \"todayDateSelected\": \"Сегодня, выбрано {date}\"\n}\n"],"names":[],"version":3,"file":"ru-RU.main.js.map"}
|
package/dist/ru-RU.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,QAAE,EAAE,KAAK,SAAS,CAAC,gBAAI,EAAE,KAAK,OAAO,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,QAAE,EAAE,KAAK,SAAS,CAAC,gBAAI,EAAE,KAAK,OAAO,EAAE;IACjF,gBAAgB,CAAC,OAAS,CAAC,kDAAQ,EAAE,KAAK,IAAI,EAAE;IAChD,8BAA8B,CAAC,uRAA6C,CAAC;IAC7E,eAAe,CAAC,4JAAwB,CAAC;IACzC,eAAe,CAAC,uIAAqB,CAAC;IACtC,QAAQ,CAAC,mCAAK,CAAC;IACf,YAAY,CAAC,mCAAK,CAAC;IACnB,2BAA2B,CAAC,OAAS,CAAC,8FAAgB,EAAE,KAAK,IAAI,EAAE;IACnE,4BAA4B,CAAC,OAAS,CAAC,0HAAoB,EAAE,KAAK,SAAS,EAAE;IAC7E,6BAA6B,CAAC,kQAA0C,CAAC;IACzE,aAAa,CAAC,OAAS,CAAC,mDAAS,EAAE,KAAK,IAAI,EAAE;IAC9C,qBAAqB,CAAC,OAAS,CAAC,qGAAiB,EAAE,KAAK,IAAI,EAAE;AAChE","sources":["packages/@react-aria/calendar/intl/ru-RU.json"],"sourcesContent":["{\n \"dateRange\": \"С {startDate} по {endDate}\",\n \"dateSelected\": \"Выбрано {date}\",\n \"finishRangeSelectionPrompt\": \"Щелкните, чтобы завершить выбор диапазона дат\",\n \"maximumDate\": \"Последняя доступная дата\",\n \"minimumDate\": \"Первая доступная дата\",\n \"next\": \"Далее\",\n \"previous\": \"Назад\",\n \"selectedDateDescription\": \"Выбранная дата: {date}\",\n \"selectedRangeDescription\": \"Выбранный диапазон: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Щелкните, чтобы начать выбор диапазона дат\",\n \"todayDate\": \"Сегодня, {date}\",\n \"todayDateSelected\": \"Сегодня, выбрано {date}\"\n}\n"],"names":[],"version":3,"file":"ru-RU.module.js.map"}
|
package/dist/sk-SK.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,GAAG,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,GAAG,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,EAAE;IAClF,gBAAgB,CAAC,OAAS,CAAC,oBAAc,EAAE,KAAK,IAAI,EAAE;IACtD,8BAA8B,CAAC,2DAAyC,CAAC;IACzE,eAAe,CAAC,gCAAuB,CAAC;IACxC,eAAe,CAAC,4BAAmB,CAAC;IACpC,QAAQ,CAAC,cAAW,CAAC;IACrB,YAAY,CAAC,oBAAc,CAAC;IAC5B,2BAA2B,CAAC,OAAS,CAAC,qBAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,mBAAgB,EAAE,KAAK,SAAS,EAAE;IACzE,6BAA6B,CAAC,oDAAwC,CAAC;IACvE,aAAa,CAAC,OAAS,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;IAC1C,qBAAqB,CAAC,OAAS,CAAC,oCAAqB,EAAE,KAAK,IAAI,EAAE;AACpE","sources":["packages/@react-aria/calendar/intl/sk-SK.json"],"sourcesContent":["{\n \"dateRange\": \"Od {startDate} do {endDate}\",\n \"dateSelected\": \"Vybratý dátum {date}\",\n \"finishRangeSelectionPrompt\": \"Kliknutím dokončíte výber rozsahu dátumov\",\n \"maximumDate\": \"Posledný dostupný dátum\",\n \"minimumDate\": \"Prvý dostupný dátum\",\n \"next\": \"Nasledujúce\",\n \"previous\": \"Predchádzajúce\",\n \"selectedDateDescription\": \"Vybratý dátum: {date}\",\n \"selectedRangeDescription\": \"Vybratý rozsah: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Kliknutím spustíte výber rozsahu dátumov\",\n \"todayDate\": \"Dnes {date}\",\n \"todayDateSelected\": \"Vybratý dnešný dátum {date}\"\n}\n"],"names":[],"version":3,"file":"sk-SK.main.js.map"}
|
package/dist/sk-SK.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,GAAG,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,GAAG,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,EAAE;IAClF,gBAAgB,CAAC,OAAS,CAAC,oBAAc,EAAE,KAAK,IAAI,EAAE;IACtD,8BAA8B,CAAC,2DAAyC,CAAC;IACzE,eAAe,CAAC,gCAAuB,CAAC;IACxC,eAAe,CAAC,4BAAmB,CAAC;IACpC,QAAQ,CAAC,cAAW,CAAC;IACrB,YAAY,CAAC,oBAAc,CAAC;IAC5B,2BAA2B,CAAC,OAAS,CAAC,qBAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,mBAAgB,EAAE,KAAK,SAAS,EAAE;IACzE,6BAA6B,CAAC,oDAAwC,CAAC;IACvE,aAAa,CAAC,OAAS,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;IAC1C,qBAAqB,CAAC,OAAS,CAAC,oCAAqB,EAAE,KAAK,IAAI,EAAE;AACpE","sources":["packages/@react-aria/calendar/intl/sk-SK.json"],"sourcesContent":["{\n \"dateRange\": \"Od {startDate} do {endDate}\",\n \"dateSelected\": \"Vybratý dátum {date}\",\n \"finishRangeSelectionPrompt\": \"Kliknutím dokončíte výber rozsahu dátumov\",\n \"maximumDate\": \"Posledný dostupný dátum\",\n \"minimumDate\": \"Prvý dostupný dátum\",\n \"next\": \"Nasledujúce\",\n \"previous\": \"Predchádzajúce\",\n \"selectedDateDescription\": \"Vybratý dátum: {date}\",\n \"selectedRangeDescription\": \"Vybratý rozsah: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Kliknutím spustíte výber rozsahu dátumov\",\n \"todayDate\": \"Dnes {date}\",\n \"todayDateSelected\": \"Vybratý dnešný dátum {date}\"\n}\n"],"names":[],"version":3,"file":"sk-SK.module.js.map"}
|
package/dist/sl-SI.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,EAAE;IAC/E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,QAAQ,CAAC;IAChD,8BAA8B,CAAC,qDAA+C,CAAC;IAC/E,eAAe,CAAC,gCAA0B,CAAC;IAC3C,eAAe,CAAC,8BAAwB,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC;IAChB,YAAY,CAAC,KAAK,CAAC;IACnB,2BAA2B,CAAC,OAAS,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,uBAAiB,EAAE,KAAK,SAAS,EAAE;IAC1E,6BAA6B,CAAC,kDAA4C,CAAC;IAC3E,aAAa,CAAC,OAAS,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;IAC5C,qBAAqB,CAAC,OAAS,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC;AAC9D","sources":["packages/@react-aria/calendar/intl/sl-SI.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} do {endDate}\",\n \"dateSelected\": \"{date} izbrano\",\n \"finishRangeSelectionPrompt\": \"Kliknite za dokončanje izbire datumskega obsega\",\n \"maximumDate\": \"Zadnji razpoložljivi datum\",\n \"minimumDate\": \"Prvi razpoložljivi datum\",\n \"next\": \"Naprej\",\n \"previous\": \"Nazaj\",\n \"selectedDateDescription\": \"Izbrani datum: {date}\",\n \"selectedRangeDescription\": \"Izbrano območje: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Kliknite za začetek izbire datumskega obsega\",\n \"todayDate\": \"Danes, {date}\",\n \"todayDateSelected\": \"Danes, {date} izbrano\"\n}\n"],"names":[],"version":3,"file":"sl-SI.main.js.map"}
|
package/dist/sl-SI.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,EAAE;IAC/E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,QAAQ,CAAC;IAChD,8BAA8B,CAAC,qDAA+C,CAAC;IAC/E,eAAe,CAAC,gCAA0B,CAAC;IAC3C,eAAe,CAAC,8BAAwB,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC;IAChB,YAAY,CAAC,KAAK,CAAC;IACnB,2BAA2B,CAAC,OAAS,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,uBAAiB,EAAE,KAAK,SAAS,EAAE;IAC1E,6BAA6B,CAAC,kDAA4C,CAAC;IAC3E,aAAa,CAAC,OAAS,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;IAC5C,qBAAqB,CAAC,OAAS,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC;AAC9D","sources":["packages/@react-aria/calendar/intl/sl-SI.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} do {endDate}\",\n \"dateSelected\": \"{date} izbrano\",\n \"finishRangeSelectionPrompt\": \"Kliknite za dokončanje izbire datumskega obsega\",\n \"maximumDate\": \"Zadnji razpoložljivi datum\",\n \"minimumDate\": \"Prvi razpoložljivi datum\",\n \"next\": \"Naprej\",\n \"previous\": \"Nazaj\",\n \"selectedDateDescription\": \"Izbrani datum: {date}\",\n \"selectedRangeDescription\": \"Izbrano območje: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Kliknite za začetek izbire datumskega obsega\",\n \"todayDate\": \"Danes, {date}\",\n \"todayDateSelected\": \"Danes, {date} izbrano\"\n}\n"],"names":[],"version":3,"file":"sl-SI.module.js.map"}
|
package/dist/sr-SP.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,EAAE;IAC/E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,QAAQ,CAAC;IAChD,8BAA8B,CAAC,iDAA2C,CAAC;IAC3E,eAAe,CAAC,8BAAwB,CAAC;IACzC,eAAe,CAAC,4BAAsB,CAAC;IACvC,QAAQ,CAAC,aAAO,CAAC;IACjB,YAAY,CAAC,SAAS,CAAC;IACvB,2BAA2B,CAAC,OAAS,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;IACnE,4BAA4B,CAAC,OAAS,CAAC,iBAAiB,EAAE,KAAK,SAAS,EAAE;IAC1E,6BAA6B,CAAC,kDAA4C,CAAC;IAC3E,aAAa,CAAC,OAAS,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;IAC5C,qBAAqB,CAAC,OAAS,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;AAC9D","sources":["packages/@react-aria/calendar/intl/sr-SP.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} do {endDate}\",\n \"dateSelected\": \"{date} izabran\",\n \"finishRangeSelectionPrompt\": \"Kliknite da dovršite opseg izabranih datuma\",\n \"maximumDate\": \"Zadnji raspoloživi datum\",\n \"minimumDate\": \"Prvi raspoloživi datum\",\n \"next\": \"Sledeći\",\n \"previous\": \"Prethodni\",\n \"selectedDateDescription\": \"Izabrani datum: {date}\",\n \"selectedRangeDescription\": \"Izabrani period: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Kliknite da započnete opseg izabranih datuma\",\n \"todayDate\": \"Danas, {date}\",\n \"todayDateSelected\": \"Danas, izabran {date}\"\n}\n"],"names":[],"version":3,"file":"sr-SP.main.js.map"}
|
package/dist/sr-SP.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,OAAO,EAAE;IAC/E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,QAAQ,CAAC;IAChD,8BAA8B,CAAC,iDAA2C,CAAC;IAC3E,eAAe,CAAC,8BAAwB,CAAC;IACzC,eAAe,CAAC,4BAAsB,CAAC;IACvC,QAAQ,CAAC,aAAO,CAAC;IACjB,YAAY,CAAC,SAAS,CAAC;IACvB,2BAA2B,CAAC,OAAS,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;IACnE,4BAA4B,CAAC,OAAS,CAAC,iBAAiB,EAAE,KAAK,SAAS,EAAE;IAC1E,6BAA6B,CAAC,kDAA4C,CAAC;IAC3E,aAAa,CAAC,OAAS,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;IAC5C,qBAAqB,CAAC,OAAS,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;AAC9D","sources":["packages/@react-aria/calendar/intl/sr-SP.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} do {endDate}\",\n \"dateSelected\": \"{date} izabran\",\n \"finishRangeSelectionPrompt\": \"Kliknite da dovršite opseg izabranih datuma\",\n \"maximumDate\": \"Zadnji raspoloživi datum\",\n \"minimumDate\": \"Prvi raspoloživi datum\",\n \"next\": \"Sledeći\",\n \"previous\": \"Prethodni\",\n \"selectedDateDescription\": \"Izabrani datum: {date}\",\n \"selectedRangeDescription\": \"Izabrani period: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Kliknite da započnete opseg izabranih datuma\",\n \"todayDate\": \"Danas, {date}\",\n \"todayDateSelected\": \"Danas, izabran {date}\"\n}\n"],"names":[],"version":3,"file":"sr-SP.module.js.map"}
|
package/dist/sv-SE.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,MAAM,EAAE,KAAK,OAAO,EAAE;IACjF,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;IAClD,8BAA8B,CAAC,+CAA4C,CAAC;IAC5E,eAAe,CAAC,2BAAwB,CAAC;IACzC,eAAe,CAAC,+BAAyB,CAAC;IAC1C,QAAQ,CAAC,QAAK,CAAC;IACf,YAAY,CAAC,gBAAU,CAAC;IACxB,2BAA2B,CAAC,OAAS,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;IAC/D,4BAA4B,CAAC,OAAS,CAAC,gBAAgB,EAAE,KAAK,SAAS,EAAE;IACzE,6BAA6B,CAAC,yCAAmC,CAAC;IAClE,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;IAC3C,qBAAqB,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC;AAC/D","sources":["packages/@react-aria/calendar/intl/sv-SE.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} till {endDate}\",\n \"dateSelected\": \"{date} har valts\",\n \"finishRangeSelectionPrompt\": \"Klicka för att avsluta val av datumintervall\",\n \"maximumDate\": \"Sista tillgängliga datum\",\n \"minimumDate\": \"Första tillgängliga datum\",\n \"next\": \"Nästa\",\n \"previous\": \"Föregående\",\n \"selectedDateDescription\": \"Valt datum: {date}\",\n \"selectedRangeDescription\": \"Valt intervall: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Klicka för att välja datumintervall\",\n \"todayDate\": \"Idag, {date}\",\n \"todayDateSelected\": \"Idag, {date} har valts\"\n}\n"],"names":[],"version":3,"file":"sv-SE.main.js.map"}
|
package/dist/sv-SE.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,MAAM,EAAE,KAAK,OAAO,EAAE;IACjF,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;IAClD,8BAA8B,CAAC,+CAA4C,CAAC;IAC5E,eAAe,CAAC,2BAAwB,CAAC;IACzC,eAAe,CAAC,+BAAyB,CAAC;IAC1C,QAAQ,CAAC,QAAK,CAAC;IACf,YAAY,CAAC,gBAAU,CAAC;IACxB,2BAA2B,CAAC,OAAS,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;IAC/D,4BAA4B,CAAC,OAAS,CAAC,gBAAgB,EAAE,KAAK,SAAS,EAAE;IACzE,6BAA6B,CAAC,yCAAmC,CAAC;IAClE,aAAa,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;IAC3C,qBAAqB,CAAC,OAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC;AAC/D","sources":["packages/@react-aria/calendar/intl/sv-SE.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} till {endDate}\",\n \"dateSelected\": \"{date} har valts\",\n \"finishRangeSelectionPrompt\": \"Klicka för att avsluta val av datumintervall\",\n \"maximumDate\": \"Sista tillgängliga datum\",\n \"minimumDate\": \"Första tillgängliga datum\",\n \"next\": \"Nästa\",\n \"previous\": \"Föregående\",\n \"selectedDateDescription\": \"Valt datum: {date}\",\n \"selectedRangeDescription\": \"Valt intervall: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Klicka för att välja datumintervall\",\n \"todayDate\": \"Idag, {date}\",\n \"todayDateSelected\": \"Idag, {date} har valts\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
|
package/dist/tr-TR.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,GAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,WAAQ,CAAC;IAChD,8BAA8B,CAAC,mFAA+C,CAAC;IAC/E,eAAe,CAAC,mBAAgB,CAAC;IACjC,eAAe,CAAC,yBAAgB,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC;IACjB,YAAY,CAAC,SAAM,CAAC;IACpB,2BAA2B,CAAC,OAAS,CAAC,kBAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,yBAAgB,EAAE,KAAK,SAAS,EAAE;IACzE,6BAA6B,CAAC,wFAA8C,CAAC;IAC7E,aAAa,CAAC,OAAS,CAAC,UAAO,EAAE,KAAK,IAAI,EAAE;IAC5C,qBAAqB,CAAC,OAAS,CAAC,UAAO,EAAE,KAAK,IAAI,CAAC,WAAQ,CAAC;AAC9D","sources":["packages/@react-aria/calendar/intl/tr-TR.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} - {endDate}\",\n \"dateSelected\": \"{date} seçildi\",\n \"finishRangeSelectionPrompt\": \"Tarih aralığı seçimini tamamlamak için tıklayın\",\n \"maximumDate\": \"Son müsait tarih\",\n \"minimumDate\": \"İlk müsait tarih\",\n \"next\": \"Sonraki\",\n \"previous\": \"Önceki\",\n \"selectedDateDescription\": \"Seçilen Tarih: {date}\",\n \"selectedRangeDescription\": \"Seçilen Aralık: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Tarih aralığı seçimini başlatmak için tıklayın\",\n \"todayDate\": \"Bugün, {date}\",\n \"todayDateSelected\": \"Bugün, {date} seçildi\"\n}\n"],"names":[],"version":3,"file":"tr-TR.main.js.map"}
|
package/dist/tr-TR.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,GAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,WAAQ,CAAC;IAChD,8BAA8B,CAAC,mFAA+C,CAAC;IAC/E,eAAe,CAAC,mBAAgB,CAAC;IACjC,eAAe,CAAC,yBAAgB,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC;IACjB,YAAY,CAAC,SAAM,CAAC;IACpB,2BAA2B,CAAC,OAAS,CAAC,kBAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,yBAAgB,EAAE,KAAK,SAAS,EAAE;IACzE,6BAA6B,CAAC,wFAA8C,CAAC;IAC7E,aAAa,CAAC,OAAS,CAAC,UAAO,EAAE,KAAK,IAAI,EAAE;IAC5C,qBAAqB,CAAC,OAAS,CAAC,UAAO,EAAE,KAAK,IAAI,CAAC,WAAQ,CAAC;AAC9D","sources":["packages/@react-aria/calendar/intl/tr-TR.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} - {endDate}\",\n \"dateSelected\": \"{date} seçildi\",\n \"finishRangeSelectionPrompt\": \"Tarih aralığı seçimini tamamlamak için tıklayın\",\n \"maximumDate\": \"Son müsait tarih\",\n \"minimumDate\": \"İlk müsait tarih\",\n \"next\": \"Sonraki\",\n \"previous\": \"Önceki\",\n \"selectedDateDescription\": \"Seçilen Tarih: {date}\",\n \"selectedRangeDescription\": \"Seçilen Aralık: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Tarih aralığı seçimini başlatmak için tıklayın\",\n \"todayDate\": \"Bugün, {date}\",\n \"todayDateSelected\": \"Bugün, {date} seçildi\"\n}\n"],"names":[],"version":3,"file":"tr-TR.module.js.map"}
|
package/dist/uk-UA.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,CAAC,kDAAQ,EAAE,KAAK,IAAI,EAAE;IAChD,8BAA8B,CAAC,gRAA4C,CAAC;IAC5E,eAAe,CAAC,uIAAqB,CAAC;IACtC,eAAe,CAAC,yHAAmB,CAAC;IACpC,QAAQ,CAAC,+DAAS,CAAC;IACnB,YAAY,CAAC,sEAAU,CAAC;IACxB,2BAA2B,CAAC,OAAS,CAAC,gFAAc,EAAE,KAAK,IAAI,EAAE;IACjE,4BAA4B,CAAC,OAAS,CAAC,mHAAmB,EAAE,KAAK,SAAS,EAAE;IAC5E,6BAA6B,CAAC,2PAAyC,CAAC;IACxE,aAAa,CAAC,OAAS,CAAC,0DAAU,EAAE,KAAK,IAAI,EAAE;IAC/C,qBAAqB,CAAC,OAAS,CAAC,4GAAkB,EAAE,KAAK,IAAI,EAAE;AACjE","sources":["packages/@react-aria/calendar/intl/uk-UA.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} — {endDate}\",\n \"dateSelected\": \"Вибрано {date}\",\n \"finishRangeSelectionPrompt\": \"Натисніть, щоб завершити вибір діапазону дат\",\n \"maximumDate\": \"Остання доступна дата\",\n \"minimumDate\": \"Перша доступна дата\",\n \"next\": \"Наступний\",\n \"previous\": \"Попередній\",\n \"selectedDateDescription\": \"Вибрана дата: {date}\",\n \"selectedRangeDescription\": \"Вибраний діапазон: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Натисніть, щоб почати вибір діапазону дат\",\n \"todayDate\": \"Сьогодні, {date}\",\n \"todayDateSelected\": \"Сьогодні, вибрано {date}\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
|
package/dist/uk-UA.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,CAAC,kDAAQ,EAAE,KAAK,IAAI,EAAE;IAChD,8BAA8B,CAAC,gRAA4C,CAAC;IAC5E,eAAe,CAAC,uIAAqB,CAAC;IACtC,eAAe,CAAC,yHAAmB,CAAC;IACpC,QAAQ,CAAC,+DAAS,CAAC;IACnB,YAAY,CAAC,sEAAU,CAAC;IACxB,2BAA2B,CAAC,OAAS,CAAC,gFAAc,EAAE,KAAK,IAAI,EAAE;IACjE,4BAA4B,CAAC,OAAS,CAAC,mHAAmB,EAAE,KAAK,SAAS,EAAE;IAC5E,6BAA6B,CAAC,2PAAyC,CAAC;IACxE,aAAa,CAAC,OAAS,CAAC,0DAAU,EAAE,KAAK,IAAI,EAAE;IAC/C,qBAAqB,CAAC,OAAS,CAAC,4GAAkB,EAAE,KAAK,IAAI,EAAE;AACjE","sources":["packages/@react-aria/calendar/intl/uk-UA.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} — {endDate}\",\n \"dateSelected\": \"Вибрано {date}\",\n \"finishRangeSelectionPrompt\": \"Натисніть, щоб завершити вибір діапазону дат\",\n \"maximumDate\": \"Остання доступна дата\",\n \"minimumDate\": \"Перша доступна дата\",\n \"next\": \"Наступний\",\n \"previous\": \"Попередній\",\n \"selectedDateDescription\": \"Вибрана дата: {date}\",\n \"selectedRangeDescription\": \"Вибраний діапазон: {dateRange}\",\n \"startRangeSelectionPrompt\": \"Натисніть, щоб почати вибір діапазону дат\",\n \"todayDate\": \"Сьогодні, {date}\",\n \"todayDateSelected\": \"Сьогодні, вибрано {date}\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
|
|
@@ -50,7 +50,7 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
50
50
|
isDisabled = isDisabled || state.isCellDisabled(date);
|
|
51
51
|
let isUnavailable = state.isCellUnavailable(date);
|
|
52
52
|
let isSelectable = !isDisabled && !isUnavailable;
|
|
53
|
-
let isInvalid = state.isValueInvalid && ('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $cuS6T$internationalizeddate.isSameDay)(state.value, date));
|
|
53
|
+
let isInvalid = state.isValueInvalid && Boolean('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $cuS6T$internationalizeddate.isSameDay)(state.value, date));
|
|
54
54
|
if (isInvalid) isSelected = true;
|
|
55
55
|
// For performance, reuse the same date object as before if the new date prop is the same.
|
|
56
56
|
// This allows subsequent useMemo results to be reused.
|
|
@@ -99,7 +99,7 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
99
99
|
let descriptionProps = (0, $cuS6T$reactariautils.useDescription)(rangeSelectionPrompt);
|
|
100
100
|
let isAnchorPressed = (0, $cuS6T$react.useRef)(false);
|
|
101
101
|
let isRangeBoundaryPressed = (0, $cuS6T$react.useRef)(false);
|
|
102
|
-
let touchDragTimerRef = (0, $cuS6T$react.useRef)(
|
|
102
|
+
let touchDragTimerRef = (0, $cuS6T$react.useRef)(undefined);
|
|
103
103
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $cuS6T$reactariainteractions.usePress)({
|
|
104
104
|
// When dragging to select a range, we don't want dragging over the original anchor
|
|
105
105
|
// again to trigger onPressStart. Cancel presses immediately when the pointer exits.
|
|
@@ -133,7 +133,7 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
133
133
|
}
|
|
134
134
|
let startDragging = ()=>{
|
|
135
135
|
state.setDragging(true);
|
|
136
|
-
touchDragTimerRef.current =
|
|
136
|
+
touchDragTimerRef.current = undefined;
|
|
137
137
|
state.selectDate(date);
|
|
138
138
|
state.setFocusedDate(date);
|
|
139
139
|
isAnchorPressed.current = true;
|
|
@@ -148,7 +148,7 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
148
148
|
isRangeBoundaryPressed.current = false;
|
|
149
149
|
isAnchorPressed.current = false;
|
|
150
150
|
clearTimeout(touchDragTimerRef.current);
|
|
151
|
-
touchDragTimerRef.current =
|
|
151
|
+
touchDragTimerRef.current = undefined;
|
|
152
152
|
},
|
|
153
153
|
onPress () {
|
|
154
154
|
// For non-range selection, always select on press up.
|
|
@@ -196,7 +196,7 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
|
-
let tabIndex =
|
|
199
|
+
let tabIndex = undefined;
|
|
200
200
|
if (!isDisabled) tabIndex = (0, $cuS6T$internationalizeddate.isSameDay)(date, state.focusedDate) ? 0 : -1;
|
|
201
201
|
// Focus the button in the DOM when the state updates.
|
|
202
202
|
(0, $cuS6T$react.useEffect)(()=>{
|
|
@@ -229,9 +229,9 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
229
229
|
return {
|
|
230
230
|
cellProps: {
|
|
231
231
|
role: 'gridcell',
|
|
232
|
-
'aria-disabled': !isSelectable ||
|
|
233
|
-
'aria-selected': isSelected ||
|
|
234
|
-
'aria-invalid': isInvalid ||
|
|
232
|
+
'aria-disabled': !isSelectable || undefined,
|
|
233
|
+
'aria-selected': isSelected || undefined,
|
|
234
|
+
'aria-invalid': isInvalid || undefined
|
|
235
235
|
},
|
|
236
236
|
buttonProps: (0, $cuS6T$reactariautils.mergeProps)(pressProps, {
|
|
237
237
|
onFocus () {
|
|
@@ -239,11 +239,11 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
|
|
|
239
239
|
},
|
|
240
240
|
tabIndex: tabIndex,
|
|
241
241
|
role: 'button',
|
|
242
|
-
'aria-disabled': !isSelectable ||
|
|
242
|
+
'aria-disabled': !isSelectable || undefined,
|
|
243
243
|
'aria-label': label,
|
|
244
|
-
'aria-invalid': isInvalid ||
|
|
244
|
+
'aria-invalid': isInvalid || undefined,
|
|
245
245
|
'aria-describedby': [
|
|
246
|
-
isInvalid ? errorMessageId :
|
|
246
|
+
isInvalid ? errorMessageId : undefined,
|
|
247
247
|
descriptionProps['aria-describedby']
|
|
248
248
|
].filter(Boolean).join(' ') || undefined,
|
|
249
249
|
onPointerEnter (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgEM,SAAS,0CAAgB,KAA4B,EAAE,KAAyC,EAAE,GAAkC;IACzI,IAAI,QAAC,IAAI,cAAE,UAAU,EAAC,GAAG;IACzB,IAAI,kBAAC,cAAc,2BAAE,uBAAuB,EAAC,GAAG,CAAA,GA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C;gBACb,uDAAuD;gBACvD,wCAAwC;gBACxC,gCAAgC;gBAChC,IAAI,2BAA2B,EAAE,MAAM,EACrC,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,SAAS;YAE9C;YACA,eAAc,CAAC;gBACb,sCAAsC;gBACtC,EAAE,cAAc;YAClB;QACF;mBACA;mBACA;oBACA;oBACA;uBACA;QACA,uBAAuB,KAAK,OAAO,CAAC,MAAM,YAAY,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,CAAC,MAAM,YAAY,CAAC,GAAG,IAAI;mBAC5G;uBACA;IACF;AACF","sources":["packages/@react-aria/calendar/src/useCalendarCell.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, isEqualDay, isSameDay, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {focusWithoutScrolling, getScrollParent, mergeProps, scrollIntoViewport, useDeepMemo, useDescription} from '@react-aria/utils';\nimport {getEraFormat, hookData} from './utils';\nimport {getInteractionModality, usePress} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useDateFormatter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useEffect, useMemo, useRef} from 'react';\n\nexport interface AriaCalendarCellProps {\n /** The date that this cell represents. */\n date: CalendarDate,\n /**\n * Whether the cell is disabled. By default, this is determined by the\n * Calendar's `minValue`, `maxValue`, and `isDisabled` props.\n */\n isDisabled?: boolean\n}\n\nexport interface CalendarCellAria {\n /** Props for the grid cell element (e.g. `<td>`). */\n cellProps: DOMAttributes,\n /** Props for the button element within the cell. */\n buttonProps: DOMAttributes,\n /** Whether the cell is currently being pressed. */\n isPressed: boolean,\n /** Whether the cell is selected. */\n isSelected: boolean,\n /** Whether the cell is focused. */\n isFocused: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n */\n isDisabled: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n */\n isOutsideVisibleRange: boolean,\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean,\n /** The day number formatted according to the current locale. */\n formattedDate: string\n}\n\n/**\n * Provides the behavior and accessibility implementation for a calendar cell component.\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport function useCalendarCell(props: AriaCalendarCellProps, state: CalendarState | RangeCalendarState, ref: RefObject<HTMLElement | null>): CalendarCellAria {\n let {date, isDisabled} = props;\n let {errorMessageId, selectedDateDescription} = hookData.get(state);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let dateFormatter = useDateFormatter({\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n era: getEraFormat(date),\n timeZone: state.timeZone\n });\n let isSelected = state.isSelected(date);\n let isFocused = state.isCellFocused(date);\n isDisabled = isDisabled || state.isCellDisabled(date);\n let isUnavailable = state.isCellUnavailable(date);\n let isSelectable = !isDisabled && !isUnavailable;\n let isInvalid = state.isValueInvalid && (\n 'highlightedRange' in state\n ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0\n : state.value && isSameDay(state.value, date)\n );\n\n if (isInvalid) {\n isSelected = true;\n }\n\n // For performance, reuse the same date object as before if the new date prop is the same.\n // This allows subsequent useMemo results to be reused.\n date = useDeepMemo<CalendarDate>(date, isEqualDay);\n let nativeDate = useMemo(() => date.toDate(state.timeZone), [date, state.timeZone]);\n\n // aria-label should be localize Day of week, Month, Day and Year without Time.\n let isDateToday = isToday(date, state.timeZone);\n let label = useMemo(() => {\n let label = '';\n\n // If this is a range calendar, add a description of the full selected range\n // to the first and last selected date.\n if (\n 'highlightedRange' in state &&\n state.value &&\n !state.anchorDate &&\n (isSameDay(date, state.value.start) || isSameDay(date, state.value.end))\n ) {\n label = selectedDateDescription + ', ';\n }\n\n label += dateFormatter.format(nativeDate);\n if (isDateToday) {\n // If date is today, set appropriate string depending on selected state:\n label = stringFormatter.format(isSelected ? 'todayDateSelected' : 'todayDate', {\n date: label\n });\n } else if (isSelected) {\n // If date is selected but not today:\n label = stringFormatter.format('dateSelected', {\n date: label\n });\n }\n\n if (state.minValue && isSameDay(date, state.minValue)) {\n label += ', ' + stringFormatter.format('minimumDate');\n } else if (state.maxValue && isSameDay(date, state.maxValue)) {\n label += ', ' + stringFormatter.format('maximumDate');\n }\n\n return label;\n }, [dateFormatter, nativeDate, stringFormatter, isSelected, isDateToday, date, state, selectedDateDescription]);\n\n // When a cell is focused and this is a range calendar, add a prompt to help\n // screenreader users know that they are in a range selection mode.\n let rangeSelectionPrompt = '';\n if ('anchorDate' in state && isFocused && !state.isReadOnly && isSelectable) {\n // If selection has started add \"click to finish selecting range\"\n if (state.anchorDate) {\n rangeSelectionPrompt = stringFormatter.format('finishRangeSelectionPrompt');\n // Otherwise, add \"click to start selecting range\" prompt\n } else {\n rangeSelectionPrompt = stringFormatter.format('startRangeSelectionPrompt');\n }\n }\n\n let descriptionProps = useDescription(rangeSelectionPrompt);\n\n let isAnchorPressed = useRef(false);\n let isRangeBoundaryPressed = useRef(false);\n let touchDragTimerRef = useRef(null);\n let {pressProps, isPressed} = usePress({\n // When dragging to select a range, we don't want dragging over the original anchor\n // again to trigger onPressStart. Cancel presses immediately when the pointer exits.\n shouldCancelOnPointerExit: 'anchorDate' in state && !!state.anchorDate,\n preventFocusOnPress: true,\n isDisabled: !isSelectable || state.isReadOnly,\n onPressStart(e) {\n if (state.isReadOnly) {\n state.setFocusedDate(date);\n return;\n }\n\n if ('highlightedRange' in state && !state.anchorDate && (e.pointerType === 'mouse' || e.pointerType === 'touch')) {\n // Allow dragging the start or end date of a range to modify it\n // rather than starting a new selection.\n // Don't allow dragging when invalid, or weird jumping behavior may occur as date ranges\n // are constrained to available dates. The user will need to select a new range in this case.\n if (state.highlightedRange && !isInvalid) {\n if (isSameDay(date, state.highlightedRange.start)) {\n state.setAnchorDate(state.highlightedRange.end);\n state.setFocusedDate(date);\n state.setDragging(true);\n isRangeBoundaryPressed.current = true;\n return;\n } else if (isSameDay(date, state.highlightedRange.end)) {\n state.setAnchorDate(state.highlightedRange.start);\n state.setFocusedDate(date);\n state.setDragging(true);\n isRangeBoundaryPressed.current = true;\n return;\n }\n }\n\n let startDragging = () => {\n state.setDragging(true);\n touchDragTimerRef.current = null;\n\n state.selectDate(date);\n state.setFocusedDate(date);\n isAnchorPressed.current = true;\n };\n\n // Start selection on mouse/touch down so users can drag to select a range.\n // On touch, delay dragging to determine if the user really meant to scroll.\n if (e.pointerType === 'touch') {\n touchDragTimerRef.current = setTimeout(startDragging, 200);\n } else {\n startDragging();\n }\n }\n },\n onPressEnd() {\n isRangeBoundaryPressed.current = false;\n isAnchorPressed.current = false;\n clearTimeout(touchDragTimerRef.current);\n touchDragTimerRef.current = null;\n },\n onPress() {\n // For non-range selection, always select on press up.\n if (!('anchorDate' in state) && !state.isReadOnly) {\n state.selectDate(date);\n state.setFocusedDate(date);\n }\n },\n onPressUp(e) {\n if (state.isReadOnly) {\n return;\n }\n\n // If the user tapped quickly, the date won't be selected yet and the\n // timer will still be in progress. In this case, select the date on touch up.\n // Timer is cleared in onPressEnd.\n if ('anchorDate' in state && touchDragTimerRef.current) {\n state.selectDate(date);\n state.setFocusedDate(date);\n }\n\n if ('anchorDate' in state) {\n if (isRangeBoundaryPressed.current) {\n // When clicking on the start or end date of an already selected range,\n // start a new selection on press up to also allow dragging the date to\n // change the existing range.\n state.setAnchorDate(date);\n } else if (state.anchorDate && !isAnchorPressed.current) {\n // When releasing a drag or pressing the end date of a range, select it.\n state.selectDate(date);\n state.setFocusedDate(date);\n } else if (e.pointerType === 'keyboard' && !state.anchorDate) {\n // For range selection, auto-advance the focused date by one if using keyboard.\n // This gives an indication that you're selecting a range rather than a single date.\n // For mouse, this is unnecessary because users will see the indication on hover. For screen readers,\n // there will be an announcement to \"click to finish selecting range\" (above).\n state.selectDate(date);\n let nextDay = date.add({days: 1});\n if (state.isInvalid(nextDay)) {\n nextDay = date.subtract({days: 1});\n }\n if (!state.isInvalid(nextDay)) {\n state.setFocusedDate(nextDay);\n }\n } else if (e.pointerType === 'virtual') {\n // For screen readers, just select the date on click.\n state.selectDate(date);\n state.setFocusedDate(date);\n }\n }\n }\n });\n\n let tabIndex = null;\n if (!isDisabled) {\n tabIndex = isSameDay(date, state.focusedDate) ? 0 : -1;\n }\n\n // Focus the button in the DOM when the state updates.\n useEffect(() => {\n if (isFocused && ref.current) {\n focusWithoutScrolling(ref.current);\n\n // Scroll into view if navigating with a keyboard, otherwise\n // try not to shift the view under the user's mouse/finger.\n // If in a overlay, scrollIntoViewport will only cause scrolling\n // up to the overlay scroll body to prevent overlay shifting.\n // Also only scroll into view if the cell actually got focused.\n // There are some cases where the cell might be disabled or inside,\n // an inert container and we don't want to scroll then.\n if (getInteractionModality() !== 'pointer' && document.activeElement === ref.current) {\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n }\n }\n }, [isFocused, ref]);\n\n let cellDateFormatter = useDateFormatter({\n day: 'numeric',\n timeZone: state.timeZone,\n calendar: date.calendar.identifier\n });\n\n let formattedDate = useMemo(() => cellDateFormatter.formatToParts(nativeDate).find(part => part.type === 'day').value, [cellDateFormatter, nativeDate]);\n\n return {\n cellProps: {\n role: 'gridcell',\n 'aria-disabled': !isSelectable || null,\n 'aria-selected': isSelected || null,\n 'aria-invalid': isInvalid || null\n },\n buttonProps: mergeProps(pressProps, {\n onFocus() {\n if (!isDisabled) {\n state.setFocusedDate(date);\n }\n },\n tabIndex,\n role: 'button',\n 'aria-disabled': !isSelectable || null,\n 'aria-label': label,\n 'aria-invalid': isInvalid || null,\n 'aria-describedby': [\n isInvalid ? errorMessageId : null,\n descriptionProps['aria-describedby']\n ].filter(Boolean).join(' ') || undefined,\n onPointerEnter(e) {\n // Highlight the date on hover or drag over a date when selecting a range.\n if ('highlightDate' in state && (e.pointerType !== 'touch' || state.isDragging) && isSelectable) {\n state.highlightDate(date);\n }\n },\n onPointerDown(e) {\n // This is necessary on touch devices to allow dragging\n // outside the original pressed element.\n // (JSDOM does not support this)\n if ('releasePointerCapture' in e.target) {\n e.target.releasePointerCapture(e.pointerId);\n }\n },\n onContextMenu(e) {\n // Prevent context menu on long press.\n e.preventDefault();\n }\n }),\n isPressed,\n isFocused,\n isSelected,\n isDisabled,\n isUnavailable,\n isOutsideVisibleRange: date.compare(state.visibleRange.start) < 0 || date.compare(state.visibleRange.end) > 0,\n isInvalid,\n formattedDate\n };\n}\n"],"names":[],"version":3,"file":"useCalendarCell.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgEM,SAAS,0CAAgB,KAA4B,EAAE,KAAyC,EAAE,GAAkC;IACzI,IAAI,QAAC,IAAI,cAAE,UAAU,EAAC,GAAG;IACzB,IAAI,kBAAC,cAAc,2BAAE,uBAAuB,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC;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C;gBACxC,gCAAgC;gBAChC,IAAI,2BAA2B,EAAE,MAAM,EACrC,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,SAAS;YAE9C;YACA,eAAc,CAAC;gBACb,sCAAsC;gBACtC,EAAE,cAAc;YAClB;QACF;mBACA;mBACA;oBACA;oBACA;uBACA;QACA,uBAAuB,KAAK,OAAO,CAAC,MAAM,YAAY,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,CAAC,MAAM,YAAY,CAAC,GAAG,IAAI;mBAC5G;uBACA;IACF;AACF","sources":["packages/@react-aria/calendar/src/useCalendarCell.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, isEqualDay, isSameDay, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {focusWithoutScrolling, getScrollParent, mergeProps, scrollIntoViewport, useDeepMemo, useDescription} from '@react-aria/utils';\nimport {getEraFormat, hookData} from './utils';\nimport {getInteractionModality, usePress} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useDateFormatter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useEffect, useMemo, useRef} from 'react';\n\nexport interface AriaCalendarCellProps {\n /** The date that this cell represents. */\n date: CalendarDate,\n /**\n * Whether the cell is disabled. By default, this is determined by the\n * Calendar's `minValue`, `maxValue`, and `isDisabled` props.\n */\n isDisabled?: boolean\n}\n\nexport interface CalendarCellAria {\n /** Props for the grid cell element (e.g. `<td>`). */\n cellProps: DOMAttributes,\n /** Props for the button element within the cell. */\n buttonProps: DOMAttributes,\n /** Whether the cell is currently being pressed. */\n isPressed: boolean,\n /** Whether the cell is selected. */\n isSelected: boolean,\n /** Whether the cell is focused. */\n isFocused: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n */\n isDisabled: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n */\n isOutsideVisibleRange: boolean,\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean,\n /** The day number formatted according to the current locale. */\n formattedDate: string\n}\n\n/**\n * Provides the behavior and accessibility implementation for a calendar cell component.\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport function useCalendarCell(props: AriaCalendarCellProps, state: CalendarState | RangeCalendarState, ref: RefObject<HTMLElement | null>): CalendarCellAria {\n let {date, isDisabled} = props;\n let {errorMessageId, selectedDateDescription} = hookData.get(state)!;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let dateFormatter = useDateFormatter({\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n era: getEraFormat(date),\n timeZone: state.timeZone\n });\n let isSelected = state.isSelected(date);\n let isFocused = state.isCellFocused(date);\n isDisabled = isDisabled || state.isCellDisabled(date);\n let isUnavailable = state.isCellUnavailable(date);\n let isSelectable = !isDisabled && !isUnavailable;\n let isInvalid = state.isValueInvalid && Boolean(\n 'highlightedRange' in state\n ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0\n : state.value && isSameDay(state.value, date)\n );\n\n if (isInvalid) {\n isSelected = true;\n }\n\n // For performance, reuse the same date object as before if the new date prop is the same.\n // This allows subsequent useMemo results to be reused.\n date = useDeepMemo<CalendarDate>(date, isEqualDay);\n let nativeDate = useMemo(() => date.toDate(state.timeZone), [date, state.timeZone]);\n\n // aria-label should be localize Day of week, Month, Day and Year without Time.\n let isDateToday = isToday(date, state.timeZone);\n let label = useMemo(() => {\n let label = '';\n\n // If this is a range calendar, add a description of the full selected range\n // to the first and last selected date.\n if (\n 'highlightedRange' in state &&\n state.value &&\n !state.anchorDate &&\n (isSameDay(date, state.value.start) || isSameDay(date, state.value.end))\n ) {\n label = selectedDateDescription + ', ';\n }\n\n label += dateFormatter.format(nativeDate);\n if (isDateToday) {\n // If date is today, set appropriate string depending on selected state:\n label = stringFormatter.format(isSelected ? 'todayDateSelected' : 'todayDate', {\n date: label\n });\n } else if (isSelected) {\n // If date is selected but not today:\n label = stringFormatter.format('dateSelected', {\n date: label\n });\n }\n\n if (state.minValue && isSameDay(date, state.minValue)) {\n label += ', ' + stringFormatter.format('minimumDate');\n } else if (state.maxValue && isSameDay(date, state.maxValue)) {\n label += ', ' + stringFormatter.format('maximumDate');\n }\n\n return label;\n }, [dateFormatter, nativeDate, stringFormatter, isSelected, isDateToday, date, state, selectedDateDescription]);\n\n // When a cell is focused and this is a range calendar, add a prompt to help\n // screenreader users know that they are in a range selection mode.\n let rangeSelectionPrompt = '';\n if ('anchorDate' in state && isFocused && !state.isReadOnly && isSelectable) {\n // If selection has started add \"click to finish selecting range\"\n if (state.anchorDate) {\n rangeSelectionPrompt = stringFormatter.format('finishRangeSelectionPrompt');\n // Otherwise, add \"click to start selecting range\" prompt\n } else {\n rangeSelectionPrompt = stringFormatter.format('startRangeSelectionPrompt');\n }\n }\n\n let descriptionProps = useDescription(rangeSelectionPrompt);\n\n let isAnchorPressed = useRef(false);\n let isRangeBoundaryPressed = useRef(false);\n let touchDragTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n let {pressProps, isPressed} = usePress({\n // When dragging to select a range, we don't want dragging over the original anchor\n // again to trigger onPressStart. Cancel presses immediately when the pointer exits.\n shouldCancelOnPointerExit: 'anchorDate' in state && !!state.anchorDate,\n preventFocusOnPress: true,\n isDisabled: !isSelectable || state.isReadOnly,\n onPressStart(e) {\n if (state.isReadOnly) {\n state.setFocusedDate(date);\n return;\n }\n\n if ('highlightedRange' in state && !state.anchorDate && (e.pointerType === 'mouse' || e.pointerType === 'touch')) {\n // Allow dragging the start or end date of a range to modify it\n // rather than starting a new selection.\n // Don't allow dragging when invalid, or weird jumping behavior may occur as date ranges\n // are constrained to available dates. The user will need to select a new range in this case.\n if (state.highlightedRange && !isInvalid) {\n if (isSameDay(date, state.highlightedRange.start)) {\n state.setAnchorDate(state.highlightedRange.end);\n state.setFocusedDate(date);\n state.setDragging(true);\n isRangeBoundaryPressed.current = true;\n return;\n } else if (isSameDay(date, state.highlightedRange.end)) {\n state.setAnchorDate(state.highlightedRange.start);\n state.setFocusedDate(date);\n state.setDragging(true);\n isRangeBoundaryPressed.current = true;\n return;\n }\n }\n\n let startDragging = () => {\n state.setDragging(true);\n touchDragTimerRef.current = undefined;\n\n state.selectDate(date);\n state.setFocusedDate(date);\n isAnchorPressed.current = true;\n };\n\n // Start selection on mouse/touch down so users can drag to select a range.\n // On touch, delay dragging to determine if the user really meant to scroll.\n if (e.pointerType === 'touch') {\n touchDragTimerRef.current = setTimeout(startDragging, 200);\n } else {\n startDragging();\n }\n }\n },\n onPressEnd() {\n isRangeBoundaryPressed.current = false;\n isAnchorPressed.current = false;\n clearTimeout(touchDragTimerRef.current);\n touchDragTimerRef.current = undefined;\n },\n onPress() {\n // For non-range selection, always select on press up.\n if (!('anchorDate' in state) && !state.isReadOnly) {\n state.selectDate(date);\n state.setFocusedDate(date);\n }\n },\n onPressUp(e) {\n if (state.isReadOnly) {\n return;\n }\n\n // If the user tapped quickly, the date won't be selected yet and the\n // timer will still be in progress. In this case, select the date on touch up.\n // Timer is cleared in onPressEnd.\n if ('anchorDate' in state && touchDragTimerRef.current) {\n state.selectDate(date);\n state.setFocusedDate(date);\n }\n\n if ('anchorDate' in state) {\n if (isRangeBoundaryPressed.current) {\n // When clicking on the start or end date of an already selected range,\n // start a new selection on press up to also allow dragging the date to\n // change the existing range.\n state.setAnchorDate(date);\n } else if (state.anchorDate && !isAnchorPressed.current) {\n // When releasing a drag or pressing the end date of a range, select it.\n state.selectDate(date);\n state.setFocusedDate(date);\n } else if (e.pointerType === 'keyboard' && !state.anchorDate) {\n // For range selection, auto-advance the focused date by one if using keyboard.\n // This gives an indication that you're selecting a range rather than a single date.\n // For mouse, this is unnecessary because users will see the indication on hover. For screen readers,\n // there will be an announcement to \"click to finish selecting range\" (above).\n state.selectDate(date);\n let nextDay = date.add({days: 1});\n if (state.isInvalid(nextDay)) {\n nextDay = date.subtract({days: 1});\n }\n if (!state.isInvalid(nextDay)) {\n state.setFocusedDate(nextDay);\n }\n } else if (e.pointerType === 'virtual') {\n // For screen readers, just select the date on click.\n state.selectDate(date);\n state.setFocusedDate(date);\n }\n }\n }\n });\n\n let tabIndex: number | undefined = undefined;\n if (!isDisabled) {\n tabIndex = isSameDay(date, state.focusedDate) ? 0 : -1;\n }\n\n // Focus the button in the DOM when the state updates.\n useEffect(() => {\n if (isFocused && ref.current) {\n focusWithoutScrolling(ref.current);\n\n // Scroll into view if navigating with a keyboard, otherwise\n // try not to shift the view under the user's mouse/finger.\n // If in a overlay, scrollIntoViewport will only cause scrolling\n // up to the overlay scroll body to prevent overlay shifting.\n // Also only scroll into view if the cell actually got focused.\n // There are some cases where the cell might be disabled or inside,\n // an inert container and we don't want to scroll then.\n if (getInteractionModality() !== 'pointer' && document.activeElement === ref.current) {\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n }\n }\n }, [isFocused, ref]);\n\n let cellDateFormatter = useDateFormatter({\n day: 'numeric',\n timeZone: state.timeZone,\n calendar: date.calendar.identifier\n });\n\n let formattedDate = useMemo(() => cellDateFormatter.formatToParts(nativeDate).find(part => part.type === 'day')!.value, [cellDateFormatter, nativeDate]);\n\n return {\n cellProps: {\n role: 'gridcell',\n 'aria-disabled': !isSelectable || undefined,\n 'aria-selected': isSelected || undefined,\n 'aria-invalid': isInvalid || undefined\n },\n buttonProps: mergeProps(pressProps, {\n onFocus() {\n if (!isDisabled) {\n state.setFocusedDate(date);\n }\n },\n tabIndex,\n role: 'button',\n 'aria-disabled': !isSelectable || undefined,\n 'aria-label': label,\n 'aria-invalid': isInvalid || undefined,\n 'aria-describedby': [\n isInvalid ? errorMessageId : undefined,\n descriptionProps['aria-describedby']\n ].filter(Boolean).join(' ') || undefined,\n onPointerEnter(e) {\n // Highlight the date on hover or drag over a date when selecting a range.\n if ('highlightDate' in state && (e.pointerType !== 'touch' || state.isDragging) && isSelectable) {\n state.highlightDate(date);\n }\n },\n onPointerDown(e) {\n // This is necessary on touch devices to allow dragging\n // outside the original pressed element.\n // (JSDOM does not support this)\n if ('releasePointerCapture' in e.target) {\n e.target.releasePointerCapture(e.pointerId);\n }\n },\n onContextMenu(e) {\n // Prevent context menu on long press.\n e.preventDefault();\n }\n }),\n isPressed,\n isFocused,\n isSelected,\n isDisabled,\n isUnavailable,\n isOutsideVisibleRange: date.compare(state.visibleRange.start) < 0 || date.compare(state.visibleRange.end) > 0,\n isInvalid,\n formattedDate\n };\n}\n"],"names":[],"version":3,"file":"useCalendarCell.main.js.map"}
|
package/dist/useCalendarCell.mjs
CHANGED
|
@@ -44,7 +44,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
44
44
|
isDisabled = isDisabled || state.isCellDisabled(date);
|
|
45
45
|
let isUnavailable = state.isCellUnavailable(date);
|
|
46
46
|
let isSelectable = !isDisabled && !isUnavailable;
|
|
47
|
-
let isInvalid = state.isValueInvalid && ('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $dm6hl$isSameDay)(state.value, date));
|
|
47
|
+
let isInvalid = state.isValueInvalid && Boolean('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $dm6hl$isSameDay)(state.value, date));
|
|
48
48
|
if (isInvalid) isSelected = true;
|
|
49
49
|
// For performance, reuse the same date object as before if the new date prop is the same.
|
|
50
50
|
// This allows subsequent useMemo results to be reused.
|
|
@@ -93,7 +93,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
93
93
|
let descriptionProps = (0, $dm6hl$useDescription)(rangeSelectionPrompt);
|
|
94
94
|
let isAnchorPressed = (0, $dm6hl$useRef)(false);
|
|
95
95
|
let isRangeBoundaryPressed = (0, $dm6hl$useRef)(false);
|
|
96
|
-
let touchDragTimerRef = (0, $dm6hl$useRef)(
|
|
96
|
+
let touchDragTimerRef = (0, $dm6hl$useRef)(undefined);
|
|
97
97
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $dm6hl$usePress)({
|
|
98
98
|
// When dragging to select a range, we don't want dragging over the original anchor
|
|
99
99
|
// again to trigger onPressStart. Cancel presses immediately when the pointer exits.
|
|
@@ -127,7 +127,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
127
127
|
}
|
|
128
128
|
let startDragging = ()=>{
|
|
129
129
|
state.setDragging(true);
|
|
130
|
-
touchDragTimerRef.current =
|
|
130
|
+
touchDragTimerRef.current = undefined;
|
|
131
131
|
state.selectDate(date);
|
|
132
132
|
state.setFocusedDate(date);
|
|
133
133
|
isAnchorPressed.current = true;
|
|
@@ -142,7 +142,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
142
142
|
isRangeBoundaryPressed.current = false;
|
|
143
143
|
isAnchorPressed.current = false;
|
|
144
144
|
clearTimeout(touchDragTimerRef.current);
|
|
145
|
-
touchDragTimerRef.current =
|
|
145
|
+
touchDragTimerRef.current = undefined;
|
|
146
146
|
},
|
|
147
147
|
onPress () {
|
|
148
148
|
// For non-range selection, always select on press up.
|
|
@@ -190,7 +190,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
let tabIndex =
|
|
193
|
+
let tabIndex = undefined;
|
|
194
194
|
if (!isDisabled) tabIndex = (0, $dm6hl$isSameDay)(date, state.focusedDate) ? 0 : -1;
|
|
195
195
|
// Focus the button in the DOM when the state updates.
|
|
196
196
|
(0, $dm6hl$useEffect)(()=>{
|
|
@@ -223,9 +223,9 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
223
223
|
return {
|
|
224
224
|
cellProps: {
|
|
225
225
|
role: 'gridcell',
|
|
226
|
-
'aria-disabled': !isSelectable ||
|
|
227
|
-
'aria-selected': isSelected ||
|
|
228
|
-
'aria-invalid': isInvalid ||
|
|
226
|
+
'aria-disabled': !isSelectable || undefined,
|
|
227
|
+
'aria-selected': isSelected || undefined,
|
|
228
|
+
'aria-invalid': isInvalid || undefined
|
|
229
229
|
},
|
|
230
230
|
buttonProps: (0, $dm6hl$mergeProps)(pressProps, {
|
|
231
231
|
onFocus () {
|
|
@@ -233,11 +233,11 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
233
233
|
},
|
|
234
234
|
tabIndex: tabIndex,
|
|
235
235
|
role: 'button',
|
|
236
|
-
'aria-disabled': !isSelectable ||
|
|
236
|
+
'aria-disabled': !isSelectable || undefined,
|
|
237
237
|
'aria-label': label,
|
|
238
|
-
'aria-invalid': isInvalid ||
|
|
238
|
+
'aria-invalid': isInvalid || undefined,
|
|
239
239
|
'aria-describedby': [
|
|
240
|
-
isInvalid ? errorMessageId :
|
|
240
|
+
isInvalid ? errorMessageId : undefined,
|
|
241
241
|
descriptionProps['aria-describedby']
|
|
242
242
|
].filter(Boolean).join(' ') || undefined,
|
|
243
243
|
onPointerEnter (e) {
|
|
@@ -44,7 +44,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
44
44
|
isDisabled = isDisabled || state.isCellDisabled(date);
|
|
45
45
|
let isUnavailable = state.isCellUnavailable(date);
|
|
46
46
|
let isSelectable = !isDisabled && !isUnavailable;
|
|
47
|
-
let isInvalid = state.isValueInvalid && ('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $dm6hl$isSameDay)(state.value, date));
|
|
47
|
+
let isInvalid = state.isValueInvalid && Boolean('highlightedRange' in state ? !state.anchorDate && state.highlightedRange && date.compare(state.highlightedRange.start) >= 0 && date.compare(state.highlightedRange.end) <= 0 : state.value && (0, $dm6hl$isSameDay)(state.value, date));
|
|
48
48
|
if (isInvalid) isSelected = true;
|
|
49
49
|
// For performance, reuse the same date object as before if the new date prop is the same.
|
|
50
50
|
// This allows subsequent useMemo results to be reused.
|
|
@@ -93,7 +93,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
93
93
|
let descriptionProps = (0, $dm6hl$useDescription)(rangeSelectionPrompt);
|
|
94
94
|
let isAnchorPressed = (0, $dm6hl$useRef)(false);
|
|
95
95
|
let isRangeBoundaryPressed = (0, $dm6hl$useRef)(false);
|
|
96
|
-
let touchDragTimerRef = (0, $dm6hl$useRef)(
|
|
96
|
+
let touchDragTimerRef = (0, $dm6hl$useRef)(undefined);
|
|
97
97
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $dm6hl$usePress)({
|
|
98
98
|
// When dragging to select a range, we don't want dragging over the original anchor
|
|
99
99
|
// again to trigger onPressStart. Cancel presses immediately when the pointer exits.
|
|
@@ -127,7 +127,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
127
127
|
}
|
|
128
128
|
let startDragging = ()=>{
|
|
129
129
|
state.setDragging(true);
|
|
130
|
-
touchDragTimerRef.current =
|
|
130
|
+
touchDragTimerRef.current = undefined;
|
|
131
131
|
state.selectDate(date);
|
|
132
132
|
state.setFocusedDate(date);
|
|
133
133
|
isAnchorPressed.current = true;
|
|
@@ -142,7 +142,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
142
142
|
isRangeBoundaryPressed.current = false;
|
|
143
143
|
isAnchorPressed.current = false;
|
|
144
144
|
clearTimeout(touchDragTimerRef.current);
|
|
145
|
-
touchDragTimerRef.current =
|
|
145
|
+
touchDragTimerRef.current = undefined;
|
|
146
146
|
},
|
|
147
147
|
onPress () {
|
|
148
148
|
// For non-range selection, always select on press up.
|
|
@@ -190,7 +190,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
let tabIndex =
|
|
193
|
+
let tabIndex = undefined;
|
|
194
194
|
if (!isDisabled) tabIndex = (0, $dm6hl$isSameDay)(date, state.focusedDate) ? 0 : -1;
|
|
195
195
|
// Focus the button in the DOM when the state updates.
|
|
196
196
|
(0, $dm6hl$useEffect)(()=>{
|
|
@@ -223,9 +223,9 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
223
223
|
return {
|
|
224
224
|
cellProps: {
|
|
225
225
|
role: 'gridcell',
|
|
226
|
-
'aria-disabled': !isSelectable ||
|
|
227
|
-
'aria-selected': isSelected ||
|
|
228
|
-
'aria-invalid': isInvalid ||
|
|
226
|
+
'aria-disabled': !isSelectable || undefined,
|
|
227
|
+
'aria-selected': isSelected || undefined,
|
|
228
|
+
'aria-invalid': isInvalid || undefined
|
|
229
229
|
},
|
|
230
230
|
buttonProps: (0, $dm6hl$mergeProps)(pressProps, {
|
|
231
231
|
onFocus () {
|
|
@@ -233,11 +233,11 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
|
|
|
233
233
|
},
|
|
234
234
|
tabIndex: tabIndex,
|
|
235
235
|
role: 'button',
|
|
236
|
-
'aria-disabled': !isSelectable ||
|
|
236
|
+
'aria-disabled': !isSelectable || undefined,
|
|
237
237
|
'aria-label': label,
|
|
238
|
-
'aria-invalid': isInvalid ||
|
|
238
|
+
'aria-invalid': isInvalid || undefined,
|
|
239
239
|
'aria-describedby': [
|
|
240
|
-
isInvalid ? errorMessageId :
|
|
240
|
+
isInvalid ? errorMessageId : undefined,
|
|
241
241
|
descriptionProps['aria-describedby']
|
|
242
242
|
].filter(Boolean).join(' ') || undefined,
|
|
243
243
|
onPointerEnter (e) {
|