|
| 1 | +import UI5Element from "@ui5/webcomponents-base/src/UI5Element.js"; |
| 2 | +import Bootstrap from "@ui5/webcomponents-base/src/Bootstrap.js"; |
| 3 | +import BusyIndicatorRenderer from "./build/compiled/BusyIndicatorRenderer.lit.js"; |
| 4 | + |
| 5 | +// Styles |
| 6 | +import busyIndicatorCss from "./themes/BusyIndicator.css.js"; |
| 7 | + |
| 8 | +// all themes should work via the convenience import (inlined now, switch to json when elements can be imported individyally) |
| 9 | +import "./ThemePropertiesProvider.js"; |
| 10 | +import BusyIndicatorType from "./types/BusyIndicatorType.js"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +const metadata = { |
| 16 | + tag: "ui5-busyindicator", |
| 17 | + properties: /** @lends sap.ui.webcomponents.main.BusyIndicator.prototype */ { |
| 18 | + /** |
| 19 | + * Defines the size of the <code>ui5-busyindicator</code>. |
| 20 | + * </br></br> |
| 21 | + * <b>Note:</b> Available options are "Small", "Medium", "Large" |
| 22 | + * |
| 23 | + * @type {BusyIndicatorType} |
| 24 | + * @defaultvalue "Large" |
| 25 | + * @public |
| 26 | + */ |
| 27 | + size: { type: BusyIndicatorType, defaultValue: BusyIndicatorType.Large }, |
| 28 | + }, |
| 29 | +}; |
| 30 | + |
| 31 | +/** |
| 32 | + * @class |
| 33 | + * |
| 34 | + * <h3 class="comment-api-title">Overview</h3> |
| 35 | + * |
| 36 | + * The <code>ui5-busyindicator</code> signals that some operation is going on and that the |
| 37 | + * user must wait. It does not block the current UI screen so other operations could be |
| 38 | + * triggered in parallel. |
| 39 | + * |
| 40 | + * <h3>Usage</h3> |
| 41 | + * For the <code>ui5-busyindicator</code> you can define the size of the indicator as well |
| 42 | + * as whether it is shown or hidden. In order to hide it, use the html attribute <code>hidden</code> or <code>display: none;</code> |
| 43 | + * |
| 44 | + * <h3>ES6 Module Import</h3> |
| 45 | + * |
| 46 | + * <code>import "@ui5/webcomponents/dist/BusyIndicator";</code> |
| 47 | + * |
| 48 | + * @constructor |
| 49 | + * @author SAP SE |
| 50 | + * @alias sap.ui.webcomponents.main.BusyIndicator |
| 51 | + * @extends UI5Element |
| 52 | + * @tagname ui5-busyindicator |
| 53 | + * @public |
| 54 | + */ |
| 55 | +class BusyIndicator extends UI5Element { |
| 56 | + static get metadata() { |
| 57 | + return metadata; |
| 58 | + } |
| 59 | + |
| 60 | + static get styles() { |
| 61 | + return busyIndicatorCss; |
| 62 | + } |
| 63 | + |
| 64 | + static get renderer() { |
| 65 | + return BusyIndicatorRenderer; |
| 66 | + } |
| 67 | + |
| 68 | + get classes() { |
| 69 | + return { |
| 70 | + main: { |
| 71 | + "ui5-busyindicator-wrapper": true, |
| 72 | + [`ui5-busyindicator-${this.size.toLowerCase()}`]: true, |
| 73 | + }, |
| 74 | + }; |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +Bootstrap.boot().then(_ => { |
| 79 | + BusyIndicator.define(); |
| 80 | +}); |
| 81 | + |
| 82 | +export default BusyIndicator; |
0 commit comments