@atlaskit/datetime-picker 13.0.0 → 13.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/components/date-picker.js +15 -11
- package/dist/cjs/components/date-time-picker.js +16 -18
- package/dist/cjs/components/time-picker.js +6 -3
- package/dist/cjs/internal/clear-button.js +44 -0
- package/dist/cjs/internal/clear-indicator.js +37 -0
- package/dist/es2019/components/date-picker.js +15 -12
- package/dist/es2019/components/date-time-picker.js +16 -19
- package/dist/es2019/components/time-picker.js +6 -3
- package/dist/es2019/internal/clear-button.js +36 -0
- package/dist/es2019/internal/clear-indicator.js +29 -0
- package/dist/esm/components/date-picker.js +15 -12
- package/dist/esm/components/date-time-picker.js +16 -19
- package/dist/esm/components/time-picker.js +6 -3
- package/dist/esm/internal/clear-button.js +37 -0
- package/dist/esm/internal/clear-indicator.js +30 -0
- package/dist/types/components/date-picker.d.ts +4 -5
- package/dist/types/components/date-time-picker.d.ts +3 -4
- package/dist/types/components/time-picker.d.ts +4 -3
- package/dist/types/internal/clear-button.d.ts +17 -0
- package/dist/types/internal/clear-indicator.d.ts +10 -0
- package/dist/types-ts4.5/components/date-picker.d.ts +4 -5
- package/dist/types-ts4.5/components/date-time-picker.d.ts +3 -4
- package/dist/types-ts4.5/components/time-picker.d.ts +4 -3
- package/dist/types-ts4.5/internal/clear-button.d.ts +17 -0
- package/dist/types-ts4.5/internal/clear-indicator.d.ts +10 -0
- package/package.json +6 -5
- package/tmp/api-report-tmp.d.ts +0 -270
|
@@ -11,9 +11,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
11
11
|
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; }
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
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; } }
|
|
14
|
-
/** @jsx jsx */
|
|
15
14
|
import { Component } from 'react';
|
|
16
|
-
import { css
|
|
15
|
+
import { css } from '@emotion/react';
|
|
17
16
|
import { format, isValid, lastDayOfMonth, parseISO } from 'date-fns';
|
|
18
17
|
import pick from 'lodash/pick';
|
|
19
18
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -26,11 +25,12 @@ import Select, { mergeStyles } from '@atlaskit/select';
|
|
|
26
25
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
27
26
|
import { layers } from '@atlaskit/theme/constants';
|
|
28
27
|
import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
|
|
28
|
+
import ClearIndicator from '../internal/clear-indicator';
|
|
29
29
|
import FixedLayer from '../internal/fixed-layer';
|
|
30
30
|
import { makeSingleValue } from '../internal/single-value';
|
|
31
31
|
import { convertTokens } from './utils';
|
|
32
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
33
|
-
var packageVersion = "13.0.
|
|
33
|
+
var packageVersion = "13.0.2";
|
|
34
34
|
function getValidDate(iso) {
|
|
35
35
|
var date = parseISO(iso);
|
|
36
36
|
return isValid(date) ? {
|
|
@@ -52,14 +52,14 @@ var menuStyles = css({
|
|
|
52
52
|
var Menu = function Menu(_ref) {
|
|
53
53
|
var selectProps = _ref.selectProps,
|
|
54
54
|
innerProps = _ref.innerProps;
|
|
55
|
-
return
|
|
55
|
+
return /*#__PURE__*/React.createElement(UNSAFE_LAYERING, {
|
|
56
56
|
isDisabled: getBooleanFF('platform.design-system-team.layering_qmiw3') ? false : true
|
|
57
|
-
},
|
|
57
|
+
}, /*#__PURE__*/React.createElement(FixedLayer, {
|
|
58
58
|
inputValue: selectProps.inputValue,
|
|
59
59
|
containerRef: selectProps.calendarContainerRef,
|
|
60
|
-
content:
|
|
60
|
+
content: /*#__PURE__*/React.createElement("div", _extends({
|
|
61
61
|
css: menuStyles
|
|
62
|
-
}, innerProps),
|
|
62
|
+
}, innerProps), /*#__PURE__*/React.createElement(Calendar, _extends({}, getValidDate(selectProps.calendarValue), getValidDate(selectProps.calendarView), {
|
|
63
63
|
disabled: selectProps.calendarDisabled,
|
|
64
64
|
disabledDateFilter: selectProps.calendarDisabledDateFilter,
|
|
65
65
|
minDate: selectProps.calendarMinDate,
|
|
@@ -430,7 +430,9 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
430
430
|
DropdownIndicator: dropDownIcon,
|
|
431
431
|
Menu: Menu,
|
|
432
432
|
SingleValue: SingleValue
|
|
433
|
-
},
|
|
433
|
+
}, showClearIndicator ? {
|
|
434
|
+
ClearIndicator: ClearIndicator
|
|
435
|
+
} : {
|
|
434
436
|
ClearIndicator: EmptyComponent
|
|
435
437
|
});
|
|
436
438
|
var _selectProps$styles = selectProps.styles,
|
|
@@ -456,9 +458,10 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
456
458
|
previousMonthLabel: previousMonthLabel
|
|
457
459
|
};
|
|
458
460
|
return (
|
|
461
|
+
/*#__PURE__*/
|
|
459
462
|
// These event handlers must be on this element because the events come
|
|
460
463
|
// from different child elements.
|
|
461
|
-
|
|
464
|
+
React.createElement("div", _extends({}, innerProps, {
|
|
462
465
|
role: "presentation",
|
|
463
466
|
onBlur: this.onContainerBlur,
|
|
464
467
|
onClick: this.onInputClick,
|
|
@@ -466,18 +469,18 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
466
469
|
onKeyDown: this.onInputKeyDown,
|
|
467
470
|
ref: this.getContainerRef,
|
|
468
471
|
"data-testid": testId && "".concat(testId, "--container")
|
|
469
|
-
}),
|
|
472
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
470
473
|
name: name,
|
|
471
474
|
type: "hidden",
|
|
472
475
|
value: value,
|
|
473
476
|
"data-testid": testId && "".concat(testId, "--input")
|
|
474
|
-
}),
|
|
477
|
+
}), /*#__PURE__*/React.createElement(Select, _extends({
|
|
475
478
|
appearance: this.props.appearance,
|
|
476
479
|
enableAnimation: false,
|
|
477
480
|
menuIsOpen: menuIsOpen,
|
|
478
481
|
closeMenuOnSelect: true,
|
|
479
482
|
autoFocus: autoFocus,
|
|
480
|
-
|
|
483
|
+
inputId: id,
|
|
481
484
|
isDisabled: isDisabled,
|
|
482
485
|
onBlur: this.onSelectBlur,
|
|
483
486
|
onFocus: this.onSelectFocus,
|
|
@@ -10,22 +10,21 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
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; } }
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
|
-
/** @jsx jsx */
|
|
14
13
|
import React from 'react';
|
|
15
|
-
import { css
|
|
14
|
+
import { css } from '@emotion/react';
|
|
16
15
|
import { format, isValid, parseISO } from 'date-fns';
|
|
17
16
|
import pick from 'lodash/pick';
|
|
18
17
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
19
|
-
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
20
18
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
21
19
|
import { mergeStyles } from '@atlaskit/select';
|
|
22
20
|
import { B100, N0, N100, N20, N30, N500, N70, R400 } from '@atlaskit/theme/colors';
|
|
23
21
|
import { defaultTimes, formatDateTimeZoneIntoIso } from '../internal';
|
|
22
|
+
import ClearButton from '../internal/clear-button';
|
|
24
23
|
import DatePicker from './date-picker';
|
|
25
24
|
import TimePicker from './time-picker';
|
|
26
25
|
import { convertTokens } from './utils';
|
|
27
26
|
var packageName = "@atlaskit/datetime-picker";
|
|
28
|
-
var packageVersion = "13.0.
|
|
27
|
+
var packageVersion = "13.0.2";
|
|
29
28
|
var isInvalidBorderStyles = css({
|
|
30
29
|
borderColor: "var(--ds-border-danger, ".concat(R400, ")")
|
|
31
30
|
});
|
|
@@ -299,18 +298,20 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
299
298
|
// Don't use Date or TimePicker's because they can't be customised
|
|
300
299
|
var isClearable = Boolean(dateValue || timeValue);
|
|
301
300
|
var notFocusedOrIsDisabled = !(isFocused || isDisabled);
|
|
302
|
-
|
|
301
|
+
var ariaLabelledbyId = id && "label--".concat(id);
|
|
302
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
303
303
|
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]
|
|
304
304
|
}, innerProps, {
|
|
305
|
+
"aria-labelledby": innerProps['aria-labelledby'] || ariaLabelledbyId,
|
|
305
306
|
"data-testid": testId
|
|
306
|
-
}),
|
|
307
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
307
308
|
name: name,
|
|
308
309
|
type: "hidden",
|
|
309
310
|
value: value,
|
|
310
311
|
"data-testid": testId && "".concat(testId, "--input")
|
|
311
|
-
}),
|
|
312
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
312
313
|
css: datePickerContainerStyles
|
|
313
|
-
},
|
|
314
|
+
}, /*#__PURE__*/React.createElement(DatePicker, _extends({}, bothProps, {
|
|
314
315
|
autoFocus: autoFocus,
|
|
315
316
|
dateFormat: dateFormat,
|
|
316
317
|
hideIcon: true,
|
|
@@ -320,9 +321,9 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
320
321
|
value: dateValue,
|
|
321
322
|
locale: locale,
|
|
322
323
|
testId: testId && "".concat(testId, "--datepicker")
|
|
323
|
-
}, datePickerProps))),
|
|
324
|
+
}, datePickerProps))), /*#__PURE__*/React.createElement("div", {
|
|
324
325
|
css: timePickerContainerStyles
|
|
325
|
-
},
|
|
326
|
+
}, /*#__PURE__*/React.createElement(TimePicker, _extends({}, bothProps, {
|
|
326
327
|
hideIcon: true,
|
|
327
328
|
onChange: this.onTimeChange,
|
|
328
329
|
selectProps: mergedTimePickerSelectProps,
|
|
@@ -332,17 +333,13 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
332
333
|
timeFormat: timeFormat,
|
|
333
334
|
locale: locale,
|
|
334
335
|
testId: testId && "".concat(testId, "--timepicker")
|
|
335
|
-
}, timePickerProps))), isClearable && !isDisabled ?
|
|
336
|
-
|
|
336
|
+
}, timePickerProps))), isClearable && !isDisabled ? /*#__PURE__*/React.createElement(ClearButton, {
|
|
337
|
+
inputId: id,
|
|
338
|
+
buttonStyles: iconContainerStyles,
|
|
337
339
|
onClick: this.onClear,
|
|
338
340
|
"data-testid": testId && "".concat(testId, "--icon--container"),
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}, jsx(SelectClearIcon, {
|
|
342
|
-
size: "small",
|
|
343
|
-
primaryColor: "inherit",
|
|
344
|
-
label: "clear"
|
|
345
|
-
})) : null);
|
|
341
|
+
primaryColor: "inherit"
|
|
342
|
+
}) : null);
|
|
346
343
|
}
|
|
347
344
|
}]);
|
|
348
345
|
return DateTimePicker;
|
|
@@ -24,12 +24,13 @@ import Select, { components, CreatableSelect, mergeStyles } from '@atlaskit/sele
|
|
|
24
24
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
25
25
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
26
26
|
import { defaultTimeFormat, defaultTimes, EmptyComponent, placeholderDatetime } from '../internal';
|
|
27
|
+
import ClearIndicator from '../internal/clear-indicator';
|
|
27
28
|
import FixedLayer from '../internal/fixed-layer';
|
|
28
29
|
import parseTime from '../internal/parse-time';
|
|
29
30
|
import { makeSingleValue } from '../internal/single-value';
|
|
30
31
|
import { convertTokens } from './utils';
|
|
31
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
32
|
-
var packageVersion = "13.0.
|
|
33
|
+
var packageVersion = "13.0.2";
|
|
33
34
|
var menuStyles = {
|
|
34
35
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
35
36
|
position: 'static',
|
|
@@ -271,8 +272,10 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
271
272
|
DropdownIndicator: EmptyComponent,
|
|
272
273
|
Menu: FixedLayerMenu,
|
|
273
274
|
SingleValue: SingleValue
|
|
274
|
-
}, hideIcon
|
|
275
|
+
}, hideIcon ? {
|
|
275
276
|
ClearIndicator: EmptyComponent
|
|
277
|
+
} : {
|
|
278
|
+
ClearIndicator: ClearIndicator
|
|
276
279
|
});
|
|
277
280
|
var renderIconContainer = Boolean(!hideIcon && value);
|
|
278
281
|
var mergedStyles = mergeStyles(selectStyles, {
|
|
@@ -306,7 +309,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
306
309
|
appearance: appearance,
|
|
307
310
|
autoFocus: autoFocus,
|
|
308
311
|
components: selectComponents,
|
|
309
|
-
|
|
312
|
+
inputId: id,
|
|
310
313
|
isClearable: true,
|
|
311
314
|
isDisabled: isDisabled,
|
|
312
315
|
menuIsOpen: isOpen && !isDisabled,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
2
|
+
/**
|
|
3
|
+
* __Clear button__
|
|
4
|
+
*/
|
|
5
|
+
var ClearButton = function ClearButton(_ref) {
|
|
6
|
+
var inputId = _ref.inputId,
|
|
7
|
+
_ref$iconSize = _ref.iconSize,
|
|
8
|
+
iconSize = _ref$iconSize === void 0 ? 'small' : _ref$iconSize,
|
|
9
|
+
_ref$label = _ref.label,
|
|
10
|
+
label = _ref$label === void 0 ? 'Clear' : _ref$label,
|
|
11
|
+
primaryColor = _ref.primaryColor,
|
|
12
|
+
buttonStyles = _ref.buttonStyles,
|
|
13
|
+
dataTestId = _ref.dataTestId,
|
|
14
|
+
onClick = _ref.onClick;
|
|
15
|
+
var labelId = inputId && "label--".concat(inputId);
|
|
16
|
+
var clearButtonId = inputId && "clear-btn--".concat(inputId);
|
|
17
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
18
|
+
"aria-labelledby": inputId ? "".concat(clearButtonId, " ").concat(labelId) : "".concat(clearButtonId),
|
|
19
|
+
css: buttonStyles,
|
|
20
|
+
type: "button",
|
|
21
|
+
tabIndex: -1,
|
|
22
|
+
"data-testid": "".concat(dataTestId, "--clear--btn"),
|
|
23
|
+
onClick: onClick
|
|
24
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
hidden: true,
|
|
26
|
+
id: clearButtonId
|
|
27
|
+
}, "Clear"), /*#__PURE__*/React.createElement("span", {
|
|
28
|
+
style: {
|
|
29
|
+
display: 'flex'
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement(SelectClearIcon, {
|
|
32
|
+
size: iconSize,
|
|
33
|
+
label: inputId ? '' : label,
|
|
34
|
+
primaryColor: primaryColor
|
|
35
|
+
})));
|
|
36
|
+
};
|
|
37
|
+
export default ClearButton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import { css } from '@emotion/react';
|
|
5
|
+
import { components } from '@atlaskit/select';
|
|
6
|
+
import ClearButton from './clear-button';
|
|
7
|
+
var buttonStyles = css({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
all: 'unset',
|
|
11
|
+
outline: 'revert'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* __Clear indicator__
|
|
16
|
+
* Overwrites the default `ClearIndicator` button with custom styles and attributes
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
var ClearIndicator = function ClearIndicator(props) {
|
|
20
|
+
return /*#__PURE__*/React.createElement(components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
|
|
21
|
+
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
22
|
+
'aria-hidden': 'false'
|
|
23
|
+
})
|
|
24
|
+
}), /*#__PURE__*/React.createElement(ClearButton, {
|
|
25
|
+
buttonStyles: buttonStyles,
|
|
26
|
+
inputId: props.selectProps.inputId,
|
|
27
|
+
dataTestId: props.selectProps.testId
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export default ClearIndicator;
|
|
@@ -50,9 +50,8 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
50
50
|
*/
|
|
51
51
|
icon?: React.ComponentType<DropdownIndicatorProps<OptionType>>;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* Keep this in mind when needing to refer to the ID. This will be fixed in an upcoming release.
|
|
53
|
+
* Set the id of the field.
|
|
54
|
+
* Associates a `<label></label>` with the field.
|
|
56
55
|
*/
|
|
57
56
|
id?: string;
|
|
58
57
|
/**
|
|
@@ -268,7 +267,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
268
267
|
render(): jsx.JSX.Element;
|
|
269
268
|
}
|
|
270
269
|
export { DatePicker as DatePickerWithoutAnalytics };
|
|
271
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "
|
|
270
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "value" | "placeholder" | "testId" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "dateFormat" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "autoFocus" | "disabled" | "name" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "icon" | "defaultIsOpen" | "disabledDateFilter" | "spacing" | "isInvalid" | "hideIcon" | "locale">> & Partial<Pick<{
|
|
272
271
|
appearance: Appearance;
|
|
273
272
|
autoFocus: boolean;
|
|
274
273
|
defaultIsOpen: boolean;
|
|
@@ -288,5 +287,5 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
|
|
|
288
287
|
selectProps: {};
|
|
289
288
|
spacing: Spacing;
|
|
290
289
|
locale: string;
|
|
291
|
-
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "
|
|
290
|
+
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "autoFocus" | "disabled" | "name" | "value" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "testId" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "icon" | "defaultIsOpen" | "disabledDateFilter" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat" | "locale" | "weekStartDay" | "analyticsContext"> & import("react").RefAttributes<any>>;
|
|
292
291
|
export default _default;
|
|
@@ -22,8 +22,7 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
22
22
|
*/
|
|
23
23
|
defaultValue?: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Keep this in mind when needing to refer to the ID. This will be fixed in an upcoming release.
|
|
25
|
+
* Set the id of the field.
|
|
27
26
|
*/
|
|
28
27
|
id?: string;
|
|
29
28
|
/**
|
|
@@ -194,7 +193,7 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
194
193
|
render(): jsx.JSX.Element;
|
|
195
194
|
}
|
|
196
195
|
export { DateTimePicker as DateTimePickerWithoutAnalytics };
|
|
197
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "
|
|
196
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "value" | "testId" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "times" | "autoFocus" | "name" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "appearance" | "innerProps" | "isDisabled" | "spacing" | "isInvalid" | "locale" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
|
|
198
197
|
appearance: string;
|
|
199
198
|
autoFocus: boolean;
|
|
200
199
|
isDisabled: boolean;
|
|
@@ -214,5 +213,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimeP
|
|
|
214
213
|
times: string[];
|
|
215
214
|
spacing: string;
|
|
216
215
|
locale: string;
|
|
217
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "
|
|
216
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "key" | "autoFocus" | "name" | "value" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "testId" | "appearance" | "innerProps" | "isDisabled" | "spacing" | "isInvalid" | "dateFormat" | "locale" | "analyticsContext" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
|
|
218
217
|
export default _default;
|
|
@@ -27,7 +27,8 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
27
27
|
*/
|
|
28
28
|
formatDisplayLabel?: (time: string, timeFormat: string) => string;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Set the id of the field.
|
|
31
|
+
* Associates a `<label></label>` with the field.
|
|
31
32
|
*/
|
|
32
33
|
id?: string;
|
|
33
34
|
/**
|
|
@@ -188,7 +189,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
188
189
|
render(): JSX.Element;
|
|
189
190
|
}
|
|
190
191
|
export { TimePicker as TimePickerWithoutAnalytics };
|
|
191
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "
|
|
192
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "value" | "placeholder" | "testId" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "times" | "autoFocus" | "name" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "defaultIsOpen" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "timeIsEditable">> & Partial<Pick<{
|
|
192
193
|
appearance: Appearance;
|
|
193
194
|
autoFocus: boolean;
|
|
194
195
|
defaultIsOpen: boolean;
|
|
@@ -208,5 +209,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
|
|
|
208
209
|
times: string[];
|
|
209
210
|
timeIsEditable: boolean;
|
|
210
211
|
locale: string;
|
|
211
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "
|
|
212
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "key" | "autoFocus" | "name" | "value" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "testId" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "analyticsContext" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
212
213
|
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { Size } from '@atlaskit/icon';
|
|
4
|
+
interface ClearButtonProps {
|
|
5
|
+
inputId?: string;
|
|
6
|
+
iconSize?: Size;
|
|
7
|
+
primaryColor?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
buttonStyles?: SerializedStyles;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* __Clear button__
|
|
15
|
+
*/
|
|
16
|
+
declare const ClearButton: ({ inputId, iconSize, label, primaryColor, buttonStyles, dataTestId, onClick, }: ClearButtonProps) => jsx.JSX.Element;
|
|
17
|
+
export default ClearButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { ClearIndicatorProps } from '@atlaskit/select';
|
|
4
|
+
/**
|
|
5
|
+
* __Clear indicator__
|
|
6
|
+
* Overwrites the default `ClearIndicator` button with custom styles and attributes
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
declare const ClearIndicator: FC<ClearIndicatorProps<any>>;
|
|
10
|
+
export default ClearIndicator;
|
|
@@ -50,9 +50,8 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
50
50
|
*/
|
|
51
51
|
icon?: React.ComponentType<DropdownIndicatorProps<OptionType>>;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* Keep this in mind when needing to refer to the ID. This will be fixed in an upcoming release.
|
|
53
|
+
* Set the id of the field.
|
|
54
|
+
* Associates a `<label></label>` with the field.
|
|
56
55
|
*/
|
|
57
56
|
id?: string;
|
|
58
57
|
/**
|
|
@@ -268,7 +267,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
268
267
|
render(): jsx.JSX.Element;
|
|
269
268
|
}
|
|
270
269
|
export { DatePicker as DatePickerWithoutAnalytics };
|
|
271
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "
|
|
270
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "value" | "placeholder" | "testId" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "dateFormat" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "autoFocus" | "disabled" | "name" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "icon" | "defaultIsOpen" | "disabledDateFilter" | "spacing" | "isInvalid" | "hideIcon" | "locale">> & Partial<Pick<{
|
|
272
271
|
appearance: Appearance;
|
|
273
272
|
autoFocus: boolean;
|
|
274
273
|
defaultIsOpen: boolean;
|
|
@@ -288,5 +287,5 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
|
|
|
288
287
|
selectProps: {};
|
|
289
288
|
spacing: Spacing;
|
|
290
289
|
locale: string;
|
|
291
|
-
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "
|
|
290
|
+
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "autoFocus" | "disabled" | "name" | "value" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "testId" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "icon" | "defaultIsOpen" | "disabledDateFilter" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat" | "locale" | "weekStartDay" | "analyticsContext"> & import("react").RefAttributes<any>>;
|
|
292
291
|
export default _default;
|
|
@@ -22,8 +22,7 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
22
22
|
*/
|
|
23
23
|
defaultValue?: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Keep this in mind when needing to refer to the ID. This will be fixed in an upcoming release.
|
|
25
|
+
* Set the id of the field.
|
|
27
26
|
*/
|
|
28
27
|
id?: string;
|
|
29
28
|
/**
|
|
@@ -194,7 +193,7 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
194
193
|
render(): jsx.JSX.Element;
|
|
195
194
|
}
|
|
196
195
|
export { DateTimePicker as DateTimePickerWithoutAnalytics };
|
|
197
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "
|
|
196
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "value" | "testId" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "times" | "autoFocus" | "name" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "appearance" | "innerProps" | "isDisabled" | "spacing" | "isInvalid" | "locale" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
|
|
198
197
|
appearance: string;
|
|
199
198
|
autoFocus: boolean;
|
|
200
199
|
isDisabled: boolean;
|
|
@@ -214,5 +213,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimeP
|
|
|
214
213
|
times: string[];
|
|
215
214
|
spacing: string;
|
|
216
215
|
locale: string;
|
|
217
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "
|
|
216
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "key" | "autoFocus" | "name" | "value" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "testId" | "appearance" | "innerProps" | "isDisabled" | "spacing" | "isInvalid" | "dateFormat" | "locale" | "analyticsContext" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
|
|
218
217
|
export default _default;
|
|
@@ -27,7 +27,8 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
27
27
|
*/
|
|
28
28
|
formatDisplayLabel?: (time: string, timeFormat: string) => string;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Set the id of the field.
|
|
31
|
+
* Associates a `<label></label>` with the field.
|
|
31
32
|
*/
|
|
32
33
|
id?: string;
|
|
33
34
|
/**
|
|
@@ -188,7 +189,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
188
189
|
render(): JSX.Element;
|
|
189
190
|
}
|
|
190
191
|
export { TimePicker as TimePickerWithoutAnalytics };
|
|
191
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "
|
|
192
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "value" | "placeholder" | "testId" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "times" | "autoFocus" | "name" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "defaultIsOpen" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "timeIsEditable">> & Partial<Pick<{
|
|
192
193
|
appearance: Appearance;
|
|
193
194
|
autoFocus: boolean;
|
|
194
195
|
defaultIsOpen: boolean;
|
|
@@ -208,5 +209,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
|
|
|
208
209
|
times: string[];
|
|
209
210
|
timeIsEditable: boolean;
|
|
210
211
|
locale: string;
|
|
211
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "
|
|
212
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "key" | "autoFocus" | "name" | "value" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "testId" | "appearance" | "innerProps" | "selectProps" | "isDisabled" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "analyticsContext" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
212
213
|
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { Size } from '@atlaskit/icon';
|
|
4
|
+
interface ClearButtonProps {
|
|
5
|
+
inputId?: string;
|
|
6
|
+
iconSize?: Size;
|
|
7
|
+
primaryColor?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
buttonStyles?: SerializedStyles;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* __Clear button__
|
|
15
|
+
*/
|
|
16
|
+
declare const ClearButton: ({ inputId, iconSize, label, primaryColor, buttonStyles, dataTestId, onClick, }: ClearButtonProps) => jsx.JSX.Element;
|
|
17
|
+
export default ClearButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { ClearIndicatorProps } from '@atlaskit/select';
|
|
4
|
+
/**
|
|
5
|
+
* __Clear indicator__
|
|
6
|
+
* Overwrites the default `ClearIndicator` button with custom styles and attributes
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
declare const ClearIndicator: FC<ClearIndicatorProps<any>>;
|
|
10
|
+
export default ClearIndicator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.2",
|
|
4
4
|
"description": "A date time picker allows the user to select an associated date and time.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/popper": "^5.5.0",
|
|
43
43
|
"@atlaskit/select": "^17.0.0",
|
|
44
44
|
"@atlaskit/theme": "^12.6.0",
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
+
"@atlaskit/tokens": "^1.29.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"date-fns": "^2.17.0",
|
|
@@ -54,15 +54,16 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@af/accessibility-testing": "*",
|
|
57
|
-
"@
|
|
57
|
+
"@af/integration-testing": "*",
|
|
58
|
+
"@atlaskit/button": "^16.17.0",
|
|
58
59
|
"@atlaskit/docs": "*",
|
|
59
60
|
"@atlaskit/form": "^9.0.0",
|
|
60
|
-
"@atlaskit/modal-dialog": "^12.
|
|
61
|
+
"@atlaskit/modal-dialog": "^12.10.0",
|
|
61
62
|
"@atlaskit/popup": "^1.11.0",
|
|
62
63
|
"@atlaskit/range": "^7.1.0",
|
|
63
64
|
"@atlaskit/section-message": "^6.4.0",
|
|
64
65
|
"@atlaskit/ssr": "*",
|
|
65
|
-
"@atlaskit/textfield": "^
|
|
66
|
+
"@atlaskit/textfield": "^6.0.0",
|
|
66
67
|
"@atlaskit/toggle": "^13.0.0",
|
|
67
68
|
"@atlaskit/visual-regression": "*",
|
|
68
69
|
"@atlaskit/webdriver-runner": "*",
|