@elastic/eui 67.0.0 → 67.1.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 -98
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -98
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/badge/badge.js +84 -78
- package/es/components/badge/badge.styles.js +56 -0
- package/es/components/basic_table/in_memory_table.js +8 -0
- package/es/components/button/button.js +0 -1
- package/es/components/button/button_display/_button_display.js +10 -5
- package/es/components/button/button_display/_button_display.styles.js +2 -2
- package/es/components/button/button_display/_button_display_content.js +5 -3
- package/es/components/button/button_display/_button_display_content.styles.js +4 -1
- package/es/components/card/card.js +2 -2
- package/es/components/card/card.styles.js +5 -2
- package/es/components/notification/notification_event.js +1 -1
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/popover/popover_title.js +2 -2
- package/es/components/popover/popover_title.styles.js +18 -6
- package/es/components/search_bar/filters/custom_component_filter.js +16 -0
- package/es/components/search_bar/filters/filters.js +6 -0
- package/es/components/search_bar/query/ast.js +12 -0
- package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
- package/es/components/search_bar/query/query.js +17 -0
- package/es/components/search_bar/search_bar.js +4 -0
- package/es/components/search_bar/search_filters.js +4 -0
- package/es/components/selectable/selectable_list/selectable_list.js +2 -2
- package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
- package/es/services/color/contrast.js +2 -0
- package/es/services/index.js +1 -1
- package/es/services/theme/context.js +2 -1
- package/es/services/theme/hooks.js +27 -1
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/provider.js +15 -1
- package/eui.d.ts +104 -28
- package/lib/components/badge/badge.js +92 -80
- package/lib/components/badge/badge.styles.js +61 -0
- package/lib/components/basic_table/in_memory_table.js +8 -0
- package/lib/components/button/button.js +0 -1
- package/lib/components/button/button_display/_button_display.js +10 -5
- package/lib/components/button/button_display/_button_display.styles.js +2 -2
- package/lib/components/button/button_display/_button_display_content.js +9 -4
- package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
- package/lib/components/card/card.js +2 -2
- package/lib/components/card/card.styles.js +5 -2
- package/lib/components/notification/notification_event.js +1 -1
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/popover/popover_title.js +2 -2
- package/lib/components/popover/popover_title.styles.js +19 -7
- package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
- package/lib/components/search_bar/filters/filters.js +7 -0
- package/lib/components/search_bar/query/ast.js +12 -0
- package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
- package/lib/components/search_bar/query/query.js +17 -0
- package/lib/components/search_bar/search_bar.js +4 -0
- package/lib/components/search_bar/search_filters.js +4 -0
- package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
- package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
- package/lib/services/color/contrast.js +6 -1
- package/lib/services/index.js +7 -0
- package/lib/services/theme/context.js +4 -2
- package/lib/services/theme/hooks.js +28 -0
- package/lib/services/theme/index.js +12 -0
- package/lib/services/theme/provider.js +23 -2
- package/optimize/es/components/badge/badge.js +82 -76
- package/optimize/es/components/badge/badge.styles.js +56 -0
- package/optimize/es/components/basic_table/in_memory_table.js +4 -0
- package/optimize/es/components/button/button.js +0 -1
- package/optimize/es/components/button/button_display/_button_display.js +8 -3
- package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
- package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
- package/optimize/es/components/card/card.js +2 -2
- package/optimize/es/components/card/card.styles.js +5 -2
- package/optimize/es/components/popover/popover_title.js +2 -2
- package/optimize/es/components/popover/popover_title.styles.js +18 -6
- package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
- package/optimize/es/components/search_bar/filters/filters.js +6 -0
- package/optimize/es/components/search_bar/query/ast.js +12 -0
- package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
- package/optimize/es/components/search_bar/query/query.js +17 -0
- package/optimize/es/services/color/contrast.js +2 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/theme/context.js +2 -1
- package/optimize/es/services/theme/hooks.js +27 -1
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/provider.js +14 -1
- package/optimize/lib/components/badge/badge.js +90 -78
- package/optimize/lib/components/badge/badge.styles.js +61 -0
- package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
- package/optimize/lib/components/button/button.js +0 -1
- package/optimize/lib/components/button/button_display/_button_display.js +8 -3
- package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
- package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
- package/optimize/lib/components/card/card.js +2 -2
- package/optimize/lib/components/card/card.styles.js +5 -2
- package/optimize/lib/components/popover/popover_title.js +2 -2
- package/optimize/lib/components/popover/popover_title.styles.js +19 -7
- package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
- package/optimize/lib/components/search_bar/filters/filters.js +7 -0
- package/optimize/lib/components/search_bar/query/ast.js +12 -0
- package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
- package/optimize/lib/components/search_bar/query/query.js +17 -0
- package/optimize/lib/services/color/contrast.js +5 -1
- package/optimize/lib/services/index.js +7 -0
- package/optimize/lib/services/theme/context.js +4 -2
- package/optimize/lib/services/theme/hooks.js +28 -0
- package/optimize/lib/services/theme/index.js +12 -0
- package/optimize/lib/services/theme/provider.js +23 -9
- package/package.json +5 -5
- package/src/components/badge/_index.scss +0 -1
- package/test-env/components/badge/badge.js +92 -80
- package/test-env/components/badge/badge.styles.js +61 -0
- package/test-env/components/basic_table/in_memory_table.js +8 -0
- package/test-env/components/button/button.js +0 -1
- package/test-env/components/button/button_display/_button_display.js +10 -5
- package/test-env/components/button/button_display/_button_display.styles.js +2 -2
- package/test-env/components/button/button_display/_button_display_content.js +8 -4
- package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
- package/test-env/components/card/card.js +2 -2
- package/test-env/components/card/card.styles.js +5 -2
- package/test-env/components/notification/notification_event.js +1 -1
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/popover/popover_title.js +2 -2
- package/test-env/components/popover/popover_title.styles.js +19 -7
- package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
- package/test-env/components/search_bar/filters/filters.js +7 -0
- package/test-env/components/search_bar/query/ast.js +12 -0
- package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
- package/test-env/components/search_bar/query/query.js +17 -0
- package/test-env/components/search_bar/search_bar.js +4 -0
- package/test-env/components/search_bar/search_filters.js +4 -0
- package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
- package/test-env/services/color/contrast.js +5 -1
- package/test-env/services/index.js +7 -0
- package/test-env/services/theme/context.js +4 -2
- package/test-env/services/theme/hooks.js +28 -0
- package/test-env/services/theme/index.js +12 -0
- package/test-env/services/theme/provider.js +23 -9
- package/src/components/badge/_badge.scss +0 -133
|
@@ -543,6 +543,18 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
543
543
|
return !Is.isInstance(clause) || clause.flag !== flag;
|
|
544
544
|
}));
|
|
545
545
|
}
|
|
546
|
+
}, {
|
|
547
|
+
key: "removeIsClauses",
|
|
548
|
+
value: function removeIsClauses() {
|
|
549
|
+
return new _AST(this._clauses.filter(function (clause) {
|
|
550
|
+
return !Is.isInstance(clause);
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
}, {
|
|
554
|
+
key: "removeAllClauses",
|
|
555
|
+
value: function removeAllClauses() {
|
|
556
|
+
return new _AST();
|
|
557
|
+
}
|
|
546
558
|
}, {
|
|
547
559
|
key: "getGroupClauses",
|
|
548
560
|
value: function getGroupClauses() {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
2
|
|
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
|
|
3
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
6
|
|
|
5
7
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -12,8 +14,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
12
14
|
|
|
13
15
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
16
|
|
|
15
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -21,11 +21,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
21
21
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
22
22
|
* Side Public License, v 1.
|
|
23
23
|
*/
|
|
24
|
-
import { printIso8601 } from './date_format';
|
|
25
|
-
import { isDateValue, dateValue } from './date_value';
|
|
26
|
-
import { AST } from './ast';
|
|
27
24
|
import { isArray, isDateLike, isString } from '../../../services/predicate';
|
|
28
25
|
import { keysOf } from '../../common';
|
|
26
|
+
import { AST } from './ast';
|
|
27
|
+
import { printIso8601 } from './date_format';
|
|
28
|
+
import { dateValue, isDateValue } from './date_value';
|
|
29
29
|
|
|
30
30
|
var processDateOperation = function processDateOperation(value, operator) {
|
|
31
31
|
var granularity = value.granularity,
|
|
@@ -115,12 +115,17 @@ export var _fieldValuesToQuery = function _fieldValuesToQuery(field, operations,
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
if (_terms.length >
|
|
118
|
+
if (_terms.length > 1) {
|
|
119
|
+
queries.push({
|
|
120
|
+
bool: _defineProperty({}, andOr === 'and' ? 'must' : 'should', _toConsumableArray(_terms.map(function (value) {
|
|
121
|
+
return {
|
|
122
|
+
match: _defineProperty({}, field, value)
|
|
123
|
+
};
|
|
124
|
+
})))
|
|
125
|
+
});
|
|
126
|
+
} else if (_terms.length === 1) {
|
|
119
127
|
queries.push({
|
|
120
|
-
match: _defineProperty({}, field,
|
|
121
|
-
query: _terms.join(' '),
|
|
122
|
-
operator: andOr
|
|
123
|
-
})
|
|
128
|
+
match: _defineProperty({}, field, _terms[0])
|
|
124
129
|
});
|
|
125
130
|
}
|
|
126
131
|
|
|
@@ -44,6 +44,11 @@ export var Query = /*#__PURE__*/function () {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
_createClass(Query, [{
|
|
47
|
+
key: "hasClauses",
|
|
48
|
+
value: function hasClauses() {
|
|
49
|
+
return this.ast.clauses.length > 0;
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
47
52
|
key: "hasSimpleFieldClause",
|
|
48
53
|
value: function hasSimpleFieldClause(field, value) {
|
|
49
54
|
return this.ast.hasSimpleFieldClause(field, value);
|
|
@@ -103,6 +108,12 @@ export var Query = /*#__PURE__*/function () {
|
|
|
103
108
|
var ast = this.ast.removeOrFieldClauses(field);
|
|
104
109
|
return new Query(ast, this.syntax);
|
|
105
110
|
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "removeAllClauses",
|
|
113
|
+
value: function removeAllClauses() {
|
|
114
|
+
var ast = this.ast.removeAllClauses();
|
|
115
|
+
return new Query(ast, this.syntax);
|
|
116
|
+
}
|
|
106
117
|
}, {
|
|
107
118
|
key: "hasIsClause",
|
|
108
119
|
value: function hasIsClause(flag) {
|
|
@@ -131,6 +142,12 @@ export var Query = /*#__PURE__*/function () {
|
|
|
131
142
|
var ast = this.ast.removeIsClause(flag);
|
|
132
143
|
return new Query(ast, this.syntax);
|
|
133
144
|
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "removeIsClauses",
|
|
147
|
+
value: function removeIsClauses() {
|
|
148
|
+
var ast = this.ast.removeIsClauses();
|
|
149
|
+
return new Query(ast, this.syntax);
|
|
150
|
+
}
|
|
134
151
|
/**
|
|
135
152
|
* Executes this query over the given iterable item and returns
|
|
136
153
|
* an new array of all items that matched this query. Options:
|
|
@@ -412,6 +412,10 @@ EuiSearchBar.propTypes = {
|
|
|
412
412
|
operator: PropTypes.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
|
|
413
413
|
}).isRequired).isRequired,
|
|
414
414
|
available: PropTypes.func
|
|
415
|
+
}).isRequired, PropTypes.shape({
|
|
416
|
+
type: PropTypes.oneOf(["custom_component"]).isRequired,
|
|
417
|
+
component: PropTypes.elementType.isRequired,
|
|
418
|
+
available: PropTypes.func
|
|
415
419
|
}).isRequired]).isRequired),
|
|
416
420
|
|
|
417
421
|
/**
|
|
@@ -156,5 +156,9 @@ EuiSearchFilters.propTypes = {
|
|
|
156
156
|
operator: PropTypes.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
|
|
157
157
|
}).isRequired).isRequired,
|
|
158
158
|
available: PropTypes.func
|
|
159
|
+
}).isRequired, PropTypes.shape({
|
|
160
|
+
type: PropTypes.oneOf(["custom_component"]).isRequired,
|
|
161
|
+
component: PropTypes.elementType.isRequired,
|
|
162
|
+
available: PropTypes.func
|
|
159
163
|
}).isRequired]).isRequired).isRequired
|
|
160
164
|
};
|
|
@@ -438,12 +438,12 @@ EuiSelectableList.propTypes = {
|
|
|
438
438
|
/**
|
|
439
439
|
* The side of the badge the icon should sit
|
|
440
440
|
*/
|
|
441
|
-
iconSide: PropTypes.
|
|
441
|
+
iconSide: PropTypes.any,
|
|
442
442
|
|
|
443
443
|
/**
|
|
444
444
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
445
445
|
*/
|
|
446
|
-
color: PropTypes.oneOfType([PropTypes.
|
|
446
|
+
color: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]),
|
|
447
447
|
|
|
448
448
|
/**
|
|
449
449
|
* Will override any color passed through the `color` prop.
|
|
@@ -272,12 +272,12 @@ EuiSelectableListItem.propTypes = {
|
|
|
272
272
|
/**
|
|
273
273
|
* The side of the badge the icon should sit
|
|
274
274
|
*/
|
|
275
|
-
iconSide: PropTypes.
|
|
275
|
+
iconSide: PropTypes.any,
|
|
276
276
|
|
|
277
277
|
/**
|
|
278
278
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
279
279
|
*/
|
|
280
|
-
color: PropTypes.oneOfType([PropTypes.
|
|
280
|
+
color: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]),
|
|
281
281
|
|
|
282
282
|
/**
|
|
283
283
|
* Will override any color passed through the `color` prop.
|
|
@@ -10,6 +10,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
10
10
|
import chroma from 'chroma-js';
|
|
11
11
|
import { shade, tint, lightness as getLightness } from './manipulation';
|
|
12
12
|
import { getOn } from '../theme/utils';
|
|
13
|
+
export var wcagContrastMin = 4.5; // WCAG AA minimum contrast ratio for normal (non-large) text
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* Creates a new color that meets or exceeds WCAG level AA
|
|
15
17
|
* @param foreground - Color to manipulate
|
package/es/services/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { keys };
|
|
|
11
11
|
export { accessibleClickKeys, cascadingMenuKeys, comboBoxKeys, htmlIdGenerator, useGeneratedHtmlId } from './accessibility';
|
|
12
12
|
export { LEFT_ALIGNMENT, RIGHT_ALIGNMENT, CENTER_ALIGNMENT } from './alignment';
|
|
13
13
|
export { useIsWithinBreakpoints, useIsWithinMaxBreakpoint, useIsWithinMinBreakpoint, CurrentEuiBreakpointContext, CurrentEuiBreakpointProvider, useCurrentEuiBreakpoint } from './breakpoint';
|
|
14
|
-
export { isColorDark, isValidHex, calculateContrast, calculateLuminance, hexToHsv, hexToRgb, hsvToHex, hsvToRgb, rgbToHex, rgbToHsv, VISUALIZATION_COLORS, DEFAULT_VISUALIZATION_COLOR, colorPalette, euiPaletteForLightBackground, euiPaletteForDarkBackground, euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteComplimentary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, euiPaletteWarm, euiPaletteGray, getSteppedGradient, transparentize, tint, shade, tintOrShade, shadeOrTint, saturate, desaturate, lightness, makeHighContrastColor, makeDisabledContrastColor } from './color';
|
|
14
|
+
export { isColorDark, isValidHex, calculateContrast, calculateLuminance, hexToHsv, hexToRgb, hsvToHex, hsvToRgb, rgbToHex, rgbToHsv, VISUALIZATION_COLORS, DEFAULT_VISUALIZATION_COLOR, colorPalette, euiPaletteForLightBackground, euiPaletteForDarkBackground, euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteComplimentary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, euiPaletteWarm, euiPaletteGray, getSteppedGradient, transparentize, tint, shade, tintOrShade, shadeOrTint, saturate, desaturate, lightness, makeHighContrastColor, makeDisabledContrastColor, wcagContrastMin } from './color';
|
|
15
15
|
export { useColorPickerState, useColorStopsState } from './color_picker';
|
|
16
16
|
export * from './console';
|
|
17
17
|
export { copyToClipboard } from './copy_to_clipboard';
|
|
@@ -11,4 +11,5 @@ import { DEFAULT_COLOR_MODE, getComputed } from './utils';
|
|
|
11
11
|
export var EuiSystemContext = /*#__PURE__*/createContext(EuiThemeAmsterdam);
|
|
12
12
|
export var EuiModificationsContext = /*#__PURE__*/createContext({});
|
|
13
13
|
export var EuiColorModeContext = /*#__PURE__*/createContext(DEFAULT_COLOR_MODE);
|
|
14
|
-
export var
|
|
14
|
+
export var defaultComputedTheme = getComputed(EuiThemeAmsterdam, {}, DEFAULT_COLOR_MODE);
|
|
15
|
+
export var EuiThemeContext = /*#__PURE__*/createContext(defaultComputedTheme);
|
|
@@ -8,12 +8,38 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
import React, { forwardRef, useContext, useMemo } from 'react';
|
|
11
|
-
import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
11
|
+
import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext, defaultComputedTheme } from './context';
|
|
12
|
+
import { getEuiDevProviderWarning } from './provider';
|
|
12
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
+
var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
|
|
13
15
|
export var useEuiTheme = function useEuiTheme() {
|
|
14
16
|
var theme = useContext(EuiThemeContext);
|
|
15
17
|
var colorMode = useContext(EuiColorModeContext);
|
|
16
18
|
var modifications = useContext(EuiModificationsContext);
|
|
19
|
+
|
|
20
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
21
|
+
var isFallback = theme === defaultComputedTheme;
|
|
22
|
+
var warningLevel = getEuiDevProviderWarning();
|
|
23
|
+
|
|
24
|
+
if (isFallback && typeof warningLevel !== 'undefined') {
|
|
25
|
+
switch (warningLevel) {
|
|
26
|
+
case 'log':
|
|
27
|
+
console.log(providerMessage);
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case 'warn':
|
|
31
|
+
console.warn(providerMessage);
|
|
32
|
+
break;
|
|
33
|
+
|
|
34
|
+
case 'error':
|
|
35
|
+
throw new Error(providerMessage);
|
|
36
|
+
|
|
37
|
+
default:
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
17
43
|
var assembledTheme = useMemo(function () {
|
|
18
44
|
return {
|
|
19
45
|
euiTheme: theme,
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { EuiSystemContext, EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
9
9
|
export { useEuiTheme, withEuiTheme } from './hooks';
|
|
10
|
-
export { EuiThemeProvider } from './provider';
|
|
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';
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
|
|
3
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -22,6 +28,13 @@ import isEqual from 'lodash/isEqual';
|
|
|
22
28
|
import { EuiSystemContext, EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
23
29
|
import { buildTheme, getColorMode, getComputed, mergeDeep } from './utils';
|
|
24
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
31
|
+
var providerWarning = undefined;
|
|
32
|
+
export var setEuiDevProviderWarning = function setEuiDevProviderWarning(level) {
|
|
33
|
+
return providerWarning = level;
|
|
34
|
+
};
|
|
35
|
+
export var getEuiDevProviderWarning = function getEuiDevProviderWarning() {
|
|
36
|
+
return providerWarning;
|
|
37
|
+
};
|
|
25
38
|
export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
26
39
|
var _system = _ref.theme,
|
|
27
40
|
_colorMode = _ref.colorMode,
|
|
@@ -54,7 +67,8 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
54
67
|
var prevColorMode = useRef(colorMode);
|
|
55
68
|
var isParentTheme = useRef(prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && isEqual(parentModifications, modifications));
|
|
56
69
|
|
|
57
|
-
var _useState7 = useState(isParentTheme.current && Object.keys(parentTheme).length ? parentTheme
|
|
70
|
+
var _useState7 = useState(isParentTheme.current && Object.keys(parentTheme).length ? _objectSpread({}, parentTheme) // Intentionally create a new object to break referential equality
|
|
71
|
+
: getComputed(system, buildTheme(modifications, "_".concat(system.key)), colorMode)),
|
|
58
72
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
59
73
|
theme = _useState8[0],
|
|
60
74
|
setTheme = _useState8[1];
|
package/eui.d.ts
CHANGED
|
@@ -1886,7 +1886,7 @@ declare module '@elastic/eui/src/themes/amsterdam/global_styling/mixins/button'
|
|
|
1886
1886
|
declare module '@elastic/eui/src/components/button/button_display/_button_display.styles' {
|
|
1887
1887
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
1888
1888
|
export const euiButtonBaseCSS: () => string;
|
|
1889
|
-
export const euiButtonDisplayStyles: (euiThemeContext: UseEuiTheme
|
|
1889
|
+
export const euiButtonDisplayStyles: (euiThemeContext: UseEuiTheme) => {
|
|
1890
1890
|
euiButtonDisplay: import("@emotion/utils").SerializedStyles;
|
|
1891
1891
|
isDisabled: import("@emotion/utils").SerializedStyles;
|
|
1892
1892
|
fullWidth: import("@emotion/utils").SerializedStyles;
|
|
@@ -1904,6 +1904,8 @@ declare module '@elastic/eui/src/components/button/button_display/_button_displa
|
|
|
1904
1904
|
right: import("@emotion/utils").SerializedStyles;
|
|
1905
1905
|
euiButtonDisplayContent__spinner: import("@emotion/utils").SerializedStyles;
|
|
1906
1906
|
euiButtonDisplayContent__icon: import("@emotion/utils").SerializedStyles;
|
|
1907
|
+
s: import("@emotion/utils").SerializedStyles;
|
|
1908
|
+
m: import("@emotion/utils").SerializedStyles;
|
|
1907
1909
|
};
|
|
1908
1910
|
|
|
1909
1911
|
}
|
|
@@ -1911,7 +1913,10 @@ declare module '@elastic/eui/src/components/button/button_display/_button_displa
|
|
|
1911
1913
|
import { HTMLAttributes, FunctionComponent, Ref } from 'react';
|
|
1912
1914
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
1913
1915
|
import { IconType } from '@elastic/eui/src/components/icon';
|
|
1914
|
-
export
|
|
1916
|
+
export const ICON_SIZES: readonly ["s", "m"];
|
|
1917
|
+
export type ButtonContentIconSize = typeof ICON_SIZES[number];
|
|
1918
|
+
export const ICON_SIDES: readonly ["left", "right"];
|
|
1919
|
+
export type ButtonContentIconSide = typeof ICON_SIDES[number] | undefined;
|
|
1915
1920
|
export type EuiButtonDisplayContentType = HTMLAttributes<HTMLSpanElement>;
|
|
1916
1921
|
/**
|
|
1917
1922
|
* *INTERNAL ONLY*
|
|
@@ -1934,7 +1939,7 @@ declare module '@elastic/eui/src/components/button/button_display/_button_displa
|
|
|
1934
1939
|
ref?: Ref<HTMLSpanElement>;
|
|
1935
1940
|
'data-text'?: string;
|
|
1936
1941
|
};
|
|
1937
|
-
iconSize?:
|
|
1942
|
+
iconSize?: ButtonContentIconSize;
|
|
1938
1943
|
isDisabled?: boolean;
|
|
1939
1944
|
}
|
|
1940
1945
|
export const EuiButtonDisplayContent: FunctionComponent<EuiButtonDisplayContentType & EuiButtonDisplayContentProps>;
|
|
@@ -4645,10 +4650,17 @@ declare module '@elastic/eui/src/components/popover/input_popover' {
|
|
|
4645
4650
|
|
|
4646
4651
|
}
|
|
4647
4652
|
declare module '@elastic/eui/src/components/popover/popover_title.styles' {
|
|
4648
|
-
import { EuiPaddingSize } from '@elastic/eui/src/global_styling';
|
|
4649
4653
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
4650
|
-
export const euiPopoverTitleStyles: (euiThemeContext: UseEuiTheme
|
|
4654
|
+
export const euiPopoverTitleStyles: (euiThemeContext: UseEuiTheme) => {
|
|
4651
4655
|
euiPopoverTitle: import("@emotion/utils").SerializedStyles;
|
|
4656
|
+
panelPaddingSizes: {
|
|
4657
|
+
none: import("@emotion/utils").SerializedStyles;
|
|
4658
|
+
xs: import("@emotion/utils").SerializedStyles;
|
|
4659
|
+
s: import("@emotion/utils").SerializedStyles;
|
|
4660
|
+
m: import("@emotion/utils").SerializedStyles;
|
|
4661
|
+
l: import("@emotion/utils").SerializedStyles;
|
|
4662
|
+
xl: import("@emotion/utils").SerializedStyles;
|
|
4663
|
+
};
|
|
4652
4664
|
};
|
|
4653
4665
|
|
|
4654
4666
|
}
|
|
@@ -6178,6 +6190,7 @@ declare module '@elastic/eui/src/services/color/manipulation' {
|
|
|
6178
6190
|
|
|
6179
6191
|
}
|
|
6180
6192
|
declare module '@elastic/eui/src/services/color/contrast' {
|
|
6193
|
+
export const wcagContrastMin = 4.5;
|
|
6181
6194
|
/**
|
|
6182
6195
|
* Creates a new color that meets or exceeds WCAG level AA
|
|
6183
6196
|
* @param foreground - Color to manipulate
|
|
@@ -6422,6 +6435,21 @@ declare module '@elastic/eui/src/global_styling/functions/size' {
|
|
|
6422
6435
|
base: number;
|
|
6423
6436
|
}) => string;
|
|
6424
6437
|
|
|
6438
|
+
}
|
|
6439
|
+
declare module '@elastic/eui/src/services/theme/provider' {
|
|
6440
|
+
import React, { PropsWithChildren } from 'react';
|
|
6441
|
+
import { EuiThemeColorMode, EuiThemeSystem, EuiThemeModifications } from '@elastic/eui/src/services/theme/types'; type LEVELS = 'log' | 'warn' | 'error';
|
|
6442
|
+
export const setEuiDevProviderWarning: (level: LEVELS) => LEVELS;
|
|
6443
|
+
export const getEuiDevProviderWarning: () => LEVELS | undefined;
|
|
6444
|
+
export interface EuiThemeProviderProps<T> {
|
|
6445
|
+
theme?: EuiThemeSystem<T>;
|
|
6446
|
+
colorMode?: EuiThemeColorMode;
|
|
6447
|
+
modify?: EuiThemeModifications<T>;
|
|
6448
|
+
children: any;
|
|
6449
|
+
}
|
|
6450
|
+
export const EuiThemeProvider: <T extends {} = {}>({ theme: _system, colorMode: _colorMode, modify: _modifications, children, }: React.PropsWithChildren<EuiThemeProviderProps<T>>) => JSX.Element;
|
|
6451
|
+
export {};
|
|
6452
|
+
|
|
6425
6453
|
}
|
|
6426
6454
|
declare module '@elastic/eui/src/services/theme/hooks' {
|
|
6427
6455
|
import React from 'react';
|
|
@@ -6432,7 +6460,7 @@ declare module '@elastic/eui/src/services/theme/hooks' {
|
|
|
6432
6460
|
modifications: EuiThemeModifications<T>;
|
|
6433
6461
|
}
|
|
6434
6462
|
export const useEuiTheme: <T extends {} = {}>() => UseEuiTheme<T>;
|
|
6435
|
-
export interface WithEuiThemeProps<P = {}> {
|
|
6463
|
+
export interface WithEuiThemeProps<P extends {} = {}> {
|
|
6436
6464
|
theme: UseEuiTheme<P>;
|
|
6437
6465
|
}
|
|
6438
6466
|
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">>>;
|
|
@@ -6535,27 +6563,16 @@ declare module '@elastic/eui/src/services/theme/context' {
|
|
|
6535
6563
|
export const EuiSystemContext: import("react").Context<EuiThemeSystem<{}>>;
|
|
6536
6564
|
export const EuiModificationsContext: import("react").Context<import ("@elastic/eui").RecursivePartial<import ("@elastic/eui/src/services/theme/types").EuiThemeShape>>;
|
|
6537
6565
|
export const EuiColorModeContext: import("react").Context<EuiThemeColorModeStandard>;
|
|
6566
|
+
export const defaultComputedTheme: EuiThemeComputed<import ("@elastic/eui/src/services/theme/types").EuiThemeShape>;
|
|
6538
6567
|
export const EuiThemeContext: import("react").Context<EuiThemeComputed<{}>>;
|
|
6539
6568
|
|
|
6540
|
-
}
|
|
6541
|
-
declare module '@elastic/eui/src/services/theme/provider' {
|
|
6542
|
-
import React, { PropsWithChildren } from 'react';
|
|
6543
|
-
import { EuiThemeColorMode, EuiThemeSystem, EuiThemeModifications } from '@elastic/eui/src/services/theme/types';
|
|
6544
|
-
export interface EuiThemeProviderProps<T> {
|
|
6545
|
-
theme?: EuiThemeSystem<T>;
|
|
6546
|
-
colorMode?: EuiThemeColorMode;
|
|
6547
|
-
modify?: EuiThemeModifications<T>;
|
|
6548
|
-
children: any;
|
|
6549
|
-
}
|
|
6550
|
-
export const EuiThemeProvider: <T extends {} = {}>({ theme: _system, colorMode: _colorMode, modify: _modifications, children, }: React.PropsWithChildren<EuiThemeProviderProps<T>>) => JSX.Element;
|
|
6551
|
-
|
|
6552
6569
|
}
|
|
6553
6570
|
declare module '@elastic/eui/src/services/theme' {
|
|
6554
6571
|
export { EuiSystemContext, EuiThemeContext, EuiModificationsContext, EuiColorModeContext, } from '@elastic/eui/src/services/theme/context';
|
|
6555
6572
|
export type { UseEuiTheme, WithEuiThemeProps } from '@elastic/eui/src/services/theme/hooks';
|
|
6556
6573
|
export { useEuiTheme, withEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
6557
6574
|
export type { EuiThemeProviderProps } from '@elastic/eui/src/services/theme/provider';
|
|
6558
|
-
export { EuiThemeProvider } from '@elastic/eui/src/services/theme/provider';
|
|
6575
|
+
export { EuiThemeProvider, getEuiDevProviderWarning, setEuiDevProviderWarning, } from '@elastic/eui/src/services/theme/provider';
|
|
6559
6576
|
export { buildTheme, computed, isInverseColorMode, getColorMode, getComputed, getOn, mergeDeep, setOn, Computed, } from '@elastic/eui/src/services/theme/utils';
|
|
6560
6577
|
export type { ComputedThemeShape, EuiThemeColorMode, EuiThemeColorModeStandard, EuiThemeComputed, EuiThemeModifications, EuiThemeShape, EuiThemeSystem, } from '@elastic/eui/src/services/theme/types';
|
|
6561
6578
|
export { COLOR_MODES_STANDARD } from '@elastic/eui/src/services/theme/types';
|
|
@@ -7073,7 +7090,7 @@ declare module '@elastic/eui/src/services' {
|
|
|
7073
7090
|
export type { EuiBreakpointSize } from '@elastic/eui/src/services/breakpoint';
|
|
7074
7091
|
export { useIsWithinBreakpoints, useIsWithinMaxBreakpoint, useIsWithinMinBreakpoint, CurrentEuiBreakpointContext, CurrentEuiBreakpointProvider, useCurrentEuiBreakpoint, } from '@elastic/eui/src/services/breakpoint';
|
|
7075
7092
|
export type { HSV } from '@elastic/eui/src/services/color';
|
|
7076
|
-
export { isColorDark, isValidHex, calculateContrast, calculateLuminance, hexToHsv, hexToRgb, hsvToHex, hsvToRgb, rgbToHex, rgbToHsv, VISUALIZATION_COLORS, DEFAULT_VISUALIZATION_COLOR, colorPalette, euiPaletteForLightBackground, euiPaletteForDarkBackground, euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteComplimentary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, euiPaletteWarm, euiPaletteGray, getSteppedGradient, transparentize, tint, shade, tintOrShade, shadeOrTint, saturate, desaturate, lightness, makeHighContrastColor, makeDisabledContrastColor, } from '@elastic/eui/src/services/color';
|
|
7093
|
+
export { isColorDark, isValidHex, calculateContrast, calculateLuminance, hexToHsv, hexToRgb, hsvToHex, hsvToRgb, rgbToHex, rgbToHsv, VISUALIZATION_COLORS, DEFAULT_VISUALIZATION_COLOR, colorPalette, euiPaletteForLightBackground, euiPaletteForDarkBackground, euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteComplimentary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, euiPaletteWarm, euiPaletteGray, getSteppedGradient, transparentize, tint, shade, tintOrShade, shadeOrTint, saturate, desaturate, lightness, makeHighContrastColor, makeDisabledContrastColor, wcagContrastMin, } from '@elastic/eui/src/services/color';
|
|
7077
7094
|
export type { EuiSetColorMethod } from '@elastic/eui/src/services/color_picker';
|
|
7078
7095
|
export { useColorPickerState, useColorStopsState } from '@elastic/eui/src/services/color_picker';
|
|
7079
7096
|
export * from '@elastic/eui/src/services/console';
|
|
@@ -7699,11 +7716,39 @@ declare module '@elastic/eui/src/components/avatar' {
|
|
|
7699
7716
|
export type { EuiAvatarProps } from '@elastic/eui/src/components/avatar/avatar';
|
|
7700
7717
|
export { EuiAvatar, checkValidColor } from '@elastic/eui/src/components/avatar/avatar';
|
|
7701
7718
|
|
|
7719
|
+
}
|
|
7720
|
+
declare module '@elastic/eui/src/components/badge/badge.styles' {
|
|
7721
|
+
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
7722
|
+
export const euiBadgeStyles: (euiThemeContext: UseEuiTheme) => {
|
|
7723
|
+
euiBadge: import("@emotion/utils").SerializedStyles;
|
|
7724
|
+
clickable: import("@emotion/utils").SerializedStyles;
|
|
7725
|
+
disabled: import("@emotion/utils").SerializedStyles;
|
|
7726
|
+
hollow: import("@emotion/utils").SerializedStyles;
|
|
7727
|
+
euiBadge__content: import("@emotion/utils").SerializedStyles;
|
|
7728
|
+
text: {
|
|
7729
|
+
euiBadge__text: import("@emotion/utils").SerializedStyles;
|
|
7730
|
+
clickable: import("@emotion/utils").SerializedStyles;
|
|
7731
|
+
};
|
|
7732
|
+
icon: {
|
|
7733
|
+
euiBadge__icon: import("@emotion/utils").SerializedStyles;
|
|
7734
|
+
right: import("@emotion/utils").SerializedStyles;
|
|
7735
|
+
left: import("@emotion/utils").SerializedStyles;
|
|
7736
|
+
};
|
|
7737
|
+
iconButton: {
|
|
7738
|
+
euiBadge__iconButton: import("@emotion/utils").SerializedStyles;
|
|
7739
|
+
right: import("@emotion/utils").SerializedStyles;
|
|
7740
|
+
left: import("@emotion/utils").SerializedStyles;
|
|
7741
|
+
};
|
|
7742
|
+
euiBadge__childButton: import("@emotion/utils").SerializedStyles;
|
|
7743
|
+
};
|
|
7744
|
+
|
|
7702
7745
|
}
|
|
7703
7746
|
declare module '@elastic/eui/src/components/badge/badge' {
|
|
7704
7747
|
import { AriaAttributes, FunctionComponent, HTMLAttributes, MouseEventHandler } from 'react';
|
|
7705
7748
|
import { CommonProps, ExclusiveUnion, PropsOf } from '@elastic/eui/src/components/common';
|
|
7706
|
-
import { EuiIcon,
|
|
7749
|
+
import { EuiIcon, IconType } from '@elastic/eui/src/components/icon';
|
|
7750
|
+
export const ICON_SIDES: readonly ["left", "right"]; type IconSide = typeof ICON_SIDES[number];
|
|
7751
|
+
export const COLORS: readonly ["default", "hollow", "primary", "success", "accent", "warning", "danger"]; type BadgeColor = typeof COLORS[number]; type WithButtonProps = {
|
|
7707
7752
|
/**
|
|
7708
7753
|
* Will apply an onclick to the badge itself
|
|
7709
7754
|
*/
|
|
@@ -7739,7 +7784,7 @@ declare module '@elastic/eui/src/components/badge/badge' {
|
|
|
7739
7784
|
/**
|
|
7740
7785
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
7741
7786
|
*/
|
|
7742
|
-
color?:
|
|
7787
|
+
color?: BadgeColor | string;
|
|
7743
7788
|
/**
|
|
7744
7789
|
* Will override any color passed through the `color` prop.
|
|
7745
7790
|
*/
|
|
@@ -7749,8 +7794,6 @@ declare module '@elastic/eui/src/components/badge/badge' {
|
|
|
7749
7794
|
*/
|
|
7750
7795
|
closeButtonProps?: Partial<PropsOf<typeof EuiIcon>>;
|
|
7751
7796
|
} & CommonProps & ExclusiveUnion<WithIconOnClick, {}> & ExclusiveUnion<ExclusiveUnion<WithButtonProps, WithAnchorProps>, WithSpanProps>;
|
|
7752
|
-
export const COLORS: string[];
|
|
7753
|
-
export const ICON_SIDES: IconSide[];
|
|
7754
7797
|
export const EuiBadge: FunctionComponent<EuiBadgeProps>;
|
|
7755
7798
|
export {};
|
|
7756
7799
|
|
|
@@ -8209,7 +8252,7 @@ declare module '@elastic/eui/src/components/card/card.styles' {
|
|
|
8209
8252
|
* 3. Horizontal layouts should always top left align no matter the textAlign prop
|
|
8210
8253
|
* 4. Ensures the contents always stretch no matter the flex layout
|
|
8211
8254
|
*/
|
|
8212
|
-
export const euiCardStyles: (euiThemeContext: UseEuiTheme, paddingSize: EuiCardProps['paddingSize']
|
|
8255
|
+
export const euiCardStyles: (euiThemeContext: UseEuiTheme, paddingSize: EuiCardProps['paddingSize']) => {
|
|
8213
8256
|
card: {
|
|
8214
8257
|
euiCard: import("@emotion/utils").SerializedStyles;
|
|
8215
8258
|
aligned: {
|
|
@@ -8241,7 +8284,10 @@ declare module '@elastic/eui/src/components/card/card.styles' {
|
|
|
8241
8284
|
};
|
|
8242
8285
|
disabled: import("@emotion/utils").SerializedStyles;
|
|
8243
8286
|
};
|
|
8244
|
-
|
|
8287
|
+
image: {
|
|
8288
|
+
euiCard__image: import("@emotion/utils").SerializedStyles;
|
|
8289
|
+
transparent: import("@emotion/utils").SerializedStyles;
|
|
8290
|
+
};
|
|
8245
8291
|
icon: {
|
|
8246
8292
|
euiCard__icon: import("@emotion/utils").SerializedStyles;
|
|
8247
8293
|
withImage: import("@emotion/utils").SerializedStyles;
|
|
@@ -16186,6 +16232,8 @@ declare module '@elastic/eui/src/components/search_bar/query/ast' {
|
|
|
16186
16232
|
getIsClauses(): IsClause[];
|
|
16187
16233
|
getIsClause(flag: string): IsClause;
|
|
16188
16234
|
removeIsClause(flag: string): _AST;
|
|
16235
|
+
removeIsClauses(): _AST;
|
|
16236
|
+
removeAllClauses(): _AST;
|
|
16189
16237
|
getGroupClauses(): GroupClause[];
|
|
16190
16238
|
/**
|
|
16191
16239
|
* Creates and returns a new AST with the given clause added to the current clauses. If
|
|
@@ -16429,7 +16477,7 @@ declare module '@elastic/eui/src/components/search_bar/query/execute_ast' {
|
|
|
16429
16477
|
|
|
16430
16478
|
}
|
|
16431
16479
|
declare module '@elastic/eui/src/components/search_bar/query/ast_to_es_query_dsl' {
|
|
16432
|
-
import {
|
|
16480
|
+
import { OperatorType, Value, _AST } from '@elastic/eui/src/components/search_bar/query/ast';
|
|
16433
16481
|
export interface QueryContainer {
|
|
16434
16482
|
bool?: BoolQuery;
|
|
16435
16483
|
match_all?: {};
|
|
@@ -16498,6 +16546,7 @@ declare module '@elastic/eui/src/components/search_bar/query/query' {
|
|
|
16498
16546
|
text: string;
|
|
16499
16547
|
private syntax;
|
|
16500
16548
|
constructor(ast: _AST, syntax?: Syntax, text?: string);
|
|
16549
|
+
hasClauses(): boolean;
|
|
16501
16550
|
hasSimpleFieldClause(field: string, value?: string): boolean;
|
|
16502
16551
|
getSimpleFieldClause(field: string, value?: Value): import ("@elastic/eui/src/components/search_bar/query/ast").FieldClause | undefined;
|
|
16503
16552
|
removeSimpleFieldClauses(field: string): Query;
|
|
@@ -16508,11 +16557,13 @@ declare module '@elastic/eui/src/components/search_bar/query/query' {
|
|
|
16508
16557
|
addOrFieldValue(field: string, value: Value, must?: boolean, operator?: OperatorType): Query;
|
|
16509
16558
|
removeOrFieldValue(field: string, value: Value): Query;
|
|
16510
16559
|
removeOrFieldClauses(field: string): Query;
|
|
16560
|
+
removeAllClauses(): Query;
|
|
16511
16561
|
hasIsClause(flag: string): boolean;
|
|
16512
16562
|
getIsClause(flag: string): import ("@elastic/eui/src/components/search_bar/query/ast").IsClause;
|
|
16513
16563
|
addMustIsClause(flag: string): Query;
|
|
16514
16564
|
addMustNotIsClause(flag: string): Query;
|
|
16515
16565
|
removeIsClause(flag: string): Query;
|
|
16566
|
+
removeIsClauses(): Query;
|
|
16516
16567
|
/**
|
|
16517
16568
|
* Executes this query over the given iterable item and returns
|
|
16518
16569
|
* an new array of all items that matched this query. Options:
|
|
@@ -17289,6 +17340,30 @@ declare module '@elastic/eui/src/components/search_bar/filters/field_value_toggl
|
|
|
17289
17340
|
render(): JSX.Element[];
|
|
17290
17341
|
}
|
|
17291
17342
|
|
|
17343
|
+
}
|
|
17344
|
+
declare module '@elastic/eui/src/components/search_bar/filters/custom_component_filter' {
|
|
17345
|
+
import React, { FC } from 'react';
|
|
17346
|
+
import { Query } from '@elastic/eui/src/components/search_bar/query';
|
|
17347
|
+
/**
|
|
17348
|
+
* The props that are passed down to the custom component
|
|
17349
|
+
*/
|
|
17350
|
+
export interface CustomComponentProps {
|
|
17351
|
+
query: Query;
|
|
17352
|
+
onChange?: (query: Query) => void;
|
|
17353
|
+
}
|
|
17354
|
+
export interface CustomComponentFilterConfigType<T extends CustomComponentProps = CustomComponentProps> {
|
|
17355
|
+
type: 'custom_component';
|
|
17356
|
+
component: React.ComponentType<T>;
|
|
17357
|
+
available?: () => boolean;
|
|
17358
|
+
}
|
|
17359
|
+
export interface CustomComponentFilterProps<T extends CustomComponentProps = CustomComponentProps> {
|
|
17360
|
+
index: number;
|
|
17361
|
+
config: CustomComponentFilterConfigType<T>;
|
|
17362
|
+
query: Query;
|
|
17363
|
+
onChange?: (query: Query) => void;
|
|
17364
|
+
}
|
|
17365
|
+
export const CustomComponentFilter: FC<CustomComponentFilterProps>;
|
|
17366
|
+
|
|
17292
17367
|
}
|
|
17293
17368
|
declare module '@elastic/eui/src/components/search_bar/filters/filters' {
|
|
17294
17369
|
|
|
@@ -17296,9 +17371,10 @@ declare module '@elastic/eui/src/components/search_bar/filters/filters' {
|
|
|
17296
17371
|
import { FieldValueSelectionFilterConfigType } from '@elastic/eui/src/components/search_bar/filters/field_value_selection_filter';
|
|
17297
17372
|
import { FieldValueToggleFilterConfigType } from '@elastic/eui/src/components/search_bar/filters/field_value_toggle_filter';
|
|
17298
17373
|
import { FieldValueToggleGroupFilterConfigType } from '@elastic/eui/src/components/search_bar/filters/field_value_toggle_group_filter';
|
|
17374
|
+
import { CustomComponentFilterConfigType } from '@elastic/eui/src/components/search_bar/filters/custom_component_filter';
|
|
17299
17375
|
import { Query } from '@elastic/eui/src/components/search_bar/query';
|
|
17300
17376
|
export const createFilter: (index: number, config: SearchFilterConfig, query: Query, onChange: (query: Query) => void) => JSX.Element;
|
|
17301
|
-
export type SearchFilterConfig = IsFilterConfigType | FieldValueSelectionFilterConfigType | FieldValueToggleFilterConfigType | FieldValueToggleGroupFilterConfigType;
|
|
17377
|
+
export type SearchFilterConfig = IsFilterConfigType | FieldValueSelectionFilterConfigType | FieldValueToggleFilterConfigType | FieldValueToggleGroupFilterConfigType | CustomComponentFilterConfigType;
|
|
17302
17378
|
|
|
17303
17379
|
}
|
|
17304
17380
|
declare module '@elastic/eui/src/components/search_bar/filters' {
|