@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
41 lines • 2.39 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 "./LoadingPrompt.scss";
import classnames from "classnames";
import * as React from "react";
import { Button, ProgressLinear } from "@itwin/itwinui-react";
import { LoadingBar } from "./LoadingBar.js";
import { LoadingSpinner } from "./LoadingSpinner.js";
import { LoadingStatus } from "./LoadingStatus.js";
/** A component to display during loading that optionally shows percentage, status text and a cancel button.
* @public
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
*/
export class LoadingPrompt extends React.PureComponent {
render() {
const isDeterminate = this.props.isDeterminate;
return (React.createElement("div", { className: classnames("core-loadingprompt", this.props.className), style: this.props.style },
React.createElement("span", { className: "title" }, this.props.title),
this.props.message && (React.createElement("span", { className: "message" }, this.props.message)),
isDeterminate && (React.createElement(LoadingBar, { style: { width: "100%" }, percent: this.props.percent, showPercentage: this.props.showPercentage })),
isDeterminate && this.props.showStatus && (React.createElement(LoadingStatus, { style: { marginTop: ".5em", width: "100%", fontSize: ".75em" }, percent: this.props.percent, message: this.props.status })),
!isDeterminate &&
(this.props.showIndeterminateBar ? (React.createElement(ProgressLinear, { indeterminate: true })) : (React.createElement(LoadingSpinner, null))),
this.props.showCancel && (React.createElement(Button, { className: "loading-prompt-cancel", onClick: this.props.onCancel }, "Cancel"))));
}
}
LoadingPrompt.defaultProps = {
showPercentage: false,
showStatus: false,
showCancel: false,
isDeterminate: false,
showIndeterminateBar: false,
percent: 0,
status: "",
};
//# sourceMappingURL=LoadingPrompt.js.map