@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
|
@@ -8,8 +8,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _reactInputAutosize = _interopRequireDefault(require("react-input-autosize"));
|
|
11
|
+
var _services = require("../../../services");
|
|
11
12
|
var _accessibility = require("../../accessibility");
|
|
12
13
|
var _form_control_layout = require("../../form/form_control_layout");
|
|
14
|
+
var _num_icons = require("../../form/form_control_layout/_num_icons");
|
|
13
15
|
var _combo_box_pill = require("./combo_box_pill");
|
|
14
16
|
var _react2 = require("@emotion/react");
|
|
15
17
|
var _excluded = ["key", "label", "color", "onClick"];
|
|
@@ -66,10 +68,29 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
66
68
|
hasFocus: false
|
|
67
69
|
});
|
|
68
70
|
});
|
|
69
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
70
72
|
var _this$props = _this.props,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
searchValue = _this$props.searchValue,
|
|
74
|
+
selectedOptions = _this$props.selectedOptions,
|
|
75
|
+
onRemoveOption = _this$props.onRemoveOption,
|
|
76
|
+
singleSelection = _this$props.singleSelection,
|
|
77
|
+
isListOpen = _this$props.isListOpen,
|
|
78
|
+
onOpenListClick = _this$props.onOpenListClick;
|
|
79
|
+
|
|
80
|
+
// When backspacing from an empty input, delete the last pill option in the list
|
|
81
|
+
var searchIsEmpty = !searchValue.length;
|
|
82
|
+
var hasPills = selectedOptions.length;
|
|
83
|
+
if (event.key === _services.keys.BACKSPACE && searchIsEmpty && hasPills) {
|
|
84
|
+
onRemoveOption(selectedOptions[selectedOptions.length - 1]);
|
|
85
|
+
if (!!singleSelection && !isListOpen) {
|
|
86
|
+
onOpenListClick();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(_assertThisInitialized(_this), "inputOnChange", function (event) {
|
|
91
|
+
var _this$props2 = _this.props,
|
|
92
|
+
onChange = _this$props2.onChange,
|
|
93
|
+
searchValue = _this$props2.searchValue;
|
|
73
94
|
if (onChange) {
|
|
74
95
|
onChange(event.target.value);
|
|
75
96
|
}
|
|
@@ -96,34 +117,35 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
96
117
|
}, {
|
|
97
118
|
key: "render",
|
|
98
119
|
value: function render() {
|
|
99
|
-
var _this$
|
|
100
|
-
compressed = _this$
|
|
101
|
-
focusedOptionId = _this$
|
|
102
|
-
fullWidth = _this$
|
|
103
|
-
hasSelectedOptions = _this$
|
|
104
|
-
id = _this$
|
|
105
|
-
inputRef = _this$
|
|
106
|
-
isDisabled = _this$
|
|
107
|
-
isListOpen = _this$
|
|
108
|
-
noIcon = _this$
|
|
109
|
-
onClear = _this$
|
|
110
|
-
onClick = _this$
|
|
111
|
-
onCloseListClick = _this$
|
|
112
|
-
onOpenListClick = _this$
|
|
113
|
-
onRemoveOption = _this$
|
|
114
|
-
placeholder = _this$
|
|
115
|
-
rootId = _this$
|
|
116
|
-
searchValue = _this$
|
|
117
|
-
selectedOptions = _this$
|
|
118
|
-
singleSelectionProp = _this$
|
|
119
|
-
toggleButtonRef = _this$
|
|
120
|
-
value = _this$
|
|
121
|
-
prepend = _this$
|
|
122
|
-
append = _this$
|
|
123
|
-
isLoading = _this$
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
var _this$props3 = this.props,
|
|
121
|
+
compressed = _this$props3.compressed,
|
|
122
|
+
focusedOptionId = _this$props3.focusedOptionId,
|
|
123
|
+
fullWidth = _this$props3.fullWidth,
|
|
124
|
+
hasSelectedOptions = _this$props3.hasSelectedOptions,
|
|
125
|
+
id = _this$props3.id,
|
|
126
|
+
inputRef = _this$props3.inputRef,
|
|
127
|
+
isDisabled = _this$props3.isDisabled,
|
|
128
|
+
isListOpen = _this$props3.isListOpen,
|
|
129
|
+
noIcon = _this$props3.noIcon,
|
|
130
|
+
onClear = _this$props3.onClear,
|
|
131
|
+
onClick = _this$props3.onClick,
|
|
132
|
+
onCloseListClick = _this$props3.onCloseListClick,
|
|
133
|
+
onOpenListClick = _this$props3.onOpenListClick,
|
|
134
|
+
onRemoveOption = _this$props3.onRemoveOption,
|
|
135
|
+
placeholder = _this$props3.placeholder,
|
|
136
|
+
rootId = _this$props3.rootId,
|
|
137
|
+
searchValue = _this$props3.searchValue,
|
|
138
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
139
|
+
singleSelectionProp = _this$props3.singleSelection,
|
|
140
|
+
toggleButtonRef = _this$props3.toggleButtonRef,
|
|
141
|
+
value = _this$props3.value,
|
|
142
|
+
prepend = _this$props3.prepend,
|
|
143
|
+
append = _this$props3.append,
|
|
144
|
+
isLoading = _this$props3.isLoading,
|
|
145
|
+
isInvalid = _this$props3.isInvalid,
|
|
146
|
+
autoFocus = _this$props3.autoFocus,
|
|
147
|
+
ariaLabel = _this$props3['aria-label'],
|
|
148
|
+
ariaLabelledby = _this$props3['aria-labelledby'];
|
|
127
149
|
var singleSelection = Boolean(singleSelectionProp);
|
|
128
150
|
var asPlainText = singleSelectionProp && _typeof(singleSelectionProp) === 'object' && singleSelectionProp.asPlainText || false;
|
|
129
151
|
var pills = selectedOptions ? selectedOptions.map(function (option) {
|
|
@@ -185,12 +207,16 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
185
207
|
type: 'arrowDown'
|
|
186
208
|
};
|
|
187
209
|
}
|
|
188
|
-
var
|
|
210
|
+
var numIconsClass = (0, _num_icons.getFormControlClassNameForIconCount)({
|
|
211
|
+
isDropdown: !noIcon,
|
|
212
|
+
clear: !!clickProps.clear,
|
|
213
|
+
isInvalid: isInvalid,
|
|
214
|
+
isLoading: isLoading
|
|
215
|
+
});
|
|
216
|
+
var wrapClasses = (0, _classnames.default)('euiComboBox__inputWrap', numIconsClass, {
|
|
189
217
|
'euiComboBox__inputWrap--compressed': compressed,
|
|
190
218
|
'euiComboBox__inputWrap--fullWidth': fullWidth,
|
|
191
219
|
'euiComboBox__inputWrap--noWrap': singleSelection,
|
|
192
|
-
'euiComboBox__inputWrap-isLoading': isLoading,
|
|
193
|
-
'euiComboBox__inputWrap-isClearable': onClear,
|
|
194
220
|
'euiComboBox__inputWrap--inGroup': prepend || append
|
|
195
221
|
});
|
|
196
222
|
return (0, _react2.jsx)(_form_control_layout.EuiFormControlLayout, _extends({
|
|
@@ -198,6 +224,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
198
224
|
}, clickProps, {
|
|
199
225
|
inputId: id,
|
|
200
226
|
isLoading: isLoading,
|
|
227
|
+
isInvalid: isInvalid,
|
|
201
228
|
compressed: compressed,
|
|
202
229
|
fullWidth: fullWidth,
|
|
203
230
|
prepend: prepend,
|
|
@@ -214,6 +241,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
214
241
|
"aria-expanded": isListOpen,
|
|
215
242
|
"aria-label": ariaLabel,
|
|
216
243
|
"aria-labelledby": ariaLabelledby,
|
|
244
|
+
"aria-invalid": isInvalid,
|
|
217
245
|
className: "euiComboBox__input",
|
|
218
246
|
"data-test-subj": "comboBoxSearchInput",
|
|
219
247
|
disabled: isDisabled,
|
|
@@ -222,6 +250,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
222
250
|
onBlur: this.onBlur,
|
|
223
251
|
onChange: this.inputOnChange,
|
|
224
252
|
onFocus: this.onFocus,
|
|
253
|
+
onKeyDown: this.onKeyDown,
|
|
225
254
|
ref: this.inputRefCallback,
|
|
226
255
|
role: "combobox",
|
|
227
256
|
style: {
|
|
@@ -253,7 +282,7 @@ EuiComboBoxInput.propTypes = {
|
|
|
253
282
|
onCloseListClick: _propTypes.default.func.isRequired,
|
|
254
283
|
onFocus: _propTypes.default.any.isRequired,
|
|
255
284
|
onOpenListClick: _propTypes.default.func.isRequired,
|
|
256
|
-
onRemoveOption: _propTypes.default.func,
|
|
285
|
+
onRemoveOption: _propTypes.default.func.isRequired,
|
|
257
286
|
placeholder: _propTypes.default.string,
|
|
258
287
|
rootId: _propTypes.default.any.isRequired,
|
|
259
288
|
searchValue: _propTypes.default.string.isRequired,
|
|
@@ -277,7 +306,7 @@ EuiComboBoxInput.propTypes = {
|
|
|
277
306
|
"aria-label": _propTypes.default.string,
|
|
278
307
|
"data-test-subj": _propTypes.default.string,
|
|
279
308
|
css: _propTypes.default.any
|
|
280
|
-
}).isRequired),
|
|
309
|
+
}).isRequired).isRequired,
|
|
281
310
|
singleSelection: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.shape({
|
|
282
311
|
asPlainText: _propTypes.default.bool
|
|
283
312
|
}).isRequired]),
|
|
@@ -287,6 +316,7 @@ EuiComboBoxInput.propTypes = {
|
|
|
287
316
|
prepend: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired).isRequired]),
|
|
288
317
|
append: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired).isRequired]),
|
|
289
318
|
isLoading: _propTypes.default.bool,
|
|
319
|
+
isInvalid: _propTypes.default.bool,
|
|
290
320
|
autoFocus: _propTypes.default.bool,
|
|
291
321
|
"aria-label": _propTypes.default.string,
|
|
292
322
|
"aria-labelledby": _propTypes.default.string,
|
|
@@ -351,7 +351,7 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
351
351
|
hasShadow: false,
|
|
352
352
|
className: classes,
|
|
353
353
|
panelRef: this.listRefCallback,
|
|
354
|
-
"data-test-subj":
|
|
354
|
+
"data-test-subj": (0, _classnames.default)('comboBoxOptionsList', dataTestSubj),
|
|
355
355
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
356
356
|
zIndex: zIndex
|
|
357
357
|
}),
|
|
@@ -13,7 +13,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
* Side Public License, v 1.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
/// <reference types="
|
|
16
|
+
/// <reference types="cypress" />
|
|
17
|
+
/// <reference types="cypress-real-events" />
|
|
18
|
+
/// <reference types="../../../cypress/support" />
|
|
17
19
|
|
|
18
20
|
var items = [(0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
19
21
|
key: "A",
|
|
@@ -20,14 +20,13 @@ var Copy = function Copy() {
|
|
|
20
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
21
|
copyText = _useState2[0],
|
|
22
22
|
setCopyText = _useState2[1];
|
|
23
|
-
var onChange = function onChange(e) {
|
|
24
|
-
setCopyText(e.target.value);
|
|
25
|
-
};
|
|
26
23
|
return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_form.EuiFormRow, {
|
|
27
24
|
label: "Enter text that will be copied to clipboard"
|
|
28
25
|
}, (0, _react2.jsx)(_form.EuiFieldText, {
|
|
29
26
|
value: copyText,
|
|
30
|
-
onChange: onChange
|
|
27
|
+
onChange: function onChange(e) {
|
|
28
|
+
return setCopyText(e.target.value);
|
|
29
|
+
}
|
|
31
30
|
})), (0, _react2.jsx)(_spacer.EuiSpacer, {
|
|
32
31
|
size: "m"
|
|
33
32
|
}), (0, _react2.jsx)(_copy.EuiCopy, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -8,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _form = require("../form");
|
|
12
|
+
var _num_icons = require("../form/form_control_layout/_num_icons");
|
|
13
|
+
var _services = require("../../services");
|
|
11
14
|
var _context = require("../context");
|
|
12
15
|
var _reactDatepicker = require("./react-datepicker");
|
|
13
16
|
var _react2 = require("@emotion/react");
|
|
@@ -15,23 +18,15 @@ var _excluded = ["adjustDateOnChange", "calendarClassName", "className", "custom
|
|
|
15
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
19
|
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); }
|
|
17
20
|
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; }
|
|
18
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
19
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
27
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
28
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
29
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
26
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
-
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); }; }
|
|
28
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
29
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
|
-
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; } }
|
|
31
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
34
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
30
|
var euiDatePickerDefaultDateFormat = 'MM/DD/YYYY';
|
|
36
31
|
exports.euiDatePickerDefaultDateFormat = euiDatePickerDefaultDateFormat;
|
|
37
32
|
var euiDatePickerDefaultTimeFormat = 'hh:mm A';
|
|
@@ -63,147 +58,146 @@ var unsupportedProps = [
|
|
|
63
58
|
'showMonthYearDropdown',
|
|
64
59
|
// We overridde this with `popoverPlacement`
|
|
65
60
|
'popperPlacement'];
|
|
66
|
-
var EuiDatePicker =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
var EuiDatePicker = function EuiDatePicker(_ref) {
|
|
62
|
+
var _ref$adjustDateOnChan = _ref.adjustDateOnChange,
|
|
63
|
+
adjustDateOnChange = _ref$adjustDateOnChan === void 0 ? true : _ref$adjustDateOnChan,
|
|
64
|
+
calendarClassName = _ref.calendarClassName,
|
|
65
|
+
className = _ref.className,
|
|
66
|
+
customInput = _ref.customInput,
|
|
67
|
+
_ref$dateFormat = _ref.dateFormat,
|
|
68
|
+
dateFormat = _ref$dateFormat === void 0 ? euiDatePickerDefaultDateFormat : _ref$dateFormat,
|
|
69
|
+
dayClassName = _ref.dayClassName,
|
|
70
|
+
disabled = _ref.disabled,
|
|
71
|
+
excludeDates = _ref.excludeDates,
|
|
72
|
+
filterDate = _ref.filterDate,
|
|
73
|
+
_ref$fullWidth = _ref.fullWidth,
|
|
74
|
+
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
75
|
+
iconType = _ref.iconType,
|
|
76
|
+
injectTimes = _ref.injectTimes,
|
|
77
|
+
inline = _ref.inline,
|
|
78
|
+
inputRef = _ref.inputRef,
|
|
79
|
+
isInvalid = _ref.isInvalid,
|
|
80
|
+
isLoading = _ref.isLoading,
|
|
81
|
+
locale = _ref.locale,
|
|
82
|
+
maxDate = _ref.maxDate,
|
|
83
|
+
maxTime = _ref.maxTime,
|
|
84
|
+
minDate = _ref.minDate,
|
|
85
|
+
minTime = _ref.minTime,
|
|
86
|
+
onChange = _ref.onChange,
|
|
87
|
+
onClear = _ref.onClear,
|
|
88
|
+
openToDate = _ref.openToDate,
|
|
89
|
+
placeholder = _ref.placeholder,
|
|
90
|
+
popperClassName = _ref.popperClassName,
|
|
91
|
+
_ref$popoverPlacement = _ref.popoverPlacement,
|
|
92
|
+
popoverPlacement = _ref$popoverPlacement === void 0 ? 'downLeft' : _ref$popoverPlacement,
|
|
93
|
+
selected = _ref.selected,
|
|
94
|
+
_ref$shadow = _ref.shadow,
|
|
95
|
+
shadow = _ref$shadow === void 0 ? true : _ref$shadow,
|
|
96
|
+
_ref$shouldCloseOnSel = _ref.shouldCloseOnSelect,
|
|
97
|
+
shouldCloseOnSelect = _ref$shouldCloseOnSel === void 0 ? true : _ref$shouldCloseOnSel,
|
|
98
|
+
_ref$showIcon = _ref.showIcon,
|
|
99
|
+
showIcon = _ref$showIcon === void 0 ? true : _ref$showIcon,
|
|
100
|
+
_ref$showTimeSelect = _ref.showTimeSelect,
|
|
101
|
+
showTimeSelect = _ref$showTimeSelect === void 0 ? false : _ref$showTimeSelect,
|
|
102
|
+
showTimeSelectOnly = _ref.showTimeSelectOnly,
|
|
103
|
+
_ref$timeFormat = _ref.timeFormat,
|
|
104
|
+
timeFormat = _ref$timeFormat === void 0 ? euiDatePickerDefaultTimeFormat : _ref$timeFormat,
|
|
105
|
+
utcOffset = _ref.utcOffset,
|
|
106
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
107
|
+
var classes = (0, _classnames.default)('euiDatePicker', {
|
|
108
|
+
'euiDatePicker--shadow': shadow,
|
|
109
|
+
'euiDatePicker--inline': inline
|
|
110
|
+
});
|
|
111
|
+
var numIconsClass = (0, _num_icons.getFormControlClassNameForIconCount)({
|
|
112
|
+
isInvalid: isInvalid,
|
|
113
|
+
isLoading: isLoading
|
|
114
|
+
});
|
|
115
|
+
var datePickerClasses = (0, _classnames.default)('euiDatePicker', 'euiFieldText', numIconsClass, {
|
|
116
|
+
'euiFieldText--fullWidth': fullWidth,
|
|
117
|
+
'euiFieldText-isLoading': isLoading,
|
|
118
|
+
'euiFieldText--withIcon': !inline && showIcon,
|
|
119
|
+
'euiFieldText--isClearable': !inline && selected && onClear
|
|
120
|
+
}, className);
|
|
121
|
+
var optionalIcon;
|
|
122
|
+
if (inline || customInput || !showIcon) {
|
|
123
|
+
optionalIcon = undefined;
|
|
124
|
+
} else if (iconType) {
|
|
125
|
+
optionalIcon = iconType;
|
|
126
|
+
} else if (showTimeSelectOnly) {
|
|
127
|
+
optionalIcon = 'clock';
|
|
128
|
+
} else {
|
|
129
|
+
optionalIcon = 'calendar';
|
|
72
130
|
}
|
|
73
|
-
_createClass(EuiDatePicker, [{
|
|
74
|
-
key: "render",
|
|
75
|
-
value: function render() {
|
|
76
|
-
var _this$props = this.props,
|
|
77
|
-
adjustDateOnChange = _this$props.adjustDateOnChange,
|
|
78
|
-
calendarClassName = _this$props.calendarClassName,
|
|
79
|
-
className = _this$props.className,
|
|
80
|
-
customInput = _this$props.customInput,
|
|
81
|
-
dateFormat = _this$props.dateFormat,
|
|
82
|
-
dayClassName = _this$props.dayClassName,
|
|
83
|
-
disabled = _this$props.disabled,
|
|
84
|
-
excludeDates = _this$props.excludeDates,
|
|
85
|
-
filterDate = _this$props.filterDate,
|
|
86
|
-
fullWidth = _this$props.fullWidth,
|
|
87
|
-
iconType = _this$props.iconType,
|
|
88
|
-
injectTimes = _this$props.injectTimes,
|
|
89
|
-
inline = _this$props.inline,
|
|
90
|
-
inputRef = _this$props.inputRef,
|
|
91
|
-
isInvalid = _this$props.isInvalid,
|
|
92
|
-
isLoading = _this$props.isLoading,
|
|
93
|
-
locale = _this$props.locale,
|
|
94
|
-
maxDate = _this$props.maxDate,
|
|
95
|
-
maxTime = _this$props.maxTime,
|
|
96
|
-
minDate = _this$props.minDate,
|
|
97
|
-
minTime = _this$props.minTime,
|
|
98
|
-
onChange = _this$props.onChange,
|
|
99
|
-
onClear = _this$props.onClear,
|
|
100
|
-
openToDate = _this$props.openToDate,
|
|
101
|
-
placeholder = _this$props.placeholder,
|
|
102
|
-
popperClassName = _this$props.popperClassName,
|
|
103
|
-
popoverPlacement = _this$props.popoverPlacement,
|
|
104
|
-
selected = _this$props.selected,
|
|
105
|
-
shadow = _this$props.shadow,
|
|
106
|
-
shouldCloseOnSelect = _this$props.shouldCloseOnSelect,
|
|
107
|
-
showIcon = _this$props.showIcon,
|
|
108
|
-
showTimeSelect = _this$props.showTimeSelect,
|
|
109
|
-
showTimeSelectOnly = _this$props.showTimeSelectOnly,
|
|
110
|
-
timeFormat = _this$props.timeFormat,
|
|
111
|
-
utcOffset = _this$props.utcOffset,
|
|
112
|
-
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
113
|
-
var classes = (0, _classnames.default)('euiDatePicker', {
|
|
114
|
-
'euiDatePicker--shadow': shadow,
|
|
115
|
-
'euiDatePicker--inline': inline
|
|
116
|
-
});
|
|
117
|
-
var datePickerClasses = (0, _classnames.default)('euiDatePicker', 'euiFieldText', {
|
|
118
|
-
'euiFieldText--fullWidth': fullWidth,
|
|
119
|
-
'euiFieldText-isLoading': isLoading,
|
|
120
|
-
'euiFieldText--withIcon': !inline && showIcon,
|
|
121
|
-
'euiFieldText--isClearable': !inline && selected && onClear,
|
|
122
|
-
'euiFieldText-isInvalid': isInvalid
|
|
123
|
-
}, className);
|
|
124
|
-
var optionalIcon;
|
|
125
|
-
if (inline || customInput || !showIcon) {
|
|
126
|
-
optionalIcon = undefined;
|
|
127
|
-
} else if (iconType) {
|
|
128
|
-
optionalIcon = iconType;
|
|
129
|
-
} else if (showTimeSelectOnly) {
|
|
130
|
-
optionalIcon = 'clock';
|
|
131
|
-
} else {
|
|
132
|
-
optionalIcon = 'calendar';
|
|
133
|
-
}
|
|
134
131
|
|
|
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
|
-
|
|
132
|
+
// In case the consumer did not alter the default date format but wants
|
|
133
|
+
// to add the time select, we append the default time format
|
|
134
|
+
var fullDateFormat = dateFormat;
|
|
135
|
+
if (showTimeSelect && dateFormat === euiDatePickerDefaultDateFormat) {
|
|
136
|
+
fullDateFormat = "".concat(dateFormat, " ").concat(timeFormat);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Set an internal ref on ReactDatePicker's `input` so we can set its :invalid state via useEuiValidatableControl
|
|
140
|
+
var _useState = (0, _react.useState)(null),
|
|
141
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
142
|
+
inputValidityRef = _useState2[0],
|
|
143
|
+
_setInputValidityRef = _useState2[1];
|
|
144
|
+
var setInputValidityRef = (0, _react.useCallback)(function (ref) {
|
|
145
|
+
_setInputValidityRef(ref === null || ref === void 0 ? void 0 : ref.input);
|
|
146
|
+
}, []);
|
|
147
|
+
(0, _form.useEuiValidatableControl)({
|
|
148
|
+
isInvalid: isInvalid,
|
|
149
|
+
controlEl: inputValidityRef
|
|
150
|
+
});
|
|
151
|
+
var inputRefs = (0, _services.useCombinedRefs)([inputRef, setInputValidityRef]);
|
|
152
|
+
return (0, _react2.jsx)("span", {
|
|
153
|
+
className: classes
|
|
154
|
+
}, (0, _react2.jsx)(_form.EuiFormControlLayout, {
|
|
155
|
+
icon: optionalIcon,
|
|
156
|
+
fullWidth: fullWidth,
|
|
157
|
+
clear: selected && onClear ? {
|
|
158
|
+
onClick: onClear
|
|
159
|
+
} : undefined,
|
|
160
|
+
isLoading: isLoading,
|
|
161
|
+
isInvalid: isInvalid
|
|
162
|
+
}, (0, _react2.jsx)(_context.EuiI18nConsumer, null, function (_ref2) {
|
|
163
|
+
var contextLocale = _ref2.locale;
|
|
164
|
+
return (0, _react2.jsx)(_reactDatepicker.ReactDatePicker, _extends({
|
|
165
|
+
adjustDateOnChange: adjustDateOnChange,
|
|
166
|
+
calendarClassName: calendarClassName,
|
|
167
|
+
className: datePickerClasses,
|
|
168
|
+
customInput: customInput,
|
|
169
|
+
dateFormat: fullDateFormat,
|
|
170
|
+
dayClassName: dayClassName,
|
|
171
|
+
disabled: disabled,
|
|
172
|
+
excludeDates: excludeDates,
|
|
173
|
+
filterDate: filterDate,
|
|
174
|
+
injectTimes: injectTimes,
|
|
175
|
+
inline: inline,
|
|
176
|
+
locale: locale || contextLocale,
|
|
177
|
+
maxDate: maxDate,
|
|
178
|
+
maxTime: maxTime,
|
|
179
|
+
minDate: minDate,
|
|
180
|
+
minTime: minTime,
|
|
181
|
+
onChange: onChange,
|
|
182
|
+
openToDate: openToDate,
|
|
183
|
+
placeholderText: placeholder,
|
|
184
|
+
popperClassName: popperClassName,
|
|
185
|
+
ref: inputRefs,
|
|
186
|
+
selected: selected,
|
|
187
|
+
shouldCloseOnSelect: shouldCloseOnSelect,
|
|
188
|
+
showMonthDropdown: true,
|
|
189
|
+
showTimeSelect: showTimeSelectOnly ? true : showTimeSelect,
|
|
190
|
+
showTimeSelectOnly: showTimeSelectOnly,
|
|
191
|
+
showYearDropdown: true,
|
|
192
|
+
timeFormat: timeFormat,
|
|
193
|
+
utcOffset: utcOffset,
|
|
194
|
+
yearDropdownItemNumber: 7,
|
|
195
|
+
accessibleMode: true,
|
|
196
|
+
popperPlacement: popoverPlacement
|
|
197
|
+
}, rest));
|
|
198
|
+
})));
|
|
199
|
+
};
|
|
193
200
|
exports.EuiDatePicker = EuiDatePicker;
|
|
194
|
-
_defineProperty(EuiDatePicker, "defaultProps", {
|
|
195
|
-
adjustDateOnChange: true,
|
|
196
|
-
dateFormat: euiDatePickerDefaultDateFormat,
|
|
197
|
-
fullWidth: false,
|
|
198
|
-
inputRef: function inputRef() {},
|
|
199
|
-
isLoading: false,
|
|
200
|
-
shadow: true,
|
|
201
|
-
shouldCloseOnSelect: true,
|
|
202
|
-
showIcon: true,
|
|
203
|
-
showTimeSelect: false,
|
|
204
|
-
timeFormat: euiDatePickerDefaultTimeFormat,
|
|
205
|
-
popoverPlacement: 'downLeft'
|
|
206
|
-
});
|
|
207
201
|
EuiDatePicker.propTypes = {
|
|
208
202
|
className: _propTypes.default.string,
|
|
209
203
|
"aria-label": _propTypes.default.string,
|
|
@@ -220,7 +214,7 @@ EuiDatePicker.propTypes = {
|
|
|
220
214
|
/**
|
|
221
215
|
* ref for the ReactDatePicker instance
|
|
222
216
|
*/
|
|
223
|
-
inputRef: _propTypes.default.any
|
|
217
|
+
inputRef: _propTypes.default.any,
|
|
224
218
|
/**
|
|
225
219
|
* Provides styling to the input when invalid
|
|
226
220
|
*/
|
|
@@ -84,7 +84,7 @@ var EuiDatePickerRange = function EuiDatePickerRange(_ref) {
|
|
|
84
84
|
className: "euiDatePickerRange__delimeter"
|
|
85
85
|
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
86
86
|
color: isInvalid ? 'danger' : 'subdued',
|
|
87
|
-
type:
|
|
87
|
+
type: "sortRight"
|
|
88
88
|
}));
|
|
89
89
|
return (0, _react2.jsx)("div", _extends({
|
|
90
90
|
className: classes
|
|
@@ -117,7 +117,7 @@ EuiDatePickerRange.propTypes = {
|
|
|
117
117
|
*/
|
|
118
118
|
isCustom: _propTypes.default.bool,
|
|
119
119
|
/**
|
|
120
|
-
* Will
|
|
120
|
+
* Will color the range delimiter the `danger` color and pass through to each control
|
|
121
121
|
*/
|
|
122
122
|
isInvalid: _propTypes.default.bool,
|
|
123
123
|
/**
|
|
@@ -24,22 +24,20 @@ var DelayHide = function DelayHide() {
|
|
|
24
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
25
|
hide = _useState4[0],
|
|
26
26
|
setHide = _useState4[1];
|
|
27
|
-
var onChangeMinimumDuration = function onChangeMinimumDuration(event) {
|
|
28
|
-
setDuration(parseInt(event.target.value, 10));
|
|
29
|
-
};
|
|
30
|
-
var onChangeHide = function onChangeHide(event) {
|
|
31
|
-
setHide(event.target.checked);
|
|
32
|
-
};
|
|
33
27
|
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_form.EuiFormRow, null, (0, _react2.jsx)(_form.EuiCheckbox, {
|
|
34
28
|
id: "dummy-id",
|
|
35
29
|
checked: hide,
|
|
36
|
-
onChange:
|
|
30
|
+
onChange: function onChange(event) {
|
|
31
|
+
return setHide(event.target.checked);
|
|
32
|
+
},
|
|
37
33
|
label: "Hide child"
|
|
38
34
|
})), (0, _react2.jsx)(_form.EuiFormRow, {
|
|
39
35
|
label: "Minimum duration"
|
|
40
36
|
}, (0, _react2.jsx)(_form.EuiFieldNumber, {
|
|
41
37
|
value: minimumDuration,
|
|
42
|
-
onChange:
|
|
38
|
+
onChange: function onChange(event) {
|
|
39
|
+
return setDuration(parseInt(event.target.value, 10));
|
|
40
|
+
}
|
|
43
41
|
})), (0, _react2.jsx)(_form.EuiFormRow, {
|
|
44
42
|
label: "Child to render"
|
|
45
43
|
}, (0, _react2.jsx)(_delay_hide.EuiDelayHide, {
|
|
@@ -24,24 +24,22 @@ var DelayRender = function DelayRender() {
|
|
|
24
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
25
|
render = _useState4[0],
|
|
26
26
|
setRender = _useState4[1];
|
|
27
|
-
var onChangeMinimumDelay = function onChangeMinimumDelay(event) {
|
|
28
|
-
setDelay(parseInt(event.target.value, 10));
|
|
29
|
-
};
|
|
30
|
-
var onChangeHide = function onChangeHide(event) {
|
|
31
|
-
setRender(event.target.checked);
|
|
32
|
-
};
|
|
33
27
|
var status = render ? 'showing' : 'hidden';
|
|
34
28
|
var label = "Child (".concat(status, ")");
|
|
35
29
|
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_form.EuiFormRow, null, (0, _react2.jsx)(_form.EuiCheckbox, {
|
|
36
30
|
id: "dummy-id",
|
|
37
31
|
checked: render,
|
|
38
|
-
onChange:
|
|
32
|
+
onChange: function onChange(event) {
|
|
33
|
+
return setRender(event.target.checked);
|
|
34
|
+
},
|
|
39
35
|
label: "Show child"
|
|
40
36
|
})), (0, _react2.jsx)(_form.EuiFormRow, {
|
|
41
37
|
label: "Minimum delay"
|
|
42
38
|
}, (0, _react2.jsx)(_form.EuiFieldNumber, {
|
|
43
39
|
value: minimumDelay,
|
|
44
|
-
onChange:
|
|
40
|
+
onChange: function onChange(event) {
|
|
41
|
+
return setDelay(parseInt(event.target.value, 10));
|
|
42
|
+
}
|
|
45
43
|
})), (0, _react2.jsx)(_form.EuiFormRow, {
|
|
46
44
|
label: label
|
|
47
45
|
}, render ? (0, _react2.jsx)(_delay_render.EuiDelayRender, {
|
|
@@ -36,7 +36,6 @@ var DragAndDrop = function DragAndDrop() {
|
|
|
36
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
37
|
list = _useState2[0],
|
|
38
38
|
setList = _useState2[1];
|
|
39
|
-
console.log(list);
|
|
40
39
|
var onDragEnd = function onDragEnd(_ref) {
|
|
41
40
|
var source = _ref.source,
|
|
42
41
|
destination = _ref.destination;
|