@fluentui/react-datepicker-compat 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,93 @@
2
2
  "name": "@fluentui/react-datepicker-compat",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 03 Jul 2023 11:54:01 GMT",
5
+ "date": "Tue, 11 Jul 2023 18:44:10 GMT",
6
+ "tag": "@fluentui/react-datepicker-compat_v0.2.0",
7
+ "version": "0.2.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "esteban.230@hotmail.com",
12
+ "package": "@fluentui/react-datepicker-compat",
13
+ "commit": "01a5a8378f8f25dc04a3c255fd6c5ede40d8f0ee",
14
+ "comment": "breaking: Remove componentRef and IDatePicker since it's no longer necessary, fix ref forwarding to the input, change ref type for useDatePicker to use HTMLInputElement instead of HTMLElement, and fix focus movement when closing/opening popup."
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-datepicker-compat",
19
+ "comment": "Bump @fluentui/react-field to v9.1.11",
20
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-datepicker-compat",
25
+ "comment": "Bump @fluentui/react-input to v9.4.21",
26
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-datepicker-compat",
31
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.11",
32
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-datepicker-compat",
37
+ "comment": "Bump @fluentui/react-popover to v9.7.6",
38
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-datepicker-compat",
43
+ "comment": "Bump @fluentui/react-positioning to v9.8.0",
44
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-datepicker-compat",
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0",
50
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
51
+ }
52
+ ],
53
+ "patch": [
54
+ {
55
+ "author": "esteban.230@hotmail.com",
56
+ "package": "@fluentui/react-datepicker-compat",
57
+ "commit": "9dc6601a3f222e0a339541cc1523a356a78c59e6",
58
+ "comment": "fix(react-datepicker-compat): Add focus styles to CalendarPicker's go to today button."
59
+ }
60
+ ]
61
+ }
62
+ },
63
+ {
64
+ "date": "Mon, 03 Jul 2023 13:34:28 GMT",
65
+ "tag": "@fluentui/react-datepicker-compat_v0.1.11",
66
+ "version": "0.1.11",
67
+ "comments": {
68
+ "patch": [
69
+ {
70
+ "author": "beachball",
71
+ "package": "@fluentui/react-datepicker-compat",
72
+ "comment": "Bump @fluentui/react-popover to v9.7.5",
73
+ "commit": "d2c95969c67521ea1df57e1339f8743b09b68772"
74
+ },
75
+ {
76
+ "author": "beachball",
77
+ "package": "@fluentui/react-datepicker-compat",
78
+ "comment": "Bump @fluentui/react-portal to v9.3.1",
79
+ "commit": "d2c95969c67521ea1df57e1339f8743b09b68772"
80
+ },
81
+ {
82
+ "author": "beachball",
83
+ "package": "@fluentui/react-datepicker-compat",
84
+ "comment": "Bump @fluentui/react-tabster to v9.10.0",
85
+ "commit": "d2c95969c67521ea1df57e1339f8743b09b68772"
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "date": "Mon, 03 Jul 2023 11:57:14 GMT",
6
92
  "tag": "@fluentui/react-datepicker-compat_v0.1.10",
7
93
  "version": "0.1.10",
8
94
  "comments": {
@@ -11,55 +97,55 @@
11
97
  "author": "beachball",
12
98
  "package": "@fluentui/react-datepicker-compat",
13
99
  "comment": "Bump @fluentui/react-field to v9.1.10",
14
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
100
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
15
101
  },
16
102
  {
17
103
  "author": "beachball",
18
104
  "package": "@fluentui/react-datepicker-compat",
19
105
  "comment": "Bump @fluentui/react-input to v9.4.20",
20
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
106
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
21
107
  },
22
108
  {
23
109
  "author": "beachball",
24
110
  "package": "@fluentui/react-datepicker-compat",
25
111
  "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.10",
26
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
112
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
27
113
  },
28
114
  {
29
115
  "author": "beachball",
30
116
  "package": "@fluentui/react-datepicker-compat",
31
117
  "comment": "Bump @fluentui/react-popover to v9.7.4",
32
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
118
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
33
119
  },
34
120
  {
35
121
  "author": "beachball",
36
122
  "package": "@fluentui/react-datepicker-compat",
37
123
  "comment": "Bump @fluentui/react-portal to v9.3.0",
38
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
124
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
39
125
  },
40
126
  {
41
127
  "author": "beachball",
42
128
  "package": "@fluentui/react-datepicker-compat",
43
129
  "comment": "Bump @fluentui/react-positioning to v9.7.3",
44
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
130
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
45
131
  },
46
132
  {
47
133
  "author": "beachball",
48
134
  "package": "@fluentui/react-datepicker-compat",
49
135
  "comment": "Bump @fluentui/react-shared-contexts to v9.6.0",
50
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
136
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
51
137
  },
52
138
  {
53
139
  "author": "beachball",
54
140
  "package": "@fluentui/react-datepicker-compat",
55
141
  "comment": "Bump @fluentui/react-tabster to v9.9.2",
56
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
142
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
57
143
  },
58
144
  {
59
145
  "author": "beachball",
60
146
  "package": "@fluentui/react-datepicker-compat",
61
147
  "comment": "Bump @fluentui/react-utilities to v9.10.1",
62
- "commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
148
+ "commit": "61633ba5de03e0ddf4839dba6da325e30c7ce9bd"
63
149
  }
64
150
  ]
65
151
  }
package/CHANGELOG.md CHANGED
@@ -1,25 +1,55 @@
1
1
  # Change Log - @fluentui/react-datepicker-compat
2
2
 
3
- This log was last generated on Mon, 03 Jul 2023 11:54:01 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 11 Jul 2023 18:44:10 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.2.0)
8
+
9
+ Tue, 11 Jul 2023 18:44:10 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.1.11..@fluentui/react-datepicker-compat_v0.2.0)
11
+
12
+ ### Minor changes
13
+
14
+ - breaking: Remove componentRef and IDatePicker since it's no longer necessary, fix ref forwarding to the input, change ref type for useDatePicker to use HTMLInputElement instead of HTMLElement, and fix focus movement when closing/opening popup. ([PR #28299](https://github.com/microsoft/fluentui/pull/28299) by esteban.230@hotmail.com)
15
+ - Bump @fluentui/react-field to v9.1.11 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
16
+ - Bump @fluentui/react-input to v9.4.21 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.11 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
18
+ - Bump @fluentui/react-popover to v9.7.6 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
19
+ - Bump @fluentui/react-positioning to v9.8.0 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v9.0.0 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
21
+
22
+ ### Patches
23
+
24
+ - fix(react-datepicker-compat): Add focus styles to CalendarPicker's go to today button. ([PR #28458](https://github.com/microsoft/fluentui/pull/28458) by esteban.230@hotmail.com)
25
+
26
+ ## [0.1.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.1.11)
27
+
28
+ Mon, 03 Jul 2023 13:34:28 GMT
29
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.1.10..@fluentui/react-datepicker-compat_v0.1.11)
30
+
31
+ ### Patches
32
+
33
+ - Bump @fluentui/react-popover to v9.7.5 ([PR #28394](https://github.com/microsoft/fluentui/pull/28394) by beachball)
34
+ - Bump @fluentui/react-portal to v9.3.1 ([PR #28394](https://github.com/microsoft/fluentui/pull/28394) by beachball)
35
+ - Bump @fluentui/react-tabster to v9.10.0 ([PR #28394](https://github.com/microsoft/fluentui/pull/28394) by beachball)
36
+
7
37
  ## [0.1.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.1.10)
8
38
 
9
- Mon, 03 Jul 2023 11:54:01 GMT
39
+ Mon, 03 Jul 2023 11:57:14 GMT
10
40
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.1.9..@fluentui/react-datepicker-compat_v0.1.10)
11
41
 
12
42
  ### Patches
13
43
 
14
- - Bump @fluentui/react-field to v9.1.10 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
15
- - Bump @fluentui/react-input to v9.4.20 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.10 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
17
- - Bump @fluentui/react-popover to v9.7.4 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
18
- - Bump @fluentui/react-portal to v9.3.0 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
19
- - Bump @fluentui/react-positioning to v9.7.3 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
20
- - Bump @fluentui/react-shared-contexts to v9.6.0 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
21
- - Bump @fluentui/react-tabster to v9.9.2 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
22
- - Bump @fluentui/react-utilities to v9.10.1 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
44
+ - Bump @fluentui/react-field to v9.1.10 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
45
+ - Bump @fluentui/react-input to v9.4.20 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
46
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.10 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
47
+ - Bump @fluentui/react-popover to v9.7.4 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
48
+ - Bump @fluentui/react-portal to v9.3.0 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
49
+ - Bump @fluentui/react-positioning to v9.7.3 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
50
+ - Bump @fluentui/react-shared-contexts to v9.6.0 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
51
+ - Bump @fluentui/react-tabster to v9.9.2 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
52
+ - Bump @fluentui/react-utilities to v9.10.1 ([PR #28412](https://github.com/microsoft/fluentui/pull/28412) by beachball)
23
53
 
24
54
  ## [0.1.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.1.9)
25
55
 
package/dist/index.d.ts CHANGED
@@ -674,11 +674,6 @@ export declare const datePickerClassNames: SlotClassNames<DatePickerSlots>;
674
674
  export declare type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';
675
675
 
676
676
  export declare type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> & {
677
- /**
678
- * Optional callback to access the IDatePicker interface. Use this instead of ref for accessing
679
- * the public methods and properties of the component.
680
- */
681
- componentRef?: React_2.RefObject<IDatePicker>;
682
677
  /**
683
678
  * Callback issued when a date is selected
684
679
  */
@@ -1061,15 +1056,6 @@ export declare interface ICalendarMonth {
1061
1056
  focus(): void;
1062
1057
  }
1063
1058
 
1064
- export declare interface IDatePicker {
1065
- /** Sets focus to the input */
1066
- focus(): void;
1067
- /** Reset the state of the picker to the default */
1068
- reset(): void;
1069
- /** Open the datepicker popup */
1070
- showDatePickerPopup(): void;
1071
- }
1072
-
1073
1059
  /**
1074
1060
  * Checks whether the specified date is in the given date range.
1075
1061
  * @param date - The origin date
@@ -1158,7 +1144,7 @@ export declare const TimeConstants: {
1158
1144
  * @param props - props from this instance of DatePicker
1159
1145
  * @param ref - reference to root Input slot
1160
1146
  */
1161
- export declare const useDatePicker_unstable: (props: DatePickerProps, ref: React_2.Ref<HTMLElement>) => DatePickerState;
1147
+ export declare const useDatePicker_unstable: (props: DatePickerProps, ref: React_2.Ref<HTMLInputElement>) => DatePickerState;
1162
1148
 
1163
1149
  /**
1164
1150
  * Apply styling to the DatePicker slots based on the state
@@ -90,13 +90,35 @@ const useGoTodayButtonStyles = /*#__PURE__*/__styles({
90
90
  Jwef8y: "f9ql6rf",
91
91
  Bi91k9c: "f1f1pb61",
92
92
  eoavqd: "f8491dx",
93
+ Bv57zgv: "fq3vqfz",
94
+ Bnosqey: "f7lk14",
95
+ Bx7pl5v: "f1awoz4y",
96
+ B23s7e0: ["f1q1rlij", "f1txf70x"],
97
+ knvgbf: ["f1txf70x", "f1q1rlij"],
98
+ B3ons6i: ["fduk3fc", "fw6hbk1"],
99
+ Be8uuq8: ["fw6hbk1", "fduk3fc"],
93
100
  B2d53fq: "fc9d3oc",
94
101
  Dyrjrp: "f1cqwcg4",
95
102
  Be90el1: "fmjaa5u"
96
103
  }
97
104
  }, {
98
105
  d: [".fpydfdc{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;}", ".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;}", ".f1yab3r1{bottom:0;}", ".f1e4lqlz{box-sizing:content-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1mo0ibp{font-family:inherit;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".f1tvdnth{height:30px;}", ".fpfng1i{line-height:30px;}", ".f17vyym1{margin-right:16px;}", ".fb5scp{margin-left:16px;}", ".f4gg0ds{margin-top:3px;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".f8wuabp{padding-right:4px;}", ".fycuoez{padding-left:4px;}", ".f1qch9an{padding-bottom:0;}", ".fvy6vk6 div{font-size:var(--fontSizeBase200);}", ".f1cqwcg4:disabled{color:var(--colorNeutralForegroundDisabled);}", ".fmjaa5u:disabled{pointer-events:none;}"],
99
- h: [".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}", ".f1f1pb61:hover{color:var(--colorBrandForeground1);}", ".f8491dx:hover{cursor:pointer;}", ".fc9d3oc:hover:active{color:var(--colorBrandForeground2);}"]
106
+ h: [".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}", ".f1f1pb61:hover{color:var(--colorBrandForeground1);}", ".f8491dx:hover{cursor:pointer;}", ".fc9d3oc:hover:active{color:var(--colorBrandForeground2);}"],
107
+ m: [["@media (forced-colors: active){.fq3vqfz:hover{outline-width:var(--strokeWidthThin);}}", {
108
+ m: "(forced-colors: active)"
109
+ }], ["@media (forced-colors: active){.f7lk14:hover{outline-style:solid;}}", {
110
+ m: "(forced-colors: active)"
111
+ }], ["@media (forced-colors: active){.f1awoz4y:hover{outline-color:ButtonText;}}", {
112
+ m: "(forced-colors: active)"
113
+ }], ["@media (forced-colors: active){.f1q1rlij:hover{border-bottom-right-radius:var(--borderRadiusSmall);}.f1txf70x:hover{border-bottom-left-radius:var(--borderRadiusSmall);}}", {
114
+ m: "(forced-colors: active)"
115
+ }], ["@media (forced-colors: active){.f1q1rlij:hover{border-bottom-right-radius:var(--borderRadiusSmall);}.f1txf70x:hover{border-bottom-left-radius:var(--borderRadiusSmall);}}", {
116
+ m: "(forced-colors: active)"
117
+ }], ["@media (forced-colors: active){.fduk3fc:hover{border-top-right-radius:var(--borderRadiusSmall);}.fw6hbk1:hover{border-top-left-radius:var(--borderRadiusSmall);}}", {
118
+ m: "(forced-colors: active)"
119
+ }], ["@media (forced-colors: active){.fduk3fc:hover{border-top-right-radius:var(--borderRadiusSmall);}.fw6hbk1:hover{border-top-left-radius:var(--borderRadiusSmall);}}", {
120
+ m: "(forced-colors: active)"
121
+ }]]
100
122
  });
101
123
  const useLiveRegionStyles = /*#__PURE__*/__styles({
102
124
  base: {
@@ -1 +1 @@
1
- {"version":3,"names":["tokens","__styles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","useDividerStyles","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bekrc4i","vrafjx","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","seuwu7","Jwef8y","Bi91k9c","eoavqd","B2d53fq","Dyrjrp","Be90el1","h","useLiveRegionStyles","B4j52fo","Bn0qgzm","ibv6hh","qhf8xq","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"sources":["useCalendarStyles.styles.js"],"sourcesContent":["import { 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 ...shorthands.margin(0),\n ...shorthands.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 ...shorthands.borderColor(tokens.colorNeutralStroke2),\n ...shorthands.borderRight('1px', 'solid'),\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 ...shorthands.overflow('visible'),\n ...shorthands.padding(0, '4px'),\n '& div': {\n fontSize: tokens.fontSizeBase200\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer'\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 ...shorthands.border(0),\n height: '1px',\n ...shorthands.margin('-1px'),\n ...shorthands.overflow('hidden'),\n ...shorthands.padding(0),\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n * @internal\n *\n * Apply styling to the Calendar slots based on the state\n */ export const useCalendarStyles_unstable = (props)=>{\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,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,MAAA;EAAA;EAAAC,SAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,qBAAA;IAAAC,OAAA;EAAA;EAAAC,yBAAA;IAAAd,MAAA;EAAA;EAAAe,mCAAA;IAAAf,MAAA;EAAA;EAAAgB,4CAAA;IAAAhB,MAAA;EAAA;AAAA;EAAAiB,CAAA;AAAA,CAuBrB,CAAC;AACF,MAAMC,gBAAgB,gBAAG9B,QAAA;EAAAU,IAAA;IAAAqB,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAR,CAAA;AAAA,CAMxB,CAAC;AACF,MAAMS,2BAA2B,gBAAGtC,QAAA;EAAAU,IAAA;IAAAC,MAAA;IAAAc,OAAA;EAAA;AAAA;EAAAI,CAAA;AAAA,CAKnC,CAAC;AACF,MAAMU,sBAAsB,gBAAGvC,QAAA;EAAAU,IAAA;IAAA8B,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAN,MAAA;IAA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U,CAACvD,SAAS,EAAE,CAAC8D,oBAAoB,IAAIP,UAAU,CAAC5C,qBAAqB,EAAEkD,kBAAkB,IAAIC,oBAAoB,IAAI,CAACC,eAAe,IAAIR,UAAU,CAAC1C,yBAAyB,EAAEgD,kBAAkB,IAAI,CAACC,oBAAoB,IAAIC,eAAe,IAAIR,UAAU,CAACzC,mCAAmC,EAAE+C,kBAAkB,IAAIC,oBAAoB,IAAIC,eAAe,IAAIR,UAAU,CAACxC,4CAA4C,EAAE6C,SAAS,CAAC;IAC5epE,OAAO,EAAEJ,YAAY,CAACE,kBAAkB,CAACE,OAAO,EAAEgE,aAAa,CAAC3D,IAAI,CAAC;IACrEH,kBAAkB,EAAEN,YAAY,CAACE,kBAAkB,CAACI,kBAAkB,EAAE+D,wBAAwB,CAAC5D,IAAI,CAAC;IACtGJ,aAAa,EAAEL,YAAY,CAACE,kBAAkB,CAACG,aAAa,EAAEiE,mBAAmB,CAAC7D,IAAI,CAAC;IACvFF,UAAU,EAAEP,YAAY,CAACE,kBAAkB,CAACK,UAAU,EAAEgE,gBAAgB,CAAC9D,IAAI;EACjF,CAAC;AACL,CAAC"}
1
+ {"version":3,"names":["tokens","__styles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","useDividerStyles","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bekrc4i","vrafjx","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bv57zgv","Bnosqey","Bx7pl5v","B23s7e0","knvgbf","B3ons6i","Be8uuq8","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","B4j52fo","Bn0qgzm","ibv6hh","qhf8xq","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"sources":["useCalendarStyles.styles.js"],"sourcesContent":["import { 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 ...shorthands.margin(0),\n ...shorthands.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 ...shorthands.borderColor(tokens.colorNeutralStroke2),\n ...shorthands.borderRight('1px', 'solid'),\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 ...shorthands.overflow('visible'),\n ...shorthands.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 ...shorthands.outline(tokens.strokeWidthThin, 'solid', 'ButtonText'),\n ...shorthands.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 ...shorthands.border(0),\n height: '1px',\n ...shorthands.margin('-1px'),\n ...shorthands.overflow('hidden'),\n ...shorthands.padding(0),\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n * @internal\n *\n * Apply styling to the Calendar slots based on the state\n */ export const useCalendarStyles_unstable = (props)=>{\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: merge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AAS;IAAGC,kBAAkB;IAAGC,oBAAoB;IAAGC;EAAiB,CAAC,GAAGT,KAAK;EAC1F,OAAO;IACHvE,IAAI,EAAEH,YAAY,CAACE,kBAAkB,CAACC,IAAI,EAAEwE,UAAU,CAAClE,IAAI,EAAEkE,UAAU,CAAC/D,SAAS,EAAE,CAACsE,oBAAoB,IAAIP,UAAU,CAACpD,qBAAqB,EAAE0D,kBAAkB,IAAIC,oBAAoB,IAAI,CAACC,eAAe,IAAIR,UAAU,CAAClD,yBAAyB,EAAEwD,kBAAkB,IAAI,CAACC,oBAAoB,IAAIC,eAAe,IAAIR,UAAU,CAACjD,mCAAmC,EAAEuD,kBAAkB,IAAIC,oBAAoB,IAAIC,eAAe,IAAIR,UAAU,CAAChD,4CAA4C,EAAEqD,SAAS,CAAC;IAC5e5E,OAAO,EAAEJ,YAAY,CAACE,kBAAkB,CAACE,OAAO,EAAEwE,aAAa,CAACnE,IAAI,CAAC;IACrEH,kBAAkB,EAAEN,YAAY,CAACE,kBAAkB,CAACI,kBAAkB,EAAEuE,wBAAwB,CAACpE,IAAI,CAAC;IACtGJ,aAAa,EAAEL,YAAY,CAACE,kBAAkB,CAACG,aAAa,EAAEyE,mBAAmB,CAACrE,IAAI,CAAC;IACvFF,UAAU,EAAEP,YAAY,CAACE,kBAAkB,CAACK,UAAU,EAAEwE,gBAAgB,CAACtE,IAAI;EACjF,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- import * as React from 'react';
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["DatePicker.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { Input } from '@fluentui/react-input';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { CalendarProps } from '../Calendar/Calendar.types';\nimport type { CalendarStrings, DateFormatting } from '../../utils';\nimport type { PositioningProps } from '@fluentui/react-positioning';\n\nexport type DatePickerSlots = {\n root: NonNullable<Slot<typeof Input>>;\n calendar: NonNullable<Slot<Partial<CalendarProps>>>;\n popupSurface?: Slot<'div'>;\n};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface IDatePicker {\n /** Sets focus to the input */\n focus(): void;\n\n /** Reset the state of the picker to the default */\n reset(): void;\n\n /** Open the datepicker popup */\n showDatePickerPopup(): void;\n}\n\nexport type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> & {\n /**\n * Optional callback to access the IDatePicker interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<IDatePicker>;\n\n /**\n * Callback issued when a date is selected\n */\n onSelectDate?: (date: Date | null | undefined) => void;\n\n /**\n * Whether the DatePicker is a required field or not. When using `<Field>`, this prop is automatically set.\n * @default false\n */\n required?: boolean;\n\n /**\n * Disabled state of the DatePicker.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether or not the Input of the DatePicker is underlined.\n * @default false\n */\n underlined?: boolean;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the DatePicker allows input a date string directly or not\n * @default false\n */\n allowTextInput?: boolean;\n\n /**\n * Whether the DatePicker should open automatically when the control is focused\n * WARNING: setting this to false creates an accessibility violation and is not recommended\n * @default true\n */\n disableAutoFocus?: boolean;\n\n /**\n * Whether the DatePicker should open when the input is clicked\n * @default true\n */\n openOnClick?: boolean;\n\n /**\n * Whether the DatePicker should be open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Whether the DatePicker is open or not\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Callback to run when the DatePicker's open state changes\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback to run after the DatePicker's input has been validated\n */\n onValidationResult?: (data: DatePickerValidationResultData) => void;\n\n /**\n * Whether the DatePicker should render the popup as inline or in a portal\n *\n * @default false\n */\n inlinePopup?: boolean;\n\n /**\n * Configure the positioning of the DatePicker dialog\n *\n * @default below\n */\n positioning?: PositioningProps;\n\n /**\n * Placeholder text for the DatePicker\n */\n placeholder?: string;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Default value of the DatePicker, if any\n *\n * When the component is controlled, `null` should be used instead of `undefined` to avoid controlled vs. uncontrolled\n * ambiguity.\n */\n value?: Date | null;\n\n /**\n * Optional method to format the chosen date to a string to display in the DatePicker\n * @default date.toString()\n */\n formatDate?: (date?: Date) => string;\n\n /**\n * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true\n * @default new Date(Date.parse(dateStr))\n */\n parseDateFromString?: (dateStr: string) => Date | null;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\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 * 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.FirstFullWeek\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Determines if the DatePicker has a border.\n * @default false\n */\n borderless?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * The minimum allowable date.\n */\n minDate?: Date;\n\n /**\n * The maximum allowable date.\n */\n maxDate?: Date;\n\n /**\n * The initially highlighted date.\n */\n initialPickerDate?: Date;\n\n /**\n * Allows all elements to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Whether the CalendarDay close button should be shown or not.\n */\n showCloseButton?: boolean;\n};\n\n/**\n * State used in rendering DatePicker.\n */\nexport type DatePickerState = ComponentState<DatePickerSlots> & {\n disabled: boolean;\n inlinePopup: boolean;\n};\n\n/**\n * Data passed to the `onValidationResult` callback.\n */\nexport type DatePickerValidationResultData = {\n /** The error found when validating the input. */\n error?: DatePickerErrorType;\n};\n\n/**\n * Error types returned by the `onValidationResult` callback.\n */\nexport type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["DatePicker.types.ts"],"sourcesContent":["import { DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { Input } from '@fluentui/react-input';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { CalendarProps } from '../Calendar/Calendar.types';\nimport type { CalendarStrings, DateFormatting } from '../../utils';\nimport type { PositioningProps } from '@fluentui/react-positioning';\n\nexport type DatePickerSlots = {\n root: NonNullable<Slot<typeof Input>>;\n calendar: NonNullable<Slot<Partial<CalendarProps>>>;\n popupSurface?: Slot<'div'>;\n};\n\nexport type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> & {\n /**\n * Callback issued when a date is selected\n */\n onSelectDate?: (date: Date | null | undefined) => void;\n\n /**\n * Whether the DatePicker is a required field or not. When using `<Field>`, this prop is automatically set.\n * @default false\n */\n required?: boolean;\n\n /**\n * Disabled state of the DatePicker.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether or not the Input of the DatePicker is underlined.\n * @default false\n */\n underlined?: boolean;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the DatePicker allows input a date string directly or not\n * @default false\n */\n allowTextInput?: boolean;\n\n /**\n * Whether the DatePicker should open automatically when the control is focused\n * WARNING: setting this to false creates an accessibility violation and is not recommended\n * @default true\n */\n disableAutoFocus?: boolean;\n\n /**\n * Whether the DatePicker should open when the input is clicked\n * @default true\n */\n openOnClick?: boolean;\n\n /**\n * Whether the DatePicker should be open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Whether the DatePicker is open or not\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Callback to run when the DatePicker's open state changes\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback to run after the DatePicker's input has been validated\n */\n onValidationResult?: (data: DatePickerValidationResultData) => void;\n\n /**\n * Whether the DatePicker should render the popup as inline or in a portal\n *\n * @default false\n */\n inlinePopup?: boolean;\n\n /**\n * Configure the positioning of the DatePicker dialog\n *\n * @default below\n */\n positioning?: PositioningProps;\n\n /**\n * Placeholder text for the DatePicker\n */\n placeholder?: string;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Default value of the DatePicker, if any\n *\n * When the component is controlled, `null` should be used instead of `undefined` to avoid controlled vs. uncontrolled\n * ambiguity.\n */\n value?: Date | null;\n\n /**\n * Optional method to format the chosen date to a string to display in the DatePicker\n * @default date.toString()\n */\n formatDate?: (date?: Date) => string;\n\n /**\n * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true\n * @default new Date(Date.parse(dateStr))\n */\n parseDateFromString?: (dateStr: string) => Date | null;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\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 * 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.FirstFullWeek\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Determines if the DatePicker has a border.\n * @default false\n */\n borderless?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * The minimum allowable date.\n */\n minDate?: Date;\n\n /**\n * The maximum allowable date.\n */\n maxDate?: Date;\n\n /**\n * The initially highlighted date.\n */\n initialPickerDate?: Date;\n\n /**\n * Allows all elements to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Whether the CalendarDay close button should be shown or not.\n */\n showCloseButton?: boolean;\n};\n\n/**\n * State used in rendering DatePicker.\n */\nexport type DatePickerState = ComponentState<DatePickerSlots> & {\n disabled: boolean;\n inlinePopup: boolean;\n};\n\n/**\n * Data passed to the `onValidationResult` callback.\n */\nexport type DatePickerValidationResultData = {\n /** The error found when validating the input. */\n error?: DatePickerErrorType;\n};\n\n/**\n * Error types returned by the `onValidationResult` callback.\n */\nexport type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';\n"],"names":[],"mappings":"AAAA,WA0OuF"}
@@ -5,7 +5,7 @@ import { CalendarMonthRegular } from '@fluentui/react-icons';
5
5
  import { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';
6
6
  import { defaultDatePickerStrings } from './defaults';
7
7
  import { Input } from '@fluentui/react-input';
8
- import { mergeCallbacks, resolveShorthand, useControllableState, useFirstMount, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';
8
+ import { mergeCallbacks, resolveShorthand, useControllableState, useEventCallback, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';
9
9
  import { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';
10
10
  import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
11
11
  import { useModalAttributes } from '@fluentui/react-tabster';
@@ -16,13 +16,13 @@ function isDateOutOfBounds(date, minDate, maxDate) {
16
16
  function useFocusLogic() {
17
17
  const inputRef = React.useRef(null);
18
18
  const preventFocusOpeningPicker = React.useRef(false);
19
- const focus = ()=>{
19
+ const focus = React.useCallback(()=>{
20
20
  var _inputRef_current, _inputRef_current_focus;
21
21
  (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);
22
- };
23
- const preventNextFocusOpeningPicker = ()=>{
22
+ }, []);
23
+ const preventNextFocusOpeningPicker = React.useCallback(()=>{
24
24
  preventFocusOpeningPicker.current = true;
25
- };
25
+ }, []);
26
26
  return [
27
27
  focus,
28
28
  inputRef,
@@ -157,8 +157,14 @@ const defaultParseDateFromString = (dateStr)=>{
157
157
  const setOpen = React.useCallback((newState)=>{
158
158
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);
159
159
  setOpenState(newState);
160
- }, [
160
+ if (!open && !props.disabled) {
161
+ focus();
162
+ }
163
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
164
+ [
165
+ focus,
161
166
  onOpenChange,
167
+ props.disabled,
162
168
  setOpenState
163
169
  ]);
164
170
  const dismissDatePickerPopup = React.useCallback((newlySelectedDate)=>{
@@ -298,7 +304,7 @@ const defaultParseDateFromString = (dateStr)=>{
298
304
  };
299
305
  const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';
300
306
  const [triggerWrapperRef, popupRef] = usePopupPositioning(props);
301
- const rootShorthand = resolveShorthand(restOfProps, {
307
+ const root = resolveShorthand(restOfProps, {
302
308
  required: true,
303
309
  defaultProps: {
304
310
  appearance: inputAppearance,
@@ -309,27 +315,34 @@ const defaultParseDateFromString = (dateStr)=>{
309
315
  onClick: onIconClick
310
316
  }),
311
317
  readOnly: !allowTextInput,
312
- role: 'combobox',
313
- root: {
314
- 'aria-owns': open ? popupSurfaceId : undefined,
315
- ref: useMergedRefs(triggerWrapperRef, ref)
316
- },
317
- input: {
318
- ref: rootRef
319
- }
318
+ role: 'combobox'
319
+ }
320
+ });
321
+ const inputRoot = resolveShorthand(props.root, {
322
+ required: true,
323
+ defaultProps: {
324
+ 'aria-owns': open ? popupSurfaceId : undefined,
325
+ ref: triggerWrapperRef
320
326
  }
321
327
  });
322
- rootShorthand.onChange = mergeCallbacks(rootShorthand.onChange, onInputChange);
323
- rootShorthand.onBlur = mergeCallbacks(rootShorthand.onBlur, onInputBlur);
324
- rootShorthand.onKeyDown = mergeCallbacks(rootShorthand.onKeyDown, onInputKeyDown);
325
- rootShorthand.onFocus = mergeCallbacks(rootShorthand.onFocus, onInputFocus);
326
- rootShorthand.onClick = mergeCallbacks(rootShorthand.onClick, onInputClick);
328
+ inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);
329
+ root.root = inputRoot;
330
+ const inputShorthand = resolveShorthand(props.input, {
331
+ required: true
332
+ });
333
+ inputShorthand.ref = useMergedRefs(inputShorthand.ref, ref, rootRef);
334
+ root.input = inputShorthand;
335
+ root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));
336
+ root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));
337
+ root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));
338
+ root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));
339
+ root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));
327
340
  const { modalAttributes } = useModalAttributes({
328
341
  trapFocus: true,
329
342
  alwaysFocusable: true,
330
343
  legacyTrapFocus: false
331
344
  });
332
- const popupSurfaceShorthand = open ? resolveShorthand(props.popupSurface, {
345
+ const popupSurface = open ? resolveShorthand(props.popupSurface, {
333
346
  required: true,
334
347
  defaultProps: {
335
348
  'aria-label': 'Calendar',
@@ -371,19 +384,6 @@ const defaultParseDateFromString = (dateStr)=>{
371
384
  open,
372
385
  props.disabled
373
386
  ]);
374
- const isFirstMount = useFirstMount();
375
- // When the popup is closed, focus should go back to the input.
376
- React.useEffect(()=>{
377
- if (!open && !props.disabled && !isFirstMount) {
378
- focus();
379
- }
380
- // Focus function keeps changing, so we need to skip it in the deps
381
- // eslint-disable-next-line react-hooks/exhaustive-deps
382
- }, [
383
- isFirstMount,
384
- open,
385
- props.disabled
386
- ]);
387
387
  const calendarShorthand = resolveShorthand(props.calendar, {
388
388
  required: true,
389
389
  defaultProps: {
@@ -406,21 +406,8 @@ const defaultParseDateFromString = (dateStr)=>{
406
406
  value: selectedDate || initialPickerDate
407
407
  }
408
408
  });
409
- calendarShorthand.onDismiss = mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed);
410
- calendarShorthand.onSelectDate = mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed);
411
- React.useImperativeHandle(props.componentRef, ()=>({
412
- focus,
413
- reset () {
414
- setOpen(false);
415
- setSelectedDate(null);
416
- },
417
- showDatePickerPopup
418
- }), [
419
- focus,
420
- setOpen,
421
- setSelectedDate,
422
- showDatePickerPopup
423
- ]);
409
+ calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));
410
+ calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));
424
411
  const state = {
425
412
  disabled: !!props.disabled,
426
413
  inlinePopup,
@@ -430,8 +417,8 @@ const defaultParseDateFromString = (dateStr)=>{
430
417
  popupSurface: 'div'
431
418
  },
432
419
  calendar: calendarShorthand,
433
- root: rootShorthand,
434
- popupSurface: popupSurfaceShorthand
420
+ root,
421
+ popupSurface
435
422
  };
436
423
  state.root.value = formattedDate;
437
424
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["useDatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport {\n mergeCallbacks,\n resolveShorthand,\n useControllableState,\n useFirstMount,\n useId,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nimport type { CalendarProps, ICalendar } from '../Calendar/Calendar.types';\nimport type { DatePickerProps, DatePickerState, DatePickerValidationResultData } from './DatePicker.types';\nimport type { InputProps, InputOnChangeData } from '@fluentui/react-input';\n\nfunction isDateOutOfBounds(date: Date, minDate?: Date, maxDate?: Date): boolean {\n return (!!minDate && compareDatePart(minDate!, date) > 0) || (!!maxDate && compareDatePart(maxDate!, date) < 0);\n}\n\nfunction useFocusLogic() {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const preventFocusOpeningPicker = React.useRef(false);\n\n const focus = () => {\n inputRef.current?.focus?.();\n };\n\n const preventNextFocusOpeningPicker = () => {\n preventFocusOpeningPicker.current = true;\n };\n\n return [focus, inputRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] as const;\n}\n\nfunction usePopupVisibility(props: DatePickerProps) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open,\n });\n const isMounted = React.useRef(false);\n\n React.useEffect(\n () => {\n if (isMounted.current && !open) {\n // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n props.onOpenChange?.(false);\n }\n isMounted.current = true;\n },\n // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.allowTextInput, open],\n );\n\n return [open, setOpen] as const;\n}\n\nfunction useSelectedDate({ formatDate, onSelectDate, value }: DatePickerProps) {\n const [selectedDate, setSelectedDateState] = useControllableState<Date | null | undefined>({\n initialState: null,\n state: value,\n });\n const [formattedDate, setFormattedDate] = React.useState(() => (value && formatDate ? formatDate(value) : ''));\n\n const setSelectedDate = (newDate: Date | null | undefined) => {\n onSelectDate?.(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n\n React.useEffect(() => {\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [formatDate, value]);\n\n return [selectedDate, formattedDate, setSelectedDate, setFormattedDate] as const;\n}\n\nconst defaultFormatDate = (date?: Date) => (date ? date.toDateString() : '');\nconst defaultParseDateFromString = (dateStr: string) => {\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */\nexport const useDatePicker_unstable = (props: DatePickerProps, ref: React.Ref<HTMLElement>): DatePickerState => {\n const {\n allowTextInput = false,\n allFocusable = false,\n borderless = false,\n dateTimeFormatter,\n defaultOpen = false,\n disableAutoFocus = true,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n formatDate = defaultFormatDate,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n initialPickerDate = new Date(),\n inlinePopup = false,\n isMonthPickerVisible = true,\n maxDate,\n minDate,\n onOpenChange,\n onSelectDate: onUserSelectDate,\n openOnClick = true,\n onValidationResult,\n parseDateFromString = defaultParseDateFromString,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay = false,\n showWeekNumbers = false,\n strings = defaultDatePickerStrings,\n today,\n underlined = false,\n value,\n ...restOfProps\n } = props;\n const calendar = React.useRef<ICalendar>(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value,\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n const required = fieldContext?.required ?? props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n\n const validateTextInput = React.useCallback(\n (date: Date | null = null): void => {\n let error: DatePickerValidationResultData['error'];\n\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date ?? selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString!(formattedDate);\n\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n\n onUserSelectDate?.(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n\n onValidationResult?.({ error });\n },\n [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate,\n ],\n );\n\n const setOpen = React.useCallback(\n (newState: boolean) => {\n onOpenChange?.(newState);\n setOpenState(newState);\n },\n [onOpenChange, setOpenState],\n );\n\n const dismissDatePickerPopup = React.useCallback(\n (newlySelectedDate?: Date | null): void => {\n if (open) {\n setOpen(false);\n\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n },\n [allowTextInput, open, setOpen, setSelectedDate, validateTextInput],\n );\n\n const showDatePickerPopup = React.useCallback((): void => {\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [open, preventNextFocusOpeningPicker, setOpen]);\n\n /**\n * Callback for closing the calendar callout\n */\n const calendarDismissed = React.useCallback(\n (newlySelectedDate?: Date): void => {\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n },\n [dismissDatePickerPopup, preventNextFocusOpeningPicker],\n );\n\n const onInputChange = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => {\n const { value: newValue } = data;\n\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n\n setFormattedDate(newValue);\n }\n },\n [allowTextInput, dismissDatePickerPopup, open, setFormattedDate],\n );\n\n const onInputBlur: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n validateTextInput();\n }, [validateTextInput]);\n\n const onInputKeyDown = React.useCallback(\n (ev: React.KeyboardEvent<HTMLElement>): void => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n\n case ArrowDown:\n ev.preventDefault();\n if (ev.altKey && !open) {\n showDatePickerPopup();\n }\n break;\n\n default:\n break;\n }\n },\n [calendarDismissed, dismissDatePickerPopup, open, props.allowTextInput, showDatePickerPopup, validateTextInput],\n );\n\n const onInputFocus: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n if (disableAutoFocus) {\n return;\n }\n\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [allowTextInput, disableAutoFocus, preventFocusOpeningPicker, showDatePickerPopup]);\n\n const onInputClick: React.MouseEventHandler<HTMLInputElement> = React.useCallback((): void => {\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup,\n ]);\n\n const onIconClick = (ev: React.MouseEvent<HTMLElement>): void => {\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n\n const inputAppearance: InputProps['appearance'] = underlined\n ? 'underline'\n : borderless\n ? 'filled-lighter'\n : 'outline';\n\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const rootShorthand = resolveShorthand(restOfProps, {\n required: true,\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: <CalendarMonthRegular onClick={onIconClick as unknown as React.MouseEventHandler<SVGElement>} />,\n readOnly: !allowTextInput,\n role: 'combobox',\n root: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: useMergedRefs(triggerWrapperRef, ref),\n },\n input: {\n ref: rootRef,\n },\n },\n });\n\n rootShorthand.onChange = mergeCallbacks(rootShorthand.onChange, onInputChange);\n rootShorthand.onBlur = mergeCallbacks(rootShorthand.onBlur, onInputBlur);\n rootShorthand.onKeyDown = mergeCallbacks(rootShorthand.onKeyDown, onInputKeyDown);\n rootShorthand.onFocus = mergeCallbacks(rootShorthand.onFocus, onInputFocus);\n rootShorthand.onClick = mergeCallbacks(rootShorthand.onClick, onInputClick);\n\n const { modalAttributes } = useModalAttributes({ trapFocus: true, alwaysFocusable: true, legacyTrapFocus: false });\n const popupSurfaceShorthand = open\n ? resolveShorthand(props.popupSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes,\n },\n })\n : undefined;\n\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n\n useOnScrollOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n\n // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(() => {\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [disableAutoFocus, open, props.disabled]);\n\n const isFirstMount = useFirstMount();\n // When the popup is closed, focus should go back to the input.\n React.useEffect(() => {\n if (!open && !props.disabled && !isFirstMount) {\n focus();\n }\n // Focus function keeps changing, so we need to skip it in the deps\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isFirstMount, open, props.disabled]);\n\n const calendarShorthand = resolveShorthand(props.calendar, {\n required: true,\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate,\n },\n });\n\n calendarShorthand.onDismiss = mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed);\n calendarShorthand.onSelectDate = mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus,\n reset() {\n setOpen(false);\n setSelectedDate(null);\n },\n showDatePickerPopup,\n }),\n [focus, setOpen, setSelectedDate, showDatePickerPopup],\n );\n\n const state: DatePickerState = {\n disabled: !!props.disabled,\n inlinePopup,\n\n components: {\n root: Input,\n calendar: Calendar as React.FC<Partial<CalendarProps>>,\n popupSurface: 'div',\n },\n\n calendar: calendarShorthand,\n root: rootShorthand,\n popupSurface: popupSurfaceShorthand,\n };\n\n state.root.value = formattedDate;\n\n return state;\n};\n"],"names":["React","ArrowDown","Enter","Escape","Calendar","CalendarMonthRegular","compareDatePart","DayOfWeek","FirstWeekOfYear","defaultDatePickerStrings","Input","mergeCallbacks","resolveShorthand","useControllableState","useFirstMount","useId","useMergedRefs","useOnClickOutside","useOnScrollOutside","useFieldContext_unstable","useFieldContext","useFluent_unstable","useFluent","useModalAttributes","usePopupPositioning","isDateOutOfBounds","date","minDate","maxDate","useFocusLogic","inputRef","useRef","preventFocusOpeningPicker","focus","current","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","initialState","defaultState","defaultOpen","state","isMounted","useEffect","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","useDatePicker_unstable","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","Sunday","firstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","required","popupSurfaceId","validateTextInput","useCallback","error","isNaN","getTime","newState","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","preventDefault","stopPropagation","altKey","onInputFocus","onInputClick","disabled","onIconClick","inputAppearance","triggerWrapperRef","popupRef","rootShorthand","defaultProps","appearance","undefined","contentAfter","onClick","readOnly","role","root","input","onChange","onBlur","onKeyDown","onFocus","modalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurfaceShorthand","popupSurface","id","targetDocument","element","callback","refs","isFirstMount","calendarShorthand","componentRef","onDismiss","useImperativeHandle","reset","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,EAAEC,SAAS,EAAEC,eAAe,QAAQ,cAAc;AAC1E,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SACEC,cAAc,EACdC,gBAAgB,EAChBC,oBAAoB,EACpBC,aAAa,EACbC,KAAK,EACLC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,QACb,4BAA4B;AACnC,SAASC,4BAA4BC,eAAe,QAAQ,wBAAwB;AACpF,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,mBAAmB,QAAQ,kCAAkC;AAKtE,SAASC,kBAAkBC,IAAU,EAAEC,OAAc,EAAEC,OAAc,EAAW;IAC9E,OAAO,AAAC,CAAC,CAACD,WAAWrB,gBAAgBqB,SAAUD,QAAQ,KAAO,CAAC,CAACE,WAAWtB,gBAAgBsB,SAAUF,QAAQ;AAC/G;AAEA,SAASG,gBAAgB;IACvB,MAAMC,WAAW9B,MAAM+B,MAAM,CAAmB,IAAI;IACpD,MAAMC,4BAA4BhC,MAAM+B,MAAM,CAAC,KAAK;IAEpD,MAAME,QAAQ,IAAM;YAClBH;QAAAA,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AAM0J,mBAAmB,CACvBrH,MAAMmH,YAAY,EAClB,IAAO,CAAA;YACLvH;YACA0H,SAAQ;gBACNpH,QAAQ,KAAK;gBACbkB,gBAAgB,IAAI;YACtB;YACAiD;QACF,CAAA,GACA;QAACzE;QAAOM;QAASkB;QAAiBiD;KAAoB;IAGxD,MAAM/D,QAAyB;QAC7B6E,UAAU,CAAC,CAACnF,MAAMmF,QAAQ;QAC1B1C;QAEA8E,YAAY;YACVvB,MAAM3H;YACNkF,UAAUxF;YACV4I,cAAc;QAChB;QAEApD,UAAU2D;QACVlB,MAAMR;QACNmB,cAAcD;IAChB;IAEApG,MAAM0F,IAAI,CAAClF,KAAK,GAAGG;IAEnB,OAAOX;AACT,EAAE"}
1
+ {"version":3,"sources":["useDatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport {\n mergeCallbacks,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n useId,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nimport type { CalendarProps, ICalendar } from '../Calendar/Calendar.types';\nimport type { DatePickerProps, DatePickerState, DatePickerValidationResultData } from './DatePicker.types';\nimport type { InputProps, InputOnChangeData } from '@fluentui/react-input';\n\nfunction isDateOutOfBounds(date: Date, minDate?: Date, maxDate?: Date): boolean {\n return (!!minDate && compareDatePart(minDate!, date) > 0) || (!!maxDate && compareDatePart(maxDate!, date) < 0);\n}\n\nfunction useFocusLogic() {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const preventFocusOpeningPicker = React.useRef(false);\n\n const focus = React.useCallback(() => {\n inputRef.current?.focus?.();\n }, []);\n\n const preventNextFocusOpeningPicker = React.useCallback(() => {\n preventFocusOpeningPicker.current = true;\n }, []);\n\n return [focus, inputRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] as const;\n}\n\nfunction usePopupVisibility(props: DatePickerProps) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open,\n });\n const isMounted = React.useRef(false);\n\n React.useEffect(\n () => {\n if (isMounted.current && !open) {\n // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n props.onOpenChange?.(false);\n }\n isMounted.current = true;\n },\n // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.allowTextInput, open],\n );\n\n return [open, setOpen] as const;\n}\n\nfunction useSelectedDate({ formatDate, onSelectDate, value }: DatePickerProps) {\n const [selectedDate, setSelectedDateState] = useControllableState<Date | null | undefined>({\n initialState: null,\n state: value,\n });\n const [formattedDate, setFormattedDate] = React.useState(() => (value && formatDate ? formatDate(value) : ''));\n\n const setSelectedDate = (newDate: Date | null | undefined) => {\n onSelectDate?.(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n\n React.useEffect(() => {\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [formatDate, value]);\n\n return [selectedDate, formattedDate, setSelectedDate, setFormattedDate] as const;\n}\n\nconst defaultFormatDate = (date?: Date) => (date ? date.toDateString() : '');\nconst defaultParseDateFromString = (dateStr: string) => {\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */\nexport const useDatePicker_unstable = (props: DatePickerProps, ref: React.Ref<HTMLInputElement>): DatePickerState => {\n const {\n allowTextInput = false,\n allFocusable = false,\n borderless = false,\n dateTimeFormatter,\n defaultOpen = false,\n disableAutoFocus = true,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n formatDate = defaultFormatDate,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n initialPickerDate = new Date(),\n inlinePopup = false,\n isMonthPickerVisible = true,\n maxDate,\n minDate,\n onOpenChange,\n onSelectDate: onUserSelectDate,\n openOnClick = true,\n onValidationResult,\n parseDateFromString = defaultParseDateFromString,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay = false,\n showWeekNumbers = false,\n strings = defaultDatePickerStrings,\n today,\n underlined = false,\n value,\n ...restOfProps\n } = props;\n const calendar = React.useRef<ICalendar>(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value,\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n const required = fieldContext?.required ?? props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n\n const validateTextInput = React.useCallback(\n (date: Date | null = null): void => {\n let error: DatePickerValidationResultData['error'];\n\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date ?? selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString!(formattedDate);\n\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n\n onUserSelectDate?.(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n\n onValidationResult?.({ error });\n },\n [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate,\n ],\n );\n\n const setOpen = React.useCallback(\n (newState: boolean) => {\n onOpenChange?.(newState);\n setOpenState(newState);\n\n if (!open && !props.disabled) {\n focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [focus, onOpenChange, props.disabled, setOpenState],\n );\n\n const dismissDatePickerPopup = React.useCallback(\n (newlySelectedDate?: Date | null): void => {\n if (open) {\n setOpen(false);\n\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n },\n [allowTextInput, open, setOpen, setSelectedDate, validateTextInput],\n );\n\n const showDatePickerPopup = React.useCallback((): void => {\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [open, preventNextFocusOpeningPicker, setOpen]);\n\n /**\n * Callback for closing the calendar callout\n */\n const calendarDismissed = React.useCallback(\n (newlySelectedDate?: Date): void => {\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n },\n [dismissDatePickerPopup, preventNextFocusOpeningPicker],\n );\n\n const onInputChange = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => {\n const { value: newValue } = data;\n\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n\n setFormattedDate(newValue);\n }\n },\n [allowTextInput, dismissDatePickerPopup, open, setFormattedDate],\n );\n\n const onInputBlur: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n validateTextInput();\n }, [validateTextInput]);\n\n const onInputKeyDown = React.useCallback(\n (ev: React.KeyboardEvent<HTMLElement>): void => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n\n case ArrowDown:\n ev.preventDefault();\n if (ev.altKey && !open) {\n showDatePickerPopup();\n }\n break;\n\n default:\n break;\n }\n },\n [calendarDismissed, dismissDatePickerPopup, open, props.allowTextInput, showDatePickerPopup, validateTextInput],\n );\n\n const onInputFocus: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n if (disableAutoFocus) {\n return;\n }\n\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [allowTextInput, disableAutoFocus, preventFocusOpeningPicker, showDatePickerPopup]);\n\n const onInputClick: React.MouseEventHandler<HTMLInputElement> = React.useCallback((): void => {\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup,\n ]);\n\n const onIconClick = (ev: React.MouseEvent<HTMLElement>): void => {\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n\n const inputAppearance: InputProps['appearance'] = underlined\n ? 'underline'\n : borderless\n ? 'filled-lighter'\n : 'outline';\n\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const root = resolveShorthand(restOfProps, {\n required: true,\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: <CalendarMonthRegular onClick={onIconClick as unknown as React.MouseEventHandler<SVGElement>} />,\n readOnly: !allowTextInput,\n role: 'combobox',\n },\n });\n\n const inputRoot = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: triggerWrapperRef,\n },\n });\n inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);\n root.root = inputRoot;\n\n const inputShorthand = resolveShorthand(props.input, { required: true });\n inputShorthand.ref = useMergedRefs(inputShorthand.ref, ref, rootRef);\n root.input = inputShorthand;\n\n root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));\n root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));\n root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));\n root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));\n root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));\n\n const { modalAttributes } = useModalAttributes({ trapFocus: true, alwaysFocusable: true, legacyTrapFocus: false });\n const popupSurface = open\n ? resolveShorthand(props.popupSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes,\n },\n })\n : undefined;\n\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n\n useOnScrollOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n\n // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(() => {\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [disableAutoFocus, open, props.disabled]);\n\n const calendarShorthand = resolveShorthand(props.calendar, {\n required: true,\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate,\n },\n });\n\n calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));\n calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));\n\n const state: DatePickerState = {\n disabled: !!props.disabled,\n inlinePopup,\n\n components: {\n root: Input,\n calendar: Calendar as React.FC<Partial<CalendarProps>>,\n popupSurface: 'div',\n },\n\n calendar: calendarShorthand,\n root,\n popupSurface,\n };\n\n state.root.value = formattedDate;\n\n return state;\n};\n"],"names":["React","ArrowDown","Enter","Escape","Calendar","CalendarMonthRegular","compareDatePart","DayOfWeek","FirstWeekOfYear","defaultDatePickerStrings","Input","mergeCallbacks","resolveShorthand","useControllableState","useEventCallback","useId","useMergedRefs","useOnClickOutside","useOnScrollOutside","useFieldContext_unstable","useFieldContext","useFluent_unstable","useFluent","useModalAttributes","usePopupPositioning","isDateOutOfBounds","date","minDate","maxDate","useFocusLogic","inputRef","useRef","preventFocusOpeningPicker","focus","useCallback","current","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","initialState","defaultState","defaultOpen","state","isMounted","useEffect","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","useDatePicker_unstable","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","Sunday","firstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","required","popupSurfaceId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","preventDefault","stopPropagation","altKey","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","root","defaultProps","appearance","undefined","contentAfter","onClick","readOnly","role","inputRoot","inputShorthand","input","onChange","onBlur","onKeyDown","onFocus","modalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","id","targetDocument","element","callback","refs","calendarShorthand","componentRef","onDismiss","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,EAAEC,SAAS,EAAEC,eAAe,QAAQ,cAAc;AAC1E,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SACEC,cAAc,EACdC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,EAChBC,KAAK,EACLC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,QACb,4BAA4B;AACnC,SAASC,4BAA4BC,eAAe,QAAQ,wBAAwB;AACpF,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,mBAAmB,QAAQ,kCAAkC;AAKtE,SAASC,kBAAkBC,IAAU,EAAEC,OAAc,EAAEC,OAAc,EAAW;IAC9E,OAAO,AAAC,C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IP,QAAQ,CAACD,MAAMkE,QAAQ,IAAIX,SAAS1D,OAAO,EAAE;YAC/C0D,SAAS1D,OAAO,CAACF,KAAK;QACxB,CAAC;IACH,GAAG;QAACsC;QAAkBhC;QAAMD,MAAMkE,QAAQ;KAAC;IAE3C,MAAM8C,oBAAoB1I,iBAAiB0B,MAAMuD,QAAQ,EAAE;QACzDI,UAAU,IAAI;QACd6B,cAAc;YACZ1D;YACAmF,cAAc1D;YACdvB;YACAE;YACAE;YACAE;YACAC;YACAG;YACApD;YACAD;YACA0D;YACAC;YACAC;YACAC;YACAC;YACAC;YACAtC,OAAOC,gBAAgByB;QACzB;IACF;IAEAwE,kBAAkBE,SAAS,GAAG1I,iBAAiBH,eAAe2I,kBAAkBE,SAAS,EAAE5C;IAC3F0C,kBAAkBnG,YAAY,GAAGrC,iBAAiBH,eAAe2I,kBAAkBnG,YAAY,EAAEyD;IAEjG,MAAMhE,QAAyB;QAC7B4D,UAAU,CAAC,CAAClE,MAAMkE,QAAQ;QAC1BzB;QAEA0E,YAAY;YACV5B,MAAMnH;YACNmF,UAAUzF;YACV4I,cAAc;QAChB;QAEAnD,UAAUyD;QACVzB;QACAmB;IACF;IAEApG,MAAMiF,IAAI,CAACzE,KAAK,GAAGG;IAEnB,OAAOX;AACT,EAAE"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { AnimationDirection } from './Calendar';\nexport type { CalendarProps, ICalendar } from './Calendar';\n\nexport type { CalendarDayProps, ICalendarDay } from './CalendarDay';\n\nexport type { CalendarMonthProps, ICalendarMonth } from './CalendarMonth';\n\nexport {\n DatePicker,\n datePickerClassNames,\n defaultDatePickerErrorStrings,\n defaultDatePickerStrings,\n renderDatePicker_unstable,\n useDatePicker_unstable,\n useDatePickerStyles_unstable,\n} from './DatePicker';\nexport type { DatePickerErrorType, DatePickerProps, DatePickerValidationResultData, IDatePicker } from './DatePicker';\n\nexport {\n DAYS_IN_WEEK,\n DateRangeType,\n DayOfWeek,\n FirstWeekOfYear,\n MonthOfYear,\n TimeConstants,\n addDays,\n addMonths,\n addWeeks,\n addYears,\n compareDatePart,\n compareDates,\n getDatePartHashValue,\n getDateRangeArray,\n getEndDateOfWeek,\n getMonthEnd,\n getMonthStart,\n getStartDateOfWeek,\n getWeekNumber,\n getWeekNumbersInMonth,\n getYearEnd,\n getYearStart,\n isInDateRangeArray,\n setMonth,\n} from './utils';\nexport type { CalendarStrings, DateFormatting, DateGridStrings } from './utils';\n"],"names":["AnimationDirection","DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable","DAYS_IN_WEEK","DateRangeType","DayOfWeek","FirstWeekOfYear","MonthOfYear","TimeConstants","addDays","addMonths","addWeeks","addYears","compareDatePart","compareDates","getDatePartHashValue","getDateRangeArray","getEndDateOfWeek","getMonthEnd","getMonthStart","getStartDateOfWeek","getWeekNumber","getWeekNumbersInMonth","getYearEnd","getYearStart","isInDateRangeArray","setMonth"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,aAAa;AAOhD,SACEC,UAAU,EACVC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,4BAA4B,QACvB,eAAe;AAGtB,SACEC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,OAAO,EACPC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,eAAe,EACfC,YAAY,EACZC,oBAAoB,EACpBC,iBAAiB,EACjBC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,aAAa,EACbC,qBAAqB,EACrBC,UAAU,EACVC,YAAY,EACZC,kBAAkB,EAClBC,QAAQ,QACH,UAAU"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { AnimationDirection } from './Calendar';\nexport type { CalendarProps, ICalendar } from './Calendar';\n\nexport type { CalendarDayProps, ICalendarDay } from './CalendarDay';\n\nexport type { CalendarMonthProps, ICalendarMonth } from './CalendarMonth';\n\nexport {\n DatePicker,\n datePickerClassNames,\n defaultDatePickerErrorStrings,\n defaultDatePickerStrings,\n renderDatePicker_unstable,\n useDatePicker_unstable,\n useDatePickerStyles_unstable,\n} from './DatePicker';\nexport type { DatePickerErrorType, DatePickerProps, DatePickerValidationResultData } from './DatePicker';\n\nexport {\n DAYS_IN_WEEK,\n DateRangeType,\n DayOfWeek,\n FirstWeekOfYear,\n MonthOfYear,\n TimeConstants,\n addDays,\n addMonths,\n addWeeks,\n addYears,\n compareDatePart,\n compareDates,\n getDatePartHashValue,\n getDateRangeArray,\n getEndDateOfWeek,\n getMonthEnd,\n getMonthStart,\n getStartDateOfWeek,\n getWeekNumber,\n getWeekNumbersInMonth,\n getYearEnd,\n getYearStart,\n isInDateRangeArray,\n setMonth,\n} from './utils';\nexport type { CalendarStrings, DateFormatting, DateGridStrings } from './utils';\n"],"names":["AnimationDirection","DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable","DAYS_IN_WEEK","DateRangeType","DayOfWeek","FirstWeekOfYear","MonthOfYear","TimeConstants","addDays","addMonths","addWeeks","addYears","compareDatePart","compareDates","getDatePartHashValue","getDateRangeArray","getEndDateOfWeek","getMonthEnd","getMonthStart","getStartDateOfWeek","getWeekNumber","getWeekNumbersInMonth","getYearEnd","getYearStart","isInDateRangeArray","setMonth"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,aAAa;AAOhD,SACEC,UAAU,EACVC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,4BAA4B,QACvB,eAAe;AAGtB,SACEC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,OAAO,EACPC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,eAAe,EACfC,YAAY,EACZC,oBAAoB,EACpBC,iBAAiB,EACjBC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,aAAa,EACbC,qBAAqB,EACrBC,UAAU,EACVC,YAAY,EACZC,kBAAkB,EAClBC,QAAQ,QACH,UAAU"}
@@ -169,6 +169,25 @@ const useGoTodayButtonStyles = /*#__PURE__*/ (0, _react["__styles"])({
169
169
  Jwef8y: "f9ql6rf",
170
170
  Bi91k9c: "f1f1pb61",
171
171
  eoavqd: "f8491dx",
172
+ Bv57zgv: "fq3vqfz",
173
+ Bnosqey: "f7lk14",
174
+ Bx7pl5v: "f1awoz4y",
175
+ B23s7e0: [
176
+ "f1q1rlij",
177
+ "f1txf70x"
178
+ ],
179
+ knvgbf: [
180
+ "f1txf70x",
181
+ "f1q1rlij"
182
+ ],
183
+ B3ons6i: [
184
+ "fduk3fc",
185
+ "fw6hbk1"
186
+ ],
187
+ Be8uuq8: [
188
+ "fw6hbk1",
189
+ "fduk3fc"
190
+ ],
172
191
  B2d53fq: "fc9d3oc",
173
192
  Dyrjrp: "f1cqwcg4",
174
193
  Be90el1: "fmjaa5u"
@@ -206,6 +225,50 @@ const useGoTodayButtonStyles = /*#__PURE__*/ (0, _react["__styles"])({
206
225
  ".f1f1pb61:hover{color:var(--colorBrandForeground1);}",
207
226
  ".f8491dx:hover{cursor:pointer;}",
208
227
  ".fc9d3oc:hover:active{color:var(--colorBrandForeground2);}"
228
+ ],
229
+ m: [
230
+ [
231
+ "@media (forced-colors: active){.fq3vqfz:hover{outline-width:var(--strokeWidthThin);}}",
232
+ {
233
+ m: "(forced-colors: active)"
234
+ }
235
+ ],
236
+ [
237
+ "@media (forced-colors: active){.f7lk14:hover{outline-style:solid;}}",
238
+ {
239
+ m: "(forced-colors: active)"
240
+ }
241
+ ],
242
+ [
243
+ "@media (forced-colors: active){.f1awoz4y:hover{outline-color:ButtonText;}}",
244
+ {
245
+ m: "(forced-colors: active)"
246
+ }
247
+ ],
248
+ [
249
+ "@media (forced-colors: active){.f1q1rlij:hover{border-bottom-right-radius:var(--borderRadiusSmall);}.f1txf70x:hover{border-bottom-left-radius:var(--borderRadiusSmall);}}",
250
+ {
251
+ m: "(forced-colors: active)"
252
+ }
253
+ ],
254
+ [
255
+ "@media (forced-colors: active){.f1q1rlij:hover{border-bottom-right-radius:var(--borderRadiusSmall);}.f1txf70x:hover{border-bottom-left-radius:var(--borderRadiusSmall);}}",
256
+ {
257
+ m: "(forced-colors: active)"
258
+ }
259
+ ],
260
+ [
261
+ "@media (forced-colors: active){.fduk3fc:hover{border-top-right-radius:var(--borderRadiusSmall);}.fw6hbk1:hover{border-top-left-radius:var(--borderRadiusSmall);}}",
262
+ {
263
+ m: "(forced-colors: active)"
264
+ }
265
+ ],
266
+ [
267
+ "@media (forced-colors: active){.fduk3fc:hover{border-top-right-radius:var(--borderRadiusSmall);}.fw6hbk1:hover{border-top-left-radius:var(--borderRadiusSmall);}}",
268
+ {
269
+ m: "(forced-colors: active)"
270
+ }
271
+ ]
209
272
  ]
210
273
  });
211
274
  const useLiveRegionStyles = /*#__PURE__*/ (0, _react["__styles"])({
@@ -1 +1 @@
1
- {"version":3,"sources":["useCalendarStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { __styles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */\nexport 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 = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n a9b677: \"f13dwy2t\"\n },\n normalize: {\n E5pizo: \"f1couhl3\",\n B7ck84d: \"f1ewtqcl\",\n B6of3ja: \"f1hu3pq6\",\n t21cq0: [\"f11qmguv\", \"f1tyq0we\"],\n jrapky: \"f19f4twv\",\n Frg6f3: [\"f1tyq0we\", \"f11qmguv\"],\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"fhxju0i\", \"f1cnd47f\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"f1cnd47f\", \"fhxju0i\"]\n },\n monthPickerNotVisible: {\n Beiy3e4: \"f1vx9l62\"\n },\n dayAndMonthPickersVisible: {\n a9b677: \"fcy5b15\"\n },\n dayPickerVisibleAndWeekNumbersShown: {\n a9b677: \"fhsg0in\"\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n a9b677: \"fcarq7f\"\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f13dwy2t{width:220px;}\", \".f1couhl3{box-shadow:none;}\", \".f1ewtqcl{box-sizing:border-box;}\", \".f1hu3pq6{margin-top:0;}\", \".f11qmguv{margin-right:0;}\", \".f1tyq0we{margin-left:0;}\", \".f19f4twv{margin-bottom:0;}\", \".f1g0x7ka{padding-top:0;}\", \".fhxju0i{padding-right:0;}\", \".f1cnd47f{padding-left:0;}\", \".f1qch9an{padding-bottom:0;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".fcy5b15{width:440px;}\", \".fhsg0in{width:250px;}\", \".fcarq7f{width:470px;}\"]\n});\nconst useDividerStyles = /*#__PURE__*/__styles({\n base: {\n g2u3we: \"f68mrw8\",\n h3c5rm: [\"f7pw515\", \"fw35ms5\"],\n B9xav0g: \"frpde29\",\n zhjwy3: [\"fw35ms5\", \"f7pw515\"],\n Bekrc4i: [\"f1hqa2wf\", \"finvdd3\"],\n vrafjx: [\"fcdblym\", \"fjik90z\"],\n Bhzewxz: \"f15twtuk\"\n }\n}, {\n d: [\".f68mrw8{border-top-color:var(--colorNeutralStroke2);}\", \".f7pw515{border-right-color:var(--colorNeutralStroke2);}\", \".fw35ms5{border-left-color:var(--colorNeutralStroke2);}\", \".frpde29{border-bottom-color:var(--colorNeutralStroke2);}\", \".f1hqa2wf{border-right-width:1px;}\", \".finvdd3{border-left-width:1px;}\", \".fcdblym{border-right-style:solid;}\", \".fjik90z{border-left-style:solid;}\", \".f15twtuk{top:0;}\"]\n});\nconst useMonthPickerWrapperStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n Beiy3e4: \"f1vx9l62\"\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\"]\n});\nconst useGoTodayButtonStyles = /*#__PURE__*/__styles({\n base: {\n qb2dma: \"fpydfdc\",\n De3pzq: \"f1c21dwh\",\n icvyot: \"f1ern45e\",\n vrafjx: [\"f1n71otn\", \"f1deefiw\"],\n oivjwe: \"f1h8hb77\",\n wvpqe5: [\"f1deefiw\", \"f1n71otn\"],\n B5kzvoi: \"f1yab3r1\",\n B7ck84d: \"f1e4lqlz\",\n sj55zd: \"f19n0e5\",\n Bahqtrf: \"f1mo0ibp\",\n Be2twd7: \"fy9rknc\",\n Bqenvij: \"f1tvdnth\",\n Bg96gwp: \"fpfng1i\",\n t21cq0: [\"f17vyym1\", \"fb5scp\"],\n B6of3ja: \"f4gg0ds\",\n B68tc82: \"f1mtd64y\",\n Bmxbyg5: \"f1y7q3j9\",\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"f8wuabp\", \"fycuoez\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"fycuoez\", \"f8wuabp\"],\n seuwu7: \"fvy6vk6\",\n Jwef8y: \"f9ql6rf\",\n Bi91k9c: \"f1f1pb61\",\n eoavqd: \"f8491dx\",\n B2d53fq: \"fc9d3oc\",\n Dyrjrp: \"f1cqwcg4\",\n Be90el1: \"fmjaa5u\"\n }\n}, {\n d: [\".fpydfdc{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;}\", \".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;}\", \".f1yab3r1{bottom:0;}\", \".f1e4lqlz{box-sizing:content-box;}\", \".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1mo0ibp{font-family:inherit;}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".f1tvdnth{height:30px;}\", \".fpfng1i{line-height:30px;}\", \".f17vyym1{margin-right:16px;}\", \".fb5scp{margin-left:16px;}\", \".f4gg0ds{margin-top:3px;}\", \".f1mtd64y{overflow-x:visible;}\", \".f1y7q3j9{overflow-y:visible;}\", \".f1g0x7ka{padding-top:0;}\", \".f8wuabp{padding-right:4px;}\", \".fycuoez{padding-left:4px;}\", \".f1qch9an{padding-bottom:0;}\", \".fvy6vk6 div{font-size:var(--fontSizeBase200);}\", \".f1cqwcg4:disabled{color:var(--colorNeutralForegroundDisabled);}\", \".fmjaa5u:disabled{pointer-events:none;}\"],\n h: [\".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}\", \".f1f1pb61:hover{color:var(--colorBrandForeground1);}\", \".f8491dx:hover{cursor:pointer;}\", \".fc9d3oc:hover:active{color:var(--colorBrandForeground2);}\"]\n});\nconst useLiveRegionStyles = /*#__PURE__*/__styles({\n base: {\n B4j52fo: \"fre7gi1\",\n Bekrc4i: [\"f1358rze\", \"f1rvrf73\"],\n Bn0qgzm: \"fqdk4by\",\n ibv6hh: [\"f1rvrf73\", \"f1358rze\"],\n Bqenvij: \"f1mpe4l3\",\n B6of3ja: \"fkrn0sh\",\n t21cq0: [\"f179hvsh\", \"f1538868\"],\n jrapky: \"fmxx68s\",\n Frg6f3: [\"f1538868\", \"f179hvsh\"],\n B68tc82: \"f1p9o1ba\",\n Bmxbyg5: \"f1sil6mw\",\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"fhxju0i\", \"f1cnd47f\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"f1cnd47f\", \"fhxju0i\"],\n qhf8xq: \"f1euv43f\",\n a9b677: \"frkrog8\"\n }\n}, {\n d: [\".fre7gi1{border-top-width:0;}\", \".f1358rze{border-right-width:0;}\", \".f1rvrf73{border-left-width:0;}\", \".fqdk4by{border-bottom-width:0;}\", \".f1mpe4l3{height:1px;}\", \".fkrn0sh{margin-top:-1px;}\", \".f179hvsh{margin-right:-1px;}\", \".f1538868{margin-left:-1px;}\", \".fmxx68s{margin-bottom:-1px;}\", \".f1p9o1ba{overflow-x:hidden;}\", \".f1sil6mw{overflow-y:hidden;}\", \".f1g0x7ka{padding-top:0;}\", \".fhxju0i{padding-right:0;}\", \".f1cnd47f{padding-left:0;}\", \".f1qch9an{padding-bottom:0;}\", \".f1euv43f{position:absolute;}\", \".frkrog8{width:1px;}\"]\n});\n/**\n * @internal\n *\n * Apply styling to the Calendar slots based on the state\n */\nexport const useCalendarStyles_unstable = props => {\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n const {\n className,\n isDayPickerVisible,\n isMonthPickerVisible,\n showWeekNumbers\n } = 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//# sourceMappingURL=useCalendarStyles.styles.js.map"],"names":["calendarClassNames","useCalendarStyles_unstable","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","__styles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","useDividerStyles","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bekrc4i","vrafjx","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","seuwu7","Jwef8y","Bi91k9c","eoavqd","B2d53fq","Dyrjrp","Be90el1","h","useLiveRegionStyles","B4j52fo","Bn0qgzm","ibv6hh","qhf8xq","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers","mergeClasses"],"mappings":";;;;;;;;;;;IAKaA,kBAAkB,MAAlBA;IA2HAC,0BAA0B,MAA1BA;;uBA/HsC;AAI5C,MAAMD,qBAAqB;IAChCE,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,oBAAoB;IACpBC,YAAY;AACd;AACA,MAAMC,gBAAgB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC1CC,MAAM;QACJC,QAAQ;QACRC,QAAQ;IACV;IACAC,WAAW;QACTC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QA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,EAClBC,qBAAoB,EACpBC,gBAAe,EAChB,GAAGT;IACJ,OAAO;QACL/D,MAAMyE,IAAAA,mBAAY,EAAC3E,mBAAmBE,IAAI,EAAEgE,WAAWzD,IAAI,EAAEyD,WAAWtD,SAAS,EAAE,CAAC6D,wBAAwBP,WAAW3C,qBAAqB,EAAEiD,sBAAsBC,wBAAwB,CAACC,mBAAmBR,WAAWzC,yBAAyB,EAAE+C,sBAAsB,CAACC,wBAAwBC,mBAAmBR,WAAWxC,mCAAmC,EAAE8C,sBAAsBC,wBAAwBC,mBAAmBR,WAAWvC,4CAA4C,EAAE4C;QAClepE,SAASwE,IAAAA,mBAAY,EAAC3E,mBAAmBG,OAAO,EAAEgE,cAAc1D,IAAI;QACpEJ,oBAAoBsE,IAAAA,mBAAY,EAAC3E,mBAAmBK,kBAAkB,EAAE+D,yBAAyB3D,IAAI;QACrGL,eAAeuE,IAAAA,mBAAY,EAAC3E,mBAAmBI,aAAa,EAAEiE,oBAAoB5D,IAAI;QACtFH,YAAYqE,IAAAA,mBAAY,EAAC3E,mBAAmBM,UAAU,EAAEgE,iBAAiB7D,IAAI;IAC/E;AACF,GACA,oDAAoD"}
1
+ {"version":3,"sources":["useCalendarStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { __styles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */\nexport 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 = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n a9b677: \"f13dwy2t\"\n },\n normalize: {\n E5pizo: \"f1couhl3\",\n B7ck84d: \"f1ewtqcl\",\n B6of3ja: \"f1hu3pq6\",\n t21cq0: [\"f11qmguv\", \"f1tyq0we\"],\n jrapky: \"f19f4twv\",\n Frg6f3: [\"f1tyq0we\", \"f11qmguv\"],\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"fhxju0i\", \"f1cnd47f\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"f1cnd47f\", \"fhxju0i\"]\n },\n monthPickerNotVisible: {\n Beiy3e4: \"f1vx9l62\"\n },\n dayAndMonthPickersVisible: {\n a9b677: \"fcy5b15\"\n },\n dayPickerVisibleAndWeekNumbersShown: {\n a9b677: \"fhsg0in\"\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n a9b677: \"fcarq7f\"\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f13dwy2t{width:220px;}\", \".f1couhl3{box-shadow:none;}\", \".f1ewtqcl{box-sizing:border-box;}\", \".f1hu3pq6{margin-top:0;}\", \".f11qmguv{margin-right:0;}\", \".f1tyq0we{margin-left:0;}\", \".f19f4twv{margin-bottom:0;}\", \".f1g0x7ka{padding-top:0;}\", \".fhxju0i{padding-right:0;}\", \".f1cnd47f{padding-left:0;}\", \".f1qch9an{padding-bottom:0;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".fcy5b15{width:440px;}\", \".fhsg0in{width:250px;}\", \".fcarq7f{width:470px;}\"]\n});\nconst useDividerStyles = /*#__PURE__*/__styles({\n base: {\n g2u3we: \"f68mrw8\",\n h3c5rm: [\"f7pw515\", \"fw35ms5\"],\n B9xav0g: \"frpde29\",\n zhjwy3: [\"fw35ms5\", \"f7pw515\"],\n Bekrc4i: [\"f1hqa2wf\", \"finvdd3\"],\n vrafjx: [\"fcdblym\", \"fjik90z\"],\n Bhzewxz: \"f15twtuk\"\n }\n}, {\n d: [\".f68mrw8{border-top-color:var(--colorNeutralStroke2);}\", \".f7pw515{border-right-color:var(--colorNeutralStroke2);}\", \".fw35ms5{border-left-color:var(--colorNeutralStroke2);}\", \".frpde29{border-bottom-color:var(--colorNeutralStroke2);}\", \".f1hqa2wf{border-right-width:1px;}\", \".finvdd3{border-left-width:1px;}\", \".fcdblym{border-right-style:solid;}\", \".fjik90z{border-left-style:solid;}\", \".f15twtuk{top:0;}\"]\n});\nconst useMonthPickerWrapperStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n Beiy3e4: \"f1vx9l62\"\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\"]\n});\nconst useGoTodayButtonStyles = /*#__PURE__*/__styles({\n base: {\n qb2dma: \"fpydfdc\",\n De3pzq: \"f1c21dwh\",\n icvyot: \"f1ern45e\",\n vrafjx: [\"f1n71otn\", \"f1deefiw\"],\n oivjwe: \"f1h8hb77\",\n wvpqe5: [\"f1deefiw\", \"f1n71otn\"],\n B5kzvoi: \"f1yab3r1\",\n B7ck84d: \"f1e4lqlz\",\n sj55zd: \"f19n0e5\",\n Bahqtrf: \"f1mo0ibp\",\n Be2twd7: \"fy9rknc\",\n Bqenvij: \"f1tvdnth\",\n Bg96gwp: \"fpfng1i\",\n t21cq0: [\"f17vyym1\", \"fb5scp\"],\n B6of3ja: \"f4gg0ds\",\n B68tc82: \"f1mtd64y\",\n Bmxbyg5: \"f1y7q3j9\",\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"f8wuabp\", \"fycuoez\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"fycuoez\", \"f8wuabp\"],\n seuwu7: \"fvy6vk6\",\n Jwef8y: \"f9ql6rf\",\n Bi91k9c: \"f1f1pb61\",\n eoavqd: \"f8491dx\",\n Bv57zgv: \"fq3vqfz\",\n Bnosqey: \"f7lk14\",\n Bx7pl5v: \"f1awoz4y\",\n B23s7e0: [\"f1q1rlij\", \"f1txf70x\"],\n knvgbf: [\"f1txf70x\", \"f1q1rlij\"],\n B3ons6i: [\"fduk3fc\", \"fw6hbk1\"],\n Be8uuq8: [\"fw6hbk1\", \"fduk3fc\"],\n B2d53fq: \"fc9d3oc\",\n Dyrjrp: \"f1cqwcg4\",\n Be90el1: \"fmjaa5u\"\n }\n}, {\n d: [\".fpydfdc{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;}\", \".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;}\", \".f1yab3r1{bottom:0;}\", \".f1e4lqlz{box-sizing:content-box;}\", \".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1mo0ibp{font-family:inherit;}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".f1tvdnth{height:30px;}\", \".fpfng1i{line-height:30px;}\", \".f17vyym1{margin-right:16px;}\", \".fb5scp{margin-left:16px;}\", \".f4gg0ds{margin-top:3px;}\", \".f1mtd64y{overflow-x:visible;}\", \".f1y7q3j9{overflow-y:visible;}\", \".f1g0x7ka{padding-top:0;}\", \".f8wuabp{padding-right:4px;}\", \".fycuoez{padding-left:4px;}\", \".f1qch9an{padding-bottom:0;}\", \".fvy6vk6 div{font-size:var(--fontSizeBase200);}\", \".f1cqwcg4:disabled{color:var(--colorNeutralForegroundDisabled);}\", \".fmjaa5u:disabled{pointer-events:none;}\"],\n h: [\".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}\", \".f1f1pb61:hover{color:var(--colorBrandForeground1);}\", \".f8491dx:hover{cursor:pointer;}\", \".fc9d3oc:hover:active{color:var(--colorBrandForeground2);}\"],\n m: [[\"@media (forced-colors: active){.fq3vqfz:hover{outline-width:var(--strokeWidthThin);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f7lk14:hover{outline-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1awoz4y:hover{outline-color:ButtonText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1q1rlij:hover{border-bottom-right-radius:var(--borderRadiusSmall);}.f1txf70x:hover{border-bottom-left-radius:var(--borderRadiusSmall);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1q1rlij:hover{border-bottom-right-radius:var(--borderRadiusSmall);}.f1txf70x:hover{border-bottom-left-radius:var(--borderRadiusSmall);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fduk3fc:hover{border-top-right-radius:var(--borderRadiusSmall);}.fw6hbk1:hover{border-top-left-radius:var(--borderRadiusSmall);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fduk3fc:hover{border-top-right-radius:var(--borderRadiusSmall);}.fw6hbk1:hover{border-top-left-radius:var(--borderRadiusSmall);}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\nconst useLiveRegionStyles = /*#__PURE__*/__styles({\n base: {\n B4j52fo: \"fre7gi1\",\n Bekrc4i: [\"f1358rze\", \"f1rvrf73\"],\n Bn0qgzm: \"fqdk4by\",\n ibv6hh: [\"f1rvrf73\", \"f1358rze\"],\n Bqenvij: \"f1mpe4l3\",\n B6of3ja: \"fkrn0sh\",\n t21cq0: [\"f179hvsh\", \"f1538868\"],\n jrapky: \"fmxx68s\",\n Frg6f3: [\"f1538868\", \"f179hvsh\"],\n B68tc82: \"f1p9o1ba\",\n Bmxbyg5: \"f1sil6mw\",\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"fhxju0i\", \"f1cnd47f\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"f1cnd47f\", \"fhxju0i\"],\n qhf8xq: \"f1euv43f\",\n a9b677: \"frkrog8\"\n }\n}, {\n d: [\".fre7gi1{border-top-width:0;}\", \".f1358rze{border-right-width:0;}\", \".f1rvrf73{border-left-width:0;}\", \".fqdk4by{border-bottom-width:0;}\", \".f1mpe4l3{height:1px;}\", \".fkrn0sh{margin-top:-1px;}\", \".f179hvsh{margin-right:-1px;}\", \".f1538868{margin-left:-1px;}\", \".fmxx68s{margin-bottom:-1px;}\", \".f1p9o1ba{overflow-x:hidden;}\", \".f1sil6mw{overflow-y:hidden;}\", \".f1g0x7ka{padding-top:0;}\", \".fhxju0i{padding-right:0;}\", \".f1cnd47f{padding-left:0;}\", \".f1qch9an{padding-bottom:0;}\", \".f1euv43f{position:absolute;}\", \".frkrog8{width:1px;}\"]\n});\n/**\n * @internal\n *\n * Apply styling to the Calendar slots based on the state\n */\nexport const useCalendarStyles_unstable = props => {\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n const {\n className,\n isDayPickerVisible,\n isMonthPickerVisible,\n showWeekNumbers\n } = 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//# sourceMappingURL=useCalendarStyles.styles.js.map"],"names":["calendarClassNames","useCalendarStyles_unstable","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","__styles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","useDividerStyles","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bekrc4i","vrafjx","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bv57zgv","Bnosqey","Bx7pl5v","B23s7e0","knvgbf","B3ons6i","Be8uuq8","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","B4j52fo","Bn0qgzm","ibv6hh","qhf8xq","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers","mergeClasses"],"mappings":";;;;;;;;;;;IAKaA,kBAAkB,MAAlBA;IAiJAC,0BAA0B,MAA1BA;;uBArJsC;AAI5C,MAAMD,qBAAqB;IAChCE,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,oBAAoB;IACpBC,YAAY;AACd;AACA,MAAMC,gBAAgB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC1CC,MAAM;QACJC,QAAQ;QACRC,QAAQ;IACV;IACAC,WAAW;QACTC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAU;IACjC;IACAC,uBAAuB;QACrBC,SAAS;IACX;IACAC,2BAA2B;QACzBd,QAAQ;IACV;IACAe,qCAAqC;QACnCf,QAAQ;IACV;IACAgB,8CAA8C;QAC5ChB,QAAQ;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QAAiC;QAAiC;QAAiC;QAA6B;QAA8B;QAA8B;QAAgC;QAAiC;KAAuB;AAC/hB;AAMO,MAAM3B,6BAA6BwE,CAAAA,QAAS;IACjD,MAAMC,aAAanE;IACnB,MAAMoE,gBAAgB9C;IACtB,MAAM+C,2BAA2BvC;IACjC,MAAMwC,sBAAsBvC;IAC5B,MAAMwC,mBAAmBV;IACzB,MAAM,EACJW,UAAS,EACTC,mBAAkB,EAClBC,qBAAoB,EACpBC,gBAAe,EAChB,GAAGT;IACJ,OAAO;QACLvE,MAAMiF,IAAAA,mBAAY,EAACnF,mBAAmBE,IAAI,EAAEwE,WAAWjE,IAAI,EAAEiE,WAAW9D,SAAS,EAAE,CAACqE,wBAAwBP,WAAWnD,qBAAqB,EAAEyD,sBAAsBC,wBAAwB,CAACC,mBAAmBR,WAAWjD,yBAAyB,EAAEuD,sBAAsB,CAACC,wBAAwBC,mBAAmBR,WAAWhD,mCAAmC,EAAEsD,sBAAsBC,wBAAwBC,mBAAmBR,WAAW/C,4CAA4C,EAAEoD;QACle5E,SAASgF,IAAAA,mBAAY,EAACnF,mBAAmBG,OAAO,EAAEwE,cAAclE,IAAI;QACpEJ,oBAAoB8E,IAAAA,mBAAY,EAACnF,mBAAmBK,kBAAkB,EAAEuE,yBAAyBnE,IAAI;QACrGL,eAAe+E,IAAAA,mBAAY,EAACnF,mBAAmBI,aAAa,EAAEyE,oBAAoBpE,IAAI;QACtFH,YAAY6E,IAAAA,mBAAY,EAACnF,mBAAmBM,UAAU,EAAEwE,iBAAiBrE,IAAI;IAC/E;AACF,GACA,oDAAoD"}
@@ -2,5 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["DatePicker.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -25,13 +25,13 @@ function isDateOutOfBounds(date, minDate, maxDate) {
25
25
  function useFocusLogic() {
26
26
  const inputRef = _react.useRef(null);
27
27
  const preventFocusOpeningPicker = _react.useRef(false);
28
- const focus = ()=>{
28
+ const focus = _react.useCallback(()=>{
29
29
  var _inputRef_current, _inputRef_current_focus;
30
30
  (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);
31
- };
32
- const preventNextFocusOpeningPicker = ()=>{
31
+ }, []);
32
+ const preventNextFocusOpeningPicker = _react.useCallback(()=>{
33
33
  preventFocusOpeningPicker.current = true;
34
- };
34
+ }, []);
35
35
  return [
36
36
  focus,
37
37
  inputRef,
@@ -156,8 +156,13 @@ const useDatePicker_unstable = (props, ref)=>{
156
156
  const setOpen = _react.useCallback((newState)=>{
157
157
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);
158
158
  setOpenState(newState);
159
+ if (!open && !props.disabled) {
160
+ focus();
161
+ }
159
162
  }, [
163
+ focus,
160
164
  onOpenChange,
165
+ props.disabled,
161
166
  setOpenState
162
167
  ]);
163
168
  const dismissDatePickerPopup = _react.useCallback((newlySelectedDate)=>{
@@ -297,7 +302,7 @@ const useDatePicker_unstable = (props, ref)=>{
297
302
  };
298
303
  const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';
299
304
  const [triggerWrapperRef, popupRef] = (0, _usePopupPositioning.usePopupPositioning)(props);
300
- const rootShorthand = (0, _reactUtilities.resolveShorthand)(restOfProps, {
305
+ const root = (0, _reactUtilities.resolveShorthand)(restOfProps, {
301
306
  required: true,
302
307
  defaultProps: {
303
308
  appearance: inputAppearance,
@@ -308,27 +313,34 @@ const useDatePicker_unstable = (props, ref)=>{
308
313
  onClick: onIconClick
309
314
  }),
310
315
  readOnly: !allowTextInput,
311
- role: 'combobox',
312
- root: {
313
- 'aria-owns': open ? popupSurfaceId : undefined,
314
- ref: (0, _reactUtilities.useMergedRefs)(triggerWrapperRef, ref)
315
- },
316
- input: {
317
- ref: rootRef
318
- }
316
+ role: 'combobox'
317
+ }
318
+ });
319
+ const inputRoot = (0, _reactUtilities.resolveShorthand)(props.root, {
320
+ required: true,
321
+ defaultProps: {
322
+ 'aria-owns': open ? popupSurfaceId : undefined,
323
+ ref: triggerWrapperRef
319
324
  }
320
325
  });
321
- rootShorthand.onChange = (0, _reactUtilities.mergeCallbacks)(rootShorthand.onChange, onInputChange);
322
- rootShorthand.onBlur = (0, _reactUtilities.mergeCallbacks)(rootShorthand.onBlur, onInputBlur);
323
- rootShorthand.onKeyDown = (0, _reactUtilities.mergeCallbacks)(rootShorthand.onKeyDown, onInputKeyDown);
324
- rootShorthand.onFocus = (0, _reactUtilities.mergeCallbacks)(rootShorthand.onFocus, onInputFocus);
325
- rootShorthand.onClick = (0, _reactUtilities.mergeCallbacks)(rootShorthand.onClick, onInputClick);
326
+ inputRoot.ref = (0, _reactUtilities.useMergedRefs)(inputRoot.ref, triggerWrapperRef);
327
+ root.root = inputRoot;
328
+ const inputShorthand = (0, _reactUtilities.resolveShorthand)(props.input, {
329
+ required: true
330
+ });
331
+ inputShorthand.ref = (0, _reactUtilities.useMergedRefs)(inputShorthand.ref, ref, rootRef);
332
+ root.input = inputShorthand;
333
+ root.onChange = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(root.onChange, onInputChange));
334
+ root.onBlur = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(root.onBlur, onInputBlur));
335
+ root.onKeyDown = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(root.onKeyDown, onInputKeyDown));
336
+ root.onFocus = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(root.onFocus, onInputFocus));
337
+ root.onClick = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(root.onClick, onInputClick));
326
338
  const { modalAttributes } = (0, _reactTabster.useModalAttributes)({
327
339
  trapFocus: true,
328
340
  alwaysFocusable: true,
329
341
  legacyTrapFocus: false
330
342
  });
331
- const popupSurfaceShorthand = open ? (0, _reactUtilities.resolveShorthand)(props.popupSurface, {
343
+ const popupSurface = open ? (0, _reactUtilities.resolveShorthand)(props.popupSurface, {
332
344
  required: true,
333
345
  defaultProps: {
334
346
  'aria-label': 'Calendar',
@@ -370,19 +382,6 @@ const useDatePicker_unstable = (props, ref)=>{
370
382
  open,
371
383
  props.disabled
372
384
  ]);
373
- const isFirstMount = (0, _reactUtilities.useFirstMount)();
374
- // When the popup is closed, focus should go back to the input.
375
- _react.useEffect(()=>{
376
- if (!open && !props.disabled && !isFirstMount) {
377
- focus();
378
- }
379
- // Focus function keeps changing, so we need to skip it in the deps
380
- // eslint-disable-next-line react-hooks/exhaustive-deps
381
- }, [
382
- isFirstMount,
383
- open,
384
- props.disabled
385
- ]);
386
385
  const calendarShorthand = (0, _reactUtilities.resolveShorthand)(props.calendar, {
387
386
  required: true,
388
387
  defaultProps: {
@@ -405,21 +404,8 @@ const useDatePicker_unstable = (props, ref)=>{
405
404
  value: selectedDate || initialPickerDate
406
405
  }
407
406
  });
408
- calendarShorthand.onDismiss = (0, _reactUtilities.mergeCallbacks)(calendarShorthand.onDismiss, calendarDismissed);
409
- calendarShorthand.onSelectDate = (0, _reactUtilities.mergeCallbacks)(calendarShorthand.onSelectDate, calendarDismissed);
410
- _react.useImperativeHandle(props.componentRef, ()=>({
411
- focus,
412
- reset () {
413
- setOpen(false);
414
- setSelectedDate(null);
415
- },
416
- showDatePickerPopup
417
- }), [
418
- focus,
419
- setOpen,
420
- setSelectedDate,
421
- showDatePickerPopup
422
- ]);
407
+ calendarShorthand.onDismiss = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(calendarShorthand.onDismiss, calendarDismissed));
408
+ calendarShorthand.onSelectDate = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(calendarShorthand.onSelectDate, calendarDismissed));
423
409
  const state = {
424
410
  disabled: !!props.disabled,
425
411
  inlinePopup,
@@ -429,8 +415,8 @@ const useDatePicker_unstable = (props, ref)=>{
429
415
  popupSurface: 'div'
430
416
  },
431
417
  calendar: calendarShorthand,
432
- root: rootShorthand,
433
- popupSurface: popupSurfaceShorthand
418
+ root,
419
+ popupSurface
434
420
  };
435
421
  state.root.value = formattedDate;
436
422
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport { mergeCallbacks, resolveShorthand, useControllableState, useFirstMount, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nfunction isDateOutOfBounds(date, minDate, maxDate) {\n return !!minDate && compareDatePart(minDate, date) > 0 || !!maxDate && compareDatePart(maxDate, date) < 0;\n}\nfunction useFocusLogic() {\n const inputRef = React.useRef(null);\n const preventFocusOpeningPicker = React.useRef(false);\n const focus = ()=>{\n var _inputRef_current, _inputRef_current_focus;\n (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);\n };\n const preventNextFocusOpeningPicker = ()=>{\n preventFocusOpeningPicker.current = true;\n };\n return [\n focus,\n inputRef,\n preventFocusOpeningPicker,\n preventNextFocusOpeningPicker\n ];\n}\nfunction usePopupVisibility(props) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open\n });\n const isMounted = React.useRef(false);\n React.useEffect(()=>{\n if (isMounted.current && !open) {\n var // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n _props_onOpenChange;\n (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, false);\n }\n isMounted.current = true;\n }, // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n props.allowTextInput,\n open\n ]);\n return [\n open,\n setOpen\n ];\n}\nfunction useSelectedDate({ formatDate , onSelectDate , value }) {\n const [selectedDate, setSelectedDateState] = useControllableState({\n initialState: null,\n state: value\n });\n const [formattedDate, setFormattedDate] = React.useState(()=>value && formatDate ? formatDate(value) : '');\n const setSelectedDate = (newDate)=>{\n onSelectDate === null || onSelectDate === void 0 ? void 0 : onSelectDate(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n React.useEffect(()=>{\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [\n formatDate,\n value\n ]);\n return [\n selectedDate,\n formattedDate,\n setSelectedDate,\n setFormattedDate\n ];\n}\nconst defaultFormatDate = (date)=>date ? date.toDateString() : '';\nconst defaultParseDateFromString = (dateStr)=>{\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */ export const useDatePicker_unstable = (props, ref)=>{\n const { allowTextInput =false , allFocusable =false , borderless =false , dateTimeFormatter , defaultOpen =false , disableAutoFocus =true , firstDayOfWeek =DayOfWeek.Sunday , firstWeekOfYear =FirstWeekOfYear.FirstDay , formatDate =defaultFormatDate , highlightCurrentMonth =false , highlightSelectedMonth =false , initialPickerDate =new Date() , inlinePopup =false , isMonthPickerVisible =true , maxDate , minDate , onOpenChange , onSelectDate: onUserSelectDate , openOnClick =true , onValidationResult , parseDateFromString =defaultParseDateFromString , showCloseButton =false , showGoToToday =true , showMonthPickerAsOverlay =false , showWeekNumbers =false , strings =defaultDatePickerStrings , today , underlined =false , value , ...restOfProps } = props;\n const calendar = React.useRef(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n var _fieldContext_required;\n const required = (_fieldContext_required = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n const validateTextInput = React.useCallback((date = null)=>{\n let error;\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date !== null && date !== void 0 ? date : selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString(formattedDate);\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n onUserSelectDate === null || onUserSelectDate === void 0 ? void 0 : onUserSelectDate(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n onValidationResult === null || onValidationResult === void 0 ? void 0 : onValidationResult({\n error\n });\n }, [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate\n ]);\n const setOpen = React.useCallback((newState)=>{\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);\n setOpenState(newState);\n }, [\n onOpenChange,\n setOpenState\n ]);\n const dismissDatePickerPopup = React.useCallback((newlySelectedDate)=>{\n if (open) {\n setOpen(false);\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n }, [\n allowTextInput,\n open,\n setOpen,\n setSelectedDate,\n validateTextInput\n ]);\n const showDatePickerPopup = React.useCallback(()=>{\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [\n open,\n preventNextFocusOpeningPicker,\n setOpen\n ]);\n /**\n * Callback for closing the calendar callout\n */ const calendarDismissed = React.useCallback((newlySelectedDate)=>{\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n }, [\n dismissDatePickerPopup,\n preventNextFocusOpeningPicker\n ]);\n const onInputChange = React.useCallback((ev, data)=>{\n const { value: newValue } = data;\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n setFormattedDate(newValue);\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n setFormattedDate\n ]);\n const onInputBlur = React.useCallback(()=>{\n validateTextInput();\n }, [\n validateTextInput\n ]);\n const onInputKeyDown = React.useCallback((ev)=>{\n switch(ev.key){\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n case ArrowDown:\n ev.preventDefault();\n if (ev.altKey && !open) {\n showDatePickerPopup();\n }\n break;\n default:\n break;\n }\n }, [\n calendarDismissed,\n dismissDatePickerPopup,\n open,\n props.allowTextInput,\n showDatePickerPopup,\n validateTextInput\n ]);\n const onInputFocus = React.useCallback(()=>{\n if (disableAutoFocus) {\n return;\n }\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [\n allowTextInput,\n disableAutoFocus,\n preventFocusOpeningPicker,\n showDatePickerPopup\n ]);\n const onInputClick = React.useCallback(()=>{\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup\n ]);\n const onIconClick = (ev)=>{\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const rootShorthand = resolveShorthand(restOfProps, {\n required: true,\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: /*#__PURE__*/ React.createElement(CalendarMonthRegular, {\n onClick: onIconClick\n }),\n readOnly: !allowTextInput,\n role: 'combobox',\n root: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: useMergedRefs(triggerWrapperRef, ref)\n },\n input: {\n ref: rootRef\n }\n }\n });\n rootShorthand.onChange = mergeCallbacks(rootShorthand.onChange, onInputChange);\n rootShorthand.onBlur = mergeCallbacks(rootShorthand.onBlur, onInputBlur);\n rootShorthand.onKeyDown = mergeCallbacks(rootShorthand.onKeyDown, onInputKeyDown);\n rootShorthand.onFocus = mergeCallbacks(rootShorthand.onFocus, onInputFocus);\n rootShorthand.onClick = mergeCallbacks(rootShorthand.onClick, onInputClick);\n const { modalAttributes } = useModalAttributes({\n trapFocus: true,\n alwaysFocusable: true,\n legacyTrapFocus: false\n });\n const popupSurfaceShorthand = open ? resolveShorthand(props.popupSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes\n }\n }) : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(()=>{\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [\n disableAutoFocus,\n open,\n props.disabled\n ]);\n const isFirstMount = useFirstMount();\n // When the popup is closed, focus should go back to the input.\n React.useEffect(()=>{\n if (!open && !props.disabled && !isFirstMount) {\n focus();\n }\n // Focus function keeps changing, so we need to skip it in the deps\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n isFirstMount,\n open,\n props.disabled\n ]);\n const calendarShorthand = resolveShorthand(props.calendar, {\n required: true,\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate\n }\n });\n calendarShorthand.onDismiss = mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed);\n calendarShorthand.onSelectDate = mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed);\n React.useImperativeHandle(props.componentRef, ()=>({\n focus,\n reset () {\n setOpen(false);\n setSelectedDate(null);\n },\n showDatePickerPopup\n }), [\n focus,\n setOpen,\n setSelectedDate,\n showDatePickerPopup\n ]);\n const state = {\n disabled: !!props.disabled,\n inlinePopup,\n components: {\n root: Input,\n calendar: Calendar,\n popupSurface: 'div'\n },\n calendar: calendarShorthand,\n root: rootShorthand,\n popupSurface: popupSurfaceShorthand\n };\n state.root.value = formattedDate;\n return state;\n};\n"],"names":["useDatePicker_unstable","isDateOutOfBounds","date","minDate","maxDate","compareDatePart","useFocusLogic","inputRef","React","useRef","preventFocusOpeningPicker","focus","_inputRef_current","_inputRef_current_focus","current","call","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","useControllableState","initialState","defaultState","defaultOpen","state","isMounted","useEffect","_props_onOpenChange","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","popupSurfaceId","useId","validateTextInput","useCallback","error","isNaN","getTime","newState","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","altKey","onInputFocus","onInputClick","disabled","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","rootShorthand","resolveShorthand","defaultProps","appearance","undefined","contentAfter","createElement","CalendarMonthRegular","onClick","readOnly","role","root","useMergedRefs","input","onChange","mergeCallbacks","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurfaceShorthand","popupSurface","id","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","isFirstMount","useFirstMount","calendarShorthand","componentRef","onDismiss","useImperativeHandle","reset","components","Input","Calendar"],"mappings":";;;;+BA8FiBA;;aAAAA;;;6DA9FM;8BACkB;0BAChB;4BACY;uBACuB;0BACnB;4BACnB;gCAC6H;4BACvF;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAE;IAC/C,OAAO,CAAC,CAACD,WAAWE,IAAAA,sBAAe,EAACF,SAASD,QAAQ,KAAK,CAAC,CAACE,WAAWC,IAAAA,sBAAe,EAACD,SAASF,QAAQ;AAC5G;AACA,SAASI,gBAAgB;IACrB,MAAMC,WAAWC,OAAMC,MAAM,CAAC,IAAI;IAClC,MAAMC,4BAA4BF,OAAMC,MAAM,CAAC,KAAK;IACpD,MAAME,QAAQ,IAAI;QACd,IAAIC,mBAAmBC;QACtBD,CAAAA,oBAAoBL,SAASO,OAAO,AAAD,MAAO,IAAI,IAAIF,sBAAsB,KAAK,IAAI,KAAK,IAAI,AAACC,CAAAA,0BAA0BD,kBAAkBD,KAAK,AAAD,MAAO,IAAI,IAAIE,4BAA4B,KAAK,IAAI,KAAK,IAAIA,wBAAwBE,IAAI,CAACH,kBAAkB;IAC5P;IACA,MAAMI,gCAAgC,IAAI;QACtCN,0BAA0BI,OAAO,GAAG,IAAI;I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AxC,OAAOC,gBAAgB0B;QAC3B;IACJ;IACA4F,kBAAkBE,SAAS,GAAGvB,IAAAA,8BAAc,EAACqB,kBAAkBE,SAAS,EAAE5D;IAC1E0D,kBAAkBxH,YAAY,GAAGmG,IAAAA,8BAAc,EAACqB,kBAAkBxH,YAAY,EAAE8D;IAChFvF,OAAMoJ,mBAAmB,CAAC1I,MAAMwI,YAAY,EAAE,IAAK,CAAA;YAC3C/I;YACAkJ,SAAS;gBACLzI,QAAQ,KAAK;gBACboB,gBAAgB,IAAI;YACxB;YACAsD;QACJ,CAAA,GAAI;QACJnF;QACAS;QACAoB;QACAsD;KACH;IACD,MAAMrE,QAAQ;QACVsF,UAAU,CAAC,CAAC7F,MAAM6F,QAAQ;QAC1BjD;QACAgG,YAAY;YACR9B,MAAM+B,iBAAK;YACXlF,UAAUmF,kBAAQ;YAClBlB,cAAc;QAClB;QACAjE,UAAU4E;QACVzB,MAAMX;QACNyB,cAAcD;IAClB;IACApH,MAAMuG,IAAI,CAAC9F,KAAK,GAAGG;IACnB,OAAOZ;AACX"}
1
+ {"version":3,"sources":["useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport { mergeCallbacks, resolveShorthand, useControllableState, useEventCallback, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nfunction isDateOutOfBounds(date, minDate, maxDate) {\n return !!minDate && compareDatePart(minDate, date) > 0 || !!maxDate && compareDatePart(maxDate, date) < 0;\n}\nfunction useFocusLogic() {\n const inputRef = React.useRef(null);\n const preventFocusOpeningPicker = React.useRef(false);\n const focus = React.useCallback(()=>{\n var _inputRef_current, _inputRef_current_focus;\n (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);\n }, []);\n const preventNextFocusOpeningPicker = React.useCallback(()=>{\n preventFocusOpeningPicker.current = true;\n }, []);\n return [\n focus,\n inputRef,\n preventFocusOpeningPicker,\n preventNextFocusOpeningPicker\n ];\n}\nfunction usePopupVisibility(props) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open\n });\n const isMounted = React.useRef(false);\n React.useEffect(()=>{\n if (isMounted.current && !open) {\n var // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n _props_onOpenChange;\n (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, false);\n }\n isMounted.current = true;\n }, // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n props.allowTextInput,\n open\n ]);\n return [\n open,\n setOpen\n ];\n}\nfunction useSelectedDate({ formatDate , onSelectDate , value }) {\n const [selectedDate, setSelectedDateState] = useControllableState({\n initialState: null,\n state: value\n });\n const [formattedDate, setFormattedDate] = React.useState(()=>value && formatDate ? formatDate(value) : '');\n const setSelectedDate = (newDate)=>{\n onSelectDate === null || onSelectDate === void 0 ? void 0 : onSelectDate(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n React.useEffect(()=>{\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [\n formatDate,\n value\n ]);\n return [\n selectedDate,\n formattedDate,\n setSelectedDate,\n setFormattedDate\n ];\n}\nconst defaultFormatDate = (date)=>date ? date.toDateString() : '';\nconst defaultParseDateFromString = (dateStr)=>{\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */ export const useDatePicker_unstable = (props, ref)=>{\n const { allowTextInput =false , allFocusable =false , borderless =false , dateTimeFormatter , defaultOpen =false , disableAutoFocus =true , firstDayOfWeek =DayOfWeek.Sunday , firstWeekOfYear =FirstWeekOfYear.FirstDay , formatDate =defaultFormatDate , highlightCurrentMonth =false , highlightSelectedMonth =false , initialPickerDate =new Date() , inlinePopup =false , isMonthPickerVisible =true , maxDate , minDate , onOpenChange , onSelectDate: onUserSelectDate , openOnClick =true , onValidationResult , parseDateFromString =defaultParseDateFromString , showCloseButton =false , showGoToToday =true , showMonthPickerAsOverlay =false , showWeekNumbers =false , strings =defaultDatePickerStrings , today , underlined =false , value , ...restOfProps } = props;\n const calendar = React.useRef(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n var _fieldContext_required;\n const required = (_fieldContext_required = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n const validateTextInput = React.useCallback((date = null)=>{\n let error;\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date !== null && date !== void 0 ? date : selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString(formattedDate);\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n onUserSelectDate === null || onUserSelectDate === void 0 ? void 0 : onUserSelectDate(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n onValidationResult === null || onValidationResult === void 0 ? void 0 : onValidationResult({\n error\n });\n }, [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate\n ]);\n const setOpen = React.useCallback((newState)=>{\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);\n setOpenState(newState);\n if (!open && !props.disabled) {\n focus();\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n focus,\n onOpenChange,\n props.disabled,\n setOpenState\n ]);\n const dismissDatePickerPopup = React.useCallback((newlySelectedDate)=>{\n if (open) {\n setOpen(false);\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n }, [\n allowTextInput,\n open,\n setOpen,\n setSelectedDate,\n validateTextInput\n ]);\n const showDatePickerPopup = React.useCallback(()=>{\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [\n open,\n preventNextFocusOpeningPicker,\n setOpen\n ]);\n /**\n * Callback for closing the calendar callout\n */ const calendarDismissed = React.useCallback((newlySelectedDate)=>{\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n }, [\n dismissDatePickerPopup,\n preventNextFocusOpeningPicker\n ]);\n const onInputChange = React.useCallback((ev, data)=>{\n const { value: newValue } = data;\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n setFormattedDate(newValue);\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n setFormattedDate\n ]);\n const onInputBlur = React.useCallback(()=>{\n validateTextInput();\n }, [\n validateTextInput\n ]);\n const onInputKeyDown = React.useCallback((ev)=>{\n switch(ev.key){\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n case ArrowDown:\n ev.preventDefault();\n if (ev.altKey && !open) {\n showDatePickerPopup();\n }\n break;\n default:\n break;\n }\n }, [\n calendarDismissed,\n dismissDatePickerPopup,\n open,\n props.allowTextInput,\n showDatePickerPopup,\n validateTextInput\n ]);\n const onInputFocus = React.useCallback(()=>{\n if (disableAutoFocus) {\n return;\n }\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [\n allowTextInput,\n disableAutoFocus,\n preventFocusOpeningPicker,\n showDatePickerPopup\n ]);\n const onInputClick = React.useCallback(()=>{\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup\n ]);\n const onIconClick = (ev)=>{\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const root = resolveShorthand(restOfProps, {\n required: true,\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: /*#__PURE__*/ React.createElement(CalendarMonthRegular, {\n onClick: onIconClick\n }),\n readOnly: !allowTextInput,\n role: 'combobox'\n }\n });\n const inputRoot = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: triggerWrapperRef\n }\n });\n inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);\n root.root = inputRoot;\n const inputShorthand = resolveShorthand(props.input, {\n required: true\n });\n inputShorthand.ref = useMergedRefs(inputShorthand.ref, ref, rootRef);\n root.input = inputShorthand;\n root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));\n root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));\n root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));\n root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));\n root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));\n const { modalAttributes } = useModalAttributes({\n trapFocus: true,\n alwaysFocusable: true,\n legacyTrapFocus: false\n });\n const popupSurface = open ? resolveShorthand(props.popupSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes\n }\n }) : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(()=>{\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [\n disableAutoFocus,\n open,\n props.disabled\n ]);\n const calendarShorthand = resolveShorthand(props.calendar, {\n required: true,\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate\n }\n });\n calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));\n calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));\n const state = {\n disabled: !!props.disabled,\n inlinePopup,\n components: {\n root: Input,\n calendar: Calendar,\n popupSurface: 'div'\n },\n calendar: calendarShorthand,\n root,\n popupSurface\n };\n state.root.value = formattedDate;\n return state;\n};\n"],"names":["useDatePicker_unstable","isDateOutOfBounds","date","minDate","maxDate","compareDatePart","useFocusLogic","inputRef","React","useRef","preventFocusOpeningPicker","focus","useCallback","_inputRef_current","_inputRef_current_focus","current","call","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","useControllableState","initialState","defaultState","defaultOpen","state","isMounted","useEffect","_props_onOpenChange","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","popupSurfaceId","useId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","altKey","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","root","resolveShorthand","defaultProps","appearance","undefined","contentAfter","createElement","CalendarMonthRegular","onClick","readOnly","role","inputRoot","useMergedRefs","inputShorthand","input","onChange","useEventCallback","mergeCallbacks","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","id","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","calendarShorthand","componentRef","onDismiss","components","Input","Calendar"],"mappings":";;;;+BA8FiBA;;aAAAA;;;6DA9FM;8BACkB;0BAChB;4BACY;uBACuB;0BACnB;4BACnB;gCACgI;4BAC1F;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAE;IAC/C,OAAO,CAAC,CAACD,WAAWE,IAAAA,sBAAe,EAACF,SAASD,QAAQ,KAAK,CAAC,CAACE,WAAWC,IAAAA,sBAAe,EAACD,SAASF,QAAQ;AAC5G;AACA,SAASI,gBAAgB;IACrB,MAAMC,WAAWC,OAAMC,MAAM,CAAC,IAAI;IAClC,MAAMC,4BAA4BF,OAAMC,MAAM,CAAC,KAAK;IACpD,MAAME,QAAQH,OAAMI,WAAW,CAAC,IAAI;QAChC,IAAIC,mBAAmBC;QACtBD,CAAAA,oBAAoBN,SAASQ,OAAO,AAAD,MAAO,IAAI,IAAIF,sBAAsB,KAAK,IAAI,KAAK,IAAI,AAACC,CAAAA,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C;SACH;QACDvB,UAAU,CAACxE;IACf;IACA,6DAA6D;IAC7D,+GAA+G;IAC/G,kBAAkB;IAClBZ,OAAMoB,SAAS,CAAC,IAAI;QAChB,IAAIR,QAAQ,CAACD,MAAMyE,QAAQ,IAAId,SAAS/D,OAAO,EAAE;YAC7C+D,SAAS/D,OAAO,CAACJ,KAAK;QAC1B,CAAC;IACL,GAAG;QACC0C;QACAjC;QACAD,MAAMyE,QAAQ;KACjB;IACD,MAAM4D,oBAAoBlC,IAAAA,gCAAgB,EAACnG,MAAM2D,QAAQ,EAAE;QACvDM,UAAU,IAAI;QACdmC,cAAc;YACVrE;YACAuG,cAAc3E;YACd1B;YACAE;YACAG;YACAG;YACAC;YACAG;YACA5D;YACAD;YACAkE;YACAC;YACAC;YACAC;YACAC;YACAE;YACAxC,OAAOC,gBAAgB0B;QAC3B;IACJ;IACA0F,kBAAkBE,SAAS,GAAGrB,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACkB,kBAAkBE,SAAS,EAAE1D;IAC3FwD,kBAAkBtH,YAAY,GAAGmG,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACkB,kBAAkBtH,YAAY,EAAE8D;IACjG,MAAMtE,QAAQ;QACVkE,UAAU,CAAC,CAACzE,MAAMyE,QAAQ;QAC1B7B;QACA4F,YAAY;YACRtC,MAAMuC,iBAAK;YACX9E,UAAU+E,kBAAQ;YAClBd,cAAc;QAClB;QACAjE,UAAU0E;QACVnC;QACA0B;IACJ;IACArH,MAAM2F,IAAI,CAAClF,KAAK,GAAGG;IACnB,OAAOZ;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-datepicker-compat",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -30,21 +30,21 @@
30
30
  "devDependencies": {
31
31
  "@fluentui/eslint-plugin": "*",
32
32
  "@fluentui/react-conformance": "*",
33
- "@fluentui/react-conformance-griffel": "9.0.0-beta.23",
33
+ "@fluentui/react-conformance-griffel": "9.0.0",
34
34
  "@fluentui/scripts-api-extractor": "*",
35
35
  "@fluentui/scripts-tasks": "*"
36
36
  },
37
37
  "dependencies": {
38
38
  "@fluentui/keyboard-keys": "^9.0.3",
39
- "@fluentui/react-field": "^9.1.10",
39
+ "@fluentui/react-field": "^9.1.11",
40
40
  "@fluentui/react-icons": "^2.0.203",
41
- "@fluentui/react-input": "^9.4.20",
42
- "@fluentui/react-jsx-runtime": "9.0.0-alpha.10",
43
- "@fluentui/react-popover": "^9.7.4",
44
- "@fluentui/react-portal": "^9.3.0",
45
- "@fluentui/react-positioning": "^9.7.3",
41
+ "@fluentui/react-input": "^9.4.21",
42
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.11",
43
+ "@fluentui/react-popover": "^9.7.6",
44
+ "@fluentui/react-portal": "^9.3.1",
45
+ "@fluentui/react-positioning": "^9.8.0",
46
46
  "@fluentui/react-shared-contexts": "^9.6.0",
47
- "@fluentui/react-tabster": "^9.9.2",
47
+ "@fluentui/react-tabster": "^9.10.0",
48
48
  "@fluentui/react-theme": "^9.1.9",
49
49
  "@fluentui/react-utilities": "^9.10.1",
50
50
  "@griffel/react": "^1.5.7",