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