@elastic/eui 66.0.0 → 67.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/dist/eui_theme_dark.css +0 -247
- package/dist/eui_theme_dark.json +0 -6
- package/dist/eui_theme_dark.json.d.ts +0 -6
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -247
- package/dist/eui_theme_light.json +0 -6
- package/dist/eui_theme_light.json.d.ts +0 -6
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/button/button_display/_button_display.js +10 -1
- package/es/components/button/button_empty/button_empty.js +10 -1
- package/es/components/collapsible_nav/collapsible_nav.js +0 -5
- package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
- package/es/components/expression/expression.js +12 -2
- package/es/components/header/header_links/header_link.js +10 -1
- package/es/components/image/image.js +6 -1
- package/es/components/image/image_fullscreen_wrapper.js +2 -3
- package/es/components/notification/notification_event.js +24 -5
- package/es/components/overlay_mask/overlay_mask.js +27 -65
- package/es/components/overlay_mask/overlay_mask.styles.js +28 -0
- package/es/components/page/page_content/page_content.js +1 -2
- package/es/components/page/page_content/page_content_body.js +1 -2
- package/es/components/page/page_content/page_content_header.js +1 -2
- package/es/components/page/page_content/page_content_header_section.js +1 -2
- package/es/components/page/page_section/page_section.js +15 -3
- package/es/components/page/page_side_bar/page_side_bar.js +1 -2
- package/es/components/page/page_template.js +3 -1
- package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
- package/es/components/page_template/page_template.js +18 -2
- package/es/components/pagination/pagination.js +17 -4
- package/es/components/pagination/pagination.styles.js +31 -0
- package/es/components/pagination/pagination_button.js +17 -5
- package/es/components/pagination/pagination_button.styles.js +30 -0
- package/es/components/pagination/pagination_button_arrow.js +5 -0
- package/es/components/progress/progress.js +6 -1
- package/es/components/provider/cache/cache_provider.js +3 -9
- package/es/components/provider/provider.js +25 -2
- package/es/components/resizable_container/resizable_panel.js +6 -1
- package/es/components/side_nav/side_nav.js +5 -0
- package/es/components/suggest/suggest.js +10 -1
- package/es/components/tool_tip/tool_tip.js +42 -66
- package/es/components/tool_tip/tool_tip.styles.js +107 -0
- package/es/components/tool_tip/tool_tip_anchor.js +73 -0
- package/es/components/tool_tip/tool_tip_arrow.js +20 -0
- package/es/components/tool_tip/tool_tip_popover.js +48 -101
- package/es/global_styling/index.js +2 -1
- package/es/global_styling/utility/animations.js +13 -0
- package/eui.d.ts +128 -51
- package/i18ntokens.json +54 -54
- package/lib/components/button/button_display/_button_display.js +10 -1
- package/lib/components/button/button_empty/button_empty.js +10 -1
- package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
- package/lib/components/expression/expression.js +12 -2
- package/lib/components/header/header_links/header_link.js +10 -1
- package/lib/components/image/image.js +6 -1
- package/lib/components/image/image_fullscreen_wrapper.js +2 -3
- package/lib/components/notification/notification_event.js +27 -8
- package/lib/components/overlay_mask/overlay_mask.js +27 -65
- package/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
- package/lib/components/page/page_content/page_content.js +1 -2
- package/lib/components/page/page_content/page_content_body.js +1 -2
- package/lib/components/page/page_content/page_content_header.js +1 -2
- package/lib/components/page/page_content/page_content_header_section.js +1 -2
- package/lib/components/page/page_section/page_section.js +15 -3
- package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
- package/lib/components/page/page_template.js +3 -1
- package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
- package/lib/components/page_template/page_template.js +18 -2
- package/lib/components/pagination/pagination.js +18 -3
- package/lib/components/pagination/pagination.styles.js +34 -0
- package/lib/components/pagination/pagination_button.js +9 -4
- package/lib/components/pagination/pagination_button.styles.js +45 -0
- package/lib/components/pagination/pagination_button_arrow.js +7 -0
- package/lib/components/progress/progress.js +6 -1
- package/lib/components/provider/cache/cache_provider.js +3 -11
- package/lib/components/provider/provider.js +31 -6
- package/lib/components/resizable_container/resizable_panel.js +6 -1
- package/lib/components/side_nav/side_nav.js +5 -0
- package/lib/components/suggest/suggest.js +10 -1
- package/lib/components/tool_tip/tool_tip.js +43 -64
- package/lib/components/tool_tip/tool_tip.styles.js +123 -0
- package/lib/components/tool_tip/tool_tip_anchor.js +87 -0
- package/lib/components/tool_tip/tool_tip_arrow.js +28 -0
- package/lib/components/tool_tip/tool_tip_popover.js +49 -98
- package/lib/global_styling/index.js +13 -0
- package/lib/global_styling/utility/animations.js +15 -0
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
- package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -3
- package/optimize/es/components/notification/notification_event.js +10 -4
- package/optimize/es/components/overlay_mask/overlay_mask.js +27 -60
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +28 -0
- package/optimize/es/components/page/page_content/page_content.js +1 -2
- package/optimize/es/components/page/page_content/page_content_body.js +1 -2
- package/optimize/es/components/page/page_content/page_content_header.js +1 -2
- package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
- package/optimize/es/components/page/page_section/page_section.js +4 -2
- package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
- package/optimize/es/components/page/page_template.js +3 -1
- package/optimize/es/components/pagination/pagination.js +17 -4
- package/optimize/es/components/pagination/pagination.styles.js +31 -0
- package/optimize/es/components/pagination/pagination_button.js +7 -4
- package/optimize/es/components/pagination/pagination_button.styles.js +30 -0
- package/optimize/es/components/pagination/pagination_button_arrow.js +5 -0
- package/optimize/es/components/provider/cache/cache_provider.js +3 -9
- package/optimize/es/components/provider/provider.js +25 -2
- package/optimize/es/components/suggest/suggest.js +4 -1
- package/optimize/es/components/tool_tip/tool_tip.js +42 -66
- package/optimize/es/components/tool_tip/tool_tip.styles.js +107 -0
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +60 -0
- package/optimize/es/components/tool_tip/tool_tip_arrow.js +20 -0
- package/optimize/es/components/tool_tip/tool_tip_popover.js +46 -87
- package/optimize/es/global_styling/index.js +2 -1
- package/optimize/es/global_styling/utility/animations.js +13 -0
- package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -3
- package/optimize/lib/components/notification/notification_event.js +11 -11
- package/optimize/lib/components/overlay_mask/overlay_mask.js +27 -59
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
- package/optimize/lib/components/page/page_content/page_content.js +1 -2
- package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
- package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
- package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
- package/optimize/lib/components/page/page_section/page_section.js +4 -2
- package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
- package/optimize/lib/components/page/page_template.js +3 -1
- package/optimize/lib/components/pagination/pagination.js +18 -3
- package/optimize/lib/components/pagination/pagination.styles.js +34 -0
- package/optimize/lib/components/pagination/pagination_button.js +9 -4
- package/optimize/lib/components/pagination/pagination_button.styles.js +45 -0
- package/optimize/lib/components/pagination/pagination_button_arrow.js +7 -0
- package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
- package/optimize/lib/components/provider/provider.js +31 -6
- package/optimize/lib/components/suggest/suggest.js +4 -1
- package/optimize/lib/components/tool_tip/tool_tip.js +42 -64
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +125 -0
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +75 -0
- package/optimize/lib/components/tool_tip/tool_tip_arrow.js +35 -0
- package/optimize/lib/components/tool_tip/tool_tip_popover.js +47 -88
- package/optimize/lib/global_styling/index.js +13 -0
- package/optimize/lib/global_styling/utility/animations.js +17 -0
- package/package.json +2 -2
- package/src/components/index.scss +0 -4
- package/src/global_styling/mixins/_tool_tip.scss +3 -6
- package/src/themes/amsterdam/overrides/_index.scss +0 -2
- package/test-env/components/button/button_display/_button_display.js +10 -1
- package/test-env/components/button/button_empty/button_empty.js +10 -1
- package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
- package/test-env/components/expression/expression.js +12 -2
- package/test-env/components/header/header_links/header_link.js +10 -1
- package/test-env/components/image/image.js +6 -1
- package/test-env/components/image/image_fullscreen_wrapper.js +2 -3
- package/test-env/components/notification/notification_event.js +24 -15
- package/test-env/components/overlay_mask/overlay_mask.js +27 -64
- package/test-env/components/overlay_mask/overlay_mask.styles.js +34 -0
- package/test-env/components/page/page_content/page_content.js +1 -2
- package/test-env/components/page/page_content/page_content_body.js +1 -2
- package/test-env/components/page/page_content/page_content_header.js +1 -2
- package/test-env/components/page/page_content/page_content_header_section.js +1 -2
- package/test-env/components/page/page_section/page_section.js +15 -3
- package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
- package/test-env/components/page/page_template.js +3 -1
- package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
- package/test-env/components/page_template/page_template.js +18 -2
- package/test-env/components/pagination/pagination.js +18 -3
- package/test-env/components/pagination/pagination.styles.js +34 -0
- package/test-env/components/pagination/pagination_button.js +9 -4
- package/test-env/components/pagination/pagination_button.styles.js +45 -0
- package/test-env/components/pagination/pagination_button_arrow.js +7 -0
- package/test-env/components/progress/progress.js +6 -1
- package/test-env/components/provider/cache/cache_provider.js +3 -11
- package/test-env/components/provider/provider.js +31 -6
- package/test-env/components/resizable_container/resizable_panel.js +6 -1
- package/test-env/components/side_nav/side_nav.js +5 -0
- package/test-env/components/suggest/suggest.js +10 -1
- package/test-env/components/tool_tip/tool_tip.js +42 -64
- package/test-env/components/tool_tip/tool_tip.styles.js +125 -0
- package/test-env/components/tool_tip/tool_tip_anchor.js +84 -0
- package/test-env/components/tool_tip/tool_tip_arrow.js +35 -0
- package/test-env/components/tool_tip/tool_tip_popover.js +49 -89
- package/test-env/global_styling/index.js +13 -0
- package/test-env/global_styling/utility/animations.js +17 -0
- package/src/components/call_out/_index.scss +0 -3
- package/src/components/call_out/_mixins.scss +0 -23
- package/src/components/call_out/_variables.scss +0 -7
- package/src/components/overlay_mask/_index.scss +0 -1
- package/src/components/overlay_mask/_overlay_mask.scss +0 -33
- package/src/components/pagination/_index.scss +0 -2
- package/src/components/pagination/_pagination.scss +0 -30
- package/src/components/pagination/_pagination_button.scss +0 -37
- package/src/components/tool_tip/_index.scss +0 -1
- package/src/components/tool_tip/_tool_tip.scss +0 -121
- package/src/themes/amsterdam/overrides/_overlay_mask.scss +0 -3
- package/src/themes/amsterdam/overrides/_tooltip.scss +0 -7
|
@@ -7,6 +7,8 @@ exports.EuiProvider = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
11
|
+
|
|
10
12
|
var _global_styles = require("../../global_styling/reset/global_styles");
|
|
11
13
|
|
|
12
14
|
var _utility = require("../../global_styling/utility/utility");
|
|
@@ -15,7 +17,7 @@ var _services = require("../../services");
|
|
|
15
17
|
|
|
16
18
|
var _themes = require("../../themes");
|
|
17
19
|
|
|
18
|
-
var
|
|
20
|
+
var _cache2 = require("./cache");
|
|
19
21
|
|
|
20
22
|
var _react2 = require("@emotion/react");
|
|
21
23
|
|
|
@@ -32,8 +34,16 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
|
32
34
|
return obj.hasOwnProperty('key');
|
|
33
35
|
};
|
|
34
36
|
|
|
37
|
+
var fallbackCache = (0, _cache.default)({
|
|
38
|
+
key: 'css'
|
|
39
|
+
});
|
|
40
|
+
fallbackCache.compat = true;
|
|
41
|
+
|
|
35
42
|
var EuiProvider = function EuiProvider(_ref) {
|
|
36
|
-
var
|
|
43
|
+
var _defaultCache;
|
|
44
|
+
|
|
45
|
+
var _ref$cache = _ref.cache,
|
|
46
|
+
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
37
47
|
_ref$theme = _ref.theme,
|
|
38
48
|
theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
|
|
39
49
|
_ref$globalStyles = _ref.globalStyles,
|
|
@@ -49,24 +59,39 @@ var EuiProvider = function EuiProvider(_ref) {
|
|
|
49
59
|
|
|
50
60
|
if (cache) {
|
|
51
61
|
if (isEmotionCacheObject(cache)) {
|
|
62
|
+
cache.compat = true;
|
|
52
63
|
defaultCache = cache;
|
|
53
64
|
} else {
|
|
65
|
+
if (cache.default) {
|
|
66
|
+
cache.default.compat = true;
|
|
67
|
+
}
|
|
68
|
+
|
|
54
69
|
defaultCache = cache.default;
|
|
70
|
+
|
|
71
|
+
if (cache.global) {
|
|
72
|
+
cache.global.compat = true;
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
globalCache = cache.global;
|
|
76
|
+
|
|
77
|
+
if (cache.utility) {
|
|
78
|
+
cache.utility.compat = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
56
81
|
utilityCache = cache.utility;
|
|
57
82
|
}
|
|
58
83
|
}
|
|
59
84
|
|
|
60
|
-
return (0, _react2.jsx)(
|
|
61
|
-
cache: defaultCache
|
|
85
|
+
return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
86
|
+
cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
|
|
62
87
|
}, (0, _react2.jsx)(_services.EuiThemeProvider, {
|
|
63
88
|
theme: theme !== null && theme !== void 0 ? theme : undefined,
|
|
64
89
|
colorMode: colorMode,
|
|
65
90
|
modify: modify
|
|
66
|
-
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
91
|
+
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
67
92
|
cache: globalCache,
|
|
68
93
|
children: Globals && (0, _react2.jsx)(Globals, null)
|
|
69
|
-
}), (0, _react2.jsx)(
|
|
94
|
+
}), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
70
95
|
cache: utilityCache,
|
|
71
96
|
children: Utilities && (0, _react2.jsx)(Utilities, null)
|
|
72
97
|
})), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
|
|
@@ -355,7 +355,12 @@ EuiResizablePanel.propTypes = {
|
|
|
355
355
|
/**
|
|
356
356
|
* Props to add to the wrapping `.euiResizablePanel` div
|
|
357
357
|
*/
|
|
358
|
-
wrapperProps: _propTypes.default.
|
|
358
|
+
wrapperProps: _propTypes.default.shape({
|
|
359
|
+
className: _propTypes.default.string,
|
|
360
|
+
"aria-label": _propTypes.default.string,
|
|
361
|
+
"data-test-subj": _propTypes.default.string,
|
|
362
|
+
css: _propTypes.default.any
|
|
363
|
+
}),
|
|
359
364
|
|
|
360
365
|
/**
|
|
361
366
|
* Padding to add directly to the wrapping `.euiResizablePanel` div
|
|
@@ -272,6 +272,11 @@ EuiSideNav.propTypes = {
|
|
|
272
272
|
* Adds a couple extra #EuiSideNavHeading props and extends the props of EuiTitle that wraps the `heading`
|
|
273
273
|
*/
|
|
274
274
|
headingProps: _propTypes.default.shape({
|
|
275
|
+
className: _propTypes.default.string,
|
|
276
|
+
"aria-label": _propTypes.default.string,
|
|
277
|
+
"data-test-subj": _propTypes.default.string,
|
|
278
|
+
css: _propTypes.default.any,
|
|
279
|
+
|
|
275
280
|
/**
|
|
276
281
|
* The actual HTML heading element to wrap the `heading`.
|
|
277
282
|
* Default is `h2`
|
|
@@ -31,7 +31,7 @@ var _suggest_item = require("./suggest_item");
|
|
|
31
31
|
|
|
32
32
|
var _react2 = require("@emotion/react");
|
|
33
33
|
|
|
34
|
-
var _excluded = ["onItemClick", "onBlur", "onFocus", "onInput", "onSearch", "status", "append", "tooltipContent", "suggestions", "id", "aria-label", "aria-labelledby", "isVirtualized", "fullWidth", "maxHeight"];
|
|
34
|
+
var _excluded = ["onItemClick", "onBlur", "onFocus", "onInput", "onSearch", "status", "append", "tooltipContent", "suggestions", "id", "aria-label", "aria-labelledby", "isPreFiltered", "isVirtualized", "fullWidth", "maxHeight"];
|
|
35
35
|
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
37
|
|
|
@@ -93,6 +93,8 @@ var EuiSuggest = function EuiSuggest(_ref) {
|
|
|
93
93
|
id = _ref.id,
|
|
94
94
|
ariaLabel = _ref['aria-label'],
|
|
95
95
|
labelId = _ref['aria-labelledby'],
|
|
96
|
+
_ref$isPreFiltered = _ref.isPreFiltered,
|
|
97
|
+
isPreFiltered = _ref$isPreFiltered === void 0 ? false : _ref$isPreFiltered,
|
|
96
98
|
_ref$isVirtualized = _ref.isVirtualized,
|
|
97
99
|
isVirtualized = _ref$isVirtualized === void 0 ? false : _ref$isVirtualized,
|
|
98
100
|
_ref$fullWidth = _ref.fullWidth,
|
|
@@ -257,6 +259,7 @@ var EuiSuggest = function EuiSuggest(_ref) {
|
|
|
257
259
|
isVirtualized: isVirtualized
|
|
258
260
|
},
|
|
259
261
|
searchable: true,
|
|
262
|
+
isPreFiltered: isPreFiltered,
|
|
260
263
|
searchProps: _objectSpread({
|
|
261
264
|
id: id,
|
|
262
265
|
append: appendArray.length ? appendArray : undefined,
|
|
@@ -384,5 +387,11 @@ EuiSuggest.propTypes = {
|
|
|
384
387
|
* Default is `60vh`
|
|
385
388
|
*/
|
|
386
389
|
maxHeight: _propTypes.default.any,
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Control whether or not options get filtered internally or if consumer will filter.
|
|
393
|
+
* Default `false`
|
|
394
|
+
*/
|
|
395
|
+
isPreFiltered: _propTypes.default.bool,
|
|
387
396
|
"aria-labelledby": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string.isRequired])
|
|
388
397
|
};
|
|
@@ -17,6 +17,10 @@ var _common = require("../common");
|
|
|
17
17
|
|
|
18
18
|
var _portal = require("../portal");
|
|
19
19
|
|
|
20
|
+
var _tool_tip_anchor = require("./tool_tip_anchor");
|
|
21
|
+
|
|
22
|
+
var _tool_tip_arrow = require("./tool_tip_arrow");
|
|
23
|
+
|
|
20
24
|
var _tool_tip_popover = require("./tool_tip_popover");
|
|
21
25
|
|
|
22
26
|
var _react2 = require("../../services/react");
|
|
@@ -35,10 +39,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
35
39
|
|
|
36
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
41
|
|
|
38
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
-
|
|
42
42
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
43
|
|
|
44
44
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -150,16 +150,12 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
+
_defineProperty(_assertThisInitialized(_this), "setAnchorRef", function (ref) {
|
|
154
|
+
return _this.anchor = ref;
|
|
155
|
+
});
|
|
156
|
+
|
|
153
157
|
_defineProperty(_assertThisInitialized(_this), "setPopoverRef", function (ref) {
|
|
154
|
-
_this.popover = ref;
|
|
155
|
-
// any previous knowledge about its size
|
|
156
|
-
|
|
157
|
-
if (ref == null) {
|
|
158
|
-
_this.setState({
|
|
159
|
-
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
160
|
-
arrowStyles: undefined
|
|
161
|
-
});
|
|
162
|
-
}
|
|
158
|
+
return _this.popover = ref;
|
|
163
159
|
});
|
|
164
160
|
|
|
165
161
|
_defineProperty(_assertThisInitialized(_this), "showToolTip", function () {
|
|
@@ -225,7 +221,9 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
225
221
|
(0, _react2.enqueueStateChange)(function () {
|
|
226
222
|
if (_this._isMounted) {
|
|
227
223
|
_this.setState({
|
|
228
|
-
visible: false
|
|
224
|
+
visible: false,
|
|
225
|
+
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
226
|
+
arrowStyles: undefined
|
|
229
227
|
});
|
|
230
228
|
}
|
|
231
229
|
});
|
|
@@ -285,8 +283,6 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
285
283
|
}, {
|
|
286
284
|
key: "render",
|
|
287
285
|
value: function render() {
|
|
288
|
-
var _this2 = this;
|
|
289
|
-
|
|
290
286
|
var _this$props = this.props,
|
|
291
287
|
children = _this$props.children,
|
|
292
288
|
className = _this$props.className,
|
|
@@ -302,56 +298,39 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
302
298
|
arrowStyles = _this$state.arrowStyles,
|
|
303
299
|
id = _this$state.id,
|
|
304
300
|
toolTipStyles = _this$state.toolTipStyles,
|
|
305
|
-
visible = _this$state.visible
|
|
301
|
+
visible = _this$state.visible,
|
|
302
|
+
calculatedPosition = _this$state.calculatedPosition;
|
|
306
303
|
var classes = (0, _classnames.default)('euiToolTip', positionsToClassNameMap[this.state.calculatedPosition], className);
|
|
307
|
-
var anchorClasses = (0, _classnames.default)(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
className: classes,
|
|
313
|
-
style: toolTipStyles,
|
|
314
|
-
positionToolTip: this.positionToolTip,
|
|
315
|
-
popoverRef: this.setPopoverRef,
|
|
316
|
-
title: title,
|
|
317
|
-
id: id,
|
|
318
|
-
role: "tooltip"
|
|
319
|
-
}, rest), (0, _react3.jsx)("div", {
|
|
320
|
-
style: arrowStyles,
|
|
321
|
-
className: "euiToolTip__arrow"
|
|
322
|
-
}), (0, _react3.jsx)(_resize_observer.EuiResizeObserver, {
|
|
323
|
-
onResize: this.positionToolTip
|
|
324
|
-
}, function (resizeRef) {
|
|
325
|
-
return (0, _react3.jsx)("div", {
|
|
326
|
-
ref: resizeRef
|
|
327
|
-
}, content);
|
|
328
|
-
})));
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
var anchor = // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
332
|
-
(0, _react3.jsx)("span", _extends({
|
|
333
|
-
ref: function ref(anchor) {
|
|
334
|
-
return _this2.anchor = anchor;
|
|
335
|
-
}
|
|
336
|
-
}, anchorProps, {
|
|
337
|
-
className: anchorClasses,
|
|
304
|
+
var anchorClasses = (0, _classnames.default)(anchorClassName, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.className);
|
|
305
|
+
return (0, _react3.jsx)(_react.default.Fragment, null, (0, _react3.jsx)(_tool_tip_anchor.EuiToolTipAnchor, _extends({}, anchorProps, {
|
|
306
|
+
ref: this.setAnchorRef,
|
|
307
|
+
onBlur: this.onBlur,
|
|
308
|
+
onFocus: this.onFocus,
|
|
338
309
|
onMouseOver: this.showToolTip,
|
|
339
|
-
onMouseOut: this.onMouseOut
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}))
|
|
354
|
-
|
|
310
|
+
onMouseOut: this.onMouseOut,
|
|
311
|
+
id: this.state.id,
|
|
312
|
+
className: anchorClasses,
|
|
313
|
+
display: display,
|
|
314
|
+
isVisible: visible
|
|
315
|
+
}), children), visible && (content || title) && (0, _react3.jsx)(_portal.EuiPortal, null, (0, _react3.jsx)(_tool_tip_popover.EuiToolTipPopover, _extends({
|
|
316
|
+
className: classes,
|
|
317
|
+
style: toolTipStyles,
|
|
318
|
+
positionToolTip: this.positionToolTip,
|
|
319
|
+
popoverRef: this.setPopoverRef,
|
|
320
|
+
title: title,
|
|
321
|
+
id: id,
|
|
322
|
+
role: "tooltip",
|
|
323
|
+
calculatedPosition: calculatedPosition
|
|
324
|
+
}, rest), (0, _react3.jsx)(_tool_tip_arrow.EuiToolTipArrow, {
|
|
325
|
+
style: arrowStyles,
|
|
326
|
+
className: "euiToolTip__arrow"
|
|
327
|
+
}), (0, _react3.jsx)(_resize_observer.EuiResizeObserver, {
|
|
328
|
+
onResize: this.positionToolTip
|
|
329
|
+
}, function (resizeRef) {
|
|
330
|
+
return (0, _react3.jsx)("div", {
|
|
331
|
+
ref: resizeRef
|
|
332
|
+
}, content);
|
|
333
|
+
}))));
|
|
355
334
|
}
|
|
356
335
|
}]);
|
|
357
336
|
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiToolTipStyles = exports.euiToolTipPopoverStyles = exports.euiToolTipBorderColor = exports.euiToolTipBackgroundColor = exports.euiToolTipAnchorStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
var _services = require("../../services");
|
|
13
|
+
|
|
14
|
+
var _amsterdam = require("../../themes/amsterdam");
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
18
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
+
|
|
20
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
21
|
+
|
|
22
|
+
var euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme, colorMode) {
|
|
23
|
+
return colorMode === _services.COLOR_MODES_STANDARD.dark ? (0, _services.shade)(euiTheme.colors.emptyShade, 1) : (0, _services.tint)(euiTheme.colors.fullShade, 0.25);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.euiToolTipBackgroundColor = euiToolTipBackgroundColor;
|
|
27
|
+
|
|
28
|
+
var euiToolTipBorderColor = function euiToolTipBorderColor(euiTheme, colorMode) {
|
|
29
|
+
return colorMode === _services.COLOR_MODES_STANDARD.dark ? (0, _services.shade)(euiTheme.colors.fullShade, 0.8) : (0, _services.tint)(euiTheme.colors.fullShade, 0.35);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.euiToolTipBorderColor = euiToolTipBorderColor;
|
|
33
|
+
|
|
34
|
+
var euiToolTipAnimationVertical = function euiToolTipAnimationVertical(size) {
|
|
35
|
+
return (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateY(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])), size);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var euiToolTipAnimationHorizontal = function euiToolTipAnimationHorizontal(size) {
|
|
39
|
+
return (0, _react.keyframes)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateX(0);\n }\n"])), size);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
43
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
44
|
+
colorMode = euiThemeContext.colorMode;
|
|
45
|
+
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards");
|
|
46
|
+
/*
|
|
47
|
+
* 1. Shift arrow 1px more than half its size to account for border radius
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
var arrowSize = euiTheme.size.m;
|
|
51
|
+
var arrowSizeInt = parseInt(arrowSize, 10);
|
|
52
|
+
var arrowPlusSize = "".concat((arrowSizeInt / 2 + 1) * -1, "px");
|
|
53
|
+
/* 1 */
|
|
54
|
+
|
|
55
|
+
var arrowMinusSize = "".concat((arrowSizeInt / 2 - 1) * -1, "px");
|
|
56
|
+
/* 1 */
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
// Base
|
|
60
|
+
euiToolTip: /*#__PURE__*/(0, _react.css)((0, _amsterdam.euiShadow)(euiThemeContext), ";border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";color:", euiTheme.colors.ghost, ";z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";position:absolute;[class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme, colorMode), ";};label:euiToolTip;"),
|
|
61
|
+
// Sizes
|
|
62
|
+
s: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";;label:s;"),
|
|
63
|
+
// Positions
|
|
64
|
+
top: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";;label:top;"),
|
|
65
|
+
bottom: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";[class*='euiToolTip__arrow']{transform:translateY(", arrowMinusSize, ") rotateZ(45deg);};label:bottom;"),
|
|
66
|
+
left: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";[class*='euiToolTip__arrow']{transform:translateX(", arrowPlusSize, ") rotateZ(45deg);};label:left;"),
|
|
67
|
+
right: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";[class*='euiToolTip__arrow']{transform:translateX(", arrowMinusSize, ") rotateZ(45deg);};label:right;"),
|
|
68
|
+
// Elements
|
|
69
|
+
euiToolTip__arrow: /*#__PURE__*/(0, _react.css)("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", (0, _global_styling.logicalSizeCSS)(arrowSize, arrowSize), ";transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:euiToolTip__arrow;")
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.euiToolTipStyles = euiToolTipStyles;
|
|
74
|
+
|
|
75
|
+
var euiToolTipPopoverStyles = function euiToolTipPopoverStyles(_ref4) {
|
|
76
|
+
var euiTheme = _ref4.euiTheme,
|
|
77
|
+
colorMode = _ref4.colorMode;
|
|
78
|
+
return {
|
|
79
|
+
// Elements
|
|
80
|
+
euiToolTip__title: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.bold, ";", (0, _global_styling.logicalCSS)('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme, colorMode))), ";", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), ";", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;")
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
exports.euiToolTipPopoverStyles = euiToolTipPopoverStyles;
|
|
85
|
+
|
|
86
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
87
|
+
name: "fzilnk-inlineBlock",
|
|
88
|
+
styles: "display:inline-block;label:inlineBlock;"
|
|
89
|
+
} : {
|
|
90
|
+
name: "fzilnk-inlineBlock",
|
|
91
|
+
styles: "display:inline-block;label:inlineBlock;",
|
|
92
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
96
|
+
name: "14aceuy-block",
|
|
97
|
+
styles: "display:block;label:block;"
|
|
98
|
+
} : {
|
|
99
|
+
name: "14aceuy-block",
|
|
100
|
+
styles: "display:block;label:block;",
|
|
101
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
105
|
+
name: "1s3i3p5-euiToolTipAnchor",
|
|
106
|
+
styles: "*[disabled]{pointer-events:none;};label:euiToolTipAnchor;"
|
|
107
|
+
} : {
|
|
108
|
+
name: "1s3i3p5-euiToolTipAnchor",
|
|
109
|
+
styles: "*[disabled]{pointer-events:none;};label:euiToolTipAnchor;",
|
|
110
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var euiToolTipAnchorStyles = function euiToolTipAnchorStyles() {
|
|
114
|
+
return {
|
|
115
|
+
// Elements
|
|
116
|
+
euiToolTipAnchor: _ref3,
|
|
117
|
+
// Variants
|
|
118
|
+
block: _ref2,
|
|
119
|
+
inlineBlock: _ref
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
exports.euiToolTipAnchorStyles = euiToolTipAnchorStyles;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.EuiToolTipAnchor = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _tool_tip = require("./tool_tip.styles");
|
|
17
|
+
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
|
+
|
|
20
|
+
var _excluded = ["onBlur", "onFocus", "onMouseOver", "onMouseOut", "id", "className", "children", "display", "isVisible"];
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
37
|
+
|
|
38
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
39
|
+
|
|
40
|
+
var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
41
|
+
var _onBlur = _ref.onBlur,
|
|
42
|
+
_onFocus = _ref.onFocus,
|
|
43
|
+
onMouseOver = _ref.onMouseOver,
|
|
44
|
+
onMouseOut = _ref.onMouseOut,
|
|
45
|
+
id = _ref.id,
|
|
46
|
+
className = _ref.className,
|
|
47
|
+
children = _ref.children,
|
|
48
|
+
display = _ref.display,
|
|
49
|
+
isVisible = _ref.isVisible,
|
|
50
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
|
|
52
|
+
var anchorCss = (0, _tool_tip.euiToolTipAnchorStyles)();
|
|
53
|
+
var cssStyles = [anchorCss.euiToolTipAnchor, anchorCss[display]];
|
|
54
|
+
var classes = (0, _classnames.default)('euiToolTipAnchor', className);
|
|
55
|
+
return (// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
56
|
+
(0, _react2.jsx)("span", _extends({
|
|
57
|
+
ref: ref
|
|
58
|
+
}, rest, {
|
|
59
|
+
css: cssStyles,
|
|
60
|
+
className: classes,
|
|
61
|
+
onMouseOver: onMouseOver,
|
|
62
|
+
onMouseOut: onMouseOut
|
|
63
|
+
}), /*#__PURE__*/(0, _react.cloneElement)(children, _objectSpread({
|
|
64
|
+
onFocus: function onFocus(e) {
|
|
65
|
+
_onFocus();
|
|
66
|
+
|
|
67
|
+
children.props.onFocus && children.props.onFocus(e);
|
|
68
|
+
},
|
|
69
|
+
onBlur: function onBlur(e) {
|
|
70
|
+
_onBlur();
|
|
71
|
+
|
|
72
|
+
children.props.onBlur && children.props.onBlur(e);
|
|
73
|
+
}
|
|
74
|
+
}, isVisible && {
|
|
75
|
+
'aria-describedby': id
|
|
76
|
+
})))
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
exports.EuiToolTipAnchor = EuiToolTipAnchor;
|
|
80
|
+
EuiToolTipAnchor.propTypes = {
|
|
81
|
+
onBlur: _propTypes.default.func.isRequired,
|
|
82
|
+
onFocus: _propTypes.default.func.isRequired,
|
|
83
|
+
children: _propTypes.default.element.isRequired,
|
|
84
|
+
isVisible: _propTypes.default.bool.isRequired,
|
|
85
|
+
display: _propTypes.default.oneOf(["block", "inlineBlock"]).isRequired
|
|
86
|
+
};
|
|
87
|
+
EuiToolTipAnchor.displayName = 'EuiToolTipAnchor';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EuiToolTipArrow = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _services = require("../../services");
|
|
11
|
+
|
|
12
|
+
var _tool_tip = require("./tool_tip.styles");
|
|
13
|
+
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
var EuiToolTipArrow = function EuiToolTipArrow(props) {
|
|
21
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
22
|
+
var toolTipCss = (0, _tool_tip.euiToolTipStyles)(euiTheme);
|
|
23
|
+
return (0, _react2.jsx)("div", _extends({
|
|
24
|
+
css: [toolTipCss.euiToolTip__arrow, ";label:EuiToolTipArrow;"]
|
|
25
|
+
}, props));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.EuiToolTipArrow = EuiToolTipArrow;
|