@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
|
@@ -218,22 +218,6 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
218
218
|
_defineProperty(_assertThisInitialized(_this), "clearSearchValue", function () {
|
|
219
219
|
_this.onSearchChange('');
|
|
220
220
|
});
|
|
221
|
-
_defineProperty(_assertThisInitialized(_this), "removeLastOption", function () {
|
|
222
|
-
if (!_this.props.selectedOptions.length) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// Backspace will be used to delete the input, not a pill.
|
|
227
|
-
if (_this.state.searchValue.length) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Delete last pill.
|
|
232
|
-
_this.onRemoveOption(_this.props.selectedOptions[_this.props.selectedOptions.length - 1]);
|
|
233
|
-
if (Boolean(_this.props.singleSelection) && !_this.state.isListOpen) {
|
|
234
|
-
_this.openList();
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
221
|
_defineProperty(_assertThisInitialized(_this), "addCustomOption", function (isContainerBlur, searchValue) {
|
|
238
222
|
var _this$props = _this.props,
|
|
239
223
|
isCaseSensitive = _this$props.isCaseSensitive,
|
|
@@ -383,10 +367,6 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
383
367
|
_this.openList();
|
|
384
368
|
}
|
|
385
369
|
break;
|
|
386
|
-
case keys.BACKSPACE:
|
|
387
|
-
event.stopPropagation();
|
|
388
|
-
_this.removeLastOption();
|
|
389
|
-
break;
|
|
390
370
|
case keys.ESCAPE:
|
|
391
371
|
if (_this.state.isListOpen) {
|
|
392
372
|
event.preventDefault();
|
|
@@ -663,7 +643,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
663
643
|
// Visually indicate the combobox is in an invalid state if it has lost focus but there is text entered in the input.
|
|
664
644
|
// When custom options are disabled and the user leaves the combo box after entering text that does not match any
|
|
665
645
|
// options, this tells the user that they've entered invalid input.
|
|
666
|
-
var markAsInvalid = isInvalid || (hasFocus === false || isListOpen === false) && searchValue;
|
|
646
|
+
var markAsInvalid = !!(isInvalid || (hasFocus === false || isListOpen === false) && searchValue);
|
|
667
647
|
var classes = classNames('euiComboBox', className, {
|
|
668
648
|
'euiComboBox--compressed': compressed,
|
|
669
649
|
'euiComboBox--fullWidth': fullWidth,
|
|
@@ -760,6 +740,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
760
740
|
append: singleSelection ? append : undefined,
|
|
761
741
|
prepend: singleSelection ? prepend : undefined,
|
|
762
742
|
isLoading: isLoading,
|
|
743
|
+
isInvalid: markAsInvalid,
|
|
763
744
|
autoFocus: autoFocus,
|
|
764
745
|
"aria-label": ariaLabel,
|
|
765
746
|
"aria-labelledby": ariaLabelledby
|
|
@@ -22,8 +22,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
22
|
import React, { Component } from 'react';
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import AutosizeInput from 'react-input-autosize';
|
|
25
|
+
import { keys } from '../../../services';
|
|
25
26
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
26
27
|
import { EuiFormControlLayout } from '../../form/form_control_layout';
|
|
28
|
+
import { getFormControlClassNameForIconCount } from '../../form/form_control_layout/_num_icons';
|
|
27
29
|
import { EuiComboBoxPill } from './combo_box_pill';
|
|
28
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
31
|
export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
@@ -59,10 +61,29 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
59
61
|
hasFocus: false
|
|
60
62
|
});
|
|
61
63
|
});
|
|
62
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
63
65
|
var _this$props = _this.props,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
searchValue = _this$props.searchValue,
|
|
67
|
+
selectedOptions = _this$props.selectedOptions,
|
|
68
|
+
onRemoveOption = _this$props.onRemoveOption,
|
|
69
|
+
singleSelection = _this$props.singleSelection,
|
|
70
|
+
isListOpen = _this$props.isListOpen,
|
|
71
|
+
onOpenListClick = _this$props.onOpenListClick;
|
|
72
|
+
|
|
73
|
+
// When backspacing from an empty input, delete the last pill option in the list
|
|
74
|
+
var searchIsEmpty = !searchValue.length;
|
|
75
|
+
var hasPills = selectedOptions.length;
|
|
76
|
+
if (event.key === keys.BACKSPACE && searchIsEmpty && hasPills) {
|
|
77
|
+
onRemoveOption(selectedOptions[selectedOptions.length - 1]);
|
|
78
|
+
if (!!singleSelection && !isListOpen) {
|
|
79
|
+
onOpenListClick();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
_defineProperty(_assertThisInitialized(_this), "inputOnChange", function (event) {
|
|
84
|
+
var _this$props2 = _this.props,
|
|
85
|
+
onChange = _this$props2.onChange,
|
|
86
|
+
searchValue = _this$props2.searchValue;
|
|
66
87
|
if (onChange) {
|
|
67
88
|
onChange(event.target.value);
|
|
68
89
|
}
|
|
@@ -89,34 +110,35 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
89
110
|
}, {
|
|
90
111
|
key: "render",
|
|
91
112
|
value: function render() {
|
|
92
|
-
var _this$
|
|
93
|
-
compressed = _this$
|
|
94
|
-
focusedOptionId = _this$
|
|
95
|
-
fullWidth = _this$
|
|
96
|
-
hasSelectedOptions = _this$
|
|
97
|
-
id = _this$
|
|
98
|
-
inputRef = _this$
|
|
99
|
-
isDisabled = _this$
|
|
100
|
-
isListOpen = _this$
|
|
101
|
-
noIcon = _this$
|
|
102
|
-
onClear = _this$
|
|
103
|
-
onClick = _this$
|
|
104
|
-
onCloseListClick = _this$
|
|
105
|
-
onOpenListClick = _this$
|
|
106
|
-
onRemoveOption = _this$
|
|
107
|
-
placeholder = _this$
|
|
108
|
-
rootId = _this$
|
|
109
|
-
searchValue = _this$
|
|
110
|
-
selectedOptions = _this$
|
|
111
|
-
singleSelectionProp = _this$
|
|
112
|
-
toggleButtonRef = _this$
|
|
113
|
-
value = _this$
|
|
114
|
-
prepend = _this$
|
|
115
|
-
append = _this$
|
|
116
|
-
isLoading = _this$
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
var _this$props3 = this.props,
|
|
114
|
+
compressed = _this$props3.compressed,
|
|
115
|
+
focusedOptionId = _this$props3.focusedOptionId,
|
|
116
|
+
fullWidth = _this$props3.fullWidth,
|
|
117
|
+
hasSelectedOptions = _this$props3.hasSelectedOptions,
|
|
118
|
+
id = _this$props3.id,
|
|
119
|
+
inputRef = _this$props3.inputRef,
|
|
120
|
+
isDisabled = _this$props3.isDisabled,
|
|
121
|
+
isListOpen = _this$props3.isListOpen,
|
|
122
|
+
noIcon = _this$props3.noIcon,
|
|
123
|
+
onClear = _this$props3.onClear,
|
|
124
|
+
onClick = _this$props3.onClick,
|
|
125
|
+
onCloseListClick = _this$props3.onCloseListClick,
|
|
126
|
+
onOpenListClick = _this$props3.onOpenListClick,
|
|
127
|
+
onRemoveOption = _this$props3.onRemoveOption,
|
|
128
|
+
placeholder = _this$props3.placeholder,
|
|
129
|
+
rootId = _this$props3.rootId,
|
|
130
|
+
searchValue = _this$props3.searchValue,
|
|
131
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
132
|
+
singleSelectionProp = _this$props3.singleSelection,
|
|
133
|
+
toggleButtonRef = _this$props3.toggleButtonRef,
|
|
134
|
+
value = _this$props3.value,
|
|
135
|
+
prepend = _this$props3.prepend,
|
|
136
|
+
append = _this$props3.append,
|
|
137
|
+
isLoading = _this$props3.isLoading,
|
|
138
|
+
isInvalid = _this$props3.isInvalid,
|
|
139
|
+
autoFocus = _this$props3.autoFocus,
|
|
140
|
+
ariaLabel = _this$props3['aria-label'],
|
|
141
|
+
ariaLabelledby = _this$props3['aria-labelledby'];
|
|
120
142
|
var singleSelection = Boolean(singleSelectionProp);
|
|
121
143
|
var asPlainText = singleSelectionProp && _typeof(singleSelectionProp) === 'object' && singleSelectionProp.asPlainText || false;
|
|
122
144
|
var pills = selectedOptions ? selectedOptions.map(function (option) {
|
|
@@ -178,12 +200,16 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
178
200
|
type: 'arrowDown'
|
|
179
201
|
};
|
|
180
202
|
}
|
|
181
|
-
var
|
|
203
|
+
var numIconsClass = getFormControlClassNameForIconCount({
|
|
204
|
+
isDropdown: !noIcon,
|
|
205
|
+
clear: !!clickProps.clear,
|
|
206
|
+
isInvalid: isInvalid,
|
|
207
|
+
isLoading: isLoading
|
|
208
|
+
});
|
|
209
|
+
var wrapClasses = classNames('euiComboBox__inputWrap', numIconsClass, {
|
|
182
210
|
'euiComboBox__inputWrap--compressed': compressed,
|
|
183
211
|
'euiComboBox__inputWrap--fullWidth': fullWidth,
|
|
184
212
|
'euiComboBox__inputWrap--noWrap': singleSelection,
|
|
185
|
-
'euiComboBox__inputWrap-isLoading': isLoading,
|
|
186
|
-
'euiComboBox__inputWrap-isClearable': onClear,
|
|
187
213
|
'euiComboBox__inputWrap--inGroup': prepend || append
|
|
188
214
|
});
|
|
189
215
|
return ___EmotionJSX(EuiFormControlLayout, _extends({
|
|
@@ -191,6 +217,7 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
191
217
|
}, clickProps, {
|
|
192
218
|
inputId: id,
|
|
193
219
|
isLoading: isLoading,
|
|
220
|
+
isInvalid: isInvalid,
|
|
194
221
|
compressed: compressed,
|
|
195
222
|
fullWidth: fullWidth,
|
|
196
223
|
prepend: prepend,
|
|
@@ -207,6 +234,7 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
207
234
|
"aria-expanded": isListOpen,
|
|
208
235
|
"aria-label": ariaLabel,
|
|
209
236
|
"aria-labelledby": ariaLabelledby,
|
|
237
|
+
"aria-invalid": isInvalid,
|
|
210
238
|
className: "euiComboBox__input",
|
|
211
239
|
"data-test-subj": "comboBoxSearchInput",
|
|
212
240
|
disabled: isDisabled,
|
|
@@ -215,6 +243,7 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
215
243
|
onBlur: this.onBlur,
|
|
216
244
|
onChange: this.inputOnChange,
|
|
217
245
|
onFocus: this.onFocus,
|
|
246
|
+
onKeyDown: this.onKeyDown,
|
|
218
247
|
ref: this.inputRefCallback,
|
|
219
248
|
role: "combobox",
|
|
220
249
|
style: {
|
|
@@ -343,7 +343,7 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
343
343
|
hasShadow: false,
|
|
344
344
|
className: classes,
|
|
345
345
|
panelRef: this.listRefCallback,
|
|
346
|
-
"data-test-subj":
|
|
346
|
+
"data-test-subj": classNames('comboBoxOptionsList', dataTestSubj),
|
|
347
347
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
348
348
|
zIndex: zIndex
|
|
349
349
|
}),
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
/// <reference types="
|
|
9
|
+
/// <reference types="cypress" />
|
|
10
|
+
/// <reference types="cypress-real-events" />
|
|
11
|
+
/// <reference types="../../../cypress/support" />
|
|
10
12
|
|
|
11
13
|
import React from 'react';
|
|
12
14
|
import { EuiContextMenuItem } from './context_menu_item';
|
|
@@ -7,7 +7,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
/// <reference types="
|
|
10
|
+
/// <reference types="cypress" />
|
|
11
|
+
/// <reference types="cypress-real-events" />
|
|
12
|
+
/// <reference types="../../../cypress/support" />
|
|
11
13
|
|
|
12
14
|
import React, { useState } from 'react';
|
|
13
15
|
import { EuiButton } from '../button';
|
|
@@ -7,7 +7,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
/// <reference types="
|
|
10
|
+
/// <reference types="cypress" />
|
|
11
|
+
/// <reference types="cypress-real-events" />
|
|
12
|
+
/// <reference types="../../../cypress/support" />
|
|
11
13
|
|
|
12
14
|
import React, { useState } from 'react';
|
|
13
15
|
import { EuiButton } from '../button';
|
|
@@ -20,14 +22,13 @@ var Copy = function Copy() {
|
|
|
20
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
23
|
copyText = _useState2[0],
|
|
22
24
|
setCopyText = _useState2[1];
|
|
23
|
-
var onChange = function onChange(e) {
|
|
24
|
-
setCopyText(e.target.value);
|
|
25
|
-
};
|
|
26
25
|
return ___EmotionJSX("div", null, ___EmotionJSX(EuiFormRow, {
|
|
27
26
|
label: "Enter text that will be copied to clipboard"
|
|
28
27
|
}, ___EmotionJSX(EuiFieldText, {
|
|
29
28
|
value: copyText,
|
|
30
|
-
onChange: onChange
|
|
29
|
+
onChange: function onChange(e) {
|
|
30
|
+
return setCopyText(e.target.value);
|
|
31
|
+
}
|
|
31
32
|
})), ___EmotionJSX(EuiSpacer, {
|
|
32
33
|
size: "m"
|
|
33
34
|
}), ___EmotionJSX(EuiCopy, {
|
|
@@ -8,7 +8,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
/// <reference types="
|
|
11
|
+
/// <reference types="cypress" />
|
|
12
|
+
/// <reference types="cypress-real-events" />
|
|
13
|
+
/// <reference types="../../../cypress/support" />
|
|
12
14
|
|
|
13
15
|
import React, { useState } from 'react';
|
|
14
16
|
import { EuiDataGrid } from './index';
|
|
@@ -7,7 +7,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
/// <reference types="
|
|
10
|
+
/// <reference types="cypress" />
|
|
11
|
+
/// <reference types="cypress-real-events" />
|
|
12
|
+
/// <reference types="../../../cypress/support" />
|
|
11
13
|
|
|
12
14
|
import React, { useState } from 'react';
|
|
13
15
|
import moment from 'moment';
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
4
|
var _excluded = ["adjustDateOnChange", "calendarClassName", "className", "customInput", "dateFormat", "dayClassName", "disabled", "excludeDates", "filterDate", "fullWidth", "iconType", "injectTimes", "inline", "inputRef", "isInvalid", "isLoading", "locale", "maxDate", "maxTime", "minDate", "minTime", "onChange", "onClear", "openToDate", "placeholder", "popperClassName", "popoverPlacement", "selected", "shadow", "shouldCloseOnSelect", "showIcon", "showTimeSelect", "showTimeSelectOnly", "timeFormat", "utcOffset"];
|
|
10
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
5
|
/*
|
|
13
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,11 +10,13 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
10
|
* Side Public License, v 1.
|
|
18
11
|
*/
|
|
19
12
|
|
|
20
|
-
import React, {
|
|
13
|
+
import React, { useState, useCallback } from 'react';
|
|
21
14
|
import classNames from 'classnames';
|
|
22
15
|
// eslint-disable-line import/named
|
|
23
16
|
|
|
24
|
-
import { EuiFormControlLayout,
|
|
17
|
+
import { EuiFormControlLayout, useEuiValidatableControl } from '../form';
|
|
18
|
+
import { getFormControlClassNameForIconCount } from '../form/form_control_layout/_num_icons';
|
|
19
|
+
import { useCombinedRefs } from '../../services';
|
|
25
20
|
import { EuiI18nConsumer } from '../context';
|
|
26
21
|
import { ReactDatePicker } from './react-datepicker';
|
|
27
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -54,143 +49,142 @@ var unsupportedProps = [
|
|
|
54
49
|
'showMonthYearDropdown',
|
|
55
50
|
// We overridde this with `popoverPlacement`
|
|
56
51
|
'popperPlacement'];
|
|
57
|
-
export var EuiDatePicker =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
export var EuiDatePicker = function EuiDatePicker(_ref) {
|
|
53
|
+
var _ref$adjustDateOnChan = _ref.adjustDateOnChange,
|
|
54
|
+
adjustDateOnChange = _ref$adjustDateOnChan === void 0 ? true : _ref$adjustDateOnChan,
|
|
55
|
+
calendarClassName = _ref.calendarClassName,
|
|
56
|
+
className = _ref.className,
|
|
57
|
+
customInput = _ref.customInput,
|
|
58
|
+
_ref$dateFormat = _ref.dateFormat,
|
|
59
|
+
dateFormat = _ref$dateFormat === void 0 ? euiDatePickerDefaultDateFormat : _ref$dateFormat,
|
|
60
|
+
dayClassName = _ref.dayClassName,
|
|
61
|
+
disabled = _ref.disabled,
|
|
62
|
+
excludeDates = _ref.excludeDates,
|
|
63
|
+
filterDate = _ref.filterDate,
|
|
64
|
+
_ref$fullWidth = _ref.fullWidth,
|
|
65
|
+
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
66
|
+
iconType = _ref.iconType,
|
|
67
|
+
injectTimes = _ref.injectTimes,
|
|
68
|
+
inline = _ref.inline,
|
|
69
|
+
inputRef = _ref.inputRef,
|
|
70
|
+
isInvalid = _ref.isInvalid,
|
|
71
|
+
isLoading = _ref.isLoading,
|
|
72
|
+
locale = _ref.locale,
|
|
73
|
+
maxDate = _ref.maxDate,
|
|
74
|
+
maxTime = _ref.maxTime,
|
|
75
|
+
minDate = _ref.minDate,
|
|
76
|
+
minTime = _ref.minTime,
|
|
77
|
+
onChange = _ref.onChange,
|
|
78
|
+
onClear = _ref.onClear,
|
|
79
|
+
openToDate = _ref.openToDate,
|
|
80
|
+
placeholder = _ref.placeholder,
|
|
81
|
+
popperClassName = _ref.popperClassName,
|
|
82
|
+
_ref$popoverPlacement = _ref.popoverPlacement,
|
|
83
|
+
popoverPlacement = _ref$popoverPlacement === void 0 ? 'downLeft' : _ref$popoverPlacement,
|
|
84
|
+
selected = _ref.selected,
|
|
85
|
+
_ref$shadow = _ref.shadow,
|
|
86
|
+
shadow = _ref$shadow === void 0 ? true : _ref$shadow,
|
|
87
|
+
_ref$shouldCloseOnSel = _ref.shouldCloseOnSelect,
|
|
88
|
+
shouldCloseOnSelect = _ref$shouldCloseOnSel === void 0 ? true : _ref$shouldCloseOnSel,
|
|
89
|
+
_ref$showIcon = _ref.showIcon,
|
|
90
|
+
showIcon = _ref$showIcon === void 0 ? true : _ref$showIcon,
|
|
91
|
+
_ref$showTimeSelect = _ref.showTimeSelect,
|
|
92
|
+
showTimeSelect = _ref$showTimeSelect === void 0 ? false : _ref$showTimeSelect,
|
|
93
|
+
showTimeSelectOnly = _ref.showTimeSelectOnly,
|
|
94
|
+
_ref$timeFormat = _ref.timeFormat,
|
|
95
|
+
timeFormat = _ref$timeFormat === void 0 ? euiDatePickerDefaultTimeFormat : _ref$timeFormat,
|
|
96
|
+
utcOffset = _ref.utcOffset,
|
|
97
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
98
|
+
var classes = classNames('euiDatePicker', {
|
|
99
|
+
'euiDatePicker--shadow': shadow,
|
|
100
|
+
'euiDatePicker--inline': inline
|
|
101
|
+
});
|
|
102
|
+
var numIconsClass = getFormControlClassNameForIconCount({
|
|
103
|
+
isInvalid: isInvalid,
|
|
104
|
+
isLoading: isLoading
|
|
105
|
+
});
|
|
106
|
+
var datePickerClasses = classNames('euiDatePicker', 'euiFieldText', numIconsClass, {
|
|
107
|
+
'euiFieldText--fullWidth': fullWidth,
|
|
108
|
+
'euiFieldText-isLoading': isLoading,
|
|
109
|
+
'euiFieldText--withIcon': !inline && showIcon,
|
|
110
|
+
'euiFieldText--isClearable': !inline && selected && onClear
|
|
111
|
+
}, className);
|
|
112
|
+
var optionalIcon;
|
|
113
|
+
if (inline || customInput || !showIcon) {
|
|
114
|
+
optionalIcon = undefined;
|
|
115
|
+
} else if (iconType) {
|
|
116
|
+
optionalIcon = iconType;
|
|
117
|
+
} else if (showTimeSelectOnly) {
|
|
118
|
+
optionalIcon = 'clock';
|
|
119
|
+
} else {
|
|
120
|
+
optionalIcon = 'calendar';
|
|
63
121
|
}
|
|
64
|
-
_createClass(EuiDatePicker, [{
|
|
65
|
-
key: "render",
|
|
66
|
-
value: function render() {
|
|
67
|
-
var _this$props = this.props,
|
|
68
|
-
adjustDateOnChange = _this$props.adjustDateOnChange,
|
|
69
|
-
calendarClassName = _this$props.calendarClassName,
|
|
70
|
-
className = _this$props.className,
|
|
71
|
-
customInput = _this$props.customInput,
|
|
72
|
-
dateFormat = _this$props.dateFormat,
|
|
73
|
-
dayClassName = _this$props.dayClassName,
|
|
74
|
-
disabled = _this$props.disabled,
|
|
75
|
-
excludeDates = _this$props.excludeDates,
|
|
76
|
-
filterDate = _this$props.filterDate,
|
|
77
|
-
fullWidth = _this$props.fullWidth,
|
|
78
|
-
iconType = _this$props.iconType,
|
|
79
|
-
injectTimes = _this$props.injectTimes,
|
|
80
|
-
inline = _this$props.inline,
|
|
81
|
-
inputRef = _this$props.inputRef,
|
|
82
|
-
isInvalid = _this$props.isInvalid,
|
|
83
|
-
isLoading = _this$props.isLoading,
|
|
84
|
-
locale = _this$props.locale,
|
|
85
|
-
maxDate = _this$props.maxDate,
|
|
86
|
-
maxTime = _this$props.maxTime,
|
|
87
|
-
minDate = _this$props.minDate,
|
|
88
|
-
minTime = _this$props.minTime,
|
|
89
|
-
onChange = _this$props.onChange,
|
|
90
|
-
onClear = _this$props.onClear,
|
|
91
|
-
openToDate = _this$props.openToDate,
|
|
92
|
-
placeholder = _this$props.placeholder,
|
|
93
|
-
popperClassName = _this$props.popperClassName,
|
|
94
|
-
popoverPlacement = _this$props.popoverPlacement,
|
|
95
|
-
selected = _this$props.selected,
|
|
96
|
-
shadow = _this$props.shadow,
|
|
97
|
-
shouldCloseOnSelect = _this$props.shouldCloseOnSelect,
|
|
98
|
-
showIcon = _this$props.showIcon,
|
|
99
|
-
showTimeSelect = _this$props.showTimeSelect,
|
|
100
|
-
showTimeSelectOnly = _this$props.showTimeSelectOnly,
|
|
101
|
-
timeFormat = _this$props.timeFormat,
|
|
102
|
-
utcOffset = _this$props.utcOffset,
|
|
103
|
-
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
104
|
-
var classes = classNames('euiDatePicker', {
|
|
105
|
-
'euiDatePicker--shadow': shadow,
|
|
106
|
-
'euiDatePicker--inline': inline
|
|
107
|
-
});
|
|
108
|
-
var datePickerClasses = classNames('euiDatePicker', 'euiFieldText', {
|
|
109
|
-
'euiFieldText--fullWidth': fullWidth,
|
|
110
|
-
'euiFieldText-isLoading': isLoading,
|
|
111
|
-
'euiFieldText--withIcon': !inline && showIcon,
|
|
112
|
-
'euiFieldText--isClearable': !inline && selected && onClear,
|
|
113
|
-
'euiFieldText-isInvalid': isInvalid
|
|
114
|
-
}, className);
|
|
115
|
-
var optionalIcon;
|
|
116
|
-
if (inline || customInput || !showIcon) {
|
|
117
|
-
optionalIcon = undefined;
|
|
118
|
-
} else if (iconType) {
|
|
119
|
-
optionalIcon = iconType;
|
|
120
|
-
} else if (showTimeSelectOnly) {
|
|
121
|
-
optionalIcon = 'clock';
|
|
122
|
-
} else {
|
|
123
|
-
optionalIcon = 'calendar';
|
|
124
|
-
}
|
|
125
122
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
timeFormat: euiDatePickerDefaultTimeFormat,
|
|
195
|
-
popoverPlacement: 'downLeft'
|
|
196
|
-
});
|
|
123
|
+
// In case the consumer did not alter the default date format but wants
|
|
124
|
+
// to add the time select, we append the default time format
|
|
125
|
+
var fullDateFormat = dateFormat;
|
|
126
|
+
if (showTimeSelect && dateFormat === euiDatePickerDefaultDateFormat) {
|
|
127
|
+
fullDateFormat = "".concat(dateFormat, " ").concat(timeFormat);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Set an internal ref on ReactDatePicker's `input` so we can set its :invalid state via useEuiValidatableControl
|
|
131
|
+
var _useState = useState(null),
|
|
132
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
133
|
+
inputValidityRef = _useState2[0],
|
|
134
|
+
_setInputValidityRef = _useState2[1];
|
|
135
|
+
var setInputValidityRef = useCallback(function (ref) {
|
|
136
|
+
_setInputValidityRef(ref === null || ref === void 0 ? void 0 : ref.input);
|
|
137
|
+
}, []);
|
|
138
|
+
useEuiValidatableControl({
|
|
139
|
+
isInvalid: isInvalid,
|
|
140
|
+
controlEl: inputValidityRef
|
|
141
|
+
});
|
|
142
|
+
var inputRefs = useCombinedRefs([inputRef, setInputValidityRef]);
|
|
143
|
+
return ___EmotionJSX("span", {
|
|
144
|
+
className: classes
|
|
145
|
+
}, ___EmotionJSX(EuiFormControlLayout, {
|
|
146
|
+
icon: optionalIcon,
|
|
147
|
+
fullWidth: fullWidth,
|
|
148
|
+
clear: selected && onClear ? {
|
|
149
|
+
onClick: onClear
|
|
150
|
+
} : undefined,
|
|
151
|
+
isLoading: isLoading,
|
|
152
|
+
isInvalid: isInvalid
|
|
153
|
+
}, ___EmotionJSX(EuiI18nConsumer, null, function (_ref2) {
|
|
154
|
+
var contextLocale = _ref2.locale;
|
|
155
|
+
return ___EmotionJSX(ReactDatePicker, _extends({
|
|
156
|
+
adjustDateOnChange: adjustDateOnChange,
|
|
157
|
+
calendarClassName: calendarClassName,
|
|
158
|
+
className: datePickerClasses,
|
|
159
|
+
customInput: customInput,
|
|
160
|
+
dateFormat: fullDateFormat,
|
|
161
|
+
dayClassName: dayClassName,
|
|
162
|
+
disabled: disabled,
|
|
163
|
+
excludeDates: excludeDates,
|
|
164
|
+
filterDate: filterDate,
|
|
165
|
+
injectTimes: injectTimes,
|
|
166
|
+
inline: inline,
|
|
167
|
+
locale: locale || contextLocale,
|
|
168
|
+
maxDate: maxDate,
|
|
169
|
+
maxTime: maxTime,
|
|
170
|
+
minDate: minDate,
|
|
171
|
+
minTime: minTime,
|
|
172
|
+
onChange: onChange,
|
|
173
|
+
openToDate: openToDate,
|
|
174
|
+
placeholderText: placeholder,
|
|
175
|
+
popperClassName: popperClassName,
|
|
176
|
+
ref: inputRefs,
|
|
177
|
+
selected: selected,
|
|
178
|
+
shouldCloseOnSelect: shouldCloseOnSelect,
|
|
179
|
+
showMonthDropdown: true,
|
|
180
|
+
showTimeSelect: showTimeSelectOnly ? true : showTimeSelect,
|
|
181
|
+
showTimeSelectOnly: showTimeSelectOnly,
|
|
182
|
+
showYearDropdown: true,
|
|
183
|
+
timeFormat: timeFormat,
|
|
184
|
+
utcOffset: utcOffset,
|
|
185
|
+
yearDropdownItemNumber: 7,
|
|
186
|
+
accessibleMode: true,
|
|
187
|
+
popperPlacement: popoverPlacement
|
|
188
|
+
}, rest));
|
|
189
|
+
})));
|
|
190
|
+
};
|
|
@@ -80,7 +80,7 @@ export var EuiDatePickerRange = function EuiDatePickerRange(_ref) {
|
|
|
80
80
|
className: "euiDatePickerRange__delimeter"
|
|
81
81
|
}, ___EmotionJSX(EuiIcon, {
|
|
82
82
|
color: isInvalid ? 'danger' : 'subdued',
|
|
83
|
-
type:
|
|
83
|
+
type: "sortRight"
|
|
84
84
|
}));
|
|
85
85
|
return ___EmotionJSX("div", _extends({
|
|
86
86
|
className: classes
|
|
@@ -8,7 +8,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
/// <reference types="
|
|
11
|
+
/// <reference types="cypress" />
|
|
12
|
+
/// <reference types="cypress-real-events" />
|
|
13
|
+
/// <reference types="../../../../cypress/support" />
|
|
12
14
|
|
|
13
15
|
import React, { useState } from 'react';
|
|
14
16
|
import { EuiSuperDatePicker } from './super_date_picker';
|