@elastic/eui 88.3.0 → 88.4.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 -142
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -142
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/in_memory_table.js +85 -34
- package/es/components/card/card.js +3 -3
- package/es/components/combo_box/combo_box.js +16 -4
- package/es/components/combo_box/combo_box_input/combo_box_input.js +4 -1
- package/es/components/combo_box/combo_box_input/combo_box_pill.js +5 -1
- package/es/components/combo_box/combo_box_options_list/combo_box_option.js +2 -0
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +59 -15
- package/es/components/datagrid/controls/column_selector.js +5 -3
- package/es/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/es/components/description_list/description_list_title.js +0 -1
- package/es/components/description_list/description_list_title.styles.js +1 -1
- package/es/components/drag_and_drop/draggable.js +18 -23
- package/es/components/drag_and_drop/draggable.styles.js +56 -0
- package/es/components/drag_and_drop/droppable.js +24 -21
- package/es/components/drag_and_drop/droppable.styles.js +51 -0
- package/es/components/search_bar/search_box.js +54 -88
- package/es/components/table/table_pagination/table_pagination.js +1 -0
- package/es/test/rtl/custom_render.js +1 -1
- package/eui.d.ts +480 -420
- package/i18ntokens.json +142 -88
- package/lib/components/basic_table/in_memory_table.js +85 -34
- package/lib/components/card/card.js +3 -3
- package/lib/components/combo_box/combo_box.js +16 -4
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +4 -1
- package/lib/components/combo_box/combo_box_input/combo_box_pill.js +5 -1
- package/lib/components/combo_box/combo_box_options_list/combo_box_option.js +2 -0
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +59 -15
- package/lib/components/datagrid/controls/column_selector.js +4 -2
- package/lib/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/lib/components/description_list/description_list_title.js +0 -1
- package/lib/components/description_list/description_list_title.styles.js +1 -1
- package/lib/components/drag_and_drop/draggable.js +17 -22
- package/lib/components/drag_and_drop/draggable.styles.js +62 -0
- package/lib/components/drag_and_drop/droppable.js +26 -22
- package/lib/components/drag_and_drop/droppable.styles.js +57 -0
- package/lib/components/search_bar/search_box.js +61 -93
- package/lib/components/table/table_pagination/table_pagination.js +1 -0
- package/lib/test/rtl/custom_render.js +2 -2
- package/optimize/es/components/basic_table/in_memory_table.js +62 -34
- package/optimize/es/components/card/card.js +3 -3
- package/optimize/es/components/combo_box/combo_box.js +6 -4
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.js +3 -1
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +49 -12
- package/optimize/es/components/datagrid/controls/column_selector.js +5 -3
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/optimize/es/components/description_list/description_list_title.js +0 -1
- package/optimize/es/components/description_list/description_list_title.styles.js +1 -1
- package/optimize/es/components/drag_and_drop/draggable.js +17 -22
- package/optimize/es/components/drag_and_drop/draggable.styles.js +56 -0
- package/optimize/es/components/drag_and_drop/droppable.js +23 -20
- package/optimize/es/components/drag_and_drop/droppable.styles.js +51 -0
- package/optimize/es/components/search_bar/search_box.js +50 -83
- package/optimize/es/components/table/table_pagination/table_pagination.js +1 -0
- package/optimize/es/test/rtl/custom_render.js +1 -1
- package/optimize/lib/components/basic_table/in_memory_table.js +62 -34
- package/optimize/lib/components/card/card.js +3 -3
- package/optimize/lib/components/combo_box/combo_box.js +6 -4
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.js +3 -1
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +49 -12
- package/optimize/lib/components/datagrid/controls/column_selector.js +4 -2
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/optimize/lib/components/description_list/description_list_title.js +0 -1
- package/optimize/lib/components/description_list/description_list_title.styles.js +1 -1
- package/optimize/lib/components/drag_and_drop/draggable.js +16 -21
- package/optimize/lib/components/drag_and_drop/draggable.styles.js +62 -0
- package/optimize/lib/components/drag_and_drop/droppable.js +25 -21
- package/optimize/lib/components/drag_and_drop/droppable.styles.js +57 -0
- package/optimize/lib/components/search_bar/search_box.js +57 -89
- package/optimize/lib/components/table/table_pagination/table_pagination.js +1 -0
- package/optimize/lib/test/rtl/custom_render.js +2 -2
- package/package.json +4 -4
- package/src/components/combo_box/combo_box_input/_combo_box_pill.scss +0 -1
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/in_memory_table.js +85 -34
- package/test-env/components/card/card.js +3 -3
- package/test-env/components/combo_box/combo_box.js +16 -4
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +4 -1
- package/test-env/components/combo_box/combo_box_input/combo_box_pill.js +5 -1
- package/test-env/components/combo_box/combo_box_options_list/combo_box_option.js +2 -0
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +58 -14
- package/test-env/components/datagrid/controls/column_selector.js +4 -2
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/test-env/components/description_list/description_list_title.js +0 -1
- package/test-env/components/description_list/description_list_title.styles.js +1 -1
- package/test-env/components/drag_and_drop/draggable.js +17 -22
- package/test-env/components/drag_and_drop/draggable.styles.js +62 -0
- package/test-env/components/drag_and_drop/droppable.js +26 -22
- package/test-env/components/drag_and_drop/droppable.styles.js +57 -0
- package/test-env/components/search_bar/search_box.js +60 -88
- package/test-env/components/table/table_pagination/table_pagination.js +1 -0
- package/test-env/test/rtl/custom_render.js +2 -2
- package/src/components/drag_and_drop/_draggable.scss +0 -41
- package/src/components/drag_and_drop/_droppable.scss +0 -40
- package/src/components/drag_and_drop/_index.scss +0 -3
- package/src/components/drag_and_drop/_variables.scss +0 -5
- package/src/themes/amsterdam/overrides/_description_list.scss +0 -7
|
@@ -4,12 +4,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.EuiDroppableContext = exports.EuiDroppable = void 0;
|
|
7
|
+
exports.SPACINGS = exports.EuiDroppableContext = exports.EuiDroppable = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _dnd = require("@hello-pangea/dnd");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _services = require("../../services");
|
|
13
|
+
var _panel = require("../panel");
|
|
12
14
|
var _drag_drop_context = require("./drag_drop_context");
|
|
15
|
+
var _droppable = require("./droppable.styles");
|
|
13
16
|
var _react2 = require("@emotion/react");
|
|
14
17
|
var _excluded = ["droppableId", "direction", "isDropDisabled", "children", "className", "cloneDraggables", "spacing", "style", "type", "withPanel", "grow", "data-test-subj"];
|
|
15
18
|
/*
|
|
@@ -25,12 +28,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
26
29
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
30
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
s: 'euiDroppable--s',
|
|
31
|
-
m: 'euiDroppable--m',
|
|
32
|
-
l: 'euiDroppable--l'
|
|
33
|
-
};
|
|
31
|
+
var SPACINGS = ['none', 's', 'm', 'l'];
|
|
32
|
+
exports.SPACINGS = SPACINGS;
|
|
34
33
|
var EuiDroppableContext = /*#__PURE__*/_react.default.createContext({
|
|
35
34
|
cloneItems: false
|
|
36
35
|
});
|
|
@@ -59,35 +58,40 @@ var EuiDroppable = function EuiDroppable(_ref) {
|
|
|
59
58
|
var _useContext = (0, _react.useContext)(_drag_drop_context.EuiDragDropContextContext),
|
|
60
59
|
isDraggingType = _useContext.isDraggingType;
|
|
61
60
|
var dropIsDisabled = cloneDraggables ? true : isDropDisabled;
|
|
61
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
62
|
+
var styles = (0, _droppable.euiDroppableStyles)(euiTheme);
|
|
62
63
|
return (0, _react2.jsx)(_dnd.Droppable, _extends({
|
|
63
64
|
isDropDisabled: dropIsDisabled,
|
|
64
65
|
droppableId: droppableId,
|
|
65
66
|
direction: direction,
|
|
66
67
|
type: type
|
|
67
68
|
}, rest), function (provided, snapshot) {
|
|
69
|
+
var isDraggingOver = snapshot.isDraggingOver;
|
|
70
|
+
var PanelOrDiv = withPanel ? _panel.EuiPanel : 'div';
|
|
71
|
+
var panelOrDivProps = withPanel ? {
|
|
72
|
+
panelRef: provided.innerRef,
|
|
73
|
+
hasShadow: true,
|
|
74
|
+
paddingSize: 'none'
|
|
75
|
+
} : {
|
|
76
|
+
ref: provided.innerRef
|
|
77
|
+
};
|
|
78
|
+
var cssStyles = [styles.euiDroppable, isDraggingType === type && !dropIsDisabled && styles.isDragging, isDraggingOver && styles.isDraggingOver, grow ? styles.grow : styles.noGrow, styles.spacing[spacing]];
|
|
68
79
|
var classes = (0, _classnames.default)('euiDroppable', {
|
|
69
|
-
'euiDroppable
|
|
70
|
-
|
|
71
|
-
'euiDroppable--isDraggingType': isDraggingType === type,
|
|
72
|
-
'euiDroppable--withPanel': withPanel,
|
|
73
|
-
'euiDroppable--grow': grow,
|
|
74
|
-
'euiDroppable--noGrow': !grow
|
|
75
|
-
}, spacingToClassNameMap[spacing], className);
|
|
76
|
-
var placeholderClasses = (0, _classnames.default)('euiDroppable__placeholder', {
|
|
77
|
-
'euiDroppable__placeholder--isHidden': cloneDraggables
|
|
78
|
-
});
|
|
80
|
+
'euiDroppable-isDisabled': dropIsDisabled
|
|
81
|
+
}, className);
|
|
79
82
|
var DroppableElement = typeof children === 'function' ? children(provided, snapshot) : children;
|
|
80
|
-
return (0, _react2.jsx)(
|
|
81
|
-
ref: provided.innerRef,
|
|
83
|
+
return (0, _react2.jsx)(PanelOrDiv, _extends({}, provided.droppableProps, panelOrDivProps, {
|
|
82
84
|
style: style,
|
|
83
85
|
"data-test-subj": dataTestSubj,
|
|
84
|
-
className: classes
|
|
86
|
+
className: classes,
|
|
87
|
+
css: cssStyles
|
|
85
88
|
}), (0, _react2.jsx)(EuiDroppableContext.Provider, {
|
|
86
89
|
value: {
|
|
87
90
|
cloneItems: cloneDraggables
|
|
88
91
|
}
|
|
89
92
|
}, DroppableElement), (0, _react2.jsx)("div", {
|
|
90
|
-
className:
|
|
93
|
+
className: "euiDroppable__placeholder",
|
|
94
|
+
hidden: cloneDraggables
|
|
91
95
|
}, provided.placeholder));
|
|
92
96
|
});
|
|
93
97
|
};
|
|
@@ -106,7 +110,7 @@ EuiDroppable.propTypes = {
|
|
|
106
110
|
/**
|
|
107
111
|
* Adds padding to the droppable area
|
|
108
112
|
*/
|
|
109
|
-
spacing: _propTypes.default.
|
|
113
|
+
spacing: _propTypes.default.any,
|
|
110
114
|
/**
|
|
111
115
|
* Adds an EuiPanel style to the droppable area
|
|
112
116
|
*/
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sharedSpacingPadding = exports.euiDroppableStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../services");
|
|
9
|
+
var _global_styling = require("../../global_styling");
|
|
10
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
11
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
13
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
14
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
|
+
* Side Public License, v 1.
|
|
16
|
+
*/
|
|
17
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
18
|
+
name: "jkp921-noGrow",
|
|
19
|
+
styles: "flex-grow:0;label:noGrow;"
|
|
20
|
+
} : {
|
|
21
|
+
name: "jkp921-noGrow",
|
|
22
|
+
styles: "flex-grow:0;label:noGrow;",
|
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
+
};
|
|
25
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
26
|
+
name: "122lw0e-grow",
|
|
27
|
+
styles: "flex-grow:1;label:grow;"
|
|
28
|
+
} : {
|
|
29
|
+
name: "122lw0e-grow",
|
|
30
|
+
styles: "flex-grow:1;label:grow;",
|
|
31
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
32
|
+
};
|
|
33
|
+
var euiDroppableStyles = function euiDroppableStyles(euiThemeContext) {
|
|
34
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
35
|
+
var droppableColor = euiTheme.colors.success;
|
|
36
|
+
return {
|
|
37
|
+
euiDroppable: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{transition:background-color ", euiTheme.animation.slow, " ease;};label:euiDroppable;"),
|
|
38
|
+
isDragging: /*#__PURE__*/(0, _react.css)("background-color:", (0, _services.transparentize)(droppableColor, 0.1), ";;label:isDragging;"),
|
|
39
|
+
isDraggingOver: /*#__PURE__*/(0, _react.css)("background-color:", (0, _services.transparentize)(droppableColor, 0.25), ";;label:isDraggingOver;"),
|
|
40
|
+
grow: _ref2,
|
|
41
|
+
noGrow: _ref,
|
|
42
|
+
spacing: sharedSpacingPadding(euiThemeContext)
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Droppable and draggable components both have the same shared spacing/padding values
|
|
47
|
+
exports.euiDroppableStyles = euiDroppableStyles;
|
|
48
|
+
var sharedSpacingPadding = function sharedSpacingPadding(_ref3) {
|
|
49
|
+
var euiTheme = _ref3.euiTheme;
|
|
50
|
+
return {
|
|
51
|
+
none: null,
|
|
52
|
+
s: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.xxs, ";;label:s;"),
|
|
53
|
+
m: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.xs, ";;label:m;"),
|
|
54
|
+
l: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.s, ";;label:l;")
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.sharedSpacingPadding = sharedSpacingPadding;
|
|
@@ -1,121 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.EuiSearchBox = void 0;
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _services = require("../../services");
|
|
11
|
+
var _i18n = require("../i18n");
|
|
9
12
|
var _form = require("../form");
|
|
10
13
|
var _popover = require("../popover");
|
|
11
14
|
var _react2 = require("@emotion/react");
|
|
12
|
-
var _excluded = ["query", "incremental", "hint"];
|
|
15
|
+
var _excluded = ["query", "placeholder", "incremental", "hint"];
|
|
16
|
+
/*
|
|
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
|
+
*/
|
|
13
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
24
|
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); }
|
|
15
25
|
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; }
|
|
16
|
-
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); }
|
|
17
26
|
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); }
|
|
18
27
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
32
|
-
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); } /*
|
|
33
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
34
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
35
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
36
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
37
|
-
* Side Public License, v 1.
|
|
38
|
-
*/
|
|
39
|
-
var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
40
|
-
_inherits(EuiSearchBox, _Component);
|
|
41
|
-
var _super = _createSuper(EuiSearchBox);
|
|
42
|
-
function EuiSearchBox() {
|
|
43
|
-
var _this;
|
|
44
|
-
_classCallCheck(this, EuiSearchBox);
|
|
45
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
46
|
-
args[_key] = arguments[_key];
|
|
29
|
+
var EuiSearchBox = function EuiSearchBox(_ref) {
|
|
30
|
+
var query = _ref.query,
|
|
31
|
+
placeholder = _ref.placeholder,
|
|
32
|
+
incremental = _ref.incremental,
|
|
33
|
+
hint = _ref.hint,
|
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
var _inputRef = (0, _react.useRef)(null);
|
|
36
|
+
(0, _services.useUpdateEffect)(function () {
|
|
37
|
+
if (_inputRef.current) {
|
|
38
|
+
_inputRef.current.value = query;
|
|
39
|
+
_inputRef.current.dispatchEvent(new Event('change'));
|
|
47
40
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
}, [query]);
|
|
42
|
+
var defaultPlaceholder = (0, _i18n.useEuiI18n)('euiSearchBox.placeholder', 'Search...');
|
|
43
|
+
var ariaLabelIncremental = (0, _i18n.useEuiI18n)('euiSearchBox.incrementalAriaLabel', 'This is a search bar. As you type, the results lower in the page will automatically filter.');
|
|
44
|
+
var ariaLabelEnter = (0, _i18n.useEuiI18n)('euiSearchBox.ariaLabel', 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.');
|
|
45
|
+
var search = (0, _react2.jsx)(_form.EuiFieldSearch, _extends({
|
|
46
|
+
inputRef: function inputRef(input) {
|
|
47
|
+
return _inputRef.current = input;
|
|
48
|
+
},
|
|
49
|
+
fullWidth: true,
|
|
50
|
+
defaultValue: query,
|
|
51
|
+
incremental: incremental,
|
|
52
|
+
"aria-label": incremental ? ariaLabelIncremental : ariaLabelEnter,
|
|
53
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : defaultPlaceholder,
|
|
54
|
+
onFocus: function onFocus() {
|
|
55
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
59
56
|
}
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
}, rest));
|
|
58
|
+
if (hint) {
|
|
59
|
+
return (0, _react2.jsx)(_popover.EuiInputPopover, _extends({
|
|
60
|
+
disableFocusTrap: true,
|
|
61
|
+
input: search,
|
|
62
|
+
isOpen: hint.isVisible,
|
|
63
|
+
fullWidth: true,
|
|
64
|
+
closePopover: function closePopover() {
|
|
65
|
+
hint.setIsVisible(false);
|
|
66
|
+
},
|
|
67
|
+
panelProps: {
|
|
68
|
+
'aria-live': undefined,
|
|
69
|
+
'aria-modal': undefined,
|
|
70
|
+
role: undefined,
|
|
71
|
+
tabIndex: -1,
|
|
72
|
+
id: hint.id
|
|
74
73
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
fullWidth: true,
|
|
80
|
-
defaultValue: query,
|
|
81
|
-
incremental: incremental,
|
|
82
|
-
"aria-label": ariaLabel,
|
|
83
|
-
onFocus: function onFocus() {
|
|
84
|
-
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
85
|
-
}
|
|
86
|
-
}, rest));
|
|
87
|
-
if (hint) {
|
|
88
|
-
return (0, _react2.jsx)(_popover.EuiInputPopover, _extends({
|
|
89
|
-
disableFocusTrap: true,
|
|
90
|
-
input: search,
|
|
91
|
-
isOpen: hint.isVisible,
|
|
92
|
-
fullWidth: true,
|
|
93
|
-
closePopover: function closePopover() {
|
|
94
|
-
hint.setIsVisible(false);
|
|
95
|
-
},
|
|
96
|
-
panelProps: {
|
|
97
|
-
'aria-live': undefined,
|
|
98
|
-
'aria-modal': undefined,
|
|
99
|
-
role: undefined,
|
|
100
|
-
tabIndex: -1,
|
|
101
|
-
id: hint.id
|
|
102
|
-
}
|
|
103
|
-
}, hint.popoverProps), hint.content);
|
|
104
|
-
}
|
|
105
|
-
return search;
|
|
106
|
-
}
|
|
107
|
-
}]);
|
|
108
|
-
return EuiSearchBox;
|
|
109
|
-
}(_react.Component);
|
|
74
|
+
}, hint.popoverProps), hint.content);
|
|
75
|
+
}
|
|
76
|
+
return search;
|
|
77
|
+
};
|
|
110
78
|
exports.EuiSearchBox = EuiSearchBox;
|
|
111
|
-
_defineProperty(EuiSearchBox, "defaultProps", {
|
|
112
|
-
placeholder: 'Search...',
|
|
113
|
-
incremental: false
|
|
114
|
-
});
|
|
115
79
|
EuiSearchBox.propTypes = {
|
|
116
80
|
query: _propTypes.default.string.isRequired,
|
|
117
81
|
// This is optional in EuiFieldSearchProps
|
|
118
82
|
onSearch: _propTypes.default.func.isRequired,
|
|
83
|
+
/**
|
|
84
|
+
* @default Search...
|
|
85
|
+
*/
|
|
86
|
+
placeholder: _propTypes.default.string,
|
|
119
87
|
hint: _propTypes.default.shape({
|
|
120
88
|
id: _propTypes.default.string.isRequired,
|
|
121
89
|
isVisible: _propTypes.default.bool.isRequired,
|
|
@@ -80,6 +80,7 @@ var EuiTablePagination = function EuiTablePagination(props) {
|
|
|
80
80
|
return (0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
81
81
|
key: itemsPerPageOption,
|
|
82
82
|
icon: itemsPerPageOption === itemsPerPage ? 'check' : 'empty',
|
|
83
|
+
"aria-current": itemsPerPageOption === itemsPerPage ? 'true' : undefined,
|
|
83
84
|
onClick: function onClick() {
|
|
84
85
|
closePopover();
|
|
85
86
|
onChangeItemsPerPage === null || onChangeItemsPerPage === void 0 ? void 0 : onChangeItemsPerPage(itemsPerPageOption);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.within = exports.screen = exports.render = void 0;
|
|
8
8
|
var _react = require("@testing-library/react");
|
|
9
|
-
var
|
|
9
|
+
var _provider = require("../../components/provider");
|
|
10
10
|
var dataTestSubjQueries = _interopRequireWildcard(require("./data_test_subj_queries"));
|
|
11
11
|
var _excluded = ["queries"];
|
|
12
12
|
/*
|
|
@@ -38,7 +38,7 @@ var customRender = function customRender(ui) {
|
|
|
38
38
|
options = _objectWithoutProperties(_ref, _excluded);
|
|
39
39
|
return (0, _react.render)(ui, _objectSpread({
|
|
40
40
|
queries: _objectSpread(_objectSpread(_objectSpread({}, _react.queries), dataTestSubjQueries), renderQueries || {}),
|
|
41
|
-
wrapper:
|
|
41
|
+
wrapper: _provider.EuiProvider
|
|
42
42
|
}, options));
|
|
43
43
|
};
|
|
44
44
|
exports.render = customRender;
|
|
@@ -7,8 +7,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["
|
|
11
|
-
_excluded2 = ["
|
|
10
|
+
var _excluded = ["schema"],
|
|
11
|
+
_excluded2 = ["onChange"],
|
|
12
|
+
_excluded3 = ["columns", "loading", "message", "error", "selection", "isSelectable", "hasActions", "compressed", "pagination", "sorting", "itemIdToExpandedRowMap", "itemId", "rowProps", "cellProps", "tableLayout", "items", "search", "searchFormat", "onTableChange", "executeQueryOptions", "allowNeutralSort", "childrenBetween"];
|
|
12
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
15
|
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; }
|
|
@@ -25,7 +26,8 @@ import React, { Component } from 'react';
|
|
|
25
26
|
import { EuiBasicTable } from './basic_table';
|
|
26
27
|
import { isString } from '../../services/predicate';
|
|
27
28
|
import { Comparators } from '../../services/sort';
|
|
28
|
-
import { EuiSearchBar } from '../search_bar';
|
|
29
|
+
import { EuiSearchBar } from '../search_bar/search_bar';
|
|
30
|
+
import { EuiSearchBox } from '../search_bar/search_box';
|
|
29
31
|
import { EuiSpacer } from '../spacer';
|
|
30
32
|
import { euiTablePaginationDefaults } from '../table/table_pagination';
|
|
31
33
|
import { EuiComponentDefaultsContext } from '../provider/component_defaults';
|
|
@@ -210,6 +212,15 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
210
212
|
};
|
|
211
213
|
});
|
|
212
214
|
});
|
|
215
|
+
// Alternative to onQueryChange - allows consumers to specify they want the
|
|
216
|
+
// search bar to ignore EQL syntax and only use the searchbar for plain text
|
|
217
|
+
_defineProperty(_assertThisInitialized(_this), "onPlainTextSearch", function (searchValue) {
|
|
218
|
+
var escapedQueryText = searchValue.replace(/["\\]/g, '\\$&');
|
|
219
|
+
var finalQuery = "\"".concat(escapedQueryText, "\"");
|
|
220
|
+
_this.setState({
|
|
221
|
+
query: EuiSearchBar.Query.parse(finalQuery)
|
|
222
|
+
});
|
|
223
|
+
});
|
|
213
224
|
var columns = props.columns,
|
|
214
225
|
_search = props.search,
|
|
215
226
|
_pagination = props.pagination,
|
|
@@ -253,12 +264,26 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
253
264
|
}, {
|
|
254
265
|
key: "renderSearchBar",
|
|
255
266
|
value: function renderSearchBar() {
|
|
256
|
-
var
|
|
257
|
-
|
|
267
|
+
var _this$props = this.props,
|
|
268
|
+
search = _this$props.search,
|
|
269
|
+
searchFormat = _this$props.searchFormat;
|
|
270
|
+
if (!search) return;
|
|
271
|
+
var searchBar;
|
|
272
|
+
if (searchFormat === 'text') {
|
|
273
|
+
var _searchBoxProps = (search === null || search === void 0 ? void 0 : search.box) || {}; // Work around | boolean type
|
|
274
|
+
var schema = _searchBoxProps.schema,
|
|
275
|
+
searchBoxProps = _objectWithoutProperties(_searchBoxProps, _excluded); // Destructure `schema` so it doesn't get rendered to DOM
|
|
276
|
+
|
|
277
|
+
searchBar = ___EmotionJSX(EuiSearchBox, _extends({
|
|
278
|
+
query: "" // Unused, passed to satisfy Typescript
|
|
279
|
+
}, searchBoxProps, {
|
|
280
|
+
onSearch: this.onPlainTextSearch
|
|
281
|
+
}));
|
|
282
|
+
} else {
|
|
258
283
|
var searchBarProps = {};
|
|
259
284
|
if (isEuiSearchBarProps(search)) {
|
|
260
285
|
var onChange = search.onChange,
|
|
261
|
-
_searchBarProps = _objectWithoutProperties(search,
|
|
286
|
+
_searchBarProps = _objectWithoutProperties(search, _excluded2);
|
|
262
287
|
searchBarProps = _searchBarProps;
|
|
263
288
|
if (searchBarProps.box && searchBarProps.box.schema === true) {
|
|
264
289
|
searchBarProps.box = _objectSpread(_objectSpread({}, searchBarProps.box), {}, {
|
|
@@ -266,12 +291,13 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
266
291
|
});
|
|
267
292
|
}
|
|
268
293
|
}
|
|
269
|
-
|
|
294
|
+
searchBar = ___EmotionJSX(EuiSearchBar, _extends({
|
|
270
295
|
onChange: this.onQueryChange
|
|
271
|
-
}, searchBarProps))
|
|
272
|
-
size: "l"
|
|
273
|
-
}));
|
|
296
|
+
}, searchBarProps));
|
|
274
297
|
}
|
|
298
|
+
return ___EmotionJSX(React.Fragment, null, searchBar, ___EmotionJSX(EuiSpacer, {
|
|
299
|
+
size: "l"
|
|
300
|
+
}));
|
|
275
301
|
}
|
|
276
302
|
}, {
|
|
277
303
|
key: "resolveSearchSchema",
|
|
@@ -348,29 +374,30 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
348
374
|
}, {
|
|
349
375
|
key: "render",
|
|
350
376
|
value: function render() {
|
|
351
|
-
var _this$
|
|
352
|
-
columns = _this$
|
|
353
|
-
loading = _this$
|
|
354
|
-
message = _this$
|
|
355
|
-
error = _this$
|
|
356
|
-
selection = _this$
|
|
357
|
-
isSelectable = _this$
|
|
358
|
-
hasActions = _this$
|
|
359
|
-
compressed = _this$
|
|
360
|
-
hasPagination = _this$
|
|
361
|
-
hasSorting = _this$
|
|
362
|
-
itemIdToExpandedRowMap = _this$
|
|
363
|
-
itemId = _this$
|
|
364
|
-
rowProps = _this$
|
|
365
|
-
cellProps = _this$
|
|
366
|
-
tableLayout = _this$
|
|
367
|
-
_unuseditems = _this$
|
|
368
|
-
search = _this$
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
377
|
+
var _this$props2 = this.props,
|
|
378
|
+
columns = _this$props2.columns,
|
|
379
|
+
loading = _this$props2.loading,
|
|
380
|
+
message = _this$props2.message,
|
|
381
|
+
error = _this$props2.error,
|
|
382
|
+
selection = _this$props2.selection,
|
|
383
|
+
isSelectable = _this$props2.isSelectable,
|
|
384
|
+
hasActions = _this$props2.hasActions,
|
|
385
|
+
compressed = _this$props2.compressed,
|
|
386
|
+
hasPagination = _this$props2.pagination,
|
|
387
|
+
hasSorting = _this$props2.sorting,
|
|
388
|
+
itemIdToExpandedRowMap = _this$props2.itemIdToExpandedRowMap,
|
|
389
|
+
itemId = _this$props2.itemId,
|
|
390
|
+
rowProps = _this$props2.rowProps,
|
|
391
|
+
cellProps = _this$props2.cellProps,
|
|
392
|
+
tableLayout = _this$props2.tableLayout,
|
|
393
|
+
_unuseditems = _this$props2.items,
|
|
394
|
+
search = _this$props2.search,
|
|
395
|
+
searchFormat = _this$props2.searchFormat,
|
|
396
|
+
onTableChange = _this$props2.onTableChange,
|
|
397
|
+
executeQueryOptions = _this$props2.executeQueryOptions,
|
|
398
|
+
allowNeutralSort = _this$props2.allowNeutralSort,
|
|
399
|
+
childrenBetween = _this$props2.childrenBetween,
|
|
400
|
+
rest = _objectWithoutProperties(_this$props2, _excluded3);
|
|
374
401
|
var _this$state3 = this.state,
|
|
375
402
|
pageIndex = _this$state3.pageIndex,
|
|
376
403
|
pageSize = _this$state3.pageSize,
|
|
@@ -493,5 +520,6 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
493
520
|
_defineProperty(EuiInMemoryTable, "contextType", EuiComponentDefaultsContext);
|
|
494
521
|
_defineProperty(EuiInMemoryTable, "defaultProps", {
|
|
495
522
|
responsive: true,
|
|
496
|
-
tableLayout: 'fixed'
|
|
523
|
+
tableLayout: 'fixed',
|
|
524
|
+
searchFormat: 'eql'
|
|
497
525
|
});
|
|
@@ -16,14 +16,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
import React, { isValidElement } from 'react';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
18
|
import { getSecureRelForTarget, useEuiTheme, cloneElementWithCss } from '../../services';
|
|
19
|
+
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
20
|
+
import { validateHref } from '../../services/security/href_validator';
|
|
19
21
|
import { EuiText } from '../text';
|
|
20
22
|
import { EuiTitle } from '../title';
|
|
21
23
|
import { EuiBetaBadge } from '../badge/beta_badge';
|
|
22
|
-
import { EuiCardSelect } from './card_select';
|
|
23
|
-
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
24
|
-
import { validateHref } from '../../services/security/href_validator';
|
|
25
24
|
import { EuiPanel } from '../panel';
|
|
26
25
|
import { EuiSpacer } from '../spacer';
|
|
26
|
+
import { EuiCardSelect } from './card_select';
|
|
27
27
|
import { euiCardBetaBadgeStyles, euiCardStyles, euiCardTextStyles } from './card.styles';
|
|
28
28
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
29
|
export var ALIGNMENTS = ['left', 'center', 'right'];
|
|
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "aria-label", "aria-labelledby"];
|
|
10
|
+
var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "truncationProps", "aria-label", "aria-labelledby"];
|
|
11
11
|
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
12
|
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; }
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -27,12 +27,12 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
27
27
|
import React, { Component } from 'react';
|
|
28
28
|
import classNames from 'classnames';
|
|
29
29
|
import { findPopoverPosition, htmlIdGenerator, keys } from '../../services';
|
|
30
|
+
import { getElementZIndex } from '../../services/popover';
|
|
30
31
|
import { EuiPortal } from '../portal';
|
|
31
32
|
import { EuiI18n } from '../i18n';
|
|
32
|
-
import { EuiComboBoxOptionsList } from './combo_box_options_list';
|
|
33
33
|
import { getMatchingOptions, flattenOptionGroups, getSelectedOptionForSearchValue, transformForCaseSensitivity } from './matching_options';
|
|
34
34
|
import { EuiComboBoxInput } from './combo_box_input/combo_box_input';
|
|
35
|
-
import {
|
|
35
|
+
import { EuiComboBoxOptionsList } from './combo_box_options_list';
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Because of how TypeScript's LibraryManagedAttributes is designed to handle defaultProps (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#support-for-defaultprops-in-jsx)
|
|
@@ -634,6 +634,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
634
634
|
delimiter = _this$props8.delimiter,
|
|
635
635
|
append = _this$props8.append,
|
|
636
636
|
autoFocus = _this$props8.autoFocus,
|
|
637
|
+
truncationProps = _this$props8.truncationProps,
|
|
637
638
|
ariaLabel = _this$props8['aria-label'],
|
|
638
639
|
ariaLabelledby = _this$props8['aria-labelledby'],
|
|
639
640
|
rest = _objectWithoutProperties(_this$props8, _excluded);
|
|
@@ -702,7 +703,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
702
703
|
width: width,
|
|
703
704
|
delimiter: delimiter,
|
|
704
705
|
getSelectedOptionForSearchValue: getSelectedOptionForSearchValue,
|
|
705
|
-
listboxAriaLabel: listboxAriaLabel
|
|
706
|
+
listboxAriaLabel: listboxAriaLabel,
|
|
707
|
+
truncationProps: truncationProps
|
|
706
708
|
});
|
|
707
709
|
}));
|
|
708
710
|
}
|
|
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
var _excluded = ["key", "label", "color", "onClick", "append", "prepend"];
|
|
11
|
+
var _excluded = ["key", "label", "color", "onClick", "append", "prepend", "truncationProps"];
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
/*
|
|
@@ -148,6 +148,7 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
148
148
|
onClick = option.onClick,
|
|
149
149
|
append = option.append,
|
|
150
150
|
prepend = option.prepend,
|
|
151
|
+
truncationProps = option.truncationProps,
|
|
151
152
|
rest = _objectWithoutProperties(option, _excluded);
|
|
152
153
|
var pillOnClose = isDisabled || singleSelection || onClick ? undefined : onRemoveOption;
|
|
153
154
|
return ___EmotionJSX(EuiComboBoxPill, _extends({
|
|
@@ -66,7 +66,9 @@ export var EuiComboBoxPill = /*#__PURE__*/function (_Component) {
|
|
|
66
66
|
} : {};
|
|
67
67
|
var content = ___EmotionJSX(React.Fragment, null, option.prepend && ___EmotionJSX("span", {
|
|
68
68
|
className: "euiComboBoxPill__prepend"
|
|
69
|
-
}, option.prepend),
|
|
69
|
+
}, option.prepend), ___EmotionJSX("span", {
|
|
70
|
+
className: "eui-textTruncate"
|
|
71
|
+
}, children), option.append && ___EmotionJSX("span", {
|
|
70
72
|
className: "euiComboBoxPill__append"
|
|
71
73
|
}, option.append));
|
|
72
74
|
if (onClose) {
|