@react-aria/datepicker 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +1626 -0
- package/dist/main.js +391 -442
- package/dist/main.js.map +1 -1
- package/dist/module.js +392 -443
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +23 -18
- package/src/useDatePicker.ts +2 -0
- package/src/useDateSegment.ts +2 -2
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"types": "./dist/types.d.ts",
|
|
10
|
+
"import": "./dist/import.mjs",
|
|
11
|
+
"require": "./dist/main.js"
|
|
12
|
+
},
|
|
8
13
|
"types": "dist/types.d.ts",
|
|
9
14
|
"source": "src/index.ts",
|
|
10
15
|
"files": [
|
|
@@ -17,22 +22,22 @@
|
|
|
17
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
18
23
|
},
|
|
19
24
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@internationalized/
|
|
22
|
-
"@internationalized/
|
|
23
|
-
"@
|
|
24
|
-
"@react-aria/
|
|
25
|
-
"@react-aria/
|
|
26
|
-
"@react-aria/
|
|
27
|
-
"@react-aria/
|
|
28
|
-
"@react-aria/
|
|
29
|
-
"@react-
|
|
30
|
-
"@react-
|
|
31
|
-
"@react-types/
|
|
32
|
-
"@react-types/
|
|
33
|
-
"@react-types/
|
|
34
|
-
"@react-types/
|
|
35
|
-
"@
|
|
25
|
+
"@internationalized/date": "^3.1.0",
|
|
26
|
+
"@internationalized/number": "^3.2.0",
|
|
27
|
+
"@internationalized/string": "^3.1.0",
|
|
28
|
+
"@react-aria/focus": "^3.11.0",
|
|
29
|
+
"@react-aria/i18n": "^3.7.0",
|
|
30
|
+
"@react-aria/interactions": "^3.14.0",
|
|
31
|
+
"@react-aria/label": "^3.5.0",
|
|
32
|
+
"@react-aria/spinbutton": "^3.3.0",
|
|
33
|
+
"@react-aria/utils": "^3.15.0",
|
|
34
|
+
"@react-stately/datepicker": "^3.3.0",
|
|
35
|
+
"@react-types/button": "^3.7.1",
|
|
36
|
+
"@react-types/calendar": "^3.1.0",
|
|
37
|
+
"@react-types/datepicker": "^3.2.0",
|
|
38
|
+
"@react-types/dialog": "^3.5.0",
|
|
39
|
+
"@react-types/shared": "^3.17.0",
|
|
40
|
+
"@swc/helpers": "^0.4.14"
|
|
36
41
|
},
|
|
37
42
|
"peerDependencies": {
|
|
38
43
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
@@ -41,5 +46,5 @@
|
|
|
41
46
|
"publishConfig": {
|
|
42
47
|
"access": "public"
|
|
43
48
|
},
|
|
44
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "a0efee84aa178cb1a202951dfd6d8de02b292307"
|
|
45
50
|
}
|
package/src/useDatePicker.ts
CHANGED
|
@@ -53,6 +53,7 @@ export interface DatePickerAria {
|
|
|
53
53
|
export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>, state: DatePickerState, ref: RefObject<Element>): DatePickerAria {
|
|
54
54
|
let buttonId = useId();
|
|
55
55
|
let dialogId = useId();
|
|
56
|
+
let fieldId = useId();
|
|
56
57
|
let stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
57
58
|
|
|
58
59
|
let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({
|
|
@@ -113,6 +114,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
|
|
|
113
114
|
},
|
|
114
115
|
fieldProps: {
|
|
115
116
|
...fieldProps,
|
|
117
|
+
id: fieldId,
|
|
116
118
|
[roleSymbol]: 'presentation',
|
|
117
119
|
'aria-describedby': ariaDescribedBy,
|
|
118
120
|
value: state.value,
|
package/src/useDateSegment.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import {CalendarDate, toCalendar} from '@internationalized/date';
|
|
14
14
|
import {DateFieldState, DateSegment} from '@react-stately/datepicker';
|
|
15
15
|
import {DOMAttributes} from '@react-types/shared';
|
|
16
|
-
import {getScrollParent, isIOS, isMac, mergeProps,
|
|
16
|
+
import {getScrollParent, isIOS, isMac, mergeProps, scrollIntoViewport, useEvent, useId, useLabels, useLayoutEffect} from '@react-aria/utils';
|
|
17
17
|
import {hookData} from './useDateField';
|
|
18
18
|
import {NumberParser} from '@internationalized/number';
|
|
19
19
|
import React, {RefObject, useMemo, useRef} from 'react';
|
|
@@ -258,7 +258,7 @@ export function useDateSegment(segment: DateSegment, state: DateFieldState, ref:
|
|
|
258
258
|
|
|
259
259
|
let onFocus = () => {
|
|
260
260
|
enteredKeys.current = '';
|
|
261
|
-
|
|
261
|
+
scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});
|
|
262
262
|
|
|
263
263
|
// Collapse selection to start or Chrome won't fire input events.
|
|
264
264
|
let selection = window.getSelection();
|