forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Index pattern field editor] Add preview for runtime fields (elastic#…
- Loading branch information
1 parent
66926a8
commit d96cffa
Showing
103 changed files
with
5,260 additions
and
731 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.../core/public/kibana-plugin-core-public.overlayflyoutopenoptions._aria-label_.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) > ["aria-label"](./kibana-plugin-core-public.overlayflyoutopenoptions._aria-label_.md) | ||
|
||
## OverlayFlyoutOpenOptions."aria-label" property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
'aria-label'?: string; | ||
``` |
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
13 changes: 13 additions & 0 deletions
13
...pment/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md
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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) > [onClose](./kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md) | ||
|
||
## OverlayFlyoutOpenOptions.onClose property | ||
|
||
EuiFlyout onClose handler. If provided the consumer is responsible for calling flyout.close() to close the flyout; | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
onClose?: (flyout: OverlayRef) => void; | ||
``` |
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
51 changes: 51 additions & 0 deletions
51
src/plugins/es_ui_shared/static/forms/docs/core/use_form_is_modified.mdx
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,51 @@ | ||
--- | ||
id: formLibCoreUseFormIsModified | ||
slug: /form-lib/core/use-form-is-modified | ||
title: useFormIsModified() | ||
summary: Know when your form has been modified by the user | ||
tags: ['forms', 'kibana', 'dev'] | ||
date: 2021-06-15 | ||
--- | ||
|
||
**Returns:** `boolean` | ||
|
||
There might be cases where you need to know if the form has been modified by the user. For example: the user is about to leave the form after making some changes, you might want to show a modal indicating that the changes will be lost. | ||
|
||
For that you can use the `useFormIsModified` hook which will update each time any of the field value changes. If the user makes a change and then undoes the change and puts the initial value back, the form **won't be marked** as modified. | ||
|
||
**Important:** If you form dynamically adds and removes fields, the `isModified` state will be set to `true` when a field is removed from the DOM **only** if it was declared in the form initial `defaultValue` object. | ||
|
||
## Options | ||
|
||
### form | ||
|
||
**Type:** `FormHook` | ||
|
||
The form hook object. It is only required to provide the form hook object in your **root form component**. | ||
|
||
```js | ||
const RootFormComponent = () => { | ||
// root form component, where the form object is declared | ||
const { form } = useForm(); | ||
const isModified = useFormIsModified({ form }); | ||
|
||
return ( | ||
<Form form={form}> | ||
<ChildComponent /> | ||
</Form> | ||
); | ||
}; | ||
|
||
const ChildComponent = () => { | ||
const isModified = useFormIsModified(); // no need to provide the form object | ||
return ( | ||
<div>...</div> | ||
); | ||
}; | ||
``` | ||
|
||
### discard | ||
|
||
**Type:** `string[]` | ||
|
||
If there are certain fields that you want to discard when checking if the form has been modified you can provide an array of field paths to the `discard` option. |
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
Oops, something went wrong.