@elastic/eui 93.2.0 → 93.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +9 -6
- package/es/components/breadcrumbs/breadcrumbs.js +4 -2
- package/es/components/button/button_display/_button_display.js +2 -3
- package/es/components/button/button_empty/button_empty.js +2 -3
- package/es/components/button/button_group/button_group.js +3 -5
- package/es/components/button/button_group/button_group.styles.js +10 -13
- package/es/components/button/button_icon/button_icon.js +4 -5
- package/es/components/button/button_icon/button_icon.styles.js +11 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/es/components/datagrid/body/data_grid_body.js +1 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/es/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/es/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/es/components/datagrid/data_grid.js +3 -1
- package/es/components/facet/facet_button.styles.js +1 -2
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/es/components/icon/icon.js +13 -16
- package/es/components/icon/icon.styles.js +6 -9
- package/es/components/link/external_link_icon.js +11 -8
- package/es/components/link/link.js +2 -3
- package/es/components/link/link.styles.js +4 -10
- package/es/components/page/page_header/page_header_content.js +4 -2
- package/es/components/progress/progress.styles.js +2 -2
- package/es/components/skeleton/skeleton_circle.js +2 -3
- package/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/es/components/skeleton/skeleton_text.js +16 -12
- package/es/components/skeleton/skeleton_title.js +2 -3
- package/es/components/text/text.js +2 -3
- package/es/components/text/text_align.js +1 -2
- package/es/components/text/text_align.styles.js +5 -7
- package/es/components/text/text_color.js +2 -3
- package/es/components/title/title.js +2 -3
- package/es/components/title/title.styles.js +0 -7
- package/es/global_styling/mixins/_typography.js +17 -6
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/style_memoization.js +47 -14
- package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/eui.d.ts +46 -37
- package/i18ntokens.json +36 -36
- package/lib/components/breadcrumbs/breadcrumb.js +9 -6
- package/lib/components/breadcrumbs/breadcrumbs.js +4 -2
- package/lib/components/button/button_display/_button_display.js +1 -2
- package/lib/components/button/button_empty/button_empty.js +1 -2
- package/lib/components/button/button_group/button_group.js +2 -4
- package/lib/components/button/button_group/button_group.styles.js +10 -13
- package/lib/components/button/button_icon/button_icon.js +3 -4
- package/lib/components/button/button_icon/button_icon.styles.js +10 -2
- package/lib/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/lib/components/datagrid/body/data_grid_body.js +1 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/lib/components/datagrid/data_grid.js +3 -1
- package/lib/components/facet/facet_button.styles.js +1 -2
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/lib/components/icon/icon.js +12 -15
- package/lib/components/icon/icon.styles.js +5 -8
- package/lib/components/link/external_link_icon.js +10 -7
- package/lib/components/link/link.js +1 -2
- package/lib/components/link/link.styles.js +6 -14
- package/lib/components/page/page_header/page_header_content.js +4 -2
- package/lib/components/progress/progress.styles.js +1 -1
- package/lib/components/skeleton/skeleton_circle.js +1 -2
- package/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/lib/components/skeleton/skeleton_text.js +18 -11
- package/lib/components/skeleton/skeleton_title.js +1 -2
- package/lib/components/text/text.js +1 -2
- package/lib/components/text/text_align.js +1 -2
- package/lib/components/text/text_align.styles.js +5 -7
- package/lib/components/text/text_color.js +1 -2
- package/lib/components/title/title.js +1 -2
- package/lib/components/title/title.styles.js +2 -10
- package/lib/global_styling/mixins/_typography.js +27 -19
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/style_memoization.js +49 -16
- package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
- package/optimize/es/components/breadcrumbs/breadcrumb.js +5 -4
- package/optimize/es/components/button/button_display/_button_display.js +2 -3
- package/optimize/es/components/button/button_empty/button_empty.js +2 -3
- package/optimize/es/components/button/button_group/button_group.js +3 -5
- package/optimize/es/components/button/button_group/button_group.styles.js +10 -13
- package/optimize/es/components/button/button_icon/button_icon.js +4 -5
- package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +5 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/optimize/es/components/datagrid/data_grid.js +3 -1
- package/optimize/es/components/facet/facet_button.styles.js +1 -2
- package/optimize/es/components/icon/icon.js +13 -16
- package/optimize/es/components/icon/icon.styles.js +6 -9
- package/optimize/es/components/link/external_link_icon.js +11 -8
- package/optimize/es/components/link/link.js +2 -3
- package/optimize/es/components/link/link.styles.js +4 -10
- package/optimize/es/components/progress/progress.styles.js +2 -2
- package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_text.js +16 -12
- package/optimize/es/components/skeleton/skeleton_title.js +2 -3
- package/optimize/es/components/text/text.js +2 -3
- package/optimize/es/components/text/text_align.js +1 -2
- package/optimize/es/components/text/text_align.styles.js +5 -7
- package/optimize/es/components/text/text_color.js +2 -3
- package/optimize/es/components/title/title.js +2 -3
- package/optimize/es/components/title/title.styles.js +0 -7
- package/optimize/es/global_styling/mixins/_typography.js +14 -6
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +47 -14
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +5 -4
- package/optimize/lib/components/button/button_display/_button_display.js +1 -2
- package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
- package/optimize/lib/components/button/button_group/button_group.js +2 -4
- package/optimize/lib/components/button/button_group/button_group.styles.js +10 -13
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
- package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +5 -3
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/optimize/lib/components/datagrid/data_grid.js +3 -1
- package/optimize/lib/components/facet/facet_button.styles.js +1 -2
- package/optimize/lib/components/icon/icon.js +12 -15
- package/optimize/lib/components/icon/icon.styles.js +5 -8
- package/optimize/lib/components/link/external_link_icon.js +10 -7
- package/optimize/lib/components/link/link.js +1 -2
- package/optimize/lib/components/link/link.styles.js +6 -14
- package/optimize/lib/components/progress/progress.styles.js +1 -1
- package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
- package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
- package/optimize/lib/components/text/text.js +1 -2
- package/optimize/lib/components/text/text_align.js +1 -2
- package/optimize/lib/components/text/text_align.styles.js +5 -7
- package/optimize/lib/components/text/text_color.js +1 -2
- package/optimize/lib/components/title/title.js +1 -2
- package/optimize/lib/components/title/title.styles.js +2 -10
- package/optimize/lib/global_styling/mixins/_typography.js +25 -19
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/style_memoization.js +49 -16
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/package.json +3 -3
- package/src/components/datagrid/_data_grid_data_row.scss +4 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +9 -6
- package/test-env/components/breadcrumbs/breadcrumbs.js +4 -2
- package/test-env/components/button/button_display/_button_display.js +1 -2
- package/test-env/components/button/button_empty/button_empty.js +1 -2
- package/test-env/components/button/button_group/button_group.js +2 -4
- package/test-env/components/button/button_group/button_group.styles.js +10 -13
- package/test-env/components/button/button_icon/button_icon.js +3 -4
- package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/test-env/components/datagrid/body/data_grid_body.js +1 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/test-env/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/test-env/components/datagrid/data_grid.js +3 -1
- package/test-env/components/facet/facet_button.styles.js +1 -2
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/test-env/components/icon/icon.styles.js +5 -8
- package/test-env/components/link/external_link_icon.js +10 -7
- package/test-env/components/link/link.js +1 -2
- package/test-env/components/link/link.styles.js +6 -14
- package/test-env/components/page/page_header/page_header_content.js +4 -2
- package/test-env/components/progress/progress.styles.js +1 -1
- package/test-env/components/skeleton/skeleton_circle.js +1 -2
- package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
- package/test-env/components/skeleton/skeleton_text.js +18 -11
- package/test-env/components/skeleton/skeleton_title.js +1 -2
- package/test-env/components/text/text.js +1 -2
- package/test-env/components/text/text_align.js +1 -2
- package/test-env/components/text/text_align.styles.js +5 -7
- package/test-env/components/text/text_color.js +1 -2
- package/test-env/components/title/title.js +1 -2
- package/test-env/components/title/title.styles.js +2 -10
- package/test-env/global_styling/mixins/_typography.js +25 -19
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/style_memoization.js +49 -16
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
|
@@ -4,9 +4,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.euiTitleStyles = exports.euiTitle = void 0;
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
|
-
var _services = require("../../services");
|
|
10
9
|
var _global_styling = require("../../global_styling");
|
|
11
10
|
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; }
|
|
12
11
|
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; }
|
|
@@ -42,17 +41,10 @@ var euiTitle = function euiTitle(euiThemeContext) {
|
|
|
42
41
|
});
|
|
43
42
|
};
|
|
44
43
|
|
|
45
|
-
// Hook version
|
|
46
|
-
exports.euiTitle = euiTitle;
|
|
47
|
-
var useEuiTitle = function useEuiTitle(scale, options) {
|
|
48
|
-
var euiTheme = (0, _services.useEuiTheme)();
|
|
49
|
-
return euiTitle(euiTheme, scale, options);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
44
|
/**
|
|
53
45
|
* Styles
|
|
54
46
|
*/
|
|
55
|
-
exports.
|
|
47
|
+
exports.euiTitle = euiTitle;
|
|
56
48
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
57
49
|
name: "1x2qsb1-uppercase",
|
|
58
50
|
styles: "text-transform:uppercase;label:uppercase;"
|
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.useEuiFontSize = exports.euiTextTruncate = exports.euiTextBreakWord = exports.euiNumberFormat = exports.euiFontSize = void 0;
|
|
7
7
|
var _typography = require("../functions/typography");
|
|
8
|
-
var
|
|
8
|
+
var _theme = require("../../services/theme");
|
|
9
|
+
var _typography2 = require("../variables/typography");
|
|
9
10
|
var _functions = require("../functions");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
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); } /*
|
|
17
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
+
* Side Public License, v 1.
|
|
22
|
+
*/
|
|
18
23
|
/**
|
|
19
24
|
* Returns font-size and line-height
|
|
20
25
|
*/
|
|
@@ -27,15 +32,23 @@ var euiFontSize = function euiFontSize(_ref, scale, options) {
|
|
|
27
32
|
};
|
|
28
33
|
exports.euiFontSize = euiFontSize;
|
|
29
34
|
var useEuiFontSize = function useEuiFontSize(scale, options) {
|
|
30
|
-
var euiTheme = (0,
|
|
31
|
-
|
|
35
|
+
var euiTheme = (0, _theme.useEuiTheme)();
|
|
36
|
+
var memoizedFontSizes = (0, _theme.useEuiMemoizedStyles)(euiFontSizes);
|
|
37
|
+
return !options ? memoizedFontSizes[scale] : euiFontSize(euiTheme, scale, options);
|
|
38
|
+
};
|
|
39
|
+
// Memomize a basic set of font sizes. We unfortunately can't
|
|
40
|
+
// memoize all possible options, there's too many permutations
|
|
41
|
+
exports.useEuiFontSize = useEuiFontSize;
|
|
42
|
+
var euiFontSizes = function euiFontSizes(euiThemeContext) {
|
|
43
|
+
return _typography2.EuiThemeFontScales.reduce(function (map, scale) {
|
|
44
|
+
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, scale, euiFontSize(euiThemeContext, scale)));
|
|
45
|
+
}, {});
|
|
32
46
|
};
|
|
33
47
|
|
|
34
48
|
/**
|
|
35
49
|
* Force text to wrap on natural word breaks (e.g. spaces & hyphens)
|
|
36
50
|
* https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/
|
|
37
51
|
*/
|
|
38
|
-
exports.useEuiFontSize = useEuiFontSize;
|
|
39
52
|
var euiTextBreakWord = function euiTextBreakWord() {
|
|
40
53
|
return "\n overflow-wrap: break-word !important; // makes sure the long string will wrap and not bust out of the container\n word-break: break-word;\n";
|
|
41
54
|
};
|
|
@@ -58,9 +71,4 @@ var euiNumberFormat = function euiNumberFormat(_ref2) {
|
|
|
58
71
|
var euiTheme = _ref2.euiTheme;
|
|
59
72
|
return "\n font-feature-settings: ".concat(euiTheme.font.featureSettings, ", 'tnum' 1;\n");
|
|
60
73
|
};
|
|
61
|
-
exports.euiNumberFormat = euiNumberFormat;
|
|
62
|
-
var useEuiNumberFormat = function useEuiNumberFormat() {
|
|
63
|
-
var euiTheme = (0, _hooks.useEuiTheme)();
|
|
64
|
-
return euiNumberFormat(euiTheme);
|
|
65
|
-
};
|
|
66
|
-
exports.useEuiNumberFormat = useEuiNumberFormat;
|
|
74
|
+
exports.euiNumberFormat = euiNumberFormat;
|
|
@@ -135,6 +135,12 @@ Object.defineProperty(exports, "useEuiThemeCSSVariables", {
|
|
|
135
135
|
return _hooks.useEuiThemeCSSVariables;
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
+
Object.defineProperty(exports, "withEuiStylesMemoizer", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function get() {
|
|
141
|
+
return _style_memoization.withEuiStylesMemoizer;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
138
144
|
Object.defineProperty(exports, "withEuiTheme", {
|
|
139
145
|
enumerable: true,
|
|
140
146
|
get: function get() {
|
|
@@ -4,13 +4,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useEuiMemoizedStyles = exports.EuiThemeMemoizedStylesProvider = exports.EuiThemeMemoizedStylesContext = void 0;
|
|
7
|
+
exports.withEuiStylesMemoizer = exports.useEuiMemoizedStyles = exports.EuiThemeMemoizedStylesProvider = exports.EuiThemeMemoizedStylesContext = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _hooks = require("../hooks");
|
|
10
10
|
var _hooks2 = require("./hooks");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
|
+
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); }
|
|
14
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
16
|
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."); }
|
|
16
17
|
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); }
|
|
@@ -47,27 +48,59 @@ var EuiThemeMemoizedStylesProvider = function EuiThemeMemoizedStylesProvider(_re
|
|
|
47
48
|
}, children);
|
|
48
49
|
};
|
|
49
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Internal util primarily responsible for getting the memoized styles (if they exist)
|
|
53
|
+
* and if not, generating and setting the styles. DRYed out to facilitate usage
|
|
54
|
+
* between both hook/function components and HOC/class components
|
|
55
|
+
*/
|
|
56
|
+
exports.EuiThemeMemoizedStylesProvider = EuiThemeMemoizedStylesProvider;
|
|
57
|
+
var getMemoizedStyles = function getMemoizedStyles(stylesGenerator, stylesMap, euiThemeContext) {
|
|
58
|
+
if (!stylesGenerator.name) {
|
|
59
|
+
throw new Error('Styles are memoized per function. Your style functions must be statically defined in order to not create a new map entry every rerender.');
|
|
60
|
+
}
|
|
61
|
+
var existingStyles = stylesMap.get(stylesGenerator);
|
|
62
|
+
if (existingStyles) {
|
|
63
|
+
return existingStyles;
|
|
64
|
+
} else {
|
|
65
|
+
var generatedStyles = stylesGenerator(euiThemeContext);
|
|
66
|
+
stylesMap.set(stylesGenerator, generatedStyles);
|
|
67
|
+
return generatedStyles;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
50
71
|
/**
|
|
51
72
|
* Hook that memoizes the returned values of components style fns/generators
|
|
52
73
|
* per-theme
|
|
53
74
|
*/
|
|
54
|
-
|
|
55
|
-
var useEuiMemoizedStyles = function useEuiMemoizedStyles(styleGenerator) {
|
|
75
|
+
var useEuiMemoizedStyles = function useEuiMemoizedStyles(stylesGenerator) {
|
|
56
76
|
var memoizedStyles = (0, _react.useContext)(EuiThemeMemoizedStylesContext);
|
|
57
77
|
var euiThemeContext = (0, _hooks2.useEuiTheme)();
|
|
58
78
|
var memoizedComponentStyles = (0, _react.useMemo)(function () {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
var existingStyles = memoizedStyles.get(styleGenerator);
|
|
63
|
-
if (existingStyles) {
|
|
64
|
-
return existingStyles;
|
|
65
|
-
} else {
|
|
66
|
-
var generatedStyles = styleGenerator(euiThemeContext);
|
|
67
|
-
memoizedStyles.set(styleGenerator, generatedStyles);
|
|
68
|
-
return generatedStyles;
|
|
69
|
-
}
|
|
70
|
-
}, [styleGenerator, memoizedStyles, euiThemeContext]);
|
|
79
|
+
return getMemoizedStyles(stylesGenerator, memoizedStyles, euiThemeContext);
|
|
80
|
+
}, [stylesGenerator, memoizedStyles, euiThemeContext]);
|
|
71
81
|
return memoizedComponentStyles;
|
|
72
82
|
};
|
|
73
|
-
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* HOC for class components
|
|
86
|
+
* Syntax is mostly copied from withEuiTheme HOC
|
|
87
|
+
*/
|
|
88
|
+
exports.useEuiMemoizedStyles = useEuiMemoizedStyles;
|
|
89
|
+
var withEuiStylesMemoizer = function withEuiStylesMemoizer(Component) {
|
|
90
|
+
var componentName = Component.displayName || Component.name || 'ComponentWithStylesMemoizer';
|
|
91
|
+
var Render = function Render(props, ref) {
|
|
92
|
+
var memoizedStyles = (0, _react.useContext)(EuiThemeMemoizedStylesContext);
|
|
93
|
+
var euiThemeContext = (0, _hooks2.useEuiTheme)();
|
|
94
|
+
var stylesMemoizer = (0, _react.useCallback)(function (stylesGenerator) {
|
|
95
|
+
return getMemoizedStyles(stylesGenerator, memoizedStyles, euiThemeContext);
|
|
96
|
+
}, [memoizedStyles, euiThemeContext]);
|
|
97
|
+
return (0, _react2.jsx)(Component, _extends({
|
|
98
|
+
stylesMemoizer: stylesMemoizer,
|
|
99
|
+
ref: ref
|
|
100
|
+
}, props));
|
|
101
|
+
};
|
|
102
|
+
var WithEuiStylesMemoizer = /*#__PURE__*/(0, _react.forwardRef)(Render);
|
|
103
|
+
WithEuiStylesMemoizer.displayName = componentName;
|
|
104
|
+
return WithEuiStylesMemoizer;
|
|
105
|
+
};
|
|
106
|
+
exports.withEuiStylesMemoizer = withEuiStylesMemoizer;
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useEuiButtonFocusCSS = exports.useEuiButtonColorCSS = exports.euiButtonSizeMap = exports.euiButtonFillColor = exports.euiButtonEmptyColor = exports.euiButtonColor = exports.BUTTON_COLORS = void 0;
|
|
6
|
+
exports.useEuiButtonFocusCSS = exports.useEuiButtonColorCSS = exports.euiButtonSizeMap = exports.euiButtonFillColor = exports.euiButtonEmptyColor = exports.euiButtonColor = exports.BUTTON_DISPLAYS = exports.BUTTON_COLORS = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../../../global_styling");
|
|
9
9
|
var _services = require("../../../../services");
|
|
10
|
+
var _templateObject;
|
|
11
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
12
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
13
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
14
|
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); }
|
|
@@ -21,6 +23,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
21
23
|
*/
|
|
22
24
|
var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger'];
|
|
23
25
|
exports.BUTTON_COLORS = BUTTON_COLORS;
|
|
26
|
+
var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
|
|
27
|
+
exports.BUTTON_DISPLAYS = BUTTON_DISPLAYS;
|
|
24
28
|
/**
|
|
25
29
|
* Creates the `base` version of button styles with proper text contrast.
|
|
26
30
|
* @param euiThemeContext
|
|
@@ -141,43 +145,63 @@ var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, color) {
|
|
|
141
145
|
exports.euiButtonEmptyColor = euiButtonEmptyColor;
|
|
142
146
|
var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
|
|
143
147
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
144
|
-
var
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
148
|
+
var _options$display = options.display,
|
|
149
|
+
display = _options$display === void 0 ? 'base' : _options$display;
|
|
150
|
+
var colorsDisplaysMap = (0, _services.useEuiMemoizedStyles)(euiButtonDisplaysColors);
|
|
151
|
+
return colorsDisplaysMap[display];
|
|
152
|
+
};
|
|
153
|
+
exports.useEuiButtonColorCSS = useEuiButtonColorCSS;
|
|
154
|
+
var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext) {
|
|
155
|
+
var COLORS = [].concat(BUTTON_COLORS, ['disabled']);
|
|
156
|
+
var displaysColorsMap = {};
|
|
157
|
+
BUTTON_DISPLAYS.forEach(function (display) {
|
|
158
|
+
displaysColorsMap[display] = {};
|
|
159
|
+
COLORS.forEach(function (color) {
|
|
160
|
+
switch (display) {
|
|
161
|
+
case 'base':
|
|
162
|
+
displaysColorsMap[display][color] = /*#__PURE__*/(0, _react.css)(euiButtonColor(euiThemeContext, color), ";;label:displaysColorsMap-display-color;");
|
|
163
|
+
break;
|
|
164
|
+
case 'fill':
|
|
165
|
+
displaysColorsMap[display][color] = /*#__PURE__*/(0, _react.css)(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:displaysColorsMap-display-color;");
|
|
166
|
+
break;
|
|
167
|
+
case 'empty':
|
|
168
|
+
displaysColorsMap[display][color] = /*#__PURE__*/(0, _react.css)("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:displaysColorsMap-display-color;");
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Tweak auto-generated Emotion label/className output
|
|
173
|
+
var emotionOutput = displaysColorsMap[display][color];
|
|
174
|
+
emotionOutput.styles = emotionOutput.styles.replace('label:displaysColorsMap-display-color;', "label:".concat(display, "-").concat(color, ";"));
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
return displaysColorsMap;
|
|
161
178
|
};
|
|
162
179
|
|
|
163
180
|
/**
|
|
164
181
|
* Creates the translate animation when button is in focus.
|
|
165
182
|
* @returns string
|
|
166
183
|
*/
|
|
167
|
-
exports.useEuiButtonColorCSS = useEuiButtonColorCSS;
|
|
168
184
|
var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
185
|
+
return (0, _services.useEuiMemoizedStyles)(euiButtonFocusCSS);
|
|
186
|
+
};
|
|
187
|
+
exports.useEuiButtonFocusCSS = useEuiButtonFocusCSS;
|
|
188
|
+
var euiButtonFocusAnimation = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n transform: translateY(1px);\n }\n"])));
|
|
189
|
+
var euiButtonFocusCSS = function euiButtonFocusCSS(_ref) {
|
|
190
|
+
var euiTheme = _ref.euiTheme;
|
|
191
|
+
var focusCSS = /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ease-in-out,background-color ", euiTheme.animation.normal, " ease-in-out;&:hover:not(:disabled){transform:translateY(-1px);}&:focus{animation:", euiButtonFocusAnimation, " ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";}&:active:not(:disabled){transform:translateY(1px);}};label:focusCSS;");
|
|
192
|
+
// Remove the auto-generated label.
|
|
193
|
+
// We could typically avoid a label by using a plain string `` instead of css``,
|
|
194
|
+
// but we need css`` for keyframes`` to work for the focus animation
|
|
195
|
+
focusCSS.styles = focusCSS.styles.replace('label:focusCSS;', '');
|
|
196
|
+
return focusCSS;
|
|
172
197
|
};
|
|
173
198
|
|
|
174
199
|
/**
|
|
175
200
|
* Map of `size` props to various sizings/scales
|
|
176
201
|
* that should remain consistent across all buttons
|
|
177
202
|
*/
|
|
178
|
-
|
|
179
|
-
var
|
|
180
|
-
var euiTheme = _ref.euiTheme;
|
|
203
|
+
var euiButtonSizeMap = function euiButtonSizeMap(_ref2) {
|
|
204
|
+
var euiTheme = _ref2.euiTheme;
|
|
181
205
|
return {
|
|
182
206
|
xs: {
|
|
183
207
|
height: euiTheme.size.l,
|
|
@@ -92,11 +92,12 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
92
92
|
css: cssStyles
|
|
93
93
|
};
|
|
94
94
|
if (isPopoverBreadcrumb) {
|
|
95
|
+
var _closePopover = function _closePopover() {
|
|
96
|
+
return setIsPopoverOpen(false);
|
|
97
|
+
};
|
|
95
98
|
return ___EmotionJSX(EuiPopover, _extends({}, popoverProps, {
|
|
96
99
|
isOpen: isPopoverOpen,
|
|
97
|
-
closePopover:
|
|
98
|
-
return setIsPopoverOpen(false);
|
|
99
|
-
},
|
|
100
|
+
closePopover: _closePopover,
|
|
100
101
|
css: !isLastBreadcrumb && styles.euiBreadcrumb__popoverWrapper,
|
|
101
102
|
button: ___EmotionJSX(EuiLink, _extends({}, baseProps, {
|
|
102
103
|
color: linkColor,
|
|
@@ -113,7 +114,7 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
113
114
|
size: "s",
|
|
114
115
|
"aria-label": " - ".concat(popoverAriaLabel)
|
|
115
116
|
}))
|
|
116
|
-
}), popoverContent);
|
|
117
|
+
}), typeof popoverContent === 'function' ? popoverContent(_closePopover) : popoverContent);
|
|
117
118
|
} else if (isInteractiveBreadcrumb) {
|
|
118
119
|
return ___EmotionJSX(EuiLink, _extends({}, baseProps, styleProps, {
|
|
119
120
|
color: linkColor,
|
|
@@ -16,7 +16,7 @@ import React, { forwardRef } from 'react';
|
|
|
16
16
|
|
|
17
17
|
// @ts-ignore module doesn't export `createElement`
|
|
18
18
|
import { createElement } from '@emotion/react';
|
|
19
|
-
import { getSecureRelForTarget,
|
|
19
|
+
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
|
|
20
20
|
import { euiButtonDisplayStyles } from './_button_display.styles';
|
|
21
21
|
import { EuiButtonDisplayContent } from './_button_display_content';
|
|
22
22
|
import { validateHref } from '../../../services/security/href_validator';
|
|
@@ -70,8 +70,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
70
70
|
isDisabled: isDisabled || disabled,
|
|
71
71
|
isLoading: isLoading
|
|
72
72
|
});
|
|
73
|
-
var
|
|
74
|
-
var styles = euiButtonDisplayStyles(theme);
|
|
73
|
+
var styles = useEuiMemoizedStyles(euiButtonDisplayStyles);
|
|
75
74
|
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
|
|
76
75
|
var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
|
|
77
76
|
isLoading: isLoading,
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
|
-
import {
|
|
17
|
+
import { useEuiMemoizedStyles, getSecureRelForTarget } from '../../../services';
|
|
18
18
|
import { EuiButtonDisplayContent } from '../button_display/_button_display_content';
|
|
19
19
|
import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
20
20
|
import { isButtonDisabled } from '../button_display/_button_display';
|
|
@@ -62,8 +62,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
62
62
|
var buttonColorStyles = useEuiButtonColorCSS({
|
|
63
63
|
display: 'empty'
|
|
64
64
|
});
|
|
65
|
-
var
|
|
66
|
-
var styles = euiButtonEmptyStyles(euiTheme);
|
|
65
|
+
var styles = useEuiMemoizedStyles(euiButtonEmptyStyles);
|
|
67
66
|
var cssStyles = [styles.euiButtonEmpty, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], flush && styles.flush, flush && styles[flush], isDisabled && styles.isDisabled];
|
|
68
67
|
var classes = classNames('euiButtonEmpty', className);
|
|
69
68
|
var contentClassNames = classNames('euiButtonEmpty__content', contentProps === null || contentProps === void 0 ? void 0 : contentProps.className);
|
|
@@ -11,7 +11,7 @@ var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelected
|
|
|
11
11
|
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
15
15
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
16
16
|
import { EuiButtonGroupButton } from './button_group_button';
|
|
17
17
|
import { euiButtonGroupStyles, euiButtonGroupButtonsStyles } from './button_group.styles';
|
|
@@ -40,10 +40,8 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
40
40
|
_ref$type = _ref.type,
|
|
41
41
|
type = _ref$type === void 0 ? 'single' : _ref$type,
|
|
42
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var wrapperCssStyles = [wrapperStyles.euiButtonGroup, isFullWidth && wrapperStyles.fullWidth];
|
|
46
|
-
var styles = euiButtonGroupButtonsStyles(euiTheme);
|
|
43
|
+
var wrapperCssStyles = [euiButtonGroupStyles.euiButtonGroup, isFullWidth && euiButtonGroupStyles.fullWidth];
|
|
44
|
+
var styles = useEuiMemoizedStyles(euiButtonGroupButtonsStyles);
|
|
47
45
|
var cssStyles = [styles.euiButtonGroup__buttons, isFullWidth && styles.fullWidth, styles[buttonSize]];
|
|
48
46
|
var classes = classNames('euiButtonGroup', {
|
|
49
47
|
'euiButtonGroup-isDisabled': isDisabled
|
|
@@ -10,19 +10,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalCSS } from '../../../global_styling';
|
|
12
12
|
import { euiFormVariables } from '../../form/form.styles';
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
euiButtonGroup: /*#__PURE__*/css("display:inline-block;", logicalCSS('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
|
|
24
|
-
fullWidth: _ref
|
|
25
|
-
};
|
|
13
|
+
export var euiButtonGroupStyles = {
|
|
14
|
+
euiButtonGroup: /*#__PURE__*/css("display:inline-block;", logicalCSS('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
|
|
15
|
+
fullWidth: process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "jl0hie-fullWidth",
|
|
17
|
+
styles: "display:block;label:fullWidth;"
|
|
18
|
+
} : {
|
|
19
|
+
name: "jl0hie-fullWidth",
|
|
20
|
+
styles: "display:block;label:fullWidth;",
|
|
21
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
|
+
}
|
|
26
23
|
};
|
|
27
24
|
export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(euiThemeContext) {
|
|
28
25
|
var euiTheme = euiThemeContext.euiTheme;
|
|
@@ -11,7 +11,7 @@ var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "di
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import { getSecureRelForTarget,
|
|
14
|
+
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
|
|
15
15
|
import { EuiIcon } from '../../icon';
|
|
16
16
|
import { EuiLoadingSpinner } from '../../loading';
|
|
17
17
|
import { useEuiButtonColorCSS, useEuiButtonFocusCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
@@ -42,7 +42,6 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
42
42
|
isSelected = _ref.isSelected,
|
|
43
43
|
isLoading = _ref.isLoading,
|
|
44
44
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
-
var euiThemeContext = useEuiTheme();
|
|
46
45
|
var isDisabled = isButtonDisabled({
|
|
47
46
|
isDisabled: _isDisabled || disabled,
|
|
48
47
|
href: href,
|
|
@@ -57,9 +56,9 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
57
56
|
display: display
|
|
58
57
|
});
|
|
59
58
|
var buttonFocusStyle = useEuiButtonFocusCSS();
|
|
60
|
-
var emptyHoverStyles =
|
|
61
|
-
var styles = euiButtonIconStyles
|
|
62
|
-
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, emptyHoverStyles, isDisabled && styles.isDisabled];
|
|
59
|
+
var emptyHoverStyles = useEuiMemoizedStyles(_emptyHoverStyles);
|
|
60
|
+
var styles = useEuiMemoizedStyles(euiButtonIconStyles);
|
|
61
|
+
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
|
|
63
62
|
var classes = classNames('euiButtonIcon', className);
|
|
64
63
|
|
|
65
64
|
// Add an icon to the button if one exists.
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
1
4
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
5
|
/*
|
|
3
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -9,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
12
|
|
|
10
13
|
import { css } from '@emotion/react';
|
|
11
14
|
import { logicalSizeCSS } from '../../../global_styling';
|
|
12
|
-
import { euiButtonEmptyColor, euiButtonSizeMap } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
15
|
+
import { BUTTON_COLORS, euiButtonEmptyColor, euiButtonSizeMap } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
13
16
|
import { euiButtonBaseCSS } from '../button_display/_button_display.styles';
|
|
14
17
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
18
|
name: "8595p9-isDisabled",
|
|
@@ -30,6 +33,8 @@ export var euiButtonIconStyles = function euiButtonIconStyles(euiThemeContext) {
|
|
|
30
33
|
m: /*#__PURE__*/css(logicalSizeCSS(sizes.m.height), " border-radius:", sizes.m.radius, ";;label:m;")
|
|
31
34
|
};
|
|
32
35
|
};
|
|
33
|
-
export var _emptyHoverStyles = function _emptyHoverStyles(euiThemeContext
|
|
34
|
-
return
|
|
36
|
+
export var _emptyHoverStyles = function _emptyHoverStyles(euiThemeContext) {
|
|
37
|
+
return BUTTON_COLORS.reduce(function (styles, color) {
|
|
38
|
+
return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, color, /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";}")));
|
|
39
|
+
}, {});
|
|
35
40
|
};
|
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
|
|
10
|
+
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
|
|
11
11
|
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
12
12
|
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
|
|
13
13
|
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; }
|
|
@@ -38,6 +38,7 @@ import { HandleInteractiveChildren } from './focus_utils';
|
|
|
38
38
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
39
39
|
var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
40
40
|
var renderCellValue = _ref.renderCellValue,
|
|
41
|
+
cellContext = _ref.cellContext,
|
|
41
42
|
column = _ref.column,
|
|
42
43
|
setCellContentsRef = _ref.setCellContentsRef,
|
|
43
44
|
rowIndex = _ref.rowIndex,
|
|
@@ -66,7 +67,7 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
66
67
|
rowIndex: rowIndex,
|
|
67
68
|
colIndex: colIndex,
|
|
68
69
|
schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
|
|
69
|
-
}, rest)));
|
|
70
|
+
}, cellContext, rest)));
|
|
70
71
|
if (cellHeightType === 'lineCount' && !isControlColumn) {
|
|
71
72
|
var lines = rowHeightUtils.getLineCount(rowHeight);
|
|
72
73
|
cellContent = ___EmotionJSX(EuiTextBlockTruncate, {
|
|
@@ -249,6 +250,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
249
250
|
var _this$props5 = _this.props,
|
|
250
251
|
renderCellPopover = _this$props5.renderCellPopover,
|
|
251
252
|
renderCellValue = _this$props5.renderCellValue,
|
|
253
|
+
cellContext = _this$props5.cellContext,
|
|
252
254
|
rowIndex = _this$props5.rowIndex,
|
|
253
255
|
colIndex = _this$props5.colIndex,
|
|
254
256
|
column = _this$props5.column,
|
|
@@ -269,7 +271,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
269
271
|
})),
|
|
270
272
|
DefaultCellPopover: DefaultCellPopover,
|
|
271
273
|
setCellPopoverProps: setCellPopoverProps
|
|
272
|
-
}), ___EmotionJSX(CellElement, _extends({}, sharedProps, {
|
|
274
|
+
}), ___EmotionJSX(CellElement, _extends({}, cellContext, sharedProps, {
|
|
273
275
|
setCellProps: _this.setCellProps,
|
|
274
276
|
isExpandable: true,
|
|
275
277
|
isExpanded: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
|
|
4
|
+
var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "cellContext", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -35,6 +35,7 @@ export var Cell = function Cell(_ref) {
|
|
|
35
35
|
columnWidths = _ref.columnWidths,
|
|
36
36
|
defaultColumnWidth = _ref.defaultColumnWidth,
|
|
37
37
|
renderCellValue = _ref.renderCellValue,
|
|
38
|
+
cellContext = _ref.cellContext,
|
|
38
39
|
renderCellPopover = _ref.renderCellPopover,
|
|
39
40
|
interactiveCellId = _ref.interactiveCellId,
|
|
40
41
|
setRowHeight = _ref.setRowHeight,
|
|
@@ -76,7 +77,8 @@ export var Cell = function Cell(_ref) {
|
|
|
76
77
|
setRowHeight: isFirstColumn ? setRowHeight : undefined,
|
|
77
78
|
rowManager: rowManager,
|
|
78
79
|
popoverContext: popoverContext,
|
|
79
|
-
pagination: pagination
|
|
80
|
+
pagination: pagination,
|
|
81
|
+
cellContext: cellContext
|
|
80
82
|
};
|
|
81
83
|
if (isLeadingControlColumn) {
|
|
82
84
|
var leadingColumn = leadingControlColumns[colIndex];
|
|
@@ -32,6 +32,7 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
32
32
|
schemaDetectors = _ref.schemaDetectors,
|
|
33
33
|
visibleRows = _ref.visibleRows,
|
|
34
34
|
renderCellValue = _ref.renderCellValue,
|
|
35
|
+
cellContext = _ref.cellContext,
|
|
35
36
|
renderCellPopover = _ref.renderCellPopover,
|
|
36
37
|
renderFooterCellValue = _ref.renderFooterCellValue,
|
|
37
38
|
interactiveCellId = _ref.interactiveCellId,
|
|
@@ -121,6 +122,7 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
121
122
|
columnWidths: columnWidths,
|
|
122
123
|
defaultColumnWidth: defaultColumnWidth,
|
|
123
124
|
renderCellValue: renderCellValue,
|
|
125
|
+
cellContext: cellContext,
|
|
124
126
|
renderCellPopover: renderCellPopover,
|
|
125
127
|
interactiveCellId: interactiveCellId,
|
|
126
128
|
setRowHeight: setRowHeight,
|
|
@@ -78,6 +78,7 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
78
78
|
endRow = _ref3$visibleRows.endRow,
|
|
79
79
|
visibleRowCount = _ref3$visibleRows.visibleRowCount,
|
|
80
80
|
renderCellValue = _ref3.renderCellValue,
|
|
81
|
+
cellContext = _ref3.cellContext,
|
|
81
82
|
renderCellPopover = _ref3.renderCellPopover,
|
|
82
83
|
renderFooterCellValue = _ref3.renderFooterCellValue,
|
|
83
84
|
interactiveCellId = _ref3.interactiveCellId,
|
|
@@ -279,6 +280,7 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
279
280
|
columnWidths: columnWidths,
|
|
280
281
|
defaultColumnWidth: defaultColumnWidth,
|
|
281
282
|
renderCellValue: renderCellValue,
|
|
283
|
+
cellContext: cellContext,
|
|
282
284
|
renderCellPopover: renderCellPopover,
|
|
283
285
|
interactiveCellId: interactiveCellId,
|
|
284
286
|
rowHeightsOptions: rowHeightsOptions,
|