@react-types/datepicker 3.0.0-nightly.1383 → 3.0.0-nightly.1386
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 +4 -4
- package/src/index.d.ts +35 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/datepicker",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1386+7e8a7f696",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@internationalized/date": "3.0.0-nightly.
|
|
13
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
12
|
+
"@internationalized/date": "3.0.0-nightly.3077+7e8a7f696",
|
|
13
|
+
"@react-types/shared": "3.0.0-nightly.1386+7e8a7f696"
|
|
14
14
|
},
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "7e8a7f69685139b3574453b424a5ad4c8fa4e808"
|
|
22
22
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -34,11 +34,20 @@ type MappedDateValue<T> =
|
|
|
34
34
|
|
|
35
35
|
export type Granularity = 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
36
36
|
interface DatePickerBase<T extends DateValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps {
|
|
37
|
+
/** The minimum allowed date that a user may select. */
|
|
37
38
|
minValue?: DateValue,
|
|
39
|
+
/** The maximum allowed date that a user may select. */
|
|
38
40
|
maxValue?: DateValue,
|
|
41
|
+
/** A placeholder date to display when no value is selected. Defaults to today's date at midnight. */
|
|
39
42
|
placeholderValue?: T,
|
|
43
|
+
/** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */
|
|
40
44
|
hourCycle?: 12 | 24,
|
|
45
|
+
/** Determines the smallest unit that is displayed in the date picker. By default, this is `"day"` for dates, and `"minute"` for times. */
|
|
41
46
|
granularity?: Granularity,
|
|
47
|
+
/**
|
|
48
|
+
* Whether to hide the time zone abbreviation.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
42
51
|
hideTimeZone?: boolean
|
|
43
52
|
}
|
|
44
53
|
|
|
@@ -52,13 +61,26 @@ export interface DateRangePickerProps<T extends DateValue> extends DatePickerBas
|
|
|
52
61
|
export interface AriaDateRangePickerProps<T extends DateValue> extends AriaDatePickerBaseProps<T>, DateRangePickerProps<T> {}
|
|
53
62
|
|
|
54
63
|
interface SpectrumDatePickerBase<T extends DateValue> extends AriaDatePickerBaseProps<T>, SpectrumLabelableProps, StyleProps {
|
|
64
|
+
/**
|
|
65
|
+
* Whether the date picker should be displayed with a quiet style.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
55
68
|
isQuiet?: boolean,
|
|
69
|
+
/**
|
|
70
|
+
* Whether to show the localized date format as help text below the field.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
56
73
|
showFormatHelpText?: boolean,
|
|
74
|
+
/**
|
|
75
|
+
* The maximum number of months to display at once in the calendar popover, if screen space permits.
|
|
76
|
+
* @default 1
|
|
77
|
+
*/
|
|
57
78
|
maxVisibleMonths?: number
|
|
58
79
|
}
|
|
59
80
|
|
|
60
81
|
export interface SpectrumDatePickerProps<T extends DateValue> extends DatePickerProps<T>, SpectrumDatePickerBase<T> {}
|
|
61
82
|
export interface SpectrumDateRangePickerProps<T extends DateValue> extends DateRangePickerProps<T>, SpectrumDatePickerBase<T> {}
|
|
83
|
+
export interface SpectrumDateFieldProps<T extends DateValue> extends Omit<SpectrumDatePickerProps<T>, 'maxVisibleMonths'> {}
|
|
62
84
|
|
|
63
85
|
export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
|
64
86
|
type MappedTimeValue<T> =
|
|
@@ -68,14 +90,27 @@ type MappedTimeValue<T> =
|
|
|
68
90
|
never;
|
|
69
91
|
|
|
70
92
|
export interface TimePickerProps<T extends TimeValue> extends InputBase, Validation, FocusableProps, LabelableProps, ValueBase<T, MappedTimeValue<T>> {
|
|
93
|
+
/** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */
|
|
71
94
|
hourCycle?: 12 | 24,
|
|
95
|
+
/**
|
|
96
|
+
* Determines the smallest unit that is displayed in the time picker.
|
|
97
|
+
* @default 'minute'
|
|
98
|
+
*/
|
|
72
99
|
granularity?: 'hour' | 'minute' | 'second' | 'millisecond',
|
|
100
|
+
/** Whether to hide the time zone abbreviation. */
|
|
73
101
|
hideTimeZone?: boolean,
|
|
102
|
+
/** A placeholder time to display when no value is selected. Defaults to 12:00 or 00:00 depending on the hour cycle. */
|
|
74
103
|
placeholderValue?: T,
|
|
104
|
+
/** The minimum allowed time that a user may select. */
|
|
75
105
|
minValue?: TimeValue,
|
|
106
|
+
/** The maximum allowed time that a user may select. */
|
|
76
107
|
maxValue?: TimeValue
|
|
77
108
|
}
|
|
78
109
|
|
|
79
110
|
export interface SpectrumTimePickerProps<T extends TimeValue> extends TimePickerProps<T>, SpectrumLabelableProps, DOMProps, StyleProps {
|
|
111
|
+
/**
|
|
112
|
+
* Whether the time field should be displayed with a quiet style.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
80
115
|
isQuiet?: boolean
|
|
81
116
|
}
|