@elastic/eui 114.2.0 → 115.0.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/basic_table/basic_table.js +3 -6
- package/es/components/basic_table/collapsed_item_actions.js +1 -3
- package/es/components/basic_table/default_item_action.js +0 -1
- package/es/components/basic_table/in_memory_table.js +3 -6
- package/es/components/color_picker/color_picker_swatch.js +1 -2
- package/es/components/datagrid/controls/display_selector.js +1 -2
- package/es/components/datagrid/controls/fullscreen_selector.js +1 -2
- package/es/components/datagrid/controls/keyboard_shortcuts.js +1 -2
- package/es/components/datagrid/utils/scrolling.js +7 -1
- package/es/components/filter_group/filter_select_item.js +36 -17
- package/es/components/flyout/flyout.component.js +8 -7
- package/es/components/flyout/hooks.js +11 -3
- package/es/components/flyout/manager/flyout_main.js +4 -2
- package/es/components/icon/assets/chart_pie.js +1 -2
- package/es/components/icon/assets/product_dashboard.js +5 -3
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -2
- package/es/components/list_group/list_group_item.js +1 -2
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +6 -3
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +14 -10
- package/es/components/portal/portal.js +72 -117
- package/es/components/search_bar/filters/field_value_toggle_group_filter.js +42 -91
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/steps/step_horizontal.js +8 -5
- package/es/components/table/table_header_cell.js +1 -2
- package/es/components/tool_tip/icon_tip.js +4 -8
- package/es/components/tool_tip/tool_tip.js +233 -261
- package/es/components/tool_tip/tool_tip.styles.js +10 -18
- package/es/components/tool_tip/tool_tip_anchor.js +3 -3
- package/es/components/tool_tip/tool_tip_manager.js +1 -0
- package/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/es/test/rtl/component_helpers.d.ts +0 -3
- package/es/test/rtl/component_helpers.js +40 -62
- package/eui.d.ts +29 -98
- package/lib/components/basic_table/basic_table.js +3 -6
- package/lib/components/basic_table/collapsed_item_actions.js +1 -3
- package/lib/components/basic_table/default_item_action.js +0 -1
- package/lib/components/basic_table/in_memory_table.js +3 -6
- package/lib/components/color_picker/color_picker_swatch.js +1 -2
- package/lib/components/datagrid/controls/display_selector.js +1 -2
- package/lib/components/datagrid/controls/fullscreen_selector.js +1 -2
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -2
- package/lib/components/datagrid/utils/scrolling.js +7 -1
- package/lib/components/filter_group/filter_select_item.js +35 -16
- package/lib/components/flyout/flyout.component.js +8 -7
- package/lib/components/flyout/hooks.js +10 -2
- package/lib/components/flyout/manager/flyout_main.js +3 -1
- package/lib/components/icon/assets/chart_pie.js +1 -2
- package/lib/components/icon/assets/product_dashboard.js +5 -3
- package/lib/components/icon/svgs/chart_pie.svg +1 -1
- package/lib/components/icon/svgs/product_dashboard.svg +4 -5
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -2
- package/lib/components/list_group/list_group_item.js +1 -2
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +6 -3
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +12 -10
- package/lib/components/portal/portal.js +73 -118
- package/lib/components/search_bar/filters/field_value_toggle_group_filter.js +44 -93
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/steps/step_horizontal.js +8 -5
- package/lib/components/table/table_header_cell.js +1 -2
- package/lib/components/tool_tip/icon_tip.js +4 -8
- package/lib/components/tool_tip/tool_tip.js +240 -266
- package/lib/components/tool_tip/tool_tip.styles.js +8 -16
- package/lib/components/tool_tip/tool_tip_anchor.js +2 -2
- package/lib/components/tool_tip/tool_tip_manager.js +1 -0
- package/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/lib/test/rtl/component_helpers.d.ts +0 -3
- package/lib/test/rtl/component_helpers.js +41 -63
- package/optimize/es/components/basic_table/collapsed_item_actions.js +1 -3
- package/optimize/es/components/basic_table/default_item_action.js +0 -1
- package/optimize/es/components/datagrid/controls/display_selector.js +1 -2
- package/optimize/es/components/datagrid/controls/fullscreen_selector.js +1 -2
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +1 -2
- package/optimize/es/components/datagrid/utils/scrolling.js +7 -1
- package/optimize/es/components/filter_group/filter_select_item.js +36 -17
- package/optimize/es/components/flyout/flyout.component.js +8 -7
- package/optimize/es/components/flyout/hooks.js +11 -3
- package/optimize/es/components/flyout/manager/flyout_main.js +4 -2
- package/optimize/es/components/icon/assets/chart_pie.js +1 -2
- package/optimize/es/components/icon/assets/product_dashboard.js +5 -3
- package/optimize/es/components/key_pad_menu/key_pad_menu_item.js +1 -2
- package/optimize/es/components/list_group/list_group_item.js +1 -2
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.js +5 -2
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +13 -9
- package/optimize/es/components/portal/portal.js +65 -91
- package/optimize/es/components/search_bar/filters/field_value_toggle_group_filter.js +43 -66
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/es/components/steps/step_horizontal.js +8 -5
- package/optimize/es/components/tool_tip/icon_tip.js +3 -5
- package/optimize/es/components/tool_tip/tool_tip.js +227 -250
- package/optimize/es/components/tool_tip/tool_tip.styles.js +10 -18
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +3 -3
- package/optimize/es/components/tool_tip/tool_tip_manager.js +1 -0
- package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/optimize/es/test/rtl/component_helpers.d.ts +0 -3
- package/optimize/es/test/rtl/component_helpers.js +40 -62
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +1 -3
- package/optimize/lib/components/basic_table/default_item_action.js +0 -1
- package/optimize/lib/components/datagrid/controls/display_selector.js +1 -2
- package/optimize/lib/components/datagrid/controls/fullscreen_selector.js +1 -2
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -2
- package/optimize/lib/components/datagrid/utils/scrolling.js +7 -1
- package/optimize/lib/components/filter_group/filter_select_item.js +35 -16
- package/optimize/lib/components/flyout/flyout.component.js +8 -7
- package/optimize/lib/components/flyout/hooks.js +10 -2
- package/optimize/lib/components/flyout/manager/flyout_main.js +3 -1
- package/optimize/lib/components/icon/assets/chart_pie.js +1 -2
- package/optimize/lib/components/icon/assets/product_dashboard.js +5 -3
- package/optimize/lib/components/icon/svgs/chart_pie.svg +1 -1
- package/optimize/lib/components/icon/svgs/product_dashboard.svg +4 -5
- package/optimize/lib/components/key_pad_menu/key_pad_menu_item.js +1 -2
- package/optimize/lib/components/list_group/list_group_item.js +1 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.js +5 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +13 -9
- package/optimize/lib/components/portal/portal.js +68 -93
- package/optimize/lib/components/search_bar/filters/field_value_toggle_group_filter.js +45 -69
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/lib/components/steps/step_horizontal.js +8 -5
- package/optimize/lib/components/tool_tip/icon_tip.js +3 -5
- package/optimize/lib/components/tool_tip/tool_tip.js +229 -251
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +8 -16
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +2 -2
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +1 -0
- package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/optimize/lib/test/rtl/component_helpers.d.ts +0 -3
- package/optimize/lib/test/rtl/component_helpers.js +41 -63
- package/package.json +2 -10
- package/test-env/components/basic_table/basic_table.js +3 -6
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -3
- package/test-env/components/basic_table/default_item_action.js +0 -1
- package/test-env/components/basic_table/in_memory_table.js +3 -6
- package/test-env/components/color_picker/color_picker_swatch.js +1 -2
- package/test-env/components/datagrid/controls/display_selector.js +1 -2
- package/test-env/components/datagrid/controls/fullscreen_selector.js +1 -2
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +1 -2
- package/test-env/components/datagrid/utils/scrolling.js +7 -1
- package/test-env/components/filter_group/filter_select_item.js +35 -16
- package/test-env/components/flyout/flyout.component.js +8 -7
- package/test-env/components/flyout/hooks.js +10 -2
- package/test-env/components/flyout/manager/flyout_main.js +3 -1
- package/test-env/components/icon/assets/chart_pie.js +1 -2
- package/test-env/components/icon/assets/product_dashboard.js +5 -3
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -2
- package/test-env/components/list_group/list_group_item.js +1 -2
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +6 -3
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +14 -10
- package/test-env/components/portal/portal.js +70 -113
- package/test-env/components/search_bar/filters/field_value_toggle_group_filter.js +44 -88
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/steps/step_horizontal.js +8 -5
- package/test-env/components/table/table_header_cell.js +1 -2
- package/test-env/components/tool_tip/icon_tip.js +4 -8
- package/test-env/components/tool_tip/tool_tip.js +230 -256
- package/test-env/components/tool_tip/tool_tip.styles.js +8 -16
- package/test-env/components/tool_tip/tool_tip_anchor.js +2 -2
- package/test-env/components/tool_tip/tool_tip_manager.js +1 -0
- package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
- package/test-env/test/rtl/component_helpers.js +41 -63
|
@@ -63,81 +63,59 @@ export var waitForEuiPopoverClose = /*#__PURE__*/function () {
|
|
|
63
63
|
}();
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* jsdom does not track keyboard vs. mouse input modality, so `:focus-visible`
|
|
67
|
+
* always returns false. Call this before `fireEvent.focus()` on an element that
|
|
68
|
+
* should be treated as keyboard-focused.
|
|
69
|
+
*
|
|
70
|
+
* Returns a cleanup function, call it after test assertions to restore the spy.
|
|
67
71
|
*/
|
|
68
|
-
export var
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var tooltip = document.querySelector('.euiToolTipPopover');
|
|
76
|
-
expect(tooltip).toBeVisible();
|
|
77
|
-
}, {
|
|
78
|
-
timeout: 3000
|
|
79
|
-
} // Account for long delay on tooltips
|
|
80
|
-
);
|
|
81
|
-
case 2:
|
|
82
|
-
return _context3.abrupt("return", _context3.sent);
|
|
83
|
-
case 3:
|
|
84
|
-
case "end":
|
|
85
|
-
return _context3.stop();
|
|
86
|
-
}
|
|
87
|
-
}, _callee3);
|
|
88
|
-
}));
|
|
89
|
-
return function waitForEuiToolTipVisible() {
|
|
90
|
-
return _ref3.apply(this, arguments);
|
|
72
|
+
export var simulateFocusVisible = function simulateFocusVisible(element) {
|
|
73
|
+
var originalMatches = Element.prototype.matches.bind(element);
|
|
74
|
+
var spy = jest.spyOn(element, 'matches').mockImplementation(function (selector) {
|
|
75
|
+
return selector === ':focus-visible' ? true : originalMatches(selector);
|
|
76
|
+
});
|
|
77
|
+
return function () {
|
|
78
|
+
return spy.mockRestore();
|
|
91
79
|
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
case 3:
|
|
106
|
-
case "end":
|
|
107
|
-
return _context4.stop();
|
|
108
|
-
}
|
|
109
|
-
}, _callee4);
|
|
110
|
-
}));
|
|
111
|
-
return function waitForEuiToolTipHidden() {
|
|
112
|
-
return _ref4.apply(this, arguments);
|
|
113
|
-
};
|
|
114
|
-
}();
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Prefer this over `fireEvent.focus()` in tooltip tests. Plain `fireEvent.focus`
|
|
84
|
+
* does not set `:focus-visible` in jsdom and will not trigger the tooltip.
|
|
85
|
+
*
|
|
86
|
+
* Returns a cleanup function to restore the mock after assertions.
|
|
87
|
+
*/
|
|
88
|
+
export var focusEuiToolTipTrigger = function focusEuiToolTipTrigger(element) {
|
|
89
|
+
var cleanup = simulateFocusVisible(element);
|
|
90
|
+
fireEvent.focus(element);
|
|
91
|
+
return cleanup;
|
|
92
|
+
};
|
|
115
93
|
|
|
116
94
|
/**
|
|
117
95
|
* EuiComboBox
|
|
118
96
|
*/
|
|
119
97
|
|
|
120
98
|
export var showEuiComboBoxOptions = /*#__PURE__*/function () {
|
|
121
|
-
var
|
|
122
|
-
return _regeneratorRuntime.wrap(function
|
|
123
|
-
while (1) switch (
|
|
99
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
100
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
101
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
124
102
|
case 0:
|
|
125
103
|
fireEvent.click(screen.getByTestSubject('comboBoxToggleListButton'));
|
|
126
|
-
|
|
104
|
+
_context3.next = 3;
|
|
127
105
|
return waitForEuiPopoverOpen();
|
|
128
106
|
case 3:
|
|
129
|
-
|
|
107
|
+
_context3.next = 5;
|
|
130
108
|
return waitFor(function () {
|
|
131
109
|
expect(screen.getByRole('listbox')).toBeInTheDocument();
|
|
132
110
|
});
|
|
133
111
|
case 5:
|
|
134
112
|
case "end":
|
|
135
|
-
return
|
|
113
|
+
return _context3.stop();
|
|
136
114
|
}
|
|
137
|
-
},
|
|
115
|
+
}, _callee3);
|
|
138
116
|
}));
|
|
139
117
|
return function showEuiComboBoxOptions() {
|
|
140
|
-
return
|
|
118
|
+
return _ref3.apply(this, arguments);
|
|
141
119
|
};
|
|
142
120
|
}();
|
|
143
121
|
|
|
@@ -146,16 +124,16 @@ export var showEuiComboBoxOptions = /*#__PURE__*/function () {
|
|
|
146
124
|
*/
|
|
147
125
|
|
|
148
126
|
export var waitForEuiContextMenuPanelTransition = /*#__PURE__*/function () {
|
|
149
|
-
var
|
|
127
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
150
128
|
var getPanels;
|
|
151
|
-
return _regeneratorRuntime.wrap(function
|
|
152
|
-
while (1) switch (
|
|
129
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
130
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
153
131
|
case 0:
|
|
154
132
|
// Used document instead of container or screen due to context menus living in portals
|
|
155
133
|
getPanels = function getPanels() {
|
|
156
134
|
return document.querySelectorAll('.euiContextMenuPanel');
|
|
157
135
|
}; // 2 panels will appear for the transition animation
|
|
158
|
-
|
|
136
|
+
_context4.next = 3;
|
|
159
137
|
return waitFor(function () {
|
|
160
138
|
expect(getPanels().length).toEqual(2);
|
|
161
139
|
});
|
|
@@ -170,11 +148,11 @@ export var waitForEuiContextMenuPanelTransition = /*#__PURE__*/function () {
|
|
|
170
148
|
expect(getPanels().length).toEqual(1);
|
|
171
149
|
case 6:
|
|
172
150
|
case "end":
|
|
173
|
-
return
|
|
151
|
+
return _context4.stop();
|
|
174
152
|
}
|
|
175
|
-
},
|
|
153
|
+
}, _callee4);
|
|
176
154
|
}));
|
|
177
155
|
return function waitForEuiContextMenuPanelTransition() {
|
|
178
|
-
return
|
|
156
|
+
return _ref4.apply(this, arguments);
|
|
179
157
|
};
|
|
180
158
|
}();
|
|
@@ -89,7 +89,6 @@ var CollapsedItemActions = exports.CollapsedItemActions = function CollapsedItem
|
|
|
89
89
|
},
|
|
90
90
|
toolTipContent: toolTipContent,
|
|
91
91
|
toolTipProps: {
|
|
92
|
-
delay: 'long',
|
|
93
92
|
// Avoid screen-readers announcing the same text twice
|
|
94
93
|
disableScreenReaderOutput: typeof buttonContent === 'string' && buttonContent === toolTipContent
|
|
95
94
|
}
|
|
@@ -113,8 +112,7 @@ var CollapsedItemActions = exports.CollapsedItemActions = function CollapsedItem
|
|
|
113
112
|
"data-test-subj": "euiCollapsedItemActionsButton"
|
|
114
113
|
});
|
|
115
114
|
var withTooltip = !actionsDisabled && (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
116
|
-
content: allActionsTooltip
|
|
117
|
-
delay: "long"
|
|
115
|
+
content: allActionsTooltip
|
|
118
116
|
}, popoverButton);
|
|
119
117
|
return (0, _react2.jsx)(_popover.EuiPopover, {
|
|
120
118
|
className: className,
|
|
@@ -41,7 +41,6 @@ var DefaultItemAction = exports.DefaultItemAction = function DefaultItemAction(_
|
|
|
41
41
|
var tooltipContent = (0, _action_types.callWithItemIfFunction)(item)(action.description);
|
|
42
42
|
var tooltipProps = {
|
|
43
43
|
content: tooltipContent,
|
|
44
|
-
delay: 'long',
|
|
45
44
|
// Avoid screen-readers announcing the same text twice
|
|
46
45
|
disableScreenReaderOutput: typeof actionContent === 'string' && actionContent === tooltipContent
|
|
47
46
|
};
|
|
@@ -361,8 +361,7 @@ var useDataGridDisplaySelector = exports.useDataGridDisplaySelector = function u
|
|
|
361
361
|
},
|
|
362
362
|
panelClassName: "euiDataGrid__displayPopoverPanel",
|
|
363
363
|
button: (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
364
|
-
content: buttonLabel
|
|
365
|
-
delay: "long"
|
|
364
|
+
content: buttonLabel
|
|
366
365
|
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
367
366
|
size: "xs",
|
|
368
367
|
iconType: "controls",
|
|
@@ -42,8 +42,7 @@ var useDataGridFullScreenSelector = exports.useDataGridFullScreenSelector = func
|
|
|
42
42
|
fullScreenButtonActive = _useEuiI18n2[1];
|
|
43
43
|
var fullScreenSelector = (0, _react.useMemo)(function () {
|
|
44
44
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
45
|
-
content: isFullScreen ? (0, _react2.jsx)(_react.default.Fragment, null, fullScreenButtonActive, " (", (0, _react2.jsx)("kbd", null, "esc"), ")") : fullScreenButton
|
|
46
|
-
delay: "long"
|
|
45
|
+
content: isFullScreen ? (0, _react2.jsx)(_react.default.Fragment, null, fullScreenButtonActive, " (", (0, _react2.jsx)("kbd", null, "esc"), ")") : fullScreenButton
|
|
47
46
|
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
48
47
|
size: "xs",
|
|
49
48
|
iconType: isFullScreen ? 'fullScreenExit' : 'fullScreen',
|
|
@@ -45,8 +45,7 @@ var useDataGridKeyboardShortcuts = exports.useDataGridKeyboardShortcuts = functi
|
|
|
45
45
|
anchorPosition: "downRight",
|
|
46
46
|
panelPaddingSize: "none",
|
|
47
47
|
button: (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
48
|
-
content: title
|
|
49
|
-
delay: "long"
|
|
48
|
+
content: title
|
|
50
49
|
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
51
50
|
size: "xs",
|
|
52
51
|
iconType: "keyboard",
|
|
@@ -59,11 +59,17 @@ var useScroll = exports.useScroll = function useScroll(args) {
|
|
|
59
59
|
});
|
|
60
60
|
}, [focusedCell, scrollCellIntoView, isPointerDownRef]);
|
|
61
61
|
(0, _react.useEffect)(function () {
|
|
62
|
-
var handlePointerUp = function handlePointerUp() {
|
|
62
|
+
var handlePointerUp = function handlePointerUp(event) {
|
|
63
63
|
var _window;
|
|
64
64
|
if (!pendingScrollRef.current || !focusedCell) return;
|
|
65
65
|
pendingScrollRef.current = false;
|
|
66
66
|
|
|
67
|
+
// The pointerup event can come from any mouse button, not only the left
|
|
68
|
+
// click. We only care about the primary (usually left) mouse button
|
|
69
|
+
// clicks, and specifically have to ignore middle mouse button clicks,
|
|
70
|
+
// which indicate scrolling on Windows.
|
|
71
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
72
|
+
|
|
67
73
|
// Skip if the interaction resulted in text being selected
|
|
68
74
|
if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
|
|
69
75
|
scrollCellIntoView({
|
|
@@ -95,6 +95,18 @@ var EuiFilterSelectItemClass = exports.EuiFilterSelectItemClass = /*#__PURE__*/f
|
|
|
95
95
|
}
|
|
96
96
|
(0, _inherits2.default)(EuiFilterSelectItemClass, _Component);
|
|
97
97
|
return (0, _createClass2.default)(EuiFilterSelectItemClass, [{
|
|
98
|
+
key: "componentDidMount",
|
|
99
|
+
value: function componentDidMount() {
|
|
100
|
+
var _this$props2 = this.props,
|
|
101
|
+
isFocused = _this$props2.isFocused,
|
|
102
|
+
toolTipContent = _this$props2.toolTipContent,
|
|
103
|
+
disabled = _this$props2.disabled,
|
|
104
|
+
children = _this$props2.children;
|
|
105
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(children) && !disabled && toolTipContent) {
|
|
106
|
+
this.toggleToolTip(isFocused !== null && isFocused !== void 0 ? isFocused : false);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
98
110
|
key: "componentDidUpdate",
|
|
99
111
|
value: function componentDidUpdate(prevProps) {
|
|
100
112
|
if (this.props.isFocused && !prevProps.isFocused) {
|
|
@@ -103,31 +115,39 @@ var EuiFilterSelectItemClass = exports.EuiFilterSelectItemClass = /*#__PURE__*/f
|
|
|
103
115
|
block: 'nearest'
|
|
104
116
|
});
|
|
105
117
|
}
|
|
118
|
+
var _this$props3 = this.props,
|
|
119
|
+
isFocused = _this$props3.isFocused,
|
|
120
|
+
toolTipContent = _this$props3.toolTipContent,
|
|
121
|
+
disabled = _this$props3.disabled,
|
|
122
|
+
children = _this$props3.children;
|
|
123
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(children) && !disabled && toolTipContent && isFocused !== prevProps.isFocused) {
|
|
124
|
+
this.toggleToolTip(isFocused !== null && isFocused !== void 0 ? isFocused : false);
|
|
125
|
+
}
|
|
106
126
|
}
|
|
107
127
|
}, {
|
|
108
128
|
key: "render",
|
|
109
129
|
value: function render() {
|
|
110
|
-
var _this$
|
|
111
|
-
theme = _this$
|
|
112
|
-
children = _this$
|
|
113
|
-
className = _this$
|
|
114
|
-
disabled = _this$
|
|
115
|
-
checked = _this$
|
|
116
|
-
isFocused = _this$
|
|
117
|
-
showIcons = _this$
|
|
118
|
-
toolTipContent = _this$
|
|
119
|
-
toolTipProps = _this$
|
|
120
|
-
style = _this$
|
|
121
|
-
truncateContent = _this$
|
|
122
|
-
forwardRef = _this$
|
|
123
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
130
|
+
var _this$props4 = this.props,
|
|
131
|
+
theme = _this$props4.theme,
|
|
132
|
+
children = _this$props4.children,
|
|
133
|
+
className = _this$props4.className,
|
|
134
|
+
disabled = _this$props4.disabled,
|
|
135
|
+
checked = _this$props4.checked,
|
|
136
|
+
isFocused = _this$props4.isFocused,
|
|
137
|
+
showIcons = _this$props4.showIcons,
|
|
138
|
+
toolTipContent = _this$props4.toolTipContent,
|
|
139
|
+
toolTipProps = _this$props4.toolTipProps,
|
|
140
|
+
style = _this$props4.style,
|
|
141
|
+
truncateContent = _this$props4.truncateContent,
|
|
142
|
+
forwardRef = _this$props4.forwardRef,
|
|
143
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
|
|
124
144
|
var styles = (0, _filter_select_item.euiFilterSelectItemStyles)(theme);
|
|
125
145
|
var cssStyles = [styles.euiFilterSelectItem, isFocused && styles.isFocused];
|
|
126
146
|
var classes = (0, _classnames.default)('euiFilterSelectItem', className);
|
|
127
147
|
var hasToolTip =
|
|
128
148
|
// we're using isValidElement here as EuiToolTipAnchor uses
|
|
129
149
|
// cloneElement to enhance the element with required attributes
|
|
130
|
-
/*#__PURE__*/_react.
|
|
150
|
+
/*#__PURE__*/(0, _react.isValidElement)(children) && !disabled && toolTipContent;
|
|
131
151
|
var anchorProps = undefined;
|
|
132
152
|
if (hasToolTip) {
|
|
133
153
|
var _toolTipProps$anchorP, _toolTipProps$anchorP2;
|
|
@@ -137,7 +157,6 @@ var EuiFilterSelectItemClass = exports.EuiFilterSelectItemClass = /*#__PURE__*/f
|
|
|
137
157
|
}) : {
|
|
138
158
|
style: style
|
|
139
159
|
};
|
|
140
|
-
this.toggleToolTip(isFocused !== null && isFocused !== void 0 ? isFocused : false);
|
|
141
160
|
}
|
|
142
161
|
var iconNode;
|
|
143
162
|
if (showIcons) {
|
|
@@ -122,9 +122,16 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
122
122
|
|
|
123
123
|
// Ref for the main flyout element to pass to context
|
|
124
124
|
var internalParentFlyoutRef = (0, _react.useRef)(null);
|
|
125
|
+
|
|
126
|
+
// Observe the container's dimensions so the resize hook and
|
|
127
|
+
// positioning styles stay aligned with its bounding rect.
|
|
128
|
+
// When no container is provided, these remain inert (null/undefined).
|
|
129
|
+
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
130
|
+
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
125
131
|
var isPushed = (0, _hooks.useIsPushed)({
|
|
126
132
|
type: type,
|
|
127
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
133
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
134
|
+
containerWidth: containerReferenceWidth
|
|
128
135
|
});
|
|
129
136
|
// When no explicit container is provided, push padding targets
|
|
130
137
|
// document.body and global push-offset CSS vars are set. When a
|
|
@@ -230,12 +237,6 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
230
237
|
var siblingFlyoutMinWidth = siblingFlyout === null || siblingFlyout === void 0 ? void 0 : siblingFlyout.minWidth;
|
|
231
238
|
var siblingFlyoutWidth = layoutMode === _const.LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
232
239
|
|
|
233
|
-
// Observe the container's dimensions so the resize hook and
|
|
234
|
-
// positioning styles stay aligned with its bounding rect.
|
|
235
|
-
// When no container is provided, these remain inert (null/undefined).
|
|
236
|
-
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
237
|
-
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
238
|
-
|
|
239
240
|
// Track the container's bounding rect for positioning the flyout.
|
|
240
241
|
var _useState = (0, _react.useState)(null),
|
|
241
242
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -17,7 +17,7 @@ var _const = require("./const");
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
20
|
-
* configuration and the current window size.
|
|
20
|
+
* configuration and the current window or container size.
|
|
21
21
|
*/
|
|
22
22
|
var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
23
23
|
var _usePropsWithComponen = (0, _component_defaults.usePropsWithComponentDefaults)('EuiFlyout', props),
|
|
@@ -25,6 +25,14 @@ var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
|
25
25
|
type = _usePropsWithComponen2 === void 0 ? _const.DEFAULT_TYPE : _usePropsWithComponen2,
|
|
26
26
|
_usePropsWithComponen3 = _usePropsWithComponen.pushMinBreakpoint,
|
|
27
27
|
pushMinBreakpoint = _usePropsWithComponen3 === void 0 ? _const.DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen3;
|
|
28
|
+
var _useEuiTheme = (0, _services.useEuiTheme)(),
|
|
29
|
+
breakpoints = _useEuiTheme.euiTheme.breakpoint;
|
|
30
|
+
|
|
31
|
+
// Always called to satisfy React hook rules; used as fallback
|
|
32
|
+
// when no container width is provided or the breakpoint key is
|
|
33
|
+
// not present on the theme.
|
|
28
34
|
var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
|
|
29
|
-
|
|
35
|
+
var minWidth = breakpoints[pushMinBreakpoint];
|
|
36
|
+
var isLargeEnoughToPush = props.containerWidth != null && minWidth != null ? props.containerWidth >= minWidth : windowIsLargeEnoughToPush;
|
|
37
|
+
return type === 'push' && isLargeEnoughToPush;
|
|
30
38
|
};
|
|
@@ -50,9 +50,11 @@ var EuiFlyoutMain = exports.EuiFlyoutMain = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
50
50
|
var flyoutId = (0, _hooks.useFlyoutId)(id);
|
|
51
51
|
var hasChildFlyout = (0, _hooks.useHasChildFlyout)(flyoutId);
|
|
52
52
|
var styles = (0, _services.useEuiMemoizedStyles)(_flyout_main.euiMainFlyoutStyles);
|
|
53
|
+
var context = (0, _hooks.useFlyoutManager)();
|
|
53
54
|
var isPushed = (0, _hooks2.useIsPushed)({
|
|
54
55
|
type: type,
|
|
55
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
56
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
57
|
+
containerWidth: context === null || context === void 0 ? void 0 : context.state.referenceWidth
|
|
56
58
|
});
|
|
57
59
|
var cssStyles = [hasChildFlyout && !isPushed && styles.hasChildFlyout[side]];
|
|
58
60
|
var style = {};
|
|
@@ -34,8 +34,7 @@ var EuiIconChartPie = function EuiIconChartPie(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
d: "M7.5 8.5h6.979A6.498 6.498 0 0 1 1.5 8a6.5 6.5 0 0 1 6-6.48V8.5Zm2-6.824A6.506 6.506 0 0 1 14.323 6.5H9.5V1.676Z"
|
|
37
|
+
d: "M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconChartPie;
|
|
@@ -34,9 +34,11 @@ var EuiIconProductDashboard = function EuiIconProductDashboard(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
d: "m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"
|
|
38
|
+
}), (0, _react2.jsx)("path", {
|
|
39
|
+
d: "M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"
|
|
40
|
+
}), (0, _react2.jsx)("path", {
|
|
41
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
42
44
|
var icon = exports.icon = EuiIconProductDashboard;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path
|
|
2
|
+
<path d="M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"/>
|
|
3
3
|
</svg>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16"
|
|
2
|
-
<path
|
|
3
|
-
<path
|
|
4
|
-
<path
|
|
5
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 2C14.5177 2 14.9438 2.39333 14.9951 2.89746L15 3V5C15 5.55228 14.5523 6 14 6H2C1.44772 6 1 5.55228 1 5V3C1 2.44772 1.44772 2 2 2H14ZM2 5H14V3H2V5Z"/>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path d="m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"/>
|
|
3
|
+
<path d="M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"/>
|
|
4
|
+
<path d="M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"/>
|
|
6
5
|
</svg>
|
|
@@ -135,7 +135,6 @@ var EuiKeyPadMenuItem = exports.EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_
|
|
|
135
135
|
}, label)));
|
|
136
136
|
return betaBadgeLabel ? (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({}, betaBadgeTooltipProps, {
|
|
137
137
|
title: betaBadgeLabel,
|
|
138
|
-
content: betaBadgeTooltipContent
|
|
139
|
-
delay: "long"
|
|
138
|
+
content: betaBadgeTooltipContent
|
|
140
139
|
}), button) : button;
|
|
141
140
|
};
|
|
@@ -177,8 +177,7 @@ var EuiListGroupItem = exports.EuiListGroupItem = function EuiListGroupItem(_ref
|
|
|
177
177
|
style: style
|
|
178
178
|
}, (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
179
179
|
content: toolTipText !== null && toolTipText !== void 0 ? toolTipText : label,
|
|
180
|
-
position: "right"
|
|
181
|
-
delay: "long"
|
|
180
|
+
position: "right"
|
|
182
181
|
}, toolTipProps, {
|
|
183
182
|
anchorClassName: anchorClasses,
|
|
184
183
|
anchorProps: anchorPropsAndCss
|
|
@@ -171,8 +171,11 @@ var EuiMarkdownEditorDropZone = exports.EuiMarkdownEditorDropZone = function Eui
|
|
|
171
171
|
getInputProps = _useDropzone.getInputProps,
|
|
172
172
|
open = _useDropzone.open;
|
|
173
173
|
var rootProps = _objectSpread({}, getRootProps());
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
/* Unset the default `role="button"` attribute to prevent invalid nested interactive elements.
|
|
175
|
+
The dropzone has `noClick=true` and `noKeyboard=true` set via `useDropzone`.
|
|
176
|
+
Keyboard drop interactions expect the drop zone element to have `role="button` but we're supporting
|
|
177
|
+
adding files via a standalone footer button instead." */
|
|
178
|
+
rootProps.role = undefined;
|
|
176
179
|
return (0, _react2.jsx)("div", (0, _extends2.default)({}, rootProps, {
|
|
177
180
|
css: cssStyles,
|
|
178
181
|
className: classes
|
|
@@ -27,6 +27,11 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
27
27
|
* Side Public License, v 1.
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* A helper type to ensure the `button` property is defined
|
|
32
|
+
* on an ` EuiMarkdownEditorUiPlugin ` object.
|
|
33
|
+
*/
|
|
34
|
+
|
|
30
35
|
var boldItalicButtons = [{
|
|
31
36
|
id: 'mdBold',
|
|
32
37
|
label: 'Bold',
|
|
@@ -101,7 +106,7 @@ var EuiMarkdownEditorToolbar = exports.EuiMarkdownEditorToolbar = /*#__PURE__*/(
|
|
|
101
106
|
markdownActions = _ref2.markdownActions,
|
|
102
107
|
viewMode = _ref2.viewMode,
|
|
103
108
|
onClickPreview = _ref2.onClickPreview,
|
|
104
|
-
|
|
109
|
+
_uiPlugins = _ref2.uiPlugins,
|
|
105
110
|
selectedNode = _ref2.selectedNode,
|
|
106
111
|
right = _ref2.right;
|
|
107
112
|
var _useContext = (0, _react.useContext)(_markdown_context.EuiMarkdownContext),
|
|
@@ -115,6 +120,9 @@ var EuiMarkdownEditorToolbar = exports.EuiMarkdownEditorToolbar = /*#__PURE__*/(
|
|
|
115
120
|
var isPreviewing = viewMode === _markdown_modes.MODE_VIEWING;
|
|
116
121
|
var isEditable = !isPreviewing && !readOnly;
|
|
117
122
|
var styles = (0, _services.useEuiMemoizedStyles)(_markdown_editor_toolbar.euiMarkdownEditorToolbarStyles);
|
|
123
|
+
var uiPlugins = _uiPlugins.filter(function (uiPlugin) {
|
|
124
|
+
return !!uiPlugin.button;
|
|
125
|
+
});
|
|
118
126
|
return (0, _react2.jsx)("div", {
|
|
119
127
|
ref: ref,
|
|
120
128
|
css: styles.euiMarkdownEditorToolbar,
|
|
@@ -126,8 +134,7 @@ var EuiMarkdownEditorToolbar = exports.EuiMarkdownEditorToolbar = /*#__PURE__*/(
|
|
|
126
134
|
}, boldItalicButtons.map(function (item) {
|
|
127
135
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
128
136
|
key: item.id,
|
|
129
|
-
content: item.label
|
|
130
|
-
delay: "long"
|
|
137
|
+
content: item.label
|
|
131
138
|
}, (0, _react2.jsx)(EuiMarkdownEditorToolbarButton, {
|
|
132
139
|
selectedNode: selectedNode,
|
|
133
140
|
handleMdButtonClick: handleMdButtonClick,
|
|
@@ -143,8 +150,7 @@ var EuiMarkdownEditorToolbar = exports.EuiMarkdownEditorToolbar = /*#__PURE__*/(
|
|
|
143
150
|
}), listButtons.map(function (item) {
|
|
144
151
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
145
152
|
key: item.id,
|
|
146
|
-
content: item.label
|
|
147
|
-
delay: "long"
|
|
153
|
+
content: item.label
|
|
148
154
|
}, (0, _react2.jsx)(EuiMarkdownEditorToolbarButton, {
|
|
149
155
|
selectedNode: selectedNode,
|
|
150
156
|
handleMdButtonClick: handleMdButtonClick,
|
|
@@ -160,8 +166,7 @@ var EuiMarkdownEditorToolbar = exports.EuiMarkdownEditorToolbar = /*#__PURE__*/(
|
|
|
160
166
|
}), quoteCodeLinkButtons.map(function (item) {
|
|
161
167
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
162
168
|
key: item.id,
|
|
163
|
-
content: item.label
|
|
164
|
-
delay: "long"
|
|
169
|
+
content: item.label
|
|
165
170
|
}, (0, _react2.jsx)(EuiMarkdownEditorToolbarButton, {
|
|
166
171
|
selectedNode: selectedNode,
|
|
167
172
|
handleMdButtonClick: handleMdButtonClick,
|
|
@@ -179,8 +184,7 @@ var EuiMarkdownEditorToolbar = exports.EuiMarkdownEditorToolbar = /*#__PURE__*/(
|
|
|
179
184
|
button = _ref3.button;
|
|
180
185
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
181
186
|
key: name,
|
|
182
|
-
content: button.label
|
|
183
|
-
delay: "long"
|
|
187
|
+
content: button.label
|
|
184
188
|
}, (0, _react2.jsx)(EuiMarkdownEditorToolbarButton, {
|
|
185
189
|
selectedNode: selectedNode,
|
|
186
190
|
handleMdButtonClick: handleMdButtonClick,
|