@atlaskit/datetime-picker 12.8.0 → 12.8.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.
@@ -1,12 +1,7 @@
1
1
  import React from 'react';
2
2
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { LocalizationProvider } from '@atlaskit/locale';
4
3
  import { ActionMeta, OptionType, SelectProps, ValueType } from '@atlaskit/select';
5
4
  import { Appearance, Spacing } from '../types';
6
- interface Option {
7
- label: string;
8
- value: string;
9
- }
10
5
  export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
11
6
  /**
12
7
  * Set the appearance of the picker.
@@ -123,7 +118,6 @@ interface State {
123
118
  clearingFromIcon: boolean;
124
119
  value: string;
125
120
  isFocused: boolean;
126
- l10n: LocalizationProvider;
127
121
  }
128
122
  declare const timePickerDefaultProps: {
129
123
  appearance: Appearance;
@@ -174,11 +168,8 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
174
168
  clearingFromIcon: boolean;
175
169
  value: string;
176
170
  isFocused: boolean;
177
- l10n: LocalizationProvider;
178
171
  };
179
- UNSAFE_componentWillReceiveProps(nextProps: TimePickerProps): void;
180
172
  getSafeState: () => State;
181
- getOptions(): Array<Option>;
182
173
  onChange: (newValue: ValueType<OptionType> | string, action?: ActionMeta<OptionType>) => void;
183
174
  /**
184
175
  * Only allow custom times if timeIsEditable prop is true
@@ -190,15 +181,6 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
190
181
  onBlur: (event: React.FocusEvent<HTMLElement>) => void;
191
182
  onFocus: (event: React.FocusEvent<HTMLElement>) => void;
192
183
  onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
193
- /**
194
- * There are multiple props that can change how the time is formatted.
195
- * The priority of props used is:
196
- * 1. formatDisplayLabel
197
- * 2. timeFormat
198
- * 3. locale
199
- */
200
- formatTime: (time: string) => string;
201
- getPlaceholder: () => string;
202
184
  render(): JSX.Element;
203
185
  }
204
186
  export { TimePicker as TimePickerWithoutAnalytics };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * This component is used to hide portions of Select component.
3
+ */
1
4
  export declare const EmptyComponent: () => null;
2
5
  export declare const placeholderDatetime: Date;
3
6
  export declare const defaultTimes: string[];
@@ -166,6 +166,7 @@ interface State {
166
166
  calendarValue: string;
167
167
  selectInputValue: string;
168
168
  l10n: LocalizationProvider;
169
+ locale: string;
169
170
  }
170
171
  declare const datePickerDefaultProps: {
171
172
  appearance: Appearance;
@@ -213,7 +214,10 @@ declare class DatePicker extends Component<DatePickerProps, State> {
213
214
  calendarRef: CalendarRef | null;
214
215
  containerRef: HTMLElement | null;
215
216
  constructor(props: any);
216
- UNSAFE_componentWillReceiveProps(nextProps: Readonly<DatePickerProps>): void;
217
+ static getDerivedStateFromProps(nextProps: Readonly<DatePickerProps>, prevState: State): {
218
+ l10n: LocalizationProvider;
219
+ locale: string;
220
+ } | null;
217
221
  getSafeState: () => {
218
222
  inputValue: any;
219
223
  value: string;
@@ -223,6 +227,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
223
227
  calendarValue: string;
224
228
  selectInputValue: string;
225
229
  l10n: LocalizationProvider;
230
+ locale: string;
226
231
  };
227
232
  isDateDisabled: (date: string) => boolean;
228
233
  onCalendarChange: ({ iso }: {
@@ -117,7 +117,6 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
117
117
  }
118
118
  type DateTimePickerProps = typeof dateTimePickerDefaultProps & DateTimePickerBaseProps;
119
119
  interface State {
120
- active: 0 | 1 | 2;
121
120
  dateValue: string;
122
121
  isFocused: boolean;
123
122
  timeValue: string;
@@ -175,7 +174,6 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
175
174
  timeValue: string;
176
175
  zoneValue: string;
177
176
  value: string;
178
- active: 0 | 1 | 2;
179
177
  isFocused: boolean;
180
178
  };
181
179
  parseValue(value: string, dateValue: string, timeValue: string, zoneValue: string): {
@@ -1,12 +1,7 @@
1
1
  import React from 'react';
2
2
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { LocalizationProvider } from '@atlaskit/locale';
4
3
  import { ActionMeta, OptionType, SelectProps, ValueType } from '@atlaskit/select';
5
4
  import { Appearance, Spacing } from '../types';
6
- interface Option {
7
- label: string;
8
- value: string;
9
- }
10
5
  export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
11
6
  /**
12
7
  * Set the appearance of the picker.
@@ -123,7 +118,6 @@ interface State {
123
118
  clearingFromIcon: boolean;
124
119
  value: string;
125
120
  isFocused: boolean;
126
- l10n: LocalizationProvider;
127
121
  }
128
122
  declare const timePickerDefaultProps: {
129
123
  appearance: Appearance;
@@ -174,11 +168,8 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
174
168
  clearingFromIcon: boolean;
175
169
  value: string;
176
170
  isFocused: boolean;
177
- l10n: LocalizationProvider;
178
171
  };
179
- UNSAFE_componentWillReceiveProps(nextProps: TimePickerProps): void;
180
172
  getSafeState: () => State;
181
- getOptions(): Array<Option>;
182
173
  onChange: (newValue: ValueType<OptionType> | string, action?: ActionMeta<OptionType>) => void;
183
174
  /**
184
175
  * Only allow custom times if timeIsEditable prop is true
@@ -190,15 +181,6 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
190
181
  onBlur: (event: React.FocusEvent<HTMLElement>) => void;
191
182
  onFocus: (event: React.FocusEvent<HTMLElement>) => void;
192
183
  onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
193
- /**
194
- * There are multiple props that can change how the time is formatted.
195
- * The priority of props used is:
196
- * 1. formatDisplayLabel
197
- * 2. timeFormat
198
- * 3. locale
199
- */
200
- formatTime: (time: string) => string;
201
- getPlaceholder: () => string;
202
184
  render(): JSX.Element;
203
185
  }
204
186
  export { TimePicker as TimePickerWithoutAnalytics };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * This component is used to hide portions of Select component.
3
+ */
1
4
  export declare const EmptyComponent: () => null;
2
5
  export declare const placeholderDatetime: Date;
3
6
  export declare const defaultTimes: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.8.0",
3
+ "version": "12.8.2",
4
4
  "description": "A date time picker allows the user to select an associated date and time.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,15 +33,15 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/analytics-next": "^9.1.0",
36
- "@atlaskit/calendar": "^13.2.0",
36
+ "@atlaskit/calendar": "^13.3.0",
37
37
  "@atlaskit/ds-lib": "^2.2.0",
38
38
  "@atlaskit/icon": "^21.12.0",
39
39
  "@atlaskit/locale": "^2.5.0",
40
40
  "@atlaskit/platform-feature-flags": "^0.2.0",
41
41
  "@atlaskit/popper": "^5.5.0",
42
42
  "@atlaskit/select": "^16.5.0",
43
- "@atlaskit/theme": "^12.5.0",
44
- "@atlaskit/tokens": "^1.15.0",
43
+ "@atlaskit/theme": "^12.6.0",
44
+ "@atlaskit/tokens": "^1.20.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1",
47
47
  "date-fns": "^2.17.0",