UNPKG

@handie/squirtle

Version:

Widgets for Handie-React

15 lines (14 loc) 947 B
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 DateTimeRangeEditDateFieldWidget extends DateFieldStructuralWidget { render() { const DateTimeRangePicker = getControl('DateTimeRangePicker'); return DateTimeRangePicker ? (_jsx(DateTimeRangePicker, { 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.dateTimeFormat')); } }