@atlaskit/datetime-picker 15.12.2 → 15.13.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/components/date-picker.js +639 -7
  3. package/dist/cjs/components/date-time-picker.js +379 -9
  4. package/dist/cjs/components/time-picker.js +2 -2
  5. package/dist/es2019/components/date-picker.js +570 -5
  6. package/dist/es2019/components/date-time-picker.js +347 -6
  7. package/dist/es2019/components/time-picker.js +2 -2
  8. package/dist/esm/components/date-picker.js +637 -7
  9. package/dist/esm/components/date-time-picker.js +375 -8
  10. package/dist/esm/components/time-picker.js +2 -2
  11. package/dist/types/components/date-picker.d.ts +18 -19
  12. package/dist/types/components/date-time-picker.d.ts +14 -31
  13. package/dist/types-ts4.5/components/date-picker.d.ts +18 -19
  14. package/dist/types-ts4.5/components/date-time-picker.d.ts +14 -31
  15. package/package.json +5 -8
  16. package/dist/cjs/components/date-picker-class.js +0 -685
  17. package/dist/cjs/components/date-picker-fc.js +0 -639
  18. package/dist/cjs/components/date-time-picker-class.js +0 -436
  19. package/dist/cjs/components/date-time-picker-fc.js +0 -394
  20. package/dist/cjs/internal/ff-component.js +0 -58
  21. package/dist/es2019/components/date-picker-class.js +0 -649
  22. package/dist/es2019/components/date-picker-fc.js +0 -563
  23. package/dist/es2019/components/date-time-picker-class.js +0 -400
  24. package/dist/es2019/components/date-time-picker-fc.js +0 -354
  25. package/dist/es2019/internal/ff-component.js +0 -47
  26. package/dist/esm/components/date-picker-class.js +0 -680
  27. package/dist/esm/components/date-picker-fc.js +0 -630
  28. package/dist/esm/components/date-time-picker-class.js +0 -434
  29. package/dist/esm/components/date-time-picker-fc.js +0 -384
  30. package/dist/esm/internal/ff-component.js +0 -49
  31. package/dist/types/components/date-picker-class.d.ts +0 -110
  32. package/dist/types/components/date-picker-fc.d.ts +0 -20
  33. package/dist/types/components/date-time-picker-class.d.ts +0 -85
  34. package/dist/types/components/date-time-picker-fc.d.ts +0 -15
  35. package/dist/types/internal/ff-component.d.ts +0 -34
  36. package/dist/types-ts4.5/components/date-picker-class.d.ts +0 -110
  37. package/dist/types-ts4.5/components/date-picker-fc.d.ts +0 -20
  38. package/dist/types-ts4.5/components/date-time-picker-class.d.ts +0 -85
  39. package/dist/types-ts4.5/components/date-time-picker-fc.d.ts +0 -15
  40. package/dist/types-ts4.5/internal/ff-component.d.ts +0 -34
@@ -1,434 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
- 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; }
10
- 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) { _defineProperty(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; }
11
- /**
12
- * @jsxRuntime classic
13
- * @jsx jsx
14
- */
15
- import React from 'react';
16
-
17
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
- import { css, jsx } from '@emotion/react';
19
- import { format, isValid, parseISO } from 'date-fns';
20
- import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
21
- import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
- import { mergeStyles } from '@atlaskit/select';
24
- import { N500, N70 } from '@atlaskit/theme/colors';
25
- import { formatDateTimeZoneIntoIso } from '../internal';
26
- import { DateTimePickerContainer } from '../internal/date-time-picker-container';
27
- import { componentWithCondition } from '../internal/ff-component';
28
- import { convertTokens } from '../internal/parse-tokens';
29
- import DatePickerOld from './date-picker-class';
30
- import DatePickerNew from './date-picker-fc';
31
- import TimePicker from './time-picker';
32
- var DatePicker = componentWithCondition(function () {
33
- return fg('dst-date-picker-use-functional-component');
34
- }, DatePickerNew, DatePickerOld);
35
- var packageName = "@atlaskit/datetime-picker";
36
- var packageVersion = "15.12.2";
37
- // Make DatePicker 50% the width of DateTimePicker
38
- // If rendering an icon container, shrink the TimePicker
39
- var datePickerContainerStyles = css({
40
- flexBasis: '50%',
41
- flexGrow: 1,
42
- flexShrink: 0
43
- });
44
- var timePickerContainerStyles = css({
45
- flexBasis: '50%',
46
- flexGrow: 1
47
- });
48
- var iconContainerStyles = css({
49
- display: 'flex',
50
- margin: "var(--ds-border-width, 1px)",
51
- alignItems: 'center',
52
- flexBasis: 'inherit',
53
- backgroundColor: 'inherit',
54
- border: 'none',
55
- color: "var(--ds-text-subtlest, ".concat(N70, ")"),
56
- paddingBlockEnd: "var(--ds-space-075, 6px)",
57
- paddingBlockStart: "var(--ds-space-075, 6px)",
58
- paddingInlineEnd: "var(--ds-space-100, 8px)",
59
- paddingInlineStart: "var(--ds-space-050, 4px)",
60
- transition: "color 150ms",
61
- '&:hover': {
62
- color: "var(--ds-text-subtle, ".concat(N500, ")")
63
- }
64
- });
65
-
66
- // react-select overrides (via @atlaskit/select).
67
- var styles = {
68
- control: function control(style) {
69
- return _objectSpread(_objectSpread({}, style), {}, {
70
- backgroundColor: 'transparent',
71
- border: 2,
72
- borderRadius: 0,
73
- paddingLeft: 0,
74
- ':hover': {
75
- backgroundColor: 'transparent',
76
- cursor: 'inherit'
77
- }
78
- });
79
- }
80
- };
81
- var dateTimePickerDefaultProps = {
82
- // These disables are here for proper typing when used as defaults. They
83
- // should *not* use the `noop` function.
84
- /* eslint-disable @repo/internal/react/use-noop */
85
- onBlur: function onBlur(_event) {},
86
- onChange: function onChange(_value) {},
87
- onFocus: function onFocus(_event) {}
88
- /* eslint-enable @repo/internal/react/use-noop */
89
- // Not including a default prop for value as it will
90
- // Make the component a controlled component
91
- };
92
- export var datePickerDefaultAriaLabel = 'Date';
93
- export var timePickerDefaultAriaLabel = 'Time';
94
- var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
95
- function DateTimePickerComponent() {
96
- var _this$props$datePicke, _this$props$timePicke;
97
- var _this;
98
- _classCallCheck(this, DateTimePickerComponent);
99
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
100
- args[_key] = arguments[_key];
101
- }
102
- _this = _callSuper(this, DateTimePickerComponent, [].concat(args));
103
- _defineProperty(_this, "state", {
104
- dateValue: ((_this$props$datePicke = _this.props.datePickerProps) === null || _this$props$datePicke === void 0 ? void 0 : _this$props$datePicke.defaultValue) || '',
105
- isFocused: false,
106
- timeValue: ((_this$props$timePicke = _this.props.timePickerProps) === null || _this$props$timePicke === void 0 ? void 0 : _this$props$timePicke.defaultValue) || '',
107
- value: _this.props.defaultValue || '',
108
- zoneValue: ''
109
- });
110
- // All state needs to be accessed via this function so that the state is mapped from props
111
- // correctly to allow controlled/uncontrolled usage.
112
- _defineProperty(_this, "getParsedValues", function () {
113
- return _this.parseValue(_this.getValue(), _this.state.dateValue, _this.state.timeValue, _this.state.zoneValue);
114
- });
115
- _defineProperty(_this, "getValue", function () {
116
- var _this$props$value;
117
- return (_this$props$value = _this.props.value) !== null && _this$props$value !== void 0 ? _this$props$value : _this.state.value;
118
- });
119
- _defineProperty(_this, "onDateBlur", function (event) {
120
- var _this$props$onBlur, _this$props, _this$props$datePicke2;
121
- _this.setState({
122
- isFocused: false
123
- });
124
- (_this$props$onBlur = (_this$props = _this.props).onBlur) === null || _this$props$onBlur === void 0 || _this$props$onBlur.call(_this$props, event);
125
- if ((_this$props$datePicke2 = _this.props.datePickerProps) !== null && _this$props$datePicke2 !== void 0 && _this$props$datePicke2.onBlur) {
126
- _this.props.datePickerProps.onBlur(event);
127
- }
128
- });
129
- _defineProperty(_this, "onTimeBlur", function (event) {
130
- var _this$props$onBlur2, _this$props2, _this$props$timePicke2;
131
- _this.setState({
132
- isFocused: false
133
- });
134
- (_this$props$onBlur2 = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur2 === void 0 || _this$props$onBlur2.call(_this$props2, event);
135
- if ((_this$props$timePicke2 = _this.props.timePickerProps) !== null && _this$props$timePicke2 !== void 0 && _this$props$timePicke2.onBlur) {
136
- _this.props.timePickerProps.onBlur(event);
137
- }
138
- });
139
- _defineProperty(_this, "onDateFocus", function (event) {
140
- var _this$props$onFocus, _this$props3, _this$props$datePicke3;
141
- _this.setState({
142
- isFocused: true
143
- });
144
- (_this$props$onFocus = (_this$props3 = _this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props3, event);
145
- if ((_this$props$datePicke3 = _this.props.datePickerProps) !== null && _this$props$datePicke3 !== void 0 && _this$props$datePicke3.onFocus) {
146
- _this.props.datePickerProps.onFocus(event);
147
- }
148
- });
149
- _defineProperty(_this, "onTimeFocus", function (event) {
150
- var _this$props$onFocus2, _this$props4, _this$props$timePicke3;
151
- _this.setState({
152
- isFocused: true
153
- });
154
- (_this$props$onFocus2 = (_this$props4 = _this.props).onFocus) === null || _this$props$onFocus2 === void 0 || _this$props$onFocus2.call(_this$props4, event);
155
- if ((_this$props$timePicke3 = _this.props.timePickerProps) !== null && _this$props$timePicke3 !== void 0 && _this$props$timePicke3.onFocus) {
156
- _this.props.timePickerProps.onFocus(event);
157
- }
158
- });
159
- _defineProperty(_this, "onDateChange", function (dateValue) {
160
- var _this$props$datePicke4;
161
- var parsedValues = _this.getParsedValues();
162
- _this.onValueChange({
163
- dateValue: dateValue,
164
- timeValue: parsedValues.timeValue,
165
- zoneValue: parsedValues.zoneValue
166
- });
167
- if ((_this$props$datePicke4 = _this.props.datePickerProps) !== null && _this$props$datePicke4 !== void 0 && _this$props$datePicke4.onChange) {
168
- _this.props.datePickerProps.onChange(dateValue);
169
- }
170
- });
171
- _defineProperty(_this, "onTimeChange", function (timeValue) {
172
- var _this$props$timePicke4;
173
- var parsedValues = _this.getParsedValues();
174
- _this.onValueChange({
175
- dateValue: parsedValues.dateValue,
176
- timeValue: timeValue,
177
- zoneValue: parsedValues.zoneValue
178
- });
179
- if ((_this$props$timePicke4 = _this.props.timePickerProps) !== null && _this$props$timePicke4 !== void 0 && _this$props$timePicke4.onChange) {
180
- _this.props.timePickerProps.onChange(timeValue);
181
- }
182
- });
183
- _defineProperty(_this, "onClear", function () {
184
- var _this$props$datePicke5, _this$props$timePicke5;
185
- var parsedValues = _this.getParsedValues();
186
- _this.onValueChange({
187
- dateValue: '',
188
- timeValue: '',
189
- zoneValue: parsedValues.zoneValue
190
- });
191
- if ((_this$props$datePicke5 = _this.props.datePickerProps) !== null && _this$props$datePicke5 !== void 0 && _this$props$datePicke5.onChange) {
192
- _this.props.datePickerProps.onChange('');
193
- }
194
- if ((_this$props$timePicke5 = _this.props.timePickerProps) !== null && _this$props$timePicke5 !== void 0 && _this$props$timePicke5.onChange) {
195
- _this.props.timePickerProps.onChange('');
196
- }
197
- });
198
- return _this;
199
- }
200
- _inherits(DateTimePickerComponent, _React$Component);
201
- return _createClass(DateTimePickerComponent, [{
202
- key: "parseValue",
203
- value: function parseValue(value, dateValue, timeValue, zoneValue) {
204
- if (this.props.parseValue) {
205
- var parsedFromFn = this.props.parseValue(value, dateValue, timeValue, zoneValue);
206
- // This handles cases found in Jira where the parse function actually does
207
- // nothing and returns undefined. The previous `getSafeState` function
208
- // just spread the values over the state, but if it returned `undefined`,
209
- // it would just rely on the previous state values. Considering this is
210
- // what is input to this function anyway, this is a safe way to handle
211
- // this, colocate the behavior, and not rely on `getSafeState`.
212
- return parsedFromFn || {
213
- dateValue: dateValue,
214
- timeValue: timeValue,
215
- zoneValue: zoneValue
216
- };
217
- }
218
- var parsed = parseISO(value);
219
- return isValid(parsed) ? {
220
- dateValue: format(parsed, convertTokens('YYYY-MM-DD')),
221
- timeValue: format(parsed, convertTokens('HH:mm')),
222
- zoneValue: format(parsed, convertTokens('ZZ'))
223
- } : {
224
- dateValue: dateValue,
225
- timeValue: timeValue,
226
- zoneValue: zoneValue
227
- };
228
- }
229
- }, {
230
- key: "onValueChange",
231
- value: function onValueChange(_ref) {
232
- var dateValue = _ref.dateValue,
233
- timeValue = _ref.timeValue,
234
- zoneValue = _ref.zoneValue;
235
- this.setState({
236
- dateValue: dateValue,
237
- timeValue: timeValue,
238
- zoneValue: zoneValue
239
- });
240
- if (dateValue && timeValue) {
241
- var _this$props$onChange, _this$props5;
242
- var value = formatDateTimeZoneIntoIso(dateValue, timeValue, zoneValue);
243
- var _this$parseValue = this.parseValue(value, dateValue, timeValue, zoneValue),
244
- parsedZone = _this$parseValue.zoneValue;
245
- var valueWithValidZone = formatDateTimeZoneIntoIso(dateValue, timeValue, parsedZone);
246
- this.setState({
247
- value: valueWithValidZone
248
- });
249
- (_this$props$onChange = (_this$props5 = this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props5, valueWithValidZone);
250
- // If the date or time value was cleared when there is an existing datetime value, then clear the value.
251
- } else if (this.getValue()) {
252
- var _this$props$onChange2, _this$props6;
253
- this.setState({
254
- value: ''
255
- });
256
- (_this$props$onChange2 = (_this$props6 = this.props).onChange) === null || _this$props$onChange2 === void 0 || _this$props$onChange2.call(_this$props6, '');
257
- }
258
- }
259
- }, {
260
- key: "render",
261
- value: function render() {
262
- var _this$props7 = this.props,
263
- ariaDescribedBy = _this$props7['aria-describedby'],
264
- _this$props7$appearan = _this$props7.appearance,
265
- appearance = _this$props7$appearan === void 0 ? 'default' : _this$props7$appearan,
266
- _this$props7$autoFocu = _this$props7.autoFocus,
267
- autoFocus = _this$props7$autoFocu === void 0 ? false : _this$props7$autoFocu,
268
- _this$props7$clearCon = _this$props7.clearControlLabel,
269
- clearControlLabel = _this$props7$clearCon === void 0 ? 'clear' : _this$props7$clearCon,
270
- _this$props7$datePick = _this$props7.datePickerProps,
271
- datePickerProps = _this$props7$datePick === void 0 ? {} : _this$props7$datePick,
272
- _this$props7$id = _this$props7.id,
273
- id = _this$props7$id === void 0 ? '' : _this$props7$id,
274
- _this$props7$innerPro = _this$props7.innerProps,
275
- innerProps = _this$props7$innerPro === void 0 ? {} : _this$props7$innerPro,
276
- _this$props7$isDisabl = _this$props7.isDisabled,
277
- isDisabled = _this$props7$isDisabl === void 0 ? false : _this$props7$isDisabl,
278
- _this$props7$isInvali = _this$props7.isInvalid,
279
- isInvalid = _this$props7$isInvali === void 0 ? false : _this$props7$isInvali,
280
- _this$props7$isRequir = _this$props7.isRequired,
281
- isRequired = _this$props7$isRequir === void 0 ? false : _this$props7$isRequir,
282
- _this$props7$locale = _this$props7.locale,
283
- locale = _this$props7$locale === void 0 ? 'en-US' : _this$props7$locale,
284
- _this$props7$name = _this$props7.name,
285
- name = _this$props7$name === void 0 ? '' : _this$props7$name,
286
- _this$props7$spacing = _this$props7.spacing,
287
- spacing = _this$props7$spacing === void 0 ? 'default' : _this$props7$spacing,
288
- testId = _this$props7.testId,
289
- _this$props7$timePick = _this$props7.timePickerProps,
290
- timePickerProps = _this$props7$timePick === void 0 ? {} : _this$props7$timePick;
291
- var value = this.getValue();
292
- var isFocused = this.state.isFocused;
293
- var parsedValues = this.getParsedValues();
294
- var dateValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.dateValue;
295
- var timeValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.timeValue;
296
- var datePickerSelectProps = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectProps;
297
- var datePickerAriaDescribedBy = datePickerProps['aria-describedby'] || ariaDescribedBy;
298
- var datePickerLabel = datePickerProps.label || datePickerDefaultAriaLabel;
299
- var mergedDatePickerSelectProps = _objectSpread(_objectSpread({}, datePickerSelectProps), {}, {
300
- styles: mergeStyles(styles, datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.styles)
301
- });
302
- var timePickerSelectProps = timePickerProps === null || timePickerProps === void 0 ? void 0 : timePickerProps.selectProps;
303
- var timePickerAriaDescribedBy = timePickerProps['aria-describedby'] || ariaDescribedBy;
304
- var timePickerLabel = timePickerProps.label || timePickerDefaultAriaLabel;
305
- var mergedTimePickerSelectProps = _objectSpread(_objectSpread({}, timePickerSelectProps), {}, {
306
- styles: mergeStyles(styles, timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.styles)
307
- });
308
-
309
- // Render DateTimePicker's IconContainer when a value has been filled
310
- // Don't use Date or TimePicker's because they can't be customised
311
- var isClearable = Boolean(dateValue || timeValue);
312
- return jsx(DateTimePickerContainer, {
313
- appearance: appearance,
314
- isDisabled: isDisabled,
315
- isFocused: isFocused,
316
- isInvalid: isInvalid,
317
- testId: testId,
318
- innerProps: innerProps
319
- }, jsx("input", {
320
- name: name,
321
- type: "hidden",
322
- value: value,
323
- "data-testid": testId && "".concat(testId, "--input")
324
- }), jsx("div", {
325
- css: datePickerContainerStyles
326
- }, jsx(DatePicker, {
327
- appearance: appearance,
328
- "aria-describedby": datePickerAriaDescribedBy,
329
- autoFocus: datePickerProps.autoFocus || autoFocus,
330
- dateFormat: datePickerProps.dateFormat,
331
- defaultIsOpen: datePickerProps.defaultIsOpen,
332
- defaultValue: datePickerProps.defaultValue,
333
- disabled: datePickerProps.disabled,
334
- disabledDateFilter: datePickerProps.disabledDateFilter,
335
- formatDisplayLabel: datePickerProps.formatDisplayLabel,
336
- hideIcon: datePickerProps.hideIcon || true,
337
- icon: datePickerProps.icon,
338
- id: datePickerProps.id || id,
339
- innerProps: datePickerProps.innerProps,
340
- isDisabled: datePickerProps.isDisabled || isDisabled,
341
- isInvalid: datePickerProps.isInvalid || isInvalid,
342
- isRequired: datePickerProps.isRequired || isRequired,
343
- isOpen: datePickerProps.isOpen,
344
- label: datePickerLabel,
345
- locale: datePickerProps.locale || locale,
346
- maxDate: datePickerProps.maxDate,
347
- minDate: datePickerProps.minDate,
348
- name: datePickerProps.name,
349
- nextMonthLabel: datePickerProps.nextMonthLabel,
350
- onBlur: this.onDateBlur,
351
- onChange: this.onDateChange,
352
- onFocus: this.onDateFocus,
353
- parseInputValue: datePickerProps.parseInputValue,
354
- placeholder: datePickerProps.placeholder,
355
- previousMonthLabel: datePickerProps.previousMonthLabel,
356
- selectProps: mergedDatePickerSelectProps,
357
- shouldShowCalendarButton: datePickerProps.shouldShowCalendarButton,
358
- spacing: datePickerProps.spacing || spacing,
359
- testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
360
- value: dateValue,
361
- weekStartDay: datePickerProps.weekStartDay
362
- })), jsx("div", {
363
- css: timePickerContainerStyles
364
- }, jsx(TimePicker, {
365
- appearance: timePickerProps.appearance || appearance,
366
- "aria-describedby": timePickerAriaDescribedBy,
367
- autoFocus: timePickerProps.autoFocus,
368
- defaultIsOpen: timePickerProps.defaultIsOpen,
369
- defaultValue: timePickerProps.defaultValue,
370
- formatDisplayLabel: timePickerProps.formatDisplayLabel,
371
- hideIcon: timePickerProps.hideIcon || true,
372
- id: timePickerProps.id,
373
- innerProps: timePickerProps.innerProps,
374
- isDisabled: timePickerProps.isDisabled || isDisabled,
375
- isInvalid: timePickerProps.isInvalid || isInvalid,
376
- isOpen: timePickerProps.isOpen,
377
- isRequired: timePickerProps.isRequired || isRequired,
378
- label: timePickerLabel,
379
- locale: timePickerProps.locale || locale,
380
- name: timePickerProps.name,
381
- onBlur: this.onTimeBlur,
382
- onChange: this.onTimeChange,
383
- onFocus: this.onTimeFocus,
384
- parseInputValue: timePickerProps.parseInputValue,
385
- placeholder: timePickerProps.placeholder,
386
- selectProps: mergedTimePickerSelectProps,
387
- spacing: timePickerProps.spacing || spacing,
388
- testId: timePickerProps.testId || testId && "".concat(testId, "--timepicker"),
389
- timeFormat: timePickerProps.timeFormat,
390
- timeIsEditable: timePickerProps.timeIsEditable,
391
- times: timePickerProps.times,
392
- value: timeValue
393
- })), isClearable && !isDisabled ? jsx("button", {
394
- css: iconContainerStyles,
395
- onClick: this.onClear,
396
- "data-testid": testId && "".concat(testId, "--icon--container"),
397
- tabIndex: -1,
398
- type: "button"
399
- }, jsx(SelectClearIcon, {
400
- LEGACY_size: "small",
401
- color: "currentColor",
402
- label: clearControlLabel
403
- }), ' ') : null);
404
- }
405
- }]);
406
- }(React.Component);
407
- _defineProperty(DateTimePickerComponent, "defaultProps", dateTimePickerDefaultProps);
408
- export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
409
-
410
- /**
411
- * __Date time picker__
412
- *
413
- * A date time picker allows the user to select an associated date and time.
414
- *
415
- * - [Examples](https://atlassian.design/components/datetime-picker/examples)
416
- * - [Code](https://atlassian.design/components/datetime-picker/code)
417
- * - [Usage](https://atlassian.design/components/datetime-picker/usage)
418
- */
419
- var DateTimePicker = withAnalyticsContext({
420
- componentName: 'dateTimePicker',
421
- packageName: packageName,
422
- packageVersion: packageVersion
423
- })(withAnalyticsEvents({
424
- onChange: createAndFireEvent('atlaskit')({
425
- action: 'changed',
426
- actionSubject: 'dateTimePicker',
427
- attributes: {
428
- componentName: 'dateTimePicker',
429
- packageName: packageName,
430
- packageVersion: packageVersion
431
- }
432
- })
433
- })(DateTimePickerComponent));
434
- export default DateTimePicker;