@elastic/eui 105.0.0 → 106.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_amsterdam_dark.json +2 -0
- package/dist/eui_theme_amsterdam_dark.json.d.ts +2 -0
- package/dist/eui_theme_amsterdam_light.json +2 -0
- package/dist/eui_theme_amsterdam_light.json.d.ts +2 -0
- package/dist/eui_theme_borealis_dark.json +2 -0
- package/dist/eui_theme_borealis_dark.json.d.ts +2 -0
- package/dist/eui_theme_borealis_light.json +10 -8
- package/dist/eui_theme_borealis_light.json.d.ts +2 -0
- package/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
- package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/es/components/date_picker/date_picker.styles.js +4 -1
- package/es/components/date_picker/date_picker_range.js +3 -2
- package/es/components/date_picker/date_picker_range.styles.js +11 -4
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
- package/es/components/flyout/_flyout_close_button.styles.js +10 -1
- package/es/components/flyout/flyout_child.js +8 -3
- package/es/components/flyout/flyout_child.styles.js +3 -2
- package/es/components/flyout/sessions/flyout_provider.js +7 -21
- package/es/components/flyout/sessions/flyout_reducer.js +5 -26
- package/es/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/es/components/form/field_number/field_number.styles.js +4 -1
- package/es/components/form/field_text/field_text.styles.js +4 -1
- package/es/components/form/file_picker/file_picker.js +107 -101
- package/es/components/form/file_picker/file_picker.styles.js +18 -17
- package/es/components/form/form.styles.js +72 -22
- package/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
- package/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
- package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/es/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/es/components/form/form_label/form_label.styles.js +4 -2
- package/es/components/header/header.styles.js +5 -3
- package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/es/components/progress/progress.a11y.js +7 -7
- package/es/components/progress/progress.js +18 -27
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +59 -23
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
- package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +63 -0
- package/es/global_styling/mixins/_button.js +1 -1
- package/es/services/color/eui_palettes.js +26 -0
- package/es/services/color/vis_color_store.js +1 -1
- package/es/services/color/visualization_colors.js +4 -0
- package/es/services/theme/provider.js +13 -6
- package/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/es/themes/amsterdam/theme.js +2 -1
- package/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/es/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/es/themes/json/eui_theme_borealis_dark.json +2 -0
- package/es/themes/json/eui_theme_borealis_light.json +10 -8
- package/eui.d.ts +461 -376
- package/i18ntokens.json +3595 -3523
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/lib/components/date_picker/date_picker.styles.js +4 -1
- package/lib/components/date_picker/date_picker_range.js +3 -2
- package/lib/components/date_picker/date_picker_range.styles.js +11 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/lib/components/flyout/_flyout_close_button.styles.js +10 -3
- package/lib/components/flyout/flyout_child.js +8 -3
- package/lib/components/flyout/flyout_child.styles.js +3 -2
- package/lib/components/flyout/sessions/flyout_provider.js +7 -21
- package/lib/components/flyout/sessions/flyout_reducer.js +5 -26
- package/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/lib/components/form/field_number/field_number.styles.js +4 -1
- package/lib/components/form/field_text/field_text.styles.js +4 -1
- package/lib/components/form/file_picker/file_picker.js +106 -100
- package/lib/components/form/file_picker/file_picker.styles.js +16 -15
- package/lib/components/form/form.styles.js +72 -22
- package/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/lib/components/form/form_label/form_label.styles.js +4 -2
- package/lib/components/header/header.styles.js +4 -2
- package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/lib/components/progress/progress.a11y.js +7 -7
- package/lib/components/progress/progress.js +18 -27
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +69 -0
- package/lib/global_styling/mixins/_button.js +1 -1
- package/lib/services/color/eui_palettes.js +26 -0
- package/lib/services/color/vis_color_store.js +1 -1
- package/lib/services/color/visualization_colors.js +3 -0
- package/lib/services/theme/provider.js +13 -6
- package/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/lib/themes/amsterdam/theme.js +2 -1
- package/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/lib/themes/json/eui_theme_borealis_dark.json +2 -0
- package/lib/themes/json/eui_theme_borealis_light.json +10 -8
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/optimize/es/components/date_picker/date_picker.styles.js +4 -1
- package/optimize/es/components/date_picker/date_picker_range.js +3 -2
- package/optimize/es/components/date_picker/date_picker_range.styles.js +11 -4
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
- package/optimize/es/components/flyout/_flyout_close_button.styles.js +10 -1
- package/optimize/es/components/flyout/flyout_child.js +4 -3
- package/optimize/es/components/flyout/flyout_child.styles.js +3 -2
- package/optimize/es/components/flyout/sessions/flyout_provider.js +7 -21
- package/optimize/es/components/flyout/sessions/flyout_reducer.js +5 -26
- package/optimize/es/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/optimize/es/components/form/field_number/field_number.styles.js +4 -1
- package/optimize/es/components/form/field_text/field_text.styles.js +4 -1
- package/optimize/es/components/form/file_picker/file_picker.js +107 -101
- package/optimize/es/components/form/file_picker/file_picker.styles.js +18 -17
- package/optimize/es/components/form/form.styles.js +72 -22
- package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/optimize/es/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/optimize/es/components/form/form_label/form_label.styles.js +4 -2
- package/optimize/es/components/header/header.styles.js +5 -3
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/optimize/es/components/progress/progress.a11y.js +7 -7
- package/optimize/es/components/progress/progress.js +18 -27
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +47 -22
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +52 -0
- package/optimize/es/global_styling/mixins/_button.js +1 -1
- package/optimize/es/services/color/eui_palettes.js +26 -0
- package/optimize/es/services/color/vis_color_store.js +1 -1
- package/optimize/es/services/color/visualization_colors.js +4 -0
- package/optimize/es/services/theme/provider.js +13 -6
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/optimize/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/optimize/es/themes/amsterdam/theme.js +2 -1
- package/optimize/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/optimize/es/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/optimize/es/themes/json/eui_theme_borealis_dark.json +2 -0
- package/optimize/es/themes/json/eui_theme_borealis_light.json +10 -8
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/optimize/lib/components/date_picker/date_picker.styles.js +4 -1
- package/optimize/lib/components/date_picker/date_picker_range.js +3 -2
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +11 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/optimize/lib/components/flyout/_flyout_close_button.styles.js +10 -3
- package/optimize/lib/components/flyout/flyout_child.js +4 -3
- package/optimize/lib/components/flyout/flyout_child.styles.js +3 -2
- package/optimize/lib/components/flyout/sessions/flyout_provider.js +7 -21
- package/optimize/lib/components/flyout/sessions/flyout_reducer.js +5 -26
- package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/optimize/lib/components/form/field_number/field_number.styles.js +4 -1
- package/optimize/lib/components/form/field_text/field_text.styles.js +4 -1
- package/optimize/lib/components/form/file_picker/file_picker.js +106 -100
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +16 -15
- package/optimize/lib/components/form/form.styles.js +72 -22
- package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/optimize/lib/components/form/form_label/form_label.styles.js +4 -2
- package/optimize/lib/components/header/header.styles.js +4 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/optimize/lib/components/progress/progress.a11y.js +7 -7
- package/optimize/lib/components/progress/progress.js +18 -27
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +45 -20
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +58 -0
- package/optimize/lib/global_styling/mixins/_button.js +1 -1
- package/optimize/lib/services/color/eui_palettes.js +26 -0
- package/optimize/lib/services/color/vis_color_store.js +1 -1
- package/optimize/lib/services/color/visualization_colors.js +3 -0
- package/optimize/lib/services/theme/provider.js +13 -6
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/optimize/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/optimize/lib/themes/amsterdam/theme.js +2 -1
- package/optimize/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/optimize/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/optimize/lib/themes/json/eui_theme_borealis_dark.json +2 -0
- package/optimize/lib/themes/json/eui_theme_borealis_light.json +10 -8
- package/package.json +12 -10
- package/src/themes/amsterdam/_colors_dark.scss +3 -0
- package/src/themes/amsterdam/_colors_light.scss +3 -0
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/test-env/components/date_picker/date_picker.styles.js +4 -1
- package/test-env/components/date_picker/date_picker_range.js +3 -2
- package/test-env/components/date_picker/date_picker_range.styles.js +11 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/test-env/components/flyout/_flyout_close_button.styles.js +10 -3
- package/test-env/components/flyout/flyout_child.js +8 -3
- package/test-env/components/flyout/flyout_child.styles.js +3 -2
- package/test-env/components/flyout/sessions/flyout_provider.js +7 -21
- package/test-env/components/flyout/sessions/flyout_reducer.js +5 -26
- package/test-env/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/test-env/components/form/field_number/field_number.styles.js +4 -1
- package/test-env/components/form/field_text/field_text.styles.js +4 -1
- package/test-env/components/form/file_picker/file_picker.js +106 -100
- package/test-env/components/form/file_picker/file_picker.styles.js +16 -15
- package/test-env/components/form/form.styles.js +72 -22
- package/test-env/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/test-env/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/test-env/components/form/form_label/form_label.styles.js +4 -2
- package/test-env/components/header/header.styles.js +4 -2
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/test-env/components/progress/progress.a11y.js +7 -7
- package/test-env/components/progress/progress.js +18 -27
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +68 -0
- package/test-env/global_styling/mixins/_button.js +1 -1
- package/test-env/services/color/eui_palettes.js +26 -0
- package/test-env/services/color/vis_color_store.js +1 -1
- package/test-env/services/color/visualization_colors.js +3 -0
- package/test-env/services/theme/provider.js +13 -6
- package/test-env/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/test-env/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/test-env/themes/amsterdam/theme.js +2 -1
- package/test-env/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/test-env/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/test-env/themes/json/eui_theme_borealis_dark.json +2 -0
- package/test-env/themes/json/eui_theme_borealis_light.json +10 -8
|
@@ -7,6 +7,8 @@ exports.euiDatePickerRangeStyles = exports.euiDatePickerRangeInlineStyles = void
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _euiThemeCommon = require("@elastic/eui-theme-common");
|
|
9
9
|
var _global_styling = require("../../global_styling");
|
|
10
|
+
var _services = require("../../services");
|
|
11
|
+
var _form = require("../form/form.styles");
|
|
10
12
|
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)."; } /*
|
|
11
13
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
14
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -14,8 +16,12 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
14
16
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
17
|
* Side Public License, v 1.
|
|
16
18
|
*/
|
|
17
|
-
var euiDatePickerRangeStyles = exports.euiDatePickerRangeStyles = {
|
|
18
|
-
|
|
19
|
+
var euiDatePickerRangeStyles = exports.euiDatePickerRangeStyles = function euiDatePickerRangeStyles(euiThemeContext) {
|
|
20
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'formVariant');
|
|
21
|
+
var refreshStyles = "\n .euiPopover:last-child {\n ".concat((0, _global_styling.logicalCSS)('border-top-right-radius', 'inherit'), "\n ").concat((0, _global_styling.logicalCSS)('border-bottom-right-radius', 'inherit'), "\n\n * {\n ").concat((0, _global_styling.logicalCSS)('border-top-right-radius', 'inherit'), "\n ").concat((0, _global_styling.logicalCSS)('border-bottom-right-radius', 'inherit'), "\n }\n }\n ");
|
|
22
|
+
return {
|
|
23
|
+
euiDatePickerRange: /*#__PURE__*/(0, _react.css)(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", (0, _global_styling.logicalCSS)('height', '100%'), ";}.euiPopover{flex:1;}", isRefreshVariant && refreshStyles, ";;label:euiDatePickerRange;")
|
|
24
|
+
};
|
|
19
25
|
};
|
|
20
26
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
21
27
|
name: "bicgs9-noShadow",
|
|
@@ -27,6 +33,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
27
33
|
};
|
|
28
34
|
var euiDatePickerRangeInlineStyles = exports.euiDatePickerRangeInlineStyles = function euiDatePickerRangeInlineStyles(euiThemeContext) {
|
|
29
35
|
var euiTheme = euiThemeContext.euiTheme;
|
|
36
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'formVariant');
|
|
30
37
|
|
|
31
38
|
// Use a container query to stack date pickers vertically if the container is
|
|
32
39
|
// not wide enough to fit both. We need a fn for this to render two width queries,
|
|
@@ -36,12 +43,12 @@ var euiDatePickerRangeInlineStyles = exports.euiDatePickerRangeInlineStyles = fu
|
|
|
36
43
|
return "\n display: block;\n container-type: inline-size;\n\n .euiFormControlLayout__childrenWrapper {\n /* Use static px widths for now, since render behavior comes from a third party library */\n @container (max-width: ".concat(datePickerWidth * 2 + delimiterWidth, "px) {\n /* Unset grid display */\n display: block !important;\n\n /* Center and point the default delimiter arrow downwards */\n .euiFormControlLayoutDelimited__delimiter .euiIcon {\n transform: rotate(90deg);\n margin-inline: auto;\n }\n }\n }");
|
|
37
44
|
};
|
|
38
45
|
return {
|
|
39
|
-
euiDatePickerRangeInline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " border:none;padding:0;.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
|
|
46
|
+
euiDatePickerRangeInline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " border:none;padding:0;", isRefreshVariant && "\n &::after {\n display: none;\n }\n ", ";.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
|
|
40
47
|
responsive: /*#__PURE__*/(0, _react.css)(containerQuery(268), ";;label:responsive;"),
|
|
41
48
|
responsiveWithTimeSelect: /*#__PURE__*/(0, _react.css)(containerQuery(374), ";;label:responsiveWithTimeSelect;"),
|
|
42
49
|
shadow: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _euiThemeCommon.euiShadowMedium)(euiThemeContext, {
|
|
43
50
|
borderAllInHighContrastMode: true
|
|
44
|
-
}), ";};label:shadow;"),
|
|
51
|
+
}), " ", isRefreshVariant && "\n /* the form layout is not part of the interactive behavior but rather a container in this variant */\n ".concat((0, _form.disableFormControlHoverStyles)(), "\n\n .euiFormControlLayout__childrenWrapper {\n box-shadow: none;\n ").concat((0, _form.disableFormControlHoverStyles)(), "\n }\n "), ";};label:shadow;"),
|
|
45
52
|
// Applied directly to EuiFormControlLayout so we can check if `disabled`
|
|
46
53
|
// and allow the disabled background-color to take precedence
|
|
47
54
|
formLayout: {
|
|
@@ -26,6 +26,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
26
26
|
};
|
|
27
27
|
var euiSuperDatePickerStyles = exports.euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiThemeContext) {
|
|
28
28
|
var euiTheme = euiThemeContext.euiTheme;
|
|
29
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'formVariant');
|
|
29
30
|
var forms = (0, _form.euiFormVariables)(euiThemeContext);
|
|
30
31
|
var inputWidth = euiTheme.base * 30;
|
|
31
32
|
var buttonWidth = euiTheme.base * 7; // @see _button_display.styles.ts
|
|
@@ -45,6 +46,18 @@ var euiSuperDatePickerStyles = exports.euiSuperDatePickerStyles = function euiSu
|
|
|
45
46
|
// Needs updating colors
|
|
46
47
|
var needsUpdatingBackgroundColor = euiTheme.components.superDatePickerBackgroundSuccees;
|
|
47
48
|
var needsUpdatingTextColor = (0, _services.makeHighContrastColor)(euiTheme.colors.success)(needsUpdatingBackgroundColor);
|
|
49
|
+
var formLayoutStyles = "\n /* using wrapper hover styles instead */\n .euiDatePopoverButton:not(.euiDatePopoverButton-isSelected):hover {\n outline: none;\n }\n\n .euiPopover {\n /* mimic input border-radius */\n border-radius: ".concat(forms.controlBorderRadius, ";\n\n &:first-child {\n ").concat((0, _global_styling.logicalCSS)('border-top-left-radius', 'inherit'), "\n ").concat((0, _global_styling.logicalCSS)('border-bottom-left-radius', 'inherit'), "\n }\n\n &:last-child {\n ").concat((0, _global_styling.logicalCSS)('border-top-right-radius', 'inherit'), "\n ").concat((0, _global_styling.logicalCSS)('border-bottom-right-radius', 'inherit'), "\n }\n }\n\n .euiDatePopoverButton {\n background-color: transparent;\n border-radius: inherit;\n }\n ");
|
|
50
|
+
var popoverButtonFocusStyles = isRefreshVariant ? "\n ".concat((0, _form.euiFormControlFocusStyles)(euiThemeContext), "\n ") : "\n --euiFormControlStateColor: ".concat(euiTheme.colors.primary, ";\n ").concat((0, _form.euiFormControlShowBackgroundLine)(euiThemeContext, euiTheme.colors.primary), "\n ");
|
|
51
|
+
var invalidStyles = isRefreshVariant ? "\n &:has(.euiPopover-isOpen, .euiDatePopoverButton:focus) {\n --euiFormControlStateColor: ".concat(forms.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(forms.borderHovered, ";\n }\n\n &:not(:has(.euiPopover-isOpen, .euiDatePopoverButton:focus)) {\n ").concat((0, _form.euiFormControlInvalidStyles)(euiThemeContext), "\n }\n\n .euiDatePopoverButton:focus,\n .euiPopover-isOpen .euiDatePopoverButton {\n ").concat((0, _form.euiFormControlFocusStyles)(euiThemeContext), "\n }\n ") : "\n ".concat((0, _form.euiFormControlInvalidStyles)(euiThemeContext), "\n ");
|
|
52
|
+
var needsUpdatingStyles = "\n --euiFormControlStateColor: ".concat(euiTheme.colors.success, ";\n --euiFormControlStateHoverColor: ").concat(euiTheme.colors.success, ";\n --euiFormControlStateWidth: ").concat(euiTheme.border.width.thin, ";\n ").concat(_form.euiFormControlHighlightBorderStyles, "\n \n &:has(.euiPopover-isOpen),\n &:focus-within {\n --euiFormControlStateColor: ").concat(forms.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(forms.borderHovered, ";\n }\n ");
|
|
53
|
+
var needsUpdatingPopoverButtonFocusStyles = isRefreshVariant ? "\n ".concat((0, _form.euiFormControlFocusStyles)(euiThemeContext), "\n ") : "\n --euiFormControlStateColor: ".concat(euiTheme.colors.success, ";\n ").concat((0, _form.euiFormControlShowBackgroundLine)(euiThemeContext, euiTheme.colors.success), "\n\n ").concat((0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
54
|
+
// Force the fill color of all icons/svgs to give a bit more indication of state,
|
|
55
|
+
// since Windows high contrast themes otherwise override background/text color
|
|
56
|
+
forced: "\n svg,\n & + * svg {\n fill: ".concat(euiTheme.colors.success, ";\n }\n ")
|
|
57
|
+
}), "\n ");
|
|
58
|
+
var prettyFormatStyles = "\n --euiFormControlStateHoverColor: ".concat(forms.borderHovered, ";\n ").concat((0, _form.euiFormControlDefaultShadow)(euiThemeContext), "\n \n ").concat((0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
59
|
+
preferred: "\n border: none;\n "
|
|
60
|
+
}), "\n\n &:focus {\n ").concat((0, _form.euiFormControlFocusStyles)(euiThemeContext), "\n }\n ");
|
|
48
61
|
return {
|
|
49
62
|
euiSuperDatePicker: /*#__PURE__*/(0, _react.css)("display:flex;gap:", gap, ";", (0, _global_styling.logicalCSS)('max-width', '100%'), " ", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('width', '100%'), ";};label:euiSuperDatePicker;"),
|
|
50
63
|
widths: {
|
|
@@ -69,27 +82,23 @@ var euiSuperDatePickerStyles = exports.euiSuperDatePickerStyles = function euiSu
|
|
|
69
82
|
isQuickSelectOnly: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', 0), ".euiFormControlLayout__prepend{", (0, _global_styling.logicalCSS)('max-width', 'none'), ";};label:isQuickSelectOnly;"),
|
|
70
83
|
euiSuperDatePicker__range: _ref,
|
|
71
84
|
euiSuperDatePicker__rangeInput: /*#__PURE__*/(0, _react.css)("flex-grow:1;", (0, _global_styling.logicalCSS)('width', 'auto'), " overflow:hidden;;label:euiSuperDatePicker__rangeInput;"),
|
|
72
|
-
euiSuperDatePicker__prettyFormat: /*#__PURE__*/(0, _react.css)(_buttonStyles(euiThemeContext), " text-align:start;;label:euiSuperDatePicker__prettyFormat;"),
|
|
85
|
+
euiSuperDatePicker__prettyFormat: /*#__PURE__*/(0, _react.css)(_buttonStyles(euiThemeContext), " text-align:start;", isRefreshVariant && prettyFormatStyles, ";;label:euiSuperDatePicker__prettyFormat;"),
|
|
73
86
|
// Form states
|
|
74
87
|
states: {
|
|
75
|
-
euiSuperDatePicker__formControlLayout: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{", (0, _form.euiFormControlDefaultShadow)(euiThemeContext), " ", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
88
|
+
euiSuperDatePicker__formControlLayout: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{--euiFormControlStateHoverColor:", forms.borderHovered, ";", (0, _form.euiFormControlDefaultShadow)(euiThemeContext), " ", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
76
89
|
none: 'box-shadow: none;',
|
|
77
90
|
preferred: 'border: none;'
|
|
78
|
-
}), ";};label:euiSuperDatePicker__formControlLayout;"),
|
|
79
|
-
default: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{color:", forms.textColor, ";background-color:", forms.backgroundColor, ";}.euiDatePopoverButton{", (0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
|
|
91
|
+
}), " ", isRefreshVariant && formLayoutStyles, ";};label:euiSuperDatePicker__formControlLayout;"),
|
|
92
|
+
default: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{color:", forms.textColor, ";background-color:", forms.backgroundColor, ";}.euiDatePopoverButton{--euiFormControlStateHoverColor:", forms.borderHovered, ";", !isRefreshVariant && (0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
|
|
80
93
|
withBorder: false,
|
|
81
94
|
withBackgroundColor: false
|
|
82
|
-
}), ";}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{
|
|
95
|
+
}), " box-shadow:none;}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{", popoverButtonFocusStyles, ";};label:default;"),
|
|
83
96
|
disabled: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{", (0, _form.euiFormControlDisabledStyles)(euiThemeContext), ";};label:disabled;"),
|
|
84
|
-
invalid: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{color:", euiTheme.colors.textDanger, ";background-color:", forms.backgroundColor, ";",
|
|
85
|
-
needsUpdating: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{color:", needsUpdatingTextColor, ";background-color:", needsUpdatingBackgroundColor, ";}.euiFormControlLayoutDelimited__delimiter{color:inherit;}.euiDatePopoverButton{", (0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
|
|
97
|
+
invalid: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{color:", euiTheme.colors.textDanger, ";background-color:", forms.backgroundColor, ";", invalidStyles, ";};label:invalid;"),
|
|
98
|
+
needsUpdating: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{color:", needsUpdatingTextColor, ";background-color:", needsUpdatingBackgroundColor, ";", isRefreshVariant && needsUpdatingStyles, ";}.euiFormControlLayoutDelimited__delimiter{color:inherit;}.euiDatePopoverButton{", (0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
|
|
86
99
|
withBorder: false,
|
|
87
100
|
withBackgroundColor: false
|
|
88
|
-
}), ";}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{
|
|
89
|
-
// Force the fill color of all icons/svgs to give a bit more indication of state,
|
|
90
|
-
// since Windows high contrast themes otherwise override background/text color
|
|
91
|
-
forced: "\n svg,\n & + * svg {\n fill: ".concat(euiTheme.colors.success, ";\n }\n ")
|
|
92
|
-
}), ";;label:needsUpdating;")
|
|
101
|
+
}), " background-color:inherit;box-shadow:none;}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{", needsUpdatingPopoverButtonFocusStyles, ";};label:needsUpdating;")
|
|
93
102
|
}
|
|
94
103
|
};
|
|
95
104
|
};
|
|
@@ -8,19 +8,26 @@ var _react = require("@emotion/react");
|
|
|
8
8
|
var _euiThemeCommon = require("@elastic/eui-theme-common");
|
|
9
9
|
var _global_styling = require("../../global_styling");
|
|
10
10
|
var _flyout = require("./flyout.styles");
|
|
11
|
-
/*
|
|
11
|
+
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)."; } /*
|
|
12
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
13
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
14
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
19
|
+
name: "1ffeobd-inside",
|
|
20
|
+
styles: "background-color:transparent;label:inside;"
|
|
21
|
+
} : {
|
|
22
|
+
name: "1ffeobd-inside",
|
|
23
|
+
styles: "background-color:transparent;label:inside;",
|
|
24
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
25
|
+
};
|
|
19
26
|
var euiFlyoutCloseButtonStyles = exports.euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
|
|
20
27
|
var euiTheme = euiThemeContext.euiTheme;
|
|
21
28
|
return {
|
|
22
29
|
euiFlyout__closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('right', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('top', euiTheme.size.s), " z-index:3;;label:euiFlyout__closeButton;"),
|
|
23
|
-
inside:
|
|
30
|
+
inside: _ref,
|
|
24
31
|
outside: /*#__PURE__*/(0, _react.css)((0, _euiThemeCommon.euiShadowXLarge)(euiThemeContext, {
|
|
25
32
|
borderAllInHighContrastMode: true
|
|
26
33
|
}), "animation:none!important;;label:outside;"),
|
|
@@ -18,7 +18,7 @@ var _flyout_context = require("./flyout_context");
|
|
|
18
18
|
var _flyout_body = require("./flyout_body");
|
|
19
19
|
var _focus_trap = require("../focus_trap");
|
|
20
20
|
var _react2 = require("@emotion/react");
|
|
21
|
-
var _excluded = ["children", "className", "banner", "hideCloseButton", "onClose", "scrollableTabIndex", "size"];
|
|
21
|
+
var _excluded = ["children", "backgroundStyle", "className", "banner", "hideCloseButton", "onClose", "scrollableTabIndex", "size"];
|
|
22
22
|
/*
|
|
23
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
24
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -37,6 +37,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
37
37
|
*/
|
|
38
38
|
var EuiFlyoutChild = exports.EuiFlyoutChild = function EuiFlyoutChild(_ref) {
|
|
39
39
|
var children = _ref.children,
|
|
40
|
+
_ref$backgroundStyle = _ref.backgroundStyle,
|
|
41
|
+
backgroundStyle = _ref$backgroundStyle === void 0 ? 'default' : _ref$backgroundStyle,
|
|
40
42
|
className = _ref.className,
|
|
41
43
|
banner = _ref.banner,
|
|
42
44
|
_ref$hideCloseButton = _ref.hideCloseButton,
|
|
@@ -129,7 +131,7 @@ var EuiFlyoutChild = exports.EuiFlyoutChild = function EuiFlyoutChild(_ref) {
|
|
|
129
131
|
var styles = (0, _services.useEuiMemoizedStyles)(_flyout_child.euiFlyoutChildStyles);
|
|
130
132
|
var childLayoutMode = flyoutContext.childLayoutMode,
|
|
131
133
|
parentFlyoutRef = flyoutContext.parentFlyoutRef;
|
|
132
|
-
var flyoutChildCss = [styles.euiFlyoutChild, size === 's' ? styles.s : styles.m, childLayoutMode === 'side-by-side' ? styles.sidePosition : styles.stackedPosition];
|
|
134
|
+
var flyoutChildCss = [styles.euiFlyoutChild, backgroundStyle === 'shaded' ? styles.backgroundShaded : styles.backgroundDefault, size === 's' ? styles.s : styles.m, childLayoutMode === 'side-by-side' ? styles.sidePosition : styles.stackedPosition];
|
|
133
135
|
return (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
134
136
|
returnFocus: function returnFocus() {
|
|
135
137
|
if (parentFlyoutRef !== null && parentFlyoutRef !== void 0 && parentFlyoutRef.current) {
|
|
@@ -156,7 +158,6 @@ var EuiFlyoutChild = exports.EuiFlyoutChild = function EuiFlyoutChild(_ref) {
|
|
|
156
158
|
className: "euiScreenReaderOnly"
|
|
157
159
|
}, flyoutTitleText), !hideCloseButton && (0, _react2.jsx)(_flyout_close_button.EuiFlyoutCloseButton, {
|
|
158
160
|
className: "euiFlyoutChild__closeButton",
|
|
159
|
-
css: styles.closeButton,
|
|
160
161
|
onClose: handleClose,
|
|
161
162
|
side: "right",
|
|
162
163
|
closeButtonPosition: "inside",
|
|
@@ -204,6 +205,10 @@ EuiFlyoutChild.propTypes = {
|
|
|
204
205
|
* @default 's'
|
|
205
206
|
*/
|
|
206
207
|
size: _propTypes.default.oneOf(["s", "m"]),
|
|
208
|
+
/*
|
|
209
|
+
* The background of the child flyout can be optionally shaded. Use `shaded` to add the shading.
|
|
210
|
+
*/
|
|
211
|
+
backgroundStyle: _propTypes.default.oneOf(["shaded", "default"]),
|
|
207
212
|
/**
|
|
208
213
|
* Children are implicitly part of FunctionComponent, but good to have if props type is standalone.
|
|
209
214
|
*/
|
|
@@ -19,13 +19,14 @@ var euiFlyoutChildStyles = exports.euiFlyoutChildStyles = function euiFlyoutChil
|
|
|
19
19
|
var euiTheme = euiThemeContext.euiTheme;
|
|
20
20
|
return {
|
|
21
21
|
// Base styles for the child flyout
|
|
22
|
-
euiFlyoutChild: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:0;inset-inline-start:0;block-size:100%;
|
|
22
|
+
euiFlyoutChild: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:0;inset-inline-start:0;block-size:100%;display:flex;flex-direction:column;", (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'hidden'), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", Number(euiTheme.levels.flyout) + 1, ";border-inline-start:", euiTheme.border.thin, ";", (0, _flyout.maxedFlyoutWidth)(euiThemeContext), ";;label:euiFlyoutChild;"),
|
|
23
|
+
backgroundDefault: /*#__PURE__*/(0, _react.css)("background:", euiTheme.colors.backgroundBasePlain, ";;label:backgroundDefault;"),
|
|
24
|
+
backgroundShaded: /*#__PURE__*/(0, _react.css)("background:", euiTheme.colors.backgroundBaseSubdued, ";;label:backgroundShaded;"),
|
|
23
25
|
// Position variants based on screen size
|
|
24
26
|
sidePosition: /*#__PURE__*/(0, _react.css)("transform:translateX(-100%);border-inline-end:", euiTheme.border.thin, ";;label:sidePosition;"),
|
|
25
27
|
stackedPosition: /*#__PURE__*/(0, _react.css)("inset-inline-end:0;inline-size:100%;border-block-end:", euiTheme.border.thin, ";;label:stackedPosition;"),
|
|
26
28
|
s: /*#__PURE__*/(0, _react.css)((0, _flyout.composeFlyoutSizing)(euiThemeContext, 's'), ";;label:s;"),
|
|
27
29
|
m: /*#__PURE__*/(0, _react.css)((0, _flyout.composeFlyoutSizing)(euiThemeContext, 'm'), ";;label:m;"),
|
|
28
|
-
closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:", euiTheme.size.s, ";inset-inline-end:", euiTheme.size.s, ";z-index:1;;label:closeButton;"),
|
|
29
30
|
overflow: {
|
|
30
31
|
overflow: /*#__PURE__*/(0, _react.css)("flex-grow:1;display:flex;flex-direction:column;", (0, _global_styling.euiYScroll)(euiThemeContext), ";;label:overflow;"),
|
|
31
32
|
wrapper: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:column;flex-grow:1;", (0, _global_styling.logicalCSS)('overflow-x', 'auto'), ";;label:wrapper;")
|
|
@@ -49,7 +49,8 @@ var useEuiFlyoutSessionContext = exports.useEuiFlyoutSessionContext = function u
|
|
|
49
49
|
var EuiFlyoutSessionProvider = exports.EuiFlyoutSessionProvider = function EuiFlyoutSessionProvider(_ref) {
|
|
50
50
|
var children = _ref.children,
|
|
51
51
|
renderMainFlyoutContent = _ref.renderMainFlyoutContent,
|
|
52
|
-
renderChildFlyoutContent = _ref.renderChildFlyoutContent
|
|
52
|
+
renderChildFlyoutContent = _ref.renderChildFlyoutContent,
|
|
53
|
+
onUnmount = _ref.onUnmount;
|
|
53
54
|
var _useReducer = (0, _react.useReducer)(_flyout_reducer.flyoutReducer, _flyout_reducer.initialFlyoutState),
|
|
54
55
|
_useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
|
|
55
56
|
state = _useReducer2[0],
|
|
@@ -68,29 +69,13 @@ var EuiFlyoutSessionProvider = exports.EuiFlyoutSessionProvider = function EuiFl
|
|
|
68
69
|
var mainFlyoutContentNode = null;
|
|
69
70
|
var childFlyoutContentNode = null;
|
|
70
71
|
if (activeFlyoutGroup) {
|
|
71
|
-
var
|
|
72
|
-
flyoutProps: activeFlyoutGroup.config.mainFlyoutProps || {},
|
|
73
|
-
flyoutSize: activeFlyoutGroup.config.mainSize,
|
|
74
|
-
flyoutType: 'main',
|
|
75
|
-
dispatch: dispatch,
|
|
72
|
+
var renderContext = {
|
|
76
73
|
activeFlyoutGroup: activeFlyoutGroup,
|
|
77
|
-
onCloseFlyout: handleClose,
|
|
78
|
-
onCloseChildFlyout: handleCloseChild,
|
|
79
74
|
meta: activeFlyoutGroup.meta
|
|
80
75
|
};
|
|
81
|
-
mainFlyoutContentNode = renderMainFlyoutContent(
|
|
76
|
+
mainFlyoutContentNode = renderMainFlyoutContent(renderContext);
|
|
82
77
|
if (activeFlyoutGroup.isChildOpen && renderChildFlyoutContent) {
|
|
83
|
-
|
|
84
|
-
flyoutProps: activeFlyoutGroup.config.childFlyoutProps || {},
|
|
85
|
-
flyoutSize: activeFlyoutGroup.config.childSize,
|
|
86
|
-
flyoutType: 'child',
|
|
87
|
-
dispatch: dispatch,
|
|
88
|
-
activeFlyoutGroup: activeFlyoutGroup,
|
|
89
|
-
onCloseFlyout: handleClose,
|
|
90
|
-
onCloseChildFlyout: handleCloseChild,
|
|
91
|
-
meta: activeFlyoutGroup.meta
|
|
92
|
-
};
|
|
93
|
-
childFlyoutContentNode = renderChildFlyoutContent(childRenderContext);
|
|
78
|
+
childFlyoutContentNode = renderChildFlyoutContent(renderContext);
|
|
94
79
|
} else if (activeFlyoutGroup.isChildOpen && !renderChildFlyoutContent) {
|
|
95
80
|
console.warn('EuiFlyoutSessionProvider: A child flyout is open, but renderChildFlyoutContent was not provided.');
|
|
96
81
|
}
|
|
@@ -101,7 +86,8 @@ var EuiFlyoutSessionProvider = exports.EuiFlyoutSessionProvider = function EuiFl
|
|
|
101
86
|
return (0, _react2.jsx)(EuiFlyoutSessionContext.Provider, {
|
|
102
87
|
value: {
|
|
103
88
|
state: state,
|
|
104
|
-
dispatch: dispatch
|
|
89
|
+
dispatch: dispatch,
|
|
90
|
+
onUnmount: onUnmount
|
|
105
91
|
}
|
|
106
92
|
}, children, (activeFlyoutGroup === null || activeFlyoutGroup === void 0 ? void 0 : activeFlyoutGroup.isMainOpen) && (0, _react2.jsx)(_index.EuiFlyout, (0, _extends2.default)({
|
|
107
93
|
onClose: handleClose,
|
|
@@ -65,8 +65,7 @@ function flyoutReducer(state, action) {
|
|
|
65
65
|
var _state$activeFlyoutGr, _state$activeFlyoutGr2;
|
|
66
66
|
var _action$payload = action.payload,
|
|
67
67
|
size = _action$payload.size,
|
|
68
|
-
flyoutProps = _action$payload.flyoutProps
|
|
69
|
-
onUnmount = _action$payload.onUnmount;
|
|
68
|
+
flyoutProps = _action$payload.flyoutProps;
|
|
70
69
|
var newHistory = (0, _toConsumableArray2.default)(state.history);
|
|
71
70
|
if (state.activeFlyoutGroup) {
|
|
72
71
|
newHistory.push(state.activeFlyoutGroup);
|
|
@@ -80,8 +79,6 @@ function flyoutReducer(state, action) {
|
|
|
80
79
|
mainFlyoutProps: flyoutProps,
|
|
81
80
|
childFlyoutProps: {}
|
|
82
81
|
},
|
|
83
|
-
mainOnUnmount: onUnmount,
|
|
84
|
-
childOnUnmount: undefined,
|
|
85
82
|
meta: action.payload.meta !== undefined ? ((_state$activeFlyoutGr = state.activeFlyoutGroup) === null || _state$activeFlyoutGr === void 0 ? void 0 : _state$activeFlyoutGr.meta) !== undefined ? _objectSpread(_objectSpread({}, state.activeFlyoutGroup.meta), action.payload.meta) : action.payload.meta : (_state$activeFlyoutGr2 = state.activeFlyoutGroup) === null || _state$activeFlyoutGr2 === void 0 ? void 0 : _state$activeFlyoutGr2.meta
|
|
86
83
|
};
|
|
87
84
|
return {
|
|
@@ -97,15 +94,13 @@ function flyoutReducer(state, action) {
|
|
|
97
94
|
}
|
|
98
95
|
var _action$payload2 = action.payload,
|
|
99
96
|
_size = _action$payload2.size,
|
|
100
|
-
_flyoutProps = _action$payload2.flyoutProps
|
|
101
|
-
_onUnmount = _action$payload2.onUnmount;
|
|
97
|
+
_flyoutProps = _action$payload2.flyoutProps;
|
|
102
98
|
var updatedActiveGroup = _objectSpread(_objectSpread({}, state.activeFlyoutGroup), {}, {
|
|
103
99
|
isChildOpen: true,
|
|
104
100
|
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), {}, {
|
|
105
101
|
childSize: _size,
|
|
106
102
|
childFlyoutProps: _flyoutProps
|
|
107
103
|
}),
|
|
108
|
-
childOnUnmount: _onUnmount,
|
|
109
104
|
meta: action.payload.meta !== undefined ? state.activeFlyoutGroup.meta !== undefined ? _objectSpread(_objectSpread({}, state.activeFlyoutGroup.meta), action.payload.meta) : action.payload.meta : state.activeFlyoutGroup.meta
|
|
110
105
|
});
|
|
111
106
|
return {
|
|
@@ -134,8 +129,6 @@ function flyoutReducer(state, action) {
|
|
|
134
129
|
mainFlyoutProps: main.flyoutProps,
|
|
135
130
|
childFlyoutProps: child.flyoutProps
|
|
136
131
|
},
|
|
137
|
-
mainOnUnmount: main.onUnmount,
|
|
138
|
-
childOnUnmount: child.onUnmount,
|
|
139
132
|
meta: meta
|
|
140
133
|
};
|
|
141
134
|
return {
|
|
@@ -145,18 +138,15 @@ function flyoutReducer(state, action) {
|
|
|
145
138
|
}
|
|
146
139
|
case 'CLOSE_CHILD_FLYOUT':
|
|
147
140
|
{
|
|
148
|
-
var _state$activeFlyoutGr3, _state$activeFlyoutGr4;
|
|
149
141
|
if (!state.activeFlyoutGroup || !state.activeFlyoutGroup.isChildOpen) {
|
|
150
142
|
console.warn('Cannot close child flyout: no child is open or no active group.');
|
|
151
143
|
return state;
|
|
152
144
|
}
|
|
153
|
-
(_state$activeFlyoutGr3 = (_state$activeFlyoutGr4 = state.activeFlyoutGroup).childOnUnmount) === null || _state$activeFlyoutGr3 === void 0 || _state$activeFlyoutGr3.call(_state$activeFlyoutGr4);
|
|
154
145
|
var _updatedActiveGroup = _objectSpread(_objectSpread({}, state.activeFlyoutGroup), {}, {
|
|
155
146
|
isChildOpen: false,
|
|
156
147
|
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), {}, {
|
|
157
148
|
childFlyoutProps: {}
|
|
158
|
-
})
|
|
159
|
-
childOnUnmount: undefined
|
|
149
|
+
})
|
|
160
150
|
});
|
|
161
151
|
return {
|
|
162
152
|
history: state.history,
|
|
@@ -165,13 +155,7 @@ function flyoutReducer(state, action) {
|
|
|
165
155
|
}
|
|
166
156
|
case 'GO_BACK':
|
|
167
157
|
{
|
|
168
|
-
var _state$activeFlyoutGr7, _state$activeFlyoutGr8;
|
|
169
158
|
if (!state.activeFlyoutGroup) return initialFlyoutState;
|
|
170
|
-
if (state.activeFlyoutGroup.isChildOpen) {
|
|
171
|
-
var _state$activeFlyoutGr5, _state$activeFlyoutGr6;
|
|
172
|
-
(_state$activeFlyoutGr5 = (_state$activeFlyoutGr6 = state.activeFlyoutGroup).childOnUnmount) === null || _state$activeFlyoutGr5 === void 0 || _state$activeFlyoutGr5.call(_state$activeFlyoutGr6);
|
|
173
|
-
}
|
|
174
|
-
(_state$activeFlyoutGr7 = (_state$activeFlyoutGr8 = state.activeFlyoutGroup).mainOnUnmount) === null || _state$activeFlyoutGr7 === void 0 || _state$activeFlyoutGr7.call(_state$activeFlyoutGr8);
|
|
175
159
|
|
|
176
160
|
// Restore from history or return to initial state
|
|
177
161
|
if (state.history.length > 0) {
|
|
@@ -191,14 +175,9 @@ function flyoutReducer(state, action) {
|
|
|
191
175
|
console.warn('Cannot update config: no active flyout group.');
|
|
192
176
|
return state;
|
|
193
177
|
}
|
|
194
|
-
var
|
|
195
|
-
configChanges = _action$payload4.configChanges,
|
|
196
|
-
newMainOnUnmount = _action$payload4.newMainOnUnmount,
|
|
197
|
-
newChildOnUnmount = _action$payload4.newChildOnUnmount;
|
|
178
|
+
var configChanges = action.payload.configChanges;
|
|
198
179
|
var _updatedActiveGroup2 = _objectSpread(_objectSpread({}, state.activeFlyoutGroup), {}, {
|
|
199
|
-
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), configChanges)
|
|
200
|
-
mainOnUnmount: newMainOnUnmount !== undefined ? newMainOnUnmount : state.activeFlyoutGroup.mainOnUnmount,
|
|
201
|
-
childOnUnmount: newChildOnUnmount !== undefined ? newChildOnUnmount : state.activeFlyoutGroup.childOnUnmount
|
|
180
|
+
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), configChanges)
|
|
202
181
|
});
|
|
203
182
|
var finalUpdatedActiveGroup = applySizeConstraints(_updatedActiveGroup2);
|
|
204
183
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useEuiFlyoutSession = useEuiFlyoutSession;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _flyout_provider = require("./flyout_provider");
|
|
8
9
|
/*
|
|
9
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -27,12 +28,24 @@ var _flyout_provider = require("./flyout_provider");
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Hook for accessing the flyout API
|
|
31
|
+
* @public
|
|
30
32
|
*/
|
|
31
33
|
function useEuiFlyoutSession() {
|
|
32
34
|
var _state$activeFlyoutGr, _state$activeFlyoutGr2;
|
|
33
35
|
var _useEuiFlyoutSessionC = (0, _flyout_provider.useEuiFlyoutSessionContext)(),
|
|
34
36
|
state = _useEuiFlyoutSessionC.state,
|
|
35
|
-
dispatch = _useEuiFlyoutSessionC.dispatch
|
|
37
|
+
dispatch = _useEuiFlyoutSessionC.dispatch,
|
|
38
|
+
onUnmount = _useEuiFlyoutSessionC.onUnmount;
|
|
39
|
+
var isInitialMount = (0, _react.useRef)(true);
|
|
40
|
+
(0, _react.useEffect)(function () {
|
|
41
|
+
// When there is no active flyout, we should call the onUnmount callback.
|
|
42
|
+
// Ensure this is not called on the initial render, only on subsequent state changes.
|
|
43
|
+
if (isInitialMount.current) {
|
|
44
|
+
isInitialMount.current = false;
|
|
45
|
+
} else if (state.activeFlyoutGroup === null) {
|
|
46
|
+
onUnmount === null || onUnmount === void 0 || onUnmount();
|
|
47
|
+
}
|
|
48
|
+
}, [state.activeFlyoutGroup, onUnmount]);
|
|
36
49
|
var openFlyout = function openFlyout(options) {
|
|
37
50
|
dispatch({
|
|
38
51
|
type: 'OPEN_MAIN_FLYOUT',
|
|
@@ -55,13 +68,11 @@ function useEuiFlyoutSession() {
|
|
|
55
68
|
payload: {
|
|
56
69
|
main: {
|
|
57
70
|
size: options.main.size,
|
|
58
|
-
flyoutProps: options.main.flyoutProps
|
|
59
|
-
onUnmount: options.main.onUnmount
|
|
71
|
+
flyoutProps: options.main.flyoutProps
|
|
60
72
|
},
|
|
61
73
|
child: {
|
|
62
74
|
size: options.child.size,
|
|
63
|
-
flyoutProps: options.child.flyoutProps
|
|
64
|
-
onUnmount: options.child.onUnmount
|
|
75
|
+
flyoutProps: options.child.flyoutProps
|
|
65
76
|
},
|
|
66
77
|
meta: options.meta
|
|
67
78
|
}
|
|
@@ -77,23 +88,23 @@ function useEuiFlyoutSession() {
|
|
|
77
88
|
type: 'GO_BACK'
|
|
78
89
|
});
|
|
79
90
|
};
|
|
80
|
-
var canGoBack = !!state.activeFlyoutGroup;
|
|
81
|
-
var isFlyoutOpen = !!((_state$activeFlyoutGr = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr !== void 0 && _state$activeFlyoutGr.isMainOpen);
|
|
82
|
-
var isChildFlyoutOpen = !!((_state$activeFlyoutGr2 = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr2 !== void 0 && _state$activeFlyoutGr2.isChildOpen);
|
|
83
91
|
var clearHistory = function clearHistory() {
|
|
84
92
|
dispatch({
|
|
85
93
|
type: 'CLEAR_HISTORY'
|
|
86
94
|
});
|
|
87
95
|
};
|
|
96
|
+
var isFlyoutOpen = !!((_state$activeFlyoutGr = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr !== void 0 && _state$activeFlyoutGr.isMainOpen);
|
|
97
|
+
var isChildFlyoutOpen = !!((_state$activeFlyoutGr2 = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr2 !== void 0 && _state$activeFlyoutGr2.isChildOpen);
|
|
98
|
+
var canGoBack = !!state.history.length;
|
|
88
99
|
return {
|
|
89
100
|
openFlyout: openFlyout,
|
|
90
101
|
openChildFlyout: openChildFlyout,
|
|
91
102
|
openFlyoutGroup: openFlyoutGroup,
|
|
92
103
|
closeChildFlyout: closeChildFlyout,
|
|
93
104
|
goBack: goBack,
|
|
94
|
-
|
|
105
|
+
clearHistory: clearHistory,
|
|
95
106
|
isFlyoutOpen: isFlyoutOpen,
|
|
96
107
|
isChildFlyoutOpen: isChildFlyoutOpen,
|
|
97
|
-
|
|
108
|
+
canGoBack: canGoBack
|
|
98
109
|
};
|
|
99
110
|
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.euiFieldNumberStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _form = require("../form.styles");
|
|
9
10
|
/*
|
|
10
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -16,9 +17,11 @@ var _form = require("../form.styles");
|
|
|
16
17
|
|
|
17
18
|
var euiFieldNumberStyles = exports.euiFieldNumberStyles = function euiFieldNumberStyles(euiThemeContext) {
|
|
18
19
|
var colorMode = euiThemeContext.colorMode;
|
|
20
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'formVariant');
|
|
19
21
|
var formStyles = (0, _form.euiFormControlStyles)(euiThemeContext);
|
|
22
|
+
var invalidStyles = isRefreshVariant ? "\n &:is(:invalid, [aria-invalid='true']):not(\n .euiFormControlLayoutDelimited__input, :focus\n ) {\n ".concat(formStyles.invalid, "\n }\n ") : "\n /* Account for native validity detection as well via [aria-invalid=\"true\"] */\n &:is(:invalid, [aria-invalid='true']) {\n ".concat(formStyles.invalid, "\n }\n ");
|
|
20
23
|
return {
|
|
21
|
-
euiFieldNumber: /*#__PURE__*/(0, _react.css)(formStyles.shared, "color-scheme:", colorMode === 'DARK' ? 'dark' : 'light', "
|
|
24
|
+
euiFieldNumber: /*#__PURE__*/(0, _react.css)(formStyles.shared, "color-scheme:", colorMode === 'DARK' ? 'dark' : 'light', ";", invalidStyles, " &:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldNumber;"),
|
|
22
25
|
// Skip the css() on the default height to avoid generating a className
|
|
23
26
|
uncompressed: formStyles.uncompressed,
|
|
24
27
|
compressed: /*#__PURE__*/(0, _react.css)(formStyles.compressed, ";label:compressed;"),
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.euiFieldTextStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _form = require("../form.styles");
|
|
9
10
|
/*
|
|
10
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -15,9 +16,11 @@ var _form = require("../form.styles");
|
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
18
|
var euiFieldTextStyles = exports.euiFieldTextStyles = function euiFieldTextStyles(euiThemeContext) {
|
|
19
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'formVariant');
|
|
18
20
|
var formStyles = (0, _form.euiFormControlStyles)(euiThemeContext);
|
|
21
|
+
var invalidStyles = isRefreshVariant ? "\n &:is(:invalid, [aria-invalid='true']):not(\n .euiFormControlLayoutDelimited__input, :focus\n ) {\n ".concat(formStyles.invalid, "\n }\n ") : "\n &:is(:invalid){\n ".concat(formStyles.invalid, "\n }\n ");
|
|
19
22
|
return {
|
|
20
|
-
euiFieldText: /*#__PURE__*/(0, _react.css)(formStyles.shared, "
|
|
23
|
+
euiFieldText: /*#__PURE__*/(0, _react.css)(formStyles.shared, " ", invalidStyles, " &:focus{", formStyles.focus, ";}&[readOnly]{", formStyles.readOnly, ";}&:disabled{", formStyles.disabled, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldText;"),
|
|
21
24
|
// Skip the css() on the default height to avoid generating a className
|
|
22
25
|
uncompressed: formStyles.uncompressed,
|
|
23
26
|
compressed: /*#__PURE__*/(0, _react.css)(formStyles.compressed, ";label:compressed;"),
|