choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
56 lines (47 loc) • 1.5 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
import { __decorate } from "tslib";
import { observer } from 'mobx-react';
import { TextField } from '../text-field/TextField';
import { $l } from '../locale-context';
import { FieldType } from '../data-set/enum';
var EmailField = /*#__PURE__*/function (_TextField) {
_inherits(EmailField, _TextField);
var _super = _createSuper(EmailField);
function EmailField() {
var _this;
_classCallCheck(this, EmailField);
_this = _super.apply(this, arguments);
_this.type = 'email';
return _this;
}
_createClass(EmailField, [{
key: "range",
get: function get() {
return false;
}
}, {
key: "getFieldType",
value: function getFieldType() {
return FieldType.email;
}
}, {
key: "defaultValidationMessages",
get: function get() {
var label = this.getProp('label');
return {
valueMissing: $l('EmailField', label ? 'value_missing' : 'value_missing_no_label', {
label: label
}),
typeMismatch: $l('EmailField', 'type_mismatch')
};
}
}]);
return EmailField;
}(TextField);
EmailField.displayName = 'EmailField';
EmailField = __decorate([observer], EmailField);
export default EmailField;
//# sourceMappingURL=EmailField.js.map