@atlaskit/inline-edit 12.1.12 → 12.2.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 +22 -0
- package/dist/cjs/inline-edit.js +14 -14
- package/dist/cjs/inline-editable-textfield.js +11 -11
- package/dist/cjs/internal/buttons.js +12 -12
- package/dist/cjs/internal/read-view.js +8 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/inline-edit.js +2 -2
- package/dist/es2019/inline-editable-textfield.js +1 -1
- package/dist/es2019/internal/buttons.js +1 -1
- package/dist/es2019/internal/read-view.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/inline-edit.js +2 -2
- package/dist/esm/inline-editable-textfield.js +1 -1
- package/dist/esm/internal/buttons.js +1 -1
- package/dist/esm/internal/read-view.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/inline-edit.d.ts +2 -2
- package/dist/types/inline-editable-textfield.d.ts +3 -2
- package/dist/types/internal/buttons.d.ts +2 -1
- package/dist/types/internal/read-view.d.ts +2 -1
- package/inline-edit/package.json +1 -0
- package/inline-editable-textfield/package.json +1 -0
- package/package.json +18 -16
- package/report.api.md +99 -0
- package/types/package.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 12.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`b52ffa29d19`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b52ffa29d19) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 12.1.14
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
18
|
+
|
|
19
|
+
## 12.1.13
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 12.1.12
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -17,7 +17,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react2 = require("@emotion/react");
|
|
21
21
|
|
|
22
22
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
23
23
|
|
|
@@ -41,17 +41,17 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
41
41
|
|
|
42
42
|
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; }
|
|
43
43
|
|
|
44
|
-
var fieldStyles = (0,
|
|
44
|
+
var fieldStyles = (0, _react2.css)({
|
|
45
45
|
maxWidth: '100%',
|
|
46
46
|
position: 'relative'
|
|
47
47
|
});
|
|
48
|
-
var buttonStyles = (0,
|
|
48
|
+
var buttonStyles = (0, _react2.css)({
|
|
49
49
|
display: 'none'
|
|
50
50
|
});
|
|
51
51
|
var analyticsAttributes = {
|
|
52
52
|
componentName: 'inlineEdit',
|
|
53
53
|
packageName: "@atlaskit/inline-edit",
|
|
54
|
-
packageVersion: "12.
|
|
54
|
+
packageVersion: "12.2.0"
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
var noop = function noop() {};
|
|
@@ -180,7 +180,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
180
180
|
}, []);
|
|
181
181
|
|
|
182
182
|
var renderReadView = function renderReadView() {
|
|
183
|
-
return (0,
|
|
183
|
+
return (0, _react2.jsx)(_readView.default, {
|
|
184
184
|
editButtonLabel: editButtonLabel,
|
|
185
185
|
onEditRequested: onEditRequested,
|
|
186
186
|
postReadViewClick: doNotFocusOnEditButton,
|
|
@@ -192,7 +192,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
192
192
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
193
193
|
|
|
194
194
|
|
|
195
|
-
return (0,
|
|
195
|
+
return (0, _react2.jsx)(_Form.default, {
|
|
196
196
|
onSubmit: function onSubmit(data) {
|
|
197
197
|
return onConfirm(data.inlineEdit);
|
|
198
198
|
}
|
|
@@ -201,7 +201,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
201
201
|
_onKeyDown = _ref$formProps.onKeyDown,
|
|
202
202
|
onSubmit = _ref$formProps.onSubmit,
|
|
203
203
|
formRef = _ref$formProps.ref;
|
|
204
|
-
return (0,
|
|
204
|
+
return (0, _react2.jsx)("form", {
|
|
205
205
|
onKeyDown: function onKeyDown(e) {
|
|
206
206
|
_onKeyDown(e);
|
|
207
207
|
|
|
@@ -211,7 +211,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
211
211
|
},
|
|
212
212
|
onSubmit: onSubmit,
|
|
213
213
|
ref: formRef
|
|
214
|
-
}, shouldBeEditing ? (0,
|
|
214
|
+
}, shouldBeEditing ? (0, _react2.jsx)(_Field.default, {
|
|
215
215
|
name: "inlineEdit",
|
|
216
216
|
label: label,
|
|
217
217
|
defaultValue: defaultValue,
|
|
@@ -222,7 +222,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
222
222
|
}, function (_ref2) {
|
|
223
223
|
var fieldProps = _ref2.fieldProps,
|
|
224
224
|
error = _ref2.error;
|
|
225
|
-
return (0,
|
|
225
|
+
return (0, _react2.jsx)("div", {
|
|
226
226
|
css: fieldStyles,
|
|
227
227
|
onBlur: function onBlur() {
|
|
228
228
|
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
@@ -230,7 +230,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
230
230
|
onFocus: onEditViewWrapperFocus
|
|
231
231
|
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
232
232
|
errorMessage: error
|
|
233
|
-
}), editViewRef), !hideActionButtons ? (0,
|
|
233
|
+
}), editViewRef), !hideActionButtons ? (0, _react2.jsx)(_buttons.default, {
|
|
234
234
|
cancelButtonLabel: cancelButtonLabel,
|
|
235
235
|
confirmButtonLabel: confirmButtonLabel,
|
|
236
236
|
onMouseDown: function onMouseDown() {
|
|
@@ -241,13 +241,13 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
241
241
|
onCancelClick: onCancelClick
|
|
242
242
|
}) :
|
|
243
243
|
/** This is to allow Ctrl + Enter to submit without action buttons */
|
|
244
|
-
(0,
|
|
244
|
+
(0, _react2.jsx)("button", {
|
|
245
245
|
css: buttonStyles,
|
|
246
246
|
type: "submit"
|
|
247
247
|
}));
|
|
248
248
|
}) :
|
|
249
249
|
/** Field is used here only for the label */
|
|
250
|
-
(0,
|
|
250
|
+
(0, _react2.jsx)(_Field.default, {
|
|
251
251
|
name: "inlineEdit",
|
|
252
252
|
label: label,
|
|
253
253
|
defaultValue: "",
|
|
@@ -260,9 +260,9 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
var InlineEdit = function InlineEdit(props) {
|
|
263
|
-
return (0,
|
|
263
|
+
return (0, _react2.jsx)(_components.default.Consumer, null, function (tokens) {
|
|
264
264
|
var mode = tokens.mode;
|
|
265
|
-
return (0,
|
|
265
|
+
return (0, _react2.jsx)(InnerInlineEdit, (0, _extends2.default)({}, props, {
|
|
266
266
|
mode: mode
|
|
267
267
|
}));
|
|
268
268
|
});
|
|
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
17
17
|
|
|
@@ -26,11 +26,11 @@ var _inlineEdit = _interopRequireDefault(require("./inline-edit"));
|
|
|
26
26
|
var _constants = require("./internal/constants");
|
|
27
27
|
|
|
28
28
|
var _excluded = ["errorMessage", "isInvalid"];
|
|
29
|
-
var errorIconContainerStyles = (0,
|
|
29
|
+
var errorIconContainerStyles = (0, _react.css)({
|
|
30
30
|
paddingRight: _constants.gridSize - 2,
|
|
31
31
|
lineHeight: '100%'
|
|
32
32
|
});
|
|
33
|
-
var readViewForTextFieldStyles = (0,
|
|
33
|
+
var readViewForTextFieldStyles = (0, _react.css)({
|
|
34
34
|
display: 'flex',
|
|
35
35
|
maxWidth: '100%',
|
|
36
36
|
minHeight: "".concat(_constants.gridSize * 2.5 / _constants.fontSize, "em"),
|
|
@@ -39,7 +39,7 @@ var readViewForTextFieldStyles = (0, _core.css)({
|
|
|
39
39
|
lineHeight: _constants.gridSize * 2.5 / _constants.fontSize,
|
|
40
40
|
wordBreak: 'break-word'
|
|
41
41
|
});
|
|
42
|
-
var compactStyles = (0,
|
|
42
|
+
var compactStyles = (0, _react.css)({
|
|
43
43
|
padding: "".concat(_constants.gridSize / 2, "px ").concat(_constants.gridSize - 2, "px")
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -49,22 +49,22 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
49
49
|
defaultValue = props.defaultValue,
|
|
50
50
|
placeholder = props.placeholder,
|
|
51
51
|
testId = props.testId;
|
|
52
|
-
return (0,
|
|
52
|
+
return (0, _react.jsx)(_inlineEdit.default, (0, _extends2.default)({}, props, {
|
|
53
53
|
defaultValue: defaultValue,
|
|
54
54
|
editView: function editView(_ref) {
|
|
55
55
|
var errorMessage = _ref.errorMessage,
|
|
56
56
|
isInvalid = _ref.isInvalid,
|
|
57
57
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
58
|
-
return (0,
|
|
58
|
+
return (0, _react.jsx)(_inlineDialog.default, {
|
|
59
59
|
isOpen: isInvalid,
|
|
60
|
-
content: (0,
|
|
60
|
+
content: (0, _react.jsx)("div", {
|
|
61
61
|
id: "error-message"
|
|
62
62
|
}, errorMessage),
|
|
63
63
|
placement: "right"
|
|
64
|
-
}, (0,
|
|
65
|
-
elemAfterInput: isInvalid && (0,
|
|
64
|
+
}, (0, _react.jsx)(_textfield.default, (0, _extends2.default)({}, props, {
|
|
65
|
+
elemAfterInput: isInvalid && (0, _react.jsx)("div", {
|
|
66
66
|
css: errorIconContainerStyles
|
|
67
|
-
}, (0,
|
|
67
|
+
}, (0, _react.jsx)(_error.default, {
|
|
68
68
|
label: "error",
|
|
69
69
|
primaryColor: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
|
|
70
70
|
})),
|
|
@@ -74,7 +74,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
74
74
|
})));
|
|
75
75
|
},
|
|
76
76
|
readView: function readView() {
|
|
77
|
-
return (0,
|
|
77
|
+
return (0, _react.jsx)("div", {
|
|
78
78
|
css: [readViewForTextFieldStyles, isCompact && compactStyles],
|
|
79
79
|
"data-compact": isCompact,
|
|
80
80
|
"data-testid": testId && "read-view-".concat(testId)
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
11
|
|
|
12
12
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
20
20
|
var _constants = require("./constants");
|
|
21
21
|
|
|
22
22
|
/** @jsx jsx */
|
|
23
|
-
var buttonsContainerStyles = (0,
|
|
23
|
+
var buttonsContainerStyles = (0, _react.css)({
|
|
24
24
|
display: 'flex',
|
|
25
25
|
marginTop: _constants.gridSize - 2,
|
|
26
26
|
position: 'absolute',
|
|
@@ -28,13 +28,13 @@ var buttonsContainerStyles = (0, _core.css)({
|
|
|
28
28
|
right: 0,
|
|
29
29
|
flexShrink: 0
|
|
30
30
|
});
|
|
31
|
-
var buttonWrapperElevationDarkStyles = (0,
|
|
31
|
+
var buttonWrapperElevationDarkStyles = (0, _react.css)({
|
|
32
32
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.DN50A, ", 0 0 1px ").concat(_colors.DN60A), ")")
|
|
33
33
|
});
|
|
34
|
-
var buttonWrapperElevationLightStyles = (0,
|
|
34
|
+
var buttonWrapperElevationLightStyles = (0, _react.css)({
|
|
35
35
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")
|
|
36
36
|
});
|
|
37
|
-
var buttonWrapperBaseStyles = (0,
|
|
37
|
+
var buttonWrapperBaseStyles = (0, _react.css)({
|
|
38
38
|
boxSizing: 'border-box',
|
|
39
39
|
width: _constants.gridSize * 4,
|
|
40
40
|
zIndex: 200,
|
|
@@ -52,24 +52,24 @@ var Buttons = function Buttons(_ref) {
|
|
|
52
52
|
cancelButtonLabel = _ref.cancelButtonLabel,
|
|
53
53
|
onMouseDown = _ref.onMouseDown,
|
|
54
54
|
onCancelClick = _ref.onCancelClick;
|
|
55
|
-
return (0,
|
|
55
|
+
return (0, _react.jsx)("div", {
|
|
56
56
|
css: buttonsContainerStyles
|
|
57
|
-
}, (0,
|
|
57
|
+
}, (0, _react.jsx)("div", {
|
|
58
58
|
css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
|
|
59
|
-
}, (0,
|
|
59
|
+
}, (0, _react.jsx)(_standardButton.default, {
|
|
60
60
|
"aria-label": confirmButtonLabel,
|
|
61
61
|
type: "submit",
|
|
62
|
-
iconBefore: (0,
|
|
62
|
+
iconBefore: (0, _react.jsx)(_check.default, {
|
|
63
63
|
label: confirmButtonLabel,
|
|
64
64
|
size: "small"
|
|
65
65
|
}),
|
|
66
66
|
shouldFitContainer: true,
|
|
67
67
|
onMouseDown: onMouseDown
|
|
68
|
-
})), (0,
|
|
68
|
+
})), (0, _react.jsx)("div", {
|
|
69
69
|
css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
|
|
70
|
-
}, (0,
|
|
70
|
+
}, (0, _react.jsx)(_standardButton.default, {
|
|
71
71
|
"aria-label": cancelButtonLabel,
|
|
72
|
-
iconBefore: (0,
|
|
72
|
+
iconBefore: (0, _react.jsx)(_cross.default, {
|
|
73
73
|
label: cancelButtonLabel,
|
|
74
74
|
size: "small"
|
|
75
75
|
}),
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
|
|
@@ -20,10 +20,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
22
|
/** @jsx jsx */
|
|
23
|
-
var readViewContainerStyles = (0,
|
|
23
|
+
var readViewContainerStyles = (0, _react2.css)({
|
|
24
24
|
lineHeight: 1
|
|
25
25
|
});
|
|
26
|
-
var editButtonStyles = (0,
|
|
26
|
+
var editButtonStyles = (0, _react2.css)({
|
|
27
27
|
display: 'block',
|
|
28
28
|
margin: '0',
|
|
29
29
|
padding: '0',
|
|
@@ -36,7 +36,7 @@ var editButtonStyles = (0, _core.css)({
|
|
|
36
36
|
border: "2px solid ".concat("var(--ds-border-focused, ".concat(_colors.B100, ")"))
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
var readViewWrapperStyles = (0,
|
|
39
|
+
var readViewWrapperStyles = (0, _react2.css)({
|
|
40
40
|
display: 'inline-block',
|
|
41
41
|
boxSizing: 'border-box',
|
|
42
42
|
width: 'auto',
|
|
@@ -48,7 +48,7 @@ var readViewWrapperStyles = (0, _core.css)({
|
|
|
48
48
|
background: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")")
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
var readViewFitContainerWidthStyles = (0,
|
|
51
|
+
var readViewFitContainerWidthStyles = (0, _react2.css)({
|
|
52
52
|
width: '100%'
|
|
53
53
|
});
|
|
54
54
|
var DRAG_THRESHOLD = 5;
|
|
@@ -80,15 +80,15 @@ var ReadView = function ReadView(_ref) {
|
|
|
80
80
|
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
return (0,
|
|
83
|
+
return (0, _react2.jsx)("div", {
|
|
84
84
|
css: readViewContainerStyles
|
|
85
|
-
}, (0,
|
|
85
|
+
}, (0, _react2.jsx)("button", {
|
|
86
86
|
css: editButtonStyles,
|
|
87
87
|
"aria-label": editButtonLabel,
|
|
88
88
|
type: "button",
|
|
89
89
|
onClick: onEditRequested,
|
|
90
90
|
ref: editButtonRef
|
|
91
|
-
}), (0,
|
|
91
|
+
}), (0, _react2.jsx)("div", {
|
|
92
92
|
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles],
|
|
93
93
|
onClick: onReadViewClick,
|
|
94
94
|
onMouseDown: function onMouseDown(e) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React, { useCallback, useRef, useState } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
7
7
|
import Field from '@atlaskit/form/Field';
|
|
8
8
|
import Form from '@atlaskit/form/Form';
|
|
@@ -20,7 +20,7 @@ const buttonStyles = css({
|
|
|
20
20
|
const analyticsAttributes = {
|
|
21
21
|
componentName: 'inlineEdit',
|
|
22
22
|
packageName: "@atlaskit/inline-edit",
|
|
23
|
-
packageVersion: "12.
|
|
23
|
+
packageVersion: "12.2.0"
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const noop = () => {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { css, jsx } from '@emotion/
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
6
6
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
7
7
|
import Textfield from '@atlaskit/textfield';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import Button from '@atlaskit/button/standard-button';
|
|
4
4
|
import ConfirmIcon from '@atlaskit/icon/glyph/check';
|
|
5
5
|
import CancelIcon from '@atlaskit/icon/glyph/cross';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { B100, N30 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { borderRadius } from './constants';
|
|
6
6
|
const readViewContainerStyles = css({
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/inline-edit.js
CHANGED
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import React, { useCallback, useRef, useState } from 'react';
|
|
11
|
-
import { css, jsx } from '@emotion/
|
|
11
|
+
import { css, jsx } from '@emotion/react';
|
|
12
12
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
13
13
|
import Field from '@atlaskit/form/Field';
|
|
14
14
|
import Form from '@atlaskit/form/Form';
|
|
@@ -26,7 +26,7 @@ var buttonStyles = css({
|
|
|
26
26
|
var analyticsAttributes = {
|
|
27
27
|
componentName: 'inlineEdit',
|
|
28
28
|
packageName: "@atlaskit/inline-edit",
|
|
29
|
-
packageVersion: "12.
|
|
29
|
+
packageVersion: "12.2.0"
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
var noop = function noop() {};
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["errorMessage", "isInvalid"];
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
|
-
import { css, jsx } from '@emotion/
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
8
8
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
9
9
|
import Textfield from '@atlaskit/textfield';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import Button from '@atlaskit/button/standard-button';
|
|
4
4
|
import ConfirmIcon from '@atlaskit/icon/glyph/check';
|
|
5
5
|
import CancelIcon from '@atlaskit/icon/glyph/cross';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { B100, N30 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { borderRadius } from './constants';
|
|
6
6
|
var readViewContainerStyles = css({
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
2
|
import { InlineEditProps } from './types';
|
|
3
|
-
declare const InlineEdit: <FieldValue extends unknown = string>(props: InlineEditProps<FieldValue>) => JSX.Element;
|
|
3
|
+
declare const InlineEdit: <FieldValue extends unknown = string>(props: InlineEditProps<FieldValue>) => jsx.JSX.Element;
|
|
4
4
|
export default InlineEdit;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
import { InlineEditableTextfieldProps } from './types';
|
|
3
|
-
declare const InlineEditableTextfield: (props: InlineEditableTextfieldProps) => JSX.Element;
|
|
4
|
+
declare const InlineEditableTextfield: (props: InlineEditableTextfieldProps) => jsx.JSX.Element;
|
|
4
5
|
export default InlineEditableTextfield;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import { ThemeModes } from '@atlaskit/theme/types';
|
|
4
5
|
interface ButtonsProp {
|
|
5
6
|
mode: ThemeModes;
|
|
@@ -8,5 +9,5 @@ interface ButtonsProp {
|
|
|
8
9
|
onMouseDown: () => void;
|
|
9
10
|
onCancelClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
10
11
|
}
|
|
11
|
-
declare const Buttons: ({ mode, confirmButtonLabel, cancelButtonLabel, onMouseDown, onCancelClick, }: ButtonsProp) => JSX.Element;
|
|
12
|
+
declare const Buttons: ({ mode, confirmButtonLabel, cancelButtonLabel, onMouseDown, onCancelClick, }: ButtonsProp) => jsx.JSX.Element;
|
|
12
13
|
export default Buttons;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
interface ReadViewProps {
|
|
4
5
|
editButtonLabel: string;
|
|
5
6
|
onEditRequested: () => void;
|
|
@@ -8,5 +9,5 @@ interface ReadViewProps {
|
|
|
8
9
|
readViewFitContainerWidth?: boolean;
|
|
9
10
|
readView: () => React.ReactNode;
|
|
10
11
|
}
|
|
11
|
-
declare const ReadView: ({ editButtonLabel, onEditRequested, postReadViewClick, editButtonRef, readViewFitContainerWidth, readView, }: ReadViewProps) => JSX.Element;
|
|
12
|
+
declare const ReadView: ({ editButtonLabel, onEditRequested, postReadViewClick, editButtonRef, readViewFitContainerWidth, readView, }: ReadViewProps) => jsx.JSX.Element;
|
|
12
13
|
export default ReadView;
|
package/inline-edit/package.json
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
"main": "../dist/cjs/entry-points/inline-editable-textfield.js",
|
|
4
4
|
"module": "../dist/esm/entry-points/inline-editable-textfield.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/inline-editable-textfield.js",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"types": "../dist/types/entry-points/inline-editable-textfield.d.ts"
|
|
7
8
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-edit",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0",
|
|
4
4
|
"description": "An inline edit displays a custom input component that switches between reading and editing on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -19,45 +19,46 @@
|
|
|
19
19
|
"team": "Design System Team",
|
|
20
20
|
"releaseModel": "scheduled",
|
|
21
21
|
"website": {
|
|
22
|
-
"name": "Inline edit"
|
|
22
|
+
"name": "Inline edit",
|
|
23
|
+
"category": "Components"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
27
28
|
"@atlaskit/button": "^16.3.0",
|
|
28
|
-
"@atlaskit/codemod-utils": "^4.
|
|
29
|
+
"@atlaskit/codemod-utils": "^4.1.0",
|
|
29
30
|
"@atlaskit/form": "^8.5.0",
|
|
30
31
|
"@atlaskit/icon": "^21.10.0",
|
|
31
|
-
"@atlaskit/inline-dialog": "^13.
|
|
32
|
-
"@atlaskit/textfield": "^5.
|
|
33
|
-
"@atlaskit/theme": "^12.
|
|
34
|
-
"@atlaskit/tokens": "^0.
|
|
32
|
+
"@atlaskit/inline-dialog": "^13.4.0",
|
|
33
|
+
"@atlaskit/textfield": "^5.2.0",
|
|
34
|
+
"@atlaskit/theme": "^12.2.0",
|
|
35
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
35
36
|
"@babel/runtime": "^7.0.0",
|
|
36
|
-
"@emotion/
|
|
37
|
+
"@emotion/react": "^11.7.1"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": "^16.8.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@atlaskit/datetime-picker": "^
|
|
43
|
+
"@atlaskit/datetime-picker": "^12.2.0",
|
|
43
44
|
"@atlaskit/docs": "*",
|
|
44
|
-
"@atlaskit/section-message": "^6.
|
|
45
|
-
"@atlaskit/select": "^15.
|
|
45
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
46
|
+
"@atlaskit/select": "^15.7.0",
|
|
46
47
|
"@atlaskit/ssr": "*",
|
|
47
|
-
"@atlaskit/tag": "^11.
|
|
48
|
-
"@atlaskit/tag-group": "^10.
|
|
48
|
+
"@atlaskit/tag": "^11.4.0",
|
|
49
|
+
"@atlaskit/tag-group": "^10.1.0",
|
|
49
50
|
"@atlaskit/textarea": "^4.3.0",
|
|
50
51
|
"@atlaskit/visual-regression": "*",
|
|
51
52
|
"@atlaskit/webdriver-runner": "*",
|
|
52
53
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
53
|
-
"@emotion/styled": "^
|
|
54
|
+
"@emotion/styled": "^11.0.0",
|
|
54
55
|
"@testing-library/dom": "^7.7.3",
|
|
55
56
|
"@testing-library/react": "^8.0.1",
|
|
56
57
|
"ast-types": "^0.13.3",
|
|
57
58
|
"jscodeshift": "^0.13.0",
|
|
58
59
|
"react-dom": "^16.8.0",
|
|
59
60
|
"storybook-addon-performance": "^0.16.0",
|
|
60
|
-
"typescript": "4.
|
|
61
|
+
"typescript": "4.3.5",
|
|
61
62
|
"wait-for-expect": "^1.2.0"
|
|
62
63
|
},
|
|
63
64
|
"keywords": [
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"import-structure": "atlassian-conventions"
|
|
71
72
|
},
|
|
72
73
|
"@repo/internal": {
|
|
74
|
+
"dom-events": "use-bind-event-listener",
|
|
73
75
|
"ui-components": "lite-mode",
|
|
74
76
|
"analytics": "analytics-next",
|
|
75
77
|
"theming": "tokens",
|
package/report.api.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/inline-edit"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
/// <reference types="react" />
|
|
7
|
+
|
|
8
|
+
import { FieldProps } from '@atlaskit/form';
|
|
9
|
+
import { default as React_2 } from 'react';
|
|
10
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
11
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
12
|
+
|
|
13
|
+
declare interface CommonProps extends WithAnalyticsEventsProps {
|
|
14
|
+
/** Additional information to be included in the `context` of analytics events that come from button. */
|
|
15
|
+
analyticsContext?: Record<string, any>;
|
|
16
|
+
/** Accessibility label for the cancel action button. */
|
|
17
|
+
cancelButtonLabel?: string;
|
|
18
|
+
/** Accessibility label for the confirm action button, which saves the field value into `editValue`. */
|
|
19
|
+
confirmButtonLabel?: string;
|
|
20
|
+
/** The user input entered into the field during `editView`. This value is updated and saved by `onConfirm`. */
|
|
21
|
+
defaultValue: any;
|
|
22
|
+
/** Label above the input field that communicates what value should be entered. */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Displays an inline dialog with a message when the field input is invalid. This is handled by `react-final-form`. */
|
|
25
|
+
validate?: (
|
|
26
|
+
value: any,
|
|
27
|
+
formState: {},
|
|
28
|
+
fieldState: {},
|
|
29
|
+
) => string | void | Promise<string | void>;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the view when the element blurs and loses focus (this can happen when a user clicks away).
|
|
32
|
+
* When set to true, inline edit stays in `editView` when blurred. */
|
|
33
|
+
keepEditViewOpenOnBlur?: boolean;
|
|
34
|
+
/** Sets whether the confirm and cancel action buttons are displayed in the bottom right of the field. */
|
|
35
|
+
hideActionButtons?: boolean;
|
|
36
|
+
/** Determines whether the input value can be confirmed as empty. */
|
|
37
|
+
isRequired?: boolean;
|
|
38
|
+
/** Determines whether the `readView` has 100% width within its container, or whether it fits the content. */
|
|
39
|
+
readViewFitContainerWidth?: boolean;
|
|
40
|
+
/** Accessibility label for button, which is used to enter `editView` from keyboard. */
|
|
41
|
+
editButtonLabel?: string;
|
|
42
|
+
/** Exits `editView` and switches back to `readView`. This is called when the cancel action button (x) is clicked. */
|
|
43
|
+
onCancel?: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Determines whether it begins in `editView` or `readView`. When set to true, `isEditing` begins as true and the inline edit
|
|
46
|
+
* starts in `editView`.
|
|
47
|
+
*/
|
|
48
|
+
startWithEditViewOpen?: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare interface ExtendedFieldProps<FieldValue>
|
|
52
|
+
extends FieldProps<FieldValue> {
|
|
53
|
+
errorMessage?: string | undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare const InlineEdit: <FieldValue extends unknown = string>(
|
|
57
|
+
props: InlineEditProps<FieldValue>,
|
|
58
|
+
) => JSX.Element;
|
|
59
|
+
export default InlineEdit;
|
|
60
|
+
|
|
61
|
+
export declare const InlineEditableTextfield: (
|
|
62
|
+
props: InlineEditableTextfieldProps,
|
|
63
|
+
) => JSX.Element;
|
|
64
|
+
|
|
65
|
+
export declare interface InlineEditableTextfieldProps extends CommonProps {
|
|
66
|
+
/** Sets height of the text field to compact. The top and bottom padding is decreased. */
|
|
67
|
+
isCompact?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Calls the `editView` handler. It confirms the changes.
|
|
70
|
+
* The field value is passed as an argument to this function.
|
|
71
|
+
*/
|
|
72
|
+
onConfirm: (value: string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
73
|
+
/** Text shown in `readView` when the field value is an empty string. */
|
|
74
|
+
placeholder: string;
|
|
75
|
+
/** A `testId` prop is provided for specific elements. This is a unique string that appears as a data attribute `data-testid` in the rendered code and serves as a hook for automated tests.
|
|
76
|
+
*/
|
|
77
|
+
testId?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare interface InlineEditProps<FieldValue> extends CommonProps {
|
|
81
|
+
/** The component shown when user is editing (when the inline edit is not in `readView`). */
|
|
82
|
+
editView: (
|
|
83
|
+
fieldProps: ExtendedFieldProps<FieldValue>,
|
|
84
|
+
ref: React_2.RefObject<any>,
|
|
85
|
+
) => React_2.ReactNode;
|
|
86
|
+
/** Sets whether the component shows the `readView` or the `editView`. This is used to manage the state of the input in stateless inline edit. */
|
|
87
|
+
isEditing?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
Saves and confirms the value entered into the field. It exits `editView` and returns to `readView`.
|
|
90
|
+
*/
|
|
91
|
+
onConfirm: (value: any, analyticsEvent: UIAnalyticsEvent) => void;
|
|
92
|
+
/** Handler called when readView is clicked. */
|
|
93
|
+
onEdit?: () => void;
|
|
94
|
+
/** The component shown when not in `editView`. This is when the inline edit is read-only and not being edited.*/
|
|
95
|
+
readView: () => React_2.ReactNode;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export {};
|
|
99
|
+
```
|