-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
) * Added isInvalid and isLoading props to EuiInlineEdit components (form, title, text). * [REVERT ME] Added prop toggles to the EuiInlineEditText example for validation * Revert "[REVERT ME] Added prop toggles to the EuiInlineEditText example for validation" This reverts commit b72c9ca. Reverting documentation change that was for PR assistance. It's no longer needed. * Updated EuiInlineEditForm by removing the isLoading prop on the confirm and cancel buttons. Instead, these are wrapped in the skeleton component when loading. * Added a new documentation view for the isLoading prop * Updated the editModeProps property to include the erorr prop from EuiFormRowProps. Additionally wrapped EuiFieldText inside of EuiFormRow. This is to allow consumers to pass an error message to the EuiFormRow when the isValid prop is false. * -[PR Feedback] Removed the onChange method from the loading example and placed it directly on the switch element - Created the isValid documentation example * Remove blunder * Added the skeletonHeight index to sizes object. The Skeleton buttons used when isLoading is true need to be smaller when the form is compressed * [PR Feedback - Update the editModeProps prop to include two sub-objects. This includes one that will be placed on the form row and the other will be placed on the input form control in edit mode * [PR Feedback - Combined the isLoading and isValid prop documentation examples. Removed the isValid example completely. * [PR Feedback - Remove hard coded values used for the EuiSkeletonRectangle height when isLoading is true * Update src/components/inline_edit/inline_edit_form.tsx Co-authored-by: Cee Chen <[email protected]> * Update src/components/inline_edit/inline_edit_form.tsx Co-authored-by: Cee Chen <[email protected]> * Update src/components/inline_edit/inline_edit_form.tsx Co-authored-by: Cee Chen <[email protected]> * Updated docs that used the editModeProps prop with EuiInlineEdit * Removed unused code block in EuiInlineEditForm * Update src-docs/src/views/inline_edit/inline_edit_example.js Co-authored-by: Cee Chen <[email protected]> * [PR Feedback] - Removed readModeProps from InlineEditTitle example. Allowed Prettier to format the copy on a documentation file --------- Co-authored-by: Cee Chen <[email protected]>
- Loading branch information
Showing
7 changed files
with
171 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
EuiFlexGroup, | ||
EuiInlineEditText, | ||
EuiSwitch, | ||
EuiSpacer, | ||
} from '../../../../src'; | ||
|
||
export default () => { | ||
const [toggleLoading, setToggleLoading] = useState(true); | ||
|
||
const [toggleValid, setToggleValid] = useState(false); | ||
|
||
const errorMessage = ["Here's an example of an error"]; | ||
|
||
return ( | ||
<> | ||
<EuiFlexGroup> | ||
<EuiSwitch | ||
label="Toggle loading state" | ||
checked={toggleLoading} | ||
onChange={(e) => setToggleLoading(e.target.checked)} | ||
/> | ||
|
||
<EuiSwitch | ||
label="Toggle validation state" | ||
checked={toggleValid} | ||
onChange={(e) => setToggleValid(e.target.checked)} | ||
/> | ||
</EuiFlexGroup> | ||
|
||
<EuiSpacer /> | ||
|
||
<EuiInlineEditText | ||
inputAriaLabel="Edit text inline" | ||
defaultValue="Hello World!" | ||
size="m" | ||
isLoading={toggleLoading} | ||
isInvalid={toggleValid} | ||
editModeProps={{ formRowProps: { error: errorMessage } }} | ||
startWithEditOpen={true} | ||
/> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters