@atlaskit/inline-edit 12.4.0 → 12.4.1
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 +6 -0
- package/dist/cjs/inline-edit.js +61 -59
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/inline-edit.js +62 -61
- package/dist/es2019/version.json +1 -1
- package/dist/esm/inline-edit.js +61 -59
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 12.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4f5a3b9d776`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4f5a3b9d776) - Improvement to last regression bugfix where internal form state persisted across blur and cancel incorrectly
|
|
8
|
+
|
|
3
9
|
## 12.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -32,7 +32,7 @@ var buttonStyles = (0, _react2.css)({
|
|
|
32
32
|
var analyticsAttributes = {
|
|
33
33
|
componentName: 'inlineEdit',
|
|
34
34
|
packageName: "@atlaskit/inline-edit",
|
|
35
|
-
packageVersion: "12.4.
|
|
35
|
+
packageVersion: "12.4.1"
|
|
36
36
|
};
|
|
37
37
|
var noop = function noop() {};
|
|
38
38
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
@@ -158,70 +158,72 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
158
158
|
readView: readView
|
|
159
159
|
});
|
|
160
160
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
161
|
+
if (shouldBeEditing) {
|
|
162
|
+
return (0, _react2.jsx)(_Form.default, {
|
|
163
|
+
onSubmit: function onSubmit(data) {
|
|
164
|
+
return onConfirm(data.inlineEdit);
|
|
165
|
+
}
|
|
166
|
+
}, function (_ref) {
|
|
167
|
+
var _ref$formProps = _ref.formProps,
|
|
168
|
+
_onKeyDown = _ref$formProps.onKeyDown,
|
|
169
|
+
onSubmit = _ref$formProps.onSubmit,
|
|
170
|
+
formRef = _ref$formProps.ref;
|
|
171
|
+
return (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
|
|
172
|
+
(0, _react2.jsx)("form", {
|
|
173
|
+
onKeyDown: function onKeyDown(e) {
|
|
174
|
+
_onKeyDown(e);
|
|
175
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
176
|
+
onCancel();
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
onSubmit: onSubmit,
|
|
180
|
+
ref: formRef
|
|
181
|
+
}, (0, _react2.jsx)(_Field.default, {
|
|
182
|
+
name: "inlineEdit",
|
|
183
|
+
label: label,
|
|
184
|
+
defaultValue: defaultValue,
|
|
185
|
+
validate: validate,
|
|
186
|
+
isRequired: isRequired,
|
|
187
|
+
key: "edit-view" // used for reset to default value
|
|
188
|
+
}, function (_ref2) {
|
|
189
|
+
var fieldProps = _ref2.fieldProps,
|
|
190
|
+
error = _ref2.error;
|
|
191
|
+
return (0, _react2.jsx)("div", {
|
|
192
|
+
css: fieldStyles,
|
|
193
|
+
onBlur: function onBlur() {
|
|
194
|
+
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
195
|
+
},
|
|
196
|
+
onFocus: onEditViewWrapperFocus
|
|
197
|
+
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
198
|
+
errorMessage: error
|
|
199
|
+
}), editViewRef), !hideActionButtons ? (0, _react2.jsx)(_buttons.default, {
|
|
200
|
+
cancelButtonLabel: cancelButtonLabel,
|
|
201
|
+
confirmButtonLabel: confirmButtonLabel,
|
|
202
|
+
onMouseDown: function onMouseDown() {
|
|
203
|
+
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
204
|
+
doNotFocusOnEditButton();
|
|
205
|
+
},
|
|
206
|
+
mode: mode,
|
|
207
|
+
onCancelClick: onCancelClick
|
|
208
|
+
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
209
|
+
(0, _react2.jsx)("button", {
|
|
210
|
+
css: buttonStyles,
|
|
211
|
+
type: "submit"
|
|
212
|
+
}));
|
|
213
|
+
}))
|
|
214
|
+
);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return (/** Form, Field are used here only for the label and spacing */
|
|
218
|
+
(0, _react2.jsx)("form", null, (0, _react2.jsx)(_Field.default, {
|
|
215
219
|
name: "inlineEdit",
|
|
216
220
|
label: label,
|
|
217
221
|
defaultValue: "",
|
|
218
222
|
isRequired: isRequired,
|
|
219
223
|
key: "read-view" // used for reset to default value
|
|
220
|
-
}, renderReadView))
|
|
221
|
-
|
|
222
|
-
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
|
|
224
|
+
}, renderReadView))
|
|
225
|
+
);
|
|
223
226
|
};
|
|
224
|
-
|
|
225
227
|
var InlineEdit = function InlineEdit(props) {
|
|
226
228
|
return (0, _react2.jsx)(_components.default.Consumer, null, function (tokens) {
|
|
227
229
|
var mode = tokens.mode;
|
package/dist/cjs/version.json
CHANGED
|
@@ -19,7 +19,7 @@ const buttonStyles = css({
|
|
|
19
19
|
const analyticsAttributes = {
|
|
20
20
|
componentName: 'inlineEdit',
|
|
21
21
|
packageName: "@atlaskit/inline-edit",
|
|
22
|
-
packageVersion: "12.4.
|
|
22
|
+
packageVersion: "12.4.1"
|
|
23
23
|
};
|
|
24
24
|
const noop = () => {};
|
|
25
25
|
const InnerInlineEdit = props => {
|
|
@@ -134,68 +134,69 @@ const InnerInlineEdit = props => {
|
|
|
134
134
|
readView: readView
|
|
135
135
|
});
|
|
136
136
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
ref: formRef
|
|
146
|
-
}
|
|
147
|
-
}) => jsx("form", {
|
|
148
|
-
onKeyDown: e => {
|
|
149
|
-
onKeyDown(e);
|
|
150
|
-
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
151
|
-
onCancel();
|
|
137
|
+
if (shouldBeEditing) {
|
|
138
|
+
return jsx(Form, {
|
|
139
|
+
onSubmit: data => onConfirm(data.inlineEdit)
|
|
140
|
+
}, ({
|
|
141
|
+
formProps: {
|
|
142
|
+
onKeyDown,
|
|
143
|
+
onSubmit,
|
|
144
|
+
ref: formRef
|
|
152
145
|
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
146
|
+
}) => /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
|
|
147
|
+
jsx("form", {
|
|
148
|
+
onKeyDown: e => {
|
|
149
|
+
onKeyDown(e);
|
|
150
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
151
|
+
onCancel();
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
onSubmit: onSubmit,
|
|
155
|
+
ref: formRef
|
|
156
|
+
}, jsx(Field, {
|
|
157
|
+
name: "inlineEdit",
|
|
158
|
+
label: label,
|
|
159
|
+
defaultValue: defaultValue,
|
|
160
|
+
validate: validate,
|
|
161
|
+
isRequired: isRequired,
|
|
162
|
+
key: "edit-view" // used for reset to default value
|
|
163
|
+
}, ({
|
|
164
|
+
fieldProps,
|
|
165
|
+
error
|
|
166
|
+
}) => jsx("div", {
|
|
167
|
+
css: fieldStyles,
|
|
168
|
+
onBlur: () => {
|
|
169
|
+
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
170
|
+
},
|
|
171
|
+
onFocus: onEditViewWrapperFocus
|
|
172
|
+
}, editView({
|
|
173
|
+
...fieldProps,
|
|
174
|
+
errorMessage: error
|
|
175
|
+
}, editViewRef), !hideActionButtons ? jsx(Buttons, {
|
|
176
|
+
cancelButtonLabel: cancelButtonLabel,
|
|
177
|
+
confirmButtonLabel: confirmButtonLabel,
|
|
178
|
+
onMouseDown: () => {
|
|
179
|
+
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
180
|
+
doNotFocusOnEditButton();
|
|
181
|
+
},
|
|
182
|
+
mode: mode,
|
|
183
|
+
onCancelClick: onCancelClick
|
|
184
|
+
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
185
|
+
jsx("button", {
|
|
186
|
+
css: buttonStyles,
|
|
187
|
+
type: "submit"
|
|
188
|
+
})))));
|
|
189
|
+
}
|
|
190
|
+
return (/** Form, Field are used here only for the label and spacing */
|
|
191
|
+
jsx("form", null, jsx(Field, {
|
|
192
|
+
name: "inlineEdit",
|
|
193
|
+
label: label,
|
|
194
|
+
defaultValue: "",
|
|
195
|
+
isRequired: isRequired,
|
|
196
|
+
key: "read-view" // used for reset to default value
|
|
197
|
+
}, renderReadView))
|
|
198
|
+
);
|
|
197
199
|
};
|
|
198
|
-
|
|
199
200
|
const InlineEdit = props => {
|
|
200
201
|
return jsx(GlobalTheme.Consumer, null, tokens => {
|
|
201
202
|
const mode = tokens.mode;
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/inline-edit.js
CHANGED
|
@@ -23,7 +23,7 @@ var buttonStyles = css({
|
|
|
23
23
|
var analyticsAttributes = {
|
|
24
24
|
componentName: 'inlineEdit',
|
|
25
25
|
packageName: "@atlaskit/inline-edit",
|
|
26
|
-
packageVersion: "12.4.
|
|
26
|
+
packageVersion: "12.4.1"
|
|
27
27
|
};
|
|
28
28
|
var noop = function noop() {};
|
|
29
29
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
@@ -149,70 +149,72 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
149
149
|
readView: readView
|
|
150
150
|
});
|
|
151
151
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
152
|
+
if (shouldBeEditing) {
|
|
153
|
+
return jsx(Form, {
|
|
154
|
+
onSubmit: function onSubmit(data) {
|
|
155
|
+
return onConfirm(data.inlineEdit);
|
|
156
|
+
}
|
|
157
|
+
}, function (_ref) {
|
|
158
|
+
var _ref$formProps = _ref.formProps,
|
|
159
|
+
_onKeyDown = _ref$formProps.onKeyDown,
|
|
160
|
+
onSubmit = _ref$formProps.onSubmit,
|
|
161
|
+
formRef = _ref$formProps.ref;
|
|
162
|
+
return (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
|
|
163
|
+
jsx("form", {
|
|
164
|
+
onKeyDown: function onKeyDown(e) {
|
|
165
|
+
_onKeyDown(e);
|
|
166
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
167
|
+
onCancel();
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
onSubmit: onSubmit,
|
|
171
|
+
ref: formRef
|
|
172
|
+
}, jsx(Field, {
|
|
173
|
+
name: "inlineEdit",
|
|
174
|
+
label: label,
|
|
175
|
+
defaultValue: defaultValue,
|
|
176
|
+
validate: validate,
|
|
177
|
+
isRequired: isRequired,
|
|
178
|
+
key: "edit-view" // used for reset to default value
|
|
179
|
+
}, function (_ref2) {
|
|
180
|
+
var fieldProps = _ref2.fieldProps,
|
|
181
|
+
error = _ref2.error;
|
|
182
|
+
return jsx("div", {
|
|
183
|
+
css: fieldStyles,
|
|
184
|
+
onBlur: function onBlur() {
|
|
185
|
+
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
186
|
+
},
|
|
187
|
+
onFocus: onEditViewWrapperFocus
|
|
188
|
+
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
189
|
+
errorMessage: error
|
|
190
|
+
}), editViewRef), !hideActionButtons ? jsx(Buttons, {
|
|
191
|
+
cancelButtonLabel: cancelButtonLabel,
|
|
192
|
+
confirmButtonLabel: confirmButtonLabel,
|
|
193
|
+
onMouseDown: function onMouseDown() {
|
|
194
|
+
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
195
|
+
doNotFocusOnEditButton();
|
|
196
|
+
},
|
|
197
|
+
mode: mode,
|
|
198
|
+
onCancelClick: onCancelClick
|
|
199
|
+
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
200
|
+
jsx("button", {
|
|
201
|
+
css: buttonStyles,
|
|
202
|
+
type: "submit"
|
|
203
|
+
}));
|
|
204
|
+
}))
|
|
205
|
+
);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return (/** Form, Field are used here only for the label and spacing */
|
|
209
|
+
jsx("form", null, jsx(Field, {
|
|
206
210
|
name: "inlineEdit",
|
|
207
211
|
label: label,
|
|
208
212
|
defaultValue: "",
|
|
209
213
|
isRequired: isRequired,
|
|
210
214
|
key: "read-view" // used for reset to default value
|
|
211
|
-
}, renderReadView))
|
|
212
|
-
|
|
213
|
-
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
|
|
215
|
+
}, renderReadView))
|
|
216
|
+
);
|
|
214
217
|
};
|
|
215
|
-
|
|
216
218
|
var InlineEdit = function InlineEdit(props) {
|
|
217
219
|
return jsx(GlobalTheme.Consumer, null, function (tokens) {
|
|
218
220
|
var mode = tokens.mode;
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-edit",
|
|
3
|
-
"version": "12.4.
|
|
3
|
+
"version": "12.4.1",
|
|
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/"
|