@atlaskit/datetime-picker 12.8.2 → 12.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 12.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`4afff68f652`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4afff68f652) - Make typing more complete and accurate for date picker.
8
+
3
9
  ## 12.8.2
4
10
 
5
11
  ### Patch Changes
@@ -38,7 +38,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
38
38
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
39
39
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
40
40
  var packageName = "@atlaskit/datetime-picker";
41
- var packageVersion = "12.8.2";
41
+ var packageVersion = "12.9.0";
42
42
  function getValidDate(iso) {
43
43
  var date = (0, _dateFns.parseISO)(iso);
44
44
  return (0, _dateFns.isValid)(date) ? {
@@ -412,7 +412,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
412
412
  isOpen: _this.props.defaultIsOpen,
413
413
  isFocused: false,
414
414
  clearingFromIcon: false,
415
- selectInputValue: _this.props.selectProps.inputValue,
415
+ selectInputValue: _this.props.selectProps.inputValue || '',
416
416
  value: _this.props.value || _this.props.defaultValue,
417
417
  calendarValue: _this.props.value || _this.props.defaultValue || getShortISOString(new Date()),
418
418
  l10n: (0, _locale.createLocalizationProvider)(_this.props.locale),
@@ -31,7 +31,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
31
31
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
32
32
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
33
33
  var packageName = "@atlaskit/datetime-picker";
34
- var packageVersion = "12.8.2";
34
+ var packageVersion = "12.9.0";
35
35
  var isInvalidBorderStyles = (0, _react2.css)({
36
36
  borderColor: "var(--ds-border-danger, ".concat(_colors.R400, ")")
37
37
  });
@@ -37,7 +37,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
37
37
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
38
38
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
39
  var packageName = "@atlaskit/datetime-picker";
40
- var packageVersion = "12.8.2";
40
+ var packageVersion = "12.9.0";
41
41
  var menuStyles = {
42
42
  /* Need to remove default absolute positioning as that causes issues with position fixed */
43
43
  position: 'static',
@@ -18,7 +18,7 @@ import FixedLayer from '../internal/fixed-layer';
18
18
  import { makeSingleValue } from '../internal/single-value';
19
19
  import { convertTokens } from './utils';
20
20
  const packageName = "@atlaskit/datetime-picker";
21
- const packageVersion = "12.8.2";
21
+ const packageVersion = "12.9.0";
22
22
  function getValidDate(iso) {
23
23
  const date = parseISO(iso);
24
24
  return isValid(date) ? {
@@ -401,7 +401,7 @@ class DatePicker extends Component {
401
401
  isOpen: this.props.defaultIsOpen,
402
402
  isFocused: false,
403
403
  clearingFromIcon: false,
404
- selectInputValue: this.props.selectProps.inputValue,
404
+ selectInputValue: this.props.selectProps.inputValue || '',
405
405
  value: this.props.value || this.props.defaultValue,
406
406
  calendarValue: this.props.value || this.props.defaultValue || getShortISOString(new Date()),
407
407
  l10n: createLocalizationProvider(this.props.locale),
@@ -15,7 +15,7 @@ import DatePicker from './date-picker';
15
15
  import TimePicker from './time-picker';
16
16
  import { convertTokens } from './utils';
17
17
  const packageName = "@atlaskit/datetime-picker";
18
- const packageVersion = "12.8.2";
18
+ const packageVersion = "12.9.0";
19
19
  const isInvalidBorderStyles = css({
20
20
  borderColor: `var(--ds-border-danger, ${R400})`
21
21
  });
@@ -16,7 +16,7 @@ import parseTime from '../internal/parse-time';
16
16
  import { makeSingleValue } from '../internal/single-value';
17
17
  import { convertTokens } from './utils';
18
18
  const packageName = "@atlaskit/datetime-picker";
19
- const packageVersion = "12.8.2";
19
+ const packageVersion = "12.9.0";
20
20
  const menuStyles = {
21
21
  /* Need to remove default absolute positioning as that causes issues with position fixed */
22
22
  position: 'static',
@@ -29,7 +29,7 @@ import FixedLayer from '../internal/fixed-layer';
29
29
  import { makeSingleValue } from '../internal/single-value';
30
30
  import { convertTokens } from './utils';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "12.8.2";
32
+ var packageVersion = "12.9.0";
33
33
  function getValidDate(iso) {
34
34
  var date = parseISO(iso);
35
35
  return isValid(date) ? {
@@ -403,7 +403,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
403
403
  isOpen: _this.props.defaultIsOpen,
404
404
  isFocused: false,
405
405
  clearingFromIcon: false,
406
- selectInputValue: _this.props.selectProps.inputValue,
406
+ selectInputValue: _this.props.selectProps.inputValue || '',
407
407
  value: _this.props.value || _this.props.defaultValue,
408
408
  calendarValue: _this.props.value || _this.props.defaultValue || getShortISOString(new Date()),
409
409
  l10n: createLocalizationProvider(_this.props.locale),
@@ -25,7 +25,7 @@ import DatePicker from './date-picker';
25
25
  import TimePicker from './time-picker';
26
26
  import { convertTokens } from './utils';
27
27
  var packageName = "@atlaskit/datetime-picker";
28
- var packageVersion = "12.8.2";
28
+ var packageVersion = "12.9.0";
29
29
  var isInvalidBorderStyles = css({
30
30
  borderColor: "var(--ds-border-danger, ".concat(R400, ")")
31
31
  });
@@ -29,7 +29,7 @@ import parseTime from '../internal/parse-time';
29
29
  import { makeSingleValue } from '../internal/single-value';
30
30
  import { convertTokens } from './utils';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "12.8.2";
32
+ var packageVersion = "12.9.0";
33
33
  var menuStyles = {
34
34
  /* Need to remove default absolute positioning as that causes issues with position fixed */
35
35
  position: 'static',
@@ -4,8 +4,8 @@ import { jsx } from '@emotion/react';
4
4
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
5
5
  import { CalendarRef } from '@atlaskit/calendar';
6
6
  import { LocalizationProvider } from '@atlaskit/locale';
7
- import { ActionMeta, DropdownIndicatorProps, OptionType, ValueType } from '@atlaskit/select';
8
- import { Appearance, SelectProps, Spacing } from '../types';
7
+ import { ActionMeta, DropdownIndicatorProps, InputActionMeta, OptionType, SelectProps, ValueType } from '@atlaskit/select';
8
+ import { Appearance, Spacing } from '../types';
9
9
  export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
10
10
  /**
11
11
  * Set the appearance of the picker.
@@ -103,7 +103,7 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
103
103
  * Props to apply to the select. This can be used to set options such as placeholder text.
104
104
  * See [the `Select` documentation for further information](/components/select).
105
105
  */
106
- selectProps?: SelectProps;
106
+ selectProps?: SelectProps<any>;
107
107
  /**
108
108
  * The spacing for the select control.
109
109
  *
@@ -219,7 +219,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
219
219
  locale: string;
220
220
  } | null;
221
221
  getSafeState: () => {
222
- inputValue: any;
222
+ inputValue?: string | undefined;
223
223
  value: string;
224
224
  isOpen: boolean;
225
225
  isFocused: boolean;
@@ -246,7 +246,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
246
246
  onClear: () => void;
247
247
  onSelectChange: (value: ValueType<OptionType>, action: ActionMeta) => void;
248
248
  refCalendar: (ref: CalendarRef | null) => void;
249
- handleSelectInputChange: (selectInputValue: string, actionMeta: {}) => void;
249
+ handleSelectInputChange: (selectInputValue: string, actionMeta: InputActionMeta) => void;
250
250
  getContainerRef: (ref: HTMLElement | null) => void;
251
251
  /**
252
252
  * There are two props that can change how the date is parsed.
@@ -1,3 +1,2 @@
1
1
  export type Appearance = 'default' | 'subtle' | 'none';
2
2
  export type Spacing = 'compact' | 'default';
3
- export type SelectProps = any;
@@ -4,8 +4,8 @@ import { jsx } from '@emotion/react';
4
4
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
5
5
  import { CalendarRef } from '@atlaskit/calendar';
6
6
  import { LocalizationProvider } from '@atlaskit/locale';
7
- import { ActionMeta, DropdownIndicatorProps, OptionType, ValueType } from '@atlaskit/select';
8
- import { Appearance, SelectProps, Spacing } from '../types';
7
+ import { ActionMeta, DropdownIndicatorProps, InputActionMeta, OptionType, SelectProps, ValueType } from '@atlaskit/select';
8
+ import { Appearance, Spacing } from '../types';
9
9
  export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
10
10
  /**
11
11
  * Set the appearance of the picker.
@@ -103,7 +103,7 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
103
103
  * Props to apply to the select. This can be used to set options such as placeholder text.
104
104
  * See [the `Select` documentation for further information](/components/select).
105
105
  */
106
- selectProps?: SelectProps;
106
+ selectProps?: SelectProps<any>;
107
107
  /**
108
108
  * The spacing for the select control.
109
109
  *
@@ -219,7 +219,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
219
219
  locale: string;
220
220
  } | null;
221
221
  getSafeState: () => {
222
- inputValue: any;
222
+ inputValue?: string | undefined;
223
223
  value: string;
224
224
  isOpen: boolean;
225
225
  isFocused: boolean;
@@ -246,7 +246,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
246
246
  onClear: () => void;
247
247
  onSelectChange: (value: ValueType<OptionType>, action: ActionMeta) => void;
248
248
  refCalendar: (ref: CalendarRef | null) => void;
249
- handleSelectInputChange: (selectInputValue: string, actionMeta: {}) => void;
249
+ handleSelectInputChange: (selectInputValue: string, actionMeta: InputActionMeta) => void;
250
250
  getContainerRef: (ref: HTMLElement | null) => void;
251
251
  /**
252
252
  * There are two props that can change how the date is parsed.
@@ -1,3 +1,2 @@
1
1
  export type Appearance = 'default' | 'subtle' | 'none';
2
2
  export type Spacing = 'compact' | 'default';
3
- export type SelectProps = any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.8.2",
3
+ "version": "12.9.0",
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/"
package/report.api.md CHANGED
@@ -23,7 +23,7 @@ import { GroupType } from '@atlaskit/select';
23
23
  import { OptionType } from '@atlaskit/select';
24
24
  import { default as React_2 } from 'react';
25
25
  import { RefAttributes } from 'react';
26
- import { SelectProps as SelectProps_2 } from '@atlaskit/select';
26
+ import { SelectProps } from '@atlaskit/select';
27
27
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
28
28
  import { WithContextProps } from '@atlaskit/analytics-next';
29
29
 
@@ -192,7 +192,7 @@ export interface DatePickerProps extends WithAnalyticsEventsProps {
192
192
  parseInputValue?: (date: string, dateFormat: string) => Date;
193
193
  placeholder?: string;
194
194
  previousMonthLabel?: string;
195
- selectProps?: SelectProps;
195
+ selectProps?: SelectProps<any>;
196
196
  spacing?: Spacing;
197
197
  testId?: string;
198
198
  value?: string;
@@ -320,7 +320,7 @@ export interface DateTimePickerProps extends WithAnalyticsEventsProps {
320
320
  autoFocus?: boolean;
321
321
  dateFormat?: string;
322
322
  datePickerProps?: DatePickerProps;
323
- datePickerSelectProps?: SelectProps_2<any>;
323
+ datePickerSelectProps?: SelectProps<any>;
324
324
  defaultValue?: string;
325
325
  id?: string;
326
326
  innerProps?: React_2.AllHTMLAttributes<HTMLElement>;
@@ -346,7 +346,7 @@ export interface DateTimePickerProps extends WithAnalyticsEventsProps {
346
346
  timeFormat?: string;
347
347
  timeIsEditable?: boolean;
348
348
  timePickerProps?: TimePickerProps;
349
- timePickerSelectProps?: SelectProps_2<any>;
349
+ timePickerSelectProps?: SelectProps<any>;
350
350
  times?: Array<string>;
351
351
  value?: string;
352
352
  }
@@ -355,9 +355,6 @@ export interface DateTimePickerProps extends WithAnalyticsEventsProps {
355
355
  type DateTimePickerProps_2 = typeof dateTimePickerDefaultProps &
356
356
  DateTimePickerProps;
357
357
 
358
- // @public (undocumented)
359
- type SelectProps = any;
360
-
361
358
  // @public (undocumented)
362
359
  export type Spacing = 'compact' | 'default';
363
360
 
@@ -503,7 +500,7 @@ export interface TimePickerProps extends WithAnalyticsEventsProps {
503
500
  // (undocumented)
504
501
  parseInputValue?: (time: string, timeFormat: string) => Date | string;
505
502
  placeholder?: string;
506
- selectProps?: SelectProps_2<any>;
503
+ selectProps?: SelectProps<any>;
507
504
  spacing?: Spacing;
508
505
  testId?: string;
509
506
  timeFormat?: string;
@@ -12,7 +12,7 @@ import { GroupType } from '@atlaskit/select';
12
12
  import { OptionType } from '@atlaskit/select';
13
13
  import { default as React_2 } from 'react';
14
14
  import { RefAttributes } from 'react';
15
- import { SelectProps as SelectProps_2 } from '@atlaskit/select';
15
+ import { SelectProps } from '@atlaskit/select';
16
16
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
17
17
  import { WithContextProps } from '@atlaskit/analytics-next';
18
18
 
@@ -93,7 +93,7 @@ export interface DatePickerProps extends WithAnalyticsEventsProps {
93
93
  parseInputValue?: (date: string, dateFormat: string) => Date;
94
94
  placeholder?: string;
95
95
  previousMonthLabel?: string;
96
- selectProps?: SelectProps;
96
+ selectProps?: SelectProps<any>;
97
97
  spacing?: Spacing;
98
98
  testId?: string;
99
99
  value?: string;
@@ -155,7 +155,7 @@ export interface DateTimePickerProps extends WithAnalyticsEventsProps {
155
155
  autoFocus?: boolean;
156
156
  dateFormat?: string;
157
157
  datePickerProps?: DatePickerProps;
158
- datePickerSelectProps?: SelectProps_2<any>;
158
+ datePickerSelectProps?: SelectProps<any>;
159
159
  defaultValue?: string;
160
160
  id?: string;
161
161
  innerProps?: React_2.AllHTMLAttributes<HTMLElement>;
@@ -176,7 +176,7 @@ export interface DateTimePickerProps extends WithAnalyticsEventsProps {
176
176
  timeFormat?: string;
177
177
  timeIsEditable?: boolean;
178
178
  timePickerProps?: TimePickerProps;
179
- timePickerSelectProps?: SelectProps_2<any>;
179
+ timePickerSelectProps?: SelectProps<any>;
180
180
  times?: Array<string>;
181
181
  value?: string;
182
182
  }
@@ -184,9 +184,6 @@ export interface DateTimePickerProps extends WithAnalyticsEventsProps {
184
184
  // @public (undocumented)
185
185
  type DateTimePickerProps_2 = typeof dateTimePickerDefaultProps & DateTimePickerProps;
186
186
 
187
- // @public (undocumented)
188
- type SelectProps = any;
189
-
190
187
  // @public (undocumented)
191
188
  export type Spacing = 'compact' | 'default';
192
189
 
@@ -257,7 +254,7 @@ export interface TimePickerProps extends WithAnalyticsEventsProps {
257
254
  // (undocumented)
258
255
  parseInputValue?: (time: string, timeFormat: string) => Date | string;
259
256
  placeholder?: string;
260
- selectProps?: SelectProps_2<any>;
257
+ selectProps?: SelectProps<any>;
261
258
  spacing?: Spacing;
262
259
  testId?: string;
263
260
  timeFormat?: string;