@elastic/eui 114.1.0 → 114.2.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/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 +4 -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 +1 -1
- package/es/components/card/card.js +1 -1
- package/es/components/card/checkable_card/checkable_card.styles.js +7 -3
- 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 -1
- 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_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 +5 -4
- package/es/components/form/form_control_button/form_control_button.styles.js +9 -0
- 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/form_control_layout/form_control_layout_icons.js +2 -2
- 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_dashboard.js +52 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +3 -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/markdown_editor/plugins/markdown_link_validator.js +61 -7
- 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/wrapping_popover.js +30 -65
- package/es/components/search_bar/filters/is_filter.js +38 -80
- package/es/components/selectable/selectable.js +14 -13
- package/es/components/selectable/selectable_list/selectable_list.js +1 -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 +1 -1
- package/es/components/toast/toast.js +1 -1
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/services/index.js +1 -1
- package/es/services/window_event/hooks.js +23 -0
- package/es/services/window_event/index.js +2 -1
- package/es/services/window_event/window_event.js +6 -63
- package/eui.d.ts +79 -57
- package/i18ntokens.json +510 -510
- 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 +4 -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 +1 -1
- package/lib/components/card/card.js +1 -1
- package/lib/components/card/checkable_card/checkable_card.styles.js +6 -2
- 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 -1
- 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_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 +5 -4
- package/lib/components/form/form_control_button/form_control_button.styles.js +9 -0
- 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/form_control_layout/form_control_layout_icons.js +2 -2
- 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_dashboard.js +59 -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_dashboard.svg +9 -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/markdown_editor/plugins/markdown_link_validator.js +62 -7
- 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/wrapping_popover.js +37 -71
- package/lib/components/search_bar/filters/is_filter.js +40 -82
- package/lib/components/selectable/selectable.js +14 -13
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -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 +1 -1
- package/lib/components/toast/toast.js +1 -1
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/services/index.js +8 -1
- package/lib/services/window_event/hooks.js +29 -0
- package/lib/services/window_event/index.js +8 -1
- package/lib/services/window_event/window_event.js +8 -64
- package/optimize/es/components/card/checkable_card/checkable_card.styles.js +7 -3
- package/optimize/es/components/form/form_control_button/form_control_button.js +4 -3
- package/optimize/es/components/form/form_control_button/form_control_button.styles.js +9 -0
- package/optimize/es/components/icon/assets/add_to_dashboard.js +51 -0
- package/optimize/es/components/icon/icon_map.js +3 -0
- package/optimize/es/components/markdown_editor/plugins/markdown_link_validator.js +61 -7
- package/optimize/es/components/popover/wrapping_popover.js +30 -55
- package/optimize/es/components/search_bar/filters/is_filter.js +39 -62
- package/optimize/es/components/selectable/selectable.js +14 -13
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/window_event/hooks.js +23 -0
- package/optimize/es/services/window_event/index.js +2 -1
- package/optimize/es/services/window_event/window_event.js +7 -53
- package/optimize/lib/components/card/checkable_card/checkable_card.styles.js +6 -2
- package/optimize/lib/components/form/form_control_button/form_control_button.js +4 -3
- package/optimize/lib/components/form/form_control_button/form_control_button.styles.js +9 -0
- package/optimize/lib/components/icon/assets/add_to_dashboard.js +59 -0
- package/optimize/lib/components/icon/icon_map.js +5 -0
- package/optimize/lib/components/icon/svgs/add_to_dashboard.svg +9 -0
- package/optimize/lib/components/markdown_editor/plugins/markdown_link_validator.js +62 -7
- package/optimize/lib/components/popover/wrapping_popover.js +33 -57
- package/optimize/lib/components/search_bar/filters/is_filter.js +41 -65
- package/optimize/lib/components/selectable/selectable.js +14 -13
- package/optimize/lib/services/index.js +8 -1
- package/optimize/lib/services/window_event/hooks.js +29 -0
- package/optimize/lib/services/window_event/index.js +8 -1
- package/optimize/lib/services/window_event/window_event.js +9 -54
- package/package.json +1 -1
- 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 +4 -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 +1 -1
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/card/checkable_card/checkable_card.styles.js +6 -2
- 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 -1
- 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_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 +5 -4
- package/test-env/components/form/form_control_button/form_control_button.styles.js +9 -0
- 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/form_control_layout/form_control_layout_icons.js +2 -2
- 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_dashboard.js +59 -0
- package/test-env/components/icon/icon_map.js +5 -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/markdown_editor/plugins/markdown_link_validator.js +62 -7
- 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/wrapping_popover.js +33 -61
- package/test-env/components/search_bar/filters/is_filter.js +40 -77
- package/test-env/components/selectable/selectable.js +14 -13
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -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 +1 -1
- package/test-env/components/toast/toast.js +1 -1
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/services/index.js +8 -1
- package/test-env/services/window_event/hooks.js +29 -0
- package/test-env/services/window_event/index.js +8 -1
- package/test-env/services/window_event/window_event.js +8 -58
|
@@ -1,77 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.EuiWindowEvent = void 0;
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
-
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); } }
|
|
13
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
-
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); }
|
|
16
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
|
-
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); }
|
|
18
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
19
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
21
|
-
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); }
|
|
22
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } /*
|
|
7
|
+
var _hooks = require("./hooks");
|
|
8
|
+
/*
|
|
23
9
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
10
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
25
11
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
26
12
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
27
13
|
* Side Public License, v 1.
|
|
28
14
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return _createClass(EuiWindowEvent, [{
|
|
36
|
-
key: "componentDidMount",
|
|
37
|
-
value: function componentDidMount() {
|
|
38
|
-
this.addEvent(this.props);
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
key: "componentDidUpdate",
|
|
42
|
-
value: function componentDidUpdate(prevProps) {
|
|
43
|
-
if (prevProps.event !== this.props.event || prevProps.handler !== this.props.handler) {
|
|
44
|
-
this.removeEvent(prevProps);
|
|
45
|
-
this.addEvent(this.props);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "componentWillUnmount",
|
|
50
|
-
value: function componentWillUnmount() {
|
|
51
|
-
this.removeEvent(this.props);
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "addEvent",
|
|
55
|
-
value: function addEvent(_ref) {
|
|
56
|
-
var event = _ref.event,
|
|
57
|
-
handler = _ref.handler;
|
|
58
|
-
window.addEventListener(event, handler);
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "removeEvent",
|
|
62
|
-
value: function removeEvent(_ref2) {
|
|
63
|
-
var event = _ref2.event,
|
|
64
|
-
handler = _ref2.handler;
|
|
65
|
-
window.removeEventListener(event, handler);
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
key: "render",
|
|
69
|
-
value: function render() {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
}]);
|
|
73
|
-
}(_react.Component);
|
|
74
|
-
EuiWindowEvent.propTypes = {
|
|
75
|
-
event: _propTypes.default.any.isRequired,
|
|
76
|
-
handler: _propTypes.default.func.isRequired
|
|
15
|
+
|
|
16
|
+
var EuiWindowEvent = exports.EuiWindowEvent = function EuiWindowEvent(_ref) {
|
|
17
|
+
var event = _ref.event,
|
|
18
|
+
handler = _ref.handler;
|
|
19
|
+
(0, _hooks.useEuiWindowEvent)(event, handler);
|
|
20
|
+
return null;
|
|
77
21
|
};
|
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
-
import { euiCanAnimate, euiPaddingSize, logicalCSS, logicals } from '../../../global_styling';
|
|
10
|
+
import { euiCanAnimate, euiPaddingSize, highContrastModeStyles, logicalCSS, logicals, preventForcedColors } from '../../../global_styling';
|
|
11
11
|
export var euiCheckableCardStyles = function euiCheckableCardStyles(euiThemeContext) {
|
|
12
12
|
var euiTheme = euiThemeContext.euiTheme;
|
|
13
13
|
var padding = euiPaddingSize(euiThemeContext, 'm');
|
|
14
14
|
return {
|
|
15
|
-
euiCheckableCard: /*#__PURE__*/css(euiCanAnimate, "{transition:border-color ", euiTheme.animation.normal, " ease-in;};label:euiCheckableCard;"),
|
|
16
|
-
isChecked: /*#__PURE__*/css(
|
|
15
|
+
euiCheckableCard: /*#__PURE__*/css(euiCanAnimate, "{&::after{transition:border-color ", euiTheme.animation.normal, " ease-in;}};label:euiCheckableCard;"),
|
|
16
|
+
isChecked: /*#__PURE__*/css(highContrastModeStyles(euiThemeContext, {
|
|
17
|
+
none: "\n &::after {\n border-color: ".concat(euiTheme.colors.primary, ";\n }\n "),
|
|
18
|
+
preferred: "\n border-color: ".concat(euiTheme.colors.primary, ";\n "),
|
|
19
|
+
forced: "\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n border: ".concat(euiTheme.border.width.thick, " solid ").concat(euiTheme.colors.primary, ";\n border-radius: inherit;\n pointer-events: none;\n\n ").concat(preventForcedColors(euiThemeContext), "\n }\n ")
|
|
20
|
+
}), ";;label:isChecked;"),
|
|
17
21
|
label: {
|
|
18
22
|
euiCheckableCard__label: /*#__PURE__*/css("cursor:pointer;display:block;", logicals.width, ":calc(100% + (", padding, " * 2));padding:", padding, ";margin:-", padding, ";;label:euiCheckableCard__label;"),
|
|
19
23
|
isDisabled: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";cursor:not-allowed;;label:isDisabled;")
|
|
@@ -33,7 +33,7 @@ export var EuiFormControlButton = function EuiFormControlButton(_ref) {
|
|
|
33
33
|
_isInvalid = _ref.isInvalid,
|
|
34
34
|
_ref$fullWidth = _ref.fullWidth,
|
|
35
35
|
fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
|
|
36
|
-
|
|
36
|
+
_iconSide = _ref.iconSide,
|
|
37
37
|
_isLoading = _ref.isLoading,
|
|
38
38
|
href = _ref.href,
|
|
39
39
|
rel = _ref.rel,
|
|
@@ -52,18 +52,19 @@ export var EuiFormControlButton = function EuiFormControlButton(_ref) {
|
|
|
52
52
|
var isInvalid = _isInvalid !== null && _isInvalid !== void 0 ? _isInvalid : formLayoutIsInvalid;
|
|
53
53
|
var isLoading = formLayoutIsLoading === true ? false : _isLoading;
|
|
54
54
|
var compressed = _compressed !== null && _compressed !== void 0 ? _compressed : formLayoutCompressed;
|
|
55
|
+
var hasText = value || placeholder;
|
|
56
|
+
var iconSide = isLoading ? 'right' : _iconSide;
|
|
55
57
|
var styles = useEuiMemoizedStyles(euiFormControlButtonStyles);
|
|
56
58
|
var classes = classNames('euiFormControlButton', className);
|
|
57
59
|
var cssStyles = [styles.euiFormControlButton, isInvalid && styles.isInvalid, isLoading && styles.isLoading, formLayoutReadOnly && styles.readOnly, compressed && styles.compressed, fullWidth ? styles.fullWidth : styles.formWidth];
|
|
58
60
|
var contentProps = _objectSpread(_objectSpread({}, _contentProps), {}, {
|
|
59
|
-
css: [styles.euiFormControlButton__content, _contentProps === null || _contentProps === void 0 ? void 0 : _contentProps.css]
|
|
61
|
+
css: [styles.euiFormControlButton__content, !hasText && iconSide === 'right' && styles.alignEnd, _contentProps === null || _contentProps === void 0 ? void 0 : _contentProps.css]
|
|
60
62
|
});
|
|
61
63
|
var customTextProps = _objectSpread(_objectSpread({}, _textProps), {}, {
|
|
62
64
|
className: classNames('eui-textTruncate', _textProps && (_textProps === null || _textProps === void 0 ? void 0 : _textProps.className)),
|
|
63
65
|
css: [styles.textContent, !value && styles.placeholder, _textProps && (_textProps === null || _textProps === void 0 ? void 0 : _textProps.css)]
|
|
64
66
|
});
|
|
65
67
|
var content = children ? /*#__PURE__*/isValidElement(children) ? children : ___EmotionJSX("span", null, children) : null;
|
|
66
|
-
var hasText = value || placeholder;
|
|
67
68
|
var linkProps = _objectSpread({
|
|
68
69
|
href: href,
|
|
69
70
|
rel: rel
|
|
@@ -18,6 +18,14 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
18
18
|
styles: "flex:1;text-align:start;label:textContent;",
|
|
19
19
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
20
|
};
|
|
21
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
22
|
+
name: "dfpczd-alignEnd",
|
|
23
|
+
styles: "justify-content:flex-end;label:alignEnd;"
|
|
24
|
+
} : {
|
|
25
|
+
name: "dfpczd-alignEnd",
|
|
26
|
+
styles: "justify-content:flex-end;label:alignEnd;",
|
|
27
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
|
+
};
|
|
21
29
|
export var euiFormControlButtonStyles = function euiFormControlButtonStyles(euiThemeContext) {
|
|
22
30
|
var euiTheme = euiThemeContext.euiTheme;
|
|
23
31
|
var form = euiFormVariables(euiThemeContext);
|
|
@@ -31,6 +39,7 @@ export var euiFormControlButtonStyles = function euiFormControlButtonStyles(euiT
|
|
|
31
39
|
formWidth: formStyles.formWidth,
|
|
32
40
|
fullWidth: /*#__PURE__*/css(formStyles.fullWidth, ";label:fullWidth;"),
|
|
33
41
|
euiFormControlButton__content: /*#__PURE__*/css("justify-content:flex-start;", logicalCSS('width', '100%'), ";;label:euiFormControlButton__content;"),
|
|
42
|
+
alignEnd: _ref2,
|
|
34
43
|
textContent: _ref,
|
|
35
44
|
placeholder: /*#__PURE__*/css(euiFormPlaceholderStyles(euiThemeContext), ";;label:placeholder;")
|
|
36
45
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { htmlIdGenerator } from '../../../services';
|
|
16
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
|
+
var EuiIconAddToDashboard = function EuiIconAddToDashboard(_ref) {
|
|
18
|
+
var title = _ref.title,
|
|
19
|
+
titleId = _ref.titleId,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var generateId = htmlIdGenerator('add_to_dashboard');
|
|
22
|
+
return ___EmotionJSX("svg", _extends({
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
width: 16,
|
|
25
|
+
height: 16,
|
|
26
|
+
viewBox: "0 0 16 16",
|
|
27
|
+
"aria-labelledby": titleId
|
|
28
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
29
|
+
id: titleId
|
|
30
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
31
|
+
d: "m8.5 9.207 3.854-3.853-.708-.708L8.5 7.793l-2-2-3.854 3.853.708.708L6.5 7.207zM14 13h2v1h-2v2h-1v-2h-2v-1h2v-2h1z"
|
|
32
|
+
}), ___EmotionJSX("mask", {
|
|
33
|
+
id: generateId('a'),
|
|
34
|
+
width: 13,
|
|
35
|
+
height: 13,
|
|
36
|
+
x: 1,
|
|
37
|
+
y: 1,
|
|
38
|
+
maskUnits: "userSpaceOnUse",
|
|
39
|
+
style: {
|
|
40
|
+
maskType: 'alpha'
|
|
41
|
+
}
|
|
42
|
+
}, ___EmotionJSX("path", {
|
|
43
|
+
fillRule: "evenodd",
|
|
44
|
+
d: "M13.072 1c.464 0 .928.542.928 1.083v10.834c0 .541-.464 1.083-.929 1.083H1.931C1.464 14 1 13.567 1 12.917V2.083C1 1.542 1.467 1 1.93 1zM1.93 12.917h11.14V2.083H1.932z"
|
|
45
|
+
})), ___EmotionJSX("g", {
|
|
46
|
+
mask: "url(#".concat(generateId('a'), ")")
|
|
47
|
+
}, ___EmotionJSX("path", {
|
|
48
|
+
d: "M1-.083h13.464V9H9v5H1z"
|
|
49
|
+
})));
|
|
50
|
+
};
|
|
51
|
+
export var icon = EuiIconAddToDashboard;
|
|
@@ -13,6 +13,9 @@ export var typeToPathMap = {
|
|
|
13
13
|
addDataApp: function addDataApp() {
|
|
14
14
|
return import('./assets/app_add_data');
|
|
15
15
|
},
|
|
16
|
+
addToDashboard: function addToDashboard() {
|
|
17
|
+
return import('./assets/add_to_dashboard');
|
|
18
|
+
},
|
|
16
19
|
advancedSettingsApp: function advancedSettingsApp() {
|
|
17
20
|
return import('./assets/app_advanced_settings');
|
|
18
21
|
},
|
|
@@ -9,13 +9,33 @@
|
|
|
9
9
|
import visit from 'unist-util-visit';
|
|
10
10
|
export var DEFAULT_OPTIONS = {
|
|
11
11
|
allowRelative: true,
|
|
12
|
+
allowDocumentRelative: false,
|
|
12
13
|
allowProtocols: ['https:', 'http:', 'mailto:']
|
|
13
14
|
};
|
|
14
|
-
export function euiMarkdownLinkValidator(
|
|
15
|
+
export function euiMarkdownLinkValidator(_ref) {
|
|
16
|
+
var _ref$allowRelative = _ref.allowRelative,
|
|
17
|
+
allowRelative = _ref$allowRelative === void 0 ? DEFAULT_OPTIONS.allowRelative : _ref$allowRelative,
|
|
18
|
+
_ref$allowDocumentRel = _ref.allowDocumentRelative,
|
|
19
|
+
allowDocumentRelative = _ref$allowDocumentRel === void 0 ? DEFAULT_OPTIONS.allowDocumentRelative : _ref$allowDocumentRel,
|
|
20
|
+
_ref$allowProtocols = _ref.allowProtocols,
|
|
21
|
+
allowProtocols = _ref$allowProtocols === void 0 ? DEFAULT_OPTIONS.allowProtocols : _ref$allowProtocols,
|
|
22
|
+
baseUrl = _ref.baseUrl;
|
|
15
23
|
return function (ast) {
|
|
16
24
|
visit(ast, 'link', function (_node) {
|
|
17
25
|
var node = _node;
|
|
18
|
-
if (
|
|
26
|
+
if (allowRelative && allowDocumentRelative && (
|
|
27
|
+
// Prevent throwing in non-browser environments if baseUrl isn't configured
|
|
28
|
+
typeof window !== 'undefined' || baseUrl) && node.url && isDocumentRelativeUrl(node.url)) {
|
|
29
|
+
var newUrl = resolveDocumentRelativeUrl(node.url, baseUrl !== null && baseUrl !== void 0 ? baseUrl : window.location.href);
|
|
30
|
+
if (newUrl) {
|
|
31
|
+
node.url = newUrl;
|
|
32
|
+
} else {
|
|
33
|
+
mutateLinkToText(node);
|
|
34
|
+
}
|
|
35
|
+
} else if (!validateUrl(node.url, {
|
|
36
|
+
allowRelative: allowRelative,
|
|
37
|
+
allowProtocols: allowProtocols
|
|
38
|
+
})) {
|
|
19
39
|
mutateLinkToText(node);
|
|
20
40
|
}
|
|
21
41
|
});
|
|
@@ -40,11 +60,11 @@ export function mutateLinkToText(node) {
|
|
|
40
60
|
delete node.url;
|
|
41
61
|
return node;
|
|
42
62
|
}
|
|
43
|
-
export function validateUrl(url,
|
|
44
|
-
var
|
|
45
|
-
allowRelative =
|
|
46
|
-
|
|
47
|
-
allowProtocols =
|
|
63
|
+
export function validateUrl(url, _ref2) {
|
|
64
|
+
var _ref2$allowRelative = _ref2.allowRelative,
|
|
65
|
+
allowRelative = _ref2$allowRelative === void 0 ? DEFAULT_OPTIONS.allowRelative : _ref2$allowRelative,
|
|
66
|
+
_ref2$allowProtocols = _ref2.allowProtocols,
|
|
67
|
+
allowProtocols = _ref2$allowProtocols === void 0 ? DEFAULT_OPTIONS.allowProtocols : _ref2$allowProtocols;
|
|
48
68
|
// relative captures both relative paths `/` and protocols `//`
|
|
49
69
|
var isRelative = url.startsWith('/');
|
|
50
70
|
if (isRelative) {
|
|
@@ -57,4 +77,38 @@ export function validateUrl(url, _ref) {
|
|
|
57
77
|
// failed to parse input as url
|
|
58
78
|
return false;
|
|
59
79
|
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Tests whether a URL is a document relative URL (e.g. "discover", "dashboards#/view/123")
|
|
84
|
+
* that has no scheme, no leading slash, and is not an anchor or query-only link.
|
|
85
|
+
*/
|
|
86
|
+
export function isDocumentRelativeUrl(url) {
|
|
87
|
+
if (url.startsWith('/') || url.startsWith('#') || url.startsWith('?')) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
// Return false if the url starts with a protocol/scheme. Catches http:, https:, mailto:, etc.
|
|
91
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(url)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Resolves a document relative URL against a base URL. This mostly replicates
|
|
99
|
+
* native browser resolution of e.g. `<a href="discover">`, except that
|
|
100
|
+
* trailing slashes are always removed to ensure consistent resolution,
|
|
101
|
+
* regardless of whether the current page URL ends with a trailing slash or not.
|
|
102
|
+
* Without this, "baz" on "/foo/bar/" resolves to "/foo/bar/baz" instead of the
|
|
103
|
+
* expected "/foo/baz".
|
|
104
|
+
*/
|
|
105
|
+
function resolveDocumentRelativeUrl(url, baseUrl) {
|
|
106
|
+
var normalizedBase = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
|
|
107
|
+
try {
|
|
108
|
+
var resolved = new URL(url, normalizedBase);
|
|
109
|
+
return "".concat(resolved.pathname).concat(resolved.search).concat(resolved.hash);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
// failed to parse URL
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
60
114
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
3
|
var _excluded = ["button"];
|
|
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 _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
4
|
/*
|
|
13
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,7 +9,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
17
9
|
* Side Public License, v 1.
|
|
18
10
|
*/
|
|
19
11
|
|
|
20
|
-
import React, {
|
|
12
|
+
import React, { useCallback, useLayoutEffect, useRef } from 'react';
|
|
21
13
|
import { EuiPopover } from './popover';
|
|
22
14
|
import { EuiPortal } from '../portal';
|
|
23
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -26,51 +18,34 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
26
18
|
* then the button element is moved into the popover dom.
|
|
27
19
|
* On unmount, the button is moved back to its original location.
|
|
28
20
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
_inherits(EuiWrappingPopover, _Component);
|
|
47
|
-
return _createClass(EuiWrappingPopover, [{
|
|
48
|
-
key: "componentWillUnmount",
|
|
49
|
-
value: function componentWillUnmount() {
|
|
50
|
-
if (this.props.button.parentNode) {
|
|
51
|
-
if (this.portal) {
|
|
52
|
-
this.portal.insertAdjacentElement('beforebegin', this.props.button);
|
|
53
|
-
}
|
|
21
|
+
|
|
22
|
+
export function EuiWrappingPopover(props) {
|
|
23
|
+
var button = props.button,
|
|
24
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
25
|
+
var portalRef = useRef(null);
|
|
26
|
+
var setPortalRef = useCallback(function (node) {
|
|
27
|
+
portalRef.current = node;
|
|
28
|
+
}, []);
|
|
29
|
+
var setAnchorRef = useCallback(function (node) {
|
|
30
|
+
node === null || node === void 0 || node.insertAdjacentElement('beforebegin', button);
|
|
31
|
+
}, [button]);
|
|
32
|
+
useLayoutEffect(function () {
|
|
33
|
+
return function () {
|
|
34
|
+
if (button.parentNode && portalRef.current) {
|
|
35
|
+
portalRef.current.insertAdjacentElement('beforebegin', button);
|
|
54
36
|
}
|
|
37
|
+
};
|
|
38
|
+
}, [button]);
|
|
39
|
+
return ___EmotionJSX(EuiPortal, {
|
|
40
|
+
portalRef: setPortalRef,
|
|
41
|
+
insert: {
|
|
42
|
+
sibling: button,
|
|
43
|
+
position: 'after'
|
|
55
44
|
}
|
|
56
|
-
}, {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
portalRef: this.setPortalRef,
|
|
64
|
-
insert: {
|
|
65
|
-
sibling: this.props.button,
|
|
66
|
-
position: 'after'
|
|
67
|
-
}
|
|
68
|
-
}, ___EmotionJSX(EuiPopover, _extends({}, rest, {
|
|
69
|
-
button: ___EmotionJSX("div", {
|
|
70
|
-
ref: this.setAnchorRef,
|
|
71
|
-
className: "euiWrappingPopover__anchor"
|
|
72
|
-
})
|
|
73
|
-
})));
|
|
74
|
-
}
|
|
75
|
-
}]);
|
|
76
|
-
}(Component);
|
|
45
|
+
}, ___EmotionJSX(EuiPopover, _extends({}, rest, {
|
|
46
|
+
button: ___EmotionJSX("div", {
|
|
47
|
+
ref: setAnchorRef,
|
|
48
|
+
className: "euiWrappingPopover__anchor"
|
|
49
|
+
})
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
1
|
/*
|
|
9
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -13,65 +6,49 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
13
6
|
* Side Public License, v 1.
|
|
14
7
|
*/
|
|
15
8
|
|
|
16
|
-
import React
|
|
9
|
+
import React from 'react';
|
|
17
10
|
import { EuiFilterButton } from '../../filter_group';
|
|
18
11
|
import { isNil } from '../../../services/predicate';
|
|
19
12
|
import { Query } from '../query';
|
|
20
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
|
-
export var IsFilter =
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
value: function resolveDisplay(clause) {
|
|
30
|
-
var _this$props$config = this.props.config,
|
|
31
|
-
name = _this$props$config.name,
|
|
32
|
-
negatedName = _this$props$config.negatedName;
|
|
33
|
-
if (isNil(clause)) {
|
|
34
|
-
return {
|
|
35
|
-
hasActiveFilters: false,
|
|
36
|
-
name: name
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return Query.isMust(clause) ? {
|
|
40
|
-
hasActiveFilters: true,
|
|
14
|
+
export var IsFilter = function IsFilter(props) {
|
|
15
|
+
var resolveDisplay = function resolveDisplay(clause) {
|
|
16
|
+
var _props$config = props.config,
|
|
17
|
+
name = _props$config.name,
|
|
18
|
+
negatedName = _props$config.negatedName;
|
|
19
|
+
if (isNil(clause)) {
|
|
20
|
+
return {
|
|
21
|
+
hasActiveFilters: false,
|
|
41
22
|
name: name
|
|
42
|
-
} : {
|
|
43
|
-
hasActiveFilters: true,
|
|
44
|
-
name: negatedName ? negatedName : "Not ".concat(name)
|
|
45
23
|
};
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}(Component);
|
|
25
|
+
return Query.isMust(clause) ? {
|
|
26
|
+
hasActiveFilters: true,
|
|
27
|
+
name: name
|
|
28
|
+
} : {
|
|
29
|
+
hasActiveFilters: true,
|
|
30
|
+
name: negatedName ? negatedName : "Not ".concat(name)
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var valueChanged = function valueChanged(field, checked) {
|
|
34
|
+
var query = checked ? props.query.removeIsClause(field) : props.query.addMustIsClause(field);
|
|
35
|
+
props.onChange(query);
|
|
36
|
+
};
|
|
37
|
+
var query = props.query,
|
|
38
|
+
config = props.config;
|
|
39
|
+
var clause = query.getIsClause(config.field);
|
|
40
|
+
var checked = !isNil(clause);
|
|
41
|
+
var _resolveDisplay = resolveDisplay(clause),
|
|
42
|
+
hasActiveFilters = _resolveDisplay.hasActiveFilters,
|
|
43
|
+
name = _resolveDisplay.name;
|
|
44
|
+
var onClick = function onClick() {
|
|
45
|
+
valueChanged(config.field, checked);
|
|
46
|
+
};
|
|
47
|
+
return ___EmotionJSX(EuiFilterButton, {
|
|
48
|
+
onClick: onClick,
|
|
49
|
+
isSelected: hasActiveFilters,
|
|
50
|
+
hasActiveFilters: hasActiveFilters,
|
|
51
|
+
"aria-pressed": !!hasActiveFilters,
|
|
52
|
+
isToggle: true
|
|
53
|
+
}, name);
|
|
54
|
+
};
|
|
@@ -477,16 +477,6 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
477
477
|
var resultsLength = visibleOptions.filter(function (option) {
|
|
478
478
|
return !option.disabled;
|
|
479
479
|
}).length;
|
|
480
|
-
var listScreenReaderStatus = searchable && ___EmotionJSX(EuiI18n, {
|
|
481
|
-
token: "euiSelectable.searchResults",
|
|
482
|
-
default: function _default(_ref6) {
|
|
483
|
-
var resultsLength = _ref6.resultsLength;
|
|
484
|
-
return "".concat(resultsLength, " result").concat(resultsLength === 1 ? '' : 's', " available");
|
|
485
|
-
},
|
|
486
|
-
values: {
|
|
487
|
-
resultsLength: resultsLength
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
480
|
var listAriaDescribedbyId = this.rootId('instructions');
|
|
491
481
|
var listAccessibleName = getAccessibleName(listProps, listAriaDescribedbyId);
|
|
492
482
|
var listHasAccessibleName = Boolean(Object.keys(listAccessibleName).length);
|
|
@@ -494,9 +484,20 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
494
484
|
token: "euiSelectable.placeholderName",
|
|
495
485
|
default: "Filter options"
|
|
496
486
|
}, function (placeholderName) {
|
|
497
|
-
return ___EmotionJSX(React.Fragment, null, searchable && ___EmotionJSX(
|
|
498
|
-
|
|
499
|
-
|
|
487
|
+
return ___EmotionJSX(React.Fragment, null, searchable && ___EmotionJSX(EuiI18n, {
|
|
488
|
+
token: "euiSelectable.searchResults",
|
|
489
|
+
default: function _default(_ref6) {
|
|
490
|
+
var resultsLength = _ref6.resultsLength;
|
|
491
|
+
return "".concat(resultsLength, " result").concat(resultsLength === 1 ? '' : 's', " available");
|
|
492
|
+
},
|
|
493
|
+
values: {
|
|
494
|
+
resultsLength: resultsLength
|
|
495
|
+
}
|
|
496
|
+
}, function (searchResults) {
|
|
497
|
+
return ___EmotionJSX(EuiScreenReaderLive, {
|
|
498
|
+
isActive: messageContent != null || activeOptionIndex != null
|
|
499
|
+
}, messageContent || searchResults);
|
|
500
|
+
}), messageContent ? ___EmotionJSX(EuiSelectableMessage, {
|
|
500
501
|
"data-test-subj": "euiSelectableMessage",
|
|
501
502
|
id: _this2.messageContentId,
|
|
502
503
|
bordered: listProps && listProps.bordered
|
|
@@ -32,5 +32,5 @@ export { slugify, toInitials, toSentenceCase } from './string';
|
|
|
32
32
|
export * from './theme';
|
|
33
33
|
export { throttle } from './throttle';
|
|
34
34
|
export { getDurationAndPerformOnFrame, getTransitionTimings, getWaitDuration, performOnFrame } from './transition';
|
|
35
|
-
export { EuiWindowEvent } from './window_event';
|
|
35
|
+
export { EuiWindowEvent, useEuiWindowEvent } from './window_event';
|
|
36
36
|
export { keys };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
10
|
+
export var useEuiWindowEvent = function useEuiWindowEvent(event, handler) {
|
|
11
|
+
var handlerRef = useRef(handler);
|
|
12
|
+
handlerRef.current = handler;
|
|
13
|
+
var stableHandler = useCallback(function (ev) {
|
|
14
|
+
return handlerRef.current.call(this, ev);
|
|
15
|
+
}, []);
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
window.addEventListener(event, stableHandler);
|
|
18
|
+
return function () {
|
|
19
|
+
return window.removeEventListener(event, stableHandler);
|
|
20
|
+
};
|
|
21
|
+
}, [event, stableHandler]);
|
|
22
|
+
return null;
|
|
23
|
+
};
|