@elastic/eui 91.3.0 → 92.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -513
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -513
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +25 -22
- package/es/components/basic_table/collapsed_item_actions.js +14 -15
- package/es/components/basic_table/expanded_item_actions.js +4 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/es/components/filter_group/filter_button.js +20 -13
- package/es/components/filter_group/filter_button.styles.js +11 -20
- package/es/components/flyout/flyout.js +4 -4
- package/es/components/flyout/flyout_resizable.js +127 -0
- package/es/components/flyout/flyout_resizable.styles.js +27 -0
- package/es/components/flyout/index.js +2 -1
- package/es/components/form/range/dual_range.js +15 -66
- package/es/components/form/range/range.js +6 -5
- package/es/components/form/range/range_slider.js +28 -22
- package/es/components/form/text_area/text_area.js +39 -3
- package/es/components/index.js +0 -2
- package/es/components/markdown_editor/markdown_editor.js +12 -13
- package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
- package/es/components/tree_view/tree_view.js +23 -25
- package/es/utils/prop_types/is.js +2 -2
- package/eui.d.ts +830 -1145
- package/i18ntokens.json +121 -373
- package/lib/components/basic_table/basic_table.js +25 -22
- package/lib/components/basic_table/collapsed_item_actions.js +14 -15
- package/lib/components/basic_table/expanded_item_actions.js +4 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/lib/components/filter_group/filter_button.js +20 -13
- package/lib/components/filter_group/filter_button.styles.js +11 -20
- package/lib/components/flyout/flyout.js +4 -4
- package/lib/components/flyout/flyout_resizable.js +136 -0
- package/lib/components/flyout/flyout_resizable.styles.js +32 -0
- package/lib/components/flyout/index.js +8 -1
- package/lib/components/form/range/dual_range.js +15 -66
- package/lib/components/form/range/range.js +6 -5
- package/lib/components/form/range/range_slider.js +27 -21
- package/lib/components/form/text_area/text_area.js +42 -3
- package/lib/components/index.js +0 -22
- package/lib/components/markdown_editor/markdown_editor.js +12 -13
- package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/lib/components/pagination/pagination_button.js +79 -2
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/tree_view/tree_view.js +23 -25
- package/lib/utils/prop_types/is.js +2 -2
- package/optimize/es/components/basic_table/basic_table.js +25 -22
- package/optimize/es/components/basic_table/collapsed_item_actions.js +14 -15
- package/optimize/es/components/basic_table/expanded_item_actions.js +4 -4
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/optimize/es/components/filter_group/filter_button.js +20 -13
- package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
- package/optimize/es/components/flyout/flyout.js +4 -4
- package/optimize/es/components/flyout/flyout_resizable.js +121 -0
- package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
- package/optimize/es/components/flyout/index.js +2 -1
- package/optimize/es/components/form/range/dual_range.js +15 -66
- package/optimize/es/components/form/range/range.js +6 -5
- package/optimize/es/components/form/range/range_slider.js +26 -21
- package/optimize/es/components/form/text_area/text_area.js +29 -3
- package/optimize/es/components/index.js +0 -2
- package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
- package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/es/components/tree_view/tree_view.js +23 -25
- package/optimize/es/utils/prop_types/is.js +2 -2
- package/optimize/lib/components/basic_table/basic_table.js +25 -22
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +14 -15
- package/optimize/lib/components/basic_table/expanded_item_actions.js +4 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/optimize/lib/components/filter_group/filter_button.js +20 -13
- package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
- package/optimize/lib/components/flyout/flyout.js +4 -4
- package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
- package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
- package/optimize/lib/components/flyout/index.js +8 -1
- package/optimize/lib/components/form/range/dual_range.js +15 -66
- package/optimize/lib/components/form/range/range.js +6 -5
- package/optimize/lib/components/form/range/range_slider.js +26 -21
- package/optimize/lib/components/form/text_area/text_area.js +32 -3
- package/optimize/lib/components/index.js +0 -22
- package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
- package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/lib/components/tree_view/tree_view.js +23 -25
- package/optimize/lib/utils/prop_types/is.js +2 -2
- package/package.json +3 -5
- package/src/components/index.scss +0 -2
- package/test-env/components/basic_table/basic_table.js +25 -22
- package/test-env/components/basic_table/collapsed_item_actions.js +14 -15
- package/test-env/components/basic_table/expanded_item_actions.js +4 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/test-env/components/filter_group/filter_button.js +20 -13
- package/test-env/components/filter_group/filter_button.styles.js +11 -20
- package/test-env/components/flyout/flyout_resizable.js +131 -0
- package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
- package/test-env/components/flyout/index.js +8 -1
- package/test-env/components/form/range/dual_range.js +15 -66
- package/test-env/components/form/range/range.js +6 -5
- package/test-env/components/form/range/range_slider.js +27 -21
- package/test-env/components/form/text_area/text_area.js +42 -3
- package/test-env/components/index.js +0 -22
- package/test-env/components/markdown_editor/markdown_editor.js +12 -13
- package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/test-env/components/pagination/pagination_button.js +79 -2
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/tree_view/tree_view.js +23 -25
- package/test-env/utils/prop_types/is.js +2 -2
- package/es/components/control_bar/control_bar.a11y.js +0 -133
- package/es/components/control_bar/control_bar.js +0 -609
- package/es/components/control_bar/index.js +0 -9
- package/es/components/notification/index.js +0 -9
- package/es/components/notification/notification_event.a11y.js +0 -104
- package/es/components/notification/notification_event.js +0 -288
- package/es/components/notification/notification_event_messages.js +0 -79
- package/es/components/notification/notification_event_meta.js +0 -148
- package/es/components/notification/notification_event_read_button.js +0 -86
- package/es/components/notification/notification_event_read_icon.js +0 -77
- package/lib/components/control_bar/control_bar.a11y.js +0 -134
- package/lib/components/control_bar/control_bar.js +0 -441
- package/lib/components/control_bar/index.js +0 -12
- package/lib/components/notification/index.js +0 -12
- package/lib/components/notification/notification_event.a11y.js +0 -105
- package/lib/components/notification/notification_event.js +0 -297
- package/lib/components/notification/notification_event_messages.js +0 -88
- package/lib/components/notification/notification_event_meta.js +0 -157
- package/lib/components/notification/notification_event_read_button.js +0 -93
- package/lib/components/notification/notification_event_read_icon.js +0 -64
- package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
- package/optimize/es/components/control_bar/control_bar.js +0 -308
- package/optimize/es/components/control_bar/index.js +0 -9
- package/optimize/es/components/notification/index.js +0 -9
- package/optimize/es/components/notification/notification_event.a11y.js +0 -99
- package/optimize/es/components/notification/notification_event.js +0 -114
- package/optimize/es/components/notification/notification_event_messages.js +0 -63
- package/optimize/es/components/notification/notification_event_meta.js +0 -106
- package/optimize/es/components/notification/notification_event_read_button.js +0 -44
- package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
- package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
- package/optimize/lib/components/control_bar/control_bar.js +0 -301
- package/optimize/lib/components/control_bar/index.js +0 -12
- package/optimize/lib/components/notification/index.js +0 -12
- package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
- package/optimize/lib/components/notification/notification_event.js +0 -123
- package/optimize/lib/components/notification/notification_event_messages.js +0 -74
- package/optimize/lib/components/notification/notification_event_meta.js +0 -117
- package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
- package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
- package/src/components/control_bar/_control_bar.scss +0 -232
- package/src/components/control_bar/_index.scss +0 -2
- package/src/components/control_bar/_variables.scss +0 -12
- package/src/components/notification/_index.scss +0 -5
- package/src/components/notification/_notification_event.scss +0 -40
- package/src/components/notification/_notification_event_messages.scss +0 -17
- package/src/components/notification/_notification_event_meta.scss +0 -44
- package/src/components/notification/_notification_event_read_button.scss +0 -5
- package/src/components/notification/_notification_event_read_icon.scss +0 -12
- package/test-env/components/control_bar/control_bar.a11y.js +0 -134
- package/test-env/components/control_bar/control_bar.js +0 -436
- package/test-env/components/control_bar/index.js +0 -12
- package/test-env/components/notification/index.js +0 -12
- package/test-env/components/notification/notification_event.a11y.js +0 -105
- package/test-env/components/notification/notification_event.js +0 -296
- package/test-env/components/notification/notification_event_messages.js +0 -85
- package/test-env/components/notification/notification_event_meta.js +0 -154
- package/test-env/components/notification/notification_event_read_button.js +0 -92
- package/test-env/components/notification/notification_event_read_icon.js +0 -63
|
@@ -61,38 +61,10 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
61
61
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
62
62
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
63
63
|
id: _this.props.id || htmlIdGenerator()(),
|
|
64
|
-
rangeSliderRefAvailable: false,
|
|
65
64
|
isPopoverOpen: false,
|
|
66
|
-
rangeWidth: 0
|
|
67
|
-
isVisible: true // used to trigger a rerender if initial element width is 0
|
|
65
|
+
rangeWidth: 0
|
|
68
66
|
});
|
|
69
67
|
_defineProperty(_assertThisInitialized(_this), "preventPopoverClose", false);
|
|
70
|
-
_defineProperty(_assertThisInitialized(_this), "rangeSliderRef", null);
|
|
71
|
-
_defineProperty(_assertThisInitialized(_this), "handleRangeSliderRefUpdate", function (ref) {
|
|
72
|
-
_this.rangeSliderRef = ref;
|
|
73
|
-
if (ref) {
|
|
74
|
-
if (_this.isInPopover) {
|
|
75
|
-
// Wait a tick for popover rendering to settle
|
|
76
|
-
requestAnimationFrame(function () {
|
|
77
|
-
_this.setState({
|
|
78
|
-
rangeSliderRefAvailable: true,
|
|
79
|
-
rangeWidth: ref.clientWidth
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
// If not in a popover, no need to wait
|
|
84
|
-
_this.setState({
|
|
85
|
-
rangeSliderRefAvailable: true,
|
|
86
|
-
rangeWidth: ref.clientWidth
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
_this.setState({
|
|
91
|
-
rangeSliderRefAvailable: false,
|
|
92
|
-
rangeWidth: 0
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
68
|
_defineProperty(_assertThisInitialized(_this), "leftPosition", 0);
|
|
97
69
|
_defineProperty(_assertThisInitialized(_this), "dragAcc", 0);
|
|
98
70
|
_defineProperty(_assertThisInitialized(_this), "_determineInvalidThumbMovement", function (newVal, lower, upper, e) {
|
|
@@ -283,14 +255,11 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
283
255
|
isPopoverOpen: false
|
|
284
256
|
});
|
|
285
257
|
});
|
|
286
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
(_this$props$inputPopo = _this.props.inputPopoverProps) === null || _this$props$inputPopo === void 0 ? void 0 : (_this$props$inputPopo2 = _this$props$inputPopo.onPanelResize) === null || _this$props$inputPopo2 === void 0 ? void 0 : _this$props$inputPopo2.call(_this$props$inputPopo, width);
|
|
258
|
+
_defineProperty(_assertThisInitialized(_this), "setRangeWidth", function (_ref) {
|
|
259
|
+
var width = _ref.width;
|
|
260
|
+
_this.setState({
|
|
261
|
+
rangeWidth: width
|
|
262
|
+
});
|
|
294
263
|
});
|
|
295
264
|
_defineProperty(_assertThisInitialized(_this), "getNearestStep", function (value) {
|
|
296
265
|
var min = _this.props.min;
|
|
@@ -313,7 +282,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
313
282
|
var delta = _this.leftPosition - x;
|
|
314
283
|
_this.leftPosition = x;
|
|
315
284
|
_this.dragAcc = _this.dragAcc + delta;
|
|
316
|
-
var percentageOfArea = _this.dragAcc / _this.
|
|
285
|
+
var percentageOfArea = _this.dragAcc / _this.state.rangeWidth;
|
|
317
286
|
var percentageOfRange = percentageOfArea * (max - min);
|
|
318
287
|
var newLower = _this.getNearestStep(lowerValue - percentageOfRange);
|
|
319
288
|
var newUpper = _this.getNearestStep(upperValue - percentageOfRange);
|
|
@@ -357,32 +326,12 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
357
326
|
get: function get() {
|
|
358
327
|
return this.lowerValueIsValid && this.upperValueIsValid;
|
|
359
328
|
}
|
|
360
|
-
}, {
|
|
361
|
-
key: "componentDidMount",
|
|
362
|
-
value: function componentDidMount() {
|
|
363
|
-
var _this$rangeSliderRef;
|
|
364
|
-
if (((_this$rangeSliderRef = this.rangeSliderRef) === null || _this$rangeSliderRef === void 0 ? void 0 : _this$rangeSliderRef.clientWidth) === 0) {
|
|
365
|
-
this.setState({
|
|
366
|
-
isVisible: false
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}, {
|
|
371
|
-
key: "componentDidUpdate",
|
|
372
|
-
value: function componentDidUpdate() {
|
|
373
|
-
var _this$rangeSliderRef2;
|
|
374
|
-
if ((_this$rangeSliderRef2 = this.rangeSliderRef) !== null && _this$rangeSliderRef2 !== void 0 && _this$rangeSliderRef2.clientWidth && !this.state.isVisible) {
|
|
375
|
-
this.setState({
|
|
376
|
-
isVisible: true
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
329
|
}, {
|
|
381
330
|
key: "render",
|
|
382
331
|
value: function render() {
|
|
383
332
|
var _this2 = this;
|
|
384
|
-
var
|
|
385
|
-
defaultFullWidth =
|
|
333
|
+
var _ref2 = this.context,
|
|
334
|
+
defaultFullWidth = _ref2.defaultFullWidth;
|
|
386
335
|
var _this$props = this.props,
|
|
387
336
|
className = _this$props.className,
|
|
388
337
|
customCss = _this$props.css,
|
|
@@ -538,10 +487,10 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
538
487
|
var classes = classNames('euiDualRange', className);
|
|
539
488
|
var dualRangeStyles = euiDualRangeStyles();
|
|
540
489
|
var cssStyles = [dualRangeStyles.euiDualRange, customCss];
|
|
541
|
-
var leftThumbPosition = this.state.
|
|
490
|
+
var leftThumbPosition = this.state.rangeWidth ? this.calculateThumbPositionStyle(Number(this.lowerValue) || min, this.state.rangeWidth) : {
|
|
542
491
|
left: '0'
|
|
543
492
|
};
|
|
544
|
-
var rightThumbPosition = this.state.
|
|
493
|
+
var rightThumbPosition = this.state.rangeWidth ? this.calculateThumbPositionStyle(Number(this.upperValue) || max, this.state.rangeWidth) : {
|
|
545
494
|
left: '0'
|
|
546
495
|
};
|
|
547
496
|
var leftThumbColor = levels && getLevelColor(levels, Number(this.lowerValue));
|
|
@@ -585,7 +534,6 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
585
534
|
}, ___EmotionJSX(EuiRangeSlider, _extends({
|
|
586
535
|
className: "euiDualRange__slider",
|
|
587
536
|
css: dualRangeStyles.euiDualRange__slider,
|
|
588
|
-
ref: this.handleRangeSliderRefUpdate,
|
|
589
537
|
id: id,
|
|
590
538
|
name: name,
|
|
591
539
|
min: min,
|
|
@@ -599,7 +547,9 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
599
547
|
showRange: showRange,
|
|
600
548
|
onFocus: _onFocus,
|
|
601
549
|
onBlur: _onBlur
|
|
602
|
-
}, rest
|
|
550
|
+
}, rest, {
|
|
551
|
+
onResize: this.setRangeWidth
|
|
552
|
+
})), isDraggable && this.isValid && ___EmotionJSX(EuiRangeDraggable, {
|
|
603
553
|
min: min,
|
|
604
554
|
max: max,
|
|
605
555
|
value: [this.lowerValue, this.upperValue],
|
|
@@ -639,7 +589,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
639
589
|
style: logicalStyles(rightThumbStyles),
|
|
640
590
|
"aria-describedby": showInputOnly ? undefined : this.props['aria-describedby'],
|
|
641
591
|
"aria-label": showInputOnly ? undefined : this.props['aria-label']
|
|
642
|
-
})
|
|
592
|
+
}), showRange && this.isValid && ___EmotionJSX(EuiRangeHighlight, {
|
|
643
593
|
showTicks: showTicks,
|
|
644
594
|
min: Number(min),
|
|
645
595
|
max: Number(max),
|
|
@@ -671,7 +621,6 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
671
621
|
isOpen: this.state.isPopoverOpen,
|
|
672
622
|
closePopover: this.closePopover,
|
|
673
623
|
disableFocusTrap: true,
|
|
674
|
-
onPanelResize: this.onResize,
|
|
675
624
|
popoverScreenReaderText: dualSliderScreenReaderInstructions
|
|
676
625
|
}), theRange) : undefined;
|
|
677
626
|
return thePopover || theRange;
|
|
@@ -64,9 +64,10 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
64
64
|
_this.props.onChange(e, isValid);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "setTrackWidth", function (_ref) {
|
|
68
|
+
var width = _ref.width;
|
|
68
69
|
_this.setState({
|
|
69
|
-
trackWidth:
|
|
70
|
+
trackWidth: width
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
73
|
_defineProperty(_assertThisInitialized(_this), "onInputFocus", function (e) {
|
|
@@ -110,8 +111,8 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
110
111
|
key: "render",
|
|
111
112
|
value: function render() {
|
|
112
113
|
var _this2 = this;
|
|
113
|
-
var
|
|
114
|
-
defaultFullWidth =
|
|
114
|
+
var _ref2 = this.context,
|
|
115
|
+
defaultFullWidth = _ref2.defaultFullWidth;
|
|
115
116
|
var _this$props = this.props,
|
|
116
117
|
className = _this$props.className,
|
|
117
118
|
compressed = _this$props.compressed,
|
|
@@ -217,7 +218,7 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
217
218
|
"aria-hidden": !!showInput,
|
|
218
219
|
thumbColor: thumbColor
|
|
219
220
|
}, rest, {
|
|
220
|
-
|
|
221
|
+
onResize: this.setTrackWidth
|
|
221
222
|
})), showRange && this.isValid && ___EmotionJSX(EuiRangeHighlight, {
|
|
222
223
|
showTicks: showTicks,
|
|
223
224
|
min: Number(min),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
var _excluded = ["className", "disabled", "id", "max", "min", "name", "step", "onChange", "tabIndex", "value", "style", "showTicks", "showRange", "thumbColor"];
|
|
2
|
+
var _excluded = ["className", "disabled", "id", "max", "min", "name", "step", "onChange", "tabIndex", "value", "style", "showTicks", "showRange", "thumbColor", "onResize"];
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -16,15 +16,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import React, {
|
|
19
|
+
import React, { useMemo } from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { useEuiTheme } from '../../../services';
|
|
23
23
|
import { logicalStyles } from '../../../global_styling';
|
|
24
|
+
import { EuiResizeObserver } from '../../observer/resize_observer';
|
|
24
25
|
import { euiRangeLevelColor } from './range_levels_colors';
|
|
25
26
|
import { euiRangeSliderStyles, euiRangeSliderThumbStyles } from './range_slider.styles';
|
|
26
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
-
export var EuiRangeSlider =
|
|
28
|
+
export var EuiRangeSlider = function EuiRangeSlider(_ref) {
|
|
28
29
|
var className = _ref.className,
|
|
29
30
|
disabled = _ref.disabled,
|
|
30
31
|
id = _ref.id,
|
|
@@ -39,6 +40,7 @@ export var EuiRangeSlider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
39
40
|
showTicks = _ref.showTicks,
|
|
40
41
|
showRange = _ref.showRange,
|
|
41
42
|
thumbColor = _ref.thumbColor,
|
|
43
|
+
onResize = _ref.onResize,
|
|
42
44
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
45
|
var classes = classNames('euiRangeSlider', className);
|
|
44
46
|
var euiTheme = useEuiTheme();
|
|
@@ -50,29 +52,33 @@ export var EuiRangeSlider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
52
|
color: thumbColor && euiRangeLevelColor(thumbColor, euiTheme.euiTheme)
|
|
51
53
|
}, style));
|
|
52
54
|
}, [thumbColor, euiTheme, style]);
|
|
53
|
-
return ___EmotionJSX(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
return ___EmotionJSX(EuiResizeObserver, {
|
|
56
|
+
onResize: onResize
|
|
57
|
+
}, function (resizeRef) {
|
|
58
|
+
return ___EmotionJSX("input", _extends({
|
|
59
|
+
ref: resizeRef,
|
|
60
|
+
type: "range",
|
|
61
|
+
id: id,
|
|
62
|
+
name: name,
|
|
63
|
+
className: classes,
|
|
64
|
+
css: cssStyles,
|
|
65
|
+
min: min,
|
|
66
|
+
max: max,
|
|
67
|
+
step: step,
|
|
68
|
+
value: value,
|
|
69
|
+
disabled: disabled,
|
|
70
|
+
onChange: onChange,
|
|
71
|
+
style: sliderStyle,
|
|
72
|
+
tabIndex: tabIndex
|
|
73
|
+
}, rest));
|
|
74
|
+
});
|
|
75
|
+
};
|
|
70
76
|
EuiRangeSlider.propTypes = {
|
|
71
77
|
onChange: PropTypes.any,
|
|
72
78
|
thumbColor: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired]),
|
|
79
|
+
onResize: PropTypes.func.isRequired,
|
|
73
80
|
className: PropTypes.string,
|
|
74
81
|
"aria-label": PropTypes.string,
|
|
75
82
|
"data-test-subj": PropTypes.string,
|
|
76
83
|
css: PropTypes.any
|
|
77
|
-
};
|
|
78
|
-
EuiRangeSlider.displayName = 'EuiRangeSlider';
|
|
84
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "compressed", "fullWidth", "id", "inputRef", "isLoading", "isInvalid", "name", "placeholder", "resize", "rows"];
|
|
1
|
+
var _excluded = ["children", "className", "compressed", "fullWidth", "id", "icon", "inputRef", "isLoading", "isInvalid", "isClearable", "name", "placeholder", "resize", "rows"];
|
|
2
2
|
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); }
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
@@ -10,9 +10,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React from 'react';
|
|
13
|
+
import React, { useRef, useMemo } from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
+
import { useCombinedRefs } from '../../../services';
|
|
16
17
|
import { EuiFormControlLayout } from '../form_control_layout';
|
|
17
18
|
import { EuiValidatableControl } from '../validatable_control';
|
|
18
19
|
import { useFormContext } from '../eui_form_context';
|
|
@@ -33,9 +34,11 @@ export var EuiTextArea = function EuiTextArea(props) {
|
|
|
33
34
|
_props$fullWidth = props.fullWidth,
|
|
34
35
|
fullWidth = _props$fullWidth === void 0 ? defaultFullWidth : _props$fullWidth,
|
|
35
36
|
id = props.id,
|
|
37
|
+
icon = props.icon,
|
|
36
38
|
inputRef = props.inputRef,
|
|
37
39
|
isLoading = props.isLoading,
|
|
38
40
|
isInvalid = props.isInvalid,
|
|
41
|
+
isClearable = props.isClearable,
|
|
39
42
|
name = props.name,
|
|
40
43
|
placeholder = props.placeholder,
|
|
41
44
|
_props$resize = props.resize,
|
|
@@ -54,10 +57,33 @@ export var EuiTextArea = function EuiTextArea(props) {
|
|
|
54
57
|
} else {
|
|
55
58
|
definedRows = 6;
|
|
56
59
|
}
|
|
60
|
+
var ref = useRef(null);
|
|
61
|
+
var refs = useCombinedRefs([ref, inputRef]);
|
|
62
|
+
var clear = useMemo(function () {
|
|
63
|
+
if (isClearable) {
|
|
64
|
+
return {
|
|
65
|
+
onClick: function onClick() {
|
|
66
|
+
if (ref.current) {
|
|
67
|
+
ref.current.value = '';
|
|
68
|
+
var event = new Event('input', {
|
|
69
|
+
bubbles: true,
|
|
70
|
+
cancelable: false
|
|
71
|
+
});
|
|
72
|
+
ref.current.dispatchEvent(event);
|
|
73
|
+
ref.current.focus(); // set focus back to the textarea
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
'data-test-subj': 'clearTextAreaButton'
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}, [isClearable]);
|
|
57
81
|
return ___EmotionJSX(EuiFormControlLayout, {
|
|
58
82
|
fullWidth: fullWidth,
|
|
59
83
|
isLoading: isLoading,
|
|
60
84
|
isInvalid: isInvalid,
|
|
85
|
+
clear: clear,
|
|
86
|
+
icon: icon,
|
|
61
87
|
className: "euiFormControlLayout--euiTextArea"
|
|
62
88
|
}, ___EmotionJSX(EuiValidatableControl, {
|
|
63
89
|
isInvalid: isInvalid
|
|
@@ -67,7 +93,7 @@ export var EuiTextArea = function EuiTextArea(props) {
|
|
|
67
93
|
rows: definedRows,
|
|
68
94
|
name: name,
|
|
69
95
|
id: id,
|
|
70
|
-
ref:
|
|
96
|
+
ref: refs,
|
|
71
97
|
placeholder: placeholder
|
|
72
98
|
}), children)));
|
|
73
99
|
};
|
|
@@ -76,8 +102,18 @@ EuiTextArea.propTypes = {
|
|
|
76
102
|
"aria-label": PropTypes.string,
|
|
77
103
|
"data-test-subj": PropTypes.string,
|
|
78
104
|
css: PropTypes.any,
|
|
105
|
+
icon: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]).isRequired, PropTypes.shape({
|
|
106
|
+
type: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]).isRequired,
|
|
107
|
+
side: PropTypes.any,
|
|
108
|
+
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]),
|
|
109
|
+
ref: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.func.isRequired])
|
|
110
|
+
}).isRequired]),
|
|
79
111
|
isLoading: PropTypes.bool,
|
|
80
112
|
isInvalid: PropTypes.bool,
|
|
113
|
+
/**
|
|
114
|
+
* Shows a button that allows users to quickly clear the textarea
|
|
115
|
+
*/
|
|
116
|
+
isClearable: PropTypes.bool,
|
|
81
117
|
/**
|
|
82
118
|
* Expand to fill 100% of the parent.
|
|
83
119
|
* Defaults to `fullWidth` prop of `<EuiForm>`.
|
package/es/components/index.js
CHANGED
|
@@ -26,7 +26,6 @@ export * from './combo_box';
|
|
|
26
26
|
export * from './comment_list';
|
|
27
27
|
export * from './context';
|
|
28
28
|
export * from './context_menu';
|
|
29
|
-
export * from './control_bar';
|
|
30
29
|
export * from './copy';
|
|
31
30
|
export * from './datagrid';
|
|
32
31
|
export * from './date_picker';
|
|
@@ -60,7 +59,6 @@ export * from './markdown_editor';
|
|
|
60
59
|
export * from './mark';
|
|
61
60
|
export * from './modal';
|
|
62
61
|
export * from './observer/mutation_observer';
|
|
63
|
-
export * from './notification';
|
|
64
62
|
export * from './outside_click_detector';
|
|
65
63
|
export * from './overlay_mask';
|
|
66
64
|
export * from './page';
|
|
@@ -266,20 +266,19 @@ export var EuiMarkdownEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
266
266
|
setEditorToolbarHeight(editorToolbarRef.current.offsetHeight);
|
|
267
267
|
}, [setEditorToolbarHeight]);
|
|
268
268
|
useEffect(function () {
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
269
|
+
if (height === 'full' || currentHeight === 'full') return;
|
|
270
|
+
if (isPreviewing && autoExpandPreview && previewRef.current.scrollHeight > currentHeight) {
|
|
271
|
+
// scrollHeight does not include the border or margin
|
|
272
|
+
// so we ask for the computed value for those,
|
|
273
|
+
// which is always in pixels because getComputedValue
|
|
274
|
+
// returns the resolved values
|
|
275
|
+
var elementComputedStyle = window.getComputedStyle(previewRef.current);
|
|
276
|
+
var borderWidth = parseFloat(elementComputedStyle.borderTopWidth) + parseFloat(elementComputedStyle.borderBottomWidth);
|
|
277
|
+
var marginWidth = parseFloat(elementComputedStyle.marginTop) + parseFloat(elementComputedStyle.marginBottom);
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
279
|
+
// then add an extra pixel for safety and because the scrollHeight value is rounded
|
|
280
|
+
var extraHeight = borderWidth + marginWidth + 1;
|
|
281
|
+
setCurrentHeight(previewRef.current.scrollHeight + extraHeight);
|
|
283
282
|
}
|
|
284
283
|
}, [currentHeight, isPreviewing, height, autoExpandPreview]);
|
|
285
284
|
var previewHeight = height === 'full' ? "calc(100% - ".concat(editorFooterHeight, "px)") : currentHeight;
|
|
@@ -62,7 +62,7 @@ export var _EuiPageBottomBar = function _EuiPageBottomBar(_ref2) {
|
|
|
62
62
|
// Hide the overflow in case of larger flex margins than padding
|
|
63
63
|
,
|
|
64
64
|
css: _ref
|
|
65
|
-
// Using
|
|
65
|
+
// Using object here because of the possible conflict with overriding props and position `sticky`
|
|
66
66
|
}, rest), ___EmotionJSX(EuiPageSection, {
|
|
67
67
|
paddingSize: paddingSize,
|
|
68
68
|
restrictWidth: restrictWidth
|
|
@@ -215,7 +215,7 @@ export var EuiSelectableListItem = /*#__PURE__*/function (_Component) {
|
|
|
215
215
|
onFocusBadgeNode = ___EmotionJSX(EuiBadge, _extends({
|
|
216
216
|
className: "euiSelectableListItem__onFocusBadge"
|
|
217
217
|
}, defaultOnFocusBadgeProps));
|
|
218
|
-
} else if (
|
|
218
|
+
} else if (typeof onFocusBadge !== 'boolean' && !!onFocusBadge) {
|
|
219
219
|
var _children = onFocusBadge.children,
|
|
220
220
|
_className = onFocusBadge.className,
|
|
221
221
|
restBadgeProps = _objectWithoutProperties(onFocusBadge, _excluded2);
|
|
@@ -237,6 +237,11 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
237
237
|
"aria-label": PropTypes.string,
|
|
238
238
|
"data-test-subj": PropTypes.string,
|
|
239
239
|
css: PropTypes.any,
|
|
240
|
+
/**
|
|
241
|
+
* One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.
|
|
242
|
+
* Note that coloring only works if your SVG is removed of fill attributes.
|
|
243
|
+
*/
|
|
244
|
+
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]),
|
|
240
245
|
/**
|
|
241
246
|
* Descriptive title for naming the icon based on its use
|
|
242
247
|
*/
|
|
@@ -54,34 +54,12 @@ var displayToClassNameMap = {
|
|
|
54
54
|
export var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
55
55
|
_inherits(EuiTreeView, _Component);
|
|
56
56
|
var _super = _createSuper(EuiTreeView);
|
|
57
|
-
function EuiTreeView() {
|
|
57
|
+
function EuiTreeView(props, context) {
|
|
58
58
|
var _this;
|
|
59
59
|
_classCallCheck(this, EuiTreeView);
|
|
60
|
-
|
|
61
|
-
args[_key] = arguments[_key];
|
|
62
|
-
}
|
|
63
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
60
|
+
_this = _super.call(this, props, context);
|
|
64
61
|
_defineProperty(_assertThisInitialized(_this), "treeIdGenerator", htmlIdGenerator('euiTreeView'));
|
|
65
|
-
_defineProperty(_assertThisInitialized(_this), "isNested",
|
|
66
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
67
|
-
openItems: _this.props.expandByDefault ? _this.props.items.map(function (_ref) {
|
|
68
|
-
var id = _ref.id,
|
|
69
|
-
children = _ref.children;
|
|
70
|
-
return children ? id : null;
|
|
71
|
-
}).filter(function (x) {
|
|
72
|
-
return x != null;
|
|
73
|
-
}) : _this.props.items.map(function (_ref2) {
|
|
74
|
-
var id = _ref2.id,
|
|
75
|
-
children = _ref2.children,
|
|
76
|
-
isExpanded = _ref2.isExpanded;
|
|
77
|
-
return children && isExpanded ? id : null;
|
|
78
|
-
}).filter(function (x) {
|
|
79
|
-
return x != null;
|
|
80
|
-
}),
|
|
81
|
-
activeItem: '',
|
|
82
|
-
treeID: getTreeId(_this.props.id, _this.context, _this.treeIdGenerator),
|
|
83
|
-
expandChildNodes: _this.props.expandByDefault || false
|
|
84
|
-
});
|
|
62
|
+
_defineProperty(_assertThisInitialized(_this), "isNested", void 0);
|
|
85
63
|
_defineProperty(_assertThisInitialized(_this), "buttonRef", []);
|
|
86
64
|
_defineProperty(_assertThisInitialized(_this), "setButtonRef", function (ref, index) {
|
|
87
65
|
_this.buttonRef[index] = ref;
|
|
@@ -176,6 +154,26 @@ export var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
|
176
154
|
_this.buttonRef[index].focus();
|
|
177
155
|
}
|
|
178
156
|
});
|
|
157
|
+
_this.isNested = !!_this.context;
|
|
158
|
+
_this.state = {
|
|
159
|
+
openItems: _this.props.expandByDefault ? _this.props.items.map(function (_ref) {
|
|
160
|
+
var id = _ref.id,
|
|
161
|
+
children = _ref.children;
|
|
162
|
+
return children ? id : null;
|
|
163
|
+
}).filter(function (x) {
|
|
164
|
+
return x != null;
|
|
165
|
+
}) : _this.props.items.map(function (_ref2) {
|
|
166
|
+
var id = _ref2.id,
|
|
167
|
+
children = _ref2.children,
|
|
168
|
+
isExpanded = _ref2.isExpanded;
|
|
169
|
+
return children && isExpanded ? id : null;
|
|
170
|
+
}).filter(function (x) {
|
|
171
|
+
return x != null;
|
|
172
|
+
}),
|
|
173
|
+
activeItem: '',
|
|
174
|
+
treeID: getTreeId(_this.props.id, context, _this.treeIdGenerator),
|
|
175
|
+
expandChildNodes: _this.props.expandByDefault || false
|
|
176
|
+
};
|
|
179
177
|
return _this;
|
|
180
178
|
}
|
|
181
179
|
_createClass(EuiTreeView, [{
|
|
@@ -12,7 +12,7 @@ export var is = function is(expectedValue) {
|
|
|
12
12
|
var compName = componentName || 'ANONYMOUS';
|
|
13
13
|
var value = props[propName];
|
|
14
14
|
if (value !== expectedValue) {
|
|
15
|
-
return new Error("[".concat(propName, "] property in [").concat(compName, "] component is expected to equal [").concat(expectedValue, "] but\n [").concat(value, "] was provided instead."));
|
|
15
|
+
return new Error("[".concat(propName.toString(), "] property in [").concat(compName, "] component is expected to equal [").concat(expectedValue, "] but\n [").concat(value, "] was provided instead."));
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
};
|
|
@@ -20,7 +20,7 @@ export var is = function is(expectedValue) {
|
|
|
20
20
|
var compName = componentName || 'ANONYMOUS';
|
|
21
21
|
var value = props[propName];
|
|
22
22
|
if (isNil(value)) {
|
|
23
|
-
return new Error("[".concat(propName, "] property in [").concat(compName, "] component is required but seems to be missing"));
|
|
23
|
+
return new Error("[".concat(propName.toString(), "] property in [").concat(compName, "] component is required but seems to be missing"));
|
|
24
24
|
}
|
|
25
25
|
return validator(props, propName, componentName);
|
|
26
26
|
};
|