@fluentui/react-calendar-compat 0.4.2 → 0.4.4
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/CHANGELOG.md +26 -2
- package/lib/components/Calendar/useCalendarStyles.styles.js +1 -0
- package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.raw.js +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.js +2 -1
- package/lib/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js +3 -10
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js +2 -9
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js +30 -8
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridRow.js +6 -5
- package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js +10 -3
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +16 -58
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +12 -67
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeeks.js +0 -1
- package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js +10 -4
- package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js +1 -0
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js +5 -33
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js +4 -41
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.js +17 -12
- package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js +1 -0
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.raw.js +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.raw.js.map +1 -1
- package/lib/utils/animations.js +24 -18
- package/lib/utils/animations.js.map +1 -1
- package/lib/utils/calendarMotions.js +93 -0
- package/lib/utils/calendarMotions.js.map +1 -0
- package/lib/utils/index.js +2 -2
- package/lib/utils/index.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js +1 -0
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js +2 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js +3 -15
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js +2 -9
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js +30 -8
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js +6 -5
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js +9 -3
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +16 -98
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +12 -67
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js +0 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js +10 -4
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js +1 -0
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js +6 -56
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js +4 -41
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.js +17 -12
- package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js +1 -0
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/utils/animations.js +12 -11
- package/lib-commonjs/utils/animations.js.map +1 -1
- package/lib-commonjs/utils/calendarMotions.js +105 -0
- package/lib-commonjs/utils/calendarMotions.js.map +1 -0
- package/lib-commonjs/utils/index.js +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-calendar-compat
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 29 Jun 2026 15:14:11 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.4.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-calendar-compat_v0.4.4)
|
|
8
|
+
|
|
9
|
+
Mon, 29 Jun 2026 15:14:11 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-calendar-compat_v0.4.3..@fluentui/react-calendar-compat_v0.4.4)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix(Calendar): year prev/next buttons don't lose focus when they become disabled ([PR #36343](https://github.com/microsoft/fluentui/pull/36343) by sarah.higley@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [0.4.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-calendar-compat_v0.4.3)
|
|
17
|
+
|
|
18
|
+
Wed, 24 Jun 2026 11:10:08 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-calendar-compat_v0.4.2..@fluentui/react-calendar-compat_v0.4.3)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- fix: remove redundant use no memo directives, and add justification to valid ones ([PR #36224](https://github.com/microsoft/fluentui/pull/36224) by martinhochel@microsoft.com)
|
|
24
|
+
- refactor(react-calendar): migrate to motion components ([PR #35666](https://github.com/microsoft/fluentui/pull/35666) by robertpenner@microsoft.com)
|
|
25
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.4 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
26
|
+
- Bump @fluentui/react-motion to v9.16.1 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
27
|
+
- Bump @fluentui/react-motion-components-preview to v0.15.6 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
28
|
+
- Bump @fluentui/react-tabster to v9.26.16 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
29
|
+
- Bump @fluentui/react-utilities to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
30
|
+
|
|
7
31
|
## [0.4.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-calendar-compat_v0.4.2)
|
|
8
32
|
|
|
9
|
-
Tue, 26 May 2026 09:
|
|
33
|
+
Tue, 26 May 2026 09:39:46 GMT
|
|
10
34
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-calendar-compat_v0.4.1..@fluentui/react-calendar-compat_v0.4.2)
|
|
11
35
|
|
|
12
36
|
### Patches
|
|
@@ -185,6 +185,7 @@ const useLiveRegionStyles = /*#__PURE__*/__styles({
|
|
|
185
185
|
export const useCalendarStyles_unstable = props => {
|
|
186
186
|
'use no memo';
|
|
187
187
|
|
|
188
|
+
// justified: compiler would optimize useCalendarStyles_unstable — manual opt-out to preserve runtime behavior
|
|
188
189
|
const rootStyles = useRootStyles();
|
|
189
190
|
const dividerStyles = useDividerStyles();
|
|
190
191
|
const monthPickerWrapperStyles = useMonthPickerWrapperStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","__styles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","p","useDividerStyles","h3c5rm","vrafjx","Bekrc4i","u1mtju","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","Bpg54ce","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bv6y5q5","uq1ffc","Bokaozi","Bfrni1f","Bkzqrjd","hu2duy","n9pfp1","dfw8yp","qugvs6","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","i8vvqc","g2u3we","B4j52fo","irswps","qhf8xq","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"sources":["useCalendarStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */ export const calendarClassNames = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion'\n};\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n monthPickerNotVisible: {\n flexDirection: 'column'\n },\n dayAndMonthPickersVisible: {\n width: '440px'\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px'\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px'\n }\n});\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0\n }\n});\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n '& div': {\n fontSize: tokens.fontSizeBase200\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall\n }\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none'\n }\n }\n});\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n * Apply styling to the Calendar slots based on the state\n *\n * @internal\n */ export const useCalendarStyles_unstable = (props)=>{\n 'use no memo'
|
|
1
|
+
{"version":3,"names":["tokens","__styles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","p","useDividerStyles","h3c5rm","vrafjx","Bekrc4i","u1mtju","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","Bpg54ce","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bv6y5q5","uq1ffc","Bokaozi","Bfrni1f","Bkzqrjd","hu2duy","n9pfp1","dfw8yp","qugvs6","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","i8vvqc","g2u3we","B4j52fo","irswps","qhf8xq","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"sources":["useCalendarStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */ export const calendarClassNames = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion'\n};\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n monthPickerNotVisible: {\n flexDirection: 'column'\n },\n dayAndMonthPickersVisible: {\n width: '440px'\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px'\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px'\n }\n});\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0\n }\n});\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n '& div': {\n fontSize: tokens.fontSizeBase200\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall\n }\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none'\n }\n }\n});\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n * Apply styling to the Calendar slots based on the state\n *\n * @internal\n */ export const useCalendarStyles_unstable = (props)=>{\n 'use no memo'; // justified: compiler would optimize useCalendarStyles_unstable — manual opt-out to preserve runtime behavior\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n const { className, isDayPickerVisible, isMonthPickerVisible, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarClassNames.root, rootStyles.base, rootStyles.normalize, !isMonthPickerVisible && rootStyles.monthPickerNotVisible, isDayPickerVisible && isMonthPickerVisible && !showWeekNumbers && rootStyles.dayAndMonthPickersVisible, isDayPickerVisible && !isMonthPickerVisible && showWeekNumbers && rootStyles.dayPickerVisibleAndWeekNumbersShown, isDayPickerVisible && isMonthPickerVisible && showWeekNumbers && rootStyles.dayAndMonthPickersVisibleAndWeekNumbersShown, className),\n divider: mergeClasses(calendarClassNames.divider, dividerStyles.base),\n monthPickerWrapper: mergeClasses(calendarClassNames.monthPickerWrapper, monthPickerWrapperStyles.base),\n goTodayButton: mergeClasses(calendarClassNames.goTodayButton, goTodayButtonStyles.base),\n liveRegion: mergeClasses(calendarClassNames.liveRegion, liveRegionStyles.base)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE;AACA;AACA;AAAI,OAAO,MAAMC,kBAAkB,GAAG;EAClCC,IAAI,EAAE,cAAc;EACpBC,OAAO,EAAE,uBAAuB;EAChCC,aAAa,EAAE,6BAA6B;EAC5CC,kBAAkB,EAAE,kCAAkC;EACtDC,UAAU,EAAE;AAChB,CAAC;AACD,MAAMC,aAAa,gBAAGT,QAAA;EAAAU,IAAA;IAAAC,MAAA;IAAAC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,MAAM;IAAEmB,SAAS;IAAEC,kBAAkB;IAAEC,oBAAoB;IAAEC;EAAgB,CAAC,GAAGT,KAAK;EACtF,OAAO;IACHlF,IAAI,EAAEH,YAAY,CAACE,kBAAkB,CAACC,IAAI,EAAEmF,UAAU,CAAC7E,IAAI,EAAE6E,UAAU,CAAC1E,SAAS,EAAE,CAACiF,oBAAoB,IAAIP,UAAU,CAAC7D,qBAAqB,EAAEmE,kBAAkB,IAAIC,oBAAoB,IAAI,CAACC,eAAe,IAAIR,UAAU,CAAC3D,yBAAyB,EAAEiE,kBAAkB,IAAI,CAACC,oBAAoB,IAAIC,eAAe,IAAIR,UAAU,CAAC1D,mCAAmC,EAAEgE,kBAAkB,IAAIC,oBAAoB,IAAIC,eAAe,IAAIR,UAAU,CAACzD,4CAA4C,EAAE8D,SAAS,CAAC;IAC5evF,OAAO,EAAEJ,YAAY,CAACE,kBAAkB,CAACE,OAAO,EAAEmF,aAAa,CAAC9E,IAAI,CAAC;IACrEH,kBAAkB,EAAEN,YAAY,CAACE,kBAAkB,CAACI,kBAAkB,EAAEkF,wBAAwB,CAAC/E,IAAI,CAAC;IACtGJ,aAAa,EAAEL,YAAY,CAACE,kBAAkB,CAACG,aAAa,EAAEoF,mBAAmB,CAAChF,IAAI,CAAC;IACvFF,UAAU,EAAEP,YAAY,CAACE,kBAAkB,CAACK,UAAU,EAAEmF,gBAAgB,CAACjF,IAAI;EACjF,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -99,7 +99,7 @@ const useLiveRegionStyles = makeStyles({
|
|
|
99
99
|
*
|
|
100
100
|
* @internal
|
|
101
101
|
*/ export const useCalendarStyles_unstable = (props)=>{
|
|
102
|
-
'use no memo';
|
|
102
|
+
'use no memo'; // justified: compiler would optimize useCalendarStyles_unstable — manual opt-out to preserve runtime behavior
|
|
103
103
|
const rootStyles = useRootStyles();
|
|
104
104
|
const dividerStyles = useDividerStyles();
|
|
105
105
|
const monthPickerWrapperStyles = useMonthPickerWrapperStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Calendar/useCalendarStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarStyles, CalendarStyleProps } from './Calendar.types';\n\n/**\n * @internal\n */\nexport const calendarClassNames: SlotClassNames<CalendarStyles> = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n monthPickerNotVisible: {\n flexDirection: 'column',\n },\n dayAndMonthPickersVisible: {\n width: '440px',\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px',\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px',\n },\n});\n\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0,\n },\n});\n\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n\n '& div': {\n fontSize: tokens.fontSizeBase200,\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall,\n },\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2,\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n },\n});\n\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px',\n },\n});\n\n/**\n * Apply styling to the Calendar slots based on the state\n *\n * @internal\n */\nexport const useCalendarStyles_unstable = (props: CalendarStyleProps): CalendarStyles => {\n 'use no memo'
|
|
1
|
+
{"version":3,"sources":["../src/components/Calendar/useCalendarStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarStyles, CalendarStyleProps } from './Calendar.types';\n\n/**\n * @internal\n */\nexport const calendarClassNames: SlotClassNames<CalendarStyles> = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n monthPickerNotVisible: {\n flexDirection: 'column',\n },\n dayAndMonthPickersVisible: {\n width: '440px',\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px',\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px',\n },\n});\n\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0,\n },\n});\n\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n\n '& div': {\n fontSize: tokens.fontSizeBase200,\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall,\n },\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2,\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n },\n});\n\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px',\n },\n});\n\n/**\n * Apply styling to the Calendar slots based on the state\n *\n * @internal\n */\nexport const useCalendarStyles_unstable = (props: CalendarStyleProps): CalendarStyles => {\n 'use no memo'; // justified: compiler would optimize useCalendarStyles_unstable — manual opt-out to preserve runtime behavior\n\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n\n const { className, isDayPickerVisible, isMonthPickerVisible, showWeekNumbers } = props;\n\n return {\n root: mergeClasses(\n calendarClassNames.root,\n rootStyles.base,\n rootStyles.normalize,\n !isMonthPickerVisible && rootStyles.monthPickerNotVisible,\n isDayPickerVisible && isMonthPickerVisible && !showWeekNumbers && rootStyles.dayAndMonthPickersVisible,\n isDayPickerVisible && !isMonthPickerVisible && showWeekNumbers && rootStyles.dayPickerVisibleAndWeekNumbersShown,\n isDayPickerVisible &&\n isMonthPickerVisible &&\n showWeekNumbers &&\n rootStyles.dayAndMonthPickersVisibleAndWeekNumbersShown,\n className,\n ),\n divider: mergeClasses(calendarClassNames.divider, dividerStyles.base),\n monthPickerWrapper: mergeClasses(calendarClassNames.monthPickerWrapper, monthPickerWrapperStyles.base),\n goTodayButton: mergeClasses(calendarClassNames.goTodayButton, goTodayButtonStyles.base),\n liveRegion: mergeClasses(calendarClassNames.liveRegion, liveRegionStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","display","width","normalize","boxShadow","boxSizing","margin","padding","monthPickerNotVisible","flexDirection","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","useDividerStyles","borderRight","colorNeutralStroke2","top","useMonthPickerWrapperStyles","useGoTodayButtonStyles","alignSelf","backgroundColor","colorTransparentBackground","borderStyle","bottom","color","colorNeutralForeground1","fontFamily","fontSize","fontSizeBase200","height","lineHeight","marginRight","marginTop","overflow","colorBrandForeground1","cursor","outline","strokeWidthThin","borderRadius","borderRadiusSmall","colorBrandForeground2","colorNeutralForegroundDisabled","pointerEvents","useLiveRegionStyles","border","position","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAItE;;CAEC,GACD,OAAO,MAAMC,qBAAqD;IAChEC,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,oBAAoB;IACpBC,YAAY;AACd,EAAE;AAEF,MAAMC,gBAAgBT,WAAW;I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AAU;QACV3C,OAAO;IACT;AACF;AAEA;;;;CAIC,GACD,OAAO,MAAM4C,6BAA6B,CAACC;IACzC,eAAe,8GAA8G;IAE7H,MAAMC,aAAajD;IACnB,MAAMkD,gBAAgBpC;IACtB,MAAMqC,2BAA2BjC;IACjC,MAAMkC,sBAAsBjC;IAC5B,MAAMkC,mBAAmBT;IAEzB,MAAM,EAAEU,SAAS,EAAEC,kBAAkB,EAAEC,oBAAoB,EAAEC,eAAe,EAAE,GAAGT;IAEjF,OAAO;QACLrD,MAAMH,aACJE,mBAAmBC,IAAI,EACvBsD,WAAWhD,IAAI,EACfgD,WAAW7C,SAAS,EACpB,CAACoD,wBAAwBP,WAAWxC,qBAAqB,EACzD8C,sBAAsBC,wBAAwB,CAACC,mBAAmBR,WAAWtC,yBAAyB,EACtG4C,sBAAsB,CAACC,wBAAwBC,mBAAmBR,WAAWrC,mCAAmC,EAChH2C,sBACEC,wBACAC,mBACAR,WAAWpC,4CAA4C,EACzDyC;QAEF1D,SAASJ,aAAaE,mBAAmBE,OAAO,EAAEsD,cAAcjD,IAAI;QACpEH,oBAAoBN,aAAaE,mBAAmBI,kBAAkB,EAAEqD,yBAAyBlD,IAAI;QACrGJ,eAAeL,aAAaE,mBAAmBG,aAAa,EAAEuD,oBAAoBnD,IAAI;QACtFF,YAAYP,aAAaE,mBAAmBK,UAAU,EAAEsD,iBAAiBpD,IAAI;IAC/E;AACF,EAAE"}
|
|
@@ -5,6 +5,7 @@ import { mergeClasses } from '@griffel/react';
|
|
|
5
5
|
import { addMonths, compareDatePart, getMonthEnd, getMonthStart } from '../../utils';
|
|
6
6
|
import { CalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid';
|
|
7
7
|
import { useCalendarDayStyles_unstable } from './useCalendarDayStyles.styles';
|
|
8
|
+
import { AnimationDirection } from '../../Calendar';
|
|
8
9
|
/**
|
|
9
10
|
* @internal
|
|
10
11
|
*/ export const CalendarDay = (props)=>{
|
|
@@ -15,7 +16,7 @@ import { useCalendarDayStyles_unstable } from './useCalendarDayStyles.styles';
|
|
|
15
16
|
(_dayGrid_current = dayGrid.current) === null || _dayGrid_current === void 0 ? void 0 : (_dayGrid_current_focus = _dayGrid_current.focus) === null || _dayGrid_current_focus === void 0 ? void 0 : _dayGrid_current_focus.call(_dayGrid_current);
|
|
16
17
|
}
|
|
17
18
|
}), []);
|
|
18
|
-
const { strings, gridLabel, navigatedDate, dateTimeFormatter, className, onHeaderSelect, showSixWeeksByDefault, minDate, maxDate, restrictedDates, onNavigateDate, showWeekNumbers, dateRangeType, animationDirection } = props;
|
|
19
|
+
const { strings, gridLabel, navigatedDate, dateTimeFormatter, className, onHeaderSelect, showSixWeeksByDefault, minDate, maxDate, restrictedDates, onNavigateDate, showWeekNumbers, dateRangeType, animationDirection = AnimationDirection.Vertical } = props;
|
|
19
20
|
const classNames = useCalendarDayStyles_unstable({
|
|
20
21
|
className,
|
|
21
22
|
headerIsClickable: !!onHeaderSelect,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarDay/CalendarDay.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { mergeClasses } from '@griffel/react';\nimport { addMonths, compareDatePart, getMonthEnd, getMonthStart } from '../../utils';\nimport { CalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid';\nimport { useCalendarDayStyles_unstable } from './useCalendarDayStyles.styles';\nimport type { ICalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid.types';\nimport type { CalendarDayProps, CalendarDayStyles } from './CalendarDay.types';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const CalendarDay: React.FunctionComponent<CalendarDayProps> = props => {\n const dayGrid = React.useRef<ICalendarDayGrid>(null);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n dayGrid.current?.focus?.();\n },\n }),\n [],\n );\n\n const {\n strings,\n gridLabel,\n navigatedDate,\n dateTimeFormatter,\n className,\n onHeaderSelect,\n showSixWeeksByDefault,\n minDate,\n maxDate,\n restrictedDates,\n onNavigateDate,\n showWeekNumbers,\n dateRangeType,\n animationDirection,\n } = props;\n\n const classNames = useCalendarDayStyles_unstable({\n className,\n headerIsClickable: !!onHeaderSelect,\n showWeekNumbers,\n animationDirection,\n });\n\n const monthAndYear = dateTimeFormatter.formatMonthYear(navigatedDate, strings);\n const HeaderButtonComponentType = onHeaderSelect ? 'button' : 'div';\n const headerAriaLabel = strings.yearPickerHeaderAriaLabel\n ? strings.yearPickerHeaderAriaLabel.replace('{0}', monthAndYear)\n : monthAndYear;\n\n const { ...propsWithoutStyles } = props;\n\n return (\n <div className={classNames.root}>\n <div className={classNames.header}>\n <HeaderButtonComponentType\n aria-label={onHeaderSelect ? headerAriaLabel : undefined}\n className={classNames.monthAndYear}\n onClick={onHeaderSelect}\n tabIndex={onHeaderSelect ? 0 : -1} // prevent focus if there's no action for the button\n onKeyDown={onButtonKeyDown(onHeaderSelect)}\n type=\"button\"\n >\n <span aria-live=\"polite\" aria-atomic=\"true\">\n {monthAndYear}\n </span>\n </HeaderButtonComponentType>\n <CalendarDayNavigationButtons {...props} classNames={classNames} />\n </div>\n <CalendarDayGrid\n {...propsWithoutStyles}\n gridLabel={`${monthAndYear}, ${gridLabel}`}\n componentRef={dayGrid}\n strings={strings}\n navigatedDate={navigatedDate!}\n weeksToShow={showSixWeeksByDefault ? 6 : undefined}\n dateTimeFormatter={dateTimeFormatter!}\n minDate={minDate}\n maxDate={maxDate}\n restrictedDates={restrictedDates}\n onNavigateDate={onNavigateDate}\n dateRangeType={dateRangeType}\n />\n </div>\n );\n};\nCalendarDay.displayName = 'CalendarDay';\n\ninterface CalendarDayNavigationButtonsProps extends CalendarDayProps {\n classNames: Record<keyof CalendarDayStyles, string>;\n}\n\nconst CalendarDayNavigationButtons = (props: CalendarDayNavigationButtonsProps): JSXElement => {\n const {\n minDate,\n maxDate,\n navigatedDate,\n navigationIcons,\n allFocusable,\n strings,\n showCloseButton,\n classNames,\n onNavigateDate,\n onDismiss,\n } = props;\n\n const onSelectNextMonth = (): void => {\n onNavigateDate(addMonths(navigatedDate, 1), false);\n };\n\n const onSelectPrevMonth = (): void => {\n onNavigateDate(addMonths(navigatedDate, -1), false);\n };\n\n // determine if previous/next months are in bounds\n const prevMonthInBounds = minDate ? compareDatePart(minDate, getMonthStart(navigatedDate)) < 0 : true;\n const nextMonthInBounds = maxDate ? compareDatePart(getMonthEnd(navigatedDate), maxDate) < 0 : true;\n\n // use aria-disabled instead of disabled so focus is not lost\n // when a prev/next button becomes disabled after being clicked\n return (\n <div className={classNames.monthComponents}>\n <button\n className={mergeClasses(classNames.headerIconButton, !prevMonthInBounds && classNames.disabledStyle)}\n tabIndex={prevMonthInBounds ? undefined : allFocusable ? 0 : -1}\n aria-disabled={!prevMonthInBounds}\n onClick={prevMonthInBounds ? onSelectPrevMonth : undefined}\n onKeyDown={prevMonthInBounds ? onButtonKeyDown(onSelectPrevMonth) : undefined}\n title={\n strings.prevMonthAriaLabel\n ? strings.prevMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, -1).getMonth()]\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.upNavigation}\n </button>\n <button\n className={mergeClasses(classNames.headerIconButton, !nextMonthInBounds && classNames.disabledStyle)}\n tabIndex={nextMonthInBounds ? undefined : allFocusable ? 0 : -1}\n aria-disabled={!nextMonthInBounds}\n onClick={nextMonthInBounds ? onSelectNextMonth : undefined}\n onKeyDown={nextMonthInBounds ? onButtonKeyDown(onSelectNextMonth) : undefined}\n title={\n strings.nextMonthAriaLabel\n ? strings.nextMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, 1).getMonth()]\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.downNavigation}\n </button>\n {showCloseButton && (\n <button\n className={classNames.headerIconButton}\n onClick={onDismiss}\n onKeyDown={onButtonKeyDown(onDismiss)}\n title={strings.closeButtonAriaLabel}\n type=\"button\"\n >\n {navigationIcons.dismiss}\n </button>\n )}\n </div>\n );\n};\nCalendarDayNavigationButtons.displayName = 'CalendarDayNavigationButtons';\n\nconst onButtonKeyDown =\n (callback?: () => void): ((ev: React.KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void) =>\n (ev: React.KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => {\n switch (ev.key) {\n case Enter:\n callback?.();\n break;\n }\n };\n"],"names":["React","Enter","mergeClasses","addMonths","compareDatePart","getMonthEnd","getMonthStart","CalendarDayGrid","useCalendarDayStyles_unstable","CalendarDay","props","dayGrid","useRef","useImperativeHandle","componentRef","focus","current","strings","gridLabel","navigatedDate","dateTimeFormatter","className","onHeaderSelect","showSixWeeksByDefault","minDate","maxDate","restrictedDates","onNavigateDate","showWeekNumbers","dateRangeType","animationDirection","classNames","headerIsClickable","monthAndYear","formatMonthYear","HeaderButtonComponentType","headerAriaLabel","yearPickerHeaderAriaLabel","replace","propsWithoutStyles","div","root","header","aria-label","undefined","onClick","tabIndex","onKeyDown","onButtonKeyDown","type","span","aria-live","aria-atomic","CalendarDayNavigationButtons","weeksToShow","displayName","navigationIcons","allFocusable","showCloseButton","onDismiss","onSelectNextMonth","onSelectPrevMonth","prevMonthInBounds","nextMonthInBounds","monthComponents","button","headerIconButton","disabledStyle","aria-disabled","title","prevMonthAriaLabel","months","getMonth","upNavigation","nextMonthAriaLabel","downNavigation","closeButtonAriaLabel","dismiss","callback","ev","key"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,SAAS,EAAEC,eAAe,EAAEC,WAAW,EAAEC,aAAa,QAAQ,cAAc;AACrF,SAASC,eAAe,QAAQ,qCAAqC;AACrE,SAASC,6BAA6B,QAAQ,gCAAgC;AAK9E;;CAEC,GACD,OAAO,MAAMC,cAAyDC,CAAAA;IACpE,MAAMC,UAAUX,MAAMY,MA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ACH,qBAAqBhC,WAAWoC,aAAa;QACnGrB,UAAUiB,oBAAoBnB,YAAYa,eAAe,IAAI,CAAC;QAC9DW,iBAAe,CAACL;QAChBlB,SAASkB,oBAAoBH,oBAAoBhB;QACjDG,WAAWgB,oBAAoBf,gBAAgBY,qBAAqBhB;QACpEyB,OACEpD,QAAQyD,kBAAkB,GACtBzD,QAAQyD,kBAAkB,GAAG,MAAMzD,QAAQsD,MAAM,CAACpE,UAAUgB,eAAe,GAAGqD,QAAQ,GAAG,GACzF5B;QAENK,MAAK;OAEJO,gBAAgBmB,cAAc,GAEhCjB,iCACC,oBAACO;QACC5C,WAAWU,WAAWmC,gBAAgB;QACtCrB,SAASc;QACTZ,WAAWC,gBAAgBW;QAC3BU,OAAOpD,QAAQ2D,oBAAoB;QACnC3B,MAAK;OAEJO,gBAAgBqB,OAAO;AAKlC;AACAxB,6BAA6BE,WAAW,GAAG;AAE3C,MAAMP,kBACJ,CAAC8B,WACD,CAACC;QACC,OAAQA,GAAGC,GAAG;YACZ,KAAK/E;gBACH6E,qBAAAA,+BAAAA;gBACA;QACJ;IACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarDay/CalendarDay.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { mergeClasses } from '@griffel/react';\nimport { addMonths, compareDatePart, getMonthEnd, getMonthStart } from '../../utils';\nimport { CalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid';\nimport { useCalendarDayStyles_unstable } from './useCalendarDayStyles.styles';\nimport type { ICalendarDayGrid } from '../CalendarDayGrid/CalendarDayGrid.types';\nimport type { CalendarDayProps, CalendarDayStyles } from './CalendarDay.types';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { AnimationDirection } from '../../Calendar';\n\n/**\n * @internal\n */\nexport const CalendarDay: React.FunctionComponent<CalendarDayProps> = props => {\n const dayGrid = React.useRef<ICalendarDayGrid>(null);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n dayGrid.current?.focus?.();\n },\n }),\n [],\n );\n\n const {\n strings,\n gridLabel,\n navigatedDate,\n dateTimeFormatter,\n className,\n onHeaderSelect,\n showSixWeeksByDefault,\n minDate,\n maxDate,\n restrictedDates,\n onNavigateDate,\n showWeekNumbers,\n dateRangeType,\n animationDirection = AnimationDirection.Vertical,\n } = props;\n\n const classNames = useCalendarDayStyles_unstable({\n className,\n headerIsClickable: !!onHeaderSelect,\n showWeekNumbers,\n animationDirection,\n });\n\n const monthAndYear = dateTimeFormatter.formatMonthYear(navigatedDate, strings);\n const HeaderButtonComponentType = onHeaderSelect ? 'button' : 'div';\n const headerAriaLabel = strings.yearPickerHeaderAriaLabel\n ? strings.yearPickerHeaderAriaLabel.replace('{0}', monthAndYear)\n : monthAndYear;\n\n const { ...propsWithoutStyles } = props;\n\n return (\n <div className={classNames.root}>\n <div className={classNames.header}>\n <HeaderButtonComponentType\n aria-label={onHeaderSelect ? headerAriaLabel : undefined}\n className={classNames.monthAndYear}\n onClick={onHeaderSelect}\n tabIndex={onHeaderSelect ? 0 : -1} // prevent focus if there's no action for the button\n onKeyDown={onButtonKeyDown(onHeaderSelect)}\n type=\"button\"\n >\n <span aria-live=\"polite\" aria-atomic=\"true\">\n {monthAndYear}\n </span>\n </HeaderButtonComponentType>\n <CalendarDayNavigationButtons {...props} classNames={classNames} />\n </div>\n <CalendarDayGrid\n {...propsWithoutStyles}\n gridLabel={`${monthAndYear}, ${gridLabel}`}\n componentRef={dayGrid}\n strings={strings}\n navigatedDate={navigatedDate!}\n weeksToShow={showSixWeeksByDefault ? 6 : undefined}\n dateTimeFormatter={dateTimeFormatter!}\n minDate={minDate}\n maxDate={maxDate}\n restrictedDates={restrictedDates}\n onNavigateDate={onNavigateDate}\n dateRangeType={dateRangeType}\n />\n </div>\n );\n};\nCalendarDay.displayName = 'CalendarDay';\n\ninterface CalendarDayNavigationButtonsProps extends CalendarDayProps {\n classNames: Record<keyof CalendarDayStyles, string>;\n}\n\nconst CalendarDayNavigationButtons = (props: CalendarDayNavigationButtonsProps): JSXElement => {\n const {\n minDate,\n maxDate,\n navigatedDate,\n navigationIcons,\n allFocusable,\n strings,\n showCloseButton,\n classNames,\n onNavigateDate,\n onDismiss,\n } = props;\n\n const onSelectNextMonth = (): void => {\n onNavigateDate(addMonths(navigatedDate, 1), false);\n };\n\n const onSelectPrevMonth = (): void => {\n onNavigateDate(addMonths(navigatedDate, -1), false);\n };\n\n // determine if previous/next months are in bounds\n const prevMonthInBounds = minDate ? compareDatePart(minDate, getMonthStart(navigatedDate)) < 0 : true;\n const nextMonthInBounds = maxDate ? compareDatePart(getMonthEnd(navigatedDate), maxDate) < 0 : true;\n\n // use aria-disabled instead of disabled so focus is not lost\n // when a prev/next button becomes disabled after being clicked\n return (\n <div className={classNames.monthComponents}>\n <button\n className={mergeClasses(classNames.headerIconButton, !prevMonthInBounds && classNames.disabledStyle)}\n tabIndex={prevMonthInBounds ? undefined : allFocusable ? 0 : -1}\n aria-disabled={!prevMonthInBounds}\n onClick={prevMonthInBounds ? onSelectPrevMonth : undefined}\n onKeyDown={prevMonthInBounds ? onButtonKeyDown(onSelectPrevMonth) : undefined}\n title={\n strings.prevMonthAriaLabel\n ? strings.prevMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, -1).getMonth()]\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.upNavigation}\n </button>\n <button\n className={mergeClasses(classNames.headerIconButton, !nextMonthInBounds && classNames.disabledStyle)}\n tabIndex={nextMonthInBounds ? undefined : allFocusable ? 0 : -1}\n aria-disabled={!nextMonthInBounds}\n onClick={nextMonthInBounds ? onSelectNextMonth : undefined}\n onKeyDown={nextMonthInBounds ? onButtonKeyDown(onSelectNextMonth) : undefined}\n title={\n strings.nextMonthAriaLabel\n ? strings.nextMonthAriaLabel + ' ' + strings.months[addMonths(navigatedDate, 1).getMonth()]\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.downNavigation}\n </button>\n {showCloseButton && (\n <button\n className={classNames.headerIconButton}\n onClick={onDismiss}\n onKeyDown={onButtonKeyDown(onDismiss)}\n title={strings.closeButtonAriaLabel}\n type=\"button\"\n >\n {navigationIcons.dismiss}\n </button>\n )}\n </div>\n );\n};\nCalendarDayNavigationButtons.displayName = 'CalendarDayNavigationButtons';\n\nconst onButtonKeyDown =\n (callback?: () => void): ((ev: React.KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void) =>\n (ev: React.KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => {\n switch (ev.key) {\n case Enter:\n callback?.();\n break;\n }\n };\n"],"names":["React","Enter","mergeClasses","addMonths","compareDatePart","getMonthEnd","getMonthStart","CalendarDayGrid","useCalendarDayStyles_unstable","AnimationDirection","CalendarDay","props","dayGrid","useRef","useImperativeHandle","componentRef","focus","current","strings","gridLabel","navigatedDate","dateTimeFormatter","className","onHeaderSelect","showSixWeeksByDefault","minDate","maxDate","restrictedDates","onNavigateDate","showWeekNumbers","dateRangeType","animationDirection","Vertical","classNames","headerIsClickable","monthAndYear","formatMonthYear","HeaderButtonComponentType","headerAriaLabel","yearPickerHeaderAriaLabel","replace","propsWithoutStyles","div","root","header","aria-label","undefined","onClick","tabIndex","onKeyDown","onButtonKeyDown","type","span","aria-live","aria-atomic","CalendarDayNavigationButtons","weeksToShow","displayName","navigationIcons","allFocusable","showCloseButton","onDismiss","onSelectNextMonth","onSelectPrevMonth","prevMonthInBounds","nextMonthInBounds","monthComponents","button","headerIconButton","disabledStyle","aria-disabled","title","prevMonthAriaLabel","months","getMonth","upNavigation","nextMonthAriaLabel","downNavigation","closeButtonAriaLabel","dismiss","callback","ev","key"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,SAAS,EAAEC,eAAe,EAAEC,WAAW,EAAEC,aAAa,QAAQ,cAAc;AACrF,SAASC,eAAe,QAA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B,GAAG,MAAMtD,QAAQuD,MAAM,CAACtE,UAAUiB,eAAe,CAAC,GAAGsD,QAAQ,GAAG,GAC1F5B;QAENK,MAAK;OAEJO,gBAAgBiB,YAAY,iBAE/B,oBAACR;QACC7C,WAAWpB,aAAa+B,WAAWmC,gBAAgB,EAAE,CAACH,qBAAqBhC,WAAWoC,aAAa;QACnGrB,UAAUiB,oBAAoBnB,YAAYa,eAAe,IAAI,CAAC;QAC9DW,iBAAe,CAACL;QAChBlB,SAASkB,oBAAoBH,oBAAoBhB;QACjDG,WAAWgB,oBAAoBf,gBAAgBY,qBAAqBhB;QACpEyB,OACErD,QAAQ0D,kBAAkB,GACtB1D,QAAQ0D,kBAAkB,GAAG,MAAM1D,QAAQuD,MAAM,CAACtE,UAAUiB,eAAe,GAAGsD,QAAQ,GAAG,GACzF5B;QAENK,MAAK;OAEJO,gBAAgBmB,cAAc,GAEhCjB,iCACC,oBAACO;QACC7C,WAAWW,WAAWmC,gBAAgB;QACtCrB,SAASc;QACTZ,WAAWC,gBAAgBW;QAC3BU,OAAOrD,QAAQ4D,oBAAoB;QACnC3B,MAAK;OAEJO,gBAAgBqB,OAAO;AAKlC;AACAxB,6BAA6BE,WAAW,GAAG;AAE3C,MAAMP,kBACJ,CAAC8B,WACD,CAACC;QACC,OAAQA,GAAGC,GAAG;YACZ,KAAKjF;gBACH+E,qBAAAA,+BAAAA;gBACA;QACJ;IACF"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { tokens } from '@fluentui/react-theme';
|
|
4
4
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
5
|
-
import { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';
|
|
6
5
|
/**
|
|
7
6
|
* @internal
|
|
8
7
|
*/
|
|
@@ -93,12 +92,6 @@ const useMonthAndYearStyles = /*#__PURE__*/__styles({
|
|
|
93
92
|
ygn44y: "f1cmbuwj",
|
|
94
93
|
Huce71: "fz5stix"
|
|
95
94
|
},
|
|
96
|
-
animation: {
|
|
97
|
-
vin17d: "fhsqnsn",
|
|
98
|
-
Bf5fcs: "fywypte",
|
|
99
|
-
Bv12yb3: "f1h7u52p",
|
|
100
|
-
Ezkn3b: "fjq4c94"
|
|
101
|
-
},
|
|
102
95
|
headerIsClickable: {
|
|
103
96
|
Jwef8y: "f18a0fwf",
|
|
104
97
|
Bi91k9c: "f3sdaeg",
|
|
@@ -124,8 +117,7 @@ const useMonthAndYearStyles = /*#__PURE__*/__styles({
|
|
|
124
117
|
p: -1
|
|
125
118
|
}], [".f1udkdxo{padding:0 10px 0 4px;}", {
|
|
126
119
|
p: -1
|
|
127
|
-
}], ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f1cmbuwj{text-overflow:ellipsis;}", ".fz5stix{white-space:nowrap;}"
|
|
128
|
-
k: ["@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}"],
|
|
120
|
+
}], ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f1cmbuwj{text-overflow:ellipsis;}", ".fz5stix{white-space:nowrap;}"],
|
|
129
121
|
h: [".f18a0fwf:hover{background-color:var(--colorBrandBackgroundInvertedHover);}", ".f3sdaeg:hover{color:var(--colorBrandForegroundOnLightHover);}", ".f8491dx:hover{cursor:pointer;}", [".f15rpok4:hover{outline:1px solid var(--colorTransparentStroke);}", {
|
|
130
122
|
p: -1
|
|
131
123
|
}], ".f1wvkgvo:hover:active{background-color:var(--colorBrandBackgroundInvertedPressed);}", ".f1wdoaqd:hover:active{color:var(--colorBrandForegroundOnLightPressed);}", ".f13c0t7h:hover:active{cursor:pointer;}", [".fy2scak:hover:active{outline:1px solid var(--colorTransparentStroke);}", {
|
|
@@ -211,6 +203,7 @@ const useDisabledStyleStyles = /*#__PURE__*/__styles({
|
|
|
211
203
|
export const useCalendarDayStyles_unstable = props => {
|
|
212
204
|
'use no memo';
|
|
213
205
|
|
|
206
|
+
// justified: compiler would optimize useCalendarDayStyles_unstable — manual opt-out to preserve runtime behavior
|
|
214
207
|
const rootStyles = useRootStyles();
|
|
215
208
|
const headerStyles = useHeaderStyles();
|
|
216
209
|
const monthAndYearStyles = useMonthAndYearStyles();
|
|
@@ -225,7 +218,7 @@ export const useCalendarDayStyles_unstable = props => {
|
|
|
225
218
|
return {
|
|
226
219
|
root: mergeClasses(calendarDayClassNames.root, rootStyles.normalize, rootStyles.base, showWeekNumbers && rootStyles.showWeekNumbers, className),
|
|
227
220
|
header: mergeClasses(calendarDayClassNames.header, headerStyles.base),
|
|
228
|
-
monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base,
|
|
221
|
+
monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base, headerIsClickable && monthAndYearStyles.headerIsClickable),
|
|
229
222
|
monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),
|
|
230
223
|
headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),
|
|
231
224
|
disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","__styles","mergeClasses","shorthands","DURATION_2","EASING_FUNCTION_2","FADE_IN","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","B7ck84d","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","a9b677","normalize","E5pizo","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","showWeekNumbers","d","p","useHeaderStyles","mc9l5x","Bqenvij","Bg96gwp","qhf8xq","useMonthAndYearStyles","Bt984gj","De3pzq","icvyot","vrafjx","oivjwe","wvpqe5","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","sj55zd","Bh6795r","Bahqtrf","Be2twd7","Bhrd7zp","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","ygn44y","Huce71","animation","vin17d","Bf5fcs","Bv12yb3","Ezkn3b","headerIsClickable","Jwef8y","Bi91k9c","eoavqd","pugfm4","ukgb2i","Dwtyhm","Biisq0s","iro3zm","B2d53fq","c3iz72","mghro0","Bx68yb","syojd9","E5hylx","k","h","useMonthComponentsStyles","qb2dma","useHeaderIconButtonStyles","useDisabledStyleStyles","Bg33ivm","t69wg0","Bnh7jwd","m","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"sources":["useCalendarDayStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';\n/**\n * @internal\n */ export const calendarDayClassNames = {\n root: 'fui-CalendarDay',\n header: 'fui-CalendarDay__header',\n monthAndYear: 'fui-CalendarDay__monthAndYear',\n monthComponents: 'fui-CalendarDay__monthComponents',\n headerIconButton: 'fui-CalendarDay__headerIconButton',\n disabledStyle: 'fui-CalendarDay__disabledStyle'\n};\nconst useRootStyles = makeStyles({\n base: {\n boxSizing: 'content-box',\n padding: '12px',\n width: '196px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n showWeekNumbers: {\n width: '226px'\n }\n});\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%'\n }\n});\nconst useMonthAndYearStyles = makeStyles({\n base: {\n alignItems: 'center',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground1,\n display: 'inline-block',\n flexGrow: 1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: '28px',\n overflow: 'hidden',\n padding: '0 4px 0 10px',\n textAlign: 'left',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n },\n animation: {\n animationDuration: DURATION_2,\n animationFillMode: 'both',\n animationName: FADE_IN,\n animationTimingFunction: EASING_FUNCTION_2\n },\n headerIsClickable: {\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`\n }\n }\n});\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex'\n }\n});\nconst useHeaderIconButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '28px',\n lineHeight: '28px',\n overflow: 'visible',\n padding: '0',\n position: 'relative',\n textAlign: 'center',\n width: '28px',\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed\n }\n }\n});\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n // add this explicitly for aria-disabled buttons that don't get default forced-colors disabled styles\n '@media (forced-colors: active)': {\n color: 'GrayText'\n }\n }\n }\n});\n/**\n * Apply styling to the CalendarDay slots based on the state\n *\n * @internal\n */ export const useCalendarDayStyles_unstable = (props)=>{\n 'use no memo';\n const rootStyles = useRootStyles();\n const headerStyles = useHeaderStyles();\n const monthAndYearStyles = useMonthAndYearStyles();\n const monthComponentsStyles = useMonthComponentsStyles();\n const headerIconButtonStyles = useHeaderIconButtonStyles();\n const disabledStyleStyles = useDisabledStyleStyles();\n const { className, headerIsClickable, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarDayClassNames.root, rootStyles.normalize, rootStyles.base, showWeekNumbers && rootStyles.showWeekNumbers, className),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base, monthAndYearStyles.animation, headerIsClickable && monthAndYearStyles.headerIsClickable),\n monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),\n headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),\n disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,OAAO,QAAQ,wBAAwB;AAC/E;AACA;AACA;AAAI,OAAO,MAAMC,qBAAqB,GAAG;EACrCC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE,yBAAyB;EACjCC,YAAY,EAAE,+BAA+B;EAC7CC,eAAe,EAAE,kCAAkC;EACnDC,gBAAgB,EAAE,mCAAmC;EACrDC,aAAa,EAAE;AACnB,CAAC;AACD,MAAMC,aAAa,gBAAGb,QAAA;EAAAc,IAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,SAAA;IAAAC,MAAA;IAAAR,OAAA;IAAAS,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAA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,qBAAqB,CAAC,CAAC;EAClD,MAAM0D,qBAAqB,GAAGb,wBAAwB,CAAC,CAAC;EACxD,MAAMc,sBAAsB,GAAGZ,yBAAyB,CAAC,CAAC;EAC1D,MAAMa,mBAAmB,GAAGZ,sBAAsB,CAAC,CAAC;EACpD,MAAM;IAAEa,SAAS;IAAEjC,iBAAiB;IAAEpC;EAAgB,CAAC,GAAG8D,KAAK;EAC/D,OAAO;IACHpF,IAAI,EAAEN,YAAY,CAACK,qBAAqB,CAACC,IAAI,EAAEqF,UAAU,CAACtE,SAAS,EAAEsE,UAAU,CAAC9E,IAAI,EAAEe,eAAe,IAAI+D,UAAU,CAAC/D,eAAe,EAAEqE,SAAS,CAAC;IAC/I1F,MAAM,EAAEP,YAAY,CAACK,qBAAqB,CAACE,MAAM,EAAEqF,YAAY,CAAC/E,IAAI,CAAC;IACrEL,YAAY,EAAER,YAAY,CAACK,qBAAqB,CAACG,YAAY,EAAEqF,kBAAkB,CAAChF,IAAI,EAAEgF,kBAAkB,CAAClC,SAAS,EAAEK,iBAAiB,IAAI6B,kBAAkB,CAAC7B,iBAAiB,CAAC;IAChLvD,eAAe,EAAET,YAAY,CAACK,qBAAqB,CAACI,eAAe,EAAEqF,qBAAqB,CAACjF,IAAI,CAAC;IAChGH,gBAAgB,EAAEV,YAAY,CAACK,qBAAqB,CAACK,gBAAgB,EAAEqF,sBAAsB,CAAClF,IAAI,CAAC;IACnGF,aAAa,EAAEX,YAAY,CAACK,qBAAqB,CAACM,aAAa,EAAEqF,mBAAmB,CAACnF,IAAI;EAC7F,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["tokens","__styles","mergeClasses","shorthands","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","B7ck84d","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","a9b677","normalize","E5pizo","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","showWeekNumbers","d","p","useHeaderStyles","mc9l5x","Bqenvij","Bg96gwp","qhf8xq","useMonthAndYearStyles","Bt984gj","De3pzq","icvyot","vrafjx","oivjwe","wvpqe5","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","sj55zd","Bh6795r","Bahqtrf","Be2twd7","Bhrd7zp","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","ygn44y","Huce71","headerIsClickable","Jwef8y","Bi91k9c","eoavqd","pugfm4","ukgb2i","Dwtyhm","Biisq0s","iro3zm","B2d53fq","c3iz72","mghro0","Bx68yb","syojd9","E5hylx","h","useMonthComponentsStyles","qb2dma","useHeaderIconButtonStyles","useDisabledStyleStyles","Bg33ivm","t69wg0","Bnh7jwd","m","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"sources":["useCalendarDayStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */ export const calendarDayClassNames = {\n root: 'fui-CalendarDay',\n header: 'fui-CalendarDay__header',\n monthAndYear: 'fui-CalendarDay__monthAndYear',\n monthComponents: 'fui-CalendarDay__monthComponents',\n headerIconButton: 'fui-CalendarDay__headerIconButton',\n disabledStyle: 'fui-CalendarDay__disabledStyle'\n};\nconst useRootStyles = makeStyles({\n base: {\n boxSizing: 'content-box',\n padding: '12px',\n width: '196px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n showWeekNumbers: {\n width: '226px'\n }\n});\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%'\n }\n});\nconst useMonthAndYearStyles = makeStyles({\n base: {\n alignItems: 'center',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground1,\n display: 'inline-block',\n flexGrow: 1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: '28px',\n overflow: 'hidden',\n padding: '0 4px 0 10px',\n textAlign: 'left',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n },\n headerIsClickable: {\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`\n }\n }\n});\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex'\n }\n});\nconst useHeaderIconButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '28px',\n lineHeight: '28px',\n overflow: 'visible',\n padding: '0',\n position: 'relative',\n textAlign: 'center',\n width: '28px',\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed\n }\n }\n});\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n // add this explicitly for aria-disabled buttons that don't get default forced-colors disabled styles\n '@media (forced-colors: active)': {\n color: 'GrayText'\n }\n }\n }\n});\n/**\n * Apply styling to the CalendarDay slots based on the state\n *\n * @internal\n */ export const useCalendarDayStyles_unstable = (props)=>{\n 'use no memo'; // justified: compiler would optimize useCalendarDayStyles_unstable — manual opt-out to preserve runtime behavior\n const rootStyles = useRootStyles();\n const headerStyles = useHeaderStyles();\n const monthAndYearStyles = useMonthAndYearStyles();\n const monthComponentsStyles = useMonthComponentsStyles();\n const headerIconButtonStyles = useHeaderIconButtonStyles();\n const disabledStyleStyles = useDisabledStyleStyles();\n const { className, headerIsClickable, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarDayClassNames.root, rootStyles.normalize, rootStyles.base, showWeekNumbers && rootStyles.showWeekNumbers, className),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base, headerIsClickable && monthAndYearStyles.headerIsClickable),\n monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),\n headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),\n disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE;AACA;AACA;AAAI,OAAO,MAAMC,qBAAqB,GAAG;EACrCC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE,yBAAyB;EACjCC,YAAY,EAAE,+BAA+B;EAC7CC,eAAe,EAAE,kCAAkC;EACnDC,gBAAgB,EAAE,mCAAmC;EACrDC,aAAa,EAAE;AACnB,CAAC;AACD,MAAMC,aAAa,gBAAGV,QAAA;EAAAW,IAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,SAAA;IAAAC,MAAA;IAAAR,OAAA;I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MoD,qBAAqB,GAAGb,wBAAwB,CAAC,CAAC;EACxD,MAAMc,sBAAsB,GAAGZ,yBAAyB,CAAC,CAAC;EAC1D,MAAMa,mBAAmB,GAAGZ,sBAAsB,CAAC,CAAC;EACpD,MAAM;IAAEa,SAAS;IAAEhC,iBAAiB;IAAE/B;EAAgB,CAAC,GAAGwD,KAAK;EAC/D,OAAO;IACH9E,IAAI,EAAEH,YAAY,CAACE,qBAAqB,CAACC,IAAI,EAAE+E,UAAU,CAAChE,SAAS,EAAEgE,UAAU,CAACxE,IAAI,EAAEe,eAAe,IAAIyD,UAAU,CAACzD,eAAe,EAAE+D,SAAS,CAAC;IAC/IpF,MAAM,EAAEJ,YAAY,CAACE,qBAAqB,CAACE,MAAM,EAAE+E,YAAY,CAACzE,IAAI,CAAC;IACrEL,YAAY,EAAEL,YAAY,CAACE,qBAAqB,CAACG,YAAY,EAAE+E,kBAAkB,CAAC1E,IAAI,EAAE8C,iBAAiB,IAAI4B,kBAAkB,CAAC5B,iBAAiB,CAAC;IAClJlD,eAAe,EAAEN,YAAY,CAACE,qBAAqB,CAACI,eAAe,EAAE+E,qBAAqB,CAAC3E,IAAI,CAAC;IAChGH,gBAAgB,EAAEP,YAAY,CAACE,qBAAqB,CAACK,gBAAgB,EAAE+E,sBAAsB,CAAC5E,IAAI,CAAC;IACnGF,aAAa,EAAER,YAAY,CAACE,qBAAqB,CAACM,aAAa,EAAE+E,mBAAmB,CAAC7E,IAAI;EAC7F,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
3
|
import { makeStyles, mergeClasses, shorthands } from '@griffel/react';
|
|
4
|
-
import { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
7
6
|
*/ export const calendarDayClassNames = {
|
|
@@ -56,12 +55,6 @@ const useMonthAndYearStyles = makeStyles({
|
|
|
56
55
|
textOverflow: 'ellipsis',
|
|
57
56
|
whiteSpace: 'nowrap'
|
|
58
57
|
},
|
|
59
|
-
animation: {
|
|
60
|
-
animationDuration: DURATION_2,
|
|
61
|
-
animationFillMode: 'both',
|
|
62
|
-
animationName: FADE_IN,
|
|
63
|
-
animationTimingFunction: EASING_FUNCTION_2
|
|
64
|
-
},
|
|
65
58
|
headerIsClickable: {
|
|
66
59
|
'&:hover': {
|
|
67
60
|
backgroundColor: tokens.colorBrandBackgroundInvertedHover,
|
|
@@ -128,7 +121,7 @@ const useDisabledStyleStyles = makeStyles({
|
|
|
128
121
|
*
|
|
129
122
|
* @internal
|
|
130
123
|
*/ export const useCalendarDayStyles_unstable = (props)=>{
|
|
131
|
-
'use no memo';
|
|
124
|
+
'use no memo'; // justified: compiler would optimize useCalendarDayStyles_unstable — manual opt-out to preserve runtime behavior
|
|
132
125
|
const rootStyles = useRootStyles();
|
|
133
126
|
const headerStyles = useHeaderStyles();
|
|
134
127
|
const monthAndYearStyles = useMonthAndYearStyles();
|
|
@@ -139,7 +132,7 @@ const useDisabledStyleStyles = makeStyles({
|
|
|
139
132
|
return {
|
|
140
133
|
root: mergeClasses(calendarDayClassNames.root, rootStyles.normalize, rootStyles.base, showWeekNumbers && rootStyles.showWeekNumbers, className),
|
|
141
134
|
header: mergeClasses(calendarDayClassNames.header, headerStyles.base),
|
|
142
|
-
monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base,
|
|
135
|
+
monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base, headerIsClickable && monthAndYearStyles.headerIsClickable),
|
|
143
136
|
monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),
|
|
144
137
|
headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),
|
|
145
138
|
disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarDay/useCalendarDayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarDay/useCalendarDayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarDayStyles, CalendarDayStyleProps } from './CalendarDay.types';\n\n/**\n * @internal\n */\nexport const calendarDayClassNames: SlotClassNames<CalendarDayStyles> = {\n root: 'fui-CalendarDay',\n header: 'fui-CalendarDay__header',\n monthAndYear: 'fui-CalendarDay__monthAndYear',\n monthComponents: 'fui-CalendarDay__monthComponents',\n headerIconButton: 'fui-CalendarDay__headerIconButton',\n disabledStyle: 'fui-CalendarDay__disabledStyle',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n boxSizing: 'content-box',\n padding: '12px',\n width: '196px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n showWeekNumbers: {\n width: '226px',\n },\n});\n\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%',\n },\n});\n\nconst useMonthAndYearStyles = makeStyles({\n base: {\n alignItems: 'center',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground1,\n display: 'inline-block',\n flexGrow: 1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: '28px',\n overflow: 'hidden',\n padding: '0 4px 0 10px',\n textAlign: 'left',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n headerIsClickable: {\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n },\n});\n\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex',\n },\n});\n\nconst useHeaderIconButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '28px',\n lineHeight: '28px',\n overflow: 'visible',\n padding: '0',\n position: 'relative',\n textAlign: 'center',\n width: '28px',\n\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n },\n },\n});\n\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n\n // add this explicitly for aria-disabled buttons that don't get default forced-colors disabled styles\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n },\n});\n\n/**\n * Apply styling to the CalendarDay slots based on the state\n *\n * @internal\n */\nexport const useCalendarDayStyles_unstable = (props: CalendarDayStyleProps): CalendarDayStyles => {\n 'use no memo'; // justified: compiler would optimize useCalendarDayStyles_unstable — manual opt-out to preserve runtime behavior\n\n const rootStyles = useRootStyles();\n const headerStyles = useHeaderStyles();\n const monthAndYearStyles = useMonthAndYearStyles();\n const monthComponentsStyles = useMonthComponentsStyles();\n const headerIconButtonStyles = useHeaderIconButtonStyles();\n const disabledStyleStyles = useDisabledStyleStyles();\n\n const { className, headerIsClickable, showWeekNumbers } = props;\n\n return {\n root: mergeClasses(\n calendarDayClassNames.root,\n rootStyles.normalize,\n rootStyles.base,\n showWeekNumbers && rootStyles.showWeekNumbers,\n className,\n ),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(\n calendarDayClassNames.monthAndYear,\n monthAndYearStyles.base,\n headerIsClickable && monthAndYearStyles.headerIsClickable,\n ),\n monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),\n headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),\n disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","boxSizing","padding","width","normalize","boxShadow","margin","showWeekNumbers","useHeaderStyles","display","height","lineHeight","position","useMonthAndYearStyles","alignItems","backgroundColor","colorTransparentBackground","borderStyle","borderRadius","borderRadiusMedium","color","colorNeutralForeground1","flexGrow","fontFamily","fontSize","fontSizeBase300","fontWeight","fontWeightSemibold","overflow","textAlign","textOverflow","whiteSpace","headerIsClickable","colorBrandBackgroundInvertedHover","colorBrandForegroundOnLightHover","cursor","outline","colorTransparentStroke","colorBrandBackgroundInvertedPressed","colorBrandForegroundOnLightPressed","useMonthComponentsStyles","alignSelf","useHeaderIconButtonStyles","colorNeutralForeground3","fontSizeBase200","useDisabledStyleStyles","colorNeutralForegroundDisabled","pointerEvents","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wB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C,eAAe,EAC7CiD;QAEF9D,QAAQJ,aAAaE,sBAAsBE,MAAM,EAAEyD,aAAanD,IAAI;QACpEL,cAAcL,aACZE,sBAAsBG,YAAY,EAClCyD,mBAAmBpD,IAAI,EACvBgC,qBAAqBoB,mBAAmBpB,iBAAiB;QAE3DpC,iBAAiBN,aAAaE,sBAAsBI,eAAe,EAAEyD,sBAAsBrD,IAAI;QAC/FH,kBAAkBP,aAAaE,sBAAsBK,gBAAgB,EAAEyD,uBAAuBtD,IAAI;QAClGF,eAAeR,aAAaE,sBAAsBM,aAAa,EAAEyD,oBAAoBvD,IAAI;IAC3F;AACF,EAAE"}
|
|
@@ -9,6 +9,8 @@ import { CalendarGridRow } from './CalendarGridRow';
|
|
|
9
9
|
import { useWeeks } from './useWeeks';
|
|
10
10
|
import { useWeekCornerStyles } from './useWeekCornerStyles.styles';
|
|
11
11
|
import { mergeClasses } from '@griffel/react';
|
|
12
|
+
import { DirectionalSlideIn, DirectionalSlideOut } from '../../utils/calendarMotions';
|
|
13
|
+
import { AnimationDirection } from '../../Calendar';
|
|
12
14
|
function useDayRefs() {
|
|
13
15
|
const daysRef = React.useRef({});
|
|
14
16
|
const getSetRefCallback = (dayKey)=>(element)=>{
|
|
@@ -91,7 +93,7 @@ export const CalendarDayGrid = (props)=>{
|
|
|
91
93
|
dayRefs = dayInfosInRange.map((dayInfo)=>daysRef.current[dayInfo.key]);
|
|
92
94
|
return dayRefs;
|
|
93
95
|
};
|
|
94
|
-
const { gridLabel, dateRangeType, showWeekNumbers, labelledBy, lightenDaysOutsideNavigatedMonth, animationDirection } = props;
|
|
96
|
+
const { gridLabel, dateRangeType, showWeekNumbers, labelledBy, lightenDaysOutsideNavigatedMonth, animationDirection = AnimationDirection.Vertical } = props;
|
|
95
97
|
const classNames = useCalendarDayGridStyles_unstable({
|
|
96
98
|
animateBackwards,
|
|
97
99
|
animationDirection,
|
|
@@ -114,6 +116,12 @@ export const CalendarDayGrid = (props)=>{
|
|
|
114
116
|
const arrowNavigationAttributes = useArrowNavigationGroup({
|
|
115
117
|
axis: 'grid-linear'
|
|
116
118
|
});
|
|
119
|
+
const firstWeek = weeks[0];
|
|
120
|
+
const finalWeek = weeks[weeks.length - 1];
|
|
121
|
+
// Single navigation epoch for all rows in the grid. Derived from the first visible day's key
|
|
122
|
+
// (`Date.toString()`), which changes when the user navigates to a different month but stays
|
|
123
|
+
// stable across intra-month interactions (e.g. day selection).
|
|
124
|
+
const navigationEpoch = firstWeek[0].key;
|
|
117
125
|
return /*#__PURE__*/ React.createElement("table", {
|
|
118
126
|
className: mergeClasses(classNames.table, props.className),
|
|
119
127
|
"aria-multiselectable": "false",
|
|
@@ -126,30 +134,44 @@ export const CalendarDayGrid = (props)=>{
|
|
|
126
134
|
...props,
|
|
127
135
|
classNames: classNames,
|
|
128
136
|
weeks: weeks
|
|
129
|
-
}), /*#__PURE__*/ React.createElement(
|
|
137
|
+
}), /*#__PURE__*/ React.createElement(DirectionalSlideOut, {
|
|
138
|
+
edge: "first",
|
|
139
|
+
replayKey: navigationEpoch,
|
|
140
|
+
animationDirection: animationDirection,
|
|
141
|
+
animateBackwards: animateBackwards
|
|
142
|
+
}, /*#__PURE__*/ React.createElement(CalendarGridRow, {
|
|
130
143
|
...props,
|
|
131
144
|
...partialWeekProps,
|
|
132
|
-
week:
|
|
145
|
+
week: firstWeek,
|
|
133
146
|
weekIndex: -1,
|
|
134
147
|
rowClassName: classNames.firstTransitionWeek,
|
|
135
148
|
"aria-role": "presentation",
|
|
136
149
|
ariaHidden: true
|
|
137
|
-
}), weeks.slice(1, weeks.length - 1).map((week, weekIndex)=>/*#__PURE__*/ React.createElement(
|
|
150
|
+
})), weeks.slice(1, weeks.length - 1).map((week, weekIndex)=>/*#__PURE__*/ React.createElement(DirectionalSlideIn, {
|
|
151
|
+
key: weekIndex,
|
|
152
|
+
replayKey: navigationEpoch,
|
|
153
|
+
animationDirection: animationDirection,
|
|
154
|
+
animateBackwards: animateBackwards
|
|
155
|
+
}, /*#__PURE__*/ React.createElement(CalendarGridRow, {
|
|
138
156
|
...props,
|
|
139
157
|
...partialWeekProps,
|
|
140
|
-
key: weekIndex,
|
|
141
158
|
week: week,
|
|
142
159
|
weekIndex: weekIndex,
|
|
143
160
|
rowClassName: classNames.weekRow
|
|
144
|
-
})), /*#__PURE__*/ React.createElement(
|
|
161
|
+
}))), /*#__PURE__*/ React.createElement(DirectionalSlideOut, {
|
|
162
|
+
edge: "last",
|
|
163
|
+
replayKey: navigationEpoch,
|
|
164
|
+
animationDirection: animationDirection,
|
|
165
|
+
animateBackwards: animateBackwards
|
|
166
|
+
}, /*#__PURE__*/ React.createElement(CalendarGridRow, {
|
|
145
167
|
...props,
|
|
146
168
|
...partialWeekProps,
|
|
147
|
-
week:
|
|
169
|
+
week: finalWeek,
|
|
148
170
|
weekIndex: -2,
|
|
149
171
|
rowClassName: classNames.lastTransitionWeek,
|
|
150
172
|
"aria-role": "presentation",
|
|
151
173
|
ariaHidden: true
|
|
152
|
-
})));
|
|
174
|
+
}))));
|
|
153
175
|
};
|
|
154
176
|
CalendarDayGrid.displayName = 'CalendarDayGrid';
|
|
155
177
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarDayGrid/CalendarDayGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useId } from '@fluentui/react-utilities';\nimport { getBoundedDateRange, getDateRangeArray, isRestrictedDate, DateRangeType } from '../../utils';\nimport { useCalendarDayGridStyles_unstable } from './useCalendarDayGridStyles.styles';\nimport { CalendarMonthHeaderRow } from './CalendarMonthHeaderRow';\nimport { CalendarGridRow } from './CalendarGridRow';\nimport { useWeeks } from './useWeeks';\nimport type { WeekCorners } from './useWeekCornerStyles.styles';\nimport { useWeekCornerStyles } from './useWeekCornerStyles.styles';\nimport { mergeClasses } from '@griffel/react';\nimport type { Day, DayOfWeek } from '../../utils';\nimport type { CalendarDayGridProps } from './CalendarDayGrid.types';\n\nexport interface DayInfo extends Day {\n onSelected: () => void;\n setRef(element: HTMLElement | null): void;\n}\n\nfunction useDayRefs() {\n const daysRef = React.useRef<Record<string, HTMLElement>>({});\n\n const getSetRefCallback = (dayKey: string) => (element: HTMLElement | null) => {\n if (element === null) {\n delete daysRef.current[dayKey];\n } else {\n daysRef.current[dayKey] = element;\n }\n };\n\n return [daysRef, getSetRefCallback] as const;\n}\n\nfunction useAnimateBackwards(weeks: DayInfo[][]): boolean | undefined {\n const previousNavigatedDateRef = React.useRef<Date | undefined>(undefined);\n React.useEffect(() => {\n previousNavigatedDateRef.current = weeks[0][0].originalDate;\n });\n const previousNavigatedDate = previousNavigatedDateRef.current;\n\n // eslint-disable-next-line react-hooks/refs\n if (!previousNavigatedDate || previousNavigatedDate.getTime() === weeks[0][0].originalDate.getTime()) {\n return undefined;\n // eslint-disable-next-line react-hooks/refs\n } else if (previousNavigatedDate <= weeks[0][0].originalDate) {\n return false;\n } else {\n return true;\n }\n}\n\nexport const CalendarDayGrid: React.FunctionComponent<CalendarDayGridProps> = props => {\n const navigatedDayRef = React.useRef<HTMLTableCellElement>(\n null,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ) as React.MutableRefObject<HTMLTableCellElement | null>;\n\n const activeDescendantId = useId();\n\n const onSelectDate = (selectedDate: Date): void => {\n const { firstDayOfWeek, minDate, maxDate, workWeekDays, daysToSelectInDayView, restrictedDates } = props;\n const restrictedDatesOptions = { minDate, maxDate, restrictedDates };\n\n // eslint-disable-next-line react-hooks/immutability\n let dateRange = getDateRangeArray(selectedDate, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView);\n dateRange = getBoundedDateRange(dateRange, minDate, maxDate);\n\n dateRange = dateRange.filter((d: Date) => {\n return !isRestrictedDate(d, restrictedDatesOptions);\n });\n\n props.onSelectDate?.(selectedDate, dateRange);\n props.onNavigateDate?.(selectedDate, true);\n };\n\n const [daysRef, getSetRefCallback] = useDayRefs();\n\n const weeks = useWeeks(props, onSelectDate, getSetRefCallback);\n const animateBackwards = useAnimateBackwards(weeks);\n const [getWeekCornerStyles, calculateRoundedStyles] = useWeekCornerStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n navigatedDayRef.current?.focus?.();\n },\n }),\n [],\n );\n\n /**\n *\n * Section for setting hover/pressed styles. Because we want arbitrary blobs of days to be selectable, to support\n * highlighting every day in the month for month view, css :hover style isn't enough, so we need mouse callbacks\n * to set classnames on all relevant child refs to apply the styling\n *\n */\n const getDayInfosInRangeOfDay = (dayToCompare: DayInfo): DayInfo[] => {\n // The hover state looks weird with non-contiguous days in work week view. In work week, show week hover state\n const dateRangeHoverType = getDateRangeTypeToUse(props.dateRangeType, props.workWeekDays);\n\n // gets all the dates for the given date range type that are in the same date range as the given day\n const dateRange = getDateRangeArray(\n dayToCompare.originalDate,\n dateRangeHoverType,\n props.firstDayOfWeek,\n props.workWeekDays,\n props.daysToSelectInDayView,\n ).map((date: Date) => date.getTime());\n\n // gets all the day refs for the given dates\n const dayInfosInRange = weeks.reduce((accumulatedValue: DayInfo[], currentWeek: DayInfo[]) => {\n return accumulatedValue.concat(\n currentWeek.filter((weekDay: DayInfo) => dateRange.indexOf(weekDay.originalDate.getTime()) !== -1),\n );\n }, []);\n\n return dayInfosInRange;\n };\n\n const getRefsFromDayInfos = (dayInfosInRange: DayInfo[]): (HTMLElement | null)[] => {\n let dayRefs: (HTMLElement | null)[] = [];\n dayRefs = dayInfosInRange.map((dayInfo: DayInfo) => daysRef.current[dayInfo.key]);\n\n return dayRefs;\n };\n\n const {\n gridLabel,\n dateRangeType,\n showWeekNumbers,\n labelledBy,\n lightenDaysOutsideNavigatedMonth,\n animationDirection,\n } = props;\n\n const classNames = useCalendarDayGridStyles_unstable({\n animateBackwards,\n animationDirection,\n dateRangeType,\n lightenDaysOutsideNavigatedMonth:\n lightenDaysOutsideNavigatedMonth === undefined ? true : lightenDaysOutsideNavigatedMonth,\n showWeekNumbers,\n });\n\n // When the month is highlighted get the corner dates so that styles can be added to them\n const weekCorners: WeekCorners = getWeekCornerStyles(weeks!);\n const partialWeekProps = {\n weeks,\n navigatedDayRef,\n calculateRoundedStyles,\n activeDescendantId,\n classNames,\n weekCorners,\n getDayInfosInRangeOfDay,\n getRefsFromDayInfos,\n } as const;\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid-linear' });\n\n return (\n <table\n className={mergeClasses(classNames.table, props.className)}\n aria-multiselectable=\"false\"\n aria-label={gridLabel}\n aria-labelledby={labelledBy}\n aria-activedescendant={activeDescendantId}\n role=\"grid\"\n {...arrowNavigationAttributes}\n >\n <tbody>\n <CalendarMonthHeaderRow {...props} classNames={classNames} weeks={weeks} />\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={weeks[0]}\n weekIndex={-1}\n rowClassName={classNames.firstTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n {weeks!.slice(1, weeks!.length - 1).map((week: DayInfo[], weekIndex: number) => (\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n key={weekIndex}\n week={week}\n weekIndex={weekIndex}\n rowClassName={classNames.weekRow}\n />\n ))}\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={weeks![weeks!.length - 1]}\n weekIndex={-2}\n rowClassName={classNames.lastTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n </tbody>\n </table>\n );\n};\nCalendarDayGrid.displayName = 'CalendarDayGrid';\n\n/**\n * When given work week, if the days are non-contiguous, the hover states look really weird. So for non-contiguous\n * work weeks, we'll just show week view instead.\n */\nfunction getDateRangeTypeToUse(dateRangeType: DateRangeType, workWeekDays: DayOfWeek[] | undefined): DateRangeType {\n if (workWeekDays && dateRangeType === DateRangeType.WorkWeek) {\n const sortedWWDays = workWeekDays.slice().sort();\n let isContiguous = true;\n for (let i = 1; i < sortedWWDays.length; i++) {\n if (sortedWWDays[i] !== sortedWWDays[i - 1] + 1) {\n isContiguous = false;\n break;\n }\n }\n\n if (!isContiguous || workWeekDays.length === 0) {\n return DateRangeType.Week;\n }\n }\n\n return dateRangeType;\n}\n"],"names":["React","useArrowNavigationGroup","useId","getBoundedDateRange","getDateRangeArray","isRestrictedDate","DateRangeType","useCalendarDayGridStyles_unstable","CalendarMonthHeaderRow","CalendarGridRow","useWeeks","useWeekCornerStyles","mergeClasses","useDayRefs","daysRef","useRef","getSetRefCallback","dayKey","element","current","useAnimateBackwards","weeks","previousNavigatedDateRef","undefined","useEffect","originalDate","previousNavigatedDate","getTime","CalendarDayGrid","props","navigatedDayRef","activeDescendantId","onSelectDate","selectedDate","firstDayOfWeek","minDate","maxDate","workWeekDays","daysToSelectInDayView","restrictedDates","restrictedDatesOptions","dateRange","dateRangeType","filter","d","onNavigateDate","animateBackwards","getWeekCornerStyles","calculateRoundedStyles","useImperativeHandle","componentRef","focus","getDayInfosInRangeOfDay","dayToCompare","dateRangeHoverType","getDateRangeTypeToUse","map","date","dayInfosInRange","reduce","accumulatedValue","currentWeek","concat","weekDay","indexOf","getRefsFromDayInfos","dayRefs","dayInfo","key","gridLabel","showWeekNumbers","labelledBy","lightenDaysOutsideNavigatedMonth","animationDirection","classNames","weekCorners","partialWeekProps","arrowNavigationAttributes","axis","table","className","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","role","tbody","week","weekIndex","rowClassName","firstTransitionWeek","aria-role","ariaHidden","slice","length","weekRow","lastTransitionWeek","displayName","WorkWeek","sortedWWDays","sort","isContiguous","i","Week"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,KAAK,QAAQ,4BAA4B;AAClD,SAASC,mBAAmB,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,cAAc;AACtG,SAASC,iCAAiC,QAAQ,oCAAoC;AACtF,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,eAAe,QAAQ,oBAAoB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AAcf,WAAWqB,OAAO;2BAGpC,oBAACtF;QACE,GAAGoB,KAAK;QACR,GAAG+C,gBAAgB;QACpBW,MAAMlE,KAAM,CAACA,MAAOyE,MAAM,GAAG,EAAE;QAC/BN,WAAW,CAAC;QACZC,cAAcf,WAAWsB,kBAAkB;QAC3CL,aAAU;QACVC,YAAY;;AAKtB,EAAE;AACFhE,gBAAgBqE,WAAW,GAAG;AAE9B;;;CAGC,GACD,SAAS1C,sBAAsBb,aAA4B,EAAEL,YAAqC;IAChG,IAAIA,gBAAgBK,kBAAkBpC,cAAc4F,QAAQ,EAAE;QAC5D,MAAMC,eAAe9D,aAAawD,KAAK,GAAGO,IAAI;QAC9C,IAAIC,eAAe;QACnB,IAAK,IAAIC,IAAI,GAAGA,IAAIH,aAAaL,MAAM,EAAEQ,IAAK;YAC5C,IAAIH,YAAY,CAACG,EAAE,KAAKH,YAAY,CAACG,IAAI,EAAE,GAAG,GAAG;gBAC/CD,eAAe;gBACf;YACF;QACF;QAEA,IAAI,CAACA,gBAAgBhE,aAAayD,MAAM,KAAK,GAAG;YAC9C,OAAOxF,cAAciG,IAAI;QAC3B;IACF;IAEA,OAAO7D;AACT"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarDayGrid/CalendarDayGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useId } from '@fluentui/react-utilities';\nimport { getBoundedDateRange, getDateRangeArray, isRestrictedDate, DateRangeType } from '../../utils';\nimport { useCalendarDayGridStyles_unstable } from './useCalendarDayGridStyles.styles';\nimport { CalendarMonthHeaderRow } from './CalendarMonthHeaderRow';\nimport { CalendarGridRow } from './CalendarGridRow';\nimport { useWeeks } from './useWeeks';\nimport type { WeekCorners } from './useWeekCornerStyles.styles';\nimport { useWeekCornerStyles } from './useWeekCornerStyles.styles';\nimport { mergeClasses } from '@griffel/react';\nimport type { Day, DayOfWeek } from '../../utils';\nimport type { CalendarDayGridProps } from './CalendarDayGrid.types';\nimport { DirectionalSlideIn, DirectionalSlideOut } from '../../utils/calendarMotions';\nimport { AnimationDirection } from '../../Calendar';\n\nexport interface DayInfo extends Day {\n onSelected: () => void;\n setRef(element: HTMLElement | null): void;\n}\n\nfunction useDayRefs() {\n const daysRef = React.useRef<Record<string, HTMLElement>>({});\n\n const getSetRefCallback = (dayKey: string) => (element: HTMLElement | null) => {\n if (element === null) {\n delete daysRef.current[dayKey];\n } else {\n daysRef.current[dayKey] = element;\n }\n };\n\n return [daysRef, getSetRefCallback] as const;\n}\n\nfunction useAnimateBackwards(weeks: DayInfo[][]): boolean | undefined {\n const previousNavigatedDateRef = React.useRef<Date | undefined>(undefined);\n React.useEffect(() => {\n previousNavigatedDateRef.current = weeks[0][0].originalDate;\n });\n const previousNavigatedDate = previousNavigatedDateRef.current;\n\n // eslint-disable-next-line react-hooks/refs\n if (!previousNavigatedDate || previousNavigatedDate.getTime() === weeks[0][0].originalDate.getTime()) {\n return undefined;\n // eslint-disable-next-line react-hooks/refs\n } else if (previousNavigatedDate <= weeks[0][0].originalDate) {\n return false;\n } else {\n return true;\n }\n}\n\nexport const CalendarDayGrid: React.FunctionComponent<CalendarDayGridProps> = props => {\n const navigatedDayRef = React.useRef<HTMLTableCellElement>(\n null,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ) as React.MutableRefObject<HTMLTableCellElement | null>;\n\n const activeDescendantId = useId();\n\n const onSelectDate = (selectedDate: Date): void => {\n const { firstDayOfWeek, minDate, maxDate, workWeekDays, daysToSelectInDayView, restrictedDates } = props;\n const restrictedDatesOptions = { minDate, maxDate, restrictedDates };\n\n // eslint-disable-next-line react-hooks/immutability\n let dateRange = getDateRangeArray(selectedDate, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView);\n dateRange = getBoundedDateRange(dateRange, minDate, maxDate);\n\n dateRange = dateRange.filter((d: Date) => {\n return !isRestrictedDate(d, restrictedDatesOptions);\n });\n\n props.onSelectDate?.(selectedDate, dateRange);\n props.onNavigateDate?.(selectedDate, true);\n };\n\n const [daysRef, getSetRefCallback] = useDayRefs();\n\n const weeks = useWeeks(props, onSelectDate, getSetRefCallback);\n const animateBackwards = useAnimateBackwards(weeks);\n\n const [getWeekCornerStyles, calculateRoundedStyles] = useWeekCornerStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n navigatedDayRef.current?.focus?.();\n },\n }),\n [],\n );\n\n /**\n *\n * Section for setting hover/pressed styles. Because we want arbitrary blobs of days to be selectable, to support\n * highlighting every day in the month for month view, css :hover style isn't enough, so we need mouse callbacks\n * to set classnames on all relevant child refs to apply the styling\n *\n */\n const getDayInfosInRangeOfDay = (dayToCompare: DayInfo): DayInfo[] => {\n // The hover state looks weird with non-contiguous days in work week view. In work week, show week hover state\n const dateRangeHoverType = getDateRangeTypeToUse(props.dateRangeType, props.workWeekDays);\n\n // gets all the dates for the given date range type that are in the same date range as the given day\n const dateRange = getDateRangeArray(\n dayToCompare.originalDate,\n dateRangeHoverType,\n props.firstDayOfWeek,\n props.workWeekDays,\n props.daysToSelectInDayView,\n ).map((date: Date) => date.getTime());\n\n // gets all the day refs for the given dates\n const dayInfosInRange = weeks.reduce((accumulatedValue: DayInfo[], currentWeek: DayInfo[]) => {\n return accumulatedValue.concat(\n currentWeek.filter((weekDay: DayInfo) => dateRange.indexOf(weekDay.originalDate.getTime()) !== -1),\n );\n }, []);\n\n return dayInfosInRange;\n };\n\n const getRefsFromDayInfos = (dayInfosInRange: DayInfo[]): (HTMLElement | null)[] => {\n let dayRefs: (HTMLElement | null)[] = [];\n dayRefs = dayInfosInRange.map((dayInfo: DayInfo) => daysRef.current[dayInfo.key]);\n\n return dayRefs;\n };\n\n const {\n gridLabel,\n dateRangeType,\n showWeekNumbers,\n labelledBy,\n lightenDaysOutsideNavigatedMonth,\n animationDirection = AnimationDirection.Vertical,\n } = props;\n\n const classNames = useCalendarDayGridStyles_unstable({\n animateBackwards,\n animationDirection,\n dateRangeType,\n lightenDaysOutsideNavigatedMonth:\n lightenDaysOutsideNavigatedMonth === undefined ? true : lightenDaysOutsideNavigatedMonth,\n showWeekNumbers,\n });\n\n // When the month is highlighted get the corner dates so that styles can be added to them\n const weekCorners: WeekCorners = getWeekCornerStyles(weeks!);\n const partialWeekProps = {\n weeks,\n navigatedDayRef,\n calculateRoundedStyles,\n activeDescendantId,\n classNames,\n weekCorners,\n getDayInfosInRangeOfDay,\n getRefsFromDayInfos,\n } as const;\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid-linear' });\n const firstWeek = weeks[0];\n const finalWeek = weeks![weeks!.length - 1];\n // Single navigation epoch for all rows in the grid. Derived from the first visible day's key\n // (`Date.toString()`), which changes when the user navigates to a different month but stays\n // stable across intra-month interactions (e.g. day selection).\n const navigationEpoch = firstWeek[0].key;\n\n return (\n <table\n className={mergeClasses(classNames.table, props.className)}\n aria-multiselectable=\"false\"\n aria-label={gridLabel}\n aria-labelledby={labelledBy}\n aria-activedescendant={activeDescendantId}\n role=\"grid\"\n {...arrowNavigationAttributes}\n >\n <tbody>\n <CalendarMonthHeaderRow {...props} classNames={classNames} weeks={weeks} />\n <DirectionalSlideOut\n edge=\"first\"\n replayKey={navigationEpoch}\n animationDirection={animationDirection}\n animateBackwards={animateBackwards}\n >\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={firstWeek}\n weekIndex={-1}\n rowClassName={classNames.firstTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n </DirectionalSlideOut>\n {weeks!.slice(1, weeks!.length - 1).map((week: DayInfo[], weekIndex: number) => (\n <DirectionalSlideIn\n key={weekIndex}\n replayKey={navigationEpoch}\n animationDirection={animationDirection}\n animateBackwards={animateBackwards}\n >\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={week}\n weekIndex={weekIndex}\n rowClassName={classNames.weekRow}\n />\n </DirectionalSlideIn>\n ))}\n <DirectionalSlideOut\n edge=\"last\"\n replayKey={navigationEpoch}\n animationDirection={animationDirection}\n animateBackwards={animateBackwards}\n >\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={finalWeek}\n weekIndex={-2}\n rowClassName={classNames.lastTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n </DirectionalSlideOut>\n </tbody>\n </table>\n );\n};\nCalendarDayGrid.displayName = 'CalendarDayGrid';\n\n/**\n * When given work week, if the days are non-contiguous, the hover states look really weird. So for non-contiguous\n * work weeks, we'll just show week view instead.\n */\nfunction getDateRangeTypeToUse(dateRangeType: DateRangeType, workWeekDays: DayOfWeek[] | undefined): DateRangeType {\n if (workWeekDays && dateRangeType === DateRangeType.WorkWeek) {\n const sortedWWDays = workWeekDays.slice().sort();\n let isContiguous = true;\n for (let i = 1; i < sortedWWDays.length; i++) {\n if (sortedWWDays[i] !== sortedWWDays[i - 1] + 1) {\n isContiguous = false;\n break;\n }\n }\n\n if (!isContiguous || workWeekDays.length === 0) {\n return DateRangeType.Week;\n }\n }\n\n return dateRangeType;\n}\n"],"names":["React","useArrowNavigationGroup","useId","getBoundedDateRange","getDateRangeArray","isRestrictedDate","DateRangeType","useCalendarDayGridStyles_unstable","CalendarMonthHeaderRow","CalendarGridRow","useWeeks","useWeekCornerStyles","mergeClasses","DirectionalSlideIn","DirectionalSlideOut","AnimationDirection","useDayRefs","daysRef","useRef","getSetRefCallback","dayKey","element","current","useAnimateBackwards","weeks","previousNavigatedDateRef","undefined","useEffect","originalDate","previousNavigatedDate","getTime","CalendarDayGrid","props","navigatedDayRef","activeDescendantId","onSelectDate","selectedDate","firstDayOfWeek","minDate","maxDate","workWeekDays","daysToSelectInDayView","restrictedDates","restrictedDatesOptions","dateRange","dateRangeType","filter","d","onNavigateDate","animateBackwards","getWeekCornerStyles","calculateRoundedStyles","useImperativeHandle","componentRef","focus","getDayInfosInRangeOfDay","dayToCompare","dateRangeHoverType","getDateRangeTypeToUse","map","date","dayInfosInRange","reduce","accumulatedValue","currentWeek","concat","weekDay","indexOf","getRefsFromDayInfos","dayRefs","dayInfo","key","gridLabel","showWeekNumbers","labelledBy","lightenDaysOutsideNavigatedMonth","animationDirection","Vertical","classNames","weekCorners","partialWeekProps","arrowNavigationAttributes","axis","firstWeek","finalWeek","length","navigationEpoch","table","className","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","role","tbody","edge","replayKey","week","weekIndex","rowClassName","firstTransitionWeek","aria-role","ariaHidden","slice","weekRow","lastTransitionWeek","displayName","WorkWeek","sortedWWDays","sort","isContiguous","i","Week"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,KAAK,QAAQ,4BAA4B;AAClD,SAASC,mBAAmB,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,cAAc;AACtG,SAASC,iCAAiC,QAAQ,oCAAoC;AACtF,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,QAAQ,QAAQ,aAAa;AAEtC,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,SAASC,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,kBAAkB,EAAEC,mBAAmB,QAAQ,8BAA8B;AACtF,SAASC,kBAAkB,QAAQ,iBAAiB;AAOpD,SAASC;IACP,MAAMC,UAAUjB,MAAMkB,MAAM,CAA8B,CAAC;IAE3D,MAAMC,oBAAoB,CAACC,SAAmB,CAACC;YAC7C,IAAIA,YAAY,MAAM;gBACpB,OAAOJ,QAAQK,OAAO,CAACF,OAAO;YAChC,OAAO;gBACLH,QAAQK,OAAO,CAACF,OAAO,GAAGC;YAC5B;QACF;IAEA,OAAO;QAACJ;QAASE;KAAkB;AACrC;AAEA,SAASI,oBAAoBC,KAAkB;IAC7C,MAAMC,2BAA2BzB,MAAMkB,MAAM,CAAmBQ;IAChE1B,MAAM2B,SAAS,CAAC;QACdF,yBAAyBH,OAAO,GAAGE,KAAK,CAA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QACNc,WAAW,CAAC;QACZC,cAAcrB,WAAW2B,kBAAkB;QAC3CJ,aAAU;QACVC,YAAY;;AAMxB,EAAE;AACFvE,gBAAgB2E,WAAW,GAAG;AAE9B;;;CAGC,GACD,SAAShD,sBAAsBb,aAA4B,EAAEL,YAAqC;IAChG,IAAIA,gBAAgBK,kBAAkBvC,cAAcqG,QAAQ,EAAE;QAC5D,MAAMC,eAAepE,aAAa+D,KAAK,GAAGM,IAAI;QAC9C,IAAIC,eAAe;QACnB,IAAK,IAAIC,IAAI,GAAGA,IAAIH,aAAavB,MAAM,EAAE0B,IAAK;YAC5C,IAAIH,YAAY,CAACG,EAAE,KAAKH,YAAY,CAACG,IAAI,EAAE,GAAG,GAAG;gBAC/CD,eAAe;gBACf;YACF;QACF;QAEA,IAAI,CAACA,gBAAgBtE,aAAa6C,MAAM,KAAK,GAAG;YAC9C,OAAO/E,cAAc0G,IAAI;QAC3B;IACF;IAEA,OAAOnE;AACT"}
|
|
@@ -10,7 +10,7 @@ import { extraCalendarDayGridClassNames } from './useCalendarDayGridStyles.style
|
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/ export const CalendarGridDayCell = (props)=>{
|
|
13
|
-
'use no memo';
|
|
13
|
+
'use no memo'; // justified: compiler would optimize unknown function — manual opt-out to preserve runtime behavior
|
|
14
14
|
const { navigatedDate, dateTimeFormatter, allFocusable, strings, activeDescendantId, navigatedDayRef, calculateRoundedStyles, weeks, classNames, day, dayIndex, weekIndex, weekCorners, ariaHidden, customDayCellRef, dateRangeType, daysToSelectInDayView, onSelectDate, restrictedDates, minDate, maxDate, onNavigateDate, getDayInfosInRangeOfDay, getRefsFromDayInfos } = props;
|
|
15
15
|
var _weekCorners_;
|
|
16
16
|
const cornerStyle = (_weekCorners_ = weekCorners === null || weekCorners === void 0 ? void 0 : weekCorners[weekIndex + '_' + dayIndex]) !== null && _weekCorners_ !== void 0 ? _weekCorners_ : '';
|