@elastic/eui 77.0.0 → 77.1.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/dist/eui_theme_dark.css +22 -51
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +22 -51
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.a11y.js +3 -1
- package/es/components/accordion/accordion.js +4 -2
- package/es/components/basic_table/table.a11y.js +3 -1
- package/es/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
- package/es/components/card/card.a11y.js +3 -1
- package/es/components/color_picker/color_picker.a11y.js +3 -1
- package/es/components/combo_box/combo_box.a11y.js +3 -1
- package/es/components/combo_box/combo_box.js +2 -21
- package/es/components/combo_box/combo_box_input/combo_box_input.js +66 -36
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/es/components/context_menu/context_menu_panel.a11y.js +3 -1
- package/es/components/control_bar/control_bar.a11y.js +3 -1
- package/es/components/copy/copy.a11y.js +6 -5
- package/es/components/datagrid/data_grid.a11y.js +3 -1
- package/es/components/date_picker/date_picker.a11y.js +3 -1
- package/es/components/date_picker/date_picker.js +148 -155
- package/es/components/date_picker/date_picker_range.js +2 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
- package/es/components/delay_hide/delay_hide.a11y.js +9 -9
- package/es/components/delay_render/delay_render.a11y.js +9 -9
- package/es/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
- package/es/components/empty_prompt/empty_prompt.a11y.js +8 -14
- package/es/components/error_boundary/error_boundary.a11y.js +3 -1
- package/es/components/expression/expression.a11y.js +3 -1
- package/es/components/filter_group/filter_group.a11y.js +4 -3
- package/es/components/flyout/flyout.a11y.js +3 -1
- package/es/components/focus_trap/focus_trap.a11y.js +3 -1
- package/es/components/form/checkbox/checkbox_group.a11y.js +3 -1
- package/es/components/form/file_picker/file_picker.js +4 -2
- package/es/components/form/radio/radio_group.a11y.js +4 -5
- package/es/components/form/range/range.a11y.js +3 -1
- package/es/components/form/switch/switch.a11y.js +4 -5
- package/es/components/form/text_area/text_area.js +11 -3
- package/es/components/form/validatable_control/index.js +1 -1
- package/es/components/form/validatable_control/validatable_control.js +49 -13
- package/es/components/header/header.a11y.js +3 -1
- package/es/components/icon/icon_ML.a11y.js +3 -1
- package/es/components/icon/icon_apps.a11y.js +3 -1
- package/es/components/icon/icon_editor.a11y.js +3 -1
- package/es/components/icon/icon_elastic.a11y.js +3 -1
- package/es/components/icon/icon_glyphs.a11y.js +3 -1
- package/es/components/icon/icon_tokens.a11y.js +3 -1
- package/es/components/image/image.a11y.js +3 -1
- package/es/components/index.js +1 -0
- package/es/components/inline_edit/index.js +10 -0
- package/es/components/inline_edit/inline_edit.styles.js +15 -0
- package/es/components/inline_edit/inline_edit_form.js +190 -0
- package/es/components/inline_edit/inline_edit_text.js +97 -0
- package/es/components/inline_edit/inline_edit_title.js +105 -0
- package/es/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
- package/es/components/modal/modal.a11y.js +3 -1
- package/es/components/notification/notification_event.a11y.js +3 -1
- package/es/components/page/page_header/page_header.a11y.js +3 -1
- package/es/components/pagination/pagination.a11y.js +3 -1
- package/es/components/popover/popover.a11y.js +3 -1
- package/es/components/popover/popover_footer.js +4 -4
- package/es/components/popover/popover_footer.styles.js +16 -5
- package/es/components/popover/popover_panel/_popover_panel.js +8 -5
- package/es/components/portal/portal.a11y.js +3 -1
- package/es/components/progress/progress.a11y.js +3 -1
- package/es/components/resizable_container/resizable_container.a11y.js +3 -1
- package/es/components/search_bar/search_bar.a11y.js +8 -7
- package/es/components/selectable/selectable.a11y.js +3 -1
- package/es/components/side_nav/side_nav.a11y.js +3 -1
- package/es/components/tabs/tabs.a11y.js +3 -1
- package/es/components/tree_view/tree_view.a11y.js +3 -1
- package/eui.d.ts +161 -37
- package/i18ntokens.json +40 -4
- package/lib/components/accordion/accordion.a11y.js +3 -1
- package/lib/components/accordion/accordion.js +4 -2
- package/lib/components/basic_table/table.a11y.js +3 -1
- package/lib/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
- package/lib/components/combo_box/combo_box.js +2 -21
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +66 -36
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/lib/components/context_menu/context_menu_panel.a11y.js +3 -1
- package/lib/components/copy/copy.a11y.js +3 -4
- package/lib/components/date_picker/date_picker.js +147 -153
- package/lib/components/date_picker/date_picker_range.js +2 -2
- package/lib/components/delay_hide/delay_hide.a11y.js +6 -8
- package/lib/components/delay_render/delay_render.a11y.js +6 -8
- package/lib/components/drag_and_drop/drag_and_drop.a11y.js +0 -1
- package/lib/components/empty_prompt/empty_prompt.a11y.js +8 -14
- package/lib/components/error_boundary/error_boundary.a11y.js +3 -1
- package/lib/components/filter_group/filter_group.a11y.js +7 -8
- package/lib/components/form/file_picker/file_picker.js +4 -2
- package/lib/components/form/radio/radio_group.a11y.js +1 -4
- package/lib/components/form/switch/switch.a11y.js +1 -4
- package/lib/components/form/text_area/text_area.js +11 -3
- package/lib/components/form/validatable_control/index.js +6 -0
- package/lib/components/form/validatable_control/validatable_control.js +51 -14
- package/lib/components/icon/icon_ML.a11y.js +3 -1
- package/lib/components/icon/icon_apps.a11y.js +3 -1
- package/lib/components/icon/icon_editor.a11y.js +3 -1
- package/lib/components/icon/icon_elastic.a11y.js +3 -1
- package/lib/components/icon/icon_glyphs.a11y.js +3 -1
- package/lib/components/icon/icon_tokens.a11y.js +3 -1
- package/lib/components/image/image.a11y.js +3 -1
- package/lib/components/index.js +11 -0
- package/lib/components/inline_edit/index.js +19 -0
- package/lib/components/inline_edit/inline_edit.styles.js +22 -0
- package/lib/components/inline_edit/inline_edit_form.js +193 -0
- package/lib/components/inline_edit/inline_edit_text.js +97 -0
- package/lib/components/inline_edit/inline_edit_title.js +106 -0
- package/lib/components/page/page_header/page_header.a11y.js +3 -1
- package/lib/components/popover/popover_footer.js +4 -4
- package/lib/components/popover/popover_footer.styles.js +19 -7
- package/lib/components/popover/popover_panel/_popover_panel.js +7 -4
- package/lib/components/resizable_container/resizable_container.a11y.js +3 -1
- package/lib/components/search_bar/search_bar.a11y.js +5 -6
- package/lib/components/tree_view/tree_view.a11y.js +3 -1
- package/optimize/es/components/accordion/accordion.a11y.js +3 -1
- package/optimize/es/components/accordion/accordion.js +4 -2
- package/optimize/es/components/basic_table/table.a11y.js +3 -1
- package/optimize/es/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
- package/optimize/es/components/card/card.a11y.js +3 -1
- package/optimize/es/components/color_picker/color_picker.a11y.js +3 -1
- package/optimize/es/components/combo_box/combo_box.a11y.js +3 -1
- package/optimize/es/components/combo_box/combo_box.js +2 -21
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +63 -34
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/optimize/es/components/context_menu/context_menu_panel.a11y.js +3 -1
- package/optimize/es/components/control_bar/control_bar.a11y.js +3 -1
- package/optimize/es/components/copy/copy.a11y.js +6 -5
- package/optimize/es/components/datagrid/data_grid.a11y.js +3 -1
- package/optimize/es/components/date_picker/date_picker.a11y.js +3 -1
- package/optimize/es/components/date_picker/date_picker.js +142 -148
- package/optimize/es/components/date_picker/date_picker_range.js +1 -1
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
- package/optimize/es/components/delay_hide/delay_hide.a11y.js +9 -9
- package/optimize/es/components/delay_render/delay_render.a11y.js +9 -9
- package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
- package/optimize/es/components/empty_prompt/empty_prompt.a11y.js +8 -14
- package/optimize/es/components/error_boundary/error_boundary.a11y.js +3 -1
- package/optimize/es/components/expression/expression.a11y.js +3 -1
- package/optimize/es/components/filter_group/filter_group.a11y.js +4 -3
- package/optimize/es/components/flyout/flyout.a11y.js +3 -1
- package/optimize/es/components/focus_trap/focus_trap.a11y.js +3 -1
- package/optimize/es/components/form/checkbox/checkbox_group.a11y.js +3 -1
- package/optimize/es/components/form/file_picker/file_picker.js +4 -2
- package/optimize/es/components/form/radio/radio_group.a11y.js +4 -5
- package/optimize/es/components/form/range/range.a11y.js +3 -1
- package/optimize/es/components/form/switch/switch.a11y.js +4 -5
- package/optimize/es/components/form/text_area/text_area.js +10 -3
- package/optimize/es/components/form/validatable_control/index.js +1 -1
- package/optimize/es/components/form/validatable_control/validatable_control.js +49 -9
- package/optimize/es/components/header/header.a11y.js +3 -1
- package/optimize/es/components/icon/icon_ML.a11y.js +3 -1
- package/optimize/es/components/icon/icon_apps.a11y.js +3 -1
- package/optimize/es/components/icon/icon_editor.a11y.js +3 -1
- package/optimize/es/components/icon/icon_elastic.a11y.js +3 -1
- package/optimize/es/components/icon/icon_glyphs.a11y.js +3 -1
- package/optimize/es/components/icon/icon_tokens.a11y.js +3 -1
- package/optimize/es/components/image/image.a11y.js +3 -1
- package/optimize/es/components/index.js +1 -0
- package/optimize/es/components/inline_edit/index.js +10 -0
- package/optimize/es/components/inline_edit/inline_edit.styles.js +15 -0
- package/optimize/es/components/inline_edit/inline_edit_form.js +133 -0
- package/optimize/es/components/inline_edit/inline_edit_text.js +52 -0
- package/optimize/es/components/inline_edit/inline_edit_title.js +56 -0
- package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
- package/optimize/es/components/modal/modal.a11y.js +3 -1
- package/optimize/es/components/notification/notification_event.a11y.js +3 -1
- package/optimize/es/components/page/page_header/page_header.a11y.js +3 -1
- package/optimize/es/components/pagination/pagination.a11y.js +3 -1
- package/optimize/es/components/popover/popover.a11y.js +3 -1
- package/optimize/es/components/popover/popover_footer.js +4 -4
- package/optimize/es/components/popover/popover_footer.styles.js +16 -5
- package/optimize/es/components/popover/popover_panel/_popover_panel.js +8 -5
- package/optimize/es/components/portal/portal.a11y.js +3 -1
- package/optimize/es/components/progress/progress.a11y.js +3 -1
- package/optimize/es/components/resizable_container/resizable_container.a11y.js +3 -1
- package/optimize/es/components/search_bar/search_bar.a11y.js +8 -7
- package/optimize/es/components/selectable/selectable.a11y.js +3 -1
- package/optimize/es/components/side_nav/side_nav.a11y.js +3 -1
- package/optimize/es/components/tabs/tabs.a11y.js +3 -1
- package/optimize/es/components/tree_view/tree_view.a11y.js +3 -1
- package/optimize/lib/components/accordion/accordion.a11y.js +3 -1
- package/optimize/lib/components/accordion/accordion.js +4 -2
- package/optimize/lib/components/basic_table/table.a11y.js +3 -1
- package/optimize/lib/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
- package/optimize/lib/components/card/card.a11y.js +3 -1
- package/optimize/lib/components/color_picker/color_picker.a11y.js +3 -1
- package/optimize/lib/components/combo_box/combo_box.a11y.js +3 -1
- package/optimize/lib/components/combo_box/combo_box.js +2 -21
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +63 -34
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/optimize/lib/components/context_menu/context_menu_panel.a11y.js +3 -1
- package/optimize/lib/components/control_bar/control_bar.a11y.js +3 -1
- package/optimize/lib/components/copy/copy.a11y.js +6 -5
- package/optimize/lib/components/datagrid/data_grid.a11y.js +3 -1
- package/optimize/lib/components/date_picker/date_picker.a11y.js +3 -1
- package/optimize/lib/components/date_picker/date_picker.js +141 -147
- package/optimize/lib/components/date_picker/date_picker_range.js +1 -1
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
- package/optimize/lib/components/delay_hide/delay_hide.a11y.js +9 -9
- package/optimize/lib/components/delay_render/delay_render.a11y.js +9 -9
- package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
- package/optimize/lib/components/empty_prompt/empty_prompt.a11y.js +8 -14
- package/optimize/lib/components/error_boundary/error_boundary.a11y.js +3 -1
- package/optimize/lib/components/filter_group/filter_group.a11y.js +10 -9
- package/optimize/lib/components/focus_trap/focus_trap.a11y.js +3 -1
- package/optimize/lib/components/form/file_picker/file_picker.js +4 -2
- package/optimize/lib/components/form/radio/radio_group.a11y.js +4 -5
- package/optimize/lib/components/form/range/range.a11y.js +3 -1
- package/optimize/lib/components/form/switch/switch.a11y.js +4 -5
- package/optimize/lib/components/form/text_area/text_area.js +10 -3
- package/optimize/lib/components/form/validatable_control/index.js +6 -0
- package/optimize/lib/components/form/validatable_control/validatable_control.js +52 -12
- package/optimize/lib/components/header/header.a11y.js +3 -1
- package/optimize/lib/components/icon/icon_ML.a11y.js +3 -1
- package/optimize/lib/components/icon/icon_apps.a11y.js +3 -1
- package/optimize/lib/components/icon/icon_editor.a11y.js +3 -1
- package/optimize/lib/components/icon/icon_elastic.a11y.js +3 -1
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +3 -1
- package/optimize/lib/components/icon/icon_tokens.a11y.js +3 -1
- package/optimize/lib/components/image/image.a11y.js +3 -1
- package/optimize/lib/components/index.js +11 -0
- package/optimize/lib/components/inline_edit/index.js +19 -0
- package/optimize/lib/components/inline_edit/inline_edit.styles.js +22 -0
- package/optimize/lib/components/inline_edit/inline_edit_form.js +144 -0
- package/optimize/lib/components/inline_edit/inline_edit_text.js +52 -0
- package/optimize/lib/components/inline_edit/inline_edit_title.js +57 -0
- package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
- package/optimize/lib/components/modal/modal.a11y.js +3 -1
- package/optimize/lib/components/notification/notification_event.a11y.js +3 -1
- package/optimize/lib/components/page/page_header/page_header.a11y.js +3 -1
- package/optimize/lib/components/pagination/pagination.a11y.js +3 -1
- package/optimize/lib/components/popover/popover.a11y.js +3 -1
- package/optimize/lib/components/popover/popover_footer.js +4 -4
- package/optimize/lib/components/popover/popover_footer.styles.js +19 -7
- package/optimize/lib/components/popover/popover_panel/_popover_panel.js +7 -4
- package/optimize/lib/components/portal/portal.a11y.js +3 -1
- package/optimize/lib/components/progress/progress.a11y.js +3 -1
- package/optimize/lib/components/resizable_container/resizable_container.a11y.js +3 -1
- package/optimize/lib/components/search_bar/search_bar.a11y.js +8 -7
- package/optimize/lib/components/selectable/selectable.a11y.js +3 -1
- package/optimize/lib/components/side_nav/side_nav.a11y.js +3 -1
- package/optimize/lib/components/tree_view/tree_view.a11y.js +3 -1
- package/package.json +1 -1
- package/src/components/combo_box/_combo_box.scss +2 -38
- package/src/components/date_picker/_date_picker_range.scss +1 -1
- package/src/components/form/field_text/_field_text.scss +0 -7
- package/src/components/form/file_picker/_file_picker.scss +3 -2
- package/src/components/form/form_control_layout/_form_control_layout.scss +7 -2
- package/src/components/form/text_area/_text_area.scss +9 -0
- package/test-env/components/accordion/accordion.a11y.js +3 -1
- package/test-env/components/accordion/accordion.js +4 -2
- package/test-env/components/basic_table/table.a11y.js +3 -1
- package/test-env/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
- package/test-env/components/card/card.a11y.js +3 -1
- package/test-env/components/color_picker/color_picker.a11y.js +3 -1
- package/test-env/components/combo_box/combo_box.a11y.js +3 -1
- package/test-env/components/combo_box/combo_box.js +2 -21
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +66 -36
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/test-env/components/context_menu/context_menu_panel.a11y.js +3 -1
- package/test-env/components/control_bar/control_bar.a11y.js +3 -1
- package/test-env/components/copy/copy.a11y.js +6 -5
- package/test-env/components/datagrid/data_grid.a11y.js +3 -1
- package/test-env/components/date_picker/date_picker.a11y.js +3 -1
- package/test-env/components/date_picker/date_picker.js +141 -147
- package/test-env/components/date_picker/date_picker_range.js +2 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
- package/test-env/components/delay_hide/delay_hide.a11y.js +9 -9
- package/test-env/components/delay_render/delay_render.a11y.js +9 -9
- package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
- package/test-env/components/empty_prompt/empty_prompt.a11y.js +8 -14
- package/test-env/components/error_boundary/error_boundary.a11y.js +3 -1
- package/test-env/components/filter_group/filter_group.a11y.js +10 -9
- package/test-env/components/focus_trap/focus_trap.a11y.js +3 -1
- package/test-env/components/form/file_picker/file_picker.js +4 -2
- package/test-env/components/form/radio/radio_group.a11y.js +4 -5
- package/test-env/components/form/range/range.a11y.js +3 -1
- package/test-env/components/form/switch/switch.a11y.js +4 -5
- package/test-env/components/form/text_area/text_area.js +11 -3
- package/test-env/components/form/validatable_control/index.js +6 -0
- package/test-env/components/form/validatable_control/validatable_control.js +51 -14
- package/test-env/components/header/header.a11y.js +3 -1
- package/test-env/components/icon/icon_ML.a11y.js +3 -1
- package/test-env/components/icon/icon_apps.a11y.js +3 -1
- package/test-env/components/icon/icon_editor.a11y.js +3 -1
- package/test-env/components/icon/icon_elastic.a11y.js +3 -1
- package/test-env/components/icon/icon_glyphs.a11y.js +3 -1
- package/test-env/components/icon/icon_tokens.a11y.js +3 -1
- package/test-env/components/image/image.a11y.js +3 -1
- package/test-env/components/index.js +11 -0
- package/test-env/components/inline_edit/index.js +19 -0
- package/test-env/components/inline_edit/inline_edit.styles.js +22 -0
- package/test-env/components/inline_edit/inline_edit_form.js +196 -0
- package/test-env/components/inline_edit/inline_edit_text.js +96 -0
- package/test-env/components/inline_edit/inline_edit_title.js +105 -0
- package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
- package/test-env/components/modal/modal.a11y.js +3 -1
- package/test-env/components/notification/notification_event.a11y.js +3 -1
- package/test-env/components/page/page_header/page_header.a11y.js +3 -1
- package/test-env/components/pagination/pagination.a11y.js +3 -1
- package/test-env/components/popover/popover.a11y.js +3 -1
- package/test-env/components/popover/popover_footer.js +4 -4
- package/test-env/components/popover/popover_footer.styles.js +19 -7
- package/test-env/components/popover/popover_panel/_popover_panel.js +7 -4
- package/test-env/components/portal/portal.a11y.js +3 -1
- package/test-env/components/progress/progress.a11y.js +3 -1
- package/test-env/components/resizable_container/resizable_container.a11y.js +3 -1
- package/test-env/components/search_bar/search_bar.a11y.js +8 -7
- package/test-env/components/selectable/selectable.a11y.js +3 -1
- package/test-env/components/side_nav/side_nav.a11y.js +3 -1
- package/test-env/components/tree_view/tree_view.a11y.js +3 -1
|
@@ -16,21 +16,20 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
/// <reference types="
|
|
19
|
+
/// <reference types="cypress" />
|
|
20
|
+
/// <reference types="cypress-real-events" />
|
|
21
|
+
/// <reference types="../../../../cypress/support" />
|
|
20
22
|
|
|
21
23
|
var Switch = function Switch() {
|
|
22
24
|
var _useState = (0, _react.useState)(false),
|
|
23
25
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
24
26
|
checked = _useState2[0],
|
|
25
27
|
setChecked = _useState2[1];
|
|
26
|
-
var _onChange = function onChange(e) {
|
|
27
|
-
setChecked(e.target.checked);
|
|
28
|
-
};
|
|
29
28
|
return (0, _react2.jsx)(_switch.EuiSwitch, {
|
|
30
29
|
label: "Malware protection",
|
|
31
30
|
checked: checked,
|
|
32
31
|
onChange: function onChange(e) {
|
|
33
|
-
return
|
|
32
|
+
return setChecked(e.target.checked);
|
|
34
33
|
}
|
|
35
34
|
});
|
|
36
35
|
};
|
|
@@ -10,10 +10,11 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _form_control_layout = require("../form_control_layout");
|
|
13
14
|
var _validatable_control = require("../validatable_control");
|
|
14
15
|
var _eui_form_context = require("../eui_form_context");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["children", "className", "compressed", "fullWidth", "id", "inputRef", "isInvalid", "name", "placeholder", "resize", "rows"];
|
|
17
|
+
var _excluded = ["children", "className", "compressed", "fullWidth", "id", "inputRef", "isLoading", "isInvalid", "name", "placeholder", "resize", "rows"];
|
|
17
18
|
var resizeToClassNameMap = {
|
|
18
19
|
vertical: 'euiTextArea--resizeVertical',
|
|
19
20
|
horizontal: 'euiTextArea--resizeHorizontal',
|
|
@@ -32,6 +33,7 @@ var EuiTextArea = function EuiTextArea(props) {
|
|
|
32
33
|
fullWidth = _props$fullWidth === void 0 ? defaultFullWidth : _props$fullWidth,
|
|
33
34
|
id = props.id,
|
|
34
35
|
inputRef = props.inputRef,
|
|
36
|
+
isLoading = props.isLoading,
|
|
35
37
|
isInvalid = props.isInvalid,
|
|
36
38
|
name = props.name,
|
|
37
39
|
placeholder = props.placeholder,
|
|
@@ -51,7 +53,12 @@ var EuiTextArea = function EuiTextArea(props) {
|
|
|
51
53
|
} else {
|
|
52
54
|
definedRows = 6;
|
|
53
55
|
}
|
|
54
|
-
return (0, _react2.jsx)(
|
|
56
|
+
return (0, _react2.jsx)(_form_control_layout.EuiFormControlLayout, {
|
|
57
|
+
fullWidth: fullWidth,
|
|
58
|
+
isLoading: isLoading,
|
|
59
|
+
isInvalid: isInvalid,
|
|
60
|
+
className: "euiFormControlLayout--euiTextArea"
|
|
61
|
+
}, (0, _react2.jsx)(_validatable_control.EuiValidatableControl, {
|
|
55
62
|
isInvalid: isInvalid
|
|
56
63
|
}, (0, _react2.jsx)("textarea", (0, _extends2.default)({
|
|
57
64
|
className: classes
|
|
@@ -61,7 +68,7 @@ var EuiTextArea = function EuiTextArea(props) {
|
|
|
61
68
|
id: id,
|
|
62
69
|
ref: inputRef,
|
|
63
70
|
placeholder: placeholder
|
|
64
|
-
}), children));
|
|
71
|
+
}), children)));
|
|
65
72
|
};
|
|
66
73
|
exports.EuiTextArea = EuiTextArea;
|
|
67
74
|
EuiTextArea.propTypes = {
|
|
@@ -69,6 +76,7 @@ EuiTextArea.propTypes = {
|
|
|
69
76
|
"aria-label": _propTypes.default.string,
|
|
70
77
|
"data-test-subj": _propTypes.default.string,
|
|
71
78
|
css: _propTypes.default.any,
|
|
79
|
+
isLoading: _propTypes.default.bool,
|
|
72
80
|
isInvalid: _propTypes.default.bool,
|
|
73
81
|
/**
|
|
74
82
|
* Expand to fill 100% of the parent.
|
|
@@ -9,4 +9,10 @@ Object.defineProperty(exports, "EuiValidatableControl", {
|
|
|
9
9
|
return _validatable_control.EuiValidatableControl;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "useEuiValidatableControl", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _validatable_control.useEuiValidatableControl;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
var _validatable_control = require("./validatable_control");
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.EuiValidatableControl = void 0;
|
|
7
|
+
exports.useEuiValidatableControl = exports.EuiValidatableControl = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
/*
|
|
@@ -18,6 +18,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
18
18
|
function isMutableRef(ref) {
|
|
19
19
|
return ref != null && ref.hasOwnProperty('current');
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The `EuiValidatableControl` component should be used in scenarios where
|
|
24
|
+
* we can render the validated `<input>` as its direct child.
|
|
25
|
+
*/
|
|
26
|
+
|
|
21
27
|
var EuiValidatableControl = function EuiValidatableControl(_ref) {
|
|
22
28
|
var isInvalid = _ref.isInvalid,
|
|
23
29
|
children = _ref.children;
|
|
@@ -34,22 +40,21 @@ var EuiValidatableControl = function EuiValidatableControl(_ref) {
|
|
|
34
40
|
childRef.current = element;
|
|
35
41
|
}
|
|
36
42
|
}, [childRef]);
|
|
37
|
-
(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (isInvalid) {
|
|
43
|
-
control.current.setCustomValidity('Invalid');
|
|
44
|
-
} else {
|
|
45
|
-
control.current.setCustomValidity('');
|
|
46
|
-
}
|
|
43
|
+
useSetControlValidity({
|
|
44
|
+
controlEl: control.current,
|
|
45
|
+
isInvalid: isInvalid
|
|
47
46
|
});
|
|
48
47
|
return /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
49
48
|
ref: replacedRef,
|
|
50
49
|
'aria-invalid': isInvalid
|
|
51
50
|
});
|
|
52
51
|
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The `UseEuiValidatableControl` hook should be used in scenarios where
|
|
55
|
+
* we *cannot* control where the validated `<input>` is rendered (e.g., ReactDatePicker)
|
|
56
|
+
* and instead need to access the input via a ref and pass the element in directly
|
|
57
|
+
*/
|
|
53
58
|
exports.EuiValidatableControl = EuiValidatableControl;
|
|
54
59
|
EuiValidatableControl.propTypes = {
|
|
55
60
|
className: _propTypes.default.string,
|
|
@@ -57,10 +62,42 @@ EuiValidatableControl.propTypes = {
|
|
|
57
62
|
"data-test-subj": _propTypes.default.string,
|
|
58
63
|
css: _propTypes.default.any,
|
|
59
64
|
isInvalid: _propTypes.default.bool,
|
|
60
|
-
/**
|
|
61
|
-
* ReactNode to render as this component's content
|
|
62
|
-
*/
|
|
63
65
|
children: _propTypes.default.shape({
|
|
64
66
|
ref: _propTypes.default.any
|
|
65
67
|
}).isRequired
|
|
68
|
+
};
|
|
69
|
+
var useEuiValidatableControl = function useEuiValidatableControl(_ref2) {
|
|
70
|
+
var isInvalid = _ref2.isInvalid,
|
|
71
|
+
controlEl = _ref2.controlEl;
|
|
72
|
+
useSetControlValidity({
|
|
73
|
+
controlEl: controlEl,
|
|
74
|
+
isInvalid: isInvalid
|
|
75
|
+
});
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
if (!controlEl) return;
|
|
78
|
+
if (typeof isInvalid === 'boolean') {
|
|
79
|
+
controlEl.setAttribute('aria-invalid', String(isInvalid));
|
|
80
|
+
} else {
|
|
81
|
+
controlEl.removeAttribute('aria-invalid');
|
|
82
|
+
}
|
|
83
|
+
}, [isInvalid, controlEl]);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Internal `setCustomValidity` helper
|
|
88
|
+
*/
|
|
89
|
+
exports.useEuiValidatableControl = useEuiValidatableControl;
|
|
90
|
+
var useSetControlValidity = function useSetControlValidity(_ref3) {
|
|
91
|
+
var controlEl = _ref3.controlEl,
|
|
92
|
+
isInvalid = _ref3.isInvalid;
|
|
93
|
+
(0, _react.useEffect)(function () {
|
|
94
|
+
if (controlEl == null || typeof controlEl.setCustomValidity !== 'function') {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (isInvalid) {
|
|
98
|
+
controlEl.setCustomValidity('Invalid');
|
|
99
|
+
} else {
|
|
100
|
+
controlEl.setCustomValidity('');
|
|
101
|
+
}
|
|
102
|
+
}, [isInvalid, controlEl]);
|
|
66
103
|
};
|
|
@@ -29,7 +29,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
* Side Public License, v 1.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
/// <reference types="
|
|
32
|
+
/// <reference types="cypress" />
|
|
33
|
+
/// <reference types="cypress-real-events" />
|
|
34
|
+
/// <reference types="../../../cypress/support" />
|
|
33
35
|
|
|
34
36
|
var Header = function Header() {
|
|
35
37
|
var renderLogo = function renderLogo() {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
describe('EuiIcons', function () {
|
|
18
20
|
describe('Automated accessibility check for ML icons', function () {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
describe('EuiIcons', function () {
|
|
18
20
|
describe('Automated accessibility check for app icons', function () {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
describe('EuiIcons', function () {
|
|
18
20
|
describe('Automated accessibility check for editor icons', function () {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
describe('EuiIcons', function () {
|
|
18
20
|
describe('Automated accessibility check for Elastic logos', function () {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
describe('EuiIcons', function () {
|
|
18
20
|
describe('Automated accessibility check for glyph icons', function () {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
describe('EuiIcons', function () {
|
|
18
20
|
describe('Automated accessibility check for token icons', function () {
|
|
@@ -12,7 +12,9 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/// <reference types="
|
|
15
|
+
/// <reference types="cypress" />
|
|
16
|
+
/// <reference types="cypress-real-events" />
|
|
17
|
+
/// <reference types="../../../cypress/support" />
|
|
16
18
|
|
|
17
19
|
var Image = function Image() {
|
|
18
20
|
return (0, _react2.jsx)(_image.EuiImage, {
|
|
@@ -476,6 +476,17 @@ Object.keys(_inner_text).forEach(function (key) {
|
|
|
476
476
|
}
|
|
477
477
|
});
|
|
478
478
|
});
|
|
479
|
+
var _inline_edit = require("./inline_edit");
|
|
480
|
+
Object.keys(_inline_edit).forEach(function (key) {
|
|
481
|
+
if (key === "default" || key === "__esModule") return;
|
|
482
|
+
if (key in exports && exports[key] === _inline_edit[key]) return;
|
|
483
|
+
Object.defineProperty(exports, key, {
|
|
484
|
+
enumerable: true,
|
|
485
|
+
get: function get() {
|
|
486
|
+
return _inline_edit[key];
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
});
|
|
479
490
|
var _i18n = require("./i18n");
|
|
480
491
|
Object.keys(_i18n).forEach(function (key) {
|
|
481
492
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "EuiInlineEditText", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _inline_edit_text.EuiInlineEditText;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "EuiInlineEditTitle", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _inline_edit_title.EuiInlineEditTitle;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _inline_edit_text = require("./inline_edit_text");
|
|
19
|
+
var _inline_edit_title = require("./inline_edit_title");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiInlineEditStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
/*
|
|
9
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
12
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
13
|
+
* Side Public License, v 1.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
var euiInlineEditStyles = function euiInlineEditStyles(_ref) {
|
|
17
|
+
var euiTheme = _ref.euiTheme;
|
|
18
|
+
return {
|
|
19
|
+
euiInlineEdit: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:euiInlineEdit;")
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.euiInlineEditStyles = euiInlineEditStyles;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SMALL_SIZE_FORM = exports.MEDIUM_SIZE_FORM = exports.EuiInlineEditForm = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
var _form = require("../form");
|
|
15
|
+
var _button = require("../button");
|
|
16
|
+
var _flex = require("../flex");
|
|
17
|
+
var _i18n = require("../i18n");
|
|
18
|
+
var _accessibility = require("../../services/accessibility");
|
|
19
|
+
var _react2 = require("@emotion/react");
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
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; }
|
|
22
|
+
/*
|
|
23
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
25
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
26
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
27
|
+
* Side Public License, v 1.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
var SMALL_SIZE_FORM = {
|
|
31
|
+
iconSize: 's',
|
|
32
|
+
compressed: true,
|
|
33
|
+
buttonSize: 's'
|
|
34
|
+
};
|
|
35
|
+
exports.SMALL_SIZE_FORM = SMALL_SIZE_FORM;
|
|
36
|
+
var MEDIUM_SIZE_FORM = {
|
|
37
|
+
iconSize: 'm',
|
|
38
|
+
compressed: false,
|
|
39
|
+
buttonSize: 'm'
|
|
40
|
+
};
|
|
41
|
+
exports.MEDIUM_SIZE_FORM = MEDIUM_SIZE_FORM;
|
|
42
|
+
var EuiInlineEditForm = function EuiInlineEditForm(_ref) {
|
|
43
|
+
var className = _ref.className,
|
|
44
|
+
children = _ref.children,
|
|
45
|
+
sizes = _ref.sizes,
|
|
46
|
+
defaultValue = _ref.defaultValue,
|
|
47
|
+
onConfirm = _ref.onConfirm,
|
|
48
|
+
inputAriaLabel = _ref.inputAriaLabel,
|
|
49
|
+
saveButtonAriaLabel = _ref.saveButtonAriaLabel,
|
|
50
|
+
cancelButtonAriaLabel = _ref.cancelButtonAriaLabel,
|
|
51
|
+
startWithEditOpen = _ref.startWithEditOpen,
|
|
52
|
+
readModeProps = _ref.readModeProps,
|
|
53
|
+
editModeProps = _ref.editModeProps;
|
|
54
|
+
var classes = (0, _classnames.default)('euiInlineEdit', className);
|
|
55
|
+
|
|
56
|
+
// Styles to come later! (Styling editMode text to match the size of its readMode counterpart)
|
|
57
|
+
/*const theme = useEuiTheme();
|
|
58
|
+
const styles = euiInlineEditStyles(theme);
|
|
59
|
+
const cssStyles = [styles.euiInlineEdit];*/
|
|
60
|
+
|
|
61
|
+
var defaultSaveButtonAriaLabel = (0, _i18n.useEuiI18n)('euiInlineEditForm.saveButtonAriaLabel', 'Save edit');
|
|
62
|
+
var defaultCancelButtonAriaLabel = (0, _i18n.useEuiI18n)('euiInlineEditForm.cancelButtonAriaLabel', 'Cancel edit');
|
|
63
|
+
var _useState = (0, _react.useState)(false || startWithEditOpen),
|
|
64
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
65
|
+
isEditing = _useState2[0],
|
|
66
|
+
setIsEditing = _useState2[1];
|
|
67
|
+
var inlineEditInputId = (0, _accessibility.useGeneratedHtmlId)({
|
|
68
|
+
prefix: '__inlineEditInput'
|
|
69
|
+
});
|
|
70
|
+
var _useState3 = (0, _react.useState)(defaultValue),
|
|
71
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
72
|
+
editModeValue = _useState4[0],
|
|
73
|
+
setEditModeValue = _useState4[1];
|
|
74
|
+
var _useState5 = (0, _react.useState)(defaultValue),
|
|
75
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
76
|
+
readModeValue = _useState6[0],
|
|
77
|
+
setReadModeValue = _useState6[1];
|
|
78
|
+
var cancelInlineEdit = function cancelInlineEdit() {
|
|
79
|
+
setEditModeValue(readModeValue);
|
|
80
|
+
setIsEditing(!isEditing);
|
|
81
|
+
};
|
|
82
|
+
var saveInlineEditValue = function saveInlineEditValue() {
|
|
83
|
+
if (editModeValue && onConfirm && !onConfirm()) {
|
|
84
|
+
// If there is text, an onConfirm method is present, and it has returned false, cancel the action
|
|
85
|
+
return;
|
|
86
|
+
} else if (editModeValue) {
|
|
87
|
+
setReadModeValue(editModeValue);
|
|
88
|
+
setIsEditing(!isEditing);
|
|
89
|
+
} else {
|
|
90
|
+
// If there's no text, cancel the action, reset the input text, and return to readMode
|
|
91
|
+
cancelInlineEdit();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var editModeForm = (0, _react2.jsx)(_form.EuiForm, {
|
|
95
|
+
fullWidth: true
|
|
96
|
+
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
97
|
+
gutterSize: "s"
|
|
98
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_form.EuiFieldText, (0, _extends2.default)({
|
|
99
|
+
id: inlineEditInputId,
|
|
100
|
+
value: editModeValue,
|
|
101
|
+
onChange: function onChange(e) {
|
|
102
|
+
setEditModeValue(e.target.value);
|
|
103
|
+
},
|
|
104
|
+
"aria-label": inputAriaLabel,
|
|
105
|
+
autoFocus: true,
|
|
106
|
+
compressed: sizes.compressed
|
|
107
|
+
}, editModeProps))), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
108
|
+
grow: false,
|
|
109
|
+
className: classes
|
|
110
|
+
}, (0, _react2.jsx)(_form.EuiFormRow, null, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
111
|
+
iconType: "check",
|
|
112
|
+
"aria-label": saveButtonAriaLabel || defaultSaveButtonAriaLabel,
|
|
113
|
+
onClick: saveInlineEditValue,
|
|
114
|
+
color: "success",
|
|
115
|
+
display: "base",
|
|
116
|
+
size: sizes.buttonSize,
|
|
117
|
+
iconSize: sizes.iconSize
|
|
118
|
+
}))), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
119
|
+
grow: false
|
|
120
|
+
}, (0, _react2.jsx)(_form.EuiFormRow, null, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
121
|
+
iconType: "cross",
|
|
122
|
+
"aria-label": cancelButtonAriaLabel || defaultCancelButtonAriaLabel,
|
|
123
|
+
onClick: cancelInlineEdit,
|
|
124
|
+
color: "danger",
|
|
125
|
+
display: "base",
|
|
126
|
+
size: sizes.buttonSize,
|
|
127
|
+
iconSize: sizes.iconSize
|
|
128
|
+
})))));
|
|
129
|
+
var readModeElement = (0, _react2.jsx)(_button.EuiButtonEmpty, (0, _extends2.default)({
|
|
130
|
+
color: "text",
|
|
131
|
+
iconType: "pencil",
|
|
132
|
+
iconSide: "right",
|
|
133
|
+
autoFocus: true,
|
|
134
|
+
flush: "both",
|
|
135
|
+
iconSize: sizes.iconSize,
|
|
136
|
+
size: sizes.buttonSize,
|
|
137
|
+
onClick: function onClick() {
|
|
138
|
+
setIsEditing(!isEditing);
|
|
139
|
+
}
|
|
140
|
+
}, readModeProps), children(readModeValue));
|
|
141
|
+
return (0, _react2.jsx)("div", {
|
|
142
|
+
className: classes
|
|
143
|
+
}, isEditing ? editModeForm : readModeElement);
|
|
144
|
+
};
|
|
145
|
+
exports.EuiInlineEditForm = EuiInlineEditForm;
|
|
146
|
+
EuiInlineEditForm.propTypes = {
|
|
147
|
+
className: _propTypes.default.string,
|
|
148
|
+
"aria-label": _propTypes.default.string,
|
|
149
|
+
"data-test-subj": _propTypes.default.string,
|
|
150
|
+
css: _propTypes.default.any,
|
|
151
|
+
defaultValue: _propTypes.default.string.isRequired,
|
|
152
|
+
/**
|
|
153
|
+
* Allow users to pass in a function that is called when the confirm button is clicked
|
|
154
|
+
* The function should return a boolean flag that will determine if the value will be saved.
|
|
155
|
+
* When the flag is true, the value will be saved. When the flag is false, the user will be
|
|
156
|
+
* returned to editMode.
|
|
157
|
+
*/
|
|
158
|
+
onConfirm: _propTypes.default.func,
|
|
159
|
+
/**
|
|
160
|
+
* Form label that appears above the form control
|
|
161
|
+
* This is required for accessibility because there is no visual label on the input
|
|
162
|
+
*/
|
|
163
|
+
inputAriaLabel: _propTypes.default.string.isRequired,
|
|
164
|
+
/**
|
|
165
|
+
* Aria-label for save button in editMode
|
|
166
|
+
*/
|
|
167
|
+
saveButtonAriaLabel: _propTypes.default.string,
|
|
168
|
+
/**
|
|
169
|
+
* Aria-label for cancel button in editMode
|
|
170
|
+
*/
|
|
171
|
+
cancelButtonAriaLabel: _propTypes.default.string,
|
|
172
|
+
/**
|
|
173
|
+
* Start in editMode
|
|
174
|
+
*/
|
|
175
|
+
startWithEditOpen: _propTypes.default.bool,
|
|
176
|
+
/**
|
|
177
|
+
* Props that will be applied directly to the EuiEmptyButton displayed in readMode
|
|
178
|
+
*/
|
|
179
|
+
readModeProps: _propTypes.default.any,
|
|
180
|
+
/**
|
|
181
|
+
* Props that will be applied directly to the EuiFieldText displayed in editMode
|
|
182
|
+
*/
|
|
183
|
+
editModeProps: _propTypes.default.any,
|
|
184
|
+
/**
|
|
185
|
+
* Form sizes
|
|
186
|
+
*/
|
|
187
|
+
sizes: _propTypes.default.shape({
|
|
188
|
+
compressed: _propTypes.default.bool.isRequired,
|
|
189
|
+
buttonSize: _propTypes.default.oneOf(["xs", "s", "m"]).isRequired,
|
|
190
|
+
iconSize: _propTypes.default.oneOf(["s", "m"]).isRequired
|
|
191
|
+
}).isRequired,
|
|
192
|
+
/**
|
|
193
|
+
* Render prop that returns the read mode value as an arg
|
|
194
|
+
*/
|
|
195
|
+
children: _propTypes.default.func.isRequired
|
|
196
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.EuiInlineEditText = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _text = require("../text");
|
|
14
|
+
var _inline_edit_form = require("./inline_edit_form");
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
16
|
+
var _excluded = ["children", "className", "size", "defaultValue", "onConfirm", "inputAriaLabel", "saveButtonAriaLabel", "cancelButtonAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps"];
|
|
17
|
+
var EuiInlineEditText = function EuiInlineEditText(_ref) {
|
|
18
|
+
var children = _ref.children,
|
|
19
|
+
className = _ref.className,
|
|
20
|
+
_ref$size = _ref.size,
|
|
21
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
22
|
+
defaultValue = _ref.defaultValue,
|
|
23
|
+
onConfirm = _ref.onConfirm,
|
|
24
|
+
inputAriaLabel = _ref.inputAriaLabel,
|
|
25
|
+
saveButtonAriaLabel = _ref.saveButtonAriaLabel,
|
|
26
|
+
cancelButtonAriaLabel = _ref.cancelButtonAriaLabel,
|
|
27
|
+
startWithEditOpen = _ref.startWithEditOpen,
|
|
28
|
+
readModeProps = _ref.readModeProps,
|
|
29
|
+
editModeProps = _ref.editModeProps,
|
|
30
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
+
var classes = (0, _classnames.default)('euiInlineEditText', className);
|
|
32
|
+
var isSmallSize = ['xs', 's'].includes(size);
|
|
33
|
+
var sizes = isSmallSize ? _inline_edit_form.SMALL_SIZE_FORM : _inline_edit_form.MEDIUM_SIZE_FORM;
|
|
34
|
+
var formProps = {
|
|
35
|
+
sizes: sizes,
|
|
36
|
+
defaultValue: defaultValue,
|
|
37
|
+
onConfirm: onConfirm,
|
|
38
|
+
inputAriaLabel: inputAriaLabel,
|
|
39
|
+
saveButtonAriaLabel: saveButtonAriaLabel,
|
|
40
|
+
cancelButtonAriaLabel: cancelButtonAriaLabel,
|
|
41
|
+
startWithEditOpen: startWithEditOpen,
|
|
42
|
+
readModeProps: readModeProps,
|
|
43
|
+
editModeProps: editModeProps
|
|
44
|
+
};
|
|
45
|
+
return (0, _react2.jsx)(_inline_edit_form.EuiInlineEditForm, (0, _extends2.default)({
|
|
46
|
+
className: classes
|
|
47
|
+
}, rest, formProps), function (textReadModeValue) {
|
|
48
|
+
return (0, _react2.jsx)(_text.EuiText, {
|
|
49
|
+
size: size
|
|
50
|
+
}, textReadModeValue);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.EuiInlineEditText = EuiInlineEditText;
|
|
54
|
+
EuiInlineEditText.propTypes = {
|
|
55
|
+
className: _propTypes.default.string,
|
|
56
|
+
"aria-label": _propTypes.default.string,
|
|
57
|
+
"data-test-subj": _propTypes.default.string,
|
|
58
|
+
css: _propTypes.default.any,
|
|
59
|
+
defaultValue: _propTypes.default.string.isRequired,
|
|
60
|
+
/**
|
|
61
|
+
* Allow users to pass in a function that is called when the confirm button is clicked
|
|
62
|
+
* The function should return a boolean flag that will determine if the value will be saved.
|
|
63
|
+
* When the flag is true, the value will be saved. When the flag is false, the user will be
|
|
64
|
+
* returned to editMode.
|
|
65
|
+
*/
|
|
66
|
+
onConfirm: _propTypes.default.func,
|
|
67
|
+
/**
|
|
68
|
+
* Form label that appears above the form control
|
|
69
|
+
* This is required for accessibility because there is no visual label on the input
|
|
70
|
+
*/
|
|
71
|
+
inputAriaLabel: _propTypes.default.string.isRequired,
|
|
72
|
+
/**
|
|
73
|
+
* Aria-label for save button in editMode
|
|
74
|
+
*/
|
|
75
|
+
saveButtonAriaLabel: _propTypes.default.string,
|
|
76
|
+
/**
|
|
77
|
+
* Aria-label for cancel button in editMode
|
|
78
|
+
*/
|
|
79
|
+
cancelButtonAriaLabel: _propTypes.default.string,
|
|
80
|
+
/**
|
|
81
|
+
* Start in editMode
|
|
82
|
+
*/
|
|
83
|
+
startWithEditOpen: _propTypes.default.bool,
|
|
84
|
+
/**
|
|
85
|
+
* Props that will be applied directly to the EuiEmptyButton displayed in readMode
|
|
86
|
+
*/
|
|
87
|
+
readModeProps: _propTypes.default.any,
|
|
88
|
+
/**
|
|
89
|
+
* Props that will be applied directly to the EuiFieldText displayed in editMode
|
|
90
|
+
*/
|
|
91
|
+
editModeProps: _propTypes.default.any,
|
|
92
|
+
/**
|
|
93
|
+
* Text size level
|
|
94
|
+
*/
|
|
95
|
+
size: _propTypes.default.any
|
|
96
|
+
};
|