Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src-docs/src/views/date_picker/super_date_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ export default class extends Component {
<EuiSwitch
label="Show apply button"
onChange={this.toggleShowApplyButton}
checked={this.state.showUpdateButton}
checked={!this.state.showRefreshOnly && this.state.showUpdateButton}
disabled={this.state.showRefreshOnly}
/>

&emsp;

<EuiSwitch
label="Show refresh only"
label="Is auto-refresh only"
onChange={this.toggleShowRefreshOnly}
checked={this.state.showRefreshOnly}
/>
Expand Down
4 changes: 4 additions & 0 deletions src/components/date_picker/_date_picker_range.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@
padding-right: $euiFormControlPadding / 2;
}
}

.euiDatePickerRange--readOnly {
background: $euiFormBackgroundDisabledColor;
}
4 changes: 4 additions & 0 deletions src/components/date_picker/date_picker_range.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ export const EuiDatePickerRange = ({
iconType,
fullWidth,
isCustom,
readOnly,
...rest
}) => {

const classes = classNames(
'euiDatePickerRange',
{
'euiDatePickerRange--fullWidth': fullWidth,
'euiDatePickerRange--readOnly': readOnly,
},
className
);
Expand All @@ -47,11 +49,13 @@ export const EuiDatePickerRange = ({
startControl = cloneElement(startDateControl, {
showIcon: false,
fullWidth: fullWidth,
readOnly: readOnly,
});

endControl = cloneElement(endDateControl, {
showIcon: false,
fullWidth: fullWidth,
readOnly: readOnly,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`EuiQuickSelectPopover showRefreshOnly 1`] = `
>
<EuiIcon
size="m"
type="calendar"
type="clock"
/>
</EuiButtonEmpty>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class EuiQuickSelectPopover extends Component {
iconSide="right"
data-test-subj="superDatePickerToggleQuickMenuButton"
>
<EuiIcon type={this.props.isPaused ? 'calendar' : 'clock'} />
<EuiIcon type={!this.props.showRefreshOnly && this.props.isPaused ? 'calendar' : 'clock'} />
</EuiButtonEmpty>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class EuiSuperDatePicker extends Component {
isCustom
startDateControl={<div/>}
endDateControl={<div/>}
readOnly
>
<span className="euiSuperDatePicker__prettyFormat">
{prettyInterval(this.props.isPaused, this.props.refreshInterval)}
Expand Down