@elastic/eui 109.1.0 → 109.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/basic_table/basic_table.js +4 -1
- package/es/components/breadcrumbs/_breadcrumb_content.js +3 -0
- package/es/components/breadcrumbs/breadcrumbs.js +3 -0
- package/es/components/button/button_group/button_group.styles.js +2 -2
- package/es/components/button/button_group/button_group_button.styles.js +1 -1
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +7 -1
- package/es/components/date_picker/super_date_picker/super_date_picker.js +35 -17
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/es/components/flex/flex_item.js +6 -4
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -0
- package/es/components/header/header_links/header_links.js +3 -0
- package/es/components/page/page_header/page_header_content.js +3 -0
- package/es/components/popover/input_popover.js +4 -1
- package/es/components/popover/popover.js +7 -4
- package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/es/components/table/_table_cell_content.styles.js +4 -4
- package/es/components/table/table.js +16 -3
- package/es/components/table/table.styles.js +2 -1
- package/es/components/table/table_cells_shared.styles.js +4 -1
- package/es/components/table/table_context.js +12 -0
- package/es/components/table/table_footer_cell.js +6 -2
- package/es/components/table/table_row.js +5 -2
- package/es/components/table/table_row.styles.js +22 -6
- package/es/components/table/table_row_cell.styles.js +3 -3
- package/es/components/tool_tip/tool_tip_anchor.js +8 -0
- package/es/components/tour/tour_step.js +9 -3
- package/es/global_styling/mixins/_button.js +4 -3
- package/es/global_styling/mixins/_typography.js +9 -0
- package/eui.d.ts +37 -8
- package/lib/components/basic_table/basic_table.js +4 -1
- package/lib/components/breadcrumbs/_breadcrumb_content.js +3 -0
- package/lib/components/button/button_group/button_group.styles.js +1 -1
- package/lib/components/button/button_group/button_group_button.styles.js +1 -1
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +7 -1
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +34 -16
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/lib/components/flex/flex_item.js +6 -4
- package/lib/components/popover/input_popover.js +4 -1
- package/lib/components/popover/popover.js +7 -4
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/lib/components/table/_table_cell_content.styles.js +4 -4
- package/lib/components/table/table.js +16 -3
- package/lib/components/table/table.styles.js +2 -1
- package/lib/components/table/table_cells_shared.styles.js +4 -1
- package/lib/components/table/table_context.js +18 -0
- package/lib/components/table/table_footer_cell.js +9 -2
- package/lib/components/table/table_row.js +8 -2
- package/lib/components/table/table_row.styles.js +20 -4
- package/lib/components/table/table_row_cell.styles.js +3 -3
- package/lib/components/tool_tip/tool_tip_anchor.js +8 -0
- package/lib/components/tour/tour_step.js +6 -3
- package/lib/global_styling/mixins/_button.js +4 -3
- package/lib/global_styling/mixins/_typography.js +10 -1
- package/optimize/es/components/basic_table/basic_table.js +4 -1
- package/optimize/es/components/button/button_group/button_group.styles.js +2 -2
- package/optimize/es/components/button/button_group/button_group_button.styles.js +1 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +7 -1
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +35 -17
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/optimize/es/components/flex/flex_item.js +6 -4
- package/optimize/es/components/popover/input_popover.js +4 -1
- package/optimize/es/components/popover/popover.js +4 -4
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/optimize/es/components/table/_table_cell_content.styles.js +4 -4
- package/optimize/es/components/table/table.js +10 -3
- package/optimize/es/components/table/table.styles.js +2 -1
- package/optimize/es/components/table/table_cells_shared.styles.js +4 -1
- package/optimize/es/components/table/table_context.js +12 -0
- package/optimize/es/components/table/table_footer_cell.js +6 -2
- package/optimize/es/components/table/table_row.js +5 -2
- package/optimize/es/components/table/table_row.styles.js +22 -6
- package/optimize/es/components/table/table_row_cell.styles.js +3 -3
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +8 -0
- package/optimize/es/components/tour/tour_step.js +4 -2
- package/optimize/es/global_styling/mixins/_button.js +4 -3
- package/optimize/es/global_styling/mixins/_typography.js +9 -0
- package/optimize/lib/components/basic_table/basic_table.js +4 -1
- package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +1 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +7 -1
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +34 -16
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/optimize/lib/components/flex/flex_item.js +6 -4
- package/optimize/lib/components/popover/input_popover.js +4 -1
- package/optimize/lib/components/popover/popover.js +4 -4
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/optimize/lib/components/table/_table_cell_content.styles.js +4 -4
- package/optimize/lib/components/table/table.js +10 -3
- package/optimize/lib/components/table/table.styles.js +2 -1
- package/optimize/lib/components/table/table_cells_shared.styles.js +4 -1
- package/optimize/lib/components/table/table_context.js +18 -0
- package/optimize/lib/components/table/table_footer_cell.js +9 -2
- package/optimize/lib/components/table/table_row.js +8 -2
- package/optimize/lib/components/table/table_row.styles.js +20 -4
- package/optimize/lib/components/table/table_row_cell.styles.js +3 -3
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +8 -0
- package/optimize/lib/components/tour/tour_step.js +4 -2
- package/optimize/lib/global_styling/mixins/_button.js +4 -3
- package/optimize/lib/global_styling/mixins/_typography.js +10 -1
- package/package.json +4 -4
- package/test-env/components/basic_table/basic_table.js +4 -1
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +3 -0
- package/test-env/components/button/button_group/button_group.styles.js +1 -1
- package/test-env/components/button/button_group/button_group_button.styles.js +1 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +7 -1
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +34 -16
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/test-env/components/flex/flex_item.js +6 -4
- package/test-env/components/popover/input_popover.js +4 -1
- package/test-env/components/popover/popover.js +7 -4
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/test-env/components/table/_table_cell_content.styles.js +4 -4
- package/test-env/components/table/table.js +16 -3
- package/test-env/components/table/table.styles.js +2 -1
- package/test-env/components/table/table_cells_shared.styles.js +4 -1
- package/test-env/components/table/table_context.js +18 -0
- package/test-env/components/table/table_footer_cell.js +9 -2
- package/test-env/components/table/table_row.js +8 -2
- package/test-env/components/table/table_row.styles.js +20 -4
- package/test-env/components/table/table_row_cell.styles.js +3 -3
- package/test-env/components/tool_tip/tool_tip_anchor.js +8 -0
- package/test-env/components/tour/tour_step.js +6 -3
- package/test-env/global_styling/mixins/_button.js +4 -3
- package/test-env/global_styling/mixins/_typography.js +10 -1
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["children", "className", "closePopover", "anchorPosition", "attachToAnchor", "repositionToCrossAxis", "display", "panelPaddingSize", "closeOnScroll", "ownFocus", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef"];
|
|
5
|
+
var _excluded = ["children", "className", "closePopover", "anchorPosition", "attachToAnchor", "repositionToCrossAxis", "display", "panelPaddingSize", "closeOnScroll", "ownFocus", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef", "offset"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/*
|
|
@@ -56,6 +56,8 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
56
56
|
onPanelResize = _ref.onPanelResize,
|
|
57
57
|
_inputRef = _ref.inputRef,
|
|
58
58
|
_panelRef = _ref.panelRef,
|
|
59
|
+
_ref$offset = _ref.offset,
|
|
60
|
+
offset = _ref$offset === void 0 ? 2 : _ref$offset,
|
|
59
61
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
60
62
|
var classes = classnames('euiInputPopover', className);
|
|
61
63
|
var euiTheme = useEuiTheme();
|
|
@@ -194,6 +196,7 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
194
196
|
closePopover: closePopover,
|
|
195
197
|
anchorPosition: anchorPosition,
|
|
196
198
|
attachToAnchor: attachToAnchor,
|
|
199
|
+
offset: offset,
|
|
197
200
|
repositionToCrossAxis: repositionToCrossAxis,
|
|
198
201
|
panelPaddingSize: panelPaddingSize,
|
|
199
202
|
ownFocus: ownFocus
|
|
@@ -188,8 +188,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
188
188
|
if (_this.button == null || _this.panel == null) return;
|
|
189
189
|
var _ref6 = _this.props,
|
|
190
190
|
anchorPosition = _ref6.anchorPosition,
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
_offset = _ref6.offset;
|
|
192
|
+
var offset = _offset != null ? _offset : _this.props.hasArrow ? 0 : 4;
|
|
193
193
|
var position = getPopoverPositionFromAnchorPosition(anchorPosition);
|
|
194
194
|
var forcePosition = undefined;
|
|
195
195
|
if (allowEnforcePosition && _this.state.isOpenStable && _this.state.openPosition != null) {
|
|
@@ -526,8 +526,8 @@ _defineProperty(EuiPopover, "defaultProps", {
|
|
|
526
526
|
isOpen: false,
|
|
527
527
|
ownFocus: true,
|
|
528
528
|
repositionToCrossAxis: true,
|
|
529
|
-
anchorPosition: '
|
|
529
|
+
anchorPosition: 'downLeft',
|
|
530
530
|
panelPaddingSize: 'm',
|
|
531
|
-
hasArrow:
|
|
531
|
+
hasArrow: false,
|
|
532
532
|
display: 'inline-block'
|
|
533
533
|
});
|
|
@@ -29,6 +29,7 @@ export var EuiSelectableTemplateSitewidePopover = function EuiSelectableTemplate
|
|
|
29
29
|
var styles = useEuiMemoizedStyles(euiSelectableTemplateSitewidePopoverStyles);
|
|
30
30
|
return ___EmotionJSX(EuiPopover, _extends({
|
|
31
31
|
panelPaddingSize: "none",
|
|
32
|
+
anchorPosition: "downCenter",
|
|
32
33
|
isOpen: isOpen,
|
|
33
34
|
ownFocus: !!trigger,
|
|
34
35
|
display: trigger ? 'inline-block' : 'block'
|
|
@@ -10,11 +10,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { euiTextTruncate, euiTextBreakWord, logicalTextAlignCSS } from '../../global_styling';
|
|
12
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
-
name: "
|
|
14
|
-
styles: "flex-direction:column;
|
|
13
|
+
name: "7d9p9x-mobile",
|
|
14
|
+
styles: "flex-direction:column;label:mobile;"
|
|
15
15
|
} : {
|
|
16
|
-
name: "
|
|
17
|
-
styles: "flex-direction:column;
|
|
16
|
+
name: "7d9p9x-mobile",
|
|
17
|
+
styles: "flex-direction:column;label:mobile;",
|
|
18
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
19
|
};
|
|
20
20
|
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "compressed", "tableLayout", "responsiveBreakpoint"];
|
|
3
|
+
var _excluded = ["children", "className", "compressed", "tableLayout", "hasBackground", "responsiveBreakpoint"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -13,6 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiMemoizedStyles } from '../../services';
|
|
15
15
|
import { useIsEuiTableResponsive, EuiTableIsResponsiveContext } from './mobile/responsive_context';
|
|
16
|
+
import { EuiTableVariantContext } from './table_context';
|
|
16
17
|
import { euiTableStyles } from './table.styles';
|
|
17
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
19
|
export var EuiTable = function EuiTable(_ref) {
|
|
@@ -21,17 +22,23 @@ export var EuiTable = function EuiTable(_ref) {
|
|
|
21
22
|
compressed = _ref.compressed,
|
|
22
23
|
_ref$tableLayout = _ref.tableLayout,
|
|
23
24
|
tableLayout = _ref$tableLayout === void 0 ? 'fixed' : _ref$tableLayout,
|
|
25
|
+
_ref$hasBackground = _ref.hasBackground,
|
|
26
|
+
hasBackground = _ref$hasBackground === void 0 ? true : _ref$hasBackground,
|
|
24
27
|
responsiveBreakpoint = _ref.responsiveBreakpoint,
|
|
25
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
29
|
var isResponsive = useIsEuiTableResponsive(responsiveBreakpoint);
|
|
27
30
|
var classes = classNames('euiTable', className);
|
|
28
31
|
var styles = useEuiMemoizedStyles(euiTableStyles);
|
|
29
|
-
var cssStyles = [styles.euiTable, styles.layout[tableLayout], (!compressed || isResponsive) && styles.uncompressed, compressed && !isResponsive && styles.compressed, isResponsive ? styles.mobile : styles.desktop];
|
|
32
|
+
var cssStyles = [styles.euiTable, styles.layout[tableLayout], (!compressed || isResponsive) && styles.uncompressed, compressed && !isResponsive && styles.compressed, hasBackground && styles.hasBackground, isResponsive ? styles.mobile : styles.desktop];
|
|
30
33
|
return ___EmotionJSX("table", _extends({
|
|
31
34
|
tabIndex: -1,
|
|
32
35
|
css: cssStyles,
|
|
33
36
|
className: classes
|
|
34
37
|
}, rest), ___EmotionJSX(EuiTableIsResponsiveContext.Provider, {
|
|
35
38
|
value: isResponsive
|
|
36
|
-
},
|
|
39
|
+
}, ___EmotionJSX(EuiTableVariantContext.Provider, {
|
|
40
|
+
value: {
|
|
41
|
+
hasBackground: hasBackground
|
|
42
|
+
}
|
|
43
|
+
}, children)));
|
|
37
44
|
};
|
|
@@ -67,11 +67,12 @@ export var euiTableStyles = function euiTableStyles(euiThemeContext) {
|
|
|
67
67
|
cellContentPadding = _euiTableVariables.cellContentPadding,
|
|
68
68
|
compressedCellContentPadding = _euiTableVariables.compressedCellContentPadding;
|
|
69
69
|
return {
|
|
70
|
-
euiTable: /*#__PURE__*/css(euiNumberFormat(euiThemeContext), " ", logicalCSS('width', '100%'), " border:none;border-collapse:collapse
|
|
70
|
+
euiTable: /*#__PURE__*/css(euiNumberFormat(euiThemeContext), " ", logicalCSS('width', '100%'), " border:none;border-collapse:collapse;;label:euiTable;"),
|
|
71
71
|
layout: {
|
|
72
72
|
fixed: _ref3,
|
|
73
73
|
auto: _ref2
|
|
74
74
|
},
|
|
75
|
+
hasBackground: /*#__PURE__*/css("background-color:", euiTheme.colors.backgroundBasePlain, ";;label:hasBackground;"),
|
|
75
76
|
/**
|
|
76
77
|
* 1. The padding on the `.euiTableCellContent` div allows the ellipsis to show if the
|
|
77
78
|
* content is truncated. If the padding was on the cell, the ellipsis would be cropped.
|
|
@@ -25,7 +25,10 @@ export var euiTableHeaderFooterCellStyles = function euiTableHeaderFooterCellSty
|
|
|
25
25
|
euiTableHeaderCell: /*#__PURE__*/css(sharedStyles, ";;label:euiTableHeaderCell;"),
|
|
26
26
|
euiTableHeaderCell__content: /*#__PURE__*/css("gap:", euiTheme.size.xs, ";;label:euiTableHeaderCell__content;"),
|
|
27
27
|
euiTableHeaderCell__button: /*#__PURE__*/css(logicalCSS('width', '100%'), " font-weight:inherit;line-height:inherit;.euiTableSortIcon--sortable{color:", euiTheme.components.tableCellSortableIconColor, ";}&:hover,&:focus{color:", euiTheme.colors.textPrimary, ";text-decoration:underline;.euiTableSortIcon--sortable{color:", euiTheme.colors.textPrimary, ";}};label:euiTableHeaderCell__button;"),
|
|
28
|
-
euiTableFooterCell:
|
|
28
|
+
euiTableFooterCell: {
|
|
29
|
+
euiTableFooterCell: /*#__PURE__*/css(sharedStyles, ";;label:euiTableFooterCell;"),
|
|
30
|
+
hasBackground: /*#__PURE__*/css("background-color:", euiTheme.components.tableFooterBackground, ";;label:hasBackground;")
|
|
31
|
+
}
|
|
29
32
|
};
|
|
30
33
|
};
|
|
31
34
|
export var euiTableCellCheckboxStyles = function euiTableCellCheckboxStyles(euiThemeContext) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createContext } from 'react';
|
|
10
|
+
export var EuiTableVariantContext = /*#__PURE__*/createContext({
|
|
11
|
+
hasBackground: true
|
|
12
|
+
});
|
|
@@ -9,12 +9,13 @@ var _excluded = ["children", "align", "className", "width", "style"];
|
|
|
9
9
|
* Side Public License, v 1.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import React from 'react';
|
|
12
|
+
import React, { useContext } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiMemoizedStyles, LEFT_ALIGNMENT } from '../../services';
|
|
15
15
|
import { resolveWidthAsStyle } from './utils';
|
|
16
16
|
import { EuiTableCellContent } from './_table_cell_content';
|
|
17
17
|
import { euiTableHeaderFooterCellStyles } from './table_cells_shared.styles';
|
|
18
|
+
import { EuiTableVariantContext } from './table_context';
|
|
18
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
20
|
export var EuiTableFooterCell = function EuiTableFooterCell(_ref) {
|
|
20
21
|
var children = _ref.children,
|
|
@@ -24,11 +25,14 @@ export var EuiTableFooterCell = function EuiTableFooterCell(_ref) {
|
|
|
24
25
|
width = _ref.width,
|
|
25
26
|
style = _ref.style,
|
|
26
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
var _useContext = useContext(EuiTableVariantContext),
|
|
29
|
+
hasBackground = _useContext.hasBackground;
|
|
27
30
|
var classes = classNames('euiTableFooterCell', className);
|
|
28
31
|
var inlineStyles = resolveWidthAsStyle(style, width);
|
|
29
32
|
var styles = useEuiMemoizedStyles(euiTableHeaderFooterCellStyles);
|
|
33
|
+
var cssStyles = [styles.euiTableFooterCell.euiTableFooterCell, hasBackground && styles.euiTableFooterCell.hasBackground];
|
|
30
34
|
return ___EmotionJSX("td", _extends({
|
|
31
|
-
css:
|
|
35
|
+
css: cssStyles,
|
|
32
36
|
className: classes,
|
|
33
37
|
style: inlineStyles
|
|
34
38
|
}, rest), ___EmotionJSX(EuiTableCellContent, {
|
|
@@ -9,10 +9,11 @@ var _excluded = ["children", "className", "hasSelection", "isSelected", "isSelec
|
|
|
9
9
|
* Side Public License, v 1.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import React from 'react';
|
|
12
|
+
import React, { useContext } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { keys, useEuiMemoizedStyles } from '../../services';
|
|
15
15
|
import { useEuiTableIsResponsive } from './mobile/responsive_context';
|
|
16
|
+
import { EuiTableVariantContext } from './table_context';
|
|
16
17
|
import { euiTableRowStyles } from './table_row.styles';
|
|
17
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
19
|
export var EuiTableRow = function EuiTableRow(_ref) {
|
|
@@ -27,8 +28,10 @@ export var EuiTableRow = function EuiTableRow(_ref) {
|
|
|
27
28
|
onClick = _ref.onClick,
|
|
28
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
30
|
var isResponsive = useEuiTableIsResponsive();
|
|
31
|
+
var _useContext = useContext(EuiTableVariantContext),
|
|
32
|
+
hasBackground = _useContext.hasBackground;
|
|
30
33
|
var styles = useEuiMemoizedStyles(euiTableRowStyles);
|
|
31
|
-
var cssStyles = isResponsive ? [styles.euiTableRow, styles.mobile.mobile, isSelected && styles.mobile.selected, isExpandedRow && styles.mobile.expanded, (hasActions === true || isExpandable || isExpandedRow) && styles.mobile.hasRightColumn, hasSelection && styles.mobile.hasLeftColumn] : [styles.euiTableRow, styles.desktop.desktop, onClick && styles.desktop.clickable, isSelected && styles.desktop.selected, isExpandedRow && styles.desktop.expanded, isExpandedRow && hasSelection && styles.desktop.checkboxOffset];
|
|
34
|
+
var cssStyles = isResponsive ? [styles.euiTableRow, styles.mobile.mobile, !hasBackground && styles.mobile.hasBorder, hasBackground && styles.mobile.hasBackground, isSelected && styles.mobile.selected, isExpandedRow && styles.mobile.expanded, (hasActions === true || isExpandable || isExpandedRow) && styles.mobile.hasRightColumn, hasSelection && styles.mobile.hasLeftColumn] : [styles.euiTableRow, styles.desktop.desktop, onClick && styles.desktop.clickable, isSelected && styles.desktop.selected, isExpandedRow && styles.desktop.expanded.expanded, isExpandedRow && hasBackground && styles.desktop.expanded.hasBackground, isExpandedRow && hasSelection && styles.desktop.checkboxOffset];
|
|
32
35
|
var classes = classNames('euiTableRow', className, {
|
|
33
36
|
'euiTableRow-isSelectable': isSelectable,
|
|
34
37
|
'euiTableRow-isSelected': isSelected,
|
|
@@ -9,8 +9,8 @@ var _templateObject;
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { css, keyframes } from '@emotion/react';
|
|
12
|
-
import { euiShadow } from '@elastic/eui-theme-common';
|
|
13
|
-
import { euiCanAnimate, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
12
|
+
import { euiBorderStyles, euiShadow } from '@elastic/eui-theme-common';
|
|
13
|
+
import { euiCanAnimate, highContrastModeStyles, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
14
14
|
import { cssSupportsHasWithNextSibling } from '../../global_styling/functions/supports';
|
|
15
15
|
import { euiTableVariables } from './table.styles';
|
|
16
16
|
export var euiTableRowStyles = function euiTableRowStyles(euiThemeContext) {
|
|
@@ -26,7 +26,11 @@ export var euiTableRowStyles = function euiTableRowStyles(euiThemeContext) {
|
|
|
26
26
|
euiTableRow: /*#__PURE__*/css(":where(&.euiTableRow--marked){background-color:", rowColors.marked.background, ";};label:euiTableRow;"),
|
|
27
27
|
desktop: {
|
|
28
28
|
desktop: /*#__PURE__*/css("&:hover{background-color:", rowColors.hover, ";}", markedStyles, ";;label:desktop;"),
|
|
29
|
-
expanded:
|
|
29
|
+
expanded: {
|
|
30
|
+
expanded: /*#__PURE__*/css(expandedAnimationCss, ";;label:expanded;"),
|
|
31
|
+
// skipping adding a css class as it's a default style when expanded
|
|
32
|
+
hasBackground: "\n background-color: ".concat(rowColors.hover, ";\n ")
|
|
33
|
+
},
|
|
30
34
|
clickable: /*#__PURE__*/css("&:hover{background-color:", rowColors.clickable.hover, ";cursor:pointer;}", markedStyles, " &:focus{background-color:", rowColors.clickable.focus, ";};label:clickable;"),
|
|
31
35
|
selected: /*#__PURE__*/css("&,&+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.background, ";}&:hover,&:hover+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.hover, ";};label:selected;"),
|
|
32
36
|
// Offset expanded & selectable rows by the checkbox width to line up content with the 2nd column
|
|
@@ -34,9 +38,21 @@ export var euiTableRowStyles = function euiTableRowStyles(euiThemeContext) {
|
|
|
34
38
|
checkboxOffset: /*#__PURE__*/css("&>.euiTableRowCell:first-child{", logicalCSS('padding-left', checkboxSize), ";};label:checkboxOffset;")
|
|
35
39
|
},
|
|
36
40
|
mobile: {
|
|
37
|
-
mobile: /*#__PURE__*/css("position:relative;display:flex;flex-wrap:wrap;padding:", cellContentPadding, ";", logicalCSS('margin-bottom', cellContentPadding),
|
|
41
|
+
mobile: /*#__PURE__*/css("position:relative;display:flex;flex-wrap:wrap;padding:", cellContentPadding, ";", logicalCSS('margin-bottom', cellContentPadding), " border-radius:", euiTheme.border.radius.medium, ";", cssSupportsHasWithNextSibling("\n &:has(+ .euiTableRow-isExpandedRow) {\n ".concat(logicalCSS('border-bottom-left-radius', 0), "\n ").concat(logicalCSS('border-bottom-right-radius', 0), "\n }\n ")), ";;label:mobile;"),
|
|
42
|
+
/* Omitting adding a class via css here as it's a default style on mobile, not a standalone prop-related style.
|
|
43
|
+
Adding it separate allows better appliance control via props without the need to override the styles. */
|
|
44
|
+
hasBorder: "\n ".concat(highContrastModeStyles(euiThemeContext, {
|
|
45
|
+
// uses pseudo-border to align dimensions with shadows applied by `hasBackground`
|
|
46
|
+
none: "\n ".concat(euiBorderStyles(euiThemeContext, {
|
|
47
|
+
side: 'all'
|
|
48
|
+
}), "\n transform: translateZ(0);\n "),
|
|
49
|
+
preferred: "\n border: ".concat(euiTheme.border.thin, "\n ")
|
|
50
|
+
}), "\n "),
|
|
51
|
+
hasBackground: /*#__PURE__*/css(euiShadow(euiThemeContext, 's', {
|
|
38
52
|
borderAllInHighContrastMode: true
|
|
39
|
-
}), " background-color:", euiTheme.colors.backgroundBasePlain, ";
|
|
53
|
+
}), " background-color:", euiTheme.colors.backgroundBasePlain, ";", highContrastModeStyles(euiThemeContext, {
|
|
54
|
+
none: "\n border: none;\n "
|
|
55
|
+
}), ";;label:hasBackground;"),
|
|
40
56
|
selected: /*#__PURE__*/css("&,&+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.background, ";};label:selected;"),
|
|
41
57
|
/**
|
|
42
58
|
* Left column offset (no border)
|
|
@@ -55,7 +71,7 @@ export var euiTableRowStyles = function euiTableRowStyles(euiThemeContext) {
|
|
|
55
71
|
// On mobile, visually move the expanded row to join up with the
|
|
56
72
|
// preceding table row via negative margins
|
|
57
73
|
'margin-top', mathWithUnits([cellContentPadding, euiTheme.border.width.thin], function (x, y) {
|
|
58
|
-
return (x + y
|
|
74
|
+
return (x + y) * -1;
|
|
59
75
|
})), logicalCSS('padding-left', cellContentPadding), " ", logicalCSS('border-top', euiTheme.border.thin), " ", logicalCSS('border-top-left-radius', 0), " ", logicalCSS('border-top-right-radius', 0), " &:after{", logicalCSS('border-top', 'none'), ";}clip-path:polygon(-50% 0, 150% 0, 150% 150%, -50% 150%);>.euiTableRowCell{", logicalCSS('width', '100%'), ";}", expandedAnimationCss, ";;label:expanded;")
|
|
60
76
|
}
|
|
61
77
|
};
|
|
@@ -70,10 +70,10 @@ export var euiTableRowCellStyles = function euiTableRowCellStyles(euiThemeContex
|
|
|
70
70
|
rightColumnContent: "\n position: absolute;\n ".concat(logicalCSS('right', 0), "\n ").concat(logicalCSS('min-width', '0'), "\n ").concat(logicalCSS('width', mobileSizes.actions.width), "\n "),
|
|
71
71
|
get actions() {
|
|
72
72
|
// Note: Visible-on-hover actions on desktop always show on mobile
|
|
73
|
-
return /*#__PURE__*/css(this.rightColumnContent, " ", logicalCSS('top', mobileSizes.actions.offset), "
|
|
73
|
+
return /*#__PURE__*/css(this.rightColumnContent, " ", logicalCSS('top', mobileSizes.actions.offset), ".euiTableCellContent{padding:0;};label:actions;");
|
|
74
74
|
},
|
|
75
75
|
get expander() {
|
|
76
|
-
return /*#__PURE__*/css(this.rightColumnContent, "
|
|
76
|
+
return /*#__PURE__*/css(this.rightColumnContent, ";;label:expander;");
|
|
77
77
|
},
|
|
78
78
|
/**
|
|
79
79
|
* Custom actions may not be icons and therefore may not fit in a column
|
|
@@ -84,6 +84,6 @@ export var euiTableRowCellStyles = function euiTableRowCellStyles(euiThemeContex
|
|
|
84
84
|
},
|
|
85
85
|
euiTableRowCell__mobileHeader: /*#__PURE__*/css(euiTextTruncate(), " font-size:", euiFontSize(euiThemeContext, 's', {
|
|
86
86
|
customScale: 'xxs'
|
|
87
|
-
}).fontSize, ";display:block;color:", euiTheme.colors.
|
|
87
|
+
}).fontSize, ";display:block;color:", euiTheme.colors.textSubdued, ";padding:", euiTheme.size.s, ";padding-block-end:0;margin-block-end:-", euiTheme.size.s, ";.euiTableRowCell:not(:only-child) &{", logicalCSS('min-height', euiTheme.size.l), ";};label:euiTableRowCell__mobileHeader;")
|
|
88
88
|
};
|
|
89
89
|
};
|
|
@@ -11,6 +11,7 @@ var _excluded = ["onBlur", "onFocus", "onMouseOver", "onMouseOut", "id", "classN
|
|
|
11
11
|
|
|
12
12
|
import React, { cloneElement, forwardRef } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useGeneratedHtmlId } from '../../services';
|
|
14
15
|
import { euiToolTipAnchorStyles } from './tool_tip.styles';
|
|
15
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
17
|
export var EuiToolTipAnchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -27,11 +28,18 @@ export var EuiToolTipAnchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
27
28
|
var anchorCss = euiToolTipAnchorStyles();
|
|
28
29
|
var cssStyles = [anchorCss.euiToolTipAnchor, anchorCss[display]];
|
|
29
30
|
var classes = classNames('euiToolTipAnchor', className);
|
|
31
|
+
var anchorId = useGeneratedHtmlId({
|
|
32
|
+
suffix: 'euiToolTipAnchor',
|
|
33
|
+
conditionalId: id ? "".concat(id, "-wrapper") : undefined
|
|
34
|
+
});
|
|
30
35
|
return (
|
|
31
36
|
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
32
37
|
___EmotionJSX("span", _extends({
|
|
33
38
|
ref: ref,
|
|
34
39
|
css: cssStyles
|
|
40
|
+
/* A11y: NVDA combines elements with identical markup into a single navigational stop. ¯\_(ツ)_/¯
|
|
41
|
+
The `id` ensures the wrappers are unique and navigated as standalone elements. (data- attributes don't work) */,
|
|
42
|
+
id: anchorId
|
|
35
43
|
}, rest, {
|
|
36
44
|
className: classes,
|
|
37
45
|
onMouseOver: onMouseOver,
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "subtitle", "title", "decoration", "footerAction", "panelProps", "panelClassName"];
|
|
5
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "subtitle", "title", "decoration", "hasArrow", "footerAction", "panelProps", "panelClassName"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/*
|
|
@@ -47,6 +47,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
47
47
|
title = _ref.title,
|
|
48
48
|
_ref$decoration = _ref.decoration,
|
|
49
49
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
50
|
+
hasArrow = _ref.hasArrow,
|
|
50
51
|
footerAction = _ref.footerAction,
|
|
51
52
|
panelProps = _ref.panelProps,
|
|
52
53
|
panelClassName = _ref.panelClassName,
|
|
@@ -108,8 +109,9 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
108
109
|
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
109
110
|
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
110
111
|
}),
|
|
111
|
-
offset: hasBeacon ? 10 :
|
|
112
|
+
offset: hasBeacon && hasArrow !== false ? 10 : undefined,
|
|
112
113
|
"aria-labelledby": titleId,
|
|
114
|
+
hasArrow: hasArrow !== null && hasArrow !== void 0 ? hasArrow : hasBeacon,
|
|
113
115
|
arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
|
|
114
116
|
css: beaconCss,
|
|
115
117
|
className: "euiTour__beacon"
|
|
@@ -14,6 +14,7 @@ import { css } from '@emotion/react';
|
|
|
14
14
|
import { getTokenName, mathWithUnits } from '@elastic/eui-theme-common';
|
|
15
15
|
import { makeHighContrastColor, useEuiMemoizedStyles } from '../../services';
|
|
16
16
|
import { highContrastModeStyles, logicalCSS } from '../functions';
|
|
17
|
+
import { euiDisabledSelector } from '../utility/selectors';
|
|
17
18
|
|
|
18
19
|
/** Tentative usage; these exist only to be used as button directly when used within other components */
|
|
19
20
|
export var SEVERITY_COLORS = ['neutral', 'risk'];
|
|
@@ -204,11 +205,11 @@ var _interactionStyles = function _interactionStyles(euiThemeContext, buttonColo
|
|
|
204
205
|
var baseStyles = function baseStyles() {
|
|
205
206
|
// button hover is applied as pseudo element with a transparent background-color
|
|
206
207
|
if (type === 'overlay') {
|
|
207
|
-
return "\n position: relative;\n overflow: hidden;\n\n &:hover:not(
|
|
208
|
+
return "\n position: relative;\n overflow: hidden;\n\n &:hover:not(".concat(euiDisabledSelector, ") {\n &::before {\n content: '';\n position: absolute;\n /* should stay under the content */\n z-index: 0;\n inset: 0;\n background-color: ").concat(buttonColors.backgroundHover, ";\n pointer-events: none;\n }\n }\n\n &:active:not(").concat(euiDisabledSelector, ") {\n &::before {\n ").concat(logicalCSS('width', '100%'), "\n ").concat(logicalCSS('height', '100%'), "\n\n content: '';\n position: absolute;\n inset: 0;\n background-color: ").concat(buttonColors.backgroundActive, ";\n }\n }\n ");
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
// button hover is applied as opaque color
|
|
211
|
-
return "\n &:hover:not(
|
|
212
|
+
return "\n &:hover:not(".concat(euiDisabledSelector, ") {\n background-color: ").concat(buttonColors.backgroundHover, ";\n }\n\n &:active:not(").concat(euiDisabledSelector, ") {\n background-color: ").concat(buttonColors.backgroundActive, ";\n }\n ");
|
|
212
213
|
};
|
|
213
214
|
return " \n ".concat(highContrastModeStyles(euiThemeContext, {
|
|
214
215
|
none: baseStyles(),
|
|
@@ -221,7 +222,7 @@ var _interactionStyles = function _interactionStyles(euiThemeContext, buttonColo
|
|
|
221
222
|
*/
|
|
222
223
|
export var highContrastHoverIndicatorStyles = function highContrastHoverIndicatorStyles(_ref2) {
|
|
223
224
|
var euiTheme = _ref2.euiTheme;
|
|
224
|
-
return "\n &:hover:not(
|
|
225
|
+
return "\n &:hover:not(".concat(euiDisabledSelector, ") {\n transition: none;\n\n /* using pseudo border to be able to control the color */\n &::after {\n content: '';\n position: absolute;\n inset: ").concat(euiTheme.border.width.thin, ";\n border: ").concat(euiTheme.border.width.thick, " solid var(--highContrastHoverIndicatorColor, ").concat(euiTheme.border.color, ");\n border-radius: ").concat(mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
225
226
|
return x / 2;
|
|
226
227
|
}), ";\n background-color: transparent;\n pointer-events: none;\n }\n }\n");
|
|
227
228
|
};
|
|
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
* Side Public License, v 1.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import { css } from '@emotion/react';
|
|
12
13
|
import { euiLineHeightFromBaseline, euiFontSizeFromScale } from '../functions/typography';
|
|
13
14
|
import { useEuiMemoizedStyles, useEuiTheme } from '../../services/theme';
|
|
14
15
|
import { EuiThemeFontScales } from '../variables/typography';
|
|
@@ -53,6 +54,14 @@ export var euiTextTruncate = function euiTextTruncate() {
|
|
|
53
54
|
, "\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
|
|
54
55
|
};
|
|
55
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Emotion CSS wrapper around `euiTextTruncate` style.
|
|
59
|
+
*/
|
|
60
|
+
export var euiTextTruncateCSS = function euiTextTruncateCSS() {
|
|
61
|
+
var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
|
|
62
|
+
return /*#__PURE__*/css(euiTextTruncate(maxWidth), ";;label:euiTextTruncateCSS;");
|
|
63
|
+
};
|
|
64
|
+
|
|
56
65
|
/**
|
|
57
66
|
* Fixed-width numbers for tabular data
|
|
58
67
|
*/
|
|
@@ -37,7 +37,7 @@ var _delay_render = require("../delay_render");
|
|
|
37
37
|
var _accessibility2 = require("../../services/accessibility");
|
|
38
38
|
var _basic_table = require("./basic_table.styles");
|
|
39
39
|
var _react2 = require("@emotion/react");
|
|
40
|
-
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout"],
|
|
40
|
+
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground"],
|
|
41
41
|
_excluded2 = ["align", "render", "dataType", "isExpander", "textOnly", "name", "field", "description", "sortable", "footer", "mobileOptions", "nameTooltip"];
|
|
42
42
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
43
43
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -361,6 +361,7 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
361
361
|
tableCaption = _this$props2.tableCaption,
|
|
362
362
|
rowHeader = _this$props2.rowHeader,
|
|
363
363
|
tableLayout = _this$props2.tableLayout,
|
|
364
|
+
hasBackground = _this$props2.hasBackground,
|
|
364
365
|
rest = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
|
|
365
366
|
var classes = (0, _classnames.default)('euiBasicTable', {
|
|
366
367
|
'euiBasicTable-loading': loading
|
|
@@ -378,6 +379,7 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
378
379
|
compressed = _this$props3.compressed,
|
|
379
380
|
responsiveBreakpoint = _this$props3.responsiveBreakpoint,
|
|
380
381
|
tableLayout = _this$props3.tableLayout,
|
|
382
|
+
hasBackground = _this$props3.hasBackground,
|
|
381
383
|
loading = _this$props3.loading;
|
|
382
384
|
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_table.EuiTableHeaderMobile, {
|
|
383
385
|
responsiveBreakpoint: responsiveBreakpoint
|
|
@@ -386,6 +388,7 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
386
388
|
tableLayout: tableLayout,
|
|
387
389
|
responsiveBreakpoint: responsiveBreakpoint,
|
|
388
390
|
compressed: compressed,
|
|
391
|
+
hasBackground: hasBackground,
|
|
389
392
|
css: loading && _basic_table.safariLoadingWorkaround
|
|
390
393
|
}, this.renderTableCaption(), this.renderTableHead(), this.renderTableBody(), this.renderTableFooter())));
|
|
391
394
|
}
|
|
@@ -47,6 +47,6 @@ var _highContrastStyles = function _highContrastStyles(euiThemeContext, compress
|
|
|
47
47
|
var euiTheme = euiThemeContext.euiTheme;
|
|
48
48
|
return (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
49
49
|
preferred: compressed ? "\n .euiButtonGroupButton {\n border: none;\n }\n " : '',
|
|
50
|
-
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat((0, _high_contrast.preventForcedColors)(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n &:is(:hover, :focus):not(
|
|
50
|
+
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat((0, _high_contrast.preventForcedColors)(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n &:is(:hover, :focus):not(").concat(_global_styling.euiDisabledSelector, ") {\n &::before {\n border-color: ").concat(euiTheme.colors.textInverse, ";\n }\n }\n }\n\n .euiButtonGroupButton:is(").concat(_global_styling.euiDisabledSelector, ") {\n opacity: 0.5;\n }\n ")
|
|
51
51
|
});
|
|
52
52
|
};
|
|
@@ -89,7 +89,7 @@ var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function e
|
|
|
89
89
|
},
|
|
90
90
|
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";font-weight:", euiTheme.font.weight.medium, ";padding:0;margin:", euiTheme.size.xxs, ";border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
91
91
|
return x / 2;
|
|
92
|
-
}), ";&+.euiButtonGroupButton{", (0, _global_styling.logicalCSS)('margin-left', '0'), ";}&:is(", selectedSelectors, "):not(
|
|
92
|
+
}), ";&+.euiButtonGroupButton{", (0, _global_styling.logicalCSS)('margin-left', '0'), ";}&:is(", selectedSelectors, "):not(", _global_styling.euiDisabledSelector, "){border:none;", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
93
93
|
forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat((0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
94
94
|
return x * 3;
|
|
95
95
|
}), ";\n }\n ")
|
|
@@ -104,10 +104,16 @@ var EuiAbsoluteTab = exports.EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
// We can be forgiving for `dateFormat` if we are certain
|
|
108
|
+
// we're not expecting any of the other formats allowed;
|
|
109
|
+
// otherwise we can get valid but inaccurate results e.g.
|
|
110
|
+
// `1970-01-01` -> `Jan 19, 1970 @ 01:01:00.000`
|
|
111
|
+
var strictModeForPassedFormat = (0, _moment.default)(textInputValue, ALLOWED_USER_DATE_FORMATS, true).isValid();
|
|
112
|
+
|
|
107
113
|
// Attempt to parse with passed `dateFormat` and `locale`
|
|
108
114
|
var _valueAsMoment = (0, _moment.default)(textInputValue, dateFormat, typeof locale === 'string' ? locale : 'en',
|
|
109
115
|
// Narrow the union type to string
|
|
110
|
-
|
|
116
|
+
strictModeForPassedFormat);
|
|
111
117
|
var dateIsValid = _valueAsMoment.isValid();
|
|
112
118
|
|
|
113
119
|
// If not valid, try a few other standardized formats
|
|
@@ -20,9 +20,11 @@ var _moment = _interopRequireDefault(require("moment"));
|
|
|
20
20
|
var _datemath = _interopRequireDefault(require("@elastic/datemath"));
|
|
21
21
|
var _services = require("../../../services");
|
|
22
22
|
var _predicate = require("../../../services/predicate");
|
|
23
|
+
var _global_styling = require("../../../global_styling");
|
|
23
24
|
var _context = require("../../context");
|
|
24
25
|
var _date_picker_range = require("../date_picker_range");
|
|
25
26
|
var _form = require("../../form");
|
|
27
|
+
var _tool_tip = require("../../tool_tip");
|
|
26
28
|
var _time_options = require("./time_options");
|
|
27
29
|
var _pretty_duration = require("./pretty_duration");
|
|
28
30
|
var _time_window_buttons = require("./time_window_buttons");
|
|
@@ -301,22 +303,38 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
|
|
|
301
303
|
};
|
|
302
304
|
var isDisabledDisplay = (0, _predicate.isObject)(isDisabled) && (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled.display);
|
|
303
305
|
if (isDisabledDisplay || showPrettyDuration && !isStartDatePopoverOpen && !isEndDatePopoverOpen) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
306
|
+
// Tooltip content with full range
|
|
307
|
+
var startMoment = _datemath.default.parse(start);
|
|
308
|
+
var endMoment = _datemath.default.parse(end, {
|
|
309
|
+
roundUp: true
|
|
310
|
+
});
|
|
311
|
+
var separator = ' – ';
|
|
312
|
+
var formattedFullRange = isInvalid ? '' : (startMoment === null || startMoment === void 0 ? void 0 : startMoment.format(dateFormat)) + separator + (endMoment === null || endMoment === void 0 ? void 0 : endMoment.format(dateFormat));
|
|
313
|
+
return (0, _react2.jsx)(_services.RenderWithEuiTheme, null, function (euiTheme) {
|
|
314
|
+
return (0, _react2.jsx)(_form.EuiFormControlLayout, formControlLayoutProps, !isQuickSelectOnly && (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
315
|
+
css: styles.euiSuperDatePicker__prettyDurationTooltip,
|
|
316
|
+
content: formattedFullRange,
|
|
317
|
+
display: "block",
|
|
318
|
+
offset: euiTheme.euiTheme.base * 0.5
|
|
319
|
+
}, (0, _react2.jsx)(_form.EuiFormControlButton, {
|
|
320
|
+
type: "button",
|
|
321
|
+
className: (0, _classnames.default)('euiSuperDatePicker__prettyFormat', {
|
|
322
|
+
'euiSuperDatePicker__prettyFormat--disabled': isDisabled
|
|
323
|
+
}),
|
|
324
|
+
compressed: compressed,
|
|
325
|
+
"data-test-subj": "superDatePickerShowDatesButton",
|
|
326
|
+
disabled: !!isDisabled,
|
|
327
|
+
onClick: _this.hidePrettyDuration,
|
|
328
|
+
onFocus: onFocus
|
|
329
|
+
}, isDisabledDisplay ? isDisabled.display : (0, _react2.jsx)("span", {
|
|
330
|
+
css: (0, _global_styling.euiTextTruncateCSS)()
|
|
331
|
+
}, (0, _react2.jsx)(_pretty_duration.PrettyDuration, {
|
|
332
|
+
timeFrom: start,
|
|
333
|
+
timeTo: end,
|
|
334
|
+
quickRanges: commonlyUsedRanges,
|
|
335
|
+
dateFormat: dateFormat
|
|
336
|
+
})))));
|
|
337
|
+
});
|
|
320
338
|
}
|
|
321
339
|
var rangeCssStyles = [styles.euiSuperDatePicker__range, formControlLayoutProps.css];
|
|
322
340
|
|
|
@@ -69,9 +69,7 @@ var euiSuperDatePickerStyles = exports.euiSuperDatePickerStyles = function euiSu
|
|
|
69
69
|
isQuickSelectOnly: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', 0), ".euiFormControlLayout__prepend{", (0, _global_styling.logicalCSS)('max-width', 'none'), ";}.euiFormControlLayoutDelimited__delimiter:first-child{", (0, _global_styling.logicalCSS)('padding-horizontal', 0), ";};label:isQuickSelectOnly;"),
|
|
70
70
|
euiSuperDatePicker__range: _ref,
|
|
71
71
|
euiSuperDatePicker__rangeInput: /*#__PURE__*/(0, _react.css)("flex-grow:1;", (0, _global_styling.logicalCSS)('width', 'auto'), " overflow:hidden;;label:euiSuperDatePicker__rangeInput;"),
|
|
72
|
-
|
|
73
|
-
preferred: "\n border: none;\n "
|
|
74
|
-
}), ";;label:euiSuperDatePicker__prettyFormat;"),
|
|
72
|
+
euiSuperDatePicker__prettyDurationTooltip: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', 'min(58ch, 90vw)'), ";;label:euiSuperDatePicker__prettyDurationTooltip;"),
|
|
75
73
|
// Form states
|
|
76
74
|
states: {
|
|
77
75
|
euiSuperDatePicker__formControlLayout: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{--euiFormControlStateHoverColor:", forms.borderHovered, ";", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
@@ -27,15 +27,17 @@ var EuiFlexItemInternal = function EuiFlexItemInternal(_ref, ref) {
|
|
|
27
27
|
var children = _ref.children,
|
|
28
28
|
className = _ref.className,
|
|
29
29
|
_ref$grow = _ref.grow,
|
|
30
|
-
|
|
30
|
+
_grow = _ref$grow === void 0 ? true : _ref$grow,
|
|
31
31
|
_ref$component = _ref.component,
|
|
32
32
|
component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
33
33
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
34
|
+
// resets `grow` to the default value when an invalid value is passed
|
|
35
|
+
var grow = VALID_GROW_VALUES.indexOf(_grow) === -1 ? true : _grow;
|
|
34
36
|
(0, _react.useEffect)(function () {
|
|
35
|
-
if (VALID_GROW_VALUES.indexOf(
|
|
36
|
-
|
|
37
|
+
if (process.env.NODE_ENV === 'development' && VALID_GROW_VALUES.indexOf(_grow) === -1) {
|
|
38
|
+
console.warn("Prop `grow` passed to `EuiFlexItem` must be a boolean or an integer between 0 and 10, received `".concat(_grow, "`. Defaulting to `true`."));
|
|
37
39
|
}
|
|
38
|
-
}, [
|
|
40
|
+
}, [_grow]);
|
|
39
41
|
var cssStyles = [_flex_item.euiFlexItemStyles.euiFlexItem, !grow ? _flex_item.euiFlexItemStyles.growZero : _flex_item.euiFlexItemStyles.grow, grow && (typeof grow === 'number' ? _flex_item.euiFlexItemStyles.growSizes[grow] : _flex_item.euiFlexItemStyles.growSizes['1'])];
|
|
40
42
|
var classes = (0, _classnames.default)('euiFlexItem', className);
|
|
41
43
|
|