@react-aria/calendar 3.5.5 → 3.5.7
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 +17 -0
- package/dist/ar-AE.main.js.map +1 -0
- package/dist/ar-AE.mjs +19 -0
- package/dist/ar-AE.module.js +19 -0
- package/dist/ar-AE.module.js.map +1 -0
- package/dist/bg-BG.main.js +17 -0
- package/dist/bg-BG.main.js.map +1 -0
- package/dist/bg-BG.mjs +19 -0
- package/dist/bg-BG.module.js +19 -0
- package/dist/bg-BG.module.js.map +1 -0
- package/dist/cs-CZ.main.js +17 -0
- package/dist/cs-CZ.main.js.map +1 -0
- package/dist/cs-CZ.mjs +19 -0
- package/dist/cs-CZ.module.js +19 -0
- package/dist/cs-CZ.module.js.map +1 -0
- package/dist/da-DK.main.js +17 -0
- package/dist/da-DK.main.js.map +1 -0
- package/dist/da-DK.mjs +19 -0
- package/dist/da-DK.module.js +19 -0
- package/dist/da-DK.module.js.map +1 -0
- package/dist/de-DE.main.js +17 -0
- package/dist/de-DE.main.js.map +1 -0
- package/dist/de-DE.mjs +19 -0
- package/dist/de-DE.module.js +19 -0
- package/dist/de-DE.module.js.map +1 -0
- package/dist/el-GR.main.js +17 -0
- package/dist/el-GR.main.js.map +1 -0
- package/dist/el-GR.mjs +19 -0
- package/dist/el-GR.module.js +19 -0
- package/dist/el-GR.module.js.map +1 -0
- package/dist/en-US.main.js +17 -0
- package/dist/en-US.main.js.map +1 -0
- package/dist/en-US.mjs +19 -0
- package/dist/en-US.module.js +19 -0
- package/dist/en-US.module.js.map +1 -0
- package/dist/es-ES.main.js +17 -0
- package/dist/es-ES.main.js.map +1 -0
- package/dist/es-ES.mjs +19 -0
- package/dist/es-ES.module.js +19 -0
- package/dist/es-ES.module.js.map +1 -0
- package/dist/et-EE.main.js +17 -0
- package/dist/et-EE.main.js.map +1 -0
- package/dist/et-EE.mjs +19 -0
- package/dist/et-EE.module.js +19 -0
- package/dist/et-EE.module.js.map +1 -0
- package/dist/fi-FI.main.js +17 -0
- package/dist/fi-FI.main.js.map +1 -0
- package/dist/fi-FI.mjs +19 -0
- package/dist/fi-FI.module.js +19 -0
- package/dist/fi-FI.module.js.map +1 -0
- package/dist/fr-FR.main.js +17 -0
- package/dist/fr-FR.main.js.map +1 -0
- package/dist/fr-FR.mjs +19 -0
- package/dist/fr-FR.module.js +19 -0
- package/dist/fr-FR.module.js.map +1 -0
- package/dist/he-IL.main.js +17 -0
- package/dist/he-IL.main.js.map +1 -0
- package/dist/he-IL.mjs +19 -0
- package/dist/he-IL.module.js +19 -0
- package/dist/he-IL.module.js.map +1 -0
- package/dist/hr-HR.main.js +17 -0
- package/dist/hr-HR.main.js.map +1 -0
- package/dist/hr-HR.mjs +19 -0
- package/dist/hr-HR.module.js +19 -0
- package/dist/hr-HR.module.js.map +1 -0
- package/dist/hu-HU.main.js +17 -0
- package/dist/hu-HU.main.js.map +1 -0
- package/dist/hu-HU.mjs +19 -0
- package/dist/hu-HU.module.js +19 -0
- package/dist/hu-HU.module.js.map +1 -0
- package/dist/import.mjs +4 -1288
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.main.js +17 -0
- package/dist/it-IT.main.js.map +1 -0
- package/dist/it-IT.mjs +19 -0
- package/dist/it-IT.module.js +19 -0
- package/dist/it-IT.module.js.map +1 -0
- package/dist/ja-JP.main.js +17 -0
- package/dist/ja-JP.main.js.map +1 -0
- package/dist/ja-JP.mjs +19 -0
- package/dist/ja-JP.module.js +19 -0
- package/dist/ja-JP.module.js.map +1 -0
- package/dist/ko-KR.main.js +17 -0
- package/dist/ko-KR.main.js.map +1 -0
- package/dist/ko-KR.mjs +19 -0
- package/dist/ko-KR.module.js +19 -0
- package/dist/ko-KR.module.js.map +1 -0
- package/dist/lt-LT.main.js +17 -0
- package/dist/lt-LT.main.js.map +1 -0
- package/dist/lt-LT.mjs +19 -0
- package/dist/lt-LT.module.js +19 -0
- package/dist/lt-LT.module.js.map +1 -0
- package/dist/lv-LV.main.js +17 -0
- package/dist/lv-LV.main.js.map +1 -0
- package/dist/lv-LV.mjs +19 -0
- package/dist/lv-LV.module.js +19 -0
- package/dist/lv-LV.module.js.map +1 -0
- package/dist/main.js +8 -1292
- package/dist/main.js.map +1 -1
- package/dist/module.js +4 -1288
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.main.js +17 -0
- package/dist/nb-NO.main.js.map +1 -0
- package/dist/nb-NO.mjs +19 -0
- package/dist/nb-NO.module.js +19 -0
- package/dist/nb-NO.module.js.map +1 -0
- package/dist/nl-NL.main.js +17 -0
- package/dist/nl-NL.main.js.map +1 -0
- package/dist/nl-NL.mjs +19 -0
- package/dist/nl-NL.module.js +19 -0
- package/dist/nl-NL.module.js.map +1 -0
- package/dist/pl-PL.main.js +17 -0
- package/dist/pl-PL.main.js.map +1 -0
- package/dist/pl-PL.mjs +19 -0
- package/dist/pl-PL.module.js +19 -0
- package/dist/pl-PL.module.js.map +1 -0
- package/dist/pt-BR.main.js +17 -0
- package/dist/pt-BR.main.js.map +1 -0
- package/dist/pt-BR.mjs +19 -0
- package/dist/pt-BR.module.js +19 -0
- package/dist/pt-BR.module.js.map +1 -0
- package/dist/pt-PT.main.js +17 -0
- package/dist/pt-PT.main.js.map +1 -0
- package/dist/pt-PT.mjs +19 -0
- package/dist/pt-PT.module.js +19 -0
- package/dist/pt-PT.module.js.map +1 -0
- package/dist/ro-RO.main.js +17 -0
- package/dist/ro-RO.main.js.map +1 -0
- package/dist/ro-RO.mjs +19 -0
- package/dist/ro-RO.module.js +19 -0
- package/dist/ro-RO.module.js.map +1 -0
- package/dist/ru-RU.main.js +17 -0
- package/dist/ru-RU.main.js.map +1 -0
- package/dist/ru-RU.mjs +19 -0
- package/dist/ru-RU.module.js +19 -0
- package/dist/ru-RU.module.js.map +1 -0
- package/dist/sk-SK.main.js +17 -0
- package/dist/sk-SK.main.js.map +1 -0
- package/dist/sk-SK.mjs +19 -0
- package/dist/sk-SK.module.js +19 -0
- package/dist/sk-SK.module.js.map +1 -0
- package/dist/sl-SI.main.js +17 -0
- package/dist/sl-SI.main.js.map +1 -0
- package/dist/sl-SI.mjs +19 -0
- package/dist/sl-SI.module.js +19 -0
- package/dist/sl-SI.module.js.map +1 -0
- package/dist/sr-SP.main.js +17 -0
- package/dist/sr-SP.main.js.map +1 -0
- package/dist/sr-SP.mjs +19 -0
- package/dist/sr-SP.module.js +19 -0
- package/dist/sr-SP.module.js.map +1 -0
- package/dist/sv-SE.main.js +17 -0
- package/dist/sv-SE.main.js.map +1 -0
- package/dist/sv-SE.mjs +19 -0
- package/dist/sv-SE.module.js +19 -0
- package/dist/sv-SE.module.js.map +1 -0
- package/dist/tr-TR.main.js +17 -0
- package/dist/tr-TR.main.js.map +1 -0
- package/dist/tr-TR.mjs +19 -0
- package/dist/tr-TR.module.js +19 -0
- package/dist/tr-TR.module.js.map +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.main.js +17 -0
- package/dist/uk-UA.main.js.map +1 -0
- package/dist/uk-UA.mjs +19 -0
- package/dist/uk-UA.module.js +19 -0
- package/dist/uk-UA.module.js.map +1 -0
- package/dist/useCalendar.main.js +25 -0
- package/dist/useCalendar.main.js.map +1 -0
- package/dist/useCalendar.mjs +20 -0
- package/dist/useCalendar.module.js +20 -0
- package/dist/useCalendar.module.js.map +1 -0
- package/dist/useCalendarBase.main.js +112 -0
- package/dist/useCalendarBase.main.js.map +1 -0
- package/dist/useCalendarBase.mjs +107 -0
- package/dist/useCalendarBase.module.js +107 -0
- package/dist/useCalendarBase.module.js.map +1 -0
- package/dist/useCalendarCell.main.js +276 -0
- package/dist/useCalendarCell.main.js.map +1 -0
- package/dist/useCalendarCell.mjs +271 -0
- package/dist/useCalendarCell.module.js +271 -0
- package/dist/useCalendarCell.module.js.map +1 -0
- package/dist/useCalendarGrid.main.js +139 -0
- package/dist/useCalendarGrid.main.js.map +1 -0
- package/dist/useCalendarGrid.mjs +134 -0
- package/dist/useCalendarGrid.module.js +134 -0
- package/dist/useCalendarGrid.module.js.map +1 -0
- package/dist/useRangeCalendar.main.js +66 -0
- package/dist/useRangeCalendar.main.js.map +1 -0
- package/dist/useRangeCalendar.mjs +61 -0
- package/dist/useRangeCalendar.module.js +61 -0
- package/dist/useRangeCalendar.module.js.map +1 -0
- package/dist/utils.main.js +138 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +130 -0
- package/dist/utils.module.js +130 -0
- package/dist/utils.module.js.map +1 -0
- package/dist/zh-CN.main.js +17 -0
- package/dist/zh-CN.main.js.map +1 -0
- package/dist/zh-CN.mjs +19 -0
- package/dist/zh-CN.module.js +19 -0
- package/dist/zh-CN.module.js.map +1 -0
- package/dist/zh-TW.main.js +17 -0
- package/dist/zh-TW.main.js.map +1 -0
- package/dist/zh-TW.mjs +19 -0
- package/dist/zh-TW.module.js +19 -0
- package/dist/zh-TW.module.js.map +1 -0
- package/package.json +11 -11
- package/src/useRangeCalendar.ts +6 -5
package/dist/uk-UA.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var $82649816f530bb1b$exports = {};
|
|
2
|
+
$82649816f530bb1b$exports = {
|
|
3
|
+
"dateRange": (args)=>`${args.startDate} \u{2014} ${args.endDate}`,
|
|
4
|
+
"dateSelected": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${args.date}`,
|
|
5
|
+
"finishRangeSelectionPrompt": `\u{41D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{456}\u{442}\u{44C}, \u{449}\u{43E}\u{431} \u{437}\u{430}\u{432}\u{435}\u{440}\u{448}\u{438}\u{442}\u{438} \u{432}\u{438}\u{431}\u{456}\u{440} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}\u{443} \u{434}\u{430}\u{442}`,
|
|
6
|
+
"maximumDate": `\u{41E}\u{441}\u{442}\u{430}\u{43D}\u{43D}\u{44F} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}`,
|
|
7
|
+
"minimumDate": `\u{41F}\u{435}\u{440}\u{448}\u{430} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}`,
|
|
8
|
+
"next": `\u{41D}\u{430}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{438}\u{439}`,
|
|
9
|
+
"previous": `\u{41F}\u{43E}\u{43F}\u{435}\u{440}\u{435}\u{434}\u{43D}\u{456}\u{439}`,
|
|
10
|
+
"selectedDateDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${args.date}`,
|
|
11
|
+
"selectedRangeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${args.dateRange}`,
|
|
12
|
+
"startRangeSelectionPrompt": `\u{41D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{456}\u{442}\u{44C}, \u{449}\u{43E}\u{431} \u{43F}\u{43E}\u{447}\u{430}\u{442}\u{438} \u{432}\u{438}\u{431}\u{456}\u{440} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}\u{443} \u{434}\u{430}\u{442}`,
|
|
13
|
+
"todayDate": (args)=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${args.date}`,
|
|
14
|
+
"todayDateSelected": (args)=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${args.date}`
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export {$82649816f530bb1b$exports as default};
|
|
19
|
+
//# sourceMappingURL=uk-UA.mjs.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var $82649816f530bb1b$exports = {};
|
|
2
|
+
$82649816f530bb1b$exports = {
|
|
3
|
+
"dateRange": (args)=>`${args.startDate} \u{2014} ${args.endDate}`,
|
|
4
|
+
"dateSelected": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${args.date}`,
|
|
5
|
+
"finishRangeSelectionPrompt": `\u{41D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{456}\u{442}\u{44C}, \u{449}\u{43E}\u{431} \u{437}\u{430}\u{432}\u{435}\u{440}\u{448}\u{438}\u{442}\u{438} \u{432}\u{438}\u{431}\u{456}\u{440} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}\u{443} \u{434}\u{430}\u{442}`,
|
|
6
|
+
"maximumDate": `\u{41E}\u{441}\u{442}\u{430}\u{43D}\u{43D}\u{44F} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}`,
|
|
7
|
+
"minimumDate": `\u{41F}\u{435}\u{440}\u{448}\u{430} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}`,
|
|
8
|
+
"next": `\u{41D}\u{430}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{438}\u{439}`,
|
|
9
|
+
"previous": `\u{41F}\u{43E}\u{43F}\u{435}\u{440}\u{435}\u{434}\u{43D}\u{456}\u{439}`,
|
|
10
|
+
"selectedDateDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${args.date}`,
|
|
11
|
+
"selectedRangeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${args.dateRange}`,
|
|
12
|
+
"startRangeSelectionPrompt": `\u{41D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{456}\u{442}\u{44C}, \u{449}\u{43E}\u{431} \u{43F}\u{43E}\u{447}\u{430}\u{442}\u{438} \u{432}\u{438}\u{431}\u{456}\u{440} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}\u{443} \u{434}\u{430}\u{442}`,
|
|
13
|
+
"todayDate": (args)=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${args.date}`,
|
|
14
|
+
"todayDateSelected": (args)=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${args.date}`
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export {$82649816f530bb1b$exports as default};
|
|
19
|
+
//# sourceMappingURL=uk-UA.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,CAAC,EAAE,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,CAAC,CAAC;IAC9E,gBAAgB,CAAC,OAAS,CAAC,kDAAQ,EAAE,KAAK,IAAI,CAAC,CAAC;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,CAAC,CAAC;IACjE,4BAA4B,CAAC,OAAS,CAAC,mHAAmB,EAAE,KAAK,SAAS,CAAC,CAAC;IAC5E,6BAA6B,CAAC,2PAAyC,CAAC;IACxE,aAAa,CAAC,OAAS,CAAC,0DAAU,EAAE,KAAK,IAAI,CAAC,CAAC;IAC/C,qBAAqB,CAAC,OAAS,CAAC,4GAAkB,EAAE,KAAK,IAAI,CAAC,CAAC;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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var $02ef492a56b91cb2$exports = require("./useCalendarBase.main.js");
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function $parcel$export(e, n, v, s) {
|
|
5
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
$parcel$export(module.exports, "useCalendar", () => $20e845123e697a89$export$3ee915f8151bd4f1);
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
function $20e845123e697a89$export$3ee915f8151bd4f1(props, state) {
|
|
21
|
+
return (0, $02ef492a56b91cb2$exports.useCalendarBase)(props, state);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=useCalendar.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiC,KAA2B,EAAE,KAAoB;IAChG,OAAO,CAAA,GAAA,yCAAc,EAAE,OAAO;AAChC","sources":["packages/@react-aria/calendar/src/useCalendar.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 {AriaCalendarProps, DateValue} from '@react-types/calendar';\nimport {CalendarAria, useCalendarBase} from './useCalendarBase';\nimport {CalendarState} from '@react-stately/calendar';\n\n/**\n * Provides the behavior and accessibility implementation for a calendar component.\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport function useCalendar<T extends DateValue>(props: AriaCalendarProps<T>, state: CalendarState): CalendarAria {\n return useCalendarBase(props, state);\n}\n"],"names":[],"version":3,"file":"useCalendar.main.js.map"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {useCalendarBase as $c4acc1de3ab169cf$export$d652b3ea2d672d5b} from "./useCalendarBase.mjs";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
function $9942cad8a072a530$export$3ee915f8151bd4f1(props, state) {
|
|
15
|
+
return (0, $c4acc1de3ab169cf$export$d652b3ea2d672d5b)(props, state);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export {$9942cad8a072a530$export$3ee915f8151bd4f1 as useCalendar};
|
|
20
|
+
//# sourceMappingURL=useCalendar.mjs.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {useCalendarBase as $c4acc1de3ab169cf$export$d652b3ea2d672d5b} from "./useCalendarBase.module.js";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
function $9942cad8a072a530$export$3ee915f8151bd4f1(props, state) {
|
|
15
|
+
return (0, $c4acc1de3ab169cf$export$d652b3ea2d672d5b)(props, state);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export {$9942cad8a072a530$export$3ee915f8151bd4f1 as useCalendar};
|
|
20
|
+
//# sourceMappingURL=useCalendar.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiC,KAA2B,EAAE,KAAoB;IAChG,OAAO,CAAA,GAAA,yCAAc,EAAE,OAAO;AAChC","sources":["packages/@react-aria/calendar/src/useCalendar.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 {AriaCalendarProps, DateValue} from '@react-types/calendar';\nimport {CalendarAria, useCalendarBase} from './useCalendarBase';\nimport {CalendarState} from '@react-stately/calendar';\n\n/**\n * Provides the behavior and accessibility implementation for a calendar component.\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport function useCalendar<T extends DateValue>(props: AriaCalendarProps<T>, state: CalendarState): CalendarAria {\n return useCalendarBase(props, state);\n}\n"],"names":[],"version":3,"file":"useCalendar.module.js.map"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var $df1d8e967e73ec8e$exports = require("./utils.main.js");
|
|
2
|
+
var $bd6dc95a3c5ee5cd$exports = require("./intlStrings.main.js");
|
|
3
|
+
var $dPWPO$reactarialiveannouncer = require("@react-aria/live-announcer");
|
|
4
|
+
var $dPWPO$reactariautils = require("@react-aria/utils");
|
|
5
|
+
var $dPWPO$reactariai18n = require("@react-aria/i18n");
|
|
6
|
+
var $dPWPO$react = require("react");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function $parcel$export(e, n, v, s) {
|
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$parcel$export(module.exports, "useCalendarBase", () => $02ef492a56b91cb2$export$d652b3ea2d672d5b);
|
|
18
|
+
/*
|
|
19
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
20
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
22
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
25
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
26
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
27
|
+
* governing permissions and limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $02ef492a56b91cb2$export$d652b3ea2d672d5b(props, state) {
|
|
35
|
+
let stringFormatter = (0, $dPWPO$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($bd6dc95a3c5ee5cd$exports))), "@react-aria/calendar");
|
|
36
|
+
let domProps = (0, $dPWPO$reactariautils.filterDOMProps)(props);
|
|
37
|
+
let title = (0, $df1d8e967e73ec8e$exports.useVisibleRangeDescription)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
|
|
38
|
+
let visibleRangeDescription = (0, $df1d8e967e73ec8e$exports.useVisibleRangeDescription)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
|
|
39
|
+
// Announce when the visible date range changes
|
|
40
|
+
(0, $dPWPO$reactariautils.useUpdateEffect)(()=>{
|
|
41
|
+
// only when pressing the Previous or Next button
|
|
42
|
+
if (!state.isFocused) (0, $dPWPO$reactarialiveannouncer.announce)(visibleRangeDescription);
|
|
43
|
+
}, [
|
|
44
|
+
visibleRangeDescription
|
|
45
|
+
]);
|
|
46
|
+
// Announce when the selected value changes
|
|
47
|
+
let selectedDateDescription = (0, $df1d8e967e73ec8e$exports.useSelectedDateDescription)(state);
|
|
48
|
+
(0, $dPWPO$reactariautils.useUpdateEffect)(()=>{
|
|
49
|
+
if (selectedDateDescription) (0, $dPWPO$reactarialiveannouncer.announce)(selectedDateDescription, "polite", 4000);
|
|
50
|
+
// handle an update to the caption that describes the currently selected range, to announce the new value
|
|
51
|
+
}, [
|
|
52
|
+
selectedDateDescription
|
|
53
|
+
]);
|
|
54
|
+
let errorMessageId = (0, $dPWPO$reactariautils.useSlotId)([
|
|
55
|
+
Boolean(props.errorMessage),
|
|
56
|
+
props.isInvalid,
|
|
57
|
+
props.validationState
|
|
58
|
+
]);
|
|
59
|
+
// Pass the label to the child grid elements.
|
|
60
|
+
(0, $df1d8e967e73ec8e$exports.hookData).set(state, {
|
|
61
|
+
ariaLabel: props["aria-label"],
|
|
62
|
+
ariaLabelledBy: props["aria-labelledby"],
|
|
63
|
+
errorMessageId: errorMessageId,
|
|
64
|
+
selectedDateDescription: selectedDateDescription
|
|
65
|
+
});
|
|
66
|
+
// If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
|
|
67
|
+
let [nextFocused, setNextFocused] = (0, $dPWPO$react.useState)(false);
|
|
68
|
+
let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
|
|
69
|
+
if (nextDisabled && nextFocused) {
|
|
70
|
+
setNextFocused(false);
|
|
71
|
+
state.setFocused(true);
|
|
72
|
+
}
|
|
73
|
+
let [previousFocused, setPreviousFocused] = (0, $dPWPO$react.useState)(false);
|
|
74
|
+
let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
|
|
75
|
+
if (previousDisabled && previousFocused) {
|
|
76
|
+
setPreviousFocused(false);
|
|
77
|
+
state.setFocused(true);
|
|
78
|
+
}
|
|
79
|
+
let labelProps = (0, $dPWPO$reactariautils.useLabels)({
|
|
80
|
+
id: props["id"],
|
|
81
|
+
"aria-label": [
|
|
82
|
+
props["aria-label"],
|
|
83
|
+
visibleRangeDescription
|
|
84
|
+
].filter(Boolean).join(", "),
|
|
85
|
+
"aria-labelledby": props["aria-labelledby"]
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
calendarProps: (0, $dPWPO$reactariautils.mergeProps)(domProps, labelProps, {
|
|
89
|
+
role: "application",
|
|
90
|
+
"aria-describedby": props["aria-describedby"] || undefined
|
|
91
|
+
}),
|
|
92
|
+
nextButtonProps: {
|
|
93
|
+
onPress: ()=>state.focusNextPage(),
|
|
94
|
+
"aria-label": stringFormatter.format("next"),
|
|
95
|
+
isDisabled: nextDisabled,
|
|
96
|
+
onFocusChange: setNextFocused
|
|
97
|
+
},
|
|
98
|
+
prevButtonProps: {
|
|
99
|
+
onPress: ()=>state.focusPreviousPage(),
|
|
100
|
+
"aria-label": stringFormatter.format("previous"),
|
|
101
|
+
isDisabled: previousDisabled,
|
|
102
|
+
onFocusChange: setPreviousFocused
|
|
103
|
+
},
|
|
104
|
+
errorMessageProps: {
|
|
105
|
+
id: errorMessageId
|
|
106
|
+
},
|
|
107
|
+
title: title
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=useCalendarBase.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA2BM,SAAS,0CAAgB,KAAuD,EAAE,KAAyC;IAChI,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,IAAI,QAAQ,CAAA,GAAA,oDAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IACzG,IAAI,0BAA0B,CAAA,GAAA,oDAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IAE3H,+CAA+C;IAC/C,CAAA,GAAA,qCAAc,EAAE;QACd,iDAAiD;QACjD,IAAI,CAAC,MAAM,SAAS,EAClB,CAAA,GAAA,sCAAO,EAAE;IAEb,GAAG;QAAC;KAAwB;IAE5B,2CAA2C;IAC3C,IAAI,0BAA0B,CAAA,GAAA,oDAAyB,EAAE;IACzD,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,yBACF,CAAA,GAAA,sCAAO,EAAE,yBAAyB,UAAU;IAE9C,yGAAyG;IAC3G,GAAG;QAAC;KAAwB;IAE5B,IAAI,iBAAiB,CAAA,GAAA,+BAAQ,EAAE;QAAC,QAAQ,MAAM,YAAY;QAAG,MAAM,SAAS;QAAE,MAAM,eAAe;KAAC;IAEpG,6CAA6C;IAC7C,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC,OAAO;QAClB,WAAW,KAAK,CAAC,aAAa;QAC9B,gBAAgB,KAAK,CAAC,kBAAkB;wBACxC;iCACA;IACF;IAEA,2GAA2G;IAC3G,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC7C,IAAI,eAAe,MAAM,UAAU,IAAI,MAAM,yBAAyB;IACtE,IAAI,gBAAgB,aAAa;QAC/B,eAAe;QACf,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,CAAC,iBAAiB,mBAAmB,GAAG,CAAA,GAAA,qBAAO,EAAE;IACrD,IAAI,mBAAmB,MAAM,UAAU,IAAI,MAAM,6BAA6B;IAC9E,IAAI,oBAAoB,iBAAiB;QACvC,mBAAmB;QACnB,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,aAAa,CAAA,GAAA,+BAAQ,EAAE;QACzB,IAAI,KAAK,CAAC,KAAK;QACf,cAAc;YAAC,KAAK,CAAC,aAAa;YAAE;SAAwB,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QAClF,mBAAmB,KAAK,CAAC,kBAAkB;IAC7C;IAEA,OAAO;QACL,eAAe,CAAA,GAAA,gCAAS,EAAE,UAAU,YAAY;YAC9C,MAAM;YACN,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;QACnD;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,aAAa;YAClC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,iBAAiB;YACtC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,mBAAmB;YACjB,IAAI;QACN;eACA;IACF;AACF","sources":["packages/@react-aria/calendar/src/useCalendarBase.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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, DOMProps} from '@react-types/shared';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {filterDOMProps, mergeProps, useLabels, useSlotId, useUpdateEffect} from '@react-aria/utils';\nimport {hookData, useSelectedDateDescription, useVisibleRangeDescription} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useState} from 'react';\n\nexport interface CalendarAria {\n /** Props for the calendar grouping element. */\n calendarProps: DOMAttributes,\n /** Props for the next button. */\n nextButtonProps: AriaButtonProps,\n /** Props for the previous button. */\n prevButtonProps: AriaButtonProps,\n /** Props for the error message element, if any. */\n errorMessageProps: DOMAttributes,\n /** A description of the visible date range, for use in the calendar title. */\n title: string\n}\n\nexport function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabelingProps, state: CalendarState | RangeCalendarState): CalendarAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let domProps = filterDOMProps(props);\n\n let title = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);\n let visibleRangeDescription = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);\n\n // Announce when the visible date range changes\n useUpdateEffect(() => {\n // only when pressing the Previous or Next button\n if (!state.isFocused) {\n announce(visibleRangeDescription);\n }\n }, [visibleRangeDescription]);\n\n // Announce when the selected value changes\n let selectedDateDescription = useSelectedDateDescription(state);\n useUpdateEffect(() => {\n if (selectedDateDescription) {\n announce(selectedDateDescription, 'polite', 4000);\n }\n // handle an update to the caption that describes the currently selected range, to announce the new value\n }, [selectedDateDescription]);\n\n let errorMessageId = useSlotId([Boolean(props.errorMessage), props.isInvalid, props.validationState]);\n\n // Pass the label to the child grid elements.\n hookData.set(state, {\n ariaLabel: props['aria-label'],\n ariaLabelledBy: props['aria-labelledby'],\n errorMessageId,\n selectedDateDescription\n });\n\n // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.\n let [nextFocused, setNextFocused] = useState(false);\n let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();\n if (nextDisabled && nextFocused) {\n setNextFocused(false);\n state.setFocused(true);\n }\n\n let [previousFocused, setPreviousFocused] = useState(false);\n let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();\n if (previousDisabled && previousFocused) {\n setPreviousFocused(false);\n state.setFocused(true);\n }\n\n let labelProps = useLabels({\n id: props['id'],\n 'aria-label': [props['aria-label'], visibleRangeDescription].filter(Boolean).join(', '),\n 'aria-labelledby': props['aria-labelledby']\n });\n\n return {\n calendarProps: mergeProps(domProps, labelProps, {\n role: 'application',\n 'aria-describedby': props['aria-describedby'] || undefined\n }),\n nextButtonProps: {\n onPress: () => state.focusNextPage(),\n 'aria-label': stringFormatter.format('next'),\n isDisabled: nextDisabled,\n onFocusChange: setNextFocused\n },\n prevButtonProps: {\n onPress: () => state.focusPreviousPage(),\n 'aria-label': stringFormatter.format('previous'),\n isDisabled: previousDisabled,\n onFocusChange: setPreviousFocused\n },\n errorMessageProps: {\n id: errorMessageId\n },\n title\n };\n}\n"],"names":[],"version":3,"file":"useCalendarBase.main.js.map"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {hookData as $a074e1e2d0f0a665$export$653eddfc964b0f8a, useSelectedDateDescription as $a074e1e2d0f0a665$export$b6df97c887c38e1a, useVisibleRangeDescription as $a074e1e2d0f0a665$export$31afe65d91ef6e8} from "./utils.mjs";
|
|
2
|
+
import $g2t6q$intlStringsmodulejs from "./intlStrings.mjs";
|
|
3
|
+
import {announce as $g2t6q$announce} from "@react-aria/live-announcer";
|
|
4
|
+
import {filterDOMProps as $g2t6q$filterDOMProps, useUpdateEffect as $g2t6q$useUpdateEffect, useSlotId as $g2t6q$useSlotId, useLabels as $g2t6q$useLabels, mergeProps as $g2t6q$mergeProps} from "@react-aria/utils";
|
|
5
|
+
import {useLocalizedStringFormatter as $g2t6q$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
6
|
+
import {useState as $g2t6q$useState} from "react";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
|
|
29
|
+
let stringFormatter = (0, $g2t6q$useLocalizedStringFormatter)((0, ($parcel$interopDefault($g2t6q$intlStringsmodulejs))), "@react-aria/calendar");
|
|
30
|
+
let domProps = (0, $g2t6q$filterDOMProps)(props);
|
|
31
|
+
let title = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
|
|
32
|
+
let visibleRangeDescription = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
|
|
33
|
+
// Announce when the visible date range changes
|
|
34
|
+
(0, $g2t6q$useUpdateEffect)(()=>{
|
|
35
|
+
// only when pressing the Previous or Next button
|
|
36
|
+
if (!state.isFocused) (0, $g2t6q$announce)(visibleRangeDescription);
|
|
37
|
+
}, [
|
|
38
|
+
visibleRangeDescription
|
|
39
|
+
]);
|
|
40
|
+
// Announce when the selected value changes
|
|
41
|
+
let selectedDateDescription = (0, $a074e1e2d0f0a665$export$b6df97c887c38e1a)(state);
|
|
42
|
+
(0, $g2t6q$useUpdateEffect)(()=>{
|
|
43
|
+
if (selectedDateDescription) (0, $g2t6q$announce)(selectedDateDescription, "polite", 4000);
|
|
44
|
+
// handle an update to the caption that describes the currently selected range, to announce the new value
|
|
45
|
+
}, [
|
|
46
|
+
selectedDateDescription
|
|
47
|
+
]);
|
|
48
|
+
let errorMessageId = (0, $g2t6q$useSlotId)([
|
|
49
|
+
Boolean(props.errorMessage),
|
|
50
|
+
props.isInvalid,
|
|
51
|
+
props.validationState
|
|
52
|
+
]);
|
|
53
|
+
// Pass the label to the child grid elements.
|
|
54
|
+
(0, $a074e1e2d0f0a665$export$653eddfc964b0f8a).set(state, {
|
|
55
|
+
ariaLabel: props["aria-label"],
|
|
56
|
+
ariaLabelledBy: props["aria-labelledby"],
|
|
57
|
+
errorMessageId: errorMessageId,
|
|
58
|
+
selectedDateDescription: selectedDateDescription
|
|
59
|
+
});
|
|
60
|
+
// If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
|
|
61
|
+
let [nextFocused, setNextFocused] = (0, $g2t6q$useState)(false);
|
|
62
|
+
let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
|
|
63
|
+
if (nextDisabled && nextFocused) {
|
|
64
|
+
setNextFocused(false);
|
|
65
|
+
state.setFocused(true);
|
|
66
|
+
}
|
|
67
|
+
let [previousFocused, setPreviousFocused] = (0, $g2t6q$useState)(false);
|
|
68
|
+
let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
|
|
69
|
+
if (previousDisabled && previousFocused) {
|
|
70
|
+
setPreviousFocused(false);
|
|
71
|
+
state.setFocused(true);
|
|
72
|
+
}
|
|
73
|
+
let labelProps = (0, $g2t6q$useLabels)({
|
|
74
|
+
id: props["id"],
|
|
75
|
+
"aria-label": [
|
|
76
|
+
props["aria-label"],
|
|
77
|
+
visibleRangeDescription
|
|
78
|
+
].filter(Boolean).join(", "),
|
|
79
|
+
"aria-labelledby": props["aria-labelledby"]
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
calendarProps: (0, $g2t6q$mergeProps)(domProps, labelProps, {
|
|
83
|
+
role: "application",
|
|
84
|
+
"aria-describedby": props["aria-describedby"] || undefined
|
|
85
|
+
}),
|
|
86
|
+
nextButtonProps: {
|
|
87
|
+
onPress: ()=>state.focusNextPage(),
|
|
88
|
+
"aria-label": stringFormatter.format("next"),
|
|
89
|
+
isDisabled: nextDisabled,
|
|
90
|
+
onFocusChange: setNextFocused
|
|
91
|
+
},
|
|
92
|
+
prevButtonProps: {
|
|
93
|
+
onPress: ()=>state.focusPreviousPage(),
|
|
94
|
+
"aria-label": stringFormatter.format("previous"),
|
|
95
|
+
isDisabled: previousDisabled,
|
|
96
|
+
onFocusChange: setPreviousFocused
|
|
97
|
+
},
|
|
98
|
+
errorMessageProps: {
|
|
99
|
+
id: errorMessageId
|
|
100
|
+
},
|
|
101
|
+
title: title
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
export {$c4acc1de3ab169cf$export$d652b3ea2d672d5b as useCalendarBase};
|
|
107
|
+
//# sourceMappingURL=useCalendarBase.mjs.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {hookData as $a074e1e2d0f0a665$export$653eddfc964b0f8a, useSelectedDateDescription as $a074e1e2d0f0a665$export$b6df97c887c38e1a, useVisibleRangeDescription as $a074e1e2d0f0a665$export$31afe65d91ef6e8} from "./utils.module.js";
|
|
2
|
+
import $g2t6q$intlStringsmodulejs from "./intlStrings.module.js";
|
|
3
|
+
import {announce as $g2t6q$announce} from "@react-aria/live-announcer";
|
|
4
|
+
import {filterDOMProps as $g2t6q$filterDOMProps, useUpdateEffect as $g2t6q$useUpdateEffect, useSlotId as $g2t6q$useSlotId, useLabels as $g2t6q$useLabels, mergeProps as $g2t6q$mergeProps} from "@react-aria/utils";
|
|
5
|
+
import {useLocalizedStringFormatter as $g2t6q$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
6
|
+
import {useState as $g2t6q$useState} from "react";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
|
|
29
|
+
let stringFormatter = (0, $g2t6q$useLocalizedStringFormatter)((0, ($parcel$interopDefault($g2t6q$intlStringsmodulejs))), "@react-aria/calendar");
|
|
30
|
+
let domProps = (0, $g2t6q$filterDOMProps)(props);
|
|
31
|
+
let title = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
|
|
32
|
+
let visibleRangeDescription = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
|
|
33
|
+
// Announce when the visible date range changes
|
|
34
|
+
(0, $g2t6q$useUpdateEffect)(()=>{
|
|
35
|
+
// only when pressing the Previous or Next button
|
|
36
|
+
if (!state.isFocused) (0, $g2t6q$announce)(visibleRangeDescription);
|
|
37
|
+
}, [
|
|
38
|
+
visibleRangeDescription
|
|
39
|
+
]);
|
|
40
|
+
// Announce when the selected value changes
|
|
41
|
+
let selectedDateDescription = (0, $a074e1e2d0f0a665$export$b6df97c887c38e1a)(state);
|
|
42
|
+
(0, $g2t6q$useUpdateEffect)(()=>{
|
|
43
|
+
if (selectedDateDescription) (0, $g2t6q$announce)(selectedDateDescription, "polite", 4000);
|
|
44
|
+
// handle an update to the caption that describes the currently selected range, to announce the new value
|
|
45
|
+
}, [
|
|
46
|
+
selectedDateDescription
|
|
47
|
+
]);
|
|
48
|
+
let errorMessageId = (0, $g2t6q$useSlotId)([
|
|
49
|
+
Boolean(props.errorMessage),
|
|
50
|
+
props.isInvalid,
|
|
51
|
+
props.validationState
|
|
52
|
+
]);
|
|
53
|
+
// Pass the label to the child grid elements.
|
|
54
|
+
(0, $a074e1e2d0f0a665$export$653eddfc964b0f8a).set(state, {
|
|
55
|
+
ariaLabel: props["aria-label"],
|
|
56
|
+
ariaLabelledBy: props["aria-labelledby"],
|
|
57
|
+
errorMessageId: errorMessageId,
|
|
58
|
+
selectedDateDescription: selectedDateDescription
|
|
59
|
+
});
|
|
60
|
+
// If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
|
|
61
|
+
let [nextFocused, setNextFocused] = (0, $g2t6q$useState)(false);
|
|
62
|
+
let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
|
|
63
|
+
if (nextDisabled && nextFocused) {
|
|
64
|
+
setNextFocused(false);
|
|
65
|
+
state.setFocused(true);
|
|
66
|
+
}
|
|
67
|
+
let [previousFocused, setPreviousFocused] = (0, $g2t6q$useState)(false);
|
|
68
|
+
let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
|
|
69
|
+
if (previousDisabled && previousFocused) {
|
|
70
|
+
setPreviousFocused(false);
|
|
71
|
+
state.setFocused(true);
|
|
72
|
+
}
|
|
73
|
+
let labelProps = (0, $g2t6q$useLabels)({
|
|
74
|
+
id: props["id"],
|
|
75
|
+
"aria-label": [
|
|
76
|
+
props["aria-label"],
|
|
77
|
+
visibleRangeDescription
|
|
78
|
+
].filter(Boolean).join(", "),
|
|
79
|
+
"aria-labelledby": props["aria-labelledby"]
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
calendarProps: (0, $g2t6q$mergeProps)(domProps, labelProps, {
|
|
83
|
+
role: "application",
|
|
84
|
+
"aria-describedby": props["aria-describedby"] || undefined
|
|
85
|
+
}),
|
|
86
|
+
nextButtonProps: {
|
|
87
|
+
onPress: ()=>state.focusNextPage(),
|
|
88
|
+
"aria-label": stringFormatter.format("next"),
|
|
89
|
+
isDisabled: nextDisabled,
|
|
90
|
+
onFocusChange: setNextFocused
|
|
91
|
+
},
|
|
92
|
+
prevButtonProps: {
|
|
93
|
+
onPress: ()=>state.focusPreviousPage(),
|
|
94
|
+
"aria-label": stringFormatter.format("previous"),
|
|
95
|
+
isDisabled: previousDisabled,
|
|
96
|
+
onFocusChange: setPreviousFocused
|
|
97
|
+
},
|
|
98
|
+
errorMessageProps: {
|
|
99
|
+
id: errorMessageId
|
|
100
|
+
},
|
|
101
|
+
title: title
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
export {$c4acc1de3ab169cf$export$d652b3ea2d672d5b as useCalendarBase};
|
|
107
|
+
//# sourceMappingURL=useCalendarBase.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA2BM,SAAS,0CAAgB,KAAuD,EAAE,KAAyC;IAChI,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAE9B,IAAI,QAAQ,CAAA,GAAA,wCAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IACzG,IAAI,0BAA0B,CAAA,GAAA,wCAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IAE3H,+CAA+C;IAC/C,CAAA,GAAA,sBAAc,EAAE;QACd,iDAAiD;QACjD,IAAI,CAAC,MAAM,SAAS,EAClB,CAAA,GAAA,eAAO,EAAE;IAEb,GAAG;QAAC;KAAwB;IAE5B,2CAA2C;IAC3C,IAAI,0BAA0B,CAAA,GAAA,yCAAyB,EAAE;IACzD,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,yBACF,CAAA,GAAA,eAAO,EAAE,yBAAyB,UAAU;IAE9C,yGAAyG;IAC3G,GAAG;QAAC;KAAwB;IAE5B,IAAI,iBAAiB,CAAA,GAAA,gBAAQ,EAAE;QAAC,QAAQ,MAAM,YAAY;QAAG,MAAM,SAAS;QAAE,MAAM,eAAe;KAAC;IAEpG,6CAA6C;IAC7C,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;QAClB,WAAW,KAAK,CAAC,aAAa;QAC9B,gBAAgB,KAAK,CAAC,kBAAkB;wBACxC;iCACA;IACF;IAEA,2GAA2G;IAC3G,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,eAAO,EAAE;IAC7C,IAAI,eAAe,MAAM,UAAU,IAAI,MAAM,yBAAyB;IACtE,IAAI,gBAAgB,aAAa;QAC/B,eAAe;QACf,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,CAAC,iBAAiB,mBAAmB,GAAG,CAAA,GAAA,eAAO,EAAE;IACrD,IAAI,mBAAmB,MAAM,UAAU,IAAI,MAAM,6BAA6B;IAC9E,IAAI,oBAAoB,iBAAiB;QACvC,mBAAmB;QACnB,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,aAAa,CAAA,GAAA,gBAAQ,EAAE;QACzB,IAAI,KAAK,CAAC,KAAK;QACf,cAAc;YAAC,KAAK,CAAC,aAAa;YAAE;SAAwB,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QAClF,mBAAmB,KAAK,CAAC,kBAAkB;IAC7C;IAEA,OAAO;QACL,eAAe,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY;YAC9C,MAAM;YACN,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;QACnD;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,aAAa;YAClC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,iBAAiB;YACtC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,mBAAmB;YACjB,IAAI;QACN;eACA;IACF;AACF","sources":["packages/@react-aria/calendar/src/useCalendarBase.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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, DOMProps} from '@react-types/shared';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {filterDOMProps, mergeProps, useLabels, useSlotId, useUpdateEffect} from '@react-aria/utils';\nimport {hookData, useSelectedDateDescription, useVisibleRangeDescription} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useState} from 'react';\n\nexport interface CalendarAria {\n /** Props for the calendar grouping element. */\n calendarProps: DOMAttributes,\n /** Props for the next button. */\n nextButtonProps: AriaButtonProps,\n /** Props for the previous button. */\n prevButtonProps: AriaButtonProps,\n /** Props for the error message element, if any. */\n errorMessageProps: DOMAttributes,\n /** A description of the visible date range, for use in the calendar title. */\n title: string\n}\n\nexport function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabelingProps, state: CalendarState | RangeCalendarState): CalendarAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let domProps = filterDOMProps(props);\n\n let title = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);\n let visibleRangeDescription = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);\n\n // Announce when the visible date range changes\n useUpdateEffect(() => {\n // only when pressing the Previous or Next button\n if (!state.isFocused) {\n announce(visibleRangeDescription);\n }\n }, [visibleRangeDescription]);\n\n // Announce when the selected value changes\n let selectedDateDescription = useSelectedDateDescription(state);\n useUpdateEffect(() => {\n if (selectedDateDescription) {\n announce(selectedDateDescription, 'polite', 4000);\n }\n // handle an update to the caption that describes the currently selected range, to announce the new value\n }, [selectedDateDescription]);\n\n let errorMessageId = useSlotId([Boolean(props.errorMessage), props.isInvalid, props.validationState]);\n\n // Pass the label to the child grid elements.\n hookData.set(state, {\n ariaLabel: props['aria-label'],\n ariaLabelledBy: props['aria-labelledby'],\n errorMessageId,\n selectedDateDescription\n });\n\n // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.\n let [nextFocused, setNextFocused] = useState(false);\n let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();\n if (nextDisabled && nextFocused) {\n setNextFocused(false);\n state.setFocused(true);\n }\n\n let [previousFocused, setPreviousFocused] = useState(false);\n let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();\n if (previousDisabled && previousFocused) {\n setPreviousFocused(false);\n state.setFocused(true);\n }\n\n let labelProps = useLabels({\n id: props['id'],\n 'aria-label': [props['aria-label'], visibleRangeDescription].filter(Boolean).join(', '),\n 'aria-labelledby': props['aria-labelledby']\n });\n\n return {\n calendarProps: mergeProps(domProps, labelProps, {\n role: 'application',\n 'aria-describedby': props['aria-describedby'] || undefined\n }),\n nextButtonProps: {\n onPress: () => state.focusNextPage(),\n 'aria-label': stringFormatter.format('next'),\n isDisabled: nextDisabled,\n onFocusChange: setNextFocused\n },\n prevButtonProps: {\n onPress: () => state.focusPreviousPage(),\n 'aria-label': stringFormatter.format('previous'),\n isDisabled: previousDisabled,\n onFocusChange: setPreviousFocused\n },\n errorMessageProps: {\n id: errorMessageId\n },\n title\n };\n}\n"],"names":[],"version":3,"file":"useCalendarBase.module.js.map"}
|