@elastic/eui 116.5.0 → 117.0.0-snapshot.1783939453438
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/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +4 -4
- package/es/components/basic_table/in_memory_table.js +13 -4
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/call_out/call_out.js +230 -30
- package/es/components/call_out/call_out.styles.js +36 -43
- package/es/components/call_out/call_out_action.js +45 -0
- package/es/components/call_out/types.js +11 -0
- package/es/components/call_out/use_layout_observer.js +54 -0
- package/es/components/card/card.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/es/components/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/es/components/datagrid/body/data_grid_body.js +7 -7
- package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/es/components/datagrid/controls/column_sorting.js +7 -7
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -20
- package/es/components/datagrid/utils/in_memory.js +6 -6
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/flyout/flyout.component.js +12 -7
- package/es/components/flyout/flyout.styles.js +1 -1
- package/es/components/flyout/flyout_body.styles.js +1 -4
- package/es/components/flyout/flyout_menu.js +2 -2
- package/es/components/flyout/manager/flyout_child.js +1 -1
- package/es/components/flyout/manager/flyout_managed.js +1 -1
- package/es/components/form/field_number/field_number.js +2 -2
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_button/form_control_button.js +1 -1
- package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/text_area/text_area.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo/header_logo.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/icon/assets/add_to_chat.js +43 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +3 -0
- package/es/components/illustration/illustration.js +86 -0
- package/es/components/illustration/illustration.styles.js +16 -0
- package/es/components/illustration/index.js +9 -0
- package/es/components/index.js +1 -0
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/popover/with_popover.js +17 -0
- package/es/components/search_bar/search_bar.js +190 -376
- package/es/components/search_bar/search_filters.js +10 -3
- package/es/components/selectable/selectable_list/selectable_list.js +8 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +2 -2
- package/es/components/toast/toast.js +2 -2
- package/es/components/toast/toast.styles.js +2 -2
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/components/tool_tip/with_tooltip.js +14 -0
- package/eui.d.ts +625 -448
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +4 -4
- package/lib/components/basic_table/in_memory_table.js +13 -4
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/call_out/call_out.js +230 -30
- package/lib/components/call_out/call_out.styles.js +37 -42
- package/lib/components/call_out/call_out_action.js +51 -0
- package/lib/components/call_out/types.js +17 -0
- package/lib/components/call_out/use_layout_observer.js +58 -0
- package/lib/components/card/card.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/lib/components/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/lib/components/datagrid/body/data_grid_body.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/lib/components/datagrid/controls/column_sorting.js +7 -7
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -20
- package/lib/components/datagrid/utils/in_memory.js +6 -6
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/flyout/flyout.component.js +11 -6
- package/lib/components/flyout/flyout.styles.js +1 -1
- package/lib/components/flyout/flyout_body.styles.js +1 -4
- package/lib/components/flyout/flyout_menu.js +2 -2
- package/lib/components/flyout/manager/flyout_child.js +1 -1
- package/lib/components/form/field_number/field_number.js +2 -2
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_button/form_control_button.js +1 -1
- package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/text_area/text_area.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo/header_logo.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/icon/assets/add_to_chat.js +50 -0
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +5 -0
- package/lib/components/icon/svgs/add_to_chat.svg +6 -0
- package/lib/components/illustration/illustration.js +91 -0
- package/lib/components/illustration/illustration.styles.js +22 -0
- package/lib/components/illustration/index.js +12 -0
- package/lib/components/index.js +11 -0
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/pagination/pagination_button.js +1 -1
- package/lib/components/popover/with_popover.js +22 -0
- package/lib/components/search_bar/search_bar.js +193 -380
- package/lib/components/search_bar/search_filters.js +10 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +8 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +2 -2
- package/lib/components/toast/toast.js +2 -2
- package/lib/components/toast/toast.styles.js +2 -2
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/components/tool_tip/with_tooltip.js +21 -0
- package/optimize/es/components/call_out/call_out.js +123 -28
- package/optimize/es/components/call_out/call_out.styles.js +36 -43
- package/optimize/es/components/call_out/call_out_action.js +44 -0
- package/optimize/es/components/call_out/types.js +11 -0
- package/optimize/es/components/call_out/use_layout_observer.js +49 -0
- package/optimize/es/components/flyout/flyout.component.js +12 -7
- package/optimize/es/components/flyout/flyout.styles.js +1 -1
- package/optimize/es/components/flyout/flyout_body.styles.js +1 -4
- package/optimize/es/components/icon/assets/add_to_chat.js +42 -0
- package/optimize/es/components/icon/icon_map.js +3 -0
- package/optimize/es/components/illustration/illustration.js +57 -0
- package/optimize/es/components/illustration/illustration.styles.js +16 -0
- package/optimize/es/components/illustration/index.js +9 -0
- package/optimize/es/components/index.js +1 -0
- package/optimize/es/components/popover/with_popover.js +17 -0
- package/optimize/es/components/search_bar/search_bar.js +184 -193
- package/optimize/es/components/search_bar/search_filters.js +5 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +7 -0
- package/optimize/es/components/toast/toast.styles.js +2 -2
- package/optimize/es/components/tool_tip/with_tooltip.js +14 -0
- package/optimize/lib/components/call_out/call_out.js +123 -28
- package/optimize/lib/components/call_out/call_out.styles.js +37 -42
- package/optimize/lib/components/call_out/call_out_action.js +50 -0
- package/optimize/lib/components/call_out/types.js +17 -0
- package/optimize/lib/components/call_out/use_layout_observer.js +56 -0
- package/optimize/lib/components/flyout/flyout.component.js +11 -6
- package/optimize/lib/components/flyout/flyout.styles.js +1 -1
- package/optimize/lib/components/flyout/flyout_body.styles.js +1 -4
- package/optimize/lib/components/icon/assets/add_to_chat.js +50 -0
- package/optimize/lib/components/icon/icon_map.js +5 -0
- package/optimize/lib/components/icon/svgs/add_to_chat.svg +6 -0
- package/optimize/lib/components/illustration/illustration.js +62 -0
- package/optimize/lib/components/illustration/illustration.styles.js +22 -0
- package/optimize/lib/components/illustration/index.js +12 -0
- package/optimize/lib/components/index.js +11 -0
- package/optimize/lib/components/popover/with_popover.js +24 -0
- package/optimize/lib/components/search_bar/search_bar.js +192 -200
- package/optimize/lib/components/search_bar/search_filters.js +5 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +7 -0
- package/optimize/lib/components/toast/toast.styles.js +2 -2
- package/optimize/lib/components/tool_tip/with_tooltip.js +21 -0
- package/package.json +8 -7
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +4 -4
- package/test-env/components/basic_table/in_memory_table.js +13 -4
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/call_out/call_out.js +230 -30
- package/test-env/components/call_out/call_out.styles.js +37 -42
- package/test-env/components/call_out/call_out_action.js +50 -0
- package/test-env/components/call_out/types.js +17 -0
- package/test-env/components/call_out/use_layout_observer.js +56 -0
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/test-env/components/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/test-env/components/datagrid/body/data_grid_body.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/test-env/components/datagrid/controls/column_sorting.js +7 -7
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -20
- package/test-env/components/datagrid/utils/in_memory.js +6 -6
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/flyout/flyout.component.js +11 -6
- package/test-env/components/flyout/flyout.styles.js +1 -1
- package/test-env/components/flyout/flyout_body.styles.js +1 -4
- package/test-env/components/flyout/flyout_menu.js +2 -2
- package/test-env/components/flyout/manager/flyout_child.js +1 -1
- package/test-env/components/form/field_number/field_number.js +2 -2
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_button/form_control_button.js +1 -1
- package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/text_area/text_area.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo/header_logo.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/icon/assets/add_to_chat.js +50 -0
- package/test-env/components/icon/icon_map.js +5 -0
- package/test-env/components/illustration/illustration.js +90 -0
- package/test-env/components/illustration/illustration.styles.js +22 -0
- package/test-env/components/illustration/index.js +12 -0
- package/test-env/components/index.js +11 -0
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/pagination/pagination_button.js +1 -1
- package/test-env/components/popover/with_popover.js +24 -0
- package/test-env/components/search_bar/search_bar.js +192 -379
- package/test-env/components/search_bar/search_filters.js +10 -3
- package/test-env/components/selectable/selectable_list/selectable_list.js +8 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +2 -2
- package/test-env/components/toast/toast.js +2 -2
- package/test-env/components/toast/toast.styles.js +2 -2
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/components/tool_tip/with_tooltip.js +21 -0
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
var _excluded = ["schema"];
|
|
1
|
+
var _excluded = ["schema", "aria-describedby"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
7
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
8
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
9
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
10
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
12
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
13
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
15
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
16
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
17
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
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."); }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
20
16
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
21
|
-
import PropTypes from "prop-types";
|
|
22
17
|
/*
|
|
23
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -27,8 +22,8 @@ import PropTypes from "prop-types";
|
|
|
27
22
|
* Side Public License, v 1.
|
|
28
23
|
*/
|
|
29
24
|
|
|
30
|
-
import React, {
|
|
31
|
-
import {
|
|
25
|
+
import React, { useState } from 'react';
|
|
26
|
+
import { useEuiTheme, useGeneratedHtmlId } from '../../services';
|
|
32
27
|
import { isString } from '../../services/predicate';
|
|
33
28
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
34
29
|
import { EuiToolTip } from '../tool_tip';
|
|
@@ -60,370 +55,189 @@ var parseQuery = function parseQuery(query, props) {
|
|
|
60
55
|
}
|
|
61
56
|
return isString(query) ? Query.parse(query, parseOptions) : query;
|
|
62
57
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
query: query,
|
|
74
|
-
queryText: queryText,
|
|
75
|
-
error: null
|
|
76
|
-
});
|
|
77
|
-
_this.setState({
|
|
78
|
-
query: query,
|
|
79
|
-
queryText: queryText,
|
|
80
|
-
error: null
|
|
81
|
-
});
|
|
82
|
-
} catch (e) {
|
|
83
|
-
var error = e instanceof Error ? {
|
|
84
|
-
name: e.name,
|
|
85
|
-
message: e.message
|
|
86
|
-
} : {
|
|
87
|
-
name: 'Unexpected error',
|
|
88
|
-
message: String(e)
|
|
89
|
-
};
|
|
90
|
-
_this.notifyControllingParent({
|
|
91
|
-
query: null,
|
|
92
|
-
queryText: queryText,
|
|
93
|
-
error: error
|
|
94
|
-
});
|
|
95
|
-
_this.setState({
|
|
96
|
-
queryText: queryText,
|
|
97
|
-
error: error
|
|
98
|
-
});
|
|
99
|
-
}
|
|
58
|
+
function renderTools(tools) {
|
|
59
|
+
if (!tools) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (Array.isArray(tools)) {
|
|
63
|
+
return tools.map(function (tool) {
|
|
64
|
+
return ___EmotionJSX(EuiFlexItem, {
|
|
65
|
+
grow: false,
|
|
66
|
+
key: tool.key == null ? undefined : tool.key
|
|
67
|
+
}, tool);
|
|
100
68
|
});
|
|
101
|
-
|
|
102
|
-
|
|
69
|
+
}
|
|
70
|
+
return ___EmotionJSX(EuiFlexItem, {
|
|
71
|
+
grow: false
|
|
72
|
+
}, tools);
|
|
73
|
+
}
|
|
74
|
+
function notifyControllingParent(oldState, newState, onChange) {
|
|
75
|
+
if (!onChange) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
var query = newState.query,
|
|
79
|
+
queryText = newState.queryText,
|
|
80
|
+
error = newState.error;
|
|
81
|
+
var isQueryDifferent = oldState.queryText !== queryText;
|
|
82
|
+
var oldError = oldState.error ? oldState.error.message : null;
|
|
83
|
+
var newError = error ? error.message : null;
|
|
84
|
+
var isErrorDifferent = oldError !== newError;
|
|
85
|
+
if (isQueryDifferent || isErrorDifferent) {
|
|
86
|
+
if (error == null) {
|
|
87
|
+
onChange({
|
|
103
88
|
query: query,
|
|
104
|
-
queryText:
|
|
105
|
-
error:
|
|
89
|
+
queryText: queryText,
|
|
90
|
+
error: error
|
|
106
91
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
92
|
+
} else {
|
|
93
|
+
onChange({
|
|
94
|
+
query: null,
|
|
95
|
+
queryText: queryText,
|
|
96
|
+
error: error
|
|
111
97
|
});
|
|
112
|
-
});
|
|
113
|
-
var _query = parseQuery(props.defaultQuery || props.query, props);
|
|
114
|
-
_this.state = {
|
|
115
|
-
query: _query,
|
|
116
|
-
queryText: _query.text,
|
|
117
|
-
error: null,
|
|
118
|
-
isHintVisible: false
|
|
119
|
-
};
|
|
120
|
-
return _this;
|
|
121
|
-
}
|
|
122
|
-
_inherits(EuiSearchBar, _Component);
|
|
123
|
-
return _createClass(EuiSearchBar, [{
|
|
124
|
-
key: "notifyControllingParent",
|
|
125
|
-
value: function notifyControllingParent(newState) {
|
|
126
|
-
var onChange = this.props.onChange;
|
|
127
|
-
if (!onChange) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
var oldState = this.state;
|
|
131
|
-
var query = newState.query,
|
|
132
|
-
queryText = newState.queryText,
|
|
133
|
-
error = newState.error;
|
|
134
|
-
var isQueryDifferent = oldState.queryText !== queryText;
|
|
135
|
-
var oldError = oldState.error ? oldState.error.message : null;
|
|
136
|
-
var newError = error ? error.message : null;
|
|
137
|
-
var isErrorDifferent = oldError !== newError;
|
|
138
|
-
if (isQueryDifferent || isErrorDifferent) {
|
|
139
|
-
if (error == null) {
|
|
140
|
-
onChange({
|
|
141
|
-
query: query,
|
|
142
|
-
queryText: queryText,
|
|
143
|
-
error: error
|
|
144
|
-
});
|
|
145
|
-
} else {
|
|
146
|
-
onChange({
|
|
147
|
-
query: null,
|
|
148
|
-
queryText: queryText,
|
|
149
|
-
error: error
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "renderTools",
|
|
156
|
-
value: function renderTools(tools) {
|
|
157
|
-
if (!tools) {
|
|
158
|
-
return undefined;
|
|
159
|
-
}
|
|
160
|
-
if (Array.isArray(tools)) {
|
|
161
|
-
return tools.map(function (tool) {
|
|
162
|
-
return ___EmotionJSX(EuiFlexItem, {
|
|
163
|
-
grow: false,
|
|
164
|
-
key: tool.key == null ? undefined : tool.key
|
|
165
|
-
}, tool);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
return ___EmotionJSX(EuiFlexItem, {
|
|
169
|
-
grow: false
|
|
170
|
-
}, tools);
|
|
171
98
|
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
css: euiSearchBar__filtersHolder(euiTheme),
|
|
227
|
-
grow: false
|
|
228
|
-
}, ___EmotionJSX(EuiSearchBarFilters, {
|
|
229
|
-
filters: filters,
|
|
230
|
-
query: query,
|
|
231
|
-
onChange: _this2.onFiltersChange
|
|
232
|
-
})), toolsRightEl);
|
|
233
|
-
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export var EuiSearchBar = function EuiSearchBar(props) {
|
|
102
|
+
var _hint$popoverProps$is, _hint$popoverProps;
|
|
103
|
+
var _props$box3 = props.box,
|
|
104
|
+
_props$box4 = _props$box3 === void 0 ? {
|
|
105
|
+
schema: ''
|
|
106
|
+
} : _props$box3,
|
|
107
|
+
schema = _props$box4.schema,
|
|
108
|
+
boxAriaDescribedBy = _props$box4['aria-describedby'],
|
|
109
|
+
box = _objectWithoutProperties(_props$box4, _excluded),
|
|
110
|
+
filters = props.filters,
|
|
111
|
+
toolsLeft = props.toolsLeft,
|
|
112
|
+
toolsRight = props.toolsRight,
|
|
113
|
+
hint = props.hint,
|
|
114
|
+
compressed = props.compressed,
|
|
115
|
+
_props$showErrorToolt = props.showErrorTooltip,
|
|
116
|
+
showErrorTooltip = _props$showErrorToolt === void 0 ? true : _props$showErrorToolt;
|
|
117
|
+
var theme = useEuiTheme();
|
|
118
|
+
var hintId = useGeneratedHtmlId({
|
|
119
|
+
prefix: '__hint'
|
|
120
|
+
});
|
|
121
|
+
var _useState = useState(function () {
|
|
122
|
+
return parseQuery(props.defaultQuery || props.query, props);
|
|
123
|
+
}),
|
|
124
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
125
|
+
query = _useState2[0],
|
|
126
|
+
setQuery = _useState2[1];
|
|
127
|
+
var _useState3 = useState(query.text),
|
|
128
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
129
|
+
queryText = _useState4[0],
|
|
130
|
+
setQueryText = _useState4[1];
|
|
131
|
+
var _useState5 = useState(null),
|
|
132
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
133
|
+
error = _useState6[0],
|
|
134
|
+
setError = _useState6[1];
|
|
135
|
+
var _useState7 = useState(false),
|
|
136
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
137
|
+
isHintVisibleState = _useState8[0],
|
|
138
|
+
setIsHintVisibleState = _useState8[1];
|
|
139
|
+
var _useState9 = useState(props.query),
|
|
140
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
141
|
+
prevPropsQuery = _useState10[0],
|
|
142
|
+
setPrevPropsQuery = _useState10[1];
|
|
143
|
+
if (props.query !== prevPropsQuery) {
|
|
144
|
+
var nextQuery = props.query;
|
|
145
|
+
var prevQuery = query;
|
|
146
|
+
var shouldUpdate = (nextQuery || nextQuery === '') && (typeof nextQuery !== 'string' && nextQuery.text !== prevQuery.text || typeof nextQuery === 'string' && nextQuery !== prevQuery.text);
|
|
147
|
+
if (shouldUpdate) {
|
|
148
|
+
setPrevPropsQuery(props.query);
|
|
149
|
+
var parsedQuery = parseQuery(nextQuery, props);
|
|
150
|
+
setQuery(parsedQuery);
|
|
151
|
+
setQueryText(parsedQuery.text);
|
|
152
|
+
setError(null);
|
|
234
153
|
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
154
|
+
}
|
|
155
|
+
function onSearch(newQueryText) {
|
|
156
|
+
var oldState = {
|
|
157
|
+
query: query,
|
|
158
|
+
queryText: queryText,
|
|
159
|
+
error: error
|
|
160
|
+
};
|
|
161
|
+
try {
|
|
162
|
+
var newQuery = parseQuery(newQueryText, props);
|
|
163
|
+
notifyControllingParent(oldState, {
|
|
164
|
+
query: newQuery,
|
|
165
|
+
queryText: newQueryText,
|
|
166
|
+
error: null
|
|
167
|
+
}, props.onChange);
|
|
168
|
+
setQuery(newQuery);
|
|
169
|
+
setQueryText(newQuery.text);
|
|
170
|
+
setError(null);
|
|
171
|
+
} catch (e) {
|
|
172
|
+
var _error = e instanceof Error ? {
|
|
173
|
+
name: e.name,
|
|
174
|
+
message: e.message
|
|
175
|
+
} : {
|
|
176
|
+
name: 'Unexpected error',
|
|
177
|
+
message: String(e)
|
|
178
|
+
};
|
|
179
|
+
notifyControllingParent(oldState, {
|
|
180
|
+
query: null,
|
|
181
|
+
queryText: newQueryText,
|
|
182
|
+
error: _error
|
|
183
|
+
}, props.onChange);
|
|
184
|
+
setQueryText(newQueryText);
|
|
185
|
+
setError(_error);
|
|
248
186
|
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
append: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.element.isRequired]).isRequired, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.element.isRequired]).isRequired).isRequired]),
|
|
307
|
-
className: PropTypes.string,
|
|
308
|
-
"aria-label": PropTypes.string,
|
|
309
|
-
"data-test-subj": PropTypes.string,
|
|
310
|
-
css: PropTypes.any,
|
|
311
|
-
// Boolean values are not meaningful to this EuiSearchBox, but are allowed so that other
|
|
312
|
-
// components can use e.g. a true value to mean "auto-derive a schema". See EuiInMemoryTable.
|
|
313
|
-
// Admittedly, this is a bit of a hack.
|
|
314
|
-
schema: PropTypes.oneOfType([PropTypes.shape({
|
|
315
|
-
strict: PropTypes.bool,
|
|
316
|
-
fields: PropTypes.any,
|
|
317
|
-
flags: PropTypes.arrayOf(PropTypes.string.isRequired),
|
|
318
|
-
// Controls which phrases will be parsed as field clauses
|
|
319
|
-
recognizedFields: PropTypes.arrayOf(PropTypes.string.isRequired)
|
|
320
|
-
}).isRequired, PropTypes.bool.isRequired])
|
|
321
|
-
}),
|
|
322
|
-
/**
|
|
323
|
-
* An array of search filters. See {@link SearchFilterConfig}.
|
|
324
|
-
*/
|
|
325
|
-
filters: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
326
|
-
type: PropTypes.oneOf(["is"]).isRequired,
|
|
327
|
-
field: PropTypes.string.isRequired,
|
|
328
|
-
name: PropTypes.string.isRequired,
|
|
329
|
-
negatedName: PropTypes.string,
|
|
330
|
-
available: PropTypes.func
|
|
331
|
-
}).isRequired, PropTypes.shape({
|
|
332
|
-
type: PropTypes.oneOf(["field_value_selection"]).isRequired,
|
|
333
|
-
field: PropTypes.string,
|
|
334
|
-
name: PropTypes.string.isRequired,
|
|
335
|
-
/**
|
|
336
|
-
* See {@link FieldValueOptionType}
|
|
337
|
-
*/
|
|
338
|
-
options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
339
|
-
field: PropTypes.string,
|
|
340
|
-
value: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired, PropTypes.bool.isRequired, PropTypes.shape({
|
|
341
|
-
type: PropTypes.oneOf(["date"]).isRequired,
|
|
342
|
-
raw: PropTypes.any.isRequired,
|
|
343
|
-
granularity: PropTypes.oneOfType([PropTypes.shape({
|
|
344
|
-
es: PropTypes.oneOf(["d", "w", "M", "y"]).isRequired,
|
|
345
|
-
js: PropTypes.oneOf(["day", "week", "month", "year"]).isRequired,
|
|
346
|
-
isSame: PropTypes.func.isRequired,
|
|
347
|
-
start: PropTypes.func.isRequired,
|
|
348
|
-
startOfNext: PropTypes.func.isRequired,
|
|
349
|
-
iso8601: PropTypes.func.isRequired
|
|
350
|
-
}).isRequired, PropTypes.oneOf([undefined])]).isRequired,
|
|
351
|
-
text: PropTypes.string.isRequired,
|
|
352
|
-
resolve: PropTypes.func.isRequired
|
|
353
|
-
}).isRequired]).isRequired,
|
|
354
|
-
name: PropTypes.string,
|
|
355
|
-
view: PropTypes.node
|
|
356
|
-
}).isRequired).isRequired, PropTypes.func.isRequired]).isRequired,
|
|
357
|
-
filterWith: PropTypes.oneOfType([PropTypes.oneOf(["prefix", "includes"]), PropTypes.func.isRequired]),
|
|
358
|
-
cache: PropTypes.number,
|
|
359
|
-
multiSelect: PropTypes.oneOfType([PropTypes.bool.isRequired, PropTypes.oneOf(["and", "or"])]),
|
|
360
|
-
loadingMessage: PropTypes.string,
|
|
361
|
-
noOptionsMessage: PropTypes.string,
|
|
362
|
-
searchThreshold: PropTypes.number,
|
|
363
|
-
available: PropTypes.func,
|
|
364
|
-
autoClose: PropTypes.bool,
|
|
365
|
-
operator: PropTypes.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"]),
|
|
366
|
-
autoSortOptions: PropTypes.bool
|
|
367
|
-
}).isRequired, PropTypes.shape({
|
|
368
|
-
type: PropTypes.oneOf(["field_value_toggle"]).isRequired,
|
|
369
|
-
field: PropTypes.string.isRequired,
|
|
370
|
-
value: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired, PropTypes.bool.isRequired, PropTypes.shape({
|
|
371
|
-
type: PropTypes.oneOf(["date"]).isRequired,
|
|
372
|
-
raw: PropTypes.any.isRequired,
|
|
373
|
-
granularity: PropTypes.oneOfType([PropTypes.shape({
|
|
374
|
-
es: PropTypes.oneOf(["d", "w", "M", "y"]).isRequired,
|
|
375
|
-
js: PropTypes.oneOf(["day", "week", "month", "year"]).isRequired,
|
|
376
|
-
isSame: PropTypes.func.isRequired,
|
|
377
|
-
start: PropTypes.func.isRequired,
|
|
378
|
-
startOfNext: PropTypes.func.isRequired,
|
|
379
|
-
iso8601: PropTypes.func.isRequired
|
|
380
|
-
}).isRequired, PropTypes.oneOf([undefined])]).isRequired,
|
|
381
|
-
text: PropTypes.string.isRequired,
|
|
382
|
-
resolve: PropTypes.func.isRequired
|
|
383
|
-
}).isRequired]).isRequired,
|
|
384
|
-
name: PropTypes.string.isRequired,
|
|
385
|
-
negatedName: PropTypes.string,
|
|
386
|
-
available: PropTypes.func,
|
|
387
|
-
operator: PropTypes.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
|
|
388
|
-
}).isRequired, PropTypes.shape({
|
|
389
|
-
type: PropTypes.oneOf(["field_value_toggle_group"]).isRequired,
|
|
390
|
-
field: PropTypes.string.isRequired,
|
|
391
|
-
/**
|
|
392
|
-
* See {@link FieldValueToggleGroupFilterItemType}
|
|
393
|
-
*/
|
|
394
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
395
|
-
value: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired, PropTypes.bool.isRequired]).isRequired,
|
|
396
|
-
name: PropTypes.string.isRequired,
|
|
397
|
-
negatedName: PropTypes.string,
|
|
398
|
-
operator: PropTypes.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
|
|
399
|
-
}).isRequired).isRequired,
|
|
400
|
-
available: PropTypes.func
|
|
401
|
-
}).isRequired, PropTypes.shape({
|
|
402
|
-
type: PropTypes.oneOf(["custom_component"]).isRequired,
|
|
403
|
-
component: PropTypes.elementType.isRequired,
|
|
404
|
-
available: PropTypes.func
|
|
405
|
-
}).isRequired]).isRequired),
|
|
406
|
-
/**
|
|
407
|
-
* Tools which go to the left of the search bar.
|
|
408
|
-
*/
|
|
409
|
-
toolsLeft: PropTypes.oneOfType([PropTypes.element.isRequired, PropTypes.arrayOf(PropTypes.element.isRequired).isRequired]),
|
|
410
|
-
/**
|
|
411
|
-
* Tools which go to the right of the search bar.
|
|
412
|
-
*/
|
|
413
|
-
toolsRight: PropTypes.oneOfType([PropTypes.element.isRequired, PropTypes.arrayOf(PropTypes.element.isRequired).isRequired]),
|
|
414
|
-
/**
|
|
415
|
-
* Date formatter to use when parsing date values
|
|
416
|
-
*/
|
|
417
|
-
dateFormat: PropTypes.any,
|
|
418
|
-
/**
|
|
419
|
-
* Hint to render below the search bar
|
|
420
|
-
*/
|
|
421
|
-
hint: PropTypes.shape({
|
|
422
|
-
content: PropTypes.node.isRequired,
|
|
423
|
-
popoverProps: PropTypes.any
|
|
424
|
-
}),
|
|
425
|
-
className: PropTypes.string,
|
|
426
|
-
"aria-label": PropTypes.string,
|
|
427
|
-
"data-test-subj": PropTypes.string,
|
|
428
|
-
css: PropTypes.any
|
|
429
|
-
};
|
|
187
|
+
}
|
|
188
|
+
function onFiltersChange(newQuery) {
|
|
189
|
+
notifyControllingParent({
|
|
190
|
+
query: query,
|
|
191
|
+
queryText: queryText,
|
|
192
|
+
error: error
|
|
193
|
+
}, {
|
|
194
|
+
query: newQuery,
|
|
195
|
+
queryText: newQuery.text,
|
|
196
|
+
error: null
|
|
197
|
+
}, props.onChange);
|
|
198
|
+
setQuery(newQuery);
|
|
199
|
+
setQueryText(newQuery.text);
|
|
200
|
+
setError(null);
|
|
201
|
+
}
|
|
202
|
+
var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 || (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
|
|
203
|
+
var toolsLeftEl = renderTools(toolsLeft);
|
|
204
|
+
var toolsRightEl = renderTools(toolsRight);
|
|
205
|
+
var describedByIds = [boxAriaDescribedBy, isHintVisible ? hintId : undefined].filter(Boolean).join(' ');
|
|
206
|
+
var searchBox = ___EmotionJSX(EuiSearchBox, _extends({
|
|
207
|
+
compressed: compressed
|
|
208
|
+
}, box, {
|
|
209
|
+
query: queryText,
|
|
210
|
+
onSearch: onSearch,
|
|
211
|
+
isInvalid: error != null,
|
|
212
|
+
"aria-describedby": describedByIds || undefined,
|
|
213
|
+
hint: hint ? _objectSpread({
|
|
214
|
+
isVisible: isHintVisible,
|
|
215
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
216
|
+
setIsHintVisibleState(isVisible);
|
|
217
|
+
},
|
|
218
|
+
id: hintId
|
|
219
|
+
}, hint) : undefined
|
|
220
|
+
}));
|
|
221
|
+
return ___EmotionJSX(EuiFlexGroup, {
|
|
222
|
+
gutterSize: "s",
|
|
223
|
+
alignItems: "center",
|
|
224
|
+
wrap: true
|
|
225
|
+
}, toolsLeftEl, ___EmotionJSX(EuiFlexItem, {
|
|
226
|
+
className: "euiSearchBar__searchHolder",
|
|
227
|
+
css: euiSearchBar__searchHolder(theme),
|
|
228
|
+
grow: true
|
|
229
|
+
}, showErrorTooltip ? ___EmotionJSX(EuiToolTip, {
|
|
230
|
+
content: error === null || error === void 0 ? void 0 : error.message,
|
|
231
|
+
display: "block"
|
|
232
|
+
}, searchBox) : searchBox), filters && ___EmotionJSX(EuiFlexItem, {
|
|
233
|
+
className: "euiSearchBar__filtersHolder",
|
|
234
|
+
css: euiSearchBar__filtersHolder(theme),
|
|
235
|
+
grow: false
|
|
236
|
+
}, ___EmotionJSX(EuiSearchBarFilters, {
|
|
237
|
+
filters: filters,
|
|
238
|
+
query: query,
|
|
239
|
+
onChange: onFiltersChange,
|
|
240
|
+
compressed: compressed
|
|
241
|
+
})), toolsRightEl);
|
|
242
|
+
};
|
|
243
|
+
EuiSearchBar.Query = Query;
|
|
@@ -15,7 +15,8 @@ export var EuiSearchBarFilters = function EuiSearchBarFilters(_ref) {
|
|
|
15
15
|
var _ref$filters = _ref.filters,
|
|
16
16
|
filters = _ref$filters === void 0 ? [] : _ref$filters,
|
|
17
17
|
query = _ref.query,
|
|
18
|
-
onChange = _ref.onChange
|
|
18
|
+
onChange = _ref.onChange,
|
|
19
|
+
compressed = _ref.compressed;
|
|
19
20
|
var items = filters.reduce(function (acc, filterConfig, index) {
|
|
20
21
|
if (filterConfig.available && !filterConfig.available()) {
|
|
21
22
|
return acc;
|
|
@@ -27,7 +28,9 @@ export var EuiSearchBarFilters = function EuiSearchBarFilters(_ref) {
|
|
|
27
28
|
}, control));
|
|
28
29
|
return acc;
|
|
29
30
|
}, []);
|
|
30
|
-
return ___EmotionJSX(EuiFilterGroup,
|
|
31
|
+
return ___EmotionJSX(EuiFilterGroup, {
|
|
32
|
+
compressed: compressed
|
|
33
|
+
}, items);
|
|
31
34
|
};
|
|
32
35
|
EuiSearchBarFilters.propTypes = {
|
|
33
36
|
query: PropTypes.any.isRequired,
|
|
@@ -112,5 +115,9 @@ EuiSearchBarFilters.propTypes = {
|
|
|
112
115
|
type: PropTypes.oneOf(["custom_component"]).isRequired,
|
|
113
116
|
component: PropTypes.elementType.isRequired,
|
|
114
117
|
available: PropTypes.func
|
|
115
|
-
}).isRequired]).isRequired).isRequired
|
|
118
|
+
}).isRequired]).isRequired).isRequired,
|
|
119
|
+
/**
|
|
120
|
+
* When `true`, creates a shorter height filter group
|
|
121
|
+
*/
|
|
122
|
+
compressed: PropTypes.bool
|
|
116
123
|
};
|