@elastic/eui 116.2.0 → 116.3.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/avatar/avatar.js +14 -5
- package/es/components/banner/banner.js +202 -0
- package/es/components/banner/banner.styles.js +76 -0
- package/es/components/banner/index.js +9 -0
- package/es/components/basic_table/basic_table.js +21 -10
- package/es/components/basic_table/collapsed_item_actions.js +5 -4
- package/es/components/basic_table/default_item_action.js +3 -5
- package/es/components/breadcrumbs/_breadcrumb_content.js +29 -19
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +2 -1
- package/es/components/context_menu/context_menu_panel_title.js +0 -12
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +11 -7
- package/es/components/datagrid/controls/display_selector.js +2 -1
- package/es/components/datagrid/controls/keyboard_shortcuts.js +2 -1
- package/es/components/date_picker/auto_refresh/auto_refresh.js +7 -4
- package/es/components/date_picker/react-datepicker/src/index.js +1 -5
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +10 -2
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +2 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +8 -5
- package/es/components/form/field_password/field_password.js +6 -3
- package/es/components/header/header.a11y.js +1 -1
- package/es/components/index.js +1 -0
- package/es/components/markdown_editor/markdown_editor_help_button.js +7 -4
- package/es/components/pagination/pagination_button_arrow.js +6 -2
- package/es/components/panel/panel.styles.js +4 -4
- package/es/components/panel/split_panel/split_panel.styles.js +1 -1
- package/es/components/search_bar/search_bar.js +20 -16
- package/es/components/search_bar/search_box.js +4 -2
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list.styles.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -1
- package/es/components/table/sticky_header/context.js +32 -0
- package/es/components/table/sticky_header/index.js +10 -0
- package/es/components/table/sticky_header/sticky_header.js +151 -0
- package/es/components/table/sticky_header/sticky_header.styles.js +43 -0
- package/es/components/table/store/provider.js +37 -0
- package/es/components/table/store/store.js +82 -0
- package/es/components/table/table.js +28 -3
- package/es/components/table/table.styles.js +4 -4
- package/es/components/table/table_header_cell.js +116 -48
- package/es/components/table/table_header_cell_checkbox.js +59 -25
- package/es/components/text_truncate/text_truncate.js +8 -3
- package/es/components/tool_tip/tool_tip.js +1 -1
- package/es/components/tool_tip/tool_tip.styles.js +14 -5
- package/es/utils/publisher.js +53 -0
- package/eui.d.ts +1266 -975
- package/i18ntokens.json +2390 -2372
- package/lib/components/avatar/avatar.js +14 -5
- package/lib/components/banner/banner.js +211 -0
- package/lib/components/banner/banner.styles.js +80 -0
- package/lib/components/banner/index.js +12 -0
- package/lib/components/basic_table/basic_table.js +21 -10
- package/lib/components/basic_table/collapsed_item_actions.js +5 -4
- package/lib/components/basic_table/default_item_action.js +3 -5
- package/lib/components/breadcrumbs/_breadcrumb_content.js +29 -19
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +2 -1
- package/lib/components/context_menu/context_menu_panel_title.js +0 -12
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +11 -7
- package/lib/components/datagrid/controls/display_selector.js +2 -1
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +2 -1
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +7 -4
- package/lib/components/date_picker/react-datepicker/src/index.js +0 -4
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +10 -2
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +2 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +8 -5
- package/lib/components/form/field_password/field_password.js +6 -3
- package/lib/components/header/header.a11y.js +1 -1
- package/lib/components/index.js +11 -0
- package/lib/components/markdown_editor/markdown_editor_help_button.js +7 -4
- package/lib/components/pagination/pagination_button_arrow.js +6 -2
- package/lib/components/panel/panel.styles.js +4 -4
- package/lib/components/panel/split_panel/split_panel.styles.js +1 -1
- package/lib/components/search_bar/search_bar.js +20 -16
- package/lib/components/search_bar/search_box.js +4 -2
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list.styles.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -1
- package/lib/components/table/sticky_header/context.js +41 -0
- package/lib/components/table/sticky_header/index.js +19 -0
- package/lib/components/table/sticky_header/sticky_header.js +156 -0
- package/lib/components/table/sticky_header/sticky_header.styles.js +47 -0
- package/lib/components/table/store/provider.js +46 -0
- package/lib/components/table/store/store.js +87 -0
- package/lib/components/table/table.js +28 -3
- package/lib/components/table/table.styles.js +4 -4
- package/lib/components/table/table_header_cell.js +118 -48
- package/lib/components/table/table_header_cell_checkbox.js +62 -25
- package/lib/components/text_truncate/text_truncate.js +8 -3
- package/lib/components/tool_tip/tool_tip.js +1 -1
- package/lib/components/tool_tip/tool_tip.styles.js +14 -5
- package/lib/utils/publisher.js +59 -0
- package/optimize/es/components/avatar/avatar.js +12 -4
- package/optimize/es/components/banner/banner.js +112 -0
- package/optimize/es/components/banner/banner.styles.js +76 -0
- package/optimize/es/components/banner/index.js +9 -0
- package/optimize/es/components/basic_table/basic_table.js +21 -10
- package/optimize/es/components/basic_table/collapsed_item_actions.js +5 -4
- package/optimize/es/components/basic_table/default_item_action.js +3 -5
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +27 -18
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +2 -1
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +11 -7
- package/optimize/es/components/datagrid/controls/display_selector.js +2 -1
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +2 -1
- package/optimize/es/components/date_picker/auto_refresh/auto_refresh.js +7 -4
- package/optimize/es/components/date_picker/react-datepicker/src/index.js +1 -5
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +10 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +2 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +8 -5
- package/optimize/es/components/form/field_password/field_password.js +6 -3
- package/optimize/es/components/header/header.a11y.js +1 -1
- package/optimize/es/components/index.js +1 -0
- package/optimize/es/components/markdown_editor/markdown_editor_help_button.js +7 -4
- package/optimize/es/components/pagination/pagination_button_arrow.js +6 -2
- package/optimize/es/components/panel/panel.styles.js +4 -4
- package/optimize/es/components/panel/split_panel/split_panel.styles.js +1 -1
- package/optimize/es/components/search_bar/search_bar.js +20 -16
- package/optimize/es/components/search_bar/search_box.js +4 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/optimize/es/components/selectable/selectable_list/selectable_list.styles.js +1 -1
- package/optimize/es/components/table/sticky_header/context.js +32 -0
- package/optimize/es/components/table/sticky_header/index.js +10 -0
- package/optimize/es/components/table/sticky_header/sticky_header.js +146 -0
- package/optimize/es/components/table/sticky_header/sticky_header.styles.js +43 -0
- package/optimize/es/components/table/store/provider.js +37 -0
- package/optimize/es/components/table/store/store.js +82 -0
- package/optimize/es/components/table/table.js +15 -3
- package/optimize/es/components/table/table.styles.js +4 -4
- package/optimize/es/components/table/table_header_cell.js +116 -48
- package/optimize/es/components/table/table_header_cell_checkbox.js +59 -25
- package/optimize/es/components/text_truncate/text_truncate.js +8 -3
- package/optimize/es/components/tool_tip/tool_tip.js +1 -1
- package/optimize/es/components/tool_tip/tool_tip.styles.js +14 -5
- package/optimize/es/utils/publisher.js +53 -0
- package/optimize/lib/components/avatar/avatar.js +12 -4
- package/optimize/lib/components/banner/banner.js +121 -0
- package/optimize/lib/components/banner/banner.styles.js +80 -0
- package/optimize/lib/components/banner/index.js +12 -0
- package/optimize/lib/components/basic_table/basic_table.js +21 -10
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +5 -4
- package/optimize/lib/components/basic_table/default_item_action.js +3 -5
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +27 -18
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +2 -1
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +11 -7
- package/optimize/lib/components/datagrid/controls/display_selector.js +2 -1
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +2 -1
- package/optimize/lib/components/date_picker/auto_refresh/auto_refresh.js +7 -4
- package/optimize/lib/components/date_picker/react-datepicker/src/index.js +0 -4
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +10 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +2 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +8 -5
- package/optimize/lib/components/form/field_password/field_password.js +6 -3
- package/optimize/lib/components/header/header.a11y.js +1 -1
- package/optimize/lib/components/index.js +11 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_help_button.js +7 -4
- package/optimize/lib/components/pagination/pagination_button_arrow.js +6 -2
- package/optimize/lib/components/panel/panel.styles.js +4 -4
- package/optimize/lib/components/panel/split_panel/split_panel.styles.js +1 -1
- package/optimize/lib/components/search_bar/search_bar.js +20 -16
- package/optimize/lib/components/search_bar/search_box.js +4 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/optimize/lib/components/selectable/selectable_list/selectable_list.styles.js +1 -1
- package/optimize/lib/components/table/sticky_header/context.js +41 -0
- package/optimize/lib/components/table/sticky_header/index.js +19 -0
- package/optimize/lib/components/table/sticky_header/sticky_header.js +156 -0
- package/optimize/lib/components/table/sticky_header/sticky_header.styles.js +47 -0
- package/optimize/lib/components/table/store/provider.js +46 -0
- package/optimize/lib/components/table/store/store.js +87 -0
- package/optimize/lib/components/table/table.js +15 -3
- package/optimize/lib/components/table/table.styles.js +4 -4
- package/optimize/lib/components/table/table_header_cell.js +119 -48
- package/optimize/lib/components/table/table_header_cell_checkbox.js +62 -25
- package/optimize/lib/components/text_truncate/text_truncate.js +8 -3
- package/optimize/lib/components/tool_tip/tool_tip.js +1 -1
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +14 -5
- package/optimize/lib/utils/publisher.js +59 -0
- package/package.json +2 -2
- package/test-env/components/avatar/avatar.js +14 -5
- package/test-env/components/banner/banner.js +210 -0
- package/test-env/components/banner/banner.styles.js +80 -0
- package/test-env/components/banner/index.js +12 -0
- package/test-env/components/basic_table/basic_table.js +21 -10
- package/test-env/components/basic_table/collapsed_item_actions.js +5 -4
- package/test-env/components/basic_table/default_item_action.js +3 -5
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +29 -19
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +2 -1
- package/test-env/components/context_menu/context_menu_panel_title.js +0 -12
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +11 -7
- package/test-env/components/datagrid/controls/display_selector.js +2 -1
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +2 -1
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +7 -4
- package/test-env/components/date_picker/react-datepicker/src/index.js +0 -4
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +10 -2
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +2 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +8 -5
- package/test-env/components/form/field_password/field_password.js +6 -3
- package/test-env/components/header/header.a11y.js +1 -1
- package/test-env/components/index.js +11 -0
- package/test-env/components/markdown_editor/markdown_editor_help_button.js +7 -4
- package/test-env/components/pagination/pagination_button_arrow.js +6 -2
- package/test-env/components/panel/panel.styles.js +4 -4
- package/test-env/components/panel/split_panel/split_panel.styles.js +1 -1
- package/test-env/components/search_bar/search_bar.js +20 -16
- package/test-env/components/search_bar/search_box.js +4 -2
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list.styles.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -1
- package/test-env/components/table/sticky_header/context.js +41 -0
- package/test-env/components/table/sticky_header/index.js +19 -0
- package/test-env/components/table/sticky_header/sticky_header.js +156 -0
- package/test-env/components/table/sticky_header/sticky_header.styles.js +47 -0
- package/test-env/components/table/store/provider.js +46 -0
- package/test-env/components/table/store/store.js +87 -0
- package/test-env/components/table/table.js +28 -3
- package/test-env/components/table/table.styles.js +4 -4
- package/test-env/components/table/table_header_cell.js +119 -48
- package/test-env/components/table/table_header_cell_checkbox.js +62 -25
- package/test-env/components/text_truncate/text_truncate.js +8 -3
- package/test-env/components/tool_tip/tool_tip.js +1 -1
- package/test-env/components/tool_tip/tool_tip.styles.js +14 -5
- package/test-env/utils/publisher.js +59 -0
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.EuiTableHeaderCellCheckbox = void 0;
|
|
7
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _services = require("../../services");
|
|
12
|
+
var _html_id_generator = require("../../services/accessibility/html_id_generator");
|
|
11
13
|
var _utils = require("./utils");
|
|
12
14
|
var _table_cells_shared = require("./table_cells_shared.styles");
|
|
15
|
+
var _provider = require("./store/provider");
|
|
16
|
+
var _sticky_header = require("./sticky_header");
|
|
13
17
|
var _react2 = require("@emotion/react");
|
|
14
18
|
var _excluded = ["children", "className", "scope", "style", "width", "minWidth", "maxWidth", "append"];
|
|
15
19
|
/*
|
|
@@ -20,35 +24,68 @@ var _excluded = ["children", "className", "scope", "style", "width", "minWidth",
|
|
|
20
24
|
* Side Public License, v 1.
|
|
21
25
|
*/
|
|
22
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
29
|
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); }
|
|
24
30
|
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; }
|
|
25
31
|
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; }
|
|
26
|
-
var EuiTableHeaderCellCheckbox = exports.EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(
|
|
27
|
-
var children =
|
|
28
|
-
className =
|
|
29
|
-
|
|
30
|
-
scope =
|
|
31
|
-
_style =
|
|
32
|
-
width =
|
|
33
|
-
minWidth =
|
|
34
|
-
maxWidth =
|
|
35
|
-
append =
|
|
36
|
-
rest = _objectWithoutProperties(
|
|
37
|
-
var
|
|
32
|
+
var EuiTableHeaderCellCheckbox = exports.EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(props) {
|
|
33
|
+
var children = props.children,
|
|
34
|
+
className = props.className,
|
|
35
|
+
_props$scope = props.scope,
|
|
36
|
+
scope = _props$scope === void 0 ? 'col' : _props$scope,
|
|
37
|
+
_style = props.style,
|
|
38
|
+
width = props.width,
|
|
39
|
+
minWidth = props.minWidth,
|
|
40
|
+
maxWidth = props.maxWidth,
|
|
41
|
+
append = props.append,
|
|
42
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
43
|
+
var internalCellId = (0, _html_id_generator.useGeneratedHtmlId)();
|
|
44
|
+
var store = (0, _provider.useEuiTableColumnDataStore)();
|
|
45
|
+
var isWithinStickyHeader = (0, _sticky_header.useEuiTableWithinStickyHeader)();
|
|
38
46
|
var styles = (0, _services.useEuiMemoizedStyles)(_table_cells_shared.euiTableCellCheckboxStyles);
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
var renderHeaderCellRef = (0, _react.useRef)();
|
|
48
|
+
renderHeaderCellRef.current = function (extraProps) {
|
|
49
|
+
var classes = (0, _classnames.default)('euiTableHeaderCellCheckbox', className);
|
|
50
|
+
var style = (0, _utils.resolveWidthPropsAsStyle)(_style, {
|
|
51
|
+
width: width,
|
|
52
|
+
minWidth: minWidth,
|
|
53
|
+
maxWidth: maxWidth
|
|
54
|
+
});
|
|
55
|
+
return (0, _react2.jsx)("th", _extends({
|
|
56
|
+
css: styles.euiTableHeaderCellCheckbox,
|
|
57
|
+
className: classes,
|
|
58
|
+
scope: scope,
|
|
59
|
+
style: style
|
|
60
|
+
}, rest, extraProps), (0, _react2.jsx)("div", {
|
|
61
|
+
className: "euiTableCellContent"
|
|
62
|
+
}, children), append);
|
|
63
|
+
};
|
|
64
|
+
(0, _react.useEffect)(function () {
|
|
65
|
+
// Don't register the column inside the sticky header as the original
|
|
66
|
+
// column is already registered. This would cause an infinite loop.
|
|
67
|
+
if (isWithinStickyHeader) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var unregisterColumn = store.registerColumn(internalCellId, {
|
|
71
|
+
renderHeaderCellRef: renderHeaderCellRef
|
|
72
|
+
});
|
|
73
|
+
return function () {
|
|
74
|
+
unregisterColumn();
|
|
75
|
+
};
|
|
76
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
|
+
}, [store, internalCellId, isWithinStickyHeader]);
|
|
78
|
+
(0, _react.useEffect)(function () {
|
|
79
|
+
// Notify the store on every render so the sticky header stays in sync.
|
|
80
|
+
// React's reconciliation will efficiently handle any duplicate renders.
|
|
81
|
+
if (isWithinStickyHeader) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
store.updateColumn(internalCellId, {
|
|
85
|
+
renderHeaderCellRef: renderHeaderCellRef
|
|
86
|
+
});
|
|
43
87
|
});
|
|
44
|
-
return
|
|
45
|
-
css: styles.euiTableHeaderCellCheckbox,
|
|
46
|
-
className: classes,
|
|
47
|
-
scope: scope,
|
|
48
|
-
style: style
|
|
49
|
-
}, rest), (0, _react2.jsx)("div", {
|
|
50
|
-
className: "euiTableCellContent"
|
|
51
|
-
}, children), append);
|
|
88
|
+
return renderHeaderCellRef.current({});
|
|
52
89
|
};
|
|
53
90
|
EuiTableHeaderCellCheckbox.propTypes = {
|
|
54
91
|
className: _propTypes.default.string,
|
|
@@ -10,6 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../services");
|
|
12
12
|
var _resize_observer = require("../observer/resize_observer");
|
|
13
|
+
var _tool_tip = require("../tool_tip");
|
|
13
14
|
var _utils = require("./utils");
|
|
14
15
|
var _text_truncate = require("./text_truncate.styles");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
@@ -213,11 +214,10 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
213
214
|
}, [ready, width, text, truncation, truncationOffset, truncationPosition, ellipsis, containerEl]);
|
|
214
215
|
var isTruncating = truncatedText !== text;
|
|
215
216
|
var styles = (0, _services.useEuiMemoizedStyles)(_text_truncate.euiTextTruncateStyles);
|
|
216
|
-
|
|
217
|
+
var content = (0, _react2.jsx)("div", _extends({
|
|
217
218
|
className: (0, _classnames.default)('euiTextTruncate', className),
|
|
218
219
|
css: styles.euiTextTruncate,
|
|
219
|
-
ref: refs
|
|
220
|
-
title: isTruncating ? text : undefined
|
|
220
|
+
ref: refs
|
|
221
221
|
}, rest), isTruncating ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
|
|
222
222
|
className: "euiTextTruncate__truncatedText",
|
|
223
223
|
css: styles.euiTextTruncate__truncatedText,
|
|
@@ -231,6 +231,11 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
231
231
|
className: "euiTextTruncate__fullText",
|
|
232
232
|
"data-test-subj": "fullText"
|
|
233
233
|
}, children ? children(text) : text));
|
|
234
|
+
return isTruncating ? (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
235
|
+
content: text,
|
|
236
|
+
disableScreenReaderOutput: true,
|
|
237
|
+
display: "block"
|
|
238
|
+
}, content) : content;
|
|
234
239
|
};
|
|
235
240
|
EuiTextTruncateWithWidth.propTypes = {
|
|
236
241
|
width: _propTypes.default.number.isRequired,
|
|
@@ -39,7 +39,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
39
39
|
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; }
|
|
40
40
|
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; }
|
|
41
41
|
var POSITIONS = exports.POSITIONS = ['top', 'right', 'bottom', 'left'];
|
|
42
|
-
var DISPLAYS = ['inlineBlock', 'block'];
|
|
42
|
+
var DISPLAYS = ['inlineBlock', 'block', 'flex'];
|
|
43
43
|
var DEFAULT_TOOLTIP_OFFSET = exports.DEFAULT_TOOLTIP_OFFSET = 16;
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -47,6 +47,14 @@ var euiToolTipStyles = exports.euiToolTipStyles = function euiToolTipStyles(euiT
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
50
|
+
name: "1cjglks-flex",
|
|
51
|
+
styles: "display:flex;label:flex;"
|
|
52
|
+
} : {
|
|
53
|
+
name: "1cjglks-flex",
|
|
54
|
+
styles: "display:flex;label:flex;",
|
|
55
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
56
|
+
};
|
|
57
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
50
58
|
name: "fzilnk-inlineBlock",
|
|
51
59
|
styles: "display:inline-block;label:inlineBlock;"
|
|
52
60
|
} : {
|
|
@@ -54,7 +62,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
54
62
|
styles: "display:inline-block;label:inlineBlock;",
|
|
55
63
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
56
64
|
};
|
|
57
|
-
var
|
|
65
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
58
66
|
name: "14aceuy-block",
|
|
59
67
|
styles: "display:block;label:block;"
|
|
60
68
|
} : {
|
|
@@ -62,7 +70,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
62
70
|
styles: "display:block;label:block;",
|
|
63
71
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
64
72
|
};
|
|
65
|
-
var
|
|
73
|
+
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
66
74
|
name: "1s3i3p5-euiToolTipAnchor",
|
|
67
75
|
styles: "*[disabled]{pointer-events:none;};label:euiToolTipAnchor;"
|
|
68
76
|
} : {
|
|
@@ -73,9 +81,10 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
|
73
81
|
var euiToolTipAnchorStyles = exports.euiToolTipAnchorStyles = function euiToolTipAnchorStyles() {
|
|
74
82
|
return {
|
|
75
83
|
// Elements
|
|
76
|
-
euiToolTipAnchor:
|
|
84
|
+
euiToolTipAnchor: _ref4,
|
|
77
85
|
// Variants
|
|
78
|
-
block:
|
|
79
|
-
inlineBlock:
|
|
86
|
+
block: _ref3,
|
|
87
|
+
inlineBlock: _ref2,
|
|
88
|
+
flex: _ref
|
|
80
89
|
};
|
|
81
90
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createPublisher = void 0;
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
/*
|
|
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
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
var createPublisher = exports.createPublisher = function createPublisher() {
|
|
30
|
+
var subscribers = new Set();
|
|
31
|
+
var unsubscribe = function unsubscribe(subscriber) {
|
|
32
|
+
subscribers.delete(subscriber);
|
|
33
|
+
};
|
|
34
|
+
var subscribe = function subscribe(subscriber) {
|
|
35
|
+
subscribers.add(subscriber);
|
|
36
|
+
return function () {
|
|
37
|
+
return unsubscribe(subscriber);
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var notify = function notify(subject) {
|
|
41
|
+
var _iterator = _createForOfIteratorHelper(subscribers),
|
|
42
|
+
_step;
|
|
43
|
+
try {
|
|
44
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
45
|
+
var _subscriber = _step.value;
|
|
46
|
+
_subscriber(subject);
|
|
47
|
+
}
|
|
48
|
+
} catch (err) {
|
|
49
|
+
_iterator.e(err);
|
|
50
|
+
} finally {
|
|
51
|
+
_iterator.f();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
subscribe: subscribe,
|
|
56
|
+
unsubscribe: unsubscribe,
|
|
57
|
+
notify: notify
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -20,6 +20,7 @@ import { warnIfContrastBelowMin, wcagContrastMin } from '../../services/color/co
|
|
|
20
20
|
import { isColorDark, hexToRgb, isValidHex, useEuiPaletteColorBlindBehindText } from '../../services/color';
|
|
21
21
|
import { toInitials, useEuiMemoizedStyles, useEuiTheme } from '../../services';
|
|
22
22
|
import { EuiIcon } from '../icon';
|
|
23
|
+
import { EuiToolTip } from '../tool_tip';
|
|
23
24
|
import { euiAvatarStyles } from './avatar.styles';
|
|
24
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
26
|
export var SIZES = ['s', 'm', 'l', 'xl'];
|
|
@@ -98,21 +99,28 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
98
99
|
// Fall back to the adjusted text color if it exists
|
|
99
100
|
return avatarStyle === null || avatarStyle === void 0 ? void 0 : avatarStyle.color;
|
|
100
101
|
}, [iconColor, avatarStyle === null || avatarStyle === void 0 ? void 0 : avatarStyle.color, isForcedColors, euiTheme]);
|
|
101
|
-
|
|
102
|
+
var avatarNode = ___EmotionJSX("div", _extends({
|
|
102
103
|
css: cssStyles,
|
|
103
104
|
className: classes,
|
|
104
105
|
style: _objectSpread(_objectSpread(_objectSpread({}, style), avatarStyle), highContrastBorder),
|
|
105
106
|
"aria-label": isDisabled ? undefined : name,
|
|
106
|
-
role: isDisabled ? 'presentation' : 'img'
|
|
107
|
-
title: name
|
|
107
|
+
role: isDisabled ? 'presentation' : 'img'
|
|
108
108
|
}, rest), !imageUrl && (iconType ? ___EmotionJSX(EuiIcon, {
|
|
109
109
|
className: "euiAvatar__icon",
|
|
110
110
|
size: iconSize || size,
|
|
111
111
|
type: iconType,
|
|
112
|
-
color: iconCustomColor
|
|
112
|
+
color: iconCustomColor,
|
|
113
|
+
"aria-hidden": true
|
|
113
114
|
}) : ___EmotionJSX("span", {
|
|
114
115
|
"aria-hidden": "true"
|
|
115
116
|
}, toInitials(name, initialsLength, initials))));
|
|
117
|
+
|
|
118
|
+
// `EuiAvatar` is not interactive so we don't need to add a `tabIndex`.
|
|
119
|
+
// It already has `aria-label`, the tooltip is only visual.
|
|
120
|
+
return name ? ___EmotionJSX(EuiToolTip, {
|
|
121
|
+
content: name,
|
|
122
|
+
disableScreenReaderOutput: true
|
|
123
|
+
}, avatarNode) : avatarNode;
|
|
116
124
|
};
|
|
117
125
|
|
|
118
126
|
// TODO: Migrate to a service
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "headingElement", "text", "size", "color", "actionProps", "media", "onDismiss", "dismissButtonProps", "children", "className", "announceOnMount", "data-test-subj"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
15
|
+
import { useEuiBackgroundColorCSS } from '../../global_styling';
|
|
16
|
+
import { useEuiI18n } from '../i18n';
|
|
17
|
+
import { EuiTitle } from '../title';
|
|
18
|
+
import { EuiButton, EuiButtonEmpty, EuiButtonIcon } from '../button';
|
|
19
|
+
import { EuiText } from '../text';
|
|
20
|
+
import { EuiLiveAnnouncer } from '../accessibility';
|
|
21
|
+
import { euiBannerStyles } from './banner.styles';
|
|
22
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
|
+
export var EuiBanner = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
|
+
var title = _ref.title,
|
|
25
|
+
_ref$headingElement = _ref.headingElement,
|
|
26
|
+
headingElement = _ref$headingElement === void 0 ? 'h2' : _ref$headingElement,
|
|
27
|
+
text = _ref.text,
|
|
28
|
+
_ref$size = _ref.size,
|
|
29
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
30
|
+
_ref$color = _ref.color,
|
|
31
|
+
color = _ref$color === void 0 ? 'highlighted' : _ref$color,
|
|
32
|
+
actionProps = _ref.actionProps,
|
|
33
|
+
media = _ref.media,
|
|
34
|
+
onDismiss = _ref.onDismiss,
|
|
35
|
+
dismissButtonProps = _ref.dismissButtonProps,
|
|
36
|
+
children = _ref.children,
|
|
37
|
+
className = _ref.className,
|
|
38
|
+
_ref$announceOnMount = _ref.announceOnMount,
|
|
39
|
+
announceOnMount = _ref$announceOnMount === void 0 ? false : _ref$announceOnMount,
|
|
40
|
+
_ref$dataTestSubj = _ref['data-test-subj'],
|
|
41
|
+
dataTestSubj = _ref$dataTestSubj === void 0 ? 'euiBanner' : _ref$dataTestSubj,
|
|
42
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
var styles = useEuiMemoizedStyles(euiBannerStyles);
|
|
44
|
+
var dismissAriaLabel = useEuiI18n('euiBanner.dismissAriaLabel', 'Dismiss "{title}" announcement', {
|
|
45
|
+
title: title
|
|
46
|
+
});
|
|
47
|
+
var Heading = headingElement;
|
|
48
|
+
var headingSize = size === 's' ? 'xxs' : 'xs';
|
|
49
|
+
var primaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary;
|
|
50
|
+
var secondaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary;
|
|
51
|
+
// a standalone secondary action is not supported
|
|
52
|
+
var hasActions = Boolean(primaryActionProps);
|
|
53
|
+
var componentClass = 'euiBanner';
|
|
54
|
+
var classes = classNames(componentClass, className);
|
|
55
|
+
var backgroundColorStyles = useEuiBackgroundColorCSS()[color];
|
|
56
|
+
var cssStyles = [styles.euiBanner, backgroundColorStyles];
|
|
57
|
+
var containerCssStyles = [styles.container, onDismiss && styles.hasDismiss];
|
|
58
|
+
return ___EmotionJSX("div", _extends({
|
|
59
|
+
ref: ref,
|
|
60
|
+
className: classes,
|
|
61
|
+
css: cssStyles,
|
|
62
|
+
"data-size": size,
|
|
63
|
+
"data-color": color,
|
|
64
|
+
"data-test-subj": dataTestSubj
|
|
65
|
+
}, rest), ___EmotionJSX("div", {
|
|
66
|
+
className: "".concat(componentClass, "__container"),
|
|
67
|
+
css: containerCssStyles
|
|
68
|
+
}, media ? ___EmotionJSX("div", {
|
|
69
|
+
className: "".concat(componentClass, "__media"),
|
|
70
|
+
css: styles.media,
|
|
71
|
+
"data-test-subj": "".concat(dataTestSubj, "-media")
|
|
72
|
+
}, media) : null, ___EmotionJSX("div", {
|
|
73
|
+
className: "".concat(componentClass, "__body"),
|
|
74
|
+
css: styles.body
|
|
75
|
+
}, ___EmotionJSX("div", {
|
|
76
|
+
className: "".concat(componentClass, "__content"),
|
|
77
|
+
css: styles.content
|
|
78
|
+
}, ___EmotionJSX(EuiTitle, {
|
|
79
|
+
size: headingSize
|
|
80
|
+
}, ___EmotionJSX(Heading, {
|
|
81
|
+
css: styles.title,
|
|
82
|
+
"data-test-subj": "".concat(dataTestSubj, "-title")
|
|
83
|
+
}, title)), onDismiss ? ___EmotionJSX(EuiButtonIcon, _extends({
|
|
84
|
+
iconType: "cross",
|
|
85
|
+
color: "text",
|
|
86
|
+
"aria-label": dismissAriaLabel,
|
|
87
|
+
"data-test-subj": "".concat(dataTestSubj, "-dismiss")
|
|
88
|
+
}, dismissButtonProps, {
|
|
89
|
+
css: [styles.dismiss, dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.css, ";label:EuiBanner;"],
|
|
90
|
+
onClick: onDismiss
|
|
91
|
+
})) : null, text ? ___EmotionJSX(EuiText, {
|
|
92
|
+
css: styles.text,
|
|
93
|
+
size: "s",
|
|
94
|
+
color: "subdued",
|
|
95
|
+
"data-test-subj": "".concat(dataTestSubj, "-text")
|
|
96
|
+
}, text) : null, children && children), hasActions ? ___EmotionJSX("div", {
|
|
97
|
+
className: "".concat(componentClass, "__actions"),
|
|
98
|
+
css: styles.actions,
|
|
99
|
+
"data-test-subj": "".concat(dataTestSubj, "-actions")
|
|
100
|
+
}, primaryActionProps ? ___EmotionJSX(EuiButton, _extends({
|
|
101
|
+
"data-test-subj": "".concat(dataTestSubj, "-primaryAction")
|
|
102
|
+
}, primaryActionProps, {
|
|
103
|
+
color: "primary",
|
|
104
|
+
size: "s"
|
|
105
|
+
})) : null, secondaryActionProps ? ___EmotionJSX(EuiButtonEmpty, _extends({
|
|
106
|
+
"data-test-subj": "".concat(dataTestSubj, "-secondaryAction")
|
|
107
|
+
}, secondaryActionProps, {
|
|
108
|
+
color: "primary",
|
|
109
|
+
size: "s"
|
|
110
|
+
})) : null) : null)), announceOnMount && ___EmotionJSX(EuiLiveAnnouncer, null, title && title, title && text && ",\xA0", text && text, (title || text) && children && ",\xA0", children && children));
|
|
111
|
+
});
|
|
112
|
+
EuiBanner.displayName = 'EuiBanner';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
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)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
var CONTAINER_NAME = 'euiBanner';
|
|
12
|
+
var CQC_LAYOUTS = ['narrow', 'wide'];
|
|
13
|
+
var CQC_BREAKPOINTS = {
|
|
14
|
+
s: {
|
|
15
|
+
narrow: '(min-width: 401px)',
|
|
16
|
+
wide: '(min-width: 800px)'
|
|
17
|
+
},
|
|
18
|
+
m: {
|
|
19
|
+
narrow: '(min-width: 601px)',
|
|
20
|
+
wide: '(min-width: 1000px)'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var CQC_BREAKPOINT_NARROWEST = '(max-width: 400px)';
|
|
24
|
+
|
|
25
|
+
/** Maximum reading width for `text` and `children` slots. */
|
|
26
|
+
var TEXT_MAX_WIDTH = 1200;
|
|
27
|
+
var withContainerQuery = function withContainerQuery(_ref2) {
|
|
28
|
+
var layout = _ref2.layout,
|
|
29
|
+
styles = _ref2.styles;
|
|
30
|
+
return Object.keys(CQC_BREAKPOINTS).map(function (sizeKey) {
|
|
31
|
+
return "\n @container ".concat(CONTAINER_NAME, "--").concat(sizeKey, " ").concat(CQC_BREAKPOINTS[sizeKey][layout], " {\n ").concat(styles, "\n }\n ");
|
|
32
|
+
}).join('\n');
|
|
33
|
+
};
|
|
34
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
35
|
+
name: "qd171g-title",
|
|
36
|
+
styles: "[data-size='s'] &{display:inline;};label:title;"
|
|
37
|
+
} : {
|
|
38
|
+
name: "qd171g-title",
|
|
39
|
+
styles: "[data-size='s'] &{display:inline;};label:title;",
|
|
40
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
41
|
+
};
|
|
42
|
+
export var euiBannerStyles = function euiBannerStyles(_ref3) {
|
|
43
|
+
var euiTheme = _ref3.euiTheme;
|
|
44
|
+
return {
|
|
45
|
+
euiBanner: /*#__PURE__*/css("container-name:", CONTAINER_NAME, ";container-type:inline-size;position:relative;border:", euiTheme.border.thin, ";border-radius:", euiTheme.border.radius.medium, ";&[data-size='s']{container-name:", CONTAINER_NAME, " ", CONTAINER_NAME, "--s;}&[data-size='m']{container-name:", CONTAINER_NAME, " ", CONTAINER_NAME, "--m;};label:euiBanner;"),
|
|
46
|
+
container: /*#__PURE__*/css("display:flex;flex-direction:column;align-items:stretch;gap:", euiTheme.size.m, ";padding-inline-start:", euiTheme.size.base, ";padding-inline-end:", euiTheme.size.base, ";[data-size='m'] &{padding-block:", euiTheme.size.base, ";}[data-size='s'] &{padding-block:", euiTheme.size.m, ";}", withContainerQuery({
|
|
47
|
+
layout: 'narrow',
|
|
48
|
+
styles: "\n flex-direction: row;\n align-items: flex-start;\n gap: ".concat(euiTheme.size.base, ";\n ")
|
|
49
|
+
}), ";;label:container;"),
|
|
50
|
+
media: /*#__PURE__*/css("--euiBannerMediaSize:", "calc(".concat(euiTheme.size.base, " * 5)"), ";flex-shrink:0;inline-size:var(--euiBannerMediaSize);block-size:var(--euiBannerMediaSize);aspect-ratio:1/1;[data-size='s'] &{--euiBannerMediaSize:", "calc(".concat(euiTheme.size.base, " * 2)"), ";}", withContainerQuery({
|
|
51
|
+
layout: 'wide',
|
|
52
|
+
styles: "\n align-self: center;\n "
|
|
53
|
+
}), " img,svg{block-size:100%;inline-size:100%;};label:media;"),
|
|
54
|
+
body: /*#__PURE__*/css("flex:1 1 auto;min-inline-size:0;display:flex;flex-direction:column;align-self:flex-start;inline-size:100%;gap:", euiTheme.size.m, ";", withContainerQuery({
|
|
55
|
+
layout: 'narrow',
|
|
56
|
+
styles: "\n align-self: center;\n inline-size: auto;\n "
|
|
57
|
+
}), " ", withContainerQuery({
|
|
58
|
+
layout: 'wide',
|
|
59
|
+
styles: "\n flex-direction: row;\n align-items: center;\n /* stretch to match the media's height so align-items has space to work */\n align-self: stretch;\n justify-content: space-between;\n gap: ".concat(euiTheme.size.xxl, ";\n ")
|
|
60
|
+
}), ";;label:body;"),
|
|
61
|
+
// At size `s` the content slot becomes a block container so the title and
|
|
62
|
+
// text flow inline. Other sizes keep the flex column with a fixed gap.
|
|
63
|
+
content: /*#__PURE__*/css("flex:1 1 auto;min-inline-size:0;max-inline-size:", TEXT_MAX_WIDTH, "px;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";[data-size='s'] &{display:block;>*+*:not(.euiButtonIcon){margin-block-start:", euiTheme.size.s, ";}};label:content;"),
|
|
64
|
+
title: _ref,
|
|
65
|
+
text: /*#__PURE__*/css("[data-size='s'] &{display:inline;&::before{content:'\xB7';display:inline-block;inline-size:calc(", euiTheme.size.s, " + ", euiTheme.size.xxs, ");text-align:center;color:", euiTheme.colors.textHeading, ";}};label:text;"),
|
|
66
|
+
actions: /*#__PURE__*/css("display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:", euiTheme.size.s, ";@container ", CONTAINER_NAME, " ", CQC_BREAKPOINT_NARROWEST, "{flex-wrap:wrap;>*{inline-size:100%;}}", withContainerQuery({
|
|
67
|
+
layout: 'wide',
|
|
68
|
+
styles: "\n /* Reverses source order so primary appears last (rightmost). */\n flex-direction: row-reverse;\n flex-shrink: 0;\n align-self: center;\n "
|
|
69
|
+
}), ";;label:actions;"),
|
|
70
|
+
hasDismiss: /*#__PURE__*/css(withContainerQuery({
|
|
71
|
+
layout: 'narrow',
|
|
72
|
+
styles: "\n padding-inline-end: calc(".concat(euiTheme.size.s, " * 5);\n ")
|
|
73
|
+
}), ";;label:hasDismiss;"),
|
|
74
|
+
dismiss: /*#__PURE__*/css("position:absolute;inset-block-start:", euiTheme.size.s, ";inset-inline-end:", euiTheme.size.s, ";color:", euiTheme.colors.textSubdued, ";;label:dismiss;")
|
|
75
|
+
};
|
|
76
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export { EuiBanner } from './banner';
|
|
@@ -8,7 +8,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground", "scrollableInline", "stickyScrollbar"],
|
|
11
|
+
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground", "scrollableInline", "stickyScrollbar", "stickyHeader"],
|
|
12
12
|
_excluded2 = ["align", "render", "dataType", "isExpander", "textOnly", "name", "field", "description", "sortable", "footer", "mobileOptions", "nameTooltip"];
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
@@ -41,6 +41,7 @@ import { EuiI18n } from '../i18n';
|
|
|
41
41
|
import { EuiDelayRender } from '../delay_render';
|
|
42
42
|
import { htmlIdGenerator } from '../../services/accessibility';
|
|
43
43
|
import { euiBasicTableBodyLoading, safariLoadingWorkaround } from './basic_table.styles';
|
|
44
|
+
import { EuiToolTip } from '../tool_tip';
|
|
44
45
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
45
46
|
var dataTypesProfiles = {
|
|
46
47
|
auto: {
|
|
@@ -155,7 +156,11 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
155
156
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
156
157
|
selectAllRows = _ref4[0],
|
|
157
158
|
deselectRows = _ref4[1];
|
|
158
|
-
return ___EmotionJSX(
|
|
159
|
+
return ___EmotionJSX(EuiToolTip, {
|
|
160
|
+
content: checked || indeterminate ? deselectRows : selectAllRows,
|
|
161
|
+
display: "block",
|
|
162
|
+
disableScreenReaderOutput: true
|
|
163
|
+
}, ___EmotionJSX(EuiCheckbox, {
|
|
159
164
|
id: _this.selectAllIdGenerator(),
|
|
160
165
|
checked: checked,
|
|
161
166
|
indeterminate: indeterminate,
|
|
@@ -163,9 +168,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
163
168
|
onChange: onChange,
|
|
164
169
|
"data-test-subj": "checkboxSelectAll",
|
|
165
170
|
"aria-label": checked || indeterminate ? deselectRows : selectAllRows,
|
|
166
|
-
title: checked || indeterminate ? deselectRows : selectAllRows,
|
|
167
171
|
label: isMobile ? selectAllRows : null
|
|
168
|
-
});
|
|
172
|
+
}));
|
|
169
173
|
});
|
|
170
174
|
});
|
|
171
175
|
_defineProperty(_this, "renderCopyChar", function (columnIndex) {
|
|
@@ -355,6 +359,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
355
359
|
hasBackground = _this$props2.hasBackground,
|
|
356
360
|
scrollableInline = _this$props2.scrollableInline,
|
|
357
361
|
stickyScrollbar = _this$props2.stickyScrollbar,
|
|
362
|
+
stickyHeader = _this$props2.stickyHeader,
|
|
358
363
|
rest = _objectWithoutProperties(_this$props2, _excluded);
|
|
359
364
|
var classes = classNames('euiBasicTable', {
|
|
360
365
|
'euiBasicTable-loading': loading
|
|
@@ -375,7 +380,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
375
380
|
hasBackground = _this$props3.hasBackground,
|
|
376
381
|
loading = _this$props3.loading,
|
|
377
382
|
scrollableInline = _this$props3.scrollableInline,
|
|
378
|
-
stickyScrollbar = _this$props3.stickyScrollbar
|
|
383
|
+
stickyScrollbar = _this$props3.stickyScrollbar,
|
|
384
|
+
stickyHeader = _this$props3.stickyHeader;
|
|
379
385
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTableHeaderMobile, {
|
|
380
386
|
responsiveBreakpoint: responsiveBreakpoint
|
|
381
387
|
}, this.renderSelectAll(true), this.renderTableMobileSort()), ___EmotionJSX(OverrideCopiedTabularContent, null, ___EmotionJSX(EuiTable, {
|
|
@@ -386,6 +392,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
386
392
|
hasBackground: hasBackground,
|
|
387
393
|
scrollableInline: scrollableInline,
|
|
388
394
|
stickyScrollbar: stickyScrollbar,
|
|
395
|
+
stickyHeader: stickyHeader,
|
|
389
396
|
css: loading && safariLoadingWorkaround
|
|
390
397
|
}, this.renderTableCaption(), this.renderTableHead(), this.renderTableBody(), this.renderTableFooter())));
|
|
391
398
|
}
|
|
@@ -654,8 +661,9 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
654
661
|
}
|
|
655
662
|
}, ___EmotionJSX(EuiIcon, {
|
|
656
663
|
type: "minusCircle",
|
|
657
|
-
color: "danger"
|
|
658
|
-
|
|
664
|
+
color: "danger",
|
|
665
|
+
"aria-hidden": true
|
|
666
|
+
}), ' ', error));
|
|
659
667
|
}
|
|
660
668
|
}, {
|
|
661
669
|
key: "renderEmptyMessage",
|
|
@@ -782,15 +790,18 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
782
790
|
index: displayedRowIndex + 1
|
|
783
791
|
}
|
|
784
792
|
}, function (selectThisRow) {
|
|
785
|
-
return ___EmotionJSX(
|
|
793
|
+
return ___EmotionJSX(EuiToolTip, {
|
|
794
|
+
content: title || selectThisRow,
|
|
795
|
+
display: "block",
|
|
796
|
+
disableScreenReaderOutput: true
|
|
797
|
+
}, ___EmotionJSX(EuiCheckbox, {
|
|
786
798
|
id: "".concat(_this6.tableId).concat(key, "-checkbox"),
|
|
787
799
|
disabled: disabled,
|
|
788
800
|
checked: checked,
|
|
789
801
|
onChange: onChange,
|
|
790
|
-
title: title || selectThisRow,
|
|
791
802
|
"aria-label": title || selectThisRow,
|
|
792
803
|
"data-test-subj": "checkboxSelectRow-".concat(itemId)
|
|
793
|
-
});
|
|
804
|
+
}));
|
|
794
805
|
})), disabled];
|
|
795
806
|
}
|
|
796
807
|
}, {
|
|
@@ -90,10 +90,10 @@ export var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
90
90
|
var popoverButton = ___EmotionJSX(EuiButtonIcon, {
|
|
91
91
|
className: className,
|
|
92
92
|
"aria-label": actionsDisabled ? allActionsButtonDisabledAriaLabel : allActionsButtonAriaLabel,
|
|
93
|
-
title: actionsDisabled ? allActionsButtonDisabledAriaLabel : undefined,
|
|
94
93
|
iconType: "boxesVertical",
|
|
95
94
|
color: "text",
|
|
96
95
|
isDisabled: actionsDisabled,
|
|
96
|
+
hasAriaDisabled: actionsDisabled,
|
|
97
97
|
onClick: function onClick() {
|
|
98
98
|
return setPopoverOpen(function (isOpen) {
|
|
99
99
|
return !isOpen;
|
|
@@ -101,14 +101,15 @@ export var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
101
101
|
},
|
|
102
102
|
"data-test-subj": "euiCollapsedItemActionsButton"
|
|
103
103
|
});
|
|
104
|
-
var withTooltip =
|
|
105
|
-
content: allActionsTooltip
|
|
104
|
+
var withTooltip = ___EmotionJSX(EuiToolTip, {
|
|
105
|
+
content: actionsDisabled ? allActionsButtonDisabledAriaLabel : allActionsTooltip,
|
|
106
|
+
disableScreenReaderOutput: true
|
|
106
107
|
}, popoverButton);
|
|
107
108
|
return ___EmotionJSX(EuiPopover, {
|
|
108
109
|
className: className,
|
|
109
110
|
id: "".concat(itemId, "-actions"),
|
|
110
111
|
isOpen: popoverOpen,
|
|
111
|
-
button: withTooltip
|
|
112
|
+
button: withTooltip,
|
|
112
113
|
closePopover: closePopover,
|
|
113
114
|
panelPaddingSize: "none",
|
|
114
115
|
anchorPosition: "leftCenter"
|