UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

51 lines (42 loc) 1.39 kB
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 UrlField = /*#__PURE__*/function (_TextField) { _inherits(UrlField, _TextField); var _super = _createSuper(UrlField); function UrlField() { var _this; _classCallCheck(this, UrlField); _this = _super.apply(this, arguments); _this.type = 'url'; return _this; } _createClass(UrlField, [{ key: "defaultValidationMessages", get: function get() { var label = this.getProp('label'); return { valueMissing: $l('UrlField', label ? 'value_missing' : 'value_missing_no_label', { label: label }), typeMismatch: $l('UrlField', 'type_mismatch') }; } }, { key: "getFieldType", value: function getFieldType() { return FieldType.url; } }]); return UrlField; }(TextField); UrlField.displayName = 'UrlField'; UrlField = __decorate([observer], UrlField); export default UrlField; //# sourceMappingURL=UrlField.js.map