@elastic/eui 69.0.0 → 70.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +0 -375
- package/dist/eui_theme_dark.json +0 -27
- package/dist/eui_theme_dark.json.d.ts +0 -27
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -375
- package/dist/eui_theme_light.json +0 -27
- package/dist/eui_theme_light.json.d.ts +0 -27
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/in_memory_table.js +8 -2
- package/es/components/code/code.js +7 -3
- package/es/components/code/code.styles.js +32 -0
- package/es/components/code/code_block.js +72 -315
- package/es/components/code/code_block.styles.js +153 -0
- package/es/components/code/code_block_controls.js +29 -0
- package/es/components/code/code_block_controls.styles.js +43 -0
- package/es/components/code/code_block_copy.js +65 -0
- package/es/components/code/code_block_full_screen.js +90 -0
- package/es/components/code/code_block_line.styles.js +49 -0
- package/es/components/code/code_block_overflow.js +78 -0
- package/es/components/code/code_block_virtualized.js +59 -0
- package/es/components/code/code_syntax.styles.js +43 -0
- package/es/components/code/utils.js +43 -37
- package/es/components/collapsible_nav/collapsible_nav.js +0 -5
- package/es/components/overlay_mask/overlay_mask.js +8 -14
- package/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/es/components/provider/provider.js +1 -5
- package/es/components/resizable_container/helpers.js +2 -2
- package/es/components/resizable_container/resizable_container.js +6 -9
- package/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/es/components/resizable_container/resizable_panel.js +25 -48
- package/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/es/components/search_bar/query/ast.js +14 -3
- package/es/components/tool_tip/tool_tip.js +3 -2
- package/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/es/components/tool_tip/tool_tip_arrow.js +17 -3
- package/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/es/components/tour/tour.styles.js +4 -3
- package/es/components/tour/tour_step.js +7 -5
- package/es/global_styling/functions/logicals.js +5 -3
- package/es/global_styling/functions/math.js +37 -19
- package/es/global_styling/mixins/_padding.js +13 -9
- package/eui.d.ts +291 -37
- package/i18ntokens.json +22 -22
- package/lib/components/basic_table/in_memory_table.js +8 -2
- package/lib/components/code/code.js +9 -3
- package/lib/components/code/code.styles.js +35 -0
- package/lib/components/code/code_block.js +72 -320
- package/lib/components/code/code_block.styles.js +154 -0
- package/lib/components/code/code_block_controls.js +48 -0
- package/lib/components/code/code_block_controls.styles.js +39 -0
- package/lib/components/code/code_block_copy.js +78 -0
- package/lib/components/code/code_block_full_screen.js +108 -0
- package/lib/components/code/code_block_line.styles.js +45 -0
- package/lib/components/code/code_block_overflow.js +82 -0
- package/lib/components/code/code_block_virtualized.js +72 -0
- package/lib/components/code/code_syntax.styles.js +57 -0
- package/lib/components/code/utils.js +40 -39
- package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
- package/lib/components/overlay_mask/overlay_mask.js +9 -14
- package/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/lib/components/provider/provider.js +7 -12
- package/lib/components/resizable_container/helpers.js +2 -2
- package/lib/components/resizable_container/resizable_container.js +7 -9
- package/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/lib/components/resizable_container/resizable_panel.js +28 -49
- package/lib/components/resizable_container/resizable_panel.styles.js +74 -0
- package/lib/components/search_bar/query/ast.js +14 -3
- package/lib/components/tool_tip/tool_tip.js +3 -2
- package/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/lib/components/tool_tip/tool_tip_arrow.js +19 -4
- package/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/lib/components/tour/tour.styles.js +3 -2
- package/lib/components/tour/tour_step.js +7 -5
- package/lib/global_styling/functions/logicals.js +5 -3
- package/lib/global_styling/functions/math.js +37 -19
- package/lib/global_styling/mixins/_padding.js +17 -10
- package/optimize/es/components/basic_table/in_memory_table.js +1 -1
- package/optimize/es/components/code/code.js +7 -3
- package/optimize/es/components/code/code.styles.js +32 -0
- package/optimize/es/components/code/code_block.js +70 -299
- package/optimize/es/components/code/code_block.styles.js +153 -0
- package/optimize/es/components/code/code_block_controls.js +29 -0
- package/optimize/es/components/code/code_block_controls.styles.js +43 -0
- package/optimize/es/components/code/code_block_copy.js +55 -0
- package/optimize/es/components/code/code_block_full_screen.js +80 -0
- package/optimize/es/components/code/code_block_line.styles.js +49 -0
- package/optimize/es/components/code/code_block_overflow.js +67 -0
- package/optimize/es/components/code/code_block_virtualized.js +59 -0
- package/optimize/es/components/code/code_syntax.styles.js +43 -0
- package/optimize/es/components/code/utils.js +43 -37
- package/optimize/es/components/overlay_mask/overlay_mask.js +8 -9
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/optimize/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/optimize/es/components/provider/provider.js +1 -5
- package/optimize/es/components/resizable_container/helpers.js +2 -2
- package/optimize/es/components/resizable_container/resizable_container.js +6 -9
- package/optimize/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/optimize/es/components/resizable_container/resizable_panel.js +25 -48
- package/optimize/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/optimize/es/components/search_bar/query/ast.js +14 -3
- package/optimize/es/components/tool_tip/tool_tip.js +3 -2
- package/optimize/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/optimize/es/components/tool_tip/tool_tip_arrow.js +9 -3
- package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/optimize/es/components/tour/tour.styles.js +4 -3
- package/optimize/es/components/tour/tour_step.js +7 -5
- package/optimize/es/global_styling/functions/logicals.js +5 -3
- package/optimize/es/global_styling/functions/math.js +35 -17
- package/optimize/es/global_styling/mixins/_padding.js +13 -9
- package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
- package/optimize/lib/components/code/code.js +9 -3
- package/optimize/lib/components/code/code.styles.js +35 -0
- package/optimize/lib/components/code/code_block.js +71 -306
- package/optimize/lib/components/code/code_block.styles.js +156 -0
- package/optimize/lib/components/code/code_block_controls.js +48 -0
- package/optimize/lib/components/code/code_block_controls.styles.js +39 -0
- package/optimize/lib/components/code/code_block_copy.js +78 -0
- package/optimize/lib/components/code/code_block_full_screen.js +108 -0
- package/optimize/lib/components/code/code_block_line.styles.js +45 -0
- package/optimize/lib/components/code/code_block_overflow.js +82 -0
- package/optimize/lib/components/code/code_block_virtualized.js +81 -0
- package/optimize/lib/components/code/code_syntax.styles.js +57 -0
- package/optimize/lib/components/code/utils.js +40 -37
- package/optimize/lib/components/overlay_mask/overlay_mask.js +9 -9
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/optimize/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/optimize/lib/components/provider/provider.js +7 -12
- package/optimize/lib/components/resizable_container/helpers.js +2 -2
- package/optimize/lib/components/resizable_container/resizable_container.js +7 -9
- package/optimize/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/optimize/lib/components/resizable_container/resizable_panel.js +28 -49
- package/optimize/lib/components/resizable_container/resizable_panel.styles.js +76 -0
- package/optimize/lib/components/search_bar/query/ast.js +14 -3
- package/optimize/lib/components/tool_tip/tool_tip.js +3 -2
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/optimize/lib/components/tool_tip/tool_tip_arrow.js +10 -10
- package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/optimize/lib/components/tour/tour.styles.js +3 -2
- package/optimize/lib/components/tour/tour_step.js +7 -5
- package/optimize/lib/global_styling/functions/logicals.js +4 -10
- package/optimize/lib/global_styling/functions/math.js +37 -19
- package/optimize/lib/global_styling/mixins/_padding.js +17 -10
- package/package.json +8 -7
- package/src/components/index.scss +0 -1
- package/src/components/resizable_container/_index.scss +0 -2
- package/src/global_styling/mixins/_header.scss +1 -1
- package/src/global_styling/variables/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/in_memory_table.js +8 -2
- package/test-env/components/code/code.styles.js +35 -0
- package/test-env/components/code/code_block.styles.js +156 -0
- package/test-env/components/code/code_block_controls.js +48 -0
- package/test-env/components/code/code_block_controls.styles.js +39 -0
- package/test-env/components/code/code_block_copy.js +78 -0
- package/test-env/components/code/code_block_full_screen.js +108 -0
- package/test-env/components/code/code_block_line.styles.js +45 -0
- package/test-env/components/code/code_block_overflow.js +82 -0
- package/test-env/components/code/code_block_virtualized.js +81 -0
- package/test-env/components/code/code_syntax.styles.js +57 -0
- package/test-env/components/code/utils.js +40 -37
- package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
- package/test-env/components/overlay_mask/overlay_mask.js +9 -14
- package/test-env/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/test-env/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/test-env/components/provider/provider.js +7 -12
- package/test-env/components/resizable_container/helpers.js +2 -2
- package/test-env/components/resizable_container/resizable_container.js +7 -9
- package/test-env/components/resizable_container/resizable_container.styles.js +31 -0
- package/test-env/components/resizable_container/resizable_panel.js +28 -49
- package/test-env/components/resizable_container/resizable_panel.styles.js +76 -0
- package/test-env/components/search_bar/query/ast.js +14 -3
- package/test-env/components/tool_tip/tool_tip.js +3 -2
- package/test-env/components/tool_tip/tool_tip.styles.js +18 -26
- package/test-env/components/tool_tip/tool_tip_arrow.js +16 -11
- package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
- package/test-env/components/tour/tour.styles.js +3 -2
- package/test-env/components/tour/tour_step.js +7 -5
- package/test-env/global_styling/functions/logicals.js +4 -10
- package/test-env/global_styling/functions/math.js +37 -19
- package/test-env/global_styling/mixins/_padding.js +17 -10
- package/src/components/code/_code.scss +0 -15
- package/src/components/code/_code_block.scss +0 -177
- package/src/components/code/_index.scss +0 -4
- package/src/components/code/_mixins.scss +0 -127
- package/src/components/code/_variables.scss +0 -5
- package/src/components/resizable_container/_resizable_container.scss +0 -8
- package/src/components/resizable_container/_resizable_panel.scss +0 -51
- package/src/global_styling/variables/_colors_code.scss +0 -23
- package/src/themes/amsterdam/overrides/_code.scss +0 -9
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiResizablePanelStyles = exports.euiResizablePanelContentStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
19
|
+
|
|
20
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "11qmbh3-collapsed",
|
|
22
|
+
styles: "overflow:hidden;label:collapsed;"
|
|
23
|
+
} : {
|
|
24
|
+
name: "11qmbh3-collapsed",
|
|
25
|
+
styles: "overflow:hidden;label:collapsed;",
|
|
26
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
30
|
+
name: "15ifdgc-euiResizablePanel",
|
|
31
|
+
styles: "position:relative;label:euiResizablePanel;"
|
|
32
|
+
} : {
|
|
33
|
+
name: "15ifdgc-euiResizablePanel",
|
|
34
|
+
styles: "position:relative;label:euiResizablePanel;",
|
|
35
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var euiResizablePanelStyles = function euiResizablePanelStyles(euiThemeContext) {
|
|
39
|
+
return {
|
|
40
|
+
euiResizablePanel: _ref3,
|
|
41
|
+
collapsed: _ref2,
|
|
42
|
+
paddingSizes: _objectSpread({}, (0, _global_styling.euiPaddingSizeCSS)(euiThemeContext))
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.euiResizablePanelStyles = euiResizablePanelStyles;
|
|
47
|
+
|
|
48
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
49
|
+
name: "597kt8-collapsedChildren",
|
|
50
|
+
styles: "*{display:none;};label:collapsedChildren;"
|
|
51
|
+
} : {
|
|
52
|
+
name: "597kt8-collapsedChildren",
|
|
53
|
+
styles: "*{display:none;};label:collapsedChildren;",
|
|
54
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var euiResizablePanelContentStyles = function euiResizablePanelContentStyles(euiThemeContext) {
|
|
58
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
59
|
+
return {
|
|
60
|
+
euiResizablePanel__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";;label:euiResizablePanel__content;"),
|
|
61
|
+
scrollable: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " ", (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), ";;label:scrollable;"),
|
|
62
|
+
collapsedChildren: _ref,
|
|
63
|
+
horizontal: {
|
|
64
|
+
collapsed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', '0 !important'), ";;label:collapsed;"),
|
|
65
|
+
hasCollapsibleButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', "".concat(euiTheme.size.l, " !important")), ";;label:hasCollapsibleButton;")
|
|
66
|
+
},
|
|
67
|
+
vertical: {
|
|
68
|
+
collapsed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-height', '0 !important'), ";;label:collapsed;"),
|
|
69
|
+
hasCollapsibleButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-height', "".concat(euiTheme.size.l, " !important")), ";;label:hasCollapsibleButton;")
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.euiResizablePanelContentStyles = euiResizablePanelContentStyles;
|
|
@@ -287,6 +287,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
287
287
|
return valuesEqual(item, value);
|
|
288
288
|
});
|
|
289
289
|
};
|
|
290
|
+
|
|
291
|
+
var mustToMatch = function mustToMatch(must) {
|
|
292
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
293
|
+
};
|
|
290
294
|
/**
|
|
291
295
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
292
296
|
*
|
|
@@ -411,9 +415,16 @@ var _AST = /*#__PURE__*/function () {
|
|
|
411
415
|
}
|
|
412
416
|
}, {
|
|
413
417
|
key: "getOrFieldClause",
|
|
414
|
-
value: function getOrFieldClause(field, value) {
|
|
418
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
415
419
|
return this.getFieldClause(field, function (clause) {
|
|
416
|
-
|
|
420
|
+
if (!(0, _predicate.isArray)(clause.value)) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
var matchValue = (0, _predicate.isNil)(value) || arrayIncludesValue(clause.value, value);
|
|
425
|
+
var matchMust = (0, _predicate.isNil)(must) || mustToMatch(must) === clause.match;
|
|
426
|
+
var matchOperator = (0, _predicate.isNil)(operator) || operator === clause.operator;
|
|
427
|
+
return matchValue && matchMust && matchOperator;
|
|
417
428
|
});
|
|
418
429
|
}
|
|
419
430
|
}, {
|
|
@@ -421,7 +432,7 @@ var _AST = /*#__PURE__*/function () {
|
|
|
421
432
|
value: function addOrFieldValue(field, value) {
|
|
422
433
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
423
434
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
424
|
-
var existingClause = this.getOrFieldClause(field);
|
|
435
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
425
436
|
|
|
426
437
|
if (!existingClause) {
|
|
427
438
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -300,7 +300,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
300
300
|
toolTipStyles = _this$state.toolTipStyles,
|
|
301
301
|
visible = _this$state.visible,
|
|
302
302
|
calculatedPosition = _this$state.calculatedPosition;
|
|
303
|
-
var classes = (0, _classnames.default)('euiToolTip',
|
|
303
|
+
var classes = (0, _classnames.default)('euiToolTip', className);
|
|
304
304
|
var anchorClasses = (0, _classnames.default)(anchorClassName, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.className);
|
|
305
305
|
return (0, _react3.jsx)(_react.default.Fragment, null, (0, _react3.jsx)(_tool_tip_anchor.EuiToolTipAnchor, _extends({}, anchorProps, {
|
|
306
306
|
ref: this.setAnchorRef,
|
|
@@ -323,7 +323,8 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
323
323
|
calculatedPosition: calculatedPosition
|
|
324
324
|
}, rest), (0, _react3.jsx)(_tool_tip_arrow.EuiToolTipArrow, {
|
|
325
325
|
style: arrowStyles,
|
|
326
|
-
className: "euiToolTip__arrow"
|
|
326
|
+
className: "euiToolTip__arrow",
|
|
327
|
+
position: calculatedPosition
|
|
327
328
|
}), (0, _react3.jsx)(_resize_observer.EuiResizeObserver, {
|
|
328
329
|
onResize: this.positionToolTip
|
|
329
330
|
}, function (resizeRef) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.euiToolTipStyles = exports.
|
|
6
|
+
exports.euiToolTipStyles = exports.euiToolTipBorderColor = exports.euiToolTipBackgroundColor = exports.euiToolTipAnchorStyles = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
|
|
@@ -42,47 +42,39 @@ var euiToolTipAnimationHorizontal = function euiToolTipAnimationHorizontal(size)
|
|
|
42
42
|
var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
43
43
|
var euiTheme = euiThemeContext.euiTheme,
|
|
44
44
|
colorMode = euiThemeContext.colorMode;
|
|
45
|
-
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards");
|
|
46
|
-
/*
|
|
47
|
-
* 1. Shift arrow 1px more than half its size to account for border radius
|
|
48
|
-
*/
|
|
45
|
+
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards"); // Shift arrow 1px more than half its size to account for border radius
|
|
49
46
|
|
|
50
47
|
var arrowSize = euiTheme.size.m;
|
|
51
48
|
var arrowPlusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
|
|
52
49
|
return (x / 2 + 1) * -1;
|
|
53
|
-
});
|
|
54
|
-
|
|
50
|
+
});
|
|
55
51
|
var arrowMinusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
|
|
56
52
|
return (x / 2 - 1) * -1;
|
|
57
|
-
});
|
|
58
|
-
|
|
53
|
+
});
|
|
59
54
|
return {
|
|
60
55
|
// Base
|
|
61
56
|
euiToolTip: /*#__PURE__*/(0, _react.css)((0, _amsterdam.euiShadow)(euiThemeContext), ";border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";color:", euiTheme.colors.ghost, ";z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";position:absolute;[class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme, colorMode), ";};label:euiToolTip;"),
|
|
62
57
|
// Sizes
|
|
63
58
|
s: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";;label:s;"),
|
|
64
59
|
// Positions
|
|
65
|
-
top: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, "
|
|
66
|
-
bottom: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";
|
|
67
|
-
left: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";
|
|
68
|
-
right: /*#__PURE__*/(0, _react.css)("animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";
|
|
69
|
-
//
|
|
70
|
-
euiToolTip__arrow: /*#__PURE__*/(0, _react.css)("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", (0, _global_styling.logicalSizeCSS)(arrowSize, arrowSize), "
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
colorMode = _ref4.colorMode;
|
|
79
|
-
return {
|
|
80
|
-
// Elements
|
|
60
|
+
top: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:top;"),
|
|
61
|
+
bottom: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";};label:bottom;"),
|
|
62
|
+
left: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:left;"),
|
|
63
|
+
right: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";};label:right;"),
|
|
64
|
+
// Arrow
|
|
65
|
+
euiToolTip__arrow: /*#__PURE__*/(0, _react.css)("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", (0, _global_styling.logicalSizeCSS)(arrowSize, arrowSize), ";;label:euiToolTip__arrow;"),
|
|
66
|
+
arrowPositions: {
|
|
67
|
+
top: /*#__PURE__*/(0, _react.css)("transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:top;"),
|
|
68
|
+
bottom: /*#__PURE__*/(0, _react.css)("transform:translateY(", arrowMinusSize, ") rotateZ(45deg);;label:bottom;"),
|
|
69
|
+
left: /*#__PURE__*/(0, _react.css)("transform:translateX(", arrowPlusSize, ") rotateZ(45deg);;label:left;"),
|
|
70
|
+
right: /*#__PURE__*/(0, _react.css)("transform:translateX(", arrowMinusSize, ") rotateZ(45deg);;label:right;")
|
|
71
|
+
},
|
|
72
|
+
// Title
|
|
81
73
|
euiToolTip__title: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.bold, ";", (0, _global_styling.logicalCSS)('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme, colorMode))), ";", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), ";", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;")
|
|
82
74
|
};
|
|
83
75
|
};
|
|
84
76
|
|
|
85
|
-
exports.
|
|
77
|
+
exports.euiToolTipStyles = euiToolTipStyles;
|
|
86
78
|
|
|
87
79
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
88
80
|
name: "fzilnk-inlineBlock",
|
|
@@ -7,22 +7,37 @@ exports.EuiToolTipArrow = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
10
12
|
var _services = require("../../services");
|
|
11
13
|
|
|
12
14
|
var _tool_tip = require("./tool_tip.styles");
|
|
13
15
|
|
|
14
16
|
var _react2 = require("@emotion/react");
|
|
15
17
|
|
|
18
|
+
var _excluded = ["position"];
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
18
22
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
23
|
|
|
20
|
-
var
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
var EuiToolTipArrow = function EuiToolTipArrow(_ref) {
|
|
29
|
+
var position = _ref.position,
|
|
30
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
21
32
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
22
|
-
var
|
|
33
|
+
var styles = (0, _tool_tip.euiToolTipStyles)(euiTheme);
|
|
34
|
+
var cssStyles = [styles.euiToolTip__arrow, styles.arrowPositions[position]];
|
|
23
35
|
return (0, _react2.jsx)("div", _extends({
|
|
24
|
-
css:
|
|
36
|
+
css: cssStyles
|
|
25
37
|
}, props));
|
|
26
38
|
};
|
|
27
39
|
|
|
28
|
-
exports.EuiToolTipArrow = EuiToolTipArrow;
|
|
40
|
+
exports.EuiToolTipArrow = EuiToolTipArrow;
|
|
41
|
+
EuiToolTipArrow.propTypes = {
|
|
42
|
+
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired
|
|
43
|
+
};
|
|
@@ -44,9 +44,8 @@ var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
|
44
44
|
|
|
45
45
|
var popover = (0, _react.useRef)();
|
|
46
46
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var titleCss = [popoverStyles.euiToolTip__title];
|
|
47
|
+
var styles = (0, _tool_tip.euiToolTipStyles)(euiTheme);
|
|
48
|
+
var cssStyles = [styles.euiToolTip, calculatedPosition && styles[calculatedPosition]];
|
|
50
49
|
var updateDimensions = (0, _react.useCallback)(function () {
|
|
51
50
|
requestAnimationFrame(function () {
|
|
52
51
|
// Because of this delay, sometimes `positionToolTip` becomes unavailable.
|
|
@@ -72,11 +71,12 @@ var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
|
72
71
|
}, [updateDimensions]);
|
|
73
72
|
var classes = (0, _classnames.default)('euiToolTipPopover', className);
|
|
74
73
|
return (0, _react2.jsx)("div", _extends({
|
|
75
|
-
css:
|
|
74
|
+
css: cssStyles,
|
|
76
75
|
className: classes,
|
|
77
|
-
ref: setPopoverRef
|
|
76
|
+
ref: setPopoverRef,
|
|
77
|
+
"data-position": calculatedPosition
|
|
78
78
|
}, rest), title && (0, _react2.jsx)("div", {
|
|
79
|
-
css:
|
|
79
|
+
css: styles.euiToolTip__title,
|
|
80
80
|
className: "euiToolTip__title"
|
|
81
81
|
}, title), children);
|
|
82
82
|
};
|
|
@@ -31,7 +31,7 @@ var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
31
31
|
colorMode = _ref.colorMode;
|
|
32
32
|
return {
|
|
33
33
|
// Targets EuiPopoverPanel
|
|
34
|
-
euiTour: /*#__PURE__*/(0, _react.css)("
|
|
34
|
+
euiTour: /*#__PURE__*/(0, _react.css)("[data-popover-arrow='top']::before{", (0, _global_styling.logicalCSS)('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -48,7 +48,8 @@ var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
50
50
|
// Base
|
|
51
|
-
euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], "
|
|
51
|
+
euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;", _global_styling.euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";};label:euiTourBeacon;"),
|
|
52
|
+
isOpen: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{opacity:1;};label:isOpen;"),
|
|
52
53
|
// Positions
|
|
53
54
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
|
|
54
55
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
|
|
@@ -33,7 +33,7 @@ var _tour = require("./tour.styles");
|
|
|
33
33
|
|
|
34
34
|
var _react2 = require("@emotion/react");
|
|
35
35
|
|
|
36
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
36
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
39
|
|
|
@@ -79,6 +79,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
79
79
|
anchor = _ref.anchor,
|
|
80
80
|
children = _ref.children,
|
|
81
81
|
className = _ref.className,
|
|
82
|
+
css = _ref.css,
|
|
82
83
|
_ref$closePopover = _ref.closePopover,
|
|
83
84
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
84
85
|
content = _ref.content,
|
|
@@ -98,6 +99,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
98
99
|
_ref$decoration = _ref.decoration,
|
|
99
100
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
100
101
|
footerAction = _ref.footerAction,
|
|
102
|
+
panelProps = _ref.panelProps,
|
|
101
103
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
102
104
|
|
|
103
105
|
var titleId = (0, _services.useGeneratedHtmlId)();
|
|
@@ -141,7 +143,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
141
143
|
var headerStyles = (0, _tour.euiTourHeaderStyles)(euiTheme);
|
|
142
144
|
var footerStyles = (0, _tour.euiTourFooterStyles)(euiTheme);
|
|
143
145
|
var beaconStyles = (0, _tour.euiTourBeaconStyles)(euiTheme);
|
|
144
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
146
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
145
147
|
var finishButtonProps = {
|
|
146
148
|
color: 'text',
|
|
147
149
|
flush: 'right',
|
|
@@ -200,9 +202,9 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
200
202
|
ownFocus: false,
|
|
201
203
|
panelClassName: classes,
|
|
202
204
|
panelStyle: style,
|
|
203
|
-
panelProps: {
|
|
204
|
-
css: tourStyles.euiTour
|
|
205
|
-
},
|
|
205
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
206
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
207
|
+
}),
|
|
206
208
|
offset: hasBeacon ? 10 : 0,
|
|
207
209
|
'aria-labelledby': titleId,
|
|
208
210
|
arrowChildren: hasBeacon && (0, _react2.jsx)(_beacon.EuiBeacon, {
|
|
@@ -11,6 +11,10 @@ var _logicals = _interopRequireDefault(require("./logicals.json"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
14
18
|
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; }
|
|
15
19
|
|
|
16
20
|
/**
|
|
@@ -102,9 +106,7 @@ var logicalSizeCSS = function logicalSizeCSS(width, height) {
|
|
|
102
106
|
exports.logicalSizeCSS = logicalSizeCSS;
|
|
103
107
|
|
|
104
108
|
var logicalSizeStyle = function logicalSizeStyle(width, height) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return _ref2 = {}, _defineProperty(_ref2, logicals.width, width), _defineProperty(_ref2, logicals.height, height), _ref2;
|
|
109
|
+
return _objectSpread(_objectSpread({}, logicalStyle('width', width)), logicalStyle('height', height));
|
|
108
110
|
}; // Text alignment is separate because its the value that changes not the property
|
|
109
111
|
|
|
110
112
|
|
|
@@ -28,28 +28,46 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
28
28
|
* Example usage:
|
|
29
29
|
* mathWithUnits('4px', (x) => x / 2) = '2px';
|
|
30
30
|
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
31
|
+
* mathWithUnits([euiTheme.size.l, euiTheme.size.s], (x, y) => x - y) = '16px';
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
// Unfortunately, this is the CSSProperties[] type used for several euiTheme vars
|
|
34
|
+
var mathWithUnits = function mathWithUnits(values, callback) {
|
|
33
35
|
var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
36
|
+
if (!Array.isArray(values)) values = [values];
|
|
37
|
+
var foundNumericValues = [];
|
|
38
|
+
var foundUnit = '';
|
|
39
|
+
values.forEach(function (value) {
|
|
40
|
+
if (typeof value === 'string') {
|
|
41
|
+
var _matches$groups, _matches$groups2;
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
|
|
44
|
+
value: 1,
|
|
45
|
+
unit: 2
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var matches = regex.exec(value);
|
|
49
|
+
var numericValue = Number(matches === null || matches === void 0 ? void 0 : (_matches$groups = matches.groups) === null || _matches$groups === void 0 ? void 0 : _matches$groups.value);
|
|
50
|
+
|
|
51
|
+
if (!isNaN(numericValue)) {
|
|
52
|
+
foundNumericValues.push(numericValue);
|
|
53
|
+
} else {
|
|
54
|
+
throw new Error('No valid numeric value found');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!unit && matches !== null && matches !== void 0 && (_matches$groups2 = matches.groups) !== null && _matches$groups2 !== void 0 && _matches$groups2.unit) {
|
|
58
|
+
if (!foundUnit) {
|
|
59
|
+
foundUnit = matches.groups.unit;
|
|
60
|
+
} else if (foundUnit !== matches.groups.unit) {
|
|
61
|
+
throw new Error('Multiple units found. Use `calc()` to mix and math multiple unit types (e.g. `%` & `px`) instead');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} else if (typeof value === 'number') {
|
|
65
|
+
foundNumericValues.push(value);
|
|
66
|
+
} else {
|
|
67
|
+
throw new Error('Invalid value type - pass a string or number');
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return "".concat(callback.apply(void 0, foundNumericValues)).concat(unit || foundUnit);
|
|
53
71
|
};
|
|
54
72
|
|
|
55
73
|
exports.mathWithUnits = mathWithUnits;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useEuiPaddingSize = exports.useEuiPaddingCSS = exports.euiPaddingSize = exports.PADDING_SIZES = void 0;
|
|
6
|
+
exports.useEuiPaddingSize = exports.useEuiPaddingCSS = exports.euiPaddingSizeCSS = exports.euiPaddingSize = exports.PADDING_SIZES = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
|
|
@@ -38,6 +38,20 @@ var euiPaddingSize = function euiPaddingSize(_ref, size) {
|
|
|
38
38
|
|
|
39
39
|
exports.euiPaddingSize = euiPaddingSize;
|
|
40
40
|
|
|
41
|
+
var euiPaddingSizeCSS = function euiPaddingSizeCSS(euiThemeContext, side) {
|
|
42
|
+
var property = side ? "padding-".concat(_functions.logicalSide[side]) : 'padding';
|
|
43
|
+
return {
|
|
44
|
+
none: null,
|
|
45
|
+
xs: /*#__PURE__*/(0, _react.css)(property, ":", euiPaddingSize(euiThemeContext, 'xs'), ";;label:xs;"),
|
|
46
|
+
s: /*#__PURE__*/(0, _react.css)(property, ":", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
|
|
47
|
+
m: /*#__PURE__*/(0, _react.css)(property, ":", euiPaddingSize(euiThemeContext, 'm'), ";;label:m;"),
|
|
48
|
+
l: /*#__PURE__*/(0, _react.css)(property, ":", euiPaddingSize(euiThemeContext, 'l'), ";;label:l;"),
|
|
49
|
+
xl: /*#__PURE__*/(0, _react.css)(property, ":", euiPaddingSize(euiThemeContext, 'xl'), ";;label:xl;")
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.euiPaddingSizeCSS = euiPaddingSizeCSS;
|
|
54
|
+
|
|
41
55
|
var useEuiPaddingSize = function useEuiPaddingSize(size) {
|
|
42
56
|
var euiTheme = (0, _theme.useEuiTheme)();
|
|
43
57
|
return euiPaddingSize(euiTheme, size);
|
|
@@ -46,15 +60,8 @@ var useEuiPaddingSize = function useEuiPaddingSize(size) {
|
|
|
46
60
|
exports.useEuiPaddingSize = useEuiPaddingSize;
|
|
47
61
|
|
|
48
62
|
var useEuiPaddingCSS = function useEuiPaddingCSS(side) {
|
|
49
|
-
var
|
|
50
|
-
return
|
|
51
|
-
none: null,
|
|
52
|
-
xs: /*#__PURE__*/(0, _react.css)(property, ":", useEuiPaddingSize('xs'), ";;label:xs;"),
|
|
53
|
-
s: /*#__PURE__*/(0, _react.css)(property, ":", useEuiPaddingSize('s'), ";;label:s;"),
|
|
54
|
-
m: /*#__PURE__*/(0, _react.css)(property, ":", useEuiPaddingSize('m'), ";;label:m;"),
|
|
55
|
-
l: /*#__PURE__*/(0, _react.css)(property, ":", useEuiPaddingSize('l'), ";;label:l;"),
|
|
56
|
-
xl: /*#__PURE__*/(0, _react.css)(property, ":", useEuiPaddingSize('xl'), ";;label:xl;")
|
|
57
|
-
};
|
|
63
|
+
var euiTheme = (0, _theme.useEuiTheme)();
|
|
64
|
+
return euiPaddingSizeCSS(euiTheme, side);
|
|
58
65
|
};
|
|
59
66
|
|
|
60
67
|
exports.useEuiPaddingCSS = useEuiPaddingCSS;
|
|
@@ -382,7 +382,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
382
382
|
sortName = _this$state2.sortName,
|
|
383
383
|
pageIndex = _this$state2.pageIndex,
|
|
384
384
|
pageSize = _this$state2.pageSize;
|
|
385
|
-
var matchingItems = query ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
385
|
+
var matchingItems = query !== null && (executeQueryOptions === null || executeQueryOptions === void 0 ? void 0 : executeQueryOptions.enabled) !== false ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
386
386
|
var sortedItems = sortName ? matchingItems.slice(0) // avoid mutating the source array
|
|
387
387
|
.sort(this.getItemSorter()) // sort, causes mutation
|
|
388
388
|
: matchingItems;
|
|
@@ -13,6 +13,8 @@ import React, { useMemo } from 'react';
|
|
|
13
13
|
import { highlight } from 'refractor';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { DEFAULT_LANGUAGE, checkSupportedLanguage, getHtmlContent } from './utils';
|
|
16
|
+
import { useEuiTheme } from '../../services';
|
|
17
|
+
import { euiCodeStyles } from './code.styles';
|
|
16
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
19
|
export var EuiCode = function EuiCode(_ref) {
|
|
18
20
|
var _ref$transparentBackg = _ref.transparentBackground,
|
|
@@ -36,11 +38,13 @@ export var EuiCode = function EuiCode(_ref) {
|
|
|
36
38
|
var content = useMemo(function () {
|
|
37
39
|
return getHtmlContent(data, children);
|
|
38
40
|
}, [data, children]);
|
|
39
|
-
var classes = classNames('euiCode',
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
var classes = classNames('euiCode', className);
|
|
42
|
+
var euiTheme = useEuiTheme();
|
|
43
|
+
var styles = euiCodeStyles(euiTheme);
|
|
44
|
+
var cssStyles = [styles.euiCode, transparentBackground && styles.transparentBackground];
|
|
42
45
|
return ___EmotionJSX("code", _extends({
|
|
43
46
|
className: classes,
|
|
47
|
+
css: cssStyles,
|
|
44
48
|
"data-code-language": language
|
|
45
49
|
}, rest), content);
|
|
46
50
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiCodeSyntaxColors, euiCodeSyntaxTokens } from './code_syntax.styles';
|
|
12
|
+
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "gfiv3z-transparentBackground",
|
|
15
|
+
styles: "background:transparent;label:transparentBackground;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "gfiv3z-transparentBackground",
|
|
18
|
+
styles: "background:transparent;label:transparentBackground;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export var euiCodeStyles = function euiCodeStyles(euiThemeContext) {
|
|
23
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
24
|
+
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
25
|
+
return {
|
|
26
|
+
/*
|
|
27
|
+
* 1. Size the code against the text its embedded within.
|
|
28
|
+
*/
|
|
29
|
+
euiCode: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;padding:0.2em 0.5em;background:", euiCodeSyntax.backgroundColor, ";border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.bold, ";color:", euiCodeSyntax.inlineCodeColor, ";", euiCodeSyntaxTokens(euiThemeContext), ";;label:euiCode;"),
|
|
30
|
+
transparentBackground: _ref
|
|
31
|
+
};
|
|
32
|
+
};
|