|
| 1 | +import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js"; |
| 2 | +import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js"; |
| 3 | +import BarTemplate from "./generated/templates/BarTemplate.lit.js"; |
| 4 | +import BarDesign from "./types/BarDesign.js"; |
| 5 | + |
| 6 | +// Styles |
| 7 | +import BarCss from "./generated/themes/Bar.css.js"; |
| 8 | + |
| 9 | +/** |
| 10 | + * @public |
| 11 | + */ |
| 12 | +const metadata = { |
| 13 | + tag: "ui5-bar", |
| 14 | + managedSlots: true, |
| 15 | + properties: /** @lends sap.ui.webcomponents.main.Bar.prototype */ { |
| 16 | + /** |
| 17 | + * Defines the <code>ui5-bar</code> design. |
| 18 | + * <br><br> |
| 19 | + * <b>Note:</b> Available options are "Header", "Subheader", "Footer", "FloatingFooter". |
| 20 | + * |
| 21 | + * @type {BarDesign} |
| 22 | + * @defaultvalue "Header" |
| 23 | + * @public |
| 24 | + */ |
| 25 | + design: { |
| 26 | + type: BarDesign, |
| 27 | + defaultValue: BarDesign.Header, |
| 28 | + }, |
| 29 | + }, |
| 30 | + slots: /** @lends sap.ui.webcomponents.main.Bar.prototype */ { |
| 31 | + /** |
| 32 | + * @type {HTMLElement[]} |
| 33 | + * @slot |
| 34 | + * @public |
| 35 | + */ |
| 36 | + startContent: { |
| 37 | + type: HTMLElement, |
| 38 | + }, |
| 39 | + /** |
| 40 | + * @type {HTMLElement[]} |
| 41 | + * @slot |
| 42 | + * @public |
| 43 | + */ |
| 44 | + middleContent: { |
| 45 | + type: HTMLElement, |
| 46 | + }, |
| 47 | + /** |
| 48 | + * @type {HTMLElement[]} |
| 49 | + * @slot |
| 50 | + * @public |
| 51 | + */ |
| 52 | + endContent: { |
| 53 | + type: HTMLElement, |
| 54 | + }, |
| 55 | + }, |
| 56 | + events: /** @lends sap.ui.webcomponents.main.Bar.prototype */ { |
| 57 | + // |
| 58 | + }, |
| 59 | +}; |
| 60 | + |
| 61 | +/** |
| 62 | + * @class |
| 63 | + * |
| 64 | + * <h3 class="comment-api-title">Overview</h3> |
| 65 | + * The Bar component consists of three areas to hold its content. It has the capability to center content, such as a title, while having other components on the left and right side. |
| 66 | + * |
| 67 | + * <h3>Usage</h3> |
| 68 | + * With the use of the design property, you can set the style of the Bar to appear designed like a Header, Subheader, Footer and FloatingFooter. |
| 69 | + * |
| 70 | + * Note: Do not place a Bar inside another Bar or inside any bar-like component. Doing so causes unpredictable behavior. |
| 71 | + * |
| 72 | + * For the <code>ui5-bar</code> |
| 73 | + * <h3>ES6 Module Import</h3> |
| 74 | + * |
| 75 | + * <code>import @ui5/webcomponents/dist/Bar.js";</code> |
| 76 | + * |
| 77 | + * @constructor |
| 78 | + * @author SAP SE |
| 79 | + * @alias sap.ui.webcomponents.main.Bar |
| 80 | + * @extends UI5Element |
| 81 | + * @tagname ui5-bar |
| 82 | + * @public |
| 83 | + * @since 1.0.0-rc.11 |
| 84 | + */ |
| 85 | +class Bar extends UI5Element { |
| 86 | + static get metadata() { |
| 87 | + return metadata; |
| 88 | + } |
| 89 | + |
| 90 | + static get render() { |
| 91 | + return litRender; |
| 92 | + } |
| 93 | + |
| 94 | + static get styles() { |
| 95 | + return BarCss; |
| 96 | + } |
| 97 | + |
| 98 | + static get template() { |
| 99 | + return BarTemplate; |
| 100 | + } |
| 101 | +} |
| 102 | + |
| 103 | +Bar.define(); |
| 104 | + |
| 105 | +export default Bar; |
0 commit comments