Repository URL to install this package:
|
Version:
3.7.2 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = require("react");
const mobx_react_1 = require("xmobx/mobx-react");
const validators_1 = require("../../validators");
const ObserverInput_1 = require("../inputs/ObserverInput");
let TelephonePlugin = class TelephonePlugin extends React.Component {
static isSatisfiedByProps(props) {
return ['telephone'].includes(props.type);
}
render() {
return (React.createElement(ObserverInput_1.ObserverInput, Object.assign({ required: true, minLength: 4, pattern: "[+()0-9]+", placeholder: "1250..." }, this.props, { type: "tel", autoComplete: "tel", dataQa: "qa-telephone" })));
}
};
// used by state
TelephonePlugin.defaultState = (inputState) => {
return {
label: 'Phone',
validator: (value) => validators_1.isValidTelephone(value) || validators_1.errorMessageFor('telephone'),
};
};
TelephonePlugin = tslib_1.__decorate([
mobx_react_1.observer
], TelephonePlugin);
exports.TelephonePlugin = TelephonePlugin;
exports.default = TelephonePlugin;
//# sourceMappingURL=TelephonePlugin.js.map