UNPKG

@handie/squirtle

Version:

Widgets for Handie-React

15 lines (14 loc) 855 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 DateEditDateFieldWidget extends DateFieldStructuralWidget { render() { const DatePicker = getControl('DatePicker'); return DatePicker ? (_jsx(DatePicker, { value: this.getDateValue(), placeholder: this.getPlaceholder(), disabled: this.state.disabled, format: this.getDisplayFormat(), pickerOption: getPickerOption(this.getDateValue(), this.config, this.$$view.getValue()), onChange: (_, date) => this.onDateChange(date) }, void 0)) : null; } componentWillMount() { super.componentWillMount(); this.setDefaultFormat(this.getCommonBehavior('field.dateFormat')); } }