choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
50 lines (39 loc) • 1.43 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _get from "@babel/runtime/helpers/get";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
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