@handie/squirtle
Version:
Widgets for Handie-React
15 lines (14 loc) • 923 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { getControl } from 'handie-react';
import { DateFieldStructuralWidget } from 'handie-react/dist/widgets/class';
import { getPickerOption } from '../../../../utils';
export default class DateRangeEditDateFieldWidget extends DateFieldStructuralWidget {
render() {
const DateRangePicker = getControl('DateRangePicker');
return DateRangePicker ? (_jsx(DateRangePicker, { value: this.getRangeValue(), placeholder: this.getRangePlaceholders(), disabled: this.state.disabled, format: this.getDisplayFormat(), separator: this.getSeparator(), pickerOption: getPickerOption(this.getRangeValue(), this.config, this.$$view.getValue()), onChange: (_, dates) => this.onRangeChange(dates) }, void 0)) : null;
}
componentWillMount() {
super.componentWillMount();
this.setDefaultFormat(this.getCommonBehavior('field.dateFormat'));
}
}