@react-types/datepicker 3.3.1 → 3.4.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/package.json +5 -4
- package/src/index.d.ts +19 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@internationalized/date": "^3.
|
|
13
|
-
"@react-types/
|
|
12
|
+
"@internationalized/date": "^3.3.0",
|
|
13
|
+
"@react-types/calendar": "^3.3.0",
|
|
14
|
+
"@react-types/overlays": "^3.8.0",
|
|
14
15
|
"@react-types/shared": "^3.18.1"
|
|
15
16
|
},
|
|
16
17
|
"publishConfig": {
|
|
@@ -19,5 +20,5 @@
|
|
|
19
20
|
"peerDependencies": {
|
|
20
21
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
21
22
|
},
|
|
22
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "504e40e0a50c1b20ed0fb3ba9561a263b6d5565e"
|
|
23
24
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
} from '@react-types/shared';
|
|
26
26
|
import {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from '@internationalized/date';
|
|
27
27
|
import {OverlayTriggerProps} from '@react-types/overlays';
|
|
28
|
+
import {PageBehavior} from '@react-types/calendar';
|
|
28
29
|
|
|
29
30
|
export type DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;
|
|
30
31
|
type MappedDateValue<T> =
|
|
@@ -51,14 +52,25 @@ interface DateFieldBase<T extends DateValue> extends InputBase, Validation, Focu
|
|
|
51
52
|
* Whether to hide the time zone abbreviation.
|
|
52
53
|
* @default false
|
|
53
54
|
*/
|
|
54
|
-
hideTimeZone?: boolean
|
|
55
|
+
hideTimeZone?: boolean,
|
|
56
|
+
/**
|
|
57
|
+
* Whether to always show leading zeros in the month, day, and hour fields.
|
|
58
|
+
* By default, this is determined by the user's locale.
|
|
59
|
+
*/
|
|
60
|
+
shouldForceLeadingZeros?: boolean
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
interface AriaDateFieldBaseProps<T extends DateValue> extends DateFieldBase<T>, AriaLabelingProps, DOMProps {}
|
|
58
64
|
export interface DateFieldProps<T extends DateValue> extends DateFieldBase<T>, ValueBase<T | null, MappedDateValue<T>> {}
|
|
59
65
|
export interface AriaDateFieldProps<T extends DateValue> extends DateFieldProps<T>, AriaDateFieldBaseProps<T> {}
|
|
60
66
|
|
|
61
|
-
interface DatePickerBase<T extends DateValue> extends DateFieldBase<T>, OverlayTriggerProps {
|
|
67
|
+
interface DatePickerBase<T extends DateValue> extends DateFieldBase<T>, OverlayTriggerProps {
|
|
68
|
+
/**
|
|
69
|
+
* Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.
|
|
70
|
+
* @default visible
|
|
71
|
+
*/
|
|
72
|
+
pageBehavior?: PageBehavior
|
|
73
|
+
}
|
|
62
74
|
export interface AriaDatePickerBaseProps<T extends DateValue> extends DatePickerBase<T>, AriaLabelingProps, DOMProps {}
|
|
63
75
|
|
|
64
76
|
export interface DatePickerProps<T extends DateValue> extends DatePickerBase<T>, ValueBase<T | null, MappedDateValue<T>> {}
|
|
@@ -122,6 +134,11 @@ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validat
|
|
|
122
134
|
granularity?: 'hour' | 'minute' | 'second',
|
|
123
135
|
/** Whether to hide the time zone abbreviation. */
|
|
124
136
|
hideTimeZone?: boolean,
|
|
137
|
+
/**
|
|
138
|
+
* Whether to always show leading zeros in the hour field.
|
|
139
|
+
* By default, this is determined by the user's locale.
|
|
140
|
+
*/
|
|
141
|
+
shouldForceLeadingZeros?: boolean,
|
|
125
142
|
/**
|
|
126
143
|
* A placeholder time that influences the format of the placeholder shown when no value is selected.
|
|
127
144
|
* Defaults to 12:00 AM or 00:00 depending on the hour cycle.
|