@react-spectrum/calendar 3.4.7 → 3.4.8

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.
Files changed (78) hide show
  1. package/dist/Calendar.main.js +78 -0
  2. package/dist/Calendar.main.js.map +1 -0
  3. package/dist/Calendar.mjs +69 -0
  4. package/dist/Calendar.module.js +69 -0
  5. package/dist/Calendar.module.js.map +1 -0
  6. package/dist/CalendarBase.main.js +116 -0
  7. package/dist/CalendarBase.main.js.map +1 -0
  8. package/dist/CalendarBase.mjs +111 -0
  9. package/dist/CalendarBase.module.js +111 -0
  10. package/dist/CalendarBase.module.js.map +1 -0
  11. package/dist/CalendarCell.main.js +95 -0
  12. package/dist/CalendarCell.main.js.map +1 -0
  13. package/dist/CalendarCell.mjs +90 -0
  14. package/dist/CalendarCell.module.js +90 -0
  15. package/dist/CalendarCell.module.js.map +1 -0
  16. package/dist/CalendarMonth.main.js +68 -0
  17. package/dist/CalendarMonth.main.js.map +1 -0
  18. package/dist/CalendarMonth.mjs +63 -0
  19. package/dist/CalendarMonth.module.js +63 -0
  20. package/dist/CalendarMonth.module.js.map +1 -0
  21. package/dist/RangeCalendar.main.js +78 -0
  22. package/dist/RangeCalendar.main.js.map +1 -0
  23. package/dist/RangeCalendar.mjs +69 -0
  24. package/dist/RangeCalendar.module.js +69 -0
  25. package/dist/RangeCalendar.module.js.map +1 -0
  26. package/dist/ar-AE.mjs +1 -1
  27. package/dist/bg-BG.mjs +1 -1
  28. package/dist/calendar_vars_css.main.js +116 -0
  29. package/dist/calendar_vars_css.main.js.map +1 -0
  30. package/dist/calendar_vars_css.mjs +118 -0
  31. package/dist/calendar_vars_css.module.js +118 -0
  32. package/dist/calendar_vars_css.module.js.map +1 -0
  33. package/dist/cs-CZ.mjs +1 -1
  34. package/dist/da-DK.mjs +1 -1
  35. package/dist/de-DE.mjs +1 -1
  36. package/dist/el-GR.mjs +1 -1
  37. package/dist/en-US.mjs +1 -1
  38. package/dist/es-ES.mjs +1 -1
  39. package/dist/et-EE.mjs +1 -1
  40. package/dist/fi-FI.mjs +1 -1
  41. package/dist/fr-FR.mjs +1 -1
  42. package/dist/he-IL.mjs +1 -1
  43. package/dist/hr-HR.mjs +1 -1
  44. package/dist/hu-HU.mjs +1 -1
  45. package/dist/import.mjs +2 -565
  46. package/dist/intlStrings.main.js +108 -0
  47. package/dist/intlStrings.main.js.map +1 -0
  48. package/dist/intlStrings.mjs +110 -0
  49. package/dist/intlStrings.module.js +110 -0
  50. package/dist/intlStrings.module.js.map +1 -0
  51. package/dist/it-IT.mjs +1 -1
  52. package/dist/ja-JP.mjs +1 -1
  53. package/dist/ko-KR.mjs +1 -1
  54. package/dist/lt-LT.mjs +1 -1
  55. package/dist/lv-LV.mjs +1 -1
  56. package/dist/main.js +4 -563
  57. package/dist/main.js.map +1 -1
  58. package/dist/module.js +2 -565
  59. package/dist/module.js.map +1 -1
  60. package/dist/nb-NO.mjs +1 -1
  61. package/dist/nl-NL.mjs +1 -1
  62. package/dist/pl-PL.mjs +1 -1
  63. package/dist/pt-BR.mjs +1 -1
  64. package/dist/pt-PT.mjs +1 -1
  65. package/dist/ro-RO.mjs +1 -1
  66. package/dist/ru-RU.mjs +1 -1
  67. package/dist/sk-SK.mjs +1 -1
  68. package/dist/sl-SI.mjs +1 -1
  69. package/dist/sr-SP.mjs +1 -1
  70. package/dist/sv-SE.mjs +1 -1
  71. package/dist/tr-TR.mjs +1 -1
  72. package/dist/uk-UA.mjs +1 -1
  73. package/dist/{main.css → vars.3977de0b.css} +45 -111
  74. package/dist/vars.3977de0b.css.map +1 -0
  75. package/dist/zh-CN.mjs +1 -1
  76. package/dist/zh-TW.mjs +1 -1
  77. package/package.json +18 -18
  78. package/dist/main.css.map +0 -1
@@ -0,0 +1,95 @@
1
+ require("./vars.3977de0b.css");
2
+ var $915891ae6206caad$exports = require("./calendar_vars_css.main.js");
3
+ var $1NqcN$reactariacalendar = require("@react-aria/calendar");
4
+ var $1NqcN$internationalizeddate = require("@internationalized/date");
5
+ var $1NqcN$reactspectrumutils = require("@react-spectrum/utils");
6
+ var $1NqcN$reactariautils = require("@react-aria/utils");
7
+ var $1NqcN$react = require("react");
8
+ var $1NqcN$reactariafocus = require("@react-aria/focus");
9
+ var $1NqcN$reactariainteractions = require("@react-aria/interactions");
10
+ var $1NqcN$reactariai18n = require("@react-aria/i18n");
11
+
12
+
13
+ function $parcel$interopDefault(a) {
14
+ return a && a.__esModule ? a.default : a;
15
+ }
16
+
17
+ function $parcel$export(e, n, v, s) {
18
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
+ }
20
+
21
+ $parcel$export(module.exports, "CalendarCell", () => $52c7c3c887827b64$export$5d847498420df57b);
22
+ /*
23
+ * Copyright 2020 Adobe. All rights reserved.
24
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
25
+ * you may not use this file except in compliance with the License. You may obtain a copy
26
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
27
+ *
28
+ * Unless required by applicable law or agreed to in writing, software distributed under
29
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
30
+ * OF ANY KIND, either express or implied. See the License for the specific language
31
+ * governing permissions and limitations under the License.
32
+ */
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+ function $52c7c3c887827b64$export$5d847498420df57b({ state: state, currentMonth: currentMonth, ...props }) {
42
+ let ref = (0, $1NqcN$react.useRef)();
43
+ let { cellProps: cellProps, buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled, isFocused: isFocused, isInvalid: isInvalid, formattedDate: formattedDate } = (0, $1NqcN$reactariacalendar.useCalendarCell)({
44
+ ...props,
45
+ isDisabled: !(0, $1NqcN$internationalizeddate.isSameMonth)(props.date, currentMonth)
46
+ }, state, ref);
47
+ let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;
48
+ let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({
49
+ days: 1
50
+ }));
51
+ let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({
52
+ days: 1
53
+ }));
54
+ let highlightedRange = "highlightedRange" in state && state.highlightedRange;
55
+ let isSelectionStart = isSelected && highlightedRange && (0, $1NqcN$internationalizeddate.isSameDay)(props.date, highlightedRange.start);
56
+ let isSelectionEnd = isSelected && highlightedRange && (0, $1NqcN$internationalizeddate.isSameDay)(props.date, highlightedRange.end);
57
+ let { locale: locale } = (0, $1NqcN$reactariai18n.useLocale)();
58
+ let dayOfWeek = (0, $1NqcN$internationalizeddate.getDayOfWeek)(props.date, locale);
59
+ let isRangeStart = isSelected && (isFirstSelectedAfterDisabled || dayOfWeek === 0 || props.date.day === 1);
60
+ let isRangeEnd = isSelected && (isLastSelectedBeforeDisabled || dayOfWeek === 6 || props.date.day === currentMonth.calendar.getDaysInMonth(currentMonth));
61
+ let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $1NqcN$reactariafocus.useFocusRing)();
62
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1NqcN$reactariainteractions.useHover)({
63
+ isDisabled: isDisabled || isUnavailable || state.isReadOnly
64
+ });
65
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($1NqcN$react))).createElement("td", {
66
+ ...cellProps,
67
+ className: (0, $1NqcN$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), "spectrum-Calendar-tableCell")
68
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1NqcN$react))).createElement("span", {
69
+ ...(0, $1NqcN$reactariautils.mergeProps)(buttonProps, hoverProps, focusProps),
70
+ ref: ref,
71
+ className: (0, $1NqcN$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), "spectrum-Calendar-date", {
72
+ "is-today": (0, $1NqcN$internationalizeddate.isToday)(props.date, state.timeZone),
73
+ "is-selected": isSelected,
74
+ "is-focused": isFocused && isFocusVisible,
75
+ // Style disabled (i.e. out of min/max range), but selected dates as unavailable
76
+ // since it is more clear than trying to dim the selection.
77
+ "is-disabled": isDisabled && !isInvalid,
78
+ "is-unavailable": isUnavailable || isInvalid && isDisabled,
79
+ "is-outsideMonth": !(0, $1NqcN$internationalizeddate.isSameMonth)(props.date, currentMonth),
80
+ "is-range-start": isRangeStart,
81
+ "is-range-end": isRangeEnd,
82
+ "is-range-selection": isSelected && "highlightedRange" in state,
83
+ "is-selection-start": isSelectionStart,
84
+ "is-selection-end": isSelectionEnd,
85
+ "is-hovered": isHovered,
86
+ "is-pressed": isPressed && !state.isReadOnly,
87
+ "is-invalid": isInvalid
88
+ })
89
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1NqcN$react))).createElement("span", {
90
+ className: (0, $1NqcN$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), "spectrum-Calendar-dateText")
91
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1NqcN$react))).createElement("span", null, formattedDate))));
92
+ }
93
+
94
+
95
+ //# sourceMappingURL=CalendarCell.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAkBM,SAAS,0CAAa,SAAC,KAAK,gBAAE,YAAY,EAAE,GAAG,OAAyB;IAC7E,IAAI,MAAM,CAAA,GAAA,mBAAK;IACf,IAAI,aACF,SAAS,eACT,WAAW,aACX,SAAS,cACT,UAAU,cACV,UAAU,aACV,SAAS,aACT,SAAS,iBACT,aAAa,EACd,GAAG,CAAA,GAAA,wCAAc,EAAE;QAClB,GAAG,KAAK;QACR,YAAY,CAAC,CAAA,GAAA,wCAAU,EAAE,MAAM,IAAI,EAAE;IACvC,GAAG,OAAO;IACV,IAAI,gBAAgB,MAAM,iBAAiB,CAAC,MAAM,IAAI,KAAK,CAAC;IAC5D,IAAI,+BAA+B,CAAC,cAAc,CAAC,aAAa,MAAM,iBAAiB,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC;QAAC,MAAM;IAAC;IAC/G,IAAI,+BAA+B,CAAC,cAAc,CAAC,aAAa,MAAM,iBAAiB,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC;QAAC,MAAM;IAAC;IACpH,IAAI,mBAAmB,sBAAsB,SAAS,MAAM,gBAAgB;IAC5E,IAAI,mBAAmB,cAAc,oBAAoB,CAAA,GAAA,sCAAQ,EAAE,MAAM,IAAI,EAAE,iBAAiB,KAAK;IACrG,IAAI,iBAAiB,cAAc,oBAAoB,CAAA,GAAA,sCAAQ,EAAE,MAAM,IAAI,EAAE,iBAAiB,GAAG;IACjG,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,YAAY,CAAA,GAAA,yCAAW,EAAE,MAAM,IAAI,EAAE;IACzC,IAAI,eAAe,cAAe,CAAA,gCAAgC,cAAc,KAAK,MAAM,IAAI,CAAC,GAAG,KAAK,CAAA;IACxG,IAAI,aAAa,cAAe,CAAA,gCAAgC,cAAc,KAAK,MAAM,IAAI,CAAC,GAAG,KAAK,aAAa,QAAQ,CAAC,cAAc,CAAC,aAAY;IACvJ,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,kCAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QAAC,YAAY,cAAc,iBAAiB,MAAM,UAAU;IAAA;IAEnG,qBACE,0DAAC;QACE,GAAG,SAAS;QACb,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAC9B,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,YAAY,WAAW;QACnD,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,0BAA0B;YACtD,YAAY,CAAA,GAAA,oCAAM,EAAE,MAAM,IAAI,EAAE,MAAM,QAAQ;YAC9C,eAAe;YACf,cAAc,aAAa;YAC3B,gFAAgF;YAChF,2DAA2D;YAC3D,eAAe,cAAc,CAAC;YAC9B,kBAAkB,iBAAkB,aAAa;YACjD,mBAAmB,CAAC,CAAA,GAAA,wCAAU,EAAE,MAAM,IAAI,EAAE;YAC5C,kBAAkB;YAClB,gBAAgB;YAChB,sBAAsB,cAAc,sBAAsB;YAC1D,sBAAsB;YACtB,oBAAoB;YACpB,cAAc;YACd,cAAc,aAAa,CAAC,MAAM,UAAU;YAC5C,cAAc;QAChB;qBACA,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAClC,0DAAC,cAAM;AAKjB","sources":["packages/@react-spectrum/calendar/src/CalendarCell.tsx"],"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 {AriaCalendarCellProps, useCalendarCell} from '@react-aria/calendar';\nimport {CalendarDate, getDayOfWeek, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface CalendarCellProps extends AriaCalendarCellProps {\n state: CalendarState | RangeCalendarState,\n currentMonth: CalendarDate\n}\n\nexport function CalendarCell({state, currentMonth, ...props}: CalendarCellProps) {\n let ref = useRef<HTMLElement>();\n let {\n cellProps,\n buttonProps,\n isPressed,\n isSelected,\n isDisabled,\n isFocused,\n isInvalid,\n formattedDate\n } = useCalendarCell({\n ...props,\n isDisabled: !isSameMonth(props.date, currentMonth)\n }, state, ref);\n let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;\n let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({days: 1}));\n let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({days: 1}));\n let highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n let isSelectionStart = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.start);\n let isSelectionEnd = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.end);\n let {locale} = useLocale();\n let dayOfWeek = getDayOfWeek(props.date, locale);\n let isRangeStart = isSelected && (isFirstSelectedAfterDisabled || dayOfWeek === 0 || props.date.day === 1);\n let isRangeEnd = isSelected && (isLastSelectedBeforeDisabled || dayOfWeek === 6 || props.date.day === currentMonth.calendar.getDaysInMonth(currentMonth));\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({isDisabled: isDisabled || isUnavailable || state.isReadOnly});\n\n return (\n <td\n {...cellProps}\n className={classNames(styles, 'spectrum-Calendar-tableCell')}>\n <span\n {...mergeProps(buttonProps, hoverProps, focusProps)}\n ref={ref}\n className={classNames(styles, 'spectrum-Calendar-date', {\n 'is-today': isToday(props.date, state.timeZone),\n 'is-selected': isSelected,\n 'is-focused': isFocused && isFocusVisible,\n // Style disabled (i.e. out of min/max range), but selected dates as unavailable\n // since it is more clear than trying to dim the selection.\n 'is-disabled': isDisabled && !isInvalid,\n 'is-unavailable': isUnavailable || (isInvalid && isDisabled),\n 'is-outsideMonth': !isSameMonth(props.date, currentMonth),\n 'is-range-start': isRangeStart,\n 'is-range-end': isRangeEnd,\n 'is-range-selection': isSelected && 'highlightedRange' in state,\n 'is-selection-start': isSelectionStart,\n 'is-selection-end': isSelectionEnd,\n 'is-hovered': isHovered,\n 'is-pressed': isPressed && !state.isReadOnly,\n 'is-invalid': isInvalid\n })}>\n <span className={classNames(styles, 'spectrum-Calendar-dateText')}>\n <span>{formattedDate}</span>\n </span>\n </span>\n </td>\n );\n}\n"],"names":[],"version":3,"file":"CalendarCell.main.js.map"}
@@ -0,0 +1,90 @@
1
+ import "./vars.3977de0b.css";
2
+ import $1nHC4$calendar_vars_cssmodulejs from "./calendar_vars_css.mjs";
3
+ import {useCalendarCell as $1nHC4$useCalendarCell} from "@react-aria/calendar";
4
+ import {isSameMonth as $1nHC4$isSameMonth, isSameDay as $1nHC4$isSameDay, getDayOfWeek as $1nHC4$getDayOfWeek, isToday as $1nHC4$isToday} from "@internationalized/date";
5
+ import {classNames as $1nHC4$classNames} from "@react-spectrum/utils";
6
+ import {mergeProps as $1nHC4$mergeProps} from "@react-aria/utils";
7
+ import $1nHC4$react, {useRef as $1nHC4$useRef} from "react";
8
+ import {useFocusRing as $1nHC4$useFocusRing} from "@react-aria/focus";
9
+ import {useHover as $1nHC4$useHover} from "@react-aria/interactions";
10
+ import {useLocale as $1nHC4$useLocale} from "@react-aria/i18n";
11
+
12
+
13
+ function $parcel$interopDefault(a) {
14
+ return a && a.__esModule ? a.default : a;
15
+ }
16
+ /*
17
+ * Copyright 2020 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License. You may obtain a copy
20
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software distributed under
23
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
+ * OF ANY KIND, either express or implied. See the License for the specific language
25
+ * governing permissions and limitations under the License.
26
+ */
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ function $453c556b9066da11$export$5d847498420df57b({ state: state, currentMonth: currentMonth, ...props }) {
36
+ let ref = (0, $1nHC4$useRef)();
37
+ let { cellProps: cellProps, buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled, isFocused: isFocused, isInvalid: isInvalid, formattedDate: formattedDate } = (0, $1nHC4$useCalendarCell)({
38
+ ...props,
39
+ isDisabled: !(0, $1nHC4$isSameMonth)(props.date, currentMonth)
40
+ }, state, ref);
41
+ let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;
42
+ let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({
43
+ days: 1
44
+ }));
45
+ let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({
46
+ days: 1
47
+ }));
48
+ let highlightedRange = "highlightedRange" in state && state.highlightedRange;
49
+ let isSelectionStart = isSelected && highlightedRange && (0, $1nHC4$isSameDay)(props.date, highlightedRange.start);
50
+ let isSelectionEnd = isSelected && highlightedRange && (0, $1nHC4$isSameDay)(props.date, highlightedRange.end);
51
+ let { locale: locale } = (0, $1nHC4$useLocale)();
52
+ let dayOfWeek = (0, $1nHC4$getDayOfWeek)(props.date, locale);
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: focusProps, isFocusVisible: isFocusVisible } = (0, $1nHC4$useFocusRing)();
56
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1nHC4$useHover)({
57
+ isDisabled: isDisabled || isUnavailable || state.isReadOnly
58
+ });
59
+ return /*#__PURE__*/ (0, $1nHC4$react).createElement("td", {
60
+ ...cellProps,
61
+ className: (0, $1nHC4$classNames)((0, ($parcel$interopDefault($1nHC4$calendar_vars_cssmodulejs))), "spectrum-Calendar-tableCell")
62
+ }, /*#__PURE__*/ (0, $1nHC4$react).createElement("span", {
63
+ ...(0, $1nHC4$mergeProps)(buttonProps, hoverProps, focusProps),
64
+ ref: ref,
65
+ className: (0, $1nHC4$classNames)((0, ($parcel$interopDefault($1nHC4$calendar_vars_cssmodulejs))), "spectrum-Calendar-date", {
66
+ "is-today": (0, $1nHC4$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": !(0, $1nHC4$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
+ }, /*#__PURE__*/ (0, $1nHC4$react).createElement("span", {
84
+ className: (0, $1nHC4$classNames)((0, ($parcel$interopDefault($1nHC4$calendar_vars_cssmodulejs))), "spectrum-Calendar-dateText")
85
+ }, /*#__PURE__*/ (0, $1nHC4$react).createElement("span", null, formattedDate))));
86
+ }
87
+
88
+
89
+ export {$453c556b9066da11$export$5d847498420df57b as CalendarCell};
90
+ //# sourceMappingURL=CalendarCell.mjs.map
@@ -0,0 +1,90 @@
1
+ import "./vars.3977de0b.css";
2
+ import $1nHC4$calendar_vars_cssmodulejs from "./calendar_vars_css.module.js";
3
+ import {useCalendarCell as $1nHC4$useCalendarCell} from "@react-aria/calendar";
4
+ import {isSameMonth as $1nHC4$isSameMonth, isSameDay as $1nHC4$isSameDay, getDayOfWeek as $1nHC4$getDayOfWeek, isToday as $1nHC4$isToday} from "@internationalized/date";
5
+ import {classNames as $1nHC4$classNames} from "@react-spectrum/utils";
6
+ import {mergeProps as $1nHC4$mergeProps} from "@react-aria/utils";
7
+ import $1nHC4$react, {useRef as $1nHC4$useRef} from "react";
8
+ import {useFocusRing as $1nHC4$useFocusRing} from "@react-aria/focus";
9
+ import {useHover as $1nHC4$useHover} from "@react-aria/interactions";
10
+ import {useLocale as $1nHC4$useLocale} from "@react-aria/i18n";
11
+
12
+
13
+ function $parcel$interopDefault(a) {
14
+ return a && a.__esModule ? a.default : a;
15
+ }
16
+ /*
17
+ * Copyright 2020 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License. You may obtain a copy
20
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software distributed under
23
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
+ * OF ANY KIND, either express or implied. See the License for the specific language
25
+ * governing permissions and limitations under the License.
26
+ */
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ function $453c556b9066da11$export$5d847498420df57b({ state: state, currentMonth: currentMonth, ...props }) {
36
+ let ref = (0, $1nHC4$useRef)();
37
+ let { cellProps: cellProps, buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled, isFocused: isFocused, isInvalid: isInvalid, formattedDate: formattedDate } = (0, $1nHC4$useCalendarCell)({
38
+ ...props,
39
+ isDisabled: !(0, $1nHC4$isSameMonth)(props.date, currentMonth)
40
+ }, state, ref);
41
+ let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;
42
+ let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({
43
+ days: 1
44
+ }));
45
+ let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({
46
+ days: 1
47
+ }));
48
+ let highlightedRange = "highlightedRange" in state && state.highlightedRange;
49
+ let isSelectionStart = isSelected && highlightedRange && (0, $1nHC4$isSameDay)(props.date, highlightedRange.start);
50
+ let isSelectionEnd = isSelected && highlightedRange && (0, $1nHC4$isSameDay)(props.date, highlightedRange.end);
51
+ let { locale: locale } = (0, $1nHC4$useLocale)();
52
+ let dayOfWeek = (0, $1nHC4$getDayOfWeek)(props.date, locale);
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: focusProps, isFocusVisible: isFocusVisible } = (0, $1nHC4$useFocusRing)();
56
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1nHC4$useHover)({
57
+ isDisabled: isDisabled || isUnavailable || state.isReadOnly
58
+ });
59
+ return /*#__PURE__*/ (0, $1nHC4$react).createElement("td", {
60
+ ...cellProps,
61
+ className: (0, $1nHC4$classNames)((0, ($parcel$interopDefault($1nHC4$calendar_vars_cssmodulejs))), "spectrum-Calendar-tableCell")
62
+ }, /*#__PURE__*/ (0, $1nHC4$react).createElement("span", {
63
+ ...(0, $1nHC4$mergeProps)(buttonProps, hoverProps, focusProps),
64
+ ref: ref,
65
+ className: (0, $1nHC4$classNames)((0, ($parcel$interopDefault($1nHC4$calendar_vars_cssmodulejs))), "spectrum-Calendar-date", {
66
+ "is-today": (0, $1nHC4$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": !(0, $1nHC4$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
+ }, /*#__PURE__*/ (0, $1nHC4$react).createElement("span", {
84
+ className: (0, $1nHC4$classNames)((0, ($parcel$interopDefault($1nHC4$calendar_vars_cssmodulejs))), "spectrum-Calendar-dateText")
85
+ }, /*#__PURE__*/ (0, $1nHC4$react).createElement("span", null, formattedDate))));
86
+ }
87
+
88
+
89
+ export {$453c556b9066da11$export$5d847498420df57b as CalendarCell};
90
+ //# sourceMappingURL=CalendarCell.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAkBM,SAAS,0CAAa,SAAC,KAAK,gBAAE,YAAY,EAAE,GAAG,OAAyB;IAC7E,IAAI,MAAM,CAAA,GAAA,aAAK;IACf,IAAI,aACF,SAAS,eACT,WAAW,aACX,SAAS,cACT,UAAU,cACV,UAAU,aACV,SAAS,aACT,SAAS,iBACT,aAAa,EACd,GAAG,CAAA,GAAA,sBAAc,EAAE;QAClB,GAAG,KAAK;QACR,YAAY,CAAC,CAAA,GAAA,kBAAU,EAAE,MAAM,IAAI,EAAE;IACvC,GAAG,OAAO;IACV,IAAI,gBAAgB,MAAM,iBAAiB,CAAC,MAAM,IAAI,KAAK,CAAC;IAC5D,IAAI,+BAA+B,CAAC,cAAc,CAAC,aAAa,MAAM,iBAAiB,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC;QAAC,MAAM;IAAC;IAC/G,IAAI,+BAA+B,CAAC,cAAc,CAAC,aAAa,MAAM,iBAAiB,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC;QAAC,MAAM;IAAC;IACpH,IAAI,mBAAmB,sBAAsB,SAAS,MAAM,gBAAgB;IAC5E,IAAI,mBAAmB,cAAc,oBAAoB,CAAA,GAAA,gBAAQ,EAAE,MAAM,IAAI,EAAE,iBAAiB,KAAK;IACrG,IAAI,iBAAiB,cAAc,oBAAoB,CAAA,GAAA,gBAAQ,EAAE,MAAM,IAAI,EAAE,iBAAiB,GAAG;IACjG,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,YAAY,CAAA,GAAA,mBAAW,EAAE,MAAM,IAAI,EAAE;IACzC,IAAI,eAAe,cAAe,CAAA,gCAAgC,cAAc,KAAK,MAAM,IAAI,CAAC,GAAG,KAAK,CAAA;IACxG,IAAI,aAAa,cAAe,CAAA,gCAAgC,cAAc,KAAK,MAAM,IAAI,CAAC,GAAG,KAAK,aAAa,QAAQ,CAAC,cAAc,CAAC,aAAY;IACvJ,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,YAAY,cAAc,iBAAiB,MAAM,UAAU;IAAA;IAEnG,qBACE,gCAAC;QACE,GAAG,SAAS;QACb,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;qBAC9B,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,YAAY,WAAW;QACnD,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG,0BAA0B;YACtD,YAAY,CAAA,GAAA,cAAM,EAAE,MAAM,IAAI,EAAE,MAAM,QAAQ;YAC9C,eAAe;YACf,cAAc,aAAa;YAC3B,gFAAgF;YAChF,2DAA2D;YAC3D,eAAe,cAAc,CAAC;YAC9B,kBAAkB,iBAAkB,aAAa;YACjD,mBAAmB,CAAC,CAAA,GAAA,kBAAU,EAAE,MAAM,IAAI,EAAE;YAC5C,kBAAkB;YAClB,gBAAgB;YAChB,sBAAsB,cAAc,sBAAsB;YAC1D,sBAAsB;YACtB,oBAAoB;YACpB,cAAc;YACd,cAAc,aAAa,CAAC,MAAM,UAAU;YAC5C,cAAc;QAChB;qBACA,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;qBAClC,gCAAC,cAAM;AAKjB","sources":["packages/@react-spectrum/calendar/src/CalendarCell.tsx"],"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 {AriaCalendarCellProps, useCalendarCell} from '@react-aria/calendar';\nimport {CalendarDate, getDayOfWeek, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface CalendarCellProps extends AriaCalendarCellProps {\n state: CalendarState | RangeCalendarState,\n currentMonth: CalendarDate\n}\n\nexport function CalendarCell({state, currentMonth, ...props}: CalendarCellProps) {\n let ref = useRef<HTMLElement>();\n let {\n cellProps,\n buttonProps,\n isPressed,\n isSelected,\n isDisabled,\n isFocused,\n isInvalid,\n formattedDate\n } = useCalendarCell({\n ...props,\n isDisabled: !isSameMonth(props.date, currentMonth)\n }, state, ref);\n let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;\n let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({days: 1}));\n let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({days: 1}));\n let highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n let isSelectionStart = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.start);\n let isSelectionEnd = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.end);\n let {locale} = useLocale();\n let dayOfWeek = getDayOfWeek(props.date, locale);\n let isRangeStart = isSelected && (isFirstSelectedAfterDisabled || dayOfWeek === 0 || props.date.day === 1);\n let isRangeEnd = isSelected && (isLastSelectedBeforeDisabled || dayOfWeek === 6 || props.date.day === currentMonth.calendar.getDaysInMonth(currentMonth));\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({isDisabled: isDisabled || isUnavailable || state.isReadOnly});\n\n return (\n <td\n {...cellProps}\n className={classNames(styles, 'spectrum-Calendar-tableCell')}>\n <span\n {...mergeProps(buttonProps, hoverProps, focusProps)}\n ref={ref}\n className={classNames(styles, 'spectrum-Calendar-date', {\n 'is-today': isToday(props.date, state.timeZone),\n 'is-selected': isSelected,\n 'is-focused': isFocused && isFocusVisible,\n // Style disabled (i.e. out of min/max range), but selected dates as unavailable\n // since it is more clear than trying to dim the selection.\n 'is-disabled': isDisabled && !isInvalid,\n 'is-unavailable': isUnavailable || (isInvalid && isDisabled),\n 'is-outsideMonth': !isSameMonth(props.date, currentMonth),\n 'is-range-start': isRangeStart,\n 'is-range-end': isRangeEnd,\n 'is-range-selection': isSelected && 'highlightedRange' in state,\n 'is-selection-start': isSelectionStart,\n 'is-selection-end': isSelectionEnd,\n 'is-hovered': isHovered,\n 'is-pressed': isPressed && !state.isReadOnly,\n 'is-invalid': isInvalid\n })}>\n <span className={classNames(styles, 'spectrum-Calendar-dateText')}>\n <span>{formattedDate}</span>\n </span>\n </span>\n </td>\n );\n}\n"],"names":[],"version":3,"file":"CalendarCell.module.js.map"}
@@ -0,0 +1,68 @@
1
+ var $52c7c3c887827b64$exports = require("./CalendarCell.main.js");
2
+ require("./vars.3977de0b.css");
3
+ var $915891ae6206caad$exports = require("./calendar_vars_css.main.js");
4
+ var $4d66a$internationalizeddate = require("@internationalized/date");
5
+ var $4d66a$reactspectrumutils = require("@react-spectrum/utils");
6
+ var $4d66a$react = require("react");
7
+ var $4d66a$reactariacalendar = require("@react-aria/calendar");
8
+ var $4d66a$reactariai18n = require("@react-aria/i18n");
9
+
10
+
11
+ function $parcel$interopDefault(a) {
12
+ return a && a.__esModule ? a.default : a;
13
+ }
14
+
15
+ function $parcel$export(e, n, v, s) {
16
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
+ }
18
+
19
+ $parcel$export(module.exports, "CalendarMonth", () => $02c19eea15a72a7b$export$26e2752316b9a375);
20
+ /*
21
+ * Copyright 2020 Adobe. All rights reserved.
22
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License. You may obtain a copy
24
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software distributed under
27
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
+ * OF ANY KIND, either express or implied. See the License for the specific language
29
+ * governing permissions and limitations under the License.
30
+ */
31
+
32
+
33
+
34
+
35
+
36
+
37
+ function $02c19eea15a72a7b$export$26e2752316b9a375(props) {
38
+ let { state: state, startDate: startDate } = props;
39
+ let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $4d66a$reactariacalendar.useCalendarGrid)({
40
+ ...props,
41
+ endDate: (0, $4d66a$internationalizeddate.endOfMonth)(startDate)
42
+ }, state);
43
+ let { locale: locale } = (0, $4d66a$reactariai18n.useLocale)();
44
+ let weeksInMonth = (0, $4d66a$internationalizeddate.getWeeksInMonth)(startDate, locale);
45
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("table", {
46
+ ...gridProps,
47
+ className: (0, $4d66a$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), "spectrum-Calendar-body", "spectrum-Calendar-table")
48
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("thead", headerProps, /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("tr", null, weekDays.map((day, index)=>/*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("th", {
49
+ key: index,
50
+ className: (0, $4d66a$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), "spectrum-Calendar-tableCell")
51
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("span", {
52
+ className: (0, $4d66a$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), "spectrum-Calendar-dayOfWeek")
53
+ }, day))))), /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("tbody", null, [
54
+ ...new Array(weeksInMonth).keys()
55
+ ].map((weekIndex)=>/*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("tr", {
56
+ key: weekIndex
57
+ }, state.getDatesInWeek(weekIndex, startDate).map((date, i)=>date ? /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement((0, $52c7c3c887827b64$exports.CalendarCell), {
58
+ key: i,
59
+ state: state,
60
+ date: date,
61
+ currentMonth: startDate
62
+ }) : /*#__PURE__*/ (0, ($parcel$interopDefault($4d66a$react))).createElement("td", {
63
+ key: i
64
+ }))))));
65
+ }
66
+
67
+
68
+ //# sourceMappingURL=CalendarMonth.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,SACF,KAAK,aACL,SAAS,EACV,GAAG;IACJ,IAAI,aACF,SAAS,eACT,WAAW,YACX,QAAQ,EACT,GAAG,CAAA,GAAA,wCAAc,EAAE;QAClB,GAAG,KAAK;QACR,SAAS,CAAA,GAAA,uCAAS,EAAE;IACtB,GAAG;IAEH,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,eAAe,CAAA,GAAA,4CAAc,EAAE,WAAW;IAE9C,qBACE,0DAAC;QACE,GAAG,SAAS;QACb,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,0BAA0B;qBACxD,0DAAC,SAAU,2BACT,0DAAC,YACE,SAAS,GAAG,CAAC,CAAC,KAAK,sBAClB,0DAAC;YACC,KAAK;YACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;yBAC9B,0DAAC;YAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;WACjC,wBAMX,0DAAC,eACE;WAAI,IAAI,MAAM,cAAc,IAAI;KAAG,CAAC,GAAG,CAAC,CAAA,0BACvC,0DAAC;YAAG,KAAK;WACN,MAAM,cAAc,CAAC,WAAW,WAAW,GAAG,CAAC,CAAC,MAAM,IACrD,qBACE,0DAAC,CAAA,GAAA,sCAAW;gBACV,KAAK;gBACL,OAAO;gBACP,MAAM;gBACN,cAAc;+BACd,0DAAC;gBAAG,KAAK;;AAO3B","sources":["packages/@react-spectrum/calendar/src/CalendarMonth.tsx"],"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 {CalendarCell} from './CalendarCell';\nimport {CalendarDate, endOfMonth, getWeeksInMonth} from '@internationalized/date';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {DOMProps, StyleProps} from '@react-types/shared';\nimport React from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';\nimport {useCalendarGrid} from '@react-aria/calendar';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface CalendarMonthProps extends CalendarPropsBase, DOMProps, StyleProps {\n state: CalendarState | RangeCalendarState,\n startDate: CalendarDate\n}\n\nexport function CalendarMonth(props: CalendarMonthProps) {\n let {\n state,\n startDate\n } = props;\n let {\n gridProps,\n headerProps,\n weekDays\n } = useCalendarGrid({\n ...props,\n endDate: endOfMonth(startDate)\n }, state);\n\n let {locale} = useLocale();\n let weeksInMonth = getWeeksInMonth(startDate, locale);\n\n return (\n <table\n {...gridProps}\n className={classNames(styles, 'spectrum-Calendar-body', 'spectrum-Calendar-table')}>\n <thead {...headerProps}>\n <tr>\n {weekDays.map((day, index) => (\n <th\n key={index}\n className={classNames(styles, 'spectrum-Calendar-tableCell')}>\n <span className={classNames(styles, 'spectrum-Calendar-dayOfWeek')}>\n {day}\n </span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {[...new Array(weeksInMonth).keys()].map(weekIndex => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date ? (\n <CalendarCell\n key={i}\n state={state}\n date={date}\n currentMonth={startDate} />\n ) : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"],"names":[],"version":3,"file":"CalendarMonth.main.js.map"}
@@ -0,0 +1,63 @@
1
+ import {CalendarCell as $453c556b9066da11$export$5d847498420df57b} from "./CalendarCell.mjs";
2
+ import "./vars.3977de0b.css";
3
+ import $d434x$calendar_vars_cssmodulejs from "./calendar_vars_css.mjs";
4
+ import {endOfMonth as $d434x$endOfMonth, getWeeksInMonth as $d434x$getWeeksInMonth} from "@internationalized/date";
5
+ import {classNames as $d434x$classNames} from "@react-spectrum/utils";
6
+ import $d434x$react from "react";
7
+ import {useCalendarGrid as $d434x$useCalendarGrid} from "@react-aria/calendar";
8
+ import {useLocale as $d434x$useLocale} from "@react-aria/i18n";
9
+
10
+
11
+ function $parcel$interopDefault(a) {
12
+ return a && a.__esModule ? a.default : a;
13
+ }
14
+ /*
15
+ * Copyright 2020 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */
25
+
26
+
27
+
28
+
29
+
30
+
31
+ function $faa2f3867773cfe5$export$26e2752316b9a375(props) {
32
+ let { state: state, startDate: startDate } = props;
33
+ let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $d434x$useCalendarGrid)({
34
+ ...props,
35
+ endDate: (0, $d434x$endOfMonth)(startDate)
36
+ }, state);
37
+ let { locale: locale } = (0, $d434x$useLocale)();
38
+ let weeksInMonth = (0, $d434x$getWeeksInMonth)(startDate, locale);
39
+ return /*#__PURE__*/ (0, $d434x$react).createElement("table", {
40
+ ...gridProps,
41
+ className: (0, $d434x$classNames)((0, ($parcel$interopDefault($d434x$calendar_vars_cssmodulejs))), "spectrum-Calendar-body", "spectrum-Calendar-table")
42
+ }, /*#__PURE__*/ (0, $d434x$react).createElement("thead", headerProps, /*#__PURE__*/ (0, $d434x$react).createElement("tr", null, weekDays.map((day, index)=>/*#__PURE__*/ (0, $d434x$react).createElement("th", {
43
+ key: index,
44
+ className: (0, $d434x$classNames)((0, ($parcel$interopDefault($d434x$calendar_vars_cssmodulejs))), "spectrum-Calendar-tableCell")
45
+ }, /*#__PURE__*/ (0, $d434x$react).createElement("span", {
46
+ className: (0, $d434x$classNames)((0, ($parcel$interopDefault($d434x$calendar_vars_cssmodulejs))), "spectrum-Calendar-dayOfWeek")
47
+ }, day))))), /*#__PURE__*/ (0, $d434x$react).createElement("tbody", null, [
48
+ ...new Array(weeksInMonth).keys()
49
+ ].map((weekIndex)=>/*#__PURE__*/ (0, $d434x$react).createElement("tr", {
50
+ key: weekIndex
51
+ }, state.getDatesInWeek(weekIndex, startDate).map((date, i)=>date ? /*#__PURE__*/ (0, $d434x$react).createElement((0, $453c556b9066da11$export$5d847498420df57b), {
52
+ key: i,
53
+ state: state,
54
+ date: date,
55
+ currentMonth: startDate
56
+ }) : /*#__PURE__*/ (0, $d434x$react).createElement("td", {
57
+ key: i
58
+ }))))));
59
+ }
60
+
61
+
62
+ export {$faa2f3867773cfe5$export$26e2752316b9a375 as CalendarMonth};
63
+ //# sourceMappingURL=CalendarMonth.mjs.map
@@ -0,0 +1,63 @@
1
+ import {CalendarCell as $453c556b9066da11$export$5d847498420df57b} from "./CalendarCell.module.js";
2
+ import "./vars.3977de0b.css";
3
+ import $d434x$calendar_vars_cssmodulejs from "./calendar_vars_css.module.js";
4
+ import {endOfMonth as $d434x$endOfMonth, getWeeksInMonth as $d434x$getWeeksInMonth} from "@internationalized/date";
5
+ import {classNames as $d434x$classNames} from "@react-spectrum/utils";
6
+ import $d434x$react from "react";
7
+ import {useCalendarGrid as $d434x$useCalendarGrid} from "@react-aria/calendar";
8
+ import {useLocale as $d434x$useLocale} from "@react-aria/i18n";
9
+
10
+
11
+ function $parcel$interopDefault(a) {
12
+ return a && a.__esModule ? a.default : a;
13
+ }
14
+ /*
15
+ * Copyright 2020 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */
25
+
26
+
27
+
28
+
29
+
30
+
31
+ function $faa2f3867773cfe5$export$26e2752316b9a375(props) {
32
+ let { state: state, startDate: startDate } = props;
33
+ let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $d434x$useCalendarGrid)({
34
+ ...props,
35
+ endDate: (0, $d434x$endOfMonth)(startDate)
36
+ }, state);
37
+ let { locale: locale } = (0, $d434x$useLocale)();
38
+ let weeksInMonth = (0, $d434x$getWeeksInMonth)(startDate, locale);
39
+ return /*#__PURE__*/ (0, $d434x$react).createElement("table", {
40
+ ...gridProps,
41
+ className: (0, $d434x$classNames)((0, ($parcel$interopDefault($d434x$calendar_vars_cssmodulejs))), "spectrum-Calendar-body", "spectrum-Calendar-table")
42
+ }, /*#__PURE__*/ (0, $d434x$react).createElement("thead", headerProps, /*#__PURE__*/ (0, $d434x$react).createElement("tr", null, weekDays.map((day, index)=>/*#__PURE__*/ (0, $d434x$react).createElement("th", {
43
+ key: index,
44
+ className: (0, $d434x$classNames)((0, ($parcel$interopDefault($d434x$calendar_vars_cssmodulejs))), "spectrum-Calendar-tableCell")
45
+ }, /*#__PURE__*/ (0, $d434x$react).createElement("span", {
46
+ className: (0, $d434x$classNames)((0, ($parcel$interopDefault($d434x$calendar_vars_cssmodulejs))), "spectrum-Calendar-dayOfWeek")
47
+ }, day))))), /*#__PURE__*/ (0, $d434x$react).createElement("tbody", null, [
48
+ ...new Array(weeksInMonth).keys()
49
+ ].map((weekIndex)=>/*#__PURE__*/ (0, $d434x$react).createElement("tr", {
50
+ key: weekIndex
51
+ }, state.getDatesInWeek(weekIndex, startDate).map((date, i)=>date ? /*#__PURE__*/ (0, $d434x$react).createElement((0, $453c556b9066da11$export$5d847498420df57b), {
52
+ key: i,
53
+ state: state,
54
+ date: date,
55
+ currentMonth: startDate
56
+ }) : /*#__PURE__*/ (0, $d434x$react).createElement("td", {
57
+ key: i
58
+ }))))));
59
+ }
60
+
61
+
62
+ export {$faa2f3867773cfe5$export$26e2752316b9a375 as CalendarMonth};
63
+ //# sourceMappingURL=CalendarMonth.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,SACF,KAAK,aACL,SAAS,EACV,GAAG;IACJ,IAAI,aACF,SAAS,eACT,WAAW,YACX,QAAQ,EACT,GAAG,CAAA,GAAA,sBAAc,EAAE;QAClB,GAAG,KAAK;QACR,SAAS,CAAA,GAAA,iBAAS,EAAE;IACtB,GAAG;IAEH,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,eAAe,CAAA,GAAA,sBAAc,EAAE,WAAW;IAE9C,qBACE,gCAAC;QACE,GAAG,SAAS;QACb,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG,0BAA0B;qBACxD,gCAAC,SAAU,2BACT,gCAAC,YACE,SAAS,GAAG,CAAC,CAAC,KAAK,sBAClB,gCAAC;YACC,KAAK;YACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;yBAC9B,gCAAC;YAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;WACjC,wBAMX,gCAAC,eACE;WAAI,IAAI,MAAM,cAAc,IAAI;KAAG,CAAC,GAAG,CAAC,CAAA,0BACvC,gCAAC;YAAG,KAAK;WACN,MAAM,cAAc,CAAC,WAAW,WAAW,GAAG,CAAC,CAAC,MAAM,IACrD,qBACE,gCAAC,CAAA,GAAA,yCAAW;gBACV,KAAK;gBACL,OAAO;gBACP,MAAM;gBACN,cAAc;+BACd,gCAAC;gBAAG,KAAK;;AAO3B","sources":["packages/@react-spectrum/calendar/src/CalendarMonth.tsx"],"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 {CalendarCell} from './CalendarCell';\nimport {CalendarDate, endOfMonth, getWeeksInMonth} from '@internationalized/date';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {DOMProps, StyleProps} from '@react-types/shared';\nimport React from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';\nimport {useCalendarGrid} from '@react-aria/calendar';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface CalendarMonthProps extends CalendarPropsBase, DOMProps, StyleProps {\n state: CalendarState | RangeCalendarState,\n startDate: CalendarDate\n}\n\nexport function CalendarMonth(props: CalendarMonthProps) {\n let {\n state,\n startDate\n } = props;\n let {\n gridProps,\n headerProps,\n weekDays\n } = useCalendarGrid({\n ...props,\n endDate: endOfMonth(startDate)\n }, state);\n\n let {locale} = useLocale();\n let weeksInMonth = getWeeksInMonth(startDate, locale);\n\n return (\n <table\n {...gridProps}\n className={classNames(styles, 'spectrum-Calendar-body', 'spectrum-Calendar-table')}>\n <thead {...headerProps}>\n <tr>\n {weekDays.map((day, index) => (\n <th\n key={index}\n className={classNames(styles, 'spectrum-Calendar-tableCell')}>\n <span className={classNames(styles, 'spectrum-Calendar-dayOfWeek')}>\n {day}\n </span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {[...new Array(weeksInMonth).keys()].map(weekIndex => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date ? (\n <CalendarCell\n key={i}\n state={state}\n date={date}\n currentMonth={startDate} />\n ) : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"],"names":[],"version":3,"file":"CalendarMonth.module.js.map"}
@@ -0,0 +1,78 @@
1
+ var $6d416018158e3a26$exports = require("./CalendarBase.main.js");
2
+ var $j3Qmk$internationalizeddate = require("@internationalized/date");
3
+ var $j3Qmk$reactspectrumutils = require("@react-spectrum/utils");
4
+ var $j3Qmk$react = require("react");
5
+ var $j3Qmk$reactariai18n = require("@react-aria/i18n");
6
+ var $j3Qmk$reactspectrumprovider = require("@react-spectrum/provider");
7
+ var $j3Qmk$reactariacalendar = require("@react-aria/calendar");
8
+ var $j3Qmk$reactstatelycalendar = require("@react-stately/calendar");
9
+
10
+
11
+ function $parcel$interopDefault(a) {
12
+ return a && a.__esModule ? a.default : a;
13
+ }
14
+
15
+ function $parcel$export(e, n, v, s) {
16
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
+ }
18
+
19
+ $parcel$export(module.exports, "RangeCalendar", () => $4d045066f2092e3b$export$a4f5c8b89d277a8d);
20
+ /*
21
+ * Copyright 2020 Adobe. All rights reserved.
22
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License. You may obtain a copy
24
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software distributed under
27
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
+ * OF ANY KIND, either express or implied. See the License for the specific language
29
+ * governing permissions and limitations under the License.
30
+ */
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+ function $4d045066f2092e3b$var$RangeCalendar(props, ref) {
39
+ props = (0, $j3Qmk$reactspectrumprovider.useProviderProps)(props);
40
+ let { visibleMonths: visibleMonths = 1 } = props;
41
+ visibleMonths = Math.max(visibleMonths, 1);
42
+ let visibleDuration = (0, $j3Qmk$react.useMemo)(()=>({
43
+ months: visibleMonths
44
+ }), [
45
+ visibleMonths
46
+ ]);
47
+ let { locale: locale } = (0, $j3Qmk$reactariai18n.useLocale)();
48
+ let state = (0, $j3Qmk$reactstatelycalendar.useRangeCalendarState)({
49
+ ...props,
50
+ locale: locale,
51
+ visibleDuration: visibleDuration,
52
+ createCalendar: $j3Qmk$internationalizeddate.createCalendar
53
+ });
54
+ let domRef = (0, $j3Qmk$react.useRef)();
55
+ (0, $j3Qmk$react.useImperativeHandle)(ref, ()=>({
56
+ ...(0, $j3Qmk$reactspectrumutils.createDOMRef)(domRef),
57
+ focus () {
58
+ state.setFocused(true);
59
+ }
60
+ }));
61
+ let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps } = (0, $j3Qmk$reactariacalendar.useRangeCalendar)(props, state, domRef);
62
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($j3Qmk$react))).createElement((0, $6d416018158e3a26$exports.CalendarBase), {
63
+ ...props,
64
+ visibleMonths: visibleMonths,
65
+ state: state,
66
+ calendarRef: domRef,
67
+ calendarProps: calendarProps,
68
+ prevButtonProps: prevButtonProps,
69
+ nextButtonProps: nextButtonProps,
70
+ errorMessageProps: errorMessageProps
71
+ });
72
+ }
73
+ /**
74
+ * RangeCalendars display a grid of days in one or more months and allow users to select a contiguous range of dates.
75
+ */ const $4d045066f2092e3b$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, ($parcel$interopDefault($j3Qmk$react))).forwardRef($4d045066f2092e3b$var$RangeCalendar);
76
+
77
+
78
+ //# sourceMappingURL=RangeCalendar.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaD,SAAS,oCAAmC,KAAoC,EAAE,GAA8B;IAC9G,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,iBAAC,gBAAgB,GAAE,GAAG;IAC1B,gBAAgB,KAAK,GAAG,CAAC,eAAe;IACxC,IAAI,kBAAkB,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;YAAC,QAAQ;QAAa,CAAA,GAAI;QAAC;KAAc;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,iDAAoB,EAAE;QAChC,GAAG,KAAK;gBACR;yBACA;wBACA;IACF;IAEA,IAAI,SAAS,CAAA,GAAA,mBAAK;IAClB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;YACvB;gBACE,MAAM,UAAU,CAAC;YACnB;QACF,CAAA;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,yCAAe,EAAE,OAAO,OAAO;IAE1G,qBACE,0DAAC,CAAA,GAAA,sCAAW;QACT,GAAG,KAAK;QACT,eAAe;QACf,OAAO;QACP,aAAa;QACb,eAAe;QACf,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB;;AAEzB;AAEA;;CAEC,GACD,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/calendar/src/RangeCalendar.tsx"],"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 {CalendarBase} from './CalendarBase';\nimport {createCalendar} from '@internationalized/date';\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {DateValue, SpectrumRangeCalendarProps} from '@react-types/calendar';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {ReactElement, useImperativeHandle, useMemo, useRef} from 'react';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRangeCalendar} from '@react-aria/calendar';\nimport {useRangeCalendarState} from '@react-stately/calendar';\n\nfunction RangeCalendar<T extends DateValue>(props: SpectrumRangeCalendarProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n let {visibleMonths = 1} = props;\n visibleMonths = Math.max(visibleMonths, 1);\n let visibleDuration = useMemo(() => ({months: visibleMonths}), [visibleMonths]);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n visibleDuration,\n createCalendar\n });\n\n let domRef = useRef();\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n state.setFocused(true);\n }\n }));\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps} = useRangeCalendar(props, state, domRef);\n\n return (\n <CalendarBase\n {...props}\n visibleMonths={visibleMonths}\n state={state}\n calendarRef={domRef}\n calendarProps={calendarProps}\n prevButtonProps={prevButtonProps}\n nextButtonProps={nextButtonProps}\n errorMessageProps={errorMessageProps} />\n );\n}\n\n/**\n * RangeCalendars display a grid of days in one or more months and allow users to select a contiguous range of dates.\n */\nconst _RangeCalendar = React.forwardRef(RangeCalendar) as <T extends DateValue>(props: SpectrumRangeCalendarProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_RangeCalendar as RangeCalendar};\n"],"names":[],"version":3,"file":"RangeCalendar.main.js.map"}