@react-spectrum/calendar 3.7.11 → 3.8.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/import.mjs +3 -3
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +4 -0
- package/package.json +12 -40
- package/src/index.ts +5 -3
- package/dist/Calendar.main.js +0 -75
- package/dist/Calendar.main.js.map +0 -1
- package/dist/Calendar.mjs +0 -66
- package/dist/Calendar.module.js +0 -66
- package/dist/Calendar.module.js.map +0 -1
- package/dist/CalendarBase.main.js +0 -121
- package/dist/CalendarBase.main.js.map +0 -1
- package/dist/CalendarBase.mjs +0 -116
- package/dist/CalendarBase.module.js +0 -116
- package/dist/CalendarBase.module.js.map +0 -1
- package/dist/CalendarCell.main.js +0 -95
- package/dist/CalendarCell.main.js.map +0 -1
- package/dist/CalendarCell.mjs +0 -90
- package/dist/CalendarCell.module.js +0 -90
- package/dist/CalendarCell.module.js.map +0 -1
- package/dist/CalendarMonth.main.js +0 -65
- package/dist/CalendarMonth.main.js.map +0 -1
- package/dist/CalendarMonth.mjs +0 -60
- package/dist/CalendarMonth.module.js +0 -60
- package/dist/CalendarMonth.module.js.map +0 -1
- package/dist/RangeCalendar.main.js +0 -75
- package/dist/RangeCalendar.main.js.map +0 -1
- package/dist/RangeCalendar.mjs +0 -66
- package/dist/RangeCalendar.module.js +0 -66
- package/dist/RangeCalendar.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -9
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -11
- package/dist/ar-AE.module.js +0 -11
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -9
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -11
- package/dist/bg-BG.module.js +0 -11
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/calendar.e1e61a27.css +0 -924
- package/dist/calendar.e1e61a27.css.map +0 -1
- package/dist/calendar_vars_css.main.js +0 -116
- package/dist/calendar_vars_css.main.js.map +0 -1
- package/dist/calendar_vars_css.mjs +0 -118
- package/dist/calendar_vars_css.module.js +0 -118
- package/dist/calendar_vars_css.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -9
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -11
- package/dist/cs-CZ.module.js +0 -11
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -9
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -11
- package/dist/da-DK.module.js +0 -11
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -9
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -11
- package/dist/de-DE.module.js +0 -11
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -9
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -11
- package/dist/el-GR.module.js +0 -11
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -9
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -11
- package/dist/en-US.module.js +0 -11
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -9
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -11
- package/dist/es-ES.module.js +0 -11
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -9
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -11
- package/dist/et-EE.module.js +0 -11
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -9
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -11
- package/dist/fi-FI.module.js +0 -11
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -9
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -11
- package/dist/fr-FR.module.js +0 -11
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -9
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -11
- package/dist/he-IL.module.js +0 -11
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -9
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -11
- package/dist/hr-HR.module.js +0 -11
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -9
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -11
- package/dist/hu-HU.module.js +0 -11
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -9
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -11
- package/dist/it-IT.module.js +0 -11
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -9
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -11
- package/dist/ja-JP.module.js +0 -11
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -9
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -11
- package/dist/ko-KR.module.js +0 -11
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -9
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -11
- package/dist/lt-LT.module.js +0 -11
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -9
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -11
- package/dist/lv-LV.module.js +0 -11
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -9
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -11
- package/dist/nb-NO.module.js +0 -11
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -9
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -11
- package/dist/nl-NL.module.js +0 -11
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -9
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -11
- package/dist/pl-PL.module.js +0 -11
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -9
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -11
- package/dist/pt-BR.module.js +0 -11
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -9
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -11
- package/dist/pt-PT.module.js +0 -11
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -9
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -11
- package/dist/ro-RO.module.js +0 -11
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -9
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -11
- package/dist/ru-RU.module.js +0 -11
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -9
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -11
- package/dist/sk-SK.module.js +0 -11
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -9
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -11
- package/dist/sl-SI.module.js +0 -11
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -9
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -11
- package/dist/sr-SP.module.js +0 -11
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -9
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -11
- package/dist/sv-SE.module.js +0 -11
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -9
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -11
- package/dist/tr-TR.module.js +0 -11
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -18
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -9
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -11
- package/dist/uk-UA.module.js +0 -11
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -9
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -11
- package/dist/zh-CN.module.js +0 -11
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -9
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -11
- package/dist/zh-TW.module.js +0 -11
- package/dist/zh-TW.module.js.map +0 -1
- package/src/Calendar.tsx +0 -61
- package/src/CalendarBase.tsx +0 -160
- package/src/CalendarCell.tsx +0 -89
- package/src/CalendarMonth.tsx +0 -80
- package/src/RangeCalendar.tsx +0 -61
package/dist/sl-SI.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $ced45866328d3850$exports = {};
|
|
2
|
-
$ced45866328d3850$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`Izbrano ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `date`,
|
|
5
|
-
other: `dates`
|
|
6
|
-
})} ni na voljo.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$ced45866328d3850$exports as default};
|
|
11
|
-
//# sourceMappingURL=sl-SI.module.js.map
|
package/dist/sl-SI.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,QAAQ,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC;QAAA,GAAG,aAAa,CAAC;AAC1J","sources":["packages/@react-spectrum/calendar/intl/sl-SI.json"],"sourcesContent":["{\n \"invalidSelection\": \"Izbrano {selectedCount, plural, one {date} other {dates}} ni na voljo.\"\n}\n"],"names":[],"version":3,"file":"sl-SI.module.js.map"}
|
package/dist/sr-SP.main.js
DELETED
package/dist/sr-SP.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,SAAS,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC;QAAA,GAAG,eAAe,CAAC;AAC7J","sources":["packages/@react-spectrum/calendar/intl/sr-SP.json"],"sourcesContent":["{\n \"invalidSelection\": \"Izabrani {selectedCount, plural, one {date} other {dates}} nije dostupan.\"\n}\n"],"names":[],"version":3,"file":"sr-SP.main.js.map"}
|
package/dist/sr-SP.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $46417484d64689f8$exports = {};
|
|
2
|
-
$46417484d64689f8$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`Izabrani ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `date`,
|
|
5
|
-
other: `dates`
|
|
6
|
-
})} nije dostupan.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$46417484d64689f8$exports as default};
|
|
11
|
-
//# sourceMappingURL=sr-SP.module.js.map
|
package/dist/sr-SP.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $46417484d64689f8$exports = {};
|
|
2
|
-
$46417484d64689f8$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`Izabrani ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `date`,
|
|
5
|
-
other: `dates`
|
|
6
|
-
})} nije dostupan.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$46417484d64689f8$exports as default};
|
|
11
|
-
//# sourceMappingURL=sr-SP.module.js.map
|
package/dist/sr-SP.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,SAAS,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC;QAAA,GAAG,eAAe,CAAC;AAC7J","sources":["packages/@react-spectrum/calendar/intl/sr-SP.json"],"sourcesContent":["{\n \"invalidSelection\": \"Izabrani {selectedCount, plural, one {date} other {dates}} nije dostupan.\"\n}\n"],"names":[],"version":3,"file":"sr-SP.module.js.map"}
|
package/dist/sv-SE.main.js
DELETED
package/dist/sv-SE.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,sCAAgC,CAAC;YAAE,OAAO,CAAC,uCAAiC,CAAC;QAAA,IAAI;AAC7L","sources":["packages/@react-spectrum/calendar/intl/sv-SE.json"],"sourcesContent":["{\n \"invalidSelection\": \"{selectedCount, plural, one {Valt datum är inte tillgängligt.} other {Valda datum är inte tillgängliga.}}\"\n}\n"],"names":[],"version":3,"file":"sv-SE.main.js.map"}
|
package/dist/sv-SE.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $9d8ccb39096f4575$exports = {};
|
|
2
|
-
$9d8ccb39096f4575$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `Valt datum \xe4r inte tillg\xe4ngligt.`,
|
|
5
|
-
other: `Valda datum \xe4r inte tillg\xe4ngliga.`
|
|
6
|
-
})}`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$9d8ccb39096f4575$exports as default};
|
|
11
|
-
//# sourceMappingURL=sv-SE.module.js.map
|
package/dist/sv-SE.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $9d8ccb39096f4575$exports = {};
|
|
2
|
-
$9d8ccb39096f4575$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `Valt datum \xe4r inte tillg\xe4ngligt.`,
|
|
5
|
-
other: `Valda datum \xe4r inte tillg\xe4ngliga.`
|
|
6
|
-
})}`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$9d8ccb39096f4575$exports as default};
|
|
11
|
-
//# sourceMappingURL=sv-SE.module.js.map
|
package/dist/sv-SE.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,sCAAgC,CAAC;YAAE,OAAO,CAAC,uCAAiC,CAAC;QAAA,IAAI;AAC7L","sources":["packages/@react-spectrum/calendar/intl/sv-SE.json"],"sourcesContent":["{\n \"invalidSelection\": \"{selectedCount, plural, one {Valt datum är inte tillgängligt.} other {Valda datum är inte tillgängliga.}}\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
|
package/dist/tr-TR.main.js
DELETED
package/dist/tr-TR.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,WAAQ,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,QAAQ,CAAC;QAAA,GAAG,uBAAc,CAAC;AAC/J","sources":["packages/@react-spectrum/calendar/intl/tr-TR.json"],"sourcesContent":["{\n \"invalidSelection\": \"Seçilen {selectedCount, plural, one {tarih} other {tarihler}} müsait değil.\"\n}\n"],"names":[],"version":3,"file":"tr-TR.main.js.map"}
|
package/dist/tr-TR.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $8e9c1a10ed1cc18a$exports = {};
|
|
2
|
-
$8e9c1a10ed1cc18a$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`Se\xe7ilen ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `tarih`,
|
|
5
|
-
other: `tarihler`
|
|
6
|
-
})} m\xfcsait de\u{11F}il.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$8e9c1a10ed1cc18a$exports as default};
|
|
11
|
-
//# sourceMappingURL=tr-TR.module.js.map
|
package/dist/tr-TR.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $8e9c1a10ed1cc18a$exports = {};
|
|
2
|
-
$8e9c1a10ed1cc18a$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`Se\xe7ilen ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `tarih`,
|
|
5
|
-
other: `tarihler`
|
|
6
|
-
})} m\xfcsait de\u{11F}il.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$8e9c1a10ed1cc18a$exports as default};
|
|
11
|
-
//# sourceMappingURL=tr-TR.module.js.map
|
package/dist/tr-TR.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,WAAQ,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,QAAQ,CAAC;QAAA,GAAG,uBAAc,CAAC;AAC/J","sources":["packages/@react-spectrum/calendar/intl/tr-TR.json"],"sourcesContent":["{\n \"invalidSelection\": \"Seçilen {selectedCount, plural, one {tarih} other {tarihler}} müsait değil.\"\n}\n"],"names":[],"version":3,"file":"tr-TR.module.js.map"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DateValue, SpectrumCalendarProps, SpectrumRangeCalendarProps } from "@react-types/calendar";
|
|
2
|
-
import { FocusableRef } from "@react-types/shared";
|
|
3
|
-
import { ReactElement } from "react";
|
|
4
|
-
/**
|
|
5
|
-
* Calendars display a grid of days in one or more months and allow users to select a single date.
|
|
6
|
-
*/
|
|
7
|
-
export const Calendar: <T extends DateValue>(props: SpectrumCalendarProps<T> & {
|
|
8
|
-
ref?: FocusableRef<HTMLElement>;
|
|
9
|
-
}) => ReactElement;
|
|
10
|
-
/**
|
|
11
|
-
* RangeCalendars display a grid of days in one or more months and allow users to select a contiguous range of dates.
|
|
12
|
-
*/
|
|
13
|
-
export const RangeCalendar: <T extends DateValue>(props: SpectrumRangeCalendarProps<T> & {
|
|
14
|
-
ref?: FocusableRef<HTMLElement>;
|
|
15
|
-
}) => ReactElement;
|
|
16
|
-
export type { SpectrumCalendarProps, SpectrumRangeCalendarProps } from '@react-types/calendar';
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;AGuBA;;GAEG;AACH,OAAO,MAAM,UAkCP,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;ACrCjH;;GAEG;AACH,OAAO,MAAM,eAkCP,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,2BAA2B,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;AC5CtH,YAAY,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,uBAAuB,CAAC","sources":["packages/@react-spectrum/calendar/src/packages/@react-spectrum/calendar/src/CalendarCell.tsx","packages/@react-spectrum/calendar/src/packages/@react-spectrum/calendar/src/CalendarMonth.tsx","packages/@react-spectrum/calendar/src/packages/@react-spectrum/calendar/src/CalendarBase.tsx","packages/@react-spectrum/calendar/src/packages/@react-spectrum/calendar/src/Calendar.tsx","packages/@react-spectrum/calendar/src/packages/@react-spectrum/calendar/src/RangeCalendar.tsx","packages/@react-spectrum/calendar/src/packages/@react-spectrum/calendar/src/index.ts","packages/@react-spectrum/calendar/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,"/*\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\n/// <reference types=\"css-module-types\" />\n\nexport {Calendar} from './Calendar';\nexport {RangeCalendar} from './RangeCalendar';\nexport type {SpectrumCalendarProps, SpectrumRangeCalendarProps} from '@react-types/calendar';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/dist/uk-UA.main.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"invalidSelection": (args, formatter)=>`${formatter.plural(args.selectedCount, {
|
|
3
|
-
one: `\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430} \u{43D}\u{435}\u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430}`,
|
|
4
|
-
other: `\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{456} \u{434}\u{430}\u{442}\u{438} \u{43D}\u{435}\u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{456}`
|
|
5
|
-
})}.`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=uk-UA.main.js.map
|
package/dist/uk-UA.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,qJAAuB,CAAC;YAAE,OAAO,CAAC,qJAAuB,CAAC;QAAA,GAAG,CAAC,CAAC;AAC3K","sources":["packages/@react-spectrum/calendar/intl/uk-UA.json"],"sourcesContent":["{\n \"invalidSelection\": \"{selectedCount, plural, one {Вибрана дата недоступна} other {Вибрані дати недоступні}}.\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
|
package/dist/uk-UA.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $84c3bf1d3eaf1f59$exports = {};
|
|
2
|
-
$84c3bf1d3eaf1f59$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430} \u{43D}\u{435}\u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430}`,
|
|
5
|
-
other: `\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{456} \u{434}\u{430}\u{442}\u{438} \u{43D}\u{435}\u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{456}`
|
|
6
|
-
})}.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$84c3bf1d3eaf1f59$exports as default};
|
|
11
|
-
//# sourceMappingURL=uk-UA.module.js.map
|
package/dist/uk-UA.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $84c3bf1d3eaf1f59$exports = {};
|
|
2
|
-
$84c3bf1d3eaf1f59$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430} \u{43D}\u{435}\u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{430}`,
|
|
5
|
-
other: `\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{456} \u{434}\u{430}\u{442}\u{438} \u{43D}\u{435}\u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{456}`
|
|
6
|
-
})}.`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$84c3bf1d3eaf1f59$exports as default};
|
|
11
|
-
//# sourceMappingURL=uk-UA.module.js.map
|
package/dist/uk-UA.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,qJAAuB,CAAC;YAAE,OAAO,CAAC,qJAAuB,CAAC;QAAA,GAAG,CAAC,CAAC;AAC3K","sources":["packages/@react-spectrum/calendar/intl/uk-UA.json"],"sourcesContent":["{\n \"invalidSelection\": \"{selectedCount, plural, one {Вибрана дата недоступна} other {Вибрані дати недоступні}}.\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
|
package/dist/zh-CN.main.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"invalidSelection": (args, formatter)=>`\u{9009}\u{5B9A}\u{7684} ${formatter.plural(args.selectedCount, {
|
|
3
|
-
one: `\u{4E2A}\u{65E5}\u{671F}`,
|
|
4
|
-
other: `\u{4E2A}\u{65E5}\u{671F}`
|
|
5
|
-
})} \u{4E0D}\u{53EF}\u{7528}\u{3002}`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=zh-CN.main.js.map
|
package/dist/zh-CN.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,yBAAI,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,wBAAG,CAAC;YAAE,OAAO,CAAC,wBAAG,CAAC;QAAA,GAAG,iCAAK,CAAC;AAC3I","sources":["packages/@react-spectrum/calendar/intl/zh-CN.json"],"sourcesContent":["{\n \"invalidSelection\": \"选定的 {selectedCount, plural, one {个日期} other {个日期}} 不可用。\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
|
package/dist/zh-CN.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $0212afd59952ac06$exports = {};
|
|
2
|
-
$0212afd59952ac06$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`\u{9009}\u{5B9A}\u{7684} ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `\u{4E2A}\u{65E5}\u{671F}`,
|
|
5
|
-
other: `\u{4E2A}\u{65E5}\u{671F}`
|
|
6
|
-
})} \u{4E0D}\u{53EF}\u{7528}\u{3002}`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$0212afd59952ac06$exports as default};
|
|
11
|
-
//# sourceMappingURL=zh-CN.module.js.map
|
package/dist/zh-CN.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $0212afd59952ac06$exports = {};
|
|
2
|
-
$0212afd59952ac06$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`\u{9009}\u{5B9A}\u{7684} ${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `\u{4E2A}\u{65E5}\u{671F}`,
|
|
5
|
-
other: `\u{4E2A}\u{65E5}\u{671F}`
|
|
6
|
-
})} \u{4E0D}\u{53EF}\u{7528}\u{3002}`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$0212afd59952ac06$exports as default};
|
|
11
|
-
//# sourceMappingURL=zh-CN.module.js.map
|
package/dist/zh-CN.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,yBAAI,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,wBAAG,CAAC;YAAE,OAAO,CAAC,wBAAG,CAAC;QAAA,GAAG,iCAAK,CAAC;AAC3I","sources":["packages/@react-spectrum/calendar/intl/zh-CN.json"],"sourcesContent":["{\n \"invalidSelection\": \"选定的 {selectedCount, plural, one {个日期} other {个日期}} 不可用。\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
|
package/dist/zh-TW.main.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"invalidSelection": (args, formatter)=>`\u{6240}\u{9078}\u{7684}${formatter.plural(args.selectedCount, {
|
|
3
|
-
one: `\u{65E5}\u{671F}`,
|
|
4
|
-
other: `\u{65E5}\u{671F}`
|
|
5
|
-
})}\u{7121}\u{6CD5}\u{4F7F}\u{7528}\u{3002}`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=zh-TW.main.js.map
|
package/dist/zh-TW.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,wBAAG,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,gBAAE,CAAC;YAAE,OAAO,CAAC,gBAAE,CAAC;QAAA,GAAG,wCAAK,CAAC;AACxI","sources":["packages/@react-spectrum/calendar/intl/zh-TW.json"],"sourcesContent":["{\n \"invalidSelection\": \"所選的{selectedCount, plural, one {日期} other {日期}}無法使用。\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
|
package/dist/zh-TW.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $87077630a4e30349$exports = {};
|
|
2
|
-
$87077630a4e30349$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`\u{6240}\u{9078}\u{7684}${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `\u{65E5}\u{671F}`,
|
|
5
|
-
other: `\u{65E5}\u{671F}`
|
|
6
|
-
})}\u{7121}\u{6CD5}\u{4F7F}\u{7528}\u{3002}`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$87077630a4e30349$exports as default};
|
|
11
|
-
//# sourceMappingURL=zh-TW.module.js.map
|
package/dist/zh-TW.module.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var $87077630a4e30349$exports = {};
|
|
2
|
-
$87077630a4e30349$exports = {
|
|
3
|
-
"invalidSelection": (args, formatter)=>`\u{6240}\u{9078}\u{7684}${formatter.plural(args.selectedCount, {
|
|
4
|
-
one: `\u{65E5}\u{671F}`,
|
|
5
|
-
other: `\u{65E5}\u{671F}`
|
|
6
|
-
})}\u{7121}\u{6CD5}\u{4F7F}\u{7528}\u{3002}`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {$87077630a4e30349$exports as default};
|
|
11
|
-
//# sourceMappingURL=zh-TW.module.js.map
|
package/dist/zh-TW.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,MAAM,YAAc,CAAC,wBAAG,EAAE,UAAU,MAAM,CAAC,KAAK,aAAa,EAAE;YAAC,KAAK,CAAC,gBAAE,CAAC;YAAE,OAAO,CAAC,gBAAE,CAAC;QAAA,GAAG,wCAAK,CAAC;AACxI","sources":["packages/@react-spectrum/calendar/intl/zh-TW.json"],"sourcesContent":["{\n \"invalidSelection\": \"所選的{selectedCount, plural, one {日期} other {日期}}無法使用。\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
|
package/src/Calendar.tsx
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {CalendarBase} from './CalendarBase';
|
|
14
|
-
import {createCalendar} from '@internationalized/date';
|
|
15
|
-
import {createDOMRef} from '@react-spectrum/utils';
|
|
16
|
-
import {DateValue, SpectrumCalendarProps} from '@react-types/calendar';
|
|
17
|
-
import {FocusableRef} from '@react-types/shared';
|
|
18
|
-
import React, {ReactElement, useImperativeHandle, useMemo, useRef} from 'react';
|
|
19
|
-
import {useCalendar} from '@react-aria/calendar';
|
|
20
|
-
import {useCalendarState} from '@react-stately/calendar';
|
|
21
|
-
import {useLocale} from '@react-aria/i18n';
|
|
22
|
-
import {useProviderProps} from '@react-spectrum/provider';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Calendars display a grid of days in one or more months and allow users to select a single date.
|
|
26
|
-
*/
|
|
27
|
-
export const Calendar = React.forwardRef(function Calendar<T extends DateValue>(props: SpectrumCalendarProps<T>, ref: FocusableRef<HTMLElement>) {
|
|
28
|
-
props = useProviderProps(props);
|
|
29
|
-
let {visibleMonths = 1} = props;
|
|
30
|
-
visibleMonths = Math.max(visibleMonths, 1);
|
|
31
|
-
let visibleDuration = useMemo(() => ({months: visibleMonths}), [visibleMonths]);
|
|
32
|
-
let {locale} = useLocale();
|
|
33
|
-
let state = useCalendarState({
|
|
34
|
-
...props,
|
|
35
|
-
locale,
|
|
36
|
-
visibleDuration,
|
|
37
|
-
createCalendar: props.createCalendar || createCalendar
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
let domRef = useRef(null);
|
|
41
|
-
useImperativeHandle(ref, () => ({
|
|
42
|
-
...createDOMRef(domRef),
|
|
43
|
-
focus() {
|
|
44
|
-
state.setFocused(true);
|
|
45
|
-
}
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps} = useCalendar(props, state);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<CalendarBase
|
|
52
|
-
{...props}
|
|
53
|
-
visibleMonths={visibleMonths}
|
|
54
|
-
state={state}
|
|
55
|
-
calendarRef={domRef}
|
|
56
|
-
calendarProps={calendarProps}
|
|
57
|
-
prevButtonProps={prevButtonProps}
|
|
58
|
-
nextButtonProps={nextButtonProps}
|
|
59
|
-
errorMessageProps={errorMessageProps} />
|
|
60
|
-
);
|
|
61
|
-
}) as <T extends DateValue>(props: SpectrumCalendarProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;
|
package/src/CalendarBase.tsx
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {ActionButton} from '@react-spectrum/button';
|
|
14
|
-
import {AriaButtonProps} from '@react-types/button';
|
|
15
|
-
import {CalendarDate} from '@internationalized/date';
|
|
16
|
-
import {CalendarMonth} from './CalendarMonth';
|
|
17
|
-
import {CalendarPropsBase} from '@react-types/calendar';
|
|
18
|
-
import {CalendarState, RangeCalendarState} from '@react-stately/calendar';
|
|
19
|
-
import ChevronLeft from '@spectrum-icons/ui/ChevronLeftLarge';
|
|
20
|
-
import ChevronRight from '@spectrum-icons/ui/ChevronRightLarge';
|
|
21
|
-
import {classNames, useStyleProps} from '@react-spectrum/utils';
|
|
22
|
-
import {DOMProps, RefObject, StyleProps} from '@react-types/shared';
|
|
23
|
-
import {HelpText} from '@react-spectrum/label';
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
import intlMessages from '../intl/*.json';
|
|
26
|
-
import React, {HTMLAttributes, JSX} from 'react';
|
|
27
|
-
import styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';
|
|
28
|
-
import {useDateFormatter, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
29
|
-
import {VisuallyHidden} from '@react-aria/visually-hidden';
|
|
30
|
-
|
|
31
|
-
interface CalendarBaseProps<T extends CalendarState | RangeCalendarState> extends CalendarPropsBase, DOMProps, StyleProps {
|
|
32
|
-
state: T,
|
|
33
|
-
visibleMonths?: number,
|
|
34
|
-
calendarProps: HTMLAttributes<HTMLElement>,
|
|
35
|
-
nextButtonProps: AriaButtonProps,
|
|
36
|
-
prevButtonProps: AriaButtonProps,
|
|
37
|
-
errorMessageProps: HTMLAttributes<HTMLElement>,
|
|
38
|
-
calendarRef: RefObject<HTMLDivElement | null>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function CalendarBase<T extends CalendarState | RangeCalendarState>(props: CalendarBaseProps<T>): JSX.Element {
|
|
42
|
-
let {
|
|
43
|
-
state,
|
|
44
|
-
calendarProps,
|
|
45
|
-
nextButtonProps,
|
|
46
|
-
prevButtonProps,
|
|
47
|
-
errorMessageProps,
|
|
48
|
-
calendarRef: ref,
|
|
49
|
-
visibleMonths = 1,
|
|
50
|
-
firstDayOfWeek
|
|
51
|
-
} = props;
|
|
52
|
-
let {styleProps} = useStyleProps(props);
|
|
53
|
-
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/calendar');
|
|
54
|
-
let {direction} = useLocale();
|
|
55
|
-
let currentMonth = state.visibleRange.start;
|
|
56
|
-
let monthDateFormatter = useDateFormatter({
|
|
57
|
-
month: 'long',
|
|
58
|
-
year: 'numeric',
|
|
59
|
-
era: currentMonth.calendar.identifier === 'gregory' && currentMonth.era === 'BC' ? 'short' : undefined,
|
|
60
|
-
calendar: currentMonth.calendar.identifier,
|
|
61
|
-
timeZone: state.timeZone
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
let titles: JSX.Element[] = [];
|
|
65
|
-
let calendars: JSX.Element[] = [];
|
|
66
|
-
for (let i = 0; i < visibleMonths; i++) {
|
|
67
|
-
let d = currentMonth.add({months: i});
|
|
68
|
-
titles.push(
|
|
69
|
-
<div key={i} className={classNames(styles, 'spectrum-Calendar-monthHeader')}>
|
|
70
|
-
{i === 0 &&
|
|
71
|
-
<ActionButton
|
|
72
|
-
{...prevButtonProps}
|
|
73
|
-
UNSAFE_className={classNames(styles, 'spectrum-Calendar-prevMonth')}
|
|
74
|
-
isQuiet>
|
|
75
|
-
{direction === 'rtl' ? <ChevronRight /> : <ChevronLeft />}
|
|
76
|
-
</ActionButton>
|
|
77
|
-
}
|
|
78
|
-
<h2
|
|
79
|
-
// We have a visually hidden heading describing the entire visible range,
|
|
80
|
-
// and the calendar itself describes the individual month
|
|
81
|
-
// so we don't need to repeat that here for screen reader users.
|
|
82
|
-
aria-hidden
|
|
83
|
-
className={classNames(styles, 'spectrum-Calendar-title')}>
|
|
84
|
-
{getCurrentMonthName(d, state.timeZone, monthDateFormatter)}
|
|
85
|
-
</h2>
|
|
86
|
-
{i === visibleMonths - 1 &&
|
|
87
|
-
<ActionButton
|
|
88
|
-
{...nextButtonProps}
|
|
89
|
-
UNSAFE_className={classNames(styles, 'spectrum-Calendar-nextMonth')}
|
|
90
|
-
isQuiet>
|
|
91
|
-
{direction === 'rtl' ? <ChevronLeft /> : <ChevronRight />}
|
|
92
|
-
</ActionButton>
|
|
93
|
-
}
|
|
94
|
-
</div>
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
calendars.push(
|
|
98
|
-
<CalendarMonth
|
|
99
|
-
{...props}
|
|
100
|
-
key={i}
|
|
101
|
-
state={state}
|
|
102
|
-
startDate={d}
|
|
103
|
-
firstDayOfWeek={firstDayOfWeek} />
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<div
|
|
109
|
-
{...styleProps}
|
|
110
|
-
{...calendarProps}
|
|
111
|
-
ref={ref}
|
|
112
|
-
className={
|
|
113
|
-
classNames(styles,
|
|
114
|
-
'spectrum-Calendar',
|
|
115
|
-
styleProps.className
|
|
116
|
-
)
|
|
117
|
-
}>
|
|
118
|
-
{/* Add a screen reader only description of the entire visible range rather than
|
|
119
|
-
* a separate heading above each month grid. This is placed first in the DOM order
|
|
120
|
-
* so that it is the first thing a touch screen reader user encounters.
|
|
121
|
-
* In addition, VoiceOver on iOS does not announce the aria-label of the grid
|
|
122
|
-
* elements, so the aria-label of the Calendar is included here as well. */}
|
|
123
|
-
<VisuallyHidden>
|
|
124
|
-
<h2>{calendarProps['aria-label']}</h2>
|
|
125
|
-
</VisuallyHidden>
|
|
126
|
-
<div className={classNames(styles, 'spectrum-Calendar-header')}>
|
|
127
|
-
{titles}
|
|
128
|
-
</div>
|
|
129
|
-
<div className={classNames(styles, 'spectrum-Calendar-months')}>
|
|
130
|
-
{calendars}
|
|
131
|
-
</div>
|
|
132
|
-
{/* For touch screen readers, add a visually hidden next button after the month grid
|
|
133
|
-
* so it's easy to navigate after reaching the end without going all the way
|
|
134
|
-
* back to the start of the month. */}
|
|
135
|
-
<VisuallyHidden>
|
|
136
|
-
<button
|
|
137
|
-
aria-label={nextButtonProps['aria-label']}
|
|
138
|
-
disabled={nextButtonProps.isDisabled}
|
|
139
|
-
onClick={() => state.focusNextPage()}
|
|
140
|
-
tabIndex={-1} />
|
|
141
|
-
</VisuallyHidden>
|
|
142
|
-
{state.isValueInvalid &&
|
|
143
|
-
<HelpText
|
|
144
|
-
showErrorIcon
|
|
145
|
-
errorMessage={props.errorMessage || stringFormatter.format('invalidSelection', {selectedCount: 'highlightedRange' in state ? 2 : 1})}
|
|
146
|
-
errorMessageProps={errorMessageProps}
|
|
147
|
-
isInvalid
|
|
148
|
-
// Intentionally a global class name so it can be targeted in DatePicker CSS...
|
|
149
|
-
UNSAFE_className="spectrum-Calendar-helpText" />
|
|
150
|
-
}
|
|
151
|
-
</div>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function getCurrentMonthName(date: CalendarDate, timezone: string, monthDateFormatter: ReturnType<typeof useDateFormatter>): string {
|
|
156
|
-
if (date.calendar.getFormattableMonth) {
|
|
157
|
-
date = date.calendar.getFormattableMonth(date);
|
|
158
|
-
}
|
|
159
|
-
return monthDateFormatter.format(date.toDate(timezone));
|
|
160
|
-
}
|
package/src/CalendarCell.tsx
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {AriaCalendarCellProps, useCalendarCell} from '@react-aria/calendar';
|
|
14
|
-
import {CalendarDate, getDayOfWeek, isSameDay, isSameMonth, isToday} from '@internationalized/date';
|
|
15
|
-
import {CalendarState, RangeCalendarState} from '@react-stately/calendar';
|
|
16
|
-
import {classNames} from '@react-spectrum/utils';
|
|
17
|
-
import {mergeProps} from '@react-aria/utils';
|
|
18
|
-
import React, {JSX, useRef} from 'react';
|
|
19
|
-
import styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';
|
|
20
|
-
import {useFocusRing} from '@react-aria/focus';
|
|
21
|
-
import {useHover} from '@react-aria/interactions';
|
|
22
|
-
import {useLocale} from '@react-aria/i18n';
|
|
23
|
-
|
|
24
|
-
interface CalendarCellProps extends AriaCalendarCellProps {
|
|
25
|
-
state: CalendarState | RangeCalendarState,
|
|
26
|
-
currentMonth: CalendarDate,
|
|
27
|
-
firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function CalendarCell({state, currentMonth, firstDayOfWeek, ...props}: CalendarCellProps): JSX.Element {
|
|
31
|
-
let ref = useRef<HTMLElement>(null);
|
|
32
|
-
let {
|
|
33
|
-
cellProps,
|
|
34
|
-
buttonProps,
|
|
35
|
-
isPressed,
|
|
36
|
-
isSelected,
|
|
37
|
-
isDisabled,
|
|
38
|
-
isFocused,
|
|
39
|
-
isInvalid,
|
|
40
|
-
formattedDate
|
|
41
|
-
} = useCalendarCell({
|
|
42
|
-
...props,
|
|
43
|
-
isDisabled: !isSameMonth(props.date, currentMonth)
|
|
44
|
-
}, state, ref);
|
|
45
|
-
let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;
|
|
46
|
-
let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({days: 1}));
|
|
47
|
-
let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({days: 1}));
|
|
48
|
-
let highlightedRange = 'highlightedRange' in state && state.highlightedRange;
|
|
49
|
-
let isSelectionStart = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.start);
|
|
50
|
-
let isSelectionEnd = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.end);
|
|
51
|
-
let {locale} = useLocale();
|
|
52
|
-
let dayOfWeek = getDayOfWeek(props.date, locale, firstDayOfWeek);
|
|
53
|
-
let isRangeStart = isSelected && (isFirstSelectedAfterDisabled || dayOfWeek === 0 || props.date.day === 1);
|
|
54
|
-
let isRangeEnd = isSelected && (isLastSelectedBeforeDisabled || dayOfWeek === 6 || props.date.day === currentMonth.calendar.getDaysInMonth(currentMonth));
|
|
55
|
-
let {focusProps, isFocusVisible} = useFocusRing();
|
|
56
|
-
let {hoverProps, isHovered} = useHover({isDisabled: isDisabled || isUnavailable || state.isReadOnly});
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<td
|
|
60
|
-
{...cellProps}
|
|
61
|
-
className={classNames(styles, 'spectrum-Calendar-tableCell')}>
|
|
62
|
-
<span
|
|
63
|
-
{...mergeProps(buttonProps, hoverProps, focusProps)}
|
|
64
|
-
ref={ref}
|
|
65
|
-
className={classNames(styles, 'spectrum-Calendar-date', {
|
|
66
|
-
'is-today': isToday(props.date, state.timeZone),
|
|
67
|
-
'is-selected': isSelected,
|
|
68
|
-
'is-focused': isFocused && isFocusVisible,
|
|
69
|
-
// Style disabled (i.e. out of min/max range), but selected dates as unavailable
|
|
70
|
-
// since it is more clear than trying to dim the selection.
|
|
71
|
-
'is-disabled': isDisabled && !isInvalid,
|
|
72
|
-
'is-unavailable': isUnavailable || (isInvalid && isDisabled),
|
|
73
|
-
'is-outsideMonth': !isSameMonth(props.date, currentMonth),
|
|
74
|
-
'is-range-start': isRangeStart,
|
|
75
|
-
'is-range-end': isRangeEnd,
|
|
76
|
-
'is-range-selection': isSelected && 'highlightedRange' in state,
|
|
77
|
-
'is-selection-start': isSelectionStart,
|
|
78
|
-
'is-selection-end': isSelectionEnd,
|
|
79
|
-
'is-hovered': isHovered,
|
|
80
|
-
'is-pressed': isPressed && !state.isReadOnly,
|
|
81
|
-
'is-invalid': isInvalid
|
|
82
|
-
})}>
|
|
83
|
-
<span className={classNames(styles, 'spectrum-Calendar-dateText')}>
|
|
84
|
-
<span>{formattedDate}</span>
|
|
85
|
-
</span>
|
|
86
|
-
</span>
|
|
87
|
-
</td>
|
|
88
|
-
);
|
|
89
|
-
}
|