@elastic/eui 73.0.0 → 74.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_theme_dark.css +0 -55
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -55
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +56 -101
- package/es/components/basic_table/basic_table.styles.js +45 -0
- package/es/components/modal/confirm_modal.js +5 -3
- package/es/components/modal/modal.a11y.js +1 -1
- package/es/components/modal/modal_header_title.js +12 -3
- package/es/components/resizable_container/resizable_panel.js +5 -0
- package/es/services/security/get_secure_rel_for_target.js +2 -8
- package/es/services/theme/hooks.js +18 -0
- package/es/services/theme/index.js +1 -1
- package/eui.d.ts +46 -19
- package/i18ntokens.json +18 -18
- package/lib/components/basic_table/basic_table.js +56 -100
- package/lib/components/basic_table/basic_table.styles.js +54 -0
- package/lib/components/modal/confirm_modal.js +5 -3
- package/lib/components/modal/modal.a11y.js +1 -1
- package/lib/components/modal/modal_header_title.js +12 -3
- package/lib/components/resizable_container/resizable_panel.js +5 -0
- package/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/lib/services/theme/hooks.js +22 -2
- package/lib/services/theme/index.js +6 -0
- package/optimize/es/components/basic_table/basic_table.js +56 -101
- package/optimize/es/components/basic_table/basic_table.styles.js +45 -0
- package/optimize/es/components/modal/confirm_modal.js +4 -3
- package/optimize/es/components/modal/modal.a11y.js +1 -1
- package/optimize/es/components/modal/modal_header_title.js +4 -2
- package/optimize/es/services/security/get_secure_rel_for_target.js +2 -8
- package/optimize/es/services/theme/hooks.js +18 -0
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +56 -95
- package/optimize/lib/components/basic_table/basic_table.styles.js +56 -0
- package/optimize/lib/components/modal/confirm_modal.js +4 -3
- package/optimize/lib/components/modal/modal.a11y.js +1 -1
- package/optimize/lib/components/modal/modal_header_title.js +4 -2
- package/optimize/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/optimize/lib/services/theme/hooks.js +22 -2
- package/optimize/lib/services/theme/index.js +6 -0
- package/package.json +1 -1
- package/src/components/index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +56 -95
- package/test-env/components/basic_table/basic_table.styles.js +56 -0
- package/test-env/components/modal/confirm_modal.js +5 -3
- package/test-env/components/modal/modal.a11y.js +1 -1
- package/test-env/components/modal/modal_header_title.js +12 -3
- package/test-env/components/resizable_container/resizable_panel.js +5 -0
- package/test-env/services/security/get_secure_rel_for_target.js +2 -9
- package/test-env/services/theme/hooks.js +22 -2
- package/test-env/services/theme/index.js +6 -0
- package/CHANGELOG.md +0 -6185
- package/es/services/url.js +0 -23
- package/lib/services/url.js +0 -32
- package/optimize/es/services/url.js +0 -23
- package/optimize/lib/services/url.js +0 -32
- package/src/components/basic_table/_basic_table.scss +0 -41
- package/src/components/basic_table/_index.scss +0 -1
- package/src/components/date_picker/react-datepicker/LICENSE +0 -21
- package/src/components/date_picker/react-datepicker/README.md +0 -168
- package/src/services/theme/README.md +0 -153
- package/src/test/README.md +0 -59
- package/test-env/services/url.js +0 -32
|
@@ -57,7 +57,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
57
57
|
import React, { Component, Fragment } from 'react';
|
|
58
58
|
import PropTypes from "prop-types";
|
|
59
59
|
import classNames from 'classnames';
|
|
60
|
-
import { formatAuto, formatBoolean, formatDate, formatNumber, formatText, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, SortDirection } from '../../services';
|
|
60
|
+
import { formatAuto, formatBoolean, formatDate, formatNumber, formatText, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, SortDirection, RenderWithEuiTheme } from '../../services';
|
|
61
61
|
import { isFunction } from '../../services/predicate';
|
|
62
62
|
import { get } from '../../services/objects';
|
|
63
63
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
@@ -71,6 +71,7 @@ import { EuiScreenReaderOnly } from '../accessibility';
|
|
|
71
71
|
import { EuiI18n } from '../i18n';
|
|
72
72
|
import { EuiDelayRender } from '../delay_render';
|
|
73
73
|
import { htmlIdGenerator } from '../../services/accessibility';
|
|
74
|
+
import { euiBasicTableBodyLoading, safariLoadingWorkaround, euiBasicTableActionsWrapper } from './basic_table.styles';
|
|
74
75
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
75
76
|
var dataTypesProfiles = {
|
|
76
77
|
auto: {
|
|
@@ -176,45 +177,6 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
176
177
|
|
|
177
178
|
_this = _super.call(this, props);
|
|
178
179
|
|
|
179
|
-
_defineProperty(_assertThisInitialized(_this), "cleanups", []);
|
|
180
|
-
|
|
181
|
-
_defineProperty(_assertThisInitialized(_this), "tbody", null);
|
|
182
|
-
|
|
183
|
-
_defineProperty(_assertThisInitialized(_this), "setTbody", function (tbody) {
|
|
184
|
-
// remove listeners from an existing element
|
|
185
|
-
_this.removeLoadingListeners(); // update the ref
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
_this.tbody = tbody; // if loading, add listeners
|
|
189
|
-
|
|
190
|
-
if (_this.props.loading === true && tbody) {
|
|
191
|
-
_this.addLoadingListeners(tbody);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
_defineProperty(_assertThisInitialized(_this), "addLoadingListeners", function (tbody) {
|
|
196
|
-
var listener = function listener(event) {
|
|
197
|
-
event.stopPropagation();
|
|
198
|
-
event.preventDefault();
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
['mousedown', 'mouseup', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'click', 'dblclick', 'keydown', 'keyup', 'keypress'].forEach(function (event) {
|
|
202
|
-
tbody.addEventListener(event, listener, true);
|
|
203
|
-
|
|
204
|
-
_this.cleanups.push(function () {
|
|
205
|
-
tbody.removeEventListener(event, listener, true);
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
_defineProperty(_assertThisInitialized(_this), "removeLoadingListeners", function () {
|
|
211
|
-
_this.cleanups.forEach(function (cleanup) {
|
|
212
|
-
return cleanup();
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
_this.cleanups.length = 0;
|
|
216
|
-
});
|
|
217
|
-
|
|
218
180
|
_defineProperty(_assertThisInitialized(_this), "tableId", htmlIdGenerator('__table')());
|
|
219
181
|
|
|
220
182
|
_defineProperty(_assertThisInitialized(_this), "selectAllIdGenerator", htmlIdGenerator('_selection_column-checkbox'));
|
|
@@ -306,27 +268,13 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
306
268
|
_createClass(EuiBasicTable, [{
|
|
307
269
|
key: "componentDidMount",
|
|
308
270
|
value: function componentDidMount() {
|
|
309
|
-
if (this.props.loading && this.tbody) this.addLoadingListeners(this.tbody);
|
|
310
271
|
this.getInitialSelection();
|
|
311
272
|
}
|
|
312
273
|
}, {
|
|
313
274
|
key: "componentDidUpdate",
|
|
314
|
-
value: function componentDidUpdate(
|
|
315
|
-
if (prevProps.loading !== this.props.loading) {
|
|
316
|
-
if (this.props.loading && this.tbody) {
|
|
317
|
-
this.addLoadingListeners(this.tbody);
|
|
318
|
-
} else {
|
|
319
|
-
this.removeLoadingListeners();
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
275
|
+
value: function componentDidUpdate() {
|
|
323
276
|
this.getInitialSelection();
|
|
324
277
|
}
|
|
325
|
-
}, {
|
|
326
|
-
key: "componentWillUnmount",
|
|
327
|
-
value: function componentWillUnmount() {
|
|
328
|
-
this.removeLoadingListeners();
|
|
329
|
-
}
|
|
330
278
|
}, {
|
|
331
279
|
key: "getInitialSelection",
|
|
332
280
|
value: function getInitialSelection() {
|
|
@@ -487,7 +435,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
487
435
|
var _this$props3 = this.props,
|
|
488
436
|
compressed = _this$props3.compressed,
|
|
489
437
|
responsive = _this$props3.responsive,
|
|
490
|
-
tableLayout = _this$props3.tableLayout
|
|
438
|
+
tableLayout = _this$props3.tableLayout,
|
|
439
|
+
loading = _this$props3.loading;
|
|
491
440
|
var mobileHeader = responsive ? ___EmotionJSX(EuiTableHeaderMobile, null, ___EmotionJSX(EuiFlexGroup, {
|
|
492
441
|
responsive: false,
|
|
493
442
|
justifyContent: "spaceBetween",
|
|
@@ -505,7 +454,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
505
454
|
id: this.tableId,
|
|
506
455
|
tableLayout: tableLayout,
|
|
507
456
|
responsive: responsive,
|
|
508
|
-
compressed: compressed
|
|
457
|
+
compressed: compressed,
|
|
458
|
+
css: loading && safariLoadingWorkaround
|
|
509
459
|
}, caption, head, body, footer));
|
|
510
460
|
}
|
|
511
461
|
}, {
|
|
@@ -768,30 +718,35 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
768
718
|
value: function renderTableBody() {
|
|
769
719
|
var _this4 = this;
|
|
770
720
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
var
|
|
776
|
-
|
|
777
|
-
if (
|
|
778
|
-
|
|
721
|
+
var _this$props8 = this.props,
|
|
722
|
+
error = _this$props8.error,
|
|
723
|
+
loading = _this$props8.loading,
|
|
724
|
+
items = _this$props8.items;
|
|
725
|
+
var content;
|
|
726
|
+
|
|
727
|
+
if (error) {
|
|
728
|
+
content = this.renderErrorMessage(error);
|
|
729
|
+
} else if (items.length === 0) {
|
|
730
|
+
content = this.renderEmptyMessage();
|
|
731
|
+
} else {
|
|
732
|
+
content = items.map(function (item, index) {
|
|
733
|
+
// if there's pagination the item's index must be adjusted to the where it is in the whole dataset
|
|
734
|
+
var tableItemIndex = hasPagination(_this4.props) && _this4.props.pagination.pageSize > 0 ? _this4.props.pagination.pageIndex * _this4.props.pagination.pageSize + index : index;
|
|
735
|
+
return _this4.renderItemRow(item, tableItemIndex);
|
|
736
|
+
});
|
|
779
737
|
}
|
|
780
738
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
739
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (theme) {
|
|
740
|
+
return ___EmotionJSX(EuiTableBody, {
|
|
741
|
+
css: loading && euiBasicTableBodyLoading(theme)
|
|
742
|
+
}, content);
|
|
785
743
|
});
|
|
786
|
-
return ___EmotionJSX(EuiTableBody, {
|
|
787
|
-
bodyRef: this.setTbody
|
|
788
|
-
}, rows);
|
|
789
744
|
}
|
|
790
745
|
}, {
|
|
791
|
-
key: "
|
|
792
|
-
value: function
|
|
746
|
+
key: "renderErrorMessage",
|
|
747
|
+
value: function renderErrorMessage(error) {
|
|
793
748
|
var colSpan = this.props.columns.length + (this.props.selection ? 1 : 0);
|
|
794
|
-
return ___EmotionJSX(
|
|
749
|
+
return ___EmotionJSX(EuiTableRow, null, ___EmotionJSX(EuiTableRowCell, {
|
|
795
750
|
align: "center",
|
|
796
751
|
colSpan: colSpan,
|
|
797
752
|
mobileOptions: {
|
|
@@ -800,38 +755,38 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
800
755
|
}, ___EmotionJSX(EuiIcon, {
|
|
801
756
|
type: "minusInCircle",
|
|
802
757
|
color: "danger"
|
|
803
|
-
}), " ", error))
|
|
758
|
+
}), " ", error));
|
|
804
759
|
}
|
|
805
760
|
}, {
|
|
806
|
-
key: "
|
|
807
|
-
value: function
|
|
808
|
-
var _this$
|
|
809
|
-
columns = _this$
|
|
810
|
-
selection = _this$
|
|
811
|
-
noItemsMessage = _this$
|
|
761
|
+
key: "renderEmptyMessage",
|
|
762
|
+
value: function renderEmptyMessage() {
|
|
763
|
+
var _this$props9 = this.props,
|
|
764
|
+
columns = _this$props9.columns,
|
|
765
|
+
selection = _this$props9.selection,
|
|
766
|
+
noItemsMessage = _this$props9.noItemsMessage;
|
|
812
767
|
var colSpan = columns.length + (selection ? 1 : 0);
|
|
813
|
-
return ___EmotionJSX(
|
|
768
|
+
return ___EmotionJSX(EuiTableRow, null, ___EmotionJSX(EuiTableRowCell, {
|
|
814
769
|
align: "center",
|
|
815
770
|
colSpan: colSpan,
|
|
816
771
|
mobileOptions: {
|
|
817
772
|
width: '100%'
|
|
818
773
|
}
|
|
819
|
-
}, noItemsMessage))
|
|
774
|
+
}, noItemsMessage));
|
|
820
775
|
}
|
|
821
776
|
}, {
|
|
822
777
|
key: "renderItemRow",
|
|
823
778
|
value: function renderItemRow(item, rowIndex) {
|
|
824
779
|
var _this5 = this;
|
|
825
780
|
|
|
826
|
-
var _this$
|
|
827
|
-
columns = _this$
|
|
828
|
-
selection = _this$
|
|
829
|
-
isSelectable = _this$
|
|
830
|
-
hasActions = _this$
|
|
831
|
-
rowHeader = _this$
|
|
832
|
-
_this$
|
|
833
|
-
itemIdToExpandedRowMap = _this$
|
|
834
|
-
isExpandable = _this$
|
|
781
|
+
var _this$props10 = this.props,
|
|
782
|
+
columns = _this$props10.columns,
|
|
783
|
+
selection = _this$props10.selection,
|
|
784
|
+
isSelectable = _this$props10.isSelectable,
|
|
785
|
+
hasActions = _this$props10.hasActions,
|
|
786
|
+
rowHeader = _this$props10.rowHeader,
|
|
787
|
+
_this$props10$itemIdT = _this$props10.itemIdToExpandedRowMap,
|
|
788
|
+
itemIdToExpandedRowMap = _this$props10$itemIdT === void 0 ? {} : _this$props10$itemIdT,
|
|
789
|
+
isExpandable = _this$props10.isExpandable;
|
|
835
790
|
var cells = [];
|
|
836
791
|
var itemIdCallback = this.props.itemId;
|
|
837
792
|
var itemId = getItemId(item, itemIdCallback) != null ? getItemId(item, itemIdCallback) : rowIndex;
|
|
@@ -986,7 +941,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
986
941
|
key: key,
|
|
987
942
|
align: "right",
|
|
988
943
|
textOnly: false,
|
|
989
|
-
hasActions: true
|
|
944
|
+
hasActions: true,
|
|
945
|
+
css: euiBasicTableActionsWrapper
|
|
990
946
|
}, tools);
|
|
991
947
|
}
|
|
992
948
|
}, {
|
|
@@ -1071,11 +1027,11 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1071
1027
|
value: function renderPaginationBar() {
|
|
1072
1028
|
var _this8 = this;
|
|
1073
1029
|
|
|
1074
|
-
var _this$
|
|
1075
|
-
error = _this$
|
|
1076
|
-
pagination = _this$
|
|
1077
|
-
tableCaption = _this$
|
|
1078
|
-
onChange = _this$
|
|
1030
|
+
var _this$props11 = this.props,
|
|
1031
|
+
error = _this$props11.error,
|
|
1032
|
+
pagination = _this$props11.pagination,
|
|
1033
|
+
tableCaption = _this$props11.tableCaption,
|
|
1034
|
+
onChange = _this$props11.onChange;
|
|
1079
1035
|
|
|
1080
1036
|
if (!error && pagination && pagination.totalItemCount > 0) {
|
|
1081
1037
|
if (!onChange) {
|
|
@@ -1127,8 +1083,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1127
1083
|
}
|
|
1128
1084
|
|
|
1129
1085
|
return null;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1086
|
+
}
|
|
1132
1087
|
}]);
|
|
1133
1088
|
|
|
1134
1089
|
return EuiBasicTable;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4
|
+
|
|
5
|
+
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)."; }
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
import { css, keyframes } from '@emotion/react';
|
|
15
|
+
import { logicalCSS, euiCantAnimate } from '../../global_styling';
|
|
16
|
+
var tableLoadingLine = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n ", "\n ", "\n }\n\n 20% {\n ", "\n ", "\n }\n\n 80% {\n ", "\n ", "\n }\n\n 100% {\n ", "\n ", "\n }\n"])), logicalCSS('left', 0), logicalCSS('width', 0), logicalCSS('left', 0), logicalCSS('width', '40%'), logicalCSS('left', '60%'), logicalCSS('width', '40%'), logicalCSS('left', '100%'), logicalCSS('width', 0));
|
|
17
|
+
export var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(_ref2) {
|
|
18
|
+
var euiTheme = _ref2.euiTheme;
|
|
19
|
+
return /*#__PURE__*/css("position:relative;overflow:hidden;&::before{position:absolute;content:'';", logicalCSS('width', '100%'), " ", logicalCSS('height', euiTheme.border.width.thick), " background-color:", euiTheme.colors.primary, ";animation:", tableLoadingLine, " 1s linear infinite;", euiCantAnimate, "{animation-duration:2s;}};label:euiBasicTableBodyLoading;");
|
|
20
|
+
}; // Fix to make the loading indicator position correctly in Safari
|
|
21
|
+
// For whatever annoying reason, Safari doesn't respect `position: relative;`
|
|
22
|
+
// on `tbody` without `position: relative` on the parent `table`
|
|
23
|
+
|
|
24
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
25
|
+
name: "6xbnw4-safariLoadingWorkaround",
|
|
26
|
+
styles: "position:relative;label:safariLoadingWorkaround;"
|
|
27
|
+
} : {
|
|
28
|
+
name: "6xbnw4-safariLoadingWorkaround",
|
|
29
|
+
styles: "position:relative;label:safariLoadingWorkaround;",
|
|
30
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export var safariLoadingWorkaround = function safariLoadingWorkaround() {
|
|
34
|
+
return _ref;
|
|
35
|
+
}; // Unsets the extra height caused by tooltip/popover wrappers around table action buttons
|
|
36
|
+
// Without this, the row height jumps whenever actions are disabled
|
|
37
|
+
|
|
38
|
+
export var euiBasicTableActionsWrapper = process.env.NODE_ENV === "production" ? {
|
|
39
|
+
name: "1mshepa-euiBasicTableActionsWrapper",
|
|
40
|
+
styles: "line-height:1;label:euiBasicTableActionsWrapper;"
|
|
41
|
+
} : {
|
|
42
|
+
name: "1mshepa-euiBasicTableActionsWrapper",
|
|
43
|
+
styles: "line-height:1;label:euiBasicTableActionsWrapper;",
|
|
44
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
45
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "title", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
1
|
+
var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || 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
|
|
|
@@ -43,6 +43,7 @@ export var CANCEL_BUTTON = 'cancel';
|
|
|
43
43
|
export var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
44
44
|
var children = _ref.children,
|
|
45
45
|
title = _ref.title,
|
|
46
|
+
titleProps = _ref.titleProps,
|
|
46
47
|
onCancel = _ref.onCancel,
|
|
47
48
|
onConfirm = _ref.onConfirm,
|
|
48
49
|
cancelButtonText = _ref.cancelButtonText,
|
|
@@ -94,9 +95,9 @@ export var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
|
94
95
|
var modalTitle;
|
|
95
96
|
|
|
96
97
|
if (title) {
|
|
97
|
-
modalTitle = ___EmotionJSX(EuiModalHeader, null, ___EmotionJSX(EuiModalHeaderTitle, {
|
|
98
|
+
modalTitle = ___EmotionJSX(EuiModalHeader, null, ___EmotionJSX(EuiModalHeaderTitle, _extends({
|
|
98
99
|
"data-test-subj": "confirmModalTitleText"
|
|
99
|
-
}, title));
|
|
100
|
+
}, titleProps), title));
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
var message;
|
|
@@ -133,6 +134,7 @@ EuiConfirmModal.propTypes = {
|
|
|
133
134
|
*/
|
|
134
135
|
children: PropTypes.node,
|
|
135
136
|
title: PropTypes.node,
|
|
137
|
+
titleProps: PropTypes.any,
|
|
136
138
|
cancelButtonText: PropTypes.node,
|
|
137
139
|
confirmButtonText: PropTypes.node,
|
|
138
140
|
onCancel: PropTypes.func.isRequired,
|
|
@@ -44,7 +44,7 @@ var Modal = function Modal() {
|
|
|
44
44
|
};
|
|
45
45
|
return ___EmotionJSX("div", null, ___EmotionJSX(EuiButton, {
|
|
46
46
|
onClick: showModal
|
|
47
|
-
}, "Show confirm modal"), isModalVisible && ___EmotionJSX(EuiModal, modalProps, ___EmotionJSX(EuiModalHeader, null, ___EmotionJSX(EuiModalHeaderTitle, null,
|
|
47
|
+
}, "Show confirm modal"), isModalVisible && ___EmotionJSX(EuiModal, modalProps, ___EmotionJSX(EuiModalHeader, null, ___EmotionJSX(EuiModalHeaderTitle, null, "Title of modal")), ___EmotionJSX(EuiModalBody, null, ___EmotionJSX("p", null, "This is a simple modal body")), ___EmotionJSX(EuiModalFooter, null, ___EmotionJSX(EuiButton, {
|
|
48
48
|
onClick: closeModal,
|
|
49
49
|
fill: true
|
|
50
50
|
}, "Close"))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "children"];
|
|
1
|
+
var _excluded = ["className", "children", "component"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || 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
|
|
|
@@ -21,17 +21,26 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
21
21
|
export var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
|
|
22
22
|
var className = _ref.className,
|
|
23
23
|
children = _ref.children,
|
|
24
|
+
_ref$component = _ref.component,
|
|
25
|
+
Component = _ref$component === void 0 ? 'h1' : _ref$component,
|
|
24
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
27
|
|
|
26
28
|
var classes = classnames('euiModalHeader__title', className);
|
|
27
29
|
return ___EmotionJSX(EuiTitle, _extends({
|
|
28
30
|
size: "m",
|
|
29
31
|
className: classes
|
|
30
|
-
}, rest),
|
|
32
|
+
}, rest), ___EmotionJSX(Component, null, children));
|
|
31
33
|
};
|
|
32
34
|
EuiModalHeaderTitle.propTypes = {
|
|
33
35
|
className: PropTypes.string,
|
|
34
36
|
"aria-label": PropTypes.string,
|
|
35
37
|
"data-test-subj": PropTypes.string,
|
|
36
|
-
css: PropTypes.any
|
|
38
|
+
css: PropTypes.any,
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The tag to render. Can be changed to a lower heading
|
|
42
|
+
* level like `h2` or a container `div`.
|
|
43
|
+
* @default h1
|
|
44
|
+
*/
|
|
45
|
+
component: PropTypes.any
|
|
37
46
|
};
|
|
@@ -303,6 +303,11 @@ EuiResizablePanel.propTypes = {
|
|
|
303
303
|
*/
|
|
304
304
|
style: PropTypes.any,
|
|
305
305
|
|
|
306
|
+
/**
|
|
307
|
+
* tabIndex={0} provides full keyboard access when content overflows `<EuiResizablePanel />`
|
|
308
|
+
*/
|
|
309
|
+
tabIndex: PropTypes.number,
|
|
310
|
+
|
|
306
311
|
/**
|
|
307
312
|
* Props to add to the wrapping `.euiResizablePanel` div
|
|
308
313
|
*/
|
|
@@ -10,20 +10,14 @@
|
|
|
10
10
|
* Secures outbound links. For more info:
|
|
11
11
|
* https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
|
|
12
12
|
*/
|
|
13
|
-
import { isDomainSecure } from '../url';
|
|
14
13
|
export var getSecureRelForTarget = function getSecureRelForTarget(_ref) {
|
|
15
|
-
var
|
|
16
|
-
_ref$target = _ref.target,
|
|
14
|
+
var _ref$target = _ref.target,
|
|
17
15
|
target = _ref$target === void 0 ? '' : _ref$target,
|
|
18
16
|
rel = _ref.rel;
|
|
19
|
-
var isElasticHref = !!href && isDomainSecure(href);
|
|
20
17
|
var relParts = !!rel ? rel.split(' ').filter(function (part) {
|
|
21
18
|
return !!part.length && part !== 'noreferrer';
|
|
22
19
|
}) : [];
|
|
23
|
-
|
|
24
|
-
if (!isElasticHref) {
|
|
25
|
-
relParts.push('noreferrer');
|
|
26
|
-
}
|
|
20
|
+
relParts.push('noreferrer');
|
|
27
21
|
|
|
28
22
|
if (target.includes('_blank') && relParts.indexOf('noopener') === -1) {
|
|
29
23
|
relParts.push('noopener');
|
|
@@ -12,6 +12,10 @@ import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext, defaultC
|
|
|
12
12
|
import { getEuiDevProviderWarning } from './provider';
|
|
13
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
14
|
var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
|
|
15
|
+
/**
|
|
16
|
+
* Hook for function components
|
|
17
|
+
*/
|
|
18
|
+
|
|
15
19
|
export var useEuiTheme = function useEuiTheme() {
|
|
16
20
|
var theme = useContext(EuiThemeContext);
|
|
17
21
|
var colorMode = useContext(EuiColorModeContext);
|
|
@@ -46,6 +50,10 @@ export var useEuiTheme = function useEuiTheme() {
|
|
|
46
50
|
}, [theme, colorMode, modifications]);
|
|
47
51
|
return assembledTheme;
|
|
48
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* HOC for class components
|
|
55
|
+
*/
|
|
56
|
+
|
|
49
57
|
// Provide the component props interface as the generic to allow the docs props table to populate.
|
|
50
58
|
// e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
|
|
51
59
|
export var withEuiTheme = function withEuiTheme(Component) {
|
|
@@ -62,4 +70,14 @@ export var withEuiTheme = function withEuiTheme(Component) {
|
|
|
62
70
|
var WithEuiTheme = /*#__PURE__*/forwardRef(Render);
|
|
63
71
|
WithEuiTheme.displayName = componentName;
|
|
64
72
|
return WithEuiTheme;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Render prop alternative for complex class components
|
|
76
|
+
* Most useful for scenarios where a HOC may interfere with typing
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
export var RenderWithEuiTheme = function RenderWithEuiTheme(_ref) {
|
|
80
|
+
var children = _ref.children;
|
|
81
|
+
var theme = useEuiTheme();
|
|
82
|
+
return children(theme);
|
|
65
83
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
export { EuiSystemContext, EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
9
|
-
export { useEuiTheme, withEuiTheme } from './hooks';
|
|
9
|
+
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme } from './hooks';
|
|
10
10
|
export { EuiThemeProvider, getEuiDevProviderWarning, setEuiDevProviderWarning } from './provider';
|
|
11
11
|
export { buildTheme, computed, isInverseColorMode, getColorMode, getComputed, getOn, mergeDeep, setOn, Computed } from './utils';
|
|
12
12
|
export { COLOR_MODES_STANDARD } from './types';
|
package/eui.d.ts
CHANGED
|
@@ -6946,7 +6946,7 @@ declare module '@elastic/eui/src/global_styling/functions/size' {
|
|
|
6946
6946
|
declare module '@elastic/eui/src/services/theme/provider' {
|
|
6947
6947
|
import React, { PropsWithChildren } from 'react';
|
|
6948
6948
|
import { EuiThemeColorMode, EuiThemeSystem, EuiThemeModifications } from '@elastic/eui/src/services/theme/types'; type LEVELS = 'log' | 'warn' | 'error';
|
|
6949
|
-
export const setEuiDevProviderWarning: (level: LEVELS) => LEVELS;
|
|
6949
|
+
export const setEuiDevProviderWarning: (level: LEVELS | undefined) => LEVELS | undefined;
|
|
6950
6950
|
export const getEuiDevProviderWarning: () => LEVELS | undefined;
|
|
6951
6951
|
export interface EuiThemeProviderProps<T> {
|
|
6952
6952
|
theme?: EuiThemeSystem<T>;
|
|
@@ -6961,16 +6961,29 @@ declare module '@elastic/eui/src/services/theme/provider' {
|
|
|
6961
6961
|
declare module '@elastic/eui/src/services/theme/hooks' {
|
|
6962
6962
|
import React from 'react';
|
|
6963
6963
|
import { EuiThemeColorModeStandard, EuiThemeModifications, EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
6964
|
+
/**
|
|
6965
|
+
* Hook for function components
|
|
6966
|
+
*/
|
|
6964
6967
|
export interface UseEuiTheme<T extends {} = {}> {
|
|
6965
6968
|
euiTheme: EuiThemeComputed<T>;
|
|
6966
6969
|
colorMode: EuiThemeColorModeStandard;
|
|
6967
6970
|
modifications: EuiThemeModifications<T>;
|
|
6968
6971
|
}
|
|
6969
6972
|
export const useEuiTheme: <T extends {} = {}>() => UseEuiTheme<T>;
|
|
6973
|
+
/**
|
|
6974
|
+
* HOC for class components
|
|
6975
|
+
*/
|
|
6970
6976
|
export interface WithEuiThemeProps<P extends {} = {}> {
|
|
6971
6977
|
theme: UseEuiTheme<P>;
|
|
6972
6978
|
}
|
|
6973
6979
|
export const withEuiTheme: <T extends {} = {}, U extends {} = {}>(Component: React.ComponentType<T & WithEuiThemeProps<U>>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<T, "theme">> & React.RefAttributes<Omit<T, "theme">>>;
|
|
6980
|
+
/**
|
|
6981
|
+
* Render prop alternative for complex class components
|
|
6982
|
+
* Most useful for scenarios where a HOC may interfere with typing
|
|
6983
|
+
*/
|
|
6984
|
+
export const RenderWithEuiTheme: <T extends {} = {}>({ children, }: {
|
|
6985
|
+
children: (theme: UseEuiTheme) => React.ReactElement;
|
|
6986
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
6974
6987
|
|
|
6975
6988
|
}
|
|
6976
6989
|
declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
@@ -7079,7 +7092,7 @@ declare module '@elastic/eui/src/services/theme/context' {
|
|
|
7079
7092
|
declare module '@elastic/eui/src/services/theme' {
|
|
7080
7093
|
export { EuiSystemContext, EuiThemeContext, EuiModificationsContext, EuiColorModeContext, } from '@elastic/eui/src/services/theme/context';
|
|
7081
7094
|
export type { UseEuiTheme, WithEuiThemeProps } from '@elastic/eui/src/services/theme/hooks';
|
|
7082
|
-
export { useEuiTheme, withEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
7095
|
+
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
7083
7096
|
export type { EuiThemeProviderProps } from '@elastic/eui/src/services/theme/provider';
|
|
7084
7097
|
export { EuiThemeProvider, getEuiDevProviderWarning, setEuiDevProviderWarning, } from '@elastic/eui/src/services/theme/provider';
|
|
7085
7098
|
export { buildTheme, computed, isInverseColorMode, getColorMode, getComputed, getOn, mergeDeep, setOn, Computed, } from '@elastic/eui/src/services/theme/utils';
|
|
@@ -7383,13 +7396,13 @@ declare module '@elastic/eui/src/services/random' {
|
|
|
7383
7396
|
}) => moment.Moment;
|
|
7384
7397
|
}
|
|
7385
7398
|
|
|
7386
|
-
}
|
|
7387
|
-
declare module '@elastic/eui/src/services/url' {
|
|
7388
|
-
export const isDomainSecure: (url?: string) => boolean;
|
|
7389
|
-
|
|
7390
7399
|
}
|
|
7391
7400
|
declare module '@elastic/eui/src/services/security/get_secure_rel_for_target' {
|
|
7392
|
-
|
|
7401
|
+
/**
|
|
7402
|
+
* Secures outbound links. For more info:
|
|
7403
|
+
* https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
|
|
7404
|
+
*/
|
|
7405
|
+
export const getSecureRelForTarget: ({ target, rel, }: {
|
|
7393
7406
|
href?: string | undefined;
|
|
7394
7407
|
target?: string | undefined;
|
|
7395
7408
|
rel?: string | undefined;
|
|
@@ -15864,9 +15877,16 @@ declare module '@elastic/eui/src/components/modal/modal_header' {
|
|
|
15864
15877
|
|
|
15865
15878
|
}
|
|
15866
15879
|
declare module '@elastic/eui/src/components/modal/modal_header_title' {
|
|
15867
|
-
import { FunctionComponent, HTMLAttributes } from 'react';
|
|
15880
|
+
import { FunctionComponent, HTMLAttributes, ElementType } from 'react';
|
|
15868
15881
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
15869
|
-
export type EuiModalHeaderTitleProps = FunctionComponent<HTMLAttributes<
|
|
15882
|
+
export type EuiModalHeaderTitleProps = FunctionComponent<HTMLAttributes<HTMLHeadingElement> & CommonProps & {
|
|
15883
|
+
/**
|
|
15884
|
+
* The tag to render. Can be changed to a lower heading
|
|
15885
|
+
* level like `h2` or a container `div`.
|
|
15886
|
+
* @default h1
|
|
15887
|
+
*/
|
|
15888
|
+
component?: ElementType;
|
|
15889
|
+
}>;
|
|
15870
15890
|
export const EuiModalHeaderTitle: EuiModalHeaderTitleProps;
|
|
15871
15891
|
|
|
15872
15892
|
}
|
|
@@ -15886,8 +15906,9 @@ declare module '@elastic/eui/src/components/modal/modal_body' {
|
|
|
15886
15906
|
|
|
15887
15907
|
}
|
|
15888
15908
|
declare module '@elastic/eui/src/components/modal/confirm_modal' {
|
|
15889
|
-
import React, { FunctionComponent, ReactNode } from 'react';
|
|
15909
|
+
import React, { FunctionComponent, ComponentProps, ReactNode } from 'react';
|
|
15890
15910
|
import { EuiModalProps } from '@elastic/eui/src/components/modal/modal';
|
|
15911
|
+
import { EuiModalHeaderTitleProps } from '@elastic/eui/src/components/modal/modal_header_title';
|
|
15891
15912
|
import { EuiButtonColor } from '@elastic/eui/src/components/button';
|
|
15892
15913
|
export interface EuiConfirmModalProps extends Omit<EuiModalProps, 'children' | 'onClose' | 'title'> {
|
|
15893
15914
|
/**
|
|
@@ -15895,6 +15916,7 @@ declare module '@elastic/eui/src/components/modal/confirm_modal' {
|
|
|
15895
15916
|
*/
|
|
15896
15917
|
children?: ReactNode;
|
|
15897
15918
|
title?: ReactNode;
|
|
15919
|
+
titleProps?: ComponentProps<EuiModalHeaderTitleProps>;
|
|
15898
15920
|
cancelButtonText?: ReactNode;
|
|
15899
15921
|
confirmButtonText?: ReactNode;
|
|
15900
15922
|
onCancel: (event?: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -20006,6 +20028,13 @@ declare module '@elastic/eui/src/components/basic_table/expanded_item_actions' {
|
|
|
20006
20028
|
}
|
|
20007
20029
|
export const ExpandedItemActions: <T extends {}>({ actions, itemId, item, actionEnabled, className, }: ExpandedItemActionsProps<T>) => ReactElement;
|
|
20008
20030
|
|
|
20031
|
+
}
|
|
20032
|
+
declare module '@elastic/eui/src/components/basic_table/basic_table.styles' {
|
|
20033
|
+
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
20034
|
+
export const euiBasicTableBodyLoading: ({ euiTheme }: UseEuiTheme) => import("@emotion/utils").SerializedStyles;
|
|
20035
|
+
export const safariLoadingWorkaround: () => import("@emotion/utils").SerializedStyles;
|
|
20036
|
+
export const euiBasicTableActionsWrapper: import("@emotion/utils").SerializedStyles;
|
|
20037
|
+
|
|
20009
20038
|
}
|
|
20010
20039
|
declare module '@elastic/eui/src/components/basic_table/basic_table' {
|
|
20011
20040
|
import { Component, HTMLAttributes, ReactNode } from 'react';
|
|
@@ -20140,17 +20169,11 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
|
|
|
20140
20169
|
static getDerivedStateFromProps<T>(nextProps: EuiBasicTableProps<T>, prevState: State<T>): {
|
|
20141
20170
|
selection: T[];
|
|
20142
20171
|
} | null;
|
|
20143
|
-
private cleanups;
|
|
20144
|
-
private tbody;
|
|
20145
20172
|
constructor(props: EuiBasicTableProps<T>);
|
|
20146
20173
|
componentDidMount(): void;
|
|
20147
|
-
componentDidUpdate(
|
|
20148
|
-
componentWillUnmount(): void;
|
|
20174
|
+
componentDidUpdate(): void;
|
|
20149
20175
|
getInitialSelection(): void;
|
|
20150
20176
|
setSelection(newSelection: T[]): void;
|
|
20151
|
-
private setTbody;
|
|
20152
|
-
private addLoadingListeners;
|
|
20153
|
-
private removeLoadingListeners;
|
|
20154
20177
|
buildCriteria(props: EuiBasicTableProps<T>): Criteria<T>;
|
|
20155
20178
|
changeSelection(selection: T[]): void;
|
|
20156
20179
|
clearSelection(): void;
|
|
@@ -20167,8 +20190,8 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
|
|
|
20167
20190
|
renderTableHead(): JSX.Element;
|
|
20168
20191
|
renderTableFooter(): JSX.Element | null;
|
|
20169
20192
|
renderTableBody(): JSX.Element;
|
|
20170
|
-
|
|
20171
|
-
|
|
20193
|
+
renderErrorMessage(error: string): JSX.Element;
|
|
20194
|
+
renderEmptyMessage(): JSX.Element;
|
|
20172
20195
|
renderItemRow(item: T, rowIndex: number): JSX.Element;
|
|
20173
20196
|
renderItemSelectionCell(itemId: ItemId<T>, item: T, selected: boolean): JSX.Element;
|
|
20174
20197
|
renderItemActionsCell(itemId: ItemIdResolved, item: T, column: EuiTableActionsColumnType<T>, columnIndex: number): JSX.Element;
|
|
@@ -20777,6 +20800,10 @@ declare module '@elastic/eui/src/components/resizable_container/resizable_panel'
|
|
|
20777
20800
|
* Custom CSS properties applied to the wrapping `.euiResizablePanel` div
|
|
20778
20801
|
*/
|
|
20779
20802
|
style?: CSSProperties;
|
|
20803
|
+
/**
|
|
20804
|
+
* tabIndex={0} provides full keyboard access when content overflows `<EuiResizablePanel />`
|
|
20805
|
+
*/
|
|
20806
|
+
tabIndex?: number;
|
|
20780
20807
|
/**
|
|
20781
20808
|
* Props to add to the wrapping `.euiResizablePanel` div
|
|
20782
20809
|
*/
|