@atlaskit/editor-plugin-date 3.0.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/ui/DatePicker/date-picker-input.compiled.css +4 -0
- package/dist/cjs/ui/DatePicker/date-picker-input.js +9 -14
- package/dist/cjs/ui/DatePicker/index.compiled.css +7 -0
- package/dist/cjs/ui/DatePicker/index.js +16 -20
- package/dist/es2019/ui/DatePicker/date-picker-input.compiled.css +4 -0
- package/dist/es2019/ui/DatePicker/date-picker-input.js +8 -15
- package/dist/es2019/ui/DatePicker/index.compiled.css +7 -0
- package/dist/es2019/ui/DatePicker/index.js +10 -21
- package/dist/esm/ui/DatePicker/date-picker-input.compiled.css +4 -0
- package/dist/esm/ui/DatePicker/date-picker-input.js +8 -15
- package/dist/esm/ui/DatePicker/index.compiled.css +7 -0
- package/dist/esm/ui/DatePicker/index.js +15 -22
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-date
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#117947](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/117947)
|
|
8
|
+
[`2c672e958d395`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2c672e958d395) -
|
|
9
|
+
[ux] EDF-2346 - [MD] Remove emotion references
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 3.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* date-picker-input.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -5,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
require("./date-picker-input.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -12,7 +15,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
17
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _react2 = require("@emotion/react");
|
|
16
18
|
var _reactIntlNext = require("react-intl-next");
|
|
17
19
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
20
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
@@ -21,16 +23,9 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
|
21
23
|
var _formatParse = require("./utils/formatParse");
|
|
22
24
|
var _internal = require("./utils/internal");
|
|
23
25
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
24
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
-
* @jsxRuntime classic
|
|
26
|
-
* @jsx jsx
|
|
27
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
27
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
29
|
-
var dateTextFieldWrapper =
|
|
30
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
31
|
-
padding: '22px',
|
|
32
|
-
paddingBottom: "var(--ds-space-150, 12px)"
|
|
33
|
-
});
|
|
28
|
+
var dateTextFieldWrapper = null;
|
|
34
29
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
35
30
|
var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
36
31
|
function DatePickerInput(props) {
|
|
@@ -203,9 +198,9 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
203
198
|
|
|
204
199
|
// Don't display an error for an empty input.
|
|
205
200
|
var displayError = (attemptedDateParse === null || !possiblyValid) && inputText !== '';
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
},
|
|
201
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
className: (0, _runtime.ax)(["_ca0qqslr _n3tdutpp _19bvqslr _u5f3qslr"])
|
|
203
|
+
}, /*#__PURE__*/_react.default.createElement(_textfield.default, {
|
|
209
204
|
name: "datetextfield",
|
|
210
205
|
value: inputText,
|
|
211
206
|
ref: this.handleInputRef,
|
|
@@ -216,7 +211,7 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
216
211
|
autoComplete: "off",
|
|
217
212
|
isInvalid: displayError,
|
|
218
213
|
"aria-label": formatMessage(_messages.dateMessages.onKeyUpDownText)
|
|
219
|
-
}), displayError &&
|
|
214
|
+
}), displayError && /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, null, formatMessage(_messages.dateMessages.invalidDateError)));
|
|
220
215
|
}
|
|
221
216
|
}, {
|
|
222
217
|
key: "componentDidUpdate",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}._16qskkzs{box-shadow:var(--_es7za0)}
|
|
3
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
|
+
._bfhk13b4{background-color:var(--_1f6rtr1)}
|
|
5
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
6
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
7
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -5,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
require("./index.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -12,7 +15,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
17
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _react2 = require("@emotion/react");
|
|
16
18
|
var _reactIntlNext = require("react-intl-next");
|
|
17
19
|
var _calendar = _interopRequireDefault(require("@atlaskit/calendar"));
|
|
18
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -20,22 +22,12 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
20
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
21
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
24
|
var _colors = require("@atlaskit/theme/colors");
|
|
23
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
24
25
|
var _datePickerInput = _interopRequireDefault(require("./date-picker-input"));
|
|
25
26
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
26
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
|
-
* @jsxRuntime classic
|
|
28
|
-
* @jsx jsx
|
|
29
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
30
28
|
var PopupWithListeners = (0, _ui.withOuterListeners)(_ui.Popup);
|
|
31
29
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
32
|
-
var popupContentWrapper =
|
|
33
|
-
padding: "var(--ds-space-025, 2px)",
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
35
|
-
borderRadius: "".concat((0, _constants.borderRadius)(), "px"),
|
|
36
|
-
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"),
|
|
37
|
-
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")")
|
|
38
|
-
});
|
|
30
|
+
var popupContentWrapper = null;
|
|
39
31
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
40
32
|
var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
41
33
|
function DatePicker(props) {
|
|
@@ -136,7 +128,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
136
128
|
if (!timestamp) {
|
|
137
129
|
return null;
|
|
138
130
|
}
|
|
139
|
-
return
|
|
131
|
+
return /*#__PURE__*/_react.default.createElement(PopupWithListeners
|
|
140
132
|
// Ignored via go/ees005
|
|
141
133
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
142
134
|
, {
|
|
@@ -152,11 +144,15 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
152
144
|
scrollableElement: scrollableElement,
|
|
153
145
|
ariaLabel: null,
|
|
154
146
|
preventOverflow: true
|
|
155
|
-
},
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
|
|
148
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
ref: setOutsideClickTargetRef,
|
|
150
|
+
className: (0, _runtime.ax)(["_2rko1sit _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qskkzs _bfhk13b4"]),
|
|
151
|
+
style: {
|
|
152
|
+
"--_es7za0": (0, _runtime.ix)("var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")")),
|
|
153
|
+
"--_1f6rtr1": (0, _runtime.ix)("var(--ds-surface-overlay, ".concat(_colors.N0, ")"))
|
|
154
|
+
}
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_datePickerInput.default, {
|
|
160
156
|
date: date,
|
|
161
157
|
onNewDate: _this2.handleNewDate,
|
|
162
158
|
onSubmitDate: _this2.handleKeyboardSubmitDate,
|
|
@@ -165,7 +161,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
165
161
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
166
162
|
autoFocus: autoFocus,
|
|
167
163
|
autoSelectAll: isNew
|
|
168
|
-
}),
|
|
164
|
+
}), /*#__PURE__*/_react.default.createElement(_calendar.default, {
|
|
169
165
|
onChange: _this2.handleOnChange,
|
|
170
166
|
onSelect: function onSelect(date) {
|
|
171
167
|
return _onSelect(date, _analytics.INPUT_METHOD.PICKER);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
/* date-picker-input.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import "./date-picker-input.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import React from 'react';
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
6
|
import { injectIntl } from 'react-intl-next';
|
|
10
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
11
8
|
import { dateMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -15,11 +12,7 @@ import { formatDateType, parseDateType } from './utils/formatParse';
|
|
|
15
12
|
import { adjustDate, findDateSegmentByPosition, isDatePossiblyValid } from './utils/internal';
|
|
16
13
|
|
|
17
14
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
18
|
-
const dateTextFieldWrapper =
|
|
19
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
20
|
-
padding: '22px',
|
|
21
|
-
paddingBottom: "var(--ds-space-150, 12px)"
|
|
22
|
-
});
|
|
15
|
+
const dateTextFieldWrapper = null;
|
|
23
16
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
24
17
|
class DatePickerInput extends React.Component {
|
|
25
18
|
constructor(props) {
|
|
@@ -200,9 +193,9 @@ class DatePickerInput extends React.Component {
|
|
|
200
193
|
|
|
201
194
|
// Don't display an error for an empty input.
|
|
202
195
|
const displayError = (attemptedDateParse === null || !possiblyValid) && inputText !== '';
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
},
|
|
196
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
197
|
+
className: ax(["_ca0qqslr _n3tdutpp _19bvqslr _u5f3qslr"])
|
|
198
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
206
199
|
name: "datetextfield",
|
|
207
200
|
value: inputText,
|
|
208
201
|
ref: this.handleInputRef,
|
|
@@ -213,7 +206,7 @@ class DatePickerInput extends React.Component {
|
|
|
213
206
|
autoComplete: "off",
|
|
214
207
|
isInvalid: displayError,
|
|
215
208
|
"aria-label": formatMessage(messages.onKeyUpDownText)
|
|
216
|
-
}), displayError &&
|
|
209
|
+
}), displayError && /*#__PURE__*/React.createElement(ErrorMessage, null, formatMessage(messages.invalidDateError)));
|
|
217
210
|
}
|
|
218
211
|
componentDidUpdate() {
|
|
219
212
|
const setInputSelectionPos = this.setInputSelectionPos;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}._16qsreen{box-shadow:var(--ds-shadow-overlay,0 4px 8px -2px rgba(9,30,66,.31),0 0 1px rgba(9,30,66,.31))}
|
|
3
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
5
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
6
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
7
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import React from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
6
|
import { injectIntl } from 'react-intl-next';
|
|
11
7
|
import Calendar from '@atlaskit/calendar';
|
|
12
8
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -14,18 +10,11 @@ import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@a
|
|
|
14
10
|
import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils';
|
|
15
11
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
16
12
|
import { N0, N60A } from '@atlaskit/theme/colors';
|
|
17
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
18
13
|
const PopupWithListeners = withOuterListeners(Popup);
|
|
19
14
|
import DatePickerInput from './date-picker-input';
|
|
20
15
|
|
|
21
16
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
22
|
-
const popupContentWrapper =
|
|
23
|
-
padding: "var(--ds-space-025, 2px)",
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
|
-
borderRadius: `${borderRadius()}px`,
|
|
26
|
-
boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`,
|
|
27
|
-
backgroundColor: `var(--ds-surface-overlay, ${N0})`
|
|
28
|
-
});
|
|
17
|
+
const popupContentWrapper = null;
|
|
29
18
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
30
19
|
class DatePicker extends React.Component {
|
|
31
20
|
constructor(props) {
|
|
@@ -125,7 +114,7 @@ class DatePicker extends React.Component {
|
|
|
125
114
|
if (!timestamp) {
|
|
126
115
|
return null;
|
|
127
116
|
}
|
|
128
|
-
return
|
|
117
|
+
return /*#__PURE__*/React.createElement(PopupWithListeners
|
|
129
118
|
// Ignored via go/ees005
|
|
130
119
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
120
|
, {
|
|
@@ -141,10 +130,10 @@ class DatePicker extends React.Component {
|
|
|
141
130
|
scrollableElement: scrollableElement,
|
|
142
131
|
ariaLabel: null,
|
|
143
132
|
preventOverflow: true
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
},
|
|
133
|
+
}, /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, setOutsideClickTargetRef => /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
ref: setOutsideClickTargetRef,
|
|
135
|
+
className: ax(["_2rko1sit _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qsreen _bfhk1bhr"])
|
|
136
|
+
}, /*#__PURE__*/React.createElement(DatePickerInput, {
|
|
148
137
|
date: date,
|
|
149
138
|
onNewDate: this.handleNewDate,
|
|
150
139
|
onSubmitDate: this.handleKeyboardSubmitDate,
|
|
@@ -153,7 +142,7 @@ class DatePicker extends React.Component {
|
|
|
153
142
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
154
143
|
autoFocus: autoFocus,
|
|
155
144
|
autoSelectAll: isNew
|
|
156
|
-
}),
|
|
145
|
+
}), /*#__PURE__*/React.createElement(Calendar, {
|
|
157
146
|
onChange: this.handleOnChange,
|
|
158
147
|
onSelect: date => onSelect(date, INPUT_METHOD.PICKER),
|
|
159
148
|
day: day,
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
+
/* date-picker-input.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import "./date-picker-input.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
/**
|
|
10
|
-
* @jsxRuntime classic
|
|
11
|
-
* @jsx jsx
|
|
12
|
-
*/
|
|
13
12
|
import React from 'react';
|
|
14
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
-
import { css, jsx } from '@emotion/react';
|
|
16
13
|
import { injectIntl } from 'react-intl-next';
|
|
17
14
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
18
15
|
import { dateMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -22,11 +19,7 @@ import { formatDateType, parseDateType } from './utils/formatParse';
|
|
|
22
19
|
import { adjustDate, findDateSegmentByPosition, isDatePossiblyValid } from './utils/internal';
|
|
23
20
|
|
|
24
21
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
25
|
-
var dateTextFieldWrapper =
|
|
26
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
27
|
-
padding: '22px',
|
|
28
|
-
paddingBottom: "var(--ds-space-150, 12px)"
|
|
29
|
-
});
|
|
22
|
+
var dateTextFieldWrapper = null;
|
|
30
23
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
24
|
var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
32
25
|
function DatePickerInput(props) {
|
|
@@ -199,9 +192,9 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
199
192
|
|
|
200
193
|
// Don't display an error for an empty input.
|
|
201
194
|
var displayError = (attemptedDateParse === null || !possiblyValid) && inputText !== '';
|
|
202
|
-
return
|
|
203
|
-
|
|
204
|
-
},
|
|
195
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: ax(["_ca0qqslr _n3tdutpp _19bvqslr _u5f3qslr"])
|
|
197
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
205
198
|
name: "datetextfield",
|
|
206
199
|
value: inputText,
|
|
207
200
|
ref: this.handleInputRef,
|
|
@@ -212,7 +205,7 @@ var DatePickerInput = /*#__PURE__*/function (_React$Component) {
|
|
|
212
205
|
autoComplete: "off",
|
|
213
206
|
isInvalid: displayError,
|
|
214
207
|
"aria-label": formatMessage(messages.onKeyUpDownText)
|
|
215
|
-
}), displayError &&
|
|
208
|
+
}), displayError && /*#__PURE__*/React.createElement(ErrorMessage, null, formatMessage(messages.invalidDateError)));
|
|
216
209
|
}
|
|
217
210
|
}, {
|
|
218
211
|
key: "componentDidUpdate",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}._16qskkzs{box-shadow:var(--_es7za0)}
|
|
3
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
|
+
._bfhk13b4{background-color:var(--_1f6rtr1)}
|
|
5
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
6
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
7
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import "./index.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
/**
|
|
10
|
-
* @jsxRuntime classic
|
|
11
|
-
* @jsx jsx
|
|
12
|
-
*/
|
|
13
12
|
import React from 'react';
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
|
-
import { css, jsx } from '@emotion/react';
|
|
17
13
|
import { injectIntl } from 'react-intl-next';
|
|
18
14
|
import Calendar from '@atlaskit/calendar';
|
|
19
15
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -21,18 +17,11 @@ import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@a
|
|
|
21
17
|
import { timestampToIsoFormat, timestampToUTCDate } from '@atlaskit/editor-common/utils';
|
|
22
18
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
23
19
|
import { N0, N60A } from '@atlaskit/theme/colors';
|
|
24
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
25
20
|
var PopupWithListeners = withOuterListeners(Popup);
|
|
26
21
|
import DatePickerInput from './date-picker-input';
|
|
27
22
|
|
|
28
23
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
29
|
-
var popupContentWrapper =
|
|
30
|
-
padding: "var(--ds-space-025, 2px)",
|
|
31
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
|
-
borderRadius: "".concat(borderRadius(), "px"),
|
|
33
|
-
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"),
|
|
34
|
-
backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")")
|
|
35
|
-
});
|
|
24
|
+
var popupContentWrapper = null;
|
|
36
25
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
37
26
|
var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
38
27
|
function DatePicker(props) {
|
|
@@ -133,7 +122,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
133
122
|
if (!timestamp) {
|
|
134
123
|
return null;
|
|
135
124
|
}
|
|
136
|
-
return
|
|
125
|
+
return /*#__PURE__*/React.createElement(PopupWithListeners
|
|
137
126
|
// Ignored via go/ees005
|
|
138
127
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
139
128
|
, {
|
|
@@ -149,11 +138,15 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
149
138
|
scrollableElement: scrollableElement,
|
|
150
139
|
ariaLabel: null,
|
|
151
140
|
preventOverflow: true
|
|
152
|
-
},
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
}, /*#__PURE__*/React.createElement(PlainOutsideClickTargetRefContext.Consumer, null, function (setOutsideClickTargetRef) {
|
|
142
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
ref: setOutsideClickTargetRef,
|
|
144
|
+
className: ax(["_2rko1sit _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _16qskkzs _bfhk13b4"]),
|
|
145
|
+
style: {
|
|
146
|
+
"--_es7za0": ix("var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")")),
|
|
147
|
+
"--_1f6rtr1": ix("var(--ds-surface-overlay, ".concat(N0, ")"))
|
|
148
|
+
}
|
|
149
|
+
}, /*#__PURE__*/React.createElement(DatePickerInput, {
|
|
157
150
|
date: date,
|
|
158
151
|
onNewDate: _this2.handleNewDate,
|
|
159
152
|
onSubmitDate: _this2.handleKeyboardSubmitDate,
|
|
@@ -162,7 +155,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
162
155
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
163
156
|
autoFocus: autoFocus,
|
|
164
157
|
autoSelectAll: isNew
|
|
165
|
-
}),
|
|
158
|
+
}), /*#__PURE__*/React.createElement(Calendar, {
|
|
166
159
|
onChange: _this2.handleOnChange,
|
|
167
160
|
onSelect: function onSelect(date) {
|
|
168
161
|
return _onSelect(date, INPUT_METHOD.PICKER);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,16 +25,19 @@
|
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
"sideEffects":
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"**/*.compiled.css"
|
|
30
|
+
],
|
|
29
31
|
"atlaskit:src": "src/index.ts",
|
|
30
32
|
"af:exports": {
|
|
31
33
|
".": "./src/index.ts"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
36
|
"@atlaskit/adf-schema": "^47.2.1",
|
|
35
|
-
"@atlaskit/calendar": "^17.
|
|
37
|
+
"@atlaskit/calendar": "^17.1.0",
|
|
38
|
+
"@atlaskit/css": "^0.10.0",
|
|
36
39
|
"@atlaskit/date": "^2.0.0",
|
|
37
|
-
"@atlaskit/editor-common": "^100.
|
|
40
|
+
"@atlaskit/editor-common": "^100.2.0",
|
|
38
41
|
"@atlaskit/editor-plugin-analytics": "^2.0.0",
|
|
39
42
|
"@atlaskit/editor-plugin-annotation": "2.0.2",
|
|
40
43
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
@@ -49,7 +52,6 @@
|
|
|
49
52
|
"@atlaskit/theme": "^17.0.0",
|
|
50
53
|
"@atlaskit/tokens": "^4.2.0",
|
|
51
54
|
"@babel/runtime": "^7.0.0",
|
|
52
|
-
"@emotion/react": "^11.7.1",
|
|
53
55
|
"date-fns": "^2.17.0",
|
|
54
56
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
55
57
|
"react-loadable": "^5.1.0"
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
"@atlaskit/editor-plugin-quick-insert": "^2.0.0",
|
|
64
66
|
"@atlaskit/editor-plugin-selection": "^2.0.0",
|
|
65
67
|
"@atlaskit/editor-plugin-table": "^10.1.0",
|
|
66
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^
|
|
68
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^4.0.0",
|
|
67
69
|
"@atlaskit/editor-plugin-type-ahead": "^2.0.0",
|
|
68
70
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
69
71
|
"@testing-library/react": "^13.4.0"
|
|
@@ -100,8 +102,7 @@
|
|
|
100
102
|
],
|
|
101
103
|
"deprecation": "no-deprecated-imports",
|
|
102
104
|
"styling": [
|
|
103
|
-
"
|
|
104
|
-
"emotion"
|
|
105
|
+
"compiled"
|
|
105
106
|
],
|
|
106
107
|
"imports": [
|
|
107
108
|
"import-no-extraneous-disable-for-examples-and-docs"
|