@ui5/webcomponents 0.0.0-1acdb5da5 → 0.0.0-1b5f0ec39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/Avatar.d.ts +9 -3
- package/dist/Avatar.js +29 -10
- package/dist/Avatar.js.map +1 -1
- package/dist/Carousel.d.ts +1 -0
- package/dist/Carousel.js +1 -0
- package/dist/Carousel.js.map +1 -1
- package/dist/CheckBox.d.ts +10 -0
- package/dist/CheckBox.js +10 -0
- package/dist/CheckBox.js.map +1 -1
- package/dist/Icon.d.ts +11 -0
- package/dist/Icon.js +11 -0
- package/dist/Icon.js.map +1 -1
- package/dist/Menu.d.ts +21 -0
- package/dist/Menu.js +26 -6
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.d.ts +23 -1
- package/dist/MenuItem.js +10 -3
- package/dist/MenuItem.js.map +1 -1
- package/dist/Tab.d.ts +1 -1
- package/dist/Tab.js.map +1 -1
- package/dist/TabContainer.d.ts +10 -10
- package/dist/TabContainer.js +10 -10
- package/dist/TabContainer.js.map +1 -1
- package/dist/Title.d.ts +1 -0
- package/dist/Title.js +1 -0
- package/dist/Title.js.map +1 -1
- package/dist/api.json +1 -1
- package/dist/assets/Title.3d358ef7.css +1 -0
- package/dist/assets/parameters-bundle.css.067142cc.js +1 -0
- package/dist/assets/parameters-bundle.css.0d6c19c9.js +1 -0
- package/dist/assets/parameters-bundle.css.217b9808.js +1 -0
- package/dist/assets/parameters-bundle.css.2280ce3e.js +1 -0
- package/dist/assets/parameters-bundle.css.3e7079bc.js +1 -0
- package/dist/assets/parameters-bundle.css.46b7578e.js +1 -0
- package/dist/assets/parameters-bundle.css.472c33c9.js +1 -0
- package/dist/assets/{parameters-bundle.css.3e7ea7bd.js → parameters-bundle.css.750d2219.js} +1 -1
- package/dist/assets/parameters-bundle.css.78ee4829.js +1 -0
- package/dist/assets/parameters-bundle.css.7bae430d.js +1 -0
- package/dist/assets/parameters-bundle.css.860290a0.js +1 -0
- package/dist/assets/parameters-bundle.css.8f1d575d.js +1 -0
- package/dist/assets/parameters-bundle.css.91b4958e.js +1 -0
- package/dist/assets/parameters-bundle.css.9b175fb5.js +1 -0
- package/dist/assets/parameters-bundle.css.a68d7143.js +1 -0
- package/dist/assets/parameters-bundle.css.ab21e265.js +1 -0
- package/dist/assets/parameters-bundle.css.b7a02c6d.js +1 -0
- package/dist/assets/parameters-bundle.css.b8686554.js +1 -0
- package/dist/assets/parameters-bundle.css.bdbac4ec.js +1 -0
- package/dist/assets/parameters-bundle.css.d6e06337.js +1 -0
- package/dist/assets/parameters-bundle.css.d806367c.js +1 -0
- package/dist/assets/parameters-bundle.css.ef6e66b9.js +1 -0
- package/dist/assets/parameters-bundle.css.f3164b8d.js +1 -0
- package/dist/assets/parameters-bundle.css.f65359ec.js +1 -0
- package/dist/css/themes/Avatar.css +1 -1
- package/dist/css/themes/CheckBox.css +1 -1
- package/dist/css/themes/Link.css +1 -1
- package/dist/css/themes/Menu.css +1 -1
- package/dist/css/themes/Panel.css +1 -1
- package/dist/css/themes/Suggestions.css +1 -1
- package/dist/css/themes/TabContainer.css +1 -1
- package/dist/css/themes/TableCell.css +1 -1
- package/dist/css/themes/TableRow.css +1 -1
- package/dist/css/themes/Title.css +1 -1
- package/dist/css/themes/sap_belize/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_belize_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_belize_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/generated/assets/themes/sap_belize/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/templates/AvatarTemplate.lit.js +2 -3
- package/dist/generated/templates/CheckBoxTemplate.lit.js +1 -1
- package/dist/generated/templates/IconTemplate.lit.js +1 -1
- package/dist/generated/templates/InputPopoverTemplate.lit.js +1 -1
- package/dist/generated/templates/MenuTemplate.lit.js +5 -3
- package/dist/generated/themes/Avatar.css.js +1 -1
- package/dist/generated/themes/Avatar.css.js.map +1 -1
- package/dist/generated/themes/CheckBox.css.js +1 -1
- package/dist/generated/themes/CheckBox.css.js.map +1 -1
- package/dist/generated/themes/Link.css.js +1 -1
- package/dist/generated/themes/Link.css.js.map +1 -1
- package/dist/generated/themes/Menu.css.js +1 -1
- package/dist/generated/themes/Menu.css.js.map +1 -1
- package/dist/generated/themes/Panel.css.js +1 -1
- package/dist/generated/themes/Panel.css.js.map +1 -1
- package/dist/generated/themes/Suggestions.css.js +1 -1
- package/dist/generated/themes/Suggestions.css.js.map +1 -1
- package/dist/generated/themes/TabContainer.css.js +1 -1
- package/dist/generated/themes/TabContainer.css.js.map +1 -1
- package/dist/generated/themes/TableCell.css.js +1 -1
- package/dist/generated/themes/TableCell.css.js.map +1 -1
- package/dist/generated/themes/TableRow.css.js +1 -1
- package/dist/generated/themes/TableRow.css.js.map +1 -1
- package/dist/generated/themes/Title.css.js +1 -1
- package/dist/generated/themes/Title.css.js.map +1 -1
- package/dist/generated/themes/sap_belize/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/package.json +7 -7
- package/src/Avatar.hbs +12 -6
- package/src/CheckBox.hbs +1 -0
- package/src/Icon.hbs +1 -0
- package/src/InputPopover.hbs +1 -1
- package/src/Menu.hbs +12 -1
- package/src/themes/Avatar.css +16 -0
- package/src/themes/CheckBox.css +13 -23
- package/src/themes/Link.css +10 -3
- package/src/themes/Menu.css +9 -0
- package/src/themes/Panel.css +1 -1
- package/src/themes/Suggestions.css +12 -0
- package/src/themes/TabContainer.css +2 -0
- package/src/themes/TableCell.css +1 -1
- package/src/themes/TableRow.css +0 -1
- package/src/themes/Title.css +8 -1
- package/src/themes/base/Link-parameters.css +2 -0
- package/src/themes/base/Panel-parameters.css +1 -0
- package/src/themes/base/rtl-parameters.css +3 -1
- package/src/themes/sap_horizon/CheckBox-parameters.css +4 -9
- package/src/themes/sap_horizon/Link-parameters.css +1 -0
- package/src/themes/sap_horizon/Panel-parameters.css +1 -0
- package/src/themes/sap_horizon_dark/CheckBox-parameters.css +4 -9
- package/src/themes/sap_horizon_dark/Link-parameters.css +1 -0
- package/src/themes/sap_horizon_dark/Panel-parameters.css +1 -0
- package/src/themes/sap_horizon_hcb/CheckBox-parameters.css +2 -7
- package/src/themes/sap_horizon_hcb/Link-parameters.css +1 -0
- package/src/themes/sap_horizon_hcb/Panel-parameters.css +1 -0
- package/src/themes/sap_horizon_hcw/CheckBox-parameters.css +2 -7
- package/src/themes/sap_horizon_hcw/Link-parameters.css +1 -0
- package/src/themes/sap_horizon_hcw/Panel-parameters.css +1 -0
- package/dist/assets/Title.d6aa17aa.css +0 -1
- package/dist/assets/parameters-bundle.css.01644757.js +0 -1
- package/dist/assets/parameters-bundle.css.09a8d17f.js +0 -1
- package/dist/assets/parameters-bundle.css.22c70329.js +0 -1
- package/dist/assets/parameters-bundle.css.2c8496aa.js +0 -1
- package/dist/assets/parameters-bundle.css.52765351.js +0 -1
- package/dist/assets/parameters-bundle.css.699b96c0.js +0 -1
- package/dist/assets/parameters-bundle.css.6baa4ec8.js +0 -1
- package/dist/assets/parameters-bundle.css.6db4d34a.js +0 -1
- package/dist/assets/parameters-bundle.css.6e0935a3.js +0 -1
- package/dist/assets/parameters-bundle.css.70a65e3a.js +0 -1
- package/dist/assets/parameters-bundle.css.71348be9.js +0 -1
- package/dist/assets/parameters-bundle.css.71c92b92.js +0 -1
- package/dist/assets/parameters-bundle.css.832a51a3.js +0 -1
- package/dist/assets/parameters-bundle.css.8425804e.js +0 -1
- package/dist/assets/parameters-bundle.css.9bd22734.js +0 -1
- package/dist/assets/parameters-bundle.css.b12ea801.js +0 -1
- package/dist/assets/parameters-bundle.css.b429cbbc.js +0 -1
- package/dist/assets/parameters-bundle.css.b7a262bf.js +0 -1
- package/dist/assets/parameters-bundle.css.c565b624.js +0 -1
- package/dist/assets/parameters-bundle.css.cbd268df.js +0 -1
- package/dist/assets/parameters-bundle.css.d211215e.js +0 -1
- package/dist/assets/parameters-bundle.css.d3b9e3dd.js +0 -1
- package/dist/assets/parameters-bundle.css.f552e9e6.js +0 -1
package/dist/Icon.d.ts
CHANGED
|
@@ -73,6 +73,17 @@ import IconDesign from "./types/IconDesign.js";
|
|
|
73
73
|
* <code><ui5-icon name="tnt/antenna"></ui5-icon></code><br>
|
|
74
74
|
* <code><ui5-icon name="business-suite/ab-testing"></ui5-icon></code>
|
|
75
75
|
*
|
|
76
|
+
* <br><br>
|
|
77
|
+
* <h3>CSS Shadow Parts</h3>
|
|
78
|
+
*
|
|
79
|
+
* <ui5-link target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/::part">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.
|
|
80
|
+
* <br>
|
|
81
|
+
* The <code>ui5-icon</code> exposes the following CSS Shadow Parts:
|
|
82
|
+
* <ul>
|
|
83
|
+
* <li>root - Used to style the outermost wrapper of the <code>ui5-icon</code></li>
|
|
84
|
+
* </ul>
|
|
85
|
+
*
|
|
86
|
+
* <br><br>
|
|
76
87
|
* <h3>Keyboard Handling</h3>
|
|
77
88
|
*
|
|
78
89
|
* <ul>
|
package/dist/Icon.js
CHANGED
|
@@ -91,6 +91,17 @@ const PRESENTATION_ROLE = "presentation";
|
|
|
91
91
|
* <code><ui5-icon name="tnt/antenna"></ui5-icon></code><br>
|
|
92
92
|
* <code><ui5-icon name="business-suite/ab-testing"></ui5-icon></code>
|
|
93
93
|
*
|
|
94
|
+
* <br><br>
|
|
95
|
+
* <h3>CSS Shadow Parts</h3>
|
|
96
|
+
*
|
|
97
|
+
* <ui5-link target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/::part">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.
|
|
98
|
+
* <br>
|
|
99
|
+
* The <code>ui5-icon</code> exposes the following CSS Shadow Parts:
|
|
100
|
+
* <ul>
|
|
101
|
+
* <li>root - Used to style the outermost wrapper of the <code>ui5-icon</code></li>
|
|
102
|
+
* </ul>
|
|
103
|
+
*
|
|
104
|
+
* <br><br>
|
|
94
105
|
* <h3>Keyboard Handling</h3>
|
|
95
106
|
*
|
|
96
107
|
* <ul>
|
package/dist/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,QAAQ,MAAM,qDAA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AAzJ5B,IAAI;IAhBT,aAAa,CAAC;QACd,GAAG,EAAE,UAAU;QACf,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,OAAO;KACf,CAAC;IACF;;;;;;OAMG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,IAAI,CA8RT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { getIconData, getIconDataSync, IconData } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { isSpace, isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport executeTemplate from \"@ui5/webcomponents-base/dist/renderer/executeTemplate.js\";\nimport IconTemplate from \"./generated/templates/IconTemplate.lit.js\";\nimport IconDesign from \"./types/IconDesign.js\";\n\n// Styles\nimport iconCss from \"./generated/themes/Icon.css.js\";\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\nconst PRESENTATION_ROLE = \"presentation\";\n\n/**\n * @class\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * The <code>ui5-icon</code> component represents an SVG icon.\n * There are two main scenarios how the <code>ui5-icon</code> component is used:\n * as a purely decorative element, <br>\n * or as an interactive element that can be focused and clicked.\n *\n * <h3>Usage</h3>\n *\n * 1. <b>Get familiar with the icons collections.</b>\n * <br>\n * Before displaying an icon, you need to explore the icons collections to find and import the desired icon.\n * <br>\n * Currently there are 3 icons collection, available as 3 npm packages:\n * <br>\n *\n * <ul>\n * <li>\n * <ui5-link target=\"_blank\" href=\"https://www.npmjs.com/package/@ui5/webcomponents-icons\">@ui5/webcomponents-icons</ui5-link> represents the \"SAP-icons\" collection and includes the following\n * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons\">icons</ui5-link>.\n * </li>\n * <li>\n * <ui5-link target=\"_blank\" href=\"https://www.npmjs.com/package/@ui5/webcomponents-icons-tnt\">@ui5/webcomponents-icons-tnt</ui5-link> represents the \"tnt\" collection and includes the following\n * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT\">icons</ui5-link>.\n * </li>\n * <li>\n * <ui5-link target=\"_blank\" href=\"https://www.npmjs.com/package/@ui5/webcomponents-icons-business-suite\">@ui5/webcomponents-icons-icons-business-suite</ui5-link> represents the \"business-suite\" collection and includes the following\n * <ui5-link target=\"_blank\" href=\"https://ui5.sap.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/BusinessSuiteInAppSymbols\">icons</ui5-link>.\n * </li>\n * </ul>\n *\n * 2. <b>After exploring the icons collections, add one or more of the packages as dependencies to your project.</b>\n * <br>\n * <code>npm i @ui5/webcomponents-icons</code><br>\n * <code>npm i @ui5/webcomponents-icons-tnt</code><br>\n * <code>npm i @ui5/webcomponents-icons-business-suite</code>\n * <br><br>\n *\n * 3. <b>Then, import the desired icon</b>.\n * <br>\n * <code>import \"@ui5/{package_name}/dist/{icon_name}.js\";</code>\n * <br><br>\n *\n * <b>For Example</b>:\n * <br>\n *\n * For the standard \"SAP-icons\" icon collection, import an icon from the <code>@ui5/webcomponents-icons</code> package:\n * <br>\n * <code>import \"@ui5/webcomponents-icons/dist/employee.js\";</code>\n * <br><br>\n *\n * For the \"tnt\" (SAP Fiori Tools) icon collection, import an icon from the <code>@ui5/webcomponents-icons-tnt</code> package:\n * <br>\n * <code>import \"@ui5/webcomponents-icons-tnt/dist/antenna.js\";</code>\n * <br><br>\n *\n * For the \"business-suite\" (SAP Business Suite) icon collection, import an icon from the <code>@ui5/webcomponents-icons-business-suite</code> package:\n * <br>\n * <code>import \"@ui5/webcomponents-icons-business-suite/dist/ab-testing.js\";</code>\n * <br><br>\n *\n * 4. <b>Display the icon using the <code>ui5-icon</code> web component.</b><br>\n * Set the icon collection (\"SAP-icons\", \"tnt\" or \"business-suite\" - \"SAP-icons\" is the default icon collection and can be skipped)<br>\n * and the icon name to the <code>name</code> property.\n * <br><br>\n *\n * <code><ui5-icon name=\"employee\"></ui5-icon></code><br>\n * <code><ui5-icon name=\"tnt/antenna\"></ui5-icon></code><br>\n * <code><ui5-icon name=\"business-suite/ab-testing\"></ui5-icon></code>\n *\n * <h3>Keyboard Handling</h3>\n *\n * <ul>\n * <li>[SPACE, ENTER, RETURN] - Fires the <code>click</code> event if the <code>interactive</code> property is set to true.</li>\n * <li>[SHIFT] - If [SPACE] or [ENTER],[RETURN] is pressed, pressing [SHIFT] releases the ui5-icon without triggering the click event.</li>\n * </ul>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Icon.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Icon\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-icon\n * @implements sap.ui.webc.main.IIcon\n * @public\n */\n@customElement({\n\ttag: \"ui5-icon\",\n\tlanguageAware: true,\n\tthemeAware: true,\n\trenderer: litRender,\n\ttemplate: IconTemplate,\n\tstyles: iconCss,\n})\n/**\n * Fired on mouseup, <code>SPACE</code> and <code>ENTER</code>.\n * - on mouse click, the icon fires native <code>click</code> event\n * - on <code>SPACE</code> and <code>ENTER</code>, the icon fires custom <code>click</code> event\n * @private\n * @since 1.0.0-rc.8\n */\n@event(\"click\")\nclass Icon extends UI5Element {\n\t/**\n\t * Defines the component semantic design.\n\t *\n\t * <br><br>\n\t * <b>The available values are:</b>\n\t *\n\t * <ul>\n\t * <li><code>Contrast</code></li>\n\t * <li><code>Critical</code></li>\n\t * <li><code>Default</code></li>\n\t * <li><code>Information</code></li>\n\t * <li><code>Negative</code></li>\n\t * <li><code>Neutral</code></li>\n\t * <li><code>NonInteractive</code></li>\n\t * <li><code>Positive</code></li>\n\t * </ul>\n\t *\n\t * @type {sap.ui.webc.main.types.IconDesign}\n\t * @name sap.ui.webc.main.Icon.prototype.design\n\t * @defaultvalue \"Default\"\n\t * @public\n\t * @since 1.9.2\n\t */\n\t@property({ type: IconDesign, defaultValue: IconDesign.Default })\n\tdesign!: IconDesign;\n\n\t/**\n\t * Defines if the icon is interactive (focusable and pressable)\n\t * @name sap.ui.webc.main.Icon.prototype.interactive\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.0.0-rc.8\n\t */\n\t@property({ type: Boolean })\n\tinteractive!: boolean;\n\n\t/**\n\t * Defines the unique identifier (icon name) of the component.\n\t * <br>\n\t *\n\t * To browse all available icons, see the\n\t * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">SAP Icons</ui5-link>,\n\t * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT\">SAP Fiori Tools</ui5-link> and\n\t * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">SAP Business Suite</ui5-link> collections.\n\t * <br>\n\t *\n\t * Example:\n\t * <br>\n\t * <code>name='add'</code>, <code>name='delete'</code>, <code>name='employee'</code>.\n\t * <br><br>\n\t *\n\t * <b>Note:</b> To use the SAP Fiori Tools icons,\n\t * you need to set the <code>tnt</code> prefix in front of the icon's name.\n\t * <br>\n\t *\n\t * Example:\n\t * <br>\n\t * <code>name='tnt/antenna'</code>, <code>name='tnt/actor'</code>, <code>name='tnt/api'</code>.\n\t * <br><br>\n\t *\n\t * <b>Note:</b> To use the SAP Business Suite icons,\n\t * you need to set the <code>business-suite</code> prefix in front of the icon's name.\n\t * <br>\n\t *\n\t * Example:\n\t * <br>\n\t * <code>name='business-suite/3d'</code>, <code>name='business-suite/1x2-grid-layout'</code>, <code>name='business-suite/4x4-grid-layout'</code>.\n\t * @name sap.ui.webc.main.Icon.prototype.name\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\tname!: string;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t * <br><br>\n\t * <b>Note:</b> Every icon should have a text alternative in order to\n\t * calculate its accessible name.\n\t *\n\t * @name sap.ui.webc.main.Icon.prototype.accessibleName\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\taccessibleName!: string;\n\n\t/**\n\t * Defines whether the component should have a tooltip.\n\t * <br><br>\n\t * <b>Note:</b> The tooltip text should be provided via the <code>accessible-name</code> property.\n\t *\n\t * @name sap.ui.webc.main.Icon.prototype.showTooltip\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowTooltip!: boolean;\n\n\t/**\n\t * Defines the accessibility role of the component.\n\t * @name sap.ui.webc.main.Icon.prototype.accessibleRole\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleRole!: string;\n\n\t/**\n\t * Defines the ARIA hidden state of the component.\n\t * Note: If the role is presentation the default value of aria-hidden will be true.\n\t * @private\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tariaHidden!: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ multiple: true })\n\tpathData!: Array<string>;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Object, defaultValue: undefined, noAttribute: true })\n\taccData?: I18nText;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused!: boolean;\n\n\t/**\n\t* @private\n\t*/\n\t@property({ type: Boolean })\n\tinvalid!: boolean;\n\n\t/**\n\t * @private\n\t */\n\t@property({ noAttribute: true, defaultValue: undefined })\n\teffectiveAccessibleName?: string;\n\n\tltr?: boolean;\n\tpackageName?: string;\n\tviewBox?: string;\n\tcustomSvg?: object;\n\n\t_onfocusout?: ((event: FocusEvent) => void);\n\t_onfocusin?: ((event: FocusEvent) => void);\n\n\t_onFocusInHandler() {\n\t\tif (this.interactive) {\n\t\t\tthis.focused = true;\n\t\t}\n\t}\n\n\t_onFocusOutHandler() {\n\t\tthis.focused = false;\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this.interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this.interactive && isSpace(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\t}\n\n\t/**\n\t* Enforce \"ltr\" direction, based on the icons collection metadata.\n\t*/\n\tget _dir() {\n\t\treturn this.ltr ? \"ltr\" : undefined;\n\t}\n\n\tget effectiveAriaHidden() {\n\t\tif (this.ariaHidden === \"\") {\n\t\t\tif (this.isDecorative) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.ariaHidden;\n\t}\n\n\tget _tabIndex() {\n\t\treturn this.interactive ? \"0\" : undefined;\n\t}\n\n\tget isDecorative() {\n\t\treturn this.effectiveAccessibleRole === PRESENTATION_ROLE;\n\t}\n\n\tget effectiveAccessibleRole() {\n\t\tif (this.accessibleRole) {\n\t\t\treturn this.accessibleRole;\n\t\t}\n\n\t\tif (this.interactive) {\n\t\t\treturn \"button\";\n\t\t}\n\n\t\treturn this.effectiveAccessibleName ? \"img\" : PRESENTATION_ROLE;\n\t}\n\n\tasync onBeforeRendering() {\n\t\tconst name = this.name;\n\t\tif (!name) {\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(\"Icon name property is required\", this);\n\t\t}\n\n\t\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\t\tif (!iconData) {\n\t\t\ticonData = await getIconData(name);\n\t\t}\n\n\t\tif (!iconData) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. Invalid icon name: ${this.name}`);\n\t\t}\n\n\t\tif (iconData === ICON_NOT_FOUND) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. You can either import the icon as a module in order to use it e.g. \"@ui5/webcomponents-icons/dist/${name.replace(\"sap-icon://\", \"\")}.js\", or setup a JSON build step and import \"@ui5/webcomponents-icons/dist/AllIcons.js\".`);\n\t\t}\n\n\t\tthis.viewBox = iconData.viewBox || \"0 0 512 512\";\n\n\t\tif (iconData.customTemplate) {\n\t\t\ticonData.pathData = [];\n\t\t\tthis.customSvg = executeTemplate(iconData.customTemplate, this);\n\t\t}\n\n\t\t// in case a new valid name is set, show the icon\n\t\tthis.invalid = false;\n\t\tthis.pathData = Array.isArray(iconData.pathData) ? iconData.pathData : [iconData.pathData];\n\t\tthis.accData = iconData.accData;\n\t\tthis.ltr = iconData.ltr;\n\t\tthis.packageName = iconData.packageName;\n\n\t\tthis._onfocusout = this.interactive ? this._onFocusOutHandler.bind(this) : undefined;\n\t\tthis._onfocusin = this.interactive ? this._onFocusInHandler.bind(this) : undefined;\n\n\t\tif (this.accessibleName) {\n\t\t\tthis.effectiveAccessibleName = this.accessibleName;\n\t\t} else if (this.accData) {\n\t\t\tconst i18nBundle = await getI18nBundle(this.packageName);\n\t\t\tthis.effectiveAccessibleName = i18nBundle.getText(this.accData) || undefined;\n\t\t} else {\n\t\t\tthis.effectiveAccessibleName = undefined;\n\t\t}\n\t}\n\n\tget hasIconTooltip() {\n\t\treturn this.showTooltip && this.effectiveAccessibleName;\n\t}\n}\n\nIcon.define();\n\nexport default Icon;\n"]}
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAY,MAAM,wDAAwD,CAAC;AAChH,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,eAAe,MAAM,0DAA0D,CAAC;AACvF,OAAO,YAAY,MAAM,2CAA2C,CAAC;AACrE,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,SAAS;AACT,OAAO,OAAO,MAAM,gCAAgC,CAAC;AAErD,MAAM,cAAc,GAAG,gBAAgB,CAAC;AACxC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AAiBH,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,UAAU;IAmK5B,iBAAiB;QAChB,IAAI,IAAI,CAAC,WAAW,EAAE;YACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACpB;IACF,CAAC;IAED,kBAAkB;QACjB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,UAAU,CAAC,CAAg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,EAAE;wCACS;AAMpB;IADC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACJ;AAMzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;qCACpD;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACV;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACV;AAMlB;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;qDACxB;AAzJ5B,IAAI;IAhBT,aAAa,CAAC;QACd,GAAG,EAAE,UAAU;QACf,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,OAAO;KACf,CAAC;IACF;;;;;;OAMG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,IAAI,CA8RT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { getIconData, getIconDataSync, IconData } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { isSpace, isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport executeTemplate from \"@ui5/webcomponents-base/dist/renderer/executeTemplate.js\";\nimport IconTemplate from \"./generated/templates/IconTemplate.lit.js\";\nimport IconDesign from \"./types/IconDesign.js\";\n\n// Styles\nimport iconCss from \"./generated/themes/Icon.css.js\";\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\nconst PRESENTATION_ROLE = \"presentation\";\n\n/**\n * @class\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * The <code>ui5-icon</code> component represents an SVG icon.\n * There are two main scenarios how the <code>ui5-icon</code> component is used:\n * as a purely decorative element, <br>\n * or as an interactive element that can be focused and clicked.\n *\n * <h3>Usage</h3>\n *\n * 1. <b>Get familiar with the icons collections.</b>\n * <br>\n * Before displaying an icon, you need to explore the icons collections to find and import the desired icon.\n * <br>\n * Currently there are 3 icons collection, available as 3 npm packages:\n * <br>\n *\n * <ul>\n * <li>\n * <ui5-link target=\"_blank\" href=\"https://www.npmjs.com/package/@ui5/webcomponents-icons\">@ui5/webcomponents-icons</ui5-link> represents the \"SAP-icons\" collection and includes the following\n * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons\">icons</ui5-link>.\n * </li>\n * <li>\n * <ui5-link target=\"_blank\" href=\"https://www.npmjs.com/package/@ui5/webcomponents-icons-tnt\">@ui5/webcomponents-icons-tnt</ui5-link> represents the \"tnt\" collection and includes the following\n * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT\">icons</ui5-link>.\n * </li>\n * <li>\n * <ui5-link target=\"_blank\" href=\"https://www.npmjs.com/package/@ui5/webcomponents-icons-business-suite\">@ui5/webcomponents-icons-icons-business-suite</ui5-link> represents the \"business-suite\" collection and includes the following\n * <ui5-link target=\"_blank\" href=\"https://ui5.sap.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/BusinessSuiteInAppSymbols\">icons</ui5-link>.\n * </li>\n * </ul>\n *\n * 2. <b>After exploring the icons collections, add one or more of the packages as dependencies to your project.</b>\n * <br>\n * <code>npm i @ui5/webcomponents-icons</code><br>\n * <code>npm i @ui5/webcomponents-icons-tnt</code><br>\n * <code>npm i @ui5/webcomponents-icons-business-suite</code>\n * <br><br>\n *\n * 3. <b>Then, import the desired icon</b>.\n * <br>\n * <code>import \"@ui5/{package_name}/dist/{icon_name}.js\";</code>\n * <br><br>\n *\n * <b>For Example</b>:\n * <br>\n *\n * For the standard \"SAP-icons\" icon collection, import an icon from the <code>@ui5/webcomponents-icons</code> package:\n * <br>\n * <code>import \"@ui5/webcomponents-icons/dist/employee.js\";</code>\n * <br><br>\n *\n * For the \"tnt\" (SAP Fiori Tools) icon collection, import an icon from the <code>@ui5/webcomponents-icons-tnt</code> package:\n * <br>\n * <code>import \"@ui5/webcomponents-icons-tnt/dist/antenna.js\";</code>\n * <br><br>\n *\n * For the \"business-suite\" (SAP Business Suite) icon collection, import an icon from the <code>@ui5/webcomponents-icons-business-suite</code> package:\n * <br>\n * <code>import \"@ui5/webcomponents-icons-business-suite/dist/ab-testing.js\";</code>\n * <br><br>\n *\n * 4. <b>Display the icon using the <code>ui5-icon</code> web component.</b><br>\n * Set the icon collection (\"SAP-icons\", \"tnt\" or \"business-suite\" - \"SAP-icons\" is the default icon collection and can be skipped)<br>\n * and the icon name to the <code>name</code> property.\n * <br><br>\n *\n * <code><ui5-icon name=\"employee\"></ui5-icon></code><br>\n * <code><ui5-icon name=\"tnt/antenna\"></ui5-icon></code><br>\n * <code><ui5-icon name=\"business-suite/ab-testing\"></ui5-icon></code>\n *\n * <br><br>\n * <h3>CSS Shadow Parts</h3>\n *\n * <ui5-link target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/::part\">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.\n * <br>\n * The <code>ui5-icon</code> exposes the following CSS Shadow Parts:\n * <ul>\n * <li>root - Used to style the outermost wrapper of the <code>ui5-icon</code></li>\n * </ul>\n *\n * <br><br>\n * <h3>Keyboard Handling</h3>\n *\n * <ul>\n * <li>[SPACE, ENTER, RETURN] - Fires the <code>click</code> event if the <code>interactive</code> property is set to true.</li>\n * <li>[SHIFT] - If [SPACE] or [ENTER],[RETURN] is pressed, pressing [SHIFT] releases the ui5-icon without triggering the click event.</li>\n * </ul>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Icon.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Icon\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-icon\n * @implements sap.ui.webc.main.IIcon\n * @public\n */\n@customElement({\n\ttag: \"ui5-icon\",\n\tlanguageAware: true,\n\tthemeAware: true,\n\trenderer: litRender,\n\ttemplate: IconTemplate,\n\tstyles: iconCss,\n})\n/**\n * Fired on mouseup, <code>SPACE</code> and <code>ENTER</code>.\n * - on mouse click, the icon fires native <code>click</code> event\n * - on <code>SPACE</code> and <code>ENTER</code>, the icon fires custom <code>click</code> event\n * @private\n * @since 1.0.0-rc.8\n */\n@event(\"click\")\nclass Icon extends UI5Element {\n\t/**\n\t * Defines the component semantic design.\n\t *\n\t * <br><br>\n\t * <b>The available values are:</b>\n\t *\n\t * <ul>\n\t * <li><code>Contrast</code></li>\n\t * <li><code>Critical</code></li>\n\t * <li><code>Default</code></li>\n\t * <li><code>Information</code></li>\n\t * <li><code>Negative</code></li>\n\t * <li><code>Neutral</code></li>\n\t * <li><code>NonInteractive</code></li>\n\t * <li><code>Positive</code></li>\n\t * </ul>\n\t *\n\t * @type {sap.ui.webc.main.types.IconDesign}\n\t * @name sap.ui.webc.main.Icon.prototype.design\n\t * @defaultvalue \"Default\"\n\t * @public\n\t * @since 1.9.2\n\t */\n\t@property({ type: IconDesign, defaultValue: IconDesign.Default })\n\tdesign!: IconDesign;\n\n\t/**\n\t * Defines if the icon is interactive (focusable and pressable)\n\t * @name sap.ui.webc.main.Icon.prototype.interactive\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.0.0-rc.8\n\t */\n\t@property({ type: Boolean })\n\tinteractive!: boolean;\n\n\t/**\n\t * Defines the unique identifier (icon name) of the component.\n\t * <br>\n\t *\n\t * To browse all available icons, see the\n\t * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">SAP Icons</ui5-link>,\n\t * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT\">SAP Fiori Tools</ui5-link> and\n\t * <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">SAP Business Suite</ui5-link> collections.\n\t * <br>\n\t *\n\t * Example:\n\t * <br>\n\t * <code>name='add'</code>, <code>name='delete'</code>, <code>name='employee'</code>.\n\t * <br><br>\n\t *\n\t * <b>Note:</b> To use the SAP Fiori Tools icons,\n\t * you need to set the <code>tnt</code> prefix in front of the icon's name.\n\t * <br>\n\t *\n\t * Example:\n\t * <br>\n\t * <code>name='tnt/antenna'</code>, <code>name='tnt/actor'</code>, <code>name='tnt/api'</code>.\n\t * <br><br>\n\t *\n\t * <b>Note:</b> To use the SAP Business Suite icons,\n\t * you need to set the <code>business-suite</code> prefix in front of the icon's name.\n\t * <br>\n\t *\n\t * Example:\n\t * <br>\n\t * <code>name='business-suite/3d'</code>, <code>name='business-suite/1x2-grid-layout'</code>, <code>name='business-suite/4x4-grid-layout'</code>.\n\t * @name sap.ui.webc.main.Icon.prototype.name\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\tname!: string;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t * <br><br>\n\t * <b>Note:</b> Every icon should have a text alternative in order to\n\t * calculate its accessible name.\n\t *\n\t * @name sap.ui.webc.main.Icon.prototype.accessibleName\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\taccessibleName!: string;\n\n\t/**\n\t * Defines whether the component should have a tooltip.\n\t * <br><br>\n\t * <b>Note:</b> The tooltip text should be provided via the <code>accessible-name</code> property.\n\t *\n\t * @name sap.ui.webc.main.Icon.prototype.showTooltip\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowTooltip!: boolean;\n\n\t/**\n\t * Defines the accessibility role of the component.\n\t * @name sap.ui.webc.main.Icon.prototype.accessibleRole\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleRole!: string;\n\n\t/**\n\t * Defines the ARIA hidden state of the component.\n\t * Note: If the role is presentation the default value of aria-hidden will be true.\n\t * @private\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tariaHidden!: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ multiple: true })\n\tpathData!: Array<string>;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Object, defaultValue: undefined, noAttribute: true })\n\taccData?: I18nText;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused!: boolean;\n\n\t/**\n\t* @private\n\t*/\n\t@property({ type: Boolean })\n\tinvalid!: boolean;\n\n\t/**\n\t * @private\n\t */\n\t@property({ noAttribute: true, defaultValue: undefined })\n\teffectiveAccessibleName?: string;\n\n\tltr?: boolean;\n\tpackageName?: string;\n\tviewBox?: string;\n\tcustomSvg?: object;\n\n\t_onfocusout?: ((event: FocusEvent) => void);\n\t_onfocusin?: ((event: FocusEvent) => void);\n\n\t_onFocusInHandler() {\n\t\tif (this.interactive) {\n\t\t\tthis.focused = true;\n\t\t}\n\t}\n\n\t_onFocusOutHandler() {\n\t\tthis.focused = false;\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this.interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this.interactive && isSpace(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\t}\n\n\t/**\n\t* Enforce \"ltr\" direction, based on the icons collection metadata.\n\t*/\n\tget _dir() {\n\t\treturn this.ltr ? \"ltr\" : undefined;\n\t}\n\n\tget effectiveAriaHidden() {\n\t\tif (this.ariaHidden === \"\") {\n\t\t\tif (this.isDecorative) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.ariaHidden;\n\t}\n\n\tget _tabIndex() {\n\t\treturn this.interactive ? \"0\" : undefined;\n\t}\n\n\tget isDecorative() {\n\t\treturn this.effectiveAccessibleRole === PRESENTATION_ROLE;\n\t}\n\n\tget effectiveAccessibleRole() {\n\t\tif (this.accessibleRole) {\n\t\t\treturn this.accessibleRole;\n\t\t}\n\n\t\tif (this.interactive) {\n\t\t\treturn \"button\";\n\t\t}\n\n\t\treturn this.effectiveAccessibleName ? \"img\" : PRESENTATION_ROLE;\n\t}\n\n\tasync onBeforeRendering() {\n\t\tconst name = this.name;\n\t\tif (!name) {\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(\"Icon name property is required\", this);\n\t\t}\n\n\t\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\t\tif (!iconData) {\n\t\t\ticonData = await getIconData(name);\n\t\t}\n\n\t\tif (!iconData) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. Invalid icon name: ${this.name}`);\n\t\t}\n\n\t\tif (iconData === ICON_NOT_FOUND) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. You can either import the icon as a module in order to use it e.g. \"@ui5/webcomponents-icons/dist/${name.replace(\"sap-icon://\", \"\")}.js\", or setup a JSON build step and import \"@ui5/webcomponents-icons/dist/AllIcons.js\".`);\n\t\t}\n\n\t\tthis.viewBox = iconData.viewBox || \"0 0 512 512\";\n\n\t\tif (iconData.customTemplate) {\n\t\t\ticonData.pathData = [];\n\t\t\tthis.customSvg = executeTemplate(iconData.customTemplate, this);\n\t\t}\n\n\t\t// in case a new valid name is set, show the icon\n\t\tthis.invalid = false;\n\t\tthis.pathData = Array.isArray(iconData.pathData) ? iconData.pathData : [iconData.pathData];\n\t\tthis.accData = iconData.accData;\n\t\tthis.ltr = iconData.ltr;\n\t\tthis.packageName = iconData.packageName;\n\n\t\tthis._onfocusout = this.interactive ? this._onFocusOutHandler.bind(this) : undefined;\n\t\tthis._onfocusin = this.interactive ? this._onFocusInHandler.bind(this) : undefined;\n\n\t\tif (this.accessibleName) {\n\t\t\tthis.effectiveAccessibleName = this.accessibleName;\n\t\t} else if (this.accData) {\n\t\t\tconst i18nBundle = await getI18nBundle(this.packageName);\n\t\t\tthis.effectiveAccessibleName = i18nBundle.getText(this.accData) || undefined;\n\t\t} else {\n\t\t\tthis.effectiveAccessibleName = undefined;\n\t\t}\n\t}\n\n\tget hasIconTooltip() {\n\t\treturn this.showTooltip && this.effectiveAccessibleName;\n\t}\n}\n\nIcon.define();\n\nexport default Icon;\n"]}
|
package/dist/Menu.d.ts
CHANGED
|
@@ -68,6 +68,26 @@ declare class Menu extends UI5Element {
|
|
|
68
68
|
* @since 1.10.0
|
|
69
69
|
*/
|
|
70
70
|
open: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.
|
|
73
|
+
*
|
|
74
|
+
* @name sap.ui.webc.main.Menu.prototype.busy
|
|
75
|
+
* @type {boolean}
|
|
76
|
+
* @defaultvalue false
|
|
77
|
+
* @public
|
|
78
|
+
* @since 1.13.0
|
|
79
|
+
*/
|
|
80
|
+
busy: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover..
|
|
83
|
+
*
|
|
84
|
+
* @name sap.ui.webc.main.Menu.prototype.busyDelay
|
|
85
|
+
* @type {sap.ui.webc.base.types.Integer}
|
|
86
|
+
* @defaultValue 1000
|
|
87
|
+
* @public
|
|
88
|
+
* @since 1.13.0
|
|
89
|
+
*/
|
|
90
|
+
busyDelay: number;
|
|
71
91
|
/**
|
|
72
92
|
* Defines the ID or DOM Reference of the element that the menu is shown at
|
|
73
93
|
*
|
|
@@ -168,6 +188,7 @@ declare class Menu extends UI5Element {
|
|
|
168
188
|
_prepareSubMenuDesktopTablet(item: MenuItem, opener: HTMLElement, actionId: string): void;
|
|
169
189
|
_prepareSubMenuPhone(item: MenuItem): void;
|
|
170
190
|
_itemMouseOver(e: MouseEvent): void;
|
|
191
|
+
_busyMouseOver(): void;
|
|
171
192
|
_itemMouseOut(e: MouseEvent): void;
|
|
172
193
|
_itemKeyDown(e: KeyboardEvent): void;
|
|
173
194
|
_itemClick(e: CustomEvent<ClickEventDetail>): void;
|
package/dist/Menu.js
CHANGED
|
@@ -16,11 +16,13 @@ import { isPhone, isTablet, isDesktop, } from "@ui5/webcomponents-base/dist/Devi
|
|
|
16
16
|
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
17
17
|
import "@ui5/webcomponents-icons/dist/slim-arrow-right.js";
|
|
18
18
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
19
|
+
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
19
20
|
import ResponsivePopover from "./ResponsivePopover.js";
|
|
20
21
|
import Button from "./Button.js";
|
|
21
22
|
import List from "./List.js";
|
|
22
23
|
import StandardListItem from "./StandardListItem.js";
|
|
23
24
|
import Icon from "./Icon.js";
|
|
25
|
+
import BusyIndicator from "./BusyIndicator.js";
|
|
24
26
|
import staticAreaMenuTemplate from "./generated/templates/MenuTemplate.lit.js";
|
|
25
27
|
import { MENU_BACK_BUTTON_ARIA_LABEL, MENU_CLOSE_BUTTON_ARIA_LABEL, } from "./generated/i18n/i18n-defaults.js";
|
|
26
28
|
// Styles
|
|
@@ -105,6 +107,10 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
105
107
|
this._currentItems.forEach(item => {
|
|
106
108
|
item.item._siblingsWithChildren = itemsWithChildren;
|
|
107
109
|
item.item._siblingsWithIcon = itemsWithIcon;
|
|
110
|
+
if (item.item._subMenu) {
|
|
111
|
+
item.item._subMenu.busy = item.item.busy;
|
|
112
|
+
item.item._subMenu.busyDelay = item.item.busyDelay;
|
|
113
|
+
}
|
|
108
114
|
});
|
|
109
115
|
}
|
|
110
116
|
onAfterRendering() {
|
|
@@ -181,7 +187,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
181
187
|
return {
|
|
182
188
|
item,
|
|
183
189
|
position: index + 1,
|
|
184
|
-
ariaHasPopup: item.
|
|
190
|
+
ariaHasPopup: item.hasSubmenu ? "menu" : undefined,
|
|
185
191
|
};
|
|
186
192
|
});
|
|
187
193
|
}
|
|
@@ -192,6 +198,8 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
192
198
|
subMenu._isSubMenu = true;
|
|
193
199
|
subMenu.setAttribute("id", `submenu-${openerId}`);
|
|
194
200
|
subMenu._parentMenuItem = item;
|
|
201
|
+
subMenu.busy = item.busy;
|
|
202
|
+
subMenu.busyDelay = item.busyDelay;
|
|
195
203
|
const subItems = item.children;
|
|
196
204
|
let clonedItem, idx;
|
|
197
205
|
for (idx = 0; idx < subItems.length; idx++) {
|
|
@@ -232,11 +240,11 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
232
240
|
}
|
|
233
241
|
}
|
|
234
242
|
_prepareSubMenuDesktopTablet(item, opener, actionId) {
|
|
235
|
-
if (actionId !== this._subMenuOpenerId || (item && item.
|
|
243
|
+
if (actionId !== this._subMenuOpenerId || (item && item.hasSubmenu)) {
|
|
236
244
|
// close opened sub-menu if there is any opened
|
|
237
245
|
this._closeItemSubMenu(this._openedSubMenuItem, true);
|
|
238
246
|
}
|
|
239
|
-
if (item && item.
|
|
247
|
+
if (item && item.hasSubmenu) {
|
|
240
248
|
// create new sub-menu
|
|
241
249
|
this._createSubMenu(item, actionId);
|
|
242
250
|
this._openItemSubMenu(item, opener, actionId);
|
|
@@ -260,12 +268,17 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
260
268
|
this._prepareSubMenuDesktopTablet(item, opener, hoverId);
|
|
261
269
|
}
|
|
262
270
|
}
|
|
271
|
+
_busyMouseOver() {
|
|
272
|
+
if (this._parentMenuItem) {
|
|
273
|
+
this._parentMenuItem._preventSubMenuClose = true;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
263
276
|
_itemMouseOut(e) {
|
|
264
277
|
if (isDesktop()) {
|
|
265
278
|
// respect mouseover only on desktop
|
|
266
279
|
const opener = e.target;
|
|
267
280
|
const item = opener.associatedItem;
|
|
268
|
-
if (item && item.
|
|
281
|
+
if (item && item.hasSubmenu && item._subMenu) {
|
|
269
282
|
// try to close the sub-menu
|
|
270
283
|
item._preventSubMenuClose = false;
|
|
271
284
|
this._closeItemSubMenu(item);
|
|
@@ -282,7 +295,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
282
295
|
const opener = e.target;
|
|
283
296
|
const item = opener.associatedItem;
|
|
284
297
|
const hoverId = opener.getAttribute("id");
|
|
285
|
-
item.
|
|
298
|
+
item.hasSubmenu && this._prepareSubMenuDesktopTablet(item, opener, hoverId);
|
|
286
299
|
}
|
|
287
300
|
else if (isMenuClose && this._isSubMenu && this._parentMenuItem) {
|
|
288
301
|
const parentMenuItemParent = this._parentMenuItem.parentElement;
|
|
@@ -293,7 +306,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
293
306
|
const opener = e.detail.item;
|
|
294
307
|
const item = opener.associatedItem;
|
|
295
308
|
const actionId = opener.getAttribute("id");
|
|
296
|
-
if (!item.
|
|
309
|
+
if (!item.hasSubmenu) {
|
|
297
310
|
// click on an item that doesn't have sub-items fires an "item-click" event
|
|
298
311
|
if (!this._isSubMenu) {
|
|
299
312
|
if (isPhone()) {
|
|
@@ -360,6 +373,12 @@ __decorate([
|
|
|
360
373
|
__decorate([
|
|
361
374
|
property({ type: Boolean })
|
|
362
375
|
], Menu.prototype, "open", void 0);
|
|
376
|
+
__decorate([
|
|
377
|
+
property({ type: Boolean })
|
|
378
|
+
], Menu.prototype, "busy", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
property({ validator: Integer, defaultValue: 1000 })
|
|
381
|
+
], Menu.prototype, "busyDelay", void 0);
|
|
363
382
|
__decorate([
|
|
364
383
|
property({ validator: DOMReference, defaultValue: "" })
|
|
365
384
|
], Menu.prototype, "opener", void 0);
|
|
@@ -399,6 +418,7 @@ Menu = Menu_1 = __decorate([
|
|
|
399
418
|
List,
|
|
400
419
|
StandardListItem,
|
|
401
420
|
Icon,
|
|
421
|
+
BusyIndicator,
|
|
402
422
|
],
|
|
403
423
|
})
|
|
404
424
|
/**
|
package/dist/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EACN,MAAM,EACN,OAAO,EACP,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACT,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,M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,EAAE,SAAS;QACnB,gBAAgB,EAAE,iBAAiB;QACnC,kBAAkB,EAAE,sBAAsB;QAC1C,YAAY,EAAE;YACb,iBAAiB;YACjB,MAAM;YACN,IAAI;YACJ,gBAAgB;YAChB,IAAI;SACJ;KACD,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,YAAY,EAAE;QACpB,MAAM,EAAE;YACP,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;YACD,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;SACD;KACD,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,aAAa,CAAC;IAErB;;;;;;OAMG;;IACF,KAAK,CAAC,YAAY,CAAC;IAEpB;;;;;;;;OAQG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,MAAM,EAAE;YACP,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC7B;KACD,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,aAAa,CAAC;GACf,IAAI,CAkbT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport DOMReference from \"@ui5/webcomponents-base/dist/types/DOMReference.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport Button from \"./Button.js\";\nimport List from \"./List.js\";\nimport StandardListItem from \"./StandardListItem.js\";\nimport Icon from \"./Icon.js\";\nimport type MenuItem from \"./MenuItem.js\";\nimport type { ClickEventDetail } from \"./List.js\";\nimport staticAreaMenuTemplate from \"./generated/templates/MenuTemplate.lit.js\";\nimport {\n\tMENU_BACK_BUTTON_ARIA_LABEL,\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport staticAreaMenuCss from \"./generated/themes/Menu.css.js\";\n\ntype CurrentItem = {\n\titem: MenuItem,\n\tposition: number,\n\tariaHasPopup: string | undefined,\n}\n\ntype OpenerStandardListItem = StandardListItem & { associatedItem: MenuItem };\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <code>ui5-menu</code> component represents a hierarchical menu structure.\n *\n * <h3>Usage</h3>\n *\n * <code>ui5-menu</code> contains <code>ui5-menu-item</code> components.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * <h3>Keyboard Handling</h3>\n *\n * The <code>ui5-menu</code> provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n * <ul>\n * <li><code>Arrow Up</code> / <code>Arrow Down</code> - Navigates up and down the menu items that are currently visible.</li>\n * <li><code>Arrow Right</code>, <code>Space</code> or <code>Enter</code> - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.</li>\n * <li><code>Arrow Left</code> or <code>Escape</code> - Closes the currently opened sub-menu.</li>\n * </ul>\n * Note: if the text ditrection is set to Right-to-left (RTL), <code>Arrow Right</code> and <code>Arrow Left</code> functionality is swapped.\n * <br>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Menu.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Menu\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-menu\n * @appenddocs sap.ui.webc.main.MenuItem\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: litRender,\n\tstaticAreaStyles: staticAreaMenuCss,\n\tstaticAreaTemplate: staticAreaMenuTemplate,\n\tdependencies: [\n\t\tResponsivePopover,\n\t\tButton,\n\t\tList,\n\t\tStandardListItem,\n\t\tIcon,\n\t],\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * @event sap.ui.webc.main.Menu#item-click\n * @param {object} item The currently clicked menu item.\n * @param {string} text The text of the currently clicked menu item.\n * @public\n */\n@event(\"item-click\", {\n\tdetail: {\n\t\titem: {\n\t\t\ttype: Object,\n\t\t},\n\t\ttext: {\n\t\t\ttype: String,\n\t\t},\n\t},\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-open\n * @allowPreventDefault\n * @since 1.10.0\n */\n@event(\"before-open\")\n\n/**\n * Fired after the menu is opened. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-open\n * @since 1.10.0\n */\n@event(\"after-open\")\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-close\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that <code>ESC</code> key has triggered the event.\n * @since 1.10.0\n */\n@event(\"before-close\", {\n\tdetail: {\n\t\tescPressed: { type: Boolean },\n\t},\n})\n\n/**\n * Fired after the menu is closed. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-close\n * @since 1.10.0\n */\n@event(\"after-close\")\nclass Menu extends UI5Element {\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.headerText\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\theaderText!: string;\n\n\t/**\n\t * Indicates if the menu is open\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.open\n\t * @public\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen!:boolean;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element that the menu is shown at\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.opener\n\t * @public\n\t * @type {sap.ui.webc.base.types.DOMReference}\n\t * @defaultvalue \"\"\n\t * @since 1.10.0\n\t */\n\t@property({ validator: DOMReference, defaultValue: \"\" })\n\topener!: HTMLElement | string;\n\n\t/**\n\t * Defines if the menu is sub-menu (not first-level).\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_isSubMenu!: boolean;\n\n\t/**\n\t * Stores id of a list item that opened sub-menu.\n\t * @type {string}\n\t * @private\n\t */\n\t@property()\n\t_subMenuOpenerId!: string;\n\n\t/**\n\t * Defines the currently available menu items.\n\t * (in case of non-phone devices these are the items of the menu,\n\t * but for phone devices the items of the currently opened sub-menu\n\t * will be populated here)\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_currentItems!: Array<CurrentItem>;\n\n\t/**\n\t * Stores a list of parent menu items for each sub-menu (on phone).\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_parentItemsStack!: Array<MenuItem>;\n\n\t/**\n\t * Stores the ResponsivePopover instance\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_popover?: ResponsivePopover;\n\n\t/**\n\t * Stores parent menu item (if there is such).\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_parentMenuItem?: MenuItem;\n\n\t/**\n\t * Stores menu item that have sub-menu opened.\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_openedSubMenuItem?: MenuItem;\n\n\t/**\n\t * Defines the items of this component.\n\t * <br><br>\n\t * <b>Note:</b> Use <code>ui5-menu-item</code> for the intended design.\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.default\n\t * @type {sap.ui.webc.main.IMenuItem[]}\n\t * @slot items\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<MenuItem>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tMenu.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget itemsWithChildren() {\n\t\treturn !!this._currentItems.filter(item => item.item.items.length).length;\n\t}\n\n\tget itemsWithIcon() {\n\t\treturn !!this._currentItems.filter(item => item.item.icon !== \"\").length;\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget placementType() {\n\t\tconst placement = this.isRtl ? \"Left\" : \"Right\";\n\t\treturn this._isSubMenu ? placement : \"Bottom\";\n\t}\n\n\tget verticalAlign() {\n\t\treturn this._isSubMenu ? \"Top\" : \"Bottom\";\n\t}\n\n\tget labelBack() {\n\t\treturn Menu.i18nBundle.getText(MENU_BACK_BUTTON_ARIA_LABEL);\n\t}\n\n\tget labelClose() {\n\t\treturn Menu.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget isSubMenuOpened() {\n\t\treturn !!this._parentMenuItem;\n\t}\n\n\tget menuHeaderTextPhone() {\n\t\treturn this._parentMenuItem ? this._parentMenuItem.text : this.headerText;\n\t}\n\n\tonBeforeRendering() {\n\t\t!isPhone() && this._prepareCurrentItems(this.items);\n\n\t\tconst itemsWithChildren = this.itemsWithChildren;\n\t\tconst itemsWithIcon = this.itemsWithIcon;\n\n\t\tthis._currentItems.forEach(item => {\n\t\t\titem.item._siblingsWithChildren = itemsWithChildren;\n\t\t\titem.item._siblingsWithIcon = itemsWithIcon;\n\t\t});\n\t}\n\n\tonAfterRendering() {\n\t\tif (!this.opener) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.open) {\n\t\t\tconst rootNode = this.getRootNode() as Document;\n\t\t\tconst opener = this.opener instanceof HTMLElement ? this.opener : rootNode && rootNode.getElementById(this.opener);\n\n\t\t\tif (opener) {\n\t\t\t\tthis.showAt(opener);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/**\n\t * Shows the Menu near the opener element.\n\t * @param {HTMLElement} opener the element that the popover is shown at\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#showAt\n\t */\n\tasync showAt(opener: HTMLElement) {\n\t\tif (isPhone()) {\n\t\t\tthis._prepareCurrentItems(this.items);\n\t\t\tthis._parentItemsStack = [];\n\t\t}\n\t\tif (!this._isSubMenu) {\n\t\t\tthis._parentMenuItem = undefined;\n\t\t}\n\t\tconst popover = await this._createPopover();\n\t\tpopover.initialFocus = \"\";\n\t\tfor (let index = 0; index < this._currentItems.length; index++) {\n\t\t\tif (!this._currentItems[index].item.disabled) {\n\t\t\t\tpopover.initialFocus = `${this._id}-menu-item-${index}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpopover.showAt(opener);\n\t}\n\n\t/**\n\t * Closes the Menu.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#close\n\t */\n\tclose() {\n\t\tif (this._popover) {\n\t\t\tif (isPhone()) {\n\t\t\t\tthis._parentItemsStack = [];\n\t\t\t}\n\t\t\tthis._popover.close();\n\t\t\tthis._popover.resetFocus();\n\t\t}\n\t}\n\n\tasync _createPopover() {\n\t\tconst staticAreaItemDomRef = await this.getStaticAreaItemDomRef();\n\t\tthis._popover = staticAreaItemDomRef!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t\treturn this._popover;\n\t}\n\n\t_navigateBack() {\n\t\tconst parentMenuItem = this._parentItemsStack.pop();\n\n\t\tthis.focus();\n\t\tif (parentMenuItem) {\n\t\t\tconst parentMenuItemParent = parentMenuItem.parentElement as MenuItem;\n\t\t\tthis._prepareCurrentItems(parentMenuItemParent.items);\n\t\t\tthis._parentMenuItem = this._parentItemsStack.length ? this._parentItemsStack[this._parentItemsStack.length - 1] : undefined;\n\t\t}\n\t}\n\n\t_prepareCurrentItems(items: Array<MenuItem>) {\n\t\tthis._currentItems = items.map((item, index) => {\n\t\t\treturn {\n\t\t\t\titem,\n\t\t\t\tposition: index + 1,\n\t\t\t\tariaHasPopup: item.hasChildren ? \"menu\" : undefined,\n\t\t\t};\n\t\t});\n\t}\n\n\t_createSubMenu(item: MenuItem, openerId: string) {\n\t\tconst ctor = this.constructor as typeof Menu;\n\t\tconst subMenu = document.createElement(ctor.getMetadata().getTag()) as Menu;\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tsubMenu._isSubMenu = true;\n\t\tsubMenu.setAttribute(\"id\", `submenu-${openerId}`);\n\t\tsubMenu._parentMenuItem = item;\n\t\tconst subItems = item.children;\n\t\tlet clonedItem,\n\t\t\tidx;\n\t\tfor (idx = 0; idx < subItems.length; idx++) {\n\t\t\tclonedItem = subItems[idx].cloneNode(true);\n\t\t\tfragment.appendChild(clonedItem);\n\t\t}\n\t\tsubMenu.appendChild(fragment);\n\t\tthis.staticAreaItem!.shadowRoot!.querySelector(\".ui5-menu-submenus\")!.appendChild(subMenu);\n\t\titem._subMenu = subMenu;\n\t}\n\n\t_openItemSubMenu(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\titem._subMenu!.showAt(opener);\n\t\titem._preventSubMenuClose = true;\n\t\tthis._openedSubMenuItem = item;\n\t\tthis._subMenuOpenerId = actionId;\n\t}\n\n\t_closeItemSubMenu(item: MenuItem, forceClose = false) {\n\t\tif (item) {\n\t\t\tif (forceClose) {\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeSubMenuPopover(item._subMenu!, true);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => this._closeSubMenuPopover(item._subMenu!), 0);\n\t\t\t}\n\t\t}\n\t}\n\n\t_closeSubMenuPopover(subMenu: Menu, forceClose = false) {\n\t\tif (subMenu) {\n\t\t\tconst parentItem = subMenu._parentMenuItem!;\n\n\t\t\tif (forceClose || !parentItem._preventSubMenuClose) {\n\t\t\t\tsubMenu.close();\n\t\t\t\tsubMenu.remove();\n\t\t\t\tparentItem._subMenu = undefined;\n\t\t\t\tthis._openedSubMenuItem = undefined;\n\t\t\t\tthis._subMenuOpenerId = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t_prepareSubMenuDesktopTablet(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\tif (actionId !== this._subMenuOpenerId || (item && item.hasChildren)) {\n\t\t\t// close opened sub-menu if there is any opened\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem!, true);\n\t\t}\n\t\tif (item && item.hasChildren) {\n\t\t\t// create new sub-menu\n\t\t\tthis._createSubMenu(item, actionId);\n\t\t\tthis._openItemSubMenu(item, opener, actionId);\n\t\t}\n\t\tif (this._parentMenuItem) {\n\t\t\tthis._parentMenuItem._preventSubMenuClose = true;\n\t\t}\n\t}\n\n\t_prepareSubMenuPhone(item: MenuItem) {\n\t\tthis._prepareCurrentItems(item.items);\n\t\tthis._parentMenuItem = item;\n\t\tthis._parentItemsStack.push(item);\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\topener.focus();\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t}\n\t}\n\n\t_itemMouseOut(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\n\t\t\tif (item && item.hasChildren && item._subMenu) {\n\t\t\t\t// try to close the sub-menu\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeItemSubMenu(item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tconst isMenuClose = this.isRtl ? isRight(e) : isLeft(e);\n\t\tconst isMenuOpen = this.isRtl ? isLeft(e) : isRight(e);\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tif (isMenuOpen) {\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\titem.hasChildren && this._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t} else if (isMenuClose && this._isSubMenu && this._parentMenuItem) {\n\t\t\tconst parentMenuItemParent = this._parentMenuItem.parentElement as Menu;\n\t\t\tparentMenuItemParent._closeItemSubMenu(this._parentMenuItem, true);\n\t\t}\n\t}\n\n\t_itemClick(e: CustomEvent<ClickEventDetail>) {\n\t\tconst opener = e.detail.item as OpenerStandardListItem;\n\t\tconst item = opener.associatedItem;\n\t\tconst actionId = opener.getAttribute(\"id\")!;\n\n\t\tif (!item.hasChildren) {\n\t\t\t// click on an item that doesn't have sub-items fires an \"item-click\" event\n\t\t\tif (!this._isSubMenu) {\n\t\t\t\tif (isPhone()) {\n\t\t\t\t\tthis._parentMenuItem = undefined;\n\t\t\t\t}\n\t\t\t\t// fire event if the click is on top-level menu item\n\t\t\t\tthis.fireEvent(\"item-click\", {\n\t\t\t\t\t\"item\": item,\n\t\t\t\t\t\"text\": item.text,\n\t\t\t\t});\n\t\t\t\tthis._popover!.close();\n\t\t\t} else {\n\t\t\t\t// find top-level menu and redirect event to it\n\t\t\t\tlet parentMenu = item.parentElement as Menu;\n\t\t\t\twhile (parentMenu._parentMenuItem) {\n\t\t\t\t\tparentMenu._parentMenuItem._preventSubMenuClose = false;\n\t\t\t\t\tthis._closeItemSubMenu(parentMenu._parentMenuItem);\n\t\t\t\t\tparentMenu = parentMenu._parentMenuItem.parentElement as Menu;\n\t\t\t\t}\n\t\t\t\tparentMenu._itemClick(e);\n\t\t\t}\n\t\t} else if (isPhone()) {\n\t\t\t// prepares and opens sub-menu on phone\n\t\t\tthis._prepareSubMenuPhone(item);\n\t\t} else if (isTablet()) {\n\t\t\t// prepares and opens sub-menu on tablet\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, actionId);\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = false;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.open = true;\n\t\tthis.fireEvent(\"after-open\");\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent(\"before-close\", { escPressed: e.detail.escPressed }, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._openedSubMenuItem) {\n\t\t\tthis._openedSubMenuItem._preventSubMenuClose = false;\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem);\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireEvent(\"after-close\");\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\n"]}
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,O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AAE;YACP,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;YACD,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;SACD;KACD,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,aAAa,CAAC;IAErB;;;;;;OAMG;;IACF,KAAK,CAAC,YAAY,CAAC;IAEpB;;;;;;;;OAQG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,MAAM,EAAE;YACP,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC7B;KACD,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,aAAa,CAAC;GACf,IAAI,CAsdT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport DOMReference from \"@ui5/webcomponents-base/dist/types/DOMReference.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport Button from \"./Button.js\";\nimport List from \"./List.js\";\nimport StandardListItem from \"./StandardListItem.js\";\nimport Icon from \"./Icon.js\";\nimport BusyIndicator from \"./BusyIndicator.js\";\nimport type MenuItem from \"./MenuItem.js\";\nimport type { ClickEventDetail } from \"./List.js\";\nimport staticAreaMenuTemplate from \"./generated/templates/MenuTemplate.lit.js\";\nimport {\n\tMENU_BACK_BUTTON_ARIA_LABEL,\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport staticAreaMenuCss from \"./generated/themes/Menu.css.js\";\n\ntype CurrentItem = {\n\titem: MenuItem,\n\tposition: number,\n\tariaHasPopup: string | undefined,\n}\n\ntype OpenerStandardListItem = StandardListItem & { associatedItem: MenuItem };\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <code>ui5-menu</code> component represents a hierarchical menu structure.\n *\n * <h3>Usage</h3>\n *\n * <code>ui5-menu</code> contains <code>ui5-menu-item</code> components.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * <h3>Keyboard Handling</h3>\n *\n * The <code>ui5-menu</code> provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n * <ul>\n * <li><code>Arrow Up</code> / <code>Arrow Down</code> - Navigates up and down the menu items that are currently visible.</li>\n * <li><code>Arrow Right</code>, <code>Space</code> or <code>Enter</code> - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.</li>\n * <li><code>Arrow Left</code> or <code>Escape</code> - Closes the currently opened sub-menu.</li>\n * </ul>\n * Note: if the text ditrection is set to Right-to-left (RTL), <code>Arrow Right</code> and <code>Arrow Left</code> functionality is swapped.\n * <br>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Menu.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Menu\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-menu\n * @appenddocs sap.ui.webc.main.MenuItem\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: litRender,\n\tstaticAreaStyles: staticAreaMenuCss,\n\tstaticAreaTemplate: staticAreaMenuTemplate,\n\tdependencies: [\n\t\tResponsivePopover,\n\t\tButton,\n\t\tList,\n\t\tStandardListItem,\n\t\tIcon,\n\t\tBusyIndicator,\n\t],\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * @event sap.ui.webc.main.Menu#item-click\n * @param {object} item The currently clicked menu item.\n * @param {string} text The text of the currently clicked menu item.\n * @public\n */\n@event(\"item-click\", {\n\tdetail: {\n\t\titem: {\n\t\t\ttype: Object,\n\t\t},\n\t\ttext: {\n\t\t\ttype: String,\n\t\t},\n\t},\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-open\n * @allowPreventDefault\n * @since 1.10.0\n */\n@event(\"before-open\")\n\n/**\n * Fired after the menu is opened. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-open\n * @since 1.10.0\n */\n@event(\"after-open\")\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-close\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that <code>ESC</code> key has triggered the event.\n * @since 1.10.0\n */\n@event(\"before-close\", {\n\tdetail: {\n\t\tescPressed: { type: Boolean },\n\t},\n})\n\n/**\n * Fired after the menu is closed. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-close\n * @since 1.10.0\n */\n@event(\"after-close\")\nclass Menu extends UI5Element {\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.headerText\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\theaderText!: string;\n\n\t/**\n\t * Indicates if the menu is open\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.open\n\t * @public\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen!:boolean;\n\n\t/**\n\t * Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.busy\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tbusy!: boolean;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover..\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.busyDelay\n\t * @type {sap.ui.webc.base.types.Integer}\n\t * @defaultValue 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ validator: Integer, defaultValue: 1000 })\n\tbusyDelay!: number;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element that the menu is shown at\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.opener\n\t * @public\n\t * @type {sap.ui.webc.base.types.DOMReference}\n\t * @defaultvalue \"\"\n\t * @since 1.10.0\n\t */\n\t@property({ validator: DOMReference, defaultValue: \"\" })\n\topener!: HTMLElement | string;\n\n\t/**\n\t * Defines if the menu is sub-menu (not first-level).\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_isSubMenu!: boolean;\n\n\t/**\n\t * Stores id of a list item that opened sub-menu.\n\t * @type {string}\n\t * @private\n\t */\n\t@property()\n\t_subMenuOpenerId!: string;\n\n\t/**\n\t * Defines the currently available menu items.\n\t * (in case of non-phone devices these are the items of the menu,\n\t * but for phone devices the items of the currently opened sub-menu\n\t * will be populated here)\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_currentItems!: Array<CurrentItem>;\n\n\t/**\n\t * Stores a list of parent menu items for each sub-menu (on phone).\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_parentItemsStack!: Array<MenuItem>;\n\n\t/**\n\t * Stores the ResponsivePopover instance\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_popover?: ResponsivePopover;\n\n\t/**\n\t * Stores parent menu item (if there is such).\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_parentMenuItem?: MenuItem;\n\n\t/**\n\t * Stores menu item that have sub-menu opened.\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_openedSubMenuItem?: MenuItem;\n\n\t/**\n\t * Defines the items of this component.\n\t * <br><br>\n\t * <b>Note:</b> Use <code>ui5-menu-item</code> for the intended design.\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.default\n\t * @type {sap.ui.webc.main.IMenuItem[]}\n\t * @slot items\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<MenuItem>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tMenu.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget itemsWithChildren() {\n\t\treturn !!this._currentItems.filter(item => item.item.items.length).length;\n\t}\n\n\tget itemsWithIcon() {\n\t\treturn !!this._currentItems.filter(item => item.item.icon !== \"\").length;\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget placementType() {\n\t\tconst placement = this.isRtl ? \"Left\" : \"Right\";\n\t\treturn this._isSubMenu ? placement : \"Bottom\";\n\t}\n\n\tget verticalAlign() {\n\t\treturn this._isSubMenu ? \"Top\" : \"Bottom\";\n\t}\n\n\tget labelBack() {\n\t\treturn Menu.i18nBundle.getText(MENU_BACK_BUTTON_ARIA_LABEL);\n\t}\n\n\tget labelClose() {\n\t\treturn Menu.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget isSubMenuOpened() {\n\t\treturn !!this._parentMenuItem;\n\t}\n\n\tget menuHeaderTextPhone() {\n\t\treturn this._parentMenuItem ? this._parentMenuItem.text : this.headerText;\n\t}\n\n\tonBeforeRendering() {\n\t\t!isPhone() && this._prepareCurrentItems(this.items);\n\n\t\tconst itemsWithChildren = this.itemsWithChildren;\n\t\tconst itemsWithIcon = this.itemsWithIcon;\n\n\t\tthis._currentItems.forEach(item => {\n\t\t\titem.item._siblingsWithChildren = itemsWithChildren;\n\t\t\titem.item._siblingsWithIcon = itemsWithIcon;\n\t\t\tif (item.item._subMenu) {\n\t\t\t\titem.item._subMenu.busy = item.item.busy;\n\t\t\t\titem.item._subMenu.busyDelay = item.item.busyDelay;\n\t\t\t}\n\t\t});\n\t}\n\n\tonAfterRendering() {\n\t\tif (!this.opener) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.open) {\n\t\t\tconst rootNode = this.getRootNode() as Document;\n\t\t\tconst opener = this.opener instanceof HTMLElement ? this.opener : rootNode && rootNode.getElementById(this.opener);\n\n\t\t\tif (opener) {\n\t\t\t\tthis.showAt(opener);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/**\n\t * Shows the Menu near the opener element.\n\t * @param {HTMLElement} opener the element that the popover is shown at\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#showAt\n\t */\n\tasync showAt(opener: HTMLElement) {\n\t\tif (isPhone()) {\n\t\t\tthis._prepareCurrentItems(this.items);\n\t\t\tthis._parentItemsStack = [];\n\t\t}\n\t\tif (!this._isSubMenu) {\n\t\t\tthis._parentMenuItem = undefined;\n\t\t}\n\t\tconst popover = await this._createPopover();\n\t\tpopover.initialFocus = \"\";\n\t\tfor (let index = 0; index < this._currentItems.length; index++) {\n\t\t\tif (!this._currentItems[index].item.disabled) {\n\t\t\t\tpopover.initialFocus = `${this._id}-menu-item-${index}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpopover.showAt(opener);\n\t}\n\n\t/**\n\t * Closes the Menu.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#close\n\t */\n\tclose() {\n\t\tif (this._popover) {\n\t\t\tif (isPhone()) {\n\t\t\t\tthis._parentItemsStack = [];\n\t\t\t}\n\t\t\tthis._popover.close();\n\t\t\tthis._popover.resetFocus();\n\t\t}\n\t}\n\n\tasync _createPopover() {\n\t\tconst staticAreaItemDomRef = await this.getStaticAreaItemDomRef();\n\t\tthis._popover = staticAreaItemDomRef!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t\treturn this._popover;\n\t}\n\n\t_navigateBack() {\n\t\tconst parentMenuItem = this._parentItemsStack.pop();\n\n\t\tthis.focus();\n\t\tif (parentMenuItem) {\n\t\t\tconst parentMenuItemParent = parentMenuItem.parentElement as MenuItem;\n\t\t\tthis._prepareCurrentItems(parentMenuItemParent.items);\n\t\t\tthis._parentMenuItem = this._parentItemsStack.length ? this._parentItemsStack[this._parentItemsStack.length - 1] : undefined;\n\t\t}\n\t}\n\n\t_prepareCurrentItems(items: Array<MenuItem>) {\n\t\tthis._currentItems = items.map((item, index) => {\n\t\t\treturn {\n\t\t\t\titem,\n\t\t\t\tposition: index + 1,\n\t\t\t\tariaHasPopup: item.hasSubmenu ? \"menu\" : undefined,\n\t\t\t};\n\t\t});\n\t}\n\n\t_createSubMenu(item: MenuItem, openerId: string) {\n\t\tconst ctor = this.constructor as typeof Menu;\n\t\tconst subMenu = document.createElement(ctor.getMetadata().getTag()) as Menu;\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tsubMenu._isSubMenu = true;\n\t\tsubMenu.setAttribute(\"id\", `submenu-${openerId}`);\n\t\tsubMenu._parentMenuItem = item;\n\t\tsubMenu.busy = item.busy;\n\t\tsubMenu.busyDelay = item.busyDelay;\n\t\tconst subItems = item.children;\n\t\tlet clonedItem,\n\t\t\tidx;\n\t\tfor (idx = 0; idx < subItems.length; idx++) {\n\t\t\tclonedItem = subItems[idx].cloneNode(true);\n\t\t\tfragment.appendChild(clonedItem);\n\t\t}\n\t\tsubMenu.appendChild(fragment);\n\t\tthis.staticAreaItem!.shadowRoot!.querySelector(\".ui5-menu-submenus\")!.appendChild(subMenu);\n\t\titem._subMenu = subMenu;\n\t}\n\n\t_openItemSubMenu(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\titem._subMenu!.showAt(opener);\n\t\titem._preventSubMenuClose = true;\n\t\tthis._openedSubMenuItem = item;\n\t\tthis._subMenuOpenerId = actionId;\n\t}\n\n\t_closeItemSubMenu(item: MenuItem, forceClose = false) {\n\t\tif (item) {\n\t\t\tif (forceClose) {\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeSubMenuPopover(item._subMenu!, true);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => this._closeSubMenuPopover(item._subMenu!), 0);\n\t\t\t}\n\t\t}\n\t}\n\n\t_closeSubMenuPopover(subMenu: Menu, forceClose = false) {\n\t\tif (subMenu) {\n\t\t\tconst parentItem = subMenu._parentMenuItem!;\n\n\t\t\tif (forceClose || !parentItem._preventSubMenuClose) {\n\t\t\t\tsubMenu.close();\n\t\t\t\tsubMenu.remove();\n\t\t\t\tparentItem._subMenu = undefined;\n\t\t\t\tthis._openedSubMenuItem = undefined;\n\t\t\t\tthis._subMenuOpenerId = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t_prepareSubMenuDesktopTablet(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\tif (actionId !== this._subMenuOpenerId || (item && item.hasSubmenu)) {\n\t\t\t// close opened sub-menu if there is any opened\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem!, true);\n\t\t}\n\t\tif (item && item.hasSubmenu) {\n\t\t\t// create new sub-menu\n\t\t\tthis._createSubMenu(item, actionId);\n\t\t\tthis._openItemSubMenu(item, opener, actionId);\n\t\t}\n\t\tif (this._parentMenuItem) {\n\t\t\tthis._parentMenuItem._preventSubMenuClose = true;\n\t\t}\n\t}\n\n\t_prepareSubMenuPhone(item: MenuItem) {\n\t\tthis._prepareCurrentItems(item.items);\n\t\tthis._parentMenuItem = item;\n\t\tthis._parentItemsStack.push(item);\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\topener.focus();\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t}\n\t}\n\n\t_busyMouseOver() {\n\t\tif (this._parentMenuItem) {\n\t\t\tthis._parentMenuItem._preventSubMenuClose = true;\n\t\t}\n\t}\n\n\t_itemMouseOut(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\n\t\t\tif (item && item.hasSubmenu && item._subMenu) {\n\t\t\t\t// try to close the sub-menu\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeItemSubMenu(item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tconst isMenuClose = this.isRtl ? isRight(e) : isLeft(e);\n\t\tconst isMenuOpen = this.isRtl ? isLeft(e) : isRight(e);\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tif (isMenuOpen) {\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\titem.hasSubmenu && this._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t} else if (isMenuClose && this._isSubMenu && this._parentMenuItem) {\n\t\t\tconst parentMenuItemParent = this._parentMenuItem.parentElement as Menu;\n\t\t\tparentMenuItemParent._closeItemSubMenu(this._parentMenuItem, true);\n\t\t}\n\t}\n\n\t_itemClick(e: CustomEvent<ClickEventDetail>) {\n\t\tconst opener = e.detail.item as OpenerStandardListItem;\n\t\tconst item = opener.associatedItem;\n\t\tconst actionId = opener.getAttribute(\"id\")!;\n\n\t\tif (!item.hasSubmenu) {\n\t\t\t// click on an item that doesn't have sub-items fires an \"item-click\" event\n\t\t\tif (!this._isSubMenu) {\n\t\t\t\tif (isPhone()) {\n\t\t\t\t\tthis._parentMenuItem = undefined;\n\t\t\t\t}\n\t\t\t\t// fire event if the click is on top-level menu item\n\t\t\t\tthis.fireEvent(\"item-click\", {\n\t\t\t\t\t\"item\": item,\n\t\t\t\t\t\"text\": item.text,\n\t\t\t\t});\n\t\t\t\tthis._popover!.close();\n\t\t\t} else {\n\t\t\t\t// find top-level menu and redirect event to it\n\t\t\t\tlet parentMenu = item.parentElement as Menu;\n\t\t\t\twhile (parentMenu._parentMenuItem) {\n\t\t\t\t\tparentMenu._parentMenuItem._preventSubMenuClose = false;\n\t\t\t\t\tthis._closeItemSubMenu(parentMenu._parentMenuItem);\n\t\t\t\t\tparentMenu = parentMenu._parentMenuItem.parentElement as Menu;\n\t\t\t\t}\n\t\t\t\tparentMenu._itemClick(e);\n\t\t\t}\n\t\t} else if (isPhone()) {\n\t\t\t// prepares and opens sub-menu on phone\n\t\t\tthis._prepareSubMenuPhone(item);\n\t\t} else if (isTablet()) {\n\t\t\t// prepares and opens sub-menu on tablet\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, actionId);\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = false;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.open = true;\n\t\tthis.fireEvent(\"after-open\");\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent(\"before-close\", { escPressed: e.detail.escPressed }, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._openedSubMenuItem) {\n\t\t\tthis._openedSubMenuItem._preventSubMenuClose = false;\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem);\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireEvent(\"after-close\");\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\n"]}
|
package/dist/MenuItem.d.ts
CHANGED
|
@@ -81,6 +81,28 @@ declare class MenuItem extends UI5Element {
|
|
|
81
81
|
* @public
|
|
82
82
|
*/
|
|
83
83
|
disabled: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.
|
|
86
|
+
*
|
|
87
|
+
* Note: If set to <code>true</code> a <code>ui5-busy-indicator</code> component will be displayed into the related one to the current <code>ui5-menu-item</code> sub-menu popover.
|
|
88
|
+
*
|
|
89
|
+
* @name sap.ui.webc.main.MenuItem.prototype.busy
|
|
90
|
+
* @type {boolean}
|
|
91
|
+
* @defaultvalue false
|
|
92
|
+
* @public
|
|
93
|
+
* @since 1.13.0
|
|
94
|
+
*/
|
|
95
|
+
busy: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.
|
|
98
|
+
*
|
|
99
|
+
* @name sap.ui.webc.main.MenuItem.prototype.busyDelay
|
|
100
|
+
* @type {sap.ui.webc.base.types.Integer}
|
|
101
|
+
* @defaultValue 1000
|
|
102
|
+
* @public
|
|
103
|
+
* @since 1.13.0
|
|
104
|
+
*/
|
|
105
|
+
busyDelay: number;
|
|
84
106
|
/**
|
|
85
107
|
* Defines the accessible ARIA name of the component.
|
|
86
108
|
*
|
|
@@ -116,7 +138,7 @@ declare class MenuItem extends UI5Element {
|
|
|
116
138
|
* @public
|
|
117
139
|
*/
|
|
118
140
|
items: Array<MenuItem>;
|
|
119
|
-
get
|
|
141
|
+
get hasSubmenu(): boolean;
|
|
120
142
|
get hasDummyIcon(): boolean;
|
|
121
143
|
get subMenuOpened(): boolean;
|
|
122
144
|
get _additionalText(): string;
|
package/dist/MenuItem.js
CHANGED
|
@@ -8,6 +8,7 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
8
8
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
9
9
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
10
10
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
11
|
+
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
11
12
|
/**
|
|
12
13
|
* @class
|
|
13
14
|
*
|
|
@@ -37,8 +38,8 @@ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
|
37
38
|
* @public
|
|
38
39
|
*/
|
|
39
40
|
let MenuItem = class MenuItem extends UI5Element {
|
|
40
|
-
get
|
|
41
|
-
return !!this.items.length;
|
|
41
|
+
get hasSubmenu() {
|
|
42
|
+
return !!(this.items.length || this.busy);
|
|
42
43
|
}
|
|
43
44
|
get hasDummyIcon() {
|
|
44
45
|
return this._siblingsWithIcon && !this.icon;
|
|
@@ -47,7 +48,7 @@ let MenuItem = class MenuItem extends UI5Element {
|
|
|
47
48
|
return !!this._subMenu;
|
|
48
49
|
}
|
|
49
50
|
get _additionalText() {
|
|
50
|
-
return this.
|
|
51
|
+
return this.hasSubmenu ? "" : this.additionalText;
|
|
51
52
|
}
|
|
52
53
|
get ariaLabelledByText() {
|
|
53
54
|
return `${this.text} ${this.accessibleName}`.trim();
|
|
@@ -68,6 +69,12 @@ __decorate([
|
|
|
68
69
|
__decorate([
|
|
69
70
|
property({ type: Boolean })
|
|
70
71
|
], MenuItem.prototype, "disabled", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
property({ type: Boolean })
|
|
74
|
+
], MenuItem.prototype, "busy", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ validator: Integer, defaultValue: 1000 })
|
|
77
|
+
], MenuItem.prototype, "busyDelay", void 0);
|
|
71
78
|
__decorate([
|
|
72
79
|
property()
|
|
73
80
|
], MenuItem.prototype, "accessibleName", void 0);
|
package/dist/MenuItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,OAAO,MAAM,+CAA+C,CAAC;AAGpE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAwIhC,IAAI,UAAU;QACb,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,YAAY;QACf,OAAO,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC7C,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IACxB,CAAC;IAED,IAAI,eAAe;QAClB,OAAO,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;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport type Menu from \"./Menu.js\";\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <code>ui5-menu-item</code> is the item to use inside a <code>ui5-menu</code>.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * <h3>Usage</h3>\n *\n * <code>ui5-menu-item</code> is an abstract element, representing a node in a <code>ui5-menu</code>. The menu itself is rendered as a list,\n * and each <code>ui5-menu-item</code> is represented by a list item (<code>ui5-li</code>) in that list. Therefore, you should only use\n * <code>ui5-menu-item</code> directly in your apps. The <code>ui5-li</code> list item is internal for the list, and not intended for public use.\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/MenuItem.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.MenuItem\n * @extends sap.ui.webc.base.UI5Element\n * @abstract\n * @tagname ui5-menu-item\n * @implements sap.ui.webc.main.IMenuItem\n * @since 1.3.0\n * @public\n */\n@customElement(\"ui5-menu-item\")\nclass MenuItem extends UI5Element {\n\t/**\n\t * Defines the text of the tree item.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.text\n\t * @type {string}\n\t * @defaultValue \"\"\n\t * @public\n\t */\n\t@property()\n\ttext!: string;\n\n\t/**\n\t * Defines the <code>additionalText</code>, displayed in the end of the menu item.\n\t * <b>Note:</b> The additional text would not be displayed if the item has a submenu.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.additionalText\n\t * @type {string}\n\t * @public\n\t * @since 1.8.0\n\t */\n\t@property()\n\tadditionalText!: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t * <br><br>\n\t <b>* Example:</b>\n\t * See all the available icons in the <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">Icon Explorer</ui5-link>.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.icon\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\ticon!: string;\n\n\t/**\n\t * Defines whether a visual separator should be rendered before the item.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.startsSection\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tstartsSection!: boolean;\n\n\t/**\n\t * Defines whether <code>ui5-menu-item</code> is in disabled state.\n\t * <br><br>\n\t * <b>Note:</b> A disabled <code>ui5-menu-item</code> is noninteractive.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.disabled\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled!: boolean;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * Note: If set to <code>true</code> a <code>ui5-busy-indicator</code> component will be displayed into the related one to the current <code>ui5-menu-item</code> sub-menu popover.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.busy\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tbusy!: boolean;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.busyDelay\n\t * @type {sap.ui.webc.base.types.Integer}\n\t * @defaultValue 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ validator: Integer, defaultValue: 1000 })\n\tbusyDelay!: number;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.accessibleName\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@property()\n\taccessibleName!: string;\n\n\t/**\n\t * Indicates whether any of the element siblings have children items.\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_siblingsWithChildren!: boolean;\n\n\t/**\n\t * Indicates whether any of the element siblings have icon.\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_siblingsWithIcon!: boolean;\n\n\t/**\n\t * Defines whether the submenu closing must be prevented\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_preventSubMenuClose!: boolean;\n\n\t/**\n\t * Stores Menu object with submenu items\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_subMenu?: Menu;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.default\n\t * @type {sap.ui.webc.main.IMenuItem[]}\n\t * @slot items\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<MenuItem>;\n\n\tget hasSubmenu() {\n\t\treturn !!(this.items.length || this.busy);\n\t}\n\n\tget hasDummyIcon() {\n\t\treturn this._siblingsWithIcon && !this.icon;\n\t}\n\n\tget subMenuOpened() {\n\t\treturn !!this._subMenu;\n\t}\n\n\tget _additionalText() {\n\t\treturn this.hasSubmenu ? \"\" : this.additionalText;\n\t}\n\n\tget ariaLabelledByText() {\n\t\treturn `${this.text} ${this.accessibleName}`.trim();\n\t}\n}\n\nMenuItem.define();\n\nexport default MenuItem;\n"]}
|
package/dist/Tab.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ declare class Tab extends UI5Element implements ITab, ITabbable {
|
|
|
40
40
|
*/
|
|
41
41
|
disabled: boolean;
|
|
42
42
|
/**
|
|
43
|
-
* Represents the "additionalText" text, which is displayed in the tab.
|
|
43
|
+
* Represents the "additionalText" text, which is displayed in the tab. In the cases when in the same time there are tabs with icons and tabs without icons, if a tab has no icon the "additionalText" is displayed larger.
|
|
44
44
|
* @type {string}
|
|
45
45
|
* @defaultvalue ""
|
|
46
46
|
* @public
|