@forge/react
11.14.2-next.211.14.2-next.3
out/components/inline-edit.js~
out/components/inline-edit.jsModified+6−1
Index: package/out/components/inline-edit.js
===================================================================
--- package/out/components/inline-edit.js
+++ package/out/components/inline-edit.js
@@ -3,9 +3,8 @@
exports.InlineEdit = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const content_wrapper_1 = require("./utils/content-wrapper");
-const InlineEditPrimitive = 'InlineEdit';
/**
* The following workaround is required because functions cannot be passed outside of the runtime.
* The Renderer will invoke the function from within the runtime
* Instead of passing the function, we are reimplementing validation and confirmation here to provide the same behaviour as the ADS version.
@@ -18,8 +17,14 @@
*
* readView and editView also need to be evaluated here so that into a primitive type(JS object) to be rendered by the Renderer. Otherwise the Renderer will not be able to evaluate them on the product side.
*
*/
+const InlineEditPrimitive = 'InlineEdit';
+/**
+ * An inline edit displays a custom input component that switches between reading and editing on the same page.
+ *
+ * @see [InlineEdit](https://developer.atlassian.com/platform/forge/ui-kit/components/inline-edit/) in UI Kit documentation for more information
+ */
const InlineEdit = ({ label, readView, editView, validate, startWithEditViewOpen, keepEditViewOpenOnBlur, hideActionButtons, isRequired, readViewFitContainerWidth, editButtonLabel, confirmButtonLabel, cancelButtonLabel, defaultValue, isEditing, onConfirm, onCancel, onEdit }) => {
const [prevValue, setPrevValue] = (0, react_1.useState)();
const [value, setValue] = (0, react_1.useState)(defaultValue);
const [_isEditing, _setIsEditing] = (0, react_1.useState)(startWithEditViewOpen ? startWithEditViewOpen : false);