@elastic/eui 116.3.0 → 116.3.1-snapshot.1782218964187
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 +4 -0
- package/es/components/avatar/avatar.styles.js +16 -16
- package/es/components/banner/banner.js +1 -2
- package/es/components/banner/banner.styles.js +1 -1
- package/es/components/basic_table/basic_table.js +35 -5
- package/es/components/basic_table/basic_table.styles.js +19 -1
- package/es/components/basic_table/in_memory_table.js +17 -0
- package/es/components/basic_table/index.js +2 -1
- package/es/components/basic_table/pagination_bar.js +19 -4
- package/es/components/basic_table/pagination_bar.styles.js +21 -0
- package/es/components/basic_table/panel.styles.js +14 -0
- package/es/components/basic_table/use_panel_props.js +28 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
- package/es/components/flyout/flyout.component.js +10 -6
- package/es/components/flyout/flyout_menu.js +122 -19
- package/es/components/flyout/flyout_menu.styles.js +2 -1
- package/es/components/flyout/manager/actions.js +20 -0
- package/es/components/flyout/manager/flyout_child.js +23 -1
- package/es/components/flyout/manager/flyout_managed.js +65 -19
- package/es/components/flyout/manager/hooks.js +1 -1
- package/es/components/flyout/manager/index.js +2 -2
- package/es/components/flyout/manager/reducer.js +32 -8
- package/es/components/flyout/manager/selectors.js +8 -2
- package/es/components/flyout/manager/store.js +35 -2
- package/es/components/flyout/use_flyout_menu.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
- package/es/components/notification_icon/assets/info_fill.js +34 -0
- package/es/components/notification_icon/assets/warning_static.js +40 -0
- package/es/components/notification_icon/notification_icon.js +87 -0
- package/es/components/notification_icon/notification_icon.styles.js +22 -0
- package/es/components/table/mobile/table_sort_mobile.js +64 -103
- package/es/components/table/store/use_unique_column_id.js +25 -0
- package/es/components/table/table_header_cell.js +7 -8
- package/es/components/table/table_header_cell_checkbox.js +5 -6
- package/es/components/toast/global_toast_list.js +132 -6
- package/es/components/toast/global_toast_list.styles.js +31 -7
- package/es/components/toast/toast.js +242 -47
- package/es/components/toast/toast.styles.js +35 -47
- package/es/components/toast/toast_action.js +34 -0
- package/es/components/toast/types.js +9 -0
- package/es/components/tool_tip/tool_tip.js +61 -30
- package/es/components/tool_tip/tool_tip_anchor.js +5 -5
- package/es/components/tool_tip/tool_tip_manager.js +27 -2
- package/eui.d.ts +811 -552
- package/i18ntokens.json +981 -927
- package/lib/components/avatar/avatar.js +4 -0
- package/lib/components/avatar/avatar.styles.js +16 -16
- package/lib/components/banner/banner.js +1 -2
- package/lib/components/banner/banner.styles.js +1 -1
- package/lib/components/basic_table/basic_table.js +34 -4
- package/lib/components/basic_table/basic_table.styles.js +19 -1
- package/lib/components/basic_table/in_memory_table.js +17 -0
- package/lib/components/basic_table/index.js +8 -1
- package/lib/components/basic_table/pagination_bar.js +19 -4
- package/lib/components/basic_table/pagination_bar.styles.js +26 -0
- package/lib/components/basic_table/panel.styles.js +20 -0
- package/lib/components/basic_table/use_panel_props.js +33 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
- package/lib/components/flyout/flyout.component.js +10 -6
- package/lib/components/flyout/flyout_menu.js +120 -19
- package/lib/components/flyout/flyout_menu.styles.js +2 -1
- package/lib/components/flyout/manager/actions.js +21 -1
- package/lib/components/flyout/manager/flyout_child.js +23 -1
- package/lib/components/flyout/manager/flyout_managed.js +41 -17
- package/lib/components/flyout/manager/hooks.js +6 -0
- package/lib/components/flyout/manager/index.js +12 -0
- package/lib/components/flyout/manager/reducer.js +31 -7
- package/lib/components/flyout/manager/selectors.js +9 -3
- package/lib/components/flyout/manager/store.js +34 -1
- package/lib/components/flyout/use_flyout_menu.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
- package/lib/components/notification_icon/assets/info_fill.js +41 -0
- package/lib/components/notification_icon/assets/warning_static.js +47 -0
- package/lib/components/notification_icon/notification_icon.js +93 -0
- package/lib/components/notification_icon/notification_icon.styles.js +28 -0
- package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
- package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
- package/lib/components/table/mobile/table_sort_mobile.js +71 -108
- package/lib/components/table/store/use_unique_column_id.js +34 -0
- package/lib/components/table/table_header_cell.js +7 -8
- package/lib/components/table/table_header_cell_checkbox.js +5 -6
- package/lib/components/toast/global_toast_list.js +132 -6
- package/lib/components/toast/global_toast_list.styles.js +31 -8
- package/lib/components/toast/toast.js +244 -47
- package/lib/components/toast/toast.styles.js +32 -45
- package/lib/components/toast/toast_action.js +40 -0
- package/lib/components/toast/types.js +15 -0
- package/lib/components/tool_tip/tool_tip.js +59 -29
- package/lib/components/tool_tip/tool_tip_anchor.js +5 -5
- package/lib/components/tool_tip/tool_tip_manager.js +27 -2
- package/optimize/es/components/avatar/avatar.js +4 -0
- package/optimize/es/components/avatar/avatar.styles.js +16 -16
- package/optimize/es/components/banner/banner.js +1 -2
- package/optimize/es/components/banner/banner.styles.js +1 -1
- package/optimize/es/components/basic_table/basic_table.js +18 -5
- package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
- package/optimize/es/components/basic_table/index.js +2 -1
- package/optimize/es/components/basic_table/pagination_bar.js +19 -4
- package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
- package/optimize/es/components/basic_table/panel.styles.js +14 -0
- package/optimize/es/components/basic_table/use_panel_props.js +28 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
- package/optimize/es/components/flyout/flyout.component.js +10 -6
- package/optimize/es/components/flyout/flyout_menu.js +99 -18
- package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
- package/optimize/es/components/flyout/manager/actions.js +20 -0
- package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
- package/optimize/es/components/flyout/manager/hooks.js +1 -1
- package/optimize/es/components/flyout/manager/index.js +2 -2
- package/optimize/es/components/flyout/manager/reducer.js +32 -8
- package/optimize/es/components/flyout/manager/selectors.js +8 -2
- package/optimize/es/components/flyout/manager/store.js +35 -2
- package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
- package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
- package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
- package/optimize/es/components/notification_icon/notification_icon.js +77 -0
- package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
- package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
- package/optimize/es/components/table/store/use_unique_column_id.js +25 -0
- package/optimize/es/components/table/table_header_cell.js +7 -8
- package/optimize/es/components/table/table_header_cell_checkbox.js +5 -6
- package/optimize/es/components/toast/global_toast_list.js +31 -6
- package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
- package/optimize/es/components/toast/toast.js +143 -47
- package/optimize/es/components/toast/toast.styles.js +35 -47
- package/optimize/es/components/toast/toast_action.js +33 -0
- package/optimize/es/components/toast/types.js +9 -0
- package/optimize/es/components/tool_tip/tool_tip.js +58 -30
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +5 -5
- package/optimize/es/components/tool_tip/tool_tip_manager.js +27 -2
- package/optimize/lib/components/avatar/avatar.js +4 -0
- package/optimize/lib/components/avatar/avatar.styles.js +16 -16
- package/optimize/lib/components/banner/banner.js +1 -2
- package/optimize/lib/components/banner/banner.styles.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +17 -4
- package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
- package/optimize/lib/components/basic_table/index.js +8 -1
- package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
- package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
- package/optimize/lib/components/basic_table/panel.styles.js +20 -0
- package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
- package/optimize/lib/components/flyout/flyout.component.js +10 -6
- package/optimize/lib/components/flyout/flyout_menu.js +98 -18
- package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
- package/optimize/lib/components/flyout/manager/actions.js +21 -1
- package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
- package/optimize/lib/components/flyout/manager/hooks.js +6 -0
- package/optimize/lib/components/flyout/manager/index.js +12 -0
- package/optimize/lib/components/flyout/manager/reducer.js +31 -7
- package/optimize/lib/components/flyout/manager/selectors.js +9 -3
- package/optimize/lib/components/flyout/manager/store.js +34 -1
- package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
- package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
- package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
- package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
- package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
- package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
- package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
- package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
- package/optimize/lib/components/table/store/use_unique_column_id.js +34 -0
- package/optimize/lib/components/table/table_header_cell.js +7 -8
- package/optimize/lib/components/table/table_header_cell_checkbox.js +5 -6
- package/optimize/lib/components/toast/global_toast_list.js +31 -6
- package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
- package/optimize/lib/components/toast/toast.js +146 -47
- package/optimize/lib/components/toast/toast.styles.js +33 -45
- package/optimize/lib/components/toast/toast_action.js +39 -0
- package/optimize/lib/components/toast/types.js +15 -0
- package/optimize/lib/components/tool_tip/tool_tip.js +57 -29
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +5 -5
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +27 -2
- package/package.json +9 -6
- package/test-env/components/avatar/avatar.js +4 -0
- package/test-env/components/avatar/avatar.styles.js +16 -16
- package/test-env/components/banner/banner.js +1 -2
- package/test-env/components/banner/banner.styles.js +1 -1
- package/test-env/components/basic_table/basic_table.js +34 -4
- package/test-env/components/basic_table/basic_table.styles.js +19 -1
- package/test-env/components/basic_table/in_memory_table.js +17 -0
- package/test-env/components/basic_table/index.js +8 -1
- package/test-env/components/basic_table/pagination_bar.js +19 -4
- package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
- package/test-env/components/basic_table/panel.styles.js +20 -0
- package/test-env/components/basic_table/use_panel_props.js +33 -0
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
- package/test-env/components/flyout/flyout.component.js +10 -6
- package/test-env/components/flyout/flyout_menu.js +121 -19
- package/test-env/components/flyout/flyout_menu.styles.js +2 -1
- package/test-env/components/flyout/manager/actions.js +21 -1
- package/test-env/components/flyout/manager/flyout_child.js +23 -1
- package/test-env/components/flyout/manager/flyout_managed.js +41 -17
- package/test-env/components/flyout/manager/hooks.js +6 -0
- package/test-env/components/flyout/manager/index.js +12 -0
- package/test-env/components/flyout/manager/reducer.js +31 -7
- package/test-env/components/flyout/manager/selectors.js +9 -3
- package/test-env/components/flyout/manager/store.js +34 -1
- package/test-env/components/flyout/use_flyout_menu.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
- package/test-env/components/notification_icon/assets/info_fill.js +41 -0
- package/test-env/components/notification_icon/assets/warning_static.js +47 -0
- package/test-env/components/notification_icon/notification_icon.js +46 -0
- package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
- package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
- package/test-env/components/table/store/use_unique_column_id.js +34 -0
- package/test-env/components/table/table_header_cell.js +7 -8
- package/test-env/components/table/table_header_cell_checkbox.js +5 -6
- package/test-env/components/toast/global_toast_list.js +132 -6
- package/test-env/components/toast/global_toast_list.styles.js +30 -7
- package/test-env/components/toast/toast.js +242 -47
- package/test-env/components/toast/toast.styles.js +33 -45
- package/test-env/components/toast/toast_action.js +39 -0
- package/test-env/components/toast/types.js +15 -0
- package/test-env/components/tool_tip/tool_tip.js +57 -29
- package/test-env/components/tool_tip/tool_tip_anchor.js +5 -5
- package/test-env/components/tool_tip/tool_tip_manager.js +27 -2
|
@@ -13,7 +13,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
var _services = require("../../services");
|
|
14
14
|
var _tool_tip = require("./tool_tip.styles");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["onBlur", "onFocus", "
|
|
16
|
+
var _excluded = ["onBlur", "onFocus", "onMouseEnter", "onMouseLeave", "id", "className", "children", "display", "isVisible"];
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -26,8 +26,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
26
26
|
var EuiToolTipAnchor = exports.EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
27
27
|
var _onBlur = _ref.onBlur,
|
|
28
28
|
_onFocus = _ref.onFocus,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
30
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
31
31
|
id = _ref.id,
|
|
32
32
|
className = _ref.className,
|
|
33
33
|
children = _ref.children,
|
|
@@ -51,8 +51,8 @@ var EuiToolTipAnchor = exports.EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwar
|
|
|
51
51
|
id: anchorId
|
|
52
52
|
}, rest, {
|
|
53
53
|
className: classes,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
onMouseEnter: onMouseEnter,
|
|
55
|
+
onMouseLeave: onMouseLeave
|
|
56
56
|
}), /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
57
57
|
onFocus: function onFocus(e) {
|
|
58
58
|
_onFocus(e);
|
|
@@ -15,29 +15,54 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
|
+
|
|
18
19
|
/**
|
|
19
20
|
* Manager utility that ensures only one tooltip is visible at a time
|
|
21
|
+
* and lets the next tooltip to open skip its entry animation if another was
|
|
22
|
+
* just opened or just closed.
|
|
20
23
|
*
|
|
21
24
|
* UX rationale (primarily for mouse-only users):
|
|
22
25
|
* @see https://github.com/elastic/kibana/issues/144482
|
|
23
26
|
* @see https://github.com/elastic/eui/issues/5883
|
|
24
27
|
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Time window in ms after a tooltip closes during which the next one to open
|
|
31
|
+
* skips its entry animation.
|
|
32
|
+
*/
|
|
33
|
+
var SKIP_ANIMATION_WINDOW = 300;
|
|
25
34
|
var ToolTipManager = /*#__PURE__*/(0, _createClass2.default)(function ToolTipManager() {
|
|
26
35
|
var _this = this;
|
|
27
36
|
(0, _classCallCheck2.default)(this, ToolTipManager);
|
|
28
37
|
// We use a set instead of a single var just in case
|
|
29
38
|
// multiple tooltips are registered via async shenanigans
|
|
30
39
|
(0, _defineProperty2.default)(this, "toolTipsToHide", new Set());
|
|
40
|
+
// Timestamp of the last hide; `null` means no tooltip has closed yet.
|
|
41
|
+
(0, _defineProperty2.default)(this, "lastHiddenAt", null);
|
|
31
42
|
(0, _defineProperty2.default)(this, "registerTooltip", function (hideCallback) {
|
|
32
|
-
if (_this.toolTipsToHide.has(hideCallback)) return;
|
|
43
|
+
if (_this.toolTipsToHide.has(hideCallback)) return null;
|
|
44
|
+
var hadOpen = _this.toolTipsToHide.size > 0;
|
|
45
|
+
var recentlyClosed = _this.lastHiddenAt !== null && Date.now() - _this.lastHiddenAt < SKIP_ANIMATION_WINDOW;
|
|
33
46
|
_this.toolTipsToHide.forEach(function (hide) {
|
|
34
47
|
return hide();
|
|
35
48
|
});
|
|
36
49
|
_this.toolTipsToHide.clear();
|
|
37
50
|
_this.toolTipsToHide.add(hideCallback);
|
|
51
|
+
return {
|
|
52
|
+
skipAnimation: hadOpen || recentlyClosed
|
|
53
|
+
};
|
|
38
54
|
});
|
|
39
55
|
(0, _defineProperty2.default)(this, "deregisterToolTip", function (hideCallback) {
|
|
40
|
-
_this.toolTipsToHide.delete(hideCallback);
|
|
56
|
+
if (_this.toolTipsToHide.delete(hideCallback)) _this.lastHiddenAt = Date.now();
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Resets all internal state. Primarily intended for tests, so that a
|
|
60
|
+
* tooltip shown in one test doesn't leak into the next (the manager is a
|
|
61
|
+
* module-level singleton).
|
|
62
|
+
*/
|
|
63
|
+
(0, _defineProperty2.default)(this, "reset", function () {
|
|
64
|
+
_this.toolTipsToHide.clear();
|
|
65
|
+
_this.lastHiddenAt = null;
|
|
41
66
|
});
|
|
42
67
|
});
|
|
43
68
|
var toolTipManager = exports.toolTipManager = new ToolTipManager();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "116.3.
|
|
4
|
+
"version": "116.3.1-snapshot.1782218964187",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "yarn build:clean && yarn build:i18ntokens && node ./scripts/compile-eui.js",
|
|
23
23
|
"build-pack": "yarn build && yarn pack",
|
|
24
24
|
"watch": "node ../../scripts/watch-eui.js --package @elastic/eui",
|
|
25
|
-
"compile-icons": "node ./scripts/compile-icons.js && prettier --write --loglevel=warn \"./src/components/icon/assets/**/*.tsx\"",
|
|
25
|
+
"compile-icons": "node ./scripts/compile-icons.js && prettier --write --loglevel=warn \"./src/components/icon/assets/**/*.tsx\" \"./src/components/notification_icon/assets/**/*.tsx\"",
|
|
26
26
|
"lint": "yarn tsc --noEmit && yarn lint-es && yarn lint-css-in-js && yarn lint-sass",
|
|
27
27
|
"lint-fix": "yarn lint-es --fix && yarn lint-css-in-js --fix",
|
|
28
28
|
"lint-es": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache \"src/**/*.{ts,tsx,js}\"",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"release-rc": "node ./scripts/release.js --type=prerelease",
|
|
45
45
|
"storybook": "storybook dev -p 6006",
|
|
46
46
|
"build-storybook": "storybook build",
|
|
47
|
+
"test-storybook": "test-storybook",
|
|
47
48
|
"pre-push": "yarn test-staged",
|
|
48
49
|
"prerelease": "node ./scripts/prerelease.mjs"
|
|
49
50
|
},
|
|
@@ -117,8 +118,7 @@
|
|
|
117
118
|
"@emotion/jest": "^11.11.0",
|
|
118
119
|
"@emotion/react": "^11.11.0",
|
|
119
120
|
"@faker-js/faker": "^8.0.2",
|
|
120
|
-
"@
|
|
121
|
-
"@loki/is-loki-running": "^0.35.0",
|
|
121
|
+
"@playwright/test": "^1.44.0",
|
|
122
122
|
"@storybook/addon-essentials": "^8.4.5",
|
|
123
123
|
"@storybook/addon-interactions": "^8.4.5",
|
|
124
124
|
"@storybook/addon-links": "^8.4.5",
|
|
@@ -130,6 +130,7 @@
|
|
|
130
130
|
"@storybook/react": "^8.4.5",
|
|
131
131
|
"@storybook/react-webpack5": "^8.4.5",
|
|
132
132
|
"@storybook/test": "^8.4.5",
|
|
133
|
+
"@storybook/test-runner": "^0.19.1",
|
|
133
134
|
"@svgr/core": "8.0.0",
|
|
134
135
|
"@svgr/plugin-jsx": "^8.0.1",
|
|
135
136
|
"@svgr/plugin-svgo": "^8.0.1",
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
"@types/classnames": "^2.3.1",
|
|
144
145
|
"@types/enzyme": "^3.10.5",
|
|
145
146
|
"@types/jest": "^29.5.12",
|
|
147
|
+
"@types/jest-image-snapshot": "^5.1.0",
|
|
146
148
|
"@types/prettier": "2.7.3",
|
|
147
149
|
"@types/react": "^18.2.14",
|
|
148
150
|
"@types/react-dom": "^18.2.6",
|
|
@@ -206,7 +208,7 @@
|
|
|
206
208
|
"jest": "^29.7.0",
|
|
207
209
|
"jest-cli": "^29.7.0",
|
|
208
210
|
"jest-environment-jsdom": "^29.7.0",
|
|
209
|
-
"
|
|
211
|
+
"jest-image-snapshot": "^6.4.0",
|
|
210
212
|
"moment": "^2.27.0",
|
|
211
213
|
"moment-timezone": "^0.5.31",
|
|
212
214
|
"path": "^0.12.7",
|
|
@@ -272,5 +274,6 @@
|
|
|
272
274
|
],
|
|
273
275
|
"installConfig": {
|
|
274
276
|
"hoistingLimits": "workspaces"
|
|
275
|
-
}
|
|
277
|
+
},
|
|
278
|
+
"stableVersion": "116.3.1"
|
|
276
279
|
}
|
|
@@ -75,6 +75,7 @@ var EuiAvatar = exports.EuiAvatar = function EuiAvatar(_ref) {
|
|
|
75
75
|
var classes = (0, _classnames.default)('euiAvatar', (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "euiAvatar--".concat(size), size), "euiAvatar--".concat(type), type), 'euiAvatar-isDisabled', isDisabled), className);
|
|
76
76
|
var styles = (0, _services.useEuiMemoizedStyles)(_avatar.euiAvatarStyles);
|
|
77
77
|
var cssStyles = [styles.euiAvatar, styles[type], styles[size], styles[casing], isPlain && styles.plain, isSubdued && styles.subdued, isDisabled && styles.isDisabled];
|
|
78
|
+
var tooltipCssStyles = [styles.tooltip[type]];
|
|
78
79
|
var avatarStyle = (0, _react.useMemo)(function () {
|
|
79
80
|
if (imageUrl) {
|
|
80
81
|
return {
|
|
@@ -129,6 +130,9 @@ var EuiAvatar = exports.EuiAvatar = function EuiAvatar(_ref) {
|
|
|
129
130
|
// It already has `aria-label`, the tooltip is only visual.
|
|
130
131
|
return name ? (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
131
132
|
content: name,
|
|
133
|
+
anchorProps: {
|
|
134
|
+
css: tooltipCssStyles
|
|
135
|
+
},
|
|
132
136
|
disableScreenReaderOutput: true
|
|
133
137
|
}, avatarNode) : avatarNode;
|
|
134
138
|
};
|
|
@@ -13,9 +13,9 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
13
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
|
-
var _avatarSize = function _avatarSize(
|
|
17
|
-
var size =
|
|
18
|
-
fontSize =
|
|
16
|
+
var _avatarSize = function _avatarSize(_ref6) {
|
|
17
|
+
var size = _ref6.size,
|
|
18
|
+
fontSize = _ref6.fontSize;
|
|
19
19
|
return "\n ".concat((0, _global_styling.logicalSizeCSS)(size), ";\n font-size: ").concat(fontSize, ";\n ");
|
|
20
20
|
};
|
|
21
21
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -58,24 +58,20 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
58
58
|
styles: "cursor:not-allowed;filter:grayscale(100%);label:isDisabled;",
|
|
59
59
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
60
60
|
};
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
68
|
-
};
|
|
69
|
-
var euiAvatarStyles = exports.euiAvatarStyles = function euiAvatarStyles(_ref8) {
|
|
70
|
-
var euiTheme = _ref8.euiTheme;
|
|
61
|
+
var euiAvatarStyles = exports.euiAvatarStyles = function euiAvatarStyles(_ref7) {
|
|
62
|
+
var euiTheme = _ref7.euiTheme;
|
|
63
|
+
var borderRadius = {
|
|
64
|
+
user: '50%',
|
|
65
|
+
space: euiTheme.border.radius.medium
|
|
66
|
+
};
|
|
71
67
|
return {
|
|
72
68
|
// Base
|
|
73
69
|
euiAvatar: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;background-size:cover;background-color:", euiTheme.colors.lightShade, ";overflow:hidden;font-weight:", euiTheme.font.weight.medium, ";;label:euiAvatar;"),
|
|
74
70
|
// Variants
|
|
75
71
|
plain: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";;label:plain;"),
|
|
76
72
|
subdued: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.lightestShade, ";;label:subdued;"),
|
|
77
|
-
user:
|
|
78
|
-
space: /*#__PURE__*/(0, _react.css)("border-radius:",
|
|
73
|
+
user: /*#__PURE__*/(0, _react.css)("border-radius:", borderRadius.user, ";;label:user;"),
|
|
74
|
+
space: /*#__PURE__*/(0, _react.css)("border-radius:", borderRadius.space, ";;label:space;"),
|
|
79
75
|
// States
|
|
80
76
|
isDisabled: _ref5,
|
|
81
77
|
// Sizes
|
|
@@ -105,6 +101,10 @@ var euiAvatarStyles = exports.euiAvatarStyles = function euiAvatarStyles(_ref8)
|
|
|
105
101
|
capitalize: _ref4,
|
|
106
102
|
uppercase: _ref3,
|
|
107
103
|
lowercase: _ref2,
|
|
108
|
-
none: _ref
|
|
104
|
+
none: _ref,
|
|
105
|
+
tooltip: {
|
|
106
|
+
user: /*#__PURE__*/(0, _react.css)("border-radius:", borderRadius.user, ";;label:user;"),
|
|
107
|
+
space: /*#__PURE__*/(0, _react.css)("border-radius:", borderRadius.space, ";;label:space;")
|
|
108
|
+
}
|
|
109
109
|
};
|
|
110
110
|
};
|
|
@@ -58,8 +58,7 @@ var EuiBanner = exports.EuiBanner = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
58
58
|
var headingSize = size === 's' ? 'xxs' : 'xs';
|
|
59
59
|
var primaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary;
|
|
60
60
|
var secondaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary;
|
|
61
|
-
|
|
62
|
-
var hasActions = Boolean(primaryActionProps);
|
|
61
|
+
var hasActions = Boolean(primaryActionProps) || Boolean(secondaryActionProps);
|
|
63
62
|
var componentClass = 'euiBanner';
|
|
64
63
|
var classes = (0, _classnames.default)(componentClass, className);
|
|
65
64
|
var backgroundColorStyles = (0, _global_styling.useEuiBackgroundColorCSS)()[color];
|
|
@@ -64,7 +64,7 @@ var euiBannerStyles = exports.euiBannerStyles = function euiBannerStyles(_ref3)
|
|
|
64
64
|
}), ";;label:body;"),
|
|
65
65
|
// At size `s` the content slot becomes a block container so the title and
|
|
66
66
|
// text flow inline. Other sizes keep the flex column with a fixed gap.
|
|
67
|
-
content: /*#__PURE__*/(0, _react.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;"),
|
|
67
|
+
content: /*#__PURE__*/(0, _react.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, ";}}[data-size='m'] &{>.euiText+*{margin-block-start:", euiTheme.size.s, ";}};label:content;"),
|
|
68
68
|
title: _ref,
|
|
69
69
|
text: /*#__PURE__*/(0, _react.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;"),
|
|
70
70
|
actions: /*#__PURE__*/(0, _react.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({
|
|
@@ -39,7 +39,7 @@ var _accessibility2 = require("../../services/accessibility");
|
|
|
39
39
|
var _basic_table = require("./basic_table.styles");
|
|
40
40
|
var _tool_tip = require("../tool_tip");
|
|
41
41
|
var _react2 = require("@emotion/react");
|
|
42
|
-
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"],
|
|
42
|
+
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", "panelled"],
|
|
43
43
|
_excluded2 = ["align", "render", "dataType", "isExpander", "textOnly", "name", "field", "description", "sortable", "footer", "mobileOptions", "nameTooltip"];
|
|
44
44
|
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); }
|
|
45
45
|
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; }
|
|
@@ -370,6 +370,7 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
370
370
|
scrollableInline = _this$props2.scrollableInline,
|
|
371
371
|
stickyScrollbar = _this$props2.stickyScrollbar,
|
|
372
372
|
stickyHeader = _this$props2.stickyHeader,
|
|
373
|
+
panelled = _this$props2.panelled,
|
|
373
374
|
rest = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
|
|
374
375
|
var classes = (0, _classnames.default)('euiBasicTable', {
|
|
375
376
|
'euiBasicTable-loading': loading
|
|
@@ -391,8 +392,9 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
391
392
|
loading = _this$props3.loading,
|
|
392
393
|
scrollableInline = _this$props3.scrollableInline,
|
|
393
394
|
stickyScrollbar = _this$props3.stickyScrollbar,
|
|
394
|
-
stickyHeader = _this$props3.stickyHeader
|
|
395
|
-
|
|
395
|
+
stickyHeader = _this$props3.stickyHeader,
|
|
396
|
+
panelled = _this$props3.panelled;
|
|
397
|
+
var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_table.EuiTableHeaderMobile, {
|
|
396
398
|
responsiveBreakpoint: responsiveBreakpoint
|
|
397
399
|
}, this.renderSelectAll(true), this.renderTableMobileSort()), (0, _react2.jsx)(_services.OverrideCopiedTabularContent, null, (0, _react2.jsx)(_table.EuiTable, {
|
|
398
400
|
id: this.tableId,
|
|
@@ -405,6 +407,13 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
405
407
|
stickyHeader: stickyHeader,
|
|
406
408
|
css: loading && _basic_table.safariLoadingWorkaround
|
|
407
409
|
}, this.renderTableCaption(), this.renderTableHead(), this.renderTableBody(), this.renderTableFooter())));
|
|
410
|
+
if (panelled) {
|
|
411
|
+
return (0, _react2.jsx)("div", {
|
|
412
|
+
css: panelled && (0, _basic_table.euiBasicTableWrapperPanelledStyles)(responsiveBreakpoint),
|
|
413
|
+
"data-test-subj": "euiBasicTablePanelledWrapper"
|
|
414
|
+
}, content);
|
|
415
|
+
}
|
|
416
|
+
return content;
|
|
408
417
|
}
|
|
409
418
|
}, {
|
|
410
419
|
key: "renderTableMobileSort",
|
|
@@ -961,7 +970,9 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
961
970
|
error = _this$props11.error,
|
|
962
971
|
pagination = _this$props11.pagination,
|
|
963
972
|
tableCaption = _this$props11.tableCaption,
|
|
964
|
-
onChange = _this$props11.onChange
|
|
973
|
+
onChange = _this$props11.onChange,
|
|
974
|
+
panelled = _this$props11.panelled,
|
|
975
|
+
responsiveBreakpoint = _this$props11.responsiveBreakpoint;
|
|
965
976
|
if (!error && pagination && pagination.totalItemCount > 0) {
|
|
966
977
|
if (!onChange) {
|
|
967
978
|
throw new Error("The Basic Table is configured with pagination but [onChange] is\n not configured. This callback must be implemented to handle pagination changes");
|
|
@@ -975,6 +986,8 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
975
986
|
}, function (tablePagination) {
|
|
976
987
|
return (0, _react2.jsx)(_pagination_bar.PaginationBar, {
|
|
977
988
|
pagination: pagination,
|
|
989
|
+
panelled: panelled,
|
|
990
|
+
responsiveBreakpoint: responsiveBreakpoint,
|
|
978
991
|
onPageSizeChange: _this7.onPageSizeChange.bind(_this7),
|
|
979
992
|
onPageChange: _this7.onPageChange.bind(_this7),
|
|
980
993
|
"aria-controls": _this7.tableId,
|
|
@@ -1495,6 +1508,23 @@ EuiBasicTable.propTypes = {
|
|
|
1495
1508
|
* Provides an infinite loading indicator
|
|
1496
1509
|
*/
|
|
1497
1510
|
loading: _propTypes.default.bool,
|
|
1511
|
+
/**
|
|
1512
|
+
* Enable the panelled style of the table.
|
|
1513
|
+
*
|
|
1514
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1515
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1516
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1517
|
+
* @default false
|
|
1518
|
+
*/
|
|
1519
|
+
/**
|
|
1520
|
+
* Enable the panelled style of the table.
|
|
1521
|
+
*
|
|
1522
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1523
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1524
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1525
|
+
* @default false
|
|
1526
|
+
*/
|
|
1527
|
+
panelled: _propTypes.default.bool,
|
|
1498
1528
|
/**
|
|
1499
1529
|
* Message to display if table is empty
|
|
1500
1530
|
*/
|
|
@@ -4,10 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.safariLoadingWorkaround = exports.euiBasicTableBodyLoading = void 0;
|
|
7
|
+
exports.safariLoadingWorkaround = exports.euiBasicTableWrapperPanelledStyles = exports.euiBasicTableBodyLoading = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _global_styling = require("../../global_styling");
|
|
11
|
+
var _use_panel_props = require("./use_panel_props");
|
|
11
12
|
var _templateObject;
|
|
12
13
|
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)."; } /*
|
|
13
14
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -24,6 +25,23 @@ var euiBasicTableBodyLoading = exports.euiBasicTableBodyLoading = function euiBa
|
|
|
24
25
|
}), ";}};label:euiBasicTableBodyLoading;");
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
var euiBasicTableWrapperPanelledStyles = exports.euiBasicTableWrapperPanelledStyles = function euiBasicTableWrapperPanelledStyles(responsiveBreakpoint) {
|
|
32
|
+
return function (theme) {
|
|
33
|
+
var euiTheme = theme.euiTheme;
|
|
34
|
+
var styles = /*#__PURE__*/(0, _react.css)("border:", euiTheme.border.thin, ";border-block-end-width:0;padding-block-start:", euiTheme.border.width.thin, ";border-radius:", euiTheme.border.radius.medium, ";.euiTable{border-radius:", euiTheme.border.radius.medium, ";}.", _use_panel_props.EUI_BASIC_TABLE_PANEL_CLASS_NAME, "+.euiBasicTable &{border-start-start-radius:0;border-start-end-radius:0;.euiTable{border-start-start-radius:0;border-start-end-radius:0;}}&:not(:last-child),&:has(+ .", _use_panel_props.EUI_BASIC_TABLE_PANEL_CLASS_NAME, "){border-end-start-radius:0;border-end-end-radius:0;.euiTable{border-end-start-radius:0;border-end-end-radius:0;}};label:styles;");
|
|
35
|
+
if (responsiveBreakpoint === true) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (!responsiveBreakpoint) {
|
|
39
|
+
return styles;
|
|
40
|
+
}
|
|
41
|
+
return /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMinBreakpoint)(theme, responsiveBreakpoint), "{", styles, ";};label:euiBasicTableWrapperPanelledStyles;");
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
27
45
|
// Fix to make the loading indicator position correctly in Safari
|
|
28
46
|
// For whatever annoying reason, Safari doesn't respect `position: relative;`
|
|
29
47
|
// on `tbody` without `position: relative` on the parent `table`
|
|
@@ -1015,6 +1015,23 @@ EuiInMemoryTable.propTypes = {
|
|
|
1015
1015
|
* Provides an infinite loading indicator
|
|
1016
1016
|
*/
|
|
1017
1017
|
loading: _propTypes.default.bool,
|
|
1018
|
+
/**
|
|
1019
|
+
* Enable the panelled style of the table.
|
|
1020
|
+
*
|
|
1021
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1022
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1023
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1024
|
+
* @default false
|
|
1025
|
+
*/
|
|
1026
|
+
/**
|
|
1027
|
+
* Enable the panelled style of the table.
|
|
1028
|
+
*
|
|
1029
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1030
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1031
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1032
|
+
* @default false
|
|
1033
|
+
*/
|
|
1034
|
+
panelled: _propTypes.default.bool,
|
|
1018
1035
|
/**
|
|
1019
1036
|
* Applied to `EuiTableRow`
|
|
1020
1037
|
*/
|
|
@@ -15,5 +15,12 @@ Object.defineProperty(exports, "EuiInMemoryTable", {
|
|
|
15
15
|
return _in_memory_table.EuiInMemoryTable;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "useEuiBasicTablePanelProps", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _use_panel_props.useEuiBasicTablePanelProps;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
var _basic_table = require("./basic_table");
|
|
19
|
-
var _in_memory_table = require("./in_memory_table");
|
|
25
|
+
var _in_memory_table = require("./in_memory_table");
|
|
26
|
+
var _use_panel_props = require("./use_panel_props");
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.PaginationBar = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _services = require("../../services");
|
|
10
10
|
var _table_pagination = require("../table/table_pagination");
|
|
11
|
+
var _responsive_context = require("../table/mobile/responsive_context");
|
|
12
|
+
var _pagination_bar = require("./pagination_bar.styles");
|
|
11
13
|
var _react2 = require("@emotion/react");
|
|
12
14
|
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); }
|
|
13
15
|
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; }
|
|
@@ -19,8 +21,19 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
19
21
|
* Side Public License, v 1.
|
|
20
22
|
*/
|
|
21
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An internal utility component that renders EuiTablePagination with
|
|
30
|
+
* proper configuration and handles the `panelled` styles.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
22
33
|
var PaginationBar = exports.PaginationBar = function PaginationBar(_ref) {
|
|
23
34
|
var pagination = _ref.pagination,
|
|
35
|
+
panelled = _ref.panelled,
|
|
36
|
+
responsiveBreakpoint = _ref.responsiveBreakpoint,
|
|
24
37
|
onPageSizeChange = _ref.onPageSizeChange,
|
|
25
38
|
onPageChange = _ref.onPageChange,
|
|
26
39
|
ariaControls = _ref['aria-controls'],
|
|
@@ -35,14 +48,16 @@ var PaginationBar = exports.PaginationBar = function PaginationBar(_ref) {
|
|
|
35
48
|
_pagination$showPerPa = pagination.showPerPageOptions,
|
|
36
49
|
showPerPageOptions = _pagination$showPerPa === void 0 ? defaults.showPerPageOptions : _pagination$showPerPa;
|
|
37
50
|
var pageCount = pageSize ? Math.ceil(totalItemCount / pageSize) : 1;
|
|
51
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_pagination_bar.euiBasicTablePaginationBarStyles);
|
|
52
|
+
var isResponsive = (0, _responsive_context.useIsEuiTableResponsive)(responsiveBreakpoint);
|
|
38
53
|
(0, _react.useEffect)(function () {
|
|
39
54
|
if (pageCount < pageIndex + 1) {
|
|
40
55
|
onPageChange === null || onPageChange === void 0 || onPageChange(pageCount - 1);
|
|
41
56
|
}
|
|
42
57
|
}, [pageCount, onPageChange, pageIndex]);
|
|
43
|
-
return (0, _react2.jsx)("div",
|
|
44
|
-
|
|
45
|
-
}
|
|
58
|
+
return (0, _react2.jsx)("div", {
|
|
59
|
+
css: [styles.root, !isResponsive && panelled && styles.panelled, ";label:PaginationBar;"]
|
|
60
|
+
}, (0, _react2.jsx)(_table_pagination.EuiTablePagination, {
|
|
46
61
|
activePage: pageIndex,
|
|
47
62
|
showPerPageOptions: showPerPageOptions,
|
|
48
63
|
itemsPerPage: pageSize,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiBasicTablePaginationBarStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _global_styling = require("../../global_styling");
|
|
9
|
+
/*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
var euiBasicTablePaginationBarStyles = exports.euiBasicTablePaginationBarStyles = function euiBasicTablePaginationBarStyles(theme) {
|
|
21
|
+
var euiTheme = theme.euiTheme;
|
|
22
|
+
return {
|
|
23
|
+
root: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalShorthandCSS)('padding', "".concat(euiTheme.size.xs, " ").concat(euiTheme.size.s)), ";;label:root;"),
|
|
24
|
+
panelled: /*#__PURE__*/(0, _react.css)("background:", euiTheme.colors.backgroundBaseSubdued, ";border:", euiTheme.border.thin, ";border-block-start-width:0;", (0, _global_styling.logicalShorthandCSS)('border-radius', "0 0 ".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium)), ";;label:panelled;")
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiBasicTablePanelStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _global_styling = require("../../global_styling");
|
|
9
|
+
/*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var euiBasicTablePanelStyles = exports.euiBasicTablePanelStyles = function euiBasicTablePanelStyles(_ref) {
|
|
18
|
+
var euiTheme = _ref.euiTheme;
|
|
19
|
+
return /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.backgroundBaseSubdued, ";border:", euiTheme.border.thin, ";border-block-end-width:0;", (0, _global_styling.logicalShorthandCSS)('border-radius', "".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium, " 0 0")), "&+&{border-start-start-radius:0;border-start-end-radius:0;};label:euiBasicTablePanelStyles;");
|
|
20
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useEuiBasicTablePanelProps = exports.EUI_BASIC_TABLE_PANEL_CLASS_NAME = void 0;
|
|
7
|
+
var _services = require("../../services");
|
|
8
|
+
var _panel = require("./panel.styles");
|
|
9
|
+
/*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
var EUI_BASIC_TABLE_PANEL_CLASS_NAME = exports.EUI_BASIC_TABLE_PANEL_CLASS_NAME = 'euiBasicTablePanel';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A utility hook that returns props needed to be passed to element(s) being
|
|
24
|
+
* a part of the paneled table look and feel (e.g., a toolbar above the table).
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
var useEuiBasicTablePanelProps = exports.useEuiBasicTablePanelProps = function useEuiBasicTablePanelProps() {
|
|
28
|
+
var css = (0, _services.useEuiMemoizedStyles)(_panel.euiBasicTablePanelStyles);
|
|
29
|
+
return {
|
|
30
|
+
css: css,
|
|
31
|
+
className: EUI_BASIC_TABLE_PANEL_CLASS_NAME
|
|
32
|
+
};
|
|
33
|
+
};
|