@elastic/eui 95.6.0 → 95.7.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 +0 -642
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -642
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/combo_box/combo_box.js +54 -50
- package/es/components/combo_box/combo_box.styles.js +14 -0
- package/es/components/combo_box/combo_box_input/combo_box_input.js +69 -62
- package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +60 -0
- package/es/components/combo_box/combo_box_input/combo_box_pill.js +50 -138
- package/es/components/combo_box/combo_box_input/combo_box_pill.styles.js +25 -0
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +22 -0
- package/es/components/combo_box/combo_box_options_list/index.js +0 -1
- package/es/components/combo_box/utils.js +26 -3
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +3 -4
- package/es/components/flyout/flyout.styles.js +3 -3
- package/es/components/form/form.styles.js +16 -8
- package/es/components/list_group/list_group.styles.js +3 -3
- package/es/components/popover/input_popover.js +3 -3
- package/es/components/search_bar/search_bar.styles.js +2 -4
- package/es/components/selectable/selectable.js +9 -8
- package/es/components/selectable/selectable.styles.js +22 -0
- package/es/components/selectable/selectable_list/selectable_list.js +38 -29
- package/es/components/selectable/selectable_list/selectable_list.styles.js +35 -0
- package/es/components/selectable/selectable_list/selectable_list_item.js +18 -17
- package/es/components/selectable/selectable_list/selectable_list_item.styles.js +56 -0
- package/es/components/selectable/selectable_message/selectable_message.js +6 -3
- package/es/components/selectable/selectable_message/selectable_message.styles.js +17 -0
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +12 -9
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +47 -0
- package/es/components/selectable/selectable_templates/selectable_template_sitewide_option.js +40 -10
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/style_memoization.js +14 -0
- package/eui.d.ts +146 -46
- package/i18ntokens.json +118 -118
- package/lib/components/combo_box/combo_box.js +53 -49
- package/lib/components/combo_box/combo_box.styles.js +20 -0
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +68 -61
- package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +64 -0
- package/lib/components/combo_box/combo_box_input/combo_box_pill.js +55 -144
- package/lib/components/combo_box/combo_box_input/combo_box_pill.styles.js +31 -0
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +28 -0
- package/lib/components/combo_box/combo_box_options_list/index.js +0 -7
- package/lib/components/combo_box/utils.js +29 -9
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +2 -3
- package/lib/components/flyout/flyout.styles.js +2 -2
- package/lib/components/form/form.styles.js +16 -9
- package/lib/components/list_group/list_group.styles.js +2 -2
- package/lib/components/popover/input_popover.js +2 -2
- package/lib/components/search_bar/search_bar.styles.js +1 -3
- package/lib/components/selectable/selectable.js +9 -8
- package/lib/components/selectable/selectable.styles.js +26 -0
- package/lib/components/selectable/selectable_list/selectable_list.js +38 -29
- package/lib/components/selectable/selectable_list/selectable_list.styles.js +38 -0
- package/lib/components/selectable/selectable_list/selectable_list_item.js +18 -16
- package/lib/components/selectable/selectable_list/selectable_list_item.styles.js +60 -0
- package/lib/components/selectable/selectable_message/selectable_message.js +6 -3
- package/lib/components/selectable/selectable_message/selectable_message.styles.js +23 -0
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +11 -8
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +51 -0
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide_option.js +40 -10
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/style_memoization.js +15 -1
- package/optimize/es/components/combo_box/combo_box.js +54 -50
- package/optimize/es/components/combo_box/combo_box.styles.js +14 -0
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +64 -62
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +60 -0
- package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.js +51 -78
- package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.styles.js +25 -0
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +22 -0
- package/optimize/es/components/combo_box/combo_box_options_list/index.js +0 -1
- package/optimize/es/components/combo_box/utils.js +23 -3
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +3 -4
- package/optimize/es/components/flyout/flyout.styles.js +3 -3
- package/optimize/es/components/form/form.styles.js +16 -8
- package/optimize/es/components/list_group/list_group.styles.js +3 -3
- package/optimize/es/components/popover/input_popover.js +3 -3
- package/optimize/es/components/search_bar/search_bar.styles.js +2 -4
- package/optimize/es/components/selectable/selectable.js +9 -8
- package/optimize/es/components/selectable/selectable.styles.js +22 -0
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +38 -29
- package/optimize/es/components/selectable/selectable_list/selectable_list.styles.js +35 -0
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +18 -14
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.styles.js +56 -0
- package/optimize/es/components/selectable/selectable_message/selectable_message.js +6 -3
- package/optimize/es/components/selectable/selectable_message/selectable_message.styles.js +17 -0
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +12 -9
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +47 -0
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_option.js +35 -10
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +14 -0
- package/optimize/lib/components/combo_box/combo_box.js +53 -49
- package/optimize/lib/components/combo_box/combo_box.styles.js +20 -0
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +63 -61
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +64 -0
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.js +52 -81
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.styles.js +31 -0
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +28 -0
- package/optimize/lib/components/combo_box/combo_box_options_list/index.js +0 -7
- package/optimize/lib/components/combo_box/utils.js +26 -9
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +2 -3
- package/optimize/lib/components/flyout/flyout.styles.js +2 -2
- package/optimize/lib/components/form/form.styles.js +16 -9
- package/optimize/lib/components/list_group/list_group.styles.js +2 -2
- package/optimize/lib/components/popover/input_popover.js +2 -2
- package/optimize/lib/components/search_bar/search_bar.styles.js +1 -3
- package/optimize/lib/components/selectable/selectable.js +9 -8
- package/optimize/lib/components/selectable/selectable.styles.js +26 -0
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +38 -29
- package/optimize/lib/components/selectable/selectable_list/selectable_list.styles.js +38 -0
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +18 -14
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.styles.js +60 -0
- package/optimize/lib/components/selectable/selectable_message/selectable_message.js +6 -3
- package/optimize/lib/components/selectable/selectable_message/selectable_message.styles.js +23 -0
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +11 -8
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +51 -0
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_option.js +35 -10
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/style_memoization.js +15 -1
- package/package.json +1 -1
- package/src/components/index.scss +0 -2
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/combo_box/combo_box.js +53 -49
- package/test-env/components/combo_box/combo_box.styles.js +20 -0
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +63 -61
- package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +64 -0
- package/test-env/components/combo_box/combo_box_input/combo_box_pill.js +51 -135
- package/test-env/components/combo_box/combo_box_input/combo_box_pill.styles.js +31 -0
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +28 -0
- package/test-env/components/combo_box/combo_box_options_list/index.js +0 -7
- package/test-env/components/combo_box/utils.js +26 -9
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +2 -3
- package/test-env/components/flyout/flyout.styles.js +2 -2
- package/test-env/components/form/form.styles.js +16 -9
- package/test-env/components/list_group/list_group.styles.js +2 -2
- package/test-env/components/popover/input_popover.js +2 -2
- package/test-env/components/search_bar/search_bar.styles.js +1 -3
- package/test-env/components/selectable/selectable.js +9 -8
- package/test-env/components/selectable/selectable.styles.js +26 -0
- package/test-env/components/selectable/selectable_list/selectable_list.js +38 -29
- package/test-env/components/selectable/selectable_list/selectable_list.styles.js +38 -0
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +18 -14
- package/test-env/components/selectable/selectable_list/selectable_list_item.styles.js +60 -0
- package/test-env/components/selectable/selectable_message/selectable_message.js +6 -3
- package/test-env/components/selectable/selectable_message/selectable_message.styles.js +23 -0
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +11 -8
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +51 -0
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_option.js +35 -10
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/style_memoization.js +15 -1
- package/es/components/combo_box/combo_box_options_list/combo_box_option.js +0 -153
- package/lib/components/combo_box/combo_box_options_list/combo_box_option.js +0 -160
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_option.js +0 -90
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_option.js +0 -98
- package/src/components/combo_box/_combo_box.scss +0 -147
- package/src/components/combo_box/_index.scss +0 -3
- package/src/components/combo_box/combo_box_input/_combo_box_pill.scss +0 -38
- package/src/components/combo_box/combo_box_input/_index.scss +0 -1
- package/src/components/combo_box/combo_box_options_list/_combo_box_option.scss +0 -72
- package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +0 -28
- package/src/components/combo_box/combo_box_options_list/_combo_box_title.scss +0 -12
- package/src/components/combo_box/combo_box_options_list/_index.scss +0 -3
- package/src/components/selectable/_index.scss +0 -5
- package/src/components/selectable/_selectable.scss +0 -8
- package/src/components/selectable/selectable_list/_index.scss +0 -3
- package/src/components/selectable/selectable_list/_selectable_list.scss +0 -38
- package/src/components/selectable/selectable_list/_selectable_list_item.scss +0 -62
- package/src/components/selectable/selectable_list/_variables.scss +0 -2
- package/src/components/selectable/selectable_message/_index.scss +0 -1
- package/src/components/selectable/selectable_message/_selectable_message.scss +0 -19
- package/src/components/selectable/selectable_search/_index.scss +0 -1
- package/src/components/selectable/selectable_search/_selectable_search.scss +0 -3
- package/src/components/selectable/selectable_templates/_index.scss +0 -2
- package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +0 -39
- package/src/components/selectable/selectable_templates/_variables.scss +0 -26
- package/src/themes/amsterdam/overrides/_combo_box.scss +0 -50
- package/test-env/components/combo_box/combo_box_options_list/combo_box_option.js +0 -154
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { euiBreakpoint, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
11
|
-
import {
|
|
11
|
+
import { euiFormMaxWidth } from '../form/form.styles';
|
|
12
12
|
export var euiSearchBar__searchHolder = function euiSearchBar__searchHolder(euiThemeContext) {
|
|
13
|
-
|
|
14
|
-
maxWidth = _euiFormVariables.maxWidth;
|
|
15
|
-
return /*#__PURE__*/css(logicalCSS('min-width', mathWithUnits(maxWidth, function (x) {
|
|
13
|
+
return /*#__PURE__*/css(logicalCSS('min-width', mathWithUnits(euiFormMaxWidth(euiThemeContext), function (x) {
|
|
16
14
|
return x / 2;
|
|
17
15
|
})), ";;label:euiSearchBar__searchHolder;");
|
|
18
16
|
};
|
|
@@ -37,15 +37,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
37
37
|
import React, { Component, createRef } from 'react';
|
|
38
38
|
import PropTypes from "prop-types";
|
|
39
39
|
import classNames from 'classnames';
|
|
40
|
-
import {
|
|
41
|
-
import { EuiSelectableMessage } from './selectable_message';
|
|
42
|
-
import { EuiSelectableList } from './selectable_list';
|
|
40
|
+
import { keys, htmlIdGenerator } from '../../services';
|
|
43
41
|
import { EuiLoadingSpinner } from '../loading';
|
|
44
42
|
import { EuiSpacer } from '../spacer';
|
|
45
|
-
import { createPartialStringEqualityOptionMatcher, getMatchingOptions } from './matching_options';
|
|
46
|
-
import { keys, htmlIdGenerator } from '../../services';
|
|
47
43
|
import { EuiScreenReaderLive, EuiScreenReaderOnly } from '../accessibility';
|
|
48
44
|
import { EuiI18n } from '../i18n';
|
|
45
|
+
import { EuiSelectableSearch } from './selectable_search';
|
|
46
|
+
import { EuiSelectableMessage } from './selectable_message';
|
|
47
|
+
import { EuiSelectableList } from './selectable_list';
|
|
48
|
+
import { createPartialStringEqualityOptionMatcher, getMatchingOptions } from './matching_options';
|
|
49
|
+
import { euiSelectableStyles as styles } from './selectable.styles';
|
|
49
50
|
|
|
50
51
|
// The `searchable` prop has significant implications for a11y.
|
|
51
52
|
// When present, we effectively change from adhering
|
|
@@ -366,9 +367,8 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
366
367
|
rowHeight: rowHeight
|
|
367
368
|
};
|
|
368
369
|
}
|
|
369
|
-
var classes = classNames('euiSelectable',
|
|
370
|
-
|
|
371
|
-
}, className);
|
|
370
|
+
var classes = classNames('euiSelectable', className);
|
|
371
|
+
var cssStyles = [styles.euiSelectable, height === 'full' && styles.fullHeight];
|
|
372
372
|
|
|
373
373
|
/** Create message content that replaces the list if no options are available (yet) */
|
|
374
374
|
var messageContent;
|
|
@@ -535,6 +535,7 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
535
535
|
});
|
|
536
536
|
return ___EmotionJSX("div", _extends({
|
|
537
537
|
ref: this.containerRef,
|
|
538
|
+
css: cssStyles,
|
|
538
539
|
className: classes,
|
|
539
540
|
onKeyDown: this.onKeyDown,
|
|
540
541
|
onBlur: this.onContainerBlur,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { logicalCSS } from '../../global_styling';
|
|
12
|
+
export var euiSelectableStyles = {
|
|
13
|
+
euiSelectable: process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "1sd0qv-euiSelectable",
|
|
15
|
+
styles: "display:flex;flex-direction:column;label:euiSelectable;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "1sd0qv-euiSelectable",
|
|
18
|
+
styles: "display:flex;flex-direction:column;label:euiSelectable;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
},
|
|
21
|
+
fullHeight: /*#__PURE__*/css(logicalCSS('height', '100%'), ";;label:fullHeight;")
|
|
22
|
+
};
|
|
@@ -32,11 +32,13 @@ import React, { Component, memo } from 'react';
|
|
|
32
32
|
import PropTypes from "prop-types";
|
|
33
33
|
import classNames from 'classnames';
|
|
34
34
|
import { FixedSizeList, areEqual } from 'react-window';
|
|
35
|
+
import { RenderWithEuiStylesMemoizer } from '../../../services';
|
|
35
36
|
import { EuiAutoSizer } from '../../auto_sizer';
|
|
36
37
|
import { EuiHighlight } from '../../highlight';
|
|
37
38
|
import { EuiMark } from '../../mark';
|
|
38
39
|
import { EuiTextTruncate } from '../../text_truncate';
|
|
39
40
|
import { EuiSelectableListItem } from './selectable_list_item';
|
|
41
|
+
import { euiSelectableListStyles } from './selectable_list.styles';
|
|
40
42
|
|
|
41
43
|
// Consumer Configurable Props via `EuiSelectable.listProps`
|
|
42
44
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -140,12 +142,15 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
140
142
|
isPreFiltered = _this$props2.isPreFiltered,
|
|
141
143
|
isVirtualized = _this$props2.isVirtualized;
|
|
142
144
|
if (isGroupLabel) {
|
|
143
|
-
return ___EmotionJSX(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
|
|
146
|
+
var styles = stylesMemoizer(euiSelectableListStyles);
|
|
147
|
+
return ___EmotionJSX("li", _extends({
|
|
148
|
+
role: "presentation",
|
|
149
|
+
css: styles.euiSelectableList__groupLabel,
|
|
150
|
+
className: "euiSelectableList__groupLabel",
|
|
151
|
+
style: style
|
|
152
|
+
}, optionRest), prepend, label, append);
|
|
153
|
+
});
|
|
149
154
|
}
|
|
150
155
|
var id = makeOptionId(index);
|
|
151
156
|
var isFocused = activeOptionIndex === index;
|
|
@@ -186,10 +191,11 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
186
191
|
paddingSize: paddingSize,
|
|
187
192
|
searchable: searchable,
|
|
188
193
|
textWrap: textWrap
|
|
194
|
+
// @ts-ignore complex
|
|
189
195
|
}, optionRest), renderOption ? renderOption( // @ts-ignore complex
|
|
190
196
|
_objectSpread(_objectSpread({}, _option), optionData), searchValue) : highlightSearch ? _this.renderSearchedText(label, truncationProps) : truncationProps ? _this.renderTruncatedText(label, truncationProps) : label);
|
|
191
197
|
}, areEqual));
|
|
192
|
-
_defineProperty(_this, "renderVirtualizedList", function () {
|
|
198
|
+
_defineProperty(_this, "renderVirtualizedList", function (listClasses) {
|
|
193
199
|
if (!_this.props.isVirtualized) return null;
|
|
194
200
|
var _this$state = _this.state,
|
|
195
201
|
optionArray = _this$state.optionArray,
|
|
@@ -200,7 +206,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
200
206
|
rowHeight = _this$props3.rowHeight;
|
|
201
207
|
var heightIsFull = forcedHeight === 'full';
|
|
202
208
|
var virtualizationProps = _objectSpread({
|
|
203
|
-
className:
|
|
209
|
+
className: listClasses,
|
|
204
210
|
ref: _this.setListRef,
|
|
205
211
|
outerRef: _this.removeScrollableTabStop,
|
|
206
212
|
innerRef: _this.setListBoxRef,
|
|
@@ -540,27 +546,30 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
540
546
|
truncationProps = _this$props11.truncationProps,
|
|
541
547
|
rest = _objectWithoutProperties(_this$props11, _excluded3);
|
|
542
548
|
var heightIsFull = forcedHeight === 'full';
|
|
543
|
-
var classes = classNames('euiSelectableList',
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
549
|
+
var classes = classNames('euiSelectableList', className);
|
|
550
|
+
return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
|
|
551
|
+
var styles = stylesMemoizer(euiSelectableListStyles);
|
|
552
|
+
var cssStyles = [styles.euiSelectableList, heightIsFull && styles.fullHeight, bordered && styles.bordered];
|
|
553
|
+
var listClasses = classNames('euiSelectableList__list', styles.euiSelectableList__list);
|
|
554
|
+
return ___EmotionJSX("div", _extends({
|
|
555
|
+
css: cssStyles,
|
|
556
|
+
className: classes
|
|
557
|
+
}, rest), isVirtualized ? _this2.renderVirtualizedList(listClasses) : ___EmotionJSX("div", {
|
|
558
|
+
className: listClasses,
|
|
559
|
+
style: !heightIsFull ? {
|
|
560
|
+
blockSize: forcedHeight
|
|
561
|
+
} : undefined,
|
|
562
|
+
ref: _this2.removeScrollableTabStop
|
|
563
|
+
}, ___EmotionJSX("ul", {
|
|
564
|
+
ref: _this2.setListBoxRef
|
|
565
|
+
}, _this2.state.optionArray.map(function (_, index) {
|
|
566
|
+
return /*#__PURE__*/React.createElement(_this2.ListRow, {
|
|
567
|
+
key: "".concat(index, "-").concat(_this2.listRowRerender),
|
|
568
|
+
data: _this2.state.optionArray,
|
|
569
|
+
index: index
|
|
570
|
+
}, null);
|
|
571
|
+
}))));
|
|
572
|
+
});
|
|
564
573
|
}
|
|
565
574
|
}]);
|
|
566
575
|
}(Component);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
// .euiSelectableList__list requires a static vanilla className
|
|
12
|
+
// as it's passed down to react-window's virtualization library
|
|
13
|
+
import { css as classNameCss } from '@emotion/css';
|
|
14
|
+
import { euiFocusRing, euiYScrollWithShadows, logicalCSS } from '../../../global_styling';
|
|
15
|
+
import { euiTitle } from '../../title/title.styles';
|
|
16
|
+
import { euiSelectableListItemVariables } from './selectable_list_item.styles';
|
|
17
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
18
|
+
name: "1giu8j5-fullHeight",
|
|
19
|
+
styles: "flex-grow:1;label:fullHeight;"
|
|
20
|
+
} : {
|
|
21
|
+
name: "1giu8j5-fullHeight",
|
|
22
|
+
styles: "flex-grow:1;label:fullHeight;",
|
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
+
};
|
|
25
|
+
export var euiSelectableListStyles = function euiSelectableListStyles(euiThemeContext) {
|
|
26
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
27
|
+
var itemVars = euiSelectableListItemVariables(euiThemeContext);
|
|
28
|
+
return {
|
|
29
|
+
euiSelectableList: /*#__PURE__*/css("&:has(:focus-visible){", euiFocusRing(euiThemeContext, 'outset'), ";};label:euiSelectableList;"),
|
|
30
|
+
fullHeight: _ref,
|
|
31
|
+
bordered: /*#__PURE__*/css("overflow:hidden;border:", euiTheme.border.thin, ";border-radius:", euiTheme.border.radius.medium, ";;label:bordered;"),
|
|
32
|
+
euiSelectableList__list: /*#__PURE__*/classNameCss(euiYScrollWithShadows(euiThemeContext), " &:focus,&>ul:focus{outline:none;};label:euiSelectableList__list;"),
|
|
33
|
+
euiSelectableList__groupLabel: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxxs'), " display:flex;align-items:center;", logicalCSS('border-bottom', itemVars.border), " ", logicalCSS('padding-vertical', itemVars.paddingVertical), " ", logicalCSS('padding-horizontal', itemVars.paddingHorizontal), ";;label:euiSelectableList__groupLabel;")
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
1
|
var _excluded = ["children", "className", "disabled", "checked", "isFocused", "showIcons", "prepend", "append", "allowExclusions", "onFocusBadge", "paddingSize", "role", "searchable", "textWrap", "toolTipContent", "toolTipProps", "aria-describedby"],
|
|
3
2
|
_excluded2 = ["children", "className"];
|
|
4
3
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
@@ -8,9 +7,6 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
8
7
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
8
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
9
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
10
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
11
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
16
12
|
/*
|
|
@@ -24,12 +20,13 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
24
20
|
import classNames from 'classnames';
|
|
25
21
|
import PropTypes from "prop-types";
|
|
26
22
|
import React, { useState, useEffect, useMemo } from 'react';
|
|
27
|
-
import {
|
|
23
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
28
24
|
import { EuiI18n } from '../../i18n';
|
|
29
25
|
import { EuiIcon } from '../../icon';
|
|
30
26
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
31
27
|
import { EuiBadge } from '../../badge';
|
|
32
28
|
import { EuiToolTip } from '../../tool_tip';
|
|
29
|
+
import { euiSelectableListItemStyles } from './selectable_list_item.styles';
|
|
33
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
34
31
|
function resolveIconAndColor(checked) {
|
|
35
32
|
switch (checked) {
|
|
@@ -55,11 +52,7 @@ function resolveIconAndColor(checked) {
|
|
|
55
52
|
};
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
|
-
var
|
|
59
|
-
none: null,
|
|
60
|
-
s: 'euiSelectableListItem--paddingSmall'
|
|
61
|
-
};
|
|
62
|
-
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
|
|
55
|
+
export var PADDING_SIZES = ['none', 's'];
|
|
63
56
|
export var EuiSelectableListItem = function EuiSelectableListItem(_ref) {
|
|
64
57
|
var children = _ref.children,
|
|
65
58
|
className = _ref.className,
|
|
@@ -86,27 +79,31 @@ export var EuiSelectableListItem = function EuiSelectableListItem(_ref) {
|
|
|
86
79
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
87
80
|
var classes = classNames('euiSelectableListItem', {
|
|
88
81
|
'euiSelectableListItem-isFocused': isFocused
|
|
89
|
-
},
|
|
90
|
-
var
|
|
82
|
+
}, className);
|
|
83
|
+
var styles = useEuiMemoizedStyles(euiSelectableListItemStyles);
|
|
84
|
+
var cssStyles = [styles.euiSelectableListItem, styles.padding[paddingSize]];
|
|
85
|
+
var textStyles = [styles.euiSelectableListItem__text, styles.textWrap[textWrap]];
|
|
91
86
|
var optionIcon = useMemo(function () {
|
|
92
87
|
if (showIcons) {
|
|
93
88
|
var _resolveIconAndColor = resolveIconAndColor(checked),
|
|
94
89
|
icon = _resolveIconAndColor.icon,
|
|
95
90
|
color = _resolveIconAndColor.color;
|
|
96
91
|
return ___EmotionJSX(EuiIcon, {
|
|
92
|
+
css: styles.euiSelectableListItem__icon,
|
|
97
93
|
className: "euiSelectableListItem__icon",
|
|
98
94
|
color: color,
|
|
99
95
|
type: icon
|
|
100
96
|
});
|
|
101
97
|
}
|
|
102
|
-
}, [showIcons, checked]);
|
|
98
|
+
}, [showIcons, checked, styles]);
|
|
103
99
|
var prependNode = useMemo(function () {
|
|
104
100
|
if (prepend) {
|
|
105
101
|
return ___EmotionJSX("span", {
|
|
102
|
+
css: styles.euiSelectableListItem__prepend,
|
|
106
103
|
className: "euiSelectableListItem__prepend"
|
|
107
104
|
}, prepend);
|
|
108
105
|
}
|
|
109
|
-
}, [prepend]);
|
|
106
|
+
}, [prepend, styles]);
|
|
110
107
|
var onFocusBadgeNode = useMemo(function () {
|
|
111
108
|
var defaultOnFocusBadgeProps = {
|
|
112
109
|
'aria-hidden': true,
|
|
@@ -131,10 +128,11 @@ export var EuiSelectableListItem = function EuiSelectableListItem(_ref) {
|
|
|
131
128
|
var appendNode = useMemo(function () {
|
|
132
129
|
if (append || showOnFocusBadge) {
|
|
133
130
|
return ___EmotionJSX("span", {
|
|
131
|
+
css: styles.euiSelectableListItem__append,
|
|
134
132
|
className: "euiSelectableListItem__append"
|
|
135
133
|
}, append, " ", showOnFocusBadge ? onFocusBadgeNode : null);
|
|
136
134
|
}
|
|
137
|
-
}, [append, showOnFocusBadge, onFocusBadgeNode]);
|
|
135
|
+
}, [append, showOnFocusBadge, onFocusBadgeNode, styles]);
|
|
138
136
|
var screenReaderText = useMemo(function () {
|
|
139
137
|
var state;
|
|
140
138
|
var instructions;
|
|
@@ -255,9 +253,11 @@ export var EuiSelectableListItem = function EuiSelectableListItem(_ref) {
|
|
|
255
253
|
}
|
|
256
254
|
}, [tooltipRef, _ariaDescribedBy]);
|
|
257
255
|
var content = ___EmotionJSX("span", {
|
|
256
|
+
css: styles.euiSelectableListItem__content,
|
|
258
257
|
className: "euiSelectableListItem__content"
|
|
259
258
|
}, optionIcon, prependNode, ___EmotionJSX("span", {
|
|
260
|
-
|
|
259
|
+
css: textStyles,
|
|
260
|
+
className: "euiSelectableListItem__text"
|
|
261
261
|
}, children, screenReaderText), appendNode);
|
|
262
262
|
return ___EmotionJSX("li", _extends({
|
|
263
263
|
role: role,
|
|
@@ -266,13 +266,14 @@ export var EuiSelectableListItem = function EuiSelectableListItem(_ref) {
|
|
|
266
266
|
,
|
|
267
267
|
"aria-selected": !disabled && isFocused // Whether the item has keyboard focus per W3 spec
|
|
268
268
|
,
|
|
269
|
+
css: cssStyles,
|
|
269
270
|
className: classes
|
|
270
271
|
}, rest, {
|
|
271
272
|
"aria-describedby": ariaDescribedBy
|
|
272
273
|
}), hasToolTip ? ___EmotionJSX(EuiToolTip, _extends({
|
|
273
274
|
ref: setTooltipRef,
|
|
274
275
|
content: toolTipContent,
|
|
275
|
-
anchorClassName: "
|
|
276
|
+
anchorClassName: "eui-fullWidth",
|
|
276
277
|
position: "left"
|
|
277
278
|
}, toolTipProps), content) : content);
|
|
278
279
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { transparentize } from '../../../services';
|
|
12
|
+
import { euiFontSize, euiTextTruncate, logicalCSS } from '../../../global_styling';
|
|
13
|
+
export var euiSelectableListItemVariables = function euiSelectableListItemVariables(_ref2) {
|
|
14
|
+
var euiTheme = _ref2.euiTheme;
|
|
15
|
+
var lighterBorder = transparentize(euiTheme.border.color, 0.4);
|
|
16
|
+
return {
|
|
17
|
+
border: "".concat(euiTheme.border.width.thin, " solid ").concat(lighterBorder),
|
|
18
|
+
paddingHorizontal: euiTheme.size.m,
|
|
19
|
+
paddingVertical: euiTheme.size.xs
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
23
|
+
name: "1rnenrt-euiSelectableListItem__text",
|
|
24
|
+
styles: "flex-grow:1;label:euiSelectableListItem__text;"
|
|
25
|
+
} : {
|
|
26
|
+
name: "1rnenrt-euiSelectableListItem__text",
|
|
27
|
+
styles: "flex-grow:1;label:euiSelectableListItem__text;",
|
|
28
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
|
+
};
|
|
30
|
+
export var euiSelectableListItemStyles = function euiSelectableListItemStyles(euiThemeContext) {
|
|
31
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
32
|
+
var _euiSelectableListIte = euiSelectableListItemVariables(euiThemeContext),
|
|
33
|
+
border = _euiSelectableListIte.border,
|
|
34
|
+
paddingHorizontal = _euiSelectableListIte.paddingHorizontal,
|
|
35
|
+
paddingVertical = _euiSelectableListIte.paddingVertical;
|
|
36
|
+
return {
|
|
37
|
+
euiSelectableListItem: /*#__PURE__*/css("display:inline-flex;", logicalCSS('width', '100%'), " line-height:", euiFontSize(euiThemeContext, 'm').lineHeight, ";font-size:", euiFontSize(euiThemeContext, 's').fontSize, ";text-align:start;cursor:pointer;overflow:hidden;&:not(:last-of-type){", logicalCSS('border-bottom', border), ";}&[aria-disabled='true']{color:", euiTheme.colors.disabledText, ";cursor:not-allowed;}&:hover,&.euiSelectableListItem-isFocused{&:not([aria-disabled='true']){color:", euiTheme.colors.primaryText, ";background-color:", euiTheme.focus.backgroundColor, ";.euiSelectableListItem__text{text-decoration:underline;}}};label:euiSelectableListItem;"),
|
|
38
|
+
padding: {
|
|
39
|
+
none: /*#__PURE__*/css(";label:none;"),
|
|
40
|
+
s: /*#__PURE__*/css(logicalCSS('padding-vertical', paddingVertical), " ", logicalCSS('padding-horizontal', paddingHorizontal), ";;label:s;")
|
|
41
|
+
},
|
|
42
|
+
// Child elements
|
|
43
|
+
|
|
44
|
+
euiSelectableListItem__content: /*#__PURE__*/css(logicalCSS('width', '100%'), " display:flex;align-items:center;;label:euiSelectableListItem__content;"),
|
|
45
|
+
euiSelectableListItem__text: _ref,
|
|
46
|
+
textWrap: {
|
|
47
|
+
truncate: /*#__PURE__*/css(euiTextTruncate(), ";label:truncate;"),
|
|
48
|
+
wrap: /*#__PURE__*/css(";label:wrap;")
|
|
49
|
+
},
|
|
50
|
+
euiSelectableListItem__prepend: /*#__PURE__*/css("flex-shrink:0;", logicalCSS('margin-right', paddingHorizontal), ";;label:euiSelectableListItem__prepend;"),
|
|
51
|
+
euiSelectableListItem__append: /*#__PURE__*/css("flex-shrink:0;", logicalCSS('margin-left', paddingHorizontal), ";;label:euiSelectableListItem__append;"),
|
|
52
|
+
get euiSelectableListItem__icon() {
|
|
53
|
+
return this.euiSelectableListItem__prepend;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -13,7 +13,9 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
16
17
|
import { EuiText } from '../../text';
|
|
18
|
+
import { euiSelectableMessageStyles } from './selectable_message.styles';
|
|
17
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
20
|
export var EuiSelectableMessage = function EuiSelectableMessage(_ref) {
|
|
19
21
|
var children = _ref.children,
|
|
@@ -21,12 +23,13 @@ export var EuiSelectableMessage = function EuiSelectableMessage(_ref) {
|
|
|
21
23
|
_ref$bordered = _ref.bordered,
|
|
22
24
|
bordered = _ref$bordered === void 0 ? false : _ref$bordered,
|
|
23
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
var classes = classNames('euiSelectableMessage',
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
var classes = classNames('euiSelectableMessage', className);
|
|
27
|
+
var styles = useEuiMemoizedStyles(euiSelectableMessageStyles);
|
|
28
|
+
var cssStyles = [styles.euiSelectableMessage, bordered && styles.bordered];
|
|
27
29
|
return ___EmotionJSX(EuiText, _extends({
|
|
28
30
|
color: "subdued",
|
|
29
31
|
size: "xs",
|
|
32
|
+
css: cssStyles,
|
|
30
33
|
className: classes
|
|
31
34
|
}, rest), children);
|
|
32
35
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
export var euiSelectableMessageStyles = function euiSelectableMessageStyles(euiThemeContext) {
|
|
11
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
12
|
+
return {
|
|
13
|
+
euiSelectableMessage: /*#__PURE__*/css("display:flex;flex-direction:column;justify-content:center;align-items:center;padding:", euiTheme.size.s, ";text-align:center;word-wrap:break-word;;label:euiSelectableMessage;"),
|
|
14
|
+
// Match border from selectable_list
|
|
15
|
+
bordered: /*#__PURE__*/css("overflow:hidden;border:", euiTheme.border.thin, ";border-radius:", euiTheme.border.radius.medium, ";;label:bordered;")
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -26,16 +26,17 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
26
26
|
import React, { useState, useMemo, useCallback } from 'react';
|
|
27
27
|
import PropTypes from "prop-types";
|
|
28
28
|
import classNames from 'classnames';
|
|
29
|
-
import { useCombinedRefs, useCurrentEuiBreakpoint } from '../../../services';
|
|
30
|
-
import {
|
|
29
|
+
import { useCombinedRefs, useCurrentEuiBreakpoint, useEuiMemoizedStyles } from '../../../services';
|
|
30
|
+
import { ENTER } from '../../../services/keys';
|
|
31
|
+
import { useEuiI18n, EuiI18n } from '../../i18n';
|
|
31
32
|
import { EuiPopoverTitle, EuiPopoverFooter } from '../../popover';
|
|
32
33
|
import { EuiPopover } from '../../popover/popover';
|
|
33
|
-
import { useEuiI18n, EuiI18n } from '../../i18n';
|
|
34
|
-
import { EuiSelectableMessage } from '../selectable_message';
|
|
35
34
|
import { EuiLoadingSpinner } from '../../loading';
|
|
36
|
-
import { euiSelectableTemplateSitewideFormatOptions, euiSelectableTemplateSitewideRenderOptions } from './selectable_template_sitewide_option';
|
|
37
35
|
import { EuiSpacer } from '../../spacer';
|
|
38
|
-
import {
|
|
36
|
+
import { EuiSelectable } from '../selectable';
|
|
37
|
+
import { EuiSelectableMessage } from '../selectable_message';
|
|
38
|
+
import { euiSelectableTemplateSitewideFormatOptions, euiSelectableTemplateSitewideRenderOptions } from './selectable_template_sitewide_option';
|
|
39
|
+
import { euiSelectableTemplateSitewideStyles } from './selectable_template_sitewide.styles';
|
|
39
40
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
40
41
|
export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewide(_ref) {
|
|
41
42
|
var children = _ref.children,
|
|
@@ -116,8 +117,9 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
116
117
|
};
|
|
117
118
|
|
|
118
119
|
/**
|
|
119
|
-
* Classes
|
|
120
|
+
* Classes & styles
|
|
120
121
|
*/
|
|
122
|
+
var styles = useEuiMemoizedStyles(euiSelectableTemplateSitewideStyles);
|
|
121
123
|
var classes = classNames('euiSelectableTemplateSitewide', className);
|
|
122
124
|
var searchClasses = classNames('euiSelectableTemplateSitewide__search', searchProps && searchProps.className);
|
|
123
125
|
var listClasses = classNames('euiSelectableTemplateSitewide__list', listProps && listProps.className);
|
|
@@ -125,7 +127,7 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
125
127
|
/**
|
|
126
128
|
* List options
|
|
127
129
|
*/
|
|
128
|
-
var formattedOptions = euiSelectableTemplateSitewideFormatOptions(options);
|
|
130
|
+
var formattedOptions = euiSelectableTemplateSitewideFormatOptions(options, styles);
|
|
129
131
|
var loadingMessage = ___EmotionJSX(EuiSelectableMessage, {
|
|
130
132
|
style: {
|
|
131
133
|
minHeight: 300
|
|
@@ -167,6 +169,8 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
167
169
|
}, popoverButton);
|
|
168
170
|
}, [popoverButton, canShowPopoverButton, togglePopover]);
|
|
169
171
|
return ___EmotionJSX(EuiSelectable, _extends({
|
|
172
|
+
css: styles.euiSelectableTemplateSitewide,
|
|
173
|
+
className: classes,
|
|
170
174
|
isLoading: isLoading,
|
|
171
175
|
options: formattedOptions,
|
|
172
176
|
renderOption: euiSelectableTemplateSitewideRenderOptions,
|
|
@@ -198,7 +202,6 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
198
202
|
emptyMessage: emptyMessage,
|
|
199
203
|
noMatchesMessage: emptyMessage
|
|
200
204
|
}, rest, {
|
|
201
|
-
className: classes,
|
|
202
205
|
searchable: true
|
|
203
206
|
}), function (list, search) {
|
|
204
207
|
return ___EmotionJSX(EuiPopover, _extends({
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiPaletteColorBlind, makeHighContrastColor } from '../../../services';
|
|
12
|
+
import { euiFontSize, logicalCSS } from '../../../global_styling';
|
|
13
|
+
var visColors = euiPaletteColorBlind();
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "q12130-euiSelectableTemplateSitewide__listItem",
|
|
16
|
+
styles: "&:hover,&.euiSelectableListItem-isFocused{&:not([aria-disabled='true']){.euiSelectableListItem__text{text-decoration:none;}.euiSelectableTemplateSitewide__listItemTitle{text-decoration:underline;}}};label:euiSelectableTemplateSitewide__listItem;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "q12130-euiSelectableTemplateSitewide__listItem",
|
|
19
|
+
styles: "&:hover,&.euiSelectableListItem-isFocused{&:not([aria-disabled='true']){.euiSelectableListItem__text{text-decoration:none;}.euiSelectableTemplateSitewide__listItemTitle{text-decoration:underline;}}};label:euiSelectableTemplateSitewide__listItem;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
22
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
23
|
+
name: "rsb9r7-euiSelectableTemplateSitewide",
|
|
24
|
+
styles: "display:block;label:euiSelectableTemplateSitewide;"
|
|
25
|
+
} : {
|
|
26
|
+
name: "rsb9r7-euiSelectableTemplateSitewide",
|
|
27
|
+
styles: "display:block;label:euiSelectableTemplateSitewide;",
|
|
28
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
|
+
};
|
|
30
|
+
export var euiSelectableTemplateSitewideStyles = function euiSelectableTemplateSitewideStyles(euiThemeContext) {
|
|
31
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
32
|
+
return {
|
|
33
|
+
euiSelectableTemplateSitewide: _ref2,
|
|
34
|
+
// Override EuiSelectable's default item underline
|
|
35
|
+
euiSelectableTemplateSitewide__listItem: _ref,
|
|
36
|
+
euiSelectableTemplateSitewide__optionMetasList: /*#__PURE__*/css("display:block;", logicalCSS('margin-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", euiTheme.colors.subduedText, ";;label:euiSelectableTemplateSitewide__optionMetasList;"),
|
|
37
|
+
euiSelectableTemplateSitewide__optionMeta: /*#__PURE__*/css("&:not(:last-of-type)::after{content:'\u2022';", logicalCSS('margin-horizontal', euiTheme.size.xs), " color:", euiTheme.colors.subduedText, ";};label:euiSelectableTemplateSitewide__optionMeta;"),
|
|
38
|
+
metaTypes: {
|
|
39
|
+
fontWeight: "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n "),
|
|
40
|
+
application: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[1])(euiTheme), ";;label:application;"),
|
|
41
|
+
deployment: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[0])(euiTheme), ";;label:deployment;"),
|
|
42
|
+
article: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[3])(euiTheme), ";;label:article;"),
|
|
43
|
+
case: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[9])(euiTheme), ";;label:case;"),
|
|
44
|
+
platform: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[5])(euiTheme), ";;label:platform;")
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
};
|