superdesk-ui-framework 3.1.13 → 3.1.14
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.
@@ -7,6 +7,7 @@ import { throttle } from 'lodash';
|
|
7
7
|
import nextId from "react-id-generator";
|
8
8
|
import { InputWrapper } from './Form';
|
9
9
|
import { IInputWrapper } from './Form/InputWrapper';
|
10
|
+
import {Button} from './Button';
|
10
11
|
|
11
12
|
export type DatePickerLocaleSettings = Omit<LocaleSettings, 'today' | 'clear'>;
|
12
13
|
|
@@ -39,7 +40,6 @@ interface IDatePicker extends IDatePickerBase {
|
|
39
40
|
onChange(valueNext: Date | null): void;
|
40
41
|
maxDate?: Date;
|
41
42
|
minDate?: Date;
|
42
|
-
showButtonBar?: boolean;
|
43
43
|
'data-test-id'?: string;
|
44
44
|
}
|
45
45
|
|
@@ -160,7 +160,17 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
|
160
160
|
tabindex={this.props.tabindex}
|
161
161
|
>
|
162
162
|
<Calendar
|
163
|
-
|
163
|
+
footerTemplate={this.props.required !== true ? () => (
|
164
|
+
<div className='d-flex justify-end'>
|
165
|
+
<Button
|
166
|
+
onClick={() => {
|
167
|
+
this.props.onChange(null);
|
168
|
+
}}
|
169
|
+
text='Clear'
|
170
|
+
data-test-id='clear-button'
|
171
|
+
/>
|
172
|
+
</div>
|
173
|
+
) : undefined}
|
164
174
|
inputId={this.htmlId}
|
165
175
|
ariaLabelledBy={this.htmlId + 'label'}
|
166
176
|
ref={(ref) => {
|