@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
34 lines • 1.54 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Loading
*/
import "./LoadingStatus.scss";
import classnames from "classnames";
import * as React from "react";
/** A loading indicator that shows status text along with the percentage.
* @public
* @deprecated in 4.12.0. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
*/
export class LoadingStatus extends React.PureComponent {
// sanity check to keep percentage between 0 & 100
inRange(percent) {
let value = Math.min(percent, 100);
value = Math.max(value, 0);
return value;
}
render() {
const percent = `${this.inRange(this.props.percent)}%`;
const containerClass = classnames(this.props.className, "loading-status-container");
return (React.createElement("div", { className: containerClass, style: this.props.style },
React.createElement("span", { className: "loading-status-message" }, this.props.message),
React.createElement("span", { className: "loading-status-percent" }, percent)));
}
}
LoadingStatus.defaultProps = {
message: "",
percent: 0,
};
//# sourceMappingURL=LoadingStatus.js.map