armstrong-react
Advanced tools
Comparing version
@@ -27,3 +27,4 @@ /// <reference types="react" /> | ||
componentDidMount(): void; | ||
calcTabIndex(tabIndex: number | undefined, fieldIndex: number): number; | ||
render(): JSX.Element; | ||
} |
@@ -127,6 +127,12 @@ "use strict"; | ||
}; | ||
CodeInput.prototype.calcTabIndex = function (tabIndex, fieldIndex) { | ||
if (tabIndex === undefined || tabIndex === -1) { | ||
return tabIndex; | ||
} | ||
return tabIndex + fieldIndex; | ||
}; | ||
CodeInput.prototype.render = function () { | ||
var _this = this; | ||
var validationMessage = formCore_1.DataValidationMessage.get(this.props); | ||
var _a = this.props, onChange = _a.onChange, validationMode = _a.validationMode, attrs = tslib_1.__rest(_a, ["onChange", "validationMode"]); | ||
var _a = this.props, onChange = _a.onChange, validationMode = _a.validationMode, lengthPerBox = _a.lengthPerBox, numeric = _a.numeric, type = _a.type, className = _a.className, tabIndex = _a.tabIndex, attrs = tslib_1.__rest(_a, ["onChange", "validationMode", "lengthPerBox", "numeric", "type", "className", "tabIndex"]); | ||
var classes = index_1.ClassHelpers.classNames("armstrong-input", "code-input", this.props.className, { | ||
@@ -136,3 +142,3 @@ "show-validation": validationMode !== "none" && validationMessage | ||
return (React.createElement("div", { className: classes }, | ||
React.createElement("div", null, this.props.lengthPerBox.map(function (lpb, i) { return (React.createElement("input", { id: "input_" + _this.uniq + "_" + i, readOnly: _this.props.readonly, className: "code-input-field", key: "cb_" + _this.uniq + "_" + i, type: _this.props.type || "text", placeholder: _this.props.placeholder, maxLength: lpb, onClick: function (e) { return _this.handleClick(e); }, onFocus: function (e) { return _this.handleFocus(i, e.target); }, onKeyUp: function (e) { return _this.focusNext(e); }, onKeyDown: function (e) { return _this.keyDown(e); }, onPaste: function (e) { return _this.handlePaste(e); }, onChange: function (e) { return _this.buildValue(); } })); })), | ||
React.createElement("div", null, this.props.lengthPerBox.map(function (lpb, i) { return (React.createElement("input", { id: "input_" + _this.uniq + "_" + i, className: "code-input-field", tabIndex: _this.calcTabIndex(_this.props.tabIndex, i), key: "cb_" + _this.uniq + "_" + i, type: _this.props.type || "text", placeholder: _this.props.placeholder, maxLength: lpb, onClick: function (e) { return _this.handleClick(e); }, onFocus: function (e) { return _this.handleFocus(i, e.target); }, onKeyUp: function (e) { return _this.focusNext(e); }, onKeyDown: function (e) { return _this.keyDown(e); }, onPaste: function (e) { return _this.handlePaste(e); }, onChange: function (e) { return _this.buildValue(); } })); })), | ||
React.createElement(validationWrapper_1.ValidationLabel, { message: validationMessage, mode: validationMode }))); | ||
@@ -139,0 +145,0 @@ }; |
{ | ||
"name": "armstrong-react", | ||
"version": "2.5.11", | ||
"version": "2.5.12", | ||
"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
760480
0.1%15006
0.09%