@atlaskit/datetime-picker 12.7.5 → 12.7.7
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 +12 -0
- package/dist/cjs/components/date-picker.js +54 -50
- package/dist/cjs/components/date-time-picker.js +1 -1
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/components/utils.js +8 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/date-picker.js +53 -49
- package/dist/es2019/components/date-time-picker.js +1 -1
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/components/utils.js +6 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/date-picker.js +54 -50
- package/dist/esm/components/date-time-picker.js +1 -1
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/components/utils.js +8 -2
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
- package/tmp/api-report-tmp.d.ts +0 -274
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 12.7.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ba50169844e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ba50169844e) - Remove lookahead and lookbehind in format util to support browsers without that functionality.
|
|
8
|
+
|
|
9
|
+
## 12.7.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`6d8ce8bb48a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6d8ce8bb48a) - Revert PR using regex that is not supported by Safari 16.4 and below and can crash a session
|
|
14
|
+
|
|
3
15
|
## 12.7.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -37,7 +37,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
37
37
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
38
38
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @repo/internal/react/use-noop */ /** @jsx jsx */ // eslint-disable-next-line no-restricted-imports
|
|
39
39
|
var packageName = "@atlaskit/datetime-picker";
|
|
40
|
-
var packageVersion = "12.7.
|
|
40
|
+
var packageVersion = "12.7.7";
|
|
41
41
|
|
|
42
42
|
/* eslint-disable react/no-unused-prop-types */
|
|
43
43
|
|
|
@@ -471,56 +471,60 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
471
471
|
nextMonthLabel: nextMonthLabel,
|
|
472
472
|
previousMonthLabel: previousMonthLabel
|
|
473
473
|
};
|
|
474
|
-
return (
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
474
|
+
return (
|
|
475
|
+
// TODO: Remove role="presentation", since div's have no semantics anyway
|
|
476
|
+
// (DSP-11587)
|
|
477
|
+
(0, _react2.jsx)("div", (0, _extends2.default)({}, innerProps, {
|
|
478
|
+
role: "presentation",
|
|
479
|
+
onClick: this.onInputClick,
|
|
480
|
+
onInput: this.onTextInput,
|
|
481
|
+
onKeyDown: this.onInputKeyDown,
|
|
482
|
+
ref: this.getContainerRef,
|
|
483
|
+
"data-testid": testId && "".concat(testId, "--container")
|
|
484
|
+
}), (0, _react2.jsx)("input", {
|
|
485
|
+
name: name,
|
|
486
|
+
type: "hidden",
|
|
487
|
+
value: value,
|
|
488
|
+
"data-testid": testId && "".concat(testId, "--input")
|
|
489
|
+
}), (0, _react2.jsx)(_select.default, (0, _extends2.default)({
|
|
490
|
+
appearance: this.props.appearance,
|
|
491
|
+
enableAnimation: false,
|
|
492
|
+
menuIsOpen: menuIsOpen,
|
|
493
|
+
closeMenuOnSelect: true,
|
|
494
|
+
autoFocus: autoFocus,
|
|
495
|
+
instanceId: id,
|
|
496
|
+
isDisabled: isDisabled,
|
|
497
|
+
onBlur: this.onSelectBlur,
|
|
498
|
+
onFocus: this.onSelectFocus,
|
|
499
|
+
inputValue: actualSelectInputValue,
|
|
500
|
+
onInputChange: this.handleSelectInputChange,
|
|
501
|
+
components: selectComponents,
|
|
502
|
+
onChange: this.onSelectChange,
|
|
503
|
+
styles: (0, _select.mergeStyles)(selectStyles, {
|
|
504
|
+
control: function control(base) {
|
|
505
|
+
return _objectSpread(_objectSpread({}, base), disabledStyle);
|
|
506
|
+
},
|
|
507
|
+
indicatorsContainer: function indicatorsContainer(base) {
|
|
508
|
+
return _objectSpread(_objectSpread({}, base), {}, {
|
|
509
|
+
paddingLeft: "var(--ds-space-025, 2px)",
|
|
510
|
+
// ICON_PADDING = 2
|
|
511
|
+
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}),
|
|
512
515
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
516
|
+
placeholder: this.getPlaceholder(),
|
|
517
|
+
value: value && {
|
|
518
|
+
label: this.formatDate(value),
|
|
519
|
+
value: value
|
|
520
|
+
}
|
|
521
|
+
}, selectProps, calendarProps, {
|
|
522
|
+
isClearable: true,
|
|
523
|
+
spacing: spacing,
|
|
524
|
+
isInvalid: isInvalid,
|
|
525
|
+
testId: testId
|
|
526
|
+
})))
|
|
527
|
+
);
|
|
524
528
|
}
|
|
525
529
|
}]);
|
|
526
530
|
return DatePicker;
|
|
@@ -31,7 +31,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
31
31
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
32
|
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; } /* eslint-disable @repo/internal/react/use-noop */ /** @jsx jsx */ // eslint-disable-next-line no-restricted-imports
|
|
33
33
|
var packageName = "@atlaskit/datetime-picker";
|
|
34
|
-
var packageVersion = "12.7.
|
|
34
|
+
var packageVersion = "12.7.7";
|
|
35
35
|
|
|
36
36
|
/* eslint-disable react/no-unused-prop-types */
|
|
37
37
|
|
|
@@ -38,7 +38,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
38
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
39
39
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "12.7.
|
|
41
|
+
var packageVersion = "12.7.7";
|
|
42
42
|
|
|
43
43
|
/* eslint-disable react/no-unused-prop-types */
|
|
44
44
|
|
|
@@ -60,7 +60,7 @@ var tokensRegExp = new RegExp(
|
|
|
60
60
|
// v1 escape string (unsure the purpose of post-pipe capture group)
|
|
61
61
|
'(\\[[^\\[]*\\])|(\\\\)?' +
|
|
62
62
|
// v2 escape string
|
|
63
|
-
"(
|
|
63
|
+
"('.+'|" +
|
|
64
64
|
// All v1 tokens
|
|
65
65
|
v1tokens.join('|') + '|.)', 'g');
|
|
66
66
|
function convertTokens(format) {
|
|
@@ -83,7 +83,13 @@ function convertTokens(format) {
|
|
|
83
83
|
// This allows double parentheses to be rendered correctly
|
|
84
84
|
// according to date-fns's spec.
|
|
85
85
|
// https://date-fns.org/v2.29.3/docs/format
|
|
86
|
-
|
|
86
|
+
//
|
|
87
|
+
// We have to keep the single quote and then remove it because
|
|
88
|
+
// browser support for lookahead/behind is low and causes breaking
|
|
89
|
+
// errors (HOT-104152)
|
|
90
|
+
var filteredEscapedTextBuffer = parsed.escapedTextBuffer.map(function (token) {
|
|
91
|
+
return token[0] === "'" && token.slice(-1) === "'" ? token.slice(1, -1) : token;
|
|
92
|
+
}).filter(function (token) {
|
|
87
93
|
return token !== "'";
|
|
88
94
|
}).join('');
|
|
89
95
|
parsed.formatBuffer.push("'".concat(filteredEscapedTextBuffer, "'"));
|
package/dist/cjs/version.json
CHANGED
|
@@ -19,7 +19,7 @@ import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from
|
|
|
19
19
|
import FixedLayer from '../internal/fixed-layer';
|
|
20
20
|
import { convertTokens } from './utils';
|
|
21
21
|
const packageName = "@atlaskit/datetime-picker";
|
|
22
|
-
const packageVersion = "12.7.
|
|
22
|
+
const packageVersion = "12.7.7";
|
|
23
23
|
|
|
24
24
|
/* eslint-disable react/no-unused-prop-types */
|
|
25
25
|
|
|
@@ -461,56 +461,60 @@ class DatePicker extends Component {
|
|
|
461
461
|
nextMonthLabel,
|
|
462
462
|
previousMonthLabel
|
|
463
463
|
};
|
|
464
|
-
return
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
464
|
+
return (
|
|
465
|
+
// TODO: Remove role="presentation", since div's have no semantics anyway
|
|
466
|
+
// (DSP-11587)
|
|
467
|
+
jsx("div", _extends({}, innerProps, {
|
|
468
|
+
role: "presentation",
|
|
469
|
+
onClick: this.onInputClick,
|
|
470
|
+
onInput: this.onTextInput,
|
|
471
|
+
onKeyDown: this.onInputKeyDown,
|
|
472
|
+
ref: this.getContainerRef,
|
|
473
|
+
"data-testid": testId && `${testId}--container`
|
|
474
|
+
}), jsx("input", {
|
|
475
|
+
name: name,
|
|
476
|
+
type: "hidden",
|
|
477
|
+
value: value,
|
|
478
|
+
"data-testid": testId && `${testId}--input`
|
|
479
|
+
}), jsx(Select, _extends({
|
|
480
|
+
appearance: this.props.appearance,
|
|
481
|
+
enableAnimation: false,
|
|
482
|
+
menuIsOpen: menuIsOpen,
|
|
483
|
+
closeMenuOnSelect: true,
|
|
484
|
+
autoFocus: autoFocus,
|
|
485
|
+
instanceId: id,
|
|
486
|
+
isDisabled: isDisabled,
|
|
487
|
+
onBlur: this.onSelectBlur,
|
|
488
|
+
onFocus: this.onSelectFocus,
|
|
489
|
+
inputValue: actualSelectInputValue,
|
|
490
|
+
onInputChange: this.handleSelectInputChange,
|
|
491
|
+
components: selectComponents,
|
|
492
|
+
onChange: this.onSelectChange,
|
|
493
|
+
styles: mergeStyles(selectStyles, {
|
|
494
|
+
control: base => ({
|
|
495
|
+
...base,
|
|
496
|
+
...disabledStyle
|
|
497
|
+
}),
|
|
498
|
+
indicatorsContainer: base => ({
|
|
499
|
+
...base,
|
|
500
|
+
paddingLeft: "var(--ds-space-025, 2px)",
|
|
501
|
+
// ICON_PADDING = 2
|
|
502
|
+
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
503
|
+
})
|
|
494
504
|
}),
|
|
495
|
-
indicatorsContainer: base => ({
|
|
496
|
-
...base,
|
|
497
|
-
paddingLeft: "var(--ds-space-025, 2px)",
|
|
498
|
-
// ICON_PADDING = 2
|
|
499
|
-
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
500
|
-
})
|
|
501
|
-
}),
|
|
502
505
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
506
|
+
placeholder: this.getPlaceholder(),
|
|
507
|
+
value: value && {
|
|
508
|
+
label: this.formatDate(value),
|
|
509
|
+
value
|
|
510
|
+
}
|
|
511
|
+
}, selectProps, calendarProps, {
|
|
512
|
+
isClearable: true,
|
|
513
|
+
spacing: spacing,
|
|
514
|
+
isInvalid: isInvalid,
|
|
515
|
+
testId: testId
|
|
516
|
+
})))
|
|
517
|
+
);
|
|
514
518
|
}
|
|
515
519
|
}
|
|
516
520
|
_defineProperty(DatePicker, "defaultProps", datePickerDefaultProps);
|
|
@@ -17,7 +17,7 @@ import DatePicker from './date-picker';
|
|
|
17
17
|
import TimePicker from './time-picker';
|
|
18
18
|
import { convertTokens } from './utils';
|
|
19
19
|
const packageName = "@atlaskit/datetime-picker";
|
|
20
|
-
const packageVersion = "12.7.
|
|
20
|
+
const packageVersion = "12.7.7";
|
|
21
21
|
|
|
22
22
|
/* eslint-disable react/no-unused-prop-types */
|
|
23
23
|
|
|
@@ -16,7 +16,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
16
16
|
import parseTime from '../internal/parse-time';
|
|
17
17
|
import { convertTokens } from './utils';
|
|
18
18
|
const packageName = "@atlaskit/datetime-picker";
|
|
19
|
-
const packageVersion = "12.7.
|
|
19
|
+
const packageVersion = "12.7.7";
|
|
20
20
|
|
|
21
21
|
/* eslint-disable react/no-unused-prop-types */
|
|
22
22
|
|
|
@@ -54,7 +54,7 @@ const tokensRegExp = new RegExp(
|
|
|
54
54
|
// v1 escape string (unsure the purpose of post-pipe capture group)
|
|
55
55
|
'(\\[[^\\[]*\\])|(\\\\)?' +
|
|
56
56
|
// v2 escape string
|
|
57
|
-
"(
|
|
57
|
+
"('.+'|" +
|
|
58
58
|
// All v1 tokens
|
|
59
59
|
v1tokens.join('|') + '|.)', 'g');
|
|
60
60
|
export function convertTokens(format) {
|
|
@@ -77,7 +77,11 @@ export function convertTokens(format) {
|
|
|
77
77
|
// This allows double parentheses to be rendered correctly
|
|
78
78
|
// according to date-fns's spec.
|
|
79
79
|
// https://date-fns.org/v2.29.3/docs/format
|
|
80
|
-
|
|
80
|
+
//
|
|
81
|
+
// We have to keep the single quote and then remove it because
|
|
82
|
+
// browser support for lookahead/behind is low and causes breaking
|
|
83
|
+
// errors (HOT-104152)
|
|
84
|
+
const filteredEscapedTextBuffer = parsed.escapedTextBuffer.map(token => token[0] === "'" && token.slice(-1) === "'" ? token.slice(1, -1) : token).filter(token => token !== "'").join('');
|
|
81
85
|
parsed.formatBuffer.push(`'${filteredEscapedTextBuffer}'`);
|
|
82
86
|
parsed.escapedTextBuffer = [];
|
|
83
87
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -30,7 +30,7 @@ import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from
|
|
|
30
30
|
import FixedLayer from '../internal/fixed-layer';
|
|
31
31
|
import { convertTokens } from './utils';
|
|
32
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
33
|
-
var packageVersion = "12.7.
|
|
33
|
+
var packageVersion = "12.7.7";
|
|
34
34
|
|
|
35
35
|
/* eslint-disable react/no-unused-prop-types */
|
|
36
36
|
|
|
@@ -464,56 +464,60 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
464
464
|
nextMonthLabel: nextMonthLabel,
|
|
465
465
|
previousMonthLabel: previousMonthLabel
|
|
466
466
|
};
|
|
467
|
-
return
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
467
|
+
return (
|
|
468
|
+
// TODO: Remove role="presentation", since div's have no semantics anyway
|
|
469
|
+
// (DSP-11587)
|
|
470
|
+
jsx("div", _extends({}, innerProps, {
|
|
471
|
+
role: "presentation",
|
|
472
|
+
onClick: this.onInputClick,
|
|
473
|
+
onInput: this.onTextInput,
|
|
474
|
+
onKeyDown: this.onInputKeyDown,
|
|
475
|
+
ref: this.getContainerRef,
|
|
476
|
+
"data-testid": testId && "".concat(testId, "--container")
|
|
477
|
+
}), jsx("input", {
|
|
478
|
+
name: name,
|
|
479
|
+
type: "hidden",
|
|
480
|
+
value: value,
|
|
481
|
+
"data-testid": testId && "".concat(testId, "--input")
|
|
482
|
+
}), jsx(Select, _extends({
|
|
483
|
+
appearance: this.props.appearance,
|
|
484
|
+
enableAnimation: false,
|
|
485
|
+
menuIsOpen: menuIsOpen,
|
|
486
|
+
closeMenuOnSelect: true,
|
|
487
|
+
autoFocus: autoFocus,
|
|
488
|
+
instanceId: id,
|
|
489
|
+
isDisabled: isDisabled,
|
|
490
|
+
onBlur: this.onSelectBlur,
|
|
491
|
+
onFocus: this.onSelectFocus,
|
|
492
|
+
inputValue: actualSelectInputValue,
|
|
493
|
+
onInputChange: this.handleSelectInputChange,
|
|
494
|
+
components: selectComponents,
|
|
495
|
+
onChange: this.onSelectChange,
|
|
496
|
+
styles: mergeStyles(selectStyles, {
|
|
497
|
+
control: function control(base) {
|
|
498
|
+
return _objectSpread(_objectSpread({}, base), disabledStyle);
|
|
499
|
+
},
|
|
500
|
+
indicatorsContainer: function indicatorsContainer(base) {
|
|
501
|
+
return _objectSpread(_objectSpread({}, base), {}, {
|
|
502
|
+
paddingLeft: "var(--ds-space-025, 2px)",
|
|
503
|
+
// ICON_PADDING = 2
|
|
504
|
+
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}),
|
|
505
508
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
509
|
+
placeholder: this.getPlaceholder(),
|
|
510
|
+
value: value && {
|
|
511
|
+
label: this.formatDate(value),
|
|
512
|
+
value: value
|
|
513
|
+
}
|
|
514
|
+
}, selectProps, calendarProps, {
|
|
515
|
+
isClearable: true,
|
|
516
|
+
spacing: spacing,
|
|
517
|
+
isInvalid: isInvalid,
|
|
518
|
+
testId: testId
|
|
519
|
+
})))
|
|
520
|
+
);
|
|
517
521
|
}
|
|
518
522
|
}]);
|
|
519
523
|
return DatePicker;
|
|
@@ -27,7 +27,7 @@ import DatePicker from './date-picker';
|
|
|
27
27
|
import TimePicker from './time-picker';
|
|
28
28
|
import { convertTokens } from './utils';
|
|
29
29
|
var packageName = "@atlaskit/datetime-picker";
|
|
30
|
-
var packageVersion = "12.7.
|
|
30
|
+
var packageVersion = "12.7.7";
|
|
31
31
|
|
|
32
32
|
/* eslint-disable react/no-unused-prop-types */
|
|
33
33
|
|
|
@@ -29,7 +29,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
29
29
|
import parseTime from '../internal/parse-time';
|
|
30
30
|
import { convertTokens } from './utils';
|
|
31
31
|
var packageName = "@atlaskit/datetime-picker";
|
|
32
|
-
var packageVersion = "12.7.
|
|
32
|
+
var packageVersion = "12.7.7";
|
|
33
33
|
|
|
34
34
|
/* eslint-disable react/no-unused-prop-types */
|
|
35
35
|
|
|
@@ -54,7 +54,7 @@ var tokensRegExp = new RegExp(
|
|
|
54
54
|
// v1 escape string (unsure the purpose of post-pipe capture group)
|
|
55
55
|
'(\\[[^\\[]*\\])|(\\\\)?' +
|
|
56
56
|
// v2 escape string
|
|
57
|
-
"(
|
|
57
|
+
"('.+'|" +
|
|
58
58
|
// All v1 tokens
|
|
59
59
|
v1tokens.join('|') + '|.)', 'g');
|
|
60
60
|
export function convertTokens(format) {
|
|
@@ -77,7 +77,13 @@ export function convertTokens(format) {
|
|
|
77
77
|
// This allows double parentheses to be rendered correctly
|
|
78
78
|
// according to date-fns's spec.
|
|
79
79
|
// https://date-fns.org/v2.29.3/docs/format
|
|
80
|
-
|
|
80
|
+
//
|
|
81
|
+
// We have to keep the single quote and then remove it because
|
|
82
|
+
// browser support for lookahead/behind is low and causes breaking
|
|
83
|
+
// errors (HOT-104152)
|
|
84
|
+
var filteredEscapedTextBuffer = parsed.escapedTextBuffer.map(function (token) {
|
|
85
|
+
return token[0] === "'" && token.slice(-1) === "'" ? token.slice(1, -1) : token;
|
|
86
|
+
}).filter(function (token) {
|
|
81
87
|
return token !== "'";
|
|
82
88
|
}).join('');
|
|
83
89
|
parsed.formatBuffer.push("'".concat(filteredEscapedTextBuffer, "'"));
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/datetime-picker"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { ComponentType } from 'react';
|
|
8
|
-
import { DropdownIndicatorProps } from '@atlaskit/select';
|
|
9
|
-
import { FocusEvent as FocusEvent_2 } from 'react';
|
|
10
|
-
import { ForwardRefExoticComponent } from 'react';
|
|
11
|
-
import { GroupType } from '@atlaskit/select';
|
|
12
|
-
import { OptionType } from '@atlaskit/select';
|
|
13
|
-
import { default as React_2 } from 'react';
|
|
14
|
-
import { RefAttributes } from 'react';
|
|
15
|
-
import { SelectProps as SelectProps_2 } from '@atlaskit/select';
|
|
16
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
17
|
-
import { WithContextProps } from '@atlaskit/analytics-next';
|
|
18
|
-
|
|
19
|
-
// @public (undocumented)
|
|
20
|
-
export type Appearance = 'default' | 'none' | 'subtle';
|
|
21
|
-
|
|
22
|
-
// @public (undocumented)
|
|
23
|
-
export const DatePicker: ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps_2, keyof WithAnalyticsEventsProps>, "dateFormat" | "formatDisplayLabel" | "isOpen" | "maxDate" | "minDate" | "nextMonthLabel" | "parseInputValue" | "placeholder" | "previousMonthLabel" | "testId" | "value" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps_2, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabled" | "disabledDateFilter" | "hideIcon" | "icon" | "id" | "innerProps" | "isDisabled" | "isInvalid" | "locale" | "name" | "onBlur" | "onChange" | "onFocus" | "selectProps" | "spacing">> & Partial<Pick<{
|
|
24
|
-
appearance: Appearance;
|
|
25
|
-
autoFocus: boolean;
|
|
26
|
-
defaultIsOpen: boolean;
|
|
27
|
-
defaultValue: string;
|
|
28
|
-
disabled: string[];
|
|
29
|
-
disabledDateFilter: (_: string) => boolean;
|
|
30
|
-
hideIcon: boolean;
|
|
31
|
-
icon: ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
|
|
32
|
-
id: string;
|
|
33
|
-
innerProps: {};
|
|
34
|
-
isDisabled: boolean;
|
|
35
|
-
isInvalid: boolean;
|
|
36
|
-
name: string;
|
|
37
|
-
onBlur: (event: FocusEvent_2<HTMLInputElement>) => void;
|
|
38
|
-
onChange: (value: string) => void;
|
|
39
|
-
onFocus: (event: FocusEvent_2<HTMLInputElement>) => void;
|
|
40
|
-
selectProps: {};
|
|
41
|
-
spacing: Spacing;
|
|
42
|
-
locale: string;
|
|
43
|
-
}, never>> & RefAttributes<any> & WithContextProps, "analyticsContext" | "appearance" | "autoFocus" | "dateFormat" | "defaultIsOpen" | "defaultValue" | "disabled" | "disabledDateFilter" | "formatDisplayLabel" | "hideIcon" | "icon" | "id" | "innerProps" | "isDisabled" | "isInvalid" | "isOpen" | "key" | "locale" | "maxDate" | "minDate" | "name" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "placeholder" | "previousMonthLabel" | "selectProps" | "spacing" | "testId" | "value" | "weekStartDay"> & RefAttributes<any>>;
|
|
44
|
-
|
|
45
|
-
// @public (undocumented)
|
|
46
|
-
const datePickerDefaultProps: {
|
|
47
|
-
appearance: Appearance;
|
|
48
|
-
autoFocus: boolean;
|
|
49
|
-
defaultIsOpen: boolean;
|
|
50
|
-
defaultValue: string;
|
|
51
|
-
disabled: string[];
|
|
52
|
-
disabledDateFilter: (_: string) => boolean;
|
|
53
|
-
hideIcon: boolean;
|
|
54
|
-
icon: ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
|
|
55
|
-
id: string;
|
|
56
|
-
innerProps: {};
|
|
57
|
-
isDisabled: boolean;
|
|
58
|
-
isInvalid: boolean;
|
|
59
|
-
name: string;
|
|
60
|
-
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
61
|
-
onChange: (value: string) => void;
|
|
62
|
-
onFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
63
|
-
selectProps: {};
|
|
64
|
-
spacing: Spacing;
|
|
65
|
-
locale: string;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// @public (undocumented)
|
|
69
|
-
export interface DatePickerProps extends WithAnalyticsEventsProps {
|
|
70
|
-
appearance?: Appearance;
|
|
71
|
-
autoFocus?: boolean;
|
|
72
|
-
dateFormat?: string;
|
|
73
|
-
defaultIsOpen?: boolean;
|
|
74
|
-
defaultValue?: string;
|
|
75
|
-
disabled?: string[];
|
|
76
|
-
disabledDateFilter?: (date: string) => boolean;
|
|
77
|
-
formatDisplayLabel?: (value: string, dateFormat: string) => string;
|
|
78
|
-
hideIcon?: boolean;
|
|
79
|
-
icon?: React.ComponentType<DropdownIndicatorProps<OptionType>>;
|
|
80
|
-
id?: string;
|
|
81
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement>;
|
|
82
|
-
isDisabled?: boolean;
|
|
83
|
-
isInvalid?: boolean;
|
|
84
|
-
isOpen?: boolean;
|
|
85
|
-
locale?: string;
|
|
86
|
-
maxDate?: string;
|
|
87
|
-
minDate?: string;
|
|
88
|
-
name?: string;
|
|
89
|
-
nextMonthLabel?: string;
|
|
90
|
-
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
91
|
-
onChange?: (value: string) => void;
|
|
92
|
-
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
93
|
-
parseInputValue?: (date: string, dateFormat: string) => Date;
|
|
94
|
-
placeholder?: string;
|
|
95
|
-
previousMonthLabel?: string;
|
|
96
|
-
selectProps?: SelectProps;
|
|
97
|
-
spacing?: Spacing;
|
|
98
|
-
testId?: string;
|
|
99
|
-
value?: string;
|
|
100
|
-
weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// @public (undocumented)
|
|
104
|
-
type DatePickerProps_2 = typeof datePickerDefaultProps & DatePickerProps;
|
|
105
|
-
|
|
106
|
-
// @public (undocumented)
|
|
107
|
-
export const DateTimePicker: React_2.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps_2, keyof WithAnalyticsEventsProps>, "dateFormat" | "parseValue" | "testId" | "timeFormat" | "value"> & Partial<Pick<Omit<DateTimePickerProps_2, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "datePickerProps" | "datePickerSelectProps" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "isInvalid" | "locale" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "timeIsEditable" | "timePickerProps" | "timePickerSelectProps" | "times">> & Partial<Pick<{
|
|
108
|
-
appearance: string;
|
|
109
|
-
autoFocus: boolean;
|
|
110
|
-
isDisabled: boolean;
|
|
111
|
-
name: string;
|
|
112
|
-
onBlur: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
113
|
-
onChange: (value: string) => void;
|
|
114
|
-
onFocus: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
115
|
-
innerProps: {};
|
|
116
|
-
id: string;
|
|
117
|
-
defaultValue: string;
|
|
118
|
-
timeIsEditable: boolean;
|
|
119
|
-
isInvalid: boolean;
|
|
120
|
-
datePickerProps: {};
|
|
121
|
-
timePickerProps: {};
|
|
122
|
-
datePickerSelectProps: {};
|
|
123
|
-
timePickerSelectProps: {};
|
|
124
|
-
times: string[];
|
|
125
|
-
spacing: string;
|
|
126
|
-
locale: string;
|
|
127
|
-
}, never>> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "appearance" | "autoFocus" | "dateFormat" | "datePickerProps" | "datePickerSelectProps" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "isInvalid" | "key" | "locale" | "name" | "onBlur" | "onChange" | "onFocus" | "parseValue" | "spacing" | "testId" | "timeFormat" | "timeIsEditable" | "timePickerProps" | "timePickerSelectProps" | "times" | "value"> & React_2.RefAttributes<any>>;
|
|
128
|
-
|
|
129
|
-
// @public (undocumented)
|
|
130
|
-
const dateTimePickerDefaultProps: {
|
|
131
|
-
appearance: string;
|
|
132
|
-
autoFocus: boolean;
|
|
133
|
-
isDisabled: boolean;
|
|
134
|
-
name: string;
|
|
135
|
-
onBlur: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
136
|
-
onChange: (value: string) => void;
|
|
137
|
-
onFocus: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
138
|
-
innerProps: {};
|
|
139
|
-
id: string;
|
|
140
|
-
defaultValue: string;
|
|
141
|
-
timeIsEditable: boolean;
|
|
142
|
-
isInvalid: boolean;
|
|
143
|
-
datePickerProps: {};
|
|
144
|
-
timePickerProps: {};
|
|
145
|
-
datePickerSelectProps: {};
|
|
146
|
-
timePickerSelectProps: {};
|
|
147
|
-
times: string[];
|
|
148
|
-
spacing: string;
|
|
149
|
-
locale: string;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
// @public (undocumented)
|
|
153
|
-
export interface DateTimePickerProps extends WithAnalyticsEventsProps {
|
|
154
|
-
appearance?: Appearance;
|
|
155
|
-
autoFocus?: boolean;
|
|
156
|
-
dateFormat?: string;
|
|
157
|
-
datePickerProps?: DatePickerProps;
|
|
158
|
-
datePickerSelectProps?: SelectProps_2<any>;
|
|
159
|
-
defaultValue?: string;
|
|
160
|
-
id?: string;
|
|
161
|
-
innerProps?: React_2.AllHTMLAttributes<HTMLElement>;
|
|
162
|
-
isDisabled?: boolean;
|
|
163
|
-
isInvalid?: boolean;
|
|
164
|
-
locale?: string;
|
|
165
|
-
name?: string;
|
|
166
|
-
onBlur?: React_2.FocusEventHandler<HTMLInputElement>;
|
|
167
|
-
onChange?: (value: string) => void;
|
|
168
|
-
onFocus?: React_2.FocusEventHandler<HTMLInputElement>;
|
|
169
|
-
parseValue?: (dateTimeValue: string, date: string, time: string, timezone: string) => {
|
|
170
|
-
dateValue: string;
|
|
171
|
-
timeValue: string;
|
|
172
|
-
zoneValue: string;
|
|
173
|
-
};
|
|
174
|
-
spacing?: Spacing;
|
|
175
|
-
testId?: string;
|
|
176
|
-
timeFormat?: string;
|
|
177
|
-
timeIsEditable?: boolean;
|
|
178
|
-
timePickerProps?: TimePickerProps;
|
|
179
|
-
timePickerSelectProps?: SelectProps_2<any>;
|
|
180
|
-
times?: Array<string>;
|
|
181
|
-
value?: string;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// @public (undocumented)
|
|
185
|
-
type DateTimePickerProps_2 = typeof dateTimePickerDefaultProps & DateTimePickerProps;
|
|
186
|
-
|
|
187
|
-
// @public (undocumented)
|
|
188
|
-
type SelectProps = any;
|
|
189
|
-
|
|
190
|
-
// @public (undocumented)
|
|
191
|
-
export type Spacing = 'compact' | 'default';
|
|
192
|
-
|
|
193
|
-
// @public (undocumented)
|
|
194
|
-
export const TimePicker: React_2.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps_2, keyof WithAnalyticsEventsProps>, "formatDisplayLabel" | "isOpen" | "placeholder" | "testId" | "timeFormat" | "value"> & Partial<Pick<Omit<TimePickerProps_2, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "hideIcon" | "id" | "innerProps" | "isDisabled" | "isInvalid" | "locale" | "name" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "selectProps" | "spacing" | "timeIsEditable" | "times">> & Partial<Pick<{
|
|
195
|
-
appearance: Appearance;
|
|
196
|
-
autoFocus: boolean;
|
|
197
|
-
defaultIsOpen: boolean;
|
|
198
|
-
defaultValue: string;
|
|
199
|
-
hideIcon: boolean;
|
|
200
|
-
id: string;
|
|
201
|
-
innerProps: {};
|
|
202
|
-
isDisabled: boolean;
|
|
203
|
-
isInvalid: boolean;
|
|
204
|
-
name: string;
|
|
205
|
-
onBlur: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
206
|
-
onChange: (value: string) => void;
|
|
207
|
-
onFocus: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
208
|
-
parseInputValue: (time: string, timeFormat: string) => Date | string;
|
|
209
|
-
selectProps: {};
|
|
210
|
-
spacing: Spacing;
|
|
211
|
-
times: string[];
|
|
212
|
-
timeIsEditable: boolean;
|
|
213
|
-
locale: string;
|
|
214
|
-
}, never>> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "formatDisplayLabel" | "hideIcon" | "id" | "innerProps" | "isDisabled" | "isInvalid" | "isOpen" | "key" | "locale" | "name" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "placeholder" | "selectProps" | "spacing" | "testId" | "timeFormat" | "timeIsEditable" | "times" | "value"> & React_2.RefAttributes<any>>;
|
|
215
|
-
|
|
216
|
-
// @public (undocumented)
|
|
217
|
-
const timePickerDefaultProps: {
|
|
218
|
-
appearance: Appearance;
|
|
219
|
-
autoFocus: boolean;
|
|
220
|
-
defaultIsOpen: boolean;
|
|
221
|
-
defaultValue: string;
|
|
222
|
-
hideIcon: boolean;
|
|
223
|
-
id: string;
|
|
224
|
-
innerProps: {};
|
|
225
|
-
isDisabled: boolean;
|
|
226
|
-
isInvalid: boolean;
|
|
227
|
-
name: string;
|
|
228
|
-
onBlur: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
229
|
-
onChange: (value: string) => void;
|
|
230
|
-
onFocus: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
231
|
-
parseInputValue: (time: string, timeFormat: string) => Date | string;
|
|
232
|
-
selectProps: {};
|
|
233
|
-
spacing: Spacing;
|
|
234
|
-
times: string[];
|
|
235
|
-
timeIsEditable: boolean;
|
|
236
|
-
locale: string;
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
// @public (undocumented)
|
|
240
|
-
export interface TimePickerProps extends WithAnalyticsEventsProps {
|
|
241
|
-
appearance?: Appearance;
|
|
242
|
-
autoFocus?: boolean;
|
|
243
|
-
defaultIsOpen?: boolean;
|
|
244
|
-
defaultValue?: string;
|
|
245
|
-
formatDisplayLabel?: (time: string, timeFormat: string) => string;
|
|
246
|
-
hideIcon?: boolean;
|
|
247
|
-
id?: string;
|
|
248
|
-
innerProps?: React_2.AllHTMLAttributes<HTMLElement>;
|
|
249
|
-
isDisabled?: boolean;
|
|
250
|
-
isInvalid?: boolean;
|
|
251
|
-
isOpen?: boolean;
|
|
252
|
-
locale?: string;
|
|
253
|
-
name?: string;
|
|
254
|
-
onBlur?: React_2.FocusEventHandler<HTMLElement>;
|
|
255
|
-
onChange?: (value: string) => void;
|
|
256
|
-
onFocus?: React_2.FocusEventHandler<HTMLElement>;
|
|
257
|
-
// (undocumented)
|
|
258
|
-
parseInputValue?: (time: string, timeFormat: string) => Date | string;
|
|
259
|
-
placeholder?: string;
|
|
260
|
-
selectProps?: SelectProps_2<any>;
|
|
261
|
-
spacing?: Spacing;
|
|
262
|
-
testId?: string;
|
|
263
|
-
timeFormat?: string;
|
|
264
|
-
timeIsEditable?: boolean;
|
|
265
|
-
times?: string[];
|
|
266
|
-
value?: string;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// @public (undocumented)
|
|
270
|
-
type TimePickerProps_2 = typeof timePickerDefaultProps & TimePickerProps;
|
|
271
|
-
|
|
272
|
-
// (No @packageDocumentation comment for this package)
|
|
273
|
-
|
|
274
|
-
```
|