choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
87 lines (70 loc) • 2.41 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _get from "@babel/runtime/helpers/get";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
function _createSuper(Derived) {
function isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
return function () {
var Super = _getPrototypeOf(Derived),
result;
if (isNativeReflectConstruct()) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
import { __decorate } from "tslib";
import React from 'react';
import { observer } from 'mobx-react';
import omit from 'lodash/omit';
import isNumber from 'lodash/isNumber';
import C7NProgress from '../../../es/progress';
import { FormField } from '../field/FormField';
var Progress =
/*#__PURE__*/
function (_FormField) {
_inherits(Progress, _FormField);
var _super = _createSuper(Progress);
function Progress() {
_classCallCheck(this, Progress);
return _super.apply(this, arguments);
}
_createClass(Progress, [{
key: "getValue",
value: function getValue() {
var value = _get(_getPrototypeOf(Progress.prototype), "getValue", this).call(this);
if (isNumber(value)) {
return value;
}
return this.props.percent;
}
}, {
key: "render",
value: function render() {
return React.createElement(C7NProgress, _extends({}, omit(this.props, ['dataSet', 'showHelp', 'renderer']), {
percent: this.getValue()
}));
}
}]);
return Progress;
}(FormField);
Progress.displayName = 'Progress';
Progress = __decorate([observer], Progress);
export default Progress;
//# sourceMappingURL=Progress.js.map