@elastic/eui 76.1.0 → 76.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +33 -6
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +33 -6
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/skip_link/skip_link.js +15 -4
- 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 +1 -1
- package/es/components/basic_table/collapsed_item_actions.js +1 -1
- package/es/components/basic_table/in_memory_table.js +1 -1
- package/es/components/button/_button_content_deprecated.js +1 -1
- package/es/components/button/button_display/_button_display.js +1 -1
- 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_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group_button.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/code/code_block_full_screen.js +2 -0
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- 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/datagrid/body/data_grid_body.js +32 -408
- package/es/components/datagrid/body/data_grid_body_custom.js +908 -0
- package/es/components/datagrid/body/data_grid_body_virtualized.js +1031 -0
- package/es/components/datagrid/body/data_grid_cell.js +34 -33
- package/es/components/datagrid/body/data_grid_cell_wrapper.js +132 -0
- package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/es/components/datagrid/body/header/data_grid_header_row.js +16 -15
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +34 -18
- package/es/components/datagrid/data_grid_types.js +18 -1
- package/es/components/datagrid/utils/in_memory.js +12 -12
- package/es/components/datagrid/utils/row_heights.js +111 -31
- 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/facet/facet_button.js +1 -1
- package/es/components/flyout/flyout.js +1 -0
- package/es/components/form/field_number/field_number.js +1 -1
- package/es/components/form/field_text/field_text.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/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.js +1 -1
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +2 -0
- package/es/components/image/image_fullscreen_wrapper.js +2 -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/notification/notification_event.js +2 -2
- package/es/components/notification/notification_event_meta.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/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/suggest/suggest.js +1 -1
- package/es/components/suggest/suggest_item.js +1 -1
- package/es/components/table/table_header_button.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/eui.d.ts +236 -139
- package/i18ntokens.json +8 -8
- package/lib/components/accessibility/skip_link/skip_link.js +15 -4
- 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 +1 -1
- package/lib/components/basic_table/collapsed_item_actions.js +1 -1
- package/lib/components/basic_table/in_memory_table.js +1 -1
- package/lib/components/button/_button_content_deprecated.js +1 -1
- package/lib/components/button/button_display/_button_display.js +1 -1
- 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_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group_button.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/code/code_block_full_screen.js +2 -0
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- 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/datagrid/body/data_grid_body.js +32 -429
- package/lib/components/datagrid/body/data_grid_body_custom.js +927 -0
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +1059 -0
- package/lib/components/datagrid/body/data_grid_cell.js +34 -33
- package/lib/components/datagrid/body/data_grid_cell_wrapper.js +147 -0
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/lib/components/datagrid/body/header/data_grid_header_row.js +17 -15
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +34 -17
- package/lib/components/datagrid/data_grid_types.js +22 -1
- package/lib/components/datagrid/utils/in_memory.js +12 -12
- package/lib/components/datagrid/utils/row_heights.js +116 -33
- 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/facet/facet_button.js +1 -1
- package/lib/components/flyout/flyout.js +1 -0
- package/lib/components/form/field_number/field_number.js +1 -1
- package/lib/components/form/field_text/field_text.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/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.js +1 -1
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +2 -0
- package/lib/components/image/image_fullscreen_wrapper.js +2 -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/notification/notification_event.js +2 -2
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- 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/suggest/suggest.js +1 -1
- package/lib/components/suggest/suggest_item.js +1 -1
- package/lib/components/table/table_header_button.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/optimize/es/components/accessibility/skip_link/skip_link.js +8 -1
- package/optimize/es/components/code/code_block_full_screen.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_body.js +17 -387
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +176 -0
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +311 -0
- package/optimize/es/components/datagrid/body/data_grid_cell.js +8 -7
- package/optimize/es/components/datagrid/body/data_grid_cell_wrapper.js +127 -0
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +3 -2
- package/optimize/es/components/datagrid/data_grid.js +8 -5
- package/optimize/es/components/datagrid/data_grid_types.js +18 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +100 -31
- package/optimize/es/components/flyout/flyout.js +1 -0
- package/optimize/es/components/icon/icon_map.js +2 -0
- package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -0
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +8 -1
- package/optimize/lib/components/code/code_block_full_screen.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_body.js +16 -409
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +198 -0
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +342 -0
- package/optimize/lib/components/datagrid/body/data_grid_cell.js +8 -7
- package/optimize/lib/components/datagrid/body/data_grid_cell_wrapper.js +144 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +4 -2
- package/optimize/lib/components/datagrid/data_grid.js +8 -4
- package/optimize/lib/components/datagrid/data_grid_types.js +22 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +103 -37
- package/optimize/lib/components/flyout/flyout.js +1 -0
- package/optimize/lib/components/icon/icon_map.js +2 -0
- package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -0
- package/package.json +1 -1
- package/src/components/datagrid/_data_grid.scss +7 -0
- package/src/components/datagrid/_data_grid_data_row.scss +1 -0
- package/src/components/datagrid/body/footer/_data_grid_footer_row.scss +1 -0
- package/src/components/datagrid/body/header/_data_grid_header_row.scss +1 -0
- package/src/components/selectable/selectable_list/_selectable_list.scss +10 -3
- package/src/themes/amsterdam/global_styling/mixins/_states.scss +17 -8
- package/test-env/components/accessibility/skip_link/skip_link.js +15 -4
- 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 +1 -1
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
- package/test-env/components/basic_table/in_memory_table.js +1 -1
- package/test-env/components/button/_button_content_deprecated.js +1 -1
- package/test-env/components/button/button_display/_button_display.js +1 -1
- 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_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group_button.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/code/code_block_full_screen.js +2 -0
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- 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/datagrid/body/data_grid_body.js +31 -428
- package/test-env/components/datagrid/body/data_grid_body_custom.js +908 -0
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +1057 -0
- package/test-env/components/datagrid/body/data_grid_cell.js +34 -33
- package/test-env/components/datagrid/body/data_grid_cell_wrapper.js +144 -0
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +17 -15
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +34 -17
- package/test-env/components/datagrid/data_grid_types.js +22 -1
- package/test-env/components/datagrid/utils/in_memory.js +12 -12
- package/test-env/components/datagrid/utils/row_heights.js +103 -37
- 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/facet/facet_button.js +1 -1
- package/test-env/components/form/field_number/field_number.js +1 -1
- package/test-env/components/form/field_text/field_text.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/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.js +1 -1
- package/test-env/components/icon/icon_map.js +2 -0
- package/test-env/components/image/image_fullscreen_wrapper.js +2 -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/notification/notification_event.js +2 -2
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- 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/suggest/suggest.js +1 -1
- package/test-env/components/suggest/suggest_item.js +1 -1
- package/test-env/components/table/table_header_button.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
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
3
|
+
import _get from "@babel/runtime/helpers/get";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
2
7
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
8
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
9
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
11
|
|
|
12
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
|
|
14
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
+
|
|
7
16
|
/*
|
|
8
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
18
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -24,16 +33,11 @@ export var cellPaddingsMap = {
|
|
|
24
33
|
export var AUTO_HEIGHT = 'auto';
|
|
25
34
|
export var DEFAULT_ROW_HEIGHT = 34;
|
|
26
35
|
export var RowHeightUtils = /*#__PURE__*/function () {
|
|
27
|
-
function RowHeightUtils(
|
|
36
|
+
function RowHeightUtils() {
|
|
28
37
|
var _this = this;
|
|
29
38
|
|
|
30
39
|
_classCallCheck(this, RowHeightUtils);
|
|
31
40
|
|
|
32
|
-
this.gridRef = gridRef;
|
|
33
|
-
this.outerGridElementRef = outerGridElementRef;
|
|
34
|
-
this.gridItemsRenderedRef = gridItemsRenderedRef;
|
|
35
|
-
this.rerenderGridBodyRef = rerenderGridBodyRef;
|
|
36
|
-
|
|
37
41
|
_defineProperty(this, "styles", {
|
|
38
42
|
paddingTop: 0,
|
|
39
43
|
paddingBottom: 0
|
|
@@ -65,10 +69,6 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
65
69
|
});
|
|
66
70
|
|
|
67
71
|
_defineProperty(this, "heightsCache", new Map());
|
|
68
|
-
|
|
69
|
-
_defineProperty(this, "timerId", void 0);
|
|
70
|
-
|
|
71
|
-
_defineProperty(this, "lastUpdatedRow", Infinity);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
_createClass(RowHeightUtils, [{
|
|
@@ -154,6 +154,11 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
154
154
|
|
|
155
155
|
return false;
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Heights cache utils
|
|
159
|
+
* This cache is primarily used by auto heights & secondarily used by lineCount row overrides
|
|
160
|
+
*/
|
|
161
|
+
|
|
157
162
|
}, {
|
|
158
163
|
key: "getRowHeight",
|
|
159
164
|
value: function getRowHeight(rowIndex) {
|
|
@@ -166,23 +171,20 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
166
171
|
}, {
|
|
167
172
|
key: "setRowHeight",
|
|
168
173
|
value: function setRowHeight(rowIndex, colId) {
|
|
169
|
-
var _this$rerenderGridBod, _this$rerenderGridBod2;
|
|
170
|
-
|
|
171
174
|
var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_ROW_HEIGHT;
|
|
172
|
-
|
|
175
|
+
|
|
176
|
+
var _visibleRowIndex = arguments.length > 3 ? arguments[3] : undefined;
|
|
177
|
+
|
|
173
178
|
var rowHeights = this.heightsCache.get(rowIndex) || new Map();
|
|
174
179
|
var adaptedHeight = Math.ceil(height + this.styles.paddingTop + this.styles.paddingBottom);
|
|
175
180
|
|
|
176
181
|
if (rowHeights.get(colId) === adaptedHeight) {
|
|
177
|
-
return;
|
|
182
|
+
return false;
|
|
183
|
+
} else {
|
|
184
|
+
rowHeights.set(colId, adaptedHeight);
|
|
185
|
+
this.heightsCache.set(rowIndex, rowHeights);
|
|
186
|
+
return true;
|
|
178
187
|
}
|
|
179
|
-
|
|
180
|
-
rowHeights.set(colId, adaptedHeight);
|
|
181
|
-
this.heightsCache.set(rowIndex, rowHeights);
|
|
182
|
-
this.resetRow(visibleRowIndex); // When an auto row height is updated, force a re-render
|
|
183
|
-
// of the grid body to update the unconstrained height
|
|
184
|
-
|
|
185
|
-
(_this$rerenderGridBod = (_this$rerenderGridBod2 = this.rerenderGridBodyRef).current) === null || _this$rerenderGridBod === void 0 ? void 0 : _this$rerenderGridBod.call(_this$rerenderGridBod2);
|
|
186
188
|
}
|
|
187
189
|
}, {
|
|
188
190
|
key: "pruneHiddenColumnHeights",
|
|
@@ -201,22 +203,84 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
201
203
|
}
|
|
202
204
|
});
|
|
203
205
|
});
|
|
206
|
+
return didModify;
|
|
207
|
+
}
|
|
208
|
+
}]);
|
|
209
|
+
|
|
210
|
+
return RowHeightUtils;
|
|
211
|
+
}();
|
|
212
|
+
/**
|
|
213
|
+
* Row height utils with virtualization library-specific APIs
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
export var RowHeightVirtualizationUtils = /*#__PURE__*/function (_RowHeightUtils) {
|
|
217
|
+
_inherits(RowHeightVirtualizationUtils, _RowHeightUtils);
|
|
218
|
+
|
|
219
|
+
var _super = _createSuper(RowHeightVirtualizationUtils);
|
|
220
|
+
|
|
221
|
+
function RowHeightVirtualizationUtils(gridRef, outerGridElementRef, gridItemsRenderedRef, rerenderGridBodyRef) {
|
|
222
|
+
var _this2;
|
|
223
|
+
|
|
224
|
+
_classCallCheck(this, RowHeightVirtualizationUtils);
|
|
225
|
+
|
|
226
|
+
_this2 = _super.call(this);
|
|
227
|
+
_this2.gridRef = gridRef;
|
|
228
|
+
_this2.outerGridElementRef = outerGridElementRef;
|
|
229
|
+
_this2.gridItemsRenderedRef = gridItemsRenderedRef;
|
|
230
|
+
_this2.rerenderGridBodyRef = rerenderGridBodyRef;
|
|
231
|
+
|
|
232
|
+
_defineProperty(_assertThisInitialized(_this2), "timerId", void 0);
|
|
233
|
+
|
|
234
|
+
_defineProperty(_assertThisInitialized(_this2), "lastUpdatedRow", Infinity);
|
|
235
|
+
|
|
236
|
+
return _this2;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Virtualization workarounds for auto height rows
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
_createClass(RowHeightVirtualizationUtils, [{
|
|
244
|
+
key: "setRowHeight",
|
|
245
|
+
value: function setRowHeight(rowIndex, colId) {
|
|
246
|
+
var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_ROW_HEIGHT;
|
|
247
|
+
var visibleRowIndex = arguments.length > 3 ? arguments[3] : undefined;
|
|
248
|
+
|
|
249
|
+
var didModify = _get(_getPrototypeOf(RowHeightVirtualizationUtils.prototype), "setRowHeight", this).call(this, rowIndex, colId, height, visibleRowIndex); // When an auto row height is updated, force a re-render
|
|
250
|
+
// of the grid body to update the unconstrained height
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
if (didModify) {
|
|
254
|
+
var _this$rerenderGridBod, _this$rerenderGridBod2;
|
|
255
|
+
|
|
256
|
+
(_this$rerenderGridBod = (_this$rerenderGridBod2 = this.rerenderGridBodyRef).current) === null || _this$rerenderGridBod === void 0 ? void 0 : _this$rerenderGridBod.call(_this$rerenderGridBod2);
|
|
257
|
+
this.resetRow(visibleRowIndex);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return didModify; // Mostly just here for typing
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "pruneHiddenColumnHeights",
|
|
264
|
+
value: function pruneHiddenColumnHeights(visibleColumns) {
|
|
265
|
+
var didModify = _get(_getPrototypeOf(RowHeightVirtualizationUtils.prototype), "pruneHiddenColumnHeights", this).call(this, visibleColumns);
|
|
204
266
|
|
|
205
267
|
if (didModify) {
|
|
206
268
|
this.resetRow(0);
|
|
207
269
|
}
|
|
270
|
+
|
|
271
|
+
return didModify; // Mostly just here for typing
|
|
208
272
|
}
|
|
209
273
|
}, {
|
|
210
274
|
key: "resetRow",
|
|
211
275
|
value: function resetRow(visibleRowIndex) {
|
|
212
|
-
var
|
|
276
|
+
var _this3 = this;
|
|
213
277
|
|
|
214
278
|
// save the first row index of batch, reassigning it only
|
|
215
279
|
// if this visible row index less than lastUpdatedRow
|
|
216
280
|
this.lastUpdatedRow = Math.min(this.lastUpdatedRow, visibleRowIndex);
|
|
217
281
|
clearTimeout(this.timerId);
|
|
218
282
|
this.timerId = window.setTimeout(function () {
|
|
219
|
-
return
|
|
283
|
+
return _this3.resetGrid();
|
|
220
284
|
}, 0);
|
|
221
285
|
}
|
|
222
286
|
}, {
|
|
@@ -254,24 +318,29 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
254
318
|
}
|
|
255
319
|
}]);
|
|
256
320
|
|
|
257
|
-
return
|
|
258
|
-
}();
|
|
321
|
+
return RowHeightVirtualizationUtils;
|
|
322
|
+
}(RowHeightUtils);
|
|
259
323
|
/**
|
|
260
324
|
* Hook for instantiating RowHeightUtils, setting internal class vars,
|
|
261
325
|
* and setting up various row-height-related side effects
|
|
262
326
|
*/
|
|
263
327
|
|
|
264
328
|
export var useRowHeightUtils = function useRowHeightUtils(_ref2) {
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
gridItemsRenderedRef = _ref2.gridItemsRenderedRef,
|
|
329
|
+
var virtualization = _ref2.virtualization,
|
|
330
|
+
rowHeightsOptions = _ref2.rowHeightsOptions,
|
|
268
331
|
gridStyles = _ref2.gridStyles,
|
|
269
|
-
columns = _ref2.columns
|
|
270
|
-
rowHeightsOptions = _ref2.rowHeightsOptions;
|
|
332
|
+
columns = _ref2.columns;
|
|
271
333
|
var forceRenderRef = useLatest(useForceRender());
|
|
272
334
|
|
|
273
335
|
var _useState = useState(function () {
|
|
274
|
-
|
|
336
|
+
if (virtualization) {
|
|
337
|
+
var _gridRef = virtualization.gridRef,
|
|
338
|
+
_outerGridElementRef = virtualization.outerGridElementRef,
|
|
339
|
+
_gridItemsRenderedRef = virtualization.gridItemsRenderedRef;
|
|
340
|
+
return new RowHeightVirtualizationUtils(_gridRef, _outerGridElementRef, _gridItemsRenderedRef, forceRenderRef);
|
|
341
|
+
} else {
|
|
342
|
+
return new RowHeightUtils();
|
|
343
|
+
}
|
|
275
344
|
}),
|
|
276
345
|
_useState2 = _slicedToArray(_useState, 1),
|
|
277
346
|
rowHeightUtils = _useState2[0]; // Forces a rerender whenever the row heights change, as this can cause the
|
|
@@ -266,6 +266,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
266
266
|
|
|
267
267
|
var flyout = ___EmotionJSX(EuiFocusTrap, _extends({
|
|
268
268
|
disabled: isPushed,
|
|
269
|
+
scrollLock: ownFocus,
|
|
269
270
|
clickOutsideDisables: !ownFocus,
|
|
270
271
|
onClickOutside: onClickOutside
|
|
271
272
|
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
@@ -415,6 +415,8 @@ export var typeToPathMap = {
|
|
|
415
415
|
visVisualBuilder: 'vis_visual_builder',
|
|
416
416
|
visualizeApp: 'app_visualize',
|
|
417
417
|
warning: 'warning',
|
|
418
|
+
alert: 'warning',
|
|
419
|
+
// NOTE: This is an undocumented alias for `warning`, added for legacy compatability with Elastic Charts
|
|
418
420
|
watchesApp: 'app_watches',
|
|
419
421
|
wordWrap: 'wordWrap',
|
|
420
422
|
wordWrapDisabled: 'wordWrapDisabled',
|
|
@@ -58,6 +58,8 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
|
|
|
58
58
|
return ___EmotionJSX(EuiOverlayMask, {
|
|
59
59
|
"data-test-subj": "fullScreenOverlayMask"
|
|
60
60
|
}, ___EmotionJSX(EuiFocusTrap, {
|
|
61
|
+
scrollLock: true,
|
|
62
|
+
preventScrollOnFocus: true,
|
|
61
63
|
onClickOutside: closeFullScreen
|
|
62
64
|
}, ___EmotionJSX(React.Fragment, null, ___EmotionJSX("figure", _extends({
|
|
63
65
|
"aria-label": optionalCaptionText,
|
|
@@ -61,7 +61,14 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
61
61
|
var hasValidId = !!destinationEl; // Check the fallback destination if not
|
|
62
62
|
|
|
63
63
|
if (!destinationEl && fallbackDestination) {
|
|
64
|
-
|
|
64
|
+
if (Array.isArray(fallbackDestination)) {
|
|
65
|
+
for (var i = 0; i < fallbackDestination.length; i++) {
|
|
66
|
+
destinationEl = document.querySelector(fallbackDestination[i]);
|
|
67
|
+
if (destinationEl) break; // Stop once the first fallback has been found
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
destinationEl = document.querySelector(fallbackDestination);
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
@@ -104,6 +104,8 @@ var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrapper(_ref2
|
|
|
104
104
|
var cssStyles = [styles.euiCodeBlock, styles.l, // Force fullscreen to use large font
|
|
105
105
|
styles.isFullScreen];
|
|
106
106
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
107
|
+
scrollLock: true,
|
|
108
|
+
preventScrollOnFocus: true,
|
|
107
109
|
clickOutsideDisables: true
|
|
108
110
|
}, (0, _react2.jsx)("div", {
|
|
109
111
|
className: "euiCodeBlockFullScreen",
|