import * as tslib_1 from "tslib";
import ADialog from './ADialog';
/** @internal */
var InputNumberDialog = /** @class */ (function (_super) {
    tslib_1.__extends(InputNumberDialog, _super);
    function InputNumberDialog(dialog, callback, options) {
        if (options === void 0) { options = {}; }
        var _this = _super.call(this, dialog) || this;
        _this.callback = callback;
        _this.ioptions = {
            min: NaN,
            max: NaN,
            step: 'any',
            value: NaN,
            label: null
        };
        Object.assign(_this.ioptions, options);
        return _this;
    }
    InputNumberDialog.prototype.build = function (node) {
        var o = this.ioptions;
        node.insertAdjacentHTML('beforeend', "\n     <input type=\"number\" value=\"" + (isNaN(o.value) ? '' : String(o.value)) + "\" required autofocus placeholder=\"" + (o.label ? o.label : 'enter number') + "\" " + (isNaN(o.min) ? '' : " min=\"" + o.min + "\"") + " " + (isNaN(o.max) ? '' : " max=\"" + o.max + "\"") + " step=\"" + o.step + "\">\n    ");
    };
    InputNumberDialog.prototype.submit = function () {
        this.callback(this.findInput('input[type=number]').valueAsNumber);
        return true;
    };
    return InputNumberDialog;
}(ADialog));
export default InputNumberDialog;
//# sourceMappingURL=InputNumberDialog.js.map