Skip to content

Commit

Permalink
Fix for delimited
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Jul 29, 2019
1 parent d8cedf4 commit 1ee7727
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
25 changes: 23 additions & 2 deletions src-docs/src/views/range/compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default class extends Component {
id={makeId()}
value={this.state.value}
onChange={this.onChange}
// compressed
showInput="only"
showLabels
/>
Expand All @@ -62,7 +61,29 @@ export default class extends Component {
id={makeId()}
value={this.state.dualValue}
onChange={this.onDualChange}
// compressed
showInput="only"
showLabels
levels={this.levels}
/>

<EuiSpacer size="xl" />

<EuiRange
id={makeId()}
value={this.state.value}
onChange={this.onChange}
compressed
showInput="only"
showLabels
/>

<EuiSpacer size="xl" />

<EuiDualRange
id={makeId()}
value={this.state.dualValue}
onChange={this.onDualChange}
compressed
showInput="only"
showLabels
levels={this.levels}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ exports[`EuiDualRange is rendered 1`] = `

exports[`EuiDualRange props compressed should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
class="euiRangeWrapper euiRangeWrapper--compressed euiDualRange"
>
<div
class="euiRangeTrack"
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/range/__snapshots__/range.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ exports[`EuiRange is rendered 1`] = `

exports[`EuiRange props compressed should render 1`] = `
<div
class="euiRangeWrapper euiRange"
class="euiRangeWrapper euiRangeWrapper--compressed euiRange"
>
<div
class="euiRangeTrack"
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/range/dual_range.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classNames from 'classnames';
import { keyCodes } from '../../../services';
import { isWithinRange } from '../../../services/number';
import { EuiPopover } from '../../popover';
import { EuiFormControlLayoutRange } from '../form_control_layout';
import { EuiFormControlLayoutDelimited } from '../form_control_layout';

import { EuiRangeHighlight } from './range_highlight';
import { EuiRangeInput } from './range_input';
Expand Down Expand Up @@ -407,7 +407,7 @@ export class EuiDualRange extends Component {
<EuiPopover
// ownFocus={popoverShouldOwnFocus}
button={
<EuiFormControlLayoutRange
<EuiFormControlLayoutDelimited
fullWidth={fullWidth}
compressed={compressed}
startControl={minInput}
Expand Down
3 changes: 3 additions & 0 deletions src/components/form/range/range_wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ import classNames from 'classnames';
export interface EuiRangeWrapperProps {
className?: string;
fullWidth?: boolean;
compressed?: boolean;
}

export const EuiRangeWrapper: FunctionComponent<EuiRangeWrapperProps> = ({
children,
className,
fullWidth,
compressed,
}) => {
const classes = classNames(
'euiRangeWrapper',
{
'euiRangeWrapper--fullWidth': fullWidth,
'euiRangeWrapper--compressed': compressed,
},
className
);
Expand Down

0 comments on commit 1ee7727

Please sign in to comment.