armstrong-react
Advanced tools
Comparing version
@@ -21,2 +21,4 @@ /// <reference types="react" /> | ||
minuteLabel?: string; | ||
/** (boolean) If true, when you select any hour, the minutes will be automatically set to 0 */ | ||
zeroMinutesOnHourSelected?: boolean; | ||
} | ||
@@ -23,0 +25,0 @@ export interface ITimerInputState { |
@@ -20,2 +20,5 @@ "use strict"; | ||
if (!_this.props.onChange || formatting_1.Formatting.isNullOrUndefined(d.hours) || formatting_1.Formatting.isNullOrUndefined(d.minutes)) { | ||
if (_this.props.zeroMinutesOnHourSelected && !formatting_1.Formatting.isNullOrUndefined(d.hours) && formatting_1.Formatting.isNullOrUndefined(d.minutes)) { | ||
_this.setState({ minutes: 0 }); | ||
} | ||
return; | ||
@@ -61,3 +64,3 @@ } | ||
var minuteOptions = options_1.buildOptions(this.props.minuteLabel, minutes, function (v) { return v; }, function (v) { return formatting_1.Formatting.twoDigitNumber(v); }); | ||
return (React.createElement(form_1.Form, { className: classNames_1.ClassHelpers.classNames("time-input", "armstrong-input", this.props.className, this.props.disabled ? "input-disabled" : null, { "show-validation": (this.props.validationMode !== "none" && validationMessage) }), dataBinder: form_1.Form.jsonDataBinder(this.state), onDataChanged: this.handleDataChanged, title: validationMessage }, | ||
return (React.createElement(form_1.Form, { className: classNames_1.ClassHelpers.classNames("time-input", "armstrong-input", this.props.className, this.props.disabled ? "input-disabled" : null, { "show-validation": this.props.validationMode !== "none" && validationMessage }), dataBinder: form_1.Form.jsonDataBinder(this.state), onDataChanged: this.handleDataChanged, title: validationMessage }, | ||
React.createElement(grid_1.Grid, null, | ||
@@ -69,4 +72,4 @@ React.createElement(grid_1.Row, null, | ||
React.createElement("select", tslib_1.__assign({ tabIndex: this.props.tabIndex }, form_1.Form.Bind.selectNumeric("minutes"), { disabled: this.props.disabled, "data-validation-message": validationMessage }), minuteOptions))), | ||
React.createElement(validationWrapper_1.ValidationLabel, { message: validationMessage, mode: this.props.validationMode, wrapper: function (p) { return React.createElement(grid_1.Row, { height: "auto" }, | ||
React.createElement(grid_1.Col, tslib_1.__assign({}, p))); } })))); | ||
React.createElement(validationWrapper_1.ValidationLabel, { message: validationMessage, mode: this.props.validationMode, wrapper: function (p) { return (React.createElement(grid_1.Row, { height: "auto" }, | ||
React.createElement(grid_1.Col, tslib_1.__assign({}, p)))); } })))); | ||
}; | ||
@@ -73,0 +76,0 @@ TimeInput.hours = _.range(0, 24); |
{ | ||
"name": "armstrong-react", | ||
"version": "2.3.22", | ||
"version": "2.3.23", | ||
"description": "Rocketmakers Armstrong library of React components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
707770
0.12%14189
0.13%