@elastic/eui 72.1.0 → 73.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/CHANGELOG.md +6185 -0
- package/dist/eui_theme_dark.css +15 -15
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +15 -15
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +1 -1
- package/es/components/datagrid/controls/column_selector.js +23 -7
- package/es/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/es/components/datagrid/data_grid.a11y.js +3 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/es/components/image/image.js +9 -2
- package/es/components/image/image_fullscreen_wrapper.js +3 -1
- package/es/components/image/image_wrapper.js +3 -1
- package/es/components/markdown_editor/markdown_format.styles.js +2 -5
- package/es/components/notification/notification_event.a11y.js +113 -0
- package/es/components/page/page_header/page_header.a11y.js +32 -0
- package/es/components/portal/portal.a11y.js +70 -0
- package/es/components/text/text.styles.js +6 -3
- package/es/components/tool_tip/icon_tip.js +8 -0
- package/es/components/tool_tip/tool_tip.js +34 -6
- package/es/components/tool_tip/tool_tip_manager.js +42 -0
- package/es/components/tour/tour.styles.js +1 -1
- package/eui.d.ts +23 -1
- package/i18ntokens.json +36 -20
- package/lib/components/accordion/accordion.js +1 -1
- package/lib/components/datagrid/controls/column_selector.js +21 -6
- package/lib/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/lib/components/datagrid/data_grid.a11y.js +3 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/lib/components/image/image.js +9 -2
- package/lib/components/image/image_fullscreen_wrapper.js +3 -1
- package/lib/components/image/image_wrapper.js +3 -1
- package/lib/components/markdown_editor/markdown_format.styles.js +1 -4
- package/lib/components/notification/notification_event.a11y.js +117 -0
- package/lib/components/page/page_header/page_header.a11y.js +40 -0
- package/lib/components/portal/portal.a11y.js +73 -0
- package/lib/components/text/text.styles.js +5 -2
- package/lib/components/tool_tip/icon_tip.js +8 -0
- package/lib/components/tool_tip/tool_tip.js +37 -8
- package/lib/components/tool_tip/tool_tip_manager.js +50 -0
- package/lib/components/tour/tour.styles.js +1 -1
- package/optimize/es/components/accordion/accordion.js +1 -1
- package/optimize/es/components/datagrid/controls/column_selector.js +22 -7
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/optimize/es/components/datagrid/data_grid.a11y.js +3 -2
- package/optimize/es/components/image/image.js +4 -2
- package/optimize/es/components/image/image_fullscreen_wrapper.js +3 -1
- package/optimize/es/components/image/image_wrapper.js +3 -1
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +2 -5
- package/optimize/es/components/notification/notification_event.a11y.js +103 -0
- package/optimize/es/components/page/page_header/page_header.a11y.js +32 -0
- package/optimize/es/components/portal/portal.a11y.js +60 -0
- package/optimize/es/components/text/text.styles.js +6 -3
- package/optimize/es/components/tool_tip/tool_tip.js +26 -6
- package/optimize/es/components/tool_tip/tool_tip_manager.js +41 -0
- package/optimize/es/components/tour/tour.styles.js +1 -1
- package/optimize/lib/components/accordion/accordion.js +1 -1
- package/optimize/lib/components/datagrid/controls/column_selector.js +21 -6
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/optimize/lib/components/datagrid/data_grid.a11y.js +3 -2
- package/optimize/lib/components/image/image.js +4 -2
- package/optimize/lib/components/image/image_fullscreen_wrapper.js +3 -1
- package/optimize/lib/components/image/image_wrapper.js +3 -1
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +1 -4
- package/optimize/lib/components/notification/notification_event.a11y.js +117 -0
- package/optimize/lib/components/page/page_header/page_header.a11y.js +40 -0
- package/optimize/lib/components/portal/portal.a11y.js +73 -0
- package/optimize/lib/components/text/text.styles.js +5 -2
- package/optimize/lib/components/tool_tip/tool_tip.js +29 -8
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +49 -0
- package/optimize/lib/components/tour/tour.styles.js +1 -1
- package/package.json +2 -2
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +14 -13
- package/src/components/date_picker/react-datepicker/LICENSE +21 -0
- package/src/components/date_picker/react-datepicker/README.md +168 -0
- package/src/components/markdown_editor/_markdown_format.scss +0 -4
- package/src/services/theme/README.md +153 -0
- package/src/test/README.md +59 -0
- package/test-env/components/accordion/accordion.js +1 -1
- package/test-env/components/datagrid/controls/column_selector.js +21 -6
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/test-env/components/datagrid/data_grid.a11y.js +3 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/test-env/components/image/image.js +9 -2
- package/test-env/components/image/image_fullscreen_wrapper.js +3 -1
- package/test-env/components/image/image_wrapper.js +3 -1
- package/test-env/components/markdown_editor/markdown_format.styles.js +1 -4
- package/test-env/components/notification/notification_event.a11y.js +117 -0
- package/test-env/components/page/page_header/page_header.a11y.js +40 -0
- package/test-env/components/portal/portal.a11y.js +73 -0
- package/test-env/components/text/text.styles.js +5 -2
- package/test-env/components/tool_tip/icon_tip.js +8 -0
- package/test-env/components/tool_tip/tool_tip.js +37 -8
- package/test-env/components/tool_tip/tool_tip_manager.js +49 -0
- package/test-env/components/tour/tour.styles.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
|
|
3
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
4
4
|
|
|
5
5
|
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); }
|
|
6
6
|
|
|
@@ -41,13 +41,14 @@ import React, { Component } from 'react';
|
|
|
41
41
|
import PropTypes from "prop-types";
|
|
42
42
|
import classNames from 'classnames';
|
|
43
43
|
import { keysOf } from '../common';
|
|
44
|
+
import { findPopoverPosition, htmlIdGenerator } from '../../services';
|
|
45
|
+
import { enqueueStateChange } from '../../services/react';
|
|
46
|
+
import { EuiResizeObserver } from '../observer/resize_observer';
|
|
44
47
|
import { EuiPortal } from '../portal';
|
|
48
|
+
import { EuiToolTipPopover } from './tool_tip_popover';
|
|
45
49
|
import { EuiToolTipAnchor } from './tool_tip_anchor';
|
|
46
50
|
import { EuiToolTipArrow } from './tool_tip_arrow';
|
|
47
|
-
import {
|
|
48
|
-
import { enqueueStateChange } from '../../services/react';
|
|
49
|
-
import { findPopoverPosition, htmlIdGenerator } from '../../services';
|
|
50
|
-
import { EuiResizeObserver } from '../observer/resize_observer';
|
|
51
|
+
import { toolTipManager } from './tool_tip_manager';
|
|
51
52
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
52
53
|
var positionsToClassNameMap = {
|
|
53
54
|
top: 'euiToolTip--top',
|
|
@@ -142,9 +143,11 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
142
143
|
if (!_this.timeoutId) {
|
|
143
144
|
_this.timeoutId = setTimeout(function () {
|
|
144
145
|
enqueueStateChange(function () {
|
|
145
|
-
|
|
146
|
+
_this.setState({
|
|
146
147
|
visible: true
|
|
147
148
|
});
|
|
149
|
+
|
|
150
|
+
toolTipManager.registerTooltip(_this.hideToolTip);
|
|
148
151
|
});
|
|
149
152
|
}, delayToMsMap[_this.props.delay]);
|
|
150
153
|
}
|
|
@@ -205,6 +208,8 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
205
208
|
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
206
209
|
arrowStyles: undefined
|
|
207
210
|
});
|
|
211
|
+
|
|
212
|
+
toolTipManager.deregisterToolTip(_this.hideToolTip);
|
|
208
213
|
}
|
|
209
214
|
});
|
|
210
215
|
});
|
|
@@ -246,18 +251,32 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
246
251
|
key: "componentDidMount",
|
|
247
252
|
value: function componentDidMount() {
|
|
248
253
|
this._isMounted = true;
|
|
254
|
+
|
|
255
|
+
if (this.props.repositionOnScroll) {
|
|
256
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
257
|
+
}
|
|
249
258
|
}
|
|
250
259
|
}, {
|
|
251
260
|
key: "componentWillUnmount",
|
|
252
261
|
value: function componentWillUnmount() {
|
|
253
262
|
this.clearAnimationTimeout();
|
|
254
263
|
this._isMounted = false;
|
|
264
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
255
265
|
}
|
|
256
266
|
}, {
|
|
257
267
|
key: "componentDidUpdate",
|
|
258
268
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
259
269
|
if (prevState.visible === false && this.state.visible === true) {
|
|
260
270
|
requestAnimationFrame(this.testAnchor);
|
|
271
|
+
} // update scroll listener
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
275
|
+
if (this.props.repositionOnScroll) {
|
|
276
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
277
|
+
} else {
|
|
278
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
279
|
+
}
|
|
261
280
|
}
|
|
262
281
|
}
|
|
263
282
|
}, {
|
|
@@ -272,6 +291,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
272
291
|
title = _this$props.title,
|
|
273
292
|
delay = _this$props.delay,
|
|
274
293
|
display = _this$props.display,
|
|
294
|
+
repositionOnScroll = _this$props.repositionOnScroll,
|
|
275
295
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
276
296
|
|
|
277
297
|
var _this$state = this.state,
|
|
@@ -380,6 +400,14 @@ EuiToolTip.propTypes = {
|
|
|
380
400
|
*/
|
|
381
401
|
position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
382
402
|
|
|
403
|
+
/**
|
|
404
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
405
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
406
|
+
*
|
|
407
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
408
|
+
*/
|
|
409
|
+
repositionOnScroll: PropTypes.bool,
|
|
410
|
+
|
|
383
411
|
/**
|
|
384
412
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
385
413
|
* hidden.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
8
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
9
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
10
|
+
* Side Public License, v 1.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Manager utility that ensures only one tooltip is visible at a time
|
|
15
|
+
*
|
|
16
|
+
* UX rationale (primarily for mouse-only users):
|
|
17
|
+
* @see https://github.com/elastic/kibana/issues/144482
|
|
18
|
+
* @see https://github.com/elastic/eui/issues/5883
|
|
19
|
+
*/
|
|
20
|
+
var ToolTipManager = function ToolTipManager() {
|
|
21
|
+
var _this = this;
|
|
22
|
+
|
|
23
|
+
_classCallCheck(this, ToolTipManager);
|
|
24
|
+
|
|
25
|
+
_defineProperty(this, "toolTipsToHide", new Set());
|
|
26
|
+
|
|
27
|
+
_defineProperty(this, "registerTooltip", function (hideCallback) {
|
|
28
|
+
_this.toolTipsToHide.forEach(function (hide) {
|
|
29
|
+
return hide();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
_this.toolTipsToHide.clear();
|
|
33
|
+
|
|
34
|
+
_this.toolTipsToHide.add(hideCallback);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
_defineProperty(this, "deregisterToolTip", function (hideCallback) {
|
|
38
|
+
_this.toolTipsToHide.delete(hideCallback);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export var toolTipManager = new ToolTipManager();
|
|
@@ -50,7 +50,7 @@ export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
|
|
|
50
50
|
euiTourHeader: /*#__PURE__*/css(logicalCSS('border-bottom', 'none'), ";", logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
|
|
51
51
|
// Elements
|
|
52
52
|
euiTourHeader__title: /*#__PURE__*/css(logicalCSS('margin-top', 0), ";;label:euiTourHeader__title;"),
|
|
53
|
-
euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:euiTourHeader__subtitle;")
|
|
53
|
+
euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
export var euiTourFooterStyles = function euiTourFooterStyles(_ref4) {
|
package/eui.d.ts
CHANGED
|
@@ -5695,6 +5695,16 @@ declare module '@elastic/eui/src/components/tool_tip/tool_tip_arrow' {
|
|
|
5695
5695
|
position: ToolTipPositions;
|
|
5696
5696
|
} & HTMLAttributes<HTMLDivElement>>;
|
|
5697
5697
|
|
|
5698
|
+
}
|
|
5699
|
+
declare module '@elastic/eui/src/components/tool_tip/tool_tip_manager' {
|
|
5700
|
+
class ToolTipManager {
|
|
5701
|
+
toolTipsToHide: Set<Function>;
|
|
5702
|
+
registerTooltip: (hideCallback: Function) => void;
|
|
5703
|
+
deregisterToolTip: (hideCallback: Function) => void;
|
|
5704
|
+
}
|
|
5705
|
+
export const toolTipManager: ToolTipManager;
|
|
5706
|
+
export {};
|
|
5707
|
+
|
|
5698
5708
|
}
|
|
5699
5709
|
declare module '@elastic/eui/src/components/tool_tip/tool_tip' {
|
|
5700
5710
|
import { Component, ReactElement, ReactNode, MouseEvent as ReactMouseEvent, HTMLAttributes } from 'react';
|
|
@@ -5753,6 +5763,13 @@ declare module '@elastic/eui/src/components/tool_tip/tool_tip' {
|
|
|
5753
5763
|
* Suggested position. If there is not enough room for it this will be changed.
|
|
5754
5764
|
*/
|
|
5755
5765
|
position: ToolTipPositions;
|
|
5766
|
+
/**
|
|
5767
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
5768
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
5769
|
+
*
|
|
5770
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
5771
|
+
*/
|
|
5772
|
+
repositionOnScroll?: boolean;
|
|
5756
5773
|
/**
|
|
5757
5774
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
5758
5775
|
* hidden.
|
|
@@ -15123,6 +15140,10 @@ declare module '@elastic/eui/src/components/image/image_types' {
|
|
|
15123
15140
|
* When set to `true` will make the image clickable to a larger version
|
|
15124
15141
|
*/
|
|
15125
15142
|
allowFullScreen?: boolean;
|
|
15143
|
+
/**
|
|
15144
|
+
* Callback when the image is clicked and `allowFullScreen` is `true`
|
|
15145
|
+
*/
|
|
15146
|
+
onFullScreen?: (isFullScreen: boolean) => void;
|
|
15126
15147
|
/**
|
|
15127
15148
|
* Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
|
|
15128
15149
|
* The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
|
|
@@ -15133,7 +15154,7 @@ declare module '@elastic/eui/src/components/image/image_types' {
|
|
|
15133
15154
|
*/
|
|
15134
15155
|
wrapperProps?: CommonProps & HTMLAttributes<HTMLDivElement>;
|
|
15135
15156
|
};
|
|
15136
|
-
export type EuiImageWrapperProps = Pick<EuiImageProps, 'alt' | 'caption' | 'float' | 'margin' | 'hasShadow' | 'wrapperProps' | 'fullScreenIconColor' | 'allowFullScreen'> & {
|
|
15157
|
+
export type EuiImageWrapperProps = Pick<EuiImageProps, 'alt' | 'caption' | 'float' | 'margin' | 'hasShadow' | 'wrapperProps' | 'fullScreenIconColor' | 'allowFullScreen' | 'onFullScreen'> & {
|
|
15137
15158
|
isFullWidth: boolean;
|
|
15138
15159
|
setIsFullScreen: (isFullScreen: boolean) => void;
|
|
15139
15160
|
};
|
|
@@ -25744,6 +25765,7 @@ declare module '@elastic/eui' {
|
|
|
25744
25765
|
"euiDataGridHeaderCell.sortedByAscendingMultiple": any;
|
|
25745
25766
|
"euiDataGridHeaderCell.sortedByDescendingMultiple": any;
|
|
25746
25767
|
"euiDataGridHeaderCell.actionsPopoverScreenReaderText": any;
|
|
25768
|
+
"euiColumnSelector.dragHandleAriaLabel": any;
|
|
25747
25769
|
"euiColumnSelector.button": any;
|
|
25748
25770
|
"euiColumnSelector.buttonActiveSingular": any;
|
|
25749
25771
|
"euiColumnSelector.buttonActivePlural": any;
|
package/i18ntokens.json
CHANGED
|
@@ -1071,17 +1071,33 @@
|
|
|
1071
1071
|
},
|
|
1072
1072
|
"filepath": "src/components/datagrid/body/header/data_grid_header_cell.tsx"
|
|
1073
1073
|
},
|
|
1074
|
+
{
|
|
1075
|
+
"token": "euiColumnSelector.dragHandleAriaLabel",
|
|
1076
|
+
"defString": "Drag handle",
|
|
1077
|
+
"highlighting": "string",
|
|
1078
|
+
"loc": {
|
|
1079
|
+
"start": {
|
|
1080
|
+
"line": 119,
|
|
1081
|
+
"column": 30
|
|
1082
|
+
},
|
|
1083
|
+
"end": {
|
|
1084
|
+
"line": 122,
|
|
1085
|
+
"column": 3
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
"filepath": "src/components/datagrid/controls/column_selector.tsx"
|
|
1089
|
+
},
|
|
1074
1090
|
{
|
|
1075
1091
|
"token": "euiColumnSelector.button",
|
|
1076
1092
|
"defString": "Columns",
|
|
1077
1093
|
"highlighting": "string",
|
|
1078
1094
|
"loc": {
|
|
1079
1095
|
"start": {
|
|
1080
|
-
"line":
|
|
1096
|
+
"line": 125,
|
|
1081
1097
|
"column": 4
|
|
1082
1098
|
},
|
|
1083
1099
|
"end": {
|
|
1084
|
-
"line":
|
|
1100
|
+
"line": 125,
|
|
1085
1101
|
"column": 66
|
|
1086
1102
|
}
|
|
1087
1103
|
},
|
|
@@ -1093,11 +1109,11 @@
|
|
|
1093
1109
|
"highlighting": "string",
|
|
1094
1110
|
"loc": {
|
|
1095
1111
|
"start": {
|
|
1096
|
-
"line":
|
|
1112
|
+
"line": 130,
|
|
1097
1113
|
"column": 6
|
|
1098
1114
|
},
|
|
1099
1115
|
"end": {
|
|
1100
|
-
"line":
|
|
1116
|
+
"line": 134,
|
|
1101
1117
|
"column": 8
|
|
1102
1118
|
}
|
|
1103
1119
|
},
|
|
@@ -1109,11 +1125,11 @@
|
|
|
1109
1125
|
"highlighting": "string",
|
|
1110
1126
|
"loc": {
|
|
1111
1127
|
"start": {
|
|
1112
|
-
"line":
|
|
1128
|
+
"line": 138,
|
|
1113
1129
|
"column": 6
|
|
1114
1130
|
},
|
|
1115
1131
|
"end": {
|
|
1116
|
-
"line":
|
|
1132
|
+
"line": 142,
|
|
1117
1133
|
"column": 8
|
|
1118
1134
|
}
|
|
1119
1135
|
},
|
|
@@ -1125,11 +1141,11 @@
|
|
|
1125
1141
|
"highlighting": "string",
|
|
1126
1142
|
"loc": {
|
|
1127
1143
|
"start": {
|
|
1128
|
-
"line":
|
|
1144
|
+
"line": 171,
|
|
1129
1145
|
"column": 14
|
|
1130
1146
|
},
|
|
1131
1147
|
"end": {
|
|
1132
|
-
"line":
|
|
1148
|
+
"line": 177,
|
|
1133
1149
|
"column": 15
|
|
1134
1150
|
}
|
|
1135
1151
|
},
|
|
@@ -1141,11 +1157,11 @@
|
|
|
1141
1157
|
"highlighting": "string",
|
|
1142
1158
|
"loc": {
|
|
1143
1159
|
"start": {
|
|
1144
|
-
"line":
|
|
1160
|
+
"line": 171,
|
|
1145
1161
|
"column": 14
|
|
1146
1162
|
},
|
|
1147
1163
|
"end": {
|
|
1148
|
-
"line":
|
|
1164
|
+
"line": 177,
|
|
1149
1165
|
"column": 15
|
|
1150
1166
|
}
|
|
1151
1167
|
},
|
|
@@ -1157,11 +1173,11 @@
|
|
|
1157
1173
|
"highlighting": "string",
|
|
1158
1174
|
"loc": {
|
|
1159
1175
|
"start": {
|
|
1160
|
-
"line":
|
|
1176
|
+
"line": 293,
|
|
1161
1177
|
"column": 18
|
|
1162
1178
|
},
|
|
1163
1179
|
"end": {
|
|
1164
|
-
"line":
|
|
1180
|
+
"line": 296,
|
|
1165
1181
|
"column": 20
|
|
1166
1182
|
}
|
|
1167
1183
|
},
|
|
@@ -1173,11 +1189,11 @@
|
|
|
1173
1189
|
"highlighting": "string",
|
|
1174
1190
|
"loc": {
|
|
1175
1191
|
"start": {
|
|
1176
|
-
"line":
|
|
1192
|
+
"line": 306,
|
|
1177
1193
|
"column": 18
|
|
1178
1194
|
},
|
|
1179
1195
|
"end": {
|
|
1180
|
-
"line":
|
|
1196
|
+
"line": 309,
|
|
1181
1197
|
"column": 20
|
|
1182
1198
|
}
|
|
1183
1199
|
},
|
|
@@ -1237,11 +1253,11 @@
|
|
|
1237
1253
|
"highlighting": "string",
|
|
1238
1254
|
"loc": {
|
|
1239
1255
|
"start": {
|
|
1240
|
-
"line":
|
|
1256
|
+
"line": 85,
|
|
1241
1257
|
"column": 14
|
|
1242
1258
|
},
|
|
1243
1259
|
"end": {
|
|
1244
|
-
"line":
|
|
1260
|
+
"line": 89,
|
|
1245
1261
|
"column": 15
|
|
1246
1262
|
}
|
|
1247
1263
|
},
|
|
@@ -1253,11 +1269,11 @@
|
|
|
1253
1269
|
"highlighting": "string",
|
|
1254
1270
|
"loc": {
|
|
1255
1271
|
"start": {
|
|
1256
|
-
"line":
|
|
1272
|
+
"line": 101,
|
|
1257
1273
|
"column": 14
|
|
1258
1274
|
},
|
|
1259
1275
|
"end": {
|
|
1260
|
-
"line":
|
|
1276
|
+
"line": 105,
|
|
1261
1277
|
"column": 15
|
|
1262
1278
|
}
|
|
1263
1279
|
},
|
|
@@ -1269,11 +1285,11 @@
|
|
|
1269
1285
|
"highlighting": "string",
|
|
1270
1286
|
"loc": {
|
|
1271
1287
|
"start": {
|
|
1272
|
-
"line":
|
|
1288
|
+
"line": 157,
|
|
1273
1289
|
"column": 14
|
|
1274
1290
|
},
|
|
1275
1291
|
"end": {
|
|
1276
|
-
"line":
|
|
1292
|
+
"line": 161,
|
|
1277
1293
|
"column": 15
|
|
1278
1294
|
}
|
|
1279
1295
|
},
|
|
@@ -260,7 +260,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
260
260
|
css: cssSpinnerStyles
|
|
261
261
|
}), (0, _react2.jsx)(_text.EuiText, {
|
|
262
262
|
size: "s"
|
|
263
|
-
}, (0, _react2.jsx)("p", null, isLoadingMessage
|
|
263
|
+
}, (0, _react2.jsx)("p", null, isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
264
264
|
token: "euiAccordion.isLoading",
|
|
265
265
|
default: "Loading"
|
|
266
266
|
}))));
|
|
@@ -45,6 +45,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
45
45
|
|
|
46
46
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
47
|
|
|
48
|
+
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); }
|
|
49
|
+
|
|
48
50
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
51
|
|
|
50
52
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -116,6 +118,7 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
116
118
|
}, [sortedColumns, columnSearchText, displayValues]);
|
|
117
119
|
var isDragEnabled = allowColumnReorder && columnSearchText.length === 0; // only allow drag-and-drop when not filtering columns
|
|
118
120
|
|
|
121
|
+
var dragHandleAriaLabel = (0, _i18n.useEuiI18n)('euiColumnSelector.dragHandleAriaLabel', 'Drag handle');
|
|
119
122
|
var buttonText = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
120
123
|
token: "euiColumnSelector.button",
|
|
121
124
|
default: "Columns"
|
|
@@ -188,18 +191,23 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
188
191
|
key: id,
|
|
189
192
|
draggableId: id,
|
|
190
193
|
index: index,
|
|
191
|
-
isDragDisabled: !isDragEnabled
|
|
194
|
+
isDragDisabled: !isDragEnabled,
|
|
195
|
+
hasInteractiveChildren: true,
|
|
196
|
+
customDragHandle: true
|
|
192
197
|
}, function (provided, state) {
|
|
193
198
|
return (0, _react2.jsx)("div", {
|
|
194
199
|
className: "euiDataGridColumnSelector__item ".concat(state.isDragging && 'euiDataGridColumnSelector__item-isDragging'),
|
|
195
200
|
"data-test-subj": "dataGridColumnSelectorColumnItem-".concat(id)
|
|
196
201
|
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
197
202
|
responsive: false,
|
|
198
|
-
gutterSize: "
|
|
203
|
+
gutterSize: "s",
|
|
199
204
|
alignItems: "center"
|
|
200
|
-
},
|
|
205
|
+
}, allowColumnHiding && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
206
|
+
grow: false
|
|
207
|
+
}, (0, _react2.jsx)(_form.EuiSwitch, {
|
|
201
208
|
name: id,
|
|
202
209
|
label: displayValues[id] || id,
|
|
210
|
+
showLabel: false,
|
|
203
211
|
checked: visibleColumnIds.has(id),
|
|
204
212
|
compressed: true,
|
|
205
213
|
className: "euiSwitch--mini",
|
|
@@ -211,11 +219,18 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
211
219
|
setVisibleColumns(nextVisibleColumns);
|
|
212
220
|
},
|
|
213
221
|
"data-test-subj": "dataGridColumnSelectorToggleColumnVisibility-".concat(id)
|
|
214
|
-
})
|
|
222
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem // This extra column name flex item affords the column more grabbable real estate
|
|
223
|
+
// for mouse users, while hiding repetition for keyboard/screen reader users
|
|
224
|
+
, _extends({}, provided.dragHandleProps, {
|
|
225
|
+
"aria-hidden": true,
|
|
226
|
+
tabIndex: -1
|
|
227
|
+
}), (0, _react2.jsx)("span", {
|
|
215
228
|
className: "euiDataGridColumnSelector__itemLabel"
|
|
216
|
-
}, id)), isDragEnabled && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
229
|
+
}, displayValues[id] || id)), isDragEnabled && (0, _react2.jsx)(_flex.EuiFlexItem, _extends({
|
|
217
230
|
grow: false
|
|
218
|
-
},
|
|
231
|
+
}, provided.dragHandleProps, {
|
|
232
|
+
"aria-label": dragHandleAriaLabel
|
|
233
|
+
}), (0, _react2.jsx)(_icon.EuiIcon, {
|
|
219
234
|
type: "grab",
|
|
220
235
|
color: "subdued"
|
|
221
236
|
}))));
|
|
@@ -89,7 +89,9 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
89
89
|
var dragHandleAriaLabel = (0, _i18n.useEuiI18n)('euiColumnSortingDraggable.dragHandleAriaLabel', 'Drag handle');
|
|
90
90
|
return (0, _react2.jsx)(_drag_and_drop.EuiDraggable, _extends({
|
|
91
91
|
draggableId: id,
|
|
92
|
-
index: index
|
|
92
|
+
index: index,
|
|
93
|
+
hasInteractiveChildren: true,
|
|
94
|
+
customDragHandle: true
|
|
93
95
|
}, rest), function (provided, state) {
|
|
94
96
|
return (0, _react2.jsx)("div", {
|
|
95
97
|
className: "euiDataGridColumnSorting__item ".concat(state.isDragging && 'euiDataGridColumnSorting__item-isDragging')
|
|
@@ -131,18 +133,25 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
131
133
|
sorting.onSort(nextColumns);
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
|
-
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
136
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, _extends({
|
|
137
|
+
className: "euiDataGridColumnSorting__name" // This extra column name flex item affords the column more grabbable real estate
|
|
138
|
+
// for mouse users, while hiding repetition for keyboard/screen reader users
|
|
139
|
+
|
|
140
|
+
}, provided.dragHandleProps, {
|
|
141
|
+
tabIndex: -1,
|
|
142
|
+
"aria-hidden": true
|
|
143
|
+
}), (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
144
|
+
gutterSize: "xs",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
responsive: false
|
|
147
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
135
148
|
grow: false
|
|
136
149
|
}, (0, _react2.jsx)(_token.EuiToken, {
|
|
137
150
|
color: schemaDetails != null ? schemaDetails.color : undefined,
|
|
138
151
|
iconType: schemaDetails != null ? schemaDetails.icon : 'tokenString'
|
|
139
|
-
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
140
|
-
"aria-hidden": true
|
|
141
|
-
}, (0, _react2.jsx)(_text.EuiText, {
|
|
152
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_text.EuiText, {
|
|
142
153
|
size: "xs"
|
|
143
|
-
}, (0, _react2.jsx)("p", null, display))), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
144
|
-
className: "euiDataGridColumnSorting__orderButtons"
|
|
145
|
-
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
154
|
+
}, (0, _react2.jsx)("p", null, display))))), (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
146
155
|
token: "euiColumnSortingDraggable.toggleLegend",
|
|
147
156
|
default: "Select sorting method for {display}",
|
|
148
157
|
values: {
|
|
@@ -188,7 +188,7 @@ describe('EuiDataGrid', function () {
|
|
|
188
188
|
it('has zero violations on first render', function () {
|
|
189
189
|
cy.checkAxe();
|
|
190
190
|
});
|
|
191
|
-
it('has zero violations when the columns
|
|
191
|
+
it('has zero violations when the columns visibility menu is open', function () {
|
|
192
192
|
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
193
193
|
cy.checkAxe();
|
|
194
194
|
});
|
|
@@ -241,9 +241,10 @@ describe('EuiDataGrid', function () {
|
|
|
241
241
|
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').find('button.euiButtonIcon').last().realClick();
|
|
242
242
|
cy.checkAxe();
|
|
243
243
|
});
|
|
244
|
-
it('has zero violations when the
|
|
244
|
+
it('has zero violations on sort and when the columns sorting menu is open', function () {
|
|
245
245
|
cy.get('button.euiDataGridHeaderCell__button').last().realClick();
|
|
246
246
|
cy.get('button.euiListGroupItem__button').contains('Sort Alma to Debian').should('exist').realClick();
|
|
247
|
+
cy.get('button[data-test-subj="dataGridColumnSortingPopover"]').realClick();
|
|
247
248
|
cy.checkAxe();
|
|
248
249
|
});
|
|
249
250
|
it('has zero violations when fullscreen is open', function () {
|
|
@@ -717,6 +717,14 @@ EuiSuperDatePickerInternal.propTypes = {
|
|
|
717
717
|
*/
|
|
718
718
|
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
719
719
|
|
|
720
|
+
/**
|
|
721
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
722
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
723
|
+
*
|
|
724
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
725
|
+
*/
|
|
726
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
727
|
+
|
|
720
728
|
/**
|
|
721
729
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
722
730
|
* hidden.
|
|
@@ -888,6 +896,7 @@ EuiSuperDatePicker.propTypes = {
|
|
|
888
896
|
title: _propTypes.default.node,
|
|
889
897
|
id: _propTypes.default.string,
|
|
890
898
|
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
899
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
891
900
|
onMouseOut: _propTypes.default.func
|
|
892
901
|
}),
|
|
893
902
|
iconOnly: _propTypes.default.bool,
|
|
@@ -296,6 +296,14 @@ EuiSuperUpdateButton.propTypes = {
|
|
|
296
296
|
*/
|
|
297
297
|
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
298
298
|
|
|
299
|
+
/**
|
|
300
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
301
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
302
|
+
*
|
|
303
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
304
|
+
*/
|
|
305
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
306
|
+
|
|
299
307
|
/**
|
|
300
308
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
301
309
|
* hidden.
|
|
@@ -25,7 +25,7 @@ var _image_types = require("./image_types");
|
|
|
25
25
|
|
|
26
26
|
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
|
|
28
|
+
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
@@ -72,6 +72,7 @@ var EuiImage = function EuiImage(_ref) {
|
|
|
72
72
|
caption = _ref.caption,
|
|
73
73
|
float = _ref.float,
|
|
74
74
|
margin = _ref.margin,
|
|
75
|
+
onFullScreen = _ref.onFullScreen,
|
|
75
76
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
76
77
|
|
|
77
78
|
var _useState = (0, _react.useState)(false),
|
|
@@ -103,7 +104,8 @@ var EuiImage = function EuiImage(_ref) {
|
|
|
103
104
|
alt: alt,
|
|
104
105
|
caption: caption,
|
|
105
106
|
float: float,
|
|
106
|
-
margin: margin
|
|
107
|
+
margin: margin,
|
|
108
|
+
onFullScreen: onFullScreen
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
var commonImgProps = _objectSpread({
|
|
@@ -177,6 +179,11 @@ EuiImage.propTypes = {
|
|
|
177
179
|
*/
|
|
178
180
|
allowFullScreen: _propTypes.default.bool,
|
|
179
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Callback when the image is clicked and `allowFullScreen` is `true`
|
|
184
|
+
*/
|
|
185
|
+
onFullScreen: _propTypes.default.func,
|
|
186
|
+
|
|
180
187
|
/**
|
|
181
188
|
* Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
|
|
182
189
|
* The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
|
|
@@ -55,7 +55,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
55
55
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
56
56
|
wrapperProps = _ref.wrapperProps,
|
|
57
57
|
isFullWidth = _ref.isFullWidth,
|
|
58
|
-
fullScreenIconColor = _ref.fullScreenIconColor
|
|
58
|
+
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
59
|
+
onFullScreen = _ref.onFullScreen;
|
|
59
60
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
60
61
|
var styles = (0, _image_fullscreen_wrapper.euiImageFullscreenWrapperStyles)(euiTheme);
|
|
61
62
|
var cssStyles = [styles.euiImageFullscreenWrapper];
|
|
@@ -71,6 +72,7 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
71
72
|
|
|
72
73
|
var closeFullScreen = function closeFullScreen() {
|
|
73
74
|
setIsFullScreen(false);
|
|
75
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
var _useInnerText = (0, _inner_text.useInnerText)(),
|
|
@@ -50,10 +50,12 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
|
|
|
50
50
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
51
51
|
wrapperProps = _ref.wrapperProps,
|
|
52
52
|
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
53
|
-
isFullWidth = _ref.isFullWidth
|
|
53
|
+
isFullWidth = _ref.isFullWidth,
|
|
54
|
+
onFullScreen = _ref.onFullScreen;
|
|
54
55
|
|
|
55
56
|
var openFullScreen = function openFullScreen() {
|
|
56
57
|
setIsFullScreen(true);
|
|
58
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
var classes = (0, _classnames.default)('euiImageWrapper', wrapperProps && wrapperProps.className);
|
|
@@ -29,16 +29,13 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
29
29
|
var measurement = options.measurement;
|
|
30
30
|
var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
|
|
31
31
|
|
|
32
|
-
var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
33
|
-
return x / 4;
|
|
34
|
-
});
|
|
35
32
|
var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
36
33
|
return x / 4;
|
|
37
34
|
});
|
|
38
35
|
var tablePaddingHorizontal = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
39
36
|
return x / 2;
|
|
40
37
|
});
|
|
41
|
-
return "\n .
|
|
38
|
+
return "\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
|
|
42
39
|
};
|
|
43
40
|
/**
|
|
44
41
|
* Styles
|