import * as tslib_1 from "tslib";
import ADialog from './ADialog';
import { timeFormat } from 'd3-time-format';
/** @internal */
var InputDateDialog = /** @class */ (function (_super) {
    tslib_1.__extends(InputDateDialog, _super);
    function InputDateDialog(dialog, callback, options) {
        if (options === void 0) { options = {}; }
        var _this = _super.call(this, dialog) || this;
        _this.callback = callback;
        _this.ioptions = {
            value: null,
            label: null
        };
        Object.assign(_this.ioptions, options);
        return _this;
    }
    InputDateDialog.prototype.build = function (node) {
        var o = this.ioptions;
        var f = timeFormat('%Y-%m-%d');
        node.insertAdjacentHTML('beforeend', "\n     <input type=\"date\" value=\"" + (o.value ? f(o.value) : '') + "\" required autofocus placeholder=\"" + (o.label ? o.label : 'enter date') + "\">\n    ");
    };
    InputDateDialog.prototype.submit = function () {
        this.callback(this.findInput('input[type=date]').valueAsDate);
        return true;
    };
    return InputDateDialog;
}(ADialog));
export default InputDateDialog;
//# sourceMappingURL=InputDateDialog.js.map