UNPKG

choerodon-ui

Version:

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

83 lines (66 loc) 2.3 kB
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); }; } var enhancer = function enhancer(WrappedComponent) { return ( /*#__PURE__*/ function (_WrappedComponent) { _inherits(Progress, _WrappedComponent); var _super = _createSuper(Progress); function Progress() { _classCallCheck(this, Progress); return _super.apply(this, arguments); } _createClass(Progress, [{ key: "componentDidUpdate", value: function componentDidUpdate() { if (!this.path) { return; } var pathStyle = this.path.style; pathStyle.transitionDuration = '.3s, .3s, .3s, .06s'; var now = Date.now(); if (this.prevTimeStamp && now - this.prevTimeStamp < 100) { pathStyle.transitionDuration = '0s, 0s'; } this.prevTimeStamp = Date.now(); } }, { key: "render", value: function render() { return _get(_getPrototypeOf(Progress.prototype), "render", this).call(this); } }]); return Progress; }(WrappedComponent) ); }; export default enhancer; //# sourceMappingURL=enhancer.js.map