@atlaskit/datetime-picker 12.1.2 → 12.1.3
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 +7 -0
- package/dist/cjs/components/date-picker.js +3 -10
- package/dist/cjs/components/date-time-picker.js +10 -2
- package/dist/cjs/components/time-picker.js +3 -12
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/date-picker.js +3 -10
- package/dist/es2019/components/date-time-picker.js +10 -2
- package/dist/es2019/components/time-picker.js +3 -11
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/date-picker.js +4 -12
- package/dist/esm/components/date-time-picker.js +10 -2
- package/dist/esm/components/time-picker.js +3 -12
- package/dist/esm/version.json +1 -1
- package/dist/types/components/date-picker.d.ts +0 -5
- package/dist/types/components/time-picker.d.ts +1 -10
- package/dist/types/types.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 12.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`299e4104e10`](https://bitbucket.org/atlassian/atlassian-frontend/commits/299e4104e10) - [ux] Added appearance 'none' option to component and adopts appearance handling from @atlaskit/select
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 12.1.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -68,7 +68,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
68
68
|
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; } }
|
|
69
69
|
|
|
70
70
|
var packageName = "@atlaskit/datetime-picker";
|
|
71
|
-
var packageVersion = "12.1.
|
|
71
|
+
var packageVersion = "12.1.3";
|
|
72
72
|
/* eslint-disable react/no-unused-prop-types */
|
|
73
73
|
|
|
74
74
|
function getDateObj(date) {
|
|
@@ -400,13 +400,6 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
400
400
|
_this.forceUpdate();
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSubtleControlStyles", function () {
|
|
404
|
-
return {
|
|
405
|
-
border: "2px solid ".concat(_this.getSafeState().isFocused ? "var(--ds-border-focused, ".concat(_colors.B100, ")") : "transparent"),
|
|
406
|
-
backgroundColor: _this.getSafeState().isOpen ? "var(--ds-background-input-pressed, transparent)" : 'transparent',
|
|
407
|
-
padding: '1px'
|
|
408
|
-
};
|
|
409
|
-
});
|
|
410
403
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "parseDate", function (date) {
|
|
411
404
|
var _this$props = _this.props,
|
|
412
405
|
parseInputValue = _this$props.parseInputValue,
|
|
@@ -524,7 +517,6 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
524
517
|
|
|
525
518
|
var _selectProps$styles = selectProps.styles,
|
|
526
519
|
selectStyles = _selectProps$styles === void 0 ? {} : _selectProps$styles;
|
|
527
|
-
var controlStyles = appearance === 'subtle' ? this.getSubtleControlStyles() : {};
|
|
528
520
|
var disabledStyle = isDisabled ? {
|
|
529
521
|
pointerEvents: 'none'
|
|
530
522
|
} : {};
|
|
@@ -558,6 +550,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
558
550
|
value: value,
|
|
559
551
|
"data-testid": testId && "".concat(testId, "--input")
|
|
560
552
|
}), (0, _core.jsx)(_select.default, (0, _extends2.default)({
|
|
553
|
+
appearance: this.props.appearance,
|
|
561
554
|
enableAnimation: false,
|
|
562
555
|
menuIsOpen: menuIsOpen,
|
|
563
556
|
closeMenuOnSelect: true,
|
|
@@ -572,7 +565,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
572
565
|
onChange: this.onSelectChange,
|
|
573
566
|
styles: (0, _select.mergeStyles)(selectStyles, {
|
|
574
567
|
control: function control(base) {
|
|
575
|
-
return _objectSpread(_objectSpread(
|
|
568
|
+
return _objectSpread(_objectSpread({}, base), disabledStyle);
|
|
576
569
|
},
|
|
577
570
|
indicatorsContainer: function indicatorsContainer(base) {
|
|
578
571
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
@@ -58,7 +58,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
58
58
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
59
|
|
|
60
60
|
var packageName = "@atlaskit/datetime-picker";
|
|
61
|
-
var packageVersion = "12.1.
|
|
61
|
+
var packageVersion = "12.1.3";
|
|
62
62
|
/* eslint-disable react/no-unused-prop-types */
|
|
63
63
|
|
|
64
64
|
var isInvalidBorderStyles = (0, _core.css)({
|
|
@@ -78,6 +78,14 @@ var subtleFocusedBgStyles = (0, _core.css)({
|
|
|
78
78
|
backgroundColor: "var(--ds-background-input-pressed, transparent)",
|
|
79
79
|
borderColor: 'transparent'
|
|
80
80
|
});
|
|
81
|
+
var noBgStyles = (0, _core.css)({
|
|
82
|
+
backgroundColor: 'transparent',
|
|
83
|
+
borderColor: 'transparent',
|
|
84
|
+
'&:hover': {
|
|
85
|
+
backgroundColor: 'transparent',
|
|
86
|
+
borderColor: 'transparent'
|
|
87
|
+
}
|
|
88
|
+
});
|
|
81
89
|
var hoverStyles = (0, _core.css)({
|
|
82
90
|
'&:hover': {
|
|
83
91
|
backgroundColor: "var(--ds-background-input-hovered, ".concat(_colors.N30, ")"),
|
|
@@ -332,7 +340,7 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
332
340
|
var notFocusedOrIsDisabled = !(isFocused || isDisabled);
|
|
333
341
|
var labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
|
|
334
342
|
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
335
|
-
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles)]
|
|
343
|
+
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
|
|
336
344
|
}, innerProps, {
|
|
337
345
|
"data-testid": testId
|
|
338
346
|
}), (0, _core.jsx)("input", {
|
|
@@ -39,8 +39,6 @@ var _locale = require("@atlaskit/locale");
|
|
|
39
39
|
|
|
40
40
|
var _select = _interopRequireWildcard(require("@atlaskit/select"));
|
|
41
41
|
|
|
42
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
43
|
-
|
|
44
42
|
var _constants = require("@atlaskit/theme/constants");
|
|
45
43
|
|
|
46
44
|
var _internal = require("../internal");
|
|
@@ -67,7 +65,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
67
65
|
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; } }
|
|
68
66
|
|
|
69
67
|
var packageName = "@atlaskit/datetime-picker";
|
|
70
|
-
var packageVersion = "12.1.
|
|
68
|
+
var packageVersion = "12.1.3";
|
|
71
69
|
var menuStyles = {
|
|
72
70
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
73
71
|
position: 'static',
|
|
@@ -242,13 +240,6 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
242
240
|
});
|
|
243
241
|
}
|
|
244
242
|
});
|
|
245
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSubtleControlStyles", function (selectStyles) {
|
|
246
|
-
return !selectStyles.control ? {
|
|
247
|
-
border: "2px solid ".concat(_this.getSafeState().isFocused ? "var(--ds-border-focused, ".concat(_colors.B100, ")") : "transparent"),
|
|
248
|
-
backgroundColor: _this.getSafeState().isFocused ? "var(--ds-background-input-pressed, transparent)" : 'transparent',
|
|
249
|
-
padding: '1px'
|
|
250
|
-
} : {};
|
|
251
|
-
});
|
|
252
243
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatTime", function (time) {
|
|
253
244
|
var _this$props2 = _this.props,
|
|
254
245
|
formatDisplayLabel = _this$props2.formatDisplayLabel,
|
|
@@ -341,7 +332,6 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
341
332
|
var _selectProps$styles = selectProps.styles,
|
|
342
333
|
selectStyles = _selectProps$styles === void 0 ? {} : _selectProps$styles,
|
|
343
334
|
otherSelectProps = (0, _objectWithoutProperties2.default)(selectProps, _excluded2);
|
|
344
|
-
var controlStyles = this.props.appearance === 'subtle' ? this.getSubtleControlStyles(selectStyles) : {};
|
|
345
335
|
var SelectComponent = this.props.timeIsEditable ? _select.CreatableSelect : _select.default;
|
|
346
336
|
var labelAndValue = value && {
|
|
347
337
|
label: this.formatTime(value),
|
|
@@ -359,7 +349,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
359
349
|
var renderIconContainer = Boolean(!hideIcon && value);
|
|
360
350
|
var mergedStyles = (0, _select.mergeStyles)(selectStyles, {
|
|
361
351
|
control: function control(base) {
|
|
362
|
-
return _objectSpread(
|
|
352
|
+
return _objectSpread({}, base);
|
|
363
353
|
},
|
|
364
354
|
menu: function menu(base) {
|
|
365
355
|
return _objectSpread(_objectSpread(_objectSpread({}, base), menuStyles), {}, {
|
|
@@ -388,6 +378,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
388
378
|
type: "hidden",
|
|
389
379
|
value: value
|
|
390
380
|
}), /*#__PURE__*/_react.default.createElement(SelectComponent, (0, _extends2.default)({
|
|
381
|
+
appearance: this.props.appearance,
|
|
391
382
|
autoFocus: autoFocus,
|
|
392
383
|
components: selectComponents,
|
|
393
384
|
instanceId: id,
|
package/dist/cjs/version.json
CHANGED
|
@@ -14,13 +14,13 @@ import Calendar from '@atlaskit/calendar';
|
|
|
14
14
|
import CalendarIcon from '@atlaskit/icon/glyph/calendar';
|
|
15
15
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
16
16
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
17
|
-
import {
|
|
17
|
+
import { N20, N50A, N60A } from '@atlaskit/theme/colors';
|
|
18
18
|
import { borderRadius, gridSize, layers } from '@atlaskit/theme/constants';
|
|
19
19
|
import { defaultDateFormat, EmptyClearIndicator, padToTwo, placeholderDatetime } from '../internal';
|
|
20
20
|
import FixedLayer from '../internal/fixed-layer';
|
|
21
21
|
import { convertTokens } from './utils';
|
|
22
22
|
const packageName = "@atlaskit/datetime-picker";
|
|
23
|
-
const packageVersion = "12.1.
|
|
23
|
+
const packageVersion = "12.1.3";
|
|
24
24
|
/* eslint-disable react/no-unused-prop-types */
|
|
25
25
|
|
|
26
26
|
function getDateObj(date) {
|
|
@@ -351,12 +351,6 @@ class DatePicker extends Component {
|
|
|
351
351
|
}
|
|
352
352
|
});
|
|
353
353
|
|
|
354
|
-
_defineProperty(this, "getSubtleControlStyles", () => ({
|
|
355
|
-
border: `2px solid ${this.getSafeState().isFocused ? `var(--ds-border-focused, ${B100})` : `transparent`}`,
|
|
356
|
-
backgroundColor: this.getSafeState().isOpen ? "var(--ds-background-input-pressed, transparent)" : 'transparent',
|
|
357
|
-
padding: '1px'
|
|
358
|
-
}));
|
|
359
|
-
|
|
360
354
|
_defineProperty(this, "parseDate", date => {
|
|
361
355
|
const {
|
|
362
356
|
parseInputValue,
|
|
@@ -477,7 +471,6 @@ class DatePicker extends Component {
|
|
|
477
471
|
const {
|
|
478
472
|
styles: selectStyles = {}
|
|
479
473
|
} = selectProps;
|
|
480
|
-
const controlStyles = appearance === 'subtle' ? this.getSubtleControlStyles() : {};
|
|
481
474
|
const disabledStyle = isDisabled ? {
|
|
482
475
|
pointerEvents: 'none'
|
|
483
476
|
} : {};
|
|
@@ -511,6 +504,7 @@ class DatePicker extends Component {
|
|
|
511
504
|
value: value,
|
|
512
505
|
"data-testid": testId && `${testId}--input`
|
|
513
506
|
}), jsx(Select, _extends({
|
|
507
|
+
appearance: this.props.appearance,
|
|
514
508
|
enableAnimation: false,
|
|
515
509
|
menuIsOpen: menuIsOpen,
|
|
516
510
|
closeMenuOnSelect: true,
|
|
@@ -525,7 +519,6 @@ class DatePicker extends Component {
|
|
|
525
519
|
onChange: this.onSelectChange,
|
|
526
520
|
styles: mergeStyles(selectStyles, {
|
|
527
521
|
control: base => ({ ...base,
|
|
528
|
-
...controlStyles,
|
|
529
522
|
...disabledStyle
|
|
530
523
|
}),
|
|
531
524
|
indicatorsContainer: base => ({ ...base,
|
|
@@ -19,7 +19,7 @@ import DatePicker from './date-picker';
|
|
|
19
19
|
import TimePicker from './time-picker';
|
|
20
20
|
import { convertTokens } from './utils';
|
|
21
21
|
const packageName = "@atlaskit/datetime-picker";
|
|
22
|
-
const packageVersion = "12.1.
|
|
22
|
+
const packageVersion = "12.1.3";
|
|
23
23
|
/* eslint-disable react/no-unused-prop-types */
|
|
24
24
|
|
|
25
25
|
const isInvalidBorderStyles = css({
|
|
@@ -39,6 +39,14 @@ const subtleFocusedBgStyles = css({
|
|
|
39
39
|
backgroundColor: "var(--ds-background-input-pressed, transparent)",
|
|
40
40
|
borderColor: 'transparent'
|
|
41
41
|
});
|
|
42
|
+
const noBgStyles = css({
|
|
43
|
+
backgroundColor: 'transparent',
|
|
44
|
+
borderColor: 'transparent',
|
|
45
|
+
'&:hover': {
|
|
46
|
+
backgroundColor: 'transparent',
|
|
47
|
+
borderColor: 'transparent'
|
|
48
|
+
}
|
|
49
|
+
});
|
|
42
50
|
const hoverStyles = css({
|
|
43
51
|
'&:hover': {
|
|
44
52
|
backgroundColor: `var(--ds-background-input-hovered, ${N30})`,
|
|
@@ -281,7 +289,7 @@ class DateTimePicker extends React.Component {
|
|
|
281
289
|
const notFocusedOrIsDisabled = !(isFocused || isDisabled);
|
|
282
290
|
const labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
|
|
283
291
|
return jsx("div", _extends({
|
|
284
|
-
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles)]
|
|
292
|
+
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
|
|
285
293
|
}, innerProps, {
|
|
286
294
|
"data-testid": testId
|
|
287
295
|
}), jsx("input", {
|
|
@@ -9,14 +9,13 @@ import pick from 'lodash/pick';
|
|
|
9
9
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
11
11
|
import Select, { components, CreatableSelect, mergeStyles } from '@atlaskit/select';
|
|
12
|
-
import { B100 } from '@atlaskit/theme/colors';
|
|
13
12
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
14
13
|
import { defaultTimeFormat, defaultTimes, DropdownIndicator, EmptyClearIndicator, placeholderDatetime } from '../internal';
|
|
15
14
|
import FixedLayer from '../internal/fixed-layer';
|
|
16
15
|
import parseTime from '../internal/parse-time';
|
|
17
16
|
import { convertTokens } from './utils';
|
|
18
17
|
const packageName = "@atlaskit/datetime-picker";
|
|
19
|
-
const packageVersion = "12.1.
|
|
18
|
+
const packageVersion = "12.1.3";
|
|
20
19
|
const menuStyles = {
|
|
21
20
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
22
21
|
position: 'static',
|
|
@@ -188,12 +187,6 @@ class TimePicker extends React.Component {
|
|
|
188
187
|
}
|
|
189
188
|
});
|
|
190
189
|
|
|
191
|
-
_defineProperty(this, "getSubtleControlStyles", selectStyles => !selectStyles.control ? {
|
|
192
|
-
border: `2px solid ${this.getSafeState().isFocused ? `var(--ds-border-focused, ${B100})` : `transparent`}`,
|
|
193
|
-
backgroundColor: this.getSafeState().isFocused ? "var(--ds-background-input-pressed, transparent)" : 'transparent',
|
|
194
|
-
padding: '1px'
|
|
195
|
-
} : {});
|
|
196
|
-
|
|
197
190
|
_defineProperty(this, "formatTime", time => {
|
|
198
191
|
const {
|
|
199
192
|
formatDisplayLabel,
|
|
@@ -281,7 +274,6 @@ class TimePicker extends React.Component {
|
|
|
281
274
|
styles: selectStyles = {},
|
|
282
275
|
...otherSelectProps
|
|
283
276
|
} = selectProps;
|
|
284
|
-
const controlStyles = this.props.appearance === 'subtle' ? this.getSubtleControlStyles(selectStyles) : {};
|
|
285
277
|
const SelectComponent = this.props.timeIsEditable ? CreatableSelect : Select;
|
|
286
278
|
const labelAndValue = value && {
|
|
287
279
|
label: this.formatTime(value),
|
|
@@ -298,8 +290,7 @@ class TimePicker extends React.Component {
|
|
|
298
290
|
|
|
299
291
|
const renderIconContainer = Boolean(!hideIcon && value);
|
|
300
292
|
const mergedStyles = mergeStyles(selectStyles, {
|
|
301
|
-
control: base => ({ ...base
|
|
302
|
-
...controlStyles
|
|
293
|
+
control: base => ({ ...base
|
|
303
294
|
}),
|
|
304
295
|
menu: base => ({ ...base,
|
|
305
296
|
...menuStyles,
|
|
@@ -325,6 +316,7 @@ class TimePicker extends React.Component {
|
|
|
325
316
|
type: "hidden",
|
|
326
317
|
value: value
|
|
327
318
|
}), /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
319
|
+
appearance: this.props.appearance,
|
|
328
320
|
autoFocus: autoFocus,
|
|
329
321
|
components: selectComponents,
|
|
330
322
|
instanceId: id,
|
package/dist/es2019/version.json
CHANGED
|
@@ -29,13 +29,13 @@ import Calendar from '@atlaskit/calendar';
|
|
|
29
29
|
import CalendarIcon from '@atlaskit/icon/glyph/calendar';
|
|
30
30
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
31
31
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
32
|
-
import {
|
|
32
|
+
import { N20, N50A, N60A } from '@atlaskit/theme/colors';
|
|
33
33
|
import { borderRadius, gridSize, layers } from '@atlaskit/theme/constants';
|
|
34
34
|
import { defaultDateFormat, EmptyClearIndicator, padToTwo, placeholderDatetime } from '../internal';
|
|
35
35
|
import FixedLayer from '../internal/fixed-layer';
|
|
36
36
|
import { convertTokens } from './utils';
|
|
37
37
|
var packageName = "@atlaskit/datetime-picker";
|
|
38
|
-
var packageVersion = "12.1.
|
|
38
|
+
var packageVersion = "12.1.3";
|
|
39
39
|
/* eslint-disable react/no-unused-prop-types */
|
|
40
40
|
|
|
41
41
|
function getDateObj(date) {
|
|
@@ -385,14 +385,6 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
385
385
|
}
|
|
386
386
|
});
|
|
387
387
|
|
|
388
|
-
_defineProperty(_assertThisInitialized(_this), "getSubtleControlStyles", function () {
|
|
389
|
-
return {
|
|
390
|
-
border: "2px solid ".concat(_this.getSafeState().isFocused ? "var(--ds-border-focused, ".concat(B100, ")") : "transparent"),
|
|
391
|
-
backgroundColor: _this.getSafeState().isOpen ? "var(--ds-background-input-pressed, transparent)" : 'transparent',
|
|
392
|
-
padding: '1px'
|
|
393
|
-
};
|
|
394
|
-
});
|
|
395
|
-
|
|
396
388
|
_defineProperty(_assertThisInitialized(_this), "parseDate", function (date) {
|
|
397
389
|
var _this$props = _this.props,
|
|
398
390
|
parseInputValue = _this$props.parseInputValue,
|
|
@@ -512,7 +504,6 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
512
504
|
|
|
513
505
|
var _selectProps$styles = selectProps.styles,
|
|
514
506
|
selectStyles = _selectProps$styles === void 0 ? {} : _selectProps$styles;
|
|
515
|
-
var controlStyles = appearance === 'subtle' ? this.getSubtleControlStyles() : {};
|
|
516
507
|
var disabledStyle = isDisabled ? {
|
|
517
508
|
pointerEvents: 'none'
|
|
518
509
|
} : {};
|
|
@@ -546,6 +537,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
546
537
|
value: value,
|
|
547
538
|
"data-testid": testId && "".concat(testId, "--input")
|
|
548
539
|
}), jsx(Select, _extends({
|
|
540
|
+
appearance: this.props.appearance,
|
|
549
541
|
enableAnimation: false,
|
|
550
542
|
menuIsOpen: menuIsOpen,
|
|
551
543
|
closeMenuOnSelect: true,
|
|
@@ -560,7 +552,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
560
552
|
onChange: this.onSelectChange,
|
|
561
553
|
styles: mergeStyles(selectStyles, {
|
|
562
554
|
control: function control(base) {
|
|
563
|
-
return _objectSpread(_objectSpread(
|
|
555
|
+
return _objectSpread(_objectSpread({}, base), disabledStyle);
|
|
564
556
|
},
|
|
565
557
|
indicatorsContainer: function indicatorsContainer(base) {
|
|
566
558
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
@@ -33,7 +33,7 @@ import DatePicker from './date-picker';
|
|
|
33
33
|
import TimePicker from './time-picker';
|
|
34
34
|
import { convertTokens } from './utils';
|
|
35
35
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "12.1.
|
|
36
|
+
var packageVersion = "12.1.3";
|
|
37
37
|
/* eslint-disable react/no-unused-prop-types */
|
|
38
38
|
|
|
39
39
|
var isInvalidBorderStyles = css({
|
|
@@ -53,6 +53,14 @@ var subtleFocusedBgStyles = css({
|
|
|
53
53
|
backgroundColor: "var(--ds-background-input-pressed, transparent)",
|
|
54
54
|
borderColor: 'transparent'
|
|
55
55
|
});
|
|
56
|
+
var noBgStyles = css({
|
|
57
|
+
backgroundColor: 'transparent',
|
|
58
|
+
borderColor: 'transparent',
|
|
59
|
+
'&:hover': {
|
|
60
|
+
backgroundColor: 'transparent',
|
|
61
|
+
borderColor: 'transparent'
|
|
62
|
+
}
|
|
63
|
+
});
|
|
56
64
|
var hoverStyles = css({
|
|
57
65
|
'&:hover': {
|
|
58
66
|
backgroundColor: "var(--ds-background-input-hovered, ".concat(N30, ")"),
|
|
@@ -315,7 +323,7 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
315
323
|
var notFocusedOrIsDisabled = !(isFocused || isDisabled);
|
|
316
324
|
var labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
|
|
317
325
|
return jsx("div", _extends({
|
|
318
|
-
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles)]
|
|
326
|
+
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
|
|
319
327
|
}, innerProps, {
|
|
320
328
|
"data-testid": testId
|
|
321
329
|
}), jsx("input", {
|
|
@@ -26,14 +26,13 @@ import pick from 'lodash/pick';
|
|
|
26
26
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
27
27
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
28
28
|
import Select, { components, CreatableSelect, mergeStyles } from '@atlaskit/select';
|
|
29
|
-
import { B100 } from '@atlaskit/theme/colors';
|
|
30
29
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
31
30
|
import { defaultTimeFormat, defaultTimes, DropdownIndicator, EmptyClearIndicator, placeholderDatetime } from '../internal';
|
|
32
31
|
import FixedLayer from '../internal/fixed-layer';
|
|
33
32
|
import parseTime from '../internal/parse-time';
|
|
34
33
|
import { convertTokens } from './utils';
|
|
35
34
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "12.1.
|
|
35
|
+
var packageVersion = "12.1.3";
|
|
37
36
|
var menuStyles = {
|
|
38
37
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
39
38
|
position: 'static',
|
|
@@ -221,14 +220,6 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
221
220
|
}
|
|
222
221
|
});
|
|
223
222
|
|
|
224
|
-
_defineProperty(_assertThisInitialized(_this), "getSubtleControlStyles", function (selectStyles) {
|
|
225
|
-
return !selectStyles.control ? {
|
|
226
|
-
border: "2px solid ".concat(_this.getSafeState().isFocused ? "var(--ds-border-focused, ".concat(B100, ")") : "transparent"),
|
|
227
|
-
backgroundColor: _this.getSafeState().isFocused ? "var(--ds-background-input-pressed, transparent)" : 'transparent',
|
|
228
|
-
padding: '1px'
|
|
229
|
-
} : {};
|
|
230
|
-
});
|
|
231
|
-
|
|
232
223
|
_defineProperty(_assertThisInitialized(_this), "formatTime", function (time) {
|
|
233
224
|
var _this$props2 = _this.props,
|
|
234
225
|
formatDisplayLabel = _this$props2.formatDisplayLabel,
|
|
@@ -325,7 +316,6 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
325
316
|
selectStyles = _selectProps$styles === void 0 ? {} : _selectProps$styles,
|
|
326
317
|
otherSelectProps = _objectWithoutProperties(selectProps, _excluded2);
|
|
327
318
|
|
|
328
|
-
var controlStyles = this.props.appearance === 'subtle' ? this.getSubtleControlStyles(selectStyles) : {};
|
|
329
319
|
var SelectComponent = this.props.timeIsEditable ? CreatableSelect : Select;
|
|
330
320
|
var labelAndValue = value && {
|
|
331
321
|
label: this.formatTime(value),
|
|
@@ -343,7 +333,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
343
333
|
var renderIconContainer = Boolean(!hideIcon && value);
|
|
344
334
|
var mergedStyles = mergeStyles(selectStyles, {
|
|
345
335
|
control: function control(base) {
|
|
346
|
-
return _objectSpread(
|
|
336
|
+
return _objectSpread({}, base);
|
|
347
337
|
},
|
|
348
338
|
menu: function menu(base) {
|
|
349
339
|
return _objectSpread(_objectSpread(_objectSpread({}, base), menuStyles), {}, {
|
|
@@ -372,6 +362,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
372
362
|
type: "hidden",
|
|
373
363
|
value: value
|
|
374
364
|
}), /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
365
|
+
appearance: this.props.appearance,
|
|
375
366
|
autoFocus: autoFocus,
|
|
376
367
|
components: selectComponents,
|
|
377
368
|
instanceId: id,
|
package/dist/esm/version.json
CHANGED
|
@@ -244,11 +244,6 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
244
244
|
refCalendar: (ref: CalendarRef | null) => void;
|
|
245
245
|
handleInputChange: (inputValue: string, actionMeta: {}) => void;
|
|
246
246
|
getContainerRef: (ref: HTMLElement | null) => void;
|
|
247
|
-
getSubtleControlStyles: () => {
|
|
248
|
-
border: string;
|
|
249
|
-
backgroundColor: string;
|
|
250
|
-
padding: string;
|
|
251
|
-
};
|
|
252
247
|
/**
|
|
253
248
|
* There are two props that can change how the date is parsed.
|
|
254
249
|
* The priority of props used is:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { LocalizationProvider } from '@atlaskit/locale';
|
|
4
|
-
import { ActionMeta, OptionType, SelectProps
|
|
4
|
+
import { ActionMeta, OptionType, SelectProps } from '@atlaskit/select';
|
|
5
5
|
import { Appearance, Spacing } from '../types';
|
|
6
6
|
interface Option {
|
|
7
7
|
label: string;
|
|
@@ -192,15 +192,6 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
192
192
|
onBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
193
193
|
onFocus: (event: React.FocusEvent<HTMLElement>) => void;
|
|
194
194
|
onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
195
|
-
getSubtleControlStyles: (selectStyles: StylesConfig) => {
|
|
196
|
-
border: string;
|
|
197
|
-
backgroundColor: string;
|
|
198
|
-
padding: string;
|
|
199
|
-
} | {
|
|
200
|
-
border?: undefined;
|
|
201
|
-
backgroundColor?: undefined;
|
|
202
|
-
padding?: undefined;
|
|
203
|
-
};
|
|
204
195
|
/**
|
|
205
196
|
* There are multiple props that can change how the time is formatted.
|
|
206
197
|
* The priority of props used is:
|
package/dist/types/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.3",
|
|
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/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/icon": "^21.10.0",
|
|
31
31
|
"@atlaskit/locale": "^2.1.0",
|
|
32
32
|
"@atlaskit/popper": "^5.2.0",
|
|
33
|
-
"@atlaskit/select": "^15.
|
|
33
|
+
"@atlaskit/select": "^15.6.0",
|
|
34
34
|
"@atlaskit/theme": "^12.1.0",
|
|
35
35
|
"@atlaskit/tokens": "^0.10.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|