@up-group/react-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
44 lines • 1.88 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var BaseControl_1 = require("../_Common/BaseControl/BaseControl");
var Input_1 = require("../Input");
var UpPhone = (function (_super) {
__extends(UpPhone, _super);
function UpPhone(p, c) {
var _this = _super.call(this, p, c) || this;
_this.phoneHandleChangeEvent = function (event) {
console.log('Phone change event');
console.log(event);
_this.handleChangeEvent(event);
};
return _this;
}
UpPhone.prototype.getValue = function (event) {
return event;
};
UpPhone.prototype.renderControl = function () {
return (React.createElement(Input_1.default, { iconName: "phone", validation: [{
pattern: /^(0|\+33)[1-9]([-. ]?[0-9]{2}){4}$/,
errorMessage: "Le champ doit être un numéro de téléphone "
}], value: this.state.value, onChange: this.phoneHandleChangeEvent, isRequired: this.props.isRequired, showError: this.props.showError }));
};
UpPhone.defaultProps = {
showError: true,
width: "medium",
defaultValue: ""
};
return UpPhone;
}(BaseControl_1.BaseControlComponent));
exports.default = UpPhone;
//# sourceMappingURL=UpPhone.js.map
;