@elastic/eui 88.0.0 → 88.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +9 -8
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +11 -41
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +11 -41
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +34 -9
- package/es/components/accordion/accordion.styles.js +29 -9
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +10 -26
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/es/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/es/components/description_list/description_list.js +40 -3
- package/es/components/flyout/flyout.styles.js +1 -1
- package/es/components/header/header.js +120 -25
- package/es/components/header/header.styles.js +1 -1
- package/es/components/index.js +1 -0
- package/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/es/components/page/page_sidebar/page_sidebar.js +2 -4
- package/es/components/page_template/page_template.js +4 -31
- package/es/components/text/text.styles.js +3 -6
- package/es/components/text_truncate/index.js +10 -0
- package/es/components/text_truncate/text_truncate.js +232 -0
- package/es/components/text_truncate/text_truncate.styles.js +49 -0
- package/es/components/text_truncate/utils.js +348 -0
- package/es/global_styling/functions/typography.js +8 -8
- package/es/global_styling/variables/typography.js +1 -1
- package/es/services/theme/context.js +3 -1
- package/es/services/theme/hooks.js +19 -1
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/provider.js +37 -8
- package/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/eui.d.ts +282 -24
- package/i18ntokens.json +112 -112
- package/lib/components/accordion/accordion.js +33 -8
- package/lib/components/accordion/accordion.styles.js +31 -10
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +10 -26
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/lib/components/description_list/description_list.js +39 -3
- package/lib/components/flyout/flyout.styles.js +1 -1
- package/lib/components/header/header.js +120 -23
- package/lib/components/header/header.styles.js +1 -1
- package/lib/components/index.js +11 -0
- package/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/lib/components/page/page_sidebar/page_sidebar.js +2 -4
- package/lib/components/page_template/page_template.js +2 -29
- package/lib/components/text/text.styles.js +3 -6
- package/lib/components/text_truncate/index.js +25 -0
- package/lib/components/text_truncate/text_truncate.js +242 -0
- package/lib/components/text_truncate/text_truncate.styles.js +54 -0
- package/lib/components/text_truncate/utils.js +352 -0
- package/lib/global_styling/functions/typography.js +8 -8
- package/lib/global_styling/variables/typography.js +3 -3
- package/lib/services/theme/context.js +3 -1
- package/lib/services/theme/hooks.js +21 -2
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/provider.js +62 -35
- package/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/es/components/accordion/accordion.js +19 -7
- package/optimize/es/components/accordion/accordion.styles.js +29 -9
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -26
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/optimize/es/components/description_list/description_list.js +22 -2
- package/optimize/es/components/flyout/flyout.styles.js +1 -1
- package/optimize/es/components/header/header.js +75 -25
- package/optimize/es/components/header/header.styles.js +1 -1
- package/optimize/es/components/index.js +1 -0
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -4
- package/optimize/es/components/page_template/page_template.js +4 -26
- package/optimize/es/components/text/text.styles.js +3 -6
- package/optimize/es/components/text_truncate/index.js +10 -0
- package/optimize/es/components/text_truncate/text_truncate.js +148 -0
- package/optimize/es/components/text_truncate/text_truncate.styles.js +49 -0
- package/optimize/es/components/text_truncate/utils.js +337 -0
- package/optimize/es/global_styling/functions/typography.js +8 -8
- package/optimize/es/global_styling/variables/typography.js +1 -1
- package/optimize/es/services/theme/context.js +3 -1
- package/optimize/es/services/theme/hooks.js +19 -1
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/provider.js +37 -8
- package/optimize/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/lib/components/accordion/accordion.js +18 -6
- package/optimize/lib/components/accordion/accordion.styles.js +31 -10
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -26
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/optimize/lib/components/description_list/description_list.js +22 -2
- package/optimize/lib/components/flyout/flyout.styles.js +1 -1
- package/optimize/lib/components/header/header.js +77 -24
- package/optimize/lib/components/header/header.styles.js +1 -1
- package/optimize/lib/components/index.js +11 -0
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/lib/components/page/page_sidebar/page_sidebar.js +2 -4
- package/optimize/lib/components/page_template/page_template.js +2 -24
- package/optimize/lib/components/text/text.styles.js +3 -6
- package/optimize/lib/components/text_truncate/index.js +25 -0
- package/optimize/lib/components/text_truncate/text_truncate.js +158 -0
- package/optimize/lib/components/text_truncate/text_truncate.styles.js +54 -0
- package/optimize/lib/components/text_truncate/utils.js +342 -0
- package/optimize/lib/global_styling/functions/typography.js +8 -8
- package/optimize/lib/global_styling/variables/typography.js +3 -3
- package/optimize/lib/services/theme/context.js +3 -1
- package/optimize/lib/services/theme/hooks.js +21 -2
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/provider.js +62 -35
- package/optimize/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/package.json +1 -1
- package/src/components/datagrid/_data_grid.scss +13 -2
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +1 -7
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_header.scss +2 -0
- package/test-env/components/accordion/accordion.js +28 -8
- package/test-env/components/accordion/accordion.styles.js +31 -10
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +10 -26
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/test-env/components/description_list/description_list.js +37 -3
- package/test-env/components/flyout/flyout.styles.js +1 -1
- package/test-env/components/header/header.js +113 -23
- package/test-env/components/header/header.styles.js +1 -1
- package/test-env/components/index.js +11 -0
- package/test-env/components/markdown_editor/markdown_format.styles.js +3 -6
- package/test-env/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/test-env/components/page/page_sidebar/page_sidebar.js +2 -4
- package/test-env/components/page_template/page_template.js +2 -24
- package/test-env/components/text/text.styles.js +3 -6
- package/test-env/components/text_truncate/index.js +25 -0
- package/test-env/components/text_truncate/text_truncate.js +236 -0
- package/test-env/components/text_truncate/text_truncate.styles.js +54 -0
- package/test-env/components/text_truncate/utils.js +342 -0
- package/test-env/global_styling/functions/typography.js +8 -8
- package/test-env/global_styling/variables/typography.js +3 -3
- package/test-env/services/theme/context.js +3 -1
- package/test-env/services/theme/hooks.js +21 -2
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/provider.js +62 -35
- package/test-env/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/src/components/accordion/_accordion_form.scss +0 -40
- package/src/components/accordion/_index.scss +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.euiAccordionTriggerWrapperStyles = exports.euiAccordionSpinnerStyles = exports.euiAccordionOptionalActionStyles = exports.euiAccordionIconButtonStyles = exports.euiAccordionChildrenStyles = exports.euiAccordionChildWrapperStyles = exports.euiAccordionButtonStyles = void 0;
|
|
6
|
+
exports.euiAccordionTriggerWrapperStyles = exports.euiAccordionStyles = exports.euiAccordionSpinnerStyles = exports.euiAccordionOptionalActionStyles = exports.euiAccordionIconButtonStyles = exports.euiAccordionChildrenStyles = exports.euiAccordionChildWrapperStyles = exports.euiAccordionButtonStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
9
|
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,13 +13,34 @@ 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 euiAccordionStyles = function euiAccordionStyles(_ref5) {
|
|
17
|
+
var euiTheme = _ref5.euiTheme;
|
|
18
|
+
return {
|
|
19
|
+
euiAccordion: /*#__PURE__*/(0, _react.css)(";label:euiAccordion;"),
|
|
20
|
+
// Borders
|
|
21
|
+
borders: {
|
|
22
|
+
// Prevent border repeats
|
|
23
|
+
borders: /*#__PURE__*/(0, _react.css)("&+[class*='euiAccordion-borders']{", (0, _global_styling.logicalCSS)('border-top', 'none'), ";};label:borders;"),
|
|
24
|
+
horizontal: /*#__PURE__*/(0, _react.css)("border-block:", euiTheme.border.thin, ";;label:horizontal;"),
|
|
25
|
+
all: /*#__PURE__*/(0, _react.css)("border:", euiTheme.border.thin, ";;label:all;")
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.euiAccordionStyles = euiAccordionStyles;
|
|
16
30
|
var euiAccordionButtonStyles = function euiAccordionButtonStyles(euiThemeContext) {
|
|
17
31
|
var euiTheme = euiThemeContext.euiTheme;
|
|
18
32
|
return {
|
|
19
33
|
euiAccordion__button: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 's'), " align-items:center;display:flex;flex-grow:1;line-height:", euiTheme.size.l, ";", (0, _global_styling.logicalTextAlignCSS)('left'), " ", (0, _global_styling.logicalCSS)('width', '100%'), " &:hover,&:focus{cursor:pointer;text-decoration:underline;};label:euiAccordion__button;"),
|
|
20
34
|
// Triggering button needs separate `disabled` key because the element that renders may not support `:disabled`;
|
|
21
35
|
// Hover pseudo selector for specificity
|
|
22
|
-
disabled: /*#__PURE__*/(0, _react.css)("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;")
|
|
36
|
+
disabled: /*#__PURE__*/(0, _react.css)("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;"),
|
|
37
|
+
// Optional padding sizes
|
|
38
|
+
s: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.s, ";;label:s;"),
|
|
39
|
+
m: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.base, ";;label:m;"),
|
|
40
|
+
l: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.l, ";;label:l;"),
|
|
41
|
+
// Remove padding from the accordion button on the side that the arrow is on
|
|
42
|
+
arrowLeft: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', 0), ";;label:arrowLeft;"),
|
|
43
|
+
arrowRight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', 0), ";;label:arrowRight;")
|
|
23
44
|
};
|
|
24
45
|
};
|
|
25
46
|
exports.euiAccordionButtonStyles = euiAccordionButtonStyles;
|
|
@@ -31,8 +52,8 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
|
31
52
|
styles: "align-items:center;display:flex;label:isLoading;",
|
|
32
53
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
33
54
|
};
|
|
34
|
-
var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(
|
|
35
|
-
var euiTheme =
|
|
55
|
+
var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref6) {
|
|
56
|
+
var euiTheme = _ref6.euiTheme;
|
|
36
57
|
return {
|
|
37
58
|
euiAccordion__children: /*#__PURE__*/(0, _react.css)(";label:euiAccordion__children;"),
|
|
38
59
|
isLoading: _ref4,
|
|
@@ -44,8 +65,8 @@ var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref5) {
|
|
|
44
65
|
};
|
|
45
66
|
};
|
|
46
67
|
exports.euiAccordionChildrenStyles = euiAccordionChildrenStyles;
|
|
47
|
-
var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(
|
|
48
|
-
var euiTheme =
|
|
68
|
+
var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref7) {
|
|
69
|
+
var euiTheme = _ref7.euiTheme;
|
|
49
70
|
return {
|
|
50
71
|
euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
|
|
51
72
|
isOpen: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
|
|
@@ -60,8 +81,8 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
|
60
81
|
styles: "transform:rotate(\n 90deg\n )!important;label:isOpen;",
|
|
61
82
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
62
83
|
};
|
|
63
|
-
var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(
|
|
64
|
-
var euiTheme =
|
|
84
|
+
var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref8) {
|
|
85
|
+
var euiTheme = _ref8.euiTheme;
|
|
65
86
|
return {
|
|
66
87
|
euiAccordion__iconButton: /*#__PURE__*/(0, _react.css)("flex-shrink:0;", (0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), " transform:rotate(\n 0deg\n )!important;;label:euiAccordion__iconButton;"),
|
|
67
88
|
isOpen: _ref3,
|
|
@@ -83,8 +104,8 @@ var euiAccordionOptionalActionStyles = function euiAccordionOptionalActionStyles
|
|
|
83
104
|
};
|
|
84
105
|
};
|
|
85
106
|
exports.euiAccordionOptionalActionStyles = euiAccordionOptionalActionStyles;
|
|
86
|
-
var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(
|
|
87
|
-
var euiTheme =
|
|
107
|
+
var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref9) {
|
|
108
|
+
var euiTheme = _ref9.euiTheme;
|
|
88
109
|
return {
|
|
89
110
|
euiAccordion__spinner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:euiAccordion__spinner;")
|
|
90
111
|
};
|
|
@@ -199,13 +199,17 @@ EuiCollapsibleNavGroup.propTypes = {
|
|
|
199
199
|
*/
|
|
200
200
|
buttonClassName: _propTypes.default.string,
|
|
201
201
|
/**
|
|
202
|
-
* Apply more props to the triggering button
|
|
202
|
+
* Apply more props to the triggering button.
|
|
203
|
+
*
|
|
204
|
+
* Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
|
|
205
|
+
* Note: Padding will not be present on the side closest to the accordion arrow.
|
|
203
206
|
*/
|
|
204
207
|
buttonProps: _propTypes.default.shape({
|
|
205
208
|
className: _propTypes.default.string,
|
|
206
209
|
"aria-label": _propTypes.default.string,
|
|
207
210
|
"data-test-subj": _propTypes.default.string,
|
|
208
|
-
css: _propTypes.default.any
|
|
211
|
+
css: _propTypes.default.any,
|
|
212
|
+
paddingSize: _propTypes.default.oneOf(["s", "m", "l"])
|
|
209
213
|
}),
|
|
210
214
|
/**
|
|
211
215
|
* Class that will apply to the trigger content for the accordion.
|
|
@@ -244,6 +248,10 @@ EuiCollapsibleNavGroup.propTypes = {
|
|
|
244
248
|
* Placement of the arrow indicator, or 'none' to hide it.
|
|
245
249
|
*/
|
|
246
250
|
arrowDisplay: _propTypes.default.oneOf(["left", "right", "none"]),
|
|
251
|
+
/**
|
|
252
|
+
* Optional border styling. Defaults to 'none'.
|
|
253
|
+
*/
|
|
254
|
+
borders: _propTypes.default.oneOf(["horizontal", "all", "none"]),
|
|
247
255
|
/**
|
|
248
256
|
* Control the opening of accordion via prop
|
|
249
257
|
*/
|
|
@@ -9,7 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../services");
|
|
12
|
-
var _global_styling = require("../../global_styling");
|
|
13
12
|
var _flyout = require("../flyout");
|
|
14
13
|
var _i18n = require("../i18n");
|
|
15
14
|
var _header = require("../header/header.styles");
|
|
@@ -17,7 +16,7 @@ var _context = require("./context");
|
|
|
17
16
|
var _collapsible_nav_button = require("./collapsible_nav_button");
|
|
18
17
|
var _collapsible_nav_beta = require("./collapsible_nav_beta.styles");
|
|
19
18
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["id", "children", "className", "
|
|
19
|
+
var _excluded = ["id", "children", "className", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
|
|
21
20
|
/*
|
|
22
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -50,9 +49,9 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
50
49
|
var id = _ref.id,
|
|
51
50
|
children = _ref.children,
|
|
52
51
|
className = _ref.className,
|
|
53
|
-
style = _ref.style,
|
|
54
52
|
_ref$initialIsCollaps = _ref.initialIsCollapsed,
|
|
55
53
|
initialIsCollapsed = _ref$initialIsCollaps === void 0 ? false : _ref$initialIsCollaps,
|
|
54
|
+
onCollapseToggle = _ref.onCollapseToggle,
|
|
56
55
|
_ref$width = _ref.width,
|
|
57
56
|
_width = _ref$width === void 0 ? 248 : _ref$width,
|
|
58
57
|
_ref$side = _ref.side,
|
|
@@ -71,9 +70,10 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
71
70
|
setIsCollapsed = _useState2[1];
|
|
72
71
|
var toggleCollapsed = (0, _react.useCallback)(function () {
|
|
73
72
|
return setIsCollapsed(function (isCollapsed) {
|
|
73
|
+
onCollapseToggle === null || onCollapseToggle === void 0 ? void 0 : onCollapseToggle(!isCollapsed);
|
|
74
74
|
return !isCollapsed;
|
|
75
75
|
});
|
|
76
|
-
}, []);
|
|
76
|
+
}, [onCollapseToggle]);
|
|
77
77
|
var onClose = (0, _react.useCallback)(function () {
|
|
78
78
|
return setIsCollapsed(true);
|
|
79
79
|
}, []);
|
|
@@ -119,24 +119,6 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
119
119
|
return _width;
|
|
120
120
|
}, [_width, isOverlayFullWidth, isPush, isCollapsed, headerHeight]);
|
|
121
121
|
|
|
122
|
-
/**
|
|
123
|
-
* Header affordance
|
|
124
|
-
*/
|
|
125
|
-
var _useState7 = (0, _react.useState)(false),
|
|
126
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
127
|
-
fixedHeadersCount = _useState8[0],
|
|
128
|
-
setFixedHeadersCount = _useState8[1];
|
|
129
|
-
(0, _react.useEffect)(function () {
|
|
130
|
-
setFixedHeadersCount(document.querySelectorAll('.euiHeader[data-fixed-header]').length);
|
|
131
|
-
}, []);
|
|
132
|
-
var stylesWithHeaderOffset = (0, _react.useMemo)(function () {
|
|
133
|
-
if (!fixedHeadersCount) return style;
|
|
134
|
-
var headersOffset = (0, _global_styling.mathWithUnits)(headerHeight, function (x) {
|
|
135
|
-
return x * fixedHeadersCount;
|
|
136
|
-
});
|
|
137
|
-
return _objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('top', headersOffset)), (0, _global_styling.logicalStyle)('height', "calc(100% - ".concat(headersOffset, ")")));
|
|
138
|
-
}, [fixedHeadersCount, style, headerHeight]);
|
|
139
|
-
|
|
140
122
|
/**
|
|
141
123
|
* Prop setup
|
|
142
124
|
*/
|
|
@@ -154,16 +136,13 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
154
136
|
var classes = (0, _classnames.default)('euiCollapsibleNav', 'euiCollapsibleNavBeta', className);
|
|
155
137
|
var styles = (0, _collapsible_nav_beta.euiCollapsibleNavBetaStyles)(euiTheme);
|
|
156
138
|
var cssStyles = [styles.euiCollapsibleNavBeta, styles[side], isPush && styles.isPush, isPush && isCollapsed && styles.isPushCollapsed, isOverlayFullWidth && styles.isOverlayFullWidth];
|
|
157
|
-
|
|
158
|
-
// Wait for any fixed headers to be queried before rendering (prevents position jumping)
|
|
159
|
-
var flyout = fixedHeadersCount !== false && (0, _react2.jsx)(_flyout.EuiFlyout, _extends({
|
|
139
|
+
var flyout = (0, _react2.jsx)(_flyout.EuiFlyout, _extends({
|
|
160
140
|
"aria-label": defaultAriaLabel
|
|
161
141
|
}, rest, {
|
|
162
142
|
// EuiCollapsibleNav is significantly less permissive than EuiFlyout
|
|
163
143
|
id: flyoutID,
|
|
164
144
|
css: cssStyles,
|
|
165
145
|
className: classes,
|
|
166
|
-
style: stylesWithHeaderOffset,
|
|
167
146
|
size: width,
|
|
168
147
|
side: side,
|
|
169
148
|
focusTrapProps: focusTrapProps,
|
|
@@ -211,6 +190,11 @@ EuiCollapsibleNavBeta.propTypes = {
|
|
|
211
190
|
* Whether the navigation flyout should default to initially collapsed or expanded
|
|
212
191
|
*/
|
|
213
192
|
initialIsCollapsed: _propTypes.default.bool,
|
|
193
|
+
/**
|
|
194
|
+
* Optional callback that fires when the user toggles the nav between
|
|
195
|
+
* collapsed and uncollapsed states
|
|
196
|
+
*/
|
|
197
|
+
onCollapseToggle: _propTypes.default.func,
|
|
214
198
|
/**
|
|
215
199
|
* Defaults to 248px wide. The navigation width determines behavior at
|
|
216
200
|
* various responsive breakpoints.
|
|
@@ -7,6 +7,7 @@ exports.euiCollapsibleNavBetaStyles = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
9
|
var _themes = require("../../themes");
|
|
10
|
+
var _header = require("../header/header.styles");
|
|
10
11
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
11
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
13
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -24,8 +25,16 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
24
25
|
};
|
|
25
26
|
var euiCollapsibleNavBetaStyles = function euiCollapsibleNavBetaStyles(euiThemeContext) {
|
|
26
27
|
var euiTheme = euiThemeContext.euiTheme;
|
|
28
|
+
|
|
29
|
+
// At least for serverless, EuiCollapsibleNav is only going to be used with 1
|
|
30
|
+
// fixed header. For those scenarios, we can prevent a minor layout jump on
|
|
31
|
+
// page load by setting the CSS var fallback to the height of a single header
|
|
32
|
+
var defaultHeaderHeight = (0, _header.euiHeaderVariables)(euiThemeContext).height;
|
|
33
|
+
var fixedHeaderOffset = "var(--euiFixedHeadersOffset, ".concat(defaultHeaderHeight, ")");
|
|
27
34
|
return {
|
|
28
|
-
euiCollapsibleNavBeta: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('
|
|
35
|
+
euiCollapsibleNavBeta: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', fixedHeaderOffset), (0, _global_styling.euiYScroll)(euiThemeContext, {
|
|
36
|
+
height: 'inherit'
|
|
37
|
+
}), (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), ".euiFlyoutBody{", (0, _global_styling.logicalCSS)('min-height', '50%'), ";}.euiFlyoutFooter{background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";};label:euiCollapsibleNavBeta;"),
|
|
29
38
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thin), ";;label:left;"),
|
|
30
39
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thin), ";;label:right;"),
|
|
31
40
|
isPush: /*#__PURE__*/(0, _react.css)((0, _themes.euiShadowFlat)(euiThemeContext), ";;label:isPush;"),
|
|
@@ -66,6 +66,7 @@ var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts() {
|
|
|
66
66
|
}, (0, _react2.jsx)(_description_list.EuiDescriptionList, {
|
|
67
67
|
"aria-labelledby": titleId,
|
|
68
68
|
type: "column",
|
|
69
|
+
columnWidths: [1, 3],
|
|
69
70
|
align: "center",
|
|
70
71
|
compressed: true,
|
|
71
72
|
listItems: [{
|
|
@@ -14,7 +14,7 @@ var _description_list_title = require("./description_list_title");
|
|
|
14
14
|
var _description_list_description = require("./description_list_description");
|
|
15
15
|
var _description_list = require("./description_list.styles");
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
|
-
var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "rowGutterSize", "columnGutterSize"];
|
|
17
|
+
var _excluded = ["align", "children", "className", "style", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "rowGutterSize", "columnGutterSize", "columnWidths"];
|
|
18
18
|
/*
|
|
19
19
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
20
20
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -26,6 +26,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
32
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
33
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
29
34
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
30
35
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
36
|
var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
@@ -33,6 +38,7 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
33
38
|
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
34
39
|
children = _ref.children,
|
|
35
40
|
className = _ref.className,
|
|
41
|
+
style = _ref.style,
|
|
36
42
|
_ref$compressed = _ref.compressed,
|
|
37
43
|
compressed = _ref$compressed === void 0 ? false : _ref$compressed,
|
|
38
44
|
descriptionProps = _ref.descriptionProps,
|
|
@@ -46,6 +52,7 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
46
52
|
rowGutterSize = _ref$rowGutterSize === void 0 ? 's' : _ref$rowGutterSize,
|
|
47
53
|
_ref$columnGutterSize = _ref.columnGutterSize,
|
|
48
54
|
columnGutterSize = _ref$columnGutterSize === void 0 ? 's' : _ref$columnGutterSize,
|
|
55
|
+
columnWidths = _ref.columnWidths,
|
|
49
56
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
57
|
var showResponsiveColumns = (0, _services.useIsWithinBreakpoints)(['xs', 's']);
|
|
51
58
|
var type = (0, _react.useMemo)(function () {
|
|
@@ -58,6 +65,20 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
58
65
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
59
66
|
var styles = (0, _description_list.euiDescriptionListStyles)(euiTheme);
|
|
60
67
|
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align], type === 'column' && styles.rowGap[rowGutterSize], type === 'column' && styles.columnGap[columnGutterSize]];
|
|
68
|
+
var inlineStyles = (0, _react.useMemo)(function () {
|
|
69
|
+
if (type === 'column' && columnWidths) {
|
|
70
|
+
// Leave string values as is - e.g. if a consumer passes in a specific '200px' or 'minmax()'
|
|
71
|
+
var convertNumbersToFr = function convertNumbersToFr(value) {
|
|
72
|
+
return typeof value === 'number' ? "".concat(value, "fr") : value;
|
|
73
|
+
};
|
|
74
|
+
var titleWidth = convertNumbersToFr(columnWidths[0]);
|
|
75
|
+
var descriptionWidth = convertNumbersToFr(columnWidths[1]);
|
|
76
|
+
return _objectSpread({
|
|
77
|
+
gridTemplateColumns: "".concat(titleWidth, " ").concat(descriptionWidth)
|
|
78
|
+
}, style);
|
|
79
|
+
}
|
|
80
|
+
return style;
|
|
81
|
+
}, [style, type, columnWidths]);
|
|
61
82
|
var classes = (0, _classnames.default)('euiDescriptionList', className);
|
|
62
83
|
var childrenOrListItems = null;
|
|
63
84
|
if (listItems) {
|
|
@@ -81,7 +102,8 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
81
102
|
}
|
|
82
103
|
}, (0, _react2.jsx)("dl", _extends({
|
|
83
104
|
className: classes,
|
|
84
|
-
css: cssStyles
|
|
105
|
+
css: cssStyles,
|
|
106
|
+
style: inlineStyles
|
|
85
107
|
}, rest, {
|
|
86
108
|
"data-type": _type
|
|
87
109
|
}), childrenOrListItems));
|
|
@@ -140,5 +162,19 @@ EuiDescriptionList.propTypes = {
|
|
|
140
162
|
*
|
|
141
163
|
* Only applies to `column` and `responsiveColumn` types.
|
|
142
164
|
*/
|
|
143
|
-
columnGutterSize: _propTypes.default.any
|
|
165
|
+
columnGutterSize: _propTypes.default.any,
|
|
166
|
+
/**
|
|
167
|
+
* Allows customizing specific column widths (e.g. `['100px', '200px']`). The first
|
|
168
|
+
* array value applies to the title column, and the second applies to the description column.
|
|
169
|
+
*
|
|
170
|
+
* Passing numbers instead of CSS width strings will use a ratio of widths.
|
|
171
|
+
* For example, [1, 3] will render a description column 3x the width of the title column.
|
|
172
|
+
* In other words, descriptions will have a width of `75%` and titles will have a width of `25%`.
|
|
173
|
+
*
|
|
174
|
+
* Only applies to `column` and `responsiveColumn` types.
|
|
175
|
+
*
|
|
176
|
+
* _Advanced usage note:_ column width strings also accept [CSS grid special units,
|
|
177
|
+
* sizing, keywords, and sizing functions](https://css-tricks.com/snippets/css/complete-guide-grid/#aa-special-units-functions).
|
|
178
|
+
*/
|
|
179
|
+
columnWidths: _propTypes.default.any
|
|
144
180
|
};
|
|
@@ -40,7 +40,7 @@ exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
|
|
|
40
40
|
var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
41
41
|
var euiTheme = euiThemeContext.euiTheme;
|
|
42
42
|
return {
|
|
43
|
-
euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('
|
|
43
|
+
euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), " ", (0, _global_styling.logicalCSS)('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
|
|
44
44
|
// Flyout sizes
|
|
45
45
|
s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
|
|
46
46
|
m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
|
|
@@ -4,16 +4,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.EuiHeader = void 0;
|
|
7
|
+
exports.euiFixedHeadersCount = exports.EuiHeader = exports.EuiFixedHeader = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../services");
|
|
12
|
+
var _global_styling = require("../../global_styling");
|
|
12
13
|
var _header_breadcrumbs = require("./header_breadcrumbs");
|
|
13
14
|
var _header_section = require("./header_section");
|
|
14
15
|
var _header = require("./header.styles");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var
|
|
17
|
+
var _euiFixedHeadersCount, _euiFixedHeadersCount2;
|
|
18
|
+
var _excluded = ["children", "className", "sections", "position", "theme"],
|
|
19
|
+
_excluded2 = ["children", "style"];
|
|
17
20
|
/*
|
|
18
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -24,6 +27,17 @@ var _excluded = ["children", "className", "sections", "position", "theme"];
|
|
|
24
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
34
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
36
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
38
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
39
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
41
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
28
42
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
43
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -34,8 +48,6 @@ var createHeaderSection = function createHeaderSection(sections) {
|
|
|
34
48
|
}, section);
|
|
35
49
|
});
|
|
36
50
|
};
|
|
37
|
-
// Start a counter to manage the total number of fixed headers that need the body class
|
|
38
|
-
var euiHeaderFixedCounter = 0;
|
|
39
51
|
var EuiHeader = function EuiHeader(_ref) {
|
|
40
52
|
var children = _ref.children,
|
|
41
53
|
className = _ref.className,
|
|
@@ -49,22 +61,6 @@ var EuiHeader = function EuiHeader(_ref) {
|
|
|
49
61
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
50
62
|
var styles = (0, _header.euiHeaderStyles)(euiTheme);
|
|
51
63
|
var cssStyles = [styles.euiHeader, styles[position], styles[theme]];
|
|
52
|
-
(0, _react.useEffect)(function () {
|
|
53
|
-
if (position === 'fixed') {
|
|
54
|
-
// Increment fixed header counter for each fixed header
|
|
55
|
-
euiHeaderFixedCounter++;
|
|
56
|
-
document.body.classList.add('euiBody--headerIsFixed');
|
|
57
|
-
document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
|
|
58
|
-
return function () {
|
|
59
|
-
// Both decrement the fixed counter AND then check if there are none
|
|
60
|
-
if (--euiHeaderFixedCounter === 0) {
|
|
61
|
-
// If there are none, THEN remove class
|
|
62
|
-
document.body.classList.remove('euiBody--headerIsFixed');
|
|
63
|
-
delete document.body.dataset.fixedHeaders;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}, [position]);
|
|
68
64
|
var contents;
|
|
69
65
|
if (sections) {
|
|
70
66
|
if (children) {
|
|
@@ -93,12 +89,22 @@ var EuiHeader = function EuiHeader(_ref) {
|
|
|
93
89
|
} else {
|
|
94
90
|
contents = children;
|
|
95
91
|
}
|
|
96
|
-
return (0, _react2.jsx)(
|
|
92
|
+
return position === 'fixed' ? (0, _react2.jsx)(EuiFixedHeader, _extends({
|
|
93
|
+
css: cssStyles,
|
|
94
|
+
className: classes
|
|
95
|
+
}, rest), contents) : (0, _react2.jsx)("div", _extends({
|
|
97
96
|
css: cssStyles,
|
|
98
|
-
className: classes
|
|
99
|
-
"data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
|
|
97
|
+
className: classes
|
|
100
98
|
}, rest), contents);
|
|
101
99
|
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Fixed headers - logic around dynamically calculating the total
|
|
103
|
+
* page offset and setting the `top` position of subsequent headers
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
// Start a counter to manage the total number of fixed headers
|
|
107
|
+
// Exported for unit testing only
|
|
102
108
|
exports.EuiHeader = EuiHeader;
|
|
103
109
|
EuiHeader.propTypes = {
|
|
104
110
|
className: _propTypes.default.string,
|
|
@@ -136,4 +142,95 @@ EuiHeader.propTypes = {
|
|
|
136
142
|
* Or, force the header into pseudo `dark` theme for all themes.
|
|
137
143
|
*/
|
|
138
144
|
theme: _propTypes.default.oneOf(["default", "dark"])
|
|
145
|
+
};
|
|
146
|
+
var euiFixedHeadersCount = 0;
|
|
147
|
+
|
|
148
|
+
// Exported for unit testing only
|
|
149
|
+
exports.euiFixedHeadersCount = euiFixedHeadersCount;
|
|
150
|
+
var EuiFixedHeader = function EuiFixedHeader(_ref2) {
|
|
151
|
+
var children = _ref2.children,
|
|
152
|
+
style = _ref2.style,
|
|
153
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
154
|
+
var _useEuiThemeCSSVariab = (0, _services.useEuiThemeCSSVariables)(),
|
|
155
|
+
setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
|
|
156
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
157
|
+
var headerHeight = (0, _header.euiHeaderVariables)(euiTheme).height;
|
|
158
|
+
var getHeaderOffset = (0, _react.useCallback)(function () {
|
|
159
|
+
return (0, _global_styling.mathWithUnits)(headerHeight, function (x) {
|
|
160
|
+
return x * euiFixedHeadersCount;
|
|
161
|
+
});
|
|
162
|
+
}, [headerHeight]);
|
|
163
|
+
var _useState = (0, _react.useState)(),
|
|
164
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
165
|
+
topPosition = _useState2[0],
|
|
166
|
+
setTopPosition = _useState2[1];
|
|
167
|
+
(0, _react.useEffect)(function () {
|
|
168
|
+
// Get the top position from the offset of previous header(s)
|
|
169
|
+
setTopPosition(getHeaderOffset());
|
|
170
|
+
|
|
171
|
+
// Increment fixed header counter for each fixed header
|
|
172
|
+
_euiFixedHeadersCount = euiFixedHeadersCount++, exports.euiFixedHeadersCount = euiFixedHeadersCount, _euiFixedHeadersCount;
|
|
173
|
+
setGlobalCSSVariables({
|
|
174
|
+
'--euiFixedHeadersOffset': getHeaderOffset()
|
|
175
|
+
});
|
|
176
|
+
document.body.classList.add('euiBody--headerIsFixed'); // TODO: Consider deleting this legacy className
|
|
177
|
+
|
|
178
|
+
return function () {
|
|
179
|
+
_euiFixedHeadersCount2 = euiFixedHeadersCount--, exports.euiFixedHeadersCount = euiFixedHeadersCount, _euiFixedHeadersCount2;
|
|
180
|
+
setGlobalCSSVariables({
|
|
181
|
+
'--euiFixedHeadersOffset': getHeaderOffset()
|
|
182
|
+
});
|
|
183
|
+
if (euiFixedHeadersCount === 0) {
|
|
184
|
+
document.body.classList.remove('euiBody--headerIsFixed'); // TODO: Consider deleting this legacy className
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}, [getHeaderOffset, setGlobalCSSVariables]);
|
|
188
|
+
var inlineStyles = (0, _react.useMemo)(function () {
|
|
189
|
+
return (0, _global_styling.logicalStyles)(_objectSpread({
|
|
190
|
+
top: topPosition
|
|
191
|
+
}, style));
|
|
192
|
+
}, [topPosition, style]);
|
|
193
|
+
return (0, _react2.jsx)("div", _extends({
|
|
194
|
+
"data-fixed-header": true // Used by EuiFlyouts as a query selector
|
|
195
|
+
,
|
|
196
|
+
style: inlineStyles
|
|
197
|
+
}, rest), children);
|
|
198
|
+
};
|
|
199
|
+
exports.EuiFixedHeader = EuiFixedHeader;
|
|
200
|
+
EuiFixedHeader.propTypes = {
|
|
201
|
+
className: _propTypes.default.string,
|
|
202
|
+
"aria-label": _propTypes.default.string,
|
|
203
|
+
"data-test-subj": _propTypes.default.string,
|
|
204
|
+
css: _propTypes.default.any,
|
|
205
|
+
/**
|
|
206
|
+
* An array of objects to wrap in a #EuiHeaderSection.
|
|
207
|
+
* Each section is spaced using `space-between`.
|
|
208
|
+
* See #EuiHeaderSectionsProp for object details.
|
|
209
|
+
* This prop disregards the prop `children` if both are passed.
|
|
210
|
+
*/
|
|
211
|
+
sections: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
212
|
+
/**
|
|
213
|
+
* An arry of items that will be wrapped in a #EuiHeaderSectionItem
|
|
214
|
+
*/
|
|
215
|
+
items: _propTypes.default.arrayOf(_propTypes.default.node.isRequired),
|
|
216
|
+
/**
|
|
217
|
+
* Breadcrumbs in the header cannot be wrapped in a #EuiHeaderSection in order for truncation to work.
|
|
218
|
+
* Simply pass the array of EuiBreadcrumb objects
|
|
219
|
+
*/
|
|
220
|
+
breadcrumbs: _propTypes.default.arrayOf(_propTypes.default.any.isRequired),
|
|
221
|
+
/**
|
|
222
|
+
* Other props to pass to #EuiHeaderBreadcrumbs
|
|
223
|
+
*/
|
|
224
|
+
breadcrumbProps: _propTypes.default.any
|
|
225
|
+
}).isRequired),
|
|
226
|
+
/**
|
|
227
|
+
* Helper that positions the header against the window body and
|
|
228
|
+
* adds the correct amount of top padding to the window when in `fixed` mode
|
|
229
|
+
*/
|
|
230
|
+
position: _propTypes.default.oneOf(["static", "fixed"]),
|
|
231
|
+
/**
|
|
232
|
+
* The `default` will inherit its coloring from the light or dark theme.
|
|
233
|
+
* Or, force the header into pseudo `dark` theme for all themes.
|
|
234
|
+
*/
|
|
235
|
+
theme: _propTypes.default.oneOf(["default", "dark"])
|
|
139
236
|
};
|
|
@@ -40,7 +40,7 @@ var euiHeaderStyles = function euiHeaderStyles(euiThemeContext) {
|
|
|
40
40
|
euiHeader: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:space-between;", (0, _global_styling.logicalCSS)('height', height), " ", (0, _global_styling.logicalCSS)('padding-horizontal', padding), " ", (0, _mixins.euiShadowSmall)(euiThemeContext), ";;label:euiHeader;"),
|
|
41
41
|
// Position
|
|
42
42
|
static: /*#__PURE__*/(0, _react.css)("z-index:", Number(euiTheme.levels.header) - 1, ";position:relative;;label:static;"),
|
|
43
|
-
fixed: /*#__PURE__*/(0, _react.css)("z-index:", euiTheme.levels.header, ";position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('horizontal', 0), "
|
|
43
|
+
fixed: /*#__PURE__*/(0, _react.css)("z-index:", euiTheme.levels.header, ";position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('horizontal', 0), ";;label:fixed;"),
|
|
44
44
|
// Theme
|
|
45
45
|
default: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(borderColor)), ";;label:default;"),
|
|
46
46
|
dark: /*#__PURE__*/(0, _react.css)(euiHeaderDarkStyles(euiThemeContext, borderColor), ";label:dark;")
|
package/lib/components/index.js
CHANGED
|
@@ -905,6 +905,17 @@ Object.keys(_text_diff).forEach(function (key) {
|
|
|
905
905
|
}
|
|
906
906
|
});
|
|
907
907
|
});
|
|
908
|
+
var _text_truncate = require("./text_truncate");
|
|
909
|
+
Object.keys(_text_truncate).forEach(function (key) {
|
|
910
|
+
if (key === "default" || key === "__esModule") return;
|
|
911
|
+
if (key in exports && exports[key] === _text_truncate[key]) return;
|
|
912
|
+
Object.defineProperty(exports, key, {
|
|
913
|
+
enumerable: true,
|
|
914
|
+
get: function get() {
|
|
915
|
+
return _text_truncate[key];
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
});
|
|
908
919
|
var _timeline = require("./timeline");
|
|
909
920
|
Object.keys(_timeline).forEach(function (key) {
|
|
910
921
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -21,8 +21,8 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
21
21
|
var _euiFontSize = (0, _global_styling.euiFontSize)(euiTheme, 'm', options),
|
|
22
22
|
fontSize = _euiFontSize.fontSize,
|
|
23
23
|
lineHeight = _euiFontSize.lineHeight;
|
|
24
|
-
var
|
|
25
|
-
var lineHeightSize =
|
|
24
|
+
var unit = options.unit;
|
|
25
|
+
var lineHeightSize = unit === 'em' ? "".concat(lineHeight, "em") : lineHeight;
|
|
26
26
|
|
|
27
27
|
// Custom scales
|
|
28
28
|
var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
@@ -43,19 +43,16 @@ var euiMarkdownFormatStyles = function euiMarkdownFormatStyles(euiTheme) {
|
|
|
43
43
|
euiMarkdownFormat: /*#__PURE__*/(0, _react.css)(";label:euiMarkdownFormat;"),
|
|
44
44
|
// Text sizes
|
|
45
45
|
m: /*#__PURE__*/(0, _react.css)(euiScaleMarkdownFormatText(euiTheme, {
|
|
46
|
-
measurement: 'rem',
|
|
47
46
|
customScale: 'm'
|
|
48
47
|
}), ";;label:m;"),
|
|
49
48
|
s: /*#__PURE__*/(0, _react.css)(euiScaleMarkdownFormatText(euiTheme, {
|
|
50
|
-
measurement: 'rem',
|
|
51
49
|
customScale: 's'
|
|
52
50
|
}), ";;label:s;"),
|
|
53
51
|
xs: /*#__PURE__*/(0, _react.css)(euiScaleMarkdownFormatText(euiTheme, {
|
|
54
|
-
measurement: 'rem',
|
|
55
52
|
customScale: 'xs'
|
|
56
53
|
}), ";;label:xs;"),
|
|
57
54
|
relative: /*#__PURE__*/(0, _react.css)(euiScaleMarkdownFormatText(euiTheme, {
|
|
58
|
-
|
|
55
|
+
unit: 'em'
|
|
59
56
|
}), ";;label:relative;")
|
|
60
57
|
};
|
|
61
58
|
};
|
|
@@ -20,7 +20,7 @@ var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
|
|
|
20
20
|
return {
|
|
21
21
|
euiOverlayMask: /*#__PURE__*/(0, _css.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " display:flex;align-items:center;justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', '10vh'), " animation:", _global_styling.euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", (0, _services.transparentize)(euiTheme.colors.ink, 0.5), ";;label:euiOverlayMask;"),
|
|
22
22
|
aboveHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
|
|
23
|
-
belowHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.maskBelowHeader, ";", (0, _global_styling.logicalCSS)('top',
|
|
23
|
+
belowHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.maskBelowHeader, ";", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), ";;label:belowHeader;")
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
exports.euiOverlayMaskStyles = euiOverlayMaskStyles;
|