@atlaskit/datetime-picker 12.3.0 → 12.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/date-picker.js +3 -2
- package/dist/cjs/components/date-time-picker.js +1 -1
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/date-picker.js +3 -2
- package/dist/es2019/components/date-time-picker.js +1 -1
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/date-picker.js +3 -2
- package/dist/esm/components/date-time-picker.js +1 -1
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/date-time-picker.d.ts +2 -2
- package/dist/types/components/time-picker.d.ts +2 -2
- package/package.json +13 -18
- package/report.api.md +66 -193
- package/dist/types-ts4.0/components/date-picker.d.ts +0 -288
- package/dist/types-ts4.0/components/date-time-picker.d.ts +0 -218
- package/dist/types-ts4.0/components/time-picker.d.ts +0 -228
- package/dist/types-ts4.0/components/utils.d.ts +0 -1
- package/dist/types-ts4.0/index.d.ts +0 -7
- package/dist/types-ts4.0/internal/fixed-layer.d.ts +0 -33
- package/dist/types-ts4.0/internal/index.d.ts +0 -10
- package/dist/types-ts4.0/internal/parse-time.d.ts +0 -14
- package/dist/types-ts4.0/types.d.ts +0 -3
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
import { SelectProps } from '@atlaskit/select';
|
|
6
|
-
import { Appearance, Spacing } from '../types';
|
|
7
|
-
import { DatePickerBaseProps as DatePickerProps } from './date-picker';
|
|
8
|
-
import { TimePickerBaseProps as TimePickerProps } from './time-picker';
|
|
9
|
-
export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
10
|
-
/**
|
|
11
|
-
* Set the appearance of the picker.
|
|
12
|
-
*
|
|
13
|
-
* `subtle` will remove the borders and background.
|
|
14
|
-
*/
|
|
15
|
-
appearance?: Appearance;
|
|
16
|
-
/**
|
|
17
|
-
* Set the picker to autofocus on mount.
|
|
18
|
-
*/
|
|
19
|
-
autoFocus?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The default for `value`.
|
|
22
|
-
*/
|
|
23
|
-
defaultValue?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The id of the field. Currently, react-select transforms this to have a `react-select-` prefix, and an `--input` suffix when applied to the input. For example, the id `my-input` would be transformed to `react-select-my-input--input`.
|
|
26
|
-
* Keep this in mind when needing to refer to the ID. This will be fixed in an upcoming release.
|
|
27
|
-
*/
|
|
28
|
-
id?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Props to apply to the container. *
|
|
31
|
-
*/
|
|
32
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement>;
|
|
33
|
-
/**
|
|
34
|
-
* Set if the field is disabled.
|
|
35
|
-
*/
|
|
36
|
-
isDisabled?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* The name of the field.
|
|
39
|
-
*/
|
|
40
|
-
name?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Called when the field is blurred.
|
|
43
|
-
*/
|
|
44
|
-
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
45
|
-
/**
|
|
46
|
-
* Called when the value changes and the date / time is a complete value, or empty. The only value is an ISO string or empty string.
|
|
47
|
-
*/
|
|
48
|
-
onChange?: (value: string) => void;
|
|
49
|
-
/**
|
|
50
|
-
* Called when the field is focused.
|
|
51
|
-
*/
|
|
52
|
-
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
53
|
-
/**
|
|
54
|
-
* The ISO time that should be used as the input value.
|
|
55
|
-
*/
|
|
56
|
-
value?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Set if users can edit the input, allowing them to add custom times.
|
|
59
|
-
*/
|
|
60
|
-
timeIsEditable?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Set if the picker has an invalid value.
|
|
63
|
-
*/
|
|
64
|
-
isInvalid?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Format the date with a string that is accepted by [date-fns's format function](https://date-fns.org/v1.29.0/docs/format).
|
|
67
|
-
*/
|
|
68
|
-
dateFormat?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Props applied to the `DatePicker`.
|
|
71
|
-
*/
|
|
72
|
-
datePickerProps?: DatePickerProps;
|
|
73
|
-
/**
|
|
74
|
-
* Props applied to the `TimePicker`.
|
|
75
|
-
*/
|
|
76
|
-
timePickerProps?: TimePickerProps;
|
|
77
|
-
/**
|
|
78
|
-
* Function used to parse datetime values into their date, time and timezone sub-values. *
|
|
79
|
-
*/
|
|
80
|
-
parseValue?: (dateTimeValue: string, date: string, time: string, timezone: string) => {
|
|
81
|
-
dateValue: string;
|
|
82
|
-
timeValue: string;
|
|
83
|
-
zoneValue: string;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* [Select props](/components/select) to pass onto the `DatePicker` component's `Select`. This can be used to set options such as placeholder text.
|
|
87
|
-
*/
|
|
88
|
-
datePickerSelectProps?: SelectProps<any>;
|
|
89
|
-
/**
|
|
90
|
-
* [Select props](/components/select) to pass onto the `TimePicker` component's `Select`. This can be used to set options such as placeholder text.
|
|
91
|
-
*/
|
|
92
|
-
timePickerSelectProps?: SelectProps<any>;
|
|
93
|
-
/**
|
|
94
|
-
* The times shown by the `TimePicker`.
|
|
95
|
-
*/
|
|
96
|
-
times?: Array<string>;
|
|
97
|
-
/**
|
|
98
|
-
* The format that times are displayed in. Values should be those accepted by [date-fns's format function](https://date-fns.org/v1.29.0/docs/format).
|
|
99
|
-
*/
|
|
100
|
-
timeFormat?: string;
|
|
101
|
-
/**
|
|
102
|
-
* The spacing for the select control.
|
|
103
|
-
*
|
|
104
|
-
* Compact is `gridSize() * 4`, default is `gridSize() * 5`.
|
|
105
|
-
*/
|
|
106
|
-
spacing?: Spacing;
|
|
107
|
-
/**
|
|
108
|
-
* Locale used for formatting dates and times. See [DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat).
|
|
109
|
-
*/
|
|
110
|
-
locale?: string;
|
|
111
|
-
/**
|
|
112
|
-
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
113
|
-
* - `{testId}--datepicker--container` wrapping element of date-picker
|
|
114
|
-
* - `{testId}--timepicker--container` wrapping element of time-picker
|
|
115
|
-
*/
|
|
116
|
-
testId?: string;
|
|
117
|
-
}
|
|
118
|
-
declare type DateTimePickerProps = typeof dateTimePickerDefaultProps & DateTimePickerBaseProps;
|
|
119
|
-
interface State {
|
|
120
|
-
active: 0 | 1 | 2;
|
|
121
|
-
dateValue: string;
|
|
122
|
-
isFocused: boolean;
|
|
123
|
-
timeValue: string;
|
|
124
|
-
value: string;
|
|
125
|
-
zoneValue: string;
|
|
126
|
-
}
|
|
127
|
-
declare const dateTimePickerDefaultProps: {
|
|
128
|
-
appearance: string;
|
|
129
|
-
autoFocus: boolean;
|
|
130
|
-
isDisabled: boolean;
|
|
131
|
-
name: string;
|
|
132
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
133
|
-
onChange: (value: string) => void;
|
|
134
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
135
|
-
innerProps: {};
|
|
136
|
-
id: string;
|
|
137
|
-
defaultValue: string;
|
|
138
|
-
timeIsEditable: boolean;
|
|
139
|
-
isInvalid: boolean;
|
|
140
|
-
datePickerProps: {};
|
|
141
|
-
timePickerProps: {};
|
|
142
|
-
datePickerSelectProps: {};
|
|
143
|
-
timePickerSelectProps: {};
|
|
144
|
-
times: string[];
|
|
145
|
-
spacing: string;
|
|
146
|
-
locale: string;
|
|
147
|
-
};
|
|
148
|
-
declare class DateTimePicker extends React.Component<DateTimePickerProps, State> {
|
|
149
|
-
static defaultProps: {
|
|
150
|
-
appearance: string;
|
|
151
|
-
autoFocus: boolean;
|
|
152
|
-
isDisabled: boolean;
|
|
153
|
-
name: string;
|
|
154
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
155
|
-
onChange: (value: string) => void;
|
|
156
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
157
|
-
innerProps: {};
|
|
158
|
-
id: string;
|
|
159
|
-
defaultValue: string;
|
|
160
|
-
timeIsEditable: boolean;
|
|
161
|
-
isInvalid: boolean;
|
|
162
|
-
datePickerProps: {};
|
|
163
|
-
timePickerProps: {};
|
|
164
|
-
datePickerSelectProps: {};
|
|
165
|
-
timePickerSelectProps: {};
|
|
166
|
-
times: string[];
|
|
167
|
-
spacing: string;
|
|
168
|
-
locale: string;
|
|
169
|
-
};
|
|
170
|
-
state: State;
|
|
171
|
-
getSafeState: () => {
|
|
172
|
-
dateValue: string;
|
|
173
|
-
timeValue: string;
|
|
174
|
-
zoneValue: string;
|
|
175
|
-
value: string;
|
|
176
|
-
active: 0 | 1 | 2;
|
|
177
|
-
isFocused: boolean;
|
|
178
|
-
};
|
|
179
|
-
parseValue(value: string, dateValue: string, timeValue: string, zoneValue: string): {
|
|
180
|
-
dateValue: string;
|
|
181
|
-
timeValue: string;
|
|
182
|
-
zoneValue: string;
|
|
183
|
-
};
|
|
184
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
185
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
186
|
-
onDateChange: (dateValue: string) => void;
|
|
187
|
-
onTimeChange: (timeValue: string) => void;
|
|
188
|
-
onClear: () => void;
|
|
189
|
-
onValueChange({ dateValue, timeValue, zoneValue, }: {
|
|
190
|
-
dateValue: string;
|
|
191
|
-
timeValue: string;
|
|
192
|
-
zoneValue: string;
|
|
193
|
-
}): void;
|
|
194
|
-
render(): jsx.JSX.Element;
|
|
195
|
-
}
|
|
196
|
-
export { DateTimePicker as DateTimePickerWithoutAnalytics };
|
|
197
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "isInvalid" | "locale" | "times" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
|
|
198
|
-
appearance: string;
|
|
199
|
-
autoFocus: boolean;
|
|
200
|
-
isDisabled: boolean;
|
|
201
|
-
name: string;
|
|
202
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
203
|
-
onChange: (value: string) => void;
|
|
204
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
205
|
-
innerProps: {};
|
|
206
|
-
id: string;
|
|
207
|
-
defaultValue: string;
|
|
208
|
-
timeIsEditable: boolean;
|
|
209
|
-
isInvalid: boolean;
|
|
210
|
-
datePickerProps: {};
|
|
211
|
-
timePickerProps: {};
|
|
212
|
-
datePickerSelectProps: {};
|
|
213
|
-
timePickerSelectProps: {};
|
|
214
|
-
times: string[];
|
|
215
|
-
spacing: string;
|
|
216
|
-
locale: string;
|
|
217
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "autoFocus" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "value" | "isInvalid" | "dateFormat" | "locale" | "key" | "analyticsContext" | "times" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
|
|
218
|
-
export default _default;
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import { LocalizationProvider } from '@atlaskit/locale';
|
|
4
|
-
import { ActionMeta, OptionType, SelectProps } from '@atlaskit/select';
|
|
5
|
-
import { Appearance, Spacing } from '../types';
|
|
6
|
-
interface Option {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}
|
|
10
|
-
export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
11
|
-
/**
|
|
12
|
-
* Set the appearance of the picker.
|
|
13
|
-
* `subtle` will remove the borders, background, and icon.
|
|
14
|
-
*
|
|
15
|
-
* __NOTE:__ Appearance values will be ignored if styles are parsed through `selectProps`.
|
|
16
|
-
*/
|
|
17
|
-
appearance?: Appearance;
|
|
18
|
-
/**
|
|
19
|
-
* Set the picker to autofocus on mount.
|
|
20
|
-
*/
|
|
21
|
-
autoFocus?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* The default for `isOpen`.
|
|
24
|
-
*/
|
|
25
|
-
defaultIsOpen?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The default for `value`.
|
|
28
|
-
*/
|
|
29
|
-
defaultValue?: string;
|
|
30
|
-
/**
|
|
31
|
-
* A function for formatting the displayed time value in the input. By default parses with an internal time parser, and formats using the [date-fns format function]((https://date-fns.org/v1.29.0/docs/format))
|
|
32
|
-
*/
|
|
33
|
-
formatDisplayLabel?: (time: string, timeFormat: string) => string;
|
|
34
|
-
/**
|
|
35
|
-
* The id of the field. Currently, react-select transforms this to have a `react-select-` prefix, and an `--input` suffix when applied to the input. For example, the id `my-input` would be transformed to `react-select-my-input--input`. Keep this in mind when needing to refer to the ID. This will be fixed in an upcoming release.
|
|
36
|
-
*/
|
|
37
|
-
id?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Props to apply to the container. *
|
|
40
|
-
*/
|
|
41
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement>;
|
|
42
|
-
/**
|
|
43
|
-
* Set if the field is disabled.
|
|
44
|
-
*/
|
|
45
|
-
isDisabled?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Set if the dropdown is open. Will be `false` if not provided.
|
|
48
|
-
*/
|
|
49
|
-
isOpen?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* The name of the field.
|
|
52
|
-
*/
|
|
53
|
-
name?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Called when the field is blurred.
|
|
56
|
-
*/
|
|
57
|
-
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
58
|
-
/**
|
|
59
|
-
* Called when the value changes. The only argument is an ISO time or empty string.
|
|
60
|
-
*/
|
|
61
|
-
onChange?: (value: string) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Called when the field is focused.
|
|
64
|
-
*/
|
|
65
|
-
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
66
|
-
parseInputValue?: (time: string, timeFormat: string) => string | Date;
|
|
67
|
-
/**
|
|
68
|
-
* Props to apply to the select.
|
|
69
|
-
*/
|
|
70
|
-
selectProps?: SelectProps<any>;
|
|
71
|
-
/**
|
|
72
|
-
* The spacing for the select control.
|
|
73
|
-
*
|
|
74
|
-
* Compact is `gridSize() * 4`, default is `gridSize * 5`.
|
|
75
|
-
*/
|
|
76
|
-
spacing?: Spacing;
|
|
77
|
-
/**
|
|
78
|
-
* The times shown in the dropdown.
|
|
79
|
-
*/
|
|
80
|
-
times?: string[];
|
|
81
|
-
/**
|
|
82
|
-
* Set if users can edit the input, allowing them to add custom times.
|
|
83
|
-
*/
|
|
84
|
-
timeIsEditable?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* The ISO time that should be used as the input value.
|
|
87
|
-
*/
|
|
88
|
-
value?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Set if the picker has an invalid value.
|
|
91
|
-
*/
|
|
92
|
-
isInvalid?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Hides icon for dropdown indicator.
|
|
95
|
-
*/
|
|
96
|
-
hideIcon?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Time format that is accepted by [date-fns's format function](https://date-fns.org/v1.29.0/docs/format).
|
|
99
|
-
*/
|
|
100
|
-
timeFormat?: string;
|
|
101
|
-
/**
|
|
102
|
-
* Placeholder text displayed in input.
|
|
103
|
-
*/
|
|
104
|
-
placeholder?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Locale used to format the time. See [DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat).
|
|
107
|
-
*/
|
|
108
|
-
locale?: string;
|
|
109
|
-
/**
|
|
110
|
-
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests:
|
|
111
|
-
* - `{testId}--container` wrapping element of time-picker
|
|
112
|
-
*/
|
|
113
|
-
testId?: string;
|
|
114
|
-
}
|
|
115
|
-
declare type TimePickerProps = typeof timePickerDefaultProps & TimePickerBaseProps;
|
|
116
|
-
interface State {
|
|
117
|
-
isOpen: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* When being cleared from the icon the TimePicker is blurred.
|
|
120
|
-
* This variable defines whether the default onMenuOpen or onMenuClose
|
|
121
|
-
* events should behave as normal
|
|
122
|
-
*/
|
|
123
|
-
clearingFromIcon: boolean;
|
|
124
|
-
value: string;
|
|
125
|
-
isFocused: boolean;
|
|
126
|
-
l10n: LocalizationProvider;
|
|
127
|
-
}
|
|
128
|
-
declare const timePickerDefaultProps: {
|
|
129
|
-
appearance: Appearance;
|
|
130
|
-
autoFocus: boolean;
|
|
131
|
-
defaultIsOpen: boolean;
|
|
132
|
-
defaultValue: string;
|
|
133
|
-
hideIcon: boolean;
|
|
134
|
-
id: string;
|
|
135
|
-
innerProps: {};
|
|
136
|
-
isDisabled: boolean;
|
|
137
|
-
isInvalid: boolean;
|
|
138
|
-
name: string;
|
|
139
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
140
|
-
onChange: (value: string) => void;
|
|
141
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
142
|
-
parseInputValue: (time: string, timeFormat: string) => string | Date;
|
|
143
|
-
selectProps: {};
|
|
144
|
-
spacing: Spacing;
|
|
145
|
-
times: string[];
|
|
146
|
-
timeIsEditable: boolean;
|
|
147
|
-
locale: string;
|
|
148
|
-
};
|
|
149
|
-
declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
150
|
-
containerRef: HTMLElement | null;
|
|
151
|
-
static defaultProps: {
|
|
152
|
-
appearance: Appearance;
|
|
153
|
-
autoFocus: boolean;
|
|
154
|
-
defaultIsOpen: boolean;
|
|
155
|
-
defaultValue: string;
|
|
156
|
-
hideIcon: boolean;
|
|
157
|
-
id: string;
|
|
158
|
-
innerProps: {};
|
|
159
|
-
isDisabled: boolean;
|
|
160
|
-
isInvalid: boolean;
|
|
161
|
-
name: string;
|
|
162
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
163
|
-
onChange: (value: string) => void;
|
|
164
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
165
|
-
parseInputValue: (time: string, timeFormat: string) => string | Date;
|
|
166
|
-
selectProps: {};
|
|
167
|
-
spacing: Spacing;
|
|
168
|
-
times: string[];
|
|
169
|
-
timeIsEditable: boolean;
|
|
170
|
-
locale: string;
|
|
171
|
-
};
|
|
172
|
-
state: {
|
|
173
|
-
isOpen: boolean;
|
|
174
|
-
clearingFromIcon: boolean;
|
|
175
|
-
value: string;
|
|
176
|
-
isFocused: boolean;
|
|
177
|
-
l10n: LocalizationProvider;
|
|
178
|
-
};
|
|
179
|
-
UNSAFE_componentWillReceiveProps(nextProps: TimePickerProps): void;
|
|
180
|
-
getSafeState: () => State;
|
|
181
|
-
getOptions(): Array<Option>;
|
|
182
|
-
onChange: (v: {
|
|
183
|
-
value: string;
|
|
184
|
-
} | null, action?: ActionMeta<OptionType> | undefined) => void;
|
|
185
|
-
/**
|
|
186
|
-
* Only allow custom times if timeIsEditable prop is true
|
|
187
|
-
*/
|
|
188
|
-
onCreateOption: (inputValue: any) => void;
|
|
189
|
-
onMenuOpen: () => void;
|
|
190
|
-
onMenuClose: () => void;
|
|
191
|
-
setContainerRef: (ref: HTMLElement | null) => void;
|
|
192
|
-
onBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
193
|
-
onFocus: (event: React.FocusEvent<HTMLElement>) => void;
|
|
194
|
-
onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
195
|
-
/**
|
|
196
|
-
* There are multiple props that can change how the time is formatted.
|
|
197
|
-
* The priority of props used is:
|
|
198
|
-
* 1. formatDisplayLabel
|
|
199
|
-
* 2. timeFormat
|
|
200
|
-
* 3. locale
|
|
201
|
-
*/
|
|
202
|
-
formatTime: (time: string) => string;
|
|
203
|
-
getPlaceholder: () => string;
|
|
204
|
-
render(): JSX.Element;
|
|
205
|
-
}
|
|
206
|
-
export { TimePicker as TimePickerWithoutAnalytics };
|
|
207
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "isOpen" | "formatDisplayLabel" | "value" | "placeholder" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "selectProps" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "times" | "timeIsEditable">> & Partial<Pick<{
|
|
208
|
-
appearance: Appearance;
|
|
209
|
-
autoFocus: boolean;
|
|
210
|
-
defaultIsOpen: boolean;
|
|
211
|
-
defaultValue: string;
|
|
212
|
-
hideIcon: boolean;
|
|
213
|
-
id: string;
|
|
214
|
-
innerProps: {};
|
|
215
|
-
isDisabled: boolean;
|
|
216
|
-
isInvalid: boolean;
|
|
217
|
-
name: string;
|
|
218
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
219
|
-
onChange: (value: string) => void;
|
|
220
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
221
|
-
parseInputValue: (time: string, timeFormat: string) => string | Date;
|
|
222
|
-
selectProps: {};
|
|
223
|
-
spacing: Spacing;
|
|
224
|
-
times: string[];
|
|
225
|
-
timeIsEditable: boolean;
|
|
226
|
-
locale: string;
|
|
227
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "isOpen" | "name" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "formatDisplayLabel" | "selectProps" | "spacing" | "value" | "isInvalid" | "hideIcon" | "placeholder" | "locale" | "key" | "analyticsContext" | "times" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
228
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function convertTokens(format: string): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as DatePicker } from './components/date-picker';
|
|
2
|
-
export type { DatePickerBaseProps as DatePickerProps } from './components/date-picker';
|
|
3
|
-
export { default as TimePicker } from './components/time-picker';
|
|
4
|
-
export type { TimePickerBaseProps as TimePickerProps } from './components/time-picker';
|
|
5
|
-
export { default as DateTimePicker } from './components/date-time-picker';
|
|
6
|
-
export type { DateTimePickerBaseProps as DateTimePickerProps } from './components/date-time-picker';
|
|
7
|
-
export type { Appearance, Spacing } from './types';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface FixedLayerProps {
|
|
3
|
-
/**
|
|
4
|
-
* A ref to the container that the content should be layered around for height calculation
|
|
5
|
-
* purposes. This must be an ancestor element as component does not attach the layered content around
|
|
6
|
-
* the ref itself.
|
|
7
|
-
*/
|
|
8
|
-
containerRef: HTMLElement | null;
|
|
9
|
-
/**
|
|
10
|
-
* The content to render in the layer.
|
|
11
|
-
*/
|
|
12
|
-
content: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* input value from the menu.
|
|
15
|
-
*/
|
|
16
|
-
inputValue: string;
|
|
17
|
-
/**
|
|
18
|
-
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
19
|
-
* - `{testId}--popper-container` wrapping element of time-picker
|
|
20
|
-
*/
|
|
21
|
-
testId?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* This component renders layered content with fixed positioning.
|
|
25
|
-
* Scroll is locked outside the layer to prevent the layered content from detaching from the
|
|
26
|
-
* container ref.
|
|
27
|
-
*/
|
|
28
|
-
export default class FixedLayer extends React.Component<FixedLayerProps> {
|
|
29
|
-
update: () => void;
|
|
30
|
-
componentDidUpdate(prevProps: any): void;
|
|
31
|
-
render(): JSX.Element;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IndicatorProps } from '@atlaskit/select';
|
|
3
|
-
export declare const EmptyClearIndicator: null;
|
|
4
|
-
export declare const placeholderDatetime: Date;
|
|
5
|
-
export declare const defaultTimes: string[];
|
|
6
|
-
export declare const defaultTimeFormat = "h:mma";
|
|
7
|
-
export declare const defaultDateFormat = "YYYY/MM/DD";
|
|
8
|
-
export declare function padToTwo(number: number): string;
|
|
9
|
-
export declare const DropdownIndicator: (props: IndicatorProps<any>) => JSX.Element | null;
|
|
10
|
-
export declare function formatDateTimeZoneIntoIso(date: string, time: string, zone: string): string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare function isValid(timeString: string): boolean;
|
|
2
|
-
export declare function removeSpacer(time: string): string;
|
|
3
|
-
export declare function formatSemi24(time: string): string;
|
|
4
|
-
export declare function checkHour(hour: string, meridiem: string): string | null;
|
|
5
|
-
export declare function checkMinute(minute: string): string | null;
|
|
6
|
-
export declare function convertTo24hrTime(time: string): {
|
|
7
|
-
hour: number;
|
|
8
|
-
minute: number;
|
|
9
|
-
} | null;
|
|
10
|
-
export declare function assignToDate(time: {
|
|
11
|
-
hour: number;
|
|
12
|
-
minute: number;
|
|
13
|
-
}): Date;
|
|
14
|
-
export default function (time: string): string | Date;
|