@elastic/eui 109.1.0-snapshot.1763390960850 → 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 +5 -6
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout"],
|
|
1
|
+
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground"],
|
|
2
2
|
_excluded2 = ["align", "render", "dataType", "isExpander", "textOnly", "name", "field", "description", "sortable", "footer", "mobileOptions", "nameTooltip"];
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -368,6 +368,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
368
368
|
tableCaption = _this$props2.tableCaption,
|
|
369
369
|
rowHeader = _this$props2.rowHeader,
|
|
370
370
|
tableLayout = _this$props2.tableLayout,
|
|
371
|
+
hasBackground = _this$props2.hasBackground,
|
|
371
372
|
rest = _objectWithoutProperties(_this$props2, _excluded);
|
|
372
373
|
var classes = classNames('euiBasicTable', {
|
|
373
374
|
'euiBasicTable-loading': loading
|
|
@@ -385,6 +386,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
385
386
|
compressed = _this$props3.compressed,
|
|
386
387
|
responsiveBreakpoint = _this$props3.responsiveBreakpoint,
|
|
387
388
|
tableLayout = _this$props3.tableLayout,
|
|
389
|
+
hasBackground = _this$props3.hasBackground,
|
|
388
390
|
loading = _this$props3.loading;
|
|
389
391
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTableHeaderMobile, {
|
|
390
392
|
responsiveBreakpoint: responsiveBreakpoint
|
|
@@ -393,6 +395,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
393
395
|
tableLayout: tableLayout,
|
|
394
396
|
responsiveBreakpoint: responsiveBreakpoint,
|
|
395
397
|
compressed: compressed,
|
|
398
|
+
hasBackground: hasBackground,
|
|
396
399
|
css: loading && safariLoadingWorkaround
|
|
397
400
|
}, this.renderTableCaption(), this.renderTableHead(), this.renderTableBody(), this.renderTableFooter())));
|
|
398
401
|
}
|
|
@@ -144,6 +144,7 @@ EuiBreadcrumbContent.propTypes = {
|
|
|
144
144
|
popoverProps: PropTypes.shape({
|
|
145
145
|
/**
|
|
146
146
|
* Alignment of the popover and arrow relative to the button
|
|
147
|
+
* @default downLeft
|
|
147
148
|
*/
|
|
148
149
|
anchorPosition: PropTypes.any,
|
|
149
150
|
/**
|
|
@@ -165,6 +166,7 @@ EuiBreadcrumbContent.propTypes = {
|
|
|
165
166
|
focusTrapProps: PropTypes.any,
|
|
166
167
|
/**
|
|
167
168
|
* Show arrow indicating to originating button
|
|
169
|
+
* @default false
|
|
168
170
|
*/
|
|
169
171
|
hasArrow: PropTypes.bool,
|
|
170
172
|
/**
|
|
@@ -257,6 +259,7 @@ EuiBreadcrumbContent.propTypes = {
|
|
|
257
259
|
zIndex: PropTypes.number,
|
|
258
260
|
/**
|
|
259
261
|
* Distance away from the anchor that the popover will render
|
|
262
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
260
263
|
*/
|
|
261
264
|
offset: PropTypes.number,
|
|
262
265
|
/**
|
|
@@ -155,6 +155,7 @@ EuiBreadcrumbs.propTypes = {
|
|
|
155
155
|
popoverProps: PropTypes.shape({
|
|
156
156
|
/**
|
|
157
157
|
* Alignment of the popover and arrow relative to the button
|
|
158
|
+
* @default downLeft
|
|
158
159
|
*/
|
|
159
160
|
anchorPosition: PropTypes.any,
|
|
160
161
|
/**
|
|
@@ -176,6 +177,7 @@ EuiBreadcrumbs.propTypes = {
|
|
|
176
177
|
focusTrapProps: PropTypes.any,
|
|
177
178
|
/**
|
|
178
179
|
* Show arrow indicating to originating button
|
|
180
|
+
* @default false
|
|
179
181
|
*/
|
|
180
182
|
hasArrow: PropTypes.bool,
|
|
181
183
|
/**
|
|
@@ -268,6 +270,7 @@ EuiBreadcrumbs.propTypes = {
|
|
|
268
270
|
zIndex: PropTypes.number,
|
|
269
271
|
/**
|
|
270
272
|
* Distance away from the anchor that the popover will render
|
|
273
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
271
274
|
*/
|
|
272
275
|
offset: PropTypes.number,
|
|
273
276
|
/**
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { logicalCSS } from '../../../global_styling';
|
|
11
|
+
import { euiDisabledSelector, logicalCSS } from '../../../global_styling';
|
|
12
12
|
import { highContrastModeStyles, preventForcedColors } from '../../../global_styling/functions/high_contrast';
|
|
13
13
|
import { euiFormVariables } from '../../form/form.styles';
|
|
14
14
|
export var euiButtonGroupStyles = {
|
|
@@ -43,6 +43,6 @@ var _highContrastStyles = function _highContrastStyles(euiThemeContext, compress
|
|
|
43
43
|
var euiTheme = euiThemeContext.euiTheme;
|
|
44
44
|
return highContrastModeStyles(euiThemeContext, {
|
|
45
45
|
preferred: compressed ? "\n .euiButtonGroupButton {\n border: none;\n }\n " : '',
|
|
46
|
-
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n &:is(:hover, :focus):not(
|
|
46
|
+
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n &:is(:hover, :focus):not(").concat(euiDisabledSelector, ") {\n &::before {\n border-color: ").concat(euiTheme.colors.textInverse, ";\n }\n }\n }\n\n .euiButtonGroupButton:is(").concat(euiDisabledSelector, ") {\n opacity: 0.5;\n }\n ")
|
|
47
47
|
});
|
|
48
48
|
};
|
|
@@ -92,7 +92,7 @@ export var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiT
|
|
|
92
92
|
},
|
|
93
93
|
compressed: /*#__PURE__*/css(logicalCSS('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";font-weight:", euiTheme.font.weight.medium, ";padding:0;margin:", euiTheme.size.xxs, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
94
94
|
return x / 2;
|
|
95
|
-
}), ";&+.euiButtonGroupButton{", logicalCSS('margin-left', '0'), ";}&:is(", selectedSelectors, "):not(
|
|
95
|
+
}), ";&+.euiButtonGroupButton{", logicalCSS('margin-left', '0'), ";}&:is(", selectedSelectors, "):not(", euiDisabledSelector, "){border:none;", highContrastModeStyles(euiThemeContext, {
|
|
96
96
|
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(mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
97
97
|
return x * 3;
|
|
98
98
|
}), ";\n }\n ")
|
|
@@ -101,10 +101,16 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// We can be forgiving for `dateFormat` if we are certain
|
|
105
|
+
// we're not expecting any of the other formats allowed;
|
|
106
|
+
// otherwise we can get valid but inaccurate results e.g.
|
|
107
|
+
// `1970-01-01` -> `Jan 19, 1970 @ 01:01:00.000`
|
|
108
|
+
var strictModeForPassedFormat = moment(textInputValue, ALLOWED_USER_DATE_FORMATS, true).isValid();
|
|
109
|
+
|
|
104
110
|
// Attempt to parse with passed `dateFormat` and `locale`
|
|
105
111
|
var _valueAsMoment = moment(textInputValue, dateFormat, typeof locale === 'string' ? locale : 'en',
|
|
106
112
|
// Narrow the union type to string
|
|
107
|
-
|
|
113
|
+
strictModeForPassedFormat);
|
|
108
114
|
var dateIsValid = _valueAsMoment.isValid();
|
|
109
115
|
|
|
110
116
|
// If not valid, try a few other standardized formats
|
|
@@ -31,11 +31,13 @@ import PropTypes from "prop-types";
|
|
|
31
31
|
import classNames from 'classnames';
|
|
32
32
|
import moment from 'moment'; // eslint-disable-line import/named
|
|
33
33
|
import dateMath from '@elastic/datemath';
|
|
34
|
-
import { useEuiMemoizedStyles } from '../../../services';
|
|
34
|
+
import { useEuiMemoizedStyles, RenderWithEuiTheme } from '../../../services';
|
|
35
35
|
import { isObject } from '../../../services/predicate';
|
|
36
|
+
import { euiTextTruncateCSS } from '../../../global_styling';
|
|
36
37
|
import { EuiI18nConsumer } from '../../context';
|
|
37
38
|
import { EuiDatePickerRange } from '../date_picker_range';
|
|
38
39
|
import { EuiFormControlButton, EuiFormControlLayout } from '../../form';
|
|
40
|
+
import { EuiToolTip } from '../../tool_tip';
|
|
39
41
|
import { RenderI18nTimeOptions } from './time_options';
|
|
40
42
|
import { PrettyDuration, showPrettyDuration } from './pretty_duration';
|
|
41
43
|
import { EuiTimeWindowButtons } from './time_window_buttons';
|
|
@@ -301,22 +303,38 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
301
303
|
};
|
|
302
304
|
var isDisabledDisplay = 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.parse(start);
|
|
308
|
+
var endMoment = dateMath.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 ___EmotionJSX(RenderWithEuiTheme, null, function (euiTheme) {
|
|
314
|
+
return ___EmotionJSX(EuiFormControlLayout, formControlLayoutProps, !isQuickSelectOnly && ___EmotionJSX(EuiToolTip, {
|
|
315
|
+
css: styles.euiSuperDatePicker__prettyDurationTooltip,
|
|
316
|
+
content: formattedFullRange,
|
|
317
|
+
display: "block",
|
|
318
|
+
offset: euiTheme.euiTheme.base * 0.5
|
|
319
|
+
}, ___EmotionJSX(EuiFormControlButton, {
|
|
320
|
+
type: "button",
|
|
321
|
+
className: classNames('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 : ___EmotionJSX("span", {
|
|
330
|
+
css: euiTextTruncateCSS()
|
|
331
|
+
}, ___EmotionJSX(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
|
|
|
@@ -65,9 +65,7 @@ export var euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiTheme
|
|
|
65
65
|
isQuickSelectOnly: /*#__PURE__*/css(logicalCSS('min-width', 0), ".euiFormControlLayout__prepend{", logicalCSS('max-width', 'none'), ";}.euiFormControlLayoutDelimited__delimiter:first-child{", logicalCSS('padding-horizontal', 0), ";};label:isQuickSelectOnly;"),
|
|
66
66
|
euiSuperDatePicker__range: _ref,
|
|
67
67
|
euiSuperDatePicker__rangeInput: /*#__PURE__*/css("flex-grow:1;", logicalCSS('width', 'auto'), " overflow:hidden;;label:euiSuperDatePicker__rangeInput;"),
|
|
68
|
-
|
|
69
|
-
preferred: "\n border: none;\n "
|
|
70
|
-
}), ";;label:euiSuperDatePicker__prettyFormat;"),
|
|
68
|
+
euiSuperDatePicker__prettyDurationTooltip: /*#__PURE__*/css(logicalCSS('max-width', 'min(58ch, 90vw)'), ";;label:euiSuperDatePicker__prettyDurationTooltip;"),
|
|
71
69
|
// Form states
|
|
72
70
|
states: {
|
|
73
71
|
euiSuperDatePicker__formControlLayout: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{--euiFormControlStateHoverColor:", forms.borderHovered, ";", highContrastModeStyles(euiThemeContext, {
|
|
@@ -19,15 +19,17 @@ var EuiFlexItemInternal = function EuiFlexItemInternal(_ref, ref) {
|
|
|
19
19
|
var children = _ref.children,
|
|
20
20
|
className = _ref.className,
|
|
21
21
|
_ref$grow = _ref.grow,
|
|
22
|
-
|
|
22
|
+
_grow = _ref$grow === void 0 ? true : _ref$grow,
|
|
23
23
|
_ref$component = _ref.component,
|
|
24
24
|
component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
// resets `grow` to the default value when an invalid value is passed
|
|
27
|
+
var grow = VALID_GROW_VALUES.indexOf(_grow) === -1 ? true : _grow;
|
|
26
28
|
useEffect(function () {
|
|
27
|
-
if (VALID_GROW_VALUES.indexOf(
|
|
28
|
-
|
|
29
|
+
if (process.env.NODE_ENV === 'development' && VALID_GROW_VALUES.indexOf(_grow) === -1) {
|
|
30
|
+
console.warn("Prop `grow` passed to `EuiFlexItem` must be a boolean or an integer between 0 and 10, received `".concat(_grow, "`. Defaulting to `true`."));
|
|
29
31
|
}
|
|
30
|
-
}, [
|
|
32
|
+
}, [_grow]);
|
|
31
33
|
var cssStyles = [styles.euiFlexItem, !grow ? styles.growZero : styles.grow, grow && (typeof grow === 'number' ? styles.growSizes[grow] : styles.growSizes['1'])];
|
|
32
34
|
var classes = classNames('euiFlexItem', className);
|
|
33
35
|
|
|
@@ -101,6 +101,7 @@ EuiHeaderBreadcrumbs.propTypes = {
|
|
|
101
101
|
popoverProps: PropTypes.shape({
|
|
102
102
|
/**
|
|
103
103
|
* Alignment of the popover and arrow relative to the button
|
|
104
|
+
* @default downLeft
|
|
104
105
|
*/
|
|
105
106
|
anchorPosition: PropTypes.any,
|
|
106
107
|
/**
|
|
@@ -122,6 +123,7 @@ EuiHeaderBreadcrumbs.propTypes = {
|
|
|
122
123
|
focusTrapProps: PropTypes.any,
|
|
123
124
|
/**
|
|
124
125
|
* Show arrow indicating to originating button
|
|
126
|
+
* @default false
|
|
125
127
|
*/
|
|
126
128
|
hasArrow: PropTypes.bool,
|
|
127
129
|
/**
|
|
@@ -214,6 +216,7 @@ EuiHeaderBreadcrumbs.propTypes = {
|
|
|
214
216
|
zIndex: PropTypes.number,
|
|
215
217
|
/**
|
|
216
218
|
* Distance away from the anchor that the popover will render
|
|
219
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
217
220
|
*/
|
|
218
221
|
offset: PropTypes.number,
|
|
219
222
|
/**
|
|
@@ -138,6 +138,7 @@ EuiHeaderLinks.propTypes = {
|
|
|
138
138
|
popoverProps: PropTypes.shape({
|
|
139
139
|
/**
|
|
140
140
|
* Alignment of the popover and arrow relative to the button
|
|
141
|
+
* @default downLeft
|
|
141
142
|
*/
|
|
142
143
|
anchorPosition: PropTypes.any,
|
|
143
144
|
/**
|
|
@@ -159,6 +160,7 @@ EuiHeaderLinks.propTypes = {
|
|
|
159
160
|
focusTrapProps: PropTypes.any,
|
|
160
161
|
/**
|
|
161
162
|
* Show arrow indicating to originating button
|
|
163
|
+
* @default false
|
|
162
164
|
*/
|
|
163
165
|
hasArrow: PropTypes.bool,
|
|
164
166
|
/**
|
|
@@ -251,6 +253,7 @@ EuiHeaderLinks.propTypes = {
|
|
|
251
253
|
zIndex: PropTypes.number,
|
|
252
254
|
/**
|
|
253
255
|
* Distance away from the anchor that the popover will render
|
|
256
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
254
257
|
*/
|
|
255
258
|
offset: PropTypes.number,
|
|
256
259
|
/**
|
|
@@ -315,6 +315,7 @@ EuiPageHeaderContent.propTypes = {
|
|
|
315
315
|
popoverProps: PropTypes.shape({
|
|
316
316
|
/**
|
|
317
317
|
* Alignment of the popover and arrow relative to the button
|
|
318
|
+
* @default downLeft
|
|
318
319
|
*/
|
|
319
320
|
anchorPosition: PropTypes.any,
|
|
320
321
|
/**
|
|
@@ -336,6 +337,7 @@ EuiPageHeaderContent.propTypes = {
|
|
|
336
337
|
focusTrapProps: PropTypes.any,
|
|
337
338
|
/**
|
|
338
339
|
* Show arrow indicating to originating button
|
|
340
|
+
* @default false
|
|
339
341
|
*/
|
|
340
342
|
hasArrow: PropTypes.bool,
|
|
341
343
|
/**
|
|
@@ -428,6 +430,7 @@ EuiPageHeaderContent.propTypes = {
|
|
|
428
430
|
zIndex: PropTypes.number,
|
|
429
431
|
/**
|
|
430
432
|
* Distance away from the anchor that the popover will render
|
|
433
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
431
434
|
*/
|
|
432
435
|
offset: PropTypes.number,
|
|
433
436
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["children", "className", "closePopover", "anchorPosition", "attachToAnchor", "repositionToCrossAxis", "display", "panelPaddingSize", "closeOnScroll", "ownFocus", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef"];
|
|
2
|
+
var _excluded = ["children", "className", "closePopover", "anchorPosition", "attachToAnchor", "repositionToCrossAxis", "display", "panelPaddingSize", "closeOnScroll", "ownFocus", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef", "offset"];
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -66,6 +66,8 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
66
66
|
onPanelResize = _ref.onPanelResize,
|
|
67
67
|
_inputRef = _ref.inputRef,
|
|
68
68
|
_panelRef = _ref.panelRef,
|
|
69
|
+
_ref$offset = _ref.offset,
|
|
70
|
+
offset = _ref$offset === void 0 ? 2 : _ref$offset,
|
|
69
71
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
70
72
|
var classes = classnames('euiInputPopover', className);
|
|
71
73
|
var euiTheme = useEuiTheme();
|
|
@@ -204,6 +206,7 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
204
206
|
closePopover: closePopover,
|
|
205
207
|
anchorPosition: anchorPosition,
|
|
206
208
|
attachToAnchor: attachToAnchor,
|
|
209
|
+
offset: offset,
|
|
207
210
|
repositionToCrossAxis: repositionToCrossAxis,
|
|
208
211
|
panelPaddingSize: panelPaddingSize,
|
|
209
212
|
ownFocus: ownFocus
|
|
@@ -204,8 +204,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
204
204
|
if (_this.button == null || _this.panel == null) return;
|
|
205
205
|
var _ref6 = _this.props,
|
|
206
206
|
anchorPosition = _ref6.anchorPosition,
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
_offset = _ref6.offset;
|
|
208
|
+
var offset = _offset != null ? _offset : _this.props.hasArrow ? 0 : 4;
|
|
209
209
|
var position = getPopoverPositionFromAnchorPosition(anchorPosition);
|
|
210
210
|
var forcePosition = undefined;
|
|
211
211
|
if (allowEnforcePosition && _this.state.isOpenStable && _this.state.openPosition != null) {
|
|
@@ -542,14 +542,15 @@ _defineProperty(EuiPopover, "defaultProps", {
|
|
|
542
542
|
isOpen: false,
|
|
543
543
|
ownFocus: true,
|
|
544
544
|
repositionToCrossAxis: true,
|
|
545
|
-
anchorPosition: '
|
|
545
|
+
anchorPosition: 'downLeft',
|
|
546
546
|
panelPaddingSize: 'm',
|
|
547
|
-
hasArrow:
|
|
547
|
+
hasArrow: false,
|
|
548
548
|
display: 'inline-block'
|
|
549
549
|
});
|
|
550
550
|
EuiPopover.propTypes = {
|
|
551
551
|
/**
|
|
552
552
|
* Alignment of the popover and arrow relative to the button
|
|
553
|
+
* @default downLeft
|
|
553
554
|
*/
|
|
554
555
|
anchorPosition: PropTypes.any,
|
|
555
556
|
/**
|
|
@@ -579,6 +580,7 @@ EuiPopover.propTypes = {
|
|
|
579
580
|
focusTrapProps: PropTypes.any,
|
|
580
581
|
/**
|
|
581
582
|
* Show arrow indicating to originating button
|
|
583
|
+
* @default false
|
|
582
584
|
*/
|
|
583
585
|
hasArrow: PropTypes.bool,
|
|
584
586
|
/**
|
|
@@ -675,6 +677,7 @@ EuiPopover.propTypes = {
|
|
|
675
677
|
zIndex: PropTypes.number,
|
|
676
678
|
/**
|
|
677
679
|
* Distance away from the anchor that the popover will render
|
|
680
|
+
* @default 4 (0 when `hasArrow=true`)
|
|
678
681
|
*/
|
|
679
682
|
offset: PropTypes.number,
|
|
680
683
|
/**
|
package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js
CHANGED
|
@@ -31,6 +31,7 @@ export var EuiSelectableTemplateSitewidePopover = function EuiSelectableTemplate
|
|
|
31
31
|
var styles = useEuiMemoizedStyles(euiSelectableTemplateSitewidePopoverStyles);
|
|
32
32
|
return ___EmotionJSX(EuiPopover, _extends({
|
|
33
33
|
panelPaddingSize: "none",
|
|
34
|
+
anchorPosition: "downCenter",
|
|
34
35
|
isOpen: isOpen,
|
|
35
36
|
ownFocus: !!trigger,
|
|
36
37
|
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,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "compressed", "tableLayout", "responsiveBreakpoint"];
|
|
1
|
+
var _excluded = ["children", "className", "compressed", "tableLayout", "hasBackground", "responsiveBreakpoint"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
@@ -15,6 +15,7 @@ import PropTypes from "prop-types";
|
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import { useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { useIsEuiTableResponsive, EuiTableIsResponsiveContext } from './mobile/responsive_context';
|
|
18
|
+
import { EuiTableVariantContext } from './table_context';
|
|
18
19
|
import { euiTableStyles } from './table.styles';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
21
|
export var EuiTable = function EuiTable(_ref) {
|
|
@@ -23,19 +24,25 @@ export var EuiTable = function EuiTable(_ref) {
|
|
|
23
24
|
compressed = _ref.compressed,
|
|
24
25
|
_ref$tableLayout = _ref.tableLayout,
|
|
25
26
|
tableLayout = _ref$tableLayout === void 0 ? 'fixed' : _ref$tableLayout,
|
|
27
|
+
_ref$hasBackground = _ref.hasBackground,
|
|
28
|
+
hasBackground = _ref$hasBackground === void 0 ? true : _ref$hasBackground,
|
|
26
29
|
responsiveBreakpoint = _ref.responsiveBreakpoint,
|
|
27
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
31
|
var isResponsive = useIsEuiTableResponsive(responsiveBreakpoint);
|
|
29
32
|
var classes = classNames('euiTable', className);
|
|
30
33
|
var styles = useEuiMemoizedStyles(euiTableStyles);
|
|
31
|
-
var cssStyles = [styles.euiTable, styles.layout[tableLayout], (!compressed || isResponsive) && styles.uncompressed, compressed && !isResponsive && styles.compressed, isResponsive ? styles.mobile : styles.desktop];
|
|
34
|
+
var cssStyles = [styles.euiTable, styles.layout[tableLayout], (!compressed || isResponsive) && styles.uncompressed, compressed && !isResponsive && styles.compressed, hasBackground && styles.hasBackground, isResponsive ? styles.mobile : styles.desktop];
|
|
32
35
|
return ___EmotionJSX("table", _extends({
|
|
33
36
|
tabIndex: -1,
|
|
34
37
|
css: cssStyles,
|
|
35
38
|
className: classes
|
|
36
39
|
}, rest), ___EmotionJSX(EuiTableIsResponsiveContext.Provider, {
|
|
37
40
|
value: isResponsive
|
|
38
|
-
},
|
|
41
|
+
}, ___EmotionJSX(EuiTableVariantContext.Provider, {
|
|
42
|
+
value: {
|
|
43
|
+
hasBackground: hasBackground
|
|
44
|
+
}
|
|
45
|
+
}, children)));
|
|
39
46
|
};
|
|
40
47
|
EuiTable.propTypes = {
|
|
41
48
|
compressed: PropTypes.bool,
|
|
@@ -51,8 +58,14 @@ EuiTable.propTypes = {
|
|
|
51
58
|
responsiveBreakpoint: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.bool.isRequired]),
|
|
52
59
|
/**
|
|
53
60
|
* Sets the table-layout CSS property
|
|
61
|
+
* @default 'fixed'
|
|
54
62
|
*/
|
|
55
63
|
tableLayout: PropTypes.oneOf(["fixed", "auto"]),
|
|
64
|
+
/**
|
|
65
|
+
* Toggle the table's background
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
hasBackground: PropTypes.bool,
|
|
56
69
|
className: PropTypes.string,
|
|
57
70
|
"aria-label": PropTypes.string,
|
|
58
71
|
"data-test-subj": PropTypes.string,
|
|
@@ -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.
|
|
@@ -28,7 +28,10 @@ export var euiTableHeaderFooterCellStyles = function euiTableHeaderFooterCellSty
|
|
|
28
28
|
euiTableHeaderCell: /*#__PURE__*/css(sharedStyles, ";;label:euiTableHeaderCell;"),
|
|
29
29
|
euiTableHeaderCell__content: /*#__PURE__*/css("gap:", euiTheme.size.xs, ";;label:euiTableHeaderCell__content;"),
|
|
30
30
|
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;"),
|
|
31
|
-
euiTableFooterCell:
|
|
31
|
+
euiTableFooterCell: {
|
|
32
|
+
euiTableFooterCell: /*#__PURE__*/css(sharedStyles, ";;label:euiTableFooterCell;"),
|
|
33
|
+
hasBackground: /*#__PURE__*/css("background-color:", euiTheme.components.tableFooterBackground, ";;label:hasBackground;")
|
|
34
|
+
}
|
|
32
35
|
};
|
|
33
36
|
};
|
|
34
37
|
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
|
+
});
|
|
@@ -10,13 +10,14 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React from 'react';
|
|
13
|
+
import React, { useContext } from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import { useEuiMemoizedStyles, LEFT_ALIGNMENT } from '../../services';
|
|
17
17
|
import { resolveWidthAsStyle } from './utils';
|
|
18
18
|
import { EuiTableCellContent } from './_table_cell_content';
|
|
19
19
|
import { euiTableHeaderFooterCellStyles } from './table_cells_shared.styles';
|
|
20
|
+
import { EuiTableVariantContext } from './table_context';
|
|
20
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
22
|
export var EuiTableFooterCell = function EuiTableFooterCell(_ref) {
|
|
22
23
|
var children = _ref.children,
|
|
@@ -26,11 +27,14 @@ export var EuiTableFooterCell = function EuiTableFooterCell(_ref) {
|
|
|
26
27
|
width = _ref.width,
|
|
27
28
|
style = _ref.style,
|
|
28
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
var _useContext = useContext(EuiTableVariantContext),
|
|
31
|
+
hasBackground = _useContext.hasBackground;
|
|
29
32
|
var classes = classNames('euiTableFooterCell', className);
|
|
30
33
|
var inlineStyles = resolveWidthAsStyle(style, width);
|
|
31
34
|
var styles = useEuiMemoizedStyles(euiTableHeaderFooterCellStyles);
|
|
35
|
+
var cssStyles = [styles.euiTableFooterCell.euiTableFooterCell, hasBackground && styles.euiTableFooterCell.hasBackground];
|
|
32
36
|
return ___EmotionJSX("td", _extends({
|
|
33
|
-
css:
|
|
37
|
+
css: cssStyles,
|
|
34
38
|
className: classes,
|
|
35
39
|
style: inlineStyles
|
|
36
40
|
}, rest), ___EmotionJSX(EuiTableCellContent, {
|
|
@@ -10,11 +10,12 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React from 'react';
|
|
13
|
+
import React, { useContext } from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import { keys, useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { useEuiTableIsResponsive } from './mobile/responsive_context';
|
|
18
|
+
import { EuiTableVariantContext } from './table_context';
|
|
18
19
|
import { euiTableRowStyles } from './table_row.styles';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
21
|
export var EuiTableRow = function EuiTableRow(_ref) {
|
|
@@ -29,8 +30,10 @@ export var EuiTableRow = function EuiTableRow(_ref) {
|
|
|
29
30
|
onClick = _ref.onClick,
|
|
30
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
32
|
var isResponsive = useEuiTableIsResponsive();
|
|
33
|
+
var _useContext = useContext(EuiTableVariantContext),
|
|
34
|
+
hasBackground = _useContext.hasBackground;
|
|
32
35
|
var styles = useEuiMemoizedStyles(euiTableRowStyles);
|
|
33
|
-
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];
|
|
36
|
+
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];
|
|
34
37
|
var classes = classNames('euiTableRow', className, {
|
|
35
38
|
'euiTableRow-isSelectable': isSelectable,
|
|
36
39
|
'euiTableRow-isSelected': isSelected,
|
|
@@ -9,8 +9,8 @@ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.fre
|
|
|
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
|
};
|