@elastic/eui 109.1.0 → 110.0.0-snapshot.1764684698664
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/es/components/basic_table/basic_table.js +4 -1
- package/es/components/basic_table/in_memory_table.js +86 -233
- package/es/components/breadcrumbs/_breadcrumb_content.js +3 -0
- package/es/components/breadcrumbs/breadcrumbs.js +3 -0
- package/es/components/button/button_group/button_group.styles.js +2 -2
- package/es/components/button/button_group/button_group_button.styles.js +1 -1
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -2
- package/es/components/date_picker/super_date_picker/date_popover/relative_tab.js +5 -1
- package/es/components/date_picker/super_date_picker/date_popover/timezone_display.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/index.js +1 -0
- package/es/components/date_picker/super_date_picker/super_date_picker.js +35 -17
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/es/components/date_picker/super_date_picker/time_window_buttons.js +1 -1
- package/es/components/filter_group/filter_group.a11y.js +1 -1
- package/es/components/flex/flex_item.js +6 -4
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -0
- package/es/components/header/header_links/header_links.js +3 -0
- package/es/components/header/header_logo/header_logo.js +6 -1
- package/es/components/header/header_logo/header_logo.styles.js +1 -1
- package/es/components/icon/icon.styles.js +4 -4
- package/es/components/page/page.js +11 -3
- package/es/components/page/page.styles.js +1 -2
- package/es/components/page/page_header/page_header.js +11 -3
- package/es/components/page/page_header/page_header_content.js +3 -0
- package/es/components/page_template/outer/page_outer.js +2 -3
- package/es/components/page_template/outer/page_outer.styles.js +29 -35
- package/es/components/page_template/page_template.js +8 -2
- package/es/components/popover/input_popover.js +4 -1
- package/es/components/popover/popover.js +7 -4
- package/es/components/search_bar/search_bar.js +4 -4
- package/es/components/selectable/selectable.js +7 -2
- package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/es/components/table/_table_cell_content.styles.js +4 -4
- package/es/components/table/table.js +16 -3
- package/es/components/table/table.styles.js +2 -1
- package/es/components/table/table_cells_shared.styles.js +4 -1
- package/es/components/table/table_context.js +12 -0
- package/es/components/table/table_footer_cell.js +6 -2
- package/es/components/table/table_row.js +5 -2
- package/es/components/table/table_row.styles.js +22 -6
- package/es/components/table/table_row_cell.styles.js +3 -3
- package/es/components/tool_tip/tool_tip_anchor.js +8 -0
- package/es/components/tour/tour_step.js +9 -3
- package/es/global_styling/mixins/_button.js +4 -3
- package/es/global_styling/mixins/_typography.js +9 -0
- package/es/services/string/to_initials.js +26 -4
- package/eui.d.ts +75 -29
- package/lib/components/basic_table/basic_table.js +4 -1
- package/lib/components/basic_table/in_memory_table.js +85 -234
- package/lib/components/breadcrumbs/_breadcrumb_content.js +3 -0
- package/lib/components/button/button_group/button_group.styles.js +1 -1
- package/lib/components/button/button_group/button_group_button.styles.js +1 -1
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -2
- package/lib/components/date_picker/super_date_picker/date_popover/relative_tab.js +5 -1
- package/lib/components/date_picker/super_date_picker/date_popover/timezone_display.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/index.js +7 -0
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +34 -16
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/lib/components/date_picker/super_date_picker/time_window_buttons.js +1 -1
- package/lib/components/filter_group/filter_group.a11y.js +1 -1
- package/lib/components/flex/flex_item.js +6 -4
- package/lib/components/header/header_logo/header_logo.js +6 -1
- package/lib/components/header/header_logo/header_logo.styles.js +1 -1
- package/lib/components/icon/icon.styles.js +4 -4
- package/lib/components/page/page.js +10 -2
- package/lib/components/page/page.styles.js +1 -2
- package/lib/components/page/page_header/page_header.js +10 -2
- package/lib/components/page_template/outer/page_outer.js +1 -2
- package/lib/components/page_template/outer/page_outer.styles.js +29 -35
- package/lib/components/page_template/page_template.js +8 -2
- package/lib/components/popover/input_popover.js +4 -1
- package/lib/components/popover/popover.js +7 -4
- package/lib/components/search_bar/search_bar.js +4 -4
- package/lib/components/selectable/selectable.js +7 -2
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/lib/components/table/_table_cell_content.styles.js +4 -4
- package/lib/components/table/table.js +16 -3
- package/lib/components/table/table.styles.js +2 -1
- package/lib/components/table/table_cells_shared.styles.js +4 -1
- package/lib/components/table/table_context.js +18 -0
- package/lib/components/table/table_footer_cell.js +9 -2
- package/lib/components/table/table_row.js +8 -2
- package/lib/components/table/table_row.styles.js +20 -4
- package/lib/components/table/table_row_cell.styles.js +3 -3
- package/lib/components/tool_tip/tool_tip_anchor.js +8 -0
- package/lib/components/tour/tour_step.js +6 -3
- package/lib/global_styling/mixins/_button.js +4 -3
- package/lib/global_styling/mixins/_typography.js +10 -1
- package/lib/services/string/to_initials.js +26 -4
- package/optimize/es/components/basic_table/basic_table.js +4 -1
- package/optimize/es/components/basic_table/in_memory_table.js +73 -46
- package/optimize/es/components/button/button_group/button_group.styles.js +2 -2
- package/optimize/es/components/button/button_group/button_group_button.styles.js +1 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/relative_tab.js +5 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/timezone_display.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/index.js +1 -0
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +35 -17
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/optimize/es/components/date_picker/super_date_picker/time_window_buttons.js +1 -1
- package/optimize/es/components/filter_group/filter_group.a11y.js +1 -1
- package/optimize/es/components/flex/flex_item.js +6 -4
- package/optimize/es/components/header/header_logo/header_logo.js +6 -1
- package/optimize/es/components/header/header_logo/header_logo.styles.js +1 -1
- package/optimize/es/components/icon/icon.styles.js +4 -4
- package/optimize/es/components/page/page.js +6 -3
- package/optimize/es/components/page/page.styles.js +1 -2
- package/optimize/es/components/page/page_header/page_header.js +6 -3
- package/optimize/es/components/page_template/outer/page_outer.js +2 -3
- package/optimize/es/components/page_template/outer/page_outer.styles.js +29 -35
- package/optimize/es/components/page_template/page_template.js +2 -1
- package/optimize/es/components/popover/input_popover.js +4 -1
- package/optimize/es/components/popover/popover.js +4 -4
- package/optimize/es/components/selectable/selectable.js +7 -2
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/optimize/es/components/table/_table_cell_content.styles.js +4 -4
- package/optimize/es/components/table/table.js +10 -3
- package/optimize/es/components/table/table.styles.js +2 -1
- package/optimize/es/components/table/table_cells_shared.styles.js +4 -1
- package/optimize/es/components/table/table_context.js +12 -0
- package/optimize/es/components/table/table_footer_cell.js +6 -2
- package/optimize/es/components/table/table_row.js +5 -2
- package/optimize/es/components/table/table_row.styles.js +22 -6
- package/optimize/es/components/table/table_row_cell.styles.js +3 -3
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +8 -0
- package/optimize/es/components/tour/tour_step.js +4 -2
- package/optimize/es/global_styling/mixins/_button.js +4 -3
- package/optimize/es/global_styling/mixins/_typography.js +9 -0
- package/optimize/es/services/string/to_initials.js +26 -4
- package/optimize/lib/components/basic_table/basic_table.js +4 -1
- package/optimize/lib/components/basic_table/in_memory_table.js +72 -47
- package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +1 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/relative_tab.js +5 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/timezone_display.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/index.js +7 -0
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +34 -16
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/optimize/lib/components/date_picker/super_date_picker/time_window_buttons.js +1 -1
- package/optimize/lib/components/filter_group/filter_group.a11y.js +1 -1
- package/optimize/lib/components/flex/flex_item.js +6 -4
- package/optimize/lib/components/header/header_logo/header_logo.js +6 -1
- package/optimize/lib/components/header/header_logo/header_logo.styles.js +1 -1
- package/optimize/lib/components/icon/icon.styles.js +4 -4
- package/optimize/lib/components/page/page.js +5 -2
- package/optimize/lib/components/page/page.styles.js +1 -2
- package/optimize/lib/components/page/page_header/page_header.js +5 -2
- package/optimize/lib/components/page_template/outer/page_outer.js +1 -2
- package/optimize/lib/components/page_template/outer/page_outer.styles.js +29 -35
- package/optimize/lib/components/page_template/page_template.js +2 -1
- package/optimize/lib/components/popover/input_popover.js +4 -1
- package/optimize/lib/components/popover/popover.js +4 -4
- package/optimize/lib/components/selectable/selectable.js +7 -2
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/optimize/lib/components/table/_table_cell_content.styles.js +4 -4
- package/optimize/lib/components/table/table.js +10 -3
- package/optimize/lib/components/table/table.styles.js +2 -1
- package/optimize/lib/components/table/table_cells_shared.styles.js +4 -1
- package/optimize/lib/components/table/table_context.js +18 -0
- package/optimize/lib/components/table/table_footer_cell.js +9 -2
- package/optimize/lib/components/table/table_row.js +8 -2
- package/optimize/lib/components/table/table_row.styles.js +20 -4
- package/optimize/lib/components/table/table_row_cell.styles.js +3 -3
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +8 -0
- package/optimize/lib/components/tour/tour_step.js +4 -2
- package/optimize/lib/global_styling/mixins/_button.js +4 -3
- package/optimize/lib/global_styling/mixins/_typography.js +10 -1
- package/optimize/lib/services/string/to_initials.js +26 -4
- package/package.json +6 -5
- package/test-env/components/basic_table/basic_table.js +4 -1
- package/test-env/components/basic_table/in_memory_table.js +85 -234
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +3 -0
- package/test-env/components/button/button_group/button_group.styles.js +1 -1
- package/test-env/components/button/button_group/button_group_button.styles.js +1 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -2
- package/test-env/components/date_picker/super_date_picker/date_popover/relative_tab.js +5 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/timezone_display.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/index.js +7 -0
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +34 -16
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -3
- package/test-env/components/date_picker/super_date_picker/time_window_buttons.js +1 -1
- package/test-env/components/filter_group/filter_group.a11y.js +1 -1
- package/test-env/components/flex/flex_item.js +6 -4
- package/test-env/components/header/header_logo/header_logo.js +6 -1
- package/test-env/components/header/header_logo/header_logo.styles.js +1 -1
- package/test-env/components/icon/icon.styles.js +4 -4
- package/test-env/components/page/page.js +10 -2
- package/test-env/components/page/page.styles.js +1 -2
- package/test-env/components/page/page_header/page_header.js +10 -2
- package/test-env/components/page_template/outer/page_outer.js +1 -2
- package/test-env/components/page_template/outer/page_outer.styles.js +29 -35
- package/test-env/components/page_template/page_template.js +8 -2
- package/test-env/components/popover/input_popover.js +4 -1
- package/test-env/components/popover/popover.js +7 -4
- package/test-env/components/search_bar/search_bar.js +4 -4
- package/test-env/components/selectable/selectable.js +7 -2
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -0
- package/test-env/components/table/_table_cell_content.styles.js +4 -4
- package/test-env/components/table/table.js +16 -3
- package/test-env/components/table/table.styles.js +2 -1
- package/test-env/components/table/table_cells_shared.styles.js +4 -1
- package/test-env/components/table/table_context.js +18 -0
- package/test-env/components/table/table_footer_cell.js +9 -2
- package/test-env/components/table/table_row.js +8 -2
- package/test-env/components/table/table_row.styles.js +20 -4
- package/test-env/components/table/table_row_cell.styles.js +3 -3
- package/test-env/components/tool_tip/tool_tip_anchor.js +8 -0
- package/test-env/components/tour/tour_step.js +6 -3
- package/test-env/global_styling/mixins/_button.js +4 -3
- package/test-env/global_styling/mixins/_typography.js +10 -1
- package/test-env/services/string/to_initials.js +26 -4
|
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
var _excluded = ["schema"],
|
|
10
10
|
_excluded2 = ["onChange"],
|
|
11
|
-
_excluded3 = ["columns", "loading", "
|
|
11
|
+
_excluded3 = ["columns", "loading", "noItemsMessage", "error", "selection", "compressed", "pagination", "sorting", "itemIdToExpandedRowMap", "itemId", "rowProps", "cellProps", "tableLayout", "items", "search", "searchFormat", "onTableChange", "executeQueryOptions", "allowNeutralSort", "childrenBetween"];
|
|
12
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -30,21 +30,33 @@ import { EuiSearchBox } from '../search_bar/search_box';
|
|
|
30
30
|
import { EuiSpacer } from '../spacer';
|
|
31
31
|
import { euiTablePaginationDefaults } from '../table/table_pagination';
|
|
32
32
|
import { EuiComponentDefaultsContext } from '../provider/component_defaults';
|
|
33
|
+
|
|
34
|
+
// allows `query: null` in the onChange callback when using `searchFormat="text"`
|
|
33
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
34
36
|
function isEuiSearchBarProps(x) {
|
|
35
37
|
return typeof x !== 'boolean';
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Extracts and formats a query from search props based on the search format
|
|
41
|
+
* @param search - The search configuration
|
|
42
|
+
* @param defaultQuery - Whether to use the defaultQuery property as fallback
|
|
43
|
+
* @param searchFormat - The search format: 'eql' for parsed queries, 'text' for plain text
|
|
44
|
+
* @returns Formatted query string or Query object
|
|
45
|
+
*/
|
|
46
|
+
var getQueryFromSearch = function getQueryFromSearch(search, defaultQuery, searchFormat) {
|
|
47
|
+
var _ref, _searchProps$defaultQ, _searchProps$query;
|
|
39
48
|
if (!search) {
|
|
40
|
-
|
|
41
|
-
} else {
|
|
42
|
-
query = (defaultQuery ? search.defaultQuery || search.query || '' : search.query) || '';
|
|
49
|
+
return searchFormat === 'text' ? '""' : '';
|
|
43
50
|
}
|
|
44
|
-
|
|
51
|
+
var searchProps = search;
|
|
52
|
+
var queryString = defaultQuery ? (_ref = (_searchProps$defaultQ = searchProps.defaultQuery) !== null && _searchProps$defaultQ !== void 0 ? _searchProps$defaultQ : searchProps.query) !== null && _ref !== void 0 ? _ref : '' : (_searchProps$query = searchProps.query) !== null && _searchProps$query !== void 0 ? _searchProps$query : '';
|
|
53
|
+
if (searchFormat === 'text') {
|
|
54
|
+
return "\"".concat(queryString, "\"");
|
|
55
|
+
}
|
|
56
|
+
return isString(queryString) ? EuiSearchBar.Query.parse(queryString) : queryString;
|
|
45
57
|
};
|
|
46
58
|
var getInitialPagination = function getInitialPagination(pagination, consumerDefaults) {
|
|
47
|
-
var
|
|
59
|
+
var _ref3, _pagination$pageIndex, _ref4, _pagination$pageSize;
|
|
48
60
|
if (!pagination) {
|
|
49
61
|
return {
|
|
50
62
|
pageIndex: undefined,
|
|
@@ -52,14 +64,14 @@ var getInitialPagination = function getInitialPagination(pagination, consumerDef
|
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
66
|
var defaults = _objectSpread(_objectSpread({}, euiTablePaginationDefaults), consumerDefaults);
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
pageSizeOptions =
|
|
58
|
-
|
|
59
|
-
showPerPageOptions =
|
|
67
|
+
var _ref2 = pagination,
|
|
68
|
+
_ref2$pageSizeOptions = _ref2.pageSizeOptions,
|
|
69
|
+
pageSizeOptions = _ref2$pageSizeOptions === void 0 ? defaults.itemsPerPageOptions : _ref2$pageSizeOptions,
|
|
70
|
+
_ref2$showPerPageOpti = _ref2.showPerPageOptions,
|
|
71
|
+
showPerPageOptions = _ref2$showPerPageOpti === void 0 ? defaults.showPerPageOptions : _ref2$showPerPageOpti;
|
|
60
72
|
var defaultPageSize = pageSizeOptions !== null && pageSizeOptions !== void 0 && pageSizeOptions.includes(defaults.itemsPerPage) ? defaults.itemsPerPage : pageSizeOptions[0];
|
|
61
|
-
var initialPageIndex = pagination === true ? 0 : (
|
|
62
|
-
var initialPageSize = pagination === true ? defaultPageSize : (
|
|
73
|
+
var initialPageIndex = pagination === true ? 0 : (_ref3 = (_pagination$pageIndex = pagination.pageIndex) !== null && _pagination$pageIndex !== void 0 ? _pagination$pageIndex : pagination.initialPageIndex) !== null && _ref3 !== void 0 ? _ref3 : 0;
|
|
74
|
+
var initialPageSize = pagination === true ? defaultPageSize : (_ref4 = (_pagination$pageSize = pagination.pageSize) !== null && _pagination$pageSize !== void 0 ? _pagination$pageSize : pagination.initialPageSize) !== null && _ref4 !== void 0 ? _ref4 : defaultPageSize;
|
|
63
75
|
if (showPerPageOptions && initialPageSize != null && !(pageSizeOptions !== null && pageSizeOptions !== void 0 && pageSizeOptions.includes(initialPageSize))) {
|
|
64
76
|
throw new Error("EuiInMemoryTable received initialPageSize ".concat(initialPageSize, ", which wasn't provided within pageSizeOptions."));
|
|
65
77
|
}
|
|
@@ -112,15 +124,16 @@ function getInitialSorting(columns, sorting) {
|
|
|
112
124
|
}
|
|
113
125
|
export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
114
126
|
function EuiInMemoryTable(props, context) {
|
|
127
|
+
var _props$searchFormat;
|
|
115
128
|
var _this;
|
|
116
129
|
_classCallCheck(this, EuiInMemoryTable);
|
|
117
130
|
_this = _callSuper(this, EuiInMemoryTable, [props]);
|
|
118
|
-
_defineProperty(_this, "onTableChange", function (
|
|
119
|
-
var page =
|
|
120
|
-
sort =
|
|
121
|
-
var
|
|
122
|
-
pageIndex =
|
|
123
|
-
pageSize =
|
|
131
|
+
_defineProperty(_this, "onTableChange", function (_ref5) {
|
|
132
|
+
var page = _ref5.page,
|
|
133
|
+
sort = _ref5.sort;
|
|
134
|
+
var _ref6 = page || {},
|
|
135
|
+
pageIndex = _ref6.index,
|
|
136
|
+
pageSize = _ref6.size;
|
|
124
137
|
|
|
125
138
|
// don't apply pagination changes that are otherwise controlled
|
|
126
139
|
// `page` is left unchanged as it goes to the consumer's `onTableChange` callback, allowing the app to respond
|
|
@@ -129,9 +142,9 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
129
142
|
if (pagination.pageSize != null) pageSize = pagination.pageSize;
|
|
130
143
|
if (pagination.pageIndex != null) pageIndex = pagination.pageIndex;
|
|
131
144
|
}
|
|
132
|
-
var
|
|
133
|
-
sortName =
|
|
134
|
-
sortDirection =
|
|
145
|
+
var _ref7 = sort || {},
|
|
146
|
+
sortName = _ref7.field,
|
|
147
|
+
sortDirection = _ref7.direction;
|
|
135
148
|
|
|
136
149
|
// To keep backwards compatibility reportedSortName needs to be tracked separately
|
|
137
150
|
// from sortName; sortName gets stored internally while reportedSortName is sent to the callback
|
|
@@ -174,10 +187,10 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
174
187
|
sortDirection: sortDirection
|
|
175
188
|
});
|
|
176
189
|
});
|
|
177
|
-
_defineProperty(_this, "onQueryChange", function (
|
|
178
|
-
var query =
|
|
179
|
-
queryText =
|
|
180
|
-
error =
|
|
190
|
+
_defineProperty(_this, "onQueryChange", function (_ref8) {
|
|
191
|
+
var query = _ref8.query,
|
|
192
|
+
queryText = _ref8.queryText,
|
|
193
|
+
error = _ref8.error;
|
|
181
194
|
var search = _this.props.search;
|
|
182
195
|
if (isEuiSearchBarProps(search)) {
|
|
183
196
|
if (search.onChange) {
|
|
@@ -211,12 +224,11 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
211
224
|
// search bar to ignore EQL syntax and only use the searchbar for plain text
|
|
212
225
|
_defineProperty(_this, "onPlainTextSearch", function (searchValue) {
|
|
213
226
|
var escapedQueryText = searchValue.replace(/["\\]/g, '\\$&');
|
|
214
|
-
var finalQuery = "\"".concat(escapedQueryText, "\"");
|
|
215
227
|
var search = _this.props.search;
|
|
216
228
|
if (isEuiSearchBarProps(search)) {
|
|
217
229
|
if (search.onChange) {
|
|
218
230
|
var shouldQueryInMemory = search.onChange({
|
|
219
|
-
query:
|
|
231
|
+
query: null,
|
|
220
232
|
queryText: escapedQueryText,
|
|
221
233
|
error: null
|
|
222
234
|
});
|
|
@@ -226,7 +238,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
226
238
|
}
|
|
227
239
|
}
|
|
228
240
|
_this.setState({
|
|
229
|
-
query:
|
|
241
|
+
query: "\"".concat(escapedQueryText, "\"")
|
|
230
242
|
});
|
|
231
243
|
});
|
|
232
244
|
var columns = props.columns,
|
|
@@ -250,7 +262,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
250
262
|
search: _search
|
|
251
263
|
},
|
|
252
264
|
search: _search,
|
|
253
|
-
query: getQueryFromSearch(_search, true),
|
|
265
|
+
query: getQueryFromSearch(_search, true, (_props$searchFormat = props.searchFormat) !== null && _props$searchFormat !== void 0 ? _props$searchFormat : 'eql'),
|
|
254
266
|
pageIndex: _pageIndex || 0,
|
|
255
267
|
pageSize: _pageSize,
|
|
256
268
|
pageSizeOptions: pageSizeOptions,
|
|
@@ -271,13 +283,28 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
271
283
|
if (!search) return;
|
|
272
284
|
var searchBar;
|
|
273
285
|
if (searchFormat === 'text') {
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
|
|
286
|
+
var _ref9 = search,
|
|
287
|
+
_ref9$box = _ref9.box,
|
|
288
|
+
box = _ref9$box === void 0 ? {} : _ref9$box,
|
|
289
|
+
query = _ref9.query,
|
|
290
|
+
defaultQuery = _ref9.defaultQuery;
|
|
291
|
+
var schema = box.schema,
|
|
292
|
+
searchBoxProps = _objectWithoutProperties(box, _excluded);
|
|
293
|
+
|
|
294
|
+
// in the unexpected case a Query object is passed with searchFormat=text
|
|
295
|
+
if (process.env.NODE_ENV === 'development') {
|
|
296
|
+
if (query != null && !isString(query)) {
|
|
297
|
+
console.warn('EuiInMemoryTable: `query` should be a string when using searchFormat="text". Query objects are only supported with searchFormat="eql".');
|
|
298
|
+
}
|
|
299
|
+
if (defaultQuery != null && !isString(defaultQuery)) {
|
|
300
|
+
console.warn('EuiInMemoryTable: `defaultQuery` should be a string when using searchFormat="text". Query objects are only supported with searchFormat="eql".');
|
|
301
|
+
}
|
|
302
|
+
}
|
|
277
303
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}, searchBoxProps, {
|
|
304
|
+
// use only string values, ignore Query objects
|
|
305
|
+
var displayQuery = isString(query) ? query : isString(defaultQuery) ? defaultQuery : '';
|
|
306
|
+
searchBar = ___EmotionJSX(EuiSearchBox, _extends({}, searchBoxProps, {
|
|
307
|
+
query: displayQuery,
|
|
281
308
|
onSearch: this.onPlainTextSearch
|
|
282
309
|
}));
|
|
283
310
|
} else {
|
|
@@ -305,9 +332,9 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
305
332
|
value: function resolveSearchSchema() {
|
|
306
333
|
var columns = this.props.columns;
|
|
307
334
|
return columns.reduce(function (schema, column) {
|
|
308
|
-
var
|
|
309
|
-
field =
|
|
310
|
-
dataType =
|
|
335
|
+
var _ref10 = column,
|
|
336
|
+
field = _ref10.field,
|
|
337
|
+
dataType = _ref10.dataType;
|
|
311
338
|
if (field) {
|
|
312
339
|
var type = dataType || 'string';
|
|
313
340
|
schema.fields[field] = {
|
|
@@ -327,8 +354,8 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
327
354
|
sortName = _this$state.sortName,
|
|
328
355
|
sortDirection = _this$state.sortDirection;
|
|
329
356
|
var columns = this.props.columns;
|
|
330
|
-
var sortColumn = columns.find(function (
|
|
331
|
-
var name =
|
|
357
|
+
var sortColumn = columns.find(function (_ref11) {
|
|
358
|
+
var name = _ref11.name;
|
|
332
359
|
return name === sortName;
|
|
333
360
|
});
|
|
334
361
|
if (sortColumn == null) {
|
|
@@ -378,7 +405,6 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
378
405
|
var _this$props2 = this.props,
|
|
379
406
|
columns = _this$props2.columns,
|
|
380
407
|
loading = _this$props2.loading,
|
|
381
|
-
message = _this$props2.message,
|
|
382
408
|
noItemsMessage = _this$props2.noItemsMessage,
|
|
383
409
|
error = _this$props2.error,
|
|
384
410
|
selection = _this$props2.selection,
|
|
@@ -441,7 +467,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
441
467
|
onChange: this.onTableChange,
|
|
442
468
|
error: error,
|
|
443
469
|
loading: loading,
|
|
444
|
-
noItemsMessage: noItemsMessage
|
|
470
|
+
noItemsMessage: noItemsMessage,
|
|
445
471
|
tableLayout: tableLayout,
|
|
446
472
|
compressed: compressed,
|
|
447
473
|
itemIdToExpandedRowMap: itemIdToExpandedRowMap
|
|
@@ -499,11 +525,12 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
499
525
|
var nextQuery = nextProps.search ? nextProps.search.query : '';
|
|
500
526
|
var prevQuery = prevState.prevProps.search ? prevState.prevProps.search.query : '';
|
|
501
527
|
if (nextQuery !== prevQuery) {
|
|
528
|
+
var _nextProps$searchForm;
|
|
502
529
|
updatedPrevState = _objectSpread(_objectSpread({}, updatedPrevState), {}, {
|
|
503
530
|
prevProps: _objectSpread(_objectSpread({}, updatedPrevState.prevProps), {}, {
|
|
504
531
|
search: nextProps.search
|
|
505
532
|
}),
|
|
506
|
-
query: getQueryFromSearch(nextProps.search, false)
|
|
533
|
+
query: getQueryFromSearch(nextProps.search, false, (_nextProps$searchForm = nextProps.searchFormat) !== null && _nextProps$searchForm !== void 0 ? _nextProps$searchForm : 'eql')
|
|
507
534
|
});
|
|
508
535
|
}
|
|
509
536
|
if (updatedPrevState !== prevState) {
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { logicalCSS } from '../../../global_styling';
|
|
11
|
+
import { euiDisabledSelector, logicalCSS } from '../../../global_styling';
|
|
12
12
|
import { highContrastModeStyles, preventForcedColors } from '../../../global_styling/functions/high_contrast';
|
|
13
13
|
import { euiFormVariables } from '../../form/form.styles';
|
|
14
14
|
export var euiButtonGroupStyles = {
|
|
@@ -43,6 +43,6 @@ var _highContrastStyles = function _highContrastStyles(euiThemeContext, compress
|
|
|
43
43
|
var euiTheme = euiThemeContext.euiTheme;
|
|
44
44
|
return highContrastModeStyles(euiThemeContext, {
|
|
45
45
|
preferred: compressed ? "\n .euiButtonGroupButton {\n border: none;\n }\n " : '',
|
|
46
|
-
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n &:is(:hover, :focus):not(
|
|
46
|
+
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n &:is(:hover, :focus):not(").concat(euiDisabledSelector, ") {\n &::before {\n border-color: ").concat(euiTheme.colors.textInverse, ";\n }\n }\n }\n\n .euiButtonGroupButton:is(").concat(euiDisabledSelector, ") {\n opacity: 0.5;\n }\n ")
|
|
47
47
|
});
|
|
48
48
|
};
|
|
@@ -84,7 +84,7 @@ export var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiT
|
|
|
84
84
|
},
|
|
85
85
|
compressed: /*#__PURE__*/css(logicalCSS('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";font-weight:", euiTheme.font.weight.medium, ";padding:0;margin:", euiTheme.size.xxs, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
86
86
|
return x / 2;
|
|
87
|
-
}), ";&+.euiButtonGroupButton{", logicalCSS('margin-left', '0'), ";}&:is(", selectedSelectors, "):not(
|
|
87
|
+
}), ";&+.euiButtonGroupButton{", logicalCSS('margin-left', '0'), ";}&:is(", selectedSelectors, "):not(", euiDisabledSelector, "){border:none;", highContrastModeStyles(euiThemeContext, {
|
|
88
88
|
forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
89
89
|
return x * 3;
|
|
90
90
|
}), ";\n }\n ")
|
|
@@ -57,6 +57,7 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
57
57
|
setHasUnparsedText(false);
|
|
58
58
|
setIsTextInvalid(false);
|
|
59
59
|
}, [dateFormat]);
|
|
60
|
+
var textInputLabelId = useGeneratedHtmlId();
|
|
60
61
|
var timeZomeDescriptionId = useGeneratedHtmlId();
|
|
61
62
|
var submitButtonLabel = useEuiI18n('euiAbsoluteTab.dateFormatButtonLabel', 'Parse date');
|
|
62
63
|
var dateFormatError = useEuiI18n('euiAbsoluteTab.dateFormatError', 'Allowed formats: {dateFormat}, ISO 8601, RFC 2822, or Unix timestamp.', {
|
|
@@ -95,10 +96,16 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
// We can be forgiving for `dateFormat` if we are certain
|
|
100
|
+
// we're not expecting any of the other formats allowed;
|
|
101
|
+
// otherwise we can get valid but inaccurate results e.g.
|
|
102
|
+
// `1970-01-01` -> `Jan 19, 1970 @ 01:01:00.000`
|
|
103
|
+
var strictModeForPassedFormat = moment(textInputValue, ALLOWED_USER_DATE_FORMATS, true).isValid();
|
|
104
|
+
|
|
98
105
|
// Attempt to parse with passed `dateFormat` and `locale`
|
|
99
106
|
var _valueAsMoment = moment(textInputValue, dateFormat, typeof locale === 'string' ? locale : 'en',
|
|
100
107
|
// Narrow the union type to string
|
|
101
|
-
|
|
108
|
+
strictModeForPassedFormat);
|
|
102
109
|
var dateIsValid = _valueAsMoment.isValid();
|
|
103
110
|
|
|
104
111
|
// If not valid, try a few other standardized formats
|
|
@@ -151,6 +158,7 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
151
158
|
helpText: hasUnparsedText && !isTextInvalid ? dateFormatError : undefined,
|
|
152
159
|
describedByIds: [timeZomeDescriptionId]
|
|
153
160
|
}, ___EmotionJSX(EuiFieldText, {
|
|
161
|
+
"aria-labelledby": textInputLabelId,
|
|
154
162
|
compressed: true,
|
|
155
163
|
isInvalid: isTextInvalid,
|
|
156
164
|
value: textInputValue,
|
|
@@ -163,7 +171,9 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
163
171
|
setIsReadyToParse(true);
|
|
164
172
|
},
|
|
165
173
|
"data-test-subj": "superDatePickerAbsoluteDateInput",
|
|
166
|
-
prepend: ___EmotionJSX(EuiFormLabel,
|
|
174
|
+
prepend: ___EmotionJSX(EuiFormLabel, {
|
|
175
|
+
id: textInputLabelId
|
|
176
|
+
}, labelPrefix)
|
|
167
177
|
})), hasUnparsedText && ___EmotionJSX(EuiButtonIcon, {
|
|
168
178
|
type: "submit",
|
|
169
179
|
css: styles.euiAbsoluteTabDateForm__submit,
|
|
@@ -80,6 +80,7 @@ export var EuiRelativeTab = function EuiRelativeTab(_ref) {
|
|
|
80
80
|
if (!parsedValue || !parsedValue.isValid()) return '';
|
|
81
81
|
return parsedValue.locale(locale || 'en').format(dateFormat);
|
|
82
82
|
}, [isInvalid, value, roundUp, locale, dateFormat]);
|
|
83
|
+
var textInputLabelId = useGeneratedHtmlId();
|
|
83
84
|
var relativeDateInputNumberDescriptionId = useGeneratedHtmlId();
|
|
84
85
|
var timeZomeDescriptionId = useGeneratedHtmlId();
|
|
85
86
|
var numberAriaLabel = useEuiI18n('euiRelativeTab.numberInputLabel', 'Time span amount');
|
|
@@ -112,11 +113,14 @@ export var EuiRelativeTab = function EuiRelativeTab(_ref) {
|
|
|
112
113
|
}))), ___EmotionJSX(EuiSpacer, {
|
|
113
114
|
size: "s"
|
|
114
115
|
}), ___EmotionJSX(EuiFieldText, {
|
|
116
|
+
"aria-labelledby": textInputLabelId,
|
|
115
117
|
compressed: true,
|
|
116
118
|
value: formattedValue,
|
|
117
119
|
readOnly: true,
|
|
118
120
|
"aria-describedby": timeZomeDescriptionId,
|
|
119
|
-
prepend: ___EmotionJSX(EuiFormLabel,
|
|
121
|
+
prepend: ___EmotionJSX(EuiFormLabel, {
|
|
122
|
+
id: textInputLabelId
|
|
123
|
+
}, labelPrefix)
|
|
120
124
|
}), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
121
125
|
id: relativeDateInputNumberDescriptionId
|
|
122
126
|
}, ___EmotionJSX(EuiI18n, {
|
package/optimize/es/components/date_picker/super_date_picker/date_popover/timezone_display.js
CHANGED
|
@@ -53,7 +53,9 @@ export var EuiTimeZoneDisplay = function EuiTimeZoneDisplay(_ref) {
|
|
|
53
53
|
"data-test-subj": "euiTimeZoneDisplay",
|
|
54
54
|
"aria-label": label
|
|
55
55
|
}, rest), typeof customRender === 'function' ? customRender({
|
|
56
|
-
nameDisplay: nameDisplay
|
|
56
|
+
nameDisplay: nameDisplay,
|
|
57
|
+
utcOffset: utc,
|
|
58
|
+
timeZoneName: name
|
|
57
59
|
}) : nameDisplay);
|
|
58
60
|
};
|
|
59
61
|
|
|
@@ -9,4 +9,5 @@
|
|
|
9
9
|
export { EuiCommonlyUsedTimeRanges } from './commonly_used_time_ranges';
|
|
10
10
|
export { EuiQuickSelectPopover } from './quick_select_popover';
|
|
11
11
|
export { EuiQuickSelect } from './quick_select';
|
|
12
|
+
export { EuiQuickSelectPanel } from './quick_select_panel';
|
|
12
13
|
export { EuiRecentlyUsed } from './recently_used';
|
|
@@ -23,11 +23,13 @@ import React, { Component } from 'react';
|
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import moment from 'moment'; // eslint-disable-line import/named
|
|
25
25
|
import dateMath from '@elastic/datemath';
|
|
26
|
-
import { useEuiMemoizedStyles } from '../../../services';
|
|
26
|
+
import { useEuiMemoizedStyles, RenderWithEuiTheme } from '../../../services';
|
|
27
27
|
import { isObject } from '../../../services/predicate';
|
|
28
|
+
import { euiTextTruncateCSS } from '../../../global_styling';
|
|
28
29
|
import { EuiI18nConsumer } from '../../context';
|
|
29
30
|
import { EuiDatePickerRange } from '../date_picker_range';
|
|
30
31
|
import { EuiFormControlButton, EuiFormControlLayout } from '../../form';
|
|
32
|
+
import { EuiToolTip } from '../../tool_tip';
|
|
31
33
|
import { RenderI18nTimeOptions } from './time_options';
|
|
32
34
|
import { PrettyDuration, showPrettyDuration } from './pretty_duration';
|
|
33
35
|
import { EuiTimeWindowButtons } from './time_window_buttons';
|
|
@@ -293,22 +295,38 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
293
295
|
};
|
|
294
296
|
var isDisabledDisplay = isObject(isDisabled) && (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled.display);
|
|
295
297
|
if (isDisabledDisplay || showPrettyDuration && !isStartDatePopoverOpen && !isEndDatePopoverOpen) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
298
|
+
// Tooltip content with full range
|
|
299
|
+
var startMoment = dateMath.parse(start);
|
|
300
|
+
var endMoment = dateMath.parse(end, {
|
|
301
|
+
roundUp: true
|
|
302
|
+
});
|
|
303
|
+
var separator = ' – ';
|
|
304
|
+
var formattedFullRange = isInvalid ? '' : (startMoment === null || startMoment === void 0 ? void 0 : startMoment.format(dateFormat)) + separator + (endMoment === null || endMoment === void 0 ? void 0 : endMoment.format(dateFormat));
|
|
305
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiTheme) {
|
|
306
|
+
return ___EmotionJSX(EuiFormControlLayout, formControlLayoutProps, !isQuickSelectOnly && ___EmotionJSX(EuiToolTip, {
|
|
307
|
+
css: styles.euiSuperDatePicker__prettyDurationTooltip,
|
|
308
|
+
content: formattedFullRange,
|
|
309
|
+
display: "block",
|
|
310
|
+
offset: euiTheme.euiTheme.base * 0.5
|
|
311
|
+
}, ___EmotionJSX(EuiFormControlButton, {
|
|
312
|
+
type: "button",
|
|
313
|
+
className: classNames('euiSuperDatePicker__prettyFormat', {
|
|
314
|
+
'euiSuperDatePicker__prettyFormat--disabled': isDisabled
|
|
315
|
+
}),
|
|
316
|
+
compressed: compressed,
|
|
317
|
+
"data-test-subj": "superDatePickerShowDatesButton",
|
|
318
|
+
disabled: !!isDisabled,
|
|
319
|
+
onClick: _this.hidePrettyDuration,
|
|
320
|
+
onFocus: onFocus
|
|
321
|
+
}, isDisabledDisplay ? isDisabled.display : ___EmotionJSX("span", {
|
|
322
|
+
css: euiTextTruncateCSS()
|
|
323
|
+
}, ___EmotionJSX(PrettyDuration, {
|
|
324
|
+
timeFrom: start,
|
|
325
|
+
timeTo: end,
|
|
326
|
+
quickRanges: commonlyUsedRanges,
|
|
327
|
+
dateFormat: dateFormat
|
|
328
|
+
})))));
|
|
329
|
+
});
|
|
312
330
|
}
|
|
313
331
|
var rangeCssStyles = [styles.euiSuperDatePicker__range, formControlLayoutProps.css];
|
|
314
332
|
|
|
@@ -65,9 +65,7 @@ export var euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiTheme
|
|
|
65
65
|
isQuickSelectOnly: /*#__PURE__*/css(logicalCSS('min-width', 0), ".euiFormControlLayout__prepend{", logicalCSS('max-width', 'none'), ";}.euiFormControlLayoutDelimited__delimiter:first-child{", logicalCSS('padding-horizontal', 0), ";};label:isQuickSelectOnly;"),
|
|
66
66
|
euiSuperDatePicker__range: _ref,
|
|
67
67
|
euiSuperDatePicker__rangeInput: /*#__PURE__*/css("flex-grow:1;", logicalCSS('width', 'auto'), " overflow:hidden;;label:euiSuperDatePicker__rangeInput;"),
|
|
68
|
-
|
|
69
|
-
preferred: "\n border: none;\n "
|
|
70
|
-
}), ";;label:euiSuperDatePicker__prettyFormat;"),
|
|
68
|
+
euiSuperDatePicker__prettyDurationTooltip: /*#__PURE__*/css(logicalCSS('max-width', 'min(58ch, 90vw)'), ";;label:euiSuperDatePicker__prettyDurationTooltip;"),
|
|
71
69
|
// Form states
|
|
72
70
|
states: {
|
|
73
71
|
euiSuperDatePicker__formControlLayout: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{--euiFormControlStateHoverColor:", forms.borderHovered, ";", highContrastModeStyles(euiThemeContext, {
|
|
@@ -35,7 +35,7 @@ export var EuiTimeWindowButtons = function EuiTimeWindowButtons(_ref) {
|
|
|
35
35
|
zoomFactor = _ref$zoomFactor === void 0 ? ZOOM_FACTOR_DEFAULT : _ref$zoomFactor;
|
|
36
36
|
var buttonColor = 'text';
|
|
37
37
|
var buttonSize = compressed ? 's' : 'm';
|
|
38
|
-
var iconSize =
|
|
38
|
+
var iconSize = 'm';
|
|
39
39
|
var styles = useEuiMemoizedStyles(euiButtonGroupButtonsStyles);
|
|
40
40
|
var _useEuiTimeWindow = useEuiTimeWindow(start, end, applyTime, {
|
|
41
41
|
zoomFactor: zoomFactor
|
|
@@ -231,7 +231,7 @@ describe('EuiFilterGroup multiselect example', function () {
|
|
|
231
231
|
cy.realPress('Enter');
|
|
232
232
|
cy.get('div[data-test-subj="euiSelectableList"]').should('exist');
|
|
233
233
|
cy.realPress('Tab');
|
|
234
|
-
cy.repeatRealPress('ArrowDown',
|
|
234
|
+
cy.repeatRealPress('ArrowDown', 4);
|
|
235
235
|
cy.realPress('Enter');
|
|
236
236
|
cy.get('li[aria-selected="true"]').find('span.euiSelectableListItem__text').should('have.text', 'Dmitri Shostakovich. Checked option. To exclude this option, press Enter.');
|
|
237
237
|
cy.realPress('ArrowDown');
|
|
@@ -18,15 +18,17 @@ var EuiFlexItemInternal = function EuiFlexItemInternal(_ref, ref) {
|
|
|
18
18
|
var children = _ref.children,
|
|
19
19
|
className = _ref.className,
|
|
20
20
|
_ref$grow = _ref.grow,
|
|
21
|
-
|
|
21
|
+
_grow = _ref$grow === void 0 ? true : _ref$grow,
|
|
22
22
|
_ref$component = _ref.component,
|
|
23
23
|
component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
24
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
// resets `grow` to the default value when an invalid value is passed
|
|
26
|
+
var grow = VALID_GROW_VALUES.indexOf(_grow) === -1 ? true : _grow;
|
|
25
27
|
useEffect(function () {
|
|
26
|
-
if (VALID_GROW_VALUES.indexOf(
|
|
27
|
-
|
|
28
|
+
if (process.env.NODE_ENV === 'development' && VALID_GROW_VALUES.indexOf(_grow) === -1) {
|
|
29
|
+
console.warn("Prop `grow` passed to `EuiFlexItem` must be a boolean or an integer between 0 and 10, received `".concat(_grow, "`. Defaulting to `true`."));
|
|
28
30
|
}
|
|
29
|
-
}, [
|
|
31
|
+
}, [_grow]);
|
|
30
32
|
var cssStyles = [styles.euiFlexItem, !grow ? styles.growZero : styles.grow, grow && (typeof grow === 'number' ? styles.growSizes[grow] : styles.growSizes['1'])];
|
|
31
33
|
var classes = classNames('euiFlexItem', className);
|
|
32
34
|
|
|
@@ -13,6 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiMemoizedStyles, getSecureRelForTarget } from '../../../services';
|
|
15
15
|
import { validateHref } from '../../../services/security/href_validator';
|
|
16
|
+
import { useEuiButtonColorCSS } from '../../../global_styling';
|
|
16
17
|
import { EuiIcon } from '../../icon';
|
|
17
18
|
import { euiHeaderLogoStyles } from './header_logo.styles';
|
|
18
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -29,6 +30,10 @@ export var EuiHeaderLogo = function EuiHeaderLogo(_ref) {
|
|
|
29
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
31
|
var classes = classNames('euiHeaderLogo', className);
|
|
31
32
|
var styles = useEuiMemoizedStyles(euiHeaderLogoStyles);
|
|
33
|
+
var buttonColorStyles = useEuiButtonColorCSS({
|
|
34
|
+
display: 'empty'
|
|
35
|
+
});
|
|
36
|
+
var cssStyles = [styles.euiHeaderLogo, buttonColorStyles.text];
|
|
32
37
|
var secureRel = getSecureRelForTarget({
|
|
33
38
|
href: href,
|
|
34
39
|
rel: rel,
|
|
@@ -39,7 +44,7 @@ export var EuiHeaderLogo = function EuiHeaderLogo(_ref) {
|
|
|
39
44
|
href: isHrefValid ? href : '',
|
|
40
45
|
rel: secureRel,
|
|
41
46
|
target: target,
|
|
42
|
-
css:
|
|
47
|
+
css: cssStyles,
|
|
43
48
|
className: classes
|
|
44
49
|
}, rest), ___EmotionJSX(EuiIcon, {
|
|
45
50
|
"aria-label": iconTitle,
|
|
@@ -15,7 +15,7 @@ export var euiHeaderLogoStyles = function euiHeaderLogoStyles(euiThemeContext) {
|
|
|
15
15
|
var _euiHeaderVariables = euiHeaderVariables(euiThemeContext),
|
|
16
16
|
childHeight = _euiHeaderVariables.childHeight;
|
|
17
17
|
return {
|
|
18
|
-
euiHeaderLogo: /*#__PURE__*/css("position:relative;", logicalCSS('height', childHeight), " line-height:", childHeight, ";", logicalCSS('min-width', childHeight), " padding-inline:", euiTheme.size.s, ";display:inline-flex;align-items:center;white-space:nowrap;", euiBreakpoint(euiThemeContext, ['xs']), "{", logicalCSS('padding-left', euiTheme.size.xs), ";};label:euiHeaderLogo;"),
|
|
18
|
+
euiHeaderLogo: /*#__PURE__*/css("position:relative;", logicalCSS('height', childHeight), " line-height:", childHeight, ";", logicalCSS('min-width', childHeight), " padding-inline:", euiTheme.size.s, ";display:inline-flex;border-radius:", euiTheme.border.radius.small, ";align-items:center;white-space:nowrap;", euiBreakpoint(euiThemeContext, ['xs']), "{", logicalCSS('padding-left', euiTheme.size.xs), ";};label:euiHeaderLogo;"),
|
|
19
19
|
euiHeaderLogo__text: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxs'), " ", logicalCSS('padding-left', euiTheme.size.base), " ", euiBreakpoint(euiThemeContext, ['xs']), "{", logicalCSS('padding-left', euiTheme.size.s), ";};label:euiHeaderLogo__text;")
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -14,11 +14,11 @@ import { logicalSizeCSS, euiCanAnimate } from '../../global_styling';
|
|
|
14
14
|
export var iconLoadingOpacity = 0.05;
|
|
15
15
|
var iconLoading = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: ", ";\n }\n\n 100% {\n opacity: 1;\n }\n"])), iconLoadingOpacity);
|
|
16
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
|
-
name: "
|
|
18
|
-
styles: "*[fill]{fill:none!important;
|
|
17
|
+
name: "p0011s-logoElasticOutline",
|
|
18
|
+
styles: "*[fill]{fill:none!important;stroke:currentColor!important;};label:logoElasticOutline;"
|
|
19
19
|
} : {
|
|
20
|
-
name: "
|
|
21
|
-
styles: "*[fill]{fill:none!important;
|
|
20
|
+
name: "p0011s-logoElasticOutline",
|
|
21
|
+
styles: "*[fill]{fill:none!important;stroke:currentColor!important;};label:logoElasticOutline;",
|
|
22
22
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
23
|
};
|
|
24
24
|
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "restrictWidth", "className", "paddingSize", "grow", "direction"];
|
|
3
|
+
var _excluded = ["children", "restrictWidth", "className", "paddingSize", "grow", "direction", "color"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -12,7 +12,7 @@ var _excluded = ["children", "restrictWidth", "className", "paddingSize", "grow"
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { setStyleForRestrictedPageWidth } from './_restrict_width';
|
|
15
|
-
import { useEuiPaddingCSS } from '../../global_styling';
|
|
15
|
+
import { useEuiPaddingCSS, useEuiBackgroundColorCSS } from '../../global_styling';
|
|
16
16
|
import { euiPageStyles } from './page.styles';
|
|
17
17
|
import { useEuiTheme } from '../../services';
|
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -27,13 +27,16 @@ export var EuiPage = function EuiPage(_ref) {
|
|
|
27
27
|
grow = _ref$grow === void 0 ? true : _ref$grow,
|
|
28
28
|
_ref$direction = _ref.direction,
|
|
29
29
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
30
|
+
_ref$color = _ref.color,
|
|
31
|
+
color = _ref$color === void 0 ? 'transparent' : _ref$color,
|
|
30
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
33
|
// Set max-width as a style prop
|
|
32
34
|
var widthStyles = setStyleForRestrictedPageWidth(restrictWidth, rest === null || rest === void 0 ? void 0 : rest.style);
|
|
33
35
|
var euiTheme = useEuiTheme();
|
|
34
36
|
var styles = euiPageStyles(euiTheme);
|
|
35
37
|
var padding = useEuiPaddingCSS()[paddingSize];
|
|
36
|
-
var
|
|
38
|
+
var backgroundColor = useEuiBackgroundColorCSS()[color];
|
|
39
|
+
var stylesCSS = [styles.euiPage, styles[direction], backgroundColor, grow && styles.grow, padding, restrictWidth && styles.restrictWidth];
|
|
37
40
|
var classes = classNames('euiPage', className);
|
|
38
41
|
return ___EmotionJSX("div", _extends({
|
|
39
42
|
css: stylesCSS,
|
|
@@ -26,9 +26,8 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
26
26
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
27
|
};
|
|
28
28
|
export var euiPageStyles = function euiPageStyles(euiThemeContext) {
|
|
29
|
-
var euiTheme = euiThemeContext.euiTheme;
|
|
30
29
|
return {
|
|
31
|
-
euiPage: /*#__PURE__*/css("display:flex;
|
|
30
|
+
euiPage: /*#__PURE__*/css("display:flex;flex-shrink:0;", logicalCSS('max-width', '100%'), ";;label:euiPage;"),
|
|
32
31
|
// Grow
|
|
33
32
|
grow: _ref2,
|
|
34
33
|
// Direction
|