@elastic/eui 93.6.0 → 94.1.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.
Files changed (147) hide show
  1. package/dist/eui_theme_dark.css +0 -765
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -765
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +123 -133
  6. package/es/components/basic_table/basic_table.styles.js +3 -17
  7. package/es/components/basic_table/collapsed_item_actions.js +11 -20
  8. package/es/components/basic_table/default_item_action.js +9 -16
  9. package/es/components/basic_table/expanded_item_actions.js +1 -2
  10. package/es/components/basic_table/in_memory_table.js +63 -78
  11. package/es/components/provider/component_defaults/component_defaults.js +7 -1
  12. package/es/components/table/_table_cell_content.js +72 -0
  13. package/es/components/table/_table_cell_content.styles.js +63 -0
  14. package/es/components/table/index.js +0 -1
  15. package/es/components/table/mobile/responsive_context.js +37 -0
  16. package/es/components/table/mobile/table_header_mobile.js +11 -4
  17. package/es/components/table/mobile/table_header_mobile.styles.js +15 -0
  18. package/es/components/table/mobile/table_sort_mobile.js +12 -3
  19. package/es/components/table/table.js +23 -13
  20. package/es/components/table/table.styles.js +102 -0
  21. package/es/components/table/table_cells_shared.styles.js +52 -0
  22. package/es/components/table/table_footer_cell.js +12 -12
  23. package/es/components/table/table_header_cell.js +58 -75
  24. package/es/components/table/table_header_cell_checkbox.js +6 -2
  25. package/es/components/table/table_row.js +18 -6
  26. package/es/components/table/table_row.styles.js +78 -0
  27. package/es/components/table/table_row_cell.js +65 -91
  28. package/es/components/table/table_row_cell.styles.js +89 -0
  29. package/es/components/table/table_row_cell_checkbox.js +7 -0
  30. package/eui.d.ts +667 -510
  31. package/i18ntokens.json +52 -52
  32. package/lib/components/basic_table/basic_table.js +122 -132
  33. package/lib/components/basic_table/basic_table.styles.js +5 -20
  34. package/lib/components/basic_table/collapsed_item_actions.js +11 -20
  35. package/lib/components/basic_table/default_item_action.js +12 -17
  36. package/lib/components/basic_table/expanded_item_actions.js +1 -2
  37. package/lib/components/basic_table/in_memory_table.js +63 -78
  38. package/lib/components/provider/component_defaults/component_defaults.js +7 -1
  39. package/lib/components/table/_table_cell_content.js +82 -0
  40. package/lib/components/table/_table_cell_content.styles.js +68 -0
  41. package/lib/components/table/index.js +0 -7
  42. package/lib/components/table/mobile/responsive_context.js +47 -0
  43. package/lib/components/table/mobile/table_header_mobile.js +11 -4
  44. package/lib/components/table/mobile/table_header_mobile.styles.js +22 -0
  45. package/lib/components/table/mobile/table_sort_mobile.js +12 -3
  46. package/lib/components/table/table.js +23 -13
  47. package/lib/components/table/table.styles.js +109 -0
  48. package/lib/components/table/table_cells_shared.styles.js +58 -0
  49. package/lib/components/table/table_footer_cell.js +11 -11
  50. package/lib/components/table/table_header_cell.js +58 -75
  51. package/lib/components/table/table_header_cell_checkbox.js +6 -2
  52. package/lib/components/table/table_row.js +17 -5
  53. package/lib/components/table/table_row.styles.js +84 -0
  54. package/lib/components/table/table_row_cell.js +64 -92
  55. package/lib/components/table/table_row_cell.styles.js +94 -0
  56. package/lib/components/table/table_row_cell_checkbox.js +7 -0
  57. package/optimize/es/components/basic_table/basic_table.js +56 -59
  58. package/optimize/es/components/basic_table/basic_table.styles.js +3 -17
  59. package/optimize/es/components/basic_table/collapsed_item_actions.js +11 -20
  60. package/optimize/es/components/basic_table/default_item_action.js +9 -16
  61. package/optimize/es/components/basic_table/expanded_item_actions.js +1 -2
  62. package/optimize/es/components/basic_table/in_memory_table.js +1 -6
  63. package/optimize/es/components/table/_table_cell_content.js +56 -0
  64. package/optimize/es/components/table/_table_cell_content.styles.js +63 -0
  65. package/optimize/es/components/table/index.js +0 -1
  66. package/optimize/es/components/table/mobile/responsive_context.js +37 -0
  67. package/optimize/es/components/table/mobile/table_header_mobile.js +11 -4
  68. package/optimize/es/components/table/mobile/table_header_mobile.styles.js +15 -0
  69. package/optimize/es/components/table/mobile/table_sort_mobile.js +7 -1
  70. package/optimize/es/components/table/table.js +13 -12
  71. package/optimize/es/components/table/table.styles.js +102 -0
  72. package/optimize/es/components/table/table_cells_shared.styles.js +49 -0
  73. package/optimize/es/components/table/table_footer_cell.js +12 -12
  74. package/optimize/es/components/table/table_header_cell.js +57 -61
  75. package/optimize/es/components/table/table_header_cell_checkbox.js +6 -2
  76. package/optimize/es/components/table/table_row.js +10 -2
  77. package/optimize/es/components/table/table_row.styles.js +78 -0
  78. package/optimize/es/components/table/table_row_cell.js +49 -80
  79. package/optimize/es/components/table/table_row_cell.styles.js +89 -0
  80. package/optimize/es/components/table/table_row_cell_checkbox.js +7 -0
  81. package/optimize/lib/components/basic_table/basic_table.js +55 -58
  82. package/optimize/lib/components/basic_table/basic_table.styles.js +5 -20
  83. package/optimize/lib/components/basic_table/collapsed_item_actions.js +11 -20
  84. package/optimize/lib/components/basic_table/default_item_action.js +12 -17
  85. package/optimize/lib/components/basic_table/expanded_item_actions.js +1 -2
  86. package/optimize/lib/components/basic_table/in_memory_table.js +1 -6
  87. package/optimize/lib/components/table/_table_cell_content.js +66 -0
  88. package/optimize/lib/components/table/_table_cell_content.styles.js +68 -0
  89. package/optimize/lib/components/table/index.js +0 -7
  90. package/optimize/lib/components/table/mobile/responsive_context.js +47 -0
  91. package/optimize/lib/components/table/mobile/table_header_mobile.js +11 -4
  92. package/optimize/lib/components/table/mobile/table_header_mobile.styles.js +22 -0
  93. package/optimize/lib/components/table/mobile/table_sort_mobile.js +7 -1
  94. package/optimize/lib/components/table/table.js +13 -12
  95. package/optimize/lib/components/table/table.styles.js +109 -0
  96. package/optimize/lib/components/table/table_cells_shared.styles.js +56 -0
  97. package/optimize/lib/components/table/table_footer_cell.js +11 -11
  98. package/optimize/lib/components/table/table_header_cell.js +57 -61
  99. package/optimize/lib/components/table/table_header_cell_checkbox.js +6 -2
  100. package/optimize/lib/components/table/table_row.js +9 -1
  101. package/optimize/lib/components/table/table_row.styles.js +85 -0
  102. package/optimize/lib/components/table/table_row_cell.js +48 -82
  103. package/optimize/lib/components/table/table_row_cell.styles.js +94 -0
  104. package/optimize/lib/components/table/table_row_cell_checkbox.js +7 -0
  105. package/package.json +2 -2
  106. package/src/components/index.scss +0 -1
  107. package/test-env/components/basic_table/basic_table.js +118 -131
  108. package/test-env/components/basic_table/basic_table.styles.js +5 -20
  109. package/test-env/components/basic_table/collapsed_item_actions.js +11 -20
  110. package/test-env/components/basic_table/default_item_action.js +12 -17
  111. package/test-env/components/basic_table/expanded_item_actions.js +1 -2
  112. package/test-env/components/basic_table/in_memory_table.js +63 -78
  113. package/test-env/components/provider/component_defaults/component_defaults.js +7 -1
  114. package/test-env/components/table/_table_cell_content.js +76 -0
  115. package/test-env/components/table/_table_cell_content.styles.js +68 -0
  116. package/test-env/components/table/index.js +0 -7
  117. package/test-env/components/table/mobile/responsive_context.js +47 -0
  118. package/test-env/components/table/mobile/table_header_mobile.js +11 -4
  119. package/test-env/components/table/mobile/table_header_mobile.styles.js +22 -0
  120. package/test-env/components/table/mobile/table_sort_mobile.js +12 -3
  121. package/test-env/components/table/table.js +23 -13
  122. package/test-env/components/table/table.styles.js +109 -0
  123. package/test-env/components/table/table_cells_shared.styles.js +56 -0
  124. package/test-env/components/table/table_footer_cell.js +11 -11
  125. package/test-env/components/table/table_header_cell.js +58 -75
  126. package/test-env/components/table/table_header_cell_checkbox.js +6 -2
  127. package/test-env/components/table/table_row.js +17 -5
  128. package/test-env/components/table/table_row.styles.js +85 -0
  129. package/test-env/components/table/table_row_cell.js +59 -93
  130. package/test-env/components/table/table_row_cell.styles.js +94 -0
  131. package/test-env/components/table/table_row_cell_checkbox.js +7 -0
  132. package/es/components/table/table_header_button.js +0 -52
  133. package/lib/components/table/table_header_button.js +0 -59
  134. package/optimize/es/components/table/table_header_button.js +0 -43
  135. package/optimize/lib/components/table/table_header_button.js +0 -50
  136. package/src/components/date_picker/react-datepicker/LICENSE +0 -21
  137. package/src/components/date_picker/react-datepicker/README.md +0 -168
  138. package/src/components/table/_index.scss +0 -7
  139. package/src/components/table/_mixins.scss +0 -20
  140. package/src/components/table/_responsive.scss +0 -211
  141. package/src/components/table/_table.scss +0 -241
  142. package/src/components/table/_variables.scss +0 -17
  143. package/src/components/table/mobile/_index.scss +0 -1
  144. package/src/components/table/mobile/_mobile.scss +0 -17
  145. package/src/services/theme/README.md +0 -153
  146. package/src/test/README.md +0 -44
  147. package/test-env/components/table/table_header_button.js +0 -58
@@ -11,8 +11,10 @@ var _react = _interopRequireDefault(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
  var _services = require("../../services");
14
+ var _responsive_context = require("./mobile/responsive_context");
15
+ var _table_row = require("./table_row.styles");
14
16
  var _react2 = require("@emotion/react");
15
- var _excluded = ["children", "className", "isSelected", "isSelectable", "hasActions", "isExpandedRow", "isExpandable", "onClick"];
17
+ var _excluded = ["children", "className", "hasSelection", "isSelected", "isSelectable", "hasActions", "isExpandedRow", "isExpandable", "onClick"];
16
18
  /*
17
19
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
18
20
  * or more contributor license agreements. Licensed under the Elastic License
@@ -23,6 +25,7 @@ var _excluded = ["children", "className", "isSelected", "isSelectable", "hasActi
23
25
  var EuiTableRow = function EuiTableRow(_ref) {
24
26
  var children = _ref.children,
25
27
  className = _ref.className,
28
+ hasSelection = _ref.hasSelection,
26
29
  isSelected = _ref.isSelected,
27
30
  isSelectable = _ref.isSelectable,
28
31
  hasActions = _ref.hasActions,
@@ -30,6 +33,9 @@ var EuiTableRow = function EuiTableRow(_ref) {
30
33
  isExpandable = _ref.isExpandable,
31
34
  onClick = _ref.onClick,
32
35
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
+ var isResponsive = (0, _responsive_context.useEuiTableIsResponsive)();
37
+ 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, isSelected && styles.desktop.selected, isExpandedRow && styles.desktop.expanded, onClick && styles.desktop.clickable, isExpandedRow && hasSelection && styles.desktop.checkboxOffset];
33
39
  var classes = (0, _classnames.default)('euiTableRow', className, {
34
40
  'euiTableRow-isSelectable': isSelectable,
35
41
  'euiTableRow-isSelected': isSelected,
@@ -40,6 +46,7 @@ var EuiTableRow = function EuiTableRow(_ref) {
40
46
  });
41
47
  if (!onClick) {
42
48
  return (0, _react2.jsx)("tr", (0, _extends2.default)({
49
+ css: cssStyles,
43
50
  className: classes
44
51
  }, rest), children);
45
52
  }
@@ -54,6 +61,7 @@ var EuiTableRow = function EuiTableRow(_ref) {
54
61
  }
55
62
  };
56
63
  return (0, _react2.jsx)("tr", (0, _extends2.default)({
64
+ css: cssStyles,
57
65
  className: classes,
58
66
  onClick: onClick,
59
67
  onKeyDown: onKeyDown,
@@ -69,7 +77,11 @@ EuiTableRow.propTypes = {
69
77
  css: _propTypes.default.any,
70
78
  /**
71
79
  * Indicates if the table has a single column of checkboxes for selecting
72
- * rows (affects mobile only)
80
+ * rows (used for mobile styling)
81
+ */
82
+ hasSelection: _propTypes.default.bool,
83
+ /**
84
+ * Indicates that the current row's checkbox is selectable / not disabled
73
85
  */
74
86
  isSelectable: _propTypes.default.bool,
75
87
  /**
@@ -77,10 +89,10 @@ EuiTableRow.propTypes = {
77
89
  */
78
90
  isSelected: _propTypes.default.bool,
79
91
  /**
80
- * Indicates if the table has a dedicated column for icon-only actions
81
- * (affects mobile only)
92
+ * Indicates if the table has a dedicated column for actions
93
+ * (used for mobile styling and desktop action hover behavior)
82
94
  */
83
- hasActions: _propTypes.default.bool,
95
+ hasActions: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.oneOf(["custom"])]),
84
96
  /**
85
97
  * Indicates if the row will have an expanded row
86
98
  */
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.euiTableRowStyles = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = require("@emotion/react");
10
+ var _services = require("../../services");
11
+ var _global_styling = require("../../global_styling");
12
+ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
13
+ var _table = require("./table.styles");
14
+ var _templateObject;
15
+ /*
16
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
+ * or more contributor license agreements. Licensed under the Elastic License
18
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
19
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
20
+ * Side Public License, v 1.
21
+ */
22
+ var euiTableRowStyles = function euiTableRowStyles(euiThemeContext) {
23
+ var euiTheme = euiThemeContext.euiTheme;
24
+ var rowColors = _rowColorVariables(euiThemeContext);
25
+ var expandedAnimationCss = _expandedRowAnimation(euiThemeContext);
26
+ var _euiTableVariables = (0, _table.euiTableVariables)(euiThemeContext),
27
+ cellContentPadding = _euiTableVariables.cellContentPadding,
28
+ mobileSizes = _euiTableVariables.mobileSizes,
29
+ checkboxSize = _euiTableVariables.checkboxSize;
30
+ return {
31
+ euiTableRow: /*#__PURE__*/(0, _react.css)(";label:euiTableRow;"),
32
+ desktop: {
33
+ desktop: /*#__PURE__*/(0, _react.css)("&:hover{background-color:", rowColors.hover, ";};label:desktop;"),
34
+ expanded: /*#__PURE__*/(0, _react.css)("background-color:", rowColors.hover, ";", expandedAnimationCss, ";;label:expanded;"),
35
+ clickable: /*#__PURE__*/(0, _react.css)("&:hover{background-color:", rowColors.clickable.hover, ";cursor:pointer;}&:focus{background-color:", rowColors.clickable.focus, ";};label:clickable;"),
36
+ selected: /*#__PURE__*/(0, _react.css)("&,&+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.color, ";}&:hover,&:hover+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.hover, ";};label:selected;"),
37
+ // Offset expanded & selectable rows by the checkbox width to line up content with the 2nd column
38
+ // Set on the `<td>` because padding can't be applied to `<tr>` elements directly
39
+ checkboxOffset: /*#__PURE__*/(0, _react.css)(".euiTableRowCell:first-child{", (0, _global_styling.logicalCSS)('padding-left', checkboxSize), ";};label:checkboxOffset;")
40
+ },
41
+ mobile: {
42
+ mobile: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;flex-wrap:wrap;padding:", cellContentPadding, ";", (0, _global_styling.logicalCSS)('margin-bottom', cellContentPadding), (0, _mixins.euiShadow)(euiThemeContext, 's'), " background-color:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'plain'), ";border-radius:", euiTheme.border.radius.medium, ";;label:mobile;"),
43
+ selected: /*#__PURE__*/(0, _react.css)("&,&+.euiTableRow-isExpandedRow{background-color:", rowColors.selected.color, ";};label:selected;"),
44
+ /**
45
+ * Left column offset (no border)
46
+ * Used for selection checkbox, which will be absolutely positioned
47
+ */
48
+ hasLeftColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', mobileSizes.checkbox.width), ";;label:hasLeftColumn;"),
49
+ /**
50
+ * Right column styles + border
51
+ * Used for cell actions and row expander arrow
52
+ */
53
+ hasRightColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-right', mobileSizes.actions.width), " &::after{content:'';position:absolute;", (0, _global_styling.logicalCSS)('vertical', 0), " ", (0, _global_styling.logicalCSS)('right', mobileSizes.actions.width), " ", (0, _global_styling.logicalCSS)('width', euiTheme.border.width.thin), " background-color:", euiTheme.border.color, ";};label:hasRightColumn;"),
54
+ /**
55
+ * Bottom of card - expanded rows
56
+ */
57
+ expanded: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', "-".concat(mobileSizes.actions.offset)), (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), " .euiTableRowCell{", (0, _global_styling.logicalCSS)('width', '100%'), ";}", expandedAnimationCss, ";;label:expanded;")
58
+ }
59
+ };
60
+ };
61
+ exports.euiTableRowStyles = euiTableRowStyles;
62
+ var _expandedRowAnimation = function _expandedRowAnimation(_ref) {
63
+ var euiTheme = _ref.euiTheme;
64
+ // Do not attempt to animate to height auto - down that road dragons lie
65
+ // @see https://github.com/elastic/eui/pull/6826
66
+ var expandRow = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateY(-", ");\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n "])), euiTheme.size.m);
67
+
68
+ // Animation must be on the contents div inside, not the row itself
69
+ return /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{.euiTableCellContent{animation:", euiTheme.animation.fast, " ", euiTheme.animation.resistance, " 1 normal none ", expandRow, ";}}");
70
+ };
71
+ var _rowColorVariables = function _rowColorVariables(_ref2) {
72
+ var euiTheme = _ref2.euiTheme,
73
+ colorMode = _ref2.colorMode;
74
+ return {
75
+ hover: colorMode === 'DARK' ? euiTheme.colors.lightestShade : (0, _services.tint)(euiTheme.colors.lightestShade, 0.5),
76
+ selected: {
77
+ color: colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.primary, 0.7) : (0, _services.tint)(euiTheme.colors.primary, 0.96),
78
+ hover: colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.primary, 0.75) : (0, _services.tint)(euiTheme.colors.primary, 0.9)
79
+ },
80
+ clickable: {
81
+ hover: (0, _services.transparentize)(euiTheme.colors.primary, 0.05),
82
+ focus: (0, _services.transparentize)(euiTheme.colors.primary, 0.1)
83
+ }
84
+ };
85
+ };
@@ -1,23 +1,24 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.EuiTableRowCell = void 0;
9
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
- var _react = _interopRequireWildcard(require("react"));
12
+ var _react = _interopRequireDefault(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
15
  var _services = require("../../services");
16
- var _predicate = require("../../services/predicate");
17
- var _text_truncate = require("../text_truncate");
16
+ var _responsive_context = require("./mobile/responsive_context");
18
17
  var _utils = require("./utils");
18
+ var _table_cell_content = require("./_table_cell_content");
19
+ var _table_row_cell = require("./table_row_cell.styles");
19
20
  var _react2 = require("@emotion/react");
20
- var _excluded = ["align", "children", "className", "truncateText", "setScopeRow", "showOnHover", "textOnly", "hasActions", "isExpander", "style", "width", "valign", "mobileOptions"];
21
+ var _excluded = ["align", "children", "className", "truncateText", "setScopeRow", "textOnly", "hasActions", "isExpander", "style", "width", "valign", "mobileOptions"];
21
22
  /*
22
23
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
24
  * or more contributor license agreements. Licensed under the Elastic License
@@ -25,19 +26,15 @@ var _excluded = ["align", "children", "className", "truncateText", "setScopeRow"
25
26
  * in compliance with, at your election, the Elastic License 2.0 or the Server
26
27
  * Side Public License, v 1.
27
28
  */
28
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
30
29
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
30
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
32
31
  var EuiTableRowCell = function EuiTableRowCell(_ref) {
33
- var _mobileOptions$showOn, _mobileOptions$trunca;
34
32
  var _ref$align = _ref.align,
35
33
  align = _ref$align === void 0 ? _services.LEFT_ALIGNMENT : _ref$align,
36
34
  children = _ref.children,
37
35
  className = _ref.className,
38
36
  truncateText = _ref.truncateText,
39
37
  setScopeRow = _ref.setScopeRow,
40
- showOnHover = _ref.showOnHover,
41
38
  _ref$textOnly = _ref.textOnly,
42
39
  textOnly = _ref$textOnly === void 0 ? true : _ref$textOnly,
43
40
  hasActions = _ref.hasActions,
@@ -46,88 +43,57 @@ var EuiTableRowCell = function EuiTableRowCell(_ref) {
46
43
  width = _ref.width,
47
44
  _ref$valign = _ref.valign,
48
45
  valign = _ref$valign === void 0 ? 'middle' : _ref$valign,
49
- _ref$mobileOptions = _ref.mobileOptions,
50
- mobileOptions = _ref$mobileOptions === void 0 ? {
51
- show: true
52
- } : _ref$mobileOptions,
46
+ mobileOptions = _ref.mobileOptions,
53
47
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
54
- var cellClasses = (0, _classnames.default)('euiTableRowCell', (0, _defineProperty2.default)({
48
+ var isResponsive = (0, _responsive_context.useEuiTableIsResponsive)();
49
+ var styles = (0, _services.useEuiMemoizedStyles)(_table_row_cell.euiTableRowCellStyles);
50
+ var cssStyles = [styles.euiTableRowCell, setScopeRow && styles.rowHeader, isExpander && styles.isExpander, hasActions && styles.hasActions, styles[valign]].concat((0, _toConsumableArray2.default)(isResponsive ? [styles.mobile.mobile, (mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.enlarge) && styles.mobile.enlarge, hasActions === 'custom' && styles.mobile.customActions, hasActions === true && styles.mobile.actions, isExpander && styles.mobile.expander] : [styles.desktop.desktop, hasActions && styles.desktop.actions]));
51
+ var cellClasses = (0, _classnames.default)('euiTableRowCell', className, {
55
52
  'euiTableRowCell--hasActions': hasActions,
56
- 'euiTableRowCell--isExpander': isExpander,
57
- 'euiTableRowCell--hideForDesktop': mobileOptions.only,
58
- 'euiTableRowCell--enlargeForMobile': mobileOptions.enlarge
59
- }, "euiTableRowCell--".concat(valign), valign));
60
- var contentClasses = (0, _classnames.default)('euiTableCellContent', className, {
61
- 'euiTableCellContent--alignRight': align === _services.RIGHT_ALIGNMENT,
62
- 'euiTableCellContent--alignCenter': align === _services.CENTER_ALIGNMENT,
63
- 'euiTableCellContent--showOnHover': showOnHover,
64
- 'euiTableCellContent--truncateText': truncateText === true,
65
- // We're doing this rigamarole instead of creating `euiTableCellContent--textOnly` for BWC
66
- // purposes for the time-being.
67
- 'euiTableCellContent--overflowingContent': textOnly !== true
53
+ 'euiTableRowCell--isExpander': isExpander
68
54
  });
69
- var mobileContentClasses = (0, _classnames.default)('euiTableCellContent', className, {
70
- 'euiTableCellContent--alignRight': mobileOptions.align === _services.RIGHT_ALIGNMENT || align === _services.RIGHT_ALIGNMENT,
71
- 'euiTableCellContent--alignCenter': mobileOptions.align === _services.CENTER_ALIGNMENT || align === _services.CENTER_ALIGNMENT,
72
- 'euiTableCellContent--showOnHover': (_mobileOptions$showOn = mobileOptions.showOnHover) !== null && _mobileOptions$showOn !== void 0 ? _mobileOptions$showOn : showOnHover,
73
- 'euiTableCellContent--truncateText': (_mobileOptions$trunca = mobileOptions.truncateText) !== null && _mobileOptions$trunca !== void 0 ? _mobileOptions$trunca : truncateText,
74
- // We're doing this rigamarole instead of creating `euiTableCellContent--textOnly` for BWC
75
- // purposes for the time-being.
76
- 'euiTableCellContent--overflowingContent': mobileOptions.textOnly !== true || textOnly !== true
77
- });
78
- var childClasses = (0, _classnames.default)({
79
- euiTableCellContent__text: textOnly === true,
80
- euiTableCellContent__hoverItem: showOnHover
81
- });
82
- var widthValue = (0, _services.useIsWithinBreakpoints)(['xs', 's']) && mobileOptions.width ? mobileOptions.width : width;
55
+ var widthValue = isResponsive ? hasActions || isExpander ? undefined // On mobile, actions are shifted to a right column via CSS
56
+ : mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.width : width;
83
57
  var styleObj = (0, _utils.resolveWidthAsStyle)(style, widthValue);
84
- var modifyChildren = (0, _react.useCallback)(function (children) {
85
- var modifiedChildren = children;
86
- if (textOnly === true) {
87
- modifiedChildren = (0, _react2.jsx)("span", {
88
- className: childClasses
89
- }, children);
90
- } else if ( /*#__PURE__*/_react.default.isValidElement(children)) {
91
- modifiedChildren = _react.default.Children.map(children, function (child) {
92
- return /*#__PURE__*/_react.default.cloneElement(child, {
93
- className: (0, _classnames.default)(child.props.className, childClasses)
94
- });
95
- });
96
- }
97
- if ((0, _predicate.isObject)(truncateText) && truncateText.lines) {
98
- modifiedChildren = (0, _react2.jsx)(_text_truncate.EuiTextBlockTruncate, {
99
- lines: truncateText.lines,
100
- cloneElement: true
101
- }, modifiedChildren);
102
- }
103
- return modifiedChildren;
104
- }, [childClasses, textOnly, truncateText]);
105
- var childrenNode = modifyChildren(children);
106
- var hideForMobileClasses = 'euiTableRowCell--hideForMobile';
107
- var showForMobileClasses = 'euiTableRowCell--hideForDesktop';
108
58
  var Element = setScopeRow ? 'th' : 'td';
109
59
  var sharedProps = _objectSpread({
110
60
  scope: setScopeRow ? 'row' : undefined,
111
- style: styleObj
61
+ style: styleObj,
62
+ css: cssStyles
112
63
  }, rest);
113
- if (mobileOptions.show === false) {
114
- return (0, _react2.jsx)(Element, (0, _extends2.default)({
115
- className: "".concat(cellClasses, " ").concat(hideForMobileClasses)
116
- }, sharedProps), (0, _react2.jsx)("div", {
117
- className: contentClasses
118
- }, childrenNode));
64
+ var sharedContentProps = {
65
+ align: align,
66
+ textOnly: textOnly,
67
+ truncateText: truncateText,
68
+ hasActions: hasActions || isExpander
69
+ };
70
+ if (isResponsive) {
71
+ // Mobile view
72
+ if ((mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.show) === false) {
73
+ return null;
74
+ } else {
75
+ var _mobileOptions$align, _mobileOptions$trunca, _mobileOptions$textOn;
76
+ return (0, _react2.jsx)(Element, (0, _extends2.default)({
77
+ className: cellClasses
78
+ }, sharedProps), (mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.header) && (0, _react2.jsx)("div", {
79
+ className: "euiTableRowCell__mobileHeader",
80
+ css: styles.euiTableRowCell__mobileHeader
81
+ }, mobileOptions.header), (0, _react2.jsx)(_table_cell_content.EuiTableCellContent, (0, _extends2.default)({}, sharedContentProps, {
82
+ align: (_mobileOptions$align = mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.align) !== null && _mobileOptions$align !== void 0 ? _mobileOptions$align : 'left' // Default to left aligned mobile cells, unless consumers specifically set an alignment for mobile
83
+ ,
84
+ truncateText: (_mobileOptions$trunca = mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.truncateText) !== null && _mobileOptions$trunca !== void 0 ? _mobileOptions$trunca : truncateText,
85
+ textOnly: (_mobileOptions$textOn = mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.textOnly) !== null && _mobileOptions$textOn !== void 0 ? _mobileOptions$textOn : textOnly
86
+ }), (mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.render) || children));
87
+ }
119
88
  } else {
120
- return (0, _react2.jsx)(Element, (0, _extends2.default)({
121
- className: cellClasses
122
- }, sharedProps), mobileOptions.header && (0, _react2.jsx)("div", {
123
- className: "euiTableRowCell__mobileHeader ".concat(showForMobileClasses)
124
- }, mobileOptions.header), mobileOptions.render ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", {
125
- className: "".concat(mobileContentClasses, " ").concat(showForMobileClasses)
126
- }, modifyChildren(mobileOptions.render)), (0, _react2.jsx)("div", {
127
- className: "".concat(contentClasses, " ").concat(hideForMobileClasses)
128
- }, childrenNode)) : (0, _react2.jsx)("div", {
129
- className: contentClasses
130
- }, childrenNode));
89
+ // Desktop view
90
+ if (mobileOptions !== null && mobileOptions !== void 0 && mobileOptions.only) {
91
+ return null;
92
+ } else {
93
+ return (0, _react2.jsx)(Element, (0, _extends2.default)({
94
+ className: cellClasses
95
+ }, sharedProps), (0, _react2.jsx)(_table_cell_content.EuiTableCellContent, sharedContentProps, children));
96
+ }
131
97
  }
132
98
  };
133
99
  exports.EuiTableRowCell = EuiTableRowCell;
@@ -145,10 +111,10 @@ EuiTableRowCell.propTypes = {
145
111
  */
146
112
  setScopeRow: _propTypes.default.bool,
147
113
  /**
148
- * Indicates if the column is dedicated to icon-only actions (currently
149
- * affects mobile only)
114
+ * Indicates if the cell is dedicated to row actions
115
+ * (used for mobile styling and desktop action hover behavior)
150
116
  */
151
- hasActions: _propTypes.default.bool,
117
+ hasActions: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.oneOf(["custom"])]),
152
118
  /**
153
119
  * Indicates if the column is dedicated as the expandable row toggle
154
120
  */
@@ -160,10 +126,12 @@ EuiTableRowCell.propTypes = {
160
126
  mobileOptions: _propTypes.default.shape({
161
127
  /**
162
128
  * If false, will not render the cell at all for mobile
129
+ * @default true
163
130
  */
164
131
  show: _propTypes.default.bool,
165
132
  /**
166
133
  * Only show for mobile? If true, will not render the column at all for desktop
134
+ * @default false
167
135
  */
168
136
  only: _propTypes.default.bool,
169
137
  /**
@@ -178,23 +146,22 @@ EuiTableRowCell.propTypes = {
178
146
  header: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.bool.isRequired]),
179
147
  /**
180
148
  * Increase text size compared to rest of cells
149
+ * @default false
181
150
  */
182
151
  enlarge: _propTypes.default.bool,
183
152
  /**
184
153
  * Applies the value to the width of the cell in mobile view (typically 50%)
154
+ * @default 50%
185
155
  */
186
156
  width: _propTypes.default.any,
187
157
  /**
188
158
  * Horizontal alignment of the text in the cell
189
159
  */
190
160
  align: _propTypes.default.any,
191
- /**
192
- * _Should only be used for action cells_
193
- */
194
- showOnHover: _propTypes.default.bool,
195
161
  /**
196
162
  * Creates a text wrapper around cell content that helps word break or truncate
197
163
  * long text correctly.
164
+ * @default true
198
165
  */
199
166
  textOnly: _propTypes.default.bool,
200
167
  /**
@@ -202,6 +169,7 @@ EuiTableRowCell.propTypes = {
202
169
  * - Set to `true` to enable single-line truncation.
203
170
  * - To enable multi-line truncation, use a configuration object with `lines`
204
171
  * set to a number of lines to truncate to.
172
+ * @default false
205
173
  */
206
174
  truncateText: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.shape({
207
175
  lines: _propTypes.default.number.isRequired
@@ -211,13 +179,10 @@ EuiTableRowCell.propTypes = {
211
179
  * Horizontal alignment of the text in the cell
212
180
  */
213
181
  align: _propTypes.default.any,
214
- /**
215
- * _Should only be used for action cells_
216
- */
217
- showOnHover: _propTypes.default.bool,
218
182
  /**
219
183
  * Creates a text wrapper around cell content that helps word break or truncate
220
184
  * long text correctly.
185
+ * @default true
221
186
  */
222
187
  textOnly: _propTypes.default.bool,
223
188
  /**
@@ -225,6 +190,7 @@ EuiTableRowCell.propTypes = {
225
190
  * - Set to `true` to enable single-line truncation.
226
191
  * - To enable multi-line truncation, use a configuration object with `lines`
227
192
  * set to a number of lines to truncate to.
193
+ * @default false
228
194
  */
229
195
  truncateText: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.shape({
230
196
  lines: _propTypes.default.number.isRequired
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiTableRowCellStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _global_styling = require("../../global_styling");
9
+ var _table = require("./table.styles");
10
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+ var _ref = process.env.NODE_ENV === "production" ? {
18
+ name: "1amvdy6-bottom",
19
+ styles: "vertical-align:bottom;label:bottom;"
20
+ } : {
21
+ name: "1amvdy6-bottom",
22
+ styles: "vertical-align:bottom;label:bottom;",
23
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
24
+ };
25
+ var _ref2 = process.env.NODE_ENV === "production" ? {
26
+ name: "2f764e-top",
27
+ styles: "vertical-align:top;label:top;"
28
+ } : {
29
+ name: "2f764e-top",
30
+ styles: "vertical-align:top;label:top;",
31
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
32
+ };
33
+ var _ref3 = process.env.NODE_ENV === "production" ? {
34
+ name: "19hexhy-baseline",
35
+ styles: "vertical-align:baseline;label:baseline;"
36
+ } : {
37
+ name: "19hexhy-baseline",
38
+ styles: "vertical-align:baseline;label:baseline;",
39
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
40
+ };
41
+ var _ref4 = process.env.NODE_ENV === "production" ? {
42
+ name: "l1nme7-middle",
43
+ styles: "vertical-align:middle;label:middle;"
44
+ } : {
45
+ name: "l1nme7-middle",
46
+ styles: "vertical-align:middle;label:middle;",
47
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
48
+ };
49
+ var euiTableRowCellStyles = function euiTableRowCellStyles(euiThemeContext) {
50
+ var euiTheme = euiThemeContext.euiTheme;
51
+ var _euiTableVariables = (0, _table.euiTableVariables)(euiThemeContext),
52
+ mobileSizes = _euiTableVariables.mobileSizes;
53
+
54
+ // Unsets the extra strut caused by inline-block display of buttons/icons/tooltips.
55
+ // Without this, the row height jumps whenever actions are disabled.
56
+ var hasIcons = "line-height: 1;";
57
+ return {
58
+ euiTableRowCell: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.text, ";;label:euiTableRowCell;"),
59
+ rowHeader: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.regular, ";;label:rowHeader;"),
60
+ isExpander: /*#__PURE__*/(0, _react.css)(hasIcons, ";;label:isExpander;"),
61
+ hasActions: /*#__PURE__*/(0, _react.css)(hasIcons, ";;label:hasActions;"),
62
+ // valign
63
+ middle: _ref4,
64
+ baseline: _ref3,
65
+ top: _ref2,
66
+ bottom: _ref,
67
+ desktop: {
68
+ desktop: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-vertical', euiTheme.border.thin), ";;label:desktop;"),
69
+ actions: /*#__PURE__*/(0, _react.css)(".euiBasicTableAction-showOnHover{opacity:0;", _global_styling.euiCanAnimate, "{transition:opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";}}&:focus-within,.euiTableRow-hasActions:hover &{.euiBasicTableAction-showOnHover{opacity:1;}};label:actions;")
70
+ },
71
+ mobile: {
72
+ mobile: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', '50%'), ";;label:mobile;"),
73
+ enlarge: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'm'), ";;label:enlarge;"),
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
+ get actions() {
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), ";;label:actions;");
78
+ },
79
+ get expander() {
80
+ return /*#__PURE__*/(0, _react.css)(this.rightColumnContent, " ", (0, _global_styling.logicalCSS)('bottom', mobileSizes.actions.offset), ";;label:expander;");
81
+ },
82
+ /**
83
+ * Custom actions may not be icons and therefore may not fit in a column
84
+ * If they're the last cell, we can create a pseudo "row"/"border-top"
85
+ * that mimicks the visual separation that the right column has
86
+ */
87
+ customActions: /*#__PURE__*/(0, _react.css)("&:last-child{", (0, _global_styling.logicalCSS)('width', '100%'), " &::before{content:'';position:absolute;", (0, _global_styling.logicalCSS)('horizontal', 0), " ", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thin), " background-color:", euiTheme.border.color, ";}.euiTableCellContent{position:relative;", (0, _global_styling.logicalCSS)('top', euiTheme.size.xs), ";}};label:customActions;")
88
+ },
89
+ euiTableRowCell__mobileHeader: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)(), " font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 's', {
90
+ customScale: 'xxs'
91
+ }).fontSize, ";display:block;color:", euiTheme.colors.darkShade, ";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
+ };
93
+ };
94
+ exports.euiTableRowCellStyles = euiTableRowCellStyles;
@@ -10,6 +10,9 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _services = require("../../services");
14
+ var _responsive_context = require("./mobile/responsive_context");
15
+ var _table_cells_shared = require("./table_cells_shared.styles");
13
16
  var _react2 = require("@emotion/react");
14
17
  var _excluded = ["children", "className"];
15
18
  /*
@@ -23,8 +26,12 @@ var EuiTableRowCellCheckbox = function EuiTableRowCellCheckbox(_ref) {
23
26
  var children = _ref.children,
24
27
  className = _ref.className,
25
28
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
+ var isResponsive = (0, _responsive_context.useEuiTableIsResponsive)();
30
+ var styles = (0, _services.useEuiMemoizedStyles)(_table_cells_shared.euiTableCellCheckboxStyles);
31
+ var cssStyles = [styles.euiTableRowCellCheckbox, isResponsive ? styles.mobile : styles.desktop];
26
32
  var classes = (0, _classnames.default)('euiTableRowCellCheckbox', className);
27
33
  return (0, _react2.jsx)("td", (0, _extends2.default)({
34
+ css: cssStyles,
28
35
  className: classes
29
36
  }, rest), (0, _react2.jsx)("div", {
30
37
  className: "euiTableCellContent"
@@ -1,52 +0,0 @@
1
- var _excluded = ["children", "className", "iconType"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
- /*
6
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
- * or more contributor license agreements. Licensed under the Elastic License
8
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
- * in compliance with, at your election, the Elastic License 2.0 or the Server
10
- * Side Public License, v 1.
11
- */
12
-
13
- import React from 'react';
14
- import PropTypes from "prop-types";
15
- import classNames from 'classnames';
16
- import { EuiInnerText } from '../inner_text';
17
- import { EuiIcon } from '../icon';
18
- import { jsx as ___EmotionJSX } from "@emotion/react";
19
- export var EuiTableHeaderButton = function EuiTableHeaderButton(_ref) {
20
- var children = _ref.children,
21
- className = _ref.className,
22
- iconType = _ref.iconType,
23
- rest = _objectWithoutProperties(_ref, _excluded);
24
- var classes = classNames('euiTableHeaderButton', className);
25
-
26
- // Add an icon to the button if one exists.
27
- var buttonIcon;
28
- if (iconType) {
29
- buttonIcon = ___EmotionJSX(EuiIcon, {
30
- className: "euiTableHeaderButton__icon",
31
- type: iconType,
32
- size: "m",
33
- "aria-hidden": "true"
34
- });
35
- }
36
- return ___EmotionJSX("button", _extends({
37
- type: "button",
38
- className: classes
39
- }, rest), ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
40
- return ___EmotionJSX("span", {
41
- title: innerText,
42
- ref: ref
43
- }, children);
44
- }), buttonIcon);
45
- };
46
- EuiTableHeaderButton.propTypes = {
47
- className: PropTypes.string,
48
- "aria-label": PropTypes.string,
49
- "data-test-subj": PropTypes.string,
50
- css: PropTypes.any,
51
- iconType: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "diff", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "newChat", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired])
52
- };