@elastic/eui 94.3.0 → 94.4.1
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/README.md +3 -0
- package/dist/eui_charts_theme.js +1519 -1519
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +41 -497
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +41 -497
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/es/components/form/form.styles.js +26 -3
- package/es/components/markdown_editor/markdown_editor.js +12 -8
- package/es/components/markdown_editor/markdown_editor.styles.js +29 -0
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +22 -9
- package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +33 -0
- package/es/components/markdown_editor/markdown_editor_footer.js +11 -2
- package/es/components/markdown_editor/markdown_editor_footer.styles.js +26 -0
- package/es/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/es/components/markdown_editor/markdown_editor_text_area.styles.js +22 -0
- package/es/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/es/components/markdown_editor/markdown_editor_toolbar.styles.js +21 -0
- package/es/components/markdown_editor/markdown_format.js +9 -6
- package/es/components/markdown_editor/markdown_format.styles.js +25 -10
- package/es/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -3
- package/es/components/markdown_editor/plugins/markdown_tooltip/renderer.js +13 -2
- package/es/components/selectable/selectable.js +10 -2
- package/es/components/selectable/selectable_list/selectable_list.js +95 -42
- package/es/components/selectable/selectable_list/selectable_list_item.js +234 -204
- package/es/components/selectable/selectable_option.js +9 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
- package/es/components/text/text_color.js +4 -1
- package/es/components/toast/global_toast_list_item.js +5 -5
- package/eui.d.ts +332 -234
- package/i18ntokens.json +124 -106
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/lib/components/form/form.styles.js +30 -4
- package/lib/components/markdown_editor/markdown_editor.js +12 -8
- package/lib/components/markdown_editor/markdown_editor.styles.js +37 -0
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +20 -8
- package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
- package/lib/components/markdown_editor/markdown_editor_footer.js +10 -1
- package/lib/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
- package/lib/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/lib/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/lib/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
- package/lib/components/markdown_editor/markdown_format.js +8 -5
- package/lib/components/markdown_editor/markdown_format.styles.js +25 -10
- package/lib/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
- package/lib/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
- package/lib/components/selectable/selectable.js +10 -2
- package/lib/components/selectable/selectable_list/selectable_list.js +95 -42
- package/lib/components/selectable/selectable_list/selectable_list_item.js +241 -210
- package/lib/components/selectable/selectable_option.js +12 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
- package/lib/components/text/text_color.js +6 -2
- package/lib/components/toast/global_toast_list_item.js +5 -5
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/optimize/es/components/form/form.styles.js +26 -3
- package/optimize/es/components/markdown_editor/markdown_editor.js +12 -8
- package/optimize/es/components/markdown_editor/markdown_editor.styles.js +29 -0
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.js +19 -9
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +33 -0
- package/optimize/es/components/markdown_editor/markdown_editor_footer.js +11 -2
- package/optimize/es/components/markdown_editor/markdown_editor_footer.styles.js +26 -0
- package/optimize/es/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/optimize/es/components/markdown_editor/markdown_editor_text_area.styles.js +22 -0
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.styles.js +21 -0
- package/optimize/es/components/markdown_editor/markdown_format.js +9 -6
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +25 -10
- package/optimize/es/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -3
- package/optimize/es/components/markdown_editor/plugins/markdown_tooltip/renderer.js +13 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +81 -38
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +217 -198
- package/optimize/es/components/selectable/selectable_option.js +9 -1
- package/optimize/es/components/text/text_color.js +4 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/optimize/lib/components/form/form.styles.js +30 -4
- package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -8
- package/optimize/lib/components/markdown_editor/markdown_editor.styles.js +37 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.js +24 -16
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +10 -1
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/optimize/lib/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
- package/optimize/lib/components/markdown_editor/markdown_format.js +8 -5
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +25 -10
- package/optimize/lib/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
- package/optimize/lib/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +81 -38
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +224 -204
- package/optimize/lib/components/selectable/selectable_option.js +12 -1
- package/optimize/lib/components/text/text_color.js +6 -2
- package/package.json +5 -12
- package/src/components/date_picker/react-datepicker/LICENSE +21 -0
- package/src/components/date_picker/react-datepicker/README.md +168 -0
- package/src/components/date_picker/super_date_picker/date_popover/_absolute_tab.scss +13 -18
- package/src/components/form/checkbox/_checkbox.scss +23 -6
- package/src/components/index.scss +0 -1
- package/src/components/selectable/selectable_list/_selectable_list_item.scss +4 -0
- package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +5 -1
- package/src/services/theme/README.md +153 -0
- package/src/test/README.md +44 -0
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/test-env/components/form/form.styles.js +30 -4
- package/test-env/components/markdown_editor/markdown_editor.js +12 -8
- package/test-env/components/markdown_editor/markdown_editor.styles.js +37 -0
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +24 -16
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
- package/test-env/components/markdown_editor/markdown_editor_footer.js +10 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
- package/test-env/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/test-env/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/test-env/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
- package/test-env/components/markdown_editor/markdown_format.js +8 -5
- package/test-env/components/markdown_editor/markdown_format.styles.js +25 -10
- package/test-env/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
- package/test-env/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
- package/test-env/components/selectable/selectable.js +10 -2
- package/test-env/components/selectable/selectable_list/selectable_list.js +95 -42
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +233 -205
- package/test-env/components/selectable/selectable_option.js +12 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
- package/test-env/components/text/text_color.js +6 -2
- package/test-env/components/toast/global_toast_list_item.js +5 -5
- package/src/components/markdown_editor/_index.scss +0 -9
- package/src/components/markdown_editor/_markdown_editor.scss +0 -22
- package/src/components/markdown_editor/_markdown_editor_drop_zone.scss +0 -58
- package/src/components/markdown_editor/_markdown_editor_footer.scss +0 -42
- package/src/components/markdown_editor/_markdown_editor_preview.scss +0 -20
- package/src/components/markdown_editor/_markdown_editor_text_area.scss +0 -43
- package/src/components/markdown_editor/_markdown_editor_toolbar.scss +0 -29
- package/src/components/markdown_editor/_markdown_format.scss +0 -78
- package/src/components/markdown_editor/_variables.scss +0 -1
- package/src/components/markdown_editor/plugins/markdown_tooltip.scss +0 -4
- package/src/themes/amsterdam/overrides/_markdown_editor.scss +0 -18
|
@@ -8,10 +8,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.CheckboxMarkdownRenderer = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
12
|
+
var _global_styling = require("../../../../global_styling");
|
|
11
13
|
var _checkbox = require("../../../form/checkbox");
|
|
12
14
|
var _markdown_context = require("../../markdown_context");
|
|
13
15
|
var _accessibility = require("../../../../services/accessibility");
|
|
14
|
-
var _react2 = require("@emotion/react");
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
17
18
|
/*
|
|
@@ -29,14 +30,17 @@ var CheckboxMarkdownRenderer = function CheckboxMarkdownRenderer(_ref) {
|
|
|
29
30
|
isChecked = _ref.isChecked,
|
|
30
31
|
children = _ref.children;
|
|
31
32
|
var _useContext = (0, _react.useContext)(_markdown_context.EuiMarkdownContext),
|
|
32
|
-
replaceNode = _useContext.replaceNode
|
|
33
|
+
replaceNode = _useContext.replaceNode,
|
|
34
|
+
readOnly = _useContext.readOnly;
|
|
33
35
|
return (0, _react2.jsx)(_checkbox.EuiCheckbox, {
|
|
34
36
|
id: (0, _accessibility.useGeneratedHtmlId)(),
|
|
35
37
|
checked: isChecked,
|
|
36
38
|
label: children,
|
|
37
39
|
onChange: function onChange() {
|
|
38
40
|
replaceNode(position, "".concat(lead, "[").concat(isChecked ? ' ' : 'x', "]").concat(label));
|
|
39
|
-
}
|
|
41
|
+
},
|
|
42
|
+
css: markdownCheckboxStyles,
|
|
43
|
+
readOnly: readOnly
|
|
40
44
|
});
|
|
41
45
|
};
|
|
42
46
|
exports.CheckboxMarkdownRenderer = CheckboxMarkdownRenderer;
|
|
@@ -57,4 +61,5 @@ CheckboxMarkdownRenderer.propTypes = {
|
|
|
57
61
|
offset: _propTypes.default.number.isRequired
|
|
58
62
|
}).isRequired
|
|
59
63
|
}).isRequired
|
|
60
|
-
};
|
|
64
|
+
};
|
|
65
|
+
var markdownCheckboxStyles = /*#__PURE__*/(0, _react2.css)("&&{.euiCheckbox__input~.euiCheckbox__label{font-size:inherit;line-height:inherit;", (0, _global_styling.logicalCSS)('padding-left', '1.5em'), ";}&:has(+ :not(.euiCheckbox)){", (0, _global_styling.logicalCSS)('margin-bottom', '1em'), ";}.euiCheckbox__input+.euiCheckbox__square{", (0, _global_styling.logicalCSS)('top', '50%'), " transform:translateY(-50%);}};label:markdownCheckboxStyles;");
|
|
@@ -10,22 +10,31 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _tool_tip = require("../../../tool_tip");
|
|
11
11
|
var _icon = require("../../../icon");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
|
-
/*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "blrk0m-tooltipMarkdownRenderer",
|
|
22
|
+
styles: "transform:translateY(-1px);label:tooltipMarkdownRenderer;"
|
|
23
|
+
} : {
|
|
24
|
+
name: "blrk0m-tooltipMarkdownRenderer",
|
|
25
|
+
styles: "transform:translateY(-1px);label:tooltipMarkdownRenderer;",
|
|
26
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
|
+
};
|
|
21
28
|
var tooltipMarkdownRenderer = function tooltipMarkdownRenderer(_ref) {
|
|
22
29
|
var content = _ref.content,
|
|
23
30
|
children = _ref.children;
|
|
24
31
|
return (0, _react2.jsx)("span", null, (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
25
32
|
content: content
|
|
26
33
|
}, (0, _react2.jsx)("span", null, (0, _react2.jsx)("strong", null, children), (0, _react2.jsx)(_icon.EuiIcon, {
|
|
27
|
-
type: "questionInCircle"
|
|
28
|
-
|
|
34
|
+
type: "questionInCircle"
|
|
35
|
+
// This is to offset the tooltip icon, which isn't perfectly centered
|
|
36
|
+
,
|
|
37
|
+
css: _ref2
|
|
29
38
|
}))));
|
|
30
39
|
};
|
|
31
40
|
exports.tooltipMarkdownRenderer = tooltipMarkdownRenderer;
|
|
@@ -630,7 +630,7 @@ EuiSelectable.propTypes = {
|
|
|
630
630
|
* 'on' to indicate inclusion, 'off' to indicate exclusion,
|
|
631
631
|
* or 'mixed' to indicate inclusion for some.
|
|
632
632
|
*/
|
|
633
|
-
checked: _propTypes.default.
|
|
633
|
+
checked: _propTypes.default.any,
|
|
634
634
|
disabled: _propTypes.default.bool,
|
|
635
635
|
/**
|
|
636
636
|
* Node to add between the selection icon and the label
|
|
@@ -660,7 +660,15 @@ EuiSelectable.propTypes = {
|
|
|
660
660
|
* Note: when searching, custom truncation props are ignored. The highlighted search
|
|
661
661
|
* text will always take precedence.
|
|
662
662
|
*/
|
|
663
|
-
truncationProps: _propTypes.default.any
|
|
663
|
+
truncationProps: _propTypes.default.any,
|
|
664
|
+
/**
|
|
665
|
+
* Optional custom tooltip content for the button
|
|
666
|
+
*/
|
|
667
|
+
toolTipContent: _propTypes.default.node,
|
|
668
|
+
/**
|
|
669
|
+
* Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
|
|
670
|
+
*/
|
|
671
|
+
toolTipProps: _propTypes.default.any
|
|
664
672
|
}).isRequired).isRequired,
|
|
665
673
|
/**
|
|
666
674
|
* Passes back the altered `options` array with selected options having `checked: 'on'`.
|
|
@@ -48,6 +48,9 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
48
48
|
var _this;
|
|
49
49
|
(0, _classCallCheck2.default)(this, EuiSelectableList);
|
|
50
50
|
_this = _super.call(this, props);
|
|
51
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "animationFrameId", void 0);
|
|
52
|
+
// counter for tracking list renders and ensuring rerenders
|
|
53
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listRowRerender", 0);
|
|
51
54
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listRef", null);
|
|
52
55
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listBoxRef", null);
|
|
53
56
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setListRef", function (ref) {
|
|
@@ -172,7 +175,6 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
172
175
|
event.persist(); // NOTE: This is needed for React v16 backwards compatibility
|
|
173
176
|
_this.onAddOrRemoveOption(option, event);
|
|
174
177
|
},
|
|
175
|
-
ref: ref ? ref.bind(null, index) : undefined,
|
|
176
178
|
isFocused: isFocused,
|
|
177
179
|
title: searchableLabel || label,
|
|
178
180
|
checked: checked,
|
|
@@ -273,7 +275,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
273
275
|
_this.focusBadgeOffset = _this.props.onFocusBadge === false ? 0 : 46;
|
|
274
276
|
|
|
275
277
|
// Wait a tick for the listbox ref to update before proceeding
|
|
276
|
-
requestAnimationFrame(function () {
|
|
278
|
+
_this.animationFrameId = requestAnimationFrame(function () {
|
|
277
279
|
var scrollbarOffset = _this.listBoxRef ? containerWidth - _this.listBoxRef.offsetWidth : 0;
|
|
278
280
|
_this.setState({
|
|
279
281
|
defaultOptionWidth: containerWidth - scrollbarOffset - paddingOffset - checkedIconOffset
|
|
@@ -425,13 +427,47 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
425
427
|
return _this;
|
|
426
428
|
}
|
|
427
429
|
(0, _createClass2.default)(EuiSelectableList, [{
|
|
430
|
+
key: "componentWillUnmount",
|
|
431
|
+
value: function componentWillUnmount() {
|
|
432
|
+
// ensure requestAnimationFrame is canceled on unmount as
|
|
433
|
+
// it could potentially run on a next tick otherwise
|
|
434
|
+
if (this.animationFrameId !== undefined) {
|
|
435
|
+
cancelAnimationFrame(this.animationFrameId);
|
|
436
|
+
this.animationFrameId = undefined;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}, {
|
|
440
|
+
key: "shouldComponentUpdate",
|
|
441
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
442
|
+
var _this$props9 = this.props,
|
|
443
|
+
allowExclusions = _this$props9.allowExclusions,
|
|
444
|
+
showIcons = _this$props9.showIcons,
|
|
445
|
+
paddingSize = _this$props9.paddingSize,
|
|
446
|
+
textWrap = _this$props9.textWrap,
|
|
447
|
+
onFocusBadge = _this$props9.onFocusBadge,
|
|
448
|
+
searchable = _this$props9.searchable;
|
|
449
|
+
|
|
450
|
+
// using shouldComponentUpdate to determine needed rerender before actual rerender
|
|
451
|
+
// without needing state updates or lagging behind on updates
|
|
452
|
+
if (nextProps.allowExclusions !== allowExclusions || nextProps.showIcons !== showIcons || nextProps.paddingSize !== paddingSize || nextProps.textWrap !== textWrap || nextProps.onFocusBadge !== onFocusBadge || nextProps.searchable !== searchable) {
|
|
453
|
+
this.listRowRerender += 1;
|
|
454
|
+
}
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
}, {
|
|
428
458
|
key: "componentDidUpdate",
|
|
429
459
|
value: function componentDidUpdate(prevProps) {
|
|
430
|
-
var _this$
|
|
431
|
-
isVirtualized = _this$
|
|
432
|
-
activeOptionIndex = _this$
|
|
433
|
-
visibleOptions = _this$
|
|
434
|
-
options = _this$
|
|
460
|
+
var _this$props10 = this.props,
|
|
461
|
+
isVirtualized = _this$props10.isVirtualized,
|
|
462
|
+
activeOptionIndex = _this$props10.activeOptionIndex,
|
|
463
|
+
visibleOptions = _this$props10.visibleOptions,
|
|
464
|
+
options = _this$props10.options,
|
|
465
|
+
allowExclusions = _this$props10.allowExclusions,
|
|
466
|
+
showIcons = _this$props10.showIcons,
|
|
467
|
+
paddingSize = _this$props10.paddingSize,
|
|
468
|
+
textWrap = _this$props10.textWrap,
|
|
469
|
+
onFocusBadge = _this$props10.onFocusBadge,
|
|
470
|
+
searchable = _this$props10.searchable;
|
|
435
471
|
if (prevProps.activeOptionIndex !== activeOptionIndex) {
|
|
436
472
|
var makeOptionId = this.props.makeOptionId;
|
|
437
473
|
if (this.listBoxRef && this.props.searchable !== true) {
|
|
@@ -463,41 +499,48 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
463
499
|
itemData: _objectSpread({}, optionArray)
|
|
464
500
|
}, this.calculateAriaSetAttrs(optionArray)));
|
|
465
501
|
}
|
|
502
|
+
|
|
503
|
+
// ensure that ListRow updates based on item props
|
|
504
|
+
if (isVirtualized) {
|
|
505
|
+
if (prevProps.allowExclusions !== allowExclusions || prevProps.showIcons !== showIcons || prevProps.paddingSize !== paddingSize || prevProps.textWrap !== textWrap || prevProps.onFocusBadge !== onFocusBadge || prevProps.searchable !== searchable) {
|
|
506
|
+
this.forceVirtualizedListRowRerender();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
466
509
|
}
|
|
467
510
|
}, {
|
|
468
511
|
key: "render",
|
|
469
512
|
value: function render() {
|
|
470
513
|
var _this2 = this;
|
|
471
|
-
var _this$
|
|
472
|
-
className = _this$
|
|
473
|
-
options = _this$
|
|
474
|
-
searchValue = _this$
|
|
475
|
-
onOptionClick = _this$
|
|
476
|
-
renderOption = _this$
|
|
477
|
-
forcedHeight = _this$
|
|
478
|
-
windowProps = _this$
|
|
479
|
-
rowHeight = _this$
|
|
480
|
-
activeOptionIndex = _this$
|
|
481
|
-
makeOptionId = _this$
|
|
482
|
-
showIcons = _this$
|
|
483
|
-
singleSelection = _this$
|
|
484
|
-
visibleOptions = _this$
|
|
485
|
-
allowExclusions = _this$
|
|
486
|
-
bordered = _this$
|
|
487
|
-
paddingSize = _this$
|
|
488
|
-
searchable = _this$
|
|
489
|
-
onFocusBadge = _this$
|
|
490
|
-
listId = _this$
|
|
491
|
-
setActiveOptionIndex = _this$
|
|
492
|
-
ariaLabel = _this$
|
|
493
|
-
ariaLabelledby = _this$
|
|
494
|
-
ariaDescribedby = _this$
|
|
495
|
-
role = _this$
|
|
496
|
-
isPreFiltered = _this$
|
|
497
|
-
isVirtualized = _this$
|
|
498
|
-
textWrap = _this$
|
|
499
|
-
truncationProps = _this$
|
|
500
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
514
|
+
var _this$props11 = this.props,
|
|
515
|
+
className = _this$props11.className,
|
|
516
|
+
options = _this$props11.options,
|
|
517
|
+
searchValue = _this$props11.searchValue,
|
|
518
|
+
onOptionClick = _this$props11.onOptionClick,
|
|
519
|
+
renderOption = _this$props11.renderOption,
|
|
520
|
+
forcedHeight = _this$props11.height,
|
|
521
|
+
windowProps = _this$props11.windowProps,
|
|
522
|
+
rowHeight = _this$props11.rowHeight,
|
|
523
|
+
activeOptionIndex = _this$props11.activeOptionIndex,
|
|
524
|
+
makeOptionId = _this$props11.makeOptionId,
|
|
525
|
+
showIcons = _this$props11.showIcons,
|
|
526
|
+
singleSelection = _this$props11.singleSelection,
|
|
527
|
+
visibleOptions = _this$props11.visibleOptions,
|
|
528
|
+
allowExclusions = _this$props11.allowExclusions,
|
|
529
|
+
bordered = _this$props11.bordered,
|
|
530
|
+
paddingSize = _this$props11.paddingSize,
|
|
531
|
+
searchable = _this$props11.searchable,
|
|
532
|
+
onFocusBadge = _this$props11.onFocusBadge,
|
|
533
|
+
listId = _this$props11.listId,
|
|
534
|
+
setActiveOptionIndex = _this$props11.setActiveOptionIndex,
|
|
535
|
+
ariaLabel = _this$props11['aria-label'],
|
|
536
|
+
ariaLabelledby = _this$props11['aria-labelledby'],
|
|
537
|
+
ariaDescribedby = _this$props11['aria-describedby'],
|
|
538
|
+
role = _this$props11.role,
|
|
539
|
+
isPreFiltered = _this$props11.isPreFiltered,
|
|
540
|
+
isVirtualized = _this$props11.isVirtualized,
|
|
541
|
+
textWrap = _this$props11.textWrap,
|
|
542
|
+
truncationProps = _this$props11.truncationProps,
|
|
543
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props11, _excluded3);
|
|
501
544
|
var heightIsFull = forcedHeight === 'full';
|
|
502
545
|
var classes = (0, _classnames.default)('euiSelectableList', {
|
|
503
546
|
'euiSelectableList-fullHeight': heightIsFull,
|
|
@@ -515,7 +558,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
515
558
|
ref: this.setListBoxRef
|
|
516
559
|
}, this.state.optionArray.map(function (_, index) {
|
|
517
560
|
return /*#__PURE__*/_react.default.createElement(_this2.ListRow, {
|
|
518
|
-
key: index,
|
|
561
|
+
key: "".concat(index, "-").concat(_this2.listRowRerender),
|
|
519
562
|
data: _this2.state.optionArray,
|
|
520
563
|
index: index
|
|
521
564
|
}, null);
|
|
@@ -666,7 +709,7 @@ EuiSelectableList.propTypes = {
|
|
|
666
709
|
* 'on' to indicate inclusion, 'off' to indicate exclusion,
|
|
667
710
|
* or 'mixed' to indicate inclusion for some.
|
|
668
711
|
*/
|
|
669
|
-
checked: _propTypes.default.
|
|
712
|
+
checked: _propTypes.default.any,
|
|
670
713
|
disabled: _propTypes.default.bool,
|
|
671
714
|
/**
|
|
672
715
|
* Node to add between the selection icon and the label
|
|
@@ -696,7 +739,15 @@ EuiSelectableList.propTypes = {
|
|
|
696
739
|
* Note: when searching, custom truncation props are ignored. The highlighted search
|
|
697
740
|
* text will always take precedence.
|
|
698
741
|
*/
|
|
699
|
-
truncationProps: _propTypes.default.any
|
|
742
|
+
truncationProps: _propTypes.default.any,
|
|
743
|
+
/**
|
|
744
|
+
* Optional custom tooltip content for the button
|
|
745
|
+
*/
|
|
746
|
+
toolTipContent: _propTypes.default.node,
|
|
747
|
+
/**
|
|
748
|
+
* Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
|
|
749
|
+
*/
|
|
750
|
+
toolTipProps: _propTypes.default.any
|
|
700
751
|
}).isRequired).isRequired,
|
|
701
752
|
/**
|
|
702
753
|
* Filtered options list (if applicable)
|
|
@@ -710,14 +761,16 @@ EuiSelectableList.propTypes = {
|
|
|
710
761
|
label: _propTypes.default.string,
|
|
711
762
|
searchableLabel: _propTypes.default.string,
|
|
712
763
|
key: _propTypes.default.string,
|
|
713
|
-
checked: _propTypes.default.
|
|
764
|
+
checked: _propTypes.default.any,
|
|
714
765
|
disabled: _propTypes.default.bool,
|
|
715
766
|
prepend: _propTypes.default.node,
|
|
716
767
|
append: _propTypes.default.node,
|
|
717
768
|
ref: _propTypes.default.func,
|
|
718
769
|
data: _propTypes.default.shape({}),
|
|
719
770
|
textWrap: _propTypes.default.oneOf(["truncate", "wrap"]),
|
|
720
|
-
truncationProps: _propTypes.default.any
|
|
771
|
+
truncationProps: _propTypes.default.any,
|
|
772
|
+
toolTipContent: _propTypes.default.node,
|
|
773
|
+
toolTipProps: _propTypes.default.any
|
|
721
774
|
}).isRequired),
|
|
722
775
|
/**
|
|
723
776
|
* Search value to highlight on the option render
|