@fluentui/react-calendar-compat 0.1.8 → 0.1.10
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/dist/index.d.ts +11 -1
- package/lib/components/Calendar/Calendar.js +6 -19
- package/lib/components/Calendar/Calendar.js.map +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.js +89 -53
- package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js +84 -46
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js +2 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +245 -114
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib/components/CalendarMonth/index.js +1 -1
- package/lib/components/CalendarMonth/index.js.map +1 -1
- package/lib/components/CalendarMonth/{useCalendarMonthStyles.js → useCalendarMonthStyles.styles.js} +4 -2
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -0
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js +169 -79
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib/utils/animations.js +5 -6
- package/lib/utils/animations.js.map +1 -1
- package/lib/utils/dateGrid/dateGrid.types.js.map +1 -1
- package/lib/utils/dateGrid/getDayGrid.js +1 -0
- package/lib/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.js +6 -19
- package/lib-commonjs/components/Calendar/Calendar.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js +126 -155
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js +133 -137
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js +2 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +417 -333
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js +2 -2
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/index.js +1 -1
- package/lib-commonjs/components/CalendarMonth/index.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/{useCalendarMonthStyles.js → useCalendarMonthStyles.styles.js} +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js +255 -225
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/utils/animations.js +4 -5
- package/lib-commonjs/utils/animations.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDayGrid.js +1 -0
- package/lib-commonjs/utils/dateGrid/getDayGrid.js.map +1 -1
- package/package.json +4 -4
- package/lib/components/CalendarMonth/useCalendarMonthStyles.js.map +0 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js.map +0 -1
@@ -15,29 +15,38 @@ export const calendarDayClassNames = {
|
|
15
15
|
const useRootStyles = /*#__PURE__*/__styles({
|
16
16
|
base: {
|
17
17
|
B7ck84d: "f1e4lqlz",
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
Byoj8tv: 0,
|
19
|
+
uwmqm3: 0,
|
20
|
+
z189sj: 0,
|
21
|
+
z8tnut: 0,
|
22
|
+
B0ocmuz: "f1sy4kr4",
|
22
23
|
a9b677: "f4m2ahc"
|
23
24
|
},
|
24
25
|
normalize: {
|
25
26
|
E5pizo: "f1couhl3",
|
26
27
|
B7ck84d: "f1ewtqcl",
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
jrapky: 0,
|
29
|
+
Frg6f3: 0,
|
30
|
+
t21cq0: 0,
|
31
|
+
B6of3ja: 0,
|
32
|
+
B74szlk: "f1s184ao",
|
33
|
+
Byoj8tv: 0,
|
34
|
+
uwmqm3: 0,
|
35
|
+
z189sj: 0,
|
36
|
+
z8tnut: 0,
|
37
|
+
B0ocmuz: "f1mk8lai"
|
35
38
|
},
|
36
39
|
showWeekNumbers: {
|
37
40
|
a9b677: "fl524qk"
|
38
41
|
}
|
39
42
|
}, {
|
40
|
-
d: [".f1e4lqlz{box-sizing:content-box;}", ".
|
43
|
+
d: [".f1e4lqlz{box-sizing:content-box;}", [".f1sy4kr4{padding:12px;}", {
|
44
|
+
p: -1
|
45
|
+
}], ".f4m2ahc{width:196px;}", ".f1couhl3{box-shadow:none;}", ".f1ewtqcl{box-sizing:border-box;}", [".f1s184ao{margin:0;}", {
|
46
|
+
p: -1
|
47
|
+
}], [".f1mk8lai{padding:0;}", {
|
48
|
+
p: -1
|
49
|
+
}], ".fl524qk{width:226px;}"]
|
41
50
|
});
|
42
51
|
const useHeaderStyles = /*#__PURE__*/__styles({
|
43
52
|
base: {
|
@@ -58,10 +67,11 @@ const useMonthAndYearStyles = /*#__PURE__*/__styles({
|
|
58
67
|
vrafjx: ["f1n71otn", "f1deefiw"],
|
59
68
|
oivjwe: "f1h8hb77",
|
60
69
|
wvpqe5: ["f1deefiw", "f1n71otn"],
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
70
|
+
Beyfa6y: 0,
|
71
|
+
Bbmb7ep: 0,
|
72
|
+
Btl43ni: 0,
|
73
|
+
B7oj6ja: 0,
|
74
|
+
Dimara: "ft85np5",
|
65
75
|
sj55zd: "f19n0e5",
|
66
76
|
mc9l5x: "f14t3ns0",
|
67
77
|
Bh6795r: "fqerorx",
|
@@ -69,12 +79,14 @@ const useMonthAndYearStyles = /*#__PURE__*/__styles({
|
|
69
79
|
Be2twd7: "fkhj508",
|
70
80
|
Bhrd7zp: "fl43uef",
|
71
81
|
Bg96gwp: "f336tjw",
|
72
|
-
B68tc82:
|
73
|
-
Bmxbyg5:
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
82
|
+
B68tc82: 0,
|
83
|
+
Bmxbyg5: 0,
|
84
|
+
Bpg54ce: "f1a3p1vp",
|
85
|
+
Byoj8tv: 0,
|
86
|
+
uwmqm3: 0,
|
87
|
+
z189sj: 0,
|
88
|
+
z8tnut: 0,
|
89
|
+
B0ocmuz: ["f1td8mcv", "f1udkdxo"],
|
78
90
|
fsow6f: ["f1o700av", "fes3tcz"],
|
79
91
|
ygn44y: "f1cmbuwj",
|
80
92
|
Huce71: "fz5stix"
|
@@ -89,20 +101,34 @@ const useMonthAndYearStyles = /*#__PURE__*/__styles({
|
|
89
101
|
Jwef8y: "f18a0fwf",
|
90
102
|
Bi91k9c: "f3sdaeg",
|
91
103
|
eoavqd: "f8491dx",
|
92
|
-
|
93
|
-
ukgb2i:
|
94
|
-
|
104
|
+
pugfm4: 0,
|
105
|
+
ukgb2i: 0,
|
106
|
+
Dwtyhm: 0,
|
107
|
+
Biisq0s: "f15rpok4",
|
95
108
|
iro3zm: "f1wvkgvo",
|
96
109
|
B2d53fq: "f1wdoaqd",
|
97
110
|
c3iz72: "f13c0t7h",
|
98
|
-
|
99
|
-
Bx68yb:
|
100
|
-
|
111
|
+
mghro0: 0,
|
112
|
+
Bx68yb: 0,
|
113
|
+
syojd9: 0,
|
114
|
+
E5hylx: "fy2scak"
|
101
115
|
}
|
102
116
|
}, {
|
103
|
-
d: [".f122n59{align-items:center;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".
|
117
|
+
d: [".f122n59{align-items:center;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", [".ft85np5{border-radius:var(--borderRadiusMedium);}", {
|
118
|
+
p: -1
|
119
|
+
}], ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f14t3ns0{display:inline-block;}", ".fqerorx{flex-grow:1;}", ".f1mo0ibp{font-family:inherit;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f336tjw{line-height:28px;}", [".f1a3p1vp{overflow:hidden;}", {
|
120
|
+
p: -1
|
121
|
+
}], [".f1td8mcv{padding:0 4px 0 10px;}", {
|
122
|
+
p: -1
|
123
|
+
}], [".f1udkdxo{padding:0 10px 0 4px;}", {
|
124
|
+
p: -1
|
125
|
+
}], ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f1cmbuwj{text-overflow:ellipsis;}", ".fz5stix{white-space:nowrap;}", ".fhsqnsn{animation-duration:0.267s;}", ".fywypte{animation-fill-mode:both;}", ".f1h7u52p{animation-name:f5j8bii;}", ".fjq4c94{animation-timing-function:cubic-bezier(.1,.25,.75,.9);}"],
|
104
126
|
k: ["@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}"],
|
105
|
-
h: [".f18a0fwf:hover{background-color:var(--colorBrandBackgroundInvertedHover);}", ".f3sdaeg:hover{color:var(--colorBrandForegroundOnLightHover);}", ".f8491dx:hover{cursor:pointer;}", ".
|
127
|
+
h: [".f18a0fwf:hover{background-color:var(--colorBrandBackgroundInvertedHover);}", ".f3sdaeg:hover{color:var(--colorBrandForegroundOnLightHover);}", ".f8491dx:hover{cursor:pointer;}", [".f15rpok4:hover{outline:1px solid var(--colorTransparentStroke);}", {
|
128
|
+
p: -1
|
129
|
+
}], ".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);}", {
|
130
|
+
p: -1
|
131
|
+
}]]
|
106
132
|
});
|
107
133
|
const useMonthComponentsStyles = /*#__PURE__*/__styles({
|
108
134
|
base: {
|
@@ -119,37 +145,49 @@ const useHeaderIconButtonStyles = /*#__PURE__*/__styles({
|
|
119
145
|
vrafjx: ["f1n71otn", "f1deefiw"],
|
120
146
|
oivjwe: "f1h8hb77",
|
121
147
|
wvpqe5: ["f1deefiw", "f1n71otn"],
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
148
|
+
Beyfa6y: 0,
|
149
|
+
Bbmb7ep: 0,
|
150
|
+
Btl43ni: 0,
|
151
|
+
B7oj6ja: 0,
|
152
|
+
Dimara: "ft85np5",
|
126
153
|
sj55zd: "f11d4kpn",
|
127
154
|
mc9l5x: "ftgm304",
|
128
155
|
Bahqtrf: "f1mo0ibp",
|
129
156
|
Be2twd7: "fy9rknc",
|
130
157
|
Bqenvij: "fxldao9",
|
131
158
|
Bg96gwp: "f336tjw",
|
132
|
-
B68tc82:
|
133
|
-
Bmxbyg5:
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
159
|
+
B68tc82: 0,
|
160
|
+
Bmxbyg5: 0,
|
161
|
+
Bpg54ce: "f1gl81tg",
|
162
|
+
Byoj8tv: 0,
|
163
|
+
uwmqm3: 0,
|
164
|
+
z189sj: 0,
|
165
|
+
z8tnut: 0,
|
166
|
+
B0ocmuz: "f1mk8lai",
|
138
167
|
qhf8xq: "f10pi13n",
|
139
168
|
fsow6f: "f17mccla",
|
140
169
|
a9b677: "f1w9dchk",
|
141
170
|
Jwef8y: "f18a0fwf",
|
142
171
|
Bi91k9c: "f3sdaeg",
|
143
172
|
eoavqd: "f8491dx",
|
144
|
-
|
145
|
-
ukgb2i:
|
146
|
-
|
173
|
+
pugfm4: 0,
|
174
|
+
ukgb2i: 0,
|
175
|
+
Dwtyhm: 0,
|
176
|
+
Biisq0s: "f15rpok4",
|
147
177
|
iro3zm: "f1wvkgvo",
|
148
178
|
B2d53fq: "f1wdoaqd"
|
149
179
|
}
|
150
180
|
}, {
|
151
|
-
d: [".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".
|
152
|
-
|
181
|
+
d: [".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", [".ft85np5{border-radius:var(--borderRadiusMedium);}", {
|
182
|
+
p: -1
|
183
|
+
}], ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".ftgm304{display:block;}", ".f1mo0ibp{font-family:inherit;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fxldao9{height:28px;}", ".f336tjw{line-height:28px;}", [".f1gl81tg{overflow:visible;}", {
|
184
|
+
p: -1
|
185
|
+
}], [".f1mk8lai{padding:0;}", {
|
186
|
+
p: -1
|
187
|
+
}], ".f10pi13n{position:relative;}", ".f17mccla{text-align:center;}", ".f1w9dchk{width:28px;}"],
|
188
|
+
h: [".f18a0fwf:hover{background-color:var(--colorBrandBackgroundInvertedHover);}", ".f3sdaeg:hover{color:var(--colorBrandForegroundOnLightHover);}", ".f8491dx:hover{cursor:pointer;}", [".f15rpok4:hover{outline:1px solid var(--colorTransparentStroke);}", {
|
189
|
+
p: -1
|
190
|
+
}], ".f1wvkgvo:hover:active{background-color:var(--colorBrandBackgroundInvertedPressed);}", ".f1wdoaqd:hover:active{color:var(--colorBrandForegroundOnLightPressed);}"]
|
153
191
|
});
|
154
192
|
const useDisabledStyleStyles = /*#__PURE__*/__styles({
|
155
193
|
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","
|
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","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"sources":["useCalendarDayStyles.styles.js"],"sourcesContent":["import { 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 }\n }\n});\n/**\n * @internal\n *\n * Apply styling to the CalendarDay slots based on the state\n */ export const useCalendarDayStyles_unstable = (props)=>{\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.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AY,EAAEmF,kBAAkB,CAAC9E,IAAI,EAAE8E,kBAAkB,CAAChC,SAAS,EAAEK,iBAAiB,IAAI2B,kBAAkB,CAAC3B,iBAAiB,CAAC;IAChLvD,eAAe,EAAET,YAAY,CAACK,qBAAqB,CAACI,eAAe,EAAEmF,qBAAqB,CAAC/E,IAAI,CAAC;IAChGH,gBAAgB,EAAEV,YAAY,CAACK,qBAAqB,CAACK,gBAAgB,EAAEmF,sBAAsB,CAAChF,IAAI,CAAC;IACnGF,aAAa,EAAEX,YAAY,CAACK,qBAAqB,CAACM,aAAa,EAAEmF,mBAAmB,CAACjF,IAAI;EAC7F,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarDayGrid.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { AnimationDirection } from '../Calendar/Calendar.types';\nimport { DayOfWeek, FirstWeekOfYear, DateRangeType } from '../../utils';\nimport type { CalendarStrings, DateFormatting, DayGridOptions } from '../../utils';\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ICalendarDayGrid {\n focus(): void;\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayGridProps extends DayGridOptions {\n /**\n * Optional callback to access the ICalendarDayGrid interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<ICalendarDayGrid>;\n\n /**\n * Additional CSS class(es) to apply to the CalendarDayGrid.\n */\n className?: string;\n\n /**\n * Localized strings to use in the CalendarDayGrid\n */\n strings: CalendarStrings;\n\n /**\n * The currently selected date\n */\n selectedDate: Date;\n\n /**\n * The currently navigated date\n */\n navigatedDate: Date;\n\n /**\n * Callback issued when a date is selected\n * @param date - The date the user selected\n * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set\n * for the component.\n */\n onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void;\n\n /**\n * Callback issued when a date in the calendar is navigated\n * @param date - The date that is navigated to\n * @param focusOnNavigatedDay - Whether to set the focus to the navigated date.\n */\n onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;\n\n /**\n * Callback issued when calendar day is closed\n */\n onDismiss?: () => void;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek: DayOfWeek;\n\n /**\n * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,\n * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values\n * @default FirstWeekOfYear.FirstDay\n */\n firstWeekOfYear: FirstWeekOfYear;\n\n /**\n * The date range type indicating how many days should be selected as the user\n * selects days\n * @default DateRangeType.Day\n */\n dateRangeType: DateRangeType;\n\n /**\n * The number of days to select while dateRangeType === DateRangeType.Day. Used in order to have multi-day\n * views.\n * @default 1\n */\n daysToSelectInDayView?: number;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter: DateFormatting;\n\n /**\n * Ref callback for individual days. Allows for customization of the styling, properties, or listeners of the\n * specific day.\n */\n customDayCellRef?: (element: HTMLElement, date: Date, classNames: CalendarDayGridStyles) => void;\n\n /**\n * How many weeks to show by default. If not provided, will show enough weeks to display the current\n * month, between 4 and 6 depending\n * @default undefined\n */\n weeksToShow?: number;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date earlier than this value.\n */\n minDate?: Date;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date later than this value.\n */\n maxDate?: Date;\n\n /**\n * If set the Calendar will not allow selection of dates in this array.\n */\n restrictedDates?: Date[];\n\n /**\n * The days that are selectable when `dateRangeType` is WorkWeek.\n * If `dateRangeType` is not WorkWeek this property does nothing.\n * @default [Monday,Tuesday,Wednesday,Thursday,Friday]\n */\n workWeekDays?: DayOfWeek[];\n\n /**\n * Whether the close button should be shown or not\n * @default false\n */\n showCloseButton?: boolean;\n\n /**\n * Allows all dates and buttons to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * The ID of the control that labels this one\n */\n labelledBy?: string;\n\n /**\n * Whether to show days outside the selected month with lighter styles\n * @default true\n */\n lightenDaysOutsideNavigatedMonth?: boolean;\n\n /**\n * The cardinal directions for animation to occur during transitions, either horizontal or veritcal\n */\n animationDirection?: AnimationDirection;\n\n /**\n * Optional callback function to mark specific days with a small symbol. Fires when the date range changes,\n * gives the starting and ending displayed dates and expects the list of which days in between should be\n * marked.\n */\n getMarkedDays?: (startingDate: Date, endingDate: Date) => Date[];\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayGridStyleProps {\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * The date range type\n */\n dateRangeType?: DateRangeType;\n\n /**\n * Whether week numbers are being shown\n */\n showWeekNumbers?: boolean;\n\n /**\n * Whether to show days outside the selected month with lighter styles\n */\n lightenDaysOutsideNavigatedMonth?: boolean;\n\n /**\n * Whether grid entering animation should be forwards or backwards\n */\n animateBackwards?: boolean;\n\n /**\n * The cardinal directions for animation to occur during transitions, either horizontal or vertical\n */\n animationDirection?: AnimationDirection;\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayGridStyles {\n /**\n * The style for the root div\n */\n wrapper?: string;\n\n /**\n * The style for the table containing the grid\n */\n table?: string;\n\n /**\n * The style to apply to the grid cells for days\n */\n dayCell?: string;\n\n /**\n * The style to apply to grid cells for days in the selected range\n */\n daySelected?: string;\n\n /**\n * The style to apply to row around weeks\n */\n weekRow?: string;\n\n /**\n * The style to apply to the column headers above the weeks\n */\n weekDayLabelCell?: string;\n\n /**\n * The style to apply to grid cells for week numbers\n */\n weekNumberCell?: string;\n\n /**\n * The style to apply to individual days that are outside the min/max date range\n */\n dayOutsideBounds?: string;\n\n /**\n * The style to apply to individual days that are outside the current month\n */\n dayOutsideNavigatedMonth?: string;\n\n /**\n * The style to apply to the button element within the day cells\n */\n dayButton?: string;\n\n /**\n * The style to apply to the individual button element that matches the \"today\" parameter\n */\n dayIsToday?: string;\n\n /**\n * The style applied to the first placeholder week used during transitions\n */\n firstTransitionWeek?: string;\n\n /**\n * The style applied to the last placeholder week used during transitions\n */\n lastTransitionWeek?: string;\n\n /**\n * The style applied to the marker on days to mark as important\n */\n dayMarker?: string;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
1
|
+
{"version":3,"sources":["CalendarDayGrid.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { AnimationDirection } from '../Calendar/Calendar.types';\nimport { DayOfWeek, FirstWeekOfYear, DateRangeType } from '../../utils';\nimport type { CalendarStrings, DateFormatting, DayGridOptions } from '../../utils';\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ICalendarDayGrid {\n focus(): void;\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayGridProps extends DayGridOptions {\n /**\n * Optional callback to access the ICalendarDayGrid interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<ICalendarDayGrid>;\n\n /**\n * Additional CSS class(es) to apply to the CalendarDayGrid.\n */\n className?: string;\n\n /**\n * Localized strings to use in the CalendarDayGrid\n */\n strings: CalendarStrings;\n\n /**\n * The currently selected date\n */\n selectedDate: Date;\n\n /**\n * The currently navigated date\n */\n navigatedDate: Date;\n\n /**\n * Callback issued when a date is selected\n * @param date - The date the user selected\n * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set\n * for the component.\n */\n onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void;\n\n /**\n * Callback issued when a date in the calendar is navigated\n * @param date - The date that is navigated to\n * @param focusOnNavigatedDay - Whether to set the focus to the navigated date.\n */\n onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;\n\n /**\n * Callback issued when calendar day is closed\n */\n onDismiss?: () => void;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek: DayOfWeek;\n\n /**\n * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,\n * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values\n * @default FirstWeekOfYear.FirstDay\n */\n firstWeekOfYear: FirstWeekOfYear;\n\n /**\n * The date range type indicating how many days should be selected as the user\n * selects days\n * @default DateRangeType.Day\n */\n dateRangeType: DateRangeType;\n\n /**\n * The number of days to select while dateRangeType === DateRangeType.Day. Used in order to have multi-day\n * views.\n * @default 1\n */\n daysToSelectInDayView?: number;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter: DateFormatting;\n\n /**\n * Ref callback for individual days. Allows for customization of the styling, properties, or listeners of the\n * specific day.\n */\n customDayCellRef?: (element: HTMLElement, date: Date, classNames: CalendarDayGridStyles) => void;\n\n /**\n * How many weeks to show by default. If not provided, will show enough weeks to display the current\n * month, between 4 and 6 depending\n * @default undefined\n */\n weeksToShow?: number;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date earlier than this value.\n */\n minDate?: Date;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a date later than this value.\n */\n maxDate?: Date;\n\n /**\n * If set the Calendar will not allow selection of dates in this array.\n */\n restrictedDates?: Date[];\n\n /**\n * The days that are selectable when `dateRangeType` is WorkWeek.\n * If `dateRangeType` is not WorkWeek this property does nothing.\n * @default [Monday,Tuesday,Wednesday,Thursday,Friday]\n */\n workWeekDays?: DayOfWeek[];\n\n /**\n * Whether the close button should be shown or not\n * @default false\n */\n showCloseButton?: boolean;\n\n /**\n * Allows all dates and buttons to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * The ID of the control that labels this one\n */\n labelledBy?: string;\n\n /**\n * Whether to show days outside the selected month with lighter styles\n * @default true\n */\n lightenDaysOutsideNavigatedMonth?: boolean;\n\n /**\n * The cardinal directions for animation to occur during transitions, either horizontal or veritcal\n */\n animationDirection?: AnimationDirection;\n\n /**\n * Optional callback function to mark specific days with a small symbol. Fires when the date range changes,\n * gives the starting and ending displayed dates and expects the list of which days in between should be\n * marked.\n */\n getMarkedDays?: (startingDate: Date, endingDate: Date) => Date[];\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayGridStyleProps {\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * The date range type\n */\n dateRangeType?: DateRangeType;\n\n /**\n * Whether week numbers are being shown\n */\n showWeekNumbers?: boolean;\n\n /**\n * Whether to show days outside the selected month with lighter styles\n */\n lightenDaysOutsideNavigatedMonth?: boolean;\n\n /**\n * Whether grid entering animation should be forwards or backwards\n */\n animateBackwards?: boolean;\n\n /**\n * The cardinal directions for animation to occur during transitions, either horizontal or vertical\n */\n animationDirection?: AnimationDirection;\n}\n\n/**\n * @internal\n */\nexport interface CalendarDayGridStyles {\n /**\n * The style for the root div\n */\n wrapper?: string;\n\n /**\n * The style for the table containing the grid\n */\n table?: string;\n\n /**\n * The style to apply to the grid cells for days\n */\n dayCell?: string;\n\n /**\n * The style to apply to grid cells for days in the selected range\n */\n daySelected?: string;\n\n /**\n * The classname applied when a single day is selected\n */\n daySingleSelected?: string;\n\n /**\n * The style to apply to row around weeks\n */\n weekRow?: string;\n\n /**\n * The style to apply to the column headers above the weeks\n */\n weekDayLabelCell?: string;\n\n /**\n * The style to apply to grid cells for week numbers\n */\n weekNumberCell?: string;\n\n /**\n * The style to apply to individual days that are outside the min/max date range\n */\n dayOutsideBounds?: string;\n\n /**\n * The style to apply to individual days that are outside the current month\n */\n dayOutsideNavigatedMonth?: string;\n\n /**\n * The style to apply to the button element within the day cells\n */\n dayButton?: string;\n\n /**\n * The style to apply to the individual button element that matches the \"today\" parameter\n */\n dayIsToday?: string;\n\n /**\n * The style applied to the first placeholder week used during transitions\n */\n firstTransitionWeek?: string;\n\n /**\n * The style applied to the last placeholder week used during transitions\n */\n lastTransitionWeek?: string;\n\n /**\n * The style applied to the marker on days to mark as important\n */\n dayMarker?: string;\n\n /**\n * The classname applied to the day \"today\" span\n */\n dayTodayMarker?: string;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
@@ -128,7 +128,7 @@ import { extraCalendarDayGridClassNames } from './useCalendarDayGridStyles.style
|
|
128
128
|
}
|
129
129
|
const isFocusable = !ariaHidden && (allFocusable || (day.isInBounds ? true : undefined));
|
130
130
|
return /*#__PURE__*/ React.createElement("td", {
|
131
|
-
className: mergeClasses(classNames.dayCell, weekCorners && cornerStyle, day.isSelected && classNames.daySelected, !day.isInBounds && classNames.dayOutsideBounds, !day.isInMonth && classNames.dayOutsideNavigatedMonth),
|
131
|
+
className: mergeClasses(classNames.dayCell, weekCorners && cornerStyle, day.isSelected && !day.isSingleSelected && classNames.daySelected, day.isSingleSelected && classNames.daySingleSelected, !day.isInBounds && classNames.dayOutsideBounds, !day.isInMonth && classNames.dayOutsideNavigatedMonth),
|
132
132
|
ref: (element)=>{
|
133
133
|
customDayCellRef === null || customDayCellRef === void 0 ? void 0 : customDayCellRef(element, day.originalDate, classNames);
|
134
134
|
day.setRef(element);
|
@@ -156,6 +156,7 @@ import { extraCalendarDayGridClassNames } from './useCalendarDayGridStyles.style
|
|
156
156
|
type: "button",
|
157
157
|
tabIndex: -1
|
158
158
|
}, /*#__PURE__*/ React.createElement("span", {
|
159
|
+
className: day.isToday ? mergeClasses(classNames.dayTodayMarker) : undefined,
|
159
160
|
"aria-hidden": "true"
|
160
161
|
}, dateTimeFormatter.formatDay(day.originalDate)), day.isMarked && /*#__PURE__*/ React.createElement("div", {
|
161
162
|
"aria-hidden": "true",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CalendarGridDayCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Enter } from '@fluentui/keyboard-keys';\nimport { getRTLSafeKey } from '@fluentui/react-utilities';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { mergeClasses } from '@griffel/react';\nimport { addDays, addWeeks, compareDates, findAvailableDate, DateRangeType } from '../../utils';\nimport { weekCornersClassNames } from './useWeekCornerStyles.styles';\nimport { extraCalendarDayGridClassNames } from './useCalendarDayGridStyles.styles';\nimport type { AvailableDateOptions } from '../../utils';\nimport type { DayInfo } from './CalendarDayGrid';\nimport type { CalendarGridRowProps } from './CalendarGridRow';\n\n/**\n * @internal\n */\nexport interface CalendarGridDayCellProps extends CalendarGridRowProps {\n day: DayInfo;\n dayIndex: number;\n}\n\n/**\n * @internal\n */\nexport const CalendarGridDayCell: React.FunctionComponent<CalendarGridDayCellProps> = props => {\n const {\n navigatedDate,\n dateTimeFormatter,\n allFocusable,\n strings,\n activeDescendantId,\n navigatedDayRef,\n calculateRoundedStyles,\n weeks,\n classNames,\n day,\n dayIndex,\n weekIndex,\n weekCorners,\n ariaHidden,\n customDayCellRef,\n dateRangeType,\n daysToSelectInDayView,\n onSelectDate,\n restrictedDates,\n minDate,\n maxDate,\n onNavigateDate,\n getDayInfosInRangeOfDay,\n getRefsFromDayInfos,\n } = props;\n const cornerStyle = weekCorners?.[weekIndex + '_' + dayIndex] ?? '';\n const isNavigatedDate = compareDates(navigatedDate, day.originalDate);\n\n const { dir } = useFluent_unstable();\n\n const navigateMonthEdge = (ev: React.KeyboardEvent<HTMLElement>, date: Date): void => {\n let targetDate: Date | undefined = undefined;\n let direction = 1; // by default search forward\n\n if (ev.key === ArrowUp) {\n targetDate = addWeeks(date, -1);\n direction = -1;\n } else if (ev.key === ArrowDown) {\n targetDate = addWeeks(date, 1);\n } else if (ev.key === getRTLSafeKey(ArrowLeft, dir)) {\n targetDate = addDays(date, -1);\n direction = -1;\n } else if (ev.key === getRTLSafeKey(ArrowRight, dir)) {\n targetDate = addDays(date, 1);\n }\n\n if (!targetDate) {\n // if we couldn't find a target date at all, do nothing\n return;\n }\n\n const findAvailableDateOptions: AvailableDateOptions = {\n initialDate: date,\n targetDate,\n direction,\n restrictedDates,\n minDate,\n maxDate,\n };\n\n // target date is restricted, search in whatever direction until finding the next possible date,\n // stopping at boundaries\n let nextDate = findAvailableDate(findAvailableDateOptions);\n\n if (!nextDate) {\n // if no dates available in initial direction, try going backwards\n findAvailableDateOptions.direction = -direction;\n nextDate = findAvailableDate(findAvailableDateOptions);\n }\n\n // if the nextDate is still inside the same focusZone area, let the focusZone handle setting the focus so we\n // don't jump the view unnecessarily\n const isInCurrentView =\n weeks &&\n nextDate &&\n weeks.slice(1, weeks.length - 1).some((week: DayInfo[]) => {\n return week.some((dayToCompare: DayInfo) => {\n return compareDates(dayToCompare.originalDate, nextDate!);\n });\n });\n if (isInCurrentView) {\n return;\n }\n\n // else, fire navigation on the date to change the view to show it\n if (nextDate) {\n onNavigateDate(nextDate, true);\n ev.preventDefault();\n }\n };\n\n const onMouseOverDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null, index: number) => {\n if (dayRef) {\n dayRef.classList.add(extraCalendarDayGridClassNames.hoverStyle);\n if (\n !dayInfos[index].isSelected &&\n dateRangeType === DateRangeType.Day &&\n daysToSelectInDayView &&\n daysToSelectInDayView > 1\n ) {\n // remove the static classes first to overwrite them\n dayRef.classList.remove(\n weekCornersClassNames.bottomLeftCornerDate!,\n weekCornersClassNames.bottomRightCornerDate!,\n weekCornersClassNames.topLeftCornerDate!,\n weekCornersClassNames.topRightCornerDate!,\n );\n\n const classNamesToAdd = calculateRoundedStyles(false, false, index > 0, index < dayRefs.length - 1).trim();\n if (classNamesToAdd) {\n dayRef.classList.add(...classNamesToAdd.trim().split(' '));\n }\n }\n }\n });\n };\n\n const onMouseDownDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null) => {\n if (dayRef) {\n dayRef.classList.add(extraCalendarDayGridClassNames.pressedStyle);\n }\n });\n };\n\n const onMouseUpDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null) => {\n if (dayRef) {\n dayRef.classList.remove(extraCalendarDayGridClassNames.pressedStyle);\n }\n });\n };\n\n const onMouseOutDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null, index: number) => {\n if (dayRef) {\n dayRef.classList.remove(extraCalendarDayGridClassNames.hoverStyle);\n dayRef.classList.remove(extraCalendarDayGridClassNames.pressedStyle);\n if (\n !dayInfos[index].isSelected &&\n dateRangeType === DateRangeType.Day &&\n daysToSelectInDayView &&\n daysToSelectInDayView > 1\n ) {\n const classNamesToAdd = calculateRoundedStyles(false, false, index > 0, index < dayRefs.length - 1).trim();\n if (classNamesToAdd) {\n dayRef.classList.remove(...classNamesToAdd.trim().split(' '));\n }\n }\n }\n });\n };\n\n const onDayKeyDown = (ev: React.KeyboardEvent<HTMLElement>): void => {\n if (ev.key === Enter) {\n onSelectDate?.(day.originalDate);\n } else {\n navigateMonthEdge(ev, day.originalDate);\n }\n };\n\n let ariaLabel =\n day.originalDate.getDate() +\n ', ' +\n strings.months[day.originalDate.getMonth()] +\n ', ' +\n day.originalDate.getFullYear();\n\n if (day.isMarked) {\n ariaLabel = ariaLabel + ', ' + strings.dayMarkedAriaLabel;\n }\n\n const isFocusable = !ariaHidden && (allFocusable || (day.isInBounds ? true : undefined));\n\n return (\n <td\n className={mergeClasses(\n classNames.dayCell,\n weekCorners && cornerStyle,\n day.isSelected && classNames.daySelected,\n !day.isInBounds && classNames.dayOutsideBounds,\n !day.isInMonth && classNames.dayOutsideNavigatedMonth,\n )}\n ref={(element: HTMLTableCellElement) => {\n customDayCellRef?.(element, day.originalDate, classNames);\n day.setRef(element);\n isNavigatedDate && (navigatedDayRef.current = element);\n }}\n aria-hidden={ariaHidden}\n aria-disabled={!ariaHidden && !day.isInBounds}\n onClick={day.isInBounds && !ariaHidden ? day.onSelected : undefined}\n onMouseOver={!ariaHidden ? onMouseOverDay : undefined}\n onMouseDown={!ariaHidden ? onMouseDownDay : undefined}\n onMouseUp={!ariaHidden ? onMouseUpDay : undefined}\n onMouseOut={!ariaHidden ? onMouseOutDay : undefined}\n onKeyDown={!ariaHidden ? onDayKeyDown : undefined}\n role=\"gridcell\"\n tabIndex={isNavigatedDate || isFocusable ? 0 : undefined}\n aria-current={day.isToday ? 'date' : undefined}\n aria-selected={day.isInBounds ? day.isSelected : undefined}\n >\n <button\n key={day.key + 'button'}\n aria-hidden={ariaHidden}\n className={mergeClasses(classNames.dayButton, day.isToday && classNames.dayIsToday)}\n aria-label={ariaLabel}\n id={isNavigatedDate ? activeDescendantId : undefined}\n disabled={!ariaHidden && !day.isInBounds}\n type=\"button\"\n tabIndex={-1}\n >\n <span aria-hidden=\"true\">{dateTimeFormatter.formatDay(day.originalDate)}</span>\n {day.isMarked && <div aria-hidden=\"true\" className={classNames.dayMarker} />}\n </button>\n </td>\n );\n};\n"],"names":["React","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Enter","getRTLSafeKey","useFluent_unstable","mergeClasses","addDays","addWeeks","compareDates","findAvailableDate","DateRangeType","weekCornersClassNames","extraCalendarDayGridClassNames","CalendarGridDayCell","props","navigatedDate","dateTimeFormatter","allFocusable","strings","activeDescendantId","navigatedDayRef","calculateRoundedStyles","weeks","classNames","day","dayIndex","weekIndex","weekCorners","ariaHidden","customDayCellRef","dateRangeType","daysToSelectInDayView","onSelectDate","restrictedDates","minDate","maxDate","onNavigateDate","getDayInfosInRangeOfDay","getRefsFromDayInfos","cornerStyle","isNavigatedDate","originalDate","dir","navigateMonthEdge","ev","date","targetDate","undefined","direction","key","findAvailableDateOptions","initialDate","nextDate","isInCurrentView","slice","length","some","week","dayToCompare","preventDefault","onMouseOverDay","dayInfos","dayRefs","forEach","dayRef","index","classList","add","hoverStyle","isSelected","Day","remove","bottomLeftCornerDate","bottomRightCornerDate","topLeftCornerDate","topRightCornerDate","classNamesToAdd","trim","split","onMouseDownDay","pressedStyle","onMouseUpDay","onMouseOutDay","onDayKeyDown","ariaLabel","getDate","months","getMonth","getFullYear","isMarked","dayMarkedAriaLabel","isFocusable","isInBounds","td","className","dayCell","daySelected","dayOutsideBounds","isInMonth","dayOutsideNavigatedMonth","ref","element","setRef","current","aria-hidden","aria-disabled","onClick","onSelected","onMouseOver","onMouseDown","onMouseUp","onMouseOut","onKeyDown","role","tabIndex","aria-current","isToday","aria-selected","button","dayButton","dayIsToday","aria-label","id","disabled","type","span","formatDay","div","dayMarker"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,EAAEC,OAAO,EAAEC,KAAK,QAAQ,0BAA0B;AAC3F,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,OAAO,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,iBAAiB,EAAEC,aAAa,QAAQ,cAAc;AAChG,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,8BAA8B,QAAQ,oCAAoC;AAanF;;CAEC,GACD,OAAO,MAAMC,sBAAyEC,CAAAA;IACpF,MAAM,EACJC,aAAa,EACbC,iBAAiB,EACjBC,YAAY,EACZC,OAAO,EACPC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,EACtBC,KAAK,EACLC,UAAU,EACVC,GAAG,EACHC,QAAQ,EACRC,SA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AqB4B;QAC3C4E,UAAU,CAAC/F,cAAc,CAACJ,IAAIoE,UAAU;QACxCgC,MAAK;QACLV,UAAU,CAAC;qBAEX,oBAACW;QAAKrB,eAAY;OAAQxF,kBAAkB8G,SAAS,CAACtG,IAAIiB,YAAY,IACrEjB,IAAIiE,QAAQ,kBAAI,oBAACsC;QAAIvB,eAAY;QAAOV,WAAWvE,WAAWyG,SAAS;;AAIhF,EAAE"}
|
1
|
+
{"version":3,"sources":["CalendarGridDayCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Enter } from '@fluentui/keyboard-keys';\nimport { getRTLSafeKey } from '@fluentui/react-utilities';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { mergeClasses } from '@griffel/react';\nimport { addDays, addWeeks, compareDates, findAvailableDate, DateRangeType } from '../../utils';\nimport { weekCornersClassNames } from './useWeekCornerStyles.styles';\nimport { extraCalendarDayGridClassNames } from './useCalendarDayGridStyles.styles';\nimport type { AvailableDateOptions } from '../../utils';\nimport type { DayInfo } from './CalendarDayGrid';\nimport type { CalendarGridRowProps } from './CalendarGridRow';\n\n/**\n * @internal\n */\nexport interface CalendarGridDayCellProps extends CalendarGridRowProps {\n day: DayInfo;\n dayIndex: number;\n}\n\n/**\n * @internal\n */\nexport const CalendarGridDayCell: React.FunctionComponent<CalendarGridDayCellProps> = props => {\n const {\n navigatedDate,\n dateTimeFormatter,\n allFocusable,\n strings,\n activeDescendantId,\n navigatedDayRef,\n calculateRoundedStyles,\n weeks,\n classNames,\n day,\n dayIndex,\n weekIndex,\n weekCorners,\n ariaHidden,\n customDayCellRef,\n dateRangeType,\n daysToSelectInDayView,\n onSelectDate,\n restrictedDates,\n minDate,\n maxDate,\n onNavigateDate,\n getDayInfosInRangeOfDay,\n getRefsFromDayInfos,\n } = props;\n const cornerStyle = weekCorners?.[weekIndex + '_' + dayIndex] ?? '';\n const isNavigatedDate = compareDates(navigatedDate, day.originalDate);\n\n const { dir } = useFluent_unstable();\n\n const navigateMonthEdge = (ev: React.KeyboardEvent<HTMLElement>, date: Date): void => {\n let targetDate: Date | undefined = undefined;\n let direction = 1; // by default search forward\n\n if (ev.key === ArrowUp) {\n targetDate = addWeeks(date, -1);\n direction = -1;\n } else if (ev.key === ArrowDown) {\n targetDate = addWeeks(date, 1);\n } else if (ev.key === getRTLSafeKey(ArrowLeft, dir)) {\n targetDate = addDays(date, -1);\n direction = -1;\n } else if (ev.key === getRTLSafeKey(ArrowRight, dir)) {\n targetDate = addDays(date, 1);\n }\n\n if (!targetDate) {\n // if we couldn't find a target date at all, do nothing\n return;\n }\n\n const findAvailableDateOptions: AvailableDateOptions = {\n initialDate: date,\n targetDate,\n direction,\n restrictedDates,\n minDate,\n maxDate,\n };\n\n // target date is restricted, search in whatever direction until finding the next possible date,\n // stopping at boundaries\n let nextDate = findAvailableDate(findAvailableDateOptions);\n\n if (!nextDate) {\n // if no dates available in initial direction, try going backwards\n findAvailableDateOptions.direction = -direction;\n nextDate = findAvailableDate(findAvailableDateOptions);\n }\n\n // if the nextDate is still inside the same focusZone area, let the focusZone handle setting the focus so we\n // don't jump the view unnecessarily\n const isInCurrentView =\n weeks &&\n nextDate &&\n weeks.slice(1, weeks.length - 1).some((week: DayInfo[]) => {\n return week.some((dayToCompare: DayInfo) => {\n return compareDates(dayToCompare.originalDate, nextDate!);\n });\n });\n if (isInCurrentView) {\n return;\n }\n\n // else, fire navigation on the date to change the view to show it\n if (nextDate) {\n onNavigateDate(nextDate, true);\n ev.preventDefault();\n }\n };\n\n const onMouseOverDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null, index: number) => {\n if (dayRef) {\n dayRef.classList.add(extraCalendarDayGridClassNames.hoverStyle);\n if (\n !dayInfos[index].isSelected &&\n dateRangeType === DateRangeType.Day &&\n daysToSelectInDayView &&\n daysToSelectInDayView > 1\n ) {\n // remove the static classes first to overwrite them\n dayRef.classList.remove(\n weekCornersClassNames.bottomLeftCornerDate!,\n weekCornersClassNames.bottomRightCornerDate!,\n weekCornersClassNames.topLeftCornerDate!,\n weekCornersClassNames.topRightCornerDate!,\n );\n\n const classNamesToAdd = calculateRoundedStyles(false, false, index > 0, index < dayRefs.length - 1).trim();\n if (classNamesToAdd) {\n dayRef.classList.add(...classNamesToAdd.trim().split(' '));\n }\n }\n }\n });\n };\n\n const onMouseDownDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null) => {\n if (dayRef) {\n dayRef.classList.add(extraCalendarDayGridClassNames.pressedStyle);\n }\n });\n };\n\n const onMouseUpDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null) => {\n if (dayRef) {\n dayRef.classList.remove(extraCalendarDayGridClassNames.pressedStyle);\n }\n });\n };\n\n const onMouseOutDay = (ev: React.MouseEvent<HTMLElement>) => {\n const dayInfos = getDayInfosInRangeOfDay(day);\n const dayRefs = getRefsFromDayInfos(dayInfos);\n\n dayRefs.forEach((dayRef: HTMLElement | null, index: number) => {\n if (dayRef) {\n dayRef.classList.remove(extraCalendarDayGridClassNames.hoverStyle);\n dayRef.classList.remove(extraCalendarDayGridClassNames.pressedStyle);\n if (\n !dayInfos[index].isSelected &&\n dateRangeType === DateRangeType.Day &&\n daysToSelectInDayView &&\n daysToSelectInDayView > 1\n ) {\n const classNamesToAdd = calculateRoundedStyles(false, false, index > 0, index < dayRefs.length - 1).trim();\n if (classNamesToAdd) {\n dayRef.classList.remove(...classNamesToAdd.trim().split(' '));\n }\n }\n }\n });\n };\n\n const onDayKeyDown = (ev: React.KeyboardEvent<HTMLElement>): void => {\n if (ev.key === Enter) {\n onSelectDate?.(day.originalDate);\n } else {\n navigateMonthEdge(ev, day.originalDate);\n }\n };\n\n let ariaLabel =\n day.originalDate.getDate() +\n ', ' +\n strings.months[day.originalDate.getMonth()] +\n ', ' +\n day.originalDate.getFullYear();\n\n if (day.isMarked) {\n ariaLabel = ariaLabel + ', ' + strings.dayMarkedAriaLabel;\n }\n\n const isFocusable = !ariaHidden && (allFocusable || (day.isInBounds ? true : undefined));\n\n return (\n <td\n className={mergeClasses(\n classNames.dayCell,\n weekCorners && cornerStyle,\n day.isSelected && !day.isSingleSelected && classNames.daySelected,\n day.isSingleSelected && classNames.daySingleSelected,\n !day.isInBounds && classNames.dayOutsideBounds,\n !day.isInMonth && classNames.dayOutsideNavigatedMonth,\n )}\n ref={(element: HTMLTableCellElement) => {\n customDayCellRef?.(element, day.originalDate, classNames);\n day.setRef(element);\n isNavigatedDate && (navigatedDayRef.current = element);\n }}\n aria-hidden={ariaHidden}\n aria-disabled={!ariaHidden && !day.isInBounds}\n onClick={day.isInBounds && !ariaHidden ? day.onSelected : undefined}\n onMouseOver={!ariaHidden ? onMouseOverDay : undefined}\n onMouseDown={!ariaHidden ? onMouseDownDay : undefined}\n onMouseUp={!ariaHidden ? onMouseUpDay : undefined}\n onMouseOut={!ariaHidden ? onMouseOutDay : undefined}\n onKeyDown={!ariaHidden ? onDayKeyDown : undefined}\n role=\"gridcell\"\n tabIndex={isNavigatedDate || isFocusable ? 0 : undefined}\n aria-current={day.isToday ? 'date' : undefined}\n aria-selected={day.isInBounds ? day.isSelected : undefined}\n >\n <button\n key={day.key + 'button'}\n aria-hidden={ariaHidden}\n className={mergeClasses(classNames.dayButton, day.isToday && classNames.dayIsToday)}\n aria-label={ariaLabel}\n id={isNavigatedDate ? activeDescendantId : undefined}\n disabled={!ariaHidden && !day.isInBounds}\n type=\"button\"\n tabIndex={-1}\n >\n <span className={day.isToday ? mergeClasses(classNames.dayTodayMarker) : undefined} aria-hidden=\"true\">\n {dateTimeFormatter.formatDay(day.originalDate)}\n </span>\n {day.isMarked && <div aria-hidden=\"true\" className={classNames.dayMarker} />}\n </button>\n </td>\n );\n};\n"],"names":["React","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Enter","getRTLSafeKey","useFluent_unstable","mergeClasses","addDays","addWeeks","compareDates","findAvailableDate","DateRangeType","weekCornersClassNames","extraCalendarDayGridClassNames","CalendarGridDayCell","props","navigatedDate","dateTimeFormatter","allFocusable","strings","activeDescendantId","navigatedDayRef","calculateRoundedStyles","weeks","classNames","day","dayIndex","weekIndex","weekCorners","ariaHidden","customDayCellRef","dateRangeType","daysToSelectInDayView","onSelectDate","restrictedDates","minDate","maxDate","onNavigateDate","getDayInfosInRangeOfDay","getRefsFromDayInfos","cornerStyle","isNavigatedDate","originalDate","dir","navigateMonthEdge","ev","date","targetDate","undefined","direction","key","findAvailableDateOptions","initialDate","nextDate","isInCurrentView","slice","length","some","week","dayToCompare","preventDefault","onMouseOverDay","dayInfos","dayRefs","forEach","dayRef","index","classList","add","hoverStyle","isSelected","Day","remove","bottomLeftCornerDate","bottomRightCornerDate","topLeftCornerDate","topRightCornerDate","classNamesToAdd","trim","split","onMouseDownDay","pressedStyle","onMouseUpDay","onMouseOutDay","onDayKeyDown","ariaLabel","getDate","months","getMonth","getFullYear","isMarked","dayMarkedAriaLabel","isFocusable","isInBounds","td","className","dayCell","isSingleSelected","daySelected","daySingleSelected","dayOutsideBounds","isInMonth","dayOutsideNavigatedMonth","ref","element","setRef","current","aria-hidden","aria-disabled","onClick","onSelected","onMouseOver","onMouseDown","onMouseUp","onMouseOut","onKeyDown","role","tabIndex","aria-current","isToday","aria-selected","button","dayButton","dayIsToday","aria-label","id","disabled","type","span","dayTodayMarker","formatDay","div","dayMarker"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,EAAEC,OAAO,EAAEC,KAAK,QAAQ,0BAA0B;AAC3F,SAAS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