diff --git a/packages/fiori/bundle.esm.js b/packages/fiori/bundle.esm.js index 79f932dca5ff..e00fed8c7b2f 100644 --- a/packages/fiori/bundle.esm.js +++ b/packages/fiori/bundle.esm.js @@ -7,6 +7,7 @@ import "./dist/Assets.js"; import "./dist/features/CoPilotAnimation.js"; // FIORI components +import Bar from "./dist/Bar.js"; import FlexibleColumnLayout from "./dist/FlexibleColumnLayout.js"; import ProductSwitch from "./dist/ProductSwitch.js"; import ProductSwitchItem from "./dist/ProductSwitchItem.js"; diff --git a/packages/fiori/src/Bar.hbs b/packages/fiori/src/Bar.hbs new file mode 100644 index 000000000000..fe94038de5f6 --- /dev/null +++ b/packages/fiori/src/Bar.hbs @@ -0,0 +1,12 @@ +
\ No newline at end of file diff --git a/packages/fiori/src/Bar.js b/packages/fiori/src/Bar.js new file mode 100644 index 000000000000..072f1bccbdc0 --- /dev/null +++ b/packages/fiori/src/Bar.js @@ -0,0 +1,105 @@ +import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js"; +import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js"; +import BarTemplate from "./generated/templates/BarTemplate.lit.js"; +import BarDesign from "./types/BarDesign.js"; + +// Styles +import BarCss from "./generated/themes/Bar.css.js"; + +/** + * @public + */ +const metadata = { + tag: "ui5-bar", + managedSlots: true, + properties: /** @lends sap.ui.webcomponents.main.Bar.prototype */ { + /** + * Defines theui5-bar
design.
+ * ui5-bar
+ * import @ui5/webcomponents/dist/Bar.js";
+ *
+ * @constructor
+ * @author SAP SE
+ * @alias sap.ui.webcomponents.main.Bar
+ * @extends UI5Element
+ * @tagname ui5-bar
+ * @public
+ * @since 1.0.0-rc.11
+ */
+class Bar extends UI5Element {
+ static get metadata() {
+ return metadata;
+ }
+
+ static get render() {
+ return litRender;
+ }
+
+ static get styles() {
+ return BarCss;
+ }
+
+ static get template() {
+ return BarTemplate;
+ }
+}
+
+Bar.define();
+
+export default Bar;
diff --git a/packages/fiori/src/themes/Bar.css b/packages/fiori/src/themes/Bar.css
new file mode 100644
index 000000000000..f667bcfd14df
--- /dev/null
+++ b/packages/fiori/src/themes/Bar.css
@@ -0,0 +1,62 @@
+:host {
+ background-color: var(--sapPageHeader_Background);
+ height: var(--_ui5_bar_base_height);
+ width: 100%;
+ box-shadow: inset 0 -0.0625rem var(--sapPageHeader_BorderColor);
+ display: block;
+}
+
+.ui5-bar-root {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: inherit;
+ width: inherit;
+ background-color: inherit;
+ box-shadow: inherit;
+ border-radius: inherit;
+}
+
+.ui5-bar-root .ui5-bar-startcontent-container {
+ padding-left: 0.5rem;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+.ui5-bar-root .ui5-bar-endcontent-container {
+ padding-right: 0.5rem;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+.ui5-bar-root .ui5-bar-midcontent-container {
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+:host([design="Footer"]){
+ background-color: var(--sapPageFooter_Background);
+ border-top: 0.0625rem solid var(--sapPageFooter_BorderColor);
+ box-shadow: none;
+}
+
+:host([design="Subheader"]){
+ height: var(--_ui5_bar_subheader_height);
+}
+
+:host([design="FloatingFooter"]){
+ border-radius: var(--sapElement_BorderCornerRadius);
+ background-color: var(--sapPageFooter_Background);
+ box-shadow: var(--sapContent_Shadow1);
+ border: none;
+}
+
+::slotted(*){
+ display: flex;
+ align-items: center;
+ margin: 0 0.25rem;
+}
\ No newline at end of file
diff --git a/packages/fiori/src/themes/base/Bar-parameters.css b/packages/fiori/src/themes/base/Bar-parameters.css
new file mode 100644
index 000000000000..650444c159d7
--- /dev/null
+++ b/packages/fiori/src/themes/base/Bar-parameters.css
@@ -0,0 +1,11 @@
+:root {
+ --_ui5_bar_base_height: 2.75rem;
+ --_ui5_bar_subheader_height: 3rem;
+}
+
+[data-ui5-compact-size],
+.ui5-content-density-compact,
+.sapUiSizeCompact {
+ --_ui5_bar_base_height: 2.5rem;
+ --_ui5_bar_subheader_height: 2.25rem;
+}
diff --git a/packages/fiori/src/themes/sap_belize/parameters-bundle.css b/packages/fiori/src/themes/sap_belize/parameters-bundle.css
index 1e0df06b3368..7a84153d93ed 100644
--- a/packages/fiori/src/themes/sap_belize/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_belize/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "../base/FlexibleColumnLayout-parameters.css";
@import "../base/ProductSwitchItem-parameters.css";
@import "../base/TimelineItem-parameters.css";
diff --git a/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css b/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css
index f9c691ab648f..fbaff801a388 100644
--- a/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "./FlexibleColumnLayout-parameters.css";
@import "./ProductSwitchItem-parameters.css";
@import "./TimelineItem-parameters.css";
diff --git a/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css b/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css
index f9c691ab648f..fbaff801a388 100644
--- a/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "./FlexibleColumnLayout-parameters.css";
@import "./ProductSwitchItem-parameters.css";
@import "./TimelineItem-parameters.css";
diff --git a/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css
index af6f8305d001..3dd6cee7a3f7 100644
--- a/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "../base/FlexibleColumnLayout-parameters.css";
@import "../base/ProductSwitchItem-parameters.css";
@import "../base/TimelineItem-parameters.css";
diff --git a/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css
index 5c31b2dd8d8c..f2af38abec1e 100644
--- a/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "./FlexibleColumnLayout-parameters.css";
@import "../base/ProductSwitchItem-parameters.css";
@import "../base/TimelineItem-parameters.css";
diff --git a/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css
index 590f7db33a19..0863a057bf29 100644
--- a/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "./ProductSwitchItem-parameters.css";
@import "./TimelineItem-parameters.css";
@import "./UploadCollection-parameters.css";
diff --git a/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css
index 590f7db33a19..0863a057bf29 100644
--- a/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css
+++ b/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css
@@ -1,3 +1,4 @@
+@import "../base/Bar-parameters.css";
@import "./ProductSwitchItem-parameters.css";
@import "./TimelineItem-parameters.css";
@import "./UploadCollection-parameters.css";
diff --git a/packages/fiori/src/types/BarDesign.js b/packages/fiori/src/types/BarDesign.js
new file mode 100644
index 000000000000..d52e322fd3e7
--- /dev/null
+++ b/packages/fiori/src/types/BarDesign.js
@@ -0,0 +1,54 @@
+import DataType from "@ui5/webcomponents-base/dist/types/DataType.js";
+
+/**
+ * @lends sap.ui.webcomponents.main.types.BarDesign.prototype
+ * @public
+ */
+const BarTypes = {
+ /**
+ * Default type
+ * @public
+ * @type {Header}
+ */
+ Header: "Header",
+
+ /**
+ * Subheader type
+ * @public
+ * @type {Subheader}
+ */
+ Subheader: "Subheader",
+
+ /**
+ * Footer type
+ * @public
+ * @type {Footer}
+ */
+ Footer: "Footer",
+
+ /**
+ * Floating Footer type - there is visible border on all sides
+ * @public
+ * @type {FloatingFooter}
+ */
+ FloatingFooter: "FloatingFooter",
+};
+
+/**
+ * @class
+ * Different types of Bar.
+ * @constructor
+ * @author SAP SE
+ * @alias sap.ui.webcomponents.main.types.BarDesign
+ * @public
+ * @enum {string}
+ */
+class BarDesign extends DataType {
+ static isValid(value) {
+ return !!BarTypes[value];
+ }
+}
+
+BarDesign.generateTypeAcessors(BarTypes);
+
+export default BarDesign;
diff --git a/packages/fiori/test/pages/Bar.html b/packages/fiori/test/pages/Bar.html
new file mode 100644
index 000000000000..f60dbef99e0e
--- /dev/null
+++ b/packages/fiori/test/pages/Bar.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ ++ + ++ Header Title ++
++ + ++ Subheader Title ++
++ + +Agree +Decline +Cancel +
++ + +Agree +Decline +Cancel +