@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
|
@@ -21,9 +21,11 @@ var _moment = _interopRequireDefault(require("moment"));
|
|
|
21
21
|
var _datemath = _interopRequireDefault(require("@elastic/datemath"));
|
|
22
22
|
var _services = require("../../../services");
|
|
23
23
|
var _predicate = require("../../../services/predicate");
|
|
24
|
+
var _global_styling = require("../../../global_styling");
|
|
24
25
|
var _context = require("../../context");
|
|
25
26
|
var _date_picker_range = require("../date_picker_range");
|
|
26
27
|
var _form = require("../../form");
|
|
28
|
+
var _tool_tip = require("../../tool_tip");
|
|
27
29
|
var _time_options = require("./time_options");
|
|
28
30
|
var _pretty_duration = require("./pretty_duration");
|
|
29
31
|
var _time_window_buttons = require("./time_window_buttons");
|
|
@@ -302,22 +304,38 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
|
|
|
302
304
|
};
|
|
303
305
|
var isDisabledDisplay = (0, _predicate.isObject)(isDisabled) && (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled.display);
|
|
304
306
|
if (isDisabledDisplay || showPrettyDuration && !isStartDatePopoverOpen && !isEndDatePopoverOpen) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
307
|
+
// Tooltip content with full range
|
|
308
|
+
var startMoment = _datemath.default.parse(start);
|
|
309
|
+
var endMoment = _datemath.default.parse(end, {
|
|
310
|
+
roundUp: true
|
|
311
|
+
});
|
|
312
|
+
var separator = ' – ';
|
|
313
|
+
var formattedFullRange = isInvalid ? '' : (startMoment === null || startMoment === void 0 ? void 0 : startMoment.format(dateFormat)) + separator + (endMoment === null || endMoment === void 0 ? void 0 : endMoment.format(dateFormat));
|
|
314
|
+
return (0, _react2.jsx)(_services.RenderWithEuiTheme, null, function (euiTheme) {
|
|
315
|
+
return (0, _react2.jsx)(_form.EuiFormControlLayout, formControlLayoutProps, !isQuickSelectOnly && (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
316
|
+
css: styles.euiSuperDatePicker__prettyDurationTooltip,
|
|
317
|
+
content: formattedFullRange,
|
|
318
|
+
display: "block",
|
|
319
|
+
offset: euiTheme.euiTheme.base * 0.5
|
|
320
|
+
}, (0, _react2.jsx)(_form.EuiFormControlButton, {
|
|
321
|
+
type: "button",
|
|
322
|
+
className: (0, _classnames.default)('euiSuperDatePicker__prettyFormat', {
|
|
323
|
+
'euiSuperDatePicker__prettyFormat--disabled': isDisabled
|
|
324
|
+
}),
|
|
325
|
+
compressed: compressed,
|
|
326
|
+
"data-test-subj": "superDatePickerShowDatesButton",
|
|
327
|
+
disabled: !!isDisabled,
|
|
328
|
+
onClick: _this.hidePrettyDuration,
|
|
329
|
+
onFocus: onFocus
|
|
330
|
+
}, isDisabledDisplay ? isDisabled.display : (0, _react2.jsx)("span", {
|
|
331
|
+
css: (0, _global_styling.euiTextTruncateCSS)()
|
|
332
|
+
}, (0, _react2.jsx)(_pretty_duration.PrettyDuration, {
|
|
333
|
+
timeFrom: start,
|
|
334
|
+
timeTo: end,
|
|
335
|
+
quickRanges: commonlyUsedRanges,
|
|
336
|
+
dateFormat: dateFormat
|
|
337
|
+
})))));
|
|
338
|
+
});
|
|
321
339
|
}
|
|
322
340
|
var rangeCssStyles = [styles.euiSuperDatePicker__range, formControlLayoutProps.css];
|
|
323
341
|
|
|
@@ -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
|
|
|
@@ -21,7 +21,7 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
21
21
|
var _focus_trap = require("../focus_trap");
|
|
22
22
|
var _form = require("../form/form.styles");
|
|
23
23
|
var _popover = require("./popover");
|
|
24
|
-
var _excluded = ["children", "className", "closePopover", "anchorPosition", "attachToAnchor", "repositionToCrossAxis", "display", "panelPaddingSize", "closeOnScroll", "ownFocus", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef"];
|
|
24
|
+
var _excluded = ["children", "className", "closePopover", "anchorPosition", "attachToAnchor", "repositionToCrossAxis", "display", "panelPaddingSize", "closeOnScroll", "ownFocus", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef", "offset"];
|
|
25
25
|
/*
|
|
26
26
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
27
27
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -65,6 +65,8 @@ var EuiInputPopover = exports.EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
65
65
|
onPanelResize = _ref.onPanelResize,
|
|
66
66
|
_inputRef = _ref.inputRef,
|
|
67
67
|
_panelRef = _ref.panelRef,
|
|
68
|
+
_ref$offset = _ref.offset,
|
|
69
|
+
offset = _ref$offset === void 0 ? 2 : _ref$offset,
|
|
68
70
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
69
71
|
var classes = (0, _classnames.default)('euiInputPopover', className);
|
|
70
72
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
@@ -203,6 +205,7 @@ var EuiInputPopover = exports.EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
203
205
|
closePopover: closePopover,
|
|
204
206
|
anchorPosition: anchorPosition,
|
|
205
207
|
attachToAnchor: attachToAnchor,
|
|
208
|
+
offset: offset,
|
|
206
209
|
repositionToCrossAxis: repositionToCrossAxis,
|
|
207
210
|
panelPaddingSize: panelPaddingSize,
|
|
208
211
|
ownFocus: ownFocus
|
|
@@ -199,8 +199,8 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
199
199
|
if (_this.button == null || _this.panel == null) return;
|
|
200
200
|
var _ref6 = _this.props,
|
|
201
201
|
anchorPosition = _ref6.anchorPosition,
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
_offset = _ref6.offset;
|
|
203
|
+
var offset = _offset != null ? _offset : _this.props.hasArrow ? 0 : 4;
|
|
204
204
|
var position = getPopoverPositionFromAnchorPosition(anchorPosition);
|
|
205
205
|
var forcePosition = undefined;
|
|
206
206
|
if (allowEnforcePosition && _this.state.isOpenStable && _this.state.openPosition != null) {
|
|
@@ -537,14 +537,15 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
537
537
|
isOpen: false,
|
|
538
538
|
ownFocus: true,
|
|
539
539
|
repositionToCrossAxis: true,
|
|
540
|
-
anchorPosition: '
|
|
540
|
+
anchorPosition: 'downLeft',
|
|
541
541
|
panelPaddingSize: 'm',
|
|
542
|
-
hasArrow:
|
|
542
|
+
hasArrow: false,
|
|
543
543
|
display: 'inline-block'
|
|
544
544
|
});
|
|
545
545
|
EuiPopover.propTypes = {
|
|
546
546
|
/**
|
|
547
547
|
* Alignment of the popover and arrow relative to the button
|
|
548
|
+
* @default downLeft
|
|
548
549
|
*/
|
|
549
550
|
anchorPosition: _propTypes.default.any,
|
|
550
551
|
/**
|
|
@@ -574,6 +575,7 @@ EuiPopover.propTypes = {
|
|
|
574
575
|
focusTrapProps: _propTypes.default.any,
|
|
575
576
|
/**
|
|
576
577
|
* Show arrow indicating to originating button
|
|
578
|
+
* @default false
|
|
577
579
|
*/
|
|
578
580
|
hasArrow: _propTypes.default.bool,
|
|
579
581
|
/**
|
|
@@ -651,6 +653,7 @@ EuiPopover.propTypes = {
|
|
|
651
653
|
zIndex: _propTypes.default.number,
|
|
652
654
|
/**
|
|
653
655
|
* Distance away from the anchor that the popover will render
|
|
656
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
654
657
|
*/
|
|
655
658
|
offset: _propTypes.default.number,
|
|
656
659
|
/**
|
package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js
CHANGED
|
@@ -36,6 +36,7 @@ var EuiSelectableTemplateSitewidePopover = exports.EuiSelectableTemplateSitewide
|
|
|
36
36
|
var styles = (0, _services.useEuiMemoizedStyles)(_selectable_template_sitewide.euiSelectableTemplateSitewidePopoverStyles);
|
|
37
37
|
return (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
|
|
38
38
|
panelPaddingSize: "none",
|
|
39
|
+
anchorPosition: "downCenter",
|
|
39
40
|
isOpen: isOpen,
|
|
40
41
|
ownFocus: !!trigger,
|
|
41
42
|
display: trigger ? 'inline-block' : 'block'
|
|
@@ -14,11 +14,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
|
-
name: "
|
|
18
|
-
styles: "flex-direction:column;
|
|
17
|
+
name: "7d9p9x-mobile",
|
|
18
|
+
styles: "flex-direction:column;label:mobile;"
|
|
19
19
|
} : {
|
|
20
|
-
name: "
|
|
21
|
-
styles: "flex-direction:column;
|
|
20
|
+
name: "7d9p9x-mobile",
|
|
21
|
+
styles: "flex-direction:column;label:mobile;",
|
|
22
22
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
23
|
};
|
|
24
24
|
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
@@ -12,9 +12,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _services = require("../../services");
|
|
14
14
|
var _responsive_context = require("./mobile/responsive_context");
|
|
15
|
+
var _table_context = require("./table_context");
|
|
15
16
|
var _table = require("./table.styles");
|
|
16
17
|
var _react2 = require("@emotion/react");
|
|
17
|
-
var _excluded = ["children", "className", "compressed", "tableLayout", "responsiveBreakpoint"];
|
|
18
|
+
var _excluded = ["children", "className", "compressed", "tableLayout", "hasBackground", "responsiveBreakpoint"];
|
|
18
19
|
/*
|
|
19
20
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
20
21
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -28,19 +29,25 @@ var EuiTable = exports.EuiTable = function EuiTable(_ref) {
|
|
|
28
29
|
compressed = _ref.compressed,
|
|
29
30
|
_ref$tableLayout = _ref.tableLayout,
|
|
30
31
|
tableLayout = _ref$tableLayout === void 0 ? 'fixed' : _ref$tableLayout,
|
|
32
|
+
_ref$hasBackground = _ref.hasBackground,
|
|
33
|
+
hasBackground = _ref$hasBackground === void 0 ? true : _ref$hasBackground,
|
|
31
34
|
responsiveBreakpoint = _ref.responsiveBreakpoint,
|
|
32
35
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
33
36
|
var isResponsive = (0, _responsive_context.useIsEuiTableResponsive)(responsiveBreakpoint);
|
|
34
37
|
var classes = (0, _classnames.default)('euiTable', className);
|
|
35
38
|
var styles = (0, _services.useEuiMemoizedStyles)(_table.euiTableStyles);
|
|
36
|
-
var cssStyles = [styles.euiTable, styles.layout[tableLayout], (!compressed || isResponsive) && styles.uncompressed, compressed && !isResponsive && styles.compressed, isResponsive ? styles.mobile : styles.desktop];
|
|
39
|
+
var cssStyles = [styles.euiTable, styles.layout[tableLayout], (!compressed || isResponsive) && styles.uncompressed, compressed && !isResponsive && styles.compressed, hasBackground && styles.hasBackground, isResponsive ? styles.mobile : styles.desktop];
|
|
37
40
|
return (0, _react2.jsx)("table", (0, _extends2.default)({
|
|
38
41
|
tabIndex: -1,
|
|
39
42
|
css: cssStyles,
|
|
40
43
|
className: classes
|
|
41
44
|
}, rest), (0, _react2.jsx)(_responsive_context.EuiTableIsResponsiveContext.Provider, {
|
|
42
45
|
value: isResponsive
|
|
43
|
-
},
|
|
46
|
+
}, (0, _react2.jsx)(_table_context.EuiTableVariantContext.Provider, {
|
|
47
|
+
value: {
|
|
48
|
+
hasBackground: hasBackground
|
|
49
|
+
}
|
|
50
|
+
}, children)));
|
|
44
51
|
};
|
|
45
52
|
EuiTable.propTypes = {
|
|
46
53
|
compressed: _propTypes.default.bool,
|
|
@@ -56,8 +63,14 @@ EuiTable.propTypes = {
|
|
|
56
63
|
responsiveBreakpoint: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.bool.isRequired]),
|
|
57
64
|
/**
|
|
58
65
|
* Sets the table-layout CSS property
|
|
66
|
+
* @default 'fixed'
|
|
59
67
|
*/
|
|
60
68
|
tableLayout: _propTypes.default.oneOf(["fixed", "auto"]),
|
|
69
|
+
/**
|
|
70
|
+
* Toggle the table's background
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
hasBackground: _propTypes.default.bool,
|
|
61
74
|
className: _propTypes.default.string,
|
|
62
75
|
"aria-label": _propTypes.default.string,
|
|
63
76
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -71,11 +71,12 @@ var euiTableStyles = exports.euiTableStyles = function euiTableStyles(euiThemeCo
|
|
|
71
71
|
cellContentPadding = _euiTableVariables.cellContentPadding,
|
|
72
72
|
compressedCellContentPadding = _euiTableVariables.compressedCellContentPadding;
|
|
73
73
|
return {
|
|
74
|
-
euiTable: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiNumberFormat)(euiThemeContext), " ", (0, _global_styling.logicalCSS)('width', '100%'), " border:none;border-collapse:collapse
|
|
74
|
+
euiTable: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiNumberFormat)(euiThemeContext), " ", (0, _global_styling.logicalCSS)('width', '100%'), " border:none;border-collapse:collapse;;label:euiTable;"),
|
|
75
75
|
layout: {
|
|
76
76
|
fixed: _ref3,
|
|
77
77
|
auto: _ref2
|
|
78
78
|
},
|
|
79
|
+
hasBackground: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.backgroundBasePlain, ";;label:hasBackground;"),
|
|
79
80
|
/**
|
|
80
81
|
* 1. The padding on the `.euiTableCellContent` div allows the ellipsis to show if the
|
|
81
82
|
* content is truncated. If the padding was on the cell, the ellipsis would be cropped.
|
|
@@ -30,7 +30,10 @@ var euiTableHeaderFooterCellStyles = exports.euiTableHeaderFooterCellStyles = fu
|
|
|
30
30
|
euiTableHeaderCell: /*#__PURE__*/(0, _react.css)(sharedStyles, ";;label:euiTableHeaderCell;"),
|
|
31
31
|
euiTableHeaderCell__content: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xs, ";;label:euiTableHeaderCell__content;"),
|
|
32
32
|
euiTableHeaderCell__button: /*#__PURE__*/(0, _react.css)((0, _global_styling.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;"),
|
|
33
|
-
euiTableFooterCell:
|
|
33
|
+
euiTableFooterCell: {
|
|
34
|
+
euiTableFooterCell: /*#__PURE__*/(0, _react.css)(sharedStyles, ";;label:euiTableFooterCell;"),
|
|
35
|
+
hasBackground: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.components.tableFooterBackground, ";;label:hasBackground;")
|
|
36
|
+
}
|
|
34
37
|
};
|
|
35
38
|
};
|
|
36
39
|
var euiTableCellCheckboxStyles = exports.euiTableCellCheckboxStyles = function euiTableCellCheckboxStyles(euiThemeContext) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EuiTableVariantContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/*
|
|
9
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
12
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
13
|
+
* Side Public License, v 1.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
var EuiTableVariantContext = exports.EuiTableVariantContext = /*#__PURE__*/(0, _react.createContext)({
|
|
17
|
+
hasBackground: true
|
|
18
|
+
});
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.EuiTableFooterCell = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _services = require("../../services");
|
|
14
15
|
var _utils = require("./utils");
|
|
15
16
|
var _table_cell_content = require("./_table_cell_content");
|
|
16
17
|
var _table_cells_shared = require("./table_cells_shared.styles");
|
|
18
|
+
var _table_context = require("./table_context");
|
|
17
19
|
var _react2 = require("@emotion/react");
|
|
18
20
|
var _excluded = ["children", "align", "className", "width", "style"];
|
|
19
21
|
/*
|
|
@@ -23,6 +25,8 @@ var _excluded = ["children", "align", "className", "width", "style"];
|
|
|
23
25
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
24
26
|
* Side Public License, v 1.
|
|
25
27
|
*/
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
26
30
|
var EuiTableFooterCell = exports.EuiTableFooterCell = function EuiTableFooterCell(_ref) {
|
|
27
31
|
var children = _ref.children,
|
|
28
32
|
_ref$align = _ref.align,
|
|
@@ -31,11 +35,14 @@ var EuiTableFooterCell = exports.EuiTableFooterCell = function EuiTableFooterCel
|
|
|
31
35
|
width = _ref.width,
|
|
32
36
|
style = _ref.style,
|
|
33
37
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
|
+
var _useContext = (0, _react.useContext)(_table_context.EuiTableVariantContext),
|
|
39
|
+
hasBackground = _useContext.hasBackground;
|
|
34
40
|
var classes = (0, _classnames.default)('euiTableFooterCell', className);
|
|
35
41
|
var inlineStyles = (0, _utils.resolveWidthAsStyle)(style, width);
|
|
36
42
|
var styles = (0, _services.useEuiMemoizedStyles)(_table_cells_shared.euiTableHeaderFooterCellStyles);
|
|
43
|
+
var cssStyles = [styles.euiTableFooterCell.euiTableFooterCell, hasBackground && styles.euiTableFooterCell.hasBackground];
|
|
37
44
|
return (0, _react2.jsx)("td", (0, _extends2.default)({
|
|
38
|
-
css:
|
|
45
|
+
css: cssStyles,
|
|
39
46
|
className: classes,
|
|
40
47
|
style: inlineStyles
|
|
41
48
|
}, rest), (0, _react2.jsx)(_table_cell_content.EuiTableCellContent, {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.EuiTableRow = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _services = require("../../services");
|
|
14
15
|
var _responsive_context = require("./mobile/responsive_context");
|
|
16
|
+
var _table_context = require("./table_context");
|
|
15
17
|
var _table_row = require("./table_row.styles");
|
|
16
18
|
var _react2 = require("@emotion/react");
|
|
17
19
|
var _excluded = ["children", "className", "hasSelection", "isSelected", "isSelectable", "hasActions", "isExpandedRow", "isExpandable", "onClick"];
|
|
@@ -22,6 +24,8 @@ var _excluded = ["children", "className", "hasSelection", "isSelected", "isSelec
|
|
|
22
24
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
23
25
|
* Side Public License, v 1.
|
|
24
26
|
*/
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
25
29
|
var EuiTableRow = exports.EuiTableRow = function EuiTableRow(_ref) {
|
|
26
30
|
var children = _ref.children,
|
|
27
31
|
className = _ref.className,
|
|
@@ -34,8 +38,10 @@ var EuiTableRow = exports.EuiTableRow = function EuiTableRow(_ref) {
|
|
|
34
38
|
onClick = _ref.onClick,
|
|
35
39
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
36
40
|
var isResponsive = (0, _responsive_context.useEuiTableIsResponsive)();
|
|
41
|
+
var _useContext = (0, _react.useContext)(_table_context.EuiTableVariantContext),
|
|
42
|
+
hasBackground = _useContext.hasBackground;
|
|
37
43
|
var styles = (0, _services.useEuiMemoizedStyles)(_table_row.euiTableRowStyles);
|
|
38
|
-
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];
|
|
44
|
+
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];
|
|
39
45
|
var classes = (0, _classnames.default)('euiTableRow', className, {
|
|
40
46
|
'euiTableRow-isSelectable': isSelectable,
|
|
41
47
|
'euiTableRow-isSelected': isSelected,
|
|
@@ -32,7 +32,11 @@ var euiTableRowStyles = exports.euiTableRowStyles = function euiTableRowStyles(e
|
|
|
32
32
|
euiTableRow: /*#__PURE__*/(0, _react.css)(":where(&.euiTableRow--marked){background-color:", rowColors.marked.background, ";};label:euiTableRow;"),
|
|
33
33
|
desktop: {
|
|
34
34
|
desktop: /*#__PURE__*/(0, _react.css)("&:hover{background-color:", rowColors.hover, ";}", markedStyles, ";;label:desktop;"),
|
|
35
|
-
expanded:
|
|
35
|
+
expanded: {
|
|
36
|
+
expanded: /*#__PURE__*/(0, _react.css)(expandedAnimationCss, ";;label:expanded;"),
|
|
37
|
+
// skipping adding a css class as it's a default style when expanded
|
|
38
|
+
hasBackground: "\n background-color: ".concat(rowColors.hover, ";\n ")
|
|
39
|
+
},
|
|
36
40
|
clickable: /*#__PURE__*/(0, _react.css)("&:hover{background-color:", rowColors.clickable.hover, ";cursor:pointer;}", markedStyles, " &:focus{background-color:", rowColors.clickable.focus, ";};label:clickable;"),
|
|
37
41
|
selected: /*#__PURE__*/(0, _react.css)("&,&+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.background, ";}&:hover,&:hover+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.hover, ";};label:selected;"),
|
|
38
42
|
// Offset expanded & selectable rows by the checkbox width to line up content with the 2nd column
|
|
@@ -40,9 +44,21 @@ var euiTableRowStyles = exports.euiTableRowStyles = function euiTableRowStyles(e
|
|
|
40
44
|
checkboxOffset: /*#__PURE__*/(0, _react.css)("&>.euiTableRowCell:first-child{", (0, _global_styling.logicalCSS)('padding-left', checkboxSize), ";};label:checkboxOffset;")
|
|
41
45
|
},
|
|
42
46
|
mobile: {
|
|
43
|
-
mobile: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;flex-wrap:wrap;padding:", cellContentPadding, ";", (0, _global_styling.logicalCSS)('margin-bottom', cellContentPadding), (0,
|
|
47
|
+
mobile: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;flex-wrap:wrap;padding:", cellContentPadding, ";", (0, _global_styling.logicalCSS)('margin-bottom', cellContentPadding), " border-radius:", euiTheme.border.radius.medium, ";", (0, _supports.cssSupportsHasWithNextSibling)("\n &:has(+ .euiTableRow-isExpandedRow) {\n ".concat((0, _global_styling.logicalCSS)('border-bottom-left-radius', 0), "\n ").concat((0, _global_styling.logicalCSS)('border-bottom-right-radius', 0), "\n }\n ")), ";;label:mobile;"),
|
|
48
|
+
/* Omitting adding a class via css here as it's a default style on mobile, not a standalone prop-related style.
|
|
49
|
+
Adding it separate allows better appliance control via props without the need to override the styles. */
|
|
50
|
+
hasBorder: "\n ".concat((0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
51
|
+
// uses pseudo-border to align dimensions with shadows applied by `hasBackground`
|
|
52
|
+
none: "\n ".concat((0, _euiThemeCommon.euiBorderStyles)(euiThemeContext, {
|
|
53
|
+
side: 'all'
|
|
54
|
+
}), "\n transform: translateZ(0);\n "),
|
|
55
|
+
preferred: "\n border: ".concat(euiTheme.border.thin, "\n ")
|
|
56
|
+
}), "\n "),
|
|
57
|
+
hasBackground: /*#__PURE__*/(0, _react.css)((0, _euiThemeCommon.euiShadow)(euiThemeContext, 's', {
|
|
44
58
|
borderAllInHighContrastMode: true
|
|
45
|
-
}), " background-color:", euiTheme.colors.backgroundBasePlain, ";
|
|
59
|
+
}), " background-color:", euiTheme.colors.backgroundBasePlain, ";", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
60
|
+
none: "\n border: none;\n "
|
|
61
|
+
}), ";;label:hasBackground;"),
|
|
46
62
|
selected: /*#__PURE__*/(0, _react.css)("&,&+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.background, ";};label:selected;"),
|
|
47
63
|
/**
|
|
48
64
|
* Left column offset (no border)
|
|
@@ -61,7 +77,7 @@ var euiTableRowStyles = exports.euiTableRowStyles = function euiTableRowStyles(e
|
|
|
61
77
|
// On mobile, visually move the expanded row to join up with the
|
|
62
78
|
// preceding table row via negative margins
|
|
63
79
|
'margin-top', (0, _global_styling.mathWithUnits)([cellContentPadding, euiTheme.border.width.thin], function (x, y) {
|
|
64
|
-
return (x + y
|
|
80
|
+
return (x + y) * -1;
|
|
65
81
|
})), (0, _global_styling.logicalCSS)('padding-left', cellContentPadding), " ", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), " ", (0, _global_styling.logicalCSS)('border-top-left-radius', 0), " ", (0, _global_styling.logicalCSS)('border-top-right-radius', 0), " &:after{", (0, _global_styling.logicalCSS)('border-top', 'none'), ";}clip-path:polygon(-50% 0, 150% 0, 150% 150%, -50% 150%);>.euiTableRowCell{", (0, _global_styling.logicalCSS)('width', '100%'), ";}", expandedAnimationCss, ";;label:expanded;")
|
|
66
82
|
}
|
|
67
83
|
};
|
|
@@ -74,10 +74,10 @@ var euiTableRowCellStyles = exports.euiTableRowCellStyles = function euiTableRow
|
|
|
74
74
|
rightColumnContent: "\n position: absolute;\n ".concat((0, _global_styling.logicalCSS)('right', 0), "\n ").concat((0, _global_styling.logicalCSS)('min-width', '0'), "\n ").concat((0, _global_styling.logicalCSS)('width', mobileSizes.actions.width), "\n "),
|
|
75
75
|
get actions() {
|
|
76
76
|
// Note: Visible-on-hover actions on desktop always show on mobile
|
|
77
|
-
return /*#__PURE__*/(0, _react.css)(this.rightColumnContent, " ", (0, _global_styling.logicalCSS)('top', mobileSizes.actions.offset), "
|
|
77
|
+
return /*#__PURE__*/(0, _react.css)(this.rightColumnContent, " ", (0, _global_styling.logicalCSS)('top', mobileSizes.actions.offset), ".euiTableCellContent{padding:0;};label:actions;");
|
|
78
78
|
},
|
|
79
79
|
get expander() {
|
|
80
|
-
return /*#__PURE__*/(0, _react.css)(this.rightColumnContent, "
|
|
80
|
+
return /*#__PURE__*/(0, _react.css)(this.rightColumnContent, ";;label:expander;");
|
|
81
81
|
},
|
|
82
82
|
/**
|
|
83
83
|
* Custom actions may not be icons and therefore may not fit in a column
|
|
@@ -88,6 +88,6 @@ var euiTableRowCellStyles = exports.euiTableRowCellStyles = function euiTableRow
|
|
|
88
88
|
},
|
|
89
89
|
euiTableRowCell__mobileHeader: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)(), " font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 's', {
|
|
90
90
|
customScale: 'xxs'
|
|
91
|
-
}).fontSize, ";display:block;color:", euiTheme.colors.
|
|
91
|
+
}).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) &{", (0, _global_styling.logicalCSS)('min-height', euiTheme.size.l), ";};label:euiTableRowCell__mobileHeader;")
|
|
92
92
|
};
|
|
93
93
|
};
|
|
@@ -11,6 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
var _services = require("../../services");
|
|
14
15
|
var _tool_tip = require("./tool_tip.styles");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
16
17
|
var _excluded = ["onBlur", "onFocus", "onMouseOver", "onMouseOut", "id", "className", "children", "display", "isVisible"];
|
|
@@ -37,11 +38,18 @@ var EuiToolTipAnchor = exports.EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwar
|
|
|
37
38
|
var anchorCss = (0, _tool_tip.euiToolTipAnchorStyles)();
|
|
38
39
|
var cssStyles = [anchorCss.euiToolTipAnchor, anchorCss[display]];
|
|
39
40
|
var classes = (0, _classnames.default)('euiToolTipAnchor', className);
|
|
41
|
+
var anchorId = (0, _services.useGeneratedHtmlId)({
|
|
42
|
+
suffix: 'euiToolTipAnchor',
|
|
43
|
+
conditionalId: id ? "".concat(id, "-wrapper") : undefined
|
|
44
|
+
});
|
|
40
45
|
return (
|
|
41
46
|
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
42
47
|
(0, _react2.jsx)("span", (0, _extends2.default)({
|
|
43
48
|
ref: ref,
|
|
44
49
|
css: cssStyles
|
|
50
|
+
/* A11y: NVDA combines elements with identical markup into a single navigational stop. ¯\_(ツ)_/¯
|
|
51
|
+
The `id` ensures the wrappers are unique and navigated as standalone elements. (data- attributes don't work) */,
|
|
52
|
+
id: anchorId
|
|
45
53
|
}, rest, {
|
|
46
54
|
className: classes,
|
|
47
55
|
onMouseOver: onMouseOver,
|
|
@@ -21,7 +21,7 @@ var _tour_header = require("./_tour_header");
|
|
|
21
21
|
var _tour_footer = require("./_tour_footer");
|
|
22
22
|
var _tour = require("./tour.styles");
|
|
23
23
|
var _react2 = require("@emotion/react");
|
|
24
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "subtitle", "title", "decoration", "footerAction", "panelProps", "panelClassName"];
|
|
24
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "subtitle", "title", "decoration", "hasArrow", "footerAction", "panelProps", "panelClassName"];
|
|
25
25
|
/*
|
|
26
26
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
27
27
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -57,6 +57,7 @@ var EuiTourStep = exports.EuiTourStep = function EuiTourStep(_ref) {
|
|
|
57
57
|
title = _ref.title,
|
|
58
58
|
_ref$decoration = _ref.decoration,
|
|
59
59
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
60
|
+
hasArrow = _ref.hasArrow,
|
|
60
61
|
footerAction = _ref.footerAction,
|
|
61
62
|
panelProps = _ref.panelProps,
|
|
62
63
|
panelClassName = _ref.panelClassName,
|
|
@@ -118,8 +119,9 @@ var EuiTourStep = exports.EuiTourStep = function EuiTourStep(_ref) {
|
|
|
118
119
|
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
119
120
|
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
120
121
|
}),
|
|
121
|
-
offset: hasBeacon ? 10 :
|
|
122
|
+
offset: hasBeacon && hasArrow !== false ? 10 : undefined,
|
|
122
123
|
"aria-labelledby": titleId,
|
|
124
|
+
hasArrow: hasArrow !== null && hasArrow !== void 0 ? hasArrow : hasBeacon,
|
|
123
125
|
arrowChildren: hasBeacon && (0, _react2.jsx)(_beacon.EuiBeacon, {
|
|
124
126
|
css: beaconCss,
|
|
125
127
|
className: "euiTour__beacon"
|
|
@@ -187,7 +189,8 @@ EuiTourStep.propTypes = {
|
|
|
187
189
|
*/
|
|
188
190
|
title: _propTypes.default.node.isRequired,
|
|
189
191
|
/**
|
|
190
|
-
* Extra visual indication of step location
|
|
192
|
+
* Extra visual indication of step location.
|
|
193
|
+
* It does not apply when `hasArrow=false`
|
|
191
194
|
*/
|
|
192
195
|
decoration: _propTypes.default.oneOf(["none", "beacon"]),
|
|
193
196
|
/**
|
|
@@ -11,6 +11,7 @@ var _react = require("@emotion/react");
|
|
|
11
11
|
var _euiThemeCommon = require("@elastic/eui-theme-common");
|
|
12
12
|
var _services = require("../../services");
|
|
13
13
|
var _functions = require("../functions");
|
|
14
|
+
var _selectors = require("../utility/selectors");
|
|
14
15
|
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; }
|
|
15
16
|
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) { (0, _defineProperty2.default)(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; } /*
|
|
16
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -208,11 +209,11 @@ var _interactionStyles = function _interactionStyles(euiThemeContext, buttonColo
|
|
|
208
209
|
var baseStyles = function baseStyles() {
|
|
209
210
|
// button hover is applied as pseudo element with a transparent background-color
|
|
210
211
|
if (type === 'overlay') {
|
|
211
|
-
return "\n position: relative;\n overflow: hidden;\n\n &:hover:not(
|
|
212
|
+
return "\n position: relative;\n overflow: hidden;\n\n &:hover:not(".concat(_selectors.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(_selectors.euiDisabledSelector, ") {\n &::before {\n ").concat((0, _functions.logicalCSS)('width', '100%'), "\n ").concat((0, _functions.logicalCSS)('height', '100%'), "\n\n content: '';\n position: absolute;\n inset: 0;\n background-color: ").concat(buttonColors.backgroundActive, ";\n }\n }\n ");
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
// button hover is applied as opaque color
|
|
215
|
-
return "\n &:hover:not(
|
|
216
|
+
return "\n &:hover:not(".concat(_selectors.euiDisabledSelector, ") {\n background-color: ").concat(buttonColors.backgroundHover, ";\n }\n\n &:active:not(").concat(_selectors.euiDisabledSelector, ") {\n background-color: ").concat(buttonColors.backgroundActive, ";\n }\n ");
|
|
216
217
|
};
|
|
217
218
|
return " \n ".concat((0, _functions.highContrastModeStyles)(euiThemeContext, {
|
|
218
219
|
none: baseStyles(),
|
|
@@ -225,7 +226,7 @@ var _interactionStyles = function _interactionStyles(euiThemeContext, buttonColo
|
|
|
225
226
|
*/
|
|
226
227
|
var highContrastHoverIndicatorStyles = exports.highContrastHoverIndicatorStyles = function highContrastHoverIndicatorStyles(_ref2) {
|
|
227
228
|
var euiTheme = _ref2.euiTheme;
|
|
228
|
-
return "\n &:hover:not(
|
|
229
|
+
return "\n &:hover:not(".concat(_selectors.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((0, _euiThemeCommon.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
229
230
|
return x / 2;
|
|
230
231
|
}), ";\n background-color: transparent;\n pointer-events: none;\n }\n }\n");
|
|
231
232
|
};
|
|
@@ -4,8 +4,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useEuiFontSize = exports.euiTextTruncate = exports.euiTextBreakWord = exports.euiNumberFormat = exports.euiFontSize = void 0;
|
|
7
|
+
exports.useEuiFontSize = exports.euiTextTruncateCSS = exports.euiTextTruncate = exports.euiTextBreakWord = exports.euiNumberFormat = exports.euiFontSize = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
9
10
|
var _typography = require("../functions/typography");
|
|
10
11
|
var _theme = require("../../services/theme");
|
|
11
12
|
var _typography2 = require("../variables/typography");
|
|
@@ -58,6 +59,14 @@ var euiTextTruncate = exports.euiTextTruncate = function euiTextTruncate() {
|
|
|
58
59
|
, "\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Emotion CSS wrapper around `euiTextTruncate` style.
|
|
64
|
+
*/
|
|
65
|
+
var euiTextTruncateCSS = exports.euiTextTruncateCSS = function euiTextTruncateCSS() {
|
|
66
|
+
var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
|
|
67
|
+
return /*#__PURE__*/(0, _react.css)(euiTextTruncate(maxWidth), ";;label:euiTextTruncateCSS;");
|
|
68
|
+
};
|
|
69
|
+
|
|
61
70
|
/**
|
|
62
71
|
* Fixed-width numbers for tabular data
|
|
63
72
|
*/
|