diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/common/switch.tsx b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/common/switch.tsx index c3ce535fa3c18..40991d6bdfb1d 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/common/switch.tsx +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/common/switch.tsx @@ -19,7 +19,7 @@ import React from 'react'; -import { EuiSwitch, EuiToolTip } from '@elastic/eui'; +import { EuiFormRow, EuiSwitch, EuiToolTip } from '@elastic/eui'; interface SwitchOptionProps { dataTestSubj?: string; @@ -27,7 +27,6 @@ interface SwitchOptionProps { tooltip?: string; disabled?: boolean; value?: boolean; - noStyle?: boolean; paramName: ParamName; setValue: (paramName: ParamName, value: boolean) => void; } @@ -37,13 +36,12 @@ function SwitchOption({ tooltip, label, disabled, - noStyle = false, paramName, value = false, setValue, }: SwitchOptionProps) { return ( -
+ ({ onChange={ev => setValue(paramName, ev.target.checked)} /> -
+ ); } diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/gauge/ranges_panel.tsx b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/gauge/ranges_panel.tsx index e1dad7442f0aa..22843906ffc4b 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/gauge/ranges_panel.tsx +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/gauge/ranges_panel.tsx @@ -127,7 +127,6 @@ function RangesPanel({ value={stateParams.gauge.percentageMode} setValue={setGaugeValue} /> - + + {chart.type === ChartTypes.AREA && ( - + <> + + + + )} {chart.type === ChartTypes.LINE && ( diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/metrics_axes/label_options.tsx b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/metrics_axes/label_options.tsx index 62ad2601f0e33..868a8ce29b466 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/metrics_axes/label_options.tsx +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/metrics_axes/label_options.tsx @@ -18,7 +18,7 @@ */ import React, { useCallback } from 'react'; -import { EuiTitle, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiTitle, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -58,6 +58,7 @@ function LabelOptions({ stateParams, setValue, axis, axesName, index }: LabelOpt return ( <> +

+ + + + + + + + + <> - + + + ) { /> - + diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/point_series/threshold_panel.tsx b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/point_series/threshold_panel.tsx index a8674b77dc985..9877b84345a1f 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/point_series/threshold_panel.tsx +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/components/options/point_series/threshold_panel.tsx @@ -49,7 +49,7 @@ function ThresholdPanel({ stateParams, setValue, vis }: VisOptionsProps - + {models.map((item, index) => ( - + {config.renderInputRow(item, index, onChangeValue)} { diff --git a/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx b/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx index ac102165ce7bb..dba8c2f871352 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx @@ -75,44 +75,33 @@ function ExtendedBoundsParamEditor({ }; return ( - - <> - {/* - We have to put it into React.Fragment to avoid errors: - EuiFormRow will try to put "compressed" as attribute into a EuiFlexGroup div - */} - - - handleChange(ev, 'min')} - onBlur={setTouched} - fullWidth={true} - isInvalid={showValidation ? !isValid : false} - aria-label={minLabel} - prepend={minLabel} - compressed - /> - - - handleChange(ev, 'max')} - onBlur={setTouched} - fullWidth={true} - isInvalid={showValidation ? !isValid : false} - aria-label={maxLabel} - prepend={maxLabel} - compressed - /> - - - + + + + handleChange(ev, 'min')} + onBlur={setTouched} + fullWidth={true} + isInvalid={showValidation ? !isValid : false} + aria-label={minLabel} + prepend={minLabel} + compressed + /> + + + handleChange(ev, 'max')} + onBlur={setTouched} + fullWidth={true} + isInvalid={showValidation ? !isValid : false} + aria-label={maxLabel} + prepend={maxLabel} + compressed + /> + + ); } diff --git a/src/legacy/ui/public/vis/editors/default/controls/filter.tsx b/src/legacy/ui/public/vis/editors/default/controls/filter.tsx index f81734f537426..779d5acf5b411 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/filter.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/filter.tsx @@ -129,7 +129,7 @@ function FilterRow({ /> ) : null} - + ); } diff --git a/src/legacy/ui/public/vis/editors/default/controls/ip_range_type.tsx b/src/legacy/ui/public/vis/editors/default/controls/ip_range_type.tsx index da298b767fc5c..380052e693a89 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/ip_range_type.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/ip_range_type.tsx @@ -50,6 +50,7 @@ function IpRangeTypeParamEditor({ agg, value, setValue }: AggParamEditorProps + { - // to force update when sub-agg params are changed - setInnerState(!innerState); - subAggParams.onAggParamsChange(...rest); - }} - onAggTypeChange={subAggParams.onAggTypeChange} - setValidity={setValidity} - setTouched={setTouched} - /> + <> + + { + // to force update when sub-agg params are changed + setInnerState(!innerState); + subAggParams.onAggParamsChange(...rest); + }} + onAggTypeChange={subAggParams.onAggTypeChange} + setValidity={setValidity} + setTouched={setTouched} + /> + ); } diff --git a/src/legacy/ui/public/vis/editors/default/controls/radius_ratio_option.tsx b/src/legacy/ui/public/vis/editors/default/controls/radius_ratio_option.tsx index 02f6bb404db0c..595ab6e0faf46 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/radius_ratio_option.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/radius_ratio_option.tsx @@ -18,7 +18,7 @@ */ import React, { useEffect } from 'react'; -import { EuiFormRow, EuiIconTip, EuiRange } from '@elastic/eui'; +import { EuiFormRow, EuiIconTip, EuiRange, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { AggControlProps } from './agg_control_props'; @@ -50,21 +50,24 @@ function RadiusRatioOptionControl({ editorStateParams, setValue }: AggControlPro }, []); return ( - - | React.MouseEvent) => - setValue(editorStateParams, PARAM_NAME, parseFloat(e.currentTarget.value)) - } - showRange - showValue - valueAppend="%" - /> - + <> + + | React.MouseEvent + ) => setValue(editorStateParams, PARAM_NAME, parseFloat(e.currentTarget.value))} + showRange + showValue + valueAppend="%" + /> + + + ); } diff --git a/src/legacy/ui/public/vis/editors/default/controls/rows_or_columns.tsx b/src/legacy/ui/public/vis/editors/default/controls/rows_or_columns.tsx index 5ded9d945bc4e..6adaef03963c6 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/rows_or_columns.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/rows_or_columns.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { EuiButtonGroup, EuiFormRow } from '@elastic/eui'; +import { EuiButtonGroup, EuiFormRow, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { AggControlProps } from './agg_control_props'; @@ -46,12 +46,8 @@ function RowsOrColumnsControl({ aggParams, setValue }: AggControlProps) ]; return ( - - <> - {/* - We have to put it into React.Fragment to avoid errors: - EuiFormRow will try to put "compressed" as attribute into a EuiButtonGroup div - */} + <> + ) idSelected={idSelected} onChange={optionId => setValue(aggParams, PARAMS.NAME, optionId === PARAMS.ROWS)} /> - - + + + ); } diff --git a/src/legacy/ui/public/vis/editors/default/controls/string.tsx b/src/legacy/ui/public/vis/editors/default/controls/string.tsx index e48c623e9b931..63827205afdb3 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/string.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/string.tsx @@ -39,6 +39,7 @@ function StringParamEditor({ return ( { - // to force update when sub-agg params are changed - setInnerState(!innerState); - subAggParams.onAggParamsChange(...rest); - }} - onAggTypeChange={subAggParams.onAggTypeChange} - setValidity={setValidity} - setTouched={setTouched} - /> + <> + + { + // to force update when sub-agg params are changed + setInnerState(!innerState); + subAggParams.onAggParamsChange(...rest); + }} + onAggTypeChange={subAggParams.onAggTypeChange} + setValidity={setValidity} + setTouched={setTouched} + /> + ); } diff --git a/src/legacy/ui/public/vis/editors/default/controls/sub_metric.tsx b/src/legacy/ui/public/vis/editors/default/controls/sub_metric.tsx index 0d4816306d12c..836049eb95cab 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/sub_metric.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/sub_metric.tsx @@ -64,6 +64,7 @@ function SubMetricParamEditor({ return ( <> + {aggTitle} { @@ -38,13 +38,8 @@ function SwitchParamEditor({ disabled, }: SwitchParamEditorProps) { return ( -
- + + setValue(ev.target.checked)} /> - -
+
); }