@elastic/eui 95.7.0 → 95.8.0-backport.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 -1163
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -1163
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/es/components/datagrid/controls/column_selector.js +1 -2
- package/es/components/datagrid/data_grid.a11y.js +2 -2
- package/es/components/date_picker/date_picker.js +11 -11
- package/es/components/date_picker/date_picker.styles.js +14 -2
- package/es/components/date_picker/date_picker_range.js +2 -1
- package/es/components/date_picker/date_picker_range.styles.js +17 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +14 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/es/components/form/checkbox/checkbox.js +28 -25
- package/es/components/form/checkbox/checkbox.styles.js +62 -0
- package/es/components/form/described_form_group/described_form_group.js +17 -9
- package/es/components/form/described_form_group/described_form_group.styles.js +26 -0
- package/es/components/form/field_number/field_number.js +1 -0
- package/es/components/form/field_number/field_number.styles.js +2 -1
- package/es/components/form/field_password/field_password.js +6 -3
- package/es/components/form/field_search/field_search.js +39 -29
- package/es/components/form/field_text/field_text.js +1 -0
- package/es/components/form/form.js +7 -4
- package/es/components/form/form.styles.js +87 -39
- package/es/components/form/form_control_layout/_num_icons.js +7 -33
- package/es/components/form/form_control_layout/form_control_layout.js +67 -32
- package/es/components/form/form_control_layout/form_control_layout.styles.js +72 -0
- package/es/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
- package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +22 -0
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +30 -5
- package/es/components/form/form_control_layout/form_control_layout_delimited.js +37 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +52 -0
- package/es/components/form/form_control_layout/form_control_layout_icons.js +33 -13
- package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +54 -0
- package/es/components/form/form_error_text/form_error_text.js +4 -0
- package/es/components/form/form_error_text/form_error_text.styles.js +16 -0
- package/es/components/form/form_fieldset/form_legend.js +6 -2
- package/es/components/form/form_fieldset/form_legend.styles.js +20 -0
- package/es/components/form/form_help_text/form_help_text.js +4 -0
- package/es/components/form/form_help_text/form_help_text.styles.js +16 -0
- package/es/components/form/form_label/form_label.js +6 -0
- package/es/components/form/form_label/form_label.styles.js +38 -0
- package/es/components/form/form_row/form_row.js +156 -223
- package/es/components/form/form_row/form_row.styles.js +49 -0
- package/es/components/form/radio/radio.js +21 -14
- package/es/components/form/radio/radio.styles.js +34 -0
- package/es/components/form/range/range.styles.js +1 -1
- package/es/components/form/range/range_input.styles.js +1 -1
- package/es/components/form/range/range_slider.styles.js +1 -4
- package/es/components/form/range/range_thumb.styles.js +1 -4
- package/es/components/form/switch/switch.js +43 -24
- package/es/components/form/switch/switch.styles.js +226 -0
- package/es/components/form/text_area/text_area.js +1 -0
- package/es/components/form/text_area/text_area.styles.js +1 -1
- package/es/components/header/header_links/header_link.js +9 -13
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_links/header_links.styles.js +1 -1
- package/es/services/emotion/clone_element.js +5 -3
- package/eui.d.ts +403 -112
- package/i18ntokens.json +48 -30
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/lib/components/datagrid/controls/column_selector.js +1 -2
- package/lib/components/datagrid/data_grid.a11y.js +2 -2
- package/lib/components/date_picker/date_picker.js +11 -11
- package/lib/components/date_picker/date_picker.styles.js +14 -2
- package/lib/components/date_picker/date_picker_range.js +2 -1
- package/lib/components/date_picker/date_picker_range.styles.js +17 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +14 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/lib/components/form/checkbox/checkbox.js +27 -23
- package/lib/components/form/checkbox/checkbox.styles.js +66 -0
- package/lib/components/form/described_form_group/described_form_group.js +17 -9
- package/lib/components/form/described_form_group/described_form_group.styles.js +32 -0
- package/lib/components/form/field_number/field_number.js +1 -0
- package/lib/components/form/field_number/field_number.styles.js +2 -1
- package/lib/components/form/field_password/field_password.js +6 -3
- package/lib/components/form/field_search/field_search.js +39 -29
- package/lib/components/form/field_text/field_text.js +1 -0
- package/lib/components/form/form.js +6 -3
- package/lib/components/form/form.styles.js +88 -40
- package/lib/components/form/form_control_layout/_num_icons.js +8 -33
- package/lib/components/form/form_control_layout/form_control_layout.js +65 -31
- package/lib/components/form/form_control_layout/form_control_layout.styles.js +76 -0
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +34 -11
- package/lib/components/form/form_control_layout/form_control_layout_delimited.js +36 -9
- package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +33 -13
- package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
- package/lib/components/form/form_error_text/form_error_text.js +4 -0
- package/lib/components/form/form_error_text/form_error_text.styles.js +22 -0
- package/lib/components/form/form_fieldset/form_legend.js +6 -2
- package/lib/components/form/form_fieldset/form_legend.styles.js +26 -0
- package/lib/components/form/form_help_text/form_help_text.js +4 -0
- package/lib/components/form/form_help_text/form_help_text.styles.js +22 -0
- package/lib/components/form/form_label/form_label.js +6 -0
- package/lib/components/form/form_label/form_label.styles.js +43 -0
- package/lib/components/form/form_row/form_row.js +161 -226
- package/lib/components/form/form_row/form_row.styles.js +55 -0
- package/lib/components/form/radio/radio.js +21 -14
- package/lib/components/form/radio/radio.styles.js +40 -0
- package/lib/components/form/range/range.styles.js +1 -1
- package/lib/components/form/range/range_input.styles.js +1 -1
- package/lib/components/form/range/range_slider.styles.js +1 -4
- package/lib/components/form/range/range_thumb.styles.js +1 -4
- package/lib/components/form/switch/switch.js +46 -26
- package/lib/components/form/switch/switch.styles.js +230 -0
- package/lib/components/form/text_area/text_area.js +1 -0
- package/lib/components/form/text_area/text_area.styles.js +1 -1
- package/lib/components/header/header_links/header_link.js +9 -13
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_links/header_links.styles.js +1 -1
- package/lib/services/emotion/clone_element.js +5 -3
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/optimize/es/components/datagrid/controls/column_selector.js +1 -2
- package/optimize/es/components/datagrid/data_grid.a11y.js +2 -2
- package/optimize/es/components/date_picker/date_picker.js +6 -9
- package/optimize/es/components/date_picker/date_picker.styles.js +14 -2
- package/optimize/es/components/date_picker/date_picker_range.js +2 -1
- package/optimize/es/components/date_picker/date_picker_range.styles.js +17 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +13 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/optimize/es/components/form/checkbox/checkbox.js +28 -25
- package/optimize/es/components/form/checkbox/checkbox.styles.js +62 -0
- package/optimize/es/components/form/described_form_group/described_form_group.js +17 -9
- package/optimize/es/components/form/described_form_group/described_form_group.styles.js +26 -0
- package/optimize/es/components/form/field_number/field_number.js +1 -0
- package/optimize/es/components/form/field_number/field_number.styles.js +2 -1
- package/optimize/es/components/form/field_password/field_password.js +6 -3
- package/optimize/es/components/form/field_search/field_search.js +39 -29
- package/optimize/es/components/form/field_text/field_text.js +1 -0
- package/optimize/es/components/form/form.js +7 -4
- package/optimize/es/components/form/form.styles.js +87 -39
- package/optimize/es/components/form/form_control_layout/_num_icons.js +7 -33
- package/optimize/es/components/form/form_control_layout/form_control_layout.js +44 -29
- package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +72 -0
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.js +19 -22
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +22 -0
- package/optimize/es/components/form/form_control_layout/form_control_layout_custom_icon.js +29 -4
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +34 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +52 -0
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +25 -11
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +54 -0
- package/optimize/es/components/form/form_error_text/form_error_text.js +4 -0
- package/optimize/es/components/form/form_error_text/form_error_text.styles.js +16 -0
- package/optimize/es/components/form/form_fieldset/form_legend.js +6 -2
- package/optimize/es/components/form/form_fieldset/form_legend.styles.js +20 -0
- package/optimize/es/components/form/form_help_text/form_help_text.js +4 -0
- package/optimize/es/components/form/form_help_text/form_help_text.styles.js +16 -0
- package/optimize/es/components/form/form_label/form_label.js +6 -0
- package/optimize/es/components/form/form_label/form_label.styles.js +37 -0
- package/optimize/es/components/form/form_row/form_row.js +135 -201
- package/optimize/es/components/form/form_row/form_row.styles.js +49 -0
- package/optimize/es/components/form/radio/radio.js +21 -14
- package/optimize/es/components/form/radio/radio.styles.js +34 -0
- package/optimize/es/components/form/range/range.styles.js +1 -1
- package/optimize/es/components/form/range/range_input.styles.js +1 -1
- package/optimize/es/components/form/range/range_slider.styles.js +1 -4
- package/optimize/es/components/form/range/range_thumb.styles.js +1 -4
- package/optimize/es/components/form/switch/switch.js +29 -23
- package/optimize/es/components/form/switch/switch.styles.js +226 -0
- package/optimize/es/components/form/text_area/text_area.js +1 -0
- package/optimize/es/components/form/text_area/text_area.styles.js +1 -1
- package/optimize/es/components/header/header_links/header_link.js +9 -10
- package/optimize/es/components/header/header_links/header_links.js +1 -1
- package/optimize/es/components/header/header_links/header_links.styles.js +1 -1
- package/optimize/es/services/emotion/clone_element.js +5 -3
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/optimize/lib/components/datagrid/controls/column_selector.js +1 -2
- package/optimize/lib/components/datagrid/data_grid.a11y.js +2 -2
- package/optimize/lib/components/date_picker/date_picker.js +6 -9
- package/optimize/lib/components/date_picker/date_picker.styles.js +14 -2
- package/optimize/lib/components/date_picker/date_picker_range.js +2 -1
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +17 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +13 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/optimize/lib/components/form/checkbox/checkbox.js +27 -23
- package/optimize/lib/components/form/checkbox/checkbox.styles.js +66 -0
- package/optimize/lib/components/form/described_form_group/described_form_group.js +17 -9
- package/optimize/lib/components/form/described_form_group/described_form_group.styles.js +32 -0
- package/optimize/lib/components/form/field_number/field_number.js +1 -0
- package/optimize/lib/components/form/field_number/field_number.styles.js +2 -1
- package/optimize/lib/components/form/field_password/field_password.js +6 -3
- package/optimize/lib/components/form/field_search/field_search.js +39 -29
- package/optimize/lib/components/form/field_text/field_text.js +1 -0
- package/optimize/lib/components/form/form.js +6 -3
- package/optimize/lib/components/form/form.styles.js +88 -40
- package/optimize/lib/components/form/form_control_layout/_num_icons.js +8 -33
- package/optimize/lib/components/form/form_control_layout/form_control_layout.js +43 -28
- package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +76 -0
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.js +19 -22
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
- package/optimize/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +29 -6
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +34 -10
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +25 -11
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
- package/optimize/lib/components/form/form_error_text/form_error_text.js +4 -0
- package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +22 -0
- package/optimize/lib/components/form/form_fieldset/form_legend.js +6 -2
- package/optimize/lib/components/form/form_fieldset/form_legend.styles.js +26 -0
- package/optimize/lib/components/form/form_help_text/form_help_text.js +4 -0
- package/optimize/lib/components/form/form_help_text/form_help_text.styles.js +22 -0
- package/optimize/lib/components/form/form_label/form_label.js +6 -0
- package/optimize/lib/components/form/form_label/form_label.styles.js +43 -0
- package/optimize/lib/components/form/form_row/form_row.js +136 -201
- package/optimize/lib/components/form/form_row/form_row.styles.js +55 -0
- package/optimize/lib/components/form/radio/radio.js +21 -14
- package/optimize/lib/components/form/radio/radio.styles.js +40 -0
- package/optimize/lib/components/form/range/range.styles.js +1 -1
- package/optimize/lib/components/form/range/range_input.styles.js +1 -1
- package/optimize/lib/components/form/range/range_slider.styles.js +1 -4
- package/optimize/lib/components/form/range/range_thumb.styles.js +1 -4
- package/optimize/lib/components/form/switch/switch.js +32 -25
- package/optimize/lib/components/form/switch/switch.styles.js +230 -0
- package/optimize/lib/components/form/text_area/text_area.js +1 -0
- package/optimize/lib/components/form/text_area/text_area.styles.js +1 -1
- package/optimize/lib/components/header/header_links/header_link.js +9 -10
- package/optimize/lib/components/header/header_links/header_links.js +1 -1
- package/optimize/lib/components/header/header_links/header_links.styles.js +1 -1
- package/optimize/lib/services/emotion/clone_element.js +5 -3
- package/package.json +3 -2
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +1 -1
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_form.scss +0 -99
- package/src/global_styling/mixins/_index.scss +0 -1
- package/src/global_styling/variables/_form.scss +0 -21
- package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -3
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/test-env/components/datagrid/controls/column_selector.js +1 -2
- package/test-env/components/datagrid/data_grid.a11y.js +2 -2
- package/test-env/components/date_picker/date_picker.js +6 -9
- package/test-env/components/date_picker/date_picker.styles.js +14 -2
- package/test-env/components/date_picker/date_picker_range.js +2 -1
- package/test-env/components/date_picker/date_picker_range.styles.js +17 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +13 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/test-env/components/form/checkbox/checkbox.js +27 -23
- package/test-env/components/form/checkbox/checkbox.styles.js +66 -0
- package/test-env/components/form/described_form_group/described_form_group.js +17 -9
- package/test-env/components/form/described_form_group/described_form_group.styles.js +32 -0
- package/test-env/components/form/field_number/field_number.js +1 -0
- package/test-env/components/form/field_number/field_number.styles.js +2 -1
- package/test-env/components/form/field_password/field_password.js +6 -3
- package/test-env/components/form/field_search/field_search.js +39 -29
- package/test-env/components/form/field_text/field_text.js +1 -0
- package/test-env/components/form/form.js +6 -3
- package/test-env/components/form/form.styles.js +88 -40
- package/test-env/components/form/form_control_layout/_num_icons.js +8 -33
- package/test-env/components/form/form_control_layout/form_control_layout.js +58 -31
- package/test-env/components/form/form_control_layout/form_control_layout.styles.js +76 -0
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +30 -7
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +34 -10
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +28 -13
- package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
- package/test-env/components/form/form_error_text/form_error_text.js +4 -0
- package/test-env/components/form/form_error_text/form_error_text.styles.js +22 -0
- package/test-env/components/form/form_fieldset/form_legend.js +6 -2
- package/test-env/components/form/form_fieldset/form_legend.styles.js +26 -0
- package/test-env/components/form/form_help_text/form_help_text.js +4 -0
- package/test-env/components/form/form_help_text/form_help_text.styles.js +22 -0
- package/test-env/components/form/form_label/form_label.js +6 -0
- package/test-env/components/form/form_label/form_label.styles.js +43 -0
- package/test-env/components/form/form_row/form_row.js +153 -216
- package/test-env/components/form/form_row/form_row.styles.js +55 -0
- package/test-env/components/form/radio/radio.js +21 -14
- package/test-env/components/form/radio/radio.styles.js +40 -0
- package/test-env/components/form/range/range.styles.js +1 -1
- package/test-env/components/form/range/range_input.styles.js +1 -1
- package/test-env/components/form/range/range_slider.styles.js +1 -4
- package/test-env/components/form/range/range_thumb.styles.js +1 -4
- package/test-env/components/form/switch/switch.js +41 -26
- package/test-env/components/form/switch/switch.styles.js +230 -0
- package/test-env/components/form/text_area/text_area.js +1 -0
- package/test-env/components/form/text_area/text_area.styles.js +1 -1
- package/test-env/components/header/header_links/header_link.js +9 -10
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_links/header_links.styles.js +1 -1
- package/test-env/services/emotion/clone_element.js +5 -3
- package/src/components/form/_form.scss +0 -8
- package/src/components/form/_index.scss +0 -11
- package/src/components/form/checkbox/_checkbox.scss +0 -115
- package/src/components/form/checkbox/_index.scss +0 -1
- package/src/components/form/described_form_group/_described_form_group.scss +0 -34
- package/src/components/form/described_form_group/_index.scss +0 -1
- package/src/components/form/form_control_layout/_form_control_layout.scss +0 -203
- package/src/components/form/form_control_layout/_form_control_layout_clear_button.scss +0 -7
- package/src/components/form/form_control_layout/_form_control_layout_custom_icon.scss +0 -24
- package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +0 -67
- package/src/components/form/form_control_layout/_form_control_layout_icons.scss +0 -54
- package/src/components/form/form_control_layout/_index.scss +0 -5
- package/src/components/form/form_error_text/_form_error_text.scss +0 -5
- package/src/components/form/form_error_text/_index.scss +0 -1
- package/src/components/form/form_fieldset/_form_legend.scss +0 -11
- package/src/components/form/form_fieldset/_index.scss +0 -1
- package/src/components/form/form_help_text/_form_help_text.scss +0 -5
- package/src/components/form/form_help_text/_index.scss +0 -1
- package/src/components/form/form_label/_form_label.scss +0 -25
- package/src/components/form/form_label/_index.scss +0 -1
- package/src/components/form/form_row/_form_row.scss +0 -102
- package/src/components/form/form_row/_index.scss +0 -1
- package/src/components/form/radio/_index.scss +0 -1
- package/src/components/form/radio/_radio.scss +0 -87
- package/src/components/form/switch/_index.scss +0 -1
- package/src/components/form/switch/_switch.scss +0 -212
- package/src/global_styling/mixins/_icons.scss +0 -17
- package/src/themes/amsterdam/overrides/_form_control_layout.scss +0 -112
- package/src/themes/amsterdam/overrides/_form_control_layout_delimited.scss +0 -42
- package/src/themes/amsterdam/overrides/_form_controls.scss +0 -19
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["inputId", "className", "children", "icon", "iconsPosition", "clear", "isDropdown", "isLoading", "isInvalid", "isDisabled", "readOnly", "compressed", "prepend", "append", "isDelimited", "wrapperProps", "fullWidth"];
|
|
2
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
10
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
13
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
3
15
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
17
|
/*
|
|
@@ -10,13 +22,15 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
10
22
|
* Side Public License, v 1.
|
|
11
23
|
*/
|
|
12
24
|
|
|
13
|
-
import React, {
|
|
25
|
+
import React, { useMemo } from 'react';
|
|
14
26
|
import PropTypes from "prop-types";
|
|
15
27
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
17
|
-
import { EuiFormControlLayoutIcons } from './form_control_layout_icons';
|
|
28
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
18
29
|
import { EuiFormLabel } from '../form_label';
|
|
19
30
|
import { useFormContext } from '../eui_form_context';
|
|
31
|
+
import { getIconAffordanceStyles, isRightSideIcon } from './_num_icons';
|
|
32
|
+
import { EuiFormControlLayoutIcons } from './form_control_layout_icons';
|
|
33
|
+
import { euiFormControlLayoutStyles, euiFormControlLayoutSideNodeStyles } from './form_control_layout.styles';
|
|
20
34
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
35
|
export var EuiFormControlLayout = function EuiFormControlLayout(props) {
|
|
22
36
|
var _useFormContext = useFormContext(),
|
|
@@ -36,16 +50,20 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
|
|
|
36
50
|
compressed = props.compressed,
|
|
37
51
|
prepend = props.prepend,
|
|
38
52
|
append = props.append,
|
|
53
|
+
isDelimited = props.isDelimited,
|
|
54
|
+
wrapperProps = props.wrapperProps,
|
|
39
55
|
_props$fullWidth = props.fullWidth,
|
|
40
56
|
fullWidth = _props$fullWidth === void 0 ? defaultFullWidth : _props$fullWidth,
|
|
41
57
|
rest = _objectWithoutProperties(props, _excluded);
|
|
58
|
+
var isGroup = !!(prepend || append || isDelimited);
|
|
42
59
|
var classes = classNames('euiFormControlLayout', {
|
|
43
|
-
'euiFormControlLayout--
|
|
44
|
-
'euiFormControlLayout
|
|
45
|
-
'euiFormControlLayout
|
|
46
|
-
'euiFormControlLayout--group': prepend || append,
|
|
47
|
-
'euiFormControlLayout-isDisabled': isDisabled
|
|
60
|
+
'euiFormControlLayout--group': isGroup && !isDelimited,
|
|
61
|
+
'euiFormControlLayout-isDisabled': isDisabled,
|
|
62
|
+
'euiFormControlLayout-readOnly': readOnly
|
|
48
63
|
}, className);
|
|
64
|
+
var styles = useEuiMemoizedStyles(euiFormControlLayoutStyles);
|
|
65
|
+
var cssStyles = [styles.euiFormControlLayout, compressed ? styles.compressed : styles.uncompressed, fullWidth ? styles.fullWidth : styles.formWidth].concat(_toConsumableArray(isGroup ? [styles.group.group, compressed ? styles.group.compressed : styles.group.uncompressed] : []));
|
|
66
|
+
var childrenWrapperStyles = [styles.children.euiFormControlLayout__childrenWrapper, isGroup && styles.children.inGroup, isGroup && !append && styles.children.prependOnly, isGroup && !prepend && styles.children.appendOnly, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
|
|
49
67
|
var hasDropdownIcon = !readOnly && !isDisabled && isDropdown;
|
|
50
68
|
var hasRightIcon = isRightSideIcon(icon);
|
|
51
69
|
var hasLeftIcon = icon && !hasRightIcon;
|
|
@@ -62,19 +80,23 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
|
|
|
62
80
|
});
|
|
63
81
|
}, [iconsPosition, icon, clear, isInvalid, isLoading, hasDropdownIcon]);
|
|
64
82
|
return ___EmotionJSX("div", _extends({
|
|
83
|
+
css: cssStyles,
|
|
65
84
|
className: classes
|
|
66
85
|
}, rest), ___EmotionJSX(EuiFormControlLayoutSideNodes, {
|
|
67
86
|
side: "prepend",
|
|
68
87
|
nodes: prepend,
|
|
69
|
-
inputId: inputId
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
inputId: inputId,
|
|
89
|
+
compressed: compressed
|
|
90
|
+
}), ___EmotionJSX("div", _extends({}, wrapperProps, {
|
|
91
|
+
css: childrenWrapperStyles,
|
|
92
|
+
className: classNames('euiFormControlLayout__childrenWrapper', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className),
|
|
93
|
+
style: _objectSpread(_objectSpread({}, iconAffordanceStyles), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style)
|
|
94
|
+
}), hasLeftIcon && ___EmotionJSX(EuiFormControlLayoutIcons, {
|
|
74
95
|
side: "left",
|
|
75
96
|
icon: icon,
|
|
76
97
|
iconsPosition: iconsPosition,
|
|
77
|
-
compressed: compressed
|
|
98
|
+
compressed: compressed,
|
|
99
|
+
isDisabled: isDisabled
|
|
78
100
|
}), children, hasRightIcons && ___EmotionJSX(EuiFormControlLayoutIcons, {
|
|
79
101
|
side: "right",
|
|
80
102
|
icon: hasRightIcon ? icon : undefined,
|
|
@@ -83,11 +105,13 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
|
|
|
83
105
|
clear: clear,
|
|
84
106
|
isLoading: isLoading,
|
|
85
107
|
isInvalid: isInvalid,
|
|
86
|
-
isDropdown: hasDropdownIcon
|
|
108
|
+
isDropdown: hasDropdownIcon,
|
|
109
|
+
isDisabled: isDisabled
|
|
87
110
|
})), ___EmotionJSX(EuiFormControlLayoutSideNodes, {
|
|
88
111
|
side: "append",
|
|
89
112
|
nodes: append,
|
|
90
|
-
inputId: inputId
|
|
113
|
+
inputId: inputId,
|
|
114
|
+
compressed: compressed
|
|
91
115
|
}));
|
|
92
116
|
};
|
|
93
117
|
|
|
@@ -127,7 +151,7 @@ EuiFormControlLayout.propTypes = {
|
|
|
127
151
|
"aria-label": PropTypes.string,
|
|
128
152
|
"data-test-subj": PropTypes.string,
|
|
129
153
|
css: PropTypes.any,
|
|
130
|
-
size: PropTypes.
|
|
154
|
+
size: PropTypes.oneOf(["s", "m"])
|
|
131
155
|
}),
|
|
132
156
|
/**
|
|
133
157
|
* Expand to fill 100% of the parent.
|
|
@@ -147,30 +171,41 @@ EuiFormControlLayout.propTypes = {
|
|
|
147
171
|
/**
|
|
148
172
|
* Connects the prepend and append labels to the input
|
|
149
173
|
*/
|
|
150
|
-
inputId: PropTypes.string
|
|
174
|
+
inputId: PropTypes.string,
|
|
175
|
+
/**
|
|
176
|
+
* Allows passing optional additional props to `.euiFormControlLayout__childrenWrapper`
|
|
177
|
+
*/
|
|
178
|
+
wrapperProps: PropTypes.shape({
|
|
179
|
+
className: PropTypes.string,
|
|
180
|
+
"aria-label": PropTypes.string,
|
|
181
|
+
"data-test-subj": PropTypes.string,
|
|
182
|
+
css: PropTypes.any
|
|
183
|
+
}),
|
|
184
|
+
// Internal prop used by EuiFormControlLayoutDelimited
|
|
185
|
+
isDelimited: PropTypes.bool
|
|
151
186
|
};
|
|
152
187
|
var EuiFormControlLayoutSideNodes = function EuiFormControlLayoutSideNodes(_ref) {
|
|
153
188
|
var side = _ref.side,
|
|
154
189
|
nodes = _ref.nodes,
|
|
155
|
-
inputId = _ref.inputId
|
|
190
|
+
inputId = _ref.inputId,
|
|
191
|
+
compressed = _ref.compressed;
|
|
156
192
|
var className = "euiFormControlLayout__".concat(side);
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
htmlFor: inputId,
|
|
160
|
-
className: className
|
|
161
|
-
}, label);
|
|
162
|
-
}, [inputId, className]);
|
|
193
|
+
var styles = useEuiMemoizedStyles(euiFormControlLayoutSideNodeStyles);
|
|
194
|
+
var cssStyles = [styles.euiFormControlLayout__side, styles[side], compressed ? styles.compressed : styles.uncompressed];
|
|
163
195
|
if (!nodes) return null;
|
|
164
|
-
return ___EmotionJSX(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
196
|
+
return ___EmotionJSX("div", {
|
|
197
|
+
css: cssStyles,
|
|
198
|
+
className: className
|
|
199
|
+
}, React.Children.map(nodes, function (node) {
|
|
200
|
+
return typeof node === 'string' ? ___EmotionJSX(EuiFormLabel, {
|
|
201
|
+
htmlFor: inputId
|
|
202
|
+
}, node) : node;
|
|
169
203
|
}));
|
|
170
204
|
};
|
|
171
205
|
EuiFormControlLayoutSideNodes.propTypes = {
|
|
172
206
|
side: PropTypes.oneOf(["append", "prepend"]).isRequired,
|
|
173
207
|
nodes: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.element.isRequired]).isRequired, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.element.isRequired]).isRequired).isRequired]),
|
|
174
208
|
// For some bizarre reason if you make this the `children` prop instead, React doesn't properly override cloned keys :|
|
|
175
|
-
inputId: PropTypes.string
|
|
209
|
+
inputId: PropTypes.string,
|
|
210
|
+
compressed: PropTypes.bool
|
|
176
211
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiTextTruncate, logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
12
|
+
import { euiFormVariables } from '../form.styles';
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "1w10n1m-inGroup",
|
|
15
|
+
styles: "flex-grow:1;overflow:hidden;label:inGroup;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "1w10n1m-inGroup",
|
|
18
|
+
styles: "flex-grow:1;overflow:hidden;label:inGroup;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
22
|
+
name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
|
|
23
|
+
styles: "position:relative;label:euiFormControlLayout__childrenWrapper;"
|
|
24
|
+
} : {
|
|
25
|
+
name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
|
|
26
|
+
styles: "position:relative;label:euiFormControlLayout__childrenWrapper;",
|
|
27
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
|
+
};
|
|
29
|
+
export var euiFormControlLayoutStyles = function euiFormControlLayoutStyles(euiThemeContext) {
|
|
30
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
|
+
var form = euiFormVariables(euiThemeContext);
|
|
32
|
+
return {
|
|
33
|
+
euiFormControlLayout: /*#__PURE__*/css(";label:euiFormControlLayout;"),
|
|
34
|
+
// Skip the css`` on the default height to avoid generating a className
|
|
35
|
+
uncompressed: "\n ".concat(logicalCSS('height', form.controlHeight), "\n "),
|
|
36
|
+
compressed: /*#__PURE__*/css(logicalCSS('height', form.controlCompressedHeight), ";;label:compressed;"),
|
|
37
|
+
// Skip the css`` on the default width to avoid generating a className
|
|
38
|
+
formWidth: "\n ".concat(logicalCSS('max-width', form.maxWidth), "\n ").concat(logicalCSS('width', '100%'), "\n "),
|
|
39
|
+
fullWidth: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " ", logicalCSS('width', '100%'), ";;label:fullWidth;"),
|
|
40
|
+
group: {
|
|
41
|
+
group: /*#__PURE__*/css("display:flex;align-items:stretch;border:", euiTheme.border.width.thin, " solid ", form.borderColor, ";background-color:", form.backgroundColor, ";overflow:hidden;>*{", logicalCSS('height', '100%'), ";};label:group;"),
|
|
42
|
+
// Skipping css`` to avoid repeated compressed/uncompressed classNames
|
|
43
|
+
uncompressed: "\n border-radius: ".concat(form.controlBorderRadius, ";\n "),
|
|
44
|
+
compressed: "\n border-radius: ".concat(form.controlCompressedBorderRadius, ";\n ")
|
|
45
|
+
},
|
|
46
|
+
children: {
|
|
47
|
+
euiFormControlLayout__childrenWrapper: _ref2,
|
|
48
|
+
inGroup: _ref,
|
|
49
|
+
prependOnly: /*#__PURE__*/css(logicalCSS('border-top-right-radius', 'inherit'), " ", logicalCSS('border-bottom-right-radius', 'inherit'), ";;label:prependOnly;"),
|
|
50
|
+
appendOnly: /*#__PURE__*/css(logicalCSS('border-top-left-radius', 'inherit'), " ", logicalCSS('border-bottom-left-radius', 'inherit'), ";;label:appendOnly;")
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export var euiFormControlLayoutSideNodeStyles = function euiFormControlLayoutSideNodeStyles(euiThemeContext) {
|
|
55
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
56
|
+
var form = euiFormVariables(euiThemeContext);
|
|
57
|
+
var uncompressedHeight = mathWithUnits([form.controlHeight, euiTheme.border.width.thin], function (x, y) {
|
|
58
|
+
return x - y * 2;
|
|
59
|
+
});
|
|
60
|
+
var compressedHeight = mathWithUnits([form.controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
|
|
61
|
+
return x - y * 2;
|
|
62
|
+
});
|
|
63
|
+
var buttons = '*:is(.euiButton, .euiButtonEmpty, .euiButtonIcon)';
|
|
64
|
+
var text = '*:is(.euiFormLabel, .euiText)';
|
|
65
|
+
return {
|
|
66
|
+
euiFormControlLayout__side: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", euiTextTruncate('50%'), " flex-shrink:0;display:flex;align-items:center;gap:", euiTheme.size.xs, ";background-color:", form.appendPrependBackground, ";", buttons, "{transform:none!important;&:focus-visible{outline-offset:-", euiTheme.focus.width, ";}}", text, "{cursor:default;overflow:hidden;text-overflow:ellipsis;}&:not(:has(> ", buttons, ":first-child, > *:first-child > ", buttons, ")){", logicalCSS('padding-left', euiTheme.size.s), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child > ", buttons, ")){", logicalCSS('padding-right', euiTheme.size.s), ";};label:euiFormControlLayout__side;"),
|
|
67
|
+
append: /*#__PURE__*/css(";label:append;"),
|
|
68
|
+
prepend: /*#__PURE__*/css(";label:prepend;"),
|
|
69
|
+
uncompressed: "\n ".concat(text, " {\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.xs), "\n line-height: ").concat(uncompressedHeight, ";\n }\n\n ").concat(buttons, " {\n ").concat(logicalCSS('height', uncompressedHeight), "\n }\n\n .euiButtonIcon {\n flex-shrink: 0;\n ").concat(logicalCSS('width', euiTheme.size.xl), "\n }\n "),
|
|
70
|
+
compressed: /*#__PURE__*/css(text, "{", logicalCSS('padding-horizontal', euiTheme.size.xxs), " line-height:", compressedHeight, ";}", buttons, "{", logicalCSS('height', compressedHeight), ";}.euiButtonIcon{flex-shrink:0;", logicalCSS('width', euiTheme.size.xl), ";};label:compressed;")
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -13,41 +13,38 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
17
17
|
import { EuiIcon } from '../../icon';
|
|
18
|
-
import {
|
|
18
|
+
import { useEuiI18n } from '../../i18n';
|
|
19
|
+
import { EuiFormControlLayoutClearButtonStyles } from './form_control_layout_clear_button.styles';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
-
var sizeToClassNameMap = {
|
|
21
|
-
s: 'euiFormControlLayoutClearButton--small',
|
|
22
|
-
m: null
|
|
23
|
-
};
|
|
24
|
-
export var SIZES = keysOf(sizeToClassNameMap);
|
|
25
21
|
export var EuiFormControlLayoutClearButton = function EuiFormControlLayoutClearButton(_ref) {
|
|
26
22
|
var className = _ref.className,
|
|
27
23
|
onClick = _ref.onClick,
|
|
28
24
|
_ref$size = _ref.size,
|
|
29
25
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
30
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
var classes = classNames('euiFormControlLayoutClearButton',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
var classes = classNames('euiFormControlLayoutClearButton', className);
|
|
28
|
+
var styles = useEuiMemoizedStyles(EuiFormControlLayoutClearButtonStyles);
|
|
29
|
+
var iconStyles = [styles.euiFormControlLayoutClearButton__icon, styles.size[size]];
|
|
30
|
+
var ariaLabel = useEuiI18n('euiFormControlLayoutClearButton.label', 'Clear input');
|
|
31
|
+
return ___EmotionJSX("button", _extends({
|
|
32
|
+
type: "button",
|
|
33
|
+
css: styles.euiFormControlLayoutClearButton,
|
|
34
|
+
className: classes,
|
|
35
|
+
onClick: onClick,
|
|
36
|
+
"aria-label": ariaLabel
|
|
37
|
+
}, rest), ___EmotionJSX(EuiIcon, {
|
|
38
|
+
css: iconStyles,
|
|
39
|
+
className: "euiFormControlLayoutClearButton__icon",
|
|
40
|
+
type: "cross",
|
|
41
|
+
size: size
|
|
42
|
+
}));
|
|
46
43
|
};
|
|
47
44
|
EuiFormControlLayoutClearButton.propTypes = {
|
|
48
45
|
className: PropTypes.string,
|
|
49
46
|
"aria-label": PropTypes.string,
|
|
50
47
|
"data-test-subj": PropTypes.string,
|
|
51
48
|
css: PropTypes.any,
|
|
52
|
-
size: PropTypes.
|
|
49
|
+
size: PropTypes.oneOf(["s", "m"])
|
|
53
50
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
export var EuiFormControlLayoutClearButtonStyles = function EuiFormControlLayoutClearButtonStyles(_ref) {
|
|
11
|
+
var euiTheme = _ref.euiTheme,
|
|
12
|
+
colorMode = _ref.colorMode;
|
|
13
|
+
var backgroundColor = colorMode === 'DARK' ? euiTheme.colors.darkShade : euiTheme.colors.mediumShade;
|
|
14
|
+
return {
|
|
15
|
+
euiFormControlLayoutClearButton: /*#__PURE__*/css("pointer-events:all;background-color:", backgroundColor, ";border-radius:50%;line-height:0;&:disabled{cursor:not-allowed;background-color:", euiTheme.colors.disabled, ";};label:euiFormControlLayoutClearButton;"),
|
|
16
|
+
euiFormControlLayoutClearButton__icon: /*#__PURE__*/css("transform:scale(0.5);fill:", euiTheme.colors.emptyShade, ";stroke:", euiTheme.colors.emptyShade, ";;label:euiFormControlLayoutClearButton__icon;"),
|
|
17
|
+
size: {
|
|
18
|
+
s: /*#__PURE__*/css("stroke-width:", euiTheme.size.xs, ";;label:s;"),
|
|
19
|
+
m: /*#__PURE__*/css("stroke-width:", euiTheme.size.xxs, ";;label:m;")
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
var _excluded = ["className", "onClick", "type", "iconRef", "size", "color"];
|
|
1
|
+
var _excluded = ["className", "onClick", "type", "iconRef", "size", "color", "disabled"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
6
|
+
import PropTypes from "prop-types";
|
|
5
7
|
/*
|
|
6
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -11,7 +13,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
import React from 'react';
|
|
14
|
-
import
|
|
16
|
+
import { css } from '@emotion/react';
|
|
15
17
|
import classNames from 'classnames';
|
|
16
18
|
import { EuiIcon } from '../../icon';
|
|
17
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -22,14 +24,16 @@ export var EuiFormControlLayoutCustomIcon = function EuiFormControlLayoutCustomI
|
|
|
22
24
|
iconRef = _ref.iconRef,
|
|
23
25
|
size = _ref.size,
|
|
24
26
|
color = _ref.color,
|
|
27
|
+
disabled = _ref.disabled,
|
|
25
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
-
var classes = classNames('euiFormControlLayoutCustomIcon', className
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
+
var classes = classNames('euiFormControlLayoutCustomIcon', className);
|
|
30
|
+
var cssStyles = [styles.euiFormControlLayoutCustomIcon, onClick ? styles.clickable : styles.unclickable];
|
|
29
31
|
if (onClick) {
|
|
30
32
|
return ___EmotionJSX("button", _extends({
|
|
31
33
|
type: "button",
|
|
32
34
|
onClick: onClick,
|
|
35
|
+
disabled: disabled,
|
|
36
|
+
css: cssStyles,
|
|
33
37
|
className: classes,
|
|
34
38
|
ref: iconRef
|
|
35
39
|
}, rest), ___EmotionJSX(EuiIcon, {
|
|
@@ -41,6 +45,7 @@ export var EuiFormControlLayoutCustomIcon = function EuiFormControlLayoutCustomI
|
|
|
41
45
|
}));
|
|
42
46
|
}
|
|
43
47
|
return ___EmotionJSX("span", _extends({
|
|
48
|
+
css: cssStyles,
|
|
44
49
|
className: classes,
|
|
45
50
|
ref: iconRef
|
|
46
51
|
}, rest), ___EmotionJSX(EuiIcon, {
|
|
@@ -59,4 +64,24 @@ EuiFormControlLayoutCustomIcon.propTypes = {
|
|
|
59
64
|
type: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "anomalyChart", "anomalySwimLane", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "check", "checkInCircleFilled", "cheer", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "diff", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "errorFilled", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "minusInSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "plusInSquare", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]).isRequired,
|
|
60
65
|
size: PropTypes.any,
|
|
61
66
|
iconRef: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.func.isRequired])
|
|
67
|
+
};
|
|
68
|
+
var styles = {
|
|
69
|
+
euiFormControlLayoutCustomIcon: process.env.NODE_ENV === "production" ? {
|
|
70
|
+
name: "7d1ma8-euiFormControlLayoutCustomIcon",
|
|
71
|
+
styles: "font-size:0;label:euiFormControlLayoutCustomIcon;"
|
|
72
|
+
} : {
|
|
73
|
+
name: "7d1ma8-euiFormControlLayoutCustomIcon",
|
|
74
|
+
styles: "font-size:0;label:euiFormControlLayoutCustomIcon;",
|
|
75
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
76
|
+
},
|
|
77
|
+
// Skip css`` here to avoid generating an Emotion className
|
|
78
|
+
unclickable: "\n pointer-events: none;\n ",
|
|
79
|
+
clickable: process.env.NODE_ENV === "production" ? {
|
|
80
|
+
name: "1j8wgxj-clickable",
|
|
81
|
+
styles: "pointer-events:all;&:disabled{cursor:not-allowed;color:currentColor;};label:clickable;"
|
|
82
|
+
} : {
|
|
83
|
+
name: "1j8wgxj-clickable",
|
|
84
|
+
styles: "pointer-events:all;&:disabled{cursor:not-allowed;color:currentColor;};label:clickable;",
|
|
85
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
86
|
+
}
|
|
62
87
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["startControl", "endControl", "delimiter", "className", "fullWidth"];
|
|
2
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
9
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
10
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
11
|
/*
|
|
@@ -10,20 +16,28 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
10
16
|
* Side Public License, v 1.
|
|
11
17
|
*/
|
|
12
18
|
|
|
13
|
-
import React
|
|
19
|
+
import React from 'react';
|
|
14
20
|
import PropTypes from "prop-types";
|
|
15
21
|
import classNames from 'classnames';
|
|
22
|
+
import { useEuiMemoizedStyles, cloneElementWithCss } from '../../../services';
|
|
16
23
|
import { useEuiI18n } from '../../i18n';
|
|
17
24
|
import { EuiIcon } from '../../icon';
|
|
18
25
|
import { EuiText } from '../../text';
|
|
26
|
+
import { FormContext, useFormContext } from '../eui_form_context';
|
|
19
27
|
import { EuiFormControlLayout } from './form_control_layout';
|
|
28
|
+
import { euiFormControlLayoutDelimitedStyles, euiFormControlLayoutDelimited__delimiter, euiFormControlLayoutDelimited__input } from './form_control_layout_delimited.styles';
|
|
20
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
30
|
export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimited(_ref) {
|
|
31
|
+
var _rest$wrapperProps;
|
|
22
32
|
var startControl = _ref.startControl,
|
|
23
33
|
endControl = _ref.endControl,
|
|
24
34
|
delimiter = _ref.delimiter,
|
|
25
35
|
className = _ref.className,
|
|
36
|
+
_fullWidth = _ref.fullWidth,
|
|
26
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var _useFormContext = useFormContext(),
|
|
39
|
+
defaultFullWidth = _useFormContext.defaultFullWidth;
|
|
40
|
+
var fullWidth = _fullWidth !== null && _fullWidth !== void 0 ? _fullWidth : defaultFullWidth;
|
|
27
41
|
var isInvalid = rest.isInvalid,
|
|
28
42
|
isDisabled = rest.isDisabled,
|
|
29
43
|
readOnly = rest.readOnly;
|
|
@@ -31,13 +45,27 @@ export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimite
|
|
|
31
45
|
var classes = classNames('euiFormControlLayoutDelimited', className, {
|
|
32
46
|
'euiFormControlLayoutDelimited--isInvalid': showInvalidState
|
|
33
47
|
});
|
|
48
|
+
var styles = useEuiMemoizedStyles(euiFormControlLayoutDelimitedStyles);
|
|
49
|
+
var cssStyles = [styles.delimited, rest.isDisabled && styles.disabled, rest.readOnly && styles.readOnly];
|
|
50
|
+
var wrapperStyles = [styles.childrenWrapper.delimited, showInvalidState && styles.childrenWrapper.invalid, (_rest$wrapperProps = rest.wrapperProps) === null || _rest$wrapperProps === void 0 ? void 0 : _rest$wrapperProps.css];
|
|
34
51
|
return ___EmotionJSX(EuiFormControlLayout, _extends({
|
|
52
|
+
isDelimited: true,
|
|
53
|
+
css: cssStyles,
|
|
35
54
|
className: classes,
|
|
36
|
-
iconsPosition: "static"
|
|
37
|
-
|
|
55
|
+
iconsPosition: "static",
|
|
56
|
+
fullWidth: fullWidth
|
|
57
|
+
}, rest, {
|
|
58
|
+
wrapperProps: _objectSpread(_objectSpread({}, rest.wrapperProps), {}, {
|
|
59
|
+
css: wrapperStyles
|
|
60
|
+
})
|
|
61
|
+
}), ___EmotionJSX(FormContext.Provider, {
|
|
62
|
+
value: {
|
|
63
|
+
defaultFullWidth: fullWidth
|
|
64
|
+
}
|
|
65
|
+
}, addClassesToControl(startControl), ___EmotionJSX(EuiFormControlDelimiter, {
|
|
38
66
|
delimiter: delimiter,
|
|
39
67
|
isInvalid: showInvalidState
|
|
40
|
-
}), addClassesToControl(endControl));
|
|
68
|
+
}), addClassesToControl(endControl)));
|
|
41
69
|
};
|
|
42
70
|
EuiFormControlLayoutDelimited.propTypes = {
|
|
43
71
|
/**
|
|
@@ -56,15 +84,17 @@ EuiFormControlLayoutDelimited.propTypes = {
|
|
|
56
84
|
className: PropTypes.string
|
|
57
85
|
};
|
|
58
86
|
var addClassesToControl = function addClassesToControl(control) {
|
|
59
|
-
return
|
|
87
|
+
return cloneElementWithCss(control, {
|
|
88
|
+
css: euiFormControlLayoutDelimited__input,
|
|
60
89
|
className: classNames(control.props.className, 'euiFormControlLayoutDelimited__input')
|
|
61
|
-
});
|
|
90
|
+
}, 'before');
|
|
62
91
|
};
|
|
63
92
|
var EuiFormControlDelimiter = function EuiFormControlDelimiter(_ref2) {
|
|
64
93
|
var delimiter = _ref2.delimiter,
|
|
65
94
|
isInvalid = _ref2.isInvalid;
|
|
66
95
|
var defaultAriaLabel = useEuiI18n('euiFormControlLayoutDelimited.delimiterLabel', 'to');
|
|
67
96
|
return ___EmotionJSX(EuiText, {
|
|
97
|
+
css: euiFormControlLayoutDelimited__delimiter,
|
|
68
98
|
className: "euiFormControlLayoutDelimited__delimiter",
|
|
69
99
|
size: "s",
|
|
70
100
|
color: isInvalid ? 'danger' : 'subdued'
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { logicalCSS } from '../../../global_styling';
|
|
12
|
+
import { euiFormControlDisabledStyles, euiFormControlReadOnlyStyles, euiFormControlDefaultShadow, euiFormControlInvalidStyles } from '../form.styles';
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "1o1b8cl-delimited",
|
|
15
|
+
styles: "display:flex;label:delimited;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "1o1b8cl-delimited",
|
|
18
|
+
styles: "display:flex;label:delimited;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
export var euiFormControlLayoutDelimitedStyles = function euiFormControlLayoutDelimitedStyles(euiThemeContext) {
|
|
22
|
+
return {
|
|
23
|
+
// Appended onto existing `euiFormControlLayout` styles
|
|
24
|
+
delimited: /*#__PURE__*/css(
|
|
25
|
+
// Transition smoothly between disabled/readOnly background color changes
|
|
26
|
+
euiFormControlDefaultShadow(euiThemeContext, {
|
|
27
|
+
withBorder: false,
|
|
28
|
+
withBackground: false,
|
|
29
|
+
withBackgroundAnimation: true
|
|
30
|
+
}), ";label:delimited;"),
|
|
31
|
+
disabled: /*#__PURE__*/css(euiFormControlDisabledStyles(euiThemeContext), ";label:disabled;"),
|
|
32
|
+
readOnly: /*#__PURE__*/css(euiFormControlReadOnlyStyles(euiThemeContext), ";label:readOnly;"),
|
|
33
|
+
// Appended onto existing `euiFormControlLayout__childrenWrapper` styles
|
|
34
|
+
childrenWrapper: {
|
|
35
|
+
delimited: _ref,
|
|
36
|
+
invalid: /*#__PURE__*/css(euiFormControlDefaultShadow(euiThemeContext, {
|
|
37
|
+
withBorder: false,
|
|
38
|
+
withBackgroundColor: false,
|
|
39
|
+
withBackgroundAnimation: false
|
|
40
|
+
}), euiFormControlInvalidStyles(euiThemeContext), ";label:invalid;")
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export var euiFormControlLayoutDelimited__delimiter = process.env.NODE_ENV === "production" ? {
|
|
45
|
+
name: "14bhjql-euiFormControlLayoutDelimited__delimiter",
|
|
46
|
+
styles: "align-self:stretch;flex-grow:0;display:flex;align-items:center;line-height:1;label:euiFormControlLayoutDelimited__delimiter;"
|
|
47
|
+
} : {
|
|
48
|
+
name: "14bhjql-euiFormControlLayoutDelimited__delimiter",
|
|
49
|
+
styles: "align-self:stretch;flex-grow:0;display:flex;align-items:center;line-height:1;label:euiFormControlLayoutDelimited__delimiter;",
|
|
50
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
51
|
+
};
|
|
52
|
+
export var euiFormControlLayoutDelimited__input = /*#__PURE__*/css("box-shadow:none;border-radius:0;text-align:center;", logicalCSS('height', '100%'), ";;label:euiFormControlLayoutDelimited__input;");
|